[
  {
    "path": ".github/SUPPORT.md",
    "content": "# Feathers Help & Support\n\nLooking for some help with [Feathers](https://feathersui.com/learn/as3-starling/)? Start by visiting the [the official Starling Framework forum](http://forum.starling-framework.org/) and create a thread in the [Feathers section](http://forum.starling-framework.org/forum/feathers). You'll get help from a community of experts, including [Josh Tynjala](https://joshblog.net/), the creator of Feathers!\n\n## Additional Resources\n\n* [Feathers (Starling) Documentation](https://feathersui.com/learn/as3-starling/)\n* [Feathers (Starling) API Reference](https://feathersui.com/api-reference/)"
  },
  {
    "path": ".github/workflows/package-feathersui.yml",
    "content": "name: Package Feathers UI for Starling\n\non:\n  push:\n    branches:\n      - master\n  pull_request:\n    branches:\n      - master\n\njobs:\n  build:\n    runs-on: macos-latest\n\n    steps:\n      - uses: actions/checkout@v4\n      - uses: actions/setup-java@v4\n        with:\n          java-version: 11\n          distribution: \"temurin\"\n      - uses: joshtynjala/setup-adobe-air-action@v2\n        with:\n          air-version: \"33.1\"\n          accept-license: true\n      - uses: joshtynjala/setup-adobe-flash-player-action@v1\n      - name: Install dependencies\n        run: |\n          wget -O playerglobal.swc https://fpdownload.macromedia.com/get/flashplayer/updaters/32/playerglobal32_0.swc\n          mkdir ${{ env.AIR_HOME }}/frameworks/libs/player/11.1/\n          cp -f playerglobal.swc ${{ env.AIR_HOME }}/frameworks/libs/player/11.1/\n          wget -O flexunit.zip http://mirrors.ibiblio.org/apache/flex/flexunit/4.2.0/binaries/apache-flex-flexunit-4.2.0-4.12.0-bin.zip\n          unzip -q flexunit.zip\n          rm flexunit/flexunit-4.2.0-20140410-flex_4.12.0.swc\n      - name: Checkout Starling\n        run: |\n          git clone https://github.com/Gamua/Starling-Framework $GITHUB_WORKSPACE/starling --depth 1\n      - name: Ant Build\n        run: |\n          ant full -Dflashsdk.root=\"${{ env.AIR_HOME }}\" -Dstarling.root=\"$GITHUB_WORKSPACE/starling/starling/src\" -Dflexunit.root=\"$GITHUB_WORKSPACE/flexunit\" -Dflashplayer=\"/usr/local/bin/flashplayer\"\n      - name: Example Ant Build - ComponentsExplorer\n        working-directory: examples/ComponentsExplorer\n        run: |\n          ant build-web -Dflashsdk.root=\"${{ env.AIR_HOME }}\" -Dstarling.root=\"$GITHUB_WORKSPACE/starling/starling/src\"\n      - name: Example Ant Build - DragAndDrop\n        working-directory: examples/DragAndDrop\n        run: |\n          ant build -Dflashsdk.root=\"${{ env.AIR_HOME }}\" -Dstarling.root=\"$GITHUB_WORKSPACE/starling/starling/src\"\n      - name: Example Ant Build - DrawersExplorer\n        working-directory: examples/DrawersExplorer\n        run: |\n          ant build-web -Dflashsdk.root=\"${{ env.AIR_HOME }}\" -Dstarling.root=\"$GITHUB_WORKSPACE/starling/starling/src\"\n      - name: Example Ant Build - HelloWorld\n        working-directory: examples/HelloWorld\n        run: |\n          ant build-web -Dflashsdk.root=\"${{ env.AIR_HOME }}\" -Dstarling.root=\"$GITHUB_WORKSPACE/starling/starling/src\"\n      - name: Example Ant Build - LayoutExplorer\n        working-directory: examples/LayoutExplorer\n        run: |\n          ant build-web -Dflashsdk.root=\"${{ env.AIR_HOME }}\" -Dstarling.root=\"$GITHUB_WORKSPACE/starling/starling/src\"\n      - name: Example Ant Build - Magic8Chat\n        working-directory: examples/Magic8Chat\n        run: |\n          ant build-web -Dflashsdk.root=\"${{ env.AIR_HOME }}\" -Dstarling.root=\"$GITHUB_WORKSPACE/starling/starling/src\"\n      - name: Example Ant Build - PullToRefresh\n        working-directory: examples/PullToRefresh\n        run: |\n          ant build-web -Dflashsdk.root=\"${{ env.AIR_HOME }}\" -Dstarling.root=\"$GITHUB_WORKSPACE/starling/starling/src\"\n      - name: Example Ant Build - StackScreenNavigatorExplorer\n        working-directory: examples/StackScreenNavigatorExplorer\n        run: |\n          ant build-web -Dflashsdk.root=\"${{ env.AIR_HOME }}\" -Dstarling.root=\"$GITHUB_WORKSPACE/starling/starling/src\"\n      - name: Example Ant Build - Tabs\n        working-directory: examples/Tabs\n        run: |\n          ant build-web -Dflashsdk.root=\"${{ env.AIR_HOME }}\" -Dstarling.root=\"$GITHUB_WORKSPACE/starling/starling/src\"\n      - name: Example Ant Build - TileList\n        working-directory: examples/TileList\n        run: |\n          ant build-web -Dflashsdk.root=\"${{ env.AIR_HOME }}\" -Dstarling.root=\"$GITHUB_WORKSPACE/starling/starling/src\"\n      - name: Example Ant Build - Todos\n        working-directory: examples/Todos\n        run: |\n          ant build-web -Dflashsdk.root=\"${{ env.AIR_HOME }}\" -Dstarling.root=\"$GITHUB_WORKSPACE/starling/starling/src\"\n      - name: Example Ant Build - TrainTimes\n        working-directory: examples/TrainTimes\n        run: |\n          ant build-web -Dflashsdk.root=\"${{ env.AIR_HOME }}\" -Dstarling.root=\"$GITHUB_WORKSPACE/starling/starling/src\"\n      - name: Example Ant Build - TransitionsExplorer\n        working-directory: examples/TransitionsExplorer\n        run: |\n          ant build-web -Dflashsdk.root=\"${{ env.AIR_HOME }}\" -Dstarling.root=\"$GITHUB_WORKSPACE/starling/starling/src\"\n      - name: Example Ant Build - YouTubeFeeds\n        working-directory: examples/YouTubeFeeds\n        run: |\n          ant build-web -Dyoutube.api.key=abc123 -Dflashsdk.root=\"${{ env.AIR_HOME }}\" -Dstarling.root=\"$GITHUB_WORKSPACE/starling/starling/src\"\n      - uses: actions/upload-artifact@v4\n        with:\n          name: feathersui-starling\n          path: output\n          if-no-files-found: error"
  },
  {
    "path": ".gitignore",
    "content": ".DS_Store\nThumbs.db\n*.swc\n*.stackdump\n._*\n*.local.properties\n*.p12\nout/\noutput/\nthird-party/\nsigning/\n.actionScriptProperties\n.flexLibProperties\n.project\nasconfig.json\n.settings/\nbin-debug/\nbin-release/\nhtml-template/\n.metadata/\n*.iml\n.idea/\narchive/\n*.lnk\n.vscode/\n*.code-workspace\npackage-lock.json"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# Feathers UI Release Notes\n\nNoteworthy changes in official, stable releases of [Feathers UI](https://feathersui.com/).\n\n## 4.2.0 - 2021\n\n## 4.1.1 - May 2020\n\n* FeathersControl: Fixed issue where super.visible was never set to false at the completion of a hideEffect.\n* Scroller: Fixed issue where scroller actualWidth was incorrectly passed to view port minVisibleWidth instead of actualMinWidth.\n\n## 4.1.0 - February 2020\n\n* Targets Starling 2.6.\n* DefaultTreeItemRenderer: Fixed issue where icons and other styles were not properly restricted, when set outside of a theme.\n* Effects: Fixed issue where tween delay was not included in total time.\n* FeathersControl: Fixed issue where a null reference error could be thrown when removing a component in the parent's Event.ADDED_TO_STAGE listener.\n* FeathersControl: Fixed issue where setting visible to the same value before showEffect or hideEffect completed would incorrectly interrupt the effect.\n* List: Fixed issue where accessories/icons would disappear when displaying the drag-and-drop avatar.\n* Scroller: Fixed issue where a null reference error could be thrown in the mouse wheel handler.\n* Toast: added openEffect, which is triggered after the parent container has run its layout code. Event.OPEN is dispatched when this effect is complete.\n* WebView: Fixed issue where the height incorrectly defaulted to the same value as the width.\n\n## 4.0.0 - January 2019\n\nSee the [Feathers 4.0 Migration Guide](https://feathersui.com/help/migration-guide-4.0.html) for details about how to upgrade to Feathers 4.0 from previous versions.\n\n* Drag and drop: Added support for drag-and-drop in List and TabBar components.\n* Toast: New component for displaying in-app notifications.\n* Removed APIs that were deprecated in Feathers 3.x.\n* Button: Fixed issue where scaleWhenDown or scaleWhenHovering could get stuck when returning back to a scale of 1, if no other changes to the button state resulted in a call to setRequiresRedraw().\n* DataGrid: Fixed issue where multiple cells could be incorrectly deselected when allowMultipleSelection is true.\n* DataGrid: Fixed issue where measurement did not account for total combined width of headers.\n* DefaultDataGridCellRenderer: If dataField is null, uses the data for the entire row instead.\n* FeathersEventType: Fixed typo in \"stateChange\" string.\n* HorizontalLayout: Fixed issue where distributeWidths did not properly use the largest item width when the container's explicit width was not set.\n* Header: Added detection for iPhone XS, XS Max, and XR to increase status bar height for notch.\n* ImageLoader: Added new style property to support a custom MeshStyle.\n* KeyToEvent, KeyToSelect, KeyToState: Fixed null reference error in KeyboardEvent.KEY_DOWN listener if target lost focus before listener was called.\n* Navigators: Fixed issue where transitionDElayEvent was ignored if it was dispatched before CREATION_COMPLETE.\n* SimpleScrollBar, ScrollBar: Added fixedThumbSize style to allow the thumb size to remain fixed, even when the scrolling range changes.\n* Scroller: Fixed issue where pressing left key on keyboard incorrectly jumped to maximum horizontal scroll position.\n* Scroller: Fixed issue where scrolling was possible with keyboard when using ScrollPolicy.OFF.\n* Scroller: Fixed null reference error caused by removing mask from leftPullView instead of topPullView when changing the topPullView.\n* Scroller: Fixed issue where touching a container with snapToPages set to true while it was animating might not continue the animation if needed after TouchPhase.ENDED.\n* Slider: Fixed issue where touching track with TrackInteractionMode.TO_VALUE would incorrectly limit the range if minimumPadding or maximumPadding is negative.\n* SpinnerList: Fixed issue where removing from stage before animation completed could change the selectedIndex unexpectedly.\n* StageTextTextEditor: Fixed issue where a very large width or height would cause the text editor to be positioned below the minimum allowed position.\n* TextArea: Added prompt property, similar to TextInput.\n* TextArea: Added innerPadding styles to add padding around both prompt and the text in the view port. Breaking change: You must inner padding on the TextArea instead of setting the padding property on TextFieldTextEditorViewPort.\n* TextBlockTextRenderer: Fixed issue where the measurement might be wrong if width of height set to negative values.\n* TextBlockTextRenderer: Fixed issue where height measurement might be wrong when using starling.text.TextFormat.\n* TextBlockTextRenderer, TextFieldTextRenderer: fixed issue where texture was offset and cut off on context resture when using vertical align in starling.text.TextFormat.\n* TextBlockTextRenderer: fixed issue where measurement was wrong when using nativeFilters property.\n* Themes: Use new starling.assets.AssetManager.\n* Todos Example: Can reorder items with drag and drop.\n* Todos Example: Persists todos with SharedObject.\n* ToggleButton: Fixed issue where the scale for the current state was incorrect when selected.\n* ToolTipManager: Fixed cast that incorrectly required all custom tooltips to extend Label instead of implement the IToolTip interface.\n* VideoPlayer: Automatically calls setRequiresRedraw() during playback so that skipUnchangedFrames may remain enabled.\n\n## 3.5.0 - June 2018\n\n* AnchorLayout: fixed issue where measurement could be incorrect when using horizontalCenter or verticalCenter.\n* BitmapFontTextEditor, TextBlockTextEditor: added Shift+Home, Shift+End, Shift+Up, and Shift+Down keyboard shortcuts.\n* BitmapFontTextEditor, TextBlockTextEditor: when pasting text, new lines are removed because TextInput displays only a single line.\n* BitmapFontTextEditor, TextBlockTextEditor: fixed issue where soft keyboard incorrectly opened on mobile when not editable.\n* BitmapFontTextEditor, TextBlockTextEditor, TextFieldTextEditor: fixed issue where touching outside the text editor incorrectly cleared focus when the FocusManager was enabled (it should only do that without a FocusManager).\n* BottomDrawerPopUpContentManager: added panelFactory and closeButtonFactory to allow these components to be more easily customized.\n* DataGrid, List, TabBar: fixed issue where sorting the collection did not update the selected indices.\n* DateTimeSpinner: fixed issue where the 31st of a month that actually has fewer days could be selected when switching to that month from a different month that has 31 days.\n* DateTimeSpinner: fixed issue where Event.CHANGE could be dispatched when the selected date had not changed.\n* DeviceCapabilities: added isLargePhone() method to check for plus-sized phones (sometimes called \"phablets\").\n* DeviceCapabilities: isPhone(), isTablet(), and isLargePhone() methods now use both portrait and landscape sizes to determine the correct classification for a device because it is more accurate.\n* Effects: Added new built-in animations that can be used by components. Includes Move, Resize, Fade, Iris, Wipe, Sequence, and Parallel.\n* FeathersControl: Listens for Event.CHANGE on IStyleProvider to allow themes to modify their style providers and have changes reflected automatically.\n* FeathersControl: added showEffect, hideEffect, moveEffect, resizeEffect, focusInEffect, focusOutEffect, addedEffect, and removeFromParentWithEffect().\n* fontStyles: In addition to restricting this style when the property is set, also listens for Event.CHANGE.\n* GroupedList, Tree: fixed issue where using a data provider that returned XML could cause runtime errors because the item renderer could not be found.\n* Header: improved \"extra\" top padding for iPhone X when app is not full screen.\n* HorizontalLayout, VerticalLayout: fixed issue where scaleX and scaleY were not accounted for when an item uses pivotX or pivotY.\n* ImageLoader: added loaderContext property to support a custom flash.system.LoaderContext.\n* List: added addItemWithEffect() and removeItemWithEffect().\n* LongPress: fixed issue where the Event.ENTER_FRAME listener was not removed if the target were set to null before the touch ended.\n* nativeToGlobal: utility function similar to localToGlobal(), except converting between native stage coordinates and global Starling coordinates.\n* ProgressBar: if the fill skin has a minimum size, and the progress bar's value is equal to its minimum value, the fill skin is hidden.\n* Scroller: fixed issue where a null reference error could be thrown in the TouchEvent.TOUCH listener under certain conditions.\n* Scroller: if thrown, a new touch automatically stops scrolling and once again requires dragging a minimum distance to start scrolling. This more closely matches native behavior to allow other containers to take over scrolling if dragged in a new direction.\n* Scroller: fixed issue where items in the view port might not be positioned correctly when snapScrollPositionsToPixels is true, causing jittery scrolling as items jump between pixels.\n* ScrollText: added outerPadding, outerPaddingTop, outerPaddingRight, outerPaddingBottom, and outerPaddingLeft properties.\n* Slider: fixed issue where thumb did not go into down state when using TrackInteractionMode.TO_VALUE.\n* SpinnerList: Fixed issue where performance could drop temporarily when transitioning from the end back to the beginning (or vice versa) when items repeat.\n* SpinnerList: fixed missing calls to processStyleRestriction() for showSelectionOverlay and hideSelectionOverlayUnlessFocused.\n* StackScreenNavigator: added isSwipeToPopEnabled property to activate a swipe gesture to navigate back in history.\n* StackScreenNavigator: fixed issue where Event.CHANGE was not dispatched again after a transition was cancelled.\n* StageTextTextEditor: fixed issue where focus was lost after touching an object with a focus owner, and the focus owner contains the TextInput.\n* TextFieldTextEditor: added softKeyboard property to allow the soft keyboard to be customized on mobile.\n* TextFieldTextEditor: added resetScrollOnFocusOut property, which is true by default.\n* TextFieldTextRenderer, TextFieldTextEditor: useGutter property is automatically forced to true if the border property is set to true so that the border is not clipped.\n* TextInput: fixed issue where a text editor might not receive focus if the TextInput moves between TouchPhase.BEGAN and TouchPhase.ENDED.\n* Themes: fixed issue where pivots in texture atlas caused some skins to appear at incorrect locations with Starling 2.3.\n* TiledColumnsLayout: fixed issue where the columns could be incorrectly aligned horizontally when alignment should not be possible.\n* TiledColumnsLayout: fixed issue where an incorrect number of visible columns was calculated when distributeHeights is true.\n* TiledColumnsLayout: if distributeWidths is set to true, useSquareTiles is changed to false automatically (or distributeWidths would have no effect).\n* TiledRowsLayout: if distributeHeights is set to true, useSquareTiles is changed to false automatically (or distributeHeights would have no effect).\n* Tree: added scrollToDisplayLocation() method.\n* ValidationQueue: reduced memory allocations to avoid unnecessary garbage collection.\n* VectorHierarchicalCollection: Fixed issue that caused compilation to fail with classic Adobe Flex SDK.\n* VerticalLayout: fixed issue where a sticky header might disappear too early if paddingTop is greater than zero.\n* VideoPlayer: added missing API documentation for FeathersEventType.ERROR.\n\n## 3.4.1 - February 2018\n\n* AnchorLayout: Fixed issue where x and y properties might not be accounted for in measurement if item had AnchorLayoutData, but didn't set left and top.\n* BitmapFontTextEditor: Fixed issue where the cursor and selection might be positioned incorrectly when alignment is center or right.\n* BitmapFontTextRenderer: Fixed issue where a new MeshStyle could be created too frequently when getDefaultMeshStyle() returns null.\n* DataGrid: Fixed issue where reordering the columns might not reorder the column headers if the columns were generated automatically.\n* DateTimeSpinner: Fixed issue where the default maximum date near the end of a year when using DateTimeMode.DATE_AND_TIME was not far enough into the future.\n* FDT: Fixed some valid, but unconventional, code that caused this IDE to display false-positive compiler errors.\n* Hierarchical Collections: Fixed some issues related to using null or empty locations that should have been considered invalid.\n* ImageLoader: Fixed issue where an IOError or SecurityError might be thrown for an old source that was replaced.\n* PopUpManager: Fixed issue where an error could be thrown by calling removeAllPopUps() when removing one pop-up might remove others automatically.\n* TextBlockTextEditor: Fixed issue where the cursor might be positioned incorrectly when alignment is center or right.\n* TextFieldTextEditor: Fixed issue where text editor would measure itself incorrectly when using embedded fonts because the measurement was based on device fonts instead.\n* ToggleGroup: Fixed issue where a flag to ignore changes might be disabled too early, causing the selection to change to the wrong value.\n* Tree: Fixed issue where changing the selected item programatically might not immediately update the appearance of the rendered component.\n\n## 3.4.0 - December 2017\n\n* New Component: DataGrid displays a list of data as a table. Each item is rendered as a row, divided into columns for each of the item's fields. Supports sorting columns, resizing columns, and drag-and-drop reordering of columns.\n* Support for Android TV. Refactored focus management API and keyboard interaction to support TV remotes. Support scaling to TV resolutions.\n* Collections: support for sorting.\n* Alert: fixed null reference error when buttonsDataProvider is null and the accept or cancel key is pressed.\n* ArrayHierarchicalCollection, VectorHierarchicalCollection: fixed issue where a runtime error could be thrown when checking if an item is a branch if the item is null.\n* AutoComplete: fixed issue where the list did not close if an item is triggered by a keyboard event.\n* BitmapFontTextRenderer: added breakLongWords property which can optionally break in the middle of long words if they extend beyond the width of the text renderer's bounds.\n* BitmapFontTextRenderer: fixed issue where distance field fonts would render blurry and fonts that shouldn't use smoothing would be blurry.\n* Button: added getScaleForState() and setScaleForState() to support different rendering scales in all states, in addition to the existing scaleWhenDown and scaleWhenHovering.\n* Button, ToggleButton, ToggleSwitch, List, GroupedList, Tree: Event.TRIGGERED and Event.CHANGE may also be dispatched for Keyboard.ENTER if the key location is KeyLocation.D_PAD.\n* Callout: added originGap property to optionally add extra spacing between the callout and its origin.\n* DateTimeSpinner: fixed issue where internal SpinnerLists were not disabled when isEnabled is set to false.\n* DeviceCapabilities: added simulateDPad property that allows regular keyboard arrow keys to interact with components similarly to a TV remote or another device that dispatches keyboard events with KeyLocation.D_PAD.\n* DeviceCapabilities: methods that accept a flash.display.Stage parameter now default to null and fall back to Starling.current.nativeStage.\n* DragDropManager: fixed issue where a null reference error could be thrown if the drag source's stage property was null during cleanup.\n* FocusManager: can change focus up, down, left, or right if the keyLocation property of the KeyboardEvent is KeyLocation.D_PAD.\n* FocusManager: supports TransformGestureEvent.GESTURE_DIRECTIONAL_TAP for focus navigation on Apple tvOS.\n* HorizontalSpinnerLayout: added horizontalAlign property to allow the selected item to be aligned to the left or right instead of the default center.\n* HorizontalSpinnerLayout: added paddingLeft and paddingRight to affect the position of the selected item, in addition to the horizontalAlign property.\n* IFocusDisplayObject, added nextUpFocus, nextDownFocus, nextLeftFocus, and nextRightFocus properties, similar to previousTabFocus and nextTabFocus.\n* IFocusDisplayObject: added isShowingFocus property to check if the focused object is showing its focus indicator.\n* IListCollection: added sortCompareFunction property to allow sorting of items in the collection.\n* ImageLoader: fixed issue where a texture that is too large for the current profile would result in a runtime error instead of being caught and turned into Event.IO_ERROR.\n* ImageSkin: the defaultColor property defaults to 0xffffff so that it behaves more like the defaultTexture.\n* ImageSkin: throws a runtime error if the color property from the Image superclass is set. Use defaultColor instead.\n* IScreenNavigatorItem: added transitionDelayEvent to optionally delay the start of the transition until the screen dispatches an event. This allows the screen extra time to initialize and do things like load assets from the web.\n* ISpinnerLayout: added selectionBounds getter to allow the layout to customize where the selectionOverlaySkin should be positioned.\n* KeyToEvent: new superclass for KeyToTrigger to allow other events to easily get dispatched on key press.\n* KeyToSelect, KeyToState, KeyToTrigger: added keyLocation property to optionally require a specific key location (like KeyLocation.D_PAD).\n* LayoutGroup: fixed issue where AutoSizeMode.STAGE could be ignored if children are positioned beyond stageWidth and stageHeight, which could have made the container larger than expected.\n* List, GroupedList, Scroller, SpinnerList, TextArea: uses native flash.events.KeyboardEvent.KEY_DOWN for keyboard interaction so that they can cancel focus changes, if necessary.\n* List, GroupedList, Tree: fixed issue where a layout could be broken if the typicalItem were null.\n* Mobile Themes: Now enable the FocusManager by default, just like desktop.\n* NumericStepper: added useLeftAndRightKeys property to optionally allow stepper to be changed with Keyboard.LEFT and Keyboard.RIGHT instead of Keyboard.UP and Keyboard.DOWN.\n* PickerList: fixed issue where the pop-up list may be given focus in the wrong focus manager when it uses a different focus manager than the PickerList.\n* ScreenDensityScaleFactorManager: added support for Android TV and Apple tvOS.\n* ScrollBar, SimpleScrollBar, Slider: fixed issue where the scroll bar could not reach the maximum scroll position with certain page or step values.\n* Scroller: fixed issue where a null reference error could be thrown if scrolling animation were manually removed just as it completed.\n* SpinnerList: added hideSelectionOverlayUnlessFocused to allow the selectionOverlaySkin to be hidden when the list is not focused if showSelectionOverlay is true.\n* SpinnerList: added showSelectionOverlay property to completely hide the selectionOverlaySkin skin when set to false.\n* SpinnerList: The selectedIndex and selectedItem is changed immediately when an item renderer is triggered or keyboard events change selection, instead of waiting for the animation to complete.\n* StageTextTextEditor: keyboard arrow keys and Keyboard.ENTER are re-dispatched if KeyLocation.D_PAD so that this text editor will support focus changes, similar to how Keyboard.TAB is already re-dispatched.\n* TapToEvent: new superclass for TapToTrigger to allow other events to easily get dispatched when tapping a display object.\n* TapToEvent, TapToTrigger: added new tapCount property to wait for a specific number of taps before dispatching the event.\n* TextBlockTextEditor: improved support for bidiLevel 1 and right-to-left languages.\n* TextBlockTextRenderer, TextFieldTextRenderer: fixed issue where updateSnapshotOnScaleChange would result in incorrect texture dimensions if the scale was set after the component validated the first time but before it rendered.\n* TextInput: added iconPosition property and support for RelativePosition.RIGHT.\n* Todos Example: added a TabBar to filter items based on if they are completed or not.\n* ToggleButton: added scaleWhenSelected property.\n* TouchToState: if TouchPhase.HOVER is dispatched before TouchPhase.BEGAN, returns to hover state on TouchPhase.ENDED if hitTest() is successful.\n* Tree: fixed issue where hasVariableItemDimensions was incorrectly forced to true, if possible. Should now be set manually on the layout.\n* VerticalSpinnerLayout: added verticalAlign property to allow the selected item to be aligned to the top or bottom instead of the default middle.\n* VerticalSpinnerLayout: added paddingTop and paddingBottom to affect the position of the selected item, in addition to the verticalAlign property.\n* VideoPlayer: added netStreamFactory to customize how the flash.net.NetStream is created.\n\n## 3.3.1 - October 2017\n\n* BitmapFontTextRenderer: fixed issue where multiple text renderers with multiple custom mesh styles would incorrectly share a single style.\n* FeathersControl: fixed issue where focusIndicatorSkin was not always disposed.\n* FontStylesSet: fixed issue where properties from a new starling.text.TextFormat were incorrectly copied to the old TextFormat, which could cause other components to change font styles too.\n* ImageLoader: fixed issue where texture would not be reused when starling.textures.Texture.asyncBitmapUploadEnabled is false.\n* ImageLoader: fixed issue where error was thrown if using texture cache and the texture could not be reused in its current state on restoration.\n* ImageLoader: fixed issue where a runtime error could be thrown if the texture is disposed while the application is deactivated on mobile.\n* Scroller: fixed issue where top and bottom offsets were used instead of left and right when determining if the horizontal scroll bar should be displayed.\n* Scroller: fixed issue where pull views would not work sometimes if hasElasticEdges is false.\n* ScrollText: fixed issue where Event.TRIGGERED would not work if FocusManager is enabled because it didn't implement INativeFocusOwner to return its TextField.\n* StageTextTextEditor: fixed issue where setting the parent TextInput's visible property to false inside a FeathersEventType.FOCUS_OUT listener would hide the background, but not the StageText.\n* StageTextTextEditor: fixed issue where calling clearFocus() after setting the parent TextInput's visible property to false would hide the background, but not the StageText.\n* TabNavigator: fixed issue where the previous screen was incorrectly recreated if isSwipeEnabled is true and a swipe transition is cancelled.\n* TextInputRestrict: fixed issue where -, ^, and \\ characters could not be escaped. Used by BitmapFontTextEditor and TextBlockTextEditor.\n\n## 3.3.0 - July 2017\n\nSee the [Feathers 3.3 Migration Guide](https://feathersui.com/help/migration-guide-3.3.html) for details about how to upgrade to Feathers 3.3.\n\n* New Component: Tree is a List-like component designed for displaying nested hierarchical data, with branches that may be opened and closed.\n* New Layout: SlideShowLayout is designed for displaying one image at a time in a gallery.\n* BaseDefaultItemRenderer: fixed issue in skinSourceField where the wrong variable was checked to determine if the property has changed.\n* BaseDefaultItemRenderer: fixed issue where icon or accessory dimensions were not accounted for in measurement if item renderer does not have a label.\n* BaseLinearLayout: new abstract base class for HorizontalLayout and VerticalLayout that shares common code.\n* BaseTiledLayout: new abstract base class for TiledRowsLayout and TiledColumnsLayout that shares common code.\n* BottomDrawerPopUpContentManager: added customCloseButtonStyleName to customize the style name of the close button in the theme.\n* BottomDrawerPopUpContentManager, CalloutPopUpContentManager, DropDownPopUpContentManager, VerticalCenteredPopUpContentManager: fixed issue where the content was not scaled the same as the origin.\n* Callout: fixed issue where stage dimensions were not accounted for when calculating maximum dimensions of content.\n* Callout: fixed issue where moving origin when content is smaller than background skin could cause content to be rendered at incorrect size.\n* Cover, Reveal, Wipe: fixed issue where runtime error could be thrown if mask was unexpectedly removed from display objects.\n* DateTimeSpinner: fixed issue where you could not set the itemRendererFactory directly on the inner SpinnerLists when the DateTimeSpinner itemRendererFactory was null.\n* DefaultFocusManager: fixed issue where addEventListener() was called where removeEventListener() should have been called, potentially causing a memory leak.\n* DefaultFocusManager: fixed issue where maintainTouchFocus was incorrectly ignored.\n* Direction: added NONE constant that may be used in some situations.\n* DropDownPopUpContentManager: fixed issue where the delegate used for animation was not scaled by the same amount as the content it mirrored.\n* DropDownPopUpContentManager, VerticalCenteredPopUpContentManager: fixed issue where content was not positioned or resized correctly if PopUpManager.root is scaled.\n* FeathersControl: throws an error if validate() is called during initialize() because it was not clear that this previously returned without doing anything.\n* FeathersControl: fixed issue where setting minWidth or minHeight that is larger than the actualWidth and actualHeight might fail to invalidate the component.\n* FeathersControl: fixed issue where setting the validation queue before initialization could cause a navigator to trigger validation when showing a screen during initialization and validate something too early.\n* FocusManager: fixed issue where getFocusManagerForStage() threw a RangeError if stack size is 0 instead of returning null.\n* FontStylesSet: added dispose() method to make sure event listeners are removed (to be called by the parent of the text renderer/editor).\n* FontStylesSet: no longer calls clone() on starling.text.TextFormat because this prevents detection of changes to original TextFormat object. This reverts a change in Feathers 3.1.2 and goes back to previous behavior (while still fixing the memory leak that prompted the change).\n* GroupedList: fixed issue where first/last/single item renderer factories were not used as fallbacks when factoryIDFunction returns null.\n* GroupedList, List: fixed issue where mouse wheel did not work when useVirtualLayout is false in layout.\n* GroupedList: fixed issue where keyboard navigation failed after multiple groups.\n* HorizontalSpinnerLayout, VerticalSpinnerLayout: fixed issue where keyboard navigation did not loop when items are repeated.\n* ILayout: added calculateNavigationDestination() to allow custom behavior for keyboard navigation.\n* IListCollection: new interface to support custom collection implementations, and added ArrayCollection, VectorCollection, and XMLListCollection.\n* IHierarchicalCollection: new interface to support custom hierarchical collection implementations, and added ArrayHierarchicalCollection, VectorHierarchicalCollection, and XMLListHierarchicalCollection.\n* ImageLoader: fixed issue where originalSourceWidth and originalSourceHeight properties returned the wrong value in an Event.COMPLETE listener.\n* ImageLoader: fixed issue where scaleFactor getter returned incorrect value.\n* LayoutGroup, ScrollContainer: in a subclass that overrides draw(), if a child is resized or has changes to its layoutData before super.draw() is called, the container will not be invalidated to avoid the \"returned to validation queue too many times during validation\" error.\n* SoundPlayer: added soundLoaderContext property to allow a flash.media.SoundLoaderContext to be passed in for the internal load() call.\n* Scroller: added horizontalPageIndex and verticalPageIndex setters so that you can change pages without calling scrollToPageIndex() (which is meant for animation).\n* Scroller: fixed issue where scroll bar would fade out immediately when beyond the minimum or maximum scroll position instead of waiting until after the scroller snaps back into range.\n* Scroller: if hasElasticEdges is false, does not consider itself dragged if already at the minimum or maximum and can't be scrolled further.\n* Scroller: fixed issue with snapScrollPositionToPixels where the animation would appear to complete because it had already snapped to the final pixel, but there could still be more time left on the animation.\n* Scroller: fixed issue where measured view port dimensions (such as those from a layout) that are smaller than content dimensions would cause the full dimensions to exclude the scroll bars. This would sometimes cause both horizontal and vertical scroll bars to appear when only one should be required.\n* Scroller: fixed incorrect maximum page index calculation caused by floating point math error and Math.ceil.\n* Scroller: fixed issue where pull views with pivots were not masked correctly.\n* ScrollContainer: fixed issue where children positioned at negative coordinates did not affect the minimum scroll position.\n* ScrollContainer: fixed issue where pivotX and pivotY were not scaled when calculating item position.\n* SpinnerList: fixed issue where an item renderer that is disabled could be incorrectly selected. Returns to the previously selected index if the scroll position lands on a disabled item renderer.\n* SpinnerList: fixed issue where pageThrowDuration property was ignored when scrolling horizontally.\n* TabNavigator: fixed issue where isSwipeEnabled getter returned incorrect value.\n* TextArea: fixed issue where runtime error would be thrown in measureViewPort is true.\n* TextFieldTextEditor: fixed issue where state changes in the parent component would not always update the font styles when using starling.text.TextFormat.\n* Text Renderers/Editors: if they have a texture snapshot, optimized to avoid updating the snapshot until render() is called, in case it needs to validate() multiple times per frame (which is common in lists).\n* TiledColumnsLayout, TiledRowsLayout: deprecated PAGING_NONE, PAGING_HORIZONTAL, and PAGING_VERTICAL in favor of Direction.NONE, Direction.HORIZONTAL, and Direction.VERTICAL.\n* ToggleSwitch: now uses ExclusiveTouch so that parent containers cannot scroll while dragging thumb.\n* Gallery Example: replaced full size image with a List that uses SlideShowLayout, and the full size image may be resized with a gesture.\n\n## 3.2.0 - April 2017\n\n* PullToRefresh: new example that demonstrates how to support the popular \"pull to refresh\" gesture with Feathers lists and other scrolling containers.\n* TabNavigator: support for swiping between tabs.\n* ListCollection: added filterFunction property to support filtering items in data providers.\n* API Reference: All classes now specify the version of Feathers when they were first added.\n* Added [Deprecated] metadata to deprecated APIs.\n* Alert: added acceptButtonIndex and cancelButtonIndex to allow keyboard (or hardware back button) control over alert.\n* AnchorLayout: fixed issue where maxWidth and maxHeight were ignored when using top/right/bottom/left on AnchorLayoutData.\n* AutoComplete, PickerList: fixed issue where event listeners were not added to default popUpContentManager created in initialize().\n* BitmapFontTextEditor, TextBlockTextEditor: added support for blinking cursor when focused.\n* BitmapFontTextEditor, TextBlockTextEditor: fixed issue where FeathersEventType.FOCUS_OUT would not be dispatched afte calling setFocus() when the FocusManager is not enabled.\n* BitmapFontTextRenderer: fixed an issue where extra whitespace would appear at the end of every line.\n* BitmapFontTextRenderer: added support for kerning and letterSpacing properties of starling.text.TextFormat.\n* Button, DefaultGroupedListHeaderOrFooterRenderer, Header: added wordWrap property. No longer needs to be set in text renderer factory, but existing code that sets it there will continue to work.\n* Button, DefaultGroupedListHeaderOrFooterRenderer, Header: added numLines getter to get the number of lines displayed in the text renderer.\n* Button: fixed issue where label text renderer measurement was incorrect if minWidth or minHeight is set explicitly.\n* CalloutPopUpContentManager: similar to Callout, the direction property is now deprecated and added supportedPositions as its replacement.\n* DateTimeSpinner: added backgroundSkin, backgroundDisabledSkin, and padding properties.\n* DateTimeSpinner: fixed issue where pending value of scrollToDate() was not cleared.\n* Drawers: content property may now be null when validating. However, it should not be null when opening a drawer.\n* FeathersControl; layoutData is set to null when disposed to avoid potential memory leaks.\n* FeathersControl: Removes event listeners on styleNameList when disposed so that they cannot be called for no reason.\n* FeathersControl; added ignoreNextStyleRestriction() to allow components to set defaults during initialization while still allowing a theme to replace styles later.\n* FeathersControl: fixed an issue where measured minimum dimensions were not affected by explicit maximum dimensions.\n* GroupedList: similar to items, an error is thrown if duplicate header or footer data appears in the data provider.\n* HorizontalLayout, VerticalLayout: fixed issue where includeInLayout was ignored when distributing item sizes.\n* HorizontalLayout, VerticalLayout: fixed issue where includeInLayout was ignored when using percent dimensions.\n* HorizontalLayout, VerticalLayout: fixed issue where the typicalItem could not resize after layout.\n* ImageLoader: supports asynchronous texture uploads to improve performance when uploading textures to the GPU.\n* ImageLoader: exposed sourceToTextureCacheKey() to allow subclasses to override the key used in the TextureCache for non-URL sources.\n* ImageLoader: createTextureOnRestore accepts sources that are non-URLs to allow subclasses to override this behavior.\n* IPopUpContentManager: now includes EventDispatcher APIs so that casting is not required.\n* Item Renderers: callbacks like labelFunction and iconFunction now support a second, optional parameter for the item's index. For example, labelFunction may now use either of the following signatures: function(item:Object):String or function(item:Object, index:int):String.\n* Item Renderers: will now display data when owner is null.\n* KeyToState: new utility class to change a component's state based on keyboard events.\n* KeyToTrigger, KeyToSelect: fixed issue where event listeners added to the stage would not be removed if the target was set to null before it was removed from stage.\n* List, GroupedList; when updateAll() is called on the data provider, items that were added or removed from source are now rendered.\n* List, GroupedList: fixed issue where event listeners were not added to default layout created in initialize().\n* List, GroupedList: fixed issue where an item could not receive a new factoryID after its index changes.\n* ListCollection, HierarchicalCollection: removeAll() no longer results in CollectionEventType.RESET. This should not have been considered a drastic reset. CollectionEventType.REMOVE_ALL is dispatched instead.\n* PickerList: added itemRendererFactory and customItemRendererStyleName. They no longer need to be set in the listFactory. However, existing code that sets them in the listFactory will continue to work correctly.\n* Navigators: validates active screen when navigator validates to avoid flickering on next frame with delayed automatic validation.\n* ScrollContainer: renamed internal stage_resizeHandler to scrollContainer_stage_resizeHandler because ASC 1.0 might consider it a conflict.\n* Scroller: fixed issue where a state change would not cause the scroller to measure its new background skin.\n* Scroller: fixed issue where a layout change would not cause the scroller to measure its content again.\n* Scroller: added horizontalScrollBarPosition to allow the horizontal scroll bar to appear on top.\n* Scroller: added support for pull views on top, right, bottom, and left to support \"pull to refresh\" gesture.\n* Scroller: fixed issue where scrollToPageIndex() would not result in dispatch of FeathersEventType.SCROLL_START and FeathersEventType.SCROLL_COMPLETE.\n* SpinnerList: fixed issue where scroll position was not updated if layout snapInterval changed.\n* StageTextTextEditor: position of StageText can no longer be larger than 8191 or smaller than -8192 to avoid a runtime error.\n* StageTextTextEditor: added clearButtonMode property to support new StageText API.\n* StageTextTextEditor: does not call assignFocus() on StageText if StageText already has focus because this can cause soft keyboard to close and re-open on iOS.\n* TabBar: fixed issue where setSelectedIndexWithAnimation() and setSelectedItemWithAnimation() did not change the value of the selectedItem property.\n* TabBarSlideTransitionManager: moved to feathers-compat project.\n* TextBlockTextRenderer: fixed issue where a new line width would not be properly detected when using content property, and optimized for the standard text case.\n* TextBlockTextRenderer: added support for leading, kerning, and letterSpacing properties of starling.text.TextFormat.\n* TextBlockTextRenderer, TextFieldTextRenderer: fixed incorrect position of snapshots when using updateSnapshotOnScaleChange.\n* TextFieldTextRenderer: ensures that _text property is not null because flash.text.TextField does not support null values.\n* TextInput: no longer shows IBEAM cursor on TouchPhase.HOVER if isEditable and isSelectable are both false.\n* TouchToState: new utility class to change a component's state based on TouchPhase values.\n* VerticalCenteredPopUpContentManager: fixed margin setter that passed 0 to marginTop/marginRight/marginBottom/marginLeft instead of new value.\n* VerticalLayout: alignment of headers with getScrollPositionForIndex() defaults to VerticalAlign.TOP because that makes more sense for headers instead of VerticalAlign.MIDDLE.\n* VideoPlayer: fixed issue where display state was not properly updated when exiting full screen with the Escape key.\n\n## 3.1.2 - January 2017\n\n* FontStylesSet: Clones or copies properties from starling.text.TextFormat to avoid memory leak.\n\n## 3.1.1 - November 2016\n\n* AnchorLayout: fixed issue where using percentWidth would result in an error about maxWidth being NaN.\n* DefaultListItemRenderer: fixed issue where defaultSkin and defaultIcon properties were not treated correctly as styles.\n* FlowLayout: fixed issue where alignment to the center or right was not correct when container has explicit width.\n* Header: accounts for new Capabilities.os value on some recent iOS devices when calculating extra padding for status bar when not full screen.\n* HorizontalLayout, VerticalLayout fixed issue where using requestedColumnCount/requestedRowCount would result in incorrect view port dimensions if layout contained zero items.\n* TextBlockTextRenderer, TextBlockTextEditor: fixed issue where text would not be clipped sometimes if truncation is disabled.\n* TextBlockTextRenderer: fixed issue where center or bottom alignment was offset incorrectly.\n* ToggleButton: fixed issue where defaultLabelProperties, selectedUpLabelProperties, and other selected label properties were ignored.\n\n## 3.1.0 - October 2016\n\nSee the [Feathers 3.1 Migration Guide](https://feathersui.com/help/migration-guide-3.1.html) for details about how to upgrade to Feathers 3.1.\n\n* New Component: TabNavigator to display a TabBar that switches between screens, similar to a ScreenNavigator.\n* Font Styles: all components support starling.text.TextFormat for font styling. For advanced needs, text renderers can still use low-level ElementFormat/TextFormat objects which take precedence.\n* Style Properties: some properties are now considered styles, and a theme cannot replace their values if they are set outside of the theme first. No more AddOnFunctionStyleProvider, validation, or extending the theme required.\n* Architecture: Attempts to use stage.starling instead of Starling.current, if possible. Brings better compatibility with multiple Starling instances.\n* Architecture: switched many places to use starling.utils.Pool instead of static helper objects.\n* AnchorLayout: fixed issue where maxWidth wasn't used when explicitWidth was not set.\n* AnchorLayout, HorizontalLayout, VerticalLayout: with percentWidth and percentHeight, explicitMinWidth and explicitMinHeight will be used as the final minimum bounds instead of calculated minimums sent to saveMeasurements().\n* BitmapFontTextRenderer: fixed infinite loop when wordWrap is true and maxWidth is 0.\n* BitmapFontTextRenderer: added style property to support a custom MeshStyle.\n* BitmapFontTextRenderer: fixed issue where resizing larger would not change position of aligned text.\n* Button: fixed issue where header would invalidate too often if icon dimensions change.\n* Button: fixed alignment when using scaleWhenDown or scaleWhenHovering.\n* ButtonBar: implements ITextBaselineControl to expose button baseline.\n* Callout: is positioned in parent's coordinate space, instead of stage coordinate space.\n* ColorFade: fixed issue where Quad could be given a width or height of 0 in its constructor, which causes a runtime error.\n* Cube: fixed issue with culling that caused screen to overlap incorrectly during transition.\n* DateTimeSpinner: added customItemRendererStyleName.\n* Default Item Renderers: added customIconLoaderStyleName and customAccessoryLoaderStyleName for icon and accessory ImageLoaders.\n* Default Item Renderers: uses customHitTest on TapToTrigger, TapToSelect, and LongPress to exclude accessory from touches (instead of old custom implementation).\n* DropDownPopUpContentManager: fixed issue where Quad could be given a width or height of 0 in its constructor, which causes a runtime error.\n* FeathersControl: runtime error is thrown if a component is repeatedly added to validation queue in the same frame.\n* FeathersControl: instead of adding listeners for FeathersEventType.FOCUS_IN and FeathersEventType.FOCUS_OUT when focusManager is set, adds listeners automatically if component implements IFocusDisplayObject.\n* FlowLayout: fixed issue where horizontal alignment did not account for items larger than the width of the view port.\n* GroupedList, List: fixed issue where calling scrollToDisplayIndex() would result in a runtime error if dataProvider is null.\n* Header: uses ScreenDensityScaleCalculator to calculate extra padding on iOS when app is not full screen.\n* Header: fixed issue where header would invalidate too often if item dimensions change.\n* Header: fixed issue where extra status bar padding for iOS might not be calculated correctly if background skin height is large enough.\n* HorizontalLayout, VerticalLayout: fixed issue where distributeWidths and distributeHeights did not work correctly when useVirtualLayout is true.\n* HorizontalLayout, VerticalLayout: fixed issue where percentHeight or percentWidth might not be used during measurement.\n* HorizontalLayout, VerticalLayout: fixed issue where maxWidth or maxHeight would be incorrectly limited.\n* HorizontalLayout, VerticalLayout: fixed issue where requestedRowCount and requestedColumnCount did not work correctly when useVirtualLayout is false.\n* HorizontalLayout, VerticalLayout: added maxColumnCount and maxRowCount properties.\n* HorizontalSpinnerLayout, VerticalSpinnerLayout: fixed runtime error in snapInterval property when typicalItem is null.\n* ImageLoader: fixed issue where scale9Grid incorrectly allowed maintainAspectRatio to remain in effect.\n* ImageLoader: fixed issue where a layout with percentWidth and percentHeight might not work because minimum dimensions were not calculated correctly.\n* ImageLoader: does not call close() on flash.display.Loader because this can cause a memory leak when using ImageDecodingPolicy.ON_LOAD. Instead, switches to different Event.COMPLETE listener to dispose BitmapData and unload image.\n* ImageSkin: fixed issue where skin would not resize correctly after setting explicit dimensions and then clearing them.\n* ITextRenderer: added numLines getter that returns the number of lines of text that are wrapped.\n* ITextRenderer, ITextEditor: added fontStyles property that accepts a FontStylesSet. This is not meant to be used by application developers, but custom component authors. Application developers should set font styles on the parent component instead of text renderer/editor.\n* LayoutGroup Item Renderers: added backgroundSelectedSkin to optionally customize background when selected.\n* LayoutGroup, ScreenNavigator, ScrollContainer: StackScreenNavigator: fixed issue where AutoSizeMode.STAGE would be ignored if the navigator validated before being added to the stage.\n* LayoutGroup, ScrollContainer: the default layout (when the layout property is null) now accounts for pivotX and pivotY during measurement.\n* MultiStarlingStyleNameFunctionTheme: moved to feathers-compat.\n* Panel: fixed issue where header would invalidate too often if header dimensions changes.\n* PickerList: calls revealScrollBars() on pop-up list when opened to show whether scrolling is possible.\n* PickerList: implements ITextBaselineControl to expose button baseline.\n* PopUpManager: now accounts for pivotX and pivotY when centering a pop-up.\n* PopUpManager: added popUpCount property to indicate how many pop-ups are currently open.\n* PopUpManager: added removeAllPoUps() function to remove all open pop-ups.\n* ScreenDensityScaleCalculator: pulled out calculation of scale factor using DPI from ScreenDensityScaleFactorManager into separate class that can be used elsewhere.\n* ScreenNavigator, StackScreenNavigator: the default transition (which has no effect) now happens immediately instead of waiting for next frame the way that animated transitions are treated.\n* Scroller: fixed issue where final touch movement would not be included in drag on TouchPhase.ENDED.\n* Scroller: runtime error is thrown if measurement of view port gets into an infinite loop. Previously, it broke out of the loop, but performance would suffer.\n* Scroller: checks for drag start on TouchPhase.MOVED so that the Quad touch blocker appears faster and the view port does not receive invalid touches. Continues to update velocity on Event.ENTER_FRAME.\n* Scroller: fixed issue where a runtime error was thrown when a bubbling TouchEvent continued after removing the listener.\n* SpinnerList: fixed issue where pageThrowDuration property was ignored when scrolling horizontally.\n* SpinnerList: fixed issue where scroll position was not updated after removing or adding item before the selected item.\n* StackScreenNavigator: fixed issue where navigator could transition infinitely because state was not cleared correctly.\n* StageTextTextEditor, TextFieldTextEditor: fixed issue where the texture would be updated too frequently because the wrong texture dimensions were used for comparison.\n* StageTextTextEditor, TextFieldTextEditor: added maintainTouchFocus property that will keep the text editor in focus if something else is touched. On mobile, this will keep the soft keyboard open. Requires AIR 22.\n* StageTextTextEditor: fixed issue where StageText could not always be hidden when isEditable is false.\n* StyleNameFunctionTheme: has a property for the Starling instance it is associated with.\n* StyleNameFunctionTheme: automatically supports multiple Starling instances. Create a new instance of the theme when a new instance of Starling is current.\n* TabBar: dispatches Event.TRIGGERED when a tab is triggered. The event's data property references the item from the data provider.\n* TabBar: added selectedSkin property to display an animated overlay over the tabs to indicate selection.\n* TabBar: added setSelectedIndexWithAnimation() to animate the selectedSkin on programatic selection changes (always animated on user changes).\n* TabBar: added labelField, labelFunction, iconField, iconFunction, enabledField and enabledFunction. These are no longer controlled by tabInitializer property.\n* TabBar: icon from ListCollection is not disposed, and dispose() function on ListCollection should be used.\n* TabBar: implements ITextBaselineControl to expose tab baseline.\n* TapToTrigger, TapToSelect, LongPress: added customHitTest property to allow items to be excluded or other custom behavior.\n* TextArea: no longer changes selection range when given focus because Flex and HTML textarea element don't do that.\n* TextArea: exposed selectionBeginIndex and selectionEndIndex properties, similar to TextInput.\n* TextArea: fixed issue where calling selectRange() immediately after setFocus() would incorrectly change selection.\n* TextArea, TextInput: fixed issue where changing errorString while input has focus would not change visibility of TextCallout (such as when setting to null).\n* TextBlockTextRenderer, TextBlockTextEditor, TextFieldTextRenderer, TextFieldTextEditor: uses SystemUtil.isEmbeddedFont() to determine if font styles are embedded when using starling.text.TextFormat.\n* TextBlockTextRenderer, TextFieldTextRenderer: optimize render() function to avoid calling getTransformationMatrix() unless required.\n* TextBlockTextRenderer, TextFieldTextRenderer: uses smallest texture possible, even when dimensions are explicit to save memory and optimize performance (so that resizing larger doesn't cause a new texture to be required).\n* TextInput: calling setFocus() programatically will select all text, for consistency with Flex.\n* TextInput: fixed issue where incorrect selection range would be reported in FeathersEventType.FOCUS_IN listener.\n* TextInput: fixed issue where selection range would not be set if text editor did not exist yet.\n* Text Renderers, Text Editors: when using starling.text.TextFormat, supports vertical alignment.\n* TiledColumnsLayout, TiledRowsLayout: added distributeWidths and distributeHeights properties.\n* ToggleGroup: added numItems property and getItemAt() method.\n* ToggleSwitch: implemented IStateContext with states defined in feathers.controls.ToggleState class.\n* ValidationQueue: no longer keeps a delayed queue that will be validated a frame later because FeathersControl throws an error in the cases where it was used.\n* VerticalLayout: fixed issue where scroll position calculation did not account for sticky header on GroupedList.\n* VideoPlayer: added events for MediaPlayerEventType.CUE_POINT and MediaPlayerEventType.XMP_DATA for NetStream's onCuePoint and onXMPData.\n* VideoPlayer: invalidates layout after Event.READY so that it might resize, if needed.\n* WebView: added FeathersEventType.LOCATION_CHANGING.\n* New Example: Tabs, a demonstration of the new TabNavigator component.\n* New Example: Magic8Chat, a mobile chat application.\n\n## 3.0.4 - September 2016\n\n* Header: fixed issue where extra padding for status bar did not work on iOS 10.\n\n## 3.0.3 - July 2016\n\n* ImageLoader: Fixed issue where reusing the existing texture did not cause the rendered view to update when skipUnchangedFrames is true.\n* Text Renderers: Fixed issue where reusing the existing texture(s) did not cause the rendered view to update when skipUnchangedFrames is true.\n\n## 3.0.2 - June 2016\n\n* Scroller: Fixed issue where view port mask would not always be resized, such as when items are added to a List.\n\n## 3.0.1 - June 2016\n\n* List, GroupedList: fixed issue where ViewPortBounds minWidth and minHeight could be NaN (this broke percentWidth and percentHeight on some layouts).\n*  HorizontalLayout, VerticalLayout: fixed issue where layout could invalidate every frame when using percentages.\n*  FeathersControl: fixed issue where setting width or height, then scaleX or scaleY, then trying to set original width or height would fail.\n\n## 3.0.0 - June 2016\n\nSee the [Feathers 3.0 Migration Guide](https://feathersui.com/help/migration-guide-3.0.html) for details about how to upgrade to Feathers 3.0.\n\n* Support for Starling Framework 2.0\n* Minimum runtime version is now Flash Player 19 and AIR 19.\n* All Components: now automatically calculate minimum dimensions when they are not set explicitly. These values may be used by some layouts, such as when specifying percentWidth and percentHeight.\n* New Example: StackScreenNavigatorExplorer demonstrates various options for StackScreenNavigator.\n* Examples: updated to use ScreenDensityScaleFactorManager.\n* Examples: updated to use Starling's new skipUnchangedFrames property.\n* Example Themes: updated to scale based on contentScaleFactor instead of Capabilities.screenDPI.\n* Example Themes: Redesigned using Animate CC, and exported as sprite sheet. Find links to original FLA files in Feathers Help.\n* Migrated shared constants to a single class. Example: HORIZONTAL_ALIGN_LEFT, HORIZONTAL_ALIGN_CENTER, and HORIZONTAL_ALIGN_RIGHT are now available on the feathers.layout.HorizontalAlign class. See migration guide for details and regular expressions for Find/Replace.\n* AnchorLayout: optimized measurement of children by restricting dimensions before validation.\n* BasicButton: new superclass of Button that has only a background skin. Useful as for skinning components like a Slider's thumb or tracks that don't need an icon or label.\n* BitmapFontTextEditor: fixed issue where selectionAnchorIndex was not updated in certain situations.\n* BitmapFontTextRenderer: fixed issue where explicit dimensions were ignored in measurement.\n* BitmapFontTextRenderer: replaced snapToPixels property with pixelSnapping property to match Starling 2.0 naming convention.\n* BitmapFontTextRenderer: added support for offsetX and offsetY properties from starling.text.BitmapFont.\n* BitmapFontTextRenderer: optimized measurement of width by skipping calculations if maximum is larger than last width.\n* BottomDrawerPopUpContentManager: added overlayFactory property to customize the modal overlay.\n* Button: deprecated stateToSkinFunction. Replaced by feathers.skins.ImageSkin.\n* Button: deprecated upLabelProperties, hoverLabelProperties, downLabelProperties, disabledLabelProperties. Replaced by setting font styles on text renderer in labelFactory. Text renderers now support multiple font styles for different states.\n* Button: states are defined in feathers.controls.ButtonState.\n* Button: fixes issue where some icons or skins would not be disposed when button is disposed.\n* ButtonGroup: fixed issue where changing isEnabled in data provider to false and then true would not re-enable a button.\n* ButtonGroup: added buttonReleaser property that works similarly to buttonInitializer, but for cleaning up a tab.\n* Callout: deprecated supportedDirections property, and replaced it with supportedPositions property that accepts a Vector.<String> of constants defined by the RelativePosition class. Allows more flexibility in the preferred order of callout positions.\n* Callout: added horizontalAlign and verticalAlign properties to customize alignment of callout relative to its origin.\n* CalloutPopUpContentManager: added overlayFactory property to customize the modal overlay.\n* ConditionalStyleProvider: new style provider where the result of a function selects between two style providers.\n* DateTimeSpinner: added itemRendererFactory property to allow the item renderer to be customized. Must return a DefaultListItemRenderer or a subclass.\n* DateTimeSpinner: improved measurement with DateTimeMode.DATE by using longest month name as typical item.\n* DateTimeSpinner: fixed issue where runtime error could be thrown if changing range or locale.\n* DateTimeSpinner: fixed issue where changing locale would not update displayed month names.\n* DateTimeSpinner: fixed issue where year range would be wrong after changing minimum.\n* DateTimeSpinner: now uses a typicalItem for the DateTimeMode.DATE_AND_TIME dates list so that it won't resize during scrolling.\n* DefaultListItemRenderer, DefaultGroupedListItemRenderer: itemToLabel() now strictly checks for null instead of a \"truthy\" value, and an empty string will have different behavior.\n* DisplayListWatcher: removed class. Please migrate to new themes, or find this class in feathers-compat library.\n* Drawers: fixed issue where drawer would jump open instead of opening smoothly when minimumDragDistance was too large.\n* Drawers: optimized measurement of drawers by setting explicit/max dimensions before validation.\n* Drawers: drawers must implement IFeathersControl, and Sprite is not allowed anymore.\n* Drawers: now enforces the assumption that multiple drawers cannot be opened at the same time (multiple drawers can still be docked).\n* FeathersControl: setSizeInternal() is deprecated and replaced by saveMeasurements(), which includes the ability to set the minimum width and minimum height.\n* FeathersControl: added toolTip property to display a tool-tip if the ToolTipManager is enabled.\n* FeathersControl: added explicitWidth, explicitHeight, explicitMinWidth, and explicitMinHeight. Will return a Number when set, or NaN if the component has auto-sized.\n* FeathersControl: if component implements IStateContext and focusIndicatorSkin is IStateObserver, passes self to stateContext property.\n* FeathersControl: added resetStyleProvider() function to allow a component's style provider to be set back to the default. Useful when changing to a different theme.\n* FeathersControl: fixed issue where setting width after scaleX (or height after scaleY) would result in incorrect final dimensions. Same for minWidth and minHeight.\n* FeathersControl: maxWidth and maxHeight can never be less than 0.\n* FeathersControl: optimization where the component will not invalidate if changing minWidth, minHeight, maxWidth, or maxHeight obviously won't affect the actual dimensions of the component.\n* FocusManager: fixed issue where focus would stop going forward when encountering an IFocusContainer.\n* FlowLayout: fixed issue where alignment could be wrong if maximum row width were smaller than max width.\n* GroupedList: added itemToItemRenderer(), headerDataToHeaderRenderer(), and footerDataToFooterRenderer() functions, to get a renderer for specific data (if one is available).\n* GroupedList: fixed issue where a runtime error could be thrown when the dataProvider property is null.\n* GroupedList: fixed issue where a runtime error could be thrown when adding or removing an item and using first, last, or single item renderer.\n* Header: improved calculation of status bar height when using useExtraPaddingForOSStatusBar.\n* Header: When horizontalAlign is HorizontalAlign.LEFT, and the header has leftItems, the title will appear to the right of the items instead of being hidden. Same for HorizontalAlign.RIGHT and rightItems. In these cases, the title will still be hidden if the header has centerItems.\n* HorizontalLayout: fixed issue where percentWidth/percentHeight values greater than 100 were not clamped.\n* HorizontalSpinnerLayout: added repeatItems property that may be set to false to disable repeating items with infinite scrolling.\n* HorizontalSpinnerLayout: fixed issue where items could disappear when using gap property.\n* ImageLoader: fixed issue where setting source to null when using a TextureCache would not release the texture from the cache.\n* ImageLoader: replaced snapToPixels property with pixelSnapping property to match Starling 2.0 naming convention.\n* ImageLoader: added scale9Grid and tileGrid properties.\n* ImageLoader: fixed issue where ScaleMode.NONE was not respected during auto-sizing.\n* ImageLoader: masks internal Image instead of itself when clipping a scaled texture so that the mask property can be used too.\n* ImageSkin: new display object that supports multiple textures and colors for different states.\n* IMeasureDisplayObject: new interface with explicit, minimum, and maximum dimensions for use when the full IFeathersControl is not necessary.\n* INativeFocusOwner: nativeFocus property is now typed as Object instead of InteractiveObject so that objects like StageText may be used, and added IAdvancedNativeFocusOwner to provide custom API for setting focus.\n* KeyToSelect: new utility class that allows selection with keyboard, similar to TapToSelect.\n* KeyToTrigger: new utility class that allows trigger event with keyboard, similar to TapToTrigger.\n* Label: added customTextRendererStyleName property.\n* LayoutGroup: if component is root when initialized, defaults to AutoSizeMode.STAGE.\n* List: added itemToItemRenderer() function, to get an item renderer for a specific item (if one is available).\n* List: fixed issue where a runtime error could be thrown when the dataProvider property is null.\n* NumericStepper: fixed issue where pressing increment or decrement button after editing TextInput would result in wrong value.\n* OldFadeNewSlideTransitionManager: removed class. Use StackScreenNavigator with push and pop transitions instead, or find this class in feathers-compat.\n* PickerList: itemToLabel() now strictly checks for null instead of a \"truthy\" value, and an empty string will have different behavior.\n* PickerList: fixed issue where button label would not be updated when calling updateItemAt() on data provider with selected index.\n* Scale3Image: removed class. Use starling.display.Image with scale9Grid.\n* Scale3Textures: removed class. Use starling.display.Image with scale9Grid, or find this class in feathers-compat library.\n* Scale9Image: removed class. Use starling.display.Image with scale9Grid.\n* Scale9Textures: removed class. Use starling.display.Image with scale9Grid, or find this class in feathers-compat library.\n* ScreenDensityScaleFactorManager: on desktop, screen density isn't used because native stage contentsScaleFactor has the proper behavior. However, it will DeviceCapabilities.dpi on desktop if the value has been customized.\n* ScreenFadeTransitionManager: removed class. Use StackScreenNavigator with push and pop transitions instead, or find this class in feathers-compat.\n* ScreenNavigator: fixed issue where an event with the same name as a member of the screen could result in a runtime error if as3-signals weren't available.\n* ScreenSlidingStackTransitionManager: removed class. Use StackScreenNavigator with push and pop transitions instead, or find this class in feathers-compat.\n* ScrollContainer: if component is root when initialized, defaults to AutoSizeMode.STAGE.\n* ScrollContainer: fixed issue where includeInLayout could be ignored when not using a layout.\n* Scroller: fixed issue where scrolling would still be active after removing from stage and adding again.\n* Scroller: fixed issue where the page index calculation would fail if the width or height of the component were not an integer.\n* Scroller: snapScrollPositionToPixels now accounts for contentScaleFactor so that pixel snapping is to view port dimensions instead of stage dimensions to make scrolling smoother.\n* ScrollText: switched back default value for cacheAsBitmap to false because it seems to have started hurting performance again.\n* Slider: TrackInteractionMode.TO_VALUE now allows dragging during TouchPhase.MOVED.\n* SpinnerList: fixed issue where the selectionOverlaySkin could be resized incorrectly if the page size is larger than the list's dimensions.\n* SpinnerList: can no longer be completely deselected if data provider is not empty.\n* StackScreenNavigator: fixed issue where an event with the same name as a member of the screen could result in a runtime error if as3-signals weren't available.\n* StackScreenNavigator: fixed runtime error in popAll() when root screen is visible.\n* StackScreenNavigator: fixed issue where a new screen with the same ID as the active screen could not be shown.\n* StackScreenNavigator: fixed issue where a new screen that has the same display object instance as the active screen would break navigation. The transition is now skipped.\n* StageTextTextEditor: better measurement on desktop and when testing a mobile app in ADL to account for the internal TextField gutter. More consistent across all platforms.\n* StageTextTextEditor: simplified font size calculation.\n* StandardIcons: removed class that was deprecated. Use DefaultListItemRenderer.ALTERNATE_STYLE_NAME_DRILL_DOWN to display a drill down accessory in an item renderer.\n* StateValueSelector: removed class. Use ImageSkin, or find this class in feathers-compat library.\n* StateToggleValueSelector: removed class. Use ImageSkin, or find this class in feathers-compat library.\n* StyleProviderRegistry: added hasStyleProvider() and getRegistredClasses().\n* TabBar: fixed issue where changing isEnabled in data provider to false and then true would not re-enable a tab.\n* TabBar: added tabReleaser property that works similarly to tabInitializer, but for cleaning up a tab.\n* TapToSelect: fixed issue where runtime error could be thrown if removed from stage between TouchPhase.BEGAN and TouchPhase.ENDED.\n* TapToTrigger: fixed issue where runtime error could be thrown if removed from stage between TouchPhase.BEGAN and TouchPhase.ENDED.\n* TextArea: added errorString property to display an error in a TextCallout when the component is focused.\n* TextArea: added TextInputState.ERROR to allow skins to change appearance when the errorString is set.\n* TextArea: states are defined in feathers.controls.TextInputState.\n* TextArea: fixed issue where set focus on touch did not account for vertical scroll position.\n* TextBlockTextRenderer: better calculation of ascent and descent to avoid the issue where accents and other diacritical marks were being cut off at the top. Also, results in better vertical centering of the text.\n* TextBlockTextRenderer: optimized measurement of width by skipping calculations if maximum is larger than last width.\n* TextBlockTextRenderer: added support for input method editors (IMEs) to improve compatibility with more languages.\n* TextBlockTextRenderer: replaced snapToPixels property with pixelSnapping property to match Starling 2.0 naming convention.\n* TextBlockTextRenderer: fixed issue where runtime error could be thrown when attempting to create BitmapData with negative dimensions.\n* TextBlockTextRenderer: optimized performance of measurement calculation by avoiding unecessary alignment.\n* TextCallout: new component that conveniently displays a message in a callout.\n* TextFieldTextRenderer: replaced snapToPixels property with pixelSnapping property to match Starling 2.0 naming convention.\n* TextFieldTextRenderer: fixed issue where last line could sometimes be cut off due to floating point rounding errors.\n* TextInput: fixed issue where the position of the text editor when using VerticalAlign.MIDDLE was not rounded to the nearest pixel.\n* TextInput: added errorString property to display an error in a TextCallout when the component is focused.\n* TextInput: added TextInputState.ERROR to allow skins to change appearance when the errorString is set.\n* TextInput: states are defined in feathers.controls.TextInputState.\n* TextInput: fixed issue where some icons or skins would not be disposed when input is disposed.\n* TextInput: fixed issue where focus in and out events sometimes weren't dispatched.\n* TextInput: fixed issue where IBEAM mouse cursor would not always be cleared.\n* TextInput: will show focused state when focused, but text editor cannot have focus.\n* TiledImage: removed class. Use starling.display.Image with tileGrid.\n* TimeLabel: fixed issue where displayed text was incorrectly when time is greater than one hour.\n* ToggleButton: deprecated defaultSelectedLabelProperties, selectedUpLabelProperties, selectedHoverLabelProperties, selectedDownLabelProperties, selectedDisabledLabelProperties. Replaced by setting font styles on text renderer in labelFactory. Text renderers now support multiple font styles for different states.\n* ToggleSwitch: labelAlign is deprecated and behaves as LABEL_ALIGN_MIDDLE now that baseline issue in TextBlockTextRenderer is fixed.\n* TokenList: optimized value getter to avoid repeated calls to Vector join().\n* ToolTipManager: added support for displaying tool tips on mouse hover. Must use desktop theme or opt-in using setEnabledForStage().\n* ValidationQueue: optimized to avoid sorting queue of length is 1 because sorting allocates and object and will result in more frequent garbage collection.\n* VerticalCenteredPopUpContentManager: added overlayFactory property to customize the modal overlay.\n* VerticalLayout: fixed issue where percentWidth/percentHeight values greater than 100 were not clamped.\n* VerticalSpinnerLayout: added repeatItems property that may be set to false to disable repeating items with infinite scrolling.\n* VerticalSpinnerLayout: fixed issue where items could disappear when using gap property.\n* VideoPlayer: fixed issue where runtime error was thrown when setting netConnectionFactory.\n* VideoPlayer: improved support for streaming video from server.\n* VideoPlayer: dispatches FeathersEventType.ERROR when NetStream.Play.NoSupportedTrackFound is dispatched by NetStream.\n\n### 3.0.0 API Changes\n\nPlease see the [Feathers 3.0 Migration Guide](https://feathersui.com/help/migration-guide-3.0.html) for details about what has been deprecated or removed in Feathers 3.0.\n\n## 2.3.0 - December 2015\n\n* New Component: DateTimeSpinner combines a set of SpinnerList components to select the date, the time, or both.\n* New Theme: TopcoatLightMobileTheme. Thank you to Marcel Piestansky for your contributions.\n* List, GroupedList: added support for displaying more than one type of item renderer (plus multiple header and footer renderers on GroupedList).\n* TapToTrigger, TapToSelect, and LongPress: new utility classes that make it easy to implement Event.TRIGGERED, Event.CHANGE, and FeathersEventType.LONG_PRESS on custom item renderers.\n* TextureCache: utility class used to store textures loaded from URL by ImageLoader for quick reloading from memory instead of requesting URL again.\n* Text: Support changing between multiple font styles when parent component changes state. Makes it easier to set font styles for button and item renderer states with strict compile-time type checking (instead of using downLabelProperties, hoverLabelProperties, etc).\n* Alert: fixed issue where icon would not be positioned correctly when message needed to scroll.\n* Alert: fixed issue where layout would not be updated after icon resized.\n* BitmapFontTextRenderer: fixed issue where a line break could happen too early due to floating point inaccuracy.\n* BitmapFontTextRenderer: added support for leading property on BitmapFontTextFormat to add extra space between lines. Thanks, matyasatfp!\n* BottomDrawerPopUpContentManager: New IPopUpContentManager for PickerList that opens a drawer at the bottom of the stage.\n* Button: added setSkinForState() and setIconForState() methods. Recommended instead of separate properties like downSkin and hoverSkin.\n* Button: fixed issue where skin was positioned incorrectly when using scaleWhenDown. Thanks, zongjingyao!\n* Button: added customLabelStyleName property.\n* ToggleButton: fixed issue where the button could get stuck in a disabled state if selected and re-enabled.\n* Button, ToggleButton, LayoutGroup, Scroller, TextInput, TextArea: ensures that all skins are disposed when disposing the parent component (some may not be on the display list at the time, so they need to be disposed manually).\n* Button, Item Renderers: when skin, icon, or accessory is IStateObserver, sets the stateContext property.\n* ButtonGroup: when distributeButtonSizes is false, and the direction is horizontal, will display buttons in multiple rows if they will not fit into one row.\n* ButtonGroup: added support for passing the item from the data provider as an optional third parameter to event listeners added in the data provider.\n* ButtonGroup: added support for listening to FeathersEventType.LONG_PRESS on buttons.\n* ButtonGroup: added support for calling updateItemAt() and updateAll() on data provider.\n* Callout: adjusts minimum and maximum dimensions of content instead of setting width and height directly, if possible, to allow resizing.\n* DefaultFocusManager: fixed issue where focus could be restored to an object that was no longer on stage, causing a runtime error.\n* DefaultFocusManager: fixed issue where a component added under a modal pop-up doesn't have a focus manager.\n* DefaultListItemRenderer, DefaultGroupedListItemRenderer: added defaultAccessory property and setAccessoryForState() method. As long as itemHasAccessory property is false, accessory does not need to be set with data provider.\n* DefaultGroupedListHeaderOrFooterRenderer: added customContentLabelStyleName.\n* Drawers: added openMode property to control whether drawers are opened above or below the content. For backwards compatibility, defaults to below.\n* Drawers: fixed issue where setting drawer to null while open would leave overlay skin visible, making it impossible to interact with the content.\n* Drawers: fixed issue where opening or closing a drawer without animation wouldn't always work.\n* Drawers: added support for dividers between docked drawers and content.\n* FlowLayout: added firstHorizontalGap and lastHorizontalGap properties to allow a different gap after the first item and before the last item.\n* FlowLayout: fixed contentWidth result from layout() when content is larger than view port.\n* FlowLayout: fixed result from measureViewPort() when using multiple rows.\n* FlowLayout, TiledRowsLayout, TiledColumnsLayout: fixed issue where the calculated view port dimensions were too large when using maxWidth/maxHeight and the rows or columns were smaller than the maximum dimensions.\n* GroupedList, List: dispatches FeathersEventType.RENDERER_REMOVE for all item renderers on dispose.\n* GroupedList: default layout now uses stickyHeader property of VerticalLayout.\n* Header: extra padding for iOS status bar now supports 3x devices.\n* Header: added customTitleStyleName property.\n* HierarchicalCollection, ListCollection: added updateAll() method, similar to updateItemItem(), that tells the List that all items have been updated.\n* HorizontalLayout, VerticalLayout: fixed issue where percentWidth and percentHeight values were ignored when measuring the typical item in a virtual layout.\n* HorizontalSpinnerLayout, VerticalSpinnerLayout: fixed issue where a \"renderer map contains bad data\" runtime error could be thrown after duplicate indices were requested by getVisibleIndicesAtScrollPosition().\n* IAsyncTheme: new interface available to themes that need to load assets asynchronously. Used by Feathers SDK to delay app initialization until the theme is ready.\n* IGroupedLayout: new interface for layouts that support special modifiers for GroupedList, like headers that stick to the top.\n* IGroupedListHeaderOrFooterRenderer: interface is deprecated, and it replaced by two separate interfaces, IGroupedListHeaderRenderer and IGroupedListFooterRenderer.\n* IListItemRenderer, IGroupedListItemRenderer: added factoryID property that allows List to determine which item renderer factory was used to create the renderer.\n* IStateContext, IStateObserver: new relationship between components that have state and sub-components that want to know their parent's state.\n* ImageLoader: immediately stops loading when changing source property, instead of waiting for validation.\n* Layouts: fixed issue where the wrong dimensions would be calculated when the layout contained zero items.\n* LayoutGroup: fixed issue where background skin dimensions did not affect min dimensions of layout.\n* LayoutGroup: fixed issue where removing a child in an Event.REMOVED_FROM_STAGE listener could cause the internal state to get out of sync with the display list.\n* List: fixed issue where FeathersEventType.RENDERER_REMOVE would be dispatched for item renderers that were kept in memory to improve performance, but they didn't have an item, so the event would make no sense.\n* PickerList: defaults to using BottomDrawerPopUpContentManager and SpinnerList on devices detected as phones.\n* PickerList: defaults to DropDownPopUpContentManager on devices detected as desktop computers.\n* PickerList: fixed issue where pop-up List may incorrectly create an item renderer for every item in the data provider before the list is opened.\n* Scale3Image: removed duplicate code that had no effect.\n* SeekSlider: added progressSkin property to display loading progress from media player.\n* SoundPlayer: fixed issue where passing Sound instance to soundSource property would not update totalTime property and the sound would not play.\n* SoundPlayer: added MediaPlayerEventType.METADATA_RECEIVED event for Sound Event.ID3.\n* SoundPlayer, VideoPlayer: implement new IProgressiveMediaPlayer interface with bytesLoaded and bytesTotal properties.\n* SoundPlayer: fixed issue where sound might not stop playing or might not be cleaned up properly on dispose.\n* SpinnerList: fixed issue where setting data provider to same object would reset selection.\n* SpinnerList: default layouts requested four rows instead of five because it will be more visually obvious that it can scroll because some items will be only partially visible\n* StandardIcons: this class is considered deprecated because List now supports multiple item renderer factories. Drill down icon should be passed to item renderer during skinning.\n* StackScreenNavigator: added stackCount property.\n* StackScreenNavigator: added replaceScreen(), popAll(), and popToRootAndReplace() functions.\n* StackScreenNavigatorItem: added setScreenIDForReplaceEvent() and clearReplaceEvent() methods and replaceEvents property.\n* StackScreenNavigator, ScreenNavigator: fixed issue where loading new screen in a FeathersEventType.TRANSITION_COMPLETE listener could cause old screen to remain on display list.\n* StageTextTextEditor: added support for FocusManager.\n* TabBar: implements IFocusDisplayObject, and the selected tab may be changed with keyboard.\n* TextArea: added customTextEditorStyleName property.\n* Text Editors: added global style providers.\n* Text Editors: fixed issue where calling clearFocus() on Android would remove focus, but keep the soft keyboard open.\n* TextBlockTextEditor: fixed issue where selection skin could incorrectly appear outside bounds of TextInput.\n* Text Renderers: added text styles for selected state.\n* TextBlockTextRenderer, TextFieldTextRenderer: fixed issue where textures were uploaded too frequently with certain Starling scale factors.\n* TextFieldTextRenderer: fixed issue where snapshot was not updated when Starling scale factor changes at runtime.\n* TextInput: added isSelectable property, to go with isEditable property, to allow selection and editing to be controlled separately.\n* TextInput: added customTextEditorStyleName and customPromptStyleName properties.\n* TiledRowsLayout, TiledColumnsLayout: fixed issue where wrong number of rows or columns were calculated when using maxWidth or maxHeight.\n* TiledRowsLayout, TiledColumnsLayout: fixed issues with measurement and item positioning when using requested row or column counts.\n* ToggleButton: added toggleGroup property, similar to Radio, and implemented IGroupedToggle interface.\n* ToggleButton: added some missing constants inherited from Button.\n* ToggleSwitch: added customOnLabelStyleName and customOffLabelStyleName.\n* Todos: Example updated with modernized coding practices and changed design a bit.\n* ValidationQueue: uses Vector insertAt() when available in runtime to improve performance by avoiding extra garbage collection.\n* VideoPlayer: added netConnectionFactory to allow creation of NetConnection and the call to connect() to be customized.\n* VideoPlayer: added MediaPlayerEventType.METADATA_RECEIVED event for NetStream onMetaData callback.\n* VideoPlayer: fixed issue where Event.COMPLETE was not dispatched on iOS because NetStream.Play.Complete event was not dispatched on this platform only.\n* VideoPlayer: fixed issue where restoring context would cause video to start playing if paused before context was lost.\n* VideoPlayer: fixed issue where only audio would play on iOS if played a second time.\n* VideoPlayer: fixed issue where video might not stop playing or might not be cleaned up properly on dispose.\n* VideoPlayer: dispatches FeathersEventType.CLEAR when texture is disposed, similar to Event.READY when texture is ready to be rendered. ImageLoader should clear its source when this is dispatched.\n* More than doubled the number of unit tests!\n\n### 2.3.0 Deprecated APIs\n\nAll deprecated APIs are subject to the [Feathers deprecation policy](https://feathersui.com/help/deprecation-policy.html). Please migrate to the new APIs as soon as possible because the deprecated APIs **will** be removed in a future version of Feathers.\n\nThe `StandardIcons` class is deprecated. It was used to provide a drill-down icon for item renderers, but since lists now support multiple item renderer types, it is no longer needed. Additionally, the `StandardIcons` didn't work properly with multiple Starling instances, so it was ultimately a poor design choice.\n\nThe `IGroupedListHeaderOrFooterRenderer` interface is deprecated. The `GroupedList` component used this interface, but it now supports separate `IGroupedListHeaderRenderer` and `IGroupedListFooterRenderer` interfaces.\n\nThe `FeathersEventType.ERROR` constant was originally deprecated in Feathers 2.2.0 and remains deprecated in Feathers 2.3. The `ImageLoader` component used this constant, and it now dispatches separate `Event.IO_ERROR` and `Event.SECURITY_ERROR` events.\n\nAll properties and constants where \"name\" was replaced by \"style name\" were originally deprecated in Feathers 2.1.0, and they have now been removed. \n\n* `custom*Name` => `custom*StyleName`\n* `DEFAULT_CHILD_NAME_*` => `DEFAULT_CHILD_STYLE_NAME_*`\n* `ALTERNATE_NAME_*` => `ALTERNATE_STYLE_NAME_*`\n* `itemRendererName` => `customItemRendererStyleName`\n* `firstItemRendererName` => `customFirstItemRendererStyleName`\n* `lastItemRendererName` => `customFirstItemRendererStyleName`\n* `singleItemRendererName` => `customSingleItemRendererStyleName`\n* `headerRendererName` => `customHeaderRendererStyleName`\n* `footerRendererName` => `customFooterRendererStyleName`\n\n## 2.2.0 - August 2015\n\n* New Component: SoundPlayer. Plays audio using a Sound object.\n* New Component: VideoPlayer. Plays video using a NetStream object.\n* New Layout: Flow. Displays items of differing dimensions in multiple rows.\n* New Layout: WaterfallLayout. Displays items optimally in columns of equal width.\n* New Layout: HorizontalSpinnerLayout. Similar to VerticalSpinnerLayout, but displays items in a horizontal row.\n* New Transition: Iris. Scales a circular mask to animate between two screens.\n* New Transition: Wipe. Resizes a clipRect to animate between two screens.\n* New Example: Video. A desktop AIR app that can play videos from the file system.\n* AddOnFunctionStyleProvider: added callBeforeOriginalStyleProvider property to allow the add-on function to be called first.\n* Alert: added customMessageStyleName property.\n* BitmapFontTextEditor, TextBlockTextEditor: fixed an issue where they didn't accept non-Latin characters and ignored characters when Alt key was pressed.\n* BitmapFontTextEditor, TextBlockTextEditor: uses needsSoftKeyboard and requestSoftKeyboard() to show soft keyboard on Android. Vote on [Adobe Bug #3962712](https://bugbase.adobe.com/index.cfm?event=bug&id=3962712) to add iOS support.\n* BitmapFontTextEditor, TextBlockTextEditor: fixed issue where the selection anchor index wasn't properly updated, making the keyboard selection change on the wrong side.\n* BitmapFontTextEditor, TextBlockTextEditor: fixed issue where setting TextInput's parent visible property to false wouldn't clear focus.\n* BitmapFontTextEditor, TextBlockTextEditor: fixed an issue where pasting something other than text would cause a runtime error.\n* BitmapFontTextEditor, TextBlockTextEditor: fixed an issue where changing the text property in an Event.CHANGE listener could cause the cursorSkin to be positioned incorrectly.\n* Button: fixed issue where the label text renderer wasn't given an maxHeight that accounted for the button's height and padding.\n* ColorFade: fixed name of createBlackFadeTransition().\n* Default Item Renderers: fixed issue where children above or below label text renderer couldn't sometimes affect the label's width.\n* DropDownPopUpContentManager: fixed issue where pop-up wasn't repositioned if the source moved to a new location.\n* DropDownPopUpContentManager: added primaryDirection property to support trying to display the pop-up above the source first, instead of below.\n* DropDownPopUpContentManager: added fitContentMinWidthToOrigin property to allow the content to be smaller than the origin.\n* DropDownPopUpContentManager: fixed horizontal position of pop-up above origin.\n* DropDownPopUpContentManager: fixed issues caused by multiple Starling instances.\n* DropDownPopUpContentManager: added isModal and overlayFactory properties to affect how pop-up is displayed.\n* FeathersControl: fixed issue where initialize() could be called during initialization.\n* FocusManager: added support for new INativeFocusOwner interface, which allows components to be associated with a specific focusable native display object (like text editors!).\n* GroupedList: the itemIndex parameter on scrollToDisplayIndex() is now optional so that you can scroll to a group header.\n* Header: fixed issue where useExtraPaddingForOSStatusBar property didn't account for contentScaleFactor.\n* HorizontalLayout, VerticalLayout: fixed issue where a scrollToDisplayIndex() on a List wouldn't work.\n* HorizontalLayout, VerticalLayout: fixed issue where center/middle alignment wasn't properly ignored if total content size was larger than the container bounds (thanks kavolorn!)\n* HorizontalLayout, VerticalLayout: fixed issue with alignment when scrolling is required in perpendicular direction.\n* HorizontalLayout: fixed issue where items weren't measured correctly sometimes when using percentage dimensions.\n* ImageLoader: now accounts for minimum and maximum dimensions when maintaining aspect ratio.\n* ImageLoader: now dispatches separate Event.IO_ERROR and Event.SECURITY_ERROR constants instead of FeathersEventType.ERROR.\n* ImageLoader: fixed issue where appending variable to ATF URL would break the check for the file extension.\n* ImageLoader: added scaleContent, horizontalAlign, and verticalAlign properties.\n* ImageLoader: added scaleMode property that uses values from starling.utils.ScaleMode.\n* LayoutGroup: fixed issue where the background skin wasn't clipped by the clipRect.\n* MultiStarlingStyleNameFunctionTheme: a variation of StyleNameFunctionTheme that supports multiple Starling instances.\n* LayoutGroup, Scroller (and subclasses), ScreenNavigator, StackScreenNavigator: setting clipContent to false will clear the clipRect only once so that clipRect may be used externally.\n* LayoutGroupListItemRenderer, LayoutGroupGroupedListItemRenderer: fixed issue where changing the data would hurt performance because the item renderer would need to validate more than once.\n* List: sometimes keeps around an extra item renderer to avoid garbage collection and improve performance. When the typical item is from the data provider, the number of renderered items would fluctuate when scrolling.\n* NumericStepper: fixed issue where selection might be changed in TextInput when using arrow keys to step.\n* Panel: fixed issue where autoSizeMode property was ignored.\n* PopUpManager: fixed issue where adding a pop-up that already had a parent would cause the Event.REMOVED_FROM_STAGE listener to be called early.\n* ProgressBar, Slider: fixed issue where the layout would be broken if the minimum equals the maximum.\n* RenderDelegate: a display object that passes rendering to another display object that has its own transformations. Useful for custom transitions.\n* Scroller: fixed issue where scrollToPageIndex() would not accept negative page indicies.\n* Scroller: fixed issue where the container didn't detect major changes to the maximum scroll position, causing it to scroll far beyond the end of the content.\n* Scroller: added SCROLL_BAR_DISPLAY_MODE_FIXED_FLOAT to allow the scroll bar floats above the content, but it won't fade out.\n* Scroller: fixed issue where INTERACTION_MODE_TOUCH_AND_SCROLL_BARS didn't work in nested scrollers because scroll bars could overlap and stop touches even when scrolling was not possible.\n* Scroller: fixed issue where touching the scroll bar thumb wouldn't stop a throw.\n* Scroller: fixed issue where a floating scroll bar would be hidden after hover out instead of waiting for the throw animation to finish.\n* Scroller: fixed issue where clipping was no properly updated when using INTERACTION_MODE_MOUSE and the view port was resized small enough that scrolling was no longer needed.\n* Scroller: fixed issue where Scroller couldn't properly calculate its dimensions when it has a background skin but no view port content, causing an infinite loop.\n* Scroller: fixed issue where floating point errors sometimes caused it to snap to the wrong page.\n* Scroller: fixed issue where maximum page indices might be one larger than they should be if a floating point error occurs.\n* Scroller: snapScrollPositionToPixels now defaults to true.\n* Scroller: switched to a different throwEase that is more natural.\n* ScrollBar, SimpleScrollBar, Slider: on initialize, clamps value to minimum and maximum because value may not have been set, and it may be outside the range.\n* ScrollContainer: fixed issue where getRawChildIndex() didn't reset the displayListBypassEnabled flag before returning the result.\n* ScrollContainer: fixed issue where view port resizing wasn't ignored when using AUTO_SIZE_MODE_STAGE, potentially hurting performance.\n* ScrollText: uses cacheAsBitmap to improve scrolling performance. A property has been exposed to disable this, if desired.\n* ScreenDensityScaleFactorManager: manages the Starling view port and stage dimensions to automatically generate an appropriate contentScaleFactor value based on the screen DPI.\n* ScrollContainer: fixed issue where addChild() stopped working with Starling 1.7.\n* Slider: thumb position is now rounded to the nearest pixel.\n* Slider: added thumbOffset property to allow the thumb to be repositioned in the direction perpendicular to the track.\n* SpinnerList: by default, the scroll bar is hidden.\n* StackScreenNavigator: fixed issue where setting rootScreenID before screens were added could throw a runtime error.\n* StageTextTextEditor: fixed issue where text color wouldn't change when disabled while StageText didn't have focus.\n* StageTextTextEditor: fixed an issue where where the text editor would try to change the font size property every frame, but it wasn't rounding to an integer, causing the check to fail.\n* StageTextTextEditor, TextFieldTextEditor: improved positioning of StageText or TextField overlay when added to Sprite3D.\n* StyleNameFunctionTheme: added a createRegistry() function that can be overridden in a subclass to customize the style provider registry.\n* TabBar: now supports isEnabled in data provider, similar to ButtonGroup.\n* TextArea, TextInput: fixed issue where the backgroundFocusedSkin wasn't displayed when the FocusManager was disabled (thanks tcfraser!)\n* TextArea: fixed issue where setting the height of the TextArea larger than the text may result in the TextArea not receiving focus.\n* TextBlockTextRenderer, TextFieldTextRenderer: fixed issue where the texture would sometimes restore with the wrong font size and clipping.\n* TextBlockTextRenderer, TextFieldTextRenderer: fixed issue where snapshot dimensions were rounded down to the nearest pixel, which could cut off a small part of the text.\n* TextBlockTextRenderer, TextFieldTextRenderer: uses Texture.empty() and uploads BitmapData manually instead of Texture.fromBitmapData() to avoid the creation of an onRestore function that will be immediately replaced.\n* TextBlockTextRenderer, TextFieldTextRenderer: fixed issue where the texture snapshot could be blurry when scaled up from 0.\n* Text Renderers: added updateSnapshotOnScaleChange property to allow the snapshot to always be crisp, even when scaled up or down. Use with caution as it needs to check the scale every frame.\n* TextBlockTextRenderer: fixed issue where texture snapshot remained visible when the text renderer's width or height was supposed to be 0.\n* TextBlockTextRenderer: fixed issue where the cursorSkin wasn't properly positioned and sized when calling setFocus() manually.\n* TextBlockTextEditor: fixed an issue where scrolling wasn't working properly on HiDPI displays.\n* TextFieldTextEditor: fixed issue where the font displayed at the wrong scale the first time that the text editor received focus on some mobile devices.\n* TextFieldTextEditor: fixed issue where accessing the baseline property might throw a runtime error because textSnapshot was null.\n* TextFieldTextEditor: exposed some more TextField property that control rendering.\n* TextFieldTextRenderer: added useSnapshotDelayWorkaround property and disabled this workaround by default.\n* Text Editors: detects changes in contentScaleFactor (such as when switching between HiDPI and normal screens) and recreates snapshots.\n* TextInput: can now receive focus when isEditable is false.\n* TiledRowsLayout, TiledColumnsCount: The requestedColumnCount property may now be used to calculate an ideal width for that number of columns, if the container doesn't have an explicitWidth. (TiledColumnsLayout uses the requestedRowCount property).\n* ValidationQueue: skips components in queue that are no longer on the display list.\n* ValidationQueue: will not proceed if Starling's context is invalid. This may happen if a TouchEvent.TOUCH listener causes a lost context.\n* VerticalSpinnerLayout: fixed issue where item heights weren't forced to the same size, which could cause large gaps or overlapping items.\n* WebView: added missing FeathersEventType.LOCATION_CHANGE constant for event.\n* YouTubeFeeds: example updated to use newer YouTube API since the old one was shut down.\n* Transitions: changed some to use RenderDelegate to avoid removing screens from display list.\n* Examples: use Context3DProfile.BASELINE for mobile examples, since it is widely supported on mobile.\n* Examples: enabled supportHighResolution flag for mobile apps so that they look better on HiDPI screens. This has no effect on a real mobile device. It just improves the development experience.\n* Themes: when disposing, unregisters bitmap fonts, clears texture onRestore function, and clears StandardIcons class.\n* Themes: desktop themes now use HiDPI textures.\n\n### 2.2.0 Deprecated APIs\n\nAll deprecated APIs are subject to the [Feathers deprecation policy](https://feathersui.com/help/deprecation-policy.html). Please migrate to the new APIs as soon as possible because the deprecated APIs **will** be removed in a future version of Feathers.\n\nThe `FeathersEventType.ERROR` constant is deprecated. The `ImageLoader` component used this constant, and it now dispatches separate `Event.IO_ERROR` and `Event.SECURITY_ERROR` events. Error events should always be specific.\n\nThe `nameList` property on the `IFeathersControl` interface was originally deprecated in Feathers 2.0.0, and it has now been removed. It is replaced by the `styleNameList` property.\n\nThe `manageVisibility` property on layouts was originally deprecated in Feathers 2.0.0, and it has now been removed. This property no longer provided the performance improvements that it was originally intended for.\n\nProperties such as `customThumbName` on the `Slider` component have have been renamed. In this case, `customThumbName` is deprecated and replaced by `customThumbStyleName`. Similarly, the static constant `Slider.DEFAULT_CHILD_NAME_THUMB` has been deprecated and renamed `Slider.DEFAULT_CHILD_STYLE_NAME_THUMB`. Similarly, the static constant `Button.ALTERNATE_NAME_BACK_BUTTON` has been deprecated and renamed `Button.ALTERNATE_STYLE_NAME_BACK_BUTTON`. On all components, APIs that refer to the *name* of sub-components have been deprecated and they have been replaced by a similar API that refers to the *style name* instead. For brevity, the list below shows the mapping between the old naming conventions and the new naming conventions instead of listing each renamed property individually.\n\n* `custom*Name` => `custom*StyleName`\n* `DEFAULT_CHILD_NAME_*` => `DEFAULT_CHILD_STYLE_NAME_*`\n* `ALTERNATE_NAME_*` => `ALTERNATE_STYLE_NAME_*`\n\nThe `List` and `GroupedList` components had some properties that didn't follow the original `custom*Name` naming convention. In both classes, the `itemRendererName` property has been deprecated and replaced by `customItemRendererStyleName`. In `GroupedList`, `firstItemRendererName`, `lastItemRendererName` and `singleItemRendererName` have been deprecated and replaced by `customFirstItemRendererStyleName`, `customLastItemRendererStyleName`, and `customSingleItemRendererStyleName` respectively. Similarly, `headerRendererName` and `footerRendererName` have been deprecated and replaced by `customHeaderRendererStyleName` and `customFooterRendererStyleName` respectively. With this change, these properties no longer diverge from the naming convention used for similar properties on other components.\n\nAll of the above renamed APIs were deprecated in Feathers 2.1.0, and they remain deprecated in Feathers 2.2.0.\n\n### 2.2.0 API Changes\n\nThe `scrollToPageIndex()` function in the `Scroller` class, and its subclasses, no longer accepts `-1` as a valid way of specifying that the horizontal or vertical page index should not change. You must pass in the current value of the `horizontalPageIndex` or `verticalPageIndex` property instead. With the ability to have negative page indices, `-1` must now be available as a valid page index.\n\nIn the following code, the vertical page index is not meant to be changed:\n\n```\nlist.scrollToPageIndex( 2, -1 );\n```\n\nThe code would need to be modified, like this:\n\n```\nlist.scrollToPageIndex( 2, list.verticalPageIndex );\n```\n\n## 2.1.2 - July 2015\n\n* ScrollContainer: overrides addChild() to fix \"RangeError: Invalid child index\" issue when using Starling 1.7.\n\n## 2.1.1 - March 2015\n\n* BitmapFontTextRenderer, ScrollContainer: added workarounds for compiler bugs in Adobe Flex SDK 4.6.\n* ButtonGroup, TabBar: fixed issue where buttons or tabs would flicker and resize for a frame when the container resizes.\n* HorizontalLayout, VerticalLayout: fixed an issue that resulted in no scrolling when the scrollToDisplayIndex() function is called on a List.\n* ScrollContainer: fixed issue where setting autoSizeMode to AUTO_SIZE_MODE_STAGE resulted in being unable to scroll.\n* SpinnerList: fixed issue where setting the selected index programmatically didn't always update the scroll position.\n* TextBlockTextRenderer, TextFieldTextRenderer: fixed issue where text would appear blurry because snapToPixels incorrectly snapped on the y-axis.\n\n## 2.1.0 - February 2015\n\n* New Component: AutoComplete, a TextInput that provides a pop-up list of suggestions.\n* New Component: SpinnerList, a list that changes selection when scrolling to an item.\n* New Component: StackScreenNavigator, a variation of ScreenNavigator with a history stack that you can push and pop.\n* New Component: WebView, displays a native web browser using StageWebView, but may be positioned in local coordinates. Available in AIR only.\n* New Layout: VerticalSpinnerLayout, the default layout for the new SpinnerList component.\n* New Transitions: ColorFade, Cover, Cube, Fade, Flip, Reveal, Slide.\n* New Example: TransitionsExplorer demonstrates each transition.\n* Unit tests: created unit tests for a number of Feathers components.\n* Help: help files are now distributed with Feathers for offline use.\n* AnchorLayout: fixed issue where items positioned relative to horizontalCenterAnchorDisplayObject or verticalCenterAnchorDisplayObject were not positioned correctly whent he anchor was at a higher depth.\n* Button: added scaleWhenDown and scaleWhenHovering properties to scale the button in these states.\n* BaseDefaultItemRenderer: fixed issue where data that is == null would be ignored in some cases by changing to stricter === null check.\n* BitmapFontTextRenderer: fixed issue where a runtime error could be thrown if a character in the bitmap font had a width or height of 0.\n* BitmapFontTextEditor, TextBlockTextEditor: fixed issue where clearing the text on focus would cause the selection range to be invalid.\n* BitmapFontTextEditor, TextBlockTextEditor: listens for flash.events.Event.SELECT_ALL instead of Ctrl/Command+A with a keyboard event because it didn't work properly on Mac.\n* BitmapFontTextRenderer: fixed issue where the last word of a line would sometimes appear on the next line.\n* CalloutPopUpContentManager, DropDownPopUpContentManager, VerticalCenteredPopUpContentManager: detects if pop-up is removed from stage externally so that Event.CLOSE is properly dispatched.\n* DropDownPopUpContentManager: fixed issue where the source would close the pop-up while validating, but the pop-up was being positioned, causing a runtime error, so now checks if open after source is validated.\n* FeathersControl: added move() convenience function to set x and y properties, similar to how setSize() sets width and height.\n* FeathersControl: the styleProvider property may be changed after initialization.\n* FeathersControl: changes to styleNameList after initialization now causes the styleProvider to be re-applied.\n* FeathersControl: may now flatten even when not initialized or on stage.\n* FEATHERS_VERSION: new constant that can be used to see the version of Feathers being used.\n* FocusManager: both containers and their children may receive focus separately (to allow the container to scroll with the keyboard), thanks to the new IFocusContainer interface.\n* HierarchicalCollection: added removeAll() function, similar to ListCollection.\n* HorizontalLayout, VerticalLayout: when alignment is justified, the size of the item renderer is reset so that an accurate measurement can be taken instead of using the old justified size.\n* HorizontalLayout: added requestColumnCount property for more control over width auto-measurement.\n* HorizontalLayout, VerticalLayout: fixed issue where the number of item renderers didn't remain constant when using hasVariableItemDimensions when all item renderers were the same size.\n* ILayout: added getNearestScrollPositionForIndex() function to support scrolling when changing selected index in components like List.\n* Label: added backgroundSkin, backgroundDisabledSkin, and padding properties.\n* LayoutGroup: added LayoutGroup.ALTERNATE_STYLE_NAME_TOOLBAR.\n* LayoutGroup: added autoSizeMode property to specify that it should fill the stage.\n* List, GroupedList: fixed issue where scrolling backwards would sometimes cause item renderers to jump around instead of scrolling smoothly with a virtual layout with variable item dimensions where an item resized. Layout may adjust scroll position, if needed.\n* List, GroupedList: updates scroll position, if needed, when using arrow keys to change selection.\n* List, GroupedList: dispatches Event.TRIGGERED when an item renderer is triggered. The event data is the item from the data provider.\n* List, GroupedList: added stricter === null check when checking if a typicalItem has been set because values like 0 could match == null.\n* List, GroupedList: fixed issue where layout didn't update after an item renderer resized while the list wasn't validating.\n* List, GroupedList: fixed issue where the typical item renderer resized, but the layout wasn't updated.\n* List, GroupedList: fixed issue where changing the index of a typical item chosen from the data provider would not update the index of its item renderer.\n* ListCollection: setting data property to null keeps null instead of removing all items from existing data.\n* NumericStepper: added valueFormatFunction and valueParseFunction properties to support custom formatting.\n* Panel: added new title and headerTitleField properties to use instead of going through headerProperties.\n* Panel: fixed issue where outerPaddingBottom was ignored if the panel didn't have a footer.\n* PanelScreen: added missing DEFAULT_CHILD_STYLE_NAME_FOOTER constant for use in themes.\n* PickerList: dispatches Event.OPEN and Event.CLOSE when the pop-up list opens and closes.\n* PickerList, TabBar: fixes issue where Event.CHANGE was incorrectly dispatched on disposal because dataProvider was set to null.\n* Scale3Textures, Scale9Textures: fixed validation of region sizes when using a scaled texture that doesn't match Starling.contentScaleFactor.\n* ScreenNavigator: fixes issue where new screen wasn't resized properly by validating self if validation queue is currently busy.\n* ScreenNavigator: adds a delay of two frames before starting a transition animation because it significantly improves the performance of the transition.\n* ScreenNavigator: added isTransition active property to indicate if a transition is currently in progress.\n* ScreenNavigator: fixed issue where clearing a screen didn't dispatch FeathersEventType.TRANSITION_START.\n* ScreenNavigator: added support for transitions that may cancel themselves.\n* ScreenNavigator: added optional transition function argument to showScreen() and clearScreen().\n* ScreenNavigator: fixes issue where active screen wasn't properly cleared if removed with removeScreen() or removeAllScreens().\n* ScreenNavigator: dispatches FeathersEventType.TRANSITION_IN_START, FeathersEventType.TRANSITION_IN_COMPLETE, FeathersEventType.TRANSITION_OUT_START, and FeathersEventType.TRANSITION_OUT_COMPLETE on screens (not on self). Screens may listen for these events instead of the events dispatched by ScreenNavigator.\n* ScreenNavigatorItem: added setFunctionForEvent() and setScreenIDForEvent().\n* ScreenNavigatorItem: The properties getter will always be a valid object. It won't return null.\n* ScrollBar: hides thumb when ranging is infinite.\n* ScrollBar: sets touchable to false on tracks when range is 0 or infinite.\n* Scroller: performance improvements from less garbage collection.\n* Scroller: added support for scrolling horizontally with vertical scroll wheel.\n* Scroller: can receive focus to control scroll position with keyboard.\n* Scroller: fixed issue where snapToPages was ignored when using mouse wheel or throwing.\n* Scroller: fixed issue where animation for elastic snapping would restart on every touch when the distance was less than 1 pixel, causing it to appear that the item renderers could not be touched.\n* ScrollContainer: added autoSizeMode property to specify that it should fill the stage.\n* ScrollContainer: fixed issue where outer container didn't invalidate when adding or removing children, or when children are resized, causing validate() to have no effect.\n* StageTextTextEditor, TextFieldTextEditor: fixes issue where focus remained when parent was set invisible.\n* StyleNameFunctionTheme: the getStyleProviderForClass() function is now public.\n* TabBar, ToggleGroup, List, GroupedList, PickerList: fixed issue where Event.CHANGE was not dispatched when removing an item and the selectedIndex remains the same, but the selectedItem is different.\n* TabBar: default selectedIndex is -1 until the data provider is set.\n* TabBar: Event.CHANGE is dispatched immediately when selectedIndex property changes instead of waiting for validation. Makes it more consistent with other components, like List.\n* TextFieldTextEditor: fixed issue where HTML formatting is lost if edited when isHTML is true.\n* TextFieldTextEditor: fixed issue where snapshot wasn't updated when size changed, but data or styles did not.\n* TextFieldTextEditorViewPort: added padding properties.\n* TextFieldTextEditorViewPort: fixed issue where the selection index was wrong from touch.\n* TextFieldTextRenderer, TextBlockTextRenderer: fixed issue where native filters could cause the text renderer to create a texture that is larger than the maximum dimensions allowed.\n* TextFieldTextRenderer, TextBlockTextRenderer: fixed issue where only the first texture (if multiple textures were required) was positioned properly when using native filters.\n* TextFieldTextRenderer, TextBlockTextRenderer: fixed issue where texture snapshots could be clipped too small when using native filters.\n* VerticalLayout: added requestRowCount property for more control over height auto-measurement.\n\n### 2.1.0 Deprecated APIs\n\nAll deprecated APIs are subject to the [Feathers deprecation policy](https://feathersui.com/help/deprecation-policy.html). Please migrate to the new APIs as soon as possible because the deprecated APIs **will** be removed in a future version of Feathers.\n\nThe `nameList` property on the `IFeathersControl` interface has been deprecated, and it is replaced by the `styleNameList` property. The `name` property is no longer connected to style names, and situations where it failed to work with `getChildByName()` have been resolved. The `styleName` property has been added to replace the former usage of the `name` property as a concatenated version of `nameList` (now, `styleNameList`). The `nameList` property was deprecated in Feathers 2.0.0, and it remains deprecated in Feathers 2.1.0.\n\nThe `manageVisibility` property on layouts has been deprecated. In previous versions, this property could be used to improve performance of non-virtual layouts by hiding items that were outside the view port. However, other performance improvements have made it so that setting `manageVisibility` can now sometimes hurt performance instead of improving it. The `manageVisibility` property was deprecated in Feathers 2.0.0, and it remains deprecated in Feathers 2.1.0.\n\nSimilar to how the `nameList` property was renamed `styleNameList` in Feathers 2.0.0, properties such as `customThumbName` on the `Slider` component have have been renamed too. In this case, `customThumbName` is deprecated and replaced by `customThumbStyleName`. Similarly, the static constant `Slider.DEFAULT_CHILD_NAME_THUMB` has been deprecated and renamed `Slider.DEFAULT_CHILD_STYLE_NAME_THUMB`. Similarly, the static constant `Button.ALTERNATE_NAME_BACK_BUTTON` has been deprecated and renamed `Button.ALTERNATE_STYLE_NAME_BACK_BUTTON`. On all components, APIs that refer to the *name* of sub-components have been deprecated and they have been replaced by a similar API that refers to the *style name* instead. For brevity, the list below shows the mapping between the old naming conventions and the new naming conventions instead of listing each renamed property individually.\n\n* `custom*Name` => `custom*StyleName`\n* `DEFAULT_CHILD_NAME_*` => `DEFAULT_CHILD_STYLE_NAME_*`\n* `ALTERNATE_NAME_*` => `ALTERNATE_STYLE_NAME_*`\n\nThe `List` and `GroupedList` components had some properties that didn't follow the original `custom*Name` naming convention. In both classes, the `itemRendererName` property has been deprecated and replaced by `customItemRendererStyleName`. In `GroupedList`, `firstItemRendererName`, `lastItemRendererName` and `singleItemRendererName` have been deprecated and replaced by `customFirstItemRendererStyleName`, `customLastItemRendererStyleName`, and `customSingleItemRendererStyleName` respectively. Similarly, `headerRendererName` and `footerRendererName` have been deprecated and replaced by `customHeaderRendererStyleName` and `customFooterRendererStyleName` respectively. With this change, these properties no longer diverge from the naming convention used for similar properties on other components.\n\n### 2.1.0 API Changes\n\n#### ILayout\n\nThe `getNearestScrollPositionForIndex()` method has been added to the `ILayout` interface. Custom implementations of `ILayout` created before Feathers 2.1.0 will have compiler errors until the required changes are made.\n\nThis method is meant to calculate an updated scroll position for a specific index that requires the minimum amount of scrolling to fully display the specified index within the container's view port. It was added so that components like `List` could update the scroll position when changing the selected index with the keyboard when the component has focus.\n\nTo maintain the existing behavior (where the container doesn't scroll at all) to simply bypass the compiler error, the following implementation will return the existing scroll position:\n\n\tpublic function getNearestScrollPositionForIndex(index:int, scrollX:Number, scrollY:Number, items:Vector.<DisplayObject>, x:Number, y:Number, width:Number, height:Number, result:Point = null):Point\n\t{\n\t\tif(!result)\n\t\t{\n\t\t\treturn new Point(scrollX, scrollY);\n\t\t}\n\t\tresult.setTo(scrollX, scrollY);\n\t\treturn result;\n\t}\n\n#### Scroller now implements IFocusDisplayObject\n\nWith the addition of the new `IFocusContainer` interface, it is now possible for a container and its children to both appear in the tab focus chain when the `FocusManager` is enabled. Previously, subclasses of `Scroller`, like `List` or `ScrollContainer`, could not receive focus to allow the user to control the scroll position with the keyboard because the children wouldn't be able to receive focus too. Now, with the new interface and an updated focus manager, that restriction is lifted, and `Scroller` implements `IFocusDisplayObject` to support keyboard scrolling.\n\nSubclasses of `Scroller` that need to support passing focus to children must now implement `IFocusContainer`. `List`, `ScrollContainer`, `GroupedList` have been updated, obviously, but custom subclasses of `Scroller` may need to be updated to support focus. `IFocusContainer` requires one property, `isChildFocusEnabled`. For convenience, you may copy following implementation of `isChildFocusEnabled` into a subclass of `Scroller`:\n\n\tprotected var _isChildFocusEnabled:Boolean = true;\n\n\tpublic function get isChildFocusEnabled():Boolean\n\t{\n\t\treturn this._isEnabled && this._isChildFocusEnabled;\n\t}\n\n\tpublic function set isChildFocusEnabled(value:Boolean):void\n\t{\n\t\tthis._isChildFocusEnabled = value;\n\t}\n\n## 2.0.1 - November 2014\n\n* AddOnFunctionStyleProvider: fixed issue where function passed into constructor would be ignored.\n* LayoutGroup: fixed issue where background skin would not validate after setting its dimensions.\n* Scale3Image, Scale9Image, TiledImage: updated to listen for Event.FLATTEN to validate instead of overriding flatten() to remain compatible with the new flatten() function signature in Starling 1.6.\n* StageTextTextEditor: fixed issue where StageText.stage was null, and calling drawViewPortToBitmapData() resulted in a runtime error.\n* StageTextTextEditor: fixed issue where setFocus() didn't work if StageText.stage was null.\n* TextInput: fixed issue where runtime error would be thrown after changing prompt from null to a valid string after input had validated.\n* Themes: fixed issue in desktop themes where assets displayed at 4x instead of 2x on HiDPI Macs.\n* Themes: fixed issue in desktop themes where PanelScreen and ScrollScreen would incorrectly use mobile scroll bars and behaviors.\n* Themes: fixed issue where a subclass would add a style function for the ToggleSwitch class, and that would cause some ToggleSwitch instances to be missing skins.\n* Themes: fixed issue where wrong arguments were passed to Texture.fromBitmap().\n* Added workarounds for stack overflow runtime errors when compiling with legacy Flex 4.6 compiler.\n\n## 2.0.0 - October 2014\n\n* New style provider architecture for skinning and themes.\n* Components may always be validated, even if they are not on the display list yet.\n* New Text Editor: TextBlockTextEditor is a desktop-only text editor built on FTE, similar to TextBlockTextRenderer.\n* New Text Editor: BitmapFontTextEditor is a desktop-only text editor built on bitmap fonts, similar to BitmapFontTextRenderer.\n* All Components: subComponentProperties pattern is now stricter. If properties that don't exist are set, a runtime error will be thrown.\n* BitmapFontTextRenderer: properly redraws when isEnabled is changed.\n* BitmapFontTextRenderer: if textFormat is null, generates a default value so that something will be displayed (using Starling's embedded BitmapFont.MINI).\n* Button: added minGap property that is used when gap is set to Number.POSITIVE_INFINITY.\n* Button: pulled out toggle functionality into a subclass: ToggleButton.\n* Button: removed now-useless autoFlatten property.\n* Button: added new hasLabelTextRenderer that may be set to false to avoid creating the text renderer (for things like scroll bar or slider button sub-components).\n* Button: fixed issue where button didn't return to up state when focus is changed with keyboard while in another state.\n* Callout: added stagePadding property to set stagePaddingTop, stagePaddingRight, stagePaddingBottom, and stagePaddingLeft properties all at once.\n* Callout: fixed issue where touch listener was removed when callout was removed, but it wasn't re-added when the same callout instance was shown again.\n* DefaultGroupedListHeaderOrFooterRenderer: fixed issue where content wasn't disabled when isEnabled changed.\n* Drawers: added optional overlaySkin property to fade in a display object over the content when a drawer is opened.\n* Drawers: checks if event types are null before adding listeners.\n* Drawers: open and close events now pass the display object in the event data.\n* Drawers: fix for issue where wrong toggle duration may used sometimes.\n* DropDownPopUpContentManager: added new gap property.\n* FeathersControl: enforced as an abstract class. If you need a generic Feathers component wrapper for layoutData and things, use LayoutGroup.\n* FeathersControl: added styleName and styleNameList property to replace nameList. The name property is no longer used for styling, and it will work for getChildByName() in the rare situations where it was broken. The nameList property is deprecated.\n* FeathersControl: fixed issue where changing minTouchWidth or minTouchHeight did not update the hit area if the width or height wasn't changed at the same time.\n* FeathersControl: fixed issue where component would validate when disposed.\n* FeathersControl: fixed issue in setSize() where scaled dimensions weren't updated.\n* FocusManager: support for custom IFocusManager instances and support for multiple Starling stages.\n* FocusManager: fixed issue where disabled components could receive focus.\n* Header: added useExtraPaddingForOSStatusBar property to support iOS 7 status bar behavior.\n* Header: getters for leftItems, rightItems, and centerItems no longer duplicate the array.\n* Header: now disposed leftItems, rightItems, and centerItems by default. Can be controlled with new disposeItems property.\n* Header: fixed issue where title text renderer's isEnabled property wasn't properly updated.\n* Header: fixed issue where the touchable property was incorrectly set to false on some children.\n* IFocusDisplayObject: added new focusOwner property to allow pop-ups to be owned by another component. Allows the focus manager to manage focus order better with components like PickerList.\n* ImageLoader: checks for lost context before creating a texture from a loaded URL.\n* ImageLoader: fixed issue where isLoaded getter didn't always return true if the source is a texture.\n* ImageLoader: fixed issue where loaded textures could be uploaded to wrong Starling instance if multiple Starling instances were active.\n* Item Renderers: added skinField, skinFunction, and itemHasSkin for background skins from the data provider.\n* Item Renderers: added isSelectableOnAccessoryTouch property to control whether the selection will change or not when the accessory is touched.\n* Item Renderers: added minGap and minAccessoryGap properties that are used when gap or accessoryGap are set to Number.POSITIVE_INFINITY.\n* ITextEditor, ITextRenderer: extend a new IBaselineTextControl interface that defines a common baseline property.\n* Layouts: fixed issue where they didn't account for pivotX and pivotY.\n* Layouts: when centering items, rounds the x and y positions to the nearest integer.\n* LayoutGroup: added new backgroundSkin and backgroundDisabledSkin properties.\n* List, GroupedList: if dataProvider property is changed, or the collection dispatches CollectionEventType.RESET, automatically behaves as if updateItemAt() were called on all item renderers.\n* ListCollection, HierarchicalCollection: added dispose() function to support a way to dispose things like display objects or textures in items.\n* NumericStepper: claims exclusive touch so that it won't repeat while scrolling with touch.\n* NumericStepper: fixes for obscure situations where text input changes are not reflected in the value.\n* NumericStepper: improved auto-measurement for values that are not integers.\n* NumericStepper: added textInputGap and buttonGap properties.\n* PageIndicator: added new interactionMode property to allow alternate precise selection of symbols on tap, instead of previous back/next behavior.\n* Panel: added new outerPadding properties to support padding that is around the everything, including the header and footer. The existing (inner) padding properties only apply to the content between the header and footer.\n* PanelScreen: turns on clipping by default.\n* PickerList: added toggleButtonOnOpenAndClose property.\n* PickerList: implements IFocusDisplayObject and manages focus of children better.\n* PickerList: closes on enter key to match native behavior.\n* PopUpManager: when centering a pop-up, rounds the x and y positions to the nearest integer.\n* ProgressBar: fixed vertical fill so that it starts from the bottom and fills up.\n* PropertyProxy: added toString() function to allow a PropertyProxy to be output to console.\n* Scale3Image, Scale9Image, fixed issue where scaling smaller than the minimum size would cause overlapping instead of distortion when end regions weren't the same size.\n* Scale3Textures, Scale9Textures: fixed rendering of textures with a scale property that isn't equal to 1.\n* Screens: removed dpiScale, pixelScale, originalWidth, and originalHeight properties. The kinds of calculations these values were used for should be handled in the theme (or somewhere else outside of the screen if not using a theme).\n* ScrollBar: increment and decrement buttons are hidden, like the thumb, if the minimum is equal to the maximum. The track fills the full dimensions.\n* ScrollBar: fix for wrongly positioned track when direction is horizontal.\n* ScrollContainer: fixed wrong measurement when using no layout with children at negative coordinates.\n* Scroller: fixed issue where a floating scroll bar wouldn't disappear.\n* Scroller: refactored scrolling behavior to more closely match iOS native scrolling.\n* Scroller: touch overlay and background skins are added and removed instead of changing visible property. Works better with Monster Debugger.\n* Scroller: fixes issue where events were dispatched for a completed scroll when the scroll position didn't actually change from calling throwTo().\n* Scroller: added support for a view port that doesn't necessarily auto-size to show its full content. In other words, a view port can choose to measure so that it needs to scroll.\n* Scroller: fixed issue where background wasn't sized property when isEnabled was changed.\n* Scroller: skips some unnecessary code when dimensions are explicit to improve performance.\n* Scroller: added new measureViewPort property that can be set to false to exclude the view port from auto-measurement and only use the background skin.\n* Scroller: automatically sets direction property on scroll bars, so that you don't need to, thanks to the new IDirectionalScrollBar interface.\n* ScrollText: added disabledTextFormat property.\n* ScrollText: may receive focus and use keyboard arrow keys to scroll.\n* Slider: added new trackInteractionMode property to control whether touching the track updates the value by page or jumps directly to the nearest value.\n* SmartDisplayObjectValueSelector: fixed issue where getValueTypeHandler() function had an extra parameter.\n* SmartDisplayObjectValueSelector: added support for null value other than the default.\n* SmartDisplayObjectValueSelector: stricter reuse of display objects. Type must match exactly. Fixes issue where Image is incorrectly reused because it is a subclass of Quad.\n* StageTextTextEditor: fixed issue where measurement was wrong when text was an empty string.\n* StageTextTextEditor: fixed issue on iOS where characters were masked immediately instead of showing in the clear for a moment.\n* StageTextTextEditor: fixed issue where the clipboard menu appeared unexpectedly when multiline is true.\n* StageTextTextEditor: draws StageText to BitmapData with double dimensions on Mac HiDPI, thanks to Adobe's bug fix.\n* TabBarSlideTransitionManager: fixes bug where switching between tabs quickly would break the transition.\n* Text: will use non-power-of-two textures for snapshots, if the Stage 3D profile supports it.\n* Text: if a renderer or editor supports native filters, does some extra cleanup in dispose() that is actually unnecessary, but will ease some pressure if there's a memory leak.\n* Text: fixed issue where snapshot wasn't updated when isEnabled changed.\n* TextBlockTextRenderer: if elementFormat is null, generates a default value so that something will be displayed.\n* TextBlockTextRenderer: fixed issue where width was calculated wrong when text ended in whitespace.\n* TextFieldTextEditor, TextFieldTextRenderer: added useGutter property to allow removal of the 2-pixel \"gutter\" that Flash adds to a TextField.\n* TextInput, TextArea: added hasFocus getter to allow checking focus, even if there is no focus manager.\n* TextInput, Text Editors: added new selectionBeginIndex and selectionEndIndex properties.\n* TextInput: fixes issue where prompt text renderer's isEnabled property wasn't updated.\n* TextInput: added new verticalAlign property to support top, middle, bottom, or justify.\n* TextInput: won't throw an error if there's no background skin, but auto-measurement will result in a width and height of 0, unless typicalText is set.\n* TextInput: improved support for text editors that are completely on the Starling display list without a native overlay.\n* TextInput: doesn't create prompt text renderer if prompt is null.\n* TextArea: added stateToSkinFunction, similar to Button background skin.\n* TextArea: fixed issue where background skin was sometimes missing.\n* TextArea: added clearFocus() function match API of TextInput.\n* TextArea: further improvements to positioning and scaling of texture snapshot.\n* Text Editors: improved support for Mac HiDPI.\n* Text Editors: added disabled font styles.\n* Text Renderers: uses generateFilterRect() when using nativeFilters for improved texture dimensions.\n* Text Renderers: ITextRenderer now has a first-class wordWrap property that is required by all renderers.\n* TiledColumnsLayout, TiledRowsLayouts: fixed result of getScrollPositionForIndex() when paging is disable to allow the item to be properly centered.\n* TiledColumnsLayout, TiledRowsLayouts: fixed calculation of tile count when padding is used.\n* TiledColumnsLayout, TiledRowsLayout: added requestedRowCount and requestedColumnCount properties.\n* ToggleSwitch: fixed issue where the isEnabled property of text renderers wasn't properly updated.\n* ToggleSwitch: added toggleThumbSelection property to update the isSelected property of the thumb (if it's a ToggleButton) to match the isSelected property of the switch.\n* ToggleSwitch: fixed issue where selection change wasn't animated when triggered with the keyboard instead of a touch.\n* ToggleSwitch: added new setSelectionWithAnimation() method so that programmatic selection changes can be optionally animated.\n* Examples: override initialize() instead of listening for FeathersEventType.INITIALIZE.\n* Example Themes: rewritten using the new style provider system.\n* Example Themes: tweaked padding, gap, dimensions, and other values to be based on a simple grid system for more consistency.\n\n### 2.0.0 Deprecated APIs\n\nAll deprecated APIs are subject to the [Feathers deprecation policy](https://feathersui.com/help/deprecation-policy.html). Please migrate to the new APIs as soon as possible because the deprecated APIs **will** be removed in a future version of Feathers.\n\nThe `nameList` property has been deprecated, and it is replaced by the `styleNameList` property. The `name` property is no longer connected to style names, and situations where it failed to work with `getChildByName()` have been resolved. The `styleName` property has been added to replace the former usage of the `name` property as a concatenated version of `nameList` (now, `styleNameList`).\n\nThe `manageVisibility` property on layouts has been deprecated. In previous versions, this property could be used to improve performance of non-virtual layouts by hiding items that were outside the view port. However, other performance improvements have made it so that setting `manageVisibility` can now sometimes hurt performance instead of improving it.\n\n### 2.0.0 Default Behavior and API Changes\n\nThis is a major update to Feathers, so it includes more breaking changes than usual. Be sure to read this section thoroughly to see if any of these changes will affect your apps.\n\n`TextFieldTextRenderer` and `TextFieldTextEditor` now have a `useGutter` property that controls whether the 2-pixel gutter around the edges of the `flash.text.TextField` will be used in measurement and layout. In previous versions of Feathers, the gutter was always enabled. The gutter is now disabled by default to allow text controls based on `TextField` to more easily align with other text controls.\n\nThe `ITextRenderer` and `ITextEditor` interfaces now extend the `ITextBaselineControl` interface. In the case of `ITextEditor`, a new `baseline` getter is required.\n\nThe `ITextRenderer` interface now requires a `wordWrap` property.\n\nThe `IFocusDisplayObject` interface now requires a `focusOwner` property.\n\nProperties including `dpiScale`, `pixelScale`, `originalWidth`, `originalHeight`, and `originalDPI` have been removed from `Screen`, `ScrollScreen` and `PanelScreen`. The calculations previously offered by these properties should be handled in skinning code, such as the theme.\n\nThe `Button` class no longer supports selection. This functionality has been moved into a subclass, `ToggleButton`.\n\nThe `autoFlatten` property has been removed from the `Button` class.\n\nSetting the properties of a sub-component, such as using `thumbProperties` on a `Slider` to set properties on the slider's thumb sub-component, is now stricter. Previously, when a property did not exist, it was silently ignored. Now, an error will be thrown.\n\nIf no text format is defined, `BitmapFontTextRenderer` defaults to using `BitmapFont.MINI` so that the text will always be rendered. Previously, it would render nothing.\n\nIf no element format is defined, `TextBlockTextRenderer` defaults to using a new `ElementFormat` with default arguments so that the text will always be rendered. Previously, an error was thrown.\n\nA `trackInteractionMode` property has been added to `Slider`. In previous versions, `Slider` behaved as if `trackInteractionMode` were set to `Slider.TRACK_INTERACTION_MODE_BY_PAGE`. Now, the default value is `Slider.TRACK_INTERACTION_MODE_TO_VALUE`.\n\nA `verticalAlign` property has been added to `TextInput`. In previous versions, `TextInput` behaved as if `verticalAlign` were set to `TextInput.VERTICAL_ALIGN_JUSTIFY`. Now, the default value is `TextInput.VERTICAL_ALIGN_MIDDLE`.\n\nThe `FeathersControl` class is now considered abstract. It will throw a runtime error if instantiated directly instead of being subclassed. If you need a generic Feathers component as a wrapper for another display object, use `LayoutGroup` instead.\n\nThe `leftItems`, `rightItems`, and `centerItems` getters on the `Header` class no longer make a copy of their storage variables. Take care when modifying these values directly.\n\nFocus management now supports multiple Starling stages (for AIR desktop apps). The static `isEnabled` property has been removed. Instead, you should use the static `setEnabledForStage()` function:\n\n```as3\nFocusManager.setEnabledForStage( Starling.current.stage, true );\n```\n\nAll layouts now account for the `pivotX` and `pivotY` properties when positioning display objects. In previous versions, these properties were ignored.\n\nWhen the `direction` property of a `ProgressBar` is equal to `ProgressBar.DIRECTION_VERTICAL`, the fill now starts at the bottom and fills up.\n\nThe increment button and decrement button sub-components of a `ScrollBar` are now hidden when the scroll bar's maximum scroll position is equal to its minimum scroll position, just like how the thumb is hidden. The track will be resized to fill the extra space where the buttons were previously rendered.\n\nWhen replacing the `dataProvider` of a `List` or `GroupedList` (or replacing the `data` property of a `ListCollection` or `HierarchicalCollection`), it is no longer necessary to call `updateItemAt()` on the new collection if it contains some of the same items as the previous collection. This behavior will happen automatically.\n\n## 1.3.1 - July 2014\n\n* NumericStepper: fixed issue where using step to calculate a new value didn't account for the minimum value.\n* NumericStepper: fixed issue where only some text was selected after changing value.\n* TextInput: fixed issue where FOCUS_OUT event wasn't dispatched when used with a NumericStepper and FocusManager.isEnabled is true, causing NumericStepper to fail to update its value properly.\n* Slider: fixed issue where using step to calculate a new value didn't account for the minimum value.\n* Button: validates skin if the skin implements IValidating so that the skin resizes properly if button dimensions are tweened.\n* Callout: fixed issue where callout incorrectly stopped content from resizing.\n* Callout: fixed issue where content resizing wouldn't reposition callout to point to origin.\n* TextInput: fixed issue where sometimes focus was not cleared on removal.\n* TextBlockTextRenderer: fixed issue where sometimes an infinite loop was triggering when attempting to truncate.\n* TextFieldTextEditor: fixed issue where existing text did not render with new text format.\n* StageTextTextEditor, TextFieldTextEditor: fixed issue where multiple FOCUS_OUT events could be dispatched.\n* TextArea: fixed positioning of texture snapshot when scrolling.\n* TiledRowsLayout, TiledColumnsLayout: fixed issue where some tiles would be incorrectly invisible with top or left padding and manageVisibility.\n* LayoutGroup: respects includeInLayout when no layout is specified.\n* TextInput: fixed selection position on touch when displaying an icon.\n* Gallery Example: updated to use HTTPS URLs since Flickr will soon require it.\n* YouTubeFeeds Example: switched to category feeds since the older feeds were deprecated and displayed the wrong data.\n\n## 1.3.0 - April 2014\n\n* New Component: ScrollScreen is new base class for ScreenNavigator screens that supports scrolling similar to ScrollContainer.\n* New Component: TextBlockTextRenderer is a new text renderer that renders text with flash.text.engine.TextBlock, with a texture snapshot similar to TextFieldTextRenderer.\n* More performance improvements with the help of Adobe Scout.\n* Improved support for multiple windows in desktop AIR apps.\n* Improved support for using scaleX and scaleY with Feathers components.\n* Added support for Mac HiDPI resolutions.\n* HorizontalLayout: added support for percentWidth and percentHeight with HorizontalLayoutData.\n* VerticalLayout: added support for percentWidth and percentHeight with VerticalLayoutData.\n* AnchorLayout: added support for percentWidth and percentHeight with AnchorLayoutData.\n* HorizontalLayout: added optional firstGap and lastGap properties.\n* VerticalLayout: added optional firstGap and lastGap properties.\n* HorizontalLayout: added distributeWidths property to available divide available width equally to all items.\n* HorizontalLayout: added distributeHeights property to available divide available height equally to all items.\n* AnchorLayout: performance improvements.\n* PickerList: added openList() and closeList() functions to open and close pop-up list programmatically.\n* Screen: now extends LayoutGroup to support layouts.\n* Scroller: final removal of scrollerProperties, which was deprecated in version 1.1.0.\n* Scroller: support for placing the vertical scroll bar on the right for right-to-left locales.\n* Scroller: added mouseWheelScrollStep property to support different steps on scroll bar and mouse wheel.\n* ScrollText: now chooses exclusively between styleSheet or textFormat to avoid runtime error.\n* ScrollText: added support for hyperlinks, including a new Event.TRIGGERED event when a link is clicked/tapped.\n* TextFieldTextRenderer: now chooses exclusively between styleSheet or textFormat to avoid runtime error.\n* TextFieldTextRenderer: added nativeFilters property to support rendering text with filters.\n* BitmapFontTextRenderer: fixed issue where truncation happened when it wasn't necessary.\n* BitmapFontTextRenderer: fixed kerning when font size is scaled.\n* ImageLoader: added textureFormat property to specify a Context3DTextureFormat value.\n* List: reuses its typical item renderer instead of creating a new one when measurement is required.\n* ScrollContainer: added IScrollContainer interface including functions for \"raw\" children.\n* Themes: \"quiet\" buttons now have a transparent up skin to blend into toolbars.\n* Themes: broke apart initialize() function into multiple functions for better organization.\n* Themes: support for optionally loading assets at runtime instead of embedding.\n* Themes: now available as SWCs for easier project setup.\n* MetalWorksMobileTheme: uses the new TextBlockTextRenderer.\n* LayoutGroup: fix for empty spaces when an item is added more than once.\n* ILayout: added new requiresLayoutOnScroll property to improve performance for static layouts.\n* IValidating: new interface for objects that support validation.\n* Scale9Image: implements IValidating to support forced validation and to put it in the ValidationQueue.\n* Scale3Image: implements IValidating to support forced validation and to put it in the ValidationQueue.\n* TiledImage: implements IValidating to support forced validation and to put it in the ValidationQueue.\n* TabBar: support for more layout properties similar to ButtonGroup.\n* Header: added optional centerItems property to support items in the center to replace the title.\n* Item Renderers: added selectableField and selectableFunction to allow some item renderers to be selectable and some that are not selectable.\n* Item Renderers: added enabledField and enabledFunction to allow some item renderers to be enabled and some that are not enabled.\n* Item Renderers: added iconLabelField and iconLabelFunction similar to accessoryLabelField and accessoryLabelFunction.\n* Item Renderers: support truncation of accessory label.\n* DisplayListWatcher: extends EventDispatcher so that subclasses (themes) can dispatch events.\n* DisplayListWatcher: now processes all matching named initializers instead of only the first match.\n* PopUpManager: added IPopUpManager to support custom pop-up managers.\n* PopUpManager: better support for multiple Starling instances.\n* Alert: fixed issue where button group was disposed on close and caused runtime error.\n* AnchorLayout: fixes for broken layouts with certain ordering of children.\n* AnchorLayout: fixes to avoid runtime error when using children that don't implement ILayoutDisplayObject.\n* Button: fix to long press duration being treated as an integer instead of floating point.\n* Button: small fixes to layout edge cases.\n* ButtonGroup: fix to allow buttons to be disabled and re-enabled.\n* ButtonGroup: fix to properly remove event listners from data provider when data provider changes.\n* BitmapFontTextRenderer: fix for centered text being blurred because its position wasn't rounded to an integer.\n* Item Renderers: minor fixes to layout edge cases.\n* StageTextTextEditor: fix for StageText not being properly hidden when text is empty.\n* TextInput: fix for icon positioning using wrong padding value.\n* ImageLoader: added optional textureQueueDuration property to upload textures after a short delay while delayTextureCreation is true. Previously, textures would not upload at all until delayTextureCreation was set to false again.\n* ProgressBar: no longer sets touchable to false on skins.\n* Panel: fix for failing to detect header and footer resizing.\n* Drawers: fix for failing to detect drawer resizing.\n* Scroller: fix for issue where an animated scroller with the scroll policy set to SCROLL_POLICY_OFF would incorrectly stop scrolling when touched. \n* Scroller: fix for incorrect calculation of maximum scroll positions when pageWidth or pageHeight is set.\n* TextFieldTextRenderer: fix for wrapping bug.\n* HorizontalLayout: fix for getScrollPositionForIndex() to properly calculate scroll position for indices less than beforeVirtualizedItemCount.\n* VerticalLayout: fix for getScrollPositionForIndex() to properly calculate scroll position for indices less than beforeVirtualizedItemCount.\n* ScreenNavigator: fix for edge case where the screen was not resized properly with AUTO_SIZE_MODE_CONTENT.\n\n### 1.3.0 Deprecated APIs\n\nAll deprecated APIs are subject to the [Feathers deprecation policy](https://feathersui.com/help/deprecation-policy.html). Please migrate to the new APIs as soon as possible because the deprecated APIs **will** be removed in a future version of Feathers.\n\nThe `scrollerProperties` property on scrolling components, including List, GroupedList, ScrollText and ScrollContainer was originally deprecated in Feathers 1.1.0, and it has now been removed. Because these components now extend `Scroller` instead of adding a `Scroller` as a child, all of the properties that could be set through `scrollerProperties` can now be set directly on the components.\n\n### 1.3.0 API Changes\n\nSome changes have been made to Feathers that have the potential to break code in existing projects. Changes of this type may be considered [exceptions to the Feathers deprecation policy](https://feathersui.com/help/deprecation-policy.html#exceptions), and careful consideration is made to limit the impact of these changes on existing projects. Most developers using Feathers will not be affected by these changes, except perhaps, to observe improved stability and consistency.\n\n#### ILayout\n\nOne change has been made to the `ILayout` interface. Custom implementations of `ILayout` created before Feathers 1.3.0 will have compiler errors until the required changes are made.\n\nThe property `requiresLayoutOnScroll` has been added to `ILayout` to provide improved performance for static layouts that don't change when a container scrolls.\n\n This property can easily simulate the old behavior from Feathers 1.2.0, if required. The following implementation of `requiresLayoutOnScroll` can easily be copied into a custom implementations of `ILayout` to quickly migrate existing Feathers 1.2.0 implementations to behave exactly the same in Feathers 1.3.0:\n\n\tpublic function get requiresLayoutOnScroll():Boolean\n\t{\n\t\treturn true;\n\t}\n\n## 1.2.0 - November 2013\n\n* New Component: Alert\n* New Component: Drawers\n* New Component: LayoutGroup\n* New Component(s): LayoutGroupListItemRenderer, LayoutGroupGroupedListItemRenderer, LayoutGroupedListHeaderOrFooterRenderer\n* FeathersControl: better support for scaleX and scaleY. Width and height are scaled.\n* FeathersControl: dispatches FeathersEventType.CREATION_COMPLETE after the first validation.\n* FeathersControl: added isCreated flag to indicate if FeathersEventType.CREATION_COMPLETE has been dispatched.\n* FeathersControl: ensures that keyboard focus is ignored if disabled.\n* FeathersControl: new protected functions setInvalidationFlag() and getInvalidationFlag() for better re-invalidation during draw().\n* FeathersControl: getChildByName() uses nameList.contains(). Doesn't work when an IFeathersControl is in a non-Feathers display object.\n* Button: added FeathersEventType.LONG_PRESS event.\n* Button: updates isEnabled on label text renderer and icon, if applicable.\n* Button: label is always on top of the icon.\n* List, GroupedList: Setting a new data provider will clear selection. Now, selection cannot be set before data provider is passed in. If the same selection is desired after a data provider change, it should be done manually.\n* List, GroupedList: improved invalidation when various properties are changed.\n* List, GroupedList: better handling of typical item to improve performance an accuracy of layout calculations.\n* List, GroupedList: support for item renderers that can be deselected if multiple selection isn't enabled.\n* ListCollection: removeAll() checks if length is 0 to avoid dispatching an event.\n* GroupedList: improved handling of updateItemAt() to properly update whole groups.\n* ImageLoader: added loadingTexture and errorTexture properties.\n* ImageLoader: support for loading ATF files from URL.\n* ToggleSwitch: on and off labels can be created with separate factories.\n* Panel: header and footer contents can receive keyboard focus.\n* ButtonGroup: properly resizes when data provider changes.\n* ButtonGroup: support for padding around buttons.\n* ButtonGroup: dispatches its own Event.TRIGGERED when any button is triggered.\n* ButtonGroup: support for horizontal and vertical alignment.\n* ButtonGroup, TabBar: better handling of custom names for first and last items.\n* Callout: backgroundSkin is no longer required.\n* Callout: show() function adds an argument for a custom overlay factory.\n* Scale9Image, Scale3Image: support for scaling edge regions down to zero. Causes distortion, but removes overlapping.\n* Scale9Image, Scale3Image, TiledImage, BitmapFontTextRenderer: uses batchable property from QuadBatch for improved performance.\n* BitmapFontTextRenderer: fix for center and right alignment when using maxWidth.\n* BitmapFontTextRenderer: fix for center and right alignment when no width or maxWidth is set.\n* Scroller: support for minimum scroll positions less than zero.\n* Scroller: improved draw() function to avoid extra invalidation.\n* Scroller: new interactionMode value INTERACTION_MODE_TOUCH_AND_SCROLL_BARS.\n* Scroller: added minimumDragDistance and minimumPageThrowVelocity.\n* Scroller: fixed vertical page snapping.\n* Scroller: supports custom page dimensions for snapping.\n* Scroller: won't scroll with mouse wheel when scroll policy is off.\n* Text editors: visibility fixes when text is empty.\n* TextFieldTextEditor: support for rotation.\n* StageTextTextEditor: doesn't clear text when displayAsPassword is changed.\n* StageTextTextEditor: better scaling and support for rotation.\n* TextFieldTextRenderer: supports using multiple textures if text width or height is greater than 2048 pixels.\n* TextFieldTextRenderer: added disabledTextFormat property.\n* TextInput, text renderers: dispatches soft keyboard events.\n* TextInput: supports icon.\n* TextInput: alternate name for search input.\n* Screen, PanelScreen: better handling of back button that accounts for depth.\n* ScreenNavigator: properly resizes if content is resized.\n* ScreenNavigator: clears screen if removeScreen() is called for the active screen.\n* ToggleGroup: added getItemIndex() and setItemIndex().\n* VerticalCenteredPopUpContentManager: touch must begin and end outside of content to close the content.\n* DisplayListWatcher: added initializeObject() function to initialize display objects that are already added when a theme is created.\n* PropertyProxy: support for QName values.\n* SmartDisplayObjectValueSelector: fix to support uint values for Quads.\n* SmartDisplayObjectValueSelector: support for ConcreteTexture.\n* State value selectors: strict equality checks for null to support 0 values.\n* VerticalLayout, HorizontalLayout: improved item validation to account for justify alignment.\n* AnchorLayout: better measurement when using horizontalCenter or verticalCenter values.\n* ValidationQueue: items are added to the queue faster with better sorting.\n* ExclusiveTouch: allows a component to claim a touch so that nested scrolling components won't be in conflict.\n* Label: added ALTERNATE_NAME_HEADING for larger text and ALTERNATE_NAME_DETAIL for smaller text.\n* Default item renderers: better handling of data and fields.\n* Default item renderers: support for delaying texture creation on scroll in ImageLoaders.\n* Default item renderers: updates isEnabled on accessory, if applicable.\n* Default item renderers: accessory is cleared if itemHasAccessory is set to false.\n* Default item renderers: fix for measurement when label is missing and gap isn't needed.\n* DefaultGroupedListHeaderOrFooterRenderer: contentLabel maxWidth is used for proper wrapping, if needed.\n* DefaultGroupedListHeaderOrFooterRenderer: added support for justify alignments.\n* Many performance improvements with the help of Adobe Scout.\n* All built-in components ensure that sub-components are validated.\n* Examples: use drawers component where applicable.\n* Examples: new DrawersExplorer example.\n* Examples: new DragAndDrop example for DragDropManager.\n* Themes: updated to support new properties and alternate names.\n* Documentation: many properties now list default values.\n* Documentation: createSubComponent() and autoSizeIfNeeded() patterns are now documented parts of the architecture.\n* Fixes to better support iOS 7.\n* New minimum runtime versions. Target SWF version rolled back to 18 (Flash Player 11.5 and AIR 3.5) to offer easier BlackBerry 10 support.\n\n### 1.2.0 Deprecated APIs\n\nAll deprecated APIs are subject to the [Feathers deprecation policy](https://feathersui.com/help/deprecation-policy.html). Please migrate to the new APIs as soon as possible because the deprecated APIs **will** be removed in a future version of Feathers.\n\nThe `scrollerProperties` property on scrolling components, including List, GroupedList, ScrollText and ScrollContainer is deprecated. Because these components now extend `Scroller` instead of adding a `Scroller` as a child, all of the properties that could be set through `scrollerProperties` can now be set directly on the components. The `scrollerProperties` property was deprecated in Feathers 1.1.0, and it remains deprecated in Feathers 1.2.0. \n\n### 1.2.0 API Changes\n\nSome changes have been made to Feathers that have the potential to break code in existing projects. Changes of this type are considered [exceptions to the Feathers deprecation policy](https://feathersui.com/help/deprecation-policy.html#exceptions), and careful consideration is made to limit the impact of these changes on existing projects. Most developers using Feathers will not be affected by these changes, except perhaps, to observe improved stability and consistency.\n\n#### PopUpManager\n\nTwo changes have been made to the `PopUpManager`.\n\nThe function `isTopLevelPopUp()` has been modified to indicate if a pop-up is above the top-most modal overlay. Previously, this function indicated if a pop-up is the single top-most pop-up.\n\nWhen a pop-up is centered when calling `PopUpManager.addPopUp()`, the `PopUpManager` will automatically realign the pop-up if the stage or the pop-up is resized. If you prefer that the pop-up isn't realigned, change the argument to `false` and call `PopUpManager.centerPopUp()` instead. It will align the pop-up only once. If you previously manually repositioned the pop-up to keep it centered when it or the stage resized, you may remove that code. However, if the code remains, it should not cause conflicts with the new behavior.\n\n#### IVirtualLayout\n\nThree changes have been made to the `IVirtualLayout` interface. Custom implementations of `IVirtualLayout` created before Feathers 1.2.0 will have compiler errors until the required changes are made. It is expected that a small number of Feathers developers have created custom implementations of `IVirtualLayout`, so this change will have no impact on the majority of projects that are upgraded from older versions of Feathers.\n\nThe `typicalItemWidth` and `typicalItemHeight` properties may be removed completely from custom `IVirtualLayout` implementations. In their place, the `typicalItem` property must be added. Components like `List` previously passed pre-calculated width and height values for a typical item display object. However, a layout may need to manipulate the typical item before calculating its dimensions. By giving more control to the layouts, their estimation of virtualized items will be more accurate.\n\nThe new `typicalItem` property might be declared as follows:\n\n\t/**\n\t * @private\n\t */\n\tprotected var _typicalItem:DisplayObject;\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic function get typicalItem():DisplayObject\n\t{\n\t\treturn this._typicalItem;\n\t}\n\n\t/**\n\t * @private\n\t */\n\tpublic function set typicalItem(value:DisplayObject):void\n\t{\n\t\tif(this._typicalItem == value)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tthis._typicalItem = value;\n\t\tthis.dispatchEventWith(Event.CHANGE);\n\t}\n\nUsage of the new `typicalItem` property may depend on factors that are specific to each implementation. In general, an implementation will measure the typical item at the beginning of most of its public functions, including `layout()`, `getScrollPositionForIndex()`, `getVisibleIndicesAtScrollPosition()`, and `measureViewPort()`. If the typical item is a Feathers control, it should be validated. The following snippet shows the most basic case for how to request the typical item's dimensions:\n\n\tvar measuredTypicalItemWidth:Number = 0;\n\tvar measuredTypicalItemHeight:Number = 0;\n\tif( this._useVirtualLayout && this._typicalItem )\n\t{\n\t\tif( this._typicalItem is IFeathersControl )\n\t\t{\n\t\t\t//validate the typical item so that it reports the correct width and height\n\t\t\tthis._typicalItem.validate();\n\t\t}\n\n\t\tmeasuredTypicalItemWidth = this._typicalItem.width;\n\t\tmeasuredTypicalItemHeight = this._typicalItem.height;\n\t}\n\nIf the typical item is a Feathers control, validate() should be called before requesting its dimensions. Optionally, the dimensions of a Feathers control may be reset to `NaN` in order to ask the control for its ideal dimensions. This will match the behavior introduced Feathers 1.1.x. However, in Feathers 1.2.0, the built-in layouts have chosen to reset the typical item's dimensions only when a flag is enabled. For many layouts, resetting the dimensions of the typical item is rarely required, and it may be undesireable. This change reverts the behavior to match Feathers 1.0.x, while still allowing advanced developers to re-enable the behavior introduced in Feathers 1.1.x.\n\nFor more advanced code, take a look at one of the built-in layout classes, such as `VerticalLayout`.\n\nNote: The built-in layout classes repurpose the `typicalItemWidth` and `typicalItemHeight` properties that were removed from `IVirtualLayout` to work with a new `resetTypicalItemDimensionsOnMeasure` property. By default, setting these properties outside of a component like `List` will have no effect, which exactly matches the behavior from all older versions of Feathers. Custom layouts may elect to provide this same capability, but it is not required by the `IVirtualLayout` interface.\n\n#### GroupedList\n\nThe `typicalHeader` and `typicalFooter` properties have been removed from `GroupedList` to support the better handling of typical items in virtual layouts, as discussed above. From now on, the `typicalItem` on a `GroupedList` is the only way to provide hints to the layout used by a `GroupedList`.\n\n## 1.1.1 - September 2013\n\nThis release includes minor updates to support Starling Framework 1.4 and a number of minor bug fixes.\n\n* Switches to Starling's implementation of the clipRect property.\n* Uses Texture onRestore for internally managed textures, like in text controls.\n* StageTextTextEditor: fix for displayAsPassword clearing the text.\n* Panel: won't scroll if mouse wheel or touch occurs in header or footer.\n* Panel: header and footer can be touched when content is scrolling.\n* AeonDesktopTheme: uses a better disabled text color.\n* SmartDisplayObjectStateValueSelector: properly supports uint color value of 0.\n* Item Renderers: smarter handling of accessory resizing.\n* Item Renderers: better measurement to account for NaN.\n* Item Renderers: properly checks for _data, in addition to _owner, in commitData().\n* Label: sets proper text renderer dimensions if height is explicitly set.\n* Radio: better handling of setting toggleGroup to avoid accidentally adding to defaultRadioGroup.\n* Scroller: properly updates isEnabled on scroll bars when they are first created.\n* Scroller: child touches are blocked until throw animation finishes to match native behavior.\n* Scroll bars: better isEnabled handling.\n* TextInput: better handling of focus when not visible.\n* TextInput: better prompt handling.\n* TextInput: fix to allow TextFieldTextEditor to be selected on focus in.\n* TextInput: added clearFocus() to allow programmatic removal of focus in NumericStepper.\n* TextFieldTextEditor: snapshot is properly hidden when text is cleared.\n* ButtonGroup: properly resizes when data provider changes.\n* GroupedList: requests proper typical item from data provider.\n* ScrollText: better padding getter.\n* PickerList: closes pop-up list on Event.TRIGGERED.\n* PickerList: properly disposes pop-up list and IPopUpContentManager.\n* NumericStepper: if TextInput sub-component is editable, it will be selected on focus in.\n* TiledRowsLayout, TiledColumnsLayout: fixed manageVisibility implementation.\n* TiledRowsLayout, TiledColumnsLayout: fixed bad positioning when useSquareTiles is true.\n\n## 1.1.0 - June 2013\n\n* New Beta Component: NumericStepper. Add and subtract from a numeric value with buttons. Optional text editing.\n* New Beta Component: TextArea. A multiline text input. Recommended for desktop only. Not recommended for mobile.\n* New Beta Component: Panel. A new container subclassing ScrollContainer that adds a header and an optional footer.\n* New Beta Component: PanelScreen. An IScreen implementation (similar to Screen) based on Panel.\n* New Beta Layout: AnchorLayout. Added to support fluid layouts and relative positioning. Can position relative to parent container and also to other children of the parent container.\n* Added FocusManager for keyboard navigation and interaction. Not intended for mobile. Use a desktop theme or set `FocusManager.isEnabled = true`. TextInput *cannot* use StageTextTextEditor when focus management is enabled. TextFieldTextEditor is recommended.\n* All Components: sub-components are created from factories and can receive custom names for theming.\n* Added ILayoutObject interface to support extra data for layouts to use, like includeInLayout property.\n* List: support for optional multiple selection.\n* TextInput: supports prompt/hint\n* TextInput/StageTextTextEditor: supports multiline on mobile.\n* PickerList: supports prompt when no item is selected.\n* Slider: measurement now includes thumb dimensions and a new property called trackScaleMode has been added.\n* Callout: disposal is more consistent. Set combination of disposeOnSelfClose and disposeContent.\n* Callout: doesn't close when origin is touched. origin should now separately determine correct behavior.\n* Callout: added origin and supportedDirections properties to make Callout capable of switching origins after creation.\n* Item Renderers: properly handle accessory resizing if accessory is a FeathersControl.\n* Item Renderers: fixes for a number of layout order, gap, and alignment combinations.\n* PickerList: doesn't close when touching scroll bar. only item renderer touch will trigger a close.\n* PopUpManager: Supports custom root to place pop-ups somewhere other than the stage.\n* PopUpManager: modal pop-ups receive a different focus manager.\n* ScreenNavigator: added hasScreen(), getScreen(), and getScreenIDs().\n* ScreenNavigator: added autoSizeMode property to select between sizing to fit stage or to fit content.\n* ScreenNavigator: fix for broken transition if showScreen() is calleed before transition begins but after new screen is added to stage.\n* Transitions: fix for quickStack constructor argument.\n* ScrollContainer, List, GroupedList: better auto-sizing with a background skin.\n* ScrollContainer: new alternate name for toolbar style.\n* TextInput: exposed isEditable, maxChars, restrict, and displayAsPassword properties.\n* BitmapFontTextRenderer, Scale3Image, Scale9Image: option to turn off the use of a separate QuadBatch.\n* TextFieldTextEditor: better selection on mobile.\n* TextFieldTextEditor: properly dispatches FeathersEventType.ENTER.\n* Text Renderers and Editors: better snapshot disposal.\n* TextFieldTextRenderer: better measurement to workaround runtime dimensions being wrong.\n* TiledRowsLayout, TiledColumnsLayout: supports separate horizontal and vertical gaps.\n* TiledRowsLayout, TiledColumnsLayout: more stable virtualized item renderer count to improve performance.\n* TiledRowsLayout, TiledColumnsLayout: fixes for certain issues with paging.\n* ButtonGroup: supports isEnabled as a property in the data provider.\n* ImageLoader: added delayTextureCreation flag to avoid creating textures while scrolling (or during any action that requires best performance).\n* Scroller: adds an invisible overlay during scrolling to block touch events on children.\n* Scroller: exposes horizontal and vertical page count properties.\n* Scroller: added FeathersEventType.SCROLL_START event.\n* Scroller: scroll bars are hidden when stopScrolling() is called.\n* Scroller: fix for velocity calculation.\n* Button: better detection of click to avoid other display objects moving on top of button before TouchPhase.ENDED.\n* Button: new styles for themes, including back, forward, call-to-action, quiet, and danger.\n* List: if items are added or removed, selected indices are adjusted.\n* List, GroupedList, ScrollContainer, and ScrollText all extend Scroller, instead of using it as a sub-component. The scrollerProperties property on each of these is now deprecated because all public properties of Scroller are now direct public properties of these components. Theme initializers that target Scroller will break because Scroller is no longer a sub-component, but a super class of classes like List. Move this stuff into initializers for List, GroupedList, ScrollContainer, and ScrollText.\n* FeathersControl: setSizeInternal() is now stricter. It can never receive a NaN value for width or height. This is a common source of bugs, and throwing an error here will help make it easier to find those bugs.\n* IVariableVirtualLayout: added function addToVariableVirtualCacheAtIndex() for more specific control over the cache of item dimensions.\n* IVariableVirtualLayout: added function removeFromVariableVirtualCacheAtIndex() for more specific control over the cache of item dimensions.\n* ScrollText: now properly handles visible and alpha properties.\n* ListCollection: added removeAll(), addAll(), addAllAt() and contains().\n* Scroller: scrolling animates for mouse wheel.\n* List, VerticalLayout, HorizontalLayout: optimized case where useVirtualLayout is true and hasVariableItemDimensions is false.\n* HorizontalLayout, VerticalLayout, TiledRowsLayout, TiledColumnsLayout: added manageVisibility property to set items to false when not in view. Set to true to improve performance.\n* Item Renderers: added stopScrollingOnAccessoryTouch property to make accessory touch behavior configurable.\n* Screen: default value of originalDPI is DeviceCapabilities.dpi. It used to be 168. Can still be changed.\n* MetalWorksMobileTheme and MinimalMobileTheme: major overhaul with improved skins and new alternate skins.\n* AeonDesktopTheme: added some missing skins, like TabBar.\n* AeonDesktopTheme: uses FocusManager.\n* AzureMobileTheme: removed this example theme. Please feel free to continue using the old version, if desired.\n* ComponentsExplorer: better button screen to show off various styles of buttons.\n* Todos: new example.\n* All Examples: Use PanelScreen instead of Screen and Header where appropriate.\n* All Examples: Use AnchorLayout where appropriate.\n* All Examples: Uses NumericStepper instead of Slider where appropriate.\n* Added 96x96 icons to examples for Android xhdpi. Requires AIR 3.7.\n* Extended API documentation with inline examples and improved descriptions.\n* Added many new articles to the Feathers Manual.\n* Now built with ASC 2.0.\n\n### 1.1.0 Deprecated APIs\n\nAll deprecated APIs are subject to the [Feathers deprecation policy](https://feathersui.com/help/deprecation-policy.html). Please migrate to the new APIs as soon as possible because the deprecated APIs **will** be removed in a future version of Feathers.\n\nThe `scrollerProperties` property on scrolling components, including List, GroupedList, ScrollText and ScrollContainer is deprecated. Because these components now extend `Scroller` instead of adding a `Scroller` as a child, all of the properties that could be set through `scrollerProperties` can now be set directly on the components.\n\n### 1.1.0 API Changes\n\nSome changes have been made to Feathers that have the potential to break code in existing projects. Changes of this type are considered [exceptions to the Feathers deprecation policy](https://feathersui.com/help/deprecation-policy.html#exceptions), and careful consideration is made to limit the impact of these changes on existing projects. Most developers using Feathers will not be affected by these changes, except perhaps, to observe improved stability and consistency.\n\n#### IVariableVirtualLayout\n\nTwo changes have been made to the `IVariableVirtualLayout` interface. Custom implementations of `IVariableVirtualLayout` created before Feathers 1.1.0 will have compiler errors until the required changes are made. It is expected that a very small number of Feathers developers have created custom implementations of `IVariableVirtualLayout`, so this change will have no impact on the vast majority of projects that are upgraded from older versions of Feathers.\n\nThe functions `addToVariableVirtualCacheAtIndex()` and `removeFromVariableVirtualCacheAtIndex()` have been added to `IVariableVirtualLayout` to provide lower-level control over the cache of item dimensions. Instead of clearing the entire cache, a component may insert or remove a specific index from the cache. For instance, the `List` component uses these functions when its data provider is manipulated. These functions allow the layout to provide more accuracy to its virtualization and to improve performance.\n\n These two functions can easily simulate the old behavior from Feathers 1.0.x, if required. The following implementations of `addToVariableVirtualCacheAtIndex()` and `removeFromVariableVirtualCacheAtIndex()` can easily be copied into a custom implementations of `IVariableVirtualLayout` to quickly migrate existing Feathers 1.0.x implementations to behave exactly the same in Feathers 1.1.0:\n\n\tpublic function addToVariableVirtualCacheAtIndex(index:int, item:DisplayObject = null):void\n\t{\n\t\tthis.resetVariableVirtualCache();\n\t}\n\n\tpublic function removeFromVariableVirtualCacheAtIndex(index:int, item:DisplayObject = null):void\n\t{\n\t\tthis.resetVariableVirtualCache();\n\t}\n\n## 1.0.1 - February 2013\n\nThis release includes a number of bug fixes.\n\n* Scroller: FeathersEventType.SCROLL_COMPLETE always dispatched after last Event.SCROLL.\n* ScrollBar, SimpleScrollBar: thumb position properly accounts for padding.\n* Scroller: mouse wheel detection properly accounts for contentScaleFactor.\n* ScreenNavigator: calling clearScreen() during a transition no longer causes a stack overflow.\n* ScrollBar, SimpleScrollBar: can drag to minimum and maximum if they aren't a multiple of the step.\n* Header: Fix for runtime error when rightItems aren't IFeathersDisplayObjects\n* TextInput: better selection/cursor recovery when changing text programmatically.\n* TextInput: Moved fontSize contentScaleFactor multiplication into StageTextTextEditor.\n* FeathersControl: requires isInitialized to be true before it can validate.\n* FeathersControl: clipRect properly accounts for scale.\n* GroupedList: added missing documentation for setSelectedLocation().\n* ImageLoader: does a better job keeping aspect ratio when only one dimension is explicit.\n* ImageLoader: properly scales content when dimensions are explicit.\n* ImageLoader: no runtime errors if content loads after dispose.\n* ScrollContainer, List, GroupedList, ScrollText: fix for detecting changes in scrollToPageIndex().\n\n## 1.0.0 - January 2013\n\nNo major API changes since 1.0.0 BETA. Mostly bug fixes and minor improvements.\n\n* Fix for memory leaks in List, GroupedList, and ImageLoader\n* PageIndicator properly handles ImageLoader or other IFeathersControl as symbol\n* IGroupedListHeaderOrFooterRenderer extends IFeathersControl\n* Header: fix for \"middle\" vertical alignment\n* Updated for Starling Framework 1.3\n\n## 1.0.0 BETA - December 2012\n\nInitial release. The following major changes happened in the last month or two leading to the beta.\n\n* GTween library removed as a dependency. All animations switched to the Starling `Tween` class.\n* as3-signals library removed as a dependency. Switched to Starling events.\n* `TextInput`: supports swappable text editors, similar to the text renderers used for uneditable text. The default `StageTextTextEditor` uses `StageText` to allow text input, which is ideal for mobile. The `TextFieldTextEditor` uses a `TextField` of `TextFieldType.INPUT` instead, and it may be a better choice for desktop. A static function, `defaultTextEditorFactory`, has been added to `FeathersControl`.\n* `TextInput`: now has events for focus in and out.\n* Item renderers: Switched to `ImageLoader` for icon and accessory textures, which has a `source` property that supports `Texture` instances or `String` URLs to load textures from the web. Properties like `iconTextureField` and `accessoryTextureFunction` now have new names like `iconSourceField` and `accessorySourceFunction` because values other than textures are now allowed. Similarly, `iconImageFactory` and `accessoryImageFactory` have been renamed to `iconLoaderFactory` and `accessoryLoaderFactory`.\n* Item renderers: accessory may be positioned. See `layoutOrder` and `accessoryPosition` properties.\n* Added `dispose()` method to `AddedWatcher` so that theme resources like textures be disposed.\n* Added `ScrollText` component to display text in an overlay on the native display list. Useful for long passages of text that may be too large to convert to a texture.\n* `ScreenNavigator`: added events for transition start and complete.\n* `ToggleSwitch`: `TRACK_LAYOUT_MODE_STRETCH` is now `TRACK_LAYOUT_MODE_ON_OFF`.\n* `Slider`: `TRACK_LAYOUT_MODE_STRETCH` is now `TRACK_LAYOUT_MODE_MIN_MAX`.\n* `ScrollBar`: `TRACK_LAYOUT_MODE_STRETCH` is now `TRACK_LAYOUT_MODE_MIN_MAX`.\n"
  },
  {
    "path": "LICENSE.md",
    "content": "Simplified BSD License\n======================\n\nCopyright 2012-2021 Bowler Hat LLC. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer. \n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution. \n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nThe views and conclusions contained in the software and documentation are those\nof the authors and should not be interpreted as representing official policies, \neither expressed or implied, of the copyright holders."
  },
  {
    "path": "README.md",
    "content": "# Feathers (AS3/Starling) 4.2.0\n\nSay hello to [Feathers UI (AS3/Starling)](https://feathersui.com/learn/as3-starling), a library of light-weight, skinnable, and extensible UI controls for mobile and desktop. The components run on [Starling Framework](https://gamua.com/starling/) and [Adobe AIR](http://airsdk.dev) — offering blazing fast GPU powered graphics to create a smooth and responsive experience. Build completely standalone, native applications on iOS, Android, Windows, and macOS, or target Adobe Flash Player in desktop browsers. Created by [Josh Tynjala](https://joshblog.net) from Bowler Hat LLC, Feathers UI is free and open source.\n\n## Quick Links\n\n* [Website](https://feathersui.com/learn/as3-starling/)\n* [Help](https://feathersui.com/learn/as3-starling/getting-started)\n* [API Reference](https://feathersui.com/api-reference/)\n* [Discussion Forum](https://forum.starling-framework.org/t/feathers)\n* [Github Project](https://github.com/feathersui/feathersui-starling)\n\n## Minimum Requirements\n\n* Adobe AIR 50\n* Starling Framework 2.7\n\n## Downloads\n\nVisit [Feathers Installation (AS3/Starling version)](https://feathersui.com/learn/as3-starling/installation/) to download the latest stable version of Feathers for ActionScript 3.0 and Starling Framework."
  },
  {
    "path": "build.properties",
    "content": "#this folder should contain the contents of starling.zip/starling/src\nstarling.root = ${basedir}/third-party/starling\n\n#this folder should contain the SWC files for flexunit, as described here:\n#https://github.com/Gamua/Starling-Framework/blob/v1.7/tests/README.md\n#additionally, it should contain the JAR files for the flexunit ant tasks\nflexunit.root = ${basedir}/third-party/flexunit\n\n# The location of the flexunit jar\nflexunit.tasks = ${flexunit.root}/flexUnitTasks-4.2.0-20140410.jar\n\nsource.root = ${basedir}/source\nexamples.root = ${basedir}/examples\nthemes.root = ${basedir}/themes\napi.root = ${basedir}/documentation/api-reference\nhelp.root = ${basedir}/documentation/help\ntest.root = ${basedir}/test\n\noutput.path = ${basedir}/output\ndependency.output = ${output.path}/dependencies\nswc.output = ${output.path}/swc\nhelp.output = ${output.path}/help\napi.output = ${output.path}/api-reference\nsource.output = ${output.path}/source\nexamples.output = ${output.path}/examples\nthemes.output = ${output.path}/themes\n\nswc.file = feathers.swc\n\nswf.version = 30\n\nfeathers.version = 4.2.0\n\napm.lib.file = feathersui_${feathers.version}.airpackage\napm.src.file = feathersui-source_${feathers.version}.airpackage\n\nfooter.text = <a href='https://feathersui.com/' target='_top'>Feathers</a> | <a href='https://github.com/BowlerHatLLC/feathersui-starling' target='_top'>Github Project</a> | <a href='https://forum.starling-framework.org/forum/feathers' target='_top'>Support Forum</a>"
  },
  {
    "path": "build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<project name=\"feathers\" default=\"swc\" basedir=\".\">\n\t\n\t<!-- build.local.properties and sdk.local.proprties are optional files that\n\t\tcan be used to override the default properties. -->\n\t<property file=\"./sdk.local.properties\"/>\n\t<property file=\"./sdk.properties\"/>\n\t<property file=\"./build.local.properties\"/>\n\t<property file=\"./build.properties\"/>\n\t<taskdef resource=\"flexUnitTasks.tasks\" classpath=\"${flexunit.tasks}\"/>\n\n\t<target name=\"swc\" depends=\"-feathers,-cleanup\" description=\"builds .swc file only\"/>\n\n\t<target name=\"api\" depends=\"-api,-cleanup\" description=\"builds API reference only\"/>\n\n\t<target name=\"test\" depends=\"-test,-cleanup\" description=\"runs automated tests\"/>\n\n\t<target name=\"full\" depends=\"-feathers,-test,-api,-themes,-includes,-cleanup\" description=\"builds distribution, but doesn't package as .zip file\">\n\n\t\t<!-- move feathers.swc to its final location for distribution.\n\t\t\tbasically, we didn't want the extra swc directory for a quick build. -->\n\n\t\t<copy overwrite=\"true\" todir=\"${swc.output}\">\n\t\t\t<fileset dir=\"${output.path}\">\n\t\t\t\t<include name=\"${swc.file}\"/>\n\t\t\t</fileset>\n\t\t</copy>\n\t\t<delete file=\"${output.path}/${swc.file}\"/>\n\t</target>\n\n\t<target name=\"apm\" depends=\"-apm,-cleanup\" description=\"builds apm package\">\n\t\t<delete file=\"${output.path}/${swc.file}\"/>\n\t\t<delete dir=\"${themes.output}\" includeemptydirs=\"true\"/>\n\t</target>\n\n\t<target name=\"package\" depends=\"full\" description=\"builds and packages a .zip file for distribution\">\n\t\t<zip destfile=\"${output.path}/feathers-ui-${feathers.version}.zip\">\n\t\t\t<zipfileset dir=\"${output.path}\"/>\n\t\t</zip>\n\n\t\t<delete includeemptydirs=\"true\">\n\t\t\t<fileset dir=\"${output.path}\" excludes=\"feathers-ui-${feathers.version}.zip\"/>\n\t\t</delete>\n\t</target>\n\n\t<target name=\"-prepare\">\n\t\t<delete dir=\"${output.path}\"/>\n\n\t\t<loadfile srcFile=\"${source.root}/feathers/FEATHERS_VERSION.as\" property=\"version.test\">\n\t\t\t<filterchain>\n\t\t\t\t<linecontains>\n\t\t\t\t\t<contains value=\"public const FEATHERS_VERSION:String\"/>\n\t\t\t\t</linecontains>\n\t\t\t\t<tokenfilter>\n\t\t\t\t\t<containsstring contains=\"${feathers.version}\"/>\n\t\t\t\t</tokenfilter>\n\t\t\t</filterchain>\n\t\t</loadfile>\n\t\t<fail unless=\"version.test\" message=\"feathers.FEATHERS_VERSION contains incorrect version string.\"/>\n\t</target>\n\n\t<target name=\"-cleanup\">\n\t\t<delete dir=\"${dependency.output}\" includeemptydirs=\"true\"/>\n\t\t<delete dir=\"${output.path}/apm\" includeemptydirs=\"true\"/>\n\t\t<delete dir=\"${output.path}/apm-src\" includeemptydirs=\"true\"/>\n\t</target>\n\n\t<target name=\"-starling\" depends=\"-prepare\">\n\t\t<echo message=\"Building starling.swc\"/>\n\t\t<java jar=\"${compc}\" dir=\"${starling.root}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${flashplayer.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-source-path+=.\"/>\n\t\t\t<arg value=\"-include-sources+=.\"/>\n\t\t\t<arg value=\"-output=${dependency.output}/starling.swc\"/>\n\t\t</java>\n\t</target>\n\n\t<target name=\"-feathers\" depends=\"-starling,-api-xml\">\n\t\t<echo message=\"Building ${swc.file}\"/>\n\t\t<java jar=\"${compc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${flashplayer.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-source-path+=${source.root}\"/>\n\t\t\t<arg value=\"-include-sources+=${source.root}\"/>\n\t\t\t<arg value=\"-external-library-path+=${dependency.output}\"/>\n\t\t\t<arg value=\"-output=${output.path}/${swc.file}\"/>\n\t\t</java>\n\t\t<echo message=\"Inserting asdoc XML into .swc\"/>\n\t\t<zip destfile=\"${output.path}/${swc.file}\" update=\"true\">\n\t\t\t<zipfileset dir=\"${dependency.output}/tempdita\" prefix=\"docs\">\n\t\t\t\t<include name=\"*.*\"/>\n\t\t\t\t<exclude name=\"ASDoc_Config.xml\" />\n\t\t\t\t<exclude name=\"overviews.xml\" />\n\t\t\t</zipfileset>\n\t\t</zip>\n\t</target>\n\n\t<target name=\"-api\" depends=\"-starling\">\n\t\t<echo message=\"Generating API Reference\"/>\n\t\t<java jar=\"${asdoc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"+flexlib=${flashsdk.framework}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-source-path+=${source.root}\"/>\n\t\t\t<arg value=\"-library-path+=${dependency.output}\"/>\n\t\t\t<arg value=\"-doc-sources+=${source.root}\"/>\n\n\t\t\t<!-- these two arguments are needed after switching to the AIR SDK\n\t\t\t\twith ASC 2.0 to stop weird errors -->\n\t\t\t<arg value=\"-theme=\"/>\n\t\t\t<arg value=\"-compiler.fonts.local-fonts-snapshot=\"/>\n\n\t\t\t<arg value=\"-templates-path\"/>\n\t\t\t<arg value=\"${api.root}/templates\"/>\n\t\t\t<arg value=\"-main-title=Feathers (Starling) ${feathers.version} API Reference\"/>\n\t\t\t<arg value=\"-window-title=Feathers (Starling) API Reference\"/>\n\t\t\t<arg value=\"-footer=${footer.text}\"/>\n\t\t\t<arg value=\"-package-description-file=${api.root}/package-descriptions.xml\"/>\n\t\t\t<arg value=\"-output=${api.output}\"/>\n\t\t</java>\n\t</target>\n\n\t<target name=\"-api-xml\" depends=\"-starling\">\n\t\t<echo message=\"Generating asdoc XML\"/>\n\t\t<java jar=\"${asdoc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"+flexlib=${flashsdk.framework}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-source-path+=${source.root}\"/>\n\t\t\t<arg value=\"-library-path+=${dependency.output}\"/>\n\t\t\t<arg value=\"-doc-sources+=${source.root}\"/>\n\n\t\t\t<!-- these two arguments are needed after switching to the AIR SDK\n\t\t\t\twith ASC 2.0 to stop weird errors -->\n\t\t\t<arg value=\"-theme=\"/>\n\t\t\t<arg value=\"-compiler.fonts.local-fonts-snapshot=\"/>\n\n\t\t\t<arg value=\"-keep-xml=true\"/>\n\t\t\t<arg value=\"-skip-xsl=true\"/>\n\t\t\t<arg value=\"-package-description-file=${api.root}/package-descriptions.xml\"/>\n\t\t\t<arg value=\"-output=${dependency.output}\"/>\n\t\t</java>\n\t</target>\n\n\t<target name=\"-themes\" depends=\"-feathers\">\n\t\t<echo message=\"Building AeonDesktopTheme.swc\"/>\n\t\t<java jar=\"${compc}\" dir=\"${themes.root}/AeonDesktopTheme\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${airmobile.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-source-path+=${themes.root}/AeonDesktopTheme/source\"/>\n\t\t\t<arg value=\"-include-sources+=${themes.root}/AeonDesktopTheme/source\"/>\n\t\t\t<arg value=\"-external-library-path+=${dependency.output}\"/>\n\t\t\t<arg value=\"-external-library-path+=${output.path}/${swc.file}\"/>\n\t\t\t<arg value=\"-output=${themes.output}/AeonDesktopTheme/swc/AeonDesktopTheme.swc\"/>\n\t\t</java>\n\n\t\t<echo message=\"Building MetalWorksDesktopTheme.swc\"/>\n\t\t<java jar=\"${compc}\" dir=\"${themes.root}/MetalWorksDesktopTheme\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${airmobile.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-source-path+=${themes.root}/MetalWorksDesktopTheme/source\"/>\n\t\t\t<arg value=\"-include-sources+=${themes.root}/MetalWorksDesktopTheme/source\"/>\n\t\t\t<arg value=\"-external-library-path+=${dependency.output}\"/>\n\t\t\t<arg value=\"-external-library-path+=${output.path}/${swc.file}\"/>\n\t\t\t<arg value=\"-output=${themes.output}/MetalWorksDesktopTheme/swc/MetalWorksDesktopTheme.swc\"/>\n\t\t</java>\n\n\t\t<echo message=\"Building MetalWorksMobileTheme.swc\"/>\n\t\t<java jar=\"${compc}\" dir=\"${themes.root}/MetalWorksMobileTheme\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${airmobile.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-source-path+=${themes.root}/MetalWorksMobileTheme/source\"/>\n\t\t\t<arg value=\"-include-sources+=${themes.root}/MetalWorksMobileTheme/source\"/>\n\t\t\t<arg value=\"-external-library-path+=${dependency.output}\"/>\n\t\t\t<arg value=\"-external-library-path+=${output.path}/${swc.file}\"/>\n\t\t\t<arg value=\"-output=${themes.output}/MetalWorksMobileTheme/swc/MetalWorksMobileTheme.swc\"/>\n\t\t</java>\n\n\t\t<echo message=\"Building MinimalDesktopTheme.swc\"/>\n\t\t<java jar=\"${compc}\" dir=\"${themes.root}/MinimalDesktopTheme\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${airmobile.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-source-path+=${themes.root}/MinimalDesktopTheme/source\"/>\n\t\t\t<arg value=\"-include-sources+=${themes.root}/MinimalDesktopTheme/source\"/>\n\t\t\t<arg value=\"-external-library-path+=${dependency.output}\"/>\n\t\t\t<arg value=\"-external-library-path+=${output.path}/${swc.file}\"/>\n\t\t\t<arg value=\"-output=${themes.output}/MinimalDesktopTheme/swc/MinimalDesktopTheme.swc\"/>\n\t\t</java>\n\n\t\t<echo message=\"Building MinimalMobileTheme.swc\"/>\n\t\t<java jar=\"${compc}\" dir=\"${themes.root}/MinimalMobileTheme\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${airmobile.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-source-path+=${themes.root}/MinimalMobileTheme/source\"/>\n\t\t\t<arg value=\"-include-sources+=${themes.root}/MinimalMobileTheme/source\"/>\n\t\t\t<arg value=\"-external-library-path+=${dependency.output}\"/>\n\t\t\t<arg value=\"-external-library-path+=${output.path}/${swc.file}\"/>\n\t\t\t<arg value=\"-output=${themes.output}/MinimalMobileTheme/swc/MinimalMobileTheme.swc\"/>\n\t\t</java>\n\n\t\t<echo message=\"Building TopcoatLightMobileTheme.swc\"/>\n\t\t<java jar=\"${compc}\" dir=\"${themes.root}/TopcoatLightMobileTheme\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${airmobile.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-source-path+=${themes.root}/TopcoatLightMobileTheme/source\"/>\n\t\t\t<arg value=\"-include-sources+=${themes.root}/TopcoatLightMobileTheme/source\"/>\n\t\t\t<arg value=\"-external-library-path+=${dependency.output}\"/>\n\t\t\t<arg value=\"-external-library-path+=${output.path}/${swc.file}\"/>\n\t\t\t<arg value=\"-output=${themes.output}/TopcoatLightMobileTheme/swc/TopcoatLightMobileTheme.swc\"/>\n\t\t</java>\n\t</target>\n\n\t<target name=\"-includes\">\n\t\t<echo message=\"Copying Feathers source code\"/>\n\t\t<copy overwrite=\"true\" todir=\"${source.output}\">\n\t\t\t<fileset dir=\"${source.root}\"/>\n\t\t</copy>\n\t\t\t\t\n\t\t<echo message=\"Copying informational documents\"/>\n\t\t<copy overwrite=\"true\" todir=\"${output.path}\">\n\t\t\t<fileset dir=\"${basedir}\">\n\t\t\t\t<include name=\"README.md\"/>\n\t\t\t\t<include name=\"LICENSE.md\"/>\n\t\t\t\t<include name=\"CHANGELOG.md\"/>\n\t\t\t</fileset>\n\t\t</copy>\n\n\t\t<echo message=\"Copying theme source code and assets\"/>\n\n\t\t<copy overwrite=\"true\" todir=\"${themes.output}/AeonDesktopTheme\">\n\t\t\t<fileset dir=\"${themes.root}/AeonDesktopTheme\">\n\t\t\t\t<include name=\"README.md\"/>\n\t\t\t\t<include name=\"source/**\"/>\n\t\t\t\t<include name=\"assets/**\"/>\n\t\t\t</fileset>\n\t\t</copy>\n\n\t\t<copy overwrite=\"true\" todir=\"${themes.output}/MetalWorksDesktopTheme\">\n\t\t\t<fileset dir=\"${themes.root}/MetalWorksDesktopTheme\">\n\t\t\t\t<include name=\"README.md\"/>\n\t\t\t\t<include name=\"source/**\"/>\n\t\t\t\t<include name=\"assets/**\"/>\n\t\t\t</fileset>\n\t\t</copy>\n\n\t\t<copy overwrite=\"true\" todir=\"${themes.output}/MetalWorksMobileTheme\">\n\t\t\t<fileset dir=\"${themes.root}/MetalWorksMobileTheme\">\n\t\t\t\t<include name=\"README.md\"/>\n\t\t\t\t<include name=\"source/**\"/>\n\t\t\t\t<include name=\"assets/**\"/>\n\t\t\t</fileset>\n\t\t</copy>\n\n\t\t<copy overwrite=\"true\" todir=\"${themes.output}/MinimalDesktopTheme\">\n\t\t\t<fileset dir=\"${themes.root}/MinimalDesktopTheme\">\n\t\t\t\t<include name=\"README.md\"/>\n\t\t\t\t<include name=\"source/**\"/>\n\t\t\t\t<include name=\"assets/**\"/>\n\t\t\t</fileset>\n\t\t</copy>\n\n\t\t<copy overwrite=\"true\" todir=\"${themes.output}/MinimalMobileTheme\">\n\t\t\t<fileset dir=\"${themes.root}/MinimalMobileTheme\">\n\t\t\t\t<include name=\"README.md\"/>\n\t\t\t\t<include name=\"source/**\"/>\n\t\t\t\t<include name=\"assets/**\"/>\n\t\t\t</fileset>\n\t\t</copy>\n\n\t\t<copy overwrite=\"true\" todir=\"${themes.output}/TopcoatLightMobileTheme\">\n\t\t\t<fileset dir=\"${themes.root}/TopcoatLightMobileTheme\">\n\t\t\t\t<include name=\"README.md\"/>\n\t\t\t\t<include name=\"source/**\"/>\n\t\t\t\t<include name=\"assets/**\"/>\n\t\t\t</fileset>\n\t\t</copy>\n\n\t\t<echo message=\"Copying examples\"/>\n\n\t\t<copy overwrite=\"true\" todir=\"${examples.output}/ComponentsExplorer\">\n\t\t\t<fileset dir=\"${examples.root}/ComponentsExplorer\">\n\t\t\t\t<include name=\"README.md\"/>\n\t\t\t\t<include name=\"source/**\"/>\n\t\t\t\t<include name=\"assets/**\"/>\n\t\t\t\t<exclude name=\"source/ComponentsExplorerWeb.as\"/>\n\t\t\t</fileset>\n\t\t</copy>\n\n\t\t<copy overwrite=\"true\" todir=\"${examples.output}/DrawersExplorer\">\n\t\t\t<fileset dir=\"${examples.root}/DrawersExplorer\">\n\t\t\t\t<include name=\"README.md\"/>\n\t\t\t\t<include name=\"source/**\"/>\n\t\t\t\t<exclude name=\"source/DrawersExplorerWeb.as\"/>\n\t\t\t</fileset>\n\t\t</copy>\n\n\t\t<copy overwrite=\"true\" todir=\"${examples.output}/DragAndDrop\">\n\t\t\t<fileset dir=\"${examples.root}/DragAndDrop\">\n\t\t\t\t<include name=\"README.md\"/>\n\t\t\t\t<include name=\"source/**\"/>\n\t\t\t</fileset>\n\t\t</copy>\n\n\t\t<copy overwrite=\"true\" todir=\"${examples.output}/Gallery\">\n\t\t\t<fileset dir=\"${examples.root}/Gallery\">\n\t\t\t\t<include name=\"README.md\"/>\n\t\t\t\t<include name=\"source/**\"/>\n\t\t\t\t<exclude name=\"source/GalleryWeb.as\"/>\n\t\t\t</fileset>\n\t\t</copy>\n\n\t\t<copy overwrite=\"true\" todir=\"${examples.output}/HelloWorld\">\n\t\t\t<fileset dir=\"${examples.root}/HelloWorld\">\n\t\t\t\t<include name=\"README.md\"/>\n\t\t\t\t<include name=\"source/**\"/>\n\t\t\t\t<include name=\"assets/**\"/>\n\t\t\t\t<exclude name=\"source/HelloWorldWeb.as\"/>\n\t\t\t</fileset>\n\t\t</copy>\n\n\t\t<copy overwrite=\"true\" todir=\"${examples.output}/LayoutExplorer\">\n\t\t\t<fileset dir=\"${examples.root}/LayoutExplorer\">\n\t\t\t\t<include name=\"README.md\"/>\n\t\t\t\t<include name=\"source/**\"/>\n\t\t\t\t<exclude name=\"source/LayoutExplorerWeb.as\"/>\n\t\t\t</fileset>\n\t\t</copy>\n\n\t\t<copy overwrite=\"true\" todir=\"${examples.output}/Magic8Chat\">\n\t\t\t<fileset dir=\"${examples.root}/Magic8Chat\">\n\t\t\t\t<include name=\"README.md\"/>\n\t\t\t\t<include name=\"source/**\"/>\n\t\t\t\t<include name=\"assets/**\"/>\n\t\t\t\t<exclude name=\"source/Magic8ChatWeb.as\"/>\n\t\t\t</fileset>\n\t\t</copy>\n\n\t\t<copy overwrite=\"true\" todir=\"${examples.output}/PullToRefresh\">\n\t\t\t<fileset dir=\"${examples.root}/PullToRefresh\">\n\t\t\t\t<include name=\"README.md\"/>\n\t\t\t\t<include name=\"assets/**\"/>\n\t\t\t\t<include name=\"source/**\"/>\n\t\t\t\t<exclude name=\"source/PullToRefreshWeb.as\"/>\n\t\t\t</fileset>\n\t\t</copy>\n\n\t\t<copy overwrite=\"true\" todir=\"${examples.output}/StackScreenNavigatorExplorer\">\n\t\t\t<fileset dir=\"${examples.root}/StackScreenNavigatorExplorer\">\n\t\t\t\t<include name=\"README.md\"/>\n\t\t\t\t<include name=\"source/**\"/>\n\t\t\t\t<exclude name=\"source/StackScreenNavigatorExplorerWeb.as\"/>\n\t\t\t</fileset>\n\t\t</copy>\n\n\t\t<copy overwrite=\"true\" todir=\"${examples.output}/Tabs\">\n\t\t\t<fileset dir=\"${examples.root}/Tabs\">\n\t\t\t\t<include name=\"README.md\"/>\n\t\t\t\t<include name=\"source/**\"/>\n\t\t\t\t<include name=\"assets/**\"/>\n\t\t\t\t<exclude name=\"source/TabsWeb.as\"/>\n\t\t\t</fileset>\n\t\t</copy>\n\n\t\t<copy overwrite=\"true\" todir=\"${examples.output}/TileList\">\n\t\t\t<fileset dir=\"${examples.root}/TileList\">\n\t\t\t\t<include name=\"README.md\"/>\n\t\t\t\t<include name=\"source/**\"/>\n\t\t\t\t<include name=\"assets/**\"/>\n\t\t\t\t<exclude name=\"source/TileListWeb.as\"/>\n\t\t\t</fileset>\n\t\t</copy>\n\n\t\t<copy overwrite=\"true\" todir=\"${examples.output}/Todos\">\n\t\t\t<fileset dir=\"${examples.root}/Todos\">\n\t\t\t\t<include name=\"README.md\"/>\n\t\t\t\t<include name=\"source/**\"/>\n\t\t\t\t<exclude name=\"source/TodosWeb.as\"/>\n\t\t\t</fileset>\n\t\t</copy>\n\n\t\t<copy overwrite=\"true\" todir=\"${examples.output}/TrainTimes\">\n\t\t\t<fileset dir=\"${examples.root}/TrainTimes\">\n\t\t\t\t<include name=\"README.md\"/>\n\t\t\t\t<include name=\"source/**\"/>\n\t\t\t\t<include name=\"assets/**\"/>\n\t\t\t\t<exclude name=\"source/TrainTimesWeb.as\"/>\n\t\t\t</fileset>\n\t\t</copy>\n\n\t\t<copy overwrite=\"true\" todir=\"${examples.output}/TransitionsExplorer\">\n\t\t\t<fileset dir=\"${examples.root}/TransitionsExplorer\">\n\t\t\t\t<include name=\"README.md\"/>\n\t\t\t\t<include name=\"source/**\"/>\n\t\t\t\t<include name=\"assets/**\"/>\n\t\t\t\t<exclude name=\"source/TransitionsExplorerWeb.as\"/>\n\t\t\t</fileset>\n\t\t</copy>\n\n\t\t<copy overwrite=\"true\" todir=\"${examples.output}/Video\">\n\t\t\t<fileset dir=\"${examples.root}/Video\">\n\t\t\t\t<include name=\"README.md\"/>\n\t\t\t\t<include name=\"source/**\"/>\n\t\t\t</fileset>\n\t\t</copy>\n\n\t\t<copy overwrite=\"true\" todir=\"${examples.output}/YouTubeFeeds\">\n\t\t\t<fileset dir=\"${examples.root}/YouTubeFeeds\">\n\t\t\t\t<include name=\"README.md\"/>\n\t\t\t\t<include name=\"source/**\"/>\n\t\t\t\t<exclude name=\"source/YouTubeFeedsWeb.as\"/>\n\t\t\t</fileset>\n\t\t</copy>\n\t</target>\n\n\t<target name=\"-test\" depends=\"-feathers\" unless=\"skip-tests\">\n\t\t<java jar=\"${mxmlc}\" dir=\"${test.root}/source\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${flashplayer.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-library-path+=${dependency.output}\"/>\n\t\t\t<arg value=\"-library-path+=${flexunit.root}\"/>\n\t\t\t<arg value=\"-library-path+=${output.path}\"/>\n\t\t\t<arg value=\"-output=${dependency.output}/TestFeathers.swf\"/>\n\t\t\t<arg value=\"TestFeathers.as\"/>\n\t\t</java>\n\t\t<copy todir=\"${dependency.output}\">\n\t\t\t<fileset file=\"${test.root}/source/TestFeathers-app.xml\"/>\n\t\t</copy>\n\t\t<copy todir=\"${dependency.output}/fixtures\">\n\t\t\t<fileset dir=\"${test.root}/fixtures\"/>\n\t\t</copy>\n    \t<condition property=\"adl.file\" value=\"adl.exe\">\n        \t<os family=\"windows\"/>\n\t\t</condition>\n\t\t<property name=\"adl.file\" value=\"adl\"/>\n\t\t<condition property=\"flexunit.command\" value=\"${flashplayer}\">\n\t\t\t<isset property=\"flashplayer\"/>\n\t\t</condition>\n\t\t<condition property=\"flexunit.swf\" value=\"${dependency.output}/TestFeathers.swf\">\n\t\t\t<isset property=\"flashplayer\"/>\n\t\t</condition>\n\t\t<property name=\"flexunit.command\" value=\"${flashsdk.bin}/${adl.file}\"/>\n\t\t<property name=\"flexunit.swf\" value=\"${dependency.output}/TestFeathers-app.xml\"/>\n\t\t<flexunit\n\t\t\tcommand=\"${flexunit.command}\"\n\t\t\tplayer=\"flash\"\n\t\t\tswf=\"${flexunit.swf}\"\n\t\t\thaltonfailure=\"true\"\n\t\t\tverbose=\"true\"\n\t\t\ttoDir=\"${dependency.output}\"/>\n\t</target>\n    \n    <macrodef name=\"apm\">\n        <attribute name=\"src\"/>\n        <attribute name=\"swc\"/>\n        <attribute name=\"readme\"/>\n        <attribute name=\"changelog\" default=\"\"/>\n        <attribute name=\"package-swc\"/>\n        <attribute name=\"package-src\"/>\n            <sequential>\n\t\t\t\t<fail unless=\"apm\" message=\"Path to apm executable is missing.\"/>\n\t\t\t\t<copy overwrite=\"true\" file=\"@{swc}\" todir=\"${output.path}/apm/swc\"/>\n\t\t\t\t<copy overwrite=\"true\" file=\"@{package-swc}\" tofile=\"${output.path}/apm/package.json\"/>\n\t\t\t\t<copy overwrite=\"true\" todir=\"${output.path}/apm\">\n\t\t\t\t\t<fileset file=\"@{readme}\"/>\n\t\t\t\t\t<fileset file=\"@{changelog}\"/>\n\t\t\t\t\t<fileset file=\"${basedir}/LICENSE.md\"/>\n\t\t\t\t</copy>\n\n\t\t\t\t<copy overwrite=\"true\" todir=\"${output.path}/apm-src/src\">\n\t\t\t\t\t<fileset dir=\"@{src}\"/>\n\t\t\t\t</copy>\n\t\t\t\t<copy overwrite=\"true\" file=\"@{package-src}\" tofile=\"${output.path}/apm-src/package.json\"/>\n\t\t\t\t<copy overwrite=\"true\" todir=\"${output.path}/apm-src\">\n\t\t\t\t\t<fileset file=\"@{readme}\"/>\n\t\t\t\t\t<fileset file=\"@{changelog}\"/>\n\t\t\t\t\t<fileset file=\"${basedir}/LICENSE.md\"/>\n\t\t\t\t</copy>\n\n\t\t\t\t<exec executable=\"${apm}\" dir=\"${output.path}\" failonerror=\"true\">\n\t\t\t\t\t<arg value=\"build\"/>\n\t\t\t\t\t<arg value=\"apm\"/>\n\t\t\t\t</exec>\n\t\t\t\t<exec executable=\"${apm}\" dir=\"${output.path}\" failonerror=\"true\">\n\t\t\t\t\t<arg value=\"build\"/>\n\t\t\t\t\t<arg value=\"apm-src\"/>\n\t\t\t\t</exec>\n\n\t\t\t\t<delete includeemptydirs=\"true\">\n\t\t\t\t\t<fileset dir=\"${output.path}/apm\"/>\n\t\t\t\t\t<fileset dir=\"${output.path}/apm-src\"/>\n\t\t\t\t</delete>\n        </sequential>\n    </macrodef>\n\n\t<target name=\"-apm\" depends=\"-feathers,-themes\">\n\t\t<apm src=\"${source.root}\"\n\t\t\tswc=\"${output.path}/${swc.file}\"\n\t\t\treadme=\"README.md\"\n\t\t\tchangelog=\"CHANGELOG.md\"\n\t\t\tpackage-swc=\"package-swc.json\"\n\t\t\tpackage-src=\"package-src.json\"/>\n\t\t<apm src=\"${themes.root}/AeonDesktopTheme/source\"\n\t\t\tswc=\"${themes.output}/AeonDesktopTheme/swc/AeonDesktopTheme.swc\"\n\t\t\treadme=\"${themes.root}/AeonDesktopTheme/README.md\"\n\t\t\tpackage-swc=\"${themes.root}/AeonDesktopTheme/package-swc.json\"\n\t\t\tpackage-src=\"${themes.root}/AeonDesktopTheme/package-src.json\"/>\n\t\t<apm src=\"${themes.root}/MetalWorksDesktopTheme/source\"\n\t\t\tswc=\"${themes.output}/MetalWorksDesktopTheme/swc/MetalWorksDesktopTheme.swc\"\n\t\t\treadme=\"${themes.root}/MetalWorksDesktopTheme/README.md\"\n\t\t\tpackage-swc=\"${themes.root}/MetalWorksDesktopTheme/package-swc.json\"\n\t\t\tpackage-src=\"${themes.root}/MetalWorksDesktopTheme/package-src.json\"/>\n\t\t<apm src=\"${themes.root}/MetalWorksMobileTheme/source\"\n\t\t\tswc=\"${themes.output}/MetalWorksMobileTheme/swc/MetalWorksMobileTheme.swc\"\n\t\t\treadme=\"${themes.root}/MetalWorksMobileTheme/README.md\"\n\t\t\tpackage-swc=\"${themes.root}/MetalWorksMobileTheme/package-swc.json\"\n\t\t\tpackage-src=\"${themes.root}/MetalWorksMobileTheme/package-src.json\"/>\n\t\t<apm src=\"${themes.root}/MinimalDesktopTheme/source\"\n\t\t\tswc=\"${themes.output}/MinimalDesktopTheme/swc/MinimalDesktopTheme.swc\"\n\t\t\treadme=\"${themes.root}/MinimalDesktopTheme/README.md\"\n\t\t\tpackage-swc=\"${themes.root}/MinimalDesktopTheme/package-swc.json\"\n\t\t\tpackage-src=\"${themes.root}/MinimalDesktopTheme/package-src.json\"/>\n\t\t<apm src=\"${themes.root}/MinimalMobileTheme/source\"\n\t\t\tswc=\"${themes.output}/MinimalMobileTheme/swc/MinimalMobileTheme.swc\"\n\t\t\treadme=\"${themes.root}/MinimalMobileTheme/README.md\"\n\t\t\tpackage-swc=\"${themes.root}/MinimalMobileTheme/package-swc.json\"\n\t\t\tpackage-src=\"${themes.root}/MinimalMobileTheme/package-src.json\"/>\n\t\t<apm src=\"${themes.root}/TopcoatLightMobileTheme/source\"\n\t\t\tswc=\"${themes.output}/TopcoatLightMobileTheme/swc/TopcoatLightMobileTheme.swc\"\n\t\t\treadme=\"${themes.root}/TopcoatLightMobileTheme/README.md\"\n\t\t\tpackage-swc=\"${themes.root}/TopcoatLightMobileTheme/package-swc.json\"\n\t\t\tpackage-src=\"${themes.root}/TopcoatLightMobileTheme/package-src.json\"/>\n\t</target>\n</project>"
  },
  {
    "path": "documentation/README.md",
    "content": "# Documentation\n\nThe *api-reference* folder contains a custom template for the [API reference](https://feathersui.com/api-reference/).\n\nThe Markdown help files that were previously in the *help* folder have been moved to the [feathersui-website](https://github.com/BowlerHatLLC/feathersui-website/tree/master/docs/as3-starling) repository."
  },
  {
    "path": "documentation/api-reference/package-descriptions.xml",
    "content": "<overviews>\n\t<packages>\n\t\t<package name=\"feathers.display\"> \n\t\t\t<shortDescription><![CDATA[A variety of custom Starling display objects.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.textures\"> \n\t\t\t<shortDescription><![CDATA[Textures for custom Starling display objects.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.controls\"> \n\t\t\t<shortDescription><![CDATA[User interface controls and containers.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.controls.color\"> \n\t\t\t<shortDescription><![CDATA[User interface controls for working with colors.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.controls.supportClasses\"> \n\t\t\t<shortDescription><![CDATA[Supporting classes and interfaces used by Feathers user interface components.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.controls.popups\"> \n\t\t\t<shortDescription><![CDATA[Managers for the display of pop-up sub-components.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.controls.text\"> \n\t\t\t<shortDescription><![CDATA[Text rendering sub-components.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.controls.renderers\"> \n\t\t\t<shortDescription><![CDATA[Data renderers for list controls.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.core\"> \n\t\t\t<shortDescription><![CDATA[Base classes and interfaces used by Feathers.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.data\"> \n\t\t\t<shortDescription><![CDATA[Collections used by Feathers to display data.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.dragDrop\"> \n\t\t\t<shortDescription><![CDATA[Classes related to drag and drop operations.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.events\"> \n\t\t\t<shortDescription><![CDATA[Contains classes to related to Feathers events.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.layout\"> \n\t\t\t<shortDescription><![CDATA[A variety of layout algorithms used to customize Feathers controls and containers.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.media\"> \n\t\t\t<shortDescription><![CDATA[User interface controls for media playback.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.skins\"> \n\t\t\t<shortDescription><![CDATA[Classes related to skinning and themes in Feathers.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.text\"> \n\t\t\t<shortDescription><![CDATA[Contains classes for working with text.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.motion\"> \n\t\t\t<shortDescription><![CDATA[Classes related to motion, tweens, and animation.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.motion.effectClasses\"> \n\t\t\t<shortDescription><![CDATA[Supporting classes and interfaces used by effects.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.system\"> \n\t\t\t<shortDescription><![CDATA[Higher level queries for system-level capabilities.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.themes\"> \n\t\t\t<shortDescription><![CDATA[Classes related to theming and styling components.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.utils\"> \n\t\t\t<shortDescription><![CDATA[Utility classes and function.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.utils.display\"> \n\t\t\t<shortDescription><![CDATA[Utilities for working with display objects.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.utils.focus\"> \n\t\t\t<shortDescription><![CDATA[Utilities for focus management.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.utils.geom\"> \n\t\t\t<shortDescription><![CDATA[Utilities for working with geometrical calculations.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.utils.keyboard\"> \n\t\t\t<shortDescription><![CDATA[Utilities for working with the keyboard.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.utils.math\"> \n\t\t\t<shortDescription><![CDATA[Utilities for common mathematical calculations.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.utils.skins\"> \n\t\t\t<shortDescription><![CDATA[Utilities for skinning.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.utils.text\"> \n\t\t\t<shortDescription><![CDATA[Utilities for text components.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.utils.textures\"> \n\t\t\t<shortDescription><![CDATA[Utilities for working with textures.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.utils.touch\"> \n\t\t\t<shortDescription><![CDATA[Utilities for working with touches.]]></shortDescription>\n\t\t</package>\n\t\t<package name=\"feathers.utils.xml\"> \n\t\t\t<shortDescription><![CDATA[Utilities for working with XML and E4X.]]></shortDescription>\n\t\t</package>\n\t</packages>\n</overviews>"
  },
  {
    "path": "documentation/api-reference/templates/AC_OETags.js",
    "content": "////////////////////////////////////////////////////////////////////////////////\n//\n//  ADOBE SYSTEMS INCORPORATED\n//  Copyright 2008 Adobe Systems Incorporated\n//  All Rights Reserved.\n//\n//  NOTICE: Adobe permits you to use, modify, and distribute this file\n//  in accordance with the terms of the license agreement accompanying it.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n\n//v1.0\nfunction AC_AddExtension(src, ext)\n{\n  if (src.indexOf('?') != -1)\n    return src.replace(/\\?/, ext+'?'); \n  else\n    return src + ext;\n}\n\nfunction AC_Generateobj(objAttrs, params, embedAttrs) \n{ \n  var str = '<object ';\n  for (var i in objAttrs)\n    str += i + '=\"' + objAttrs[i] + '\" ';\n  str += '>';\n  for (var i in params)\n    str += '<param name=\"' + i + '\" value=\"' + params[i] + '\" /> ';\n  str += '<embed ';\n  for (var i in embedAttrs)\n    str += i + '=\"' + embedAttrs[i] + '\" ';\n  str += ' ></embed></object>';\n\n  document.write(str);\n}\n\nfunction AC_FL_RunContent(){\n  var ret = \n    AC_GetArgs\n    (  arguments, \".swf\", \"movie\", \"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\"\n     , \"application/x-shockwave-flash\"\n    );\n  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);\n}\n\nfunction AC_GetArgs(args, ext, srcParamName, classid, mimeType){\n  var ret = new Object();\n  ret.embedAttrs = new Object();\n  ret.params = new Object();\n  ret.objAttrs = new Object();\n  for (var i=0; i < args.length; i=i+2){\n    var currArg = args[i].toLowerCase();    \n\n    switch (currArg){\t\n      case \"classid\":\n        break;\n      case \"pluginspage\":\n        ret.embedAttrs[args[i]] = args[i+1];\n        break;\n      case \"src\":\n      case \"movie\":\t\n        args[i+1] = AC_AddExtension(args[i+1], ext);\n        ret.embedAttrs[\"src\"] = args[i+1];\n        ret.params[srcParamName] = args[i+1];\n        break;\n      case \"onafterupdate\":\n      case \"onbeforeupdate\":\n      case \"onblur\":\n      case \"oncellchange\":\n      case \"onclick\":\n      case \"ondblClick\":\n      case \"ondrag\":\n      case \"ondragend\":\n      case \"ondragenter\":\n      case \"ondragleave\":\n      case \"ondragover\":\n      case \"ondrop\":\n      case \"onfinish\":\n      case \"onfocus\":\n      case \"onhelp\":\n      case \"onmousedown\":\n      case \"onmouseup\":\n      case \"onmouseover\":\n      case \"onmousemove\":\n      case \"onmouseout\":\n      case \"onkeypress\":\n      case \"onkeydown\":\n      case \"onkeyup\":\n      case \"onload\":\n      case \"onlosecapture\":\n      case \"onpropertychange\":\n      case \"onreadystatechange\":\n      case \"onrowsdelete\":\n      case \"onrowenter\":\n      case \"onrowexit\":\n      case \"onrowsinserted\":\n      case \"onstart\":\n      case \"onscroll\":\n      case \"onbeforeeditfocus\":\n      case \"onactivate\":\n      case \"onbeforedeactivate\":\n      case \"ondeactivate\":\n      case \"type\":\n      case \"codebase\":\n        ret.objAttrs[args[i]] = args[i+1];\n        break;\n      case \"width\":\n      case \"height\":\n      case \"align\":\n      case \"vspace\": \n      case \"hspace\":\n      case \"class\":\n      case \"title\":\n      case \"accesskey\":\n      case \"name\":\n      case \"id\":\n      case \"tabindex\":\n        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];\n        break;\n      default:\n        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];\n    }\n  }\n  ret.objAttrs[\"classid\"] = classid;\n  if (mimeType) ret.embedAttrs[\"type\"] = mimeType;\n  return ret;\n}\n\n"
  },
  {
    "path": "documentation/api-reference/templates/ASDoc_Config_Base.xml",
    "content": "<!--\n\n\tADOBE SYSTEMS INCORPORATED\n\tCopyright 2006-2008 Adobe Systems Incorporated\n\tAll Rights Reserved.\n\n\tNOTICE: Adobe permits you to use, modify, and distribute this file\n\tin accordance with the terms of the license agreement accompanying it.\n\n-->\n<!-- this file normally should not be edited.  Use the command-line\n     parameters for ASDoc instead -->\n<asDocConfig>\n  <options buildNum=\"asd3_0_final_1\" verbose=\"false\" livedocs=\"false\" standalone=\"true\" eclipse=\"false\" docversion=\"3\" includePrivate=\"false\" splitIndex=\"true\" showVersions=\"true\" showConventions=\"false\" showReview=\"true\" />\n\n  <keywords show=\"false\" num=\"500\" />\n<!--\n  <feedback show=\"false\" type=\"livedocs\">\n    <feedbackEmail>\n        <label>Submit Feedback</label>\n        <address>foo@foo.com</address>\n    </feedbackEmail>\n  </feedback>\n-->\n  <warnings langversion=\"false\" playerversion=\"false\" xref=\"true\" />\n\t<!-- <includeExamplesDirectory></includeExamplesDirectory> -->\n\n  <xmlInputFile>toplevel.xml</xmlInputFile>\n  <title>API Documentation</title>\n  <windowTitle>API Documentation</windowTitle>\n\n  <languageElements show=\"false\" constants=\"true\" functions=\"true\" operators=\"false\" statements=\"false\" specialTypes=\"false\" />\n\t<footer></footer>\n  <namespaces hideAll=\"false\">\n    <namespace hide=\"false\" summaryDisplay=\"public\">AS3</namespace>\n    <namespace hide=\"true\">mx_internal</namespace>\n    <namespace hide=\"false\" summaryDisplay=\"protected\">flash_proxy</namespace>\n    <namespace hide=\"false\" summaryDisplay=\"protected\">object_proxy</namespace>\n    <namespace hide=\"false\">mx_inner</namespace>\n    <namespace hide=\"false\" summaryDisplay=\"public\">flash10</namespace>\n  </namespaces>\n<!--\n  <packages hideAll=\"false\">\n    <asPackage hide=\"false\">adobe.utils</asPackage>\n    <asPackage hide=\"true\">flash.debugger</asPackage>\n    <asPackage hide=\"true\">macromedia.util</asPackage>\n  </packages>\n-->\n<!--\n  <annotate>\n    <item type=\"package\" name=\"mx.charts\">\n        <annotation type=\"text\">(Flex Data Visualization components only)</annotation>\n    </item>\n  </annotate>\n-->\n</asDocConfig>"
  },
  {
    "path": "documentation/api-reference/templates/ASDoc_terms.xml",
    "content": "<!--\n\n\tADOBE SYSTEMS INCORPORATED\n\tCopyright 2008 Adobe Systems Incorporated\n\tAll Rights Reserved.\n\n\tNOTICE: Adobe permits you to use, modify, and distribute this file\n\tin accordance with the terms of the license agreement accompanying it.\n\n-->\n<dita>\n  <topic DTDVersion=\"V1.1.3\"\n          domains=\"(topic hi-d) (topic pr-d) (topic sw-d) (topic adobe-d)\"\n          class=\"- topic/topic \"\n          id=\"WS58b67d046ae8e03c15f1d0a110e67a7921-8000\">\n      <title class=\"- topic/title \">Localizable Terms</title>\n      <body class=\"- topic/body \"/>\n      <reference DTDVersion=\"V1.1.3\"\n                 domains=\"(topic hi-d) (topic pr-d) (topic sw-d) (topic adobe-d)\"\n                 class=\"- topic/topic       reference/reference \"\n                 id=\"WS58b67d046ae8e03c15f1d0a110e67a7921-7fff\">\n         <title class=\"- topic/title \">Localizable Terms</title>\n         <refbody class=\"- topic/body        reference/refbody \">\n            <adobetable frame=\"all\" colsep=\"0\" rowsep=\"1\" class=\"+ topic/table adobe-d/adobetable \">\n               <tgroup cols=\"2\" colsep=\"0\" rowsep=\"1\" outputclass=\"2col.small.table\"\n                       class=\"- topic/tgroup \">\n                  <colspec colnum=\"1\" colname=\"1\" colwidth=\"1.167in\" colsep=\"0\" class=\"- topic/colspec \"/>\n                  <colspec colnum=\"2\" colname=\"2\" colwidth=\"2.041in\" colsep=\"0\" class=\"- topic/colspec \"/>\n                  <thead class=\"- topic/thead \">\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Key (or Paragraph tag)</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Value</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Comment</p>\n                        </entry>\n                     </row>\n                  </thead>\n                  <tbody>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">AS1tooltip</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Tooltip for AS1 compatible examples</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Tooltip for AS1 compatible examples</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">AS2tooltip</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">This example requires ActionScript 2.0</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Tooltip for AS2 compatible examples</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">AS3tooltip</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">This example requires ActionScript 3.0</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Tooltip for AS3 compatible examples</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Type</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Type</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Type</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Format</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Format</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Format</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">CSSInheritance</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">CSS Inheritance</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">CSS Inheritance</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Properties</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Properties</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Header for properties</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Property</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">property</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for property</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">PropertyProperty</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Property</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for property</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">PropertyDetail</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Property Detail</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for property</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Constructor</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Constructor</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Header for constructor</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ConstructorDetail</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Constructor Detail</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Header for constructor</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">MethodDetail</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Method Detail</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">MethodDetail</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Methods</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Methods</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Header for methods</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">MethodMethod</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Method</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">text for method</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Method</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">method</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">text for method</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Functions</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Functions</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Header for functions</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FunctionFunction</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Function</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">text for function</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Function</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">function</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">text for function</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Events</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Events</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Header for events</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Event</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Event</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">text for event</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Styles</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Styles</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Header for styles</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Style</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">style</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">text for style</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">StyleStyle</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Style</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">text for style</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">StyleDetail</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Style Detail</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for style</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Effects</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Effects</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Header for effects</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Effect</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Effect</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">text for effect</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Constants</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Constants</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Header for constants</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Constant</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Constant</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">text for constant</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ConstantDetail</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Constant Detail</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">text for constant detail</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Interfaces</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Interfaces</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Header for interfaces</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Interface</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Interface</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">text for interface</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Classes</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Classes</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Header for classes</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ClassClass</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Class</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">*NAME* class </p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Use</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Use</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Header for use</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Usage</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Usage</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Header for usage</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Example</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Example</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Header for examples</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Examples</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Examples</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Header for examples</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ViewExamples</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">View the examples</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">View the examples</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">searchLivedocs</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Search</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Search LiveDocs links</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">allPackages</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">All Packages</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for All Packages links</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">allMXPackages</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">All MX Packages</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for All MX Packages links</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">allFlashPlayerPackages</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">All Flash Packages</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for All Flash Packages links</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">allClasses</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">All Classes</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for All Classes links</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">allMXClasses</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">All MX Classes</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for All MX Classes links</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">allFlashClasses</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">All Flash Classes</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for All Flash Classes links</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">LanguageElements</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Language Elements</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Language Elements links</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">LanguageElement</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Language Element</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Language Element table header</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Index</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Index</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Index links</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">deprecated_index</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">deprecated_index</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for deprecated_index</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Appendix</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Appendixes</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Appendixes links</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Description</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Description</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Appendixes links</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Conventions</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Conventions</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Conventions links</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Frames</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Frames</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for link to frames version of help</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">NoFrames</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">No Frames</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for link to no frames version of help</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">MXMLOnly</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">MXML Only Components</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for link to MXML Only Components</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">MXML Only Components</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">MXML Only Components</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for link to MXML Only Components</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">SQLSupportInLocalDatabases</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">SQL support in local databases</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for SQL support in local databases</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">SQL support in local databases</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">SQL support in local databases</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for SQL support in local databases</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">MXMLSyntax</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">MXML Syntax</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for MXML Syntax</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ShowMXMLSyntax</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Show MXML Syntax</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Show MXML Syntax</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">HideMXMLSyntax</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Hide MXML Syntax</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Hide MXML Syntax</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">PlayerVersion</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Player Version</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for player version label</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">oldPlayerVersion</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Runtime Versions</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for player version label</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">LanguageVersion</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Language Version</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for language version label</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">andLater</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">??</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Suffix for \"ActionScript N and later\"</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">seeAlso</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">See also</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">See also header</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">All</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">All</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for all index</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Unsupported</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Unsupported</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Unsupported</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">TopLevel</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Top Level</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Top Level link</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">fscommand2</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">&lt;a href=\"global_functions.html#fscommand2()\"&gt;fscommand2&lt;/a&gt;fscommand2</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for fscommand2 link</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Operator</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Operator</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Operator link</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Operators</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Operators</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Operator link</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Statement</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Statement</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Statement link</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">statement</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Statement</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for statement type in statements.xsl</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Statements</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Statements</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Statement link</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">SpecialType</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Special Type</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Special Type link</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">SpecialTypes</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Special Types</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Special Types</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">SpecialTypeDetail</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Special Type Detail</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Special Type Detail</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">DeprecatedText</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \"> Deprecated Text</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Deprecated classes</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">DeprecatedClassesHeader</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Deprecated Classes</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Header for Deprecated classes</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">DeprecatedFunctionHeader</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Deprecated Function</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Header for Deprecated Functions</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">DeprecatedMethodHeader</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Deprecated Methods</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Header for Deprecated Methods</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">DeprecatedPropertiesHeader</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Deprecated Properties</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Header for Deprecated Properties</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">DeprecatedStylesHeader</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Deprecated Styles</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Header for Deprecated Styles</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">DeprecatedOperatorsHeader</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Deprecated Operators</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Header for Deprecated Operators</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">DeprecatedAsOf</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Deprecated</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Deprecated classes with a version</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">DeprecatedIn</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Deprecated</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Deprecated classes with a version</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">StaticMethodIn</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Static Method                  </p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Static method</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">MethodIn</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Method                  </p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for method</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">PackageStaticFunctionIn</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Package Static Function</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for static function in package</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">PackageFunctionIn</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Package Function</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for function in package</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">CompilerDirective</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Compiler Directive</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Compiler Directive</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">CompilerDirectives</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \"> Compiler Directives</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Compiler Directives</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Protected</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Protected</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Protected</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Public</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Public</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Public</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Global</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Global</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Global</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">GlobalFunction</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Global Function</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for GlobalFunction</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">GlobalFunctions</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Global Functions</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for GlobalFunction</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">GlobalProperties</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Global Properties</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Global Properties</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ConstructorInClass</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Constructor</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for constructor in class</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ConstantStaticPropertyIn</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Constant Static Property</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for constant static property in class</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">StaticPropertyIn</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Static Property</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for static property in class</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">PropertyIn</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Property</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Property in class</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ConstantPropertyIn</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Constant Property</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Constant property in class</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">PackageConstantStaticPropertyIn</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Package Constant Static Property</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Package constant static property in class</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">PackageConstantPropertyIn</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Package Constant Property</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Package static property in class</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ConstantProperty</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Constant Property</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">constant property</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">GlobalProperty</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Global property</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Global property</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">EventHandlerIn</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Event handler                  </p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Event handler in </p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">EventListenerIn</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Event Listener                  </p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Event Listener in</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">EventIn</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Event</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Event in</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">GlobalEventHandler</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Global event handler</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Global event handler</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">GlobalEventListener</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Global event listener</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Global event listener</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FinalDynamicClass</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">final dynamic class</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Final dynamic class</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FinalClass</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">final class</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Final class</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">DynamicClass</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">dynamic class</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">dynamic class</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">InterfaceIn</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">interface</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">interface</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ClassIn</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">class</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">class</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FinalDynamicClassIn</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">final dynamic class</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">final dynamic class</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FinalDynamicClassIn</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">final dynamic class</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">final dynamic class</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FinalClassIn</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Final Class</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">final class</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">DynamicClassIn</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Dynamic Class</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">dynamic class</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Package</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">package</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">package</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">PackagePackage</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Package</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">*NAME* package</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Packages</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Packages</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">package</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">InnerClassSummary</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Inner Class summary</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Inner Class summary</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">HideInheritedPublicConstants</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \"> Hide Inherited Public Constants</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Hide Inherited Public Constants</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ShowInheritedPublicConstants</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \"> Show Inherited Public Constants</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Show Inherited Public Constants</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">HideInheritedProtectedConstants</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \"> Hide Inherited Protected Constants</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Hide Inherited Protected Constants</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ShowInheritedProtectedConstants</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \"> Show Inherited Protected Constants</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Show Inherited Protected Constants</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">HideInheritedPublicProperties</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \"> Hide Inherited Public Properties</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Hide Inherited Public Properties</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ShowInheritedPublicProperties</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \"> Show Inherited Public Properties</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Show Inherited Public Properties</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">HideInheritedPublicMethods</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \"> Hide Inherited Public Methods</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Hide Inherited Public Methods</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ShowInheritedPublicMethods</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \"> Show Inherited Public Methods</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Show Inherited Public Methods</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">HideInheritedProtectedMethods</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \"> Hide Inherited Protected Methods</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Hide Inherited Protected Methods</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ShowInheritedProtectedMethods</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \"> Show Inherited Protected Methods</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Show Inherited Protected Methods</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">HideInheritedProtectedProperties</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \"> Hide Inherited Protected Properties</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Hide Inherited Protected Properties</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ShowInheritedProtectedProperties</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \"> Show Inherited Protected Properties</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Show Inherited Protected Properties</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">HideInheritedEffects</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \"> Hide Inherited Effects</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Hide Inherited Effects</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ShowInheritedEffects</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \"> Show Inherited Effects</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Show Inherited Effects</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">HideInheritedEvents</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \"> Hide Inherited Events</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Hide Inherited Events</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ShowInheritedEvents</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \"> Show Inherited Events</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Show Inherited Events</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">TriggeringEvent</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \"> Triggering Event</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for TriggeringEvent</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">DefaultValueIs</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \"> The default value is</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for The default value is </p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Style_States_2</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">You can use the skin style to assign the skin for the following skin states:</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for The default value is </p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">DataBinding</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">This property can be used as the source for data binding.</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for This property can be used as the source for data binding.</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Implementation</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Implementation</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Implementation</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">HideInheritedStyles</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \"> Hide Inherited Styles</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Hide Inherited Styles</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ShowInheritedStyles</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \"> Show Inherited Styles</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Show Inherited Styles</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">InheritedFrom</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Inherited From</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \"> Text for inherited from class</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">DefaultMXMLProperty</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Default MXML Property</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Default MXML Property</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Inheritance</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Inheritance</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Inheritance</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Implementors</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Implementors</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Implementors</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">CompilerErrors</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Compiler Errors</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Compiler Errors</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">CompilerWarnings</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Compiler Warnings</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Compiler Warnings</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">RunTimeErrors</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Runtime Errors</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Runtime Errors</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">CharacterSetCodes</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Character Set Codes</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Character Set Codes</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">MotionXMLElements</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Motion XML Elements</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Motion XML Elements</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Timed Text XML Formats</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Timed Text XML Formats</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Timed Text XML Formats</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ExampleInstruct</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Using examples in the ActionScript 3.0 Language Reference</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Example Instruct</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Using examples in the ActionScript 3.0 Language and Components Reference</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Using examples in the ActionScript 3.0 Language and Components Reference</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Using examples in the ActionScript 3.0 Language and Components Reference</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ActionScript2Migration</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">ActionScript 2.0 Migration</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for ActionScript 2.0 Migration</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">StatementsKeywordsDirectives</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Statements, Keywords &amp; Directives</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Statements, Keywords &amp; Directives</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">StatementsKeywordsDirectiveDetail</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Statements, Keywords &amp; Directive detail</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Statements, Keywords &amp; Directives</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">StatementsKeywords</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Statements and Keywords</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Statements and Keywords</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FunctionsMethods</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Functions and Methods</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Functions and Methods</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Symbols</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Symbols</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for symbols (index letter list)</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Code</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Code</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Code</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Message</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Message</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Message</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">InvalidActionScriptNote</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">* Note: This error indicates that the ActionScript in the SWF is invalid. If you believe that the file has not been corrupted, please report the problem to Adobe.</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">* Note: This error indicates that the ActionScript in the SWF is invalid. If you believe that the file has not been corrupted, please report the problem to Adobe.</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Comments</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Comments</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Comments</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">OperatorDetail</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Operator Detail</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">OperatorDetail</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">EventDetail</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Event Detail</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Event Detail</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">EventObjectType</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Event Object Type</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Event Object Type</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Result</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Result</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Result</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Operands</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Operands</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Operands</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Parameters</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Parameters</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Parameters</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">TopLevelConstantsFunctions</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Top Level Constants and Functions</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Top Level Constants and Functions</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Details</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Details</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Details</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Summary</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Summary</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Summary</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">PackageList</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Package List</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">PackageList</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">DefinedBy</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Defined By</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">PackageList</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Throws</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Throws</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Throws</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Returns</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Returns</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Returns</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">StaticTypeDefinedInClass</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Static Type Defined In Class</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Returns</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">definition keyword</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Definition keyword</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">definition keyword</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">primary expression keyword</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Primary expression keyword</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">primary expression keyword</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">directive</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Directive</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">directive</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">attribute keyword</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Attribute Keyword</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Attribute Keyword</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">namespace</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Namespace</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">namespace</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">comment</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Comment</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">comment</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">arithmetic</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Arithmetic</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">arithmetic</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">string</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">String</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">string</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">assignment</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Assignment</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">assignment</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">arithmetic compound assignment</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Arithmetic compound assignment</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">arithmetic compound assignment</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">bitwise compound assignment</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Bitwise compound assignment</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">bitwise compound assignment</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">bitwise</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Bitwise</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">bitwise</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">comparison</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Comparison</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">comparison</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">logical</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Logical</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">logical</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">XML</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">XML</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">XML</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">other</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Other</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">other</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Supported Character Sets</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Supported Character Sets</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Supported Character Sets</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Binding</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Binding</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Binding</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Component</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Component</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Component</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Metadata</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Metadata</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Metadata</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Model</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Model</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Model</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Script</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Script</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Script</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">XMLList</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">XMLList</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">XMLList</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">UseExamples</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">How to use examples</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Link for example blocks to example use instructions.</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FPH_Book_Title</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">ActionScript 3.0 Language and Components Reference</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">ActionScript 3.0 Language and Components Reference</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FPH_Book_Directory</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">ActionScriptLangRefV3</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">ActionScriptLangRefV3</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FPH_Book_Categories</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">languagereferences,as3,components3</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">languagereferences,as3,components3</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FPH_Book_Language</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">en</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">en</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FPH_Book_Version</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">3.0</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">3.0</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FPH_Book_Sort</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">mm_3</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">mm_3</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FPH_Lang_Elements_Name</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Language Elements</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Language Elements</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FPH_All_Classes</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">All Classes</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">All Classes</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FPH_All_Packages</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">All Packages</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">All Packages</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FPH_Top_Level_Classes</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Top Level classes</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Top Level classes</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FPH_Appendixes_Name</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Appendixes</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Appendixes</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FPH_Appendixes_Tip_Text</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Link to list of Appendixes</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Link to list of Appendixes</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FPH_Conventions_Name</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Conventions</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Conventions</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FPH_Conventions_Tip_Text</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Link to list of Conventions</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Link to list of Conventions</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FPH_Index_Name</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Index</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Index</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FPH_Index_Tip_Text</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Index of all classes, methods, properties and language elements</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Index of all classes, methods, properties and language elements</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FPH_Interface</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">interface</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">interface</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FPH_Class</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">class</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">class</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FPH_Constructor</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Constructor</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Constructor</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FPH_Methods</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Methods</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Methods</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FPH_Properties</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Properties</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Properties</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FPH_Events</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Events</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Events</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FPH_Operators</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Operators</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Operators</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FPH_StatementsKeywordsDirectives</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Statements, Keywords and Directives</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Statements, Keywords and Directives</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FPH_Special_Types</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Special Types</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Special Types</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FPH_Styles</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Styles</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Styles</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FPH_Global</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Global</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Global</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FPH_Functions</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Functions</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Functions</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FPH_Constants</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Constants</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Constants</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FunctionDetail</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Function detail</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">function detail</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">DefinedIn</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Defined In </p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">defined in class</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">AdobeLogo</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Feathers Logo</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">defined in class</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Implements</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Implements</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Implements</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Subclasses</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Subclasses</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Subclasses</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">PleaseUse</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Please Use</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Please Use</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">GlobalConstants</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Global Constants</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Global Constants</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">GlobalProperties</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Global Properties</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Global Properties</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">PublicConstants</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Public Constants</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Public Constants</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">PublicProperties</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Public Properties</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Public Properties</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ProtectedConstants</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Protected Constants</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Protected Constants</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ProtectedProperties</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Protected Properties</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Protected Properties</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ProtectedMethods</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Protected Methods</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Protected Methods</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">PublicMethods</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Public Methods</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Public Methods</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">GlobalMethods</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Global Methods</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Global Methods</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Pleaseuse</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Please use </p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Please use</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">DeprecatedSince</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Deprecated Since</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Deprecated Since</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Deprecated</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Deprecated</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Deprecated</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">SymbolsIndex</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Symbols Index</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Symbols Index</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Compiler Errors</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Compiler Errors</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Compiler Errors</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Compiler Warnings</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Compiler Warnings</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Compiler Warnings</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Run-Time Errors</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Run-Time Errors</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Run-Time Errors</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ActionScript 2.0 Migration</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">ActionScript 2.0 Migration</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for ActionScript 2.0 Migration</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Character Set Codes</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Character Set Codes</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Character Set Codes</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Motion XML Elements</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Motion XML Elements</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Motion XML Elements</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Timed Text Tags</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Timed Text Tags</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Timed Text Tags</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Legal notices</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Legal notices</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Legal notices</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Legal Notices</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Legal Notices</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Legal Notices</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Using examples in the ActionScript 3.0 Language Reference</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Using examples in the ActionScript 3.0 Language Reference</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Using examples in the ActionScript 3.0 Language Reference</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">List of deprecated elements</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">List of deprecated elements</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for List of deprecated elements</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">DefinedByProperties</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Defined By</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for \"Defined By\" column next to \"Properties\"</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">DefinedByMethods</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Defined By</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for \"Defined By\" column next to \"Methods\"</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">DefinedByEvents</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Defined By</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for \"Defined By\" column next to \"Events\"</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">DefinedByStyles</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Defined By</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for \"Defined By\" column next to \"Styles\"</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">DefinedByEffects</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Defined By</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for \"Defined By\" column next to \"Effects\"</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">read</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">read</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for read</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">write</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">write</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for write</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">only</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">only</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for only</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">static</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">static</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for static</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FinalStaticPropertyIn</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Final static property</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Final static property</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">FinalPropertyIn</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Final property</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Final property</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">PackageStaticPropertyIn</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Package static property</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Package static property</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ProductVersion</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Product Version</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for product version label</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ProductVersions</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Product Versions</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for product versions label</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Since</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Since</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for since label</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">windowruntimeproperty</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">window.runtime property</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">*JSLR*</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ShowInheritedProperties</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \"> Show Inherited Properties</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">JSLR: Text for Show Inherited Properties</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ShowInheritedMethods</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \"> Show Inherited Methods</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">JSLR: Text for Show Inherited Methods</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ShowInheritedConstants</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \"> Show Inherited Constants</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">JSLR: Text for Show Inherited Constants</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">JSLR_Book_Title</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Adobe AIR Language Reference for HTML Developers</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">JSLR: Text for Title</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">JSLR_Index_Title</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">JavaScript Language Reference for The Adobe® Integrated Runtime (AIR™)</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">JSLR: Text for Title</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">SQLError_detail_messages</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">SQL error detail messages, ids, and arguments</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for SQLError detail messages</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">RuntimeVersions</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Runtime Versions</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Runtime Version label</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Acrobat</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Acrobat ActionScript API</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">long name for Acrobat.</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">SearchResults</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Search Results</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Search Results</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Search</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Search</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Search</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">terms_AHV_SHORT_WORDS</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Short and common words are excluded from the search database.</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for terms_AHV_SHORT_WORDS</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">terms_AHV_NO_SEARCH_TERM</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">No search term entered.</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for terms_AHV_NO_SEARCH_TERM</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">terms_AHV_MATCHES</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Pages containing:</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for terms_AHV_MATCHES</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">terms_AHV_NO_MATCHES</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">No pages contain:</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for terms_AHV_NO_MATCHES</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Override</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">override</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Override</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">SkinStates</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Skin States</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Skin States</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">SkinState</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Skin State</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Skin State</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">SkinParts</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Skin Parts</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Skin Parts</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">SkinPart</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Skin Part</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Skin Part</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">HideInheritedSkinStates</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \"> Hide Inherited Skin States</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Hide Inherited Skin States</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ShowInheritedSkinStates</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \"> Show Inherited Skin States</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Show Inherited Skin States</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">HideInheritedSkinParts</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \"> Hide Inherited Skin Parts</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Hide Inherited Skin Parts</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">ShowInheritedSkinParts</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \"> Show Inherited Skin Parts</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Show Inherited Skin Parts</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">PartType</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Part Type</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Part Type</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Required</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Required</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Required</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Static</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Static</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Static</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Dynamic</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Dynamic</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Dynamic</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">skinpartprefixed</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">This component uses skins made up of skin parts. Do not set the skin parts directly. The component's skin sets the skin parts.</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for This component uses skins made up of skin parts. Do not set the skin parts directly. The component's skin sets the skin parts.</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">skinstateprefixed</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">To skin the component, implement a skin that defines the following states. Although you must implement all skin states, a skin state can be empty. An empty skin state specifies no changes to the default skin state.</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for To skin the component, implement a skin that defines the following states. Although you must implement all skin states, a skin state can be empty. An empty skin state specifies no changes to the default skin state.</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">dynpropdesc</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">The %type% must return an object of type</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for The %type% must return an object of type</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">unknown</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">unknown</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for unknown</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">howtouseevents</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Click for more information on events</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Click for more information on events</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">howtouseeffects</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Click for more information on effects</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Click for more information on effects</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">howtousestyles</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Click for more information on styles</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Click for more information on styles</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">howtouseskins</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Click for more information on skins</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Click for more information on skins</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">Theme</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Theme</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Theme</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                     <row rowsep=\"1\" class=\"- topic/row \">\n                        <entry colname=\"1\" colsep=\"1\" class=\"- topic/entry \">\n                           <p translate=\"no\" class=\"- topic/p \">altr.desc.1st</p>\n                        </entry>\n                        <entry colname=\"2\" colsep=\"1\" class=\"- topic/entry \">\n                           <p class=\"- topic/p \">Starting with Flex %ver%, Adobe recommends that you use the %class% class as an alternative to this class.</p>\n                        </entry>\n                        <entry colname=\"3\" class=\"- topic/entry \">\n                           <draft-comment class=\"- topic/draft-comment \">\n                              <p class=\"- topic/p \">Text for Starting with Flex %ver%, Adobe recommends that you use the %class% class as an alternative to this class.</p>\n                           </draft-comment>\n                        </entry>\n                     </row>\n                  </tbody>\n               </tgroup>\n            </adobetable>\n         </refbody>\n      </reference>\n  </topic>\n</dita>"
  },
  {
    "path": "documentation/api-reference/templates/ClassHeader.xslt",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n\n\tADOBE SYSTEMS INCORPORATED\n\tCopyright 2008 Adobe Systems Incorporated\n\tAll Rights Reserved.\n\n\tNOTICE: Adobe permits you to use, modify, and distribute this file\n\tin accordance with the terms of the license agreement accompanying it.\n\n-->\n<xsl:stylesheet version=\"2.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:saxon=\"http://sf.net/saxon\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:ifn=\"urn:internal:functions\" exclude-result-prefixes=\"saxon xs ifn\">\n\t<xsl:output method=\"xml\" version=\"1.0\" encoding=\"UTF-8\" indent=\"yes\"/>\n\t<xsl:key name=\"baseclass\" match=\"apiClassifier\" use=\".//apiBaseClassifier/text()\"/>\n\t<xsl:key name=\"id\" match=\"//apiClassifier\" use=\"@id\"/>\n\t<xsl:key name=\"idg\" match=\"//apiClassifier\" use=\"substring-after(@id,':')\"/>\n\t<xsl:key name=\"baseInter\" match=\"//apiBaseInterface\" use=\"text()\"/>\n\t<xsl:template match=\"/\">\n\t\t<xsl:apply-templates/>\n\t</xsl:template>\n\t<xsl:template match=\"apiPackage\">\n\t\t<apiPackage id=\"{@id}\">\n\t\t\t<apiName>\n\t\t\t\t<xsl:value-of select=\"@id\"/>\n\t\t\t</apiName>\n\t\t\t<xsl:copy-of select=\"./apiDetail\"/>\n\t\t\t<xsl:apply-templates select=\"apiClassifier\"/>\n\t\t</apiPackage>\n\t</xsl:template>\n\t<xsl:template match=\"apiClassifier\">\n\t\t<apiClassifier id=\"{@id}\">\n\t\t\t<apiName>\n\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t</apiName>\n\t\t\t<xsl:apply-templates select=\"shortdesc\"/>\n\t\t\t<xsl:apply-templates select=\"prolog\"/>\n\t\t\t<xsl:apply-templates select=\"Keywords\" mode=\"keys\"/>\n\t\t\t<xsl:apply-templates select=\"apiClassifierDetail\"/>\n\t\t\t<xsl:apply-templates select=\"related-links\"/>\n\t\t</apiClassifier>\n\t</xsl:template>\n\t<xsl:template match=\"apiClassifierDetail\">\n\t\t<apiClassifierDetail>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t\t<Inheritancelist>\n\t\t\t\t<BaseInterface>\n\t\t\t\t\t<xsl:if test=\"./apiClassifierDef/apiInterface and ./apiClassifierDef/apiBaseInterface\">\n\t\t\t\t\t\t<xsl:for-each select=\"./apiClassifierDef/apiBaseInterface\">\n\t\t\t\t\t\t\t<xsl:sort select=\"substring-after(./apiClassifierDef/apiBaseInterface/.,':')\" order=\"ascending\" data-type=\"text\"/>\n\t\t\t\t\t\t\t<Interface id=\"{.}\"/>\n\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t<xsl:call-template name=\"nested\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</BaseInterface>\n\t\t\t\t<Inheritance>\n\t\t\t\t\t<xsl:variable name=\"baseClass\" select=\".//apiBaseClassifier/text()\"/>\n\t\t\t\t\t<xsl:for-each select=\".//apiBaseClassifier\">\n\t\t\t\t\t\t<Inherit id=\"{$baseClass}\"/>\n\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t<xsl:call-template name=\"inheritList\">\n\t\t\t\t\t\t<xsl:with-param name=\"base\" select=\"$baseClass\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</Inheritance>\n\t\t\t\t<Implements>\n\t\t\t\t\t<xsl:for-each select=\".//apiBaseInterface\">\n\t\t\t\t\t\t<Implement id=\"{@*|node()}\"/>\n\t\t\t\t\t</xsl:for-each>\n\t\t\t\t</Implements>\n\t\t\t\t<Subclasses>\n\t\t\t\t\t<xsl:variable name=\"apiClass\" select=\"ancestor::apiClassifier/@id\"/>\n\t\t\t\t\t<xsl:variable name=\"apiClassGlb\" select=\"substring-after($apiClass,'globalClassifier:')\"/>\n\t\t\t\t\t<xsl:for-each select=\"key('baseclass',  $apiClass)\">\n\t\t\t\t\t\t<class id=\"{@id}\"/>\n\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t<xsl:for-each select=\"key('baseclass',  $apiClassGlb)\">\n\t\t\t\t\t\t<class id=\"{@id}\"/>\n\t\t\t\t\t</xsl:for-each>\n\t\t\t\t</Subclasses>\n\t\t\t\t<Implementors>\n\t\t\t\t\t<xsl:if test=\".//apiInterface\">\n\t\t\t\t\t\t<xsl:variable name=\"apiClass\" select=\"ancestor::apiClassifier/@id\"/>\n\t\t\t\t\t\t<xsl:for-each select=\"key('baseInter',$apiClass)\">\n\t\t\t\t\t\t\t<xsl:sort select=\"substring-after(ancestor::apiClassifier/@id,':')\" order=\"ascending\"/>\n\t\t\t\t\t\t\t<xsl:if test=\"not(parent::apiClassifierDef/apiInterface)\">\n\t\t\t\t\t\t\t\t<Implementor id=\"{ancestor::apiClassifier/@id}\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</Implementors>\n\t\t\t\t<Excludes>\n\t\t\t\t\t<xsl:copy-of select=\"ancestor::apiClassifier/Excludes/Exclude\"/>\n\t\t\t\t\t<xsl:for-each select=\".//apiBaseClassifier\">\n\t\t\t\t\t\t<xsl:call-template name=\"getexcludes\"/>\n\t\t\t\t\t</xsl:for-each>\n\t\t\t\t</Excludes>\n\t\t\t</Inheritancelist>\n\t\t</apiClassifierDetail>\n\t</xsl:template>\n\t<xsl:template match=\"Keywords\" mode=\"keys\">\n\t\t<xsl:apply-templates select=\"node()\"/>\n\t</xsl:template>\n\t<xsl:template match=\"apiClassifierDef\">\n\t\t<apiClassifierDef>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</apiClassifierDef>\n\t</xsl:template>\n\t<xsl:template name=\"nested\">\n\t\t<xsl:variable name=\"apiBaseInter\" select=\".//apiBaseInterface/.\"/>\n\t\t<xsl:for-each select=\"key('id', $apiBaseInter)/apiClassifierDetail/apiClassifierDef/apiBaseInterface\">\n\t\t\t<xsl:variable name=\"nested.apiBaseInter\" select=\".\"/>\n\t\t\t<xsl:choose>\n\t\t\t\t<xsl:when test=\"$apiBaseInter=$nested.apiBaseInter\"/>\n\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t<Interface id=\"{.}\"/>\n\t\t\t\t</xsl:otherwise>\n\t\t\t</xsl:choose>\n\t\t</xsl:for-each>\n\t\t<xsl:call-template name=\"sub-nested\"/>\n\t</xsl:template>\n\t<xsl:template name=\"sub-nested\">\n\t\t<xsl:variable name=\"apiBaseInter\" select=\".//apiBaseInterface/.\"/>\n\t\t<xsl:variable name=\"subnested.apiBaseInter\" select=\"key('id', $apiBaseInter)/apiClassifierDetail/apiClassifierDef/apiBaseInterface\"/>\n\t\t<xsl:for-each select=\"key('id', $subnested.apiBaseInter)/apiClassifierDetail/apiClassifierDef/apiBaseInterface\">\n\t\t\t<xsl:variable name=\"nested.apiBaseInter\" select=\".\"/>\n\t\t\t<xsl:choose>\n\t\t\t\t<xsl:when test=\"$subnested.apiBaseInter=$nested.apiBaseInter\"/>\n\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t<Interface id=\"{.}\"/>\n\t\t\t\t</xsl:otherwise>\n\t\t\t</xsl:choose>\n\t\t</xsl:for-each>\n\t</xsl:template>\n\t<xsl:template name=\"inheritList\">\n\t\t<xsl:param name=\"base\"/>\n\t\t<xsl:variable name=\"match\">\n\t\t\t<xsl:if test=\"contains($base,':')\">\n\t\t\t\t<xsl:value-of select=\"$base\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($base,':'))\">\n\t\t\t\t<xsl:text>globalClassifier:</xsl:text>\n\t\t\t\t<xsl:value-of select=\"$base\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:for-each select=\"key('id',$match)\">\n\t\t\t<xsl:variable name=\"find\" select=\".//apiBaseClassifier/.\"/>\n\t\t\t<xsl:if test=\".//apiBaseClassifier/.\">\n\t\t\t\t<Inherit id=\"{$find}\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not($find='Object')\">\n\t\t\t\t<xsl:call-template name=\"inheritList\">\n\t\t\t\t\t<xsl:with-param name=\"base\" select=\"$find\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:if>\n\t\t</xsl:for-each>\n\t</xsl:template>\n\t<xsl:template name=\"getexcludes\">\n\t\t<xsl:for-each select=\"key('id', ./text())\">\n\t\t\t<xsl:copy-of select=\".//Excludes/Exclude\"/>\n\t\t\t<xsl:for-each select=\".//apiBaseClassifier\">\n\t\t\t\t<xsl:call-template name=\"getexcludes\"/>\n\t\t\t</xsl:for-each>\n\t\t</xsl:for-each>\n\t</xsl:template>\n\t<xsl:template match=\"shortdesc\">\n\t\t<shortdesc>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</shortdesc>\n\t</xsl:template>\n\t<xsl:template match=\"prolog\">\n\t\t<prolog>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</prolog>\n\t</xsl:template>\n\t<xsl:template match=\"related-links\">\n\t\t<related-links>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</related-links>\n\t</xsl:template>\n\t<xsl:template match=\"node()\">\n\t\t<xsl:copy copy-namespaces=\"no\">\n\t\t\t<xsl:copy-of select=\"@*\"/>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</xsl:copy>\n\t</xsl:template>\n</xsl:stylesheet>\n"
  },
  {
    "path": "documentation/api-reference/templates/Classes.xslt",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n\n\tADOBE SYSTEMS INCORPORATED\n\tCopyright 2008 Adobe Systems Incorporated\n\tAll Rights Reserved.\n\n\tNOTICE: Adobe permits you to use, modify, and distribute this file\n\tin accordance with the terms of the license agreement accompanying it.\n\n-->\n<xsl:stylesheet version=\"2.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:saxon=\"http://sf.net/saxon\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:ifn=\"urn:internal:functions\"\n\texclude-result-prefixes=\"saxon xs ifn\">\n\t<xsl:output method=\"xml\" version=\"1.0\" encoding=\"UTF-8\" indent=\"yes\"/>\n\t<xsl:param name=\"ditaFileDir\" select=\"''\"/>\n\t<xsl:template match=\"/\">\n\t\t<allClasses>\n\t\t\t<xsl:apply-templates select=\"//apiItemRef\">\n\t\t\t\t<xsl:sort select=\"@href\" order=\"ascending\"/>\n\t\t\t</xsl:apply-templates>\n\t\t</allClasses>\n\t</xsl:template>\n\t<xsl:template match=\"apiItemRef\">\n\t\t<xsl:variable name=\"ditaFileName\">\n\t\t\t<xsl:value-of select=\"concat($ditaFileDir,@href)\"/>\n\t\t</xsl:variable>\n\t\t<xsl:for-each select=\"document($ditaFileName)/apiPackage\">\n\t\t\t<apiPackage id=\"{@id}\">\n\t\t\t\t<apiName>\n\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t</apiName>\n\t\t\t\t<xsl:copy-of select=\"./apiDetail\"/>\n\t\t\t\t<xsl:for-each select=\"//apiClassifier\">\n\t\t\t\t\t<xsl:variable name=\"id\" select=\"@id\"/>\n\t\t\t\t\t<apiClassifier id=\"{@id}\">\n\t\t\t\t\t\t<apiName>\n\t\t\t\t\t\t\t<xsl:value-of select=\"apiName/.\"/>\n\t\t\t\t\t\t</apiName>\n\t\t\t\t\t\t<xsl:apply-templates select=\"shortdesc\"/>\n\t\t\t\t\t\t<xsl:apply-templates select=\"prolog\"/>\n\t\t\t\t\t\t<xsl:apply-templates select=\"apiClassifierDetail\"/>\n\t\t\t\t\t\t<xsl:apply-templates select=\"related-links\"/>\n\t\t\t\t\t\t<Keywords>\n\t\t\t\t\t\t\t<xsl:variable name=\"keywords\">\n\t\t\t\t\t\t\t\t<xsl:if test=\".//Xkeyword\">\n\t\t\t\t\t\t\t\t\t<xsl:for-each select=\".//keyword\">\n\t\t\t\t\t\t\t\t\t\t<xsl:sort order=\"ascending\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"normalize-space()\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:text>, </xsl:text>\n\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t\t\t\t\t<xsl:if test=\"string-length(../apiName)\">\n\t\t\t\t\t\t\t\t\t<xsl:text>,</xsl:text>\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"convertFullName\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fullname\" select=\"@id\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"apiValue\">\n\t\t\t\t\t\t\t\t\t<xsl:text>,</xsl:text>\n\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"//apiValue\">\n\t\t\t\t\t\t\t\t\t\t<xsl:sort order=\"ascending\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"position() != last()\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>,</xsl:text>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"apiOperation\">\n\t\t\t\t\t\t\t\t\t<xsl:text>,</xsl:text>\n\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"//apiOperation\">\n\t\t\t\t\t\t\t\t\t\t<xsl:sort order=\"ascending\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"position() != last()\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>,</xsl:text>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t<meta name=\"keywords\" content=\"{$keywords}\"/>\n\t\t\t\t\t\t</Keywords>\n\t\t\t\t\t\t<xsl:if test=\"./prolog/asMetadata/Exclude\">\n\t\t\t\t\t\t\t<Excludes>\n\t\t\t\t\t\t\t\t<xsl:for-each select=\"./prolog/asMetadata/Exclude\">\n\t\t\t\t\t\t\t\t\t<Exclude name=\"{@name}\" kind=\"{@kind}\" class=\"+ topic/ph adobe-api-d/Exclude \"/>\n\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t</Excludes>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</apiClassifier>\n\t\t\t\t</xsl:for-each>\n\t\t\t</apiPackage>\n\t\t</xsl:for-each>\n\t</xsl:template>\n\t<xsl:template name=\"convertFullName\">\n\t\t<xsl:param name=\"fullname\"/>\n\t\t<xsl:param name=\"separator\">.</xsl:param>\n\t\t<xsl:param name=\"justClass\">false</xsl:param>\n\t\t<xsl:variable name=\"trimmed\">\n\t\t\t<xsl:call-template name=\"search-and-replace\">\n\t\t\t\t<xsl:with-param name=\"input\" select=\"$fullname\"/>\n\t\t\t\t<xsl:with-param name=\"search-string\">:public</xsl:with-param>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"trimmed2\">\n\t\t\t<xsl:call-template name=\"search-and-replace\">\n\t\t\t\t<xsl:with-param name=\"input\" select=\"$trimmed\"/>\n\t\t\t\t<xsl:with-param name=\"search-string\">:internal</xsl:with-param>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"trimmed3\" select=\"translate($trimmed2,':','.')\"/>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"$justClass = 'true'\">\n\t\t\t\t<xsl:call-template name=\"substring-after-last\">\n\t\t\t\t\t<xsl:with-param name=\"input\" select=\"translate($trimmed3,'/','.')\"/>\n\t\t\t\t\t<xsl:with-param name=\"substr\">.</xsl:with-param>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:when>\n\t\t\t<xsl:when test=\"contains($trimmed3,'/')\">\n\t\t\t\t<!-- inner class -->\n\t\t\t\t<xsl:value-of select=\"translate(substring-before($trimmed3,'/'),'.',$separator)\"/>\n\t\t\t\t<xsl:text>.</xsl:text>\n\t\t\t\t<xsl:variable name=\"trimmed4\" select=\"substring-after($trimmed3,'/')\"/>\n\t\t\t\t<xsl:if test=\"contains($trimmed4,'.')\">\n\t\t\t\t\t<xsl:variable name=\"trimmed5\">\n\t\t\t\t\t\t<xsl:call-template name=\"substring-after-last\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"input\" select=\"$trimmed4\"/>\n\t\t\t\t\t\t\t<xsl:with-param name=\"substr\" select=\"'.'\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t<xsl:value-of select=\"translate($trimmed5,'.',$separator)\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(contains($trimmed4,'.'))\">\n\t\t\t\t\t<xsl:value-of select=\"translate($trimmed4,'.',$separator)\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:value-of select=\"translate($trimmed3,'.',$separator)\"/>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template name=\"search-and-replace\">\n\t\t<xsl:param name=\"input\"/>\n\t\t<xsl:param name=\"search-string\"/>\n\t\t<xsl:param name=\"replace-string\"/>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"$search-string and contains($input,$search-string)\">\n\t\t\t\t<xsl:value-of select=\"substring-before($input,$search-string)\"/>\n\t\t\t\t<xsl:value-of select=\"$replace-string\"/>\n\t\t\t\t<xsl:call-template name=\"search-and-replace\">\n\t\t\t\t\t<xsl:with-param name=\"input\" select=\"substring-after($input,$search-string)\"/>\n\t\t\t\t\t<xsl:with-param name=\"search-string\" select=\"$search-string\"/>\n\t\t\t\t\t<xsl:with-param name=\"replace-string\" select=\"$replace-string\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:value-of select=\"$input\"/>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template name=\"substring-after-last\">\n\t\t<xsl:param name=\"input\"/>\n\t\t<xsl:param name=\"substr\"/>\n\t\t<xsl:variable name=\"tmp\" select=\"substring-after($input,$substr)\"/>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"$substr and contains($tmp,$substr)\">\n\t\t\t\t<xsl:call-template name=\"substring-after-last\">\n\t\t\t\t\t<xsl:with-param name=\"input\" select=\"$tmp\"/>\n\t\t\t\t\t<xsl:with-param name=\"substr\" select=\"$substr\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:value-of select=\"$tmp\"/>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template name=\"isTopLevel\">\n\t\t<xsl:param name=\"packageName\"/>\n\t\t<xsl:value-of select=\"string-length($packageName)=0 or contains($packageName,'__Global__')\"/>\n\t</xsl:template>\n\t<xsl:template match=\"related-links\">\n\t\t<related-links>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</related-links>\n\t</xsl:template>\n\t<xsl:template match=\"apiClassifierDetail\">\n\t\t<apiClassifierDetail>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</apiClassifierDetail>\n\t</xsl:template>\n\t<xsl:template match=\"shortdesc\">\n\t\t<shortdesc>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</shortdesc>\n\t</xsl:template>\n\t<xsl:template match=\"prolog\">\n\t\t<prolog>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</prolog>\n\t</xsl:template>\n\t<xsl:template match=\"node()\">\n\t\t<xsl:copy copy-namespaces=\"no\">\n\t\t\t<xsl:copy-of select=\"@*\"/>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</xsl:copy>\n\t</xsl:template>\n\t<xsl:template match=\"styles\"/>\n\t<xsl:template match=\"prolog/asMetadata/Exclude\"/>\n</xsl:stylesheet>\n"
  },
  {
    "path": "documentation/api-reference/templates/Overviews_Base.xml",
    "content": "<!--\n\n\tADOBE SYSTEMS INCORPORATED\n\tCopyright 2006 Adobe Systems Incorporated\n\tAll Rights Reserved.\n\n\tNOTICE: Adobe permits you to use, modify, and distribute this file\n\tin accordance with the terms of the license agreement accompanying it.\n\n-->\n\n<!-- this file normally should not be edited.  Use the command-line\n     parameters for ASDoc instead -->\n<overviews>\n    <!-- \n\t<all-packages>\n\t\t<description></description>\n\t</all-packages>\n\t-->\n\t<all-classes>\n\t\t<description><![CDATA[Documentation for classes includes syntax, usage information, and code samples for methods, properties, and event handlers and listeners for those APIs that belong to a specific class in ActionScript. The classes are listed alphabetically. If you are not sure to which class a certain method or property belongs, you can look it up in the Index.]]></description>\n\t</all-classes>\n\t<deprecated>\n\t\t<shortDescription><![CDATA[A list of deprecated items and suggested alternatives when available.]]></shortDescription>\n\t\t<description></description>\n\t</deprecated>\n\t<!--\n\t<packages>\n\t\t<package name=\"\">\n\t\t\t<shortDescription></shortDescription>\n\t\t\t<description></description>\n\t\t\t<propertiesDescription></propertiesDescription>\n\t\t\t<functionsDescription></functionsDescription>\n\t\t</package>\n\t</packages>\n\t-->\n</overviews>\n"
  },
  {
    "path": "documentation/api-reference/templates/PostProcessing.xslt",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n\n\tADOBE SYSTEMS INCORPORATED\n\tCopyright 2008 Adobe Systems Incorporated\n\tAll Rights Reserved.\n\n\tNOTICE: Adobe permits you to use, modify, and distribute this file\n\tin accordance with the terms of the license agreement accompanying it.\n\n-->\n<xsl:stylesheet version=\"2.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n\t<xsl:output method=\"xml\" version=\"1.0\" encoding=\"UTF-8\" indent=\"no\"/>\n\t<xsl:param name=\"ditaFileDir\" select=\"''\"/>\n\t<xsl:variable name=\"classheader\" select=\"document('ClassHeader.xml')\"/>\n\t<xsl:variable name=\"fieldSummary\" select=\"document('PP_fieldSummary.xml')\"/>\n\t<xsl:variable name=\"methodSummary\" select=\"document('pp_methodSummary.xml')\"/>\n\t<xsl:template match=\"node()\">\n\t\t<xsl:copy copy-namespaces=\"no\">\n\t\t\t<xsl:copy-of select=\"@*\"/>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</xsl:copy>\n\t</xsl:template>\n\t<!-- For FieldSummary -->\n\t<xsl:template match=\"apiName[parent::apiValue[not(shortdesc)] and parent::apiValue/apiValueDetail/apiValueDef/apiInheritDoc]\">\n\t\t<xsl:copy-of select=\".\"/>\n\t\t<xsl:variable name=\"name\" select=\".\"/>\n\t\t<xsl:variable name=\"apiID\" select=\"ancestor::apiClassifier/@id\"/>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"$classheader//apiPackage/apiClassifier[@id=$apiID]\">\n\t\t\t\t<xsl:for-each select=\"$classheader//apiPackage/apiClassifier[@id=$apiID]/apiClassifierDetail/Inheritancelist/Inheritance/Inherit/@id\">\n\t\t\t\t\t<xsl:variable name=\"baseID\" select=\".\"/>\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"$fieldSummary//apiPackage/apiClassifier[@id=$baseID]/apiOperation[apiName = $name]/shortdesc\">\n\t\t\t\t\t\t\t<xsl:copy-of select=\"$fieldSummary//apiPackage/apiClassifier[@id=$baseID]/apiOperation[apiName = $name]/shortdesc\"/>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:message terminate=\"no\">\n\t\t\t\t\t<xsl:text>WARNING : Short Description not present for </xsl:text>\n\t\t\t\t\t<xsl:value-of select=\"parent::apiValue/@id\"/>\n\t\t\t\t</xsl:message>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template match=\"apiValueDef[parent::apiValueDetail[not(apiDesc)] and parent::apiValueDetail/apiValueDef/apiInheritDoc]\">\n\t\t<xsl:copy-of select=\".\"/>\n\t\t<xsl:variable name=\"name\" select=\"parent::apiValueDetail/parent::apiValue/apiName\"/>\n\t\t<xsl:variable name=\"apiID\" select=\"ancestor::apiClassifier/@id\"/>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"$classheader//apiPackage/apiClassifier[@id=$apiID]\">\n\t\t\t\t<xsl:for-each select=\"$classheader//apiPackage/apiClassifier[@id=$apiID]/apiClassifierDetail/Inheritancelist/Inheritance/Inherit/@id\">\n\t\t\t\t\t<xsl:variable name=\"baseID\" select=\".\"/>\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"$fieldSummary//apiPackage/apiClassifier[@id=$baseID]/apiOperation[apiName = $name]/apiValueDetail/apiDesc\">\n\t\t\t\t\t\t\t<xsl:copy-of select=\"$fieldSummary//apiPackage/apiClassifier[@id=$baseID]/apiOperation[apiName = $name]/apiValueDetail/apiDesc\"/>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:message terminate=\"no\">\n\t\t\t\t\t<xsl:text>WARNING : api Description not present for </xsl:text>\n\t\t\t\t\t<xsl:value-of select=\"parent::apiValueDetail/parent::apiValue/@id\"/>\n\t\t\t\t</xsl:message>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<!-- For MethodSummary -->\n\t<xsl:template match=\"apiName[parent::apiOperation[not(shortdesc)] and parent::apiOperation/apiOperationDetail/apiOperationDef/apiInheritDoc]\">\n\t\t<xsl:copy-of select=\".\"/>\n\t\t<xsl:variable name=\"name\" select=\".\"/>\n\t\t<xsl:variable name=\"apiID\" select=\"ancestor::apiClassifier/@id\"/>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"$classheader//apiPackage/apiClassifier[@id=$apiID]\">\n\t\t\t\t<xsl:for-each select=\"$classheader//apiPackage/apiClassifier[@id=$apiID]/apiClassifierDetail/Inheritancelist/Inheritance/Inherit/@id\">\n\t\t\t\t\t<xsl:variable name=\"baseID\" select=\".\"/>\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"$methodSummary//apiPackage/apiClassifier[@id=$baseID]/apiOperation[apiName = $name]/shortdesc\">\n\t\t\t\t\t\t\t<xsl:copy-of select=\"$methodSummary//apiPackage/apiClassifier[@id=$baseID]/apiOperation[apiName = $name]/shortdesc\"/>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:message terminate=\"no\">\n\t\t\t\t\t<xsl:text>WARNING : Short Description not present for </xsl:text>\n\t\t\t\t\t<xsl:value-of select=\"parent::apiOperation/@id\"/>\n\t\t\t\t</xsl:message>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template match=\"apiOperationDef[parent::apiOperationDetail[not(apiDesc) or apiDesc[normalize-space(.)=' ']] and parent::apiOperationDetail/apiOperationDef/apiInheritDoc]\">\n\t\t<xsl:copy-of select=\".\"/>\n\t\t<xsl:variable name=\"name\" select=\"parent::apiOperationDetail/parent::apiOperation/apiName\"/>\n\t\t<xsl:variable name=\"apiID\" select=\"ancestor::apiClassifier/@id\"/>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"$classheader//apiPackage/apiClassifier[@id=$apiID]\">\n\t\t\t\t<xsl:for-each select=\"$classheader//apiPackage/apiClassifier[@id=$apiID]/apiClassifierDetail/Inheritancelist/Inheritance/Inherit/@id\">\n\t\t\t\t\t<xsl:variable name=\"baseID\" select=\".\"/>\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"$methodSummary//apiPackage/apiClassifier[@id=$baseID]/apiOperation[apiName = $name]/apiOperationDetail/apiDesc\">\n\t\t\t\t\t\t\t<xsl:copy-of select=\"$methodSummary//apiPackage/apiClassifier[@id=$baseID]/apiOperation[apiName = $name]/apiOperationDetail/apiDesc\"/>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:message terminate=\"no\">\n\t\t\t\t\t<xsl:text>WARNING : api Description not present for </xsl:text>\n\t\t\t\t\t<xsl:value-of select=\"parent::apiOperationDetail/parent::apiOperation/@id\"/>\n\t\t\t\t</xsl:message>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template match=\"shortdesc[normalize-space(.)= ' ']\"/>\n\t<xsl:template match=\"shortdesc[2]\"/>\n\t<xsl:template match=\"apiDesc[normalize-space(.) =' ']\"/>\n\t<xsl:template match=\"apiDesc[2]\"/>\n</xsl:stylesheet>\n"
  },
  {
    "path": "documentation/api-reference/templates/all-classes.xslt",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n\n\tADOBE SYSTEMS INCORPORATED\n\tCopyright 2008 Adobe Systems Incorporated\n\tAll Rights Reserved.\n\n\tNOTICE: Adobe permits you to use, modify, and distribute this file\n\tin accordance with the terms of the license agreement accompanying it.\n\n-->\n<xsl:stylesheet version=\"2.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:saxon=\"http://sf.net/saxon\" xmlns:str=\"http://exslt.org/strings\" xmlns:ifn=\"urn:internal:functions\"\n\texclude-result-prefixes=\"saxon str ifn\">\n\t<xsl:import href=\"asdoc-util.xslt\"/>\n\t<xsl:output encoding=\"UTF-8\" method=\"html\" omit-xml-declaration=\"yes\" saxon:indent=\"3\" use-character-maps=\"disable\" indent=\"yes\"/>\n\t<xsl:variable name=\"title\" select=\"concat($asdoc_terms/row[entry[1][p/text() = 'allClasses']]/entry[2]/p, ' - ',$title-base)\"/>\n\t<xsl:param name=\"packages_map_name\" select=\"'packagemap.xml'\"/>\n\t<xsl:param name=\"jslr\" select=\"'flashclasses.xml'\"/>\n\t<xsl:param name=\"prog_language_name\" select=\"''\"/>\n\t<xsl:template match=\"/\">\n\t\t<xsl:copy-of select=\"$noLiveDocs\"/>\n\t\t<xsl:copy-of select=\"$docType\"/>\n\t\t<xsl:element name=\"html\">\n\t\t\t<head>\n\t\t\t\t<title>\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\" />\n\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t<xsl:value-of select=\"$title\"/>\n\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t</title>\n\t\t\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n\t\t\t\t<base target=\"classFrame\"/>\n\t\t\t\t<xsl:call-template name=\"getStyleLink\">\n\t\t\t\t\t<xsl:with-param name=\"link\" select=\"asdoc/link\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</head>\n\t\t\t<body class=\"classFrameContent\">\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t<h3>\n\t\t\t\t\t\t\t<a href=\"class-summary.html\" target=\"classFrame\" style=\"color:black\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'allClasses']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</h3>\n\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t</xsl:choose>\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\">\n\t\t\t\t\t\t\t<xsl:apply-templates select=\"//apiClassifier\">\n\t\t\t\t\t\t\t\t<xsl:sort select=\"apiName\" order=\"ascending\" lang=\"en-US\"/>\n\t\t\t\t\t\t\t</xsl:apply-templates>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t</xsl:choose>\n\t\t\t</body>\n\t\t</xsl:element>\n\t\t<xsl:copy-of select=\"$copyrightComment\"/>\n\t</xsl:template>\n\t<xsl:template match=\"apiClassifier\">\n\t\t<xsl:variable name=\"name\" select=\"./apiName\"/>\n\t\t<xsl:variable name=\"packageName\" select=\"../apiName\"/>\n\t\t<xsl:variable name=\"isTopLevel\">\n\t\t\t<xsl:call-template name=\"isTopLevel\">\n\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$packageName\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"classPath\" select=\"translate($packageName,'.','/')\"/>\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"$isTopLevel='false'\">\n\t\t\t\t\t\t<a href=\"{$classPath}/{$name}.html\"  title=\"{$packageName}.{$name}\">\n\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t<xsl:when test=\"./apiClassifierDetail/apiClassifierDef/apiInterface\">\n\t\t\t\t\t\t\t\t\t<i>\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t</i>\n\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</xsl:when>\n\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t<xsl:variable name=\"targetValue\" select=\"concat('./',$name,'.html')\"/>\n\t\t\t\t\t\t<a href=\"{$targetValue}\">\n\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t<xsl:when test=\"./apiClassifierDetail/apiClassifierDef/apiInterface!=null\">\n\t\t\t\t\t\t\t\t\t<i>\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t</i>\n\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t</xsl:choose>\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t<xsl:if test=\"prolog/asMetadata/apiVersion/apiPlatform[@name='AIR'] and not (prolog/asMetadata/apiVersion/apiPlatform[@name='Flash'])\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t<img src=\"images/AirIcon12x12.gif\" width=\"12\" height=\"12\" hspace=\"0\" vspace=\"0\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t</xsl:choose>\n\t\t\t</td>\n\t\t</tr>\n\t</xsl:template>\n</xsl:stylesheet>\n"
  },
  {
    "path": "documentation/api-reference/templates/all-index.xslt",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n\n\tADOBE SYSTEMS INCORPORATED\n\tCopyright 2008 Adobe Systems Incorporated\n\tAll Rights Reserved.\n\n\tNOTICE: Adobe permits you to use, modify, and distribute this file\n\tin accordance with the terms of the license agreement accompanying it.\n\n-->\n<xsl:stylesheet version=\"2.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:saxon=\"http://sf.net/saxon\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:ifn=\"urn:internal:functions\"\n\texclude-result-prefixes=\"saxon xs ifn\">\n\t<xsl:import href=\"asdoc-util.xslt\"/>\n\t<xsl:output encoding=\"UTF-8\" method=\"html\" omit-xml-declaration=\"yes\" use-character-maps=\"disable\"/>\n\t<xsl:param name=\"basedir\" select=\"''\"/>\n\t<xsl:param name=\"directivesFile\" select=\"'directives.xml'\"/>\n\t<xsl:param name=\"globalFuncFile\" select=\"'global_functions.xml'\"/>\n\t<xsl:param name=\"globalPropsFile\" select=\"'global_props.xml'\"/>\n\t<xsl:param name=\"constantsFile\" select=\"'constants.xml'\"/>\n\t<xsl:param name=\"operatorsFile\" select=\"'operators.xml'\"/>\n\t<xsl:param name=\"statementsFile\" select=\"'statements.xml'\"/>\n\t<xsl:param name=\"specialTypesFile\" select=\"'specialTypes.xml'\"/>\n\t<xsl:param name=\"unsupportedFile\" select=\"'unsupported.xml'\"/>\n\t<xsl:param name=\"fscommandFile\" select=\"'fscommand.xml'\"/>\n\t<xsl:param name=\"splitIndex\" select=\"$config/options[@splitIndex='true']\"/>\n\t<xsl:param name=\"outputPath\" select=\"''\"/>\n\t<xsl:param name=\"ditaFileDir\" select=\"''\"/>\n\t<xsl:param name=\"ditaFile\" select=\"'packages.dita'\"/>\n\t<xsl:param name=\"packages_map_name\" select=\"'packagemap.xml'\"/>\n\t<xsl:param name=\"symbolsName\" select=\"'Symbols'\"/>\n\t<xsl:param name=\"packageOverviewFile\" select=\"'overviews.xml'\"/>\n\t<xsl:param name=\"prog_language_name\" select=\"'ActionScript'\"/>\n\t<xsl:variable name=\"directives\">\n\t\t<xsl:if test=\"$config/languageElements[@show='true' and @directives='true']\">\n\t\t\t<xsl:copy-of select=\"document(concat($basedir,$directivesFile))/asdoc\"/>\n\t\t</xsl:if>\n\t</xsl:variable>\n\t<xsl:variable name=\"globalFuncs\">\n\t\t<xsl:if test=\"$config/languageElements[@show='true' and @functions='true'] and $config/options[@docversion!='3']\">\n\t\t\t<xsl:copy-of select=\"document(concat($basedir,$globalFuncFile))/asdoc\"/>\n\t\t</xsl:if>\n\t</xsl:variable>\n\t<xsl:variable name=\"globalProps\">\n\t\t<xsl:if test=\"$config/languageElements[@show='true' and @properties='true']\">\n\t\t\t<xsl:copy-of select=\"document(concat($basedir,$globalPropsFile))/asdoc\"/>\n\t\t</xsl:if>\n\t</xsl:variable>\n\t<xsl:variable name=\"constants\">\n\t\t<xsl:if test=\"$config/languageElements[@show='true' and @constants='true'] and $config/options[@docversion!='3']\">\n\t\t\t<xsl:copy-of select=\"document(concat($basedir,$constantsFile))/asdoc\"/>\n\t\t</xsl:if>\n\t</xsl:variable>\n\t<xsl:variable name=\"operators\">\n\t\t<xsl:if test=\"$config/languageElements[@show='true' and @operators='true']\">\n\t\t\t<xsl:copy-of select=\"document(concat($basedir,$operatorsFile))/asdoc\"/>\n\t\t</xsl:if>\n\t</xsl:variable>\n\t<xsl:variable name=\"statements\">\n\t\t<xsl:if test=\"$config/languageElements[@show='true' and @statements='true']\">\n\t\t\t<xsl:copy-of select=\"document(concat($basedir,$statementsFile))/asdoc\"/>\n\t\t</xsl:if>\n\t</xsl:variable>\n\t<xsl:variable name=\"specialTypes\">\n\t\t<xsl:if test=\"$config/languageElements[@show='true' and @specialTypes='true']\">\n\t\t\t<xsl:copy-of select=\"document(concat($basedir,$specialTypesFile))/asdoc\"/>\n\t\t</xsl:if>\n\t</xsl:variable>\n\t<xsl:variable name=\"unsupported\">\n\t\t<xsl:if test=\"$config/index[@showUnsupported='true']\">\n\t\t\t<xsl:copy-of select=\"document(concat($basedir,$unsupportedFile))/asdoc\"/>\n\t\t</xsl:if>\n\t</xsl:variable>\n\t<xsl:variable name=\"fscommand\">\n\t\t<xsl:if test=\"$config/index[@showFscommand='true']\">\n\t\t\t<xsl:copy-of select=\"document(concat($basedir,$fscommandFile))/asdoc\"/>\n\t\t</xsl:if>\n\t</xsl:variable>\n\t<xsl:variable name=\"matches\"\n\t\tselect=\"//*[((self::apiOperation or self::apiValue or self::apiConstructor or self::style or self::SkinPart or self::SkinState or self::effect) and not(ancestor::asAncestor)) or self::apiPackage or self::apiClassifier or (self::adobeApiEvent[not(adobeApiEventDetail/adobeApiEventDef/apiDefinedEvent)] and (not(parent::apiOperation) and not(parent::apiConstructor) and not(parent::eventsDefined) and not(ancestor::asAncestor)))] | $directives/asdoc/object/methods/method | $globalFuncs/asdoc/object/methods/method | $globalProps/asdoc/object/fields/field | $constants/asdoc/object/fields/field | $operators/asdoc/operators/operator | $statements/asdoc/statements/statement | $specialTypes/asdoc/specialTypes/specialType | $unsupported/asdoc/unsupported//*[@name] | $fscommand/asdoc/fscommand | $config/index/entry\"/>\n\t<xsl:variable name=\"symbols\">\n\t\t<xsl:text disable-output-escaping=\"yes\">+,:!?/.^~*=%|&amp;&lt;>()[]{}\"</xsl:text>\n\t</xsl:variable>\n\t<xsl:variable name=\"letters\">\n\t\t<xsl:if test=\"$config/languageElements[@show='true' and (@operators='true' or @specialTypes='true')]\">\n\t\t\t<xsl:value-of select=\"$symbolsName\"/>\n\t\t\t<xsl:text> </xsl:text>\n\t\t</xsl:if>\n\t\t<xsl:text>A B C D E F G H I J K L M N O P Q R S T U V W X Y Z</xsl:text>\n\t</xsl:variable>\n\t<xsl:variable name=\"letterSet\" select=\"tokenize($letters,' ')\"/>\n\t<xsl:template match=\"/\">\n\t\t<xsl:if test=\"$splitIndex='false'\">\n\t\t\t<xsl:apply-templates select=\"allClasses\"/>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"$splitIndex!='false'\">\n\t\t\t<xsl:variable name=\"context\" select=\"/\"/>\n\t\t\t<xsl:for-each select=\"$letterSet\">\n\t\t\t\t<xsl:variable name=\"fileName\" select=\"concat('all-index-',.)\"/>\n\t\t\t\t<xsl:result-document href=\"{concat($outputPath,$fileName,'.html')}\">\n\t\t\t\t\t<xsl:apply-templates select=\"$context/allClasses\">\n\t\t\t\t\t\t<xsl:with-param name=\"displayLetters\" select=\"tokenize(.,' ')\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"fileName\" select=\"$fileName\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"letter\" select=\".\"/>\n\t\t\t\t\t</xsl:apply-templates>\n\t\t\t\t</xsl:result-document>\n\t\t\t</xsl:for-each>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template match=\"allClasses\">\n\t\t<xsl:param name=\"displayLetters\" select=\"$letterSet\"/>\n\t\t<xsl:param name=\"fileName\" select=\"'all-index'\"/>\n\t\t<xsl:param name=\"letter\"/>\n\t\t<xsl:variable name=\"localizedLetter\">\n\t\t\t<xsl:choose>\n\t\t\t\t<xsl:when test=\"$letter = 'Symbols'\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Symbols']]/entry[2]/p\"/>\n\t\t\t\t</xsl:when>\n\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t<xsl:value-of select=\"$letter\"/>\n\t\t\t\t</xsl:otherwise>\n\t\t\t</xsl:choose>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"localizedIndex\">\n\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Index']]/entry[2]/p\"/>\n\t\t</xsl:variable>\n\t\t<xsl:copy-of select=\"$noLiveDocs\"/>\n\t\t<xsl:copy-of select=\"$docType\"/>\n\t\t<xsl:if test=\"$config/options[@livedocs='true']\">\n\t\t\t<xsl:comment>#config errmsg=\"\"</xsl:comment>\n\t\t</xsl:if>\n\t\t<xsl:element name=\"html\">\n\t\t\t<head>\n\t\t\t\t<title>\n\t\t\t\t\t<xsl:if test=\"$splitIndex and $letter\">\n\t\t\t\t\t\t<xsl:value-of select=\"$localizedLetter\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"not($splitIndex)\">\n\t\t\t\t\t\t<xsl:value-of select=\"$config/title\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t<xsl:value-of select=\"localizedIndex\"/>\n\t\t\t\t\t<xsl:call-template name=\"getPageTitlePostFix\"/>\n\t\t\t\t</title>\n\t\t\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n\t\t\t\t<xsl:call-template name=\"getStyleLink\">\n\t\t\t\t\t<xsl:with-param name=\"link\" select=\"asdoc/link\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</head>\n\t\t\t<xsl:element name=\"body\">\n\t\t\t\t<xsl:if test=\"$isEclipse\">\n\t\t\t\t\t<xsl:attribute name=\"class\">\n\t\t\t\t\t\t<xsl:text>eclipseBody</xsl:text>\n\t\t\t\t\t</xsl:attribute>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:call-template name=\"getTitleScript\">\n\t\t\t\t\t<xsl:with-param name=\"title\">\n\t\t\t\t\t\t<xsl:if test=\"$splitIndex\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"concat($letter,' ',$localizedIndex,' - ',$title-base)\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"not($splitIndex)\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"concat('All Index - ',$title-base)\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:with-param>\n\t\t\t\t</xsl:call-template>\n\t\t\t\t<xsl:call-template name=\"getLinks2\">\n\t\t\t\t\t<xsl:with-param name=\"subTitle\">\n\t\t\t\t\t\t<xsl:if test=\"$splitIndex\">\n\t\t\t\t\t\t\t<xsl:if test=\"$letter!='Symbols'\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($localizedLetter,$nbsp,$localizedIndex)\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"$letter='Symbols'\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'SymbolsIndex']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"not($splitIndex)\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"concat('All',$nbsp,'Index')\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:with-param>\n\t\t\t\t\t<xsl:with-param name=\"fileName\" select=\"$fileName\"/>\n\t\t\t\t\t<xsl:with-param name=\"fileName2\" select=\"'index-list.html'\"/>\n\t\t\t\t\t<xsl:with-param name=\"showProperties\" select=\"false()\"/>\n\t\t\t\t\t<xsl:with-param name=\"showMethods\" select=\"false()\"/>\n\t\t\t\t\t<xsl:with-param name=\"showIndex\" select=\"false()\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t\t<div class=\"MainContent\">\n\t\t\t\t\t<br/>\n\t\t\t\t\t<table class=\"allIndexTable\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n\t\t\t\t\t\t<xsl:for-each select=\"$displayLetters\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td colspan=\"2\">\n\t\t\t\t\t\t\t\t\t<a name=\"{.}\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"currLetter\" select=\".\"/>\n\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$letterSet\">\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$currLetter=.\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$currLetter=$symbolsName\">\n\t\t\t\t\t\t\t\t\t\t\t\t<font color=\"black\" size=\"6px\" style=\"bold\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\" select=\".\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t</font>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$currLetter!=$symbolsName\">\n\t\t\t\t\t\t\t\t\t\t\t\t<font color=\"black\" size=\"10px\" style=\"bold\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\" select=\".\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t</font>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$currLetter!=.\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$splitIndex='false'\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"#{.}\" onclick=\"javascript:loadClassListFrame('index-list.html');\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\" select=\".\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$splitIndex!='false'\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"all-index-{.}.html\" onclick=\"javascript:loadClassListFrame('index-list.html');\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\" select=\".\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\"><![CDATA[&nbsp; ]]></xsl:text>\n\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<xsl:variable name=\"firstUpper\" select=\".\"/>\n\t\t\t\t\t\t\t<xsl:variable name=\"checkingSymbol\" select=\".=$symbolsName and $config/languageElements[@show='true' and (@operators='true' or @specialTypes='true')]\"/>\n\t\t\t\t\t\t\t<xsl:variable name=\"firstLower\" select=\"translate($firstUpper,$upperCase,$lowerCase)\"/>\n\t\t\t\t\t\t\t<xsl:for-each select=\"$matches\">\n\t\t\t\t\t\t\t\t<xsl:sort select=\"concat(translate(self::apiPackage[apiName='__Global__']/apiName,'Global__','Top Le'),translate(@symbol,$symbols,''),translate(./apiName | @name,'#_.( ',''))\"\n\t\t\t\t\t\t\t\t\tdata-type=\"text\" lang=\"en-US\"/>\n\t\t\t\t\t\t\t\t<xsl:sort select=\"../../apiName | @name\"/>\n\t\t\t\t\t\t\t\t<xsl:sort select=\"../apiName | @name\"/>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"isSymbol\" select=\"string-length(./@symbol) > 0 and not(contains($letters,translate(substring(./@symbol,1,1),$lowerCase,$upperCase)))\"/>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"isSpecialSymbol\" select=\"self::specialType and not(contains($letters,translate(substring(@name,1,1),$lowerCase,$upperCase)))\"/>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"isRestParam\" select=\"starts-with(@name,'...')\"/>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"sortableName\">\n\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t<!-- special case for -Infinity -->\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"./apiName='-Infinity'\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring(./apiName,2)\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"./apiName='__Global__'\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'TopLevel']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isSymbol\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@symbol\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not($isSymbol)\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length(@symbol) > 0\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@symbol\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(string-length(@symbol) > 0)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"translate(./apiName,'#_.( ','')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"local-name(.) ='style' or local-name(.) ='SkinPart' or local-name(.) ='SkinState' or local-name(.) ='effect' or local-name(.) ='statement' or local-name(.) ='specialType' or local-name(.) ='operator'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"./@name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"symbolMatch\" select=\"$checkingSymbol and ($isSymbol or $isSpecialSymbol or $isRestParam)\"/>\n\t\t\t\t\t\t\t\t<xsl:if test=\"$symbolMatch or starts-with($sortableName,$firstLower) or starts-with($sortableName,$firstUpper)\">\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td class=\"idxrow\" colspan=\"2\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- unsupported must come first, otherwise they show up in their original sections -->\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor::unsupported\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"unsupported.html\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"self::method\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>()</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$emdash\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Unsupported']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"self::globalFunction\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"global_functions.html\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"../@label\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"self::fscommand\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"global_functions.html#fscommand()\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"../@label\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"self::eventHandler and not(string-length(@class))\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text> global </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"parent::node()/@label\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length(@package)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>, </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length(@class)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ClassIn']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@package\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(string-length(@class))\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Package']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{concat(translate(@package,'.','/'),'/package-detail.html')}\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@package\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(string-length(@package))\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"self::class\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>, </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"package-detail.html\" onclick=\"javascript:loadClassListFrame('class-list.html');\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'TopLevel']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length(@class)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>, </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ClassIn']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{@class}.html\" onclick=\"javascript:loadClassListFrame('class-list.html');\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@class\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"self::fscommand\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{concat('fscommand/',@name,'.html')}\" onclick=\"javascript:loadClassListFrame('fscommand-list.html');\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$emdash\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>Command for </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"global_functions.html#fscommand2()\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'fscommand2']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'GlobalFunction']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"(self::apiOperation and (not(@type) or (@type!='handler'))) or self::apiConstructor\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"packageName\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"isTopLevel\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"isTopLevel\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$packageName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"classPath\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<!-- AS2 lang elements -->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='true' or ../../@type='list'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>.</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='false'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"translate($packageName,'.','/')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<!-- AS2 lang elements -->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"../../@type='list'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{../../@href}#{@name}()\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor::apiClassifier\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$classPath}/{../apiName}.html#{apiName}()\" onclick=\"javascript:loadClassListFrame('{$classPath}/class-list.html');\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$classPath}/package.html#{apiName}()\" onclick=\"javascript:loadClassListFrame('{$classPath}/class-list.html');\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(@type) or @type!='directive'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"params\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getParamList\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"params\" select=\".//apiParam\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>(</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:copy-of select=\"$params\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>)</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$emdash\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"self::apiOperation\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getMethodDesc\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"classPath\" select=\"$classPath\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"self::apiConstructor\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getConstructorDesc\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"classPath\" select=\"$classPath\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"self::apiValue\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"isTopLevel\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"isTopLevel\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"classPath\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<!-- AS2 lang elements -->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='true' or ../../@type='list'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>.</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='false'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"ancestor::apiClassifier\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"translate(ancestor-or-self::apiPackage/apiName,'.','/')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(ancestor::apiClassifier)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"translate(ancestor-or-self::apiPackage/apiName,'.','/')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<!-- AS2 lang elements -->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"../../@type='list'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{../../@href}#{apiName}\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor::apiClassifier\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$classPath}/{ancestor::apiClassifier/apiName}.html#{apiName}\" onclick=\"javascript:loadClassListFrame('{$classPath}/class-list.html');\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$classPath}/package.html#{apiName}\" onclick=\"javascript:loadClassListFrame('{$classPath}/class-list.html');\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$emdash\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getPropertyDesc\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"classPath\" select=\"$classPath\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"self::style or self::SkinPart or self::SkinState or self::effect\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"isTopLevel\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"isTopLevel\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"ancestor::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"classPath\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<!-- AS2 lang elements -->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='true' or ../../@type='list'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>.</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='false'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"translate(ancestor-or-self::apiPackage/apiName,'.','/')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"self::style\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$classPath}/{ancestor::apiClassifier/apiName}.html#style:{@name}\" onclick=\"javascript:loadClassListFrame('{$classPath}/class-list.html');\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$emdash\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Style']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>, </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ClassIn']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getClassRef\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"classPath\" select=\"$classPath\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td width=\"20\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"styleText\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./description/@conref\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"./description/@conref\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"local-name(./description)\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"'style'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(./description/@conref)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"normalize-space(./description)\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($styleText) &gt; 0\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"styleTextShortDesc\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getFirstSentence\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"inText\" select=\"$styleText\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"$styleTextShortDesc\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"self::SkinPart\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"pkg\" select=\"translate($classPath,'/','.')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"class\" select=\"ancestor::apiClassifier/apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$classPath}/{ancestor::apiClassifier/apiName}.html#skinpart:{@name}\" onclick=\"javascript:loadClassListFrame('{$classPath}/class-list.html');\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$emdash\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'SkinPart']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>, </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ClassIn']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getClassRef\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"classPath\" select=\"$classPath\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td width=\"20\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"normalize-space(./description)\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"self::SkinState\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"pkg\" select=\"translate($classPath,'/','.')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"class\" select=\"ancestor::apiClassifier/apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$classPath}/{ancestor::apiClassifier/apiName}.html#skinstate:{@name}\" onclick=\"javascript:loadClassListFrame('{$classPath}/class-list.html');\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@name\"/>Skin\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$emdash\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'SkinState']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>, </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ClassIn']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getClassRef\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"classPath\" select=\"$classPath\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td width=\"20\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"normalize-space(./description)\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"self::effect\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$classPath}/{ancestor::apiClassifier/apiName}.html#effect:{@name}\" onclick=\"javascript:loadClassListFrame('{$classPath}/class-list.html');\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$emdash\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Effect']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>, </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ClassIn']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getClassRef\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"classPath\" select=\"$classPath\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"self::apiPackage\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"isTopLevel\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"isTopLevel\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"./apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"packagePath\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='true'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>.</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='false'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"translate(./apiName,'.','/')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$packagePath}/package-detail.html\" onclick=\"javascript:loadClassListFrame('{$packagePath}/class-list.html');\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='true'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'TopLevel']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='false'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$emdash\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Package']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"self::apiClassifier\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"name\" select=\"./apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"packageName\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"../apiName != '__Global__'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"../apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"isTopLevel\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"isTopLevel\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$packageName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"classPath\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='true'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>.</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='false'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"translate($packageName,'.','/')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$classPath}/{$name}.html\" onclick=\"javascript:loadClassListFrame('{$classPath}/class-list.html');\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./apiClassifierDetail/apiClassifierDef[apiInterface]\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</i>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./apiClassifierDetail/apiClassifierDef[not(apiInterface)]\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$emdash\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getClassDesc\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$packageName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"self::adobeApiEvent or (self::apiOperation and @type='handler')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"isTopLevel\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"isTopLevel\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"ancestor::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"classPath\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<!-- AS2 lang elements -->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='true' or ../../@type='list'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>.</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='false'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"ancestor::apiClassifier\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"translate(../../apiName,'.','/')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(ancestor::apiClassifier)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"translate(../apiName,'.','/')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<!-- AS2 lang elements -->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"../../@type='list'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{../../@href}#event:{./apiName}\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor::apiClassifier\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$classPath}/{../apiName}.html#event:{./apiName}\" onclick=\"javascript:loadClassListFrame('{$classPath}/class-list.html');\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$classPath}/package-detail.html#event:{./apiName}\" onclick=\"javascript:loadClassListFrame('{$classPath}/class-list.html');\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"@type='handler'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"params\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getParamList\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"params\" select=\"params\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>(</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:copy-of select=\"$params\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>)</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$emdash\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getEventDesc\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"classPath\" select=\"$classPath\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"self::operator or self::statement\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"suffix\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"self::operator and deprecated\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"'_deprecated'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"self::statment or not(deprecated)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"''\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"href\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$config/options/@docversion='2'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"../@href\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not($config/options/@docversion='2')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"local-name()\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>s.html</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$href}#{concat(translate(@name,' ','_'),$suffix)}\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length(@symbol)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@symbol\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text> (</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length(@symbol)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>)</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$emdash\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"self::operator\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Operator']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"self::statement\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Statement']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"self::specialType\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"specialTypes.html#{@name}\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$emdash\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'SpecialType']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"self::entry\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{@href}\" onclick=\"loadClassListFrame('mxml-tags.html');\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$emdash\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"mxml-tag-detail.html\" onclick=\"loadClassListFrame('mxml-tags.html');\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'MXMLOnly']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"(self::statement or self::specialType)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"desc\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"./shortDescription\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"inText\" select=\"$desc\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"desc\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length(./shortdesc) &gt; 0 and not(string-length(./shortdesc/@conref) &gt; 0)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"./shortdesc\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(string-length(./shortdesc) &gt; 0) and (string-length(./shortdesc/@conref) &gt; 0)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor-or-self::apiOperation\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"./shortdesc/@conref\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"'shortdesc'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"'method'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor-or-self::apiValue\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"./shortdesc/@conref\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"'shortdesc'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"'property'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor-or-self::adobeApiEvent\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"./shortdesc/@conref\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"'shortdesc'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"'event'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"inText\" select=\"$desc\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td width=\"20\"/>\n\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"deprecated\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:apply-templates select=\"deprecated\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"(self::apiValue or self::apiOperation or self::apiConstructor or self::adobeApiEvent) and ../../deprecated\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:copy-of select=\"$deprecatedLabel\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<em>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"deprecated\" select=\"$asdoc_terms/row[entry[1][p/text() = 'DeprecatedAsOf']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:apply-templates select=\"$deprecated\" mode=\"terms\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"class\" select=\"../../@name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"as-of\" select=\"../../deprecated/@as-of\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:apply-templates>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</em>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"self::entry\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"inText\" select=\"node()\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"self::effect\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"inText\" select=\"./description\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"self::apiPackage\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getPackageComment\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"./apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<!-- AS2 lang elements -->\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"(self::operator or self::statement or self::specialType)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length(shortDescription/.) or string-length(short-description)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"inText\" select=\"shortDescription/. | short-description/.\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"desc\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length(normalize-space(./shortdesc)) &gt; 0 and not(string-length(normalize-space(./shortdesc/@conref)) &gt; 0)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"inText\" select=\"./shortdesc\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(string-length(normalize-space(./shortdesc)) &gt; 0) and (string-length(normalize-space(./shortdesc/@conref)) &gt; 0)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor-or-self::apiOperation\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"./shortdesc/@conref\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"'shortdesc'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"'method'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor-or-self::apiValue\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"./shortdesc/@conref\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"'shortdesc'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"'property'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor-or-self::adobeApiEvent\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"./shortdesc/@conref\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"'shortdesc'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"'event'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(string-length(normalize-space(./shortdesc)) &gt; 0) and (string-length(normalize-space(./shortdesc/@conref)) = 0)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor-or-self::apiOperation\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"ancestor-or-self::apiOperation/apiOperationDetail/apiOperationDef/apiInheritDoc\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttest=\"ancestor-or-self::apiClassifier/apiClassifierDetail/apiClassifierDef/apiBaseClassifier or ancestor-or-self::apiClassifier/apiClassifierDetail/apiBaseInterface \">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getInheritDocText\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"ancestor-or-self::apiClassifier/apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"'shortdesc'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"'apiOperation'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"nameToMatch\" select=\"ancestor-or-self::apiOperation/apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor-or-self::apiValue\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"ancestor-or-self::apiValue/apiValueDetail/apiValueDef/apiInheritDoc\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttest=\"ancestor-or-self::apiClassifier/apiClassifierDetail/apiClassifierDef/apiBaseClassifier or ancestor-or-self::apiClassifier/apiClassifierDetail/apiBaseInterface \">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getInheritDocText\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"ancestor-or-self::apiClassifier/apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"'shortdesc'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"'apiValue'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"nameToMatch\" select=\"ancestor-or-self::apiValue/apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"text\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"search-and-replace\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"search-string\" select=\"'~~'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"replace-string\" select=\"'*'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"input\" select=\"$desc\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$text\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td colspan=\"2\" style=\"padding-bottom:20px\"/>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<xsl:if test=\"$splitIndex!='false'\">\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td colspan=\"2\">\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"currLetter\" select=\".\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$letterSet\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$currLetter=.\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$currLetter=$symbolsName\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<font color=\"black\" size=\"6px\" style=\"bold\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\" select=\".\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</font>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$currLetter!=$symbolsName\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<font color=\"black\" size=\"10px\" style=\"bold\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\" select=\".\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</font>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$currLetter!=.\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$splitIndex='false'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"#{.}\" onclick=\"javascript:loadClassListFrame('index-list.html');\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\" select=\".\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$splitIndex!='false'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"all-index-{.}.html\" onclick=\"javascript:loadClassListFrame('index-list.html');\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\" select=\".\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\"><![CDATA[&nbsp; ]]></xsl:text>\n\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t</table>\n\t\t\t\t\t<p/>\n\t\t\t\t\t<xsl:call-template name=\"getFeedbackLink\">\n\t\t\t\t\t\t<xsl:with-param name=\"topic\">\n\t\t\t\t\t\t\t<xsl:if test=\"$splitIndex\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($letter,' Index')\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"not($splitIndex)\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"'Index'\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:with-param>\n\t\t\t\t\t\t<xsl:with-param name=\"filename\" select=\"$fileName\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"filename2\" select=\"'index-list.html'\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t<center class=\"copyright\">\n\t\t\t\t\t\t<xsl:copy-of select=\"$copyright\"/>\n\t\t\t\t\t</center>\n\t\t\t\t</div>\n\t\t\t\t<xsl:if test=\"$config/options[@livedocs='true']\">\n\t\t\t\t\t<div class=\"separator\">&#160;</div>\n\t\t\t\t\t<xsl:comment>BEGIN IONCOMMENTS</xsl:comment>\n\t\t\t\t\t<div id=\"ionComHere\"> </div>\n\t\t\t\t\t<xsl:comment>END IONCOMMENTS</xsl:comment>\n\t\t\t\t\t<xsl:comment>#include virtual=\"ionComments.ssi\"</xsl:comment>\n\t\t\t\t\t<p id=\"creativecommons\" class=\"creativecommons\">\n\t\t\t\t\t\t<a href=\"http://creativecommons.org/licenses/by-nc-sa/3.0/\">\n\t\t\t\t\t\t\t<img id=\"creativecommons_img\" src=\"images/CC.png\"/>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</p>\n\t\t\t\t\t<xsl:comment>#include virtual=\"/livedocs/googleAnalytics.ssi\"</xsl:comment>\n\t\t\t\t\t<xsl:comment>#include virtual=\"/ubi/analytics/analytics_ssi.html\"</xsl:comment>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:element>\n\t\t</xsl:element>\n\t\t<xsl:copy-of select=\"$copyrightComment\"/>\n\t</xsl:template>\n\t<xsl:template name=\"getClassRef\">\n\t\t<xsl:param name=\"classPath\"/>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"string-length($classPath) > 1\">\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t<xsl:value-of select=\"ancestor::apiPackage/apiName\"/>\n\t\t\t\t\t\t<xsl:text>.</xsl:text>\n\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t</xsl:choose>\n\t\t\t\t<a href=\"{$classPath}/{ancestor::apiClassifier/apiName}.html\" onclick=\"javascript:loadClassListFrame('{$classPath}/class-list.html');\">\n\t\t\t\t\t<xsl:value-of select=\"ancestor::apiClassifier/apiName\"/>\n\t\t\t\t</a>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<a href=\"{ancestor::apiClassifier/apiName}.html\" onclick=\"javascript:loadClassListFrame('class-list.html');\">\n\t\t\t\t\t<xsl:value-of select=\"ancestor::apiClassifier/apiName\"/>\n\t\t\t\t</a>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template name=\"getMethodDesc\">\n\t\t<xsl:param name=\"classPath\"/>\n\t\t<!-- AS2 lang elements -->\n\t\t<xsl:if test=\"parent::apiClassifier\">\n\t\t\t<!-- TODO handle more variations (override,final?) -->\n\t\t\t<xsl:if test=\"apiOperationDetail/apiOperationDef/apiStatic\">\n\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'StaticMethodIn']]/entry[2]/p\"/>\n\t\t\t\t<xsl:text>, </xsl:text>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(apiOperationDetail/apiOperationDef/apiStatic)\">\n\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Method']]/entry[2]/p\"/>\n\t\t\t\t<xsl:text>, </xsl:text>\n\t\t\t</xsl:if>\n\t\t\t<xsl:text> </xsl:text>\n\t\t\t<xsl:if test=\"../apiClassifierDetail/apiClassifierDef/apiInterface\">\n\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'InterfaceIn']]/entry[2]/p\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(../apiClassifierDetail/apiClassifierDef/apiInterface)\">\n\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ClassIn']]/entry[2]/p\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:text> </xsl:text>\n\t\t\t<xsl:call-template name=\"getClassRef\">\n\t\t\t\t<xsl:with-param name=\"classPath\" select=\"$classPath\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"parent::apiPackage\">\n\t\t\t<xsl:if test=\"apiOperationDetail/apiOperationDef/apiStatic\">\n\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'PackageStaticFunctionIn']]/entry[2]/p\"/>\n\t\t\t\t<xsl:text>, </xsl:text>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(apiOperationDetail/apiOperationDef/apiStatic)\">\n\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'PackageFunctionIn']]/entry[2]/p\"/>\n\t\t\t\t<xsl:text>, </xsl:text>\n\t\t\t</xsl:if>\n\t\t\t<xsl:variable name=\"isTopLevel\">\n\t\t\t\t<xsl:call-template name=\"isTopLevel\">\n\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"ancestor::apiPackage/apiName\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:if test=\"$isTopLevel='false'\">\n\t\t\t\t<a href=\"{$classPath}/package.html\" onclick=\"loadClassListFrame('{$classPath}/class-list.html')\">\n\t\t\t\t\t<xsl:value-of select=\"ancestor::apiPackage/apiName\"/>\n\t\t\t\t</a>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"$isTopLevel!='false'\">\n\t\t\t\t<a href=\"package.html\" onclick=\"loadClassListFrame('class-list.html')\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'TopLevel']]/entry[2]/p\"/>\n\t\t\t\t</a>\n\t\t\t</xsl:if>\n\t\t</xsl:if>\n\t\t<!-- AS2 lang elements -->\n\t\t<xsl:if test=\"../../@type='list'\">\n\t\t\t<xsl:if test=\"@type='directive'\">\n\t\t\t\t<xsl:text>Compiler Directive</xsl:text>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"@type!='directive'\">\n\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'GlobalFunction']]/entry[2]/p\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getConstructorDesc\">\n\t\t<xsl:param name=\"classPath\"/>\n\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Constructor']]/entry[2]/p\"/>\n\t\t<xsl:text>, </xsl:text>\n\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ClassIn']]/entry[2]/p\"/>\n\t\t<xsl:text> </xsl:text>\n\t\t<xsl:call-template name=\"getClassRef\">\n\t\t\t<xsl:with-param name=\"classPath\" select=\"$classPath\"/>\n\t\t</xsl:call-template>\n\t</xsl:template>\n\t<xsl:template name=\"getPropertyDesc\">\n\t\t<xsl:param name=\"classPath\"/>\n\t\t<!-- AS2 lang elements -->\n\t\t<xsl:if test=\"parent::apiClassifier\">\n\t\t\t<xsl:if test=\"$prog_language_name='ActionScript'\">\n\t\t\t\t<xsl:if test=\"apiValueDetail/apiValueDef/apiStatic\">\n\t\t\t\t\t<xsl:if test=\"not(apiValueDetail/apiValueDef/apiProperty)\">\n\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ConstantStaticPropertyIn']]/entry[2]/p\"/>\n\t\t\t\t\t\t<xsl:text>,</xsl:text>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"apiValueDetail/apiValueDef/apiProperty\">\n\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'StaticPropertyIn']]/entry[2]/p\"/>\n\t\t\t\t\t\t<xsl:text>,</xsl:text>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(apiValueDetail/apiValueDef/apiStatic)\">\n\t\t\t\t\t<xsl:if test=\"not(apiValueDetail/apiValueDef/apiProperty)\">\n\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ConstantPropertyIn']]/entry[2]/p\"/>\n\t\t\t\t\t\t<xsl:text>,</xsl:text>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"apiValueDetail/apiValueDef/apiProperty\">\n\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'PropertyIn']]/entry[2]/p\"/>\n\t\t\t\t\t\t<xsl:text>,</xsl:text>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:if>\n\t\t\t<xsl:text> </xsl:text>\n\t\t\t<xsl:if test=\"../apiClassifierDetail/apiClassifierDef/apiInterface\">\n\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'InterfaceIn']]/entry[2]/p\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(../apiClassifierDetail/apiClassifierDef/apiInterface)\">\n\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ClassIn']]/entry[2]/p\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:text> </xsl:text>\n\t\t\t<xsl:call-template name=\"getClassRef\">\n\t\t\t\t<xsl:with-param name=\"classPath\" select=\"$classPath\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"parent::apiPackage\">\n\t\t\t<xsl:if test=\"apiValueDetail/apiValueDef/apiStatic\">\n\t\t\t\t<xsl:if test=\"not(apiValueDetail/apiValueDef/apiProperty)\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'PackageConstantStaticPropertyIn']]/entry[2]/p\"/>\n\t\t\t\t\t<xsl:text>, </xsl:text>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"apiValueDetail/apiValueDef/apiProperty\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'PackageStaticPropertyIn']]/entry[2]/p\"/>\n\t\t\t\t\t<xsl:text>, </xsl:text>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(apiValueDetail/apiValueDef/apiStatic)\">\n\t\t\t\t<xsl:if test=\"not(apiValueDetail/apiValueDef/apiProperty)\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'PackageConstantPropertyIn']]/entry[2]/p\"/>\n\t\t\t\t\t<xsl:text>, </xsl:text>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"apiValueDetail/apiValueDef/apiProperty\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Package']]/entry[2]/p\"/>\n\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Property']]/entry[2]/p\"/>\n\t\t\t\t\t<xsl:text>, </xsl:text>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:if>\n\t\t\t<xsl:variable name=\"isTopLevel\">\n\t\t\t\t<xsl:call-template name=\"isTopLevel\">\n\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"ancestor::apiPackage/apiName\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:if test=\"$isTopLevel='false'\">\n\t\t\t\t<a href=\"{$classPath}/package.html\" onclick=\"loadClassListFrame('{$classPath}/class-list.html')\">\n\t\t\t\t\t<xsl:value-of select=\"ancestor::apiPackage/apiName\"/>\n\t\t\t\t</a>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"$isTopLevel!='false'\">\n\t\t\t\t<a href=\"package.html\" onclick=\"loadClassListFrame('class-list.html')\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'TopLevel']]/entry[2]/p\"/>\n\t\t\t\t</a>\n\t\t\t</xsl:if>\n\t\t</xsl:if>\n\t\t<!-- AS2 lang elements -->\n\t\t<xsl:if test=\"../../@type='list'\">\n\t\t\t<xsl:if test=\"../../@name='Constants'\">\n\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ConstantProperty']]/entry[2]/p\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"../../@name!='Constants'\">\n\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'GlobalProperty']]/entry[2]/p\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getEventDesc\">\n\t\t<xsl:param name=\"classPath\"/>\n\t\t<!-- AS2 lang elements -->\n\t\t<xsl:if test=\"parent::apiClassifier\">\n\t\t\t<xsl:variable name=\"typeName\">\n\t\t\t\t<xsl:if test=\"../apiClassifierDetail/apiClassifierDef/apiInterface\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'InterfaceIn']]/entry[2]/p\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(../apiClassifierDetail/apiClassifierDef/apiInterface)\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ClassIn']]/entry[2]/p\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:choose>\n\t\t\t\t<xsl:when test=\"@type = 'handler'\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'EventHandlerIn']]/entry[2]/p\"/>\n\t\t\t\t\t<xsl:text>,</xsl:text>\n\t\t\t\t</xsl:when>\n\t\t\t\t<xsl:when test=\"@type != 'handler'\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'EventListenerIn']]/entry[2]/p\"/>\n\t\t\t\t\t<xsl:text>,</xsl:text>\n\t\t\t\t</xsl:when>\n\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'EventIn']]/entry[2]/p\"/>\n\t\t\t\t\t<xsl:text>,</xsl:text>\n\t\t\t\t</xsl:otherwise>\n\t\t\t</xsl:choose>\n\t\t\t<xsl:text> </xsl:text>\n\t\t\t<xsl:value-of select=\"$typeName\"/>\n\t\t\t<xsl:text> </xsl:text>\n\t\t\t<xsl:call-template name=\"getClassRef\">\n\t\t\t\t<xsl:with-param name=\"classPath\" select=\"$classPath\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"not(../../@type) or ../../@type='list'\">\n\t\t\t<xsl:if test=\"@type = 'handler'\">\n\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'GlobalEventHandler']]/entry[2]/p\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"@type != 'handler'\">\n\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'GlobalEventListener']]/entry[2]/p\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getPackageComment\">\n\t\t<xsl:param name=\"packageName\"/>\n\t\t<xsl:if test=\"not($config/overviews/package)\">\n\t\t\t<xsl:variable name=\"packageComments\" select=\"document($packageOverviewFile)/overviews/packages/package[@name=$packageName]\"/>\n\t\t\t<xsl:for-each select=\"$packageComments/shortDescription\">\n\t\t\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t\t\t<xsl:with-param name=\"inText\" select=\".\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:for-each>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"$config/overviews/package\">\n\t\t\t<xsl:for-each select=\"$config/overviews/package\">\n\t\t\t\t<xsl:variable name=\"packageOverview\" select=\"document(.)/overviews/packages/package[@name=$packageName]\"/>\n\t\t\t\t<xsl:for-each select=\"$packageOverview/shortDescription\">\n\t\t\t\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t\t\t\t<xsl:with-param name=\"inText\" select=\".\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:for-each>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getClassDesc\">\n\t\t<xsl:param name=\"packageName\"/>\n\t\t<xsl:if test=\"string-length($packageName)=0\">\n\t\t\t<xsl:if test=\"apiClassifierDetail/apiClassifierDef/apiFinal\">\n\t\t\t\t<xsl:if test=\"apiClassifierDetail/apiClassifierDef/apiDynamic\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'FinalDynamicClass']]/entry[2]/p\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(apiClassifierDetail/apiClassifierDef/apiDynamic)\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'FinalClass']]/entry[2]/p\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(apiClassifierDetail/apiClassifierDef/apiFinal)\">\n\t\t\t\t<xsl:if test=\"apiClassifierDetail/apiClassifierDef/apiDynamic\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'DynamicClassIn']]/entry[2]/p\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(apiClassifierDetail/apiClassifierDef/apiDynamic)\">\n\t\t\t\t\t<xsl:if test=\"apiClassifierDetail/apiClassifierDef/apiInterface\">\n\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Interface']]/entry[2]/p\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"not(apiClassifierDetail/apiClassifierDef/apiInterface)\">\n\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ClassIn']]/entry[2]/p\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:if>\n\t\t\t<xsl:text>, </xsl:text>\n\t\t\t<a href=\"package-detail.html\" onclick=\"javascript:loadClassListFrame('class-list.html');\">\n\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'TopLevel']]/entry[2]/p\"/>\n\t\t\t</a>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"string-length($packageName)\">\n\t\t\t<xsl:if test=\"apiClassifierDetail/apiClassifierDef/apiFinal\">\n\t\t\t\t<xsl:if test=\"apiClassifierDetail/apiClassifierDef/apiDynamic\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'FinalDynamicClass']]/entry[2]/p\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(apiClassifierDetail/apiClassifierDef/apiDynamic)\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'FinalClass']]/entry[2]/p\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(apiClassifierDetail/apiClassifierDef/apiFinal)\">\n\t\t\t\t<xsl:if test=\"apiClassifierDetail/apiClassifierDef/apiDynamic\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'DynamicClassIn']]/entry[2]/p\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(apiClassifierDetail/apiClassifierDef/apiDynamic)\">\n\t\t\t\t\t<xsl:if test=\"apiClassifierDetail/apiClassifierDef/apiInterface\">\n\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Interface']]/entry[2]/p\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"not(apiClassifierDetail/apiClassifierDef/apiInterface)\">\n\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ClassIn']]/entry[2]/p\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:if>\n\t\t\t<xsl:text>, </xsl:text>\n\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Package']]/entry[2]/p\"/>\n\t\t\t<xsl:text> </xsl:text>\n\t\t\t<xsl:variable name=\"isTopLevel\">\n\t\t\t\t<xsl:call-template name=\"isTopLevel\">\n\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$packageName\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:if test=\"$isTopLevel='false'\">\n\t\t\t\t<a href=\"{translate($packageName,'.','/')}/package-detail.html\" onclick=\"javascript:loadClassListFrame('{translate($packageName,'.','/')}/class-list.html');\">\n\t\t\t\t\t<xsl:value-of select=\"$packageName\"/>\n\t\t\t\t</a>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"$isTopLevel!='false'\">\n\t\t\t\t<a href=\"package.html\" onclick=\"loadClassListFrame('class-list.html')\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'TopLevel']]/entry[2]/p\"/>\n\t\t\t\t</a>\n\t\t\t</xsl:if>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getParamList\">\n\t\t<xsl:param name=\"params\"/>\n\t\t<xsl:for-each select=\"$params\">\n\t\t\t<xsl:if test=\"position()>1\">\n\t\t\t\t<xsl:text>, </xsl:text>\n\t\t\t</xsl:if>\n\t\t\t<xsl:variable name=\"typeName\">\n\t\t\t\t<xsl:if test=\"./apiType and not(./apiOperationClassifier)\">\n\t\t\t\t\t<xsl:value-of select=\"./apiType/@value\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"./apiOperationClassifier and not(./apiType)\">\n\t\t\t\t\t<xsl:value-of select=\"./apiOperationClassifier\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:if test=\"$prog_language_name = 'ActionScript'\">\n\t\t\t\t<xsl:if test=\"$config/options/@docversion='2' and @optional='true'\">\n\t\t\t\t\t<xsl:text>[</xsl:text>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"($typeName!= 'restParam')\">\n\t\t\t\t\t<xsl:value-of select=\"./apiItemName\"/>\n\t\t\t\t\t<xsl:if test=\"($typeName!= '')\">\n\t\t\t\t\t\t<xsl:text>:</xsl:text>\n\t\t\t\t\t\t<xsl:call-template name=\"processParamType\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"typeName\" select=\"$typeName\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"($typeName = 'restParam')\">\n\t\t\t\t\t<xsl:text>... rest</xsl:text>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$config/options/@docversion='2' and @optional='true'\">\n\t\t\t\t\t<xsl:text>]</xsl:text>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:if>\n\t\t</xsl:for-each>\n\t</xsl:template>\n\t<xsl:template name=\"processParamType\">\n\t\t<xsl:param name=\"typeName\"/>\n\t\t<xsl:if test=\"($typeName='list')\">\n\t\t\t<a href=\"{$typeName}.html\">\n\t\t\t\t<xsl:value-of select=\"$typeName\"/>\n\t\t\t</a>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"$typeName !='list'\">\n\t\t\t<xsl:variable name=\"doesTypeExist\">\n\t\t\t\t<xsl:call-template name=\"doesClassExist\">\n\t\t\t\t\t<xsl:with-param name=\"class_name\" select=\"translate($typeName, '[]', '')\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:choose>\n\t\t\t\t<xsl:when test=\"$doesTypeExist = '1'\">\n\t\t\t\t\t<xsl:variable name=\"href\">\n\t\t\t\t\t\t<xsl:call-template name=\"convertFullName\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"fullname\" select=\"$typeName\"/>\n\t\t\t\t\t\t\t<xsl:with-param name=\"separator\">/</xsl:with-param>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t<xsl:if test=\"string-length($href)\">\n\t\t\t\t\t\t<a href=\"{$href}.html\">\n\t\t\t\t\t\t\t<xsl:attribute name=\"onclick\">\n\t\t\t\t\t\t\t\t<xsl:text>javascript:loadClassListFrame('</xsl:text>\n\t\t\t\t\t\t\t\t<xsl:call-template name=\"substring-before-last\">\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"input\" select=\"$href\"/>\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"substr\" select=\"'/'\"/>\n\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t<xsl:text>./class-list.html');</xsl:text>\n\t\t\t\t\t\t\t</xsl:attribute>\n\t\t\t\t\t\t\t<xsl:value-of select=\"$typeName\"/>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:when>\n\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t<xsl:value-of select=\"$typeName\"/>\n\t\t\t\t</xsl:otherwise>\n\t\t\t</xsl:choose>\n\t\t</xsl:if>\n\t</xsl:template>\n</xsl:stylesheet>\n"
  },
  {
    "path": "documentation/api-reference/templates/asdoc-util.xslt",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n\n\tADOBE SYSTEMS INCORPORATED\n\tCopyright 2008 Adobe Systems Incorporated\n\tAll Rights Reserved.\n\n\tNOTICE: Adobe permits you to use, modify, and distribute this file\n\tin accordance with the terms of the license agreement accompanying it.\n\n-->\n<xsl:stylesheet version=\"2.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:saxon=\"http://sf.net/saxon\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:ifn=\"urn:internal:functions\"\n\texclude-result-prefixes=\"saxon xs ifn\">\n\t<xsl:character-map name=\"disable\">\n\t\t<xsl:output-character character=\"&amp;\" string=\"&amp;\"/>\n\t\t<xsl:output-character character=\"&lt;\" string=\"&lt;\"/>\n\t\t<xsl:output-character character=\"&gt;\" string=\"&gt;\"/>\n\t\t<xsl:output-character character=\"&#145;\" string=\"&amp;lsquo;\"/>\n\t\t<xsl:output-character character=\"&#146;\" string=\"&amp;apos;\"/>\n\t\t<xsl:output-character character=\"&#151;\" string=\"&amp;mdash;\"/>\n\t\t<xsl:output-character character=\"&#x2014;\" string=\"&amp;mdash;\"/>\n\t\t<xsl:output-character character=\"&#x2009;\" string=\"&amp;thinsp;\"/>\n\t\t<xsl:output-character character=\"&#xAE;\" string=\"&amp;reg;\"/>\n\t\t<xsl:output-character character=\"&#xB0;\" string=\"&amp;deg;\"/>\n\t\t<xsl:output-character character=\"&#x2122;\" string=\"&amp;trade;\"/>\n\t</xsl:character-map>\n\t<xsl:output method=\"html\" encoding=\"UTF-8\" indent=\"no\" omit-xml-declaration=\"yes\" use-character-maps=\"disable\"/>\n\t<xsl:key name=\"match\" match=\"//apiPackage\" use=\"@id\"/>\n\t<xsl:variable name=\"newline\">\n\t\t<xsl:text/>\n\t</xsl:variable>\n\t<xsl:variable name=\"productName\" select=\"$config//product\"/>\n\t<xsl:variable name=\"markOfTheWeb\" select=\"'&lt;!-- saved from url=(0014)about:internet -->'\"/>\n\t<xsl:variable name=\"docType\">\n\t\t<!-- insert byte order mark needed for Flash Panel Help -->\n\t\t<xsl:if test=\"$config/options[@livedocs!='true']\">\n\t\t\t<xsl:text disable-output-escaping=\"yes\"></xsl:text>\n\t\t</xsl:if>\n\t\t<xsl:text disable-output-escaping=\"yes\">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;</xsl:text>\n\t\t<xsl:value-of select=\"$newline\"/>\n\t\t<xsl:if test=\"$config/options[@standalone='true']\">\n\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"$markOfTheWeb\"/>\n\t\t\t<xsl:value-of select=\"$newline\"/>\n\t\t</xsl:if>\n\t</xsl:variable>\n\t<xsl:variable name=\"frameDocType\">\n\t\t<xsl:text disable-output-escaping=\"yes\">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Frameset//EN&quot; &quot;http://www.w3.org/TR/html4/frameset.dtd&quot;&gt;</xsl:text>\n\t\t<xsl:value-of select=\"$newline\"/>\n\t</xsl:variable>\n\t<xsl:function name=\"ifn:myFormatDate\">\n\t\t<xsl:variable name=\"lookup\" as=\"node()+\">\n\t\t\t<term value=\"Jan\">January</term>\n\t\t\t<term value=\"Feb\">February</term>\n\t\t\t<term value=\"Mar\">March</term>\n\t\t\t<term value=\"Apr\">April</term>\n\t\t\t<term value=\"May\">May</term>\n\t\t\t<term value=\"Jun\">June</term>\n\t\t\t<term value=\"Jul\">July</term>\n\t\t\t<term value=\"Aug\">August</term>\n\t\t\t<term value=\"Sep\">September</term>\n\t\t\t<term value=\"Oct\">October</term>\n\t\t\t<term value=\"Nov\">November</term>\n\t\t\t<term value=\"Dec\">December</term>\n\t\t\t<term value=\"Mon\">Monday</term>\n\t\t\t<term value=\"Tue\">Tuesday</term>\n\t\t\t<term value=\"Wed\">Wednesday</term>\n\t\t\t<term value=\"Thu\">Thursday</term>\n\t\t\t<term value=\"Fri\">Friday</term>\n\t\t\t<term value=\"Sat\">Saturday</term>\n\t\t\t<term value=\"Sun\">Sunday</term>\n\t\t\t<term value=\"AM\">A.M.</term>\n\t\t\t<term value=\"PM\">P.M.</term>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"date\" select=\"format-dateTime(current-dateTime(),  '[F] [MNn] [D] [Y], [h01]:[m01] [PN] [ZN] ' )\"/>\n\t\t<xsl:value-of select=\"for $i in tokenize($date, ' ') return ($lookup[. = $i]/@value, $i)[1]\"/>\n\t</xsl:function>\n\t<xsl:param name=\"locale\" select=\"'en-us'\"/>\n\t<xsl:param name=\"asdocTermsFilename\" select=\"'ASDoc_terms.xml'\"/>\n\t<xsl:variable name=\"asdoc_terms\" select=\"document($asdocTermsFilename)//tbody\"/>\n\t<xsl:param name=\"configFilename\" select=\"'ASDoc_Config.xml'\"/>\n\t<xsl:variable name=\"config\" select=\"document($configFilename)/asDocConfig\"/>\n\t<xsl:param name=\"ditaFileDir\" select=\"''\"/>\n\t<xsl:param name=\"packageCommentsFilename\" select=\"'packages.xml'\"/>\n\t<xsl:param name=\"AS1tooltip\" select=\"'This example can be used with ActionScript 1.0'\"/>\n\t<xsl:param name=\"AS2tooltip\" select=\"$asdoc_terms/row[entry[1][p/text() = 'AS2tooltip']]/entry[2]/p\"/>\n\t<xsl:param name=\"AS3tooltip\" select=\"$asdoc_terms/row[entry[1][p/text() = 'AS3tooltip']]/entry[2]/p\"/>\n\t<xsl:param name=\"showASIcons\" select=\"'false'\"/>\n\t<xsl:param name=\"showInheritanceIcon\" select=\"'true'\"/>\n\t<xsl:param name=\"inheritanceIcon\" select=\"'inherit-arrow.jpg'\"/>\n\t<xsl:param name=\"isEclipse\" select=\"$config/options[@eclipse='true']\"/>\n\t<xsl:param name=\"isLiveDocs\" select=\"$config/options[@livedocs='true']\"/>\n\t<xsl:param name=\"liveDocsSearchSite\" select=\"$config/livedocs/searchsite/.\"/>\n\t<xsl:param name=\"liveDocsSearchString\" select=\"$config/livedocs/searchstring/.\"/>\n\t<xsl:param name=\"liveDocsSearchLocale\" select=\"$config/livedocs/locale/.\"/>\n\t<xsl:param name=\"liveDocsSearch\" select=\"$asdoc_terms/row[entry[1][p/text() = 'searchLivedocs']]/entry[2]/p\"/>\n\t<xsl:param name=\"liveDocsSearchServlet\" select=\"$config/livedocs/searchservlet/.\"/>\n\t<xsl:param name=\"isStandalone\" select=\"$config/options[@standalone='true']\"/>\n\t<xsl:param name=\"isSkin\" select=\"$config/skinLink/.\"/>\t\n\t<xsl:param name=\"prog_language_name\" select=\"'ActionScript'\"/>\n\t<xsl:variable name=\"id.match\" select=\"document('flashclasses.xml')//package//class\"/>\n\t<xsl:variable name=\"id.match.name\" select=\"document('flashclasses.xml')//package\"/>\n\t<xsl:variable name=\"id.match.class\" select=\"document('flashclasses.xml')//category//class\"/>\n\t<xsl:variable name=\"class.File.Name\" select=\"document('ClassHeader.xml')//apiClassifier\"/>\n\t<xsl:param name=\"process_xref_href_attribute\" select=\"'0'\"/>\n\t<xsl:param name=\"showLangVersionWarnings\">\n\t\t<xsl:if test=\"$config/warnings/@langversion='true'\">\n\t\t\t<xsl:value-of select=\"'true'\"/>\n\t\t</xsl:if>\n\t</xsl:param>\n\t<xsl:param name=\"showPlayerVersionWarnings\">\n\t\t<xsl:if test=\"$config/warnings/@playerversion='true'\">\n\t\t\t<xsl:value-of select=\"'true'\"/>\n\t\t</xsl:if>\n\t</xsl:param>\n\t<xsl:param name=\"noLiveDocs\">\n\t\t<xsl:if test=\"$config/options[@livedocs='true']\">\n\t\t\t<xsl:comment>livedocs:no</xsl:comment>\n\t\t\t<xsl:value-of select=\"$newline\"/>\n\t\t</xsl:if>\n\t</xsl:param>\n\t<xsl:param name=\"showXrefs\" select=\"$config/xrefs[@show='true']\"/>\n\t<xsl:variable name=\"xrefs\">\n\t\t<xsl:if test=\"$showXrefs\">\n\t\t\t<xsl:copy-of select=\"document($config/xrefs/@mapfile)/helpreferences\"/>\n\t\t</xsl:if>\n\t</xsl:variable>\n\t<xsl:param name=\"title-base\" select=\"$config/windowTitle/.\"/>\n\t<xsl:param name=\"title-jslr\" select=\"$asdoc_terms/row[entry[1][p/text() = 'JSLR_Book_Title']]/entry[2]/p\"/>\n\t<xsl:param name=\"page-title-base\" select=\"$config/title/.\"/>\n\t<xsl:param name=\"timestamp\">\n\t\t<xsl:value-of select=\"ifn:myFormatDate()\"/>\n\t</xsl:param>\n\t<xsl:param name=\"copyright\">\n\t\t<xsl:copy-of select=\"$config/footer\"/>\n\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t<xsl:if test=\"$config/dateInFooter='true'\">\n\t\t\t<xsl:value-of select=\"$timestamp\"/>\n\t\t</xsl:if>\n\t\t<xsl:text> </xsl:text>\n\t</xsl:param>\n\t<xsl:variable name=\"copyrightComment\">\n\t\t<xsl:comment>\n\t\t\t<xsl:copy-of select=\"$copyright\"/>\n\t\t</xsl:comment>\n\t</xsl:variable>\n\t<xsl:variable name=\"upperCase\">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable>\n\t<xsl:variable name=\"lowerCase\">abcdefghijklmnopqrstuvwxyz</xsl:variable>\n\t<xsl:variable name=\"thinsp\">\n\t\t<xsl:text>&#x2009;</xsl:text>\n\t</xsl:variable>\n\t<xsl:variable name=\"emdash\">\n\t\t<xsl:text> &#x2014; </xsl:text>\n\t</xsl:variable>\n\t<xsl:variable name=\"asterisk\">\n\t\t<xsl:text>&#x2A;</xsl:text>\n\t</xsl:variable>\n\t<xsl:variable name=\"nbsp\">\n\t\t<xsl:text>&#xA0;</xsl:text>\n\t</xsl:variable>\n\t<xsl:variable name=\"degree\">\n\t\t<xsl:text>&#xB0;</xsl:text>\n\t</xsl:variable>\n\t<xsl:variable name=\"trademark\">\n\t\t<xsl:text>&#x2122;</xsl:text>\n\t</xsl:variable>\n\t<xsl:variable name=\"registered\">\n\t\t<xsl:text>&#xAE;</xsl:text>\n\t</xsl:variable>\n\t<xsl:template name=\"getRelativePath\">\n\t\t<xsl:param name=\"currentPath\"/>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"not($currentPath) or $currentPath='__Global__'\">\n\t\t\t\t<xsl:value-of select=\"''\"/>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:if test=\"contains($currentPath,'.')\">\n\t\t\t\t\t<xsl:call-template name=\"getRelativePath\">\n\t\t\t\t\t\t<xsl:with-param name=\"currentPath\" select=\"substring-after($currentPath,'.')\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:value-of select=\"'../'\"/>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template name=\"getBaseRef\">\n\t\t<xsl:param name=\"packageName\"/>\n\t\t<xsl:variable name=\"isTopLevel\">\n\t\t\t<xsl:call-template name=\"isTopLevel\">\n\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$packageName\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:if test=\"$isTopLevel='false'\">\n\t\t\t<xsl:variable name=\"newName\" select=\"substring-after($packageName,'.')\"/>\n\t\t\t<xsl:if test=\"$packageName\">\n\t\t\t\t<xsl:text>../</xsl:text>\n\t\t\t\t<xsl:call-template name=\"getBaseRef\">\n\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$newName\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:if>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"convertNumberListIntoBoolean\">\n\t\t<xsl:param name=\"numberList\"/>\n\t\t<xsl:choose>\n\t\t\t<xsl:when\n\t\t\t\ttest=\"contains($numberList,'1') or contains($numberList,'2') or contains($numberList,'3') or contains($numberList,'4') or contains($numberList,'5') or contains($numberList,'6') or contains($numberList,'7') or contains($numberList,'8') or contains($numberList,'9')\">\n\t\t\t\t<xsl:value-of select=\"'true'\"/>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:value-of select=\"'false'\"/>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template name=\"getStyleLink\">\n\t\t<xsl:param name=\"link\"/>\n\t\t<xsl:param name=\"packageName\"/>\n\t\t<xsl:choose>\n\t\t\t<!-- TODO support this? -->\n\t\t\t<xsl:when test=\"false()\">\n\t\t\t\t<xsl:for-each select=\"$link\">\n\t\t\t\t\t<xsl:copy-of select=\".\"/>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:variable name=\"baseRef\">\n\t\t\t\t\t<xsl:call-template name=\"getBaseRef\">\n\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$packageName\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<xsl:element name=\"link\">\n\t\t\t\t\t<xsl:attribute name=\"rel\">stylesheet</xsl:attribute>\n\t\t\t\t\t<xsl:attribute name=\"href\"><xsl:value-of select=\"$baseRef\"/>style.css</xsl:attribute>\n\t\t\t\t\t<xsl:attribute name=\"type\">text/css</xsl:attribute>\n\t\t\t\t\t<xsl:attribute name=\"media\">screen</xsl:attribute>\n\t\t\t\t</xsl:element>\n\t\t\t\t<xsl:element name=\"link\">\n\t\t\t\t\t<xsl:attribute name=\"rel\">stylesheet</xsl:attribute>\n\t\t\t\t\t<xsl:attribute name=\"href\"><xsl:value-of select=\"$baseRef\"/>print.css</xsl:attribute>\n\t\t\t\t\t<xsl:attribute name=\"type\">text/css</xsl:attribute>\n\t\t\t\t\t<xsl:attribute name=\"media\">print</xsl:attribute>\n\t\t\t\t</xsl:element>\n\t\t\t\t<xsl:element name=\"link\">\n\t\t\t\t\t<xsl:attribute name=\"rel\">stylesheet</xsl:attribute>\n\t\t\t\t\t<xsl:attribute name=\"href\"><xsl:value-of select=\"$baseRef\"/>override.css</xsl:attribute>\n\t\t\t\t\t<xsl:attribute name=\"type\">text/css</xsl:attribute>\n\t\t\t\t</xsl:element>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template name=\"getTitleScript\">\n\t\t<xsl:param name=\"packageName\"/>\n\t\t<xsl:param name=\"title\" select=\"$title-base\"/>\n\t\t<xsl:variable name=\"baseRef\">\n\t\t\t<xsl:call-template name=\"getBaseRef\">\n\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$packageName\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t<xsl:attribute name=\"src\">\n\t\t\t\t<xsl:value-of select=\"$baseRef\"/>\n\t\t\t\t<xsl:text>asdoc.js</xsl:text>\n\t\t\t</xsl:attribute>\n\t\t</script>\n\t\t<xsl:if test=\"$isEclipse\">\n\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\t<xsl:comment> eclipseBuild = true;</xsl:comment>\n\t\t\t</script>\n\t\t</xsl:if>\n\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t<xsl:attribute name=\"src\">\n\t\t\t\t<xsl:value-of select=\"$baseRef\"/>\n\t\t\t\t<xsl:text>help.js</xsl:text>\n\t\t\t</xsl:attribute>\n\t\t</script>\n\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t<xsl:attribute name=\"src\">\n\t\t\t\t<xsl:value-of select=\"$baseRef\"/>\n\t\t\t\t<xsl:text>cookies.js</xsl:text>\n\t\t\t</xsl:attribute>\n\t\t</script>\n\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t<xsl:comment>\n\t\t\t\tasdocTitle = '<xsl:value-of select=\"$title\"/>';\n\t\t\t\tvar baseRef = '<xsl:value-of select=\"$baseRef\"/>';\n\t\t\t\twindow.onload = configPage;\n\t\t\t</xsl:comment>\n\t\t</script>\n\t\t<xsl:text>&#xa;</xsl:text>\n\t\t<xsl:if test=\"$config/options[@standalonesearch='true']\">\n\t\t\t<xsl:call-template name=\"search.function.submit\">\n\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:if>\n\t\t<script type=\"text/javascript\">\n\t\t\tscrollToNameAnchor();\n\t\t</script>\n\t</xsl:template>\n\t<xsl:template name=\"search.function.submit\">\n\t\t<xsl:param name=\"baseRef\"/>\n\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t<xsl:comment>\n\t\t\t\t<xsl:text>&#xa;</xsl:text>\n\t\t\t\t<xsl:text>function submitValue(){</xsl:text>\n\t\t\t\t<xsl:text>&#xa;</xsl:text>\n\t\t\t\t<xsl:text>var searchStr=document.getElementById('search-livedocs').value;</xsl:text>\n\t\t\t\t<xsl:text>&#xa;</xsl:text>\n\t\t\t\t<xsl:text>window.location=\"</xsl:text><xsl:value-of select=\"$baseRef\"/><xsl:text>search.html\"+\"###\"+searchStr;</xsl:text>\n\t\t\t\t<xsl:text>&#xa;</xsl:text>\n\t\t\t\t<xsl:text>}</xsl:text>\n\t\t\t\t<xsl:text>&#xa;</xsl:text>\n\t\t\t</xsl:comment>\n\t\t</script>\n\t</xsl:template>\n\t<xsl:template name=\"getLinks\">\n\t\t<xsl:param name=\"packageName\" select=\"''\"/>\n\t\t<xsl:param name=\"fileName\"/>\n\t\t<xsl:param name=\"fileName2\" select=\"'all-classes.html'\"/>\n\t\t<xsl:param name=\"showInnerClasses\" select=\"false()\"/>\n\t\t<xsl:param name=\"showConstants\" select=\"false()\"/>\n\t\t<xsl:param name=\"showProperties\" select=\"true()\"/>\n\t\t<xsl:param name=\"showConstructors\" select=\"false()\"/>\n\t\t<xsl:param name=\"showMethods\" select=\"true()\"/>\n\t\t<xsl:param name=\"showStyles\" select=\"false()\"/>\n\t\t<xsl:param name=\"showSkinState\" select=\"false()\"/>\n\t\t<xsl:param name=\"showSkinPart\" select=\"false()\"/>\t\t\n\t\t<xsl:param name=\"showEffects\" select=\"false()\"/>\n\t\t<xsl:param name=\"showEvents\" select=\"false()\"/>\n\t\t<xsl:param name=\"showIncludeExamples\" select=\"false()\"/>\n\t\t<xsl:param name=\"showPackages\" select=\"true()\"/>\n\t\t<xsl:param name=\"showAllClasses\" select=\"true()\"/>\n\t\t<xsl:param name=\"showLanguageElements\" select=\"boolean($config/languageElements[@show='true'])\"/>\n\t\t<xsl:param name=\"showIndex\" select=\"true()\"/>\n\t\t<xsl:param name=\"showAppendixes\" select=\"true()\"/>\n\t\t<xsl:param name=\"showPackageConstants\" select=\"false()\"/>\n\t\t<xsl:param name=\"showPackageProperties\" select=\"false()\"/>\n\t\t<xsl:param name=\"showPackageFunctions\" select=\"false()\"/>\n\t\t<xsl:param name=\"showInterfaces\" select=\"false()\"/>\n\t\t<xsl:param name=\"showClasses\" select=\"false()\"/>\n\t\t<xsl:param name=\"showPackageUse\" select=\"false()\"/>\n\t\t<xsl:param name=\"copyNum\" select=\"'1'\"/>\n\t\t<xsl:param name=\"additionalLinks\"/>\n\t\t<xsl:param name=\"splitIndex\" select=\"$config/options[@splitIndex='true']\"/>\n\t\t<xsl:param name=\"showMXMLOnly\" select=\"boolean($config/options[@showMXMLOnly='true'])\"/>\n\t\t<xsl:param name=\"showConventions\" select=\"boolean($config/options[@showConventions!='false'])\"/>\n\t\t<xsl:variable name=\"baseRef\">\n\t\t\t<xsl:call-template name=\"getBaseRef\">\n\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$packageName\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"href\">\n\t\t\t<xsl:variable name=\"isTopLevel\">\n\t\t\t\t<xsl:call-template name=\"isTopLevel\">\n\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$packageName\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:if test=\"$isTopLevel='false'\">\n\t\t\t\t<xsl:value-of select=\"translate($packageName,'.','/')\"/>\n\t\t\t\t<xsl:text>/</xsl:text>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:if test=\"$copyNum='1'\">\n\t\t\t<div class=\"pageTop\"/>\n\t\t\t<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" id=\"titleTable\" style=\"display:none\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td valign=\"left\" width=\"64\" style=\"padding-left:5px\">\n\t\t\t\t\t\t<img src=\"{$baseRef}images/mm-icon.jpg\" border=\"0\">\n\t\t\t\t\t\t\t<xsl:attribute name=\"alt\">\n\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\">AdobeLogo</xsl:with-param>\n\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t</xsl:attribute>\n\t\t\t\t\t\t\t<xsl:attribute name=\"title\">\n\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\">AdobeLogo</xsl:with-param>\n\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t</xsl:attribute>\n\t\t\t\t\t\t</img>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td align=\"center\" valign=\"middle\">\n\t\t\t\t\t\t<xsl:variable name=\"fontSize\">\n\t\t\t\t\t\t\t<xsl:if test=\"string-length($config/title/@size)\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$config/title/@size\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"not(string-length($config/title/@size))\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"24\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t<h1 style=\"font-size:{$fontSize}px\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$title-base\"/>\n\t\t\t\t\t\t</h1>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=\"2\" height=\"5px\"/>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"not($copyNum='1')\">\n\t\t\t<xsl:call-template name=\"getNavLinks\">\n\t\t\t\t<xsl:with-param name=\"copyNum\" select=\"$copyNum\"/>\n\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t<xsl:with-param name=\"showPackages\" select=\"$showPackages\"/>\n\t\t\t\t<xsl:with-param name=\"showAllClasses\" select=\"$showAllClasses\"/>\n\t\t\t\t<xsl:with-param name=\"showLanguageElements\" select=\"$showLanguageElements\"/>\n\t\t\t\t<xsl:with-param name=\"showMXMLOnly\" select=\"$showMXMLOnly\"/>\n\t\t\t\t<xsl:with-param name=\"showIndex\" select=\"$showIndex\"/>\n\t\t\t\t<xsl:with-param name=\"splitIndex\" select=\"$splitIndex\"/>\n\t\t\t\t<xsl:with-param name=\"showAppendixes\" select=\"$showAppendixes\"/>\n\t\t\t\t<xsl:with-param name=\"showConventions\" select=\"$showConventions\"/>\n\t\t\t\t<xsl:with-param name=\"href\" select=\"$href\"/>\n\t\t\t\t<xsl:with-param name=\"fileName\" select=\"$fileName\"/>\n\t\t\t\t<xsl:with-param name=\"fileName2\" select=\"$fileName2\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:if>\n\t\t<div width=\"100%\" class=\"topLinks\" align=\"right\">\n\t\t\t<span>\n\n\t\t\t\t<xsl:if test=\"$showProperties\">\n\t\t\t\t\t<a href=\"#propertySummary\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Properties']]/entry[2]/p\"/></a>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$showPackageProperties\">\n\t\t\t\t\t<a href=\"package.html#propertySummary\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Properties']]/entry[2]/p\"/></a>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$showConstructors\">\n\t\t\t\t\t<a href=\"#constructorSummary\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Constructor']]/entry[2]/p\"/></a>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not($showMethods=false)\">\n\t\t\t\t\t<a href=\"#methodSummary\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Method']]/entry[2]/p\"/></a>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$showPackageFunctions\">\n\t\t\t\t\t<a href=\"package.html#methodSummary\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Functions']]/entry[2]/p\"/></a>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$showEvents\">\n\t\t\t\t\t<a href=\"#eventSummary\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Events']]/entry[2]/p\"/></a>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$showStyles\">\n\t\t\t\t\t<a href=\"#styleSummary\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Styles']]/entry[2]/p\"/></a>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$showSkinPart\">\n\t\t\t\t\t<a href=\"#SkinPartSummary\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'SkinParts']]/entry[2]/p\"/></a>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$showSkinState\">\n\t\t\t\t\t<a href=\"#SkinStateSummary\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'SkinStates']]/entry[2]/p\"/></a>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$showEffects\">\n\t\t\t\t\t<a href=\"#effectSummary\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Effects']]/entry[2]/p\"/></a>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$showConstants\">\n\t\t\t\t\t<a href=\"#constantSummary\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Constants']]/entry[2]/p\"/></a>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$showPackageConstants\">\n\t\t\t\t\t<a href=\"package.html#constantSummary\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Constants']]/entry[2]/p\"/></a>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$showInterfaces\">\n\t\t\t\t\t<a href=\"package-detail.html#interfaceSummary\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Interfaces']]/entry[2]/p\"/></a>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$showClasses\">\n\t\t\t\t\t<a href=\"package-detail.html#classSummary\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Classes']]/entry[2]/p\"/></a>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$showPackageUse\">\n\t\t\t\t\t<a href=\"package-use.html\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Use']]/entry[2]/p\"/></a>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$showIncludeExamples\">\n\t\t\t\t\t<a href=\"#includeExamplesSummary\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Examples']]/entry[2]/p\"/></a>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$additionalLinks\">\n\t\t\t\t\t<xsl:copy-of select=\"$additionalLinks\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</span>\n\t\t</div>\n\t\t<xsl:if test=\"not($copyNum='2')\">\n\t\t\t<xsl:call-template name=\"getNavLinks\">\n\t\t\t\t<xsl:with-param name=\"copyNum\" select=\"$copyNum\"/>\n\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t<xsl:with-param name=\"showPackages\" select=\"$showPackages\"/>\n\t\t\t\t<xsl:with-param name=\"showAllClasses\" select=\"$showAllClasses\"/>\n\t\t\t\t<xsl:with-param name=\"showLanguageElements\" select=\"$showLanguageElements\"/>\n\t\t\t\t<xsl:with-param name=\"showMXMLOnly\" select=\"$showMXMLOnly\"/>\n\t\t\t\t<xsl:with-param name=\"showIndex\" select=\"$showIndex\"/>\n\t\t\t\t<xsl:with-param name=\"splitIndex\" select=\"$splitIndex\"/>\n\t\t\t\t<xsl:with-param name=\"showAppendixes\" select=\"$showAppendixes\"/>\n\t\t\t\t<xsl:with-param name=\"showConventions\" select=\"$showConventions\"/>\n\t\t\t\t<xsl:with-param name=\"href\" select=\"$href\"/>\n\t\t\t\t<xsl:with-param name=\"fileName\" select=\"$fileName\"/>\n\t\t\t\t<xsl:with-param name=\"fileName2\" select=\"$fileName2\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getLinks2\">\n\t\t<xsl:param name=\"subTitle\" select=\"$nbsp\"/>\n\t\t<xsl:param name=\"packageName\" select=\"''\"/>\n\t\t<xsl:param name=\"fileName\"/>\n\t\t<xsl:param name=\"fileName2\" select=\"'all-classes.html'\"/>\n\t\t<xsl:param name=\"showInnerClasses\"/>\n\t\t<xsl:param name=\"showConstants\" select=\"false()\"/>\n\t\t<xsl:param name=\"showProperties\" select=\"true()\"/>\n\t\t<xsl:param name=\"showConstructors\" select=\"false()\"/>\n\t\t<xsl:param name=\"showMethods\" select=\"true()\"/>\n\t\t<xsl:param name=\"showStyles\" select=\"false()\"/>\n\t\t<xsl:param name=\"showSkinState\" select=\"false()\"/>\n\t\t<xsl:param name=\"showSkinPart\" select=\"false()\"/>\t\t\n\t\t<xsl:param name=\"showEffects\" select=\"false()\"/>\n\t\t<xsl:param name=\"showEvents\" select=\"false()\"/>\n\t\t<xsl:param name=\"showIncludeExamples\" select=\"false()\"/>\n\t\t<xsl:param name=\"showPackages\" select=\"true()\"/>\n\t\t<xsl:param name=\"showAllClasses\" select=\"true()\"/>\n\t\t<xsl:param name=\"showLanguageElements\" select=\"boolean($config/languageElements[@show='true'])\"/>\n\t\t<xsl:param name=\"showIndex\" select=\"true()\"/>\n\t\t<xsl:param name=\"showAppendixes\" select=\"boolean($config/appendixes[@show='true'])\"/>\n\t\t<xsl:param name=\"showPackageConstants\" select=\"false()\"/>\n\t\t<xsl:param name=\"showPackageProperties\" select=\"false()\"/>\n\t\t<xsl:param name=\"showPackageFunctions\" select=\"false()\"/>\n\t\t<xsl:param name=\"showInterfaces\" select=\"false()\"/>\n\t\t<xsl:param name=\"showClasses\" select=\"false()\"/>\n\t\t<xsl:param name=\"showPackageUse\" select=\"false()\"/>\n\t\t<xsl:param name=\"copyNum\" select=\"'1'\"/>\n\t\t<xsl:param name=\"additionalLinks\"/>\n\t\t<xsl:param name=\"splitIndex\" select=\"$config/options[@splitIndex='true']\"/>\n\t\t<xsl:param name=\"showConventions\" select=\"boolean($config/options[@showConventions!='false'])\"/>\n\t\t<xsl:variable name=\"baseRef\">\n\t\t\t<xsl:call-template name=\"getBaseRef\">\n\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$packageName\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"href\">\n\t\t\t<xsl:variable name=\"isTopLevel\">\n\t\t\t\t<xsl:call-template name=\"isTopLevel\">\n\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$packageName\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:if test=\"$isTopLevel='false'\">\n\t\t\t\t<xsl:value-of select=\"translate($packageName,'.','/')\"/>\n\t\t\t\t<xsl:text>/</xsl:text>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:if test=\"$copyNum='1'\">\n\t\t\t<xsl:if test=\"not($config/options[@eclipse='true'])\">\n\t\t\t\t<table class=\"titleTable\" cellpadding=\"0\" cellspacing=\"0\" id=\"titleTable\" style=\"display:none\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=\"titleTableTitle\" align=\"left\">\n\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"$page-title-base\"/>\n\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<xsl:if test=\"$config/options[@ion='true']\">\n\t\t\t\t\t\t\t<td class=\"titleTableSearch\" align=\"center\">\n\t\t\t\t\t\t\t\t<xsl:comment>#include virtual=\"/livedocs/flex/3/langref/ionsearchform.ssi\"</xsl:comment>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"$config/options[@livedocs='true']\">\n\t\t\t\t\t\t\t<td class=\"titleTableSearch\" align=\"center\">\n\t\t\t\t\t\t\t\t<form class=\"searchForm\" target=\"adbe_window\" method=\"get\" action=\"{$liveDocsSearchServlet}\"\n\t\t\t\t\t\t\t\t\tonsubmit=\"this.term.value = this.termPrefix.value + &quot;\\&quot;&quot; + this.search_text.value + &quot;\\&quot;&quot;;\">\n\t\t\t\t\t\t\t\t\t<input class=\"hidden\" name=\"loc\" value=\"{$liveDocsSearchLocale}\" type=\"hidden\"/>\n\t\t\t\t\t\t\t\t\t<input class=\"hidden\" name=\"termPrefix\" value=\"{$liveDocsSearchSite}\" type=\"hidden\"/>\n\t\t\t\t\t\t\t\t\t<input class=\"hidden\" name=\"term\" value=\"\" type=\"hidden\"/>\n\t\t\t\t\t\t\t\t\t<input class=\"hidden\" name=\"area\" value=\"\" type=\"hidden\"/>\n\t\t\t\t\t\t\t\t\t<input id=\"search-livedocs\" name=\"search_text\" value=\"\" title=\"{$liveDocsSearchString}\" type=\"text\"/>\n\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"{$liveDocsSearch}\"/>\n\t\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:variable name=\"ref.path\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$baseRef\"/>\n\t\t\t\t\t\t\t<xsl:text>search.html</xsl:text>\n\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t<xsl:if test=\"$config/options[@standalonesearch='true']\">\n\t\t\t\t\t\t\t<td class=\"titleTableSearch\" align=\"center\">\n\t\t\t\t\t\t\t\t<form class=\"searchForm\" method=\"get\" action=\"{$ref.path}\" onsubmit=\"submitValue();\">\n\t\t\t\t\t\t\t\t\t<input class=\"hidden\" name=\"loc\" value=\"{$liveDocsSearchLocale}\" type=\"hidden\"/>\n\t\t\t\t\t\t\t\t\t<input class=\"hidden\" name=\"termPrefix\" value=\"\" type=\"hidden\"/>\n\t\t\t\t\t\t\t\t\t<input class=\"hidden\" name=\"term\" value=\"\" type=\"hidden\"/>\n\t\t\t\t\t\t\t\t\t<input class=\"hidden\" name=\"area\" value=\"\" type=\"hidden\"/>\n\t\t\t\t\t\t\t\t\t<input id=\"search-livedocs\" name=\"search_text\" value=\"\" title=\"{$liveDocsSearchString}\" type=\"text\"/>\n\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t<input type=\"button\" name=\"action\" value=\"{$liveDocsSearch}\" onclick=\"submitValue()\"/>\n\t\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<td class=\"titleTableTopNav\" align=\"right\">\n\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getNavLinks2\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"copyNum\" select=\"$copyNum\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"showPackages\" select=\"$showPackages\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"showAllClasses\" select=\"$showAllClasses\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"showLanguageElements\" select=\"$showLanguageElements\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"showIndex\" select=\"$showIndex\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"splitIndex\" select=\"$splitIndex\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"showAppendixes\" select=\"$showAppendixes\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"showConventions\" select=\"$showConventions\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"href\" select=\"$href\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fileName\" select=\"$fileName\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fileName2\" select=\"$fileName2\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td class=\"titleTableLogo\" align=\"right\" rowspan=\"3\">\n\t\t\t\t\t\t\t<picture>\n\t\t\t\t\t\t\t\t<img src=\"{$baseRef}images/logo.jpg\" srcset=\"{$baseRef}images/logo@2x.jpg 2x\" class=\"logoImage\">\n\t\t\t\t\t\t\t\t\t<xsl:attribute name=\"alt\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\">AdobeLogo</xsl:with-param>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:attribute>\n\t\t\t\t\t\t\t\t\t<xsl:attribute name=\"title\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\">AdobeLogo</xsl:with-param>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:attribute>\n\t\t\t\t\t\t\t\t</img>\n\t\t\t\t\t\t\t</picture>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr class=\"titleTableRow2\">\n\t\t\t\t\t\t<td class=\"titleTableSubTitle\" id=\"subTitle\" align=\"left\">\n\t\t\t\t\t\t\t<xsl:if test=\"string-length($subTitle)\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$subTitle\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"not(string-length($subTitle))\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td class=\"titleTableSubNav\" id=\"subNav\" align=\"right\">\n\t\t\t\t\t\t\t<xsl:if test=\"$config/options[@livedocs='true']\">\n\t\t\t\t\t\t\t\t<xsl:attribute name=\"colspan\">\n\t\t\t\t\t\t\t\t\t<xsl:text>2</xsl:text>\n\t\t\t\t\t\t\t\t</xsl:attribute>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"$config/options[@ion='true']\">\n\t\t\t\t\t\t\t\t<xsl:attribute name=\"colspan\">\n\t\t\t\t\t\t\t\t\t<xsl:text>2</xsl:text>\n\t\t\t\t\t\t\t\t</xsl:attribute>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"$config/options[@standalonesearch='true']\">\n\t\t\t\t\t\t\t\t<xsl:attribute name=\"colspan\">\n\t\t\t\t\t\t\t\t\t<xsl:text>2</xsl:text>\n\t\t\t\t\t\t\t\t</xsl:attribute>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$showProperties=true()\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"#propertySummary\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Properties']]/entry[2]/p\"/></a>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$showPackageProperties\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"package.html#propertySummary\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Properties']]/entry[2]/p\"/></a>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$showConstructors=true()\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"#constructorSummary\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Constructor']]/entry[2]/p\"/></a>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not($showMethods=false())\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"#methodSummary\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Methods']]/entry[2]/p\"/></a>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$showPackageFunctions\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"package.html#methodSummary\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Functions']]/entry[2]/p\"/></a>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$showEvents=true()\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"#eventSummary\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Events']]/entry[2]/p\"/></a>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$showStyles=true()\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"#styleSummary\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Styles']]/entry[2]/p\"/></a>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$showSkinPart=true()\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"#SkinPartSummary\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'SkinParts']]/entry[2]/p\"/></a>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$showSkinState=true()\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"#SkinStateSummary\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'SkinStates']]/entry[2]/p\"/></a>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$showEffects=true()\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"#effectSummary\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Effects']]/entry[2]/p\"/></a>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$showConstants=true()\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"#constantSummary\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Constants']]/entry[2]/p\"/></a>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$showPackageConstants\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"package.html#constantSummary\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Constants']]/entry[2]/p\"/></a>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$showInterfaces\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"package-detail.html#interfaceSummary\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\">Interfaces</xsl:with-param>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$showClasses\">\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"href\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$fileName != 'deprecated'\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>package-detail.html</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>#classSummary</xsl:text>\n\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t<a href=\"{$href}\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Classes']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$showPackageUse\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"package-use.html\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Use']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$showIncludeExamples=true()\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"#includeExamplesSummary\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Examples']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$additionalLinks\">\n\t\t\t\t\t\t\t\t\t\t<xsl:copy-of select=\"$additionalLinks\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr class=\"titleTableRow3\">\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<xsl:attribute name=\"colspan\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"$config/options[@livedocs='true']\">\n\t\t\t\t\t\t\t\t\t<xsl:text>3</xsl:text>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t<xsl:when test=\"not($config/options[@livedocs='true']) and $config/options[@standalonesearch='false']\">\n\t\t\t\t\t\t\t\t\t\t<xsl:text>3</xsl:text>\n\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t<xsl:text>3</xsl:text>\n\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t</xsl:attribute>\n\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</xsl:if>\n\t\t\t<script language=\"javascript\" type=\"text/javascript\" xml:space=\"preserve\">\n\t\t\t\t<xsl:comment>\n\t\t\t\t<xsl:text/>\n\t\t\t\t\t<xsl:text>if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {</xsl:text><xsl:text>titleBar_setSubTitle(\"</xsl:text><xsl:value-of select=\"$subTitle\"/><xsl:text>\"); </xsl:text><xsl:text>titleBar_setSubNav(</xsl:text><xsl:value-of select=\"$showConstants\"/><xsl:text>,</xsl:text><xsl:value-of select=\"$showProperties\"/><xsl:text>,</xsl:text><xsl:value-of select=\"$showStyles\"/><xsl:text>,</xsl:text><xsl:value-of select=\"$showSkinPart\"/><xsl:text>,</xsl:text><xsl:value-of select=\"$showSkinState\"/><xsl:text>,</xsl:text><xsl:value-of select=\"$showEffects\"/><xsl:text>,</xsl:text><xsl:value-of select=\"$showEvents\"/><xsl:text>,</xsl:text><xsl:value-of select=\"$showConstructors\"/><xsl:text>,</xsl:text><xsl:value-of select=\"$showMethods\"/><xsl:text>,</xsl:text><xsl:value-of select=\"$showIncludeExamples\"/><xsl:text>,</xsl:text><xsl:value-of select=\"$showPackageConstants\"/>\t<xsl:text>,</xsl:text><xsl:value-of select=\"$showPackageProperties\"/><xsl:text>,</xsl:text><xsl:value-of select=\"$showPackageFunctions\"/><xsl:text>,</xsl:text><xsl:value-of select=\"$showInterfaces\"/><xsl:text>,</xsl:text><xsl:value-of select=\"$showClasses\"/><xsl:text>,</xsl:text><xsl:value-of select=\"$showPackageUse\"/><xsl:text>);</xsl:text><xsl:text>}</xsl:text>\t<xsl:text/>\n\t\t\t\t</xsl:comment>\n\t\t\t</script>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getNavLinks2\">\n\t\t<xsl:param name=\"copyNum\"/>\n\t\t<xsl:param name=\"baseRef\"/>\n\t\t<xsl:param name=\"showPackages\"/>\n\t\t<xsl:param name=\"showAllClasses\"/>\n\t\t<xsl:param name=\"showLanguageElements\"/>\n\t\t<xsl:param name=\"showIndex\"/>\n\t\t<xsl:param name=\"splitIndex\"/>\n\t\t<xsl:param name=\"showAppendixes\"/>\n\t\t<xsl:param name=\"showConventions\"/>\n\t\t<xsl:param name=\"href\"/>\n\t\t<xsl:param name=\"fileName\"/>\n\t\t<xsl:param name=\"fileName2\"/>\n\t\t<xsl:if test=\"$showPackages\">\n\t\t\t<a href=\"{$baseRef}package-summary.html\" onclick=\"loadClassListFrame('{$baseRef}all-classes.html')\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'allPackages']]/entry[2]/p\"/></a>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"$showAllClasses\">\n\t\t\t<xsl:choose>\n\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t<a href=\"{$baseRef}class-summary.html\" onclick=\"loadClassListFrame('{$baseRef}all-classes.html')\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'allClasses']]/entry[2]/p\"/></a>\n\t\t\t\t</xsl:otherwise>\n\t\t\t</xsl:choose>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"$showLanguageElements\">\n\t\t\t<xsl:choose>\n\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t<a href=\"{$baseRef}language-elements.html\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'LanguageElements']]/entry[2]/p\"/></a>\n\t\t\t\t</xsl:otherwise>\n\t\t\t</xsl:choose>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"$showIndex\">\n\t\t\t<xsl:if test=\"$splitIndex='false'\">\n\t\t\t\t<a href=\"{$baseRef}all-index.html\" onclick=\"loadClassListFrame('{$baseRef}index-list.html')\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Index']]/entry[2]/p\"/></a>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"$splitIndex!='false' and $config/languageElements/@show='true' and $config/languageElements/@operators='true'\">\n\t\t\t\t<a href=\"{$baseRef}all-index-Symbols.html\" onclick=\"loadClassListFrame('{$baseRef}index-list.html')\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Index']]/entry[2]/p\"/></a>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"$isLiveDocs\">\n\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"$splitIndex!='false' and ($config/languageElements/@show!='true' or $config/languageElements/@operators!='true')\">\n\t\t\t\t<a href=\"{$baseRef}all-index-A.html\" onclick=\"loadClassListFrame('{$baseRef}index-list.html')\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Index']]/entry[2]/p\"/></a>\n\t\t\t</xsl:if>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"$showAppendixes and $config/appendixes/@show='true'\">\n\t\t\t<a href=\"{$baseRef}appendixes.html\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Appendix']]/entry[2]/p\"/></a>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"$showConventions\">\n\t\t\t<xsl:choose>\n\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t<a href=\"{$baseRef}conventions.html\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Conventions']]/entry[2]/p\"/></a>\n\t\t\t\t</xsl:otherwise>\n\t\t\t</xsl:choose>\n\t\t</xsl:if>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<a id=\"framesLink{$copyNum}\" href=\"{$baseRef}index.html?{$href}{$fileName}.html&amp;{$fileName2}\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Frames']]/entry[2]/p\"/>\n\t\t\t\t</a>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t\t<a id=\"noFramesLink{$copyNum}\" style=\"display:none\" href=\"\" onclick=\"parent.location=document.location\">\n\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t<xsl:with-param name=\"key\">NoFrames</xsl:with-param>\n\t\t\t</xsl:call-template>\n\t\t</a>\n\t</xsl:template>\n\t<xsl:template name=\"getNavLinks\">\n\t\t<xsl:param name=\"copyNum\"/>\n\t\t<xsl:param name=\"baseRef\"/>\n\t\t<xsl:param name=\"showPackages\"/>\n\t\t<xsl:param name=\"showAllClasses\"/>\n\t\t<xsl:param name=\"showLanguageElements\"/>\n\t\t<xsl:param name=\"showMXMLOnly\"/>\n\t\t<xsl:param name=\"showIndex\"/>\n\t\t<xsl:param name=\"splitIndex\"/>\n\t\t<xsl:param name=\"showAppendixes\"/>\n\t\t<xsl:param name=\"showConventions\"/>\n\t\t<xsl:param name=\"href\"/>\n\t\t<xsl:param name=\"fileName\"/>\n\t\t<xsl:param name=\"fileName2\"/>\n\t\t<div width=\"100%\" class=\"topLinks\" align=\"right\" style=\"padding-bottom:5px\">\n\t\t\t<span id=\"navigationCell{$copyNum}\" style=\"display:none;font-size:14px;font-weight:bold\">\n\t\t\t\t<xsl:if test=\"$showPackages\">\n\t\t\t\t\t<a href=\"{$baseRef}package-summary.html\" onclick=\"loadClassListFrame('{$baseRef}all-classes.html')\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'allPackages']]/entry[2]/p\"/></a>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$showAllClasses\">\n\t\t\t\t\t<a href=\"{$baseRef}class-summary.html\" onclick=\"loadClassListFrame('{$baseRef}all-classes.html')\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'allClasses']]/entry[2]/p\"/></a>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$showLanguageElements\">\n\t\t\t\t\t<a href=\"{$baseRef}language-elements.html\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'LanguageElements']]/entry[2]/p\"/></a>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$showMXMLOnly\">\n\t\t\t\t\t<a href=\"{$baseRef}mxml-tag-detail.html\" onclick=\"loadClassListFrame('{$baseRef}mxml-tags.html')\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'MXMLOnly']]/entry[2]/p\"/></a>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$showIndex\">\n\t\t\t\t\t<xsl:if test=\"$splitIndex='false'\">\n\t\t\t\t\t\t<a href=\"{$baseRef}all-index.html\" onclick=\"loadClassListFrame('{$baseRef}index-list.html')\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Index']]/entry[2]/p\"/>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"$splitIndex!='false' and $config/languageElements/@show='true' and $config/languageElements/@operators='true'\">\n\t\t\t\t\t\t<a href=\"{$baseRef}all-index-Symbols.html\" onclick=\"loadClassListFrame('{$baseRef}index-list.html')\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Index']]/entry[2]/p\"/>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"$splitIndex!='false' and ($config/languageElements/@show!='true' or $config/languageElements/@operators!='true')\">\n\t\t\t\t\t\t<a href=\"{$baseRef}all-index-A.html\" onclick=\"loadClassListFrame('{$baseRef}index-list.html')\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Index']]/entry[2]/p\"/>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$showAppendixes and $config/appendixes/@show='true'\">\n\t\t\t\t\t<a href=\"{$baseRef}appendixes.html\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Appendix']]/entry[2]/p\"/></a>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$showConventions\">\n\t\t\t\t\t<a href=\"{$baseRef}conventions.html\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Conventions']]/entry[2]/p\"/></a>\n\t\t\t\t</xsl:if>\n\t\t\t\t<a id=\"framesLink{$copyNum}\" href=\"{$baseRef}index.html?{$href}{$fileName}.html&amp;{$fileName2}\"><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Frames']]/entry[2]/p\"/></a>\n\t\t\t\t<a id=\"noFramesLink{$copyNum}\" style=\"display:none\" href=\"\" onclick=\"parent.location=document.location\"><xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t<xsl:with-param name=\"key\">NoFrames</xsl:with-param>\n\t\t\t\t\t</xsl:call-template></a>\n\t\t\t</span>\n\t\t</div>\n\t</xsl:template>\n\t<xsl:template name=\"getFeedbackLink\">\n\t\t<xsl:param name=\"topic\"/>\n\t\t<xsl:param name=\"filename\"/>\n\t\t<xsl:param name=\"filename2\" select=\"''\"/>\n\t\t<xsl:param name=\"baseRef\"/>\n\t\t<xsl:if test=\"not ($isLiveDocs)\">\n\t\t\t<xsl:if test=\"$config/feedback[@show='true']\">\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t<div class=\"feedbackLink\">\n\t\t\t\t\t\t\t<center>\n\t\t\t\t\t\t\t\t<xsl:if test=\"$config/feedback[@type='email']\">\n\t\t\t\t\t\t\t\t\t<a href=\"mailto:{$config/feedback/feedbackEmail/address/.}?subject=ASLR Feedback({$timestamp}) : {$topic}\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$config/feedback/feedbackEmail/label/.\"/>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"$config/feedback[@type='livedocs']\">\n\t\t\t\t\t\t\t\t\t<a href=\"javascript:gotoLiveDocs('{$filename}','{$filename2}','{$locale}');\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$config/feedback/feedbackLiveDocs/label/.\"/>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</center>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t</xsl:choose>\n\t\t\t</xsl:if>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"$config/options[@ion='true']\">\n\t\t\t<xsl:if test=\"$config/feedback[@show='true']\">\n\t\t\t\t<script src=\"{$baseRef}currentpage.js\" type=\"text/javascript\" language=\"Javascript\" charset=\"UTF-8\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"$config/options[@livedocs='true']\">\n\t\t\t<div class=\"feedbackLink\">\n\t\t\t\t<center>\n\t\t\t\t\t<xsl:if test=\"$config/feedback[@type='livedocs']\">\n\t\t\t\t\t\t<a href=\"javascript:gotoLiveDocs('{$filename}','{$filename2}','{$locale}');\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$config/feedback/feedbackLiveDocs/label/.\"/>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</center>\n\t\t\t</div>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"showHelpLink\">\n\t\t<xsl:if test=\"$config/exampleHelp and $config/exampleHelp/@show='true'\">\n\t\t\t<xsl:variable name=\"linkurl\" select=\"concat('&lt;a href=&quot;',$config/exampleHelp/linkUrl,'&quot; target=&quot;external&quot;&gt;')\"/>\n\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"$linkurl\"/>\n\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"$config/exampleHelp/linkText\"/>\n\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;/a&gt;'\"/>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"oldversion\">\n\t\t<xsl:if test=\"$showLangVersionWarnings='true' and not(count(versions/langversion))\">\n\t\t\t<xsl:message>WARNING: no langversion for <xsl:if test=\"../../@name\">\n\t\t\t\t\t<xsl:value-of select=\"../../@name\"/>\n\t\t\t\t\t<xsl:text>.</xsl:text>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t\t</xsl:message>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"$showPlayerVersionWarnings='true' and not(count(versions/playerversion))\">\n\t\t\t<xsl:message>WARNING: no playerversion for <xsl:if test=\"../../@name\">\n\t\t\t\t\t<xsl:value-of select=\"../../@name\"/>\n\t\t\t\t\t<xsl:text>.</xsl:text>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t\t</xsl:message>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"not($config/options/@showVersions) or $config/options[@showVersions!='false']\">\n\t\t\t<xsl:if test=\"count(versions/langversion[not(starts-with(@version,'1'))]) or count(versions/playerversion)\">\n\t\t\t\t<p/>\n\t\t\t\t<xsl:if test=\"count(versions/langversion[not(starts-with(@version,'1'))])\">\n\t\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td style=\"white-space:nowrap\" valign=\"top\">\n\t\t\t\t\t\t\t\t<b>\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\">LanguageVersion</xsl:with-param>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">:&amp;nbsp;</xsl:text>\n\t\t\t\t\t\t\t\t</b>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<xsl:text>ActionScript </xsl:text>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"translate(versions/langversion/@version,'+','')\"/>\n\t\t\t\t\t\t\t\t<xsl:if test=\"substring-before(versions/langversion/@version, '+')\">\n\t\t\t\t\t\t\t\t\t<xsl:text> and later</xsl:text>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"string-length(normalize-space(versions/langversion))\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$emdash\"/>\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"inText\" select=\"normalize-space(versions/langversion)\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not($config/options/@showVersions) or $config/options[@showVersions!='false'] or $config/options[@showRuntimeVersions='true']\">\n\t\t\t\t<xsl:if test=\"count(versions/playerversion)\">\n\t\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td style=\"white-space:nowrap\" valign=\"top\">\n\t\t\t\t\t\t\t\t<b>\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\">RuntimeVersions</xsl:with-param>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">:&amp;nbsp;</xsl:text>\n\t\t\t\t\t\t\t\t</b>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t<xsl:when test=\"versions/playerversion/@name='Flash'\">\n\t\t\t\t\t\t\t\t\t\t<xsl:text>Flash Player </xsl:text>\n\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t<xsl:when test=\"versions/playerversion/@name='Lite'\">\n\t\t\t\t\t\t\t\t\t\t<xsl:text>Flash Lite </xsl:text>\n\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"translate(translate(versions/playerversion/@version,'+',''),',','.')\"/>\n\t\t\t\t\t\t\t\t<xsl:if test=\"substring-before(versions/playerversion/@version, '+')\">\n\t\t\t\t\t\t\t\t\t<xsl:text> and later</xsl:text>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"string-length(normalize-space(versions/playerversion))\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$emdash\"/>\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"inText\" select=\"normalize-space(versions/playerversion)\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</xsl:if>\n\t\t\t\t<p/>\n\t\t\t</xsl:if>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<!-- TODO support multiple? -->\n\t<xsl:template name=\"version\">\n\t\t<xsl:if test=\"$showLangVersionWarnings='true' and not(count(prolog/asMetadata/apiVersion/apiLanguage))\">\n\t\t\t<xsl:message>WARNING: no langversion for <xsl:if test=\"../../apiName\">\n\t\t\t\t\t<xsl:value-of select=\"../../apiName\"/>\n\t\t\t\t\t<xsl:text>.</xsl:text>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:value-of select=\"apiName\"/>\n\t\t\t</xsl:message>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"$showPlayerVersionWarnings='true' and not(count(prolog/asMetadata/apiVersion/apiPlatform))\">\n\t\t\t<xsl:message>WARNING: no playerversion for <xsl:if test=\"../../apiName\">\n\t\t\t\t\t<xsl:value-of select=\"../../apiName\"/>\n\t\t\t\t\t<xsl:text>.</xsl:text>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:value-of select=\"apiName\"/>\n\t\t\t</xsl:message>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"not($config/options/@showVersions) or $config/options[@showVersions!='false']\">\n\t\t\t<xsl:if test=\"count(prolog/asMetadata/apiVersion[not(starts-with(./apiLanguage/@version,'1'))]) or count(./prolog/asMetadata/apiVersion/apiPlatform/@version)\">\n\t\t\t\t<p/>\n\t\t\t\t<xsl:if test=\"prolog/asMetadata/apiVersion/apiLanguage/@version and count(prolog/asMetadata/apiVersion[not(starts-with(./apiLanguage/@version,'1'))])\">\n\t\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td style=\"white-space:nowrap\" valign=\"top\">\n\t\t\t\t\t\t\t\t<b>\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\">LanguageVersion</xsl:with-param>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">:&amp;nbsp;</xsl:text>\n\t\t\t\t\t\t\t\t</b>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<xsl:text>ActionScript </xsl:text>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"translate(prolog/asMetadata/apiVersion/apiLanguage/@version,'+','')\"/>\n\t\t\t\t\t\t\t\t<xsl:if test=\"substring-before(prolog/asMetadata/apiVersion/apiLanguage/@version, '+')\">\n\t\t\t\t\t\t\t\t\t<xsl:text> and later</xsl:text>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"string-length(normalize-space(prolog/asMetadata/apiVersion/apiLanguage))\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$emdash\"/>\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"inText\" select=\"normalize-space(prolog/asMetadata/apiVersion/apiLanguage)\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</xsl:if>\n\t\t\t\t<!--apiLanguage-->\n\t\t\t\t<!-- Product Version -->\n\t\t\t\t<xsl:if test=\"count(prolog/asMetadata/apiVersion/apiTool)\">\n\t\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td style=\"white-space:nowrap\" valign=\"top\">\n\t\t\t\t\t\t\t\t<b>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"count(prolog/asMetadata/apiVersion/apiTool) = 1\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\">ProductVersion</xsl:with-param>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">:&amp;nbsp;</xsl:text>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"count(prolog/asMetadata/apiVersion/apiTool) &gt; 1\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\">ProductVersions</xsl:with-param>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">:&amp;nbsp;</xsl:text>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</b>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<xsl:for-each select=\"prolog/asMetadata/apiVersion/apiTool\">\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"ToolExpanded\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:with-param>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$ToolExpanded\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$ToolExpanded\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"translate(translate(@version,'+',''),',','.')\"/>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"position() != last()\">\n\t\t\t\t\t\t\t\t\t\t<xsl:text>,</xsl:text>\n\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</xsl:if>\n\t\t\t\t<!--apiTool-->\n\n\t\t\t\t<!-- Since -->\n\t\t\t\t<xsl:if test=\"count(prolog/asMetadata/apiVersion/apiSince)\">\n\t\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td style=\"white-space:nowrap\" valign=\"top\">\n\t\t\t\t\t\t\t\t<b>\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\">Since</xsl:with-param>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">:&amp;nbsp;</xsl:text>\n\t\t\t\t\t\t\t\t</b>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<xsl:for-each select=\"prolog/asMetadata/apiVersion/apiSince\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"translate(translate(@version,'+',''),',','.')\"/>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"position() != last()\">\n\t\t\t\t\t\t\t\t\t\t<xsl:text>,</xsl:text>\n\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</xsl:if>\n\t\t\t\t<!--apiSince-->\n\n\t\t\t</xsl:if>\n\t\t\t<!--apiVersion-->\n\t\t</xsl:if>\n\t\t<!--showVersion-->\n\t\t<xsl:if test=\"not($config/options/@showVersions) or $config/options[@showVersions!='false'] or $config/options[@showRuntimeVersions='true']\">\n\t\t\t<!-- Multiple Versions -->\n\t\t\t<xsl:if test=\"prolog/asMetadata/apiVersion[apiPlatform]\">\n\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td style=\"white-space:nowrap\" valign=\"top\">\n\t\t\t\t\t\t\t<b>\n\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\">RuntimeVersions</xsl:with-param>\n\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">:&amp;nbsp;</xsl:text>\n\t\t\t\t\t\t\t</b>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<!-- Add default air 1.0 runtime -->\n\t\t\t\t\t\t\t<xsl:if test=\"count(prolog/asMetadata/apiVersion/apiPlatform) = 1 and (prolog/asMetadata/apiVersion/apiPlatform[@name='Flash'])\">\n\t\t\t\t\t\t\t\t<xsl:text>AIR 1.0, </xsl:text>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:for-each select=\"prolog/asMetadata/apiVersion/apiPlatform\">\n\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t<xsl:when test=\"@name='Flash'\">\n\t\t\t\t\t\t\t\t\t\t<xsl:text>Flash Player </xsl:text>\n\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t<xsl:when test=\"@name='AIR'\">\n\t\t\t\t\t\t\t\t\t\t<xsl:text>AIR</xsl:text>\n\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t<xsl:when test=\"@name='Lite'\">\n\t\t\t\t\t\t\t\t\t\t<xsl:text>Flash Lite </xsl:text>\n\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"translate(translate(@version,'+',''),',','.')\"/>\n\t\t\t\t\t\t\t\t<xsl:if test=\"@description!=''\">\n\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t<xsl:text>-</xsl:text>\n\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"normalize-space(@description)\"/>\n                                </xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"substring-before(string-join(@version, ''), '+')\">\n\t\t\t\t\t\t\t\t\t<xsl:text> and later</xsl:text>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"position() != last()\">\n\t\t\t\t\t\t\t\t\t<xsl:text>,</xsl:text>\n\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</xsl:if>\n\t\t\t<!--apiPlatform-->\n\t\t\t<p/>\n\t\t</xsl:if>\n\t\t<!--showVersions / showRuntimeVersions-->\n\t</xsl:template>\n\t<xsl:template name=\"isTopLevel\">\n\t\t<xsl:param name=\"packageName\"/>\n\t\t<xsl:value-of select=\"string-length($packageName)=0 or contains($packageName,'__Global__')\"/>\n\t</xsl:template>\n\t<xsl:template name=\"getPackageComments\">\n\t\t<xsl:param name=\"name\"/>\n\t\t<xsl:element name=\"package\">\n\t\t\t<xsl:copy-of select=\"document($packageCommentsFilename)/packages/package[@name=$name]\"/>\n\t\t</xsl:element>\n\t</xsl:template>\n\t<xsl:template name=\"getLinkFromId\">\n\t\t<xsl:param name=\"id\" select=\"''\"/>\n\t\t<xsl:param name=\"currentPackage\" select=\"''\"/>\n\t\t<xsl:param name=\"memberName\" select=\"''\"/>\n\t\t<xsl:if test=\"string-length($id) &gt; 0\">\n\t\t\t<xsl:variable name=\"classNameText\" select=\"substring-after($id,':')\"/>\n\t\t\t<xsl:variable name=\"packageNameText\" select=\"substring-before($id,':')\"/>\n\t\t\t<xsl:variable name=\"packageName\">\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"not(contains($packageNameText,'.'))\">\n\t\t\t\t\t\t<xsl:value-of select=\"''\"/>\n\t\t\t\t\t</xsl:when>\n\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t<xsl:value-of select=\"$packageNameText\"/>\n\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t</xsl:choose>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"className\">\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"contains($packageName,'.')\">\n\t\t\t\t\t\t<xsl:if test=\"contains($classNameText,':')\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"substring-before($classNameText,':')\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:when>\n\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t<xsl:value-of select=\"substring-before($id,':')\"/>\n\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t</xsl:choose>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"methodName\">\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"$memberName != ''\">\n\t\t\t\t\t\t<xsl:value-of select=\"$memberName\"/>\n\t\t\t\t\t</xsl:when>\n\t\t\t\t\t<xsl:when test=\"contains($packageName,'.')\">\n\t\t\t\t\t\t<xsl:if test=\"contains($classNameText,':')\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"substring-after($classNameText,':')\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:when>\n\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t<xsl:value-of select=\"substring-after($id,':')\"/>\n\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t</xsl:choose>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"hPath\">\n\t\t\t\t<xsl:call-template name=\"getHyperlinkPath\">\n\t\t\t\t\t<xsl:with-param name=\"destination\" select=\"concat($packageName,':',$className)\"/>\n\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"completeHLink\">\n\t\t\t\t<xsl:if test=\"string-length($methodName) &gt; 0\">\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"contains($methodName,':')\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"concat($hPath,'#',substring-before($methodName,':'))\"/>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t<xsl:value-of select=\"concat($hPath,'#',$methodName)\"/>\n\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:value-of select=\"$completeHLink\"/>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getClassLinkFromId\">\n\t\t<xsl:param name=\"id\" select=\"''\"/>\n\t\t<xsl:param name=\"currentPackage\" select=\"''\"/>\n\t\t<xsl:if test=\"string-length($id) &gt; 0\">\n\t\t\t<xsl:variable name=\"classNameText\" select=\"substring-after($id,':')\"/>\n\t\t\t<xsl:variable name=\"packageNameText\" select=\"substring-before($id,':')\"/>\n\t\t\t<xsl:variable name=\"packageName\">\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"not(contains($packageNameText,'.'))\">\n\t\t\t\t\t\t<xsl:value-of select=\"''\"/>\n\t\t\t\t\t</xsl:when>\n\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t<xsl:value-of select=\"$packageNameText\"/>\n\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t</xsl:choose>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"className\">\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"contains($packageName,'.')\">\n\t\t\t\t\t\t<xsl:if test=\"contains($classNameText,':')\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"substring-before($classNameText,':')\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:when>\n\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t<xsl:value-of select=\"substring-before($id,':')\"/>\n\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t</xsl:choose>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"hPath\">\n\t\t\t\t<xsl:call-template name=\"getHyperlinkPath\">\n\t\t\t\t\t<xsl:with-param name=\"destination\" select=\"concat($packageName,':',$className)\"/>\n\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:value-of select=\"$hPath\"/>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getClassNameFromId\">\n\t\t<xsl:param name=\"id\" select=\"''\"/>\n\t\t<xsl:if test=\"string-length($id) &gt; 0\">\n\t\t\t<xsl:variable name=\"classNameText\" select=\"substring-after($id,':')\"/>\n\t\t\t<xsl:variable name=\"packageNameText\" select=\"substring-before($id,':')\"/>\n\t\t\t<xsl:variable name=\"packageName\">\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"not(contains($packageNameText,'.')) and string-length($packageNameText) = 0\">\n\t\t\t\t\t\t<xsl:value-of select=\"''\"/>\n\t\t\t\t\t</xsl:when>\n\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t<xsl:value-of select=\"$packageNameText\"/>\n\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t</xsl:choose>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"className\">\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"contains($packageName,'.')\">\n\t\t\t\t\t\t<xsl:if test=\"contains($classNameText,':')\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"substring-before($classNameText,':')\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"not(contains($classNameText,':'))\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$classNameText\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:when>\n\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t<xsl:if test=\"contains($classNameText,':')\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"substring-before($classNameText,':')\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"not(contains($classNameText,':'))\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$classNameText\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t</xsl:choose>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:value-of select=\"$className\"/>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"styleTypeHyperlink\">\n\t\t<xsl:param name=\"type\" select=\"''\"/>\n\t\t<xsl:param name=\"currentPackage\" select=\"''\"/>\n\t\t<xsl:if test=\"$type\">\n\t\t\t<xsl:variable name=\"relativePath\">\n\t\t\t\t<xsl:call-template name=\"getRelativePath\">\n\t\t\t\t\t<xsl:with-param name=\"currentPath\" select=\"$currentPackage\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"hyperLink\">\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"not(contains($type,'.'))\">\n\t\t\t\t\t\t<xsl:value-of select=\"concat($relativePath,$type,'.html')\"/>\n\t\t\t\t\t</xsl:when>\n\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t<xsl:variable name=\"package\">\n\t\t\t\t\t\t\t<xsl:call-template name=\"substring-before-last\">\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"input\" select=\"$type\"/>\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"substr\" select=\"'.'\"/>\n\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t<xsl:variable name=\"class\">\n\t\t\t\t\t\t\t<xsl:call-template name=\"substring-after-last\">\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"input\" select=\"$type\"/>\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"substr\" select=\"'.'\"/>\n\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t<xsl:value-of select=\"concat($relativePath,translate($package,'.','/'),'/',$class,'.html')\"/>\n\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t</xsl:choose>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:value-of select=\"$hyperLink\"/>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getEventClassLinkFromId\">\n\t\t<xsl:param name=\"id\" select=\"''\"/>\n\t\t<xsl:param name=\"currentPackage\" select=\"''\"/>\n\t\t<xsl:if test=\"string-length($id) &gt; 0\">\n\t\t\t<xsl:variable name=\"text\" select=\"substring-before($id,'_')\"/>\n\t\t\t<xsl:variable name=\"className\" select=\"substring-after($text,':')\"/>\n\t\t\t<xsl:variable name=\"packageName\" select=\"substring-before($text,':')\"/>\n\t\t\t<xsl:variable name=\"hPath\">\n\t\t\t\t<xsl:call-template name=\"getHyperlinkPath\">\n\t\t\t\t\t<xsl:with-param name=\"destination\" select=\"concat($packageName,':',$className)\"/>\n\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:value-of select=\"$hPath\"/>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getEventClassNameFromId\">\n\t\t<xsl:param name=\"currentPackage\"/>\n\t\t<xsl:param name=\"id\" select=\"''\"/>\n\t\t<xsl:if test=\"string-length($id) &gt; 0\">\n\t\t\t<xsl:variable name=\"text\" select=\"substring-before($id,'_')\"/>\n\t\t\t<xsl:variable name=\"className\" select=\"substring-after($text,':')\"/>\n\t\t\t<xsl:value-of select=\"$className\"/>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getConRefText\">\n\t\t<xsl:param name=\"conref\"/>\n\t\t<xsl:param name=\"descriptionType\"/>\n\t\t<xsl:param name=\"entryType\"/>\n\t\t<xsl:param name=\"doNotProcessTags\" select=\"false()\"/>\n\t\t<xsl:param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t<xsl:if test=\"string-length($conref) &gt; 0\">\n\t\t\t<xsl:variable name=\"relativePath\">\n\t\t\t\t<xsl:call-template name=\"getRelativePath\">\n\t\t\t\t\t<xsl:with-param name=\"currentPath\" select=\"$currentPackage\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"packageClassText\">\n\t\t\t\t<xsl:if test=\"contains($conref,'#') and contains(substring-before($conref,'#'),'.')\">\n\t\t\t\t\t<xsl:value-of select=\"substring-before($conref,'#')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"contains($conref,'#') and not(contains(substring-before($conref,'#'),'.'))\">\n\t\t\t\t\t<xsl:value-of select=\"concat($currentPackage,'.',substring-before($conref,'#'))\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(contains($conref,'#'))\">\n\t\t\t\t\t<xsl:value-of select=\"$conref\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"className\">\n\t\t\t\t<xsl:if test=\"contains($conref,'#') and contains(substring-before($conref,'#'),'.')\">\n\t\t\t\t\t<xsl:call-template name=\"lastIndexOf\">\n\t\t\t\t\t\t<xsl:with-param name=\"string\" select=\"$packageClassText\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"char\" select=\"'.'\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"contains($conref,'#') and not(contains(substring-before($conref,'#'),'.'))\">\n\t\t\t\t\t<xsl:if test=\"string-length(substring-before($conref,'#')) = 0\">\n\t\t\t\t\t\t<xsl:value-of select=\"ancestor-or-self::apiPackage/apiClassifier/apiName\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"string-length(substring-before($conref,'#')) &gt; 0\">\n\t\t\t\t\t\t<xsl:value-of select=\"substring-before($conref,'#')\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"destPackageName1\">\n\t\t\t\t<xsl:value-of select=\"substring-before($packageClassText,concat('.',$className))\"/>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"destPackageName\">\n\t\t\t\t<xsl:if test=\"$destPackageName1 = '' or $destPackageName1='__Global__'\">\n\t\t\t\t\t<xsl:value-of select=\"'__Global__.xml'\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not($destPackageName1='') and not($destPackageName1='__Global__')\">\n\t\t\t\t\t<xsl:value-of select=\"concat($destPackageName1, '.xml')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"entryTypeNameText\" select=\"substring-after($conref,'#')\"/>\n\t\t\t<xsl:variable name=\"nameToMatch\">\n\t\t\t\t<xsl:if test=\"string-length($entryTypeNameText) = 0\">\n\t\t\t\t\t<xsl:value-of select=\"$className\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"contains($entryTypeNameText,':')\">\n\t\t\t\t\t<xsl:value-of select=\"substring-after($entryTypeNameText,':')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(contains($entryTypeNameText,':')) and string-length($entryTypeNameText) &gt; 0\">\n\t\t\t\t\t<xsl:if test=\"contains($entryTypeNameText,')')\">\n\t\t\t\t\t\t<xsl:value-of select=\"substring-before($entryTypeNameText,'(')\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"not(contains($entryTypeNameText,')'))\">\n\t\t\t\t\t\t<xsl:value-of select=\"$entryTypeNameText\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"entryType\">\n\t\t\t\t<xsl:if test=\"string-length($entryTypeNameText) = 0\">\n\t\t\t\t\t<xsl:value-of select=\"'class'\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"contains($entryTypeNameText,':')\">\n\t\t\t\t\t<xsl:value-of select=\"substring-before($entryTypeNameText,':')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(contains($entryTypeNameText,':')) and string-length($entryTypeNameText) &gt; 0\">\n\t\t\t\t\t<xsl:if test=\"contains($entryTypeNameText,')')\">\n\t\t\t\t\t\t<xsl:value-of select=\"'method'\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"not(contains($entryTypeNameText,')'))\">\n\t\t\t\t\t\t<xsl:value-of select=\"'property'\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:if test=\"string-length(normalize-space($destPackageName)) = 4\">\n\t\t\t\t<xsl:message> CAlling class : <xsl:value-of select=\"ancestor-or-self::apiClassifier/apiName\"/> currentpackage : <xsl:value-of select=\"ancestor-or-self::apiPackage/apiName\"/> Entry Type : <xsl:value-of\n\t\t\t\t\t\tselect=\"$entryType\"/> Entry Type Text:\t\t<xsl:value-of select=\"$entryTypeNameText\"/> descriptionType : <xsl:value-of select=\"$descriptionType\"/> Conref : <xsl:value-of select=\"$conref\"\n\t\t\t\t\t\t/> nameToMatch : <xsl:value-of select=\"$nameToMatch\"/> Class Name : <xsl:value-of select=\"$className\"/>\tpackageClassText Name : <xsl:value-of select=\"$packageClassText\"\n\t\t\t\t\t\t/> destPackageName Name : <xsl:value-of select=\"$destPackageName\"/>\n\t\t\t\t</xsl:message>\n\t\t\t</xsl:if>\n\t\t\t<xsl:for-each select=\"document(concat($ditaFileDir,$destPackageName))/apiPackage//apiClassifier[apiName=$className]\">\n\t\t\t\t<xsl:if test=\"string-length($entryType) &gt; 0\">\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"contains($entryType,'class')\">\n\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t<xsl:when test=\"$descriptionType='shortdesc'\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"./shortdesc[@conref]\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"./shortdesc/@conref\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"local-name(./shortdesc)\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(./shortdesc[@conref])\">\n\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"./shortdesc/.\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not ($doNotProcessTags)\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t<xsl:when test=\"$descriptionType='apiDesc'\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"./apiClassifierDetail/apiDesc[@conref]\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"./apiClassifierDetail/apiDesc/@conref\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"local-name(./apiClassifierDetail/apiDesc)\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(./apiClassifierDetail/apiDesc[@conref])\">\n\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"./apiClassifierDetail/apiDesc\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not ($doNotProcessTags)\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"./description[@conref]\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"./description/@conref\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"local-name(./description)\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(./description[@conref])\">\n\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"./description\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not ($doNotProcessTags)\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:when test=\"contains($entryType,'style')\">\n\t\t\t\t\t\t\t<xsl:for-each select=\"./prolog/asMetadata/styles/style[@name=$nameToMatch]\">\n\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t<xsl:when test=\"$descriptionType='shortdesc'\">\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./shortdesc[@conref]\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"./shortdesc/@conref\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"local-name(./shortdesc)\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(./shortdesc[@conref])\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"./shortdesc/.\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not ($doNotProcessTags)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./description[@conref]\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"./description/@conref\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"local-name(./description)\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(./description[@conref])\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"./description\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not ($doNotProcessTags)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:when test=\"contains($entryType,'event')\">\n\t\t\t\t\t\t\t<xsl:for-each select=\".//adobeApiEvent[apiName=$nameToMatch]\">\n\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t<xsl:when test=\"$descriptionType='shortdesc'\">\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./shortdesc[@conref]\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"./shortdesc/@conref\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"local-name(./shortdesc)\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(./shortdesc[@conref])\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"./shortdesc/.\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not ($doNotProcessTags)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./adobeApiEventDetail/apiDesc[@conref]\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"./adobeApiEventDetail/apiDesc/@conref\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"local-name(./adobeApiEventDetail/apiDesc)\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(./adobeApiEventDetail/apiDesc[@conref])\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"./adobeApiEventDetail/apiDesc\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not ($doNotProcessTags)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:when test=\"contains($entryType,'method')\">\n\t\t\t\t\t\t\t<xsl:for-each select=\"./apiOperation[apiName=$nameToMatch]\">\n\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t<xsl:when test=\"$descriptionType='shortdesc'\">\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./shortdesc[@conref]\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"./shortdesc/@conref\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"local-name(./shortdesc)\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(./shortdesc[@conref])\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"./shortdesc/.\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not ($doNotProcessTags)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./apiOperationDetail/apiDesc[@conref]\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"./apiOperationDetail/apiDesc/@conref\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"local-name(./apiOperationDetail/apiDesc)\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(./apiOperationDetail/apiDesc[@conref])\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"./apiOperationDetail/apiDesc\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not ($doNotProcessTags)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:when test=\"contains($entryType,'property')\">\n\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t                <xsl:when test=\"count(./apiValue[apiName=$nameToMatch]) &gt; 0\">\n\t\t\t\t                  <xsl:for-each select=\"./apiValue[apiName=$nameToMatch]\">\n\t\t\t\t                    <xsl:choose>\n\t\t\t\t                      <xsl:when test=\"$descriptionType='shortdesc'\">\n\t\t\t\t                        <xsl:if test=\"./shortdesc[@conref]\">\n\t\t\t\t                          <xsl:call-template name=\"getConRefText\">\n\t\t\t\t                            <xsl:with-param name=\"conref\" select=\"./shortdesc/@conref\"/>\n\t\t\t\t                            <xsl:with-param name=\"descriptionType\" select=\"local-name(./shortdesc)\"/>\n\t\t\t\t                          </xsl:call-template>\n\t\t\t\t                        </xsl:if>\n\t\t\t\t                        <xsl:if test=\"not(./shortdesc[@conref])\">\n\t\t\t\t                          <xsl:for-each select=\"./shortdesc/.\">\n\t\t\t\t                            <xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t                              <xsl:value-of select=\".\"/>\n\t\t\t\t                            </xsl:if>\n\t\t\t\t                            <xsl:if test=\"not($doNotProcessTags)\">\n\t\t\t\t                              <xsl:call-template name=\"processTags\"/>\n\t\t\t\t                            </xsl:if>\n\t\t\t\t                          </xsl:for-each>\n\t\t\t\t                        </xsl:if>\n\t\t\t\t                      </xsl:when>\n\t\t\t\t                      <xsl:otherwise>\n\t\t\t\t                        <xsl:if test=\"./apiValueDetail/apiDesc[@conref]\">\n\t\t\t\t                          <xsl:call-template name=\"getConRefText\">\n\t\t\t\t                            <xsl:with-param name=\"conref\" select=\"./apiValueDetail/apiDesc/@conref\"/>\n\t\t\t\t                            <xsl:with-param name=\"descriptionType\" select=\"local-name(./apiValueDetail/apiDesc)\"/>\n\t\t\t\t                          </xsl:call-template>\n\t\t\t\t                        </xsl:if>\n\t\t\t\t                        <xsl:if test=\"not(./apiValueDetail/apiDesc[@conref])\">\n\t\t\t\t                          <xsl:for-each select=\"./apiValueDetail/apiDesc\">\n\t\t\t\t                            <xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t                              <xsl:value-of select=\".\"/>\n\t\t\t\t                            </xsl:if>\n\t\t\t\t                            <xsl:if test=\"not($doNotProcessTags)\">\n\t\t\t\t                              <xsl:call-template name=\"processTags\"/>\n\t\t\t\t                            </xsl:if>\n\t\t\t\t                          </xsl:for-each>\n\t\t\t\t                        </xsl:if>\n\t\t\t\t                      </xsl:otherwise>\n\t\t\t\t                    </xsl:choose>\n\t\t\t\t                  </xsl:for-each>                  \n\t\t\t\t                </xsl:when>\n\t\t\t\t                <xsl:when test=\"count(./prolog/asMetadata/skinParts/SkinPart[@name=$nameToMatch]) &gt; 0\">\n\t\t\t\t                  <xsl:for-each select=\"./prolog/asMetadata/skinParts/SkinPart[@name=$nameToMatch]\">\n\t\t\t\t                    <xsl:choose>\n\t\t\t\t                      <xsl:when test=\"$descriptionType='shortdesc'\">\n\t\t\t\t                        <xsl:if test=\"./shortdesc[@conref]\">\n\t\t\t\t                          <xsl:call-template name=\"getConRefText\">\n\t\t\t\t                            <xsl:with-param name=\"conref\" select=\"./shortdesc/@conref\"/>\n\t\t\t\t                            <xsl:with-param name=\"descriptionType\" select=\"local-name(./shortdesc)\"/>\n\t\t\t\t                          </xsl:call-template>\n\t\t\t\t                        </xsl:if>\n\t\t\t\t                        <xsl:if test=\"not(./shortdesc[@conref])\">\n\t\t\t\t                          <xsl:for-each select=\"./shortdesc/.\">\n\t\t\t\t                            <xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t                              <xsl:value-of select=\".\"/>\n\t\t\t\t                            </xsl:if>\n\t\t\t\t                            <xsl:if test=\"not($doNotProcessTags)\">\n\t\t\t\t                              <xsl:call-template name=\"processTags\"/>\n\t\t\t\t                            </xsl:if>\n\t\t\t\t                          </xsl:for-each>\n\t\t\t\t                        </xsl:if>\n\t\t\t\t                      </xsl:when>\n\t\t\t\t                      <xsl:otherwise>\n\t\t\t\t                        <xsl:if test=\"./description[@conref]\">\n\t\t\t\t                          <xsl:call-template name=\"getConRefText\">\n\t\t\t\t                            <xsl:with-param name=\"conref\" select=\"./description/@conref\"/>\n\t\t\t\t                            <xsl:with-param name=\"descriptionType\" select=\"local-name(./description)\"/>\n\t\t\t\t                          </xsl:call-template>\n\t\t\t\t                        </xsl:if>\n\t\t\t\t                        <xsl:if test=\"not(./description[@conref])\">\n\t\t\t\t                          <xsl:for-each select=\"./description\">\n\t\t\t\t                            <xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t                              <xsl:value-of select=\".\"/>\n\t\t\t\t                            </xsl:if>\n\t\t\t\t                            <xsl:if test=\"not($doNotProcessTags)\">\n\t\t\t\t                              <xsl:call-template name=\"processTags\"/>\n\t\t\t\t                            </xsl:if>\n\t\t\t\t                          </xsl:for-each>\n\t\t\t\t                        </xsl:if>\n\t\t\t\t                      </xsl:otherwise>\n\t\t\t\t                    </xsl:choose>\n\t\t\t\t                  </xsl:for-each>\n\t\t\t\t                </xsl:when>\n\t\t\t\t              </xsl:choose>\t\t\t\t\t\t\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t<xsl:when test=\"$descriptionType='shortdesc'\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"./shortdesc[@conref]\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"./shortdesc/@conref\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"local-name(./shortdesc)\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(./shortdesc[@conref])\">\n\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"./shortdesc/.\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not ($doNotProcessTags)\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"./apiClassifierDetail/apiDesc[@conref]\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"./apiClassifierDetail/apiDesc/@conref\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"local-name(./apiClassifierDetail/apiDesc)\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(./apiClassifierDetail/apiDesc[@conref])\">\n\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"./apiClassifierDetail/apiDesc\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not ($doNotProcessTags)\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:for-each>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"doesClassExist\">\n\t\t<xsl:param name=\"class_name\"/>\n\t\t<xsl:variable name=\"xslDocPath\">\n\t\t\t<xsl:choose>\n\t\t\t\t<xsl:when test=\"contains($class_name,':') and  substring-before($class_name,':') != '' \">\n\t\t\t\t\t<xsl:value-of select=\"substring-before($class_name,':')\"/>\n\t\t\t\t</xsl:when>\n\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t<xsl:value-of select=\"'__Global__'\"/>\n\t\t\t\t</xsl:otherwise>\n\t\t\t</xsl:choose>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"className\">\n\t\t\t<xsl:if test=\"contains($class_name,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-after($class_name,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($class_name,':'))\">\n\t\t\t\t<xsl:value-of select=\"$class_name\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"ancestor::allClasses/apiPackage[@id=$xslDocPath]/apiClassifier[@id=$class_name or apiName=$class_name or apiName=$className]\">\n\t\t\t\t<xsl:text>1</xsl:text>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:text>0</xsl:text>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template name=\"getHyperlinkPath\">\n\t\t<xsl:param name=\"destination\"/>\n\t\t<xsl:param name=\"currentPackage\"/>\n\t\t<xsl:if test=\"string-length($destination) &gt; 0\">\n\t\t\t<xsl:variable name=\"doesClassExist\">\n\t\t\t\t<xsl:call-template name=\"doesClassExist\">\n\t\t\t\t\t<xsl:with-param name=\"class_name\" select=\"$destination\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:if test=\"$doesClassExist = '1'\">\n\t\t\t\t<xsl:variable name=\"relativePath\">\n\t\t\t\t\t<xsl:call-template name=\"getRelativePath\">\n\t\t\t\t\t\t<xsl:with-param name=\"currentPath\" select=\"$currentPackage\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<xsl:variable name=\"className\">\n\t\t\t\t\t<xsl:if test=\"contains($destination,':')\">\n\t\t\t\t\t\t<xsl:value-of select=\"substring-after($destination,':')\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"not(contains($destination,':'))\">\n\t\t\t\t\t\t<xsl:if test=\"not(contains($destination,'.'))\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$destination\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<xsl:variable name=\"packageName\">\n\t\t\t\t\t<xsl:if test=\"contains($destination,':')\">\n\t\t\t\t\t\t<xsl:value-of select=\"substring-before($destination,':')\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"not(contains($destination,':'))\">\n\t\t\t\t\t\t<xsl:if test=\"contains($destination,'.')\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$destination\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<xsl:if test=\"string-length($packageName) &gt; 0\">\n\t\t\t\t\t<xsl:if test=\"string-length($className) &gt; 0\">\n\t\t\t\t\t\t<xsl:value-of select=\"concat($relativePath,translate($packageName,'.','/'),'/',$className,'.html')\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"string-length($packageName) = 0\">\n\t\t\t\t\t<xsl:if test=\"string-length($className) &gt; 0\">\n\t\t\t\t\t\t<xsl:value-of select=\"concat($relativePath,$className,'.html')\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"$doesClassExist != '1'\"> </xsl:if>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getHyperlinkRef\">\n\t\t<xsl:param name=\"destination\"/>\n\t\t<xsl:param name=\"baseRef\"/>\n\t\t<xsl:if test=\"string-length($destination) &gt; 0\">\n\t\t\t<xsl:variable name=\"className\">\n\t\t\t\t<xsl:if test=\"contains($destination,':')\">\n\t\t\t\t\t<xsl:value-of select=\"substring-after($destination,':')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(contains($destination,':'))\">\n\t\t\t\t\t<xsl:value-of select=\"$destination\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"packageName\">\n\t\t\t\t<xsl:if test=\"contains($destination,':')\">\n\t\t\t\t\t<xsl:value-of select=\"substring-before($destination,':')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:if test=\"string-length($packageName) &gt; 0\">\n\t\t\t\t<xsl:if test=\"string-length($className) &gt; 0\">\n\t\t\t\t\t<xsl:value-of select=\"concat($baseRef,translate($packageName,'.','/'),'/',$className,'.html')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"string-length($packageName) = 0\">\n\t\t\t\t<xsl:if test=\"string-length($className) &gt; 0\">\n\t\t\t\t\t<xsl:value-of select=\"concat($baseRef,$className,'.html')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:if>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getEventHyperlink\">\n\t\t<xsl:param name=\"destination\"/>\n\t\t<xsl:param name=\"currentPackage\"/>\n\t\t<xsl:if test=\"string-length($destination) &gt; 0\">\n\n\t\t\t<xsl:variable name=\"className\">\n\t\t\t\t<xsl:call-template name=\"lastIndexOf\">\n\t\t\t\t\t<xsl:with-param name=\"string\" select=\"$destination\"/>\n\t\t\t\t\t<xsl:with-param name=\"char\" select=\"'.'\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"packageName\">\n\t\t\t\t<xsl:if test=\"contains($destination,'.')\">\n\t\t\t\t\t<xsl:value-of select=\"substring-before($destination,concat('.',$className))\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\n\t\t\t<xsl:variable name=\"classHeader_map\" select=\"document('ClassHeader.xml')//apiPackage\"/>\n\t\t\t<xsl:if test=\"contains($destination,'.')\">\n\t\t\t\t<xsl:if test=\"count($classHeader_map//apiClassifier[@id=concat($packageName,':',$className)] ) &gt; 0\">\n\n\t\t\t\t\t<xsl:variable name=\"relativePath\">\n\t\t\t\t\t\t<xsl:call-template name=\"getRelativePath\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"currentPath\" select=\"$currentPackage\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t<xsl:if test=\"string-length($packageName) &gt; 0\">\n\t\t\t\t\t\t<xsl:if test=\"string-length($className) &gt; 0\">\n\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name!='javascript'\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($relativePath,translate($packageName,'.','/'),'/',$className,'.html')\"/>\n\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t<xsl:otherwise/>\n\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"string-length($packageName) = 0\">\n\t\t\t\t\t\t<xsl:if test=\"string-length($className) &gt; 0\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"concat($relativePath,$className,'.html')\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($destination,'.'))\">\n\t\t\t\t<xsl:if test=\"count($classHeader_map//apiClassifier[@id=concat('globalClassifier:',$className)] ) &gt; 0\">\n\n\t\t\t\t\t<xsl:variable name=\"relativePath\">\n\t\t\t\t\t\t<xsl:call-template name=\"getRelativePath\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"currentPath\" select=\"$currentPackage\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t<xsl:if test=\"string-length($packageName) &gt; 0\">\n\t\t\t\t\t\t<xsl:if test=\"string-length($className) &gt; 0\">\n\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name!='javascript'\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($relativePath,translate($packageName,'.','/'),'/',$className,'.html')\"/>\n\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t<xsl:otherwise/>\n\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"string-length($packageName) = 0\">\n\t\t\t\t\t\t<xsl:if test=\"string-length($className) &gt; 0\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"concat($relativePath,$className,'.html')\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:if>\n\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getEventTypeHyperlink\">\n\t\t<xsl:param name=\"destination\"/>\n\t\t<xsl:param name=\"currentPackage\"/>\n\t\t<xsl:if test=\"string-length($destination) &gt; 0\">\n\t\t\t<xsl:variable name=\"relativePath\">\n\t\t\t\t<xsl:call-template name=\"getRelativePath\">\n\t\t\t\t\t<xsl:with-param name=\"currentPath\" select=\"$currentPackage\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"lastToken\">\n\t\t\t\t<xsl:call-template name=\"lastIndexOf\">\n\t\t\t\t\t<xsl:with-param name=\"string\" select=\"$destination\"/>\n\t\t\t\t\t<xsl:with-param name=\"char\" select=\"'.'\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"firstPassToken\" select=\"substring-before($destination,concat('.',$lastToken))\"/>\n\t\t\t<xsl:variable name=\"eventTypeLink\">\n\t\t\t\t<xsl:if test=\"document(concat($ditaFileDir,'packages.dita'))/apiMap//apiItemRef[substring-before(@href,'xml')=$firstPassToken]\">\n\t\t\t\t\t<xsl:value-of select=\"concat($relativePath,translate($firstPassToken,'.','/'),'.html')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(document(concat($ditaFileDir,'packages.dita'))/apiMap//apiItemRef[substring-before(@href,'.xml')=$firstPassToken])\">\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"$prog_language_name!='javascript'\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"concat($relativePath,translate($firstPassToken,'.','/'),'.html#',$lastToken)\"/>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:otherwise/>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:value-of select=\"$eventTypeLink\"/>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getEventDescription\">\n\t\t<xsl:param name=\"destination\"/>\n\t\t<xsl:param name=\"descriptionType\" select=\"'apiDesc'\"/>\n\t\t<xsl:if test=\"string-length($destination) &gt; 0\">\n\t\t\t<xsl:variable name=\"lastToken\">\n\t\t\t\t<xsl:call-template name=\"lastIndexOf\">\n\t\t\t\t\t<xsl:with-param name=\"string\" select=\"$destination\"/>\n\t\t\t\t\t<xsl:with-param name=\"char\" select=\"'.'\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"firstPassToken\" select=\"substring-before($destination,concat('.',$lastToken))\"/>\n\t\t\t<xsl:variable name=\"firstPassCount\" select=\"count(document(concat($ditaFileDir,'packages.dita'))/apiMap//apiItemRef[@href=concat($firstPassToken,'.xml')])\"/>\n\t\t\t<xsl:if test=\"$firstPassCount &gt; 0\">\n\t\t\t\t<xsl:variable name=\"packageName\" select=\"$firstPassToken\"/>\n\t\t\t\t<xsl:variable name=\"className\" select=\"$lastToken\"/>\n\t\t\t\t<xsl:for-each select=\"document(concat($ditaFileDir,$packageName,'.xml'))/apiPackage//apiClassifier[apiName=$className]\">\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"$descriptionType='apiDesc'\">\n\t\t\t\t\t\t\t<xsl:for-each select=\"./apiValueDetail/apiDesc\">\n\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t<xsl:for-each select=\"./apiValueDetail/shortdesc\">\n\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not($firstPassCount &gt; 0)\">\n\t\t\t\t<xsl:variable name=\"eventName\" select=\"$lastToken\"/>\n\t\t\t\t<xsl:variable name=\"className\">\n\t\t\t\t\t<xsl:call-template name=\"lastIndexOf\">\n\t\t\t\t\t\t<xsl:with-param name=\"string\" select=\"$firstPassToken\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"char\" select=\"'.'\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<xsl:variable name=\"packageName\" select=\"substring-before($firstPassToken,concat('.',$className))\"/>\n\t\t\t\t<xsl:for-each select=\"document(concat($ditaFileDir,$packageName,'.xml'))/apiPackage//apiClassifier[apiName=$className]\">\n\t\t\t\t\t<xsl:for-each select=\".//apiValue[apiName=$eventName and not(apiValueDetail/apiValueDef/apiProperty)]\">\n\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t<xsl:when test=\"$descriptionType='apiDesc'\">\n\t\t\t\t\t\t\t\t<xsl:for-each select=\"./apiValueDetail/apiDesc\">\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t<xsl:for-each select=\"./shortdesc\">\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t</xsl:for-each>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:if>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"lastIndexOf\">\n\t\t<xsl:param name=\"string\"/>\n\t\t<xsl:param name=\"char\"/>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"contains($string, $char)\">\n\t\t\t\t<xsl:call-template name=\"lastIndexOf\">\n\t\t\t\t\t<xsl:with-param name=\"string\" select=\"substring-after($string, $char)\"/>\n\t\t\t\t\t<xsl:with-param name=\"char\" select=\"$char\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:value-of select=\"$string\"/>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template name=\"getFirstSentence\">\n\t\t<xsl:param name=\"inText\"/>\n\t\t<xsl:variable name=\"text\" select=\"normalize-space($inText)\"/>\n\t\t<xsl:variable name=\"periodWithTag\">\n\t\t\t<xsl:text disable-output-escaping=\"yes\">.&lt;</xsl:text>\n\t\t</xsl:variable>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"string-length($text) = 0\"/>\n\t\t\t<xsl:when test=\"substring-before($text,'. ')\">\n\t\t\t\t<xsl:value-of select=\"substring-before($text,'. ')\" disable-output-escaping=\"yes\"/>.</xsl:when>\n\t\t\t<xsl:when test=\"substring-before($text,$periodWithTag)\">\n\t\t\t\t<xsl:value-of select=\"substring-before($inText,$periodWithTag)\" disable-output-escaping=\"yes\"/>.</xsl:when>\n\t\t\t<xsl:when test=\"substring-before($text,'.')\">\n\t\t\t\t<xsl:value-of select=\"substring-before($text,'.')\" disable-output-escaping=\"yes\"/>.</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:value-of select=\"$text\" disable-output-escaping=\"yes\"/>.</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template name=\"deTilda\">\n\t\t<xsl:param name=\"inText\"/>\n\t\t<xsl:variable name=\"text\">\n\t\t\t<xsl:call-template name=\"search-and-replace\">\n\t\t\t\t<xsl:with-param name=\"search-string\" select=\"'~~'\"/>\n\t\t\t\t<xsl:with-param name=\"replace-string\" select=\"'*'\"/>\n\t\t\t\t<xsl:with-param name=\"input\">\n\t\t\t\t\t<xsl:call-template name=\"convertListing\">\n\t\t\t\t\t\t<xsl:with-param name=\"inText\" select=\"$inText\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:with-param>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"text2\">\n\t\t\t<xsl:call-template name=\"search-and-replace\">\n\t\t\t\t<xsl:with-param name=\"search-string\" select=\"'TAAB'\"/>\n\t\t\t\t<xsl:with-param name=\"replace-string\" select=\"'    '\"/>\n\t\t\t\t<xsl:with-param name=\"input\" select=\"$text\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:value-of select=\"$text2\" disable-output-escaping=\"yes\"/>\n\t</xsl:template>\n\t<xsl:template name=\"listingIcon\">\n\t\t<xsl:param name=\"version\"/>\n\t\t<xsl:variable name=\"conditionalText\">\n\t\t\t<xsl:choose>\n\t\t\t\t<xsl:when test=\"number($version)=3\">\n\t\t\t\t\t<xsl:text>3.gif' alt='</xsl:text>\n\t\t\t\t\t<xsl:value-of select=\"$AS3tooltip\"/>\n\t\t\t\t\t<xsl:text>' title='</xsl:text>\n\t\t\t\t\t<xsl:value-of select=\"$AS3tooltip\"/>\n\t\t\t\t</xsl:when>\n\t\t\t\t<xsl:when test=\"number($version)=2\">\n\t\t\t\t\t<xsl:text>2.gif' alt='</xsl:text>\n\t\t\t\t\t<xsl:value-of select=\"$AS2tooltip\"/>\n\t\t\t\t\t<xsl:text>' title='</xsl:text>\n\t\t\t\t\t<xsl:value-of select=\"$AS2tooltip\"/>\n\t\t\t\t</xsl:when>\n\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t<xsl:text>1.gif' alt='</xsl:text>\n\t\t\t\t\t<xsl:value-of select=\"$AS1tooltip\"/>\n\t\t\t\t\t<xsl:text>' title='</xsl:text>\n\t\t\t\t\t<xsl:value-of select=\"$AS1tooltip\"/>\n\t\t\t\t</xsl:otherwise>\n\t\t\t</xsl:choose>\n\t\t</xsl:variable>\n\t\t<xsl:text disable-output-escaping=\"yes\">&lt;img src='</xsl:text>\n\t\t<xsl:call-template name=\"getBaseRef\">\n\t\t\t<xsl:with-param name=\"packageName\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t</xsl:call-template>\n\t\t<xsl:text>images/AS</xsl:text>\n\t\t<xsl:value-of select=\"$conditionalText\"/>\n\t\t<xsl:text>' width='96' height='15' style='margin-right:5px' /&gt;</xsl:text>\n\t</xsl:template>\n\t<xsl:template name=\"convertListing\">\n\t\t<xsl:param name=\"inText\" select=\"''\"/>\n\t\t<xsl:if test=\"not(contains($inText,'&lt;listing'))\">\n\t\t\t<xsl:value-of select=\"$inText\"/>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"contains($inText,'&lt;listing')\">\n\t\t\t<xsl:value-of select=\"substring-before($inText,'&lt;listing')\"/>\n\t\t\t<xsl:if test=\"$showASIcons='true'\">\n\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;div class='listingIcons'&gt;</xsl:text>\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"contains(substring-before($inText,'&lt;/listing&gt;'),'version=&quot;3')\">\n\t\t\t\t\t\t<xsl:call-template name=\"listingIcon\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"version\" select=\"3\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:when>\n\t\t\t\t\t<xsl:when test=\"contains(substring-before($inText,'&lt;/listing&gt;'),'version=&quot;2')\">\n\t\t\t\t\t\t<xsl:call-template name=\"listingIcon\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"version\" select=\"2\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:when>\n\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t<xsl:call-template name=\"listingIcon\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"version\" select=\"1\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t</xsl:choose>\n\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;/div&gt;</xsl:text>\n\t\t\t</xsl:if>\n\t\t\t<xsl:variable name=\"remainder\" select=\"substring-after(substring-after($inText,'&lt;listing'),'&gt;')\"/>\n\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;div class='listing'&gt;&lt;pre&gt;</xsl:text>\n\t\t\t<xsl:value-of select=\"substring-before($remainder,'&lt;/listing&gt;')\"/>\n\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;/pre&gt;&lt;/div&gt;</xsl:text>\n\t\t\t<xsl:call-template name=\"convertListing\">\n\t\t\t\t<xsl:with-param name=\"inText\" select=\"substring-after($remainder,'&lt;/listing&gt;')\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getKeywords\">\n\t\t<xsl:variable name=\"keywords\">\n\t\t\t<!-- TODO use defined keywords after scrub? -->\n\t\t\t<xsl:if test=\".//Xkeyword\">\n\t\t\t\t<xsl:for-each select=\".//keyword\">\n\t\t\t\t\t<xsl:value-of select=\"normalize-space()\"/>\n\t\t\t\t\t<xsl:text>, </xsl:text>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:if>\n\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t<xsl:if test=\"string-length(../apiName)\">\n\t\t\t\t<xsl:text>,</xsl:text>\n\t\t\t\t<xsl:call-template name=\"convertFullName\">\n\t\t\t\t\t<xsl:with-param name=\"fullname\" select=\"@id\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"apiValue\">\n\t\t\t\t<xsl:text>,</xsl:text>\n\t\t\t\t<xsl:for-each select=\"//apiValue\">\n\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t\t<xsl:if test=\"position() != last()\">\n\t\t\t\t\t\t<xsl:text>,</xsl:text>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"apiOperation\">\n\t\t\t\t<xsl:text>,</xsl:text>\n\t\t\t\t<xsl:for-each select=\"//apiOperation\">\n\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t\t<xsl:if test=\"position() != last()\">\n\t\t\t\t\t\t<xsl:text>,</xsl:text>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<meta name=\"keywords\" content=\"{$keywords}\"/>\n\t</xsl:template>\n\t<xsl:template name=\"convertClassifierLink\">\n\t\t<xsl:param name=\"fullname\"/>\n\t\t<xsl:variable name=\"className\">\n\t\t\t<xsl:if test=\"contains($fullname,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-after($fullname,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($fullname,':'))\">\n\t\t\t\t<xsl:value-of select=\"$fullname\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"packageName\">\n\t\t\t<xsl:if test=\"contains($fullname,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-before($fullname,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($fullname,':'))\">\n\t\t\t\t<xsl:value-of select=\"''\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"hyperLink\">\n\t\t\t<xsl:if test=\"string-length($packageName) &gt; 0 and string-length($className) &gt; 0\">\n\t\t\t\t<xsl:value-of select=\"concat('./',translate($packageName,'.','/'),'/',$className,'.html')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"string-length($packageName) = 0 and string-length($className) &gt; 0\">\n\t\t\t\t<xsl:value-of select=\"concat('./',$className,'.html')\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:value-of select=\"$hyperLink\"/>\n\t</xsl:template>\n\t<xsl:template name=\"convertFullName\">\n\t\t<xsl:param name=\"fullname\"/>\n\t\t<xsl:param name=\"separator\">.</xsl:param>\n\t\t<xsl:param name=\"justClass\">false</xsl:param>\n\t\t<xsl:variable name=\"trimmed\">\n\t\t\t<xsl:call-template name=\"search-and-replace\">\n\t\t\t\t<xsl:with-param name=\"input\" select=\"$fullname\"/>\n\t\t\t\t<xsl:with-param name=\"search-string\">:public</xsl:with-param>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"trimmed2\">\n\t\t\t<xsl:call-template name=\"search-and-replace\">\n\t\t\t\t<xsl:with-param name=\"input\" select=\"$trimmed\"/>\n\t\t\t\t<xsl:with-param name=\"search-string\">:internal</xsl:with-param>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"trimmed3\" select=\"translate($trimmed2,':','.')\"/>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"$justClass = 'true'\">\n\t\t\t\t<xsl:call-template name=\"substring-after-last\">\n\t\t\t\t\t<xsl:with-param name=\"input\" select=\"translate($trimmed3,'/','.')\"/>\n\t\t\t\t\t<xsl:with-param name=\"substr\">.</xsl:with-param>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:when>\n\t\t\t<xsl:when test=\"contains($trimmed3,'/')\">\n\t\t\t\t<!-- inner class -->\n\t\t\t\t<xsl:value-of select=\"translate(substring-before($trimmed3,'/'),'.',$separator)\"/>\n\t\t\t\t<xsl:text>.</xsl:text>\n\t\t\t\t<xsl:variable name=\"trimmed4\" select=\"substring-after($trimmed3,'/')\"/>\n\t\t\t\t<xsl:if test=\"contains($trimmed4,'.')\">\n\t\t\t\t\t<xsl:variable name=\"trimmed5\">\n\t\t\t\t\t\t<xsl:call-template name=\"substring-after-last\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"input\" select=\"$trimmed4\"/>\n\t\t\t\t\t\t\t<xsl:with-param name=\"substr\" select=\"'.'\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t<xsl:value-of select=\"translate($trimmed5,'.',$separator)\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(contains($trimmed4,'.'))\">\n\t\t\t\t\t<xsl:value-of select=\"translate($trimmed4,'.',$separator)\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:value-of select=\"translate($trimmed3,'.',$separator)\"/>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template name=\"buildInheritanceTree\">\n\t\t<xsl:param name=\"package\"/>\n\t\t<xsl:variable name=\"iconRef\">\n\t\t\t<xsl:call-template name=\"getBaseRef\">\n\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$package\"/>\n\t\t\t</xsl:call-template>\n\t\t\t<xsl:text>images/</xsl:text>\n\t\t\t<xsl:value-of select=\"$inheritanceIcon\"/>\n\t\t</xsl:variable>\n\t\t<pre>\n\t\t\t<script type=\"text/javascript\">var tabCount=3;</script>\n\t\t\t<xsl:variable name=\"objType\" select=\"@type\"/>\n\t\t\t<xsl:variable name=\"className\" select=\"@name\"/>\n\t\t\t<xsl:for-each select=\"asAncestors/asAncestor\">\n\t\t\t\t<xsl:sort select=\"position()\" order=\"descending\" data-type=\"number\"/>\n\t\t\t\t<!-- TODO remove hack when interfaces no longer inherit from Object and Object no longer inherits from itself -->\n\t\t\t\t<xsl:if test=\"(position()=1) and ($className!='Object')\">\n\t\t\t\t\t<a href=\"{classRef/@relativePath}\">\n\t\t\t\t\t\t<xsl:call-template name=\"convertFullName\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"fullname\" select=\"classRef/@fullName\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</a>\n\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\t<xsl:text>document.writeln();</xsl:text>\n\t\t\t\t\t</script>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"position()!=1\">\n\t\t\t\t\t<xsl:if test=\"$showInheritanceIcon='false'\">\n\t\t\t\t\t\t<script type=\"text/javascript\">for (var cnt=0; cnt &lt; tabCount; cnt++)document.write(\" \");document.writeln(\"|\");</script>\n\t\t\t\t\t\t<script type=\"text/javascript\">for (var cnt=0; cnt &lt; tabCount; cnt++)document.write(\" \");document.write(\"+--\");</script>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"$showInheritanceIcon='true'\">\n\t\t\t\t\t\t<script type=\"text/javascript\">for (var cnt=0; cnt &lt; tabCount; cnt++)document.write(\" \");document.write(\"&lt;img src='<xsl:value-of select=\"$iconRef\"/>' style='margin-top:1px' /&gt;\");document.write(\" \");\n\t\t\t\t\t\t</script>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<script type=\"text/javascript\">document.writeln(\"&lt;a href=\\\"<xsl:value-of select=\"translate(classRef/@relativePath,':','/')\"/>\\\"&gt;<xsl:call-template name=\"convertFullName\">\n\t\t\t\t\t\t<xsl:with-param name=\"fullname\" select=\"classRef/@fullName\"/>\n\t\t\t\t\t</xsl:call-template>&lt;/a&gt;\");</script>\n\t\t\t\t\t<script type=\"text/javascript\">tabCount+=5;</script>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:for-each>\n\t\t\t<xsl:choose>\n\t\t\t\t<xsl:when test=\"not(asAncestors/asAncestor)\">\n\t\t\t\t\t<script type=\"text/javascript\">var showInheritance = false;</script></xsl:when>\n\t\t\t\t<xsl:when test=\"@type = 'interface'\">\n\t\t\t\t\t<script type=\"text/javascript\">var showInheritance = true;</script>\n\t\t\t\t</xsl:when>\n\t\t\t\t<!-- TODO remove hack when Object no longer inherits from itself -->\n\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t<xsl:if test=\"@name != 'Object'\">\n\t\t\t\t\t\t<script type=\"text/javascript\">var showInheritance = true;</script>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"@name='Object'\">\n\t\t\t\t\t\t<script type=\"text/javascript\">var showInheritance = false;</script>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:otherwise>\n\t\t\t</xsl:choose>\n\t\t\t<xsl:if test=\"$showInheritanceIcon='false'\">\n\t\t\t\t<script type=\"text/javascript\">if (showInheritance) { for (var cnt=0; cnt &lt; tabCount; cnt++)document.write(\" \");document.writeln(\"|\");}</script>\n\t\t\t\t<script type=\"text/javascript\">if (showInheritance) { for (var cnt=0; cnt &lt; tabCount; cnt++)document.write(\" \");document.write(\"+--\");};</script>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"$showInheritanceIcon='true'\">\n\t\t\t\t<script type=\"text/javascript\">if (showInheritance) { for (var cnt=0; cnt &lt; tabCount; cnt++)document.write(\" \");document.write(\"&lt;img src='<xsl:value-of select=\"$iconRef\"/>' style='margin-top:1px' /&gt;\");document.write(\" \");};</script>\n\t\t\t</xsl:if>\n\t\t\t<script type=\"text/javascript\">document.writeln(\"<xsl:call-template name=\"convertFullName\"><xsl:with-param name=\"fullname\" select=\"@fullname\"/></xsl:call-template>\");</script>\n\t\t</pre>\n\t</xsl:template>\n\t<xsl:template name=\"sees\">\n\t\t<xsl:param name=\"currentPackage\" />\n\t\t<xsl:param name=\"labelClass\" select=\"'label'\"/>\n\t\t<xsl:param name=\"xrefId\">\n\t\t\t<xsl:choose>\n\t\t\t\t<xsl:when test=\"self::operator\">\n\t\t\t\t\t<xsl:text>operator#</xsl:text>\n\t\t\t\t</xsl:when>\n\t\t\t\t<xsl:when test=\"self::statement\">\n\t\t\t\t\t<xsl:text>statement#</xsl:text>\n\t\t\t\t</xsl:when>\n\t\t\t\t<xsl:when test=\"self::specialType\">\n\t\t\t\t\t<xsl:text>specialType#</xsl:text>\n\t\t\t\t</xsl:when>\n\t\t\t\t<xsl:when test=\"self::statements\">\n\t\t\t\t\t<xsl:text>statements</xsl:text>\n\t\t\t\t</xsl:when>\n\t\t\t\t<xsl:when test=\"self::operators\">\n\t\t\t\t\t<xsl:text>operators</xsl:text>\n\t\t\t\t</xsl:when>\n\t\t\t\t<xsl:when test=\"self::specialTypes\">\n\t\t\t\t\t<xsl:text>special-types</xsl:text>\n\t\t\t\t</xsl:when>\n\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t<xsl:if test=\"ancestor::apiPackage/apiName='__Global__' and not(ancestor-or-self::apiClassifier)\">\n\t\t\t\t\t\t<xsl:text>global</xsl:text>\n\t\t\t\t\t\t<xsl:if test=\"ancestor::apiClassifier\">\n\t\t\t\t\t\t\t<xsl:text>.</xsl:text>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"not(ancestor::apiPackage/apiName='__Global__')\">\n\t\t\t\t\t\t<xsl:value-of select=\"ancestor::apiPackage/apiName\"/>\n\t\t\t\t\t\t<xsl:if test=\"ancestor-or-self::apiClassifier\">\n\t\t\t\t\t\t\t<xsl:text>.</xsl:text>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"ancestor-or-self::apiClassifier\">\n\t\t\t\t\t\t<xsl:value-of select=\"ancestor::apiClassifier/apiName\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"self::apiConstructor\">\n\t\t\t\t\t\t\t<xsl:text>#method:</xsl:text>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:when test=\"self::apiOperation\">\n\t\t\t\t\t\t\t<xsl:text>#method:</xsl:text>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:when test=\"self::apiValue\">\n\t\t\t\t\t\t\t<xsl:text>#property:</xsl:text>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:when test=\"self::adobeApiEvent\">\n\t\t\t\t\t\t\t<xsl:text>#event:</xsl:text>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:when test=\"self::style\">\n\t\t\t\t\t\t\t<xsl:text>#style:</xsl:text>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:when test=\"self::effect\">\n\t\t\t\t\t\t\t<xsl:text>#effect:</xsl:text>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t</xsl:otherwise>\n\t\t\t</xsl:choose>\n\t\t\t<xsl:value-of select=\"apiName\"/>\n\t\t</xsl:param>\n\t\t<xsl:param name=\"packageName\">\n\t\t\t<xsl:if test=\"ancestor-or-self::apiPackage/apiName!='__Global__'\">\n\t\t\t\t<xsl:value-of select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:param>\n\t\t<xsl:variable name=\"numSees\" select=\"count(./related-links/link[normalize-space(./linktext) or @href])\"/>\n\t\t<xsl:if test=\"$numSees or $xrefs/helpreferences/helpreference[normalize-space(id/.)=$xrefId]\">\n\t\t\t<p>\n\t\t\t\t<span class=\"{$labelClass}\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'seeAlso']]/entry[2]/p\"/>\n\t\t\t\t</span>\n\t\t\t</p>\n\t\t\t<div class=\"seeAlso\">\n\t\t\t\t<xsl:for-each select=\"./related-links/link[string-length(@href) or string-length(./linktext)]\">\n\t\t\t\t\t<xsl:if test=\"string-length(@href) &gt; 0\">\n\t\t\t\t\t\t<!-- Get the method name -->\n\t\t\t\t\t\t<xsl:variable name=\"methodNameText\" select=\"substring-after(@href,'/')\"/>\n\t\t\t\t\t\t<!-- Get the Classname name -->\n\t\t\t\t\t\t<xsl:variable name=\"classNameText\">\n\t\t\t\t\t\t\t<xsl:if test=\"contains(@href,'/')\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring-before(substring-after(@href,'#'),'/')\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"not(contains(@href,'/'))\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring-after(@href,'#')\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t<xsl:variable name=\"className\">\n\t\t\t\t\t\t\t<xsl:if test=\"string-length($classNameText) &gt; 0\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$classNameText\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"string-length($classNameText) = 0\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"ancestor-or-self::apiClassifier/apiName\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t<!-- Get the package name -->\n\t\t\t\t\t\t<xsl:variable name=\"packName\">\n\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t<xsl:when test=\"contains(@href,'.xml.xml')\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains(@href,'#')\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring(substring-before(@href,'#'),0,string-length(substring-before(@href,'#'))-string-length('.xml')+1)\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains(@href,'#')) and not(contains(@href,'/')) and not(contains(@href,'.htm'))\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring(@href,0,string-length(@href)-string-length('.xml')+1)\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains(@href,'#')\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring-before(substring-before(@href,'#'),'.xml')\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains(@href,'#')) and not(contains(@href,'/')) and not(contains(@href,'.htm'))\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring-before(@href,'.xml')\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t<xsl:variable name=\"hyperlinkLocation\">\n\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t<xsl:when test=\"contains(@href,'.htm') or starts-with(@href,'http://')\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@href\"/>\n\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($packName) &gt; 0 and not($packName=ancestor-or-self::apiPackage/apiName) and  not(contains(@href,'.htm'))\">\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"relPathParam\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"ancestor-or-self::apiPackage/apiName\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(ancestor-or-self::apiPackage/apiName)\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$currentPackage\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"relPath\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getRelativePath\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"currentPath\" select=\"$relPathParam\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($classNameText) &gt; 0\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($methodNameText) &gt; 0 \">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($relPath,translate($packName,'.','/'),'/',$classNameText,'.html#',$methodNameText)\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($methodNameText) = 0\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($relPath,translate($packName,'.','/'),'/',$classNameText,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($classNameText) = 0\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($methodNameText) &gt; 0 \">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($relPath,translate($packName,'.','/'),'/','package.html#',$methodNameText)\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($methodNameText) = 0\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($relPath,translate($packName,'.','/'),'/','package-detail.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"(string-length($packName) = 0 or  ($packName=ancestor-or-self::apiPackage/apiName)) and not(contains(@href,'.htm'))\">\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($classNameText) &gt; 0 and not($classNameText='global') and string-length($packName) != 0 \">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($methodNameText) &gt; 0\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($classNameText,'.html#',$methodNameText)\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($methodNameText) = 0\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($classNameText,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<!-- To handle the <#Array/sort() kind of stuff in a package>-->\n\t\t\t\t\t\t\t\t\t\t<xsl:if\n\t\t\t\t\t\t\t\t\t\t\ttest=\"string-length($classNameText) &gt; 0 and not($classNameText='global') and (string-length(ancestor-or-self::apiPackage/apiName) &gt; 0 or string-length($currentPackage) &gt; 0)and string-length($packName) = 0 \">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"relPathParam\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"ancestor-or-self::apiPackage/apiName\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(ancestor-or-self::apiPackage/apiName)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$currentPackage\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"relPath\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($relPathParam,'.')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getRelativePath\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"currentPath\" select=\"$relPathParam\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($methodNameText) &gt; 0\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($relPath,$classNameText,'.html#',$methodNameText)\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($methodNameText) = 0\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($relPath,$classNameText,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($classNameText) &gt; 0 and $classNameText='global'\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"relPathParam\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"ancestor-or-self::apiPackage/apiName\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(ancestor-or-self::apiPackage/apiName)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$currentPackage\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"relPath\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($relPathParam,'.')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getRelativePath\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"currentPath\" select=\"$relPathParam\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($methodNameText) &gt; 0\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($relPath,'package.html#',$methodNameText)\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($classNameText) = 0\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($packName) &gt; 0\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat('package.html#',$methodNameText)\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($packName) = 0\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat('#',$methodNameText)\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t<xsl:variable name=\"linktxt\" select=\"./linktext\"/>\n\t\t\t\t\t\t<xsl:if test=\"$prog_language_name!='javascript'\">\n\t\t\t\t\t\t\t<a href=\"{$hyperlinkLocation}\">\n\t\t\t\t\t\t\t\t<xsl:attribute name=\"target\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"starts-with(@href,'http:')\">\n\t\t\t\t\t\t\t\t\t\t<xsl:text>_top</xsl:text>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains(@href,'../help/')\">\n\t\t\t\t\t\t\t\t\t\t<xsl:text>_top</xsl:text>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:attribute>\n\t\t\t\t\t\t\t\t<xsl:if test=\"normalize-space(./linktext)\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"normalize-space(./linktext)\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"not(normalize-space(./linktext))\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@href\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"$prog_language_name!='javascript'\">\n\t\t\t\t\t\t<xsl:if test=\"not(string-length(@href)) and string-length(./linktext) &gt; 0\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"normalize-space(./linktext)\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"position() != last()\">\n\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:for-each>\n\t\t\t\t<xsl:variable name=\"baseRef\">\n\t\t\t\t\t<xsl:call-template name=\"getBaseRef\">\n\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$packageName\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<xsl:for-each select=\"$xrefs/helpreferences/helpreference[normalize-space(id/.)=$xrefId]\">\n\t\t\t\t\t<xsl:if test=\"position()=1 and $numSees\">\n\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:element name=\"a\">\n\t\t\t\t\t\t<xsl:attribute name=\"href\">\n\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t<xsl:when test=\"not(bookfolder) or bookfolder=''\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($baseRef,$config/xrefs/@baseRef,href/.)\"/>\n\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($baseRef,$config/xrefs/@baseRef,bookfolder/text(),'/',href/.)\"/>\n\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t</xsl:attribute>\n\t\t\t\t\t\t<xsl:if test=\"string-length($config/xrefs/@target)\">\n\t\t\t\t\t\t\t<xsl:attribute name=\"target\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$config/xrefs/@target\"/>\n\t\t\t\t\t\t\t</xsl:attribute>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:variable name=\"titletext\" select=\"replace(title/.,'&lt;/','&amp;lt;/')\"/>\n\t\t\t\t\t\t<xsl:value-of select=\"$titletext\"/>\n\t\t\t\t\t</xsl:element>\n\t\t\t\t\t<xsl:if test=\"position() != last()\">\n\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:for-each>\n\t\t\t</div>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getInheritDocText\">\n\t\t<xsl:param name=\"baseClass\"/>\n\t\t<xsl:param name=\"implementedInterface\"/>\n\t\t<xsl:param name=\"descriptionType\"/>\n\t\t<xsl:param name=\"entryType\"/>\n\t\t<xsl:param name=\"nameToMatch\"/>\n\t\t<xsl:param name=\"itemNameToMatch\"/>\n\t\t<xsl:param name=\"doNotProcessTags\" select=\"false()\"/>\n\t\t<xsl:for-each select=\"ancestor::apiClassifier/apiClassifierDetail/apiClassifierDef/apiBaseInterface\">\n\t\t\t<xsl:call-template name=\"inheritDocFromInterfaces\">\n\t\t\t\t<xsl:with-param name=\"implementedInterface\" select=\".\"/>\n\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"$descriptionType\"/>\n\t\t\t\t<xsl:with-param name=\"entryType\" select=\"$entryType\"/>\n\t\t\t\t<xsl:with-param name=\"nameToMatch\" select=\"$nameToMatch\"/>\n\t\t\t\t<xsl:with-param name=\"doNotProcessTags\" select=\"$doNotProcessTags\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:for-each>\n\t\t<xsl:call-template name=\"inheritDocFromBaseClass\">\n\t\t\t<xsl:with-param name=\"baseClass\" select=\"$baseClass\"/>\n\t\t\t<xsl:with-param name=\"descriptionType\" select=\"$descriptionType\"/>\n\t\t\t<xsl:with-param name=\"entryType\" select=\"$entryType\"/>\n\t\t\t<xsl:with-param name=\"nameToMatch\" select=\"$nameToMatch\"/>\n\t\t\t<xsl:with-param name=\"itemNameToMatch\" select=\"$itemNameToMatch\"/>\n\t\t\t<xsl:with-param name=\"doNotProcessTags\" select=\"$doNotProcessTags\"/>\n\t\t</xsl:call-template>\n\t</xsl:template>\n\t<xsl:template name=\"inheritDocFromInterfaces\">\n\t\t<xsl:param name=\"implementedInterface\"/>\n\t\t<xsl:param name=\"descriptionType\"/>\n\t\t<xsl:param name=\"entryType\"/>\n\t\t<xsl:param name=\"nameToMatch\"/>\n\t\t<xsl:param name=\"doNotProcessTags\" select=\"false()\"/>\n\t\t<xsl:for-each select=\"$implementedInterface\">\n\t\t\t<xsl:variable name=\"baseClass\" select=\".\"/>\n\t\t\t<xsl:variable name=\"className\">\n\t\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t\t<xsl:value-of select=\"substring-after($baseClass,':')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t\t<xsl:value-of select=\"$baseClass\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"packageName\">\n\t\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t\t<xsl:value-of select=\"substring-before($baseClass,':')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t\t<xsl:value-of select=\"__Global__\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"xslDocPath\">\n\t\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t\t<xsl:value-of select=\"concat($ditaFileDir,substring-before($baseClass,':'),'.xml')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t\t<xsl:value-of select=\"concat($ditaFileDir,'__Global__.xml')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:choose>\n\t\t\t\t<xsl:when test=\"$entryType='apiClassifier'\">\n\t\t\t\t\t<xsl:for-each select=\"document($xslDocPath)/apiPackage/apiClassifier[apiName=$nameToMatch and apiClassifierDetail/apiClassifierDef/apiInterface]\">\n\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t<xsl:when test=\"$descriptionType='shortdesc'\">\n\t\t\t\t\t\t\t\t<xsl:for-each select=\"./shortdesc\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not ($doNotProcessTags)\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"addParagraphTags\" select=\"false()\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t<xsl:when test=\"$descriptionType='apiDesc'\">\n\t\t\t\t\t\t\t\t<xsl:for-each select=\"./apiClassifierDetail/apiDesc\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not ($doNotProcessTags)\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"addParagraphTags\" select=\"true()\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t</xsl:for-each>\n\t\t\t\t</xsl:when>\n\t\t\t\t<xsl:when test=\"$entryType='apiOperation'\">\n\t\t\t\t\t<xsl:for-each select=\"document($xslDocPath)/apiPackage/apiClassifier[apiName=$className and  apiClassifierDetail/apiClassifierDef/apiInterface]/apiOperation[apiName=$nameToMatch]\">\n\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t<xsl:when test=\"$descriptionType='shortdesc'\">\n\t\t\t\t\t\t\t\t<xsl:for-each select=\"./shortdesc\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not ($doNotProcessTags)\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"addParagraphTags\" select=\"false()\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t<xsl:when test=\"$descriptionType='apiDesc'\">\n\t\t\t\t\t\t\t\t<xsl:for-each select=\"./apiOperationDetail/apiDesc\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not ($doNotProcessTags)\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"addParagraphTags\" select=\"true()\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t</xsl:for-each>\n\t\t\t\t</xsl:when>\n\t\t\t\t<xsl:when test=\"$entryType='apiValue'\">\n\t\t\t\t\t<xsl:for-each select=\"document($xslDocPath)/apiPackage/apiClassifier[apiName=$className and apiClassifierDetail/apiClassifierDef/apiInterface]/apiValue[apiName=$nameToMatch]\">\n\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t<xsl:when test=\"$descriptionType='shortdesc'\">\n\t\t\t\t\t\t\t\t<xsl:for-each select=\"./shortdesc\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not ($doNotProcessTags)\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"addParagraphTags\" select=\"false()\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t<xsl:when test=\"$descriptionType='apiDesc'\">\n\t\t\t\t\t\t\t\t<xsl:for-each select=\"./apiValueDetail/apiDesc\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not ($doNotProcessTags)\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"addParagraphTags\" select=\"true()\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t</xsl:for-each>\n\t\t\t\t</xsl:when>\n\t\t\t</xsl:choose>\n\t\t\t<!-- Now process the base interface of the current interface-->\n\t\t\t<xsl:for-each select=\"document($xslDocPath)/apiPackage/apiClassifier[apiName=$className]/apiClassifierDetail/apiClassifierDef/apiBaseInterface\">\n\t\t\t\t<xsl:call-template name=\"inheritDocFromInterfaces\">\n\t\t\t\t\t<xsl:with-param name=\"implementedInterface\" select=\".\"/>\n\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"$descriptionType\"/>\n\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"$entryType\"/>\n\t\t\t\t\t<xsl:with-param name=\"nameToMatch\" select=\"$nameToMatch\"/>\n\t\t\t\t\t<xsl:with-param name=\"doNotProcessTags\" select=\"$doNotProcessTags\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:for-each>\n\t\t</xsl:for-each>\n\t</xsl:template>\n\t<xsl:template name=\"inheritDocFromBaseClass\">\n\t\t<xsl:param name=\"baseClass\"/>\n\t\t<xsl:param name=\"descriptionType\"/>\n\t\t<xsl:param name=\"entryType\"/>\n\t\t<xsl:param name=\"nameToMatch\"/>\n\t\t<xsl:param name=\"itemNameToMatch\"/>\n\t\t<xsl:param name=\"doNotProcessTags\" select=\"false()\"/>\n\t\t<xsl:variable name=\"className\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-after($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"$baseClass\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"packageName\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-before($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"__Global__\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"xslDocPath\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"concat($ditaFileDir,substring-before($baseClass,':'),'.xml')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"concat($ditaFileDir,'__Global__.xml')\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"$entryType='apiClassifier'\">\n\t\t\t\t<xsl:for-each select=\"document($xslDocPath)/apiPackage/apiClassifier[apiName=$nameToMatch and not(apiClassifierDetail/apiClassifierDef/apiInterface)]\">\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"$descriptionType='shortdesc'\">\n\t\t\t\t\t\t\t<xsl:for-each select=\"./shortdesc\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"not ($doNotProcessTags)\">\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"addParagraphTags\" select=\"false()\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:when test=\"$descriptionType='apiDesc'\">\n\t\t\t\t\t\t\t<xsl:for-each select=\"./apiClassifierDetail/apiDesc\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"not ($doNotProcessTags)\">\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"addParagraphTags\" select=\"true()\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:when>\n\t\t\t<xsl:when test=\"$entryType='apiOperation'\">\n\t\t\t\t<xsl:for-each select=\"document($xslDocPath)/apiPackage/apiClassifier[apiName=$className and not(apiClassifierDetail/apiClassifierDef/apiInterface)]/apiOperation[apiName=$nameToMatch]\">\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"$descriptionType='shortdesc'\">\n\t\t\t\t\t\t\t<xsl:for-each select=\"./shortdesc\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"not ($doNotProcessTags)\">\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"addParagraphTags\" select=\"false()\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:when test=\"$descriptionType='apiDesc'\">\n\t\t\t\t\t\t\t<xsl:for-each select=\"./apiOperationDetail/apiDesc\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"not ($doNotProcessTags)\">\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"addParagraphTags\" select=\"false()\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:when>\n\t\t\t<xsl:when test=\"$entryType='apiValue'\">\n\t\t\t\t<xsl:for-each select=\"document($xslDocPath)/apiPackage/apiClassifier[apiName=$className and not(apiClassifierDetail/apiClassifierDef/apiInterface)]/apiValue[apiName=$nameToMatch]\">\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"$descriptionType='shortdesc'\">\n\t\t\t\t\t\t\t<xsl:for-each select=\"./shortdesc\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"not ($doNotProcessTags)\">\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"addParagraphTags\" select=\"false()\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:when test=\"$descriptionType='apiDesc'\">\n\t\t\t\t\t\t\t<xsl:for-each select=\"./apiValueDetail/apiDesc\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"not ($doNotProcessTags)\">\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"addParagraphTags\" select=\"true()\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:when>\n\t\t\t<xsl:when test=\"$entryType='apiParam'\">\n\t\t\t\t<xsl:for-each\n\t\t\t\t\tselect=\"document($xslDocPath)/apiPackage/apiClassifier[apiName=$className and not(apiClassifierDetail/apiClassifierDef/apiInterface)]/apiOperation[apiName=$nameToMatch]/apiOperationDetail/apiOperationDef/apiParam[apiItemName=$itemNameToMatch]\">\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"$descriptionType='shortdesc'\">\n\t\t\t\t\t\t\t<xsl:for-each select=\"./shortdesc\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"not ($doNotProcessTags)\">\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"addParagraphTags\" select=\"false()\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:when test=\"$descriptionType='apiDesc'\">\n\t\t\t\t\t\t\t<xsl:for-each select=\"./apiDesc\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"not ($doNotProcessTags)\">\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"addParagraphTags\" select=\"false()\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:when>\n\t\t\t<xsl:when test=\"$entryType='apiReturn'\">\n\t\t\t\t<xsl:for-each\n\t\t\t\t\tselect=\"document($xslDocPath)/apiPackage/apiClassifier[apiName=$className and not(apiClassifierDetail/apiClassifierDef/apiInterface)]/apiOperation[apiName=$nameToMatch]/apiOperationDetail/apiOperationDef/apiReturn\">\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"$descriptionType='shortdesc'\">\n\t\t\t\t\t\t\t<xsl:for-each select=\"./shortdesc\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"not ($doNotProcessTags)\">\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"addParagraphTags\" select=\"false()\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:when test=\"$descriptionType='apiDesc'\">\n\t\t\t\t\t\t\t<xsl:for-each select=\"./apiDesc\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"$doNotProcessTags\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"not ($doNotProcessTags)\">\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"addParagraphTags\" select=\"false()\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:when>\n\t\t</xsl:choose>\n\t\t<xsl:if test=\"not($className='Object')\">\n\t\t\t<xsl:variable name=\"newBaseClass\"\n\t\t\t\tselect=\"document($xslDocPath)/apiPackage/apiClassifier[apiName=$className and not(apiClassifierDetail/apiClassifierDef/apiInterface)]/apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t<xsl:if test=\"string-length($newBaseClass) &gt; 0\">\n\t\t\t\t<xsl:call-template name=\"inheritDocFromBaseClass\">\n\t\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"$newBaseClass\"/>\n\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"$descriptionType\"/>\n\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"$entryType\"/>\n\t\t\t\t\t<xsl:with-param name=\"nameToMatch\" select=\"$nameToMatch\"/>\n\t\t\t\t\t<xsl:with-param name=\"itemNameToMatch\" select=\"$itemNameToMatch\"/>\n\t\t\t\t\t<xsl:with-param name=\"doNotProcessTags\" select=\"$doNotProcessTags\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:if>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getSimpleClassName\">\n\t\t<xsl:param name=\"fullClassName\"/>\n\t\t<xsl:param name=\"baseRef\"/>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"contains($fullClassName,':') and not(contains($fullClassName,'Vector$'))\">\n\t\t\t\t<xsl:call-template name=\"substring-after-last\">\n\t\t\t\t\t<xsl:with-param name=\"input\" select=\"$fullClassName\"/>\n\t\t\t\t\t<xsl:with-param name=\"substr\" select=\"':'\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:when>\n\t\t\t<xsl:when test=\"contains($fullClassName,'.') and not(contains($fullClassName,'Vector$'))\">\n\t\t\t\t<xsl:call-template name=\"substring-after-last\">\n\t\t\t\t\t<xsl:with-param name=\"input\" select=\"$fullClassName\"/>\n\t\t\t\t\t<xsl:with-param name=\"substr\" select=\"'.'\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<!-- Vector  -->\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"contains($fullClassName,'Vector$')\">\n\t\t\t\t\t\t<xsl:variable name=\"vector.link\" select=\"$fullClassName\"/>\n\t\t\t\t\t\t<xsl:if test=\"not(contains($fullClassName,'*'))\">\n\t\t\t\t\t\t\t<xsl:variable name=\"bef.vec\" select=\"substring-before($fullClassName,'$')\"/>\n\t\t\t\t\t\t\t<xsl:variable name=\"aft.vec\" select=\"substring-after($fullClassName,'$')\"/>\n\t\t\t\t\t\t\t<xsl:variable name=\"bef.vec.file\" select=\"concat($baseRef,$bef.vec,'.html')\"/>\n\t\t\t\t\t\t\t<xsl:variable name=\"aft.vec.aft\" select=\"substring-after($aft.vec,':')\"/>\n\t\t\t\t\t\t\t<xsl:variable name=\"aft.vec.bef\" select=\"substring-before($aft.vec,':')\"/>\n\t\t\t\t\t\t\t<xsl:variable name=\"aft.vec.file\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"contains($aft.vec,':')\">\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"aft.vec.bef\" select=\"substring-before($aft.vec,':')\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"aft.vec.aft\" select=\"substring-after($aft.vec,':')\"/>\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($baseRef,translate($aft.vec.bef,'.','/'),'/',$aft.vec.aft,'.html')\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($aft.vec,':'))\">\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"aft.vec.file\" select=\"concat($baseRef,$aft.vec,'.html')\"/>\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$aft.vec.file\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t<xsl:if test=\"count($class.File.Name[apiName[.=$bef.vec]] ) &gt; 0\">\n\t\t\t\t\t\t\t\t<a href=\"{$bef.vec.file}\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$bef.vec\"/>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"count($class.File.Name[apiName[.=$bef.vec]]) = 0\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$bef.vec\"/>\n\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:text>.</xsl:text>\n\t\t\t\t\t\t\t<xsl:text>&amp;lt;</xsl:text>\n\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t<!-- Matched ID's -->\n\t\t\t\t\t\t\t\t<xsl:when test=\"$class.File.Name[apiName[.=$aft.vec]]\">\n\t\t\t\t\t\t\t\t\t<a href=\"{$aft.vec.file}\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$aft.vec\"/>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t<xsl:when test=\"$class.File.Name[@id=$aft.vec and apiName[.=$aft.vec.aft]]\">\n\t\t\t\t\t\t\t\t\t<a href=\"{$aft.vec.file}\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$aft.vec.aft\"/>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t<!-- Non-Matched ID's -->\n\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($aft.vec,':')\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$aft.vec.aft\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($aft.vec,':'))\">\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($aft.vec,'$')\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"$aft.vec\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($aft.vec,'$'))\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$aft.vec\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t<xsl:text>&amp;gt;</xsl:text>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<!-- Vector: Special Types -->\n\t\t\t\t\t\t<xsl:if test=\"contains($fullClassName,'Vector$*')\">\n\t\t\t\t\t\t\t<xsl:variable name=\"bef.vec\" select=\"substring-before($fullClassName,'$')\"/>\n\t\t\t\t\t\t\t<xsl:variable name=\"aft.vec\" select=\"substring-after($fullClassName,'$')\"/>\n\t\t\t\t\t\t\t<xsl:variable name=\"bef.vec.file\" select=\"concat($baseRef,$bef.vec,'.html')\"/>\n\t\t\t\t\t\t\t<xsl:variable name=\"aft.vec.file\" select=\"concat($baseRef,$aft.vec,'.html')\"/>\n\t\t\t\t\t\t\t<a href=\"{$bef.vec.file}\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$bef.vec\"/>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t<xsl:text>.</xsl:text>\n\t\t\t\t\t\t\t<xsl:text>&amp;lt;</xsl:text>\n\t\t\t\t\t\t\t<xsl:call-template name=\"getSpecialTypeLink\">\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"type\" select=\"'*'\"/>\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t<xsl:text>&amp;gt;</xsl:text>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:when>\n\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t<xsl:value-of select=\"$fullClassName\"/>\n\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t</xsl:choose>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template name=\"getSpecialTypeLink\">\n\t\t<xsl:param name=\"type\"/>\n\t\t<xsl:param name=\"baseRef\">\n\t\t\t<xsl:call-template name=\"getBaseRef\">\n\t\t\t\t<xsl:with-param name=\"packageName\">\n\t\t\t\t\t<xsl:if test=\"ancestor::apiClassifier\">\n\t\t\t\t\t\t<xsl:value-of select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"not(ancestor::apiClassifier)\">\n\t\t\t\t\t\t<xsl:value-of select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:with-param>\n\t\t\t</xsl:call-template>\n\t\t</xsl:param>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"$config/languageElements[@show='true' and @specialTypes='true']\">\n\t\t\t\t<a href=\"{$baseRef}specialTypes.html#{$type}\">\n\t\t\t\t\t<xsl:value-of select=\"$type\"/>\n\t\t\t\t</a>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:value-of select=\"$type\"/>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:variable name=\"deprecatedLabel\">\n\t\t<b>\n\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Deprecated']]/entry[2]/p\"/>\n\t\t</b>\n\t</xsl:variable>\n\t<xsl:template match=\"deprecated\">\n\t\t<xsl:param name=\"showDescription\" select=\"'true'\"/>\n\t\t<xsl:copy-of select=\"$deprecatedLabel\"/>\n\t\t<xsl:if test=\"string-length(@as-of)\">\n\t\t\t<xsl:text> since </xsl:text>\n\t\t\t<xsl:value-of select=\"normalize-space(@as-of)\"/>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"$showDescription='true' and string-length(normalize-space())\">\n\t\t\t<xsl:value-of select=\"$emdash\"/>\n\t\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t\t<xsl:with-param name=\"inText\" select=\"normalize-space()\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"$showDescription!='true' or not(string-length(normalize-space()))\">\n\t\t\t<xsl:text>.</xsl:text>\n\t\t</xsl:if>\n\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t</xsl:template>\n\t<xsl:template match=\"item\" mode=\"annotate\">\n\t\t<xsl:for-each select=\"annotation\">\n\t\t\t<xsl:choose>\n\t\t\t\t<xsl:when test=\"@type='text'\">\n\t\t\t\t\t<div class=\"annotation\">\n\t\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\".\"/>\n\t\t\t\t\t</div>\n\t\t\t\t</xsl:when>\n\t\t\t</xsl:choose>\n\t\t</xsl:for-each>\n\t</xsl:template>\n\t<xsl:template name=\"shortDescriptionReview\">\n\t\t<xsl:variable name=\"asCustomsText\">\n\t\t\t<xsl:value-of select=\"./prolog/asCustoms/review\"/>\n\t\t</xsl:variable>\n\t\t<xsl:if test=\"string-length($asCustomsText) &gt; 0\">\n\t\t\t<xsl:if test=\"$asCustomsText and $config/options/@showReview='true'\">\n\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t<font color=\"red\">Review Needed.<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t</font>\n\t\t\t</xsl:if>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getPageTitlePostFix\">\n\t\t<xsl:if test=\"string-length($config/pageTitlePostFix/.)\">\n\t\t\t<xsl:text> </xsl:text>\n\t\t\t<xsl:value-of select=\"$config/pageTitlePostFix/.\"/>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"addKeywords\">\n\t\t<xsl:param name=\"keyword\"/>\n\t\t<xsl:param name=\"num\" select=\"$config/keywords/@num\"/>\n\t\t<xsl:if test=\"$config/keywords[@show='true'] and $keyword\">\n\t\t\t<div style=\"display:none\">\n\t\t\t\t<xsl:call-template name=\"duplicateString\">\n\t\t\t\t\t<xsl:with-param name=\"input\" select=\"concat($keyword,' ')\"/>\n\t\t\t\t\t<xsl:with-param name=\"count\" select=\"$num\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</div>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"duplicateString\">\n\t\t<xsl:param name=\"input\"/>\n\t\t<xsl:param name=\"count\" select=\"1\"/>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"not($count) or not($input)\"/>\n\t\t\t<xsl:when test=\"$count=1\">\n\t\t\t\t<xsl:value-of select=\"$input\"/>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:if test=\"$count mod 2\">\n\t\t\t\t\t<xsl:value-of select=\"$input\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:call-template name=\"duplicateString\">\n\t\t\t\t\t<xsl:with-param name=\"input\" select=\"concat($input,$input)\"/>\n\t\t\t\t\t<xsl:with-param name=\"count\" select=\"floor($count div 2)\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template name=\"substring-before-last\">\n\t\t<xsl:param name=\"input\"/>\n\t\t<xsl:param name=\"substr\"/>\n\t\t<xsl:if test=\"$substr and contains($input,$substr)\">\n\t\t\t<xsl:variable name=\"tmp\" select=\"substring-after($input,$substr)\"/>\n\t\t\t<xsl:value-of select=\"substring-before($input,$substr)\"/>\n\t\t\t<xsl:if test=\"contains($tmp,$substr)\">\n\t\t\t\t<xsl:value-of select=\"$substr\"/>\n\t\t\t\t<xsl:call-template name=\"substring-before-last\">\n\t\t\t\t\t<xsl:with-param name=\"input\" select=\"$tmp\"/>\n\t\t\t\t\t<xsl:with-param name=\"substr\" select=\"$substr\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:if>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"substring-after-last\">\n\t\t<xsl:param name=\"input\"/>\n\t\t<xsl:param name=\"substr\"/>\n\t\t<xsl:variable name=\"tmp\" select=\"substring-after($input,$substr)\"/>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"$substr and contains($tmp,$substr)\">\n\t\t\t\t<xsl:call-template name=\"substring-after-last\">\n\t\t\t\t\t<xsl:with-param name=\"input\" select=\"$tmp\"/>\n\t\t\t\t\t<xsl:with-param name=\"substr\" select=\"$substr\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:value-of select=\"$tmp\"/>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template name=\"search-and-replace\">\n\t\t<xsl:param name=\"input\"/>\n\t\t<xsl:param name=\"search-string\"/>\n\t\t<xsl:param name=\"replace-string\"/>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"$search-string and contains($input,$search-string)\">\n\t\t\t\t<xsl:value-of select=\"substring-before($input,$search-string)\"/>\n\t\t\t\t<xsl:value-of select=\"$replace-string\"/>\n\t\t\t\t<xsl:call-template name=\"search-and-replace\">\n\t\t\t\t\t<xsl:with-param name=\"input\" select=\"substring-after($input,$search-string)\"/>\n\t\t\t\t\t<xsl:with-param name=\"search-string\" select=\"$search-string\"/>\n\t\t\t\t\t<xsl:with-param name=\"replace-string\" select=\"$replace-string\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:value-of select=\"$input\" disable-output-escaping=\"no\"/>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template match=\"p\" mode=\"terms\">\n\t\t<xsl:param name=\"class\"/>\n\t\t<xsl:param name=\"package\"/>\n\t\t<xsl:param name=\"as-of\"/>\n\t\t<xsl:param name=\"type\"/>\n\t\t<xsl:param name=\"value\"/>\n\t\t<xsl:apply-templates mode=\"terms\">\n\t\t\t<xsl:with-param name=\"class\" select=\"$class\"/>\n\t\t\t<xsl:with-param name=\"package\" select=\"$package\"/>\n\t\t\t<xsl:with-param name=\"as-of\" select=\"$as-of\"/>\n\t\t\t<xsl:with-param name=\"type\" select=\"$type\"/>\n\t\t\t<xsl:with-param name=\"value\" select=\"$value\"/>\n\t\t</xsl:apply-templates>\n\t</xsl:template>\n\t<xsl:template match=\"class\" mode=\"terms\">\n\t\t<xsl:param name=\"class\"/>\n\t\t<xsl:value-of select=\"$class\"/>\n\t</xsl:template>\n\t<xsl:template match=\"package\" mode=\"terms\">\n\t\t<xsl:param name=\"package\"/>\n\t\t<xsl:value-of select=\"$package\"/>\n\t</xsl:template>\n\t<xsl:template match=\"as-of\" mode=\"terms\">\n\t\t<xsl:param name=\"as-of\"/>\n\t\t<xsl:value-of select=\"$as-of\"/>\n\t</xsl:template>\n\t<xsl:template match=\"type\" mode=\"terms\">\n\t\t<xsl:param name=\"type\"/>\n\t\t<xsl:value-of select=\"$type\"/>\n\t</xsl:template>\n\t<xsl:template match=\"value\" mode=\"terms\">\n\t\t<xsl:param name=\"value\"/>\n\t\t<xsl:value-of select=\"$value\"/>\n\t</xsl:template>\n\t<xsl:template match=\"* | @*\" mode=\"terms\" priority=\"-1\">\n\t\t<xsl:copy>\n\t\t\t<xsl:apply-templates mode=\"terms\"/>\n\t\t</xsl:copy>\n\t</xsl:template>\n\t<xsl:template name=\"getLocalizedString\">\n\t\t<xsl:param name=\"key\"/>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"$asdoc_terms/row[entry[1][p/text() = $key]]/entry[2]/p\">\n\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = $key]]/entry[2]/p\"/>\n\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:value-of select=\"$key\"/>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template name=\"getAppendixLocalizedString\">\n\t\t<xsl:param name=\"key\"/>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"$asdoc_terms/row[entry[1][p/text() = $key]]/entry[2]/p\">\n\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = $key]]/entry[2]/p\"/>\n\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t<xsl:value-of select=\"$config/appendixes/appendix[@overview=$key]/@label\"/>\n\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<!-- For HTML Processing-->\n\t<xsl:template name=\"processTags\">\n\t\t<xsl:param name=\"addParagraphTags\" select=\"false()\"/>\n\t\t<xsl:param name=\"createLinkFromRootContext\" select=\"false()\"/>\n\t\t<xsl:param name=\"event\"/>\n\t\t<xsl:variable name=\"matchHTML\" select=\"./adobetable |  ./ol |  ./p | ./codeblock |  ./ul |  ./b |  ./adobeimage | ./ph |  ./codeph | ./bold | ./strong |  ./em |  ./i |  ./xref | ./pre | ./text() | ./li| ./sup\"/>\n\t\t<xsl:for-each select=\"$matchHTML\">\n\t\t\t<xsl:if test=\"self::text()\">\n\t\t\t\t<xsl:if test=\"$addParagraphTags\">\n\t\t\t\t\t<xsl:if test=\"position()=1\">\n\t\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;p&gt;'\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:variable name=\"text\">\n\t\t\t\t\t<xsl:if test=\"contains(.,'~~')\">\n\t\t\t\t\t\t<xsl:call-template name=\"search-and-replace\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"search-string\" select=\"'~~'\"/>\n\t\t\t\t\t\t\t<xsl:with-param name=\"replace-string\" select=\"'*'\"/>\n\t\t\t\t\t\t\t<xsl:with-param name=\"input\" select=\".\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"not(contains(.,'~~'))\">\n\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<xsl:variable name=\"retext\" select=\"replace($text,'&lt;mx','&amp;lt;mx')\"/>\n\t\t\t\t<xsl:variable name=\"re.text\" select=\"replace($retext,'&lt;','&amp;lt;')\"/>\n\t\t\t\t<xsl:if test=\"$event!='eventdesc'\">\n\t\t\t\t\t<xsl:value-of select=\"replace($re.text,'&lt;/mx','&amp;lt;/mx')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$event='eventdesc'\">\n\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$addParagraphTags\">\n\t\t\t\t\t<xsl:if test=\"position()=last()\">\n\t\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;/p&gt;'\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"self::codeblock\">\n\t\t\t\t<xsl:apply-templates select=\".\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"self::ol | self::ul\">\n\t\t\t\t<xsl:apply-templates select=\".\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"self::li\">\n\t\t\t\t<xsl:apply-templates select=\".\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"self::p\">\n\t\t\t\t<xsl:apply-templates select=\".\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"self::b | self::bold | self::strong\">\n\t\t\t\t<xsl:apply-templates select=\".\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"self::adobetable\">\n\t\t\t\t<xsl:apply-templates select=\".\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"self::adobeimage\">\n\t\t\t\t<xsl:apply-templates select=\".\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"self::ph\">\n\t\t\t\t<xsl:apply-templates select=\".\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"self::sup\">\n\t\t\t\t<xsl:apply-templates select=\".\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"self::em | self::i\">\n\t\t\t\t<xsl:apply-templates select=\".\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"self::codeph\">\n\t\t\t\t<xsl:apply-templates select=\".\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"self::xref\">\n\t\t\t\t<xsl:apply-templates select=\".\">\n\t\t\t\t\t<xsl:with-param name=\"createLinkFromRootContext\" select=\"$createLinkFromRootContext\"/>\n\t\t\t\t</xsl:apply-templates>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"self::pre\">\n\t\t\t\t<xsl:apply-templates select=\".\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:for-each>\n\t</xsl:template>\n\t<xsl:template match=\"codeblock\">\n\t\t<xsl:variable name=\"product\" select=\"./@product|./@class[contains(.,'only')] | ./@outputclass\"/>\n\t\t<xsl:if test=\"string-length($product)=0 or $product=concat($productName,'only')\">\n\t\t\t<!-- for some reason, asdoc includes all whitespace before\n\t\t\t\tthe * in documentation comments -->\n\t\t\t<!-- the Feathers codebase uses tabs for indentation, and one\n\t\t\t\tspace before *, so we can remove the space -->\n\t\t\t<xsl:variable name=\"deTabbed\">\n\t\t\t\t<xsl:call-template name=\"search-and-replace\">\n\t\t\t\t\t<xsl:with-param name=\"input\" select=\".\"/>\n\t\t\t\t\t<xsl:with-param name=\"search-string\" select=\"'&#09; '\"/>\n\t\t\t\t\t<xsl:with-param name=\"replace-string\" select=\"'&#09;'\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:variable>\n\t\t\t<!-- Feathers examples only use spaces so we can safely remove\n\t\t\t\tall tabs in code blocks -->\n\t\t\t<xsl:variable name=\"deTabbed\" select=\"replace($deTabbed,'&#09;','')\"/>\n\t\t\t<xsl:variable name=\"listingversion\" select=\"./@rev\"/>\n\t\t\t<xsl:variable name=\"openTag\">\n\t\t\t\t<xsl:if test=\"string-length($listingversion) &gt; 0\">\n\t\t\t\t\t<xsl:value-of select=\"concat('&lt;div class=&quot;','listing','&quot; version=&quot;',$listingversion,'&quot;&gt;')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"string-length($listingversion) = 0\">\n\t\t\t\t\t<xsl:value-of select=\"concat('&lt;div class=&quot;','listing','&quot;&gt;')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"$openTag\"/>\n\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;pre&gt;'\"/>\n\t\t\t<xsl:if test=\"contains($deTabbed,'~~')\">\n\t\t\t\t<xsl:call-template name=\"search-and-replace\">\n\t\t\t\t\t<xsl:with-param name=\"input\" select=\"$deTabbed\"/>\n\t\t\t\t\t<xsl:with-param name=\"search-string\" select=\"'~~'\"/>\n\t\t\t\t\t<xsl:with-param name=\"replace-string\" select=\"'*'\"/>\t\t\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:if>\n\t\t\t<xsl:variable name=\"text\" select=\"replace($deTabbed,'&lt;','&amp;lt;')\"/>\n\t\t\t<xsl:variable name=\"finaltext\" select=\"replace($text,'&gt;','&amp;gt;')\"/>\n\t\t\t<xsl:if test=\"not(contains($deTabbed,'~~'))\">\n\t\t\t\t<xsl:value-of select=\"$finaltext\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;/pre&gt;'\"/>\n\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;/div&gt;'\"/>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template match=\"ol | ul\">\n\t\t<xsl:variable name=\"product\" select=\"./@product|./@class[contains(.,'only')] | ./@outputclass\"/>\n\t\t<xsl:if test=\"string-length($product)=0 or $product=concat($productName,'only')\">\n\t\t\t<xsl:variable name=\"openTag\">\n\t\t\t\t<xsl:variable name=\"className\" select=\"./@outputclass\"/>\n\t\t\t\t<xsl:if test=\"self::ol\">\n\t\t\t\t\t<xsl:if test=\"string-length($className) &gt; 0\">\n\t\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"concat('&lt;ol type=&quot;',$className,'&quot; &gt;')\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"string-length($className) = 0\">\n\t\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;ol&gt;'\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"self::ul\">\n\t\t\t\t\t<xsl:if test=\"string-length($className) &gt; 0\">\n\t\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"concat('&lt;ul type=&quot;',$className,'&quot; &gt;')\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"string-length($className) = 0\">\n\t\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;ul&gt;'\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"closeTag\">\n\t\t\t\t<xsl:if test=\"self::ol\">\n\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;/ol&gt;'\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"self::ul\">\n\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;/ul&gt;'\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"$openTag\"/>\n\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"$closeTag\"/>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template match=\"li\">\n\t\t<xsl:variable name=\"product\" select=\"./@product|./@class[contains(.,'only')] | ./@outputclass\"/>\n\t\t<xsl:if test=\"string-length($product)=0 or $product=concat($productName,'only')\">\n\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;li&gt;'\"/>\n\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;/li&gt;'\"/>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template match=\"p\">\n\t\t<xsl:variable name=\"product\" select=\"./@product|./@class[contains(.,'only')] | ./@outputclass\"/>\n\t\t<xsl:if test=\"string-length($product)=0 or $product=concat($productName,'only')\">\n\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;p&gt;'\"/>\n\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;/p&gt;'\"/>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template match=\"b | bold | strong\">\n\t\t<xsl:variable name=\"product\" select=\"./@product|./@class[contains(.,'only')] | ./@outputclass\"/>\n\t\t<xsl:if test=\"string-length($product)=0 or $product=concat($productName,'only')\">\n\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;b&gt;'\"/>\n\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;/b&gt;'\"/>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template match=\"sup\">\n\t\t<xsl:variable name=\"product\" select=\"./@product|./@class[contains(.,'only')] | ./@outputclass\"/>\n\t\t<xsl:if test=\"string-length($product)=0 or $product=concat($productName,'only')\">\n\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;sup&gt;'\"/>\n\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;/sup&gt;'\"/>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template match=\"pre\">\n\t\t<xsl:variable name=\"product\" select=\"./@product | ./@class[contains(.,'only')] | ./@outputclass\"/>\n\t\t<xsl:if test=\"string-length($product)=0 or $product=concat($productName,'only')\">\n\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;pre&gt;'\"/>\n\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;/pre&gt;'\"/>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template match=\"em | i\">\n\t\t<xsl:variable name=\"product\" select=\"./@product|./@class[contains(.,'only')] | ./@outputclass\"/>\n\t\t<xsl:if test=\"string-length($product)=0 or $product=concat($productName,'only')\">\n\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;i&gt;'\"/>\n\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;/i&gt;'\"/>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template match=\"codeph\">\n\t\t<xsl:variable name=\"product\" select=\"./@product|./@class[contains(.,'only')] | ./@outputclass\"/>\n\t\t<xsl:if test=\"string-length($product)=0 or $product=concat($productName,'only')\">\n\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;code&gt;'\"/>\n\t\t\t<xsl:choose>\n\t\t\t\t<xsl:when test=\"contains(.,'&lt;') and contains(.,'&gt;')\">\n\t\t\t\t\t<xsl:variable name=\"rep\" select=\"replace(.,'&lt;','&amp;lt;')\"/>\n\t\t\t\t\t<xsl:value-of select=\"replace($rep,'&gt;','&amp;gt;')\"/>\n\t\t\t\t</xsl:when>\n\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t</xsl:otherwise>\n\t\t\t</xsl:choose>\n\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;/code&gt;'\"/>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template match=\"adobetable\">\n\t\t<xsl:variable name=\"product\" select=\"./@product|./@class[contains(.,'only')] | ./@outputclass\"/>\n\t\t<xsl:if test=\"string-length($product)=0 or $product=concat($productName,'only')\">\n\t\t\t<xsl:variable name=\"colCount\" select=\"./tgroup/@cols\"/>\n\t\t\t<xsl:if test=\"string-length(./@class) &gt; 0\">\n\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"concat('&lt;table class=&quot;',./@class,'&quot; &gt;')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"string-length(./@class) = 0\">\n\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;table &gt;'\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:for-each select=\"./tgroup/thead//row\">\n\t\t\t\t<tr>\n\t\t\t\t\t<xsl:for-each select=\"entry\">\n\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t<xsl:when test=\"string-length(./@align) &gt; 0\">\n\t\t\t\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"concat('&lt;th align=&quot;',./@align,'&quot;&gt;')\"/>\n\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;/th&gt;'\"/>\n\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t</xsl:for-each>\n\t\t\t\t</tr>\n\t\t\t</xsl:for-each>\n\t\t\t<xsl:for-each select=\"./tgroup/tbody//row\">\n\t\t\t\t<tr>\n\t\t\t\t\t<xsl:for-each select=\"entry\">\n\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t<xsl:when test=\"string-length(./@align) &gt; 0\">\n\t\t\t\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"concat('&lt;td align=&quot;',./@align,'&quot;&gt;')\"/>\n\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;/td&gt;'\"/>\n\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t</xsl:for-each>\n\t\t\t\t</tr>\n\t\t\t</xsl:for-each>\n\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;/table&gt;'\"/>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template match=\"adobeimage\">\n\t\t<xsl:variable name=\"product\" select=\"./@product|./@class[contains(.,'only')] | ./@outputclass\"/>\n\t\t<xsl:if test=\"string-length($product)=0 or $product=concat($productName,'only')\">\n\t\t\t<xsl:variable name=\"hrefUrl\" select=\"./@href\"/>\n\t\t\t<xsl:variable name=\"alt.text\" select=\"./@alt\"/>\n\t\t\t<xsl:variable name=\"openTag\">\n\t\t\t\t<xsl:if test=\"string-length($hrefUrl) &gt; 0\">\n\t\t\t\t\t<xsl:if test=\"string-length($alt.text) &gt; 0\">\n\t\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"concat('&lt;img src=&quot;',$hrefUrl,'&quot; alt=&quot;',$alt.text,'&quot;&gt;')\"/>\n\t\t\t\t\t</xsl:if>\t\t\t\t\t\t\t\t\n\t\t\t\t\t<xsl:if test=\"not(string-length($alt.text) &gt; 0)\">\n\t\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"concat('&lt;img src=&quot;',$hrefUrl,'&quot; &gt;')\"/>\n\t\t\t\t\t</xsl:if>\t\t\t\t\t\t\t\t\n\t\t\t\t</xsl:if>\t\t\t\n\t\t\t\t<xsl:if test=\"not(string-length($hrefUrl) &gt; 0) and not(string-length($alt.text) &gt; 0)\">\n\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;img&gt;'\"/>\n\t\t\t\t</xsl:if>\t\t\t\t\t\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"closeTag\">\n\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;/img&gt;'\"/>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"$openTag\"/>\n\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"$closeTag\"/>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template match=\"ph\">\n\t\t<xsl:variable name=\"product\" select=\"./@product|./@class[contains(.,'only')] | ./@outputclass\"/>\n\t\t<xsl:if test=\"string-length($product)=0 or $product=concat($productName,'only')\">\n\t\t\t<xsl:variable name=\"class\" select=\"./@outputclass\"/>\n\t\t\t<xsl:choose>\n\t\t\t\t<xsl:when test=\"$class='br'\">\n\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t</xsl:when>\n\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t<xsl:variable name=\"openTag\">\n\t\t\t\t\t\t<xsl:if test=\"string-length($class) &gt; 0\">\n\t\t\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"concat('&lt;span src=&quot;',$class,'&quot;&gt;')\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"not(string-length($class) &gt; 0)\">\n\t\t\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;span&gt;'\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t<xsl:variable name=\"closeTag\">\n\t\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;/span&gt;'\"/>\n\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"$openTag\"/>\n\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"$closeTag\"/>\n\t\t\t\t</xsl:otherwise>\n\t\t\t</xsl:choose>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template match=\"xref\">\n\t\t<xsl:param name=\"createLinkFromRootContext\" select=\"false()\"/>\n\t\t<xsl:variable name=\"product\" select=\"./@product|./@class[contains(.,'only')] | ./@outputclass\"/>\n\t\t<xsl:if test=\"string-length($product)=0 or $product=concat($productName,'only')\">\n\t\t\t<xsl:variable name=\"source\">\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"$process_xref_href_attribute ='0' or contains(@href,'http://') or contains(@href,'.htm')\">\n\t\t\t\t\t\t<xsl:value-of select=\"@href\"/>\n\t\t\t\t\t</xsl:when>\n\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t<xsl:call-template name=\"getLinkURL\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"href\" select=\"@href\"/>\n\t\t\t\t\t\t\t<xsl:with-param name=\"createLinkFromRootContext\" select=\"$createLinkFromRootContext\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t</xsl:choose>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"target\" select=\"@scope\"/>\n\t\t\t<xsl:variable name=\"openTag\">\n\t\t\t\t<xsl:if test=\"string-length($source) &gt; 0\">\n\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"concat('&lt;a href=&quot;',$source,'&quot; target=&quot;',$target,'&quot;&gt;')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(string-length($source) &gt; 0)\">\n\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;a&gt;'\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"closeTag\">\n\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"'&lt;/a&gt;'\"/>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"$openTag\"/>\n\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"$closeTag\"/>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getLinkURL\">\n\t\t<xsl:param name=\"href\"/>\n\t\t<xsl:param name=\"createLinkFromRootContext\" select=\"false()\"/>\n\t\t<xsl:if test=\"string-length(@href) &gt; 0\">\n\t\t\t<xsl:variable name=\"methodNameText\" select=\"substring-after(@href,'/')\"/>\n\t\t\t<xsl:variable name=\"classNameText\">\n\t\t\t\t<xsl:if test=\"contains(@href,'/')\">\n\t\t\t\t\t<xsl:value-of select=\"substring-before(substring-after(@href,'#'),'/')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(contains(@href,'/'))\">\n\t\t\t\t\t<xsl:value-of select=\"substring-after(@href,'#')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"className\">\n\t\t\t\t<xsl:if test=\"string-length($classNameText) &gt; 0\">\n\t\t\t\t\t<xsl:value-of select=\"$classNameText\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"string-length($classNameText) = 0\">\n\t\t\t\t\t<xsl:value-of select=\"ancestor-or-self::apiClassifier/apiName\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"packName\">\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"contains(@href,'.xml.xml')\">\n\t\t\t\t\t\t<xsl:if test=\"contains(@href,'#')\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"substring(substring-before(@href,'#'),0,string-length(substring-before(@href,'#'))-string-length('.xml')+1)\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"not(contains(@href,'#')) and not(contains(@href,'/')) and not(contains(@href,'.htm'))\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"substring(@href,0,string-length(@href)-string-length('.xml')+1)\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:when>\n\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t<xsl:if test=\"contains(@href,'#')\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"substring-before(substring-before(@href,'#'),'.xml')\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"not(contains(@href,'#')) and not(contains(@href,'/')) and not(contains(@href,'.htm'))\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"substring-before(@href,'.xml')\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t</xsl:choose>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:if test=\"contains(@href,'.htm') \">\n\t\t\t\t<xsl:value-of select=\"@href\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:choose>\n\t\t\t\t<xsl:when test=\"string-length($packName) &gt; 0 and ( not($packName=ancestor-or-self::apiPackage/apiName) or $createLinkFromRootContext = true() )and  not(contains(@href,'.htm'))\">\n\t\t\t\t\t<xsl:variable name=\"relPath\">\n\t\t\t\t\t\t<xsl:if test=\"$createLinkFromRootContext = false() and contains(ancestor-or-self::apiPackage/apiName,'.')\">\n\t\t\t\t\t\t\t<xsl:call-template name=\"getRelativePath\">\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"currentPath\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t<xsl:if test=\"string-length($classNameText) &gt; 0\">\n\t\t\t\t\t\t<xsl:if test=\"string-length($methodNameText) &gt; 0 \">\n\t\t\t\t\t\t\t<xsl:value-of select=\"concat($relPath,translate($packName,'.','/'),'/',$classNameText,'.html#',$methodNameText)\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"string-length($methodNameText) = 0\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"concat($relPath,translate($packName,'.','/'),'/',$classNameText,'.html')\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"string-length($classNameText) = 0\">\n\t\t\t\t\t\t<xsl:if test=\"string-length($methodNameText) &gt; 0 \">\n\t\t\t\t\t\t\t<xsl:value-of select=\"concat($relPath,translate($packName,'.','/'),'/','package.html#',$methodNameText)\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"string-length($methodNameText) = 0\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"concat($relPath,translate($packName,'.','/'),'/','package-detail.html')\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:when>\n\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t<xsl:if test=\"(string-length($packName) = 0 or  ($packName=ancestor-or-self::apiPackage/apiName)) and not(contains(@href,'.htm'))\">\n\t\t\t\t\t\t<xsl:if test=\"string-length($classNameText) &gt; 0 and not($classNameText='global') and string-length($packName) != 0 \">\n\t\t\t\t\t\t\t<xsl:if test=\"string-length($methodNameText) &gt; 0\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($classNameText,'.html#',$methodNameText)\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"string-length($methodNameText) = 0\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($classNameText,'.html')\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<!-- To handle the <#Array/sort() kind of stuff in a package>-->\n\t\t\t\t\t\t<xsl:if test=\"string-length($classNameText) &gt; 0 and not($classNameText='global') and string-length(ancestor-or-self::apiPackage/apiName) &gt; 0 and string-length($packName) = 0 \">\n\t\t\t\t\t\t\t<xsl:variable name=\"relPath\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"$prog_language_name = 'ActionScript' and contains(ancestor-or-self::apiPackage/apiName,'.')\">\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getRelativePath\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"currentPath\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t<xsl:if test=\"string-length($methodNameText) &gt; 0\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($relPath,$classNameText,'.html#',$methodNameText)\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"string-length($methodNameText) = 0\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($relPath,$classNameText,'.html')\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"string-length($classNameText) &gt; 0 and $classNameText='global'\">\n\t\t\t\t\t\t\t<xsl:variable name=\"relPath\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"contains(ancestor-or-self::apiPackage/apiName,'.')\">\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getRelativePath\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"currentPath\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t<xsl:if test=\"string-length($methodNameText) &gt; 0\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($relPath,'package.html#',$methodNameText)\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"string-length($classNameText) = 0\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"concat('#',$methodNameText)\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:otherwise>\n\t\t\t</xsl:choose>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getDeprecatedReplacementLink\">\n\t\t<xsl:param name=\"replacement\"/>\n\t\t<xsl:param name=\"currentPackage\"/>\n\t\t<xsl:param name=\"linkFromRootContext\" select=\"false()\"/>\n\t\t<xsl:param name=\"ancestorPath\"/>\n\t\t<xsl:param name=\"anchorPrefix\" select=\"''\"/>\n\t\t<xsl:param name=\"mode\" select=\"''\"/>\n\n\t\t<xsl:variable name=\"relativePath\">\n\t\t\t<xsl:call-template name=\"getRelativePath\">\n\t\t\t\t<xsl:with-param name=\"currentPath\" select=\"$currentPackage\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"$ancestorPath\">\n\t\t\t\t<xsl:variable name=\"lastToken\">\n\t\t\t\t\t<xsl:call-template name=\"lastIndexOf\">\n\t\t\t\t\t\t<xsl:with-param name=\"string\" select=\"$replacement\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"char\" select=\"'.'\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<xsl:variable name=\"firstPassToken\" select=\"substring-before($replacement,concat('.',$lastToken))\"/>\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"string-length($firstPassToken) &gt; 0\">\n\t\t\t\t\t\t<xsl:if test=\"$linkFromRootContext = false()\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$relativePath\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:when>\n\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t<xsl:if test=\"$linkFromRootContext = true()\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"translate($currentPackage,'.','/')\"/>\n\t\t\t\t\t\t\t<xsl:text>/</xsl:text>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t</xsl:choose>\n\t\t\t\t<xsl:value-of select=\"concat(translate($replacement,'.','/'),'.html')\"/>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:variable name=\"lastToken\">\n\t\t\t\t\t<xsl:call-template name=\"lastIndexOf\">\n\t\t\t\t\t\t<xsl:with-param name=\"string\" select=\"$replacement\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"char\" select=\"'.'\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<xsl:variable name=\"firstPassToken\" select=\"substring-before($replacement,concat('.',$lastToken))\"/>\n\t\t\t\t<xsl:variable name=\"className\">\n\t\t\t\t\t<xsl:call-template name=\"lastIndexOf\">\n\t\t\t\t\t\t<xsl:with-param name=\"string\" select=\"$firstPassToken\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"char\" select=\"'.'\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<xsl:variable name=\"packageName\" select=\"substring-before($firstPassToken,concat('.',$className))\"/>\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"string-length($packageName) &gt; 0\">\n\t\t\t\t\t\t<xsl:if test=\"$linkFromRootContext = false()\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$relativePath\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:when>\n\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t<xsl:if test=\"$linkFromRootContext = true()\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"translate($currentPackage,'.','/')\"/>\n\t\t\t\t\t\t\t<xsl:text>/</xsl:text>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t</xsl:choose>\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"string-length($firstPassToken) &gt; 0\">\n\t\t\t\t\t\t<xsl:value-of select=\"concat(translate($firstPassToken,'.','/'),'.html')\"/>\n\t\t\t\t\t</xsl:when>\n\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t<xsl:if test=\"$linkFromRootContext = true()\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"concat(ancestor::apiClassifier/apiName,'.html')\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t</xsl:choose>\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"string-length($mode) = 0\">\n\t\t\t\t\t\t<xsl:value-of select=\"concat('#', $anchorPrefix, $lastToken)\"/>\n\t\t\t\t\t</xsl:when>\n\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t<xsl:value-of select=\"concat('#', $mode, $anchorPrefix, $lastToken)\"/>\n\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t</xsl:choose>\n\n\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template match=\"text()\">\n\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t<xsl:with-param name=\"inText\" select=\".\"/>\n\t\t</xsl:call-template>\n\t</xsl:template>\n\t<xsl:template name=\"getParentInterfaces\">\n\t\t<xsl:param name=\"currentInterface\"/>\n\t\t<xsl:param name=\"interfaceList\"/>\n\t\t<xsl:variable name=\"className\">\n\t\t\t<xsl:if test=\"contains($currentInterface,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-after($currentInterface,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($currentInterface,':'))\">\n\t\t\t\t<xsl:value-of select=\"$currentInterface\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"xslDocPath\">\n\t\t\t<xsl:if test=\"contains($currentInterface,':')\">\n\t\t\t\t<xsl:value-of select=\"concat($ditaFileDir,substring-before($currentInterface,':'),'.xml')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($currentInterface,':'))\">\n\t\t\t\t<xsl:value-of select=\"concat($ditaFileDir,'__Global__.xml')\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:for-each select=\"document($xslDocPath)/apiPackage//apiClassifier[apiName=$className]/apiClassifierDetail/apiClassifierDef/apiBaseInterface\">\n\t\t\t<xsl:if test=\"not(contains($interfaceList,.))\">\n\t\t\t\t<interface>\n\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t</interface>\n\t\t\t</xsl:if>\n\t\t</xsl:for-each>\n\t\t<xsl:variable name=\"newInterfaceList\">\n\t\t\t<xsl:for-each select=\"document($xslDocPath)/apiPackage//apiClassifier[apiName=$className]/apiClassifierDetail/apiClassifierDef/apiBaseInterface\">\n\t\t\t\t<xsl:if test=\"not(contains($interfaceList,.))\">\n\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:for-each>\n\t\t</xsl:variable>\n\t\t<xsl:for-each select=\"document($xslDocPath)/apiPackage//apiClassifier[apiName=$className]/apiClassifierDetail/apiClassifierDef/apiBaseInterface\">\n\t\t\t<xsl:if test=\"not(contains($interfaceList,.))\">\n\t\t\t\t<xsl:call-template name=\"getParentInterfaces\">\n\t\t\t\t\t<xsl:with-param name=\"currentInterface\" select=\".\"/>\n\t\t\t\t\t<xsl:with-param name=\"interfaceList\" select=\"concat($interfaceList, ' ', $newInterfaceList)\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:if>\n\t\t</xsl:for-each>\n\t</xsl:template>\n\t<xsl:template name=\"createBaseInterfaceList\">\n\t\t<xsl:variable name=\"interfaceList\">\n\t\t\t<xsl:for-each select=\"./apiClassifierDetail/apiClassifierDef/apiBaseInterface\">\n\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t</xsl:for-each>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"baseinterfaces\">\n\t\t\t<xsl:for-each select=\"./apiClassifierDetail/apiClassifierDef/apiBaseInterface\">\n\t\t\t\t<interface>\n\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t</interface>\n\t\t\t</xsl:for-each>\n\t\t\t<xsl:for-each select=\"./apiClassifierDetail/apiClassifierDef/apiBaseInterface\">\n\t\t\t\t<xsl:call-template name=\"getParentInterfaces\">\n\t\t\t\t\t<xsl:with-param name=\"currentInterface\" select=\".\"/>\n\t\t\t\t\t<xsl:with-param name=\"interfaceList\" select=\"$interfaceList\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:for-each>\n\t\t</xsl:variable>\n\t\t<xsl:for-each select=\"$baseinterfaces/interface\">\n\t\t\t<xsl:if test=\"not(node()) or not(preceding-sibling::node()[.=string(current()) and name()=name(current())])\">\n\t\t\t\t<xsl:copy>\n\t\t\t\t\t<interface>\n\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t</interface>\n\t\t\t\t</xsl:copy>\n\t\t\t</xsl:if>\n\t\t</xsl:for-each>\n\t</xsl:template>\n\t<xsl:template name=\"insertAIRIcon\">\n\t\t<xsl:param name=\"baseRef\"/>\n\t\t<img src=\"{$baseRef}images/AirIcon12x12.gif\" width=\"12\" height=\"12\" hspace=\"0\" vspace=\"0\" alt=\"AIR-only\" title=\"Only available in the AIR runtime\"/>\n\t</xsl:template>\n</xsl:stylesheet>\n"
  },
  {
    "path": "documentation/api-reference/templates/asdoc.js",
    "content": "////////////////////////////////////////////////////////////////////////////////\n//\n//  ADOBE SYSTEMS INCORPORATED\n//  Copyright 2006-2008 Adobe Systems Incorporated\n//  All Rights Reserved.\n//\n//  NOTICE: Adobe permits you to use, modify, and distribute this file\n//  in accordance with the terms of the license agreement accompanying it.\n//\n////////////////////////////////////////////////////////////////////////////////\nvar ECLIPSE_FRAME_NAME = \"ContentViewFrame\";\nvar eclipseBuild = false;\nvar liveDocsBaseUrl = \"http://livedocs.adobe.com/flex/3\";\nvar liveDocsBookName = \"langref\";\nfunction findObject(objId) {\n    if (document.getElementById)\n        return document.getElementById(objId);\n    if (document.all)\n        return document.all[objId];\n}\nfunction isEclipse() {\n    return eclipseBuild;\n//  return (window.name == ECLIPSE_FRAME_NAME) || (parent.name == ECLIPSE_FRAME_NAME) || (parent.parent.name == ECLIPSE_FRAME_NAME);\n}\nfunction configPage() {\n    setRowColorsInitial(true, \"Property\");\n    setRowColorsInitial(true, \"Method\");\n    setRowColorsInitial(true, \"ProtectedMethod\");   \n    setRowColorsInitial(true, \"Event\");\n    setRowColorsInitial(true, \"Style\");\n    \n    setRowColorsInitial(true, \"SkinPart\");\n    setRowColorsInitial(true, \"SkinState\");\n    \n    setRowColorsInitial(true, \"Constant\");\n    if (isEclipse()) {\n        if (window.name != \"classFrame\")\n        {\n            var localRef = window.location.href.indexOf('?') != -1 ? window.location.href.substring(0, window.location.href.indexOf('?')) : window.location.href;\n            localRef = localRef.substring(localRef.indexOf(\"langref/\") + 8);\n            if (window.location.search != \"\")\n                localRef += (\"#\" + window.location.search.substring(1));\n            window.location.replace(baseRef + \"index.html?\" + localRef);\n            return;\n        }\n        else\n        {\n            setStyle(\".eclipseBody\", \"display\", \"block\");\n//          var isIE  = (navigator.appVersion.indexOf(\"MSIE\") != -1) ? true : false;\n//          if (isIE == false && window.location.hash != \"\")\n            if (window.location.hash != \"\")\n                window.location.hash=window.location.hash.substring(1);\n        }\n    }\n    else if (window == top) { // no frames\n        findObject(\"titleTable\").style.display = \"\";\n    }\n    else { // frames\n        findObject(\"titleTable\").style.display = \"none\";\n    }\n    showTitle(asdocTitle);\n}\nfunction loadFrames(classFrameURL, classListFrameURL) {\n    var classListFrame = findObject(\"classListFrame\");\n    if(classListFrame != null && classListFrameContent!='')\n        classListFrame.document.location.href=classListFrameContent;\n    if (isEclipse()) {\n        var contentViewFrame = findObject(ECLIPSE_FRAME_NAME);\n        if (contentViewFrame != null && classFrameURL != '')\n            contentViewFrame.document.location.href=classFrameURL;\n    }\n    else {\n        var classFrame = findObject(\"classFrame\");\n        if(classFrame != null && classFrameContent!='')\n            classFrame.document.location.href=classFrameContent;\n    }\n}\nfunction showTitle(title) {\n    if (!isEclipse())\n        top.document.title = title;\n}\nfunction loadClassListFrame(classListFrameURL) {\n    if (parent.frames[\"classListFrame\"] != null) {\n        parent.frames[\"classListFrame\"].location = classListFrameURL;\n    }\n    else if (parent.frames[\"packageFrame\"] != null) {\n        if (parent.frames[\"packageFrame\"].frames[\"classListFrame\"] != null) {\n            parent.frames[\"packageFrame\"].frames[\"classListFrame\"].location = classListFrameURL;\n        }\n    }\n}\nfunction gotoLiveDocs(primaryURL, secondaryURL, locale) {\n        if (locale == \"en-us\") {\n             locale = \"\";\n        } \n        else {\n              locale = \"_\" + locale.substring(3);\n        }\n    var url = liveDocsBaseUrl + locale + \"/\" + liveDocsBookName + \"/index.html?\" + primaryURL;\n    if (secondaryURL != null && secondaryURL != \"\")\n        url += (\"&\" + secondaryURL);\n    window.open(url, \"mm_livedocs\", \"menubar=1,toolbar=1,status=1,scrollbars=1,resizable=yes\");\n}\nfunction findTitleTableObject(id)\n{\n    if (isEclipse())\n        return parent.titlebar.document.getElementById(id);\n    else if (top.titlebar)\n        return top.titlebar.document.getElementById(id);\n    else\n        return document.getElementById(id);\n}\nfunction titleBar_setSubTitle(title)\n{\n    if (isEclipse() || top.titlebar)\n        findTitleTableObject(\"subTitle\").childNodes.item(0).data = title;\n}\nfunction titleBar_setSubNav(showConstants,showProperties,showStyles,showSkinPart,showSkinState,showEffects,showEvents,showConstructor,showMethods,showExamples,\n                showPackageConstants,showPackageProperties,showPackageFunctions,showInterfaces,showClasses,showPackageUse)\n{\n    if (isEclipse() || top.titlebar)\n    {\n        var borderStyle = \"solid 1px #333\";\n        findTitleTableObject(\"propertiesLink\").style.display = showProperties ? \"inline\" : \"none\";\n        findTitleTableObject(\"propertiesLink\").style.borderRight = (showProperties && (showPackageProperties || showConstructor || showMethods || showPackageFunctions || showEvents || showStyles || showSkinPart || showSkinState || showEffects || showConstants || showPackageConstants || showInterfaces || showClasses || showPackageUse || showExamples)) ? borderStyle : \"none\";\n        // findTitleTableObject(\"propertiesBar\").style.display = (showProperties && (showPackageProperties || showConstructor || showMethods || showPackageFunctions || showEvents || showStyles || showSkinPart || showSkinState || showEffects || showConstants || showPackageConstants || showInterfaces || showClasses || showPackageUse || showExamples)) ? \"inline\" : \"none\";\n        findTitleTableObject(\"packagePropertiesLink\").style.display = showPackageProperties ? \"inline\" : \"none\";\n        findTitleTableObject(\"packagePropertiesLink\").style.borderRight = (showPackageProperties && (showConstructor || showMethods || showPackageFunctions || showEvents || showStyles || showSkinPart || showSkinState || showConstants || showEffects || showPackageConstants || showInterfaces || showClasses || showPackageUse || showExamples)) ? borderStyle : \"none\";\n        // findTitleTableObject(\"packagePropertiesBar\").style.display = (showPackageProperties && (showConstructor || showMethods || showPackageFunctions || showEvents || showStyles || showSkinPart || showSkinState || showConstants || showEffects || showPackageConstants || showInterfaces || showClasses || showPackageUse || showExamples)) ? \"inline\" : \"none\";\n        findTitleTableObject(\"constructorLink\").style.display = showConstructor ? \"inline\" : \"none\";\n        findTitleTableObject(\"constructorLink\").style.borderRight = (showConstructor && (showMethods || showPackageFunctions || showEvents || showStyles || showSkinPart || showSkinState || showEffects || showConstants || showPackageConstants || showInterfaces || showClasses || showPackageUse || showExamples)) ? borderStyle : \"none\";\n        // findTitleTableObject(\"constructorBar\").style.display = (showConstructor && (showMethods || showPackageFunctions || showEvents || showStyles || showSkinPart || showSkinState || showEffects || showConstants || showPackageConstants || showInterfaces || showClasses || showPackageUse || showExamples)) ? \"inline\" : \"none\";\n        findTitleTableObject(\"methodsLink\").style.display = showMethods ? \"inline\" : \"none\";\n        findTitleTableObject(\"methodsLink\").style.borderRight = (showMethods && (showPackageFunctions || showEvents || showStyles || showSkinPart || showSkinState || showEffects || showConstants || showPackageConstants || showInterfaces || showClasses || showPackageUse || showExamples)) ? borderStyle : \"none\";\n        // findTitleTableObject(\"methodsBar\").style.display = (showMethods && (showPackageFunctions || showEvents || showStyles || showSkinPart || showSkinState || showEffects || showConstants || showPackageConstants || showInterfaces || showClasses || showPackageUse || showExamples)) ? \"inline\" : \"none\";\n        findTitleTableObject(\"packageFunctionsLink\").style.display = showPackageFunctions ? \"inline\" : \"none\";\n        findTitleTableObject(\"packageFunctionsLink\").style.borderRight = (showPackageFunctions && (showEvents || showStyles || showSkinPart || showSkinState || showEffects || showConstants || showPackageConstants || showInterfaces || showClasses || showPackageUse || showExamples)) ? borderStyle : \"none\";\n        // findTitleTableObject(\"packageFunctionsBar\").style.display = (showPackageFunctions && (showEvents || showStyles || showSkinPart || showSkinState || showEffects || showConstants || showPackageConstants || showInterfaces || showClasses || showPackageUse || showExamples)) ? \"inline\" : \"none\";\n        findTitleTableObject(\"eventsLink\").style.display = showEvents ? \"inline\" : \"none\";\n        findTitleTableObject(\"eventsLink\").style.borderRight = (showEvents && (showStyles || showSkinPart || showSkinState || showEffects || showConstants || showPackageConstants || showInterfaces || showClasses || showPackageUse || showExamples)) ? borderStyle : \"none\";\n        // findTitleTableObject(\"eventsBar\").style.display = (showEvents && (showStyles || showSkinPart || showSkinState || showEffects || showConstants || showPackageConstants || showInterfaces || showClasses || showPackageUse || showExamples)) ? \"inline\" : \"none\";\n        findTitleTableObject(\"stylesLink\").style.display = showStyles ? \"inline\" : \"none\";\n        findTitleTableObject(\"stylesLink\").style.borderRight = (showStyles && (showSkinPart || showSkinState || showEffects || showConstants || showPackageConstants || showInterfaces || showClasses || showPackageUse || showExamples)) ? borderStyle : \"none\";\n        // findTitleTableObject(\"stylesBar\").style.display = (showStyles && (showSkinPart || showSkinState || showEffects || showConstants || showPackageConstants || showInterfaces || showClasses || showPackageUse || showExamples)) ? \"inline\" : \"none\";\n        \n        findTitleTableObject(\"SkinPartLink\").style.display = showSkinPart ? \"inline\" : \"none\";\n        findTitleTableObject(\"SkinPartLink\").style.borderRight = (showSkinPart && (showSkinState || showEffects || showConstants || showPackageConstants || showInterfaces || showClasses || showPackageUse || showExamples)) ? borderStyle : \"none\";\n        // findTitleTableObject(\"SkinPartBar\").style.display = (showSkinPart && (showSkinState || showEffects || showConstants || showPackageConstants || showInterfaces || showClasses || showPackageUse || showExamples)) ? \"inline\" : \"none\";\n        \n        findTitleTableObject(\"SkinStateLink\").style.display = showSkinState ? \"inline\" : \"none\";\n\t    findTitleTableObject(\"SkinStateLink\").style.borderRight = (showSkinState && (showEffects || showConstants || showPackageConstants || showInterfaces || showClasses || showPackageUse || showExamples)) ? borderStyle : \"none\";\n        // findTitleTableObject(\"SkinStateBar\").style.display = (showSkinState && (showEffects || showConstants || showPackageConstants || showInterfaces || showClasses || showPackageUse || showExamples)) ? \"inline\" : \"none\";\n                \n        findTitleTableObject(\"effectsLink\").style.display = showEffects ? \"inline\" : \"none\";\n        findTitleTableObject(\"effectsLink\").style.borderRight = (showEffects && (showConstants || showPackageConstants || showInterfaces || showClasses || showPackageUse || showExamples)) ? borderStyle : \"none\";\n        // findTitleTableObject(\"effectsBar\").style.display = (showEffects && (showConstants || showPackageConstants || showInterfaces || showClasses || showPackageUse || showExamples)) ? \"inline\" : \"none\";\n        findTitleTableObject(\"constantsLink\").style.display = showConstants ? \"inline\" : \"none\";\n        findTitleTableObject(\"constantsLink\").style.borderRight = (showConstants && (showPackageConstants || showInterfaces || showClasses || showPackageUse || showExamples)) ? borderStyle : \"none\";\n        // findTitleTableObject(\"constantsBar\").style.display = (showConstants && (showPackageConstants || showInterfaces || showClasses || showPackageUse || showExamples)) ? \"inline\" : \"none\";\n        findTitleTableObject(\"packageConstantsLink\").style.display = showPackageConstants ? \"inline\" : \"none\";\n        findTitleTableObject(\"packageConstantsLink\").style.borderRight = (showPackageConstants && (showInterfaces || showClasses || showPackageUse || showExamples)) ? borderStyle : \"none\";\n        // findTitleTableObject(\"packageConstantsBar\").style.display = (showPackageConstants && (showInterfaces || showClasses || showPackageUse || showExamples)) ? \"inline\" : \"none\";\n        findTitleTableObject(\"interfacesLink\").style.display = showInterfaces ? \"inline\" : \"none\";\n        findTitleTableObject(\"interfacesLink\").style.borderRight = (showInterfaces && (showClasses || showPackageUse || showExamples)) ? borderStyle : \"none\";\n        // findTitleTableObject(\"interfacesBar\").style.display = (showInterfaces && (showClasses || showPackageUse || showExamples)) ? \"inline\" : \"none\";\n        findTitleTableObject(\"classesLink\").style.display = showClasses ? \"inline\" : \"none\";\n        findTitleTableObject(\"classesLink\").style.borderRight = (showClasses && (showPackageUse || showExamples)) ? borderStyle : \"none\";\n        // findTitleTableObject(\"classesBar\").style.display = (showClasses && (showPackageUse || showExamples)) ? \"inline\" : \"none\";\n        findTitleTableObject(\"packageUseLink\").style.display = showPackageUse ? \"inline\" : \"none\";\n        findTitleTableObject(\"packageUseLink\").style.borderRight = (showPackageUse && showExamples) ? borderStyle : \"none\";\n        // findTitleTableObject(\"packageUseBar\").style.display = (showPackageUse && showExamples) ? \"inline\" : \"none\";\n        findTitleTableObject(\"examplesLink\").style.display = showExamples ? \"inline\" : \"none\";\n    }\n}\nfunction titleBar_gotoClassFrameAnchor(anchor)\n{\n    if (isEclipse())\n        parent.classFrame.location = parent.classFrame.location.toString().split('#')[0] + \"#\" + anchor;\n    else\n        top.classFrame.location = top.classFrame.location.toString().split('#')[0] + \"#\" + anchor;\n}\nfunction setMXMLOnly() \n{\n    if (getCookie(\"showMXML\") == \"false\")\n    {\n        toggleMXMLOnly();\n    }\n}\nfunction toggleMXMLOnly() \n{\n    var mxmlDiv = findObject(\"mxmlSyntax\");\n    var mxmlShowLink = findObject(\"showMxmlLink\");\n    var mxmlHideLink = findObject(\"hideMxmlLink\");\n    if (mxmlDiv && mxmlShowLink && mxmlHideLink)\n    {\n        if (mxmlDiv.style.display == \"none\")\n        {\n            mxmlDiv.style.display = \"block\";\n            mxmlShowLink.style.display = \"none\";\n            mxmlHideLink.style.display = \"inline\";\n            setCookie(\"showMXML\",\"true\", new Date(3000,1,1,1,1), \"/\", document.location.domain);\n        }\n        else\n        {\n            mxmlDiv.style.display = \"none\";\n            mxmlShowLink.style.display = \"inline\";\n            mxmlHideLink.style.display = \"none\";\n            setCookie(\"showMXML\",\"false\", new Date(3000,1,1,1,1), \"/\", document.location.domain);\n        }\n    }\n}\nfunction showHideInherited()\n{   \n    setInheritedVisible(getCookie(\"showInheritedConstant\") == \"true\", \"Constant\");\n    setInheritedVisible(getCookie(\"showInheritedProtectedConstant\") == \"true\", \"ProtectedConstant\");\n    setInheritedVisible(getCookie(\"showInheritedProperty\") == \"true\", \"Property\");\n    setInheritedVisible(getCookie(\"showInheritedProtectedProperty\") == \"true\", \"ProtectedProperty\");\n    setInheritedVisible(getCookie(\"showInheritedMethod\") == \"true\", \"Method\");\n    setInheritedVisible(getCookie(\"showInheritedProtectedMethod\") == \"true\", \"ProtectedMethod\");\n    setInheritedVisible(getCookie(\"showInheritedEvent\") == \"true\", \"Event\");\n    setInheritedVisible(getCookie(\"showInheritedStyle\") == \"true\", \"Style\");\n    \n    setInheritedVisible(getCookie(\"showInheritedSkinPart\") == \"true\", \"SkinPart\");\n    setInheritedVisible(getCookie(\"showInheritedSkinState\") == \"true\", \"SkinState\");\n    \n    setInheritedVisible(getCookie(\"showInheritedEffect\") == \"true\", \"Effect\");\n}\nfunction setInheritedVisible(show, selectorText)\n{\n    if (document.styleSheets[0].cssRules != undefined)\n    {\n        var rules = document.styleSheets[0].cssRules;\n        for (var i = 0; i < rules.length; i++)\n        {\n            if (rules[i].selectorText == \".hideInherited\" + selectorText)\n                rules[i].style.display = show ? \"\" : \"none\";\n                \n            if (rules[i].selectorText == \".showInherited\" + selectorText)\n                rules[i].style.display = show ? \"none\" : \"\";\n\n            if (rules[i].selectorText == \"table.hideInherited\" + selectorText)\n                rules[i].style.display = show ? \"block\" : \"none\";\n            \n            if (rules[i].selectorText == \"table.showInherited\" + selectorText)\n                rules[i].style.display = show ? \"none\" : \"block\";\n        }\n    }\n    else\n    {\n        document.styleSheets[0].addRule(\".hideInherited\" + selectorText, show ? \"display:inline\" : \"display:none\");\n        document.styleSheets[0].addRule(\".showInherited\" + selectorText, show ? \"display:none\" : \"display:inline\");\n        document.styleSheets[0].addRule(\"table.hideInherited\" + selectorText, show ? \"display:block\" : \"display:none\");\n        document.styleSheets[0].addRule(\"table.showInherited\" + selectorText, show ? \"display:none\" : \"display:block\");\n    }\n    setCookie(\"showInherited\" + selectorText, show ? \"true\" : \"false\", new Date(3000,1,1,1,1), \"/\", document.location.domain);\n    setRowColors(show, selectorText);\n}\nfunction setRowColors(show, selectorText)\n{\n    var rowColor = \"#F2F2F2\";\n    var table = findObject(\"summaryTable\" + selectorText);\n    if (table != null)\n    {\n        var rowNum = 0;\n        for (var i = 1; i < table.rows.length; i++)\n        {\n            if (table.rows[i].className.indexOf(\"hideInherited\") == -1 || show)\n            {\n                rowNum++;\n                table.rows[i].bgColor = (rowNum % 2 == 0) ? rowColor : \"#FFFFFF\";\n            }           \n        }\n    }\n}\nfunction setRowColorsInitial(show, selectorText)\n{\n    var rowColor = \"#F2F2F2\";\n    var table = findObject(\"summaryTable\" + selectorText);\n    if (table != null)\n    {\n        var rowNum = 0;\n        for (var i = 1; i < table.rows.length; i++)\n        {\n            if (table.rows[i].className.indexOf(\"hideInherited\") == -1 && show)\n            {\n                rowNum++;\n                table.rows[i].bgColor = (rowNum % 2 == 0) ? rowColor : \"#FFFFFF\";\n            }           \n        }\n    }\n}\nfunction setStyle(selectorText, styleName, newValue)\n{\n    if (document.styleSheets[0].cssRules != undefined)\n    {\n        var rules = document.styleSheets[0].cssRules;\n        for (var i = 0; i < rules.length; i++)\n        {\n            if (rules[i].selectorText == selectorText)\n            {\n                rules[i].style[styleName] = newValue;\n                break;\n            }\n        }\n    }\n    else\n    {\n        document.styleSheets[0].addRule(selectorText, styleName + \":\" + newValue);\n    }\n}\n"
  },
  {
    "path": "documentation/api-reference/templates/class-files.xslt",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n\n\tADOBE SYSTEMS INCORPORATED\n\tCopyright 2008 Adobe Systems Incorporated\n\tAll Rights Reserved.\n\n\tNOTICE: Adobe permits you to use, modify, and distribute this file\n\tin accordance with the terms of the license agreement accompanying it.\n\n-->\n<xsl:stylesheet version=\"2.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:saxon=\"http://sf.net/saxon\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:ifn=\"urn:internal:functions\"\n\texclude-result-prefixes=\"saxon xs ifn\">\n\t<xsl:import href=\"asdoc-util.xslt\"/>\n\t<xsl:import href=\"class-parts.xslt\"/>\n\t<xsl:character-map name=\"disable\">\n\t\t<xsl:output-character character=\"&amp;\" string=\"&amp;\"/>\n\t\t<xsl:output-character character=\"&lt;\" string=\"&lt;\"/>\n\t\t<xsl:output-character character=\"&gt;\" string=\"&gt;\"/>\n\t\t<xsl:output-character character=\"&#145;\" string=\"&amp;lsquo;\"/>\n\t\t<xsl:output-character character=\"&#146;\" string=\"&amp;apos;\"/>\n\t\t<xsl:output-character character=\"&#151;\" string=\"&amp;mdash;\"/>\n\t\t<xsl:output-character character=\"&#x2014;\" string=\"&amp;mdash;\"/>\n\t\t<xsl:output-character character=\"&#x2009;\" string=\"&amp;thinsp;\"/>\n\t\t<xsl:output-character character=\"&#xAE;\" string=\"&amp;reg;\"/>\n\t\t<xsl:output-character character=\"&#xB0;\" string=\"&amp;deg;\"/>\n\t\t<xsl:output-character character=\"&#x2122;\" string=\"&amp;trade;\"/>\n\t</xsl:character-map>\n\t<xsl:output method=\"html\" encoding=\"UTF-8\" indent=\"no\" omit-xml-declaration=\"yes\" use-character-maps=\"disable\" saxon:character-representation=\"native;decimal\"/>\n\t<xsl:param name=\"outputPath\" select=\"''\"/>\n\t<xsl:param name=\"ditaFileDir\" select=\"''\"/>\n\t<xsl:param name=\"showExamples\">true</xsl:param>\n\t<xsl:param name=\"showIncludeExamples\">true</xsl:param>\n\t<xsl:param name=\"showSWFs\">\n\t\t<xsl:if test=\"$config/options/@showSWFs='false'\">\n\t\t\t<xsl:text>false</xsl:text>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"not($config/options/@showSWFs='false')\">\n\t\t\t<xsl:text>true</xsl:text>\n\t\t</xsl:if>\n\t</xsl:param>\n\t<xsl:param name=\"tabSpaces\" select=\"'    '\"/>\n\t<xsl:param name=\"classFileName\" select=\"'ClassHeader.xml'\"/>\n\t<xsl:variable name=\"classHeader_map\" select=\"document($classFileName)//apiPackage\"/>\n\t<xsl:variable name=\"field_map\" select=\"document('fieldSummary.xml')/allClasses/apiPackage\"/>\n\t<xsl:variable name=\"method_map\" select=\"document('methodSummary.xml')/allClasses/apiPackage\"/>\n\t<xsl:variable name=\"event_map\" select=\"document('eventsGeneratedSummary.xml')/allClasses/apiPackage\"/>\n\t<xsl:variable name=\"style_map\" select=\"document('stylesSummary.xml')/allClasses/apiPackage\"/>\n\t<xsl:variable name=\"effect_map\" select=\"document('effectsSummary.xml')/allClasses/apiPackage\"/>\n\t<xsl:variable name=\"thinsp\">\n\t\t<xsl:text>&#x2009;</xsl:text>\n\t</xsl:variable>\n\t<xsl:variable name=\"tab\">\n\t\t<xsl:text>\t</xsl:text>\n\t</xsl:variable>\n\t<xsl:param name=\"prog_language_name\" select=\"''\"/>\n\t<xsl:param name=\"jslr\" select=\"'flashclasses.xml'\"/>\n\t<xsl:key name=\"class_id\" match=\"//apiClassifier\" use=\"@id\"/>\n\t<xsl:template match=\"/\">\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t<!-- ActionScript -->\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:for-each select=\"apiMap//apiItemRef\">\n\t\t\t\t\t<xsl:sort select=\"@href\" order=\"ascending\" lang=\"en-US\"/>\n\t\t\t\t\t<xsl:variable name=\"ditaFileName\">\n\t\t\t\t\t\t<xsl:value-of select=\"concat($ditaFileDir,@href)\"/>\n\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t<xsl:for-each select=\"document($ditaFileName)/apiPackage//apiClassifier\">\n\t\t\t\t\t\t<xsl:sort select=\"apiName\" order=\"ascending\" lang=\"en-US\"/>\n\t\t\t\t\t\t<xsl:variable name=\"packageName\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t\t<xsl:variable name=\"name\" select=\"apiName\"/>\n\t\t\t\t\t\t<xsl:variable name=\"ID\" select=\"@id\"/>\n\t\t\t\t\t\t<xsl:variable name=\"classNode\" select=\".\"/>\n\t\t\t\t\t\t<xsl:variable name=\"isTopLevel\">\n\t\t\t\t\t\t\t<xsl:call-template name=\"isTopLevel\">\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$packageName\"/>\n\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t<xsl:variable name=\"isInnerClass\" select=\"ancestor::apiClassifier\"/>\n\t\t\t\t\t\t<xsl:variable name=\"packagePath\" select=\"translate($packageName, '.', '/')\"/>\n\t\t\t\t\t\t<xsl:variable name=\"classFile\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$outputPath\"/>\n\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='false'\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$packagePath\"/>\n\t\t\t\t\t\t\t\t<xsl:text>/</xsl:text>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t<xsl:text>.html</xsl:text>\n\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t<xsl:variable name=\"title\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"concat(concat($name,' - '),$title-base)\"/>\n\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t<xsl:variable name=\"classDeprecated\">\n\t\t\t\t\t\t\t<xsl:if test=\"deprecated\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"'true'\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"not(deprecated)\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"'false'\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t<xsl:variable name=\"baseRef\">\n\t\t\t\t\t\t\t<xsl:call-template name=\"getBaseRef\">\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$packageName\"/>\n\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t<xsl:result-document href=\"{$classFile}\" method=\"html\">\n\t\t\t\t\t\t\t<!--xsl:message select=\"$classFile\"/-->\n\t\t\t\t\t\t\t<xsl:copy-of select=\"$docType\"/>\n\t\t\t\t\t\t\t<xsl:if test=\"$config/options[@ion='true']\">\n\t\t\t\t\t\t\t\t<xsl:comment>#config errmsg=\"\"</xsl:comment>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:element name=\"html\">\n\t\t\t\t\t\t\t\t<head>\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getStyleLink\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"link\" select=\"/asdoc/link\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$packageName\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$classHeader_map/apiClassifier[@id=$ID]\">\n\t\t\t\t\t\t\t\t\t\t<xsl:copy-of select=\"./meta\"/>\n\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t<title>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='false'\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$packageName\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>.</xsl:text>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getPageTitlePostFix\"/>\n\t\t\t\t\t\t\t\t\t</title>\n\t\t\t\t\t\t\t\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$showIncludeExamples='true' and apiClassifierDetail/example/codeblock\">\n\t\t\t\t\t\t\t\t\t\t<script src=\"{$baseRef}AC_OETags.js\" type=\"text/javascript\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</head>\n\t\t\t\t\t\t\t\t<xsl:element name=\"body\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isEclipse\">\n\t\t\t\t\t\t\t\t\t\t<xsl:attribute name=\"class\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>eclipseBody</xsl:text>\n\t\t\t\t\t\t\t\t\t\t</xsl:attribute>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getTitleScript\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"title\" select=\"$title\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$packageName\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$classHeader_map/apiClassifier[@id=$ID]\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"classHeader\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"classNode\" select=\"$classNode\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$field_map//apiClassifier[@id=$ID]\">\n\t\t\t\t\t\t\t\t\t\t<!-- list of interfaces that this interface extends-->\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"interfaces\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./apiClassifierDetail/apiClassifierDef/apiInterface and ./apiClassifierDetail/apiClassifierDef/apiBaseInterface\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"createBaseInterfaceList\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t<!--  PUBLIC PROPERTY SUMMARY-->\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"fieldSummary\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"interfaces\" select=\"$interfaces\" tunnel=\"yes\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"isConst\" select=\"'false'\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t<!--  PROTECTED PROPERTY SUMMARY-->\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"fieldSummary\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"accessLevel\" select=\"'protected'\" as=\"xs:string\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"interfaces\" select=\"$interfaces\" tunnel=\"yes\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"isConst\" select=\"'false'\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$method_map//apiClassifier[@id=$ID]\">\n\t\t\t\t\t\t\t\t\t\t<!-- list of interfaces that this interface extends-->\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"interfaces\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./apiClassifierDetail/apiClassifierDef/apiInterface and ./apiClassifierDetail/apiClassifierDef/apiBaseInterface\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"createBaseInterfaceList\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t<!--  METHOD SUMMARY-->\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"methodSummary\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"className\" select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"interfaces\" select=\"$interfaces\" tunnel=\"yes\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t<!--  PROTECTED METHOD SUMMARY-->\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"methodSummary\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"className\" select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"accessLevel\" select=\"'protected'\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"interfaces\" select=\"$interfaces\" tunnel=\"yes\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$event_map//apiClassifier[@id=$ID]\">\n\t\t\t\t\t\t\t\t\t\t<!-- list of interfaces that this interface extends-->\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"interfaces\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./apiClassifierDetail/apiClassifierDef/apiInterface and ./apiClassifierDetail/apiClassifierDef/apiBaseInterface\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"createBaseInterfaceList\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t<!--  EVENT SUMMARY-->\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"eventsGeneratedSummary\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"interfaces\" select=\"$interfaces\" tunnel=\"yes\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$style_map//apiClassifier[@id=$ID]\">\n\t\t\t\t\t\t\t\t\t\t<!-- list of interfaces that this interface extends-->\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"interfaces\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./apiClassifierDetail/apiClassifierDef/apiInterface and ./apiClassifierDetail/apiClassifierDef/apiBaseInterface\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"createBaseInterfaceList\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t<!-- STYLE SUMMARY-->\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"stylesSummary\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"interfaces\" select=\"$interfaces\" tunnel=\"yes\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\n\t\t\t\t\t\t\t\t\t  <!-- SKIN PART SUMMARY -->\n\t\t\t\t\t\t\t\t\t  <xsl:for-each select=\"$classHeader_map//apiClassifier[@id=$ID]\">\n\t\t\t\t\t\t\t\t\t    <xsl:variable name=\"interfaces\">\n\t\t\t\t\t\t\t\t\t      <xsl:if test=\"./apiClassifierDetail/apiClassifierDef/apiInterface and ./apiClassifierDetail/apiClassifierDef/apiBaseInterface\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"createBaseInterfaceList\"/>\n\t\t\t\t\t\t\t\t\t      </xsl:if>\n\t\t\t\t\t\t\t\t\t    </xsl:variable>\n\t\t\t\t\t\t\t\t\t    <xsl:call-template name=\"SkinPartSummary\">\n\t\t\t\t\t\t\t\t\t      <xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t\t\t\t\t      <xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t      <xsl:with-param name=\"interfaces\" select=\"$interfaces\" tunnel=\"yes\"/>\n\t\t\t\t\t\t\t\t\t    </xsl:call-template>\n\t\t\t\t\t\t\t\t\t  </xsl:for-each> \n\t\t\t\t\t\t\t\t\t  <!-- SKIN STATE SUMMARY -->\n\t\t\t\t\t\t\t\t\t  <xsl:for-each select=\"$classHeader_map//apiClassifier[@id=$ID]\">\n\t\t\t\t\t\t\t\t\t    <xsl:variable name=\"interfaces\">\n\t\t\t\t\t\t\t\t\t      <xsl:if test=\"./apiClassifierDetail/apiClassifierDef/apiInterface and ./apiClassifierDetail/apiClassifierDef/apiBaseInterface\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"createBaseInterfaceList\"/>\n\t\t\t\t\t\t\t\t\t      </xsl:if>\n\t\t\t\t\t\t\t\t\t    </xsl:variable>\n\t\t\t\t\t\t\t\t\t    <xsl:call-template name=\"SkinStateSummary\">\n\t\t\t\t\t\t\t\t\t      <xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t\t\t\t\t      <xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t      <xsl:with-param name=\"interfaces\" select=\"$interfaces\" tunnel=\"yes\"/>\n\t\t\t\t\t\t\t\t\t    </xsl:call-template>\n\t\t\t\t\t\t\t\t\t  </xsl:for-each> \n\n                  \t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$effect_map//apiClassifier[@id=$ID]\">\n\t\t\t\t\t\t\t\t\t\t<!-- list of interfaces that this interface extends-->\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"interfaces\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./apiClassifierDetail/apiClassifierDef/apiInterface and ./apiClassifierDetail/apiClassifierDef/apiBaseInterface\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"createBaseInterfaceList\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t<!-- EFFECT SUMMARY-->\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"effectsSummary\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"interfaces\" select=\"$interfaces\" tunnel=\"yes\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$field_map//apiClassifier[@id=$ID]\">\n\t\t\t\t\t\t\t\t\t\t<!-- list of interfaces that this interface extends-->\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"interfaces\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./apiClassifierDetail/apiClassifierDef/apiInterface and ./apiClassifierDetail/apiClassifierDef/apiBaseInterface\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"createBaseInterfaceList\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t<!--  PUBLIC CONSTANT SUMMARY-->\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"fieldSummary\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"isConst\" select=\"'true'\" as=\"xs:string\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"interfaces\" select=\"$interfaces\" tunnel=\"yes\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t<!--  PROTECTED CONSTANT SUMMARY-->\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"fieldSummary\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"isConst\" select=\"'true'\" as=\"xs:string\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"accessLevel\" select=\"'protected'\" as=\"xs:string\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"interfaces\" select=\"$interfaces\" tunnel=\"yes\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\t\t\t\t\t\t\t<xsl:comment>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>\n\t\t\t\t\t\t\t\t\t\t</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>showHideInherited();</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>\n\t\t\t\t\t\t\t\t\t\t</xsl:text>\n\t\t\t\t\t\t\t\t\t\t</xsl:comment>\n\t\t\t\t\t\t\t\t\t</script>\n\t\t\t\t\t\t\t\t\t<div class=\"MainContent\">\n\t\t\t\t\t\t\t\t\t\t<!--  PROPERTY DETAIL -->\n\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$field_map//apiClassifier[@id=$ID]\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"propertyDetails\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t<!-- CONSTRUCTOR DETAIL-->\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(./apiClassifierDetail/apiClassifierDef/apiInterface) and count(apiConstructor) &gt; 0\">\n\t\t\t\t\t\t\t\t\t\t\t<a name=\"constructorDetail\"/>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"detailSectionHeader\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ConstructorDetail']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"className\" select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:apply-templates select=\"apiConstructor[./apiName = $className]\" mode=\"detail\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"isConstructor\">true</xsl:with-param>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"constructCall\" select=\"'false'\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:apply-templates>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<!-- METHOD DETAIL -->\n\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$method_map//apiClassifier[@id=$ID]\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"methodsDetails\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"className\" select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"constructCall\" select=\"'false'\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t<!--  EVENT DETAIL-->\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"eventDetails\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t<!-- STYLE DETAIL -->\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"styleDetails\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t<!--  CONSTANT DETAIL -->\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"constantDetails\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"isConst\" select=\"'true'\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t<!-- INCLUDE EXAMPLES-->\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./*/example/codeblock\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"createExampleInstructionLink\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$config/exampleFile\">true</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>false</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"includeExamples\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"createExampleLink\" select=\"'true'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"createExampleInstructionLink\" select=\"$createExampleInstructionLink\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t\t\t\t\t\t\t<hr/>\n\t\t\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getPageLinks\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"copyNum\" select=\"'2'\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t<p/>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$config/options[@ion!='true']\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getFeedbackLink\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"topic\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='false'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$packageName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>.</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:with-param>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"filename\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='false'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$packagePath\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>/</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>.html</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:with-param>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"filename2\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='true'\">class-list.html</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel!='true'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$packagePath\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>/class-list.html</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:with-param>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$config/options[@ion='true']\">\n\t\t\t\t\t\t\t\t\t\t\t<script src=\"{$baseRef}currentpage.js\" type=\"text/javascript\" language=\"Javascript\" charset=\"UTF-8\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<center class=\"copyright\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:copy-of select=\"$copyright\"/>\n\t\t\t\t\t\t\t\t\t\t</center>\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"addKeywords\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"keyword\" select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='false'\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"addKeywords\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"keyword\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$packageName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>.</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:with-param>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$config/options[@ion='true']\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"separator\">&#160;</div>\n\t\t\t\t\t\t\t\t\t\t<xsl:comment>BEGIN IONCOMMENTS</xsl:comment>\n\t\t\t\t\t\t\t\t\t\t<div id=\"ionComHere\"> </div>\n\t\t\t\t\t\t\t\t\t\t<xsl:comment>END IONCOMMENTS</xsl:comment>\n\t\t\t\t\t\t\t\t\t\t<xsl:comment>#include virtual=\"ionComments.ssi\"</xsl:comment>\n\t\t\t\t\t\t\t\t\t\t<p id=\"creativecommons\" class=\"creativecommons\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"http://creativecommons.org/licenses/by-nc-sa/3.0/\">\n\t\t\t\t\t\t\t\t\t\t\t\t<img id=\"creativecommons_img\" src=\"{$baseRef}images/CC.png\"/>\n\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t<xsl:comment>#include virtual=\"/livedocs/googleAnalytics.ssi\"</xsl:comment>\n\t\t\t\t\t\t\t\t\t\t<xsl:comment>#include virtual=\"/ubi/analytics/analytics_ssi.html\"</xsl:comment>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:element>\n\t\t\t\t\t\t\t</xsl:element>\n\t\t\t\t\t\t\t<xsl:copy-of select=\"$copyrightComment\"/>\n\t\t\t\t\t\t</xsl:result-document>\n\t\t\t\t\t</xsl:for-each>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<!-- INNER CLASSES -->\n\t<xsl:template name=\"innerClassSummary\">\n\t\t<xsl:param name=\"hasInherited\" select=\"false\"/>\n\t\t<xsl:param name=\"classDeprecated\" select=\"false\"/>\n\t\t<xsl:if test=\"count(.//apiClassifier) &gt; 0 or boolean($hasInherited)\">\n\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t<a name=\"innerClassSummary\"/>\n\t\t\t<table cellspacing=\"0\" cellpadding=\"3\" width=\"100%\" class=\"withBorder\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=\"2\" bgcolor=\"#CCCCCC\" class=\"SummaryTableHeader\">\n\t\t\t\t\t\t<font size=\"+1\">\n\t\t\t\t\t\t\t<b>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'InnerClassSummary']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t</b>\n\t\t\t\t\t\t</font>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<xsl:for-each select=\"//apiClassifier\">\n\t\t\t\t\t<xsl:sort select=\"./apiName\" order=\"ascending\" lang=\"en-US\"/>\n\t\t\t\t\t<tr class=\"row{position() mod 2}\">\n\t\t\t\t\t\t<td width=\"50px\" valign=\"top\">\n\t\t\t\t\t\t\t<code>\n\t\t\t\t\t\t\t\t<font size=\"1\" style=\"font-weight:bold\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"./apiClassifierDetail/apiClassifierDef/apiFinal\">\n\t\t\t\t\t\t\t\t\t\t<xsl:text>final </xsl:text>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"./apiClassifierDetail/apiClassifierDef/apiDynamic\">\n\t\t\t\t\t\t\t\t\t\t<xsl:text>dynamic </xsl:text>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</font>\n\t\t\t\t\t\t\t</code>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td valign=\"top\">\n\t\t\t\t\t\t\t<code>\n\t\t\t\t\t\t\t\t<a href=\"{./apiName}.html\">\n\t\t\t\t\t\t\t\t\t<b>\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t\t\t\t\t\t</b>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</code>\n\t\t\t\t\t\t\t<xsl:if test=\"deprecated\">\n\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:apply-templates select=\"deprecated\"/>\n\t\t\t\t\t\t\t<xsl:if test=\"not(deprecated)\">\n\t\t\t\t\t\t\t\t<xsl:call-template name=\"shortDescription\">\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</xsl:for-each>\n\t\t\t</table>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<!-- FIELDS -->\n\t<xsl:template name=\"fieldSummary\">\n\t\t<xsl:param name=\"classDeprecated\" select=\"'false'\"/>\n\t\t<xsl:param name=\"isConst\" select=\"'false'\"/>\n\t\t<xsl:param name=\"accessLevel\" select=\"'public'\"/>\n\t\t<xsl:param name=\"baseRef\" select=\"''\"/>\n\t\t<xsl:param name=\"isGlobal\" select=\"false()\"/>\n\t\t<xsl:param name=\"showAnchor\" select=\"true()\"/>\n\t\t<xsl:param name=\"getProp\"/>\n\t\t<xsl:param name=\"interfaces\" tunnel=\"yes\"/>\n\t\t<xsl:variable name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t<xsl:variable name=\"ID\" select=\"@id\"/>\n\t\t<xsl:variable name=\"hasFields\">\n\t\t\t<xsl:if test=\"$isConst='true'\">\n\t\t\t\t<xsl:value-of\n\t\t\t\t\tselect=\"count(apiValue/apiValueDetail/apiValueDef[not(apiProperty) and (apiAccess/@value=$accessLevel or apiAccess/@value=$config/namespaces/namespace[@summaryDisplay=$accessLevel]/.)]) &gt; 0\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"$isConst='false'\">\n\t\t\t\t<xsl:value-of\n\t\t\t\t\tselect=\"count(apiValue/apiValueDetail/apiValueDef[apiProperty and (apiAccess/@value=$accessLevel or apiAccess/@value=$config/namespaces/namespace[@summaryDisplay=$accessLevel]/.)]) &gt; 0\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"ancestorexcludes\">\n\t\t\t<excludes>\n\t\t\t\t<xsl:for-each select=\"$classHeader_map//apiClassifier[@id = $ID]//Excludes/Exclude[@kind='property']\">\n\t\t\t\t\t<xsl:copy-of select=\".\"/>\n\t\t\t\t</xsl:for-each>\n\t\t\t</excludes>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"propertyList\">\n\t\t\t<xsl:if test=\"$isConst='true'\">\n\t\t\t\t<xsl:for-each\n\t\t\t\t\tselect=\"apiValue[not(./apiValueDetail/apiValueDef/apiProperty) and (./apiValueDetail/apiValueDef/apiAccess/@value=$accessLevel or ./apiValueDetail/apiValueDef/apiAccess/@value=$config/namespaces/namespace[@summaryDisplay=$accessLevel]/.)]\">\n\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t</xsl:for-each>\n\t\t\t\t<xsl:for-each select=\"$ancestorexcludes/excludes/Exclude\">\n\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"$isConst='false'\">\n\t\t\t\t<xsl:for-each\n\t\t\t\t\tselect=\"apiValue[./apiValueDetail/apiValueDef/apiProperty and (./apiValueDetail/apiValueDef/apiAccess/@value=$accessLevel or ./apiValueDetail/apiValueDef/apiAccess/@value=$config/namespaces/namespace[@summaryDisplay=$accessLevel]/.)]\">\n\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t</xsl:for-each>\n\t\t\t\t<xsl:for-each select=\"$ancestorexcludes/excludes/Exclude\">\n\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"ancestorNode\">\n\t\t\t<ancestors>\n\t\t\t\t<xsl:call-template name=\"getAncestorProperty\">\n\t\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"./apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t\t\t<xsl:with-param name=\"accessLevel\" select=\"$accessLevel\"/>\n\t\t\t\t\t<xsl:with-param name=\"isConst\" select=\"$isConst\"/>\n\t\t\t\t\t<xsl:with-param name=\"propertyList\" select=\"$propertyList\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t\t<xsl:for-each select=\"$interfaces/interface\">\n\t\t\t\t\t<xsl:call-template name=\"getAncestorProperty\">\n\t\t\t\t\t\t<xsl:with-param name=\"baseClass\" select=\".\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"accessLevel\" select=\"$accessLevel\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"isConst\" select=\"$isConst\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"propertyList\" select=\"$propertyList\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"processParentClass\" select=\"false()\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:for-each>\n\t\t\t</ancestors>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"hasInherited\" select=\"count($ancestorNode/ancestors/apiValue) &gt; 0\"/>\n\t\t<xsl:if test=\"$hasFields='true' or $hasInherited\">\n\t\t\t<xsl:if test=\"$showAnchor\">\n\t\t\t\t<xsl:variable name=\"hasPublic\">\n\t\t\t\t\t<xsl:if test=\"$accessLevel='protected'\">\n\t\t\t\t\t\t<xsl:value-of\n\t\t\t\t\t\t\tselect=\"count(apiValue[not(apiValueDetail/apiValueDef/apiProperty)!=($isConst) and (apiValueDetail/apiValueDef/apiAccess/@value='public' or apiValueDetail/apiValueDef/apiAccess/@value=$config/namespaces/namespace[@summaryDisplay='public']/.)]) &gt; 0 or $hasInherited\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"not($accessLevel='protected')\">\n\t\t\t\t\t\t<xsl:value-of select=\"false()\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<xsl:if test=\"$isConst='true'\">\n\t\t\t\t\t<xsl:if test=\"$accessLevel='public'\">\n\t\t\t\t\t\t<a name=\"constantSummary\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"$accessLevel='protected'\">\n\t\t\t\t\t\t<xsl:if test=\"$hasPublic='false'\">\n\t\t\t\t\t\t\t<a name=\"constantSummary\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<a name=\"protectedConstantSummary\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$isConst='false'\">\n\t\t\t\t\t<xsl:if test=\"$accessLevel='public'\">\n\t\t\t\t\t\t<a name=\"propertySummary\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"$accessLevel='protected'\">\n\t\t\t\t\t\t<xsl:if test=\"$hasPublic='false'\">\n\t\t\t\t\t\t\t<a name=\"propertySummary\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<a name=\"protectedPropertySummary\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:if>\n\t\t\t<div class=\"summarySection\">\n\t\t\t\t<div class=\"summaryTableTitle\">\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"$isGlobal and $isConst='true'\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'GlobalConstants']]/entry[2]/p\"/>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:when test=\"$isGlobal and $isConst='false'\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'GlobalProperties']]/entry[2]/p\"/>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:when test=\"$accessLevel='public' and $isConst='true'\">\n\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'PublicConstants']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t</xsl:choose>\n\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:when test=\"$accessLevel='public' and $isConst='false'\">\n\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'PublicProperties']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t</xsl:choose>\n\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:when test=\"$accessLevel='protected' and $isConst='true'\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ProtectedConstants']]/entry[2]/p\"/>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:when test=\"$accessLevel='protected' and $isConst='false'\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ProtectedProperties']]/entry[2]/p\"/>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t</div>\n\t\t\t\t<xsl:if test=\"$hasInherited\">\n\t\t\t\t\t<div class=\"showHideLinks\">\n\t\t\t\t\t\t<xsl:if test=\"$isConst='true' and $accessLevel!='protected'\">\n\t\t\t\t\t\t\t<div id=\"hideInheritedConstant\" class=\"hideInheritedConstant\">\n\t\t\t\t\t\t\t\t<a class=\"showHideLink\" href=\"#constantSummary\" onclick=\"javascript:setInheritedVisible(false,'Constant');\">\n\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t<img class=\"showHideLinkImage\" src=\"{$baseRef}images/expanded.gif\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'HideInheritedPublicConstants']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div id=\"showInheritedConstant\" class=\"showInheritedConstant\">\n\t\t\t\t\t\t\t\t<a class=\"showHideLink\" href=\"#constantSummary\" onclick=\"javascript:setInheritedVisible(true,'Constant');\">\n\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t<img class=\"showHideLinkImage\" src=\"{$baseRef}images/collapsed.gif\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ShowInheritedPublicConstants']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"$isConst='true' and $accessLevel='protected'\">\n\t\t\t\t\t\t\t<div id=\"hideInheritedProtectedConstant\" class=\"hideInheritedProtectedConstant\">\n\t\t\t\t\t\t\t\t<a class=\"showHideLink\" href=\"#protectedConstantSummary\" onclick=\"javascript:setInheritedVisible(false,'ProtectedConstant');\">\n\t\t\t\t\t\t\t\t\t<img class=\"showHideLinkImage\" src=\"{$baseRef}images/expanded.gif\"/>\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'HideInheritedProtectedConstants']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div id=\"showInheritedProtectedConstant\" class=\"showInheritedProtectedConstant\">\n\t\t\t\t\t\t\t\t<a class=\"showHideLink\" href=\"#protectedConstantSummary\" onclick=\"javascript:setInheritedVisible(true,'ProtectedConstant');\">\n\t\t\t\t\t\t\t\t\t<img class=\"showHideLinkImage\" src=\"{$baseRef}images/collapsed.gif\"/>\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ShowInheritedProtectedConstants']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"$isConst='false' and $accessLevel!='protected'\">\n\t\t\t\t\t\t\t<div id=\"hideInheritedProperty\" class=\"hideInheritedProperty\">\n\t\t\t\t\t\t\t\t<a class=\"showHideLink\" href=\"#propertySummary\" onclick=\"javascript:setInheritedVisible(false,'Property');\">\n\t\t\t\t\t\t\t\t\t<img class=\"showHideLinkImage\" src=\"{$baseRef}images/expanded.gif\"/>\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'HideInheritedPublicProperties']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div id=\"showInheritedProperty\" class=\"showInheritedProperty\">\n\t\t\t\t\t\t\t\t<a class=\"showHideLink\" href=\"#propertySummary\" onclick=\"javascript:setInheritedVisible(true,'Property');\">\n\t\t\t\t\t\t\t\t\t<img class=\"showHideLinkImage\" src=\"{$baseRef}images/collapsed.gif\"/>\n\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ShowInheritedPublicProperties']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"$isConst='false' and $accessLevel='protected'\">\n\t\t\t\t\t\t\t<div id=\"hideInheritedProtectedProperty\" class=\"hideInheritedProtectedProperty\">\n\t\t\t\t\t\t\t\t<a class=\"showHideLink\" href=\"#protectedPropertySummary\" onclick=\"javascript:setInheritedVisible(false,'ProtectedProperty');\">\n\t\t\t\t\t\t\t\t\t<img class=\"showHideLinkImage\" src=\"{$baseRef}images/expanded.gif\"/>\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'HideInheritedProtectedProperties']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div id=\"showInheritedProtectedProperty\" class=\"showInheritedProtectedProperty\">\n\t\t\t\t\t\t\t\t<a class=\"showHideLink\" href=\"#protectedPropertySummary\" onclick=\"javascript:setInheritedVisible(true,'ProtectedProperty');\">\n\t\t\t\t\t\t\t\t\t<img class=\"showHideLinkImage\" src=\"{$baseRef}images/collapsed.gif\"/>\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ShowInheritedProtectedProperties']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</div>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:variable name=\"tableStyle\">\n\t\t\t\t\t<xsl:if test=\"$hasInherited and $hasFields='false'\">\n\t\t\t\t\t\t<xsl:text>hideInherited</xsl:text>\n\t\t\t\t\t\t<xsl:if test=\"$accessLevel='protected'\">\n\t\t\t\t\t\t\t<xsl:text>Protected</xsl:text>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"$isConst='true'\">\n\t\t\t\t\t\t\t<xsl:text>Constant</xsl:text>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"$isConst='false'\">\n\t\t\t\t\t\t\t<xsl:text>Property</xsl:text>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<xsl:variable name=\"tableId\">\n\t\t\t\t\t<xsl:text>summaryTable</xsl:text>\n\t\t\t\t\t<xsl:if test=\"$accessLevel='protected'\">\n\t\t\t\t\t\t<xsl:text>Protected</xsl:text>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"$isConst='true'\">\n\t\t\t\t\t\t<xsl:text>Constant</xsl:text>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"$isConst='false'\">\n\t\t\t\t\t\t<xsl:text>Property</xsl:text>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<table cellspacing=\"0\" cellpadding=\"3\" class=\"summaryTable {$tableStyle}\" id=\"{$tableId}\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th colspan=\"2\">\n\t\t\t\t\t\t\t<xsl:if test=\"$isConst='false'\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'PropertyProperty']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"$isConst='true'\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Constant']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<xsl:if test=\"not($config/options/@docversion='2')\">\n\t\t\t\t\t\t\t<th class=\"summaryTableOwnerCol\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'DefinedBy']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<xsl:for-each\n\t\t\t\t\t\tselect=\"apiValue[(not(apiValueDetail/apiValueDef/apiProperty)=($isConst='true') or apiValueDetail/apiValueDef/apiProperty='false') and (apiValueDetail/apiValueDef/apiAccess/@value = $accessLevel or apiValueDetail/apiValueDef/apiAccess/@value=$config/namespaces/namespace[@summaryDisplay=$accessLevel]/.)] | $ancestorNode/ancestors/apiValue[( not(apiValueDetail/apiValueDef/apiProperty)=($isConst='true') or apiValueDetail/apiValueDef/apiProperty='false') and (apiValueDetail/apiValueDef/apiAccess/@value = $accessLevel or apiValueDetail/apiValueDef/apiAccess/@value=$config/namespaces/namespace[@summaryDisplay=$accessLevel]/.)]\">\n\t\t\t\t\t\t<xsl:sort select=\"translate(apiName,'_','')\" order=\"ascending\" data-type=\"text\" lang=\"en-US\"/>\n\t\t\t\t\t\t<xsl:variable name=\"name\" select=\"./apiName\"/>\n\t\t\t\t\t\t<xsl:variable name=\"rowStyle\">\n\t\t\t\t\t\t\t<xsl:if test=\"ancestor::ancestors\">\n\t\t\t\t\t\t\t\t<xsl:text>hideInherited</xsl:text>\n\t\t\t\t\t\t\t\t<xsl:if test=\"$accessLevel='protected'\">\n\t\t\t\t\t\t\t\t\t<xsl:text>Protected</xsl:text>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"$isConst='true'\">\n\t\t\t\t\t\t\t\t\t<xsl:text>Constant</xsl:text>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"$isConst='false'\">\n\t\t\t\t\t\t\t\t\t<xsl:text>Property</xsl:text>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t<tr class=\"{$rowStyle}\">\n\t\t\t\t\t\t\t<td class=\"summaryTablePaddingCol\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"summaryTableInheritanceCol\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"ancestor::ancestors\">\n\t\t\t\t\t\t\t\t\t<img src=\"{$baseRef}images/inheritedSummary.gif\" alt=\"Inherited\" title=\"Inherited\" class=\"inheritedSummaryImage\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"not(ancestor::ancestors)\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"summaryTableSignatureCol\">\n\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor::ancestors\">\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"hLink\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"memberName\" select=\"./apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"id\" select=\"./@id\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"classNameText\" select=\"substring-after($id,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"packageNameText\" select=\"substring-before($id,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"packageName\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"not(contains($packageNameText,'.')) and string-length($packageNameText) = 0\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"''\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$packageNameText\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"className\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"contains($packageName,'.')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($classNameText,':')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring-before($classNameText,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($classNameText,':'))\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$classNameText\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($classNameText,':')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring-before($classNameText,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($classNameText,':'))\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$classNameText\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"methodName\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$memberName != ''\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$memberName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"contains($packageName,'.')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($classNameText,':')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring-after($classNameText,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring-after($id,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"destination\" select=\"concat($packageName,':',$className)\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h1\" select=\"substring-before($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h2\" select=\"substring-after($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"file\" select=\"concat($baseRef,translate($h1,'.','/'),'/',$h2,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"gfile\" select=\"concat($baseRef,$h2,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"completeHLink\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($methodName) &gt; 0\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"contains($methodName,':')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat('#',substring-before($methodName,':'))\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat('#',$methodName)\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($destination,'.') or string-length($packageNameText) &gt; 0\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$completeHLink\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($destination,'.')) and string-length($packageNameText) = 0\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$gfile\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$completeHLink\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"prolog/asMetadata/apiVersion/apiPlatform[@name='AIR'] and not (prolog/asMetadata/apiVersion/apiPlatform[@name='Flash'])\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"insertAIRIcon\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$hLink!=''\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$hLink}\" class=\"signatureLink\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$hLink=''\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor::apiClassifier or ancestor-or-self::apiPackage\">\n\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"prolog/asMetadata/apiVersion/apiPlatform[@name='AIR'] and not (prolog/asMetadata/apiVersion/apiPlatform[@name='Flash'])\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"insertAIRIcon\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t<a href=\"#{$name}\" class=\"signatureLink\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t<xsl:if test=\"./apiValueDetail/apiValueDef/apiValueClassifier | ./apiValueDetail/apiValueDef/apiType \">\n\t\t\t\t\t\t\t\t\t<xsl:text> : </xsl:text>\n\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"./apiValueDetail/apiValueDef/apiValueClassifier\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"destination\" select=\"./apiValueDetail/apiValueDef/apiValueClassifier\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h1\" select=\"substring-after($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h2\" select=\"substring-before($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"file\" select=\"concat($baseRef,translate($h2,'.','/'),'/',$h1,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"gfile\" select=\"concat($baseRef,$destination,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"hyperLink\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($destination,':')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$prog_language_name!='javascript'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($destination,':'))\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$gfile\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$hyperLink = ''\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"./apiValueDetail/apiValueDef/apiValueClassifier\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$hyperLink != ''\">\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$hyperLink}\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"./apiValueDetail/apiValueDef/apiValueClassifier\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"./apiValueDetail/apiValueDef/apiValueClassifier='' or apiValueDetail/apiValueDef/apiValueClassifier='*'\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSpecialTypeLink\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"type\" select=\"'*'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"./apiValueDetail/apiValueDef/apiType/@value='' or apiValueDetail/apiValueDef/apiType/@value='*' or apiValueDetail/apiValueDef/apiType/@value='any'\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSpecialTypeLink\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"type\" select=\"'*'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"./apiValueDetail/apiValueDef/apiType\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"./apiValueDetail/apiValueDef/apiType/@value\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"./apiValueDetail/apiValueDef/apiValueClassifier\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"(string-length(./apiValueDetail/apiValueDef/apiData) or ./apiValueDetail/apiValueDef/apiValueClassifier='String') and ./apiValueDetail/apiValueDef/apiData!='unknown'\">\n\t\t\t\t\t\t\t\t\t<xsl:text> = </xsl:text>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"./apiValueDetail/apiValueDef/apiType/@value='String'\">\n\t\t\t\t\t\t\t\t\t\t<xsl:text>\"</xsl:text>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"./apiValueDetail/apiValueDef/apiData\"/>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"apiValueDetail/apiValueDef/apiType/@value='String'\">\n\t\t\t\t\t\t\t\t\t\t<xsl:text>\"</xsl:text>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"./apiValueDetail/apiValueDef/apiValueClassifier='Number' and ./apiValueDetail/apiValueDef/apiData='unknown'\">\n\t\t\t\t\t\t\t\t\t<xsl:text> = NaN</xsl:text>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"./apiValueDetail/apiValueDef/apiValueClassifier='String' and ./apiValueDetail/apiValueDef/apiData='unknown'\">\n\t\t\t\t\t\t\t\t\t<xsl:text> = \"</xsl:text>\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"./apiValueDetail/apiValueDef/apiData\"/>\n\t\t\t\t\t\t\t\t\t<xsl:text>\"</xsl:text>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<div class=\"summaryTableDescription\">\n\t\t\t\t\t\t\t\t\t<xsl:apply-templates select=\"apiValueDetail/apiValueDef/apiDeprecated\"/>\n\t\t\t\t\t\t\t\t\t<xsl:apply-templates select=\"deprecated\"/>\n\n\t\t\t\t\t\t\t\t\t  <xsl:if test=\"./apiValueDetail/apiValueDef/apiIsOverride\">\n\t\t\t\t\t\t\t\t\t\t<xsl:text>[</xsl:text>\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Override']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:text>] </xsl:text>\n\t\t\t\t\t\t\t\t\t  </xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(deprecated)\">\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./apiValueDetail/apiValueDef/apiStatic\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>[</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'static']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>] </xsl:text>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./apiValueDetail/apiValueDef/apiValueAccess/@value and not(./apiValueDetail/apiValueDef/apiValueAccess/@value='readwrite')\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>[</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"value\" select=\"./apiValueDetail/apiValueDef/apiValueAccess/@value\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = $value]]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>-</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'only']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>] </xsl:text>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./shortdesc or $classDeprecated='true'\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"shortDescriptionReview\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$classDeprecated='true'\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:copy-of select=\"$deprecatedLabel\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>. </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(string-length(./shortdesc/@conref) &gt; 0)\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"./shortdesc\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<xsl:if test=\"not($config/options/@docversion='2')\">\n\t\t\t\t\t\t\t\t<td class=\"summaryTableOwnerCol\">\n\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor::ancestors\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"classLink\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"id\" select=\"./@id\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"classNameText\" select=\"substring-after($id,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"packageNameText\" select=\"substring-before($id,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"packageName\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"not(contains($packageNameText,'.')) and string-length($packageNameText) = 0\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"''\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$packageNameText\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"className\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"contains($packageName,'.')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($classNameText,':')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring-before($classNameText,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($classNameText,':'))\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$classNameText\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($classNameText,':')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring-before($classNameText,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($classNameText,':'))\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$classNameText\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"destination\" select=\"concat($packageName,':',$className)\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h1\" select=\"substring-before($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h2\" select=\"substring-after($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"file\" select=\"concat($baseRef,translate($h1,'.','/'),'/',$h2,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"gfile\" select=\"concat($baseRef,$h2,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($id,'.') or string-length($packageNameText) &gt; 0\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($id,'.')) and string-length($packageNameText) = 0\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$gfile\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"className\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getClassNameFromId\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"id\" select=\"./@id\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$classLink!=''\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$classLink}\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$className\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$className\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor::apiClassifier\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"ancestor::apiClassifier/apiName\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor-or-self::apiPackage\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"ancestor-or-self::apiPackage/apiName='__Global__'\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat('Top',$nbsp,'Level')\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"ancestor-or-self::apiPackage/apiName!='__Global__'\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</xsl:for-each>\n\t\t\t\t</table>\n\t\t\t\t<!-- AS2 INHERITED PROPERTIES -->\n\t\t\t\t<xsl:if test=\"$config/options/@docversion='2'\">\n\t\t\t\t\t<xsl:for-each select=\"asAncestors/asAncestor\">\n\t\t\t\t\t\t<xsl:call-template name=\"inherited\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"lowerType\">properties</xsl:with-param>\n\t\t\t\t\t\t\t<xsl:with-param name=\"upperType\">Properties</xsl:with-param>\n\t\t\t\t\t\t\t<xsl:with-param name=\"inheritedItems\" select=\"@properties\"/>\n\t\t\t\t\t\t\t<xsl:with-param name=\"staticItems\" select=\"@staticProperties\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:for-each>\n\t\t\t\t</xsl:if>\n\t\t\t</div>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template match=\"apiValue\" mode=\"detail\">\n\t\t<xsl:param name=\"classDeprecated\" select=\"'false'\"/>\n\t\t<xsl:param name=\"isConst\" select=\"'false'\"/>\n\t\t<xsl:param name=\"baseRef\"/>\n\t\t<xsl:variable name=\"cntPropOrConst\">\n\t\t\t<xsl:if test=\"$isConst='true'\">\n\t\t\t\t<xsl:value-of select=\"count(../apiValue/apiValueDetail/apiValueDef[not(apiProperty)])\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"$isConst='false'\">\n\t\t\t\t<xsl:value-of select=\"count(apiValueDetail/apiValueDef/apiProperty)\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:if test=\"$cntPropOrConst &gt; 0\">\n\t\t\t<xsl:if test=\"$isConst='true'\">\n\t\t\t\t<a name=\"constantDetail\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not($isConst='true')\">\n\t\t\t\t<a name=\"propertyDetail\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"$cntPropOrConst &gt; 0\">\n\t\t\t\t<xsl:for-each select=\"./apiName\">\n\t\t\t\t\t<xsl:sort select=\"translate(./apiName,'_','')\" order=\"ascending\" lang=\"en-US\"/>\n\t\t\t\t</xsl:for-each>\n\t\t\t\t<xsl:variable name=\"name\" select=\"./apiName\"/>\n\t\t\t\t<a name=\"{$name}\"/>\n\t\t\t\t<table class=\"detailHeader\" cellpadding=\"0\" cellspacing=\"0\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=\"detailHeaderName\">\n\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"prolog/asMetadata/apiVersion/apiPlatform[@name='AIR'] and not (prolog/asMetadata/apiVersion/apiPlatform[@name='Flash'])\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"insertAIRIcon\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td class=\"detailHeaderType\">\n\t\t\t\t\t\t\t<xsl:if test=\"not(apiValueDetail/apiValueDef/apiProperty)\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Constant']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"apiValueDetail/apiValueDef/apiProperty\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Property']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<xsl:if test=\"position()!=1\">\n\t\t\t\t\t\t\t<td class=\"detailHeaderRule\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t\t<div class=\"detailBody\">\n\t\t\t\t\t<code>\n\t\t\t\t\t\t<xsl:if test=\"string-length(apiValueDetail/apiValueDef/apiValueAccess/@value)\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"not(string-length(apiValueDetail/apiValueDef/apiValueAccess/@value))\">\n\t\t\t\t\t\t\t<xsl:call-template name=\"getNamespaceLink\">\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"accessLevel\" select=\"apiValueDetail/apiValueDef/apiAccess/@value\"/>\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t<xsl:if test=\"apiValueDetail/apiValueDef/apiStatic\">\n\t\t\t\t\t\t\t\t<xsl:text>static </xsl:text>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"$prog_language_name='ActionScript'\">\n\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t<xsl:when test=\"not(apiValueDetail/apiValueDef/apiProperty) and $config/options/@docversion='3'\">\n\t\t\t\t\t\t\t\t\t\t<xsl:text>const </xsl:text>\n\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t<xsl:text>var </xsl:text>\n\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"apiValueDetail/apiValueDef/apiValueClassifier | apiValueDetail/apiValueDef/apiType\">\n\t\t\t\t\t\t\t<xsl:text>:</xsl:text>\n\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t<xsl:when test=\"apiValueDetail/apiValueDef/apiValueClassifier\">\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"destination\" select=\"./apiValueDetail/apiValueDef/apiValueClassifier\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h1\" select=\"substring-after($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h2\" select=\"substring-before($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"file\" select=\"concat($baseRef,translate($h2,'.','/'),'/',$h1,'.html')\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"gfile\" select=\"concat($baseRef,$destination,'.html')\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"hyperLink\">\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($destination,':')\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$prog_language_name!='javascript'\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($destination,':'))\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$gfile\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$hyperLink = ''\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"apiValueDetail/apiValueDef/apiValueClassifier\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$hyperLink != ''\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"{$hyperLink}\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"apiValueDetail/apiValueDef/apiValueClassifier\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t<xsl:when\n\t\t\t\t\t\t\t\t\ttest=\"apiValueDetail/apiValueDef/apiValueClassifier='' or apiValueDetail/apiValueDef/apiValueClassifier='*' or apiValueDetail/apiValueDef/apiType/@value='' or apiValueDetail/apiValueDef/apiType/@value='*' or apiValueDetail/apiValueDef/apiType/@value='any'\">\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSpecialTypeLink\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"type\" select=\"'*'\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t<xsl:when test=\"apiValueDetail/apiValueDef/apiType\">\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"apiValueDetail/apiValueDef/apiType/@value\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"apiValueDetail/apiValueDef/apiValueClassifier\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"(string-length(apiValueDetail/apiValueDef/apiData) or apiValueDetail/apiValueDef/apiValueClassifier='String') and apiValueDetail/apiValueDef/apiData!='unknown'\">\n\t\t\t\t\t\t\t<xsl:text> = </xsl:text>\n\t\t\t\t\t\t\t<xsl:if test=\"apiValueDetail/apiValueDef/apiType/@value='String'\">\n\t\t\t\t\t\t\t\t<xsl:text>\"</xsl:text>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:value-of select=\"apiValueDetail/apiValueDef/apiData\"/>\n\t\t\t\t\t\t\t<xsl:if test=\"apiValueDetail/apiValueDef/apiType/@value='String'\">\n\t\t\t\t\t\t\t\t<xsl:text>\"</xsl:text>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:if>\n\n\t\t\t\t\t\t<xsl:if test=\"apiValueDetail/apiValueDef/apiValueClassifier='Number' and apiValueDetail/apiValueDef/apiData='unknown'\">\n\t\t\t\t\t\t\t<xsl:text> = NaN</xsl:text>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"apiValueDetail/apiValueDef/apiValueClassifier='String' and apiValueDetail/apiValueDef/apiData='unknown'\">\n\t\t\t\t\t\t\t<xsl:text> = \"</xsl:text>\n\t\t\t\t\t\t\t<xsl:value-of select=\"apiValueDetail/apiValueDef/apiData\"/>\n\t\t\t\t\t\t\t<xsl:text>\"</xsl:text>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</code>\n\t\t\t\t\t<xsl:if test=\"string-length(apiValueDetail/apiValueDef/apiValueAccess/@value)\">\n\t\t\t\t\t\t<xsl:if test=\"not(apiValueDetail/apiValueDef/apiValueAccess/@value='readwrite')\">\n\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\"><![CDATA[&nbsp;&nbsp;]]>[</xsl:text>\n\t\t\t\t\t\t\t<xsl:variable name=\"value\" select=\"apiValueDetail/apiValueDef/apiValueAccess/@value\"/>\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = $value]]/entry[2]/p\"/>\n\t\t\t\t\t\t\t<xsl:text>-</xsl:text>\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'only']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t<xsl:text>] </xsl:text>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t  <xsl:if test=\"apiValueDetail/apiValueDef/apiIsOverride\">\n\t\t\t\t\t\t<xsl:text>[</xsl:text>\n\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Override']]/entry[2]/p\"/>\n\t\t\t\t\t\t<xsl:text>] </xsl:text>\n\t\t\t\t\t  </xsl:if>\n\t\t\t\t\t<xsl:apply-templates select=\"apiValueDetail/apiValueDef/apiDeprecated\"/>\n\t\t\t\t\t<xsl:apply-templates select=\"deprecated\"/>\n\t\t\t\t\t<xsl:if test=\"$classDeprecated='true'\">\n\t\t\t\t\t\t<xsl:call-template name=\"description\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t\t\t<xsl:with-param name=\"addParagraphTags\" select=\"true()\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:call-template name=\"version\"/>\n\t\t\t\t\t<xsl:if test=\"$classDeprecated!='true'\">\n\t\t\t\t\t\t<xsl:call-template name=\"description\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t\t\t<xsl:with-param name=\"addParagraphTags\" select=\"true()\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t<xsl:for-each select=\"apiDesc\">\n\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"apiValueDetail/apiValueDef/apiDefaultValue\">\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'DefaultValueIs']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t<code>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"normalize-space(apiValueDetail/apiValueDef/apiDefaultValue/.)\"/>\n\t\t\t\t\t\t\t</code>\n\t\t\t\t\t\t\t<xsl:text>.</xsl:text>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"apiValueDetail/apiValueDef/apiProperty/@isBindable='true'\">\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'DataBinding']]/entry[2]/p\"/>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t<xsl:if test=\"string-length(apiValueDetail/apiValueDef/apiValueAccess/@value)\">\n\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t\t\t\t\t<span class=\"label\">\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\">Implementation</xsl:with-param>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t\t\t\t\t<xsl:if test=\"contains(apiValueDetail/apiValueDef/apiValueAccess/@value,'read')\">\n\t\t\t\t\t\t\t\t\t<code>\n\t\t\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\"><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;]]></xsl:text>\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getNamespaceLink\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"accessLevel\" select=\"apiValueDetail/apiValueDef/apiAccess/@value\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"apiValueDetail/apiValueDef/apiStatic\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>static </xsl:text>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:text>function get </xsl:text>\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:text>():</xsl:text>\n\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"./apiValueDetail/apiValueDef/apiValueClassifier\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"destination\" select=\"./apiValueDetail/apiValueDef/apiValueClassifier\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h1\" select=\"substring-after($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h2\" select=\"substring-before($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"file\" select=\"concat($baseRef,translate($h2,'.','/'),'/',$h1,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"gfile\" select=\"concat($baseRef,$destination,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"hyperLink\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($destination,'.')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($destination,'.'))\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$gfile\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$hyperLink = ''\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"apiValueDetail/apiValueDef/apiValueClassifier\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$hyperLink != ''\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$hyperLink}\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"apiValueDetail/apiValueDef/apiValueClassifier\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:when\n\t\t\t\t\t\t\t\t\t\t\t\ttest=\"apiValueDetail/apiValueDef/apiValueClassifier='' or apiValueDetail/apiValueDef/apiValueClassifier='*' or apiValueDetail/apiValueDef/apiType/@value='any' or apiValueDetail/apiValueDef/apiType/@value='' or apiValueDetail/apiValueDef/apiType/@value='*'\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSpecialTypeLink\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"type\" select=\"'*'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"apiValueDetail/apiValueDef/apiType\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"apiValueDetail/apiValueDef/apiType/@value\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"apiValueDetail/apiValueDef/apiValueClassifier\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t</code>\n\t\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"contains(apiValueDetail/apiValueDef/apiValueAccess/@value,'write')\">\n\t\t\t\t\t\t\t\t\t<code>\n\t\t\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\"><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;]]></xsl:text>\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getNamespaceLink\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"accessLevel\" select=\"apiValueDetail/apiValueDef/apiAccess/@value\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"apiValueDetail/apiValueDef/apiStatic\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>static </xsl:text>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:text>function set </xsl:text>\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:text>(value:</xsl:text>\n\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"./apiValueDetail/apiValueDef/apiValueClassifier\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"destination\" select=\"./apiValueDetail/apiValueDef/apiValueClassifier\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h1\" select=\"substring-after($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h2\" select=\"substring-before($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"file\" select=\"concat($baseRef,translate($h2,'.','/'),'/',$h1,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"gfile\" select=\"concat($baseRef,$destination,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"hyperLink\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($destination,'.')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($destination,'.'))\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$gfile\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$hyperLink = ''\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"apiValueDetail/apiValueDef/apiValueClassifier\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$hyperLink != ''\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$hyperLink}\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"apiValueDetail/apiValueDef/apiValueClassifier\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"apiValueDetail/apiValueDef/apiValueClassifier='' or apiValueDetail/apiValueDef/apiValueClassifier='*'\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSpecialTypeLink\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"type\" select=\"'*'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"apiValueDetail/apiValueDef/apiType\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"apiValueDetail/apiValueDef/apiType/@value\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"apiValueDetail/apiValueDef/apiValueClassifier\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t<xsl:text>):</xsl:text>\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSpecialTypeLink\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"type\" select=\"'void'\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</code>\n\t\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t<xsl:if test=\"apiValueDetail/apiValueDef/apiException\">\n\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t\t\t<span class=\"label\">\n\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\">Throws</xsl:with-param>\n\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n\t\t\t\t\t\t\t<xsl:apply-templates select=\"apiValueDetail/apiValueDef/apiException\"/>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:call-template name=\"sees\"/>\n\t\t\t\t\t<xsl:if test=\"./*/example[codeblock] | includeExamples/includeExample[codepart]\">\n\t\t\t\t\t\t<xsl:call-template name=\"includeExamples\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"createExampleLink\" select=\"'false'\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"./*/example[not(codeblock)] | includeExamples/includeExample[not(codepart)] \">\n\t\t\t\t\t\t<xsl:for-each select=\"./*/example | includeExamples/includeExample[not(codepart)]\">\n\t\t\t\t\t\t\t<xsl:if test=\"count(descendant::*) &gt; 0\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"position() = 1\">\n\t\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t\t\t\t\t\t<span class=\"label\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\">Example</xsl:with-param>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</div>\n\t\t\t</xsl:if>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<!-- STYLES -->\n\t<xsl:template name=\"stylesSummary\">\n\t\t<xsl:param name=\"classDeprecated\" select=\"'false'\"/>\n\t\t<xsl:param name=\"baseRef\" select=\"''\"/>\n\t\t<xsl:param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t<xsl:param name=\"interfaces\" tunnel=\"yes\"/>\n\t\t<xsl:variable name=\"ancestorexcludes\">\n\t\t\t<excludes>\n\t\t\t\t<xsl:variable name=\"self\" select=\"@id\"/>\n\t\t\t\t<xsl:for-each select=\"$classHeader_map//apiClassifier[@id = $self]//Excludes/Exclude[@kind='style']\">\n\t\t\t\t\t<xsl:copy-of select=\".\"/>\n\t\t\t\t</xsl:for-each>\n\t\t\t</excludes>\n\t\t</xsl:variable>\n\t\t<!--List of styles to suppress when creating inheritance list.  Includes both the existing styles and any exclusions-->\n\t\t<xsl:variable name=\"stylesList\">\n\t\t\t<xsl:for-each select=\"prolog/asMetadata/styles/style\">\n\t\t\t\t<xsl:value-of select=\"concat(' ',@name,' ')\"/>\n\t\t\t</xsl:for-each>\n\t\t\t<xsl:for-each select=\"$ancestorexcludes/excludes/Exclude\">\n\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t</xsl:for-each>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"hasStyles\" select=\"count(prolog/asMetadata[styles/style]) &gt; 0\"/>\n\t\t<xsl:variable name=\"ancestorNodes\">\n\t\t\t<ancestors>\n\t\t\t\t<xsl:call-template name=\"getInheritedStyle\">\n\t\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"./apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t\t\t<xsl:with-param name=\"stylesList\" select=\"$stylesList\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</ancestors>\n\t\t\t<xsl:for-each select=\"$interfaces/interface\">\n\t\t\t\t<xsl:call-template name=\"getInheritedStyle\">\n\t\t\t\t\t<xsl:with-param name=\"baseClass\" select=\".\"/>\n\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t\t\t<xsl:with-param name=\"stylesList\" select=\"$stylesList\"/>\n\t\t\t\t\t<xsl:with-param name=\"processParentClass\" select=\"false()\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:for-each>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"hasInherited\" select=\"count($ancestorNodes/ancestors/style) &gt; 0\"/>\n\t\t<xsl:if test=\"$hasStyles or $hasInherited\">\n\t\t\t<a name=\"styleSummary\"/>\n\t\t\t<div class=\"summarySection\">\n\t\t\t\t<div class=\"summaryTableTitle\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Styles']]/entry[2]/p\"/>\n\t\t\t\t</div>\n\t\t\t\t<xsl:if test=\"$hasInherited\">\n\t\t\t\t\t<div class=\"showHideLinks\">\n\t\t\t\t\t\t<div id=\"hideInheritedStyle\" class=\"hideInheritedStyle\">\n\t\t\t\t\t\t\t<a class=\"showHideLink\" href=\"#styleSummary\" onclick=\"javascript:setInheritedVisible(false,'Style');\">\n\t\t\t\t\t\t\t\t<img class=\"showHideLinkImage\" src=\"{$baseRef}images/expanded.gif\"/>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'HideInheritedStyles']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div id=\"showInheritedStyle\" class=\"showInheritedStyle\">\n\t\t\t\t\t\t\t<a class=\"showHideLink\" href=\"#styleSummary\" onclick=\"javascript:setInheritedVisible(true,'Style');\">\n\t\t\t\t\t\t\t\t<img class=\"showHideLinkImage\" src=\"{$baseRef}images/collapsed.gif\"/>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ShowInheritedStyles']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:variable name=\"tableStyle\">\n\t\t\t\t\t<xsl:if test=\"$hasInherited and not($hasStyles)\">\n\t\t\t\t\t\t<xsl:text>hideInheritedStyle</xsl:text>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<table cellspacing=\"0\" cellpadding=\"3\" class=\"summaryTable {$tableStyle}\" id=\"summaryTableStyle\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th colspan=\"2\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'StyleStyle']]/entry[2]/p\"/>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th class=\"summaryTableOwnerCol\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'DefinedBy']]/entry[2]/p\"/>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<xsl:for-each select=\"./prolog/asMetadata/styles/style | $ancestorNodes/ancestors/style\">\n\t\t\t\t\t\t<xsl:sort select=\"@name\" order=\"ascending\" data-type=\"text\" lang=\"en-US\"/>\n\t\t\t\t\t\t<xsl:variable name=\"sequence\" select=\"ancestor::apiClassifierDetail/apiClassifierDef\"/>\n\t\t\t\t\t\t<xsl:variable name=\"apihtml\" select=\"concat(ancestor::apiClassifier/apiName,'.html')\"/>\n\t\t\t\t\t\t<xsl:variable name=\"destination\" select=\"./@owner\"/>\n\t\t\t\t\t\t<xsl:variable name=\"rowStyle\">\n\t\t\t\t\t\t\t<xsl:if test=\"ancestor::ancestors\">\n\t\t\t\t\t\t\t\t<xsl:text>hideInheritedStyle</xsl:text>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t<tr class=\"{$rowStyle}\">\n\t\t\t\t\t\t\t<td class=\"summaryTablePaddingCol\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"summaryTableInheritanceCol\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"ancestor::ancestors\">\n\t\t\t\t\t\t\t\t\t<img src=\"{$baseRef}images/inheritedSummary.gif\" alt=\"Inherited\" title=\"Inherited\" class=\"inheritedSummaryImage\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"not(ancestor::ancestors)\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"summaryTableSignatureCol\">\n\t\t\t\t\t\t\t\t<div class=\"summarySignature\">\n\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor::ancestors\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"destination\" select=\"./@owner\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h1\" select=\"substring-after($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h2\" select=\"substring-before($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"file\" select=\"concat($baseRef,translate($h2,'.','/'),'/',$h1,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"gfile\" select=\"concat($baseRef,translate($destination,':','/'),'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"hyperLink\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($destination,'.')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($destination,'.'))\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$gfile\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$hyperLink = ''\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$hyperLink != ''\">\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$hyperLink}#style:{@name}\" class=\"signatureLink\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor::apiClassifier\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"#style:{@name}\" class=\"signatureLink\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"@type\">\n\t\t\t\t\t\t\t\t\t\t<xsl:text> : </xsl:text>\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"@type\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t<div class=\"summaryTableDescription\">\n\t\t\t\t\t\t\t\t\t<xsl:apply-templates select=\"apiValueDetail/apiValueDef/apiDeprecated\"/>\n\t\t\t\t\t\t\t\t\t<xsl:apply-templates select=\"deprecated\"/>\n\n\t\t\t\t\t\t\t\t\t  <xsl:if test=\"./apiValueDetail/apiValueDef/apiIsOverride\">\n\t\t\t\t\t\t\t\t\t\t<xsl:text>[</xsl:text>\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Override']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:text>] </xsl:text>\n\t\t\t\t\t\t\t\t\t  </xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(deprecated)\">\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./apiValueDetail/apiValueDef/apiStatic\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>[</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'static']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>] </xsl:text>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./apiValueDetail/apiValueDef/apiValueAccess/@value and not(./apiValueDetail/apiValueDef/apiValueAccess/@value='readwrite')\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>[</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"value\" select=\"./apiValueDetail/apiValueDef/apiValueAccess/@value\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = $value]]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>-</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'only']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>] </xsl:text>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"description\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getFirstSentence\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"inText\" select=\"./description\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$description\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"summaryTableOwnerCol\">\n\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor::ancestors\">\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"destination\" select=\"./@owner\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h1\" select=\"substring-after($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h2\" select=\"substring-before($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"file\" select=\"concat($baseRef,translate($h2,'.','/'),'/',$h1,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"gfile\" select=\"concat($baseRef,translate($destination,':','/'),'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"classLink\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($destination,'.')\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($destination,'.'))\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$gfile\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$classLink = ''\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring-after(./@owner,':')\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$classLink != ''\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$classLink}\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring-after(./@owner,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor::apiClassifier\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"ancestor::apiClassifier/apiName\"/>\n\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</xsl:for-each>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<!-- SKINSTATE -->\n\t<xsl:template name=\"SkinStateSummary\">\n\t<xsl:param name=\"classDeprecated\" select=\"'false'\"/>\n\t<xsl:param name=\"baseRef\" select=\"''\"/>\n\t<xsl:param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t<xsl:param name=\"interfaces\" tunnel=\"yes\"/>\n\t<xsl:variable name=\"SkinStateList\">\n\t<xsl:for-each select=\"./prolog/asMetadata/skinStates/SkinState\">\n\t<xsl:value-of select=\"concat(' ',@name,' ')\"/>\n\t</xsl:for-each>\n\t</xsl:variable>\n\t<xsl:variable name=\"hasSkinState\" select=\"count(./prolog/asMetadata[skinStates/SkinState]) &gt; 0\"/>\n\t<xsl:variable name=\"ancestorNodes\">\n\t<ancestors>\n\t<xsl:call-template name=\"getInheritedSkinState\">\n\t  <xsl:with-param name=\"baseClass\" select=\"./apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t  <xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t  <xsl:with-param name=\"SkinStateList\" select=\"$SkinStateList\"/>\n\t</xsl:call-template>\n\t</ancestors>\n\t<xsl:for-each select=\"$interfaces/interface\">\n\t<xsl:call-template name=\"getInheritedSkinState\">\n\t  <xsl:with-param name=\"baseClass\" select=\".\"/>\n\t  <xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t  <xsl:with-param name=\"SkinStateList\" select=\"$SkinStateList\"/>\n\t  <xsl:with-param name=\"processParentClass\" select=\"false()\"/>\n\t</xsl:call-template>\n\t</xsl:for-each>\n\t</xsl:variable>\n\t<xsl:variable name=\"hasInherited\" select=\"count($ancestorNodes/ancestors/SkinState) &gt; 0\"/>\n\t<xsl:if test=\"$hasSkinState or $hasInherited\">\n\t<a name=\"SkinStateSummary\"/>\n\t<div class=\"summarySection\">\n\t<div class=\"summaryTableTitle\">\n\t  <xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'SkinStates']]/entry[2]/p\"/>\n\t</div>\n\t<p><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'skinstateprefixed']]/entry[2]/p\"/></p>\n\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t<!-- Start: Bug#2259590 Shinde Date: 13.03.09 Adding a link to the doc -->\n\t<xsl:if test=\"$isSkin!=''\">\n\t  <div class=\"showHideLinks\">\n\t    <a href=\"{$isSkin}\" target=\"_blank\">\n\t      <xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'howtouseskins']]/entry[2]/p\"/>\n\t    </a>\n\t  </div>\n\t</xsl:if>\n\t<!-- End: Bug#2259590 Shinde Date: 13.03.09 Adding a link to the doc -->\n\t<xsl:if test=\"$hasInherited\">\n\t  <div class=\"showHideLinks\">\n\t    <div id=\"hideInheritedSkinState\" class=\"hideInheritedSkinState\">\n\t      <a class=\"showHideLink\" href=\"#SkinStateSummary\" onclick=\"javascript:setInheritedVisible(false,'SkinState');\">\n\t\t<img class=\"showHideLinkImage\" src=\"{$baseRef}images/expanded.gif\"/>\n\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'HideInheritedSkinStates']]/entry[2]/p\"/>\n\t      </a>\n\t    </div>\n\t    <div id=\"showInheritedSkinState\" class=\"showInheritedSkinState\">\n\t      <a class=\"showHideLink\" href=\"#SkinStateSummary\" onclick=\"javascript:setInheritedVisible(true,'SkinState');\">\n\t\t<img class=\"showHideLinkImage\" src=\"{$baseRef}images/collapsed.gif\"/>\n\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ShowInheritedSkinStates']]/entry[2]/p\"/>\n\t      </a>\n\t    </div>\n\t  </div>\n\t</xsl:if>\n\t<xsl:variable name=\"tableSkinState\">\n\t  <xsl:if test=\"$hasInherited and not($hasSkinState)\">\n\t    <xsl:text>hideInheritedSkinState</xsl:text>\n\t  </xsl:if>\n\t</xsl:variable>\n\t<table cellspacing=\"0\" cellpadding=\"3\" class=\"summaryTable {$tableSkinState}\" id=\"summaryTableSkinState\">\n\t  <tr>\n\t    <th>\n\t      <xsl:value-of select=\"$nbsp\"/>\n\t    </th>\n\t    <th colspan=\"2\">\n\t      <xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'SkinState']]/entry[2]/p\"/>\n\t    </th>\n\t    <th>\n\t      <xsl:call-template name=\"getLocalizedString\">\n\t\t<xsl:with-param name=\"key\">Description</xsl:with-param>\n\t      </xsl:call-template>\n\t    </th>\n\t    <th>\n\t      <xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'DefinedBy']]/entry[2]/p\"/>\n\t    </th>\n\t  </tr>\n\t  <xsl:for-each select=\"./prolog/asMetadata/skinStates/SkinState | $ancestorNodes/ancestors/SkinState\">\n\t    <xsl:sort select=\"@name\" order=\"ascending\" data-type=\"text\" lang=\"en-US\"/>\n\t    <xsl:variable name=\"sequence\" select=\"ancestor::apiClassifierDetail/apiClassifierDef\"/>\n\t    <xsl:variable name=\"apihtml\" select=\"concat(ancestor::apiClassifier/apiName,'.html')\"/>\n\t    <xsl:variable name=\"destination\" select=\"./@owner\"/>\n\t    <xsl:variable name=\"rowStyle\">\n\t      <xsl:if test=\"ancestor::ancestors\">\n\t\t<xsl:text>hideInheritedskinState</xsl:text>\n\t      </xsl:if>\n\t    </xsl:variable>\n\t    <tr class=\"{$rowStyle}\">\n\t      <td class=\"summaryTablePaddingCol\">\n\t\t<xsl:if test=\"not(ancestor::ancestors)\">\n\t\t  <a name=\"skinstate:{@name}\"/>\n\t\t</xsl:if>\n\t\t<xsl:value-of select=\"$nbsp\"/>\n\t      </td>\n\t      <td class=\"summaryTableInheritanceCol\">\n\t\t<xsl:if test=\"ancestor::ancestors\">\n\t\t  <img src=\"{$baseRef}images/inheritedSummary.gif\" alt=\"Inherited\" title=\"Inherited\" class=\"inheritedSummaryImage\"/>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"not(ancestor::ancestors)\">\n\t\t  <xsl:value-of select=\"$nbsp\"/>\n\t\t</xsl:if>\n\t      </td>\n\t      <td class=\"summaryTableSignatureCol\">\n\t\t<div class=\"summarySignature\">\n\t\t  <xsl:choose>\n\t\t    <xsl:when test=\"ancestor::ancestors\">\n\t\t      <xsl:variable name=\"destination\" select=\"./@owner\"/>\n\t\t      <xsl:variable name=\"h1\" select=\"substring-after($destination,':')\"/>\n\t\t      <xsl:variable name=\"h2\" select=\"substring-before($destination,':')\"/>\n\t\t      <xsl:variable name=\"file\" select=\"concat($baseRef,translate($h2,'.','/'),'/',$h1,'.html')\"/>\n\t\t      <xsl:variable name=\"gfile\" select=\"concat($baseRef,replace($destination, ':', '/'),'.html')\"/>\n\t\t      <xsl:variable name=\"hyperLink\">\n\t\t\t<xsl:if test=\"contains($destination,'.')\">\n\t\t\t  <xsl:value-of select=\"$file\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($destination,'.'))\">\n\t\t\t  <xsl:value-of select=\"$gfile\"/>\n\t\t\t</xsl:if>\n\t\t      </xsl:variable>\n\t\t      <xsl:if test=\"$hyperLink = ''\">\n\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t      </xsl:if>\n\t\t      <xsl:if test=\"$hyperLink != ''\">\n\t\t\t<a href=\"{$hyperLink}#skinstate:{@name}\" class=\"signatureLink\">\n\t\t\t  <xsl:value-of select=\"@name\"/>\n\t\t\t</a>\n\t\t      </xsl:if>\n\t\t    </xsl:when>\n\t\t    <xsl:when test=\"ancestor::apiClassifier\">\n\t\t      <span class=\"signatureLink\">\n\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t      </span>\n\t\t    </xsl:when>\n\t\t  </xsl:choose>\n\t\t</div>\n\t      </td>\n\t      <td class=\"summaryTableDescription\">\n\t\t<xsl:if test=\"not(ancestor::ancestors)\">\n\t\t  <xsl:call-template name=\"deTilda\">\n\t\t    <xsl:with-param name=\"inText\" select=\"description/.\"/>\n\t\t  </xsl:call-template>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"ancestor::ancestors\">\n\t\t  <xsl:call-template name=\"deTilda\">\n\t\t    <xsl:with-param name=\"inText\" select=\"description/.\"/>\n\t\t  </xsl:call-template>\n\t\t</xsl:if>\n\t\t<xsl:call-template name=\"sees\">\n\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t</xsl:call-template>\n\t      </td>\n\t      <td class=\"summaryTableOwnerCol\">\n\t\t<xsl:choose>\n\t\t  <xsl:when test=\"ancestor::ancestors\">\n\t\t    <xsl:variable name=\"destination\" select=\"./@owner\"/>\n\t\t    <xsl:variable name=\"h1\" select=\"substring-after($destination,':')\"/>\n\t\t    <xsl:variable name=\"h2\" select=\"substring-before($destination,':')\"/>\n\t\t    <xsl:variable name=\"file\" select=\"concat($baseRef,translate($h2,'.','/'),'/',$h1,'.html')\"/>\n\t\t    <xsl:variable name=\"gfile\" select=\"concat($baseRef,replace($destination, ':', '/'),'.html')\"/>\n\t\t    <xsl:variable name=\"classLink\">\n\t\t      <xsl:if test=\"contains($destination,'.')\">\n\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t      </xsl:if>\n\t\t      <xsl:if test=\"not(contains($destination,'.'))\">\n\t\t\t<xsl:value-of select=\"$gfile\"/>\n\t\t      </xsl:if>\n\t\t    </xsl:variable>\n\t\t    <xsl:if test=\"$classLink = ''\">\n\t\t      <xsl:value-of select=\"substring-after(./@owner,':')\"/>\n\t\t    </xsl:if>\n\t\t    <xsl:if test=\"$classLink != ''\">\n\t\t      <a href=\"{$classLink}\">\n\t\t\t<xsl:value-of select=\"substring-after(./@owner,':')\"/>\n\t\t      </a>\n\t\t    </xsl:if>\n\t\t  </xsl:when>\n\t\t  <xsl:when test=\"ancestor::apiClassifier\">\n\t\t    <xsl:value-of select=\"ancestor::apiClassifier/apiName\"/>\n\t\t  </xsl:when>\n\t\t</xsl:choose>\n\t      </td>\n\t    </tr>\n\t  </xsl:for-each>\n\t</table>\n\t</div>\n\t</xsl:if>\n\t</xsl:template>\n\t<!-- SKIN PART -->\n\t<xsl:template name=\"SkinPartSummary\">\n\t<xsl:param name=\"classDeprecated\" select=\"'false'\"/>\n\t<xsl:param name=\"baseRef\" select=\"''\"/>\n\t<xsl:param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t<xsl:param name=\"interfaces\" tunnel=\"yes\"/>\n\t<xsl:variable name=\"SkinPartList\">\n\t<xsl:for-each select=\"prolog/asMetadata/styles/style\">\n\t<xsl:value-of select=\"concat(' ',@name,' ')\"/>\n\t</xsl:for-each>\n\t</xsl:variable>\n\t<xsl:variable name=\"hasSkinPart\" select=\"count(./prolog/asMetadata[skinParts/SkinPart]) &gt; 0\"/>\n\t<xsl:variable name=\"ancestorNodes\">\n\t<ancestors>\n\t<xsl:call-template name=\"getInheritedSkinPart\">\n\t  <xsl:with-param name=\"baseClass\" select=\"./apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t  <xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t  <xsl:with-param name=\"SkinPartList\" select=\"$SkinPartList\"/>\n\t</xsl:call-template>\n\t</ancestors>\n\t<xsl:for-each select=\"$interfaces/interface\">\n\t<xsl:call-template name=\"getInheritedSkinPart\">\n\t  <xsl:with-param name=\"baseClass\" select=\".\"/>\n\t  <xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t  <xsl:with-param name=\"SkinPartList\" select=\"$SkinPartList\"/>\n\t  <xsl:with-param name=\"processParentClass\" select=\"false()\"/>\n\t</xsl:call-template>\n\t</xsl:for-each>\n\t</xsl:variable>\n\t<xsl:variable name=\"hasInherited\" select=\"count($ancestorNodes/ancestors/SkinPart) &gt; 0\"/>\n\t<xsl:if test=\"$hasSkinPart or $hasInherited\">\n\t<a name=\"SkinPartSummary\"/>\n\t<div class=\"summarySection\">\n\t<div class=\"summaryTableTitle\">\n\t  <xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'SkinParts']]/entry[2]/p\"/>\n\t</div>\n\t<p><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'skinpartprefixed']]/entry[2]/p\"/></p>\n\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t<!-- Start: Bug#2259590 Shinde Date: 13.03.09 Adding a link to the doc -->\n\t<xsl:if test=\"$isSkin!=''\">\n\t  <div class=\"showHideLinks\">\n\t    <a href=\"{$isSkin}\" target=\"_blank\">\n\t      <xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'howtouseskins']]/entry[2]/p\"/>\n\t    </a>\n\t  </div>\n\t</xsl:if>\n\t<!-- End: Bug#2259590 Shinde Date: 13.03.09 Adding a link to the doc -->\n\t<xsl:if test=\"$hasInherited\">\n\t  <div class=\"showHideLinks\">\n\t    <div id=\"hideInheritedSkinPart\" class=\"hideInheritedSkinPart\">\n\t      <a class=\"showHideLink\" href=\"#SkinPartSummary\" onclick=\"javascript:setInheritedVisible(false,'SkinPart');\">\n\t\t<img class=\"showHideLinkImage\" src=\"{$baseRef}images/expanded.gif\"/>\n\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'HideInheritedSkinParts']]/entry[2]/p\"/>\n\t      </a>\n\t    </div>\n\t    <div id=\"showInheritedSkinPart\" class=\"showInheritedSkinPart\">\n\t      <a class=\"showHideLink\" href=\"#SkinPartSummary\" onclick=\"javascript:setInheritedVisible(true,'SkinPart');\">\n\t\t<img class=\"showHideLinkImage\" src=\"{$baseRef}images/collapsed.gif\"/>\n\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ShowInheritedSkinParts']]/entry[2]/p\"/>\n\t      </a>\n\t    </div>\n\t  </div>\n\t</xsl:if>\n\t<xsl:variable name=\"tableStyle\">\n\t  <xsl:if test=\"$hasInherited and not($hasSkinPart)\">\n\t    <xsl:text>hideInheritedSkinPart</xsl:text>\n\t  </xsl:if>\n\t</xsl:variable>\n\t<table cellspacing=\"0\" cellpadding=\"3\" class=\"summaryTable {$tableStyle}\" id=\"summaryTableSkinPart\">\n\t  <tr>\n\t    <th>\n\t      <xsl:value-of select=\"$nbsp\"/>\n\t    </th>\n\t    <th colspan=\"2\">\n\t      <xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'SkinPart']]/entry[2]/p\"/>\n\t    </th>\n\t    <th>\n\t      <xsl:call-template name=\"getLocalizedString\">\n\t\t<xsl:with-param name=\"key\">Description</xsl:with-param>\n\t      </xsl:call-template>\n\t    </th>\n\t    <th>\n\t      <xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'DefinedBy']]/entry[2]/p\"/>\n\t    </th>\n\t  </tr>\n\t  <xsl:for-each select=\"./prolog/asMetadata/skinParts/SkinPart | $ancestorNodes/ancestors/SkinPart\">\n\t    <xsl:sort select=\"@name\" order=\"ascending\" data-type=\"text\" lang=\"en-US\"/>\n\t    <xsl:variable name=\"sequence\" select=\"ancestor::apiClassifierDetail/apiClassifierDef\"/>\n\t    <xsl:variable name=\"apihtml\" select=\"concat(ancestor::apiClassifier/apiName,'.html')\"/>\n\t    <xsl:variable name=\"destination\" select=\"./@owner\"/>\n\t    <xsl:variable name=\"rowStyle\">\n\t      <xsl:if test=\"ancestor::ancestors\">\n\t\t<xsl:text>hideInheritedSkinPart</xsl:text>\n\t      </xsl:if>\n\t    </xsl:variable>\n\t    <tr class=\"{$rowStyle}\">\n\t      <td class=\"summaryTablePaddingCol\">\n\t\t<xsl:if test=\"not(ancestor::ancestors)\">\n\t\t  <a name=\"skinpart:{@name}\"/>\n\t\t</xsl:if>\n\t\t<xsl:value-of select=\"$nbsp\"/>\n\t      </td>\n\t      <td class=\"summaryTableInheritanceCol\">\n\t\t<xsl:if test=\"ancestor::ancestors\">\n\t\t  <img src=\"{$baseRef}images/inheritedSummary.gif\" alt=\"Inherited\" title=\"Inherited\" class=\"inheritedSummaryImage\"/>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"not(ancestor::ancestors)\">\n\t\t  <xsl:value-of select=\"$nbsp\"/>\n\t\t</xsl:if>\n\t      </td>\n\t      <td class=\"summaryTableSignatureCol\">\n\t\t<div class=\"summarySignature\">\n\t\t\t\n\t\t  <xsl:choose>\n\t\t    <xsl:when test=\"ancestor::ancestors\">\n\t\t      <xsl:variable name=\"destination\" select=\"./@owner\"/>\n\t\t      <xsl:variable name=\"h1\" select=\"substring-after($destination,':')\"/>\n\t\t      <xsl:variable name=\"h2\" select=\"substring-before($destination,':')\"/>\n\t\t      <xsl:variable name=\"file\" select=\"concat($baseRef,translate($h2,'.','/'),'/',$h1,'.html')\"/>\n\t\t      <xsl:variable name=\"gfile\" select=\"concat($baseRef,replace($destination, ':', '/'),'.html')\"/>\n\t\t      <xsl:variable name=\"hyperLink\">\n\t\t\t<xsl:if test=\"contains($destination,'.')\">\n\t\t\t  <xsl:value-of select=\"$file\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($destination,'.'))\">\n\t\t\t  <xsl:value-of select=\"$gfile\"/>\n\t\t\t</xsl:if>\n\t\t      </xsl:variable>\n\t\t      <xsl:if test=\"$hyperLink = ''\">\n\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t      </xsl:if>\n\t\t      <xsl:if test=\"$hyperLink != ''\">\n\t\t\t<a href=\"{$hyperLink}#skinpart:{@name}\" class=\"signatureLink\">\n\t\t\t  <xsl:value-of select=\"@name\"/>\n\t\t\t</a>\n\t\t      </xsl:if>\n\t\t    </xsl:when>\n\t\t    <xsl:when test=\"ancestor::apiClassifier\">\n\t\t      <span class=\"signatureLink\">\n\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t      </span>\n\t\t    </xsl:when>\n\t\t  </xsl:choose>\n\t\t  <xsl:if test=\"@var_type\">\n\t\t    <xsl:text>:</xsl:text>\n\t\t    <xsl:variable name=\"destination\" select=\"./@var_type\"/>\n\t\t    <xsl:variable name=\"h1\" select=\"substring-after($destination,':')\"/>\n\t\t    <xsl:variable name=\"h2\" select=\"substring-before($destination,':')\"/>\n\t\t    <xsl:variable name=\"file\" select=\"concat($baseRef,translate($h2,'.','/'),'/',$h1,'.html')\"/>\n\t\t    <xsl:variable name=\"gfile\" select=\"replace(concat($baseRef, $destination, '.html'), ':', '/')\"/>\n\t\t    <xsl:variable name=\"hyperLink\">\n\t\t      <xsl:if test=\"contains($destination,'.')\">\n\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t      </xsl:if>\n\t\t      <xsl:if test=\"not(contains($destination,'.'))\">\n\t\t\t<xsl:value-of select=\"$gfile\"/>\n\t\t      </xsl:if>\n\t\t    </xsl:variable>\n\n\t\t    <xsl:if test=\"count($classHeader_map//apiClassifier[@id=$destination] ) &gt; 0\">\n\t\t\t\t<xsl:if test=\"$hyperLink = ''\">\n\t\t\t\t\t<xsl:if test=\"not(contains($destination,':'))\">\n\t\t\t\t\t\t<xsl:value-of select=\"$destination\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"contains($destination,':')\">\n\t\t\t\t\t\t<xsl:value-of select=\"concat($h2,concat('.',$h1))\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$hyperLink != ''\">\n\t\t\t\t\t<a href=\"{$hyperLink}\" class=\"signatureLink\">\n\t\t\t\t\t\t<xsl:value-of select=\"$h1\"/>\n\t\t      \t\t</a>\n\t\t\t\t</xsl:if>\n\t\t      </xsl:if>\n\t\t      <xsl:if test=\"not(count($classHeader_map//apiClassifier[@id=$destination] ) &gt; 0)\">\n\t\t\t\t\t<xsl:if test=\"not(contains($destination,':'))\">\n\t\t\t\t\t\t<xsl:value-of select=\"$destination\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"contains($destination,':')\">\n\t\t\t\t\t\t<xsl:value-of select=\"concat($h2,concat('.',$h1))\"/>\n\t\t\t\t\t</xsl:if>\n\t\t      </xsl:if>\n\t\t  </xsl:if>\n\t\t</div>\n\t      </td>\n\t      <td class=\"summaryTableDescription\">\n\t\t<xsl:if test=\"string-length(normalize-space(@required)) &gt; 0\">\n\t\t  <span class=\"label\">\n\t\t    <xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Required']]/entry[2]/p\"/>: </span>\n\t\t  <xsl:value-of select=\"normalize-space(@required)\"/>\n\t\t</xsl:if>\n\t\t<xsl:text disable-output-escaping=\"yes\"><![CDATA[&nbsp;]]></xsl:text>\n\t\t<xsl:if test=\"not(@type)\">\n\t\t  <span class=\"label\">\n\t\t    <xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'PartType']]/entry[2]/p\"/>: </span>\n\t\t  <xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Static']]/entry[2]/p\"/>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"@type!=''\">\n\t\t  <span class=\"label\">\n\t\t    <xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'PartType']]/entry[2]/p\"/>: </span>\n\t\t  <xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Dynamic']]/entry[2]/p\"/>\n\t\t</xsl:if>\n\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t<xsl:if test=\"not(ancestor::ancestors)\">\n\t\t  <xsl:call-template name=\"deTilda\">\n\t\t    <xsl:with-param name=\"inText\" select=\"description/.\"/>\n\t\t  </xsl:call-template>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"ancestor::ancestors\">\n\t\t  <xsl:call-template name=\"deTilda\">\n\t\t    <xsl:with-param name=\"inText\" select=\"description/.\"/>\n\t\t  </xsl:call-template>\n\t\t</xsl:if>\n\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t<xsl:if test=\"@type!=''\">\n\t\t    <xsl:variable name=\"hyperlink\">\n\t\t      <xsl:call-template name=\"styleTypeHyperlink\">\n\t\t\t<xsl:with-param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t<xsl:with-param name=\"type\" select=\"@type\"/>\n\t\t      </xsl:call-template>\n\t\t    </xsl:variable>\n\t\t  <xsl:variable name=\"propdesc\">\n\t\t    <xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'dynpropdesc']]/entry[2]/p\"/>\n\t\t  </xsl:variable>\n\t\t  <xsl:variable name=\"destination\" select=\"./@var_type\"/>\n\t\t  <xsl:variable name=\"var_type\" select=\"substring-after($destination,':')\"/>\n\t\t  <xsl:variable name=\"type.value\" select=\"replace($propdesc,'%type%',$var_type)\"/>\n\t\t  \n\t\t  <xsl:variable name=\"full.type\" select=\"replace(@type, ':', '.')\"/>\n\t\t  <xsl:if test=\"replace(@var_type, ':', '.')!=$full.type\">\n\t\t\t  <xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t  <xsl:value-of select=\"$type.value\"/><xsl:text disable-output-escaping=\"yes\"><![CDATA[&nbsp;]]></xsl:text>\n\t\t\t  \n\t\t\t   <xsl:variable name=\"display.type\" >\n\t\t\t\t\t<xsl:call-template name=\"substring-after-last\">\n\t\t\t\t\t\t<xsl:with-param name=\"input\" select=\"$full.type\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"substr\" select=\"'.'\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:variable >\n\t\t\t\t\t\t\t\n\t\t\t\t<xsl:if test=\"count($classHeader_map//apiClassifier[@id=@type] ) &gt; 0\">\n\t\t\t\t\t<a href=\"{$hyperlink}\">\n\t\t\t\t\t\t<xsl:value-of select=\"$display.type\"/>\n\t\t\t\t\t</a>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(count($classHeader_map//apiClassifier[@id=@type] ) &gt; 0)\">\n\t\t\t\t\t<xsl:value-of select=\"$display.type\"/>\n\t\t\t\t</xsl:if>\n\t\t  </xsl:if>\n\t\t</xsl:if>\n\t\t\t<xsl:call-template name=\"sees\">\n\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t</xsl:call-template>\n\t      </td>\n\t      <td class=\"summaryTableOwnerCol\">\n\t\t<xsl:choose>\n\t\t  <xsl:when test=\"ancestor::ancestors\">\n\t\t    <xsl:variable name=\"destination\" select=\"./@owner\"/>\n\t\t    <xsl:variable name=\"h1\" select=\"substring-after($destination,':')\"/>\n\t\t    <xsl:variable name=\"h2\" select=\"substring-before($destination,':')\"/>\n\t\t    <xsl:variable name=\"file\" select=\"concat($baseRef,translate($h2,'.','/'),'/',$h1,'.html')\"/>\n\t\t    <xsl:variable name=\"gfile\" select=\"concat($baseRef,$destination,'.html')\"/>\n\t\t    <xsl:variable name=\"classLink\">\n\t\t      <xsl:if test=\"contains($destination,'.')\">\n\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t      </xsl:if>\n\t\t      <xsl:if test=\"not(contains($destination,'.'))\">\n\t\t\t<xsl:value-of select=\"$gfile\"/>\n\t\t      </xsl:if>\n\t\t    </xsl:variable>\n\t\t    <xsl:if test=\"$classLink = ''\">\n\t\t      <xsl:value-of select=\"substring-after(./@owner,':')\"/>\n\t\t    </xsl:if>\n\t\t    <xsl:if test=\"$classLink != ''\">\n\t\t      <a href=\"{$classLink}\">\n\t\t\t<xsl:value-of select=\"substring-after(./@owner,':')\"/>\n\t\t      </a>\n\t\t    </xsl:if>\n\t\t  </xsl:when>\n\t\t  <xsl:when test=\"ancestor::apiClassifier\">\n\t\t    <xsl:value-of select=\"ancestor::apiClassifier/apiName\"/>\n\t\t  </xsl:when>\n\t\t</xsl:choose>\n\t      </td>\n\t    </tr>\n\t  </xsl:for-each>\n\t</table>\n\t</div>\n\t</xsl:if>\n\t</xsl:template>\t\n\t<!-- EFFECTS -->\n\t<xsl:template name=\"effectsSummary\">\n\t\t<xsl:param name=\"classDeprecated\" select=\"'false'\"/>\n\t\t<xsl:param name=\"baseRef\" select=\"''\"/>\n\t\t<xsl:param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t<xsl:param name=\"interfaces\" tunnel=\"yes\"/>\n\t\t<xsl:variable name=\"ancestorexcludes\">\n\t\t\t<excludes>\n\t\t\t\t<xsl:variable name=\"self\" select=\"@id\"/>\n\t\t\t\t<xsl:for-each select=\"$classHeader_map//apiClassifier[@id = $self]//Excludes/Exclude[@kind='effect']\">\n\t\t\t\t\t<xsl:copy-of select=\".\"/>\n\t\t\t\t</xsl:for-each>\n\t\t\t</excludes>\n\t\t</xsl:variable>\n\t\t<!--List of effects to suppress when creating inheritance list.  Includes both the existing effects and any exclusions-->\n\t\t<xsl:variable name=\"effectsList\">\n\t\t\t<xsl:for-each select=\"prolog/asMetadata/effects/effect\">\n\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t</xsl:for-each>\n\t\t\t<xsl:for-each select=\"$ancestorexcludes/excludes/Exclude\">\n\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t</xsl:for-each>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"hasEffects\" select=\"count(prolog/asMetadata/effects/effect) &gt; 0\"/>\n\t\t<xsl:variable name=\"ancestorNodes\">\n\t\t\t<ancestors>\n\t\t\t\t<xsl:call-template name=\"getInheritedEffect\">\n\t\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"./apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t\t\t<xsl:with-param name=\"effectsList\" select=\"$effectsList\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t\t<xsl:for-each select=\"$interfaces/interface\">\n\t\t\t\t\t<xsl:call-template name=\"getInheritedEffect\">\n\t\t\t\t\t\t<xsl:with-param name=\"baseClass\" select=\".\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"effectsList\" select=\"$effectsList\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"processParentClass\" select=\"false()\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:for-each>\n\t\t\t</ancestors>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"hasInherited\" select=\"count($ancestorNodes/ancestors/effect ) &gt; 0\"/>\n\t\t<xsl:if test=\"$hasEffects or $hasInherited\">\n\t\t\t<a name=\"effectSummary\"/>\n\t\t\t<div class=\"summarySection\">\n\t\t\t\t<div class=\"summaryTableTitle\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Effects']]/entry[2]/p\"/>\n\t\t\t\t</div>\n\t\t\t\t<xsl:if test=\"$hasInherited\">\n\t\t\t\t\t<div class=\"showHideLinks\">\n\t\t\t\t\t\t<div id=\"hideInheritedEffect\" class=\"hideInheritedEffect\">\n\t\t\t\t\t\t\t<a class=\"showHideLink\" href=\"#effectSummary\" onclick=\"javascript:setInheritedVisible(false,'Effect');\">\n\t\t\t\t\t\t\t\t<img class=\"showHideLinkImage\" src=\"{$baseRef}images/expanded.gif\"/>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'HideInheritedEffects']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div id=\"showInheritedEffect\" class=\"showInheritedEffect\">\n\t\t\t\t\t\t\t<a class=\"showHideLink\" href=\"#effectSummary\" onclick=\"javascript:setInheritedVisible(true,'Effect');\">\n\t\t\t\t\t\t\t\t<img class=\"showHideLinkImage\" src=\"{$baseRef}images/collapsed.gif\"/>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ShowInheritedEffects']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:variable name=\"tableStyle\">\n\t\t\t\t\t<xsl:if test=\"$hasInherited and not($hasEffects)\">\n\t\t\t\t\t\t<xsl:text>hideInheritedEffect</xsl:text>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<table cellspacing=\"0\" cellpadding=\"3\" class=\"summaryTable {$tableStyle}\" id=\"summaryTableEffect\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th colspan=\"2\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Effect']]/entry[2]/p\"/>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\">Description</xsl:with-param>\n\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th class=\"summaryTableOwnerCol\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'DefinedBy']]/entry[2]/p\"/>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<xsl:for-each select=\"prolog/asMetadata/effects/effect | $ancestorNodes/ancestors/effect\">\n\t\t\t\t\t\t<xsl:sort select=\"@name\" order=\"ascending\" data-type=\"text\" lang=\"en-US\"/>\n\t\t\t\t\t\t<xsl:variable name=\"owner\" select=\"@owner\"/>\n\t\t\t\t\t\t<xsl:variable name=\"ancestorPath\" select=\"ancestor::apiClassifier/apiClassifierDetail/apiClassifierDef\"/>\n\t\t\t\t\t\t<xsl:variable name=\"rowStyle\">\n\t\t\t\t\t\t\t<xsl:if test=\"ancestor::ancestors\">\n\t\t\t\t\t\t\t\t<xsl:text>hideInheritedEffect</xsl:text>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t<tr class=\"{$rowStyle}\">\n\t\t\t\t\t\t\t<td class=\"summaryTablePaddingCol\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"not(ancestor::ancestors)\">\n\t\t\t\t\t\t\t\t\t<a name=\"effect:{@name}\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"summaryTableInheritanceCol\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"ancestor::ancestors\">\n\t\t\t\t\t\t\t\t\t<img src=\"{$baseRef}images/inheritedSummary.gif\" alt=\"Inherited\" title=\"Inherited\" class=\"inheritedSummaryImage\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"not(ancestor::ancestors)\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<xsl:variable name=\"classLink\">\n\t\t\t\t\t\t\t\t<xsl:variable name=\"id\" select=\"$owner\"/>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"destination\" select=\"$owner\"/>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"h1\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($destination,'.')\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring-before($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($destination,'.'))\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$destination\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"h2\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($destination,'.')\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring-after($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($destination,'.'))\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$destination\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"file\" select=\"concat($baseRef,translate($h1,'.','/'),'/',$h2,'.html')\"/>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"gfile\" select=\"concat($baseRef,$h2,'.html')\"/>\n\t\t\t\t\t\t\t\t<xsl:if test=\"contains($id,'.')\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($id,'.'))\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$gfile\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t<td class=\"summaryTableSignatureCol\">\n\t\t\t\t\t\t\t\t<div class=\"summarySignature\">\n\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor::ancestors\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$classLink}#effect:{@name}\" class=\"signatureLink\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor::apiClassifier\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"signatureLink\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"summaryTableDescription\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"string-length(@event)\">\n\t\t\t\t\t\t\t\t\t<span class=\"label\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'TriggeringEvent']]/entry[2]/p\"/>: </span>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"event\" select=\"@event\"/>\n\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor::apiClassifier/prolog/asMetadata/apiAdobeEvent/event[@name=$event]\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"#event:{@event}\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@event\"/>\n\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor::asClass/asAncestors/asAncestor/eventsGenerated/event[@name=$event]\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"{ancestor::asClass/asAncestors/asAncestor[eventsGenerated/event/@name=$event]/classRef/@relativePath}#event:{@event}\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@event\"/>\n\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@event\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"owner\" select=\"$owner\"/>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"packageName\" select=\"$currentPackage\"/>\n\t\t\t\t\t\t\t\t<xsl:if test=\"@deprecatedReplacement or @deprecatedMessage\">\n\t\t\t\t\t\t\t\t\t<span class=\"label\">\n\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"@deprecatedSince!=''\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'DeprecatedSince']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@deprecatedSince\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"@deprecatedReplacement!=''\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>: </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Deprecated']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"@deprecatedReplacement!=''\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>:</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"@deprecatedReplacement!=''\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'PleaseUse']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"hyperlink\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"destination\" select=\"$owner\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h1\" select=\"substring-after($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h2\" select=\"substring-before($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"file\" select=\"concat($baseRef,translate($h2,'.','/'),'/',$h1,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"gfile\" select=\"concat($baseRef,translate($destination,':','/'),'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($destination,'.')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($destination,'.'))\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$gfile\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains(@deprecatedReplacement,',')\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"tokenize(@deprecatedReplacement,',')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"spec\" select=\"normalize-space(.)\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"tospec\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($spec, ':')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring-after($spec,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($spec, ':'))\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$spec\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"linkpath1\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getDeprecatedReplacementLink\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"replacement\" select=\"$tospec\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$packageName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<!--<xsl:with-param name=\"ancestorPath\" select=\"$ancestorPath\"/>-->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<A href=\"{$hyperlink}{$linkpath1}\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$spec\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</A>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"position() != last()\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>, </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"linkpath\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getDeprecatedReplacementLink\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"replacement\" select=\"@deprecatedReplacement/.\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"anchorPrefix\" select=\"concat(local-name(),':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains(@deprecatedReplacement,','))\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor::ancestors\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<A href=\"{$hyperlink}{$linkpath}\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@deprecatedReplacement/.\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</A>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<A href=\"{$linkpath}\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@deprecatedReplacement/.\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</A>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"@deprecatedMessage!=''\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"description\">\n\t\t\t\t\t\t\t\t\t\t\t\t<apiDesc>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@deprecatedMessage/.\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</apiDesc>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$description/apiDesc\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"not(ancestor::ancestors)\">\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"inText\" select=\"description/.\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"ancestor::ancestors\">\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"inText\" select=\"description/.\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"summaryTableOwnerCol\">\n\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor::ancestors\">\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"classLink\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"id\" select=\"$owner\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"destination\" select=\"$owner\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h1\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($destination,'.')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring-before($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($destination,'.'))\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$destination\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h2\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($destination,'.')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring-after($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($destination,'.'))\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$destination\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"file\" select=\"concat($baseRef,translate($h1,'.','/'),'/',$h2,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"gfile\" select=\"concat($baseRef,$h2,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($id,'.')\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($id,'.'))\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$gfile\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"className\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"cn\" select=\"$owner\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring-after($cn,':')\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t<a href=\"{$classLink}\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$className\"/>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor::apiClassifier\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"ancestor::apiClassifier/apiName\"/>\n\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</xsl:for-each>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<!-- EVENTS -->\n\t<xsl:template name=\"eventsGeneratedSummary\">\n\t\t<xsl:param name=\"classDeprecated\" select=\"'false'\"/>\n\t\t<xsl:param name=\"baseRef\" select=\"''\"/>\n\t\t<xsl:param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t<xsl:param name=\"interfaces\" tunnel=\"yes\"/>\n\t\t<xsl:variable name=\"ancestorexcludes\">\n\t\t\t<excludes>\n\t\t\t\t<xsl:variable name=\"self\" select=\"@id\"/>\n\t\t\t\t<xsl:for-each select=\"$classHeader_map//apiClassifier[@id = $self]//Excludes/Exclude[@kind='event']\">\n\t\t\t\t\t<xsl:copy-of select=\".\"/>\n\t\t\t\t</xsl:for-each>\n\t\t\t</excludes>\n\t\t</xsl:variable>\n\t\t<!--List of events to suppress when creating inheritance list.  Includes both the existing events and any exclusions-->\n\t\t<xsl:variable name=\"eventsList\">\n\t\t\t<xsl:for-each select=\"adobeApiEvent[not(adobeApiEventDetail/adobeApiEventDef/apiDefinedEvent)]\">\n\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t</xsl:for-each>\n\t\t\t<xsl:for-each select=\"$ancestorexcludes/excludes/Exclude\">\n\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t</xsl:for-each>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"hasEvents\" select=\"count(adobeApiEvent[not(adobeApiEventDetail/adobeApiEventDef/apiDefinedEvent)]) &gt; 0\"/>\n\t\t<xsl:variable name=\"ancestorNodes\">\n\t\t\t<ancestors>\n\t\t\t\t<xsl:call-template name=\"getInheritedEvent\">\n\t\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"./apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t\t\t<xsl:with-param name=\"eventsList\" select=\"$eventsList\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</ancestors>\n\t\t\t<xsl:for-each select=\"$interfaces/interface\">\n\t\t\t\t<xsl:call-template name=\"getInheritedEvent\">\n\t\t\t\t\t<xsl:with-param name=\"baseClass\" select=\".\"/>\n\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t\t\t<xsl:with-param name=\"eventsList\" select=\"$eventsList\"/>\n\t\t\t\t\t<xsl:with-param name=\"processParentClass\" select=\"false()\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:for-each>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"hasInherited\" select=\"count($ancestorNodes/ancestors/adobeApiEvent[not(adobeApiEventDetail/adobeApiEventDef/apiDefinedEvent)]) &gt; 0\"/>\n\t\t<xsl:if test=\"$hasEvents or $hasInherited\">\n\t\t\t<a name=\"eventSummary\"/>\n\t\t\t<div class=\"summarySection\">\n\t\t\t\t<div class=\"summaryTableTitle\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Events']]/entry[2]/p\"/>\n\t\t\t\t</div>\n\t\t\t\t<xsl:if test=\"$hasInherited\">\n\t\t\t\t\t<div class=\"showHideLinks\">\n\t\t\t\t\t\t<div id=\"hideInheritedEvent\" class=\"hideInheritedEvent\">\n\t\t\t\t\t\t\t<a class=\"showHideLink\" href=\"#eventSummary\" onclick=\"javascript:setInheritedVisible(false,'Event');\">\n\t\t\t\t\t\t\t\t<img class=\"showHideLinkImage\" src=\"{$baseRef}images/expanded.gif\"/>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'HideInheritedEvents']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div id=\"showInheritedEvent\" class=\"showInheritedEvent\">\n\t\t\t\t\t\t\t<a class=\"showHideLink\" href=\"#eventSummary\" onclick=\"javascript:setInheritedVisible(true,'Event');\">\n\t\t\t\t\t\t\t\t<img class=\"showHideLinkImage\" src=\"{$baseRef}images/collapsed.gif\"/>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ShowInheritedEvents']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:variable name=\"tableStyle\">\n\t\t\t\t\t<xsl:if test=\"$hasInherited and not($hasEvents)\">\n\t\t\t\t\t\t<xsl:text>hideInheritedEvent</xsl:text>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<table cellspacing=\"0\" cellpadding=\"3\" class=\"summaryTable {$tableStyle}\" id=\"summaryTableEvent\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th colspan=\"2\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Event']]/entry[2]/p\"/>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\">Summary</xsl:with-param>\n\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th class=\"summaryTableOwnerCol\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'DefinedBy']]/entry[2]/p\"/>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<xsl:for-each select=\"adobeApiEvent[not(adobeApiEventDetail/adobeApiEventDef/apiDefinedEvent)] | $ancestorNodes/ancestors/adobeApiEvent[not(adobeApiEventDetail/adobeApiEventDef/apiDefinedEvent)] \">\n\t\t\t\t\t\t<xsl:sort select=\"apiName\" order=\"ascending\" data-type=\"text\" lang=\"en-US\"/>\n\t\t\t\t\t\t<xsl:variable name=\"name\" select=\"./apiName\"/>\n\t\t\t\t\t\t<xsl:if test=\"./adobeApiEventDetail/adobeApiEventDef/apiEventType or ./shortdesc\">\n\t\t\t\t\t\t\t<xsl:variable name=\"rowStyle\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"ancestor::ancestors\">\n\t\t\t\t\t\t\t\t\t<xsl:text>hideInheritedEvent</xsl:text>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t<tr class=\"{$rowStyle}\">\n\t\t\t\t\t\t\t\t<td class=\"summaryTablePaddingCol\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td class=\"summaryTableInheritanceCol\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"ancestor::ancestors\">\n\t\t\t\t\t\t\t\t\t\t<img src=\"{$baseRef}images/inheritedSummary.gif\" alt=\"Inherited\" title=\"Inherited\" class=\"inheritedSummaryImage\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(ancestor::ancestors)\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td class=\"summaryTableSignatureCol\">\n\t\t\t\t\t\t\t\t\t<div class=\"summarySignature\">\n\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor::ancestors\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"hyperLink\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"id\" select=\"./@id\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"text\" select=\"substring-before($id,'_')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"cName\" select=\"substring-after($text,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"pName\" select=\"substring-before($text,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"destination\" select=\"concat($pName,':',$cName)\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"className\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($destination,':')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring-after($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($destination,':'))\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($destination,'.'))\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$destination\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"packageName\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($destination,':')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring-before($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($destination,':'))\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$destination\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"file\" select=\"concat($baseRef,translate($packageName,'.','/'),'/',$className,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"gfile\" select=\"concat($baseRef,$className,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($packageName) &gt; 0\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(string-length($packageName) &gt; 0 )\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$gfile\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"prolog/asMetadata/apiVersion/apiPlatform[@name='AIR'] and not (prolog/asMetadata/apiVersion/apiPlatform[@name='Flash'])\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"insertAIRIcon\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$hyperLink!=''\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$hyperLink}#event:{apiName}\" class=\"signatureLink\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$hyperLink=''\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor::apiClassifier\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"prolog/asMetadata/apiVersion/apiPlatform[@name='AIR'] and not (prolog/asMetadata/apiVersion/apiPlatform[@name='Flash'])\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"insertAIRIcon\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"#event:{$name}\" class=\"signatureLink\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t<!-- TODO add param classRefs for AS2 -->\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$config/options/@docversion='2'\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text> = function(</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"params\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>) {}</xsl:text>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td class=\"summaryTableDescription summaryTableCol\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$classDeprecated='true'\">\n\t\t\t\t\t\t\t\t\t\t<xsl:copy-of select=\"$deprecatedLabel\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:text>. </xsl:text>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"eventText\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"normalize-space(./shortdesc)\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./shortdesc/@conref\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"./shortdesc/@conref\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"local-name(./shortdesc)\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"'event'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($eventText) &gt;0 \">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"inText\" select=\"$eventText\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(string-length($eventText) &gt; 0)\">\n\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./adobeApiEventDetail/adobeApiEventDef/adobeApiEventClassifier\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getEventDescription\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"destination\" select=\"adobeApiEventDetail/adobeApiEventDef/apiEventType\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"local-name(./shortdesc)\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td class=\"summaryTableOwnerCol\">\n\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor::ancestors\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"hyperLink\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"id\" select=\"./@id\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"text\" select=\"substring-before($id,'_')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"className\" select=\"substring-after($text,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"packageName\" select=\"substring-before($text,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"destination\" select=\"concat($packageName,':',$className)\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h1\" select=\"substring-before($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h2\" select=\"substring-after($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"file\" select=\"concat($baseRef,translate($h1,'.','/'),'/',$h2,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"gfile\" select=\"concat($baseRef,$h2,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($destination,'.')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($destination,'.'))\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$gfile\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"className\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getEventClassNameFromId\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"id\" select=\"./@id\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$hyperLink!=''\">\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$hyperLink}\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$className\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$hyperLink=''\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$className\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"ancestor::apiClassifier\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"ancestor::apiClassifier/apiName\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:for-each>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"eventDetails\">\n\t\t<xsl:param name=\"baseRef\"/>\n\t\t<xsl:param name=\"classDeprecated\" select=\"'false'\"/>\n\t\t<xsl:if test=\"count(adobeApiEvent[not(adobeApiEventDetail/adobeApiEventDef/apiDefinedEvent)]) &gt; 0\">\n\t\t\t<div class=\"detailSectionHeader\">\n\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t<xsl:with-param name=\"key\" select=\"'EventDetail'\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</div>\n\t\t\t<xsl:for-each select=\"./adobeApiEvent[not(adobeApiEventDetail/adobeApiEventDef/apiDefinedEvent)]\">\n\t\t\t\t<xsl:sort select=\"apiName\" order=\"ascending\" lang=\"en-US\"/>\n\t\t\t\t<xsl:variable name=\"name\" select=\"./apiName\"/>\n\t\t\t\t<a name=\"event:{$name}\"/>\n\t\t\t\t<table class=\"detailHeader\" cellpadding=\"0\" cellspacing=\"0\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=\"detailHeaderName\">\n\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"prolog/asMetadata/apiVersion/apiPlatform[@name='AIR'] and not (prolog/asMetadata/apiVersion/apiPlatform[@name='Flash'])\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"insertAIRIcon\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td class=\"detailHeaderType\">\n\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\">EventIn</xsl:with-param>\n\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<xsl:if test=\"position()!=1\">\n\t\t\t\t\t\t\t<td class=\"detailHeaderRule\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t\t<div class=\"detailBody\">\n\t\t\t\t\t<xsl:if test=\"string-length(normalize-space(adobeApiEventDetail/adobeApiEventDef/adobeApiEventClassifier)) &gt; 0\">\n\t\t\t\t\t\t<xsl:if test=\"$name='onCuePoint' or $name='onMetaData'\"> </xsl:if>\n\t\t\t\t\t\t<span class=\"label\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'EventObjectType']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t<xsl:text>: </xsl:text>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<xsl:variable name=\"eventHyperLink\">\n\t\t\t\t\t\t\t<xsl:call-template name=\"getEventHyperlink\">\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"destination\" select=\"adobeApiEventDetail/adobeApiEventDef/adobeApiEventClassifier\"/>\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t<xsl:variable name=\"eventTypeClassifierTmp\" select=\"adobeApiEventDetail/adobeApiEventDef/adobeApiEventClassifier\"/>\n\n\t\t\t\t\t\t<xsl:variable name=\"eventTypeClassifierPkg\" >\n\t\t\t\t\t\t\t<xsl:call-template name=\"substring-before-last\">\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"input\" select=\"$eventTypeClassifierTmp\"/>\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"substr\" select=\"'.'\"/>\n\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t</xsl:variable >\n\n\t\t\t\t\t\t<xsl:variable name=\"eventTypeClassifierCls\" >\n\t\t\t\t\t\t\t<xsl:call-template name=\"substring-after-last\">\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"input\" select=\"$eventTypeClassifierTmp\"/>\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"substr\" select=\"'.'\"/>\n\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t</xsl:variable >\n\n\t\t\t\t\t\t<xsl:variable name=\"eventTypeClassifier\" select=\"concat($eventTypeClassifierPkg, ':', $eventTypeClassifierCls)\"/>\n\n\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t<xsl:when test=\"$eventHyperLink=''\">\n\t\t\t\t\t\t\t\t<code>\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"adobeApiEventDetail/adobeApiEventDef/adobeApiEventClassifier\"/>\n\t\t\t\t\t\t\t\t</code>\n\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t<a href=\"{$eventHyperLink}\">\n\t\t\t\t\t\t\t\t\t<code>\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$eventTypeClassifierTmp\"/>\n\t\t\t\t\t\t\t\t\t</code>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t\t\t<xsl:variable name=\"eventTypeDITA\" select=\"adobeApiEventDetail/adobeApiEventDef/apiEventType\"/>\n\t\t\t\t\t\t<xsl:if test=\"string-length($eventTypeDITA) &gt; 0\">\n\t\t\t\t\t\t\t<xsl:variable name=\"eventTypeHref\">\n\t\t\t\t\t\t\t\t<xsl:call-template name=\"getEventTypeHyperlink\">\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"destination\" select=\"$eventTypeDITA\"/>\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t<span class=\"label\">\n\n\t\t\t\t\t\t\t\t<xsl:if test=\"contains($eventTypeClassifierTmp,'.')\">\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"substring-after-last\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"input\" select=\"$eventTypeClassifierTmp\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"substr\" select=\"'.'\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($eventTypeClassifierTmp,'.'))\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$eventTypeClassifierTmp\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:text>.type</xsl:text>\n\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Property']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t<xsl:text> = </xsl:text>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t<xsl:when test=\"$eventTypeHref=''\">\n\t\t\t\t\t\t\t\t\t<code>\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$eventTypeDITA\"/>\n\t\t\t\t\t\t\t\t\t</code>\n\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t<xsl:otherwise>\n\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($eventTypeClassifierTmp,'.')\">\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"count($classHeader_map//apiClassifier[@id=$eventTypeClassifier] ) &gt; 0\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$eventTypeHref}\">\n\t\t\t\t\t\t\t\t\t\t\t\t<code>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$eventTypeDITA\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</code>\n\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(count($classHeader_map//apiClassifier[@id=$eventTypeClassifier] ) &gt; 0)\">\n\t\t\t\t\t\t\t\t\t\t\t<code>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$eventTypeDITA\"/>\n\t\t\t\t\t\t\t\t\t\t\t</code>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($eventTypeClassifierTmp,'.'))\">\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"count($classHeader_map//apiClassifier[@id=concat('globalClassifier:',$eventTypeClassifierTmp)] ) &gt; 0\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$eventTypeHref}\">\n\t\t\t\t\t\t\t\t\t\t\t\t<code>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$eventTypeDITA\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</code>\n\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(count($classHeader_map//apiClassifier[@id=concat('globalClassifier:',$eventTypeClassifierTmp)] ) &gt; 0)\">\n\t\t\t\t\t\t\t\t\t\t\t<code>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$eventTypeDITA\"/>\n\t\t\t\t\t\t\t\t\t\t\t</code>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"not(string-length($eventTypeDITA) &gt; 0)\">\n\t\t\t\t\t\t\t<p/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"$config/options/@docversion='2'\">\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t<code>\n\t\t\t\t\t\t\t\t<xsl:text>public </xsl:text>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t<xsl:text> = function(</xsl:text>\n\t\t\t\t\t\t\t\t<xsl:call-template name=\"params\"/>\n\t\t\t\t\t\t\t\t<xsl:text>) {}</xsl:text>\n\t\t\t\t\t\t\t</code>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:apply-templates select=\"adobeApiEventDetail/adobeApiEventDef/apiDeprecated\" mode=\"event\" />\n\t\t\t\t\t<xsl:if test=\"$classDeprecated='true'\">\n\t\t\t\t\t\t<xsl:call-template name=\"description\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t\t\t<xsl:with-param name=\"addParagraphTags\" select=\"true()\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:call-template name=\"version\"/>\n\t\t\t\t\t<xsl:if test=\"$classDeprecated!='true'\">\n\t\t\t\t\t\t<xsl:call-template name=\"description\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t\t\t<xsl:with-param name=\"addParagraphTags\" select=\"true()\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"string-length(normalize-space(adobeApiEventDetail/adobeApiEventDef/adobeApiEventClassifier)) &gt; 0\">\n\t\t\t\t\t\t<xsl:call-template name=\"getEventDescription\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"destination\" select=\"adobeApiEventDetail/adobeApiEventDef/apiEventType\"/>\n\t\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"'apiDesc'\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:apply-templates select=\"params\"/>\n\t\t\t\t\t<xsl:if test=\"./*/example[codeblock]\">\n\t\t\t\t\t\t<xsl:call-template name=\"includeExamples\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"createExampleLink\" select=\"'false'\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:call-template name=\"sees\"/>\n\t\t\t\t</div>\n\t\t\t</xsl:for-each>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"event\">\n\t\t<xsl:variable name=\"packageName\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t<xsl:variable name=\"baseRef\">\n\t\t\t<xsl:call-template name=\"getBaseRef\">\n\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$packageName\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:if test=\"count(adobeApiEvent)\">\n\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t<span class=\"label\">\n\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Events']]/entry[2]/p\"/>\n\t\t\t</span>\n\t\t\t<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n\t\t\t\t<xsl:for-each select=\"adobeApiEvent\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=\"20px\"/>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<code>\n\t\t\t\t\t\t\t\t<b>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$config/options/@docversion='2'\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"#event:{apiName}\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"apiName\"/>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$config/options/@docversion!='2'\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"apiName\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</b>\n\t\t\t\t\t\t\t\t<xsl:if test=\"adobeApiEventDetail/adobeApiEventDef/adobeApiEventClassifier\">\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"destination\" select=\"adobeApiEventDetail/adobeApiEventDef/adobeApiEventClassifier\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h1\" select=\"substring-after($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h2\" select=\"substring-before($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"file\" select=\"concat($baseRef,translate($h2,'.','/'),'/',$h1,'.html')\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"gfile\" select=\"concat($baseRef,$destination,'.html')\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"eventHyperLink\">\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($destination,'.')\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($destination,'.'))\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$gfile\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"classname\">\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains(adobeApiEventDetail/adobeApiEventDef/adobeApiEventClassifier,':')\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring-after(adobeApiEventDetail/adobeApiEventDef/adobeApiEventClassifier,':')\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains(adobeApiEventDetail/adobeApiEventDef/adobeApiEventClassifier,':'))\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"adobeApiEventDetail/adobeApiEventDef/adobeApiEventClassifier\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t<xsl:text>:</xsl:text>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$eventHyperLink = ''\">\n\t\t\t\t\t\t\t\t\t\t<code>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$classname\"/>\n\t\t\t\t\t\t\t\t\t\t</code>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$eventHyperLink != ''\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"{$eventHyperLink}\">\n\t\t\t\t\t\t\t\t\t\t\t<code>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$classname\"/>\n\t\t\t\t\t\t\t\t\t\t\t</code>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</code>\n\t\t\t\t\t\t\t<xsl:if test=\"string-length(adobeApiEventDetail/apiDesc)\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$emdash\"/>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"desctext\">\n\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"./adobeApiEventDetail/apiDesc\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"event\" select=\"'eventdesc'\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"$desctext\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<xsl:if test=\"position()!=last()\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td class=\"paramSpacer\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:for-each>\n\t\t\t</table>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<!-- METHODS -->\n\t<xsl:template name=\"methodSummary\">\n\t\t<xsl:param name=\"className\"/>\n\t\t<xsl:param name=\"title\" select=\"'Methods'\"/>\n\t\t<xsl:param name=\"classDeprecated\" select=\"'false'\"/>\n\t\t<xsl:param name=\"accessLevel\" select=\"'public'\"/>\n\t\t<xsl:param name=\"baseRef\" select=\"''\"/>\n\t\t<xsl:param name=\"isGlobal\" select=\"false()\"/>\n\t\t<xsl:param name=\"showAnchor\" select=\"true()\"/>\n\t\t<xsl:param name=\"interfaces\" tunnel=\"yes\"/>\n\t\t<xsl:variable name=\"localizedTitle\">\n\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t<xsl:with-param name=\"key\">\n\t\t\t\t\t<xsl:value-of select=\"$title\"/>\n\t\t\t\t</xsl:with-param>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t<xsl:variable name=\"hasMethods\"\n\t\t\tselect=\"count(apiOperation[apiOperationDetail/apiOperationDef/apiAccess/@value=$accessLevel or apiOperationDetail/apiOperationDef/apiAccess/@value=$config/namespaces/namespace[@summaryDisplay=$accessLevel]/.]) &gt; 0 or count(apiConstructor[apiConstructorDetail/apiConstructorDef/apiAccess/@value=$accessLevel or apiConstructorDetail/apiConstructorDef/apiAccess/@value=$config/namespaces/namespace[@summaryDisplay=$accessLevel]/.]) &gt; 0\"/>\n\t\t<xsl:variable name=\"ancestorexcludes\">\n\t\t\t<excludes>\n\t\t\t\t<xsl:variable name=\"self\" select=\"@id\"/>\n\t\t\t\t<xsl:for-each select=\"$classHeader_map//apiClassifier[@id = $self]//Excludes/Exclude[@kind='method']\">\n\t\t\t\t\t<xsl:copy-of select=\".\"/>\n\t\t\t\t</xsl:for-each>\n\t\t\t</excludes>\n\t\t</xsl:variable>\n\t\t<!--List of methods to suppress when creating inheritance list.  Includes both the existing methods and any exclusions-->\n\t\t<xsl:variable name=\"newMethodList\">\n\t\t\t<xsl:for-each\n\t\t\t\tselect=\"./apiOperation[apiOperationDetail/apiOperationDef/apiAccess/@value=$accessLevel or apiOperationDetail/apiOperationDef/apiAccess/@value=$config/namespaces/namespace[@summaryDisplay=$accessLevel]/.] | ./apiConstructor[apiConstructorDetail/apiConstructorDef/apiAccess/@value=$accessLevel or apiConstructorDetail/apiConstructorDef/apiAccess/@value=$config/namespaces/namespace[@summaryDisplay=$accessLevel]/.]\">\n\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t</xsl:for-each>\n\t\t\t<xsl:for-each select=\"$ancestorexcludes/excludes/Exclude\">\n\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t</xsl:for-each>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"ancestorNode\">\n\t\t\t<ancestors>\n\t\t\t\t<xsl:call-template name=\"getMethodAncestors\">\n\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t<xsl:with-param name=\"methodList\" select=\"$newMethodList\"/>\n\t\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"./apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t\t\t<xsl:with-param name=\"accessLevel\" select=\"$accessLevel\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t\t<xsl:for-each select=\"$interfaces/interface\">\n\t\t\t\t\t<xsl:call-template name=\"getMethodAncestors\">\n\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"methodList\" select=\"$newMethodList\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"baseClass\" select=\".\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"accessLevel\" select=\"$accessLevel\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"processParentClass\" select=\"false()\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:for-each>\n\t\t\t</ancestors>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"hasInherited\" select=\"count ($ancestorNode/ancestors/apiOperation | $ancestorNode/ancestors/apiConstructor) &gt; 0\"/>\n\t\t<xsl:if test=\"$hasMethods or $hasInherited\">\n\t\t\t<xsl:if test=\"$showAnchor\">\n\t\t\t\t<xsl:if test=\"$accessLevel='public'\">\n\t\t\t\t\t<a name=\"methodSummary\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$accessLevel='protected'\">\n\t\t\t\t\t<xsl:if\n\t\t\t\t\t\ttest=\"not(count(apiOperation[./apiOperationDetail/apiOperationDef/apiAccess/@value='public' or ./apiOperationDetail/apiOperationDef/apiAccess/@value=$config/namespaces/namespace[@summaryDisplay='public']/.]) &gt; 0 or count($ancestorNode/ancestors/apiOperation[./apiOperationDetail/apiOperationDef/apiAccess/@value='public' or ./apiOperationDetail/apiOperationDef/apiAccess/@value=$config/namespaces/namespace[@summaryDisplay='public']/.]) &gt; 0)\">\n\t\t\t\t\t\t<a name=\"methodSummary\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<a name=\"protectedMethodSummary\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:if>\n\t\t\t<div class=\"summarySection\">\n\t\t\t\t<div class=\"summaryTableTitle\">\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"$isGlobal\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'GlobalMethods']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:when test=\"$accessLevel='public'\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'PublicMethods']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:when test=\"$accessLevel='protected'\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ProtectedMethods']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t</xsl:choose>\n\n\t\t\t\t</div>\n\t\t\t\t<xsl:if test=\"$hasInherited\">\n\t\t\t\t\t<div class=\"showHideLinks\">\n\t\t\t\t\t\t<xsl:if test=\"$accessLevel!='protected'\">\n\t\t\t\t\t\t\t<div id=\"hideInheritedMethod\" class=\"hideInheritedMethod\">\n\t\t\t\t\t\t\t\t<a class=\"showHideLink\" href=\"#methodSummary\" onclick=\"javascript:setInheritedVisible(false,'Method');\">\n\t\t\t\t\t\t\t\t\t<img class=\"showHideLinkImage\" src=\"{$baseRef}images/expanded.gif\"/>\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'HideInheritedPublicMethods']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div id=\"showInheritedMethod\" class=\"showInheritedMethod\">\n\t\t\t\t\t\t\t\t<a class=\"showHideLink\" href=\"#methodSummary\" onclick=\"javascript:setInheritedVisible(true,'Method');\">\n\t\t\t\t\t\t\t\t\t<img class=\"showHideLinkImage\" src=\"{$baseRef}images/collapsed.gif\"/>\n\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ShowInheritedPublicMethods']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t</xsl:choose>\n\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"$accessLevel='protected'\">\n\t\t\t\t\t\t\t<div id=\"hideInheritedProtectedMethod\" class=\"hideInheritedProtectedMethod\">\n\t\t\t\t\t\t\t\t<a class=\"showHideLink\" href=\"#protectedMethodSummary\" onclick=\"javascript:setInheritedVisible(false,'ProtectedMethod');\">\n\t\t\t\t\t\t\t\t\t<img class=\"showHideLinkImage\" src=\"{$baseRef}images/expanded.gif\"/>\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ShowInheritedProtectedMethods']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div id=\"showInheritedProtectedMethod\" class=\"showInheritedProtectedMethod\">\n\t\t\t\t\t\t\t\t<a class=\"showHideLink\" href=\"#protectedMethodSummary\" onclick=\"javascript:setInheritedVisible(true,'ProtectedMethod');\">\n\t\t\t\t\t\t\t\t\t<img class=\"showHideLinkImage\" src=\"{$baseRef}images/collapsed.gif\"/>\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ShowInheritedProtectedMethods']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</div>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:variable name=\"tableStyle\">\n\t\t\t\t\t<xsl:if test=\"$hasInherited and not($hasMethods)\">\n\t\t\t\t\t\t<xsl:text>hideInherited</xsl:text>\n\t\t\t\t\t\t<xsl:if test=\"$accessLevel='protected'\">\n\t\t\t\t\t\t\t<xsl:text>Protected</xsl:text>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:text>Method</xsl:text>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<xsl:variable name=\"tableId\">\n\t\t\t\t\t<xsl:text>summaryTable</xsl:text>\n\t\t\t\t\t<xsl:if test=\"$accessLevel='protected'\">\n\t\t\t\t\t\t<xsl:text>Protected</xsl:text>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:text>Method</xsl:text>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<table cellspacing=\"0\" cellpadding=\"3\" class=\"summaryTable {$tableStyle}\" id=\"{$tableId}\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th colspan=\"2\">\n\t\t\t\t\t\t\t<xsl:if test=\"self::apiClassifier\">\n\t\t\t\t\t\t\t\t<xsl:text/>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'MethodMethod']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"not(self::apiClassifier)\">\n\t\t\t\t\t\t\t\t<xsl:text/>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'FunctionFunction']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<xsl:if test=\"not($config/options/@docversion='2')\">\n\t\t\t\t\t\t\t<th class=\"summaryTableOwnerCol\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'DefinedBy']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<xsl:apply-templates\n\t\t\t\t\t\tselect=\"apiOperation[apiOperationDetail/apiOperationDef/apiAccess/@value=$accessLevel or apiOperationDetail/apiOperationDef/apiAccess/@value=$config/namespaces/namespace[@summaryDisplay=$accessLevel]/.] | apiConstructor[apiConstructorDetail/apiConstructorDef/apiAccess/@value=$accessLevel or apiConstructorDetail/apiConstructorDef/apiAccess/@value=$config/namespaces/namespace[@summaryDisplay=$accessLevel]/.] | $ancestorNode/ancestors/apiOperation[apiOperationDetail/apiOperationDef/apiAccess/@value=$accessLevel or apiOperationDetail/apiOperationDef/apiAccess/@value=$config/namespaces/namespace[@summaryDisplay=$accessLevel]/.] | $ancestorNode/ancestors/apiConstructor[apiConstructorDetail/apiConstructorDef/apiAccess/@value=$accessLevel or apiConstructorDetail/apiConstructorDef/apiAccess/@value=$config/namespaces/namespace[@summaryDisplay=$accessLevel]/.]\"\n\t\t\t\t\t\tmode=\"summary\">\n\t\t\t\t\t\t<xsl:sort select=\"local-name()\" lang=\"en-US\"/>\n\t\t\t\t\t\t<xsl:sort select=\"apiName\" order=\"ascending\" lang=\"en-US\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"accessLevel\" select=\"$accessLevel\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t\t\t</xsl:apply-templates>\n\t\t\t\t</table>\n\t\t\t\t<!-- AS2 INHERITED METHODS -->\n\t\t\t\t<xsl:if test=\"$config/options/@docversion='2'\">\n\t\t\t\t\t<xsl:for-each select=\"asAncestors/asAncestor\">\n\t\t\t\t\t\t<xsl:call-template name=\"inherited\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"lowerType\" select=\"'methods'\"/>\n\t\t\t\t\t\t\t<xsl:with-param name=\"upperType\" select=\"'Methods'\"/>\n\t\t\t\t\t\t\t<xsl:with-param name=\"inheritedItems\" select=\"@methods\"/>\n\t\t\t\t\t\t\t<xsl:with-param name=\"staticItems\" select=\"@staticMethods\"/>\n\t\t\t\t\t\t\t<xsl:with-param name=\"postfix\" select=\"'()'\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:for-each>\n\t\t\t\t</xsl:if>\n\t\t\t</div>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"methodsDetails\">\n\t\t<xsl:param name=\"className\"/>\n\t\t<xsl:param name=\"title\" select=\"$asdoc_terms/row[entry[1][p/text() = 'MethodDetail']]/entry[2]/p\"/>\n\t\t<xsl:param name=\"classDeprecated\" select=\"'false'\"/>\n\t\t<xsl:param name=\"baseRef\"/>\n\t\t<xsl:param name=\"constructCall\" select=\"'true'\"/>\n\t\t<xsl:if test=\"count(.//apiOperation) &gt; 0\">\n\t\t\t<a name=\"methodDetail\"/>\n\t\t\t<div class=\"detailSectionHeader\">\n\t\t\t\t<xsl:value-of select=\"$title\"/>\n\t\t\t</div>\n\t\t\t<xsl:apply-templates select=\"apiOperation\" mode=\"detail\">\n\t\t\t\t<xsl:sort select=\"./apiName\" order=\"ascending\" lang=\"en-US\"/>\n\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t<xsl:with-param name=\"isMethod\" select=\"$className!='package'\"/>\n\t\t\t\t<xsl:with-param name=\"className\" select=\"$className\"/>\n\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t</xsl:apply-templates>\n\t\t\t<xsl:if test=\"$constructCall='true'\">\n\t\t\t\t<xsl:apply-templates select=\"apiConstructor\" mode=\"detail\">\n\t\t\t\t\t<xsl:sort select=\"./apiName\" order=\"ascending\" lang=\"en-US\"/>\n\t\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t<xsl:with-param name=\"isMethod\" select=\"$className!='package'\"/>\n\t\t\t\t\t<xsl:with-param name=\"className\" select=\"$className\"/>\n\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t</xsl:apply-templates>\n\t\t\t</xsl:if>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"constantDetails\">\n\t\t<xsl:param name=\"title\" select=\"$asdoc_terms/row[entry[1][p/text() = 'ConstantDetail']]/entry[2]/p\"/>\n\t\t<xsl:param name=\"classDeprecated\" select=\"'false'\"/>\n\t\t<xsl:param name=\"baseRef\"/>\n\t\t<xsl:param name=\"isConst\" select=\"'true'\"/>\n\t\t<xsl:if test=\"count(./apiValue[not(apiValueDetail/apiValueDef/apiProperty)]) &gt; 0\">\n\t\t\t<div class=\"detailSectionHeader\">\n\t\t\t\t<xsl:value-of select=\"$title\"/>\n\t\t\t</div>\n\t\t\t<xsl:apply-templates select=\"apiValue[not(apiValueDetail/apiValueDef/apiProperty)]\" mode=\"detail\">\n\t\t\t\t<xsl:sort select=\"./apiName\" order=\"ascending\" lang=\"en-US\"/>\n\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t<xsl:with-param name=\"isConst\" select=\"$isConst\"/>\n\t\t\t</xsl:apply-templates>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"propertyDetails\">\n\t\t<xsl:param name=\"title\" select=\"$asdoc_terms/row[entry[1][p/text() = 'PropertyDetail']]/entry[2]/p\"/>\n\t\t<xsl:param name=\"classDeprecated\" select=\"'false'\"/>\n\t\t<xsl:param name=\"baseRef\"/>\n\t\t<xsl:if test=\"count(./apiValue[apiValueDetail/apiValueDef/apiProperty]) &gt; 0\">\n\t\t\t<div class=\"detailSectionHeader\">\n\t\t\t\t<xsl:value-of select=\"$title\"/>\n\t\t\t</div>\n\t\t\t<xsl:apply-templates select=\"apiValue[apiValueDetail/apiValueDef/apiProperty]\" mode=\"detail\">\n\t\t\t\t<xsl:sort select=\"./apiName\" order=\"ascending\" lang=\"en-US\"/>\n\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t</xsl:apply-templates>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"styleDetails\">\n\t\t<xsl:param name=\"title\" select=\"$asdoc_terms/row[entry[1][p/text() = 'StyleDetail']]/entry[2]/p\"/>\n\t\t<xsl:param name=\"classDeprecated\" select=\"'false'\"/>\n\t\t<xsl:param name=\"baseRef\"/>\n\t\t<xsl:if test=\"count(prolog/asMetadata[styles/style]) &gt; 0\">\n\t\t\t<div class=\"detailSectionHeader\">\n\t\t\t\t<xsl:value-of select=\"$title\"/>\n\t\t\t</div>\n\t\t\t<xsl:apply-templates select=\"prolog/asMetadata[styles/style]\" mode=\"detail\">\n\t\t\t\t<xsl:sort select=\"@name\" order=\"ascending\" lang=\"en-US\"/>\n\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t</xsl:apply-templates>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template match=\"style\" mode=\"detail\">\n\t\t<xsl:param name=\"classDeprecated\" select=\"'false'\"/>\n\t\t<xsl:param name=\"isMethod\" select=\"true()\"/>\n\t\t<xsl:param name=\"className\" select=\"''\"/>\n\t\t<xsl:param name=\"baseRef\"/>\n\t\t<xsl:variable name=\"name\" select=\"@name\"/>\n\t\t<xsl:variable name=\"type\" select=\"@type\"/>\n\t\t<a name=\"{$name}\"/>\n\t\t<a name=\"style:{$name}\"/>\n\t\t<table class=\"detailHeader\" cellpadding=\"0\" cellspacing=\"0\">\n\t\t\t<tr>\n\t\t\t\t<td class=\"detailHeaderName\">\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t<xsl:if test=\"prolog/asMetadata/apiVersion/apiPlatform[@name='AIR'] and not (prolog/asMetadata/apiVersion/apiPlatform[@name='Flash'])\">\n\t\t\t\t\t\t\t\t<xsl:call-template name=\"insertAIRIcon\">\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t</td>\n\t\t\t\t<td class=\"detailHeaderType\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Style']]/entry[2]/p\"/>\n\t\t\t\t</td>\n\t\t\t\t<xsl:if test=\"position()!=1\">\n\t\t\t\t\t<td class=\"detailHeaderRule\">\n\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t</td>\n\t\t\t\t</xsl:if>\n\t\t\t</tr>\n\t\t</table>\n\t\t<div class=\"detailBody\">\n\t\t\t<code>\n\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t<xsl:if test=\"@type\">\n\t\t\t\t\t<xsl:text>:</xsl:text>\n\t\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"@type\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:if>\n\t\t\t</code>\n\t\t\t<xsl:if test=\"$classDeprecated!='true'\">\n\t\t\t\t<xsl:call-template name=\"description\">\n\t\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t<xsl:with-param name=\"addParagraphTags\" select=\"true()\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"./default\">\n\t\t\t\t<p>\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'DefaultValueIs']]/entry[2]/p\"/>\n\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t<code>\n\t\t\t\t\t\t<xsl:value-of select=\"normalize-space(./default/.)\"/>\n\t\t\t\t\t</code>\n\t\t\t\t\t<xsl:text>.</xsl:text>\n\t\t\t\t</p>\n\t\t\t</xsl:if>\n\t\t\t<xsl:call-template name=\"sees\"/>\n\t\t</div>\n\t</xsl:template>\n\t<xsl:template match=\"apiOperation | apiConstructor\" mode=\"summary\">\n\t\t<xsl:param name=\"classDeprecated\" select=\"'false'\"/>\n\t\t<xsl:param name=\"baseRef\" select=\"''\"/>\n\t\t<xsl:param name=\"accessLevel\" select=\"'public'\"/>\n\t\t<xsl:param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t<xsl:variable name=\"rowStyle\">\n\t\t\t<xsl:if test=\"ancestor::ancestors\">\n\t\t\t\t<xsl:text>hideInherited</xsl:text>\n\t\t\t\t<xsl:if test=\"$accessLevel='protected'\">\n\t\t\t\t\t<xsl:text>Protected</xsl:text>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:text>Method</xsl:text>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<tr class=\"{$rowStyle}\">\n\t\t\t<td class=\"summaryTablePaddingCol\">\n\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t</td>\n\t\t\t<td class=\"summaryTableInheritanceCol\">\n\t\t\t\t<xsl:if test=\"ancestor::ancestors\">\n\t\t\t\t\t<img src=\"{$baseRef}images/inheritedSummary.gif\" alt=\"Inherited\" title=\"Inherited\" class=\"inheritedSummaryImage\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(ancestor::ancestors)\">\n\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</td>\n\t\t\t<td class=\"summaryTableSignatureCol\">\n\t\t\t\t<div class=\"summarySignature\">\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"ancestor::ancestors\">\n\t\t\t\t\t\t\t<xsl:variable name=\"hLink\">\n\t\t\t\t\t\t\t\t<xsl:variable name=\"memberName\" select=\"./apiName\"/>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"id\" select=\"./@id\"/>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"classNameText\" select=\"substring-after($id,':')\"/>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"packageNameText\" select=\"substring-before($id,':')\"/>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"h1\" select=\"substring-before($classNameText,':')\"/>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"h2\" select=\"$packageNameText\"/>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"file\" select=\"concat($baseRef,translate($h2,'.','/'),'/',$h1,'.html')\"/>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"gfile\" select=\"concat($baseRef,$packageNameText,'.html')\"/>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"packageName\">\n\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"not(contains($packageNameText,'.')) and string-length($packageNameText) = 0\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"''\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$packageNameText\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"methodName\">\n\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$memberName != ''\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$memberName\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"contains($packageName,'.')\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($classNameText,':')\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring-after($classNameText,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring-after($id,':')\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t<xsl:if test=\"contains($id,'.') or string-length($packageNameText) &gt; 0\">\n\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>#</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$methodName\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t</xsl:choose>\n\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($id,'.')) and string-length($packageNameText) = 0\">\n\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$gfile\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>#</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$methodName\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"prolog/asMetadata/apiVersion/apiPlatform[@name='AIR'] and not (prolog/asMetadata/apiVersion/apiPlatform[@name='Flash'])\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"insertAIRIcon\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t<xsl:if test=\"$hLink!=''\">\n\t\t\t\t\t\t\t\t<a href=\"{$hLink}()\" class=\"signatureLink\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"$hLink=''\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:when test=\"self::apiConstructor\">\n\t\t\t\t\t\t\t<xsl:if test=\"position()>1\">\n\t\t\t\t\t\t\t\t<a href=\"#{./apiName}{position()}()\" class=\"signatureLink\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"position()=1\">\n\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"prolog/asMetadata/apiVersion/apiPlatform[@name='AIR'] and not (prolog/asMetadata/apiVersion/apiPlatform[@name='Flash'])\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"insertAIRIcon\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t<a href=\"#{./apiName}()\" class=\"signatureLink\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:when test=\"ancestor::apiClassifier or ancestor-or-self::apiPackage\">\n\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"prolog/asMetadata/apiVersion/apiPlatform[@name='AIR'] and not (prolog/asMetadata/apiVersion/apiPlatform[@name='Flash'])\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"insertAIRIcon\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t<a href=\"#{./apiName}()\" class=\"signatureLink\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t<xsl:if test=\"self::apiOperation | self::apiConstructor\">\n\t\t\t\t\t\t<xsl:text>(</xsl:text>\n\t\t\t\t\t\t<xsl:call-template name=\"params\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t<xsl:text>)</xsl:text>\n\t\t\t\t\t\t<xsl:if test=\"self::apiOperation and $prog_language_name='ActionScript'\">\n\t\t\t\t\t\t\t<xsl:text>:</xsl:text>\n\t\t\t\t\t\t\t<xsl:call-template name=\"processReturnType\">\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"summaryTableDescription\">\n\t\t\t\t\t<xsl:apply-templates select=\"apiOperationDetail/apiOperationDef/apiDeprecated\"/>\n\t\t\t\t\t<xsl:apply-templates select=\"deprecated\"/>\n\t\t\t\t\t  <xsl:if test=\"apiOperationDetail/apiOperationDef/apiIsOverride\">\n\t\t\t\t\t\t<xsl:text>[</xsl:text>\n\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Override']]/entry[2]/p\"/>\n\t\t\t\t\t\t<xsl:text>] </xsl:text>\n\t\t\t\t\t  </xsl:if>\n\t\t\t\t\t<xsl:if test=\"not(deprecated)\">\n\t\t\t\t\t\t<xsl:if test=\"apiOperationDetail/apiOperationDef/apiStatic\">\n\t\t\t\t\t\t\t<xsl:text>[</xsl:text>\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'static']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t<xsl:text>] </xsl:text>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"./shortdesc or $classDeprecated='true'\">\n\t\t\t\t\t\t\t<xsl:call-template name=\"shortDescriptionReview\"/>\n\t\t\t\t\t\t\t<xsl:if test=\"$classDeprecated='true'\">\n\t\t\t\t\t\t\t\t<xsl:copy-of select=\"$deprecatedLabel\"/>\n\t\t\t\t\t\t\t\t<xsl:text>. </xsl:text>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"not(string-length(./shortdesc/@conref) &gt; 0)\">\n\t\t\t\t\t\t\t<xsl:for-each select=\"./shortdesc\">\n\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</div>\n\t\t\t</td>\n\t\t\t<xsl:if test=\"not($config/options/@docversion='2')\">\n\t\t\t\t<td class=\"summaryTableOwnerCol\">\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"ancestor::ancestors\">\n\t\t\t\t\t\t\t<xsl:variable name=\"classLink\">\n\t\t\t\t\t\t\t\t<xsl:variable name=\"id\" select=\"./@id\"/>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"classNameText\" select=\"substring-after($id,':')\"/>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"packageNameText\" select=\"substring-before($id,':')\"/>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"h1\" select=\"$packageNameText\"/>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"h2\" select=\"substring-before($classNameText,':')\"/>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"file\" select=\"concat($baseRef,translate($h1,'.','/'),'/',$h2,'.html')\"/>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"gfile\" select=\"concat($baseRef,$packageNameText,'.html')\"/>\n\t\t\t\t\t\t\t\t<xsl:if test=\"contains($id,'.') or string-length($packageNameText) &gt; 0\">\n\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($id,'.')) and string-length($packageNameText) = 0\">\n\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$gfile\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t<xsl:variable name=\"className\">\n\t\t\t\t\t\t\t\t<xsl:call-template name=\"getClassNameFromId\">\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"id\" select=\"./@id\"/>\n\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t<xsl:if test=\"$classLink!=''\">\n\t\t\t\t\t\t\t\t<a href=\"{$classLink}\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$className\"/>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"$classLink=''\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$className\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:when test=\"ancestor::apiClassifier\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"ancestor::apiClassifier/apiName\"/>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:when test=\"ancestor-or-self::apiPackage\">\n\t\t\t\t\t\t\t<xsl:if test=\"ancestor-or-self::apiPackage/apiName='__Global__'\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat('Top',$nbsp,'Level')\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"ancestor-or-self::apiPackage/apiName!='__Global__'\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t</td>\n\t\t\t</xsl:if>\n\t\t</tr>\n\t</xsl:template>\n\t<xsl:template name=\"getNamespaceLink\">\n\t\t<xsl:param name=\"accessLevel\"/>\n\t\t<xsl:param name=\"baseRef\"/>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"$config/languageElements[@show='true' and @statements='true']\">\n\t\t\t\t<xsl:if test=\"$accessLevel='public' or $accessLevel='protected'\">\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t<xsl:value-of select=\"$accessLevel\"/>\n\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not($accessLevel='public' or $accessLevel='protected')\">\n\t\t\t\t\t<a href=\"{$baseRef}statements.html#{$accessLevel}\">\n\t\t\t\t\t\t<xsl:value-of select=\"$accessLevel\"/>\n\t\t\t\t\t</a>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:value-of select=\"$accessLevel\"/>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template name=\"getSpecialTypeLink\">\n\t\t<xsl:param name=\"type\"/>\n\t\t<xsl:param name=\"baseRef\">\n\t\t\t<xsl:call-template name=\"getBaseRef\">\n\t\t\t\t<xsl:with-param name=\"packageName\">\n\t\t\t\t\t<xsl:if test=\"ancestor::apiClassifier\">\n\t\t\t\t\t\t<xsl:value-of select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"not(ancestor::apiClassifier)\">\n\t\t\t\t\t\t<xsl:value-of select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:with-param>\n\t\t\t</xsl:call-template>\n\t\t</xsl:param>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"$config/languageElements[@show='true' and @specialTypes='true']\">\n\t\t\t\t<a href=\"{$baseRef}specialTypes.html#{$type}\">\n\t\t\t\t\t<xsl:value-of select=\"$type\"/>\n\t\t\t\t</a>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:value-of select=\"$type\"/>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template name=\"includeExamples\">\n\t\t<xsl:param name=\"showIncludeExamples\" select=\"$showIncludeExamples\"/>\n\t\t<xsl:param name=\"createExampleLink\"/>\n\t\t<xsl:param name=\"createExampleInstructionLink\" select=\"'false'\"/>\n\t\t<xsl:if test=\"$showIncludeExamples = 'true'\">\n\t\t\t<xsl:if test=\"./*/example/codeblock\">\n\t\t\t\t<xsl:if test=\"$createExampleLink = 'true'\">\n\t\t\t\t\t<a name=\"includeExamplesSummary\"/>\n\t\t\t\t\t<div class=\"detailSectionHeader\">\n\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Examples']]/entry[2]/p\"/>\n\t\t\t\t\t</div>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:for-each select=\"./*/example\">\n\t\t\t\t\t<xsl:if test=\"$createExampleLink = 'false' and position() = 1\">\n\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t\t\t<span class=\"label\">\n\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\">Example</xsl:with-param>\n\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"$createExampleLink = 'true' and string-length(@conref) &gt; 0 \">\n\t\t\t\t\t\t<div class=\"exampleHeader\">\n\t\t\t\t\t\t\t<xsl:call-template name=\"lastIndexOf\">\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"string\" select=\"@conref\"/>\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"char\" select=\"'\\'\"/>\n\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"contains(@conref,'.as')\">\n\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<div class=\"detailBody\">\n\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t\t<xsl:if test=\"swfblock/@conref and $showSWFs='true'\">\n\t\t\t\t\t\t\t<xsl:call-template name=\"getPlugin\">\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"pluginId\" select=\"concat('example',position())\"/>\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"filename\" select=\"swfblock/@conref\"/>\n\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</div>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:if>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getPlugin\">\n\t\t<xsl:param name=\"pluginId\"/>\n\t\t<xsl:param name=\"filename\"/>\n\t\t<xsl:if test=\"not($isEclipse)\">\n\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\t<xsl:comment> AC_FL_RunContent( \"src\", \"<xsl:value-of select=\"substring-before($filename,'.swf')\"/>\", \"width\", \"100%\",\n\t\t\t\t\t\"height\",\"400px\", \"salign\", \"TL\", \"id\", \"<xsl:value-of select=\"$pluginId\"/>\", \"quality\", \"high\", \"bgcolor\", \"\", \"name\",\n\t\t\t\t\t\t\"<xsl:value-of select=\"$pluginId\"/>\", \"flashvars\",\"\", \"allowScriptAccess\",\"sameDomain\", \"type\",\n\t\t\t\t\t\"application/x-shockwave-flash\",\"pluginspage\", \"http://www.macromedia.com/go/getflashplayer\" ); </xsl:comment>\n\t\t\t</script>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template match=\"apiOperation\" mode=\"detail\">\n\t\t<xsl:param name=\"classDeprecated\" select=\"'false'\"/>\n\t\t<xsl:param name=\"isMethod\" select=\"true()\"/>\n\t\t<xsl:param name=\"className\" select=\"''\"/>\n\t\t<xsl:param name=\"baseRef\"/>\n\t\t<xsl:variable name=\"name\" select=\"./apiName\"/>\n\t\t<a name=\"{$name}()\"/>\n\t\t<xsl:if test=\"count(./apiOperationDetail/apiOperationDef/apiParam) &gt; 0 \">\n\t\t\t<xsl:variable name=\"anchorWithArgs\">\n\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t<xsl:text>(</xsl:text>\n\t\t\t\t<xsl:for-each select=\"./apiOperationDetail/apiOperationDef/apiParam\">\n\t\t\t\t\t<xsl:if test=\"./apiOperationClassifier\">\n\t\t\t\t\t\t<xsl:value-of select=\"translate(./apiOperationClassifier, ':', '.')\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"./apiType\">\n\t\t\t\t\t\t<xsl:value-of select=\"translate(./apiType/@value, ':', '.')\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"position() != last()\">\n\t\t\t\t\t\t<xsl:text>,</xsl:text>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:for-each>\n\t\t\t\t<xsl:text>)</xsl:text>\n\t\t\t</xsl:variable>\n\t\t\t<a name=\"{$anchorWithArgs}\"/>\n\t\t</xsl:if>\n\t\t<table class=\"detailHeader\" cellpadding=\"0\" cellspacing=\"0\">\n\t\t\t<tr>\n\t\t\t\t<td class=\"detailHeaderName\">\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t<xsl:if test=\"prolog/asMetadata/apiVersion/apiPlatform[@name='AIR'] and not (prolog/asMetadata/apiVersion/apiPlatform[@name='Flash'])\">\n\t\t\t\t\t\t\t\t<xsl:call-template name=\"insertAIRIcon\">\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t</td>\n\t\t\t\t<td class=\"detailHeaderParens\">\n\t\t\t\t\t<xsl:text>()</xsl:text>\n\t\t\t\t</td>\n\t\t\t\t<td class=\"detailHeaderType\">\n\t\t\t\t\t<xsl:if test=\"$prog_language_name='ActionScript'\">\n\t\t\t\t\t\t<xsl:if test=\"$isMethod\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Method']]/entry[2]/p\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"not($isMethod)\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Function']]/entry[2]/p\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</td>\n\t\t\t\t<xsl:if test=\"position()!=1\">\n\t\t\t\t\t<td class=\"detailHeaderRule\">\n\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t</td>\n\t\t\t\t</xsl:if>\n\t\t\t</tr>\n\t\t</table>\n\t\t<div class=\"detailBody\">\n\t\t\t<xsl:if test=\"(not(@type) or @type='method')\">\n\t\t\t\t<code>\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t<xsl:if test=\"./apiOperationDetail/apiOperationDef/apiIsOverride\">\n\t\t\t\t\t\t\t\t<xsl:text>override</xsl:text>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t<xsl:call-template name=\"getNamespaceLink\">\n\t\t\t\t\t\t<xsl:with-param name=\"accessLevel\" select=\"./apiOperationDetail/apiOperationDef/apiAccess/@value\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t<xsl:if test=\"./apiOperationDetail/apiOperationDef/apiFinal\">\n\t\t\t\t\t\t<xsl:text>final </xsl:text>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t<xsl:if test=\"./apiOperationDetail/apiOperationDef/apiStatic\">\n\t\t\t\t\t\t\t\t<xsl:text>static </xsl:text>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t<xsl:if test=\"$prog_language_name='ActionScript'\">\n\t\t\t\t\t\t<xsl:text>function</xsl:text>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t\t<xsl:text>(</xsl:text>\n\t\t\t\t\t<xsl:call-template name=\"params\"/>\n\t\t\t\t\t<xsl:text>)</xsl:text>\n\t\t\t\t\t<xsl:if test=\"self::apiOperation and $prog_language_name='ActionScript'\">\n\t\t\t\t\t\t<xsl:text>:</xsl:text>\n\t\t\t\t\t\t<xsl:call-template name=\"processReturnType\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</code>\n\t\t\t</xsl:if>\n\t\t\t<xsl:apply-templates select=\"apiOperationDetail/apiOperationDef/apiDeprecated\"/>\n\t\t\t<xsl:apply-templates select=\"deprecated\"/>\n\t\t\t<xsl:if test=\"$classDeprecated='true'\">\n\t\t\t\t<xsl:call-template name=\"description\">\n\t\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t<xsl:with-param name=\"addParagraphTags\" select=\"true()\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:if>\n\t\t\t<xsl:call-template name=\"version\"/>\n\t\t\t<xsl:if test=\"$classDeprecated!='true'\">\n\t\t\t\t<xsl:call-template name=\"description\">\n\t\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t<xsl:with-param name=\"addParagraphTags\" select=\"true()\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"count(./apiOperationDetail/apiOperationDef/apiParam) &gt; 0 \">\n\t\t\t\t<p>\n\t\t\t\t\t<xsl:call-template name=\"parameters\"/>\n\t\t\t\t</p>\n\t\t\t</xsl:if>\n\t\t\t<xsl:call-template name=\"result\"/>\n\t\t\t<xsl:call-template name=\"event\"/>\n\t\t\t<xsl:if test=\"apiOperationDetail/apiOperationDef/apiException\">\n\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t<span class=\"label\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Throws']]/entry[2]/p\"/>\n\t\t\t\t</span>\n\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n\t\t\t\t\t<xsl:apply-templates select=\"apiOperationDetail/apiOperationDef/apiException\"/>\n\t\t\t\t</table>\n\t\t\t</xsl:if>\n\t\t\t<xsl:call-template name=\"sees\"/>\n\t\t\t<xsl:if test=\"./*/example[codeblock]\">\n\t\t\t\t<xsl:call-template name=\"includeExamples\">\n\t\t\t\t\t<xsl:with-param name=\"createExampleLink\" select=\"'false'\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"./*/example[not(codeblock)] | includeExamples/includeExample[not(codepart)] \">\n\t\t\t\t<xsl:for-each select=\"./*/example[not(codeblock)] | includeExamples/includeExample[not(codepart)]\">\n\t\t\t\t\t<xsl:if test=\"count(descendant::*) &gt; 0\">\n\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t\t\t<span class=\"label\">\n\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\">Example</xsl:with-param>\n\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:if>\n\t\t</div>\n\t</xsl:template>\n\t<!-- CONSTRUCTORS -->\n\t<xsl:template match=\"apiConstructor\" mode=\"detail\">\n\t\t<xsl:param name=\"classDeprecated\" select=\"'false'\"/>\n\t\t<xsl:param name=\"baseRef\"/>\n\t\t<xsl:variable name=\"name\" select=\"./apiName\"/>\n\t\t<xsl:if test=\"position()>1\">\n\t\t\t<a name=\"{$name}{position()}()\"/>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"position()=1\">\n\t\t\t<a name=\"{$name}()\"/>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"count(./apiConstructorDetail/apiConstructorDef/apiParam) &gt; 0 \">\n\t\t\t<xsl:variable name=\"anchorWithArgs\">\n\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t<xsl:text>(</xsl:text>\n\t\t\t\t<xsl:for-each select=\"./apiConstructorDetail/apiConstructorDef/apiParam\">\n\t\t\t\t\t<xsl:if test=\"./apiOperationClassifier\">\n\t\t\t\t\t\t<xsl:value-of select=\"translate(./apiOperationClassifier, ':', '.')\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"./apiType\">\n\t\t\t\t\t\t<xsl:value-of select=\"translate(./apiType/@value, ':', '.')\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"position() != last()\">\n\t\t\t\t\t\t<xsl:text>,</xsl:text>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:for-each>\n\t\t\t\t<xsl:text>)</xsl:text>\n\t\t\t</xsl:variable>\n\n\t\t\t<a name=\"{$anchorWithArgs}\"/>\n\t\t</xsl:if>\n\t\t<table class=\"detailHeader\" cellpadding=\"0\" cellspacing=\"0\">\n\t\t\t<tr>\n\t\t\t\t<td class=\"detailHeaderName\">\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t<xsl:if test=\"prolog/asMetadata/apiVersion/apiPlatform[@name='AIR'] and not (prolog/asMetadata/apiVersion/apiPlatform[@name='Flash'])\">\n\t\t\t\t\t\t\t\t<xsl:call-template name=\"insertAIRIcon\">\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t</td>\n\t\t\t\t<td class=\"detailHeaderParens\">\n\t\t\t\t\t<xsl:text>()</xsl:text>\n\t\t\t\t</td>\n\t\t\t\t<xsl:if test=\"$prog_language_name='ActionScript'\">\n\t\t\t\t\t<td class=\"detailHeaderType\">\n\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Constructor']]/entry[2]/p\"/>\n\t\t\t\t\t</td>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"position()!=1\">\n\t\t\t\t\t<td class=\"detailHeaderRule\">\n\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t</td>\n\t\t\t\t</xsl:if>\n\t\t\t</tr>\n\t\t</table>\n\t\t<div class=\"detailBody\">\n\t\t\t<xsl:if test=\"(not(@type) or @type='method')\">\n\t\t\t\t<code>\n\t\t\t\t\t<xsl:call-template name=\"getNamespaceLink\">\n\t\t\t\t\t\t<xsl:with-param name=\"accessLevel\" select=\"apiConstructorDetail/apiConstructorDef/apiAccess/@value\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t<xsl:if test=\"$prog_language_name='ActionScript'\">\n\t\t\t\t\t\t<xsl:text> function</xsl:text>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t<xsl:text>(</xsl:text>\n\t\t\t\t\t<xsl:call-template name=\"params\"/>\n\t\t\t\t\t<xsl:text>)</xsl:text>\n\t\t\t\t</code>\n\t\t\t</xsl:if>\n\t\t\t<xsl:apply-templates select=\"apiConstructorDetail/apiConstructorDef/apiDeprecated\"/>\n\t\t\t<xsl:call-template name=\"version\"/>\n\t\t\t<xsl:variable name=\"description\">\n\t\t\t\t<xsl:call-template name=\"description\">\n\t\t\t\t\t<xsl:with-param name=\"classDeprecated\" select=\"$classDeprecated\"/>\n\t\t\t\t\t<xsl:with-param name=\"addParagraphTags\" select=\"true()\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:value-of select=\"$description\"/>\n\t\t\t<xsl:if test=\"$description=''\">\n\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"count(./apiConstructorDetail/apiConstructorDef/apiParam) &gt; 0\">\n\t\t\t\t<xsl:call-template name=\"parameters\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:call-template name=\"event\"/>\n\t\t\t<xsl:if test=\"apiConstructorDetail/apiConstructorDef/apiException\">\n\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t<span class=\"label\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Throws']]/entry[2]/p\"/>\n\t\t\t\t</span>\n\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n\t\t\t\t\t<xsl:apply-templates select=\"apiConstructorDetail/apiConstructorDef/apiException\"/>\n\t\t\t\t</table>\n\t\t\t</xsl:if>\n\t\t\t<xsl:call-template name=\"sees\"/>\n\t\t\t<xsl:if test=\"./*/example[codeblock]\">\n\t\t\t\t<xsl:call-template name=\"includeExamples\">\n\t\t\t\t\t<xsl:with-param name=\"createExampleLink\" select=\"'false'\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"./*/example[not(codeblock)] | includeExamples/includeExample[not(codepart)] \">\n\t\t\t\t<xsl:for-each select=\"./*/example | includeExamples/includeExample[not(codepart)]\">\n\t\t\t\t\t<xsl:if test=\"count(descendant::*) &gt; 0\">\n\t\t\t\t\t\t<xsl:if test=\"position() = 1\">\n\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t\t\t\t<span class=\"label\">\n\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\">Example</xsl:with-param>\n\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:if>\n\t\t</div>\n\t</xsl:template>\n\t<!-- PARAMS -->\n\t<xsl:template name=\"params\">\n\t\t<xsl:param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t<xsl:variable name=\"baseRef\">\n\t\t\t<xsl:call-template name=\"getBaseRef\">\n\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$currentPackage\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:for-each select=\".//apiParam\">\n\t\t\t<xsl:if test=\"position()>1\">\n\t\t\t\t<xsl:text>, </xsl:text>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"$config/options/@docversion='2' and @optional='true'\">\n\t\t\t\t<xsl:text>[</xsl:text>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"./apiType or ./apiOperationClassifier\">\n\t\t\t\t<xsl:if test=\"./apiType/@value= 'restParam' or ./apiOperationClassifier = 'restParam'\">\n\t\t\t\t\t<xsl:if test=\"$config/languageElements[@show='true' and @statements='true']\">\n\t\t\t\t\t\t<a href=\"{$baseRef}statements.html#..._(rest)_parameter\">...</a>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"not($config/languageElements[@show='true' and @statements='true'])\">\n\t\t\t\t\t\t<xsl:text>...</xsl:text>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t<xsl:value-of select=\"./apiItemName\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"((./apiType and ./apiType/@value!='restParam'))  or (./apiOperationClassifier and ./apiOperationClassifier != 'restParam')\">\n\t\t\t\t\t<xsl:if test=\"$prog_language_name='ActionScript'\">\n\t\t\t\t\t\t<xsl:value-of select=\"./apiItemName\"/>\n\t\t\t\t\t\t<xsl:text>:</xsl:text>\n\t\t\t\t\t\t<xsl:call-template name=\"processParamType\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"(string-length(apiData) or ./apiOperationClassifier='String') and apiData!='unknown'\">\n\t\t\t\t<xsl:text> = </xsl:text>\n\t\t\t\t<xsl:if test=\"./apiOperationClassifier='String' and apiData!='null'\">\n\t\t\t\t\t<xsl:text>\"</xsl:text>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:value-of select=\"apiData\"/>\n\t\t\t\t<xsl:if test=\"./apiOperationClassifier='String' and apiData!='null'\">\n\t\t\t\t\t<xsl:text>\"</xsl:text>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"./apiOperationClassifier='Number' and apiData='unknown'\">\n\t\t\t\t<xsl:text> = NaN</xsl:text>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"$config/options/@docversion='2' and @optional='true'\">\n\t\t\t\t<xsl:text>]</xsl:text>\n\t\t\t</xsl:if>\n\t\t</xsl:for-each>\n\t</xsl:template>\n\t<xsl:template name=\"processParamType\">\n\t\t<xsl:param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t<xsl:param name=\"baseRef\" select=\"''\"/>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"./apiOperationClassifier\">\n\t\t\t\t<xsl:variable name=\"destination\" select=\"./apiOperationClassifier\"/>\n\t\t\t\t<xsl:variable name=\"h1\" select=\"substring-after($destination,':')\"/>\n\t\t\t\t<xsl:variable name=\"h2\" select=\"substring-before($destination,':')\"/>\n\t\t\t\t<xsl:variable name=\"file\" select=\"concat($baseRef,translate($h2,'.','/'),'/',$h1,'.html')\"/>\n\t\t\t\t<xsl:variable name=\"gfile\" select=\"concat($baseRef,$destination,'.html')\"/>\n\t\t\t\t<xsl:variable name=\"hyperLink\">\n\t\t\t\t\t<xsl:if test=\"contains($destination,'.')\">\n\t\t\t\t\t\t<xsl:if test=\"$prog_language_name!='javascript'\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"not(contains($destination,'.'))\">\n\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$gfile\"/>\n\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<xsl:if test=\"$hyperLink = ''\">\n\t\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"./apiOperationClassifier\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$hyperLink != ''\">\n\t\t\t\t\t<a href=\"{$hyperLink}\">\n\t\t\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"./apiOperationClassifier\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</a>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:when>\n\t\t\t<xsl:when test=\"./apiType/@value='' or ./apiType/@value='*' or ./apiType/@value='any'or ./apiOperationClassifier='' or ./apiOperationClassifier='*'\">\n\t\t\t\t<xsl:call-template name=\"getSpecialTypeLink\">\n\t\t\t\t\t<xsl:with-param name=\"type\" select=\"'*'\"/>\n\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:when>\n\t\t\t<xsl:when test=\"not(./apiOperationClassifier)\">\n\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"./apiType/@value\"/>\n\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:when>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template name=\"parameters\">\n\t\t<xsl:param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t<span class=\"label\">\n\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t<xsl:with-param name=\"key\">Parameters</xsl:with-param>\n\t\t\t</xsl:call-template>\n\t\t</span>\n\t\t<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n\t\t\t<xsl:for-each select=\".//apiParam\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td width=\"20px\"/>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<code>\n\t\t\t\t\t\t\t<xsl:if test=\"./apiType/@value='restParam' or ./apiOperationClassifier='restParam'\">\n\t\t\t\t\t\t\t\t<xsl:variable name=\"baseRef\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$currentPackage\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getBaseRef\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$currentPackage\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t<xsl:if test=\"$config/languageElements[@show='true' and @statements='true']\">\n\t\t\t\t\t\t\t\t\t<a href=\"{$baseRef}statements.html#..._(rest)_parameter\">...</a>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"not($config/languageElements[@show='true' and @statements='true'])\">\n\t\t\t\t\t\t\t\t\t<xsl:text>...</xsl:text>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t<span class=\"label\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"./apiItemName\"/>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"((./apiType) and ./apiType/@value!='restParam')  or (./apiOperationClassifier and ./apiOperationClassifier!='restParam')\">\n\t\t\t\t\t\t\t\t<span class=\"label\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"./apiItemName\"/>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<xsl:if test=\"$prog_language_name='ActionScript'\">\n\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"./apiOperationClassifier\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"packageName\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"baseRef\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getBaseRef\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$packageName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"destination\" select=\"./apiOperationClassifier\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h1\" select=\"substring-after($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h2\" select=\"substring-before($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"file\" select=\"concat($baseRef,translate($h2,'.','/'),'/',$h1,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"gfile\" select=\"concat($baseRef,$destination,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"hyperLink\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($destination,'.')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($destination,'.'))\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$gfile\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>:</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$hyperLink = ''\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"./apiOperationClassifier\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$hyperLink != ''\">\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$hyperLink}\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"./apiOperationClassifier\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"./apiType/@value='' or ./apiType/@value='*' or ./apiType/@value='any' or ./apiOperationClassifier='' or ./apiOperationClassifier='*'\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>:</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"baseRef\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getBaseRef\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$currentPackage\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSpecialTypeLink\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"type\" select=\"'*'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"not(./apiOperationClassifier)\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"baseRef\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getBaseRef\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$currentPackage\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>:</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"./apiType/@value\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t</xsl:if>\n\n\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"(string-length(./apiData) or ./apiOperationClassifier='String') and ./apiData!='unknown'\">\n\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;/code&gt; (default = </xsl:text>\n\t\t\t\t\t\t\t\t<xsl:if test=\"./apiOperationClassifier='String' and ./apiData!='null'\">\n\t\t\t\t\t\t\t\t\t<xsl:text>\"</xsl:text>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;code&gt;</xsl:text>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"apiData\"/>\n\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;/code&gt;</xsl:text>\n\t\t\t\t\t\t\t\t<xsl:if test=\"./apiOperationClassifier='String' and ./apiData!='null'\">\n\t\t\t\t\t\t\t\t\t<xsl:text>\"</xsl:text>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:text>)</xsl:text>\n\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;code&gt;</xsl:text>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"(string-length(./apiData) or ./apiOperationClassifier='Number') and ./apiData='unknown'\">\n\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;/code&gt; (default = </xsl:text>\n\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;code&gt;</xsl:text>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"'NaN'\"/>\n\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;/code&gt;</xsl:text>\n\t\t\t\t\t\t\t\t<xsl:text>)</xsl:text>\n\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;code&gt;</xsl:text>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</code>\n\t\t\t\t\t\t<xsl:if test=\"@optional='true'\">\n\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\"><![CDATA[&nbsp;]]>[optional]</xsl:text>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"normalize-space(./apiDesc/.)\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$emdash\"/>\n\t\t\t\t\t\t\t<xsl:for-each select=\"./apiDesc\">\n\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<xsl:if test=\"position()!=last()\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=\"paramSpacer\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:for-each>\n\t\t</table>\n\t</xsl:template>\n\t<!-- RESULT -->\n\t<xsl:template name=\"result\">\n\t\t<xsl:param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t<xsl:variable name=\"baseRef\">\n\t\t\t<xsl:call-template name=\"getBaseRef\">\n\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$currentPackage\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:if\n\t\t\ttest=\"(not(apiOperationDetail/apiOperationDef/apiReturn/apiType) or apiOperationDetail/apiOperationDef/apiReturn/apiType[@value != 'void']) and not($config/options/@docversion='2' and apiOperationDetail/apiOperationDef/apiReturn/apiOperationClassifer='Void')\">\n\t\t\t<p/>\n\t\t\t<span class=\"label\">\n\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Returns']]/entry[2]/p\"/>\n\t\t\t</span>\n\t\t\t<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td width=\"20\"/>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<xsl:if test=\"$prog_language_name='ActionScript'\">\n\t\t\t\t\t\t\t<code>\n\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t<xsl:when\n\t\t\t\t\t\t\t\t\t\ttest=\"apiOperationDetail/apiOperationDef/apiReturn/apiType/@value='' or apiOperationDetail/apiOperationDef/apiReturn/apiType/@value='*' or apiOperationDetail/apiOperationDef/apiReturn/apiType/@value='any' \">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSpecialTypeLink\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"type\" select=\"'*'\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t<xsl:when test=\"apiOperationDetail/apiOperationDef/apiReturn/apiType/@value='Void' and $config/options/@docversion='2'\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"apiOperationDetail/apiOperationDef/apiReturn/apiType/@value\"/>\n\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t<xsl:when test=\"apiOperationDetail/apiOperationDef/apiReturn/apiOperationClassifier\">\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"destination\" select=\"apiOperationDetail/apiOperationDef/apiReturn/apiOperationClassifier\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h1\" select=\"substring-after($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h2\" select=\"substring-before($destination,':')\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"file\" select=\"concat($baseRef,translate($h2,'.','/'),'/',$h1,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"gfile\" select=\"concat($baseRef,$destination,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"hyperLink\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($destination,'.')\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($destination,'.'))\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$gfile\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$hyperLink = ''\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"apiOperationDetail/apiOperationDef/apiReturn/apiOperationClassifier\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$hyperLink != ''\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$hyperLink}\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"apiOperationDetail/apiOperationDef/apiReturn/apiOperationClassifier\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t<xsl:when test=\"not(apiOperationDetail/apiOperationDef/apiReturn/apiOperationClassifier)\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"apiOperationDetail/apiOperationDef/apiReturn/apiType/@value\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t</code>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"./apiOperationDetail/apiOperationDef/apiReturn/apiDesc/@conref\">\n\t\t\t\t\t\t\t<xsl:if test=\"$prog_language_name='ActionScript'\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$emdash\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"./apiOperationDetail/apiOperationDef/apiReturn/apiDesc/@conref\"/>\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"local-name(./apiOperationDetail/apiOperationDef/apiReturn/apiDesc)\"/>\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"'method'\"/>\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"not(./apiOperationDetail/apiOperationDef/apiReturn/apiDesc/@conref)\">\n\t\t\t\t\t\t\t<xsl:for-each select=\"./apiOperationDetail/apiOperationDef/apiReturn/apiDesc\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"$prog_language_name='ActionScript'\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$emdash\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<!-- THROWS -->\n\t<xsl:template match=\"apiException\">\n\t\t<xsl:param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t<tr>\n\t\t\t<td width=\"20\"/>\n\t\t\t<td>\n\t\t\t\t<code>\n\t\t\t\t\t<xsl:if test=\"apiOperationClassifier\">\n\t\t\t\t\t\t<xsl:variable name=\"packageName\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t\t<xsl:variable name=\"baseRef\">\n\t\t\t\t\t\t\t<xsl:call-template name=\"getBaseRef\">\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$packageName\"/>\n\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t<xsl:variable name=\"destination\" select=\"apiOperationClassifier\"/>\n\t\t\t\t\t\t<xsl:if test=\"count($classHeader_map//apiClassifier[@id=$destination] ) &gt; 0\">\n\t\t\t\t\t\t\t<xsl:variable name=\"h1\" select=\"substring-after($destination,':')\"/>\n\t\t\t\t\t\t\t<xsl:variable name=\"h2\" select=\"substring-before($destination,':')\"/>\n\t\t\t\t\t\t\t<xsl:variable name=\"file\" select=\"concat($baseRef,translate($h2,'.','/'),'/',$h1,'.html')\"/>\n\t\t\t\t\t\t\t<xsl:variable name=\"gfile\" select=\"concat($baseRef,$destination,'.html')\"/>\n\t\t\t\t\t\t\t<xsl:variable name=\"hyperLink\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"contains($destination,'.')\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$prog_language_name!='javascript'\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($destination,'.'))\">\n\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$gfile\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:variable>\n\n\t\t\t\t\t\t\t<xsl:if test=\"$hyperLink = ''\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"apiItemName\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"$hyperLink != ''\">\n\t\t\t\t\t\t\t\t<a href=\"{$hyperLink}\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"apiItemName\"/>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"not(count($classHeader_map//apiClassifier[@id=$destination] ) &gt; 0)\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"apiItemName\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t</xsl:if>\n\n\t\t\t\t</code>\n\t\t\t\t<xsl:if test=\"string-length(apiDesc/.)\">\n\t\t\t\t\t<xsl:value-of select=\"$emdash\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:for-each select=\"./apiDesc\">\n\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t</xsl:for-each>\n\t\t\t</td>\n\t\t</tr>\n\t\t<xsl:if test=\"position()!=last()\">\n\t\t\t<tr>\n\t\t\t\t<td class=\"paramSpacer\">\n\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<!-- EXAMPLES -->\n\t<xsl:template match=\"example | includeExample\">\n\t\t<xsl:param name=\"show\" select=\"$showExamples\"/>\n\t\t<xsl:if test=\"$show = 'true'\">\n\t\t\t<xsl:if test=\"position()=1\">\n\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t<span class=\"label\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Example']]/entry[2]/p\"/>\n\t\t\t\t</span>\n\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"self::example\">\n\t\t\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t\t\t<xsl:with-param name=\"inText\">\n\t\t\t\t\t\t<xsl:apply-templates mode=\"deTab\"/>\n\t\t\t\t\t</xsl:with-param>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"self::includeExample\">\n\t\t\t\t<xsl:variable name=\"deTabbed\">\n\t\t\t\t\t<xsl:call-template name=\"search-and-replace\">\n\t\t\t\t\t\t<xsl:with-param name=\"input\" select=\"codeblock/.\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"search-string\" select=\"$tab\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"replace-string\" select=\"$tabSpaces\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<xsl:variable name=\"initialComment\" select=\"starts-with($deTabbed,'/*')\"/>\n\t\t\t\t<xsl:if test=\"$initialComment\">\n\t\t\t\t\t<xsl:variable name=\"comment\" select=\"substring-before($deTabbed,'*/')\"/>\n\t\t\t\t\t<xsl:if test=\"contains($comment,'@exampleText ')\">\n\t\t\t\t\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"inText\" select=\"substring-after(translate($comment,'*',''),'@exampleText ')\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$initialComment\">\n\t\t\t\t\t<xsl:variable name=\"rest\" select=\"substring-after($deTabbed,'*/')\"/>\n\t\t\t\t\t<xsl:variable name=\"finalComment\" select=\"contains($rest,'/*')\"/>\n\t\t\t\t\t<xsl:if test=\"$finalComment\">\n\t\t\t\t\t\t<div class=\"listing\">\n\t\t\t\t\t\t\t<pre>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring-before($rest,'/*')\"/>\n\t\t\t\t\t\t\t</pre>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<xsl:if test=\"contains($rest,'@exampleText ')\">\n\t\t\t\t\t\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"inText\" select=\"substring-after(translate(substring-before($rest,'*/'),'*',''),'@exampleText ')\"/>\n\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"not($finalComment)\">\n\t\t\t\t\t\t<div class=\"listing\">\n\t\t\t\t\t\t\t<pre>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring-after($deTabbed,'*/')\"/>\n\t\t\t\t\t\t\t</pre>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not($initialComment)\">\n\t\t\t\t\t<xsl:variable name=\"finalComment\" select=\"contains($deTabbed,'/*')\"/>\n\t\t\t\t\t<xsl:if test=\"$finalComment\">\n\t\t\t\t\t\t<div class=\"listing\">\n\t\t\t\t\t\t\t<pre>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring-before($deTabbed,'/*')\"/>\n\t\t\t\t\t\t\t</pre>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<xsl:if test=\"contains($deTabbed,'@exampleText ')\">\n\t\t\t\t\t\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"inText\" select=\"substring-after(translate(substring-before($deTabbed,'*/'),'*',''),'@exampleText ')\"/>\n\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"not($finalComment)\">\n\t\t\t\t\t\t<div class=\"listing\">\n\t\t\t\t\t\t\t<pre>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$deTabbed\"/>\n\t\t\t\t\t\t\t</pre>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"swfblock/@conref and $showSWFs='true'\">\n\t\t\t\t\t<xsl:variable name=\"filename\" select=\"swfblock/@conref\"/>\n\t\t\t\t\t<xsl:call-template name=\"getPlugin\">\n\t\t\t\t\t\t<xsl:with-param name=\"filename\" select=\"$filename\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:if>\n\t\t\t<p/>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template match=\"text()\" mode=\"deTab\">\n\t\t<xsl:call-template name=\"search-and-replace\">\n\t\t\t<xsl:with-param name=\"input\" select=\".\"/>\n\t\t\t<xsl:with-param name=\"search-string\" select=\"'&#09;'\"/>\n\t\t\t<xsl:with-param name=\"replace-string\" select=\"'    '\"/>\n\t\t</xsl:call-template>\n\t</xsl:template>\n\t<xsl:template name=\"includeExampleLink\">\n\t\t<xsl:param name=\"showIncludeExamples\" select=\"$showIncludeExamples\"/>\n\t\t<xsl:if test=\"$showIncludeExamples = 'true'\">\n\t\t\t<xsl:if test=\"./*/example/codeblock\">\n\t\t\t\t<p>\n\t\t\t\t\t<a href=\"#includeExamplesSummary\">\n\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ViewExamples']]/entry[2]/p\"/>\n\t\t\t\t\t</a>\n\t\t\t\t</p>\n\t\t\t</xsl:if>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"inherited\">\n\t\t<xsl:param name=\"lowerType\"/>\n\t\t<xsl:param name=\"upperType\"/>\n\t\t<xsl:param name=\"prefix\"/>\n\t\t<xsl:param name=\"postfix\"/>\n\t\t<xsl:param name=\"inheritedItems\"/>\n\t\t<xsl:param name=\"staticItems\"/>\n\t\t<xsl:if test=\"string-length($inheritedItems) &gt; 0\">\n\t\t\t<xsl:call-template name=\"doInherited\">\n\t\t\t\t<xsl:with-param name=\"lowerType\" select=\"$lowerType\"/>\n\t\t\t\t<xsl:with-param name=\"upperType\" select=\"$upperType\"/>\n\t\t\t\t<xsl:with-param name=\"prefix\" select=\"$prefix\"/>\n\t\t\t\t<xsl:with-param name=\"postfix\" select=\"$postfix\"/>\n\t\t\t\t<xsl:with-param name=\"items\" select=\"$inheritedItems\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"string-length($staticItems) &gt; 0\">\n\t\t\t<xsl:call-template name=\"doInherited\">\n\t\t\t\t<xsl:with-param name=\"lowerType\" select=\"$lowerType\"/>\n\t\t\t\t<xsl:with-param name=\"upperType\" select=\"$upperType\"/>\n\t\t\t\t<xsl:with-param name=\"prefix\" select=\"$prefix\"/>\n\t\t\t\t<xsl:with-param name=\"postfix\" select=\"$postfix\"/>\n\t\t\t\t<xsl:with-param name=\"items\" select=\"$staticItems\"/>\n\t\t\t\t<xsl:with-param name=\"isStatic\" select=\"true()\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"doInherited\">\n\t\t<xsl:param name=\"lowerType\"/>\n\t\t<xsl:param name=\"upperType\"/>\n\t\t<xsl:param name=\"prefix\"/>\n\t\t<xsl:param name=\"postfix\"/>\n\t\t<xsl:param name=\"items\"/>\n\t\t<xsl:param name=\"innerClass\" select=\"false()\"/>\n\t\t<xsl:param name=\"isStatic\" select=\"false()\"/>\n\t\t<xsl:variable name=\"classRef\" select=\"classRef\"/>\n\t\t<xsl:variable name=\"bgColor\">\n\t\t\t<xsl:if test=\"not($isStatic)\">\n\t\t\t\t<xsl:text>#EEEEEE</xsl:text>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"$isStatic\">\n\t\t\t\t<xsl:text>#EEDDDD</xsl:text>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<a name=\"{$lowerType}InheritedFrom{$classRef/@name}\"/>\n\t\t<table cellspacing=\"0\" cellpadding=\"3\" class=\"summaryTable\">\n\t\t\t<tr>\n\t\t\t\t<th>\n\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t</th>\n\t\t\t\t<th>\n\t\t\t\t\t<xsl:if test=\"$isStatic\">\n\t\t\t\t\t\t<!--defined in class-->\n\t\t\t\t\t\t<xsl:text>Static </xsl:text>\n\t\t\t\t\t\t<xsl:value-of select=\"$lowerType\"/>\n\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"key\">DefinedIn</xsl:with-param>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"not($isStatic)\">\n\t\t\t\t\t\t<!-- inherited from class -->\n\t\t\t\t\t\t<xsl:value-of select=\"$upperType\"/>\n\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"key\">InheritedFrom</xsl:with-param>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<a href=\"{$classRef/@relativePath}\">\n\t\t\t\t\t\t<xsl:value-of select=\"$classRef/@name\"/>\n\t\t\t\t\t</a>\n\t\t\t\t</th>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=\"summaryTablePaddingCol\">\n\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t</td>\n\t\t\t\t<td class=\"inheritanceList\">\n\t\t\t\t\t<code>\n\t\t\t\t\t\t<xsl:for-each select=\"tokenize($items,';')\">\n\t\t\t\t\t\t\t<xsl:sort select=\".\" order=\"ascending\" data-type=\"text\" lang=\"en-US\"/>\n\t\t\t\t\t\t\t<xsl:if test=\"$innerClass\">\n\t\t\t\t\t\t\t\t<xsl:variable name=\"href\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($classRef/@relativePath,':')\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"substring-before-last\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"input\" select=\"$classRef/@relativePath\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"substr\" select=\"':'\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t<xsl:text>/</xsl:text>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t<a href=\"{$href}.html\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"not($innerClass)\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"$prefix\">\n\t\t\t\t\t\t\t\t\t<a href=\"{$classRef/@relativePath}#{$prefix}:{.}{$postfix}\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"not($prefix)\">\n\t\t\t\t\t\t\t\t\t<a href=\"{$classRef/@relativePath}#{.}{$postfix}\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\".\"/>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"position() != last()\">\n\t\t\t\t\t\t\t\t<xsl:text>, </xsl:text>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t</code>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t</xsl:template>\n\t<xsl:template name=\"description\">\n\t\t<xsl:param name=\"classDeprecated\" select=\"'false'\"/>\n\t\t<xsl:param name=\"addParagraphTags\" select=\"false()\"/>\n\t\t<xsl:param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t<xsl:variable name=\"sourceName\">\n\t\t\t<xsl:value-of select=\"local-name(.)\"/>\n\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t</xsl:variable>\n\t\t<xsl:if test=\"$classDeprecated='true'\">\n\t\t\t<xsl:copy-of select=\"$deprecatedLabel\"/>\n\t\t\t<xsl:message>THIS CODE SHOULD NOT BE CALLED. If you see this message, please notify your local ASDocs contact or the tech team. </xsl:message>\n\t\t\t<xsl:text>.</xsl:text>\n\t\t\t<xsl:text> The </xsl:text>\n\t\t\t<xsl:value-of select=\"../../apiName\"/>\n\t\t\t<xsl:text> class is </xsl:text>\n\t\t\t<a href=\"#deprecated\">deprecated</a>\n\t\t\t<xsl:if test=\"string-length(../../deprecated/@as-of)\">\n\t\t\t\t<xsl:text> since </xsl:text>\n\t\t\t\t<xsl:value-of select=\"../../deprecated/@as-of\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:text>.</xsl:text>\n\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t</xsl:if>\n\t\t<xsl:variable name=\"asCustomsText\">\n\t\t\t<xsl:value-of select=\"prolog/asCustoms/review\"/>\n\t\t</xsl:variable>\n\t\t<xsl:if test=\"string-length($asCustomsText) &gt; 0\">\n\t\t\t<xsl:if test=\"$config/options/@showReview='true'\">\n\t\t\t\t<h2>\n\t\t\t\t\t<font color=\"red\">Review Needed</font>\n\t\t\t\t</h2>\n\t\t\t</xsl:if>\n\t\t\t<xsl:value-of select=\"$asCustomsText\"/>\n\t\t</xsl:if>\n\t\t<xsl:for-each select=\"./apiDesc | ./*/apiDesc | ./description\">\n\t\t\t<xsl:variable name=\"entryType\">\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"self::apiClassifier\">\n\t\t\t\t\t\t<xsl:value-of select=\"'class'\"/>\n\t\t\t\t\t</xsl:when>\n\t\t\t\t\t<xsl:when test=\"self::apiOperation\">\n\t\t\t\t\t\t<xsl:value-of select=\"'method'\"/>\n\t\t\t\t\t</xsl:when>\n\t\t\t\t\t<xsl:when test=\"self::apiValue\">\n\t\t\t\t\t\t<xsl:value-of select=\"'property'\"/>\n\t\t\t\t\t</xsl:when>\n\t\t\t\t\t<xsl:when test=\"self::adobeApiEvent\">\n\t\t\t\t\t\t<xsl:value-of select=\"'event'\"/>\n\t\t\t\t\t</xsl:when>\n\t\t\t\t\t<xsl:when test=\"self::style\">\n\t\t\t\t\t\t<xsl:value-of select=\"'style'\"/>\n\t\t\t\t\t</xsl:when>\n\t\t\t\t</xsl:choose>\n\t\t\t</xsl:variable>\n\n\t\t\t<p>\n\t\t\t\t<xsl:if test=\"string-length(./@conref) &gt; 0\">\n\t\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"./@conref\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"local-name(.)\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"$entryType\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:if>\n\t\t\t</p>\n\n\t\t\t<!-- Call for any child NODE PROCESS-->\n\t\t\t<xsl:call-template name=\"processTags\">\n\t\t\t\t<xsl:with-param name=\"addParagraphTags\" select=\"$addParagraphTags\"/>\n\t\t\t</xsl:call-template>\n\t\t\t<!-- END Call for any child NODE PROCESS-->\n\t\t</xsl:for-each>\n\t</xsl:template>\n\t<xsl:template name=\"shortDescription\">\n\t\t<xsl:param name=\"classDeprecated\" select=\"'false'\"/>\n\t\t<xsl:param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t<xsl:if test=\"./shortdesc or $classDeprecated='true'\">\n\t\t\t<xsl:call-template name=\"shortDescriptionReview\"/>\n\t\t\t<xsl:if test=\"$classDeprecated='true'\">\n\t\t\t\t<xsl:copy-of select=\"$deprecatedLabel\"/>\n\t\t\t\t<xsl:text>. </xsl:text>\n\t\t\t</xsl:if>\n\t\t\t<xsl:variable name=\"entryType\">\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"self::apiClassifier\">\n\t\t\t\t\t\t<xsl:value-of select=\"'class'\"/>\n\t\t\t\t\t</xsl:when>\n\t\t\t\t\t<xsl:when test=\"self::apiOperation\">\n\t\t\t\t\t\t<xsl:value-of select=\"'method'\"/>\n\t\t\t\t\t</xsl:when>\n\t\t\t\t\t<xsl:when test=\"self::apiValue\">\n\t\t\t\t\t\t<xsl:value-of select=\"'property'\"/>\n\t\t\t\t\t</xsl:when>\n\t\t\t\t\t<xsl:when test=\"self::adobeApiEvent\">\n\t\t\t\t\t\t<xsl:value-of select=\"'event'\"/>\n\t\t\t\t\t</xsl:when>\n\t\t\t\t\t<xsl:when test=\"self::style\">\n\t\t\t\t\t\t<xsl:value-of select=\"'style'\"/>\n\t\t\t\t\t</xsl:when>\n\t\t\t\t</xsl:choose>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"conRefText\">\n\t\t\t\t<xsl:if test=\"string-length(./shortdesc/@conref) &gt; 0\">\n\t\t\t\t\t<xsl:for-each select=\"./shortdesc\">\n\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t</xsl:for-each>\n\n\t\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"./shortdesc/@conref\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"local-name(./shortdesc)\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"$entryType\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(string-length(./shortdesc/@conref) &gt; 0)\">\n\t\t\t\t\t<xsl:for-each select=\"./shortdesc\">\n\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t</xsl:for-each>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:if test=\"string-length($conRefText) &gt; 0\">\n\t\t\t\t<xsl:value-of select=\"$conRefText\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:if>\n\t</xsl:template>\n\n\t<xsl:template name=\"hasInnerClasses\">\n\t\t<xsl:if test=\"self::apiClassifier\">\n\t\t\t<xsl:value-of select=\"count(./apiClassifier)\"/>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"self::apiPackage\"> </xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"hasConstants\">\n\t\t<xsl:if test=\"self::apiClassifier\">\n\t\t\t<xsl:value-of select=\"count(./apiValue[not(apiValueDetail/apiValueDef/apiProperty)])\"/>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"self::apiPackage\">\n\t\t\t<xsl:value-of select=\"count(.//*[apiValue[not(apiValueDetail/apiValueDef/apiProperty)]])\"/>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"hasFields\">\n\t\t<xsl:if test=\"self::apiClassifier\">\n\t\t\t<xsl:value-of select=\"count(./apiValue[apiValueDetail/apiValueDef/apiProperty])\"/>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"self::apiPackage\">\n\t\t\t<xsl:value-of select=\"count(.//*[apiValue[apiValueDetail/apiValueDef/apiProperty]])\"/>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"hasConstructor\">\n\t\t<xsl:if test=\"self::apiClassifier\">\n\t\t\t<xsl:value-of select=\"count(./apiConstructor)\"/>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"self::apiPackage\">\n\t\t\t<xsl:value-of select=\"count(./*[apiConstructor])\"/>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"hasMethods\">\n\t\t<xsl:if test=\"self::apiClassifier\">\n\t\t\t<xsl:value-of select=\"count(./apiOperation)\"/>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"self::apiPackage\">\n\t\t\t<xsl:value-of select=\"count(.//*[apiOperation])\"/>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<!-- TODO currently the mxmlc compiler does not recognize events defined in interfaces that are\n\t     not redeclared by the implementor, so we can not consider them when determining the event count -->\n\t<xsl:template name=\"hasEvents\">\n\t\t<xsl:if test=\"self::apiClassifier\">\n\t\t\t<xsl:value-of select=\"count(./adobeApiEvent[not(adobeApiEventDetail/adobeApiEventDef/apiDefinedEvent)])\"/>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"hasStyles\">\n\t\t<xsl:value-of select=\"count(.//*[style])\"/>\n\t</xsl:template>\n\n\t  <xsl:template name=\"hasSkinPart\">\n\t    <xsl:value-of select=\"count(.//*[SkinPart])\"/>\n\t  </xsl:template>\n\t  <xsl:template name=\"hasSkinState\">\n\t    <xsl:value-of select=\"count(.//*[SkinState])\"/>\n\t  </xsl:template>\t\n\t<xsl:template name=\"hasEffects\">\n\t\t<xsl:value-of select=\"count(.//*[effect])\"/>\n\t</xsl:template>\n\t<xsl:template name=\"hasInheritedConstants\">\n\t\t<xsl:variable name=\"countList\">\n\t\t\t<xsl:call-template name=\"inheritPropertyCount\">\n\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"./apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t\t<xsl:with-param name=\"accessLevel\" select=\"'public'\"/>\n\t\t\t\t<xsl:with-param name=\"isConst\" select=\"'true'\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"hasInherited\">\n\t\t\t<xsl:call-template name=\"convertNumberListIntoBoolean\">\n\t\t\t\t<xsl:with-param name=\"numberList\" select=\"$countList\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:value-of select=\"$hasInherited\"/>\n\t</xsl:template>\n\t<xsl:template name=\"hasInheritedFields\">\n\t\t<xsl:variable name=\"countList\">\n\t\t\t<xsl:call-template name=\"inheritPropertyCount\">\n\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"./apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t\t<xsl:with-param name=\"accessLevel\" select=\"'public'\"/>\n\t\t\t\t<xsl:with-param name=\"isConst\" select=\"'false'\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"hasInherited\">\n\t\t\t<xsl:call-template name=\"convertNumberListIntoBoolean\">\n\t\t\t\t<xsl:with-param name=\"numberList\" select=\"$countList\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:value-of select=\"$hasInherited\"/>\n\t</xsl:template>\n\t<xsl:template name=\"hasInheritedMethods\">\n\t\t<xsl:variable name=\"countList\">\n\t\t\t<xsl:call-template name=\"inheritMethodCount\">\n\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"./apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t\t<xsl:with-param name=\"accessLevel\" select=\"'public'\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"hasInherited\">\n\t\t\t<xsl:call-template name=\"convertNumberListIntoBoolean\">\n\t\t\t\t<xsl:with-param name=\"numberList\" select=\"$countList\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:value-of select=\"$hasInherited\"/>\n\t</xsl:template>\n\t<xsl:template name=\"hasInheritedEvents\">\n\t\t<xsl:variable name=\"countList\">\n\t\t\t<xsl:call-template name=\"inheritEventCount\">\n\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"./apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"hasInherited\">\n\t\t\t<xsl:call-template name=\"convertNumberListIntoBoolean\">\n\t\t\t\t<xsl:with-param name=\"numberList\" select=\"$countList\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:value-of select=\"$hasInherited\"/>\n\t</xsl:template>\n\t<xsl:template name=\"hasInheritedStyles\">\n\t\t<xsl:variable name=\"countList\">\n\t\t\t<xsl:call-template name=\"inheritStyleCount\">\n\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"./apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"hasInherited\">\n\t\t\t<xsl:call-template name=\"convertNumberListIntoBoolean\">\n\t\t\t\t<xsl:with-param name=\"numberList\" select=\"$countList\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:value-of select=\"$hasInherited\"/>\n\t</xsl:template>\n\t<xsl:template name=\"hasInheritedSkinPart\">\n\t\t<xsl:variable name=\"countList\">\n\t\t\t<xsl:call-template name=\"inheritSkinPartCount\">\n\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"./apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"hasInherited\">\n\t\t\t<xsl:call-template name=\"convertNumberListIntoBoolean\">\n\t\t\t\t<xsl:with-param name=\"numberList\" select=\"$countList\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:value-of select=\"$hasInherited\"/>\n\t</xsl:template>\n\t<xsl:template name=\"hasInheritedSkinState\">\n\t\t<xsl:variable name=\"countList\">\n\t\t\t<xsl:call-template name=\"inheritSkinStateCount\">\n\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"./apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"hasInherited\">\n\t\t\t<xsl:call-template name=\"convertNumberListIntoBoolean\">\n\t\t\t\t<xsl:with-param name=\"numberList\" select=\"$countList\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:value-of select=\"$hasInherited\"/>\n\t</xsl:template>\n\t<xsl:template name=\"hasInheritedEffects\">\n\t\t<xsl:variable name=\"countList\">\n\t\t\t<xsl:call-template name=\"inheritEffectCount\">\n\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"./apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"hasInherited\">\n\t\t\t<xsl:call-template name=\"convertNumberListIntoBoolean\">\n\t\t\t\t<xsl:with-param name=\"numberList\" select=\"$countList\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:value-of select=\"$hasInherited\"/>\n\t</xsl:template>\n\t<xsl:template name=\"hasIncludeExamples\">\n\t\t<xsl:param name=\"showIncludeExamples\" select=\"$showIncludeExamples\"/>\n\t\t<xsl:if test=\"$showIncludeExamples = 'true'\">\n\t\t\t<xsl:value-of select=\"count(./*[example/codeblock])\"/>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getPageLinks\">\n\t\t<xsl:param name=\"copyNum\" select=\"'1'\"/>\n\t\t<xsl:param name=\"title\" select=\"''\"/>\n\t\t<xsl:variable name=\"hasInnerClasses\">\n\t\t\t<xsl:call-template name=\"hasInnerClasses\"/>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"hasConstants\">\n\t\t\t<xsl:call-template name=\"hasConstants\"/>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"hasFields\">\n\t\t\t<xsl:call-template name=\"hasFields\"/>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"hasConstructor\">\n\t\t\t<xsl:call-template name=\"hasConstructor\"/>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"hasMethods\">\n\t\t\t<xsl:call-template name=\"hasMethods\"/>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"hasStyles\">\n\t\t\t<xsl:call-template name=\"hasStyles\"/>\n\t\t</xsl:variable>\n\t\t    <xsl:variable name=\"hasSkinPart\">\n\t\t      <xsl:call-template name=\"hasSkinPart\"/>\n\t\t    </xsl:variable>\n\t\t    <xsl:variable name=\"hasSkinState\">\n\t\t      <xsl:call-template name=\"hasSkinState\"/>\n\t\t    </xsl:variable>\t\t\n\t\t<xsl:variable name=\"hasEffects\">\n\t\t\t<xsl:call-template name=\"hasEffects\"/>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"hasEvents\">\n\t\t\t<xsl:call-template name=\"hasEvents\"/>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"hasInheritedConstants\">\n\t\t\t<xsl:call-template name=\"hasInheritedConstants\"/>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"hasInheritedFields\">\n\t\t\t<xsl:call-template name=\"hasInheritedFields\"/>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"hasInheritedMethods\">\n\t\t\t<xsl:call-template name=\"hasInheritedMethods\"/>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"hasInheritedStyles\">\n\t\t\t<xsl:call-template name=\"hasInheritedStyles\"/>\n\t\t</xsl:variable>\n\t\t    <xsl:variable name=\"hasInheritedSkinPart\">\n\t\t      <xsl:call-template name=\"hasInheritedSkinPart\"/>\n\t\t    </xsl:variable>\n\t\t    <xsl:variable name=\"hasInheritedSkinState\">\n\t\t      <xsl:call-template name=\"hasInheritedSkinState\"/>\n\t\t    </xsl:variable>\t\t\n\t\t<xsl:variable name=\"hasInheritedEffects\">\n\t\t\t<xsl:call-template name=\"hasInheritedEffects\"/>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"hasInheritedEvents\">\n\t\t\t<xsl:call-template name=\"hasInheritedEvents\"/>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"hasIncludeExamples\">\n\t\t\t<xsl:call-template name=\"hasIncludeExamples\"/>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"isTopLevel\">\n\t\t\t<xsl:call-template name=\"isTopLevel\">\n\t\t\t\t<xsl:with-param name=\"packageName\" select=\"../apiName\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:call-template name=\"getLinks2\">\n\t\t\t<xsl:with-param name=\"subTitle\" select=\"$title\"/>\n\t\t\t<xsl:with-param name=\"packageName\" select=\"../apiName\"/>\n\t\t\t<xsl:with-param name=\"fileName\" select=\"./apiName\"/>\n\t\t\t<xsl:with-param name=\"fileName2\">\n\t\t\t\t<xsl:if test=\"string-length(../apiName) and $isTopLevel='false'\">\n\t\t\t\t\t<xsl:value-of select=\"concat(translate(../apiName,'.','/'),'/class-list.html')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(string-length(../apiName))\">\n\t\t\t\t\t<xsl:value-of select=\"'class-list.html'\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:with-param>\n\t\t\t<xsl:with-param name=\"showInnerClasses\" select=\"boolean(number($hasInnerClasses))\"/>\n\t\t\t<xsl:with-param name=\"showConstants\">\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t<xsl:value-of select=\"boolean(number($hasConstants)) or ($hasInheritedConstants='true')\"/>\n\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t</xsl:choose>\n\t\t\t</xsl:with-param>\n\t\t\t<xsl:with-param name=\"showProperties\">\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t<xsl:value-of select=\"boolean(number($hasFields)) or ($hasInheritedFields='true')\"/>\n\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t</xsl:choose>\n\t\t\t</xsl:with-param>\n\t\t\t<xsl:with-param name=\"showConstructors\" select=\"false()\" />\n\t\t\t<xsl:with-param name=\"showMethods\">\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t<xsl:value-of select=\"boolean(number($hasMethods)) or boolean(number($hasConstructor)) or ($hasInheritedMethods='true')\"/>\n\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t</xsl:choose>\n\t\t\t</xsl:with-param>\n\t\t\t<xsl:with-param name=\"showStyles\">\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t<xsl:value-of select=\"boolean(number($hasStyles)) or ($hasInheritedStyles='true')\"/>\n\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t</xsl:choose>\n\t\t\t</xsl:with-param>\n\t\t      <xsl:with-param name=\"showSkinPart\">\n\t\t\t<xsl:choose>\n\t\t\t  <xsl:when test=\"$prog_language_name='javascript'\">\n\t\t\t    <xsl:value-of select=\"false()\"/>\n\t\t\t  </xsl:when>\n\t\t\t  <xsl:otherwise>\n\t\t\t    <xsl:value-of select=\"boolean(number($hasSkinPart)) or ($hasInheritedSkinPart='true')\"/>\n\t\t\t  </xsl:otherwise>\n\t\t\t</xsl:choose>\n\t\t      </xsl:with-param>\n\t\t      <xsl:with-param name=\"showSkinState\">\n\t\t\t<xsl:choose>\n\t\t\t  <xsl:when test=\"$prog_language_name='javascript'\">\n\t\t\t    <xsl:value-of select=\"false()\"/>\n\t\t\t  </xsl:when>\n\t\t\t  <xsl:otherwise>\n\t\t\t    <xsl:value-of select=\"boolean(number($hasSkinState)) or ($hasInheritedSkinState='true')\"/>\n\t\t\t  </xsl:otherwise>\n\t\t\t</xsl:choose>\n\t\t      </xsl:with-param>\t\t\t\n\t\t\t<xsl:with-param name=\"showEffects\">\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t<xsl:value-of select=\"boolean(number($hasEffects)) or ($hasInheritedEffects='true')\"/>\n\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t</xsl:choose>\n\t\t\t</xsl:with-param>\n\t\t\t<xsl:with-param name=\"showEvents\">\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t<xsl:value-of select=\"boolean(number($hasEvents)) or ($hasInheritedEvents='true')\"/>\n\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t</xsl:choose>\n\t\t\t</xsl:with-param>\n\t\t\t<xsl:with-param name=\"showIncludeExamples\">\n\t\t\t\t<xsl:choose>\n\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t<xsl:value-of select=\"boolean(number($hasIncludeExamples))\"/>\n\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t</xsl:choose>\n\t\t\t</xsl:with-param>\n\t\t\t<xsl:with-param name=\"copyNum\" select=\"$copyNum\"/>\n\t\t</xsl:call-template>\n\t</xsl:template>\n\t<xsl:template name=\"processReturnType\">\n\t\t<xsl:param name=\"baseRef\" select=\"''\"/>\n\t\t<xsl:param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t<xsl:choose>\n\t\t\t<xsl:when\n\t\t\t\ttest=\"./apiOperationDetail/apiOperationDef/apiReturn/apiType/@value='' or ./apiOperationDetail/apiOperationDef/apiReturn/apiType/@value='*' or ./apiOperationDetail/apiOperationDef/apiReturn/apiType/@value='any'\">\n\t\t\t\t<xsl:call-template name=\"getSpecialTypeLink\">\n\t\t\t\t\t<xsl:with-param name=\"type\" select=\"'*'\"/>\n\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:when>\n\t\t\t<xsl:when test=\"./apiOperationDetail/apiOperationDef/apiReturn/apiType/@value='void'\">\n\t\t\t\t<xsl:call-template name=\"getSpecialTypeLink\">\n\t\t\t\t\t<xsl:with-param name=\"type\" select=\"'void'\"/>\n\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:when>\n\t\t\t<xsl:when test=\"./apiOperationDetail/apiOperationDef/apiReturn/apiOperationClassifier='Void' and $config/options/@docversion='2'\">\n\t\t\t\t<xsl:value-of select=\"./apiOperationDetail/apiOperationDef/apiReturn/apiOperationClassifier\"/>\n\t\t\t</xsl:when>\n\t\t\t<xsl:when test=\"./apiOperationDetail/apiOperationDef/apiReturn/apiOperationClassifier\">\n\t\t\t\t<xsl:variable name=\"destination\" select=\"./apiOperationDetail/apiOperationDef/apiReturn/apiOperationClassifier\"/>\n\t\t\t\t<xsl:variable name=\"h1\" select=\"substring-after($destination,':')\"/>\n\t\t\t\t<xsl:variable name=\"h2\" select=\"substring-before($destination,':')\"/>\n\t\t\t\t<xsl:variable name=\"file\" select=\"concat($baseRef,translate($h2,'.','/'),'/',$h1,'.html')\"/>\n\t\t\t\t<xsl:variable name=\"gfile\" select=\"concat($baseRef,$destination,'.html')\"/>\n\t\t\t\t<xsl:variable name=\"hyperLink\">\n\t\t\t\t\t<xsl:if test=\"contains($destination,'.')\">\n\t\t\t\t\t\t<xsl:if test=\"$prog_language_name!='javascript'\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"not(contains($destination,'.'))\">\n\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$gfile\"/>\n\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<xsl:if test=\"$hyperLink = ''\">\n\t\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"./apiOperationDetail/apiOperationDef/apiReturn/apiOperationClassifier\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$hyperLink != ''\">\n\t\t\t\t\t<a href=\"{$hyperLink}\">\n\t\t\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"./apiOperationDetail/apiOperationDef/apiReturn/apiOperationClassifier\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</a>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:when>\n\t\t\t<xsl:when test=\"not(./apiOperationDetail/apiOperationDef/apiReturn/apiOperationClassifier) and ./apiOperationDetail/apiOperationDef/apiReturn/apiType\">\n\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"./apiOperationDetail/apiOperationDef/apiReturn/apiType/@value\"/>\n\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:call-template name=\"getSimpleClassName\">\n\t\t\t\t\t<xsl:with-param name=\"fullClassName\" select=\"./apiOperationDetail/apiOperationDef/apiReturn/apiOperationClassifier\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n</xsl:stylesheet>\n"
  },
  {
    "path": "documentation/api-reference/templates/class-list.xslt",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n\n\tADOBE SYSTEMS INCORPORATED\n\tCopyright 2008 Adobe Systems Incorporated\n\tAll Rights Reserved.\n\n\tNOTICE: Adobe permits you to use, modify, and distribute this file\n\tin accordance with the terms of the license agreement accompanying it.\n\n-->\n<xsl:stylesheet version=\"2.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:saxon=\"http://sf.net/saxon\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:ifn=\"urn:internal:functions\"\n\texclude-result-prefixes=\"saxon xs ifn\">\n\t<xsl:import href=\"asdoc-util.xslt\"/>\n\t<xsl:output encoding=\"UTF-8\" method=\"html\" omit-xml-declaration=\"yes\" use-character-maps=\"disable\"/>\n\t<xsl:param name=\"outputPath\" select=\"''\"/>\n\t<xsl:param name=\"ditaFileDir\" select=\"''\"/>\n\t<xsl:param name=\"packages_map_name\" select=\"'packagemap.xml'\"/>\n\t<xsl:variable name=\"thinsp\">\n\t\t<xsl:text>&#x2009;</xsl:text>\n\t</xsl:variable>\n\t<xsl:template match=\"/\">\n\t\t<xsl:for-each select=\"apiMap//apiItemRef\">\n\t\t\t<xsl:sort select=\"@href\" order=\"ascending\"/>\n\t\t\t<xsl:variable name=\"ditaFileName\">\n\t\t\t\t<xsl:value-of select=\"concat($ditaFileDir,@href)\"/>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:for-each select=\"document($ditaFileName)/apiPackage\">\n\t\t\t\t<xsl:variable name=\"name\" select=\"./apiName\"/>\n\t\t\t\t<xsl:variable name=\"title\" select=\"concat($name,concat(' - ',$title-base))\"/>\n\t\t\t\t<xsl:variable name=\"isTopLevel\">\n\t\t\t\t\t<xsl:call-template name=\"isTopLevel\">\n\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$name\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<xsl:variable name=\"classListFile\">\n\t\t\t\t\t<xsl:value-of select=\"$outputPath\"/>\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"$isTopLevel='true'\">class-list.html</xsl:when>\n\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t<xsl:value-of select=\"translate($name,'.','/')\"/>/class-list.html</xsl:otherwise>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<xsl:result-document href=\"{$classListFile}\">\n\t\t\t\t\t<xsl:copy-of select=\"$noLiveDocs\"/>\n\t\t\t\t\t<xsl:copy-of select=\"$docType\"/>\n\t\t\t\t\t<xsl:element name=\"html\">\n\t\t\t\t\t\t<head>\n\t\t\t\t\t\t\t<title>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$title\"/>\n\t\t\t\t\t\t\t</title>\n\t\t\t\t\t\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n\t\t\t\t\t\t\t<base target=\"classFrame\"/>\n\t\t\t\t\t\t\t<xsl:call-template name=\"getStyleLink\">\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"link\" select=\"/asdoc/link\"/>\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$name\"/>\n\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t</head>\n\t\t\t\t\t\t<body class=\"classFrameContent\">\n\t\t\t\t\t\t\t<h3>\n\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t<xsl:when test=\"$isTopLevel='true'\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"package-detail.html\" target=\"classFrame\" style=\"color:black\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'TopLevel']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t<a href=\"package-detail.html\" target=\"classFrame\" style=\"color:black\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'PackagePackage']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat(' ',$name)\"/>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\">\n\t\t\t\t\t\t\t\t<xsl:for-each select=\"apiValue[not(./apiValueDetail/apiValueDef/apiProperty)]\">\n\t\t\t\t\t\t\t\t\t<xsl:sort select=\"apiName\" order=\"ascending\" lang=\"en-US\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"name\" select=\"apiName\"/>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"position()=1\">\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"package.html#constantSummary\" style=\"color:black\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<b>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Constants']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</b>\n\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"package.html#{$name}\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"position()=last()\">\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td width=\"10px\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&amp;nbsp;</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t<xsl:for-each select=\"apiValue[./apiValueDetail/apiValueDef/apiProperty]\">\n\t\t\t\t\t\t\t\t\t<xsl:sort select=\"apiName\" order=\"ascending\" lang=\"en-US\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"name\" select=\"apiName\"/>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"position()=1\">\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"package.html#propertySummary\" style=\"color:black\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<b>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Properties']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</b>\n\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"package.html#{$name}\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"position()=last()\">\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td width=\"10px\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&amp;nbsp;</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t<xsl:for-each select=\"apiOperation\">\n\t\t\t\t\t\t\t\t\t<xsl:sort select=\"apiName\" order=\"ascending\" lang=\"en-US\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"name\" select=\"apiName\"/>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"position()=1\">\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"package.html#methodSummary\" style=\"color:black\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<b>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Functions']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</b>\n\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"package.html#{$name}()\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>()</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"position()=last()\">\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td width=\"10px\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&amp;nbsp;</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t<xsl:for-each select=\".//apiClassifier[apiClassifierDetail/apiClassifierDef/apiInterface]\">\n\t\t\t\t\t\t\t\t\t<xsl:sort select=\"apiName\" order=\"ascending\" lang=\"en-US\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"name\" select=\"./apiName\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"packageName\" select=\"ancestor::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"baseRef\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getBaseRef\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$packageName\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"position()=1\">\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"package-detail.html#interfaceSummary\" style=\"color:black\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<b>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Interfaces']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</b>\n\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$name}.html\">\n\t\t\t\t\t\t\t\t\t\t\t\t<i>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</i>\n\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"prolog/asMetadata/apiVersion/apiPlatform[@name='AIR'] and not (prolog/asMetadata/apiVersion/apiPlatform[@name='Flash'])\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"insertAIRIcon\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"position()=last()\">\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td width=\"10px\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&amp;nbsp;</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t<xsl:for-each select=\"./apiClassifier[not(./apiClassifierDetail/apiClassifierDef/apiInterface)]\">\n\t\t\t\t\t\t\t\t\t<xsl:sort select=\"apiName\" order=\"ascending\" lang=\"en-US\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"name\" select=\"apiName\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"packageName\" select=\"ancestor::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"baseRef\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getBaseRef\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$packageName\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"position()=1\">\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"package-detail.html#classSummary\" style=\"color:black\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<b>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Classes']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</b>\n\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$name}.html\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"prolog/asMetadata/apiVersion/apiPlatform[@name='AIR'] and not (prolog/asMetadata/apiVersion/apiPlatform[@name='Flash'])\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"insertAIRIcon\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</body>\n\t\t\t\t\t</xsl:element>\n\t\t\t\t\t<xsl:copy-of select=\"$copyrightComment\"/>\n\t\t\t\t</xsl:result-document>\n\t\t\t</xsl:for-each>\n\t\t</xsl:for-each>\n\t</xsl:template>\n</xsl:stylesheet>\n"
  },
  {
    "path": "documentation/api-reference/templates/class-parts.xslt",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n\n\tADOBE SYSTEMS INCORPORATED\n\tCopyright 2008 Adobe Systems Incorporated\n\tAll Rights Reserved.\n\n\tNOTICE: Adobe permits you to use, modify, and distribute this file\n\tin accordance with the terms of the license agreement accompanying it.\n\n-->\n<xsl:stylesheet version=\"2.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:saxon=\"http://sf.net/saxon\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:ifn=\"urn:internal:functions\" xmlns:fn=\"http://www.w3.org/2005/xpath-functions\"\n\texclude-result-prefixes=\"saxon xs ifn\">\n\t<xsl:import href=\"asdoc-util.xslt\"/>\n\t<xsl:param name=\"ditaFileDir\" select=\"''\"/>\n\t<xsl:param name=\"outPath\" select=\"''\"/>\n\t<xsl:param name=\"dita.package\" select=\"'packages.dita'\"/>\n\t<xsl:param name=\"prog_language_name\" select=\"''\"/>\n\t<xsl:template name=\"getAncestorProperty\">\n\t\t<xsl:param name=\"isConst\" select=\"'false'\"/>\n\t\t<xsl:param name=\"accessLevel\" select=\"'public'\"/>\n\t\t<xsl:param name=\"baseClass\"/>\n\t\t<xsl:param name=\"propertyList\"/>\n\t\t<xsl:param name=\"processParentClass\" select=\"true()\"/>\n\t\t<xsl:variable name=\"className\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-after($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"$baseClass\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"xslDocPath\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-before($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"'__Global__'\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:if test=\"$isConst='true'\">\n\t\t\t<xsl:for-each select=\"$field_map[@id=$xslDocPath]//apiClassifier[apiName=$className]/apiValue[not(apiValueDetail/apiValueDef/apiProperty) and apiValueDetail/apiValueDef/apiAccess/@value =$accessLevel]\">\n\t\t\t\t<xsl:if test=\"not(contains($propertyList,concat(' ',apiName,' ')))\">\n\t\t\t\t\t<xsl:copy-of select=\".\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:for-each>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"$isConst='false'\">\n\t\t\t<xsl:for-each select=\"$field_map[@id=$xslDocPath]//apiClassifier[apiName=$className]/apiValue[apiValueDetail/apiValueDef/apiProperty and apiValueDetail/apiValueDef/apiAccess/@value =$accessLevel or apiValueDetail/apiValueDef/apiAccess/@value=$config/namespaces/namespace[@summaryDisplay=$accessLevel]/.]\">\n\t\t\t\t<xsl:if test=\"not(contains($propertyList,concat(' ',apiName,' ')))\">\n\t\t\t\t\t<xsl:copy-of select=\".\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:for-each>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"$baseClass !='Object' and $processParentClass = true()\">\n\t\t\t<!-- do not make a recursive call when processing interfaces -->\n\t\t\t<xsl:variable name=\"newPropertyList\">\n\t\t\t\t<xsl:if test=\"$isConst='true'\">\n\t\t\t\t\t<xsl:for-each\n\t\t\t\t\t\tselect=\"$field_map[@id=$xslDocPath]//apiClassifier[apiName=$className]/apiValue[not(./apiValueDetail/apiValueDef/apiProperty) and (./apiValueDetail/apiValueDef/apiAccess/@value=$accessLevel or ./apiValueDetail/apiValueDef/apiAccess/@value=$config/namespaces/namespace[@summaryDisplay=$accessLevel]/.)]\">\n\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t</xsl:for-each>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$isConst='false'\">\n\t\t\t\t\t<xsl:for-each\n\t\t\t\t\t\tselect=\"$field_map[@id=$xslDocPath]//apiClassifier[apiName=$className]/apiValue[./apiValueDetail/apiValueDef/apiProperty and (./apiValueDetail/apiValueDef/apiAccess/@value=$accessLevel or ./apiValueDetail/apiValueDef/apiAccess/@value=$config/namespaces/namespace[@summaryDisplay=$accessLevel]/.)]\">\n\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t</xsl:for-each>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:call-template name=\"getAncestorProperty\">\n\t\t\t\t<xsl:with-param name=\"isConst\" select=\"$isConst\"/>\n\t\t\t\t<xsl:with-param name=\"accessLevel\" select=\"$accessLevel\"/>\n\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"$field_map[@id=$xslDocPath]/apiClassifier[@id=$baseClass or apiName=$baseClass]/apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t\t<xsl:with-param name=\"propertyList\" select=\"concat($propertyList,$newPropertyList)\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"inheritPropertyCount\">\n\t\t<xsl:param name=\"isConst\" select=\"'false'\"/>\n\t\t<xsl:param name=\"accessLevel\" select=\"'public'\"/>\n\t\t<xsl:param name=\"baseClass\"/>\n\t\t<xsl:variable name=\"className\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-after($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"$baseClass\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"xslDocPath\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-before($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"'__Global__'\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"countAttribute\">\n\t\t\t<xsl:if test=\"$isConst='true'\">\n\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t<xsl:value-of\n\t\t\t\t\tselect=\"count($field_map[@id=$xslDocPath]//apiClassifier[apiName=$className]/apiValue[not(apiValueDetail/apiValueDef/apiProperty) and apiValueDetail/apiValueDef/apiAccess/@value =$accessLevel])\"/>\n\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"$isConst='false'\">\n\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t<xsl:value-of select=\"count($field_map[@id=$xslDocPath]//apiClassifier[apiName=$className]/apiValue[apiValueDetail/apiValueDef/apiProperty and apiValueDetail/apiValueDef/apiAccess/@value =$accessLevel])\"/>\n\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:value-of select=\"$countAttribute\"/>\n\t\t<xsl:if test=\"$baseClass !='Object'\">\n\t\t\t<xsl:variable name=\"xslDocPath\">\n\t\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t\t<xsl:value-of select=\"substring-before($baseClass,':')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t\t<xsl:value-of select=\"'__Global__'\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:call-template name=\"inheritPropertyCount\">\n\t\t\t\t<xsl:with-param name=\"isConst\" select=\"$isConst\"/>\n\t\t\t\t<xsl:with-param name=\"accessLevel\" select=\"$accessLevel\"/>\n\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"$field_map[@id=$xslDocPath]/apiClassifier[@id=$baseClass or apiName=$baseClass]/apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getMethodAncestors\">\n\t\t<xsl:param name=\"baseRef\"/>\n\t\t<xsl:param name=\"accessLevel\" select=\"'public'\"/>\n\t\t<xsl:param name=\"baseClass\"/>\n\t\t<xsl:param name=\"methodList\" select=\"''\"/>\n\t\t<xsl:param name=\"processParentClass\" select=\"true()\"/>\n\t\t<xsl:param name=\"classDeprecated\"/>\n\t\t<xsl:variable name=\"className\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-after($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"$baseClass\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"xslDocPath\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-before($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"'__Global__'\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:for-each\n\t\t\tselect=\"$method_map[@id=$xslDocPath]//apiClassifier[apiName=$className]/apiOperation[apiOperationDetail/apiOperationDef/apiAccess/@value =$accessLevel or ($accessLevel='public' and apiOperationDetail/apiOperationDef/apiAccess/@value='AS3')]\">\n\t\t\t<xsl:if test=\"not(contains($methodList,concat(' ',apiName,' ')))\">\n\t\t\t\t<xsl:copy-of select=\".\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:for-each>\n\t\t<xsl:if test=\"$baseClass !='Object' and $processParentClass = true()\">\n\t\t\t<xsl:variable name=\"newMethodList\">\n\t\t\t\t<xsl:for-each\n\t\t\t\t\tselect=\"$method_map[@id=$xslDocPath]//apiClassifier[apiName=$className]/apiOperation[apiOperationDetail/apiOperationDef/apiAccess/@value =$accessLevel or ($accessLevel='public' and apiOperationDetail/apiOperationDef/apiAccess/@value='AS3')]\">\n\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"xslDocPath\">\n\t\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t\t<xsl:value-of select=\"substring-before($baseClass,':')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t\t<xsl:value-of select=\"'__Global__'\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:call-template name=\"getMethodAncestors\">\n\t\t\t\t<xsl:with-param name=\"accessLevel\" select=\"$accessLevel\"/>\n\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"$method_map[@id=$xslDocPath]/apiClassifier[@id=$baseClass or apiName=$baseClass]/apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t\t<xsl:with-param name=\"methodList\" select=\"concat($methodList,' ', $newMethodList)\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"inheritMethodCount\">\n\t\t<xsl:param name=\"accessLevel\" select=\"'public'\"/>\n\t\t<xsl:param name=\"baseClass\"/>\n\t\t<xsl:param name=\"methodList\" select=\"''\"/>\n\t\t<xsl:variable name=\"className\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-after($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"$baseClass\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"xslDocPath\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-before($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"'__Global__'\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"countAttribute\">\n\t\t\t<xsl:text> </xsl:text>\n\t\t\t<xsl:value-of\n\t\t\t\tselect=\"count($method_map[@id=$xslDocPath]//apiClassifier[apiName=$className and apiOperation/apiOperationDetail/apiOperationDef/apiAccess[@value=$accessLevel or apiConstructor/apiConstructorDetail/apiConstructorDef/apiAccess/@value =$accessLevel]])\"/>\n\t\t\t<xsl:text> </xsl:text>\n\t\t</xsl:variable>\n\t\t<xsl:value-of select=\"$countAttribute\"/>\n\t\t<xsl:if test=\"$baseClass !='Object'\">\n\t\t\t<xsl:variable name=\"newMethodList\">\n\t\t\t\t<xsl:for-each\n\t\t\t\t\tselect=\"$method_map[@id=$xslDocPath]//apiClassifier[apiName=$className]/apiOperation[apiOperationDetail/apiOperationDef/apiAccess/@value =$accessLevel or ($accessLevel='public' and apiOperationDetail/apiOperationDef/apiAccess/@value='AS3')]\">\n\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"xslDocPath\">\n\t\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t\t<xsl:value-of select=\"substring-before($baseClass,':')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t\t<xsl:value-of select=\"'__Global__'\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:call-template name=\"inheritMethodCount\">\n\t\t\t\t<xsl:with-param name=\"accessLevel\" select=\"$accessLevel\"/>\n\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"$method_map[@id=$xslDocPath]/apiClassifier[@id=$baseClass or apiName=$baseClass]/apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t\t<xsl:with-param name=\"methodList\" select=\"concat($methodList,' ', $newMethodList)\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"doesValueExistsInList\">\n\t\t<xsl:param name=\"valueToFind\" select=\"''\"/>\n\t\t<xsl:param name=\"givenList\" select=\"''\"/>\n\t\t<!--If the method or processMethod List is blank return false indicating the method has not been processed-->\n\t\t<xsl:if test=\"string-length($valueToFind) = 0 or string-length(normalize-space($givenList)) = 0 \">\n\t\t\t<xsl:value-of select=\"'false'\"/>\n\t\t</xsl:if>\n\t\t<xsl:variable name=\"valueSet\" select=\"tokenize($givenList,' ')\"/>\n\t\t<xsl:for-each select=\"$valueSet\">\n\t\t\t<xsl:if test=\". = $valueToFind\">\n\t\t\t\t<xsl:value-of select=\"'true'\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:for-each>\n\t</xsl:template>\n\t<xsl:template name=\"inheritEventCount\">\n\t\t<xsl:param name=\"baseClass\"/>\n\t\t<xsl:variable name=\"className\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-after($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"$baseClass\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"xslDocPath\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-before($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"'__Global__'\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"countAttribute\">\n\t\t\t<xsl:text> </xsl:text>\n\t\t\t<xsl:value-of select=\"count($event_map[@id=$xslDocPath]/apiClassifier[apiName=$className]/adobeApiEvent[not(adobeApiEventDetail/adobeApiEventDef/apiDefinedEvent)])\"/>\n\t\t\t<xsl:text> </xsl:text>\n\t\t</xsl:variable>\n\t\t<xsl:value-of select=\"$countAttribute\"/>\n\t\t<xsl:if test=\"$baseClass !='Object'\">\n\t\t\t<xsl:variable name=\"xslDocPath\">\n\t\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t\t<xsl:value-of select=\"substring-before($baseClass,':')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t\t<xsl:value-of select=\"'__Global__'\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:call-template name=\"inheritEventCount\">\n\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"$event_map[@id=$xslDocPath]/apiClassifier[@id=$baseClass or apiName=$className]/apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getInheritedEvent\">\n\t\t<xsl:param name=\"baseClass\"/>\n\t\t<xsl:param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t<xsl:param name=\"eventsList\"/>\n\t\t<xsl:param name=\"processParentClass\" select=\"true()\"/>\n\t\t<xsl:variable name=\"className\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-after($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"$baseClass\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"xslDocPath\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-before($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"'__Global__'\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:for-each select=\"$event_map[@id=$xslDocPath]/apiClassifier[apiName=$className]/adobeApiEvent[not(adobeApiEventDetail/adobeApiEventDef/apiDefinedEvent)]\">\n\t\t\t<xsl:if test=\"not(contains($eventsList,concat(' ',apiName,' ')))\">\n\t\t\t\t<xsl:copy-of select=\".\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:for-each>\n\t\t<xsl:if test=\"$baseClass !='Object' and $processParentClass = true()\">\n\t\t\t<xsl:variable name=\"newEventsList\">\n\t\t\t\t<xsl:for-each select=\"$event_map[@id=$xslDocPath]/apiClassifier[apiName=$className]/adobeApiEvent[not(adobeApiEventDetail/adobeApiEventDef/apiDefinedEvent)]\">\n\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:call-template name=\"getInheritedEvent\">\n\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"$event_map[@id=$xslDocPath]/apiClassifier[@id=$baseClass or apiName=$className]/apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t\t<xsl:with-param name=\"eventsList\" select=\"concat($eventsList,' ', $newEventsList)\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"inheritStyleCount\">\n\t\t<xsl:param name=\"baseClass\"/>\n\t\t<xsl:variable name=\"className\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-after($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"$baseClass\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"xslDocPath\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-before($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"'__Global__'\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"countAttribute\">\n\t\t\t<xsl:text> </xsl:text>\n\t\t\t<xsl:value-of select=\"count($style_map[@id=$xslDocPath]//apiClassifier[apiName=$className]/prolog/asMetadata[styles/style])\"/>\n\t\t\t<xsl:text> </xsl:text>\n\t\t</xsl:variable>\n\t\t<xsl:value-of select=\"$countAttribute\"/>\n\t\t<xsl:if test=\"$baseClass !='Object'\">\n\t\t\t<xsl:call-template name=\"inheritStyleCount\">\n\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"$style_map[@id=$xslDocPath]/apiClassifier[@id=$baseClass or apiName=$baseClass]/apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:if>\n\t</xsl:template>\n\t\n\t<xsl:template name=\"inheritSkinStateCount\">\n\t\t<xsl:param name=\"baseClass\"/>\n\t\t<xsl:variable name=\"className\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-after($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"$baseClass\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"xslDocPath\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-before($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"'__Global__'\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"countAttribute\">\n\t\t\t<xsl:text> </xsl:text>\n\t\t\t<xsl:value-of select=\"count($classHeader_map[@id=$xslDocPath]//apiClassifier[apiName=$className]/prolog/asMetadata[skinStates/SkinState])\"/>\n\t\t\t<xsl:text> </xsl:text>\n\t\t</xsl:variable>\n\t\t<xsl:value-of select=\"$countAttribute\"/>\n\t\t<xsl:if test=\"$baseClass !='Object'\">\n\t\t\t<xsl:call-template name=\"inheritSkinStateCount\">\n\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"$classHeader_map[@id=$xslDocPath]/apiClassifier[@id=$baseClass or apiName=$baseClass]/apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"inheritSkinPartCount\">\n\t\t<xsl:param name=\"baseClass\"/>\n\t\t<xsl:variable name=\"className\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-after($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"$baseClass\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"xslDocPath\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-before($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"'__Global__'\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"countAttribute\">\n\t\t\t<xsl:text> </xsl:text>\n\t\t\t<xsl:value-of select=\"count($classHeader_map[@id=$xslDocPath]//apiClassifier[apiName=$className]/prolog/asMetadata[skinParts/SkinPart])\"/>\n\t\t\t<xsl:text> </xsl:text>\n\t\t</xsl:variable>\n\t\t<xsl:value-of select=\"$countAttribute\"/>\n\t\t<xsl:if test=\"$baseClass !='Object'\">\n\t\t\t<xsl:call-template name=\"inheritSkinPartCount\">\n\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"$classHeader_map[@id=$xslDocPath]/apiClassifier[@id=$baseClass or apiName=$baseClass]/apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:if>\n\t</xsl:template>\t\n\t<xsl:template name=\"getInheritedStyle\">\n\t\t<xsl:param name=\"baseClass\"/>\n\t\t<xsl:param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t<xsl:param name=\"stylesList\"/>\n\t\t<xsl:param name=\"processParentClass\" select=\"true()\"/>\n\t\t<xsl:variable name=\"className\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-after($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"$baseClass\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"xslDocPath\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-before($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"'__Global__'\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:for-each select=\"$style_map[@id=$xslDocPath]//apiClassifier[apiName=$className]/prolog/asMetadata/styles/style\">\n\t\t\t<xsl:if test=\"not(contains($stylesList,concat(' ',@name,' ')))\">\n\t\t\t\t<xsl:copy-of select=\".\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:for-each>\n\t\t<xsl:if test=\"$baseClass !='Object' and $processParentClass=true()\">\n\t\t\t<xsl:variable name=\"newStylesList\">\n\t\t\t\t<xsl:for-each select=\"$style_map[@id=$xslDocPath]//apiClassifier[apiName=$className]/prolog/asMetadata/styles/style\">\n\t\t\t\t\t<xsl:value-of select=\"concat(' ',@name,' ')\"/>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:call-template name=\"getInheritedStyle\">\n\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"$style_map[@id=$xslDocPath]/apiClassifier[@id=$baseClass or apiName=$baseClass]/apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t\t<xsl:with-param name=\"stylesList\" select=\"concat($stylesList,' ',$newStylesList)\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getInheritedSkinState\">\n\t\t<xsl:param name=\"baseClass\"/>\n\t\t<xsl:param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t<xsl:param name=\"SkinStateList\"/>\n\t\t<xsl:param name=\"processParentClass\" select=\"true()\"/>\n\t\t<xsl:variable name=\"className\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-after($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"$baseClass\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"xslDocPath\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-before($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"'__Global__'\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:for-each select=\"$classHeader_map[@id=$xslDocPath]//apiClassifier[apiName=$className]/prolog/asMetadata/skinStates/SkinState\">\n\t\t\t<xsl:if test=\"not(contains($SkinStateList,concat(' ',@name,' ')))\">\n\t\t\t\t<xsl:copy-of select=\".\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:for-each>\n\t\t<xsl:if test=\"$baseClass !='Object' and $processParentClass=true()\">\n\t\t\t<xsl:variable name=\"newSkinStateList\">\n\t\t\t\t<xsl:for-each select=\"$classHeader_map[@id=$xslDocPath]//apiClassifier[apiName=$className]/prolog/asMetadata/skinStates/SkinState\">\n\t\t\t\t\t<xsl:value-of select=\"concat(' ',@name,' ')\"/>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:call-template name=\"getInheritedSkinState\">\n\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"$classHeader_map[@id=$xslDocPath]/apiClassifier[@id=$baseClass or apiName=$baseClass]/apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t\t<xsl:with-param name=\"SkinStateList\" select=\"concat($SkinStateList,' ',$newSkinStateList)\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getInheritedSkinPart\">\n\t\t<xsl:param name=\"baseClass\"/>\n\t\t<xsl:param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t<xsl:param name=\"SkinPartList\"/>\n\t\t<xsl:param name=\"processParentClass\" select=\"true()\"/>\n\t\t<xsl:variable name=\"className\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-after($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"$baseClass\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"xslDocPath\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-before($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"'__Global__'\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:for-each select=\"$classHeader_map[@id=$xslDocPath]//apiClassifier[apiName=$className]/prolog/asMetadata/skinParts/SkinPart\">\n\t\t\t<xsl:if test=\"not(contains($SkinPartList,concat(' ',@name,' ')))\">\n\t\t\t\t<xsl:copy-of select=\".\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:for-each>\n\t\t<xsl:if test=\"$baseClass !='Object' and $processParentClass=true()\">\n\t\t\t<xsl:variable name=\"newSkinPartList\">\n\t\t\t\t<xsl:for-each select=\"$classHeader_map[@id=$xslDocPath]//apiClassifier[apiName=$className]/prolog/asMetadata/skinParts/SkinPart\">\n\t\t\t\t\t<xsl:value-of select=\"concat(' ',@name,' ')\"/>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:call-template name=\"getInheritedSkinPart\">\n\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"$classHeader_map[@id=$xslDocPath]/apiClassifier[@id=$baseClass or apiName=$baseClass]/apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t\t<xsl:with-param name=\"SkinPartList\" select=\"concat($SkinPartList,' ',$newSkinPartList)\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:if>\n\t</xsl:template>\t\n\t<xsl:template name=\"inheritEffectCount\">\n\t\t<xsl:param name=\"baseClass\"/>\n\t\t<xsl:variable name=\"className\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-after($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"$baseClass\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"xslDocPath\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-before($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"'__Global__'\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"countAttribute\">\n\t\t\t<xsl:text> </xsl:text>\n\t\t\t<xsl:value-of select=\"count($effect_map[@id=$xslDocPath]//apiClassifier[apiName=$className]/prolog/asMetadata[effects/effect])\"/>\n\t\t\t<xsl:text> </xsl:text>\n\t\t</xsl:variable>\n\t\t<xsl:value-of select=\"$countAttribute\"/>\n\t\t<xsl:if test=\"$baseClass !='Object'\">\n\t\t\t<xsl:variable name=\"xslDocPath\">\n\t\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t\t<xsl:value-of select=\"substring-before($baseClass,':')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t\t<xsl:value-of select=\"'__Global__'\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:call-template name=\"inheritEffectCount\">\n\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"$effect_map[@id=$xslDocPath]/apiClassifier[@id=$baseClass or apiName=$baseClass]/apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getInheritedEffect\">\n\t\t<xsl:param name=\"baseClass\"/>\n\t\t<xsl:param name=\"currentPackage\"/>\n\t\t<xsl:param name=\"effectsList\"/>\n\t\t<xsl:param name=\"processParentClass\" select=\"true()\"/>\n\t\t<xsl:variable name=\"className\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-after($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"$baseClass\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"xslDocPath\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-before($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"'__Global__'\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:for-each select=\"$effect_map[@id=$xslDocPath]//apiClassifier[apiName=$className]/prolog/asMetadata/effects/effect\">\n\t\t\t<xsl:if test=\"not(contains($effectsList,concat(' ',@name,' ')))\">\n\t\t\t\t<xsl:copy-of select=\".\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:for-each>\n\t\t<xsl:if test=\"$baseClass !='Object' and $processParentClass = true()\">\n\t\t\t<xsl:variable name=\"newEffectsList\">\n\t\t\t\t<xsl:for-each select=\"$effect_map[@id=$xslDocPath]/apiClassifier[apiName=$className]/asMetadata/effects/effect\">\n\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:call-template name=\"getInheritedEffect\">\n\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"$effect_map[@id=$xslDocPath]/apiClassifier[@id=$baseClass or apiName=$baseClass]/apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t\t<xsl:with-param name=\"effectsList\" select=\"concat($effectsList,' ',$newEffectsList )\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template match=\"DefaultProperty\">\n\t\t<p>\n\t\t\t<span class=\"classHeaderTableLabel\">\n\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'DefaultMXMLProperty']]/entry[2]/p\"/>\n\t\t\t</span>\n\t\t\t<code>\n\t\t\t\t<xsl:value-of select=\"@name\"/>\n\t\t\t</code>\n\t\t</p>\n\t</xsl:template>\n\t<xsl:template name=\"classHeader\">\n\t\t<xsl:param name=\"classNode\"/>\n\t\t<xsl:param name=\"classDeprecated\"/>\n\t\t<xsl:variable name=\"packageName\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t<xsl:variable name=\"baseRef\">\n\t\t\t<xsl:call-template name=\"getBaseRef\">\n\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$packageName\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"ID\" select=\"@id\"/>\n\t\t<xsl:variable name=\"isTopLevel\">\n\t\t\t<xsl:call-template name=\"isTopLevel\">\n\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$packageName\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:variable>\n\t\t<xsl:for-each select=\"$classNode\">\n\t\t\t<xsl:call-template name=\"getPageLinks\">\n\t\t\t\t<xsl:with-param name=\"title\">\n\t\t\t\t\t<xsl:if test=\"./apiClassifierDetail/apiClassifierDef/apiInterface\">\n\t\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"not(./apiClassifierDetail/apiClassifierDef/apiInterface)\">\n\t\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:with-param>\n\t\t\t</xsl:call-template>\n\t\t</xsl:for-each>\n\t\t<div class=\"MainContent\">\n\t\t\t<xsl:variable name=\"id\" select=\"@id\"/>\n\t\t\t<xsl:apply-templates mode=\"annotate\"\n\t\t\t\tselect=\"$config/annotate/item[@type='class' and ((@name=translate($id,':','.') and (not(string-length(@packageName)) or @packageName=$packageName)) or (not(string-length(@name)) and string-length(@packageName) and tokenize(@packageName,',')[starts-with($packageName,.)]))]\"/>\n\t\t\t<table class=\"classHeaderTable\" cellpadding=\"0\" cellspacing=\"0\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=\"classHeaderTableLabel\">\n\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'PackagePackage']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t<a href=\"package-detail.html\" onclick=\"javascript:loadClassListFrame('class-list.html')\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length(../apiName) &gt; 0 and not($isTopLevel='true')\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"../apiName\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='true'\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'TopLevel']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<xsl:if test=\"not(.//apiClassifierDef/apiInterface)\">\n\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t<td class=\"classHeaderTableLabel\">Class</td>\n\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\".//apiClassifierDef/apiInterface\">\n\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t<td class=\"classHeaderTableLabel\">Interface</td>\n\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<td class=\"classSignature\">\n\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"./apiClassifierDetail/apiClassifierDef/apiAccess/@value\"/>\n\t\t\t\t\t\t\t\t<xsl:if test=\"./apiClassifierDetail/apiClassifierDef/apiFinal\">\n\t\t\t\t\t\t\t\t\t<xsl:text> final </xsl:text>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"./apiClassifierDetail/apiClassifierDef/apiDynamic\">\n\t\t\t\t\t\t\t\t\t<xsl:text> dynamic </xsl:text>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t<xsl:if test=\"not(./apiClassifierDetail/apiClassifierDef/apiInterface)\">\n\t\t\t\t\t\t\t\t\t<xsl:text> class </xsl:text>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"./apiClassifierDetail/apiClassifierDef/apiInterface\">\n\t\t\t\t\t\t\t\t\t<xsl:text> interface </xsl:text>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t\t\t\t\t<xsl:if test=\"./apiClassifierDetail/apiClassifierDef/apiInterface and ./apiClassifierDetail/Inheritancelist/BaseInterface/Interface\">\n\t\t\t\t\t\t\t\t\t<xsl:text> extends </xsl:text>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:for-each select=\"./apiClassifierDetail/Inheritancelist/BaseInterface/Interface/@id\">\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"text\" select=\".\"/>\n\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$text\">\n\t\t\t\t\t\t\t\t\t\t<xsl:sort select=\"substring-after(text(),':')\" order=\"ascending\" data-type=\"text\" lang=\"en-US\"/>\n\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h2\" select=\"substring-before($text,':')\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h1\" select=\"substring-after($text,':')\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"file\" select=\"concat($baseRef,translate($h2,'.','/'),'/',$h1,'.html')\"/>\n\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"count($classHeader_map//apiClassifier[@id=$text] ) &gt; 0\">\n\t\t\t\t\t\t\t\t\t\t<a>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:attribute name=\"href\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:attribute>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$h1\"/>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(count($classHeader_map//apiClassifier[@id=$text] ) &gt; 0)\">\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($text,':'))\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$text\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($text,':')\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($h2,concat('.',$h1))\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<xsl:text></xsl:text>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"position() != last()\">\n\t\t\t\t\t\t\t\t\t\t<xsl:text>, </xsl:text>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<xsl:if test=\"not(./apiClassifierDetail/apiClassifierDef/apiInterface) and ./apiClassifierDetail/Inheritancelist/Inheritance/Inherit/@id\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=\"classHeaderTableLabel\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Inheritance']]/entry[2]/p\"/>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td class=\"inheritanceList\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t<xsl:for-each select=\"./apiClassifierDetail/Inheritancelist/Inheritance/Inherit\">\n\t\t\t\t\t\t\t\t<xsl:variable name=\"val\" select=\"@id\"/>\n\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t<xsl:when test=\"not(@id)\"/>\n\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$prog_language_name='javascript'\" />\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$prog_language_name!='javascript'\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h2\" select=\"substring-before($val,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h1\" select=\"substring-after($val,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"file\" select=\"concat($baseRef,translate($h2,'.','/'),'/',$h1,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($val,':'))\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"global\" select=\"$val\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains(ancestor::apiClassifier/@id,'globalClassifier:')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"gfile\" select=\"concat($val,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"iconRef\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>images/inherit-arrow.gif</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<img src=\"{$iconRef}\" title=\"Inheritance\" alt=\"Inheritance\" class=\"inheritArrow\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"count($classHeader_map//apiClassifier[@id=$val] ) &gt; 0\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:attribute name=\"href\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$gfile\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:attribute>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$val\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(count($classHeader_map//apiClassifier[@id=$val] ) &gt; 0)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$val\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains(ancestor::apiClassifier/@id,'globalClassifier:'))\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"file1\" select=\"concat($baseRef,$val,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"iconRef\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>images/inherit-arrow.gif</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<img src=\"{$baseRef}{$iconRef}\" title=\"Inheritance\" alt=\"Inheritance\" class=\"inheritArrow\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"count($classHeader_map//apiClassifier[@id=$val] ) &gt; 0\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:attribute name=\"href\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file1\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:attribute>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$val\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(count($classHeader_map//apiClassifier[@id=$val] ) &gt; 0)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$val\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($val,':')\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"iconRef\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>images/inherit-arrow.gif</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t<img src=\"{$baseRef}{$iconRef}\" title=\"Inheritance\" alt=\"Inheritance\" class=\"inheritArrow\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"count($classHeader_map//apiClassifier[@id=$val] ) &gt; 0\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:attribute name=\"href\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:attribute>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$h1\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(count($classHeader_map//apiClassifier[@id=$val] ) &gt; 0)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($h2,concat('.',$h1))\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(./apiClassifierDetail/apiClassifierDef/apiInterface) and count(./apiClassifierDetail/Inheritancelist/Implements/Implement) &gt; 0\">\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td class=\"classHeaderTableLabel\">Implements</td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"./apiClassifierDetail/Inheritancelist/Implements/Implement\">\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"val\" select=\"@id\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h2\" select=\"substring-before($val,':')\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h1\" select=\"substring-after($val,':')\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"file\" select=\"concat($baseRef,translate($h2,'.','/'),'/',$h1,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($val,':'))\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"file1\" select=\"concat($baseRef,$val,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"count($classHeader_map//apiClassifier[@id=$val] ) &gt; 0\">\n\t\t\t\t\t\t\t\t\t\t\t\t<a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:attribute name=\"href\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file1\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:attribute>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$val\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(count($classHeader_map//apiClassifier[@id=$val] ) &gt; 0)\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$val\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($val,':')\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"count($classHeader_map//apiClassifier[@id=$val] ) &gt; 0\">\n\t\t\t\t\t\t\t\t\t\t\t\t<a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:attribute name=\"href\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:attribute>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$h1\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(count($classHeader_map//apiClassifier[@id=$val] ) &gt; 0)\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($h2,concat('.',$h1))\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"position() != last()\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>, </xsl:text>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(./apiClassifierDetail/apiClassifierDef/apiInterface)\">\n\t\t\t\t\t<xsl:if test=\"./apiClassifierDetail/Inheritancelist/Subclasses/class\">\n\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td class=\"classHeaderTableLabel\">\n\t\t\t\t\t\t\t\t\t\t<xsl:text>Subclasses</xsl:text>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"./apiClassifierDetail/Inheritancelist/Subclasses/class\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:sort select=\"substring-after(@id,':')\" order=\"ascending\" data-type=\"text\" lang=\"en-US\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains(@id,'globalClassifier:'))\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"val\" select=\"@id\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h2\" select=\"substring-before($val,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h1\" select=\"substring-after($val,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"file\" select=\"concat($baseRef,translate($h2,'.','/'),'/',$h1,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($val,':'))\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"file1\" select=\"concat($baseRef,$val,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:attribute name=\"href\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file1\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:attribute>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$val\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($val,':')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:attribute name=\"href\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:attribute>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$h1\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"position() != last()\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>, </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains(@id,'globalClassifier:')\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"val\" select=\"substring-after(@id, 'globalClassifier:')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h2\" select=\"substring-before($val,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h1\" select=\"substring-after($val,':')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"file\" select=\"concat($baseRef,translate($h2,'.','/'),'/',$h1,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($val,':'))\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"file1\" select=\"concat($baseRef,$val,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:attribute name=\"href\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file1\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:attribute>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$val\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($val,':')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:attribute name=\"href\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:attribute>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$h1\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"position() != last()\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>, </xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"./apiClassifierDetail/apiClassifierDef/apiInterface and ./apiClassifierDetail/Inheritancelist/Implementors/Implementor\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=\"classHeaderTableLabel\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Implementors']]/entry[2]/p\"/>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<xsl:for-each select=\"./apiClassifierDetail/Inheritancelist/Implementors/Implementor\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains(@id,'globalClassifier:'))\">\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"val\" select=\"@id\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h2\" select=\"substring-before($val,':')\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h1\" select=\"substring-after($val,':')\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"file\" select=\"concat($baseRef,translate($h2,'.','/'),'/',$h1,'.html')\"/>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($val,':'))\">\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"file1\" select=\"concat($baseRef,$val,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t<a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:attribute name=\"href\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file1\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:attribute>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$val\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($val,':')\">\n\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t<a>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:attribute name=\"href\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:attribute>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$h1\"/>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"position() != last()\">\n\t\t\t\t\t\t\t\t\t\t<xsl:text>, </xsl:text>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"contains(@id,'globalClassifier:')\">\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"val\" select=\"substring-after(@id, 'globalClassifier:')\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h2\" select=\"substring-before($val,':')\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"h1\" select=\"substring-after($val,':')\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"file\" select=\"concat($baseRef,translate($h2,'.','/'),'/',$h1,'.html')\"/>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($val,':'))\">\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"file1\" select=\"concat($baseRef,$val,'.html')\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t<a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:attribute name=\"href\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file1\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:attribute>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$val\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"contains($val,':')\">\n\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t<a>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:attribute name=\"href\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$file\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:attribute>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$h1\"/>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"position() != last()\">\n\t\t\t\t\t\t\t\t\t\t<xsl:text>, </xsl:text>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</xsl:if>\n\t\t\t</table>\n\t\t\t<xsl:if test=\"$classDeprecated='true'\">\n\t\t\t\t<xsl:apply-templates select=\"deprecated\"/>\n\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t</xsl:if>\n\t\t\t<xsl:apply-templates select=\"apiClassifierDetail/apiClassifierDef/apiDeprecated\"/>\n\t\t\t<xsl:call-template name=\"version\"/>\n\t\t\t<p/>\n\t\t\t  <xsl:if test=\"prolog/asMetadata/Alternative\">\n\t\t\t    <xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t    <table width=\"100%\" class=\"innertable\">\n\t\t\t      <xsl:for-each select=\"prolog/asMetadata/Alternative\">\n\t\t\t\t<xsl:variable name=\"replacement\" select=\"@replacement\"/>\n\t\t\t\t<xsl:variable name=\"version\" select=\"@since\"/>\n\t\t\t\t<xsl:variable name=\"baseref\" select=\"$baseRef\"/>\n\t\t\t\t<xsl:choose>\n\t\t\t\t  <xsl:when test=\"$replacement='none'\">\n\t\t\t\t    <tr>\n\t\t\t\t      <td bgcolor=\"#FFFFCC\">\n\t\t\t\t      \t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t      </td>\n\t\t\t\t      <td bgcolor=\"#FFFFCC\">\n\t\t\t\t\t<xsl:apply-templates select=\"./description/node()\"/>\n\t\t\t\t      </td>\n\t\t\t\t    </tr>\n\t\t\t\t  </xsl:when>\n\t\t\t\t  <xsl:when test=\"$replacement!='none'\">\n\t\t\t\t    <xsl:variable name=\"desc.terms\" select=\"$asdoc_terms/row[entry[1][p/text() = 'altr.desc.1st']]/entry[2]/p\"/>\n\t\t\t\t    <xsl:variable name=\"class.link\">\n\t\t\t\t      <xsl:variable name=\"class\" select=\"substring-after(substring-after($replacement,'.'),'.')\"/>\n\t\t\t\t      <xsl:variable name=\"alt.pkg\" select=\"substring-before($replacement,concat('.',$class))\"/>\n\t\t\t\t      <xsl:variable name=\"pkg.path\" select=\"translate($alt.pkg,'.','/')\"/>\n\t\t\t\t      <xsl:value-of select=\"concat($baseref,$pkg.path,'/',$class,'.html')\"/>\n\t\t\t\t    </xsl:variable>\n\t\t\t\t    <xsl:variable name=\"replace.version\" select=\"replace($desc.terms,'%ver%',$version)\"/>\n\t\t\t\t    <tr>\n\t\t\t\t      <td bgcolor=\"#FFFFCC\">\n\t\t\t\t\t\n\t\t\t\t\t<img src=\"{$baseRef}images/P_AlternativeMetadataIndicator_30x28_N.png\" />\n\t\t\t\t      </td>\n\t\t\t\t      <td bgcolor=\"#FFFFCC\">\n\t\t\t\t\t<xsl:value-of select=\"substring-before($replace.version,'%class%')\"/>\n\t\t\t\t\t<a href=\"{$class.link}\">\n\t\t\t\t\t  <xsl:value-of select=\"$replacement\"/>\n\t\t\t\t\t</a>\n\t\t\t\t\t<xsl:value-of select=\"substring-after($replace.version,'%class%')\"/>\n\t\t\t\t\t<xsl:if test=\"./description\">\n\t\t\t\t\t  <xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t\t  <p>\n\t\t\t\t\t    <xsl:apply-templates select=\"./description/node()\"/>\n\t\t\t\t\t  </p>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t      </td>\n\t\t\t\t    </tr>\n\t\t\t\t  </xsl:when>\n\t\t\t\t</xsl:choose>\n\t\t\t      </xsl:for-each>\n\t\t\t    </table>\n\t\t\t    <xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t  </xsl:if>\t\t\t\n\t\t\t<xsl:call-template name=\"description\"/>\n\t\t\t<p/>\n\t\t\t<xsl:if test=\"apiClassifierDetail/apiClassifierDef/apiInheritDoc\">\n\t\t\t\t<xsl:call-template name=\"getInheritDocText\">\n\t\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"ancestor-or-self::apiClassifier/apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"'apiDesc'\"/>\n\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"'apiClassifier'\"/>\n\t\t\t\t\t<xsl:with-param name=\"nameToMatch\" select=\"./apiName\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"prolog/asCustoms/mxml\">\n\t\t\t\t<a name=\"mxmlSyntaxSummary\"/>\n\t\t\t\t<span class=\"classHeaderTableLabel\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'MXMLSyntax']]/entry[2]/p\"/>\n\t\t\t\t</span>\n\t\t\t\t<span id=\"showMxmlLink\" style=\"display:none\">\n\t\t\t\t\t<a href=\"#mxmlSyntaxSummary\" onclick=\"toggleMXMLOnly();\">\n\t\t\t\t\t\t<img src=\"{$baseRef}images/collapsed.gif\" title=\"collapsed\" alt=\"collapsed\" class=\"collapsedImage\"/>\n\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ShowMXMLSyntax']]/entry[2]/p\"/>\n\t\t\t\t\t</a>\n\t\t\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t\t</span>\n\t\t\t\t<span id=\"hideMxmlLink\">\n\t\t\t\t\t<a href=\"#mxmlSyntaxSummary\" onclick=\"toggleMXMLOnly();\">\n\t\t\t\t\t\t<img src=\"{$baseRef}images/expanded.gif\" title=\"expanded\" alt=\"expanded\" class=\"expandedImage\"/>\n\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'HideMXMLSyntax']]/entry[2]/p\"/>\n\t\t\t\t\t</a>\n\t\t\t\t</span>\n\t\t\t\t<div id=\"mxmlSyntax\" class=\"mxmlSyntax\">\n\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"prolog/asCustoms/mxml/.\"/>\n\t\t\t\t</div>\n\t\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\t\t<xsl:comment>\n\t\t\t\t\t\t<xsl:text>\n\t\t\t\t\t\t\t\t</xsl:text>\n\t\t\t\t\t\t<xsl:text>setMXMLOnly();</xsl:text>\n\t\t\t\t\t\t<xsl:text>\n\t\t\t\t\t\t\t\t</xsl:text>\n\t\t\t\t\t</xsl:comment>\n\t\t\t\t</script>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"prolog/asMetadata/SkinStates/@states\">\n\t\t\t\t<xsl:variable name=\"state\" select=\"normalize-space(prolog/asMetadata/SkinStates/@states)\"/>\n\t\t\t\t<h3>Skinning the component</h3>\n\t\t\t\t<p>To skin the component, implement a skin that defines the following skin states: &lt;br/&gt;&lt;br/&gt;<xsl:value-of select=\"$state\"/>  &lt;br/&gt;&lt;br/&gt;While you must implement all skin states, a skin state can be empty. An empty skin state defines no changes to the default skin state.</p>\n\t\t\t</xsl:if>\n\t\t\t<xsl:apply-templates select=\"prolog/asMetadata/DefaultProperty\"/>\n\t\t\t<xsl:apply-templates select=\"example\"/>\n\t\t\t<xsl:call-template name=\"includeExampleLink\"/>\n\t\t\t<xsl:call-template name=\"sees\">\n\t\t\t\t<xsl:with-param name=\"labelClass\" select=\"'classHeaderTableLabel'\"/>\n\t\t\t</xsl:call-template>\n\t\t\t<xsl:text disable-output-escaping=\"yes\">&lt;br/&gt;</xsl:text>\n\t\t\t<hr/>\n\t\t</div>\n\t</xsl:template>\n\t<xsl:template match=\"apiDeprecated\" >\n\t\t<xsl:variable name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t<xsl:variable name=\"ancestorPath\" select=\"ancestor::apiClassifierDetail/apiClassifierDef\"/>\n\t\t<div style=\"white-space:nowrap\" valign=\"top\">\n\t\t\t<xsl:choose>\n\t\t\t\t<xsl:when test=\"@sinceVersion\">\n\t\t\t\t\t<b>\n\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'DeprecatedSince']]/entry[2]/p\"/>\n\t\t\t\t\t</b>\n\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t<xsl:value-of select=\"@sinceVersion\"/>\n\t\t\t\t\t<xsl:if test=\"@replacement!=''\">\n\t\t\t\t\t\t<xsl:text>: </xsl:text>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:when>\n\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t<b>\n\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Deprecated']]/entry[2]/p\"/>\n\t\t\t\t\t\t<xsl:text>:</xsl:text>\n\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t</b>\n\t\t\t\t</xsl:otherwise>\n\t\t\t</xsl:choose>\n\t\t\t<xsl:choose>\n\t\t\t\t<xsl:when test=\"@replacement!=''\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'PleaseUse']]/entry[2]/p\"/>\n\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t<xsl:if test=\"contains(@replacement,',')\">\n\t\t\t\t\t\t<xsl:for-each select=\"tokenize(@replacement, ',')\">\n\t\t\t\t\t\t\t<xsl:variable name=\"spec\" select=\".\"/>\n\t\t\t\t\t\t\t<xsl:variable name=\"tospec\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"contains($spec, ':')\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring-after($spec,':')\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($spec, ':'))\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$spec\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t<xsl:variable name=\"linkpath1\">\n\t\t\t\t\t\t\t\t<xsl:call-template name=\"getDeprecatedReplacementLink\">\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"replacement\" select=\"$tospec\"/>\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t<xsl:when test=\"contains($linkpath1,'.') and contains($linkpath1,'/')\">\n\t\t\t\t\t\t\t\t\t<A href=\"{$linkpath1}\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$spec\"/>\n\t\t\t\t\t\t\t\t\t</A>\n\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$spec\"/>\n\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t<xsl:if test=\"position() != last()\">\n\t\t\t\t\t\t\t\t<xsl:text>, </xsl:text>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:variable name=\"linkpath\">\n\t\t\t\t\t\t<xsl:call-template name=\"getDeprecatedReplacementLink\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"replacement\" select=\"@replacement\"/>\n\t\t\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t<xsl:with-param name=\"ancestorPath\" select=\"$ancestorPath\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t<xsl:if test=\"not(contains(@replacement,','))\">\n\t\t\t\t\t\t<xsl:if test=\"$ancestorPath\">\n\t\t\t\t\t\t\t<xsl:variable name=\"lastToken\">\n\t\t\t\t\t\t\t\t<xsl:call-template name=\"lastIndexOf\">\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"string\" select=\"@replacement\"/>\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"char\" select=\"'.'\"/>\n\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t<xsl:variable name=\"firstPassToken\" select=\"substring-before(@replacement,concat('.',$lastToken))\"/>\n\t\t\t\t\t\t\t<xsl:variable name=\"testToken\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($firstPassToken) &gt; 0\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($firstPassToken,':',@replacement)\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($firstPassToken) = 0\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$currentPackage = '__Global__'\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat('globalClassifier:',@replacement)\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not($currentPackage = '__Global__')\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($currentPackage,':',@replacement)\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t<xsl:if test=\"count($classHeader_map//apiClassifier[@id=$testToken] ) &gt; 0\">\n\t\t\t\t\t\t\t\t<A href=\"{$linkpath}\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@replacement\"/>\n\t\t\t\t\t\t\t\t</A>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"count($classHeader_map//apiClassifier[@id=$testToken] ) = 0\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@replacement\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"not($ancestorPath)\">\n\t\t\t\t\t\t\t<xsl:if test=\"contains(@replacement, '.')\">\n\t\t\t\t\t\t\t\t<xsl:variable name=\"lastToken\">\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"lastIndexOf\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"string\" select=\"@replacement\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"char\" select=\"'.'\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"firstPassToken\" select=\"substring-before(@replacement,concat('.',$lastToken))\"/>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"className\">\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"lastIndexOf\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"string\" select=\"$firstPassToken\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"char\" select=\"'.'\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"packageName\" select=\"substring-before($firstPassToken,concat('.',$className))\"/>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"testToken\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($packageName) &gt; 0\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$packageName\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($packageName) = 0\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$currentPackage\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"testToken2\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($firstPassToken) &gt; 0\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$firstPassToken\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($firstPassToken) = 0\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$classHeader_map//apiClassifier/apiName\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t<xsl:if test=\"count($classHeader_map//apiClassifier[@id=concat($testToken, ':', $testToken2)] ) &gt; 0\">\n\t\t\t\t\t\t\t\t\t<A href=\"{$linkpath}\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@replacement\"/>\n\t\t\t\t\t\t\t\t\t</A>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"count($classHeader_map//apiClassifier[@id=concat($testToken, ':', $testToken2)] ) = 0\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@replacement\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"not(contains(@replacement, '.'))\">\n\t\t\t\t\t\t\t\t<A href=\"{$linkpath}\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@replacement\"/>\n\t\t\t\t\t\t\t\t</A>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:when>\n\t\t\t\t<xsl:when test=\"apiDesc\">\n\t\t\t\t\t<xsl:for-each select=\"./apiDesc\">\n\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t</xsl:for-each>\n\t\t\t\t</xsl:when>\n\t\t\t</xsl:choose>\n\t\t</div>\n\t</xsl:template>\n\t<xsl:template match=\"apiDeprecated\" mode=\"event\" >\n\t\t<xsl:variable name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t<xsl:variable name=\"ancestorPath\" select=\"ancestor::apiClassifierDetail/apiClassifierDef\"/>\n\t\t<div style=\"white-space:nowrap\" valign=\"top\">\n\t\t\t<xsl:choose>\n\t\t\t\t<xsl:when test=\"@sinceVersion\">\n\t\t\t\t\t<b>\n\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'DeprecatedSince']]/entry[2]/p\"/>\n\t\t\t\t\t</b>\n\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t<xsl:value-of select=\"@sinceVersion\"/>\n\t\t\t\t\t<xsl:if test=\"@replacement!=''\">\n\t\t\t\t\t\t<xsl:text>: </xsl:text>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:when>\n\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t<b>\n\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Deprecated']]/entry[2]/p\"/>\n\t\t\t\t\t\t<xsl:text>:</xsl:text>\n\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t</b>\n\t\t\t\t</xsl:otherwise>\n\t\t\t</xsl:choose>\n\t\t\t<xsl:choose>\n\t\t\t\t<xsl:when test=\"@replacement!=''\">\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'PleaseUse']]/entry[2]/p\"/>\n\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t<xsl:if test=\"contains(@replacement,',')\">\n\t\t\t\t\t\t<xsl:for-each select=\"tokenize(@replacement, ',')\">\n\t\t\t\t\t\t\t<xsl:variable name=\"spec\" select=\".\"/>\n\t\t\t\t\t\t\t<xsl:variable name=\"tospec\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"contains($spec, ':')\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"substring-after($spec,':')\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"not(contains($spec, ':'))\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$spec\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t<xsl:variable name=\"linkpath1\">\n\t\t\t\t\t\t\t\t<xsl:call-template name=\"getDeprecatedReplacementLink\">\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"replacement\" select=\"$tospec\"/>\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"mode\" select=\"'event:'\"/>\n\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t<xsl:when test=\"contains($linkpath1,'.') and contains($linkpath1,'/')\">\n\t\t\t\t\t\t\t\t\t<A href=\"{$linkpath1}\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$spec\"/>\n\t\t\t\t\t\t\t\t\t</A>\n\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$spec\"/>\n\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t<xsl:if test=\"position() != last()\">\n\t\t\t\t\t\t\t\t<xsl:text>, </xsl:text>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:variable name=\"linkpath\">\n\t\t\t\t\t\t<xsl:call-template name=\"getDeprecatedReplacementLink\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"replacement\" select=\"@replacement\"/>\n\t\t\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t<xsl:with-param name=\"ancestorPath\" select=\"$ancestorPath\"/>\n\t\t\t\t\t\t\t<xsl:with-param name=\"mode\" select=\"'event:'\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t<xsl:if test=\"not(contains(@replacement,','))\">\n\t\t\t\t\t\t<xsl:if test=\"$ancestorPath\">\n\t\t\t\t\t\t\t<xsl:variable name=\"lastToken\">\n\t\t\t\t\t\t\t\t<xsl:call-template name=\"lastIndexOf\">\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"string\" select=\"@replacement\"/>\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"char\" select=\"'.'\"/>\n\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t<xsl:variable name=\"firstPassToken\" select=\"substring-before(@replacement,concat('.',$lastToken))\"/>\n\t\t\t\t\t\t\t<xsl:variable name=\"testToken\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($firstPassToken) &gt; 0\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($firstPassToken,':',@replacement)\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($firstPassToken) = 0\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$currentPackage = '__Global__'\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat('globalClassifier:',@replacement)\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not($currentPackage = '__Global__')\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($currentPackage,':',@replacement)\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t<xsl:if test=\"count($classHeader_map//apiClassifier[@id=$testToken] ) &gt; 0\">\n\t\t\t\t\t\t\t\t<A href=\"{$linkpath}\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@replacement\"/>\n\t\t\t\t\t\t\t\t</A>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"count($classHeader_map//apiClassifier[@id=$testToken] ) = 0\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@replacement\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"not($ancestorPath)\">\n\t\t\t\t\t\t\t<xsl:if test=\"contains(@replacement, '.')\">\n\t\t\t\t\t\t\t\t<xsl:variable name=\"lastToken\">\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"lastIndexOf\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"string\" select=\"@replacement\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"char\" select=\"'.'\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"firstPassToken\" select=\"substring-before(@replacement,concat('.',$lastToken))\"/>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"className\">\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"lastIndexOf\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"string\" select=\"$firstPassToken\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"char\" select=\"'.'\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"packageName\" select=\"substring-before($firstPassToken,concat('.',$className))\"/>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"testToken\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($packageName) &gt; 0\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$packageName\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($packageName) = 0\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$currentPackage\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t<xsl:variable name=\"testToken2\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($firstPassToken) &gt; 0\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$firstPassToken\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($firstPassToken) = 0\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$classHeader_map//apiClassifier/apiName\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t<xsl:if test=\"count($classHeader_map//apiClassifier[@id=concat($testToken, ':', $testToken2)] ) &gt; 0\">\n\t\t\t\t\t\t\t\t\t<A href=\"{$linkpath}\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@replacement\"/>\n\t\t\t\t\t\t\t\t\t</A>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:if test=\"count($classHeader_map//apiClassifier[@id=concat($testToken, ':', $testToken2)] ) = 0\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@replacement\"/>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"not(contains(@replacement, '.'))\">\n\t\t\t\t\t\t\t\t<A href=\"{$linkpath}\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@replacement\"/>\n\t\t\t\t\t\t\t\t</A>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:when>\n\t\t\t\t<xsl:when test=\"apiDesc\">\n\t\t\t\t\t<xsl:for-each select=\"./apiDesc\">\n\t\t\t\t\t\t<xsl:call-template name=\"processTags\"/>\n\t\t\t\t\t</xsl:for-each>\n\t\t\t\t</xsl:when>\n\t\t\t</xsl:choose>\n\t\t</div>\n\t</xsl:template>\n</xsl:stylesheet>\n"
  },
  {
    "path": "documentation/api-reference/templates/class-summary.xslt",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n\n\tADOBE SYSTEMS INCORPORATED\n\tCopyright 2008 Adobe Systems Incorporated\n\tAll Rights Reserved.\n\n\tNOTICE: Adobe permits you to use, modify, and distribute this file\n\tin accordance with the terms of the license agreement accompanying it.\n\n-->\n<xsl:stylesheet version=\"2.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:saxon=\"http://sf.net/saxon\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:ifn=\"urn:internal:functions\"\n\texclude-result-prefixes=\"saxon xs ifn\">\n\t<xsl:import href=\"asdoc-util.xslt\"/>\n\t<xsl:output encoding=\"UTF-8\" method=\"html\" use-character-maps=\"disable\"/>\n\t<xsl:param name=\"localTitle\" select=\"$localTitle\"/>\n\t<xsl:variable name=\"title\" select=\"concat($asdoc_terms/row[entry[1][p/text() = $localTitle]]/entry[2]/p,' - ',$title-base)\"/>\n\t<xsl:param name=\"overviewsFile\" select=\"'overviews.xml'\"/>\n\t<xsl:param name=\"ditaFileDir\" select=\"''\"/>\n\t<xsl:param name=\"packages_map_name\" select=\"packagemap.xml\"/>\n\t<xsl:param name=\"filter\" select=\"$filter\"/>\n\t<xsl:param name=\"outfile\" select=\"'class-summary'\"/>\n\t<xsl:variable name=\"useFilter\">\n\t\t<xsl:if test=\"contains($filter,'*')\">\n\t\t\t<xsl:value-of select=\"substring-before($filter,'*')\"/>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"not(contains($filter,'*'))\">\n\t\t\t<xsl:value-of select=\"$filter\"/>\n\t\t</xsl:if>\n\t</xsl:variable>\n\t<xsl:template match=\"/\">\n\t\t<xsl:copy-of select=\"$noLiveDocs\"/>\n\t\t<xsl:copy-of select=\"$docType\"/>\n\t\t<xsl:element name=\"html\">\n\t\t\t<head>\n\t\t\t\t<title>\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = $localTitle]]/entry[2]/p\"/>\n\t\t\t\t\t<xsl:call-template name=\"getPageTitlePostFix\"/>\n\t\t\t\t</title>\n\t\t\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n\t\t\t\t<xsl:call-template name=\"getStyleLink\">\n\t\t\t\t\t<xsl:with-param name=\"link\" select=\"asdoc/link\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</head>\n\t\t\t<xsl:element name=\"body\">\n\t\t\t\t<xsl:if test=\"$isEclipse\">\n\t\t\t\t\t<xsl:attribute name=\"class\">\n\t\t\t\t\t\t<xsl:text>eclipseBody</xsl:text>\n\t\t\t\t\t</xsl:attribute>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:call-template name=\"getTitleScript\">\n\t\t\t\t\t<xsl:with-param name=\"title\" select=\"$title\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t\t<xsl:call-template name=\"getLinks2\">\n\t\t\t\t\t<xsl:with-param name=\"subTitle\">\n\t\t\t\t\t\t<xsl:call-template name=\"search-and-replace\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"input\" select=\"$asdoc_terms/row[entry[1][p/text() = $localTitle]]/entry[2]/p\"/>\n\t\t\t\t\t\t\t<xsl:with-param name=\"search-string\" select=\"' '\"/>\n\t\t\t\t\t\t\t<xsl:with-param name=\"replace-string\" select=\"$nbsp\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:with-param>\n\t\t\t\t\t<xsl:with-param name=\"fileName\" select=\"$outfile\"/>\n\t\t\t\t\t<xsl:with-param name=\"showProperties\" select=\"false()\"/>\n\t\t\t\t\t<xsl:with-param name=\"showMethods\" select=\"false()\"/>\n\t\t\t\t\t<xsl:with-param name=\"showAllClasses\" select=\"false()\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t\t<div class=\"MainContent\">\n\t\t\t\t\t<br/>\n\t\t\t\t\t<xsl:variable name=\"overviews\" select=\"document($overviewsFile)/overviews\"/>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t<xsl:when test=\"starts-with($useFilter,'mx.')\">\n\t\t\t\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"$overviews/mx-classes/description/.\"/>\n\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t<xsl:when test=\"starts-with($useFilter,'flash.')\">\n\t\t\t\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"$overviews/flash-classes/description/.\"/>\n\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"$overviews/all-classes/description/.\"/>\n\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t</p>\n\t\t\t\t\t<xsl:for-each select=\"$overviews/all-classes\">\n\t\t\t\t\t\t<xsl:call-template name=\"sees\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"xrefId\" select=\"'all-classes'\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t<br/>\n\t\t\t\t\t<table cellpadding=\"3\" cellspacing=\"0\" class=\"summaryTable\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t<th width=\"20%\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ClassClass']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t<th width=\"20%\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'PackagePackage']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t<th width=\"60%\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Description']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<xsl:for-each select=\"allClasses/apiPackage//apiClassifier[starts-with(../apiName,$useFilter) or ($useFilter='flash.' and ../apiName='__Global__')]\">\n\t\t\t\t\t\t\t<xsl:sort select=\"./apiName\" order=\"ascending\" data-type=\"text\" lang=\"en-US\"/>\n\t\t\t\t\t\t\t<xsl:variable name=\"name\" select=\"./apiName\"/>\n\t\t\t\t\t\t\t<xsl:variable name=\"packageName\" select=\"../apiName\"/>\n\t\t\t\t\t\t\t<xsl:variable name=\"classPath\">\n\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t<xsl:when test=\"$packageName='__Global__'\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"'.'\"/>\n\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"translate($packageName,'.','/') \"/>\n\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t<tr class=\"prow{position() mod 2}\">\n\t\t\t\t\t\t\t\t<td class=\"summaryTablePaddingCol\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td class=\"summaryTableSecondCol\">\n\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$classPath\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$classPath}/{$name}.html\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./apiClassifierDetail/apiClassifierDef/apiInterface\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<i>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"prolog/asMetadata/apiVersion/apiPlatform[@name='AIR'] and not (prolog/asMetadata/apiVersion/apiPlatform[@name='Flash'])\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img src=\"images/AirIcon12x12.gif\" width=\"12\" height=\"12\" hspace=\"0\" vspace=\"0\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</i>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(./apiClassifierDetail/apiClassifierDef/apiInterface)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"prolog/asMetadata/apiVersion/apiPlatform[@name='AIR'] and not (prolog/asMetadata/apiVersion/apiPlatform[@name='Flash'])\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img src=\"images/AirIcon12x12.gif\" width=\"12\" height=\"12\" hspace=\"0\" vspace=\"0\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t<br/>\n\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$classPath}/{$name}.html\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"apiClassifier[./apiClassifierDetail/apiClassifierDef/apiInterface]\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<i>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"prolog/asMetadata/apiVersion/apiPlatform[@name='AIR'] and not (prolog/asMetadata/apiVersion/apiPlatform[@name='Flash'])\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img src=\"images/AirIcon12x12.gif\" width=\"12\" height=\"12\" hspace=\"0\" vspace=\"0\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</i>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"apiClassifier[not(./apiClassifierDetail/apiClassifierDef/apiInterface)]\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"prolog/asMetadata/apiVersion/apiPlatform[@name='AIR'] and not (prolog/asMetadata/apiVersion/apiPlatform[@name='Flash'])\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img src=\"images/AirIcon12x12.gif\" width=\"12\" height=\"12\" hspace=\"0\" vspace=\"0\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t<br/>\n\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td class=\"summaryTableCol\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$classPath and string-length(normalize-space($classPath)) &gt; 0 and not($classPath='.')\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"{$classPath}/package-detail.html\" onclick=\"javascript:loadClassListFrame('{$classPath}/class-list.html');\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$packageName\"/>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not($classPath) or string-length(normalize-space($classPath)) = 0 or $classPath='.'\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"package-detail.html\" onclick=\"javascript:loadClassListFrame('class-list.html');\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'TopLevel']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td class=\"summaryTableLastCol\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"deprecated\">\n\t\t\t\t\t\t\t\t\t\t<xsl:apply-templates select=\"deprecated\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(deprecated)\">\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length(normalize-space(./shortdesc)) &gt; 0\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"./shortdesc\" disable-output-escaping=\"yes\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(string-length(normalize-space(./shortdesc)) &gt; 0)\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t</table>\n\t\t\t\t\t<p/>\n\t\t\t\t\t<center class=\"copyright\">\n\t\t\t\t\t\t<xsl:copy-of select=\"$copyright\"/>\n\t\t\t\t\t</center>\n\t\t\t\t</div>\n\t\t\t</xsl:element>\n\t\t</xsl:element>\n\t\t<xsl:copy-of select=\"$copyrightComment\"/>\n\t</xsl:template>\n</xsl:stylesheet>\n"
  },
  {
    "path": "documentation/api-reference/templates/cookies.js",
    "content": "////////////////////////////////////////////////////////////////////////////////\n//\n//  ADOBE SYSTEMS INCORPORATED\n//  Copyright 2006-2008 Adobe Systems Incorporated\n//  All Rights Reserved.\n//\n//  NOTICE: Adobe permits you to use, modify, and distribute this file\n//  in accordance with the terms of the license agreement accompanying it.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Read the JavaScript cookies tutorial at:\n *   http://www.netspade.com/articles/javascript/cookies.xml\n */\n\n/**\n * Sets a Cookie with the given name and value.\n *\n * name       Name of the cookie\n * value      Value of the cookie\n * [expires]  Expiration date of the cookie (default: end of current session)\n * [path]     Path where the cookie is valid (default: path of calling document)\n * [domain]   Domain where the cookie is valid\n *              (default: domain of calling document)\n * [secure]   Boolean value indicating if the cookie transmission requires a\n *              secure transmission\n */\nfunction setCookie(name, value, expires, path, domain, secure)\n{\n    document.cookie= name + \"=\" + escape(value) +\n        ((expires) ? \"; expires=\" + expires.toGMTString() : \"\") +\n        ((path) ? \"; path=\" + path : \"\") +\n        ((domain) ? \"; domain=\" + domain : \"\") +\n        ((secure) ? \"; secure\" : \"\");\n}\n\n/**\n * Gets the value of the specified cookie.\n *\n * name  Name of the desired cookie.\n *\n * Returns a string containing value of specified cookie,\n *   or null if cookie does not exist.\n */\nfunction getCookie(name)\n{\n    var dc = document.cookie;\n    var prefix = name + \"=\";\n    var begin = dc.indexOf(\"; \" + prefix);\n    if (begin == -1)\n    {\n        begin = dc.indexOf(prefix);\n        if (begin != 0) return null;\n    }\n    else\n    {\n        begin += 2;\n    }\n    var end = document.cookie.indexOf(\";\", begin);\n    if (end == -1)\n    {\n        end = dc.length;\n    }\n    return unescape(dc.substring(begin + prefix.length, end));\n}\n\n/**\n * Deletes the specified cookie.\n *\n * name      name of the cookie\n * [path]    path of the cookie (must be same as path used to create cookie)\n * [domain]  domain of the cookie (must be same as domain used to create cookie)\n */\nfunction deleteCookie(name, path, domain)\n{\n    if (getCookie(name))\n    {\n        document.cookie = name + \"=\" + \n            ((path) ? \"; path=\" + path : \"\") +\n            ((domain) ? \"; domain=\" + domain : \"\") +\n            \"; expires=Thu, 01-Jan-70 00:00:01 GMT\";\n    }\n}\n"
  },
  {
    "path": "documentation/api-reference/templates/effectsSummary.xslt",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n\n\tADOBE SYSTEMS INCORPORATED\n\tCopyright 2008 Adobe Systems Incorporated\n\tAll Rights Reserved.\n\n\tNOTICE: Adobe permits you to use, modify, and distribute this file\n\tin accordance with the terms of the license agreement accompanying it.\n\n-->\n<xsl:stylesheet version=\"2.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n\t<xsl:output method=\"xml\" version=\"1.0\" encoding=\"UTF-8\" indent=\"no\"/>\n\t<xsl:param name=\"ditaFileDir\" select=\"''\"/>\n\t<xsl:template match=\"/\">\n\t\t<allClasses>\n\t\t\t<xsl:apply-templates select=\"//apiItemRef\">\n\t\t\t\t<xsl:sort select=\"@href\" order=\"ascending\"/>\n\t\t\t</xsl:apply-templates>\n\t\t</allClasses>\n\t</xsl:template>\n\t<xsl:template match=\"apiItemRef\">\n\t\t<xsl:variable name=\"ditaFileName\">\n\t\t\t<xsl:value-of select=\"concat($ditaFileDir,@href)\"/>\n\t\t</xsl:variable>\n\t\t<xsl:for-each select=\"document($ditaFileName)/apiPackage\">\n\t\t\t<apiPackage id=\"{@id}\">\n\t\t\t\t<apiName>\n\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t</apiName>\n\t\t\t\t<xsl:apply-templates select=\"apiClassifier\"/>\n\t\t\t</apiPackage>\n\t\t</xsl:for-each>\n\t</xsl:template>\n\t<xsl:template match=\"apiClassifier\">\n\t\t<apiClassifier id=\"{@id}\">\n\t\t\t<apiName>\n\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t</apiName>\n\t\t\t<xsl:apply-templates select=\"apiClassifierDetail\"/>\n\t\t\t<xsl:apply-templates select=\"prolog/asMetadata\"/>\n\t\t</apiClassifier>\n\t</xsl:template>\n\t<xsl:template match=\"prolog/asMetadata\">\n\t\t<prolog>\n\t\t\t<asMetadata>\n\t\t\t\t<xsl:apply-templates select=\"effects\"/>\n\t\t\t</asMetadata>\n\t\t</prolog>\n\t</xsl:template>\n\t<xsl:template match=\"effects\">\n\t\t<effects>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</effects>\n\t</xsl:template>\n\t<xsl:template match=\"apiClassifierDetail\">\n\t\t<apiClassifierDetail>\n\t\t\t<xsl:apply-templates select=\"apiClassifierDef\"/>\n\t\t</apiClassifierDetail>\n\t</xsl:template>\n\t<xsl:template match=\"apiClassifierDef\">\n\t\t<apiClassifierDef>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</apiClassifierDef>\n\t</xsl:template>\n\t<xsl:template match=\"node()\">\n\t\t<xsl:copy copy-namespaces=\"no\">\n\t\t\t<xsl:copy-of select=\"@*\"/>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</xsl:copy>\n\t</xsl:template>\n</xsl:stylesheet>\n"
  },
  {
    "path": "documentation/api-reference/templates/eventsGeneratedSummary.xslt",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n\n\tADOBE SYSTEMS INCORPORATED\n\tCopyright 2008 Adobe Systems Incorporated\n\tAll Rights Reserved.\n\n\tNOTICE: Adobe permits you to use, modify, and distribute this file\n\tin accordance with the terms of the license agreement accompanying it.\n\n-->\n<xsl:stylesheet version=\"2.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n\t<xsl:output method=\"xml\" version=\"1.0\" encoding=\"UTF-8\" indent=\"yes\"/>\n\t<xsl:param name=\"ditaFileDir\" select=\"''\"/>\n\t<xsl:template match=\"/\">\n\t\t<allClasses>\n\t\t\t<xsl:apply-templates select=\"//apiItemRef\">\n\t\t\t\t<xsl:sort select=\"@href\" order=\"ascending\"/>\n\t\t\t</xsl:apply-templates>\n\t\t</allClasses>\n\t</xsl:template>\n\t<xsl:template match=\"apiItemRef\">\n\t\t<xsl:variable name=\"ditaFileName\">\n\t\t\t<xsl:value-of select=\"concat($ditaFileDir,@href)\"/>\n\t\t</xsl:variable>\n\t\t<xsl:for-each select=\"document($ditaFileName)/apiPackage\">\n\t\t\t<apiPackage id=\"{@id}\">\n\t\t\t\t<apiName>\n\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t</apiName>\n\t\t\t\t<xsl:apply-templates select=\"apiClassifier\"/>\n\t\t\t</apiPackage>\n\t\t</xsl:for-each>\n\t</xsl:template>\n\t<xsl:template match=\"apiClassifier\">\n\t\t<apiClassifier id=\"{@id}\">\n\t\t\t<apiName>\n\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t</apiName>\n\t\t\t<xsl:apply-templates select=\"shortdesc\"/>\n\t\t\t<xsl:apply-templates select=\"apiClassifierDetail\"/>\n\t\t\t<xsl:apply-templates select=\"adobeApiEvent\"/>\n\t\t</apiClassifier>\n\t</xsl:template>\n\t<xsl:template match=\"apiClassifierDetail\">\n\t\t<apiClassifierDetail>\n\t\t\t<xsl:apply-templates select=\"apiClassifierDef\"/>\n\t\t</apiClassifierDetail>\n\t\t<xsl:apply-templates select=\"apiDesc\"/>\n\t</xsl:template>\n\t<xsl:template match=\"apiDesc\">\n\t\t<apiDesc>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</apiDesc>\n\t</xsl:template>\n\t<xsl:template match=\"adobeApiEvent\">\n\t\t<adobeApiEvent id=\"{@id}\">\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</adobeApiEvent>\n\t</xsl:template>\n\t<xsl:template match=\"apiClassifierDef\">\n\t\t<apiClassifierDef>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</apiClassifierDef>\n\t</xsl:template>\n\t<xsl:template match=\"shortdesc\">\n\t\t<shortdesc>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</shortdesc>\n\t</xsl:template>\n\t<xsl:template match=\"node()\">\n\t\t<xsl:copy copy-namespaces=\"no\">\n\t\t\t<xsl:copy-of select=\"@*\"/>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</xsl:copy>\n\t</xsl:template>\n</xsl:stylesheet>\n"
  },
  {
    "path": "documentation/api-reference/templates/fieldSummary.xslt",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n\n\tADOBE SYSTEMS INCORPORATED\n\tCopyright 2008 Adobe Systems Incorporated\n\tAll Rights Reserved.\n\n\tNOTICE: Adobe permits you to use, modify, and distribute this file\n\tin accordance with the terms of the license agreement accompanying it.\n\n-->\n<xsl:stylesheet version=\"2.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:saxon=\"http://sf.net/saxon\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:ifn=\"urn:internal:functions\"\n\txmlns:ditaarch=\"http://dita.oasis-open.org/architecture/2005/\" exclude-result-prefixes=\"saxon xs ifn ditaarch\">\n\t<xsl:output method=\"xml\" version=\"1.0\" encoding=\"UTF-8\" indent=\"no\"/>\n\t<xsl:param name=\"ditaFileDir\" select=\"''\"/>\n\t<xsl:variable name=\"isConst\" select=\"'false'\"/>\n\t<xsl:variable name=\"accessLevel\" select=\"'public'\"/>\n\t<xsl:variable name=\"accessLevelpr\" select=\"'protected'\"/>\n\t<xsl:param name=\"configFilename\" select=\"'../../bin/ASDoc_Config.xml'\"/>\n\t<xsl:variable name=\"config\" select=\"document($configFilename)/asDocConfig\"/>\n\t<xsl:template match=\"/\">\n\t\t<allClasses>\n\t\t\t<xsl:apply-templates select=\"//apiItemRef\">\n\t\t\t\t<xsl:sort select=\"@href\" order=\"ascending\"/>\n\t\t\t</xsl:apply-templates>\n\t\t</allClasses>\n\t</xsl:template>\n\t<xsl:template match=\"apiItemRef\">\n\t\t<xsl:variable name=\"ditaFileName\">\n\t\t\t<xsl:value-of select=\"concat($ditaFileDir,@href)\"/>\n\t\t</xsl:variable>\n\t\t<xsl:for-each select=\"document($ditaFileName)/apiPackage\">\n\t\t\t<apiPackage id=\"{@id}\">\n\t\t\t\t<apiName>\n\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t</apiName>\n\t\t\t\t<xsl:apply-templates select=\"apiClassifier\"/>\n\t\t\t</apiPackage>\n\t\t</xsl:for-each>\n\t</xsl:template>\n\t<xsl:template match=\"apiClassifier\">\n\t\t<apiClassifier id=\"{@id}\">\n\t\t\t<apiName>\n\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t</apiName>\n\t\t\t<xsl:apply-templates select=\"shortdesc\"/>\n\t\t\t<xsl:apply-templates select=\"prolog\"/>\n\t\t\t<xsl:apply-templates select=\"apiClassifierDetail\"/>\n\t\t\t<xsl:apply-templates select=\"apiValue\"/>\n\t\t</apiClassifier>\n\t</xsl:template>\n\t<xsl:template match=\"apiValue\">\n\t\t<apiValue id=\"{@id}\">\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</apiValue>\n\t</xsl:template>\n\t<xsl:template name=\"getInheritDocText\">\n\t\t<xsl:param name=\"baseClass\"/>\n\t\t<xsl:param name=\"implementedInterface\"/>\n\t\t<xsl:param name=\"descriptionType\"/>\n\t\t<xsl:param name=\"entryType\"/>\n\t\t<xsl:param name=\"nameToMatch\"/>\n\t\t<xsl:param name=\"itemNameToMatch\"/>\n\t\t<xsl:param name=\"doNotProcessTags\" select=\"false()\"/>\n\t\t<xsl:for-each select=\"ancestor::apiClassifier/apiClassifierDetail/apiClassifierDef/apiBaseInterface\">\n\t\t\t<xsl:call-template name=\"inheritDocFromInterfaces\">\n\t\t\t\t<xsl:with-param name=\"implementedInterface\" select=\".\"/>\n\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"$descriptionType\"/>\n\t\t\t\t<xsl:with-param name=\"entryType\" select=\"$entryType\"/>\n\t\t\t\t<xsl:with-param name=\"nameToMatch\" select=\"$nameToMatch\"/>\n\t\t\t\t<xsl:with-param name=\"doNotProcessTags\" select=\"$doNotProcessTags\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:for-each>\n\t\t<xsl:call-template name=\"inheritDocFromBaseClass\">\n\t\t\t<xsl:with-param name=\"baseClass\" select=\"$baseClass\"/>\n\t\t\t<xsl:with-param name=\"descriptionType\" select=\"$descriptionType\"/>\n\t\t\t<xsl:with-param name=\"entryType\" select=\"$entryType\"/>\n\t\t\t<xsl:with-param name=\"nameToMatch\" select=\"$nameToMatch\"/>\n\t\t\t<xsl:with-param name=\"itemNameToMatch\" select=\"$itemNameToMatch\"/>\n\t\t\t<xsl:with-param name=\"doNotProcessTags\" select=\"$doNotProcessTags\"/>\n\t\t</xsl:call-template>\n\t</xsl:template>\n\t<xsl:template name=\"inheritDocFromInterfaces\">\n\t\t<xsl:param name=\"implementedInterface\"/>\n\t\t<xsl:param name=\"descriptionType\"/>\n\t\t<xsl:param name=\"entryType\"/>\n\t\t<xsl:param name=\"nameToMatch\"/>\n\t\t<xsl:param name=\"doNotProcessTags\" select=\"false()\"/>\n\t\t<xsl:for-each select=\"$implementedInterface\">\n\t\t\t<xsl:variable name=\"baseClass\" select=\".\"/>\n\t\t\t<xsl:variable name=\"className\">\n\t\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t\t<xsl:value-of select=\"substring-after($baseClass,':')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t\t<xsl:value-of select=\"$baseClass\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"packageName\">\n\t\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t\t<xsl:value-of select=\"substring-before($baseClass,':')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t\t<xsl:value-of select=\"__Global__\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"xslDocPath\">\n\t\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t\t<xsl:value-of select=\"concat($ditaFileDir,substring-before($baseClass,':'),'.xml')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t\t<xsl:value-of select=\"concat($ditaFileDir,'__Global__.xml')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:choose>\n\t\t\t\t<xsl:when test=\"$entryType='apiValue'\">\n\t\t\t\t\t<xsl:for-each select=\"document($xslDocPath)/apiPackage/apiClassifier[apiName=$className and apiClassifierDetail/apiClassifierDef/apiInterface]/apiValue[apiName=$nameToMatch]\">\n\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t<xsl:when test=\"$descriptionType='shortdesc'\">\n\t\t\t\t\t\t\t\t<xsl:for-each select=\"./shortdesc[normalize-space(.)!='']\">\n\t\t\t\t\t\t\t\t\t<shortdesc>\n\t\t\t\t\t\t\t\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t\t\t\t\t\t\t\t</shortdesc>\n\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t<xsl:when test=\"$descriptionType='apiDesc'\">\n\t\t\t\t\t\t\t\t<xsl:for-each select=\"./apiValueDetail/apiDesc[normalize-space(.)!='']\">\n\t\t\t\t\t\t\t\t\t<apiDesc>\n\t\t\t\t\t\t\t\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t\t\t\t\t\t\t\t</apiDesc>\n\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t</xsl:for-each>\n\t\t\t\t</xsl:when>\n\t\t\t</xsl:choose>\n\t\t\t<!-- Now process the base interface of the current interface-->\n\t\t\t<xsl:for-each select=\"document($xslDocPath)/apiPackage/apiClassifier[apiName=$className]/apiClassifierDetail/apiClassifierDef/apiBaseInterface\">\n\t\t\t\t<xsl:call-template name=\"inheritDocFromInterfaces\">\n\t\t\t\t\t<xsl:with-param name=\"implementedInterface\" select=\".\"/>\n\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"$descriptionType\"/>\n\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"$entryType\"/>\n\t\t\t\t\t<xsl:with-param name=\"nameToMatch\" select=\"$nameToMatch\"/>\n\t\t\t\t\t<xsl:with-param name=\"doNotProcessTags\" select=\"$doNotProcessTags\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:for-each>\n\t\t</xsl:for-each>\n\t</xsl:template>\n\t<xsl:template name=\"inheritDocFromBaseClass\">\n\t\t<xsl:param name=\"baseClass\"/>\n\t\t<xsl:param name=\"descriptionType\"/>\n\t\t<xsl:param name=\"entryType\"/>\n\t\t<xsl:param name=\"nameToMatch\"/>\n\t\t<xsl:param name=\"itemNameToMatch\"/>\n\t\t<xsl:param name=\"doNotProcessTags\" select=\"false()\"/>\n\t\t<xsl:variable name=\"className\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-after($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"$baseClass\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"packageName\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-before($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"__Global__\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"xslDocPath\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"concat($ditaFileDir,substring-before($baseClass,':'),'.xml')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"concat($ditaFileDir,'__Global__.xml')\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"$entryType='apiValue'\">\n\t\t\t\t<xsl:for-each select=\"document($xslDocPath)/apiPackage/apiClassifier[apiName=$className and not(apiClassifierDetail/apiClassifierDef/apiInterface)]/apiValue[apiName=$nameToMatch]\">\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"$descriptionType='shortdesc'\">\n\t\t\t\t\t\t\t<xsl:for-each select=\"./shortdesc[normalize-space(.)!='']\">\n\t\t\t\t\t\t\t\t<shortdesc>\n\t\t\t\t\t\t\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t\t\t\t\t\t\t</shortdesc>\n\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:when test=\"$descriptionType='apiDesc'\">\n\t\t\t\t\t\t\t<xsl:for-each select=\"./apiValueDetail/apiDesc[normalize-space(.)!='']\">\n\t\t\t\t\t\t\t\t<apiDesc>\n\t\t\t\t\t\t\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t\t\t\t\t\t\t</apiDesc>\n\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:when>\n\t\t</xsl:choose>\n\t\t<!-- Now process the base class till object reached-->\n\t\t<xsl:if test=\"not($className='Object')\">\n\t\t\t<xsl:variable name=\"newBaseClass\"\n\t\t\t\tselect=\"document($xslDocPath)/apiPackage/apiClassifier[apiName=$className and not(apiClassifierDetail/apiClassifierDef/apiInterface)]/apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t<xsl:if test=\"string-length($newBaseClass) &gt; 0\">\n\t\t\t\t<xsl:call-template name=\"inheritDocFromBaseClass\">\n\t\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"$newBaseClass\"/>\n\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"$descriptionType\"/>\n\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"$entryType\"/>\n\t\t\t\t\t<xsl:with-param name=\"nameToMatch\" select=\"$nameToMatch\"/>\n\t\t\t\t\t<xsl:with-param name=\"itemNameToMatch\" select=\"$itemNameToMatch\"/>\n\t\t\t\t\t<xsl:with-param name=\"doNotProcessTags\" select=\"$doNotProcessTags\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:if>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getConRefText\">\n\t\t<xsl:param name=\"conref\"/>\n\t\t<xsl:param name=\"descriptionType\"/>\n\t\t<xsl:param name=\"entryType\"/>\n\t\t<xsl:param name=\"doNotProcessTags\" select=\"false()\"/>\n\t\t<xsl:param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t<xsl:if test=\"string-length($conref) &gt; 0\">\n\t\t\t<xsl:variable name=\"relativePath\">\n\t\t\t\t<xsl:call-template name=\"getRelativePath\">\n\t\t\t\t\t<xsl:with-param name=\"currentPath\" select=\"$currentPackage\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"packageClassText\">\n\t\t\t\t<xsl:if test=\"contains($conref,'#') and contains(substring-before($conref,'#'),'.')\">\n\t\t\t\t\t<xsl:value-of select=\"substring-before($conref,'#')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"contains($conref,'#') and not(contains(substring-before($conref,'#'),'.'))\">\n\t\t\t\t\t<xsl:value-of select=\"concat($currentPackage,'.',substring-before($conref,'#'))\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(contains($conref,'#'))\">\n\t\t\t\t\t<xsl:value-of select=\"$conref\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"className\">\n\t\t\t\t<xsl:if test=\"contains($conref,'#') and contains(substring-before($conref,'#'),'.')\">\n\t\t\t\t\t<xsl:call-template name=\"lastIndexOf\">\n\t\t\t\t\t\t<xsl:with-param name=\"string\" select=\"$packageClassText\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"char\" select=\"'.'\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"contains($conref,'#') and not(contains(substring-before($conref,'#'),'.'))\">\n\t\t\t\t\t<xsl:if test=\"string-length(substring-before($conref,'#')) = 0\">\n\t\t\t\t\t\t<xsl:value-of select=\"ancestor-or-self::apiPackage/apiClassifier/apiName\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"string-length(substring-before($conref,'#')) &gt; 0\">\n\t\t\t\t\t\t<xsl:value-of select=\"substring-before($conref,'#')\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"destPackageName1\">\n\t\t\t\t<xsl:value-of select=\"substring-before($packageClassText,concat('.',$className))\"/>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"destPackageName\">\n\t\t\t\t<xsl:if test=\"$destPackageName1 = '' or $destPackageName1='__Global__'\">\n\t\t\t\t\t<xsl:value-of select=\"'__Global__.xml'\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not($destPackageName1='') and not($destPackageName1='__Global__')\">\n\t\t\t\t\t<xsl:value-of select=\"concat($destPackageName1, '.xml')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"entryTypeNameText\" select=\"substring-after($conref,'#')\"/>\n\t\t\t<xsl:variable name=\"nameToMatch\">\n\t\t\t\t<xsl:if test=\"string-length($entryTypeNameText) = 0\">\n\t\t\t\t\t<xsl:value-of select=\"$className\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"contains($entryTypeNameText,':')\">\n\t\t\t\t\t<xsl:value-of select=\"substring-after($entryTypeNameText,':')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(contains($entryTypeNameText,':')) and string-length($entryTypeNameText) &gt; 0\">\n\t\t\t\t\t<xsl:if test=\"contains($entryTypeNameText,')')\">\n\t\t\t\t\t\t<xsl:value-of select=\"substring-before($entryTypeNameText,'(')\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"not(contains($entryTypeNameText,')'))\">\n\t\t\t\t\t\t<xsl:value-of select=\"$entryTypeNameText\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"entryType\">\n\t\t\t\t<xsl:if test=\"string-length($entryTypeNameText) = 0\">\n\t\t\t\t\t<xsl:value-of select=\"'class'\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"contains($entryTypeNameText,':')\">\n\t\t\t\t\t<xsl:value-of select=\"substring-before($entryTypeNameText,':')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(contains($entryTypeNameText,':')) and string-length($entryTypeNameText) &gt; 0\">\n\t\t\t\t\t<xsl:if test=\"contains($entryTypeNameText,')')\">\n\t\t\t\t\t\t<xsl:value-of select=\"'method'\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"not(contains($entryTypeNameText,')'))\">\n\t\t\t\t\t\t<xsl:value-of select=\"'property'\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:for-each select=\"document(concat($ditaFileDir,$destPackageName))/apiPackage//apiClassifier[apiName=$className]\">\n\t\t\t\t<xsl:if test=\"string-length($entryType) &gt; 0\">\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"contains($entryType,'property')\">\n\t\t\t\t\t\t\t<xsl:variable name=\"property.desc\">\n\t\t\t\t\t\t\t\t<xsl:for-each select=\"./apiValue[apiName=$nameToMatch]\">\n\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$descriptionType='shortdesc'\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./shortdesc[@conref]\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"./shortdesc/@conref\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"local-name(./shortdesc)\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(./shortdesc[@conref])\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"./shortdesc/.\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./apiValueDetail/apiDesc[@conref]\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"./apiValueDetail/apiDesc/@conref\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"local-name(./apiValueDetail/apiDesc)\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(./apiValueDetail/apiDesc[@conref])\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"./apiValueDetail/apiDesc\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t<xsl:variable name=\"skin.desc\">\n\t\t\t\t\t\t\t\t<xsl:for-each select=\"./prolog/asMetadata/skinParts/SkinPart[@name=$nameToMatch]\">\n\t\t\t\t\t\t\t      <xsl:choose>\n\t\t\t\t\t\t\t        <xsl:when test=\"$descriptionType='shortdesc'\">\n\t\t\t\t\t\t\t          <xsl:if test=\"./shortdesc[@conref]\">\n\t\t\t\t\t\t\t            <xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t\t              <xsl:with-param name=\"conref\" select=\"./shortdesc/@conref\"/>\n\t\t\t\t\t\t\t              <xsl:with-param name=\"descriptionType\" select=\"local-name(./shortdesc)\"/>\n\t\t\t\t\t\t\t            </xsl:call-template>\n\t\t\t\t\t\t\t          </xsl:if>\n\t\t\t\t\t\t\t          <xsl:if test=\"not(./shortdesc[@conref])\">\n\t\t\t\t\t\t\t            <xsl:for-each select=\"./shortdesc/.\">\n\t\t\t\t\t\t\t              <xsl:apply-templates select=\"node()\"/>\n\t\t\t\t\t\t\t            </xsl:for-each>\n\t\t\t\t\t\t\t          </xsl:if>\n\t\t\t\t\t\t\t        </xsl:when>\n\t\t\t\t\t\t\t        <xsl:otherwise>\n\t\t\t\t\t\t\t          <xsl:if test=\"./description[@conref]\">\n\t\t\t\t\t\t\t            <xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t\t              <xsl:with-param name=\"conref\" select=\"./description/@conref\"/>\n\t\t\t\t\t\t\t              <xsl:with-param name=\"descriptionType\" select=\"local-name(./description)\"/>\n\t\t\t\t\t\t\t            </xsl:call-template>\n\t\t\t\t\t\t\t          </xsl:if>\n\t\t\t\t\t\t\t          <xsl:if test=\"not(./description[@conref])\">\n\t\t\t\t\t\t\t            <xsl:for-each select=\"./description\">\n\t\t\t\t\t\t\t              <xsl:apply-templates select=\"node()\"/>\n\t\t\t\t\t\t\t            </xsl:for-each>\n\t\t\t\t\t\t\t          </xsl:if>\n\t\t\t\t\t\t\t        </xsl:otherwise>\n\t\t\t\t\t\t\t      </xsl:choose>\n\t\t\t\t\t\t\t    </xsl:for-each>\t\t\t\t\t\t\n\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t<xsl:if test=\"$property.desc=''\">\n\t\t\t\t\t\t\t\t<xsl:copy-of select=\"$skin.desc\" copy-namespaces=\"no\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"$property.desc!=''\">\n\t\t\t\t\t\t\t\t<xsl:copy-of select=\"$property.desc\" copy-namespaces=\"no\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:for-each>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getRelativePath\">\n\t\t<xsl:param name=\"currentPath\"/>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"not($currentPath) or $currentPath='__Global__'\">\n\t\t\t\t<xsl:value-of select=\"''\"/>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:if test=\"contains($currentPath,'.')\">\n\t\t\t\t\t<xsl:call-template name=\"getRelativePath\">\n\t\t\t\t\t\t<xsl:with-param name=\"currentPath\" select=\"substring-after($currentPath,'.')\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:value-of select=\"'../'\"/>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template name=\"lastIndexOf\">\n\t\t<xsl:param name=\"string\"/>\n\t\t<xsl:param name=\"char\"/>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"contains($string, $char)\">\n\t\t\t\t<xsl:call-template name=\"lastIndexOf\">\n\t\t\t\t\t<xsl:with-param name=\"string\" select=\"substring-after($string, $char)\"/>\n\t\t\t\t\t<xsl:with-param name=\"char\" select=\"$char\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:value-of select=\"$string\"/>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template match=\"apiClassifierDetail\">\n\t\t<apiClassifierDetail>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</apiClassifierDetail>\n\t</xsl:template>\n\t<xsl:template match=\"apiClassifierDef\">\n\t\t<apiClassifierDef>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</apiClassifierDef>\n\t</xsl:template>\n\t<xsl:template match=\"shortdesc\">\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"parent::apiValue/apiValueDetail/apiValueDef/apiInheritDoc\">\n\t\t\t\t<xsl:if test=\"ancestor::apiClassifier/apiClassifierDetail/apiClassifierDef/apiBaseClassifier or ancestor::apiClassifier/apiClassifierDetail/apiClassifierDef/apiBaseInterface \">\n\t\t\t\t\t<xsl:call-template name=\"getInheritDocText\">\n\t\t\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"ancestor::apiClassifier/apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"implementedInterface\" select=\"ancestor::apiClassifier/apiClassifierDetail/apiClassifierDef/apiBaseInterface\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"'shortdesc'\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"'apiValue'\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"nameToMatch\" select=\"parent::apiValue/apiName\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:when>\n\t\t\t<xsl:when test=\"@conref\">\n\t\t\t\t<xsl:variable name=\"entryType\" select=\"'property'\"/>\n\t\t\t\t<xsl:variable name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t<shortdesc>\n\t\t\t\t\t<xsl:if test=\"normalize-space(.)\">\n\t\t\t\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"@conref\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"'shortdesc'\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"$entryType\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t\t\t</xsl:call-template>\n\n\t\t\t\t</shortdesc>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<shortdesc>\n\t\t\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t\t\t</shortdesc>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template match=\"apiDesc\">\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"@conref\">\n\t\t\t\t<xsl:variable name=\"entryType\" select=\"'property'\"/>\n\t\t\t\t<xsl:variable name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t<apiDesc>\n\t\t\t\t\t<xsl:if test=\"normalize-space(.)\">\n\t\t\t\t\t\t<p class=\"- topic/p \">\n\t\t\t\t\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"@conref\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"'apiDesc'\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"$entryType\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</apiDesc>\n\t\t\t</xsl:when>\n\t\t</xsl:choose>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"not(parent::apiValueDetail/apiValueDef/apiInheritDoc)\">\n\t\t\t\t<apiDesc>\n\t\t\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t\t\t</apiDesc>\n\t\t\t</xsl:when>\n\t\t\t<xsl:when test=\"parent::apiValueDetail/apiValueDef/apiInheritDoc\">\n\t\t\t\t<xsl:if test=\"ancestor::apiClassifier/apiClassifierDetail/apiClassifierDef/apiBaseClassifier or ancestor::apiClassifier/apiClassifierDetail/apiClassifierDef/apiBaseInterface \">\n\t\t\t\t\t<xsl:call-template name=\"getInheritDocText\">\n\t\t\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"ancestor::apiClassifier/apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"implementedInterface\" select=\"ancestor::apiClassifier/apiClassifierDetail/apiClassifierDef/apiBaseInterface\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"'apiDesc'\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"'apiValue'\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"nameToMatch\" select=\"ancestor::apiValue/apiName\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:when>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template match=\"related-links\">\n\t\t<related-links>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</related-links>\n\t</xsl:template>\n\t<xsl:template match=\"example\">\n\t\t<example>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</example>\n\t</xsl:template>\n\t<xsl:template match=\"prolog\">\n\t\t<prolog>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</prolog>\n\t</xsl:template>\n\t<xsl:template match=\"styles\"/>\n\t<xsl:template match=\"node()\">\n\t\t<xsl:copy copy-namespaces=\"no\">\n\t\t\t<xsl:copy-of select=\"@*\"/>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</xsl:copy>\n\t</xsl:template>\n</xsl:stylesheet>\n"
  },
  {
    "path": "documentation/api-reference/templates/help.js",
    "content": "////////////////////////////////////////////////////////////////////////////////\n//\n//  ADOBE SYSTEMS INCORPORATED\n//  Copyright 2008 Adobe Systems Incorporated\n//  All Rights Reserved.\n//\n//  NOTICE: Adobe permits you to use, modify, and distribute this file\n//  in accordance with the terms of the license agreement accompanying it.\n//\n////////////////////////////////////////////////////////////////////////////////\n\n\nfunction closePopup()\n{\n  window.close();\n}\nfunction scrollToNameAnchor() \n{\n\tvar nameAnchor = window.location.href;\n\tvar value = nameAnchor.split(\"nameAnchor=\");\n\t\n\tif (value[1] != null) { \n\t\tdocument.location =value[0]+\"#\"+ value[1];\n\t}\n}\n// HIDES AND SHOWS LARGE GRAPHICS IN THE CONTENT PAGES\nfunction showHideImage(thisID, obj) \n{\n\t\n\tvar imgElement = document.getElementById(thisID);\n\tvar imgText = obj;\n\n\tif( imgElement.className == \"largeImage\" )\n\t{\n\t\t\timgElement.src = \"images/\" + thisID + \".png\";\n\t\t\timgElement.className=\"smallImage\";\n\t\t\tobj.className=\"showImageLink\";\n\t\t\tobj.href=\"#\";\n\t\t\tobj.firstChild.nodeValue = terms_AHV_LARGE_GRAPHIC;\n\t\t\twindow.focus();\n\t}\n\telse\n\t{\n\t\t\timgElement.src = \"images/\" + thisID + \"_popup.png\";\n\t\t\timgElement.className=\"largeImage\";\n\t\t\tobj.className=\"hideImageLink\";\n\t\t\tobj.href=\"#\";\n\t\t\tobj.firstChild.nodeValue = terms_AHV_SMALL_GRAPHIC;\n\t\t\twindow.focus();\n\t}\n}\n// js function for expand collapse menu functionality\nfunction KeyCheck(e, tree, idx)\n{\n  var KeyID = (window.event) ? event.keyCode : e.keyCode;\n  var node =  YAHOO.widget.TreeView.getNode(tree, idx);\n   switch(KeyID)\n   {\n      case 37:\n     // alert(\"Arrow Left\");\n      node.collapse();\n      break;\n      case 39:\n     // alert(\"Arrow Right\");\n      node.expand();\n      break;\n   }\n}\n// js function for hide/display mini-elements functionality\nfunction toggleLayer(whichLayer) {\n\tif (document.getElementById) {\n\t\t// this is the way the standards work\n\t\tvar obj=document.getElementById(whichLayer);\n\t\tvar img = obj.previousSibling.firstChild.firstChild;\n\t\timg.setAttribute(\"src\",\"images/on.gif\");\n\t\tvar styleatt = obj.style;\n\t\tstyleatt.display = styleatt.display? \"\":\"block\";\n\t\t\n\t\t//change the class of the h3 per design\n\t\tif (obj.previousSibling.className === \"topictitle3\")\t{\n\t\t\tobj.previousSibling.className =\"topictitle3off\";\n\t\t    img.setAttribute(\"src\",\"images/on.gif\");\n\t\t} else if (obj.previousSibling.className === \"topictitle3off\")\t{\n\t\t\tobj.previousSibling.className =\"topictitle3\";\n\t\t\timg.setAttribute(\"src\",\"images/off.gif\");\n\t\t} \n\t}\n\telse if (document.all) {\n\t\t// this is the way old msie versions work\n\t\tvar style2 = document.all[whichLayer].style;\n\t\tstyle2.display = style2.display? \"\":\"block\";\n\t}\n}\n function addBookmark( bm_url_str, bm_str_label ) {\n  parent.navigation.flashProxy.call('addBookmark', bm_url_str, bm_str_label );\n}\n\nvar upperAsciiXlatTbl = new Array(\n223,\"ss\",\n230,\"ae\",\n198,\"ae\",\n156,\"oe\",\n140,\"oe\",\n240,\"eth\",\n208,\"eth\",\n141,\"y\",\n159,\"y\"\n);\n\nvar maxNumberOfShownSearchHits = 30;\nvar showInputStringAlerts = 0;\nvar navigationCookie = \"\";\n\n////////////// COOKIE-RELATED FUNCTIONS /////////////////////////////////////////\n//  test the navigator object for cookie enabling\n//  additional code would need to be added for\n//  to support browsers pre navigator 4 or IE5 or \n//  other browsers that dont support\n//  the navigator object if any .. \n function cookiesNotEnabled() \n{\n\treturn true;     // We're not going to use cookies\n}\n/*\n * This function parses comma-separated name=value \n * argument pairs from the query string of the URL. \n * It stores the name=value pairs in \n * properties of an object and returns that object.\n */\nfunction getArgs() \n{\n\tvar args = new Object();\n\tvar query = window.location.search.substring(1); \n\t// Get query string\n\tif (query.length > 0)\t{\n\t\tvar pairs = query.split(\",\");\n\t\t// Break at comma\n\t\tfor(var i = 0; i < pairs.length; i++) \n\t\t{\n\t\t\tvar pos = pairs[i].indexOf('=');\n\t\t\t  // Look for \"name=value\"\n\t\t\tif (pos == -1) continue;\n\t\t\t  // If not found, skip\n\t\t\tvar argname = pairs[i].substring(0,pos);\n\t\t\t  // Extract the name\n\t\t\tvar value = pairs[i].substring(pos+1);\n\t\t\t  // Extract the value\n\t\t\targs[argname] = unescape(value);\n\t\t  \t  // Store as a property\n\t\t\t  // In JavaScript 1.5, use decodeURIComponent(  ) \n\t\t\t  // instead of escape(  )\n\t\t}\n\t} else {\n\t\targs[name] = false;\t\t\n\t}\n\treturn args;     // Return the object\n}\n\n/////////////////////////////// COOKIE-RELATED FUNCTIONS ////////////////////////\n// Bill Dortch getCookieVal and GetCookie routines\nfunction getCookieVal(offset) {\n  var endstr=document.cookie.indexOf(\";\",offset);\n  if (endstr==-1)endstr=document.cookie.length;\n  return unescape(document.cookie.substring(offset, endstr));\n}\nfunction GetCookie(name) {\n  var arg=name+\"=\";\n  var alen=arg.length;\n  var clen=document.cookie.length;\n  var i=0;\n\n  if (cookiesNotEnabled())\n  {\n\tvar args = getArgs();\n\tif (args[name] !== false) { \n\t\treturn args[name];\n\t}\t\n  } else {\n\t  while(i<clen){\n\t    var j=i+alen;\n\t    if(document.cookie.substring(i,j)==arg)return getCookieVal(j);\n\t    i=document.cookie.indexOf(\" \",i)+1;\n\t    if(i==0)break; \n\t  }\n\t  return null;\n\t}\n}\nfunction getTopCookieVal(offset) {\n  var endstr=document.cookie.indexOf(\";\",offset);\n  if (endstr==-1)endstr=document.cookie.length;\n  return unescape(document.cookie.substring(offset, endstr));\n}\nfunction GetTopCookie(name) {\n  var arg=name+\"=\";\n  var alen=arg.length;\n  var clen=document.cookie.length;\n  var i=0;\n  while(i<clen){\n    var j=i+alen;\n    if(document.cookie.substring(i,j)==arg)return getTopCookieVal(j);\n    i=document.cookie.indexOf(\" \",i)+1;\n    if(i==0)break; \n  }\n  return null;\n}\n// SetCookie\n// -----------\n// This function is called to set a cookie in the current document.\n//  params:\n//\t\tn - name of the cookie\n//\t\tv - value of the cookie\n//\t\tminutes - the duration of the cookie in minutes (that is, how many minutes before it expires)\nfunction SetCookie(n,v,minutes) {\n var Then = new Date();\n Then.setTime(Then.getTime() + minutes * 60 * 1000);\n document.cookie = n + \"=\" + v + \";expires=\" + Then.toGMTString();\n}\n// getContentCookie\n// ----------------\n// This function reads the content cookie set by the handleContext funtion.\n//\nfunction getContentCookie()\n{\n\tvar contentCookie = GetCookie(\"content\");\n\tdocument.cookie = \"content=\";\n\n\t// What does this expression mean?\n\t// (contentCookie.indexOf(\"htm\") != -1)\n\tif ( (contentCookie != null) && (contentCookie.indexOf(\"htm\") != -1) ) \n\t{\n\t\tdocument.cookie = \"content=\"; // Wipe out the cookie\n\t\tdocument.cookie = \"histR=\" + contentCookie;\n\t\tlocation.replace(contentCookie);\n\t}\t\t\t\n}\n// getNavigationCookie\n// -------------------\n// This function reads the content cookie set by the handleContext funtion.\n//\nfunction getNavigationCookie()\n{\n\tnavigationCookie = GetCookie(\"navigation\");\n\tdocument.cookie = \"navigation=\";\n\n\t// What does this expression mean?\n\t// (navigationCookie.indexOf(\"htm\") != -1)\n\tif ( (navigationCookie != null) && (navigationCookie.indexOf(\"htm\") != -1) ) \n\t{\n\t\tdocument.cookie = \"navigation=\"; // Wipe out the cookie\n\t\tdocument.cookie = \"histL=\" + navigationCookie;\n\t\tlocation.replace(navigationCookie);\n\t}\n\t\t\t\t\n}\n\n// handleContext\n// -------------\n// This function is called from content pages. It sets a cookie as soon\n// as the page is loaded. If the content page is not in it's proper place\n// in the frameset, the frameset will be loaded and the page will be \n// restored using the value in this cookie.\n//\nfunction handleContext(which)\n{\n}\n// lastNodeOf\n// ----------\n// This function gets passed a URL and returns the last node of same.\nfunction lastNodeOf(e)\n{\n\tvar expr = \"\" + e;\n\tvar to = expr.indexOf(\"?\");\n\tif( to !== -1) {\n\t\tvar path = expr.substring(0,to);\t\t\n\t\tvar pieces = path.split(\"/\");\n\t\treturn pieces[pieces.length -1];\n\t}  else\t{\t\n\t\tvar pos = expr.lastIndexOf(\"/\");\t\n\t\tif( (pos != -1) && (pos+1 != expr.length) ) {\n\t\t\treturn expr.substr(pos+1);\n\t\t} else {\n\t\t\treturn expr;\n\t\t}\n\t}\n}\n// frameBuster\n// -----------\n// This function is called by the frameset to ensure it's always loaded\n// at the top level of the current window.\n//\nfunction frameBuster()\n{\n}\n\n\n// SEARCH RELATED.......................................SEARCH RELATED\n// SEARCH RELATED.......................................SEARCH RELATED\n// SEARCH RELATED.......................................SEARCH RELATED\n// SEARCH RELATED.......................................SEARCH RELATED\n// SEARCH RELATED.......................................SEARCH RELATED\n// SEARCH RELATED.......................................SEARCH RELATED\n// SEARCH RELATED.......................................SEARCH RELATED\n// SEARCH RELATED.......................................SEARCH RELATED\n// SEARCH RELATED.......................................SEARCH RELATED\n// SEARCH RELATED.......................................SEARCH RELATED\nfunction bubbleSortWithShadow(a,b)\n{\n\tvar temp;\n\tfor(var j=1; j<a.length; j++) {\n\t\tfor(var i=0; i<j; i++) {\n\t\t\tif( a[i] < a[j] ) {\t\n\t\t\t\ttemp = a[j];a[j] = a[i];a[i] = temp;\n\t\t\t\ttemp = b[j];b[j] = b[i];b[i] = temp;\n\t\t\t}\n\t\t}\n\t}\n}\n//---------------------------------------------------\nfunction buildHtmlResultsStr()\n{\n\tvar innerHTMLstring,ndxEnd;\n\n\t// Gather all of the results display lines into the 'resultsArr'\n\tndxEnd = (matchesArrIndices.length > maxNumberOfShownSearchHits ) ? maxNumberOfShownSearchHits : matchesArrIndices.length;\n\n\tfor(var ndx=0, resultsArr = new Array(); ndx < ndxEnd; ndx++) {\n\t\tresultsArr[resultsArr.length] = buildResultsStrOneLine(matchesArrIndices[ndx],matchesArrHits[ndx]);\n\t}\n\n\t// Convert this 'resultsArr' into a single string that will be injected into this search page.\n\tinnerHTMLstring = \"<ol>\";\n\tfor( var ndx=0; ndx < resultsArr.length; ndx++ ) {\n\t\tinnerHTMLstring = innerHTMLstring + resultsArr[ndx];\n\t}\n\tinnerHTMLstring = innerHTMLstring + \"</ol>\";\n\treturn innerHTMLstring;\n}\n//---------------------------------------------------\nfunction buildResultsStrOneLine(a,b)\n{\n\tvar retStr;\n\tretStr = \"<li class=\\\"searchresults\\\"><a href=\\\"\" + fileArr[a] + \".html\\\">\";\n\n\t// for debug...\n\t//retStr += \"target=\\\"content\\\" \";\n\t//retStr += \"title=\\\"\" + top.fileArr[a] + \".html-\";\n\t//retStr += a + \"-\" + b + \"\\\">\";\n\n\t// for production...\n\t//retStr += \"target=\\\"AdobeHelp\\\" >\";\n\n\tretStr += titleArr[a] + \"</a></li>\";\n\treturn retStr;\n}\n//---------------------------------------------------\n// checkForHits\n//  Break up the search term into words.\n//  Check each of those words against...\n//\t\t(a) cached titles and \n//\t\t(b) cached content lines \n//  Perform the hit detection for each one, \n//  storing the results into (hits-ordered) \n//\t\t'matchesArrIndices' and \n//\t\t'matchesArrHits'.\n//---------------------------------------------------\nfunction checkForHits()\n{\n\tvar inputWords = new Array();\n\tvar tempArr = new Array();\n\n\t// Split the search term into individual search words\n\t\ttempArr = searchTerm.split(\" \");\n\t\tfor(var ndx=0; ndx < tempArr.length; ndx++) {\n\t\t\tif( tempArr[ndx].length ) {\n\t\t\t\tinputWords[inputWords.length] = tempArr[ndx];\n\t\t\t}\n\t\t}\n\n\t// Initialization\n\t\tmatchesArrHits = new Array();\n\t\tmatchesArrIndices = new Array();\n\n\t// Initialize the 'maskArr' and the 'hitsArr'\n\t\tmaskArr = new Array();\n\t\thitsArr = new Array();\n\t\tfor( var ndx = 0; ndx < fileArr.length; ndx++ ) {\n\t\t\tmaskArr[maskArr.length] = 1;\n\t\t\thitsArr[hitsArr.length] = 0;\n\t\t}\n\n\t// Do checking for matches on EACH OF THE INPUT WORDS\n\t\tfor( var ndx = 0; ndx < inputWords.length; ndx++ ) {\n\n\t\t\t// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\t\t\tif( ! checkForHitsWordAgainstPages( inputWords[ndx] ) ) {\n\t\t\t\treturn; \t// No sense in continuing, match has failed.\n\t\t\t}\n\t\t\t// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n\t\t\tfor( var ndx2 = 0; ndx2 < hitsArr.length; ndx2++ ) {\n\t\t\t\tif( hitsArr[ndx2] == 0 ) {\n\t\t\t\t\tmaskArr[ndx2] = 0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif( maskArr[ndx2] != 0 ) {\n\t\t\t\t\t\tmaskArr[ndx2] += hitsArr[ndx2];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t// From the final 'maskArr', generate 'matchesArrHits' and 'matchesArrIndices'\t\n\t\tfor( var ndx = 0; ndx < maskArr.length; ndx++ ) {\n\t\t\tif( maskArr[ndx] ) {\n\t\t\t\tmatchesArrHits[matchesArrHits.length] = maskArr[ndx];\n\t\t\t\tmatchesArrIndices[matchesArrIndices.length] = ndx;\n\t\t\t}\n\t\t}\n\n\t// If there were any hits, then sort them by highest hits first\n\t\tif( matchesArrIndices.length ) {\n\t\t\tbubbleSortWithShadow(matchesArrHits, matchesArrIndices);\n\t\t}\n}\n//---------------------------------------------------\nfunction checkForHitsWordAgainstPages(w)\t\t\n{\n\tvar hitAnywhere = 0;\n\t\n\tif(showInputStringAlerts){alert( \"Length of sc2: \" + sc2.length );}\n\n\t// Process each of the content lines (one per file/page)\n\t\tfor(var ndx=0; ndx < sc2.length; ndx++) {\n\n\t\t\t// Put the cached title into glob_title\n\t\t\t\tglob_title = sc1[ndx];\n\n\t\t\t// Put the cached content line into glob_phrase\n\t\t\t\tglob_phrase = sc2[ndx];\n\t\t\t\t\n\t\t\tif( maskArr[ndx] ) {\n\t\t\t// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\t\t\t\tif( document.isDblByte ) {\n\t\t\t\t\thitsArr[ndx] = checkForHitsWordAgainstTitleAndLine2(w,ndx);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\thitsArr[ndx] = checkForHitsWordAgainstTitleAndLine(w,ndx);\n\t\t\t\t}\n\t\t\t\tif( hitsArr[ndx] ) {\n\t\t\t\t\thitAnywhere = 1;\n\t\t\t\t}\n\t\t\t// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\t\t\t}\n\t\t}\n\treturn hitAnywhere;\n}\n//---------------------------------------------------\nfunction checkForHitsWordAgainstTitleAndLine(w, lineNdx)\n{\n\tvar words;\n\tvar titleHitCnt = 0;\n\tvar contentHitCnt = 0;\n\tvar regex = new RegExp(w, \"i\");\n\n\t// TITLE .........................................\n\t\twords = new Array();\n\t\tif(glob_title!=null){\n\t\t\twords = glob_title.split(\" \");\n\t\t}\n\t\t// EXECUTE TITLE MATCH TEST\n\t\tfor( var ndx = 0; ndx < words.length; ndx++ ) {\n\t\t\tif( w == words[ndx] ) {\n\t\t\t\ttitleHitCnt += 100;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t// CONTENT .........................................\n\t\twords = new Array();\n\t\tif(glob_phrase!=null){\n\t\t\twords = glob_phrase.split(\" \");\n\t\t}\n\t\t// EXECUTE CONTENT MATCH TEST\n\t\tif( regex.test(glob_phrase) ) {\t// See if word is anywhere within the phrase first.\n\t\t\tfor( var ndx = 0; ndx < words.length; ndx++ ) {\n\t\t\t\tif( w == words[ndx] ) {\n\t\t\t\t\tcontentHitCnt += getInstanceCount(lineNdx,ndx);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t//else if( w < words[ndx] ) { // If word is greater than the remaining words, leave\n\t\t\t\t//\tbreak;\n\t\t\t\t//}\n\t\t\t}\n\t\t}\n\n\treturn titleHitCnt + contentHitCnt;\n}\n//---------------------------------------------------\nfunction checkForHitsWordAgainstTitleAndLine2(w, lineNdx)\n{\n\tvar titleHitCnt = 0;\n\tvar contentHitCnt = 0;\n\n\t// TITLE .........................................\n\t\tif( glob_title.indexOf(w) != -1 ) {\n\t\t\ttitleHitCnt = 100;\n\t\t}\n\n\t// CONTENT .........................................\n\t\tcontentHitCnt = indexesOf(glob_phrase,w);\n\n\treturn titleHitCnt + contentHitCnt;\n}\n//---------------------------------------------------\n// checkTheInputString\n// \n//  returns...\n//\t\tempty string - if there is valid input to search\n//\t\tmessage string - if there is NO VALID INPUT to search\n//---------------------------------------------------\nfunction checkTheInputString()\n{\n\tvar myArr = new Array();\n\tvar tempArr = new Array();\n\tvar foundStopOrShortWord = 0;\n\tvar ptn1 = /\\d\\D/;\n\tvar ptn2 = /\\D\\d/;\n\n\thandleWhitespaceRemoval();\n\tsearchTerm = searchTerm.replace (/(%20)+/g,\" \") ;\n\tsearchTerm = searchTerm.toLowerCase();\n\n\tsearchTerm = filterTheChars(searchTerm);\n\t\t\n\thandleWhitespaceRemoval();\n\n\tif( searchTerm.length ) {\n\t\t\n\t\t// Split the searchTerm\n\t\t\ttempArr = searchTerm.split(\" \",100);\n\t\t\tif(showInputStringAlerts){alert( \"size of tempArr: \" + tempArr.length );}\n\n\t\t// Handle periods\n\t\t\tfor( var ndx = 0; ndx < tempArr.length; ndx++ ) {\n\t\t\t\tif( tempArr[ndx].charCodeAt(0) == 46 ) {\t// periods at the start of word\n\t\t\t\t\t//tempArr[ndx] = tempArr[ndx].substr(1); // NOTE: We don't want to do this. (e.g. \".txt\")\n\t\t\t\t}\n\t\t\t\tif( tempArr[ndx].charCodeAt(tempArr[ndx].length-1) == 46 ) { // end of word\n\t\t\t\t\ttempArr[ndx] = tempArr[ndx].substr(0,tempArr[ndx].length-1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t// Do stopwords and shortwords removal\n\t\t\tfor( var ndx = 0; ndx < tempArr.length; ndx++ ) {\n\t\t\t\tvar word = tempArr[ndx];\n\t\t\t\tif(showInputStringAlerts){alert( \"Checking word: \" + word );}\n\t\t\t\t\n\t\t\t\tif( ! sw[word] ) {\n\t\t\t\t\tif( word.length < 2 ) {\n\t\t\t\t\t\tfoundStopOrShortWord = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse if( (word.length > 2) || (ptn1.test(word) || ptn2.test(word)) ) {\n\t\t\t\t\t\tmyArr[myArr.length] = tempArr[ndx];\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tfoundStopOrShortWord = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tfoundStopOrShortWord = 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Now reconstruct the searchTerm, based upon the 'myArr'\n\t\t\tsearchTerm = \"\";\n\t\t\tfor( var ndx = 0; ndx < myArr.length; ndx++ ) {\n\t\t\t\tsearchTerm = searchTerm + myArr[ndx] + \" \";\n\t\t\t}\n\n\t\thandleWhitespaceRemoval();\n\n\t\tif(showInputStringAlerts){alert( \"FINAL SEARCH TERM: *\" + searchTerm + \"*\" );}\n\t\t\t\n\t\tif( foundStopOrShortWord && ! searchTerm.length ) {\n\t\t\treturn MSG_stopAndShortWords;\n\t\t}\n\t\tsrch_input_massaged = searchTerm;\n\t\treturn \"\";\n\t} \n\telse {\n\t\treturn MSG_noSearchTermEntered;\n\t}\n}\n//---------------------------------------------------\nfunction checkTheInputString2()\t\t// double-byte version\n{\n\tvar tempArr = new Array();\n\n\thandleWhitespaceRemoval();\n\tsearchTerm = searchTerm.toLowerCase();\n\n\tif( searchTerm.length ) {\n\n\t\t// Split the searchTerm\n\t\t\ttempArr = searchTerm.split(\" \",100);\n\t\t\tif(showInputStringAlerts){alert( \"number of search terms: \" + tempArr.length );}\n\n\t\t// Now reconstruct the searchTerm, based upon the 'tempArr'\n\t\t\tsearchTerm = \"\";\n\t\t\tfor( var ndx = 0; ndx < tempArr.length; ndx++ ) {\n\t\t\t\tsearchTerm = searchTerm + tempArr[ndx] + \" \";\n\t\t\t}\n\t\t\thandleWhitespaceRemoval();\n\nif(showInputStringAlerts){alert( \"Massaged search term: \" + searchTerm );}\n\n\t\tsrch_input_massaged = searchTerm;\n\t\treturn \"\";\n\t}\n\telse {\n\t\treturn MSG_noSearchTermEntered;\n\t}\n}\n//---------------------------------------------------\nfunction doIEsearch()\n{\n\tvar stStr = \"\";\n\t\t\t\n\tdocument.forms[0].sh_term.value = srch_input_verbatim;\n\t\n\tif( srch_message.length ) {\n\t\tdocument.getElementById(\"results\").innerHTML = srch_message;\n\t\tsrch_message = \"\";\n\t}\n\telse if( srch_1_shot ) {\n\t\tsrch_1_shot = 0;\n\t\t\n\t\tsearchTerm = srch_input_massaged;\n\t\tcheckForHits();\t// Sets: 'matchesArrIndices' and 'matchesArrHits'\n\n\t\tif( matchesArrIndices.length ) {\t// If there were matches/hits...  /* Changed for CS4 */\n\n\t\t\tstStr = \"<div class=\\\"form\\\">\" + MSG_pagesContaining + \"<strong>\" + srch_input_massaged + \"</strong></div><br /><br />\\n\";\n\n\t\t\tdocument.getElementById(\"results\").innerHTML = stStr + buildHtmlResultsStr();\n\t\t}\n\t\telse {                                                  /* Changed for CS4 */\n\t\t\tdocument.getElementById(\"results\").innerHTML = MSG_noPagesContain + \"<strong>\" + srch_input_massaged + \"</strong><br /><br />\";\n\n\t\t}\n\t\t//searching_message.style.visibility=\"visible\";\n\t}\n\tsrch_input_verbatim = \"\";\n}\n//---------------------------------------------------\nfunction getInstanceCount( lineIndex, wordIndex )\n{\n\tvar instancesStr = instances[lineIndex];\t// e.g. \"1432931\"\n\tvar ch = instancesStr.substr(wordIndex,1);\n\t\n\treturn parseInt(ch);\n}\n//---------------------------------------------------\nfunction handleWhitespaceRemoval()\n{\n\tvar re_1 = /^\\s/;\n\tvar re_2 = /\\s$/;\n\tvar re_3 = /\\s\\s/;\n\tvar temp;\n\n\t// Remove leading whitespace\n\t\twhile( true ) {\n\t\t\ttemp = searchTerm.replace(re_1,\"\");\n\t\t\tif( temp == searchTerm ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tsearchTerm = temp;\n\t\t}\n\t// Remove trailing whitespace\n\t\twhile( true ) {\n\t\t\ttemp = searchTerm.replace(re_2,\"\");\n\t\t\tif( temp == searchTerm ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tsearchTerm = temp;\n\t\t}\n\t// Replace multiple contiguous spaces with a single space\n\t\twhile( searchTerm.search(re_3) != -1 ) {\n\t\t\ttemp = searchTerm.replace(re_3,\" \");\n\t\t\tsearchTerm = temp;\n\t\t}\n}\n//--------------------------------------------------\nfunction isAcceptableChar(chrNdx)\n{\n\tvar acceptableChars = new Array( 32, 46, 95 );\t// space, period, underscore\n\t\n\tfor( var ndx = 0; ndx < acceptableChars.length; ndx++ ) {\n\t\tif( chrNdx == acceptableChars[ndx] ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n//--------------------------------------------------\nfunction indexesOf(str,ptn)\n{\n\tvar position = 0;\n\tvar hits = -1;\n\tvar start = -1;\n\n\twhile( position != -1 ) {\n\t\tposition = str.indexOf(ptn, start+1);\n\t\thits += 1;\n\t\tstart = position;\n\t}\n\treturn hits;\n}\n//--------------------------------------------------\nfunction filterTheChars(line)\n{\n\tvar retStr = \"\",tempStr;\n\tvar ch, chCode, retChr;\n\tvar ndx;\n\t\n\tfor( ndx = 0; ndx < line.length; ndx++ ) {\n\t\tch = line.substr(ndx,1);\n\t\tchCode = ch.charCodeAt(0);\n\t\t\n\t\t\n\t\t\tif( (chCode >= 192) && (chCode <= 221) ) {\t// Handle capital upper-ASCII characters\n\t\t\t\tchCode = chCode + 32;\n\t\t\t\tretChr = ASCII_to_char(chCode);\n\t\t\t}\n\t\t\telse if( withinAcceptableRanges(chCode) || isAcceptableChar(chCode) ) { // Acceptable characters\n\t\t\t\tretChr = ch;\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttempStr = isLigatureChar(chCode);\n\n\t\t\t\tif( tempStr.length ) {\t//Don't replace ligatures.\n\t\t\t\t\tretChr = ch;\n\t\t\t\t}\n\t\t\t\telse {\t\t// Turn all else into space\t\n\t\t\t\t\tretChr = \" \";\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Grow the return string\n\t\t\tretStr += retChr;\n\t}\n\t\n\treturn retStr;\n}\n//--------------------------------------------------\nfunction isLigatureChar(codeToCheck) {\n\tvar xlatTblNdx, code, replStr = \"\";\n\n\tfor( xlatTblNdx = 0; xlatTblNdx < upperAsciiXlatTbl.length; xlatTblNdx+=2 ) {\n\n\t\tcode = upperAsciiXlatTbl[xlatTblNdx];\n\t\tif( code == codeToCheck ) {\n\t\t\treplStr = upperAsciiXlatTbl[xlatTblNdx+1];\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\treturn replStr;\n}\n//--------------------------------------------------\nfunction respondToSearchButton() \n{\n\tvar myStr;\n\tdocument.getElementById(\"results\").innerHTML = \"\"; //We don't expect this to be slow enough to need a message.\t\n\tsrch_input_verbatim = document.forms[0].sh_term.value;\n\tsearchTerm = document.forms[0].sh_term.value;\n\t\n\tif( document.isDblByte ) {\n\t\tmyStr = checkTheInputString2();\n\t}\n\telse {\n\t\tmyStr = checkTheInputString();\t\n\t}\n\t\n\tsrch_message = myStr;\n\tsrch_1_shot = srch_message.length ? 0 : 1;\n\t\n\tdoIEsearch();\n}\n//--------------------------------------------------\nfunction respondToSearchLoad() \n{\n\tvar externalQuery = GetCookie(\"externalQuery\");\n\tif (externalQuery == null) { \n\t\t\texternalQuery = GetCookie(\"sh_term\");\n\t}\n\n\tif (externalQuery != null) { \n\t\tvar myStr;\n\t\tsrch_input_verbatim = externalQuery;\n\t\tsearchTerm = externalQuery;\n\t\n\t\tif(document.isDblByte ) {\n\t\t  myStr = checkTheInputString2();\n\t\t}\n\t\telse {\n\t\t  myStr = checkTheInputString();\t\n\t\t}\n\t\t\n\t\tsrch_message = myStr;\n\t\tsrch_1_shot = srch_message.length ? 0 : 1;\n\t\t\n\t\tdoIEsearch();\n\t}\n}\n//---------------------------------------------------\nfunction strReplace(orig,src,dest)\n{\n\tvar startPos=0;\n\tvar matchPos = orig.indexOf(src,startPos);\n\tvar retLine=\"\";\n\t\n\twhile(matchPos != -1) {\n\t\tretLine = retLine + orig.substring(startPos,matchPos) + dest;\n\t\tstartPos = matchPos+1;\n\t\tmatchPos = orig.indexOf(src,startPos);\n\t}\n\tif(! retLine.length) {return orig;}\n\telse {return retLine+orig.substring(startPos,orig.length);}\n}\n//--------------------------------------------------\nfunction withinAcceptableRanges(chrNdx)\n{\t\n\tvar acceptableRanges = new Array( \"48-57\",\"65-90\",\"97-122\",\"224-229\",\"231-239\",\"241-246\",\"248-253\",\"255-255\");\n\t\n\tfor( var ndx = 0; ndx < acceptableRanges.length; ndx++ ) {\n\t\tvar start_finish = new Array();\n\n\t\tstart_finish = acceptableRanges[ndx].split(\"-\");\n\t\t\n\t\tif( (chrNdx >= start_finish[0]) && (chrNdx <= start_finish[1]) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n//--------------------------------------------------\nfunction ASCII_to_char(num_in)\n{\n\tvar str_out = \"\";\n\tvar num_out = parseInt(num_in);\n\t\n\tnum_out = unescape('%' + num_out.toString(16));\n\tstr_out += num_out;\n\t\n\treturn unescape(str_out);\n}\n//--------------------------------------------------\nvar agt=navigator.userAgent.toLowerCase();\nvar use_ie_behavior = false;\nvar use_ie_6_behavior = false;\nif (agt.indexOf(\"msie\") != -1) {\n  use_ie_behavior = true;\n}\nif ((agt.indexOf(\"msie 5\") != -1) || (agt.indexOf(\"msie 6\") != -1)) {\n  use_ie_6_behavior = true;\n}\n\n//--------------------------------------------------\n\nvar Url = {\n\n\t// public method for url encoding\n\tencode : function (string) {\n\t\treturn escape(this._utf8_encode(string));\n\t},\n\n\t// public method for url decoding\n\tdecode : function (string) {\n\t\treturn this._utf8_decode(unescape(string));\n\t},\n\n\t// private method for UTF-8 encoding\n\t_utf8_encode : function (string) {\n\t\tstring = string.replace(/\\r\\n/g,\"\\n\");\n\t\tvar utftext = \"\";\n\n\t\tfor (var n = 0; n < string.length; n++) {\n\n\t\t\tvar c = string.charCodeAt(n);\n\n\t\t\tif (c < 128) {\n\t\t\t\tutftext += String.fromCharCode(c);\n\t\t\t}\n\t\t\telse if((c > 127) && (c < 2048)) {\n\t\t\t\tutftext += String.fromCharCode((c >> 6) | 192);\n\t\t\t\tutftext += String.fromCharCode((c & 63) | 128);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tutftext += String.fromCharCode((c >> 12) | 224);\n\t\t\t\tutftext += String.fromCharCode(((c >> 6) & 63) | 128);\n\t\t\t\tutftext += String.fromCharCode((c & 63) | 128);\n\t\t\t}\n\n\t\t}\n\n\t\treturn utftext;\n\t},\n\n\t// private method for UTF-8 decoding\n\t_utf8_decode : function (utftext) {\n\t\tvar string = \"\";\n\t\tvar i = 0;\n\t\tvar c = c1 = c2 = 0;\n\n\t\twhile ( i < utftext.length ) {\n\n\t\t\tc = utftext.charCodeAt(i);\n\n\t\t\tif (c < 128) {\n\t\t\t\tstring += String.fromCharCode(c);\n\t\t\t\ti++;\n\t\t\t}\n\t\t\telse if((c > 191) && (c < 224)) {\n\t\t\t\tc2 = utftext.charCodeAt(i+1);\n\t\t\t\tstring += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\t\ti += 2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tc2 = utftext.charCodeAt(i+1);\n\t\t\t\tc3 = utftext.charCodeAt(i+2);\n\t\t\t\tstring += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\t\ti += 3;\n\t\t\t}\n\n\t\t}\n\n\t\treturn string;\n\t}\n\n}\n"
  },
  {
    "path": "documentation/api-reference/templates/index-list.html",
    "content": "<html>\n<head>\n\t<title>ActionScript 3.0 Language and Components Reference</title>\n\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n\t<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />\n\t<base target=\"classFrame\" />\n</head>\n\n<body class=\"classFrameContent\">\n<h3> Index\n</h3>\n<table cellpadding=\"0\" cellspacing=\"5\" width=\"100%\">\n<tbody>\n<!--\n<tr>\n\t<td colspan=\"2\"><a href=\"all-index-Symbols.html\">Symbols</a></td>\n</tr>\n-->\n<tr>\n<td><a href=\"all-index-A.html\">A</a></td>\n<td><a href=\"all-index-N.html\">N</a></td>\n</tr>\n<tr>\n<td><a href=\"all-index-B.html\">B</a></td>\n<td><a href=\"all-index-O.html\">O</a></td>\n</tr>\n<tr>\n<td><a href=\"all-index-C.html\">C</a></td>\n<td><a href=\"all-index-P.html\">P</a></td>\n</tr>\n<tr>\n<td><a href=\"all-index-D.html\">D</a></td>\n<td><a href=\"all-index-Q.html\">Q</a></td>\n</tr>\n<tr>\n<td><a href=\"all-index-E.html\">E</a></td>\n<td><a href=\"all-index-R.html\">R</a></td>\n</tr>\n<tr>\n<td><a href=\"all-index-F.html\">F</a></td>\n<td><a href=\"all-index-S.html\">S</a></td>\n</tr>\n<tr>\n<td><a href=\"all-index-G.html\">G</a></td>\n<td><a href=\"all-index-T.html\">T</a></td>\n</tr>\n<tr>\n<td><a href=\"all-index-H.html\">H</a></td>\n<td><a href=\"all-index-U.html\">U</a></td>\n</tr>\n<tr>\n<td><a href=\"all-index-I.html\">I</a></td>\n<td><a href=\"all-index-V.html\">V</a></td>\n</tr>\n<tr>\n<td><a href=\"all-index-J.html\">J</a></td>\n<td><a href=\"all-index-W.html\">W</a></td>\n</tr>\n<tr>\n<td><a href=\"all-index-K.html\">K</a></td>\n<td><a href=\"all-index-X.html\">X</a></td>\n</tr>\n<tr>\n<td><a href=\"all-index-L.html\">L</a></td>\n<td><a href=\"all-index-Y.html\">Y</a></td>\n</tr>\n<tr>\n<td><a href=\"all-index-M.html\">M</a></td>\n<td><a href=\"all-index-Z.html\">Z</a></td>\n</tr>\n</tbody></table>\n</body></html>\n"
  },
  {
    "path": "documentation/api-reference/templates/index.html",
    "content": "<html>\n<head>\n    <title>ActionScript 3.0 Language and Components Reference</title>\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n    <script language=\"javascript\" type=\"text/javascript\">\n    \t<!--\n        window.onload=function(){\n            var d=document.location.search;\n\t\t\tvar args=d.substring(d.lastIndexOf('?')+1,d.length);\n\t\t\tvar classFrameContent=args;\n\t\t\tvar classListFrameContent='';\n\t\t\tif (args.indexOf('&') != -1) {\n\t\t\t\tclassFrameContent = args.substring(0,args.indexOf('&'));\n\t\t\t\tclassListFrameContent = args.substring(args.indexOf('&')+1,args.length);\n\t\t\t}\n            if(classFrameContent!='')\n            \ttop.frames['classFrame'].document.location.href=classFrameContent;\n\t\t\tif(classListFrameContent!='')\n\t\t\t\ttop.frames['packageFrame'].frames['classListFrame'].document.location.href=classListFrameContent;\n        }\n        -->\n    </script>\n</head>\n<frameset cols=\"175,*\" border=\"2\" bordercolor=\"#AAAAAA\" framespacing=\"1\">\n       <frame src=\"package-frame.html\" name=\"packageFrame\" scrolling=\"no\" />\n       <frameset rows=\"80,*\" border=\"0\" bordercolor=\"#AAAAAA\">\n       \t\t<frame src=\"title-bar.html\" name=\"titlebar\" scrolling=\"no\" frameborder=\"0\" />\n       \t\t<frame src=\"package-summary.html\" name=\"classFrame\" frameborder=\"0\" />\n    \t</frameset>\n    <noframes>\n\t<body>\n        <h2>Frame Alert</h2>\n        <p>\n        This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.\n        <br />\n        Link to <a href=\"package-summary.html\">Non-frame version.</a>\n        </p>\n        </body>\n    </noframes>\n</frameset>\n</html>\n"
  },
  {
    "path": "documentation/api-reference/templates/merge_dita_xml.xslt",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n\n\tADOBE SYSTEMS INCORPORATED\n\tCopyright 2008 Adobe Systems Incorporated\n\tAll Rights Reserved.\n\n\tNOTICE: Adobe permits you to use, modify, and distribute this file\n\tin accordance with the terms of the license agreement accompanying it.\n\n-->\n<xsl:stylesheet version=\"2.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n    <xsl:param name=\"ditaFileDir\" select=\"''\"/>\n    <xsl:template match=\"/\">\n                <allClasses>\n                    <xsl:apply-templates select=\"//apiItemRef\">\n                        <xsl:sort select=\"@href\" order=\"ascending\"/>\n                    </xsl:apply-templates>\n                </allClasses>\n    </xsl:template>\n    <xsl:template match=\"apiItemRef\">\n        <xsl:variable name=\"ditaFileName\">\n            <xsl:value-of select=\"concat($ditaFileDir,@href)\"/>\n        </xsl:variable>\n        <xsl:for-each select=\"document($ditaFileName)/apiPackage\">\n            <xsl:copy-of select=\".\"/>\n        </xsl:for-each>\n    </xsl:template>\n</xsl:stylesheet>\n"
  },
  {
    "path": "documentation/api-reference/templates/methodSummary.xslt",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n\n\tADOBE SYSTEMS INCORPORATED\n\tCopyright 2008 Adobe Systems Incorporated\n\tAll Rights Reserved.\n\n\tNOTICE: Adobe permits you to use, modify, and distribute this file\n\tin accordance with the terms of the license agreement accompanying it.\n\n-->\n<xsl:stylesheet version=\"2.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:saxon=\"http://sf.net/saxon\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:ifn=\"urn:internal:functions\"\n\txmlns:ditaarch=\"http://dita.oasis-open.org/architecture/2005/\" exclude-result-prefixes=\"saxon xs ifn ditaarch\">\n\t<xsl:character-map name=\"disable\">\n\t\t<xsl:output-character character=\"&#146;\" string=\"&apos;\"/>\n\t</xsl:character-map>\n\t<xsl:output method=\"xml\" version=\"1.0\" encoding=\"UTF-8\" indent=\"no\" use-character-maps=\"disable\"/>\n\t<xsl:param name=\"ditaFileDir\" select=\"''\"/>\n\t<xsl:template match=\"/\">\n\t\t<allClasses>\n\t\t\t<xsl:apply-templates select=\"//apiItemRef\">\n\t\t\t\t<xsl:sort select=\"@href\" order=\"ascending\"/>\n\t\t\t</xsl:apply-templates>\n\t\t</allClasses>\n\t</xsl:template>\n\t<xsl:template match=\"apiItemRef\">\n\t\t<xsl:variable name=\"ditaFileName\">\n\t\t\t<xsl:value-of select=\"concat($ditaFileDir,@href)\"/>\n\t\t</xsl:variable>\n\t\t<xsl:for-each select=\"document($ditaFileName)/apiPackage\">\n\t\t\t<apiPackage id=\"{@id}\">\n\t\t\t\t<apiName>\n\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t</apiName>\n\t\t\t\t<xsl:apply-templates select=\"apiClassifier\"/>\n\t\t\t</apiPackage>\n\t\t</xsl:for-each>\n\t</xsl:template>\n\n\t<xsl:template match=\"apiClassifier\">\n\t\t<apiClassifier id=\"{@id}\">\n\t\t\t<apiName>\n\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t</apiName>\n\t\t\t<xsl:apply-templates select=\"apiClassifierDetail\"/>\n\t\t\t<xsl:apply-templates select=\"apiOperation\"/>\n\t\t\t<xsl:apply-templates select=\"apiConstructor\" mode=\"apiCon\"/>\n\t\t</apiClassifier>\n\t</xsl:template>\n\t<xsl:template match=\"apiClassifierDetail\">\n\t\t<apiClassifierDetail>\n\t\t\t<xsl:apply-templates select=\"apiClassifierDef\"/>\n\t\t\t<xsl:copy-of select=\"./example\" copy-namespaces=\"no\"/>\n\t\t</apiClassifierDetail>\n\t</xsl:template>\n\t<xsl:template match=\"apiClassifierDef\">\n\t\t<apiClassifierDef>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</apiClassifierDef>\n\t</xsl:template>\n\t<xsl:template match=\"apiOperation\">\n\t\t<apiOperation id=\"{@id}\">\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</apiOperation>\n\t</xsl:template>\n\t<xsl:template match=\"adobeApiEvent\">\n\t\t<adobeApiEvent id=\"{@id}\">\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</adobeApiEvent>\n\t</xsl:template>\n\t<xsl:template match=\"apiParam\">\n\t\t<xsl:variable name=\"itemName\" select=\"./apiItemName\"/>\n\t\t<xsl:variable name=\"itemType\" select=\"./apiType\"/>\n\t\t<apiParam>\n\t\t\t<xsl:apply-templates select=\"apiItemName\"/>\n\t\t\t<xsl:if test=\"$itemType\">\n\t\t\t\t<xsl:copy-of select=\"./apiType\" copy-namespaces=\"no\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:apply-templates select=\"apiData\"/>\n\t\t\t<xsl:apply-templates select=\"apiOperationClassifier\"/>\n\t\t\t<xsl:choose>\n\t\t\t\t<xsl:when test=\"parent::apiOperationDef[apiInheritDoc and apiParam[not(apiDesc) or apiDesc[normalize-space(.) = '']]]\">\n\t\t\t\t\t<xsl:call-template name=\"getInheritDocText\">\n\t\t\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"ancestor-or-self::apiClassifier/apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"implementedInterface\" select=\"ancestor-or-self::apiClassifier/apiClassifierDetail/apiBaseInterface\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"'paramapiDesc'\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"'apiOperation'\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"nameToMatch\" select=\"ancestor::apiOperation/apiName\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"paramText\" select=\"'apiParam'\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"itemName\" select=\"$itemName\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:when>\n\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t<xsl:apply-templates select=\"apiDesc\"/>\n\t\t\t\t</xsl:otherwise>\n\t\t\t</xsl:choose>\n\t\t</apiParam>\n\t</xsl:template>\n\t<xsl:template match=\"apiReturn\">\n\t\t<apiReturn>\n\t\t\t<xsl:variable name=\"itemType\" select=\"./apiType\"/>\n\t\t\t<xsl:if test=\"$itemType\">\n\t\t\t\t<xsl:copy-of select=\"./apiType\" copy-namespaces=\"no\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:apply-templates select=\"apiOperationClassifier\"/>\n\t\t\t<xsl:choose>\n\t\t\t\t<xsl:when test=\"parent::apiOperationDef[apiInheritDoc and apiReturn[not(apiDesc) or apiDesc[normalize-space(.) = '']]]\">\n\t\t\t\t\t<xsl:call-template name=\"getInheritDocText\">\n\t\t\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"ancestor-or-self::apiClassifier/apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"implementedInterface\" select=\"ancestor-or-self::apiClassifier/apiClassifierDetail/apiBaseInterface\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"'returnapiDesc'\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"'apiOperation'\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"nameToMatch\" select=\"ancestor::apiOperation/apiName\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"paramText\" select=\"'apiParam'\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:when>\n\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t<xsl:apply-templates select=\"apiDesc\"/>\n\t\t\t\t</xsl:otherwise>\n\t\t\t</xsl:choose>\n\t\t</apiReturn>\n\t</xsl:template>\n\t<xsl:template match=\"apiItemName\">\n\t\t<apiItemName>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</apiItemName>\n\t</xsl:template>\n\t<xsl:template match=\"apiData\">\n\t\t<apiData>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</apiData>\n\t</xsl:template>\n\t<xsl:template match=\"apiOperationClassifier\">\n\t\t<apiOperationClassifier>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</apiOperationClassifier>\n\t</xsl:template>\n\t<xsl:template match=\"shortdesc\">\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"parent::apiOperation/apiOperationDetail/apiOperationDef/apiInheritDoc\">\n\t\t\t\t<xsl:if test=\"ancestor::apiClassifier/apiClassifierDetail/apiClassifierDef/apiBaseClassifier or ancestor::apiClassifier/apiClassifierDetail/apiClassifierDef/apiBaseInterface \">\n\t\t\t\t\t<xsl:call-template name=\"getInheritDocText\">\n\t\t\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"ancestor::apiClassifier/apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"implementedInterface\" select=\"ancestor::apiClassifier/apiClassifierDetail/apiClassifierDef/apiBaseInterface\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"'shortdesc'\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"'apiOperation'\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"nameToMatch\" select=\"parent::apiOperation/apiName\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:when>\n\t\t\t<xsl:when test=\"@conref\">\n\t\t\t\t<xsl:if test=\"normalize-space(.)\">\n\t\t\t\t\t<shortdesc>\n\t\t\t\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t\t\t\t</shortdesc>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:variable name=\"entryType\" select=\"'method'\"/>\n\t\t\t\t<xsl:variable name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"@conref\"/>\n\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"'shortdesc'\"/>\n\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"$entryType\"/>\n\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<shortdesc>\n\t\t\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t\t\t</shortdesc>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template match=\"apiDesc\">\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"@conref\">\n\t\t\t\t<xsl:variable name=\"entryType\" select=\"'method'\"/>\n\t\t\t\t<xsl:variable name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t<apiDesc>\n\t\t\t\t\t<xsl:if test=\"normalize-space(.)\">\n\t\t\t\t\t\t<p class=\"- topic/p \">\n\t\t\t\t\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"@conref\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"'apiDesc'\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"$entryType\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"currentPackage\" select=\"$currentPackage\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</apiDesc>\n\t\t\t</xsl:when>\n\t\t\t<xsl:when test=\"parent::apiOperationDetail/apiOperationDef/apiInheritDoc\">\n\t\t\t\t<xsl:if test=\"ancestor::apiClassifier/apiClassifierDetail/apiClassifierDef/apiBaseClassifier or ancestor::apiClassifier/apiClassifierDetail/apiClassifierDef/apiBaseInterface \">\n\t\t\t\t\t<xsl:call-template name=\"getInheritDocText\">\n\t\t\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"ancestor::apiClassifier/apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"implementedInterface\" select=\"ancestor::apiClassifier/apiClassifierDetail/apiClassifierDef/apiBaseInterface\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"'apiDesc'\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"'apiOperation'\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"nameToMatch\" select=\"ancestor::apiOperation/apiName\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<apiDesc>\n\t\t\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t\t\t</apiDesc>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template match=\"apiConstructor\" mode=\"apiCon\">\n\t\t<apiConstructor id=\"{@id}\">\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</apiConstructor>\n\t</xsl:template>\n\t<xsl:template name=\"getInheritDocText\">\n\t\t<xsl:param name=\"itemName\"/>\n\t\t<xsl:param name=\"paramText\"/>\n\t\t<xsl:param name=\"baseClass\"/>\n\t\t<xsl:param name=\"implementedInterface\"/>\n\t\t<xsl:param name=\"descriptionType\"/>\n\t\t<xsl:param name=\"entryType\"/>\n\t\t<xsl:param name=\"nameToMatch\"/>\n\t\t<xsl:param name=\"itemNameToMatch\"/>\n\t\t<xsl:param name=\"doNotProcessTags\" select=\"false()\"/>\n\t\t<xsl:for-each select=\"ancestor::apiClassifier/apiClassifierDetail/apiClassifierDef/apiBaseInterface\">\n\t\t\t<xsl:call-template name=\"inheritDocFromInterfaces\">\n\t\t\t\t<xsl:with-param name=\"implementedInterface\" select=\".\"/>\n\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"$descriptionType\"/>\n\t\t\t\t<xsl:with-param name=\"entryType\" select=\"$entryType\"/>\n\t\t\t\t<xsl:with-param name=\"nameToMatch\" select=\"$nameToMatch\"/>\n\t\t\t\t<xsl:with-param name=\"doNotProcessTags\" select=\"$doNotProcessTags\"/>\n\t\t\t\t<xsl:with-param name=\"paramText\" select=\"$paramText\"/>\n\t\t\t\t<xsl:with-param name=\"itemName\" select=\"$itemName\"/>\n\t\t\t</xsl:call-template>\n\t\t</xsl:for-each>\n\t\t<xsl:call-template name=\"inheritDocFromBaseClass\">\n\t\t\t<xsl:with-param name=\"baseClass\" select=\"$baseClass\"/>\n\t\t\t<xsl:with-param name=\"descriptionType\" select=\"$descriptionType\"/>\n\t\t\t<xsl:with-param name=\"entryType\" select=\"$entryType\"/>\n\t\t\t<xsl:with-param name=\"nameToMatch\" select=\"$nameToMatch\"/>\n\t\t\t<xsl:with-param name=\"itemNameToMatch\" select=\"$itemNameToMatch\"/>\n\t\t\t<xsl:with-param name=\"doNotProcessTags\" select=\"$doNotProcessTags\"/>\n\t\t\t<xsl:with-param name=\"paramText\" select=\"$paramText\"/>\n\t\t\t<xsl:with-param name=\"itemName\" select=\"$itemName\"/>\n\t\t</xsl:call-template>\n\t</xsl:template>\n\t<xsl:template name=\"inheritDocFromInterfaces\">\n\t\t<xsl:param name=\"itemName\"/>\n\t\t<xsl:param name=\"paramText\"/>\n\t\t<xsl:param name=\"implementedInterface\"/>\n\t\t<xsl:param name=\"descriptionType\"/>\n\t\t<xsl:param name=\"entryType\"/>\n\t\t<xsl:param name=\"nameToMatch\"/>\n\t\t<xsl:param name=\"doNotProcessTags\" select=\"false()\"/>\n\t\t<xsl:for-each select=\"$implementedInterface\">\n\t\t\t<xsl:variable name=\"baseClass\" select=\".\"/>\n\t\t\t<xsl:variable name=\"className\">\n\t\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t\t<xsl:value-of select=\"substring-after($baseClass,':')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t\t<xsl:value-of select=\"$baseClass\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"packageName\">\n\t\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t\t<xsl:value-of select=\"substring-before($baseClass,':')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t\t<xsl:value-of select=\"__Global__\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"xslDocPath\">\n\t\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t\t<xsl:value-of select=\"concat($ditaFileDir,substring-before($baseClass,':'),'.xml')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t\t<xsl:value-of select=\"concat($ditaFileDir,'__Global__.xml')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:choose>\n\t\t\t\t<xsl:when test=\"$entryType='apiOperation'\">\n\t\t\t\t\t<xsl:for-each select=\"document($xslDocPath)/apiPackage/apiClassifier[apiName=$className and  apiClassifierDetail/apiClassifierDef/apiInterface]/apiOperation[apiName=$nameToMatch]\">\n\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t<xsl:when test=\"$descriptionType='shortdesc'\">\n\t\t\t\t\t\t\t\t<xsl:for-each select=\"./shortdesc[text() != '']\">\n\t\t\t\t\t\t\t\t\t<shortdesc>\n\t\t\t\t\t\t\t\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t\t\t\t\t\t\t\t</shortdesc>\n\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t<xsl:when test=\"$descriptionType='apiDesc'\">\n\t\t\t\t\t\t\t\t<xsl:for-each select=\"./apiOperationDetail/apiDesc[normalize-space(.) != '']\">\n\t\t\t\t\t\t\t\t\t<apiDesc>\n\t\t\t\t\t\t\t\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t\t\t\t\t\t\t\t</apiDesc>\n\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t<xsl:when test=\"$descriptionType='paramapiDesc'\">\n\t\t\t\t\t\t\t\t<xsl:for-each select=\"./apiOperationDetail/apiOperationDef/apiParam[apiItemName=$itemName]\">\n\t\t\t\t\t\t\t\t\t<xsl:copy-of select=\"./apiDesc\" copy-namespaces=\"no\"/>\n\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t<xsl:when test=\"$descriptionType='returnapiDesc'\">\n\t\t\t\t\t\t\t\t<xsl:copy-of select=\"./apiOperationDetail/apiOperationDef/apiReturn/apiDesc\" copy-namespaces=\"no\"/>\n\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t</xsl:for-each>\n\t\t\t\t</xsl:when>\n\t\t\t</xsl:choose>\n\t\t\t<!-- Now process the base interface of the current interface-->\n\t\t\t<xsl:for-each select=\"document($xslDocPath)/apiPackage/apiClassifier[apiName=$className]/apiClassifierDetail/apiClassifierDef/apiBaseInterface\">\n\t\t\t\t<xsl:call-template name=\"inheritDocFromInterfaces\">\n\t\t\t\t\t<xsl:with-param name=\"implementedInterface\" select=\".\"/>\n\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"$descriptionType\"/>\n\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"$entryType\"/>\n\t\t\t\t\t<xsl:with-param name=\"nameToMatch\" select=\"$nameToMatch\"/>\n\t\t\t\t\t<xsl:with-param name=\"doNotProcessTags\" select=\"$doNotProcessTags\"/>\n\t\t\t\t\t<xsl:with-param name=\"paramText\" select=\"$paramText\"/>\n\t\t\t\t\t<xsl:with-param name=\"itemName\" select=\"$itemName\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:for-each>\n\t\t</xsl:for-each>\n\t</xsl:template>\n\t<xsl:template name=\"inheritDocFromBaseClass\">\n\t\t<xsl:param name=\"itemName\"/>\n\t\t<xsl:param name=\"paramText\"/>\n\t\t<xsl:param name=\"baseClass\"/>\n\t\t<xsl:param name=\"descriptionType\"/>\n\t\t<xsl:param name=\"entryType\"/>\n\t\t<xsl:param name=\"nameToMatch\"/>\n\t\t<xsl:param name=\"itemNameToMatch\"/>\n\t\t<xsl:param name=\"doNotProcessTags\" select=\"false()\"/>\n\t\t<xsl:variable name=\"className\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-after($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"$baseClass\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"packageName\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"substring-before($baseClass,':')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"__Global__\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:variable name=\"xslDocPath\">\n\t\t\t<xsl:if test=\"contains($baseClass,':')\">\n\t\t\t\t<xsl:value-of select=\"concat($ditaFileDir,substring-before($baseClass,':'),'.xml')\"/>\n\t\t\t</xsl:if>\n\t\t\t<xsl:if test=\"not(contains($baseClass,':'))\">\n\t\t\t\t<xsl:value-of select=\"concat($ditaFileDir,'__Global__.xml')\"/>\n\t\t\t</xsl:if>\n\t\t</xsl:variable>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"$entryType='apiOperation'\">\n\t\t\t\t<xsl:for-each select=\"document($xslDocPath)/apiPackage/apiClassifier[apiName=$className and not(apiClassifierDetail/apiClassifierDef/apiInterface)]/apiOperation[apiName=$nameToMatch]\">\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"$descriptionType='shortdesc'\">\n\t\t\t\t\t\t\t<xsl:for-each select=\"./shortdesc[normalize-space(text()) != '']\">\n\t\t\t\t\t\t\t\t<shortdesc>\n\t\t\t\t\t\t\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t\t\t\t\t\t\t</shortdesc>\n\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:when test=\"$descriptionType='apiDesc'\">\n\t\t\t\t\t\t\t<xsl:for-each select=\"./apiOperationDetail/apiDesc[normalize-space(.) != '']\">\n\t\t\t\t\t\t\t\t<apiDesc>\n\t\t\t\t\t\t\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t\t\t\t\t\t\t</apiDesc>\n\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:when test=\"$descriptionType='paramapiDesc'\">\n\t\t\t\t\t\t\t<xsl:for-each select=\"./apiOperationDetail/apiOperationDef/apiParam[apiItemName=$itemName]\">\n\t\t\t\t\t\t\t\t<xsl:copy-of select=\"./apiDesc\" copy-namespaces=\"no\"/>\n\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:when test=\"$descriptionType='returnapiDesc'\">\n\t\t\t\t\t\t\t<xsl:copy-of select=\"./apiOperationDetail/apiOperationDef/apiReturn/apiDesc\" copy-namespaces=\"no\"/>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:when>\n\t\t</xsl:choose>\n\t\t<!-- Now process the base class till object reached-->\n\t\t<xsl:if test=\"not($className='Object')\">\n\t\t\t<xsl:variable name=\"newBaseClass\"\n\t\t\t\tselect=\"document($xslDocPath)/apiPackage/apiClassifier[apiName=$className and not(apiClassifierDetail/apiClassifierDef/apiInterface)]/apiClassifierDetail/apiClassifierDef/apiBaseClassifier\"/>\n\t\t\t<xsl:if test=\"string-length($newBaseClass) &gt; 0\">\n\t\t\t\t<xsl:call-template name=\"inheritDocFromBaseClass\">\n\t\t\t\t\t<xsl:with-param name=\"baseClass\" select=\"$newBaseClass\"/>\n\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"$descriptionType\"/>\n\t\t\t\t\t<xsl:with-param name=\"entryType\" select=\"$entryType\"/>\n\t\t\t\t\t<xsl:with-param name=\"nameToMatch\" select=\"$nameToMatch\"/>\n\t\t\t\t\t<xsl:with-param name=\"itemNameToMatch\" select=\"$itemNameToMatch\"/>\n\t\t\t\t\t<xsl:with-param name=\"doNotProcessTags\" select=\"$doNotProcessTags\"/>\n\t\t\t\t\t<xsl:with-param name=\"paramText\" select=\"$paramText\"/>\n\t\t\t\t\t<xsl:with-param name=\"itemName\" select=\"$itemName\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:if>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getConRefText\">\n\t\t<xsl:param name=\"text\"/>\n\t\t<xsl:param name=\"conref\"/>\n\t\t<xsl:param name=\"descriptionType\"/>\n\t\t<xsl:param name=\"entryType\"/>\n\t\t<xsl:param name=\"doNotProcessTags\" select=\"false()\"/>\n\t\t<xsl:param name=\"currentPackage\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t<xsl:if test=\"string-length($conref) &gt; 0\">\n\t\t\t<xsl:variable name=\"relativePath\">\n\t\t\t\t<xsl:call-template name=\"getRelativePath\">\n\t\t\t\t\t<xsl:with-param name=\"currentPath\" select=\"$currentPackage\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"packageClassText\">\n\t\t\t\t<xsl:if test=\"contains($conref,'#') and contains(substring-before($conref,'#'),'.')\">\n\t\t\t\t\t<xsl:value-of select=\"substring-before($conref,'#')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"contains($conref,'#') and not(contains(substring-before($conref,'#'),'.'))\">\n\t\t\t\t\t<xsl:value-of select=\"concat($currentPackage,'.',substring-before($conref,'#'))\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(contains($conref,'#'))\">\n\t\t\t\t\t<xsl:value-of select=\"$conref\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"className\">\n\t\t\t\t<xsl:if test=\"contains($conref,'#') and contains(substring-before($conref,'#'),'.')\">\n\t\t\t\t\t<xsl:call-template name=\"lastIndexOf\">\n\t\t\t\t\t\t<xsl:with-param name=\"string\" select=\"$packageClassText\"/>\n\t\t\t\t\t\t<xsl:with-param name=\"char\" select=\"'.'\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"contains($conref,'#') and not(contains(substring-before($conref,'#'),'.'))\">\n\t\t\t\t\t<xsl:if test=\"string-length(substring-before($conref,'#')) = 0\">\n\t\t\t\t\t\t<xsl:value-of select=\"ancestor-or-self::apiPackage/apiClassifier/apiName\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"string-length(substring-before($conref,'#')) &gt; 0\">\n\t\t\t\t\t\t<xsl:value-of select=\"substring-before($conref,'#')\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"destPackageName1\">\n\t\t\t\t<xsl:value-of select=\"substring-before($packageClassText,concat('.',$className))\"/>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"destPackageName\">\n\t\t\t\t<xsl:if test=\"$destPackageName1 = '' or $destPackageName1='__Global__'\">\n\t\t\t\t\t<xsl:value-of select=\"'__Global__.xml'\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not($destPackageName1='') and not($destPackageName1='__Global__')\">\n\t\t\t\t\t<xsl:value-of select=\"concat($destPackageName1, '.xml')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"entryTypeNameText\" select=\"substring-after($conref,'#')\"/>\n\t\t\t<xsl:variable name=\"nameToMatch\">\n\t\t\t\t<xsl:if test=\"string-length($entryTypeNameText) = 0\">\n\t\t\t\t\t<xsl:value-of select=\"$className\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"contains($entryTypeNameText,':')\">\n\t\t\t\t\t<xsl:value-of select=\"substring-after($entryTypeNameText,':')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(contains($entryTypeNameText,':')) and string-length($entryTypeNameText) &gt; 0\">\n\t\t\t\t\t<xsl:if test=\"contains($entryTypeNameText,')')\">\n\t\t\t\t\t\t<xsl:value-of select=\"substring-before($entryTypeNameText,'(')\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"not(contains($entryTypeNameText,')'))\">\n\t\t\t\t\t\t<xsl:value-of select=\"$entryTypeNameText\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:variable name=\"entryType\">\n\t\t\t\t<xsl:if test=\"string-length($entryTypeNameText) = 0\">\n\t\t\t\t\t<xsl:value-of select=\"'class'\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"contains($entryTypeNameText,':')\">\n\t\t\t\t\t<xsl:value-of select=\"substring-before($entryTypeNameText,':')\"/>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"not(contains($entryTypeNameText,':')) and string-length($entryTypeNameText) &gt; 0\">\n\t\t\t\t\t<xsl:if test=\"contains($entryTypeNameText,')')\">\n\t\t\t\t\t\t<xsl:value-of select=\"'method'\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"not(contains($entryTypeNameText,')'))\">\n\t\t\t\t\t\t<xsl:value-of select=\"'property'\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:for-each select=\"document(concat($ditaFileDir,$destPackageName))/apiPackage//apiClassifier[apiName=$className]\">\n\t\t\t\t<xsl:if test=\"string-length($entryType) &gt; 0\">\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"contains($entryType,'method')\">\n\t\t\t\t\t\t\t<xsl:for-each select=\"./apiOperation[apiName=$nameToMatch]\">\n\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t<xsl:when test=\"$descriptionType='shortdesc'\">\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./shortdesc[@conref]\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"./shortdesc/@conref\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"local-name(./shortdesc)\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(./shortdesc[@conref])\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"./shortdesc[text() != '']\">\n\t\t\t\t\t\t\t\t\t\t\t\t<shortdesc>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</shortdesc>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./apiOperationDetail/apiDesc[@conref]\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getConRefText\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"conref\" select=\"./apiOperationDetail/apiDesc/@conref\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"descriptionType\" select=\"local-name(./apiOperationDetail/apiDesc)\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(./apiOperationDetail/apiDesc[@conref])\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"./apiOperationDetail/apiDesc\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:for-each>\n\t\t</xsl:if>\n\t</xsl:template>\n\t<xsl:template name=\"getRelativePath\">\n\t\t<xsl:param name=\"currentPath\"/>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"not($currentPath) or $currentPath='__Global__'\">\n\t\t\t\t<xsl:value-of select=\"''\"/>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:if test=\"contains($currentPath,'.')\">\n\t\t\t\t\t<xsl:call-template name=\"getRelativePath\">\n\t\t\t\t\t\t<xsl:with-param name=\"currentPath\" select=\"substring-after($currentPath,'.')\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:value-of select=\"'../'\"/>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template name=\"lastIndexOf\">\n\t\t<xsl:param name=\"string\"/>\n\t\t<xsl:param name=\"char\"/>\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"contains($string, $char)\">\n\t\t\t\t<xsl:call-template name=\"lastIndexOf\">\n\t\t\t\t\t<xsl:with-param name=\"string\" select=\"substring-after($string, $char)\"/>\n\t\t\t\t\t<xsl:with-param name=\"char\" select=\"$char\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</xsl:when>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:value-of select=\"$string\"/>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n\t<xsl:template match=\"keywords\"/>\n\t<xsl:template match=\"node()\">\n\t\t<xsl:copy copy-namespaces=\"no\">\n\t\t\t<xsl:copy-of select=\"@*\" copy-namespaces=\"no\"/>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</xsl:copy>\n\t</xsl:template>\n</xsl:stylesheet>\n"
  },
  {
    "path": "documentation/api-reference/templates/mxml-tags.html",
    "content": "<html>\n<head>\n\t<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />\n\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n\t<title>MXML Only Components - Adobe Flex 3 Language Reference</title>\n</head>\n\n<body class=\"classFrameContent\">\n\t<h3>MXML Only Components</h3>\n\t<a href=\"mxml/binding.html\" target=\"classFrame\">&lt;mx:Binding&gt;</a><br />\n\t<a href=\"mxml/component.html\" target=\"classFrame\">&lt;mx:Component&gt;</a><br />\n\t<a href=\"mxml/metadata.html\" target=\"classFrame\">&lt;mx:Metadata&gt;</a><br />\n\t<a href=\"mxml/model.html\" target=\"classFrame\">&lt;mx:Model&gt;</a><br />\n\t<a href=\"mxml/script.html\" target=\"classFrame\">&lt;mx:Script&gt;</a><br />\n\t<a href=\"mxml/style.html\" target=\"classFrame\">&lt;mx:Style&gt;</a><br />\n\t<a href=\"mxml/xml.html\" target=\"classFrame\">&lt;mx:XML&gt;</a><br />\n\t<a href=\"mxml/xmlList.html\" target=\"classFrame\">&lt;mx:XMLList&gt;</a><br />\n</body>\n</html>\n\n"
  },
  {
    "path": "documentation/api-reference/templates/override.css",
    "content": "/*\n////////////////////////////////////////////////////////////////////////////////\n//\n//  ADOBE SYSTEMS INCORPORATED\n//  Copyright 2008 Adobe Systems Incorporated\n//  All Rights Reserved.\n//\n//  NOTICE: Adobe permits you to use, modify, and distribute this file\n//  in accordance with the terms of the license agreement accompanying it.\n//\n////////////////////////////////////////////////////////////////////////////////\n*/"
  },
  {
    "path": "documentation/api-reference/templates/package-detail.xslt",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n\n\tADOBE SYSTEMS INCORPORATED\n\tCopyright 2008 Adobe Systems Incorporated\n\tAll Rights Reserved.\n\n\tNOTICE: Adobe permits you to use, modify, and distribute this file\n\tin accordance with the terms of the license agreement accompanying it.\n\n-->\n<xsl:stylesheet version=\"2.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:saxon=\"http://sf.net/saxon\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:ifn=\"urn:internal:functions\"\n\texclude-result-prefixes=\"saxon xs ifn\">\n\t<xsl:import href=\"asdoc-util.xslt\"/>\n\t<xsl:import href=\"class-files.xslt\"/>\n\t<xsl:output encoding=\"UTF-8\" method=\"html\" omit-xml-declaration=\"yes\" use-character-maps=\"disable\"/>\n\t<xsl:param name=\"outputPath\" select=\"''\"/>\n\t<xsl:param name=\"packageOverviewFile\" select=\"'overviews.xml'\"/>\n\t<xsl:param name=\"packages_map_name\" select=\"'packagemap.xml'\"/>\n\t<xsl:variable name=\"thinsp\">\n\t\t<xsl:text>&#x2009;</xsl:text>\n\t</xsl:variable>\n\t<xsl:template match=\"/\">\n\t\t<xsl:choose>\n\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t<xsl:otherwise>\n\t\t\t\t<xsl:for-each select=\"apiMap//apiItemRef\">\n\t\t\t\t\t<xsl:sort select=\"@href\" order=\"ascending\" lang=\"en-US\"/>\n\t\t\t\t\t<xsl:variable name=\"ditaFileName\">\n\t\t\t\t\t\t<xsl:value-of select=\"concat($ditaFileDir,@href)\"/>\n\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t<xsl:for-each select=\"document($ditaFileName)/apiPackage\">\n\t\t\t\t\t\t<xsl:variable name=\"name\" select=\"./apiName\"/>\n\t\t\t\t\t\t<xsl:variable name=\"isTopLevel\">\n\t\t\t\t\t\t\t<xsl:call-template name=\"isTopLevel\">\n\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$name\"/>\n\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t<xsl:variable name=\"shortPackageName\" select=\"$name\"/>\n\t\t\t\t\t\t<xsl:variable name=\"packageFile\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$outputPath\"/>\n\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t<xsl:when test=\"$isTopLevel='true'\">package-detail.html</xsl:when>\n\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"translate($name,'.','/')\"/>/package-detail.html</xsl:otherwise>\n\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t<xsl:variable name=\"classListFile\">\n\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t<xsl:when test=\"$isTopLevel='true'\">class-list.html</xsl:when>\n\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"translate($name,'.','/')\"/>/class-list.html</xsl:otherwise>\n\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t<xsl:variable name=\"packageName\">\n\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t<xsl:when test=\"$isTopLevel='true'\">\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'TopLevel']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t<xsl:apply-templates select=\"$asdoc_terms/row[entry[1][p/text() = 'PackagePackage']]/entry[2]/p\" mode=\"terms\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"package\" select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t</xsl:apply-templates>\n\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t<xsl:variable name=\"title\">\n\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='true'\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($asdoc_terms/row[entry[1][p/text() = 'TopLevel']]/entry[2]/p,' - ',$title-base)\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel != 'true'\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($name,' ',$asdoc_terms/row[entry[1][p/text() = 'Package']]/entry[2]/p,' - ',$title-base)\"/>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t<xsl:result-document href=\"{$packageFile}\" method=\"html\">\n\t\t\t\t\t\t\t<xsl:copy-of select=\"$noLiveDocs\"/>\n\t\t\t\t\t\t\t<xsl:copy-of select=\"$docType\"/>\n\t\t\t\t\t\t\t<xsl:value-of select=\"$markOfTheWeb\"/>\n\t\t\t\t\t\t\t<xsl:if test=\"$config/options[@ion='true']\">\n\t\t\t\t\t\t\t\t<xsl:comment>#config errmsg=\"\"</xsl:comment>\n\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t<xsl:element name=\"html\">\n\t\t\t\t\t\t\t\t<head>\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getStyleLink\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"link\" select=\"/asdoc/link\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t<title>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='true'\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'TopLevelConstantsFunctions']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='false'\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Summary']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getPageTitlePostFix\"/>\n\t\t\t\t\t\t\t\t\t</title>\n\t\t\t\t\t\t\t\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n\t\t\t\t\t\t\t\t</head>\n\t\t\t\t\t\t\t\t<xsl:element name=\"body\">\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isEclipse\">\n\t\t\t\t\t\t\t\t\t\t<xsl:attribute name=\"class\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>eclipseBody</xsl:text>\n\t\t\t\t\t\t\t\t\t\t</xsl:attribute>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getTitleScript\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"title\" select=\"$title\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLinks2\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"subTitle\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$isTopLevel='true'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'TopLevel']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:apply-templates select=\"$shortPackageName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t</xsl:with-param>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fileName\" select=\"'package-detail'\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fileName2\" select=\"$classListFile\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"showProperties\" select=\"false()\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"showMethods\" select=\"false()\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"showPackageConstants\" select=\"boolean(count(apiValue[not(apiValueDetail/apiValueDef/apiProperty)]))\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"showPackageProperties\" select=\"boolean(count(apiValue[apiValueDetail/apiValueDef/apiProperty]))\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"showPackageFunctions\" select=\"boolean(count(apiOperation))\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"showInterfaces\" select=\"boolean(count(apiClassifier[apiClassifierDetail/apiClassifierDef/apiInterface]))\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"showClasses\" select=\"boolean(count(apiClassifier[not(apiClassifierDetail/apiClassifierDef/apiInterface)]))\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"showPackageUse\" select=\"false()\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"id\" select=\"@id\"/>\n\t\t\t\t\t\t\t\t\t<div class=\"MainContent\">\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"annot\" select=\"$id\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"pack\" select=\"translate($annot,':','.')\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:apply-templates mode=\"annotate\" select=\"$config/annotate/item[@type='package' and @name[starts-with($pack,.)]]\"/>\n\t\t\t\t\t\t\t\t\t\t<br/>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not($config/overviews/package)\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"packageComments\" select=\"document($packageOverviewFile)/overviews/packages/package[@name=current()/apiName]\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$packageComments/description\">\n\t\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"inText\" select=\".\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$packageComments\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"sees\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$config/overviews/package\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"pname\" select=\"@name\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$config/overviews/package\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"packageOverview\" select=\"document(.)/overviews/packages/package[@name=$pname]\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$packageOverview/longDescription\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"inText\" select=\"$packageOverview/description\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$packageOverview\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"sees\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"xrefId\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='true'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>global</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not($isTopLevel='true')\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$pname\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:with-param>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<br/>\n\t\t\t\t\t\t\t\t\t\t<hr/>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"apiValue/apiValueDetail/apiValueDef[apiProperty]\">\n\t\t\t\t\t\t\t\t\t\t\t<a name=\"fieldSummary\"/>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"summaryTableTitle\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$isTopLevel='true'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'GlobalProperties']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Property']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<table cellpadding=\"3\" cellspacing=\"0\" class=\"summaryTable\">\n\t\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<th width=\"30%\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Property']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<th width=\"70%\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Description']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"apiValue/apiValueDetail/apiValueDef[apiProperty]\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:sort select=\"apiName\" order=\"ascending\" lang=\"en-US\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"name\" select=\"apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<tr class=\"prow{position() mod 2}\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class=\"summaryTablePaddingCol\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class=\"summaryTableSecondCol\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"package.html#{$name}\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class=\"summaryTableLastCol\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"shortDescription\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(string-length(normalize-space(shortDescription/.)))\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"apiOperation\">\n\t\t\t\t\t\t\t\t\t\t\t<a name=\"methodSummary\"/>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"summaryTableTitle\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$isTopLevel='true'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'GlobalFunctions']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Functions']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<table cellpadding=\"3\" cellspacing=\"0\" class=\"summaryTable\">\n\t\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<th width=\"30%\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'FunctionFunction']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<th width=\"70%\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Description']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"apiOperation\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:sort select=\"apiName\" order=\"ascending\" lang=\"en-US\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"name\" select=\"apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<tr class=\"prow{position() mod 2}\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class=\"summaryTablePaddingCol\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class=\"summaryTableSecondCol\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"package.html#{$name}()\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class=\"summaryTableLastCol\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"shortDescriptionReview\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"shortDescription\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(string-length(normalize-space(./shortdesc/.)))\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"apiValue[not(apiValueDetail/apiValueDef/apiProperty)]\">\n\t\t\t\t\t\t\t\t\t\t\t<a name=\"constantSummary\"/>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"summaryTableTitle\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$isTopLevel='true'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'GlobalConstants']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Constants']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<table cellpadding=\"3\" cellspacing=\"0\" class=\"summaryTable\">\n\t\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<th width=\"30%\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Constant']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<th width=\"70%\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Description']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"apiValue[not(apiValueDetail/apiValueDef/apiProperty)]\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:sort select=\"apiName\" order=\"ascending\" lang=\"en-US\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"name\" select=\"apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<tr class=\"prow{position() mod 2}\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class=\"summaryTablePaddingCol\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class=\"summaryTableSecondCol\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"package.html#{$name}\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class=\"summaryTableLastCol\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"shortDescription\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(string-length(normalize-space(./shortdesc/.)))\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"apiClassifier[apiClassifierDetail/apiClassifierDef/apiInterface]\">\n\t\t\t\t\t\t\t\t\t\t\t<a name=\"interfaceSummary\"/>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"summaryTableTitle\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Interfaces']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<table cellpadding=\"3\" cellspacing=\"0\" class=\"summaryTable\">\n\t\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<th width=\"30%\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Interface']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<th width=\"70%\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Description']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"apiClassifier[apiClassifierDetail/apiClassifierDef/apiInterface]\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:sort select=\"apiName\" order=\"ascending\" lang=\"en-US\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"name\" select=\"apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"packageName\" select=\"ancestor::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"baseRef\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getBaseRef\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$packageName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<tr class=\"prow{position() mod 2}\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class=\"summaryTablePaddingCol\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class=\"summaryTableSecondCol\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$name}.html\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</i>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"prolog/asMetadata/apiVersion/apiPlatform[@name='AIR'] and not (prolog/asMetadata/apiVersion/apiPlatform[@name='Flash'])\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"insertAIRIcon\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class=\"summaryTableLastCol\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"deprecated\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:apply-templates select=\"deprecated\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(deprecated)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"shortDescription\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(string-length(normalize-space(./shortdesc/.)))\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"apiClassifier[not(apiClassifierDetail/apiClassifierDef/apiInterface)]\">\n\t\t\t\t\t\t\t\t\t\t\t<a name=\"classSummary\"/>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"summaryTableTitle\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Classes']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<table cellpadding=\"3\" cellspacing=\"0\" class=\"summaryTable\">\n\t\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<th width=\"30%\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'ClassClass']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<th width=\"70%\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Description']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"apiClassifier[not(apiClassifierDetail/apiClassifierDef/apiInterface)]\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:sort select=\"apiName\" order=\"ascending\" lang=\"en-US\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"name\" select=\"apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"packageName\" select=\"ancestor::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"baseRef\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getBaseRef\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$packageName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<tr class=\"prow{position() mod 2}\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class=\"summaryTablePaddingCol\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class=\"summaryTableSecondCol\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$name}.html\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"prolog/asMetadata/apiVersion/apiPlatform[@name='AIR'] and not (prolog/asMetadata/apiVersion/apiPlatform[@name='Flash'])\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"insertAIRIcon\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td class=\"summaryTableLastCol\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"deprecated\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:apply-templates select=\"deprecated\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(deprecated)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"shortDescription\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not(string-length(normalize-space(./shortdesc)))\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<p/>\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"packageName\" select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"baseRef\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getBaseRef\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$packageName\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t\t<p/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='true'\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getFeedbackLink\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"topic\" select=\"'Top Level'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel!='true'\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getFeedbackLink\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"topic\" select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<center class=\"copyright\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:copy-of select=\"$copyright\"/>\n\t\t\t\t\t\t\t\t\t\t\t</center>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"packageName\" select=\"ancestor::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"baseRef\">\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getBaseRef\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$config/options[@ion='true']\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"separator\">&#160;</div>\n\t\t\t\t\t\t\t\t\t\t<xsl:comment>BEGIN IONCOMMENTS</xsl:comment>\n\t\t\t\t\t\t\t\t\t\t<div id=\"ionComHere\"> </div>\n\t\t\t\t\t\t\t\t\t\t<xsl:comment>END IONCOMMENTS</xsl:comment>\n\t\t\t\t\t\t\t\t\t\t<xsl:comment>#include virtual=\"ionComments.ssi\"</xsl:comment>\n\t\t\t\t\t\t\t\t\t\t<p id=\"creativecommons\" class=\"creativecommons\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"http://creativecommons.org/licenses/by-nc-sa/3.0/\">\n\t\t\t\t\t\t\t\t\t\t\t\t<img id=\"creativecommons_img\" src=\"{$baseRef}images/CC.png\"/>\n\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t<xsl:comment>#include virtual=\"/livedocs/googleAnalytics.ssi\"</xsl:comment>\n\t\t\t\t\t\t\t\t\t\t<xsl:comment>#include virtual=\"/ubi/analytics/analytics_ssi.html\"</xsl:comment>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</xsl:element>\n\t\t\t\t\t\t\t</xsl:element>\n\t\t\t\t\t\t\t<xsl:copy-of select=\"$copyrightComment\"/>\n\t\t\t\t\t\t</xsl:result-document>\n\t\t\t\t\t</xsl:for-each>\n\t\t\t\t</xsl:for-each>\n\t\t\t</xsl:otherwise>\n\t\t</xsl:choose>\n\t</xsl:template>\n</xsl:stylesheet>\n"
  },
  {
    "path": "documentation/api-reference/templates/package-frame.html",
    "content": "<html>\n<head>\n    <title>ActionScript 3.0 Language and Components Reference</title>\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n</head>\n<frameset rows=\"40%,60%\" border=\"2\" framespacing=\"1\" bordercolor=\"#AAAAAA\">\n    <frame src=\"package-list.html\" name=\"packageListFrame\" scrolling=\"yes\" />\n    <frame src=\"all-classes.html\" name=\"classListFrame\" scrolling=\"yes\" />\n    <noframes>\n        <body>\n            <h2>Frame Alert</h2>\n            <p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.\n                <br />\n                Link to<a href=\"package-summary.html\">Non-frame version.</a>\n            </p>\n        </body>\n    </noframes>\n</frameset>\n</html>"
  },
  {
    "path": "documentation/api-reference/templates/package-list.xslt",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n\n\tADOBE SYSTEMS INCORPORATED\n\tCopyright 2008 Adobe Systems Incorporated\n\tAll Rights Reserved.\n\n\tNOTICE: Adobe permits you to use, modify, and distribute this file\n\tin accordance with the terms of the license agreement accompanying it.\n\n-->\n<xsl:stylesheet version=\"2.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n\t<xsl:import href=\"asdoc-util.xslt\"/>\n\t<xsl:output encoding=\"UTF-8\" method=\"html\" omit-xml-declaration=\"yes\" use-character-maps=\"disable\"/>\n\t<xsl:param name=\"packages_map_name\" select=\"'packagemap.xml'\"/>\n\t<xsl:param name=\"ditaFileDir\" select=\"''\"/>\n\t<xsl:template match=\"/\">\n\t\t<xsl:copy-of select=\"$noLiveDocs\"/>\n\t\t<xsl:copy-of select=\"$docType\"/>\n\t\t<xsl:element name=\"html\">\n\t\t\t<head>\n\t\t\t\t<title><xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'PackageList']]/entry[2]/p\"/> - <xsl:value-of select=\"$title-base\"/></title>\n\t\t\t\t<base target=\"classFrame\"/>\n\t\t\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n\t\t\t\t<xsl:call-template name=\"getStyleLink\">\n\t\t\t\t\t<xsl:with-param name=\"link\" select=\"asdoc/link\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t\t<script language=\"javascript\" src=\"asdoc.js\" type=\"text/javascript\"/>\n\t\t\t</head>\n\t\t\t<body class=\"classFrameContent\">\n\t\t\t\t<h3>\n\t\t\t\t\t<a href=\"package-summary.html\" onclick=\"javascript:loadClassListFrame('all-classes.html');\" style=\"color:black\">\n\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Packages']]/entry[2]/p\"/>\n\t\t\t\t\t</a>\n\t\t\t\t</h3>\n\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\">\n\t\t\t\t\t<xsl:for-each select=\"apiMap//apiItemRef\">\n\t\t\t\t\t\t<xsl:sort select=\"substring(@href, 0, string-length(@href)-4)\" order=\"ascending\" lang=\"en-US\"/>\n\t\t\t\t\t\t<xsl:variable name=\"ditaFileName\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"concat($ditaFileDir,@href)\"/>\n\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t<xsl:if test=\"document($ditaFileName)/apiPackage[contains(apiName,'__Global__')]/apiClassifier\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<a href=\"package-detail.html\" onclick=\"javascript:loadClassListFrame('class-list.html');\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'TopLevel']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:for-each select=\"document($ditaFileName)/apiPackage[apiClassifier or apiOperation or apiValue]\">\n\t\t\t\t\t\t\t<xsl:sort select=\"apiName\" order=\"ascending\" lang=\"en-US\"/>\n\t\t\t\t\t\t\t<xsl:variable name=\"name\" select=\"apiName\"/>\n\t\t\t\t\t\t\t<xsl:variable name=\"isTopLevel\">\n\t\t\t\t\t\t\t\t<xsl:call-template name=\"isTopLevel\">\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$name\"/>\n\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='false'\">\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"packagePath\" select=\"translate($name,'.','/')\"/>\n\t\t\t\t\t\t\t\t\t\t<a href=\"{$packagePath}/package-detail.html\" onclick=\"javascript:loadClassListFrame('{$packagePath}/class-list.html');\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"position() != last()\">\n\t\t\t\t\t\t\t\t\t\t\t<br/>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t</xsl:for-each>\n\t\t\t\t</table>\n\t\t\t\t<xsl:if test=\"$config/languageElements[@show='true']\">\n\t\t\t\t\t<h3>\n\t\t\t\t\t\t<a href=\"language-elements.html\" style=\"color:black\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'LanguageElements']]/entry[2]/p\"/>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</h3>\n\t\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\">\n\t\t\t\t\t\t<xsl:if test=\"$config/languageElements[@directives='true']\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<a href=\"directives.html\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'CompilerDirectives']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"$config/languageElements[@constants='true']\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$config/options[@docversion='3']\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"package.html#constantSummary\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'GlobalConstants']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not($config/options[@docversion='3'])\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"constants.html\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'GlobalConstants']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"$config/languageElements[@functions='true']\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$config/options[@docversion='3']\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"package.html#methodSummary\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'GlobalFunctions']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"not($config/options[@docversion='3'])\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"global_functions.html\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'GlobalFunctions']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"$config/languageElements[@properties='true']\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<a href=\"global_props.html\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'GlobalProperties']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"$config/languageElements[@operators='true']\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<a href=\"operators.html\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Operators']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"$config/languageElements[@statements='true']\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<a href=\"statements.html\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'StatementsKeywordsDirectives']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:if test=\"$config/languageElements[@specialTypes='true']\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<a href=\"specialTypes.html\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'SpecialTypes']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:for-each select=\"$config/languageElements/element\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<a href=\"{@href}\" onclick=\"{@onclick}\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"@label\"/>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t</table>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:if test=\"$config/appendixes[@show='true']\">\n\t\t\t\t\t<h3>\n\t\t\t\t\t\t<a href=\"appendixes.html\" style=\"color:black\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Appendix']]/entry[2]/p\"/>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</h3>\n\t\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\">\n\t\t\t\t\t\t<xsl:if test=\"$config/appendixes[@deprecated='true']\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<a href=\"deprecated.html\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Deprecated']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:for-each select=\"$config/appendixes/appendix\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<a href=\"{@href}\" onclick=\"{@onclick}\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1]/p = current()/@label]/entry[2]//p\"/>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t</table>\n\t\t\t\t</xsl:if>\n\t\t\t</body>\n\t\t</xsl:element>\n\t\t<xsl:copy-of select=\"$copyrightComment\"/>\n\t</xsl:template>\n</xsl:stylesheet>\n"
  },
  {
    "path": "documentation/api-reference/templates/package-summary.xslt",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n\n\tADOBE SYSTEMS INCORPORATED\n\tCopyright 2008 Adobe Systems Incorporated\n\tAll Rights Reserved.\n\n\tNOTICE: Adobe permits you to use, modify, and distribute this file\n\tin accordance with the terms of the license agreement accompanying it.\n\n-->\n<xsl:stylesheet version=\"2.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:saxon=\"http://sf.net/saxon\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:ifn=\"urn:internal:functions\"\n\texclude-result-prefixes=\"saxon xs ifn\">\n\t<xsl:import href=\"asdoc-util.xslt\"/>\n\t<xsl:output encoding=\"UTF-8\" method=\"html\" use-character-maps=\"disable\"/>\n\t<xsl:param name=\"localTitle\" select=\"$localTitle\"/>\n\t<xsl:variable name=\"title\" select=\"concat($asdoc_terms/row[entry[1][p/text() = $localTitle]]/entry[2]/p,' - ',$title-base)\"/>\n\t<xsl:param name=\"overviewsFile\" select=\"'overviews.xml'\"/>\n\t<xsl:param name=\"ditaFileDir\" select=\"''\"/>\n\t<xsl:param name=\"filter\" select=\"'*'\"/>\n\t<xsl:param name=\"outfile\" select=\"'package-summary'\"/>\n\t<xsl:param name=\"packages_map_name\" select=\"'packagemap.xml'\"/>\n\t<xsl:param name=\"jslr\" select=\"'flashclasses.xml'\"/>\n\t<xsl:param name=\"prog_language_name\" select=\"''\"/>\n\t<xsl:variable name=\"useFilter\">\n\t\t<xsl:if test=\"contains($filter,'*')\">\n\t\t\t<xsl:value-of select=\"substring-before($filter,'*')\"/>\n\t\t</xsl:if>\n\t\t<xsl:if test=\"not(contains($filter,'*'))\">\n\t\t\t<xsl:value-of select=\"$filter\"/>\n\t\t</xsl:if>\n\t</xsl:variable>\n\t<xsl:template match=\"/\">\n\t\t<xsl:copy-of select=\"$noLiveDocs\"/>\n\t\t<xsl:copy-of select=\"$docType\"/>\n\t\t<xsl:value-of select=\"$markOfTheWeb\"/>\n\t\t<xsl:if test=\"$config/options[@livedocs='true']\">\n\t\t\t<xsl:comment>#config errmsg=\"\"</xsl:comment>\n\t\t</xsl:if>\n\t\t<xsl:element name=\"html\">\n\t\t\t<head>\n\t\t\t\t<title>\n\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = $localTitle]]/entry[2]/p\"/>\n\t\t\t\t\t<xsl:call-template name=\"getPageTitlePostFix\"/>\n\t\t\t\t</title>\n\t\t\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n\t\t\t\t<xsl:call-template name=\"getStyleLink\">\n\t\t\t\t\t<xsl:with-param name=\"link\" select=\"asdoc/link\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t</head>\n\t\t\t<xsl:element name=\"body\">\n\t\t\t\t<xsl:if test=\"$isEclipse\">\n\t\t\t\t\t<xsl:attribute name=\"class\">\n\t\t\t\t\t\t<xsl:text>eclipseBody</xsl:text>\n\t\t\t\t\t</xsl:attribute>\n\t\t\t\t</xsl:if>\n\t\t\t\t<xsl:call-template name=\"getTitleScript\">\n\t\t\t\t\t<xsl:with-param name=\"title\" select=\"$title\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t\t<xsl:call-template name=\"getLinks2\">\n\t\t\t\t\t<xsl:with-param name=\"subTitle\">\n\t\t\t\t\t\t<xsl:call-template name=\"search-and-replace\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"input\" select=\"$asdoc_terms/row[entry[1][p/text() = $localTitle]]/entry[2]/p\"/>\n\t\t\t\t\t\t\t<xsl:with-param name=\"search-string\" select=\"' '\"/>\n\t\t\t\t\t\t\t<xsl:with-param name=\"replace-string\" select=\"$nbsp\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:with-param>\n\t\t\t\t\t<xsl:with-param name=\"fileName\" select=\"$outfile\"/>\n\t\t\t\t\t<xsl:with-param name=\"showProperties\" select=\"false()\"/>\n\t\t\t\t\t<xsl:with-param name=\"showMethods\" select=\"false()\"/>\n\t\t\t\t\t<xsl:with-param name=\"showPackages\" select=\"false()\"/>\n\t\t\t\t</xsl:call-template>\n\t\t\t\t<div class=\"MainContent\">\n\t\t\t\t\t<br/>\n\t\t\t\t\t<xsl:variable name=\"overviews\" select=\"document($overviewsFile)/overviews\"/>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t<xsl:when test=\"starts-with($useFilter,'mx.')\">\n\t\t\t\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"$overviews/mx-packages/description/.\"/>\n\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t<xsl:when test=\"starts-with($useFilter,'flash.')\">\n\t\t\t\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"$overviews/flash-packages/description/.\"/>\n\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t<xsl:value-of disable-output-escaping=\"yes\" select=\"$overviews/all-packages/description/.\"/>\n\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t</p>\n\t\t\t\t\t<xsl:for-each select=\"$overviews/all-packages\">\n\t\t\t\t\t\t<xsl:call-template name=\"sees\">\n\t\t\t\t\t\t\t<xsl:with-param name=\"xrefId\" select=\"'all-packages'\"/>\n\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t<br/>\n\t\t\t\t\t<table cellpadding=\"3\" cellspacing=\"0\" class=\"summaryTable\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t<th width=\"30%\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Package']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t<th width=\"70%\">\n\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Description']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t<xsl:when test=\"$prog_language_name='javascript'\"/>\n\n\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t<xsl:for-each select=\"apiMap//apiItemRef\">\n\t\t\t\t\t\t\t\t\t<xsl:sort select=\"substring(@href, 0, string-length(@href)-4)\" order=\"ascending\"/>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"ditaFileName\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"concat($ditaFileDir,@href)\"/>\n\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t<xsl:variable name=\"rowNumber\" select=\"concat('prow',position() mod 2)\"/>\n\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"document($ditaFileName)/apiPackage[starts-with(apiName,$useFilter) or ($useFilter='flash.' and apiName='__Global__')]\">\n\t\t\t\t\t\t\t\t\t\t<xsl:sort select=\"apiName\" order=\"ascending\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"name\" select=\"apiName\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"isTopLevel\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"isTopLevel\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"packageFile\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='false'\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"translate($name,'.','/')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>/</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>package-detail.html</xsl:text>\n\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"classListFile\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='false'\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"translate($name,'.','/')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>/</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:text>class-list.html</xsl:text>\n\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./apiClassifier or ./apiOperation or ./apiValue/apiProperty\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"name\" select=\"apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t<tr class=\"{$rowNumber}\">\n\t\t\t\t\t\t\t\t\t\t\t\t<td class=\"summaryTablePaddingCol\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t<td class=\"summaryTableSecondCol\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"{$packageFile}\" onclick=\"javascript:loadClassListFrame('{$classListFile}');\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='true'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'TopLevel']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='false'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t<td class=\"summaryTableLastCol\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not($config/overviews/package)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"overview\" select=\"document($overviewsFile)/overviews/packages/package[@name=current()/apiName]\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$overview/shortDescription\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"inText\" select=\".\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length(string-join($overview/shortDescription/., ' '))\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$config/overviews/package\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"pname\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$config/overviews/package\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"packageOverview\" select=\"normalize-space(document(.)/overviews/packages/package[@name=$pname]/shortDescription/.)\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"string-length($packageOverview)\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"inText\" select=\"$packageOverview\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$nbsp\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t</table>\n\t\t\t\t\t<p/>\n\t\t\t\t\t<center class=\"copyright\">\n\t\t\t\t\t\t<xsl:copy-of select=\"$copyright\"/>\n\t\t\t\t\t</center>\n\t\t\t\t</div>\n\t\t\t\t<xsl:if test=\"$config/options[@livedocs='true']\">\n\t\t\t\t\t<div class=\"separator\">&#160;</div>\n\t\t\t\t\t<xsl:comment>BEGIN IONCOMMENTS</xsl:comment>\n\t\t\t\t\t<div id=\"ionComHere\"> </div>\n\t\t\t\t\t<xsl:comment>END IONCOMMENTS</xsl:comment>\n\t\t\t\t\t<xsl:comment>#include virtual=\"ionComments.ssi\"</xsl:comment>\n\t\t\t\t\t<p id=\"creativecommons\" class=\"creativecommons\">\n\t\t\t\t\t\t<a href=\"http://creativecommons.org/licenses/by-nc-sa/3.0/\">\n\t\t\t\t\t\t\t<img id=\"creativecommons_img\" src=\"images/CC.png\"/>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</p>\n\t\t\t\t\t<xsl:comment>#include virtual=\"/livedocs/googleAnalytics.ssi\"</xsl:comment>\n\t\t\t\t\t<xsl:comment>#include virtual=\"/ubi/analytics/analytics_ssi.html\"</xsl:comment>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:element>\n\t\t</xsl:element>\n\t\t<xsl:copy-of select=\"$copyrightComment\"/>\n\t</xsl:template>\n</xsl:stylesheet>\n"
  },
  {
    "path": "documentation/api-reference/templates/package.xslt",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n\n\tADOBE SYSTEMS INCORPORATED\n\tCopyright 2008 Adobe Systems Incorporated\n\tAll Rights Reserved.\n\n\tNOTICE: Adobe permits you to use, modify, and distribute this file\n\tin accordance with the terms of the license agreement accompanying it.\n\n-->\n<xsl:stylesheet version=\"2.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:saxon=\"http://sf.net/saxon\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:ifn=\"urn:internal:functions\"\n\texclude-result-prefixes=\"saxon xs ifn\">\n\t<xsl:import href=\"asdoc-util.xslt\"/>\n\t<xsl:import href=\"class-files.xslt\"/>\n\t<xsl:output encoding=\"UTF-8\" method=\"html\" omit-xml-declaration=\"yes\" use-character-maps=\"disable\"/>\n\t<xsl:param name=\"outputPath\" select=\"''\"/>\n\t<xsl:param name=\"ditaFileDir\" select=\"''\"/>\n\t<xsl:param name=\"packageOverviewFile\" select=\"'overviews.xml'\"/>\n\t<xsl:param name=\"packages_map_name\" select=\"'packagemap.xml'\"/>\n\t<xsl:template match=\"/\">\n\t\t<xsl:for-each select=\"apiMap//apiItemRef\">\n\t\t\t<xsl:sort select=\"@href\" order=\"ascending\"/>\n\t\t\t<xsl:variable name=\"ditaFileName\">\n\t\t\t\t<xsl:value-of select=\"concat($ditaFileDir,@href)\"/>\n\t\t\t</xsl:variable>\n\t\t\t<xsl:for-each select=\"document($ditaFileName)/apiPackage\">\n\t\t\t\t<xsl:sort select=\"./apiName\" order=\"ascending\" lang=\"en-US\"/>\n\t\t\t\t<xsl:variable name=\"name\" select=\"./apiName\"/>\n\t\t\t\t<xsl:variable name=\"interfaces\">\n\t\t\t\t\t<xsl:if test=\"./apiClassifierDetail/apiClassifierDef/apiInterface and ./apiClassifierDetail/apiClassifierDef/apiBaseInterface\">\n\t\t\t\t\t\t<xsl:call-template name=\"createBaseInterfaceList\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<xsl:variable name=\"isTopLevel\">\n\t\t\t\t\t<xsl:call-template name=\"isTopLevel\">\n\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$name\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<xsl:variable name=\"packageFile\">\n\t\t\t\t\t<xsl:value-of select=\"$outputPath\"/>\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"$isTopLevel='true'\">package.html</xsl:when>\n\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t<xsl:value-of select=\"translate($name,'.','/')\"/>/package.html</xsl:otherwise>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<xsl:variable name=\"classListFile\">\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"$isTopLevel='true'\">class-list.html</xsl:when>\n\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t<xsl:value-of select=\"translate($name,'.','/')\"/>/class-list.html</xsl:otherwise>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<xsl:variable name=\"packageName\">\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"$isTopLevel='true'\">\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'TopLevel']]/entry[2]/p\"/>\n\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'PackagePackage']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<xsl:variable name=\"xrefPackageName\">\n\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t<xsl:when test=\"$isTopLevel='true'\">__Global__</xsl:when>\n\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t</xsl:choose>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<xsl:variable name=\"title\">\n\t\t\t\t\t<xsl:if test=\"$isTopLevel='true'\">\n\t\t\t\t\t\t<xsl:value-of select=\"concat($asdoc_terms/row[entry[1][p/text() = 'TopLevelConstantsFunctions']]/entry[2]/p,' - ',$title-base)\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t\t<xsl:if test=\"not($isTopLevel='true')\">\n\t\t\t\t\t\t<xsl:value-of select=\"concat($name,' ', $asdoc_terms/row[entry[1][p/text() = 'Package']]/entry[2]/p, ' - ',$title-base)\"/>\n\t\t\t\t\t</xsl:if>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<xsl:variable name=\"baseRef\">\n\t\t\t\t\t<xsl:call-template name=\"getBaseRef\">\n\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"ancestor-or-self::apiPackage/apiName\"/>\n\t\t\t\t\t</xsl:call-template>\n\t\t\t\t</xsl:variable>\n\t\t\t\t<xsl:variable name=\"hasConstants\" select=\"count(apiValue[not(./apiValueDetail/apiValueDef/apiProperty)]) &gt; 0\"/>\n\t\t\t\t<xsl:variable name=\"hasFields\" select=\"count(apiValue/apiValueDetail/apiValueDef/apiProperty) &gt; 0\"/>\n\t\t\t\t<xsl:variable name=\"hasFunctions\" select=\"count(./apiOperation) &gt; 0\"/>\n\t\t\t\t<xsl:if test=\"$hasConstants or $hasFields or $hasFunctions\">\n\t\t\t\t\t<!-- TODO move this to asdoc-util -->\n\t\t\t\t\t<xsl:variable name=\"pname\" select=\"$name\"/>\n\t\t\t\t\t<xsl:result-document href=\"{$packageFile}\">\n\t\t\t\t\t\t<xsl:copy-of select=\"$docType\"/>\n\t\t\t\t\t\t<xsl:if test=\"$config/options[@livedocs='true']\">\n\t\t\t\t\t\t\t<xsl:comment>#config errmsg=\"\"</xsl:comment>\n\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t<xsl:element name=\"html\">\n\t\t\t\t\t\t\t<head>\n\t\t\t\t\t\t\t\t<xsl:call-template name=\"getStyleLink\">\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"link\" select=\"/asdoc/link\"/>\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$name\"/>\n\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t<title>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='true'\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'TopLevelConstantsFunctions']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='false'\">\n\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:text> </xsl:text>\n\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'Details']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getPageTitlePostFix\"/>\n\t\t\t\t\t\t\t\t</title>\n\t\t\t\t\t\t\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n\t\t\t\t\t\t\t</head>\n\t\t\t\t\t\t\t<xsl:element name=\"body\">\n\t\t\t\t\t\t\t\t<xsl:if test=\"$isEclipse\">\n\t\t\t\t\t\t\t\t\t<xsl:attribute name=\"class\">\n\t\t\t\t\t\t\t\t\t\t<xsl:text>eclipseBody</xsl:text>\n\t\t\t\t\t\t\t\t\t</xsl:attribute>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t<xsl:call-template name=\"getTitleScript\">\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"title\" select=\"$title\"/>\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$name\"/>\n\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLinks2\">\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"subTitle\">\n\t\t\t\t\t\t\t\t\t\t<xsl:choose>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:when test=\"$isTopLevel='true'\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'TopLevel']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:when>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:apply-templates select=\"$asdoc_terms/row[entry[1][p/text() = 'PackagePackage']]/entry[2]/p\" mode=\"terms\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"package\" select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:apply-templates>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:otherwise>\n\t\t\t\t\t\t\t\t\t\t</xsl:choose>\n\t\t\t\t\t\t\t\t\t</xsl:with-param>\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fileName\" select=\"'package'\"/>\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"fileName2\" select=\"$classListFile\"/>\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"packageName\" select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"showProperties\" select=\"false()\"/>\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"showMethods\" select=\"false()\"/>\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"showPackageConstants\" select=\"boolean(number($hasConstants))\"/>\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"showPackageProperties\" select=\"boolean(number($hasFields))\"/>\n\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"showPackageFunctions\" select=\"boolean(number($hasFunctions))\"/>\n\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t<div class=\"MainContent\">\n\t\t\t\t\t\t\t\t\t<xsl:apply-templates mode=\"annotate\" select=\"$config/annotate/item[@type='package' and @name=$name and string-length($name) and tokenize($name,',')[starts-with($pname,.)]]\"/>\n\t\t\t\t\t\t\t\t\t<br/>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$hasFields\">\n\t\t\t\t\t\t\t\t\t\t<a name=\"propertySummary\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not($config/overviews/package)\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"packageComments\" select=\"document($packageOverviewFile)/overviews/packages/package[@name=$pname]\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"inText\" select=\"$packageComments/propertiesDescription\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$packageComments/propertiesDescription\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"sees\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"xrefId\" select=\"concat($xrefPackageName,'#propertySummary')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$config/overviews/package\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$config/overviews/package\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"packageOverview\" select=\"document(.)/overviews/packages/package[@name=$pname]\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$packageOverview/propertiesDescription\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"inText\" select=\"$packageOverview/propertiesDescription\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$packageOverview/propertiesDescription\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"sees\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"xrefId\" select=\"concat($xrefPackageName,'#propertySummary')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"interfaces\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./apiClassifierDetail/apiClassifierDef/apiInterface and ./apiClassifierDetail/apiClassifierDef/apiBaseInterface\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"createBaseInterfaceList\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"fieldSummary\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"isGlobal\" select=\"$isTopLevel='true'\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"showAnchor\" select=\"false()\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"interfaces\" select=\"$interfaces\" tunnel=\"yes\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"boolean(number($hasFunctions)) or boolean(number($hasConstants))\">\n\t\t\t\t\t\t\t\t\t\t\t<br/>\n\t\t\t\t\t\t\t\t\t\t\t<br/>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$hasFunctions\">\n\t\t\t\t\t\t\t\t\t\t<a name=\"methodSummary\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"packageComments\" select=\"document($packageOverviewFile)/overviews/packages/package[@name=$pname]\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not($config/overviews/package)\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"inText\" select=\"$packageComments/functionsDescription\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$packageComments/functionsDescription\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"sees\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"xrefId\" select=\"concat($xrefPackageName,'#methodSummary')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$config/overviews/package\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$config/overviews/package\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"packageOverview\" select=\"document(.)/overviews/packages/package[@name=$pname]\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$packageOverview/functionsDescription\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"inText\" select=\"$packageOverview/functionsDescription\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$packageOverview/functionsDescription\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"sees\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"xrefId\" select=\"concat($xrefPackageName,'#methodSummary')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"interfaces\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./apiClassifierDetail/apiClassifierDef/apiInterface and ./apiClassifierDetail/apiClassifierDef/apiBaseInterface\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"createBaseInterfaceList\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"methodSummary\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"className\" select=\"'package'\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"title\" select=\"$asdoc_terms/row[entry[1][p/text() = 'Functions']]/entry[2]/p\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"isGlobal\" select=\"$isTopLevel='true'\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"showAnchor\" select=\"false()\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"interfaces\" select=\"$interfaces\" tunnel=\"yes\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"boolean(number($hasConstants))\">\n\t\t\t\t\t\t\t\t\t\t\t<br/>\n\t\t\t\t\t\t\t\t\t\t\t<br/>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"$hasConstants\">\n\t\t\t\t\t\t\t\t\t\t<a name=\"constantSummary\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"not($config/overviews/package)\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"packageComments\" select=\"document($packageOverviewFile)/overviews/packages/package[@name=$pname]\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"inText\" select=\"$packageComments/constantsDescription\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$packageComments/constantsDescription\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"sees\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"xrefId\" select=\"concat($xrefPackageName,'#constantSummary')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$config/overviews/package\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$config/overviews/package\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"packageOverview\" select=\"document(.)/overviews/packages/package[@name=$pname]\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$packageOverview/constantsDescription\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"deTilda\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"inText\" select=\"$packageOverview/constantsDescription\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:for-each select=\"$packageOverview/constantsDescription\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"sees\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"xrefId\" select=\"concat($xrefPackageName,'#constantSummary')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:for-each>\n\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t<xsl:variable name=\"interfaces\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"./apiClassifierDetail/apiClassifierDef/apiInterface and ./apiClassifierDetail/apiClassifierDef/apiBaseInterface\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"createBaseInterfaceList\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:variable>\n\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"fieldSummary\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"isConst\" select=\"'true'\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"isGlobal\" select=\"$isTopLevel='true'\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"showAnchor\" select=\"false()\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"interfaces\" select=\"$interfaces\" tunnel=\"yes\"/>\n\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<!--<xsl:apply-templates select=\"apiValue\" mode=\"detail\"/>-->\n\t\t\t\t\t\t\t\t\t<!-- CONSTANT DETAILS FOR PACKAGES-->\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"boolean(number($hasConstants))\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"detailSectionHeader\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\">ConstantDetail</xsl:with-param>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:apply-templates select=\"apiValue[not(apiValueDetail/apiValueDef/apiProperty)]\" mode=\"detail\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"isConst\" select=\"'true'\"/>\n\t\t\t\t\t\t\t\t\t</xsl:apply-templates>\n\t\t\t\t\t\t\t\t\t<!--END OF CONSTANT DETAILS-->\n\t\t\t\t\t\t\t\t\t<!--FUNCTION DETAILS -->\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"methodsDetails\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"className\" select=\"'package'\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"title\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\">FunctionDetail</xsl:with-param>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</xsl:with-param>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"baseRef\" select=\"$baseRef\"/>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t<!--END OF FUNCTION DETAILS -->\n\t\t\t\t\t\t\t\t\t<!--PROPERTIES DETAILS -->\n\t\t\t\t\t\t\t\t\t<xsl:if test=\"boolean(number($hasFields))\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"detailSectionHeader\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\">PropertyDetail</xsl:with-param>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t<xsl:apply-templates select=\"apiValue[apiValueDetail/apiValueDef/apiProperty]\" mode=\"detail\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"className\" select=\"'package'\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"title\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getLocalizedString\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"key\">PropertyDetail</xsl:with-param>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t\t</xsl:with-param>\n\t\t\t\t\t\t\t\t\t</xsl:apply-templates>\n\t\t\t\t\t\t\t\t\t<!--END OF PROPERTIES DETAILS -->\n\t\t\t\t\t\t\t\t\t<p/>\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"getFeedbackLink\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"topic\" select=\"$packageName\"/>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"filename\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='true'\">package.html</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel!='true'\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"translate($name,'.','/')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>/package.html</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:with-param>\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"filename2\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='true'\">class-list.html</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel!='true'\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"translate($name,'.','/')\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:text>/class-list.html</xsl:text>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:with-param>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t\t<center class=\"copyright\">\n\t\t\t\t\t\t\t\t\t\t<xsl:copy-of select=\"$copyright\"/>\n\t\t\t\t\t\t\t\t\t</center>\n\t\t\t\t\t\t\t\t\t<xsl:call-template name=\"addKeywords\">\n\t\t\t\t\t\t\t\t\t\t<xsl:with-param name=\"keyword\">\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel='true'\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"'Top Level'\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t\t<xsl:if test=\"$isTopLevel!='true'\">\n\t\t\t\t\t\t\t\t\t\t\t\t<xsl:value-of select=\"$name\"/>\n\t\t\t\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t\t\t\t</xsl:with-param>\n\t\t\t\t\t\t\t\t\t</xsl:call-template>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<xsl:if test=\"$config/options[@livedocs='true']\">\n\t\t\t\t\t\t\t\t\t<div class=\"separator\">&#160;</div>\n\t\t\t\t\t\t\t\t\t<xsl:comment>BEGIN IONCOMMENTS</xsl:comment>\n\t\t\t\t\t\t\t\t\t<div id=\"ionComHere\"> </div>\n\t\t\t\t\t\t\t\t\t<xsl:comment>END IONCOMMENTS</xsl:comment>\n\t\t\t\t\t\t\t\t\t<xsl:comment>#include virtual=\"ionComments.ssi\"</xsl:comment>\n\t\t\t\t\t\t\t\t\t<p id=\"creativecommons\" class=\"creativecommons\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"http://creativecommons.org/licenses/by-nc-sa/3.0/\">\n\t\t\t\t\t\t\t\t\t\t\t<img id=\"creativecommons_img\" src=\"{$baseRef}images/CC.png\"/>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t<xsl:comment>#include virtual=\"/livedocs/googleAnalytics.ssi\"</xsl:comment>\n\t\t\t\t\t\t\t\t\t<xsl:comment>#include virtual=\"/ubi/analytics/analytics_ssi.html\"</xsl:comment>\n\t\t\t\t\t\t\t\t</xsl:if>\n\t\t\t\t\t\t\t</xsl:element>\n\t\t\t\t\t\t</xsl:element>\n\t\t\t\t\t</xsl:result-document>\n\t\t\t\t</xsl:if>\n\t\t\t</xsl:for-each>\n\t\t</xsl:for-each>\n\t</xsl:template>\n</xsl:stylesheet>\n"
  },
  {
    "path": "documentation/api-reference/templates/print.css",
    "content": "/*\n////////////////////////////////////////////////////////////////////////////////\n//\n//  ADOBE SYSTEMS INCORPORATED\n//  Copyright 2005-2008 Adobe Systems Incorporated\n//  All Rights Reserved.\n//\n//  NOTICE: Adobe permits you to use, modify, and distribute this file\n//  in accordance with the terms of the license agreement accompanying it.\n//\n////////////////////////////////////////////////////////////////////////////////\n*/\n\nbody {\n  color: #000000;\n  background: #ffffff;\n  font-family: \"Times New Roman\", Times, serif;\n  font-size: 12pt;\n}\na {\n  text-decoration: none;\n  color: #000000;\n}\npre {\n  white-space: -moz-pre-wrap; /* Mozilla */\n  white-space: -pre-wrap;     /* Opera 4-6 */\n  white-space: -o-pre-wrap;   /* Opera 7 */\n  word-wrap: break-word;      /* IE */\n}\n.titleTableTopNav, .titleTableSubNav, .logoImage {\n  display: none;\n}\n.packageFrame {\n  display: none;\n}\n.titleTableSubTitle {\n  font-weight: bold;\n}\n.classHeaderTableLabel {\n\tpadding-right: 10px;\n\tvertical-align: top;\n}\n.showHideLinks {\n  display: none;\n}\nhtml>body code {\n  font-size: 10pt;\n}\n.summaryTableTitle, .detailSectionHeader {\n  font-size: 14pt;\n  font-weight: bold;\n  padding-top: 15px;\n  padding-bottom: 5px;\n}\n.summaryTable {\n  border: 1px solid #000000;\n  border-collapse: collapse;\n  width: 100%;\n}\n.summaryTableDescription {\n  padding-bottom: 20px;\n}\n.summaryTableSignatureCol, .summaryTableOwnerCol, .summaryTableLastCol, .summaryTableCol {\n  border: 1px solid #000000;\n}\n.summaryTablePaddingCol {\n  border: 1px solid #000000;\n  border-right: 0px;\n}\n.summaryTableInheritanceCol, .summaryTableOperatorCol, .summaryTableStatementCol, .summaryTableSecondCol {\n  border: 1px solid #000000;\n  border-left: 0px;\n}\n.summaryTableLastCol {\n  vertical-align: top;\n}\n.detailHeader {\n  font-size: 13pt;\n  padding-top: 100px;\n}\n.detailHeaderName {\n  font-weight: bold;\n}\n.detailHeaderType {\n  padding-left: 5px;\n}\n.detailHeaderRule {\n  background: #FF0000;\n}\n.seeAlso {\n  padding-bottom: 20px;\n  margin-top: -20px;\n}\n.innertable {\n  border-collapse: collapse;\n}\n.innertable td,.innertable th {\n  border: 1px solid #000000;\n  padding-left: 5px;\n  padding-right: 5px;\n}\n.listing {\n  font-size: 10pt;\n}\n.feedbackLink {\n  display: none;\n}\n.copyright {\n  font-size: 10pt;\n}"
  },
  {
    "path": "documentation/api-reference/templates/processHTML.xslt",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n\n\tADOBE SYSTEMS INCORPORATED\n\tCopyright 2008 Adobe Systems Incorporated\n\tAll Rights Reserved.\n\n\tNOTICE: Adobe permits you to use, modify, and distribute this file\n\tin accordance with the terms of the license agreement accompanying it.\n\n-->\n<xsl:stylesheet version=\"2.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:saxon=\"http://saxon.sf.net/\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:ifn=\"urn:internal:functions\"\n  exclude-result-prefixes=\"saxon xs ifn\">\n  <xsl:import href=\"asdoc-util.xslt\"/>\n  <xsl:output method=\"html\" encoding=\"UTF-8\" omit-xml-declaration=\"yes\" use-character-maps=\"disable\" indent=\"no\"/>\n  <xsl:param name=\"titleBarFile\" select=\"''\"/>\n  <xsl:param name=\"index-file\" select=\"''\"/>\n  <xsl:param name=\"package-frame\" select=\"''\"/>\n  <xsl:param name=\"liveDocsTitleBarFile\" select=\"''\"/>\n  <xsl:param name=\"packages_map_name\" select=\"'packagemap.xml'\"/>\n  <xsl:param name=\"prog_language_name\" select=\"''\"/>\n  <xsl:template match=\"/\">\n    <xsl:choose>\n      <xsl:when test=\"$liveDocsTitleBarFile = '' and  $titleBarFile = ''\">\n        <xsl:apply-templates select=\"./html\"/>\n      </xsl:when>\n      <xsl:when test=\"$isLiveDocs\">\n        <xsl:apply-templates select=\"document($liveDocsTitleBarFile)/html\"/>\n      </xsl:when>\n      <xsl:when test=\"$isStandalone\">\n        <xsl:apply-templates select=\"document($titleBarFile)/html\"/>\n      </xsl:when>\n      <xsl:when test=\"$prog_language_name='javascript'\"/>\n      <xsl:otherwise>\n        <xsl:apply-templates select=\"document($titleBarFile)/html\"/>\n      </xsl:otherwise>\n    </xsl:choose>\n  </xsl:template>\n  <xsl:template match=\"node() | @*\" priority=\"-1\">\n    <xsl:copy>\n      <xsl:apply-templates select=\"@* | node()\"/>\n    </xsl:copy>\n  </xsl:template>\n  <xsl:template match=\"html\">\n    <xsl:copy-of select=\"$noLiveDocs\"/>\n    <xsl:choose>\n      <xsl:when test=\".//frameset\">\n        <xsl:copy-of select=\"$frameDocType\"/>\n      </xsl:when>\n      <xsl:otherwise>\n        <xsl:copy-of select=\"$docType\"/>\n      </xsl:otherwise>\n    </xsl:choose>\n    <xsl:choose>\n      <xsl:when test=\"$isLiveDocs\"/>\n      <xsl:otherwise>\n        <xsl:value-of select=\"$markOfTheWeb\"/>\n      </xsl:otherwise>\n    </xsl:choose>\n    <xsl:element name=\"html\">\n      <xsl:apply-templates/>\n      <xsl:copy-of select=\"$copyrightComment\"/>\n      <xsl:value-of select=\"$newline\"/>\n    </xsl:element>\n  </xsl:template>\n  <xsl:template match=\"title\">\n    <xsl:choose>\n        <xsl:when test=\"$index-file\">\n\t\t<xsl:copy>\n\t\t  <xsl:value-of select=\"$config/windowTitle\"/>\n\t\t</xsl:copy>\n        </xsl:when>\n        <xsl:when test=\"$package-frame\">\n          <title>\n            <xsl:value-of select=\"$config/title\"/>\n          </title>\n        </xsl:when>\n        <xsl:when test=\"$titleBarFile\">\n          <title>\n            <xsl:value-of select=\"$config/title\"/>\n          </title>\n        </xsl:when>\n      <xsl:otherwise>\n        <xsl:copy>\n          <xsl:value-of select=\"$config/title\"/>\n        </xsl:copy>\n      </xsl:otherwise>\n    </xsl:choose>\n    <link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" media=\"screen\"/>\n    <link rel=\"stylesheet\" href=\"print.css\" type=\"text/css\" media=\"print\"/>\n    <link rel=\"stylesheet\" href=\"override.css\" type=\"text/css\"/>\n  </xsl:template>\n  <xsl:template match=\"head/link\"/>\n  <xsl:template name=\"script\">\n    <xsl:variable name=\"loc.search\">\n      <xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'SearchResults']]/entry[2]/p\"/>\n    </xsl:variable>\n    <script language=\"javascript\" type=\"text/javascript\">\n      <xsl:text>&#xa;</xsl:text>function submitValue(){\n      <xsl:text>&#xa;</xsl:text>\n      var searchStr=document.getElementById('search-livedocs').value; var windowLocation=window.top.location.href.split(\"###\");      window.top.location=windowLocation[0]+\"###\"+searchStr; parent.frames[\"classFrame\"].location = \"search.html\";      document.getElementById('subTitle').childNodes.item(0).data = \"<xsl:value-of select=\"$loc.search\"/>\"; document.getElementById('search-livedocs').value=searchStr;      return false; <xsl:text>&#xa;</xsl:text><xsl:text>}</xsl:text>      <xsl:value-of select=\"$newline\"/>      <xsl:text>&#xa;</xsl:text> function noFrms(){ var doc =      parent.frames[\"classFrame\"].location.href.substring(window.location.href.lastIndexOf(\"/\")+1); if(doc==\"search.html\"){ var      curLoc=window.top.location.href.split(\"?\"); var openFile; if(curLoc[1]!=null){ curLoc = curLoc[1].split(\"###\"); curLoc =      curLoc[0].split(\"&amp;\"); openFile = window.top.location.href.substring(0,window.top.location.href.lastIndexOf(\"?\")+1); openFile =      openFile.substring(0,openFile.lastIndexOf(\"/\")+1)+curLoc[0]; }else{ curLoc[0]=\"overview.html\"; openFile =      window.top.location.href.substring(0,window.top.location.href.lastIndexOf(\"/\")+1)+curLoc[0]; } top.location=openFile; }else{      top.location=top.classFrame.location;\n      <xsl:text>&#xa;</xsl:text>\n      <xsl:text>}</xsl:text>\n      <xsl:text>&#xa;</xsl:text>}\n    </script>\n  </xsl:template>\n  <xsl:template match=\"td[@class='titleTableTitle']\">\n    <xsl:copy>\n      <xsl:copy-of select=\"@*\"/>\n      <xsl:choose>\n        <xsl:when test=\"$prog_language_name='javascript'\"/>\n        <xsl:otherwise>\n          <xsl:value-of select=\"$config/title\"/>\n        </xsl:otherwise>\n      </xsl:choose>\n    </xsl:copy>\n    <xsl:choose>\n      <xsl:when test=\"$config/options[@standalonesearch='true']\">\n        <td class=\"titleTableSearch\" align=\"center\">\n          <form class=\"searchForm\" method=\"get\" onsubmit=\"return submitValue();\">\n            <input class=\"hidden\" name=\"loc\" value=\"{$liveDocsSearchLocale}\" type=\"hidden\"/>\n            <input class=\"hidden\" name=\"termPrefix\" value=\"\" type=\"hidden\"/>\n            <input class=\"hidden\" name=\"term\" value=\"\" type=\"hidden\"/>\n            <input class=\"hidden\" name=\"area\" value=\"\" type=\"hidden\"/>\n            <input id=\"search-livedocs\" name=\"search_text\" value=\"\" title=\"{$liveDocsSearchString}\" type=\"text\"/>\n            <xsl:text> </xsl:text>\n            <input type=\"button\" name=\"action\" value=\"{$liveDocsSearch}\" onclick=\"submitValue()\"/>\n          </form>\n        </td>\n      </xsl:when>\n      <xsl:when test=\"$config/options[@ion='true']\">\n        <td class=\"titleTableSearch\" align=\"center\">\n          <xsl:comment>#include virtual=\"/livedocs/flex/3/langref/ionsearchform.ssi\"</xsl:comment>\n        </td>\n      </xsl:when>\n      <xsl:when test=\"$config/options[@livedocs='true']\">\n        <td class=\"titleTableSearch\" align=\"center\">\n          <form class=\"searchForm\" method=\"get\" action=\"http://www.adobe.com/cfusion/search/index.cfm\" target=\"adbe_window\"\n            onsubmit=\"this.term.value= this.termPrefix.value + &quot;\\&quot;&quot; + this.search_text.value + &quot;\\&quot;&quot;;\">\n            <input class=\"hidden\" name=\"loc\" value=\"en\" type=\"hidden\"/>\n            <input class=\"hidden\" name=\"termPrefix\" value=\"site:livedocs.adobe.com/labs/flex3   \" type=\"hidden\"/>\n            <input class=\"hidden\" name=\"term\" value=\"\" type=\"hidden\"/>\n            <input class=\"hidden\" name=\"area\" value=\"\" type=\"hidden\"/>\n            <input id=\"search-livedocs\" name=\"search_text\" value=\"\" title=\"Search\" type=\"text\"/>\n            <input type=\"submit\" name=\"action\" value=\"Search\"/>\n          </form>\n        </td>\n      </xsl:when>\n      <xsl:otherwise>\n        <td class=\"titleTableSearch\" align=\"center\">&#xA0;</td>\n      </xsl:otherwise>\n    </xsl:choose>\n  </xsl:template>\n  <xsl:template match=\"td[@class='titleTableSearch']\"/>\n  <xsl:template match=\"tr[@class='titleTableRow3']/td[@colspan='2']\">\n    <xsl:choose>\n      <xsl:when test=\"$config/options[@standalonesearch='true']\">\n        <td colspan=\"3\">&#xA0;</td>\n      </xsl:when>\n      <xsl:otherwise>\n        <td colspan=\"3\">&#xA0;</td>\n      </xsl:otherwise>\n    </xsl:choose>\n  </xsl:template>\n  <xsl:template match=\"tr[@class='titleTableRow2']/td[@class='titleTableSubTitle']\">\n    <xsl:choose>\n      <xsl:when test=\"$config/options[@standalonesearch='true']\">\n        <td class=\"titleTableSubTitle\" id=\"subTitle\" align=\"left\" colspan=\"2\">&#xA0;</td>\n      </xsl:when>\n      <xsl:otherwise>\n        <td class=\"titleTableSubTitle\" id=\"subTitle\" align=\"left\" colspan=\"2\">&#xA0;</td>\n      </xsl:otherwise>\n    </xsl:choose>\n  </xsl:template>\n  <xsl:template match=\"h3\">\n    <xsl:variable name=\"localized_value\">\n      <xsl:choose>\n        <xsl:when test=\"normalize-space(.) = 'Index'\">\n          <xsl:call-template name=\"getLocalizedString\">\n            <xsl:with-param name=\"key\">Index</xsl:with-param>\n          </xsl:call-template>\n        </xsl:when>\n        <xsl:otherwise>\n          <xsl:value-of select=\".\"/>\n        </xsl:otherwise>\n      </xsl:choose>\n    </xsl:variable>\n    <xsl:copy>\n      <xsl:copy-of select=\"@*\"/>\n      <xsl:value-of select=\"$localized_value\"/>\n    </xsl:copy>\n  </xsl:template>\n  <xsl:template match=\"a\">\n    <xsl:variable name=\"re-value\" select=\"normalize-space(.)\"/>\n    <xsl:variable name=\"value\" select=\"replace($re-value,'&lt;','&amp;lt;')\"/>\n    <xsl:variable name=\"localized_value\">\n      <xsl:choose>\n        <xsl:when test=\"$value = 'All Classes'\">\n          <xsl:call-template name=\"getLocalizedString\">\n            <xsl:with-param name=\"key\">allClasses</xsl:with-param>\n          </xsl:call-template>\n        </xsl:when>\n        <xsl:when test=\"$value = 'All Packages'\">\n          <xsl:call-template name=\"getLocalizedString\">\n            <xsl:with-param name=\"key\">allPackages</xsl:with-param>\n          </xsl:call-template>\n        </xsl:when>\n        <xsl:when test=\"$value = 'Language Elements'\">\n          <xsl:call-template name=\"getLocalizedString\">\n            <xsl:with-param name=\"key\">LanguageElements</xsl:with-param>\n          </xsl:call-template>\n        </xsl:when>\n        <xsl:when test=\"$value = 'Appendixes'\">\n          <xsl:call-template name=\"getLocalizedString\">\n            <xsl:with-param name=\"key\">Appendix</xsl:with-param>\n          </xsl:call-template>\n        </xsl:when>\n        <xsl:when test=\"$value = 'Index'\">\n          <xsl:call-template name=\"getLocalizedString\">\n            <xsl:with-param name=\"key\">Index</xsl:with-param>\n          </xsl:call-template>\n        </xsl:when>\n        <xsl:when test=\"$value = 'Conventions'\">\n          <xsl:call-template name=\"getLocalizedString\">\n            <xsl:with-param name=\"key\">Conventions</xsl:with-param>\n          </xsl:call-template>\n        </xsl:when>\n        <xsl:when test=\"$value = 'No Frames'\">\n          <xsl:call-template name=\"getLocalizedString\">\n            <xsl:with-param name=\"key\">NoFrames</xsl:with-param>\n          </xsl:call-template>\n        </xsl:when>\n        <xsl:when test=\"$value = 'Properties'\">\n          <xsl:call-template name=\"getLocalizedString\">\n            <xsl:with-param name=\"key\">Properties</xsl:with-param>\n          </xsl:call-template>\n        </xsl:when>\n        <xsl:when test=\"$value = 'Constructor'\">\n          <xsl:call-template name=\"getLocalizedString\">\n            <xsl:with-param name=\"key\">Constructor</xsl:with-param>\n          </xsl:call-template>\n        </xsl:when>\n        <xsl:when test=\"$value = 'Methods'\">\n          <xsl:call-template name=\"getLocalizedString\">\n            <xsl:with-param name=\"key\">Methods</xsl:with-param>\n          </xsl:call-template>\n        </xsl:when>\n        <xsl:when test=\"$value = 'Functions'\">\n          <xsl:call-template name=\"getLocalizedString\">\n            <xsl:with-param name=\"key\">Functions</xsl:with-param>\n          </xsl:call-template>\n        </xsl:when>\n        <xsl:when test=\"$value = 'Events'\">\n          <xsl:call-template name=\"getLocalizedString\">\n            <xsl:with-param name=\"key\">Events</xsl:with-param>\n          </xsl:call-template>\n        </xsl:when>\n        <xsl:when test=\"$value = 'Effects'\">\n          <xsl:call-template name=\"getLocalizedString\">\n            <xsl:with-param name=\"key\">Effects</xsl:with-param>\n          </xsl:call-template>\n        </xsl:when>\n        <xsl:when test=\"$value = 'Constants'\">\n          <xsl:call-template name=\"getLocalizedString\">\n            <xsl:with-param name=\"key\">Constants</xsl:with-param>\n          </xsl:call-template>\n        </xsl:when>\n        <xsl:when test=\"$value = 'Interfaces'\">\n          <xsl:call-template name=\"getLocalizedString\">\n            <xsl:with-param name=\"key\">Interfaces</xsl:with-param>\n          </xsl:call-template>\n        </xsl:when>\n        <xsl:when test=\"$value = 'Classes'\">\n          <xsl:call-template name=\"getLocalizedString\">\n            <xsl:with-param name=\"key\">Classes</xsl:with-param>\n          </xsl:call-template>\n        </xsl:when>\n        <xsl:when test=\"$value = 'Examples'\">\n          <xsl:call-template name=\"getLocalizedString\">\n            <xsl:with-param name=\"key\">Examples</xsl:with-param>\n          </xsl:call-template>\n        </xsl:when>\n        <xsl:when test=\"$value = 'Styles'\">\n          <xsl:call-template name=\"getLocalizedString\">\n            <xsl:with-param name=\"key\">Styles</xsl:with-param>\n          </xsl:call-template>\n        </xsl:when>\n        \n        <xsl:when test=\"$value = 'Skin States'\">\n          <xsl:call-template name=\"getLocalizedString\">\n            <xsl:with-param name=\"key\">SkinStates</xsl:with-param>\n          </xsl:call-template>\n        </xsl:when>\n        <xsl:when test=\"$value = 'Skin Parts'\">\n          <xsl:call-template name=\"getLocalizedString\">\n            <xsl:with-param name=\"key\">SkinParts</xsl:with-param>\n          </xsl:call-template>\n        </xsl:when>\n        \n        <xsl:when test=\"$value = 'Symbols'\">\n          <xsl:call-template name=\"getLocalizedString\">\n            <xsl:with-param name=\"key\">Symbols</xsl:with-param>\n          </xsl:call-template>\n        </xsl:when>\n        <xsl:otherwise>\n          <xsl:value-of select=\"$value\"/>\n        </xsl:otherwise>\n      </xsl:choose>\n    </xsl:variable>\n    <xsl:copy>\n      <xsl:copy-of select=\"@*\"/>\n      <xsl:value-of select=\"$localized_value\"/>\n    </xsl:copy>\n  </xsl:template>\n  <!-- PSEN: 06/02/2008 We should always show the \"No Frames\" link  <xsl:template match=\"a[@onclick='top.location=top.classFrame.location']\">    <xsl:if test=\"$config/options[@standalonesearch='true']\">\t  <a href=\"\" onclick=\"noFrms();\">          <xsl:call-template name=\"getLocalizedString\">            <xsl:with-param name=\"key\">NoFrames</xsl:with-param>          </xsl:call-template>      </a>    </xsl:if>  </xsl:template>-->\n  <xsl:template match=\"script\">\n    <xsl:element name=\"script\">\n      <xsl:apply-templates select=\"@* | node()\"/>\n      <xsl:value-of select=\"$newline\"/>\n    </xsl:element>\n    <xsl:if test=\"$config/options[@standalonesearch='true']\">\n      <xsl:call-template name=\"script\"/>\n    </xsl:if>\n  </xsl:template>\n  <xsl:template match=\"text()\">\n    <xsl:value-of disable-output-escaping=\"no\" select=\".\"/>\n  </xsl:template>\n  <xsl:template match=\"comment()\">\n    <xsl:comment>\n      <xsl:value-of disable-output-escaping=\"yes\" select=\".\"/>\n    </xsl:comment>\n  </xsl:template>\n  <xsl:template match=\"input[@name='termPrefix']/@value\">\n    <xsl:attribute name=\"value\">\n      <xsl:value-of select=\"$config/livedocs/searchsite/.\"/>\n    </xsl:attribute>\n  </xsl:template>\n  <xsl:template match=\"input/@value[.='Search']\">\n    <xsl:attribute name=\"value\">\n      <xsl:value-of select=\"$asdoc_terms/row[entry[1][p/text() = 'searchLivedocs']]/entry[2]/p\"/>\n    </xsl:attribute>\n  </xsl:template>\n  <xsl:template match=\"input[@name='loc']/@value\">\n    <xsl:attribute name=\"value\">\n      <xsl:value-of select=\"$config/livedocs/locale/.\"/>\n    </xsl:attribute>\n  </xsl:template>\n  <xsl:template match=\"input[@name='search_text']/@title\">\n    <xsl:attribute name=\"title\">\n      <xsl:value-of select=\"$config/livedocs/searchstring/.\"/>\n    </xsl:attribute>\n  </xsl:template>\n  <xsl:template match=\"input[@name='action']\">\n    <xsl:if test=\"$config/options[@standalonesearch='true']\">\n      <input>\n        <xsl:attribute name=\"type\">\n          <xsl:if test=\"contains(@type,'submit')\">\n            <xsl:value-of select=\"replace(@type,'submit','button')\"/>\n          </xsl:if>\n        </xsl:attribute>\n        <xsl:attribute name=\"name\">\n          <xsl:value-of select=\"'action'\"/>\n        </xsl:attribute>\n        <xsl:attribute name=\"value\">\n          <xsl:value-of select=\"'Search'\"/>\n        </xsl:attribute>\n        <xsl:attribute name=\"onclick\">\n          <xsl:value-of select=\"'submitValue()'\"/>\n        </xsl:attribute>\n      </input>\n    </xsl:if>\n  </xsl:template>\n  <xsl:template match=\"form/@action\">\n    <xsl:attribute name=\"action\">\n      <xsl:value-of select=\"$config/livedocs/searchservlet/.\"/>\n    </xsl:attribute>\n  </xsl:template>\n  <xsl:template match=\"frameset/@rows\">\n    <xsl:choose>\n      <xsl:when test=\"$prog_language_name='javascript'\"/>\n      <xsl:otherwise>\n        <xsl:if test=\"$index-file\">\n          <xsl:attribute name=\"rows\">\n            <xsl:text>80,*</xsl:text>\n          </xsl:attribute>\n        </xsl:if>\n        <xsl:if test=\"$package-frame\">\n          <xsl:attribute name=\"rows\">\n            <xsl:text>40%,60%</xsl:text>\n          </xsl:attribute>\n        </xsl:if>\n      </xsl:otherwise>\n    </xsl:choose>\n  </xsl:template>\n  <xsl:template match=\"td[@class='titleTableTopNav']\">\n    <xsl:choose>\n      <xsl:when test=\"$prog_language_name='javascript'\"/>\n      <xsl:otherwise>\n        <td class=\"titleTableTopNav\" align=\"right\">\n          <xsl:apply-templates/>\n        </td>\n      </xsl:otherwise>\n    </xsl:choose>\n  </xsl:template>\n</xsl:stylesheet>\n"
  },
  {
    "path": "documentation/api-reference/templates/style.css",
    "content": "/*\n////////////////////////////////////////////////////////////////////////////////\n//\n//  ADOBE SYSTEMS INCORPORATED\n//  Copyright 2005-2008 Adobe Systems Incorporated\n//  All Rights Reserved.\n//\n//  NOTICE: Adobe permits you to use, modify, and distribute this file\n//  in accordance with the terms of the license agreement accompanying it.\n//\n////////////////////////////////////////////////////////////////////////////////\n*/\n\n.titleTable {\n\twidth: 100%;\n}\n.titleTableTitle {\n\twhite-space: nowrap;\n\tpadding-left: 15px;\n\tpadding-right: 5px;\n\tfont-size: 13px;\n\theight: 44px;\n\tbackground-image: url(images/titleTableTop.jpg);\n\tbackground-repeat: repeat-x;\n}\n.titleTableSearch {\n\twhite-space: nowrap;\n\tbackground-image: url(images/titleTableTop.jpg);\n\tbackground-repeat: repeat-x;\n\tpadding-right: 10px;\n\twidth: 220;\n}\n.searchForm {\n\tmargin-top: 0px;\n\tmargin-bottom: 0px;\n}\n.titleTableTopNav {\n\tfont-size: 12px;\n\tbackground-image: url(images/titleTableTop.jpg);\n\tbackground-repeat: repeat-x;\n}\n.titleTableLogo {\n\twidth: 76px;\n\theight: 80px;\n\tvertical-align: top;\n}\n.titleTableRow2 {\n\tcolor: #000000;\n\theight: 31px;\n\tbackground-image: url(images/titleTableMiddle.jpg);\n\tbackground-repeat: repeat-x;\n}\n.titleTableSubTitle {\n\tfont-size: 20px;\n\tpadding-left: 15px;\n\tpadding-right: 5px;\n}\n.titleTableSubNav {\n\t//white-space: nowrap;\n\tfont-size: 12px;\n}\n.titleTableRow3 {\n\theight: 5px;\n\tbackground-image: url(images/titleTableBottom.jpg);\n\tbackground-repeat: repeat-x;\n}\n.logoImage {\n\twidth: 76px;\n\theight: 80px;\n}\n\n.classHeaderTable {\n\tmargin-top: 20px;\n}\n.classHeaderTable td {\n\tvertical-align: top;\n\tpadding-bottom: 4px;\n}\n.classHeaderTableLabel {\n\tfont-weight: bold;\n\tpadding-right: 15px;\n}\n.classSignature {\n\ttext-indent: -20px;\n\tpadding-left: 20px;\n}\n.inheritanceList {\n\ttext-indent: -20px;\n\tpadding-left: 20px;\n}\n.inheritArrow {\n\twidth: 15px;\n\theight: 9px;\n}\n.mxmlSyntax {\n\tmargin-bottom: -13px;\n}\n.collapsedImage {\n\twidth: 9px;\n\theight: 9px;\n\tborder: 0;\n}\n.expandedImage {\n\twidth: 9px;\n\theight: 9px;\n\tborder: 0;\n}\n.classFrameContent {\n\tmargin-right: 5px;\n\tmargin-left: 10px;\n\tmargin-top: 10px;\n\tmargin-bottom: 10px;\n}\n.classFrameContent td {\n\twhite-space: nowrap;\n\tpadding-right: 5px;\n}\n\n.eclipseBody {\n\tdisplay: none;\n}\n\t\n/** html {\n\toverflow-y:scroll;\n}*/\n\nimg {\n\tborder:0;\n}\n\n.annotation {\n\tfont-size: 20px;\n\tmargin-top: 20px;\n}\n\n.label {\n\tcolor: #444444;\n\tfont-weight: bold;\n}\n\nstrong {\n\tcolor: #444444;\n}\n\n.summarySection {\n\tmargin-left: 20px;\n\tmargin-right: 10px;\n}\n.summaryTableTitle {\n\tfont-weight: bold;\n\tfont-size: 18px;\n\tpadding-top: 20px;\n\tpadding-bottom: 5px;\n}\n* .summaryTable {\n\tmargin-top: 10px;\n\tborder: #999999 1px solid;\n\twidth: 100%;\n\tmargin-bottom: 20px;\n}\nhtml>body .summaryTable {\n\tmargin-top: 10px;\n\tborder: #999999 1px solid;\n\twidth: 100%;\n\tmargin-bottom: 20px;\n\tmargin-right: 10px;\n}\n.summaryTable th {\n\tcolor: #FFFFFF;\n\tbackground-color: #627C9D;\n\twhite-space: nowrap;\n}\n.summaryTable td {\n\tborder-top: #999999 1px solid;\n\tvertical-align: top;\n}\n.summaryTablePaddingCol {\n\twidth: 5px;\n}\n.summaryTableInheritanceCol {\n\twidth: 14px;\n}\n.summaryTableSignatureCol {\n\tpadding-right: 10px;\n}\n.summaryTableOperatorCol {\n\tpadding-left: 10px;\n\tpadding-right: 10px;\n\tfont-weight: bold;\n}\n.summaryTableStatementCol {\n\tpadding-left: 10px;\n\tpadding-right: 10px;\n\tfont-weight: bold;\n\twhite-space: nowrap;\n}\n.summarySignature {\n\ttext-indent: -20px;\n\tpadding-left: 20px;\n}\n.summaryTableOwnerCol {\n\tpadding-right: 10px;\n\twidth: 10px;\n}\n.summaryTableCol, .summaryTableSecondCol {\n}\n.signatureLink {\n\tfont-weight: bold;\n}\n.summaryTableDescription {\n\tcolor: #333333;\n}\n.summaryTableLastCol {\n\tpadding-right: 10px;\n}\n.inheritedSummaryImage {\n\twidth: 14px;\n\theight: 14px;\n}\n\n.showHideLink {\n}\n.showHideLinkImage {\n\twidth: 9px;\n\theight: 9px;\n}\n.hideInheritedConstant {\n\tdisplay: none;\n}\n.showInheritedConstant {\n\tdisplay: inline;\n}\n.hideInheritedProtectedConstant {\n\tdisplay: none;\n}\n.showInheritedProtectedConstant {\n\tdisplay: inline;\n}\n.hideInheritedProperty {\n\tdisplay: none;\n}\n.showInheritedProperty {\n\tdisplay: inline;\n}\n.hideInheritedProtectedProperty {\n\tdisplay: none;\n}\n.showInheritedProtectedProperty {\n\tdisplay: inline;\n}\n.hideInheritedMethod {\n\tdisplay: none;\n}\n.showInheritedMethod {\n\tdisplay: inline;\n}\n.hideInheritedProtectedMethod {\n\tdisplay: none;\n}\n.showInheritedProtectedMethod {\n\tdisplay: inline;\n}\n.hideInheritedEvent {\n\tdisplay: none;\n}\n.showInheritedEvent {\n\tdisplay: inline;\n}\n.hideInheritedStyle {\n\tdisplay: none;\n}\n.showInheritedStyle {\n\tdisplay: inline;\n}\n.hideInheritedEffect {\n\tdisplay: none;\n}\n.showInheritedEffect {\n\tdisplay: inline;\n}\n\n\n.detailSectionHeader {\n\tcolor: #434343;\n\tfont-size: 18px;\n\tpadding-left: 10px;\n\tpadding-top: 4px;\n\tpadding-bottom: 4px;\n\tmargin-top: 40px;\n\tmargin-bottom: 3px;\n\tbackground-image: url(images/detailSectionHeader.jpg);\n\tbackground-repeat: repeat-x;\n}\n.detailHeader {\n\tmargin-left: 20px;\n\tmargin-top: 10px;\n\tmargin-bottom: 3px;\n}\n.detailHeaderName {\n\tfont-weight: bold;\n\tfont-size: 16px;\n\tvertical-align: baseline;\n\twhite-space: nowrap;\n}\n.detailHeaderType {\n\tfont-size: 12px;\n\tvertical-align: baseline;\n\tpadding-right: 10px;\n\tpadding-left: 7px;\n\twhite-space: nowrap;\n}\n.detailHeaderParens {\n\tfont-size: 14px;\n\tfont-weight: bold;\n\tpadding-left: 1px;\n\tpadding-bottom: 2px;\n}\n.detailHeaderRule {\n\tbackground-image: url(images/detailHeaderRule.jpg);\n\tbackground-repeat: repeat-x;\n\twidth: 100%;\n\tbackground-position: 50%;\n}\n.detailBody {\n\tmargin-left: 20px;\n\tmargin-right: 15px;\n\tmargin-bottom: 20px;\n}\n.exampleHeader {\n\tbackground-color: #C8D1DF;\n\tpadding-left: 10px;\n\tpadding-top: 3px;\n\tpadding-bottom: 3px;\n}\n\n.seeAlso {\n\tmargin-top: -13px;\n\tpadding-left: 20px;\n}\n\n/*\n#header {\n\tpadding: 0;\n\tmargin: 0;\n\tborder: 2px solid\n}\n*/\n\nbody {\n\tfont-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;\n\tcolor: #000000;\n\tbackground-color:#FFFFFF;\n\tmargin: 0px;\n\tpadding: 0px;\n}\n\nbody, td, th {\n\tfont-size: 13px;\n}\n\n.MainContent {\n\tmargin-left: 20px;\n\tmargin-right: 10px;\n\tmargin-bottom: 10px;\n}\n\ncode {\n\tfont-family: \"Lucida Console\", \"Courier New\", Courier, monospace; \n\tfont-size: 12px;\n}\npre {\n\tfont-family: \"Lucida Console\", \"Courier New\", Courier, monospace; \n\tfont-size: 12px;\n}\n\nth\t{\n\ttext-align: left;\n\tfont-weight: bold;\n\tvertical-align: bottom;\n}\n\ntable {\n\tbackground-color: white;\n}\n\ntable.withBorder {\n\tborder-color: #BBBBBB;\n\tborder-width: 1px;\n\tborder-style: solid;\n}\n\n.innertable {\n\tborder-collapse: collapse; /* to eliminate the default table cellspacing=2 */\n}\n\n.innertable th {\n\tborder: 1px solid #000000;\n\tbackground:#DDDDDD;\n\tpadding: 2px 3px 2px 3px;\n}\n\n.innertable td {\n\tborder: 1px solid #000000;\n\tpadding: 2px 3px 2px 3px;\n}\n\n.paramSpacer {\n\tfont-size: 5px;\n}\n\n/* Custom Classes */\n.row0 {\n\tbackground-color: #F2F2F2;\n}\n\n.row1 {\n\tbackground-color: #FFFFFF;\n}\n\n.prow0 {\n\tbackground-color: #F2F2F2;\n}\n\n.prow1 {\n\tbackground-color: #FFFFFF;\n}\n\n.idxrow {\n\tpadding-top: 5px;\n}\n\n.SummaryTableHeader {\n    background-color: #CCCCCC;\n}\n\n.InheritedTableHeader {\n    background-color: #EEEEEE;\n}\n\n.PackageTableHeader {\n    background-color: #EEEEEE;\n}\n\n\n/* Links */\na:link {\n\tcolor: #0000CC;\n\ttext-decoration: none;\n}\n\na:visited {\n    color: #0000CC;\n\ttext-decoration: none;\n}\n\na:hover {\n\ttext-decoration: underline;\n\tcolor: #0000CC;\n}\n\na:active {\n\ttext-decoration: none;\n\tcolor: #CC0000;\n}\n\n/* Headings */\nh1, h2, h3, h4, h5, h6\t{\n\tfont-family: \"Trebuchet MS\", \"Bitstream Vera Sans\", verdana, lucida, arial, helvetica, sans-serif;\n\tfont-weight: bold;\n\tmargin-top: 3px;\n\tmargin-bottom: 3px;\n\tletter-spacing: 1px;\n\twidth: 90%;\n}\n\nh1 {\n\tfont-size: 18px;\n}\n\nh2 {\n\tfont-size: 16px;\n}\n\nh3 {\n\tfont-size: 14px;\n}\n\nh4 {\n\tfont-size: 12px;\n\tcolor: #666666;\n}\n\nh5 {\n\tfont-size: 11px;\n}\n.copyright {\n   margin-top: 30px;\n   color: #777777;\n   font-size: 10px;\n   padding-bottom: 5px;\n}\n.inheritanceList {\n\tline-height: 19px;\n}\n.private {\n    color: #999999;\n}\n.flashonly {\n    color: #000000;\n}\n.flexonly {\n    display:none;\n    color: #000000;\n}\n.hide {\n\tdisplay:none;\n}\n.feedbackLink {\n/*\tdisplay:none;  */\n}\n\n/* IE */\n* html .listing {\n   width: 93%;\n   padding-left: 6%;\n   padding-right: 5px;\n   padding-top: 5px;\n   padding-bottom: 5px;\n   overflow-x: auto;\t\n   background-color: #F2F2F2;\n   margin-bottom: 10px;\n   margin-top: 10px;\n   font-family: \"Lucida Console\", \"Courier New\", Courier, monospace;\n   font-size: 12px;\n}\n\n/* Firefox, Netscape */\nhtml>body .listing pre\n{\n   overflow: auto;\n   padding-left: 40px;\n   padding-right: 5px;\n   padding-top: 5px;\n   padding-bottom: 5px;\n   background-color: #F2F2F2;\n   margin-top: 10px;\n   margin-bottom: 10px;\n   font-family: \"Lucida Console\", \"Courier New\", Courier, monospace;\n   font-size: 12px;\n}   \n\n.listingIcons\n{\n\tpadding: 0px;\n\tmargin-top: 10px;\n\theight: 15px;\n}  \n\n.pageTop\n{\n\theight:10px;\n}\n\n.hideInheritedSkinState {\n\tdisplay: none;\n}\n\n.showInheritedSkinState {\n\tdisplay: inline;\n}\n\n.hideInheritedSkinPart {\n\tdisplay: none;\n}\n\n.showInheritedSkinPart {\n\tdisplay: inline;\n}\n\n/****** start mobile tweaks ******/\n.titleTable tr td.titleTableTopNav a,\n\t.titleTable tr td.titleTableSubNav a {\n\tpadding-right: 6px;\n\tpadding-left: 6px;\n\tborder-right: solid 1px #333;\n}\n.titleTable tr td.titleTableTopNav a:last-of-type,\n\t.titleTable tr td.titleTableSubNav a:last-of-type,\n\t.titleTable tr td.titleTableTopNav a#framesLink1,\n\t.titleTable tr td.titleTableTopNav a#noFramesLink11 {\n\tborder-right: none;\n}\n@media only screen and (max-width: 600px) {\n\t.titleTable tr {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tflex-wrap: wrap;\n\t}\n\t.titleTable tr.titleTableRow2 {\n\t\theight: auto;\n\t\tbackground-size: contain;\n\t}\n\t.titleTable tr td {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tbackground-size: contain;\n\t\talign-self: stretch;\n\t\tmin-height: 32px;\n\t\tflex-grow: 1;\n\t\tpadding-left: 10px;\n\t\tpadding-right: 10px;\n\t}\n\t.titleTable tr td.titleTableTitle {\n\t\twhite-space: normal;\n\t\tflex-grow: 2;\n\t}\n\t.titleTable tr td.titleTableLogo {\n\t\tdisplay: none;\n\t}\n\t.titleTable tr td.titleTableSubTitle {\n\t\tflex-grow: 2;\n\t}\n\t.titleTable tr td.titleTableTopNav {\n\t\tjustify-content: end;\n\t}\n\t.titleTable tr td.titleTableSubNav {\n\t\tjustify-content: end;\n\t}\n\t.MainContent, .summarySection, .detailHeader, .detailBody {\n\t\tmargin-left: 8px;\n\t\tmargin-right: 8px;\n\t}\n\t.summaryTable {\n\t\toverflow-x: auto;\n\t\tdisplay: block;\n\t}\n\t.detailHeader tr {\n\t\tdisplay: flex;\n\t\talign-items: baseline;\n\t\tflex-wrap: wrap;\n\t}\n\t.detailHeaderName {\n\t\tword-break: break-word;\n\t\twhite-space: normal;\n\t}\n\t.allIndexTable {\n\t\toverflow-x: auto;\n\t\tdisplay: block;\n\t}\n\t.idxrow,\n\t.seeAlso a,\n\t.detailBody code {\n\t\t/* word-break: normal; */\n\t\toverflow-wrap: anywhere;\n\t\tword-break: break-word;\n\t}\n\t.titleTable tr td.titleTableSearch {\n\t\tdisplay: none;\n\t}\n\n\t/* title bar in a frame */\n\t.titleTable.titleTableFrame tr {\n\t\tflex-wrap: unset;\n\t}\n\t.titleTable.titleTableFrame tr td.titleTableTopNav {\n\t\tflex-grow: 3;\n\t}\n\t.titleTable.titleTableFrame tr td.titleTableTitle {\n\t\tflex-grow: 1;\n\t}\n}\n@media only screen and (max-width: 450px) {\n\t.titleTable.titleTableFrame tr td.titleTableTopNav a:not(#noFramesLink1),\n\t\t.titleTable.titleTableFrame tr td.titleTableSubNav a {\n\t\tdisplay: none !important;\n\t}\n}\n\n\ntable.hideInheritedConstant {\n\tdisplay: none;\n}\ntable.showInheritedConstant {\n\tdisplay: block;\n}\ntable.hideInheritedProtectedConstant {\n\tdisplay: none;\n}\ntable.showInheritedProtectedConstant {\n\tdisplay: block;\n}\ntable.hideInheritedProperty {\n\tdisplay: none;\n}\ntable.showInheritedProperty {\n\tdisplay: block;\n}\ntable.hideInheritedProtectedProperty {\n\tdisplay: none;\n}\ntable.showInheritedProtectedProperty {\n\tdisplay: block;\n}\ntable.hideInheritedMethod {\n\tdisplay: none;\n}\ntable.showInheritedMethod {\n\tdisplay: block;\n}\ntable.hideInheritedProtectedMethod {\n\tdisplay: none;\n}\ntable.showInheritedProtectedMethod {\n\tdisplay: block;\n}\ntable.hideInheritedEvent {\n\tdisplay: none;\n}\ntable.showInheritedEvent {\n\tdisplay: block;\n}\ntable.hideInheritedStyle {\n\tdisplay: none;\n}\ntable.showInheritedStyle {\n\tdisplay: block;\n}\ntable.hideInheritedEffect {\n\tdisplay: none;\n}\ntable.showInheritedEffect {\n\tdisplay: block;\n}"
  },
  {
    "path": "documentation/api-reference/templates/stylesSummary.xslt",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n\n\tADOBE SYSTEMS INCORPORATED\n\tCopyright 2008 Adobe Systems Incorporated\n\tAll Rights Reserved.\n\n\tNOTICE: Adobe permits you to use, modify, and distribute this file\n\tin accordance with the terms of the license agreement accompanying it.\n\n-->\n<xsl:stylesheet version=\"2.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n\t<xsl:output method=\"xml\" version=\"1.0\" encoding=\"UTF-8\" indent=\"yes\"/>\n\t<xsl:param name=\"ditaFileDir\" select=\"''\"/>\n\t<xsl:template match=\"/\">\n\t\t<allClasses>\n\t\t\t<xsl:apply-templates select=\"//apiItemRef\">\n\t\t\t\t<xsl:sort select=\"@href\" order=\"ascending\"/>\n\t\t\t</xsl:apply-templates>\n\t\t</allClasses>\n\t</xsl:template>\n\t<xsl:template match=\"apiItemRef\">\n\t\t<xsl:variable name=\"ditaFileName\">\n\t\t\t<xsl:value-of select=\"concat($ditaFileDir,@href)\"/>\n\t\t</xsl:variable>\n\t\t<xsl:for-each select=\"document($ditaFileName)/apiPackage\">\n\t\t\t<apiPackage id=\"{@id}\">\n\t\t\t\t<apiName>\n\t\t\t\t\t<xsl:value-of select=\"./apiName\"/>\n\t\t\t\t</apiName>\n\t\t\t\t<xsl:apply-templates select=\"apiClassifier\"/>\n\t\t\t</apiPackage>\n\t\t</xsl:for-each>\n\t</xsl:template>\n\t<xsl:template match=\"apiClassifier\">\n\t\t<apiClassifier id=\"{@id}\">\n\t\t\t<apiName>\n\t\t\t\t<xsl:value-of select=\"apiName/.\"/>\n\t\t\t</apiName>\n\t\t\t<xsl:apply-templates select=\"apiClassifierDetail\"/>\n\t\t\t<xsl:apply-templates select=\"prolog/asMetadata\"/>\n\t\t</apiClassifier>\n\t</xsl:template>\n\t<xsl:template match=\"apiClassifierDetail\">\n\t\t<apiClassifierDetail>\n\t\t\t<xsl:apply-templates select=\"apiClassifierDef\"/>\n\t\t</apiClassifierDetail>\n\t</xsl:template>\n\t<xsl:template match=\"prolog/asMetadata\">\n\t\t<prolog>\n\t\t\t<asMetadata>\n\t\t\t\t<xsl:apply-templates select=\"styles\"/>\n\t\t\t</asMetadata>\n\t\t</prolog>\n\t</xsl:template>\n\t<xsl:template match=\"styles\">\n\t\t<styles>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</styles>\n\t</xsl:template>\n\t<xsl:template match=\"apiClassifierDef\">\n\t\t<apiClassifierDef>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</apiClassifierDef>\n\t</xsl:template>\n\t<xsl:template match=\"node()\">\n\t\t<xsl:copy copy-namespaces=\"no\">\n\t\t\t<xsl:copy-of select=\"@*\"/>\n\t\t\t<xsl:apply-templates select=\"node()\"/>\n\t\t</xsl:copy>\n\t</xsl:template>\n</xsl:stylesheet>\n"
  },
  {
    "path": "documentation/api-reference/templates/title-bar.html",
    "content": "<html>\n\t<head>\n\t\t<title>ActionScript 3.0 Language Reference</title>\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n\t\t<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" media=\"screen\" />\n\t\t<link rel=\"stylesheet\" href=\"print.css\" type=\"text/css\" media=\"print\" />\n\t\t<script language=\"javascript\" type=\"text/javascript\" src=\"asdoc.js\"></script>\n\t</head>\n\t<body>\n\t\t<a name=\"top\"></a>\n\t\t<table class=\"titleTable titleTableFrame\" cellpadding=\"0\" cellspacing=\"0\">\n\t\t\t<tbody>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=\"titleTableTitle\" align=\"left\">ActionScript&#xA0;3.0&#xA0;Language&#xA0;and&#xA0;Components&#xA0;Reference</td>\n\t\t\t\t\t<td class=\"titleTableTopNav\" align=\"right\">\n\t\t\t\t\t\t<a target=\"classFrame\" href=\"package-summary.html\" onclick=\"loadClassListFrame('all-classes.html')\">All Packages</a>\n\t\t\t\t\t\t<a target=\"classFrame\" href=\"class-summary.html\" onclick=\"loadClassListFrame('all-classes.html')\">All Classes</a>\n\t\t\t\t\t\t<a target=\"classFrame\" href=\"all-index-A.html\" onclick=\"loadClassListFrame('index-list.html')\">Index</a>\n\t\t\t\t\t\t<a id=\"noFramesLink1\" href=\"\" onclick=\"top.location=top.classFrame.location\">No Frames</a>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class=\"titleTableLogo\" align=\"right\" rowspan=\"3\">\n\t\t\t\t\t\t<picture>\n\t\t\t\t\t\t\t<img src=\"images/logo.jpg\" srcset=\"images/logo@2x.jpg 2x\" class=\"logoImage\" title=\"Feathers Logo\" alt=\"Feathers Logo\" />\n\t\t\t\t\t\t</picture>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class=\"titleTableRow2\">\n\t\t\t\t\t<td class=\"titleTableSubTitle\" id=\"subTitle\" align=\"left\">&#xA0;</td>\n\t\t\t\t\t<td class=\"titleTableSubNav\" id=\"subNav\" align=\"right\">\n\t\t\t\t\t<a id=\"propertiesLink\" href=\"#top\" onclick=\"javascript:titleBar_gotoClassFrameAnchor('propertySummary');\" style=\"display:none\">Properties</a>\n\t\t\t\t\t<span id=\"propertiesBar\" style=\"display:none\"> | </span>\n\t\t\t\t\t<a id=\"packagePropertiesLink\" href=\"#top\" onclick=\"javascript:titleBar_gotoClassFrameAnchor('propertySummary');\" style=\"display:none\">Properties</a>\n\t\t\t\t\t<span id=\"packagePropertiesBar\" style=\"display:none\"> | </span>\n\t\t\t\t\t<a id=\"constructorLink\" href=\"#top\" onclick=\"javascript:titleBar_gotoClassFrameAnchor('constructorSummary');\" style=\"display:none\">Constructor</a>\n\t\t\t\t\t<span id=\"constructorBar\" style=\"display:none\"> | </span>\n\t\t\t\t\t<a id=\"methodsLink\" href=\"#top\" onclick=\"javascript:titleBar_gotoClassFrameAnchor('methodSummary');\" style=\"display:none\">Methods</a>\n\t\t\t\t\t<span id=\"methodsBar\" style=\"display:none\"> | </span>\n\t\t\t\t\t<a id=\"packageFunctionsLink\" href=\"#top\" onclick=\"javascript:titleBar_gotoClassFrameAnchor('methodSummary');\" style=\"display:none\">Functions</a>\n\t\t\t\t\t<span id=\"packageFunctionsBar\" style=\"display:none\"> | </span>\n\t\t\t\t\t<a id=\"eventsLink\" href=\"#top\" onclick=\"javascript:titleBar_gotoClassFrameAnchor('eventSummary');\" style=\"display:none\">Events</a>\n\t\t\t\t\t<span id=\"eventsBar\" style=\"display:none\"> | </span>\n\t\t\t\t\t<a id=\"stylesLink\" href=\"#top\" onclick=\"javascript:titleBar_gotoClassFrameAnchor('styleSummary');\" style=\"display:none\">Styles</a>\n\t\t\t\t\t<span id=\"stylesBar\" style=\"display:none\"> | </span>\n\t\t\t\t\t<a id=\"SkinPartLink\" href=\"#top\" onclick=\"javascript:titleBar_gotoClassFrameAnchor('SkinPartSummary');\" style=\"display:none\">Skin Parts</a>\n\t\t\t\t\t<span id=\"SkinPartBar\" style=\"display:none\"> | </span>\n\t\t\t\t\t<a id=\"SkinStateLink\" href=\"#top\" onclick=\"javascript:titleBar_gotoClassFrameAnchor('SkinStateSummary');\" style=\"display:none\">Skin States</a>\n\t\t\t\t\t<span id=\"SkinStateBar\" style=\"display:none\"> | </span>\n\t\t\t\t\t<a id=\"effectsLink\" href=\"#top\" onclick=\"javascript:titleBar_gotoClassFrameAnchor('effectSummary');\" style=\"display:none\">Effects</a>\n\t\t\t\t\t<span id=\"effectsBar\" style=\"display:none\"> | </span>\n\t\t\t\t\t<a id=\"constantsLink\" href=\"#top\" onclick=\"javascript:titleBar_gotoClassFrameAnchor('constantSummary');\" style=\"display:none\">Constants</a>\n\t\t\t\t\t<span id=\"constantsBar\" style=\"display:none\"> | </span>\n\t\t\t\t\t<a id=\"packageConstantsLink\" href=\"#top\" onclick=\"javascript:titleBar_gotoClassFrameAnchor('constantSummary');\" style=\"display:none\">Constants</a>\n\t\t\t\t\t<span id=\"packageConstantsBar\" style=\"display:none\"> | </span>\n\t\t\t\t\t<a id=\"interfacesLink\" href=\"#top\" onclick=\"javascript:titleBar_gotoClassFrameAnchor('interfaceSummary');\" style=\"display:none\">Interfaces</a>\n\t\t\t\t\t<span id=\"interfacesBar\" style=\"display:none\"> | </span>\n\t\t\t\t\t<a id=\"classesLink\" href=\"#top\" onclick=\"javascript:titleBar_gotoClassFrameAnchor('classSummary');\" style=\"display:none\">Classes</a>\n\t\t\t\t\t<span id=\"classesBar\" style=\"display:none\"> | </span>\n\t\t\t\t\t<a id=\"packageUseLink\" href=\"#top\" onclick=\"javascript:titleBar_gotoClassFrameAnchor('package-use.html');\" style=\"display:none\">Use</a>\n\t\t\t\t\t<span id=\"packageUseBar\" style=\"display:none\"> | </span>\n\t\t\t\t\t<a id=\"examplesLink\" href=\"#top\" onclick=\"javascript:titleBar_gotoClassFrameAnchor('includeExamplesSummary');\" style=\"display:none\">Examples</a>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr class=\"titleTableRow3\">\n\t\t\t\t\t<td colspan=\"3\">&#xA0;</td>\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t</body>\n</html>\n\n"
  },
  {
    "path": "examples/ComponentsExplorer/README.md",
    "content": "# Feathers Components Explorer\n\nA little bit of everything in [Feathers](http://feathersui.com/), presented as a mobile app. Includes screens for each component, with configurable options.\n\n## Requirements\n\nIn addition to Starling Framework and Feathers, this example project requires the `MetalWorksMobileTheme` example theme. You can find the SWC file for this theme at the following location in the Feathers release build:\n\n\tthemes/MetalWorksMobileTheme/swc/MetalWorksMobileTheme.swc\n\n## Web Demo\n\nView the [Components Explorer](http://feathersui.com/examples/components-explorer/) in your browser."
  },
  {
    "path": "examples/ComponentsExplorer/assets/images/icons-readme.txt",
    "content": "Icons by Glyphish - glyphish.com"
  },
  {
    "path": "examples/ComponentsExplorer/build.properties",
    "content": "feathers.root = ${basedir}/../../source\nstarling.root = ${basedir}/../../third-party/starling\ntheme.root = ${basedir}/../../themes/MetalWorksMobileTheme/source\noutput.path = ${basedir}/output\nicon.path = ${basedir}/../shared-assets/icons\nlaunch.image.path = ${basedir}/../shared-assets/launch-images-windowed\nadvanced.telemetry=false\n\nswf.version = 30"
  },
  {
    "path": "examples/ComponentsExplorer/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<project name=\"components-explorer\" default=\"build\" basedir=\".\">\n\t\n\t<!-- build.local.properties and sdk.local.proprties are optional files that\n\t\tcan be used to override the default properties. -->\n\t<property file=\"./build.local.properties\"/>\n\t<property file=\"./sdk.local.properties\"/>\n\t<property file=\"./build.properties\"/>\n\t<!-- inherit SDK properties from the root of the repository -->\n\t<property file=\"../../sdk.local.properties\"/>\n\t<property file=\"../../sdk.properties\"/>\n\n\t<target name=\"build\" depends=\"build-web,build-android,build-ios\"/>\n\n\t<target name=\"prepare\">\n\t\t<delete dir=\"${output.path}\"/>\n\t</target>\n\n\t<target name=\"build-web\" depends=\"prepare\">\n\t\t<echo message=\"Building ComponentsExplorerWeb.swf\"/>\n\t\t<java jar=\"${mxmlc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${flashplayer.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-advanced-telemetry=true\"/>\n\t\t\t<arg value=\"-frame=two,feathers.examples.componentsExplorer.Main\"/>\n\t\t\t<arg value=\"-source-path+=source\"/>\n\t\t\t<arg value=\"-source-path+=${starling.root}\"/>\n\t\t\t<arg value=\"-source-path+=${feathers.root}\"/>\n\t\t\t<arg value=\"-source-path+=${theme.root}\"/>\n\t\t\t<arg value=\"source/ComponentsExplorerWeb.as\"/>\n\t\t\t<arg value=\"-output=${output.path}/ComponentsExplorerWeb.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"build-air-swf\" depends=\"prepare\">\n\t\t<echo message=\"Building ComponentsExplorer.swf\"/>\n\t\t<java jar=\"${mxmlc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${airmobile.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-advanced-telemetry=${advanced.telemetry}\"/>\n\t\t\t<arg value=\"-source-path+=source\"/>\n\t\t\t<arg value=\"-source-path+=${starling.root}\"/>\n\t\t\t<arg value=\"-source-path+=${feathers.root}\"/>\n\t\t\t<arg value=\"-source-path+=${theme.root}\"/>\n\t\t\t<arg value=\"source/ComponentsExplorer.as\"/>\n\t\t\t<arg value=\"-output=${output.path}/ComponentsExplorer.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"-check-ios-properties\">\n\t\t<fail unless=\"ios.provision.path\"/>\n\t\t<fail unless=\"ios.certificate.path\"/>\n\t\t<fail unless=\"ios.certificate.password\"/>\n\t</target>\n\t<target name=\"build-ios\" depends=\"-check-ios-properties,build-air-swf\">\n\t\t<echo message=\"Packaging ComponentsExplorer.ipa\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"-target\"/>\n\t\t\t<arg value=\"ipa-app-store\"/>\n\t\t\t<!-- uncomment for actionscript sampling with scout on ios -->\n\t\t\t<!--<arg value=\"-sampler\"/>-->\n\t\t\t<arg value=\"-provisioning-profile\"/>\n\t\t\t<arg value=\"${ios.provision.path}\"/>\n\t\t\t<arg value=\"-keystore\"/>\n\t\t\t<arg value=\"${ios.certificate.path}\"/>\n\t\t\t<arg value=\"-storetype\"/>\n\t\t\t<arg value=\"pkcs12\"/>\n\t\t\t<arg value=\"-storepass\"/>\n\t\t\t<arg value=\"${ios.certificate.password}\"/>\n\t\t\t<arg value=\"${output.path}/ComponentsExplorer.ipa\"/>\n\t\t\t<arg value=\"source/ComponentsExplorer-app.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${icon.path}\"/>\n\t\t\t<arg line=\"icon29.png icon48.png icon50.png icon57.png icon58.png icon72.png icon87.png icon96.png icon100.png icon114.png icon128.png icon144.png icon180.png\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${launch.image.path}\"/>\n\t\t\t<arg value=\"Default~iphone.png\"/>\t\t\t\t\t\t\t<!-- iphone 3gs -->\n\t\t\t<arg value=\"Default@2x~iphone.png\"/>\t\t\t\t\t\t<!-- iphone 4/4s -->\n\t\t\t<arg value=\"Default-568h@2x~iphone.png\"/>\t\t\t\t\t<!-- iphone 5/5c/5s -->\n\t\t\t<arg value=\"Default-375w-667h@2x~iphone.png\"/>\t\t\t\t<!-- iphone 6/7/8 -->\n\t\t\t<arg value=\"Default-812h@3x~iphone.png\"/>\t\t\t\t\t<!-- iphone x (portrait) -->\n\t\t\t<arg value=\"Default-Landscape-812h@3x~iphone.png\"/>\t\t\t<!-- iphone x (landscape) -->\n\t\t\t<arg value=\"Default-414w-736h@3x~iphone.png\"/>\t\t\t\t<!-- iphone 6/7/8 plus (portrait) -->\n\t\t\t<arg value=\"Default-Landscape-414w-736h@3x~iphone.png\"/>\t<!-- iphone 6/7/8 plus (landscape) -->\n\t\t\t<arg value=\"Default-Portrait~ipad.png\"/>\t\t\t\t\t<!-- ipad 1/2 (portrait) -->\n\t\t\t<arg value=\"Default-PortraitUpsideDown~ipad.png\"/>\t\t\t<!-- ipad 1/2 (portrait upside down) -->\n\t\t\t<arg value=\"Default-Landscape~ipad.png\"/>\t\t\t\t\t<!-- ipad 1/2 (landscape left) -->\n\t\t\t<arg value=\"Default-LandscapeRight~ipad.png\"/>\t\t\t\t<!-- ipad 1/2 (landscape right) -->\n\t\t\t<arg value=\"Default-Portrait@2x~ipad.png\"/>\t\t\t\t\t<!-- ipad 3/air (portrait) -->\n\t\t\t<arg value=\"Default-LandscapeLeft@2x~ipad.png\"/>\t\t\t<!-- ipad 3/air (landscape left) -->\n\t\t\t<arg value=\"Default-LandscapeRight@2x~ipad.png\"/>\t\t\t<!-- ipad 3/air (landscape right) -->\n\t\t\t<arg value=\"Default-Portrait@2x.png\"/>\t\t\t\t\t\t<!-- ipad pro (portrait) -->\n\t\t\t<arg value=\"Default-Landscape@2x.png\"/>\t\t\t\t\t\t<!-- ipad pro (landscape) -->\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${output.path}\"/>\n\t\t\t<arg value=\"ComponentsExplorer.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"-check-android-properties\">\n\t\t<fail unless=\"android.certificate.path\"/>\n\t\t<fail unless=\"android.certificate.password\"/>\n\t</target>\n\t<target name=\"build-android\" depends=\"-check-android-properties,build-air-swf\">\n\t\t<echo message=\"Packaging ComponentsExplorer.apk\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"-target\"/>\n\t\t\t<arg value=\"apk-captive-runtime\"/>\n\t\t\t<arg value=\"-storetype\"/>\n\t\t\t<arg value=\"pkcs12\"/>\n\t\t\t<arg value=\"-keystore\"/>\n\t\t\t<arg value=\"${android.certificate.path}\"/>\n\t\t\t<arg value=\"-storepass\"/>\n\t\t\t<arg value=\"${android.certificate.password}\"/>\n\t\t\t<arg value=\"${output.path}/ComponentsExplorer.apk\"/>\n\t\t\t<arg value=\"source/ComponentsExplorer-app.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${icon.path}\"/>\n\t\t\t<arg line=\"icon29.png icon48.png icon50.png icon57.png icon58.png icon72.png icon87.png icon96.png icon100.png icon114.png icon128.png icon144.png icon180.png\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${output.path}\"/>\n\t\t\t<arg value=\"ComponentsExplorer.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"install-android\">\n\t\t<echo message=\"Installing ComponentsExplorer.apk\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"false\">\n\t\t\t<arg value=\"-uninstallApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"android\"/>\n\t\t\t<arg value=\"-appid\"/>\n\t\t\t<arg value=\"com.feathersui.examples.ComponentsExplorer\"/>\n\t\t</java>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-installApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"android\"/>\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"${output.path}/ComponentsExplorer.apk\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"install-ios\">\n\t\t<echo message=\"Installing ComponentsExplorer.ipa\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"false\">\n\t\t\t<arg value=\"-uninstallApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"iOS\"/>\n\t\t\t<arg value=\"-appid\"/>\n\t\t\t<arg value=\"com.feathersui.examples.ComponentsExplorer\"/>\n\t\t</java>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-installApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"iOS\"/>\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"${output.path}/ComponentsExplorer.ipa\"/>\n\t\t</java>\n\t</target>\n</project>"
  },
  {
    "path": "examples/ComponentsExplorer/source/ComponentsExplorer-app.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<application xmlns=\"http://ns.adobe.com/air/application/32.0\">\n\t<id>com.feathersui.examples.ComponentsExplorer</id>\n\t<filename>Components</filename>\n\t<name>Components</name>\n\t<versionNumber>4.2.0</versionNumber>\n\t<description>Components Explorer example application built with Feathers UI controls for Starling</description>\n\t<copyright>2021 Bowler Hat LLC</copyright>\n\n\t<initialWindow>\n\t\t<content>ComponentsExplorer.swf</content>\n\t\t<autoOrients>true</autoOrients>\n\t\t<fullScreen>false</fullScreen>\n\t\t<visible>true</visible>\n\t\t<renderMode>direct</renderMode>\n\t</initialWindow>\n\n\t<supportedLanguages>en</supportedLanguages>\n\n\t<icon>\n\t\t<image29x29>icon29.png</image29x29>\n\t\t<image48x48>icon48.png</image48x48>\n\t\t<image50x50>icon50.png</image50x50>\n\t\t<image57x57>icon57.png</image57x57>\n\t\t<image58x58>icon58.png</image58x58>\n\t\t<image72x72>icon72.png</image72x72>\n\t\t<image87x87>icon87.png</image87x87>\n\t\t<image96x96>icon96.png</image96x96>\n\t\t<image100x100>icon100.png</image100x100>\n\t\t<image114x114>icon114.png</image114x114>\n\t\t<image128x128>icon128.png</image128x128>\n\t\t<image144x144>icon144.png</image144x144>\n\t\t<image180x180>icon180.png</image180x180>\n\t</icon>\n\t<android>\n\t\t<colorDepth>16bit</colorDepth>\n\t\t<manifestAdditions><![CDATA[\n\t\t\t<manifest android:installLocation=\"auto\">\n\t\t\t    <uses-permission android:name=\"android.permission.INTERNET\"/>\n\t\t\t</manifest>\n\t\t]]></manifestAdditions>\n\t</android>\n\t<iPhone>\n\t\t<InfoAdditions>\n\t\t<![CDATA[\n\t\t\t<key>UIDeviceFamily</key> \n\t\t\t<array> \n\t\t\t\t<string>1</string>\n\t\t\t\t<string>2</string>\n\t\t\t</array>\n\t\t\t<key>UIPrerenderedIcon</key>\n\t\t\t<true/>\n\t\t\t<key>UIStatusBarStyle</key>\n\t\t\t<string>UIStatusBarStyleLightContent</string>\n\t\t\t<key>NSAppTransportSecurity</key>\n\t\t\t<dict>\n\t\t\t\t<key>NSAllowsArbitraryLoads</key>\n\t\t\t\t<true/>\n\t\t\t</dict>\n\t\t]]> \n\t\t</InfoAdditions>\n\t\t<requestedDisplayResolution>high</requestedDisplayResolution>\n\t</iPhone>\n</application>"
  },
  {
    "path": "examples/ComponentsExplorer/source/ComponentsExplorer.as",
    "content": "package\n{\n\timport feathers.examples.componentsExplorer.Main;\n\timport feathers.utils.ScreenDensityScaleFactorManager;\n\n\timport flash.display.Loader;\n\timport flash.display.Sprite;\n\timport flash.display.StageAlign;\n\timport flash.display.StageOrientation;\n\timport flash.display.StageScaleMode;\n\timport flash.display3D.Context3DProfile;\n\timport flash.display3D.Context3DRenderMode;\n\timport flash.events.Event;\n\timport flash.filesystem.File;\n\timport flash.filesystem.FileMode;\n\timport flash.filesystem.FileStream;\n\timport flash.system.Capabilities;\n\timport flash.utils.ByteArray;\n\n\timport starling.core.Starling;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#4a4137\")]\n\tpublic class ComponentsExplorer extends Sprite\n\t{\n\t\tpublic function ComponentsExplorer()\n\t\t{\n\t\t\tif(this.stage)\n\t\t\t{\n\t\t\t\tthis.stage.scaleMode = StageScaleMode.NO_SCALE;\n\t\t\t\tthis.stage.align = StageAlign.TOP_LEFT;\n\t\t\t}\n\t\t\tthis.mouseEnabled = this.mouseChildren = false;\n\t\t\tthis.showLaunchImage();\n\t\t\tthis.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);\n\t\t}\n\n\t\tprivate var _starling:Starling;\n\t\tprivate var _scaler:ScreenDensityScaleFactorManager;\n\t\tprivate var _launchImage:Loader;\n\t\tprivate var _savedAutoOrients:Boolean;\n\n\t\t/**\n\t\t * On iOS, add the native launch image to the classic display list to\n\t\t * avoid displaying only the stage background color between when the\n\t\t * AIR app finishes launching and Starling starts rendering.\n\t\t * \n\t\t * Launch image names: https://forums.adobe.com/message/9986239#9986239\n\t\t */\n\t\tprivate function showLaunchImage():void\n\t\t{\n\t\t\tvar filePath:String = null;\n\t\t\tvar isPortraitOnly:Boolean = false;\n\t\t\tif(Capabilities.manufacturer.indexOf(\"iOS\") >= 0)\n\t\t\t{\n\t\t\t\tvar isPortraitUpsideDown:Boolean = this.stage.orientation == StageOrientation.UPSIDE_DOWN;\n\t\t\t\tvar isPortrait:Boolean = this.stage.orientation == StageOrientation.DEFAULT || isPortraitUpsideDown;\n\t\t\t\tvar isLandscapeRight:Boolean = this.stage.orientation == StageOrientation.ROTATED_RIGHT;\n\t\t\t\tif(Capabilities.screenResolutionX == 1242 && Capabilities.screenResolutionY == 2208)\n\t\t\t\t{\n\t\t\t\t\t//iphone 6/7/8 plus\n\t\t\t\t\tfilePath = isPortrait ? \"Default-414w-736h@3x~iphone.png\" : \"Default-Landscape-414w-736h@3x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 1125 && Capabilities.screenResolutionY == 2436)\n\t\t\t\t{\n\t\t\t\t\t//iphone x\n\t\t\t\t\tfilePath = isPortrait ? \"Default-812h@3x~iphone.png\" : \"Default-Landscape-812h@3x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 2048 && Capabilities.screenResolutionY == 2732)\n\t\t\t\t{\n\t\t\t\t\t//ipad pro\n\t\t\t\t\tfilePath = isPortrait ? \"Default-Portrait@2x.png\" : \"Default-Landscape@2x.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 1536 && Capabilities.screenResolutionY == 2048)\n\t\t\t\t{\n\t\t\t\t\t//ipad 3/air\n\t\t\t\t\tif(isPortraitUpsideDown)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Portrait@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isPortrait)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-PortraitUpsideDown@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isLandscapeRight)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeRight@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeLeft@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 768 && Capabilities.screenResolutionY == 1024)\n\t\t\t\t{\n\t\t\t\t\t//ipad 1/2\n\t\t\t\t\tif(isPortraitUpsideDown)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Portrait~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isPortrait)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-PortraitUpsideDown~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isLandscapeRight)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeRight~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Landscape~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 750)\n\t\t\t\t{\n\t\t\t\t\t//iphone 6/7/8\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tfilePath = \"Default-375w-667h@2x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 640)\n\t\t\t\t{\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tif(Capabilities.screenResolutionY == 1136)\n\t\t\t\t\t{\n\t\t\t\t\t\t//iphone 5/5c/5s\n\t\t\t\t\t\tfilePath = \"Default-568h@2x~iphone.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//iphone 4/4s\n\t\t\t\t\t\tfilePath = \"Default@2x~iphone.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 320)\n\t\t\t\t{\n\t\t\t\t\t//iphone 3gs\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tfilePath = \"Default~iphone.png\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(filePath)\n\t\t\t{\n\t\t\t\tvar file:File = File.applicationDirectory.resolvePath(filePath);\n\t\t\t\tif(file.exists)\n\t\t\t\t{\n\t\t\t\t\tvar bytes:ByteArray = new ByteArray();\n\t\t\t\t\tvar stream:FileStream = new FileStream();\n\t\t\t\t\tstream.open(file, FileMode.READ);\n\t\t\t\t\tstream.readBytes(bytes, 0, stream.bytesAvailable);\n\t\t\t\t\tstream.close();\n\t\t\t\t\tthis._launchImage = new Loader();\n\t\t\t\t\tthis._launchImage.loadBytes(bytes);\n\t\t\t\t\tthis.addChild(this._launchImage);\n\t\t\t\t\tthis._savedAutoOrients = this.stage.autoOrients;\n\t\t\t\t\tthis.stage.autoOrients = false;\n\t\t\t\t\tif(isPortraitOnly)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.stage.setOrientation(StageOrientation.DEFAULT);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function loaderInfo_completeHandler(event:Event):void\n\t\t{\n\t\t\tStarling.multitouchEnabled = true;\n\t\t\tthis._starling = new Starling(Main, this.stage, null, null, Context3DRenderMode.AUTO, Context3DProfile.BASELINE);\n\t\t\tthis._starling.supportHighResolutions = true;\n\t\t\tthis._starling.skipUnchangedFrames = true;\n\t\t\tthis._starling.start();\n\t\t\tif(this._launchImage)\n\t\t\t{\n\t\t\t\tthis._starling.addEventListener(\"rootCreated\", starling_rootCreatedHandler);\n\t\t\t}\n\t\t\tthis._scaler = new ScreenDensityScaleFactorManager(this._starling);\n\t\t\tthis.stage.addEventListener(Event.DEACTIVATE, stage_deactivateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function starling_rootCreatedHandler(event:Object):void\n\t\t{\n\t\t\tif(this._launchImage)\n\t\t\t{\n\t\t\t\tthis.removeChild(this._launchImage);\n\t\t\t\tthis._launchImage.unloadAndStop(true);\n\t\t\t\tthis._launchImage = null;\n\t\t\t\tthis.stage.autoOrients = this._savedAutoOrients;\n\t\t\t}\n\t\t}\n\n\t\tprivate function stage_deactivateHandler(event:Event):void\n\t\t{\n\t\t\tthis._starling.stop(true);\n\t\t\tthis.stage.addEventListener(Event.ACTIVATE, stage_activateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function stage_activateHandler(event:Event):void\n\t\t{\n\t\t\tthis.stage.removeEventListener(Event.ACTIVATE, stage_activateHandler);\n\t\t\tthis._starling.start();\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "examples/ComponentsExplorer/source/ComponentsExplorerWeb.as",
    "content": "package\n{\n\timport feathers.system.DeviceCapabilities;\n\n\timport flash.display.MovieClip;\n\timport flash.display.StageAlign;\n\timport flash.display.StageScaleMode;\n\timport flash.events.Event;\n\timport flash.geom.Rectangle;\n\timport flash.ui.ContextMenu;\n\timport flash.utils.getDefinitionByName;\n\n\timport starling.core.Starling;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#4a4137\")]\n\tpublic class ComponentsExplorerWeb extends MovieClip\n\t{\n\t\tpublic function ComponentsExplorerWeb()\n\t\t{\n\t\t\tvar menu:ContextMenu = new ContextMenu();\n\t\t\tmenu.hideBuiltInItems();\n\t\t\tthis.contextMenu = menu;\n\t\t\t\n\t\t\tif(this.stage)\n\t\t\t{\n\t\t\t\tthis.stage.align = StageAlign.TOP_LEFT;\n\t\t\t\tthis.stage.scaleMode = StageScaleMode.NO_SCALE;\n\t\t\t}\n\t\t\t\n\t\t\tthis.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);\n\t\t}\n\t\t\n\t\tprivate var _starling:Starling;\n\t\t\n\t\tprivate function start():void\n\t\t{\n\t\t\tthis.gotoAndStop(2);\n\t\t\tthis.graphics.clear();\n\t\t\t\n\t\t\t//simulating iPhone Retina\n\t\t\tDeviceCapabilities.dpi = 326;\n\t\t\t\n\t\t\tStarling.multitouchEnabled = true;\n\t\t\tvar MainType:Class = getDefinitionByName(\"feathers.examples.componentsExplorer.Main\") as Class;\n\t\t\tthis._starling = new Starling(MainType, this.stage, new Rectangle(0, 0, 960, 640));\n\t\t\tthis._starling.supportHighResolutions = true;\n\t\t\tthis._starling.skipUnchangedFrames = true;\n\t\t\tthis._starling.stage.stageWidth = 480;\n\t\t\tthis._starling.stage.stageHeight = 320;\n\t\t\tthis._starling.start();\n\t\t}\n\t\t\n\t\tprivate function loaderInfo_completeHandler(event:Event):void\n\t\t{\n\t\t\tthis.start();\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/Main.as",
    "content": "package feathers.examples.componentsExplorer\n{\n\timport feathers.controls.Drawers;\n\timport feathers.controls.StackScreenNavigator;\n\timport feathers.controls.StackScreenNavigatorItem;\n\timport feathers.examples.componentsExplorer.data.DataGridSettings;\n\timport feathers.examples.componentsExplorer.data.DateTimeSpinnerSettings;\n\timport feathers.examples.componentsExplorer.data.EmbeddedAssets;\n\timport feathers.examples.componentsExplorer.data.GroupedListSettings;\n\timport feathers.examples.componentsExplorer.data.ItemRendererSettings;\n\timport feathers.examples.componentsExplorer.data.ListSettings;\n\timport feathers.examples.componentsExplorer.data.NumericStepperSettings;\n\timport feathers.examples.componentsExplorer.data.SliderSettings;\n\timport feathers.examples.componentsExplorer.screens.AlertScreen;\n\timport feathers.examples.componentsExplorer.screens.AutoCompleteScreen;\n\timport feathers.examples.componentsExplorer.screens.ButtonGroupScreen;\n\timport feathers.examples.componentsExplorer.screens.ButtonScreen;\n\timport feathers.examples.componentsExplorer.screens.CalloutScreen;\n\timport feathers.examples.componentsExplorer.screens.CheckScreen;\n\timport feathers.examples.componentsExplorer.screens.DataGridScreen;\n\timport feathers.examples.componentsExplorer.screens.DataGridSettingsScreen;\n\timport feathers.examples.componentsExplorer.screens.DateTimeSpinnerScreen;\n\timport feathers.examples.componentsExplorer.screens.DateTimeSpinnerSettingsScreen;\n\timport feathers.examples.componentsExplorer.screens.GroupedListScreen;\n\timport feathers.examples.componentsExplorer.screens.GroupedListSettingsScreen;\n\timport feathers.examples.componentsExplorer.screens.ItemRendererScreen;\n\timport feathers.examples.componentsExplorer.screens.ItemRendererSettingsScreen;\n\timport feathers.examples.componentsExplorer.screens.LabelScreen;\n\timport feathers.examples.componentsExplorer.screens.ListScreen;\n\timport feathers.examples.componentsExplorer.screens.ListSettingsScreen;\n\timport feathers.examples.componentsExplorer.screens.MainMenuScreen;\n\timport feathers.examples.componentsExplorer.screens.NumericStepperScreen;\n\timport feathers.examples.componentsExplorer.screens.NumericStepperSettingsScreen;\n\timport feathers.examples.componentsExplorer.screens.PageIndicatorScreen;\n\timport feathers.examples.componentsExplorer.screens.PanelComponentScreen;\n\timport feathers.examples.componentsExplorer.screens.PickerListScreen;\n\timport feathers.examples.componentsExplorer.screens.ProgressBarScreen;\n\timport feathers.examples.componentsExplorer.screens.RadioScreen;\n\timport feathers.examples.componentsExplorer.screens.ScrollTextScreen;\n\timport feathers.examples.componentsExplorer.screens.SliderScreen;\n\timport feathers.examples.componentsExplorer.screens.SliderSettingsScreen;\n\timport feathers.examples.componentsExplorer.screens.SpinnerListScreen;\n\timport feathers.examples.componentsExplorer.screens.TabBarScreen;\n\timport feathers.examples.componentsExplorer.screens.TextCalloutScreen;\n\timport feathers.examples.componentsExplorer.screens.TextInputScreen;\n\timport feathers.examples.componentsExplorer.screens.ToggleSwitchScreen;\n\timport feathers.examples.componentsExplorer.screens.TreeScreen;\n\timport feathers.examples.componentsExplorer.screens.WebViewScreen;\n\timport feathers.layout.Orientation;\n\timport feathers.motion.Cover;\n\timport feathers.motion.Reveal;\n\timport feathers.motion.Slide;\n\timport feathers.system.DeviceCapabilities;\n\timport feathers.themes.MetalWorksMobileTheme;\n\n\timport flash.system.Capabilities;\n\n\timport starling.core.Starling;\n\timport starling.events.Event;\n\timport feathers.examples.componentsExplorer.screens.ToastScreen;\n\n\tpublic class Main extends Drawers\n\t{\n\t\tpublic function Main()\n\t\t{\n\t\t\t//set up the theme right away!\n\t\t\tnew MetalWorksMobileTheme();\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _navigator:StackScreenNavigator;\n\t\tprivate var _menu:MainMenuScreen;\n\t\t\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tEmbeddedAssets.initialize();\n\n\t\t\tthis._navigator = new StackScreenNavigator();\n\t\t\tthis.content = this._navigator;\n\n\t\t\tvar alertItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(AlertScreen);\n\t\t\talertItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._navigator.addScreen(ScreenID.ALERT, alertItem);\n\n\t\t\tvar autoCompleteItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(AutoCompleteScreen);\n\t\t\tautoCompleteItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._navigator.addScreen(ScreenID.AUTO_COMPLETE, autoCompleteItem);\n\n\t\t\tvar buttonItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(ButtonScreen);\n\t\t\tbuttonItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._navigator.addScreen(ScreenID.BUTTON, buttonItem);\n\n\t\t\tvar buttonGroupItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(ButtonGroupScreen);\n\t\t\tbuttonGroupItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._navigator.addScreen(ScreenID.BUTTON_GROUP, buttonGroupItem);\n\n\t\t\tvar calloutItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(CalloutScreen);\n\t\t\tcalloutItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._navigator.addScreen(ScreenID.CALLOUT, calloutItem);\n\n\t\t\tvar checkItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(CheckScreen);\n\t\t\tcheckItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._navigator.addScreen(ScreenID.CHECK, checkItem);\n\n\t\t\tvar dataGridSettings:DataGridSettings = new DataGridSettings();\n\t\t\tvar dataGridItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(DataGridScreen);\n\t\t\tdataGridItem.setScreenIDForPushEvent(DataGridScreen.SHOW_SETTINGS, ScreenID.DATA_GRID_SETTINGS);\n\t\t\tdataGridItem.addPopEvent(Event.COMPLETE);\n\t\t\tdataGridItem.properties.settings = dataGridSettings;\n\t\t\tthis._navigator.addScreen(ScreenID.DATA_GRID, dataGridItem);\n\n\t\t\tvar dataGridSettingsItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(DataGridSettingsScreen);\n\t\t\tdataGridSettingsItem.addPopEvent(Event.COMPLETE);\n\t\t\tdataGridSettingsItem.properties.settings = dataGridSettings;\n\t\t\t//custom push and pop transitions for this settings screen\n\t\t\tdataGridSettingsItem.pushTransition = Cover.createCoverUpTransition();\n\t\t\tdataGridSettingsItem.popTransition = Reveal.createRevealDownTransition();\n\t\t\tthis._navigator.addScreen(ScreenID.DATA_GRID_SETTINGS, dataGridSettingsItem);\n\n\t\t\tvar dateTimeSpinnerSettings:DateTimeSpinnerSettings = new DateTimeSpinnerSettings();\n\t\t\tvar dateTimeSpinnerItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(DateTimeSpinnerScreen);\n\t\t\tdateTimeSpinnerItem.setScreenIDForPushEvent(DateTimeSpinnerScreen.SHOW_SETTINGS, ScreenID.DATE_TIME_SPINNER_SETTINGS);\n\t\t\tdateTimeSpinnerItem.addPopEvent(Event.COMPLETE);\n\t\t\tdateTimeSpinnerItem.properties.settings = dateTimeSpinnerSettings;\n\t\t\tthis._navigator.addScreen(ScreenID.DATE_TIME_SPINNER, dateTimeSpinnerItem);\n\n\t\t\tvar dateTimeSpinnerSettingsItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(DateTimeSpinnerSettingsScreen);\n\t\t\tdateTimeSpinnerSettingsItem.addPopEvent(Event.COMPLETE);\n\t\t\tdateTimeSpinnerSettingsItem.properties.settings = dateTimeSpinnerSettings;\n\t\t\t//custom push and pop transitions for this settings screen\n\t\t\tdateTimeSpinnerSettingsItem.pushTransition = Cover.createCoverUpTransition();\n\t\t\tdateTimeSpinnerSettingsItem.popTransition = Reveal.createRevealDownTransition();\n\t\t\tthis._navigator.addScreen(ScreenID.DATE_TIME_SPINNER_SETTINGS, dateTimeSpinnerSettingsItem);\n\n\t\t\tvar groupedListSettings:GroupedListSettings = new GroupedListSettings();\n\t\t\tvar groupedListItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(GroupedListScreen);\n\t\t\tgroupedListItem.setScreenIDForPushEvent(GroupedListScreen.SHOW_SETTINGS, ScreenID.GROUPED_LIST_SETTINGS);\n\t\t\tgroupedListItem.addPopEvent(Event.COMPLETE);\n\t\t\tgroupedListItem.properties.settings = groupedListSettings;\n\t\t\tthis._navigator.addScreen(ScreenID.GROUPED_LIST, groupedListItem);\n\n\t\t\tvar groupedListSettingsItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(GroupedListSettingsScreen);\n\t\t\tgroupedListSettingsItem.addPopEvent(Event.COMPLETE);\n\t\t\tgroupedListSettingsItem.properties.settings = groupedListSettings;\n\t\t\t//custom push and pop transitions for this settings screen\n\t\t\tgroupedListSettingsItem.pushTransition = Cover.createCoverUpTransition();\n\t\t\tgroupedListSettingsItem.popTransition = Reveal.createRevealDownTransition();\n\t\t\tthis._navigator.addScreen(ScreenID.GROUPED_LIST_SETTINGS, groupedListSettingsItem);\n\n\t\t\tvar itemRendererSettings:ItemRendererSettings = new ItemRendererSettings();\n\t\t\tvar itemRendererItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(ItemRendererScreen);\n\t\t\titemRendererItem.setScreenIDForPushEvent(ItemRendererScreen.SHOW_SETTINGS, ScreenID.ITEM_RENDERER_SETTINGS);\n\t\t\titemRendererItem.addPopEvent(Event.COMPLETE);\n\t\t\titemRendererItem.properties.settings = itemRendererSettings;\n\t\t\tthis._navigator.addScreen(ScreenID.ITEM_RENDERER, itemRendererItem);\n\n\t\t\tvar itemRendererSettingsItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(ItemRendererSettingsScreen);\n\t\t\titemRendererSettingsItem.addPopEvent(Event.COMPLETE);\n\t\t\titemRendererSettingsItem.properties.settings = itemRendererSettings;\n\t\t\t//custom push and pop transitions for this settings screen\n\t\t\titemRendererSettingsItem.pushTransition = Cover.createCoverUpTransition();\n\t\t\titemRendererSettingsItem.popTransition = Reveal.createRevealDownTransition();\n\t\t\tthis._navigator.addScreen(ScreenID.ITEM_RENDERER_SETTINGS, itemRendererSettingsItem);\n\n\t\t\tvar labelItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(LabelScreen);\n\t\t\tlabelItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._navigator.addScreen(ScreenID.LABEL, labelItem);\n\n\t\t\tvar listSettings:ListSettings = new ListSettings();\n\t\t\tvar listItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(ListScreen);\n\t\t\tlistItem.setScreenIDForPushEvent(ListScreen.SHOW_SETTINGS, ScreenID.LIST_SETTINGS);\n\t\t\tlistItem.addPopEvent(Event.COMPLETE);\n\t\t\tlistItem.properties.settings = listSettings;\n\t\t\tthis._navigator.addScreen(ScreenID.LIST, listItem);\n\n\t\t\tvar listSettingsItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(ListSettingsScreen);\n\t\t\tlistSettingsItem.addPopEvent(Event.COMPLETE);\n\t\t\tlistSettingsItem.properties.settings = listSettings;\n\t\t\t//custom push and pop transitions for this settings screen\n\t\t\tlistSettingsItem.pushTransition = Cover.createCoverUpTransition();\n\t\t\tlistSettingsItem.popTransition = Reveal.createRevealDownTransition();\n\t\t\tthis._navigator.addScreen(ScreenID.LIST_SETTINGS, listSettingsItem);\n\n\t\t\tvar numericStepperSettings:NumericStepperSettings = new NumericStepperSettings();\n\t\t\tvar numericStepperItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(NumericStepperScreen);\n\t\t\tnumericStepperItem.setScreenIDForPushEvent(NumericStepperScreen.SHOW_SETTINGS, ScreenID.NUMERIC_STEPPER_SETTINGS);\n\t\t\tnumericStepperItem.addPopEvent(Event.COMPLETE);\n\t\t\tnumericStepperItem.properties.settings = numericStepperSettings;\n\t\t\tthis._navigator.addScreen(ScreenID.NUMERIC_STEPPER, numericStepperItem);\n\n\t\t\tvar panelItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(PanelComponentScreen);\n\t\t\tpanelItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._navigator.addScreen(ScreenID.PANEL, panelItem);\n\n\t\t\tvar numericStepperSettingsItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(NumericStepperSettingsScreen);\n\t\t\tnumericStepperSettingsItem.addPopEvent(Event.COMPLETE);\n\t\t\tnumericStepperSettingsItem.properties.settings = numericStepperSettings;\n\t\t\t//custom push and pop transitions for this settings screen\n\t\t\tnumericStepperSettingsItem.pushTransition = Cover.createCoverUpTransition();\n\t\t\tnumericStepperSettingsItem.popTransition = Reveal.createRevealDownTransition();\n\t\t\tthis._navigator.addScreen(ScreenID.NUMERIC_STEPPER_SETTINGS, numericStepperSettingsItem);\n\n\t\t\tvar pageIndicatorItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(PageIndicatorScreen);\n\t\t\tpageIndicatorItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._navigator.addScreen(ScreenID.PAGE_INDICATOR, pageIndicatorItem);\n\n\t\t\tvar pickerListItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(PickerListScreen);\n\t\t\tpickerListItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._navigator.addScreen(ScreenID.PICKER_LIST, pickerListItem);\n\n\t\t\tvar progressBarItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(ProgressBarScreen);\n\t\t\tprogressBarItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._navigator.addScreen(ScreenID.PROGRESS_BAR, progressBarItem);\n\n\t\t\tvar radioItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(RadioScreen);\n\t\t\tradioItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._navigator.addScreen(ScreenID.RADIO, radioItem);\n\n\t\t\tvar scrollTextItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(ScrollTextScreen);\n\t\t\tscrollTextItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._navigator.addScreen(ScreenID.SCROLL_TEXT, scrollTextItem);\n\n\t\t\tvar sliderSettings:SliderSettings = new SliderSettings();\n\t\t\tvar sliderItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(SliderScreen);\n\t\t\tsliderItem.setScreenIDForPushEvent(SliderScreen.SHOW_SETTINGS, ScreenID.SLIDER_SETTINGS);\n\t\t\tsliderItem.addPopEvent(Event.COMPLETE);\n\t\t\tsliderItem.properties.settings = sliderSettings;\n\t\t\tthis._navigator.addScreen(ScreenID.SLIDER, sliderItem);\n\n\t\t\tvar sliderSettingsItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(SliderSettingsScreen);\n\t\t\tsliderSettingsItem.addPopEvent(Event.COMPLETE);\n\t\t\tsliderSettingsItem.properties.settings = sliderSettings;\n\t\t\t//custom push and pop transitions for this settings screen\n\t\t\tsliderSettingsItem.pushTransition = Cover.createCoverUpTransition();\n\t\t\tsliderSettingsItem.popTransition = Reveal.createRevealDownTransition();\n\t\t\tthis._navigator.addScreen(ScreenID.SLIDER_SETTINGS, sliderSettingsItem);\n\n\t\t\tvar spinnerListItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(SpinnerListScreen);\n\t\t\tspinnerListItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._navigator.addScreen(ScreenID.SPINNER_LIST, spinnerListItem);\n\n\t\t\tvar tabBarItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(TabBarScreen);\n\t\t\ttabBarItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._navigator.addScreen(ScreenID.TAB_BAR, tabBarItem);\n\n\t\t\tvar textCalloutItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(TextCalloutScreen);\n\t\t\ttextCalloutItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._navigator.addScreen(ScreenID.TEXT_CALLOUT, textCalloutItem);\n\n\t\t\tvar textInputItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(TextInputScreen);\n\t\t\ttextInputItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._navigator.addScreen(ScreenID.TEXT_INPUT, textInputItem);\n\n\t\t\tvar toastItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(ToastScreen);\n\t\t\ttoastItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._navigator.addScreen(ScreenID.TOAST, toastItem);\n\n\t\t\tvar togglesItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(ToggleSwitchScreen);\n\t\t\ttogglesItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._navigator.addScreen(ScreenID.TOGGLES, togglesItem);\n\n\t\t\tvar treeItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(TreeScreen);\n\t\t\ttreeItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._navigator.addScreen(ScreenID.TREE, treeItem);\n\n\t\t\tif(Capabilities.playerType == \"Desktop\") //this means AIR, even for mobile\n\t\t\t{\n\t\t\t\tvar webViewItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(WebViewScreen);\n\t\t\t\twebViewItem.addPopEvent(Event.COMPLETE);\n\t\t\t\tthis._navigator.addScreen(ScreenID.WEB_VIEW, webViewItem);\n\t\t\t}\n\n\t\t\tif(DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\t//we don't want the screens bleeding outside the navigator's\n\t\t\t\t//bounds on top of a drawer when a transition is active, so\n\t\t\t\t//enable clipping.\n\t\t\t\tthis._navigator.clipContent = true;\n\t\t\t\tthis._menu = new MainMenuScreen();\n\t\t\t\tthis._menu.addEventListener(Event.CHANGE, mainMenu_tabletChangeHandler);\n\t\t\t\tthis._menu.height = 200;\n\t\t\t\tthis.leftDrawer = this._menu;\n\t\t\t\tthis.leftDrawerDockMode = Orientation.BOTH;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar mainMenuItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(MainMenuScreen);\n\t\t\t\tmainMenuItem.setFunctionForPushEvent(Event.CHANGE, mainMenu_phoneChangeHandler);\n\t\t\t\tthis._navigator.addScreen(ScreenID.MAIN_MENU, mainMenuItem);\n\t\t\t\tthis._navigator.rootScreenID = ScreenID.MAIN_MENU;\n\t\t\t}\n\n\t\t\tthis._navigator.pushTransition = Slide.createSlideLeftTransition();\n\t\t\tthis._navigator.popTransition = Slide.createSlideRightTransition();\n\t\t}\n\n\t\tprivate function mainMenu_phoneChangeHandler(event:Event):void\n\t\t{\n\t\t\t//when MainMenuScreen dispatches Event.CHANGE, its selectedScreenID\n\t\t\t//property has been updated. use that to show the correct screen.\n\t\t\tvar screen:MainMenuScreen = MainMenuScreen(event.currentTarget);\n\t\t\tthis._navigator.pushScreen(screen.selectedScreenID, event.data);\n\t\t\t//pass the data from the event to save it for when we pop back.\n\t\t}\n\n\t\tprivate function mainMenu_tabletChangeHandler(event:Event):void\n\t\t{\n\t\t\t//since this navigation is triggered by an external menu, we don't\n\t\t\t//want to push a new screen onto the stack. we want to start fresh.\n\t\t\tvar screen:MainMenuScreen = MainMenuScreen(event.currentTarget);\n\t\t\tthis._navigator.rootScreenID = screen.selectedScreenID;\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/ScreenID.as",
    "content": "package feathers.examples.componentsExplorer\n{\n\tpublic class ScreenID\n\t{\n\t\tpublic static const MAIN_MENU:String = \"mainMenu\";\n\t\tpublic static const ALERT:String = \"alert\";\n\t\tpublic static const AUTO_COMPLETE:String = \"autoComplete\";\n\t\tpublic static const BUTTON:String = \"button\";\n\t\tpublic static const BUTTON_GROUP:String = \"buttonGroup\";\n\t\tpublic static const CALLOUT:String = \"callout\";\n\t\tpublic static const CHECK:String = \"check\";\n\t\tpublic static const DATA_GRID:String = \"dataGrid\";\n\t\tpublic static const DATA_GRID_SETTINGS:String = \"dataGridSettings\";\n\t\tpublic static const DATE_TIME_SPINNER:String = \"dateTimeSpinner\";\n\t\tpublic static const DATE_TIME_SPINNER_SETTINGS:String = \"dateTimeSpinnerSettings\";\n\t\tpublic static const GROUPED_LIST:String = \"groupedList\";\n\t\tpublic static const GROUPED_LIST_SETTINGS:String = \"groupedListSettings\";\n\t\tpublic static const ITEM_RENDERER:String = \"itemRenderer\";\n\t\tpublic static const ITEM_RENDERER_SETTINGS:String = \"itemRendererSettings\";\n\t\tpublic static const LABEL:String = \"label\";\n\t\tpublic static const LIST:String = \"list\";\n\t\tpublic static const LIST_SETTINGS:String = \"listSettings\";\n\t\tpublic static const NUMERIC_STEPPER:String = \"numericStepper\";\n\t\tpublic static const NUMERIC_STEPPER_SETTINGS:String = \"numericStepperSettings\";\n\t\tpublic static const PAGE_INDICATOR:String = \"pageIndicator\";\n\t\tpublic static const PANEL:String = \"panel\";\n\t\tpublic static const PICKER_LIST:String = \"pickerList\";\n\t\tpublic static const PROGRESS_BAR:String = \"progressBar\";\n\t\tpublic static const RADIO:String = \"radio\";\n\t\tpublic static const SCROLL_TEXT:String = \"scrollText\";\n\t\tpublic static const SLIDER:String = \"slider\";\n\t\tpublic static const SPINNER_LIST:String = \"spinnerList\";\n\t\tpublic static const SLIDER_SETTINGS:String = \"sliderSettings\";\n\t\tpublic static const TAB_BAR:String = \"tabBar\";\n\t\tpublic static const TEXT_CALLOUT:String = \"textCallout\";\n\t\tpublic static const TEXT_INPUT:String = \"textInput\";\n\t\tpublic static const TOAST:String = \"toast\";\n\t\tpublic static const TOGGLES:String = \"toggles\";\n\t\tpublic static const TREE:String = \"tree\";\n\t\tpublic static const WEB_VIEW:String = \"webView\";\n\t}\n}\n"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/data/DataGridSettings.as",
    "content": "package feathers.examples.componentsExplorer.data\n{\n\timport feathers.controls.ItemRendererLayoutOrder;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.RelativePosition;\n\timport feathers.layout.VerticalAlign;\n\n\tpublic class DataGridSettings\n\t{\n\t\tpublic function DataGridSettings()\n\t\t{\n\t\t}\n\n\t\tpublic var reorderColumns:Boolean = false;\n\t\tpublic var sortableColumns:Boolean = false;\n\t\tpublic var resizableColumns:Boolean = false;\n\t}\n}\n"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/data/DateTimeSpinnerSettings.as",
    "content": "package feathers.examples.componentsExplorer.data\n{\n\timport feathers.controls.DateTimeMode;\n\n\tpublic class DateTimeSpinnerSettings\n\t{\n\t\tpublic function DateTimeSpinnerSettings()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic var editingMode:String = DateTimeMode.DATE_AND_TIME;\n\t}\n}\n"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/data/EmbeddedAssets.as",
    "content": "package feathers.examples.componentsExplorer.data\n{\n\timport starling.textures.Texture;\n\n\tpublic class EmbeddedAssets\n\t{\n\t\t[Embed(source=\"/../assets/images/skull.png\")]\n\t\tprivate static const SKULL_ICON_DARK_EMBEDDED:Class;\n\n\t\t[Embed(source=\"/../assets/images/skull-white.png\")]\n\t\tprivate static const SKULL_ICON_LIGHT_EMBEDDED:Class;\n\n\t\tpublic static var SKULL_ICON_DARK:Texture;\n\n\t\tpublic static var SKULL_ICON_LIGHT:Texture;\n\t\t\n\t\tpublic static function initialize():void\n\t\t{\n\t\t\t//we can't create these textures until Starling is ready\n\t\t\tSKULL_ICON_DARK = Texture.fromEmbeddedAsset(SKULL_ICON_DARK_EMBEDDED, false, false, 2);\n\t\t\tSKULL_ICON_LIGHT = Texture.fromEmbeddedAsset(SKULL_ICON_LIGHT_EMBEDDED, false, false, 2);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/data/GroupedListSettings.as",
    "content": "package feathers.examples.componentsExplorer.data\n{\n\tpublic class GroupedListSettings\n\t{\n\t\tpublic static const STYLE_NORMAL:String = \"normal\";\n\t\tpublic static const STYLE_INSET:String = \"inset\";\n\n\t\tpublic function GroupedListSettings()\n\t\t{\n\t\t}\n\n\t\tpublic var isSelectable:Boolean = true;\n\t\tpublic var hasElasticEdges:Boolean = true;\n\t\tpublic var style:String = STYLE_NORMAL;\n\t}\n}\n"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/data/ItemRendererSettings.as",
    "content": "package feathers.examples.componentsExplorer.data\n{\n\timport feathers.controls.ItemRendererLayoutOrder;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.RelativePosition;\n\timport feathers.layout.VerticalAlign;\n\n\tpublic class ItemRendererSettings\n\t{\n\t\tpublic static const ICON_ACCESSORY_TYPE_DISPLAY_OBJECT:String = \"Display Object\";\n\t\tpublic static const ICON_ACCESSORY_TYPE_TEXTURE:String = \"Texture\";\n\t\tpublic static const ICON_ACCESSORY_TYPE_LABEL:String = \"Label\";\n\n\t\tpublic function ItemRendererSettings()\n\t\t{\n\t\t}\n\n\t\tpublic var hasIcon:Boolean = true;\n\t\tpublic var hasAccessory:Boolean = true;\n\t\tpublic var layoutOrder:String = ItemRendererLayoutOrder.LABEL_ICON_ACCESSORY;\n\t\tpublic var iconType:String = ICON_ACCESSORY_TYPE_TEXTURE;\n\t\tpublic var iconPosition:String = RelativePosition.LEFT;\n\t\tpublic var useInfiniteGap:Boolean = false;\n\t\tpublic var accessoryPosition:String = RelativePosition.RIGHT;\n\t\tpublic var accessoryType:String = ICON_ACCESSORY_TYPE_DISPLAY_OBJECT;\n\t\tpublic var useInfiniteAccessoryGap:Boolean = true;\n\t\tpublic var horizontalAlign:String = HorizontalAlign.LEFT;\n\t\tpublic var verticalAlign:String = VerticalAlign.MIDDLE;\n\t}\n}\n"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/data/ListSettings.as",
    "content": "package feathers.examples.componentsExplorer.data\n{\n\tpublic class ListSettings\n\t{\n\t\tpublic function ListSettings()\n\t\t{\n\t\t}\n\n\t\tpublic var isSelectable:Boolean = true;\n\t\tpublic var hasElasticEdges:Boolean = true;\n\t\tpublic var allowMultipleSelection:Boolean = false;\n\t}\n}\n"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/data/NumericStepperSettings.as",
    "content": "package feathers.examples.componentsExplorer.data\n{\n\tpublic class NumericStepperSettings\n\t{\n\t\tpublic function NumericStepperSettings()\n\t\t{\n\t\t}\n\n\t\tpublic var step:Number = 1;\n\t}\n}\n"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/data/SliderSettings.as",
    "content": "package feathers.examples.componentsExplorer.data\n{\n\timport feathers.controls.TrackInteractionMode;\n\n\tpublic class SliderSettings\n\t{\n\t\tpublic function SliderSettings()\n\t\t{\n\t\t}\n\n\t\tpublic var step:Number = 1;\n\t\tpublic var page:Number = 10;\n\t\tpublic var liveDragging:Boolean = true;\n\t\tpublic var trackInteractionMode:String = TrackInteractionMode.TO_VALUE;\n\t}\n}\n"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/AlertScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Alert;\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.PanelScreen;\n\timport feathers.data.ArrayCollection;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\n\timport starling.events.Event;\n\timport feathers.system.DeviceCapabilities;\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\n\tpublic class AlertScreen extends PanelScreen\n\t{\n\t\tpublic function AlertScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _showAlertButton:Button;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Alert\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._showAlertButton = new Button();\n\t\t\tthis._showAlertButton.label = \"Show Alert\";\n\t\t\tthis._showAlertButton.addEventListener(Event.TRIGGERED, showAlertButton_triggeredHandler);\n\t\t\tvar buttonLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tbuttonLayoutData.horizontalCenter = 0;\n\t\t\tbuttonLayoutData.verticalCenter = 0;\n\t\t\tthis._showAlertButton.layoutData = buttonLayoutData;\n\t\t\tthis.addChild(this._showAlertButton);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function showAlertButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tvar alert:Alert = Alert.show(\"I just wanted you to know that I have a very important message to share with you.\", \"Alert\", new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ label: \"OK\" },\n\t\t\t\t{ label: \"Cancel\" }\n\t\t\t]));\n\t\t\t//when the enter key is pressed, treat it as OK\n\t\t\talert.acceptButtonIndex = 0;\n\t\t\t//when the back or escape key is pressed, treat it as cancel\n\t\t\talert.cancelButtonIndex = 1;\n\t\t\talert.addEventListener(Event.CLOSE, alert_closeHandler);\n\t\t}\n\n\t\tprivate function alert_closeHandler(event:Event, data:Object):void\n\t\t{\n\t\t\tif(data)\n\t\t\t{\n\t\t\t\ttrace(\"alert closed with item:\", data.label);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttrace(\"alert closed without item\");\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/AutoCompleteScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.AutoComplete;\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.ScrollPolicy;\n\timport feathers.data.LocalAutoCompleteSource;\n\timport feathers.data.VectorCollection;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class AutoCompleteScreen extends PanelScreen\n\t{\n\t\tpublic function AutoCompleteScreen()\n\t\t{\n\t\t}\n\n\t\tprivate var _input:AutoComplete;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Auto-complete\";\n\t\t\t\n\t\t\tvar verticalLayout:VerticalLayout = new VerticalLayout();\n\t\t\tverticalLayout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tverticalLayout.verticalAlign = VerticalAlign.TOP;\n\t\t\tverticalLayout.padding = 12;\n\t\t\tverticalLayout.gap = 8;\n\t\t\tthis.layout = verticalLayout;\n\n\t\t\tthis.verticalScrollPolicy = ScrollPolicy.ON;\n\n\t\t\tthis._input = new AutoComplete();\n\t\t\tthis._input.prompt = \"Fruits. Type 'ap' to see suggestions\";\n\t\t\tthis._input.source = new LocalAutoCompleteSource(new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\t\"Apple\",\n\t\t\t\t\"Apricot\",\n\t\t\t\t\"Banana\",\n\t\t\t\t\"Cantaloupe\",\n\t\t\t\t\"Cherry\",\n\t\t\t\t\"Grape\",\n\t\t\t\t\"Lemon\",\n\t\t\t\t\"Lime\",\n\t\t\t\t\"Mango\",\n\t\t\t\t\"Orange\",\n\t\t\t\t\"Peach\",\n\t\t\t\t\"Pineapple\",\n\t\t\t\t\"Plum\",\n\t\t\t\t\"Pomegranate\",\n\t\t\t\t\"Raspberry\",\n\t\t\t\t\"Strawberry\",\n\t\t\t\t\"Watermelon\"\n\t\t\t]));\n\t\t\tthis.addChild(this._input);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/ButtonGroupScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.ButtonGroup;\n\timport feathers.controls.Header;\n\timport feathers.controls.PanelScreen;\n\timport feathers.data.ArrayCollection;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class ButtonGroupScreen extends PanelScreen\n\t{\n\t\tpublic function ButtonGroupScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _buttonGroup:ButtonGroup;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Button Group\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._buttonGroup = new ButtonGroup();\n\t\t\tthis._buttonGroup.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ label: \"One\", triggered: button_triggeredHandler },\n\t\t\t\t{ label: \"Two\", triggered: button_triggeredHandler },\n\t\t\t\t{ label: \"Three\", triggered: button_triggeredHandler },\n\t\t\t\t{ label: \"Four\", triggered: button_triggeredHandler },\n\t\t\t]);\n\t\t\tvar buttonGroupLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tbuttonGroupLayoutData.horizontalCenter = 0;\n\t\t\tbuttonGroupLayoutData.verticalCenter = 0;\n\t\t\tthis._buttonGroup.layoutData = buttonGroupLayoutData;\n\t\t\tthis.addChild(this._buttonGroup);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function button_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tvar button:Button = Button(event.currentTarget);\n\t\t\ttrace(button.label + \" triggered.\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/ButtonScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.ImageLoader;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.ScrollPolicy;\n\timport feathers.controls.ToggleButton;\n\timport feathers.examples.componentsExplorer.data.EmbeddedAssets;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class ButtonScreen extends PanelScreen\n\t{\n\t\tpublic function ButtonScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _normalButton:Button;\n\t\tprivate var _disabledButton:Button;\n\t\tprivate var _iconButton:Button;\n\t\tprivate var _toggleButton:ToggleButton;\n\t\tprivate var _callToActionButton:Button;\n\t\tprivate var _quietButton:Button;\n\t\tprivate var _dangerButton:Button;\n\t\tprivate var _sampleBackButton:Button;\n\t\tprivate var _forwardButton:Button;\n\t\t\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Button\";\n\t\t\t\n\t\t\tvar verticalLayout:VerticalLayout = new VerticalLayout();\n\t\t\tverticalLayout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tverticalLayout.verticalAlign = VerticalAlign.TOP;\n\t\t\tverticalLayout.padding = 12;\n\t\t\tverticalLayout.gap = 8;\n\t\t\tthis.layout = verticalLayout;\n\n\t\t\tthis.verticalScrollPolicy = ScrollPolicy.ON;\n\t\t\t\n\t\t\tthis._normalButton = new Button();\n\t\t\tthis._normalButton.label = \"Normal Button\";\n\t\t\tthis._normalButton.addEventListener(Event.TRIGGERED, normalButton_triggeredHandler);\n\t\t\tthis.addChild(this._normalButton);\n\n\t\t\tthis._disabledButton = new Button();\n\t\t\tthis._disabledButton.label = \"Disabled Button\";\n\t\t\tthis._disabledButton.isEnabled = false;\n\t\t\tthis.addChild(this._disabledButton);\n\t\t\t\n\t\t\tthis._iconButton = new Button();\n\t\t\tthis._iconButton.label = \"Icon Button\";\n\t\t\tvar icon:ImageLoader = new ImageLoader();\n\t\t\t//the source can be either a texture or a URL\n\t\t\ticon.source = EmbeddedAssets.SKULL_ICON_DARK;\n\t\t\tthis._iconButton.defaultIcon = icon;\n\t\t\tthis.addChild(this._iconButton);\n\n\t\t\tthis._toggleButton = new ToggleButton();\n\t\t\tthis._toggleButton.label = \"Toggle Button\";\n\t\t\tthis._toggleButton.isSelected = true;\n\t\t\tthis._toggleButton.addEventListener(Event.CHANGE, toggleButton_changeHandler);\n\t\t\tthis.addChild(this._toggleButton);\n\n\t\t\tthis._callToActionButton = new Button();\n\t\t\tthis._callToActionButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_CALL_TO_ACTION_BUTTON);\n\t\t\tthis._callToActionButton.label = \"Call to Action Button\";\n\t\t\tthis.addChild(this._callToActionButton);\n\n\t\t\tthis._dangerButton = new Button();\n\t\t\tthis._dangerButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_DANGER_BUTTON);\n\t\t\tthis._dangerButton.label = \"Danger Button\";\n\t\t\tthis.addChild(this._dangerButton);\n\n\t\t\tthis._sampleBackButton = new Button();\n\t\t\tthis._sampleBackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\tthis._sampleBackButton.label = \"Back Button\";\n\t\t\tthis.addChild(this._sampleBackButton);\n\n\t\t\tthis._forwardButton = new Button();\n\t\t\tthis._forwardButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_FORWARD_BUTTON);\n\t\t\tthis._forwardButton.label = \"Forward Button\";\n\t\t\tthis.addChild(this._forwardButton);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\tthis._quietButton = new Button();\n\t\t\tthis._quietButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_QUIET_BUTTON);\n\t\t\tthis._quietButton.label = \"Quiet Button\";\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tthis._quietButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\t\t\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function normalButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\ttrace(\"normal button triggered.\")\n\t\t}\n\n\t\tprivate function toggleButton_changeHandler(event:Event):void\n\t\t{\n\t\t\ttrace(\"toggle button changed:\", this._toggleButton.isSelected);\n\t\t}\n\t\t\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/CalloutScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Callout;\n\timport feathers.controls.Header;\n\timport feathers.controls.Label;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.ScrollPolicy;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class CalloutScreen extends PanelScreen\n\t{\n\t\tpublic function CalloutScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _showCalloutButton:Button;\n\t\tprivate var _content:PanelScreen;\n\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//the content won't be on the display list when the screen is\n\t\t\t//disposed, so dispose it manually\n\t\t\tif(this._content)\n\t\t\t{\n\t\t\t\tthis._content.dispose();\n\t\t\t\tthis._content = null;\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Callout\";\n\n\t\t\tvar verticalLayout:VerticalLayout = new VerticalLayout();\n\t\t\tverticalLayout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tverticalLayout.verticalAlign = VerticalAlign.TOP;\n\t\t\tverticalLayout.padding = 12;\n\t\t\tverticalLayout.gap = 8;\n\t\t\tthis.layout = verticalLayout;\n\n\t\t\tthis.verticalScrollPolicy = ScrollPolicy.ON;\n\n\t\t\t//this is what we're going to display in the callout\n\t\t\tthis._content = new PanelScreen();\n\t\t\tthis._content.headerFactory = function():Header\n\t\t\t{\n\t\t\t\tvar header:Header = new Header();\n\t\t\t\t//don't add extra padding on iOS\n\t\t\t\theader.useExtraPaddingForOSStatusBar = false;\n\t\t\t\theader.paddingTop = 2;\n\t\t\t\theader.paddingBottom = 8;\n\t\t\t\theader.gap = 8;\n\t\t\t\theader.titleGap = 8;\n\t\t\t\theader.backgroundSkin = null;\n\t\t\t\t//we want to use the theme's font styles, with a slightly smaller font size\n\t\t\t\theader.initializeNow();\n\t\t\t\theader.fontStyles.size = 14;\n\t\t\t\treturn header;\n\t\t\t};\n\t\t\tthis._content.title = \"Callout Content\";\n\t\t\tthis._content.width = 200;\n\t\t\tthis._content.layout = new AnchorLayout();\n\t\t\tvar description:Label = new Label();\n\t\t\tdescription.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tdescription.wordWrap = true;\n\t\t\tdescription.text = \"A callout displays content in a pop-up container, with an arrow that points to its origin.\\n\\nTap anywhere outside of the callout to close it.\";\n\t\t\tthis._content.addChild(description);\n\t\t\t//the content will be shown in the callout, so we don't add it to a\n\t\t\t//parent yet.\n\n\t\t\tthis._showCalloutButton = new Button();\n\t\t\tthis._showCalloutButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_CALL_TO_ACTION_BUTTON);\n\t\t\tthis._showCalloutButton.label = \"Show Callout\";\n\t\t\tthis._showCalloutButton.addEventListener(Event.TRIGGERED, showCalloutButton_triggeredHandler);\n\t\t\tthis.addChild(this._showCalloutButton);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function showCalloutButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tvar callout:Callout = Callout.show(this._content, this._showCalloutButton);\n\t\t\t//we're reusing the content every time that it is shown, so we don't\n\t\t\t//want the content to be disposed. we'll dispose of it manually\n\t\t\t//later when the screen is disposed.\n\t\t\tcallout.disposeContent = false;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/CheckScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Check;\n\timport feathers.controls.Header;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.ScrollPolicy;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class CheckScreen extends PanelScreen\n\t{\n\t\tpublic function CheckScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _check:Check;\n\t\tprivate var _checked:Check;\n\t\tprivate var _disabled:Check;\n\t\tprivate var _selectedDisabled:Check;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Check\";\n\n\t\t\tvar verticalLayout:VerticalLayout = new VerticalLayout();\n\t\t\tverticalLayout.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tverticalLayout.verticalAlign = VerticalAlign.TOP;\n\t\t\tverticalLayout.padding = 12;\n\t\t\tverticalLayout.gap = 8;\n\t\t\tthis.layout = verticalLayout;\n\n\t\t\tthis.verticalScrollPolicy = ScrollPolicy.ON;\n\n\t\t\tthis._check = new Check();\n\t\t\tthis._check.label = \"Default\";\n\t\t\tthis._check.addEventListener(Event.CHANGE, check_changeHandler);\n\t\t\tthis.addChild(this._check);\n\n\t\t\tthis._checked = new Check();\n\t\t\tthis._checked.label = \"Selected\";\n\t\t\tthis._checked.isSelected = true;\n\t\t\tthis.addChild(this._checked);\n\n\t\t\tthis._disabled = new Check();\n\t\t\tthis._disabled.label = \"Disabled\";\n\t\t\tthis._disabled.isEnabled = false;\n\t\t\tthis.addChild(this._disabled);\n\n\t\t\tthis._selectedDisabled = new Check();\n\t\t\tthis._selectedDisabled.label = \"Selected and Disabled\";\n\t\t\tthis._selectedDisabled.isSelected = true;\n\t\t\tthis._selectedDisabled.isEnabled = false;\n\t\t\tthis.addChild(this._selectedDisabled);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function check_changeHandler(event:Event):void\n\t\t{\n\t\t\ttrace(\"check changed:\", this._check.isSelected);\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/DataGridScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.DataGrid;\n\timport feathers.controls.DataGridColumn;\n\timport feathers.controls.Header;\n\timport feathers.controls.PanelScreen;\n\timport feathers.data.ArrayCollection;\n\timport feathers.events.FeathersEventType;\n\timport feathers.examples.componentsExplorer.data.DataGridSettings;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\t[Event(name=\"showSettings\",type=\"starling.events.Event\")]\n\n\tpublic class DataGridScreen extends PanelScreen\n\t{\n\t\tpublic static const SHOW_SETTINGS:String = \"showSettings\";\n\n\t\tpublic function DataGridScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic var settings:DataGridSettings;\n\n\t\tprivate var _grid:DataGrid;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Data Grid\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tvar items:Array =\n\t\t\t[\n\t\t\t\t{ item: \"Chicken breast\", dept: \"Meat\", price: \"5.90\" },\n\t\t\t\t{ item: \"Bacon\", dept: \"Meat\", price: \"4.49\" },\n\t\t\t\t{ item: \"2% Milk\", dept: \"Dairy\", price: \"2.49\" },\n\t\t\t\t{ item: \"Butter\", dept: \"Dairy\", price: \"4.69\" },\n\t\t\t\t{ item: \"Lettuce\", dept: \"Produce\", price: \"1.29\" },\n\t\t\t\t{ item: \"Broccoli\", dept: \"Produce\", price: \"2.99\" },\n\t\t\t\t{ item: \"Whole Wheat Bread\", dept: \"Bakery\", price: \"2.49\" },\n\t\t\t\t{ item: \"English Muffins\", dept: \"Bakery\", price: \"2.99\" },\n\t\t\t];\n\t\t\tvar columns:Array =\n\t\t\t[\n\t\t\t\tnew DataGridColumn(\"item\", \"Item\"),\n\t\t\t\tnew DataGridColumn(\"dept\", \"Department\"),\n\t\t\t\tnew DataGridColumn(\"price\", \"Unit Price\"),\n\t\t\t];\n\n\t\t\tthis._grid = new DataGrid();\n\t\t\tthis._grid.dataProvider = new ArrayCollection(items);\n\t\t\tthis._grid.columns = new ArrayCollection(columns);\n\n\t\t\tthis._grid.sortableColumns = this.settings.sortableColumns;\n\t\t\tthis._grid.resizableColumns = this.settings.resizableColumns;\n\t\t\tthis._grid.reorderColumns = this.settings.reorderColumns;\n\n\t\t\t//optimization: since this grid fills the entire screen, there's no\n\t\t\t//need for clipping. clipping should not be disabled if there's a\n\t\t\t//chance that item renderers could be visible if they appear outside\n\t\t\t//the list's bounds\n\t\t\tthis._grid.clipContent = false;\n\t\t\t//optimization: when the background is covered by all item\n\t\t\t//renderers, don't render it\n\t\t\tthis._grid.autoHideBackground = true;\n\t\t\tthis._grid.addEventListener(Event.CHANGE, list_changeHandler);\n\t\t\tthis._grid.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis.addChild(this._grid);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\n\t\t\tthis.addEventListener(FeathersEventType.TRANSITION_IN_COMPLETE, transitionInCompleteHandler);\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\tvar settingsButton:Button = new Button();\n\t\t\tsettingsButton.label = \"Settings\";\n\t\t\tsettingsButton.addEventListener(Event.TRIGGERED, settingsButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tsettingsButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\t\t\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function transitionInCompleteHandler(event:Event):void\n\t\t{\n\t\t\tthis._grid.revealScrollBars();\n\t\t}\n\t\t\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function settingsButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(SHOW_SETTINGS);\n\t\t}\n\n\t\tprivate function list_changeHandler(event:Event):void\n\t\t{\n\t\t\tvar selectedIndices:Vector.<int> = this._grid.selectedIndices;\n\t\t\ttrace(\"List change:\", selectedIndices.length > 0 ? selectedIndices : this._grid.selectedIndex);\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/DataGridSettingsScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.List;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.ToggleSwitch;\n\timport feathers.data.ArrayCollection;\n\timport feathers.examples.componentsExplorer.data.DataGridSettings;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class DataGridSettingsScreen extends PanelScreen\n\t{\n\t\tpublic function DataGridSettingsScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic var settings:DataGridSettings;\n\n\t\tprivate var _list:List;\n\t\tprivate var _sortableColumnsToggle:ToggleSwitch;\n\t\tprivate var _resizableColumnsToggle:ToggleSwitch;\n\t\tprivate var _reorderColumnsToggle:ToggleSwitch;\n\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//icon and accessory display objects in the list's data provider\n\t\t\t//won't be automatically disposed because feathers cannot know if\n\t\t\t//they need to be used again elsewhere or not. we need to dispose\n\t\t\t//them manually.\n\t\t\tthis._list.dataProvider.dispose(disposeItemAccessory);\n\n\t\t\t//never forget to call super.dispose() because you don't want to\n\t\t\t//create a memory leak!\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Data Grid Settings\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._sortableColumnsToggle = new ToggleSwitch();\n\t\t\tthis._sortableColumnsToggle.isSelected = this.settings.sortableColumns;\n\t\t\tthis._sortableColumnsToggle.addEventListener(Event.CHANGE, sortableColumnsToggle_changeHandler);\n\n\t\t\tthis._resizableColumnsToggle = new ToggleSwitch();\n\t\t\tthis._resizableColumnsToggle.isSelected = this.settings.resizableColumns;\n\t\t\tthis._resizableColumnsToggle.addEventListener(Event.CHANGE, resizableColumnsToggle_changeHandler);\n\n\t\t\tthis._reorderColumnsToggle = new ToggleSwitch();\n\t\t\tthis._reorderColumnsToggle.isSelected = this.settings.reorderColumns;\n\t\t\tthis._reorderColumnsToggle.addEventListener(Event.CHANGE, reorderColumnsToggle_changeHandler);\n\n\t\t\tthis._list = new List();\n\t\t\tthis._list.isSelectable = false;\n\t\t\tthis._list.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ label: \"Sortable Columns\", accessory: this._sortableColumnsToggle },\n\t\t\t\t{ label: \"Resizable Columns\", accessory: this._resizableColumnsToggle },\n\t\t\t\t{ label: \"Reorder Columns\", accessory: this._reorderColumnsToggle },\n\t\t\t]);\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis._list.clipContent = false;\n\t\t\tthis._list.autoHideBackground = true;\n\t\t\tthis.addChild(this._list);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\tvar doneButton:Button = new Button();\n\t\t\tdoneButton.label = \"Done\";\n\t\t\tdoneButton.addEventListener(Event.TRIGGERED, doneButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tdoneButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function disposeItemAccessory(item:Object):void\n\t\t{\n\t\t\tDisplayObject(item.accessory).dispose();\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function reorderColumnsToggle_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.reorderColumns = this._reorderColumnsToggle.isSelected;\n\t\t}\n\n\t\tprivate function resizableColumnsToggle_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.resizableColumns = this._resizableColumnsToggle.isSelected;\n\t\t}\n\n\t\tprivate function sortableColumnsToggle_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.sortableColumns = this._sortableColumnsToggle.isSelected;\n\t\t}\n\n\t\tprivate function doneButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/DateTimeSpinnerScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.DateTimeSpinner;\n\timport feathers.controls.Header;\n\timport feathers.controls.PanelScreen;\n\timport feathers.examples.componentsExplorer.data.DateTimeSpinnerSettings;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\t\n\tpublic class DateTimeSpinnerScreen extends PanelScreen\n\t{\n\t\tpublic static const SHOW_SETTINGS:String = \"showSettings\";\n\t\t\n\t\tpublic function DateTimeSpinnerScreen()\n\t\t{\n\t\t}\n\n\t\tpublic var settings:DateTimeSpinnerSettings;\n\n\t\tprivate var _dateTimeSpinner:DateTimeSpinner;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Date Time Spinner\";\n\n\t\t\tvar verticalLayout:VerticalLayout = new VerticalLayout();\n\t\t\tverticalLayout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tverticalLayout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\tverticalLayout.padding = 12;\n\t\t\tverticalLayout.gap = 8;\n\t\t\tthis.layout = verticalLayout;\n\n\t\t\tthis._dateTimeSpinner = new DateTimeSpinner();\n\t\t\tthis._dateTimeSpinner.editingMode = this.settings.editingMode;\n\t\t\tthis._dateTimeSpinner.addEventListener(Event.CHANGE, dateTimeSpinner_changeHandler);\n\t\t\tthis.addChild(this._dateTimeSpinner);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\tvar settingsButton:Button = new Button();\n\t\t\tsettingsButton.label = \"Settings\";\n\t\t\tsettingsButton.addEventListener(Event.TRIGGERED, settingsButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tsettingsButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function settingsButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(SHOW_SETTINGS);\n\t\t}\n\n\t\tprivate function dateTimeSpinner_changeHandler(event:Event):void\n\t\t{\n\t\t\ttrace(\"DateTimeSpinner change:\", this._dateTimeSpinner.value);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/DateTimeSpinnerSettingsScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.DateTimeMode;\n\timport feathers.controls.Header;\n\timport feathers.controls.List;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.PickerList;\n\timport feathers.data.ArrayCollection;\n\timport feathers.data.VectorCollection;\n\timport feathers.examples.componentsExplorer.data.DateTimeSpinnerSettings;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class DateTimeSpinnerSettingsScreen extends PanelScreen\n\t{\n\t\tpublic function DateTimeSpinnerSettingsScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic var settings:DateTimeSpinnerSettings;\n\n\t\tprivate var _list:List;\n\t\tprivate var _editingModePicker:PickerList;\n\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//icon and accessory display objects in the list's data provider\n\t\t\t//won't be automatically disposed because feathers cannot know if\n\t\t\t//they need to be used again elsewhere or not. we need to dispose\n\t\t\t//them manually.\n\t\t\tthis._list.dataProvider.dispose(disposeItemAccessory);\n\n\t\t\t//never forget to call super.dispose() because you don't want to\n\t\t\t//create a memory leak!\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Date Time Spinner Settings\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._editingModePicker = new PickerList();\n\t\t\tthis._editingModePicker.dataProvider = new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\tDateTimeMode.DATE_AND_TIME,\n\t\t\t\tDateTimeMode.DATE,\n\t\t\t\tDateTimeMode.TIME,\n\t\t\t]);\n\t\t\tthis._editingModePicker.selectedItem = this.settings.editingMode;\n\t\t\tthis._editingModePicker.addEventListener(Event.CHANGE, editingModePicker_changeHandler);\n\n\t\t\tthis._list = new List();\n\t\t\tthis._list.isSelectable = false;\n\t\t\tthis._list.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ label: \"editingMode\", accessory: this._editingModePicker },\n\t\t\t]);\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis._list.clipContent = false;\n\t\t\tthis._list.autoHideBackground = true;\n\t\t\tthis.addChild(this._list);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\tvar doneButton:Button = new Button();\n\t\t\tdoneButton.label = \"Done\";\n\t\t\tdoneButton.addEventListener(Event.TRIGGERED, doneButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tdoneButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function disposeItemAccessory(item:Object):void\n\t\t{\n\t\t\tDisplayObject(item.accessory).dispose();\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function editingModePicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.editingMode = this._editingModePicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function doneButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/GroupedListScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.GroupedList;\n\timport feathers.controls.Header;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.renderers.DefaultGroupedListItemRenderer;\n\timport feathers.controls.renderers.IGroupedListItemRenderer;\n\timport feathers.data.ArrayHierarchicalCollection;\n\timport feathers.events.FeathersEventType;\n\timport feathers.examples.componentsExplorer.data.GroupedListSettings;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\t[Event(name=\"showSettings\",type=\"starling.events.Event\")]\n\n\tpublic class GroupedListScreen extends PanelScreen\n\t{\n\t\tpublic static const SHOW_SETTINGS:String = \"showSettings\";\n\n\t\tpublic function GroupedListScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic var settings:GroupedListSettings;\n\n\t\tprivate var _list:GroupedList;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Grouped List\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tvar groups:Array =\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\theader: \"A\",\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{ text: \"Aardvark\" },\n\t\t\t\t\t\t{ text: \"Alligator\" },\n\t\t\t\t\t\t{ text: \"Alpaca\" },\n\t\t\t\t\t\t{ text: \"Anteater\" },\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\theader: \"B\",\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{ text: \"Baboon\" },\n\t\t\t\t\t\t{ text: \"Bear\" },\n\t\t\t\t\t\t{ text: \"Beaver\" },\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\theader: \"C\",\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{ text: \"Canary\" },\n\t\t\t\t\t\t{ text: \"Cat\" },\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\theader: \"D\",\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{ text: \"Deer\" },\n\t\t\t\t\t\t{ text: \"Dingo\" },\n\t\t\t\t\t\t{ text: \"Dog\" },\n\t\t\t\t\t\t{ text: \"Dolphin\" },\n\t\t\t\t\t\t{ text: \"Donkey\" },\n\t\t\t\t\t\t{ text: \"Dragonfly\" },\n\t\t\t\t\t\t{ text: \"Duck\" },\n\t\t\t\t\t\t{ text: \"Dung Beetle\" },\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\theader: \"E\",\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{ text: \"Eagle\" },\n\t\t\t\t\t\t{ text: \"Earthworm\" },\n\t\t\t\t\t\t{ text: \"Eel\" },\n\t\t\t\t\t\t{ text: \"Elk\" },\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\theader: \"F\",\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{ text: \"Fox\" },\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t];\n\t\t\t\n\t\t\tthis._list = new GroupedList();\n\t\t\tif(this.settings.style == GroupedListSettings.STYLE_INSET)\n\t\t\t{\n\t\t\t\tthis._list.styleNameList.add(GroupedList.ALTERNATE_STYLE_NAME_INSET_GROUPED_LIST);\n\t\t\t}\n\t\t\tthis._list.dataProvider = new ArrayHierarchicalCollection(groups);\n\t\t\tthis._list.typicalItem = { text: \"Item 1000\" };\n\t\t\tthis._list.isSelectable = this.settings.isSelectable;\n\t\t\tthis._list.hasElasticEdges = this.settings.hasElasticEdges;\n\t\t\t//optimization: since this list fills the entire screen, there's no\n\t\t\t//need for clipping. clipping should not be disabled if there's a\n\t\t\t//chance that item renderers could be visible if they appear outside\n\t\t\t//the list's bounds\n\t\t\tthis._list.clipContent = false;\n\t\t\t//optimization: when the background is covered by all item\n\t\t\t//renderers, don't render it\n\t\t\tthis._list.autoHideBackground = true;\n\t\t\tthis._list.itemRendererFactory = function():IGroupedListItemRenderer\n\t\t\t{\n\t\t\t\tvar renderer:DefaultGroupedListItemRenderer = new DefaultGroupedListItemRenderer();\n\n\t\t\t\t//enable the quick hit area to optimize hit tests when an item\n\t\t\t\t//is only selectable and doesn't have interactive children.\n\t\t\t\trenderer.isQuickHitAreaEnabled = true;\n\n\t\t\t\trenderer.labelField = \"text\";\n\t\t\t\treturn renderer;\n\t\t\t};\n\t\t\tthis._list.addEventListener(Event.CHANGE, list_changeHandler);\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis.addChildAt(this._list, 0);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\n\t\t\tthis.addEventListener(FeathersEventType.TRANSITION_IN_COMPLETE, transitionInCompleteHandler);\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\tvar settingsButton:Button = new Button();\n\t\t\tsettingsButton.label = \"Settings\";\n\t\t\tsettingsButton.addEventListener(Event.TRIGGERED, settingsButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tsettingsButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\t\t\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function transitionInCompleteHandler(event:Event):void\n\t\t{\n\t\t\tthis._list.revealScrollBars();\n\t\t}\n\t\t\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function settingsButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(SHOW_SETTINGS);\n\t\t}\n\n\t\tprivate function list_changeHandler(event:Event):void\n\t\t{\n\t\t\ttrace(\"GroupedList change:\", this._list.selectedGroupIndex, this._list.selectedItemIndex);\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/GroupedListSettingsScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.List;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.PickerList;\n\timport feathers.controls.ToggleSwitch;\n\timport feathers.data.ArrayCollection;\n\timport feathers.data.VectorCollection;\n\timport feathers.examples.componentsExplorer.data.GroupedListSettings;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class GroupedListSettingsScreen extends PanelScreen\n\t{\n\t\tpublic function GroupedListSettingsScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic var settings:GroupedListSettings;\n\n\t\tprivate var _list:List;\n\n\t\tprivate var _stylePicker:PickerList;\n\t\tprivate var _isSelectableToggle:ToggleSwitch;\n\t\tprivate var _hasElasticEdgesToggle:ToggleSwitch;\n\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//icon and accessory display objects in the list's data provider\n\t\t\t//won't be automatically disposed because feathers cannot know if\n\t\t\t//they need to be used again elsewhere or not. we need to dispose\n\t\t\t//them manually.\n\t\t\tthis._list.dataProvider.dispose(disposeItemAccessory);\n\n\t\t\t//never forget to call super.dispose() because you don't want to\n\t\t\t//create a memory leak!\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Grouped List Settings\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._stylePicker = new PickerList();\n\t\t\tthis._stylePicker.dataProvider = new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\tGroupedListSettings.STYLE_NORMAL,\n\t\t\t\tGroupedListSettings.STYLE_INSET\n\t\t\t]);\n\t\t\tthis._stylePicker.typicalItem = GroupedListSettings.STYLE_NORMAL;\n\t\t\tthis._stylePicker.listProperties.typicalItem = GroupedListSettings.STYLE_NORMAL;\n\t\t\tthis._stylePicker.selectedItem = this.settings.style;\n\t\t\tthis._stylePicker.addEventListener(Event.CHANGE, stylePicker_changeHandler);\n\n\t\t\tthis._isSelectableToggle = new ToggleSwitch();\n\t\t\tthis._isSelectableToggle.isSelected = this.settings.isSelectable;\n\t\t\tthis._isSelectableToggle.addEventListener(Event.CHANGE, isSelectableToggle_changeHandler);\n\n\t\t\tthis._hasElasticEdgesToggle = new ToggleSwitch();\n\t\t\tthis._hasElasticEdgesToggle.isSelected = this.settings.hasElasticEdges;\n\t\t\tthis._hasElasticEdgesToggle.addEventListener(Event.CHANGE, hasElasticEdgesToggle_changeHandler);\n\n\t\t\tthis._list = new List();\n\t\t\tthis._list.isSelectable = false;\n\t\t\tthis._list.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ label: \"Group Style\", accessory: this._stylePicker },\n\t\t\t\t{ label: \"isSelectable\", accessory: this._isSelectableToggle },\n\t\t\t\t{ label: \"hasElasticEdges\", accessory: this._hasElasticEdgesToggle },\n\t\t\t]);\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis._list.clipContent = false;\n\t\t\tthis._list.autoHideBackground = true;\n\t\t\tthis.addChild(this._list);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\tvar doneButton:Button = new Button();\n\t\t\tdoneButton.label = \"Done\";\n\t\t\tdoneButton.addEventListener(Event.TRIGGERED, doneButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tdoneButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function disposeItemAccessory(item:Object):void\n\t\t{\n\t\t\tDisplayObject(item.accessory).dispose();\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function doneButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function stylePicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.style = this._stylePicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function isSelectableToggle_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.isSelectable = this._isSelectableToggle.isSelected;\n\t\t}\n\n\t\tprivate function hasElasticEdgesToggle_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.hasElasticEdges = this._hasElasticEdgesToggle.isSelected;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/ItemRendererScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.List;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.ToggleSwitch;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.renderers.IListItemRenderer;\n\timport feathers.data.ArrayCollection;\n\timport feathers.examples.componentsExplorer.data.EmbeddedAssets;\n\timport feathers.examples.componentsExplorer.data.ItemRendererSettings;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\t[Event(name=\"showSettings\",type=\"starling.events.Event\")]\n\n\tpublic class ItemRendererScreen extends PanelScreen\n\t{\n\t\tpublic static const SHOW_SETTINGS:String = \"showSettings\";\n\n\t\tpublic function ItemRendererScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _list:List;\n\t\tprivate var _listItem:Object;\n\n\t\tprivate var _settings:ItemRendererSettings;\n\n\t\tpublic function get settings():ItemRendererSettings\n\t\t{\n\t\t\treturn this._settings;\n\t\t}\n\n\t\tpublic function set settings(value:ItemRendererSettings):void\n\t\t{\n\t\t\tif(this._settings == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._settings = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//icon and accessory display objects in the list's data provider\n\t\t\t//won't be automatically disposed because feathers cannot know if\n\t\t\t//they need to be used again elsewhere or not. we need to dispose\n\t\t\t//them manually.\n\t\t\tthis._list.dataProvider.dispose(disposeItemIconOrAccessory);\n\n\t\t\t//never forget to call super.dispose() because you don't want to\n\t\t\t//create a memory leak!\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()!\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Item Renderer\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._list = new List();\n\n\t\t\tthis._listItem = { text: \"Primary Text\" };\n\t\t\tthis._list.itemRendererFactory = this.customItemRendererFactory;\n\t\t\tthis._list.dataProvider = new ArrayCollection([this._listItem]);\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis._list.isSelectable = false;\n\t\t\tthis._list.clipContent = false;\n\t\t\tthis._list.autoHideBackground = true;\n\t\t\tthis.addChild(this._list);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\t\t}\n\n\t\tprivate function customItemRendererFactory():IListItemRenderer\n\t\t{\n\t\t\tvar itemRenderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\t\t\titemRenderer.labelField = \"text\";\n\t\t\tif(this.settings.hasIcon)\n\t\t\t{\n\t\t\t\tswitch(this.settings.iconType)\n\t\t\t\t{\n\t\t\t\t\tcase ItemRendererSettings.ICON_ACCESSORY_TYPE_LABEL:\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._listItem.iconText = \"Icon Text\";\n\t\t\t\t\t\titemRenderer.iconLabelField = \"iconText\";\n\n\t\t\t\t\t\t//clear these in case this setting has changed\n\t\t\t\t\t\tdelete this._listItem.iconTexture;\n\t\t\t\t\t\tdelete this._listItem.icon;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase ItemRendererSettings.ICON_ACCESSORY_TYPE_TEXTURE:\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._listItem.iconTexture = EmbeddedAssets.SKULL_ICON_LIGHT;\n\t\t\t\t\t\titemRenderer.iconSourceField = \"iconTexture\";\n\n\t\t\t\t\t\t//clear these in case this setting has changed\n\t\t\t\t\t\tdelete this._listItem.iconText;\n\t\t\t\t\t\tdelete this._listItem.icon;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tdefault:\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._listItem.icon = new ToggleSwitch();\n\t\t\t\t\t\titemRenderer.iconField = \"icon\";\n\n\t\t\t\t\t\t//clear these in case this setting has changed\n\t\t\t\t\t\tdelete this._listItem.iconText;\n\t\t\t\t\t\tdelete this._listItem.iconTexture;\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\titemRenderer.iconPosition = this.settings.iconPosition;\n\t\t\t}\n\t\t\tif(this.settings.hasAccessory)\n\t\t\t{\n\t\t\t\tswitch(this.settings.accessoryType)\n\t\t\t\t{\n\t\t\t\t\tcase ItemRendererSettings.ICON_ACCESSORY_TYPE_LABEL:\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._listItem.accessoryText = \"Accessory Text\";\n\t\t\t\t\t\titemRenderer.accessoryLabelField = \"accessoryText\";\n\n\t\t\t\t\t\t//clear these in case this setting has changed\n\t\t\t\t\t\tdelete this._listItem.accessoryTexture;\n\t\t\t\t\t\tdelete this._listItem.accessory;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase ItemRendererSettings.ICON_ACCESSORY_TYPE_TEXTURE:\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._listItem.accessoryTexture = EmbeddedAssets.SKULL_ICON_LIGHT;\n\t\t\t\t\t\titemRenderer.accessorySourceField = \"accessoryTexture\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tdefault:\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._listItem.accessory = new ToggleSwitch();\n\t\t\t\t\t\titemRenderer.accessoryField = \"accessory\";\n\n\t\t\t\t\t\t//clear these in case this setting has changed\n\t\t\t\t\t\tdelete this._listItem.accessoryText;\n\t\t\t\t\t\tdelete this._listItem.accessoryTexture;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\titemRenderer.accessoryPosition = this.settings.accessoryPosition;\n\t\t\t}\n\t\t\tif(this.settings.useInfiniteGap)\n\t\t\t{\n\t\t\t\titemRenderer.gap = Number.POSITIVE_INFINITY;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\titemRenderer.gap = 12;\n\t\t\t}\n\t\t\tif(this.settings.useInfiniteAccessoryGap)\n\t\t\t{\n\t\t\t\titemRenderer.accessoryGap = Number.POSITIVE_INFINITY;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\titemRenderer.accessoryGap = 12;\n\t\t\t}\n\t\t\titemRenderer.horizontalAlign = this.settings.horizontalAlign;\n\t\t\titemRenderer.verticalAlign = this.settings.verticalAlign;\n\t\t\titemRenderer.layoutOrder = this.settings.layoutOrder;\n\t\t\treturn itemRenderer;\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\tvar settingsButton:Button = new Button();\n\t\t\tsettingsButton.label = \"Settings\";\n\t\t\tsettingsButton.addEventListener(Event.TRIGGERED, settingsButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tsettingsButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function disposeItemIconOrAccessory(item:Object):void\n\t\t{\n\t\t\tif(item.hasOwnProperty(\"icon\"))\n\t\t\t{\n\t\t\t\tDisplayObject(item.icon).dispose();\n\t\t\t}\n\t\t\tif(item.hasOwnProperty(\"accessory\"))\n\t\t\t{\n\t\t\t\tDisplayObject(item.accessory).dispose();\n\t\t\t}\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function settingsButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(SHOW_SETTINGS);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/ItemRendererSettingsScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.GroupedList;\n\timport feathers.controls.Header;\n\timport feathers.controls.ItemRendererLayoutOrder;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.PickerList;\n\timport feathers.controls.ToggleSwitch;\n\timport feathers.data.ArrayCollection;\n\timport feathers.data.ArrayHierarchicalCollection;\n\timport feathers.data.VectorCollection;\n\timport feathers.examples.componentsExplorer.data.ItemRendererSettings;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.RelativePosition;\n\timport feathers.layout.VerticalAlign;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class ItemRendererSettingsScreen extends PanelScreen\n\t{\n\t\tprivate static const GAP_LABEL_INFINITE:String = \"Fill Available Space\";\n\t\tprivate static const GAP_LABEL_DEFAULT:String = \"No Fill\";\n\n\t\tpublic function ItemRendererSettingsScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic var settings:ItemRendererSettings;\n\n\t\tprivate var _list:GroupedList;\n\t\tprivate var _gapPicker:PickerList;\n\t\tprivate var _hasIconToggle:ToggleSwitch;\n\t\tprivate var _hasAccessoryToggle:ToggleSwitch;\n\t\tprivate var _layoutOrderPicker:PickerList;\n\t\tprivate var _iconPositionPicker:PickerList;\n\t\tprivate var _iconTypePicker:PickerList;\n\t\tprivate var _accessoryPositionPicker:PickerList;\n\t\tprivate var _accessoryTypePicker:PickerList;\n\t\tprivate var _accessoryGapPicker:PickerList;\n\t\tprivate var _horizontalAlignPicker:PickerList;\n\t\tprivate var _verticalAlignPicker:PickerList;\n\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//icon and accessory display objects in the list's data provider\n\t\t\t//won't be automatically disposed because feathers cannot know if\n\t\t\t//they need to be used again elsewhere or not. we need to dispose\n\t\t\t//them manually.\n\t\t\tthis._list.dataProvider.dispose(null, disposeItemAccessory);\n\n\t\t\t//never forget to call super.dispose() because you don't want to\n\t\t\t//create a memory leak!\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Item Renderer Settings\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._hasIconToggle = new ToggleSwitch();\n\t\t\tthis._hasIconToggle.isSelected = this.settings.hasIcon;\n\t\t\tthis._hasIconToggle.addEventListener(Event.CHANGE, hasIconToggle_changeHandler);\n\n\t\t\tthis._iconTypePicker = new PickerList();\n\t\t\tthis._iconTypePicker.typicalItem = ItemRendererSettings.ICON_ACCESSORY_TYPE_DISPLAY_OBJECT;\n\t\t\tthis._iconTypePicker.dataProvider = new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\tItemRendererSettings.ICON_ACCESSORY_TYPE_DISPLAY_OBJECT,\n\t\t\t\tItemRendererSettings.ICON_ACCESSORY_TYPE_TEXTURE,\n\t\t\t\tItemRendererSettings.ICON_ACCESSORY_TYPE_LABEL,\n\t\t\t]);\n\t\t\tthis._iconTypePicker.listProperties.typicalItem = ItemRendererSettings.ICON_ACCESSORY_TYPE_DISPLAY_OBJECT;\n\t\t\tthis._iconTypePicker.selectedItem = this.settings.iconType;\n\t\t\tthis._iconTypePicker.addEventListener(Event.CHANGE, iconTypePicker_changeHandler);\n\n\t\t\tthis._iconPositionPicker = new PickerList();\n\t\t\tthis._iconPositionPicker.typicalItem = RelativePosition.RIGHT_BASELINE;\n\t\t\tthis._iconPositionPicker.dataProvider = new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\tRelativePosition.TOP,\n\t\t\t\tRelativePosition.RIGHT,\n\t\t\t\tRelativePosition.BOTTOM,\n\t\t\t\tRelativePosition.LEFT,\n\t\t\t\tRelativePosition.LEFT_BASELINE,\n\t\t\t\tRelativePosition.RIGHT_BASELINE,\n\t\t\t\t//RelativePosition.MANUAL,\n\t\t\t]);\n\t\t\tthis._iconPositionPicker.listProperties.typicalItem = RelativePosition.RIGHT_BASELINE;\n\t\t\tthis._iconPositionPicker.selectedItem = this.settings.iconPosition;\n\t\t\tthis._iconPositionPicker.addEventListener(Event.CHANGE, iconPositionPicker_changeHandler);\n\n\t\t\tthis._gapPicker = new PickerList();\n\t\t\tthis._gapPicker.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ label: GAP_LABEL_INFINITE, value: true },\n\t\t\t\t{ label: GAP_LABEL_DEFAULT, value: false },\n\t\t\t]);\n\t\t\tthis._gapPicker.typicalItem = this._gapPicker.dataProvider.getItemAt(0);\n\t\t\tthis._gapPicker.listProperties.typicalItem = this._gapPicker.dataProvider.getItemAt(0);\n\t\t\tthis._gapPicker.selectedItem = this._gapPicker.dataProvider.getItemAt(this.settings.useInfiniteGap ? 0 : 1);\n\t\t\tthis._gapPicker.addEventListener(Event.CHANGE, gapPicker_changeHandler);\n\n\t\t\tthis._hasAccessoryToggle = new ToggleSwitch();\n\t\t\tthis._hasAccessoryToggle.isSelected = this.settings.hasAccessory;\n\t\t\tthis._hasAccessoryToggle.addEventListener(Event.CHANGE, hasAccessoryToggle_changeHandler);\n\n\t\t\tthis._accessoryTypePicker = new PickerList();\n\t\t\tthis._accessoryTypePicker.typicalItem = ItemRendererSettings.ICON_ACCESSORY_TYPE_DISPLAY_OBJECT;\n\t\t\tthis._accessoryTypePicker.dataProvider = new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\tItemRendererSettings.ICON_ACCESSORY_TYPE_DISPLAY_OBJECT,\n\t\t\t\tItemRendererSettings.ICON_ACCESSORY_TYPE_TEXTURE,\n\t\t\t\tItemRendererSettings.ICON_ACCESSORY_TYPE_LABEL,\n\t\t\t]);\n\t\t\tthis._accessoryTypePicker.listProperties.typicalItem = ItemRendererSettings.ICON_ACCESSORY_TYPE_DISPLAY_OBJECT;\n\t\t\tthis._accessoryTypePicker.selectedItem = this.settings.accessoryType;\n\t\t\tthis._accessoryTypePicker.addEventListener(Event.CHANGE, accessoryTypePicker_changeHandler);\n\n\t\t\tthis._accessoryPositionPicker = new PickerList();\n\t\t\tthis._accessoryPositionPicker.typicalItem = RelativePosition.BOTTOM;\n\t\t\tthis._accessoryPositionPicker.dataProvider = new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\tRelativePosition.TOP,\n\t\t\t\tRelativePosition.RIGHT,\n\t\t\t\tRelativePosition.BOTTOM,\n\t\t\t\tRelativePosition.LEFT,\n\t\t\t\t//RelativePosition.MANUAL,\n\t\t\t]);\n\t\t\tthis._accessoryPositionPicker.listProperties.typicalItem = RelativePosition.BOTTOM;\n\t\t\tthis._accessoryPositionPicker.selectedItem = this.settings.accessoryPosition;\n\t\t\tthis._accessoryPositionPicker.addEventListener(Event.CHANGE, accessoryPositionPicker_changeHandler);\n\n\t\t\tthis._accessoryGapPicker = new PickerList();\n\t\t\tthis._accessoryGapPicker.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ label: GAP_LABEL_INFINITE, value: true },\n\t\t\t\t{ label: GAP_LABEL_DEFAULT, value: false },\n\t\t\t]);\n\t\t\tthis._accessoryGapPicker.typicalItem = this._accessoryGapPicker.dataProvider.getItemAt(0);\n\t\t\tthis._accessoryGapPicker.listProperties.typicalItem = this._accessoryGapPicker.dataProvider.getItemAt(0);\n\t\t\tthis._accessoryGapPicker.selectedItem = this._accessoryGapPicker.dataProvider.getItemAt(this.settings.useInfiniteAccessoryGap ? 0 : 1);\n\t\t\tthis._accessoryGapPicker.addEventListener(Event.CHANGE, accessoryGapPicker_changeHandler);\n\n\t\t\tthis._layoutOrderPicker = new PickerList();\n\t\t\tthis._layoutOrderPicker.typicalItem = ItemRendererLayoutOrder.LABEL_ACCESSORY_ICON;\n\t\t\tthis._layoutOrderPicker.dataProvider = new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\tItemRendererLayoutOrder.LABEL_ICON_ACCESSORY,\n\t\t\t\tItemRendererLayoutOrder.LABEL_ACCESSORY_ICON,\n\t\t\t]);\n\t\t\tthis._layoutOrderPicker.listProperties.typicalItem = ItemRendererLayoutOrder.LABEL_ACCESSORY_ICON;\n\t\t\tthis._layoutOrderPicker.selectedItem = this.settings.layoutOrder;\n\t\t\tthis._layoutOrderPicker.addEventListener(Event.CHANGE, layoutOrderPicker_changeHandler);\n\n\t\t\tthis._horizontalAlignPicker = new PickerList();\n\t\t\tthis._horizontalAlignPicker.dataProvider = new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\tHorizontalAlign.LEFT,\n\t\t\t\tHorizontalAlign.CENTER,\n\t\t\t\tHorizontalAlign.RIGHT,\n\t\t\t]);\n\t\t\tthis._horizontalAlignPicker.typicalItem = HorizontalAlign.CENTER;\n\t\t\tthis._horizontalAlignPicker.listProperties.typicalItem = HorizontalAlign.CENTER;\n\t\t\tthis._horizontalAlignPicker.selectedItem = this.settings.horizontalAlign;\n\t\t\tthis._horizontalAlignPicker.addEventListener(Event.CHANGE, horizontalAlignPicker_changeHandler);\n\n\t\t\tthis._verticalAlignPicker = new PickerList();\n\t\t\tthis._verticalAlignPicker.dataProvider = new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\tVerticalAlign.TOP,\n\t\t\t\tVerticalAlign.MIDDLE,\n\t\t\t\tVerticalAlign.BOTTOM,\n\t\t\t]);\n\t\t\tthis._verticalAlignPicker.typicalItem = VerticalAlign.MIDDLE;\n\t\t\tthis._verticalAlignPicker.listProperties.typicalItem = VerticalAlign.MIDDLE;\n\t\t\tthis._verticalAlignPicker.selectedItem = this.settings.verticalAlign;\n\t\t\tthis._verticalAlignPicker.addEventListener(Event.CHANGE, verticalAlignPicker_changeHandler);\n\n\t\t\tthis._list = new GroupedList();\n\t\t\tthis._list.styleNameList.add(GroupedList.ALTERNATE_STYLE_NAME_INSET_GROUPED_LIST);\n\t\t\tthis._list.isSelectable = false;\n\t\t\tthis._list.dataProvider = new ArrayHierarchicalCollection(\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\theader: \"Layout\",\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{ label: \"layoutOrder\", accessory: this._layoutOrderPicker },\n\t\t\t\t\t\t{ label: \"horizontalAlign\", accessory: this._horizontalAlignPicker },\n\t\t\t\t\t\t{ label: \"verticalAlign\", accessory: this._verticalAlignPicker },\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\theader: \"Icon\",\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{ label: \"Has Icon\", accessory: this._hasIconToggle },\n\t\t\t\t\t\t{ label: \"Icon Type\", accessory: this._iconTypePicker },\n\t\t\t\t\t\t{ label: \"iconPosition\", accessory: this._iconPositionPicker },\n\t\t\t\t\t\t{ label: \"gap\", accessory: this._gapPicker },\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\theader: \"Accessory\",\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{ label: \"Has Accessory\", accessory: this._hasAccessoryToggle },\n\t\t\t\t\t\t{ label: \"Accessory Type\", accessory: this._accessoryTypePicker },\n\t\t\t\t\t\t{ label: \"accessoryPosition\", accessory: this._accessoryPositionPicker },\n\t\t\t\t\t\t{ label: \"accessoryGap\", accessory: this._accessoryGapPicker },\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t]);\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis._list.clipContent = false;\n\t\t\tthis._list.autoHideBackground = true;\n\t\t\tthis.addChild(this._list);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\tvar doneButton:Button = new Button();\n\t\t\tdoneButton.label = \"Done\";\n\t\t\tdoneButton.addEventListener(Event.TRIGGERED, doneButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tdoneButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function disposeItemAccessory(item:Object):void\n\t\t{\n\t\t\tDisplayObject(item.accessory).dispose();\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function hasIconToggle_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.hasIcon = this._hasIconToggle.isSelected\n\t\t}\n\n\t\tprivate function iconTypePicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.iconType = this._iconTypePicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function iconPositionPicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.iconPosition = this._iconPositionPicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function gapPicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.useInfiniteGap = this._gapPicker.selectedIndex == 0;\n\t\t}\n\n\t\tprivate function hasAccessoryToggle_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.hasAccessory = this._hasAccessoryToggle.isSelected\n\t\t}\n\n\t\tprivate function accessoryTypePicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.accessoryType = this._accessoryTypePicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function accessoryPositionPicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.accessoryPosition = this._accessoryPositionPicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function accessoryGapPicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.useInfiniteAccessoryGap = this._accessoryGapPicker.selectedIndex == 0;\n\t\t}\n\n\t\tprivate function layoutOrderPicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.layoutOrder = this._layoutOrderPicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function horizontalAlignPicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.horizontalAlign = this._horizontalAlignPicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function verticalAlignPicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.verticalAlign = this._verticalAlignPicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function doneButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/LabelScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.Label;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.ScrollPolicy;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class LabelScreen extends PanelScreen\n\t{\n\t\tpublic function LabelScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _normalLabel:Label;\n\t\tprivate var _disabledLabel:Label;\n\t\tprivate var _headingLabel:Label;\n\t\tprivate var _detailLabel:Label;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Label\";\n\t\t\t\n\t\t\tvar verticalLayout:VerticalLayout = new VerticalLayout();\n\t\t\tverticalLayout.horizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\tverticalLayout.verticalAlign = VerticalAlign.TOP;\n\t\t\tverticalLayout.padding = 12;\n\t\t\tverticalLayout.gap = 8;\n\t\t\tthis.layout = verticalLayout;\n\n\t\t\tthis.verticalScrollPolicy = ScrollPolicy.ON;\n\n\t\t\tthis._normalLabel = new Label();\n\t\t\tthis._normalLabel.text = \"This is a normal label.\";\n\t\t\tthis.addChild(this._normalLabel);\n\n\t\t\tthis._disabledLabel = new Label();\n\t\t\tthis._disabledLabel.text = \"A label may be disabled.\";\n\t\t\tthis._disabledLabel.isEnabled = false;\n\t\t\tthis.addChild(this._disabledLabel);\n\n\t\t\tthis._headingLabel = new Label();\n\t\t\tthis._headingLabel.styleNameList.add(Label.ALTERNATE_STYLE_NAME_HEADING);\n\t\t\tthis._headingLabel.text = \"A heading label is for larger, more important text.\";\n\t\t\tthis._headingLabel.wordWrap = true;\n\t\t\tthis.addChild(this._headingLabel);\n\n\t\t\tthis._detailLabel = new Label();\n\t\t\tthis._detailLabel.styleNameList.add(Label.ALTERNATE_STYLE_NAME_DETAIL);\n\t\t\tthis._detailLabel.text = \"While a detail label is for smaller, less important text.\";\n\t\t\tthis._detailLabel.wordWrap = true;\n\t\t\tthis.addChild(this._detailLabel);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/ListScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.List;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.renderers.IListItemRenderer;\n\timport feathers.data.ArrayCollection;\n\timport feathers.events.FeathersEventType;\n\timport feathers.examples.componentsExplorer.data.ListSettings;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\t[Event(name=\"showSettings\",type=\"starling.events.Event\")]\n\n\tpublic class ListScreen extends PanelScreen\n\t{\n\t\tpublic static const SHOW_SETTINGS:String = \"showSettings\";\n\n\t\tpublic function ListScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic var settings:ListSettings;\n\n\t\tprivate var _list:List;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"List\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tvar items:Array = [];\n\t\t\tfor(var i:int = 0; i < 150; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = {text: \"Item \" + (i + 1).toString()};\n\t\t\t\titems[i] = item;\n\t\t\t}\n\t\t\titems.fixed = true;\n\n\t\t\tthis._list = new List();\n\t\t\tthis._list.dataProvider = new ArrayCollection(items);\n\t\t\tthis._list.typicalItem = {text: \"Item 1000\"};\n\t\t\tthis._list.isSelectable = this.settings.isSelectable;\n\t\t\tthis._list.allowMultipleSelection = this.settings.allowMultipleSelection;\n\t\t\tthis._list.hasElasticEdges = this.settings.hasElasticEdges;\n\t\t\t//optimization: since this list fills the entire screen, there's no\n\t\t\t//need for clipping. clipping should not be disabled if there's a\n\t\t\t//chance that item renderers could be visible if they appear outside\n\t\t\t//the list's bounds\n\t\t\tthis._list.clipContent = false;\n\t\t\t//optimization: when the background is covered by all item\n\t\t\t//renderers, don't render it\n\t\t\tthis._list.autoHideBackground = true;\n\t\t\tthis._list.itemRendererFactory = function():IListItemRenderer\n\t\t\t{\n\t\t\t\tvar renderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\n\t\t\t\t//enable the quick hit area to optimize hit tests when an item\n\t\t\t\t//is only selectable and doesn't have interactive children.\n\t\t\t\trenderer.isQuickHitAreaEnabled = true;\n\n\t\t\t\trenderer.labelField = \"text\";\n\t\t\t\treturn renderer;\n\t\t\t};\n\t\t\tthis._list.addEventListener(Event.CHANGE, list_changeHandler);\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis.addChild(this._list);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\n\t\t\tthis.addEventListener(FeathersEventType.TRANSITION_IN_COMPLETE, transitionInCompleteHandler);\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\tvar settingsButton:Button = new Button();\n\t\t\tsettingsButton.label = \"Settings\";\n\t\t\tsettingsButton.addEventListener(Event.TRIGGERED, settingsButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tsettingsButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\t\t\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function transitionInCompleteHandler(event:Event):void\n\t\t{\n\t\t\tthis._list.revealScrollBars();\n\t\t}\n\t\t\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function settingsButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(SHOW_SETTINGS);\n\t\t}\n\n\t\tprivate function list_changeHandler(event:Event):void\n\t\t{\n\t\t\tvar selectedIndices:Vector.<int> = this._list.selectedIndices;\n\t\t\ttrace(\"List change:\", selectedIndices.length > 0 ? selectedIndices : this._list.selectedIndex);\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/ListSettingsScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Header;\n\timport feathers.controls.List;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.ToggleSwitch;\n\timport feathers.data.ArrayCollection;\n\timport feathers.examples.componentsExplorer.data.ListSettings;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\n\timport starling.events.Event;\n\timport feathers.controls.Button;\n\timport starling.display.DisplayObject;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class ListSettingsScreen extends PanelScreen\n\t{\n\t\tpublic function ListSettingsScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic var settings:ListSettings;\n\n\t\tprivate var _list:List;\n\n\t\tprivate var _isSelectableToggle:ToggleSwitch;\n\t\tprivate var _allowMultipleSelectionToggle:ToggleSwitch;\n\t\tprivate var _hasElasticEdgesToggle:ToggleSwitch;\n\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//icon and accessory display objects in the list's data provider\n\t\t\t//won't be automatically disposed because feathers cannot know if\n\t\t\t//they need to be used again elsewhere or not. we need to dispose\n\t\t\t//them manually.\n\t\t\tthis._list.dataProvider.dispose(disposeItemAccessory);\n\n\t\t\t//never forget to call super.dispose() because you don't want to\n\t\t\t//create a memory leak!\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"List Settings\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._isSelectableToggle = new ToggleSwitch();\n\t\t\tthis._isSelectableToggle.isSelected = this.settings.isSelectable;\n\t\t\tthis._isSelectableToggle.addEventListener(Event.CHANGE, isSelectableToggle_changeHandler);\n\n\t\t\tthis._allowMultipleSelectionToggle = new ToggleSwitch();\n\t\t\tthis._allowMultipleSelectionToggle.isSelected = this.settings.allowMultipleSelection;\n\t\t\tthis._allowMultipleSelectionToggle.addEventListener(Event.CHANGE, allowMultipleSelectionToggle_changeHandler);\n\n\t\t\tthis._hasElasticEdgesToggle = new ToggleSwitch();\n\t\t\tthis._hasElasticEdgesToggle.isSelected = this.settings.hasElasticEdges;\n\t\t\tthis._hasElasticEdgesToggle.addEventListener(Event.CHANGE, hasElasticEdgesToggle_changeHandler);\n\n\t\t\tthis._list = new List();\n\t\t\tthis._list.isSelectable = false;\n\t\t\tthis._list.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ label: \"isSelectable\", accessory: this._isSelectableToggle },\n\t\t\t\t{ label: \"allowMultipleSelection\", accessory: this._allowMultipleSelectionToggle },\n\t\t\t\t{ label: \"hasElasticEdges\", accessory: this._hasElasticEdgesToggle },\n\t\t\t]);\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis._list.clipContent = false;\n\t\t\tthis._list.autoHideBackground = true;\n\t\t\tthis.addChild(this._list);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\tvar doneButton:Button = new Button();\n\t\t\tdoneButton.label = \"Done\";\n\t\t\tdoneButton.addEventListener(Event.TRIGGERED, doneButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tdoneButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function disposeItemAccessory(item:Object):void\n\t\t{\n\t\t\tDisplayObject(item.accessory).dispose();\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function doneButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function isSelectableToggle_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.isSelectable = this._isSelectableToggle.isSelected;\n\t\t}\n\n\t\tprivate function allowMultipleSelectionToggle_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.allowMultipleSelection = this._allowMultipleSelectionToggle.isSelected;\n\t\t}\n\n\t\tprivate function hasElasticEdgesToggle_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.hasElasticEdges = this._hasElasticEdgesToggle.isSelected;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/MainMenuScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.List;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.renderers.IListItemRenderer;\n\timport feathers.data.ArrayCollection;\n\timport feathers.events.FeathersEventType;\n\timport feathers.examples.componentsExplorer.ScreenID;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.system.DeviceCapabilities;\n\n\timport flash.system.Capabilities;\n\n\timport starling.core.Starling;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\tpublic class MainMenuScreen extends PanelScreen\n\t{\n\t\tpublic function MainMenuScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _list:List;\n\n\t\tpublic var savedVerticalScrollPosition:Number = 0;\n\t\tpublic var savedSelectedIndex:int = -1;\n\n\t\tprivate var _selectedScreenID:String = null;\n\n\t\tpublic function get selectedScreenID():String\n\t\t{\n\t\t\treturn this._selectedScreenID;\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Feathers\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._list = new List();\n\t\t\tthis._list.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ label: \"Alert\", screen: ScreenID.ALERT },\n\t\t\t\t{ label: \"Auto-complete\", screen: ScreenID.AUTO_COMPLETE },\n\t\t\t\t{ label: \"Button\", screen: ScreenID.BUTTON },\n\t\t\t\t{ label: \"Button Group\", screen: ScreenID.BUTTON_GROUP },\n\t\t\t\t{ label: \"Callout\", screen: ScreenID.CALLOUT },\n\t\t\t\t{ label: \"Check\", screen: ScreenID.CHECK },\n\t\t\t\t{ label: \"Data Grid\", screen: ScreenID.DATA_GRID },\n\t\t\t\t{ label: \"Date Time Spinner\", screen: ScreenID.DATE_TIME_SPINNER },\n\t\t\t\t{ label: \"Grouped List\", screen: ScreenID.GROUPED_LIST },\n\t\t\t\t{ label: \"Item Renderer\", screen: ScreenID.ITEM_RENDERER },\n\t\t\t\t{ label: \"Label\", screen: ScreenID.LABEL },\n\t\t\t\t{ label: \"List\", screen: ScreenID.LIST },\n\t\t\t\t{ label: \"Numeric Stepper\", screen: ScreenID.NUMERIC_STEPPER },\n\t\t\t\t{ label: \"Page Indicator\", screen: ScreenID.PAGE_INDICATOR },\n\t\t\t\t{ label: \"Panel\", screen: ScreenID.PANEL },\n\t\t\t\t{ label: \"Picker List\", screen: ScreenID.PICKER_LIST },\n\t\t\t\t{ label: \"Progress Bar\", screen: ScreenID.PROGRESS_BAR },\n\t\t\t\t{ label: \"Radio\", screen: ScreenID.RADIO },\n\t\t\t\t{ label: \"Scroll Text\", screen: ScreenID.SCROLL_TEXT },\n\t\t\t\t{ label: \"Slider\", screen: ScreenID.SLIDER},\n\t\t\t\t{ label: \"Spinner List\", screen: ScreenID.SPINNER_LIST },\n\t\t\t\t{ label: \"Tab Bar\", screen: ScreenID.TAB_BAR },\n\t\t\t\t{ label: \"Text Callout\", screen: ScreenID.TEXT_CALLOUT },\n\t\t\t\t{ label: \"Text Input and Text Area\", screen: ScreenID.TEXT_INPUT },\n\t\t\t\t{ label: \"Toast\", screen: ScreenID.TOAST },\n\t\t\t\t{ label: \"Toggle Switch\", screen: ScreenID.TOGGLES },\n\t\t\t\t{ label: \"Tree\", screen: ScreenID.TREE },\n\t\t\t]);\n\t\t\tif(Capabilities.playerType == \"Desktop\") //this means AIR, even for mobile\n\t\t\t{\n\t\t\t\tthis._list.dataProvider.addItem( { label: \"Web View\", screen: ScreenID.WEB_VIEW } );\n\t\t\t}\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis._list.clipContent = false;\n\t\t\tthis._list.autoHideBackground = true;\n\t\t\tthis._list.verticalScrollPosition = this.savedVerticalScrollPosition;\n\n\t\t\tthis._list.itemRendererFactory = this.createItemRenderer;\n\n\t\t\tvar isTablet:Boolean = DeviceCapabilities.isTablet(Starling.current.nativeStage);\n\t\t\tif(isTablet)\n\t\t\t{\n\t\t\t\tthis._list.addEventListener(Event.CHANGE, list_changeHandler);\n\t\t\t\tthis._list.selectedIndex = 0;\n\t\t\t\tthis._list.revealScrollBars();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._list.selectedIndex = this.savedSelectedIndex;\n\t\t\t\tthis.addEventListener(FeathersEventType.TRANSITION_IN_COMPLETE, transitionInCompleteHandler);\n\t\t\t}\n\t\t\tthis.addChild(this._list);\n\t\t}\n\t\t\n\t\tprivate function createItemRenderer():IListItemRenderer\n\t\t{\n\t\t\tvar isTablet:Boolean = DeviceCapabilities.isTablet(Starling.current.nativeStage);\n\t\t\t\n\t\t\tvar renderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\t\t\tif(!isTablet)\n\t\t\t{\n\t\t\t\trenderer.styleNameList.add(DefaultListItemRenderer.ALTERNATE_STYLE_NAME_DRILL_DOWN);\n\t\t\t}\n\n\t\t\t//enable the quick hit area to optimize hit tests when an item\n\t\t\t//is only selectable and doesn't have interactive children.\n\t\t\trenderer.isQuickHitAreaEnabled = true;\n\n\t\t\trenderer.labelField = \"label\";\n\t\t\treturn renderer;\n\t\t}\n\t\t\n\t\tprivate function transitionInCompleteHandler(event:Event):void\n\t\t{\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis._list.selectedIndex = -1;\n\t\t\t\tthis._list.addEventListener(Event.CHANGE, list_changeHandler);\n\t\t\t}\n\t\t\tthis._list.revealScrollBars();\n\t\t}\n\t\t\n\t\tprivate function list_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis._selectedScreenID = this._list.selectedItem.screen as String;\n\t\t\tif(DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//save the list's scroll position and selected index so that we\n\t\t\t//can restore some context when this screen when we return to it\n\t\t\t//again later.\n\t\t\tthis.dispatchEventWith(Event.CHANGE, false,\n\t\t\t{\n\t\t\t\tsavedVerticalScrollPosition: this._list.verticalScrollPosition,\n\t\t\t\tsavedSelectedIndex: this._list.selectedIndex\n\t\t\t});\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/NumericStepperScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.NumericStepper;\n\timport feathers.controls.PanelScreen;\n\timport feathers.examples.componentsExplorer.data.NumericStepperSettings;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\t[Event(name=\"showSettings\",type=\"starling.events.Event\")]\n\n\tpublic class NumericStepperScreen extends PanelScreen\n\t{\n\t\tpublic static const SHOW_SETTINGS:String = \"showSettings\";\n\n\t\tpublic function NumericStepperScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic var settings:NumericStepperSettings;\n\n\t\tprivate var _stepper:NumericStepper;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Numeric Stepper\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._stepper = new NumericStepper();\n\t\t\tthis._stepper.minimum = 0;\n\t\t\tthis._stepper.maximum = 100;\n\t\t\tthis._stepper.value = 50;\n\t\t\tthis._stepper.step = this.settings.step;\n\t\t\tthis._stepper.addEventListener(Event.CHANGE, slider_changeHandler);\n\t\t\tvar stepperLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tstepperLayoutData.horizontalCenter = 0;\n\t\t\tstepperLayoutData.verticalCenter = 0;\n\t\t\tthis._stepper.layoutData = stepperLayoutData;\n\t\t\tthis.addChild(this._stepper);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\tvar settingsButton:Button = new Button();\n\t\t\tsettingsButton.label = \"Settings\";\n\t\t\tsettingsButton.addEventListener(Event.TRIGGERED, settingsButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tsettingsButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function slider_changeHandler(event:Event):void\n\t\t{\n\t\t\ttrace(\"numeric stepper change:\", this._stepper.value);\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function settingsButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(SHOW_SETTINGS);\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/NumericStepperSettingsScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Header;\n\timport feathers.controls.List;\n\timport feathers.controls.NumericStepper;\n\timport feathers.controls.PanelScreen;\n\timport feathers.data.ArrayCollection;\n\timport feathers.examples.componentsExplorer.data.NumericStepperSettings;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\n\timport starling.events.Event;\n\timport feathers.controls.Button;\n\timport starling.display.DisplayObject;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class NumericStepperSettingsScreen extends PanelScreen\n\t{\n\t\tpublic function NumericStepperSettingsScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic var settings:NumericStepperSettings;\n\n\t\tprivate var _list:List;\n\t\tprivate var _stepStepper:NumericStepper;\n\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//icon and accessory display objects in the list's data provider\n\t\t\t//won't be automatically disposed because feathers cannot know if\n\t\t\t//they need to be used again elsewhere or not. we need to dispose\n\t\t\t//them manually.\n\t\t\tthis._list.dataProvider.dispose(disposeItemAccessory);\n\n\t\t\t//never forget to call super.dispose() because you don't want to\n\t\t\t//create a memory leak!\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Numeric Stepper Settings\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._stepStepper = new NumericStepper();\n\t\t\tthis._stepStepper.minimum = 1;\n\t\t\tthis._stepStepper.maximum = 20;\n\t\t\tthis._stepStepper.step = 1;\n\t\t\tthis._stepStepper.value = this.settings.step;\n\t\t\tthis._stepStepper.addEventListener(Event.CHANGE, stepStepper_changeHandler);\n\n\t\t\tthis._list = new List();\n\t\t\tthis._list.isSelectable = false;\n\t\t\tthis._list.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ label: \"step\", accessory: this._stepStepper },\n\t\t\t]);\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis._list.clipContent = false;\n\t\t\tthis._list.autoHideBackground = true;\n\t\t\tthis.addChild(this._list);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\tvar doneButton:Button = new Button();\n\t\t\tdoneButton.label = \"Done\";\n\t\t\tdoneButton.addEventListener(Event.TRIGGERED, doneButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tdoneButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function disposeItemAccessory(item:Object):void\n\t\t{\n\t\t\tDisplayObject(item.accessory).dispose();\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function stepStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.step = this._stepStepper.value;\n\t\t}\n\n\t\tprivate function doneButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/PageIndicatorScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.PageIndicator;\n\timport feathers.controls.PanelScreen;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class PageIndicatorScreen extends PanelScreen\n\t{\n\t\tpublic function PageIndicatorScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _pageIndicator:PageIndicator;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Page Indicator\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._pageIndicator = new PageIndicator();\n\t\t\tthis._pageIndicator.pageCount = 5;\n\t\t\tthis._pageIndicator.addEventListener(Event.CHANGE, pageIndicator_changeHandler);\n\t\t\tvar pageIndicatorLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tpageIndicatorLayoutData.left = 0;\n\t\t\tpageIndicatorLayoutData.right = 0;\n\t\t\tpageIndicatorLayoutData.verticalCenter = 0;\n\t\t\tthis._pageIndicator.layoutData = pageIndicatorLayoutData;\n\t\t\tthis.addChild(this._pageIndicator);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function pageIndicator_changeHandler(event:Event):void\n\t\t{\n\t\t\ttrace(\"page indicator change:\", this._pageIndicator.selectedIndex);\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/PanelComponentScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.Label;\n\timport feathers.controls.Panel;\n\timport feathers.controls.PanelScreen;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class PanelComponentScreen extends PanelScreen\n\t{\n\t\tpublic function PanelComponentScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _panel:Panel;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Panel\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._panel = new Panel();\n\t\t\tthis._panel.title = \"Title\";\n\t\t\tthis._panel.width = 200;\n\t\t\tthis._panel.height = 150;\n\n\t\t\t//how the component is positioned in its parent's layout\n\t\t\tvar panelLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tpanelLayoutData.horizontalCenter = 0;\n\t\t\tpanelLayoutData.verticalCenter = 0;\n\t\t\tthis._panel.layoutData = panelLayoutData;\n\n\t\t\t//the panel's own internal layout\n\t\t\tvar panelLayout:VerticalLayout = new VerticalLayout();\n\t\t\tpanelLayout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tpanelLayout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\tthis._panel.layout = panelLayout;\n\n\t\t\tthis.addChild(this._panel);\n\n\t\t\tvar content:Label = new Label();\n\t\t\tcontent.text = \"This is the Panel's content.\";\n\t\t\tcontent.wordWrap = true;\n\t\t\tthis._panel.addChild(content);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/PickerListScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.List;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.PickerList;\n\timport feathers.controls.SpinnerList;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.renderers.IListItemRenderer;\n\timport feathers.data.ArrayCollection;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class PickerListScreen extends PanelScreen\n\t{\n\t\tpublic function PickerListScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _list:PickerList;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Picker List\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tvar items:Array = [];\n\t\t\tfor(var i:int = 0; i < 150; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = {text: \"Item \" + (i + 1).toString()};\n\t\t\t\titems[i] = item;\n\t\t\t}\n\t\t\titems.fixed = true;\n\n\t\t\tthis._list = new PickerList();\n\t\t\tthis._list.prompt = \"Select an Item\";\n\t\t\tthis._list.dataProvider = new ArrayCollection(items);\n\t\t\t//normally, the first item is selected, but let's show the prompt\n\t\t\tthis._list.selectedIndex = -1;\n\t\t\tvar listLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tlistLayoutData.horizontalCenter = 0;\n\t\t\tlistLayoutData.verticalCenter = 0;\n\t\t\tthis._list.layoutData = listLayoutData;\n\t\t\tthis._list.addEventListener(Event.CHANGE, pickerList_changeHandler);\n\t\t\tthis.addChildAt(this._list, 0);\n\n\t\t\t//the typical item helps us set an ideal width for the button\n\t\t\t//if we don't use a typical item, the button will resize to fit\n\t\t\t//the currently selected item.\n\t\t\tthis._list.typicalItem = { text: \"Select an Item\" };\n\t\t\tthis._list.labelField = \"text\";\n\n\t\t\tthis._list.listFactory = function():List\n\t\t\t{\n\t\t\t\tvar list:List;\n\t\t\t\tif(DeviceCapabilities.isPhone(Starling.current.nativeStage))\n\t\t\t\t{\n\t\t\t\t\tlist = new SpinnerList();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tlist = new List();\n\t\t\t\t}\n\t\t\t\t//notice that we're setting typicalItem on the list separately. we\n\t\t\t\t//may want to have the list measure at a different width, so it\n\t\t\t\t//might need a different typical item than the picker list's button.\n\t\t\t\tlist.typicalItem = { text: \"Item 1000\" };\n\t\t\t\tlist.itemRendererFactory = function():IListItemRenderer\n\t\t\t\t{\n\t\t\t\t\tvar renderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\t\t\t\t\t//notice that we're setting labelField on the item renderers\n\t\t\t\t\t//separately. the default item renderer has a labelField property,\n\t\t\t\t\t//but a custom item renderer may not even have a label, so\n\t\t\t\t\t//PickerList cannot simply pass its labelField down to item\n\t\t\t\t\t//renderers automatically\n\t\t\t\t\trenderer.labelField = \"text\";\n\t\t\t\t\treturn renderer;\n\t\t\t\t};\n\t\t\t\treturn list;\n\t\t\t};\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\treturn header;\n\t\t}\n\t\t\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\t\t\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\t\t\n\t\tprivate function pickerList_changeHandler(event:Event):void\n\t\t{\n\t\t\ttrace(\"PickerList change:\", this._list.selectedIndex);\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/ProgressBarScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.ProgressBar;\n\timport feathers.layout.Direction;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.HorizontalLayout;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.animation.Tween;\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class ProgressBarScreen extends PanelScreen\n\t{\n\t\tpublic function ProgressBarScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _horizontalProgress:ProgressBar;\n\t\tprivate var _verticalProgress:ProgressBar;\n\n\t\tprivate var _horizontalProgressTween:Tween;\n\t\tprivate var _verticalProgressTween:Tween;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Progress Bar\";\n\t\t\t\n\t\t\tvar layout:HorizontalLayout = new HorizontalLayout();\n\t\t\tlayout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tlayout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\tlayout.padding = 12;\n\t\t\tlayout.gap = 12;\n\t\t\tthis.layout = layout;\n\n\t\t\tthis._horizontalProgress = new ProgressBar();\n\t\t\tthis._horizontalProgress.direction = Direction.HORIZONTAL;\n\t\t\tthis._horizontalProgress.minimum = 0;\n\t\t\tthis._horizontalProgress.maximum = 1;\n\t\t\tthis._horizontalProgress.value = 0;\n\t\t\tthis.addChild(this._horizontalProgress);\n\n\t\t\tthis._verticalProgress = new ProgressBar();\n\t\t\tthis._verticalProgress.direction = Direction.VERTICAL;\n\t\t\tthis._verticalProgress.minimum = 0;\n\t\t\tthis._verticalProgress.maximum = 100;\n\t\t\tthis._verticalProgress.value = 0;\n\t\t\tthis.addChild(this._verticalProgress);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\n\t\t\tthis._horizontalProgressTween = new Tween(this._horizontalProgress, 5);\n\t\t\tthis._horizontalProgressTween.animate(\"value\", 1);\n\t\t\tthis._horizontalProgressTween.repeatCount = int.MAX_VALUE;\n\t\t\tStarling.juggler.add(this._horizontalProgressTween);\n\n\t\t\tthis._verticalProgressTween = new Tween(this._verticalProgress, 8);\n\t\t\tthis._verticalProgressTween.animate(\"value\", 100);\n\t\t\tthis._verticalProgressTween.repeatCount = int.MAX_VALUE;\n\t\t\tStarling.juggler.add(this._verticalProgressTween);\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tif(this._horizontalProgressTween)\n\t\t\t{\n\t\t\t\tStarling.juggler.remove(this._horizontalProgressTween);\n\t\t\t\tthis._horizontalProgressTween = null;\n\t\t\t}\n\t\t\tif(this._verticalProgressTween)\n\t\t\t{\n\t\t\t\tStarling.juggler.remove(this._verticalProgressTween);\n\t\t\t\tthis._verticalProgressTween = null;\n\t\t\t}\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/RadioScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.Label;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.Radio;\n\timport feathers.controls.ScrollPolicy;\n\timport feathers.core.ToggleGroup;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class RadioScreen extends PanelScreen\n\t{\n\t\tpublic function RadioScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _group1:ToggleGroup;\n\t\tprivate var _title1:Label;\n\t\tprivate var _radio1:Radio;\n\t\tprivate var _radio2:Radio;\n\t\tprivate var _radio3:Radio;\n\t\tprivate var _radio4:Radio;\n\t\t\n\t\tprivate var _group2:ToggleGroup;\n\t\tprivate var _title2:Label;\n\t\tprivate var _radioA:Radio;\n\t\tprivate var _radioB:Radio;\n\t\tprivate var _radioC:Radio;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Radio\";\n\n\t\t\tvar verticalLayout:VerticalLayout = new VerticalLayout();\n\t\t\tverticalLayout.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tverticalLayout.verticalAlign = VerticalAlign.TOP;\n\t\t\tverticalLayout.padding = 12;\n\t\t\tverticalLayout.gap = 8;\n\t\t\tthis.layout = verticalLayout;\n\n\t\t\tthis.verticalScrollPolicy = ScrollPolicy.ON;\n\n\t\t\tthis._group1 = new ToggleGroup();\n\n\t\t\tthis._title1 = new Label();\n\t\t\tthis._title1.styleNameList.add(Label.ALTERNATE_STYLE_NAME_HEADING);\n\t\t\tthis._title1.text = \"Group 1\";\n\t\t\tthis.addChild(this._title1);\n\n\t\t\tthis._radio1 = new Radio();\n\t\t\tthis._radio1.label = \"Option 1\";\n\t\t\tthis._radio1.toggleGroup = this._group1;\n\t\t\tthis.addChild(this._radio1);\n\n\t\t\tthis._radio2 = new Radio();\n\t\t\tthis._radio2.label = \"Option 2\";\n\t\t\tthis._radio2.isSelected = true;\n\t\t\tthis._radio2.toggleGroup = this._group1;\n\t\t\tthis.addChild(this._radio2);\n\n\t\t\tthis._radio3 = new Radio();\n\t\t\tthis._radio3.label = \"Option 3\";\n\t\t\tthis._radio3.toggleGroup = this._group1;\n\t\t\tthis.addChild(this._radio3);\n\n\t\t\tthis._radio4 = new Radio();\n\t\t\tthis._radio4.label = \"Option 4 (Disabled)\";\n\t\t\tthis._radio4.isEnabled = false;\n\t\t\tthis._radio4.toggleGroup = this._group1;\n\t\t\tthis.addChild(this._radio4);\n\n\t\t\tthis._group1.addEventListener(Event.CHANGE, group1_changeHandler);\n\n\t\t\t//radios may be added to different groups\n\t\t\tthis._group2 = new ToggleGroup();\n\n\t\t\tthis._title2 = new Label();\n\t\t\tthis._title2.styleNameList.add(Label.ALTERNATE_STYLE_NAME_HEADING);\n\t\t\tthis._title2.text = \"Group 2\";\n\t\t\tthis.addChild(this._title2);\n\n\t\t\tthis._radioA = new Radio();\n\t\t\tthis._radioA.label = \"Option A\";\n\t\t\tthis.addChild(this._radioA);\n\n\t\t\tthis._radioB = new Radio();\n\t\t\tthis._radioB.label = \"Option B\";\n\t\t\tthis.addChild(this._radioB);\n\n\t\t\tthis._radioC = new Radio();\n\t\t\tthis._radioC.label = \"Option C\";\n\t\t\tthis.addChild(this._radioC);\n\n\t\t\tthis._group2.selectedItem = this._radioA;\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function group1_changeHandler(event:Event):void\n\t\t{\n\t\t\ttrace(\"radio group changed:\", this._group1.selectedIndex);\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/ScrollTextScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.ScrollText;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class ScrollTextScreen extends PanelScreen\n\t{\n\t\tpublic function ScrollTextScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _scrollText:ScrollText;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Scroll Text\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._scrollText = new ScrollText();\n\t\t\tthis._scrollText.text = \"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\\n\\nSed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.\\n\\nNeque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?\\n\\nAt vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.\\n\\nDonec ultricies nibh non metus volutpat, ac gravida tellus accumsan. Sed in urna quis ante ultrices tristique non non felis. Etiam accumsan molestie felis id auctor. Aliquam suscipit finibus mollis. Etiam euismod odio massa, eu tempus neque consequat ullamcorper. Donec non dignissim metus, ut dictum erat. Sed vestibulum ut sapien vitae laoreet. Integer sollicitudin tellus vitae scelerisque aliquam. Praesent gravida, leo imperdiet vestibulum congue, felis arcu eleifend sem, nec cursus enim massa sit amet risus. Sed cursus pulvinar bibendum.\\n\\nVivamus nec posuere nunc. Quisque consequat nisi sem, a mattis nisi sagittis ac. Donec efficitur, dui in tincidunt mollis, sapien eros pharetra nibh, quis malesuada mauris velit quis mauris. Nunc eget fermentum tellus. Integer a mi neque. Suspendisse ut cursus mi. Nam tempus interdum felis vel rutrum. Sed quis pharetra mauris, id faucibus quam. Nunc vehicula ullamcorper nisl, non interdum massa scelerisque nec. Proin suscipit rhoncus enim sed tristique.\\n\\nProin id erat nunc. Sed rutrum tortor in tempor vehicula. Integer et imperdiet odio, sed viverra diam. Pellentesque et commodo lectus, vitae tempus tortor. Quisque purus justo, pharetra ac est molestie, finibus aliquam dui. Vestibulum sodales hendrerit nibh, quis venenatis lorem dictum in. Sed volutpat bibendum eros id vulputate. Curabitur lobortis, tellus a aliquet aliquet, nunc risus aliquet arcu, at ullamcorper ligula tortor vel nulla. Duis sit amet odio pharetra, sodales magna ac, eleifend magna. Curabitur fringilla nec urna vel ultricies.\\n\\nNunc vel consequat dolor. Quisque nec pretium arcu, faucibus efficitur tortor. Etiam sapien dui, vulputate et libero sollicitudin, consectetur iaculis quam. Nulla eget odio vehicula, vehicula libero sed, tristique lectus. Aliquam in mollis ante, ac molestie risus. Nam faucibus urna at dui varius, sed elementum diam convallis. Nullam ut suscipit diam.\\n\\nCras tempus faucibus dolor id accumsan. Integer lobortis rutrum vulputate. Nullam porttitor nisi dapibus, tincidunt ante eu, gravida mi. Cras efficitur, magna vitae pulvinar dictum, mauris libero laoreet est, quis volutpat nibh libero a felis. Nunc fringilla dignissim mauris, et aliquam elit molestie ac. Nunc sit amet dignissim nunc. Cras accumsan mauris augue, eget laoreet erat tincidunt in. Phasellus rutrum turpis eget ligula tristique consequat. Maecenas volutpat consectetur purus a ultricies. Sed auctor pulvinar sem, eget fringilla purus consequat sit amet. In hac habitasse platea dictumst. Fusce lobortis vehicula aliquam. Phasellus ornare, est at condimentum consequat, elit ipsum hendrerit est, in rhoncus mauris dui nec quam.\";\n\t\t\tthis._scrollText.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis.addChild(this._scrollText);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/SliderScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.Slider;\n\timport feathers.examples.componentsExplorer.data.SliderSettings;\n\timport feathers.layout.Direction;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.HorizontalLayout;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\t[Event(name=\"showSettings\",type=\"starling.events.Event\")]\n\n\tpublic class SliderScreen extends PanelScreen\n\t{\n\t\tpublic static const SHOW_SETTINGS:String = \"showSettings\";\n\n\t\tpublic function SliderScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic var settings:SliderSettings;\n\n\t\tprivate var _horizontalSlider:Slider;\n\t\tprivate var _verticalSlider:Slider;\n\t\t\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Slider\";\n\t\t\t\n\t\t\tvar layout:HorizontalLayout = new HorizontalLayout();\n\t\t\tlayout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tlayout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\tlayout.padding = 12;\n\t\t\tlayout.gap = 12;\n\t\t\tthis.layout = layout;\n\n\t\t\tthis._horizontalSlider = new Slider();\n\t\t\tthis._horizontalSlider.direction = Direction.HORIZONTAL;\n\t\t\tthis._horizontalSlider.minimum = 0;\n\t\t\tthis._horizontalSlider.maximum = 100;\n\t\t\tthis._horizontalSlider.value = 50;\n\t\t\tthis._horizontalSlider.step = this.settings.step;\n\t\t\tthis._horizontalSlider.page = this.settings.page;\n\t\t\tthis._horizontalSlider.liveDragging = this.settings.liveDragging;\n\t\t\tthis._horizontalSlider.trackInteractionMode = this.settings.trackInteractionMode;\n\t\t\tthis._horizontalSlider.addEventListener(Event.CHANGE, horizontalSlider_changeHandler);\n\t\t\tthis.addChild(this._horizontalSlider);\n\n\t\t\tthis._verticalSlider = new Slider();\n\t\t\tthis._verticalSlider.direction = Direction.VERTICAL;\n\t\t\tthis._verticalSlider.minimum = 0;\n\t\t\tthis._verticalSlider.maximum = 100;\n\t\t\tthis._verticalSlider.value = 50;\n\t\t\tthis._verticalSlider.step = this.settings.step;\n\t\t\tthis._verticalSlider.page = this.settings.page;\n\t\t\tthis._verticalSlider.liveDragging = this.settings.liveDragging;\n\t\t\tthis._verticalSlider.trackInteractionMode = this.settings.trackInteractionMode;\n\t\t\tthis.addChild(this._verticalSlider);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\n\t\t\tvar settingsButton:Button = new Button();\n\t\t\tsettingsButton.label = \"Settings\";\n\t\t\tsettingsButton.addEventListener(Event.TRIGGERED, settingsButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tsettingsButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\t\t\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\t\t\n\t\tprivate function horizontalSlider_changeHandler(event:Event):void\n\t\t{\n\t\t\ttrace(\"horizontal slider change:\", this._horizontalSlider.value.toString());\n\t\t}\n\t\t\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function settingsButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(SHOW_SETTINGS);\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/SliderSettingsScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.List;\n\timport feathers.controls.NumericStepper;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.PickerList;\n\timport feathers.controls.ToggleSwitch;\n\timport feathers.controls.TrackInteractionMode;\n\timport feathers.data.ArrayCollection;\n\timport feathers.examples.componentsExplorer.data.SliderSettings;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class SliderSettingsScreen extends PanelScreen\n\t{\n\t\tpublic function SliderSettingsScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic var settings:SliderSettings;\n\n\t\tprivate var _list:List;\n\t\tprivate var _liveDraggingToggle:ToggleSwitch;\n\t\tprivate var _stepStepper:NumericStepper;\n\t\tprivate var _pageStepper:NumericStepper;\n\t\tprivate var _trackInteractionModePicker:PickerList;\n\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//icon and accessory display objects in the list's data provider\n\t\t\t//won't be automatically disposed because feathers cannot know if\n\t\t\t//they need to be used again elsewhere or not. we need to dispose\n\t\t\t//them manually.\n\t\t\tthis._list.dataProvider.dispose(disposeItemAccessory);\n\n\t\t\t//never forget to call super.dispose() because you don't want to\n\t\t\t//create a memory leak!\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Slider Settings\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._liveDraggingToggle = new ToggleSwitch();\n\t\t\tthis._liveDraggingToggle.isSelected = this.settings.liveDragging;\n\t\t\tthis._liveDraggingToggle.addEventListener(Event.CHANGE, liveDraggingToggle_changeHandler);\n\n\t\t\tthis._stepStepper = new NumericStepper();\n\t\t\tthis._stepStepper.minimum = 1;\n\t\t\tthis._stepStepper.maximum = 20;\n\t\t\tthis._stepStepper.step = 1;\n\t\t\tthis._stepStepper.value = this.settings.step;\n\t\t\tthis._stepStepper.addEventListener(Event.CHANGE, stepStepper_changeHandler);\n\n\t\t\tthis._trackInteractionModePicker = new PickerList();\n\t\t\tthis._trackInteractionModePicker.typicalItem = TrackInteractionMode.TO_VALUE;\n\t\t\tthis._trackInteractionModePicker.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\tTrackInteractionMode.TO_VALUE,\n\t\t\t\tTrackInteractionMode.BY_PAGE,\n\t\t\t]);\n\t\t\tthis._trackInteractionModePicker.selectedItem = this.settings.trackInteractionMode;\n\t\t\tthis._trackInteractionModePicker.addEventListener(Event.CHANGE, trackInteractionModePicker_changeHandler);\n\n\t\t\tthis._pageStepper = new NumericStepper();\n\t\t\tthis._pageStepper.minimum = 1;\n\t\t\tthis._pageStepper.maximum = 20;\n\t\t\tthis._pageStepper.step = 1;\n\t\t\tthis._pageStepper.value = this.settings.page;\n\t\t\tthis._pageStepper.addEventListener(Event.CHANGE, pageStepper_changeHandler);\n\n\t\t\tthis._list = new List();\n\t\t\tthis._list.isSelectable = false;\n\t\t\tthis._list.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ label: \"liveDragging\", accessory: this._liveDraggingToggle },\n\t\t\t\t{ label: \"step\", accessory: this._stepStepper },\n\t\t\t\t{ label: \"trackInteractionMode\", accessory: this._trackInteractionModePicker },\n\t\t\t\t{ label: \"page\", accessory: this._pageStepper },\n\t\t\t]);\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis._list.clipContent = false;\n\t\t\tthis._list.autoHideBackground = true;\n\t\t\tthis.addChild(this._list);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\tvar doneButton:Button = new Button();\n\t\t\tdoneButton.label = \"Done\";\n\t\t\tdoneButton.addEventListener(Event.TRIGGERED, doneButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tdoneButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function disposeItemAccessory(item:Object):void\n\t\t{\n\t\t\tDisplayObject(item.accessory).dispose();\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function liveDraggingToggle_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.liveDragging = this._liveDraggingToggle.isSelected;\n\t\t}\n\n\t\tprivate function stepStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.step = this._stepStepper.value;\n\t\t}\n\n\t\tprivate function pageStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.page = this._pageStepper.value;\n\t\t}\n\n\t\tprivate function trackInteractionModePicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.trackInteractionMode = this._trackInteractionModePicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function doneButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/SpinnerListScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.SpinnerList;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.renderers.IListItemRenderer;\n\timport feathers.data.ArrayCollection;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class SpinnerListScreen extends PanelScreen\n\t{\n\t\tpublic function SpinnerListScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _list:SpinnerList;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Spinner List\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._list = new SpinnerList();\n\t\t\tthis._list.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ text: \"Aardvark\" },\n\t\t\t\t{ text: \"Alligator\" },\n\t\t\t\t{ text: \"Alpaca\" },\n\t\t\t\t{ text: \"Anteater\" },\n\t\t\t\t{ text: \"Baboon\" },\n\t\t\t\t{ text: \"Bear\" },\n\t\t\t\t{ text: \"Beaver\" },\n\t\t\t\t{ text: \"Canary\" },\n\t\t\t\t{ text: \"Cat\" },\n\t\t\t\t{ text: \"Deer\" },\n\t\t\t\t{ text: \"Dingo\" },\n\t\t\t\t{ text: \"Dog\" },\n\t\t\t\t{ text: \"Dolphin\" },\n\t\t\t\t{ text: \"Donkey\" },\n\t\t\t\t{ text: \"Dragonfly\" },\n\t\t\t\t{ text: \"Duck\" },\n\t\t\t\t{ text: \"Dung Beetle\" },\n\t\t\t\t{ text: \"Eagle\" },\n\t\t\t\t{ text: \"Earthworm\" },\n\t\t\t\t{ text: \"Eel\" },\n\t\t\t\t{ text: \"Elk\" },\n\t\t\t\t{ text: \"Fox\" },\n\t\t\t]);\n\t\t\tthis._list.typicalItem = {text: \"Item 1000\"};\n\t\t\tthis._list.itemRendererFactory = function():IListItemRenderer\n\t\t\t{\n\t\t\t\tvar renderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\n\t\t\t\t//enable the quick hit area to optimize hit tests when an item\n\t\t\t\t//is only selectable and doesn't have interactive children.\n\t\t\t\trenderer.isQuickHitAreaEnabled = true;\n\n\t\t\t\trenderer.labelField = \"text\";\n\t\t\t\treturn renderer;\n\t\t\t};\n\t\t\tthis._list.addEventListener(Event.CHANGE, list_changeHandler);\n\n\t\t\tvar listLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tlistLayoutData.left = 0;\n\t\t\tlistLayoutData.right = 0;\n\t\t\tlistLayoutData.verticalCenter = 0;\n\t\t\tthis._list.layoutData = listLayoutData;\n\n\t\t\tthis.addChild(this._list);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\n\t\t\tthis.addEventListener(FeathersEventType.TRANSITION_IN_COMPLETE, transitionInCompleteHandler);\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function transitionInCompleteHandler(event:Event):void\n\t\t{\n\t\t\tthis._list.revealScrollBars();\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function list_changeHandler(event:Event):void\n\t\t{\n\t\t\ttrace(\"SpinnerList change:\", this._list.selectedIndex);\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/TabBarScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.Label;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.TabBar;\n\timport feathers.data.ArrayCollection;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class TabBarScreen extends PanelScreen\n\t{\n\t\tpublic function TabBarScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _tabBar:TabBar;\n\t\tprivate var _label:Label;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Tab Bar\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._tabBar = new TabBar();\n\t\t\tthis._tabBar.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ label: \"One\" },\n\t\t\t\t{ label: \"Two\" },\n\t\t\t\t{ label: \"Three\" },\n\t\t\t\t{ label: \"Disabled\", isEnabled: false },\n\t\t\t]);\n\t\t\tthis._tabBar.addEventListener(Event.CHANGE, tabBar_changeHandler);\n\t\t\tthis._tabBar.layoutData = new AnchorLayoutData(NaN, 0, 0, 0);\n\t\t\tthis.addChild(this._tabBar);\n\n\t\t\tthis._label = new Label();\n\t\t\tthis._label.text = \"selectedIndex: \" + this._tabBar.selectedIndex.toString();\n\t\t\tvar labelLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tlabelLayoutData.horizontalCenter = 0;\n\t\t\tlabelLayoutData.verticalCenter = 0;\n\t\t\tthis._label.layoutData = labelLayoutData;\n\t\t\tthis.addChild(DisplayObject(this._label));\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function tabBar_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis._label.text = \"selectedIndex: \" + this._tabBar.selectedIndex.toString();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/TextCalloutScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.TextCallout;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.layout.RelativePosition;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class TextCalloutScreen extends PanelScreen\n\t{\n\t\tprivate static const MESSAGE:String = \"Thank you for trying Feathers.\\nHappy coding.\";\n\n\t\tpublic function TextCalloutScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _rightButton:Button;\n\t\tprivate var _bottomButton:Button;\n\t\tprivate var _topButton:Button;\n\t\tprivate var _leftButton:Button;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \" Text Callout\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\t\t\t\n\t\t\tthis._rightButton = new Button();\n\t\t\tthis._rightButton.label = \"Right\";\n\t\t\tthis._rightButton.addEventListener(Event.TRIGGERED, rightButton_triggeredHandler);\n\t\t\tvar rightButtonLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\trightButtonLayoutData.top = 12;\n\t\t\trightButtonLayoutData.left = 12;\n\t\t\tthis._rightButton.layoutData = rightButtonLayoutData;\n\t\t\tthis.addChild(this._rightButton);\n\n\t\t\tthis._bottomButton = new Button();\n\t\t\tthis._bottomButton.label = \"Bottom\";\n\t\t\tthis._bottomButton.addEventListener(Event.TRIGGERED, bottomButton_triggeredHandler);\n\t\t\tvar bottomButtonLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tbottomButtonLayoutData.top = 12;\n\t\t\tbottomButtonLayoutData.right = 12;\n\t\t\tthis._bottomButton.layoutData = bottomButtonLayoutData;\n\t\t\tthis.addChild(this._bottomButton);\n\n\t\t\tthis._topButton = new Button();\n\t\t\tthis._topButton.label = \"Top\";\n\t\t\tthis._topButton.addEventListener(Event.TRIGGERED, topButton_triggeredHandler);\n\t\t\tvar topButtonLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\ttopButtonLayoutData.bottom = 12;\n\t\t\ttopButtonLayoutData.left = 12;\n\t\t\tthis._topButton.layoutData = topButtonLayoutData;\n\t\t\tthis.addChild(this._topButton);\n\n\t\t\tthis._leftButton = new Button();\n\t\t\tthis._leftButton.label = \"Left\";\n\t\t\tthis._leftButton.addEventListener(Event.TRIGGERED, leftButton_triggeredHandler);\n\t\t\tvar leftButtonLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tleftButtonLayoutData.bottom = 12;\n\t\t\tleftButtonLayoutData.right = 12;\n\t\t\tthis._leftButton.layoutData = leftButtonLayoutData;\n\t\t\tthis.addChild(this._leftButton);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function rightButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tTextCallout.show(MESSAGE, this._rightButton, new <String>[RelativePosition.RIGHT]);\n\t\t}\n\n\t\tprivate function bottomButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tTextCallout.show(MESSAGE, this._bottomButton, new <String>[RelativePosition.BOTTOM]);\n\t\t}\n\n\t\tprivate function topButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tTextCallout.show(MESSAGE, this._topButton, new <String>[RelativePosition.TOP]);\n\t\t}\n\n\t\tprivate function leftButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tTextCallout.show(MESSAGE, this._leftButton, new <String>[RelativePosition.LEFT]);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/TextInputScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.ScrollPolicy;\n\timport feathers.controls.TextArea;\n\timport feathers.controls.TextInput;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class TextInputScreen extends PanelScreen\n\t{\n\t\tpublic function TextInputScreen()\n\t\t{\n\t\t}\n\n\t\tprivate var _input:TextInput;\n\t\tprivate var _disabledInput:TextInput;\n\t\tprivate var _passwordInput:TextInput;\n\t\tprivate var _errorInput:TextInput;\n\t\tprivate var _notEditableInput:TextInput;\n\t\tprivate var _searchInput:TextInput;\n\t\tprivate var _textArea:TextArea;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Text Input\";\n\n\t\t\tvar verticalLayout:VerticalLayout = new VerticalLayout();\n\t\t\tverticalLayout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tverticalLayout.verticalAlign = VerticalAlign.TOP;\n\t\t\tverticalLayout.padding = 12;\n\t\t\tverticalLayout.gap = 8;\n\t\t\tthis.layout = verticalLayout;\n\n\t\t\tthis.verticalScrollPolicy = ScrollPolicy.ON;\n\n\t\t\tthis._input = new TextInput();\n\t\t\tthis._input.prompt = \"Normal Text Input\";\n\t\t\tthis.addChild(this._input);\n\n\t\t\tthis._disabledInput = new TextInput();\n\t\t\tthis._disabledInput.prompt = \"Disabled Input\";\n\t\t\tthis._disabledInput.isEnabled = false;\n\t\t\tthis.addChild(this._disabledInput);\n\n\t\t\tthis._searchInput = new TextInput();\n\t\t\tthis._searchInput.styleNameList.add(TextInput.ALTERNATE_STYLE_NAME_SEARCH_TEXT_INPUT);\n\t\t\tthis._searchInput.prompt = \"Search Input\";\n\t\t\tthis.addChild(this._searchInput);\n\n\t\t\tthis._passwordInput = new TextInput();\n\t\t\tthis._passwordInput.prompt = \"Password Input\";\n\t\t\tthis._passwordInput.displayAsPassword = true;\n\t\t\tthis.addChild(this._passwordInput);\n\n\t\t\tthis._errorInput = new TextInput();\n\t\t\tthis._errorInput.prompt = \"Error Input\";\n\t\t\tthis._errorInput.errorString = \"Oh, no! It's an error!\";\n\t\t\tthis.addChild(this._errorInput);\n\n\t\t\tthis._notEditableInput = new TextInput();\n\t\t\tthis._notEditableInput.text = \"Not Editable\";\n\t\t\tthis._notEditableInput.isEditable = false;\n\t\t\tthis.addChild(this._notEditableInput);\n\n\t\t\t//note: using TextArea on mobile generally isn't recommended.\n\t\t\t//consider TextInput with a multiline StageTextTextEditor instead.\n\t\t\tthis._textArea = new TextArea();\n\t\t\tthis.addChild(this._textArea);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/ToastScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Alert;\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.PanelScreen;\n\timport feathers.data.ArrayCollection;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\n\timport starling.events.Event;\n\timport feathers.system.DeviceCapabilities;\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport feathers.controls.Toast;\n\timport feathers.controls.ButtonGroup;\n\n\tpublic class ToastScreen extends PanelScreen\n\t{\n\t\tpublic function ToastScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _showToastButtons:ButtonGroup;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Toast\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._showToastButtons = new ButtonGroup();\n\t\t\tthis._showToastButtons.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ label: \"Show Toast with Message\", triggered: showMessageButton_triggeredHandler },\n\t\t\t\t{ label: \"Show Toast with Actions\", triggered: showActionsButton_triggeredHandler },\n\t\t\t])\n\t\t\tvar buttonGroupLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tbuttonGroupLayoutData.horizontalCenter = 0;\n\t\t\tbuttonGroupLayoutData.verticalCenter = 0;\n\t\t\tthis._showToastButtons.layoutData = buttonGroupLayoutData;\n\t\t\tthis.addChild(this._showToastButtons);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function showMessageButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tToast.showMessage(\"Hi, there!\");\n\t\t}\n\n\t\tprivate function showActionsButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tToast.showMessageWithActions(\"I have an action\", new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ label: \"Neat!\" }\n\t\t\t]));\n\t\t}\n\n\t\tprivate function alert_closeHandler(event:Event, data:Object):void\n\t\t{\n\t\t\tif(data)\n\t\t\t{\n\t\t\t\ttrace(\"alert closed with item:\", data.label);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttrace(\"alert closed without item\");\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/ToggleSwitchScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.ToggleSwitch;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.TiledRowsLayout;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class ToggleSwitchScreen extends PanelScreen\n\t{\n\t\tpublic function ToggleSwitchScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _toggle:ToggleSwitch;\n\t\tprivate var _selected:ToggleSwitch;\n\t\tprivate var _disabled:ToggleSwitch;\n\t\tprivate var _selectedDisabled:ToggleSwitch;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Toggle Switch\";\n\t\t\t\n\t\t\tvar layout:TiledRowsLayout = new TiledRowsLayout();\n\t\t\tlayout.requestedColumnCount = 2;\n\t\t\tlayout.useSquareTiles = false;\n\t\t\tlayout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tlayout.verticalAlign = VerticalAlign.TOP;\n\t\t\tlayout.tileHorizontalAlign = HorizontalAlign.CENTER;\n\t\t\tlayout.tileVerticalAlign = VerticalAlign.TOP;\n\t\t\tlayout.padding = 12;\n\t\t\tlayout.horizontalGap = 12;\n\t\t\tlayout.verticalGap = 44;\n\t\t\tthis.layout = layout;\n\n\t\t\tthis._toggle = new ToggleSwitch();\n\t\t\tthis._toggle.addEventListener(Event.CHANGE, toggleSwitch_changeHandler);\n\t\t\tthis.addChild(this._toggle);\n\n\t\t\tthis._selected = new ToggleSwitch();\n\t\t\tthis._selected.isSelected = true;\n\t\t\tthis.addChild(this._selected);\n\n\t\t\tthis._disabled = new ToggleSwitch();\n\t\t\tthis._disabled.isEnabled = false;\n\t\t\tthis.addChild(this._disabled);\n\n\t\t\tthis._selectedDisabled = new ToggleSwitch();\n\t\t\tthis._selectedDisabled.isSelected = true;\n\t\t\tthis._selectedDisabled.isEnabled = false;\n\t\t\tthis.addChild(this._selectedDisabled);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function toggleSwitch_changeHandler(event:Event):void\n\t\t{\n\t\t\ttrace(\"toggle switch changed:\", this._toggle.isSelected);\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/TreeScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.Tree;\n\timport feathers.controls.renderers.DefaultTreeItemRenderer;\n\timport feathers.controls.renderers.ITreeItemRenderer;\n\timport feathers.data.ArrayHierarchicalCollection;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class TreeScreen extends PanelScreen\n\t{\n\t\tpublic function TreeScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _tree:Tree;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Tree\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tvar data:Array =\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\ttext: \"Node 1\",\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttext: \"Node 1A\",\n\t\t\t\t\t\t\tchildren:\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t{ text: \"Node 1A-I\" },\n\t\t\t\t\t\t\t\t{ text: \"Node 1A-II\" },\n\t\t\t\t\t\t\t\t{ text: \"Node 1A-III\" },\n\t\t\t\t\t\t\t\t{ text: \"Node 1A-IV\" },\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{ text: \"Node 1B\" },\n\t\t\t\t\t\t{ text: \"Node 1C\" },\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttext: \"Node 2\",\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{ text: \"Node 2A\" },\n\t\t\t\t\t\t{ text: \"Node 2B\" },\n\t\t\t\t\t\t{ text: \"Node 2C\" },\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttext: \"Node 3\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttext: \"Node 4\",\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{ text: \"Node 4A\" },\n\t\t\t\t\t\t{ text: \"Node 4B\" },\n\t\t\t\t\t\t{ text: \"Node 4C\" },\n\t\t\t\t\t\t{ text: \"Node 4D\" },\n\t\t\t\t\t\t{ text: \"Node 4E\" },\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t];\n\t\t\t\n\t\t\tthis._tree = new Tree();\n\t\t\tthis._tree.dataProvider = new ArrayHierarchicalCollection(data);\n\t\t\tthis._tree.typicalItem = { text: \"Item 1000\" };\n\t\t\t//optimization: since this tree fills the entire screen, there's no\n\t\t\t//need for clipping. clipping should not be disabled if there's a\n\t\t\t//chance that item renderers could be visible if they appear outside\n\t\t\t//the tree's bounds\n\t\t\tthis._tree.clipContent = false;\n\t\t\t//optimization: when the background is covered by all item\n\t\t\t//renderers, don't render it\n\t\t\tthis._tree.autoHideBackground = true;\n\t\t\tthis._tree.itemRendererFactory = function():ITreeItemRenderer\n\t\t\t{\n\t\t\t\tvar renderer:DefaultTreeItemRenderer = new DefaultTreeItemRenderer();\n\t\t\t\trenderer.labelField = \"text\";\n\t\t\t\treturn renderer;\n\t\t\t};\n\t\t\tthis._tree.addEventListener(Event.CHANGE, tree_changeHandler);\n\t\t\tthis._tree.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis.addChildAt(this._tree, 0);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\n\t\t\tthis.addEventListener(FeathersEventType.TRANSITION_IN_COMPLETE, transitionInCompleteHandler);\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\treturn header;\n\t\t}\n\t\t\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function transitionInCompleteHandler(event:Event):void\n\t\t{\n\t\t\tthis._tree.revealScrollBars();\n\t\t}\n\t\t\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function tree_changeHandler(event:Event):void\n\t\t{\n\t\t\ttrace(\"Tree change:\", this._tree.dataProvider.getItemLocation(this._tree.selectedItem));\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/ComponentsExplorer/source/feathers/examples/componentsExplorer/screens/WebViewScreen.as",
    "content": "package feathers.examples.componentsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.TextInput;\n\timport feathers.controls.WebView;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.layout.HorizontalLayoutData;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class WebViewScreen extends PanelScreen\n\t{\n\t\tpublic function WebViewScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _browser:WebView;\n\t\tprivate var _locationInput:TextInput;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Web View\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tvar items:Array = [];\n\t\t\tfor(var i:int = 0; i < 150; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = {text: \"Item \" + (i + 1).toString()};\n\t\t\t\titems[i] = item;\n\t\t\t}\n\t\t\titems.fixed = true;\n\n\t\t\tthis._browser = new WebView();\n\t\t\tthis._browser.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis._browser.addEventListener(FeathersEventType.LOCATION_CHANGE, webView_locationChangeHandler);\n\t\t\tthis.addChild(this._browser);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\t\t\tthis.footerFactory = this.customFooterFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\n\t\t\t//with skipUnchangedFrames, we need to call setRequiresRedraw()\n\t\t\t//every frame\n\t\t\tthis.addEventListener(Event.ENTER_FRAME, enterFrameHandler);\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function customFooterFactory():LayoutGroup\n\t\t{\n\t\t\tvar footer:LayoutGroup = new LayoutGroup();\n\t\t\tfooter.styleNameList.add(LayoutGroup.ALTERNATE_STYLE_NAME_TOOLBAR);\n\t\t\t\n\t\t\tthis._locationInput = new TextInput();\n\t\t\tthis._locationInput.prompt = \"Enter a website address\";\n\t\t\tthis._locationInput.layoutData = new HorizontalLayoutData(100);\n\t\t\tthis._locationInput.addEventListener(FeathersEventType.ENTER, locationInput_enterHandler);\n\t\t\tfooter.addChild(this._locationInput);\n\t\t\t\n\t\t\tvar goButton:Button = new Button();\n\t\t\tgoButton.label = \"Go\";\n\t\t\tgoButton.addEventListener(Event.TRIGGERED, goButton_triggeredHandler);\n\t\t\tfooter.addChild(goButton);\n\t\t\t\n\t\t\treturn footer;\n\t\t}\n\t\t\n\t\tprivate function loadLocation():void\n\t\t{\n\t\t\tif(this._locationInput.text.length == 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._locationInput.clearFocus();\n\t\t\tvar url:String = this._locationInput.text;\n\t\t\t//make sure that there's a protocol. otherwise, AIR will add app:/,\n\t\t\t//which probably isn't what you want.\n\t\t\tif(!url.match(/^\\w+:\\//))\n\t\t\t{\n\t\t\t\turl = \"http://\" + url;\n\t\t\t}\n\t\t\turl = encodeURI(url);\n\t\t\tthis._browser.loadURL(url);\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function enterFrameHandler(event:Event):void\n\t\t{\n\t\t\tthis._browser.setRequiresRedraw();\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\t\t\n\t\tprivate function webView_locationChangeHandler(event:Event):void\n\t\t{\n\t\t\tthis._locationInput.text = this._browser.location;\n\t\t}\n\t\t\n\t\tprivate function locationInput_enterHandler(event:Event):void\n\t\t{\n\t\t\tthis.loadLocation();\n\t\t}\n\t\t\n\t\tprivate function goButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.loadLocation();\n\t\t}\n\t\t\n\t\t\n\t}\n}"
  },
  {
    "path": "examples/DragAndDrop/README.md",
    "content": "# Feathers Drag and Drop\n\nA very simple of drag and drop in [Feathers](http://feathersui.com/). Includes examples of implementing the `IDragSource` and `IDropTarget` interfaces.\n\n## Requirements\n\nIn addition to Starling Framework and Feathers, this example project requires the `MetalWorksDesktopTheme` example theme. You can find the SWC file for this theme at the following location in the Feathers release build:\n\n\tthemes/MetalWorksDesktopTheme/swc/MetalWorksDesktopTheme.swc\n\n## Web Demo\n\nView the [Drag and Drop Example](http://feathersui.com/examples/drag-and-drop/) in your web browser."
  },
  {
    "path": "examples/DragAndDrop/build.properties",
    "content": "feathers.root = ${basedir}/../../source\nstarling.root = ${basedir}/../../third-party/starling\ntheme.root = ${basedir}/../../themes/MetalWorksDesktopTheme/source\noutput.path = ${basedir}/output\n\nswf.version = 30"
  },
  {
    "path": "examples/DragAndDrop/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<project name=\"drag-and-drop\" default=\"build\" basedir=\".\">\n\t\n\t<!-- build.local.properties and sdk.local.proprties are optional files that\n\t\tcan be used to override the default properties. -->\n\t<property file=\"./build.local.properties\"/>\n\t<property file=\"./sdk.local.properties\"/>\n\t<property file=\"./build.properties\"/>\n\t<!-- inherit SDK properties from the root of the repository -->\n\t<property file=\"../../sdk.local.properties\"/>\n\t<property file=\"../../sdk.properties\"/>\n\n\t<target name=\"build\" depends=\"-build-swf\"/>\n\n\t<target name=\"-prepare\">\n\t\t<delete dir=\"${output.path}\"/>\n\t</target>\n\n\t<target name=\"-build-swf\" depends=\"-prepare\">\n\t\t<echo message=\"Building DragAndDrop.swf\"/>\n\t\t<java jar=\"${mxmlc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${flashplayer.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-source-path+=source\"/>\n\t\t\t<arg value=\"-source-path+=${starling.root}\"/>\n\t\t\t<arg value=\"-source-path+=${feathers.root}\"/>\n\t\t\t<arg value=\"-source-path+=${theme.root}\"/>\n\t\t\t<arg value=\"source/DragAndDrop.as\"/>\n\t\t\t<arg value=\"-output=${output.path}/DragAndDrop.swf\"/>\n\t\t</java>\n\t</target>\n</project>"
  },
  {
    "path": "examples/DragAndDrop/source/DragAndDrop.as",
    "content": "package\n{\n\timport feathers.examples.dragDrop.Main;\n\n\timport flash.display.Sprite;\n\timport flash.display.StageAlign;\n\timport flash.display.StageScaleMode;\n\timport flash.events.Event;\n\timport flash.geom.Rectangle;\n\n\timport starling.core.Starling;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#4a4137\")]\n\tpublic class DragAndDrop extends Sprite\n\t{\n\t\tpublic function DragAndDrop()\n\t\t{\n\t\t\tif(this.stage)\n\t\t\t{\n\t\t\t\tthis.stage.scaleMode = StageScaleMode.NO_SCALE;\n\t\t\t\tthis.stage.align = StageAlign.TOP_LEFT;\n\t\t\t}\n\t\t\tthis.mouseEnabled = this.mouseChildren = false;\n\t\t\tthis.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);\n\t\t}\n\n\t\tprivate var _starling:Starling;\n\n\t\tprivate function loaderInfo_completeHandler(event:Event):void\n\t\t{\n\t\t\tStarling.multitouchEnabled = true;\n\t\t\tthis._starling = new Starling(Main, this.stage);\n\t\t\tthis._starling.supportHighResolutions = true;\n\t\t\tthis._starling.skipUnchangedFrames = true;\n\t\t\tthis._starling.start();\n\n\t\t\tthis.stage.addEventListener(Event.RESIZE, stage_resizeHandler, false, int.MAX_VALUE, true);\n\t\t\tthis.stage.addEventListener(Event.DEACTIVATE, stage_deactivateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function stage_resizeHandler(event:Event):void\n\t\t{\n\t\t\tthis._starling.stage.stageWidth = this.stage.stageWidth;\n\t\t\tthis._starling.stage.stageHeight = this.stage.stageHeight;\n\n\t\t\tvar viewPort:Rectangle = this._starling.viewPort;\n\t\t\tviewPort.width = this.stage.stageWidth;\n\t\t\tviewPort.height = this.stage.stageHeight;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tthis._starling.viewPort = viewPort;\n\t\t\t}\n\t\t\tcatch(error:Error) {}\n\t\t}\n\n\t\tprivate function stage_deactivateHandler(event:Event):void\n\t\t{\n\t\t\tthis._starling.stop(true);\n\t\t\tthis.stage.addEventListener(Event.ACTIVATE, stage_activateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function stage_activateHandler(event:Event):void\n\t\t{\n\t\t\tthis.stage.removeEventListener(Event.ACTIVATE, stage_activateHandler);\n\t\t\tthis._starling.start();\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "examples/DragAndDrop/source/feathers/examples/dragDrop/DragSource.as",
    "content": "package feathers.examples.dragDrop\n{\n\timport feathers.controls.LayoutGroup;\n\timport feathers.dragDrop.DragData;\n\timport feathers.dragDrop.DragDropManager;\n\timport feathers.dragDrop.IDragSource;\n\timport feathers.events.DragDropEvent;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\tpublic class DragSource extends LayoutGroup implements IDragSource\n\t{\n\t\tpublic function DragSource(dragFormat:String)\n\t\t{\n\t\t\tthis._dragFormat = dragFormat;\n\t\t\tthis.addEventListener(TouchEvent.TOUCH, touchHandler);\n\t\t\tthis.addEventListener(DragDropEvent.DRAG_START, dragStartHandler);\n\t\t\tthis.addEventListener(DragDropEvent.DRAG_COMPLETE, dragCompleteHandler);\n\t\t}\n\n\t\tprivate var _touchID:int = -1;\n\t\tprivate var _draggedObject:DisplayObject;\n\t\tprivate var _dragFormat:String;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tthis.backgroundSkin = new Quad(1, 1, 0x36322e);\n\t\t}\n\n\t\tprivate function touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(DragDropManager.isDragging)\n\t\t\t{\n\t\t\t\t//one drag at a time, please\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._touchID >= 0)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(this._draggedObject, null, this._touchID);\n\t\t\t\tif(touch.phase == TouchPhase.MOVED)\n\t\t\t\t{\n\t\t\t\t\tthis._touchID = -1;\n\n\t\t\t\t\tvar avatar:Quad = new Quad(100, 100, 0xff8800);\n\t\t\t\t\tavatar.alpha = 0.5;\n\n\t\t\t\t\tvar dragData:DragData = new DragData();\n\t\t\t\t\tdragData.setDataForFormat(this._dragFormat, this._draggedObject);\n\t\t\t\t\tDragDropManager.startDrag(this, touch, dragData, avatar, -avatar.width / 2, -avatar.height / 2);\n\t\t\t\t}\n\t\t\t\telse if(touch.phase == TouchPhase.ENDED)\n\t\t\t\t{\n\t\t\t\t\tthis._touchID = -1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(this, TouchPhase.BEGAN);\n\t\t\t\tif(!touch || touch.target == this || touch.target == this.backgroundSkin)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._touchID = touch.id;\n\t\t\t\tthis._draggedObject = touch.target;\n\t\t\t}\n\t\t}\n\n\t\tprivate function dragStartHandler(event:DragDropEvent, dragData:DragData):void\n\t\t{\n\t\t\t//the drag was started with the call to DragDropManager.startDrag()\n\t\t}\n\n\t\tprivate function dragCompleteHandler(event:DragDropEvent, dragData:DragData):void\n\t\t{\n\t\t\tif(event.isDropped)\n\t\t\t{\n\t\t\t\t//the object was dropped somewhere\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//the drag cancelled and the object was not dropped\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/DragAndDrop/source/feathers/examples/dragDrop/DropTarget.as",
    "content": "package feathers.examples.dragDrop\n{\n\timport feathers.controls.LayoutGroup;\n\timport feathers.dragDrop.DragData;\n\timport feathers.dragDrop.DragDropManager;\n\timport feathers.dragDrop.IDropTarget;\n\timport feathers.events.DragDropEvent;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\n\tpublic class DropTarget extends LayoutGroup implements IDropTarget\n\t{\n\t\tprivate static const DEFAULT_COLOR:uint = 0x36322e;\n\t\tprivate static const HOVER_COLOR:uint = 0x26221e;\n\n\t\tpublic function DropTarget(dragFormat:String)\n\t\t{\n\t\t\tthis._dragFormat = dragFormat;\n\t\t\tthis.addEventListener(DragDropEvent.DRAG_ENTER, dragEnterHandler);\n\t\t\tthis.addEventListener(DragDropEvent.DRAG_EXIT, dragExitHandler);\n\t\t\tthis.addEventListener(DragDropEvent.DRAG_DROP, dragDropHandler);\n\t\t}\n\n\t\tprivate var _dragFormat:String;\n\t\tprivate var _backgroundQuad:Quad;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tthis._backgroundQuad = new Quad(1, 1, DEFAULT_COLOR);\n\t\t\tthis.backgroundSkin = this._backgroundQuad;\n\t\t}\n\n\t\tprivate function dragEnterHandler(event:DragDropEvent, dragData:DragData):void\n\t\t{\n\t\t\tif(!dragData.hasDataForFormat(this._dragFormat))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tDragDropManager.acceptDrag(this);\n\t\t\tthis._backgroundQuad.color = HOVER_COLOR;\n\t\t}\n\n\t\tprivate function dragExitHandler(event:DragDropEvent, dragData:DragData):void\n\t\t{\n\t\t\tthis._backgroundQuad.color = DEFAULT_COLOR;\n\t\t}\n\n\t\tprivate function dragDropHandler(event:DragDropEvent, dragData:DragData):void\n\t\t{\n\t\t\tvar droppedObject:DisplayObject = DisplayObject(dragData.getDataForFormat(this._dragFormat))\n\t\t\tdroppedObject.x = Math.min(Math.max(event.localX - droppedObject.width / 2,\n\t\t\t\t0), this.actualWidth - droppedObject.width); //keep within the bounds of the target\n\t\t\tdroppedObject.y = Math.min(Math.max(event.localY - droppedObject.height / 2,\n\t\t\t\t0), this.actualHeight - droppedObject.height); //keep within the bounds of the target\n\t\t\tthis.addChild(droppedObject);\n\n\t\t\tthis._backgroundQuad.color = DEFAULT_COLOR;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/DragAndDrop/source/feathers/examples/dragDrop/Main.as",
    "content": "package feathers.examples.dragDrop\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Label;\n\timport feathers.dragDrop.IDragSource;\n\timport feathers.dragDrop.IDropTarget;\n\timport feathers.themes.MetalWorksDesktopTheme;\n\n\timport starling.display.Quad;\n\timport starling.display.Sprite;\n\timport starling.events.Event;\n\n\tpublic class Main extends Sprite implements IDragSource, IDropTarget\n\t{\n\t\tprivate static const DRAG_FORMAT:String = \"draggableQuad\";\n\n\t\tpublic function Main()\n\t\t{\n\t\t\t//set up the theme right away!\n\t\t\tnew MetalWorksDesktopTheme();\n\t\t\tthis.addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);\n\t\t}\n\n\t\tprivate var _draggableQuad:Quad;\n\t\tprivate var _dragSource:DragSource;\n\t\tprivate var _dropTarget:DropTarget;\n\t\tprivate var _resetButton:Button;\n\n\t\tprivate function reset():void\n\t\t{\n\t\t\tthis._draggableQuad.x = 40;\n\t\t\tthis._draggableQuad.y = 40;\n\t\t\tthis._dragSource.addChild(this._draggableQuad);\n\t\t}\n\n\t\tprivate function addedToStageHandler(event:Event):void\n\t\t{\n\t\t\tthis._draggableQuad = new Quad(100, 100, 0xff8800);\n\n\t\t\tthis._dragSource = new DragSource(DRAG_FORMAT);\n\t\t\tthis._dragSource.width = 320;\n\t\t\tthis._dragSource.height = 420;\n\t\t\tthis._dragSource.x = 80;\n\t\t\tthis._dragSource.y = 80;\n\t\t\tthis.addChild(this._dragSource);\n\n\t\t\tthis._dropTarget = new DropTarget(DRAG_FORMAT);\n\t\t\tthis._dropTarget.width = 320;\n\t\t\tthis._dropTarget.height = 420;\n\t\t\tthis._dropTarget.x = 560;\n\t\t\tthis._dropTarget.y = 80;\n\t\t\tthis.addChild(this._dropTarget);\n\n\t\t\tthis._resetButton = new Button();\n\t\t\tthis._resetButton.label = \"Reset\";\n\t\t\tthis._resetButton.addEventListener(Event.TRIGGERED, resetButton_triggeredHandler);\n\t\t\tthis.addChild(this._resetButton);\n\n\t\t\tthis._resetButton.validate();\n\t\t\tthis._resetButton.x = (this.stage.stageWidth - this._resetButton.width) / 2;\n\t\t\tthis._resetButton.y = this.stage.stageHeight - this._resetButton.height - 80;\n\n\t\t\tvar instructions:Label = new Label();\n\t\t\tinstructions.text = \"Drag the square from the left container to the right container.\";\n\t\t\tthis.addChild(instructions);\n\n\t\t\tinstructions.validate();\n\t\t\tinstructions.x = (this.stage.stageWidth - instructions.width) / 2;\n\t\t\tinstructions.y = (this._dragSource.y - instructions.height) / 2;\n\n\t\t\tthis.reset();\n\t\t}\n\n\t\tprivate function resetButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.reset();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/DrawersExplorer/README.md",
    "content": "# Feathers Drawers Explorer\n\nA look at some of the options available to the `Drawers` component in [Feathers](http://feathersui.com/), presented as a mobile app.\n\n## Requirements\n\nIn addition to Starling Framework and Feathers, this example project requires the `MetalWorksMobileTheme` example theme. You can find the SWC file for this theme at the following location in the Feathers release build:\n\n\tthemes/MetalWorksMobileTheme/swc/MetalWorksMobileTheme.swc\n\n## Web Demo\n\nView the [Drawers Explorer](http://feathersui.com/examples/drawers-explorer/) in your browser."
  },
  {
    "path": "examples/DrawersExplorer/build.properties",
    "content": "feathers.root = ${basedir}/../../source\nstarling.root = ${basedir}/../../third-party/starling\ntheme.root = ${basedir}/../../themes/MetalWorksMobileTheme/source\noutput.path = ${basedir}/output\nicon.path = ${basedir}/../shared-assets/icons\nlaunch.image.path = ${basedir}/../shared-assets/launch-images-full-screen\n\nswf.version = 30"
  },
  {
    "path": "examples/DrawersExplorer/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<project name=\"drawers-explorer\" default=\"build\" basedir=\".\">\n\t\n\t<!-- build.local.properties and sdk.local.proprties are optional files that\n\t\tcan be used to override the default properties. -->\n\t<property file=\"./build.local.properties\"/>\n\t<property file=\"./sdk.local.properties\"/>\n\t<property file=\"./build.properties\"/>\n\t<!-- inherit SDK properties from the root of the repository -->\n\t<property file=\"../../sdk.local.properties\"/>\n\t<property file=\"../../sdk.properties\"/>\n\n\t<target name=\"build\" depends=\"build-web,build-android,build-ios\"/>\n\n\t<target name=\"prepare\">\n\t\t<delete dir=\"${output.path}\"/>\n\t</target>\n\n\t<target name=\"build-web\" depends=\"prepare\">\n\t\t<echo message=\"Building DrawersExplorerWeb.swf\"/>\n\t\t<java jar=\"${mxmlc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${flashplayer.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-advanced-telemetry=true\"/>\n\t\t\t<arg value=\"-frame=two,feathers.examples.drawersExplorer.Main\"/>\n\t\t\t<arg value=\"-source-path+=source\"/>\n\t\t\t<arg value=\"-source-path+=${starling.root}\"/>\n\t\t\t<arg value=\"-source-path+=${feathers.root}\"/>\n\t\t\t<arg value=\"-source-path+=${theme.root}\"/>\n\t\t\t<arg value=\"source/DrawersExplorerWeb.as\"/>\n\t\t\t<arg value=\"-output=${output.path}/DrawersExplorerWeb.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"build-air-swf\" depends=\"prepare\">\n\t\t<echo message=\"Building DrawersExplorer.swf\"/>\n\t\t<java jar=\"${mxmlc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${airmobile.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-advanced-telemetry=true\"/>\n\t\t\t<arg value=\"-source-path+=source\"/>\n\t\t\t<arg value=\"-source-path+=${starling.root}\"/>\n\t\t\t<arg value=\"-source-path+=${feathers.root}\"/>\n\t\t\t<arg value=\"-source-path+=${theme.root}\"/>\n\t\t\t<arg value=\"source/DrawersExplorer.as\"/>\n\t\t\t<arg value=\"-output=${output.path}/DrawersExplorer.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"-check-ios-properties\">\n\t\t<fail unless=\"ios.provision.path\"/>\n\t\t<fail unless=\"ios.certificate.path\"/>\n\t\t<fail unless=\"ios.certificate.password\"/>\n\t</target>\n\t<target name=\"build-ios\" depends=\"-check-ios-properties,build-air-swf\">\n\t\t<echo message=\"Packaging DrawersExplorer.ipa\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"-target\"/>\n\t\t\t<arg value=\"ipa-app-store\"/>\n\t\t\t<!-- uncomment for actionscript sampling with scout on ios -->\n\t\t\t<!--<arg value=\"-sampler\"/>-->\n\t\t\t<arg value=\"-provisioning-profile\"/>\n\t\t\t<arg value=\"${ios.provision.path}\"/>\n\t\t\t<arg value=\"-keystore\"/>\n\t\t\t<arg value=\"${ios.certificate.path}\"/>\n\t\t\t<arg value=\"-storetype\"/>\n\t\t\t<arg value=\"pkcs12\"/>\n\t\t\t<arg value=\"-storepass\"/>\n\t\t\t<arg value=\"${ios.certificate.password}\"/>\n\t\t\t<arg value=\"${output.path}/DrawersExplorer.ipa\"/>\n\t\t\t<arg value=\"source/DrawersExplorer-app.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${icon.path}\"/>\n\t\t\t<arg line=\"icon29.png icon48.png icon50.png icon57.png icon58.png icon72.png icon87.png icon96.png icon100.png icon114.png icon128.png icon144.png icon180.png\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${launch.image.path}\"/>\n\t\t\t<arg value=\"Default~iphone.png\"/>\t\t\t\t\t\t\t<!-- iphone 3gs -->\n\t\t\t<arg value=\"Default@2x~iphone.png\"/>\t\t\t\t\t\t<!-- iphone 4/4s -->\n\t\t\t<arg value=\"Default-568h@2x~iphone.png\"/>\t\t\t\t\t<!-- iphone 5/5c/5s -->\n\t\t\t<arg value=\"Default-375w-667h@2x~iphone.png\"/>\t\t\t\t<!-- iphone 6/7/8 -->\n\t\t\t<arg value=\"Default-812h@3x~iphone.png\"/>\t\t\t\t\t<!-- iphone x (portrait) -->\n\t\t\t<arg value=\"Default-Landscape-812h@3x~iphone.png\"/>\t\t\t<!-- iphone x (landscape) -->\n\t\t\t<arg value=\"Default-414w-736h@3x~iphone.png\"/>\t\t\t\t<!-- iphone 6/7/8 plus (portrait) -->\n\t\t\t<arg value=\"Default-Landscape-414w-736h@3x~iphone.png\"/>\t<!-- iphone 6/7/8 plus (landscape) -->\n\t\t\t<arg value=\"Default-Portrait~ipad.png\"/>\t\t\t\t\t<!-- ipad 1/2 (portrait) -->\n\t\t\t<arg value=\"Default-PortraitUpsideDown~ipad.png\"/>\t\t\t<!-- ipad 1/2 (portrait upside down) -->\n\t\t\t<arg value=\"Default-Landscape~ipad.png\"/>\t\t\t\t\t<!-- ipad 1/2 (landscape left) -->\n\t\t\t<arg value=\"Default-LandscapeRight~ipad.png\"/>\t\t\t\t<!-- ipad 1/2 (landscape right) -->\n\t\t\t<arg value=\"Default-Portrait@2x~ipad.png\"/>\t\t\t\t\t<!-- ipad 3/air (portrait) -->\n\t\t\t<arg value=\"Default-LandscapeLeft@2x~ipad.png\"/>\t\t\t<!-- ipad 3/air (landscape left) -->\n\t\t\t<arg value=\"Default-LandscapeRight@2x~ipad.png\"/>\t\t\t<!-- ipad 3/air (landscape right) -->\n\t\t\t<arg value=\"Default-Portrait@2x.png\"/>\t\t\t\t\t\t<!-- ipad pro (portrait) -->\n\t\t\t<arg value=\"Default-Landscape@2x.png\"/>\t\t\t\t\t\t<!-- ipad pro (landscape) -->\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${output.path}\"/>\n\t\t\t<arg value=\"DrawersExplorer.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"-check-android-properties\">\n\t\t<fail unless=\"android.certificate.path\"/>\n\t\t<fail unless=\"android.certificate.password\"/>\n\t</target>\n\t<target name=\"build-android\" depends=\"-check-android-properties,build-air-swf\">\n\t\t<echo message=\"Packaging DrawersExplorer.apk\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"-target\"/>\n\t\t\t<arg value=\"apk-captive-runtime\"/>\n\t\t\t<arg value=\"-storetype\"/>\n\t\t\t<arg value=\"pkcs12\"/>\n\t\t\t<arg value=\"-keystore\"/>\n\t\t\t<arg value=\"${android.certificate.path}\"/>\n\t\t\t<arg value=\"-storepass\"/>\n\t\t\t<arg value=\"${android.certificate.password}\"/>\n\t\t\t<arg value=\"${output.path}/DrawersExplorer.apk\"/>\n\t\t\t<arg value=\"source/DrawersExplorer-app.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${icon.path}\"/>\n\t\t\t<arg line=\"icon29.png icon48.png icon50.png icon57.png icon58.png icon72.png icon87.png icon96.png icon100.png icon114.png icon128.png icon144.png icon180.png\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${output.path}\"/>\n\t\t\t<arg value=\"DrawersExplorer.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"install-android\">\n\t\t<echo message=\"Installing DrawersExplorer.apk\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"false\">\n\t\t\t<arg value=\"-uninstallApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"android\"/>\n\t\t\t<arg value=\"-appid\"/>\n\t\t\t<arg value=\"com.feathersui.examples.DrawersExplorer\"/>\n\t\t</java>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-installApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"android\"/>\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"${output.path}/DrawersExplorer.apk\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"install-ios\">\n\t\t<echo message=\"Installing DrawersExplorer.ipa\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"false\">\n\t\t\t<arg value=\"-uninstallApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"iOS\"/>\n\t\t\t<arg value=\"-appid\"/>\n\t\t\t<arg value=\"com.feathersui.examples.DrawersExplorer\"/>\n\t\t</java>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-installApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"iOS\"/>\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"${output.path}/DrawersExplorer.ipa\"/>\n\t\t</java>\n\t</target>\n</project>"
  },
  {
    "path": "examples/DrawersExplorer/source/DrawersExplorer-app.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<application xmlns=\"http://ns.adobe.com/air/application/32.0\">\n\t<id>com.feathersui.examples.DrawersExplorer</id>\n\t<filename>Drawers</filename>\n\t<name>Drawers</name>\n\t<versionNumber>4.2.0</versionNumber>\n\t<description>Drawers Explorer example application built with Feathers UI controls for Starling</description>\n\t<copyright>2021 Bowler Hat LLC</copyright>\n\n\t<initialWindow>\n\t\t<content>DrawersExplorer.swf</content>\n\t\t<autoOrients>true</autoOrients>\n\t\t<fullScreen>true</fullScreen>\n\t\t<visible>true</visible>\n\t\t<renderMode>direct</renderMode>\n\t</initialWindow>\n\n\t<supportedLanguages>en</supportedLanguages>\n\n\t<icon>\n\t\t<image29x29>icon29.png</image29x29>\n\t\t<image48x48>icon48.png</image48x48>\n\t\t<image50x50>icon50.png</image50x50>\n\t\t<image57x57>icon57.png</image57x57>\n\t\t<image58x58>icon58.png</image58x58>\n\t\t<image72x72>icon72.png</image72x72>\n\t\t<image87x87>icon87.png</image87x87>\n\t\t<image96x96>icon96.png</image96x96>\n\t\t<image100x100>icon100.png</image100x100>\n\t\t<image114x114>icon114.png</image114x114>\n\t\t<image128x128>icon128.png</image128x128>\n\t\t<image144x144>icon144.png</image144x144>\n\t\t<image180x180>icon180.png</image180x180>\n\t</icon>\n\t<android>\n\t\t<colorDepth>16bit</colorDepth>\n\t\t<manifestAdditions><![CDATA[\n\t\t\t<manifest android:installLocation=\"auto\">\n\t\t\t    <uses-permission android:name=\"android.permission.INTERNET\"/>\n\t\t\t</manifest>\n\t\t]]></manifestAdditions>\n\t</android>\n\t<iPhone>\n\t\t<InfoAdditions>\n\t\t<![CDATA[\n\t\t\t<key>UIDeviceFamily</key> \n\t\t\t<array> \n\t\t\t\t<string>1</string>\n\t\t\t\t<string>2</string>\n\t\t\t</array>\n\t\t\t<key>UIPrerenderedIcon</key>\n\t\t\t<true/>\n\t\t]]> \n\t\t</InfoAdditions>\n\t\t<requestedDisplayResolution>high</requestedDisplayResolution>\n\t</iPhone>\n</application>"
  },
  {
    "path": "examples/DrawersExplorer/source/DrawersExplorer.as",
    "content": "package\n{\n\timport feathers.examples.drawersExplorer.Main;\n\timport feathers.utils.ScreenDensityScaleFactorManager;\n\n\timport flash.display.Loader;\n\timport flash.display.Sprite;\n\timport flash.display.StageAlign;\n\timport flash.display.StageOrientation;\n\timport flash.display.StageScaleMode;\n\timport flash.display3D.Context3DProfile;\n\timport flash.display3D.Context3DRenderMode;\n\timport flash.events.Event;\n\timport flash.filesystem.File;\n\timport flash.filesystem.FileMode;\n\timport flash.filesystem.FileStream;\n\timport flash.system.Capabilities;\n\timport flash.utils.ByteArray;\n\n\timport starling.core.Starling;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#4a4137\")]\n\tpublic class DrawersExplorer extends Sprite\n\t{\n\t\tpublic function DrawersExplorer()\n\t\t{\n\t\t\tif(this.stage)\n\t\t\t{\n\t\t\t\tthis.stage.scaleMode = StageScaleMode.NO_SCALE;\n\t\t\t\tthis.stage.align = StageAlign.TOP_LEFT;\n\t\t\t}\n\t\t\tthis.mouseEnabled = this.mouseChildren = false;\n\t\t\tthis.showLaunchImage();\n\t\t\tthis.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);\n\t\t}\n\n\t\tprivate var _starling:Starling;\n\t\tprivate var _scaler:ScreenDensityScaleFactorManager;\n\t\tprivate var _launchImage:Loader;\n\t\tprivate var _savedAutoOrients:Boolean;\n\n\t\t/**\n\t\t * On iOS, add the native launch image to the classic display list to\n\t\t * avoid displaying only the stage background color between when the\n\t\t * AIR app finishes launching and Starling starts rendering.\n\t\t * \n\t\t * Launch image names: https://forums.adobe.com/message/9986239#9986239\n\t\t */\n\t\tprivate function showLaunchImage():void\n\t\t{\n\t\t\tvar filePath:String = null;\n\t\t\tvar isPortraitOnly:Boolean = false;\n\t\t\tif(Capabilities.manufacturer.indexOf(\"iOS\") >= 0)\n\t\t\t{\n\t\t\t\tvar isPortraitUpsideDown:Boolean = this.stage.orientation == StageOrientation.UPSIDE_DOWN;\n\t\t\t\tvar isPortrait:Boolean = this.stage.orientation == StageOrientation.DEFAULT || isPortraitUpsideDown;\n\t\t\t\tvar isLandscapeRight:Boolean = this.stage.orientation == StageOrientation.ROTATED_RIGHT;\n\t\t\t\tif(Capabilities.screenResolutionX == 1242 && Capabilities.screenResolutionY == 2208)\n\t\t\t\t{\n\t\t\t\t\t//iphone 6/7/8 plus\n\t\t\t\t\tfilePath = isPortrait ? \"Default-414w-736h@3x~iphone.png\" : \"Default-Landscape-414w-736h@3x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 1125 && Capabilities.screenResolutionY == 2436)\n\t\t\t\t{\n\t\t\t\t\t//iphone x\n\t\t\t\t\tfilePath = isPortrait ? \"Default-812h@3x~iphone.png\" : \"Default-Landscape-812h@3x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 2048 && Capabilities.screenResolutionY == 2732)\n\t\t\t\t{\n\t\t\t\t\t//ipad pro\n\t\t\t\t\tfilePath = isPortrait ? \"Default-Portrait@2x.png\" : \"Default-Landscape@2x.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 1536 && Capabilities.screenResolutionY == 2048)\n\t\t\t\t{\n\t\t\t\t\t//ipad 3/air\n\t\t\t\t\tif(isPortraitUpsideDown)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Portrait@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isPortrait)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-PortraitUpsideDown@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isLandscapeRight)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeRight@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeLeft@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 768 && Capabilities.screenResolutionY == 1024)\n\t\t\t\t{\n\t\t\t\t\t//ipad 1/2\n\t\t\t\t\tif(isPortraitUpsideDown)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Portrait~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isPortrait)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-PortraitUpsideDown~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isLandscapeRight)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeRight~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Landscape~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 750)\n\t\t\t\t{\n\t\t\t\t\t//iphone 6/7/8\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tfilePath = \"Default-375w-667h@2x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 640)\n\t\t\t\t{\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tif(Capabilities.screenResolutionY == 1136)\n\t\t\t\t\t{\n\t\t\t\t\t\t//iphone 5/5c/5s\n\t\t\t\t\t\tfilePath = \"Default-568h@2x~iphone.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//iphone 4/4s\n\t\t\t\t\t\tfilePath = \"Default@2x~iphone.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 320)\n\t\t\t\t{\n\t\t\t\t\t//iphone 3gs\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tfilePath = \"Default~iphone.png\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(filePath)\n\t\t\t{\n\t\t\t\tvar file:File = File.applicationDirectory.resolvePath(filePath);\n\t\t\t\tif(file.exists)\n\t\t\t\t{\n\t\t\t\t\tvar bytes:ByteArray = new ByteArray();\n\t\t\t\t\tvar stream:FileStream = new FileStream();\n\t\t\t\t\tstream.open(file, FileMode.READ);\n\t\t\t\t\tstream.readBytes(bytes, 0, stream.bytesAvailable);\n\t\t\t\t\tstream.close();\n\t\t\t\t\tthis._launchImage = new Loader();\n\t\t\t\t\tthis._launchImage.loadBytes(bytes);\n\t\t\t\t\tthis.addChild(this._launchImage);\n\t\t\t\t\tthis._savedAutoOrients = this.stage.autoOrients;\n\t\t\t\t\tthis.stage.autoOrients = false;\n\t\t\t\t\tif(isPortraitOnly)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.stage.setOrientation(StageOrientation.DEFAULT);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function loaderInfo_completeHandler(event:Event):void\n\t\t{\n\t\t\tStarling.multitouchEnabled = true;\n\t\t\tthis._starling = new Starling(Main, this.stage, null, null, Context3DRenderMode.AUTO, Context3DProfile.BASELINE);\n\t\t\tthis._starling.supportHighResolutions = true;\n\t\t\tthis._starling.skipUnchangedFrames = true;\n\t\t\tthis._starling.start();\n\t\t\tif(this._launchImage)\n\t\t\t{\n\t\t\t\tthis._starling.addEventListener(\"rootCreated\", starling_rootCreatedHandler);\n\t\t\t}\n\t\t\tthis._scaler = new ScreenDensityScaleFactorManager(this._starling);\n\n\t\t\tthis.stage.addEventListener(Event.DEACTIVATE, stage_deactivateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function starling_rootCreatedHandler(event:Object):void\n\t\t{\n\t\t\tif(this._launchImage)\n\t\t\t{\n\t\t\t\tthis.removeChild(this._launchImage);\n\t\t\t\tthis._launchImage.unloadAndStop(true);\n\t\t\t\tthis._launchImage = null;\n\t\t\t\tthis.stage.autoOrients = this._savedAutoOrients;\n\t\t\t}\n\t\t}\n\n\t\tprivate function stage_deactivateHandler(event:Event):void\n\t\t{\n\t\t\tthis._starling.stop(true);\n\t\t\tthis.stage.addEventListener(Event.ACTIVATE, stage_activateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function stage_activateHandler(event:Event):void\n\t\t{\n\t\t\tthis.stage.removeEventListener(Event.ACTIVATE, stage_activateHandler);\n\t\t\tthis._starling.start();\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "examples/DrawersExplorer/source/DrawersExplorerWeb.as",
    "content": "package\n{\n\timport feathers.system.DeviceCapabilities;\n\n\timport flash.display.MovieClip;\n\timport flash.display.StageAlign;\n\timport flash.display.StageScaleMode;\n\timport flash.events.Event;\n\timport flash.geom.Rectangle;\n\timport flash.ui.ContextMenu;\n\timport flash.utils.getDefinitionByName;\n\n\timport starling.core.Starling;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#4a4137\")]\n\tpublic class DrawersExplorerWeb extends MovieClip\n\t{\n\t\tpublic function DrawersExplorerWeb()\n\t\t{\n\t\t\tvar menu:ContextMenu = new ContextMenu();\n\t\t\tmenu.hideBuiltInItems();\n\t\t\tthis.contextMenu = menu;\n\t\t\t\n\t\t\tif(this.stage)\n\t\t\t{\n\t\t\t\tthis.stage.align = StageAlign.TOP_LEFT;\n\t\t\t\tthis.stage.scaleMode = StageScaleMode.NO_SCALE;\n\t\t\t}\n\t\t\t\n\t\t\tthis.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);\n\t\t}\n\t\t\n\t\tprivate var _starling:Starling;\n\t\t\n\t\tprivate function start():void\n\t\t{\n\t\t\tthis.gotoAndStop(2);\n\t\t\tthis.graphics.clear();\n\n\t\t\t//simulating iPhone Retina\n\t\t\tDeviceCapabilities.dpi = 326;\n\t\t\t\n\t\t\tStarling.multitouchEnabled = true;\n\t\t\tvar MainType:Class = getDefinitionByName(\"feathers.examples.drawersExplorer.Main\") as Class;\n\t\t\tthis._starling = new Starling(MainType, this.stage, new Rectangle(0, 0, 960, 640));\n\t\t\tthis._starling.supportHighResolutions = true;\n\t\t\tthis._starling.skipUnchangedFrames = true;\n\t\t\tthis._starling.stage.stageWidth = 480;\n\t\t\tthis._starling.stage.stageHeight = 320;\n\t\t\tthis._starling.start();\n\t\t}\n\t\t\n\t\tprivate function loaderInfo_completeHandler(event:Event):void\n\t\t{\n\t\t\tthis.start();\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/DrawersExplorer/source/feathers/examples/drawersExplorer/Main.as",
    "content": "package feathers.examples.drawersExplorer\n{\n\timport feathers.controls.DragGesture;\n\timport feathers.controls.Drawers;\n\timport feathers.examples.drawersExplorer.skins.DrawersExplorerTheme;\n\timport feathers.examples.drawersExplorer.views.ContentView;\n\timport feathers.examples.drawersExplorer.views.DrawerView;\n\timport feathers.layout.Orientation;\n\n\timport starling.display.Sprite;\n\timport starling.events.Event;\n\n\tpublic class Main extends Sprite\n\t{\n\t\tpublic function Main()\n\t\t{\n\t\t\t//set up the theme right away!\n\t\t\tnew DrawersExplorerTheme();\n\t\t\tsuper();\n\t\t\tthis.addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);\n\t\t}\n\n\t\tprivate var _drawers:Drawers;\n\n\t\tprivate function changeDockMode(drawer:DrawerView, dockMode:String):void\n\t\t{\n\t\t\tswitch(drawer)\n\t\t\t{\n\t\t\t\tcase this._drawers.topDrawer:\n\t\t\t\t{\n\t\t\t\t\tthis._drawers.topDrawerDockMode = dockMode;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase this._drawers.rightDrawer:\n\t\t\t\t{\n\t\t\t\t\tthis._drawers.rightDrawerDockMode = dockMode;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase this._drawers.bottomDrawer:\n\t\t\t\t{\n\t\t\t\t\tthis._drawers.bottomDrawerDockMode = dockMode;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase this._drawers.leftDrawer:\n\t\t\t\t{\n\t\t\t\t\tthis._drawers.leftDrawerDockMode = dockMode;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tprivate function addedToStageHandler(event:Event):void\n\t\t{\n\t\t\tthis._drawers = new Drawers();\n\n\t\t\t//a drawer may be opened by dragging from the edge of the content\n\t\t\t//you can also set it to drag from anywhere inside the content\n\t\t\t//or you can disable gestures entirely and only open a drawer when\n\t\t\t//an event is dispatched by the content or by calling a function\n\t\t\t//on the drawer component to open a drawer programmatically.\n\t\t\tthis._drawers.openGesture = DragGesture.EDGE;\n\n\t\t\tthis._drawers.content = new ContentView();\n\t\t\t//these events are dispatched by the content\n\t\t\t//Drawers listens for each of these events and opens the drawer\n\t\t\t//associated with an event when it is dispatched\n\t\t\tthis._drawers.topDrawerToggleEventType = ContentView.TOGGLE_TOP_DRAWER;\n\t\t\tthis._drawers.rightDrawerToggleEventType = ContentView.TOGGLE_RIGHT_DRAWER;\n\t\t\tthis._drawers.bottomDrawerToggleEventType = ContentView.TOGGLE_BOTTOM_DRAWER;\n\t\t\tthis._drawers.leftDrawerToggleEventType = ContentView.TOGGLE_LEFT_DRAWER;\n\t\t\tthis._drawers.content.addEventListener(ContentView.OPEN_MODE_CHANGE, contentView_openDrawerChangeHandler);\n\n\t\t\tvar topDrawer:DrawerView = new DrawerView(\"Top\");\n\t\t\ttopDrawer.styleNameList.add(DrawersExplorerTheme.THEME_NAME_TOP_AND_BOTTOM_DRAWER);\n\t\t\ttopDrawer.addEventListener(DrawerView.CHANGE_DOCK_MODE_TO_NONE, drawer_dockNoneHandler);\n\t\t\ttopDrawer.addEventListener(DrawerView.CHANGE_DOCK_MODE_TO_BOTH, drawer_dockBothHandler);\n\t\t\t//a drawer may be any display object\n\t\t\tthis._drawers.topDrawer = topDrawer;\n\t\t\t//by default, a drawer is not docked. it may be opened and closed\n\t\t\t//based on user interaction or events dispatched by the content.\n\t\t\tthis._drawers.topDrawerDockMode = Orientation.NONE;\n\n\t\t\tvar rightDrawer:DrawerView = new DrawerView(\"Right\");\n\t\t\trightDrawer.styleNameList.add(DrawersExplorerTheme.THEME_NAME_LEFT_AND_RIGHT_DRAWER);\n\t\t\trightDrawer.addEventListener(DrawerView.CHANGE_DOCK_MODE_TO_NONE, drawer_dockNoneHandler);\n\t\t\trightDrawer.addEventListener(DrawerView.CHANGE_DOCK_MODE_TO_BOTH, drawer_dockBothHandler);\n\t\t\tthis._drawers.rightDrawer = rightDrawer;\n\t\t\tthis._drawers.rightDrawerDockMode = Orientation.NONE;\n\n\t\t\tvar bottomDrawer:DrawerView = new DrawerView(\"Bottom\");\n\t\t\tbottomDrawer.styleNameList.add(DrawersExplorerTheme.THEME_NAME_TOP_AND_BOTTOM_DRAWER);\n\t\t\tbottomDrawer.addEventListener(DrawerView.CHANGE_DOCK_MODE_TO_NONE, drawer_dockNoneHandler);\n\t\t\tbottomDrawer.addEventListener(DrawerView.CHANGE_DOCK_MODE_TO_BOTH, drawer_dockBothHandler);\n\t\t\tthis._drawers.bottomDrawer = bottomDrawer;\n\t\t\tthis._drawers.bottomDrawerDockMode = Orientation.NONE;\n\n\t\t\tvar leftDrawer:DrawerView = new DrawerView(\"Left\");\n\t\t\tleftDrawer.styleNameList.add(DrawersExplorerTheme.THEME_NAME_LEFT_AND_RIGHT_DRAWER);\n\t\t\tleftDrawer.addEventListener(DrawerView.CHANGE_DOCK_MODE_TO_NONE, drawer_dockNoneHandler);\n\t\t\tleftDrawer.addEventListener(DrawerView.CHANGE_DOCK_MODE_TO_BOTH, drawer_dockBothHandler);\n\t\t\tthis._drawers.leftDrawer = leftDrawer;\n\t\t\tthis._drawers.leftDrawerDockMode = Orientation.NONE;\n\n\t\t\tthis.addChild(this._drawers);\n\t\t}\n\n\t\tprivate function drawer_dockNoneHandler(event:Event):void\n\t\t{\n\t\t\tvar drawer:DrawerView = DrawerView(event.currentTarget);\n\t\t\tthis.changeDockMode(drawer, Orientation.NONE);\n\t\t}\n\n\t\tprivate function drawer_dockBothHandler(event:Event):void\n\t\t{\n\t\t\tvar drawer:DrawerView = DrawerView(event.currentTarget);\n\t\t\tthis.changeDockMode(drawer, Orientation.BOTH);\n\t\t}\n\t\t\n\t\tprivate function contentView_openDrawerChangeHandler(event:Event):void\n\t\t{\n\t\t\tvar content:ContentView = ContentView(event.currentTarget);\n\t\t\tthis._drawers.openMode = content.openMode;\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/DrawersExplorer/source/feathers/examples/drawersExplorer/skins/DrawersExplorerTheme.as",
    "content": "package feathers.examples.drawersExplorer.skins\n{\n\timport feathers.examples.drawersExplorer.views.ContentView;\n\timport feathers.examples.drawersExplorer.views.DrawerView;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.HorizontalLayout;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.themes.MetalWorksMobileTheme;\n\n\timport starling.display.Quad;\n\n\tpublic class DrawersExplorerTheme extends MetalWorksMobileTheme\n\t{\n\t\tpublic static const THEME_NAME_TOP_AND_BOTTOM_DRAWER:String = \"drawers-explorer-top-and-bottom-drawer\";\n\t\tpublic static const THEME_NAME_LEFT_AND_RIGHT_DRAWER:String = \"drawers-explorer-left-and-right-drawer\";\n\n\t\tpublic function DrawersExplorerTheme()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\toverride protected function initializeStyleProviders():void\n\t\t{\n\t\t\tsuper.initializeStyleProviders();\n\t\t\tthis.getStyleProviderForClass(ContentView).defaultStyleFunction = setContentViewStyles;\n\t\t\tthis.getStyleProviderForClass(DrawerView).setFunctionForStyleName(THEME_NAME_TOP_AND_BOTTOM_DRAWER, setTopAndBottomDrawerViewStyles);\n\t\t\tthis.getStyleProviderForClass(DrawerView).setFunctionForStyleName(THEME_NAME_LEFT_AND_RIGHT_DRAWER, setLeftAndRightDrawerViewStyles);\n\t\t}\n\n\t\tprotected function setContentViewStyles(view:ContentView):void\n\t\t{\n\t\t\t//don't forget to set styles from the super class, if required\n\t\t\tthis.setScrollerStyles(view);\n\t\t\t\n\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\tlayout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tlayout.padding = this.gutterSize;\n\t\t\tlayout.gap = this.gutterSize;\n\t\t\tview.layout = layout;\n\t\t}\n\n\t\tprotected function setLeftAndRightDrawerViewStyles(view:DrawerView):void\n\t\t{\n\t\t\t//don't forget to set styles from the super class, if required\n\t\t\tthis.setScrollerStyles(view);\n\t\t\t\n\t\t\tview.backgroundSkin = new Quad(10, 10, LIST_BACKGROUND_COLOR);\n\n\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\tlayout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tlayout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\tlayout.padding = this.smallGutterSize;\n\t\t\tlayout.gap = this.smallGutterSize;\n\t\t\tview.layout = layout;\n\t\t}\n\n\t\tprotected function setTopAndBottomDrawerViewStyles(view:DrawerView):void\n\t\t{\n\t\t\t//don't forget to set styles from the super class, if required\n\t\t\tthis.setScrollerStyles(view);\n\t\t\t\n\t\t\tview.backgroundSkin = new Quad(10, 10, GROUPED_LIST_HEADER_BACKGROUND_COLOR);\n\n\t\t\tvar layout:HorizontalLayout = new HorizontalLayout();\n\t\t\tlayout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tlayout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\tlayout.padding = this.smallGutterSize;\n\t\t\tlayout.gap = this.smallGutterSize;\n\t\t\tview.layout = layout;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/DrawersExplorer/source/feathers/examples/drawersExplorer/views/ContentView.as",
    "content": "package feathers.examples.drawersExplorer.views\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.List;\n\timport feathers.controls.Panel;\n\timport feathers.controls.PickerList;\n\timport feathers.controls.ScrollContainer;\n\timport feathers.data.ArrayCollection;\n\timport feathers.data.ListCollection;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.layout.RelativeDepth;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.skins.IStyleProvider;\n\n\timport starling.events.Event;\n\n\tpublic class ContentView extends ScrollContainer\n\t{\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\tpublic static const TOGGLE_TOP_DRAWER:String = \"toggleTopDrawer\";\n\t\tpublic static const TOGGLE_RIGHT_DRAWER:String = \"toggleRightDrawer\";\n\t\tpublic static const TOGGLE_BOTTOM_DRAWER:String = \"toggleBottomDrawer\";\n\t\tpublic static const TOGGLE_LEFT_DRAWER:String = \"toggleLeftDrawer\";\n\t\tpublic static const OPEN_MODE_CHANGE:String = \"openModeChange\";\n\n\t\tpublic function ContentView()\n\t\t{\n\n\t\t}\n\n\t\tprivate var _topButton:Button;\n\t\tprivate var _rightButton:Button;\n\t\tprivate var _bottomButton:Button;\n\t\tprivate var _leftButton:Button;\n\t\t\n\t\tprivate var _openModePicker:PickerList;\n\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn ContentView.globalStyleProvider;\n\t\t}\n\t\t\n\t\tprivate var _openMode:String = RelativeDepth.BELOW;\n\t\t\n\t\tpublic function get openMode():String\n\t\t{\n\t\t\treturn this._openMode;\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tvar openControlsPanel:Panel = new Panel();\n\t\t\topenControlsPanel.title = \"Open Drawers\";\n\t\t\topenControlsPanel.layout = new AnchorLayout();\n\t\t\tthis.addChild(openControlsPanel);\n\n\t\t\tthis._topButton = new Button();\n\t\t\tthis._topButton.label = \"Top\";\n\t\t\tthis._topButton.addEventListener(Event.TRIGGERED, topButton_triggeredHandler);\n\t\t\tvar topLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\ttopLayoutData.horizontalCenter = 0;\n\t\t\tthis._topButton.layoutData = topLayoutData;\n\t\t\topenControlsPanel.addChild(this._topButton);\n\n\t\t\tthis._rightButton = new Button();\n\t\t\tthis._rightButton.label = \"Right\";\n\t\t\tthis._rightButton.addEventListener(Event.TRIGGERED, rightButton_triggeredHandler);\n\t\t\tvar rightLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\trightLayoutData.verticalCenter = 0;\n\t\t\tthis._rightButton.layoutData = rightLayoutData;\n\t\t\topenControlsPanel.addChild(this._rightButton);\n\n\t\t\tthis._bottomButton = new Button();\n\t\t\tthis._bottomButton.label = \"Bottom\";\n\t\t\tthis._bottomButton.addEventListener(Event.TRIGGERED, bottomButton_triggeredHandler);\n\t\t\tvar bottomLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tbottomLayoutData.horizontalCenter = 0;\n\t\t\tthis._bottomButton.layoutData = bottomLayoutData;\n\t\t\topenControlsPanel.addChild(this._bottomButton);\n\n\t\t\tthis._leftButton = new Button();\n\t\t\tthis._leftButton.label = \"Left\";\n\t\t\tthis._leftButton.addEventListener(Event.TRIGGERED, leftButton_triggeredHandler);\n\t\t\tvar leftLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tleftLayoutData.verticalCenter = 0;\n\t\t\tthis._leftButton.layoutData = leftLayoutData;\n\t\t\topenControlsPanel.addChild(this._leftButton);\n\n\t\t\tthis._topButton.validate();\n\t\t\tvar verticalOffset:Number = this._topButton.height * 1.5;\n\t\t\ttopLayoutData.verticalCenter = -verticalOffset;\n\t\t\tbottomLayoutData.verticalCenter = verticalOffset;\n\n\t\t\tthis._rightButton.validate();\n\t\t\tvar horizontalOffset:Number = this._rightButton.width;\n\t\t\trightLayoutData.horizontalCenter = horizontalOffset;\n\t\t\tleftLayoutData.horizontalCenter = -horizontalOffset;\n\t\t\t\n\t\t\tvar optionsPanel:Panel = new Panel();\n\t\t\toptionsPanel.title = \"Options\";\n\t\t\toptionsPanel.layout = new VerticalLayout();\n\t\t\tthis.addChild(optionsPanel);\n\t\t\t\n\t\t\tthis._openModePicker = new PickerList();\n\t\t\tthis._openModePicker.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ label: \"Below\", data: RelativeDepth.BELOW },\n\t\t\t\t{ label: \"Above\", data: RelativeDepth.ABOVE },\n\t\t\t]);\n\t\t\tthis._openModePicker.addEventListener(Event.CHANGE, openModePicker_changeHandler);\n\n\t\t\tvar optionsList:List = new List();\n\t\t\toptionsList.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ label: \"Open Mode\", accessory: this._openModePicker },\n\t\t\t]);\n\t\t\toptionsPanel.addChild(optionsList);\n\t\t}\n\n\t\tprivate function topButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(TOGGLE_TOP_DRAWER);\n\t\t}\n\n\t\tprivate function rightButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(TOGGLE_RIGHT_DRAWER);\n\t\t}\n\n\t\tprivate function bottomButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(TOGGLE_BOTTOM_DRAWER);\n\t\t}\n\n\t\tprivate function leftButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(TOGGLE_LEFT_DRAWER);\n\t\t}\n\t\t\n\t\tprivate function openModePicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis._openMode = this._openModePicker.selectedItem.data as String;\n\t\t\tthis.dispatchEventWith(OPEN_MODE_CHANGE);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/DrawersExplorer/source/feathers/examples/drawersExplorer/views/DrawerView.as",
    "content": "package feathers.examples.drawersExplorer.views\n{\n\timport feathers.controls.Check;\n\timport feathers.controls.Label;\n\timport feathers.controls.ScrollContainer;\n\timport feathers.skins.IStyleProvider;\n\n\timport starling.events.Event;\n\n\tpublic class DrawerView extends ScrollContainer\n\t{\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\tpublic static const CHANGE_DOCK_MODE_TO_NONE:String = \"changeDockModeToNone\";\n\t\tpublic static const CHANGE_DOCK_MODE_TO_BOTH:String = \"changeDockModeToBoth\";\n\n\t\tpublic function DrawerView(title:String)\n\t\t{\n\t\t\tsuper();\n\t\t\tthis._title = title;\n\t\t}\n\n\t\tprivate var _title:String;\n\t\tprivate var _titleLabel:Label;\n\t\tprivate var _dockCheck:Check;\n\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn DrawerView.globalStyleProvider;\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis._titleLabel = new Label();\n\t\t\tthis._titleLabel.styleNameList.add(Label.ALTERNATE_STYLE_NAME_HEADING);\n\t\t\tthis._titleLabel.text = this._title;\n\t\t\tthis.addChild(this._titleLabel);\n\n\t\t\tthis._dockCheck = new Check();\n\t\t\tthis._dockCheck.isSelected = false;\n\t\t\tthis._dockCheck.label = \"Dock\";\n\t\t\tthis._dockCheck.addEventListener(Event.CHANGE, dockCheck_changeHandler);\n\t\t\tthis.addChild(this._dockCheck);\n\t\t}\n\n\t\tprivate function dockCheck_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._dockCheck.isSelected)\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(CHANGE_DOCK_MODE_TO_BOTH);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(CHANGE_DOCK_MODE_TO_NONE);\n\t\t\t}\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "examples/Gallery/README.md",
    "content": "# Gallery Example for Feathers\n\nDisplays a simple gallery of images from the [Flickr API](http://www.flickr.com/services/api/) using [Feathers](http://feathersui.com/). This example shows how to create lists with `SlideShowLayout` and `HorizontalLayout` with custom item renderers.\n\n## Requirements\n\nIn addition to Starling Framework and Feathers, this example project requires the `MetalWorksMobileTheme` example theme. You can find the SWC file for this theme at the following location in the Feathers release build:\n\n\tthemes/MetalWorksMobileTheme/swc/MetalWorksMobileTheme.swc\n\nAdditionally, you will need a [Flickr API key](https://www.flickr.com/services/apps/create/apply/). Pass in this API key by defining a conditional constant named `CONFIG::FLICKR_API_KEY`. If you are compiling with an IDE, conditional constants are usually defined somewhere in your project's settings. On the command line, you may use the `-define` compiler argument:\n\n\t-define+=CONFIG::FLICKR_API_KEY,'your flickr api key'"
  },
  {
    "path": "examples/Gallery/build.properties",
    "content": "feathers.root = ${basedir}/../../source\nstarling.root = ${basedir}/../../third-party/starling\ntheme.root = ${basedir}/../../themes/MetalWorksMobileTheme/source\noutput.path = ${basedir}/output\nicon.path = ${basedir}/../shared-assets/icons\nlaunch.image.path = ${basedir}/../shared-assets/launch-images-windowed\n\nswf.version = 30"
  },
  {
    "path": "examples/Gallery/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<project name=\"gallery\" default=\"build\" basedir=\".\">\n\t\n\t<!-- build.local.properties and sdk.local.proprties are optional files that\n\t\tcan be used to override the default properties. -->\n\t<property file=\"./build.local.properties\"/>\n\t<property file=\"./sdk.local.properties\"/>\n\t<property file=\"./build.properties\"/>\n\t<!-- inherit SDK properties from the root of the repository -->\n\t<property file=\"../../sdk.local.properties\"/>\n\t<property file=\"../../sdk.properties\"/>\n\n\t<fail unless=\"flickr.api.key\"/>\n\n\t<target name=\"build\" depends=\"build-android,build-ios\"/>\n\n\t<target name=\"prepare\">\n\t\t<delete dir=\"${output.path}\"/>\n\t</target>\n\n\t<target name=\"build-air-swf\" depends=\"prepare\">\n\t\t<echo message=\"Building Gallery.swf\"/>\n\t\t<java jar=\"${mxmlc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${airmobile.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"--define+=CONFIG::FLICKR_API_KEY,'${flickr.api.key}'\"/>\n\t\t\t<arg value=\"-source-path+=source\"/>\n\t\t\t<arg value=\"-source-path+=${starling.root}\"/>\n\t\t\t<arg value=\"-source-path+=${feathers.root}\"/>\n\t\t\t<arg value=\"-source-path+=${theme.root}\"/>\n\t\t\t<arg value=\"source/Gallery.as\"/>\n\t\t\t<arg value=\"-output=${output.path}/Gallery.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"-check-ios-properties\">\n\t\t<fail unless=\"ios.provision.path\"/>\n\t\t<fail unless=\"ios.certificate.path\"/>\n\t\t<fail unless=\"ios.certificate.password\"/>\n\t</target>\n\t<target name=\"build-ios\" depends=\"-check-ios-properties,build-air-swf\">\n\t\t<echo message=\"Packaging Gallery.ipa\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"-target\"/>\n\t\t\t<arg value=\"ipa-app-store\"/>\n\t\t\t<arg value=\"-provisioning-profile\"/>\n\t\t\t<arg value=\"${ios.provision.path}\"/>\n\t\t\t<arg value=\"-keystore\"/>\n\t\t\t<arg value=\"${ios.certificate.path}\"/>\n\t\t\t<arg value=\"-storetype\"/>\n\t\t\t<arg value=\"pkcs12\"/>\n\t\t\t<arg value=\"-storepass\"/>\n\t\t\t<arg value=\"${ios.certificate.password}\"/>\n\t\t\t<arg value=\"${output.path}/Gallery.ipa\"/>\n\t\t\t<arg value=\"source/Gallery-app.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${icon.path}\"/>\n\t\t\t<arg line=\"icon29.png icon48.png icon50.png icon57.png icon58.png icon72.png icon87.png icon96.png icon100.png icon114.png icon128.png icon144.png icon180.png\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${launch.image.path}\"/>\n\t\t\t<arg value=\"Default~iphone.png\"/>\t\t\t\t\t\t\t<!-- iphone 3gs -->\n\t\t\t<arg value=\"Default@2x~iphone.png\"/>\t\t\t\t\t\t<!-- iphone 4/4s -->\n\t\t\t<arg value=\"Default-568h@2x~iphone.png\"/>\t\t\t\t\t<!-- iphone 5/5c/5s -->\n\t\t\t<arg value=\"Default-375w-667h@2x~iphone.png\"/>\t\t\t\t<!-- iphone 6/7/8 -->\n\t\t\t<arg value=\"Default-812h@3x~iphone.png\"/>\t\t\t\t\t<!-- iphone x (portrait) -->\n\t\t\t<arg value=\"Default-Landscape-812h@3x~iphone.png\"/>\t\t\t<!-- iphone x (landscape) -->\n\t\t\t<arg value=\"Default-414w-736h@3x~iphone.png\"/>\t\t\t\t<!-- iphone 6/7/8 plus (portrait) -->\n\t\t\t<arg value=\"Default-Landscape-414w-736h@3x~iphone.png\"/>\t<!-- iphone 6/7/8 plus (landscape) -->\n\t\t\t<arg value=\"Default-Portrait~ipad.png\"/>\t\t\t\t\t<!-- ipad 1/2 (portrait) -->\n\t\t\t<arg value=\"Default-PortraitUpsideDown~ipad.png\"/>\t\t\t<!-- ipad 1/2 (portrait upside down) -->\n\t\t\t<arg value=\"Default-Landscape~ipad.png\"/>\t\t\t\t\t<!-- ipad 1/2 (landscape left) -->\n\t\t\t<arg value=\"Default-LandscapeRight~ipad.png\"/>\t\t\t\t<!-- ipad 1/2 (landscape right) -->\n\t\t\t<arg value=\"Default-Portrait@2x~ipad.png\"/>\t\t\t\t\t<!-- ipad 3/air (portrait) -->\n\t\t\t<arg value=\"Default-LandscapeLeft@2x~ipad.png\"/>\t\t\t<!-- ipad 3/air (landscape left) -->\n\t\t\t<arg value=\"Default-LandscapeRight@2x~ipad.png\"/>\t\t\t<!-- ipad 3/air (landscape right) -->\n\t\t\t<arg value=\"Default-Portrait@2x.png\"/>\t\t\t\t\t\t<!-- ipad pro (portrait) -->\n\t\t\t<arg value=\"Default-Landscape@2x.png\"/>\t\t\t\t\t\t<!-- ipad pro (landscape) -->\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${output.path}\"/>\n\t\t\t<arg value=\"Gallery.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"-check-android-properties\">\n\t\t<fail unless=\"android.certificate.path\"/>\n\t\t<fail unless=\"android.certificate.password\"/>\n\t</target>\n\t<target name=\"build-android\" depends=\"-check-android-properties,build-air-swf\">\n\t\t<echo message=\"Packaging Gallery.apk\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"-target\"/>\n\t\t\t<arg value=\"apk-captive-runtime\"/>\n\t\t\t<arg value=\"-storetype\"/>\n\t\t\t<arg value=\"pkcs12\"/>\n\t\t\t<arg value=\"-keystore\"/>\n\t\t\t<arg value=\"${android.certificate.path}\"/>\n\t\t\t<arg value=\"-storepass\"/>\n\t\t\t<arg value=\"${android.certificate.password}\"/>\n\t\t\t<arg value=\"${output.path}/Gallery.apk\"/>\n\t\t\t<arg value=\"source/Gallery-app.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${icon.path}\"/>\n\t\t\t<arg line=\"icon29.png icon48.png icon50.png icon57.png icon58.png icon72.png icon87.png icon96.png icon100.png icon114.png icon128.png icon144.png icon180.png\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${output.path}\"/>\n\t\t\t<arg value=\"Gallery.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"install-android\">\n\t\t<echo message=\"Installing Gallery.apk\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"false\">\n\t\t\t<arg value=\"-uninstallApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"android\"/>\n\t\t\t<arg value=\"-appid\"/>\n\t\t\t<arg value=\"com.feathersui.examples.Gallery\"/>\n\t\t</java>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-installApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"android\"/>\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"${output.path}/Gallery.apk\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"install-ios\">\n\t\t<echo message=\"Installing Gallery.ipa\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"false\">\n\t\t\t<arg value=\"-uninstallApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"iOS\"/>\n\t\t\t<arg value=\"-appid\"/>\n\t\t\t<arg value=\"com.feathersui.examples.Gallery\"/>\n\t\t</java>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-installApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"iOS\"/>\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"${output.path}/Gallery.ipa\"/>\n\t\t</java>\n\t</target>\n</project>"
  },
  {
    "path": "examples/Gallery/source/Gallery-app.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<application xmlns=\"http://ns.adobe.com/air/application/32.0\">\n\t<id>com.feathersui.examples.Gallery</id>\n\t<filename>Gallery</filename>\n\t<name>Gallery</name>\n\t<versionNumber>4.2.0</versionNumber>\n\t<description>Gallery example application built with Feathers UI controls for Starling</description>\n\t<copyright>2021 Bowler Hat LLC</copyright>\n\n\t<initialWindow>\n\t\t<content>Gallery.swf</content>\n\t\t<autoOrients>true</autoOrients>\n\t\t<fullScreen>false</fullScreen>\n\t\t<visible>true</visible>\n\t\t<renderMode>direct</renderMode>\n\t</initialWindow>\n\n\t<supportedLanguages>en</supportedLanguages>\n\n\t<icon>\n\t\t<image29x29>icon29.png</image29x29>\n\t\t<image48x48>icon48.png</image48x48>\n\t\t<image50x50>icon50.png</image50x50>\n\t\t<image57x57>icon57.png</image57x57>\n\t\t<image58x58>icon58.png</image58x58>\n\t\t<image72x72>icon72.png</image72x72>\n\t\t<image87x87>icon87.png</image87x87>\n\t\t<image96x96>icon96.png</image96x96>\n\t\t<image100x100>icon100.png</image100x100>\n\t\t<image114x114>icon114.png</image114x114>\n\t\t<image128x128>icon128.png</image128x128>\n\t\t<image144x144>icon144.png</image144x144>\n\t\t<image180x180>icon180.png</image180x180>\n\t</icon>\n\t<android>\n\t\t<colorDepth>16bit</colorDepth>\n\t\t<manifestAdditions><![CDATA[\n\t\t\t<manifest android:installLocation=\"auto\">\n\t\t\t    <uses-permission android:name=\"android.permission.INTERNET\"/>\n\t\t\t</manifest>\n\t\t]]></manifestAdditions>\n\t</android>\n\t<iPhone>\n\t\t<InfoAdditions>\n\t\t<![CDATA[\n\t\t\t<key>UIDeviceFamily</key> \n\t\t\t<array> \n\t\t\t\t<string>1</string>\n\t\t\t\t<string>2</string>\n\t\t\t</array>\n\t\t\t<key>UIPrerenderedIcon</key>\n\t\t\t<true/>\n\t\t\t<key>UIStatusBarStyle</key>\n\t\t\t<string>UIStatusBarStyleLightContent</string>\n\t\t]]> \n\t\t</InfoAdditions>\n\t\t<requestedDisplayResolution>high</requestedDisplayResolution>\n\t</iPhone>\n</application>"
  },
  {
    "path": "examples/Gallery/source/Gallery.as",
    "content": "package\n{\n\timport feathers.examples.gallery.Main;\n\timport feathers.utils.ScreenDensityScaleFactorManager;\n\n\timport flash.display.Loader;\n\timport flash.display.Sprite;\n\timport flash.display.StageAlign;\n\timport flash.display.StageOrientation;\n\timport flash.display.StageScaleMode;\n\timport flash.display3D.Context3DProfile;\n\timport flash.display3D.Context3DRenderMode;\n\timport flash.events.Event;\n\timport flash.filesystem.File;\n\timport flash.filesystem.FileMode;\n\timport flash.filesystem.FileStream;\n\timport flash.system.Capabilities;\n\timport flash.utils.ByteArray;\n\n\timport starling.core.Starling;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#4a4137\")]\n\tpublic class Gallery extends Sprite\n\t{\n\t\tpublic function Gallery()\n\t\t{\n\t\t\tif(this.stage)\n\t\t\t{\n\t\t\t\tthis.stage.scaleMode = StageScaleMode.NO_SCALE;\n\t\t\t\tthis.stage.align = StageAlign.TOP_LEFT;\n\t\t\t}\n\t\t\tthis.mouseEnabled = this.mouseChildren = false;\n\t\t\tthis.showLaunchImage();\n\t\t\tthis.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);\n\t\t}\n\n\t\tprivate var _starling:Starling;\n\t\tprivate var _scaler:ScreenDensityScaleFactorManager;\n\t\tprivate var _launchImage:Loader;\n\t\tprivate var _savedAutoOrients:Boolean;\n\n\t\t/**\n\t\t * On iOS, add the native launch image to the classic display list to\n\t\t * avoid displaying only the stage background color between when the\n\t\t * AIR app finishes launching and Starling starts rendering.\n\t\t * \n\t\t * Launch image names: https://forums.adobe.com/message/9986239#9986239\n\t\t */\n\t\tprivate function showLaunchImage():void\n\t\t{\n\t\t\tvar filePath:String = null;\n\t\t\tvar isPortraitOnly:Boolean = false;\n\t\t\tif(Capabilities.manufacturer.indexOf(\"iOS\") >= 0)\n\t\t\t{\n\t\t\t\tvar isPortraitUpsideDown:Boolean = this.stage.orientation == StageOrientation.UPSIDE_DOWN;\n\t\t\t\tvar isPortrait:Boolean = this.stage.orientation == StageOrientation.DEFAULT || isPortraitUpsideDown;\n\t\t\t\tvar isLandscapeRight:Boolean = this.stage.orientation == StageOrientation.ROTATED_RIGHT;\n\t\t\t\tif(Capabilities.screenResolutionX == 1242 && Capabilities.screenResolutionY == 2208)\n\t\t\t\t{\n\t\t\t\t\t//iphone 6/7/8 plus\n\t\t\t\t\tfilePath = isPortrait ? \"Default-414w-736h@3x~iphone.png\" : \"Default-Landscape-414w-736h@3x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 1125 && Capabilities.screenResolutionY == 2436)\n\t\t\t\t{\n\t\t\t\t\t//iphone x\n\t\t\t\t\tfilePath = isPortrait ? \"Default-812h@3x~iphone.png\" : \"Default-Landscape-812h@3x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 2048 && Capabilities.screenResolutionY == 2732)\n\t\t\t\t{\n\t\t\t\t\t//ipad pro\n\t\t\t\t\tfilePath = isPortrait ? \"Default-Portrait@2x.png\" : \"Default-Landscape@2x.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 1536 && Capabilities.screenResolutionY == 2048)\n\t\t\t\t{\n\t\t\t\t\t//ipad 3/air\n\t\t\t\t\tif(isPortraitUpsideDown)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Portrait@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isPortrait)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-PortraitUpsideDown@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isLandscapeRight)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeRight@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeLeft@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 768 && Capabilities.screenResolutionY == 1024)\n\t\t\t\t{\n\t\t\t\t\t//ipad 1/2\n\t\t\t\t\tif(isPortraitUpsideDown)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Portrait~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isPortrait)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-PortraitUpsideDown~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isLandscapeRight)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeRight~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Landscape~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 750)\n\t\t\t\t{\n\t\t\t\t\t//iphone 6/7/8\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tfilePath = \"Default-375w-667h@2x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 640)\n\t\t\t\t{\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tif(Capabilities.screenResolutionY == 1136)\n\t\t\t\t\t{\n\t\t\t\t\t\t//iphone 5/5c/5s\n\t\t\t\t\t\tfilePath = \"Default-568h@2x~iphone.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//iphone 4/4s\n\t\t\t\t\t\tfilePath = \"Default@2x~iphone.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 320)\n\t\t\t\t{\n\t\t\t\t\t//iphone 3gs\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tfilePath = \"Default~iphone.png\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(filePath)\n\t\t\t{\n\t\t\t\tvar file:File = File.applicationDirectory.resolvePath(filePath);\n\t\t\t\tif(file.exists)\n\t\t\t\t{\n\t\t\t\t\tvar bytes:ByteArray = new ByteArray();\n\t\t\t\t\tvar stream:FileStream = new FileStream();\n\t\t\t\t\tstream.open(file, FileMode.READ);\n\t\t\t\t\tstream.readBytes(bytes, 0, stream.bytesAvailable);\n\t\t\t\t\tstream.close();\n\t\t\t\t\tthis._launchImage = new Loader();\n\t\t\t\t\tthis._launchImage.loadBytes(bytes);\n\t\t\t\t\tthis.addChild(this._launchImage);\n\t\t\t\t\tthis._savedAutoOrients = this.stage.autoOrients;\n\t\t\t\t\tthis.stage.autoOrients = false;\n\t\t\t\t\tif(isPortraitOnly)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.stage.setOrientation(StageOrientation.DEFAULT);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function loaderInfo_completeHandler(event:Event):void\n\t\t{\n\t\t\tStarling.multitouchEnabled = true;\n\t\t\tthis._starling = new Starling(Main, this.stage, null, null, Context3DRenderMode.AUTO, Context3DProfile.BASELINE);\n\t\t\tthis._starling.supportHighResolutions = true;\n\t\t\tthis._starling.skipUnchangedFrames = true;\n\t\t\tthis._starling.simulateMultitouch = true;\n\t\t\tthis._starling.start();\n\t\t\tif(this._launchImage)\n\t\t\t{\n\t\t\t\tthis._starling.addEventListener(\"rootCreated\", starling_rootCreatedHandler);\n\t\t\t}\n\t\t\tthis._scaler = new ScreenDensityScaleFactorManager(this._starling);\n\n\t\t\tthis.stage.addEventListener(Event.DEACTIVATE, stage_deactivateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function starling_rootCreatedHandler(event:Object):void\n\t\t{\n\t\t\tif(this._launchImage)\n\t\t\t{\n\t\t\t\tthis.removeChild(this._launchImage);\n\t\t\t\tthis._launchImage.unloadAndStop(true);\n\t\t\t\tthis._launchImage = null;\n\t\t\t\tthis.stage.autoOrients = this._savedAutoOrients;\n\t\t\t}\n\t\t}\n\n\t\tprivate function stage_deactivateHandler(event:Event):void\n\t\t{\n\t\t\tthis._starling.stop(true);\n\t\t\tthis.stage.addEventListener(Event.ACTIVATE, stage_activateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function stage_activateHandler(event:Event):void\n\t\t{\n\t\t\tthis.stage.removeEventListener(Event.ACTIVATE, stage_activateHandler);\n\t\t\tthis._starling.start();\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "examples/Gallery/source/feathers/examples/gallery/Main.as",
    "content": "package feathers.examples.gallery\n{\n\timport feathers.controls.DecelerationRate;\n\timport feathers.controls.Label;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.List;\n\timport feathers.controls.ScrollBarDisplayMode;\n\timport feathers.controls.ScrollPolicy;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.renderers.IListItemRenderer;\n\timport feathers.data.VectorCollection;\n\timport feathers.events.FeathersEventType;\n\timport feathers.examples.gallery.controls.GalleryItemRenderer;\n\timport feathers.examples.gallery.controls.ThumbItemRenderer;\n\timport feathers.examples.gallery.data.GalleryItem;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.HorizontalLayout;\n\timport feathers.layout.SlideShowLayout;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.themes.MetalWorksMobileTheme;\n\timport feathers.utils.textures.TextureCache;\n\n\timport flash.events.Event;\n\timport flash.events.IOErrorEvent;\n\timport flash.events.SecurityErrorEvent;\n\timport flash.net.URLLoader;\n\timport flash.net.URLRequest;\n\n\timport starling.animation.Transitions;\n\timport starling.animation.Tween;\n\timport starling.core.Starling;\n\timport starling.events.Event;\n\n\tpublic class Main extends LayoutGroup\n\t{\n\t\tprivate static const FLICKR_URL:String = \"https://api.flickr.com/services/rest/?method=flickr.interestingness.getList&api_key=\" + CONFIG::FLICKR_API_KEY + \"&format=rest\";\n\t\tprivate static const FLICKR_PHOTO_URL:String = \"https://farm{farm-id}.staticflickr.com/{server-id}/{id}_{secret}_{size}.jpg\";\n\n\t\tpublic function Main()\n\t\t{\n\t\t\t//set up the theme right away!\n\t\t\t//this is an *extended* version of MetalWorksMobileTheme\n\t\t\tnew MetalWorksMobileTheme();\n\t\t\tsuper();\n\t\t}\n\n\t\tprotected var fullSizeList:List;\n\t\tprotected var thumbnailList:List;\n\t\tprotected var message:Label;\n\t\tprotected var apiLoader:URLLoader;\n\t\tprotected var thumbnailTextureCache:TextureCache;\n\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this.thumbnailTextureCache)\n\t\t\t{\n\t\t\t\tthis.thumbnailTextureCache.dispose();\n\t\t\t\tthis.thumbnailTextureCache = null;\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//don't forget to call super.initialize() when you override it!\n\t\t\tsuper.initialize();\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\t//keep some thumbnails in memory so that they don't need to be\n\t\t\t//reloaded from the web\n\t\t\tthis.thumbnailTextureCache = new TextureCache(30);\n\n\t\t\tthis.apiLoader = new URLLoader();\n\t\t\tthis.apiLoader.addEventListener(flash.events.Event.COMPLETE, apiLoader_completeListener);\n\t\t\tthis.apiLoader.addEventListener(IOErrorEvent.IO_ERROR, apiLoader_errorListener);\n\t\t\tthis.apiLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, apiLoader_errorListener);\n\t\t\tthis.apiLoader.load(new URLRequest(FLICKR_URL));\n\n\t\t\t//the thumbnail list is positioned on the bottom edge of the app\n\t\t\t//and fills the entire width\n\t\t\tvar thumbnailListLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tthumbnailListLayoutData.left = 0;\n\t\t\tthumbnailListLayoutData.right = 0;\n\t\t\tthumbnailListLayoutData.bottom = 0;\n\n\t\t\tvar thumbnailListLayout:HorizontalLayout = new HorizontalLayout();\n\t\t\tthumbnailListLayout.verticalAlign = VerticalAlign.JUSTIFY;\n\t\t\tthumbnailListLayout.hasVariableItemDimensions = true;\n\n\t\t\tthis.thumbnailList = new List();\n\t\t\tthis.thumbnailList.layout = thumbnailListLayout;\n\t\t\t//make sure that we have elastic edges horizontally\n\t\t\tthis.thumbnailList.horizontalScrollPolicy = ScrollPolicy.ON;\n\t\t\t//we're not displaying scroll bars\n\t\t\tthis.thumbnailList.scrollBarDisplayMode = ScrollBarDisplayMode.NONE;\n\t\t\t//make a swipe scroll a shorter distance\n\t\t\tthis.thumbnailList.decelerationRate = DecelerationRate.FAST;\n\t\t\tthis.thumbnailList.itemRendererFactory = thumbnailItemRendererFactory;\n\t\t\tthis.thumbnailList.addEventListener(starling.events.Event.CHANGE, thumbnailList_changeHandler);\n\t\t\tthis.thumbnailList.height = 100;\n\t\t\tthis.thumbnailList.layoutData = thumbnailListLayoutData;\n\t\t\tthis.addChild(this.thumbnailList);\n\n\t\t\t//the full size list fills the remaining space above the thumbnails\n\t\t\tvar fullSizeListLayoutData:AnchorLayoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tfullSizeListLayoutData.bottomAnchorDisplayObject = this.thumbnailList;\n\n\t\t\t//show a single item per page\n\t\t\tvar fullSizeListLayout:SlideShowLayout = new SlideShowLayout();\n\t\t\tfullSizeListLayout.horizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\tfullSizeListLayout.verticalAlign = VerticalAlign.JUSTIFY;\n\t\t\t//load the previous and next items so that they are already visible\n\t\t\t//if images use a lot of memory, this might not be possible for\n\t\t\t//some galleries!\n\t\t\tfullSizeListLayout.minimumItemCount = 3;\n\n\t\t\tthis.fullSizeList = new List();\n\t\t\t//snap to the nearest page when scrolling\n\t\t\tthis.fullSizeList.snapToPages = true;\n\t\t\t//there is nothing to select in this list\n\t\t\tthis.fullSizeList.isSelectable = false;\n\t\t\t//no need to display scroll bars in this list\n\t\t\tthis.fullSizeList.scrollBarDisplayMode = ScrollBarDisplayMode.NONE;\n\t\t\t//make sure that we have elastic edges horizontally\n\t\t\tthis.fullSizeList.horizontalScrollPolicy = ScrollPolicy.ON;\n\t\t\tthis.fullSizeList.layout = fullSizeListLayout;\n\t\t\tthis.fullSizeList.layoutData = fullSizeListLayoutData;\n\t\t\tthis.fullSizeList.itemRendererFactory = fullSizeItemRendererFactory;\n\t\t\tthis.addChild(this.fullSizeList);\n\n\t\t\t//display at the center of the list of full size images\n\t\t\tvar messageLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tmessageLayoutData.horizontalCenter = 0;\n\t\t\tmessageLayoutData.verticalCenter = 0;\n\t\t\tmessageLayoutData.verticalCenterAnchorDisplayObject = this.fullSizeList;\n\n\t\t\tthis.message = new Label();\n\t\t\tthis.message.text = \"Loading...\";\n\t\t\tthis.message.layoutData = messageLayoutData;\n\t\t\tthis.addChild(this.message);\n\t\t}\n\n\t\tprotected function fullSizeItemRendererFactory():IListItemRenderer\n\t\t{\n\t\t\treturn new GalleryItemRenderer();\n\t\t}\n\n\t\tprotected function thumbnailItemRendererFactory():IListItemRenderer\n\t\t{\n\t\t\tvar itemRenderer:ThumbItemRenderer = new ThumbItemRenderer();\n\t\t\t//cache the textures so that they don't need to be reloaded from URLs\n\t\t\titemRenderer.textureCache = this.thumbnailTextureCache;\n\t\t\t//limit how large these item renderers can be\n\t\t\titemRenderer.maxWidth = 100;\n\t\t\titemRenderer.maxHeight = 100;\n\t\t\treturn itemRenderer;\n\t\t}\n\n\t\tprotected function thumbnailList_changeHandler(event:starling.events.Event):void\n\t\t{\n\t\t\tvar item:GalleryItem = GalleryItem(this.thumbnailList.selectedItem);\n\t\t\tif(!item)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.fullSizeList.scrollToDisplayIndex(this.thumbnailList.selectedIndex, 0.5);\n\t\t}\n\n\t\tprotected function apiLoader_completeListener(event:flash.events.Event):void\n\t\t{\n\t\t\tvar result:XML = XML(this.apiLoader.data);\n\t\t\tif(result.attribute(\"stat\") == \"fail\")\n\t\t\t{\n\t\t\t\tmessage.text = \"Unable to load the list of images from Flickr at this time.\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar items:Vector.<GalleryItem> = new <GalleryItem>[];\n\t\t\tvar photosList:XMLList = result.photos.photo;\n\t\t\tvar photoCount:int = photosList.length();\n\t\t\tfor(var i:int = 0; i < photoCount; i++)\n\t\t\t{\n\t\t\t\tvar photoXML:XML = photosList[i];\n\t\t\t\tvar url:String = FLICKR_PHOTO_URL.replace(\"{farm-id}\", photoXML.@farm.toString());\n\t\t\t\turl = url.replace(\"{server-id}\", photoXML.@server.toString());\n\t\t\t\turl = url.replace(\"{id}\", photoXML.@id.toString());\n\t\t\t\turl = url.replace(\"{secret}\", photoXML.@secret.toString());\n\t\t\t\tvar thumbURL:String = url.replace(\"{size}\", \"t\");\n\t\t\t\turl = url.replace(\"{size}\", \"b\");\n\t\t\t\tvar title:String = photoXML.@title.toString();\n\t\t\t\titems.push(new GalleryItem(title, url, thumbURL));\n\t\t\t}\n\n\t\t\tthis.message.text = \"\";\n\n\t\t\tvar collection:VectorCollection = new VectorCollection(items);\n\t\t\tthis.thumbnailList.dataProvider = collection;\n\t\t\tthis.fullSizeList.dataProvider = collection;\n\t\t}\n\n\t\tprotected function apiLoader_errorListener(event:flash.events.Event):void\n\t\t{\n\t\t\tthis.message.text = \"Error loading images.\";\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/Gallery/source/feathers/examples/gallery/controls/GalleryItemRenderer.as",
    "content": "package feathers.examples.gallery.controls\n{\n\timport feathers.controls.ImageLoader;\n\timport feathers.controls.List;\n\timport feathers.controls.ScrollBarDisplayMode;\n\timport feathers.controls.ScrollContainer;\n\timport feathers.controls.ScrollPolicy;\n\timport feathers.controls.renderers.IListItemRenderer;\n\timport feathers.core.FeathersControl;\n\timport feathers.events.FeathersEventType;\n\timport feathers.examples.gallery.data.GalleryItem;\n\timport feathers.examples.gallery.layout.GalleryItemRendererLayout;\n\timport feathers.layout.ILayout;\n\timport feathers.utils.display.calculateScaleRatioToFit;\n\timport feathers.utils.touch.TapToSelect;\n\timport feathers.utils.touch.TouchSheet;\n\n\timport flash.geom.Point;\n\timport flash.utils.Dictionary;\n\n\timport starling.animation.Transitions;\n\timport starling.animation.Tween;\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\t/**\n\t * A list item renderer that displays an image that may be zoomed.\n\t */\n\tpublic class GalleryItemRenderer extends ScrollContainer implements IListItemRenderer\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function GalleryItemRenderer()\n\t\t{\n\t\t\tsuper();\n\t\t\t//the default layout for a scroll container doesn't work well when\n\t\t\t//TouchSheet gestures move it into negative coordinates.\n\t\t\tthis.layout = new GalleryItemRendererLayout();\n\t\t\t//when we reach the edge, we want to stop without elasticity\n\t\t\tthis.hasElasticEdges = false;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var touchSheet:TouchSheet = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var image:ImageLoader = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _index:int = -1;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get index():int\n\t\t{\n\t\t\treturn this._index;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set index(value:int):void\n\t\t{\n\t\t\tif(this._index == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._index = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _factoryID:String = null;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get factoryID():String\n\t\t{\n\t\t\treturn this._factoryID;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set factoryID(value:String):void\n\t\t{\n\t\t\tthis._factoryID = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _owner:List = null;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get owner():List\n\t\t{\n\t\t\treturn List(this._owner);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set owner(value:List):void\n\t\t{\n\t\t\tif(this._owner == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._owner !== null)\n\t\t\t{\n\t\t\t\tthis._owner.removeEventListener(FeathersEventType.SCROLL_COMPLETE, owner_scrollCompleteHandler);\n\t\t\t}\n\t\t\tthis._owner = value;\n\t\t\tif(this._owner !== null)\n\t\t\t{\n\t\t\t\tthis._owner.addEventListener(FeathersEventType.SCROLL_COMPLETE, owner_scrollCompleteHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _data:GalleryItem = null;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get data():Object\n\t\t{\n\t\t\treturn this._data;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set data(value:Object):void\n\t\t{\n\t\t\tif(this._data == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._data = GalleryItem(value);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _isSelected:Boolean;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get isSelected():Boolean\n\t\t{\n\t\t\treturn this._isSelected;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isSelected(value:Boolean):void\n\t\t{\n\t\t\tif(this._isSelected == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isSelected = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * If the scale value is less than this after a zoom gesture ends, the\n\t\t * scale will be animated back to this value. The default scale may be\n\t\t * updated when a new texture is loaded.\n\t\t */\n\t\tprotected var _defaultScale:Number = 1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n        protected var _gestureCompleteTween:Tween = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function hitTest(localPoint:Point):DisplayObject\n\t\t{\n\t\t\tvar target:DisplayObject = super.hitTest(localPoint);\n\t\t\tif(target === this)\n\t\t\t{\n\t\t\t\t//the TouchSheet may not fill the entire width and height of\n\t\t\t\t//the item renderer, but we want the gestures to work from\n\t\t\t\t//anywhere within the item renderer's bounds.\n\t\t\t\treturn this.touchSheet;\n\t\t\t}\n\t\t\treturn target;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tsuper.initialize();\n\n\t\t\tthis.image = new ImageLoader();\n\t\t\tthis.image.addEventListener(Event.COMPLETE, image_completeHandler);\n\t\t\tthis.image.addEventListener(FeathersEventType.ERROR, image_errorHandler);\n\n\t\t\t//this is a custom version of TouchSheet designed to work better\n\t\t\t//with Feathers scrolling containers\n\t\t\tthis.touchSheet = new TouchSheet(this.image);\n\t\t\t//you can disable certain features of this TouchSheet\n\t\t\tthis.touchSheet.zoomEnabled = true;\n\t\t\tthis.touchSheet.rotateEnabled = false;\n\t\t\tthis.touchSheet.moveEnabled = false;\n\t\t\t//and events are dispatched when any of the gestures are performed\n\t\t\tthis.touchSheet.addEventListener(TouchSheet.MOVE, touchSheet_gestureHandler);\n\t\t\tthis.touchSheet.addEventListener(TouchSheet.ROTATE, touchSheet_gestureHandler);\n\t\t\tthis.touchSheet.addEventListener(TouchSheet.ZOOM, touchSheet_gestureHandler);\n\t\t\t//on TouchPhase.ENDED, any gestures performed are complete\n\t\t\tthis.touchSheet.addEventListener(TouchEvent.TOUCH, touchSheet_touchHandler);\n\t\t\tthis.addChild(this.touchSheet);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tif(dataInvalid)\n\t\t\t{\n\t\t\t\tif(this._data !== null)\n\t\t\t\t{\n\t\t\t\t\tif(this.image.source !== this._data.url)\n\t\t\t\t\t{\n\t\t\t\t\t\t//hide until the image finishes loading\n\t\t\t\t\t\tthis.touchSheet.visible = false;\n\t\t\t\t\t}\n\t\t\t\t\tthis.image.source = this._data.url;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.image.source = null;\n\t\t\t\t}\n\t\t\t\t//stop any active animations because it's a new image\n\t\t\t\tif(this._gestureCompleteTween !== null)\n\t\t\t\t{\n\t\t\t\t\tthis.stage.starling.juggler.remove(this._gestureCompleteTween);\n\t\t\t\t\tthis._gestureCompleteTween = null;\n\t\t\t\t}\n\t\t\t\t//reset all of the transformations because it's a new image\n\t\t\t\tthis._defaultScale = 1;\n\t\t\t\tthis.resetTransformation();\n\t\t\t}\n\n\t\t\tsuper.draw();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function resetTransformation():void\n\t\t{\n\t\t\tthis.touchSheet.rotation = 0;\n\t\t\tthis.touchSheet.scale = this._defaultScale;\n\t\t\tthis.touchSheet.pivotX = 0;\n\t\t\tthis.touchSheet.pivotY = 0;\n\t\t\tthis.touchSheet.x = 0;\n\t\t\tthis.touchSheet.y = 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function image_completeHandler(event:Event):void\n\t\t{\n\t\t\t//when an image first loads, we want it to fill the width and height\n\t\t\t//of the item renderer, without being larger than the item renderer\n\t\t\tthis._defaultScale = calculateScaleRatioToFit(\n\t\t\t\tthis.image.originalSourceWidth, this.image.originalSourceHeight,\n\t\t\t\tthis.viewPort.visibleWidth, this.viewPort.visibleHeight);\n\t\t\tif(this._defaultScale > 1)\n\t\t\t{\n\t\t\t\t//however, we only want to make large images smaller. small\n\t\t\t\t//images should not be made larger because they'll get blurry.\n\t\t\t\t//the user can zoom in, if desired.\n\t\t\t\tthis._defaultScale = 1;\n\t\t\t}\n\t\t\tthis.touchSheet.scale = this._defaultScale;\n\t\t\tthis.touchSheet.visible = true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function image_errorHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function touchSheet_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\t//the current gesture is complete on TouchPhase.ENDED\n\t\t\tvar touch:Touch = event.getTouch(this.touchSheet, TouchPhase.ENDED);\n\t\t\tif(touch === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//if the scale is smaller than the default, animate it back\n\t\t\tvar targetScale:Number = this.touchSheet.scale;\n\t\t\tif(targetScale < this._defaultScale)\n\t\t\t{\n\t\t\t\ttargetScale = this._defaultScale;\n\t\t\t}\n\t\t\tif(this.touchSheet.scale !== targetScale)\n\t\t\t{\n\t\t\t\tthis._gestureCompleteTween = new Tween(this.touchSheet, 0.15, Transitions.EASE_OUT);\n\t\t\t\tthis._gestureCompleteTween.scaleTo(targetScale);\n\t\t\t\tthis._gestureCompleteTween.onComplete = this.gestureCompleteTween_onComplete;\n\t\t\t\tthis.stage.starling.juggler.add(this._gestureCompleteTween);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function touchSheet_gestureHandler(event:Event):void\n\t\t{\n\t\t\t//if the animation from the previous gesture is still active, stop\n\t\t\t//it immediately when a new gesture starts\n\t\t\tif(this._gestureCompleteTween !== null)\n\t\t\t{\n\t\t\t\tthis.stage.starling.juggler.remove(this._gestureCompleteTween);\n\t\t\t\tthis._gestureCompleteTween = null;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function gestureCompleteTween_onComplete():void\n\t\t{\n\t\t\tthis._gestureCompleteTween = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function owner_scrollCompleteHandler(event:Event):void\n\t\t{\n\t\t\tif(this._owner.horizontalPageIndex === this._index)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.resetTransformation();\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/Gallery/source/feathers/examples/gallery/controls/ThumbItemRenderer.as",
    "content": "package feathers.examples.gallery.controls\n{\n\timport feathers.controls.ImageLoader;\n\timport feathers.controls.List;\n\timport feathers.controls.renderers.IListItemRenderer;\n\timport feathers.core.FeathersControl;\n\timport feathers.events.FeathersEventType;\n\timport feathers.examples.gallery.data.GalleryItem;\n\timport feathers.utils.textures.TextureCache;\n\timport feathers.utils.touch.TapToSelect;\n\n\timport flash.geom.Point;\n\timport flash.utils.Dictionary;\n\n\timport starling.animation.Transitions;\n\timport starling.animation.Tween;\n\timport starling.core.Starling;\n\timport starling.events.Event;\n\n\t/**\n\t * Renders a simple thumbnail image with animation to fade in when it\n\t * completes loading.\n\t */\n\tpublic class ThumbItemRenderer extends FeathersControl implements IListItemRenderer\n\t{\n\t\t/**\n\t\t * @private\n\t\t * This will only work in a single list. If this item renderer needs to\n\t\t * be used by multiple lists, this data should be stored differently.\n\t\t */\n\t\tprivate static const CACHED_BOUNDS:Dictionary = new Dictionary(false);\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function ThumbItemRenderer()\n\t\t{\n\t\t\t//optimization: this item renderer doesn't have interactive children\n\t\t\tthis.isQuickHitAreaEnabled = true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var image:ImageLoader;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var fadeTween:Tween;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _index:int = -1;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get index():int\n\t\t{\n\t\t\treturn this._index;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set index(value:int):void\n\t\t{\n\t\t\tif(this._index == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._index = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _factoryID:String;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get factoryID():String\n\t\t{\n\t\t\treturn this._factoryID;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set factoryID(value:String):void\n\t\t{\n\t\t\tthis._factoryID = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _owner:List;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get owner():List\n\t\t{\n\t\t\treturn List(this._owner);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set owner(value:List):void\n\t\t{\n\t\t\tif(this._owner == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._owner)\n\t\t\t{\n\t\t\t\tthis._owner.removeEventListener(FeathersEventType.SCROLL_START, owner_scrollStartHandler);\n\t\t\t\tthis._owner.removeEventListener(FeathersEventType.SCROLL_COMPLETE, owner_scrollCompleteHandler);\n\t\t\t}\n\t\t\tthis._owner = value;\n\t\t\tif(this._owner)\n\t\t\t{\n\t\t\t\tif(this.image)\n\t\t\t\t{\n\t\t\t\t\tthis.image.delayTextureCreation = this._owner.isScrolling;\n\t\t\t\t}\n\t\t\t\tthis._owner.addEventListener(FeathersEventType.SCROLL_START, owner_scrollStartHandler);\n\t\t\t\tthis._owner.addEventListener(FeathersEventType.SCROLL_COMPLETE, owner_scrollCompleteHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _tapToSelect:TapToSelect;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _data:GalleryItem;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get data():Object\n\t\t{\n\t\t\treturn this._data;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set data(value:Object):void\n\t\t{\n\t\t\tif(this._data == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._data = GalleryItem(value);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _isSelected:Boolean;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get isSelected():Boolean\n\t\t{\n\t\t\treturn this._isSelected;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isSelected(value:Boolean):void\n\t\t{\n\t\t\tif(this._isSelected == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isSelected = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _textureCache:TextureCache;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get textureCache():TextureCache\n\t\t{\n\t\t\treturn this._textureCache;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set textureCache(value:TextureCache):void\n\t\t{\n\t\t\tif(this._textureCache == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textureCache = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tsuper.initialize();\n\n\t\t\tthis.image = new ImageLoader();\n\t\t\tthis.image.textureQueueDuration = 0.25;\n\t\t\tthis.image.addEventListener(Event.COMPLETE, image_completeHandler);\n\t\t\tthis.image.addEventListener(FeathersEventType.ERROR, image_errorHandler);\n\t\t\tthis.addChild(this.image);\n\n\t\t\tthis._tapToSelect = new TapToSelect(this);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\n\t\t\tthis.image.textureCache = this._textureCache;\n\n\t\t\tif(dataInvalid)\n\t\t\t{\n\t\t\t\tif(this.fadeTween)\n\t\t\t\t{\n\t\t\t\t\tthis.fadeTween.advanceTime(Number.MAX_VALUE);\n\t\t\t\t}\n\t\t\t\tif(this._data)\n\t\t\t\t{\n\t\t\t\t\tthis.image.visible = false;\n\t\t\t\t\tthis.image.source = this._data.thumbURL;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.image.source = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.autoSizeIfNeeded();\n\t\t\tthis.layoutChildren();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = isNaN(this._explicitWidth);\n\t\t\tvar needsHeight:Boolean = isNaN(this._explicitHeight);\n\t\t\tvar needsMinWidth:Boolean = isNaN(this._explicitMinWidth);\n\t\t\tvar needsMinHeight:Boolean = isNaN(this._explicitMinHeight);\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t//pass all of these values down to the ImageLoader\n\t\t\t//because they can affect its measured dimensions\n\t\t\tthis.image.width = this._explicitWidth;\n\t\t\tthis.image.height = this._explicitHeight;\n\t\t\tthis.image.minWidth = this._explicitMinWidth;\n\t\t\tthis.image.minHeight = this._explicitMinHeight;\n\t\t\tthis.image.maxWidth = this._explicitMaxWidth;\n\t\t\tthis.image.maxHeight = this._explicitMaxHeight;\n\t\t\tthis.image.validate();\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tif(this.image.isLoaded)\n\t\t\t\t{\n\t\t\t\t\tif(!CACHED_BOUNDS.hasOwnProperty(this._index))\n\t\t\t\t\t{\n\t\t\t\t\t\tCACHED_BOUNDS[this._index] = new Point();\n\t\t\t\t\t}\n\t\t\t\t\tvar boundsFromCache:Point = Point(CACHED_BOUNDS[this._index]);\n\t\t\t\t\t//also save it to a cache so that we can reuse the width and\n\t\t\t\t\t//height values later if the same image needs to be loaded\n\t\t\t\t\t//again.\n\t\t\t\t\tnewWidth = boundsFromCache.x = this.image.width;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(CACHED_BOUNDS.hasOwnProperty(this._index))\n\t\t\t\t\t{\n\t\t\t\t\t\t//if the image isn't loaded yet, but we've loaded it at\n\t\t\t\t\t\t//least once before, we can use a cached value to avoid\n\t\t\t\t\t\t//jittering when the image resizes\n\t\t\t\t\t\tboundsFromCache = Point(CACHED_BOUNDS[this._index]);\n\t\t\t\t\t\tnewWidth = boundsFromCache.x;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//default to 100 if we've never displayed an image for\n\t\t\t\t\t\t//this index yet.\n\t\t\t\t\t\tnewWidth = 100;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tif(this.image.isLoaded)\n\t\t\t\t{\n\t\t\t\t\tif(!CACHED_BOUNDS.hasOwnProperty(this._index))\n\t\t\t\t\t{\n\t\t\t\t\t\tCACHED_BOUNDS[this._index] = new Point();\n\t\t\t\t\t}\n\t\t\t\t\tboundsFromCache = Point(CACHED_BOUNDS[this._index]);\n\t\t\t\t\tnewHeight = boundsFromCache.y = this.image.height;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(CACHED_BOUNDS.hasOwnProperty(this._index))\n\t\t\t\t\t{\n\t\t\t\t\t\tboundsFromCache = Point(CACHED_BOUNDS[this._index]);\n\t\t\t\t\t\tnewHeight = boundsFromCache.y;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewHeight = 100;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newWidth, newHeight);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutChildren():void\n\t\t{\n\t\t\tthis.image.width = this.actualWidth;\n\t\t\tthis.image.height = this.actualHeight;\n\t\t\tthis.image.validate();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function fadeTween_onComplete():void\n\t\t{\n\t\t\tthis.fadeTween = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function owner_scrollStartHandler(event:Event):void\n\t\t{\n\t\t\tthis.image.delayTextureCreation = true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function owner_scrollCompleteHandler(event:Event):void\n\t\t{\n\t\t\tthis.image.delayTextureCreation = false;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function image_completeHandler(event:Event):void\n\t\t{\n\t\t\tthis.image.alpha = 0;\n\t\t\tthis.image.visible = true;\n\t\t\tthis.fadeTween = new Tween(this.image, 1, Transitions.EASE_OUT);\n\t\t\tthis.fadeTween.fadeTo(1);\n\t\t\tthis.fadeTween.onComplete = fadeTween_onComplete;\n\t\t\tStarling.juggler.add(this.fadeTween);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\tprotected function image_errorHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "examples/Gallery/source/feathers/examples/gallery/data/GalleryItem.as",
    "content": "package feathers.examples.gallery.data\n{\n\tpublic class GalleryItem\n\t{\n\t\tpublic function GalleryItem(title:String, url:String, thumbURL:String)\n\t\t{\n\t\t\tthis.title = title;\n\t\t\tthis.url = url;\n\t\t\tthis.thumbURL = thumbURL;\n\t\t}\n\n\t\tpublic var title:String;\n\t\tpublic var url:String;\n\t\tpublic var thumbURL:String;\n\t}\n}\n"
  },
  {
    "path": "examples/Gallery/source/feathers/examples/gallery/layout/GalleryItemRendererLayout.as",
    "content": "package feathers.examples.gallery.layout\n{\n\timport feathers.layout.ILayout;\n\timport feathers.layout.LayoutBoundsResult;\n\timport feathers.layout.ViewPortBounds;\n\n\timport flash.errors.IllegalOperationError;\n\timport flash.geom.Point;\n\timport flash.geom.Rectangle;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.EventDispatcher;\n\timport starling.utils.Pool;\n\n\tpublic class GalleryItemRendererLayout extends EventDispatcher implements ILayout\n\t{\n\t\tpublic function GalleryItemRendererLayout()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic function get requiresLayoutOnScroll():Boolean\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic function layout(items:Vector.<DisplayObject>, viewPortBounds:ViewPortBounds = null, result:LayoutBoundsResult = null):LayoutBoundsResult\n\t\t{\n\t\t\tvar itemCount:int = items.length;\n\t\t\tif(itemCount > 1)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"GalleryItemLayout may not have more than one item.\");\n\t\t\t}\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new LayoutBoundsResult();\n\t\t\t}\n\t\t\tvar minX:Number = Number.POSITIVE_INFINITY;\n\t\t\tvar minY:Number = Number.POSITIVE_INFINITY;\n\t\t\tvar maxX:Number = Number.NEGATIVE_INFINITY;\n\t\t\tvar maxY:Number = Number.NEGATIVE_INFINITY;\n\t\t\tif(itemCount > 0)\n\t\t\t{\n\t\t\t\tvar item:DisplayObject = items[0];\n\t\t\t\tvar itemBounds:Rectangle = item.getBounds(item.parent, Pool.getRectangle());\n\t\t\t\tif(itemBounds.x < minX)\n\t\t\t\t{\n\t\t\t\t\tminX = itemBounds.x;\n\t\t\t\t}\n\t\t\t\tif(itemBounds.y < minY)\n\t\t\t\t{\n\t\t\t\t\tminY = itemBounds.y;\n\t\t\t\t}\n\t\t\t\tvar itemMaxX:Number = itemBounds.x + itemBounds.width;\n\t\t\t\tif(itemMaxX > maxX)\n\t\t\t\t{\n\t\t\t\t\tmaxX = itemMaxX;\n\t\t\t\t}\n\t\t\t\tvar itemMaxY:Number = itemBounds.y + itemBounds.height;\n\t\t\t\tif(itemMaxY > maxY)\n\t\t\t\t{\n\t\t\t\t\tmaxY = itemMaxY;\n\t\t\t\t}\n\t\t\t\tPool.putRectangle(itemBounds);\n\t\t\t}\n\t\t\tif(minX == Number.POSITIVE_INFINITY)\n\t\t\t{\n\t\t\t\tminX = 0;\n\t\t\t}\n\t\t\tif(minY == Number.POSITIVE_INFINITY)\n\t\t\t{\n\t\t\t\tminY = 0;\n\t\t\t}\n\t\t\tif(maxX == Number.NEGATIVE_INFINITY)\n\t\t\t{\n\t\t\t\tmaxX = 0;\n\t\t\t}\n\t\t\tif(maxY == Number.NEGATIVE_INFINITY)\n\t\t\t{\n\t\t\t\tmaxY = 0;\n\t\t\t}\n\t\t\tvar contentX:Number = minX;\n\t\t\tvar contentY:Number = minY;\n\t\t\tvar contentWidth:Number = maxX - minX;\n\t\t\tvar contentHeight:Number = maxY - minY;\n\t\t\tvar viewPortWidth:Number = contentWidth;\n\t\t\tvar viewPortHeight:Number = contentHeight;\n\t\t\tif(viewPortBounds && viewPortBounds.explicitWidth === viewPortBounds.explicitWidth)\n\t\t\t{\n\t\t\t\tviewPortWidth = viewPortBounds.explicitWidth;\n\t\t\t}\n\t\t\tif(viewPortBounds && viewPortBounds.explicitHeight === viewPortBounds.explicitHeight)\n\t\t\t{\n\t\t\t\tviewPortHeight = viewPortBounds.explicitHeight;\n\t\t\t}\n\t\t\tif(contentWidth <= viewPortWidth)\n\t\t\t{\n\t\t\t\tcontentX -= (viewPortWidth - contentWidth) / 2;\n\t\t\t\tcontentWidth = viewPortWidth;\n\t\t\t}\n\t\t\tif(contentHeight <= viewPortHeight)\n\t\t\t{\n\t\t\t\tcontentY -= (viewPortHeight - contentHeight) / 2;\n\t\t\t\tcontentHeight = viewPortHeight;\n\t\t\t}\n\t\t\tresult.contentX = contentX;\n\t\t\tresult.contentY = contentY;\n\t\t\tresult.contentWidth = contentWidth;\n\t\t\tresult.contentHeight = contentHeight;\n\t\t\tresult.viewPortWidth = viewPortWidth;\n\t\t\tresult.viewPortHeight = viewPortHeight;\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic function calculateNavigationDestination(items:Vector.<DisplayObject>, index:int, keyCode:uint, bounds:LayoutBoundsResult):int\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\n\t\tpublic function getScrollPositionForIndex(index:int, items:Vector.<DisplayObject>,\n\t\t\tx:Number, y:Number, width:Number, height:Number, result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\treturn new Point(0, 0);\n\t\t\t}\n\t\t\tresult.setTo(0, 0);\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic function getNearestScrollPositionForIndex(index:int, scrollX:Number, scrollY:Number,\n\t\t\titems:Vector.<DisplayObject>, x:Number, y:Number, width:Number, height:Number, result:Point = null):Point\n\t\t{\n\t\t\treturn getScrollPositionForIndex(index, items, x, y, width, height, result);\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/Gallery/source/feathers/utils/touch/TouchSheet.as",
    "content": "package feathers.utils.touch\n{\n    import feathers.controls.LayoutGroup;\n    import feathers.events.ExclusiveTouch;\n\n    import flash.geom.Point;\n\n    import starling.display.DisplayObject;\n    import starling.display.Sprite;\n    import starling.events.Touch;\n    import starling.events.TouchEvent;\n    import starling.events.TouchPhase;\n    import starling.utils.Pool;\n\n    /**\n     * A modified version of TouchSheet for Feathers.\n     */\n    public class TouchSheet extends LayoutGroup\n    {\n        public static const MOVE:String = \"move\";\n        public static const ZOOM:String = \"zoom\";\n        public static const ROTATE:String = \"rotate\";\n\n        public function TouchSheet(contents:DisplayObject=null)\n        {\n            addEventListener(TouchEvent.TOUCH, onTouch);\n            useHandCursor = true;\n            \n            if (contents)\n            {\n                contents.x = int(contents.width / -2);\n                contents.y = int(contents.height / -2);\n                addChild(contents);\n            }\n        }\n\n        public var moveEnabled:Boolean = true;\n        public var rotateEnabled:Boolean = true;\n        public var zoomEnabled:Boolean = true;\n        public var bringToFrontEnabled:Boolean = true;\n        protected var touchAID:int = -1;\n        protected var touchBID:int = -1;\n        \n        private function onTouch(event:TouchEvent):void\n        {\n            var exclusiveTouch:ExclusiveTouch = ExclusiveTouch.forStage(this.stage);\n\n            //first check if the existing touches ended\n            if(touchBID != -1)\n            {\n                var touchB:Touch = event.getTouch(this, null, touchBID);\n                if(touchB !== null)\n                {\n                    if(touchB.phase === TouchPhase.ENDED)\n                    {\n                        touchBID = -1;\n                    }\n                    else\n                    {\n                        //if the touch has been claimed since we first started\n                        //watching it, we can no longer use it\n                        var claim:DisplayObject = exclusiveTouch.getClaim(touchBID);\n                        if(claim !== null && claim !== this)\n                        {\n                            touchBID = -1;\n                        }\n                    }\n                }\n            }\n            //we checeked touch b first because a might be replaced by b\n            if(touchAID != -1)\n            {\n                var touchA:Touch = event.getTouch(this, null, touchAID);\n                if(touchA !== null)\n                {\n                    if(touchA.phase === TouchPhase.ENDED)\n                    {\n                        touchAID = touchBID;\n                        touchBID = -1;\n                    }\n                    else\n                    {\n                        claim = exclusiveTouch.getClaim(touchAID);\n                        if(claim !== null && claim !== this)\n                        {\n                            touchAID = touchBID;\n                            touchBID = -1;\n                        }\n                    }\n                }\n            }\n            //then, check for new touches, if necessary\n            if(touchAID == -1 || touchBID == -1)\n            {\n                var touches:Vector.<Touch> = event.getTouches(this, TouchPhase.BEGAN);\n                var touchCount:int = touches.length;\n                for(var i:int = 0; i < touchCount; i++)\n                {\n                    var touch:Touch = touches[i];\n                    claim = exclusiveTouch.getClaim(touch.id);\n                    if(claim !== null)\n                    {\n                        //this touch is claimed, so we can't use it\n                        continue;\n                    }\n                    if(touchAID == -1)\n                    {\n                        touchAID = touch.id;\n                        if(this.moveEnabled)\n                        {\n                            exclusiveTouch.claimTouch(touchAID, this);\n                        }\n                    }\n                    else if(touchBID == -1)\n                    {\n                        touchBID = touch.id;\n                        //if we've found both touches, claim them to stop containers\n                        //from scrolling\n                        exclusiveTouch.claimTouch(touchAID, this);\n                        exclusiveTouch.claimTouch(touchBID, this);\n                    }\n                }\n            }\n            //do a multi-touch gesture if we have enough touches\n            if(touchAID != -1 && touchBID != -1)\n            {\n                // two fingers touching -> rotate and scale\n                touchA = event.getTouch(this, null, touchAID);\n                touchB = event.getTouch(this, null, touchBID);\n                if(touchA.phase !== TouchPhase.MOVED && touchB.phase !== TouchPhase.MOVED)\n                {\n                    //neither touch moved, so nothing has changed\n                    return;\n                }\n                \n                // updated to use stage instead of parent because the\n                // parent might move, but the stage never will. -JT\n                var currentPosA:Point  = touchA.getLocation(stage, Pool.getPoint());\n                var previousPosA:Point = touchA.getPreviousLocation(stage, Pool.getPoint());\n                var currentPosB:Point  = touchB.getLocation(stage, Pool.getPoint());\n                var previousPosB:Point = touchB.getPreviousLocation(stage, Pool.getPoint());\n                \n                var currentVector:Point  = currentPosA.subtract(currentPosB);\n                var previousVector:Point = previousPosA.subtract(previousPosB);\n                \n                var currentAngle:Number  = Math.atan2(currentVector.y, currentVector.x);\n                var previousAngle:Number = Math.atan2(previousVector.y, previousVector.x);\n                var deltaAngle:Number = currentAngle - previousAngle;\n\n                // update pivot point based on previous center\n                var point:Point = Pool.getPoint(\n                    (previousPosA.x + previousPosB.x) * 0.5,\n                    (previousPosA.y + previousPosB.y) * 0.5);\n                globalToLocal(point, point);\n                pivotX = point.x;\n                pivotY = point.y;\n\n                // update location based on the current center\n                point.setTo(\n                    (currentPosA.x + currentPosB.x) * 0.5,\n                    (currentPosA.y + currentPosB.y) * 0.5);\n                parent.globalToLocal(point, point);\n                x = point.x;\n                y = point.y;\n\n                Pool.putPoint(point);\n                Pool.putPoint(currentPosA);\n                Pool.putPoint(previousPosA);\n                Pool.putPoint(currentPosB);\n                Pool.putPoint(previousPosB);\n\n                if (rotateEnabled && deltaAngle != 0)\n                {\n                    rotation += deltaAngle;\n                    dispatchEventWith(ROTATE);\n                }\n\n                var sizeDiff:Number = currentVector.length / previousVector.length;\n                if (zoomEnabled && sizeDiff !== 1)\n                {\n                    var zoomed:Boolean = false;\n                    var newScaleX:Number = scaleX * sizeDiff;\n                    if(scaleX !== newScaleX)\n                    {\n                        scaleX = newScaleX;\n                        zoomed = true;\n                    }\n                    var newScaleY:Number = scaleY * sizeDiff;\n                    if(scaleY !== newScaleY)\n                    {\n                        scaleY = newScaleY;\n                        zoomed = true;\n                    }\n                    if(zoomed)\n                    {\n                        dispatchEventWith(ZOOM);\n                    }\n                }\n            }\n            else if(touchAID != -1) //single touch gesture\n            {\n                touchA = event.getTouch(this, null, touchAID);\n                if (moveEnabled)\n                {\n                    // one finger touching -> move\n\n                    // updated to use stage instead of parent because the\n                    // parent might move, but the stage won't -JT\n                    var delta:Point = touchA.getMovement(stage, Pool.getPoint());\n                    if(delta.length != 0)\n                    {\n                        x += delta.x;\n                        y += delta.y;\n\n                        dispatchEventWith(MOVE);\n                    }\n                    Pool.putPoint(delta);\n                }\n            }\n            \n            var touchEnded:Touch = event.getTouch(this, TouchPhase.ENDED);\n            if (touchEnded)\n            {\n                if (bringToFrontEnabled && touchEnded.tapCount == 2)\n                {\n                    parent.addChild(this); // bring self to front\n                }\n            }\n        }\n    }\n}"
  },
  {
    "path": "examples/HelloWorld/README.md",
    "content": "# Hello World Example for Feathers\n\nA very simple example that creates a Button control from the [Feathers](http://feathersui.com/) library, presented as a mobile app.\n\n## Requirements\n\nIn addition to Starling Framework and Feathers, this example project requires the `MetalWorksMobileTheme` example theme. You can find the SWC file for this theme at the following location in the Feathers release build:\n\n\tthemes/MetalWorksMobileTheme/swc/MetalWorksMobileTheme.swc\n\n## Web Demo\n\nView the [Hello World Example](http://feathersui.com/examples/hello-world/) in your browser."
  },
  {
    "path": "examples/HelloWorld/build.properties",
    "content": "feathers.root = ${basedir}/../../source\nstarling.root = ${basedir}/../../third-party/starling\ntheme.root = ${basedir}/../../themes/MetalWorksMobileTheme/source\noutput.path = ${basedir}/output\nicon.path = ${basedir}/../shared-assets/icons\nlaunch.image.path = ${basedir}/../shared-assets/launch-images-windowed\n\nswf.version = 30"
  },
  {
    "path": "examples/HelloWorld/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<project name=\"hello-world\" default=\"build\" basedir=\".\">\n\t\n\t<!-- build.local.properties and sdk.local.proprties are optional files that\n\t\tcan be used to override the default properties. -->\n\t<property file=\"./build.local.properties\"/>\n\t<property file=\"./sdk.local.properties\"/>\n\t<property file=\"./build.properties\"/>\n\t<!-- inherit SDK properties from the root of the repository -->\n\t<property file=\"../../sdk.local.properties\"/>\n\t<property file=\"../../sdk.properties\"/>\n\n\t<target name=\"build\" depends=\"build-web,build-android,build-ios\"/>\n\n\t<target name=\"prepare\">\n\t\t<delete dir=\"${output.path}\"/>\n\t</target>\n\n\t<target name=\"build-web\" depends=\"prepare\">\n\t\t<echo message=\"Building HelloWorldWeb.swf\"/>\n\t\t<java jar=\"${mxmlc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${flashplayer.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-frame=two,feathers.examples.helloWorld.Main\"/>\n\t\t\t<arg value=\"-source-path+=source\"/>\n\t\t\t<arg value=\"-source-path+=${starling.root}\"/>\n\t\t\t<arg value=\"-source-path+=${feathers.root}\"/>\n\t\t\t<arg value=\"-source-path+=${theme.root}\"/>\n\t\t\t<arg value=\"source/HelloWorldWeb.as\"/>\n\t\t\t<arg value=\"-output=${output.path}/HelloWorldWeb.swf\"/>\n\t\t</java>\n\t</target>\n\n\t<target name=\"build-air-swf\" depends=\"prepare\">\n\t\t<echo message=\"Building HelloWorld.swf\"/>\n\t\t<java jar=\"${mxmlc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${airmobile.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-source-path+=source\"/>\n\t\t\t<arg value=\"-source-path+=${starling.root}\"/>\n\t\t\t<arg value=\"-source-path+=${feathers.root}\"/>\n\t\t\t<arg value=\"-source-path+=${theme.root}\"/>\n\t\t\t<arg value=\"source/HelloWorld.as\"/>\n\t\t\t<arg value=\"-output=${output.path}/HelloWorld.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"-check-ios-properties\">\n\t\t<fail unless=\"ios.provision.path\"/>\n\t\t<fail unless=\"ios.certificate.path\"/>\n\t\t<fail unless=\"ios.certificate.password\"/>\n\t</target>\n\t<target name=\"build-ios\" depends=\"-check-ios-properties,build-air-swf\">\n\t\t<echo message=\"Packaging HelloWorld.ipa\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"-target\"/>\n\t\t\t<arg value=\"ipa-app-store\"/>\n\t\t\t<arg value=\"-provisioning-profile\"/>\n\t\t\t<arg value=\"${ios.provision.path}\"/>\n\t\t\t<arg value=\"-keystore\"/>\n\t\t\t<arg value=\"${ios.certificate.path}\"/>\n\t\t\t<arg value=\"-storetype\"/>\n\t\t\t<arg value=\"pkcs12\"/>\n\t\t\t<arg value=\"-storepass\"/>\n\t\t\t<arg value=\"${ios.certificate.password}\"/>\n\t\t\t<arg value=\"${output.path}/HelloWorld.ipa\"/>\n\t\t\t<arg value=\"source/HelloWorld-app.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${icon.path}\"/>\n\t\t\t<arg line=\"icon29.png icon48.png icon50.png icon57.png icon58.png icon72.png icon87.png icon96.png icon100.png icon114.png icon128.png icon144.png icon180.png\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${launch.image.path}\"/>\n\t\t\t<arg value=\"Default~iphone.png\"/>\t\t\t\t\t\t\t<!-- iphone 3gs -->\n\t\t\t<arg value=\"Default@2x~iphone.png\"/>\t\t\t\t\t\t<!-- iphone 4/4s -->\n\t\t\t<arg value=\"Default-568h@2x~iphone.png\"/>\t\t\t\t\t<!-- iphone 5/5c/5s -->\n\t\t\t<arg value=\"Default-375w-667h@2x~iphone.png\"/>\t\t\t\t<!-- iphone 6/7/8 -->\n\t\t\t<arg value=\"Default-812h@3x~iphone.png\"/>\t\t\t\t\t<!-- iphone x (portrait) -->\n\t\t\t<arg value=\"Default-Landscape-812h@3x~iphone.png\"/>\t\t\t<!-- iphone x (landscape) -->\n\t\t\t<arg value=\"Default-414w-736h@3x~iphone.png\"/>\t\t\t\t<!-- iphone 6/7/8 plus (portrait) -->\n\t\t\t<arg value=\"Default-Landscape-414w-736h@3x~iphone.png\"/>\t<!-- iphone 6/7/8 plus (landscape) -->\n\t\t\t<arg value=\"Default-Portrait~ipad.png\"/>\t\t\t\t\t<!-- ipad 1/2 (portrait) -->\n\t\t\t<arg value=\"Default-PortraitUpsideDown~ipad.png\"/>\t\t\t<!-- ipad 1/2 (portrait upside down) -->\n\t\t\t<arg value=\"Default-Landscape~ipad.png\"/>\t\t\t\t\t<!-- ipad 1/2 (landscape left) -->\n\t\t\t<arg value=\"Default-LandscapeRight~ipad.png\"/>\t\t\t\t<!-- ipad 1/2 (landscape right) -->\n\t\t\t<arg value=\"Default-Portrait@2x~ipad.png\"/>\t\t\t\t\t<!-- ipad 3/air (portrait) -->\n\t\t\t<arg value=\"Default-LandscapeLeft@2x~ipad.png\"/>\t\t\t<!-- ipad 3/air (landscape left) -->\n\t\t\t<arg value=\"Default-LandscapeRight@2x~ipad.png\"/>\t\t\t<!-- ipad 3/air (landscape right) -->\n\t\t\t<arg value=\"Default-Portrait@2x.png\"/>\t\t\t\t\t\t<!-- ipad pro (portrait) -->\n\t\t\t<arg value=\"Default-Landscape@2x.png\"/>\t\t\t\t\t\t<!-- ipad pro (landscape) -->\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${output.path}\"/>\n\t\t\t<arg value=\"HelloWorld.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"-check-android-properties\">\n\t\t<fail unless=\"android.certificate.path\"/>\n\t\t<fail unless=\"android.certificate.password\"/>\n\t</target>\n\t<target name=\"build-android\" depends=\"-check-android-properties,build-air-swf\">\n\t\t<echo message=\"Packaging HelloWorld.apk\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"-target\"/>\n\t\t\t<arg value=\"apk-captive-runtime\"/>\n\t\t\t<arg value=\"-storetype\"/>\n\t\t\t<arg value=\"pkcs12\"/>\n\t\t\t<arg value=\"-keystore\"/>\n\t\t\t<arg value=\"${android.certificate.path}\"/>\n\t\t\t<arg value=\"-storepass\"/>\n\t\t\t<arg value=\"${android.certificate.password}\"/>\n\t\t\t<arg value=\"${output.path}/HelloWorld.apk\"/>\n\t\t\t<arg value=\"source/HelloWorld-app.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${icon.path}\"/>\n\t\t\t<arg line=\"icon29.png icon48.png icon50.png icon57.png icon58.png icon72.png icon87.png icon96.png icon100.png icon114.png icon128.png icon144.png icon180.png\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${output.path}\"/>\n\t\t\t<arg value=\"HelloWorld.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"install-android\">\n\t\t<echo message=\"Installing HelloWorld.apk\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"false\">\n\t\t\t<arg value=\"-uninstallApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"android\"/>\n\t\t\t<arg value=\"-appid\"/>\n\t\t\t<arg value=\"com.feathersui.examples.HelloWorld\"/>\n\t\t</java>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-installApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"android\"/>\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"${output.path}/HelloWorld.apk\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"install-ios\">\n\t\t<echo message=\"Installing HelloWorld.ipa\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"false\">\n\t\t\t<arg value=\"-uninstallApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"iOS\"/>\n\t\t\t<arg value=\"-appid\"/>\n\t\t\t<arg value=\"com.feathersui.examples.HelloWorld\"/>\n\t\t</java>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-installApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"iOS\"/>\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"${output.path}/HelloWorld.ipa\"/>\n\t\t</java>\n\t</target>\n</project>"
  },
  {
    "path": "examples/HelloWorld/source/HelloWorld-app.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<application xmlns=\"http://ns.adobe.com/air/application/32.0\">\n\t<id>com.feathersui.examples.HelloWorld</id>\n\t<filename>Hello World</filename>\n\t<name>Hello World</name>\n\t<versionNumber>4.2.0</versionNumber>\n\t<description>Hello World example application built with Feathers UI controls for Starling</description>\n\t<copyright>2021 Bowler Hat LLC</copyright>\n\n\t<initialWindow>\n\t\t<content>HelloWorld.swf</content>\n\t\t<autoOrients>true</autoOrients>\n\t\t<fullScreen>false</fullScreen>\n\t\t<visible>true</visible>\n\t\t<renderMode>direct</renderMode>\n\t</initialWindow>\n\n\t<supportedLanguages>en</supportedLanguages>\n\n\t<icon>\n\t\t<image29x29>icon29.png</image29x29>\n\t\t<image48x48>icon48.png</image48x48>\n\t\t<image50x50>icon50.png</image50x50>\n\t\t<image57x57>icon57.png</image57x57>\n\t\t<image58x58>icon58.png</image58x58>\n\t\t<image72x72>icon72.png</image72x72>\n\t\t<image87x87>icon87.png</image87x87>\n\t\t<image96x96>icon96.png</image96x96>\n\t\t<image100x100>icon100.png</image100x100>\n\t\t<image114x114>icon114.png</image114x114>\n\t\t<image128x128>icon128.png</image128x128>\n\t\t<image144x144>icon144.png</image144x144>\n\t\t<image180x180>icon180.png</image180x180>\n\t</icon>\n\t<android>\n\t\t<colorDepth>16bit</colorDepth>\n\t\t<manifestAdditions><![CDATA[\n\t\t\t<manifest android:installLocation=\"auto\">\n\t\t\t    <uses-permission android:name=\"android.permission.INTERNET\"/>\n\t\t\t</manifest>\n\t\t]]></manifestAdditions>\n\t</android>\n\t<iPhone>\n\t\t<InfoAdditions>\n\t\t<![CDATA[\n\t\t\t<key>UIDeviceFamily</key> \n\t\t\t<array> \n\t\t\t\t<string>1</string>\n\t\t\t\t<string>2</string>\n\t\t\t</array>\n\t\t\t<key>UIPrerenderedIcon</key>\n\t\t\t<true/>\n\t\t\t<key>UIStatusBarStyle</key>\n\t\t\t<string>UIStatusBarStyleLightContent</string>\n\t\t]]> \n\t\t</InfoAdditions>\n\t\t<requestedDisplayResolution>high</requestedDisplayResolution>\n\t</iPhone>\n</application>"
  },
  {
    "path": "examples/HelloWorld/source/HelloWorld.as",
    "content": "package\n{\n\timport feathers.examples.helloWorld.Main;\n\timport feathers.utils.ScreenDensityScaleFactorManager;\n\n\timport flash.display.Loader;\n\timport flash.display.Sprite;\n\timport flash.display.StageAlign;\n\timport flash.display.StageOrientation;\n\timport flash.display.StageScaleMode;\n\timport flash.display3D.Context3DProfile;\n\timport flash.display3D.Context3DRenderMode;\n\timport flash.events.Event;\n\timport flash.filesystem.File;\n\timport flash.filesystem.FileMode;\n\timport flash.filesystem.FileStream;\n\timport flash.system.Capabilities;\n\timport flash.utils.ByteArray;\n\n\timport starling.core.Starling;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#4a4137\")]\n\tpublic class HelloWorld extends Sprite\n\t{\n\t\tpublic function HelloWorld()\n\t\t{\n\t\t\tif(this.stage)\n\t\t\t{\n\t\t\t\tthis.stage.scaleMode = StageScaleMode.NO_SCALE;\n\t\t\t\tthis.stage.align = StageAlign.TOP_LEFT;\n\t\t\t}\n\t\t\tthis.mouseEnabled = this.mouseChildren = false;\n\t\t\tthis.showLaunchImage();\n\t\t\tthis.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);\n\t\t}\n\n\t\tprivate var _starling:Starling;\n\t\tprivate var _scaler:ScreenDensityScaleFactorManager;\n\t\tprivate var _launchImage:Loader;\n\t\tprivate var _savedAutoOrients:Boolean;\n\n\t\t/**\n\t\t * On iOS, add the native launch image to the classic display list to\n\t\t * avoid displaying only the stage background color between when the\n\t\t * AIR app finishes launching and Starling starts rendering.\n\t\t * \n\t\t * Launch image names: https://forums.adobe.com/message/9986239#9986239\n\t\t */\n\t\tprivate function showLaunchImage():void\n\t\t{\n\t\t\tvar filePath:String = null;\n\t\t\tvar isPortraitOnly:Boolean = false;\n\t\t\tif(Capabilities.manufacturer.indexOf(\"iOS\") >= 0)\n\t\t\t{\n\t\t\t\tvar isPortraitUpsideDown:Boolean = this.stage.orientation == StageOrientation.UPSIDE_DOWN;\n\t\t\t\tvar isPortrait:Boolean = this.stage.orientation == StageOrientation.DEFAULT || isPortraitUpsideDown;\n\t\t\t\tvar isLandscapeRight:Boolean = this.stage.orientation == StageOrientation.ROTATED_RIGHT;\n\t\t\t\tif(Capabilities.screenResolutionX == 1242 && Capabilities.screenResolutionY == 2208)\n\t\t\t\t{\n\t\t\t\t\t//iphone 6/7/8 plus\n\t\t\t\t\tfilePath = isPortrait ? \"Default-414w-736h@3x~iphone.png\" : \"Default-Landscape-414w-736h@3x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 1125 && Capabilities.screenResolutionY == 2436)\n\t\t\t\t{\n\t\t\t\t\t//iphone x\n\t\t\t\t\tfilePath = isPortrait ? \"Default-812h@3x~iphone.png\" : \"Default-Landscape-812h@3x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 2048 && Capabilities.screenResolutionY == 2732)\n\t\t\t\t{\n\t\t\t\t\t//ipad pro\n\t\t\t\t\tfilePath = isPortrait ? \"Default-Portrait@2x.png\" : \"Default-Landscape@2x.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 1536 && Capabilities.screenResolutionY == 2048)\n\t\t\t\t{\n\t\t\t\t\t//ipad 3/air\n\t\t\t\t\tif(isPortraitUpsideDown)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Portrait@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isPortrait)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-PortraitUpsideDown@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isLandscapeRight)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeRight@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeLeft@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 768 && Capabilities.screenResolutionY == 1024)\n\t\t\t\t{\n\t\t\t\t\t//ipad 1/2\n\t\t\t\t\tif(isPortraitUpsideDown)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Portrait~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isPortrait)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-PortraitUpsideDown~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isLandscapeRight)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeRight~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Landscape~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 750)\n\t\t\t\t{\n\t\t\t\t\t//iphone 6/7/8\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tfilePath = \"Default-375w-667h@2x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 640)\n\t\t\t\t{\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tif(Capabilities.screenResolutionY == 1136)\n\t\t\t\t\t{\n\t\t\t\t\t\t//iphone 5/5c/5s\n\t\t\t\t\t\tfilePath = \"Default-568h@2x~iphone.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//iphone 4/4s\n\t\t\t\t\t\tfilePath = \"Default@2x~iphone.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 320)\n\t\t\t\t{\n\t\t\t\t\t//iphone 3gs\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tfilePath = \"Default~iphone.png\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(filePath)\n\t\t\t{\n\t\t\t\tvar file:File = File.applicationDirectory.resolvePath(filePath);\n\t\t\t\tif(file.exists)\n\t\t\t\t{\n\t\t\t\t\tvar bytes:ByteArray = new ByteArray();\n\t\t\t\t\tvar stream:FileStream = new FileStream();\n\t\t\t\t\tstream.open(file, FileMode.READ);\n\t\t\t\t\tstream.readBytes(bytes, 0, stream.bytesAvailable);\n\t\t\t\t\tstream.close();\n\t\t\t\t\tthis._launchImage = new Loader();\n\t\t\t\t\tthis._launchImage.loadBytes(bytes);\n\t\t\t\t\tthis.addChild(this._launchImage);\n\t\t\t\t\tthis._savedAutoOrients = this.stage.autoOrients;\n\t\t\t\t\tthis.stage.autoOrients = false;\n\t\t\t\t\tif(isPortraitOnly)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.stage.setOrientation(StageOrientation.DEFAULT);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function loaderInfo_completeHandler(event:Event):void\n\t\t{\n\t\t\tStarling.multitouchEnabled = true;\n\t\t\tthis._starling = new Starling(Main, this.stage, null, null, Context3DRenderMode.AUTO, Context3DProfile.BASELINE);\n\t\t\tthis._starling.supportHighResolutions = true;\n\t\t\tthis._starling.skipUnchangedFrames = true;\n\t\t\tthis._starling.start();\n\t\t\tif(this._launchImage)\n\t\t\t{\n\t\t\t\tthis._starling.addEventListener(\"rootCreated\", starling_rootCreatedHandler);\n\t\t\t}\n\n\t\t\tthis._scaler = new ScreenDensityScaleFactorManager(this._starling);\n\t\t\tthis.stage.addEventListener(Event.DEACTIVATE, stage_deactivateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function starling_rootCreatedHandler(event:Object):void\n\t\t{\n\t\t\tif(this._launchImage)\n\t\t\t{\n\t\t\t\tthis.removeChild(this._launchImage);\n\t\t\t\tthis._launchImage.unloadAndStop(true);\n\t\t\t\tthis._launchImage = null;\n\t\t\t\tthis.stage.autoOrients = this._savedAutoOrients;\n\t\t\t}\n\t\t}\n\n\t\tprivate function stage_deactivateHandler(event:Event):void\n\t\t{\n\t\t\tthis._starling.stop(true);\n\t\t\tthis.stage.addEventListener(Event.ACTIVATE, stage_activateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function stage_activateHandler(event:Event):void\n\t\t{\n\t\t\tthis.stage.removeEventListener(Event.ACTIVATE, stage_activateHandler);\n\t\t\tthis._starling.start();\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "examples/HelloWorld/source/HelloWorldWeb.as",
    "content": "package\n{\n\timport feathers.system.DeviceCapabilities;\n\n\timport flash.display.MovieClip;\n\timport flash.display.StageAlign;\n\timport flash.display.StageScaleMode;\n\timport flash.events.Event;\n\timport flash.geom.Rectangle;\n\timport flash.ui.ContextMenu;\n\timport flash.utils.getDefinitionByName;\n\n\timport starling.core.Starling;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#4a4137\")]\n\tpublic class HelloWorldWeb extends MovieClip\n\t{\n\t\tpublic function HelloWorldWeb()\n\t\t{\n\t\t\tvar menu:ContextMenu = new ContextMenu();\n\t\t\tmenu.hideBuiltInItems();\n\t\t\tthis.contextMenu = menu;\n\t\t\t\n\t\t\tif(this.stage)\n\t\t\t{\n\t\t\t\tthis.stage.align = StageAlign.TOP_LEFT;\n\t\t\t\tthis.stage.scaleMode = StageScaleMode.NO_SCALE;\n\t\t\t}\n\t\t\t\n\t\t\tthis.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);\n\t\t}\n\t\t\n\t\tprivate var _starling:Starling;\n\t\t\n\t\tprivate function start():void\n\t\t{\n\t\t\tthis.gotoAndStop(2);\n\t\t\tthis.graphics.clear();\n\n\t\t\t//simulating iPhone Retina\n\t\t\tDeviceCapabilities.dpi = 326;\n\t\t\t\n\t\t\tStarling.multitouchEnabled = true;\n\t\t\tvar MainType:Class = getDefinitionByName(\"feathers.examples.helloWorld.Main\") as Class;\n\t\t\tthis._starling = new Starling(MainType, this.stage, new Rectangle(0, 0, 960, 640));\n\t\t\tthis._starling.supportHighResolutions = true;\n\t\t\tthis._starling.skipUnchangedFrames = true;\n\t\t\tthis._starling.stage.stageWidth = 480;\n\t\t\tthis._starling.stage.stageHeight = 320;\n\t\t\tthis._starling.start();\n\t\t}\n\t\t\n\t\tprivate function loaderInfo_completeHandler(event:Event):void\n\t\t{\n\t\t\tthis.start();\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/HelloWorld/source/feathers/examples/helloWorld/Main.as",
    "content": "package feathers.examples.helloWorld\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.TextCallout;\n\timport feathers.themes.MetalWorksMobileTheme;\n\n\timport starling.display.Sprite;\n\timport starling.events.Event;\n\n\t/**\n\t * An example to help you get started with Feathers. Creates a \"theme\" and\n\t * displays a Button component that you can trigger.\n\t *\n\t * <p>Note: This example requires the MetalWorksMobileTheme, which is one of\n\t * the themes included with Feathers.</p>\n\t *\n\t * @see http://feathersui.com/help/getting-started.html\n\t */\n\tpublic class Main extends Sprite\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function Main()\n\t\t{\n\t\t\t//we'll initialize things after we've been added to the stage\n\t\t\tthis.addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);\n\t\t}\n\n\t\t/**\n\t\t * The Feathers Button control that we'll be creating.\n\t\t */\n\t\tprotected var button:Button;\n\n\t\t/**\n\t\t * Where the magic happens. Start after the main class has been added\n\t\t * to the stage so that we can access the stage property.\n\t\t */\n\t\tprotected function addedToStageHandler(event:Event):void\n\t\t{\n\t\t\tthis.removeEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);\n\n\t\t\t//create the theme. this class will automatically pass skins to any\n\t\t\t//Feathers component that is added to the stage. components do not\n\t\t\t//have default skins, so you must always use a theme or skin the\n\t\t\t//components manually. you should always create a theme immediately\n\t\t\t//when your app starts up to ensure that all components are\n\t\t\t//properly skinned.\n\t\t\t//see http://feathersui.com/help/themes.html\n\t\t\tnew MetalWorksMobileTheme();\n\n\t\t\t//create a button and give it some text to display.\n\t\t\tthis.button = new Button();\n\t\t\tthis.button.label = \"Click Me\";\n\n\t\t\t//an event that tells us when the user has tapped the button.\n\t\t\tthis.button.addEventListener(Event.TRIGGERED, button_triggeredHandler);\n\n\t\t\t//add the button to the display list, just like you would with any\n\t\t\t//other Starling display object. this is where the theme give some\n\t\t\t//skins to the button.\n\t\t\tthis.addChild(this.button);\n\n\t\t\t//the button won't have a width and height until it \"validates\". it\n\t\t\t//will validate on its own before the next frame is rendered by\n\t\t\t//Starling, but we want to access the dimension immediately, so tell\n\t\t\t//it to validate right now.\n\t\t\tthis.button.validate();\n\n\t\t\t//center the button\n\t\t\tthis.button.x = Math.round((this.stage.stageWidth - this.button.width) / 2);\n\t\t\tthis.button.y = Math.round((this.stage.stageHeight - this.button.height) / 2);\n\t\t}\n\n\t\t/**\n\t\t * Listener for the Button's Event.TRIGGERED event.\n\t\t */\n\t\tprotected function button_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tTextCallout.show(\"Hi, I'm Feathers!\\nHave a nice day.\", this.button);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/LayoutExplorer/README.md",
    "content": "# Layout Explorer for Feathers\n\nDemonstrations of each layout available in [Feathers](http://feathersui.com/) for the List and LayoutContainer components, presented as a mobile app. Includes screens for each layout, with configurable options.\n\n## Requirements\n\nIn addition to Starling Framework and Feathers, this example project requires the `MetalWorksMobileTheme` example theme. You can find the SWC file for this theme at the following location in the Feathers release build:\n\n\tthemes/MetalWorksMobileTheme/swc/MetalWorksMobileTheme.swc\n\n## Web Demo\n\nView the [Layout Explorer Example](http://feathersui.com/examples/layout-explorer/) in your browser."
  },
  {
    "path": "examples/LayoutExplorer/build.properties",
    "content": "feathers.root = ${basedir}/../../source\nstarling.root = ${basedir}/../../third-party/starling\ntheme.root = ${basedir}/../../themes/MetalWorksMobileTheme/source\noutput.path = ${basedir}/output\nicon.path = ${basedir}/../shared-assets/icons\nlaunch.image.path = ${basedir}/../shared-assets/launch-images-windowed\n\nswf.version = 30"
  },
  {
    "path": "examples/LayoutExplorer/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<project name=\"layout-explorer\" default=\"build\" basedir=\".\">\n\t\n\t<!-- build.local.properties and sdk.local.proprties are optional files that\n\t\tcan be used to override the default properties. -->\n\t<property file=\"./build.local.properties\"/>\n\t<property file=\"./sdk.local.properties\"/>\n\t<property file=\"./build.properties\"/>\n\t<!-- inherit SDK properties from the root of the repository -->\n\t<property file=\"../../sdk.local.properties\"/>\n\t<property file=\"../../sdk.properties\"/>\n\n\t<target name=\"build\" depends=\"build-web,build-android,build-ios\"/>\n\n\t<target name=\"prepare\">\n\t\t<delete dir=\"${output.path}\"/>\n\t</target>\n\n\t<target name=\"build-web\" depends=\"prepare\">\n\t\t<echo message=\"Building LayoutExplorerWeb.swf\"/>\n\t\t<java jar=\"${mxmlc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${flashplayer.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-frame=two,feathers.examples.layoutExplorer.Main\"/>\n\t\t\t<arg value=\"-source-path+=source\"/>\n\t\t\t<arg value=\"-source-path+=${starling.root}\"/>\n\t\t\t<arg value=\"-source-path+=${feathers.root}\"/>\n\t\t\t<arg value=\"-source-path+=${theme.root}\"/>\n\t\t\t<arg value=\"source/LayoutExplorerWeb.as\"/>\n\t\t\t<arg value=\"-output=${output.path}/LayoutExplorerWeb.swf\"/>\n\t\t</java>\n\t</target>\n\n\t<target name=\"build-air-swf\" depends=\"prepare\">\n\t\t<echo message=\"Building LayoutExplorer.swf\"/>\n\t\t<java jar=\"${mxmlc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${airmobile.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-source-path+=source\"/>\n\t\t\t<arg value=\"-source-path+=${starling.root}\"/>\n\t\t\t<arg value=\"-source-path+=${feathers.root}\"/>\n\t\t\t<arg value=\"-source-path+=${theme.root}\"/>\n\t\t\t<arg value=\"source/LayoutExplorer.as\"/>\n\t\t\t<arg value=\"-output=${output.path}/LayoutExplorer.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"-check-ios-properties\">\n\t\t<fail unless=\"ios.provision.path\"/>\n\t\t<fail unless=\"ios.certificate.path\"/>\n\t\t<fail unless=\"ios.certificate.password\"/>\n\t</target>\n\t<target name=\"build-ios\" depends=\"-check-ios-properties,build-air-swf\">\n\t\t<echo message=\"Packaging LayoutExplorer.ipa\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"-target\"/>\n\t\t\t<arg value=\"ipa-app-store\"/>\n\t\t\t<arg value=\"-provisioning-profile\"/>\n\t\t\t<arg value=\"${ios.provision.path}\"/>\n\t\t\t<arg value=\"-keystore\"/>\n\t\t\t<arg value=\"${ios.certificate.path}\"/>\n\t\t\t<arg value=\"-storetype\"/>\n\t\t\t<arg value=\"pkcs12\"/>\n\t\t\t<arg value=\"-storepass\"/>\n\t\t\t<arg value=\"${ios.certificate.password}\"/>\n\t\t\t<arg value=\"${output.path}/LayoutExplorer.ipa\"/>\n\t\t\t<arg value=\"source/LayoutExplorer-app.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${icon.path}\"/>\n\t\t\t<arg line=\"icon29.png icon48.png icon50.png icon57.png icon58.png icon72.png icon87.png icon96.png icon100.png icon114.png icon128.png icon144.png icon180.png\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${launch.image.path}\"/>\n\t\t\t<arg value=\"Default~iphone.png\"/>\t\t\t\t\t\t\t<!-- iphone 3gs -->\n\t\t\t<arg value=\"Default@2x~iphone.png\"/>\t\t\t\t\t\t<!-- iphone 4/4s -->\n\t\t\t<arg value=\"Default-568h@2x~iphone.png\"/>\t\t\t\t\t<!-- iphone 5/5c/5s -->\n\t\t\t<arg value=\"Default-375w-667h@2x~iphone.png\"/>\t\t\t\t<!-- iphone 6/7/8 -->\n\t\t\t<arg value=\"Default-812h@3x~iphone.png\"/>\t\t\t\t\t<!-- iphone x (portrait) -->\n\t\t\t<arg value=\"Default-Landscape-812h@3x~iphone.png\"/>\t\t\t<!-- iphone x (landscape) -->\n\t\t\t<arg value=\"Default-414w-736h@3x~iphone.png\"/>\t\t\t\t<!-- iphone 6/7/8 plus (portrait) -->\n\t\t\t<arg value=\"Default-Landscape-414w-736h@3x~iphone.png\"/>\t<!-- iphone 6/7/8 plus (landscape) -->\n\t\t\t<arg value=\"Default-Portrait~ipad.png\"/>\t\t\t\t\t<!-- ipad 1/2 (portrait) -->\n\t\t\t<arg value=\"Default-PortraitUpsideDown~ipad.png\"/>\t\t\t<!-- ipad 1/2 (portrait upside down) -->\n\t\t\t<arg value=\"Default-Landscape~ipad.png\"/>\t\t\t\t\t<!-- ipad 1/2 (landscape left) -->\n\t\t\t<arg value=\"Default-LandscapeRight~ipad.png\"/>\t\t\t\t<!-- ipad 1/2 (landscape right) -->\n\t\t\t<arg value=\"Default-Portrait@2x~ipad.png\"/>\t\t\t\t\t<!-- ipad 3/air (portrait) -->\n\t\t\t<arg value=\"Default-LandscapeLeft@2x~ipad.png\"/>\t\t\t<!-- ipad 3/air (landscape left) -->\n\t\t\t<arg value=\"Default-LandscapeRight@2x~ipad.png\"/>\t\t\t<!-- ipad 3/air (landscape right) -->\n\t\t\t<arg value=\"Default-Portrait@2x.png\"/>\t\t\t\t\t\t<!-- ipad pro (portrait) -->\n\t\t\t<arg value=\"Default-Landscape@2x.png\"/>\t\t\t\t\t\t<!-- ipad pro (landscape) -->\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${output.path}\"/>\n\t\t\t<arg value=\"LayoutExplorer.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"-check-android-properties\">\n\t\t<fail unless=\"android.certificate.path\"/>\n\t\t<fail unless=\"android.certificate.password\"/>\n\t</target>\n\t<target name=\"build-android\" depends=\"-check-android-properties,build-air-swf\">\n\t\t<echo message=\"Packaging LayoutExplorer.apk\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"-target\"/>\n\t\t\t<arg value=\"apk-captive-runtime\"/>\n\t\t\t<arg value=\"-storetype\"/>\n\t\t\t<arg value=\"pkcs12\"/>\n\t\t\t<arg value=\"-keystore\"/>\n\t\t\t<arg value=\"${android.certificate.path}\"/>\n\t\t\t<arg value=\"-storepass\"/>\n\t\t\t<arg value=\"${android.certificate.password}\"/>\n\t\t\t<arg value=\"${output.path}/LayoutExplorer.apk\"/>\n\t\t\t<arg value=\"source/LayoutExplorer-app.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${icon.path}\"/>\n\t\t\t<arg line=\"icon29.png icon48.png icon50.png icon57.png icon58.png icon72.png icon87.png icon96.png icon100.png icon114.png icon128.png icon144.png icon180.png\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${output.path}\"/>\n\t\t\t<arg value=\"LayoutExplorer.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"install-android\">\n\t\t<echo message=\"Installing LayoutExplorer.apk\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"false\">\n\t\t\t<arg value=\"-uninstallApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"android\"/>\n\t\t\t<arg value=\"-appid\"/>\n\t\t\t<arg value=\"com.feathersui.examples.LayoutExplorer\"/>\n\t\t</java>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-installApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"android\"/>\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"${output.path}/LayoutExplorer.apk\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"install-ios\">\n\t\t<echo message=\"Installing LayoutExplorer.ipa\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"false\">\n\t\t\t<arg value=\"-uninstallApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"iOS\"/>\n\t\t\t<arg value=\"-appid\"/>\n\t\t\t<arg value=\"com.feathersui.examples.LayoutExplorer\"/>\n\t\t</java>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-installApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"iOS\"/>\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"${output.path}/LayoutExplorer.ipa\"/>\n\t\t</java>\n\t</target>\n</project>"
  },
  {
    "path": "examples/LayoutExplorer/source/LayoutExplorer-app.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<application xmlns=\"http://ns.adobe.com/air/application/32.0\">\n\t<id>com.feathersui.examples.LayoutExplorer</id>\n\t<filename>Layouts</filename>\n\t<name>Layouts</name>\n\t<versionNumber>4.2.0</versionNumber>\n\t<description>Layout Explorer example application built with Feathers UI controls for Starling</description>\n\t<copyright>2021 Bowler Hat LLC</copyright>\n\n\t<initialWindow>\n\t\t<content>LayoutExplorer.swf</content>\n\t\t<autoOrients>true</autoOrients>\n\t\t<fullScreen>false</fullScreen>\n\t\t<visible>true</visible>\n\t\t<renderMode>direct</renderMode>\n\t</initialWindow>\n\n\t<supportedLanguages>en</supportedLanguages>\n\n\t<icon>\n\t\t<image29x29>icon29.png</image29x29>\n\t\t<image48x48>icon48.png</image48x48>\n\t\t<image50x50>icon50.png</image50x50>\n\t\t<image57x57>icon57.png</image57x57>\n\t\t<image58x58>icon58.png</image58x58>\n\t\t<image72x72>icon72.png</image72x72>\n\t\t<image87x87>icon87.png</image87x87>\n\t\t<image96x96>icon96.png</image96x96>\n\t\t<image100x100>icon100.png</image100x100>\n\t\t<image114x114>icon114.png</image114x114>\n\t\t<image128x128>icon128.png</image128x128>\n\t\t<image144x144>icon144.png</image144x144>\n\t\t<image180x180>icon180.png</image180x180>\n\t</icon>\n\t<android>\n\t\t<colorDepth>16bit</colorDepth>\n\t\t<manifestAdditions><![CDATA[\n\t\t\t<manifest android:installLocation=\"auto\">\n\t\t\t    <uses-permission android:name=\"android.permission.INTERNET\"/>\n\t\t\t</manifest>\n\t\t]]></manifestAdditions>\n\t</android>\n\t<iPhone>\n\t\t<InfoAdditions>\n\t\t<![CDATA[\n\t\t\t<key>UIDeviceFamily</key> \n\t\t\t<array> \n\t\t\t\t<string>1</string>\n\t\t\t\t<string>2</string>\n\t\t\t</array>\n\t\t\t<key>UIPrerenderedIcon</key>\n\t\t\t<true/>\n\t\t\t<key>UIStatusBarStyle</key>\n\t\t\t<string>UIStatusBarStyleLightContent</string>\n\t\t]]> \n\t\t</InfoAdditions>\n\t\t<requestedDisplayResolution>high</requestedDisplayResolution>\n\t</iPhone>\n</application>"
  },
  {
    "path": "examples/LayoutExplorer/source/LayoutExplorer.as",
    "content": "package\n{\n\timport feathers.examples.layoutExplorer.Main;\n\timport feathers.utils.ScreenDensityScaleFactorManager;\n\n\timport flash.display.Loader;\n\timport flash.display.Sprite;\n\timport flash.display.StageAlign;\n\timport flash.display.StageOrientation;\n\timport flash.display.StageScaleMode;\n\timport flash.display3D.Context3DProfile;\n\timport flash.display3D.Context3DRenderMode;\n\timport flash.events.Event;\n\timport flash.filesystem.File;\n\timport flash.filesystem.FileMode;\n\timport flash.filesystem.FileStream;\n\timport flash.system.Capabilities;\n\timport flash.utils.ByteArray;\n\n\timport starling.core.Starling;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#4a4137\")]\n\tpublic class LayoutExplorer extends Sprite\n\t{\n\t\tpublic function LayoutExplorer()\n\t\t{\n\t\t\tif(this.stage)\n\t\t\t{\n\t\t\t\tthis.stage.scaleMode = StageScaleMode.NO_SCALE;\n\t\t\t\tthis.stage.align = StageAlign.TOP_LEFT;\n\t\t\t}\n\t\t\tthis.mouseEnabled = this.mouseChildren = false;\n\t\t\tthis.showLaunchImage();\n\t\t\tthis.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);\n\t\t}\n\n\t\tprivate var _starling:Starling;\n\t\tprivate var _scaler:ScreenDensityScaleFactorManager;\n\t\tprivate var _launchImage:Loader;\n\t\tprivate var _savedAutoOrients:Boolean;\n\n\t\t/**\n\t\t * On iOS, add the native launch image to the classic display list to\n\t\t * avoid displaying only the stage background color between when the\n\t\t * AIR app finishes launching and Starling starts rendering.\n\t\t * \n\t\t * Launch image names: https://forums.adobe.com/message/9986239#9986239\n\t\t */\n\t\tprivate function showLaunchImage():void\n\t\t{\n\t\t\tvar filePath:String = null;\n\t\t\tvar isPortraitOnly:Boolean = false;\n\t\t\tif(Capabilities.manufacturer.indexOf(\"iOS\") >= 0)\n\t\t\t{\n\t\t\t\tvar isPortraitUpsideDown:Boolean = this.stage.orientation == StageOrientation.UPSIDE_DOWN;\n\t\t\t\tvar isPortrait:Boolean = this.stage.orientation == StageOrientation.DEFAULT || isPortraitUpsideDown;\n\t\t\t\tvar isLandscapeRight:Boolean = this.stage.orientation == StageOrientation.ROTATED_RIGHT;\n\t\t\t\tif(Capabilities.screenResolutionX == 1242 && Capabilities.screenResolutionY == 2208)\n\t\t\t\t{\n\t\t\t\t\t//iphone 6/7/8 plus\n\t\t\t\t\tfilePath = isPortrait ? \"Default-414w-736h@3x~iphone.png\" : \"Default-Landscape-414w-736h@3x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 1125 && Capabilities.screenResolutionY == 2436)\n\t\t\t\t{\n\t\t\t\t\t//iphone x\n\t\t\t\t\tfilePath = isPortrait ? \"Default-812h@3x~iphone.png\" : \"Default-Landscape-812h@3x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 2048 && Capabilities.screenResolutionY == 2732)\n\t\t\t\t{\n\t\t\t\t\t//ipad pro\n\t\t\t\t\tfilePath = isPortrait ? \"Default-Portrait@2x.png\" : \"Default-Landscape@2x.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 1536 && Capabilities.screenResolutionY == 2048)\n\t\t\t\t{\n\t\t\t\t\t//ipad 3/air\n\t\t\t\t\tif(isPortraitUpsideDown)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Portrait@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isPortrait)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-PortraitUpsideDown@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isLandscapeRight)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeRight@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeLeft@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 768 && Capabilities.screenResolutionY == 1024)\n\t\t\t\t{\n\t\t\t\t\t//ipad 1/2\n\t\t\t\t\tif(isPortraitUpsideDown)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Portrait~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isPortrait)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-PortraitUpsideDown~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isLandscapeRight)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeRight~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Landscape~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 750)\n\t\t\t\t{\n\t\t\t\t\t//iphone 6/7/8\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tfilePath = \"Default-375w-667h@2x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 640)\n\t\t\t\t{\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tif(Capabilities.screenResolutionY == 1136)\n\t\t\t\t\t{\n\t\t\t\t\t\t//iphone 5/5c/5s\n\t\t\t\t\t\tfilePath = \"Default-568h@2x~iphone.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//iphone 4/4s\n\t\t\t\t\t\tfilePath = \"Default@2x~iphone.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 320)\n\t\t\t\t{\n\t\t\t\t\t//iphone 3gs\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tfilePath = \"Default~iphone.png\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(filePath)\n\t\t\t{\n\t\t\t\tvar file:File = File.applicationDirectory.resolvePath(filePath);\n\t\t\t\tif(file.exists)\n\t\t\t\t{\n\t\t\t\t\tvar bytes:ByteArray = new ByteArray();\n\t\t\t\t\tvar stream:FileStream = new FileStream();\n\t\t\t\t\tstream.open(file, FileMode.READ);\n\t\t\t\t\tstream.readBytes(bytes, 0, stream.bytesAvailable);\n\t\t\t\t\tstream.close();\n\t\t\t\t\tthis._launchImage = new Loader();\n\t\t\t\t\tthis._launchImage.loadBytes(bytes);\n\t\t\t\t\tthis.addChild(this._launchImage);\n\t\t\t\t\tthis._savedAutoOrients = this.stage.autoOrients;\n\t\t\t\t\tthis.stage.autoOrients = false;\n\t\t\t\t\tif(isPortraitOnly)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.stage.setOrientation(StageOrientation.DEFAULT);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function loaderInfo_completeHandler(event:Event):void\n\t\t{\n\t\t\tStarling.multitouchEnabled = true;\n\t\t\tthis._starling = new Starling(Main, this.stage, null, null, Context3DRenderMode.AUTO, Context3DProfile.BASELINE);\n\t\t\tthis._starling.supportHighResolutions = true;\n\t\t\tthis._starling.skipUnchangedFrames = true;\n\t\t\tthis._starling.start();\n\t\t\tif(this._launchImage)\n\t\t\t{\n\t\t\t\tthis._starling.addEventListener(\"rootCreated\", starling_rootCreatedHandler);\n\t\t\t}\n\t\t\tthis._scaler = new ScreenDensityScaleFactorManager(this._starling);\n\n\t\t\tthis.stage.addEventListener(Event.DEACTIVATE, stage_deactivateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function starling_rootCreatedHandler(event:Object):void\n\t\t{\n\t\t\tif(this._launchImage)\n\t\t\t{\n\t\t\t\tthis.removeChild(this._launchImage);\n\t\t\t\tthis._launchImage.unloadAndStop(true);\n\t\t\t\tthis._launchImage = null;\n\t\t\t\tthis.stage.autoOrients = this._savedAutoOrients;\n\t\t\t}\n\t\t}\n\n\t\tprivate function stage_deactivateHandler(event:Event):void\n\t\t{\n\t\t\tthis._starling.stop(true);\n\t\t\tthis.stage.addEventListener(Event.ACTIVATE, stage_activateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function stage_activateHandler(event:Event):void\n\t\t{\n\t\t\tthis.stage.removeEventListener(Event.ACTIVATE, stage_activateHandler);\n\t\t\tthis._starling.start();\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "examples/LayoutExplorer/source/LayoutExplorerWeb.as",
    "content": "package\n{\n\timport feathers.system.DeviceCapabilities;\n\n\timport flash.display.MovieClip;\n\timport flash.display.StageAlign;\n\timport flash.display.StageScaleMode;\n\timport flash.events.Event;\n\timport flash.geom.Rectangle;\n\timport flash.ui.ContextMenu;\n\timport flash.utils.getDefinitionByName;\n\n\timport starling.core.Starling;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#4a4137\")]\n\tpublic class LayoutExplorerWeb extends MovieClip\n\t{\n\t\tpublic function LayoutExplorerWeb()\n\t\t{\n\t\t\tvar menu:ContextMenu = new ContextMenu();\n\t\t\tmenu.hideBuiltInItems();\n\t\t\tthis.contextMenu = menu;\n\t\t\t\n\t\t\tif(this.stage)\n\t\t\t{\n\t\t\t\tthis.stage.align = StageAlign.TOP_LEFT;\n\t\t\t\tthis.stage.scaleMode = StageScaleMode.NO_SCALE;\n\t\t\t}\n\t\t\t\n\t\t\tthis.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);\n\t\t}\n\t\t\n\t\tprivate var _starling:Starling;\n\t\t\n\t\tprivate function start():void\n\t\t{\n\t\t\tthis.gotoAndStop(2);\n\t\t\tthis.graphics.clear();\n\n\t\t\t//simulating iPhone Retina\n\t\t\tDeviceCapabilities.dpi = 326;\n\t\t\t\n\t\t\tStarling.multitouchEnabled = true;\n\t\t\tvar MainType:Class = getDefinitionByName(\"feathers.examples.layoutExplorer.Main\") as Class;\n\t\t\tthis._starling = new Starling(MainType, this.stage, new Rectangle(0, 0, 960, 640));\n\t\t\tthis._starling.supportHighResolutions = true;\n\t\t\tthis._starling.skipUnchangedFrames = true;\n\t\t\tthis._starling.stage.stageWidth = 480;\n\t\t\tthis._starling.stage.stageHeight = 320;\n\t\t\tthis._starling.start();\n\t\t}\n\t\t\n\t\tprivate function loaderInfo_completeHandler(event:Event):void\n\t\t{\n\t\t\tthis.start();\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/LayoutExplorer/source/feathers/examples/layoutExplorer/Main.as",
    "content": "package feathers.examples.layoutExplorer\n{\n\timport feathers.controls.Drawers;\n\timport feathers.controls.StackScreenNavigator;\n\timport feathers.controls.StackScreenNavigatorItem;\n\timport feathers.examples.layoutExplorer.data.FlowLayoutSettings;\n\timport feathers.examples.layoutExplorer.data.HorizontalLayoutSettings;\n\timport feathers.examples.layoutExplorer.data.SlideShowLayoutSettings;\n\timport feathers.examples.layoutExplorer.data.TiledColumnsLayoutSettings;\n\timport feathers.examples.layoutExplorer.data.TiledRowsLayoutSettings;\n\timport feathers.examples.layoutExplorer.data.VerticalLayoutSettings;\n\timport feathers.examples.layoutExplorer.data.WaterfallLayoutSettings;\n\timport feathers.examples.layoutExplorer.screens.AnchorLayoutScreen;\n\timport feathers.examples.layoutExplorer.screens.FlowLayoutScreen;\n\timport feathers.examples.layoutExplorer.screens.FlowLayoutSettingsScreen;\n\timport feathers.examples.layoutExplorer.screens.HorizontalLayoutScreen;\n\timport feathers.examples.layoutExplorer.screens.HorizontalLayoutSettingsScreen;\n\timport feathers.examples.layoutExplorer.screens.MainMenuScreen;\n\timport feathers.examples.layoutExplorer.screens.SlideShowLayoutScreen;\n\timport feathers.examples.layoutExplorer.screens.SlideShowLayoutSettingsScreen;\n\timport feathers.examples.layoutExplorer.screens.TiledColumnsLayoutScreen;\n\timport feathers.examples.layoutExplorer.screens.TiledColumnsLayoutSettingsScreen;\n\timport feathers.examples.layoutExplorer.screens.TiledRowsLayoutScreen;\n\timport feathers.examples.layoutExplorer.screens.TiledRowsLayoutSettingsScreen;\n\timport feathers.examples.layoutExplorer.screens.VerticalLayoutScreen;\n\timport feathers.examples.layoutExplorer.screens.VerticalLayoutSettingsScreen;\n\timport feathers.examples.layoutExplorer.screens.WaterfallLayoutScreen;\n\timport feathers.examples.layoutExplorer.screens.WaterfallLayoutSettingsScreen;\n\timport feathers.layout.Orientation;\n\timport feathers.motion.Cover;\n\timport feathers.motion.Reveal;\n\timport feathers.motion.Slide;\n\timport feathers.system.DeviceCapabilities;\n\timport feathers.themes.MetalWorksMobileTheme;\n\n\timport starling.core.Starling;\n\timport starling.events.Event;\n\n\tpublic class Main extends Drawers\n\t{\n\t\tprivate static const MAIN_MENU:String = \"mainMenu\";\n\t\tprivate static const ANCHOR:String = \"anchor\";\n\t\tprivate static const FLOW:String = \"flow\";\n\t\tprivate static const HORIZONTAL:String = \"horizontal\";\n\t\tprivate static const VERTICAL:String = \"vertical\";\n\t\tprivate static const TILED_ROWS:String = \"tiledRows\";\n\t\tprivate static const TILED_COLUMNS:String = \"tiledColumns\";\n\t\tprivate static const WATERFALL:String = \"waterfall\";\n\t\tprivate static const SLIDE_SHOW:String = \"slideShow\";\n\t\tprivate static const FLOW_SETTINGS:String = \"flowSettings\";\n\t\tprivate static const HORIZONTAL_SETTINGS:String = \"horizontalSettings\";\n\t\tprivate static const VERTICAL_SETTINGS:String = \"verticalSettings\";\n\t\tprivate static const TILED_ROWS_SETTINGS:String = \"tiledRowsSettings\";\n\t\tprivate static const TILED_COLUMNS_SETTINGS:String = \"tiledColumnsSettings\";\n\t\tprivate static const WATERFALL_SETTINGS:String = \"waterfallSettings\";\n\t\tprivate static const SLIDE_SHOW_SETTINGS:String = \"slideShowSettings\";\n\n\t\tprivate static const MAIN_MENU_EVENTS:Object =\n\t\t{\n\t\t\tshowAnchor: ANCHOR,\n\t\t\tshowFlow: FLOW,\n\t\t\tshowHorizontal: HORIZONTAL,\n\t\t\tshowVertical: VERTICAL,\n\t\t\tshowTiledRows: TILED_ROWS,\n\t\t\tshowTiledColumns: TILED_COLUMNS,\n\t\t\tshowWaterfall: WATERFALL,\n\t\t\tshowSlideShow: SLIDE_SHOW\n\t\t};\n\n\t\tpublic function Main()\n\t\t{\n\t\t\t//set up the theme right away!\n\t\t\tnew MetalWorksMobileTheme();\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _navigator:StackScreenNavigator;\n\t\tprivate var _menu:MainMenuScreen;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis._navigator = new StackScreenNavigator();\n\t\t\t//we're using Drawers because we want to display the menu on the\n\t\t\t//side when running on tablets.\n\t\t\tthis.content = this._navigator;\n\n\t\t\tvar anchorItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(AnchorLayoutScreen);\n\t\t\tanchorItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._navigator.addScreen(ANCHOR, anchorItem);\n\n\t\t\tvar flowLayoutSettings:FlowLayoutSettings = new FlowLayoutSettings();\n\t\t\tvar flowItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(FlowLayoutScreen);\n\t\t\tflowItem.setScreenIDForPushEvent(FlowLayoutScreen.SHOW_SETTINGS, FLOW_SETTINGS);\n\t\t\tflowItem.addPopEvent(Event.COMPLETE);\n\t\t\tflowItem.properties.settings = flowLayoutSettings;\n\t\t\tthis._navigator.addScreen(FLOW, flowItem);\n\n\t\t\tvar flowSettingsItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(FlowLayoutSettingsScreen);\n\t\t\tflowSettingsItem.addPopEvent(Event.COMPLETE);\n\t\t\tflowSettingsItem.properties.settings = flowLayoutSettings;\n\t\t\tflowSettingsItem.pushTransition = Cover.createCoverUpTransition();\n\t\t\tflowSettingsItem.popTransition = Reveal.createRevealDownTransition();\n\t\t\tthis._navigator.addScreen(FLOW_SETTINGS, flowSettingsItem);\n\n\t\t\tvar horizontalLayoutSettings:HorizontalLayoutSettings = new HorizontalLayoutSettings();\n\t\t\tvar horizontalItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(HorizontalLayoutScreen);\n\t\t\thorizontalItem.setScreenIDForPushEvent(HorizontalLayoutScreen.SHOW_SETTINGS, HORIZONTAL_SETTINGS);\n\t\t\thorizontalItem.addPopEvent(Event.COMPLETE);\n\t\t\thorizontalItem.properties.settings = horizontalLayoutSettings;\n\t\t\tthis._navigator.addScreen(HORIZONTAL, horizontalItem);\n\n\t\t\tvar horizontalSettingsItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(HorizontalLayoutSettingsScreen);\n\t\t\thorizontalSettingsItem.addPopEvent(Event.COMPLETE);\n\t\t\thorizontalSettingsItem.properties.settings = horizontalLayoutSettings;\n\t\t\thorizontalSettingsItem.pushTransition = Cover.createCoverUpTransition();\n\t\t\thorizontalSettingsItem.popTransition = Reveal.createRevealDownTransition();\n\t\t\tthis._navigator.addScreen(HORIZONTAL_SETTINGS, horizontalSettingsItem);\n\n\t\t\tvar verticalLayoutSettings:VerticalLayoutSettings = new VerticalLayoutSettings();\n\t\t\tvar verticalItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(VerticalLayoutScreen);\n\t\t\tverticalItem.setScreenIDForPushEvent(VerticalLayoutScreen.SHOW_SETTINGS, VERTICAL_SETTINGS);\n\t\t\tverticalItem.addPopEvent(Event.COMPLETE);\n\t\t\tverticalItem.properties.settings = verticalLayoutSettings;\n\t\t\tthis._navigator.addScreen(VERTICAL, verticalItem);\n\n\t\t\tvar verticalSettingsItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(VerticalLayoutSettingsScreen);\n\t\t\tverticalSettingsItem.addPopEvent(Event.COMPLETE);\n\t\t\tverticalSettingsItem.properties.settings = verticalLayoutSettings;\n\t\t\tverticalSettingsItem.pushTransition = Cover.createCoverUpTransition();\n\t\t\tverticalSettingsItem.popTransition = Reveal.createRevealDownTransition();\n\t\t\tthis._navigator.addScreen(VERTICAL_SETTINGS, verticalSettingsItem);\n\n\t\t\tvar tiledRowsLayoutSettings:TiledRowsLayoutSettings = new TiledRowsLayoutSettings();\n\t\t\tvar tiledRowsItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(TiledRowsLayoutScreen);\n\t\t\ttiledRowsItem.setScreenIDForPushEvent(TiledRowsLayoutScreen.SHOW_SETTINGS, TILED_ROWS_SETTINGS);\n\t\t\ttiledRowsItem.addPopEvent(Event.COMPLETE);\n\t\t\ttiledRowsItem.properties.settings = tiledRowsLayoutSettings;\n\t\t\tthis._navigator.addScreen(TILED_ROWS, tiledRowsItem);\n\n\t\t\tvar tiledRowsSettingsItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(TiledRowsLayoutSettingsScreen);\n\t\t\ttiledRowsSettingsItem.addPopEvent(Event.COMPLETE);\n\t\t\ttiledRowsSettingsItem.properties.settings = tiledRowsLayoutSettings;\n\t\t\ttiledRowsSettingsItem.pushTransition = Cover.createCoverUpTransition();\n\t\t\ttiledRowsSettingsItem.popTransition = Reveal.createRevealDownTransition();\n\t\t\tthis._navigator.addScreen(TILED_ROWS_SETTINGS, tiledRowsSettingsItem);\n\n\t\t\tvar tiledColumnsLayoutSettings:TiledColumnsLayoutSettings = new TiledColumnsLayoutSettings();\n\t\t\tvar tiledColumnsItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(TiledColumnsLayoutScreen);\n\t\t\ttiledColumnsItem.setScreenIDForPushEvent(TiledColumnsLayoutScreen.SHOW_SETTINGS, TILED_COLUMNS_SETTINGS);\n\t\t\ttiledColumnsItem.addPopEvent(Event.COMPLETE);\n\t\t\ttiledColumnsItem.properties.settings = tiledColumnsLayoutSettings;\n\t\t\tthis._navigator.addScreen(TILED_COLUMNS, tiledColumnsItem);\n\n\t\t\tvar tiledColumnsSettingsItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(TiledColumnsLayoutSettingsScreen);\n\t\t\ttiledColumnsSettingsItem.addPopEvent(Event.COMPLETE);\n\t\t\ttiledColumnsSettingsItem.properties.settings = tiledColumnsLayoutSettings;\n\t\t\ttiledColumnsSettingsItem.pushTransition = Cover.createCoverUpTransition();\n\t\t\ttiledColumnsSettingsItem.popTransition = Reveal.createRevealDownTransition();\n\t\t\tthis._navigator.addScreen(TILED_COLUMNS_SETTINGS, tiledColumnsSettingsItem);\n\n\t\t\tvar waterfallLayoutSettings:WaterfallLayoutSettings = new WaterfallLayoutSettings();\n\t\t\tvar waterfallItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(WaterfallLayoutScreen);\n\t\t\twaterfallItem.setScreenIDForPushEvent(TiledColumnsLayoutScreen.SHOW_SETTINGS, WATERFALL_SETTINGS);\n\t\t\twaterfallItem.addPopEvent(Event.COMPLETE);\n\t\t\twaterfallItem.properties.settings = waterfallLayoutSettings;\n\t\t\tthis._navigator.addScreen(WATERFALL, waterfallItem);\n\n\t\t\tvar waterfallSettingsItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(WaterfallLayoutSettingsScreen);\n\t\t\twaterfallSettingsItem.addPopEvent(Event.COMPLETE);\n\t\t\twaterfallSettingsItem.properties.settings = waterfallLayoutSettings;\n\t\t\twaterfallSettingsItem.pushTransition = Cover.createCoverUpTransition();\n\t\t\twaterfallSettingsItem.popTransition = Reveal.createRevealDownTransition();\n\t\t\tthis._navigator.addScreen(WATERFALL_SETTINGS, waterfallSettingsItem);\n\n\t\t\tvar slideShowSettings:SlideShowLayoutSettings = new SlideShowLayoutSettings();\n\t\t\tvar slideShowItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(SlideShowLayoutScreen);\n\t\t\tslideShowItem.setScreenIDForPushEvent(SlideShowLayoutScreen.SHOW_SETTINGS, SLIDE_SHOW_SETTINGS);\n\t\t\tslideShowItem.addPopEvent(Event.COMPLETE);\n\t\t\tslideShowItem.properties.settings = slideShowSettings;\n\t\t\tthis._navigator.addScreen(SLIDE_SHOW, slideShowItem);\n\n\t\t\tvar slideShowSettingsItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(SlideShowLayoutSettingsScreen);\n\t\t\tslideShowSettingsItem.addPopEvent(Event.COMPLETE);\n\t\t\tslideShowSettingsItem.properties.settings = slideShowSettings;\n\t\t\tslideShowSettingsItem.pushTransition = Cover.createCoverUpTransition();\n\t\t\tslideShowSettingsItem.popTransition = Reveal.createRevealDownTransition();\n\t\t\tthis._navigator.addScreen(SLIDE_SHOW_SETTINGS, slideShowSettingsItem);\n\n\t\t\tif(DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\t//we don't want the screens bleeding outside the navigator's\n\t\t\t\t//bounds on top of a drawer when a transition is active, so\n\t\t\t\t//enable clipping.\n\t\t\t\tthis._navigator.clipContent = true;\n\t\t\t\tthis._menu = new MainMenuScreen();\n\t\t\t\tfor(var eventType:String in MAIN_MENU_EVENTS)\n\t\t\t\t{\n\t\t\t\t\tthis._menu.addEventListener(eventType, mainMenuEventHandler);\n\t\t\t\t}\n\t\t\t\tthis.leftDrawer = this._menu;\n\t\t\t\tthis.leftDrawerDockMode = Orientation.BOTH;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar mainMenuItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(MainMenuScreen);\n\t\t\t\tfor(eventType in MAIN_MENU_EVENTS)\n\t\t\t\t{\n\t\t\t\t\tmainMenuItem.setScreenIDForPushEvent(eventType, MAIN_MENU_EVENTS[eventType] as String);\n\t\t\t\t}\n\t\t\t\tthis._navigator.addScreen(MAIN_MENU, mainMenuItem);\n\t\t\t\tthis._navigator.rootScreenID = MAIN_MENU;\n\t\t\t}\n\n\t\t\tthis._navigator.pushTransition = Slide.createSlideLeftTransition();\n\t\t\tthis._navigator.popTransition = Slide.createSlideRightTransition();\n\t\t}\n\n\t\tprivate function mainMenuEventHandler(event:Event):void\n\t\t{\n\t\t\tvar screenName:String = MAIN_MENU_EVENTS[event.type] as String;\n\t\t\t//since this navigation is triggered by an external menu, we don't\n\t\t\t//want to push a new screen onto the stack. we want to start fresh.\n\t\t\tthis._navigator.rootScreenID = screenName;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/LayoutExplorer/source/feathers/examples/layoutExplorer/data/FlowLayoutSettings.as",
    "content": "package feathers.examples.layoutExplorer.data\n{\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\n\tpublic class FlowLayoutSettings\n\t{\n\t\tpublic function FlowLayoutSettings()\n\t\t{\n\t\t}\n\n\t\tpublic var itemCount:int = 75;\n\t\tpublic var horizontalAlign:String = HorizontalAlign.LEFT;\n\t\tpublic var verticalAlign:String = VerticalAlign.TOP;\n\t\tpublic var rowVerticalAlign:String = VerticalAlign.TOP;\n\t\tpublic var horizontalGap:Number = 2;\n\t\tpublic var verticalGap:Number = 2;\n\t\tpublic var paddingTop:Number = 0;\n\t\tpublic var paddingRight:Number = 0;\n\t\tpublic var paddingBottom:Number = 0;\n\t\tpublic var paddingLeft:Number = 0;\n\t}\n}\n"
  },
  {
    "path": "examples/LayoutExplorer/source/feathers/examples/layoutExplorer/data/HorizontalLayoutSettings.as",
    "content": "package feathers.examples.layoutExplorer.data\n{\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\n\tpublic class HorizontalLayoutSettings\n\t{\n\t\tpublic function HorizontalLayoutSettings()\n\t\t{\n\t\t}\n\n\t\tpublic var itemCount:int = 75;\n\t\tpublic var horizontalAlign:String = HorizontalAlign.LEFT;\n\t\tpublic var verticalAlign:String = VerticalAlign.TOP;\n\t\tpublic var gap:Number = 2;\n\t\tpublic var paddingTop:Number = 0;\n\t\tpublic var paddingRight:Number = 0;\n\t\tpublic var paddingBottom:Number = 0;\n\t\tpublic var paddingLeft:Number = 0;\n\t}\n}\n"
  },
  {
    "path": "examples/LayoutExplorer/source/feathers/examples/layoutExplorer/data/SlideShowLayoutSettings.as",
    "content": "package feathers.examples.layoutExplorer.data\n{\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\n\tpublic class SlideShowLayoutSettings\n\t{\n\t\tpublic function SlideShowLayoutSettings()\n\t\t{\n\t\t}\n\n\t\tpublic var itemCount:int = 5;\n\t\tpublic var horizontalAlign:String = HorizontalAlign.CENTER;\n\t\tpublic var verticalAlign:String = VerticalAlign.MIDDLE;\n\t\tpublic var paddingTop:Number = 0;\n\t\tpublic var paddingRight:Number = 0;\n\t\tpublic var paddingBottom:Number = 0;\n\t\tpublic var paddingLeft:Number = 0;\n\t}\n}\n"
  },
  {
    "path": "examples/LayoutExplorer/source/feathers/examples/layoutExplorer/data/TiledColumnsLayoutSettings.as",
    "content": "package feathers.examples.layoutExplorer.data\n{\n\timport feathers.layout.Direction;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.TiledColumnsLayout;\n\timport feathers.layout.VerticalAlign;\n\n\tpublic class TiledColumnsLayoutSettings\n\t{\n\t\tpublic function TiledColumnsLayoutSettings()\n\t\t{\n\t\t}\n\n\t\tpublic var itemCount:int = 75;\n\t\tpublic var requestedRowCount:int = 0;\n\t\tpublic var paging:String = Direction.NONE;\n\t\tpublic var horizontalAlign:String = HorizontalAlign.LEFT;\n\t\tpublic var verticalAlign:String = VerticalAlign.TOP;\n\t\tpublic var tileHorizontalAlign:String = HorizontalAlign.LEFT;\n\t\tpublic var tileVerticalAlign:String = VerticalAlign.TOP;\n\t\tpublic var horizontalGap:Number = 2;\n\t\tpublic var verticalGap:Number = 2;\n\t\tpublic var paddingTop:Number = 0;\n\t\tpublic var paddingRight:Number = 0;\n\t\tpublic var paddingBottom:Number = 0;\n\t\tpublic var paddingLeft:Number = 0;\n\t}\n}\n"
  },
  {
    "path": "examples/LayoutExplorer/source/feathers/examples/layoutExplorer/data/TiledRowsLayoutSettings.as",
    "content": "package feathers.examples.layoutExplorer.data\n{\n\timport feathers.layout.Direction;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.TiledRowsLayout;\n\timport feathers.layout.VerticalAlign;\n\n\tpublic class TiledRowsLayoutSettings\n\t{\n\t\tpublic function TiledRowsLayoutSettings()\n\t\t{\n\t\t}\n\n\t\tpublic var paging:String = Direction.NONE;\n\t\tpublic var itemCount:int = 75;\n\t\tpublic var requestedColumnCount:int = 0;\n\t\tpublic var horizontalAlign:String = HorizontalAlign.LEFT;\n\t\tpublic var verticalAlign:String = VerticalAlign.TOP;\n\t\tpublic var tileHorizontalAlign:String = HorizontalAlign.LEFT;\n\t\tpublic var tileVerticalAlign:String = VerticalAlign.TOP;\n\t\tpublic var horizontalGap:Number = 2;\n\t\tpublic var verticalGap:Number = 2;\n\t\tpublic var paddingTop:Number = 0;\n\t\tpublic var paddingRight:Number = 0;\n\t\tpublic var paddingBottom:Number = 0;\n\t\tpublic var paddingLeft:Number = 0;\n\t}\n}\n"
  },
  {
    "path": "examples/LayoutExplorer/source/feathers/examples/layoutExplorer/data/VerticalLayoutSettings.as",
    "content": "package feathers.examples.layoutExplorer.data\n{\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\n\tpublic class VerticalLayoutSettings\n\t{\n\t\tpublic function VerticalLayoutSettings()\n\t\t{\n\t\t}\n\n\t\tpublic var itemCount:int = 75;\n\t\tpublic var horizontalAlign:String = HorizontalAlign.LEFT;\n\t\tpublic var verticalAlign:String = VerticalAlign.TOP;\n\t\tpublic var gap:Number = 2;\n\t\tpublic var paddingTop:Number = 0;\n\t\tpublic var paddingRight:Number = 0;\n\t\tpublic var paddingBottom:Number = 0;\n\t\tpublic var paddingLeft:Number = 0;\n\t}\n}\n"
  },
  {
    "path": "examples/LayoutExplorer/source/feathers/examples/layoutExplorer/data/WaterfallLayoutSettings.as",
    "content": "package feathers.examples.layoutExplorer.data\n{\n\timport feathers.layout.HorizontalAlign;\n\n\tpublic class WaterfallLayoutSettings\n\t{\n\t\tpublic function WaterfallLayoutSettings()\n\t\t{\n\t\t}\n\n\t\tpublic var itemCount:int = 75;\n\t\tpublic var requestedColumnCount:int = 0;\n\t\tpublic var horizontalAlign:String = HorizontalAlign.CENTER;\n\t\tpublic var horizontalGap:Number = 2;\n\t\tpublic var verticalGap:Number = 2;\n\t\tpublic var paddingTop:Number = 0;\n\t\tpublic var paddingRight:Number = 0;\n\t\tpublic var paddingBottom:Number = 0;\n\t\tpublic var paddingLeft:Number = 0;\n\t}\n}\n"
  },
  {
    "path": "examples/LayoutExplorer/source/feathers/examples/layoutExplorer/screens/AnchorLayoutScreen.as",
    "content": "package feathers.examples.layoutExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.Label;\n\timport feathers.controls.PanelScreen;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class AnchorLayoutScreen extends PanelScreen\n\t{\n\t\tpublic function AnchorLayoutScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Anchor Layout\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tvar centeredLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tcenteredLayoutData.horizontalCenter = 0;\n\t\t\tcenteredLayoutData.verticalCenter = 0;\n\t\t\tvar label1:Label = new Label();\n\t\t\tlabel1.text = \"(Rotate device to see the layout update!)\";\n\t\t\tlabel1.layoutData = centeredLayoutData;\n\t\t\tthis.addChild(label1);\n\n\t\t\tvar topRightLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\ttopRightLayoutData.top = 20;\n\t\t\ttopRightLayoutData.right = 20;\n\t\t\tvar button1:Button = new Button();\n\t\t\tbutton1.label = \"This button is positioned\\nat the top right corner.\";\n\t\t\tbutton1.layoutData = topRightLayoutData;\n\t\t\tthis.addChild(button1);\n\n\t\t\tvar fillBottomLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tfillBottomLayoutData.left = 20;\n\t\t\tfillBottomLayoutData.right = 20;\n\t\t\tfillBottomLayoutData.bottom = 20;\n\t\t\tvar button2:Button = new Button();\n\t\t\tbutton2.label = \"This button stretches across the bottom.\";\n\t\t\tbutton2.layoutData = fillBottomLayoutData;\n\t\t\tthis.addChild(button2);\n\n\t\t\tvar relativeLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\trelativeLayoutData.bottom = 20;\n\t\t\trelativeLayoutData.bottomAnchorDisplayObject = button2;\n\t\t\trelativeLayoutData.horizontalCenter = 0;\n\t\t\tvar label2:Label = new Label();\n\t\t\tlabel2.text = \"The label is positioned relative to the button.\";\n\t\t\tlabel2.layoutData = relativeLayoutData;\n\t\t\tthis.addChild(label2);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/LayoutExplorer/source/feathers/examples/layoutExplorer/screens/FlowLayoutScreen.as",
    "content": "package feathers.examples.layoutExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.PanelScreen;\n\timport feathers.events.FeathersEventType;\n\timport feathers.examples.layoutExplorer.data.FlowLayoutSettings;\n\timport feathers.layout.FlowLayout;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\t[Event(name=\"showSettings\",type=\"starling.events.Event\")]\n\n\tpublic class FlowLayoutScreen extends PanelScreen\n\t{\n\t\tpublic static const SHOW_SETTINGS:String = \"showSettings\";\n\n\t\tpublic function FlowLayoutScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic var settings:FlowLayoutSettings;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Flow Layout\";\n\n\t\t\tvar layout:FlowLayout = new FlowLayout();\n\t\t\tlayout.horizontalGap = this.settings.horizontalGap;\n\t\t\tlayout.verticalGap = this.settings.verticalGap;\n\t\t\tlayout.paddingTop = this.settings.paddingTop;\n\t\t\tlayout.paddingRight = this.settings.paddingRight;\n\t\t\tlayout.paddingBottom = this.settings.paddingBottom;\n\t\t\tlayout.paddingLeft = this.settings.paddingLeft;\n\t\t\tlayout.horizontalAlign = this.settings.horizontalAlign;\n\t\t\tlayout.verticalAlign = this.settings.verticalAlign;\n\t\t\tlayout.rowVerticalAlign = this.settings.rowVerticalAlign;\n\n\t\t\tthis.layout = layout;\n\t\t\tthis.snapScrollPositionsToPixels = true;\n\n\t\t\tvar minQuadSize:Number = Math.min(Starling.current.stage.stageWidth, Starling.current.stage.stageHeight) / 15;\n\t\t\tfor(var i:int = 0; i < this.settings.itemCount; i++)\n\t\t\t{\n\t\t\t\tvar size:Number = (minQuadSize + minQuadSize * 2 * Math.random());\n\t\t\t\tvar quad:Quad = new Quad(size, size, 0xff8800);\n\t\t\t\tthis.addChild(quad);\n\t\t\t}\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\tthis.addEventListener(FeathersEventType.TRANSITION_IN_COMPLETE, transitionInCompleteHandler);\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\tvar settingsButton:Button = new Button();\n\t\t\tsettingsButton.label = \"Settings\";\n\t\t\tsettingsButton.addEventListener(Event.TRIGGERED, settingsButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tsettingsButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function transitionInCompleteHandler(event:Event):void\n\t\t{\n\t\t\tthis.revealScrollBars();\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function settingsButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(SHOW_SETTINGS);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/LayoutExplorer/source/feathers/examples/layoutExplorer/screens/FlowLayoutSettingsScreen.as",
    "content": "package feathers.examples.layoutExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.List;\n\timport feathers.controls.NumericStepper;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.PickerList;\n\timport feathers.data.ArrayCollection;\n\timport feathers.data.ListCollection;\n\timport feathers.data.VectorCollection;\n\timport feathers.examples.layoutExplorer.data.FlowLayoutSettings;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class FlowLayoutSettingsScreen extends PanelScreen\n\t{\n\t\tpublic function FlowLayoutSettingsScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic var settings:FlowLayoutSettings;\n\n\t\tprivate var _list:List;\n\n\t\tprivate var _itemCountStepper:NumericStepper;\n\t\tprivate var _horizontalGapStepper:NumericStepper;\n\t\tprivate var _verticalGapStepper:NumericStepper;\n\t\tprivate var _paddingTopStepper:NumericStepper;\n\t\tprivate var _paddingRightStepper:NumericStepper;\n\t\tprivate var _paddingBottomStepper:NumericStepper;\n\t\tprivate var _paddingLeftStepper:NumericStepper;\n\t\tprivate var _horizontalAlignPicker:PickerList;\n\t\tprivate var _verticalAlignPicker:PickerList;\n\t\tprivate var _rowVerticalAlignPicker:PickerList;\n\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//icon and accessory display objects in the list's data provider\n\t\t\t//won't be automatically disposed because feathers cannot know if\n\t\t\t//they need to be used again elsewhere or not. we need to dispose\n\t\t\t//them manually.\n\t\t\tthis._list.dataProvider.dispose(disposeItemAccessory);\n\n\t\t\t//never forget to call super.dispose() because you don't want to\n\t\t\t//create a memory leak!\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Flow Layout Settings\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._itemCountStepper = new NumericStepper();\n\t\t\tthis._itemCountStepper.minimum = 1;\n\t\t\t//the layout can certainly handle more. this value is arbitrary.\n\t\t\tthis._itemCountStepper.maximum = 100;\n\t\t\tthis._itemCountStepper.step = 1;\n\t\t\tthis._itemCountStepper.value = this.settings.itemCount;\n\t\t\tthis._itemCountStepper.addEventListener(Event.CHANGE, itemCountStepper_changeHandler);\n\n\t\t\tthis._horizontalAlignPicker = new PickerList();\n\t\t\tthis._horizontalAlignPicker.typicalItem = HorizontalAlign.CENTER;\n\t\t\tthis._horizontalAlignPicker.dataProvider = new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\tHorizontalAlign.LEFT,\n\t\t\t\tHorizontalAlign.CENTER,\n\t\t\t\tHorizontalAlign.RIGHT\n\t\t\t]);\n\t\t\tthis._horizontalAlignPicker.selectedItem = this.settings.horizontalAlign;\n\t\t\tthis._horizontalAlignPicker.addEventListener(Event.CHANGE, horizontalAlignPicker_changeHandler);\n\n\t\t\tthis._verticalAlignPicker = new PickerList();\n\t\t\tthis._verticalAlignPicker.typicalItem = VerticalAlign.BOTTOM;\n\t\t\tthis._verticalAlignPicker.dataProvider = new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\tVerticalAlign.TOP,\n\t\t\t\tVerticalAlign.MIDDLE,\n\t\t\t\tVerticalAlign.BOTTOM,\n\t\t\t]);\n\t\t\tthis._verticalAlignPicker.selectedItem = this.settings.verticalAlign;\n\t\t\tthis._verticalAlignPicker.addEventListener(Event.CHANGE, verticalAlignPicker_changeHandler);\n\n\t\t\tthis._rowVerticalAlignPicker = new PickerList();\n\t\t\tthis._rowVerticalAlignPicker.typicalItem = VerticalAlign.BOTTOM;\n\t\t\tthis._rowVerticalAlignPicker.dataProvider = new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\tVerticalAlign.TOP,\n\t\t\t\tVerticalAlign.MIDDLE,\n\t\t\t\tVerticalAlign.BOTTOM,\n\t\t\t]);\n\t\t\tthis._rowVerticalAlignPicker.selectedItem = this.settings.rowVerticalAlign;\n\t\t\tthis._rowVerticalAlignPicker.addEventListener(Event.CHANGE, rowVerticalAlignPicker_changeHandler);\n\n\t\t\tthis._horizontalGapStepper = new NumericStepper();\n\t\t\tthis._horizontalGapStepper.minimum = 0;\n\t\t\t//these maximum values are completely arbitrary\n\t\t\tthis._horizontalGapStepper.maximum = 100;\n\t\t\tthis._horizontalGapStepper.step = 1;\n\t\t\tthis._horizontalGapStepper.value = this.settings.horizontalGap;\n\t\t\tthis._horizontalGapStepper.addEventListener(Event.CHANGE, horizontalGapStepper_changeHandler);\n\n\t\t\tthis._verticalGapStepper = new NumericStepper();\n\t\t\tthis._verticalGapStepper.minimum = 0;\n\t\t\tthis._verticalGapStepper.maximum = 100;\n\t\t\tthis._verticalGapStepper.step = 1;\n\t\t\tthis._verticalGapStepper.value = this.settings.verticalGap;\n\t\t\tthis._verticalGapStepper.addEventListener(Event.CHANGE, verticalGapStepper_changeHandler);\n\n\t\t\tthis._paddingTopStepper = new NumericStepper();\n\t\t\tthis._paddingTopStepper.minimum = 0;\n\t\t\tthis._paddingTopStepper.maximum = 100;\n\t\t\tthis._paddingTopStepper.step = 1;\n\t\t\tthis._paddingTopStepper.value = this.settings.paddingTop;\n\t\t\tthis._paddingTopStepper.addEventListener(Event.CHANGE, paddingTopStepper_changeHandler);\n\n\t\t\tthis._paddingRightStepper = new NumericStepper();\n\t\t\tthis._paddingRightStepper.minimum = 0;\n\t\t\tthis._paddingRightStepper.maximum = 100;\n\t\t\tthis._paddingRightStepper.step = 1;\n\t\t\tthis._paddingRightStepper.value = this.settings.paddingRight;\n\t\t\tthis._paddingRightStepper.addEventListener(Event.CHANGE, paddingRightStepper_changeHandler);\n\n\t\t\tthis._paddingBottomStepper = new NumericStepper();\n\t\t\tthis._paddingBottomStepper.minimum = 0;\n\t\t\tthis._paddingBottomStepper.maximum = 100;\n\t\t\tthis._paddingBottomStepper.step = 1;\n\t\t\tthis._paddingBottomStepper.value = this.settings.paddingBottom;\n\t\t\tthis._paddingBottomStepper.addEventListener(Event.CHANGE, paddingBottomStepper_changeHandler);\n\n\t\t\tthis._paddingLeftStepper = new NumericStepper();\n\t\t\tthis._paddingLeftStepper.minimum = 0;\n\t\t\tthis._paddingLeftStepper.maximum = 100;\n\t\t\tthis._paddingLeftStepper.step = 1;\n\t\t\tthis._paddingLeftStepper.value = this.settings.paddingLeft;\n\t\t\tthis._paddingLeftStepper.addEventListener(Event.CHANGE, paddingLeftStepper_changeHandler);\n\n\t\t\tthis._list = new List();\n\t\t\tthis._list.isSelectable = false;\n\t\t\tthis._list.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ label: \"Item Count\", accessory: this._itemCountStepper },\n\t\t\t\t{ label: \"horizontalAlign\", accessory: this._horizontalAlignPicker },\n\t\t\t\t{ label: \"verticalAlign\", accessory: this._verticalAlignPicker },\n\t\t\t\t{ label: \"rowVerticalAlign\", accessory: this._rowVerticalAlignPicker },\n\t\t\t\t{ label: \"horizontalGap\", accessory: this._horizontalGapStepper },\n\t\t\t\t{ label: \"verticalGap\", accessory: this._verticalGapStepper },\n\t\t\t\t{ label: \"paddingTop\", accessory: this._paddingTopStepper },\n\t\t\t\t{ label: \"paddingRight\", accessory: this._paddingRightStepper },\n\t\t\t\t{ label: \"paddingBottom\", accessory: this._paddingBottomStepper },\n\t\t\t\t{ label: \"paddingLeft\", accessory: this._paddingLeftStepper },\n\t\t\t]);\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis.addChild(this._list);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\tvar doneButton:Button = new Button();\n\t\t\tdoneButton.label = \"Done\";\n\t\t\tdoneButton.addEventListener(Event.TRIGGERED, doneButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tdoneButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function disposeItemAccessory(item:Object):void\n\t\t{\n\t\t\tDisplayObject(item.accessory).dispose();\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function doneButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function itemCountStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.itemCount = this._itemCountStepper.value;\n\t\t}\n\n\t\tprivate function horizontalAlignPicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.horizontalAlign = this._horizontalAlignPicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function verticalAlignPicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.verticalAlign = this._verticalAlignPicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function rowVerticalAlignPicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.rowVerticalAlign = this._rowVerticalAlignPicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function horizontalGapStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.horizontalGap = this._horizontalGapStepper.value;\n\t\t}\n\n\t\tprivate function verticalGapStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.verticalGap = this._verticalGapStepper.value;\n\t\t}\n\n\t\tprivate function paddingTopStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paddingTop = this._paddingTopStepper.value;\n\t\t}\n\n\t\tprivate function paddingRightStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paddingRight = this._paddingRightStepper.value;\n\t\t}\n\n\t\tprivate function paddingBottomStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paddingBottom = this._paddingBottomStepper.value;\n\t\t}\n\n\t\tprivate function paddingLeftStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paddingLeft = this._paddingLeftStepper.value;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/LayoutExplorer/source/feathers/examples/layoutExplorer/screens/HorizontalLayoutScreen.as",
    "content": "package feathers.examples.layoutExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.ScrollPolicy;\n\timport feathers.events.FeathersEventType;\n\timport feathers.examples.layoutExplorer.data.HorizontalLayoutSettings;\n\timport feathers.layout.HorizontalLayout;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\t[Event(name=\"showSettings\",type=\"starling.events.Event\")]\n\n\tpublic class HorizontalLayoutScreen extends PanelScreen\n\t{\n\t\tpublic static const SHOW_SETTINGS:String = \"showSettings\";\n\n\t\tpublic function HorizontalLayoutScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic var settings:HorizontalLayoutSettings;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Horizontal Layout\";\n\n\t\t\tvar layout:HorizontalLayout = new HorizontalLayout();\n\t\t\tlayout.gap = this.settings.gap;\n\t\t\tlayout.paddingTop = this.settings.paddingTop;\n\t\t\tlayout.paddingRight = this.settings.paddingRight;\n\t\t\tlayout.paddingBottom = this.settings.paddingBottom;\n\t\t\tlayout.paddingLeft = this.settings.paddingLeft;\n\t\t\tlayout.horizontalAlign = this.settings.horizontalAlign;\n\t\t\tlayout.verticalAlign = this.settings.verticalAlign;\n\n\t\t\tthis.layout = layout;\n\t\t\t//when the scroll policy is set to on, the \"elastic\" edges will be\n\t\t\t//active even when the max scroll position is zero\n\t\t\tthis.horizontalScrollPolicy = ScrollPolicy.ON;\n\t\t\tthis.snapScrollPositionsToPixels = true;\n\n\t\t\tvar minQuadSize:Number = Math.min(Starling.current.stage.stageWidth, Starling.current.stage.stageHeight) / 15;\n\t\t\tfor(var i:int = 0; i < this.settings.itemCount; i++)\n\t\t\t{\n\t\t\t\tvar size:Number = (minQuadSize + minQuadSize * 2 * Math.random());\n\t\t\t\tvar quad:Quad = new Quad(size, size, 0xff8800);\n\t\t\t\tthis.addChild(quad);\n\t\t\t}\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\n\t\t\tthis.addEventListener(FeathersEventType.TRANSITION_IN_COMPLETE, transitionInCompleteHandler);\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\tvar settingsButton:Button = new Button();\n\t\t\tsettingsButton.label = \"Settings\";\n\t\t\tsettingsButton.addEventListener(Event.TRIGGERED, settingsButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tsettingsButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function transitionInCompleteHandler(event:Event):void\n\t\t{\n\t\t\tthis.revealScrollBars();\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function settingsButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(SHOW_SETTINGS);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/LayoutExplorer/source/feathers/examples/layoutExplorer/screens/HorizontalLayoutSettingsScreen.as",
    "content": "package feathers.examples.layoutExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.List;\n\timport feathers.controls.NumericStepper;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.PickerList;\n\timport feathers.data.ArrayCollection;\n\timport feathers.data.ListCollection;\n\timport feathers.data.VectorCollection;\n\timport feathers.examples.layoutExplorer.data.HorizontalLayoutSettings;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class HorizontalLayoutSettingsScreen extends PanelScreen\n\t{\n\t\tpublic function HorizontalLayoutSettingsScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic var settings:HorizontalLayoutSettings;\n\n\t\tprivate var _list:List;\n\n\t\tprivate var _itemCountStepper:NumericStepper;\n\t\tprivate var _gapStepper:NumericStepper;\n\t\tprivate var _paddingTopStepper:NumericStepper;\n\t\tprivate var _paddingRightStepper:NumericStepper;\n\t\tprivate var _paddingBottomStepper:NumericStepper;\n\t\tprivate var _paddingLeftStepper:NumericStepper;\n\t\tprivate var _horizontalAlignPicker:PickerList;\n\t\tprivate var _verticalAlignPicker:PickerList;\n\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//icon and accessory display objects in the list's data provider\n\t\t\t//won't be automatically disposed because feathers cannot know if\n\t\t\t//they need to be used again elsewhere or not. we need to dispose\n\t\t\t//them manually.\n\t\t\tthis._list.dataProvider.dispose(disposeItemAccessory);\n\n\t\t\t//never forget to call super.dispose() because you don't want to\n\t\t\t//create a memory leak!\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Horizontal Layout Settings\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._itemCountStepper = new NumericStepper();\n\t\t\tthis._itemCountStepper.minimum = 1;\n\t\t\t//the layout can certainly handle more. this value is arbitrary.\n\t\t\tthis._itemCountStepper.maximum = 100;\n\t\t\tthis._itemCountStepper.step = 1;\n\t\t\tthis._itemCountStepper.value = this.settings.itemCount;\n\t\t\tthis._itemCountStepper.addEventListener(Event.CHANGE, itemCountStepper_changeHandler);\n\n\t\t\tthis._horizontalAlignPicker = new PickerList();\n\t\t\tthis._horizontalAlignPicker.typicalItem = HorizontalAlign.CENTER;\n\t\t\tthis._horizontalAlignPicker.dataProvider = new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\tHorizontalAlign.LEFT,\n\t\t\t\tHorizontalAlign.CENTER,\n\t\t\t\tHorizontalAlign.RIGHT\n\t\t\t]);\n\t\t\tthis._horizontalAlignPicker.selectedItem = this.settings.horizontalAlign;\n\t\t\tthis._horizontalAlignPicker.addEventListener(Event.CHANGE, horizontalAlignPicker_changeHandler);\n\n\t\t\tthis._verticalAlignPicker = new PickerList();\n\t\t\tthis._verticalAlignPicker.typicalItem = VerticalAlign.BOTTOM;\n\t\t\tthis._verticalAlignPicker.dataProvider = new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\tVerticalAlign.TOP,\n\t\t\t\tVerticalAlign.MIDDLE,\n\t\t\t\tVerticalAlign.BOTTOM,\n\t\t\t\tVerticalAlign.JUSTIFY\n\t\t\t]);\n\t\t\tthis._verticalAlignPicker.selectedItem = this.settings.verticalAlign;\n\t\t\tthis._verticalAlignPicker.addEventListener(Event.CHANGE, verticalAlignPicker_changeHandler);\n\n\t\t\tthis._gapStepper = new NumericStepper();\n\t\t\tthis._gapStepper.minimum = 0;\n\t\t\t//these maximum values are completely arbitrary\n\t\t\tthis._gapStepper.maximum = 100;\n\t\t\tthis._gapStepper.step = 1;\n\t\t\tthis._gapStepper.value = this.settings.gap;\n\t\t\tthis._gapStepper.addEventListener(Event.CHANGE, gapStepper_changeHandler);\n\n\t\t\tthis._paddingTopStepper = new NumericStepper();\n\t\t\tthis._paddingTopStepper.minimum = 0;\n\t\t\tthis._paddingTopStepper.maximum = 100;\n\t\t\tthis._paddingTopStepper.step = 1;\n\t\t\tthis._paddingTopStepper.value = this.settings.paddingTop;\n\t\t\tthis._paddingTopStepper.addEventListener(Event.CHANGE, paddingTopStepper_changeHandler);\n\n\t\t\tthis._paddingRightStepper = new NumericStepper();\n\t\t\tthis._paddingRightStepper.minimum = 0;\n\t\t\tthis._paddingRightStepper.maximum = 100;\n\t\t\tthis._paddingRightStepper.step = 1;\n\t\t\tthis._paddingRightStepper.value = this.settings.paddingRight;\n\t\t\tthis._paddingRightStepper.addEventListener(Event.CHANGE, paddingRightStepper_changeHandler);\n\n\t\t\tthis._paddingBottomStepper = new NumericStepper();\n\t\t\tthis._paddingBottomStepper.minimum = 0;\n\t\t\tthis._paddingBottomStepper.maximum = 100;\n\t\t\tthis._paddingBottomStepper.step = 1;\n\t\t\tthis._paddingBottomStepper.value = this.settings.paddingBottom;\n\t\t\tthis._paddingBottomStepper.addEventListener(Event.CHANGE, paddingBottomStepper_changeHandler);\n\n\t\t\tthis._paddingLeftStepper = new NumericStepper();\n\t\t\tthis._paddingLeftStepper.minimum = 0;\n\t\t\tthis._paddingLeftStepper.maximum = 100;\n\t\t\tthis._paddingLeftStepper.step = 1;\n\t\t\tthis._paddingLeftStepper.value = this.settings.paddingLeft;\n\t\t\tthis._paddingLeftStepper.addEventListener(Event.CHANGE, paddingLeftStepper_changeHandler);\n\n\t\t\tthis._list = new List();\n\t\t\tthis._list.isSelectable = false;\n\t\t\tthis._list.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ label: \"Item Count\", accessory: this._itemCountStepper },\n\t\t\t\t{ label: \"horizontalAlign\", accessory: this._horizontalAlignPicker },\n\t\t\t\t{ label: \"verticalAlign\", accessory: this._verticalAlignPicker },\n\t\t\t\t{ label: \"gap\", accessory: this._gapStepper },\n\t\t\t\t{ label: \"paddingTop\", accessory: this._paddingTopStepper },\n\t\t\t\t{ label: \"paddingRight\", accessory: this._paddingRightStepper },\n\t\t\t\t{ label: \"paddingBottom\", accessory: this._paddingBottomStepper },\n\t\t\t\t{ label: \"paddingLeft\", accessory: this._paddingLeftStepper },\n\t\t\t]);\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis.addChild(this._list);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\tvar doneButton:Button = new Button();\n\t\t\tdoneButton.label = \"Done\";\n\t\t\tdoneButton.addEventListener(Event.TRIGGERED, doneButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tdoneButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function disposeItemAccessory(item:Object):void\n\t\t{\n\t\t\tDisplayObject(item.accessory).dispose();\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function doneButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function itemCountStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.itemCount = this._itemCountStepper.value;\n\t\t}\n\n\t\tprivate function horizontalAlignPicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.horizontalAlign = this._horizontalAlignPicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function verticalAlignPicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.verticalAlign = this._verticalAlignPicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function gapStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.gap = this._gapStepper.value;\n\t\t}\n\n\t\tprivate function paddingTopStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paddingTop = this._paddingTopStepper.value;\n\t\t}\n\n\t\tprivate function paddingRightStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paddingRight = this._paddingRightStepper.value;\n\t\t}\n\n\t\tprivate function paddingBottomStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paddingBottom = this._paddingBottomStepper.value;\n\t\t}\n\n\t\tprivate function paddingLeftStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paddingLeft = this._paddingLeftStepper.value;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/LayoutExplorer/source/feathers/examples/layoutExplorer/screens/MainMenuScreen.as",
    "content": "package feathers.examples.layoutExplorer.screens\n{\n\timport feathers.controls.List;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.renderers.IListItemRenderer;\n\timport feathers.data.ArrayCollection;\n\timport feathers.data.ListCollection;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.events.Event;\n\n\t[Event(name=\"showAnchor\",type=\"starling.events.Event\")]\n\n\t[Event(name=\"showFlow\",type=\"starling.events.Event\")]\n\n\t[Event(name=\"showHorizontal\",type=\"starling.events.Event\")]\n\n\t[Event(name=\"showVertical\",type=\"starling.events.Event\")]\n\n\t[Event(name=\"showTiledRows\",type=\"starling.events.Event\")]\n\n\t[Event(name=\"showTiledColumns\",type=\"starling.events.Event\")]\n\n\t[Event(name=\"showWaterfall\",type=\"starling.events.Event\")]\n\n\tpublic class MainMenuScreen extends PanelScreen\n\t{\n\t\tpublic static const SHOW_ANCHOR:String = \"showAnchor\";\n\t\tpublic static const SHOW_FLOW:String = \"showFlow\";\n\t\tpublic static const SHOW_HORIZONTAL:String = \"showHorizontal\";\n\t\tpublic static const SHOW_VERTICAL:String = \"showVertical\";\n\t\tpublic static const SHOW_TILED_ROWS:String = \"showTiledRows\";\n\t\tpublic static const SHOW_TILED_COLUMNS:String = \"showTiledColumns\";\n\t\tpublic static const SHOW_WATERFALL:String = \"showWaterfall\";\n\t\tpublic static const SHOW_SLIDE_SHOW:String = \"showSlideShow\";\n\n\t\tpublic function MainMenuScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _list:List;\n\n\t\tpublic var savedVerticalScrollPosition:Number = 0;\n\t\tpublic var savedSelectedIndex:int = -1;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Layouts in Feathers\";\n\n\t\t\tvar isTablet:Boolean = DeviceCapabilities.isTablet(Starling.current.nativeStage);\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._list = new List();\n\t\t\tthis._list.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ text: \"Anchor\", event: SHOW_ANCHOR },\n\t\t\t\t{ text: \"Flow\", event: SHOW_FLOW },\n\t\t\t\t{ text: \"Horizontal\", event: SHOW_HORIZONTAL },\n\t\t\t\t{ text: \"Vertical\", event: SHOW_VERTICAL },\n\t\t\t\t{ text: \"Tiled Rows\", event: SHOW_TILED_ROWS },\n\t\t\t\t{ text: \"Tiled Columns\", event: SHOW_TILED_COLUMNS },\n\t\t\t\t{ text: \"Waterfall\", event: SHOW_WATERFALL },\n\t\t\t\t{ text: \"Slide Show\", event: SHOW_SLIDE_SHOW },\n\t\t\t]);\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis._list.verticalScrollPosition = this.savedVerticalScrollPosition;\n\n\t\t\tthis._list.itemRendererFactory = this.createItemRenderer;\n\n\t\t\tif(isTablet)\n\t\t\t{\n\t\t\t\tthis._list.addEventListener(Event.CHANGE, list_changeHandler);\n\t\t\t\tthis._list.selectedIndex = 0;\n\t\t\t\tthis._list.revealScrollBars();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._list.selectedIndex = this.savedSelectedIndex;\n\t\t\t\tthis.addEventListener(FeathersEventType.TRANSITION_IN_COMPLETE, transitionInCompleteHandler);\n\t\t\t}\n\t\t\tthis.addChild(this._list);\n\t\t}\n\n\t\tprivate function createItemRenderer():IListItemRenderer\n\t\t{\n\t\t\tvar isTablet:Boolean = DeviceCapabilities.isTablet(Starling.current.nativeStage);\n\t\t\t\n\t\t\tvar renderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\t\t\tif(!isTablet)\n\t\t\t{\n\t\t\t\trenderer.styleNameList.add(DefaultListItemRenderer.ALTERNATE_STYLE_NAME_DRILL_DOWN);\n\t\t\t}\n\n\t\t\t//enable the quick hit area to optimize hit tests when an item\n\t\t\t//is only selectable and doesn't have interactive children.\n\t\t\trenderer.isQuickHitAreaEnabled = true;\n\n\t\t\trenderer.labelField = \"text\";\n\t\t\treturn renderer;\n\t\t}\n\n\t\tprivate function transitionInCompleteHandler(event:Event):void\n\t\t{\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis._list.selectedIndex = -1;\n\t\t\t\tthis._list.addEventListener(Event.CHANGE, list_changeHandler);\n\t\t\t}\n\t\t\tthis._list.revealScrollBars();\n\t\t}\n\n\t\tprivate function list_changeHandler(event:Event):void\n\t\t{\n\t\t\tvar eventType:String = this._list.selectedItem.event as String;\n\t\t\tif(DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(eventType);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//save the list's scroll position and selected index so that we\n\t\t\t//can restore some context when this screen when we return to it\n\t\t\t//again later.\n\t\t\tthis.dispatchEventWith(eventType, false,\n\t\t\t{\n\t\t\t\tsavedVerticalScrollPosition: this._list.verticalScrollPosition,\n\t\t\t\tsavedSelectedIndex: this._list.selectedIndex\n\t\t\t});\n\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/LayoutExplorer/source/feathers/examples/layoutExplorer/screens/SlideShowLayoutScreen.as",
    "content": "package feathers.examples.layoutExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.Label;\n\timport feathers.controls.PanelScreen;\n\timport feathers.events.FeathersEventType;\n\timport feathers.examples.layoutExplorer.data.SlideShowLayoutSettings;\n\timport feathers.layout.SlideShowLayout;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\t[Event(name=\"showSettings\",type=\"starling.events.Event\")]\n\n\tpublic class SlideShowLayoutScreen extends PanelScreen\n\t{\n\t\tpublic static const SHOW_SETTINGS:String = \"showSettings\";\n\n\t\tpublic function SlideShowLayoutScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic var settings:SlideShowLayoutSettings;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Slide Show Layout\";\n\n\t\t\tthis.layout = new SlideShowLayout();\n\t\t\t//with this layout, you should always snap to pages\n\t\t\tthis.snapToPages = true;\n\n\t\t\tvar layout:SlideShowLayout = new SlideShowLayout();\n\t\t\tlayout.paddingTop = this.settings.paddingTop;\n\t\t\tlayout.paddingRight = this.settings.paddingRight;\n\t\t\tlayout.paddingBottom = this.settings.paddingBottom;\n\t\t\tlayout.paddingLeft = this.settings.paddingLeft;\n\t\t\tlayout.horizontalAlign = this.settings.horizontalAlign;\n\t\t\tlayout.verticalAlign = this.settings.verticalAlign;\n\n\t\t\tvar minQuadSize:Number = Math.min(Starling.current.stage.stageWidth, Starling.current.stage.stageHeight) / 2;\n\t\t\tfor(var i:int = 0; i < this.settings.itemCount; i++)\n\t\t\t{\n\t\t\t\tvar size:Number = (minQuadSize + minQuadSize * 0.5 * Math.random());\n\t\t\t\tvar quad:Quad = new Quad(size, size, 0xff8800);\n\t\t\t\tthis.addChild(quad);\n\t\t\t}\n\n\t\t\tthis.layout = layout;\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\n\t\t\tthis.addEventListener(FeathersEventType.TRANSITION_IN_COMPLETE, transitionInCompleteHandler);\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\tvar settingsButton:Button = new Button();\n\t\t\tsettingsButton.label = \"Settings\";\n\t\t\tsettingsButton.addEventListener(Event.TRIGGERED, settingsButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tsettingsButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function transitionInCompleteHandler(event:Event):void\n\t\t{\n\t\t\tthis.revealScrollBars();\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function settingsButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(SHOW_SETTINGS);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/LayoutExplorer/source/feathers/examples/layoutExplorer/screens/SlideShowLayoutSettingsScreen.as",
    "content": "package feathers.examples.layoutExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.List;\n\timport feathers.controls.NumericStepper;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.PickerList;\n\timport feathers.data.ArrayCollection;\n\timport feathers.data.ListCollection;\n\timport feathers.data.VectorCollection;\n\timport feathers.examples.layoutExplorer.data.SlideShowLayoutSettings;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class SlideShowLayoutSettingsScreen extends PanelScreen\n\t{\n\t\tpublic function SlideShowLayoutSettingsScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic var settings:SlideShowLayoutSettings;\n\n\t\tprivate var _list:List;\n\n\t\tprivate var _itemCountStepper:NumericStepper;\n\t\tprivate var _paddingTopStepper:NumericStepper;\n\t\tprivate var _paddingRightStepper:NumericStepper;\n\t\tprivate var _paddingBottomStepper:NumericStepper;\n\t\tprivate var _paddingLeftStepper:NumericStepper;\n\t\tprivate var _horizontalAlignPicker:PickerList;\n\t\tprivate var _verticalAlignPicker:PickerList;\n\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//icon and accessory display objects in the list's data provider\n\t\t\t//won't be automatically disposed because feathers cannot know if\n\t\t\t//they need to be used again elsewhere or not. we need to dispose\n\t\t\t//them manually.\n\t\t\tthis._list.dataProvider.dispose(disposeItemAccessory);\n\n\t\t\t//never forget to call super.dispose() because you don't want to\n\t\t\t//create a memory leak!\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Slide Show Layout Settings\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._itemCountStepper = new NumericStepper();\n\t\t\tthis._itemCountStepper.minimum = 1;\n\t\t\t//the layout can certainly handle more. this value is arbitrary.\n\t\t\tthis._itemCountStepper.maximum = 100;\n\t\t\tthis._itemCountStepper.step = 1;\n\t\t\tthis._itemCountStepper.value = this.settings.itemCount;\n\t\t\tthis._itemCountStepper.addEventListener(Event.CHANGE, itemCountStepper_changeHandler);\n\n\t\t\tthis._horizontalAlignPicker = new PickerList();\n\t\t\tthis._horizontalAlignPicker.typicalItem = HorizontalAlign.CENTER;\n\t\t\tthis._horizontalAlignPicker.dataProvider = new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\tHorizontalAlign.LEFT,\n\t\t\t\tHorizontalAlign.CENTER,\n\t\t\t\tHorizontalAlign.RIGHT,\n\t\t\t\tHorizontalAlign.JUSTIFY\n\t\t\t]);\n\t\t\tthis._horizontalAlignPicker.selectedItem = this.settings.horizontalAlign;\n\t\t\tthis._horizontalAlignPicker.addEventListener(Event.CHANGE, horizontalAlignPicker_changeHandler);\n\n\t\t\tthis._verticalAlignPicker = new PickerList();\n\t\t\tthis._verticalAlignPicker.typicalItem = VerticalAlign.BOTTOM;\n\t\t\tthis._verticalAlignPicker.dataProvider = new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\tVerticalAlign.TOP,\n\t\t\t\tVerticalAlign.MIDDLE,\n\t\t\t\tVerticalAlign.BOTTOM,\n\t\t\t\tVerticalAlign.JUSTIFY\n\t\t\t]);\n\t\t\tthis._verticalAlignPicker.selectedItem = this.settings.verticalAlign;\n\t\t\tthis._verticalAlignPicker.addEventListener(Event.CHANGE, verticalAlignPicker_changeHandler);\n\n\t\t\tthis._paddingTopStepper = new NumericStepper();\n\t\t\tthis._paddingTopStepper.minimum = 0;\n\t\t\tthis._paddingTopStepper.maximum = 100;\n\t\t\tthis._paddingTopStepper.step = 1;\n\t\t\tthis._paddingTopStepper.value = this.settings.paddingTop;\n\t\t\tthis._paddingTopStepper.addEventListener(Event.CHANGE, paddingTopStepper_changeHandler);\n\n\t\t\tthis._paddingRightStepper = new NumericStepper();\n\t\t\tthis._paddingRightStepper.minimum = 0;\n\t\t\tthis._paddingRightStepper.maximum = 100;\n\t\t\tthis._paddingRightStepper.step = 1;\n\t\t\tthis._paddingRightStepper.value = this.settings.paddingRight;\n\t\t\tthis._paddingRightStepper.addEventListener(Event.CHANGE, paddingRightStepper_changeHandler);\n\n\t\t\tthis._paddingBottomStepper = new NumericStepper();\n\t\t\tthis._paddingBottomStepper.minimum = 0;\n\t\t\tthis._paddingBottomStepper.maximum = 100;\n\t\t\tthis._paddingBottomStepper.step = 1;\n\t\t\tthis._paddingBottomStepper.value = this.settings.paddingBottom;\n\t\t\tthis._paddingBottomStepper.addEventListener(Event.CHANGE, paddingBottomStepper_changeHandler);\n\n\t\t\tthis._paddingLeftStepper = new NumericStepper();\n\t\t\tthis._paddingLeftStepper.minimum = 0;\n\t\t\tthis._paddingLeftStepper.maximum = 100;\n\t\t\tthis._paddingLeftStepper.step = 1;\n\t\t\tthis._paddingLeftStepper.value = this.settings.paddingLeft;\n\t\t\tthis._paddingLeftStepper.addEventListener(Event.CHANGE, paddingLeftStepper_changeHandler);\n\n\t\t\tthis._list = new List();\n\t\t\tthis._list.isSelectable = false;\n\t\t\tthis._list.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ label: \"Item Count\", accessory: this._itemCountStepper },\n\t\t\t\t{ label: \"horizontalAlign\", accessory: this._horizontalAlignPicker },\n\t\t\t\t{ label: \"verticalAlign\", accessory: this._verticalAlignPicker },\n\t\t\t\t{ label: \"paddingTop\", accessory: this._paddingTopStepper },\n\t\t\t\t{ label: \"paddingRight\", accessory: this._paddingRightStepper },\n\t\t\t\t{ label: \"paddingBottom\", accessory: this._paddingBottomStepper },\n\t\t\t\t{ label: \"paddingLeft\", accessory: this._paddingLeftStepper },\n\t\t\t]);\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis.addChild(this._list);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\tvar doneButton:Button = new Button();\n\t\t\tdoneButton.label = \"Done\";\n\t\t\tdoneButton.addEventListener(Event.TRIGGERED, doneButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tdoneButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function disposeItemAccessory(item:Object):void\n\t\t{\n\t\t\tDisplayObject(item.accessory).dispose();\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function doneButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function itemCountStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.itemCount = this._itemCountStepper.value;\n\t\t}\n\n\t\tprivate function horizontalAlignPicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.horizontalAlign = this._horizontalAlignPicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function verticalAlignPicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.verticalAlign = this._verticalAlignPicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function paddingTopStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paddingTop = this._paddingTopStepper.value;\n\t\t}\n\n\t\tprivate function paddingRightStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paddingRight = this._paddingRightStepper.value;\n\t\t}\n\n\t\tprivate function paddingBottomStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paddingBottom = this._paddingBottomStepper.value;\n\t\t}\n\n\t\tprivate function paddingLeftStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paddingLeft = this._paddingLeftStepper.value;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/LayoutExplorer/source/feathers/examples/layoutExplorer/screens/TiledColumnsLayoutScreen.as",
    "content": "package feathers.examples.layoutExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.PanelScreen;\n\timport feathers.events.FeathersEventType;\n\timport feathers.examples.layoutExplorer.data.TiledColumnsLayoutSettings;\n\timport feathers.layout.Direction;\n\timport feathers.layout.TiledColumnsLayout;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\t[Event(name=\"showSettings\",type=\"starling.events.Event\")]\n\n\tpublic class TiledColumnsLayoutScreen extends PanelScreen\n\t{\n\t\tpublic static const SHOW_SETTINGS:String = \"showSettings\";\n\n\t\tpublic function TiledColumnsLayoutScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic var settings:TiledColumnsLayoutSettings;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Tiled Columns Layout\";\n\n\t\t\tvar layout:TiledColumnsLayout = new TiledColumnsLayout();\n\t\t\tlayout.paging = this.settings.paging;\n\t\t\tlayout.requestedRowCount = this.settings.requestedRowCount;\n\t\t\tlayout.horizontalGap = this.settings.horizontalGap;\n\t\t\tlayout.verticalGap = this.settings.verticalGap;\n\t\t\tlayout.paddingTop = this.settings.paddingTop;\n\t\t\tlayout.paddingRight = this.settings.paddingRight;\n\t\t\tlayout.paddingBottom = this.settings.paddingBottom;\n\t\t\tlayout.paddingLeft = this.settings.paddingLeft;\n\t\t\tlayout.horizontalAlign = this.settings.horizontalAlign;\n\t\t\tlayout.verticalAlign = this.settings.verticalAlign;\n\t\t\tlayout.tileHorizontalAlign = this.settings.tileHorizontalAlign;\n\t\t\tlayout.tileVerticalAlign = this.settings.tileVerticalAlign;\n\n\t\t\tthis.layout = layout;\n\t\t\tthis.snapToPages = this.settings.paging != Direction.NONE;\n\t\t\tthis.snapScrollPositionsToPixels = true;\n\n\t\t\tvar minQuadSize:Number = Math.min(Starling.current.stage.stageWidth, Starling.current.stage.stageHeight) / 15;\n\t\t\tfor(var i:int = 0; i < this.settings.itemCount; i++)\n\t\t\t{\n\t\t\t\tvar size:Number = minQuadSize + minQuadSize * 2 * Math.random();\n\t\t\t\tvar quad:Quad = new Quad(size, size, 0xff8800);\n\t\t\t\tthis.addChild(quad);\n\t\t\t}\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\tthis.addEventListener(FeathersEventType.TRANSITION_IN_COMPLETE, transitionInCompleteHandler);\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\tvar settingsButton:Button = new Button();\n\t\t\tsettingsButton.label = \"Settings\";\n\t\t\tsettingsButton.addEventListener(Event.TRIGGERED, settingsButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tsettingsButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function transitionInCompleteHandler(event:Event):void\n\t\t{\n\t\t\tthis.revealScrollBars();\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function settingsButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(SHOW_SETTINGS);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/LayoutExplorer/source/feathers/examples/layoutExplorer/screens/TiledColumnsLayoutSettingsScreen.as",
    "content": "package feathers.examples.layoutExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.List;\n\timport feathers.controls.NumericStepper;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.PickerList;\n\timport feathers.data.ArrayCollection;\n\timport feathers.data.VectorCollection;\n\timport feathers.examples.layoutExplorer.data.TiledColumnsLayoutSettings;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.layout.Direction;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class TiledColumnsLayoutSettingsScreen extends PanelScreen\n\t{\n\t\tpublic function TiledColumnsLayoutSettingsScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic var settings:TiledColumnsLayoutSettings;\n\n\t\tprivate var _list:List;\n\n\t\tprivate var _itemCountStepper:NumericStepper;\n\t\tprivate var _requestedRowCountStepper:NumericStepper;\n\t\tprivate var _pagingPicker:PickerList;\n\t\tprivate var _horizontalGapStepper:NumericStepper;\n\t\tprivate var _verticalGapStepper:NumericStepper;\n\t\tprivate var _paddingTopStepper:NumericStepper;\n\t\tprivate var _paddingRightStepper:NumericStepper;\n\t\tprivate var _paddingBottomStepper:NumericStepper;\n\t\tprivate var _paddingLeftStepper:NumericStepper;\n\t\tprivate var _horizontalAlignPicker:PickerList;\n\t\tprivate var _verticalAlignPicker:PickerList;\n\t\tprivate var _tileHorizontalAlignPicker:PickerList;\n\t\tprivate var _tileVerticalAlignPicker:PickerList;\n\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//icon and accessory display objects in the list's data provider\n\t\t\t//won't be automatically disposed because feathers cannot know if\n\t\t\t//they need to be used again elsewhere or not. we need to dispose\n\t\t\t//them manually.\n\t\t\tthis._list.dataProvider.dispose(disposeItemAccessory);\n\n\t\t\t//never forget to call super.dispose() because you don't want to\n\t\t\t//create a memory leak!\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Tiled Columns Layout Settings\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._itemCountStepper = new NumericStepper();\n\t\t\tthis._itemCountStepper.minimum = 1;\n\t\t\t//the layout can certainly handle more. this value is arbitrary.\n\t\t\tthis._itemCountStepper.maximum = 100;\n\t\t\tthis._itemCountStepper.step = 1;\n\t\t\tthis._itemCountStepper.value = this.settings.itemCount;\n\t\t\tthis._itemCountStepper.addEventListener(Event.CHANGE, itemCountStepper_changeHandler);\n\n\t\t\tthis._requestedRowCountStepper = new NumericStepper();\n\t\t\tthis._requestedRowCountStepper.minimum = 0;\n\t\t\t//the layout can certainly handle more. this value is arbitrary.\n\t\t\tthis._requestedRowCountStepper.maximum = 10;\n\t\t\tthis._requestedRowCountStepper.step = 1;\n\t\t\tthis._requestedRowCountStepper.value = this.settings.requestedRowCount;\n\t\t\tthis._requestedRowCountStepper.addEventListener(Event.CHANGE, requestedRowCountStepper_changeHandler);\n\n\t\t\tthis._pagingPicker = new PickerList();\n\t\t\tthis._pagingPicker.typicalItem = Direction.HORIZONTAL;\n\t\t\tthis._pagingPicker.dataProvider = new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\tDirection.NONE,\n\t\t\t\tDirection.HORIZONTAL,\n\t\t\t\tDirection.VERTICAL\n\t\t\t]);\n\t\t\tthis._pagingPicker.selectedItem = this.settings.paging;\n\t\t\tthis._pagingPicker.addEventListener(Event.CHANGE, pagingPicker_changeHandler);\n\n\t\t\tthis._horizontalAlignPicker = new PickerList();\n\t\t\tthis._horizontalAlignPicker.typicalItem = HorizontalAlign.CENTER;\n\t\t\tthis._horizontalAlignPicker.dataProvider = new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\tHorizontalAlign.LEFT,\n\t\t\t\tHorizontalAlign.CENTER,\n\t\t\t\tHorizontalAlign.RIGHT\n\t\t\t]);\n\t\t\tthis._horizontalAlignPicker.selectedItem = this.settings.horizontalAlign;\n\t\t\tthis._horizontalAlignPicker.addEventListener(Event.CHANGE, horizontalAlignPicker_changeHandler);\n\n\t\t\tthis._verticalAlignPicker = new PickerList();\n\t\t\tthis._verticalAlignPicker.typicalItem = VerticalAlign.BOTTOM;\n\t\t\tthis._verticalAlignPicker.dataProvider = new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\tVerticalAlign.TOP,\n\t\t\t\tVerticalAlign.MIDDLE,\n\t\t\t\tVerticalAlign.BOTTOM\n\t\t\t]);\n\t\t\tthis._verticalAlignPicker.selectedItem = this.settings.verticalAlign;\n\t\t\tthis._verticalAlignPicker.addEventListener(Event.CHANGE, verticalAlignPicker_changeHandler);\n\n\t\t\tthis._tileHorizontalAlignPicker = new PickerList();\n\t\t\tthis._tileHorizontalAlignPicker.typicalItem = HorizontalAlign.CENTER;\n\t\t\tthis._tileHorizontalAlignPicker.dataProvider = new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\tHorizontalAlign.LEFT,\n\t\t\t\tHorizontalAlign.CENTER,\n\t\t\t\tHorizontalAlign.RIGHT,\n\t\t\t\tHorizontalAlign.JUSTIFY\n\t\t\t]);\n\t\t\tthis._tileHorizontalAlignPicker.selectedItem = this.settings.tileHorizontalAlign;\n\t\t\tthis._tileHorizontalAlignPicker.addEventListener(Event.CHANGE, tileHorizontalAlignPicker_changeHandler);\n\n\t\t\tthis._tileVerticalAlignPicker = new PickerList();\n\t\t\tthis._tileVerticalAlignPicker.typicalItem = VerticalAlign.BOTTOM;\n\t\t\tthis._tileVerticalAlignPicker.dataProvider = new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\tVerticalAlign.TOP,\n\t\t\t\tVerticalAlign.MIDDLE,\n\t\t\t\tVerticalAlign.BOTTOM,\n\t\t\t\tVerticalAlign.JUSTIFY\n\t\t\t]);\n\t\t\tthis._tileVerticalAlignPicker.selectedItem = this.settings.tileVerticalAlign;\n\t\t\tthis._tileVerticalAlignPicker.addEventListener(Event.CHANGE, tileVerticalAlignPicker_changeHandler);\n\n\t\t\tthis._horizontalGapStepper = new NumericStepper();\n\t\t\tthis._horizontalGapStepper.minimum = 0;\n\t\t\t//these maximum values are completely arbitrary\n\t\t\tthis._horizontalGapStepper.maximum = 100;\n\t\t\tthis._horizontalGapStepper.step = 1;\n\t\t\tthis._horizontalGapStepper.value = this.settings.horizontalGap;\n\t\t\tthis._horizontalGapStepper.addEventListener(Event.CHANGE, horizontalGapStepper_changeHandler);\n\n\t\t\tthis._verticalGapStepper = new NumericStepper();\n\t\t\tthis._verticalGapStepper.minimum = 0;\n\t\t\tthis._verticalGapStepper.maximum = 100;\n\t\t\tthis._verticalGapStepper.step = 1;\n\t\t\tthis._verticalGapStepper.value = this.settings.verticalGap;\n\t\t\tthis._verticalGapStepper.addEventListener(Event.CHANGE, verticalGapStepper_changeHandler);\n\n\t\t\tthis._paddingTopStepper = new NumericStepper();\n\t\t\tthis._paddingTopStepper.minimum = 0;\n\t\t\tthis._paddingTopStepper.maximum = 100;\n\t\t\tthis._paddingTopStepper.step = 1;\n\t\t\tthis._paddingTopStepper.value = this.settings.paddingTop;\n\t\t\tthis._paddingTopStepper.addEventListener(Event.CHANGE, paddingTopStepper_changeHandler);\n\n\t\t\tthis._paddingRightStepper = new NumericStepper();\n\t\t\tthis._paddingRightStepper.minimum = 0;\n\t\t\tthis._paddingRightStepper.maximum = 100;\n\t\t\tthis._paddingRightStepper.step = 1;\n\t\t\tthis._paddingRightStepper.value = this.settings.paddingRight;\n\t\t\tthis._paddingRightStepper.addEventListener(Event.CHANGE, paddingRightStepper_changeHandler);\n\n\t\t\tthis._paddingBottomStepper = new NumericStepper();\n\t\t\tthis._paddingBottomStepper.minimum = 0;\n\t\t\tthis._paddingBottomStepper.maximum = 100;\n\t\t\tthis._paddingBottomStepper.step = 1;\n\t\t\tthis._paddingBottomStepper.value = this.settings.paddingBottom;\n\t\t\tthis._paddingBottomStepper.addEventListener(Event.CHANGE, paddingBottomStepper_changeHandler);\n\n\t\t\tthis._paddingLeftStepper = new NumericStepper();\n\t\t\tthis._paddingLeftStepper.minimum = 0;\n\t\t\tthis._paddingLeftStepper.maximum = 100;\n\t\t\tthis._paddingLeftStepper.step = 1;\n\t\t\tthis._paddingLeftStepper.value = this.settings.paddingLeft;\n\t\t\tthis._paddingLeftStepper.addEventListener(Event.CHANGE, paddingLeftStepper_changeHandler);\n\n\t\t\tthis._list = new List();\n\t\t\tthis._list.isSelectable = false;\n\t\t\tthis._list.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ label: \"Item Count\", accessory: this._itemCountStepper },\n\t\t\t\t{ label: \"Requested Row Count\", accessory: this._requestedRowCountStepper },\n\t\t\t\t{ label: \"Paging\", accessory: this._pagingPicker },\n\t\t\t\t{ label: \"horizontalAlign\", accessory: this._horizontalAlignPicker },\n\t\t\t\t{ label: \"verticalAlign\", accessory: this._verticalAlignPicker },\n\t\t\t\t{ label: \"tileHorizontalAlign\", accessory: this._tileHorizontalAlignPicker },\n\t\t\t\t{ label: \"tileVerticalAlign\", accessory: this._tileVerticalAlignPicker },\n\t\t\t\t{ label: \"horizontalGap\", accessory: this._horizontalGapStepper },\n\t\t\t\t{ label: \"verticalGap\", accessory: this._verticalGapStepper },\n\t\t\t\t{ label: \"paddingTop\", accessory: this._paddingTopStepper },\n\t\t\t\t{ label: \"paddingRight\", accessory: this._paddingRightStepper },\n\t\t\t\t{ label: \"paddingBottom\", accessory: this._paddingBottomStepper },\n\t\t\t\t{ label: \"paddingLeft\", accessory: this._paddingLeftStepper },\n\t\t\t]);\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis.addChild(this._list);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\tvar doneButton:Button = new Button();\n\t\t\tdoneButton.label = \"Done\";\n\t\t\tdoneButton.addEventListener(Event.TRIGGERED, doneButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tdoneButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function disposeItemAccessory(item:Object):void\n\t\t{\n\t\t\tDisplayObject(item.accessory).dispose();\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function doneButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function itemCountStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.itemCount = this._itemCountStepper.value;\n\t\t}\n\n\t\tprivate function requestedRowCountStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.requestedRowCount = this._requestedRowCountStepper.value;\n\t\t}\n\n\t\tprivate function pagingPicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paging = this._pagingPicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function horizontalAlignPicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.horizontalAlign = this._horizontalAlignPicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function verticalAlignPicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.verticalAlign = this._verticalAlignPicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function tileHorizontalAlignPicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.tileHorizontalAlign = this._tileHorizontalAlignPicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function tileVerticalAlignPicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.tileVerticalAlign = this._tileVerticalAlignPicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function horizontalGapStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.horizontalGap = this._horizontalGapStepper.value;\n\t\t}\n\n\t\tprivate function verticalGapStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.verticalGap = this._verticalGapStepper.value;\n\t\t}\n\n\t\tprivate function paddingTopStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paddingTop = this._paddingTopStepper.value;\n\t\t}\n\n\t\tprivate function paddingRightStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paddingRight = this._paddingRightStepper.value;\n\t\t}\n\n\t\tprivate function paddingBottomStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paddingBottom = this._paddingBottomStepper.value;\n\t\t}\n\n\t\tprivate function paddingLeftStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paddingLeft = this._paddingLeftStepper.value;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/LayoutExplorer/source/feathers/examples/layoutExplorer/screens/TiledRowsLayoutScreen.as",
    "content": "package feathers.examples.layoutExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.PanelScreen;\n\timport feathers.events.FeathersEventType;\n\timport feathers.examples.layoutExplorer.data.TiledRowsLayoutSettings;\n\timport feathers.layout.Direction;\n\timport feathers.layout.TiledRowsLayout;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\t[Event(name=\"showSettings\",type=\"starling.events.Event\")]\n\n\tpublic class TiledRowsLayoutScreen extends PanelScreen\n\t{\n\t\tpublic static const SHOW_SETTINGS:String = \"showSettings\";\n\n\t\tpublic function TiledRowsLayoutScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic var settings:TiledRowsLayoutSettings;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Tiled Rows Layout\";\n\n\t\t\tvar layout:TiledRowsLayout = new TiledRowsLayout();\n\t\t\tlayout.paging = this.settings.paging;\n\t\t\tlayout.requestedColumnCount = this.settings.requestedColumnCount;\n\t\t\tlayout.horizontalGap = this.settings.horizontalGap;\n\t\t\tlayout.verticalGap = this.settings.verticalGap;\n\t\t\tlayout.paddingTop = this.settings.paddingTop;\n\t\t\tlayout.paddingRight = this.settings.paddingRight;\n\t\t\tlayout.paddingBottom = this.settings.paddingBottom;\n\t\t\tlayout.paddingLeft = this.settings.paddingLeft;\n\t\t\tlayout.horizontalAlign = this.settings.horizontalAlign;\n\t\t\tlayout.verticalAlign = this.settings.verticalAlign;\n\t\t\tlayout.tileHorizontalAlign = this.settings.tileHorizontalAlign;\n\t\t\tlayout.tileVerticalAlign = this.settings.tileVerticalAlign;\n\n\t\t\tthis.layout = layout;\n\t\t\tthis.snapToPages = this.settings.paging != Direction.NONE;\n\t\t\tthis.snapScrollPositionsToPixels = true;\n\n\t\t\tvar minQuadSize:Number = Math.min(Starling.current.stage.stageWidth, Starling.current.stage.stageHeight) / 15;\n\t\t\tfor(var i:int = 0; i < this.settings.itemCount; i++)\n\t\t\t{\n\t\t\t\tvar size:Number = (minQuadSize + minQuadSize * 2 * Math.random());\n\t\t\t\tvar quad:Quad = new Quad(size, size, 0xff8800);\n\t\t\t\tthis.addChild(quad);\n\t\t\t}\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\tthis.addEventListener(FeathersEventType.TRANSITION_IN_COMPLETE, transitionInCompleteHandler);\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\tvar settingsButton:Button = new Button();\n\t\t\tsettingsButton.label = \"Settings\";\n\t\t\tsettingsButton.addEventListener(Event.TRIGGERED, settingsButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tsettingsButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function transitionInCompleteHandler(event:Event):void\n\t\t{\n\t\t\tthis.revealScrollBars();\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function settingsButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(SHOW_SETTINGS);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/LayoutExplorer/source/feathers/examples/layoutExplorer/screens/TiledRowsLayoutSettingsScreen.as",
    "content": "package feathers.examples.layoutExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.List;\n\timport feathers.controls.NumericStepper;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.PickerList;\n\timport feathers.data.ArrayCollection;\n\timport feathers.data.VectorCollection;\n\timport feathers.examples.layoutExplorer.data.TiledRowsLayoutSettings;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.layout.Direction;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class TiledRowsLayoutSettingsScreen extends PanelScreen\n\t{\n\t\tpublic function TiledRowsLayoutSettingsScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic var settings:TiledRowsLayoutSettings;\n\n\t\tprivate var _list:List;\n\n\t\tprivate var _itemCountStepper:NumericStepper;\n\t\tprivate var _requestedColumnCountStepper:NumericStepper;\n\t\tprivate var _pagingPicker:PickerList;\n\t\tprivate var _horizontalGapStepper:NumericStepper;\n\t\tprivate var _verticalGapStepper:NumericStepper;\n\t\tprivate var _paddingTopStepper:NumericStepper;\n\t\tprivate var _paddingRightStepper:NumericStepper;\n\t\tprivate var _paddingBottomStepper:NumericStepper;\n\t\tprivate var _paddingLeftStepper:NumericStepper;\n\t\tprivate var _horizontalAlignPicker:PickerList;\n\t\tprivate var _verticalAlignPicker:PickerList;\n\t\tprivate var _tileHorizontalAlignPicker:PickerList;\n\t\tprivate var _tileVerticalAlignPicker:PickerList;\n\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//icon and accessory display objects in the list's data provider\n\t\t\t//won't be automatically disposed because feathers cannot know if\n\t\t\t//they need to be used again elsewhere or not. we need to dispose\n\t\t\t//them manually.\n\t\t\tthis._list.dataProvider.dispose(disposeItemAccessory);\n\n\t\t\t//never forget to call super.dispose() because you don't want to\n\t\t\t//create a memory leak!\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Tiled Rows Layout Settings\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._itemCountStepper = new NumericStepper();\n\t\t\tthis._itemCountStepper.minimum = 1;\n\t\t\t//the layout can certainly handle more. this value is arbitrary.\n\t\t\tthis._itemCountStepper.maximum = 100;\n\t\t\tthis._itemCountStepper.step = 1;\n\t\t\tthis._itemCountStepper.value = this.settings.itemCount;\n\t\t\tthis._itemCountStepper.addEventListener(Event.CHANGE, itemCountStepper_changeHandler);\n\n\t\t\tthis._requestedColumnCountStepper = new NumericStepper();\n\t\t\tthis._requestedColumnCountStepper.minimum = 0;\n\t\t\t//the layout can certainly handle more. this value is arbitrary.\n\t\t\tthis._requestedColumnCountStepper.maximum = 10;\n\t\t\tthis._requestedColumnCountStepper.step = 1;\n\t\t\tthis._requestedColumnCountStepper.value = this.settings.requestedColumnCount;\n\t\t\tthis._requestedColumnCountStepper.addEventListener(Event.CHANGE, requestedColumnCountStepper_changeHandler);\n\n\t\t\tthis._pagingPicker = new PickerList();\n\t\t\tthis._pagingPicker.typicalItem = Direction.HORIZONTAL;\n\t\t\tthis._pagingPicker.dataProvider = new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\tDirection.NONE,\n\t\t\t\tDirection.HORIZONTAL,\n\t\t\t\tDirection.VERTICAL\n\t\t\t]);\n\t\t\tthis._pagingPicker.selectedItem = this.settings.paging;\n\t\t\tthis._pagingPicker.addEventListener(Event.CHANGE, pagingPicker_changeHandler);\n\n\t\t\tthis._horizontalAlignPicker = new PickerList();\n\t\t\tthis._horizontalAlignPicker.typicalItem = HorizontalAlign.CENTER;\n\t\t\tthis._horizontalAlignPicker.dataProvider = new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\tHorizontalAlign.LEFT,\n\t\t\t\tHorizontalAlign.CENTER,\n\t\t\t\tHorizontalAlign.RIGHT\n\t\t\t]);\n\t\t\tthis._horizontalAlignPicker.selectedItem = this.settings.horizontalAlign;\n\t\t\tthis._horizontalAlignPicker.addEventListener(Event.CHANGE, horizontalAlignPicker_changeHandler);\n\n\t\t\tthis._verticalAlignPicker = new PickerList();\n\t\t\tthis._verticalAlignPicker.typicalItem = VerticalAlign.BOTTOM;\n\t\t\tthis._verticalAlignPicker.dataProvider = new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\tVerticalAlign.TOP,\n\t\t\t\tVerticalAlign.MIDDLE,\n\t\t\t\tVerticalAlign.BOTTOM\n\t\t\t]);\n\t\t\tthis._verticalAlignPicker.selectedItem = this.settings.verticalAlign;\n\t\t\tthis._verticalAlignPicker.addEventListener(Event.CHANGE, verticalAlignPicker_changeHandler);\n\n\t\t\tthis._tileHorizontalAlignPicker = new PickerList();\n\t\t\tthis._tileHorizontalAlignPicker.typicalItem = HorizontalAlign.CENTER;\n\t\t\tthis._tileHorizontalAlignPicker.dataProvider = new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\tHorizontalAlign.LEFT,\n\t\t\t\tHorizontalAlign.CENTER,\n\t\t\t\tHorizontalAlign.RIGHT,\n\t\t\t\tHorizontalAlign.JUSTIFY\n\t\t\t]);\n\t\t\tthis._tileHorizontalAlignPicker.selectedItem = this.settings.tileHorizontalAlign;\n\t\t\tthis._tileHorizontalAlignPicker.addEventListener(Event.CHANGE, tileHorizontalAlignPicker_changeHandler);\n\n\t\t\tthis._tileVerticalAlignPicker = new PickerList();\n\t\t\tthis._tileVerticalAlignPicker.typicalItem = VerticalAlign.BOTTOM;\n\t\t\tthis._tileVerticalAlignPicker.dataProvider = new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\tVerticalAlign.TOP,\n\t\t\t\tVerticalAlign.MIDDLE,\n\t\t\t\tVerticalAlign.BOTTOM,\n\t\t\t\tVerticalAlign.JUSTIFY\n\t\t\t]);\n\t\t\tthis._tileVerticalAlignPicker.selectedItem = this.settings.tileVerticalAlign;\n\t\t\tthis._tileVerticalAlignPicker.addEventListener(Event.CHANGE, tileVerticalAlignPicker_changeHandler);\n\n\t\t\tthis._horizontalGapStepper = new NumericStepper();\n\t\t\tthis._horizontalGapStepper.minimum = 0;\n\t\t\t//these maximum values are completely arbitrary\n\t\t\tthis._horizontalGapStepper.maximum = 100;\n\t\t\tthis._horizontalGapStepper.step = 1;\n\t\t\tthis._horizontalGapStepper.value = this.settings.horizontalGap;\n\t\t\tthis._horizontalGapStepper.addEventListener(Event.CHANGE, horizontalGapStepper_changeHandler);\n\n\t\t\tthis._verticalGapStepper = new NumericStepper();\n\t\t\tthis._verticalGapStepper.minimum = 0;\n\t\t\tthis._verticalGapStepper.maximum = 100;\n\t\t\tthis._verticalGapStepper.step = 1;\n\t\t\tthis._verticalGapStepper.value = this.settings.verticalGap;\n\t\t\tthis._verticalGapStepper.addEventListener(Event.CHANGE, verticalGapStepper_changeHandler);\n\n\t\t\tthis._paddingTopStepper = new NumericStepper();\n\t\t\tthis._paddingTopStepper.minimum = 0;\n\t\t\tthis._paddingTopStepper.maximum = 100;\n\t\t\tthis._paddingTopStepper.step = 1;\n\t\t\tthis._paddingTopStepper.value = this.settings.paddingTop;\n\t\t\tthis._paddingTopStepper.addEventListener(Event.CHANGE, paddingTopStepper_changeHandler);\n\n\t\t\tthis._paddingRightStepper = new NumericStepper();\n\t\t\tthis._paddingRightStepper.minimum = 0;\n\t\t\tthis._paddingRightStepper.maximum = 100;\n\t\t\tthis._paddingRightStepper.step = 1;\n\t\t\tthis._paddingRightStepper.value = this.settings.paddingRight;\n\t\t\tthis._paddingRightStepper.addEventListener(Event.CHANGE, paddingRightStepper_changeHandler);\n\n\t\t\tthis._paddingBottomStepper = new NumericStepper();\n\t\t\tthis._paddingBottomStepper.minimum = 0;\n\t\t\tthis._paddingBottomStepper.maximum = 100;\n\t\t\tthis._paddingBottomStepper.step = 1;\n\t\t\tthis._paddingBottomStepper.value = this.settings.paddingBottom;\n\t\t\tthis._paddingBottomStepper.addEventListener(Event.CHANGE, paddingBottomStepper_changeHandler);\n\n\t\t\tthis._paddingLeftStepper = new NumericStepper();\n\t\t\tthis._paddingLeftStepper.minimum = 0;\n\t\t\tthis._paddingLeftStepper.maximum = 100;\n\t\t\tthis._paddingLeftStepper.step = 1;\n\t\t\tthis._paddingLeftStepper.value = this.settings.paddingLeft;\n\t\t\tthis._paddingLeftStepper.addEventListener(Event.CHANGE, paddingLeftStepper_changeHandler);\n\n\t\t\tthis._list = new List();\n\t\t\tthis._list.isSelectable = false;\n\t\t\tthis._list.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ label: \"Item Count\", accessory: this._itemCountStepper },\n\t\t\t\t{ label: \"Requested Column Count\", accessory: this._requestedColumnCountStepper },\n\t\t\t\t{ label: \"Paging\", accessory: this._pagingPicker },\n\t\t\t\t{ label: \"horizontalAlign\", accessory: this._horizontalAlignPicker },\n\t\t\t\t{ label: \"verticalAlign\", accessory: this._verticalAlignPicker },\n\t\t\t\t{ label: \"tileHorizontalAlign\", accessory: this._tileHorizontalAlignPicker },\n\t\t\t\t{ label: \"tileVerticalAlign\", accessory: this._tileVerticalAlignPicker },\n\t\t\t\t{ label: \"horizontalGap\", accessory: this._horizontalGapStepper },\n\t\t\t\t{ label: \"verticalGap\", accessory: this._verticalGapStepper },\n\t\t\t\t{ label: \"paddingTop\", accessory: this._paddingTopStepper },\n\t\t\t\t{ label: \"paddingRight\", accessory: this._paddingRightStepper },\n\t\t\t\t{ label: \"paddingBottom\", accessory: this._paddingBottomStepper },\n\t\t\t\t{ label: \"paddingLeft\", accessory: this._paddingLeftStepper },\n\t\t\t]);\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis.addChild(this._list);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\tvar doneButton:Button = new Button();\n\t\t\tdoneButton.label = \"Done\";\n\t\t\tdoneButton.addEventListener(Event.TRIGGERED, doneButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tdoneButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function disposeItemAccessory(item:Object):void\n\t\t{\n\t\t\tDisplayObject(item.accessory).dispose();\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function doneButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function itemCountStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.itemCount = this._itemCountStepper.value;\n\t\t}\n\n\t\tprivate function requestedColumnCountStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.requestedColumnCount = this._requestedColumnCountStepper.value;\n\t\t}\n\n\t\tprivate function pagingPicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paging = this._pagingPicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function horizontalAlignPicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.horizontalAlign = this._horizontalAlignPicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function verticalAlignPicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.verticalAlign = this._verticalAlignPicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function tileHorizontalAlignPicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.tileHorizontalAlign = this._tileHorizontalAlignPicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function tileVerticalAlignPicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.tileVerticalAlign = this._tileVerticalAlignPicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function horizontalGapStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.horizontalGap = this._horizontalGapStepper.value;\n\t\t}\n\n\t\tprivate function verticalGapStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.verticalGap = this._verticalGapStepper.value;\n\t\t}\n\n\t\tprivate function paddingTopStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paddingTop = this._paddingTopStepper.value;\n\t\t}\n\n\t\tprivate function paddingRightStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paddingRight = this._paddingRightStepper.value;\n\t\t}\n\n\t\tprivate function paddingBottomStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paddingBottom = this._paddingBottomStepper.value;\n\t\t}\n\n\t\tprivate function paddingLeftStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paddingLeft = this._paddingLeftStepper.value;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/LayoutExplorer/source/feathers/examples/layoutExplorer/screens/VerticalLayoutScreen.as",
    "content": "package feathers.examples.layoutExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.ScrollPolicy;\n\timport feathers.events.FeathersEventType;\n\timport feathers.examples.layoutExplorer.data.VerticalLayoutSettings;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\t[Event(name=\"showSettings\",type=\"starling.events.Event\")]\n\n\tpublic class VerticalLayoutScreen extends PanelScreen\n\t{\n\t\tpublic static const SHOW_SETTINGS:String = \"showSettings\";\n\n\t\tpublic function VerticalLayoutScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic var settings:VerticalLayoutSettings;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Vertical Layout\";\n\n\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\tlayout.gap = this.settings.gap;\n\t\t\tlayout.paddingTop = this.settings.paddingTop;\n\t\t\tlayout.paddingRight = this.settings.paddingRight;\n\t\t\tlayout.paddingBottom = this.settings.paddingBottom;\n\t\t\tlayout.paddingLeft = this.settings.paddingLeft;\n\t\t\tlayout.horizontalAlign = this.settings.horizontalAlign;\n\t\t\tlayout.verticalAlign = this.settings.verticalAlign;\n\n\t\t\tthis.layout = layout;\n\t\t\t//when the scroll policy is set to on, the \"elastic\" edges will be\n\t\t\t//active even when the max scroll position is zero\n\t\t\tthis.verticalScrollPolicy = ScrollPolicy.ON;\n\t\t\tthis.snapScrollPositionsToPixels = true;\n\n\t\t\tvar minQuadSize:Number = Math.min(Starling.current.stage.stageWidth, Starling.current.stage.stageHeight) / 15;\n\t\t\tfor(var i:int = 0; i < this.settings.itemCount; i++)\n\t\t\t{\n\t\t\t\tvar size:Number = (minQuadSize + minQuadSize * 2 * Math.random());\n\t\t\t\tvar quad:Quad = new Quad(size, size, 0xff8800);\n\t\t\t\tthis.addChild(quad);\n\t\t\t}\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\n\t\t\tthis.addEventListener(FeathersEventType.TRANSITION_IN_COMPLETE, transitionInCompleteHandler);\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\tvar settingsButton:Button = new Button();\n\t\t\tsettingsButton.label = \"Settings\";\n\t\t\tsettingsButton.addEventListener(Event.TRIGGERED, settingsButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tsettingsButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function transitionInCompleteHandler(event:Event):void\n\t\t{\n\t\t\tthis.revealScrollBars();\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function settingsButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(SHOW_SETTINGS);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/LayoutExplorer/source/feathers/examples/layoutExplorer/screens/VerticalLayoutSettingsScreen.as",
    "content": "package feathers.examples.layoutExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.List;\n\timport feathers.controls.NumericStepper;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.PickerList;\n\timport feathers.data.ArrayCollection;\n\timport feathers.data.ListCollection;\n\timport feathers.data.VectorCollection;\n\timport feathers.examples.layoutExplorer.data.VerticalLayoutSettings;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class VerticalLayoutSettingsScreen extends PanelScreen\n\t{\n\t\tpublic function VerticalLayoutSettingsScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic var settings:VerticalLayoutSettings;\n\n\t\tprivate var _list:List;\n\n\t\tprivate var _itemCountStepper:NumericStepper;\n\t\tprivate var _gapStepper:NumericStepper;\n\t\tprivate var _paddingTopStepper:NumericStepper;\n\t\tprivate var _paddingRightStepper:NumericStepper;\n\t\tprivate var _paddingBottomStepper:NumericStepper;\n\t\tprivate var _paddingLeftStepper:NumericStepper;\n\t\tprivate var _horizontalAlignPicker:PickerList;\n\t\tprivate var _verticalAlignPicker:PickerList;\n\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//icon and accessory display objects in the list's data provider\n\t\t\t//won't be automatically disposed because feathers cannot know if\n\t\t\t//they need to be used again elsewhere or not. we need to dispose\n\t\t\t//them manually.\n\t\t\tthis._list.dataProvider.dispose(disposeItemAccessory);\n\n\t\t\t//never forget to call super.dispose() because you don't want to\n\t\t\t//create a memory leak!\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Vertical Layout Settings\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._itemCountStepper = new NumericStepper();\n\t\t\tthis._itemCountStepper.minimum = 1;\n\t\t\t//the layout can certainly handle more. this value is arbitrary.\n\t\t\tthis._itemCountStepper.maximum = 100;\n\t\t\tthis._itemCountStepper.step = 1;\n\t\t\tthis._itemCountStepper.value = this.settings.itemCount;\n\t\t\tthis._itemCountStepper.addEventListener(Event.CHANGE, itemCountStepper_changeHandler);\n\n\t\t\tthis._horizontalAlignPicker = new PickerList();\n\t\t\tthis._horizontalAlignPicker.typicalItem = HorizontalAlign.CENTER;\n\t\t\tthis._horizontalAlignPicker.dataProvider = new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\tHorizontalAlign.LEFT,\n\t\t\t\tHorizontalAlign.CENTER,\n\t\t\t\tHorizontalAlign.RIGHT,\n\t\t\t\tHorizontalAlign.JUSTIFY\n\t\t\t]);\n\t\t\tthis._horizontalAlignPicker.selectedItem = this.settings.horizontalAlign;\n\t\t\tthis._horizontalAlignPicker.addEventListener(Event.CHANGE, horizontalAlignPicker_changeHandler);\n\n\t\t\tthis._verticalAlignPicker = new PickerList();\n\t\t\tthis._verticalAlignPicker.typicalItem = VerticalAlign.BOTTOM;\n\t\t\tthis._verticalAlignPicker.dataProvider = new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\tVerticalAlign.TOP,\n\t\t\t\tVerticalAlign.MIDDLE,\n\t\t\t\tVerticalAlign.BOTTOM\n\t\t\t]);\n\t\t\tthis._verticalAlignPicker.selectedItem = this.settings.verticalAlign;\n\t\t\tthis._verticalAlignPicker.addEventListener(Event.CHANGE, verticalAlignPicker_changeHandler);\n\n\t\t\tthis._gapStepper = new NumericStepper();\n\t\t\tthis._gapStepper.minimum = 0;\n\t\t\t//these maximum values are completely arbitrary\n\t\t\tthis._gapStepper.maximum = 100;\n\t\t\tthis._gapStepper.step = 1;\n\t\t\tthis._gapStepper.value = this.settings.gap;\n\t\t\tthis._gapStepper.addEventListener(Event.CHANGE, gapStepper_changeHandler);\n\n\t\t\tthis._paddingTopStepper = new NumericStepper();\n\t\t\tthis._paddingTopStepper.minimum = 0;\n\t\t\tthis._paddingTopStepper.maximum = 100;\n\t\t\tthis._paddingTopStepper.step = 1;\n\t\t\tthis._paddingTopStepper.value = this.settings.paddingTop;\n\t\t\tthis._paddingTopStepper.addEventListener(Event.CHANGE, paddingTopStepper_changeHandler);\n\n\t\t\tthis._paddingRightStepper = new NumericStepper();\n\t\t\tthis._paddingRightStepper.minimum = 0;\n\t\t\tthis._paddingRightStepper.maximum = 100;\n\t\t\tthis._paddingRightStepper.step = 1;\n\t\t\tthis._paddingRightStepper.value = this.settings.paddingRight;\n\t\t\tthis._paddingRightStepper.addEventListener(Event.CHANGE, paddingRightStepper_changeHandler);\n\n\t\t\tthis._paddingBottomStepper = new NumericStepper();\n\t\t\tthis._paddingBottomStepper.minimum = 0;\n\t\t\tthis._paddingBottomStepper.maximum = 100;\n\t\t\tthis._paddingBottomStepper.step = 1;\n\t\t\tthis._paddingBottomStepper.value = this.settings.paddingBottom;\n\t\t\tthis._paddingBottomStepper.addEventListener(Event.CHANGE, paddingBottomStepper_changeHandler);\n\n\t\t\tthis._paddingLeftStepper = new NumericStepper();\n\t\t\tthis._paddingLeftStepper.minimum = 0;\n\t\t\tthis._paddingLeftStepper.maximum = 100;\n\t\t\tthis._paddingLeftStepper.step = 1;\n\t\t\tthis._paddingLeftStepper.value = this.settings.paddingLeft;\n\t\t\tthis._paddingLeftStepper.addEventListener(Event.CHANGE, paddingLeftStepper_changeHandler);\n\n\t\t\tthis._list = new List();\n\t\t\tthis._list.isSelectable = false;\n\t\t\tthis._list.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ label: \"Item Count\", accessory: this._itemCountStepper },\n\t\t\t\t{ label: \"horizontalAlign\", accessory: this._horizontalAlignPicker },\n\t\t\t\t{ label: \"verticalAlign\", accessory: this._verticalAlignPicker },\n\t\t\t\t{ label: \"gap\", accessory: this._gapStepper },\n\t\t\t\t{ label: \"paddingTop\", accessory: this._paddingTopStepper },\n\t\t\t\t{ label: \"paddingRight\", accessory: this._paddingRightStepper },\n\t\t\t\t{ label: \"paddingBottom\", accessory: this._paddingBottomStepper },\n\t\t\t\t{ label: \"paddingLeft\", accessory: this._paddingLeftStepper },\n\t\t\t]);\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis.addChild(this._list);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\tvar doneButton:Button = new Button();\n\t\t\tdoneButton.label = \"Done\";\n\t\t\tdoneButton.addEventListener(Event.TRIGGERED, doneButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tdoneButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function disposeItemAccessory(item:Object):void\n\t\t{\n\t\t\tDisplayObject(item.accessory).dispose();\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function doneButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function itemCountStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.itemCount = this._itemCountStepper.value;\n\t\t}\n\n\t\tprivate function horizontalAlignPicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.horizontalAlign = this._horizontalAlignPicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function verticalAlignPicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.verticalAlign = this._verticalAlignPicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function gapStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.gap = this._gapStepper.value;\n\t\t}\n\n\t\tprivate function paddingTopStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paddingTop = this._paddingTopStepper.value;\n\t\t}\n\n\t\tprivate function paddingRightStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paddingRight = this._paddingRightStepper.value;\n\t\t}\n\n\t\tprivate function paddingBottomStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paddingBottom = this._paddingBottomStepper.value;\n\t\t}\n\n\t\tprivate function paddingLeftStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paddingLeft = this._paddingLeftStepper.value;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/LayoutExplorer/source/feathers/examples/layoutExplorer/screens/WaterfallLayoutScreen.as",
    "content": "package feathers.examples.layoutExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.PanelScreen;\n\timport feathers.events.FeathersEventType;\n\timport feathers.examples.layoutExplorer.data.WaterfallLayoutSettings;\n\timport feathers.layout.WaterfallLayout;\n\timport feathers.system.DeviceCapabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\t[Event(name=\"showSettings\",type=\"starling.events.Event\")]\n\n\tpublic class WaterfallLayoutScreen extends PanelScreen\n\t{\n\t\tpublic static const SHOW_SETTINGS:String = \"showSettings\";\n\n\t\tpublic function WaterfallLayoutScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic var settings:WaterfallLayoutSettings;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Waterfall Layout\";\n\n\t\t\tvar layout:WaterfallLayout = new WaterfallLayout();\n\t\t\tlayout.requestedColumnCount = this.settings.requestedColumnCount;\n\t\t\tlayout.horizontalGap = this.settings.horizontalGap;\n\t\t\tlayout.verticalGap = this.settings.verticalGap;\n\t\t\tlayout.paddingTop = this.settings.paddingTop;\n\t\t\tlayout.paddingRight = this.settings.paddingRight;\n\t\t\tlayout.paddingBottom = this.settings.paddingBottom;\n\t\t\tlayout.paddingLeft = this.settings.paddingLeft;\n\t\t\tlayout.horizontalAlign = this.settings.horizontalAlign;\n\n\t\t\tthis.layout = layout;\n\t\t\tthis.snapScrollPositionsToPixels = true;\n\n\t\t\tvar minQuadSize:Number = Math.round(Math.min(Starling.current.stage.stageWidth, Starling.current.stage.stageHeight) / 5);\n\t\t\tfor(var i:int = 0; i < this.settings.itemCount; i++)\n\t\t\t{\n\t\t\t\tvar height:Number = Math.round((minQuadSize + minQuadSize * Math.random()));\n\t\t\t\tvar quad:Quad = new Quad(minQuadSize, height, 0xff8800);\n\t\t\t\tthis.addChild(quad);\n\t\t\t}\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t\t}\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\tthis.addEventListener(FeathersEventType.TRANSITION_IN_COMPLETE, transitionInCompleteHandler);\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\t//this screen doesn't use a back button on tablets because the main\n\t\t\t//app's uses a split layout\n\t\t\tif(!DeviceCapabilities.isTablet(Starling.current.nativeStage))\n\t\t\t{\n\t\t\t\tvar backButton:Button = new Button();\n\t\t\t\tbackButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\t\tbackButton.label = \"Back\";\n\t\t\t\tbackButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t\t[\n\t\t\t\t\tbackButton\n\t\t\t\t];\n\t\t\t}\n\t\t\tvar settingsButton:Button = new Button();\n\t\t\tsettingsButton.label = \"Settings\";\n\t\t\tsettingsButton.addEventListener(Event.TRIGGERED, settingsButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tsettingsButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function transitionInCompleteHandler(event:Event):void\n\t\t{\n\t\t\tthis.revealScrollBars();\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function settingsButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(SHOW_SETTINGS);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/LayoutExplorer/source/feathers/examples/layoutExplorer/screens/WaterfallLayoutSettingsScreen.as",
    "content": "package feathers.examples.layoutExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.List;\n\timport feathers.controls.NumericStepper;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.PickerList;\n\timport feathers.data.ArrayCollection;\n\timport feathers.data.VectorCollection;\n\timport feathers.examples.layoutExplorer.data.WaterfallLayoutSettings;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.layout.HorizontalAlign;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class WaterfallLayoutSettingsScreen extends PanelScreen\n\t{\n\t\tpublic function WaterfallLayoutSettingsScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic var settings:WaterfallLayoutSettings;\n\n\t\tprivate var _list:List;\n\n\t\tprivate var _itemCountStepper:NumericStepper;\n\t\tprivate var _requestedColumnCountStepper:NumericStepper;\n\t\tprivate var _horizontalGapStepper:NumericStepper;\n\t\tprivate var _verticalGapStepper:NumericStepper;\n\t\tprivate var _paddingTopStepper:NumericStepper;\n\t\tprivate var _paddingRightStepper:NumericStepper;\n\t\tprivate var _paddingBottomStepper:NumericStepper;\n\t\tprivate var _paddingLeftStepper:NumericStepper;\n\t\tprivate var _horizontalAlignPicker:PickerList;\n\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//icon and accessory display objects in the list's data provider\n\t\t\t//won't be automatically disposed because feathers cannot know if\n\t\t\t//they need to be used again elsewhere or not. we need to dispose\n\t\t\t//them manually.\n\t\t\tthis._list.dataProvider.dispose(disposeItemAccessory);\n\n\t\t\t//never forget to call super.dispose() because you don't want to\n\t\t\t//create a memory leak!\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Waterfall Layout Settings\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._itemCountStepper = new NumericStepper();\n\t\t\tthis._itemCountStepper.minimum = 1;\n\t\t\t//the layout can certainly handle more. this value is arbitrary.\n\t\t\tthis._itemCountStepper.maximum = 100;\n\t\t\tthis._itemCountStepper.step = 1;\n\t\t\tthis._itemCountStepper.value = this.settings.itemCount;\n\t\t\tthis._itemCountStepper.addEventListener(Event.CHANGE, itemCountStepper_changeHandler);\n\n\t\t\tthis._requestedColumnCountStepper = new NumericStepper();\n\t\t\tthis._requestedColumnCountStepper.minimum = 0;\n\t\t\t//the layout can certainly handle more. this value is arbitrary.\n\t\t\tthis._requestedColumnCountStepper.maximum = 10;\n\t\t\tthis._requestedColumnCountStepper.step = 1;\n\t\t\tthis._requestedColumnCountStepper.value = this.settings.requestedColumnCount;\n\t\t\tthis._requestedColumnCountStepper.addEventListener(Event.CHANGE, requestedColumnCountStepper_changeHandler);\n\n\t\t\tthis._horizontalAlignPicker = new PickerList();\n\t\t\tthis._horizontalAlignPicker.typicalItem = HorizontalAlign.CENTER;\n\t\t\tthis._horizontalAlignPicker.dataProvider = new VectorCollection(new <String>\n\t\t\t[\n\t\t\t\tHorizontalAlign.LEFT,\n\t\t\t\tHorizontalAlign.CENTER,\n\t\t\t\tHorizontalAlign.RIGHT\n\t\t\t]);\n\t\t\tthis._horizontalAlignPicker.selectedItem = this.settings.horizontalAlign;\n\t\t\tthis._horizontalAlignPicker.addEventListener(Event.CHANGE, horizontalAlignPicker_changeHandler);\n\n\t\t\tthis._horizontalGapStepper = new NumericStepper();\n\t\t\tthis._horizontalGapStepper.minimum = 0;\n\t\t\t//these maximum values are completely arbitrary\n\t\t\tthis._horizontalGapStepper.maximum = 100;\n\t\t\tthis._horizontalGapStepper.step = 1;\n\t\t\tthis._horizontalGapStepper.value = this.settings.horizontalGap;\n\t\t\tthis._horizontalGapStepper.addEventListener(Event.CHANGE, horizontalGapStepper_changeHandler);\n\n\t\t\tthis._verticalGapStepper = new NumericStepper();\n\t\t\tthis._verticalGapStepper.minimum = 0;\n\t\t\tthis._verticalGapStepper.maximum = 100;\n\t\t\tthis._verticalGapStepper.step = 1;\n\t\t\tthis._verticalGapStepper.value = this.settings.verticalGap;\n\t\t\tthis._verticalGapStepper.addEventListener(Event.CHANGE, verticalGapStepper_changeHandler);\n\n\t\t\tthis._paddingTopStepper = new NumericStepper();\n\t\t\tthis._paddingTopStepper.minimum = 0;\n\t\t\tthis._paddingTopStepper.maximum = 100;\n\t\t\tthis._paddingTopStepper.step = 1;\n\t\t\tthis._paddingTopStepper.value = this.settings.paddingTop;\n\t\t\tthis._paddingTopStepper.addEventListener(Event.CHANGE, paddingTopStepper_changeHandler);\n\n\t\t\tthis._paddingRightStepper = new NumericStepper();\n\t\t\tthis._paddingRightStepper.minimum = 0;\n\t\t\tthis._paddingRightStepper.maximum = 100;\n\t\t\tthis._paddingRightStepper.step = 1;\n\t\t\tthis._paddingRightStepper.value = this.settings.paddingRight;\n\t\t\tthis._paddingRightStepper.addEventListener(Event.CHANGE, paddingRightStepper_changeHandler);\n\n\t\t\tthis._paddingBottomStepper = new NumericStepper();\n\t\t\tthis._paddingBottomStepper.minimum = 0;\n\t\t\tthis._paddingBottomStepper.maximum = 100;\n\t\t\tthis._paddingBottomStepper.step = 1;\n\t\t\tthis._paddingBottomStepper.value = this.settings.paddingBottom;\n\t\t\tthis._paddingBottomStepper.addEventListener(Event.CHANGE, paddingBottomStepper_changeHandler);\n\n\t\t\tthis._paddingLeftStepper = new NumericStepper();\n\t\t\tthis._paddingLeftStepper.minimum = 0;\n\t\t\tthis._paddingLeftStepper.maximum = 100;\n\t\t\tthis._paddingLeftStepper.step = 1;\n\t\t\tthis._paddingLeftStepper.value = this.settings.paddingLeft;\n\t\t\tthis._paddingLeftStepper.addEventListener(Event.CHANGE, paddingLeftStepper_changeHandler);\n\n\t\t\tthis._list = new List();\n\t\t\tthis._list.isSelectable = false;\n\t\t\tthis._list.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ label: \"Item Count\", accessory: this._itemCountStepper },\n\t\t\t\t{ label: \"Requested Column Count\", accessory: this._requestedColumnCountStepper },\n\t\t\t\t{ label: \"horizontalAlign\", accessory: this._horizontalAlignPicker },\n\t\t\t\t{ label: \"horizontalGap\", accessory: this._horizontalGapStepper },\n\t\t\t\t{ label: \"verticalGap\", accessory: this._verticalGapStepper },\n\t\t\t\t{ label: \"paddingTop\", accessory: this._paddingTopStepper },\n\t\t\t\t{ label: \"paddingRight\", accessory: this._paddingRightStepper },\n\t\t\t\t{ label: \"paddingBottom\", accessory: this._paddingBottomStepper },\n\t\t\t\t{ label: \"paddingLeft\", accessory: this._paddingLeftStepper },\n\t\t\t]);\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis.addChild(this._list);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\tvar doneButton:Button = new Button();\n\t\t\tdoneButton.label = \"Done\";\n\t\t\tdoneButton.addEventListener(Event.TRIGGERED, doneButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tdoneButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function disposeItemAccessory(item:Object):void\n\t\t{\n\t\t\tDisplayObject(item.accessory).dispose();\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function doneButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function itemCountStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.itemCount = this._itemCountStepper.value;\n\t\t}\n\n\t\tprivate function requestedColumnCountStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.requestedColumnCount = this._requestedColumnCountStepper.value;\n\t\t}\n\n\t\tprivate function horizontalAlignPicker_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.horizontalAlign = this._horizontalAlignPicker.selectedItem as String;\n\t\t}\n\n\t\tprivate function horizontalGapStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.horizontalGap = this._horizontalGapStepper.value;\n\t\t}\n\n\t\tprivate function verticalGapStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.verticalGap = this._verticalGapStepper.value;\n\t\t}\n\n\t\tprivate function paddingTopStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paddingTop = this._paddingTopStepper.value;\n\t\t}\n\n\t\tprivate function paddingRightStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paddingRight = this._paddingRightStepper.value;\n\t\t}\n\n\t\tprivate function paddingBottomStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paddingBottom = this._paddingBottomStepper.value;\n\t\t}\n\n\t\tprivate function paddingLeftStepper_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.settings.paddingLeft = this._paddingLeftStepper.value;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/Magic8Chat/README.md",
    "content": "# Feathers Magic 8 Chat\n\nDemonstrates how to create a mobile chat app using [Feathers](http://feathersui.com/).\n\n## Requirements\n\nIn addition to Starling Framework and Feathers, this example project requires the `MetalWorksMobileTheme` example theme. You can find the SWC file for this theme at the following location in the Feathers release build:\n\n\tthemes/MetalWorksMobileTheme/swc/MetalWorksMobileTheme.swc\n\n## Web Demo\n\nView the [Magic8Chat example](http://feathersui.com/examples/magic-8-chat/) in your browser."
  },
  {
    "path": "examples/Magic8Chat/assets/images/icons-readme.txt",
    "content": "Icons by Glyphish - glyphish.com"
  },
  {
    "path": "examples/Magic8Chat/build.properties",
    "content": "feathers.root = ${basedir}/../../source\nstarling.root = ${basedir}/../../third-party/starling\ntheme.root = ${basedir}/../../themes/MetalWorksMobileTheme/source\noutput.path = ${basedir}/output\nicon.path = ${basedir}/../shared-assets/icons\nlaunch.image.path = ${basedir}/../shared-assets/launch-images-windowed\n\nswf.version = 34"
  },
  {
    "path": "examples/Magic8Chat/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<project name=\"magic8\" default=\"build\" basedir=\".\">\n\n\t<!-- build.local.properties and sdk.local.proprties are optional files that\n\t\tcan be used to override the default properties. -->\n\t<property file=\"./build.local.properties\"/>\n\t<property file=\"./sdk.local.properties\"/>\n\t<property file=\"./build.properties\"/>\n\t<!-- inherit SDK properties from the root of the repository -->\n\t<property file=\"../../sdk.local.properties\"/>\n\t<property file=\"../../sdk.properties\"/>\n\n\t<target name=\"build\" depends=\"build-web,build-android,build-ios\"/>\n\n\t<target name=\"prepare\">\n\t\t<delete dir=\"${output.path}\"/>\n\t</target>\n\n\t<target name=\"build-web\" depends=\"prepare\">\n\t\t<echo message=\"Building Magic8ChatWeb.swf\"/>\n\t\t<java jar=\"${mxmlc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${flashplayer.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-advanced-telemetry=true\"/>\n\t\t\t<arg value=\"-frame=two,feathers.examples.magic8.Main\"/>\n\t\t\t<arg value=\"-source-path+=source\"/>\n\t\t\t<arg value=\"-source-path+=${starling.root}\"/>\n\t\t\t<arg value=\"-source-path+=${feathers.root}\"/>\n\t\t\t<arg value=\"-source-path+=${theme.root}\"/>\n\t\t\t<arg value=\"source/Magic8ChatWeb.as\"/>\n\t\t\t<arg value=\"-output=${output.path}/Magic8ChatWeb.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"build-air-swf\" depends=\"prepare\">\n\t\t<echo message=\"Building Magic8Chat.swf\"/>\n\t\t<java jar=\"${mxmlc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${airmobile.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<!-- uncomment for profiling with scout -->\n\t\t\t<!--<arg value=\"-advanced-telemetry=true\"/>-->\n\t\t\t<arg value=\"-source-path+=source\"/>\n\t\t\t<arg value=\"-source-path+=${starling.root}\"/>\n\t\t\t<arg value=\"-source-path+=${feathers.root}\"/>\n\t\t\t<arg value=\"-source-path+=${theme.root}\"/>\n\t\t\t<arg value=\"source/Magic8Chat.as\"/>\n\t\t\t<arg value=\"-output=${output.path}/Magic8Chat.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"-check-ios-properties\">\n\t\t<fail unless=\"ios.provision.path\"/>\n\t\t<fail unless=\"ios.certificate.path\"/>\n\t\t<fail unless=\"ios.certificate.password\"/>\n\t</target>\n\t<target name=\"build-ios\" depends=\"-check-ios-properties,build-air-swf\">\n\t\t<echo message=\"Packaging Magic8Chat.ipa\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"-target\"/>\n\t\t\t<arg value=\"ipa-app-store\"/>\n\t\t\t<!-- uncomment for actionscript sampling with scout on ios -->\n\t\t\t<!--<arg value=\"-sampler\"/>-->\n\t\t\t<arg value=\"-provisioning-profile\"/>\n\t\t\t<arg value=\"${ios.provision.path}\"/>\n\t\t\t<arg value=\"-keystore\"/>\n\t\t\t<arg value=\"${ios.certificate.path}\"/>\n\t\t\t<arg value=\"-storetype\"/>\n\t\t\t<arg value=\"pkcs12\"/>\n\t\t\t<arg value=\"-storepass\"/>\n\t\t\t<arg value=\"${ios.certificate.password}\"/>\n\t\t\t<arg value=\"${output.path}/Magic8Chat.ipa\"/>\n\t\t\t<arg value=\"source/Magic8Chat-app.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${icon.path}\"/>\n\t\t\t<arg line=\"icon29.png icon48.png icon50.png icon57.png icon58.png icon72.png icon87.png icon96.png icon100.png icon114.png icon128.png icon144.png icon180.png\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${launch.image.path}\"/>\n\t\t\t<arg value=\"Default~iphone.png\"/>\t\t\t\t\t\t\t<!-- iphone 3gs -->\n\t\t\t<arg value=\"Default@2x~iphone.png\"/>\t\t\t\t\t\t<!-- iphone 4/4s -->\n\t\t\t<arg value=\"Default-568h@2x~iphone.png\"/>\t\t\t\t\t<!-- iphone 5/5c/5s -->\n\t\t\t<arg value=\"Default-375w-667h@2x~iphone.png\"/>\t\t\t\t<!-- iphone 6/7/8 -->\n\t\t\t<arg value=\"Default-812h@3x~iphone.png\"/>\t\t\t\t\t<!-- iphone x (portrait) -->\n\t\t\t<arg value=\"Default-Landscape-812h@3x~iphone.png\"/>\t\t\t<!-- iphone x (landscape) -->\n\t\t\t<arg value=\"Default-414w-736h@3x~iphone.png\"/>\t\t\t\t<!-- iphone 6/7/8 plus (portrait) -->\n\t\t\t<arg value=\"Default-Landscape-414w-736h@3x~iphone.png\"/>\t<!-- iphone 6/7/8 plus (landscape) -->\n\t\t\t<arg value=\"Default-Portrait~ipad.png\"/>\t\t\t\t\t<!-- ipad 1/2 (portrait) -->\n\t\t\t<arg value=\"Default-PortraitUpsideDown~ipad.png\"/>\t\t\t<!-- ipad 1/2 (portrait upside down) -->\n\t\t\t<arg value=\"Default-Landscape~ipad.png\"/>\t\t\t\t\t<!-- ipad 1/2 (landscape left) -->\n\t\t\t<arg value=\"Default-LandscapeRight~ipad.png\"/>\t\t\t\t<!-- ipad 1/2 (landscape right) -->\n\t\t\t<arg value=\"Default-Portrait@2x~ipad.png\"/>\t\t\t\t\t<!-- ipad 3/air (portrait) -->\n\t\t\t<arg value=\"Default-LandscapeLeft@2x~ipad.png\"/>\t\t\t<!-- ipad 3/air (landscape left) -->\n\t\t\t<arg value=\"Default-LandscapeRight@2x~ipad.png\"/>\t\t\t<!-- ipad 3/air (landscape right) -->\n\t\t\t<arg value=\"Default-Portrait@2x.png\"/>\t\t\t\t\t\t<!-- ipad pro (portrait) -->\n\t\t\t<arg value=\"Default-Landscape@2x.png\"/>\t\t\t\t\t\t<!-- ipad pro (landscape) -->\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${output.path}\"/>\n\t\t\t<arg value=\"Magic8Chat.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"-check-android-properties\">\n\t\t<fail unless=\"android.certificate.path\"/>\n\t\t<fail unless=\"android.certificate.password\"/>\n\t</target>\n\t<target name=\"build-android\" depends=\"-check-android-properties,build-air-swf\">\n\t\t<echo message=\"Packaging Magic8Chat.apk\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"-target\"/>\n\t\t\t<arg value=\"apk-captive-runtime\"/>\n\t\t\t<arg value=\"-storetype\"/>\n\t\t\t<arg value=\"pkcs12\"/>\n\t\t\t<arg value=\"-keystore\"/>\n\t\t\t<arg value=\"${android.certificate.path}\"/>\n\t\t\t<arg value=\"-storepass\"/>\n\t\t\t<arg value=\"${android.certificate.password}\"/>\n\t\t\t<arg value=\"${output.path}/Magic8Chat.apk\"/>\n\t\t\t<arg value=\"source/Magic8Chat-app.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${icon.path}\"/>\n\t\t\t<arg line=\"icon29.png icon48.png icon50.png icon57.png icon58.png icon72.png icon87.png icon96.png icon100.png icon114.png icon128.png icon144.png icon180.png\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${output.path}\"/>\n\t\t\t<arg value=\"Magic8Chat.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"install-android\">\n\t\t<echo message=\"Installing Magic8Chat.apk\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"false\">\n\t\t\t<arg value=\"-uninstallApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"android\"/>\n\t\t\t<arg value=\"-appid\"/>\n\t\t\t<arg value=\"com.feathersui.examples.Magic8Chat\"/>\n\t\t</java>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-installApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"android\"/>\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"${output.path}/Magic8Chat.apk\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"install-ios\">\n\t\t<echo message=\"Installing Magic8Chat.ipa\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"false\">\n\t\t\t<arg value=\"-uninstallApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"iOS\"/>\n\t\t\t<arg value=\"-appid\"/>\n\t\t\t<arg value=\"com.feathersui.examples.Magic8Chat\"/>\n\t\t</java>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-installApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"iOS\"/>\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"${output.path}/Magic8Chat.ipa\"/>\n\t\t</java>\n\t</target>\n</project>"
  },
  {
    "path": "examples/Magic8Chat/source/Magic8Chat-app.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<application xmlns=\"http://ns.adobe.com/air/application/32.0\">\n\t<id>com.feathersui.examples.Magic8Chat</id>\n\t<filename>Magic8Chat</filename>\n\t<name>Magic8Chat</name>\n\t<versionNumber>4.2.0</versionNumber>\n\t<description>Magic8Chat example application built with Feathers UI controls for Starling</description>\n\t<copyright>2021 Bowler Hat LLC</copyright>\n\n\t<initialWindow>\n\t\t<content>Magic8Chat.swf</content>\n\t\t<autoOrients>true</autoOrients>\n\t\t<fullScreen>false</fullScreen>\n\t\t<visible>true</visible>\n\t\t<renderMode>direct</renderMode>\n\t\t<depthAndStencil>true</depthAndStencil>\n\t</initialWindow>\n\n\t<supportedLanguages>en</supportedLanguages>\n\n\t<icon>\n\t\t<image29x29>icon29.png</image29x29>\n\t\t<image48x48>icon48.png</image48x48>\n\t\t<image50x50>icon50.png</image50x50>\n\t\t<image57x57>icon57.png</image57x57>\n\t\t<image58x58>icon58.png</image58x58>\n\t\t<image72x72>icon72.png</image72x72>\n\t\t<image87x87>icon87.png</image87x87>\n\t\t<image96x96>icon96.png</image96x96>\n\t\t<image100x100>icon100.png</image100x100>\n\t\t<image114x114>icon114.png</image114x114>\n\t\t<image128x128>icon128.png</image128x128>\n\t\t<image144x144>icon144.png</image144x144>\n\t\t<image180x180>icon180.png</image180x180>\n\t</icon>\n\t<android>\n\t\t<colorDepth>16bit</colorDepth>\n\t\t<manifestAdditions><![CDATA[\n\t\t\t<manifest android:installLocation=\"auto\">\n\t\t\t    <uses-permission android:name=\"android.permission.INTERNET\"/>\n\t\t\t</manifest>\n\t\t]]></manifestAdditions>\n\t</android>\n\t<iPhone>\n\t\t<InfoAdditions>\n\t\t<![CDATA[\n\t\t\t<key>UIDeviceFamily</key> \n\t\t\t<array> \n\t\t\t\t<string>1</string>\n\t\t\t\t<string>2</string>\n\t\t\t</array>\n\t\t\t<key>UIPrerenderedIcon</key>\n\t\t\t<true/>\n\t\t\t<key>UIStatusBarStyle</key>\n\t\t\t<string>UIStatusBarStyleLightContent</string>\n\t\t]]> \n\t\t</InfoAdditions>\n\t\t<requestedDisplayResolution>high</requestedDisplayResolution>\n\t</iPhone>\n</application>"
  },
  {
    "path": "examples/Magic8Chat/source/Magic8Chat.as",
    "content": "package\n{\n\timport feathers.examples.magic8.Main;\n\timport feathers.utils.ScreenDensityScaleFactorManager;\n\n\timport flash.display.Loader;\n\timport flash.display.Sprite;\n\timport flash.display.StageAlign;\n\timport flash.display.StageOrientation;\n\timport flash.display.StageScaleMode;\n\timport flash.display3D.Context3DProfile;\n\timport flash.display3D.Context3DRenderMode;\n\timport flash.events.Event;\n\timport flash.filesystem.File;\n\timport flash.filesystem.FileMode;\n\timport flash.filesystem.FileStream;\n\timport flash.system.Capabilities;\n\timport flash.utils.ByteArray;\n\n\timport starling.core.Starling;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#4a4137\")]\n\tpublic class Magic8Chat extends Sprite\n\t{\n\t\tpublic function Magic8Chat()\n\t\t{\n\t\t\tif(this.stage)\n\t\t\t{\n\t\t\t\tthis.stage.scaleMode = StageScaleMode.NO_SCALE;\n\t\t\t\tthis.stage.align = StageAlign.TOP_LEFT;\n\t\t\t}\n\t\t\tthis.mouseEnabled = this.mouseChildren = false;\n\t\t\tthis.showLaunchImage();\n\t\t\tthis.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);\n\t\t}\n\n\t\tprivate var _starling:Starling;\n\t\tprivate var _scaler:ScreenDensityScaleFactorManager;\n\t\tprivate var _launchImage:Loader;\n\t\tprivate var _savedAutoOrients:Boolean;\n\n\t\t/**\n\t\t * On iOS, add the native launch image to the classic display list to\n\t\t * avoid displaying only the stage background color between when the\n\t\t * AIR app finishes launching and Starling starts rendering.\n\t\t * \n\t\t * Launch image names: https://forums.adobe.com/message/9986239#9986239\n\t\t */\n\t\tprivate function showLaunchImage():void\n\t\t{\n\t\t\tvar filePath:String = null;\n\t\t\tvar isPortraitOnly:Boolean = false;\n\t\t\tif(Capabilities.manufacturer.indexOf(\"iOS\") >= 0)\n\t\t\t{\n\t\t\t\tvar isPortraitUpsideDown:Boolean = this.stage.orientation == StageOrientation.UPSIDE_DOWN;\n\t\t\t\tvar isPortrait:Boolean = this.stage.orientation == StageOrientation.DEFAULT || isPortraitUpsideDown;\n\t\t\t\tvar isLandscapeRight:Boolean = this.stage.orientation == StageOrientation.ROTATED_RIGHT;\n\t\t\t\tif(Capabilities.screenResolutionX == 1242 && Capabilities.screenResolutionY == 2208)\n\t\t\t\t{\n\t\t\t\t\t//iphone 6/7/8 plus\n\t\t\t\t\tfilePath = isPortrait ? \"Default-414w-736h@3x~iphone.png\" : \"Default-Landscape-414w-736h@3x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 1125 && Capabilities.screenResolutionY == 2436)\n\t\t\t\t{\n\t\t\t\t\t//iphone x\n\t\t\t\t\tfilePath = isPortrait ? \"Default-812h@3x~iphone.png\" : \"Default-Landscape-812h@3x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 2048 && Capabilities.screenResolutionY == 2732)\n\t\t\t\t{\n\t\t\t\t\t//ipad pro\n\t\t\t\t\tfilePath = isPortrait ? \"Default-Portrait@2x.png\" : \"Default-Landscape@2x.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 1536 && Capabilities.screenResolutionY == 2048)\n\t\t\t\t{\n\t\t\t\t\t//ipad 3/air\n\t\t\t\t\tif(isPortraitUpsideDown)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Portrait@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isPortrait)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-PortraitUpsideDown@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isLandscapeRight)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeRight@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeLeft@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 768 && Capabilities.screenResolutionY == 1024)\n\t\t\t\t{\n\t\t\t\t\t//ipad 1/2\n\t\t\t\t\tif(isPortraitUpsideDown)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Portrait~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isPortrait)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-PortraitUpsideDown~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isLandscapeRight)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeRight~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Landscape~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 750)\n\t\t\t\t{\n\t\t\t\t\t//iphone 6/7/8\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tfilePath = \"Default-375w-667h@2x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 640)\n\t\t\t\t{\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tif(Capabilities.screenResolutionY == 1136)\n\t\t\t\t\t{\n\t\t\t\t\t\t//iphone 5/5c/5s\n\t\t\t\t\t\tfilePath = \"Default-568h@2x~iphone.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//iphone 4/4s\n\t\t\t\t\t\tfilePath = \"Default@2x~iphone.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 320)\n\t\t\t\t{\n\t\t\t\t\t//iphone 3gs\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tfilePath = \"Default~iphone.png\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(filePath)\n\t\t\t{\n\t\t\t\tvar file:File = File.applicationDirectory.resolvePath(filePath);\n\t\t\t\tif(file.exists)\n\t\t\t\t{\n\t\t\t\t\tvar bytes:ByteArray = new ByteArray();\n\t\t\t\t\tvar stream:FileStream = new FileStream();\n\t\t\t\t\tstream.open(file, FileMode.READ);\n\t\t\t\t\tstream.readBytes(bytes, 0, stream.bytesAvailable);\n\t\t\t\t\tstream.close();\n\t\t\t\t\tthis._launchImage = new Loader();\n\t\t\t\t\tthis._launchImage.loadBytes(bytes);\n\t\t\t\t\tthis.addChild(this._launchImage);\n\t\t\t\t\tthis._savedAutoOrients = this.stage.autoOrients;\n\t\t\t\t\tthis.stage.autoOrients = false;\n\t\t\t\t\tif(isPortraitOnly)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.stage.setOrientation(StageOrientation.DEFAULT);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function loaderInfo_completeHandler(event:Event):void\n\t\t{\n\t\t\tStarling.multitouchEnabled = true;\n\t\t\tthis._starling = new Starling(Main, this.stage, null, null, Context3DRenderMode.AUTO, Context3DProfile.BASELINE);\n\t\t\tthis._starling.supportHighResolutions = true;\n\t\t\tthis._starling.skipUnchangedFrames = true;\n\t\t\tthis._starling.start();\n\t\t\tif(this._launchImage)\n\t\t\t{\n\t\t\t\tthis._starling.addEventListener(\"rootCreated\", starling_rootCreatedHandler);\n\t\t\t}\n\t\t\tthis._scaler = new ScreenDensityScaleFactorManager(this._starling);\n\t\t\tthis.stage.addEventListener(Event.DEACTIVATE, stage_deactivateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function starling_rootCreatedHandler(event:Object):void\n\t\t{\n\t\t\tif(this._launchImage)\n\t\t\t{\n\t\t\t\tthis.removeChild(this._launchImage);\n\t\t\t\tthis._launchImage.unloadAndStop(true);\n\t\t\t\tthis._launchImage = null;\n\t\t\t\tthis.stage.autoOrients = this._savedAutoOrients;\n\t\t\t}\n\t\t}\n\n\t\tprivate function stage_deactivateHandler(event:Event):void\n\t\t{\n\t\t\tthis._starling.stop(true);\n\t\t\tthis.stage.addEventListener(Event.ACTIVATE, stage_activateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function stage_activateHandler(event:Event):void\n\t\t{\n\t\t\tthis.stage.removeEventListener(Event.ACTIVATE, stage_activateHandler);\n\t\t\tthis._starling.start();\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "examples/Magic8Chat/source/Magic8ChatWeb.as",
    "content": "package\n{\n\timport feathers.system.DeviceCapabilities;\n\n\timport flash.display.MovieClip;\n\timport flash.display.StageAlign;\n\timport flash.display.StageScaleMode;\n\timport flash.events.Event;\n\timport flash.geom.Rectangle;\n\timport flash.ui.ContextMenu;\n\timport flash.utils.getDefinitionByName;\n\n\timport starling.core.Starling;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#4a4137\")]\n\tpublic class Magic8ChatWeb extends MovieClip\n\t{\n\t\tpublic function Magic8ChatWeb()\n\t\t{\n\t\t\tvar menu:ContextMenu = new ContextMenu();\n\t\t\tmenu.hideBuiltInItems();\n\t\t\tthis.contextMenu = menu;\n\t\t\t\n\t\t\tif(this.stage)\n\t\t\t{\n\t\t\t\tthis.stage.align = StageAlign.TOP_LEFT;\n\t\t\t\tthis.stage.scaleMode = StageScaleMode.NO_SCALE;\n\t\t\t}\n\t\t\t\n\t\t\tthis.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);\n\t\t}\n\t\t\n\t\tprivate var _starling:Starling;\n\t\t\n\t\tprivate function start():void\n\t\t{\n\t\t\tthis.gotoAndStop(2);\n\t\t\tthis.graphics.clear();\n\t\t\t\n\t\t\t//simulating iPhone Retina\n\t\t\tDeviceCapabilities.dpi = 326;\n\t\t\t\n\t\t\tStarling.multitouchEnabled = true;\n\t\t\tvar MainType:Class = getDefinitionByName(\"feathers.examples.magic8.Main\") as Class;\n\t\t\tthis._starling = new Starling(MainType, this.stage, new Rectangle(0, 0, 960, 640));\n\t\t\tthis._starling.supportHighResolutions = true;\n\t\t\tthis._starling.skipUnchangedFrames = true;\n\t\t\tthis._starling.stage.stageWidth = 480;\n\t\t\tthis._starling.stage.stageHeight = 320;\n\t\t\tthis._starling.start();\n\t\t}\n\t\t\n\t\tprivate function loaderInfo_completeHandler(event:Event):void\n\t\t{\n\t\t\tthis.start();\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/Magic8Chat/source/feathers/examples/magic8/Main.as",
    "content": "package feathers.examples.magic8\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.List;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.TextInput;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.renderers.IListItemRenderer;\n\timport feathers.controls.text.StageTextTextEditor;\n\timport feathers.core.ITextEditor;\n\timport feathers.data.ArrayCollection;\n\timport feathers.data.ListCollection;\n\timport feathers.events.FeathersEventType;\n\timport feathers.examples.magic8.data.ChatMessage;\n\timport feathers.examples.magic8.themes.Magic8ChatTheme;\n\timport feathers.examples.magic8.themes.StyleNames;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.HorizontalLayoutData;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\n\timport starling.events.Event;\n\n\tpublic class Main extends PanelScreen\n\t{\n\t\tprivate static const MESSAGES:Vector.<String> = new <String>\n\t\t[\n\t\t\t\"It is certain\",\n\t\t\t\"It is decidedly so\",\n\t\t\t\"Without a doubt\",\n\t\t\t\"Yes, definitely\",\n\t\t\t\"You may rely on it\",\n\t\t\t\"As I see it, yes\",\n\t\t\t\"Most likely\",\n\t\t\t\"Outlook good\",\n\t\t\t\"Yes\",\n\t\t\t\"Signs point to yes\",\n\t\t\t\"Reply hazy try again\",\n\t\t\t\"Ask again later\",\n\t\t\t\"Better not tell you now\",\n\t\t\t\"Cannot predict now\",\n\t\t\t\"Concentrate and ask again\",\n\t\t\t\"Don't count on it\",\n\t\t\t\"My reply is no\",\n\t\t\t\"My sources say no\",\n\t\t\t\"Outlook not so good\",\n\t\t\t\"Very doubtful\",\n\t\t];\n\n\t\tprivate static const USER_ITEM:String = \"user\";\n\t\tprivate static const EIGHT_BALL_ITEM:String = \"8ball\";\n\n\t\tpublic function Main()\n\t\t{\n\t\t\tnew Magic8ChatTheme();\n\t\t\tsuper();\n\t\t\tthis.title = \"Magic 8-Ball\";\n\t\t}\n\n\t\tprivate var _list:List;\n\t\tprivate var _input:TextInput;\n\t\tprivate var _sendButton:Button;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tsuper.initialize();\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._list = new List();\n\t\t\tthis._list.dataProvider = new ArrayCollection();\n\t\t\tthis._list.isSelectable = false;\n\t\t\tthis._list.setItemRendererFactoryWithID(USER_ITEM, function():IListItemRenderer\n\t\t\t{\n\t\t\t\tvar itemRenderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\t\t\t\titemRenderer.styleNameList.add(StyleNames.USER_MESSAGE_ITEM_RENDERER);\n\t\t\t\titemRenderer.labelField = \"message\";\n\t\t\t\titemRenderer.wordWrap = true;\n\t\t\t\treturn itemRenderer;\n\t\t\t});\n\t\t\tthis._list.setItemRendererFactoryWithID(EIGHT_BALL_ITEM, function():IListItemRenderer\n\t\t\t{\n\t\t\t\tvar itemRenderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\t\t\t\titemRenderer.styleNameList.add(StyleNames.EIGHT_BALL_MESSAGE_ITEM_RENDERER);\n\t\t\t\titemRenderer.labelField = \"message\";\n\t\t\t\titemRenderer.wordWrap = true;\n\t\t\t\treturn itemRenderer;\n\t\t\t});\n\t\t\tthis._list.factoryIDFunction = function(item:ChatMessage):String\n\t\t\t{\n\t\t\t\tif(item.type === ChatMessage.TYPE_MAGIC_8BALL)\n\t\t\t\t{\n\t\t\t\t\treturn EIGHT_BALL_ITEM;\n\t\t\t\t}\n\t\t\t\treturn USER_ITEM;\n\t\t\t};\n\t\t\tvar listLayout:VerticalLayout = new VerticalLayout();\n\t\t\tlistLayout.hasVariableItemDimensions = true;\n\t\t\tlistLayout.horizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\tlistLayout.verticalAlign = VerticalAlign.BOTTOM;\n\t\t\tthis._list.layout = listLayout;\n\t\t\tthis.addChild(this._list);\n\n\t\t\tvar controls:LayoutGroup = new LayoutGroup();\n\t\t\tcontrols.styleNameList.add(LayoutGroup.ALTERNATE_STYLE_NAME_TOOLBAR);\n\t\t\tthis.addChild(controls);\n\n\t\t\tthis._input = new TextInput();\n\t\t\tthis._input.prompt = \"Ask a yes or no question...\";\n\t\t\tthis._input.layoutData = new HorizontalLayoutData(100);\n\t\t\tthis._input.textEditorFactory = function():ITextEditor\n\t\t\t{\n\t\t\t\tvar textEditor:StageTextTextEditor = new StageTextTextEditor();\n\t\t\t\ttextEditor.maintainTouchFocus = true;\n\t\t\t\t//flash.text.ReturnKeyLabel doesn't exist in Flash Player, so\n\t\t\t\t//we can't use the constant here.\n\t\t\t\t//we use ReturnKeyLabel.GO because the default label doesn't\n\t\t\t\t//dispatch an event for Keyboard.ENTER on all platforms.\n\t\t\t\ttextEditor.returnKeyLabel = \"go\";\n\t\t\t\treturn textEditor;\n\t\t\t};\n\t\t\tthis._input.addEventListener(FeathersEventType.ENTER, input_enterHandler);\n\t\t\tthis._input.addEventListener(Event.CHANGE, input_changeHandler);\n\t\t\tcontrols.addChild(this._input);\n\n\t\t\tthis._sendButton = new Button();\n\t\t\tthis._sendButton.label = \"Send\";\n\t\t\tthis._sendButton.addEventListener(Event.TRIGGERED, sendButton_triggeredHandler);\n\t\t\tcontrols.addChild(this._sendButton);\n\n\t\t\tcontrols.layoutData = new AnchorLayoutData(NaN, 0, 0, 0);\n\t\t\tvar listLayoutData:AnchorLayoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tlistLayoutData.bottomAnchorDisplayObject = controls;\n\t\t\tthis._list.layoutData = listLayoutData;\n\t\t}\n\n\t\tprivate function sendMessage():void\n\t\t{\n\t\t\tvar message:String = this._input.text;\n\t\t\tif(message.length == 0)\n\t\t\t{\n\t\t\t\tthis._input.errorString = \"Please ask a question!\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._input.text = \"\";\n\t\t\tthis._list.dataProvider.addItem(new ChatMessage(ChatMessage.TYPE_USER, message));\n\n\t\t\tvar index:int = Math.floor(Math.random() * MESSAGES.length);\n\t\t\tvar response:String = MESSAGES[index];\n\t\t\tthis._list.dataProvider.addItem(new ChatMessage(ChatMessage.TYPE_MAGIC_8BALL, response));\n\n\t\t\tthis._list.validate();\n\t\t\tthis._list.scrollToPosition(0, this._list.maxVerticalScrollPosition, 0.5);\n\t\t}\n\n\t\tprivate function input_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._input.text.length > 0)\n\t\t\t{\n\t\t\t\tthis._input.errorString = null;\n\t\t\t}\n\t\t}\n\n\t\tprivate function input_enterHandler(event:Event):void\n\t\t{\n\t\t\tthis.sendMessage();\n\t\t}\n\n\t\tprivate function sendButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.sendMessage();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/Magic8Chat/source/feathers/examples/magic8/data/ChatMessage.as",
    "content": "package feathers.examples.magic8.data\n{\n\tpublic class ChatMessage\n\t{\n\t\tpublic static const TYPE_USER:String = \"user\";\n\t\tpublic static const TYPE_MAGIC_8BALL:String = \"magic8Ball\";\n\n\t\tpublic function ChatMessage(type:String, message:String)\n\t\t{\n\t\t\tthis.type = type;\n\t\t\tthis.message = message;\n\t\t}\n\n\t\tpublic var type:String;\n\t\tpublic var message:String;\n\t}\n}\n"
  },
  {
    "path": "examples/Magic8Chat/source/feathers/examples/magic8/themes/Magic8ChatTheme.as",
    "content": "package feathers.examples.magic8.themes\n{\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.text.TextBlockTextRenderer;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.RelativePosition;\n\timport feathers.themes.MetalWorksMobileTheme;\n\n\timport starling.display.Image;\n\timport starling.textures.Texture;\n\n\tpublic class Magic8ChatTheme extends MetalWorksMobileTheme\n\t{\n\t\t[Embed(source=\"/../assets/images/8ball@2x.png\")]\n\t\tprivate static const EIGHT_BALL_ICON:Class;\n\n\t\t[Embed(source=\"/../assets/images/question@2x.png\")]\n\t\tprivate static const QUESTION_ICON:Class;\n\n\t\tprivate static const THEME_STYLE_NAME_MESSAGE_ITEM_RENDERER_LABEL:String = \"magic8Ball-message-item-renderer-label\";\n\n\t\tpublic function Magic8ChatTheme()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var eightBallTexture:Texture;\n\t\tprivate var questionTexture:Texture;\n\n\t\toverride protected function initializeTextures():void\n\t\t{\n\t\t\tsuper.initializeTextures();\n\t\t\tthis.eightBallTexture = Texture.fromEmbeddedAsset(EIGHT_BALL_ICON, false, false, 2);\n\t\t\tthis.questionTexture = Texture.fromEmbeddedAsset(QUESTION_ICON, false, false, 2);\n\t\t}\n\n\t\toverride protected function initializeStyleProviders():void\n\t\t{\n\t\t\tsuper.initializeStyleProviders();\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer)\n\t\t\t\t.setFunctionForStyleName(StyleNames.USER_MESSAGE_ITEM_RENDERER, this.setUserMessageItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer)\n\t\t\t\t.setFunctionForStyleName(StyleNames.EIGHT_BALL_MESSAGE_ITEM_RENDERER, this.setEightBallMessageItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(TextBlockTextRenderer)\n\t\t\t\t.setFunctionForStyleName(THEME_STYLE_NAME_MESSAGE_ITEM_RENDERER_LABEL, this.setMessageItemRendererLabelStyles);\n\t\t}\n\n\t\tprivate function setUserMessageItemRendererStyles(itemRenderer:DefaultListItemRenderer):void\n\t\t{\n\t\t\tthis.setItemRendererStyles(itemRenderer);\n\n\t\t\titemRenderer.customLabelStyleName = THEME_STYLE_NAME_MESSAGE_ITEM_RENDERER_LABEL;\n\n\t\t\titemRenderer.horizontalAlign = HorizontalAlign.RIGHT;\n\t\t\titemRenderer.iconPosition = RelativePosition.RIGHT;\n\n\t\t\titemRenderer.itemHasIcon = false;\n\t\t\titemRenderer.defaultIcon = new Image(this.questionTexture);\n\t\t}\n\n\t\tprivate function setEightBallMessageItemRendererStyles(itemRenderer:DefaultListItemRenderer):void\n\t\t{\n\t\t\tthis.setItemRendererStyles(itemRenderer);\n\n\t\t\titemRenderer.customLabelStyleName = THEME_STYLE_NAME_MESSAGE_ITEM_RENDERER_LABEL;\n\n\t\t\titemRenderer.itemHasIcon = false;\n\t\t\titemRenderer.defaultIcon = new Image(this.eightBallTexture);\n\t\t}\n\n\t\tprivate function setMessageItemRendererLabelStyles(text:TextBlockTextRenderer):void\n\t\t{\n\t\t\ttext.wordWrap = true;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/Magic8Chat/source/feathers/examples/magic8/themes/StyleNames.as",
    "content": "package feathers.examples.magic8.themes\n{\n\tpublic class StyleNames\n\t{\n\t\tpublic static const USER_MESSAGE_ITEM_RENDERER:String = \"magic8Ball-user-message-item-renderer\";\n\t\tpublic static const EIGHT_BALL_MESSAGE_ITEM_RENDERER:String = \"magic8Ball-eight-ball-message-item-renderer\";\n\t}\n}\n"
  },
  {
    "path": "examples/PullToRefresh/README.md",
    "content": "# Feathers Pull to Refresh\n\nA demonstration of a [Feathers](http://feathersui.com/) list component containing a pull view that refreshes the data provider.\n\n## Requirements\n\nIn addition to Starling Framework and Feathers, this example project requires the `MetalWorksMobileTheme` example theme. You can find the SWC file for this theme at the following location in the Feathers release build:\n\n\tthemes/MetalWorksMobileTheme/swc/MetalWorksMobileTheme.swc\n\n## Web Demo\n\nView the [Pull to Refresh](http://feathersui.com/examples/pull-to-refresh/) example in your browser."
  },
  {
    "path": "examples/PullToRefresh/assets/images/spinner.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<TextureAtlas imagePath=\"spinner.png\">\n\t<!-- Created with Adobe Animate version 16.1.0.86 -->\n\t<!-- http://www.adobe.com/products/animate.html -->\n\t<SubTexture name=\"Spinner0000\" x=\"0\" y=\"0\" width=\"36\" height=\"36\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"Spinner0001\" x=\"0\" y=\"36\" width=\"36\" height=\"36\"/>\n\t<SubTexture name=\"Spinner0002\" x=\"0\" y=\"72\" width=\"36\" height=\"36\"/>\n\t<SubTexture name=\"Spinner0003\" x=\"36\" y=\"0\" width=\"36\" height=\"36\"/>\n\t<SubTexture name=\"Spinner0004\" x=\"72\" y=\"0\" width=\"36\" height=\"36\"/>\n\t<SubTexture name=\"Spinner0005\" x=\"36\" y=\"36\" width=\"36\" height=\"36\"/>\n\t<SubTexture name=\"Spinner0006\" x=\"36\" y=\"72\" width=\"36\" height=\"36\"/>\n\t<SubTexture name=\"Spinner0007\" x=\"72\" y=\"36\" width=\"36\" height=\"36\"/>\n</TextureAtlas>\n"
  },
  {
    "path": "examples/PullToRefresh/build.properties",
    "content": "feathers.root = ${basedir}/../../source\nstarling.root = ${basedir}/../../third-party/starling\ntheme.root = ${basedir}/../../themes/MetalWorksMobileTheme/source\noutput.path = ${basedir}/output\nicon.path = ${basedir}/../shared-assets/icons\nlaunch.image.path = ${basedir}/../shared-assets/launch-images-windowed\nadvanced.telemetry=false\n\nswf.version = 30"
  },
  {
    "path": "examples/PullToRefresh/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<project name=\"pull-to-refresh\" default=\"build\" basedir=\".\">\n\t\n\t<!-- build.local.properties and sdk.local.proprties are optional files that\n\t\tcan be used to override the default properties. -->\n\t<property file=\"./build.local.properties\"/>\n\t<property file=\"./sdk.local.properties\"/>\n\t<property file=\"./build.properties\"/>\n\t<!-- inherit SDK properties from the root of the repository -->\n\t<property file=\"../../sdk.local.properties\"/>\n\t<property file=\"../../sdk.properties\"/>\n\n\t<target name=\"build\" depends=\"build-web,build-android,build-ios\"/>\n\n\t<target name=\"prepare\">\n\t\t<delete dir=\"${output.path}\"/>\n\t</target>\n\n\t<target name=\"build-web\" depends=\"prepare\">\n\t\t<echo message=\"Building PullToRefreshWeb.swf\"/>\n\t\t<java jar=\"${mxmlc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${flashplayer.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-advanced-telemetry=true\"/>\n\t\t\t<arg value=\"-frame=two,feathers.examples.pullToRefresh.Main\"/>\n\t\t\t<arg value=\"-source-path+=source\"/>\n\t\t\t<arg value=\"-source-path+=${starling.root}\"/>\n\t\t\t<arg value=\"-source-path+=${feathers.root}\"/>\n\t\t\t<arg value=\"-source-path+=${theme.root}\"/>\n\t\t\t<arg value=\"source/PullToRefreshWeb.as\"/>\n\t\t\t<arg value=\"-output=${output.path}/PullToRefreshWeb.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"build-air-swf\" depends=\"prepare\">\n\t\t<echo message=\"Building PullToRefresh.swf\"/>\n\t\t<java jar=\"${mxmlc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${airmobile.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-advanced-telemetry=${advanced.telemetry}\"/>\n\t\t\t<arg value=\"-source-path+=source\"/>\n\t\t\t<arg value=\"-source-path+=${starling.root}\"/>\n\t\t\t<arg value=\"-source-path+=${feathers.root}\"/>\n\t\t\t<arg value=\"-source-path+=${theme.root}\"/>\n\t\t\t<arg value=\"source/PullToRefresh.as\"/>\n\t\t\t<arg value=\"-output=${output.path}/PullToRefresh.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"-check-ios-properties\">\n\t\t<fail unless=\"ios.provision.path\"/>\n\t\t<fail unless=\"ios.certificate.path\"/>\n\t\t<fail unless=\"ios.certificate.password\"/>\n\t</target>\n\t<target name=\"build-ios\" depends=\"-check-ios-properties,build-air-swf\">\n\t\t<echo message=\"Packaging PullToRefresh.ipa\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"-target\"/>\n\t\t\t<arg value=\"ipa-app-store\"/>\n\t\t\t<!-- uncomment for actionscript sampling with scout on ios -->\n\t\t\t<!--<arg value=\"-sampler\"/>-->\n\t\t\t<arg value=\"-provisioning-profile\"/>\n\t\t\t<arg value=\"${ios.provision.path}\"/>\n\t\t\t<arg value=\"-keystore\"/>\n\t\t\t<arg value=\"${ios.certificate.path}\"/>\n\t\t\t<arg value=\"-storetype\"/>\n\t\t\t<arg value=\"pkcs12\"/>\n\t\t\t<arg value=\"-storepass\"/>\n\t\t\t<arg value=\"${ios.certificate.password}\"/>\n\t\t\t<arg value=\"${output.path}/PullToRefresh.ipa\"/>\n\t\t\t<arg value=\"source/PullToRefresh-app.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${icon.path}\"/>\n\t\t\t<arg line=\"icon29.png icon48.png icon50.png icon57.png icon58.png icon72.png icon87.png icon96.png icon100.png icon114.png icon128.png icon144.png icon180.png\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${launch.image.path}\"/>\n\t\t\t<arg value=\"Default~iphone.png\"/>\t\t\t\t\t\t\t<!-- iphone 3gs -->\n\t\t\t<arg value=\"Default@2x~iphone.png\"/>\t\t\t\t\t\t<!-- iphone 4/4s -->\n\t\t\t<arg value=\"Default-568h@2x~iphone.png\"/>\t\t\t\t\t<!-- iphone 5/5c/5s -->\n\t\t\t<arg value=\"Default-375w-667h@2x~iphone.png\"/>\t\t\t\t<!-- iphone 6/7/8 -->\n\t\t\t<arg value=\"Default-812h@3x~iphone.png\"/>\t\t\t\t\t<!-- iphone x (portrait) -->\n\t\t\t<arg value=\"Default-Landscape-812h@3x~iphone.png\"/>\t\t\t<!-- iphone x (landscape) -->\n\t\t\t<arg value=\"Default-414w-736h@3x~iphone.png\"/>\t\t\t\t<!-- iphone 6/7/8 plus (portrait) -->\n\t\t\t<arg value=\"Default-Landscape-414w-736h@3x~iphone.png\"/>\t<!-- iphone 6/7/8 plus (landscape) -->\n\t\t\t<arg value=\"Default-Portrait~ipad.png\"/>\t\t\t\t\t<!-- ipad 1/2 (portrait) -->\n\t\t\t<arg value=\"Default-PortraitUpsideDown~ipad.png\"/>\t\t\t<!-- ipad 1/2 (portrait upside down) -->\n\t\t\t<arg value=\"Default-Landscape~ipad.png\"/>\t\t\t\t\t<!-- ipad 1/2 (landscape left) -->\n\t\t\t<arg value=\"Default-LandscapeRight~ipad.png\"/>\t\t\t\t<!-- ipad 1/2 (landscape right) -->\n\t\t\t<arg value=\"Default-Portrait@2x~ipad.png\"/>\t\t\t\t\t<!-- ipad 3/air (portrait) -->\n\t\t\t<arg value=\"Default-LandscapeLeft@2x~ipad.png\"/>\t\t\t<!-- ipad 3/air (landscape left) -->\n\t\t\t<arg value=\"Default-LandscapeRight@2x~ipad.png\"/>\t\t\t<!-- ipad 3/air (landscape right) -->\n\t\t\t<arg value=\"Default-Portrait@2x.png\"/>\t\t\t\t\t\t<!-- ipad pro (portrait) -->\n\t\t\t<arg value=\"Default-Landscape@2x.png\"/>\t\t\t\t\t\t<!-- ipad pro (landscape) -->\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${output.path}\"/>\n\t\t\t<arg value=\"PullToRefresh.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"-check-android-properties\">\n\t\t<fail unless=\"android.certificate.path\"/>\n\t\t<fail unless=\"android.certificate.password\"/>\n\t</target>\n\t<target name=\"build-android\" depends=\"-check-android-properties,build-air-swf\">\n\t\t<echo message=\"Packaging PullToRefresh.apk\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"-target\"/>\n\t\t\t<arg value=\"apk-captive-runtime\"/>\n\t\t\t<arg value=\"-storetype\"/>\n\t\t\t<arg value=\"pkcs12\"/>\n\t\t\t<arg value=\"-keystore\"/>\n\t\t\t<arg value=\"${android.certificate.path}\"/>\n\t\t\t<arg value=\"-storepass\"/>\n\t\t\t<arg value=\"${android.certificate.password}\"/>\n\t\t\t<arg value=\"${output.path}/PullToRefresh.apk\"/>\n\t\t\t<arg value=\"source/PullToRefresh-app.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${icon.path}\"/>\n\t\t\t<arg line=\"icon29.png icon48.png icon50.png icon57.png icon58.png icon72.png icon87.png icon96.png icon100.png icon114.png icon128.png icon144.png icon180.png\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${output.path}\"/>\n\t\t\t<arg value=\"PullToRefresh.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"install-android\">\n\t\t<echo message=\"Installing PullToRefresh.apk\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"false\">\n\t\t\t<arg value=\"-uninstallApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"android\"/>\n\t\t\t<arg value=\"-appid\"/>\n\t\t\t<arg value=\"com.feathersui.examples.PullToRefresh\"/>\n\t\t</java>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-installApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"android\"/>\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"${output.path}/PullToRefresh.apk\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"install-ios\">\n\t\t<echo message=\"Installing PullToRefresh.ipa\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"false\">\n\t\t\t<arg value=\"-uninstallApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"iOS\"/>\n\t\t\t<arg value=\"-appid\"/>\n\t\t\t<arg value=\"com.feathersui.examples.PullToRefresh\"/>\n\t\t</java>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-installApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"iOS\"/>\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"${output.path}/PullToRefresh.ipa\"/>\n\t\t</java>\n\t</target>\n</project>"
  },
  {
    "path": "examples/PullToRefresh/source/PullToRefresh-app.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<application xmlns=\"http://ns.adobe.com/air/application/32.0\">\n\t<id>com.feathersui.examples.PullToRefresh</id>\n\t<filename>PullToRefresh</filename>\n\t<name>Pull to Refresh</name>\n\t<versionNumber>4.2.0</versionNumber>\n\t<description>Pull to Refresh example application built with Feathers UI controls for Starling</description>\n\t<copyright>2021 Bowler Hat LLC</copyright>\n\n\t<initialWindow>\n\t\t<content>PullToRefresh.swf</content>\n\t\t<autoOrients>true</autoOrients>\n\t\t<fullScreen>false</fullScreen>\n\t\t<visible>true</visible>\n\t\t<renderMode>direct</renderMode>\n\t</initialWindow>\n\n\t<supportedLanguages>en</supportedLanguages>\n\n\t<icon>\n\t\t<image29x29>icon29.png</image29x29>\n\t\t<image48x48>icon48.png</image48x48>\n\t\t<image50x50>icon50.png</image50x50>\n\t\t<image57x57>icon57.png</image57x57>\n\t\t<image58x58>icon58.png</image58x58>\n\t\t<image72x72>icon72.png</image72x72>\n\t\t<image87x87>icon87.png</image87x87>\n\t\t<image96x96>icon96.png</image96x96>\n\t\t<image100x100>icon100.png</image100x100>\n\t\t<image114x114>icon114.png</image114x114>\n\t\t<image128x128>icon128.png</image128x128>\n\t\t<image144x144>icon144.png</image144x144>\n\t\t<image180x180>icon180.png</image180x180>\n\t</icon>\n\t<android>\n\t\t<colorDepth>16bit</colorDepth>\n\t\t<manifestAdditions><![CDATA[\n\t\t\t<manifest android:installLocation=\"auto\">\n\t\t\t    <uses-permission android:name=\"android.permission.INTERNET\"/>\n\t\t\t</manifest>\n\t\t]]></manifestAdditions>\n\t</android>\n\t<iPhone>\n\t\t<InfoAdditions>\n\t\t<![CDATA[\n\t\t\t<key>UIDeviceFamily</key> \n\t\t\t<array> \n\t\t\t\t<string>1</string>\n\t\t\t\t<string>2</string>\n\t\t\t</array>\n\t\t\t<key>UIPrerenderedIcon</key>\n\t\t\t<true/>\n\t\t\t<key>UIStatusBarStyle</key>\n\t\t\t<string>UIStatusBarStyleLightContent</string>\n\t\t\t<key>NSAppTransportSecurity</key>\n\t\t\t<dict>\n\t\t\t\t<key>NSAllowsArbitraryLoads</key>\n\t\t\t\t<true/>\n\t\t\t</dict>\n\t\t]]> \n\t\t</InfoAdditions>\n\t\t<requestedDisplayResolution>high</requestedDisplayResolution>\n\t</iPhone>\n</application>"
  },
  {
    "path": "examples/PullToRefresh/source/PullToRefresh.as",
    "content": "package\n{\n\timport feathers.examples.pullToRefresh.Main;\n\timport feathers.utils.ScreenDensityScaleFactorManager;\n\n\timport flash.display.Loader;\n\timport flash.display.Sprite;\n\timport flash.display.StageAlign;\n\timport flash.display.StageOrientation;\n\timport flash.display.StageScaleMode;\n\timport flash.display3D.Context3DProfile;\n\timport flash.display3D.Context3DRenderMode;\n\timport flash.events.Event;\n\timport flash.filesystem.File;\n\timport flash.filesystem.FileMode;\n\timport flash.filesystem.FileStream;\n\timport flash.system.Capabilities;\n\timport flash.utils.ByteArray;\n\n\timport starling.core.Starling;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#4a4137\")]\n\tpublic class PullToRefresh extends Sprite\n\t{\n\t\tpublic function PullToRefresh()\n\t\t{\n\t\t\tif(this.stage)\n\t\t\t{\n\t\t\t\tthis.stage.scaleMode = StageScaleMode.NO_SCALE;\n\t\t\t\tthis.stage.align = StageAlign.TOP_LEFT;\n\t\t\t}\n\t\t\tthis.mouseEnabled = this.mouseChildren = false;\n\t\t\tthis.showLaunchImage();\n\t\t\tthis.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);\n\t\t}\n\n\t\tprivate var _starling:Starling;\n\t\tprivate var _scaler:ScreenDensityScaleFactorManager;\n\t\tprivate var _launchImage:Loader;\n\t\tprivate var _savedAutoOrients:Boolean;\n\n\t\t/**\n\t\t * On iOS, add the native launch image to the classic display list to\n\t\t * avoid displaying only the stage background color between when the\n\t\t * AIR app finishes launching and Starling starts rendering.\n\t\t * \n\t\t * Launch image names: https://forums.adobe.com/message/9986239#9986239\n\t\t */\n\t\tprivate function showLaunchImage():void\n\t\t{\n\t\t\tvar filePath:String = null;\n\t\t\tvar isPortraitOnly:Boolean = false;\n\t\t\tif(Capabilities.manufacturer.indexOf(\"iOS\") >= 0)\n\t\t\t{\n\t\t\t\tvar isPortraitUpsideDown:Boolean = this.stage.orientation == StageOrientation.UPSIDE_DOWN;\n\t\t\t\tvar isPortrait:Boolean = this.stage.orientation == StageOrientation.DEFAULT || isPortraitUpsideDown;\n\t\t\t\tvar isLandscapeRight:Boolean = this.stage.orientation == StageOrientation.ROTATED_RIGHT;\n\t\t\t\tif(Capabilities.screenResolutionX == 1242 && Capabilities.screenResolutionY == 2208)\n\t\t\t\t{\n\t\t\t\t\t//iphone 6/7/8 plus\n\t\t\t\t\tfilePath = isPortrait ? \"Default-414w-736h@3x~iphone.png\" : \"Default-Landscape-414w-736h@3x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 1125 && Capabilities.screenResolutionY == 2436)\n\t\t\t\t{\n\t\t\t\t\t//iphone x\n\t\t\t\t\tfilePath = isPortrait ? \"Default-812h@3x~iphone.png\" : \"Default-Landscape-812h@3x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 2048 && Capabilities.screenResolutionY == 2732)\n\t\t\t\t{\n\t\t\t\t\t//ipad pro\n\t\t\t\t\tfilePath = isPortrait ? \"Default-Portrait@2x.png\" : \"Default-Landscape@2x.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 1536 && Capabilities.screenResolutionY == 2048)\n\t\t\t\t{\n\t\t\t\t\t//ipad 3/air\n\t\t\t\t\tif(isPortraitUpsideDown)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Portrait@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isPortrait)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-PortraitUpsideDown@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isLandscapeRight)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeRight@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeLeft@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 768 && Capabilities.screenResolutionY == 1024)\n\t\t\t\t{\n\t\t\t\t\t//ipad 1/2\n\t\t\t\t\tif(isPortraitUpsideDown)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Portrait~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isPortrait)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-PortraitUpsideDown~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isLandscapeRight)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeRight~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Landscape~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 750)\n\t\t\t\t{\n\t\t\t\t\t//iphone 6/7/8\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tfilePath = \"Default-375w-667h@2x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 640)\n\t\t\t\t{\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tif(Capabilities.screenResolutionY == 1136)\n\t\t\t\t\t{\n\t\t\t\t\t\t//iphone 5/5c/5s\n\t\t\t\t\t\tfilePath = \"Default-568h@2x~iphone.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//iphone 4/4s\n\t\t\t\t\t\tfilePath = \"Default@2x~iphone.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 320)\n\t\t\t\t{\n\t\t\t\t\t//iphone 3gs\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tfilePath = \"Default~iphone.png\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(filePath)\n\t\t\t{\n\t\t\t\tvar file:File = File.applicationDirectory.resolvePath(filePath);\n\t\t\t\tif(file.exists)\n\t\t\t\t{\n\t\t\t\t\tvar bytes:ByteArray = new ByteArray();\n\t\t\t\t\tvar stream:FileStream = new FileStream();\n\t\t\t\t\tstream.open(file, FileMode.READ);\n\t\t\t\t\tstream.readBytes(bytes, 0, stream.bytesAvailable);\n\t\t\t\t\tstream.close();\n\t\t\t\t\tthis._launchImage = new Loader();\n\t\t\t\t\tthis._launchImage.loadBytes(bytes);\n\t\t\t\t\tthis.addChild(this._launchImage);\n\t\t\t\t\tthis._savedAutoOrients = this.stage.autoOrients;\n\t\t\t\t\tthis.stage.autoOrients = false;\n\t\t\t\t\tif(isPortraitOnly)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.stage.setOrientation(StageOrientation.DEFAULT);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function loaderInfo_completeHandler(event:Event):void\n\t\t{\n\t\t\tStarling.multitouchEnabled = true;\n\t\t\tthis._starling = new Starling(Main, this.stage, null, null, Context3DRenderMode.AUTO, Context3DProfile.BASELINE);\n\t\t\tthis._starling.supportHighResolutions = true;\n\t\t\tthis._starling.skipUnchangedFrames = true;\n\t\t\tthis._starling.start();\n\t\t\tif(this._launchImage)\n\t\t\t{\n\t\t\t\tthis._starling.addEventListener(\"rootCreated\", starling_rootCreatedHandler);\n\t\t\t}\n\t\t\tthis._scaler = new ScreenDensityScaleFactorManager(this._starling);\n\t\t\tthis.stage.addEventListener(Event.DEACTIVATE, stage_deactivateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function starling_rootCreatedHandler(event:Object):void\n\t\t{\n\t\t\tif(this._launchImage)\n\t\t\t{\n\t\t\t\tthis.removeChild(this._launchImage);\n\t\t\t\tthis._launchImage.unloadAndStop(true);\n\t\t\t\tthis._launchImage = null;\n\t\t\t\tthis.stage.autoOrients = this._savedAutoOrients;\n\t\t\t}\n\t\t}\n\n\t\tprivate function stage_deactivateHandler(event:Event):void\n\t\t{\n\t\t\tthis._starling.stop(true);\n\t\t\tthis.stage.addEventListener(Event.ACTIVATE, stage_activateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function stage_activateHandler(event:Event):void\n\t\t{\n\t\t\tthis.stage.removeEventListener(Event.ACTIVATE, stage_activateHandler);\n\t\t\tthis._starling.start();\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "examples/PullToRefresh/source/PullToRefreshWeb.as",
    "content": "package\n{\n\timport feathers.system.DeviceCapabilities;\n\n\timport flash.display.MovieClip;\n\timport flash.display.StageAlign;\n\timport flash.display.StageScaleMode;\n\timport flash.events.Event;\n\timport flash.geom.Rectangle;\n\timport flash.ui.ContextMenu;\n\timport flash.utils.getDefinitionByName;\n\n\timport starling.core.Starling;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#4a4137\")]\n\tpublic class PullToRefreshWeb extends MovieClip\n\t{\n\t\tpublic function PullToRefreshWeb()\n\t\t{\n\t\t\tvar menu:ContextMenu = new ContextMenu();\n\t\t\tmenu.hideBuiltInItems();\n\t\t\tthis.contextMenu = menu;\n\t\t\t\n\t\t\tif(this.stage)\n\t\t\t{\n\t\t\t\tthis.stage.align = StageAlign.TOP_LEFT;\n\t\t\t\tthis.stage.scaleMode = StageScaleMode.NO_SCALE;\n\t\t\t}\n\t\t\t\n\t\t\tthis.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);\n\t\t}\n\t\t\n\t\tprivate var _starling:Starling;\n\t\t\n\t\tprivate function start():void\n\t\t{\n\t\t\tthis.gotoAndStop(2);\n\t\t\tthis.graphics.clear();\n\t\t\t\n\t\t\t//simulating iPhone Retina\n\t\t\tDeviceCapabilities.dpi = 326;\n\t\t\t\n\t\t\tStarling.multitouchEnabled = true;\n\t\t\tvar MainType:Class = getDefinitionByName(\"feathers.examples.pullToRefresh.Main\") as Class;\n\t\t\tthis._starling = new Starling(MainType, this.stage, new Rectangle(0, 0, 960, 640));\n\t\t\tthis._starling.supportHighResolutions = true;\n\t\t\tthis._starling.skipUnchangedFrames = true;\n\t\t\tthis._starling.stage.stageWidth = 480;\n\t\t\tthis._starling.stage.stageHeight = 320;\n\t\t\tthis._starling.start();\n\t\t}\n\t\t\n\t\tprivate function loaderInfo_completeHandler(event:Event):void\n\t\t{\n\t\t\tthis.start();\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/PullToRefresh/source/feathers/examples/pullToRefresh/Main.as",
    "content": "package feathers.examples.pullToRefresh\n{\n\timport feathers.controls.List;\n\timport feathers.controls.PanelScreen;\n\timport feathers.data.ArrayCollection;\n\timport feathers.data.IListCollection;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.themes.MetalWorksMobileTheme;\n\n\timport flash.events.TimerEvent;\n\timport flash.utils.Timer;\n\n\timport starling.core.Starling;\n\timport starling.display.MovieClip;\n\timport starling.events.Event;\n\timport starling.textures.Texture;\n\timport starling.textures.TextureAtlas;\n\n\tpublic class Main extends PanelScreen\n\t{\n\t\t[Embed(source=\"/../assets/images/spinner.png\")]\n\t\tprivate static const SPINNER_ATLAS_IMAGE_EMBEDDED:Class;\n\n\t\t[Embed(source=\"/../assets/images/spinner.xml\",mimeType=\"application/octet-stream\")]\n\t\tprivate static const SPINNER_ATLAS_XML_EMBEDDED:Class;\n\n\t\tpublic function Main()\n\t\t{\n\t\t\tnew MetalWorksMobileTheme();\n\t\t}\n\n\t\tprivate var _list:List;\n\t\tprivate var _pullView:MovieClip;\n\t\tprivate var _timer:Timer;\n\t\tprivate var _nextItemIndex:int = 1;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tsuper.initialize(); //don't forget this!\n\n\t\t\tthis.title = \"Pull to Refresh\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\t//any Starling display object may be used as a pull view.\n\t\t\t//we'll use an animated MovieClip in this example.\n\t\t\tvar texture:Texture = Texture.fromEmbeddedAsset(SPINNER_ATLAS_IMAGE_EMBEDDED, false, false, 2);\n\t\t\tvar atlas:TextureAtlas = new TextureAtlas(texture, XML(new SPINNER_ATLAS_XML_EMBEDDED()));\n\t\t\tthis._pullView = new MovieClip(atlas.getTextures());\n\n\t\t\t//FeathersEventType.PULLING will be dispatched on the pull view as\n\t\t\t//it is pulled down so that we can change its appearance. \n\t\t\tthis._pullView.addEventListener(FeathersEventType.PULLING, pullView_pullingHandler);\n\n\t\t\tthis._list = new List();\n\n\t\t\t//pull views may appear on any of the four sides.\n\t\t\t//we'll put one on the top.\n\t\t\tthis._list.topPullView = this._pullView;\n\n\t\t\t//when the user pulls the topPullView down by its full height then\n\t\t\t//releases, the list will dispatch Event.UPDATE\n\t\t\tthis._list.addEventListener(Event.UPDATE, list_updateHandler);\n\n\t\t\tthis._list.dataProvider = new ArrayCollection();\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis.addChild(this._list);\n\n\t\t\tthis.loadData();\n\t\t}\n\n\t\tprivate function loadData():void\n\t\t{\n\t\t\tif(this._timer)\n\t\t\t{\n\t\t\t\t//if we're already loading data, cancel it\n\t\t\t\tthis._timer.stop();\n\t\t\t\tthis._timer.removeEventListener(TimerEvent.TIMER_COMPLETE, timerCompleteHandler);\n\t\t\t\tthis._timer = null;\n\t\t\t}\n\n\t\t\t//if we aren't showing the pull view (such as the first time we load\n\t\t\t//the data), we can force it to display\n\t\t\tthis._list.isTopPullViewActive = true;\n\n\t\t\t//start the pull view animation\n\t\t\tStarling.juggler.add(this._pullView);\n\n\t\t\t//we're not going to load real data for this example. we'll just\n\t\t\t//wait a couple of seconds and generate some new items dynamically.\n\t\t\t//using an AssetManager or URLLoader would look pretty similar.\n\t\t\tthis._timer = new Timer(2000, 1);\n\t\t\tthis._timer.addEventListener(TimerEvent.TIMER_COMPLETE, timerCompleteHandler);\n\t\t\tthis._timer.start();\n\t\t}\n\n\t\tprivate function timerCompleteHandler(event:TimerEvent):void\n\t\t{\n\t\t\tthis._timer.removeEventListener(TimerEvent.TIMER_COMPLETE, timerCompleteHandler);\n\t\t\tthis._timer = null;\n\n\t\t\tvar collection:IListCollection = this._list.dataProvider;\n\t\t\t//we don't need to remove all of the old items. we could simply add\n\t\t\t//the new ones to the beginning instead.\n\t\t\t//if not removing all items, be aware that the new data might\n\t\t\t//contain duplicate items, depending on how it was loaded, so it's\n\t\t\t//a good idea to check if an item already exists in the collection\n\t\t\t//before adding it. \n\t\t\tcollection.removeAll();\n\t\t\tfor(var i:int = 0; i < 25; i++)\n\t\t\t{\n\t\t\t\tvar newItem:Object = { label: \"Item \" + this._nextItemIndex };\n\t\t\t\tcollection.unshift(newItem);\n\t\t\t\tthis._nextItemIndex++;\n\t\t\t}\n\n\t\t\t//when the data has finished loading, tell the list to deactivate\n\t\t\t//its pull view:\n\t\t\tthis._list.isTopPullViewActive = false;\n\n\t\t\t//and stop the pull view animation\n\t\t\tStarling.juggler.remove(this._pullView);\n\t\t}\n\n\t\tprivate function pullView_pullingHandler(event:Event, ratio:Number):void\n\t\t{\n\t\t\tvar totalFrames:int = this._pullView.numFrames;\n\n\t\t\t//to provide some extra feedback to the user while they're pulling,\n\t\t\t//change the currentFrame of the MovieClip based on how far they've\n\t\t\t//pulled\n\t\t\tvar frameIndex:int = Math.round(ratio * totalFrames);\n\n\t\t\t//the ratio could be greater than 1, which could result in a frame\n\t\t\t//index greater than the number of frames in the MovieClip\n\t\t\twhile(frameIndex >= totalFrames)\n\t\t\t{\n\t\t\t\tframeIndex -= totalFrames;\n\t\t\t}\n\t\t\tthis._pullView.currentFrame = frameIndex;\n\t\t}\n\n\t\tprivate function list_updateHandler(event:Event):void\n\t\t{\n\t\t\t//load the new data when the List dispatches Event.UPDATE\n\t\t\tthis.loadData();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/StackScreenNavigatorExplorer/README.md",
    "content": "# Feathers StackScreenNavigator Explorer\n\nDemonstrates how to navigate between screens using the [Feathers](http://feathersui.com/) `StackScreenNavigator` component, presented as a mobile app.\n\n## Requirements\n\nIn addition to Starling Framework and Feathers, this example project requires the `MetalWorksMobileTheme` example theme. You can find the SWC file for this theme at the following location in the Feathers release build:\n\n\tthemes/MetalWorksMobileTheme/swc/MetalWorksMobileTheme.swc\n\n## Web Demo\n\nView the [StackScreenNavigator Explorer](http://feathersui.com/examples/stack-screen-navigator-explorer/) in your browser."
  },
  {
    "path": "examples/StackScreenNavigatorExplorer/build.properties",
    "content": "feathers.root = ${basedir}/../../source\nstarling.root = ${basedir}/../../third-party/starling\ntheme.root = ${basedir}/../../themes/MetalWorksMobileTheme/source\noutput.path = ${basedir}/output\nicon.path = ${basedir}/../shared-assets/icons\nlaunch.image.path = ${basedir}/../shared-assets/launch-images-windowed\n\nswf.version = 30"
  },
  {
    "path": "examples/StackScreenNavigatorExplorer/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<project name=\"stack-screen-navigator-explorer\" default=\"build\" basedir=\".\">\n\t\n\t<!-- build.local.properties and sdk.local.proprties are optional files that\n\t\tcan be used to override the default properties. -->\n\t<property file=\"./build.local.properties\"/>\n\t<property file=\"./sdk.local.properties\"/>\n\t<property file=\"./build.properties\"/>\n\t<!-- inherit SDK properties from the root of the repository -->\n\t<property file=\"../../sdk.local.properties\"/>\n\t<property file=\"../../sdk.properties\"/>\n\n\t<target name=\"build\" depends=\"build-web,build-android,build-ios\"/>\n\n\t<target name=\"prepare\">\n\t\t<delete dir=\"${output.path}\"/>\n\t</target>\n\n\t<target name=\"build-web\" depends=\"prepare\">\n\t\t<echo message=\"Building StackScreenNavigatorExplorerWeb.swf\"/>\n\t\t<java jar=\"${mxmlc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${flashplayer.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-advanced-telemetry=true\"/>\n\t\t\t<arg value=\"-frame=two,feathers.examples.navigator.Main\"/>\n\t\t\t<arg value=\"-source-path+=source\"/>\n\t\t\t<arg value=\"-source-path+=${starling.root}\"/>\n\t\t\t<arg value=\"-source-path+=${feathers.root}\"/>\n\t\t\t<arg value=\"-source-path+=${theme.root}\"/>\n\t\t\t<arg value=\"source/StackScreenNavigatorExplorerWeb.as\"/>\n\t\t\t<arg value=\"-output=${output.path}/StackScreenNavigatorExplorerWeb.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"build-air-swf\" depends=\"prepare\">\n\t\t<echo message=\"Building StackScreenNavigatorExplorer.swf\"/>\n\t\t<java jar=\"${mxmlc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${airmobile.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<!-- uncomment for profiling with scout -->\n\t\t\t<!--<arg value=\"-advanced-telemetry=true\"/>-->\n\t\t\t<arg value=\"-source-path+=source\"/>\n\t\t\t<arg value=\"-source-path+=${starling.root}\"/>\n\t\t\t<arg value=\"-source-path+=${feathers.root}\"/>\n\t\t\t<arg value=\"-source-path+=${theme.root}\"/>\n\t\t\t<arg value=\"source/StackScreenNavigatorExplorer.as\"/>\n\t\t\t<arg value=\"-output=${output.path}/StackScreenNavigatorExplorer.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"-check-ios-properties\">\n\t\t<fail unless=\"ios.provision.path\"/>\n\t\t<fail unless=\"ios.certificate.path\"/>\n\t\t<fail unless=\"ios.certificate.password\"/>\n\t</target>\n\t<target name=\"build-ios\" depends=\"-check-ios-properties,build-air-swf\">\n\t\t<echo message=\"Packaging StackScreenNavigatorExplorer.ipa\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"-target\"/>\n\t\t\t<arg value=\"ipa-app-store\"/>\n\t\t\t<!-- uncomment for actionscript sampling with scout on ios -->\n\t\t\t<!--<arg value=\"-sampler\"/>-->\n\t\t\t<arg value=\"-provisioning-profile\"/>\n\t\t\t<arg value=\"${ios.provision.path}\"/>\n\t\t\t<arg value=\"-keystore\"/>\n\t\t\t<arg value=\"${ios.certificate.path}\"/>\n\t\t\t<arg value=\"-storetype\"/>\n\t\t\t<arg value=\"pkcs12\"/>\n\t\t\t<arg value=\"-storepass\"/>\n\t\t\t<arg value=\"${ios.certificate.password}\"/>\n\t\t\t<arg value=\"${output.path}/StackScreenNavigatorExplorer.ipa\"/>\n\t\t\t<arg value=\"source/StackScreenNavigatorExplorer-app.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${icon.path}\"/>\n\t\t\t<arg line=\"icon29.png icon48.png icon50.png icon57.png icon58.png icon72.png icon87.png icon96.png icon100.png icon114.png icon128.png icon144.png icon180.png\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${launch.image.path}\"/>\n\t\t\t<arg value=\"Default~iphone.png\"/>\t\t\t\t\t\t\t<!-- iphone 3gs -->\n\t\t\t<arg value=\"Default@2x~iphone.png\"/>\t\t\t\t\t\t<!-- iphone 4/4s -->\n\t\t\t<arg value=\"Default-568h@2x~iphone.png\"/>\t\t\t\t\t<!-- iphone 5/5c/5s -->\n\t\t\t<arg value=\"Default-375w-667h@2x~iphone.png\"/>\t\t\t\t<!-- iphone 6/7/8 -->\n\t\t\t<arg value=\"Default-812h@3x~iphone.png\"/>\t\t\t\t\t<!-- iphone x (portrait) -->\n\t\t\t<arg value=\"Default-Landscape-812h@3x~iphone.png\"/>\t\t\t<!-- iphone x (landscape) -->\n\t\t\t<arg value=\"Default-414w-736h@3x~iphone.png\"/>\t\t\t\t<!-- iphone 6/7/8 plus (portrait) -->\n\t\t\t<arg value=\"Default-Landscape-414w-736h@3x~iphone.png\"/>\t<!-- iphone 6/7/8 plus (landscape) -->\n\t\t\t<arg value=\"Default-Portrait~ipad.png\"/>\t\t\t\t\t<!-- ipad 1/2 (portrait) -->\n\t\t\t<arg value=\"Default-PortraitUpsideDown~ipad.png\"/>\t\t\t<!-- ipad 1/2 (portrait upside down) -->\n\t\t\t<arg value=\"Default-Landscape~ipad.png\"/>\t\t\t\t\t<!-- ipad 1/2 (landscape left) -->\n\t\t\t<arg value=\"Default-LandscapeRight~ipad.png\"/>\t\t\t\t<!-- ipad 1/2 (landscape right) -->\n\t\t\t<arg value=\"Default-Portrait@2x~ipad.png\"/>\t\t\t\t\t<!-- ipad 3/air (portrait) -->\n\t\t\t<arg value=\"Default-LandscapeLeft@2x~ipad.png\"/>\t\t\t<!-- ipad 3/air (landscape left) -->\n\t\t\t<arg value=\"Default-LandscapeRight@2x~ipad.png\"/>\t\t\t<!-- ipad 3/air (landscape right) -->\n\t\t\t<arg value=\"Default-Portrait@2x.png\"/>\t\t\t\t\t\t<!-- ipad pro (portrait) -->\n\t\t\t<arg value=\"Default-Landscape@2x.png\"/>\t\t\t\t\t\t<!-- ipad pro (landscape) -->\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${output.path}\"/>\n\t\t\t<arg value=\"StackScreenNavigatorExplorer.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"-check-android-properties\">\n\t\t<fail unless=\"android.certificate.path\"/>\n\t\t<fail unless=\"android.certificate.password\"/>\n\t</target>\n\t<target name=\"build-android\" depends=\"-check-android-properties,build-air-swf\">\n\t\t<echo message=\"Packaging StackScreenNavigatorExplorer.apk\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"-target\"/>\n\t\t\t<arg value=\"apk-captive-runtime\"/>\n\t\t\t<arg value=\"-storetype\"/>\n\t\t\t<arg value=\"pkcs12\"/>\n\t\t\t<arg value=\"-keystore\"/>\n\t\t\t<arg value=\"${android.certificate.path}\"/>\n\t\t\t<arg value=\"-storepass\"/>\n\t\t\t<arg value=\"${android.certificate.password}\"/>\n\t\t\t<arg value=\"${output.path}/StackScreenNavigatorExplorer.apk\"/>\n\t\t\t<arg value=\"source/StackScreenNavigatorExplorer-app.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${icon.path}\"/>\n\t\t\t<arg line=\"icon29.png icon48.png icon50.png icon57.png icon58.png icon72.png icon87.png icon96.png icon100.png icon114.png icon128.png icon144.png icon180.png\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${output.path}\"/>\n\t\t\t<arg value=\"StackScreenNavigatorExplorer.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"install-android\">\n\t\t<echo message=\"Installing StackScreenNavigatorExplorer.apk\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"false\">\n\t\t\t<arg value=\"-uninstallApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"android\"/>\n\t\t\t<arg value=\"-appid\"/>\n\t\t\t<arg value=\"com.feathersui.examples.StackScreenNavigatorExplorer\"/>\n\t\t</java>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-installApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"android\"/>\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"${output.path}/StackScreenNavigatorExplorer.apk\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"install-ios\">\n\t\t<echo message=\"Installing StackScreenNavigatorExplorer.ipa\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"false\">\n\t\t\t<arg value=\"-uninstallApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"iOS\"/>\n\t\t\t<arg value=\"-appid\"/>\n\t\t\t<arg value=\"com.feathersui.examples.StackScreenNavigatorExplorer\"/>\n\t\t</java>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-installApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"iOS\"/>\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"${output.path}/StackScreenNavigatorExplorer.ipa\"/>\n\t\t</java>\n\t</target>\n</project>"
  },
  {
    "path": "examples/StackScreenNavigatorExplorer/source/StackScreenNavigatorExplorer-app.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<application xmlns=\"http://ns.adobe.com/air/application/32.0\">\n\t<id>com.feathersui.examples.StackScreenNavigatorExplorer</id>\n\t<filename>StackScreenNavigator</filename>\n\t<name>StackScreenNavigator</name>\n\t<versionNumber>4.2.0</versionNumber>\n\t<description>StackScreenNavigator Explorer example application built with Feathers UI controls for Starling</description>\n\t<copyright>2021 Bowler Hat LLC</copyright>\n\n\t<initialWindow>\n\t\t<content>StackScreenNavigatorExplorer.swf</content>\n\t\t<autoOrients>true</autoOrients>\n\t\t<fullScreen>false</fullScreen>\n\t\t<visible>true</visible>\n\t\t<renderMode>direct</renderMode>\n\t</initialWindow>\n\n\t<supportedLanguages>en</supportedLanguages>\n\n\t<icon>\n\t\t<image29x29>icon29.png</image29x29>\n\t\t<image48x48>icon48.png</image48x48>\n\t\t<image50x50>icon50.png</image50x50>\n\t\t<image57x57>icon57.png</image57x57>\n\t\t<image58x58>icon58.png</image58x58>\n\t\t<image72x72>icon72.png</image72x72>\n\t\t<image87x87>icon87.png</image87x87>\n\t\t<image96x96>icon96.png</image96x96>\n\t\t<image100x100>icon100.png</image100x100>\n\t\t<image114x114>icon114.png</image114x114>\n\t\t<image128x128>icon128.png</image128x128>\n\t\t<image144x144>icon144.png</image144x144>\n\t\t<image180x180>icon180.png</image180x180>\n\t</icon>\n\t<android>\n\t\t<colorDepth>16bit</colorDepth>\n\t\t<manifestAdditions><![CDATA[\n\t\t\t<manifest android:installLocation=\"auto\">\n\t\t\t    <uses-permission android:name=\"android.permission.INTERNET\"/>\n\t\t\t</manifest>\n\t\t]]></manifestAdditions>\n\t</android>\n\t<iPhone>\n\t\t<InfoAdditions>\n\t\t<![CDATA[\n\t\t\t<key>UIDeviceFamily</key> \n\t\t\t<array> \n\t\t\t\t<string>1</string>\n\t\t\t\t<string>2</string>\n\t\t\t</array>\n\t\t\t<key>UIPrerenderedIcon</key>\n\t\t\t<true/>\n\t\t\t<key>UIStatusBarStyle</key>\n\t\t\t<string>UIStatusBarStyleLightContent</string>\n\t\t]]> \n\t\t</InfoAdditions>\n\t\t<requestedDisplayResolution>high</requestedDisplayResolution>\n\t</iPhone>\n</application>"
  },
  {
    "path": "examples/StackScreenNavigatorExplorer/source/StackScreenNavigatorExplorer.as",
    "content": "package\n{\n\timport feathers.examples.navigator.Main;\n\timport feathers.utils.ScreenDensityScaleFactorManager;\n\n\timport flash.display.Loader;\n\timport flash.display.Sprite;\n\timport flash.display.StageAlign;\n\timport flash.display.StageOrientation;\n\timport flash.display.StageScaleMode;\n\timport flash.display3D.Context3DProfile;\n\timport flash.display3D.Context3DRenderMode;\n\timport flash.events.Event;\n\timport flash.filesystem.File;\n\timport flash.filesystem.FileMode;\n\timport flash.filesystem.FileStream;\n\timport flash.system.Capabilities;\n\timport flash.utils.ByteArray;\n\n\timport starling.core.Starling;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#4a4137\")]\n\tpublic class StackScreenNavigatorExplorer extends Sprite\n\t{\n\t\tpublic function StackScreenNavigatorExplorer()\n\t\t{\n\t\t\tif(this.stage)\n\t\t\t{\n\t\t\t\tthis.stage.scaleMode = StageScaleMode.NO_SCALE;\n\t\t\t\tthis.stage.align = StageAlign.TOP_LEFT;\n\t\t\t}\n\t\t\tthis.mouseEnabled = this.mouseChildren = false;\n\t\t\tthis.showLaunchImage();\n\t\t\tthis.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);\n\t\t}\n\n\t\tprivate var _starling:Starling;\n\t\tprivate var _scaler:ScreenDensityScaleFactorManager;\n\t\tprivate var _launchImage:Loader;\n\t\tprivate var _savedAutoOrients:Boolean;\n\n\t\t/**\n\t\t * On iOS, add the native launch image to the classic display list to\n\t\t * avoid displaying only the stage background color between when the\n\t\t * AIR app finishes launching and Starling starts rendering.\n\t\t * \n\t\t * Launch image names: https://forums.adobe.com/message/9986239#9986239\n\t\t */\n\t\tprivate function showLaunchImage():void\n\t\t{\n\t\t\tvar filePath:String = null;\n\t\t\tvar isPortraitOnly:Boolean = false;\n\t\t\tif(Capabilities.manufacturer.indexOf(\"iOS\") >= 0)\n\t\t\t{\n\t\t\t\tvar isPortraitUpsideDown:Boolean = this.stage.orientation == StageOrientation.UPSIDE_DOWN;\n\t\t\t\tvar isPortrait:Boolean = this.stage.orientation == StageOrientation.DEFAULT || isPortraitUpsideDown;\n\t\t\t\tvar isLandscapeRight:Boolean = this.stage.orientation == StageOrientation.ROTATED_RIGHT;\n\t\t\t\tif(Capabilities.screenResolutionX == 1242 && Capabilities.screenResolutionY == 2208)\n\t\t\t\t{\n\t\t\t\t\t//iphone 6/7/8 plus\n\t\t\t\t\tfilePath = isPortrait ? \"Default-414w-736h@3x~iphone.png\" : \"Default-Landscape-414w-736h@3x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 1125 && Capabilities.screenResolutionY == 2436)\n\t\t\t\t{\n\t\t\t\t\t//iphone x\n\t\t\t\t\tfilePath = isPortrait ? \"Default-812h@3x~iphone.png\" : \"Default-Landscape-812h@3x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 2048 && Capabilities.screenResolutionY == 2732)\n\t\t\t\t{\n\t\t\t\t\t//ipad pro\n\t\t\t\t\tfilePath = isPortrait ? \"Default-Portrait@2x.png\" : \"Default-Landscape@2x.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 1536 && Capabilities.screenResolutionY == 2048)\n\t\t\t\t{\n\t\t\t\t\t//ipad 3/air\n\t\t\t\t\tif(isPortraitUpsideDown)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Portrait@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isPortrait)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-PortraitUpsideDown@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isLandscapeRight)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeRight@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeLeft@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 768 && Capabilities.screenResolutionY == 1024)\n\t\t\t\t{\n\t\t\t\t\t//ipad 1/2\n\t\t\t\t\tif(isPortraitUpsideDown)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Portrait~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isPortrait)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-PortraitUpsideDown~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isLandscapeRight)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeRight~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Landscape~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 750)\n\t\t\t\t{\n\t\t\t\t\t//iphone 6/7/8\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tfilePath = \"Default-375w-667h@2x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 640)\n\t\t\t\t{\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tif(Capabilities.screenResolutionY == 1136)\n\t\t\t\t\t{\n\t\t\t\t\t\t//iphone 5/5c/5s\n\t\t\t\t\t\tfilePath = \"Default-568h@2x~iphone.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//iphone 4/4s\n\t\t\t\t\t\tfilePath = \"Default@2x~iphone.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 320)\n\t\t\t\t{\n\t\t\t\t\t//iphone 3gs\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tfilePath = \"Default~iphone.png\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(filePath)\n\t\t\t{\n\t\t\t\tvar file:File = File.applicationDirectory.resolvePath(filePath);\n\t\t\t\tif(file.exists)\n\t\t\t\t{\n\t\t\t\t\tvar bytes:ByteArray = new ByteArray();\n\t\t\t\t\tvar stream:FileStream = new FileStream();\n\t\t\t\t\tstream.open(file, FileMode.READ);\n\t\t\t\t\tstream.readBytes(bytes, 0, stream.bytesAvailable);\n\t\t\t\t\tstream.close();\n\t\t\t\t\tthis._launchImage = new Loader();\n\t\t\t\t\tthis._launchImage.loadBytes(bytes);\n\t\t\t\t\tthis.addChild(this._launchImage);\n\t\t\t\t\tthis._savedAutoOrients = this.stage.autoOrients;\n\t\t\t\t\tthis.stage.autoOrients = false;\n\t\t\t\t\tif(isPortraitOnly)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.stage.setOrientation(StageOrientation.DEFAULT);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function loaderInfo_completeHandler(event:Event):void\n\t\t{\n\t\t\tStarling.multitouchEnabled = true;\n\t\t\tthis._starling = new Starling(Main, this.stage, null, null, Context3DRenderMode.AUTO, Context3DProfile.BASELINE);\n\t\t\tthis._starling.supportHighResolutions = true;\n\t\t\tthis._starling.skipUnchangedFrames = true;\n\t\t\tthis._starling.start();\n\t\t\tif(this._launchImage)\n\t\t\t{\n\t\t\t\tthis._starling.addEventListener(\"rootCreated\", starling_rootCreatedHandler);\n\t\t\t}\n\t\t\tthis._scaler = new ScreenDensityScaleFactorManager(this._starling);\n\t\t\tthis.stage.addEventListener(Event.DEACTIVATE, stage_deactivateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function starling_rootCreatedHandler(event:Object):void\n\t\t{\n\t\t\tif(this._launchImage)\n\t\t\t{\n\t\t\t\tthis.removeChild(this._launchImage);\n\t\t\t\tthis._launchImage.unloadAndStop(true);\n\t\t\t\tthis._launchImage = null;\n\t\t\t\tthis.stage.autoOrients = this._savedAutoOrients;\n\t\t\t}\n\t\t}\n\n\t\tprivate function stage_deactivateHandler(event:Event):void\n\t\t{\n\t\t\tthis._starling.stop(true);\n\t\t\tthis.stage.addEventListener(Event.ACTIVATE, stage_activateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function stage_activateHandler(event:Event):void\n\t\t{\n\t\t\tthis.stage.removeEventListener(Event.ACTIVATE, stage_activateHandler);\n\t\t\tthis._starling.start();\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "examples/StackScreenNavigatorExplorer/source/StackScreenNavigatorExplorerWeb.as",
    "content": "package\n{\n\timport feathers.system.DeviceCapabilities;\n\n\timport flash.display.MovieClip;\n\timport flash.display.StageAlign;\n\timport flash.display.StageScaleMode;\n\timport flash.events.Event;\n\timport flash.geom.Rectangle;\n\timport flash.ui.ContextMenu;\n\timport flash.utils.getDefinitionByName;\n\n\timport starling.core.Starling;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#4a4137\")]\n\tpublic class StackScreenNavigatorExplorerWeb extends MovieClip\n\t{\n\t\tpublic function StackScreenNavigatorExplorerWeb()\n\t\t{\n\t\t\tvar menu:ContextMenu = new ContextMenu();\n\t\t\tmenu.hideBuiltInItems();\n\t\t\tthis.contextMenu = menu;\n\t\t\t\n\t\t\tif(this.stage)\n\t\t\t{\n\t\t\t\tthis.stage.align = StageAlign.TOP_LEFT;\n\t\t\t\tthis.stage.scaleMode = StageScaleMode.NO_SCALE;\n\t\t\t}\n\t\t\t\n\t\t\tthis.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);\n\t\t}\n\t\t\n\t\tprivate var _starling:Starling;\n\t\t\n\t\tprivate function start():void\n\t\t{\n\t\t\tthis.gotoAndStop(2);\n\t\t\tthis.graphics.clear();\n\t\t\t\n\t\t\t//simulating iPhone Retina\n\t\t\tDeviceCapabilities.dpi = 326;\n\t\t\t\n\t\t\tStarling.multitouchEnabled = true;\n\t\t\tvar MainType:Class = getDefinitionByName(\"feathers.examples.navigator.Main\") as Class;\n\t\t\tthis._starling = new Starling(MainType, this.stage, new Rectangle(0, 0, 960, 640));\n\t\t\tthis._starling.supportHighResolutions = true;\n\t\t\tthis._starling.skipUnchangedFrames = true;\n\t\t\tthis._starling.stage.stageWidth = 480;\n\t\t\tthis._starling.stage.stageHeight = 320;\n\t\t\tthis._starling.start();\n\t\t}\n\t\t\n\t\tprivate function loaderInfo_completeHandler(event:Event):void\n\t\t{\n\t\t\tthis.start();\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/StackScreenNavigatorExplorer/source/feathers/examples/navigator/Main.as",
    "content": "package feathers.examples.navigator\n{\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.StackScreenNavigator;\n\timport feathers.controls.StackScreenNavigatorItem;\n\timport feathers.examples.navigator.screens.ScreenA;\n\timport feathers.examples.navigator.screens.ScreenB1;\n\timport feathers.examples.navigator.screens.ScreenB2;\n\timport feathers.examples.navigator.screens.ScreenC;\n\timport feathers.motion.Fade;\n\timport feathers.motion.Slide;\n\timport feathers.themes.MetalWorksMobileTheme;\n\n\timport starling.events.Event;\n\n\tpublic class Main extends LayoutGroup\n\t{\n\t\tprivate static const SCREEN_A:String = \"a\";\n\t\tprivate static const SCREEN_B1:String = \"b1\";\n\t\tprivate static const SCREEN_B2:String = \"b2\";\n\t\tprivate static const SCREEN_C:String = \"c\";\n\n\t\tpublic function Main()\n\t\t{\n\t\t\tnew MetalWorksMobileTheme();\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _navigator:StackScreenNavigator;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tthis._navigator = new StackScreenNavigator();\n\t\t\tthis._navigator.pushTransition = Slide.createSlideLeftTransition();\n\t\t\tthis._navigator.popTransition = Slide.createSlideRightTransition();\n\n\t\t\tvar itemA:StackScreenNavigatorItem = new StackScreenNavigatorItem(ScreenA);\n\t\t\titemA.setScreenIDForPushEvent(Event.COMPLETE, SCREEN_B1);\n\t\t\tthis._navigator.addScreen(SCREEN_A, itemA);\n\n\t\t\tvar itemB1:StackScreenNavigatorItem = new StackScreenNavigatorItem(ScreenB1);\n\t\t\titemB1.setScreenIDForPushEvent(Event.COMPLETE, SCREEN_C);\n\t\t\titemB1.setScreenIDForReplaceEvent(Event.CHANGE, SCREEN_B2);\n\t\t\titemB1.addPopEvent(Event.CANCEL);\n\t\t\tthis._navigator.addScreen(SCREEN_B1, itemB1);\n\n\t\t\tvar itemB2:StackScreenNavigatorItem = new StackScreenNavigatorItem(ScreenB2);\n\t\t\titemB2.pushTransition = Fade.createFadeInTransition();\n\t\t\titemB2.addPopEvent(Event.CANCEL);\n\t\t\tthis._navigator.addScreen(SCREEN_B2, itemB2);\n\n\t\t\tvar itemC:StackScreenNavigatorItem = new StackScreenNavigatorItem(ScreenC);\n\t\t\titemC.addPopToRootEvent(Event.CLOSE);\n\t\t\titemC.addPopEvent(Event.CANCEL);\n\t\t\tthis._navigator.addScreen(SCREEN_C, itemC);\n\n\t\t\tthis._navigator.rootScreenID = SCREEN_A;\n\t\t\tthis.addChild(this._navigator);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/StackScreenNavigatorExplorer/source/feathers/examples/navigator/screens/ScreenA.as",
    "content": "package feathers.examples.navigator.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.PanelScreen;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.layout.VerticalLayoutData;\n\n\timport starling.events.Event;\n\n\t/**\n\t * Pushes another screen onto the stack. An event is mapped to the push\n\t * action by calling setScreenIDForPushEvent() on the\n\t * StackScreenNavigatorItem.\n\t *\n\t * item.setScreenIDForPushEvent(Event.COMPLETE, otherScreenID);\n\t */\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class ScreenA extends PanelScreen\n\t{\n\t\tpublic function ScreenA()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.title = \"Screen A\";\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tsuper.initialize();\n\n\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\tlayout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tlayout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\tlayout.gap = 10;\n\t\t\tthis.layout = layout;\n\n\t\t\tvar pushB1Button:Button = new Button();\n\t\t\tpushB1Button.label = \"Push Screen B1\";\n\t\t\tpushB1Button.layoutData = new VerticalLayoutData(50);\n\t\t\tpushB1Button.addEventListener(Event.TRIGGERED, pushB1Button_triggeredHandler);\n\t\t\tthis.addChild(pushB1Button);\n\t\t}\n\n\t\tprotected function pushB1Button_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/StackScreenNavigatorExplorer/source/feathers/examples/navigator/screens/ScreenB1.as",
    "content": "package feathers.examples.navigator.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.PanelScreen;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.layout.VerticalLayoutData;\n\n\timport starling.events.Event;\n\n\t/**\n\t * Pops this screen from the stack to return to the previous screen. An\n\t * event is mapped to the pop action by calling addPopEvent() on the\n\t * StackScreenNavigatorItem.\n\t *\n\t * item.addPopEvent(Event.CANCEL);\n\t */\n\t[Event(name=\"cancel\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Replaces this screen with another screen at the same position in the\n\t * stack. An event is mapped to the replace action by calling\n\t * setScreenIDForReplaceEvent() on the StackScreenNavigatorItem.\n\t *\n\t * item.setScreenIDForReplaceEvent(Event.CHANGE, otherScreenID);\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Pushes another screen onto the stack. An event is mapped to the push\n\t * action by calling setScreenIDForPushEvent() on the\n\t * StackScreenNavigatorItem.\n\t *\n\t * item.setScreenIDForPushEvent(Event.COMPLETE, otherScreenID);\n\t */\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class ScreenB1 extends PanelScreen\n\t{\n\t\tpublic function ScreenB1()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.title = \"Screen B1\";\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tsuper.initialize();\n\n\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\tlayout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tlayout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\tlayout.gap = 10;\n\t\t\tthis.layout = layout;\n\n\t\t\tvar popToAButton:Button = new Button();\n\t\t\tpopToAButton.label = \"Pop to Screen A\";\n\t\t\tpopToAButton.layoutData = new VerticalLayoutData(50);\n\t\t\tpopToAButton.addEventListener(Event.TRIGGERED, popToAButton_triggeredHandler);\n\t\t\tthis.addChild(popToAButton);\n\n\t\t\tvar pushCButton:Button = new Button();\n\t\t\tpushCButton.label = \"Push Screen C\";\n\t\t\tpushCButton.layoutData = new VerticalLayoutData(50);\n\t\t\tpushCButton.addEventListener(Event.TRIGGERED, pushCButton_triggeredHandler);\n\t\t\tthis.addChild(pushCButton);\n\n\t\t\tvar replaceWithB2Button:Button = new Button();\n\t\t\treplaceWithB2Button.label = \"Replace With Screen B2\";\n\t\t\treplaceWithB2Button.layoutData = new VerticalLayoutData(50);\n\t\t\treplaceWithB2Button.addEventListener(Event.TRIGGERED, replaceWithB2Button_triggeredHandler);\n\t\t\tthis.addChild(replaceWithB2Button);\n\t\t}\n\n\t\tprotected function popToAButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.CANCEL);\n\t\t}\n\n\t\tprotected function pushCButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprotected function replaceWithB2Button_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/StackScreenNavigatorExplorer/source/feathers/examples/navigator/screens/ScreenB2.as",
    "content": "package feathers.examples.navigator.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.PanelScreen;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.layout.VerticalLayoutData;\n\n\timport starling.events.Event;\n\n\t/**\n\t * Pops this screen from the stack to return to the previous screen. An\n\t * event is mapped to the pop action by calling addPopEvent() on the\n\t * StackScreenNavigatorItem.\n\t *\n\t * item.addPopEvent(Event.CANCEL);\n\t */\n\t[Event(name=\"cancel\",type=\"starling.events.Event\")]\n\n\tpublic class ScreenB2 extends PanelScreen\n\t{\n\t\tpublic function ScreenB2()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.title = \"Screen B2\";\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tsuper.initialize();\n\n\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\tlayout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tlayout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\tlayout.gap = 10;\n\t\t\tthis.layout = layout;\n\n\t\t\tvar popToAButton:Button = new Button();\n\t\t\tpopToAButton.label = \"Pop to Screen A\";\n\t\t\tpopToAButton.layoutData = new VerticalLayoutData(50);\n\t\t\tpopToAButton.addEventListener(Event.TRIGGERED, popToAButton_triggeredHandler);\n\t\t\tthis.addChild(popToAButton);\n\t\t}\n\n\t\tprotected function popToAButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.CANCEL);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/StackScreenNavigatorExplorer/source/feathers/examples/navigator/screens/ScreenC.as",
    "content": "package feathers.examples.navigator.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.PanelScreen;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.layout.VerticalLayoutData;\n\n\timport starling.events.Event;\n\n\t/**\n\t * Pops all screens from the stack to return to the root screen. An event\n\t * is mapped to the pop to root action by calling addPopToRootEvent() on the\n\t * StackScreenNavigatorItem.\n\t *\n\t * item.addPopToRootEvent(Event.CLOSE);\n\t */\n\t[Event(name=\"close\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Pops this screen from the stack to return to the previous screen. An\n\t * event is mapped to the pop action by calling addPopEvent() on the\n\t * StackScreenNavigatorItem.\n\t *\n\t * item.addPopEvent(Event.CANCEL);\n\t */\n\t[Event(name=\"cancel\",type=\"starling.events.Event\")]\n\n\tpublic class ScreenC extends PanelScreen\n\t{\n\t\tpublic function ScreenC()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.title = \"Screen C\";\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tsuper.initialize();\n\n\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\tlayout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tlayout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\tlayout.gap = 10;\n\t\t\tthis.layout = layout;\n\n\t\t\tvar popToB1Button:Button = new Button();\n\t\t\tpopToB1Button.label = \"Pop to Screen B\";\n\t\t\tpopToB1Button.layoutData = new VerticalLayoutData(50);\n\t\t\tpopToB1Button.addEventListener(Event.TRIGGERED, popToB1Button_triggeredHandler);\n\t\t\tthis.addChild(popToB1Button);\n\n\t\t\tvar popToRootButton:Button = new Button();\n\t\t\tpopToRootButton.label = \"Pop to Root\";\n\t\t\tpopToRootButton.layoutData = new VerticalLayoutData(50);\n\t\t\tpopToRootButton.addEventListener(Event.TRIGGERED, popToRootButton_triggeredHandler);\n\t\t\tthis.addChild(popToRootButton);\n\t\t}\n\n\t\tprotected function popToB1Button_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.CANCEL);\n\t\t}\n\n\t\tprotected function popToRootButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.CLOSE);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/Tabs/README.md",
    "content": "# Feathers Tabs\n\nDemonstrates how to navigate between tabs using the [Feathers](http://feathersui.com/) `TabNavigator` component, presented as a mobile app.\n\n## Requirements\n\nIn addition to Starling Framework and Feathers, this example project requires the `MetalWorksMobileTheme` example theme. You can find the SWC file for this theme at the following location in the Feathers release build:\n\n\tthemes/MetalWorksMobileTheme/swc/MetalWorksMobileTheme.swc\n\n## Web Demo\n\nView the [Tabs example](http://feathersui.com/examples/tabs/) in your browser.\n\n## Credits\n\nUser data randomly generated with [randomuser.me](https://randomuser.me/)."
  },
  {
    "path": "examples/Tabs/build.properties",
    "content": "feathers.root = ${basedir}/../../source\nstarling.root = ${basedir}/../../third-party/starling\ntheme.root = ${basedir}/../../themes/MetalWorksMobileTheme/source\noutput.path = ${basedir}/output\nicon.path = ${basedir}/../shared-assets/icons\nlaunch.image.path = ${basedir}/../shared-assets/launch-images-windowed\n\nswf.version = 30"
  },
  {
    "path": "examples/Tabs/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<project name=\"tabs\" default=\"build\" basedir=\".\">\n\t\n\t<!-- build.local.properties and sdk.local.proprties are optional files that\n\t\tcan be used to override the default properties. -->\n\t<property file=\"./build.local.properties\"/>\n\t<property file=\"./sdk.local.properties\"/>\n\t<property file=\"./build.properties\"/>\n\t<!-- inherit SDK properties from the root of the repository -->\n\t<property file=\"../../sdk.local.properties\"/>\n\t<property file=\"../../sdk.properties\"/>\n\n\t<target name=\"build\" depends=\"build-web,build-android,build-ios\"/>\n\n\t<target name=\"prepare\">\n\t\t<delete dir=\"${output.path}\"/>\n\t</target>\n\n\t<target name=\"build-web\" depends=\"prepare\">\n\t\t<echo message=\"Building TabsWeb.swf\"/>\n\t\t<java jar=\"${mxmlc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${flashplayer.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-advanced-telemetry=true\"/>\n\t\t\t<arg value=\"-frame=two,feathers.examples.tabs.Main\"/>\n\t\t\t<arg value=\"-source-path+=source\"/>\n\t\t\t<arg value=\"-source-path+=${starling.root}\"/>\n\t\t\t<arg value=\"-source-path+=${feathers.root}\"/>\n\t\t\t<arg value=\"-source-path+=${theme.root}\"/>\n\t\t\t<arg value=\"source/TabsWeb.as\"/>\n\t\t\t<arg value=\"-output=${output.path}/TabsWeb.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"build-air-swf\" depends=\"prepare\">\n\t\t<echo message=\"Building Tabs.swf\"/>\n\t\t<java jar=\"${mxmlc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${airmobile.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<!-- uncomment for profiling with scout -->\n\t\t\t<!--<arg value=\"-advanced-telemetry=true\"/>-->\n\t\t\t<arg value=\"-source-path+=source\"/>\n\t\t\t<arg value=\"-source-path+=${starling.root}\"/>\n\t\t\t<arg value=\"-source-path+=${feathers.root}\"/>\n\t\t\t<arg value=\"-source-path+=${theme.root}\"/>\n\t\t\t<arg value=\"source/Tabs.as\"/>\n\t\t\t<arg value=\"-output=${output.path}/Tabs.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"-check-ios-properties\">\n\t\t<fail unless=\"ios.provision.path\"/>\n\t\t<fail unless=\"ios.certificate.path\"/>\n\t\t<fail unless=\"ios.certificate.password\"/>\n\t</target>\n\t<target name=\"build-ios\" depends=\"-check-ios-properties,build-air-swf\">\n\t\t<echo message=\"Packaging Tabs.ipa\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"-target\"/>\n\t\t\t<arg value=\"ipa-app-store\"/>\n\t\t\t<!-- uncomment for actionscript sampling with scout on ios -->\n\t\t\t<!--<arg value=\"-sampler\"/>-->\n\t\t\t<arg value=\"-provisioning-profile\"/>\n\t\t\t<arg value=\"${ios.provision.path}\"/>\n\t\t\t<arg value=\"-keystore\"/>\n\t\t\t<arg value=\"${ios.certificate.path}\"/>\n\t\t\t<arg value=\"-storetype\"/>\n\t\t\t<arg value=\"pkcs12\"/>\n\t\t\t<arg value=\"-storepass\"/>\n\t\t\t<arg value=\"${ios.certificate.password}\"/>\n\t\t\t<arg value=\"${output.path}/Tabs.ipa\"/>\n\t\t\t<arg value=\"source/Tabs-app.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${icon.path}\"/>\n\t\t\t<arg line=\"icon29.png icon48.png icon50.png icon57.png icon58.png icon72.png icon87.png icon96.png icon100.png icon114.png icon128.png icon144.png icon180.png\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${launch.image.path}\"/>\n\t\t\t<arg value=\"Default~iphone.png\"/>\t\t\t\t\t\t\t<!-- iphone 3gs -->\n\t\t\t<arg value=\"Default@2x~iphone.png\"/>\t\t\t\t\t\t<!-- iphone 4/4s -->\n\t\t\t<arg value=\"Default-568h@2x~iphone.png\"/>\t\t\t\t\t<!-- iphone 5/5c/5s -->\n\t\t\t<arg value=\"Default-375w-667h@2x~iphone.png\"/>\t\t\t\t<!-- iphone 6/7/8 -->\n\t\t\t<arg value=\"Default-812h@3x~iphone.png\"/>\t\t\t\t\t<!-- iphone x (portrait) -->\n\t\t\t<arg value=\"Default-Landscape-812h@3x~iphone.png\"/>\t\t\t<!-- iphone x (landscape) -->\n\t\t\t<arg value=\"Default-414w-736h@3x~iphone.png\"/>\t\t\t\t<!-- iphone 6/7/8 plus (portrait) -->\n\t\t\t<arg value=\"Default-Landscape-414w-736h@3x~iphone.png\"/>\t<!-- iphone 6/7/8 plus (landscape) -->\n\t\t\t<arg value=\"Default-Portrait~ipad.png\"/>\t\t\t\t\t<!-- ipad 1/2 (portrait) -->\n\t\t\t<arg value=\"Default-PortraitUpsideDown~ipad.png\"/>\t\t\t<!-- ipad 1/2 (portrait upside down) -->\n\t\t\t<arg value=\"Default-Landscape~ipad.png\"/>\t\t\t\t\t<!-- ipad 1/2 (landscape left) -->\n\t\t\t<arg value=\"Default-LandscapeRight~ipad.png\"/>\t\t\t\t<!-- ipad 1/2 (landscape right) -->\n\t\t\t<arg value=\"Default-Portrait@2x~ipad.png\"/>\t\t\t\t\t<!-- ipad 3/air (portrait) -->\n\t\t\t<arg value=\"Default-LandscapeLeft@2x~ipad.png\"/>\t\t\t<!-- ipad 3/air (landscape left) -->\n\t\t\t<arg value=\"Default-LandscapeRight@2x~ipad.png\"/>\t\t\t<!-- ipad 3/air (landscape right) -->\n\t\t\t<arg value=\"Default-Portrait@2x.png\"/>\t\t\t\t\t\t<!-- ipad pro (portrait) -->\n\t\t\t<arg value=\"Default-Landscape@2x.png\"/>\t\t\t\t\t\t<!-- ipad pro (landscape) -->\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${output.path}\"/>\n\t\t\t<arg value=\"Tabs.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"-check-android-properties\">\n\t\t<fail unless=\"android.certificate.path\"/>\n\t\t<fail unless=\"android.certificate.password\"/>\n\t</target>\n\t<target name=\"build-android\" depends=\"-check-android-properties,build-air-swf\">\n\t\t<echo message=\"Packaging Tabs.apk\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"-target\"/>\n\t\t\t<arg value=\"apk-captive-runtime\"/>\n\t\t\t<arg value=\"-storetype\"/>\n\t\t\t<arg value=\"pkcs12\"/>\n\t\t\t<arg value=\"-keystore\"/>\n\t\t\t<arg value=\"${android.certificate.path}\"/>\n\t\t\t<arg value=\"-storepass\"/>\n\t\t\t<arg value=\"${android.certificate.password}\"/>\n\t\t\t<arg value=\"${output.path}/Tabs.apk\"/>\n\t\t\t<arg value=\"source/Tabs-app.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${icon.path}\"/>\n\t\t\t<arg line=\"icon29.png icon48.png icon50.png icon57.png icon58.png icon72.png icon87.png icon96.png icon100.png icon114.png icon128.png icon144.png icon180.png\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${output.path}\"/>\n\t\t\t<arg value=\"Tabs.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"install-android\">\n\t\t<echo message=\"Installing Tabs.apk\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"false\">\n\t\t\t<arg value=\"-uninstallApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"android\"/>\n\t\t\t<arg value=\"-appid\"/>\n\t\t\t<arg value=\"com.feathersui.examples.Tabs\"/>\n\t\t</java>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-installApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"android\"/>\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"${output.path}/Tabs.apk\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"install-ios\">\n\t\t<echo message=\"Installing Tabs.ipa\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"false\">\n\t\t\t<arg value=\"-uninstallApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"iOS\"/>\n\t\t\t<arg value=\"-appid\"/>\n\t\t\t<arg value=\"com.feathersui.examples.Tabs\"/>\n\t\t</java>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-installApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"iOS\"/>\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"${output.path}/Tabs.ipa\"/>\n\t\t</java>\n\t</target>\n</project>"
  },
  {
    "path": "examples/Tabs/source/Tabs-app.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<application xmlns=\"http://ns.adobe.com/air/application/32.0\">\n\t<id>com.feathersui.examples.Tabs</id>\n\t<filename>Tabs</filename>\n\t<name>Tabs</name>\n\t<versionNumber>4.2.0</versionNumber>\n\t<description>Tabs example application built with Feathers UI controls for Starling</description>\n\t<copyright>2021 Bowler Hat LLC</copyright>\n\n\t<initialWindow>\n\t\t<content>Tabs.swf</content>\n\t\t<autoOrients>true</autoOrients>\n\t\t<fullScreen>false</fullScreen>\n\t\t<visible>true</visible>\n\t\t<renderMode>direct</renderMode>\n\t\t<depthAndStencil>true</depthAndStencil>\n\t</initialWindow>\n\n\t<supportedLanguages>en</supportedLanguages>\n\n\t<icon>\n\t\t<image29x29>icon29.png</image29x29>\n\t\t<image48x48>icon48.png</image48x48>\n\t\t<image50x50>icon50.png</image50x50>\n\t\t<image57x57>icon57.png</image57x57>\n\t\t<image58x58>icon58.png</image58x58>\n\t\t<image72x72>icon72.png</image72x72>\n\t\t<image87x87>icon87.png</image87x87>\n\t\t<image96x96>icon96.png</image96x96>\n\t\t<image100x100>icon100.png</image100x100>\n\t\t<image114x114>icon114.png</image114x114>\n\t\t<image128x128>icon128.png</image128x128>\n\t\t<image144x144>icon144.png</image144x144>\n\t\t<image180x180>icon180.png</image180x180>\n\t</icon>\n\t<android>\n\t\t<colorDepth>16bit</colorDepth>\n\t\t<manifestAdditions><![CDATA[\n\t\t\t<manifest android:installLocation=\"auto\">\n\t\t\t    <uses-permission android:name=\"android.permission.INTERNET\"/>\n\t\t\t</manifest>\n\t\t]]></manifestAdditions>\n\t</android>\n\t<iPhone>\n\t\t<InfoAdditions>\n\t\t<![CDATA[\n\t\t\t<key>UIDeviceFamily</key> \n\t\t\t<array> \n\t\t\t\t<string>1</string>\n\t\t\t\t<string>2</string>\n\t\t\t</array>\n\t\t\t<key>UIPrerenderedIcon</key>\n\t\t\t<true/>\n\t\t\t<key>UIStatusBarStyle</key>\n\t\t\t<string>UIStatusBarStyleLightContent</string>\n\t\t\t<key>NSAppTransportSecurity</key>\n\t\t\t<dict>\n\t\t\t\t<key>NSExceptionDomains</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>feathersui.com</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>\n\t\t\t\t\t\t<true/>\n\t\t\t\t\t</dict>\n\t\t\t\t</dict>\n\t\t\t</dict>\n\t\t]]> \n\t\t</InfoAdditions>\n\t\t<requestedDisplayResolution>high</requestedDisplayResolution>\n\t</iPhone>\n</application>"
  },
  {
    "path": "examples/Tabs/source/Tabs.as",
    "content": "package\n{\n\timport feathers.examples.tabs.Main;\n\timport feathers.utils.ScreenDensityScaleFactorManager;\n\n\timport flash.display.Loader;\n\timport flash.display.Sprite;\n\timport flash.display.StageAlign;\n\timport flash.display.StageOrientation;\n\timport flash.display.StageScaleMode;\n\timport flash.display3D.Context3DProfile;\n\timport flash.display3D.Context3DRenderMode;\n\timport flash.events.Event;\n\timport flash.filesystem.File;\n\timport flash.filesystem.FileMode;\n\timport flash.filesystem.FileStream;\n\timport flash.system.Capabilities;\n\timport flash.utils.ByteArray;\n\n\timport starling.core.Starling;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#4a4137\")]\n\tpublic class Tabs extends Sprite\n\t{\n\t\tpublic function Tabs()\n\t\t{\n\t\t\tif(this.stage)\n\t\t\t{\n\t\t\t\tthis.stage.scaleMode = StageScaleMode.NO_SCALE;\n\t\t\t\tthis.stage.align = StageAlign.TOP_LEFT;\n\t\t\t}\n\t\t\tthis.mouseEnabled = this.mouseChildren = false;\n\t\t\tthis.showLaunchImage();\n\t\t\tthis.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);\n\t\t}\n\n\t\tprivate var _starling:Starling;\n\t\tprivate var _scaler:ScreenDensityScaleFactorManager;\n\t\tprivate var _launchImage:Loader;\n\t\tprivate var _savedAutoOrients:Boolean;\n\n\t\t/**\n\t\t * On iOS, add the native launch image to the classic display list to\n\t\t * avoid displaying only the stage background color between when the\n\t\t * AIR app finishes launching and Starling starts rendering.\n\t\t * \n\t\t * Launch image names: https://forums.adobe.com/message/9986239#9986239\n\t\t */\n\t\tprivate function showLaunchImage():void\n\t\t{\n\t\t\tvar filePath:String = null;\n\t\t\tvar isPortraitOnly:Boolean = false;\n\t\t\tif(Capabilities.manufacturer.indexOf(\"iOS\") >= 0)\n\t\t\t{\n\t\t\t\tvar isPortraitUpsideDown:Boolean = this.stage.orientation == StageOrientation.UPSIDE_DOWN;\n\t\t\t\tvar isPortrait:Boolean = this.stage.orientation == StageOrientation.DEFAULT || isPortraitUpsideDown;\n\t\t\t\tvar isLandscapeRight:Boolean = this.stage.orientation == StageOrientation.ROTATED_RIGHT;\n\t\t\t\tif(Capabilities.screenResolutionX == 1242 && Capabilities.screenResolutionY == 2208)\n\t\t\t\t{\n\t\t\t\t\t//iphone 6/7/8 plus\n\t\t\t\t\tfilePath = isPortrait ? \"Default-414w-736h@3x~iphone.png\" : \"Default-Landscape-414w-736h@3x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 1125 && Capabilities.screenResolutionY == 2436)\n\t\t\t\t{\n\t\t\t\t\t//iphone x\n\t\t\t\t\tfilePath = isPortrait ? \"Default-812h@3x~iphone.png\" : \"Default-Landscape-812h@3x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 2048 && Capabilities.screenResolutionY == 2732)\n\t\t\t\t{\n\t\t\t\t\t//ipad pro\n\t\t\t\t\tfilePath = isPortrait ? \"Default-Portrait@2x.png\" : \"Default-Landscape@2x.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 1536 && Capabilities.screenResolutionY == 2048)\n\t\t\t\t{\n\t\t\t\t\t//ipad 3/air\n\t\t\t\t\tif(isPortraitUpsideDown)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Portrait@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isPortrait)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-PortraitUpsideDown@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isLandscapeRight)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeRight@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeLeft@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 768 && Capabilities.screenResolutionY == 1024)\n\t\t\t\t{\n\t\t\t\t\t//ipad 1/2\n\t\t\t\t\tif(isPortraitUpsideDown)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Portrait~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isPortrait)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-PortraitUpsideDown~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isLandscapeRight)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeRight~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Landscape~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 750)\n\t\t\t\t{\n\t\t\t\t\t//iphone 6/7/8\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tfilePath = \"Default-375w-667h@2x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 640)\n\t\t\t\t{\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tif(Capabilities.screenResolutionY == 1136)\n\t\t\t\t\t{\n\t\t\t\t\t\t//iphone 5/5c/5s\n\t\t\t\t\t\tfilePath = \"Default-568h@2x~iphone.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//iphone 4/4s\n\t\t\t\t\t\tfilePath = \"Default@2x~iphone.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 320)\n\t\t\t\t{\n\t\t\t\t\t//iphone 3gs\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tfilePath = \"Default~iphone.png\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(filePath)\n\t\t\t{\n\t\t\t\tvar file:File = File.applicationDirectory.resolvePath(filePath);\n\t\t\t\tif(file.exists)\n\t\t\t\t{\n\t\t\t\t\tvar bytes:ByteArray = new ByteArray();\n\t\t\t\t\tvar stream:FileStream = new FileStream();\n\t\t\t\t\tstream.open(file, FileMode.READ);\n\t\t\t\t\tstream.readBytes(bytes, 0, stream.bytesAvailable);\n\t\t\t\t\tstream.close();\n\t\t\t\t\tthis._launchImage = new Loader();\n\t\t\t\t\tthis._launchImage.loadBytes(bytes);\n\t\t\t\t\tthis.addChild(this._launchImage);\n\t\t\t\t\tthis._savedAutoOrients = this.stage.autoOrients;\n\t\t\t\t\tthis.stage.autoOrients = false;\n\t\t\t\t\tif(isPortraitOnly)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.stage.setOrientation(StageOrientation.DEFAULT);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function loaderInfo_completeHandler(event:Event):void\n\t\t{\n\t\t\tStarling.multitouchEnabled = true;\n\t\t\tthis._starling = new Starling(Main, this.stage, null, null, Context3DRenderMode.AUTO, Context3DProfile.BASELINE);\n\t\t\tthis._starling.supportHighResolutions = true;\n\t\t\tthis._starling.skipUnchangedFrames = true;\n\t\t\tthis._starling.start();\n\t\t\tif(this._launchImage)\n\t\t\t{\n\t\t\t\tthis._starling.addEventListener(\"rootCreated\", starling_rootCreatedHandler);\n\t\t\t}\n\t\t\tthis._scaler = new ScreenDensityScaleFactorManager(this._starling);\n\t\t\tthis.stage.addEventListener(Event.DEACTIVATE, stage_deactivateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function starling_rootCreatedHandler(event:Object):void\n\t\t{\n\t\t\tif(this._launchImage)\n\t\t\t{\n\t\t\t\tthis.removeChild(this._launchImage);\n\t\t\t\tthis._launchImage.unloadAndStop(true);\n\t\t\t\tthis._launchImage = null;\n\t\t\t\tthis.stage.autoOrients = this._savedAutoOrients;\n\t\t\t}\n\t\t}\n\n\t\tprivate function stage_deactivateHandler(event:Event):void\n\t\t{\n\t\t\tthis._starling.stop(true);\n\t\t\tthis.stage.addEventListener(Event.ACTIVATE, stage_activateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function stage_activateHandler(event:Event):void\n\t\t{\n\t\t\tthis.stage.removeEventListener(Event.ACTIVATE, stage_activateHandler);\n\t\t\tthis._starling.start();\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "examples/Tabs/source/TabsWeb.as",
    "content": "package\n{\n\timport feathers.system.DeviceCapabilities;\n\n\timport flash.display.MovieClip;\n\timport flash.display.StageAlign;\n\timport flash.display.StageScaleMode;\n\timport flash.events.Event;\n\timport flash.geom.Rectangle;\n\timport flash.ui.ContextMenu;\n\timport flash.utils.getDefinitionByName;\n\n\timport starling.core.Starling;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#4a4137\")]\n\tpublic class TabsWeb extends MovieClip\n\t{\n\t\tpublic function TabsWeb()\n\t\t{\n\t\t\tvar menu:ContextMenu = new ContextMenu();\n\t\t\tmenu.hideBuiltInItems();\n\t\t\tthis.contextMenu = menu;\n\t\t\t\n\t\t\tif(this.stage)\n\t\t\t{\n\t\t\t\tthis.stage.align = StageAlign.TOP_LEFT;\n\t\t\t\tthis.stage.scaleMode = StageScaleMode.NO_SCALE;\n\t\t\t}\n\t\t\t\n\t\t\tthis.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);\n\t\t}\n\t\t\n\t\tprivate var _starling:Starling;\n\t\t\n\t\tprivate function start():void\n\t\t{\n\t\t\tthis.gotoAndStop(2);\n\t\t\tthis.graphics.clear();\n\t\t\t\n\t\t\t//simulating iPhone Retina\n\t\t\tDeviceCapabilities.dpi = 326;\n\t\t\t\n\t\t\tStarling.multitouchEnabled = true;\n\t\t\tvar MainType:Class = getDefinitionByName(\"feathers.examples.tabs.Main\") as Class;\n\t\t\tthis._starling = new Starling(MainType, this.stage, new Rectangle(0, 0, 960, 640));\n\t\t\tthis._starling.supportHighResolutions = true;\n\t\t\tthis._starling.skipUnchangedFrames = true;\n\t\t\tthis._starling.stage.stageWidth = 480;\n\t\t\tthis._starling.stage.stageHeight = 320;\n\t\t\tthis._starling.start();\n\t\t}\n\t\t\n\t\tprivate function loaderInfo_completeHandler(event:Event):void\n\t\t{\n\t\t\tthis.start();\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/Tabs/source/feathers/examples/tabs/Main.as",
    "content": "package feathers.examples.tabs\n{\n\timport feathers.controls.TabNavigator;\n\timport feathers.controls.TabNavigatorItem;\n\timport feathers.examples.tabs.screens.ContactsScreen;\n\timport feathers.examples.tabs.screens.MessagesScreen;\n\timport feathers.examples.tabs.screens.ProfileScreen;\n\timport feathers.examples.tabs.themes.TabsTheme;\n\n\timport starling.display.Sprite;\n\timport starling.events.Event;\n\n\tpublic class Main extends Sprite\n\t{\n\t\tprivate static const MESSAGES:String = \"messages\";\n\t\tprivate static const CONTACTS:String = \"contacts\";\n\t\tprivate static const PROFILE:String = \"profile\";\n\n\t\tpublic function Main()\n\t\t{\n\t\t\tnew TabsTheme();\n\n\t\t\tsuper();\n\n\t\t\tthis.addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);\n\t\t}\n\n\t\tprotected var navigator:TabNavigator;\n\n\t\tprotected function addedToStageHandler(event:Event):void\n\t\t{\n\t\t\tthis.navigator = new TabNavigator();\n\t\t\tthis.addMessagesTab();\n\t\t\tthis.addContactsTab();\n\t\t\tthis.addProfileTab();\n\t\t\tthis.addChild(this.navigator);\n\t\t}\n\n\t\tprivate function addMessagesTab():void\n\t\t{\n\t\t\tvar screen:MessagesScreen = new MessagesScreen();\n\t\t\tvar item:TabNavigatorItem = new TabNavigatorItem(screen, \"Messages\");\n\t\t\tthis.navigator.addScreen(MESSAGES, item);\n\t\t}\n\n\t\tprivate function addContactsTab():void\n\t\t{\n\t\t\tvar screen:ContactsScreen = new ContactsScreen();\n\t\t\tvar item:TabNavigatorItem = new TabNavigatorItem(screen, \"Contacts\");\n\t\t\tthis.navigator.addScreen(CONTACTS, item);\n\t\t}\n\n\t\tprivate function addProfileTab():void\n\t\t{\n\t\t\tvar screen:ProfileScreen = new ProfileScreen();\n\t\t\tvar item:TabNavigatorItem = new TabNavigatorItem(screen, \"Profile\");\n\t\t\tthis.navigator.addScreen(PROFILE, item);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/Tabs/source/feathers/examples/tabs/screens/ContactsScreen.as",
    "content": "package feathers.examples.tabs.screens\n{\n\timport feathers.controls.GroupedList;\n\timport feathers.controls.ImageLoader;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.renderers.DefaultGroupedListItemRenderer;\n\timport feathers.controls.renderers.IGroupedListItemRenderer;\n\timport feathers.data.ArrayHierarchicalCollection;\n\timport feathers.examples.tabs.themes.StyleNames;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.utils.textures.TextureCache;\n\n\tpublic class ContactsScreen extends PanelScreen\n\t{\n\t\tpublic function ContactsScreen()\n\t\t{\n\t\t\tthis.title = \"Contacts\";\n\t\t}\n\n\t\tprivate var _list:GroupedList;\n\t\tprivate var _cache:TextureCache;\n\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this._cache !== null)\n\t\t\t{\n\t\t\t\tthis._cache.dispose();\n\t\t\t\tthis._cache = null;\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tsuper.initialize();\n\n\t\t\tthis._cache = new TextureCache(10);\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._list = new GroupedList();\n\t\t\tthis._list.isSelectable = false;\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis._list.customItemRendererStyleName = StyleNames.MESSAGE_LIST_ITEM_RENDERER;\n\t\t\tthis._list.itemRendererFactory = this.createContactItemRenderer;\n\t\t\tthis.addChild(this._list);\n\n\t\t\tthis._list.dataProvider = new ArrayHierarchicalCollection(\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\theader: \"A\",\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: \"Andy Johnston\",\n\t\t\t\t\t\t\temail: \"itsandy1981@example.com\",\n\t\t\t\t\t\t\tphoto: \"http://feathersui.com/examples/tabs/images/men92.jpg\"\n\t\t\t\t\t\t},\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\theader: \"D\",\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: \"Denise Kim\",\n\t\t\t\t\t\t\temail: \"kim.denise@example.com\",\n\t\t\t\t\t\t\tphoto: \"http://feathersui.com/examples/tabs/images/women83.jpg\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: \"Dylan Curtis\",\n\t\t\t\t\t\t\temail: \"curtis1987@example.com\",\n\t\t\t\t\t\t\tphoto: \"http://feathersui.com/examples/tabs/images/men87.jpg\"\n\t\t\t\t\t\t},\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\theader: \"P\",\n\t\t\t\t\tchildren: \n\t\t\t\t\t[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: \"Pat Brewer\",\n\t\t\t\t\t\t\temail: \"pbrewer19@example.com\",\n\t\t\t\t\t\t\tphoto: \"http://feathersui.com/examples/tabs/images/women79.jpg\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: \"Pearl Boyd\",\n\t\t\t\t\t\t\temail: \"pearl.boyd@example.com\",\n\t\t\t\t\t\t\tphoto: \"http://feathersui.com/examples/tabs/images/women69.jpg\"\n\t\t\t\t\t\t},\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\theader: \"R\",\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: \"Robin Taylor\",\n\t\t\t\t\t\t\temail: \"robintaylor@example.com\",\n\t\t\t\t\t\t\tphoto: \"http://feathersui.com/examples/tabs/images/women89.jpg\"\n\t\t\t\t\t\t},\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\theader: \"S\",\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: \"Savannah Flores\",\n\t\t\t\t\t\t\temail: \"saflo79@example.com\",\n\t\t\t\t\t\t\tphoto: \"http://feathersui.com/examples/tabs/images/women53.jpg\"\n\t\t\t\t\t\t},\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\theader: \"W\",\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: \"Wayne Adams\",\n\t\t\t\t\t\t\temail: \"superwayne@example.com\",\n\t\t\t\t\t\t\tphoto: \"http://feathersui.com/examples/tabs/images/men36.jpg\"\n\t\t\t\t\t\t},\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t]);\n\t\t}\n\n\t\tprivate function createContactItemRenderer():IGroupedListItemRenderer\n\t\t{\n\t\t\tvar itemRenderer:DefaultGroupedListItemRenderer = new DefaultGroupedListItemRenderer();\n\t\t\titemRenderer.labelField = \"name\";\n\t\t\titemRenderer.accessoryLabelField = \"email\";\n\t\t\titemRenderer.iconSourceField = \"photo\";\n\t\t\titemRenderer.iconLoaderFactory = this.createPhotoLoader;\n\t\t\treturn itemRenderer;\n\t\t}\n\n\t\tprivate function createPhotoLoader():ImageLoader\n\t\t{\n\t\t\tvar loader:ImageLoader = new ImageLoader();\n\t\t\tloader.textureCache = this._cache;\n\t\t\treturn loader;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/Tabs/source/feathers/examples/tabs/screens/MessagesScreen.as",
    "content": "package feathers.examples.tabs.screens\n{\n\timport feathers.controls.ImageLoader;\n\timport feathers.controls.List;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.renderers.IListItemRenderer;\n\timport feathers.data.ArrayCollection;\n\timport feathers.data.ListCollection;\n\timport feathers.examples.tabs.themes.StyleNames;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.utils.textures.TextureCache;\n\n\tpublic class MessagesScreen extends PanelScreen\n\t{\n\t\tpublic function MessagesScreen()\n\t\t{\n\t\t\tthis.title = \"Messages\";\n\t\t}\n\n\t\tprivate var _list:List;\n\t\tprivate var _cache:TextureCache;\n\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this._cache !== null)\n\t\t\t{\n\t\t\t\tthis._cache.dispose();\n\t\t\t\tthis._cache = null;\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tsuper.initialize();\n\n\t\t\tthis._cache = new TextureCache(10);\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._list = new List();\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis._list.customItemRendererStyleName = StyleNames.MESSAGE_LIST_ITEM_RENDERER;\n\t\t\tthis._list.itemRendererFactory = this.createMessageItemRenderer;\n\t\t\tthis.addChild(this._list);\n\n\t\t\tthis._list.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\tname: \"Patsy Brewer\",\n\t\t\t\t\tmessage: \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\",\n\t\t\t\t\tphoto: \"http://feathersui.com/examples/tabs/images/women79.jpg\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: \"Wayne Adams\",\n\t\t\t\t\tmessage: \"Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\",\n\t\t\t\t\tphoto: \"http://feathersui.com/examples/tabs/images/men36.jpg\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: \"Andy Johnston\",\n\t\t\t\t\tmessage: \"Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\",\n\t\t\t\t\tphoto: \"http://feathersui.com/examples/tabs/images/men92.jpg\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: \"Pearl Boyd\",\n\t\t\t\t\tmessage: \"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\",\n\t\t\t\t\tphoto: \"http://feathersui.com/examples/tabs/images/women69.jpg\"\n\t\t\t\t},\n\t\t\t]);\n\t\t}\n\n\t\tprivate function createMessageItemRenderer():IListItemRenderer\n\t\t{\n\t\t\tvar itemRenderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\t\t\titemRenderer.labelField = \"name\";\n\t\t\titemRenderer.accessoryLabelField = \"message\";\n\t\t\titemRenderer.iconSourceField = \"photo\";\n\t\t\titemRenderer.iconLoaderFactory = this.createPhotoLoader;\n\t\t\treturn itemRenderer;\n\t\t}\n\n\t\tprivate function createPhotoLoader():ImageLoader\n\t\t{\n\t\t\tvar loader:ImageLoader = new ImageLoader();\n\t\t\tloader.textureCache = this._cache;\n\t\t\treturn loader;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/Tabs/source/feathers/examples/tabs/screens/ProfileScreen.as",
    "content": "package feathers.examples.tabs.screens\n{\n\timport feathers.controls.ImageLoader;\n\timport feathers.controls.Label;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.Screen;\n\timport feathers.examples.tabs.themes.StyleNames;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\n\tpublic class ProfileScreen extends Screen\n\t{\n\t\tpublic function ProfileScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _image:ImageLoader;\n\t\tprivate var _nameLabel:Label;\n\t\tprivate var _emailLabel:Label;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tsuper.initialize();\n\n\t\t\tvar mainLayout:VerticalLayout = new VerticalLayout();\n\t\t\tmainLayout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tmainLayout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\tmainLayout.padding = 10;\n\t\t\tthis.layout = mainLayout;\n\n\t\t\tvar header:LayoutGroup = new LayoutGroup();\n\t\t\tvar headerLayout:VerticalLayout = new VerticalLayout();\n\t\t\theaderLayout.gap = 4;\n\t\t\theaderLayout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\theader.layout = headerLayout;\n\t\t\tthis.addChild(header);\n\n\t\t\tthis._image = new ImageLoader();\n\t\t\tthis._image.styleNameList.add(StyleNames.LARGE_PROFILE_IMAGE);\n\t\t\tthis._image.source = \"http://feathersui.com/examples/tabs/images/men67.jpg\";\n\t\t\theader.addChild(this._image);\n\n\t\t\tthis._nameLabel = new Label();\n\t\t\tthis._nameLabel.styleNameList.add(Label.ALTERNATE_STYLE_NAME_HEADING);\n\t\t\tthis._nameLabel.text = \"Flynn Reynolds\";\n\t\t\theader.addChild(this._nameLabel);\n\n\t\t\tthis._emailLabel = new Label();\n\t\t\tthis._emailLabel.text = \"flynn.reynolds84@example.com\";\n\t\t\tthis.addChild(this._emailLabel);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/Tabs/source/feathers/examples/tabs/themes/StyleNames.as",
    "content": "package feathers.examples.tabs.themes\n{\n\tpublic class StyleNames\n\t{\n\t\tpublic static const MESSAGE_LIST_ITEM_RENDERER:String = \"message-list-item-renderer\";\n\t\tpublic static const SMALL_PROFILE_IMAGE:String = \"small-profile-image\";\n\t\tpublic static const LARGE_PROFILE_IMAGE:String = \"large-profile-image\";\n\t}\n}\n"
  },
  {
    "path": "examples/Tabs/source/feathers/examples/tabs/themes/TabsTheme.as",
    "content": "package feathers.examples.tabs.themes\n{\n\timport feathers.controls.ImageLoader;\n\timport feathers.controls.ItemRendererLayoutOrder;\n\timport feathers.controls.renderers.BaseDefaultItemRenderer;\n\timport feathers.controls.renderers.DefaultGroupedListItemRenderer;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.layout.RelativePosition;\n\timport feathers.themes.MetalWorksMobileTheme;\n\n\timport starling.display.Canvas;\n\n\tpublic class TabsTheme extends MetalWorksMobileTheme\n\t{\n\t\tpublic function TabsTheme()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\toverride protected function initializeStyleProviders():void\n\t\t{\n\t\t\tsuper.initializeStyleProviders();\n\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).setFunctionForStyleName(\n\t\t\t\t\tStyleNames.MESSAGE_LIST_ITEM_RENDERER, this.setMessageListItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListItemRenderer).setFunctionForStyleName(\n\t\t\t\tStyleNames.MESSAGE_LIST_ITEM_RENDERER, this.setMessageListItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(ImageLoader).setFunctionForStyleName(\n\t\t\t\tStyleNames.SMALL_PROFILE_IMAGE, this.setSmallProfileImageStyles);\n\t\t\tthis.getStyleProviderForClass(ImageLoader).setFunctionForStyleName(\n\t\t\t\tStyleNames.LARGE_PROFILE_IMAGE, this.setLargeProfileImageStyles);\n\t\t}\n\n\t\tprivate function setMessageListItemRendererStyles(itemRenderer:BaseDefaultItemRenderer):void\n\t\t{\n\t\t\tthis.setItemRendererStyles(itemRenderer);\n\t\t\titemRenderer.accessoryPosition = RelativePosition.BOTTOM;\n\t\t\titemRenderer.accessoryGap = 4;\n\t\t\titemRenderer.layoutOrder = ItemRendererLayoutOrder.LABEL_ACCESSORY_ICON;\n\t\t\titemRenderer.customIconLoaderStyleName = StyleNames.SMALL_PROFILE_IMAGE;\n\t\t}\n\n\t\tprivate function setProfileImageStyles(image:ImageLoader, size:Number):void\n\t\t{\n\t\t\tvar halfSize:Number = size / 2;\n\t\t\timage.setSize(size, size);\n\t\t\tvar mask:Canvas = new Canvas();\n\t\t\tmask.beginFill(0xff00ff, 1);\n\t\t\tmask.drawCircle(halfSize, halfSize, halfSize);\n\t\t\tmask.endFill();\n\t\t\timage.mask = mask;\n\t\t\timage.addChild(mask);\n\t\t}\n\n\t\tprivate function setSmallProfileImageStyles(image:ImageLoader):void\n\t\t{\n\t\t\tthis.setProfileImageStyles(image, 48);\n\t\t}\n\n\t\tprivate function setLargeProfileImageStyles(image:ImageLoader):void\n\t\t{\n\t\t\tthis.setProfileImageStyles(image, 100);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/TileList/README.md",
    "content": "# Tile List Example for Feathers\n\nAn example of customizing the List component in [Feathers](http://feathersui.com/) using a tile layout with paging. Includes some customization of the DefaultListItemRenderer layout to display an icon above text.\n\n## Web Demo\n\nView the [Tile List Example](http://feathersui.com/examples/tile-list/) in your browser.\n\n## Credits\n\nThis example uses the free [Picons social media icon set](https://picons.me/download-social.php)."
  },
  {
    "path": "examples/TileList/assets/images/atlas@2x.tps",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<data version=\"1.0\">\n    <struct type=\"Settings\">\n        <key>fileFormatVersion</key>\n        <int>3</int>\n        <key>texturePackerVersion</key>\n        <string>4.0.1</string>\n        <key>fileName</key>\n        <string>/Users/joshtynjala/Development/feathers/feathers/examples/TileList/assets/images/atlas@2x.tps</string>\n        <key>autoSDSettings</key>\n        <array>\n            <struct type=\"AutoSDSettings\">\n                <key>scale</key>\n                <double>1</double>\n                <key>extension</key>\n                <string></string>\n                <key>spriteFilter</key>\n                <string></string>\n                <key>acceptFractionalValues</key>\n                <false/>\n                <key>maxTextureSize</key>\n                <QSize>\n                    <key>width</key>\n                    <int>-1</int>\n                    <key>height</key>\n                    <int>-1</int>\n                </QSize>\n            </struct>\n        </array>\n        <key>allowRotation</key>\n        <false/>\n        <key>premultiplyAlpha</key>\n        <false/>\n        <key>shapeDebug</key>\n        <false/>\n        <key>dpi</key>\n        <uint>72</uint>\n        <key>dataFormat</key>\n        <string>sparrow</string>\n        <key>textureFileName</key>\n        <filename>atlas@2x.png</filename>\n        <key>flipPVR</key>\n        <false/>\n        <key>pvrCompressionQuality</key>\n        <enum type=\"SettingsBase::PvrCompressionQuality\">PVR_QUALITY_BEST</enum>\n        <key>atfCompressData</key>\n        <false/>\n        <key>mipMapMinSize</key>\n        <uint>32768</uint>\n        <key>etc1CompressionQuality</key>\n        <enum type=\"SettingsBase::Etc1CompressionQuality\">ETC1_QUALITY_LOW_PERCEPTUAL</enum>\n        <key>dxtCompressionMode</key>\n        <enum type=\"SettingsBase::DxtCompressionMode\">DXT_PERCEPTUAL</enum>\n        <key>jxrColorFormat</key>\n        <enum type=\"SettingsBase::JpegXrColorMode\">JXR_YUV444</enum>\n        <key>jxrTrimFlexBits</key>\n        <uint>0</uint>\n        <key>jxrCompressionLevel</key>\n        <uint>0</uint>\n        <key>ditherType</key>\n        <enum type=\"SettingsBase::DitherType\">NearestNeighbour</enum>\n        <key>backgroundColor</key>\n        <uint>0</uint>\n        <key>libGdx</key>\n        <struct type=\"LibGDX\">\n            <key>filtering</key>\n            <struct type=\"LibGDXFiltering\">\n                <key>x</key>\n                <enum type=\"LibGDXFiltering::Filtering\">Linear</enum>\n                <key>y</key>\n                <enum type=\"LibGDXFiltering::Filtering\">Linear</enum>\n            </struct>\n        </struct>\n        <key>shapePadding</key>\n        <uint>2</uint>\n        <key>jpgQuality</key>\n        <uint>80</uint>\n        <key>pngOptimizationLevel</key>\n        <uint>1</uint>\n        <key>webpQualityLevel</key>\n        <uint>101</uint>\n        <key>textureSubPath</key>\n        <string></string>\n        <key>textureFormat</key>\n        <enum type=\"SettingsBase::TextureFormat\">png</enum>\n        <key>borderPadding</key>\n        <uint>2</uint>\n        <key>maxTextureSize</key>\n        <QSize>\n            <key>width</key>\n            <int>2048</int>\n            <key>height</key>\n            <int>2048</int>\n        </QSize>\n        <key>fixedTextureSize</key>\n        <QSize>\n            <key>width</key>\n            <int>-1</int>\n            <key>height</key>\n            <int>-1</int>\n        </QSize>\n        <key>reduceBorderArtifacts</key>\n        <false/>\n        <key>algorithmSettings</key>\n        <struct type=\"AlgorithmSettings\">\n            <key>algorithm</key>\n            <enum type=\"AlgorithmSettings::AlgorithmId\">MaxRects</enum>\n            <key>freeSizeMode</key>\n            <enum type=\"AlgorithmSettings::AlgorithmFreeSizeMode\">Best</enum>\n            <key>sizeConstraints</key>\n            <enum type=\"AlgorithmSettings::SizeConstraints\">AnySize</enum>\n            <key>forceSquared</key>\n            <false/>\n            <key>forceWordAligned</key>\n            <false/>\n            <key>maxRects</key>\n            <struct type=\"AlgorithmMaxRectsSettings\">\n                <key>heuristic</key>\n                <enum type=\"AlgorithmMaxRectsSettings::Heuristic\">Best</enum>\n            </struct>\n            <key>basic</key>\n            <struct type=\"AlgorithmBasicSettings\">\n                <key>sortBy</key>\n                <enum type=\"AlgorithmBasicSettings::SortBy\">Best</enum>\n                <key>order</key>\n                <enum type=\"AlgorithmBasicSettings::Order\">Ascending</enum>\n            </struct>\n        </struct>\n        <key>andEngine</key>\n        <struct type=\"AndEngine\">\n            <key>minFilter</key>\n            <enum type=\"AndEngine::MinFilter\">Linear</enum>\n            <key>packageName</key>\n            <string>Texture</string>\n            <key>wrap</key>\n            <struct type=\"AndEngineWrap\">\n                <key>s</key>\n                <enum type=\"AndEngineWrap::Wrap\">Clamp</enum>\n                <key>t</key>\n                <enum type=\"AndEngineWrap::Wrap\">Clamp</enum>\n            </struct>\n            <key>magFilter</key>\n            <enum type=\"AndEngine::MagFilter\">MagLinear</enum>\n        </struct>\n        <key>dataFileNames</key>\n        <map type=\"GFileNameMap\">\n            <key>data</key>\n            <struct type=\"DataFile\">\n                <key>name</key>\n                <filename>atlas@2x.xml</filename>\n            </struct>\n            <key>java</key>\n            <struct type=\"DataFile\">\n                <key>name</key>\n                <filename>icons.java</filename>\n            </struct>\n        </map>\n        <key>multiPack</key>\n        <false/>\n        <key>forceIdenticalLayout</key>\n        <false/>\n        <key>outputFormat</key>\n        <enum type=\"SettingsBase::OutputFormat\">RGBA8888</enum>\n        <key>contentProtection</key>\n        <struct type=\"ContentProtection\">\n            <key>key</key>\n            <string></string>\n        </struct>\n        <key>autoAliasEnabled</key>\n        <true/>\n        <key>trimSpriteNames</key>\n        <false/>\n        <key>prependSmartFolderName</key>\n        <false/>\n        <key>cleanTransparentPixels</key>\n        <true/>\n        <key>globalSpriteSettings</key>\n        <struct type=\"SpriteSettings\">\n            <key>scale</key>\n            <double>1</double>\n            <key>scaleMode</key>\n            <enum type=\"ScaleMode\">Smooth</enum>\n            <key>extrude</key>\n            <uint>1</uint>\n            <key>trimThreshold</key>\n            <uint>1</uint>\n            <key>trimMargin</key>\n            <uint>1</uint>\n            <key>trimMode</key>\n            <enum type=\"SpriteSettings::TrimMode\">Trim</enum>\n            <key>tracerTolerance</key>\n            <int>200</int>\n            <key>heuristicMask</key>\n            <false/>\n            <key>pivotPoint</key>\n            <enum type=\"SpriteSettings::PivotPoint\">Center</enum>\n        </struct>\n        <key>fileList</key>\n        <array>\n            <filename>atlas@2x</filename>\n        </array>\n        <key>ignoreFileList</key>\n        <array/>\n        <key>replaceList</key>\n        <array/>\n        <key>ignoredWarnings</key>\n        <array/>\n        <key>commonDivisorX</key>\n        <uint>1</uint>\n        <key>commonDivisorY</key>\n        <uint>1</uint>\n        <key>packNormalMaps</key>\n        <false/>\n        <key>autodetectNormalMaps</key>\n        <true/>\n        <key>normalMapFilter</key>\n        <string></string>\n        <key>normalMapSuffix</key>\n        <string></string>\n        <key>normalMapSheetFileName</key>\n        <filename></filename>\n    </struct>\n</data>\n"
  },
  {
    "path": "examples/TileList/assets/images/atlas@2x.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- Created with TexturePacker http://www.codeandweb.com/texturepacker-->\n<!-- $TexturePacker:SmartUpdate:e03d873b4d80c26aee33406ce98c2c27:56e65690a0ede4bbfc70f7d857016895:eab29082ace0a83bd389fcb3e4575d43$ -->\n<TextureAtlas imagePath=\"atlas@2x.png\" width=\"1717\" height=\"266\">\n    <SubTexture name=\"behance\" x=\"3\" y=\"3\" width=\"128\" height=\"128\"/>\n    <SubTexture name=\"blogger\" x=\"3\" y=\"135\" width=\"128\" height=\"128\"/>\n    <SubTexture name=\"delicious\" x=\"135\" y=\"3\" width=\"128\" height=\"128\"/>\n    <SubTexture name=\"deviantart\" x=\"135\" y=\"135\" width=\"128\" height=\"128\"/>\n    <SubTexture name=\"digg\" x=\"267\" y=\"3\" width=\"128\" height=\"128\"/>\n    <SubTexture name=\"dribbble\" x=\"267\" y=\"135\" width=\"128\" height=\"128\"/>\n    <SubTexture name=\"facebook\" x=\"399\" y=\"3\" width=\"128\" height=\"128\"/>\n    <SubTexture name=\"flickr\" x=\"399\" y=\"135\" width=\"128\" height=\"128\"/>\n    <SubTexture name=\"github\" x=\"1455\" y=\"135\" width=\"128\" height=\"125\" frameX=\"0\" frameY=\"0\" frameWidth=\"128\" frameHeight=\"128\"/>\n    <SubTexture name=\"google\" x=\"531\" y=\"3\" width=\"128\" height=\"128\"/>\n    <SubTexture name=\"instagram\" x=\"531\" y=\"135\" width=\"128\" height=\"128\"/>\n    <SubTexture name=\"linkedin\" x=\"663\" y=\"3\" width=\"128\" height=\"128\"/>\n    <SubTexture name=\"pinterest\" x=\"663\" y=\"135\" width=\"128\" height=\"128\"/>\n    <SubTexture name=\"snapchat\" x=\"1587\" y=\"3\" width=\"127\" height=\"127\" frameX=\"0\" frameY=\"0\" frameWidth=\"128\" frameHeight=\"128\"/>\n    <SubTexture name=\"soundcloud\" x=\"795\" y=\"3\" width=\"128\" height=\"128\"/>\n    <SubTexture name=\"stackoverflow\" x=\"795\" y=\"135\" width=\"128\" height=\"128\"/>\n    <SubTexture name=\"stumbleupon\" x=\"927\" y=\"3\" width=\"128\" height=\"128\"/>\n    <SubTexture name=\"tumblr\" x=\"927\" y=\"135\" width=\"128\" height=\"128\"/>\n    <SubTexture name=\"twitter\" x=\"1059\" y=\"3\" width=\"128\" height=\"128\"/>\n    <SubTexture name=\"vimeo\" x=\"1059\" y=\"135\" width=\"128\" height=\"128\"/>\n    <SubTexture name=\"vine\" x=\"1191\" y=\"3\" width=\"128\" height=\"128\"/>\n    <SubTexture name=\"wordpress\" x=\"1191\" y=\"135\" width=\"128\" height=\"128\"/>\n    <SubTexture name=\"yahoo\" x=\"1323\" y=\"3\" width=\"128\" height=\"128\"/>\n    <SubTexture name=\"yelp\" x=\"1323\" y=\"135\" width=\"128\" height=\"128\"/>\n    <SubTexture name=\"youtube\" x=\"1455\" y=\"3\" width=\"128\" height=\"128\"/>\n</TextureAtlas>\n"
  },
  {
    "path": "examples/TileList/build.properties",
    "content": "feathers.root = ${basedir}/../../source\nstarling.root = ${basedir}/../../third-party/starling\ntheme.root = ${basedir}/../../themes/MinimalMobileTheme/source\noutput.path = ${basedir}/output\nicon.path = ${basedir}/../shared-assets/icons\nassets.path = ${basedir}/assets\nlaunch.image.path = ${assets.path}/launch-images\n\nswf.version = 30"
  },
  {
    "path": "examples/TileList/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<project name=\"tile-list\" default=\"build\" basedir=\".\">\n\t\n\t<!-- build.local.properties and sdk.local.proprties are optional files that\n\t\tcan be used to override the default properties. -->\n\t<property file=\"./build.local.properties\"/>\n\t<property file=\"./sdk.local.properties\"/>\n\t<property file=\"./build.properties\"/>\n\t<!-- inherit SDK properties from the root of the repository -->\n\t<property file=\"../../sdk.local.properties\"/>\n\t<property file=\"../../sdk.properties\"/>\n\n\t<target name=\"build\" depends=\"build-web,build-android,build-ios\"/>\n\n\t<target name=\"prepare\">\n\t\t<delete dir=\"${output.path}\"/>\n\t</target>\n\n\t<target name=\"build-web\" depends=\"prepare\">\n\t\t<echo message=\"Building TileListWeb.swf\"/>\n\t\t<java jar=\"${mxmlc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${flashplayer.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-frame=two,feathers.examples.tileList.Main\"/>\n\t\t\t<arg value=\"-source-path+=source\"/>\n\t\t\t<arg value=\"-source-path+=${starling.root}\"/>\n\t\t\t<arg value=\"-source-path+=${feathers.root}\"/>\n\t\t\t<arg value=\"-source-path+=${theme.root}\"/>\n\t\t\t<arg value=\"source/TileListWeb.as\"/>\n\t\t\t<arg value=\"-output=${output.path}/TileListWeb.swf\"/>\n\t\t</java>\n\t\t<copy overwrite=\"true\" todir=\"${output.path}\">\n\t\t\t<fileset dir=\"${assets.path}\">\n\t\t\t\t<include name=\"images/atlas@2x.png\"/>\n\t\t\t\t<include name=\"images/atlas@2x.xml\"/>\n\t\t\t</fileset>\n\t\t</copy>\n\t</target>\n\n\t<target name=\"build-air-swf\" depends=\"prepare\">\n\t\t<echo message=\"Building TileList.swf\"/>\n\t\t<java jar=\"${mxmlc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${airmobile.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-source-path+=source\"/>\n\t\t\t<arg value=\"-source-path+=${starling.root}\"/>\n\t\t\t<arg value=\"-source-path+=${feathers.root}\"/>\n\t\t\t<arg value=\"-source-path+=${theme.root}\"/>\n\t\t\t<arg value=\"source/TileList.as\"/>\n\t\t\t<arg value=\"-output=${output.path}/TileList.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"-check-ios-properties\">\n\t\t<fail unless=\"ios.provision.path\"/>\n\t\t<fail unless=\"ios.certificate.path\"/>\n\t\t<fail unless=\"ios.certificate.password\"/>\n\t</target>\n\t<target name=\"build-ios\" depends=\"-check-ios-properties,build-air-swf\">\n\t\t<echo message=\"Packaging TileList.ipa\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"-target\"/>\n\t\t\t<arg value=\"ipa-app-store\"/>\n\t\t\t<arg value=\"-provisioning-profile\"/>\n\t\t\t<arg value=\"${ios.provision.path}\"/>\n\t\t\t<arg value=\"-keystore\"/>\n\t\t\t<arg value=\"${ios.certificate.path}\"/>\n\t\t\t<arg value=\"-storetype\"/>\n\t\t\t<arg value=\"pkcs12\"/>\n\t\t\t<arg value=\"-storepass\"/>\n\t\t\t<arg value=\"${ios.certificate.password}\"/>\n\t\t\t<arg value=\"${output.path}/TileList.ipa\"/>\n\t\t\t<arg value=\"source/TileList-app.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${icon.path}\"/>\n\t\t\t<arg line=\"icon29.png icon48.png icon50.png icon57.png icon58.png icon72.png icon87.png icon96.png icon100.png icon114.png icon128.png icon144.png icon180.png\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${launch.image.path}\"/>\n\t\t\t<arg value=\"Default~iphone.png\"/>\t\t\t\t\t\t\t<!-- iphone 3gs -->\n\t\t\t<arg value=\"Default@2x~iphone.png\"/>\t\t\t\t\t\t<!-- iphone 4/4s -->\n\t\t\t<arg value=\"Default-568h@2x~iphone.png\"/>\t\t\t\t\t<!-- iphone 5/5c/5s -->\n\t\t\t<arg value=\"Default-375w-667h@2x~iphone.png\"/>\t\t\t\t<!-- iphone 6/7/8 -->\n\t\t\t<arg value=\"Default-812h@3x~iphone.png\"/>\t\t\t\t\t<!-- iphone x (portrait) -->\n\t\t\t<arg value=\"Default-Landscape-812h@3x~iphone.png\"/>\t\t\t<!-- iphone x (landscape) -->\n\t\t\t<arg value=\"Default-414w-736h@3x~iphone.png\"/>\t\t\t\t<!-- iphone 6/7/8 plus (portrait) -->\n\t\t\t<arg value=\"Default-Landscape-414w-736h@3x~iphone.png\"/>\t<!-- iphone 6/7/8 plus (landscape) -->\n\t\t\t<arg value=\"Default-Portrait~ipad.png\"/>\t\t\t\t\t<!-- ipad 1/2 (portrait) -->\n\t\t\t<arg value=\"Default-PortraitUpsideDown~ipad.png\"/>\t\t\t<!-- ipad 1/2 (portrait upside down) -->\n\t\t\t<arg value=\"Default-Landscape~ipad.png\"/>\t\t\t\t\t<!-- ipad 1/2 (landscape left) -->\n\t\t\t<arg value=\"Default-LandscapeRight~ipad.png\"/>\t\t\t\t<!-- ipad 1/2 (landscape right) -->\n\t\t\t<arg value=\"Default-Portrait@2x~ipad.png\"/>\t\t\t\t\t<!-- ipad 3/air (portrait) -->\n\t\t\t<arg value=\"Default-LandscapeLeft@2x~ipad.png\"/>\t\t\t<!-- ipad 3/air (landscape left) -->\n\t\t\t<arg value=\"Default-LandscapeRight@2x~ipad.png\"/>\t\t\t<!-- ipad 3/air (landscape right) -->\n\t\t\t<arg value=\"Default-Portrait@2x.png\"/>\t\t\t\t\t\t<!-- ipad pro (portrait) -->\n\t\t\t<arg value=\"Default-Landscape@2x.png\"/>\t\t\t\t\t\t<!-- ipad pro (landscape) -->\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${assets.path}\"/>\n\t\t\t<arg line=\"images/atlas@2x.png images/atlas@2x.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${output.path}\"/>\n\t\t\t<arg value=\"TileList.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"-check-android-properties\">\n\t\t<fail unless=\"android.certificate.path\"/>\n\t\t<fail unless=\"android.certificate.password\"/>\n\t</target>\n\t<target name=\"build-android\" depends=\"-check-android-properties,build-air-swf\">\n\t\t<echo message=\"Packaging TileList.apk\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"-target\"/>\n\t\t\t<arg value=\"apk-captive-runtime\"/>\n\t\t\t<arg value=\"-storetype\"/>\n\t\t\t<arg value=\"pkcs12\"/>\n\t\t\t<arg value=\"-keystore\"/>\n\t\t\t<arg value=\"${android.certificate.path}\"/>\n\t\t\t<arg value=\"-storepass\"/>\n\t\t\t<arg value=\"${android.certificate.password}\"/>\n\t\t\t<arg value=\"${output.path}/TileList.apk\"/>\n\t\t\t<arg value=\"source/TileList-app.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${icon.path}\"/>\n\t\t\t<arg line=\"icon29.png icon48.png icon50.png icon57.png icon58.png icon72.png icon87.png icon96.png icon100.png icon114.png icon128.png icon144.png icon180.png\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${assets.path}\"/>\n\t\t\t<arg line=\"images/atlas@2x.png images/atlas@2x.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${output.path}\"/>\n\t\t\t<arg value=\"TileList.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"install-android\">\n\t\t<echo message=\"Installing TileList.apk\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"false\">\n\t\t\t<arg value=\"-uninstallApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"android\"/>\n\t\t\t<arg value=\"-appid\"/>\n\t\t\t<arg value=\"com.feathersui.examples.TileList\"/>\n\t\t</java>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-installApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"android\"/>\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"${output.path}/TileList.apk\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"install-ios\">\n\t\t<echo message=\"Installing TileList.ipa\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"false\">\n\t\t\t<arg value=\"-uninstallApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"iOS\"/>\n\t\t\t<arg value=\"-appid\"/>\n\t\t\t<arg value=\"com.feathersui.examples.TileList\"/>\n\t\t</java>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-installApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"iOS\"/>\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"${output.path}/TileList.ipa\"/>\n\t\t</java>\n\t</target>\n</project>"
  },
  {
    "path": "examples/TileList/source/TileList-app.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<application xmlns=\"http://ns.adobe.com/air/application/32.0\">\n\t<id>com.feathersui.examples.TileList</id>\n\t<filename>Tile List</filename>\n\t<name>Tile List</name>\n\t<versionNumber>4.2.0</versionNumber>\n\t<description>TileList example application built with Feathers UI controls for Starling</description>\n\t<copyright>2021 Bowler Hat LLC</copyright>\n\n\t<initialWindow>\n\t\t<content>TileList.swf</content>\n\t\t<autoOrients>true</autoOrients>\n\t\t<fullScreen>true</fullScreen>\n\t\t<visible>true</visible>\n\t\t<renderMode>direct</renderMode>\n\t</initialWindow>\n\n\t<supportedLanguages>en</supportedLanguages>\n\n\t<icon>\n\t\t<image29x29>icon29.png</image29x29>\n\t\t<image48x48>icon48.png</image48x48>\n\t\t<image50x50>icon50.png</image50x50>\n\t\t<image57x57>icon57.png</image57x57>\n\t\t<image58x58>icon58.png</image58x58>\n\t\t<image72x72>icon72.png</image72x72>\n\t\t<image87x87>icon87.png</image87x87>\n\t\t<image96x96>icon96.png</image96x96>\n\t\t<image100x100>icon100.png</image100x100>\n\t\t<image114x114>icon114.png</image114x114>\n\t\t<image128x128>icon128.png</image128x128>\n\t\t<image144x144>icon144.png</image144x144>\n\t\t<image180x180>icon180.png</image180x180>\n\t</icon>\n\t<android>\n\t\t<colorDepth>16bit</colorDepth>\n\t\t<manifestAdditions><![CDATA[\n\t\t\t<manifest android:installLocation=\"auto\">\n\t\t\t    <uses-permission android:name=\"android.permission.INTERNET\"/>\n\t\t\t</manifest>\n\t\t]]></manifestAdditions>\n\t</android>\n\t<iPhone>\n\t\t<InfoAdditions>\n\t\t<![CDATA[\n\t\t\t<key>UIDeviceFamily</key> \n\t\t\t<array> \n\t\t\t\t<string>1</string>\n\t\t\t\t<string>2</string>\n\t\t\t</array>\n\t\t\t<key>UIPrerenderedIcon</key>\n\t\t\t<true/>\n\t\t]]> \n\t\t</InfoAdditions>\n\t\t<requestedDisplayResolution>high</requestedDisplayResolution>\n\t</iPhone>\n</application>"
  },
  {
    "path": "examples/TileList/source/TileList.as",
    "content": "package\n{\n\timport feathers.examples.tileList.Main;\n\timport feathers.utils.ScreenDensityScaleFactorManager;\n\n\timport flash.display.Loader;\n\timport flash.display.Sprite;\n\timport flash.display.StageAlign;\n\timport flash.display.StageOrientation;\n\timport flash.display.StageScaleMode;\n\timport flash.display3D.Context3DProfile;\n\timport flash.display3D.Context3DRenderMode;\n\timport flash.events.Event;\n\timport flash.filesystem.File;\n\timport flash.filesystem.FileMode;\n\timport flash.filesystem.FileStream;\n\timport flash.system.Capabilities;\n\timport flash.utils.ByteArray;\n\n\timport starling.core.Starling;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#ffffff\")]\n\tpublic class TileList extends Sprite\n\t{\n\t\tpublic function TileList()\n\t\t{\n\t\t\tif(this.stage)\n\t\t\t{\n\t\t\t\tthis.stage.scaleMode = StageScaleMode.NO_SCALE;\n\t\t\t\tthis.stage.align = StageAlign.TOP_LEFT;\n\t\t\t}\n\t\t\tthis.mouseEnabled = this.mouseChildren = false;\n\t\t\tthis.showLaunchImage();\n\t\t\tthis.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);\n\t\t}\n\n\t\tprivate var _starling:Starling;\n\t\tprivate var _scaler:ScreenDensityScaleFactorManager;\n\t\tprivate var _launchImage:Loader;\n\t\tprivate var _savedAutoOrients:Boolean;\n\n\t\t/**\n\t\t * On iOS, add the native launch image to the classic display list to\n\t\t * avoid displaying only the stage background color between when the\n\t\t * AIR app finishes launching and Starling starts rendering.\n\t\t * \n\t\t * Launch image names: https://forums.adobe.com/message/9986239#9986239\n\t\t */\n\t\tprivate function showLaunchImage():void\n\t\t{\n\t\t\tvar filePath:String = null;\n\t\t\tvar isPortraitOnly:Boolean = false;\n\t\t\tif(Capabilities.manufacturer.indexOf(\"iOS\") >= 0)\n\t\t\t{\n\t\t\t\tvar isPortraitUpsideDown:Boolean = this.stage.orientation == StageOrientation.UPSIDE_DOWN;\n\t\t\t\tvar isPortrait:Boolean = this.stage.orientation == StageOrientation.DEFAULT || isPortraitUpsideDown;\n\t\t\t\tvar isLandscapeRight:Boolean = this.stage.orientation == StageOrientation.ROTATED_RIGHT;\n\t\t\t\tif(Capabilities.screenResolutionX == 1242 && Capabilities.screenResolutionY == 2208)\n\t\t\t\t{\n\t\t\t\t\t//iphone 6/7/8 plus\n\t\t\t\t\tfilePath = isPortrait ? \"Default-414w-736h@3x~iphone.png\" : \"Default-Landscape-414w-736h@3x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 1125 && Capabilities.screenResolutionY == 2436)\n\t\t\t\t{\n\t\t\t\t\t//iphone x\n\t\t\t\t\tfilePath = isPortrait ? \"Default-812h@3x~iphone.png\" : \"Default-Landscape-812h@3x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 2048 && Capabilities.screenResolutionY == 2732)\n\t\t\t\t{\n\t\t\t\t\t//ipad pro\n\t\t\t\t\tfilePath = isPortrait ? \"Default-Portrait@2x.png\" : \"Default-Landscape@2x.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 1536 && Capabilities.screenResolutionY == 2048)\n\t\t\t\t{\n\t\t\t\t\t//ipad 3/air\n\t\t\t\t\tif(isPortraitUpsideDown)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Portrait@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isPortrait)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-PortraitUpsideDown@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isLandscapeRight)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeRight@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeLeft@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 768 && Capabilities.screenResolutionY == 1024)\n\t\t\t\t{\n\t\t\t\t\t//ipad 1/2\n\t\t\t\t\tif(isPortraitUpsideDown)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Portrait~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isPortrait)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-PortraitUpsideDown~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isLandscapeRight)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeRight~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Landscape~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 750)\n\t\t\t\t{\n\t\t\t\t\t//iphone 6/7/8\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tfilePath = \"Default-375w-667h@2x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 640)\n\t\t\t\t{\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tif(Capabilities.screenResolutionY == 1136)\n\t\t\t\t\t{\n\t\t\t\t\t\t//iphone 5/5c/5s\n\t\t\t\t\t\tfilePath = \"Default-568h@2x~iphone.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//iphone 4/4s\n\t\t\t\t\t\tfilePath = \"Default@2x~iphone.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 320)\n\t\t\t\t{\n\t\t\t\t\t//iphone 3gs\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tfilePath = \"Default~iphone.png\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(filePath)\n\t\t\t{\n\t\t\t\tvar file:File = File.applicationDirectory.resolvePath(filePath);\n\t\t\t\tif(file.exists)\n\t\t\t\t{\n\t\t\t\t\tvar bytes:ByteArray = new ByteArray();\n\t\t\t\t\tvar stream:FileStream = new FileStream();\n\t\t\t\t\tstream.open(file, FileMode.READ);\n\t\t\t\t\tstream.readBytes(bytes, 0, stream.bytesAvailable);\n\t\t\t\t\tstream.close();\n\t\t\t\t\tthis._launchImage = new Loader();\n\t\t\t\t\tthis._launchImage.loadBytes(bytes);\n\t\t\t\t\tthis.addChild(this._launchImage);\n\t\t\t\t\tthis._savedAutoOrients = this.stage.autoOrients;\n\t\t\t\t\tthis.stage.autoOrients = false;\n\t\t\t\t\tif(isPortraitOnly)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.stage.setOrientation(StageOrientation.DEFAULT);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function loaderInfo_completeHandler(event:Event):void\n\t\t{\n\t\t\tStarling.multitouchEnabled = true;\n\t\t\tthis._starling = new Starling(Main, this.stage, null, null, Context3DRenderMode.AUTO, Context3DProfile.BASELINE);\n\t\t\tthis._starling.supportHighResolutions = true;\n\t\t\tthis._starling.skipUnchangedFrames = true;\n\t\t\tthis._starling.start();\n\t\t\tif(this._launchImage)\n\t\t\t{\n\t\t\t\tthis._starling.addEventListener(\"rootCreated\", starling_rootCreatedHandler);\n\t\t\t}\n\t\t\tthis._scaler = new ScreenDensityScaleFactorManager(this._starling);\n\n\t\t\tthis.stage.addEventListener(Event.DEACTIVATE, stage_deactivateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function starling_rootCreatedHandler(event:Object):void\n\t\t{\n\t\t\tif(this._launchImage)\n\t\t\t{\n\t\t\t\tthis.removeChild(this._launchImage);\n\t\t\t\tthis._launchImage.unloadAndStop(true);\n\t\t\t\tthis._launchImage = null;\n\t\t\t\tthis.stage.autoOrients = this._savedAutoOrients;\n\t\t\t}\n\t\t}\n\n\t\tprivate function stage_deactivateHandler(event:Event):void\n\t\t{\n\t\t\tthis._starling.stop(true);\n\t\t\tthis.stage.addEventListener(Event.ACTIVATE, stage_activateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function stage_activateHandler(event:Event):void\n\t\t{\n\t\t\tthis.stage.removeEventListener(Event.ACTIVATE, stage_activateHandler);\n\t\t\tthis._starling.start();\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "examples/TileList/source/TileListWeb.as",
    "content": "package\n{\n\timport feathers.system.DeviceCapabilities;\n\n\timport flash.display.MovieClip;\n\timport flash.display.StageAlign;\n\timport flash.display.StageScaleMode;\n\timport flash.events.Event;\n\timport flash.geom.Rectangle;\n\timport flash.ui.ContextMenu;\n\timport flash.utils.getDefinitionByName;\n\n\timport starling.core.Starling;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#ffffff\")]\n\tpublic class TileListWeb extends MovieClip\n\t{\n\t\tpublic function TileListWeb()\n\t\t{\n\t\t\tvar menu:ContextMenu = new ContextMenu();\n\t\t\tmenu.hideBuiltInItems();\n\t\t\tthis.contextMenu = menu;\n\n\t\t\tif(this.stage)\n\t\t\t{\n\t\t\t\tthis.stage.align = StageAlign.TOP_LEFT;\n\t\t\t\tthis.stage.scaleMode = StageScaleMode.NO_SCALE;\n\t\t\t}\n\n\t\t\tthis.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);\n\t\t}\n\n\t\tprivate var _starling:Starling;\n\n\t\tprivate function start():void\n\t\t{\n\t\t\tthis.gotoAndStop(2);\n\n\t\t\t//simulating iPhone Retina\n\t\t\tDeviceCapabilities.dpi = 326;\n\n\t\t\tvar MainType:Class = getDefinitionByName(\"feathers.examples.tileList.Main\") as Class;\n\t\t\tthis._starling = new Starling(MainType, this.stage, new Rectangle(0, 0, 960, 640));\n\t\t\tthis._starling.supportHighResolutions = true;\n\t\t\tthis._starling.skipUnchangedFrames = true;\n\t\t\tthis._starling.stage.stageWidth = 480;\n\t\t\tthis._starling.stage.stageHeight = 320;\n\t\t\tthis._starling.start();\n\t\t}\n\n\t\tprivate function loaderInfo_completeHandler(event:Event):void\n\t\t{\n\t\t\tthis.start();\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/TileList/source/feathers/examples/tileList/Main.as",
    "content": "package feathers.examples.tileList\n{\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.List;\n\timport feathers.controls.PageIndicator;\n\timport feathers.controls.ScrollBarDisplayMode;\n\timport feathers.controls.ScrollPolicy;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.renderers.IListItemRenderer;\n\timport feathers.data.ArrayCollection;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.layout.Direction;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.RelativePosition;\n\timport feathers.layout.TiledRowsLayout;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.themes.MinimalMobileTheme;\n\n\timport starling.events.Event;\n\timport starling.textures.TextureAtlas;\n\timport starling.utils.AssetManager;\n\n\tpublic class Main extends LayoutGroup\n\t{\n\t\tpublic function Main()\n\t\t{\n\t\t\tnew MinimalMobileTheme();\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _assetManager:AssetManager;\n\t\tprivate var _list:List;\n\t\tprivate var _pageIndicator:PageIndicator;\n\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//don't forget to clean up textures and things!\n\t\t\tif(this._assetManager)\n\t\t\t{\n\t\t\t\tthis._assetManager.dispose();\n\t\t\t\tthis._assetManager = null;\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//don't forget to call super.initialize()\n\t\t\tsuper.initialize();\n\t\t\t\n\t\t\t//a nice, fluid layout\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\t//the page indicator can be used to scroll the list\n\t\t\tthis._pageIndicator = new PageIndicator();\n\t\t\tthis._pageIndicator.direction = Direction.HORIZONTAL;\n\t\t\tthis._pageIndicator.pageCount = 1;\n\n\t\t\t//we listen to the change event to update the list's scroll position\n\t\t\tthis._pageIndicator.addEventListener(Event.CHANGE, pageIndicator_changeHandler);\n\n\t\t\t//we'll position the page indicator on the bottom and stretch its\n\t\t\t//width to fill the container's width\n\t\t\tvar pageIndicatorLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tpageIndicatorLayoutData.bottom = 0;\n\t\t\tpageIndicatorLayoutData.left = 0;\n\t\t\tpageIndicatorLayoutData.right = 0;\n\t\t\tthis._pageIndicator.layoutData = pageIndicatorLayoutData;\n\n\t\t\tthis.addChild(this._pageIndicator);\n\n\t\t\tthis._list = new List();\n\t\t\tthis._list.itemRendererFactory = tileListItemRendererFactory;\n\t\t\tthis._list.snapToPages = true;\n\t\t\tthis._list.scrollBarDisplayMode = ScrollBarDisplayMode.NONE;\n\t\t\tthis._list.horizontalScrollPolicy = ScrollPolicy.ON;\n\t\t\tthis._list.verticalScrollPolicy = ScrollPolicy.OFF;\n\n\t\t\tvar listLayout:TiledRowsLayout = new TiledRowsLayout();\n\t\t\tlistLayout.paging = Direction.HORIZONTAL;\n\t\t\tlistLayout.useSquareTiles = false;\n\t\t\tlistLayout.tileHorizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\tlistLayout.tileVerticalAlign = HorizontalAlign.JUSTIFY;\n\t\t\tlistLayout.horizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\tlistLayout.verticalAlign = VerticalAlign.TOP;\n\t\t\tlistLayout.requestedColumnCount = 4;\n\t\t\tlistLayout.distributeWidths = true;\n\t\t\tthis._list.layout = listLayout;\n\n\t\t\t//we listen to the scroll event to update the page indicator\n\t\t\tthis._list.addEventListener(Event.SCROLL, list_scrollHandler);\n\n\t\t\t//the list fills the container's width and the remaining height\n\t\t\t//above the page indicator\n\t\t\tvar listLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tlistLayoutData.top = 0;\n\t\t\tlistLayoutData.right = 0;\n\t\t\tlistLayoutData.bottom = 0;\n\t\t\tlistLayoutData.bottomAnchorDisplayObject = this._pageIndicator;\n\t\t\tlistLayoutData.left = 0;\n\t\t\tthis._list.layoutData = listLayoutData;\n\n\t\t\tthis.addChild(this._list);\n\t\t\t\n\t\t\tthis.loadIcons();\n\t\t}\n\t\t\n\t\tprotected function loadIcons():void\n\t\t{\n\t\t\tthis._assetManager = new AssetManager(2);\n\t\t\tthis._assetManager.enqueue(\"images/atlas@2x.png\");\n\t\t\tthis._assetManager.enqueue(\"images/atlas@2x.xml\");\n\t\t\tthis._assetManager.loadQueue(assetManager_onProgress);\n\t\t}\n\t\t\n\t\tprotected function tileListItemRendererFactory():IListItemRenderer\n\t\t{\n\t\t\tvar itemRenderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\t\t\titemRenderer.labelField = \"label\";\n\t\t\titemRenderer.iconSourceField = \"texture\";\n\t\t\titemRenderer.iconPosition = RelativePosition.TOP;\n\t\t\titemRenderer.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\titemRenderer.verticalAlign = VerticalAlign.BOTTOM;\n\t\t\titemRenderer.maxWidth = 80;\n\t\t\titemRenderer.gap = 2;\n\t\t\treturn itemRenderer;\n\t\t}\n\n\t\tprotected function list_scrollHandler(event:Event):void\n\t\t{\n\t\t\tthis._pageIndicator.pageCount = this._list.horizontalPageCount;\n\t\t\tthis._pageIndicator.selectedIndex = this._list.horizontalPageIndex;\n\t\t}\n\n\t\tprotected function pageIndicator_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis._list.scrollToPageIndex(this._pageIndicator.selectedIndex, 0, this._list.pageThrowDuration);\n\t\t}\n\t\t\n\t\tprotected function assetManager_onProgress(ratio:Number):void\n\t\t{\n\t\t\tif(ratio < 1)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//get the texture atlas from the asset manager\n\t\t\tvar atlas:TextureAtlas = this._assetManager.getTextureAtlas(\"atlas@2x\");\n\t\t\t\n\t\t\t//populate the list using the textures\n\t\t\tthis._list.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ label: \"Behance\", texture: atlas.getTexture(\"behance\") },\n\t\t\t\t{ label: \"Blogger\", texture: atlas.getTexture(\"blogger\") },\n\t\t\t\t{ label: \"Delicious\", texture: atlas.getTexture(\"delicious\") },\n\t\t\t\t{ label: \"DeviantArt\", texture: atlas.getTexture(\"deviantart\") },\n\t\t\t\t{ label: \"Digg\", texture: atlas.getTexture(\"digg\") },\n\t\t\t\t{ label: \"Dribbble\", texture: atlas.getTexture(\"dribbble\") },\n\t\t\t\t{ label: \"Facebook\", texture: atlas.getTexture(\"facebook\") },\n\t\t\t\t{ label: \"Flickr\", texture: atlas.getTexture(\"flickr\") },\n\t\t\t\t{ label: \"Github\", texture: atlas.getTexture(\"github\") },\n\t\t\t\t{ label: \"Google\", texture: atlas.getTexture(\"google\") },\n\t\t\t\t{ label: \"Instagram\", texture: atlas.getTexture(\"instagram\") },\n\t\t\t\t{ label: \"LinkedIn\", texture: atlas.getTexture(\"linkedin\") },\n\t\t\t\t{ label: \"Pinterest\", texture: atlas.getTexture(\"pinterest\") },\n\t\t\t\t{ label: \"Snapchat\", texture: atlas.getTexture(\"snapchat\") },\n\t\t\t\t{ label: \"SoundCloud\", texture: atlas.getTexture(\"soundcloud\") },\n\t\t\t\t{ label: \"StackOverflow\", texture: atlas.getTexture(\"stackoverflow\") },\n\t\t\t\t{ label: \"StumbleUpon\", texture: atlas.getTexture(\"stumbleupon\") },\n\t\t\t\t{ label: \"Tumblr\", texture: atlas.getTexture(\"tumblr\") },\n\t\t\t\t{ label: \"Twitter\", texture: atlas.getTexture(\"twitter\") },\n\t\t\t\t{ label: \"Vimeo\", texture: atlas.getTexture(\"vimeo\") },\n\t\t\t\t{ label: \"Vine\", texture: atlas.getTexture(\"vine\") },\n\t\t\t\t{ label: \"WordPress\", texture: atlas.getTexture(\"wordpress\") },\n\t\t\t\t{ label: \"Yahoo!\", texture: atlas.getTexture(\"yahoo\") },\n\t\t\t\t{ label: \"Yelp\", texture: atlas.getTexture(\"yelp\") },\n\t\t\t\t{ label: \"YouTube\", texture: atlas.getTexture(\"youtube\") },\n\t\t\t]);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/Todos/README.md",
    "content": "# Todos Example for Feathers\n\nThis [Feathers UI](http://feathersui.com/) example mocks up a simple application to track things that need to get done. The app can add and remove todo items, mark them as completed, and it even supports drag and drop to change the order of items. A custom list item renderer based on the `LayoutGroup` component is used, and it can switch between a normal checkbox and label and an editable mode that adds a drag handle and a delete button.\n\n## Requirements\n\nIn addition to Starling Framework and Feathers, this example project requires the `MetalWorksMobileTheme` example theme. You can find the SWC file for this theme at the following location in the Feathers release build:\n\n\tthemes/MetalWorksMobileTheme/swc/MetalWorksMobileTheme.swc\n\n## Web Demo\n\nView the [Todos example](http://feathersui.com/examples/todos/) in your browser."
  },
  {
    "path": "examples/Todos/build.properties",
    "content": "feathers.root = ${basedir}/../../source\nstarling.root = ${basedir}/../../third-party/starling\ntheme.root = ${basedir}/../../themes/MetalWorksMobileTheme/source\noutput.path = ${basedir}/output\nicon.path = ${basedir}/../shared-assets/icons\nlaunch.image.path = ${basedir}/../shared-assets/launch-images-windowed\n\nswf.version = 30"
  },
  {
    "path": "examples/Todos/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<project name=\"todos\" default=\"build\" basedir=\".\">\n\t\n\t<!-- build.local.properties and sdk.local.proprties are optional files that\n\t\tcan be used to override the default properties. -->\n\t<property file=\"./build.local.properties\"/>\n\t<property file=\"./sdk.local.properties\"/>\n\t<property file=\"./build.properties\"/>\n\t<!-- inherit SDK properties from the root of the repository -->\n\t<property file=\"../../sdk.local.properties\"/>\n\t<property file=\"../../sdk.properties\"/>\n\n\t<target name=\"build\" depends=\"build-web,build-android,build-ios\"/>\n\n\t<target name=\"prepare\">\n\t\t<delete dir=\"${output.path}\"/>\n\t</target>\n\n\t<target name=\"build-web\" depends=\"prepare\">\n\t\t<echo message=\"Building TodosWeb.swf\"/>\n\t\t<java jar=\"${mxmlc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${flashplayer.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-advanced-telemetry=true\"/>\n\t\t\t<arg value=\"-frame=two,feathers.examples.todos.Main\"/>\n\t\t\t<arg value=\"-source-path+=source\"/>\n\t\t\t<arg value=\"-source-path+=${starling.root}\"/>\n\t\t\t<arg value=\"-source-path+=${feathers.root}\"/>\n\t\t\t<arg value=\"-source-path+=${theme.root}\"/>\n\t\t\t<arg value=\"source/TodosWeb.as\"/>\n\t\t\t<arg value=\"-output=${output.path}/TodosWeb.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"build-air-swf\" depends=\"prepare\">\n\t\t<echo message=\"Building Todos.swf\"/>\n\t\t<java jar=\"${mxmlc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${airmobile.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-advanced-telemetry=true\"/>\n\t\t\t<arg value=\"-source-path+=source\"/>\n\t\t\t<arg value=\"-source-path+=${starling.root}\"/>\n\t\t\t<arg value=\"-source-path+=${feathers.root}\"/>\n\t\t\t<arg value=\"-source-path+=${theme.root}\"/>\n\t\t\t<arg value=\"source/Todos.as\"/>\n\t\t\t<arg value=\"-output=${output.path}/Todos.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"-check-ios-properties\">\n\t\t<fail unless=\"ios.provision.path\"/>\n\t\t<fail unless=\"ios.certificate.path\"/>\n\t\t<fail unless=\"ios.certificate.password\"/>\n\t</target>\n\t<target name=\"build-ios\" depends=\"-check-ios-properties,build-air-swf\">\n\t\t<echo message=\"Packaging Todos.ipa\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"-target\"/>\n\t\t\t<arg value=\"ipa-app-store\"/>\n\t\t\t<!-- uncomment for actionscript sampling with scout on ios -->\n\t\t\t<!--<arg value=\"-sampler\"/>-->\n\t\t\t<arg value=\"-provisioning-profile\"/>\n\t\t\t<arg value=\"${ios.provision.path}\"/>\n\t\t\t<arg value=\"-keystore\"/>\n\t\t\t<arg value=\"${ios.certificate.path}\"/>\n\t\t\t<arg value=\"-storetype\"/>\n\t\t\t<arg value=\"pkcs12\"/>\n\t\t\t<arg value=\"-storepass\"/>\n\t\t\t<arg value=\"${ios.certificate.password}\"/>\n\t\t\t<arg value=\"${output.path}/Todos.ipa\"/>\n\t\t\t<arg value=\"source/Todos-app.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${icon.path}\"/>\n\t\t\t<arg line=\"icon29.png icon48.png icon50.png icon57.png icon58.png icon72.png icon87.png icon96.png icon100.png icon114.png icon128.png icon144.png icon180.png\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${launch.image.path}\"/>\n\t\t\t<arg value=\"Default~iphone.png\"/>\t\t\t\t\t\t\t<!-- iphone 3gs -->\n\t\t\t<arg value=\"Default@2x~iphone.png\"/>\t\t\t\t\t\t<!-- iphone 4/4s -->\n\t\t\t<arg value=\"Default-568h@2x~iphone.png\"/>\t\t\t\t\t<!-- iphone 5/5c/5s -->\n\t\t\t<arg value=\"Default-375w-667h@2x~iphone.png\"/>\t\t\t\t<!-- iphone 6/7/8 -->\n\t\t\t<arg value=\"Default-812h@3x~iphone.png\"/>\t\t\t\t\t<!-- iphone x (portrait) -->\n\t\t\t<arg value=\"Default-Landscape-812h@3x~iphone.png\"/>\t\t\t<!-- iphone x (landscape) -->\n\t\t\t<arg value=\"Default-414w-736h@3x~iphone.png\"/>\t\t\t\t<!-- iphone 6/7/8 plus (portrait) -->\n\t\t\t<arg value=\"Default-Landscape-414w-736h@3x~iphone.png\"/>\t<!-- iphone 6/7/8 plus (landscape) -->\n\t\t\t<arg value=\"Default-Portrait~ipad.png\"/>\t\t\t\t\t<!-- ipad 1/2 (portrait) -->\n\t\t\t<arg value=\"Default-PortraitUpsideDown~ipad.png\"/>\t\t\t<!-- ipad 1/2 (portrait upside down) -->\n\t\t\t<arg value=\"Default-Landscape~ipad.png\"/>\t\t\t\t\t<!-- ipad 1/2 (landscape left) -->\n\t\t\t<arg value=\"Default-LandscapeRight~ipad.png\"/>\t\t\t\t<!-- ipad 1/2 (landscape right) -->\n\t\t\t<arg value=\"Default-Portrait@2x~ipad.png\"/>\t\t\t\t\t<!-- ipad 3/air (portrait) -->\n\t\t\t<arg value=\"Default-LandscapeLeft@2x~ipad.png\"/>\t\t\t<!-- ipad 3/air (landscape left) -->\n\t\t\t<arg value=\"Default-LandscapeRight@2x~ipad.png\"/>\t\t\t<!-- ipad 3/air (landscape right) -->\n\t\t\t<arg value=\"Default-Portrait@2x.png\"/>\t\t\t\t\t\t<!-- ipad pro (portrait) -->\n\t\t\t<arg value=\"Default-Landscape@2x.png\"/>\t\t\t\t\t\t<!-- ipad pro (landscape) -->\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${output.path}\"/>\n\t\t\t<arg value=\"Todos.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"-check-android-properties\">\n\t\t<fail unless=\"android.certificate.path\"/>\n\t\t<fail unless=\"android.certificate.password\"/>\n\t</target>\n\t<target name=\"build-android\" depends=\"-check-android-properties,build-air-swf\">\n\t\t<echo message=\"Packaging Todos.apk\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"-target\"/>\n\t\t\t<arg value=\"apk-captive-runtime\"/>\n\t\t\t<arg value=\"-storetype\"/>\n\t\t\t<arg value=\"pkcs12\"/>\n\t\t\t<arg value=\"-keystore\"/>\n\t\t\t<arg value=\"${android.certificate.path}\"/>\n\t\t\t<arg value=\"-storepass\"/>\n\t\t\t<arg value=\"${android.certificate.password}\"/>\n\t\t\t<arg value=\"${output.path}/Todos.apk\"/>\n\t\t\t<arg value=\"source/Todos-app.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${icon.path}\"/>\n\t\t\t<arg line=\"icon29.png icon48.png icon50.png icon57.png icon58.png icon72.png icon87.png icon96.png icon100.png icon114.png icon128.png icon144.png icon180.png\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${output.path}\"/>\n\t\t\t<arg value=\"Todos.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"install-android\">\n\t\t<echo message=\"Installing Todos.apk\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"false\">\n\t\t\t<arg value=\"-uninstallApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"android\"/>\n\t\t\t<arg value=\"-appid\"/>\n\t\t\t<arg value=\"com.feathersui.examples.Todos\"/>\n\t\t</java>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-installApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"android\"/>\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"${output.path}/Todos.apk\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"install-ios\">\n\t\t<echo message=\"Installing Todos.ipa\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"false\">\n\t\t\t<arg value=\"-uninstallApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"iOS\"/>\n\t\t\t<arg value=\"-appid\"/>\n\t\t\t<arg value=\"com.feathersui.examples.Todos\"/>\n\t\t</java>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-installApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"iOS\"/>\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"${output.path}/Todos.ipa\"/>\n\t\t</java>\n\t</target>\n</project>"
  },
  {
    "path": "examples/Todos/source/Todos-app.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<application xmlns=\"http://ns.adobe.com/air/application/32.0\">\n\t<id>com.feathersui.examples.Todos</id>\n\t<filename>Todos</filename>\n\t<name>Todos</name>\n\t<versionNumber>4.2.0</versionNumber>\n\t<description>Todos example application built with Feathers UI controls for Starling</description>\n\t<copyright>2021 Bowler Hat LLC</copyright>\n\n\t<initialWindow>\n\t\t<content>Todos.swf</content>\n\t\t<autoOrients>true</autoOrients>\n\t\t<fullScreen>false</fullScreen>\n\t\t<visible>true</visible>\n\t\t<renderMode>direct</renderMode>\n\t</initialWindow>\n\n\t<supportedLanguages>en</supportedLanguages>\n\n\t<icon>\n\t\t<image29x29>icon29.png</image29x29>\n\t\t<image48x48>icon48.png</image48x48>\n\t\t<image50x50>icon50.png</image50x50>\n\t\t<image57x57>icon57.png</image57x57>\n\t\t<image58x58>icon58.png</image58x58>\n\t\t<image72x72>icon72.png</image72x72>\n\t\t<image87x87>icon87.png</image87x87>\n\t\t<image96x96>icon96.png</image96x96>\n\t\t<image100x100>icon100.png</image100x100>\n\t\t<image114x114>icon114.png</image114x114>\n\t\t<image128x128>icon128.png</image128x128>\n\t\t<image144x144>icon144.png</image144x144>\n\t\t<image180x180>icon180.png</image180x180>\n\t</icon>\n\t<android>\n\t\t<colorDepth>16bit</colorDepth>\n\t\t<manifestAdditions><![CDATA[\n\t\t\t<manifest android:installLocation=\"auto\">\n\t\t\t    <uses-permission android:name=\"android.permission.INTERNET\"/>\n\t\t\t</manifest>\n\t\t]]></manifestAdditions>\n\t</android>\n\t<iPhone>\n\t\t<InfoAdditions>\n\t\t<![CDATA[\n\t\t\t<key>UIDeviceFamily</key> \n\t\t\t<array> \n\t\t\t\t<string>1</string>\n\t\t\t\t<string>2</string>\n\t\t\t</array>\n\t\t\t<key>UIPrerenderedIcon</key>\n\t\t\t<true/>\n\t\t\t<key>UIStatusBarStyle</key>\n\t\t\t<string>UIStatusBarStyleLightContent</string>\n\t\t]]> \n\t\t</InfoAdditions>\n\t\t<requestedDisplayResolution>high</requestedDisplayResolution>\n\t</iPhone>\n</application>"
  },
  {
    "path": "examples/Todos/source/Todos.as",
    "content": "package\n{\n\timport feathers.examples.todos.Main;\n\timport feathers.utils.ScreenDensityScaleFactorManager;\n\n\timport flash.display.Loader;\n\timport flash.display.Sprite;\n\timport flash.display.StageAlign;\n\timport flash.display.StageOrientation;\n\timport flash.display.StageScaleMode;\n\timport flash.display3D.Context3DProfile;\n\timport flash.display3D.Context3DRenderMode;\n\timport flash.events.Event;\n\timport flash.filesystem.File;\n\timport flash.filesystem.FileMode;\n\timport flash.filesystem.FileStream;\n\timport flash.system.Capabilities;\n\timport flash.utils.ByteArray;\n\n\timport starling.core.Starling;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#4a4137\")]\n\tpublic class Todos extends Sprite\n\t{\n\t\tpublic function Todos()\n\t\t{\n\t\t\tif(this.stage)\n\t\t\t{\n\t\t\t\tthis.stage.scaleMode = StageScaleMode.NO_SCALE;\n\t\t\t\tthis.stage.align = StageAlign.TOP_LEFT;\n\t\t\t}\n\t\t\tthis.mouseEnabled = this.mouseChildren = false;\n\t\t\tthis.showLaunchImage();\n\t\t\tthis.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);\n\t\t}\n\n\t\tprivate var _starling:Starling;\n\t\tprivate var _scaler:ScreenDensityScaleFactorManager;\n\t\tprivate var _launchImage:Loader;\n\t\tprivate var _savedAutoOrients:Boolean;\n\n\t\t/**\n\t\t * On iOS, add the native launch image to the classic display list to\n\t\t * avoid displaying only the stage background color between when the\n\t\t * AIR app finishes launching and Starling starts rendering.\n\t\t * \n\t\t * Launch image names: https://forums.adobe.com/message/9986239#9986239\n\t\t */\n\t\tprivate function showLaunchImage():void\n\t\t{\n\t\t\tvar filePath:String = null;\n\t\t\tvar isPortraitOnly:Boolean = false;\n\t\t\tif(Capabilities.manufacturer.indexOf(\"iOS\") >= 0)\n\t\t\t{\n\t\t\t\tvar isPortraitUpsideDown:Boolean = this.stage.orientation == StageOrientation.UPSIDE_DOWN;\n\t\t\t\tvar isPortrait:Boolean = this.stage.orientation == StageOrientation.DEFAULT || isPortraitUpsideDown;\n\t\t\t\tvar isLandscapeRight:Boolean = this.stage.orientation == StageOrientation.ROTATED_RIGHT;\n\t\t\t\tif(Capabilities.screenResolutionX == 1242 && Capabilities.screenResolutionY == 2208)\n\t\t\t\t{\n\t\t\t\t\t//iphone 6/7/8 plus\n\t\t\t\t\tfilePath = isPortrait ? \"Default-414w-736h@3x~iphone.png\" : \"Default-Landscape-414w-736h@3x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 1125 && Capabilities.screenResolutionY == 2436)\n\t\t\t\t{\n\t\t\t\t\t//iphone x\n\t\t\t\t\tfilePath = isPortrait ? \"Default-812h@3x~iphone.png\" : \"Default-Landscape-812h@3x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 2048 && Capabilities.screenResolutionY == 2732)\n\t\t\t\t{\n\t\t\t\t\t//ipad pro\n\t\t\t\t\tfilePath = isPortrait ? \"Default-Portrait@2x.png\" : \"Default-Landscape@2x.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 1536 && Capabilities.screenResolutionY == 2048)\n\t\t\t\t{\n\t\t\t\t\t//ipad 3/air\n\t\t\t\t\tif(isPortraitUpsideDown)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Portrait@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isPortrait)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-PortraitUpsideDown@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isLandscapeRight)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeRight@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeLeft@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 768 && Capabilities.screenResolutionY == 1024)\n\t\t\t\t{\n\t\t\t\t\t//ipad 1/2\n\t\t\t\t\tif(isPortraitUpsideDown)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Portrait~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isPortrait)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-PortraitUpsideDown~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isLandscapeRight)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeRight~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Landscape~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 750)\n\t\t\t\t{\n\t\t\t\t\t//iphone 6/7/8\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tfilePath = \"Default-375w-667h@2x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 640)\n\t\t\t\t{\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tif(Capabilities.screenResolutionY == 1136)\n\t\t\t\t\t{\n\t\t\t\t\t\t//iphone 5/5c/5s\n\t\t\t\t\t\tfilePath = \"Default-568h@2x~iphone.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//iphone 4/4s\n\t\t\t\t\t\tfilePath = \"Default@2x~iphone.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 320)\n\t\t\t\t{\n\t\t\t\t\t//iphone 3gs\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tfilePath = \"Default~iphone.png\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(filePath)\n\t\t\t{\n\t\t\t\tvar file:File = File.applicationDirectory.resolvePath(filePath);\n\t\t\t\tif(file.exists)\n\t\t\t\t{\n\t\t\t\t\tvar bytes:ByteArray = new ByteArray();\n\t\t\t\t\tvar stream:FileStream = new FileStream();\n\t\t\t\t\tstream.open(file, FileMode.READ);\n\t\t\t\t\tstream.readBytes(bytes, 0, stream.bytesAvailable);\n\t\t\t\t\tstream.close();\n\t\t\t\t\tthis._launchImage = new Loader();\n\t\t\t\t\tthis._launchImage.loadBytes(bytes);\n\t\t\t\t\tthis.addChild(this._launchImage);\n\t\t\t\t\tthis._savedAutoOrients = this.stage.autoOrients;\n\t\t\t\t\tthis.stage.autoOrients = false;\n\t\t\t\t\tif(isPortraitOnly)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.stage.setOrientation(StageOrientation.DEFAULT);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function loaderInfo_completeHandler(event:Event):void\n\t\t{\n\t\t\tStarling.multitouchEnabled = true;\n\t\t\tthis._starling = new Starling(Main, this.stage, null, null, Context3DRenderMode.AUTO, Context3DProfile.BASELINE);\n\t\t\tthis._starling.supportHighResolutions = true;\n\t\t\tthis._starling.skipUnchangedFrames = true;\n\t\t\tthis._starling.start();\n\t\t\tif(this._launchImage)\n\t\t\t{\n\t\t\t\tthis._starling.addEventListener(\"rootCreated\", starling_rootCreatedHandler);\n\t\t\t}\n\t\t\tthis._scaler = new ScreenDensityScaleFactorManager(this._starling);\n\n\t\t\tthis.stage.addEventListener(Event.DEACTIVATE, stage_deactivateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function starling_rootCreatedHandler(event:Object):void\n\t\t{\n\t\t\tif(this._launchImage)\n\t\t\t{\n\t\t\t\tthis.removeChild(this._launchImage);\n\t\t\t\tthis._launchImage.unloadAndStop(true);\n\t\t\t\tthis._launchImage = null;\n\t\t\t\tthis.stage.autoOrients = this._savedAutoOrients;\n\t\t\t}\n\t\t}\n\n\t\tprivate function stage_deactivateHandler(event:Event):void\n\t\t{\n\t\t\tthis._starling.stop(true);\n\t\t\tthis.stage.addEventListener(Event.ACTIVATE, stage_activateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function stage_activateHandler(event:Event):void\n\t\t{\n\t\t\tthis.stage.removeEventListener(Event.ACTIVATE, stage_activateHandler);\n\t\t\tthis._starling.start();\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "examples/Todos/source/TodosWeb.as",
    "content": "package\n{\n\timport feathers.system.DeviceCapabilities;\n\n\timport flash.display.MovieClip;\n\timport flash.display.StageAlign;\n\timport flash.display.StageScaleMode;\n\timport flash.events.Event;\n\timport flash.geom.Rectangle;\n\timport flash.ui.ContextMenu;\n\timport flash.utils.getDefinitionByName;\n\n\timport starling.core.Starling;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#4a4137\")]\n\tpublic class TodosWeb extends MovieClip\n\t{\n\t\tpublic function TodosWeb()\n\t\t{\n\t\t\tvar menu:ContextMenu = new ContextMenu();\n\t\t\tmenu.hideBuiltInItems();\n\t\t\tthis.contextMenu = menu;\n\t\t\t\n\t\t\tif(this.stage)\n\t\t\t{\n\t\t\t\tthis.stage.align = StageAlign.TOP_LEFT;\n\t\t\t\tthis.stage.scaleMode = StageScaleMode.NO_SCALE;\n\t\t\t}\n\t\t\t\n\t\t\tthis.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);\n\t\t}\n\t\t\n\t\tprivate var _starling:Starling;\n\t\t\n\t\tprivate function start():void\n\t\t{\n\t\t\tthis.gotoAndStop(2);\n\t\t\tthis.graphics.clear();\n\n\t\t\t//simulating iPhone Retina\n\t\t\tDeviceCapabilities.dpi = 326;\n\t\t\t\n\t\t\tStarling.multitouchEnabled = true;\n\t\t\tvar MainType:Class = getDefinitionByName(\"feathers.examples.todos.Main\") as Class;\n\t\t\tthis._starling = new Starling(MainType, this.stage, new Rectangle(0, 0, 960, 640));\n\t\t\tthis._starling.supportHighResolutions = true;\n\t\t\tthis._starling.skipUnchangedFrames = true;\n\t\t\tthis._starling.stage.stageWidth = 480;\n\t\t\tthis._starling.stage.stageHeight = 320;\n\t\t\tthis._starling.start();\n\t\t}\n\t\t\n\t\tprivate function loaderInfo_completeHandler(event:Event):void\n\t\t{\n\t\t\tthis.start();\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/Todos/source/feathers/examples/todos/Main.as",
    "content": "package feathers.examples.todos\n{\n\timport feathers.controls.Alert;\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.List;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.TabBar;\n\timport feathers.controls.TextInput;\n\timport feathers.controls.ToggleButton;\n\timport feathers.controls.text.StageTextTextEditor;\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.ITextEditor;\n\timport feathers.data.ArrayCollection;\n\timport feathers.data.VectorCollection;\n\timport feathers.events.FeathersEventType;\n\timport feathers.examples.todos.TodoItem;\n\timport feathers.examples.todos.controls.TodoItemRenderer;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.layout.HorizontalLayoutData;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport flash.net.SharedObject;\n\timport feathers.controls.renderers.IListItemRenderer;\n\timport flash.net.registerClassAlias;\n\n\tpublic class Main extends PanelScreen\n\t{\n\t\tpublic function Main()\n\t\t{\n\t\t\t//set up the theme right away!\n\t\t\tnew TodosTheme();\n\t\t\tsuper();\n\t\t\t\n\t\t\tregisterClassAlias(\"feathers.examples.todos.TodoItem\", TodoItem);\n\t\t\tthis._sharedObject = SharedObject.getLocal(\"todos\");\n\n\t\t\tthis.addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);\n\t\t\tthis.addEventListener(Event.REMOVED_FROM_STAGE, removedFromStageHandler);\n\t\t}\n\n\t\tprivate var _list:List;\n\t\tprivate var _tabs:TabBar;\n\t\tprivate var _toolbar:LayoutGroup;\n\t\tprivate var _input:TextInput;\n\t\tprivate var _clearButton:Button;\n\t\tprivate var _editButton:ToggleButton;\n\t\tprivate var _items:VectorCollection;\n\t\tprivate var _sharedObject:SharedObject;\n\n\t\tprivate function customHeaderFactory():IFeathersControl\n\t\t{\n\t\t\tvar header:Header = new Header();\n\n\t\t\tif(!this._editButton)\n\t\t\t{\n\t\t\t\tthis._editButton = new ToggleButton();\n\t\t\t\tthis._editButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_QUIET_BUTTON);\n\t\t\t\tthis._editButton.label = \"Edit\";\n\t\t\t\tthis._editButton.addEventListener(Event.CHANGE, editButton_changeHandler);\n\t\t\t}\n\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tthis._editButton\n\t\t\t];\n\n\t\t\treturn header;\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"TODOS\";\n\n\t\t\tthis.width = this.stage.stageWidth;\n\t\t\tthis.height = this.stage.stageHeight;\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\tthis._tabs = new TabBar();\n\t\t\tthis._tabs.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{label: \"All\"},\n\t\t\t\t{label: \"Active\"},\n\t\t\t\t{label: \"Completed\"},\n\t\t\t]);\n\t\t\tthis._tabs.addEventListener(Event.CHANGE, tabs_changeHandler);\n\t\t\tthis.addChild(this._tabs);\n\n\t\t\tvar itemsToRestore:Vector.<TodoItem> = this._sharedObject.data.items;\n\t\t\tif(!itemsToRestore)\n\t\t\t{\n\t\t\t\t//if the shared object is empty, create a new vector\n\t\t\t\titemsToRestore = new <TodoItem>[];\n\t\t\t}\n\t\t\tthis._items = new VectorCollection(itemsToRestore);\n\n\t\t\tthis._list = new List();\n\t\t\tthis._list.isSelectable = false;\n\t\t\tthis._list.dataProvider = this._items;\n\t\t\tthis._list.itemRendererFactory = function():IListItemRenderer\n\t\t\t{\n\t\t\t\tvar itemRenderer:TodoItemRenderer = new TodoItemRenderer();\n\t\t\t\titemRenderer.addEventListener(Event.CHANGE, itemRenderer_changeHandler);\n\t\t\t\titemRenderer.addEventListener(TodoItemRenderer.EVENT_DELETE_ITEM, itemRenderer_deleteItemHandler);\n\t\t\t\treturn itemRenderer;\n\t\t\t};\n\t\t\tthis.addChild(this._list);\n\n\t\t\tthis._toolbar = new LayoutGroup();\n\t\t\tthis._toolbar.styleNameList.add(LayoutGroup.ALTERNATE_STYLE_NAME_TOOLBAR);\n\t\t\tthis.addChild(this._toolbar);\n\n\t\t\tthis._clearButton = new Button();\n\t\t\tthis._clearButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_DANGER_BUTTON);\n\t\t\tthis._clearButton.label = \"Clear All Completed Items\";\n\t\t\tthis._clearButton.includeInLayout = false;\n\t\t\tthis._clearButton.visible = false;\n\t\t\tthis._clearButton.addEventListener(Event.TRIGGERED, clearButton_triggeredHandler);\n\t\t\tthis._toolbar.addChild(this._clearButton);\n\n\t\t\tthis._input = new TextInput();\n\t\t\tthis._input.prompt = \"What needs to be done?\";\n\t\t\tthis._input.textEditorFactory = function():ITextEditor\n\t\t\t{\n\t\t\t\tvar textEditor:StageTextTextEditor = FeathersControl.defaultTextEditorFactory() as StageTextTextEditor;\n\t\t\t\tif(textEditor)\n\t\t\t\t{\n\t\t\t\t\t//we can't get an enter key event without changing the value\n\t\t\t\t\t//of returnKeyLabel.\n\t\t\t\t\t//we didn't use using ReturnKeyLabel.GO here so that it will\n\t\t\t\t\t//build the demo for Flash Player. That class is AIR only.\n\t\t\t\t\ttextEditor.returnKeyLabel = \"go\";\n\t\t\t\t}\n\t\t\t\treturn textEditor;\n\t\t\t};\n\t\t\tthis._input.layoutData = new HorizontalLayoutData(100);\n\t\t\tthis._input.addEventListener(FeathersEventType.ENTER, input_enterHandler);\n\t\t\tthis._toolbar.addChild(this._input);\n\n\t\t\tvar toolbarLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\ttoolbarLayoutData.top = 0;\n\t\t\ttoolbarLayoutData.right = 0;\n\t\t\ttoolbarLayoutData.left = 0;\n\t\t\tthis._toolbar.layoutData = toolbarLayoutData;\n\n\t\t\tvar tabsLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\ttabsLayoutData.bottom = 0;\n\t\t\ttabsLayoutData.right = 0;\n\t\t\ttabsLayoutData.left = 0;\n\t\t\tthis._tabs.layoutData = tabsLayoutData;\n\n\t\t\tvar listLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tlistLayoutData.top = 0;\n\t\t\tlistLayoutData.topAnchorDisplayObject = this._toolbar;\n\t\t\tlistLayoutData.right = 0;\n\t\t\tlistLayoutData.bottom = 0;\n\t\t\tlistLayoutData.bottomAnchorDisplayObject = this._tabs;\n\t\t\tlistLayoutData.left = 0;\n\t\t\tthis._list.layoutData = listLayoutData;\n\t\t}\n\n\t\tprivate function includeActiveItems(item:TodoItem):Boolean\n\t\t{\n\t\t\treturn !item.isCompleted;\n\t\t}\n\n\t\tprivate function includeCompletedItems(item:TodoItem):Boolean\n\t\t{\n\t\t\treturn item.isCompleted;\n\t\t}\n\n\t\tprivate function refreshFilterFunction():void\n\t\t{\n\t\t\tif(this._tabs.selectedIndex === 1)\n\t\t\t{\n\t\t\t\tthis._items.filterFunction = this.includeActiveItems;\n\t\t\t}\n\t\t\telse if(this._tabs.selectedIndex === 2)\n\t\t\t{\n\t\t\t\tthis._items.filterFunction = this.includeCompletedItems;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._items.filterFunction = null;\n\t\t\t}\n\t\t}\n\n\t\tprivate function saveItems():void\n\t\t{\n\t\t\tthis._sharedObject.data.items = this._items.vectorData;\n\t\t\tthis._sharedObject.flush();\n\t\t}\n\n\t\tprivate function addedToStageHandler():void\n\t\t{\n\t\t\tthis.stage.addEventListener(Event.RESIZE, stage_resizeHandler);\n\t\t}\n\n\t\tprivate function removedFromStageHandler():void\n\t\t{\n\t\t\tthis.stage.removeEventListener(Event.RESIZE, stage_resizeHandler);\n\t\t}\n\n\t\tprivate function input_enterHandler():void\n\t\t{\n\t\t\tif(!this._input.text)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._items.addItem(new TodoItem(this._input.text));\n\t\t\tthis._input.text = \"\";\n\n\t\t\tthis.saveItems();\n\t\t}\n\n\t\tprivate function editButton_changeHandler(event:Event):void\n\t\t{\n\t\t\tvar isEditing:Boolean = this._editButton.isSelected;\n\n\t\t\tthis._list.dragEnabled = isEditing;\n\t\t\tthis._list.dropEnabled = isEditing;\n\n\t\t\tthis._clearButton.visible = isEditing;\n\t\t\tthis._clearButton.includeInLayout = isEditing;\n\n\t\t\tthis._input.visible = !isEditing;\n\t\t\tthis._input.includeInLayout = !isEditing;\n\t\t}\n\n\t\tprivate function clearButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\t//the completed items may currently be filtered, so temporarily\n\t\t\t//disable the filter.\n\t\t\tthis._items.filterFunction = null;\n\t\t\tvar hasCompletedItem:Boolean = false;\n\t\t\tvar itemCount:int = this._items.length;\n\t\t\tfor(var i:int = itemCount - 1; i >= 0; i--)\n\t\t\t{\n\t\t\t\tvar item:TodoItem = TodoItem(this._items.getItemAt(i));\n\t\t\t\tif(item.isCompleted)\n\t\t\t\t{\n\t\t\t\t\thasCompletedItem = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//be sure to restore the filter\n\t\t\tthis.refreshFilterFunction();\n\t\t\tif(!hasCompletedItem)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tAlert.show(\"Are you sure that you want to delete all completed items? This action cannot be undone.\", \"Confirm delete\",\n\t\t\t\tnew ArrayCollection(\n\t\t\t\t[\n\t\t\t\t\t{ label: \"Cancel\" },\n\t\t\t\t\t{ label: \"Delete\", triggered: confirmButton_triggeredHandler },\n\t\t\t\t]));\n\t\t}\n\n\t\tprivate function confirmButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\t//the completed items may currently be filtered, so temporarily\n\t\t\t//disable the filter.\n\t\t\tthis._items.filterFunction = null;\n\t\t\tvar itemCount:int = this._items.length;\n\t\t\tfor(var i:int = itemCount - 1; i >= 0; i--)\n\t\t\t{\n\t\t\t\tvar item:TodoItem = TodoItem(this._items.getItemAt(i));\n\t\t\t\tif(item.isCompleted)\n\t\t\t\t{\n\t\t\t\t\tthis._items.removeItemAt(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//be sure to restore the filter\n\t\t\tthis.refreshFilterFunction();\n\n\t\t\tthis.saveItems();\n\t\t}\n\n\t\tprivate function itemRenderer_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.saveItems();\n\t\t}\n\n\t\tprivate function itemRenderer_deleteItemHandler(event:Event, item:Object):void\n\t\t{\n\t\t\tthis._items.removeItem(item);\n\t\t\tthis.saveItems();\n\t\t}\n\n\t\tprivate function stage_resizeHandler():void\n\t\t{\n\t\t\tthis.width = this.stage.stageWidth;\n\t\t\tthis.height = this.stage.stageHeight;\n\t\t}\n\n\t\tprivate function tabs_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.refreshFilterFunction();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/Todos/source/feathers/examples/todos/TodoItem.as",
    "content": "package feathers.examples.todos\n{\n\timport flash.utils.IExternalizable;\n\timport flash.utils.IDataInput;\n\timport flash.utils.IDataOutput;\n\n\tpublic class TodoItem implements IExternalizable\n\t{\n\t\tpublic function TodoItem(description:String = null, isCompleted:Boolean = false)\n\t\t{\n\t\t\tthis.description = description;\n\t\t\tthis.isCompleted = isCompleted;\n\t\t}\n\n\t\tpublic var description:String;\n\t\tpublic var isCompleted:Boolean;\n\n\t\tpublic function writeExternal(output:IDataOutput):void\n\t\t{\n\t\t\toutput.writeBoolean(this.isCompleted);\n\t\t\toutput.writeUTF(this.description);\n\t\t}\n\n\t\tpublic function readExternal(input:IDataInput):void\n\t\t{\n\t\t\tthis.isCompleted = input.readBoolean();\n\t\t\tthis.description = input.readUTF();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/Todos/source/feathers/examples/todos/TodosTheme.as",
    "content": "package feathers.examples.todos\n{\n\timport feathers.controls.Check;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.examples.todos.controls.TodoItemRenderer;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.HorizontalLayout;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.skins.ImageSkin;\n\timport feathers.themes.MetalWorksMobileTheme;\n\n\tpublic class TodosTheme extends MetalWorksMobileTheme\n\t{\n\t\tpublic function TodosTheme()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\t\t\n\t\toverride protected function initializeStyleProviders():void\n\t\t{\n\t\t\tsuper.initializeStyleProviders();\n\t\t\t\n\t\t\tthis.getStyleProviderForClass(TodoItemRenderer).defaultStyleFunction = this.setTodoItemRendererStyles;\n\t\t}\n\n\t\toverride protected function setCheckStyles(check:Check):void\n\t\t{\n\t\t\tsuper.setCheckStyles(check);\n\t\t\tcheck.hasLabelTextRenderer = false;\n\t\t\tcheck.horizontalAlign = HorizontalAlign.CENTER;\n\t\t}\n\t\t\n\t\toverride protected function setToolbarLayoutGroupStyles(group:LayoutGroup):void\n\t\t{\n\t\t\tsuper.setToolbarLayoutGroupStyles(group);\n\t\t\t\n\t\t\tvar layout:HorizontalLayout = new HorizontalLayout();\n\t\t\tlayout.gap = this.smallGutterSize;\n\t\t\tlayout.padding = this.gutterSize;\n\t\t\tlayout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tlayout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\tgroup.layout = layout;\n\t\t}\n\t\t\n\t\tprotected function setTodoItemRendererStyles(itemRenderer:TodoItemRenderer):void\n\t\t{\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.itemRendererUpSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = ITEM_RENDERER_SCALE9_GRID;\n\t\t\titemRenderer.backgroundSkin = backgroundSkin;\n\n\t\t\tvar layout:HorizontalLayout = new HorizontalLayout();\n\t\t\tlayout.gap = this.smallGutterSize;\n\t\t\tlayout.padding = this.smallGutterSize;\n\t\t\tlayout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\titemRenderer.layout = layout;\n\n\t\t\tvar dragIcon:ImageSkin = new ImageSkin(this.dragHandleIcon);\n\t\t\titemRenderer.dragIcon = dragIcon;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/Todos/source/feathers/examples/todos/controls/TodoItemRenderer.as",
    "content": "package feathers.examples.todos.controls\n{\n\timport feathers.controls.Alert;\n\timport feathers.controls.Button;\n\timport feathers.controls.Check;\n\timport feathers.controls.Label;\n\timport feathers.controls.List;\n\timport feathers.controls.renderers.LayoutGroupListItemRenderer;\n\timport feathers.data.ArrayCollection;\n\timport feathers.examples.todos.TodoItem;\n\timport feathers.layout.HorizontalLayoutData;\n\timport feathers.skins.IStyleProvider;\n\n\timport starling.events.Event;\n\timport starling.display.DisplayObject;\n\timport feathers.controls.renderers.IDragAndDropItemRenderer;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.layout.HorizontalLayout;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\n\tpublic class TodoItemRenderer extends LayoutGroupListItemRenderer implements IDragAndDropItemRenderer\n\t{\n\t\tpublic static const EVENT_DELETE_ITEM:String = \"deleteItem\";\n\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\t\t\n\t\tpublic function TodoItemRenderer()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprotected var check:Check;\n\t\tprotected var deleteButton:Button;\n\t\tprotected var label:Label;\n\t\t\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn globalStyleProvider;\n\t\t}\n\n\t\tprivate var _dragEnabled:Boolean = false;\n\n\t\tpublic function get dragEnabled():Boolean\n\t\t{\n\t\t\treturn this._dragEnabled;\n\t\t}\n\n\t\tpublic function set dragEnabled(value:Boolean):void\n\t\t{\n\t\t\tif(this._dragEnabled == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._dragEnabled = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\tpublic function get dragProxy():DisplayObject\n\t\t{\n\t\t\treturn this._dragIcon;\n\t\t}\n\n\t\tprivate var _dragIconContainer:LayoutGroup;\n\n\t\tprivate var _dragIcon:DisplayObject;\n\n\t\tpublic function get dragIcon():DisplayObject\n\t\t{\n\t\t\treturn this._dragIcon;\n\t\t}\n\n\t\tpublic function set dragIcon(value:DisplayObject):void\n\t\t{\n\t\t\tif(this._dragIcon == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._dragIcon && this._dragIcon.parent == this._dragIconContainer)\n\t\t\t{\n\t\t\t\tthis._dragIcon.removeFromParent(false);\n\t\t\t}\n\t\t\tthis._dragIcon = value;\n\t\t\tif(this._dragIcon)\n\t\t\t{\n\t\t\t\tif(!this._dragIconContainer)\n\t\t\t\t{\n\t\t\t\t\tthis._dragIconContainer = new LayoutGroup();\n\t\t\t\t\tvar layout:HorizontalLayout = new HorizontalLayout();\n\t\t\t\t\tlayout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\t\t\tlayout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\t\t\tthis._dragIconContainer.layout = layout;\n\t\t\t\t\tthis.addChildAt(this._dragIconContainer, 0);\n\t\t\t\t}\n\t\t\t\tthis._dragIconContainer.addChild(this._dragIcon)\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this.check)\n\t\t\t{\n\t\t\t\tthis.check.removeFromParent(true);\n\t\t\t\tthis.check = null;\n\t\t\t}\n\t\t\tif(this.deleteButton)\n\t\t\t{\n\t\t\t\tthis.deleteButton.removeFromParent(true);\n\t\t\t\tthis.deleteButton = null;\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\t\t\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tif(!this.check)\n\t\t\t{\n\t\t\t\tthis.check = new Check();\n\t\t\t\tthis.check.addEventListener(Event.CHANGE, check_changeHandler);\n\t\t\t\tthis.addChild(this.check);\n\t\t\t}\n\n\t\t\tif(!this.label)\n\t\t\t{\n\t\t\t\tthis.label = new Label();\n\t\t\t\tthis.label.layoutData = new HorizontalLayoutData(100);\n\t\t\t\tthis.addChild(this.label);\n\t\t\t}\n\n\t\t\tif(!this.deleteButton)\n\t\t\t{\n\t\t\t\tthis.deleteButton = new Button();\n\t\t\t\tthis.deleteButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_DANGER_BUTTON);\n\t\t\t\tthis.deleteButton.label = \"Delete\";\n\t\t\t\tthis.deleteButton.addEventListener(Event.TRIGGERED, deleteButton_triggeredHandler);\n\t\t\t\tthis.addChild(this.deleteButton);\n\t\t\t}\n\t\t}\n\n\t\toverride protected function preLayout():void\n\t\t{\n\t\t\tif(this._dragIconContainer)\n\t\t\t{\n\t\t\t\tthis.check.validate();\n\t\t\t\tthis._dragIconContainer.width = this.check.width;\n\t\t\t\tthis._dragIconContainer.height = this.check.height;\n\t\t\t\tthis.setChildIndex(this._dragIconContainer, 0);\n\t\t\t}\n\t\t}\n\n\t\toverride protected function commitData():void\n\t\t{\n\t\t\tsuper.commitData();\n\t\t\tvar item:TodoItem = this._data as TodoItem;\n\t\t\tif(!item)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.label.text = item.description;\n\t\t\t\n\t\t\tthis.check.isSelected = item.isCompleted;\n\t\t\tthis.check.isEnabled = this._isEnabled;\n\t\t\tthis.check.includeInLayout = !this._dragEnabled;\n\t\t\tthis.check.visible = !this._dragEnabled;\n\t\t\t\n\t\t\tthis.deleteButton.includeInLayout = this._dragEnabled;\n\t\t\tthis.deleteButton.visible = this._dragEnabled;\n\t\t\t\n\t\t\tif(this._dragIconContainer)\n\t\t\t{\n\t\t\t\tthis._dragIconContainer.includeInLayout = this._dragEnabled;\n\t\t\t\tthis._dragIconContainer.visible = this._dragEnabled;\n\t\t\t}\n\t\t}\n\n\t\tprotected function check_changeHandler(event:Event):void\n\t\t{\n\t\t\tvar item:TodoItem = this._data as TodoItem;\n\t\t\tif(!item)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar isCompleted:Boolean = this.check.isSelected;\n\t\t\tif(item.isCompleted == isCompleted)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\titem.isCompleted = isCompleted;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\tprotected function deleteButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tAlert.show(\"Are you sure that you want to delete this item? This action cannot be undone.\", \"Confirm delete\",\n\t\t\t\tnew ArrayCollection(\n\t\t\t\t[\n\t\t\t\t\t{ label: \"Cancel\" },\n\t\t\t\t\t{ label: \"Delete\", triggered: confirmButton_triggeredHandler },\n\t\t\t\t]));\n\t\t}\n\n\t\tprivate function confirmButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(EVENT_DELETE_ITEM, false, this._data);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/TrainTimes/README.md",
    "content": "# Train Times Example for Feathers\n\nThis [Feathers](http://feathersui.com/) example mocks up a simple application to view train schedules. It uses custom item renderers and a custom theme.\n\n## Web Demo\n\nView the [Train Times example](http://feathersui.com/examples/train-times/) in your browser."
  },
  {
    "path": "examples/TrainTimes/assets/images/traintimes.tps",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<data version=\"1.0\">\n    <struct type=\"Settings\">\n        <key>fileFormatVersion</key>\n        <int>1</int>\n        <key>variation</key>\n        <string>main</string>\n        <key>verbose</key>\n        <false/>\n        <key>autoSDSettings</key>\n        <array/>\n        <key>allowRotation</key>\n        <false/>\n        <key>quiet</key>\n        <false/>\n        <key>premultiplyAlpha</key>\n        <false/>\n        <key>shapeDebug</key>\n        <false/>\n        <key>dpi</key>\n        <uint>72</uint>\n        <key>dataFormat</key>\n        <string>sparrow</string>\n        <key>textureFileName</key>\n        <filename>traintimes.png</filename>\n        <key>flipPVR</key>\n        <false/>\n        <key>ditherType</key>\n        <enum type=\"SettingsBase::DitherType\">NearestNeighbour</enum>\n        <key>backgroundColor</key>\n        <uint>0</uint>\n        <key>libGdx</key>\n        <struct type=\"LibGDX\">\n            <key>filtering</key>\n            <struct type=\"LibGDXFiltering\">\n                <key>x</key>\n                <enum type=\"LibGDXFiltering::Filtering\">Linear</enum>\n                <key>y</key>\n                <enum type=\"LibGDXFiltering::Filtering\">Linear</enum>\n            </struct>\n        </struct>\n        <key>shapePadding</key>\n        <uint>1</uint>\n        <key>jpgQuality</key>\n        <uint>80</uint>\n        <key>pngOptimizationLevel</key>\n        <uint>0</uint>\n        <key>textureSubPath</key>\n        <string></string>\n        <key>textureFormat</key>\n        <enum type=\"SettingsBase::TextureFormat\">png</enum>\n        <key>borderPadding</key>\n        <uint>1</uint>\n        <key>maxTextureSize</key>\n        <QSize>\n            <key>width</key>\n            <int>2048</int>\n            <key>height</key>\n            <int>2048</int>\n        </QSize>\n        <key>fixedTextureSize</key>\n        <QSize>\n            <key>width</key>\n            <int>-1</int>\n            <key>height</key>\n            <int>-1</int>\n        </QSize>\n        <key>reduceBorderArtifacts</key>\n        <false/>\n        <key>algorithmSettings</key>\n        <struct type=\"AlgorithmSettings\">\n            <key>algorithm</key>\n            <enum type=\"AlgorithmSettings::AlgorithmId\">MaxRects</enum>\n            <key>freeSizeMode</key>\n            <enum type=\"AlgorithmSettings::AlgorithmFreeSizeMode\">Best</enum>\n            <key>sizeConstraints</key>\n            <enum type=\"AlgorithmSettings::SizeConstraints\">POT</enum>\n            <key>forceSquared</key>\n            <false/>\n            <key>forceWordAligned</key>\n            <false/>\n            <key>maxRects</key>\n            <struct type=\"AlgorithmMaxRectsSettings\">\n                <key>heuristic</key>\n                <enum type=\"AlgorithmMaxRectsSettings::Heuristic\">Best</enum>\n            </struct>\n            <key>basic</key>\n            <struct type=\"AlgorithmBasicSettings\">\n                <key>sortBy</key>\n                <enum type=\"AlgorithmBasicSettings::SortBy\">Best</enum>\n                <key>order</key>\n                <enum type=\"AlgorithmBasicSettings::Order\">Ascending</enum>\n            </struct>\n        </struct>\n        <key>andEngine</key>\n        <struct type=\"AndEngine\">\n            <key>minFilter</key>\n            <enum type=\"AndEngine::MinFilter\">Linear</enum>\n            <key>packageName</key>\n            <string>Texture</string>\n            <key>javaFileName</key>\n            <filename>traintimes.java</filename>\n            <key>wrap</key>\n            <struct type=\"AndEngineWrap\">\n                <key>s</key>\n                <enum type=\"AndEngineWrap::Wrap\">Clamp</enum>\n                <key>t</key>\n                <enum type=\"AndEngineWrap::Wrap\">Clamp</enum>\n            </struct>\n            <key>magFilter</key>\n            <enum type=\"AndEngine::MagFilter\">MagLinear</enum>\n        </struct>\n        <key>dataFileName</key>\n        <filename>traintimes.xml</filename>\n        <key>mainExtension</key>\n        <string></string>\n        <key>forceIdenticalLayout</key>\n        <false/>\n        <key>outputFormat</key>\n        <enum type=\"SettingsBase::OutputFormat\">RGBA8888</enum>\n        <key>autoAliasEnabled</key>\n        <true/>\n        <key>trimSpriteNames</key>\n        <false/>\n        <key>globalSpriteSettings</key>\n        <struct type=\"SpriteSettings\">\n            <key>scale</key>\n            <double>1</double>\n            <key>scaleMode</key>\n            <enum type=\"ScaleMode\">Smooth</enum>\n            <key>innerPadding</key>\n            <uint>0</uint>\n            <key>extrude</key>\n            <uint>1</uint>\n            <key>trimThreshold</key>\n            <uint>1</uint>\n            <key>trimMode</key>\n            <enum type=\"SpriteSettings::TrimMode\">Trim</enum>\n            <key>heuristicMask</key>\n            <false/>\n        </struct>\n        <key>fileList</key>\n        <array>\n            <filename>traintimes</filename>\n        </array>\n        <key>ignoreFileList</key>\n        <array/>\n        <key>replaceList</key>\n        <array/>\n        <key>commonDivisorX</key>\n        <uint>1</uint>\n        <key>commonDivisorY</key>\n        <uint>1</uint>\n    </struct>\n</data>\n"
  },
  {
    "path": "examples/TrainTimes/assets/images/traintimes.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- Created with TexturePacker http://texturepacker.com-->\n<!-- $TexturePacker:SmartUpdate:ac9dff798214f47f3dfc1767f7453ea9$ -->\n<TextureAtlas imagePath=\"traintimes.png\">\n    <SubTexture name=\"back-icon\" x=\"216\" y=\"35\" width=\"25\" height=\"27\"/>\n    <SubTexture name=\"cancel-icon\" x=\"216\" y=\"2\" width=\"30\" height=\"30\"/>\n    <SubTexture name=\"confirm-icon\" x=\"2\" y=\"477\" width=\"41\" height=\"30\"/>\n    <SubTexture name=\"header-background\" x=\"249\" y=\"2\" width=\"4\" height=\"12\"/>\n    <SubTexture name=\"horizontal-scroll-bar-thumb-skin\" x=\"216\" y=\"65\" width=\"24\" height=\"8\"/>\n    <SubTexture name=\"main-background\" x=\"2\" y=\"2\" width=\"125\" height=\"125\"/>\n    <SubTexture name=\"station-list-first-normal-icon\" x=\"2\" y=\"370\" width=\"53\" height=\"104\" frameX=\"-15\" frameY=\"-56\" frameWidth=\"83\" frameHeight=\"160\"/>\n    <SubTexture name=\"station-list-first-selected-icon\" x=\"88\" y=\"165\" width=\"83\" height=\"120\" frameX=\"0\" frameY=\"-40\" frameWidth=\"83\" frameHeight=\"160\"/>\n    <SubTexture name=\"station-list-last-normal-icon\" x=\"2\" y=\"257\" width=\"53\" height=\"110\" frameX=\"-15\" frameY=\"0\" frameWidth=\"83\" frameHeight=\"160\"/>\n    <SubTexture name=\"station-list-last-selected-icon\" x=\"2\" y=\"130\" width=\"83\" height=\"124\" frameX=\"0\" frameY=\"0\" frameWidth=\"83\" frameHeight=\"160\"/>\n    <SubTexture name=\"station-list-normal-icon\" x=\"174\" y=\"165\" width=\"53\" height=\"160\" frameX=\"-15\" frameY=\"0\" frameWidth=\"83\" frameHeight=\"160\"/>\n    <SubTexture name=\"station-list-selected-icon\" x=\"130\" y=\"2\" width=\"83\" height=\"160\"/>\n    <SubTexture name=\"vertical-scroll-bar-thumb-skin\" x=\"244\" y=\"35\" width=\"8\" height=\"24\"/>\n</TextureAtlas>\n"
  },
  {
    "path": "examples/TrainTimes/build.properties",
    "content": "feathers.root = ${basedir}/../../source\nstarling.root = ${basedir}/../../third-party/starling\noutput.path = ${basedir}/output\nicon.path = ${basedir}/../shared-assets/icons\nlaunch.image.path = ${basedir}/assets/launch-images\n\nswf.version = 30"
  },
  {
    "path": "examples/TrainTimes/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<project name=\"train-times\" default=\"build\" basedir=\".\">\n\t\n\t<!-- build.local.properties and sdk.local.proprties are optional files that\n\t\tcan be used to override the default properties. -->\n\t<property file=\"./build.local.properties\"/>\n\t<property file=\"./sdk.local.properties\"/>\n\t<property file=\"./build.properties\"/>\n\t<!-- inherit SDK properties from the root of the repository -->\n\t<property file=\"../../sdk.local.properties\"/>\n\t<property file=\"../../sdk.properties\"/>\n\n\t<target name=\"build\" depends=\"build-web,build-android,build-ios\"/>\n\n\t<target name=\"prepare\">\n\t\t<delete dir=\"${output.path}\"/>\n\t</target>\n\n\t<target name=\"build-web\" depends=\"prepare\">\n\t\t<echo message=\"Building TrainTimesWeb.swf\"/>\n\t\t<java jar=\"${mxmlc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${flashplayer.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-frame=two,feathers.examples.trainTimes.Main\"/>\n\t\t\t<arg value=\"-source-path+=source\"/>\n\t\t\t<arg value=\"-source-path+=${starling.root}\"/>\n\t\t\t<arg value=\"-source-path+=${feathers.root}\"/>\n\t\t\t<arg value=\"source/TrainTimesWeb.as\"/>\n\t\t\t<arg value=\"-output=${output.path}/TrainTimesWeb.swf\"/>\n\t\t</java>\n\t</target>\n\n\t<target name=\"build-air-swf\" depends=\"prepare\">\n\t\t<echo message=\"Building TrainTimes.swf\"/>\n\t\t<java jar=\"${mxmlc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${airmobile.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-source-path+=source\"/>\n\t\t\t<arg value=\"-source-path+=${starling.root}\"/>\n\t\t\t<arg value=\"-source-path+=${feathers.root}\"/>\n\t\t\t<arg value=\"source/TrainTimes.as\"/>\n\t\t\t<arg value=\"-output=${output.path}/TrainTimes.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"-check-ios-properties\">\n\t\t<fail unless=\"ios.provision.path\"/>\n\t\t<fail unless=\"ios.certificate.path\"/>\n\t\t<fail unless=\"ios.certificate.password\"/>\n\t</target>\n\t<target name=\"build-ios\" depends=\"-check-ios-properties,build-air-swf\">\n\t\t<echo message=\"Packaging TrainTimes.ipa\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"-target\"/>\n\t\t\t<arg value=\"ipa-app-store\"/>\n\t\t\t<arg value=\"-provisioning-profile\"/>\n\t\t\t<arg value=\"${ios.provision.path}\"/>\n\t\t\t<arg value=\"-keystore\"/>\n\t\t\t<arg value=\"${ios.certificate.path}\"/>\n\t\t\t<arg value=\"-storetype\"/>\n\t\t\t<arg value=\"pkcs12\"/>\n\t\t\t<arg value=\"-storepass\"/>\n\t\t\t<arg value=\"${ios.certificate.password}\"/>\n\t\t\t<arg value=\"${output.path}/TrainTimes.ipa\"/>\n\t\t\t<arg value=\"source/TrainTimes-app.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${icon.path}\"/>\n\t\t\t<arg line=\"icon29.png icon48.png icon50.png icon57.png icon58.png icon72.png icon87.png icon96.png icon100.png icon114.png icon128.png icon144.png icon180.png\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${launch.image.path}\"/>\n\t\t\t<arg value=\"Default~iphone.png\"/>\t\t\t\t\t\t\t<!-- iphone 3gs -->\n\t\t\t<arg value=\"Default@2x~iphone.png\"/>\t\t\t\t\t\t<!-- iphone 4/4s -->\n\t\t\t<arg value=\"Default-568h@2x~iphone.png\"/>\t\t\t\t\t<!-- iphone 5/5c/5s -->\n\t\t\t<arg value=\"Default-375w-667h@2x~iphone.png\"/>\t\t\t\t<!-- iphone 6/7/8 -->\n\t\t\t<arg value=\"Default-812h@3x~iphone.png\"/>\t\t\t\t\t<!-- iphone x (portrait) -->\n\t\t\t<arg value=\"Default-Landscape-812h@3x~iphone.png\"/>\t\t\t<!-- iphone x (landscape) -->\n\t\t\t<arg value=\"Default-414w-736h@3x~iphone.png\"/>\t\t\t\t<!-- iphone 6/7/8 plus (portrait) -->\n\t\t\t<arg value=\"Default-Landscape-414w-736h@3x~iphone.png\"/>\t<!-- iphone 6/7/8 plus (landscape) -->\n\t\t\t<arg value=\"Default-Portrait~ipad.png\"/>\t\t\t\t\t<!-- ipad 1/2 (portrait) -->\n\t\t\t<arg value=\"Default-PortraitUpsideDown~ipad.png\"/>\t\t\t<!-- ipad 1/2 (portrait upside down) -->\n\t\t\t<arg value=\"Default-Landscape~ipad.png\"/>\t\t\t\t\t<!-- ipad 1/2 (landscape left) -->\n\t\t\t<arg value=\"Default-LandscapeRight~ipad.png\"/>\t\t\t\t<!-- ipad 1/2 (landscape right) -->\n\t\t\t<arg value=\"Default-Portrait@2x~ipad.png\"/>\t\t\t\t\t<!-- ipad 3/air (portrait) -->\n\t\t\t<arg value=\"Default-LandscapeLeft@2x~ipad.png\"/>\t\t\t<!-- ipad 3/air (landscape left) -->\n\t\t\t<arg value=\"Default-LandscapeRight@2x~ipad.png\"/>\t\t\t<!-- ipad 3/air (landscape right) -->\n\t\t\t<arg value=\"Default-Portrait@2x.png\"/>\t\t\t\t\t\t<!-- ipad pro (portrait) -->\n\t\t\t<arg value=\"Default-Landscape@2x.png\"/>\t\t\t\t\t\t<!-- ipad pro (landscape) -->\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${output.path}\"/>\n\t\t\t<arg value=\"TrainTimes.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"-check-android-properties\">\n\t\t<fail unless=\"android.certificate.path\"/>\n\t\t<fail unless=\"android.certificate.password\"/>\n\t</target>\n\t<target name=\"build-android\" depends=\"-check-android-properties,build-air-swf\">\n\t\t<echo message=\"Packaging TrainTimes.apk\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"-target\"/>\n\t\t\t<arg value=\"apk-captive-runtime\"/>\n\t\t\t<arg value=\"-storetype\"/>\n\t\t\t<arg value=\"pkcs12\"/>\n\t\t\t<arg value=\"-keystore\"/>\n\t\t\t<arg value=\"${android.certificate.path}\"/>\n\t\t\t<arg value=\"-storepass\"/>\n\t\t\t<arg value=\"${android.certificate.password}\"/>\n\t\t\t<arg value=\"${output.path}/TrainTimes.apk\"/>\n\t\t\t<arg value=\"source/TrainTimes-app.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${icon.path}\"/>\n\t\t\t<arg line=\"icon29.png icon48.png icon50.png icon57.png icon58.png icon72.png icon87.png icon96.png icon100.png icon114.png icon128.png icon144.png icon180.png\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${output.path}\"/>\n\t\t\t<arg value=\"TrainTimes.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"install-android\">\n\t\t<echo message=\"Installing TrainTimes.apk\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"false\">\n\t\t\t<arg value=\"-uninstallApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"android\"/>\n\t\t\t<arg value=\"-appid\"/>\n\t\t\t<arg value=\"com.feathersui.examples.TrainTimes\"/>\n\t\t</java>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-installApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"android\"/>\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"${output.path}/TrainTimes.apk\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"install-ios\">\n\t\t<echo message=\"Installing TrainTimes.ipa\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"false\">\n\t\t\t<arg value=\"-uninstallApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"iOS\"/>\n\t\t\t<arg value=\"-appid\"/>\n\t\t\t<arg value=\"com.feathersui.examples.TrainTimes\"/>\n\t\t</java>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-installApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"iOS\"/>\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"${output.path}/TrainTimes.ipa\"/>\n\t\t</java>\n\t</target>\n</project>"
  },
  {
    "path": "examples/TrainTimes/source/TrainTimes-app.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<application xmlns=\"http://ns.adobe.com/air/application/32.0\">\n\t<id>com.feathersui.examples.TrainTimes</id>\n\t<filename>Train Times</filename>\n\t<name>Train Times</name>\n\t<versionNumber>4.2.0</versionNumber>\n\t<description>Train Times example application built with Feathers UI controls for Starling</description>\n\t<copyright>2021 Bowler Hat LLC</copyright>\n\n\t<initialWindow>\n\t\t<content>TrainTimes.swf</content>\n\t\t<autoOrients>true</autoOrients>\n\t\t<fullScreen>false</fullScreen>\n\t\t<visible>true</visible>\n\t\t<renderMode>direct</renderMode>\n\t\t<requestedDisplayResolution>high</requestedDisplayResolution>\n\t</initialWindow>\n\n\t<supportedLanguages>en</supportedLanguages>\n\n\t<icon>\n\t\t<image29x29>icon29.png</image29x29>\n\t\t<image48x48>icon48.png</image48x48>\n\t\t<image50x50>icon50.png</image50x50>\n\t\t<image57x57>icon57.png</image57x57>\n\t\t<image58x58>icon58.png</image58x58>\n\t\t<image72x72>icon72.png</image72x72>\n\t\t<image87x87>icon87.png</image87x87>\n\t\t<image96x96>icon96.png</image96x96>\n\t\t<image100x100>icon100.png</image100x100>\n\t\t<image114x114>icon114.png</image114x114>\n\t\t<image128x128>icon128.png</image128x128>\n\t\t<image144x144>icon144.png</image144x144>\n\t\t<image180x180>icon180.png</image180x180>\n\t</icon>\n\t<android>\n\t\t<manifestAdditions><![CDATA[\n\t\t\t<manifest android:installLocation=\"auto\">\n\t\t\t    <uses-permission android:name=\"android.permission.INTERNET\"/>\n\t\t\t</manifest>\n\t\t]]></manifestAdditions>\n\t</android>\n\t<iPhone>\n\t\t<InfoAdditions>\n\t\t\t<![CDATA[\n\t\t\t<key>UIDeviceFamily</key>\n\t\t\t<array>\n\t\t\t\t<string>1</string>\n\t\t\t\t<string>2</string>\n\t\t\t</array>\n\t\t\t<key>UIPrerenderedIcon</key>\n\t\t\t<true/>\n\t\t\t<key>UIStatusBarStyle</key>\n\t\t\t<string>UIStatusBarStyleLightContent</string>\n\t\t]]>\n\t\t</InfoAdditions>\n\t\t<requestedDisplayResolution>high</requestedDisplayResolution>\n\t</iPhone>\n</application>"
  },
  {
    "path": "examples/TrainTimes/source/TrainTimes.as",
    "content": "package\n{\n\timport feathers.examples.trainTimes.Main;\n\timport feathers.utils.ScreenDensityScaleFactorManager;\n\n\timport flash.display.Loader;\n\timport flash.display.Sprite;\n\timport flash.display.StageAlign;\n\timport flash.display.StageOrientation;\n\timport flash.display.StageScaleMode;\n\timport flash.display3D.Context3DProfile;\n\timport flash.display3D.Context3DRenderMode;\n\timport flash.events.Event;\n\timport flash.filesystem.File;\n\timport flash.filesystem.FileMode;\n\timport flash.filesystem.FileStream;\n\timport flash.system.Capabilities;\n\timport flash.utils.ByteArray;\n\n\timport starling.core.Starling;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#424254\")]\n\tpublic class TrainTimes extends Sprite\n\t{\n\t\tpublic function TrainTimes()\n\t\t{\n\t\t\tif(this.stage)\n\t\t\t{\n\t\t\t\tthis.stage.scaleMode = StageScaleMode.NO_SCALE;\n\t\t\t\tthis.stage.align = StageAlign.TOP_LEFT;\n\t\t\t}\n\t\t\tthis.mouseEnabled = this.mouseChildren = false;\n\t\t\tthis.showLaunchImage();\n\t\t\tthis.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);\n\t\t}\n\n\t\tprivate var _starling:Starling;\n\t\tprivate var _scaler:ScreenDensityScaleFactorManager;\n\t\tprivate var _launchImage:Loader;\n\t\tprivate var _savedAutoOrients:Boolean;\n\n\t\t/**\n\t\t * On iOS, add the native launch image to the classic display list to\n\t\t * avoid displaying only the stage background color between when the\n\t\t * AIR app finishes launching and Starling starts rendering.\n\t\t * \n\t\t * Launch image names: https://forums.adobe.com/message/9986239#9986239\n\t\t */\n\t\tprivate function showLaunchImage():void\n\t\t{\n\t\t\tvar filePath:String = null;\n\t\t\tvar isPortraitOnly:Boolean = false;\n\t\t\tif(Capabilities.manufacturer.indexOf(\"iOS\") >= 0)\n\t\t\t{\n\t\t\t\tvar isPortraitUpsideDown:Boolean = this.stage.orientation == StageOrientation.UPSIDE_DOWN;\n\t\t\t\tvar isPortrait:Boolean = this.stage.orientation == StageOrientation.DEFAULT || isPortraitUpsideDown;\n\t\t\t\tvar isLandscapeRight:Boolean = this.stage.orientation == StageOrientation.ROTATED_RIGHT;\n\t\t\t\tif(Capabilities.screenResolutionX == 1242 && Capabilities.screenResolutionY == 2208)\n\t\t\t\t{\n\t\t\t\t\t//iphone 6/7/8 plus\n\t\t\t\t\tfilePath = isPortrait ? \"Default-414w-736h@3x~iphone.png\" : \"Default-Landscape-414w-736h@3x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 1125 && Capabilities.screenResolutionY == 2436)\n\t\t\t\t{\n\t\t\t\t\t//iphone x\n\t\t\t\t\tfilePath = isPortrait ? \"Default-812h@3x~iphone.png\" : \"Default-Landscape-812h@3x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 2048 && Capabilities.screenResolutionY == 2732)\n\t\t\t\t{\n\t\t\t\t\t//ipad pro\n\t\t\t\t\tfilePath = isPortrait ? \"Default-Portrait@2x.png\" : \"Default-Landscape@2x.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 1536 && Capabilities.screenResolutionY == 2048)\n\t\t\t\t{\n\t\t\t\t\t//ipad 3/air\n\t\t\t\t\tif(isPortraitUpsideDown)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Portrait@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isPortrait)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-PortraitUpsideDown@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isLandscapeRight)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeRight@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeLeft@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 768 && Capabilities.screenResolutionY == 1024)\n\t\t\t\t{\n\t\t\t\t\t//ipad 1/2\n\t\t\t\t\tif(isPortraitUpsideDown)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Portrait~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isPortrait)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-PortraitUpsideDown~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isLandscapeRight)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeRight~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Landscape~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 750)\n\t\t\t\t{\n\t\t\t\t\t//iphone 6/7/8\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tfilePath = \"Default-375w-667h@2x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 640)\n\t\t\t\t{\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tif(Capabilities.screenResolutionY == 1136)\n\t\t\t\t\t{\n\t\t\t\t\t\t//iphone 5/5c/5s\n\t\t\t\t\t\tfilePath = \"Default-568h@2x~iphone.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//iphone 4/4s\n\t\t\t\t\t\tfilePath = \"Default@2x~iphone.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 320)\n\t\t\t\t{\n\t\t\t\t\t//iphone 3gs\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tfilePath = \"Default~iphone.png\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(filePath)\n\t\t\t{\n\t\t\t\tvar file:File = File.applicationDirectory.resolvePath(filePath);\n\t\t\t\tif(file.exists)\n\t\t\t\t{\n\t\t\t\t\tvar bytes:ByteArray = new ByteArray();\n\t\t\t\t\tvar stream:FileStream = new FileStream();\n\t\t\t\t\tstream.open(file, FileMode.READ);\n\t\t\t\t\tstream.readBytes(bytes, 0, stream.bytesAvailable);\n\t\t\t\t\tstream.close();\n\t\t\t\t\tthis._launchImage = new Loader();\n\t\t\t\t\tthis._launchImage.loadBytes(bytes);\n\t\t\t\t\tthis.addChild(this._launchImage);\n\t\t\t\t\tthis._savedAutoOrients = this.stage.autoOrients;\n\t\t\t\t\tthis.stage.autoOrients = false;\n\t\t\t\t\tif(isPortraitOnly)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.stage.setOrientation(StageOrientation.DEFAULT);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function loaderInfo_completeHandler(event:Event):void\n\t\t{\n\t\t\tStarling.multitouchEnabled = true;\n\t\t\tthis._starling = new Starling(Main, this.stage, null, null, Context3DRenderMode.AUTO, Context3DProfile.BASELINE);\n\t\t\tthis._starling.supportHighResolutions = true;\n\t\t\tthis._starling.skipUnchangedFrames = true;\n\t\t\tthis._starling.start();\n\t\t\tif(this._launchImage)\n\t\t\t{\n\t\t\t\tthis._starling.addEventListener(\"rootCreated\", starling_rootCreatedHandler);\n\t\t\t}\n\t\t\tthis._scaler = new ScreenDensityScaleFactorManager(this._starling);\n\t\t\tthis.stage.addEventListener(Event.DEACTIVATE, stage_deactivateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function starling_rootCreatedHandler(event:Object):void\n\t\t{\n\t\t\tif(this._launchImage)\n\t\t\t{\n\t\t\t\tthis.removeChild(this._launchImage);\n\t\t\t\tthis._launchImage.unloadAndStop(true);\n\t\t\t\tthis._launchImage = null;\n\t\t\t\tthis.stage.autoOrients = this._savedAutoOrients;\n\t\t\t}\n\t\t}\n\n\t\tprivate function stage_deactivateHandler(event:Event):void\n\t\t{\n\t\t\tthis._starling.stop(true);\n\t\t\tthis.stage.addEventListener(Event.ACTIVATE, stage_activateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function stage_activateHandler(event:Event):void\n\t\t{\n\t\t\tthis.stage.removeEventListener(Event.ACTIVATE, stage_activateHandler);\n\t\t\tthis._starling.start();\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "examples/TrainTimes/source/TrainTimesWeb.as",
    "content": "package\n{\n\timport feathers.system.DeviceCapabilities;\n\n\timport flash.display.MovieClip;\n\timport flash.display.StageAlign;\n\timport flash.display.StageScaleMode;\n\timport flash.events.Event;\n\timport flash.geom.Rectangle;\n\timport flash.ui.ContextMenu;\n\timport flash.utils.getDefinitionByName;\n\n\timport starling.core.Starling;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#424254\")]\n\tpublic class TrainTimesWeb extends MovieClip\n\t{\n\t\tpublic function TrainTimesWeb()\n\t\t{\n\t\t\tvar menu:ContextMenu = new ContextMenu();\n\t\t\tmenu.hideBuiltInItems();\n\t\t\tthis.contextMenu = menu;\n\t\t\t\n\t\t\tif(this.stage)\n\t\t\t{\n\t\t\t\tthis.stage.align = StageAlign.TOP_LEFT;\n\t\t\t\tthis.stage.scaleMode = StageScaleMode.NO_SCALE;\n\t\t\t}\n\t\t\t\n\t\t\tthis.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);\n\t\t}\n\t\t\n\t\tprivate var _starling:Starling;\n\t\t\n\t\tprivate function start():void\n\t\t{\n\t\t\tthis.gotoAndStop(2);\n\t\t\tthis.graphics.clear();\n\n\t\t\t//simulating iPhone Retina\n\t\t\tDeviceCapabilities.dpi = 326;\n\t\t\t\n\t\t\tStarling.multitouchEnabled = true;\n\t\t\tvar MainType:Class = getDefinitionByName(\"feathers.examples.trainTimes.Main\") as Class;\n\t\t\tthis._starling = new Starling(MainType, this.stage, new Rectangle(0, 0, 960, 640));\n\t\t\tthis._starling.supportHighResolutions = true;\n\t\t\tthis._starling.skipUnchangedFrames = true;\n\t\t\tthis._starling.stage.stageWidth = 480;\n\t\t\tthis._starling.stage.stageHeight = 320;\n\t\t\tthis._starling.start();\n\t\t}\n\t\t\n\t\tprivate function loaderInfo_completeHandler(event:Event):void\n\t\t{\n\t\t\tthis.start();\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/TrainTimes/source/feathers/examples/trainTimes/Main.as",
    "content": "package feathers.examples.trainTimes\n{\n\n\timport feathers.controls.StackScreenNavigator;\n\timport feathers.controls.StackScreenNavigatorItem;\n\timport feathers.examples.trainTimes.screens.StationScreen;\n\timport feathers.examples.trainTimes.screens.TimesScreen;\n\timport feathers.examples.trainTimes.themes.TrainTimesTheme;\n\timport feathers.motion.Slide;\n\n\timport starling.events.Event;\n\n\tpublic class Main extends StackScreenNavigator\n\t{\n\t\tprivate static const STATION_SCREEN:String = \"stationScreen\";\n\t\tprivate static const TIMES_SCREEN:String = \"timesScreen\";\n\n\t\tpublic function Main()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tnew TrainTimesTheme();\n\n\t\t\tvar stationScreenItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(StationScreen);\n\t\t\tstationScreenItem.setScreenIDForPushEvent(Event.COMPLETE, TIMES_SCREEN);\n\t\t\tthis.addScreen(STATION_SCREEN, stationScreenItem);\n\n\t\t\tvar timesScreenItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(TimesScreen);\n\t\t\ttimesScreenItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis.addScreen(TIMES_SCREEN, timesScreenItem);\n\n\t\t\tthis.rootScreenID = STATION_SCREEN;\n\n\t\t\tthis.pushTransition = Slide.createSlideLeftTransition();\n\t\t\tthis.popTransition = Slide.createSlideRightTransition();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/TrainTimes/source/feathers/examples/trainTimes/controls/StationListItemRenderer.as",
    "content": "package feathers.examples.trainTimes.controls\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.ImageLoader;\n\timport feathers.controls.Label;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.List;\n\timport feathers.controls.renderers.IListItemRenderer;\n\timport feathers.core.FeathersControl;\n\timport feathers.examples.trainTimes.model.StationData;\n\timport feathers.skins.IStyleProvider;\n\n\timport flash.geom.Point;\n\n\timport starling.animation.Transitions;\n\timport starling.animation.Tween;\n\timport starling.core.Starling;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.textures.Texture;\n\n\tpublic class StationListItemRenderer extends FeathersControl implements IListItemRenderer\n\t{\n\t\tpublic static const CHILD_STYLE_NAME_STATION_LIST_NAME_LABEL:String = \"stationListNameLabel\";\n\t\tpublic static const CHILD_STYLE_NAME_STATION_LIST_DETAILS_LABEL:String = \"stationListDetailsLabel\";\n\t\tpublic static const CHILD_STYLE_NAME_STATION_LIST_ACTION_CONTAINER:String = \"stationListActionContainer\";\n\t\tpublic static const CHILD_STYLE_NAME_STATION_LIST_CONFIRM_BUTTON:String = \"stationListConfirmButton\";\n\t\tpublic static const CHILD_STYLE_NAME_STATION_LIST_CANCEL_BUTTON:String = \"stationListCancelButton\";\n\n\t\tprivate static const HELPER_POINT:Point = new Point();\n\t\tprivate static const HELPER_TOUCHES_VECTOR:Vector.<Touch> = new <Touch>[];\n\n\t\tprivate static const DEPART_FROM_TEXT:String = \"DEPART FROM\";\n\t\tprivate static const DEPARTING_FROM_TEXT:String = \"DEPARTING FROM\";\n\t\tprivate static const TRAVEL_TO_TEXT:String = \"TRAVEL TO\";\n\t\tprivate static const QUESTION_MARK:String = \"?\";\n\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\tprotected static function defaultLoaderFactory():ImageLoader\n\t\t{\n\t\t\treturn new ImageLoader();\n\t\t}\n\n\t\tpublic function StationListItemRenderer()\n\t\t{\n\t\t\tthis.addEventListener(TouchEvent.TOUCH, touchHandler);\n\t\t}\n\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn StationListItemRenderer.globalStyleProvider;\n\t\t}\n\n\t\tprotected var background:Quad;\n\t\tprotected var actionContainer:LayoutGroup;\n\t\tprotected var confirmButton:Button;\n\t\tprotected var cancelButton:Button;\n\t\tprotected var nameLabel:Label;\n\t\tprotected var detailsLabel:Label;\n\t\tprotected var icon:ImageLoader;\n\n\t\tprotected var _touchPointID:int = -1;\n\n\t\tprotected var _data:StationData;\n\n\t\tpublic function get data():Object\n\t\t{\n\t\t\treturn this._data;\n\t\t}\n\n\t\tpublic function set data(value:Object):void\n\t\t{\n\t\t\tif(this._data == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._data = StationData(value);\n\t\t\tthis.isSelectionWaitingToBeAnimated = false;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\tprotected var _index:int = -1;\n\n\t\tpublic function get index():int\n\t\t{\n\t\t\treturn this._index;\n\t\t}\n\n\t\tpublic function set index(value:int):void\n\t\t{\n\t\t\tthis._index = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _factoryID:String;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get factoryID():String\n\t\t{\n\t\t\treturn this._factoryID;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set factoryID(value:String):void\n\t\t{\n\t\t\tthis._factoryID = value;\n\t\t}\n\n\t\tprotected var _isInDestinationPhase:Boolean = false;\n\n\t\tpublic function get isInDestinationPhase():Boolean\n\t\t{\n\t\t\treturn this._isInDestinationPhase;\n\t\t}\n\n\t\tpublic function set isInDestinationPhase(value:Boolean):void\n\t\t{\n\t\t\tif(this._isInDestinationPhase == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isInDestinationPhase = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\n\t\tprotected var _owner:List;\n\n\t\tpublic function get owner():List\n\t\t{\n\t\t\treturn this._owner;\n\t\t}\n\n\t\tpublic function set owner(value:List):void\n\t\t{\n\t\t\tif(this._owner == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._owner)\n\t\t\t{\n\t\t\t\tthis._owner.removeEventListener(Event.SCROLL, owner_scrollHandler);\n\t\t\t}\n\t\t\tthis._owner = value;\n\t\t\tif(this._owner)\n\t\t\t{\n\t\t\t\tthis._owner.addEventListener(Event.SCROLL, owner_scrollHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\tprotected var isSelectionWaitingToBeAnimated:Boolean = false;\n\n\t\tprotected var _isSelected:Boolean = false;\n\n\t\tpublic function get isSelected():Boolean\n\t\t{\n\t\t\treturn this._isSelected;\n\t\t}\n\n\t\tpublic function set isSelected(value:Boolean):void\n\t\t{\n\t\t\tif(this._isSelected == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isSelected = value;\n\t\t\tif(this.selectionTween)\n\t\t\t{\n\t\t\t\tStarling.juggler.remove(this.selectionTween);\n\t\t\t\tthis.selectionTween = null;\n\t\t\t}\n\t\t\tthis.isSelectionWaitingToBeAnimated = !this.isInvalid(INVALIDATION_FLAG_DATA) && !this._data.isDepartingFromHere;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\tprotected var _normalIconTexture:Texture;\n\n\t\tpublic function get normalIconTexture():Texture\n\t\t{\n\t\t\treturn this._normalIconTexture;\n\t\t}\n\n\t\tpublic function set normalIconTexture(value:Texture):void\n\t\t{\n\t\t\tif(this._normalIconTexture == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._normalIconTexture = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SKIN);\n\t\t}\n\n\t\tprotected var _selectedIconTexture:Texture;\n\n\t\tpublic function get selectedIconTexture():Texture\n\t\t{\n\t\t\treturn this._selectedIconTexture;\n\t\t}\n\n\t\tpublic function set selectedIconTexture(value:Texture):void\n\t\t{\n\t\t\tif(this._selectedIconTexture == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._selectedIconTexture = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SKIN);\n\t\t}\n\n\t\tprotected var _iconLoaderFactory:Function = defaultLoaderFactory;\n\n\t\tpublic function get iconLoaderFactory():Function\n\t\t{\n\t\t\treturn this._iconLoaderFactory;\n\t\t}\n\n\t\tpublic function set iconLoaderFactory(value:Function):void\n\t\t{\n\t\t\tif(this._iconLoaderFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._iconLoaderFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\tprotected var _paddingTop:Number = 0;\n\n\t\tpublic function get paddingTop():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\tpublic function set paddingTop(value:Number):void\n\t\t{\n\t\t\tif(this._paddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingTop = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\tprotected var _paddingRight:Number = 0;\n\n\t\tpublic function get paddingRight():Number\n\t\t{\n\t\t\treturn this._paddingRight;\n\t\t}\n\n\t\tpublic function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this._paddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingRight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\tprotected var _paddingBottom:Number = 0;\n\n\t\tpublic function get paddingBottom():Number\n\t\t{\n\t\t\treturn this._paddingBottom;\n\t\t}\n\n\t\tpublic function set paddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this._paddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingBottom = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\tprotected var _paddingLeft:Number = 0;\n\n\t\tpublic function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\tpublic function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this._paddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingLeft = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\tprotected var _gap:Number = 0;\n\n\t\tpublic function get gap():Number\n\t\t{\n\t\t\treturn this._gap;\n\t\t}\n\n\t\tpublic function set gap(value:Number):void\n\t\t{\n\t\t\tif(this._gap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._gap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\tpublic var confirmCallback:Function;\n\n\t\tprotected var selectionTween:Tween;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tthis.background = new Quad(10, 10, 0x3b2a41);\n\t\t\tthis.background.alpha = 0;\n\t\t\tthis.addChild(this.background);\n\n\t\t\tthis.detailsLabel = new Label();\n\t\t\tthis.detailsLabel.styleNameList.add(CHILD_STYLE_NAME_STATION_LIST_DETAILS_LABEL);\n\t\t\tthis.addChild(this.detailsLabel);\n\n\t\t\tthis.nameLabel = new Label();\n\t\t\tthis.nameLabel.styleNameList.add(CHILD_STYLE_NAME_STATION_LIST_NAME_LABEL);\n\t\t\tthis.addChild(this.nameLabel);\n\n\t\t\tthis.actionContainer = new LayoutGroup();\n\t\t\tthis.actionContainer.styleNameList.add(CHILD_STYLE_NAME_STATION_LIST_ACTION_CONTAINER);\n\t\t\tthis.actionContainer.visible = false;\n\t\t\tthis.addChild(this.actionContainer);\n\n\t\t\tthis.confirmButton = new Button();\n\t\t\tthis.confirmButton.styleNameList.add(CHILD_STYLE_NAME_STATION_LIST_CONFIRM_BUTTON);\n\t\t\tthis.confirmButton.addEventListener(Event.TRIGGERED, confirmButton_triggeredHandler);\n\t\t\tthis.actionContainer.addChild(this.confirmButton);\n\n\t\t\tthis.cancelButton = new Button();\n\t\t\tthis.cancelButton.styleNameList.add(CHILD_STYLE_NAME_STATION_LIST_CANCEL_BUTTON);\n\t\t\tthis.cancelButton.addEventListener(Event.TRIGGERED, cancelButton_triggeredHandler);\n\t\t\tthis.actionContainer.addChild(this.cancelButton);\n\t\t}\n\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar selectionInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SELECTED);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\n\t\t\tif(stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshIcon();\n\t\t\t}\n\n\t\t\tif(dataInvalid || selectionInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.commitData();\n\t\t\t}\n\n\t\t\tsizeInvalid = this.autoSizeIfNeeded() || sizeInvalid;\n\t\t\tthis.layout();\n\t\t}\n\n\t\tprotected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = isNaN(this._explicitWidth);\n\t\t\tvar needsHeight:Boolean = isNaN(this._explicitHeight);\n\t\t\tvar needsMinWidth:Boolean = isNaN(this._explicitMinWidth);\n\t\t\tvar needsMinHeight:Boolean = isNaN(this._explicitMinHeight);\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tthis.icon.validate();\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tnewWidth = this.icon.width;\n\t\t\t\tnewWidth += this._paddingLeft + this._paddingRight;\n\t\t\t}\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tnewHeight = this.icon.height;\n\t\t\t}\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tnewMinWidth = this.icon.width;\n\t\t\t\tnewMinWidth += this._paddingLeft + this._paddingRight;\n\t\t\t}\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tnewMinHeight = this.icon.height;\n\t\t\t}\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\tprotected function refreshIcon():void\n\t\t{\n\t\t\tif(this.icon)\n\t\t\t{\n\t\t\t\tthis.icon.removeFromParent(true);\n\t\t\t}\n\n\t\t\tthis.icon = ImageLoader(this._iconLoaderFactory());\n\t\t\tthis.addChild(this.icon);\n\t\t}\n\n\t\tprotected function commitData():void\n\t\t{\n\t\t\tif(this._owner && this._data)\n\t\t\t{\n\t\t\t\tvar nameLabelText:String = this._data.name;\n\t\t\t\tif(this._isSelected)\n\t\t\t\t{\n\t\t\t\t\tnameLabelText += QUESTION_MARK;\n\t\t\t\t}\n\t\t\t\tthis.nameLabel.text = nameLabelText;\n\n\t\t\t\tvar displayAsSelected:Boolean = this._isSelected || this._data.isDepartingFromHere;\n\t\t\t\tthis.icon.source = displayAsSelected ? this._selectedIconTexture : this._normalIconTexture;\n\n\t\t\t\tif(this._data.isDepartingFromHere)\n\t\t\t\t{\n\t\t\t\t\tthis.detailsLabel.text = DEPARTING_FROM_TEXT;\n\t\t\t\t}\n\t\t\t\telse if(this._isInDestinationPhase)\n\t\t\t\t{\n\t\t\t\t\tthis.detailsLabel.text = TRAVEL_TO_TEXT;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.detailsLabel.text = DEPART_FROM_TEXT;\n\t\t\t\t}\n\n\t\t\t\tif(!this.isSelectionWaitingToBeAnimated)\n\t\t\t\t{\n\t\t\t\t\tthis.background.alpha = displayAsSelected ? 1 : 0;\n\t\t\t\t}\n\t\t\t\tif(!this.isSelectionWaitingToBeAnimated || displayAsSelected)\n\t\t\t\t{\n\t\t\t\t\tthis.detailsLabel.visible = displayAsSelected;\n\t\t\t\t}\n\t\t\t\t//the action container will disappear after the departure\n\t\t\t\t//station has been selected, so it has different rules\n\t\t\t\tif(!this._data.isDepartingFromHere && (!this.isSelectionWaitingToBeAnimated || this._isSelected))\n\t\t\t\t{\n\t\t\t\t\tthis.actionContainer.visible = this._isSelected;\n\t\t\t\t\tthis.actionContainer.alpha = this._isSelected ? 1 : 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.nameLabel.text = null;\n\t\t\t\tthis.detailsLabel.text = null;\n\t\t\t\tthis.actionContainer.visible = false;\n\t\t\t\tthis.background.alpha = 0;\n\t\t\t\tthis.icon.source = null;\n\t\t\t}\n\t\t}\n\n\t\tprotected function layout():void\n\t\t{\n\t\t\tthis.background.width = this.actualWidth;\n\t\t\tthis.background.height = this.actualHeight;\n\n\t\t\tthis.icon.validate();\n\t\t\tthis.icon.x = this._paddingLeft;\n\t\t\tvar leftMarginWidth:Number = this._paddingLeft + this.icon.width + this._gap;\n\t\t\tvar availableLabelWidth:Number = this.actualWidth - this._paddingRight - leftMarginWidth;\n\t\t\tvar availableLabelHeight:Number = this.actualHeight - this._paddingTop - this._paddingBottom;\n\n\t\t\tthis.actionContainer.width = availableLabelWidth;\n\n\t\t\tthis.nameLabel.validate();\n\t\t\tthis.detailsLabel.validate();\n\t\t\tthis.actionContainer.validate();\n\n\t\t\tvar displayAsSelected:Boolean = this._isSelected || (this._data && this._data.isDepartingFromHere);\n\t\t\tif((displayAsSelected && this.isSelectionWaitingToBeAnimated) ||\n\t\t\t\t(!displayAsSelected && !this.isSelectionWaitingToBeAnimated))\n\t\t\t{\n\t\t\t\tthis.actionContainer.x = this.actualWidth;\n\t\t\t\tthis.detailsLabel.alpha = 0;\n\t\t\t\tthis.nameLabel.x = leftMarginWidth;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.actionContainer.x = this.actualWidth - this.actionContainer.width;\n\t\t\t\tthis.detailsLabel.alpha = 1;\n\t\t\t\tthis.nameLabel.x = leftMarginWidth + (availableLabelWidth - this.nameLabel.width) / 2;\n\t\t\t}\n\t\t\tif(this.isSelectionWaitingToBeAnimated)\n\t\t\t{\n\t\t\t\tthis.isSelectionWaitingToBeAnimated = false;\n\t\t\t\tthis.selectionTween = new Tween(this.nameLabel, 0.35, Transitions.EASE_OUT);\n\t\t\t\tif(displayAsSelected)\n\t\t\t\t{\n\t\t\t\t\tthis.selectionTween.animate(\"x\", leftMarginWidth + (availableLabelWidth - this.nameLabel.width) / 2);\n\t\t\t\t\tthis.selectionTween.onComplete = selectionTween_onSelectComplete;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.selectionTween.animate(\"x\", leftMarginWidth);\n\t\t\t\t\tthis.selectionTween.onComplete = selectionTween_onDeselectComplete;\n\t\t\t\t}\n\t\t\t\tthis.selectionTween.onUpdate = selectionTween_onUpdate;\n\t\t\t\tStarling.juggler.add(this.selectionTween);\n\t\t\t}\n\t\t\telse if(this._data && this._data.isDepartingFromHere && this.actionContainer.visible)\n\t\t\t{\n\t\t\t\tthis.selectionTween = new Tween(this.actionContainer, 0.35, Transitions.EASE_OUT);\n\t\t\t\tthis.selectionTween.fadeTo(0);\n\t\t\t\tthis.selectionTween.onComplete = selectionTween_onConfirmComplete;\n\t\t\t\tStarling.juggler.add(this.selectionTween);\n\t\t\t}\n\n\t\t\tthis.nameLabel.y = (availableLabelHeight - this.nameLabel.height) / 2;\n\t\t\tthis.detailsLabel.x = leftMarginWidth + (availableLabelWidth - this.detailsLabel.width) / 2;\n\t\t\tthis.detailsLabel.y = this.nameLabel.y - this.detailsLabel.height + this.detailsLabel.height - this.detailsLabel.baseline;\n\t\t\tthis.actionContainer.y = this.actualHeight - this.actionContainer.height;\n\t\t}\n\n\t\tprotected function selectionTween_onUpdate():void\n\t\t{\n\t\t\tvar ratio:Number = this.selectionTween.transitionFunc(this.selectionTween.currentTime / this.selectionTween.totalTime);\n\t\t\tif(!this._isSelected)\n\t\t\t{\n\t\t\t\tratio = 1 - ratio;\n\t\t\t}\n\t\t\tthis.detailsLabel.alpha = this.background.alpha = ratio;\n\t\t\tthis.actionContainer.x = this.actualWidth - this.actionContainer.width * ratio;\n\t\t}\n\n\t\tprotected function selectionTween_onSelectComplete():void\n\t\t{\n\t\t\tthis.selectionTween = null;\n\t\t}\n\n\t\tprotected function selectionTween_onDeselectComplete():void\n\t\t{\n\t\t\tthis.detailsLabel.visible = false;\n\t\t\tthis.actionContainer.visible = false;\n\t\t\tthis.selectionTween = null;\n\t\t}\n\n\t\tprotected function selectionTween_onConfirmComplete():void\n\t\t{\n\t\t\tthis.actionContainer.visible = false;\n\t\t\tthis.selectionTween = null;\n\t\t}\n\n\t\tprotected function touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar touches:Vector.<Touch> = event.getTouches(this, null, HELPER_TOUCHES_VECTOR);\n\t\t\tif(touches.length == 0)\n\t\t\t{\n\t\t\t\t//end of hover\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._touchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar touch:Touch;\n\t\t\t\tfor each(var currentTouch:Touch in touches)\n\t\t\t\t{\n\t\t\t\t\tif(currentTouch.id == this._touchPointID)\n\t\t\t\t\t{\n\t\t\t\t\t\ttouch = currentTouch;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\t//end of hover\n\t\t\t\t\tHELPER_TOUCHES_VECTOR.length = 0;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif(touch.phase == TouchPhase.ENDED)\n\t\t\t\t{\n\t\t\t\t\tthis._touchPointID = -1;\n\t\t\t\t\ttouch.getLocation(this, HELPER_POINT);\n\t\t\t\t\tvar isInBounds:Boolean = this.hitTest(HELPER_POINT) !== null;\n\t\t\t\t\tif(isInBounds)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(!this._isSelected && !this._data.isDepartingFromHere)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.isSelected = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //if we get here, we don't have a saved touch ID yet\n\t\t\t{\n\t\t\t\tfor each(touch in touches)\n\t\t\t\t{\n\t\t\t\t\tif(touch.phase == TouchPhase.BEGAN)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._touchPointID = touch.id;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tHELPER_TOUCHES_VECTOR.length = 0;\n\t\t}\n\n\t\tprotected function owner_scrollHandler(event:Event):void\n\t\t{\n\t\t\tthis._touchPointID = -1;\n\t\t}\n\n\t\tprotected function confirmButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tif(this.confirmCallback == null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.confirmCallback();\n\t\t}\n\n\t\tprotected function cancelButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis._owner.selectedIndex = -1;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/TrainTimes/source/feathers/examples/trainTimes/model/StationData.as",
    "content": "package feathers.examples.trainTimes.model\n{\n\tpublic class StationData\n\t{\n\t\tpublic function StationData(name:String)\n\t\t{\n\t\t\tthis.name = name;\n\t\t}\n\n\t\tpublic var name:String;\n\t\tpublic var isDepartingFromHere:Boolean = false;\n\t}\n}\n"
  },
  {
    "path": "examples/TrainTimes/source/feathers/examples/trainTimes/model/TimeData.as",
    "content": "package feathers.examples.trainTimes.model\n{\n\tpublic class TimeData\n\t{\n\t\tpublic function TimeData(trainNumber:int, departureTime:Date, arrivalTime:Date)\n\t\t{\n\t\t\tthis.trainNumber = trainNumber;\n\t\t\tthis.departureTime = departureTime;\n\t\t\tthis.arrivalTime = arrivalTime;\n\t\t}\n\n\t\tpublic var trainNumber:int;\n\t\tpublic var departureTime:Date;\n\t\tpublic var arrivalTime:Date;\n\t}\n}\n"
  },
  {
    "path": "examples/TrainTimes/source/feathers/examples/trainTimes/screens/StationScreen.as",
    "content": "package feathers.examples.trainTimes.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.List;\n\timport feathers.controls.Screen;\n\timport feathers.data.ListCollection;\n\timport feathers.data.VectorCollection;\n\timport feathers.examples.trainTimes.controls.StationListItemRenderer;\n\timport feathers.examples.trainTimes.model.StationData;\n\n\timport flash.events.KeyboardEvent;\n\timport flash.ui.Keyboard;\n\n\timport starling.animation.Transitions;\n\timport starling.animation.Tween;\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class StationScreen extends Screen\n\t{\n\t\tpublic static const CHILD_STYLE_NAME_STATION_LIST:String = \"stationList\";\n\t\tpublic static const CHILD_STYLE_NAME_STATION_LIST_ITEM_RENDERER:String = \"stationListItemRenderer\";\n\t\tpublic static const CHILD_STYLE_NAME_STATION_LIST_FIRST_ITEM_RENDERER:String = \"stationListFirstItemRenderer\";\n\t\tpublic static const CHILD_STYLE_NAME_STATION_LIST_LAST_ITEM_RENDERER:String = \"stationListLastItemRenderer\";\n\t\t\n\t\tprivate static const FIRST_ITEM_RENDERER_ID:String = \"station-list-first-item-renderer\";\n\t\tprivate static const LAST_ITEM_RENDERER_ID:String = \"station-list-last-item-renderer\";\n\n\t\tpublic function StationScreen()\n\t\t{\n\t\t\tthis.addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);\n\t\t\tthis.addEventListener(Event.REMOVED_FROM_STAGE, removedFromStageHandler);\n\t\t}\n\n\t\tpublic var selectedDepartureStation:StationData;\n\t\tpublic var selectedDestinationStation:StationData;\n\n\t\tprivate var _departureHeader:Header;\n\t\tprivate var _destinationHeader:Header;\n\t\tprivate var _backButton:Button;\n\t\tprivate var _stationList:List;\n\n\t\tprivate var _headerTween:Tween;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tthis._stationList = new List();\n\t\t\tthis._stationList.styleNameList.add(CHILD_STYLE_NAME_STATION_LIST);\n\t\t\tthis._stationList.dataProvider = new VectorCollection(new <StationData>\n\t\t\t[\n\t\t\t\tnew StationData(\"Ten Stone Road\"),\n\t\t\t\tnew StationData(\"Birch Grove\"),\n\t\t\t\tnew StationData(\"East Elm Court\"),\n\t\t\t\tnew StationData(\"Oakheart Hills\"),\n\t\t\t\tnew StationData(\"Timber Ridge\"),\n\t\t\t\tnew StationData(\"Old Mine Heights\"),\n\t\t\t\tnew StationData(\"Granite Estates\"),\n\t\t\t])\n\t\t\tthis._stationList.itemRendererFactory = this.createItemRenderer;\n\t\t\tthis._stationList.setItemRendererFactoryWithID(FIRST_ITEM_RENDERER_ID, this.createFirstItemRenderer);\n\t\t\tthis._stationList.setItemRendererFactoryWithID(LAST_ITEM_RENDERER_ID, this.createLastItemRenderer);\n\t\t\tthis._stationList.factoryIDFunction = this.factoryIDFunction;\n\t\t\tthis.addChild(this._stationList);\n\n\t\t\tthis._backButton = new Button();\n\t\t\tthis._backButton.visible = false;\n\t\t\tthis._backButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\n\t\t\tthis._departureHeader = new Header();\n\t\t\tthis._departureHeader.title = \"Choose Departure Station\";\n\t\t\tthis.addChild(this._departureHeader);\n\n\t\t\tthis._destinationHeader = new Header();\n\t\t\tthis._destinationHeader.title = \"Choose Destination Station\";\n\t\t\tthis._destinationHeader.leftItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tthis._backButton\n\t\t\t];\n\t\t\tthis.addChild(this._destinationHeader);\n\t\t}\n\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tthis._departureHeader.width = this.actualWidth;\n\t\t\tthis._destinationHeader.width = this.actualWidth;\n\n\t\t\tvar currentHeader:Header;\n\t\t\tif(this.selectedDepartureStation)\n\t\t\t{\n\t\t\t\tcurrentHeader = this._destinationHeader;\n\t\t\t\tthis._destinationHeader.x = 0;\n\t\t\t\tthis._destinationHeader.visible = true;\n\t\t\t\tthis._departureHeader.x = this.actualWidth;\n\t\t\t\tthis._departureHeader.visible = false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcurrentHeader = this._departureHeader;\n\t\t\t\tthis._destinationHeader.x = -this.actualWidth;\n\t\t\t\tthis._destinationHeader.visible = false;\n\t\t\t\tthis._departureHeader.x = 0;\n\t\t\t\tthis._departureHeader.visible = true;\n\t\t\t}\n\n\t\t\tcurrentHeader.validate();\n\t\t\tthis._stationList.y = currentHeader.height;\n\t\t\tthis._stationList.width = this.actualWidth;\n\t\t\tthis._stationList.height = this.actualHeight - this._stationList.y;\n\t\t}\n\n\t\tprivate function factoryIDFunction(item:Object, index:int):String\n\t\t{\n\t\t\tif(index == 0)\n\t\t\t{\n\t\t\t\treturn FIRST_ITEM_RENDERER_ID;\n\t\t\t}\n\t\t\telse if(index == this._stationList.dataProvider.length - 1)\n\t\t\t{\n\t\t\t\treturn LAST_ITEM_RENDERER_ID;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tprivate function createItemRenderer():StationListItemRenderer\n\t\t{\n\t\t\tvar itemRenderer:StationListItemRenderer = new StationListItemRenderer();\n\t\t\titemRenderer.styleNameList.add(CHILD_STYLE_NAME_STATION_LIST_ITEM_RENDERER);\n\t\t\titemRenderer.confirmCallback = this.stationList_onConfirm;\n\t\t\titemRenderer.isInDestinationPhase = false;\n\t\t\treturn itemRenderer;\n\t\t}\n\n\t\tprivate function createFirstItemRenderer():StationListItemRenderer\n\t\t{\n\t\t\tvar itemRenderer:StationListItemRenderer = new StationListItemRenderer();\n\t\t\titemRenderer.styleNameList.add(CHILD_STYLE_NAME_STATION_LIST_FIRST_ITEM_RENDERER);\n\t\t\titemRenderer.confirmCallback = this.stationList_onConfirm;\n\t\t\titemRenderer.isInDestinationPhase = false;\n\t\t\treturn itemRenderer;\n\t\t}\n\n\t\tprivate function createLastItemRenderer():StationListItemRenderer\n\t\t{\n\t\t\tvar itemRenderer:StationListItemRenderer = new StationListItemRenderer();\n\t\t\titemRenderer.styleNameList.add(CHILD_STYLE_NAME_STATION_LIST_LAST_ITEM_RENDERER);\n\t\t\titemRenderer.confirmCallback = this.stationList_onConfirm;\n\t\t\titemRenderer.isInDestinationPhase = false;\n\t\t\treturn itemRenderer;\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.selectedDepartureStation.isDepartingFromHere = false;\n\t\t\tvar index:int = this._stationList.dataProvider.getItemIndex(this.selectedDepartureStation);\n\t\t\tthis._stationList.dataProvider.updateItemAt(index);\n\t\t\tthis._stationList.selectedItem = this.selectedDepartureStation;\n\t\t\tthis.selectedDepartureStation = null;\n\t\t\tthis._backButton.visible = false;\n\t\t\tthis._departureHeader.title = \"Choose Departure Station\";\n\t\t\tthis._stationList.itemRendererProperties.isInDestinationPhase = false;\n\n\t\t\tthis._departureHeader.visible = true;\n\t\t\tif(this._headerTween)\n\t\t\t{\n\t\t\t\tStarling.juggler.remove(this._headerTween);\n\t\t\t\tthis._headerTween = null;\n\t\t\t}\n\t\t\tthis._headerTween = new Tween(this._departureHeader, 0.4, Transitions.EASE_OUT);\n\t\t\tthis._headerTween.animate(\"x\", 0);\n\t\t\tthis._headerTween.onUpdate = headerTween_onUpdate;\n\t\t\tthis._headerTween.onComplete = headerTween_onDestinationHideComplete;\n\t\t\tStarling.juggler.add(this._headerTween);\n\t\t}\n\n\t\tprivate function stationList_onConfirm():void\n\t\t{\n\t\t\tif(this.selectedDepartureStation)\n\t\t\t{\n\t\t\t\tthis.selectedDestinationStation = StationData(this._stationList.selectedItem);\n\t\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.selectedDepartureStation = StationData(this._stationList.selectedItem);\n\t\t\tthis.selectedDepartureStation.isDepartingFromHere = true;\n\n\t\t\tthis._departureHeader.title = \"Choose Destination Station\";\n\t\t\tthis._backButton.visible = true;\n\n\t\t\tthis._stationList.selectedIndex = -1;\n\t\t\tthis._stationList.itemRendererProperties.isInDestinationPhase = true;\n\n\t\t\tthis._destinationHeader.visible = true;\n\t\t\tif(this._headerTween)\n\t\t\t{\n\t\t\t\tStarling.juggler.remove(this._headerTween);\n\t\t\t\tthis._headerTween = null;\n\t\t\t}\n\t\t\tthis._headerTween = new Tween(this._departureHeader, 0.4, Transitions.EASE_OUT);\n\t\t\tthis._headerTween.animate(\"x\", this.actualWidth);\n\t\t\tthis._headerTween.onUpdate = headerTween_onUpdate;\n\t\t\tthis._headerTween.onComplete = headerTween_onDestinationShowComplete;\n\t\t\tStarling.juggler.add(this._headerTween);\n\t\t}\n\n\t\tprivate function headerTween_onUpdate():void\n\t\t{\n\t\t\tthis._destinationHeader.x = this._departureHeader.x - this.actualWidth;\n\t\t}\n\n\t\tprivate function headerTween_onDestinationShowComplete():void\n\t\t{\n\t\t\tthis._departureHeader.visible = false;\n\t\t\tthis._headerTween = null;\n\t\t}\n\n\t\tprivate function headerTween_onDestinationHideComplete():void\n\t\t{\n\t\t\tthis._destinationHeader.visible = false;\n\t\t\tthis._headerTween = null;\n\t\t}\n\n\t\tprivate function addedToStageHandler(event:Event):void\n\t\t{\n\t\t\tStarling.current.nativeStage.addEventListener(KeyboardEvent.KEY_DOWN, nativeStage_keyDownHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tStarling.current.nativeStage.removeEventListener(KeyboardEvent.KEY_DOWN, nativeStage_keyDownHandler);\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\n\t\tprivate function nativeStage_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(event.keyCode == Keyboard.BACK && this.selectedDepartureStation)\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.onBackButton();\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/TrainTimes/source/feathers/examples/trainTimes/screens/TimesScreen.as",
    "content": "package feathers.examples.trainTimes.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.List;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.renderers.IListItemRenderer;\n\timport feathers.data.ListCollection;\n\timport feathers.data.VectorCollection;\n\timport feathers.examples.trainTimes.model.TimeData;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class TimesScreen extends PanelScreen\n\t{\n\t\tpublic static const CHILD_STYLE_NAME_TIMES_LIST:String = \"timesList\";\n\n\t\tprivate static const NORTH_TIMES:Vector.<TimeData> = new <TimeData>\n\t\t[\n\t\t\tnew TimeData(281, new Date(2013, 2, 6, 13, 5), new Date(2013, 2, 6, 13, 19)),\n\t\t\tnew TimeData(281, new Date(2013, 2, 6, 14, 5), new Date(2013, 2, 6, 14, 19)),\n\t\t\tnew TimeData(281, new Date(2013, 2, 6, 15, 5), new Date(2013, 2, 6, 15, 19)),\n\t\t\tnew TimeData(281, new Date(2013, 2, 6, 16, 5), new Date(2013, 2, 6, 16, 19)),\n\t\t\tnew TimeData(281, new Date(2013, 2, 6, 17, 5), new Date(2013, 2, 6, 17, 21)),\n\t\t\tnew TimeData(281, new Date(2013, 2, 6, 17, 35), new Date(2013, 2, 6, 17, 51)),\n\t\t\tnew TimeData(281, new Date(2013, 2, 6, 18, 5), new Date(2013, 2, 6, 18, 21)),\n\t\t\tnew TimeData(281, new Date(2013, 2, 6, 18, 35), new Date(2013, 2, 6, 18, 51)),\n\t\t\tnew TimeData(281, new Date(2013, 2, 6, 19, 5), new Date(2013, 2, 6, 19, 21)),\n\t\t\tnew TimeData(281, new Date(2013, 2, 6, 20, 1), new Date(2013, 2, 6, 20, 12)),\n\t\t\tnew TimeData(281, new Date(2013, 2, 6, 20, 41), new Date(2013, 2, 6, 20, 52)),\n\t\t\tnew TimeData(281, new Date(2013, 2, 6, 21, 41), new Date(2013, 2, 6, 21, 52)),\n\t\t\tnew TimeData(281, new Date(2013, 2, 6, 22, 41), new Date(2013, 2, 6, 22, 52)),\n\t\t\tnew TimeData(281, new Date(2013, 2, 6, 23, 41), new Date(2013, 2, 6, 23, 52)),\n\t\t];\n\n\t\tpublic function TimesScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _backButton:Button;\n\t\tprivate var _list:List;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Schedule\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._list = new List();\n\t\t\tthis._list.styleNameList.add(CHILD_STYLE_NAME_TIMES_LIST);\n\t\t\tthis._list.dataProvider = new VectorCollection(NORTH_TIMES);\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis._list.itemRendererFactory = this.customItemRendererFactory;\n\t\t\tthis.addChild(this._list);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\tthis.backButtonHandler = this.onBackButton;\n\t\t}\n\n\t\tprivate function customItemRendererFactory():IListItemRenderer\n\t\t{\n\t\t\tvar itemRenderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\t\t\titemRenderer.labelFunction = list_labelFunction;\n\t\t\treturn itemRenderer;\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\tthis._backButton = new Button();\n\t\t\tthis._backButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tthis._backButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function list_labelFunction(item:TimeData):String\n\t\t{\n\t\t\tvar departureTime:Date = item.departureTime;\n\t\t\tvar arrivalTime:Date = item.arrivalTime;\n\t\t\tvar duration:int = (arrivalTime.getTime() - departureTime.getTime()) / 1000 / 60;\n\t\t\treturn this.formatTimeAsString(departureTime) + \"\\t\" + this.formatTimeAsString(arrivalTime) + \"\\t\" +\n\t\t\t\titem.trainNumber + \"\\t\" + duration + \"mins\";\n\t\t}\n\n\t\tprivate function formatTimeAsString(time:Date):String\n\t\t{\n\t\t\tvar hours:Number = time.hours;\n\t\t\tvar isAM:Boolean = hours < 12;\n\t\t\tvar hoursAsString:String = ((isAM ? hours : (hours - 12)) + 1).toString();\n\t\t\tvar minutes:Number = time.minutes;\n\t\t\tvar minutesAsString:String = minutes < 10 ? \"0\" + minutes : minutes.toString();\n\t\t\treturn hoursAsString + \":\" + minutesAsString + (isAM ? \"am\" : \"pm\");\n\t\t}\n\n\t\tprivate function onBackButton():void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.onBackButton();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/TrainTimes/source/feathers/examples/trainTimes/themes/TrainTimesTheme.as",
    "content": "package feathers.examples.trainTimes.themes\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Callout;\n\timport feathers.controls.Header;\n\timport feathers.controls.Label;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.List;\n\timport feathers.controls.SimpleScrollBar;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.text.StageTextTextEditor;\n\timport feathers.controls.text.TextFieldTextRenderer;\n\timport feathers.core.FeathersControl;\n\timport feathers.core.ITextEditor;\n\timport feathers.core.ITextRenderer;\n\timport feathers.core.PopUpManager;\n\timport feathers.examples.trainTimes.controls.StationListItemRenderer;\n\timport feathers.examples.trainTimes.screens.StationScreen;\n\timport feathers.examples.trainTimes.screens.TimesScreen;\n\timport feathers.layout.Direction;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.HorizontalLayout;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.themes.StyleNameFunctionTheme;\n\n\timport flash.geom.Rectangle;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.display.Image;\n\timport starling.display.Quad;\n\timport starling.events.ResizeEvent;\n\timport starling.text.TextFormat;\n\timport starling.textures.Texture;\n\timport starling.textures.TextureAtlas;\n\timport starling.utils.Align;\n\n\tpublic class TrainTimesTheme extends StyleNameFunctionTheme\n\t{\n\t\t[Embed(source=\"/../assets/images/traintimes.png\")]\n\t\tprotected static const ATLAS_IMAGE:Class;\n\n\t\t[Embed(source=\"/../assets/images/traintimes.xml\",mimeType=\"application/octet-stream\")]\n\t\tprotected static const ATLAS_XML:Class;\n\n\t\t[Embed(source=\"/../assets/fonts/SourceSansPro-Regular.ttf\",fontName=\"SourceSansPro\",mimeType=\"application/x-font\",embedAsCFF=\"false\")]\n\t\tprotected static const SOURCE_SANS_PRO_REGULAR:Class;\n\n\t\t[Embed(source=\"/../assets/fonts/SourceSansPro-Bold.ttf\",fontName=\"SourceSansProBold\",fontWeight=\"bold\",mimeType=\"application/x-font\",embedAsCFF=\"false\")]\n\t\tprotected static const SOURCE_SANS_PRO_BOLD:Class;\n\n\t\t[Embed(source=\"/../assets/fonts/SourceSansPro-BoldIt.ttf\",fontName=\"SourceSansProBoldItalic\",fontWeight=\"bold\",fontStyle=\"italic\",mimeType=\"application/x-font\",embedAsCFF=\"false\")]\n\t\tprotected static const SOURCE_SANS_PRO_BOLD_ITALIC:Class;\n\n\t\tprotected static const TIMES_LIST_ITEM_RENDERER_NAME:String = \"traintimes-times-list-item-renderer\";\n\n\t\tprotected static const HEADER_SCALE9_GRID:Rectangle = new Rectangle(1, 1, 1, 1);\n\t\tprotected static const HORIZONTAL_SCROLL_BAR_THUMB_SCALE9_GRID:Rectangle = new Rectangle(3, 0, 7, 4);\n\t\tprotected static const VERTICAL_SCROLL_BAR_THUMB_SCALE9_GRID:Rectangle = new Rectangle(0, 3, 4, 7);\n\n\t\tprotected static const PRIMARY_TEXT_COLOR:uint = 0xe8caa4;\n\t\tprotected static const DETAIL_TEXT_COLOR:uint = 0x64908a;\n\n\t\tprotected static function textRendererFactory():ITextRenderer\n\t\t{\n\t\t\tvar renderer:TextFieldTextRenderer = new TextFieldTextRenderer();\n\t\t\trenderer.embedFonts = true;\n\t\t\treturn renderer;\n\t\t}\n\n\t\tprotected static function textEditorFactory():ITextEditor\n\t\t{\n\t\t\treturn new StageTextTextEditor();\n\t\t}\n\n\t\tprotected static function popUpOverlayFactory():DisplayObject\n\t\t{\n\t\t\tvar quad:Quad = new Quad(100, 100, 0x1a1a1a);\n\t\t\tquad.alpha = 0.85;\n\t\t\treturn quad;\n\t\t}\n\n\t\tpublic function TrainTimesTheme()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.initialize();\n\t\t}\n\n\t\tprotected var primaryBackground:Image;\n\n\t\tprotected var defaultTextFormat:TextFormat;\n\t\tprotected var selectedTextFormat:TextFormat;\n\t\tprotected var headerTitleTextFormat:TextFormat;\n\t\tprotected var stationListNameTextFormat:TextFormat;\n\t\tprotected var stationListDetailTextFormat:TextFormat;\n\n\t\tprotected var atlas:TextureAtlas;\n\t\tprotected var mainBackgroundTexture:Texture;\n\t\tprotected var headerBackgroundTexture:Texture;\n\t\tprotected var stationListNormalIconTexture:Texture;\n\t\tprotected var stationListFirstNormalIconTexture:Texture;\n\t\tprotected var stationListLastNormalIconTexture:Texture;\n\t\tprotected var stationListSelectedIconTexture:Texture;\n\t\tprotected var stationListFirstSelectedIconTexture:Texture;\n\t\tprotected var stationListLastSelectedIconTexture:Texture;\n\t\tprotected var confirmIconTexture:Texture;\n\t\tprotected var cancelIconTexture:Texture;\n\t\tprotected var backIconTexture:Texture;\n\t\tprotected var horizontalScrollBarThumbSkinTexture:Texture;\n\t\tprotected var verticalScrollBarThumbSkinTexture:Texture;\n\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this.primaryBackground)\n\t\t\t{\n\t\t\t\tStarling.current.stage.removeEventListener(ResizeEvent.RESIZE, stage_resizeHandler);\n\t\t\t\tStarling.current.stage.removeChild(this.primaryBackground, true);\n\t\t\t\tthis.primaryBackground = null;\n\t\t\t}\n\t\t\tif(this.atlas)\n\t\t\t{\n\t\t\t\tthis.atlas.dispose();\n\t\t\t\tthis.atlas = null;\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\tprotected function initialize():void\n\t\t{\n\t\t\tthis.initializeGlobals();\n\t\t\tthis.initializeTextures();\n\t\t\tthis.initializeStage();\n\t\t\tthis.initializeStyleProviders();\n\t\t}\n\n\t\tprotected function initializeStage():void\n\t\t{\n\t\t\tthis.primaryBackground = new Image(this.mainBackgroundTexture);\n\t\t\tthis.primaryBackground.tileGrid = new Rectangle();\n\t\t\tthis.primaryBackground.width = Starling.current.stage.stageWidth;\n\t\t\tthis.primaryBackground.height = Starling.current.stage.stageHeight;\n\t\t\tStarling.current.stage.addChildAt(this.primaryBackground, 0);\n\t\t\tStarling.current.stage.addEventListener(ResizeEvent.RESIZE, stage_resizeHandler);\n\t\t}\n\n\t\tprotected function initializeGlobals():void\n\t\t{\n\t\t\tFeathersControl.defaultTextRendererFactory = textRendererFactory;\n\t\t\tFeathersControl.defaultTextEditorFactory = textEditorFactory;\n\n\t\t\tPopUpManager.overlayFactory = popUpOverlayFactory;\n\t\t\tCallout.stagePaddingTop = Callout.stagePaddingRight = Callout.stagePaddingBottom =\n\t\t\t\tCallout.stagePaddingLeft = 8;\n\t\t}\n\n\t\tprotected function initializeTextures():void\n\t\t{\n\t\t\tvar atlasTexture:Texture = Texture.fromEmbeddedAsset(ATLAS_IMAGE, false, false, 2);\n\t\t\tthis.atlas = new TextureAtlas(atlasTexture, XML(new ATLAS_XML()));\n\n\t\t\tthis.mainBackgroundTexture = this.atlas.getTexture(\"main-background\");\n\t\t\tthis.headerBackgroundTexture = this.atlas.getTexture(\"header-background\");\n\t\t\tthis.stationListNormalIconTexture = this.atlas.getTexture(\"station-list-normal-icon\");\n\t\t\tthis.stationListFirstNormalIconTexture = this.atlas.getTexture(\"station-list-first-normal-icon\");\n\t\t\tthis.stationListLastNormalIconTexture = this.atlas.getTexture(\"station-list-last-normal-icon\");\n\t\t\tthis.stationListSelectedIconTexture = this.atlas.getTexture(\"station-list-selected-icon\");\n\t\t\tthis.stationListFirstSelectedIconTexture = this.atlas.getTexture(\"station-list-first-selected-icon\");\n\t\t\tthis.stationListLastSelectedIconTexture = this.atlas.getTexture(\"station-list-last-selected-icon\");\n\t\t\tthis.confirmIconTexture = this.atlas.getTexture(\"confirm-icon\");\n\t\t\tthis.cancelIconTexture = this.atlas.getTexture(\"cancel-icon\");\n\t\t\tthis.backIconTexture = this.atlas.getTexture(\"back-icon\");\n\t\t\tthis.horizontalScrollBarThumbSkinTexture = this.atlas.getTexture(\"horizontal-scroll-bar-thumb-skin\");\n\t\t\tthis.verticalScrollBarThumbSkinTexture = this.atlas.getTexture(\"vertical-scroll-bar-thumb-skin\");\n\n\t\t\t//we need to use different font names because Flash runtimes seem to\n\t\t\t//have a bug where setting defaultTextFormat on a TextField with a\n\t\t\t//different TextFormat that has the same font name as the existing\n\t\t\t//defaultTextFormat value causes the new TextFormat to be ignored,\n\t\t\t//even if the new TextFormat has different bold or italic values.\n\t\t\t//wtf, right?\n\t\t\tvar regularFontName:String = \"SourceSansPro\";\n\t\t\tvar boldFontName:String = \"SourceSansProBold\";\n\t\t\tvar boldItalicFontName:String = \"SourceSansProBoldItalic\";\n\t\t\tthis.defaultTextFormat = new TextFormat(regularFontName, 18, PRIMARY_TEXT_COLOR, Align.LEFT, Align.TOP);\n\t\t\tthis.selectedTextFormat = new TextFormat(boldFontName, 18, PRIMARY_TEXT_COLOR, Align.LEFT, Align.TOP);\n\t\t\tthis.selectedTextFormat.bold = true;\n\t\t\tthis.headerTitleTextFormat = new TextFormat(regularFontName, 18, PRIMARY_TEXT_COLOR, Align.LEFT, Align.TOP);\n\t\t\tthis.stationListNameTextFormat = new TextFormat(boldItalicFontName, 24, PRIMARY_TEXT_COLOR, Align.LEFT, Align.TOP);\n\t\t\tthis.stationListNameTextFormat.bold = true;\n\t\t\tthis.stationListNameTextFormat.italic = true;\n\t\t\tthis.stationListDetailTextFormat = new TextFormat(boldFontName, 12, DETAIL_TEXT_COLOR, Align.LEFT, Align.TOP);\n\t\t\tthis.stationListDetailTextFormat.bold = true;\n\t\t\tthis.stationListDetailTextFormat.letterSpacing = 3;\n\t\t}\n\n\t\tprotected function initializeStyleProviders():void\n\t\t{\n\t\t\tthis.getStyleProviderForClass(Button).defaultStyleFunction = setButtonStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(StationListItemRenderer.CHILD_STYLE_NAME_STATION_LIST_CONFIRM_BUTTON, setConfirmButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(StationListItemRenderer.CHILD_STYLE_NAME_STATION_LIST_CANCEL_BUTTON, setCancelButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(SimpleScrollBar.DEFAULT_CHILD_STYLE_NAME_THUMB, setNoStyles);\n\t\t\tthis.getStyleProviderForClass(Label).defaultStyleFunction = setLabelStyles;\n\t\t\tthis.getStyleProviderForClass(Label).setFunctionForStyleName(StationListItemRenderer.CHILD_STYLE_NAME_STATION_LIST_NAME_LABEL, setStationListNameLabelStyles);\n\t\t\tthis.getStyleProviderForClass(Label).setFunctionForStyleName(StationListItemRenderer.CHILD_STYLE_NAME_STATION_LIST_DETAILS_LABEL, setStationListDetailLabelStyles);\n\t\t\tthis.getStyleProviderForClass(Header).defaultStyleFunction = setHeaderStyles;\n\t\t\tthis.getStyleProviderForClass(List).setFunctionForStyleName(StationScreen.CHILD_STYLE_NAME_STATION_LIST, setStationListStyles);\n\t\t\tthis.getStyleProviderForClass(List).setFunctionForStyleName(TimesScreen.CHILD_STYLE_NAME_TIMES_LIST, setTimesListStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).setFunctionForStyleName(TIMES_LIST_ITEM_RENDERER_NAME, setTimesListItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(StationListItemRenderer).setFunctionForStyleName(StationScreen.CHILD_STYLE_NAME_STATION_LIST_ITEM_RENDERER, setStationListItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(StationListItemRenderer).setFunctionForStyleName(StationScreen.CHILD_STYLE_NAME_STATION_LIST_FIRST_ITEM_RENDERER, setStationListFirstItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(StationListItemRenderer).setFunctionForStyleName(StationScreen.CHILD_STYLE_NAME_STATION_LIST_LAST_ITEM_RENDERER, setStationListLastItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(LayoutGroup).setFunctionForStyleName(StationListItemRenderer.CHILD_STYLE_NAME_STATION_LIST_ACTION_CONTAINER, setActionContainerStyles);\n\t\t}\n\n\t\tprotected function horizontalScrollBarFactory():SimpleScrollBar\n\t\t{\n\t\t\tvar scrollBar:SimpleScrollBar = new SimpleScrollBar();\n\t\t\tscrollBar.direction = Direction.HORIZONTAL;\n\t\t\tvar defaultSkin:Image = new Image(this.horizontalScrollBarThumbSkinTexture);\n\t\t\tdefaultSkin.scale9Grid = HORIZONTAL_SCROLL_BAR_THUMB_SCALE9_GRID;\n\t\t\tdefaultSkin.width = 5;\n\t\t\tscrollBar.thumbProperties.defaultSkin = defaultSkin;\n\t\t\tscrollBar.paddingRight = scrollBar.paddingBottom = scrollBar.paddingLeft = 2;\n\t\t\treturn scrollBar;\n\t\t}\n\n\t\tprotected function verticalScrollBarFactory():SimpleScrollBar\n\t\t{\n\t\t\tvar scrollBar:SimpleScrollBar = new SimpleScrollBar();\n\t\t\tscrollBar.direction = Direction.VERTICAL;\n\t\t\tvar defaultSkin:Image = new Image(this.verticalScrollBarThumbSkinTexture);\n\t\t\tdefaultSkin.scale9Grid = VERTICAL_SCROLL_BAR_THUMB_SCALE9_GRID;\n\t\t\tdefaultSkin.height = 5;\n\t\t\tscrollBar.thumbProperties.defaultSkin = defaultSkin;\n\t\t\tscrollBar.paddingTop = scrollBar.paddingRight = scrollBar.paddingBottom = 2;\n\t\t\treturn scrollBar;\n\t\t}\n\n\t\tprotected function setNoStyles(target:DisplayObject):void {}\n\n\t\tprotected function setLabelStyles(label:Label):void\n\t\t{\n\t\t\tlabel.fontStyles = this.defaultTextFormat;\n\t\t}\n\n\t\tprotected function setStationListNameLabelStyles(label:Label):void\n\t\t{\n\t\t\tlabel.fontStyles = this.stationListNameTextFormat;\n\t\t}\n\n\t\tprotected function setStationListDetailLabelStyles(label:Label):void\n\t\t{\n\t\t\tlabel.fontStyles = this.stationListDetailTextFormat;\n\t\t}\n\n\t\tprotected function setButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar defaultIcon:Image = new Image(this.backIconTexture);\n\t\t\tbutton.defaultIcon = defaultIcon;\n\t\t\tbutton.minWidth = button.minHeight = 22;\n\t\t\tbutton.minTouchWidth = button.minTouchHeight = 44;\n\t\t}\n\n\t\tprotected function setConfirmButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar defaultIcon:Image = new Image(this.confirmIconTexture);\n\t\t\tbutton.defaultIcon = defaultIcon;\n\t\t\tbutton.minWidth = button.minHeight = 22;\n\t\t\tbutton.minTouchWidth = button.minTouchHeight = 44;\n\t\t}\n\n\t\tprotected function setCancelButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar defaultIcon:Image = new Image(this.cancelIconTexture);\n\t\t\tbutton.defaultIcon = defaultIcon;\n\t\t\tbutton.minWidth = button.minHeight = 22;\n\t\t\tbutton.minTouchWidth = button.minTouchHeight = 44;\n\t\t}\n\n\t\tprotected function setHeaderStyles(header:Header):void\n\t\t{\n\t\t\theader.useExtraPaddingForOSStatusBar = true;\n\t\t\t\n\t\t\theader.minWidth = 44;\n\t\t\theader.minHeight = 44;\n\t\t\theader.padding = 7;\n\t\t\theader.titleAlign = HorizontalAlign.RIGHT;\n\n\t\t\tvar backgroundSkin:Image = new Image(this.headerBackgroundTexture);\n\t\t\tbackgroundSkin.scale9Grid = HEADER_SCALE9_GRID;\n\t\t\theader.backgroundSkin = backgroundSkin;\n\t\t\t\n\t\t\theader.fontStyles = this.headerTitleTextFormat;\n\t\t}\n\n\t\tprotected function setStationListStyles(list:List):void\n\t\t{\n\t\t\tlist.horizontalScrollBarFactory = this.horizontalScrollBarFactory;\n\t\t\tlist.verticalScrollBarFactory = this.verticalScrollBarFactory;\n\t\t}\n\n\t\tprotected function setTimesListStyles(list:List):void\n\t\t{\n\t\t\tlist.horizontalScrollBarFactory = this.horizontalScrollBarFactory;\n\t\t\tlist.verticalScrollBarFactory = this.verticalScrollBarFactory;\n\t\t\tlist.customItemRendererStyleName = TIMES_LIST_ITEM_RENDERER_NAME;\n\t\t}\n\n\t\tprotected function setTimesListItemRendererStyles(renderer:DefaultListItemRenderer):void\n\t\t{\n\t\t\tvar defaultSkin:Quad = new Quad(44, 44, 0xff00ff);\n\t\t\tdefaultSkin.alpha = 0;\n\t\t\trenderer.defaultSkin = defaultSkin;\n\t\t\tvar defaultSelectedSkin:Quad = new Quad(44, 44, 0xcc2a41);\n\t\t\trenderer.defaultSelectedSkin = defaultSelectedSkin;\n\t\t\trenderer.fontStyles = this.defaultTextFormat;\n\t\t\trenderer.selectedFontStyles = this.selectedTextFormat;\n\t\t\trenderer.paddingLeft = 4;\n\t\t\trenderer.paddingRight = 8;\n\t\t}\n\n\t\tprotected function setStationListItemRendererStyles(renderer:StationListItemRenderer):void\n\t\t{\n\t\t\trenderer.paddingLeft = 22;\n\t\t\trenderer.paddingRight = 16;\n\t\t\trenderer.normalIconTexture = this.stationListNormalIconTexture;\n\t\t\trenderer.selectedIconTexture = this.stationListSelectedIconTexture;\n\t\t}\n\n\t\tprotected function setStationListFirstItemRendererStyles(renderer:StationListItemRenderer):void\n\t\t{\n\t\t\trenderer.paddingLeft = 22;\n\t\t\trenderer.paddingRight = 16;\n\t\t\trenderer.normalIconTexture = this.stationListFirstNormalIconTexture;\n\t\t\trenderer.selectedIconTexture = this.stationListFirstSelectedIconTexture;\n\t\t}\n\n\t\tprotected function setStationListLastItemRendererStyles(renderer:StationListItemRenderer):void\n\t\t{\n\t\t\trenderer.paddingLeft = 22;\n\t\t\trenderer.paddingRight = 16;\n\t\t\trenderer.normalIconTexture = this.stationListLastNormalIconTexture;\n\t\t\trenderer.selectedIconTexture = this.stationListLastSelectedIconTexture;\n\t\t}\n\n\t\tprotected function setActionContainerStyles(container:LayoutGroup):void\n\t\t{\n\t\t\tvar backgroundSkin:Quad = new Quad(24, 24, 0xcc2a41);\n\t\t\tcontainer.backgroundSkin = backgroundSkin;\n\n\t\t\tvar layout:HorizontalLayout = new HorizontalLayout();\n\t\t\tlayout.paddingRight = 16;\n\t\t\tlayout.gap = 24;\n\t\t\tlayout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tlayout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\tcontainer.layout = layout;\n\t\t}\n\n\t\tprotected function stage_resizeHandler(event:ResizeEvent):void\n\t\t{\n\t\t\tthis.primaryBackground.width = event.width;\n\t\t\tthis.primaryBackground.height = event.height;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/TransitionsExplorer/README.md",
    "content": "# Feathers Transitions Explorer\n\nEach of the animated transitions available for the [Feathers](http://feathersui.com/) [`StackScreenNavigator`](http://feathersui.com/help/stack-screen-navigator.html) and [`ScreenNavigator`](http://feathersui.com/help/screen-navigator.html)components, presented as a mobile app.\n\n## Requirements\n\nIn addition to Starling Framework and Feathers, this example project requires the `MetalWorksMobileTheme` example theme. You can find the SWC file for this theme at the following location in the Feathers release build:\n\n\tthemes/MetalWorksMobileTheme/swc/MetalWorksMobileTheme.swc\n\n## Web Demo\n\nView the [Transitions Explorer](http://feathersui.com/examples/transitions-explorer/) in your browser."
  },
  {
    "path": "examples/TransitionsExplorer/build.properties",
    "content": "feathers.root = ${basedir}/../../source\nstarling.root = ${basedir}/../../third-party/starling\ntheme.root = ${basedir}/../../themes/MetalWorksMobileTheme/source\noutput.path = ${basedir}/output\nicon.path = ${basedir}/../shared-assets/icons\nlaunch.image.path = ${basedir}/assets/launch-images\n\nswf.version = 30"
  },
  {
    "path": "examples/TransitionsExplorer/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<project name=\"transitions-explorer\" default=\"build\" basedir=\".\">\n\t\n\t<!-- build.local.properties and sdk.local.proprties are optional files that\n\t\tcan be used to override the default properties. -->\n\t<property file=\"./build.local.properties\"/>\n\t<property file=\"./sdk.local.properties\"/>\n\t<property file=\"./build.properties\"/>\n\t<!-- inherit SDK properties from the root of the repository -->\n\t<property file=\"../../sdk.local.properties\"/>\n\t<property file=\"../../sdk.properties\"/>\n\n\t<target name=\"build\" depends=\"build-web,build-android,build-ios\"/>\n\n\t<target name=\"prepare\">\n\t\t<delete dir=\"${output.path}\"/>\n\t</target>\n\n\t<target name=\"build-web\" depends=\"prepare\">\n\t\t<echo message=\"Building TransitionsExplorerWeb.swf\"/>\n\t\t<java jar=\"${mxmlc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${flashplayer.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-advanced-telemetry=true\"/>\n\t\t\t<arg value=\"-frame=two,feathers.examples.transitionsExplorer.Main\"/>\n\t\t\t<arg value=\"-source-path+=source\"/>\n\t\t\t<arg value=\"-source-path+=${starling.root}\"/>\n\t\t\t<arg value=\"-source-path+=${feathers.root}\"/>\n\t\t\t<arg value=\"-source-path+=${theme.root}\"/>\n\t\t\t<arg value=\"source/TransitionsExplorerWeb.as\"/>\n\t\t\t<arg value=\"-output=${output.path}/TransitionsExplorerWeb.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"build-air-swf\" depends=\"prepare\">\n\t\t<echo message=\"Building TransitionsExplorer.swf\"/>\n\t\t<java jar=\"${mxmlc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${airmobile.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-advanced-telemetry=true\"/>\n\t\t\t<arg value=\"-source-path+=source\"/>\n\t\t\t<arg value=\"-source-path+=${starling.root}\"/>\n\t\t\t<arg value=\"-source-path+=${feathers.root}\"/>\n\t\t\t<arg value=\"-source-path+=${theme.root}\"/>\n\t\t\t<arg value=\"source/TransitionsExplorer.as\"/>\n\t\t\t<arg value=\"-output=${output.path}/TransitionsExplorer.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"-check-ios-properties\">\n\t\t<fail unless=\"ios.provision.path\"/>\n\t\t<fail unless=\"ios.certificate.path\"/>\n\t\t<fail unless=\"ios.certificate.password\"/>\n\t</target>\n\t<target name=\"build-ios\" depends=\"-check-ios-properties,build-air-swf\">\n\t\t<echo message=\"Packaging TransitionsExplorer.ipa\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"-target\"/>\n\t\t\t<arg value=\"ipa-app-store\"/>\n\t\t\t<!-- uncomment to use the new, faster compiling for ios -->\n\t\t\t<!--<arg value=\"-useLegacyAOT\"/>\n\t\t\t<arg value=\"no\"/>-->\n\t\t\t<!-- uncomment for actionscript sampling with scout on ios -->\n\t\t\t<!--<arg value=\"-sampler\"/>-->\n\t\t\t<arg value=\"-provisioning-profile\"/>\n\t\t\t<arg value=\"${ios.provision.path}\"/>\n\t\t\t<arg value=\"-keystore\"/>\n\t\t\t<arg value=\"${ios.certificate.path}\"/>\n\t\t\t<arg value=\"-storetype\"/>\n\t\t\t<arg value=\"pkcs12\"/>\n\t\t\t<arg value=\"-storepass\"/>\n\t\t\t<arg value=\"${ios.certificate.password}\"/>\n\t\t\t<arg value=\"${output.path}/TransitionsExplorer.ipa\"/>\n\t\t\t<arg value=\"source/TransitionsExplorer-app.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${icon.path}\"/>\n\t\t\t<arg line=\"icon29.png icon48.png icon50.png icon57.png icon58.png icon72.png icon87.png icon96.png icon100.png icon114.png icon128.png icon144.png icon180.png\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${launch.image.path}\"/>\n\t\t\t<arg value=\"Default~iphone.png\"/>\t\t\t\t\t\t\t<!-- iphone 3gs -->\n\t\t\t<arg value=\"Default@2x~iphone.png\"/>\t\t\t\t\t\t<!-- iphone 4/4s -->\n\t\t\t<arg value=\"Default-568h@2x~iphone.png\"/>\t\t\t\t\t<!-- iphone 5/5c/5s -->\n\t\t\t<arg value=\"Default-375w-667h@2x~iphone.png\"/>\t\t\t\t<!-- iphone 6/7/8 -->\n\t\t\t<arg value=\"Default-812h@3x~iphone.png\"/>\t\t\t\t\t<!-- iphone x (portrait) -->\n\t\t\t<arg value=\"Default-Landscape-812h@3x~iphone.png\"/>\t\t\t<!-- iphone x (landscape) -->\n\t\t\t<arg value=\"Default-414w-736h@3x~iphone.png\"/>\t\t\t\t<!-- iphone 6/7/8 plus (portrait) -->\n\t\t\t<arg value=\"Default-Landscape-414w-736h@3x~iphone.png\"/>\t<!-- iphone 6/7/8 plus (landscape) -->\n\t\t\t<arg value=\"Default-Portrait~ipad.png\"/>\t\t\t\t\t<!-- ipad 1/2 (portrait) -->\n\t\t\t<arg value=\"Default-PortraitUpsideDown~ipad.png\"/>\t\t\t<!-- ipad 1/2 (portrait upside down) -->\n\t\t\t<arg value=\"Default-Landscape~ipad.png\"/>\t\t\t\t\t<!-- ipad 1/2 (landscape left) -->\n\t\t\t<arg value=\"Default-LandscapeRight~ipad.png\"/>\t\t\t\t<!-- ipad 1/2 (landscape right) -->\n\t\t\t<arg value=\"Default-Portrait@2x~ipad.png\"/>\t\t\t\t\t<!-- ipad 3/air (portrait) -->\n\t\t\t<arg value=\"Default-LandscapeLeft@2x~ipad.png\"/>\t\t\t<!-- ipad 3/air (landscape left) -->\n\t\t\t<arg value=\"Default-LandscapeRight@2x~ipad.png\"/>\t\t\t<!-- ipad 3/air (landscape right) -->\n\t\t\t<arg value=\"Default-Portrait@2x.png\"/>\t\t\t\t\t\t<!-- ipad pro (portrait) -->\n\t\t\t<arg value=\"Default-Landscape@2x.png\"/>\t\t\t\t\t\t<!-- ipad pro (landscape) -->\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${output.path}\"/>\n\t\t\t<arg value=\"TransitionsExplorer.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"-check-android-properties\">\n\t\t<fail unless=\"android.certificate.path\"/>\n\t\t<fail unless=\"android.certificate.password\"/>\n\t</target>\n\t<target name=\"build-android\" depends=\"-check-android-properties,build-air-swf\">\n\t\t<echo message=\"Packaging TransitionsExplorer.apk\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"-target\"/>\n\t\t\t<arg value=\"apk-captive-runtime\"/>\n\t\t\t<arg value=\"-storetype\"/>\n\t\t\t<arg value=\"pkcs12\"/>\n\t\t\t<arg value=\"-keystore\"/>\n\t\t\t<arg value=\"${android.certificate.path}\"/>\n\t\t\t<arg value=\"-storepass\"/>\n\t\t\t<arg value=\"${android.certificate.password}\"/>\n\t\t\t<arg value=\"${output.path}/TransitionsExplorer.apk\"/>\n\t\t\t<arg value=\"source/TransitionsExplorer-app.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${icon.path}\"/>\n\t\t\t<arg line=\"icon29.png icon48.png icon50.png icon57.png icon58.png icon72.png icon87.png icon96.png icon100.png icon114.png icon128.png icon144.png icon180.png\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${output.path}\"/>\n\t\t\t<arg value=\"TransitionsExplorer.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"install-android\">\n\t\t<echo message=\"Installing TransitionsExplorer.apk\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"false\">\n\t\t\t<arg value=\"-uninstallApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"android\"/>\n\t\t\t<arg value=\"-appid\"/>\n\t\t\t<arg value=\"com.feathersui.examples.TransitionsExplorer\"/>\n\t\t</java>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-installApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"android\"/>\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"${output.path}/TransitionsExplorer.apk\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"install-ios\">\n\t\t<echo message=\"Installing TransitionsExplorer.ipa\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"false\">\n\t\t\t<arg value=\"-uninstallApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"iOS\"/>\n\t\t\t<arg value=\"-appid\"/>\n\t\t\t<arg value=\"com.feathersui.examples.TransitionsExplorer\"/>\n\t\t</java>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-installApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"iOS\"/>\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"${output.path}/TransitionsExplorer.ipa\"/>\n\t\t</java>\n\t</target>\n</project>"
  },
  {
    "path": "examples/TransitionsExplorer/source/TransitionsExplorer-app.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<application xmlns=\"http://ns.adobe.com/air/application/32.0\">\n\t<id>com.feathersui.examples.TransitionsExplorer</id>\n\t<filename>Transitions</filename>\n\t<name>Transitions</name>\n\t<versionNumber>4.2.0</versionNumber>\n\t<description>Transitions Explorer example application built with Feathers UI controls for Starling</description>\n\t<copyright>2021 Bowler Hat LLC</copyright>\n\n\t<initialWindow>\n\t\t<content>TransitionsExplorer.swf</content>\n\t\t<aspectRatio>landscape</aspectRatio>\n\t\t<fullScreen>true</fullScreen>\n\t\t<visible>true</visible>\n\t\t<renderMode>direct</renderMode>\n\t\t<depthAndStencil>true</depthAndStencil>\n\t</initialWindow>\n\n\t<supportedLanguages>en</supportedLanguages>\n\n\t<icon>\n\t\t<image29x29>icon29.png</image29x29>\n\t\t<image48x48>icon48.png</image48x48>\n\t\t<image50x50>icon50.png</image50x50>\n\t\t<image57x57>icon57.png</image57x57>\n\t\t<image58x58>icon58.png</image58x58>\n\t\t<image72x72>icon72.png</image72x72>\n\t\t<image87x87>icon87.png</image87x87>\n\t\t<image96x96>icon96.png</image96x96>\n\t\t<image100x100>icon100.png</image100x100>\n\t\t<image114x114>icon114.png</image114x114>\n\t\t<image128x128>icon128.png</image128x128>\n\t\t<image144x144>icon144.png</image144x144>\n\t\t<image180x180>icon180.png</image180x180>\n\t</icon>\n\t<android>\n\t\t<colorDepth>16bit</colorDepth>\n\t\t<manifestAdditions><![CDATA[\n\t\t\t<manifest android:installLocation=\"auto\">\n\t\t\t    <uses-permission android:name=\"android.permission.INTERNET\"/>\n\t\t\t</manifest>\n\t\t]]></manifestAdditions>\n\t</android>\n\t<iPhone>\n\t\t<InfoAdditions>\n\t\t<![CDATA[\n\t\t\t<key>UIDeviceFamily</key> \n\t\t\t<array> \n\t\t\t\t<string>1</string>\n\t\t\t\t<string>2</string>\n\t\t\t</array>\n\t\t\t<key>UIPrerenderedIcon</key>\n\t\t\t<true/>\n\t\t\t<key>UIStatusBarStyle</key>\n\t\t\t<string>UIStatusBarStyleLightContent</string>\n\t\t]]> \n\t\t</InfoAdditions>\n\t\t<requestedDisplayResolution>high</requestedDisplayResolution>\n\t</iPhone>\n</application>"
  },
  {
    "path": "examples/TransitionsExplorer/source/TransitionsExplorer.as",
    "content": "package\n{\n\timport feathers.examples.transitionsExplorer.Main;\n\timport feathers.utils.ScreenDensityScaleFactorManager;\n\n\timport flash.display.Loader;\n\timport flash.display.Sprite;\n\timport flash.display.StageAlign;\n\timport flash.display.StageScaleMode;\n\timport flash.display3D.Context3DProfile;\n\timport flash.display3D.Context3DRenderMode;\n\timport flash.events.Event;\n\timport flash.filesystem.File;\n\timport flash.filesystem.FileMode;\n\timport flash.filesystem.FileStream;\n\timport flash.system.Capabilities;\n\timport flash.utils.ByteArray;\n\n\timport starling.core.Starling;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#4a4137\")]\n\tpublic class TransitionsExplorer extends Sprite\n\t{\n\t\tpublic function TransitionsExplorer()\n\t\t{\n\t\t\tif(this.stage)\n\t\t\t{\n\t\t\t\tthis.stage.scaleMode = StageScaleMode.NO_SCALE;\n\t\t\t\tthis.stage.align = StageAlign.TOP_LEFT;\n\t\t\t}\n\t\t\tthis.mouseEnabled = this.mouseChildren = false;\n\t\t\tthis.showLaunchImage();\n\t\t\tthis.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);\n\t\t}\n\n\t\tprivate var _starling:Starling;\n\t\tprivate var _scaler:ScreenDensityScaleFactorManager;\n\t\tprivate var _launchImage:Loader;\n\n\t\tprivate function showLaunchImage():void\n\t\t{\n\t\t\tvar filePath:String;\n\t\t\tvar isPortraitOnly:Boolean = false;\n\t\t\tif(Capabilities.manufacturer.indexOf(\"iOS\") >= 0)\n\t\t\t{\n\t\t\t\tif(Capabilities.screenResolutionX == 1242 && Capabilities.screenResolutionY == 2208)\n\t\t\t\t{\n\t\t\t\t\t//iphone 6 plus\n\t\t\t\t\tfilePath = \"Default-414w-736h-Landscape@3x.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 1536 && Capabilities.screenResolutionY == 2048)\n\t\t\t\t{\n\t\t\t\t\t//ipad retina\n\t\t\t\t\tfilePath = \"Default-Landscape@2x.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 768 && Capabilities.screenResolutionY == 1024)\n\t\t\t\t{\n\t\t\t\t\t//ipad classic\n\t\t\t\t\tfilePath = \"Default-Landscape.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 750)\n\t\t\t\t{\n\t\t\t\t\t//iphone 6\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tfilePath = \"Default-375w-667h@2x.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 640)\n\t\t\t\t{\n\t\t\t\t\t//iphone retina\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tif(Capabilities.screenResolutionY == 1136)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-568h@2x.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default@2x.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 320)\n\t\t\t\t{\n\t\t\t\t\t//iphone classic\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tfilePath = \"Default.png\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(filePath)\n\t\t\t{\n\t\t\t\tvar file:File = File.applicationDirectory.resolvePath(filePath);\n\t\t\t\tif(file.exists)\n\t\t\t\t{\n\t\t\t\t\tvar bytes:ByteArray = new ByteArray();\n\t\t\t\t\tvar stream:FileStream = new FileStream();\n\t\t\t\t\tstream.open(file, FileMode.READ);\n\t\t\t\t\tstream.readBytes(bytes, 0, stream.bytesAvailable);\n\t\t\t\t\tstream.close();\n\t\t\t\t\tthis._launchImage = new Loader();\n\t\t\t\t\tthis._launchImage.loadBytes(bytes);\n\t\t\t\t\tif(isPortraitOnly)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._launchImage.rotation = -90;\n\t\t\t\t\t\tthis._launchImage.y = Capabilities.screenResolutionX;\n\t\t\t\t\t}\n\t\t\t\t\tthis.addChild(this._launchImage);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function loaderInfo_completeHandler(event:Event):void\n\t\t{\n\t\t\tStarling.multitouchEnabled = true;\n\t\t\tthis._starling = new Starling(Main, this.stage, null, null, Context3DRenderMode.AUTO, Context3DProfile.BASELINE);\n\t\t\tthis._starling.supportHighResolutions = true;\n\t\t\tthis._starling.skipUnchangedFrames = true;\n\t\t\tthis._starling.start();\n\t\t\tif(this._launchImage)\n\t\t\t{\n\t\t\t\tthis._starling.addEventListener(\"rootCreated\", starling_rootCreatedHandler);\n\t\t\t}\n\t\t\tthis._scaler = new ScreenDensityScaleFactorManager(this._starling);\n\n\t\t\tthis.stage.addEventListener(Event.DEACTIVATE, stage_deactivateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function starling_rootCreatedHandler(event:Object):void\n\t\t{\n\t\t\tif(this._launchImage)\n\t\t\t{\n\t\t\t\tthis.removeChild(this._launchImage);\n\t\t\t\tthis._launchImage.unloadAndStop(true);\n\t\t\t\tthis._launchImage = null;\n\t\t\t}\n\t\t}\n\n\t\tprivate function stage_deactivateHandler(event:Event):void\n\t\t{\n\t\t\tthis._starling.stop(true);\n\t\t\tthis.stage.addEventListener(Event.ACTIVATE, stage_activateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function stage_activateHandler(event:Event):void\n\t\t{\n\t\t\tthis.stage.removeEventListener(Event.ACTIVATE, stage_activateHandler);\n\t\t\tthis._starling.start();\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "examples/TransitionsExplorer/source/TransitionsExplorerWeb.as",
    "content": "package\n{\n\timport feathers.system.DeviceCapabilities;\n\n\timport flash.display.MovieClip;\n\timport flash.display.StageAlign;\n\timport flash.display.StageScaleMode;\n\timport flash.events.Event;\n\timport flash.geom.Rectangle;\n\timport flash.ui.ContextMenu;\n\timport flash.utils.getDefinitionByName;\n\n\timport starling.core.Starling;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#4a4137\")]\n\tpublic class TransitionsExplorerWeb extends MovieClip\n\t{\n\t\tpublic function TransitionsExplorerWeb()\n\t\t{\n\t\t\tvar menu:ContextMenu = new ContextMenu();\n\t\t\tmenu.hideBuiltInItems();\n\t\t\tthis.contextMenu = menu;\n\n\t\t\tif(this.stage)\n\t\t\t{\n\t\t\t\tthis.stage.align = StageAlign.TOP_LEFT;\n\t\t\t\tthis.stage.scaleMode = StageScaleMode.NO_SCALE;\n\t\t\t}\n\n\t\t\tthis.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);\n\t\t}\n\n\t\tprivate var _starling:Starling;\n\n\t\tprivate function start():void\n\t\t{\n\t\t\tthis.gotoAndStop(2);\n\t\t\tthis.graphics.clear();\n\n\t\t\t//simulating iPhone Retina\n\t\t\tDeviceCapabilities.dpi = 326;\n\n\t\t\tStarling.multitouchEnabled = true;\n\t\t\tvar MainType:Class = getDefinitionByName(\"feathers.examples.transitionsExplorer.Main\") as Class;\n\t\t\tthis._starling = new Starling(MainType, this.stage, new Rectangle(0, 0, 960, 640));\n\t\t\tthis._starling.supportHighResolutions = true;\n\t\t\tthis._starling.skipUnchangedFrames = true;\n\t\t\tthis._starling.stage.stageWidth = 480;\n\t\t\tthis._starling.stage.stageHeight = 320;\n\t\t\tthis._starling.start();\n\t\t}\n\n\t\tprivate function loaderInfo_completeHandler(event:Event):void\n\t\t{\n\t\t\tthis.start();\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/TransitionsExplorer/source/feathers/examples/transitionsExplorer/Main.as",
    "content": "package feathers.examples.transitionsExplorer\n{\n\timport feathers.controls.AutoSizeMode;\n\timport feathers.controls.ImageLoader;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.ScreenNavigator;\n\timport feathers.controls.ScreenNavigatorItem;\n\timport feathers.controls.StackScreenNavigator;\n\timport feathers.controls.StackScreenNavigatorItem;\n\timport feathers.examples.transitionsExplorer.screens.AllTransitionsScreen;\n\timport feathers.examples.transitionsExplorer.screens.ColorFadeTransitionScreen;\n\timport feathers.examples.transitionsExplorer.screens.FadeTransitionScreen;\n\timport feathers.examples.transitionsExplorer.screens.FourWayTransitionScreen;\n\timport feathers.examples.transitionsExplorer.screens.IrisTransitionScreen;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.motion.Cover;\n\timport feathers.motion.Cube;\n\timport feathers.motion.Flip;\n\timport feathers.motion.Reveal;\n\timport feathers.motion.Slide;\n\timport feathers.motion.Wipe;\n\timport feathers.themes.MetalWorksMobileTheme;\n\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.textures.Texture;\n\n\tpublic class Main extends LayoutGroup\n\t{\n\t\t[Embed(source=\"/../assets/images/test-pattern1.png\")]\n\t\tprivate static const TEST_PATTERN1:Class;\n\n\t\t[Embed(source=\"/../assets/images/test-pattern2.png\")]\n\t\tprivate static const TEST_PATTERN2:Class;\n\n\t\tprivate static const MENU_SCREEN_ID_ALL_TRANSITIONS:String = \"allTransitions\";\n\t\tprivate static const MENU_SCREEN_ID_COLOR_FADE:String = \"colorFade\";\n\t\tprivate static const MENU_SCREEN_ID_COVER:String = \"cover\";\n\t\tprivate static const MENU_SCREEN_ID_CUBE:String = \"cube\";\n\t\tprivate static const MENU_SCREEN_ID_FADE:String = \"fade\";\n\t\tprivate static const MENU_SCREEN_ID_FLIP:String = \"flip\";\n\t\tprivate static const MENU_SCREEN_ID_IRIS:String = \"iris\";\n\t\tprivate static const MENU_SCREEN_ID_REVEAL:String = \"reveal\";\n\t\tprivate static const MENU_SCREEN_ID_SLIDE:String = \"slide\";\n\t\tprivate static const MENU_SCREEN_ID_WIPE:String = \"wipe\";\n\n\t\tprivate static const CONTENT_SCREEN_ID_ONE:String = \"one\";\n\t\tprivate static const CONTENT_SCREEN_ID_TWO:String = \"two\";\n\n\t\tpublic function Main()\n\t\t{\n\t\t\t//set up the theme right away!\n\t\t\tnew MetalWorksMobileTheme();\n\t\t\tsuper();\n\t\t\tthis.autoSizeMode = AutoSizeMode.STAGE;\n\t\t}\n\n\t\tprivate var _menu:StackScreenNavigator;\n\t\tprivate var _content:ScreenNavigator;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._menu = new StackScreenNavigator();\n\t\t\tthis._menu.autoSizeMode = AutoSizeMode.CONTENT;\n\t\t\tvar menuLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tmenuLayoutData.top = 0;\n\t\t\tmenuLayoutData.bottom = 0;\n\t\t\tmenuLayoutData.left = 0;\n\t\t\tthis._menu.width = this.stage.stageWidth / 3;\n\t\t\tthis._menu.layoutData = new AnchorLayoutData(0, NaN, 0, 0);\n\t\t\tthis._menu.clipContent = true;\n\t\t\tthis.addChild(this._menu);\n\n\t\t\tvar allTransitionsItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(AllTransitionsScreen);\n\t\t\tallTransitionsItem.setScreenIDForPushEvent(AllTransitionsScreen.COVER, MENU_SCREEN_ID_COVER);\n\t\t\tallTransitionsItem.setScreenIDForPushEvent(AllTransitionsScreen.CUBE, MENU_SCREEN_ID_CUBE);\n\t\t\tallTransitionsItem.setScreenIDForPushEvent(AllTransitionsScreen.FADE, MENU_SCREEN_ID_FADE);\n\t\t\tallTransitionsItem.setScreenIDForPushEvent(AllTransitionsScreen.COLOR_FADE, MENU_SCREEN_ID_COLOR_FADE);\n\t\t\tallTransitionsItem.setScreenIDForPushEvent(AllTransitionsScreen.FLIP, MENU_SCREEN_ID_FLIP);\n\t\t\tallTransitionsItem.setScreenIDForPushEvent(AllTransitionsScreen.IRIS, MENU_SCREEN_ID_IRIS);\n\t\t\tallTransitionsItem.setScreenIDForPushEvent(AllTransitionsScreen.REVEAL, MENU_SCREEN_ID_REVEAL);\n\t\t\tallTransitionsItem.setScreenIDForPushEvent(AllTransitionsScreen.SLIDE, MENU_SCREEN_ID_SLIDE);\n\t\t\tallTransitionsItem.setScreenIDForPushEvent(AllTransitionsScreen.WIPE, MENU_SCREEN_ID_WIPE);\n\t\t\tthis._menu.addScreen(MENU_SCREEN_ID_ALL_TRANSITIONS, allTransitionsItem);\n\n\t\t\tvar colorFadeItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(ColorFadeTransitionScreen);\n\t\t\tcolorFadeItem.setFunctionForPushEvent(ColorFadeTransitionScreen.TRANSITION, transitionHandler);\n\t\t\tcolorFadeItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._menu.addScreen(MENU_SCREEN_ID_COLOR_FADE, colorFadeItem);\n\n\t\t\tvar coverItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(FourWayTransitionScreen);\n\t\t\tcoverItem.properties.transitionName = \"Cover\";\n\t\t\tcoverItem.properties.leftTransition = Cover.createCoverLeftTransition();\n\t\t\tcoverItem.properties.rightTransition = Cover.createCoverRightTransition();\n\t\t\tcoverItem.properties.upTransition = Cover.createCoverUpTransition();\n\t\t\tcoverItem.properties.downTransition = Cover.createCoverDownTransition();\n\t\t\tcoverItem.setFunctionForPushEvent(FourWayTransitionScreen.TRANSITION, transitionHandler);\n\t\t\tcoverItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._menu.addScreen(MENU_SCREEN_ID_COVER, coverItem);\n\n\t\t\tvar cubeItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(FourWayTransitionScreen);\n\t\t\tcubeItem.properties.transitionName = \"Cube\";\n\t\t\tcubeItem.properties.leftTransition = Cube.createCubeLeftTransition();\n\t\t\tcubeItem.properties.rightTransition = Cube.createCubeRightTransition();\n\t\t\tcubeItem.properties.upTransition = Cube.createCubeUpTransition();\n\t\t\tcubeItem.properties.downTransition = Cube.createCubeDownTransition();\n\t\t\tcubeItem.setFunctionForPushEvent(FourWayTransitionScreen.TRANSITION, transitionHandler);\n\t\t\tcubeItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._menu.addScreen(MENU_SCREEN_ID_CUBE, cubeItem);\n\n\t\t\tvar fadeItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(FadeTransitionScreen);\n\t\t\tfadeItem.setFunctionForPushEvent(FourWayTransitionScreen.TRANSITION, transitionHandler);\n\t\t\tfadeItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._menu.addScreen(MENU_SCREEN_ID_FADE, fadeItem);\n\n\t\t\tvar flipItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(FourWayTransitionScreen);\n\t\t\tflipItem.properties.transitionName = \"Flip\";\n\t\t\tflipItem.properties.leftTransition = Flip.createFlipLeftTransition();\n\t\t\tflipItem.properties.rightTransition = Flip.createFlipRightTransition();\n\t\t\tflipItem.properties.upTransition = Flip.createFlipUpTransition();\n\t\t\tflipItem.properties.downTransition = Flip.createFlipDownTransition();\n\t\t\tflipItem.setFunctionForPushEvent(FourWayTransitionScreen.TRANSITION, transitionHandler);\n\t\t\tflipItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._menu.addScreen(MENU_SCREEN_ID_FLIP, flipItem);\n\n\t\t\tvar irisItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(IrisTransitionScreen);\n\t\t\tirisItem.setFunctionForPushEvent(IrisTransitionScreen.TRANSITION, transitionHandler);\n\t\t\tirisItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._menu.addScreen(MENU_SCREEN_ID_IRIS, irisItem);\n\n\t\t\tvar revealItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(FourWayTransitionScreen);\n\t\t\trevealItem.properties.transitionName = \"Reveal\";\n\t\t\trevealItem.properties.leftTransition = Reveal.createRevealLeftTransition();\n\t\t\trevealItem.properties.rightTransition = Reveal.createRevealRightTransition();\n\t\t\trevealItem.properties.upTransition = Reveal.createRevealUpTransition();\n\t\t\trevealItem.properties.downTransition = Reveal.createRevealDownTransition();\n\t\t\trevealItem.setFunctionForPushEvent(FourWayTransitionScreen.TRANSITION, transitionHandler);\n\t\t\trevealItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._menu.addScreen(MENU_SCREEN_ID_REVEAL, revealItem);\n\n\t\t\tvar slideItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(FourWayTransitionScreen);\n\t\t\tslideItem.properties.transitionName = \"Slide\";\n\t\t\tslideItem.properties.leftTransition = Slide.createSlideLeftTransition();\n\t\t\tslideItem.properties.rightTransition = Slide.createSlideRightTransition();\n\t\t\tslideItem.properties.upTransition = Slide.createSlideUpTransition();\n\t\t\tslideItem.properties.downTransition = Slide.createSlideDownTransition();\n\t\t\tslideItem.setFunctionForPushEvent(FourWayTransitionScreen.TRANSITION, transitionHandler);\n\t\t\tslideItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._menu.addScreen(MENU_SCREEN_ID_SLIDE, slideItem);\n\n\t\t\tvar wipeItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(FourWayTransitionScreen);\n\t\t\twipeItem.properties.transitionName = \"Wipe\";\n\t\t\twipeItem.properties.leftTransition = Wipe.createWipeLeftTransition();\n\t\t\twipeItem.properties.rightTransition = Wipe.createWipeRightTransition();\n\t\t\twipeItem.properties.upTransition = Wipe.createWipeUpTransition();\n\t\t\twipeItem.properties.downTransition = Wipe.createWipeDownTransition();\n\t\t\twipeItem.setFunctionForPushEvent(FourWayTransitionScreen.TRANSITION, transitionHandler);\n\t\t\twipeItem.addPopEvent(Event.COMPLETE);\n\t\t\tthis._menu.addScreen(MENU_SCREEN_ID_WIPE, wipeItem);\n\n\t\t\tthis._menu.pushScreen(MENU_SCREEN_ID_ALL_TRANSITIONS);\n\n\t\t\tthis._menu.pushTransition = Slide.createSlideLeftTransition();\n\t\t\tthis._menu.popTransition = Slide.createSlideRightTransition();\n\n\t\t\tthis._content = new ScreenNavigator();\n\t\t\tvar contentLayoutData:AnchorLayoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tcontentLayoutData.leftAnchorDisplayObject = this._menu;\n\t\t\tthis._content.layoutData = contentLayoutData;\n\t\t\tthis.addChildAt(this._content, 0);\n\n\t\t\tvar content1:LayoutGroup = new LayoutGroup();\n\t\t\tcontent1.layout = new AnchorLayout();\n\t\t\tvar image:ImageLoader = new ImageLoader();\n\t\t\timage.source = Texture.fromEmbeddedAsset(TEST_PATTERN1, false);\n\t\t\timage.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tcontent1.addChild(image);\n\t\t\tcontent1.backgroundSkin = new Quad(1, 1, 0x000000);\n\t\t\tthis._content.addScreen(CONTENT_SCREEN_ID_ONE, new ScreenNavigatorItem(content1));\n\t\t\tvar content2:LayoutGroup = new LayoutGroup();\n\t\t\tcontent2.layout = new AnchorLayout();\n\t\t\timage = new ImageLoader();\n\t\t\timage.source = Texture.fromEmbeddedAsset(TEST_PATTERN2, false);\n\t\t\timage.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tcontent2.addChild(image);\n\t\t\tcontent2.backgroundSkin = new Quad(1, 1, 0xffffff);\n\t\t\tthis._content.addScreen(CONTENT_SCREEN_ID_TWO, new ScreenNavigatorItem(content2));\n\n\t\t\tthis._content.showScreen(CONTENT_SCREEN_ID_ONE);\n\n\t\t\t//we're not setting the transition on the content screen navigator\n\t\t\t//because the screens will select their own transitions.\n\t\t}\n\n\t\tprivate function getNextScreenID():String\n\t\t{\n\t\t\tif(this._content.activeScreenID == CONTENT_SCREEN_ID_ONE)\n\t\t\t{\n\t\t\t\treturn CONTENT_SCREEN_ID_TWO;\n\t\t\t}\n\t\t\treturn CONTENT_SCREEN_ID_ONE;\n\t\t}\n\n\t\tprivate function transitionHandler(event:Event, transition:Function):void\n\t\t{\n\t\t\tthis._content.showScreen(this.getNextScreenID(), transition);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/TransitionsExplorer/source/feathers/examples/transitionsExplorer/screens/AllTransitionsScreen.as",
    "content": "package feathers.examples.transitionsExplorer.screens\n{\n\timport feathers.controls.List;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.renderers.IListItemRenderer;\n\timport feathers.data.ArrayCollection;\n\timport feathers.data.ListCollection;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\n\timport starling.events.Event;\n\n\tpublic class AllTransitionsScreen extends PanelScreen\n\t{\n\t\tpublic static const COLOR_FADE:String = \"colorFade\";\n\t\tpublic static const COVER:String = \"cover\";\n\t\tpublic static const CUBE:String = \"cube\";\n\t\tpublic static const FADE:String = \"fade\";\n\t\tpublic static const FLIP:String = \"flip\";\n\t\tpublic static const IRIS:String = \"iris\";\n\t\tpublic static const REVEAL:String = \"reveal\";\n\t\tpublic static const SLIDE:String = \"slide\";\n\t\tpublic static const WIPE:String = \"wipe\";\n\n\t\tpublic function AllTransitionsScreen()\n\t\t{\n\t\t}\n\n\t\tprivate var _list:List;\n\n\t\tpublic var savedVerticalScrollPosition:Number = 0;\n\t\tpublic var savedSelectedIndex:int = -1;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Transitions\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._list = new List();\n\t\t\tthis._list.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ label: \"Color Fade\", event: COLOR_FADE },\n\t\t\t\t{ label: \"Cover\", event: COVER },\n\t\t\t\t{ label: \"Fade\", event: FADE },\n\t\t\t\t{ label: \"Cube\", event: CUBE },\n\t\t\t\t{ label: \"Flip\", event: FLIP },\n\t\t\t\t{ label: \"Iris\", event: IRIS },\n\t\t\t\t{ label: \"Reveal\", event: REVEAL },\n\t\t\t\t{ label: \"Slide\", event: SLIDE },\n\t\t\t\t{ label: \"Wipe\", event: WIPE },\n\t\t\t]);\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis._list.clipContent = false;\n\t\t\tthis._list.autoHideBackground = true;\n\t\t\tthis._list.verticalScrollPosition = this.savedVerticalScrollPosition;\n\t\t\tthis._list.selectedIndex = this.savedSelectedIndex;\n\n\t\t\tthis._list.itemRendererFactory = this.createItemRenderer;\n\n\t\t\tthis._list.addEventListener(Event.TRIGGERED, list_triggeredHandler);\n\t\t\tthis.addChild(this._list);\n\n\t\t\tthis.addEventListener(FeathersEventType.TRANSITION_IN_COMPLETE, transitionInCompleteHandler);\n\t\t}\n\t\t\n\t\tprivate function createItemRenderer():IListItemRenderer\n\t\t{\n\t\t\tvar renderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\t\t\trenderer.styleNameList.add(DefaultListItemRenderer.ALTERNATE_STYLE_NAME_DRILL_DOWN);\n\n\t\t\t//enable the quick hit area to optimize hit tests when an item\n\t\t\t//is only selectable and doesn't have interactive children.\n\t\t\trenderer.isQuickHitAreaEnabled = true;\n\n\t\t\trenderer.labelField = \"label\";\n\t\t\treturn renderer;\n\t\t};\n\n\t\tprivate function transitionInCompleteHandler(event:Event):void\n\t\t{\n\t\t\tthis._list.selectedIndex = -1;\n\t\t\tthis._list.revealScrollBars();\n\t\t}\n\n\t\tprivate function list_triggeredHandler(event:Event, item:Object):void\n\t\t{\n\t\t\tvar eventType:String = item.event as String;\n\t\t\tthis.dispatchEventWith(eventType, false,\n\t\t\t{\n\t\t\t\t//we're going to save the position of the list so that when the user\n\t\t\t\t//navigates back to this screen, they won't need to scroll back to\n\t\t\t\t//the same position manually\n\t\t\t\tsavedVerticalScrollPosition: this._list.verticalScrollPosition,\n\t\t\t\t//we'll also save the selected index to temporarily highlight\n\t\t\t\t//the previously selected item when transitioning back\n\t\t\t\tsavedSelectedIndex: this._list.selectedIndex\n\t\t\t});\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/TransitionsExplorer/source/feathers/examples/transitionsExplorer/screens/ColorFadeTransitionScreen.as",
    "content": "package feathers.examples.transitionsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.List;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.renderers.IListItemRenderer;\n\timport feathers.data.ArrayCollection;\n\timport feathers.data.ListCollection;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.motion.ColorFade;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\tpublic class ColorFadeTransitionScreen extends PanelScreen\n\t{\n\t\tpublic static const TRANSITION:String = \"transition\";\n\n\t\tprivate static function fadeToRandomColor(oldScreen:DisplayObject, newScreen:DisplayObject, completeCallback:Function):void\n\t\t{\n\t\t\tvar randomColor:uint = Math.random() * 0xffffff;\n\t\t\tColorFade.createColorFadeTransition(randomColor)(oldScreen, newScreen, completeCallback);\n\t\t}\n\n\t\tpublic function ColorFadeTransitionScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _list:List;\n\t\tprivate var _backButton:Button;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Color Fade\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._list = new List();\n\t\t\tthis._list.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ label: \"Black\", transition: ColorFade.createBlackFadeTransition() },\n\t\t\t\t{ label: \"White\", transition: ColorFade.createWhiteFadeTransition() },\n\t\t\t\t{ label: \"Custom\", transition: fadeToRandomColor, accessory: \"(random for demo)\" },\n\t\t\t]);\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis._list.clipContent = false;\n\t\t\tthis._list.autoHideBackground = true;\n\n\t\t\tthis._list.itemRendererFactory = function():IListItemRenderer\n\t\t\t{\n\t\t\t\tvar renderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\n\t\t\t\t//enable the quick hit area to optimize hit tests when an item\n\t\t\t\t//is only selectable and doesn't have interactive children.\n\t\t\t\trenderer.isQuickHitAreaEnabled = true;\n\n\t\t\t\trenderer.labelField = \"label\";\n\n\t\t\t\trenderer.accessoryLabelField = \"accessory\";\n\t\t\t\treturn renderer;\n\t\t\t};\n\n\t\t\tthis._list.addEventListener(Event.TRIGGERED, list_triggeredHandler);\n\t\t\tthis._list.revealScrollBars();\n\t\t\tthis.addChild(this._list);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\n\t\t\tthis._backButton = new Button();\n\t\t\tthis._backButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\tthis._backButton.label = \"Transitions\";\n\t\t\tthis._backButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\theader.leftItems = new <DisplayObject>[this._backButton];\n\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function list_triggeredHandler(event:Event, item:Object):void\n\t\t{\n\t\t\tvar transition:Function = item.transition as Function;\n\t\t\tthis.dispatchEventWith(TRANSITION, false, transition);\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/TransitionsExplorer/source/feathers/examples/transitionsExplorer/screens/FadeTransitionScreen.as",
    "content": "package feathers.examples.transitionsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.List;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.renderers.IListItemRenderer;\n\timport feathers.data.ArrayCollection;\n\timport feathers.data.ListCollection;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.motion.Fade;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\tpublic class FadeTransitionScreen extends PanelScreen\n\t{\n\t\tpublic static const TRANSITION:String = \"transition\";\n\n\t\tpublic function FadeTransitionScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _list:List;\n\t\tprivate var _backButton:Button;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Fade\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._list = new List();\n\t\t\tthis._list.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ label: \"Fade In\", transition: Fade.createFadeInTransition() },\n\t\t\t\t{ label: \"Fade Out\", transition: Fade.createFadeOutTransition() },\n\t\t\t\t{ label: \"Crossfade\", transition: Fade.createCrossfadeTransition() },\n\t\t\t]);\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis._list.clipContent = false;\n\t\t\tthis._list.autoHideBackground = true;\n\n\t\t\tthis._list.itemRendererFactory = function():IListItemRenderer\n\t\t\t{\n\t\t\t\tvar renderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\n\t\t\t\t//enable the quick hit area to optimize hit tests when an item\n\t\t\t\t//is only selectable and doesn't have interactive children.\n\t\t\t\trenderer.isQuickHitAreaEnabled = true;\n\n\t\t\t\trenderer.labelField = \"label\";\n\t\t\t\treturn renderer;\n\t\t\t};\n\n\t\t\tthis._list.addEventListener(Event.TRIGGERED, list_triggeredHandler);\n\t\t\tthis._list.revealScrollBars();\n\t\t\tthis.addChild(this._list);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\n\t\t\tthis._backButton = new Button();\n\t\t\tthis._backButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\tthis._backButton.label = \"Transitions\";\n\t\t\tthis._backButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\theader.leftItems = new <DisplayObject>[this._backButton];\n\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function list_triggeredHandler(event:Event, item:Object):void\n\t\t{\n\t\t\tvar transition:Function = item.transition as Function;\n\t\t\tthis.dispatchEventWith(TRANSITION, false, transition);\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/TransitionsExplorer/source/feathers/examples/transitionsExplorer/screens/FourWayTransitionScreen.as",
    "content": "package feathers.examples.transitionsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.List;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.renderers.IListItemRenderer;\n\timport feathers.data.ArrayCollection;\n\timport feathers.data.ListCollection;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\tpublic class FourWayTransitionScreen extends PanelScreen\n\t{\n\t\tpublic static const TRANSITION:String = \"transition\";\n\n\t\tpublic function FourWayTransitionScreen()\n\t\t{\n\t\t}\n\n\t\tprivate var _list:List;\n\t\tprivate var _backButton:Button;\n\n\t\tpublic var transitionName:String;\n\t\tpublic var upTransition:Function;\n\t\tpublic var downTransition:Function;\n\t\tpublic var leftTransition:Function;\n\t\tpublic var rightTransition:Function;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = this.transitionName;\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._list = new List();\n\t\t\tthis._list.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ label: \"Left\", transition: this.leftTransition },\n\t\t\t\t{ label: \"Right\", transition: this.rightTransition },\n\t\t\t\t{ label: \"Up\", transition: this.upTransition },\n\t\t\t\t{ label: \"Down\", transition: this.downTransition },\n\t\t\t]);\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis._list.clipContent = false;\n\t\t\tthis._list.autoHideBackground = true;\n\n\t\t\tthis._list.itemRendererFactory = function():IListItemRenderer\n\t\t\t{\n\t\t\t\tvar renderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\n\t\t\t\t//enable the quick hit area to optimize hit tests when an item\n\t\t\t\t//is only selectable and doesn't have interactive children.\n\t\t\t\trenderer.isQuickHitAreaEnabled = true;\n\n\t\t\t\trenderer.labelField = \"label\";\n\t\t\t\treturn renderer;\n\t\t\t};\n\n\t\t\tthis._list.addEventListener(Event.TRIGGERED, list_triggeredHandler);\n\t\t\tthis._list.revealScrollBars();\n\t\t\tthis.addChild(this._list);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\n\t\t\tthis._backButton = new Button();\n\t\t\tthis._backButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\tthis._backButton.label = \"Transitions\";\n\t\t\tthis._backButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\theader.leftItems = new <DisplayObject>[this._backButton];\n\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function list_triggeredHandler(event:Event, item:Object):void\n\t\t{\n\t\t\tvar transition:Function = item.transition as Function;\n\t\t\tthis.dispatchEventWith(TRANSITION, false, transition);\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/TransitionsExplorer/source/feathers/examples/transitionsExplorer/screens/IrisTransitionScreen.as",
    "content": "package feathers.examples.transitionsExplorer.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.List;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.renderers.IListItemRenderer;\n\timport feathers.data.ArrayCollection;\n\timport feathers.data.ListCollection;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.motion.Iris;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\tpublic class IrisTransitionScreen extends PanelScreen\n\t{\n\t\tprivate static function irisCloseAtRandomPosition(oldScreen:DisplayObject, newScreen:DisplayObject, completeCallback:Function):void\n\t\t{\n\t\t\tvar randomX:Number = Math.random() * (oldScreen ? oldScreen.width : newScreen.width);\n\t\t\tvar randomY:Number = Math.random() * (oldScreen ? oldScreen.height : newScreen.height);\n\t\t\tIris.createIrisCloseTransitionAt(randomX, randomY)(oldScreen, newScreen, completeCallback);\n\t\t}\n\t\t\n\t\tprivate static function irisOpenAtRandomPosition(oldScreen:DisplayObject, newScreen:DisplayObject, completeCallback:Function):void\n\t\t{\n\t\t\tvar randomX:Number = Math.random() * (oldScreen ? oldScreen.width : newScreen.width);\n\t\t\tvar randomY:Number = Math.random() * (oldScreen ? oldScreen.height : newScreen.height);\n\t\t\tIris.createIrisOpenTransitionAt(randomX, randomY)(oldScreen, newScreen, completeCallback);\n\t\t}\n\t\t\n\t\tpublic static const TRANSITION:String = \"transition\";\n\t\t\n\t\tpublic function IrisTransitionScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _list:List;\n\t\tprivate var _backButton:Button;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"Iris\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._list = new List();\n\t\t\tthis._list.dataProvider = new ArrayCollection(\n\t\t\t[\n\t\t\t\t{ label: \"Iris Open\", transition: Iris.createIrisOpenTransition() },\n\t\t\t\t{ label: \"Iris Close\", transition: Iris.createIrisCloseTransition() },\n\t\t\t\t{ label: \"Iris Open At\", transition: irisOpenAtRandomPosition },\n\t\t\t\t{ label: \"Iris Close At\", transition: irisCloseAtRandomPosition },\n\t\t\t]);\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis._list.clipContent = false;\n\t\t\tthis._list.autoHideBackground = true;\n\n\t\t\tthis._list.itemRendererFactory = function():IListItemRenderer\n\t\t\t{\n\t\t\t\tvar renderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\n\t\t\t\t//enable the quick hit area to optimize hit tests when an item\n\t\t\t\t//is only selectable and doesn't have interactive children.\n\t\t\t\trenderer.isQuickHitAreaEnabled = true;\n\n\t\t\t\trenderer.labelField = \"label\";\n\n\t\t\t\trenderer.accessoryLabelField = \"accessory\";\n\t\t\t\treturn renderer;\n\t\t\t};\n\n\t\t\tthis._list.addEventListener(Event.TRIGGERED, list_triggeredHandler);\n\t\t\tthis._list.revealScrollBars();\n\t\t\tthis.addChild(this._list);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\n\t\t\tthis._backButton = new Button();\n\t\t\tthis._backButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\tthis._backButton.label = \"Transitions\";\n\t\t\tthis._backButton.addEventListener(Event.TRIGGERED, backButton_triggeredHandler);\n\t\t\theader.leftItems = new <DisplayObject>[this._backButton];\n\n\t\t\treturn header;\n\t\t}\n\n\t\tprivate function list_triggeredHandler(event:Event, item:Object):void\n\t\t{\n\t\t\tvar transition:Function = item.transition as Function;\n\t\t\tthis.dispatchEventWith(TRANSITION, false, transition);\n\t\t}\n\n\t\tprivate function backButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/Video/README.md",
    "content": "# Feathers Video Example\n\nA simple example of the [`VideoPlayer`](http://feathersui.com/help/video-player.html) component from [Feathers](http://feathersui.com/), presented as a desktop application.\n\n## Requirements\n\nIn addition to Starling Framework and Feathers, this example project requires the `MetalWorksDesktopTheme` example theme. You can find the SWC file for this theme at the following location in the Feathers release build:\n\n\tthemes/MetalWorksDesktopTheme/swc/MetalWorksDesktopTheme.swc"
  },
  {
    "path": "examples/Video/build.properties",
    "content": "feathers.root = ${basedir}/../../source\nstarling.root = ${basedir}/../../third-party/starling\ntheme.root = ${basedir}/../../themes/MetalWorksDesktopTheme/source\noutput.path = ${basedir}/output\nicon.path = ${basedir}/../shared-assets/icons\n\nswf.version = 30"
  },
  {
    "path": "examples/Video/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<project name=\"video\" default=\"build\" basedir=\".\">\n\t\n\t<!-- build.local.properties and sdk.local.proprties are optional files that\n\t\tcan be used to override the default properties. -->\n\t<property file=\"./build.local.properties\"/>\n\t<property file=\"./sdk.local.properties\"/>\n\t<property file=\"./build.properties\"/>\n\t<!-- inherit SDK properties from the root of the repository -->\n\t<property file=\"../../sdk.local.properties\"/>\n\t<property file=\"../../sdk.properties\"/>\n\n\t<target name=\"build\" depends=\"build-desktop\"/>\n\n\t<target name=\"prepare\">\n\t\t<delete dir=\"${output.path}\"/>\n\t</target>\n\n\t<target name=\"build-air-swf\" depends=\"prepare\">\n\t\t<echo message=\"Building Video.swf\"/>\n\t\t<java jar=\"${mxmlc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${airdesktop.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"-source-path+=source\"/>\n\t\t\t<arg value=\"-source-path+=${starling.root}\"/>\n\t\t\t<arg value=\"-source-path+=${feathers.root}\"/>\n\t\t\t<arg value=\"-source-path+=${theme.root}\"/>\n\t\t\t<arg value=\"source/Video.as\"/>\n\t\t\t<arg value=\"-output=${output.path}/Video.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"-check-desktop-properties\">\n\t\t<fail unless=\"certificate.path\" message=\"Must define certificate.path in build.local.properties to sign AIR application\"/>\n\t\t<fail unless=\"certificate.password\" message=\"Must define certificate.password in build.local.properties to sign AIR application\"/>\n\t</target>\n\t<target name=\"build-desktop\" depends=\"-check-desktop-properties,build-air-swf\">\n\t\t<echo message=\"Packaging Video\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"-storetype\"/>\n\t\t\t<arg value=\"pkcs12\"/>\n\t\t\t<arg value=\"-keystore\"/>\n\t\t\t<arg value=\"${certificate.path}\"/>\n\t\t\t<arg value=\"-storepass\"/>\n\t\t\t<arg value=\"${certificate.password}\"/>\n\t\t\t<arg value=\"-target\"/>\n\t\t\t<arg value=\"bundle\"/>\n\t\t\t<arg value=\"${output.path}/Video\"/>\n\t\t\t<arg value=\"source/Video-app.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${icon.path}\"/>\n\t\t\t<arg line=\"icon48.png\"/>\n\t\t\t<arg line=\"icon128.png\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${output.path}\"/>\n\t\t\t<arg value=\"Video.swf\"/>\n\t\t</java>\n\t\t<delete file=\"${output.path}/Video.swf\"/>\n\t</target>\n</project>"
  },
  {
    "path": "examples/Video/source/Video-app.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<application xmlns=\"http://ns.adobe.com/air/application/32.0\">\n\t<id>com.feathersui.examples.Video</id>\n\t<filename>Feathers Video</filename>\n\t<name>Feathers Video</name>\n\t<versionNumber>4.2.0</versionNumber>\n\t<description>Video example application built with Feathers UI controls for Starling</description>\n\t<copyright>2021 Bowler Hat LLC</copyright>\n\n\t<initialWindow>\n\t\t<content>Video.swf</content>\n\t\t<minimizable>true</minimizable>\n\t\t<maximizable>true</maximizable>\n\t\t<resizable>true</resizable>\n\t\t<visible>true</visible>\n\t\t<renderMode>direct</renderMode>\n\t\t<minSize>480 320</minSize>\n\t\t<width>480</width>\n\t\t<height>320</height>\n\t\t<requestedDisplayResolution>high</requestedDisplayResolution>\n\t</initialWindow>\n\n\t<supportedLanguages>en</supportedLanguages>\n\n\t<icon>\n\t\t<image48x48>icon48.png</image48x48>\n\t\t<image128x128>icon128.png</image128x128>\n\t</icon>\n</application>"
  },
  {
    "path": "examples/Video/source/Video.as",
    "content": "package\n{\n\timport feathers.examples.video.Main;\n\n\timport flash.display.Sprite;\n\timport flash.display.StageAlign;\n\timport flash.display.StageScaleMode;\n\timport flash.display3D.Context3DProfile;\n\timport flash.display3D.Context3DRenderMode;\n\timport flash.events.Event;\n\timport flash.geom.Rectangle;\n\n\timport starling.core.Starling;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#4a4137\")]\n    public class Video extends Sprite\n    {\n        public function Video()\n        {\n            if(this.stage)\n            {\n                this.stage.scaleMode = StageScaleMode.NO_SCALE;\n                this.stage.align = StageAlign.TOP_LEFT;\n            }\n            this.mouseEnabled = this.mouseChildren = false;\n            this.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);\n        }\n\n        private var _starling:Starling;\n\n        private function loaderInfo_completeHandler(event:Event):void\n        {\n            Starling.multitouchEnabled = true;\n            this._starling = new Starling(Main, this.stage, null, null, Context3DRenderMode.AUTO, Context3DProfile.BASELINE);\n            this._starling.supportHighResolutions = true;\n            this._starling.start();\n\n            this.stage.addEventListener(Event.RESIZE, stage_resizeHandler, false, int.MAX_VALUE, true);\n        }\n\n        private function stage_resizeHandler(event:Event):void\n        {\n            this._starling.stage.stageWidth = this.stage.stageWidth;\n            this._starling.stage.stageHeight = this.stage.stageHeight;\n\n            var viewPort:Rectangle = this._starling.viewPort;\n            viewPort.width = this.stage.stageWidth;\n            viewPort.height = this.stage.stageHeight;\n            try\n            {\n                this._starling.viewPort = viewPort;\n            }\n            catch(error:Error) {}\n        }\n\n    }\n}"
  },
  {
    "path": "examples/Video/source/feathers/examples/video/Main.as",
    "content": "package feathers.examples.video\n{\n\timport feathers.controls.Alert;\n\timport feathers.controls.AutoSizeMode;\n\timport feathers.controls.ImageLoader;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.data.ArrayCollection;\n\timport feathers.data.ListCollection;\n\timport feathers.events.FeathersEventType;\n\timport feathers.events.MediaPlayerEventType;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.layout.HorizontalLayoutData;\n\timport feathers.media.FullScreenToggleButton;\n\timport feathers.media.MuteToggleButton;\n\timport feathers.media.PlayPauseToggleButton;\n\timport feathers.media.SeekSlider;\n\timport feathers.media.VideoPlayer;\n\timport feathers.themes.MetalWorksDesktopTheme;\n\n\timport flash.desktop.NativeApplication;\n\timport flash.display.NativeMenu;\n\timport flash.display.NativeMenuItem;\n\timport flash.events.ContextMenuEvent;\n\timport flash.filesystem.File;\n\timport flash.net.FileFilter;\n\n\timport starling.core.Starling;\n\timport starling.display.Sprite;\n\timport starling.events.Event;\n\n\tpublic class Main extends Sprite\n\t{\n\t\tpublic function Main()\n\t\t{\n\t\t\tnew MetalWorksDesktopTheme();\n\t\t\tsuper();\n\t\t\tthis.addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);\n\t\t}\n\t\t\n\t\tprotected var _videoPlayer:VideoPlayer\n\t\tprotected var _controls:LayoutGroup;\n\t\tprotected var _playPauseButton:PlayPauseToggleButton;\n\t\tprotected var _seekSlider:SeekSlider;\n\t\tprotected var _muteButton:MuteToggleButton;\n\t\tprotected var _fullScreenButton:FullScreenToggleButton;\n\t\tprotected var _view:ImageLoader;\n\t\t\n\t\tprotected var _fullScreenItem:NativeMenuItem;\n\t\tprotected var _fileToOpen:File;\n\t\t\n\t\tprivate function addedToStageHandler(event:Event):void\n\t\t{\n\t\t\tthis.createMenu();\n\t\t\t\n\t\t\tthis._videoPlayer = new VideoPlayer();\n\t\t\tthis._videoPlayer.autoSizeMode = AutoSizeMode.STAGE;\n\t\t\tthis._videoPlayer.layout = new AnchorLayout();\n\t\t\tthis._videoPlayer.addEventListener(Event.READY, videoPlayer_readyHandler);\n\t\t\tthis._videoPlayer.addEventListener(FeathersEventType.CLEAR, videoPlayer_clearHandler);\n\t\t\tthis._videoPlayer.addEventListener(MediaPlayerEventType.DISPLAY_STATE_CHANGE, videoPlayer_displayStateChangeHandler);\n\t\t\tthis._videoPlayer.addEventListener(Event.IO_ERROR, videoPlayer_errorHandler);\n\t\t\tthis._videoPlayer.addEventListener(FeathersEventType.ERROR, videoPlayer_errorHandler);\n\t\t\tthis.addChild(this._videoPlayer);\n\t\t\t\n\t\t\tthis._view = new ImageLoader();\n\t\t\tthis._videoPlayer.addChild(this._view);\n\t\t\t\n\t\t\tthis._controls = new LayoutGroup();\n\t\t\tthis._controls.touchable = false;\n\t\t\tthis._controls.styleNameList.add(LayoutGroup.ALTERNATE_STYLE_NAME_TOOLBAR);\n\t\t\tthis._videoPlayer.addChild(this._controls);\n\t\t\t\n\t\t\tthis._playPauseButton = new PlayPauseToggleButton();\n\t\t\tthis._controls.addChild(this._playPauseButton);\n\t\t\t\n\t\t\tthis._seekSlider = new SeekSlider();\n\t\t\tthis._seekSlider.layoutData = new HorizontalLayoutData(100);\n\t\t\tthis._controls.addChild(this._seekSlider);\n\t\t\t\n\t\t\tthis._muteButton = new MuteToggleButton();\n\t\t\tthis._controls.addChild(this._muteButton);\n\n\t\t\tthis._fullScreenButton = new FullScreenToggleButton();\n\t\t\tthis._controls.addChild(this._fullScreenButton);\n\t\t\t\n\t\t\tvar controlsLayoutData:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tcontrolsLayoutData.left = 0;\n\t\t\tcontrolsLayoutData.right = 0;\n\t\t\tcontrolsLayoutData.bottom = 0;\n\t\t\tthis._controls.layoutData = controlsLayoutData;\n\n\t\t\tvar viewLayoutData:AnchorLayoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tviewLayoutData.bottomAnchorDisplayObject = this._controls;\n\t\t\tthis._view.layoutData = viewLayoutData;\n\t\t}\n\t\t\n\t\tprotected function createMenu():void\n\t\t{\n\t\t\tvar menu:NativeMenu;\n\t\t\tif(NativeApplication.supportsMenu)\n\t\t\t{\n\t\t\t\tmenu = NativeApplication.nativeApplication.menu;\n\t\t\t\tvar applicationMenuItem:NativeMenuItem = menu.getItemAt(0);\n\t\t\t\tmenu.removeAllItems();\n\t\t\t\tmenu.addItem(applicationMenuItem);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmenu = new NativeMenu();\n\t\t\t\tStarling.current.nativeStage.nativeWindow.menu = menu;\n\t\t\t}\n\n\t\t\tvar fileMenuItem:NativeMenuItem = new NativeMenuItem(\"File\");\n\t\t\tvar fileMenu:NativeMenu = new NativeMenu();\n\t\t\tfileMenuItem.submenu = fileMenu;\n\t\t\tmenu.addItem(fileMenuItem);\n\t\t\tvar openItem:NativeMenuItem = new NativeMenuItem(\"Open\");\n\t\t\topenItem.keyEquivalent = \"o\";\n\t\t\topenItem.addEventListener(flash.events.Event.SELECT, openItem_selectHandler);\n\t\t\tfileMenu.addItem(openItem);\n\t\t\tvar closeItem:NativeMenuItem = new NativeMenuItem(\"Close\");\n\t\t\tcloseItem.keyEquivalent = \"w\";\n\t\t\tcloseItem.addEventListener(flash.events.Event.SELECT, closeItem_selectHandler);\n\t\t\tfileMenu.addItem(closeItem);\n\n\t\t\tvar viewMenuItem:NativeMenuItem = new NativeMenuItem(\"View\");\n\t\t\tvar viewMenu:NativeMenu = new NativeMenu();\n\t\t\tviewMenuItem.submenu = viewMenu;\n\t\t\tmenu.addItem(viewMenuItem);\n\t\t\tthis._fullScreenItem = new NativeMenuItem(\"Enter Full Screen\");\n\t\t\tthis._fullScreenItem.keyEquivalent = \"f\";\n\t\t\tthis._fullScreenItem.addEventListener(flash.events.Event.SELECT, fullScreenItem_selectHandler);\n\t\t\tviewMenu.addItem(this._fullScreenItem);\n\t\t\t\n\t\t\tif(NativeApplication.supportsMenu)\n\t\t\t{\n\t\t\t\tvar windowMenuItem:NativeMenuItem = new NativeMenuItem(\"Window\");\n\t\t\t\tvar windowMenu:NativeMenu = new NativeMenu();\n\t\t\t\twindowMenuItem.submenu = windowMenu;\n\t\t\t\tmenu.addItem(windowMenuItem);\n\t\t\t\tvar minimizeItem:NativeMenuItem = new NativeMenuItem(\"Minimize\");\n\t\t\t\tminimizeItem.keyEquivalent = \"m\";\n\t\t\t\tminimizeItem.addEventListener(flash.events.Event.SELECT, minimizeItem_selectHandler);\n\t\t\t\twindowMenu.addItem(minimizeItem);\n\t\t\t\tvar zoomItem:NativeMenuItem = new NativeMenuItem(\"Zoom\");\n\t\t\t\tzoomItem.addEventListener(flash.events.Event.SELECT, zoomItem_selectHandler);\n\t\t\t\twindowMenu.addItem(zoomItem);\n\t\t\t}\n\t\t}\n\t\t\n\t\tprotected function videoPlayer_readyHandler(event:Event):void\n\t\t{\n\t\t\tthis._view.source = this._videoPlayer.texture;\n\t\t\tthis._controls.touchable = true;\n\t\t}\n\t\t\n\t\tprotected function videoPlayer_clearHandler(event:Event):void\n\t\t{\n\t\t\tthis._view.source = null;\n\t\t\tthis._controls.touchable = false;\n\t\t}\n\n\t\tprotected function videoPlayer_displayStateChangeHandler(event:Event):void\n\t\t{\n\t\t\tthis._fullScreenItem.label = this._videoPlayer.isFullScreen ? \"Exit Full Screen\" : \"Enter Full Screen\";\n\t\t}\n\t\t\n\t\tprotected function videoPlayer_errorHandler(event:Event):void\n\t\t{\n\t\t\tAlert.show(\"Cannot play selected video.\",\n\t\t\t\t\"Video Error\", new ArrayCollection([{ label: \"OK\" }]));\n\t\t\ttrace(\"VideoPlayer Error: \" + event.data);\n\t\t}\n\t\t\n\t\tprotected function openItem_selectHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tthis._fileToOpen = new File();\n\t\t\tthis._fileToOpen.addEventListener(flash.events.Event.SELECT, fileToOpen_selectHandler);\n\t\t\tthis._fileToOpen.addEventListener(flash.events.Event.CANCEL, fileToOpen_cancelHandler);\n\t\t\tthis._fileToOpen.browseForOpen(\"Select video file\",\n\t\t\t[\n\t\t\t\tnew FileFilter(\"Video files\", \"*.m4v;*.mp4;*.f4v;*.flv;*.mov\")\n\t\t\t]);\n\t\t}\n\t\t\n\t\tprotected function closeItem_selectHandler(event:flash.events.Event):void\n\t\t{\n\t\t\t//we don't need to dispose the texture here. the VideoPlayer will\n\t\t\t//do it automatically when videoSource is changed.\n\t\t\tthis._view.source = null;\n\t\t\tthis._videoPlayer.videoSource = null;\n\t\t\tthis._controls.touchable = false;\n\t\t}\n\t\t\n\t\tprotected function fileToOpen_cancelHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tthis._fileToOpen.removeEventListener(flash.events.Event.SELECT, fileToOpen_selectHandler);\n\t\t\tthis._fileToOpen.removeEventListener(flash.events.Event.CANCEL, fileToOpen_cancelHandler);\n\t\t\tthis._fileToOpen = null;\n\t\t}\n\n\t\tprotected function fileToOpen_selectHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tif(this._videoPlayer.videoSource === this._fileToOpen.url)\n\t\t\t{\n\t\t\t\t//it's the same file, so just start it over instead of trying\n\t\t\t\t//to load it again!\n\t\t\t\tthis._videoPlayer.stop();\n\t\t\t\tthis._videoPlayer.play();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._controls.touchable = false;\n\t\t\tthis._videoPlayer.videoSource = this._fileToOpen.url;\n\t\t\tthis._fileToOpen.removeEventListener(flash.events.Event.SELECT, fileToOpen_selectHandler);\n\t\t\tthis._fileToOpen.removeEventListener(flash.events.Event.CANCEL, fileToOpen_cancelHandler);\n\t\t\tthis._fileToOpen = null;\n\t\t}\n\t\t\n\t\tprotected function fullScreenItem_selectHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tthis._videoPlayer.toggleFullScreen();\n\t\t}\n\t\t\n\t\tprotected function minimizeItem_selectHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tStarling.current.nativeStage.nativeWindow.minimize();\n\t\t}\n\n\t\tprotected function zoomItem_selectHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tStarling.current.nativeStage.nativeWindow.maximize();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/YouTubeFeeds/README.md",
    "content": "# YouTube Feeds Example for Feathers\n\nA simple application that uses the [YouTube Data API](https://developers.google.com/youtube/2.0/reference) to display feeds using [Feathers](http://feathersui.com/) components.\n\n## Requirements\n\nIn addition to Starling Framework and Feathers, this example project requires the `MetalWorksMobileTheme` example theme. You can find the SWC file for this theme at the following location in the Feathers release build:\n\n\tthemes/MetalWorksMobileTheme/swc/MetalWorksMobileTheme.swc\n\n## Web Demo\n\nView the [YouTube Feeds example](http://feathersui.com/examples/youtube-feeds/) in your browser."
  },
  {
    "path": "examples/YouTubeFeeds/build.properties",
    "content": "feathers.root = ${basedir}/../../source\nstarling.root = ${basedir}/../../third-party/starling\ntheme.root = ${basedir}/../../themes/MetalWorksMobileTheme/source\noutput.path = ${basedir}/output\nicon.path = ${basedir}/../shared-assets/icons\nlaunch.image.path = ${basedir}/../shared-assets/launch-images-windowed\n\nswf.version = 30"
  },
  {
    "path": "examples/YouTubeFeeds/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<project name=\"youtube\" default=\"build\" basedir=\".\">\n\t\n\t<!-- build.local.properties and sdk.local.proprties are optional files that\n\t\tcan be used to override the default properties. -->\n\t<property file=\"./build.local.properties\"/>\n\t<property file=\"./sdk.local.properties\"/>\n\t<property file=\"./build.properties\"/>\n\t<!-- inherit SDK properties from the root of the repository -->\n\t<property file=\"../../sdk.local.properties\"/>\n\t<property file=\"../../sdk.properties\"/>\n\n\t<fail unless=\"youtube.api.key\"/>\n\n\t<target name=\"build\" depends=\"build-android,build-ios\"/>\n\n\t<target name=\"prepare\">\n\t\t<delete dir=\"${output.path}\"/>\n\t</target>\n\n\t<target name=\"build-web\" depends=\"prepare\">\n\t\t<echo message=\"Building YouTubeFeedsWeb.swf\"/>\n\t\t<java jar=\"${mxmlc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${flashplayer.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"--define+=CONFIG::YOUTUBE_API_KEY,'${youtube.api.key}'\"/>\n\t\t\t<arg value=\"-frame=two,feathers.examples.youtube.Main\"/>\n\t\t\t<arg value=\"-source-path+=source\"/>\n\t\t\t<arg value=\"-source-path+=${starling.root}\"/>\n\t\t\t<arg value=\"-source-path+=${feathers.root}\"/>\n\t\t\t<arg value=\"-source-path+=${theme.root}\"/>\n\t\t\t<arg value=\"source/YouTubeFeedsWeb.as\"/>\n\t\t\t<arg value=\"-output=${output.path}/YouTubeFeedsWeb.swf\"/>\n\t\t</java>\n\t</target>\n\n\t<target name=\"build-air-swf\" depends=\"prepare\">\n\t\t<echo message=\"Building YouTubeFeeds.swf\"/>\n\t\t<java jar=\"${mxmlc}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-load-config=${airmobile.config}\"/>\n\t\t\t<arg value=\"-swf-version=${swf.version}\"/>\n\t\t\t<arg value=\"--define+=CONFIG::YOUTUBE_API_KEY,'${youtube.api.key}'\"/>\n\t\t\t<arg value=\"-source-path+=source\"/>\n\t\t\t<arg value=\"-source-path+=${starling.root}\"/>\n\t\t\t<arg value=\"-source-path+=${feathers.root}\"/>\n\t\t\t<arg value=\"-source-path+=${theme.root}\"/>\n\t\t\t<arg value=\"source/YouTubeFeeds.as\"/>\n\t\t\t<arg value=\"-output=${output.path}/YouTubeFeeds.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"-check-ios-properties\">\n\t\t<fail unless=\"ios.provision.path\"/>\n\t\t<fail unless=\"ios.certificate.path\"/>\n\t\t<fail unless=\"ios.certificate.password\"/>\n\t</target>\n\t<target name=\"build-ios\" depends=\"-check-ios-properties,build-air-swf\">\n\t\t<echo message=\"Packaging YouTubeFeeds.ipa\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"-target\"/>\n\t\t\t<arg value=\"ipa-app-store\"/>\n\t\t\t<arg value=\"-provisioning-profile\"/>\n\t\t\t<arg value=\"${ios.provision.path}\"/>\n\t\t\t<arg value=\"-keystore\"/>\n\t\t\t<arg value=\"${ios.certificate.path}\"/>\n\t\t\t<arg value=\"-storetype\"/>\n\t\t\t<arg value=\"pkcs12\"/>\n\t\t\t<arg value=\"-storepass\"/>\n\t\t\t<arg value=\"${ios.certificate.password}\"/>\n\t\t\t<arg value=\"${output.path}/YouTubeFeeds.ipa\"/>\n\t\t\t<arg value=\"source/YouTubeFeeds-app.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${icon.path}\"/>\n\t\t\t<arg line=\"icon29.png icon48.png icon50.png icon57.png icon58.png icon72.png icon87.png icon96.png icon100.png icon114.png icon128.png icon144.png icon180.png\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${launch.image.path}\"/>\n\t\t\t<arg value=\"Default~iphone.png\"/>\t\t\t\t\t\t\t<!-- iphone 3gs -->\n\t\t\t<arg value=\"Default@2x~iphone.png\"/>\t\t\t\t\t\t<!-- iphone 4/4s -->\n\t\t\t<arg value=\"Default-568h@2x~iphone.png\"/>\t\t\t\t\t<!-- iphone 5/5c/5s -->\n\t\t\t<arg value=\"Default-375w-667h@2x~iphone.png\"/>\t\t\t\t<!-- iphone 6/7/8 -->\n\t\t\t<arg value=\"Default-812h@3x~iphone.png\"/>\t\t\t\t\t<!-- iphone x (portrait) -->\n\t\t\t<arg value=\"Default-Landscape-812h@3x~iphone.png\"/>\t\t\t<!-- iphone x (landscape) -->\n\t\t\t<arg value=\"Default-414w-736h@3x~iphone.png\"/>\t\t\t\t<!-- iphone 6/7/8 plus (portrait) -->\n\t\t\t<arg value=\"Default-Landscape-414w-736h@3x~iphone.png\"/>\t<!-- iphone 6/7/8 plus (landscape) -->\n\t\t\t<arg value=\"Default-Portrait~ipad.png\"/>\t\t\t\t\t<!-- ipad 1/2 (portrait) -->\n\t\t\t<arg value=\"Default-PortraitUpsideDown~ipad.png\"/>\t\t\t<!-- ipad 1/2 (portrait upside down) -->\n\t\t\t<arg value=\"Default-Landscape~ipad.png\"/>\t\t\t\t\t<!-- ipad 1/2 (landscape left) -->\n\t\t\t<arg value=\"Default-LandscapeRight~ipad.png\"/>\t\t\t\t<!-- ipad 1/2 (landscape right) -->\n\t\t\t<arg value=\"Default-Portrait@2x~ipad.png\"/>\t\t\t\t\t<!-- ipad 3/air (portrait) -->\n\t\t\t<arg value=\"Default-LandscapeLeft@2x~ipad.png\"/>\t\t\t<!-- ipad 3/air (landscape left) -->\n\t\t\t<arg value=\"Default-LandscapeRight@2x~ipad.png\"/>\t\t\t<!-- ipad 3/air (landscape right) -->\n\t\t\t<arg value=\"Default-Portrait@2x.png\"/>\t\t\t\t\t\t<!-- ipad pro (portrait) -->\n\t\t\t<arg value=\"Default-Landscape@2x.png\"/>\t\t\t\t\t\t<!-- ipad pro (landscape) -->\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${output.path}\"/>\n\t\t\t<arg value=\"YouTubeFeeds.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"-check-android-properties\">\n\t\t<fail unless=\"android.certificate.path\"/>\n\t\t<fail unless=\"android.certificate.password\"/>\n\t</target>\n\t<target name=\"build-android\" depends=\"-check-android-properties,build-air-swf\">\n\t\t<echo message=\"Packaging YouTubeFeeds.apk\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"-target\"/>\n\t\t\t<arg value=\"apk-captive-runtime\"/>\n\t\t\t<arg value=\"-storetype\"/>\n\t\t\t<arg value=\"pkcs12\"/>\n\t\t\t<arg value=\"-keystore\"/>\n\t\t\t<arg value=\"${android.certificate.path}\"/>\n\t\t\t<arg value=\"-storepass\"/>\n\t\t\t<arg value=\"${android.certificate.password}\"/>\n\t\t\t<arg value=\"${output.path}/YouTubeFeeds.apk\"/>\n\t\t\t<arg value=\"source/YouTubeFeeds-app.xml\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${icon.path}\"/>\n\t\t\t<arg line=\"icon29.png icon48.png icon50.png icon57.png icon58.png icon72.png icon87.png icon96.png icon100.png icon114.png icon128.png icon144.png icon180.png\"/>\n\t\t\t<arg value=\"-C\"/>\n\t\t\t<arg value=\"${output.path}\"/>\n\t\t\t<arg value=\"YouTubeFeeds.swf\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"install-android\">\n\t\t<echo message=\"Installing YouTubeFeeds.apk\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"false\">\n\t\t\t<arg value=\"-uninstallApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"android\"/>\n\t\t\t<arg value=\"-appid\"/>\n\t\t\t<arg value=\"com.feathersui.examples.YouTubeFeeds\"/>\n\t\t</java>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-installApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"android\"/>\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"${output.path}/YouTubeFeeds.apk\"/>\n\t\t</java>\n\t</target>\n\t<target name=\"install-ios\">\n\t\t<echo message=\"Installing YouTubeFeeds.ipa\"/>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"false\">\n\t\t\t<arg value=\"-uninstallApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"iOS\"/>\n\t\t\t<arg value=\"-appid\"/>\n\t\t\t<arg value=\"com.feathersui.examples.YouTubeFeeds\"/>\n\t\t</java>\n\t\t<java jar=\"${adt}\" dir=\"${basedir}\" fork=\"true\" failonerror=\"true\">\n\t\t\t<arg value=\"-installApp\"/>\n\t\t\t<arg value=\"-platform\"/>\n\t\t\t<arg value=\"iOS\"/>\n\t\t\t<arg value=\"-package\"/>\n\t\t\t<arg value=\"${output.path}/YouTubeFeeds.ipa\"/>\n\t\t</java>\n\t</target>\n</project>"
  },
  {
    "path": "examples/YouTubeFeeds/source/YouTubeFeeds-app.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<application xmlns=\"http://ns.adobe.com/air/application/32.0\">\n\t<id>com.feathersui.examples.YouTubeFeeds</id>\n\t<filename>YouTube Feeds</filename>\n\t<name>YouTube Feeds</name>\n\t<versionNumber>4.2.0</versionNumber>\n\t<description>YouTube Feeds example application built with Feathers UI controls for Starling</description>\n\t<copyright>2021 Bowler Hat LLC</copyright>\n\n\t<initialWindow>\n\t\t<content>YouTubeFeeds.swf</content>\n\t\t<autoOrients>true</autoOrients>\n\t\t<fullScreen>false</fullScreen>\n\t\t<visible>true</visible>\n\t\t<renderMode>direct</renderMode>\n\t</initialWindow>\n\n\t<supportedLanguages>en</supportedLanguages>\n\n\t<icon>\n\t\t<image29x29>icon29.png</image29x29>\n\t\t<image48x48>icon48.png</image48x48>\n\t\t<image50x50>icon50.png</image50x50>\n\t\t<image57x57>icon57.png</image57x57>\n\t\t<image58x58>icon58.png</image58x58>\n\t\t<image72x72>icon72.png</image72x72>\n\t\t<image87x87>icon87.png</image87x87>\n\t\t<image96x96>icon96.png</image96x96>\n\t\t<image100x100>icon100.png</image100x100>\n\t\t<image114x114>icon114.png</image114x114>\n\t\t<image128x128>icon128.png</image128x128>\n\t\t<image144x144>icon144.png</image144x144>\n\t\t<image180x180>icon180.png</image180x180>\n\t</icon>\n\t<android>\n\t\t<colorDepth>16bit</colorDepth>\n\t\t<manifestAdditions><![CDATA[\n\t\t\t<manifest android:installLocation=\"auto\">\n\t\t\t    <uses-permission android:name=\"android.permission.INTERNET\"/>\n\t\t\t</manifest>\n\t\t]]></manifestAdditions>\n\t</android>\n\t<iPhone>\n\t\t<InfoAdditions>\n\t\t<![CDATA[\n\t\t\t<key>UIDeviceFamily</key> \n\t\t\t<array> \n\t\t\t\t<string>1</string>\n\t\t\t\t<string>2</string>\n\t\t\t</array>\n\t\t\t<key>UIPrerenderedIcon</key>\n\t\t\t<true/>\n\t\t\t<key>UIStatusBarStyle</key>\n\t\t\t<string>UIStatusBarStyleLightContent</string>\n\t\t]]> \n\t\t</InfoAdditions>\n\t\t<requestedDisplayResolution>high</requestedDisplayResolution>\n\t</iPhone>\n</application>"
  },
  {
    "path": "examples/YouTubeFeeds/source/YouTubeFeeds.as",
    "content": "package\n{\n\timport feathers.examples.youtube.Main;\n\timport feathers.utils.ScreenDensityScaleFactorManager;\n\n\timport flash.display.Loader;\n\timport flash.display.Sprite;\n\timport flash.display.StageAlign;\n\timport flash.display.StageOrientation;\n\timport flash.display.StageScaleMode;\n\timport flash.display3D.Context3DProfile;\n\timport flash.display3D.Context3DRenderMode;\n\timport flash.events.Event;\n\timport flash.filesystem.File;\n\timport flash.filesystem.FileMode;\n\timport flash.filesystem.FileStream;\n\timport flash.system.Capabilities;\n\timport flash.utils.ByteArray;\n\n\timport starling.core.Starling;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#4a4137\")]\n\tpublic class YouTubeFeeds extends Sprite\n\t{\n\t\tpublic function YouTubeFeeds()\n\t\t{\n\t\t\tif(this.stage)\n\t\t\t{\n\t\t\t\tthis.stage.scaleMode = StageScaleMode.NO_SCALE;\n\t\t\t\tthis.stage.align = StageAlign.TOP_LEFT;\n\t\t\t}\n\t\t\tthis.mouseEnabled = this.mouseChildren = false;\n\t\t\tthis.showLaunchImage();\n\t\t\tthis.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);\n\t\t}\n\n\t\tprivate var _starling:Starling;\n\t\tprivate var _scaler:ScreenDensityScaleFactorManager;\n\t\tprivate var _launchImage:Loader;\n\t\tprivate var _savedAutoOrients:Boolean;\n\n\t\t/**\n\t\t * On iOS, add the native launch image to the classic display list to\n\t\t * avoid displaying only the stage background color between when the\n\t\t * AIR app finishes launching and Starling starts rendering.\n\t\t * \n\t\t * Launch image names: https://forums.adobe.com/message/9986239#9986239\n\t\t */\n\t\tprivate function showLaunchImage():void\n\t\t{\n\t\t\tvar filePath:String = null;\n\t\t\tvar isPortraitOnly:Boolean = false;\n\t\t\tif(Capabilities.manufacturer.indexOf(\"iOS\") >= 0)\n\t\t\t{\n\t\t\t\tvar isPortraitUpsideDown:Boolean = this.stage.orientation == StageOrientation.UPSIDE_DOWN;\n\t\t\t\tvar isPortrait:Boolean = this.stage.orientation == StageOrientation.DEFAULT || isPortraitUpsideDown;\n\t\t\t\tvar isLandscapeRight:Boolean = this.stage.orientation == StageOrientation.ROTATED_RIGHT;\n\t\t\t\tif(Capabilities.screenResolutionX == 1242 && Capabilities.screenResolutionY == 2208)\n\t\t\t\t{\n\t\t\t\t\t//iphone 6/7/8 plus\n\t\t\t\t\tfilePath = isPortrait ? \"Default-414w-736h@3x~iphone.png\" : \"Default-Landscape-414w-736h@3x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 1125 && Capabilities.screenResolutionY == 2436)\n\t\t\t\t{\n\t\t\t\t\t//iphone x\n\t\t\t\t\tfilePath = isPortrait ? \"Default-812h@3x~iphone.png\" : \"Default-Landscape-812h@3x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 2048 && Capabilities.screenResolutionY == 2732)\n\t\t\t\t{\n\t\t\t\t\t//ipad pro\n\t\t\t\t\tfilePath = isPortrait ? \"Default-Portrait@2x.png\" : \"Default-Landscape@2x.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 1536 && Capabilities.screenResolutionY == 2048)\n\t\t\t\t{\n\t\t\t\t\t//ipad 3/air\n\t\t\t\t\tif(isPortraitUpsideDown)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Portrait@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isPortrait)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-PortraitUpsideDown@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isLandscapeRight)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeRight@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeLeft@2x~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 768 && Capabilities.screenResolutionY == 1024)\n\t\t\t\t{\n\t\t\t\t\t//ipad 1/2\n\t\t\t\t\tif(isPortraitUpsideDown)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Portrait~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isPortrait)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-PortraitUpsideDown~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(isLandscapeRight)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-LandscapeRight~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfilePath = \"Default-Landscape~ipad.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 750)\n\t\t\t\t{\n\t\t\t\t\t//iphone 6/7/8\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tfilePath = \"Default-375w-667h@2x~iphone.png\";\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 640)\n\t\t\t\t{\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tif(Capabilities.screenResolutionY == 1136)\n\t\t\t\t\t{\n\t\t\t\t\t\t//iphone 5/5c/5s\n\t\t\t\t\t\tfilePath = \"Default-568h@2x~iphone.png\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//iphone 4/4s\n\t\t\t\t\t\tfilePath = \"Default@2x~iphone.png\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(Capabilities.screenResolutionX == 320)\n\t\t\t\t{\n\t\t\t\t\t//iphone 3gs\n\t\t\t\t\tisPortraitOnly = true;\n\t\t\t\t\tfilePath = \"Default~iphone.png\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(filePath)\n\t\t\t{\n\t\t\t\tvar file:File = File.applicationDirectory.resolvePath(filePath);\n\t\t\t\tif(file.exists)\n\t\t\t\t{\n\t\t\t\t\tvar bytes:ByteArray = new ByteArray();\n\t\t\t\t\tvar stream:FileStream = new FileStream();\n\t\t\t\t\tstream.open(file, FileMode.READ);\n\t\t\t\t\tstream.readBytes(bytes, 0, stream.bytesAvailable);\n\t\t\t\t\tstream.close();\n\t\t\t\t\tthis._launchImage = new Loader();\n\t\t\t\t\tthis._launchImage.loadBytes(bytes);\n\t\t\t\t\tthis.addChild(this._launchImage);\n\t\t\t\t\tthis._savedAutoOrients = this.stage.autoOrients;\n\t\t\t\t\tthis.stage.autoOrients = false;\n\t\t\t\t\tif(isPortraitOnly)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.stage.setOrientation(StageOrientation.DEFAULT);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function loaderInfo_completeHandler(event:Event):void\n\t\t{\n\t\t\tStarling.multitouchEnabled = true;\n\t\t\tthis._starling = new Starling(Main, this.stage, null, null, Context3DRenderMode.AUTO, Context3DProfile.BASELINE);\n\t\t\tthis._starling.supportHighResolutions = true;\n\t\t\tthis._starling.skipUnchangedFrames = true;\n\t\t\tthis._starling.start();\n\t\t\tif(this._launchImage)\n\t\t\t{\n\t\t\t\tthis._starling.addEventListener(\"rootCreated\", starling_rootCreatedHandler);\n\t\t\t}\n\t\t\tthis._scaler = new ScreenDensityScaleFactorManager(this._starling);\n\n\t\t\tthis.stage.addEventListener(Event.DEACTIVATE, stage_deactivateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function starling_rootCreatedHandler(event:Object):void\n\t\t{\n\t\t\tif(this._launchImage)\n\t\t\t{\n\t\t\t\tthis.removeChild(this._launchImage);\n\t\t\t\tthis._launchImage.unloadAndStop(true);\n\t\t\t\tthis._launchImage = null;\n\t\t\t\tthis.stage.autoOrients = this._savedAutoOrients;\n\t\t\t}\n\t\t}\n\n\t\tprivate function stage_deactivateHandler(event:Event):void\n\t\t{\n\t\t\tthis._starling.stop(true);\n\t\t\tthis.stage.addEventListener(Event.ACTIVATE, stage_activateHandler, false, 0, true);\n\t\t}\n\n\t\tprivate function stage_activateHandler(event:Event):void\n\t\t{\n\t\t\tthis.stage.removeEventListener(Event.ACTIVATE, stage_activateHandler);\n\t\t\tthis._starling.start();\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "examples/YouTubeFeeds/source/YouTubeFeedsWeb.as",
    "content": "package\n{\n\timport feathers.system.DeviceCapabilities;\n\n\timport flash.display.MovieClip;\n\timport flash.display.StageAlign;\n\timport flash.display.StageScaleMode;\n\timport flash.events.Event;\n\timport flash.geom.Rectangle;\n\timport flash.ui.ContextMenu;\n\timport flash.utils.getDefinitionByName;\n\n\timport starling.core.Starling;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#4a4137\")]\n\tpublic class YouTubeFeedsWeb extends MovieClip\n\t{\n\t\tpublic function YouTubeFeedsWeb()\n\t\t{\n\t\t\tvar menu:ContextMenu = new ContextMenu();\n\t\t\tmenu.hideBuiltInItems();\n\t\t\tthis.contextMenu = menu;\n\t\t\t\n\t\t\tif(this.stage)\n\t\t\t{\n\t\t\t\tthis.stage.align = StageAlign.TOP_LEFT;\n\t\t\t\tthis.stage.scaleMode = StageScaleMode.NO_SCALE;\n\t\t\t}\n\t\t\t\n\t\t\tthis.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);\n\t\t}\n\t\t\n\t\tprivate var _starling:Starling;\n\t\t\n\t\tprivate function start():void\n\t\t{\n\t\t\tthis.gotoAndStop(2);\n\t\t\tthis.graphics.clear();\n\n\t\t\t//simulating iPhone Retina\n\t\t\tDeviceCapabilities.dpi = 326;\n\t\t\t\n\t\t\tStarling.multitouchEnabled = true;\n\t\t\tvar MainType:Class = getDefinitionByName(\"feathers.examples.youtube.Main\") as Class;\n\t\t\tthis._starling = new Starling(MainType, this.stage, new Rectangle(0, 0, 960, 640));\n\t\t\tthis._starling.supportHighResolutions = true;\n\t\t\tthis._starling.skipUnchangedFrames = true;\n\t\t\tthis._starling.stage.stageWidth = 480;\n\t\t\tthis._starling.stage.stageHeight = 320;\n\t\t\tthis._starling.start();\n\t\t}\n\t\t\n\t\tprivate function loaderInfo_completeHandler(event:Event):void\n\t\t{\n\t\t\tthis.start();\n\t\t}\n\t}\n}"
  },
  {
    "path": "examples/YouTubeFeeds/source/feathers/examples/youtube/Main.as",
    "content": "package feathers.examples.youtube\n{\n\timport feathers.controls.StackScreenNavigator;\n\timport feathers.controls.StackScreenNavigatorItem;\n\timport feathers.examples.youtube.models.YouTubeModel;\n\timport feathers.examples.youtube.screens.ListVideosScreen;\n\timport feathers.examples.youtube.screens.MainMenuScreen;\n\timport feathers.examples.youtube.screens.VideoDetailsScreen;\n\timport feathers.motion.Slide;\n\timport feathers.themes.MetalWorksMobileTheme;\n\n\timport starling.events.Event;\n\n\tpublic class Main extends StackScreenNavigator\n\t{\n\t\tprivate static const MAIN_MENU:String = \"mainMenu\";\n\t\tprivate static const LIST_VIDEOS:String = \"listVideos\";\n\t\tprivate static const VIDEO_DETAILS:String = \"videoDetails\";\n\n\t\tpublic function Main()\n\t\t{\n\t\t\t//set up the theme right away!\n\t\t\tnew MetalWorksMobileTheme();\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _model:YouTubeModel;\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis._model = new YouTubeModel();\n\n\t\t\tvar mainMenuItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(MainMenuScreen);\n\t\t\tmainMenuItem.setFunctionForPushEvent(MainMenuScreen.LIST_VIDEOS, this.mainMenuScreen_listVideosHandler);\n\t\t\tthis.addScreen(MAIN_MENU, mainMenuItem);\n\n\t\t\tvar listVideosItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(ListVideosScreen);\n\t\t\tlistVideosItem.setFunctionForPushEvent(ListVideosScreen.SHOW_VIDEO_DETAILS, this.listVideos_showVideoDetails);\n\t\t\tlistVideosItem.addPopEvent(Event.COMPLETE);\n\t\t\tlistVideosItem.properties.model = this._model;\n\t\t\tthis.addScreen(LIST_VIDEOS, listVideosItem);\n\n\t\t\tvar videoDetailsItem:StackScreenNavigatorItem = new StackScreenNavigatorItem(VideoDetailsScreen);\n\t\t\tvideoDetailsItem.addPopEvent(Event.COMPLETE);\n\t\t\tvideoDetailsItem.properties.model = this._model;\n\t\t\tthis.addScreen(VIDEO_DETAILS, videoDetailsItem);\n\n\t\t\tthis.rootScreenID = MAIN_MENU;\n\n\t\t\tthis.pushTransition = Slide.createSlideLeftTransition();\n\t\t\tthis.popTransition = Slide.createSlideRightTransition();\n\t\t}\n\n\t\tprivate function mainMenuScreen_listVideosHandler(event:Event, mainMenuProperties:Object):void\n\t\t{\n\t\t\tvar screen:MainMenuScreen = MainMenuScreen(this.activeScreen);\n\t\t\tthis._model.selectedList = screen.selectedCategory;\n\t\t\tthis.pushScreen(LIST_VIDEOS, mainMenuProperties);\n\t\t}\n\n\t\tprivate function listVideos_showVideoDetails(event:Event, listVideosProperties:Object):void\n\t\t{\n\t\t\tvar screen:ListVideosScreen = ListVideosScreen(this.activeScreen);\n\t\t\tthis._model.selectedVideo = screen.selectedVideo;\n\t\t\tthis.pushScreen(VIDEO_DETAILS, listVideosProperties);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/YouTubeFeeds/source/feathers/examples/youtube/models/VideoDetails.as",
    "content": "package feathers.examples.youtube.models\n{\n\tpublic class VideoDetails\n\t{\n\t\tpublic function VideoDetails(title:String = null, author:String = null,\n\t\t\turl:String = null, description:String = null, thumbnailURL:String = null)\n\t\t{\n\t\t\tthis.title = title;\n\t\t\tthis.author = author;\n\t\t\tthis.url = url;\n\t\t\tthis.description = description;\n\t\t\tthis.thumbnailURL = thumbnailURL;\n\t\t}\n\n\t\tpublic var title:String;\n\t\tpublic var author:String;\n\t\tpublic var url:String;\n\t\tpublic var description:String;\n\t\tpublic var thumbnailURL:String;\n\t}\n}\n"
  },
  {
    "path": "examples/YouTubeFeeds/source/feathers/examples/youtube/models/VideoFeed.as",
    "content": "package feathers.examples.youtube.models\n{\n\tpublic class VideoFeed\n\t{\n\t\tpublic function VideoFeed(name:String = null, url:String = null)\n\t\t{\n\t\t\tthis.name = name;\n\t\t\tthis.url = url;\n\t\t}\n\n\t\tpublic var name:String;\n\t\tpublic var url:String;\n\t}\n}\n"
  },
  {
    "path": "examples/YouTubeFeeds/source/feathers/examples/youtube/models/YouTubeModel.as",
    "content": "package feathers.examples.youtube.models\n{\n\tpublic class YouTubeModel\n\t{\n\t\tpublic var selectedList:VideoFeed;\n\t\tpublic var selectedVideo:VideoDetails;\n\t\tpublic var cachedLists:Object = {};\n\t}\n}\n"
  },
  {
    "path": "examples/YouTubeFeeds/source/feathers/examples/youtube/screens/ListVideosScreen.as",
    "content": "package feathers.examples.youtube.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.Label;\n\timport feathers.controls.List;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.renderers.IListItemRenderer;\n\timport feathers.data.VectorCollection;\n\timport feathers.events.FeathersEventType;\n\timport feathers.examples.youtube.models.VideoDetails;\n\timport feathers.examples.youtube.models.YouTubeModel;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\n\timport flash.events.ErrorEvent;\n\timport flash.events.Event;\n\timport flash.events.IOErrorEvent;\n\timport flash.events.SecurityErrorEvent;\n\timport flash.net.URLLoader;\n\timport flash.net.URLLoaderDataFormat;\n\timport flash.net.URLRequest;\n\timport flash.system.Capabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.display.Stage;\n\timport starling.events.Event;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\t[Event(name=\"showVideoDetails\",type=\"starling.events.Event\")]\n\n\tpublic class ListVideosScreen extends PanelScreen\n\t{\n\t\tpublic static const SHOW_VIDEO_DETAILS:String = \"showVideoDetails\";\n\t\t\n\t\tprivate static const YOUTUBE_VIDEO_URL:String = \"https://www.youtube.com/watch?v=\";\n\n\t\tpublic function ListVideosScreen()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.addEventListener(starling.events.Event.REMOVED_FROM_STAGE, removedFromStageHandler);\n\t\t}\n\n\t\tprivate var _backButton:Button;\n\t\tprivate var _list:List;\n\t\tprivate var _message:Label;\n\n\t\tprivate var _isTransitioning:Boolean = false;\n\n\t\tprivate var _model:YouTubeModel;\n\n\t\tpublic function get model():YouTubeModel\n\t\t{\n\t\t\treturn this._model;\n\t\t}\n\n\t\tpublic function set model(value:YouTubeModel):void\n\t\t{\n\t\t\tif(this._model == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._model = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\tpublic var savedVerticalScrollPosition:Number = 0;\n\t\tpublic var savedSelectedIndex:int = -1;\n\t\tpublic var savedDataProvider:VectorCollection;\n\n\t\tprivate var _loader:URLLoader;\n\t\tprivate var _savedResult:Object;\n\n\t\tpublic function get selectedVideo():VideoDetails\n\t\t{\n\t\t\tif(!this._list)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn this._list.selectedItem as VideoDetails;\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = this._model.selectedList.name;\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._list = new List();\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis._list.itemRendererFactory = function():IListItemRenderer\n\t\t\t{\n\t\t\t\tvar renderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\t\t\t\trenderer.labelField = \"title\";\n\t\t\t\trenderer.accessoryLabelField = \"author\";\n\t\t\t\t//no accessory and anything interactive, so we can use the quick\n\t\t\t\t//hit area to improve performance.\n\t\t\t\trenderer.isQuickHitAreaEnabled = true;\n\t\t\t\treturn renderer;\n\t\t\t}\n\t\t\t//when navigating to video details, we save this information to\n\t\t\t//restore the list when later navigating back to this screen.\n\t\t\tif(this.savedDataProvider)\n\t\t\t{\n\t\t\t\tthis._list.dataProvider = this.savedDataProvider;\n\t\t\t\tthis._list.selectedIndex = this.savedSelectedIndex;\n\t\t\t\tthis._list.verticalScrollPosition = this.savedVerticalScrollPosition;\n\t\t\t}\n\t\t\tthis.addChild(this._list);\n\n\t\t\tthis._message = new Label();\n\t\t\tthis._message.text = \"Loading...\";\n\t\t\tthis._message.layoutData = new AnchorLayoutData(NaN, NaN, NaN, NaN, 0, 0);\n\t\t\t//hide the loading message if we're using restored results\n\t\t\tthis._message.visible = this.savedDataProvider === null;\n\t\t\tthis.addChild(this._message);\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\tthis.backButtonHandler = onBackButton;\n\n\t\t\tthis._isTransitioning = true;\n\t\t\tthis.addEventListener(FeathersEventType.TRANSITION_IN_COMPLETE, transitionInCompleteHandler);\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\tthis._backButton = new Button();\n\t\t\tthis._backButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\tthis._backButton.label = \"Back\";\n\t\t\tthis._backButton.addEventListener(starling.events.Event.TRIGGERED, onBackButton);\n\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tthis._backButton\n\t\t\t];\n\t\t\treturn header;\n\t\t}\n\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\n\t\t\t//only load the list of videos if don't have restored results\n\t\t\tif(!this.savedDataProvider && dataInvalid)\n\t\t\t{\n\t\t\t\tthis._list.dataProvider = null;\n\t\t\t\tif(this._model && this._model.selectedList)\n\t\t\t\t{\n\t\t\t\t\tif(this._loader)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.cleanUpLoader();\n\t\t\t\t\t}\n\t\t\t\t\tif(this._model.cachedLists.hasOwnProperty(this._model.selectedList.url))\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._message.visible = false;\n\t\t\t\t\t\tthis._list.dataProvider = VectorCollection(this._model.cachedLists[this._model.selectedList.url]);\n\n\t\t\t\t\t\t//show the scroll bars so that the user knows they can scroll\n\t\t\t\t\t\tthis._list.revealScrollBars();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._loader = new URLLoader();\n\t\t\t\t\t\tthis._loader.dataFormat = URLLoaderDataFormat.TEXT;\n\t\t\t\t\t\tthis._loader.addEventListener(flash.events.Event.COMPLETE, loader_completeHandler);\n\t\t\t\t\t\tthis._loader.addEventListener(IOErrorEvent.IO_ERROR, loader_errorHandler);\n\t\t\t\t\t\tthis._loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, loader_errorHandler);\n\t\t\t\t\t\tthis._loader.load(new URLRequest(this._model.selectedList.url));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//never forget to call super.draw()!\n\t\t\tsuper.draw();\n\t\t}\n\n\t\tprivate function cleanUpLoader():void\n\t\t{\n\t\t\tif(!this._loader)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._loader.removeEventListener(flash.events.Event.COMPLETE, loader_completeHandler);\n\t\t\tthis._loader.removeEventListener(IOErrorEvent.IO_ERROR, loader_errorHandler);\n\t\t\tthis._loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, loader_errorHandler);\n\t\t\tthis._loader = null;\n\t\t}\n\n\t\tprivate function parseListVideosResult(result:Object):void\n\t\t{\n\t\t\tthis._message.visible = false;\n\t\t\t\n\t\t\tvar stage:Stage = Starling.current.stage;\n\t\t\tvar useHighQualityThumbnail:Boolean = Math.min(stage.stageWidth, stage.stageHeight) > 350;\n\t\t\tvar useHTTP:Boolean = Capabilities.playerType !== \"Desktop\";\n\t\t\t\n\t\t\tvar items:Vector.<VideoDetails> = new <VideoDetails>[];\n\t\t\tvar videos:Array = result.items as Array;\n\t\t\tvar videoCount:int = videos.length;\n\t\t\tfor(var i:int = 0; i < videoCount; i++)\n\t\t\t{\n\t\t\t\tvar video:Object = videos[i];\n\t\t\t\tvar item:VideoDetails = new VideoDetails();\n\t\t\t\titem.title = video.snippet.title as String;\n\t\t\t\titem.author = video.snippet.channelTitle as String;\n\t\t\t\titem.url = YOUTUBE_VIDEO_URL + video.id as String;\n\t\t\t\titem.description = video.snippet.description as String;\n\t\t\t\tif(\"thumbnails\" in video.snippet)\n\t\t\t\t{\n\t\t\t\t\tif(useHighQualityThumbnail)\n\t\t\t\t\t{\n\t\t\t\t\t\titem.thumbnailURL = video.snippet.thumbnails.high.url as String;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\titem.thumbnailURL = video.snippet.thumbnails.medium.url as String;\n\t\t\t\t\t}\n\t\t\t\t\t//switch from https to http if we're not running in AIR\n\t\t\t\t\tif(useHTTP && item.thumbnailURL.indexOf(\"https\") == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\titem.thumbnailURL = \"http\" + item.thumbnailURL.substr(5);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\titems.push(item);\n\t\t\t}\n\t\t\tvar collection:VectorCollection = new VectorCollection(items);\n\t\t\tthis._model.cachedLists[this._model.selectedList.url] = collection;\n\t\t\tthis._list.dataProvider = collection;\n\n\t\t\t//show the scroll bars so that the user knows they can scroll\n\t\t\tthis._list.revealScrollBars();\n\t\t}\n\n\t\tprivate function onBackButton(event:starling.events.Event = null):void\n\t\t{\n\t\t\tthis.dispatchEventWith(starling.events.Event.COMPLETE);\n\t\t}\n\n\t\tprivate function removedFromStageHandler(event:starling.events.Event):void\n\t\t{\n\t\t\tthis.cleanUpLoader();\n\t\t}\n\n\t\tprivate function transitionInCompleteHandler(event:starling.events.Event):void\n\t\t{\n\t\t\tthis._isTransitioning = false;\n\n\t\t\tif(this._savedResult)\n\t\t\t{\n\t\t\t\tthis.parseListVideosResult(this._savedResult);\n\t\t\t\tthis._savedResult = null;\n\t\t\t}\n\n\t\t\tthis._list.selectedIndex = -1;\n\t\t\tthis._list.addEventListener(starling.events.Event.CHANGE, list_changeHandler);\n\t\t\tthis._list.revealScrollBars();\n\t\t}\n\n\t\tprivate function list_changeHandler(event:starling.events.Event):void\n\t\t{\n\t\t\tif(this._list.selectedIndex < 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.dispatchEventWith(SHOW_VIDEO_DETAILS, false,\n\t\t\t{\n\t\t\t\t//we're going to save the position of the list so that when the user\n\t\t\t\t//navigates back to this screen, they won't need to scroll back to\n\t\t\t\t//the same position manually\n\t\t\t\tsavedVerticalScrollPosition: this._list.verticalScrollPosition,\n\t\t\t\t//we'll also save the selected index to temporarily highlight\n\t\t\t\t//the previously selected item when transitioning back\n\t\t\t\tsavedSelectedIndex: this._list.selectedIndex,\n\t\t\t\t//and we'll save the data provider so that we don't need to reload\n\t\t\t\t//data when we return to this screen. we can restore it.\n\t\t\t\tsavedDataProvider: this._list.dataProvider\n\t\t\t});\n\t\t}\n\n\t\tprivate function loader_completeHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tvar loaderData:String = this._loader.data as String;\n\t\t\tthis.cleanUpLoader();\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar result:Object = JSON.parse(loaderData);\n\t\t\t\tif(this._isTransitioning)\n\t\t\t\t{\n\t\t\t\t\t//if this screen is still transitioning in, the we'll save\n\t\t\t\t\t//the result until later to ensure that the animation isn't\n\t\t\t\t\t//affected.\n\t\t\t\t\tthis._savedResult = result;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.parseListVideosResult(result);\n\t\t\t}\n\t\t\tcatch(error:Error)\n\t\t\t{\n\t\t\t\tthis._message.text = \"Unable to read video list. Please try again later.\";\n\t\t\t\tthis._message.visible = true;\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t\t\ttrace(error.toString());\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tprivate function loader_errorHandler(event:ErrorEvent):void\n\t\t{\n\t\t\tthis.cleanUpLoader();\n\t\t\tthis._message.text = \"Unable to load video list. Please try again later.\";\n\t\t\tthis._message.visible = true;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t\ttrace(event.toString());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/YouTubeFeeds/source/feathers/examples/youtube/screens/MainMenuScreen.as",
    "content": "package feathers.examples.youtube.screens\n{\n\timport feathers.controls.Label;\n\timport feathers.controls.List;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.renderers.IListItemRenderer;\n\timport feathers.data.VectorCollection;\n\timport feathers.events.FeathersEventType;\n\timport feathers.examples.youtube.models.VideoFeed;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\n\timport flash.events.ErrorEvent;\n\timport flash.events.Event;\n\timport flash.events.IOErrorEvent;\n\timport flash.events.SecurityErrorEvent;\n\timport flash.net.URLLoader;\n\timport flash.net.URLLoaderDataFormat;\n\timport flash.net.URLRequest;\n\n\timport starling.events.Event;\n\n\t[Event(name=\"listVideos\",type=\"starling.events.Event\")]\n\n\tpublic class MainMenuScreen extends PanelScreen\n\t{\n\t\tpublic static const LIST_VIDEOS:String = \"listVideos\";\n\n\t\tprivate static const PART_PARAMETER:String = \"?part=snippet\"; //must be first\n\t\tprivate static const CHART_PARAMETER:String = \"&chart=mostPopular\";\n\t\tprivate static const REGION_CODE_PARAMETER:String = \"&regionCode=US\";\n\t\tprivate static const MAX_RESULTS_PARAMETER:String = \"&maxResults=25\";\n\t\tprivate static const VIDEO_CATEGORY_ID_PARAMETER:String = \"&videoCategoryId=\";\n\t\tprivate static const KEY_PARAMETER:String = \"&key=\" + CONFIG::YOUTUBE_API_KEY;\n\t\tprivate static const FIELDS_PARAMETER:String = \"&fields=items%2Fid%2Citems%2Fsnippet%2Ftitle%2Citems%2Fsnippet%2FchannelTitle%2Citems%2Fsnippet%2Fdescription%2Citems%2Fsnippet%2Fthumbnails\";\n\t\tprivate static const LIST_CATEGORIES_URL:String = \"https://www.googleapis.com/youtube/v3/videoCategories\" + PART_PARAMETER + REGION_CODE_PARAMETER + KEY_PARAMETER;\n\t\tprivate static const LIST_VIDEOS_IN_CATEGORY_URL:String = \"https://www.googleapis.com/youtube/v3/videos\" + PART_PARAMETER + CHART_PARAMETER + REGION_CODE_PARAMETER + MAX_RESULTS_PARAMETER + FIELDS_PARAMETER + KEY_PARAMETER + VIDEO_CATEGORY_ID_PARAMETER;\n\n\t\tpublic function MainMenuScreen()\n\t\t{\n\t\t\tthis.addEventListener(starling.events.Event.REMOVED_FROM_STAGE, removedFromStageHandler);\n\t\t}\n\n\t\tprivate var _list:List;\n\n\t\tprivate var _loader:URLLoader;\n\t\tprivate var _message:Label;\n\n\t\tpublic var savedVerticalScrollPosition:Number = 0;\n\t\tpublic var savedSelectedIndex:int = -1;\n\t\tpublic var savedDataProvider:VectorCollection;\n\n\t\tpublic function get selectedCategory():VideoFeed\n\t\t{\n\t\t\tif(!this._list)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn this._list.selectedItem as VideoFeed;\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tsuper.initialize();\n\n\t\t\tthis.title = \"YouTube Feeds\";\n\n\t\t\tthis.layout = new AnchorLayout();\n\n\t\t\tthis._list = new List();\n\t\t\tthis._list.layoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis._list.itemRendererFactory = this.createItemRenderer;\n\t\t\t//when navigating to video results, we save this information to\n\t\t\t//restore the list when later navigating back to this screen.\n\t\t\tif(this.savedDataProvider)\n\t\t\t{\n\t\t\t\tthis._list.dataProvider = this.savedDataProvider;\n\t\t\t\tthis._list.selectedIndex = this.savedSelectedIndex;\n\t\t\t\tthis._list.verticalScrollPosition = this.savedVerticalScrollPosition;\n\t\t\t}\n\t\t\tthis.addChild(this._list);\n\n\t\t\tthis._message = new Label();\n\t\t\tthis._message.text = \"Loading...\";\n\t\t\tthis._message.layoutData = new AnchorLayoutData(NaN, NaN, NaN, NaN, 0, 0);\n\t\t\t//hide the loading message if we're using restored results\n\t\t\tthis._message.visible = this.savedDataProvider === null;\n\t\t\tthis.addChild(this._message);\n\n\t\t\tthis.addEventListener(FeathersEventType.TRANSITION_IN_COMPLETE, transitionInCompleteHandler);\n\t\t}\n\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\n\t\t\t//only load the list of videos if don't have restored results\n\t\t\tif(!this.savedDataProvider && dataInvalid)\n\t\t\t{\n\t\t\t\tthis._list.dataProvider = null;\n\t\t\t\tthis._message.visible = true;\n\t\t\t\tif(this._loader)\n\t\t\t\t{\n\t\t\t\t\tthis.cleanUpLoader();\n\t\t\t\t}\n\t\t\t\tthis._loader = new URLLoader();\n\t\t\t\tthis._loader.dataFormat = URLLoaderDataFormat.TEXT;\n\t\t\t\tthis._loader.addEventListener(flash.events.Event.COMPLETE, loader_completeHandler);\n\t\t\t\tthis._loader.addEventListener(IOErrorEvent.IO_ERROR, loader_errorHandler);\n\t\t\t\tthis._loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, loader_errorHandler);\n\t\t\t\tthis._loader.load(new URLRequest(LIST_CATEGORIES_URL));\n\t\t\t}\n\n\t\t\t//never forget to call super.draw()!\n\t\t\tsuper.draw();\n\t\t}\n\n\t\tprivate function cleanUpLoader():void\n\t\t{\n\t\t\tif(!this._loader)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._loader.removeEventListener(flash.events.Event.COMPLETE, loader_completeHandler);\n\t\t\tthis._loader.removeEventListener(IOErrorEvent.IO_ERROR, loader_errorHandler);\n\t\t\tthis._loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, loader_errorHandler);\n\t\t\tthis._loader = null;\n\t\t}\n\n\t\tprivate function parseListVideoCategoriesResult(result:Object):void\n\t\t{\n\t\t\tthis._message.visible = false;\n\n\t\t\tvar items:Vector.<VideoFeed> = new <VideoFeed>[];\n\t\t\tvar categories:Array = result.items as Array;\n\t\t\tvar categoryCount:int = categories.length;\n\t\t\tfor(var i:int = 0; i < categoryCount; i++)\n\t\t\t{\n\t\t\t\tvar category:Object = categories[i];\n\t\t\t\tvar assignable:Boolean = category.snippet.assignable as Boolean; \n\t\t\t\tif(!assignable)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tvar item:VideoFeed = new VideoFeed();\n\t\t\t\titem.name = category.snippet.title as String;\n\t\t\t\tvar categoryID:String = category.id as String;\n\t\t\t\titem.url = LIST_VIDEOS_IN_CATEGORY_URL + categoryID;\n\t\t\t\titems.push(item);\n\t\t\t}\n\t\t\tvar collection:VectorCollection = new VectorCollection(items);\n\t\t\tthis._list.dataProvider = collection;\n\n\t\t\t//show the scroll bars so that the user knows they can scroll\n\t\t\tthis._list.revealScrollBars();\n\t\t}\n\n\t\tprivate function createItemRenderer():IListItemRenderer\n\t\t{\n\t\t\tvar renderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\t\t\trenderer.styleNameList.add(DefaultListItemRenderer.ALTERNATE_STYLE_NAME_DRILL_DOWN);\n\n\t\t\t//enable the quick hit area to optimize hit tests when an item\n\t\t\t//is only selectable and doesn't have interactive children.\n\t\t\trenderer.isQuickHitAreaEnabled = true;\n\n\t\t\trenderer.labelField = \"name\";\n\t\t\treturn renderer;\n\t\t}\n\n\t\tprivate function removedFromStageHandler(event:starling.events.Event):void\n\t\t{\n\t\t\tthis.cleanUpLoader();\n\t\t}\n\n\t\tprivate function transitionInCompleteHandler(event:starling.events.Event):void\n\t\t{\n\t\t\tthis._list.selectedIndex = -1;\n\t\t\tthis._list.addEventListener(starling.events.Event.CHANGE, list_changeHandler);\n\n\t\t\tthis._list.revealScrollBars();\n\t\t}\n\n\t\tprivate function list_changeHandler(event:starling.events.Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(LIST_VIDEOS, false,\n\t\t\t{\n\t\t\t\t//we're going to save the position of the list so that when the user\n\t\t\t\t//navigates back to this screen, they won't need to scroll back to\n\t\t\t\t//the same position manually\n\t\t\t\tsavedVerticalScrollPosition: this._list.verticalScrollPosition,\n\t\t\t\t//we'll also save the selected index to temporarily highlight\n\t\t\t\t//the previously selected item when transitioning back\n\t\t\t\tsavedSelectedIndex: this._list.selectedIndex,\n\t\t\t\t//and we'll save the data provider so that we don't need to reload\n\t\t\t\t//data when we return to this screen. we can restore it.\n\t\t\t\tsavedDataProvider: this._list.dataProvider\n\t\t\t});\n\t\t}\n\n\t\tprivate function loader_completeHandler(event:flash.events.Event):void\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar loaderData:String = this._loader.data as String;\n\t\t\t\tthis.parseListVideoCategoriesResult(JSON.parse(loaderData));\n\t\t\t}\n\t\t\tcatch(error:Error)\n\t\t\t{\n\t\t\t\tthis._message.text = \"Unable to load data. Please try again later.\";\n\t\t\t\tthis._message.visible = true;\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t\t\ttrace(error.toString());\n\t\t\t}\n\t\t\tthis.cleanUpLoader();\n\t\t}\n\n\t\tprivate function loader_errorHandler(event:ErrorEvent):void\n\t\t{\n\t\t\tthis.cleanUpLoader();\n\t\t\tthis._message.text = \"Unable to load data. Please try again later.\";\n\t\t\tthis._message.visible = true;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t\ttrace(event.toString());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/YouTubeFeeds/source/feathers/examples/youtube/screens/VideoDetailsScreen.as",
    "content": "package feathers.examples.youtube.screens\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.ImageLoader;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.ScrollPolicy;\n\timport feathers.controls.ScrollText;\n\timport feathers.events.FeathersEventType;\n\timport feathers.examples.youtube.models.YouTubeModel;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\n\timport flash.net.URLRequest;\n\timport flash.net.navigateToURL;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.utils.ScaleMode;\n\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\tpublic class VideoDetailsScreen extends PanelScreen\n\t{\n\t\tpublic function VideoDetailsScreen()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _backButton:Button;\n\t\tprivate var _watchButton:Button;\n\t\tprivate var _thumbnail:ImageLoader;\n\t\tprivate var _portraitThumbnailLayoutData:AnchorLayoutData;\n\t\tprivate var _landscapeThumbnailLayoutData:AnchorLayoutData;\n\t\tprivate var _scrollText:ScrollText;\n\t\tprivate var _portraitTextLayoutData:AnchorLayoutData;\n\t\tprivate var _landscapeTextLayoutData:AnchorLayoutData;\n\n\t\tprivate var _model:YouTubeModel;\n\n\t\tpublic function get model():YouTubeModel\n\t\t{\n\t\t\treturn this._model;\n\t\t}\n\n\t\tpublic function set model(value:YouTubeModel):void\n\t\t{\n\t\t\tif(this._model == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._model = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//never forget to call super.initialize()\n\t\t\tsuper.initialize();\n\n\t\t\tthis.layout = new AnchorLayout();\n\t\t\t\n\t\t\tthis._thumbnail = new ImageLoader();\n\t\t\tthis._thumbnail.scaleMode = ScaleMode.NO_BORDER;\n\t\t\tthis._thumbnail.layoutData = new AnchorLayoutData(0, 0, NaN, 0);\n\t\t\tthis.addChild(this._thumbnail);\n\n\t\t\tthis._scrollText = new ScrollText();\n\t\t\tthis._scrollText.isHTML = true;\n\t\t\tthis._scrollText.verticalScrollPolicy = ScrollPolicy.ON;\n\t\t\tthis.addChild(this._scrollText);\n\t\t\t\n\t\t\t//we're going to use these AnchorLayoutData objects later, when we\n\t\t\t//know if this screen is displayed in portrait or landscape.\n\t\t\t//we'll change it dynamically if the device is rotated while this\n\t\t\t//screen is visible.\n\t\t\tthis._portraitThumbnailLayoutData = new AnchorLayoutData(0, 0, NaN, 0);\n\t\t\tthis._landscapeThumbnailLayoutData = new AnchorLayoutData(0, NaN, 0, 0);\n\t\t\tthis._landscapeThumbnailLayoutData.percentWidth = 50;\n\t\t\tthis._portraitTextLayoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis._portraitTextLayoutData.topAnchorDisplayObject = this._thumbnail;\n\t\t\tthis._landscapeTextLayoutData = new AnchorLayoutData(0, 0, 0, 0);\n\t\t\tthis._landscapeTextLayoutData.leftAnchorDisplayObject = this._thumbnail;\n\n\t\t\tthis.headerFactory = this.customHeaderFactory;\n\n\t\t\tthis.backButtonHandler = onBackButton;\n\n\t\t\tthis.addEventListener(FeathersEventType.TRANSITION_IN_COMPLETE, transitionInCompleteHandler);\n\t\t}\n\n\t\tprivate function customHeaderFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\n\t\t\tthis._backButton = new Button();\n\t\t\tthis._backButton.styleNameList.add(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON);\n\t\t\tthis._backButton.label = \"Back\";\n\t\t\tthis._backButton.addEventListener(Event.TRIGGERED, onBackButton);\n\t\t\theader.leftItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tthis._backButton\n\t\t\t];\n\n\t\t\tthis._watchButton = new Button();\n\t\t\tthis._watchButton.label = \"Watch\";\n\t\t\tthis._watchButton.addEventListener(Event.TRIGGERED, watchButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tthis._watchButton\n\t\t\t];\n\n\t\t\treturn header;\n\t\t}\n\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\t\n\t\t\tif(dataInvalid)\n\t\t\t{\n\t\t\t\tif(this._model && this._model.selectedVideo)\n\t\t\t\t{\n\t\t\t\t\tthis.title = this._model.selectedVideo.title;\n\t\t\t\t\tthis._thumbnail.source = this._model.selectedVideo.thumbnailURL;\n\t\t\t\t\t\n\t\t\t\t\tvar content:String = '<p><b><font size=\"+2\">' + this._model.selectedVideo.title + '</font></b></p>';\n\t\t\t\t\tcontent += '<p><font size=\"-2\" color=\"#999999\">' + this._model.selectedVideo.author + '</font></p><br>';\n\t\t\t\t\tcontent += this._model.selectedVideo.description.replace(/\\r\\n/g, \"<br>\");\n\t\t\t\t\tthis._scrollText.text = content;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.title = null;\n\t\t\t\t\tthis._thumbnail.source = null;\n\t\t\t\t\tthis._scrollText.text = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(sizeInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshLayout();\n\t\t\t}\n\n\t\t\t//never forget to call super.draw()!\n\t\t\tsuper.draw();\n\t\t}\n\t\t\n\t\tprotected function refreshLayout():void\n\t\t{\n\t\t\tif(this.actualHeight > this.actualWidth &&\n\t\t\t\tthis._thumbnail.layoutData != this._portraitThumbnailLayoutData) //portrait\n\t\t\t{\n\t\t\t\t//in landscape, the height of the thumbnail may have been set\n\t\t\t\t//explicitly. we need to reset it so that the thumbnail can\n\t\t\t\t//resize itself automatically.\n\t\t\t\tthis._thumbnail.height = NaN;\n\t\t\t\tthis._thumbnail.layoutData = this._portraitThumbnailLayoutData;\n\t\t\t\t\n\t\t\t\tthis._scrollText.layoutData = this._portraitTextLayoutData;\n\t\t\t}\n\t\t\telse if(this.actualWidth > this.actualHeight) //landscape\n\t\t\t{\n\t\t\t\tthis._thumbnail.layoutData = this._landscapeThumbnailLayoutData;\n\t\t\t\tthis._scrollText.layoutData = this._landscapeTextLayoutData;\n\t\t\t}\n\t\t}\n\n\t\tprivate function onBackButton(event:Event = null):void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\n\t\tprivate function transitionInCompleteHandler(event:Event):void\n\t\t{\n\t\t\tthis._scrollText.revealScrollBars();\n\t\t}\n\n\t\tprivate function watchButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tnavigateToURL(new URLRequest(this._model.selectedVideo.url), \"_blank\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "examples/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<project name=\"feathers-examples\" default=\"web\" basedir=\".\">\n\n\t<target name=\"desktop\" description=\"Builds desktop SWFs from all examples.\">\n\t\t<ant dir=\"${basedir}/Video\" target=\"build-desktop\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t</target>\n\t<target name=\"web\" description=\"Builds web SWFs from all examples.\">\n\t\t<ant dir=\"${basedir}/ComponentsExplorer\" target=\"build-web\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/DrawersExplorer\" target=\"build-web\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/DragAndDrop\" target=\"build\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/HelloWorld\" target=\"build-web\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/LayoutExplorer\" target=\"build-web\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/Magic8Chat\" target=\"build-web\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/PullToRefresh\" target=\"build-web\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/StackScreenNavigatorExplorer\" target=\"build-web\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/Tabs\" target=\"build-web\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/TileList\" target=\"build-web\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/Todos\" target=\"build-web\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/TrainTimes\" target=\"build-web\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/TransitionsExplorer\" target=\"build-web\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/YouTubeFeeds\" target=\"build-web\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t</target>\n\t<target name=\"android\" description=\"Builds Android APKs from all examples.\">\n\t\t<ant dir=\"${basedir}/ComponentsExplorer\" target=\"build-android\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/DrawersExplorer\" target=\"build-android\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/Gallery\" target=\"build-android\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/HelloWorld\" target=\"build-android\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/LayoutExplorer\" target=\"build-android\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/Magic8Chat\" target=\"build-android\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/PullToRefresh\" target=\"build-android\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/StackScreenNavigatorExplorer\" target=\"build-android\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/Tabs\" target=\"build-android\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/TileList\" target=\"build-android\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/Todos\" target=\"build-android\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/TrainTimes\" target=\"build-android\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/TransitionsExplorer\" target=\"build-android\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/YouTubeFeeds\" target=\"build-android\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t</target>\n\t<target name=\"ios\" description=\"Builds iOS IPAs from all examples.\">\n\t\t<ant dir=\"${basedir}/ComponentsExplorer\" target=\"build-ios\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/DrawersExplorer\" target=\"build-ios\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/Gallery\" target=\"build-ios\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/HelloWorld\" target=\"build-ios\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/LayoutExplorer\" target=\"build-ios\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/Magic8Chat\" target=\"build-ios\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/PullToRefresh\" target=\"build-ios\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/StackScreenNavigatorExplorer\" target=\"build-ios\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/Tabs\" target=\"build-ios\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/TileList\" target=\"build-ios\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/Todos\" target=\"build-ios\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/TrainTimes\" target=\"build-ios\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/TransitionsExplorer\" target=\"build-ios\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/YouTubeFeeds\" target=\"build-ios\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t</target>\n\t<target name=\"install-android\" description=\"Installs Android APKs to a device.\">\n\t\t<ant dir=\"${basedir}/ComponentsExplorer\" target=\"install-android\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/DrawersExplorer\" target=\"install-android\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/Gallery\" target=\"install-android\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/HelloWorld\" target=\"install-android\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/LayoutExplorer\" target=\"install-android\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/Magic8Chat\" target=\"install-android\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/PullToRefresh\" target=\"install-android\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/StackScreenNavigatorExplorer\" target=\"install-android\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/Tabs\" target=\"install-android\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/TileList\" target=\"install-android\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/Todos\" target=\"install-android\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/TrainTimes\" target=\"install-android\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/TransitionsExplorer\" target=\"install-android\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/YouTubeFeeds\" target=\"install-android\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t</target>\n\t<target name=\"install-ios\" description=\"Installs iOS IPAs to a device.\">\n\t\t<ant dir=\"${basedir}/ComponentsExplorer\" target=\"install-ios\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/DrawersExplorer\" target=\"install-ios\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/Gallery\" target=\"install-ios\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/HelloWorld\" target=\"install-ios\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/LayoutExplorer\" target=\"install-ios\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/Magic8Chat\" target=\"install-ios\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/PullToRefresh\" target=\"install-ios\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/StackScreenNavigatorExplorer\" target=\"install-ios\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/Tabs\" target=\"install-ios\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/TileList\" target=\"install-ios\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/Todos\" target=\"install-ios\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/TrainTimes\" target=\"install-ios\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/TransitionsExplorer\" target=\"install-ios\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t\t<ant dir=\"${basedir}/YouTubeFeeds\" target=\"install-ios\" inheritAll=\"false\" useNativeBasedir=\"true\"/>\n\t</target>\n</project>"
  },
  {
    "path": "package-src.json",
    "content": "{\n  \"id\": \"feathersui-source\",\n  \"name\": \"feathersui-source\",\n  \"url\": \"https://feathersui.com/as3-starling/\",\n  \"docUrl\": \"https://feathersui/api-reference/\",\n  \"description\": \"Cross-platform user interface components for creative frontend projects built with Starling\",\n  \"type\": \"src\",\n  \"version\": \"4.2.0\",\n  \"sourceUrl\": \"https://github.com/feathersui/feathersui-starling/releases/download/v4.2.0/feathersui-source_4.2.0.airpackage\",\n\t\"publishedAt\": \"2021-11-19T00:00:00.000Z\",\n  \"dependencies\": [\"starling-source:2.x.x\"],\n  \"parameters\": [],\n  \"tags\": [\"components\", \"gui\", \"starling\", \"ui\", \"widgets\"],\n  \"status\": \"release\",\n  \"license\": {\n    \"type\": \"Simplified BSD\",\n    \"url\": \"https://github.com/feathersui/feathersui-starling/blob/v4.2.0/LICENSE.md\",\n    \"public\": true\n  }\n}\n"
  },
  {
    "path": "package-swc.json",
    "content": "{\n  \"id\": \"feathersui\",\n  \"name\": \"feathersui\",\n  \"url\": \"https://feathersui.com/as3-starling/\",\n  \"docUrl\": \"https://feathersui/api-reference/\",\n  \"description\": \"Cross-platform user interface components for creative frontend projects built with Starling\",\n  \"type\": \"swc\",\n  \"version\": \"4.2.0\",\n  \"sourceUrl\": \"https://github.com/feathersui/feathersui-starling/releases/download/v4.2.0/feathersui_4.2.0.airpackage\",\n\t\"publishedAt\": \"2021-11-19T00:00:00.000Z\",\n  \"dependencies\": [\"starling:2.x.x\"],\n  \"parameters\": [],\n  \"tags\": [\"components\", \"gui\", \"starling\", \"ui\", \"widgets\"],\n  \"status\": \"release\",\n  \"license\": {\n    \"type\": \"Simplified BSD\",\n    \"url\": \"https://github.com/feathersui/feathersui-starling/blob/v4.2.0/LICENSE.md\",\n    \"public\": true\n  }\n}\n"
  },
  {
    "path": "sdk.properties",
    "content": "# The location of the AIR SDK with ASC 2.0\nflashsdk.root = c:/Users/josht/Development/Flash/sdks/AIR32.0.0.89\nflashsdk.bin = ${flashsdk.root}/bin\nflashsdk.lib = ${flashsdk.root}/lib\nflashsdk.config = ${flashsdk.root}/frameworks/flex-config.xml\nflashsdk.framework = ${flashsdk.root}/frameworks\n\n# config files\nflashplayer.config = ${flashsdk.root}/frameworks/flex-config.xml\nairdesktop.config = ${flashsdk.root}/frameworks/air-config.xml\nairmobile.config = ${flashsdk.root}/frameworks/airmobile-config.xml\n\n# path to compiler jars\nasdoc = ${flashsdk.lib}/legacy/asdoc.jar\ncompc = ${flashsdk.lib}/compc-cli.jar\nmxmlc = ${flashsdk.lib}/mxmlc-cli.jar\nadt = ${flashsdk.lib}/adt.jar\n\napm = /opt/apm/apm"
  },
  {
    "path": "source/feathers/FEATHERS_VERSION.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers\n{\n\t/**\n\t * The current version of Feathers. Stable versions will use the format\n\t * <code>major.minor.patch</code>. Prerelease versions may append additional\n\t * information after a hyphen. For example, the beta release of Feathers 2.2\n\t * would use the following value: <code>2.2.0-beta</code>. Special builds\n\t * may append additional information after a plus sign. For example, the\n\t * stable release of Feathers SDK 2.2 would use the following value:\n\t * <code>2.2.0+sdk</code>. The beta version of Feathers SDK 2.2 would use\n\t * the following value: <code>2.2.0-beta+sdk</code>.\n\t *\n\t * @productversion Feathers 2.1.0\n\t */\n\tpublic const FEATHERS_VERSION:String = \"4.2.0\";\n}\n"
  },
  {
    "path": "source/feathers/controls/Alert.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IMeasureDisplayObject;\n\timport feathers.core.ITextRenderer;\n\timport feathers.core.IValidating;\n\timport feathers.core.PopUpManager;\n\timport feathers.core.PropertyProxy;\n\timport feathers.data.IListCollection;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.text.FontStylesSet;\n\timport feathers.utils.display.getDisplayObjectDepthFromStage;\n\timport feathers.utils.skins.resetFluidChildDimensionsForMeasurement;\n\n\timport flash.events.KeyboardEvent;\n\timport flash.ui.Keyboard;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.text.TextFormat;\n\n\t[Exclude(name=\"layout\",kind=\"property\")]\n\t[Exclude(name=\"footer\",kind=\"property\")]\n\t[Exclude(name=\"footerFactory\",kind=\"property\")]\n\t[Exclude(name=\"footerProperties\",kind=\"property\")]\n\t[Exclude(name=\"customFooterStyleName\",kind=\"style\")]\n\t[Exclude(name=\"createFooter\",kind=\"method\")]\n\n\t/**\n\t * A style name to add to the alert's button group sub-component.\n\t * Typically used by a theme to provide different styles to different alerts.\n\t *\n\t * <p>In the following example, a custom button group style name is\n\t * passed to the alert:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * alert.customButtonGroupStyleName = \"my-custom-button-group\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( ButtonGroup ).setFunctionForStyleName( \"my-custom-button-group\", setCustomButtonGroupStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_BUTTON_GROUP\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #buttonGroupFactory\n\t */\n\t[Style(name=\"customButtonGroupStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to the alert's message text renderer\n\t * sub-component. Typically used by a theme to provide different styles\n\t * to different alerts.\n\t *\n\t * <p>In the following example, a custom message style name is passed\n\t * to the alert:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * alert.customMessageStyleName = \"my-custom-button-group\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( BitmapFontTextRenderer ).setFunctionForStyleName( \"my-custom-message\", setCustomMessageStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_MESSAGE\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #messageFactory\n\t */\n\t[Style(name=\"customMessageStyleName\",type=\"String\")]\n\n\t/**\n\t * The font styles used to display the alert's message text when the\n\t * alert is disabled.\n\t *\n\t * <p>These styles will only apply to the alert's message. The header's\n\t * title font styles should be set directly on the header. The button\n\t * font styles should be set directly on the buttons.</p>\n\t *\n\t * <p>In the following example, the disabled font styles are customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * alert.disabledFontStyles = new TextFormat( \"Helvetica\", 20, 0x999999 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>messageFactory</code> to set more advanced styles on the\n\t * text renderer.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:fontStyles\n\t */\n\t[Style(name=\"disabledFontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The font styles used to display the alert's message text.\n\t *\n\t * <p>These styles will only apply to the alert's message. The header's\n\t * title font styles should be set directly on the header. The button\n\t * font styles should be set directly on the buttons.</p>\n\t *\n\t * <p>In the following example, the font styles are customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * alert.fontStyles = new TextFormat( \"Helvetica\", 20, 0xcc0000 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>messageFactory</code> to set more advanced styles.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:disabledFontStyles\n\t */\n\t[Style(name=\"fontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The space, in pixels, between the alert's icon and its message text\n\t * renderer.\n\t *\n\t * <p>In the following example, the gap is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * alert.gap = 20;</listing>\n\t *\n\t * @default 0\n\t */\n\t[Style(name=\"gap\",type=\"Number\")]\n\n\t/**\n\t * The alert's optional icon content to display next to the text.\n\t *\n\t * <p>In the following example, the icon is privated:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * alert.icon = new Image( texture );</listing>\n\t *\n\t * @default null\n\t */\n\t[Style(name=\"icon\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * Dispatched when the alert is closed. The <code>data</code> property of\n\t * the event object will contain the item from the <code>ButtonGroup</code>\n\t * data provider for the button that is triggered. If no button is\n\t * triggered, then the <code>data</code> property will be <code>null</code>.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CLOSE\n\t */\n\t[Event(name=\"close\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Displays a message in a modal pop-up with a title and a set of buttons.\n\t *\n\t * <p>In general, an <code>Alert</code> isn't instantiated directly.\n\t * Instead, you will typically call the static function\n\t * <code>Alert.show()</code>. This is not required, but it result in less\n\t * code and no need to manually manage calls to the <code>PopUpManager</code>.</p>\n\t *\n\t * <p>In the following example, an alert is shown when a <code>Button</code>\n\t * is triggered:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.addEventListener( Event.TRIGGERED, button_triggeredHandler );\n\t * \n\t * function button_triggeredHandler( event:Event ):void\n\t * {\n\t *     var alert:Alert = Alert.show( \"This is an alert!\", \"Hello World\", new ArrayCollection(\n\t *     [\n\t *         { label: \"OK\" }\n\t *     ]));\n\t * }</listing>\n\t *\n\t * @see ../../../help/alert.html How to use the Feathers Alert component\n\t *\n\t * @productversion Feathers 1.2.0\n\t */\n\tpublic class Alert extends Panel\n\t{\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the header.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_HEADER:String = \"feathers-alert-header\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the button group.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_BUTTON_GROUP:String = \"feathers-alert-button-group\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the\n\t\t * message text renderer.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t * @see ../../../help/text-renderers.html Introduction to Feathers text renderers\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_MESSAGE:String = \"feathers-alert-message\";\n\n\t\t/**\n\t\t * Returns a new <code>Alert</code> instance when <code>Alert.show()</code>\n\t\t * is called. If one wishes to skin the alert manually, a custom factory\n\t\t * may be provided.\n\t\t *\n\t\t * <p>This function is expected to have the following signature:</p>\n\t\t *\n\t\t * <pre>function():Alert</pre>\n\t\t *\n\t\t * <p>The following example shows how to create a custom alert factory:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * Alert.alertFactory = function():Alert\n\t\t * {\n\t\t *     var alert:Alert = new Alert();\n\t\t *     //set properties here!\n\t\t *     return alert;\n\t\t * };</listing>\n\t\t *\n\t\t * @see #show()\n\t\t */\n\t\tpublic static var alertFactory:Function = defaultAlertFactory;\n\n\t\t/**\n\t\t * Creates overlays for modal alerts. When this property is\n\t\t * <code>null</code>, uses the <code>overlayFactory</code> defined by\n\t\t * <code>PopUpManager</code> instead.\n\t\t *\n\t\t * <p>Note: Specific, individual alerts may have custom overlays that\n\t\t * are different than the default by passing a different overlay factory\n\t\t * to <code>Alert.show()</code>.</p>\n\t\t *\n\t\t * <p>This function is expected to have the following signature:</p>\n\t\t * <pre>function():DisplayObject</pre>\n\t\t *\n\t\t * <p>The following example uses a semi-transparent <code>Quad</code> as\n\t\t * a custom overlay:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * Alert.overlayFactory = function():Quad\n\t\t * {\n\t\t *     var quad:Quad = new Quad(10, 10, 0x000000);\n\t\t *     quad.alpha = 0.75;\n\t\t *     return quad;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.PopUpManager#overlayFactory\n\t\t * @see #show()\n\t\t */\n\t\tpublic static var overlayFactory:Function;\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>Alert</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * The default factory that creates alerts when <code>Alert.show()</code>\n\t\t * is called. To use a different factory, you need to set\n\t\t * <code>Alert.alertFactory</code> to a <code>Function</code>\n\t\t * instance.\n\t\t *\n\t\t * @see #show()\n\t\t * @see #alertFactory\n\t\t */\n\t\tpublic static function defaultAlertFactory():Alert\n\t\t{\n\t\t\treturn new Alert();\n\t\t}\n\n\t\t/**\n\t\t * Creates an alert, sets common properties, and adds it to the\n\t\t * <code>PopUpManager</code> with the specified modal and centering\n\t\t * options.\n\t\t *\n\t\t * <p>In the following example, an alert is shown when a\n\t\t * <code>Button</code> is triggered:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * button.addEventListener( Event.TRIGGERED, button_triggeredHandler );\n\t\t * \n\t\t * function button_triggeredHandler( event:Event ):void\n\t\t * {\n\t\t *     var alert:Alert = Alert.show( \"This is an alert!\", \"Hello World\", new ArrayCollection(\n\t\t *     [\n\t\t *         { label: \"OK\" }\n\t\t *     ]);\n\t\t * }</listing>\n\t\t */\n\t\tpublic static function show(message:String, title:String = null, buttons:IListCollection = null,\n\t\t\ticon:DisplayObject = null, isModal:Boolean = true, isCentered:Boolean = true,\n\t\t\tcustomAlertFactory:Function = null, customOverlayFactory:Function = null):Alert\n\t\t{\n\t\t\tvar factory:Function = customAlertFactory;\n\t\t\tif(factory == null)\n\t\t\t{\n\t\t\t\tfactory = alertFactory != null ? alertFactory : defaultAlertFactory;\n\t\t\t}\n\t\t\tvar alert:Alert = Alert(factory());\n\t\t\talert.title = title;\n\t\t\talert.message = message;\n\t\t\talert.buttonsDataProvider = buttons;\n\t\t\talert.icon = icon;\n\t\t\tfactory = customOverlayFactory;\n\t\t\tif(factory == null)\n\t\t\t{\n\t\t\t\tfactory = overlayFactory;\n\t\t\t}\n\t\t\tPopUpManager.addPopUp(alert, isModal, isCentered, factory);\n\t\t\treturn alert;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultButtonGroupFactory():ButtonGroup\n\t\t{\n\t\t\treturn new ButtonGroup();\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function Alert()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.headerStyleName = DEFAULT_CHILD_STYLE_NAME_HEADER;\n\t\t\tthis.footerStyleName = DEFAULT_CHILD_STYLE_NAME_BUTTON_GROUP;\n\t\t\tif(this._fontStylesSet === null)\n\t\t\t{\n\t\t\t\tthis._fontStylesSet = new FontStylesSet();\n\t\t\t\tthis._fontStylesSet.addEventListener(Event.CHANGE, fontStyles_changeHandler);\n\t\t\t}\n\t\t\tthis.buttonGroupFactory = defaultButtonGroupFactory;\n\t\t\tthis.addEventListener(Event.ADDED_TO_STAGE, alert_addedToStageHandler);\n\t\t}\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the alert's\n\t\t * message text renderer. This variable is <code>protected</code> so\n\t\t * that sub-classes can customize the message style name in their\n\t\t * constructors instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_MESSAGE</code>.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var messageStyleName:String = DEFAULT_CHILD_STYLE_NAME_MESSAGE;\n\n\t\t/**\n\t\t * The header sub-component.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t */\n\t\tprotected var headerHeader:Header;\n\n\t\t/**\n\t\t * The button group sub-component.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t */\n\t\tprotected var buttonGroupFooter:ButtonGroup;\n\n\t\t/**\n\t\t * The message text renderer sub-component.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t */\n\t\tprotected var messageTextRenderer:ITextRenderer;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn Alert.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _message:String = null;\n\n\t\t/**\n\t\t * The alert's main text content.\n\t\t */\n\t\tpublic function get message():String\n\t\t{\n\t\t\treturn this._message;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set message(value:String):void\n\t\t{\n\t\t\tif(this._message == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._message = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _icon:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get icon():DisplayObject\n\t\t{\n\t\t\treturn this._icon;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set icon(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._icon === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar oldDisplayListBypassEnabled:Boolean = this.displayListBypassEnabled;\n\t\t\tthis.displayListBypassEnabled = false;\n\t\t\tif(this._icon)\n\t\t\t{\n\t\t\t\tthis._icon.removeEventListener(FeathersEventType.RESIZE, icon_resizeHandler);\n\t\t\t\tthis.removeChild(this._icon);\n\t\t\t}\n\t\t\tthis._icon = value;\n\t\t\tif(this._icon)\n\t\t\t{\n\t\t\t\tthis._icon.addEventListener(FeathersEventType.RESIZE, icon_resizeHandler);\n\t\t\t\tthis.addChild(this._icon);\n\t\t\t}\n\t\t\tthis.displayListBypassEnabled = oldDisplayListBypassEnabled;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _gap:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get gap():Number\n\t\t{\n\t\t\treturn this._gap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set gap(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._gap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._gap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _buttonsDataProvider:IListCollection = null;\n\n\t\t/**\n\t\t * The data provider of the alert's <code>ButtonGroup</code>.\n\t\t */\n\t\tpublic function get buttonsDataProvider():IListCollection\n\t\t{\n\t\t\treturn this._buttonsDataProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set buttonsDataProvider(value:IListCollection):void\n\t\t{\n\t\t\tif(this._buttonsDataProvider == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._buttonsDataProvider = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _acceptButtonIndex:int;\n\n\t\t/**\n\t\t * The index of the button in the <code>buttonsDataProvider</code> to\n\t\t * trigger when <code>Keyboard.ENTER</code> is pressed.\n\t\t *\n\t\t * <p>In the following example, the <code>acceptButtonIndex</code> is\n\t\t * set to the first button in the data provider.</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var alert:Alert = Alert.show( \"This is an alert!\", \"Hello World\", new ArrayCollection(\n\t\t * [\n\t\t *     { label: \"OK\" }\n\t\t * ]));\n\t\t * alert.acceptButtonIndex = 0;</listing>\n\t\t *\n\t\t * @default -1\n\t\t */\n\t\tpublic function get acceptButtonIndex():int\n\t\t{\n\t\t\treturn this._acceptButtonIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set acceptButtonIndex(value:int):void\n\t\t{\n\t\t\tthis._acceptButtonIndex = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _cancelButtonIndex:int;\n\n\t\t/**\n\t\t * The index of the button in the <code>buttonsDataProvider</code> to\n\t\t * trigger when <code>Keyboard.ESCAPE</code> or\n\t\t * <code>Keyboard.BACK</code> is pressed.\n\t\t *\n\t\t * <p>In the following example, the <code>cancelButtonIndex</code> is\n\t\t * set to the second button in the data provider.</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var alert:Alert = Alert.show( \"This is an alert!\", \"Hello World\", new ArrayCollection(\n\t\t * [\n\t\t *     { label: \"OK\" },\n\t\t *     { label: \"Cancel\" },\n\t\t * ]));\n\t\t * alert.cancelButtonIndex = 1;</listing>\n\t\t *\n\t\t * @default -1\n\t\t */\n\t\tpublic function get cancelButtonIndex():int\n\t\t{\n\t\t\treturn this._cancelButtonIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set cancelButtonIndex(value:int):void\n\t\t{\n\t\t\tthis._cancelButtonIndex = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fontStylesSet:FontStylesSet;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get fontStyles():TextFormat\n\t\t{\n\t\t\treturn this._fontStylesSet.format;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set fontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._fontStylesSet.format;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._fontStylesSet.format = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get disabledFontStyles():TextFormat\n\t\t{\n\t\t\treturn this._fontStylesSet.disabledFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disabledFontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._fontStylesSet.disabledFormat;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._fontStylesSet.disabledFormat = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _messageFactory:Function;\n\n\t\t/**\n\t\t * A function used to instantiate the alert's message text renderer\n\t\t * sub-component. By default, the alert will use the global text\n\t\t * renderer factory, <code>FeathersControl.defaultTextRendererFactory()</code>,\n\t\t * to create the message text renderer. The message text renderer must\n\t\t * be an instance of <code>ITextRenderer</code>. This factory can be\n\t\t * used to change properties on the message text renderer when it is\n\t\t * first created. For instance, if you are skinning Feathers components\n\t\t * without a theme, you might use this factory to style the message text\n\t\t * renderer.\n\t\t *\n\t\t * <p>If you are not using a theme, the message factory can be used to\n\t\t * provide skin the message text renderer with appropriate text styles.</p>\n\t\t *\n\t\t * <p>The factory should have the following function signature:</p>\n\t\t * <pre>function():ITextRenderer</pre>\n\t\t *\n\t\t * <p>In the following example, a custom message factory is passed to\n\t\t * the alert:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * alert.messageFactory = function():ITextRenderer\n\t\t * {\n\t\t *     var messageRenderer:TextFieldTextRenderer = new TextFieldTextRenderer();\n\t\t *     messageRenderer.textFormat = new TextFormat( \"_sans\", 12, 0xff0000 );\n\t\t *     return messageRenderer;\n\t\t * }</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #message\n\t\t * @see feathers.core.ITextRenderer\n\t\t * @see feathers.core.FeathersControl#defaultTextRendererFactory\n\t\t */\n\t\tpublic function get messageFactory():Function\n\t\t{\n\t\t\treturn this._messageFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set messageFactory(value:Function):void\n\t\t{\n\t\t\tif(this._messageFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._messageFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _messageProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the alert's message text\n\t\t * renderer sub-component, and the properties will be passed down to the\n\t\t * text renderer when the alert validates. The available properties\n\t\t * depend on which <code>ITextRenderer</code> implementation is returned\n\t\t * by <code>messageFactory</code>. Refer to\n\t\t * <a href=\"../core/ITextRenderer.html\"><code>feathers.core.ITextRenderer</code></a>\n\t\t * for a list of available text renderer implementations.\n\t\t *\n\t\t * <p>In the following example, some properties are set for the alert's\n\t\t * message text renderer (this example assumes that the message text\n\t\t * renderer is a <code>BitmapFontTextRenderer</code>):</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * alert.messageProperties.textFormat = new BitmapFontTextFormat( bitmapFont );\n\t\t * alert.messageProperties.wordWrap = true;</listing>\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>messageFactory</code> function instead\n\t\t * of using <code>messageProperties</code> will result in better\n\t\t * performance.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #messageFactory\n\t\t * @see feathers.core.ITextRenderer\n\t\t */\n\t\tpublic function get messageProperties():Object\n\t\t{\n\t\t\tif(!this._messageProperties)\n\t\t\t{\n\t\t\t\tthis._messageProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._messageProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set messageProperties(value:Object):void\n\t\t{\n\t\t\tif(this._messageProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value && !(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvalue = PropertyProxy.fromObject(value);\n\t\t\t}\n\t\t\tif(this._messageProperties)\n\t\t\t{\n\t\t\t\tthis._messageProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._messageProperties = PropertyProxy(value);\n\t\t\tif(this._messageProperties)\n\t\t\t{\n\t\t\t\tthis._messageProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customMessageStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customMessageStyleName():String\n\t\t{\n\t\t\treturn this._customMessageStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customMessageStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customMessageStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customMessageStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * A function used to generate the alerts's button group sub-component.\n\t\t * The button group must be an instance of <code>ButtonGroup</code>.\n\t\t * This factory can be used to change properties on the button group\n\t\t * when it is first created. For instance, if you are skinning Feathers\n\t\t * components without a theme, you might use this factory to set skins\n\t\t * and other styles on the button group.\n\t\t *\n\t\t * <p>The function should have the following signature:</p>\n\t\t * <pre>function():ButtonGroup</pre>\n\t\t *\n\t\t * <p>In the following example, a custom button group factory is\n\t\t * provided to the alert:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * alert.buttonGroupFactory = function():ButtonGroup\n\t\t * {\n\t\t *     return new ButtonGroup();\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.ButtonGroup\n\t\t */\n\t\tpublic function get buttonGroupFactory():Function\n\t\t{\n\t\t\treturn super.footerFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set buttonGroupFactory(value:Function):void\n\t\t{\n\t\t\tsuper.footerFactory = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customButtonGroupStyleName():String\n\t\t{\n\t\t\treturn super.customFooterStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customButtonGroupStyleName(value:String):void\n\t\t{\n\t\t\tsuper.customFooterStyleName = value;\n\t\t}\n\n\t\t/**\n\t\t * An object that stores properties for the alert's button group\n\t\t * sub-component, and the properties will be passed down to the button\n\t\t * group when the alert validates. For a list of available properties,\n\t\t * refer to <a href=\"ButtonGroup.html\"><code>feathers.controls.ButtonGroup</code></a>.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>buttonGroupFactory</code> function\n\t\t * instead of using <code>buttonGroupProperties</code> will result in better\n\t\t * performance.</p>\n\t\t *\n\t\t * <p>In the following example, the button group properties are customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * alert.buttonGroupProperties.gap = 20;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #buttonGroupFactory\n\t\t * @see feathers.controls.ButtonGroup\n\t\t */\n\t\tpublic function get buttonGroupProperties():Object\n\t\t{\n\t\t\treturn super.footerProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set buttonGroupProperties(value:Object):void\n\t\t{\n\t\t\tsuper.footerProperties = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this._fontStylesSet !== null)\n\t\t\t{\n\t\t\t\tthis._fontStylesSet.dispose();\n\t\t\t\tthis._fontStylesSet = null;\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tif(this._layout === null)\n\t\t\t{\n\t\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\t\tlayout.horizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\t\tthis.ignoreNextStyleRestriction();\n\t\t\t\tthis.layout = layout;\n\t\t\t}\n\t\t\tsuper.initialize();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar textRendererInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_TEXT_RENDERER);\n\n\t\t\tif(textRendererInvalid)\n\t\t\t{\n\t\t\t\tthis.createMessage();\n\t\t\t}\n\n\t\t\tif(textRendererInvalid || dataInvalid)\n\t\t\t{\n\t\t\t\tthis.messageTextRenderer.text = this._message;\n\t\t\t}\n\n\t\t\tif(textRendererInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshMessageStyles();\n\t\t\t}\n\n\t\t\tsuper.draw();\n\n\t\t\tif(this._icon !== null)\n\t\t\t{\n\t\t\t\tif(this._icon is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this._icon).validate();\n\t\t\t\t}\n\t\t\t\tthis._icon.x = this._paddingLeft;\n\t\t\t\tthis._icon.y = this._topViewPortOffset + (this._viewPort.visibleHeight - this._icon.height) / 2;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tif(this._autoSizeMode === AutoSizeMode.STAGE)\n\t\t\t{\n\t\t\t\t//the implementation in a super class can handle this\n\t\t\t\treturn super.autoSizeIfNeeded();\n\t\t\t}\n\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tresetFluidChildDimensionsForMeasurement(this.currentBackgroundSkin,\n\t\t\t\tthis._explicitWidth, this._explicitHeight,\n\t\t\t\tthis._explicitMinWidth, this._explicitMinHeight,\n\t\t\t\tthis._explicitMaxWidth, this._explicitMaxHeight,\n\t\t\t\tthis._explicitBackgroundWidth, this._explicitBackgroundHeight,\n\t\t\t\tthis._explicitBackgroundMinWidth, this._explicitBackgroundMinHeight,\n\t\t\t\tthis._explicitBackgroundMaxWidth, this._explicitBackgroundMaxHeight);\n\t\t\tvar measureBackground:IMeasureDisplayObject = this.currentBackgroundSkin as IMeasureDisplayObject;\n\t\t\tif(this.currentBackgroundSkin is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.currentBackgroundSkin).validate();\n\t\t\t}\n\n\t\t\tif(this._icon is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this._icon).validate();\n\t\t\t}\n\n\t\t\t//we don't measure the header and footer here because they are\n\t\t\t//handled in calculateViewPortOffsets(), which is automatically\n\t\t\t//called by Scroller before autoSizeIfNeeded().\n\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tif(this._measureViewPort)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this._viewPort.visibleWidth;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewWidth = 0;\n\t\t\t\t}\n\t\t\t\t//we don't need to account for the icon and gap because it is\n\t\t\t\t//already included in the left offset\n\t\t\t\tnewWidth += this._rightViewPortOffset + this._leftViewPortOffset;\n\t\t\t\tvar headerWidth:Number = this.header.width + this._outerPaddingLeft + this._outerPaddingRight;\n\t\t\t\tif(headerWidth > newWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = headerWidth;\n\t\t\t\t}\n\t\t\t\tif(this.footer !== null)\n\t\t\t\t{\n\t\t\t\t\tvar footerWidth:Number = this.footer.width + this._outerPaddingLeft + this._outerPaddingRight;\n\t\t\t\t\tif(footerWidth > newWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewWidth = footerWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this.currentBackgroundSkin !== null &&\n\t\t\t\t\tthis.currentBackgroundSkin.width > newWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this.currentBackgroundSkin.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tif(this._measureViewPort)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this._viewPort.visibleHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewHeight = 0;\n\t\t\t\t}\n\t\t\t\tif(this._icon !== null)\n\t\t\t\t{\n\t\t\t\t\tvar iconHeight:Number = this._icon.height;\n\t\t\t\t\tif(iconHeight === iconHeight && //!isNaN\n\t\t\t\t\t\ticonHeight > newHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewHeight = iconHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnewHeight += this._bottomViewPortOffset + this._topViewPortOffset;\n\t\t\t\t//we don't need to account for the header and footer because\n\t\t\t\t//they're already included in the top and bottom offsets\n\t\t\t\tif(this.currentBackgroundSkin !== null &&\n\t\t\t\t\tthis.currentBackgroundSkin.height > newHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this.currentBackgroundSkin.height;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tif(this._measureViewPort)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = this._viewPort.minVisibleWidth;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = 0;\n\t\t\t\t}\n\t\t\t\t//we don't need to account for the icon and gap because it is\n\t\t\t\t//already included in the left offset\n\t\t\t\tnewMinWidth += this._rightViewPortOffset + this._leftViewPortOffset;\n\t\t\t\tvar headerMinWidth:Number = this.header.minWidth + this._outerPaddingLeft + this._outerPaddingRight;\n\t\t\t\tif(headerMinWidth > newMinWidth)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = headerMinWidth;\n\t\t\t\t}\n\t\t\t\tif(this.footer !== null)\n\t\t\t\t{\n\t\t\t\t\tvar footerMinWidth:Number = this.footer.minWidth + this._outerPaddingLeft + this._outerPaddingRight;\n\t\t\t\t\tif(footerMinWidth > newMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = footerMinWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(measureBackground !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(measureBackground.minWidth > newMinWidth)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinWidth = measureBackground.minWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._explicitBackgroundMinWidth > newMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = this._explicitBackgroundMinWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tif(this._measureViewPort)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = this._viewPort.minVisibleHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = 0;\n\t\t\t\t}\n\t\t\t\tif(this._icon !== null)\n\t\t\t\t{\n\t\t\t\t\ticonHeight = this._icon.height;\n\t\t\t\t\tif(iconHeight === iconHeight && //!isNaN\n\t\t\t\t\t\ticonHeight > newMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = iconHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnewMinHeight += this._bottomViewPortOffset + this._topViewPortOffset;\n\t\t\t\t//we don't need to account for the header and footer because\n\t\t\t\t//they're already included in the top and bottom offsets\n\t\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(measureBackground !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(measureBackground.minHeight > newMinHeight)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinHeight = measureBackground.minHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._explicitBackgroundMinHeight > newMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = this._explicitBackgroundMinHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>header</code> sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #header\n\t\t * @see #headerFactory\n\t\t * @see #style:customHeaderStyleName\n\t\t */\n\t\toverride protected function createHeader():void\n\t\t{\n\t\t\tsuper.createHeader();\n\t\t\tthis.headerHeader = Header(this.header);\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>buttonGroupFooter</code> sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #buttonGroupFooter\n\t\t * @see #buttonGroupFactory\n\t\t * @see #style:customButtonGroupStyleName\n\t\t */\n\t\tprotected function createButtonGroup():void\n\t\t{\n\t\t\tif(this.buttonGroupFooter)\n\t\t\t{\n\t\t\t\tthis.buttonGroupFooter.removeEventListener(Event.TRIGGERED, buttonsFooter_triggeredHandler);\n\t\t\t}\n\t\t\tsuper.createFooter();\n\t\t\tthis.buttonGroupFooter = ButtonGroup(this.footer);\n\t\t\tthis.buttonGroupFooter.addEventListener(Event.TRIGGERED, buttonsFooter_triggeredHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function createFooter():void\n\t\t{\n\t\t\tthis.createButtonGroup();\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>messageTextRenderer</code> sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #message\n\t\t * @see #messageTextRenderer\n\t\t * @see #messageFactory\n\t\t */\n\t\tprotected function createMessage():void\n\t\t{\n\t\t\tif(this.messageTextRenderer)\n\t\t\t{\n\t\t\t\tthis.removeChild(DisplayObject(this.messageTextRenderer), true);\n\t\t\t\tthis.messageTextRenderer = null;\n\t\t\t}\n\n\t\t\tvar factory:Function = this._messageFactory != null ? this._messageFactory : FeathersControl.defaultTextRendererFactory;\n\t\t\tthis.messageTextRenderer = ITextRenderer(factory());\n\t\t\tthis.messageTextRenderer.wordWrap = true;\n\t\t\tvar messageStyleName:String = this._customMessageStyleName != null ? this._customMessageStyleName : this.messageStyleName;\n\t\t\tvar uiTextRenderer:IFeathersControl = IFeathersControl(this.messageTextRenderer);\n\t\t\tuiTextRenderer.styleNameList.add(messageStyleName);\n\t\t\tuiTextRenderer.touchable = false;\n\t\t\tthis.addChild(DisplayObject(this.messageTextRenderer));\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function refreshFooterStyles():void\n\t\t{\n\t\t\tsuper.refreshFooterStyles();\n\t\t\tthis.buttonGroupFooter.dataProvider = this._buttonsDataProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshMessageStyles():void\n\t\t{\n\t\t\tthis.messageTextRenderer.fontStyles = this._fontStylesSet;\n\t\t\tfor(var propertyName:String in this._messageProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._messageProperties[propertyName];\n\t\t\t\tthis.messageTextRenderer[propertyName] = propertyValue;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function calculateViewPortOffsets(forceScrollBars:Boolean = false, useActualBounds:Boolean = false):void\n\t\t{\n\t\t\tsuper.calculateViewPortOffsets(forceScrollBars, useActualBounds);\n\t\t\tif(this._icon !== null)\n\t\t\t{\n\t\t\t\tif(this._icon is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this._icon).validate();\n\t\t\t\t}\n\t\t\t\tvar iconWidth:Number = this._icon.width;\n\t\t\t\tif(iconWidth === iconWidth) //!isNaN\n\t\t\t\t{\n\t\t\t\t\tthis._leftViewPortOffset += iconWidth + this._gap;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function closeAlert(item:Object):void\n\t\t{\n\t\t\tthis.removeFromParent();\n\t\t\tthis.dispatchEventWith(Event.CLOSE, false, item);\n\t\t\tthis.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function buttonsFooter_triggeredHandler(event:Event, data:Object):void\n\t\t{\n\t\t\tthis.closeAlert(data);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function icon_resizeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function fontStyles_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function alert_addedToStageHandler(event:Event):void\n\t\t{\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\t//using priority here is a hack so that objects higher up in the\n\t\t\t//display list have a chance to cancel the event first.\n\t\t\tvar priority:int = -getDisplayObjectDepthFromStage(this);\n\t\t\tstarling.nativeStage.addEventListener(KeyboardEvent.KEY_DOWN, alert_nativeStage_keyDownHandler, false, priority, true);\n\t\t\tthis.addEventListener(Event.REMOVED_FROM_STAGE, alert_removedFromStageHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function alert_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tthis.removeEventListener(Event.REMOVED_FROM_STAGE, alert_removedFromStageHandler);\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tstarling.nativeStage.removeEventListener(KeyboardEvent.KEY_DOWN, alert_nativeStage_keyDownHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function alert_nativeStage_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(event.isDefaultPrevented())\n\t\t\t{\n\t\t\t\t//someone else already handled this one\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._buttonsDataProvider === null)\n\t\t\t{\n\t\t\t\t//no buttons to trigger\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar keyCode:uint = event.keyCode;\n\t\t\tif(this._acceptButtonIndex != -1 && keyCode == Keyboard.ENTER)\n\t\t\t{\n\t\t\t\t//don't let the OS handle the event\n\t\t\t\tevent.preventDefault();\n\t\t\t\tvar item:Object = this._buttonsDataProvider.getItemAt(this._acceptButtonIndex);\n\t\t\t\tthis.closeAlert(item);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._cancelButtonIndex != -1 &&\n\t\t\t\t(keyCode == Keyboard.BACK || keyCode == Keyboard.ESCAPE))\n\t\t\t{\n\t\t\t\t//don't let the OS handle the event\n\t\t\t\tevent.preventDefault();\n\t\t\t\titem = this._buttonsDataProvider.getItemAt(this._cancelButtonIndex);\n\t\t\t\tthis.closeAlert(item);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/AutoComplete.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.controls.popups.DropDownPopUpContentManager;\n\timport feathers.controls.popups.IPopUpContentManager;\n\timport feathers.core.PropertyProxy;\n\timport feathers.data.ArrayCollection;\n\timport feathers.data.IAutoCompleteSource;\n\timport feathers.data.IListCollection;\n\timport feathers.events.FeathersEventType;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.utils.display.getDisplayObjectDepthFromStage;\n\n\timport flash.events.KeyboardEvent;\n\timport flash.ui.Keyboard;\n\timport flash.utils.getTimer;\n\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\timport starling.events.KeyboardEvent;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\t/**\n\t * A style name to add to the list sub-component of the\n\t * <code>AutoComplete</code>. Typically used by a theme to provide\n\t * different styles to different <code>AutoComplete</code> instances.\n\t *\n\t * <p>In the following example, a custom list style name is passed to the\n\t * <code>AutoComplete</code>:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * input.customListStyleName = \"my-custom-list\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to provide\n\t * different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( List ).setFunctionForStyleName( \"my-custom-list\", setCustomListStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_LIST\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #listFactory\n\t */\n\t[Style(name=\"customListStyleName\",type=\"String\")]\n\n\t/**\n\t * A manager that handles the details of how to display the pop-up list.\n\t *\n\t * <p>In the following example, a pop-up content manager is provided:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * input.popUpContentManager = new CalloutPopUpContentManager();</listing>\n\t *\n\t * @default null\n\t */\n\t[Style(name=\"popUpContentManager\",type=\"feathers.controls.popups.IPopUpContentManager\")]\n\n\t/**\n\t * Dispatched when the pop-up list is opened.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.OPEN\n\t */\n\t[Event(name=\"open\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the pop-up list is closed.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CLOSE\n\t */\n\t[Event(name=\"close\",type=\"starling.events.Event\")]\n\n\t/**\n\t * A text input that provides a pop-up list with suggestions as you type.\n\t *\n\t * <p>The following example creates an <code>AutoComplete</code> with a\n\t * local collection of suggestions:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var input:AutoComplete = new AutoComplete();\n\t * input.source = new LocalAutoCompleteSource( new VectorCollection(new &lt;String&gt;\n\t * [\n\t *     \"Apple\",\n\t *     \"Banana\",\n\t *     \"Cherry\",\n\t *     \"Grape\",\n\t *     \"Lemon\",\n\t *     \"Orange\",\n\t *     \"Watermelon\"\n\t * ]));\n\t * this.addChild( input );</listing>\n\t *\n\t * @see ../../../help/auto-complete.html How to use the Feathers AutoComplete component\n\t * @see feathers.controls.TextInput\n\t *\n\t * @productversion Feathers 2.1.0\n\t */\n\tpublic class AutoComplete extends TextInput\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_LIST_FACTORY:String = \"listFactory\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the pop-up\n\t\t * list.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_LIST:String = \"feathers-auto-complete-list\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all\n\t\t * <code>AutoComplete</code> components. If <code>null</code>, falls\n\t\t * back to using <code>TextInput.globalStyleProvider</code> instead.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultListFactory():List\n\t\t{\n\t\t\treturn new List();\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function AutoComplete()\n\t\t{\n\t\t\tthis.addEventListener(Event.CHANGE, autoComplete_changeHandler);\n\t\t}\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the\n\t\t * pop-up list. This variable is <code>protected</code> so that\n\t\t * sub-classes can customize the list style name in their constructors\n\t\t * instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_LIST</code>.\n\t\t *\n\t\t * <p>To customize the pop-up list name without subclassing, see\n\t\t * <code>customListStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customListStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var listStyleName:String = DEFAULT_CHILD_STYLE_NAME_LIST;\n\n\t\t/**\n\t\t * The list sub-component.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t *\n\t\t * @see #listFactory\n\t\t * @see #createList()\n\t\t */\n\t\tprotected var list:List;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _listCollection:IListCollection;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\tif(AutoComplete.globalStyleProvider)\n\t\t\t{\n\t\t\t\treturn AutoComplete.globalStyleProvider;\n\t\t\t}\n\t\t\treturn TextInput.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _originalText:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _source:IAutoCompleteSource;\n\n\t\t/**\n\t\t * The source of the suggestions that appear in the pop-up list.\n\t\t *\n\t\t * <p>In the following example, a source of suggestions is provided:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * input.source = new LocalAutoCompleteSource( new VectorCollection(new &lt;String&gt;\n\t\t * [\n\t\t *     \"Apple\",\n\t\t *     \"Banana\",\n\t\t *     \"Cherry\",\n\t\t *     \"Grape\",\n\t\t *     \"Lemon\",\n\t\t *     \"Orange\",\n\t\t *     \"Watermelon\"\n\t\t * ]));</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get source():IAutoCompleteSource\n\t\t{\n\t\t\treturn this._source;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set source(value:IAutoCompleteSource):void\n\t\t{\n\t\t\tif(this._source == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._source)\n\t\t\t{\n\t\t\t\tthis._source.removeEventListener(Event.COMPLETE, dataProvider_completeHandler);\n\t\t\t}\n\t\t\tthis._source = value;\n\t\t\tif(this._source)\n\t\t\t{\n\t\t\t\tthis._source.addEventListener(Event.COMPLETE, dataProvider_completeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _autoCompleteDelay:Number = 0.5;\n\n\t\t/**\n\t\t * The time, in seconds, after the text has changed before requesting\n\t\t * suggestions from the <code>IAutoCompleteSource</code>.\n\t\t *\n\t\t * <p>In the following example, the delay is changed to 1.5 seconds:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * input.autoCompleteDelay = 1.5;</listing>\n\t\t *\n\t\t * @default 0.5\n\t\t *\n\t\t * @see #source\n\t\t */\n\t\tpublic function get autoCompleteDelay():Number\n\t\t{\n\t\t\treturn this._autoCompleteDelay;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set autoCompleteDelay(value:Number):void\n\t\t{\n\t\t\tthis._autoCompleteDelay = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimumAutoCompleteLength:int = 2;\n\n\t\t/**\n\t\t * The minimum number of entered characters required to request\n\t\t * suggestions from the <code>IAutoCompleteSource</code>.\n\t\t *\n\t\t * <p>In the following example, the minimum number of characters is\n\t\t * changed to <code>3</code>:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * input.minimumAutoCompleteLength = 3;</listing>\n\t\t *\n\t\t * @default 2\n\t\t *\n\t\t * @see #source\n\t\t */\n\t\tpublic function get minimumAutoCompleteLength():int\n\t\t{\n\t\t\treturn this._minimumAutoCompleteLength;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minimumAutoCompleteLength(value:int):void\n\t\t{\n\t\t\tthis._minimumAutoCompleteLength = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _popUpContentManager:IPopUpContentManager;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get popUpContentManager():IPopUpContentManager\n\t\t{\n\t\t\treturn this._popUpContentManager;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set popUpContentManager(value:IPopUpContentManager):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._popUpContentManager === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._popUpContentManager is EventDispatcher)\n\t\t\t{\n\t\t\t\tvar dispatcher:EventDispatcher = EventDispatcher(this._popUpContentManager);\n\t\t\t\tdispatcher.removeEventListener(Event.OPEN, popUpContentManager_openHandler);\n\t\t\t\tdispatcher.removeEventListener(Event.CLOSE, popUpContentManager_closeHandler);\n\t\t\t}\n\t\t\tthis._popUpContentManager = value;\n\t\t\tif(this._popUpContentManager is EventDispatcher)\n\t\t\t{\n\t\t\t\tdispatcher = EventDispatcher(this._popUpContentManager);\n\t\t\t\tdispatcher.addEventListener(Event.OPEN, popUpContentManager_openHandler);\n\t\t\t\tdispatcher.addEventListener(Event.CLOSE, popUpContentManager_closeHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _listFactory:Function;\n\n\t\t/**\n\t\t * A function used to generate the pop-up list sub-component. The list\n\t\t * must be an instance of <code>List</code>. This factory can be used to\n\t\t * change properties on the list when it is first created. For instance,\n\t\t * if you are skinning Feathers components without a theme, you might\n\t\t * use this factory to set skins and other styles on the list.\n\t\t *\n\t\t * <p>The function should have the following signature:</p>\n\t\t * <pre>function():List</pre>\n\t\t *\n\t\t * <p>In the following example, a custom list factory is passed to the\n\t\t * <code>AutoComplete</code>:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * input.listFactory = function():List\n\t\t * {\n\t\t *     var popUpList:List = new List();\n\t\t *     popUpList.backgroundSkin = new Image( texture );\n\t\t *     return popUpList;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.List\n\t\t */\n\t\tpublic function get listFactory():Function\n\t\t{\n\t\t\treturn this._listFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set listFactory(value:Function):void\n\t\t{\n\t\t\tif(this._listFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._listFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LIST_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customListStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customListStyleName():String\n\t\t{\n\t\t\treturn this._customListStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customListStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customListStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customListStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LIST_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _listProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the auto-complete's pop-up list\n\t\t * sub-component, and the properties will be passed down to the pop-up\n\t\t * list when the auto-complete validates. For a list of available\n\t\t * properties, refer to\n\t\t * <a href=\"List.html\"><code>feathers.controls.List</code></a>.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>listFactory</code> function\n\t\t * instead of using <code>listProperties</code> will result in better\n\t\t * performance.</p>\n\t\t *\n\t\t * <p>In the following example, the list properties are passed to the\n\t\t * auto complete:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * input.listProperties.backgroundSkin = new Image( texture );</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #listFactory\n\t\t * @see feathers.controls.List\n\t\t */\n\t\tpublic function get listProperties():Object\n\t\t{\n\t\t\tif(!this._listProperties)\n\t\t\t{\n\t\t\t\tthis._listProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._listProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set listProperties(value:Object):void\n\t\t{\n\t\t\tif(this._listProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._listProperties)\n\t\t\t{\n\t\t\t\tthis._listProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._listProperties = PropertyProxy(value);\n\t\t\tif(this._listProperties)\n\t\t\t{\n\t\t\t\tthis._listProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _ignoreAutoCompleteChanges:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastChangeTime:int = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _listHasFocus:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _listTouchPointID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _triggered:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isOpenListPending:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isCloseListPending:Boolean = false;\n\n\t\t/**\n\t\t * Opens the pop-up list, if it isn't already open.\n\t\t */\n\t\tpublic function openList():void\n\t\t{\n\t\t\tthis._isCloseListPending = false;\n\t\t\tif(this._popUpContentManager.isOpen)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!this._isValidating && this.isInvalid())\n\t\t\t{\n\t\t\t\tthis._isOpenListPending = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isOpenListPending = false;\n\t\t\tthis._popUpContentManager.open(this.list, this);\n\t\t\tthis.list.validate();\n\t\t\tif(this._focusManager)\n\t\t\t{\n\t\t\t\tthis.stage.addEventListener(starling.events.KeyboardEvent.KEY_UP, stage_keyUpHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Closes the pop-up list, if it is open.\n\t\t */\n\t\tpublic function closeList():void\n\t\t{\n\t\t\tthis._isOpenListPending = false;\n\t\t\tif(!this._popUpContentManager.isOpen)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!this._isValidating && this.isInvalid())\n\t\t\t{\n\t\t\t\tthis._isCloseListPending = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._listHasFocus)\n\t\t\t{\n\t\t\t\tthis.list.dispatchEventWith(FeathersEventType.FOCUS_OUT);\n\t\t\t}\n\t\t\tthis._isCloseListPending = false;\n\t\t\tthis.list.validate();\n\t\t\t//don't clean up anything from openList() in closeList(). The list\n\t\t\t//may be closed by removing it from the PopUpManager, which would\n\t\t\t//result in closeList() never being called.\n\t\t\t//instead, clean up in the Event.REMOVED_FROM_STAGE listener.\n\t\t\tthis._popUpContentManager.close();\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tthis.source = null;\n\t\t\tif(this.list)\n\t\t\t{\n\t\t\t\tthis.closeList();\n\t\t\t\tthis.list.dispose();\n\t\t\t\tthis.list = null;\n\t\t\t}\n\t\t\tif(this._popUpContentManager)\n\t\t\t{\n\t\t\t\tthis._popUpContentManager.dispose();\n\t\t\t\tthis._popUpContentManager = null;\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tsuper.initialize();\n\n\t\t\tthis._listCollection = new ArrayCollection();\n\t\t\tif(this._popUpContentManager === null)\n\t\t\t{\n\t\t\t\tthis.ignoreNextStyleRestriction();\n\t\t\t\tthis.popUpContentManager = new DropDownPopUpContentManager();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar listFactoryInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_LIST_FACTORY);\n\n\t\t\tsuper.draw();\n\n\t\t\tif(listFactoryInvalid)\n\t\t\t{\n\t\t\t\tthis.createList();\n\t\t\t}\n\n\t\t\tif(listFactoryInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshListProperties();\n\t\t\t}\n\n\t\t\tthis.handlePendingActions();\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>list</code> sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #list\n\t\t * @see #listFactory\n\t\t * @see #style:customListStyleName\n\t\t */\n\t\tprotected function createList():void\n\t\t{\n\t\t\tif(this.list)\n\t\t\t{\n\t\t\t\tthis.list.removeFromParent(false);\n\t\t\t\t//disposing separately because the list may not have a parent\n\t\t\t\tthis.list.dispose();\n\t\t\t\tthis.list = null;\n\t\t\t}\n\n\t\t\tvar factory:Function = this._listFactory != null ? this._listFactory : defaultListFactory;\n\t\t\tvar listStyleName:String = this._customListStyleName != null ? this._customListStyleName : this.listStyleName;\n\t\t\tthis.list = List(factory());\n\t\t\tthis.list.focusOwner = this;\n\t\t\tthis.list.isFocusEnabled = false;\n\t\t\tthis.list.isChildFocusEnabled = false;\n\t\t\tthis.list.styleNameList.add(listStyleName);\n\t\t\tthis.list.addEventListener(Event.CHANGE, list_changeHandler);\n\t\t\tthis.list.addEventListener(Event.TRIGGERED, list_triggeredHandler);\n\t\t\tthis.list.addEventListener(TouchEvent.TOUCH, list_touchHandler);\n\t\t\tthis.list.addEventListener(Event.REMOVED_FROM_STAGE, list_removedFromStageHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshListProperties():void\n\t\t{\n\t\t\tfor(var propertyName:String in this._listProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._listProperties[propertyName];\n\t\t\t\tthis.list[propertyName] = propertyValue;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function handlePendingActions():void\n\t\t{\n\t\t\tif(this._isOpenListPending)\n\t\t\t{\n\t\t\t\tthis.openList();\n\t\t\t}\n\t\t\tif(this._isCloseListPending)\n\t\t\t{\n\t\t\t\tthis.closeList();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function focusInHandler(event:Event):void\n\t\t{\n\t\t\t//using priority here is a hack so that objects deeper in the\n\t\t\t//display list have a chance to cancel the event first.\n\t\t\tvar priority:int = -getDisplayObjectDepthFromStage(this);\n\t\t\tthis.stage.starling.nativeStage.addEventListener(flash.events.KeyboardEvent.KEY_DOWN, nativeStage_keyDownHandler, false, priority, true);\n\t\t\tsuper.focusInHandler(event);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function focusOutHandler(event:Event):void\n\t\t{\n\t\t\tthis.stage.starling.nativeStage.removeEventListener(flash.events.KeyboardEvent.KEY_DOWN, nativeStage_keyDownHandler);\n\t\t\tsuper.focusOutHandler(event);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function nativeStage_keyDownHandler(event:flash.events.KeyboardEvent):void\n\t\t{\n\t\t\tif(!this._popUpContentManager.isOpen)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(event.isDefaultPrevented())\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar isDown:Boolean = event.keyCode == Keyboard.DOWN;\n\t\t\tvar isUp:Boolean = event.keyCode == Keyboard.UP;\n\t\t\tif(!isDown && !isUp)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar oldSelectedIndex:int = this.list.selectedIndex;\n\t\t\tvar lastIndex:int = this.list.dataProvider.length - 1;\n\t\t\tif(oldSelectedIndex < 0)\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis._originalText = this._text;\n\t\t\t\tif(isDown)\n\t\t\t\t{\n\t\t\t\t\tthis.list.selectedIndex = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.list.selectedIndex = lastIndex;\n\t\t\t\t}\n\t\t\t\tthis.list.scrollToDisplayIndex(this.list.selectedIndex, this.list.keyScrollDuration);\n\t\t\t\tthis._listHasFocus = true;\n\t\t\t\tthis.list.dispatchEventWith(FeathersEventType.FOCUS_IN);\n\t\t\t}\n\t\t\telse if((isDown && oldSelectedIndex == lastIndex) ||\n\t\t\t\t(isUp && oldSelectedIndex == 0))\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tvar oldIgnoreAutoCompleteChanges:Boolean = this._ignoreAutoCompleteChanges;\n\t\t\t\tthis._ignoreAutoCompleteChanges = true;\n\t\t\t\tthis.text = this._originalText;\n\t\t\t\tthis._ignoreAutoCompleteChanges = oldIgnoreAutoCompleteChanges;\n\t\t\t\tthis.list.selectedIndex = -1;\n\t\t\t\tthis.selectRange(this.text.length, this.text.length);\n\t\t\t\tthis._listHasFocus = false;\n\t\t\t\tthis.list.dispatchEventWith(FeathersEventType.FOCUS_OUT);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function autoComplete_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreAutoCompleteChanges || !this._source || !this.hasFocus)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this.text.length < this._minimumAutoCompleteLength)\n\t\t\t{\n\t\t\t\tthis.removeEventListener(Event.ENTER_FRAME, autoComplete_enterFrameHandler);\n\t\t\t\tthis.closeList();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this._autoCompleteDelay == 0)\n\t\t\t{\n\t\t\t\t//just in case the enter frame listener was added before\n\t\t\t\t//sourceUpdateDelay was set to 0.\n\t\t\t\tthis.removeEventListener(Event.ENTER_FRAME, autoComplete_enterFrameHandler);\n\n\t\t\t\tthis._source.load(this.text, this._listCollection);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._lastChangeTime = getTimer();\n\t\t\t\tthis.addEventListener(Event.ENTER_FRAME, autoComplete_enterFrameHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function autoComplete_enterFrameHandler():void\n\t\t{\n\t\t\tvar currentTime:int = getTimer();\n\t\t\tvar secondsSinceLastUpdate:Number = (currentTime - this._lastChangeTime) / 1000;\n\t\t\tif(secondsSinceLastUpdate < this._autoCompleteDelay)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.removeEventListener(Event.ENTER_FRAME, autoComplete_enterFrameHandler);\n\t\t\tthis._source.load(this.text, this._listCollection);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_completeHandler(event:Event, data:IListCollection):void\n\t\t{\n\t\t\tthis.list.dataProvider = data;\n\t\t\tif(data.length == 0)\n\t\t\t{\n\t\t\t\tif(this._popUpContentManager.isOpen)\n\t\t\t\t{\n\t\t\t\t\tthis.closeList();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.openList();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function list_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(!this.list.selectedItem)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar oldIgnoreAutoCompleteChanges:Boolean = this._ignoreAutoCompleteChanges;\n\t\t\tthis._ignoreAutoCompleteChanges = true;\n\t\t\tthis.text = this.list.selectedItem.toString();\n\t\t\tthis.selectRange(this.text.length, this.text.length);\n\t\t\tthis._ignoreAutoCompleteChanges = oldIgnoreAutoCompleteChanges;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function popUpContentManager_openHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.OPEN);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function popUpContentManager_closeHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.CLOSE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function list_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tif(this._focusManager)\n\t\t\t{\n\t\t\t\tthis.list.stage.removeEventListener(starling.events.KeyboardEvent.KEY_UP, stage_keyUpHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function list_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._listTouchPointID == -1)\n\t\t\t{\n\t\t\t\t//triggered by keyboard\n\t\t\t\tthis.closeList();\n\t\t\t\tthis.selectRange(this.text.length, this.text.length);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._triggered = true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function list_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tvar touch:Touch = event.getTouch(this.list);\n\t\t\tif(touch === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(touch.phase === TouchPhase.BEGAN)\n\t\t\t{\n\t\t\t\tthis._listTouchPointID = touch.id;\n\t\t\t\tthis._triggered = false;\n\t\t\t}\n\t\t\tif(touch.phase === TouchPhase.ENDED && this._triggered)\n\t\t\t{\n\t\t\t\tthis._listTouchPointID = -1;\n\t\t\t\tthis.closeList();\n\t\t\t\tthis.selectRange(this.text.length, this.text.length);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_keyUpHandler(event:starling.events.KeyboardEvent):void\n\t\t{\n\t\t\tif(!this._popUpContentManager.isOpen)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(event.keyCode == Keyboard.ENTER)\n\t\t\t{\n\t\t\t\tthis.closeList();\n\t\t\t\tthis.selectRange(this.text.length, this.text.length);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/AutoSizeMode.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\t/**\n\t * Constants that determine how a component should automatically calculate\n\t * its own dimensions when no explicit dimensions are provided.\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class AutoSizeMode\n\t{\n\t\t/**\n\t\t * The component will automatically calculate its dimensions to fill the\n\t\t * entire stage.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const STAGE:String = \"stage\";\n\n\t\t/**\n\t\t * The component will automatically calculate its dimensions to fit its\n\t\t * content's ideal dimensions.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const CONTENT:String = \"content\";\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/BasicButton.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IMeasureDisplayObject;\n\timport feathers.core.IStateContext;\n\timport feathers.core.IStateObserver;\n\timport feathers.core.IValidating;\n\timport feathers.events.FeathersEventType;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.utils.skins.resetFluidChildDimensionsForMeasurement;\n\timport feathers.utils.touch.TapToTrigger;\n\timport feathers.utils.touch.TouchToState;\n\n\timport flash.geom.Point;\n\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * The skin used when no other skin is defined for the current state.\n\t * Intended to be used when multiple states should share the same skin.\n\t *\n\t * <p>The following example gives the button a default skin to use for\n\t * all states when no specific skin is available:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.defaultSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #setSkinForState()\n\t */\n\t[Style(name=\"defaultSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The skin used for the button's disabled state. If <code>null</code>,\n\t * then <code>defaultSkin</code> is used instead.\n\t *\n\t * <p>This property will be ignored if a function is passed to the\n\t * <code>stateToSkinFunction</code> property.</p>\n\t *\n\t * <p>The following example gives the button a skin for the disabled state:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.disabledSkin = new Image( texture );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setSkinForState()</code> with\n\t * <code>ButtonState.DISABLED</code> to set the same skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var skin:Image = new Image( texture );\n\t * button.setSkinForState( ButtonState.DISABLED, skin );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:defaultSkin\n\t * @see #setSkinForState()\n\t * @see feathers.controls.ButtonState#DISABLED\n\t */\n\t[Style(name=\"disabledSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The skin used for the button's down state. If <code>null</code>, then\n\t * <code>defaultSkin</code> is used instead.\n\t *\n\t * <p>This property will be ignored if a function is passed to the\n\t * <code>stateToSkinFunction</code> property.</p>\n\t *\n\t * <p>The following example gives the button a skin for the down state:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.downSkin = new Image( texture );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setSkinForState()</code> with\n\t * <code>ButtonState.DOWN</code> to set the same skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var skin:Image = new Image( texture );\n\t * button.setSkinForState( ButtonState.DOWN, skin );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:defaultSkin\n\t * @see #setSkinForState()\n\t * @see feathers.controls.ButtonState#DOWN\n\t */\n\t[Style(name=\"downSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The skin used for the button's hover state. If <code>null</code>, then\n\t * <code>defaultSkin</code> is used instead.\n\t *\n\t * <p>This property will be ignored if a function is passed to the\n\t * <code>stateToSkinFunction</code> property.</p>\n\t *\n\t * <p>The following example gives the button a skin for the hover state:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.hoverSkin = new Image( texture );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setSkinForState()</code> with\n\t * <code>ButtonState.HOVER</code> to set the same skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var skin:Image = new Image( texture );\n\t * button.setSkinForState( ButtonState.HOVER, skin );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:defaultSkin\n\t * @see #setSkinForState()\n\t * @see feathers.controls.ButtonState#HOVER\n\t */\n\t[Style(name=\"hoverSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * Determines if a pressed button should remain in the down state if a\n\t * touch moves outside of the button's bounds. Useful for controls like\n\t * <code>Slider</code> and <code>ToggleSwitch</code> to keep a thumb in\n\t * the down state while it is dragged around.\n\t *\n\t * <p>The following example ensures that the button's down state remains\n\t * active when the button is pressed but the touch moves outside the\n\t * button's bounds:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.keepDownStateOnRollOut = true;</listing>\n\t *\n\t * @default false\n\t */\n\t[Style(name=\"keepDownStateOnRollOut\",type=\"Boolean\")]\n\n\t/**\n\t * The skin used for the button's up state. If <code>null</code>, then\n\t * <code>defaultSkin</code> is used instead.\n\t *\n\t * <p>This property will be ignored if a function is passed to the\n\t * <code>stateToSkinFunction</code> property.</p>\n\t *\n\t * <p>The following example gives the button a skin for the up state:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.upSkin = new Image( texture );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setSkinForState()</code> with\n\t * <code>ButtonState.UP</code> to set the same skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var skin:Image = new Image( texture );\n\t * button.setSkinForState( ButtonState.UP, skin );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:defaultSkin\n\t * @see #setSkinForState()\n\t * @see feathers.controls.ButtonState#UP\n\t */\n\t[Style(name=\"upSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * Dispatched when the the user taps or clicks the button. The touch must\n\t * remain within the bounds of the button on release to register as a tap\n\t * or a click. If focus management is enabled, the button may also be\n\t * triggered by pressing the spacebar while the button has focus.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.TRIGGERED\n\t */\n\t[Event(name=\"triggered\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the display object's state changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.STATE_CHANGE\n\t *\n\t * @see #currentState\n\t */\n\t[Event(name=\"stateChange\",type=\"starling.events.Event\")]\n\n\t/**\n\t * A simple button control with states, but no content, that is useful for\n\t * purposes like skinning. For a more full-featured button, with a label and\n\t * icon, see <code>feathers.controls.Button</code> instead.\n\t *\n\t * @see feathers.controls.Button\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class BasicButton extends FeathersControl implements IStateContext\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const HELPER_POINT:Point = new Point();\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>BasicButton</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function BasicButton()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.isQuickHitAreaEnabled = true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn BasicButton.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var touchToState:TouchToState;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var tapToTrigger:TapToTrigger;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentState:String = ButtonState.UP;\n\n\t\t/**\n\t\t * The current state of the button.\n\t\t *\n\t\t * @see feathers.controls.ButtonState\n\t\t * @see #event:stateChange feathers.events.FeathersEventType.STATE_CHANGE\n\t\t */\n\t\tpublic function get currentState():String\n\t\t{\n\t\t\treturn this._currentState;\n\t\t}\n\n\t\t/**\n\t\t * The currently visible skin. The value will be <code>null</code> if\n\t\t * there is no currently visible skin.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t */\n\t\tprotected var currentSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set isEnabled(value:Boolean):void\n\t\t{\n\t\t\tif(this._isEnabled === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsuper.isEnabled = value;\n\t\t\tif(this._isEnabled)\n\t\t\t{\n\t\t\t\t//might be in another state for some reason\n\t\t\t\t//let's only change to up if needed\n\t\t\t\tif(this._currentState === ButtonState.DISABLED)\n\t\t\t\t{\n\t\t\t\t\tthis.changeState(ButtonState.UP);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.changeState(ButtonState.DISABLED);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _keepDownStateOnRollOut:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get keepDownStateOnRollOut():Boolean\n\t\t{\n\t\t\treturn this._keepDownStateOnRollOut;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set keepDownStateOnRollOut(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._keepDownStateOnRollOut = value;\n\t\t\tif(this.touchToState !== null)\n\t\t\t{\n\t\t\t\tthis.touchToState.keepDownStateOnRollOut = value;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _defaultSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get defaultSkin():DisplayObject\n\t\t{\n\t\t\treturn this._defaultSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set defaultSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._defaultSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._defaultSkin !== null &&\n\t\t\t\tthis.currentSkin === this._defaultSkin)\n\t\t\t{\n\t\t\t\t//if this skin needs to be reused somewhere else, we need to\n\t\t\t\t//properly clean it up\n\t\t\t\tthis.removeCurrentSkin(this._defaultSkin);\n\t\t\t\tthis.currentSkin = null;\n\t\t\t}\n\t\t\tthis._defaultSkin = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get upSkin():DisplayObject\n\t\t{\n\t\t\treturn this.getSkinForState(ButtonState.UP);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set upSkin(value:DisplayObject):void\n\t\t{\n\t\t\tthis.setSkinForState(ButtonState.UP, value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get downSkin():DisplayObject\n\t\t{\n\t\t\treturn this.getSkinForState(ButtonState.DOWN);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set downSkin(value:DisplayObject):void\n\t\t{\n\t\t\tthis.setSkinForState(ButtonState.DOWN, value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get hoverSkin():DisplayObject\n\t\t{\n\t\t\treturn this.getSkinForState(ButtonState.HOVER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set hoverSkin(value:DisplayObject):void\n\t\t{\n\t\t\tthis.setSkinForState(ButtonState.HOVER, value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get disabledSkin():DisplayObject\n\t\t{\n\t\t\treturn this.getSkinForState(ButtonState.DISABLED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disabledSkin(value:DisplayObject):void\n\t\t{\n\t\t\tthis.setSkinForState(ButtonState.DISABLED, value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * Chooses an appropriate skin based on the state and the selection.\n\t\t */\n\t\tprotected var _stateToSkin:Object = {};\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitSkinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitSkinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitSkinMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitSkinMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitSkinMaxWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitSkinMaxHeight:Number;\n\n\t\t/**\n\t\t * Gets the skin to be used by the button when its\n\t\t * <code>currentState</code> property matches the specified state value.\n\t\t *\n\t\t * <p>If a skin is not defined for a specific state, returns\n\t\t * <code>null</code>.</p>\n\t\t *\n\t\t * @see #setSkinForState()\n\t\t */\n\t\tpublic function getSkinForState(state:String):DisplayObject\n\t\t{\n\t\t\treturn this._stateToSkin[state] as DisplayObject;\n\t\t}\n\n\t\t/**\n\t\t * Sets the skin to be used by the button when its\n\t\t * <code>currentState</code> property matches the specified state value.\n\t\t *\n\t\t * <p>If a skin is not defined for a specific state, the value of the\n\t\t * <code>defaultSkin</code> property will be used instead.</p>\n\t\t *\n\t\t * @see #style:defaultSkin\n\t\t * @see #getSkinForState()\n\t\t * @see feathers.controls.ButtonState\n\t\t */\n\t\tpublic function setSkinForState(state:String, skin:DisplayObject):void\n\t\t{\n\t\t\tvar key:String = \"setSkinForState--\" + state;\n\t\t\tif(this.processStyleRestriction(key))\n\t\t\t{\n\t\t\t\tif(skin !== null)\n\t\t\t\t{\n\t\t\t\t\tskin.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar oldSkin:DisplayObject = this._stateToSkin[state] as DisplayObject;\n\t\t\tif(oldSkin !== null &&\n\t\t\t\tthis.currentSkin === oldSkin)\n\t\t\t{\n\t\t\t\t//if this skin needs to be reused somewhere else, we need to\n\t\t\t\t//properly clean it up\n\t\t\t\tthis.removeCurrentSkin(oldSkin);\n\t\t\t\tthis.currentSkin = null;\n\t\t\t}\n\t\t\tif(skin !== null)\n\t\t\t{\n\t\t\t\tthis._stateToSkin[state] = skin;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdelete this._stateToSkin[state];\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//we don't dispose it if the button is the parent because it'll\n\t\t\t//already get disposed in super.dispose()\n\t\t\tif(this._defaultSkin !== null && this._defaultSkin.parent !== this)\n\t\t\t{\n\t\t\t\tthis._defaultSkin.dispose();\n\t\t\t}\n\t\t\tfor(var state:String in this._stateToSkin)\n\t\t\t{\n\t\t\t\tvar skin:DisplayObject = this._stateToSkin[state] as DisplayObject;\n\t\t\t\tif(skin !== null && skin.parent !== this)\n\t\t\t\t{\n\t\t\t\t\tskin.dispose();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this.touchToState !== null)\n\t\t\t{\n\t\t\t\t//setting the target to null will remove listeners and do any\n\t\t\t\t//other clean up that is needed\n\t\t\t\tthis.touchToState.target = null;\n\t\t\t}\n\t\t\tif(this.tapToTrigger !== null)\n\t\t\t{\n\t\t\t\tthis.tapToTrigger.target = null;\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tsuper.initialize();\n\t\t\tif(!this.touchToState)\n\t\t\t{\n\t\t\t\tthis.touchToState = new TouchToState(this, this.changeState);\n\t\t\t}\n\t\t\tthis.touchToState.keepDownStateOnRollOut = this._keepDownStateOnRollOut;\n\t\t\tif(!this.tapToTrigger)\n\t\t\t{\n\t\t\t\tthis.tapToTrigger = new TapToTrigger(this);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\n\t\t\tif(stylesInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshTriggeredEvents();\n\t\t\t\tthis.refreshSkin();\n\t\t\t}\n\n\t\t\tthis.autoSizeIfNeeded();\n\t\t\tthis.scaleSkin();\n\t\t}\n\n\t\t/**\n\t\t * If the component's dimensions have not been set explicitly, it will\n\t\t * measure its content and determine an ideal size for itself. If the\n\t\t * <code>explicitWidth</code> or <code>explicitHeight</code> member\n\t\t * variables are set, those value will be used without additional\n\t\t * measurement. If one is set, but not the other, the dimension with the\n\t\t * explicit value will not be measured, but the other non-explicit\n\t\t * dimension will still need measurement.\n\t\t *\n\t\t * <p>Calls <code>saveMeasurements()</code> to set up the\n\t\t * <code>actualWidth</code> and <code>actualHeight</code> member\n\t\t * variables used for layout.</p>\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t */\n\t\tprotected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tresetFluidChildDimensionsForMeasurement(this.currentSkin,\n\t\t\t\tthis._explicitWidth, this._explicitHeight,\n\t\t\t\tthis._explicitMinWidth, this._explicitMinHeight,\n\t\t\t\tthis._explicitMaxWidth, this._explicitMaxHeight,\n\t\t\t\tthis._explicitSkinWidth, this._explicitSkinHeight,\n\t\t\t\tthis._explicitSkinMinWidth, this._explicitSkinMinHeight,\n\t\t\t\tthis._explicitSkinMaxWidth, this._explicitSkinMaxHeight);\n\t\t\tvar measureSkin:IMeasureDisplayObject = this.currentSkin as IMeasureDisplayObject;\n\n\t\t\tif(this.currentSkin is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.currentSkin).validate();\n\t\t\t}\n\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tif(measureSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = measureSkin.minWidth;\n\t\t\t\t}\n\t\t\t\telse if(this.currentSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = this._explicitSkinMinWidth;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tif(measureSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = measureSkin.minHeight;\n\t\t\t\t}\n\t\t\t\telse if(this.currentSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = this._explicitSkinMinHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tif(this.currentSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this.currentSkin.width;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewWidth = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tif(this.currentSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this.currentSkin.height;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewHeight = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * Sets the <code>currentSkin</code> property.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t */\n\t\tprotected function refreshSkin():void\n\t\t{\n\t\t\tvar oldSkin:DisplayObject = this.currentSkin;\n\t\t\tthis.currentSkin = this.getCurrentSkin();\n\t\t\tif(this.currentSkin !== oldSkin)\n\t\t\t{\n\t\t\t\tthis.removeCurrentSkin(oldSkin);\n\t\t\t\tif(this.currentSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(this.currentSkin is IFeathersControl)\n\t\t\t\t\t{\n\t\t\t\t\t\tIFeathersControl(this.currentSkin).initializeNow();\n\t\t\t\t\t}\n\t\t\t\t\tif(this.currentSkin is IMeasureDisplayObject)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar measureSkin:IMeasureDisplayObject = IMeasureDisplayObject(this.currentSkin);\n\t\t\t\t\t\tthis._explicitSkinWidth = measureSkin.explicitWidth;\n\t\t\t\t\t\tthis._explicitSkinHeight = measureSkin.explicitHeight;\n\t\t\t\t\t\tthis._explicitSkinMinWidth = measureSkin.explicitMinWidth;\n\t\t\t\t\t\tthis._explicitSkinMinHeight = measureSkin.explicitMinHeight;\n\t\t\t\t\t\tthis._explicitSkinMaxWidth = measureSkin.explicitMaxWidth;\n\t\t\t\t\t\tthis._explicitSkinMaxHeight = measureSkin.explicitMaxHeight;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._explicitSkinWidth = this.currentSkin.width;\n\t\t\t\t\t\tthis._explicitSkinHeight = this.currentSkin.height;\n\t\t\t\t\t\tthis._explicitSkinMinWidth = this._explicitSkinWidth;\n\t\t\t\t\t\tthis._explicitSkinMinHeight = this._explicitSkinHeight;\n\t\t\t\t\t\tthis._explicitSkinMaxWidth = this._explicitSkinWidth;\n\t\t\t\t\t\tthis._explicitSkinMaxHeight = this._explicitSkinHeight;\n\t\t\t\t\t}\n\t\t\t\t\tif(this.currentSkin is IStateObserver)\n\t\t\t\t\t{\n\t\t\t\t\t\tIStateObserver(this.currentSkin).stateContext = this;\n\t\t\t\t\t}\n\t\t\t\t\tthis.addChildAt(this.currentSkin, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getCurrentSkin():DisplayObject\n\t\t{\n\t\t\tvar result:DisplayObject = this._stateToSkin[this._currentState] as DisplayObject;\n\t\t\tif(result !== null)\n\t\t\t{\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\treturn this._defaultSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function scaleSkin():void\n\t\t{\n\t\t\tif(!this.currentSkin)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.currentSkin.x = 0;\n\t\t\tthis.currentSkin.y = 0;\n\t\t\tif(this.currentSkin.width != this.actualWidth)\n\t\t\t{\n\t\t\t\tthis.currentSkin.width = this.actualWidth;\n\t\t\t}\n\t\t\tif(this.currentSkin.height != this.actualHeight)\n\t\t\t{\n\t\t\t\tthis.currentSkin.height = this.actualHeight;\n\t\t\t}\n\t\t\tif(this.currentSkin is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.currentSkin).validate();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function removeCurrentSkin(skin:DisplayObject):void\n\t\t{\n\t\t\tif(skin === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(skin is IStateObserver)\n\t\t\t{\n\t\t\t\tIStateObserver(skin).stateContext = null;\n\t\t\t}\n\t\t\tif(skin.parent === this)\n\t\t\t{\n\t\t\t\t//we need to restore these values so that they won't be lost the\n\t\t\t\t//next time that this skin is used for measurement\n\t\t\t\tskin.width = this._explicitSkinWidth;\n\t\t\t\tskin.height = this._explicitSkinHeight;\n\t\t\t\tif(skin is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar measureSkin:IMeasureDisplayObject = IMeasureDisplayObject(skin);\n\t\t\t\t\tmeasureSkin.minWidth = this._explicitSkinMinWidth;\n\t\t\t\t\tmeasureSkin.minHeight = this._explicitSkinMinHeight;\n\t\t\t\t\tmeasureSkin.maxWidth = this._explicitSkinMaxWidth;\n\t\t\t\t\tmeasureSkin.maxHeight = this._explicitSkinMaxHeight;\n\t\t\t\t}\n\t\t\t\tthis.removeChild(skin, false);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshTriggeredEvents():void\n\t\t{\n\t\t\tthis.tapToTrigger.isEnabled = this._isEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function changeState(state:String):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\tstate = ButtonState.DISABLED;\n\t\t\t}\n\t\t\tif(this._currentState === state)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._currentState = state;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STATE);\n\t\t\tthis.dispatchEventWith(FeathersEventType.STATE_CHANGE);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/Button.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IFocusDisplayObject;\n\timport feathers.core.IMeasureDisplayObject;\n\timport feathers.core.IStateObserver;\n\timport feathers.core.ITextBaselineControl;\n\timport feathers.core.ITextRenderer;\n\timport feathers.core.IValidating;\n\timport feathers.core.PropertyProxy;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.RelativePosition;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.text.FontStylesSet;\n\timport feathers.utils.keyboard.KeyToState;\n\timport feathers.utils.keyboard.KeyToTrigger;\n\timport feathers.utils.skins.resetFluidChildDimensionsForMeasurement;\n\timport feathers.utils.touch.LongPress;\n\n\timport flash.geom.Matrix;\n\timport flash.geom.Point;\n\timport flash.ui.Keyboard;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.rendering.Painter;\n\timport starling.text.TextFormat;\n\timport starling.utils.Pool;\n\n\t[Exclude(name=\"stateToIconFunction\",kind=\"property\")]\n\t[Exclude(name=\"stateToLabelPropertiesFunction\",kind=\"property\")]\n\t[Exclude(name=\"stateToSkinFunction\",kind=\"property\")]\n\t[Exclude(name=\"upLabelProperties\",kind=\"property\")]\n\t[Exclude(name=\"downLabelProperties\",kind=\"property\")]\n\t[Exclude(name=\"hoverLabelProperties\",kind=\"property\")]\n\t[Exclude(name=\"disabledLabelProperties\",kind=\"property\")]\n\n\t/**\n\t * A style name to add to the button's label text renderer\n\t * sub-component. Typically used by a theme to provide different styles\n\t * to different buttons.\n\t *\n\t * <p>In the following example, a custom label style name is passed to\n\t * the button:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.customLabelStyleName = \"my-custom-button-label\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( BitmapFontTextRenderer ).setFunctionForStyleName( \"my-custom-button-label\", setCustomButtonLabelStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_LABEL\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #labelFactory\n\t */\n\t[Style(name=\"customLabelStyleName\",type=\"String\")]\n\n\t/**\n\t * The icon used when no other icon is defined for the current state.\n\t * Intended to be used when multiple states should share the same icon.\n\t *\n\t * <p>This property will be ignored if a function is passed to the\n\t * <code>stateToIconFunction</code> property.</p>\n\t *\n\t * <p>The following example gives the button a default icon to use for\n\t * all states when no specific icon is available:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.defaultIcon = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #setIconForState()\n\t */\n\t[Style(name=\"defaultIcon\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The font styles used to display the button's text when the button is\n\t * disabled.\n\t *\n\t * <p>In the following example, the disabled font styles are customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.disabledFontStyles = new TextFormat( \"Helvetica\", 20, 0x999999 );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setFontStylesForState()</code> with\n\t * <code>ButtonState.DISABLED</code> to set the same font styles:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var fontStyles:TextFormat = new TextFormat( \"Helvetica\", 20, 0x999999 );\n\t * button.setFontStylesForState( ButtonState.DISABLED, fontStyles );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>labelFactory</code> to set more advanced styles on the\n\t * text renderer.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:fontStyles\n\t * @see #setFontStylesForState()\n\t */\n\t[Style(name=\"disabledFontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The icon used for the button's disabled state. If <code>null</code>, then\n\t * <code>defaultIcon</code> is used instead.\n\t *\n\t * <p>This property will be ignored if a function is passed to the\n\t * <code>stateToIconFunction</code> property.</p>\n\t *\n\t * <p>The following example gives the button an icon for the disabled state:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.disabledIcon = new Image( texture );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setIconForState()</code> with\n\t * <code>ButtonState.DISABLED</code> to set the same icon:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var icon:Image = new Image( texture );\n\t * button.setIconForState( ButtonState.DISABLED, icon );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:defaultIcon\n\t * @see #setIconForState()\n\t * @see feathers.controls.ButtonState#DISABLED\n\t */\n\t[Style(name=\"disabledIcon\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The icon used for the button's down state. If <code>null</code>, then\n\t * <code>defaultIcon</code> is used instead.\n\t *\n\t * <p>This property will be ignored if a function is passed to the\n\t * <code>stateToIconFunction</code> property.</p>\n\t *\n\t * <p>The following example gives the button an icon for the down state:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.downIcon = new Image( texture );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setIconForState()</code> with\n\t * <code>ButtonState.DOWN</code> to set the same icon:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var icon:Image = new Image( texture );\n\t * button.setIconForState( ButtonState.DOWN, icon );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:defaultIcon\n\t * @see #setIconForState()\n\t * @see feathers.controls.ButtonState#DOWN\n\t */\n\t[Style(name=\"downIcon\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The font styles used to display the button's text.\n\t *\n\t * <p>In the following example, the font styles are customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.fontStyles = new TextFormat( \"Helvetica\", 20, 0xcc0000 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>labelFactory</code> to set more advanced styles.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:disabledFontStyles\n\t * @see #setFontStylesForState()\n\t */\n\t[Style(name=\"fontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The space, in pixels, between the icon and the label. Applies to\n\t * either horizontal or vertical spacing, depending on the value of\n\t * <code>iconPosition</code>.\n\t *\n\t * <p>If <code>gap</code> is set to <code>Number.POSITIVE_INFINITY</code>,\n\t * the label and icon will be positioned as far apart as possible. In\n\t * other words, they will be positioned at the edges of the button,\n\t * adjusted for padding.</p>\n\t *\n\t * <p>The following example creates a gap of 50 pixels between the label\n\t * and the icon:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.label = \"Click Me\";\n\t * button.defaultIcon = new Image( texture );\n\t * button.gap = 50;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:iconPosition\n\t * @see #style:minGap\n\t */\n\t[Style(name=\"gap\",type=\"Number\")]\n\n\t/**\n\t * Determines if the button's label text renderer is created or not.\n\t * Useful for button sub-components that may not display text, like\n\t * slider thumbs and tracks, or similar sub-components on scroll bars.\n\t *\n\t * <p>The following example removed the label text renderer:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.hasLabelTextRenderer = false;</listing>\n\t *\n\t * @default true\n\t */\n\t[Style(name=\"hasLabelTextRenderer\",type=\"Boolean\")]\n\n\t/**\n\t * The location where the button's content is aligned horizontally (on\n\t * the x-axis).\n\t *\n\t * <p>The following example aligns the button's content to the left:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.horizontalAlign = HorizontalAlign.LEFT;</listing>\n\t *\n\t * <p><strong>Note:</strong> The <code>HorizontalAlign.JUSTIFY</code>\n\t * constant is not supported.</p>\n\t *\n\t * @default feathers.layout.HorizontalAlign.CENTER\n\t *\n\t * @see feathers.layout.HorizontalAlign#LEFT\n\t * @see feathers.layout.HorizontalAlign#CENTER\n\t * @see feathers.layout.HorizontalAlign#RIGHT\n\t */\n\t[Style(name=\"horizontalAlign\",type=\"String\")]\n\n\t/**\n\t * The icon used for the button's hover state. If <code>null</code>, then\n\t * <code>defaultIcon</code> is used instead.\n\t *\n\t * <p>This property will be ignored if a function is passed to the\n\t * <code>stateToIconFunction</code> property.</p>\n\t *\n\t * <p>The following example gives the button an icon for the hover state:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.hoverIcon = new Image( texture );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setIconForState()</code> with\n\t * <code>ButtonState.HOVER</code> to set the same icon:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var icon:Image = new Image( texture );\n\t * button.setIconForState( ButtonState.HOVER, icon );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:defaultIcon\n\t * @see #setIconForState()\n\t * @see feathers.controls.ButtonState#HOVER\n\t */\n\t[Style(name=\"hoverIcon\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * Offsets the x position of the icon by a certain number of pixels.\n\t * This does not affect the measurement of the button. The button will\n\t * measure itself as if the icon were not offset from its original\n\t * position.\n\t *\n\t * <p>The following example offsets the x position of the button's icon\n\t * by 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.iconOffsetX = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:iconOffsetY\n\t */\n\t[Style(name=\"iconOffsetX\",type=\"Number\")]\n\n\t/**\n\t * Offsets the y position of the icon by a certain number of pixels.\n\t * This does not affect the measurement of the button. The button will\n\t * measure itself as if the icon were not offset from its original\n\t * position.\n\t *\n\t * <p>The following example offsets the y position of the button's icon\n\t * by 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.iconOffsetY = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:iconOffsetX\n\t */\n\t[Style(name=\"iconOffsetY\",type=\"Number\")]\n\n\t/**\n\t * The location of the icon, relative to the label.\n\t *\n\t * <p>The following example positions the icon to the right of the\n\t * label:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.label = \"Click Me\";\n\t * button.defaultIcon = new Image( texture );\n\t * button.iconPosition = RelativePosition.RIGHT;</listing>\n\t *\n\t * @default feathers.layout.RelativePosition.LEFT\n\t *\n\t * @see feathers.layout.RelativePosition#TOP\n\t * @see feathers.layout.RelativePosition#RIGHT\n\t * @see feathers.layout.RelativePosition#BOTTOM\n\t * @see feathers.layout.RelativePosition#LEFT\n\t * @see feathers.layout.RelativePosition#RIGHT_BASELINE\n\t * @see feathers.layout.RelativePosition#LEFT_BASELINE\n\t * @see feathers.layout.RelativePosition#MANUAL\n\t */\n\t[Style(name=\"iconPosition\",type=\"String\")]\n\n\t/**\n\t * Offsets the x position of the label by a certain number of pixels.\n\t * This does not affect the measurement of the button. The button will\n\t * measure itself as if the label were not offset from its original\n\t * position.\n\t *\n\t * <p>The following example offsets the x position of the button's label\n\t * by 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.labelOffsetX = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:labelOffsetY\n\t */\n\t[Style(name=\"labelOffsetX\",type=\"Number\")]\n\n\t/**\n\t * Offsets the y position of the label by a certain number of pixels.\n\t * This does not affect the measurement of the button. The button will\n\t * measure itself as if the label were not offset from its original\n\t * position.\n\t *\n\t * <p>The following example offsets the y position of the button's label\n\t * by 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.labelOffsetY = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:labelOffsetX\n\t */\n\t[Style(name=\"labelOffsetY\",type=\"Number\")]\n\n\t/**\n\t * If the value of the <code>gap</code> property is\n\t * <code>Number.POSITIVE_INFINITY</code>, meaning that the gap will\n\t * fill as much space as possible, the final calculated value will not be\n\t * smaller than the value of the <code>minGap</code> property.\n\t *\n\t * <p>The following example ensures that the gap is never smaller than\n\t * 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.gap = Number.POSITIVE_INFINITY;\n\t * button.minGap = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:gap\n\t */\n\t[Style(name=\"minGap\",type=\"Number\")]\n\n\t/**\n\t * Quickly sets all padding properties to the same value. The\n\t * <code>padding</code> getter always returns the value of\n\t * <code>paddingTop</code>, but the other padding values may be\n\t * different.\n\t *\n\t * <p>The following example gives the button 20 pixels of padding on all\n\t * sides:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.padding = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:paddingTop\n\t * @see #style:paddingRight\n\t * @see #style:paddingBottom\n\t * @see #style:paddingLeft\n\t */\n\t[Style(name=\"padding\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the button's top edge and the\n\t * button's content.\n\t *\n\t * <p>The following example gives the button 20 pixels of padding on the\n\t * top edge only:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.paddingTop = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingTop\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the button's right edge and the\n\t * button's content.\n\t *\n\t * <p>The following example gives the button 20 pixels of padding on the\n\t * right edge only:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.paddingRight = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingRight\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the button's bottom edge and\n\t * the button's content.\n\t *\n\t * <p>The following example gives the button 20 pixels of padding on the\n\t * bottom edge only:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.paddingBottom = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingBottom\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the button's left edge and the\n\t * button's content.\n\t *\n\t * <p>The following example gives the button 20 pixels of padding on the\n\t * left edge only:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.paddingLeft = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingLeft\",type=\"Number\")]\n\n\t/**\n\t * The button renders at this scale in the down state.\n\t *\n\t * <p>The following example scales the button in the down state:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.scaleWhenDown = 0.9;</listing>\n\t *\n\t * @default 1\n\t *\n\t * @see #getScaleForState()\n\t * @see #setScaleForState()\n\t */\n\t[Style(name=\"scaleWhenDown\",type=\"Number\")]\n\n\t/**\n\t * The button renders at this scale in the hover state.\n\t *\n\t * <p>The following example scales the button in the hover state:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.scaleWhenHovering = 0.9;</listing>\n\t *\n\t * @default 1\n\t *\n\t * @see #getScaleForState()\n\t * @see #setScaleForState()\n\t */\n\t[Style(name=\"scaleWhenHovering\",type=\"Number\")]\n\n\t/**\n\t * The icon used for the button's up state. If <code>null</code>, then\n\t * <code>defaultIcon</code> is used instead.\n\t *\n\t * <p>This property will be ignored if a function is passed to the\n\t * <code>stateToIconFunction</code> property.</p>\n\t *\n\t * <p>The following example gives the button an icon for the up state:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.upIcon = new Image( texture );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setIconForState()</code> with\n\t * <code>ButtonState.UP</code> to set the same icon:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var icon:Image = new Image( texture );\n\t * button.setIconForState( ButtonState.UP, icon );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:defaultIcon\n\t * @see #setIconForState()\n\t * @see feathers.controls.ButtonState#UP\n\t */\n\t[Style(name=\"upIcon\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The location where the button's content is aligned vertically (on\n\t * the y-axis).\n\t *\n\t * <p>The following example aligns the button's content to the top:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.verticalAlign = VerticalAlign.TOP;</listing>\n\t *\n\t * <p><strong>Note:</strong> The <code>VerticalAlign.JUSTIFY</code>\n\t * constant is not supported.</p>\n\t *\n\t * @default feathers.layout.VerticalAlign.MIDDLE\n\t *\n\t * @see feathers.layout.VerticalAlign#TOP\n\t * @see feathers.layout.VerticalAlign#MIDDLE\n\t * @see feathers.layout.VerticalAlign#BOTTOM\n\t */\n\t[Style(name=\"verticalAlign\",type=\"String\")]\n\n\t/**\n\t * Determines if the text wraps to the next line when it reaches the\n\t * width (or max width) of the component.\n\t *\n\t * <p>In the following example, the button's text is wrapped:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.wordWrap = true;</listing>\n\t *\n\t * @default false\n\t */\n\t[Style(name=\"wordWrap\",type=\"Boolean\")]\n\n\t/**\n\t * Dispatched when the button is pressed for a long time. The property\n\t * <code>isLongPressEnabled</code> must be set to <code>true</code> before\n\t * this event will be dispatched.\n\t *\n\t * <p>The following example enables long presses:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.isLongPressEnabled = true;\n\t * button.addEventListener( FeathersEventType.LONG_PRESS, function( event:Event ):void\n\t * {\n\t *     // long press\n\t * });</listing>\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.LONG_PRESS\n\t * @see #isLongPressEnabled\n\t * @see #longPressDuration\n\t */\n\t[Event(name=\"longPress\",type=\"starling.events.Event\")]\n\n\t/**\n\t * A push button control that may be triggered when pressed and released.\n\t *\n\t * <p>The following example creates a button, gives it a label and listens\n\t * for when the button is triggered:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var button:Button = new Button();\n\t * button.label = \"Click Me\";\n\t * button.addEventListener( Event.TRIGGERED, button_triggeredHandler );\n\t * this.addChild( button );</listing>\n\t *\n\t * @see ../../../help/button.html How to use the Feathers Button component\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class Button extends BasicButton implements IFocusDisplayObject, ITextBaselineControl\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const HELPER_POINT:Point = new Point();\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the\n\t\t * label text renderer.\n\t\t *\n\t\t * <p>Note: the label text renderer is not a\n\t\t * <code>feathers.controls.Label</code>. It is an instance of one of the\n\t\t * <code>ITextRenderer</code> implementations.</p>\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t * @see ../../../help/text-renderers.html Introduction to Feathers text renderers\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_LABEL:String = \"feathers-button-label\";\n\n\t\t/**\n\t\t * An alternate style name to use with <code>Button</code> to allow a\n\t\t * theme to give it a more prominent, \"call-to-action\" style. If a theme\n\t\t * does not provide a style for a call-to-action button, the theme will\n\t\t * automatically fall back to using the default button style.\n\t\t *\n\t\t * <p>An alternate style name should always be added to a component's\n\t\t * <code>styleNameList</code> before the component is initialized. If\n\t\t * the style name is added later, it will be ignored.</p>\n\t\t *\n\t\t * <p>In the following example, the call-to-action style is applied to\n\t\t * a button:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var button:Button = new Button();\n\t\t * button.styleNameList.add( Button.ALTERNATE_STYLE_NAME_CALL_TO_ACTION_BUTTON );\n\t\t * this.addChild( button );</listing>\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const ALTERNATE_STYLE_NAME_CALL_TO_ACTION_BUTTON:String = \"feathers-call-to-action-button\";\n\n\t\t/**\n\t\t * An alternate style name to use with <code>Button</code> to allow a\n\t\t * theme to give it a less prominent, \"quiet\" style. If a theme does not\n\t\t * provide a style for a quiet button, the theme will automatically fall\n\t\t * back to using the default button style.\n\t\t *\n\t\t * <p>An alternate style name should always be added to a component's\n\t\t * <code>styleNameList</code> before the component is initialized. If\n\t\t * the style name is added later, it will be ignored.</p>\n\t\t *\n\t\t * <p>In the following example, the quiet button style is applied to\n\t\t * a button:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var button:Button = new Button();\n\t\t * button.styleNameList.add( Button.ALTERNATE_STYLE_NAME_QUIET_BUTTON );\n\t\t * this.addChild( button );</listing>\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const ALTERNATE_STYLE_NAME_QUIET_BUTTON:String = \"feathers-quiet-button\";\n\n\t\t/**\n\t\t * An alternate style name to use with <code>Button</code> to allow a\n\t\t * theme to give it a highly prominent, \"danger\" style. An example would\n\t\t * be a delete button or some other button that has a destructive action\n\t\t * that cannot be undone if the button is triggered. If a theme does not\n\t\t * provide a style for the danger button, the theme will automatically\n\t\t * fall back to using the default button style.\n\t\t *\n\t\t * <p>An alternate style name should always be added to a component's\n\t\t * <code>styleNameList</code> before the component is initialized. If\n\t\t * the style name is added later, it will be ignored.</p>\n\t\t *\n\t\t * <p>In the following example, the danger button style is applied to\n\t\t * a button:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var button:Button = new Button();\n\t\t * button.styleNameList.add( Button.ALTERNATE_STYLE_NAME_DANGER_BUTTON );\n\t\t * this.addChild( button );</listing>\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const ALTERNATE_STYLE_NAME_DANGER_BUTTON:String = \"feathers-danger-button\";\n\n\t\t/**\n\t\t * An alternate style name to use with <code>Button</code> to allow a\n\t\t * theme to give it a \"back button\" style, perhaps with an arrow\n\t\t * pointing backward. If a theme does not provide a style for a back\n\t\t * button, the theme will automatically fall back to using the default\n\t\t * button skin.\n\t\t *\n\t\t * <p>An alternate style name should always be added to a component's\n\t\t * <code>styleNameList</code> before the component is initialized. If\n\t\t * the style name is added later, it will be ignored.</p>\n\t\t *\n\t\t * <p>In the following example, the back button style is applied to\n\t\t * a button:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var button:Button = new Button();\n\t\t * button.styleNameList.add( Button.ALTERNATE_STYLE_NAME_BACK_BUTTON );\n\t\t * this.addChild( button );</listing>\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const ALTERNATE_STYLE_NAME_BACK_BUTTON:String = \"feathers-back-button\";\n\n\t\t/**\n\t\t * An alternate style name to use with <code>Button</code> to allow a\n\t\t * theme to give it a \"forward\" button style, perhaps with an arrow\n\t\t * pointing forward. If a theme does not provide a style for a forward\n\t\t * button, the theme will automatically fall back to using the default\n\t\t * button style.\n\t\t *\n\t\t * <p>An alternate style name should always be added to a component's\n\t\t * <code>styleNameList</code> before the component is initialized. If\n\t\t * the style name is added later, it will be ignored.</p>\n\t\t *\n\t\t * <p>In the following example, the forward button style is applied to\n\t\t * a button:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var button:Button = new Button();\n\t\t * button.styleNameList.add( Button.ALTERNATE_STYLE_NAME_FORWARD_BUTTON );\n\t\t * this.addChild( button );</listing>\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const ALTERNATE_STYLE_NAME_FORWARD_BUTTON:String = \"feathers-forward-button\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>Button</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function Button()\n\t\t{\n\t\t\tsuper();\n\t\t\tif(this._fontStylesSet === null)\n\t\t\t{\n\t\t\t\tthis._fontStylesSet = new FontStylesSet();\n\t\t\t\tthis._fontStylesSet.addEventListener(Event.CHANGE, fontStyles_changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the label text\n\t\t * renderer. This variable is <code>protected</code> so that sub-classes\n\t\t * can customize the label text renderer style name in their\n\t\t * constructors instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_LABEL</code>.\n\t\t *\n\t\t * <p>To customize the label text renderer style name without\n\t\t * subclassing, see <code>customLabelStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customLabelStyleName\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var labelStyleName:String = DEFAULT_CHILD_STYLE_NAME_LABEL;\n\n\t\t/**\n\t\t * The text renderer for the button's label.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t *\n\t\t * @see #label\n\t\t * @see #labelFactory\n\t\t * @see #createLabel()\n\t\t */\n\t\tprotected var labelTextRenderer:ITextRenderer;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitLabelWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitLabelHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitLabelMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitLabelMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitLabelMaxWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitLabelMaxHeight:Number;\n\n\t\t/**\n\t\t * The currently visible icon. The value will be <code>null</code> if\n\t\t * there is no currently visible icon.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t */\n\t\tprotected var currentIcon:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn Button.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var keyToTrigger:KeyToTrigger;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var keyToState:KeyToState;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var longPress:LongPress;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var dpadEnterKeyToTrigger:KeyToTrigger;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var dpadEnterKeyToState:KeyToState;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _label:String = null;\n\n\t\t/**\n\t\t * The text displayed on the button.\n\t\t *\n\t\t * <p>The following example gives the button some label text:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * button.label = \"Click Me\";</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get label():String\n\t\t{\n\t\t\treturn this._label;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set label(value:String):void\n\t\t{\n\t\t\tif(this._label == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._label = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _hasLabelTextRenderer:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get hasLabelTextRenderer():Boolean\n\t\t{\n\t\t\treturn this._hasLabelTextRenderer;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set hasLabelTextRenderer(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._hasLabelTextRenderer === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._hasLabelTextRenderer = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _iconPosition:String = RelativePosition.LEFT;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"top,right,bottom,left,rightBaseline,leftBaseline,manual\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get iconPosition():String\n\t\t{\n\t\t\treturn this._iconPosition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set iconPosition(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._iconPosition === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._iconPosition = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _gap:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get gap():Number\n\t\t{\n\t\t\treturn this._gap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set gap(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._gap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._gap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minGap:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get minGap():Number\n\t\t{\n\t\t\treturn this._minGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minGap(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._minGap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._minGap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalAlign:String = HorizontalAlign.CENTER;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"left,center,right\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get horizontalAlign():String\n\t\t{\n\t\t\treturn this._horizontalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalAlign(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._horizontalAlign === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalAlign = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalAlign:String = VerticalAlign.MIDDLE;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"top,middle,bottom\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get verticalAlign():String\n\t\t{\n\t\t\treturn _verticalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalAlign(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._verticalAlign === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalAlign = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get padding():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set padding(value:Number):void\n\t\t{\n\t\t\tthis.paddingTop = value;\n\t\t\tthis.paddingRight = value;\n\t\t\tthis.paddingBottom = value;\n\t\t\tthis.paddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingTop:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingTop():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingTop(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingTop = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingRight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingRight():Number\n\t\t{\n\t\t\treturn this._paddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingRight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingBottom:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingBottom():Number\n\t\t{\n\t\t\treturn this._paddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingBottom = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingLeft:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingLeft = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _labelOffsetX:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get labelOffsetX():Number\n\t\t{\n\t\t\treturn this._labelOffsetX;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set labelOffsetX(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._labelOffsetX == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._labelOffsetX = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _labelOffsetY:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get labelOffsetY():Number\n\t\t{\n\t\t\treturn this._labelOffsetY;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set labelOffsetY(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._labelOffsetY == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._labelOffsetY = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _iconOffsetX:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get iconOffsetX():Number\n\t\t{\n\t\t\treturn this._iconOffsetX;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set iconOffsetX(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._iconOffsetX == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._iconOffsetX = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _iconOffsetY:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get iconOffsetY():Number\n\t\t{\n\t\t\treturn this._iconOffsetY;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set iconOffsetY(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._iconOffsetY == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._iconOffsetY = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fontStylesSet:FontStylesSet;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get fontStyles():TextFormat\n\t\t{\n\t\t\treturn this._fontStylesSet.format;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set fontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._fontStylesSet.format;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._fontStylesSet.format = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get disabledFontStyles():TextFormat\n\t\t{\n\t\t\treturn this._fontStylesSet.disabledFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disabledFontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._fontStylesSet.disabledFormat;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._fontStylesSet.disabledFormat = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _wordWrap:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get wordWrap():Boolean\n\t\t{\n\t\t\treturn this._wordWrap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set wordWrap(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._wordWrap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _labelFactory:Function;\n\n\t\t/**\n\t\t * A function used to instantiate the button's label text renderer\n\t\t * sub-component. By default, the button will use the global text\n\t\t * renderer factory, <code>FeathersControl.defaultTextRendererFactory()</code>,\n\t\t * to create the label text renderer. The label text renderer must be an\n\t\t * instance of <code>ITextRenderer</code>. To change properties on the\n\t\t * label text renderer, see <code>defaultLabelProperties</code> and the\n\t\t * other \"<code>LabelProperties</code>\" properties for each button\n\t\t * state.\n\t\t *\n\t\t * <p>The factory should have the following function signature:</p>\n\t\t * <pre>function():ITextRenderer</pre>\n\t\t *\n\t\t * <p>The following example gives the button a custom factory for the\n\t\t * label text renderer:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * button.labelFactory = function():ITextRenderer\n\t\t * {\n\t\t *     return new TextFieldTextRenderer();\n\t\t * }</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.ITextRenderer\n\t\t * @see feathers.core.FeathersControl#defaultTextRendererFactory\n\t\t */\n\t\tpublic function get labelFactory():Function\n\t\t{\n\t\t\treturn this._labelFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set labelFactory(value:Function):void\n\t\t{\n\t\t\tif(this._labelFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._labelFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customLabelStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customLabelStyleName():String\n\t\t{\n\t\t\treturn this._customLabelStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customLabelStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customLabelStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customLabelStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _defaultLabelProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the button's label text renderer\n\t\t * when no specific properties are defined for the button's current\n\t\t * state, and the properties will be passed down to the label text\n\t\t * renderer when the button validates. The available properties depend\n\t\t * on which <code>ITextRenderer</code> implementation is returned by\n\t\t * <code>labelFactory</code>. Refer to\n\t\t * <a href=\"../core/ITextRenderer.html\"><code>feathers.core.ITextRenderer</code></a>\n\t\t * for a list of available text renderer implementations.\n\t\t *\n\t\t * <p>The following example gives the button default label properties to\n\t\t * use for all states when no specific label properties are available\n\t\t * (this example assumes that the label text renderer is a\n\t\t * <code>BitmapFontTextRenderer</code>):</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * button.defaultLabelProperties.textFormat = new BitmapFontTextFormat( bitmapFont );\n\t\t * button.defaultLabelProperties.wordWrap = true;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.ITextRenderer\n\t\t * @see #fontStyles\n\t\t */\n\t\tpublic function get defaultLabelProperties():Object\n\t\t{\n\t\t\tif(this._defaultLabelProperties === null)\n\t\t\t{\n\t\t\t\tthis._defaultLabelProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._defaultLabelProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set defaultLabelProperties(value:Object):void\n\t\t{\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvalue = PropertyProxy.fromObject(value);\n\t\t\t}\n\t\t\tif(this._defaultLabelProperties !== null)\n\t\t\t{\n\t\t\t\tthis._defaultLabelProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._defaultLabelProperties = PropertyProxy(value);\n\t\t\tif(this._defaultLabelProperties !== null)\n\t\t\t{\n\t\t\t\tthis._defaultLabelProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _defaultIcon:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get defaultIcon():DisplayObject\n\t\t{\n\t\t\treturn this._defaultIcon;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set defaultIcon(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._defaultIcon === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._defaultIcon !== null &&\n\t\t\t\tthis.currentIcon === this._defaultIcon)\n\t\t\t{\n\t\t\t\t//if this icon needs to be reused somewhere else, we need to\n\t\t\t\t//properly clean it up\n\t\t\t\tthis.removeCurrentIcon(this._defaultIcon);\n\t\t\t\tthis.currentIcon = null;\n\t\t\t}\n\t\t\tthis._defaultIcon = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _stateToIcon:Object = {};\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get upIcon():DisplayObject\n\t\t{\n\t\t\treturn this.getIconForState(ButtonState.UP);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set upIcon(value:DisplayObject):void\n\t\t{\n\t\t\tthis.setIconForState(ButtonState.UP, value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get downIcon():DisplayObject\n\t\t{\n\t\t\treturn this.getIconForState(ButtonState.DOWN);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set downIcon(value:DisplayObject):void\n\t\t{\n\t\t\tthis.setIconForState(ButtonState.DOWN, value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get hoverIcon():DisplayObject\n\t\t{\n\t\t\treturn this.getIconForState(ButtonState.HOVER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set hoverIcon(value:DisplayObject):void\n\t\t{\n\t\t\tthis.setIconForState(ButtonState.HOVER, value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get disabledIcon():DisplayObject\n\t\t{\n\t\t\treturn this.getIconForState(ButtonState.DISABLED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disabledIcon(value:DisplayObject):void\n\t\t{\n\t\t\tthis.setIconForState(ButtonState.DISABLED, value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _longPressDuration:Number = 0.5;\n\n\t\t/**\n\t\t * The duration, in seconds, of a long press.\n\t\t *\n\t\t * <p>The following example changes the long press duration to one full second:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * button.longPressDuration = 1.0;</listing>\n\t\t *\n\t\t * @default 0.5\n\t\t *\n\t\t * @see #event:longPress\n\t\t * @see #isLongPressEnabled\n\t\t */\n\t\tpublic function get longPressDuration():Number\n\t\t{\n\t\t\treturn this._longPressDuration;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set longPressDuration(value:Number):void\n\t\t{\n\t\t\tif(this._longPressDuration == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._longPressDuration = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isLongPressEnabled:Boolean = false;\n\n\t\t/**\n\t\t * Determines if <code>FeathersEventType.LONG_PRESS</code> will be\n\t\t * dispatched.\n\t\t *\n\t\t * <p>The following example enables long presses:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * button.isLongPressEnabled = true;\n\t\t * button.addEventListener( FeathersEventType.LONG_PRESS, function( event:Event ):void\n\t\t * {\n\t\t *     // long press\n\t\t * });</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see #event:longPress\n\t\t * @see #longPressDuration\n\t\t */\n\t\tpublic function get isLongPressEnabled():Boolean\n\t\t{\n\t\t\treturn this._isLongPressEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isLongPressEnabled(value:Boolean):void\n\t\t{\n\t\t\tif(this._isLongPressEnabled === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isLongPressEnabled = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _stateToScale:Object = {};\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get scaleWhenDown():Number\n\t\t{\n\t\t\treturn this.getScaleForState(ButtonState.DOWN);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set scaleWhenDown(value:Number):void\n\t\t{\n\t\t\tthis.setScaleForState(ButtonState.DOWN, value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get scaleWhenHovering():Number\n\t\t{\n\t\t\treturn this.getScaleForState(ButtonState.HOVER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set scaleWhenHovering(value:Number):void\n\t\t{\n\t\t\tthis.setScaleForState(ButtonState.HOVER, value);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get baseline():Number\n\t\t{\n\t\t\tif(!this.labelTextRenderer)\n\t\t\t{\n\t\t\t\treturn this.scaledActualHeight;\n\t\t\t}\n\t\t\treturn this.scaleY * (this.labelTextRenderer.y + this.labelTextRenderer.baseline);\n\t\t}\n\n\t\t/**\n\t\t * The number of text lines displayed by the button. The component may\n\t\t * contain multiple text lines if the text contains line breaks or if\n\t\t * the <code>wordWrap</code> property is enabled.\n\t\t *\n\t\t * @see #wordWrap\n\t\t */\n\t\tpublic function get numLines():int\n\t\t{\n\t\t\tif(this.labelTextRenderer === null)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn this.labelTextRenderer.numLines;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _ignoreIconResizes:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function render(painter:Painter):void\n\t\t{\n\t\t\tvar scale:Number = this.getScaleForCurrentState();\n\t\t\tif(scale != 1)\n\t\t\t{\n\t\t\t\tvar matrix:Matrix = Pool.getMatrix();\n\t\t\t\t//scale first, then translate... issue #1455\n\t\t\t\tmatrix.scale(scale, scale);\n\t\t\t\tmatrix.translate(Math.round((1 - scale) / 2 * this.actualWidth),\n\t\t\t\t\tMath.round((1 - scale) / 2 * this.actualHeight));\n\t\t\t\tpainter.state.transformModelviewMatrix(matrix);\n\t\t\t\tPool.putMatrix(matrix);\n\t\t\t}\n\t\t\tsuper.render(painter);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//we don't dispose it if the button is the parent because it'll\n\t\t\t//already get disposed in super.dispose()\n\t\t\tif(this._defaultIcon !== null && this._defaultIcon.parent !== this)\n\t\t\t{\n\t\t\t\tthis._defaultIcon.dispose();\n\t\t\t}\n\t\t\tfor(var state:String in this._stateToIcon)\n\t\t\t{\n\t\t\t\tvar icon:DisplayObject = this._stateToIcon[state] as DisplayObject;\n\t\t\t\tif(icon !== null && icon.parent !== this)\n\t\t\t\t{\n\t\t\t\t\ticon.dispose();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this.keyToState !== null)\n\t\t\t{\n\t\t\t\t//setting the target to null will remove listeners and do any\n\t\t\t\t//other clean up that is needed\n\t\t\t\tthis.keyToState.target = null;\n\t\t\t}\n\t\t\tif(this.keyToTrigger !== null)\n\t\t\t{\n\t\t\t\tthis.keyToTrigger.target = null;\n\t\t\t}\n\t\t\tif(this.dpadEnterKeyToState !== null)\n\t\t\t{\n\t\t\t\tthis.dpadEnterKeyToState.target = null;\n\t\t\t}\n\t\t\tif(this.dpadEnterKeyToTrigger !== null)\n\t\t\t{\n\t\t\t\tthis.dpadEnterKeyToTrigger.target = null;\n\t\t\t}\n\t\t\tif(this._fontStylesSet !== null)\n\t\t\t{\n\t\t\t\tthis._fontStylesSet.dispose();\n\t\t\t\tthis._fontStylesSet = null;\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * Gets the font styles to be used to display the button's text when the\n\t\t * button's <code>currentState</code> property matches the specified\n\t\t * state value.\n\t\t *\n\t\t * <p>If font styles are not defined for a specific state, returns\n\t\t * <code>null</code>.</p>\n\t\t *\n\t\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t\t * @see #setFontStylesForState()\n\t\t * @see #style:fontStyles\n\t\t */\n\t\tpublic function getFontStylesForState(state:String):TextFormat\n\t\t{\n\t\t\tif(this._fontStylesSet === null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn this._fontStylesSet.getFormatForState(state);\n\t\t}\n\n\t\t/**\n\t\t * Sets the font styles to be used to display the button's text when the\n\t\t * button's <code>currentState</code> property matches the specified\n\t\t * state value.\n\t\t *\n\t\t * <p>If font styles are not defined for a specific state, the value of\n\t\t * the <code>fontStyles</code> property will be used instead.</p>\n\t\t *\n\t\t * <p>Note: if the text renderer has been customized with advanced font\n\t\t * formatting, it may override the values specified with\n\t\t * <code>setFontStylesForState()</code> and properties like\n\t\t * <code>fontStyles</code> and <code>disabledFontStyles</code>.</p>\n\t\t *\n\t\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t\t * @see #style:fontStyles\n\t\t */\n\t\tpublic function setFontStylesForState(state:String, format:TextFormat):void\n\t\t{\n\t\t\tvar key:String = \"setFontStylesForState--\" + state;\n\t\t\tif(this.processStyleRestriction(key))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(key);\n\t\t\t}\n\t\t\tvar oldFormat:TextFormat = this._fontStylesSet.getFormatForState(state);\n\t\t\tif(oldFormat !== null)\n\t\t\t{\n\t\t\t\toldFormat.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._fontStylesSet.setFormatForState(state, format);\n\t\t\tif(format !== null)\n\t\t\t{\n\t\t\t\tformat.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Gets the icon to be used by the button when the button's\n\t\t * <code>currentState</code> property matches the specified state value.\n\t\t *\n\t\t * <p>If a icon is not defined for a specific state, returns\n\t\t * <code>null</code>.</p>\n\t\t *\n\t\t * @see #setIconForState()\n\t\t */\n\t\tpublic function getIconForState(state:String):DisplayObject\n\t\t{\n\t\t\treturn this._stateToIcon[state] as DisplayObject;\n\t\t}\n\n\t\t/**\n\t\t * Sets the icon to be used by the button when the button's\n\t\t * <code>currentState</code> property matches the specified state value.\n\t\t *\n\t\t * <p>If an icon is not defined for a specific state, the value of the\n\t\t * <code>defaultIcon</code> property will be used instead.</p>\n\t\t *\n\t\t * @see #style:defaultIcon\n\t\t * @see #getIconForState()\n\t\t * @see feathers.controls.ButtonState\n\t\t */\n\t\tpublic function setIconForState(state:String, icon:DisplayObject):void\n\t\t{\n\t\t\tvar key:String = \"setIconForState--\" + state;\n\t\t\tif(this.processStyleRestriction(key))\n\t\t\t{\n\t\t\t\tif(icon !== null)\n\t\t\t\t{\n\t\t\t\t\ticon.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar oldIcon:DisplayObject = this._stateToIcon[state] as DisplayObject;\n\t\t\tif(oldIcon !== null &&\n\t\t\t\tthis.currentIcon === oldIcon)\n\t\t\t{\n\t\t\t\t//if this icon needs to be reused somewhere else, we need to\n\t\t\t\t//properly clean it up\n\t\t\t\tthis.removeCurrentIcon(oldIcon);\n\t\t\t\tthis.currentIcon = null;\n\t\t\t}\n\t\t\tif(icon !== null)\n\t\t\t{\n\t\t\t\tthis._stateToIcon[state] = icon;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdelete this._stateToIcon[state];\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * Gets the scale to be used by the button when the button's\n\t\t * <code>currentState</code> property matches the specified state value.\n\t\t *\n\t\t * <p>If a scale is not defined for a specific state, returns\n\t\t * <code>NaN</code>.</p>\n\t\t *\n\t\t * @see #setScaleForState()\n\t\t */\n\t\tpublic function getScaleForState(state:String):Number\n\t\t{\n\t\t\tif(state in this._stateToScale)\n\t\t\t{\n\t\t\t\treturn this._stateToScale[state] as Number;\n\t\t\t}\n\t\t\treturn NaN;\n\t\t}\n\n\t\t/**\n\t\t * Sets the scale to be used by the button when the button's\n\t\t * <code>currentState</code> property matches the specified state value.\n\t\t *\n\t\t * <p>If an icon is not defined for a specific state, the value of the\n\t\t * <code>defaultIcon</code> property will be used instead.</p>\n\t\t *\n\t\t * @see #getScaleForState()\n\t\t * @see feathers.controls.ButtonState\n\t\t */\n\t\tpublic function setScaleForState(state:String, scale:Number):void\n\t\t{\n\t\t\tvar key:String = \"setScaleForState--\" + state;\n\t\t\tif(this.processStyleRestriction(key))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(scale === scale) //!isNaN\n\t\t\t{\n\t\t\t\tthis._stateToScale[state] = scale;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdelete this._stateToScale[state];\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tsuper.initialize();\n\t\t\tif(this.keyToState === null)\n\t\t\t{\n\t\t\t\tthis.keyToState = new KeyToState(this, this.changeState);\n\t\t\t}\n\t\t\tif(this.keyToTrigger === null)\n\t\t\t{\n\t\t\t\tthis.keyToTrigger = new KeyToTrigger(this);\n\t\t\t}\n\t\t\tif(this.longPress === null)\n\t\t\t{\n\t\t\t\tthis.longPress = new LongPress(this);\n\t\t\t}\n\t\t\tif(this.dpadEnterKeyToState === null)\n\t\t\t{\n\t\t\t\tthis.dpadEnterKeyToState = new KeyToState(this, this.changeState);\n\t\t\t\tthis.dpadEnterKeyToState.keyCode = Keyboard.ENTER;\n\t\t\t\tthis.dpadEnterKeyToState.keyLocation = 4; //KeyLocation.D_PAD is only in AIR\n\t\t\t}\n\t\t\tif(this.dpadEnterKeyToTrigger === null)\n\t\t\t{\n\t\t\t\tthis.dpadEnterKeyToTrigger = new KeyToTrigger(this, Keyboard.ENTER);\n\t\t\t\tthis.dpadEnterKeyToTrigger.keyLocation = 4; //KeyLocation.D_PAD is only in AIR\n\t\t\t}\n\t\t\tthis.longPress.tapToTrigger = this.tapToTrigger;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar textRendererInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t\tvar focusInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_FOCUS);\n\n\t\t\tif(textRendererInvalid)\n\t\t\t{\n\t\t\t\tthis.createLabel();\n\t\t\t}\n\n\t\t\tif(textRendererInvalid || stateInvalid || dataInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshLabel();\n\t\t\t}\n\n\t\t\tif(stylesInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshLongPressEvents();\n\t\t\t\tthis.refreshIcon();\n\t\t\t}\n\n\t\t\t//most components don't need to check the state before passing\n\t\t\t//properties to a child component, but button is an exception\n\t\t\tif(textRendererInvalid || stylesInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshLabelStyles();\n\t\t\t}\n\n\t\t\tsuper.draw();\n\n\t\t\tif(textRendererInvalid || stylesInvalid || stateInvalid || dataInvalid || sizeInvalid)\n\t\t\t{\n\t\t\t\tthis.layoutContent();\n\t\t\t}\n\n\t\t\tif(sizeInvalid || focusInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshFocusIndicator();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvar labelRenderer:ITextRenderer = null;\n\t\t\tif(this._label !== null && this.labelTextRenderer)\n\t\t\t{\n\t\t\t\tlabelRenderer = this.labelTextRenderer;\n\t\t\t\tthis.refreshLabelTextRendererDimensions(true);\n\t\t\t\tthis.labelTextRenderer.measureText(HELPER_POINT);\n\t\t\t}\n\n\t\t\tvar adjustedGap:Number = this._gap;\n\t\t\tif(adjustedGap == Number.POSITIVE_INFINITY)\n\t\t\t{\n\t\t\t\tadjustedGap = this._minGap;\n\t\t\t}\n\n\t\t\tresetFluidChildDimensionsForMeasurement(this.currentSkin,\n\t\t\t\tthis._explicitWidth, this._explicitHeight,\n\t\t\t\tthis._explicitMinWidth, this._explicitMinHeight,\n\t\t\t\tthis._explicitMaxWidth, this._explicitMaxHeight,\n\t\t\t\tthis._explicitSkinWidth, this._explicitSkinHeight,\n\t\t\t\tthis._explicitSkinMinWidth, this._explicitSkinMinHeight,\n\t\t\t\tthis._explicitSkinMaxWidth, this._explicitSkinMaxHeight);\n\t\t\tvar measureSkin:IMeasureDisplayObject = this.currentSkin as IMeasureDisplayObject;\n\n\t\t\tif(this.currentIcon is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.currentIcon).validate();\n\t\t\t}\n\t\t\tif(this.currentSkin is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.currentSkin).validate();\n\t\t\t}\n\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tif(labelRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = HELPER_POINT.x;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = 0;\n\t\t\t\t}\n\t\t\t\tif(this.currentIcon !== null)\n\t\t\t\t{\n\t\t\t\t\tif(labelRenderer !== null) //both label and icon\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._iconPosition !== RelativePosition.TOP &&\n\t\t\t\t\t\t\tthis._iconPosition !== RelativePosition.BOTTOM &&\n\t\t\t\t\t\t\tthis._iconPosition !== RelativePosition.MANUAL)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinWidth += adjustedGap;\n\t\t\t\t\t\t\tif(this.currentIcon is IFeathersControl)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tnewMinWidth += IFeathersControl(this.currentIcon).minWidth;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tnewMinWidth += this.currentIcon.width;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse //top, bottom, or manual\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(this.currentIcon is IFeathersControl)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar iconMinWidth:Number = IFeathersControl(this.currentIcon).minWidth;\n\t\t\t\t\t\t\t\tif(iconMinWidth > newMinWidth)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tnewMinWidth = iconMinWidth;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if(this.currentIcon.width > newMinWidth)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tnewMinWidth = this.currentIcon.width;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse //no label\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this.currentIcon is IFeathersControl)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinWidth = IFeathersControl(this.currentIcon).minWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinWidth = this.currentIcon.width;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnewMinWidth += this._paddingLeft + this._paddingRight;\n\t\t\t\tif(this.currentSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(measureSkin !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(measureSkin.minWidth > newMinWidth)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinWidth = measureSkin.minWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._explicitSkinMinWidth > newMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = this._explicitSkinMinWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tif(labelRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = HELPER_POINT.y;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = 0;\n\t\t\t\t}\n\t\t\t\tif(this.currentIcon !== null)\n\t\t\t\t{\n\t\t\t\t\tif(labelRenderer !== null) //both label and icon\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._iconPosition === RelativePosition.TOP || this._iconPosition === RelativePosition.BOTTOM)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinHeight += adjustedGap;\n\t\t\t\t\t\t\tif(this.currentIcon is IFeathersControl)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tnewMinHeight += IFeathersControl(this.currentIcon).minHeight;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tnewMinHeight += this.currentIcon.height;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse //left, right, manual\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(this.currentIcon is IFeathersControl)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar iconMinHeight:Number = IFeathersControl(this.currentIcon).minHeight;\n\t\t\t\t\t\t\t\tif(iconMinHeight > newMinHeight)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tnewMinHeight = iconMinHeight;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if(this.currentIcon.height > newMinHeight)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tnewMinHeight = this.currentIcon.height;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse //no label\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this.currentIcon is IFeathersControl)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinHeight = IFeathersControl(this.currentIcon).minHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinHeight = this.currentIcon.height;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnewMinHeight += this._paddingTop + this._paddingBottom;\n\t\t\t\tif(this.currentSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(measureSkin !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(measureSkin.minHeight > newMinHeight)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinHeight = measureSkin.minHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._explicitSkinMinHeight > newMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = this._explicitSkinMinHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tif(labelRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = HELPER_POINT.x;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewWidth = 0;\n\t\t\t\t}\n\t\t\t\tif(this.currentIcon !== null)\n\t\t\t\t{\n\t\t\t\t\tif(labelRenderer !== null) //both label and icon\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._iconPosition !== RelativePosition.TOP &&\n\t\t\t\t\t\t\tthis._iconPosition !== RelativePosition.BOTTOM &&\n\t\t\t\t\t\t\tthis._iconPosition !== RelativePosition.MANUAL)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewWidth += adjustedGap + this.currentIcon.width;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(this.currentIcon.width > newWidth) //top, bottom, or manual\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewWidth = this.currentIcon.width;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse //no label\n\t\t\t\t\t{\n\t\t\t\t\t\tnewWidth = this.currentIcon.width;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnewWidth += this._paddingLeft + this._paddingRight;\n\t\t\t\tif(this.currentSkin !== null &&\n\t\t\t\t\tthis.currentSkin.width > newWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this.currentSkin.width;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tif(labelRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = HELPER_POINT.y;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewHeight = 0;\n\t\t\t\t}\n\t\t\t\tif(this.currentIcon !== null)\n\t\t\t\t{\n\t\t\t\t\tif(labelRenderer !== null) //both label and icon\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._iconPosition === RelativePosition.TOP || this._iconPosition === RelativePosition.BOTTOM)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewHeight += adjustedGap + this.currentIcon.height;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(this.currentIcon.height > newHeight) //left, right, manual\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewHeight = this.currentIcon.height;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse //no label\n\t\t\t\t\t{\n\t\t\t\t\t\tnewHeight = this.currentIcon.height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnewHeight += this._paddingTop + this._paddingBottom;\n\t\t\t\tif(this.currentSkin !== null &&\n\t\t\t\t\tthis.currentSkin.height > newHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this.currentSkin.height;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function changeState(state:String):void\n\t\t{\n\t\t\tvar oldState:String = this._currentState;\n\t\t\tif(oldState === state)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsuper.changeState(state);\n\t\t\tif(this.getScaleForCurrentState() != this.getScaleForCurrentState(oldState))\n\t\t\t{\n\t\t\t\tthis.setRequiresRedraw();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Creates the label text renderer sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #labelTextRenderer\n\t\t * @see #labelFactory\n\t\t */\n\t\tprotected function createLabel():void\n\t\t{\n\t\t\tif(this.labelTextRenderer)\n\t\t\t{\n\t\t\t\tthis.removeChild(DisplayObject(this.labelTextRenderer), true);\n\t\t\t\tthis.labelTextRenderer = null;\n\t\t\t}\n\n\t\t\tif(this._hasLabelTextRenderer)\n\t\t\t{\n\t\t\t\tvar factory:Function = this._labelFactory != null ? this._labelFactory : FeathersControl.defaultTextRendererFactory;\n\t\t\t\tthis.labelTextRenderer = ITextRenderer(factory());\n\t\t\t\tvar labelStyleName:String = this._customLabelStyleName != null ? this._customLabelStyleName : this.labelStyleName;\n\t\t\t\tthis.labelTextRenderer.styleNameList.add(labelStyleName);\n\t\t\t\tif(this.labelTextRenderer is IStateObserver)\n\t\t\t\t{\n\t\t\t\t\tIStateObserver(this.labelTextRenderer).stateContext = this;\n\t\t\t\t}\n\t\t\t\tthis.addChild(DisplayObject(this.labelTextRenderer));\n\t\t\t\tthis._explicitLabelWidth = this.labelTextRenderer.explicitWidth;\n\t\t\t\tthis._explicitLabelHeight = this.labelTextRenderer.explicitHeight;\n\t\t\t\tthis._explicitLabelMinWidth = this.labelTextRenderer.explicitMinWidth;\n\t\t\t\tthis._explicitLabelMinHeight = this.labelTextRenderer.explicitMinHeight;\n\t\t\t\tthis._explicitLabelMaxWidth = this.labelTextRenderer.explicitMaxWidth;\n\t\t\t\tthis._explicitLabelMaxHeight = this.labelTextRenderer.explicitMaxHeight;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshLabel():void\n\t\t{\n\t\t\tif(!this.labelTextRenderer)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.labelTextRenderer.text = this._label;\n\t\t\tthis.labelTextRenderer.visible = this._label !== null && this._label.length > 0;\n\t\t\tthis.labelTextRenderer.isEnabled = this._isEnabled;\n\t\t}\n\n\t\t/**\n\t\t * Sets the <code>currentIcon</code> property.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t */\n\t\tprotected function refreshIcon():void\n\t\t{\n\t\t\tvar oldIcon:DisplayObject = this.currentIcon;\n\t\t\tthis.currentIcon = this.getCurrentIcon();\n\t\t\tif(this.currentIcon is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this.currentIcon).isEnabled = this._isEnabled;\n\t\t\t}\n\t\t\tif(this.currentIcon !== oldIcon)\n\t\t\t{\n\t\t\t\tif(oldIcon !== null)\n\t\t\t\t{\n\t\t\t\t\tthis.removeCurrentIcon(oldIcon);\n\t\t\t\t}\n\t\t\t\tif(this.currentIcon !== null)\n\t\t\t\t{\n\t\t\t\t\tif(this.currentIcon is IStateObserver)\n\t\t\t\t\t{\n\t\t\t\t\t\tIStateObserver(this.currentIcon).stateContext = this;\n\t\t\t\t\t}\n\t\t\t\t\t//we want the icon to appear below the label text renderer\n\t\t\t\t\tvar index:int = this.numChildren;\n\t\t\t\t\tif(this.labelTextRenderer)\n\t\t\t\t\t{\n\t\t\t\t\t\tindex = this.getChildIndex(DisplayObject(this.labelTextRenderer));\n\t\t\t\t\t}\n\t\t\t\t\tthis.addChildAt(this.currentIcon, index);\n\t\t\t\t\tif(this.currentIcon is IFeathersControl)\n\t\t\t\t\t{\n\t\t\t\t\t\tIFeathersControl(this.currentIcon).addEventListener(FeathersEventType.RESIZE, currentIcon_resizeHandler);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function removeCurrentIcon(icon:DisplayObject):void\n\t\t{\n\t\t\tif(icon === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(icon is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(icon).removeEventListener(FeathersEventType.RESIZE, currentIcon_resizeHandler);\n\t\t\t}\n\t\t\tif(icon is IStateObserver)\n\t\t\t{\n\t\t\t\tIStateObserver(icon).stateContext = null;\n\t\t\t}\n\t\t\tif(icon.parent === this)\n\t\t\t{\n\t\t\t\tthis.removeChild(icon, false);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getCurrentIcon():DisplayObject\n\t\t{\n\t\t\tvar result:DisplayObject = this._stateToIcon[this._currentState] as DisplayObject;\n\t\t\tif(result !== null)\n\t\t\t{\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\treturn this._defaultIcon;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getScaleForCurrentState(state:String = null):Number\n\t\t{\n\t\t\tif(state === null)\n\t\t\t{\n\t\t\t\tstate = this._currentState;\n\t\t\t}\n\t\t\tif(state in this._stateToScale)\n\t\t\t{\n\t\t\t\treturn this._stateToScale[state];\n\t\t\t}\n\t\t\treturn 1;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshLabelStyles():void\n\t\t{\n\t\t\tif(this.labelTextRenderer === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.labelTextRenderer.fontStyles = this._fontStylesSet;\n\t\t\tthis.labelTextRenderer.wordWrap = this._wordWrap;\n\t\t\tfor(var propertyName:String in this._defaultLabelProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._defaultLabelProperties[propertyName];\n\t\t\t\tthis.labelTextRenderer[propertyName] = propertyValue;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function refreshTriggeredEvents():void\n\t\t{\n\t\t\tsuper.refreshTriggeredEvents();\n\t\t\tthis.keyToTrigger.isEnabled = this._isEnabled;\n\t\t\tthis.dpadEnterKeyToTrigger.isEnabled = this._isEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshLongPressEvents():void\n\t\t{\n\t\t\tthis.longPress.isEnabled = this._isEnabled && this._isLongPressEnabled;\n\t\t\tthis.longPress.longPressDuration = this._longPressDuration;\n\t\t}\n\n\t\t/**\n\t\t * Positions and sizes the button's content.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t */\n\t\tprotected function layoutContent():void\n\t\t{\n\t\t\tthis.refreshLabelTextRendererDimensions(false);\n\t\t\tvar labelRenderer:DisplayObject = null;\n\t\t\tif(this._label !== null && this.labelTextRenderer !== null)\n\t\t\t{\n\t\t\t\tlabelRenderer = DisplayObject(this.labelTextRenderer);\n\t\t\t}\n\t\t\tvar iconIsInLayout:Boolean = this.currentIcon && this._iconPosition != RelativePosition.MANUAL;\n\t\t\tif(labelRenderer && iconIsInLayout)\n\t\t\t{\n\t\t\t\tthis.positionSingleChild(labelRenderer);\n\t\t\t\tthis.positionLabelAndIcon();\n\t\t\t}\n\t\t\telse if(labelRenderer)\n\t\t\t{\n\t\t\t\tthis.positionSingleChild(labelRenderer);\n\t\t\t}\n\t\t\telse if(iconIsInLayout)\n\t\t\t{\n\t\t\t\tthis.positionSingleChild(this.currentIcon);\n\t\t\t}\n\n\t\t\tif(this.currentIcon)\n\t\t\t{\n\t\t\t\tif(this._iconPosition == RelativePosition.MANUAL)\n\t\t\t\t{\n\t\t\t\t\tthis.currentIcon.x = this._paddingLeft;\n\t\t\t\t\tthis.currentIcon.y = this._paddingTop;\n\t\t\t\t}\n\t\t\t\tthis.currentIcon.x += this._iconOffsetX;\n\t\t\t\tthis.currentIcon.y += this._iconOffsetY;\n\t\t\t}\n\t\t\tif(labelRenderer)\n\t\t\t{\n\t\t\t\tthis.labelTextRenderer.x += this._labelOffsetX;\n\t\t\t\tthis.labelTextRenderer.y += this._labelOffsetY;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshLabelTextRendererDimensions(forMeasurement:Boolean):void\n\t\t{\n\t\t\tvar oldIgnoreIconResizes:Boolean = this._ignoreIconResizes;\n\t\t\tthis._ignoreIconResizes = true;\n\t\t\tif(this.currentIcon is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.currentIcon).validate();\n\t\t\t}\n\t\t\tthis._ignoreIconResizes = oldIgnoreIconResizes;\n\t\t\tif(this._label === null || this.labelTextRenderer === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar calculatedWidth:Number = this.actualWidth;\n\t\t\tvar calculatedHeight:Number = this.actualHeight;\n\t\t\tif(forMeasurement)\n\t\t\t{\n\t\t\t\tcalculatedWidth = this._explicitWidth;\n\t\t\t\tif(calculatedWidth !== calculatedWidth) //isNaN\n\t\t\t\t{\n\t\t\t\t\tcalculatedWidth = this._explicitMaxWidth;\n\t\t\t\t}\n\t\t\t\tcalculatedHeight = this._explicitHeight;\n\t\t\t\tif(calculatedHeight !== calculatedHeight) //isNaN\n\t\t\t\t{\n\t\t\t\t\tcalculatedHeight = this._explicitMaxHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcalculatedWidth -= (this._paddingLeft + this._paddingRight);\n\t\t\tcalculatedHeight -= (this._paddingTop + this._paddingBottom);\n\t\t\tif(this.currentIcon !== null)\n\t\t\t{\n\t\t\t\tvar adjustedGap:Number = this._gap;\n\t\t\t\tif(adjustedGap == Number.POSITIVE_INFINITY)\n\t\t\t\t{\n\t\t\t\t\tadjustedGap = this._minGap;\n\t\t\t\t}\n\t\t\t\tif(this._iconPosition === RelativePosition.LEFT || this._iconPosition === RelativePosition.LEFT_BASELINE ||\n\t\t\t\t\tthis._iconPosition === RelativePosition.RIGHT || this._iconPosition === RelativePosition.RIGHT_BASELINE)\n\t\t\t\t{\n\t\t\t\t\tcalculatedWidth -= (this.currentIcon.width + adjustedGap);\n\t\t\t\t}\n\t\t\t\tif(this._iconPosition === RelativePosition.TOP || this._iconPosition === RelativePosition.BOTTOM)\n\t\t\t\t{\n\t\t\t\t\tcalculatedHeight -= (this.currentIcon.height + adjustedGap);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(calculatedWidth < 0)\n\t\t\t{\n\t\t\t\tcalculatedWidth = 0;\n\t\t\t}\n\t\t\tif(calculatedHeight < 0)\n\t\t\t{\n\t\t\t\tcalculatedHeight = 0;\n\t\t\t}\n\t\t\tif(calculatedWidth > this._explicitLabelMaxWidth)\n\t\t\t{\n\t\t\t\tcalculatedWidth = this._explicitLabelMaxWidth;\n\t\t\t}\n\t\t\tif(calculatedHeight > this._explicitLabelMaxHeight)\n\t\t\t{\n\t\t\t\tcalculatedHeight = this._explicitLabelMaxHeight;\n\t\t\t}\n\t\t\tthis.labelTextRenderer.width = this._explicitLabelWidth;\n\t\t\tthis.labelTextRenderer.height = this._explicitLabelHeight;\n\t\t\tthis.labelTextRenderer.minWidth = this._explicitLabelMinWidth;\n\t\t\tthis.labelTextRenderer.minHeight = this._explicitLabelMinHeight;\n\t\t\tthis.labelTextRenderer.maxWidth = calculatedWidth;\n\t\t\tthis.labelTextRenderer.maxHeight = calculatedHeight;\n\t\t\tthis.labelTextRenderer.validate();\n\t\t\tif(!forMeasurement)\n\t\t\t{\n\t\t\t\tcalculatedWidth = this.labelTextRenderer.width;\n\t\t\t\tcalculatedHeight = this.labelTextRenderer.height;\n\t\t\t\t//setting all of these dimensions explicitly means that the text\n\t\t\t\t//renderer won't measure itself again when it validates, which\n\t\t\t\t//helps performance. we'll reset them when the button needs to\n\t\t\t\t//measure itself.\n\t\t\t\tthis.labelTextRenderer.width = calculatedWidth;\n\t\t\t\tthis.labelTextRenderer.height = calculatedHeight;\n\t\t\t\tthis.labelTextRenderer.minWidth = calculatedWidth;\n\t\t\t\tthis.labelTextRenderer.minHeight = calculatedHeight;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function positionSingleChild(displayObject:DisplayObject):void\n\t\t{\n\t\t\tif(this._horizontalAlign == HorizontalAlign.LEFT)\n\t\t\t{\n\t\t\t\tdisplayObject.x = this._paddingLeft;\n\t\t\t}\n\t\t\telse if(this._horizontalAlign == HorizontalAlign.RIGHT)\n\t\t\t{\n\t\t\t\tdisplayObject.x = this.actualWidth - this._paddingRight - displayObject.width;\n\t\t\t}\n\t\t\telse //center\n\t\t\t{\n\t\t\t\tdisplayObject.x = this._paddingLeft + Math.round((this.actualWidth - this._paddingLeft - this._paddingRight - displayObject.width) / 2);\n\t\t\t}\n\t\t\tif(this._verticalAlign == VerticalAlign.TOP)\n\t\t\t{\n\t\t\t\tdisplayObject.y = this._paddingTop;\n\t\t\t}\n\t\t\telse if(this._verticalAlign == VerticalAlign.BOTTOM)\n\t\t\t{\n\t\t\t\tdisplayObject.y = this.actualHeight - this._paddingBottom - displayObject.height;\n\t\t\t}\n\t\t\telse //middle\n\t\t\t{\n\t\t\t\tdisplayObject.y = this._paddingTop + Math.round((this.actualHeight - this._paddingTop - this._paddingBottom - displayObject.height) / 2);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function positionLabelAndIcon():void\n\t\t{\n\t\t\tif(this._iconPosition == RelativePosition.TOP)\n\t\t\t{\n\t\t\t\tif(this._gap == Number.POSITIVE_INFINITY)\n\t\t\t\t{\n\t\t\t\t\tthis.currentIcon.y = this._paddingTop;\n\t\t\t\t\tthis.labelTextRenderer.y = this.actualHeight - this._paddingBottom - this.labelTextRenderer.height;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(this._verticalAlign == VerticalAlign.TOP)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.labelTextRenderer.y += this.currentIcon.height + this._gap;\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._verticalAlign == VerticalAlign.MIDDLE)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.labelTextRenderer.y += Math.round((this.currentIcon.height + this._gap) / 2);\n\t\t\t\t\t}\n\t\t\t\t\tthis.currentIcon.y = this.labelTextRenderer.y - this.currentIcon.height - this._gap;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(this._iconPosition == RelativePosition.RIGHT || this._iconPosition == RelativePosition.RIGHT_BASELINE)\n\t\t\t{\n\t\t\t\tif(this._gap == Number.POSITIVE_INFINITY)\n\t\t\t\t{\n\t\t\t\t\tthis.labelTextRenderer.x = this._paddingLeft;\n\t\t\t\t\tthis.currentIcon.x = this.actualWidth - this._paddingRight - this.currentIcon.width;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(this._horizontalAlign == HorizontalAlign.RIGHT)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.labelTextRenderer.x -= this.currentIcon.width + this._gap;\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._horizontalAlign == HorizontalAlign.CENTER)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.labelTextRenderer.x -= Math.round((this.currentIcon.width + this._gap) / 2);\n\t\t\t\t\t}\n\t\t\t\t\tthis.currentIcon.x = this.labelTextRenderer.x + this.labelTextRenderer.width + this._gap;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(this._iconPosition == RelativePosition.BOTTOM)\n\t\t\t{\n\t\t\t\tif(this._gap == Number.POSITIVE_INFINITY)\n\t\t\t\t{\n\t\t\t\t\tthis.labelTextRenderer.y = this._paddingTop;\n\t\t\t\t\tthis.currentIcon.y = this.actualHeight - this._paddingBottom - this.currentIcon.height;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(this._verticalAlign == VerticalAlign.BOTTOM)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.labelTextRenderer.y -= this.currentIcon.height + this._gap;\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._verticalAlign == VerticalAlign.MIDDLE)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.labelTextRenderer.y -= Math.round((this.currentIcon.height + this._gap) / 2);\n\t\t\t\t\t}\n\t\t\t\t\tthis.currentIcon.y = this.labelTextRenderer.y + this.labelTextRenderer.height + this._gap;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(this._iconPosition == RelativePosition.LEFT || this._iconPosition == RelativePosition.LEFT_BASELINE)\n\t\t\t{\n\t\t\t\tif(this._gap == Number.POSITIVE_INFINITY)\n\t\t\t\t{\n\t\t\t\t\tthis.currentIcon.x = this._paddingLeft;\n\t\t\t\t\tthis.labelTextRenderer.x = this.actualWidth - this._paddingRight - this.labelTextRenderer.width;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(this._horizontalAlign == HorizontalAlign.LEFT)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.labelTextRenderer.x += this._gap + this.currentIcon.width;\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._horizontalAlign == HorizontalAlign.CENTER)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.labelTextRenderer.x += Math.round((this._gap + this.currentIcon.width) / 2);\n\t\t\t\t\t}\n\t\t\t\t\tthis.currentIcon.x = this.labelTextRenderer.x - this._gap - this.currentIcon.width;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(this._iconPosition == RelativePosition.LEFT || this._iconPosition == RelativePosition.RIGHT)\n\t\t\t{\n\t\t\t\tif(this._verticalAlign == VerticalAlign.TOP)\n\t\t\t\t{\n\t\t\t\t\tthis.currentIcon.y = this._paddingTop;\n\t\t\t\t}\n\t\t\t\telse if(this._verticalAlign == VerticalAlign.BOTTOM)\n\t\t\t\t{\n\t\t\t\t\tthis.currentIcon.y = this.actualHeight - this._paddingBottom - this.currentIcon.height;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.currentIcon.y = this._paddingTop + Math.round((this.actualHeight - this._paddingTop - this._paddingBottom - this.currentIcon.height) / 2);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(this._iconPosition == RelativePosition.LEFT_BASELINE || this._iconPosition == RelativePosition.RIGHT_BASELINE)\n\t\t\t{\n\t\t\t\tthis.currentIcon.y = this.labelTextRenderer.y + (this.labelTextRenderer.baseline) - this.currentIcon.height;\n\t\t\t}\n\t\t\telse //top or bottom\n\t\t\t{\n\t\t\t\tif(this._horizontalAlign == HorizontalAlign.LEFT)\n\t\t\t\t{\n\t\t\t\t\tthis.currentIcon.x = this._paddingLeft;\n\t\t\t\t}\n\t\t\t\telse if(this._horizontalAlign == HorizontalAlign.RIGHT)\n\t\t\t\t{\n\t\t\t\t\tthis.currentIcon.x = this.actualWidth - this._paddingRight - this.currentIcon.width;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.currentIcon.x = this._paddingLeft + Math.round((this.actualWidth - this._paddingLeft - this._paddingRight - this.currentIcon.width) / 2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function childProperties_onChange(proxy:PropertyProxy, name:Object):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function currentIcon_resizeHandler():void\n\t\t{\n\t\t\tif(this._ignoreIconResizes)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function fontStyles_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/controls/ButtonGroup.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.core.FeathersControl;\n\timport feathers.core.ITextBaselineControl;\n\timport feathers.core.PropertyProxy;\n\timport feathers.data.IListCollection;\n\timport feathers.events.CollectionEventType;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.Direction;\n\timport feathers.layout.FlowLayout;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.HorizontalLayout;\n\timport feathers.layout.ILayout;\n\timport feathers.layout.IVirtualLayout;\n\timport feathers.layout.LayoutBoundsResult;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.layout.ViewPortBounds;\n\timport feathers.skins.IStyleProvider;\n\n\timport flash.utils.Dictionary;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t/**\n\t * A style name to add to all buttons in this button group. Typically\n\t * used by a theme to provide different styles to different button groups.\n\t *\n\t * <p>The following example provides a custom button style name:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * group.customButtonStyleName = \"my-custom-button\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( Button ).setFunctionForStyleName( \"my-custom-button\", setCustomButtonStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_BUTTON\n\t * @see feathers.core.FeathersControl#styleNameList\n\t */\n\t[Style(name=\"customButtonStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to the first button in this button group.\n\t * Typically used by a theme to provide different styles to the first\n\t * button.\n\t *\n\t * <p>The following example provides a custom first button style name:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * group.customFirstButtonStyleName = \"my-custom-first-button\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( Button ).setFunctionForStyleName( \"my-custom-first-button\", setCustomFirstButtonStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see feathers.core.FeathersControl#styleNameList\n\t */\n\t[Style(name=\"customFirstButtonStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to the last button in this button group.\n\t * Typically used by a theme to provide different styles to the last\n\t * button.\n\t *\n\t * <p>The following example provides a custom last button style name:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * group.customLastButtonStyleName = \"my-custom-last-button\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( Button ).setFunctionForStyleName( \"my-custom-last-button\", setCustomLastButtonStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see feathers.core.FeathersControl#styleNameList\n\t */\n\t[Style(name=\"customLastButtonStyleName\",type=\"String\")]\n\n\t/**\n\t * The button group layout is either vertical or horizontal.\n\t *\n\t * <p>If the <code>direction</code> is\n\t * <code>Direction.HORIZONTAL</code> and\n\t * <code>distributeButtonSizes</code> is <code>false</code>, the buttons\n\t * may be displayed in multiple rows, if they won't fit in one row\n\t * horizontally.</p>\n\t *\n\t * <p>The following example sets the layout direction of the buttons\n\t * to line them up horizontally:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * group.direction = Direction.HORIZONTAL;</listing>\n\t *\n\t * <p><strong>Note:</strong> The <code>Direction.NONE</code>\n\t * constant is not supported.</p>\n\t *\n\t * @default feathers.layout.Direction.VERTICAL\n\t *\n\t * @see feathers.layout.Direction#HORIZONTAL\n\t * @see feathers.layout.Direction#VERTICAL\n\t */\n\t[Style(name=\"direction\",type=\"String\")]\n\n\t/**\n\t * If <code>true</code>, the buttons will be equally sized in the\n\t * direction of the layout. In other words, if the button group is\n\t * horizontal, each button will have the same width, and if the button\n\t * group is vertical, each button will have the same height. If\n\t * <code>false</code>, the buttons will be sized to their ideal\n\t * dimensions.\n\t *\n\t * <p>The following example doesn't distribute the button sizes:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * group.distributeButtonSizes = false;</listing>\n\t *\n\t * @default true\n\t */\n\t[Style(name=\"distributeButtonSizes\",type=\"Boolean\")]\n\n\t/**\n\t * Space, in pixels, between the first two buttons. If <code>NaN</code>,\n\t * the default <code>gap</code> property will be used.\n\t *\n\t * <p>The following example sets the gap between the first and second\n\t * button to a different value than the standard gap:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * group.firstGap = 30;\n\t * group.gap = 20;</listing>\n\t *\n\t * @default NaN\n\t *\n\t * @see #style:gap\n\t * @see #style:lastGap\n\t */\n\t[Style(name=\"firstGap\",type=\"Number\")]\n\n\t/**\n\t * Space, in pixels, between buttons.\n\t *\n\t * <p>The following example sets the gap used for the button layout to\n\t * 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * group.gap = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:firstGap\n\t * @see #style:lastGap\n\t */\n\t[Style(name=\"gap\",type=\"Number\")]\n\n\t/**\n\t * Determines how the buttons are horizontally aligned within the bounds\n\t * of the button group (on the x-axis).\n\t *\n\t * <p>The following example aligns the group's content to the left:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * group.horizontalAlign = HorizontalAlign.LEFT;</listing>\n\t *\n\t * @default feathers.layout.HorizontalAlign.JUSTIFY\n\t *\n\t * @see feathers.layout.HorizontalAlign#LEFT\n\t * @see feathers.layout.HorizontalAlign#CENTER\n\t * @see feathers.layout.HorizontalAlign#RIGHT\n\t * @see feathers.layout.HorizontalAlign#JUSTIFY\n\t */\n\t[Style(name=\"horizontalAlign\",type=\"String\")]\n\n\t/**\n\t * Space, in pixels, between the last two buttons. If <code>NaN</code>,\n\t * the default <code>gap</code> property will be used.\n\t *\n\t * <p>The following example sets the gap between the last and next to last\n\t * button to a different value than the standard gap:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * group.lastGap = 30;\n\t * group.gap = 20;</listing>\n\t *\n\t * @default NaN\n\t *\n\t * @see #style:gap\n\t * @see #style:firstGap\n\t */\n\t[Style(name=\"lastGap\",type=\"Number\")]\n\n\t/**\n\t * Quickly sets all padding properties to the same value. The\n\t * <code>padding</code> getter always returns the value of\n\t * <code>paddingTop</code>, but the other padding values may be\n\t * different.\n\t *\n\t * <p>In the following example, the padding of all sides of the group\n\t * is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * group.padding = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:paddingTop\n\t * @see #style:paddingRight\n\t * @see #style:paddingBottom\n\t * @see #style:paddingLeft\n\t */\n\t[Style(name=\"padding\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the group's top edge and the\n\t * group's buttons.\n\t *\n\t * <p>In the following example, the padding on the top edge of the\n\t * group is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * group.paddingTop = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingTop\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the group's right edge and the\n\t * group's buttons.\n\t *\n\t * <p>In the following example, the padding on the right edge of the\n\t * group is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * group.paddingRight = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingRight\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the group's bottom edge and the\n\t * group's buttons.\n\t *\n\t * <p>In the following example, the padding on the bottom edge of the\n\t * group is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * group.paddingBottom = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingBottom\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the group's left edge and the\n\t * group's buttons.\n\t *\n\t * <p>In the following example, the padding on the left edge of the\n\t * group is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * group.paddingLeft = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingLeft\",type=\"Number\")]\n\n\t/**\n\t * Determines how the buttons are vertically aligned within the bounds\n\t * of the button group (on the y-axis).\n\t *\n\t * <p>The following example aligns the group's content to the top:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * group.verticalAlign = VerticalAlign.TOP;</listing>\n\t *\n\t * @default feathers.layout.VerticalAlign.JUSTIFY\n\t *\n\t * @see feathers.layout.VerticalAlign#TOP\n\t * @see feathers.layout.VerticalAlign#MIDDLE\n\t * @see feathers.layout.VerticalAlign#BOTTOM\n\t * @see feathers.layout.VerticalAlign#JUSTIFY\n\t */\n\t[Style(name=\"verticalAlign\",type=\"String\")]\n\n\t/**\n\t * Dispatched when one of the buttons is triggered. The <code>data</code>\n\t * property of the event contains the item from the data provider that is\n\t * associated with the button that was triggered.\n\t *\n\t * <p>The following example listens to <code>Event.TRIGGERED</code> on the\n\t * button group instead of on individual buttons:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * group.dataProvider = new ArrayCollection(\n\t * [\n\t *     { label: \"Yes\" },\n\t *     { label: \"No\" },\n\t *     { label: \"Cancel\" },\n\t * ]);\n\t * group.addEventListener( Event.TRIGGERED, function( event:Event, data:Object ):void\n\t * {\n\t *    trace( \"The button with label \\\"\" + data.label + \"\\\" was triggered.\" );\n\t * }</listing>\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The item associated with the button\n\t *   that was triggered.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.TRIGGERED\n\t */\n\t[Event(name=\"triggered\",type=\"starling.events.Event\")]\n\n\t/**\n\t * A set of related buttons with layout, customized using a data provider.\n\t *\n\t * <p>The following example creates a button group with a few buttons:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var group:ButtonGroup = new ButtonGroup();\n\t * group.dataProvider = new ArrayCollection(\n\t * [\n\t *     { label: \"Yes\", triggered: yesButton_triggeredHandler },\n\t *     { label: \"No\", triggered: noButton_triggeredHandler },\n\t *     { label: \"Cancel\", triggered: cancelButton_triggeredHandler },\n\t * ]);\n\t * this.addChild( group );</listing>\n\t *\n\t * @see ../../../help/button-group.html How to use the Feathers ButtonGroup component\n\t * @see feathers.controls.TabBar\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class ButtonGroup extends FeathersControl implements ITextBaselineControl\n\t{\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>ButtonGroup</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_BUTTON_FACTORY:String = \"buttonFactory\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const LABEL_FIELD:String = \"label\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const ENABLED_FIELD:String = \"isEnabled\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const DEFAULT_BUTTON_FIELDS:Vector.<String> = new <String>\n\t\t\t[\n\t\t\t\t\"defaultIcon\",\n\t\t\t\t\"upIcon\",\n\t\t\t\t\"downIcon\",\n\t\t\t\t\"hoverIcon\",\n\t\t\t\t\"disabledIcon\",\n\t\t\t\t\"defaultSelectedIcon\",\n\t\t\t\t\"selectedUpIcon\",\n\t\t\t\t\"selectedDownIcon\",\n\t\t\t\t\"selectedHoverIcon\",\n\t\t\t\t\"selectedDisabledIcon\",\n\t\t\t\t\"isSelected\",\n\t\t\t\t\"isToggle\",\n\t\t\t\t\"isLongPressEnabled\",\n\t\t\t\t\"name\",\n\t\t\t];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const DEFAULT_BUTTON_EVENTS:Vector.<String> = new <String>\n\t\t\t[\n\t\t\t\tEvent.TRIGGERED,\n\t\t\t\tEvent.CHANGE,\n\t\t\t\tFeathersEventType.LONG_PRESS,\n\t\t\t];\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the buttons.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_BUTTON:String = \"feathers-button-group-button\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultButtonFactory():Button\n\t\t{\n\t\t\treturn new Button();\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function ButtonGroup()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the buttons.\n\t\t * This variable is <code>protected</code> so that sub-classes can\n\t\t * customize the button style name in their constructors instead of\n\t\t * using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_BUTTON</code>.\n\t\t *\n\t\t * <p>To customize the button style name without subclassing, see\n\t\t * <code>customButtonStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customButtonStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var buttonStyleName:String = DEFAULT_CHILD_STYLE_NAME_BUTTON;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the first button.\n\t\t *\n\t\t * <p>To customize the first button name without subclassing, see\n\t\t * <code>customFirstButtonStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customFirstButtonStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var firstButtonStyleName:String = DEFAULT_CHILD_STYLE_NAME_BUTTON;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the last button.\n\t\t *\n\t\t * <p>To customize the last button style name without subclassing, see\n\t\t * <code>customLastButtonStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customLastButtonStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var lastButtonStyleName:String = DEFAULT_CHILD_STYLE_NAME_BUTTON;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var activeFirstButton:Button;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var inactiveFirstButton:Button;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var activeLastButton:Button;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var inactiveLastButton:Button;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _layoutItems:Vector.<DisplayObject> = new <DisplayObject>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var activeButtons:Vector.<Button> = new <Button>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var inactiveButtons:Vector.<Button> = new <Button>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _buttonToItem:Dictionary = new Dictionary(true);\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn ButtonGroup.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _dataProvider:IListCollection;\n\n\t\t/**\n\t\t * The collection of data to be displayed with buttons.\n\t\t *\n\t\t * <p>The following example sets the button group's data provider:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * group.dataProvider = new ArrayCollection(\n\t\t * [\n\t\t *     { label: \"Yes\", triggered: yesButton_triggeredHandler },\n\t\t *     { label: \"No\", triggered: noButton_triggeredHandler },\n\t\t *     { label: \"Cancel\", triggered: cancelButton_triggeredHandler },\n\t\t * ]);</listing>\n\t\t *\n\t\t * <p>By default, items in the data provider support the following\n\t\t * properties from <code>Button</code></p>\n\t\t *\n\t\t * <ul>\n\t\t *     <li>label</li>\n\t\t *     <li>defaultIcon</li>\n\t\t *     <li>upIcon</li>\n\t\t *     <li>downIcon</li>\n\t\t *     <li>hoverIcon</li>\n\t\t *     <li>disabledIcon</li>\n\t\t *     <li>defaultSelectedIcon</li>\n\t\t *     <li>selectedUpIcon</li>\n\t\t *     <li>selectedDownIcon</li>\n\t\t *     <li>selectedHoverIcon</li>\n\t\t *     <li>selectedDisabledIcon</li>\n\t\t *     <li>isSelected (only supported by <code>ToggleButton</code>)</li>\n\t\t *     <li>isToggle (only supported by <code>ToggleButton</code>)</li>\n\t\t *     <li>isEnabled</li>\n\t\t *     <li>name</li>\n\t\t * </ul>\n\t\t *\n\t\t * <p>Additionally, you can add the following event listeners:</p>\n\t\t *\n\t\t * <ul>\n\t\t *     <li>Event.TRIGGERED</li>\n\t\t *     <li>Event.CHANGE (only supported by <code>ToggleButton</code>)</li>\n\t\t * </ul>\n\t\t *\n\t\t * <p>Event listeners may have one of the following signatures:</p>\n\t\t * <pre>function(event:Event):void</pre>\n\t\t * <pre>function(event:Event, eventData:Object):void</pre>\n\t\t * <pre>function(event:Event, eventData:Object, dataProviderItem:Object):void</pre>\n\t\t *\n\t\t * <p>To use properties and events that are only supported by\n\t\t * <code>ToggleButton</code>, you must provide a <code>buttonFactory</code>\n\t\t * that returns a <code>ToggleButton</code> instead of a <code>Button</code>.</p>\n\t\t *\n\t\t * <p>You can pass a function to the <code>buttonInitializer</code>\n\t\t * property that can provide custom logic to interpret each item in the\n\t\t * data provider differently. For example, you could use it to support\n\t\t * additional properties or events.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.Button\n\t\t * @see #buttonInitializer\n\t\t * @see feathers.data.ArrayCollection\n\t\t * @see feathers.data.VectorCollection\n\t\t * @see feathers.data.XMLListCollection\n\t\t */\n\t\tpublic function get dataProvider():IListCollection\n\t\t{\n\t\t\treturn this._dataProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set dataProvider(value:IListCollection):void\n\t\t{\n\t\t\tif(this._dataProvider == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._dataProvider)\n\t\t\t{\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.UPDATE_ALL, dataProvider_updateAllHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.UPDATE_ITEM, dataProvider_updateItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(Event.CHANGE, dataProvider_changeHandler);\n\t\t\t}\n\t\t\tthis._dataProvider = value;\n\t\t\tif(this._dataProvider)\n\t\t\t{\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.UPDATE_ALL, dataProvider_updateAllHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.UPDATE_ITEM, dataProvider_updateItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(Event.CHANGE, dataProvider_changeHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var layout:ILayout;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _viewPortBounds:ViewPortBounds = new ViewPortBounds();\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _layoutResult:LayoutBoundsResult = new LayoutBoundsResult();\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _direction:String = Direction.VERTICAL;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"horizontal,vertical\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get direction():String\n\t\t{\n\t\t\treturn _direction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set direction(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._direction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._direction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalAlign:String = HorizontalAlign.JUSTIFY;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"left,center,right,justify\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get horizontalAlign():String\n\t\t{\n\t\t\treturn this._horizontalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalAlign(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._horizontalAlign === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalAlign = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalAlign:String = VerticalAlign.JUSTIFY;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"top,middle,bottom,justify\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get verticalAlign():String\n\t\t{\n\t\t\treturn _verticalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalAlign(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._verticalAlign === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalAlign = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _distributeButtonSizes:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get distributeButtonSizes():Boolean\n\t\t{\n\t\t\treturn this._distributeButtonSizes;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set distributeButtonSizes(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._distributeButtonSizes === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._distributeButtonSizes = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _gap:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get gap():Number\n\t\t{\n\t\t\treturn this._gap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set gap(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._gap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._gap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _firstGap:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get firstGap():Number\n\t\t{\n\t\t\treturn this._firstGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set firstGap(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._firstGap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._firstGap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastGap:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get lastGap():Number\n\t\t{\n\t\t\treturn this._lastGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set lastGap(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._lastGap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._lastGap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get padding():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set padding(value:Number):void\n\t\t{\n\t\t\tthis.paddingTop = value;\n\t\t\tthis.paddingRight = value;\n\t\t\tthis.paddingBottom = value;\n\t\t\tthis.paddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingTop:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingTop():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingTop(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingTop = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingRight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingRight():Number\n\t\t{\n\t\t\treturn this._paddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingRight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingBottom:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingBottom():Number\n\t\t{\n\t\t\treturn this._paddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingBottom = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingLeft:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingLeft = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _buttonFactory:Function = defaultButtonFactory;\n\n\t\t/**\n\t\t * Creates each button in the group. A button must be an instance of\n\t\t * <code>Button</code>. This factory can be used to change properties on\n\t\t * the buttons when they are first created. For instance, if you are\n\t\t * skinning Feathers components without a theme, you might use this\n\t\t * factory to set skins and other styles on a button.\n\t\t *\n\t\t * <p>Optionally, the first button and the last button may be different\n\t\t * than the other buttons that are in the middle. Use the\n\t\t * <code>firstButtonFactory</code> and/or the\n\t\t * <code>lastButtonFactory</code> to customize one or both of these\n\t\t * buttons.</p>\n\t\t *\n\t\t * <p>This function is expected to have the following signature:</p>\n\t\t *\n\t\t * <pre>function():Button</pre>\n\t\t *\n\t\t * <p>The following example skins the buttons using a custom button\n\t\t * factory:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * group.buttonFactory = function():Button\n\t\t * {\n\t\t *     var button:Button = new Button();\n\t\t *     button.defaultSkin = new Image( texture );\n\t\t *     return button;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.Button\n\t\t * @see #firstButtonFactory\n\t\t * @see #lastButtonFactory\n\t\t */\n\t\tpublic function get buttonFactory():Function\n\t\t{\n\t\t\treturn this._buttonFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set buttonFactory(value:Function):void\n\t\t{\n\t\t\tif(this._buttonFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._buttonFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_BUTTON_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _firstButtonFactory:Function;\n\n\t\t/**\n\t\t * If not <code>null</code>, creates the first button. If the\n\t\t * <code>firstButtonFactory</code> is <code>null</code>, then the button\n\t\t * group will use the <code>buttonFactory</code>. The first button must\n\t\t * be an instance of <code>Button</code>. This factory can be used to\n\t\t * change properties on the first button when it is initially created.\n\t\t * For instance, if you are skinning Feathers components without a\n\t\t * theme, you might use this factory to set skins and other styles on\n\t\t * the first button.\n\t\t *\n\t\t * <p>This function is expected to have the following signature:</p>\n\t\t *\n\t\t * <pre>function():Button</pre>\n\t\t *\n\t\t * <p>The following example skins the first button using a custom\n\t\t * factory:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * group.firstButtonFactory = function():Button\n\t\t * {\n\t\t *     var button:Button = new Button();\n\t\t *     button.defaultSkin = new Image( texture );\n\t\t *     return button;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.Button\n\t\t * @see #buttonFactory\n\t\t * @see #lastButtonFactory\n\t\t */\n\t\tpublic function get firstButtonFactory():Function\n\t\t{\n\t\t\treturn this._firstButtonFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set firstButtonFactory(value:Function):void\n\t\t{\n\t\t\tif(this._firstButtonFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._firstButtonFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_BUTTON_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastButtonFactory:Function;\n\n\t\t/**\n\t\t * If not <code>null</code>, creates the last button. If the\n\t\t * <code>lastButtonFactory</code> is <code>null</code>, then the button\n\t\t * group will use the <code>buttonFactory</code>. The last button must\n\t\t * be an instance of <code>Button</code>. This factory can be used to\n\t\t * change properties on the last button when it is initially created.\n\t\t * For instance, if you are skinning Feathers components without a\n\t\t * theme, you might use this factory to set skins and other styles on\n\t\t * the last button.\n\t\t *\n\t\t * <p>This function is expected to have the following signature:</p>\n\t\t *\n\t\t * <pre>function():Button</pre>\n\t\t *\n\t\t * <p>The following example skins the last button using a custom\n\t\t * factory:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * group.lastButtonFactory = function():Button\n\t\t * {\n\t\t *     var button:Button = new Button();\n\t\t *     button.defaultSkin = new Image( texture );\n\t\t *     return button;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.Button\n\t\t * @see #buttonFactory\n\t\t * @see #firstButtonFactory\n\t\t */\n\t\tpublic function get lastButtonFactory():Function\n\t\t{\n\t\t\treturn this._lastButtonFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set lastButtonFactory(value:Function):void\n\t\t{\n\t\t\tif(this._lastButtonFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._lastButtonFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_BUTTON_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _buttonInitializer:Function = defaultButtonInitializer;\n\n\t\t/**\n\t\t * Modifies a button, perhaps by changing its label and icons, based on the\n\t\t * item from the data provider that the button is meant to represent. The\n\t\t * default buttonInitializer function can set the button's label and icons if\n\t\t * <code>label</code> and/or any of the <code>Button</code> icon fields\n\t\t * (<code>defaultIcon</code>, <code>upIcon</code>, etc.) are present in\n\t\t * the item. You can listen to <code>Event.TRIGGERED</code> and\n\t\t * <code>Event.CHANGE</code> by passing in functions for each.\n\t\t *\n\t\t * <p>This function is expected to have the following signature:</p>\n\t\t *\n\t\t * <pre>function( button:Button, item:Object ):void</pre>\n\t\t *\n\t\t * <p>The following example provides a custom button initializer:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * group.buttonInitializer = function( button:Button, item:Object ):void\n\t\t * {\n\t\t *     button.label = item.label;\n\t\t * };</listing>\n\t\t *\n\t\t * @see #dataProvider\n\t\t */\n\t\tpublic function get buttonInitializer():Function\n\t\t{\n\t\t\treturn this._buttonInitializer;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set buttonInitializer(value:Function):void\n\t\t{\n\t\t\tif(this._buttonInitializer == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._buttonInitializer = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_BUTTON_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _buttonReleaser:Function = defaultButtonReleaser;\n\n\t\t/**\n\t\t * Resets the properties of an individual button, using the item from the\n\t\t * data provider that was associated with the button.\n\t\t *\n\t\t * <p>This function is expected to have one of the following signatures:</p>\n\t\t * <pre>function( tab:Button ):void</pre>\n\t\t * <pre>function( tab:Button, oldItem:Object ):void</pre>\n\t\t *\n\t\t * <p>In the following example, a custom button releaser is passed to the\n\t\t * button group:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * group.buttonReleaser = function( button:Button, oldItem:Object ):void\n\t\t * {\n\t\t *     button.label = null;\n\t\t * };</listing>\n\t\t *\n\t\t * @see #buttonInitializer\n\t\t */\n\t\tpublic function get buttonReleaser():Function\n\t\t{\n\t\t\treturn this._buttonReleaser;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set buttonReleaser(value:Function):void\n\t\t{\n\t\t\tif(this._buttonReleaser == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._buttonReleaser = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customButtonStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customButtonStyleName():String\n\t\t{\n\t\t\treturn this._customButtonStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customButtonStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customButtonStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customButtonStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_BUTTON_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customFirstButtonStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customFirstButtonStyleName():String\n\t\t{\n\t\t\treturn this._customFirstButtonStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customFirstButtonStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customFirstButtonStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customFirstButtonStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_BUTTON_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customLastButtonStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customLastButtonStyleName():String\n\t\t{\n\t\t\treturn this._customLastButtonStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customLastButtonStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customLastButtonStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customLastButtonStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_BUTTON_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _buttonProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for all of the button group's\n\t\t * buttons, and the properties will be passed down to every button when\n\t\t * the button group validates. For a list of available properties,\n\t\t * refer to <a href=\"Button.html\"><code>feathers.controls.Button</code></a>.\n\t\t *\n\t\t * <p>These properties are shared by every button, so anything that cannot\n\t\t * be shared (such as display objects, which cannot be added to multiple\n\t\t * parents) should be passed to buttons using the\n\t\t * <code>buttonFactory</code> or in the theme.</p>\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>The following example sets some properties on all of the buttons:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * group.buttonProperties.horizontalAlign = HorizontalAlign.LEFT;\n\t\t * group.buttonProperties.verticalAlign = VerticalAlign.TOP;</listing>\n\t\t *\n\t\t * <p>Setting properties in a <code>buttonFactory</code> function instead\n\t\t * of using <code>buttonProperties</code> will result in better\n\t\t * performance.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #buttonFactory\n\t\t * @see #firstButtonFactory\n\t\t * @see #lastButtonFactory\n\t\t * @see feathers.controls.Button\n\t\t */\n\t\tpublic function get buttonProperties():Object\n\t\t{\n\t\t\tif(!this._buttonProperties)\n\t\t\t{\n\t\t\t\tthis._buttonProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._buttonProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set buttonProperties(value:Object):void\n\t\t{\n\t\t\tif(this._buttonProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._buttonProperties)\n\t\t\t{\n\t\t\t\tthis._buttonProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._buttonProperties = PropertyProxy(value);\n\t\t\tif(this._buttonProperties)\n\t\t\t{\n\t\t\t\tthis._buttonProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get baseline():Number\n\t\t{\n\t\t\tif(!this.activeButtons || this.activeButtons.length == 0)\n\t\t\t{\n\t\t\t\treturn this.scaledActualHeight;\n\t\t\t}\n\t\t\tvar firstButton:Button = this.activeButtons[0];\n\t\t\treturn this.scaleY * (firstButton.y + firstButton.baseline);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tthis.dataProvider = null;\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar buttonFactoryInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_BUTTON_FACTORY);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\n\t\t\tif(dataInvalid || stateInvalid || buttonFactoryInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshButtons(buttonFactoryInvalid);\n\t\t\t}\n\n\t\t\tif(dataInvalid || buttonFactoryInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshButtonStyles();\n\t\t\t}\n\n\t\t\tif(dataInvalid || stateInvalid || buttonFactoryInvalid)\n\t\t\t{\n\t\t\t\tthis.commitEnabled();\n\t\t\t}\n\n\t\t\tif(stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshLayoutStyles();\n\t\t\t}\n\n\t\t\tthis.layoutButtons();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function commitEnabled():void\n\t\t{\n\t\t\tvar buttonCount:int = this.activeButtons.length;\n\t\t\tfor(var i:int = 0; i < buttonCount; i++)\n\t\t\t{\n\t\t\t\tvar button:Button = this.activeButtons[i];\n\t\t\t\tbutton.isEnabled &&= this._isEnabled;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshButtonStyles():void\n\t\t{\n\t\t\tfor(var propertyName:String in this._buttonProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._buttonProperties[propertyName];\n\t\t\t\tfor each(var button:Button in this.activeButtons)\n\t\t\t\t{\n\t\t\t\t\tbutton[propertyName] = propertyValue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshLayoutStyles():void\n\t\t{\n\t\t\tif(this._direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tvar verticalLayout:VerticalLayout = this.layout as VerticalLayout;\n\t\t\t\tif(!verticalLayout)\n\t\t\t\t{\n\t\t\t\t\tthis.layout = verticalLayout = new VerticalLayout();\n\t\t\t\t}\n\t\t\t\tverticalLayout.distributeHeights = this._distributeButtonSizes;\n\t\t\t\tverticalLayout.horizontalAlign = this._horizontalAlign;\n\t\t\t\tverticalLayout.verticalAlign = (this._verticalAlign == VerticalAlign.JUSTIFY) ? VerticalAlign.TOP : this._verticalAlign;\n\t\t\t\tverticalLayout.gap = this._gap;\n\t\t\t\tverticalLayout.firstGap = this._firstGap;\n\t\t\t\tverticalLayout.lastGap = this._lastGap;\n\t\t\t\tverticalLayout.paddingTop = this._paddingTop;\n\t\t\t\tverticalLayout.paddingRight = this._paddingRight;\n\t\t\t\tverticalLayout.paddingBottom = this._paddingBottom;\n\t\t\t\tverticalLayout.paddingLeft = this._paddingLeft;\n\t\t\t}\n\t\t\telse //horizontal\n\t\t\t{\n\t\t\t\tif(this._distributeButtonSizes)\n\t\t\t\t{\n\t\t\t\t\tvar horizontalLayout:HorizontalLayout = this.layout as HorizontalLayout;\n\t\t\t\t\tif(!horizontalLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.layout = horizontalLayout = new HorizontalLayout();\n\t\t\t\t\t}\n\t\t\t\t\thorizontalLayout.distributeWidths = true;\n\t\t\t\t\thorizontalLayout.horizontalAlign = (this._horizontalAlign == HorizontalAlign.JUSTIFY) ? HorizontalAlign.LEFT : this._horizontalAlign;\n\t\t\t\t\thorizontalLayout.verticalAlign = this._verticalAlign;\n\t\t\t\t\thorizontalLayout.gap = this._gap;\n\t\t\t\t\thorizontalLayout.firstGap = this._firstGap;\n\t\t\t\t\thorizontalLayout.lastGap = this._lastGap;\n\t\t\t\t\thorizontalLayout.paddingTop = this._paddingTop;\n\t\t\t\t\thorizontalLayout.paddingRight = this._paddingRight;\n\t\t\t\t\thorizontalLayout.paddingBottom = this._paddingBottom;\n\t\t\t\t\thorizontalLayout.paddingLeft = this._paddingLeft;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar flowLayout:FlowLayout = this.layout as FlowLayout;\n\t\t\t\t\tif(!flowLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.layout = flowLayout = new FlowLayout();\n\t\t\t\t\t}\n\t\t\t\t\tflowLayout.horizontalAlign = (this._horizontalAlign == HorizontalAlign.JUSTIFY) ? HorizontalAlign.LEFT : this._horizontalAlign;\n\t\t\t\t\tflowLayout.verticalAlign = this._verticalAlign;\n\t\t\t\t\tflowLayout.gap = this._gap;\n\t\t\t\t\tflowLayout.firstHorizontalGap = this._firstGap;\n\t\t\t\t\tflowLayout.lastHorizontalGap = this._lastGap;\n\t\t\t\t\tflowLayout.paddingTop = this._paddingTop;\n\t\t\t\t\tflowLayout.paddingRight = this._paddingRight;\n\t\t\t\t\tflowLayout.paddingBottom = this._paddingBottom;\n\t\t\t\t\tflowLayout.paddingLeft = this._paddingLeft;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(layout is IVirtualLayout)\n\t\t\t{\n\t\t\t\tIVirtualLayout(layout).useVirtualLayout = false;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function defaultButtonInitializer(button:Button, item:Object):void\n\t\t{\n\t\t\tif(item is Object)\n\t\t\t{\n\t\t\t\tif(item.hasOwnProperty(LABEL_FIELD))\n\t\t\t\t{\n\t\t\t\t\tbutton.label = item.label as String;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbutton.label = item.toString();\n\t\t\t\t}\n\t\t\t\tif(item.hasOwnProperty(ENABLED_FIELD))\n\t\t\t\t{\n\t\t\t\t\tbutton.isEnabled = item.isEnabled as Boolean;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbutton.isEnabled = this._isEnabled;\n\t\t\t\t}\n\t\t\t\tfor each(var field:String in DEFAULT_BUTTON_FIELDS)\n\t\t\t\t{\n\t\t\t\t\tif(item.hasOwnProperty(field))\n\t\t\t\t\t{\n\t\t\t\t\t\tbutton[field] = item[field];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor each(field in DEFAULT_BUTTON_EVENTS)\n\t\t\t\t{\n\t\t\t\t\tvar removeListener:Boolean = true;\n\t\t\t\t\tif(item.hasOwnProperty(field))\n\t\t\t\t\t{\n\t\t\t\t\t\tvar listener:Function = item[field] as Function;\n\t\t\t\t\t\tif(listener === null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tremoveListener = false;\n\t\t\t\t\t\t//we can't add the listener directly because we don't\n\t\t\t\t\t\t//know how to remove it later if the data provider\n\t\t\t\t\t\t//changes and we lose the old item. we'll use another\n\t\t\t\t\t\t//event listener that we control as a delegate, and\n\t\t\t\t\t\t//we'll be able to remove it later.\n\t\t\t\t\t\tbutton.addEventListener(field, defaultButtonEventsListener);\n\t\t\t\t\t}\n\t\t\t\t\tif(removeListener)\n\t\t\t\t\t{\n\t\t\t\t\t\tbutton.removeEventListener(field, defaultButtonEventsListener);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbutton.label = \"\";\n\t\t\t\tbutton.isEnabled = this._isEnabled;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function defaultButtonReleaser(button:Button, oldItem:Object):void\n\t\t{\n\t\t\tbutton.label = null;\n\t\t\tfor each(var field:String in DEFAULT_BUTTON_FIELDS)\n\t\t\t{\n\t\t\t\tif(oldItem.hasOwnProperty(field))\n\t\t\t\t{\n\t\t\t\t\tbutton[field] = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor each(field in DEFAULT_BUTTON_EVENTS)\n\t\t\t{\n\t\t\t\tvar removeListener:Boolean = true;\n\t\t\t\tif(oldItem.hasOwnProperty(field))\n\t\t\t\t{\n\t\t\t\t\tvar listener:Function = oldItem[field] as Function;\n\t\t\t\t\tif(listener === null)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tbutton.removeEventListener(field, defaultButtonEventsListener);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshButtons(isFactoryInvalid:Boolean):void\n\t\t{\n\t\t\tvar temp:Vector.<Button> = this.inactiveButtons;\n\t\t\tthis.inactiveButtons = this.activeButtons;\n\t\t\tthis.activeButtons = temp;\n\t\t\tthis.activeButtons.length = 0;\n\t\t\tthis._layoutItems.length = 0;\n\t\t\ttemp = null;\n\t\t\tif(isFactoryInvalid)\n\t\t\t{\n\t\t\t\tthis.clearInactiveButtons();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(this.activeFirstButton)\n\t\t\t\t{\n\t\t\t\t\tthis.inactiveButtons.shift();\n\t\t\t\t}\n\t\t\t\tthis.inactiveFirstButton = this.activeFirstButton;\n\n\t\t\t\tif(this.activeLastButton)\n\t\t\t\t{\n\t\t\t\t\tthis.inactiveButtons.pop();\n\t\t\t\t}\n\t\t\t\tthis.inactiveLastButton = this.activeLastButton;\n\t\t\t}\n\t\t\tthis.activeFirstButton = null;\n\t\t\tthis.activeLastButton = null;\n\n\t\t\tvar pushIndex:int = 0;\n\t\t\tvar itemCount:int = this._dataProvider ? this._dataProvider.length : 0;\n\t\t\tvar lastItemIndex:int = itemCount - 1;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = this._dataProvider.getItemAt(i);\n\t\t\t\tif(i == 0)\n\t\t\t\t{\n\t\t\t\t\tvar button:Button = this.activeFirstButton = this.createFirstButton(item);\n\t\t\t\t}\n\t\t\t\telse if(i == lastItemIndex)\n\t\t\t\t{\n\t\t\t\t\tbutton = this.activeLastButton = this.createLastButton(item);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbutton = this.createButton(item);\n\t\t\t\t}\n\t\t\t\tthis.activeButtons[pushIndex] = button;\n\t\t\t\tthis._layoutItems[pushIndex] = button;\n\t\t\t\tpushIndex++;\n\t\t\t}\n\t\t\tthis.clearInactiveButtons();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function clearInactiveButtons():void\n\t\t{\n\t\t\tvar itemCount:int = this.inactiveButtons.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar button:Button = this.inactiveButtons.shift();\n\t\t\t\tthis.destroyButton(button);\n\t\t\t}\n\n\t\t\tif(this.inactiveFirstButton)\n\t\t\t{\n\t\t\t\tthis.destroyButton(this.inactiveFirstButton);\n\t\t\t\tthis.inactiveFirstButton = null;\n\t\t\t}\n\n\t\t\tif(this.inactiveLastButton)\n\t\t\t{\n\t\t\t\tthis.destroyButton(this.inactiveLastButton);\n\t\t\t\tthis.inactiveLastButton = null;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createFirstButton(item:Object):Button\n\t\t{\n\t\t\tvar isNewInstance:Boolean = false;\n\t\t\tif(this.inactiveFirstButton !== null)\n\t\t\t{\n\t\t\t\tvar button:Button = this.inactiveFirstButton;\n\t\t\t\tthis.releaseButton(button);\n\t\t\t\tthis.inactiveFirstButton = null;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tisNewInstance = true;\n\t\t\t\tvar factory:Function = this._firstButtonFactory != null ? this._firstButtonFactory : this._buttonFactory;\n\t\t\t\tbutton = Button(factory());\n\t\t\t\tif(this._customFirstButtonStyleName)\n\t\t\t\t{\n\t\t\t\t\tbutton.styleNameList.add(this._customFirstButtonStyleName);\n\t\t\t\t}\n\t\t\t\telse if(this._customButtonStyleName)\n\t\t\t\t{\n\t\t\t\t\tbutton.styleNameList.add(this._customButtonStyleName);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbutton.styleNameList.add(this.firstButtonStyleName);\n\t\t\t\t}\n\t\t\t\tthis.addChild(button);\n\t\t\t}\n\t\t\tthis._buttonInitializer(button, item);\n\t\t\tthis._buttonToItem[button] = item;\n\t\t\tif(isNewInstance)\n\t\t\t{\n\t\t\t\t//we need to listen for Event.TRIGGERED after the initializer\n\t\t\t\t//is called to avoid runtime errors because the button may be\n\t\t\t\t//disposed by the time listeners in the initializer are called.\n\t\t\t\tbutton.addEventListener(Event.TRIGGERED, button_triggeredHandler);\n\t\t\t}\n\t\t\treturn button;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createLastButton(item:Object):Button\n\t\t{\n\t\t\tvar isNewInstance:Boolean = false;\n\t\t\tif(this.inactiveLastButton !== null)\n\t\t\t{\n\t\t\t\tvar button:Button = this.inactiveLastButton;\n\t\t\t\tthis.releaseButton(button);\n\t\t\t\tthis.inactiveLastButton = null;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tisNewInstance = true;\n\t\t\t\tvar factory:Function = this._lastButtonFactory != null ? this._lastButtonFactory : this._buttonFactory;\n\t\t\t\tbutton = Button(factory());\n\t\t\t\tif(this._customLastButtonStyleName)\n\t\t\t\t{\n\t\t\t\t\tbutton.styleNameList.add(this._customLastButtonStyleName);\n\t\t\t\t}\n\t\t\t\telse if(this._customButtonStyleName)\n\t\t\t\t{\n\t\t\t\t\tbutton.styleNameList.add(this._customButtonStyleName);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbutton.styleNameList.add(this.lastButtonStyleName);\n\t\t\t\t}\n\t\t\t\tthis.addChild(button);\n\t\t\t}\n\t\t\tthis._buttonInitializer(button, item);\n\t\t\tthis._buttonToItem[button] = item;\n\t\t\tif(isNewInstance)\n\t\t\t{\n\t\t\t\t//we need to listen for Event.TRIGGERED after the initializer\n\t\t\t\t//is called to avoid runtime errors because the button may be\n\t\t\t\t//disposed by the time listeners in the initializer are called.\n\t\t\t\tbutton.addEventListener(Event.TRIGGERED, button_triggeredHandler);\n\t\t\t}\n\t\t\treturn button;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createButton(item:Object):Button\n\t\t{\n\t\t\tvar isNewInstance:Boolean = false;\n\t\t\tif(this.inactiveButtons.length == 0)\n\t\t\t{\n\t\t\t\tisNewInstance = true;\n\t\t\t\tvar button:Button = this._buttonFactory();\n\t\t\t\tif(this._customButtonStyleName)\n\t\t\t\t{\n\t\t\t\t\tbutton.styleNameList.add(this._customButtonStyleName);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbutton.styleNameList.add(this.buttonStyleName);\n\t\t\t\t}\n\t\t\t\tthis.addChild(button);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbutton = this.inactiveButtons.shift();\n\t\t\t\tthis.releaseButton(button);\n\t\t\t}\n\t\t\tthis._buttonInitializer(button, item);\n\t\t\tthis._buttonToItem[button] = item;\n\t\t\tif(isNewInstance)\n\t\t\t{\n\t\t\t\t//we need to listen for Event.TRIGGERED after the initializer\n\t\t\t\t//is called to avoid runtime errors because the button may be\n\t\t\t\t//disposed by the time listeners in the initializer are called.\n\t\t\t\tbutton.addEventListener(Event.TRIGGERED, button_triggeredHandler);\n\t\t\t}\n\t\t\treturn button;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function releaseButton(button:Button):void\n\t\t{\n\t\t\tvar item:Object = this._buttonToItem[button];\n\t\t\tdelete this._buttonToItem[button];\n\t\t\tif(this._buttonReleaser.length == 1)\n\t\t\t{\n\t\t\t\tthis._buttonReleaser(button);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._buttonReleaser(button, item);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function destroyButton(button:Button):void\n\t\t{\n\t\t\tbutton.removeEventListener(Event.TRIGGERED, button_triggeredHandler);\n\t\t\tthis.releaseButton(button);\n\t\t\tthis.removeChild(button, true);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutButtons():void\n\t\t{\n\t\t\tthis._viewPortBounds.x = 0;\n\t\t\tthis._viewPortBounds.y = 0;\n\t\t\tthis._viewPortBounds.scrollX = 0;\n\t\t\tthis._viewPortBounds.scrollY = 0;\n\t\t\tthis._viewPortBounds.explicitWidth = this._explicitWidth;\n\t\t\tthis._viewPortBounds.explicitHeight = this._explicitHeight;\n\t\t\tthis._viewPortBounds.minWidth = this._explicitMinWidth;\n\t\t\tthis._viewPortBounds.minHeight = this._explicitMinHeight;\n\t\t\tthis._viewPortBounds.maxWidth = this._explicitMaxWidth;\n\t\t\tthis._viewPortBounds.maxHeight = this._explicitMaxHeight;\n\t\t\tthis.layout.layout(this._layoutItems, this._viewPortBounds, this._layoutResult);\n\n\t\t\tvar contentWidth:Number = this._layoutResult.contentWidth;\n\t\t\tvar contentHeight:Number = this._layoutResult.contentHeight;\n\t\t\t//minimum dimensions are the same as the measured dimensions\n\t\t\tthis.saveMeasurements(contentWidth, contentHeight, contentWidth, contentHeight);\n\n\t\t\t//final validation to avoid juggler next frame issues\n\t\t\tfor each(var button:Button in this.activeButtons)\n\t\t\t{\n\t\t\t\tbutton.validate();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function childProperties_onChange(proxy:PropertyProxy, name:String):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_updateAllHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_updateItemHandler(event:Event, index:int):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function button_triggeredHandler(event:Event):void\n\t\t{\n\t\t\t//if this was called after dispose, ignore it\n\t\t\tif(!this._dataProvider || !this.activeButtons)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar button:Button = Button(event.currentTarget);\n\t\t\tvar index:int = this.activeButtons.indexOf(button);\n\t\t\tvar item:Object = this._dataProvider.getItemAt(index);\n\t\t\tthis.dispatchEventWith(Event.TRIGGERED, false, item);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function defaultButtonEventsListener(event:Event):void\n\t\t{\n\t\t\tvar button:Button = Button(event.currentTarget);\n\t\t\tvar index:int = this.activeButtons.indexOf(button);\n\t\t\tvar item:Object = this._dataProvider.getItemAt(index);\n\t\t\tvar field:String = event.type;\n\t\t\tif(item.hasOwnProperty(field))\n\t\t\t{\n\t\t\t\tvar listener:Function = item[field] as Function;\n\t\t\t\tif(listener == null)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar argCount:int = listener.length;\n\t\t\t\tswitch(argCount)\n\t\t\t\t{\n\t\t\t\t\tcase 3:\n\t\t\t\t\t{\n\t\t\t\t\t\tlistener(event, event.data, item);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase 2:\n\t\t\t\t\t{\n\t\t\t\t\t\tlistener(event, event.data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase 1:\n\t\t\t\t\t{\n\t\t\t\t\t\tlistener(event);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tdefault:\n\t\t\t\t\t{\n\t\t\t\t\t\tlistener();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/ButtonState.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\t/**\n\t * States for button components.\n\t *\n\t * @see feathers.controls.BasicButton\n\t * @see feathers.controls.Button\n\t * @see feathers.controls.ToggleButton\n\t * @see feathers.controls.Check\n\t * @see feathers.controls.Radio\n\t * @see feathers.controls.renderers.DefaultListItemRenderer\n\t * @see feathers.controls.renderers.DefaultGroupedListItemRenderer\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class ButtonState\n\t{\n\t\t/**\n\t\t * The default, up state.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const UP:String = \"up\";\n\n\t\t/**\n\t\t * The down state, when a touch begins on the component.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const DOWN:String = \"down\";\n\n\t\t/**\n\t\t * The hover state, when the mouse is over the component. This state is\n\t\t * not used on a touchscreen.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const HOVER:String = \"hover\";\n\n\t\t/**\n\t\t * The disabled state, when the component's <code>isEnabled</code>\n\t\t * property is <code>false</code>.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#isEnabled\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const DISABLED:String = \"disabled\";\n\n\t\t/**\n\t\t * Same as the up state, but the component is also selected.\n\t\t *\n\t\t * @see feathers.controls.ToggleButton#isSelected\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const UP_AND_SELECTED:String = \"upAndSelected\";\n\n\t\t/**\n\t\t * Same as the down state, but the component is also selected.\n\t\t *\n\t\t * @see feathers.controls.ToggleButton#isSelected\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const DOWN_AND_SELECTED:String = \"downAndSelected\";\n\n\t\t/**\n\t\t * Same as the hover state, but the component is also selected.\n\t\t *\n\t\t * @see feathers.controls.ToggleButton#isSelected\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const HOVER_AND_SELECTED:String = \"hoverAndSelected\";\n\n\t\t/**\n\t\t * Same as the disabled state, but the component is also selected.\n\t\t *\n\t\t * @see feathers.controls.ToggleButton#isSelected\n\t\t * @see feathers.core.FeathersControl#isEnabled\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const DISABLED_AND_SELECTED:String = \"disabledAndSelected\";\n\n\t\t/**\n\t\t * Same as the focused state, but the component is also selected.\n\t\t *\n\t\t * @see feathers.controls.ToggleButton#isSelected\n\t\t * @see feathers.core.FocusManager\n\t\t *\n\t\t * @productversion Feathers 3.4.0\n\t\t */\n\t\tpublic static const FOCUSED_AND_SELECTED:String = \"focusedAndSelected\";\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/Callout.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IMeasureDisplayObject;\n\timport feathers.core.IValidating;\n\timport feathers.core.PopUpManager;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.RelativePosition;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.utils.display.getDisplayObjectDepthFromStage;\n\timport feathers.utils.skins.resetFluidChildDimensionsForMeasurement;\n\n\timport flash.events.KeyboardEvent;\n\timport flash.geom.Point;\n\timport flash.geom.Rectangle;\n\timport flash.ui.Keyboard;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.display.DisplayObjectContainer;\n\timport starling.display.Stage;\n\timport starling.events.EnterFrameEvent;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.utils.Pool;\n\n\t/**\n\t * The position of the callout's arrow relative to the callout's\n\t * background. If the callout's <code>origin</code> is set, this value\n\t * will be managed by the callout and may change automatically if the\n\t * origin moves to a new position or if the stage resizes.\n\t *\n\t * <p>The <code>supportedPositions</code> property is related to this\n\t * one, but they have different meanings and are usually opposites. For\n\t * example, a callout on the right side of its origin will generally\n\t * display its left arrow.</p>\n\t *\n\t * <p>If you use <code>Callout.show()</code> or set the <code>origin</code>\n\t * property manually, you should avoid manually modifying the\n\t * <code>arrowPosition</code> and <code>arrowOffset</code> properties.</p>\n\t *\n\t * <p>In the following example, the callout's arrow is positioned on the\n\t * left side:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * callout.arrowPosition = RelativePosition.LEFT;</listing>\n\t *\n\t * @default feathers.layout.RelativePosition.TOP\n\t *\n\t * @see feathers.layout.RelativePosition#TOP\n\t * @see feathers.layout.RelativePosition#RIGHT\n\t * @see feathers.layout.RelativePosition#BOTTOM\n\t * @see feathers.layout.RelativePosition#LEFT\n\t *\n\t * @see #origin\n\t * @see #supportedPositions\n\t * @see #style:arrowOffset\n\t */\n\t[Style(name=\"arrowPosition\",type=\"String\")]\n\n\t/**\n\t * The primary background to display behind the callout's content.\n\t *\n\t * <p>In the following example, the callout's background is set to an image:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * callout.backgroundSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t */\n\t[Style(name=\"backgroundSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The space, in pixels, between the bottom arrow skin and the\n\t * background skin. To have the arrow overlap the background, you may\n\t * use a negative gap value.\n\t *\n\t * <p>In the following example, the gap between the callout and its\n\t * bottom arrow is set to -4 pixels (perhaps to hide a border on the\n\t * callout's background):</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * callout.bottomArrowGap = -4;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:bottomArrowSkin\n\t */\n\t[Style(name=\"bottomArrowGap\",type=\"Number\")]\n\n\t/**\n\t * The arrow skin to display on the bottom edge of the callout. This\n\t * arrow is displayed when the callout is displayed above the region it\n\t * points at.\n\t *\n\t * <p>In the following example, the callout's bottom arrow skin is set\n\t * to an image:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * callout.bottomArrowSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:bottomArrowGap\n\t */\n\t[Style(name=\"bottomArrowSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The horizontal alignment of the callout, relative to the origin.\n\t *\n\t * <p><strong>Note:</strong> The <code>HorizontalAlign.JUSTIFY</code>\n\t * constant is not supported.</p>\n\t *\n\t * @default feathers.layout.HorizontalAlign.CENTER\n\t *\n\t * @see feathers.layout.HorizontalAlign#LEFT\n\t * @see feathers.layout.HorizontalAlign#CENTER\n\t * @see feathers.layout.HorizontalAlign#RIGHT\n\t */\n\t[Style(name=\"horizontalAlign\",type=\"String\")]\n\n\t/**\n\t * The space, in pixels, between the right arrow skin and the background\n\t * skin. To have the arrow overlap the background, you may use a\n\t * negative gap value.\n\t *\n\t * <p>In the following example, the gap between the callout and its\n\t * left arrow is set to -4 pixels (perhaps to hide a border on the\n\t * callout's background):</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * callout.leftArrowGap = -4;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:leftArrowSkin\n\t */\n\t[Style(name=\"leftArrowGap\",type=\"Number\")]\n\n\t/**\n\t * The arrow skin to display on the left edge of the callout. This arrow\n\t * is displayed when the callout is displayed to the right of the region\n\t * it points at.\n\t *\n\t * <p>In the following example, the callout's left arrow skin is set\n\t * to an image:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * callout.leftArrowSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:leftArrowGap\n\t */\n\t[Style(name=\"leftArrowSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The space, in pixels, between the callout and the origin.\n\t *\n\t * <p>In the following example, the gap between the callout and its\n\t * origin is set to 10 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * callout.originGap = 10;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #origin\n\t */\n\t[Style(name=\"originGap\",type=\"Number\")]\n\n\t/**\n\t * Quickly sets all padding properties to the same value. The\n\t * <code>padding</code> getter always returns the value of\n\t * <code>paddingTop</code>, but the other padding values may be\n\t * different.\n\t *\n\t * <p>In the following example, the padding of all sides of the callout\n\t * is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * callout.padding = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:paddingTop\n\t * @see #style:paddingRight\n\t * @see #style:paddingBottom\n\t * @see #style:paddingLeft\n\t */\n\t[Style(name=\"padding\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the callout's top edge and the\n\t * callout's content.\n\t *\n\t * <p>In the following example, the padding on the top edge of the\n\t * callout is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * callout.paddingTop = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingTop\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the callout's right edge and\n\t * the callout's content.\n\t *\n\t * <p>In the following example, the padding on the right edge of the\n\t * callout is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * callout.paddingRight = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingRight\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the callout's bottom edge and\n\t * the callout's content.\n\t *\n\t * <p>In the following example, the padding on the bottom edge of the\n\t * callout is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * callout.paddingBottom = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingBottom\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the callout's left edge and the\n\t * callout's content.\n\t *\n\t * <p>In the following example, the padding on the left edge of the\n\t * callout is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * callout.paddingLeft = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingLeft\",type=\"Number\")]\n\n\t/**\n\t * The space, in pixels, between the right arrow skin and the background\n\t * skin. To have the arrow overlap the background, you may use a\n\t * negative gap value.\n\t *\n\t * <p>In the following example, the gap between the callout and its\n\t * right arrow is set to -4 pixels (perhaps to hide a border on the\n\t * callout's background):</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * callout.rightArrowGap = -4;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:rightArrowSkin\n\t */\n\t[Style(name=\"rightArrowGap\",type=\"Number\")]\n\n\t/**\n\t * The arrow skin to display on the right edge of the callout. This\n\t * arrow is displayed when the callout is displayed to the left of the\n\t * region it points at.\n\t *\n\t * <p>In the following example, the callout's right arrow skin is set\n\t * to an image:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * callout.rightArrowSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:rightArrowGap\n\t */\n\t[Style(name=\"rightArrowSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The space, in pixels, between the top arrow skin and the background\n\t * skin. To have the arrow overlap the background, you may use a\n\t * negative gap value.\n\t *\n\t * <p>In the following example, the gap between the callout and its\n\t * top arrow is set to -4 pixels (perhaps to hide a border on the\n\t * callout's background):</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * callout.topArrowGap = -4;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:topArrowSkin\n\t */\n\t[Style(name=\"topArrowGap\",type=\"Number\")]\n\n\t/**\n\t * The arrow skin to display on the top edge of the callout. This arrow\n\t * is displayed when the callout is displayed below the region it points\n\t * at.\n\t *\n\t * <p>In the following example, the callout's top arrow skin is set\n\t * to an image:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * callout.topArrowSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:topArrowGap\n\t */\n\t[Style(name=\"topArrowSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The vertical alignment of the callout, relative to the origin.\n\t *\n\t * <p><strong>Note:</strong> The <code>VerticalAlign.JUSTIFY</code>\n\t * constant is not supported.</p>\n\t *\n\t * @default feathers.layout.VerticalAlign.MIDDLE\n\t *\n\t * @see feathers.layout.VerticalAlign#TOP\n\t * @see feathers.layout.VerticalAlign#MIDDLE\n\t * @see feathers.layout.VerticalAlign#BOTTOM\n\t */\n\t[Style(name=\"verticalAlign\",type=\"String\")]\n\n\t/**\n\t * The offset, in pixels, of the arrow skin from the horizontal center\n\t * or vertical middle of the background skin, depending on the position\n\t * of the arrow (which side it is on). This value is used to point at\n\t * the callout's origin when the callout is not perfectly centered\n\t * relative to the origin.\n\t *\n\t * <p>On the top and bottom edges, the arrow will move left for negative\n\t * values of <code>arrowOffset</code> and right for positive values. On\n\t * the left and right edges, the arrow will move up for negative values\n\t * and down for positive values.</p>\n\t *\n\t * <p>If you use <code>Callout.show()</code> or set the <code>origin</code>\n\t * property manually, you should avoid manually modifying the\n\t * <code>arrowPosition</code> and <code>arrowOffset</code> properties.</p>\n\t *\n\t * <p>In the following example, the arrow offset is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * callout.arrowOffset = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:arrowPosition\n\t * @see #origin\n\t */\n\t[Style(name=\"arrowOffset\",type=\"Number\")]\n\n\t/**\n\t * Dispatched when the callout is closed.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CLOSE\n\t */\n\t[Event(name=\"close\",type=\"starling.events.Event\")]\n\n\t/**\n\t * A pop-up container that points at (or calls out) a specific region of\n\t * the application (typically a specific control that triggered it).\n\t *\n\t * <p>In general, a <code>Callout</code> isn't instantiated directly.\n\t * Instead, you will typically call the static function\n\t * <code>Callout.show()</code>. This is not required, but it result in less\n\t * code and no need to manually manage calls to the <code>PopUpManager</code>.</p>\n\t *\n\t * <p>In the following example, a callout displaying a <code>Label</code> is\n\t * shown when a <code>Button</code> is triggered:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.addEventListener( Event.TRIGGERED, button_triggeredHandler );\n\t * \n\t * function button_triggeredHandler( event:Event ):void\n\t * {\n\t *     var label:Label = new Label();\n\t *     label.text = \"Hello World!\";\n\t *     var button:Button = Button( event.currentTarget );\n\t *     Callout.show( label, button );\n\t * }</listing>\n\t *\n\t * @see ../../../help/callout.html How to use the Feathers Callout component\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class Callout extends FeathersControl\n\t{\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>Callout</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * The default positions used by a callout.\n\t\t */\n\t\tpublic static const DEFAULT_POSITIONS:Vector.<String> = new <String>\n\t\t[\n\t\t\tRelativePosition.BOTTOM,\n\t\t\tRelativePosition.TOP,\n\t\t\tRelativePosition.RIGHT,\n\t\t\tRelativePosition.LEFT,\n\t\t];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_ORIGIN:String = \"origin\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const FUZZY_CONTENT_DIMENSIONS_PADDING:Number = 0.000001;\n\n\t\t/**\n\t\t * Quickly sets all stage padding properties to the same value. The\n\t\t * <code>stagePadding</code> getter always returns the value of\n\t\t * <code>stagePaddingTop</code>, but the other padding values may be\n\t\t * different.\n\t\t *\n\t\t * <p>The following example gives the stage 20 pixels of padding on all\n\t\t * sides:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * Callout.stagePadding = 20;</listing>\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #stagePaddingTop\n\t\t * @see #stagePaddingRight\n\t\t * @see #stagePaddingBottom\n\t\t * @see #stagePaddingLeft\n\t\t */\n\t\tpublic static function get stagePadding():Number\n\t\t{\n\t\t\treturn Callout.stagePaddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic static function set stagePadding(value:Number):void\n\t\t{\n\t\t\tCallout.stagePaddingTop = value;\n\t\t\tCallout.stagePaddingRight = value;\n\t\t\tCallout.stagePaddingBottom = value;\n\t\t\tCallout.stagePaddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * The padding between a callout and the top edge of the stage when the\n\t\t * callout is positioned automatically. May be ignored if the callout\n\t\t * is too big for the stage.\n\t\t *\n\t\t * <p>In the following example, the top stage padding will be set to\n\t\t * 20 pixels:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * Callout.stagePaddingTop = 20;</listing>\n\t\t */\n\t\tpublic static var stagePaddingTop:Number = 0;\n\n\t\t/**\n\t\t * The padding between a callout and the right edge of the stage when the\n\t\t * callout is positioned automatically. May be ignored if the callout\n\t\t * is too big for the stage.\n\t\t *\n\t\t * <p>In the following example, the right stage padding will be set to\n\t\t * 20 pixels:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * Callout.stagePaddingRight = 20;</listing>\n\t\t */\n\t\tpublic static var stagePaddingRight:Number = 0;\n\n\t\t/**\n\t\t * The padding between a callout and the bottom edge of the stage when the\n\t\t * callout is positioned automatically. May be ignored if the callout\n\t\t * is too big for the stage.\n\t\t *\n\t\t * <p>In the following example, the bottom stage padding will be set to\n\t\t * 20 pixels:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * Callout.stagePaddingBottom = 20;</listing>\n\t\t */\n\t\tpublic static var stagePaddingBottom:Number = 0;\n\n\t\t/**\n\t\t * The margin between a callout and the top edge of the stage when the\n\t\t * callout is positioned automatically. May be ignored if the callout\n\t\t * is too big for the stage.\n\t\t *\n\t\t * <p>In the following example, the left stage padding will be set to\n\t\t * 20 pixels:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * Callout.stagePaddingLeft = 20;</listing>\n\t\t */\n\t\tpublic static var stagePaddingLeft:Number = 0;\n\n\t\t/**\n\t\t * Returns a new <code>Callout</code> instance when\n\t\t * <code>Callout.show()</code> is called. If one wishes to skin the\n\t\t * callout manually or change its behavior, a custom factory may be\n\t\t * provided.\n\t\t *\n\t\t * <p>This function is expected to have the following signature:</p>\n\t\t *\n\t\t * <pre>function():Callout</pre>\n\t\t *\n\t\t * <p>The following example shows how to create a custom callout factory:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * Callout.calloutFactory = function():Callout\n\t\t * {\n\t\t *     var callout:Callout = new Callout();\n\t\t *     //set properties here!\n\t\t *     return callout;\n\t\t * };</listing>\n\t\t *\n\t\t * <p>Note: the default callout factory sets the following properties:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * callout.closeOnTouchBeganOutside = true;\n\t\t * callout.closeOnTouchEndedOutside = true;\n\t\t * callout.closeOnKeys = new &lt;uint&gt;[Keyboard.BACK, Keyboard.ESCAPE];</listing>\n\t\t *\n\t\t * @see #show()\n\t\t */\n\t\tpublic static var calloutFactory:Function = defaultCalloutFactory;\n\n\t\t/**\n\t\t * Returns an overlay to display with a callout that is modal. Uses the\n\t\t * standard <code>overlayFactory</code> of the <code>PopUpManager</code>\n\t\t * by default, but you can use this property to provide your own custom\n\t\t * overlay, if you prefer.\n\t\t *\n\t\t * <p>This function is expected to have the following signature:</p>\n\t\t * <pre>function():DisplayObject</pre>\n\t\t *\n\t\t * <p>The following example uses a semi-transparent <code>Quad</code> as\n\t\t * a custom overlay:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * Callout.calloutOverlayFactory = function():Quad\n\t\t * {\n\t\t *     var quad:Quad = new Quad(10, 10, 0x000000);\n\t\t *     quad.alpha = 0.75;\n\t\t *     return quad;\n\t\t * };</listing>\n\t\t *\n\t\t * @see feathers.core.PopUpManager#overlayFactory\n\t\t *\n\t\t * @see #show()\n\t\t */\n\t\tpublic static var calloutOverlayFactory:Function = PopUpManager.defaultOverlayFactory;\n\n\t\t/**\n\t\t * Creates a callout, and then positions and sizes it automatically\n\t\t * based on an origin rectangle and the specified direction relative to\n\t\t * the original. The provided width and height values are optional, and\n\t\t * these values may be ignored if the callout cannot be drawn at the\n\t\t * specified dimensions.\n\t\t *\n\t\t * <p>The <code>supportedPositions</code> parameter should be a\n\t\t * <code>Vector.&lt;String&gt;</code> of values from the\n\t\t * <code>feathers.layout.RelativePosition</code> class. The positions\n\t\t * should be ordered by preference. This parameter is typed as\n\t\t * <code>Object</code> to allow some deprecated <code>String</code>\n\t\t * values. In a future version of Feathers, the type will change to\n\t\t * <code>Vector.&lt;String&gt;</code> instead.</p>\n\t\t *\n\t\t * <p>In the following example, a callout displaying a <code>Label</code> is\n\t\t * shown when a <code>Button</code> is triggered:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * button.addEventListener( Event.TRIGGERED, button_triggeredHandler );\n\t\t * \n\t\t * function button_triggeredHandler( event:Event ):void\n\t\t * {\n\t\t *     var label:Label = new Label();\n\t\t *     label.text = \"Hello World!\";\n\t\t *     var button:Button = Button( event.currentTarget );\n\t\t *     Callout.show( label, button );\n\t\t * }</listing>\n\t\t */\n\t\tpublic static function show(content:DisplayObject, origin:DisplayObject,\n\t\t\tsupportedPositions:Vector.<String> = null, isModal:Boolean = true, customCalloutFactory:Function = null,\n\t\t\tcustomOverlayFactory:Function = null):Callout\n\t\t{\n\t\t\tif(origin.stage === null)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"Callout origin must be added to the stage.\");\n\t\t\t}\n\t\t\tvar factory:Function = customCalloutFactory;\n\t\t\tif(factory === null)\n\t\t\t{\n\t\t\t\tfactory = calloutFactory;\n\t\t\t\tif(factory === null)\n\t\t\t\t{\n\t\t\t\t\tfactory = defaultCalloutFactory;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar callout:Callout = Callout(factory());\n\t\t\tcallout.content = content;\n\t\t\tcallout.supportedPositions = supportedPositions;\n\t\t\tcallout.origin = origin;\n\t\t\tfactory = customOverlayFactory;\n\t\t\tif(factory === null)\n\t\t\t{\n\t\t\t\tfactory = calloutOverlayFactory;\n\t\t\t\tif(factory === null)\n\t\t\t\t{\n\t\t\t\t\tfactory = PopUpManager.defaultOverlayFactory;\n\t\t\t\t}\n\t\t\t}\n\t\t\tPopUpManager.addPopUp(callout, isModal, false, factory);\n\t\t\treturn callout;\n\t\t}\n\n\t\t/**\n\t\t * The default factory that creates callouts when <code>Callout.show()</code>\n\t\t * is called. To use a different factory, you need to set\n\t\t * <code>Callout.calloutFactory</code> to a <code>Function</code>\n\t\t * instance.\n\t\t */\n\t\tpublic static function defaultCalloutFactory():Callout\n\t\t{\n\t\t\tvar callout:Callout = new Callout();\n\t\t\tcallout.closeOnTouchBeganOutside = true;\n\t\t\tcallout.closeOnTouchEndedOutside = true;\n\t\t\tcallout.closeOnKeys = new <uint>[Keyboard.BACK, Keyboard.ESCAPE];\n\t\t\treturn callout;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function positionBelowOrigin(callout:Callout, globalOrigin:Rectangle):void\n\t\t{\n\t\t\tcallout.measureWithArrowPosition(RelativePosition.TOP);\n\t\t\tvar idealXPosition:Number = globalOrigin.x;\n\t\t\tif(callout._horizontalAlign === HorizontalAlign.CENTER)\n\t\t\t{\n\t\t\t\tidealXPosition += Math.round((globalOrigin.width - callout.width) / 2);\n\t\t\t}\n\t\t\telse if(callout._horizontalAlign === HorizontalAlign.RIGHT)\n\t\t\t{\n\t\t\t\tidealXPosition += (globalOrigin.width - callout.width);\n\t\t\t}\n\t\t\tvar xPosition:Number = idealXPosition;\n\t\t\tif(stagePaddingLeft > xPosition)\n\t\t\t{\n\t\t\t\txPosition = stagePaddingLeft;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar stage:Stage = callout.stage !== null ? callout.stage : Starling.current.stage;\n\t\t\t\tvar maxXPosition:Number = stage.stageWidth - callout.width - stagePaddingRight;\n\t\t\t\tif(maxXPosition < xPosition)\n\t\t\t\t{\n\t\t\t\t\txPosition = maxXPosition;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar point:Point = Pool.getPoint(xPosition, globalOrigin.y + globalOrigin.height);\n\t\t\t//we calculate the position in global coordinates, but the callout\n\t\t\t//may be in a container that is offset from the global origin, so\n\t\t\t//adjust for that difference.\n\t\t\tcallout.parent.globalToLocal(point, point);\n\t\t\tcallout.x = point.x;\n\t\t\tcallout.y = point.y + callout._originGap;\n\t\t\tPool.putPoint(point);\n\t\t\tif(callout._isValidating)\n\t\t\t{\n\t\t\t\t//no need to invalidate and need to validate again next frame\n\t\t\t\tcallout._arrowOffset = idealXPosition - xPosition;\n\t\t\t\tcallout._arrowPosition = RelativePosition.TOP;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcallout.arrowOffset = idealXPosition - xPosition;\n\t\t\t\tcallout.arrowPosition = RelativePosition.TOP;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function positionAboveOrigin(callout:Callout, globalOrigin:Rectangle):void\n\t\t{\n\t\t\tcallout.measureWithArrowPosition(RelativePosition.BOTTOM);\n\t\t\tvar idealXPosition:Number = globalOrigin.x;\n\t\t\tif(callout._horizontalAlign === HorizontalAlign.CENTER)\n\t\t\t{\n\t\t\t\tidealXPosition += Math.round((globalOrigin.width - callout.width) / 2);\n\t\t\t}\n\t\t\telse if(callout._horizontalAlign === HorizontalAlign.RIGHT)\n\t\t\t{\n\t\t\t\tidealXPosition += (globalOrigin.width - callout.width);\n\t\t\t}\n\t\t\tvar xPosition:Number = idealXPosition;\n\t\t\tif(stagePaddingLeft > xPosition)\n\t\t\t{\n\t\t\t\txPosition = stagePaddingLeft;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar stage:Stage = callout.stage !== null ? callout.stage : Starling.current.stage;\n\t\t\t\tvar maxXPosition:Number = stage.stageWidth - callout.width - stagePaddingRight;\n\t\t\t\tif(maxXPosition < xPosition)\n\t\t\t\t{\n\t\t\t\t\txPosition = maxXPosition;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar point:Point = Pool.getPoint(xPosition, globalOrigin.y - callout.height);\n\t\t\t//we calculate the position in global coordinates, but the callout\n\t\t\t//may be in a container that is offset from the global origin, so\n\t\t\t//adjust for that difference.\n\t\t\tcallout.parent.globalToLocal(point, point);\n\t\t\tcallout.x = point.x;\n\t\t\tcallout.y = point.y - callout._originGap;\n\t\t\tPool.putPoint(point);\n\t\t\tif(callout._isValidating)\n\t\t\t{\n\t\t\t\t//no need to invalidate and need to validate again next frame\n\t\t\t\tcallout._arrowOffset = idealXPosition - xPosition;\n\t\t\t\tcallout._arrowPosition = RelativePosition.BOTTOM;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcallout.arrowOffset = idealXPosition - xPosition;\n\t\t\t\tcallout.arrowPosition = RelativePosition.BOTTOM;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function positionToRightOfOrigin(callout:Callout, globalOrigin:Rectangle):void\n\t\t{\n\t\t\tcallout.measureWithArrowPosition(RelativePosition.LEFT);\n\t\t\tvar idealYPosition:Number = globalOrigin.y;\n\t\t\tif(callout._verticalAlign === VerticalAlign.MIDDLE)\n\t\t\t{\n\t\t\t\tidealYPosition += Math.round((globalOrigin.height - callout.height) / 2);\n\t\t\t}\n\t\t\telse if(callout._verticalAlign === VerticalAlign.BOTTOM)\n\t\t\t{\n\t\t\t\tidealYPosition += (globalOrigin.height - callout.height);\n\t\t\t}\n\t\t\tvar yPosition:Number = idealYPosition;\n\t\t\tif(stagePaddingTop > yPosition)\n\t\t\t{\n\t\t\t\tyPosition = stagePaddingTop;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar stage:Stage = callout.stage !== null ? callout.stage : Starling.current.stage;\n\t\t\t\tvar maxYPosition:Number = stage.stageHeight - callout.height - stagePaddingBottom;\n\t\t\t\tif(maxYPosition < yPosition)\n\t\t\t\t{\n\t\t\t\t\tyPosition = maxYPosition;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar point:Point = Pool.getPoint(globalOrigin.x + globalOrigin.width, yPosition);\n\t\t\t//we calculate the position in global coordinates, but the callout\n\t\t\t//may be in a container that is offset from the global origin, so\n\t\t\t//adjust for that difference.\n\t\t\tcallout.parent.globalToLocal(point, point);\n\t\t\tcallout.x = point.x + callout._originGap;\n\t\t\tcallout.y = point.y;\n\t\t\tPool.putPoint(point);\n\t\t\tif(callout._isValidating)\n\t\t\t{\n\t\t\t\t//no need to invalidate and need to validate again next frame\n\t\t\t\tcallout._arrowOffset = idealYPosition - yPosition;\n\t\t\t\tcallout._arrowPosition = RelativePosition.LEFT;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcallout.arrowOffset = idealYPosition - yPosition;\n\t\t\t\tcallout.arrowPosition = RelativePosition.LEFT;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function positionToLeftOfOrigin(callout:Callout, globalOrigin:Rectangle):void\n\t\t{\n\t\t\tcallout.measureWithArrowPosition(RelativePosition.RIGHT);\n\t\t\tvar idealYPosition:Number = globalOrigin.y;\n\t\t\tif(callout._verticalAlign === VerticalAlign.MIDDLE)\n\t\t\t{\n\t\t\t\tidealYPosition += Math.round((globalOrigin.height - callout.height) / 2);\n\t\t\t}\n\t\t\telse if(callout._verticalAlign === VerticalAlign.BOTTOM)\n\t\t\t{\n\t\t\t\tidealYPosition += (globalOrigin.height - callout.height);\n\t\t\t}\n\t\t\tvar yPosition:Number = idealYPosition;\n\t\t\tif(stagePaddingTop > yPosition)\n\t\t\t{\n\t\t\t\tyPosition = stagePaddingTop;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar stage:Stage = callout.stage !== null ? callout.stage : Starling.current.stage;\n\t\t\t\tvar maxYPosition:Number = stage.stageHeight - callout.height - stagePaddingBottom;\n\t\t\t\tif(maxYPosition < yPosition)\n\t\t\t\t{\n\t\t\t\t\tyPosition = maxYPosition;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar point:Point = Pool.getPoint(globalOrigin.x - callout.width, yPosition);\n\t\t\t//we calculate the position in global coordinates, but the callout\n\t\t\t//may be in a container that is offset from the global origin, so\n\t\t\t//adjust for that difference.\n\t\t\tcallout.parent.globalToLocal(point, point);\n\t\t\tcallout.x = point.x - callout._originGap;\n\t\t\tcallout.y = point.y;\n\t\t\tPool.putPoint(point);\n\t\t\tif(callout._isValidating)\n\t\t\t{\n\t\t\t\t//no need to invalidate and need to validate again next frame\n\t\t\t\tcallout._arrowOffset = idealYPosition - yPosition;\n\t\t\t\tcallout._arrowPosition = RelativePosition.RIGHT;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcallout.arrowOffset = idealYPosition - yPosition;\n\t\t\t\tcallout.arrowPosition = RelativePosition.RIGHT;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function Callout()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.addEventListener(Event.ADDED_TO_STAGE, callout_addedToStageHandler);\n\t\t}\n\n\t\t/**\n\t\t * Determines if the callout is automatically closed if a touch in the\n\t\t * <code>TouchPhase.BEGAN</code> phase happens outside of the callout's\n\t\t * or the origin's bounds.\n\t\t *\n\t\t * <p>In the following example, the callout will not close when a touch\n\t\t * event with <code>TouchPhase.BEGAN</code> is detected outside the\n\t\t * callout's (or its origin's) bounds:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * callout.closeOnTouchBeganOutside = false;</listing>\n\t\t *\n\t\t * @see #closeOnTouchEndedOutside\n\t\t * @see #closeOnKeys\n\t\t */\n\t\tpublic var closeOnTouchBeganOutside:Boolean = false;\n\n\t\t/**\n\t\t * Determines if the callout is automatically closed if a touch in the\n\t\t * <code>TouchPhase.ENDED</code> phase happens outside of the callout's\n\t\t * or the origin's bounds.\n\t\t *\n\t\t * <p>In the following example, the callout will not close when a touch\n\t\t * event with <code>TouchPhase.ENDED</code> is detected outside the\n\t\t * callout's (or its origin's) bounds:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * callout.closeOnTouchEndedOutside = false;</listing>\n\t\t *\n\t\t * @see #closeOnTouchBeganOutside\n\t\t * @see #closeOnKeys\n\t\t */\n\t\tpublic var closeOnTouchEndedOutside:Boolean = false;\n\n\t\t/**\n\t\t * The callout will be closed if any of these keys are pressed.\n\t\t *\n\t\t * <p>In the following example, the callout close when the Escape key\n\t\t * is pressed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * callout.closeOnKeys = new &lt;uint&gt;[Keyboard.ESCAPE];</listing>\n\t\t *\n\t\t * @see #closeOnTouchBeganOutside\n\t\t * @see #closeOnTouchEndedOutside\n\t\t */\n\t\tpublic var closeOnKeys:Vector.<uint>;\n\n\t\t/**\n\t\t * Determines if the callout will be disposed when <code>close()</code>\n\t\t * is called internally. Close may be called internally in a variety of\n\t\t * cases, depending on values such as <code>closeOnTouchBeganOutside</code>,\n\t\t * <code>closeOnTouchEndedOutside</code>, and <code>closeOnKeys</code>.\n\t\t * If set to <code>false</code>, you may reuse the callout later by\n\t\t * giving it a new <code>origin</code> and adding it to the\n\t\t * <code>PopUpManager</code> again.\n\t\t *\n\t\t * <p>In the following example, the callout will not be disposed when it\n\t\t * closes itself:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * callout.disposeOnSelfClose = false;</listing>\n\t\t *\n\t\t * @see #closeOnTouchBeganOutside\n\t\t * @see #closeOnTouchEndedOutside\n\t\t * @see #closeOnKeys\n\t\t * @see #close()\n\t\t */\n\t\tpublic var disposeOnSelfClose:Boolean = true;\n\n\t\t/**\n\t\t * Determines if the callout's content will be disposed when the callout\n\t\t * is disposed. If set to <code>false</code>, the callout's content may\n\t\t * be added to the display list again later.\n\t\t *\n\t\t * <p>In the following example, the callout's content will not be\n\t\t * disposed when the callout is disposed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * callout.disposeContent = false;</listing>\n\t\t */\n\t\tpublic var disposeContent:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isReadyToClose:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn Callout.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitContentWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitContentHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitContentMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitContentMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitContentMaxWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitContentMaxHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundSkinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundSkinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundSkinMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundSkinMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundSkinMaxWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundSkinMaxHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _content:DisplayObject;\n\n\t\t/**\n\t\t * The display object that will be presented by the callout. This object\n\t\t * may be resized to fit the callout's bounds. If the content needs to\n\t\t * be scrolled if placed into a smaller region than its ideal size, it\n\t\t * must provide its own scrolling capabilities because the callout does\n\t\t * not offer scrolling.\n\t\t *\n\t\t * <p>In the following example, the callout's content is an image:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * callout.content = new Image( texture );</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get content():DisplayObject\n\t\t{\n\t\t\treturn this._content;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set content(value:DisplayObject):void\n\t\t{\n\t\t\tif(this._content == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._content !== null)\n\t\t\t{\n\t\t\t\tif(this._content is IFeathersControl)\n\t\t\t\t{\n\t\t\t\t\tIFeathersControl(this._content).removeEventListener(FeathersEventType.RESIZE, content_resizeHandler);\n\t\t\t\t}\n\t\t\t\tif(this._content.parent === this)\n\t\t\t\t{\n\t\t\t\t\tthis._content.width = this._explicitContentWidth;\n\t\t\t\t\tthis._content.height = this._explicitContentHeight;\n\t\t\t\t\tif(this._content is IMeasureDisplayObject)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar measureContent:IMeasureDisplayObject = IMeasureDisplayObject(this._content);\n\t\t\t\t\t\tmeasureContent.minWidth = this._explicitContentMinWidth;\n\t\t\t\t\t\tmeasureContent.minHeight = this._explicitContentMinHeight;\n\t\t\t\t\t\tmeasureContent.maxWidth = this._explicitContentMaxWidth;\n\t\t\t\t\t\tmeasureContent.maxHeight = this._explicitContentMaxHeight;\n\t\t\t\t\t}\n\t\t\t\t\tthis._content.removeFromParent(false);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._content = value;\n\t\t\tif(this._content !== null)\n\t\t\t{\n\t\t\t\tif(this._content is IFeathersControl)\n\t\t\t\t{\n\t\t\t\t\tIFeathersControl(this._content).addEventListener(FeathersEventType.RESIZE, content_resizeHandler);\n\t\t\t\t}\n\t\t\t\tthis.addChild(this._content);\n\t\t\t\tif(this._content is IFeathersControl)\n\t\t\t\t{\n\t\t\t\t\tIFeathersControl(this._content).initializeNow();\n\t\t\t\t}\n\t\t\t\tif(this._content is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tmeasureContent = IMeasureDisplayObject(this._content);\n\t\t\t\t\tthis._explicitContentWidth = measureContent.explicitWidth;\n\t\t\t\t\tthis._explicitContentHeight = measureContent.explicitHeight;\n\t\t\t\t\tthis._explicitContentMinWidth = measureContent.explicitMinWidth;\n\t\t\t\t\tthis._explicitContentMinHeight = measureContent.explicitMinHeight;\n\t\t\t\t\tthis._explicitContentMaxWidth = measureContent.explicitMaxWidth;\n\t\t\t\t\tthis._explicitContentMaxHeight = measureContent.explicitMaxHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._explicitContentWidth = this._content.width;\n\t\t\t\t\tthis._explicitContentHeight = this._content.height;\n\t\t\t\t\tthis._explicitContentMinWidth = this._explicitContentWidth;\n\t\t\t\t\tthis._explicitContentMinHeight = this._explicitContentHeight;\n\t\t\t\t\tthis._explicitContentMaxWidth = this._explicitContentWidth;\n\t\t\t\t\tthis._explicitContentMaxHeight = this._explicitContentHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _origin:DisplayObject;\n\n\t\t/**\n\t\t * A callout may be positioned relative to another display object, known\n\t\t * as the callout's origin. Even if the position of the origin changes,\n\t\t * the callout will reposition itself to always point at the origin.\n\t\t *\n\t\t * <p>When an origin is set, the <code>arrowPosition</code> and\n\t\t * <code>arrowOffset</code> properties will be managed automatically by\n\t\t * the callout. Setting either of these values manually will either have\n\t\t * no effect or unexpected behavior, so it is recommended that you\n\t\t * avoid modifying those properties.</p>\n\t\t *\n\t\t * <p>Note: The <code>origin</code> is excluded when using\n\t\t * <code>closeOnTouchBeganOutside</code> and <code>closeOnTouchEndedOutside</code>.\n\t\t * In other words, when the origin is touched, and either of these\n\t\t * properties is <code>true</code>, the callout will not be closed. If\n\t\t * the callout is not displayed modally, and touching the origin opens\n\t\t * the callout, you should check if a callout is already visible. If a\n\t\t * callout is visible, close it. If no callouts are visible, show one.\n\t\t * However, if the callout is modal, the touch will be stopped by the\n\t\t * overlay before it reaches the origin, so this behavior will not apply.</p>\n\t\t *\n\t\t * <p>In general, if you use <code>Callout.show()</code>, you will\n\t\t * rarely need to manually manage the <code>origin</code> property.</p>\n\t\t *\n\t\t * <p>In the following example, the callout's origin is set to a button:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * callout.origin = button;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.Callout#show()\n\t\t * @see #supportedPositions\n\t\t */\n\t\tpublic function get origin():DisplayObject\n\t\t{\n\t\t\treturn this._origin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set origin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this._origin == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value && !value.stage)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"Callout origin must have access to the stage.\");\n\t\t\t}\n\t\t\tif(this._origin)\n\t\t\t{\n\t\t\t\tthis.removeEventListener(EnterFrameEvent.ENTER_FRAME, callout_enterFrameHandler);\n\t\t\t\tthis._origin.removeEventListener(Event.REMOVED_FROM_STAGE, origin_removedFromStageHandler);\n\t\t\t}\n\t\t\tthis._origin = value;\n\t\t\tthis._lastGlobalBoundsOfOrigin = null;\n\t\t\tif(this._origin)\n\t\t\t{\n\t\t\t\tthis._origin.addEventListener(Event.REMOVED_FROM_STAGE, origin_removedFromStageHandler);\n\t\t\t\tthis.addEventListener(EnterFrameEvent.ENTER_FRAME, callout_enterFrameHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ORIGIN);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _supportedPositions:Vector.<String> = null;\n\n\t\t/**\n\t\t * The position of the callout, relative to its origin. Accepts a\n\t\t * <code>Vector.&lt;String&gt;</code> containing one or more of the\n\t\t * constants from <code>feathers.layout.RelativePosition</code> or\n\t\t * <code>null</code>. If <code>null</code>, the callout will attempt to\n\t\t * position itself using values in the following order:\n\t\t *\n\t\t * <ul>\n\t\t *     <li><code>RelativePosition.BOTTOM</code></li>\n\t\t *     <li><code>RelativePosition.TOP</code></li>\n\t\t *     <li><code>RelativePosition.RIGHT</code></li>\n\t\t *     <li><code>RelativePosition.LEFT</code></li>\n\t\t * </ul>\n\t\t *\n\t\t * <p>Note: If the callout's origin is not set, the\n\t\t * <code>supportedPositions</code> property will be ignored.</p>\n\t\t *\n\t\t * <p>In the following example, the callout's supported positions are\n\t\t * restricted to the top and bottom of the origin:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * callout.supportedPositions = new &lt;String&gt;[RelativePosition.TOP, RelativePosition.BOTTOM];</listing>\n\t\t *\n\t\t * <p>In the following example, the callout's position is restricted to\n\t\t * the right of the origin:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * callout.supportedPositions = new &lt;String&gt;[RelativePosition.RIGHT];</listing>\n\t\t *\n\t\t * <p>Note: The <code>arrowPosition</code> property is related to this\n\t\t * one, but they have different meanings and are usually opposites. For\n\t\t * example, a callout on the right side of its origin will generally\n\t\t * display its left arrow.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.layout.RelativePosition#TOP\n\t\t * @see feathers.layout.RelativePosition#RIGHT\n\t\t * @see feathers.layout.RelativePosition#BOTTOM\n\t\t * @see feathers.layout.RelativePosition#LEFT\n\t\t */\n\t\tpublic function get supportedPositions():Vector.<String>\n\t\t{\n\t\t\treturn this._supportedPositions;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set supportedPositions(value:Vector.<String>):void\n\t\t{\n\t\t\tthis._supportedPositions = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalAlign:String = HorizontalAlign.CENTER;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get horizontalAlign():String\n\t\t{\n\t\t\treturn this._horizontalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalAlign(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._horizontalAlign === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalAlign = value;\n\t\t\tthis._lastGlobalBoundsOfOrigin = null;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ORIGIN);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalAlign:String = VerticalAlign.MIDDLE;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get verticalAlign():String\n\t\t{\n\t\t\treturn this._verticalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalAlign(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._verticalAlign === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalAlign = value;\n\t\t\tthis._lastGlobalBoundsOfOrigin = null;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ORIGIN);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get padding():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set padding(value:Number):void\n\t\t{\n\t\t\tthis.paddingTop = value;\n\t\t\tthis.paddingRight = value;\n\t\t\tthis.paddingBottom = value;\n\t\t\tthis.paddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingTop:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingTop():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingTop(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingTop = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingRight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingRight():Number\n\t\t{\n\t\t\treturn this._paddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingRight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingBottom:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingBottom():Number\n\t\t{\n\t\t\treturn this._paddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingBottom = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingLeft:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingLeft = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _arrowPosition:String = RelativePosition.TOP;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"top,right,bottom,left\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get arrowPosition():String\n\t\t{\n\t\t\treturn this._arrowPosition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set arrowPosition(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._arrowPosition === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._arrowPosition = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _backgroundSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundSkin():DisplayObject\n\t\t{\n\t\t\treturn this._backgroundSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSkin !== null && this._backgroundSkin.parent === this)\n\t\t\t{\n\t\t\t\t//we need to restore these values so that they won't be lost the\n\t\t\t\t//next time that this skin is used for measurement\n\t\t\t\tthis._backgroundSkin.width = this._explicitBackgroundSkinWidth;\n\t\t\t\tthis._backgroundSkin.height = this._explicitBackgroundSkinHeight;\n\t\t\t\tif(this._backgroundSkin is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar measureSkin:IMeasureDisplayObject = IMeasureDisplayObject(this._backgroundSkin);\n\t\t\t\t\tmeasureSkin.minWidth = this._explicitBackgroundSkinMinWidth;\n\t\t\t\t\tmeasureSkin.minHeight = this._explicitBackgroundSkinMinHeight;\n\t\t\t\t\tmeasureSkin.maxWidth = this._explicitBackgroundSkinMaxWidth;\n\t\t\t\t\tmeasureSkin.maxHeight = this._explicitBackgroundSkinMaxHeight;\n\t\t\t\t}\n\t\t\t\tthis._backgroundSkin.removeFromParent(false);\n\t\t\t}\n\t\t\tthis._backgroundSkin = value;\n\t\t\tif(this._backgroundSkin !== null)\n\t\t\t{\n\t\t\t\tif(this._backgroundSkin is IFeathersControl)\n\t\t\t\t{\n\t\t\t\t\tIFeathersControl(this._backgroundSkin).initializeNow();\n\t\t\t\t}\n\t\t\t\tif(this._backgroundSkin is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tmeasureSkin = IMeasureDisplayObject(this._backgroundSkin);\n\t\t\t\t\tthis._explicitBackgroundSkinWidth = measureSkin.explicitWidth;\n\t\t\t\t\tthis._explicitBackgroundSkinHeight = measureSkin.explicitHeight;\n\t\t\t\t\tthis._explicitBackgroundSkinMinWidth = measureSkin.explicitMinWidth;\n\t\t\t\t\tthis._explicitBackgroundSkinMinHeight = measureSkin.explicitMinHeight;\n\t\t\t\t\tthis._explicitBackgroundSkinMaxWidth = measureSkin.explicitMaxWidth;\n\t\t\t\t\tthis._explicitBackgroundSkinMaxHeight = measureSkin.explicitMaxHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._explicitBackgroundSkinWidth = this._backgroundSkin.width;\n\t\t\t\t\tthis._explicitBackgroundSkinHeight = this._backgroundSkin.height;\n\t\t\t\t\tthis._explicitBackgroundSkinMinWidth = this._explicitBackgroundSkinWidth;\n\t\t\t\t\tthis._explicitBackgroundSkinMinHeight = this._explicitBackgroundSkinHeight;\n\t\t\t\t\tthis._explicitBackgroundSkinMaxWidth = this._explicitBackgroundSkinWidth;\n\t\t\t\t\tthis._explicitBackgroundSkinMaxHeight = this._explicitBackgroundSkinHeight;\n\t\t\t\t}\n\t\t\t\tthis.addChildAt(this._backgroundSkin, 0);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var currentArrowSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _topArrowSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get topArrowSkin():DisplayObject\n\t\t{\n\t\t\treturn this._topArrowSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set topArrowSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._topArrowSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._topArrowSkin !== null && this._topArrowSkin.parent === this)\n\t\t\t{\n\t\t\t\tthis._topArrowSkin.removeFromParent(false);\n\t\t\t}\n\t\t\tthis._topArrowSkin = value;\n\t\t\tif(this._topArrowSkin !== null)\n\t\t\t{\n\t\t\t\tthis._topArrowSkin.visible = false;\n\t\t\t\tvar index:int = this.getChildIndex(this._content);\n\t\t\t\tif(index < 0)\n\t\t\t\t{\n\t\t\t\t\tthis.addChild(this._topArrowSkin);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.addChildAt(this._topArrowSkin, index);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _rightArrowSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get rightArrowSkin():DisplayObject\n\t\t{\n\t\t\treturn this._rightArrowSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set rightArrowSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._rightArrowSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._rightArrowSkin !== null && this._rightArrowSkin.parent === this)\n\t\t\t{\n\t\t\t\tthis._rightArrowSkin.removeFromParent(false);\n\t\t\t}\n\t\t\tthis._rightArrowSkin = value;\n\t\t\tif(this._rightArrowSkin !== null)\n\t\t\t{\n\t\t\t\tthis._rightArrowSkin.visible = false;\n\t\t\t\tvar index:int = this.getChildIndex(this._content);\n\t\t\t\tif(index < 0)\n\t\t\t\t{\n\t\t\t\t\tthis.addChild(this._rightArrowSkin);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.addChildAt(this._rightArrowSkin, index);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _bottomArrowSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get bottomArrowSkin():DisplayObject\n\t\t{\n\t\t\treturn this._bottomArrowSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set bottomArrowSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._bottomArrowSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._bottomArrowSkin !== null && this._bottomArrowSkin.parent === this)\n\t\t\t{\n\t\t\t\tthis._bottomArrowSkin.removeFromParent(false);\n\t\t\t}\n\t\t\tthis._bottomArrowSkin = value;\n\t\t\tif(this._bottomArrowSkin !== null)\n\t\t\t{\n\t\t\t\tthis._bottomArrowSkin.visible = false;\n\t\t\t\tvar index:int = this.getChildIndex(this._content);\n\t\t\t\tif(index < 0)\n\t\t\t\t{\n\t\t\t\t\tthis.addChild(this._bottomArrowSkin);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.addChildAt(this._bottomArrowSkin, index);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _leftArrowSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get leftArrowSkin():DisplayObject\n\t\t{\n\t\t\treturn this._leftArrowSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set leftArrowSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._leftArrowSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._leftArrowSkin !== null && this._leftArrowSkin.parent === this)\n\t\t\t{\n\t\t\t\tthis._leftArrowSkin.removeFromParent(false);\n\t\t\t}\n\t\t\tthis._leftArrowSkin = value;\n\t\t\tif(this._leftArrowSkin !== null)\n\t\t\t{\n\t\t\t\tthis._leftArrowSkin.visible = false;\n\t\t\t\tvar index:int = this.getChildIndex(this._content);\n\t\t\t\tif(index < 0)\n\t\t\t\t{\n\t\t\t\t\tthis.addChild(this._leftArrowSkin);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.addChildAt(this._leftArrowSkin, index);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _originGap:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get originGap():Number\n\t\t{\n\t\t\treturn this._originGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set originGap(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._originGap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._originGap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _topArrowGap:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get topArrowGap():Number\n\t\t{\n\t\t\treturn this._topArrowGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set topArrowGap(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._topArrowGap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._topArrowGap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _bottomArrowGap:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get bottomArrowGap():Number\n\t\t{\n\t\t\treturn this._bottomArrowGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set bottomArrowGap(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._bottomArrowGap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._bottomArrowGap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _rightArrowGap:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get rightArrowGap():Number\n\t\t{\n\t\t\treturn this._rightArrowGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set rightArrowGap(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._rightArrowGap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._rightArrowGap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _leftArrowGap:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get leftArrowGap():Number\n\t\t{\n\t\t\treturn this._leftArrowGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set leftArrowGap(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._leftArrowGap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._leftArrowGap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _arrowOffset:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get arrowOffset():Number\n\t\t{\n\t\t\treturn this._arrowOffset;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set arrowOffset(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._arrowOffset == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._arrowOffset = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastGlobalBoundsOfOrigin:Rectangle;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _ignoreContentResize:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tthis.origin = null;\n\t\t\tvar savedContent:DisplayObject = this._content;\n\t\t\tthis.content = null;\n\t\t\t//remove the content safely if it should not be disposed\n\t\t\tif(savedContent !== null && this.disposeContent)\n\t\t\t{\n\t\t\t\tsavedContent.dispose();\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * Closes the callout.\n\t\t */\n\t\tpublic function close(dispose:Boolean = false):void\n\t\t{\n\t\t\tif(this.parent)\n\t\t\t{\n\t\t\t\t//don't dispose here because we need to keep the event listeners\n\t\t\t\t//when dispatching Event.CLOSE. we'll dispose after that.\n\t\t\t\tthis.removeFromParent(false);\n\t\t\t\tthis.dispatchEventWith(Event.CLOSE);\n\t\t\t}\n\t\t\tif(dispose)\n\t\t\t{\n\t\t\t\tthis.dispose();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tthis.addEventListener(Event.REMOVED_FROM_STAGE, callout_removedFromStageHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar originInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_ORIGIN);\n\n\t\t\tif(sizeInvalid)\n\t\t\t{\n\t\t\t\tthis._lastGlobalBoundsOfOrigin = null;\n\t\t\t\toriginInvalid = true;\n\t\t\t}\n\n\t\t\tif(originInvalid)\n\t\t\t{\n\t\t\t\tthis.positionRelativeToOrigin();\n\t\t\t}\n\n\t\t\tif(stylesInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshArrowSkin();\n\t\t\t}\n\n\t\t\tif(stateInvalid || dataInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshEnabled();\n\t\t\t}\n\n\t\t\tsizeInvalid = this.autoSizeIfNeeded() || sizeInvalid;\n\n\t\t\tthis.layoutChildren();\n\t\t}\n\n\t\t/**\n\t\t * If the component's dimensions have not been set explicitly, it will\n\t\t * measure its content and determine an ideal size for itself. If the\n\t\t * <code>explicitWidth</code> or <code>explicitHeight</code> member\n\t\t * variables are set, those value will be used without additional\n\t\t * measurement. If one is set, but not the other, the dimension with the\n\t\t * explicit value will not be measured, but the other non-explicit\n\t\t * dimension will still need measurement.\n\t\t *\n\t\t * <p>Calls <code>saveMeasurements()</code> to set up the\n\t\t * <code>actualWidth</code> and <code>actualHeight</code> member\n\t\t * variables used for layout.</p>\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t */\n\t\tprotected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\treturn this.measureWithArrowPosition(this._arrowPosition);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function measureWithArrowPosition(arrowPosition:String):Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t//the dimensions of the stage (plus stage padding) affect the\n\t\t\t//maximum width and height\n\t\t\tvar maxWidth:Number = this._explicitMaxWidth;\n\t\t\tvar maxHeight:Number = this._explicitMaxHeight;\n\t\t\tif(this.stage !== null)\n\t\t\t{\n\t\t\t\tvar stageMaxWidth:Number = this.stage.stageWidth - stagePaddingLeft - stagePaddingRight;\n\t\t\t\tif(maxWidth > stageMaxWidth)\n\t\t\t\t{\n\t\t\t\t\tmaxWidth = stageMaxWidth;\n\t\t\t\t}\n\t\t\t\tvar stageMaxHeight:Number = this.stage.stageHeight - stagePaddingTop - stagePaddingBottom;\n\t\t\t\tif(maxHeight > stageMaxHeight)\n\t\t\t\t{\n\t\t\t\t\tmaxHeight = stageMaxHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(this._backgroundSkin !== null)\n\t\t\t{\n\t\t\t\tvar oldBackgroundWidth:Number = this._backgroundSkin.width;\n\t\t\t\tvar oldBackgroundHeight:Number = this._backgroundSkin.height;\n\t\t\t}\n\t\t\tvar measureBackground:IMeasureDisplayObject = this._backgroundSkin as IMeasureDisplayObject;\n\t\t\tresetFluidChildDimensionsForMeasurement(this._backgroundSkin,\n\t\t\t\tthis._explicitWidth, this._explicitHeight,\n\t\t\t\tthis._explicitMinWidth, this._explicitMinHeight,\n\t\t\t\tmaxWidth, maxHeight,\n\t\t\t\tthis._explicitBackgroundSkinWidth, this._explicitBackgroundSkinHeight,\n\t\t\t\tthis._explicitBackgroundSkinMinWidth, this._explicitBackgroundSkinMinHeight,\n\t\t\t\tthis._explicitBackgroundSkinMaxWidth, this._explicitBackgroundSkinMaxHeight);\n\t\t\tif(this._backgroundSkin is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this._backgroundSkin).validate();\n\t\t\t}\n\n\t\t\tvar leftOrRightArrowWidth:Number = 0;\n\t\t\tvar leftOrRightArrowHeight:Number = 0;\n\t\t\tif(arrowPosition === RelativePosition.LEFT && this._leftArrowSkin !== null)\n\t\t\t{\n\t\t\t\tleftOrRightArrowWidth = this._leftArrowSkin.width + this._leftArrowGap + this._originGap;\n\t\t\t\tleftOrRightArrowHeight = this._leftArrowSkin.height;\n\t\t\t}\n\t\t\telse if(arrowPosition === RelativePosition.RIGHT && this._rightArrowSkin !== null)\n\t\t\t{\n\t\t\t\tleftOrRightArrowWidth = this._rightArrowSkin.width + this._rightArrowGap + this._originGap;\n\t\t\t\tleftOrRightArrowHeight = this._rightArrowSkin.height;\n\t\t\t}\n\t\t\tvar topOrBottomArrowWidth:Number = 0;\n\t\t\tvar topOrBottomArrowHeight:Number = 0;\n\t\t\tif(arrowPosition === RelativePosition.TOP && this._topArrowSkin !== null)\n\t\t\t{\n\t\t\t\ttopOrBottomArrowWidth = this._topArrowSkin.width;\n\t\t\t\ttopOrBottomArrowHeight = this._topArrowSkin.height + this._topArrowGap + this._originGap;\n\t\t\t}\n\t\t\telse if(arrowPosition === RelativePosition.BOTTOM && this._bottomArrowSkin !== null)\n\t\t\t{\n\t\t\t\ttopOrBottomArrowWidth = this._bottomArrowSkin.width;\n\t\t\t\ttopOrBottomArrowHeight = this._bottomArrowSkin.height + this._bottomArrowGap + this._originGap;\n\t\t\t}\n\t\t\t//the content resizes when the callout resizes, so we can treat it\n\t\t\t//similarly to a background skin\n\t\t\tvar oldIgnoreContentResize:Boolean = this._ignoreContentResize;\n\t\t\tthis._ignoreContentResize = true;\n\t\t\tif(this._content !== null)\n\t\t\t{\n\t\t\t\t//we need to restore these after measurement\n\t\t\t\tvar oldContentWidth:Number = this._content.width;\n\t\t\t\tvar oldContentHeight:Number = this._content.height;\n\t\t\t}\n\t\t\tvar measureContent:IMeasureDisplayObject = this._content as IMeasureDisplayObject;\n\t\t\tresetFluidChildDimensionsForMeasurement(this._content,\n\t\t\t\tthis._explicitWidth - leftOrRightArrowWidth - this._paddingLeft - this._paddingRight,\n\t\t\t\tthis._explicitHeight - topOrBottomArrowHeight - this._paddingTop - this._paddingBottom,\n\t\t\t\tthis._explicitMinWidth - leftOrRightArrowWidth - this._paddingLeft - this._paddingRight,\n\t\t\t\tthis._explicitMinHeight - topOrBottomArrowHeight - this._paddingTop - this._paddingBottom,\n\t\t\t\tmaxWidth - leftOrRightArrowHeight - this._paddingLeft - this._paddingRight,\n\t\t\t\tmaxHeight - topOrBottomArrowHeight - this._paddingTop - this._paddingBottom,\n\t\t\t\tthis._explicitContentWidth, this._explicitContentHeight,\n\t\t\t\tthis._explicitContentMinWidth, this._explicitContentMinHeight,\n\t\t\t\tthis._explicitContentMaxWidth, this._explicitContentMaxHeight);\n\t\t\tif(this._content is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this._content).validate();\n\t\t\t}\n\t\t\tthis._ignoreContentResize = oldIgnoreContentResize;\n\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tvar contentWidth:Number = 0;\n\t\t\t\tif(this._content !== null)\n\t\t\t\t{\n\t\t\t\t\tcontentWidth = this._content.width;\n\t\t\t\t}\n\t\t\t\tif(topOrBottomArrowWidth > contentWidth)\n\t\t\t\t{\n\t\t\t\t\tcontentWidth = topOrBottomArrowWidth;\n\t\t\t\t}\n\t\t\t\tnewWidth = contentWidth + this._paddingLeft + this._paddingRight;\n\t\t\t\tvar backgroundWidth:Number = 0;\n\t\t\t\tif(this._backgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tbackgroundWidth = this._backgroundSkin.width;\n\t\t\t\t}\n\t\t\t\tif(backgroundWidth > newWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = backgroundWidth;\n\t\t\t\t}\n\t\t\t\tnewWidth += leftOrRightArrowWidth;\n\t\t\t\tif(newWidth > maxWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = maxWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tvar contentHeight:Number = 0;\n\t\t\t\tif(this._content !== null)\n\t\t\t\t{\n\t\t\t\t\tcontentHeight = this._content.height;\n\t\t\t\t}\n\t\t\t\tif(leftOrRightArrowHeight > contentWidth)\n\t\t\t\t{\n\t\t\t\t\tcontentHeight = leftOrRightArrowHeight;\n\t\t\t\t}\n\t\t\t\tnewHeight = contentHeight + this._paddingTop + this._paddingBottom;\n\t\t\t\tvar backgroundHeight:Number = 0;\n\t\t\t\tif(this._backgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tbackgroundHeight = this._backgroundSkin.height;\n\t\t\t\t}\n\t\t\t\tif(backgroundHeight > newHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = backgroundHeight;\n\t\t\t\t}\n\t\t\t\tnewHeight += topOrBottomArrowHeight;\n\t\t\t\tif(newHeight > maxHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = maxHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tvar contentMinWidth:Number = 0;\n\t\t\t\tif(measureContent !== null)\n\t\t\t\t{\n\t\t\t\t\tcontentMinWidth = measureContent.minWidth;\n\t\t\t\t}\n\t\t\t\telse if(this._content !== null)\n\t\t\t\t{\n\t\t\t\t\tcontentMinWidth = this._content.width;\n\t\t\t\t}\n\t\t\t\tif(topOrBottomArrowWidth > contentMinWidth)\n\t\t\t\t{\n\t\t\t\t\tcontentMinWidth = topOrBottomArrowWidth;\n\t\t\t\t}\n\t\t\t\tnewMinWidth = contentMinWidth + this._paddingLeft + this._paddingRight;\n\t\t\t\tvar backgroundMinWidth:Number = 0;\n\t\t\t\tif(measureBackground !== null)\n\t\t\t\t{\n\t\t\t\t\tbackgroundMinWidth = measureBackground.minWidth;\n\t\t\t\t}\n\t\t\t\telse if(this._backgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tbackgroundMinWidth = this._explicitBackgroundSkinMinWidth;\n\t\t\t\t}\n\t\t\t\tif(backgroundMinWidth > newMinWidth)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = backgroundMinWidth;\n\t\t\t\t}\n\t\t\t\tnewMinWidth += leftOrRightArrowWidth;\n\t\t\t\tif(newMinWidth > maxWidth)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = maxWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar newMinHeight:Number = this._explicitHeight;\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tvar contentMinHeight:Number = 0;\n\t\t\t\tif(measureContent !== null)\n\t\t\t\t{\n\t\t\t\t\tcontentMinHeight = measureContent.minHeight;\n\t\t\t\t}\n\t\t\t\telse if(this._content !== null)\n\t\t\t\t{\n\t\t\t\t\tcontentMinHeight = this._content.height;\n\t\t\t\t}\n\t\t\t\tif(leftOrRightArrowHeight > contentMinHeight)\n\t\t\t\t{\n\t\t\t\t\tcontentMinHeight = leftOrRightArrowHeight;\n\t\t\t\t}\n\t\t\t\tnewMinHeight = contentMinHeight + this._paddingTop + this._paddingBottom;\n\t\t\t\tvar backgroundMinHeight:Number = 0;\n\t\t\t\tif(measureBackground !== null)\n\t\t\t\t{\n\t\t\t\t\tbackgroundMinHeight = measureBackground.minHeight;\n\t\t\t\t}\n\t\t\t\telse if(this._backgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tbackgroundMinHeight = this._explicitBackgroundSkinMinHeight;\n\t\t\t\t}\n\t\t\t\tif(backgroundMinHeight > newMinHeight)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = backgroundMinHeight;\n\t\t\t\t}\n\t\t\t\tnewMinHeight += topOrBottomArrowHeight;\n\t\t\t\tif(newMinHeight > maxHeight)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = maxHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._backgroundSkin !== null)\n\t\t\t{\n\t\t\t\tthis._backgroundSkin.width = oldBackgroundWidth;\n\t\t\t\tthis._backgroundSkin.height = oldBackgroundHeight;\n\t\t\t}\n\t\t\tif(this._content !== null)\n\t\t\t{\n\t\t\t\toldIgnoreContentResize = this._ignoreContentResize;\n\t\t\t\tthis._ignoreContentResize = true;\n\t\t\t\tthis._content.width = oldContentWidth;\n\t\t\t\tthis._content.height = oldContentHeight;\n\t\t\t\tthis._ignoreContentResize = oldIgnoreContentResize;\n\t\t\t}\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshArrowSkin():void\n\t\t{\n\t\t\tthis.currentArrowSkin = null;\n\t\t\tif(this._arrowPosition == RelativePosition.BOTTOM)\n\t\t\t{\n\t\t\t\tthis.currentArrowSkin = this._bottomArrowSkin;\n\t\t\t}\n\t\t\telse if(this._bottomArrowSkin)\n\t\t\t{\n\t\t\t\tthis._bottomArrowSkin.visible = false;\n\t\t\t}\n\t\t\tif(this._arrowPosition == RelativePosition.TOP)\n\t\t\t{\n\t\t\t\tthis.currentArrowSkin = this._topArrowSkin;\n\t\t\t}\n\t\t\telse if(this._topArrowSkin)\n\t\t\t{\n\t\t\t\tthis._topArrowSkin.visible = false;\n\t\t\t}\n\t\t\tif(this._arrowPosition == RelativePosition.LEFT)\n\t\t\t{\n\t\t\t\tthis.currentArrowSkin = this._leftArrowSkin;\n\t\t\t}\n\t\t\telse if(this._leftArrowSkin)\n\t\t\t{\n\t\t\t\tthis._leftArrowSkin.visible = false;\n\t\t\t}\n\t\t\tif(this._arrowPosition == RelativePosition.RIGHT)\n\t\t\t{\n\t\t\t\tthis.currentArrowSkin = this._rightArrowSkin;\n\t\t\t}\n\t\t\telse if(this._rightArrowSkin)\n\t\t\t{\n\t\t\t\tthis._rightArrowSkin.visible = false;\n\t\t\t}\n\t\t\tif(this.currentArrowSkin)\n\t\t\t{\n\t\t\t\tthis.currentArrowSkin.visible = true;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshEnabled():void\n\t\t{\n\t\t\tif(this._content is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this._content).isEnabled = this._isEnabled;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutChildren():void\n\t\t{\n\t\t\tvar xPosition:Number = 0;\n\t\t\tif(this._leftArrowSkin !== null && this._arrowPosition === RelativePosition.LEFT)\n\t\t\t{\n\t\t\t\txPosition = this._leftArrowSkin.width + this._leftArrowGap;\n\t\t\t}\n\t\t\tvar yPosition:Number = 0;\n\t\t\tif(this._topArrowSkin !== null && this._arrowPosition === RelativePosition.TOP)\n\t\t\t{\n\t\t\t\tyPosition = this._topArrowSkin.height + this._topArrowGap;\n\t\t\t}\n\t\t\tvar widthOffset:Number = 0;\n\t\t\tif(this._rightArrowSkin !== null && this._arrowPosition === RelativePosition.RIGHT)\n\t\t\t{\n\t\t\t\twidthOffset = this._rightArrowSkin.width + this._rightArrowGap;\n\t\t\t}\n\t\t\tvar heightOffset:Number = 0;\n\t\t\tif(this._bottomArrowSkin !== null && this._arrowPosition === RelativePosition.BOTTOM)\n\t\t\t{\n\t\t\t\theightOffset = this._bottomArrowSkin.height + this._bottomArrowGap;\n\t\t\t}\n\t\t\tvar backgroundWidth:Number = this.actualWidth - xPosition - widthOffset;\n\t\t\tvar backgroundHeight:Number = this.actualHeight - yPosition - heightOffset;\n\t\t\tif(this._backgroundSkin !== null)\n\t\t\t{\n\t\t\t\tthis._backgroundSkin.x = xPosition;\n\t\t\t\tthis._backgroundSkin.y = yPosition;\n\t\t\t\tthis._backgroundSkin.width = backgroundWidth;\n\t\t\t\tthis._backgroundSkin.height = backgroundHeight;\n\t\t\t}\n\n\t\t\tif(this.currentArrowSkin !== null)\n\t\t\t{\n\t\t\t\tvar contentWidth:Number = backgroundWidth - this._paddingLeft - this._paddingRight;\n\t\t\t\tvar contentHeight:Number = backgroundHeight - this._paddingTop - this._paddingBottom;\n\t\t\t\tif(this._arrowPosition === RelativePosition.LEFT)\n\t\t\t\t{\n\t\t\t\t\tthis._leftArrowSkin.x = xPosition - this._leftArrowSkin.width - this._leftArrowGap;\n\t\t\t\t\tvar leftArrowSkinY:Number = this._arrowOffset + yPosition + this._paddingTop;\n\t\t\t\t\tif(this._verticalAlign === VerticalAlign.MIDDLE)\n\t\t\t\t\t{\n\t\t\t\t\t\tleftArrowSkinY += Math.round((contentHeight - this._leftArrowSkin.height) / 2);\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._verticalAlign === VerticalAlign.BOTTOM)\n\t\t\t\t\t{\n\t\t\t\t\t\tleftArrowSkinY += (contentHeight - this._leftArrowSkin.height);\n\t\t\t\t\t}\n\t\t\t\t\tvar minLeftArrowSkinY:Number = yPosition + this._paddingTop;\n\t\t\t\t\tif(minLeftArrowSkinY > leftArrowSkinY)\n\t\t\t\t\t{\n\t\t\t\t\t\tleftArrowSkinY = minLeftArrowSkinY;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar maxLeftArrowSkinY:Number = yPosition + this._paddingTop + contentHeight - this._leftArrowSkin.height;\n\t\t\t\t\t\tif(maxLeftArrowSkinY < leftArrowSkinY)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tleftArrowSkinY = maxLeftArrowSkinY;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis._leftArrowSkin.y = leftArrowSkinY;\n\t\t\t\t}\n\t\t\t\telse if(this._arrowPosition === RelativePosition.RIGHT)\n\t\t\t\t{\n\t\t\t\t\tthis._rightArrowSkin.x = xPosition + backgroundWidth + this._rightArrowGap;\n\t\t\t\t\tvar rightArrowSkinY:Number = this._arrowOffset + yPosition + this._paddingTop;\n\t\t\t\t\tif(this._verticalAlign === VerticalAlign.MIDDLE)\n\t\t\t\t\t{\n\t\t\t\t\t\trightArrowSkinY += Math.round((contentHeight - this._rightArrowSkin.height) / 2);\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._verticalAlign === VerticalAlign.BOTTOM)\n\t\t\t\t\t{\n\t\t\t\t\t\trightArrowSkinY += (contentHeight - this._rightArrowSkin.height);\n\t\t\t\t\t}\n\t\t\t\t\tvar minRightArrowSkinY:Number = yPosition + this._paddingTop;\n\t\t\t\t\tif(minRightArrowSkinY > rightArrowSkinY)\n\t\t\t\t\t{\n\t\t\t\t\t\trightArrowSkinY = minRightArrowSkinY;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar maxRightArrowSkinY:Number = yPosition + this._paddingTop + contentHeight - this._rightArrowSkin.height;\n\t\t\t\t\t\tif(maxRightArrowSkinY < rightArrowSkinY)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trightArrowSkinY = maxRightArrowSkinY;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis._rightArrowSkin.y = rightArrowSkinY;\n\t\t\t\t}\n\t\t\t\telse if(this._arrowPosition === RelativePosition.BOTTOM)\n\t\t\t\t{\n\t\t\t\t\tvar bottomArrowSkinX:Number = this._arrowOffset + xPosition + this._paddingLeft;\n\t\t\t\t\tif(this._horizontalAlign === HorizontalAlign.CENTER)\n\t\t\t\t\t{\n\t\t\t\t\t\tbottomArrowSkinX += Math.round((contentWidth - this._bottomArrowSkin.width) / 2);\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._horizontalAlign === HorizontalAlign.RIGHT)\n\t\t\t\t\t{\n\t\t\t\t\t\tbottomArrowSkinX += (contentWidth - this._bottomArrowSkin.width);\n\t\t\t\t\t}\n\t\t\t\t\tvar minBottomArrowSkinX:Number = xPosition + this._paddingLeft;\n\t\t\t\t\tif(minBottomArrowSkinX > bottomArrowSkinX)\n\t\t\t\t\t{\n\t\t\t\t\t\tbottomArrowSkinX = minBottomArrowSkinX;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar maxBottomArrowSkinX:Number = xPosition + this._paddingLeft + contentWidth - this._bottomArrowSkin.width;\n\t\t\t\t\t\tif(maxBottomArrowSkinX < bottomArrowSkinX)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbottomArrowSkinX = maxBottomArrowSkinX;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis._bottomArrowSkin.x = bottomArrowSkinX;\n\t\t\t\t\tthis._bottomArrowSkin.y = yPosition + backgroundHeight + this._bottomArrowGap;\n\t\t\t\t}\n\t\t\t\telse //top\n\t\t\t\t{\n\t\t\t\t\tvar topArrowSkinX:Number = this._arrowOffset + xPosition + this._paddingLeft;\n\t\t\t\t\tif(this._horizontalAlign === HorizontalAlign.CENTER)\n\t\t\t\t\t{\n\t\t\t\t\t\ttopArrowSkinX += Math.round((contentWidth - this._topArrowSkin.width) / 2);\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._horizontalAlign === HorizontalAlign.RIGHT)\n\t\t\t\t\t{\n\t\t\t\t\t\ttopArrowSkinX += (contentWidth - this._topArrowSkin.width);\n\t\t\t\t\t}\n\t\t\t\t\tvar minTopArrowSkinX:Number = xPosition + this._paddingLeft;\n\t\t\t\t\tif(minTopArrowSkinX > topArrowSkinX)\n\t\t\t\t\t{\n\t\t\t\t\t\ttopArrowSkinX = minTopArrowSkinX;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar maxTopArrowSkinX:Number = xPosition + this._paddingLeft + contentWidth - this._topArrowSkin.width;\n\t\t\t\t\t\tif(maxTopArrowSkinX < topArrowSkinX)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttopArrowSkinX = maxTopArrowSkinX;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis._topArrowSkin.x = topArrowSkinX;\n\t\t\t\t\tthis._topArrowSkin.y = yPosition - this._topArrowSkin.height - this._topArrowGap;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(this._content !== null)\n\t\t\t{\n\t\t\t\tthis._content.x = xPosition + this._paddingLeft;\n\t\t\t\tthis._content.y = yPosition + this._paddingTop;\n\t\t\t\tvar oldIgnoreContentResize:Boolean = this._ignoreContentResize;\n\t\t\t\tthis._ignoreContentResize = true;\n\t\t\t\tthis._content.width = backgroundWidth - this._paddingLeft - this._paddingRight;\n\t\t\t\tthis._content.height = backgroundHeight - this._paddingTop - this._paddingBottom;\n\t\t\t\tif(this._content is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this._content).validate();\n\t\t\t\t}\n\t\t\t\tthis._ignoreContentResize = oldIgnoreContentResize;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function positionRelativeToOrigin():void\n\t\t{\n\t\t\tif(this._origin === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar stage:Stage = this.stage !== null ? this.stage : Starling.current.stage;\n\t\t\tvar rect:Rectangle = Pool.getRectangle();\n\t\t\tthis._origin.getBounds(stage, rect);\n\t\t\tvar hasGlobalBounds:Boolean = this._lastGlobalBoundsOfOrigin != null;\n\t\t\tif(hasGlobalBounds && this._lastGlobalBoundsOfOrigin.equals(rect))\n\t\t\t{\n\t\t\t\tPool.putRectangle(rect);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!hasGlobalBounds)\n\t\t\t{\n\t\t\t\tthis._lastGlobalBoundsOfOrigin = new Rectangle();\n\t\t\t}\n\t\t\tthis._lastGlobalBoundsOfOrigin.x = rect.x;\n\t\t\tthis._lastGlobalBoundsOfOrigin.y = rect.y;\n\t\t\tthis._lastGlobalBoundsOfOrigin.width = rect.width;\n\t\t\tthis._lastGlobalBoundsOfOrigin.height = rect.height;\n\t\t\tPool.putRectangle(rect);\n\n\t\t\tvar supportedPositions:Vector.<String> = this._supportedPositions;\n\t\t\tif(supportedPositions === null)\n\t\t\t{\n\t\t\t\tsupportedPositions = DEFAULT_POSITIONS;\n\t\t\t}\n\t\t\tvar upSpace:Number = -1;\n\t\t\tvar rightSpace:Number = -1;\n\t\t\tvar downSpace:Number = -1;\n\t\t\tvar leftSpace:Number = -1;\n\t\t\tvar positionsCount:int = supportedPositions.length;\n\t\t\tfor(var i:int = 0; i < positionsCount; i++)\n\t\t\t{\n\t\t\t\tvar position:String = supportedPositions[i];\n\t\t\t\tswitch(position)\n\t\t\t\t{\n\t\t\t\t\tcase RelativePosition.TOP:\n\t\t\t\t\t{\n\t\t\t\t\t\t//arrow is opposite, on bottom side\n\t\t\t\t\t\tthis.measureWithArrowPosition(RelativePosition.BOTTOM);\n\t\t\t\t\t\tupSpace = this._lastGlobalBoundsOfOrigin.y - this.actualHeight;\n\t\t\t\t\t\tif(upSpace >= stagePaddingTop)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpositionAboveOrigin(this, this._lastGlobalBoundsOfOrigin);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(upSpace < 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tupSpace = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase RelativePosition.RIGHT:\n\t\t\t\t\t{\n\t\t\t\t\t\t//arrow is opposite, on left side\n\t\t\t\t\t\tthis.measureWithArrowPosition(RelativePosition.LEFT);\n\t\t\t\t\t\trightSpace = (stage.stageWidth - actualWidth) - (this._lastGlobalBoundsOfOrigin.x + this._lastGlobalBoundsOfOrigin.width);\n\t\t\t\t\t\tif(rightSpace >= stagePaddingRight)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpositionToRightOfOrigin(this, this._lastGlobalBoundsOfOrigin);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(rightSpace < 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trightSpace = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase RelativePosition.LEFT:\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.measureWithArrowPosition(RelativePosition.RIGHT);\n\t\t\t\t\t\tleftSpace = this._lastGlobalBoundsOfOrigin.x - this.actualWidth;\n\t\t\t\t\t\tif(leftSpace >= stagePaddingLeft)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpositionToLeftOfOrigin(this, this._lastGlobalBoundsOfOrigin);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(leftSpace < 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tleftSpace = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tdefault: //bottom\n\t\t\t\t\t{\n\t\t\t\t\t\t//arrow is opposite, on top side\n\t\t\t\t\t\tthis.measureWithArrowPosition(RelativePosition.TOP);\n\t\t\t\t\t\tdownSpace = (stage.stageHeight - this.actualHeight) - (this._lastGlobalBoundsOfOrigin.y + this._lastGlobalBoundsOfOrigin.height);\n\t\t\t\t\t\tif(downSpace >= stagePaddingBottom)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpositionBelowOrigin(this, this._lastGlobalBoundsOfOrigin);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(downSpace < 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdownSpace = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//worst case: pick the side that has the most available space\n\t\t\tif(downSpace != -1 && downSpace >= upSpace &&\n\t\t\t\tdownSpace >= rightSpace && downSpace >= leftSpace)\n\t\t\t{\n\t\t\t\tpositionBelowOrigin(this, this._lastGlobalBoundsOfOrigin);\n\t\t\t}\n\t\t\telse if(upSpace != -1 && upSpace >= rightSpace && upSpace >= leftSpace)\n\t\t\t{\n\t\t\t\tpositionAboveOrigin(this, this._lastGlobalBoundsOfOrigin);\n\t\t\t}\n\t\t\telse if(rightSpace != -1 && rightSpace >= leftSpace)\n\t\t\t{\n\t\t\t\tpositionToRightOfOrigin(this, this._lastGlobalBoundsOfOrigin);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpositionToLeftOfOrigin(this, this._lastGlobalBoundsOfOrigin);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function callout_addedToStageHandler(event:Event):void\n\t\t{\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\t//using priority here is a hack so that objects higher up in the\n\t\t\t//display list have a chance to cancel the event first.\n\t\t\tvar priority:int = -getDisplayObjectDepthFromStage(this);\n\t\t\tstarling.nativeStage.addEventListener(KeyboardEvent.KEY_DOWN, callout_nativeStage_keyDownHandler, false, priority, true);\n\n\t\t\tthis.stage.addEventListener(TouchEvent.TOUCH, stage_touchHandler);\n\t\t\t//to avoid touch events bubbling up to the callout and causing it to\n\t\t\t//close immediately, we wait one frame before allowing it to close\n\t\t\t//based on touches.\n\t\t\tthis._isReadyToClose = false;\n\t\t\tthis.addEventListener(EnterFrameEvent.ENTER_FRAME, callout_oneEnterFrameHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function callout_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tthis.stage.removeEventListener(TouchEvent.TOUCH, stage_touchHandler);\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tstarling.nativeStage.removeEventListener(KeyboardEvent.KEY_DOWN, callout_nativeStage_keyDownHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function callout_oneEnterFrameHandler(event:Event):void\n\t\t{\n\t\t\tthis.removeEventListener(EnterFrameEvent.ENTER_FRAME, callout_oneEnterFrameHandler);\n\t\t\tthis._isReadyToClose = true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function callout_enterFrameHandler(event:EnterFrameEvent):void\n\t\t{\n\t\t\tthis.positionRelativeToOrigin();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tvar target:DisplayObject = DisplayObject(event.target);\n\t\t\tif(!this._isReadyToClose ||\n\t\t\t\t(!this.closeOnTouchEndedOutside && !this.closeOnTouchBeganOutside) || this.contains(target) ||\n\t\t\t\t(PopUpManager.isPopUp(this) && !PopUpManager.isTopLevelPopUp(this)))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this._origin == target || (this._origin is DisplayObjectContainer && DisplayObjectContainer(this._origin).contains(target)))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this.closeOnTouchBeganOutside)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(this.stage, TouchPhase.BEGAN);\n\t\t\t\tif(touch)\n\t\t\t\t{\n\t\t\t\t\tthis.close(this.disposeOnSelfClose);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this.closeOnTouchEndedOutside)\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(this.stage, TouchPhase.ENDED);\n\t\t\t\tif(touch)\n\t\t\t\t{\n\t\t\t\t\tthis.close(this.disposeOnSelfClose);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function callout_nativeStage_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(event.isDefaultPrevented())\n\t\t\t{\n\t\t\t\t//someone else already handled this one\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!this.closeOnKeys || this.closeOnKeys.indexOf(event.keyCode) < 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//don't let the OS handle the event\n\t\t\tevent.preventDefault();\n\t\t\tthis.close(this.disposeOnSelfClose);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function origin_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tthis.close(this.disposeOnSelfClose);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function content_resizeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreContentResize)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/Check.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.skins.IStyleProvider;\n\n\timport flash.errors.IllegalOperationError;\n\n\t[Exclude(name=\"isToggle\",kind=\"property\")]\n\n\t/**\n\t * A toggle control that contains a label and a box that may be checked\n\t * or not to indicate selection.\n\t *\n\t * <p>In the following example, a check is created and selected, and a\n\t * listener for <code>Event.CHANGE</code> is added:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var check:Check = new Check();\n\t * check.label = \"Pick Me!\";\n\t * check.isSelected = true;\n\t * check.addEventListener( Event.CHANGE, check_changeHandler );\n\t * this.addChild( check );</listing>\n\t *\n\t * @see ../../../help/check.html How to use the Feathers Check component\n\t * @see feathers.controls.ToggleSwitch\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class Check extends ToggleButton\n\t{\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the label.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_LABEL:String = \"feathers-check-label\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>Check</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function Check()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.labelStyleName = DEFAULT_CHILD_STYLE_NAME_LABEL;\n\t\t\tsuper.isToggle = true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn Check.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set isToggle(value:Boolean):void\n\t\t{\n\t\t\tthrow IllegalOperationError(\"CheckBox isToggle must always be true.\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/DataGrid.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.controls.DataGridColumn;\n\timport feathers.controls.Scroller;\n\timport feathers.controls.renderers.DefaultDataGridHeaderRenderer;\n\timport feathers.controls.renderers.IDataGridHeaderRenderer;\n\timport feathers.controls.supportClasses.DataGridDataViewPort;\n\timport feathers.core.IMeasureDisplayObject;\n\timport feathers.core.IValidating;\n\timport feathers.data.ArrayCollection;\n\timport feathers.data.IListCollection;\n\timport feathers.data.ListCollection;\n\timport feathers.data.SortOrder;\n\timport feathers.display.RenderDelegate;\n\timport feathers.dragDrop.DragData;\n\timport feathers.dragDrop.DragDropManager;\n\timport feathers.dragDrop.IDragSource;\n\timport feathers.dragDrop.IDropTarget;\n\timport feathers.events.CollectionEventType;\n\timport feathers.events.DragDropEvent;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.HorizontalLayout;\n\timport feathers.layout.HorizontalLayoutData;\n\timport feathers.layout.ILayout;\n\timport feathers.layout.IVariableVirtualLayout;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.system.DeviceCapabilities;\n\timport feathers.utils.skins.resetFluidChildDimensionsForMeasurement;\n\n\timport flash.errors.IllegalOperationError;\n\timport flash.events.KeyboardEvent;\n\timport flash.events.TransformGestureEvent;\n\timport flash.geom.Point;\n\timport flash.ui.Keyboard;\n\timport flash.utils.Dictionary;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.utils.Pool;\n\timport starling.utils.SystemUtil;\n\n\t/**\n\t * A skin to display when dragging one of the data grid's headers to\n\t * highlight the column where it was orignally located.\n\t *\n\t * <p>In the following example, the data grid's column overlay skin is provided:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var skin:Quad = new Quad(1, 1, 0x999999);\n\t * skin.alpha = 0.5;\n\t * grid.columnDragOverlaySkin = skin;</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #reorderColumns\n\t */\n\t[Style(name=\"columnDragOverlaySkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * A skin to display when resizing one of the data grid's headers to\n\t * indicate how it will be resized.\n\t *\n\t * <p>In the following example, the data grid's column resize skin is provided:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * grid.columnResizeSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #resizableColumns\n\t * @see feathers.controls.DataGridColumn#resizable\n\t */\n\t[Style(name=\"columnResizeSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * Specifies a custom style name for cell renderers that will be used if\n\t * the <code>customCellRendererStyleName</code> property from a\n\t * <code>DataGridColumn</code> is <code>null</code>.\n\t *\n\t * <p>The following example sets the cell renderer style name:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * column.customCellRendererStyleName = \"my-custom-cell-renderer\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component name to provide\n\t * different skins than the default style:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( DefaultDataGridCellRenderer ).setFunctionForStyleName( \"my-custom-cell-renderer\", setCustomCellRendererStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see feathers.core.FeathersControl#styleNameList\n\t */\n\t[Style(name=\"customCellRendererStyleName\",type=\"String\")]\n\n\t/**\n\t * Specifies a custom style name for header renderers that will be used if\n\t * the <code>customHeaderRendererStyleName</code> property from a\n\t * <code>DataGridColumn</code> is <code>null</code>.\n\t *\n\t * <p>The following example sets the header renderer style name:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * column.customHeaderRendererStyleName = \"my-custom-header-renderer\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component name to provide\n\t * different skins than the default style:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( DefaultDataGridHeaderRenderer ).setFunctionForStyleName( \"my-custom-header-renderer\", setCustomHeaderRendererStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see feathers.core.FeathersControl#styleNameList\n\t */\n\t[Style(name=\"customHeaderRendererStyleName\",type=\"String\")]\n\n\t/**\n\t * Determines if the height of the column drop indicator is equal to the\n\t * height of the headers, or if it extends to the full height of the data\n\t * grid's view port.\n\t *\n\t * <p>In the following example, the data grid's column drop skin is extended:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * grid.extendedColumnDropIndicator = true;</listing>\n\t *\n\t * @default false\n\t *\n\t * @see #reorderColumns\n\t * @see #style:columnDropIndicatorSkin\n\t */\n\t[Style(name=\"extendedColumnDropIndicator\",type=\"Boolean\")]\n\n\t/**\n\t * The default background to display in the data grid's header.\n\t *\n\t * <p>In the following example, the data grid's header is given a background skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.headerBackgroundSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:headerBackgroundDisabledSkin\n\t */\n\t[Style(name=\"headerBackgroundSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * A function that returns new dividers that separate each of the data\n\t * grid's header renderers. If <code>null</code>, no dividers will appear\n\t * between the header renderers.\n\t *\n\t * <p>The function is expected to have the following signature:</p>\n\t *\n\t * <pre>function():DisplayObject</pre>\n\t *\n\t * <p>The following example provides a factory for the header dividers:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * grid.headerDividerFactory = function():DisplayObject\n\t * {\n\t *     return = new ImageSkin( texture );\n\t * };</listing>\n\t *\n\t * @default null\n\t */\n\t[Style(name=\"headerDividerFactory\",type=\"Function\")]\n\n\t/**\n\t * A background to display in the data grid's header when the container is\n\t * disabled.\n\t *\n\t * <p>In the following example, the data grid's header is given a disabled background skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * grid.headerBackgroundDisabledSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:headerBackgroundSkin\n\t */\n\t[Style(name=\"headerBackgroundDisabledSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The alpha value used for the column's drag avatar.\n\t *\n\t * <p>In the following example, the data grid's column drag avatar alpha value is customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * grid.columnDragAvatarAlpha = 0.5;</listing>\n\t *\n\t * @default 0.8\n\t *\n\t * @see #reorderColumns\n\t */\n\t[Style(name=\"columnDragAvatarAlpha\",type=\"Number\")]\n\n\t/**\n\t * A skin to display when dragging one of the data grid's headers to indicate where\n\t * it can be dropped.\n\t *\n\t * <p>In the following example, the data grid's header drag indicator is provided:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * grid.columnDropIndicatorSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #reorderColumns\n\t * @see #style:extendedColumnDropIndicator\n\t */\n\t[Style(name=\"columnDropIndicatorSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The duration, in seconds, of the animation when the selected item is\n\t * changed by keyboard navigation and the item scrolls into view.\n\t *\n\t * <p>In the following example, the duration of the animation that\n\t * scrolls the list to a new selected item is set to 500 milliseconds:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * list.keyScrollDuration = 0.5;</listing>\n\t *\n\t * @default 0.25\n\t */\n\t[Style(name=\"keyScrollDuration\",type=\"Number\")]\n\n\t/**\n\t * A function that returns new dividers that separate each of the data\n\t * grid's columns. If <code>null</code>, no dividers will appear between\n\t * columns.\n\t *\n\t * <p>The function is expected to have the following signature:</p>\n\t *\n\t * <pre>function():DisplayObject</pre>\n\t *\n\t * <p>The following example provides a factory for the vertical dividers:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * grid.verticalDividerFactory = function():DisplayObject\n\t * {\n\t *     return = new ImageSkin( texture );\n\t * };</listing>\n\t *\n\t * @default null\n\t */\n\t[Style(name=\"verticalDividerFactory\",type=\"Function\")]\n\n\t/**\n\t * Dispatched when the selected item changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #selectedItem\n\t * @see #selectedIndex\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Displays a collection of items as a table. Each item is rendered as a\n\t * row, divided into columns for each of the item's fields. Supports\n\t * scrolling, custom cell renderers, sorting columns, resizing columns, and\n\t * drag and drop reordering of columns.\n\t *\n\t * <p>The following example creates a data grid, gives it a data provider,\n\t * defines its columns, and listens for when the selection changes:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var grid:DataGrid = new DataGrid();\n\t * \n\t * grid.dataProvider = new ArrayCollection(\n\t * [\n\t *     { item: \"Chicken breast\", dept: \"Meat\", price: \"5.90\" },\n\t *     { item: \"Butter\", dept: \"Dairy\", price: \"4.69\" },\n\t *     { item: \"Broccoli\", dept: \"Produce\", price: \"2.99\" },\n\t *     { item: \"Whole Wheat Bread\", dept: \"Bakery\", price: \"2.49\" },\n\t * ]);\n\t * \n\t * grid.columns = new ArrayCollection(\n\t * [\n\t *     new DataGridColumn(\"item\", \"Item\"),\n\t *     new DataGridColumn(\"dept\", \"Department\"),\n\t *     new DataGridColumn(\"price\", \"Unit Price\"),\n\t * ]);\n\t * \n\t * grid.addEventListener( Event.CHANGE, grid_changeHandler );\n\t * \n\t * this.addChild( grid );</listing>\n\t *\n\t * @see ../../../help/data-grid.html How to use the Feathers DataGrid component\n\t *\n\t * @productversion Feathers 3.4.0\n\t */\n\tpublic class DataGrid extends Scroller implements IDragSource, IDropTarget\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultSortCompareFunction(a:Object, b:Object):int\n\t\t{\n\t\t\tvar aString:String = a.toString().toLowerCase();\n\t\t\tvar bString:String = b.toString().toLowerCase();\n\t\t\tif(aString < bString)\n\t\t\t{\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif(aString > bString)\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultHeaderRendererFactory():IDataGridHeaderRenderer\n\t\t{\n\t\t\treturn new DefaultDataGridHeaderRenderer();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const DATA_GRID_HEADER_DRAG_FORMAT:String = \"feathers-data-grid-header\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>List</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function DataGrid()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.addEventListener(DragDropEvent.DRAG_ENTER, dataGrid_dragEnterHandler);\n\t\t\tthis.addEventListener(DragDropEvent.DRAG_MOVE, dataGrid_dragMoveHandler);\n\t\t\tthis.addEventListener(DragDropEvent.DRAG_DROP, dataGrid_dragDropHandler);\n\t\t\tthis._selectedIndices.addEventListener(Event.CHANGE, selectedIndices_changeHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * The guts of the DataGrid's functionality. Handles layout and selection.\n\t\t */\n\t\tprotected var dataViewPort:DataGridDataViewPort;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _headerGroup:LayoutGroup = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _headerDividerGroup:LayoutGroup = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalDividerGroup:LayoutGroup = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _headerLayout:HorizontalLayout = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _headerRendererMap:Dictionary = new Dictionary(true);\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _unrenderedHeaders:Vector.<int> = new <int>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _headerStorage:HeaderRendererFactoryStorage = new HeaderRendererFactoryStorage();\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _headerDividerStorage:DividerFactoryStorage = new DividerFactoryStorage();\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalDividerStorage:DividerFactoryStorage = new DividerFactoryStorage();\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn DataGrid.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function get isFocusEnabled():Boolean\n\t\t{\n\t\t\treturn (this._isSelectable || this._minHorizontalScrollPosition != this._maxHorizontalScrollPosition ||\n\t\t\t\tthis._minVerticalScrollPosition != this._maxVerticalScrollPosition) &&\n\t\t\t\tthis._isEnabled && this._isFocusEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isChildFocusEnabled:Boolean = true;\n\n\t\t/**\n\t\t * @copy feathers.core.IFocusContainer#isChildFocusEnabled\n\t\t *\n\t\t * @default true\n\t\t *\n\t\t * @see #isFocusEnabled\n\t\t */\n\t\tpublic function get isChildFocusEnabled():Boolean\n\t\t{\n\t\t\treturn this._isEnabled && this._isChildFocusEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isChildFocusEnabled(value:Boolean):void\n\t\t{\n\t\t\tthis._isChildFocusEnabled = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _reorderColumns:Boolean = false;\n\n\t\t/**\n\t\t * Determines if the data grid's columns may be reordered using drag\n\t\t * and drop.\n\t\t *\n\t\t * <p>The following example enables column reordering:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * grid.reorderColumns = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic function get reorderColumns():Boolean\n\t\t{\n\t\t\treturn this._reorderColumns;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set reorderColumns(value:Boolean):void\n\t\t{\n\t\t\tthis._reorderColumns = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _sortableColumns:Boolean = false;\n\n\t\t/**\n\t\t * Determines if the data grid's columns may be sorted.\n\t\t *\n\t\t * <p>The following example enables column sorting:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * grid.sortableColumns = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see feathers.controls.DataGridColumn#sortOrder\n\t\t */\n\t\tpublic function get sortableColumns():Boolean\n\t\t{\n\t\t\treturn this._sortableColumns;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set sortableColumns(value:Boolean):void\n\t\t{\n\t\t\tthis._sortableColumns = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _resizableColumns:Boolean = false;\n\n\t\t/**\n\t\t * Determines if the data grid's columns may be resized.\n\t\t *\n\t\t * <p>The following example enables column resizing:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * grid.resizableColumns = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see #style:columnResizeSkin\n\t\t */\n\t\tpublic function get resizableColumns():Boolean\n\t\t{\n\t\t\treturn this._resizableColumns;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set resizableColumns(value:Boolean):void\n\t\t{\n\t\t\tthis._resizableColumns = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentColumnDropIndicatorSkin:DisplayObject = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _columnDropIndicatorSkin:DisplayObject = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get columnDropIndicatorSkin():DisplayObject\n\t\t{\n\t\t\treturn this._columnDropIndicatorSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set columnDropIndicatorSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._columnDropIndicatorSkin = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentColumnResizeSkin:DisplayObject = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _columnResizeSkin:DisplayObject = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get columnResizeSkin():DisplayObject\n\t\t{\n\t\t\treturn this._columnResizeSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set columnResizeSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._columnResizeSkin = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentColumnDragOverlaySkin:DisplayObject = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _columnDragOverlaySkin:DisplayObject = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get columnDragOverlaySkin():DisplayObject\n\t\t{\n\t\t\treturn this._columnDragOverlaySkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set columnDragOverlaySkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._columnDragOverlaySkin = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _columnDragAvatarAlpha:Number = 0.8;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get columnDragAvatarAlpha():Number\n\t\t{\n\t\t\treturn this._columnDragAvatarAlpha;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set columnDragAvatarAlpha(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._columnDragAvatarAlpha = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _extendedColumnDropIndicator:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get extendedColumnDropIndicator():Boolean\n\t\t{\n\t\t\treturn this._extendedColumnDropIndicator;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set extendedColumnDropIndicator(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._extendedColumnDropIndicator = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _layout:ILayout = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function get layout():ILayout\n\t\t{\n\t\t\treturn this._layout;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function set layout(value:ILayout):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._layout === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._layout)\n\t\t\t{\n\t\t\t\tthis._layout.removeEventListener(Event.SCROLL, layout_scrollHandler);\n\t\t\t}\n\t\t\tthis._layout = value;\n\t\t\tif(this._layout is IVariableVirtualLayout)\n\t\t\t{\n\t\t\t\tthis._layout.addEventListener(Event.SCROLL, layout_scrollHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _updateForDataReset:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _dataProvider:IListCollection;\n\n\t\t/**\n\t\t * The collection of data displayed by the data grid. Changing this\n\t\t * property to a new value is considered a drastic change to the data\n\t\t * grid's data, so the horizontal and vertical scroll positions will be\n\t\t * reset, and the data grid's selection will be cleared.\n\t\t *\n\t\t * <p>The following example passes in a data provider and columns:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * grid.dataProvider = new ArrayCollection(\n\t\t * [\n\t\t *     { item: \"Chicken breast\", dept: \"Meat\", price: \"5.90\" },\n\t\t *     { item: \"Butter\", dept: \"Dairy\", price: \"4.69\" },\n\t\t *     { item: \"Broccoli\", dept: \"Produce\", price: \"2.99\" },\n\t\t *     { item: \"Whole Wheat Bread\", dept: \"Bakery\", price: \"2.49\" },\n\t\t * ]);\n\t\t * \n\t\t * grid.columns = new ArrayCollection(\n\t\t * [\n\t\t *     new DataGridColumn(\"item\", \"Item\"),\n\t\t *     new DataGridColumn(\"dept\", \"Department\"),\n\t\t *     new DataGridColumn(\"price\", \"Unit Price\"),\n\t\t * ]);</listing>\n\t\t *\n\t\t * <p><em>Warning:</em> A data grid's data provider cannot contain\n\t\t * duplicate items. To display the same item in multiple item\n\t\t * renderers, you must create separate objects with the same\n\t\t * properties. This restriction exists because it significantly improves\n\t\t * performance.</p>\n\t\t *\n\t\t * <p><em>Warning:</em> If the data provider contains display objects,\n\t\t * concrete textures, or anything that needs to be disposed, those\n\t\t * objects will not be automatically disposed when the data grid is\n\t\t * disposed. Similar to how <code>starling.display.Image</code> cannot\n\t\t * automatically dispose its texture because the texture may be used\n\t\t * by other display objects, a data grid cannot dispose its data\n\t\t * provider because the data provider may be used by other data grids.\n\t\t * See the <code>dispose()</code> function on\n\t\t * <code>IListCollection</code> to see how the data provider can be\n\t\t * disposed properly.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #columns\n\t\t * @see feathers.data.IListCollection#dispose()\n\t\t * @see feathers.data.ArrayCollection\n\t\t * @see feathers.data.VectorCollection\n\t\t * @see feathers.data.XMLListCollection\n\t\t */\n\t\tpublic function get dataProvider():IListCollection\n\t\t{\n\t\t\treturn this._dataProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set dataProvider(value:IListCollection):void\n\t\t{\n\t\t\tif(this._dataProvider == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._dataProvider)\n\t\t\t{\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.FILTER_CHANGE, dataProvider_filterChangeHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.SORT_CHANGE, dataProvider_sortChangeHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.ADD_ITEM, dataProvider_addItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.REMOVE_ITEM, dataProvider_removeItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.REMOVE_ALL, dataProvider_removeAllHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.REPLACE_ITEM, dataProvider_replaceItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.RESET, dataProvider_resetHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(Event.CHANGE, dataProvider_changeHandler);\n\t\t\t}\n\t\t\tthis._dataProvider = value;\n\t\t\tif(this._dataProvider)\n\t\t\t{\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.FILTER_CHANGE, dataProvider_filterChangeHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.SORT_CHANGE, dataProvider_sortChangeHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.ADD_ITEM, dataProvider_addItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.REMOVE_ITEM, dataProvider_removeItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.REMOVE_ALL, dataProvider_removeAllHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.REPLACE_ITEM, dataProvider_replaceItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.RESET, dataProvider_resetHandler);\n\t\t\t\tthis._dataProvider.addEventListener(Event.CHANGE, dataProvider_changeHandler);\n\t\t\t}\n\n\t\t\t//reset the scroll position because this is a drastic change and\n\t\t\t//the data is probably completely different\n\t\t\tthis.horizontalScrollPosition = 0;\n\t\t\tthis.verticalScrollPosition = 0;\n\n\t\t\t//clear the selection for the same reason\n\t\t\tthis.selectedIndex = -1;\n\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _columns:IListCollection = null;\n\n\t\t/**\n\t\t * Defines the columns to display for each item in the data provider.\n\t\t * If <code>null</code>, the data grid will attempt to populate the\n\t\t * columns automatically.\n\t\t *\n\t\t * <p>The following example passes in a data provider and columns:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * grid.dataProvider = new ArrayCollection(\n\t\t * [\n\t\t *     { item: \"Chicken breast\", dept: \"Meat\", price: \"5.90\" },\n\t\t *     { item: \"Butter\", dept: \"Dairy\", price: \"4.69\" },\n\t\t *     { item: \"Broccoli\", dept: \"Produce\", price: \"2.99\" },\n\t\t *     { item: \"Whole Wheat Bread\", dept: \"Bakery\", price: \"2.49\" },\n\t\t * ]);\n\t\t * \n\t\t * grid.columns = new ArrayCollection(\n\t\t * [\n\t\t *     new DataGridColumn(\"item\", \"Item\"),\n\t\t *     new DataGridColumn(\"dept\", \"Department\"),\n\t\t *     new DataGridColumn(\"price\", \"Unit Price\"),\n\t\t * ]);</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #dataProvider\n\t\t * @see feathers.controls.DataGridColumn\n\t\t */\n\t\tpublic function get columns():IListCollection\n\t\t{\n\t\t\treturn this._columns;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set columns(value:IListCollection):void\n\t\t{\n\t\t\tif(this._columns === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.setColumns(value);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function setColumns(value:IListCollection):void\n\t\t{\n\t\t\tif(this._columns !== null)\n\t\t\t{\n\t\t\t\tthis._columns.removeEventListener(Event.CHANGE, columns_changeHandler);\n\t\t\t\tthis._columns.removeEventListener(CollectionEventType.RESET, columns_resetHandler);\n\t\t\t\tthis._columns.removeEventListener(CollectionEventType.UPDATE_ALL, columns_updateAllHandler);\n\t\t\t}\n\t\t\tthis._columns = value;\n\t\t\tif(this._columns !== null)\n\t\t\t{\n\t\t\t\tthis._columns.addEventListener(Event.CHANGE, columns_changeHandler);\n\t\t\t\tthis._columns.addEventListener(CollectionEventType.RESET, columns_resetHandler);\n\t\t\t\tthis._columns.addEventListener(CollectionEventType.UPDATE_ALL, columns_updateAllHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isSelectable:Boolean = true;\n\n\t\t/**\n\t\t * Determines if items in the data grid may be selected. By default\n\t\t * only a single item may be selected at any given time. In other\n\t\t * words, if item A is selected, and the user selects item B, item A\n\t\t * will be deselected automatically. Set\n\t\t * <code>allowMultipleSelection</code> to <code>true</code> to select\n\t\t * more than one item without automatically deselecting other items.\n\t\t *\n\t\t * <p>The following example disables selection:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * grid.isSelectable = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t *\n\t\t * @see #selectedItem\n\t\t * @see #selectedIndex\n\t\t * @see #allowMultipleSelection\n\t\t */\n\t\tpublic function get isSelectable():Boolean\n\t\t{\n\t\t\treturn this._isSelectable;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isSelectable(value:Boolean):void\n\t\t{\n\t\t\tif(this._isSelectable == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isSelectable = value;\n\t\t\tif(!this._isSelectable)\n\t\t\t{\n\t\t\t\tthis.selectedIndex = -1;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectedIndex:int = -1;\n\n\t\t/**\n\t\t * The index of the currently selected item. Returns <code>-1</code> if\n\t\t * no item is selected.\n\t\t *\n\t\t * <p>The following example selects an item by its index:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * grid.selectedIndex = 2;</listing>\n\t\t *\n\t\t * <p>The following example clears the selected index:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * grid.selectedIndex = -1;</listing>\n\t\t *\n\t\t * <p>The following example listens for when selection changes and\n\t\t * requests the selected index:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * function grid_changeHandler( event:Event ):void\n\t\t * {\n\t\t *     var grid:DataGrid = DataGrid( event.currentTarget );\n\t\t *     var index:int = grid.selectedIndex;\n\t\t * \n\t\t * }\n\t\t * grid.addEventListener( Event.CHANGE, grid_changeHandler );</listing>\n\t\t *\n\t\t * @default -1\n\t\t *\n\t\t * @see #selectedItem\n\t\t * @see #allowMultipleSelection\n\t\t * @see #selectedItems\n\t\t * @see #selectedIndices\n\t\t */\n\t\tpublic function get selectedIndex():int\n\t\t{\n\t\t\treturn this._selectedIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedIndex(value:int):void\n\t\t{\n\t\t\tif(this._selectedIndex == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value >= 0)\n\t\t\t{\n\t\t\t\tthis._selectedIndices.data = new <int>[value];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._selectedIndices.removeAll();\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * The currently selected item. Returns <code>null</code> if no item is\n\t\t * selected.\n\t\t *\n\t\t * <p>The following example changes the selected item:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * grid.selectedItem = grid.dataProvider.getItemAt(0);</listing>\n\t\t *\n\t\t * <p>The following example clears the selected item:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * grid.selectedItem = null;</listing>\n\t\t *\n\t\t * <p>The following example listens for when selection changes and\n\t\t * requests the selected item:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * function grid_changeHandler( event:Event ):void\n\t\t * {\n\t\t *     var grid:DataGrid = DataGrid( event.currentTarget );\n\t\t *     var item:Object = grid.selectedItem;\n\t\t * \n\t\t * }\n\t\t * grid.addEventListener( Event.CHANGE, grid_changeHandler );</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #selectedIndex\n\t\t * @see #allowMultipleSelection\n\t\t * @see #selectedItems\n\t\t * @see #selectedIndices\n\t\t */\n\t\tpublic function get selectedItem():Object\n\t\t{\n\t\t\tif(!this._dataProvider || this._selectedIndex < 0 || this._selectedIndex >= this._dataProvider.length)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn this._dataProvider.getItemAt(this._selectedIndex);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedItem(value:Object):void\n\t\t{\n\t\t\tif(!this._dataProvider)\n\t\t\t{\n\t\t\t\tthis.selectedIndex = -1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.selectedIndex = this._dataProvider.getItemIndex(value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _allowMultipleSelection:Boolean = false;\n\n\t\t/**\n\t\t * If <code>true</code> multiple items may be selected at a time. If\n\t\t * <code>false</code>, then only a single item may be selected at a\n\t\t * time, and if the selection changes, other items are deselected. Has\n\t\t * no effect if <code>isSelectable</code> is <code>false</code>.\n\t\t *\n\t\t * <p>In the following example, multiple selection is enabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * grid.allowMultipleSelection = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see #isSelectable\n\t\t * @see #selectedIndices\n\t\t * @see #selectedItems\n\t\t */\n\t\tpublic function get allowMultipleSelection():Boolean\n\t\t{\n\t\t\treturn this._allowMultipleSelection;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set allowMultipleSelection(value:Boolean):void\n\t\t{\n\t\t\tif(this._allowMultipleSelection == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._allowMultipleSelection = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectedIndices:ListCollection = new ListCollection(new <int>[]);\n\n\t\t/**\n\t\t * The indices of the currently selected items. Returns an empty <code>Vector.&lt;int&gt;</code>\n\t\t * if no items are selected. If <code>allowMultipleSelection</code> is\n\t\t * <code>false</code>, only one item may be selected at a time.\n\t\t *\n\t\t * <p>The following example selects two items by their indices:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * grid.selectedIndices = new &lt;int&gt;[ 2, 3 ];</listing>\n\t\t *\n\t\t * <p>The following example clears the selected indices:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * grid.selectedIndices = null;</listing>\n\t\t *\n\t\t * <p>The following example listens for when selection changes and\n\t\t * requests the selected indices:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * function grid_changeHandler( event:Event ):void\n\t\t * {\n\t\t *     var grid:DataGrid = DataGrid( event.currentTarget );\n\t\t *     var indices:Vector.&lt;int&gt; = grid.selectedIndices;\n\t\t * \n\t\t * }\n\t\t * grid.addEventListener( Event.CHANGE, grid_changeHandler );</listing>\n\t\t *\n\t\t * @see #allowMultipleSelection\n\t\t * @see #selectedItems\n\t\t * @see #selectedIndex\n\t\t * @see #selectedItem\n\t\t */\n\t\tpublic function get selectedIndices():Vector.<int>\n\t\t{\n\t\t\treturn this._selectedIndices.data as Vector.<int>;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedIndices(value:Vector.<int>):void\n\t\t{\n\t\t\tvar oldValue:Vector.<int> = this._selectedIndices.data as Vector.<int>;\n\t\t\tif(oldValue == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tif(this._selectedIndices.length == 0)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._selectedIndices.removeAll();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(!this._allowMultipleSelection && value.length > 0)\n\t\t\t\t{\n\t\t\t\t\tvalue.length = 1;\n\t\t\t\t}\n\t\t\t\tthis._selectedIndices.data = value;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectedItems:Vector.<Object> = new <Object>[];\n\n\t\t/**\n\t\t * The currently selected item. The getter returns an empty\n\t\t * <code>Vector.&lt;Object&gt;</code> if no item is selected. If any\n\t\t * items are selected, the getter creates a new\n\t\t * <code>Vector.&lt;Object&gt;</code> to return a list of selected\n\t\t * items.\n\t\t *\n\t\t * <p>The following example selects two items:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * grid.selectedItems = new &lt;Object&gt;[ grid.dataProvider.getItemAt(2) , grid.dataProvider.getItemAt(3) ];</listing>\n\t\t *\n\t\t * <p>The following example clears the selected items:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * grid.selectedItems = null;</listing>\n\t\t *\n\t\t * <p>The following example listens for when selection changes and\n\t\t * requests the selected items:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * function grid_changeHandler( event:Event ):void\n\t\t * {\n\t\t *     var grid:DataGrid = DataGrid( event.currentTarget );\n\t\t *     var items:Vector.&lt;Object&gt; = grid.selectedItems;\n\t\t * \n\t\t * }\n\t\t * grid.addEventListener( Event.CHANGE, grid_changeHandler );</listing>\n\t\t *\n\t\t * @see #allowMultipleSelection\n\t\t * @see #selectedIndices\n\t\t * @see #selectedIndex\n\t\t * @see #selectedItem\n\t\t */\n\t\tpublic function get selectedItems():Vector.<Object>\n\t\t{\n\t\t\treturn this._selectedItems;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedItems(value:Vector.<Object>):void\n\t\t{\n\t\t\tif(!value || !this._dataProvider)\n\t\t\t{\n\t\t\t\tthis.selectedIndex = -1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar indices:Vector.<int> = new <int>[];\n\t\t\tvar itemCount:int = value.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = value[i];\n\t\t\t\tvar index:int = this._dataProvider.getItemIndex(item);\n\t\t\t\tif(index >= 0)\n\t\t\t\t{\n\t\t\t\t\tindices.push(index);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.selectedIndices = indices;\n\t\t}\n\n\t\t/**\n\t\t * Returns the selected items, with the ability to pass in an optional\n\t\t * result vector. Better for performance than the <code>selectedItems</code>\n\t\t * getter because it can avoid the allocation, and possibly garbage\n\t\t * collection, of the result object.\n\t\t *\n\t\t * @see #selectedItems\n\t\t */\n\t\tpublic function getSelectedItems(result:Vector.<Object> = null):Vector.<Object>\n\t\t{\n\t\t\tif(result !== null)\n\t\t\t{\n\t\t\t\tresult.length = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult = new <Object>[];\n\t\t\t}\n\t\t\tif(!this._dataProvider)\n\t\t\t{\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tvar indexCount:int = this._selectedIndices.length;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tvar index:int = this._selectedIndices.getItemAt(i) as int;\n\t\t\t\tvar item:Object = this._dataProvider.getItemAt(index);\n\t\t\t\tresult[i] = item;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _typicalItem:Object = null;\n\n\t\t/**\n\t\t * Used to auto-size the data grid when a virtualized layout is used.\n\t\t * If the data grid's width or height is unknown, the data grid will\n\t\t * try to automatically pick an ideal size. This item is used to create\n\t\t * a sample item renderer to measure item renderers that are virtual\n\t\t * and not visible in the viewport.\n\t\t *\n\t\t * <p>The following example provides a typical item:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * grid.typicalItem = { text: \"A typical item\", thumbnail: texture };</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get typicalItem():Object\n\t\t{\n\t\t\treturn this._typicalItem;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set typicalItem(value:Object):void\n\t\t{\n\t\t\tif(this._typicalItem == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._typicalItem = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _keyScrollDuration:Number = 0.25;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get keyScrollDuration():Number\n\t\t{\n\t\t\treturn this._keyScrollDuration;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set keyScrollDuration(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._keyScrollDuration = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _headerBackgroundSkin:DisplayObject = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get headerBackgroundSkin():DisplayObject\n\t\t{\n\t\t\treturn this._headerBackgroundSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set headerBackgroundSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._headerBackgroundSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._headerBackgroundSkin = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _headerBackgroundDisabledSkin:DisplayObject = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get headerBackgroundDisabledSkin():DisplayObject\n\t\t{\n\t\t\treturn this._headerBackgroundDisabledSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set headerBackgroundDisabledSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._headerBackgroundDisabledSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._headerBackgroundDisabledSkin = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalDividerFactory:Function = null;\n\n\t\t/**\n\t\t * @private\n\t\t *\n\t\t * @see #style:verticalDividerFactory\n\t\t */\n\t\tpublic function get verticalDividerFactory():Function\n\t\t{\n\t\t\treturn this._verticalDividerFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalDividerFactory(value:Function):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._verticalDividerFactory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalDividerFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _headerDividerFactory:Function = null;\n\n\t\t/**\n\t\t * @private\n\t\t *\n\t\t * @see #style:headerDividerFactory\n\t\t */\n\t\tpublic function get headerDividerFactory():Function\n\t\t{\n\t\t\treturn this._headerDividerFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set headerDividerFactory(value:Function):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._headerDividerFactory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._headerDividerFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _cellRendererFactory:Function = null;\n\n\t\t/**\n\t\t * Specifies a default factory for cell renderers that will be used if\n\t\t * the <code>cellRendererFactory</code> from a\n\t\t * <code>DataGridColumn</code> is <code>null</code>.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t *\n\t\t * <pre>function():IDataGridCellRenderer</pre>\n\t\t *\n\t\t * <p>The following example provides a factory for the data grid:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * grid.cellRendererFactory = function():IDataGridCellRenderer\n\t\t * {\n\t\t *     var cellRenderer:CustomCellRendererClass = new CustomCellRendererClass();\n\t\t *     cellRenderer.backgroundSkin = new Quad( 10, 10, 0xff0000 );\n\t\t *     return cellRenderer;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.renderers.IDataGridCellRenderer\n\t\t */\n\t\tpublic function get cellRendererFactory():Function\n\t\t{\n\t\t\treturn this._cellRendererFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set cellRendererFactory(value:Function):void\n\t\t{\n\t\t\tif(this._cellRendererFactory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._cellRendererFactory = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customCellRendererStyleName:String = null;\n\n\t\t/**\n\t\t * @private\n\t\t *\n\t\t * @see #style:customCellRendererStyleName\n\t\t */\n\t\tpublic function get customCellRendererStyleName():String\n\t\t{\n\t\t\treturn this._customCellRendererStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customCellRendererStyleName(value:String):void\n\t\t{\n\t\t\tif(this._customCellRendererStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customCellRendererStyleName = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _headerRendererFactory:Function = null;\n\n\t\t/**\n\t\t * Specifies a default factory for header renderers that will be used if\n\t\t * the <code>headerRendererFactory</code> from a\n\t\t * <code>DataGridColumn</code> is <code>null</code>.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t *\n\t\t * <pre>function():IDataGridHeaderRenderer</pre>\n\t\t *\n\t\t * <p>The following example provides a factory for the data grid:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * grid.headerRendererFactory = function():IDataGridHeaderRenderer\n\t\t * {\n\t\t *     var headerRenderer:CustomHeaderRendererClass = new CustomHeaderRendererClass();\n\t\t *     headerRenderer.backgroundSkin = new Quad( 10, 10, 0xff0000 );\n\t\t *     return headerRenderer;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.renderers.IDataGridHeaderRenderer\n\t\t */\n\t\tpublic function get headerRendererFactory():Function\n\t\t{\n\t\t\treturn this._headerRendererFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set headerRendererFactory(value:Function):void\n\t\t{\n\t\t\tif(this._headerRendererFactory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._headerRendererFactory = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customHeaderRendererStyleName:String = null;\n\n\t\t/**\n\t\t * @private\n\t\t *\n\t\t * @see #style:customHeaderRendererStyleName\n\t\t */\n\t\tpublic function get customHeaderRendererStyleName():String\n\t\t{\n\t\t\treturn this._customHeaderRendererStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customHeaderRendererStyleName(value:String):void\n\t\t{\n\t\t\tif(this._customHeaderRendererStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customHeaderRendererStyleName = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _draggedHeaderIndex:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _headerTouchID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _headerTouchX:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _headerTouchY:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _headerDividerTouchID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _headerDividerTouchX:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _resizingColumnIndex:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customColumnSizes:Vector.<Number> = null;\n\n\t\t/**\n\t\t * The pending item index to scroll to after validating. A value of\n\t\t * <code>-1</code> means that the scroller won't scroll to an item after\n\t\t * validating.\n\t\t */\n\t\tprotected var pendingItemIndex:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function scrollToPosition(horizontalScrollPosition:Number, verticalScrollPosition:Number, animationDuration:Number = NaN):void\n\t\t{\n\t\t\tthis.pendingItemIndex = -1;\n\t\t\tsuper.scrollToPosition(horizontalScrollPosition, verticalScrollPosition, animationDuration);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function scrollToPageIndex(horizontalPageIndex:int, verticalPageIndex:int, animationDuration:Number = NaN):void\n\t\t{\n\t\t\tthis.pendingItemIndex = -1;\n\t\t\tsuper.scrollToPageIndex(horizontalPageIndex, verticalPageIndex, animationDuration);\n\t\t}\n\n\t\t/**\n\t\t * Scrolls the data grid so that the specified item is visible. If\n\t\t * <code>animationDuration</code> is greater than zero, the scroll will\n\t\t * animate. The duration is in seconds.\n\t\t *\n\t\t * <p>If the layout is virtual with variable item dimensions, this\n\t\t * function may not accurately scroll to the exact correct position. A\n\t\t * virtual layout with variable item dimensions is often forced to\n\t\t * estimate positions, so the results aren't guaranteed to be accurate.</p>\n\t\t *\n\t\t * <p>If you want to scroll to the end of the data grid, it is better\n\t\t * to use <code>scrollToPosition()</code> with\n\t\t * <code>maxHorizontalScrollPosition</code> or\n\t\t * <code>maxVerticalScrollPosition</code>.</p>\n\t\t *\n\t\t * <p>In the following example, the data grid is scrolled to display index 10:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * grid.scrollToDisplayIndex( 10 );</listing>\n\t\t *\n\t\t * @param index The integer index of an item from the data provider.\n\t\t * @param animationDuration The length of time, in seconds, of the animation. May be zero to scroll instantly.\n\t\t *\n\t\t * @see #scrollToPosition()\n\t\t */\n\t\tpublic function scrollToDisplayIndex(index:int, animationDuration:Number = 0):void\n\t\t{\n\t\t\t//cancel any pending scroll to a different page or scroll position.\n\t\t\t//we can have only one type of pending scroll at a time.\n\t\t\tthis.hasPendingHorizontalPageIndex = false;\n\t\t\tthis.hasPendingVerticalPageIndex = false;\n\t\t\tthis.pendingHorizontalScrollPosition = NaN;\n\t\t\tthis.pendingVerticalScrollPosition = NaN;\n\t\t\tif(this.pendingItemIndex == index &&\n\t\t\t\tthis.pendingScrollDuration == animationDuration)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.pendingItemIndex = index;\n\t\t\tthis.pendingScrollDuration = animationDuration;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_PENDING_SCROLL);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this._columnDropIndicatorSkin !== null &&\n\t\t\t\tthis._columnDropIndicatorSkin.parent === null)\n\t\t\t{\n\t\t\t\tthis._columnDropIndicatorSkin.dispose();\n\t\t\t\tthis._columnDropIndicatorSkin = null;\n\t\t\t}\n\t\t\tif(this._columnDragOverlaySkin !== null &&\n\t\t\t\tthis._columnDragOverlaySkin.parent === null)\n\t\t\t{\n\t\t\t\tthis._columnDragOverlaySkin.dispose();\n\t\t\t\tthis._columnDragOverlaySkin = null;\n\t\t\t}\n\t\t\tthis.refreshInactiveHeaderDividers(true);\n\t\t\tthis.refreshInactiveVerticalDividers(true);\n\t\t\t//clearing selection now so that the data provider setter won't\n\t\t\t//cause a selection change that triggers events.\n\t\t\tthis._selectedIndices.removeEventListeners();\n\t\t\tthis._selectedIndex = -1;\n\t\t\tthis.dataProvider = null;\n\t\t\tthis.columns = null;\n\t\t\tthis.layout = null;\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tvar hasLayout:Boolean = this._layout !== null;\n\n\t\t\tsuper.initialize();\n\n\t\t\tif(!this.dataViewPort)\n\t\t\t{\n\t\t\t\tthis.viewPort = this.dataViewPort = new DataGridDataViewPort();\n\t\t\t\tthis.dataViewPort.owner = this;\n\t\t\t\tthis.viewPort = this.dataViewPort;\n\t\t\t}\n\n\t\t\tif(this._verticalDividerGroup === null)\n\t\t\t{\n\t\t\t\tthis._verticalDividerGroup = new LayoutGroup();\n\t\t\t\tthis._verticalDividerGroup.touchable = false;\n\t\t\t\tthis.addChild(this._verticalDividerGroup);\n\t\t\t}\n\n\t\t\tif(this._headerLayout === null)\n\t\t\t{\n\t\t\t\tthis._headerLayout = new HorizontalLayout();\n\t\t\t\tthis._headerLayout.useVirtualLayout = false;\n\t\t\t\tthis._headerLayout.verticalAlign = VerticalAlign.JUSTIFY;\n\t\t\t}\n\n\t\t\tif(this._headerGroup === null)\n\t\t\t{\n\t\t\t\tthis._headerGroup = new LayoutGroup();\n\t\t\t\tthis.addChild(this._headerGroup);\n\t\t\t}\n\n\t\t\tthis._headerGroup.layout = this._headerLayout;\n\n\t\t\tif(this._headerDividerGroup === null)\n\t\t\t{\n\t\t\t\tthis._headerDividerGroup = new LayoutGroup();\n\t\t\t\tthis.addChild(this._headerDividerGroup);\n\t\t\t}\n\n\t\t\tif(!hasLayout)\n\t\t\t{\n\t\t\t\tif(this._hasElasticEdges &&\n\t\t\t\t\tthis._verticalScrollPolicy === ScrollPolicy.AUTO &&\n\t\t\t\t\tthis._scrollBarDisplayMode !== ScrollBarDisplayMode.FIXED)\n\t\t\t\t{\n\t\t\t\t\t//so that the elastic edges work even when the max scroll\n\t\t\t\t\t//position is 0, similar to iOS.\n\t\t\t\t\tthis._verticalScrollPolicy = ScrollPolicy.ON;\n\t\t\t\t}\n\n\t\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\t\tlayout.useVirtualLayout = true;\n\t\t\t\tlayout.horizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\t\tthis.ignoreNextStyleRestriction();\n\t\t\t\tthis.layout = layout;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\n\t\t\tif(stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshHeaderStyles();\n\t\t\t}\n\n\t\t\tthis.refreshColumns();\n\n\t\t\tthis.refreshHeaderRenderers();\n\t\t\tthis.refreshDataViewPortProperties();\n\t\t\tsuper.draw();\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\toverride protected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tresetFluidChildDimensionsForMeasurement(this.currentBackgroundSkin,\n\t\t\t\tthis._explicitWidth, this._explicitHeight,\n\t\t\t\tthis._explicitMinWidth, this._explicitMinHeight,\n\t\t\t\tthis._explicitMaxWidth, this._explicitMaxHeight,\n\t\t\t\tthis._explicitBackgroundWidth, this._explicitBackgroundHeight,\n\t\t\t\tthis._explicitBackgroundMinWidth, this._explicitBackgroundMinHeight,\n\t\t\t\tthis._explicitBackgroundMaxWidth, this._explicitBackgroundMaxHeight);\n\t\t\tvar measureBackground:IMeasureDisplayObject = this.currentBackgroundSkin as IMeasureDisplayObject;\n\t\t\tif(this.currentBackgroundSkin is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.currentBackgroundSkin).validate();\n\t\t\t}\n\n\t\t\t//we don't measure the header and footer here because they are\n\t\t\t//handled in calculateViewPortOffsets(), which is automatically\n\t\t\t//called by Scroller before autoSizeIfNeeded().\n\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tif(this._measureViewPort)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this._viewPort.visibleWidth;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewWidth = 0;\n\t\t\t\t}\n\t\t\t\tnewWidth += this._rightViewPortOffset + this._leftViewPortOffset;\n\t\t\t\tvar headerWidth:Number = this._headerGroup.width;\n\t\t\t\tif(headerWidth > newWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = headerWidth;\n\t\t\t\t}\n\t\t\t\tif(this.currentBackgroundSkin !== null &&\n\t\t\t\t\tthis.currentBackgroundSkin.width > newWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this.currentBackgroundSkin.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tif(this._measureViewPort)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this._viewPort.visibleHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewHeight = 0;\n\t\t\t\t}\n\t\t\t\tnewHeight += this._bottomViewPortOffset + this._topViewPortOffset;\n\t\t\t\t//we don't need to account for the header and footer because\n\t\t\t\t//they're already included in the top and bottom offsets\n\t\t\t\tif(this.currentBackgroundSkin !== null &&\n\t\t\t\t\tthis.currentBackgroundSkin.height > newHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this.currentBackgroundSkin.height;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tif(this._measureViewPort)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = this._viewPort.minVisibleWidth;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = 0;\n\t\t\t\t}\n\t\t\t\tnewMinWidth += this._rightViewPortOffset + this._leftViewPortOffset;\n\t\t\t\tvar headerMinWidth:Number = this._headerGroup.minWidth;\n\t\t\t\tif(headerMinWidth > newMinWidth)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = headerMinWidth;\n\t\t\t\t}\n\t\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(measureBackground !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(measureBackground.minWidth > newMinWidth)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinWidth = measureBackground.minWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._explicitBackgroundMinWidth > newMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = this._explicitBackgroundMinWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tif(this._measureViewPort)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = this._viewPort.minVisibleHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = 0;\n\t\t\t\t}\n\t\t\t\tnewMinHeight += this._bottomViewPortOffset + this._topViewPortOffset;\n\t\t\t\t//we don't need to account for the header and footer because\n\t\t\t\t//they're already included in the top and bottom offsets\n\t\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(measureBackground !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(measureBackground.minHeight > newMinHeight)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinHeight = measureBackground.minHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._explicitBackgroundMinHeight > newMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = this._explicitBackgroundMinHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * If the columns are not defined, we can try to create them automatically.\n\t\t */\n\t\tprotected function refreshColumns():void\n\t\t{\n\t\t\tif(this._columns !== null || this._dataProvider === null || this._dataProvider.length == 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar columns:Array = [];\n\t\t\tvar firstItem:Object = this._dataProvider.getItemAt(0);\n\t\t\tvar pushIndex:int = 0;\n\t\t\tfor(var key:String in firstItem)\n\t\t\t{\n\t\t\t\tcolumns[pushIndex] = new DataGridColumn(key);\n\t\t\t\tpushIndex++;\n\t\t\t}\n\t\t\tthis.setColumns(new ArrayCollection(columns));\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshHeaderStyles():void\n\t\t{\n\t\t\tthis._headerGroup.backgroundSkin = this._headerBackgroundSkin;\n\t\t\tthis._headerGroup.backgroundDisabledSkin = this._headerBackgroundDisabledSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function calculateViewPortOffsets(forceScrollBars:Boolean = false, useActualBounds:Boolean = false):void\n\t\t{\n\t\t\tsuper.calculateViewPortOffsets(forceScrollBars, useActualBounds);\n\n\t\t\tthis._headerLayout.paddingLeft = this._leftViewPortOffset;\n\t\t\tthis._headerLayout.paddingRight = this._rightViewPortOffset;\n\t\t\tif(useActualBounds)\n\t\t\t{\n\t\t\t\tthis._headerGroup.width = this.actualWidth;\n\t\t\t\tthis._headerGroup.minWidth = this.actualMinWidth;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._headerGroup.width = this._explicitWidth;\n\t\t\t\tthis._headerGroup.minWidth = this._explicitMinWidth;\n\t\t\t}\n\t\t\tthis._headerGroup.maxWidth = this._explicitMaxWidth;\n\t\t\tthis._headerGroup.validate();\n\t\t\tthis._topViewPortOffset += this._headerGroup.height;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function layoutChildren():void\n\t\t{\n\t\t\tthis.validateCustomColumnSizes();\n\t\t\tthis.layoutHeaderRenderers();\n\n\t\t\tthis._headerLayout.paddingLeft = this._leftViewPortOffset;\n\t\t\tthis._headerLayout.paddingRight = this._rightViewPortOffset;\n\t\t\tthis._headerGroup.width = this.actualWidth;\n\t\t\tthis._headerGroup.validate();\n\t\t\tthis._headerGroup.x = 0;\n\t\t\tthis._headerGroup.y = this._topViewPortOffset - this._headerGroup.height;\n\t\t\tthis._headerDividerGroup.x = this._headerGroup.x;\n\t\t\tthis._headerDividerGroup.y = this._headerGroup.y;\n\t\t\tthis._headerDividerGroup.width = this._headerGroup.width;\n\n\t\t\tsuper.layoutChildren();\n\n\t\t\tthis._verticalDividerGroup.x = this._headerGroup.x;\n\t\t\tthis._verticalDividerGroup.y = this._headerGroup.y + this._headerGroup.height;\n\t\t\tthis._verticalDividerGroup.width = this._headerGroup.width;\n\t\t\tthis._verticalDividerGroup.height = this.viewPort.visibleHeight;\n\n\t\t\tthis.refreshHeaderDividers();\n\t\t\tthis.refreshVerticalDividers();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function validateCustomColumnSizes():void\n\t\t{\n\t\t\tif(this._customColumnSizes === null || this._customColumnSizes.length < this._columns.length)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar availableWidth:Number = this.actualWidth - this._leftViewPortOffset - this._rightViewPortOffset;\n\t\t\tvar count:int = this._customColumnSizes.length;\n\t\t\tvar totalWidth:Number = 0;\n\t\t\tvar indices:Vector.<int> = new <int>[];\n\t\t\tvar currentIndex:int = 0;\n\t\t\tfor(var i:int = 0; i < count; i++)\n\t\t\t{\n\t\t\t\tvar column:DataGridColumn = DataGridColumn(this._columns.getItemAt(i));\n\t\t\t\tif(column.width === column.width) //!isNaN\n\t\t\t\t{\n\t\t\t\t\t//if the width is set explicitly, skip it!\n\t\t\t\t\tavailableWidth -= column.width;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tvar size:Number = this._customColumnSizes[i];\n\t\t\t\ttotalWidth += size;\n\t\t\t\tindices[currentIndex] = i;\n\t\t\t\tcurrentIndex++;\n\t\t\t}\n\t\t\tif(totalWidth == availableWidth)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//make a copy so that this is detected as a change\n\t\t\tthis._customColumnSizes = this._customColumnSizes.slice();\n\n\t\t\tvar widthToDistribute:Number = availableWidth - totalWidth;\n\t\t\tthis.distributeWidthToIndices(widthToDistribute, indices, totalWidth);\n\t\t\tthis.dataViewPort.customColumnSizes = this._customColumnSizes;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function distributeWidthToIndices(widthToDistribute:Number, indices:Vector.<int>, totalWidthOfIndices:Number):void\n\t\t{\n\t\t\twhile(Math.abs(widthToDistribute) > 1)\n\t\t\t{\n\t\t\t\t//this will be the store value if we need to loop again\n\t\t\t\tvar nextWidthToDistribute:Number = widthToDistribute;\n\t\t\t\tvar count:int = indices.length;\n\t\t\t\tfor(var i:int = count - 1; i >= 0; i--)\n\t\t\t\t{\n\t\t\t\t\tvar index:int = indices[i];\n\t\t\t\t\tvar headerRenderer:IDataGridHeaderRenderer = IDataGridHeaderRenderer(this._headerGroup.getChildAt(index));\n\t\t\t\t\tvar columnWidth:Number = headerRenderer.width;\n\t\t\t\t\tvar column:DataGridColumn = DataGridColumn(this._columns.getItemAt(index));\n\t\t\t\t\tvar percent:Number = columnWidth / totalWidthOfIndices;\n\t\t\t\t\tvar offset:Number = widthToDistribute * percent;\n\t\t\t\t\tvar newWidth:Number = this._customColumnSizes[index] + offset;\n\t\t\t\t\tif(newWidth < column.minWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\toffset += (column.minWidth - newWidth);\n\t\t\t\t\t\tnewWidth = column.minWidth;\n\t\t\t\t\t\t//we've hit the minimum, so skip it if we loop again\n\t\t\t\t\t\tindices.removeAt(i);\n\t\t\t\t\t\t//also readjust the total to exclude this column\n\t\t\t\t\t\t//so that the percentages still add up to 100%\n\t\t\t\t\t\ttotalWidthOfIndices -= columnWidth;\n\t\t\t\t\t}\n\t\t\t\t\tthis._customColumnSizes[index] = newWidth;\n\t\t\t\t\tnextWidthToDistribute -= offset;\n\t\t\t\t}\n\t\t\t\twidthToDistribute = nextWidthToDistribute;\n\t\t\t}\n\n\t\t\tif(widthToDistribute != 0)\n\t\t\t{\n\t\t\t\t//if we have less than a pixel left, just add it to the\n\t\t\t\t//final column and exit the loop\n\t\t\t\tthis._customColumnSizes[this._customColumnSizes.length - 1] += widthToDistribute;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutHeaderRenderers():void\n\t\t{\n\t\t\tvar columnCount:int = 0;\n\t\t\tif(this._columns !== null)\n\t\t\t{\n\t\t\t\tcolumnCount = this._columns.length;\n\t\t\t}\n\t\t\tfor(var i:int = 0; i < columnCount; i++)\n\t\t\t{\n\t\t\t\tvar headerRenderer:IDataGridHeaderRenderer = IDataGridHeaderRenderer(this._headerGroup.getChildAt(i));\n\t\t\t\tvar column:DataGridColumn = DataGridColumn(this._columns.getItemAt(i));\n\t\t\t\tif(column.width === column.width) //!isNaN\n\t\t\t\t{\n\t\t\t\t\theaderRenderer.width = column.width;\n\t\t\t\t\theaderRenderer.layoutData = null;\n\t\t\t\t}\n\t\t\t\telse if(this._customColumnSizes !== null && i < this._customColumnSizes.length)\n\t\t\t\t{\n\t\t\t\t\theaderRenderer.width = this._customColumnSizes[i];\n\t\t\t\t\theaderRenderer.layoutData = null;\n\t\t\t\t}\n\t\t\t\telse if(headerRenderer.layoutData === null)\n\t\t\t\t{\n\t\t\t\t\theaderRenderer.layoutData = new HorizontalLayoutData(100);\n\t\t\t\t}\n\t\t\t\theaderRenderer.minWidth = column.minWidth;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshVerticalDividers():void\n\t\t{\n\t\t\tthis.refreshInactiveVerticalDividers(this._verticalDividerStorage.factory !== this._verticalDividerFactory);\n\t\t\tthis._verticalDividerStorage.factory = this._verticalDividerFactory;\n\n\t\t\tvar columnCount:int = 0;\n\t\t\tif(this._columns !== null)\n\t\t\t{\n\t\t\t\tcolumnCount = this._columns.length;\n\t\t\t}\n\t\t\tvar dividerCount:int = 0;\n\t\t\tif(this._verticalDividerFactory !== null)\n\t\t\t{\n\t\t\t\tdividerCount = columnCount - 1;\n\t\t\t}\n\n\t\t\tthis._headerGroup.validate();\n\t\t\tvar activeDividers:Vector.<DisplayObject> = this._verticalDividerStorage.activeDividers;\n\t\t\tvar inactiveDividers:Vector.<DisplayObject> = this._verticalDividerStorage.inactiveDividers;\n\t\t\tfor(var i:int = 0; i < dividerCount; i++)\n\t\t\t{\n\t\t\t\tvar verticalDivider:DisplayObject = null;\n\t\t\t\tif(inactiveDividers.length > 0)\n\t\t\t\t{\n\t\t\t\t\tverticalDivider = inactiveDividers.shift();\n\t\t\t\t\tthis._verticalDividerGroup.setChildIndex(verticalDivider, i);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tverticalDivider = DisplayObject(this._verticalDividerFactory());\n\t\t\t\t\tthis._verticalDividerGroup.addChildAt(verticalDivider, i);\n\t\t\t\t}\n\t\t\t\tactiveDividers[i] = verticalDivider;\n\t\t\t\tverticalDivider.height = this._viewPort.visibleHeight;\n\t\t\t\tif(verticalDivider is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(verticalDivider).validate();\n\t\t\t\t}\n\t\t\t\tvar headerRenderer:IDataGridHeaderRenderer = IDataGridHeaderRenderer(this._headerGroup.getChildAt(i));\n\t\t\t\tverticalDivider.x = headerRenderer.x + headerRenderer.width - (verticalDivider.width / 2);\n\t\t\t\tverticalDivider.y = 0;\n\t\t\t}\n\t\t\tthis.freeInactiveVerticalDividers();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshInactiveVerticalDividers(forceCleanup:Boolean):void\n\t\t{\n\t\t\tvar temp:Vector.<DisplayObject> = this._verticalDividerStorage.inactiveDividers;\n\t\t\tthis._verticalDividerStorage.inactiveDividers = this._verticalDividerStorage.activeDividers;\n\t\t\tthis._verticalDividerStorage.activeDividers = temp;\n\t\t\tif(forceCleanup)\n\t\t\t{\n\t\t\t\tthis.freeInactiveVerticalDividers();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function freeInactiveVerticalDividers():void\n\t\t{\n\t\t\tvar inactiveDividers:Vector.<DisplayObject> = this._verticalDividerStorage.inactiveDividers;\n\t\t\tvar dividerCount:int = inactiveDividers.length;\n\t\t\tfor(var i:int = 0; i < dividerCount; i++)\n\t\t\t{\n\t\t\t\tvar verticalDivider:DisplayObject = inactiveDividers.shift();\n\t\t\t\tverticalDivider.removeFromParent(true);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshHeaderDividers():void\n\t\t{\n\t\t\tthis.refreshInactiveHeaderDividers(this._headerDividerStorage.factory !== this._headerDividerFactory);\n\t\t\tthis._headerDividerStorage.factory = this._headerDividerFactory;\n\n\t\t\tvar dividerCount:int = 0;\n\t\t\tif(this._columns !== null)\n\t\t\t{\n\t\t\t\tdividerCount = this._columns.length;\n\t\t\t\tif(this._scrollBarDisplayMode !== ScrollBarDisplayMode.FIXED ||\n\t\t\t\t\tthis._minVerticalScrollPosition == this._maxVerticalScrollPosition)\n\t\t\t\t{\n\t\t\t\t\tdividerCount--;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._headerGroup.validate();\n\t\t\tvar activeDividers:Vector.<DisplayObject> = this._headerDividerStorage.activeDividers;\n\t\t\tvar inactiveDividers:Vector.<DisplayObject> = this._headerDividerStorage.inactiveDividers;\n\t\t\tfor(var i:int = 0; i < dividerCount; i++)\n\t\t\t{\n\t\t\t\tvar headerDivider:DisplayObject = null;\n\t\t\t\tif(inactiveDividers.length > 0)\n\t\t\t\t{\n\t\t\t\t\theaderDivider = inactiveDividers.shift();\n\t\t\t\t\tthis._headerDividerGroup.setChildIndex(headerDivider, i);\n\t\t\t\t}\n\t\t\t\telse if(this._headerDividerFactory !== null)\n\t\t\t\t{\n\t\t\t\t\theaderDivider = DisplayObject(this._headerDividerFactory());\n\t\t\t\t\theaderDivider.addEventListener(TouchEvent.TOUCH, headerDivider_touchHandler);\n\t\t\t\t\tthis._headerDividerGroup.addChildAt(headerDivider, i);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\theaderDivider = new Quad(3, 1, 0xff00ff);\n\t\t\t\t\theaderDivider.alpha = 0;\n\t\t\t\t\tif(!SystemUtil.isDesktop)\n\t\t\t\t\t{\n\t\t\t\t\t\theaderDivider.width = 22;\n\t\t\t\t\t}\n\t\t\t\t\theaderDivider.addEventListener(TouchEvent.TOUCH, headerDivider_touchHandler);\n\t\t\t\t\tthis._headerDividerGroup.addChildAt(headerDivider, i);\n\t\t\t\t}\n\t\t\t\tactiveDividers[i] = headerDivider;\n\t\t\t\tvar headerRenderer:IDataGridHeaderRenderer = IDataGridHeaderRenderer(this._headerGroup.getChildAt(i));\n\t\t\t\theaderDivider.height = headerRenderer.height;\n\t\t\t\tif(headerDivider is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(headerDivider).validate();\n\t\t\t\t}\n\t\t\t\theaderDivider.x = headerRenderer.x + headerRenderer.width - (headerDivider.width / 2);\n\t\t\t\theaderDivider.y = headerRenderer.y;\n\t\t\t}\n\t\t\tthis.freeInactiveHeaderDividers();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshInactiveHeaderDividers(forceCleanup:Boolean):void\n\t\t{\n\t\t\tvar temp:Vector.<DisplayObject> = this._headerDividerStorage.inactiveDividers;\n\t\t\tthis._headerDividerStorage.inactiveDividers = this._headerDividerStorage.activeDividers;\n\t\t\tthis._headerDividerStorage.activeDividers = temp;\n\t\t\tif(forceCleanup)\n\t\t\t{\n\t\t\t\tthis.freeInactiveHeaderDividers();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function freeInactiveHeaderDividers():void\n\t\t{\n\t\t\tvar inactiveDividers:Vector.<DisplayObject> = this._headerDividerStorage.inactiveDividers;\n\t\t\tvar dividerCount:int = inactiveDividers.length;\n\t\t\tfor(var i:int = 0; i < dividerCount; i++)\n\t\t\t{\n\t\t\t\tvar headerDivider:DisplayObject = inactiveDividers.shift();\n\t\t\t\theaderDivider.removeEventListener(TouchEvent.TOUCH, headerDivider_touchHandler);\n\t\t\t\theaderDivider.removeFromParent(true);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshHeaderRenderers():void\n\t\t{\n\t\t\tthis.findUnrenderedData();\n\t\t\tthis.recoverInactiveHeaderRenderers();\n\t\t\tthis.renderUnrenderedData();\n\t\t\tthis.freeInactiveHeaderRenderers();\n\t\t\tthis._updateForDataReset = false;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function findUnrenderedData():void\n\t\t{\n\t\t\tvar temp:Vector.<IDataGridHeaderRenderer> = this._headerStorage.inactiveHeaderRenderers;\n\t\t\tthis._headerStorage.inactiveHeaderRenderers = this._headerStorage.activeHeaderRenderers;\n\t\t\tthis._headerStorage.activeHeaderRenderers = temp;\n\n\t\t\tvar activeHeaderRenderers:Vector.<IDataGridHeaderRenderer> = this._headerStorage.activeHeaderRenderers;\n\t\t\tvar inactiveHeaderRenderers:Vector.<IDataGridHeaderRenderer> = this._headerStorage.inactiveHeaderRenderers;\n\n\t\t\tvar columnCount:int = 0;\n\t\t\tif(this._columns !== null)\n\t\t\t{\n\t\t\t\tcolumnCount = this._columns.length;\n\t\t\t}\n\n\t\t\tvar activePushIndex:int = activeHeaderRenderers.length;\n\t\t\tvar unrenderedDataLastIndex:int = this._unrenderedHeaders.length;\n\t\t\tfor(var i:int = 0; i < columnCount; i++)\n\t\t\t{\n\t\t\t\tvar column:DataGridColumn = DataGridColumn(this._columns.getItemAt(i));\n\t\t\t\tvar headerRenderer:IDataGridHeaderRenderer = this._headerRendererMap[column] as IDataGridHeaderRenderer;\n\t\t\t\tif(headerRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\theaderRenderer.columnIndex = i;\n\t\t\t\t\theaderRenderer.visible = true;\n\t\t\t\t\tif(column === this._sortedColumn)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._reverseSort)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\theaderRenderer.sortOrder = SortOrder.DESCENDING;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\theaderRenderer.sortOrder = SortOrder.ASCENDING;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\theaderRenderer.sortOrder = SortOrder.NONE;\n\t\t\t\t\t}\n\t\t\t\t\tthis._headerGroup.setChildIndex(DisplayObject(headerRenderer), i);\n\t\t\t\t\tif(this._updateForDataReset)\n\t\t\t\t\t{\n\t\t\t\t\t\t//similar to calling updateItemAt(), replacing the data\n\t\t\t\t\t\t//provider or resetting its source means that we should\n\t\t\t\t\t\t//trick the item renderer into thinking it has new data.\n\t\t\t\t\t\t//many developers seem to expect this behavior, so while\n\t\t\t\t\t\t//it's not the most optimal for performance, it saves on\n\t\t\t\t\t\t//support time in the forums. thankfully, it's still\n\t\t\t\t\t\t//somewhat optimized since the same item renderer will\n\t\t\t\t\t\t//receive the same data, and the children generally\n\t\t\t\t\t\t//won't have changed much, if at all.\n\t\t\t\t\t\theaderRenderer.data = null;\n\t\t\t\t\t\theaderRenderer.data = column;\n\t\t\t\t\t}\n\t\t\t\t\tactiveHeaderRenderers[activePushIndex] = headerRenderer;\n\t\t\t\t\tactivePushIndex++;\n\n\t\t\t\t\tvar inactiveIndex:int = inactiveHeaderRenderers.indexOf(headerRenderer);\n\t\t\t\t\tif(inactiveIndex >= 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tinactiveHeaderRenderers[inactiveIndex] = null;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new IllegalOperationError(\"DataGrid: header renderer map contains bad data. This may be caused by duplicate items in the columns collection, which is not allowed.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._unrenderedHeaders[unrenderedDataLastIndex] = i;\n\t\t\t\t\tunrenderedDataLastIndex++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function recoverInactiveHeaderRenderers():void\n\t\t{\n\t\t\tvar inactiveHeaderRenderers:Vector.<IDataGridHeaderRenderer> = this._headerStorage.inactiveHeaderRenderers;\n\t\t\tvar count:int = inactiveHeaderRenderers.length;\n\t\t\tfor(var i:int = 0; i < count; i++)\n\t\t\t{\n\t\t\t\tvar headerRenderer:IDataGridHeaderRenderer = inactiveHeaderRenderers[i];\n\t\t\t\tif(headerRenderer === null || headerRenderer.data === null)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.RENDERER_REMOVE, false, headerRenderer);\n\t\t\t\tdelete this._headerRendererMap[headerRenderer.data];\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function renderUnrenderedData():void\n\t\t{\n\t\t\tvar headerRendererCount:int = this._unrenderedHeaders.length;\n\t\t\tfor(var i:int = 0; i < headerRendererCount; i++)\n\t\t\t{\n\t\t\t\tvar columnIndex:int = this._unrenderedHeaders.shift();\n\t\t\t\tvar column:DataGridColumn = DataGridColumn(this._columns.getItemAt(columnIndex));\n\t\t\t\tthis.createHeaderRenderer(column, columnIndex);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function freeInactiveHeaderRenderers():void\n\t\t{\n\t\t\tvar inactiveHeaderRenderers:Vector.<IDataGridHeaderRenderer> = this._headerStorage.inactiveHeaderRenderers;\n\t\t\tvar count:int = inactiveHeaderRenderers.length;\n\t\t\tfor(var i:int = 0; i < count; i++)\n\t\t\t{\n\t\t\t\tvar headerRenderer:IDataGridHeaderRenderer = inactiveHeaderRenderers.shift();\n\t\t\t\tif(headerRenderer === null)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tthis.destroyHeaderRenderer(headerRenderer);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createHeaderRenderer(column:DataGridColumn, columnIndex:int):IDataGridHeaderRenderer\n\t\t{\n\t\t\tvar headerRendererFactory:Function = column.headerRendererFactory;\n\t\t\tif(headerRendererFactory === null)\n\t\t\t{\n\t\t\t\theaderRendererFactory = this._headerRendererFactory;\n\t\t\t}\n\t\t\tif(headerRendererFactory === null)\n\t\t\t{\n\t\t\t\theaderRendererFactory = defaultHeaderRendererFactory;\n\t\t\t}\n\t\t\tvar customHeaderRendererStyleName:String = column.customHeaderRendererStyleName;\n\t\t\tif(customHeaderRendererStyleName === null)\n\t\t\t{\n\t\t\t\tcustomHeaderRendererStyleName = this._customHeaderRendererStyleName;\n\t\t\t}\n\t\t\tvar inactiveHeaderRenderers:Vector.<IDataGridHeaderRenderer> = this._headerStorage.inactiveHeaderRenderers;\n\t\t\tvar activeHeaderRenderers:Vector.<IDataGridHeaderRenderer> = this._headerStorage.activeHeaderRenderers;\n\t\t\tvar headerRenderer:IDataGridHeaderRenderer = null;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tif(inactiveHeaderRenderers.length == 0)\n\t\t\t\t{\n\t\t\t\t\theaderRenderer = IDataGridHeaderRenderer(headerRendererFactory());\n\t\t\t\t\theaderRenderer.addEventListener(TouchEvent.TOUCH, headerRenderer_touchHandler);\n\t\t\t\t\theaderRenderer.addEventListener(Event.TRIGGERED, headerRenderer_triggeredHandler);\n\t\t\t\t\tif(customHeaderRendererStyleName !== null && customHeaderRendererStyleName.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\theaderRenderer.styleNameList.add(customHeaderRendererStyleName);\n\t\t\t\t\t}\n\t\t\t\t\tthis._headerGroup.addChild(DisplayObject(headerRenderer));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\theaderRenderer = inactiveHeaderRenderers.shift();\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile(headerRenderer === null);\n\t\t\theaderRenderer.data = column;\n\t\t\theaderRenderer.columnIndex = columnIndex;\n\t\t\theaderRenderer.owner = this;\n\n\t\t\tthis._headerRendererMap[column] = headerRenderer;\n\t\t\tactiveHeaderRenderers[activeHeaderRenderers.length] = headerRenderer;\n\t\t\tthis.dispatchEventWith(FeathersEventType.RENDERER_ADD, false, headerRenderer);\n\n\t\t\tcolumn.addEventListener(Event.CHANGE, column_changeHandler);\n\n\t\t\treturn headerRenderer;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function destroyHeaderRenderer(headerRenderer:IDataGridHeaderRenderer):void\n\t\t{\n\t\t\tif(headerRenderer.data !== null)\n\t\t\t{\n\t\t\t\theaderRenderer.data.removeEventListener(Event.CHANGE, column_changeHandler);\n\t\t\t}\n\t\t\theaderRenderer.removeEventListener(Event.TRIGGERED, headerRenderer_triggeredHandler);\n\t\t\theaderRenderer.removeEventListener(TouchEvent.TOUCH, headerRenderer_touchHandler);\n\t\t\theaderRenderer.owner = null;\n\t\t\theaderRenderer.data = null;\n\t\t\theaderRenderer.columnIndex = -1;\n\t\t\tthis._headerGroup.removeChild(DisplayObject(headerRenderer), true);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshDataViewPortProperties():void\n\t\t{\n\t\t\tthis.dataViewPort.isSelectable = this._isSelectable;\n\t\t\tthis.dataViewPort.allowMultipleSelection = this._allowMultipleSelection;\n\t\t\tthis.dataViewPort.selectedIndices = this._selectedIndices;\n\t\t\tthis.dataViewPort.dataProvider = this._dataProvider;\n\t\t\tthis.dataViewPort.columns = this._columns;\n\t\t\tthis.dataViewPort.typicalItem = this._typicalItem;\n\t\t\tthis.dataViewPort.layout = this._layout;\n\t\t\tthis.dataViewPort.customColumnSizes = this._customColumnSizes;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function handlePendingScroll():void\n\t\t{\n\t\t\tif(this.pendingItemIndex >= 0)\n\t\t\t{\n\t\t\t\tvar item:Object = null;\n\t\t\t\tif(this._dataProvider !== null)\n\t\t\t\t{\n\t\t\t\t\titem = this._dataProvider.getItemAt(this.pendingItemIndex);\n\t\t\t\t}\n\t\t\t\tif(item is Object)\n\t\t\t\t{\n\t\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\t\tthis.dataViewPort.getScrollPositionForIndex(this.pendingItemIndex, point);\n\t\t\t\t\tthis.pendingItemIndex = -1;\n\n\t\t\t\t\tvar targetHorizontalScrollPosition:Number = point.x;\n\t\t\t\t\tvar targetVerticalScrollPosition:Number = point.y;\n\t\t\t\t\tPool.putPoint(point);\n\t\t\t\t\tif(targetHorizontalScrollPosition < this._minHorizontalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\ttargetHorizontalScrollPosition = this._minHorizontalScrollPosition;\n\t\t\t\t\t}\n\t\t\t\t\telse if(targetHorizontalScrollPosition > this._maxHorizontalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\ttargetHorizontalScrollPosition = this._maxHorizontalScrollPosition;\n\t\t\t\t\t}\n\t\t\t\t\tif(targetVerticalScrollPosition < this._minVerticalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\ttargetVerticalScrollPosition = this._minVerticalScrollPosition;\n\t\t\t\t\t}\n\t\t\t\t\telse if(targetVerticalScrollPosition > this._maxVerticalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\ttargetVerticalScrollPosition = this._maxVerticalScrollPosition;\n\t\t\t\t\t}\n\t\t\t\t\tthis.throwTo(targetHorizontalScrollPosition, targetVerticalScrollPosition, this.pendingScrollDuration);\n\t\t\t\t}\n\t\t\t}\n\t\t\tsuper.handlePendingScroll();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function column_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function nativeStage_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(!this._isSelectable)\n\t\t\t{\n\t\t\t\t//not selectable, but should scroll\n\t\t\t\tsuper.nativeStage_keyDownHandler(event);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(event.isDefaultPrevented())\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!this._dataProvider)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._selectedIndex != -1 && (event.keyCode == Keyboard.SPACE ||\n\t\t\t\t((event.keyLocation == 4 || DeviceCapabilities.simulateDPad) && event.keyCode == Keyboard.ENTER)))\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(Event.TRIGGERED, false, this.selectedItem);\n\t\t\t}\n\t\t\tif(event.keyCode == Keyboard.HOME || event.keyCode == Keyboard.END ||\n\t\t\t\tevent.keyCode == Keyboard.PAGE_UP || event.keyCode == Keyboard.PAGE_DOWN ||\n\t\t\t\tevent.keyCode == Keyboard.UP || event.keyCode == Keyboard.DOWN ||\n\t\t\t\tevent.keyCode == Keyboard.LEFT || event.keyCode == Keyboard.RIGHT)\n\t\t\t{\n\t\t\t\tvar newIndex:int = this.dataViewPort.calculateNavigationDestination(this.selectedIndex, event.keyCode);\n\t\t\t\tif(this.selectedIndex != newIndex)\n\t\t\t\t{\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tthis.selectedIndex = newIndex;\n\t\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\t\tthis.dataViewPort.getNearestScrollPositionForIndex(this.selectedIndex, point);\n\t\t\t\t\tthis.scrollToPosition(point.x, point.y, this._keyScrollDuration);\n\t\t\t\t\tPool.putPoint(point);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function stage_gestureDirectionalTapHandler(event:TransformGestureEvent):void\n\t\t{\n\t\t\tif(event.isDefaultPrevented())\n\t\t\t{\n\t\t\t\t//something else has already handled this event\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar keyCode:uint = int.MAX_VALUE;\n\t\t\tif(event.offsetY < 0)\n\t\t\t{\n\t\t\t\tkeyCode = Keyboard.UP;\n\t\t\t}\n\t\t\telse if(event.offsetY > 0)\n\t\t\t{\n\t\t\t\tkeyCode = Keyboard.DOWN;\n\t\t\t}\n\t\t\telse if(event.offsetX > 0)\n\t\t\t{\n\t\t\t\tkeyCode = Keyboard.RIGHT;\n\t\t\t}\n\t\t\telse if(event.offsetX < 0)\n\t\t\t{\n\t\t\t\tkeyCode = Keyboard.LEFT;\n\t\t\t}\n\t\t\tif(keyCode == int.MAX_VALUE)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar newIndex:int = this.dataViewPort.calculateNavigationDestination(this.selectedIndex, keyCode);\n\t\t\tif(this.selectedIndex != newIndex)\n\t\t\t{\n\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t\t//event.preventDefault();\n\t\t\t\tthis.selectedIndex = newIndex;\n\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\tthis.dataViewPort.getNearestScrollPositionForIndex(this.selectedIndex, point);\n\t\t\t\tthis.scrollToPosition(point.x, point.y, this._keyScrollDuration);\n\t\t\t\tPool.putPoint(point);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function columns_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function columns_resetHandler(event:Event):void\n\t\t{\n\t\t\tthis._updateForDataReset = true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function columns_updateAllHandler(event:Event):void\n\t\t{\n\t\t\t//we're treating this similar to the RESET event because enough\n\t\t\t//users are treating UPDATE_ALL similarly. technically, UPDATE_ALL\n\t\t\t//is supposed to affect only existing items, but it's confusing when\n\t\t\t//new items are added and not displayed.\n\t\t\tthis._updateForDataReset = true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_resetHandler(event:Event):void\n\t\t{\n\t\t\tthis.horizontalScrollPosition = 0;\n\t\t\tthis.verticalScrollPosition = 0;\n\n\t\t\t//the entire data provider was replaced. select no item.\n\t\t\tthis._selectedIndices.removeAll();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_addItemHandler(event:Event, index:int):void\n\t\t{\n\t\t\tif(this._selectedIndex == -1)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar selectionChanged:Boolean = false;\n\t\t\tvar newIndices:Vector.<int> = new <int>[];\n\t\t\tvar indexCount:int = this._selectedIndices.length;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tvar currentIndex:int = this._selectedIndices.getItemAt(i) as int;\n\t\t\t\tif(currentIndex >= index)\n\t\t\t\t{\n\t\t\t\t\tcurrentIndex++;\n\t\t\t\t\tselectionChanged = true;\n\t\t\t\t}\n\t\t\t\tnewIndices.push(currentIndex);\n\t\t\t}\n\t\t\tif(selectionChanged)\n\t\t\t{\n\t\t\t\tthis._selectedIndices.data = newIndices;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_removeAllHandler(event:Event):void\n\t\t{\n\t\t\tthis.selectedIndex = -1;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_removeItemHandler(event:Event, index:int):void\n\t\t{\n\t\t\tif(this._selectedIndex == -1)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar selectionChanged:Boolean = false;\n\t\t\tvar newIndices:Vector.<int> = new <int>[];\n\t\t\tvar indexCount:int = this._selectedIndices.length;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tvar currentIndex:int = this._selectedIndices.getItemAt(i) as int;\n\t\t\t\tif(currentIndex == index)\n\t\t\t\t{\n\t\t\t\t\tselectionChanged = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(currentIndex > index)\n\t\t\t\t\t{\n\t\t\t\t\t\tcurrentIndex--;\n\t\t\t\t\t\tselectionChanged = true;\n\t\t\t\t\t}\n\t\t\t\t\tnewIndices.push(currentIndex);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(selectionChanged)\n\t\t\t{\n\t\t\t\tthis._selectedIndices.data = newIndices;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshSelectedIndicesAfterFilterOrSort():void\n\t\t{\n\t\t\tif(this._selectedIndex == -1)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar selectionChanged:Boolean = false;\n\t\t\tvar newIndices:Vector.<int> = new <int>[];\n\t\t\tvar pushIndex:int = 0;\n\t\t\tvar count:int = this._selectedItems.length;\n\t\t\tfor(var i:int = 0; i < count; i++)\n\t\t\t{\n\t\t\t\tvar selectedItem:Object = this._selectedItems[i];\n\t\t\t\tvar oldIndex:int = this._selectedIndices.getItemAt(i) as int;\n\t\t\t\tvar newIndex:int = this._dataProvider.getItemIndex(selectedItem);\n\t\t\t\tif(newIndex >= 0)\n\t\t\t\t{\n\t\t\t\t\tif(newIndex != oldIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\t//the item was not filtered, but it moved to a new index\n\t\t\t\t\t\tselectionChanged = true;\n\t\t\t\t\t}\n\t\t\t\t\tnewIndices[pushIndex] = newIndex;\n\t\t\t\t\tpushIndex++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//the item is filtered, so it should not be selected\n\t\t\t\t\tselectionChanged = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(selectionChanged)\n\t\t\t{\n\t\t\t\tthis._selectedIndices.data = newIndices;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_sortChangeHandler(event:Event):void\n\t\t{\n\t\t\tthis.refreshSelectedIndicesAfterFilterOrSort();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_filterChangeHandler(event:Event):void\n\t\t{\n\t\t\tthis.refreshSelectedIndicesAfterFilterOrSort();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_replaceItemHandler(event:Event, index:int):void\n\t\t{\n\t\t\tif(this._selectedIndex == -1)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar indexOfIndex:int = this._selectedIndices.getItemIndex(index);\n\t\t\tif(indexOfIndex >= 0)\n\t\t\t{\n\t\t\t\tthis._selectedIndices.removeItemAt(indexOfIndex);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function selectedIndices_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.getSelectedItems(this._selectedItems);\n\t\t\tif(this._selectedIndices.length > 0)\n\t\t\t{\n\t\t\t\tthis._selectedIndex = this._selectedIndices.getItemAt(0) as int;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(this._selectedIndex < 0)\n\t\t\t\t{\n\t\t\t\t\t//no change\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._selectedIndex = -1;\n\t\t\t}\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layout_scrollHandler(event:Event, scrollOffset:Point):void\n\t\t{\n\t\t\tvar layout:IVariableVirtualLayout = IVariableVirtualLayout(this._layout);\n\t\t\tif(!this.isScrolling || !layout.useVirtualLayout || !layout.hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar scrollOffsetX:Number = scrollOffset.x;\n\t\t\tthis._startHorizontalScrollPosition += scrollOffsetX;\n\t\t\tthis._horizontalScrollPosition += scrollOffsetX;\n\t\t\tif(this._horizontalAutoScrollTween)\n\t\t\t{\n\t\t\t\tthis._targetHorizontalScrollPosition += scrollOffsetX;\n\t\t\t\tthis.throwTo(this._targetHorizontalScrollPosition, NaN, this._horizontalAutoScrollTween.totalTime - this._horizontalAutoScrollTween.currentTime);\n\t\t\t}\n\n\t\t\tvar scrollOffsetY:Number = scrollOffset.y;\n\t\t\tthis._startVerticalScrollPosition += scrollOffsetY;\n\t\t\tthis._verticalScrollPosition += scrollOffsetY;\n\t\t\tif(this._verticalAutoScrollTween)\n\t\t\t{\n\t\t\t\tthis._targetVerticalScrollPosition += scrollOffsetY;\n\t\t\t\tthis.throwTo(NaN, this._targetVerticalScrollPosition, this._verticalAutoScrollTween.totalTime - this._verticalAutoScrollTween.currentTime);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function headerRenderer_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tvar headerRenderer:IDataGridHeaderRenderer = IDataGridHeaderRenderer(event.currentTarget);\n\t\t\tvar column:DataGridColumn = headerRenderer.data;\n\t\t\tif(!this._sortableColumns || column.sortOrder === SortOrder.NONE)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._sortedColumn != column)\n\t\t\t{\n\t\t\t\tthis._sortedColumn = column;\n\t\t\t\tthis._reverseSort = column.sortOrder === SortOrder.DESCENDING;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._reverseSort = !this._reverseSort;\n\t\t\t}\n\t\t\tif(this._reverseSort)\n\t\t\t{\n\t\t\t\tthis._dataProvider.sortCompareFunction = this.reverseSortCompareFunction;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._dataProvider.sortCompareFunction = this.sortCompareFunction;\n\t\t\t}\n\t\t\t//the sortCompareFunction might not have changed if we're sorting a\n\t\t\t//different column, so force a refresh.\n\t\t\tthis._dataProvider.refresh();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _reverseSort:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _sortedColumn:DataGridColumn = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function reverseSortCompareFunction(a:Object, b:Object):int\n\t\t{\n\t\t\treturn -this.sortCompareFunction(a, b);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function sortCompareFunction(a:Object, b:Object):int\n\t\t{\n\t\t\tvar aField:Object = a[this._sortedColumn.dataField];\n\t\t\tvar bField:Object = b[this._sortedColumn.dataField];\n\t\t\tvar sortCompareFunction:Function = this._sortedColumn.sortCompareFunction;\n\t\t\tif(sortCompareFunction === null)\n\t\t\t{\n\t\t\t\tsortCompareFunction = defaultSortCompareFunction;\n\t\t\t}\n\t\t\treturn sortCompareFunction(aField, bField);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataGrid_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(this._headerTouchID != -1)\n\t\t\t{\n\t\t\t\t//a touch has begun, so we'll ignore all other touches.\n\t\t\t\tvar touch:Touch = event.getTouch(this, null, this._headerTouchID);\n\t\t\t\tif(touch === null)\n\t\t\t\t{\n\t\t\t\t\t//this should not happen.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif(touch.phase === TouchPhase.ENDED)\n\t\t\t\t{\n\t\t\t\t\tthis.removeEventListener(TouchEvent.TOUCH, dataGrid_touchHandler);\n\t\t\t\t\t//these might be null if there was no TouchPhase.MOVED\n\t\t\t\t\tif(this._currentColumnDropIndicatorSkin !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._currentColumnDropIndicatorSkin.removeFromParent(this._currentColumnDropIndicatorSkin !== this._columnDropIndicatorSkin);\n\t\t\t\t\t\tthis._currentColumnDropIndicatorSkin = null;\n\t\t\t\t\t}\n\t\t\t\t\tif(this._currentColumnDragOverlaySkin !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._currentColumnDragOverlaySkin.removeFromParent(this._currentColumnDragOverlaySkin !== this._columnDragOverlaySkin);\n\t\t\t\t\t\tthis._currentColumnDragOverlaySkin = null;\n\t\t\t\t\t}\n\t\t\t\t\tthis._headerTouchID = -1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function headerRenderer_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tvar headerRenderer:IDataGridHeaderRenderer = IDataGridHeaderRenderer(event.currentTarget);\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\tthis._headerTouchID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._headerTouchID != -1)\n\t\t\t{\n\t\t\t\t//a touch has begun, so we'll ignore all other touches.\n\t\t\t\tvar touch:Touch = event.getTouch(DisplayObject(headerRenderer), null, this._headerTouchID);\n\t\t\t\tif(touch === null)\n\t\t\t\t{\n\t\t\t\t\t//this should not happen.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif(touch.phase === TouchPhase.MOVED)\n\t\t\t\t{\n\t\t\t\t\tif(!DragDropManager.isDragging && this._reorderColumns)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar column:DataGridColumn = DataGridColumn(this._columns.getItemAt(headerRenderer.columnIndex));\n\t\t\t\t\t\tvar dragData:DragData = new DragData();\n\t\t\t\t\t\tdragData.setDataForFormat(DATA_GRID_HEADER_DRAG_FORMAT, column);\n\t\t\t\t\t\tvar self:DataGrid = this;\n\t\t\t\t\t\tvar avatar:RenderDelegate = new RenderDelegate(DisplayObject(headerRenderer));\n\t\t\t\t\t\tavatar.alpha = this._columnDragAvatarAlpha;\n\t\t\t\t\t\tDragDropManager.startDrag(this, touch, dragData, avatar);\n\t\t\t\t\t\tif(this._columnDropIndicatorSkin === null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._currentColumnDropIndicatorSkin = new Quad(1, 1, 0x000000);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(this._columnDropIndicatorSkin !== null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._currentColumnDropIndicatorSkin = this._columnDropIndicatorSkin;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//start out invisible and TouchPhase.MOVED will reveal it, if necessary\n\t\t\t\t\t\tthis._currentColumnDropIndicatorSkin.visible = false;\n\t\t\t\t\t\tthis.addChild(this._currentColumnDropIndicatorSkin);\n\n\t\t\t\t\t\tif(this._columnDragOverlaySkin === null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._currentColumnDragOverlaySkin = new Quad(1, 1, 0xff00ff);\n\t\t\t\t\t\t\tthis._currentColumnDragOverlaySkin.alpha = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._currentColumnDragOverlaySkin = this._columnDragOverlaySkin;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._currentColumnDragOverlaySkin.x = this._headerGroup.x + headerRenderer.x;\n\t\t\t\t\t\tthis._currentColumnDragOverlaySkin.y = this._headerGroup.y + headerRenderer.y;\n\t\t\t\t\t\tthis._currentColumnDragOverlaySkin.width = headerRenderer.width;\n\t\t\t\t\t\tthis._currentColumnDragOverlaySkin.height = this._viewPort.y + this._viewPort.visibleHeight - this._headerGroup.y;\n\t\t\t\t\t\tthis.addChild(this._currentColumnDragOverlaySkin);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(!DragDropManager.isDragging && this._reorderColumns)\n\t\t\t{\n\t\t\t\t//we aren't tracking another touch, so let's look for a new one.\n\t\t\t\ttouch = event.getTouch(DisplayObject(headerRenderer), TouchPhase.BEGAN);\n\t\t\t\tif(touch === null)\n\t\t\t\t{\n\t\t\t\t\t//we only care about the began phase. ignore all other\n\t\t\t\t\t//phases when we don't have a saved touch ID.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._headerTouchID = touch.id;\n\t\t\t\tthis._headerTouchX = touch.globalX;\n\t\t\t\tthis._headerTouchY = touch.globalX;\n\t\t\t\tthis._draggedHeaderIndex = headerRenderer.columnIndex;\n\t\t\t\t//we want to check for TouchPhase.ENDED after it's bubbled\n\t\t\t\t//beyond the header renderer\n\t\t\t\tthis.addEventListener(TouchEvent.TOUCH, dataGrid_touchHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getHeaderDropIndex(globalX:Number):int\n\t\t{\n\t\t\tvar headerCount:int = this._headerGroup.numChildren;\n\t\t\tfor(var i:int = 0; i < headerCount; i++)\n\t\t\t{\n\t\t\t\tvar header:IDataGridHeaderRenderer = IDataGridHeaderRenderer(this._headerGroup.getChildAt(i));\n\t\t\t\tvar point:Point = Pool.getPoint(header.width / 2, 0);\n\t\t\t\theader.localToGlobal(point, point);\n\t\t\t\tvar headerGlobalMiddleX:Number = point.x;\n\t\t\t\tPool.putPoint(point);\n\t\t\t\tif(globalX < headerGlobalMiddleX)\n\t\t\t\t{\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn headerCount;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataGrid_dragEnterHandler(event:DragDropEvent):void\n\t\t{\n\t\t\tif(DragDropManager.dragSource !== this || !event.dragData.hasDataForFormat(DATA_GRID_HEADER_DRAG_FORMAT))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tDragDropManager.acceptDrag(this);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataGrid_dragMoveHandler(event:DragDropEvent):void\n\t\t{\n\t\t\tif(DragDropManager.dragSource !== this || !event.dragData.hasDataForFormat(DATA_GRID_HEADER_DRAG_FORMAT))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar point:Point = Pool.getPoint(event.localX, event.localY);\n\t\t\tthis.localToGlobal(point, point);\n\t\t\tvar globalDropX:Number = point.x;\n\t\t\tPool.putPoint(point);\n\t\t\tvar dropIndex:int = this.getHeaderDropIndex(globalDropX);\n\t\t\tvar showDropIndicator:Boolean = dropIndex != this._draggedHeaderIndex &&\n\t\t\t\tdropIndex != (this._draggedHeaderIndex + 1);\n\t\t\tthis._currentColumnDropIndicatorSkin.visible = showDropIndicator;\n\t\t\tif(!showDropIndicator)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._extendedColumnDropIndicator)\n\t\t\t{\n\t\t\t\tthis._currentColumnDropIndicatorSkin.height = this._headerGroup.height + this._viewPort.visibleHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._currentColumnDropIndicatorSkin.height = this._headerGroup.height;\n\t\t\t}\n\t\t\tif(this._currentColumnDropIndicatorSkin is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this._currentColumnDropIndicatorSkin).validate();\n\t\t\t}\n\t\t\tvar dropIndicatorX:Number = 0;\n\t\t\tif(dropIndex == this._columns.length)\n\t\t\t{\n\t\t\t\tvar header:DisplayObject = this._headerGroup.getChildAt(dropIndex - 1);\n\t\t\t\tdropIndicatorX = header.x + header.width;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\theader = this._headerGroup.getChildAt(dropIndex);\n\t\t\t\tdropIndicatorX = header.x;\n\t\t\t}\n\t\t\tthis._currentColumnDropIndicatorSkin.x = this._headerGroup.x + dropIndicatorX - (this._currentColumnDropIndicatorSkin.width / 2);\n\t\t\tthis._currentColumnDropIndicatorSkin.y = this._headerGroup.y;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataGrid_dragDropHandler(event:DragDropEvent):void\n\t\t{\n\t\t\tif(DragDropManager.dragSource !== this || !event.dragData.hasDataForFormat(DATA_GRID_HEADER_DRAG_FORMAT))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar point:Point = Pool.getPoint(event.localX, event.localY);\n\t\t\tthis.localToGlobal(point, point);\n\t\t\tvar globalDropX:Number = point.x;\n\t\t\tPool.putPoint(point);\n\t\t\tvar dropIndex:int = this.getHeaderDropIndex(globalDropX);\n\t\t\tif(dropIndex == this._draggedHeaderIndex ||\n\t\t\t\t(dropIndex == (this._draggedHeaderIndex + 1)))\n\t\t\t{\n\t\t\t\t//it's the same position, so do nothing\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(dropIndex > this._draggedHeaderIndex)\n\t\t\t{\n\t\t\t\tdropIndex--;\n\t\t\t}\n\t\t\tvar column:DataGridColumn = DataGridColumn(this._columns.removeItemAt(this._draggedHeaderIndex));\n\t\t\tthis._columns.addItemAt(column, dropIndex);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function headerDivider_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tvar divider:DisplayObject = DisplayObject(event.currentTarget);\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\tthis._headerDividerTouchID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar dividerIndex:int = this._headerDividerStorage.activeDividers.indexOf(divider);\n\t\t\tif(dividerIndex == (this._headerDividerStorage.activeDividers.length - 1) &&\n\t\t\t\tthis._scrollBarDisplayMode === ScrollBarDisplayMode.FIXED &&\n\t\t\t\tthis._minVerticalScrollPosition != this._maxVerticalScrollPosition)\n\t\t\t{\n\t\t\t\t//no resizing!\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._headerDividerTouchID != -1)\n\t\t\t{\n\t\t\t\t//a touch has begun, so we'll ignore all other touches.\n\t\t\t\tvar touch:Touch = event.getTouch(divider, null, this._headerDividerTouchID);\n\t\t\t\tif(touch === null)\n\t\t\t\t{\n\t\t\t\t\t//this should not happen.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif(touch.phase === TouchPhase.ENDED)\n\t\t\t\t{\n\t\t\t\t\tthis.calculateResizedColumnWidth();\n\t\t\t\t\tthis._resizingColumnIndex = -1;\n\n\t\t\t\t\tthis._currentColumnResizeSkin.removeFromParent(this._currentColumnResizeSkin !== this._columnResizeSkin);\n\t\t\t\t\tthis._currentColumnResizeSkin = null;\n\t\t\t\t\tthis._headerDividerTouchID = -1;\n\t\t\t\t}\n\t\t\t\telse if(touch.phase === TouchPhase.MOVED)\n\t\t\t\t{\n\t\t\t\t\tvar column:DataGridColumn = DataGridColumn(this._columns.getItemAt(this._resizingColumnIndex));\n\t\t\t\t\tvar headerRenderer:IDataGridHeaderRenderer = IDataGridHeaderRenderer(this._headerGroup.getChildAt(this._resizingColumnIndex));\n\t\t\t\t\tvar minX:Number = headerRenderer.x + column.minWidth;\n\t\t\t\t\tvar maxX:Number = this.actualWidth - this._currentColumnResizeSkin.width - this._rightViewPortOffset;\n\t\t\t\t\tvar difference:Number = touch.globalX - this._headerDividerTouchX;\n\t\t\t\t\tvar newX:Number = divider.x + (divider.width / 2) - (this._currentColumnResizeSkin.width / 2) + difference;\n\t\t\t\t\tif(newX < minX)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewX = minX;\n\t\t\t\t\t}\n\t\t\t\t\telse if(newX > maxX)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewX = maxX;\n\t\t\t\t\t}\n\t\t\t\t\tthis._currentColumnResizeSkin.x = newX;\n\t\t\t\t\tthis._currentColumnResizeSkin.y = this._headerGroup.y;\n\t\t\t\t\tthis._currentColumnResizeSkin.height = this.actualHeight - this._bottomViewPortOffset - this._currentColumnResizeSkin.y;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(this._resizableColumns)\n\t\t\t{\n\t\t\t\t//we aren't tracking another touch, so let's look for a new one.\n\t\t\t\ttouch = event.getTouch(divider, TouchPhase.BEGAN);\n\t\t\t\tif(touch === null)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcolumn = DataGridColumn(this._columns.getItemAt(dividerIndex));\n\t\t\t\tif(!column.resizable)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._resizingColumnIndex = dividerIndex;\n\t\t\t\tthis._headerDividerTouchID = touch.id;\n\t\t\t\tthis._headerDividerTouchX = touch.globalX;\n\t\t\t\theaderRenderer = IDataGridHeaderRenderer(this._headerGroup.getChildAt(dividerIndex));\n\t\t\t\tif(this._columnResizeSkin === null)\n\t\t\t\t{\n\t\t\t\t\tthis._currentColumnResizeSkin = new Quad(1, 1, 0x000000);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._currentColumnResizeSkin = this._columnResizeSkin;\n\t\t\t\t}\n\t\t\t\tthis._currentColumnResizeSkin.height = this.actualHeight;\n\t\t\t\tthis.addChild(this._currentColumnResizeSkin);\n\t\t\t\tif(this._currentColumnResizeSkin is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this._currentColumnResizeSkin).validate();\n\t\t\t\t}\n\t\t\t\tthis._currentColumnResizeSkin.x = divider.x + (divider.width / 2) - (this._currentColumnResizeSkin.width / 2);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function calculateResizedColumnWidth():void\n\t\t{\n\t\t\tvar columnCount:int = this._columns.length;\n\t\t\tif(this._customColumnSizes === null)\n\t\t\t{\n\t\t\t\tthis._customColumnSizes = new Vector.<Number>(columnCount);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//make a copy so that it will be detected as a change\n\t\t\t\tthis._customColumnSizes = this._customColumnSizes.slice();\n\t\t\t\t//try to keep any column widths we already saved\n\t\t\t\tthis._customColumnSizes.length = columnCount;\n\t\t\t}\n\t\t\tvar column:DataGridColumn = DataGridColumn(this._columns.getItemAt(this._resizingColumnIndex));\n\t\t\t//clear the explicit width because the user resized it\n\t\t\tcolumn.width = NaN;\n\t\t\tvar headerRenderer:IDataGridHeaderRenderer = IDataGridHeaderRenderer(this._headerGroup.getChildAt(this._resizingColumnIndex));\n\t\t\tvar preferredWidth:Number = this._currentColumnResizeSkin.x + (this._currentColumnResizeSkin.width / 2) - headerRenderer.x;\n\t\t\tvar totalMinWidth:Number = 0;\n\t\t\tvar originalWidth:Number = headerRenderer.width;\n\t\t\tvar totalWidthAfter:Number = 0;\n\t\t\tvar indicesAfter:Vector.<int> = new <int>[];\n\t\t\tfor(var i:int = 0; i < columnCount; i++)\n\t\t\t{\n\t\t\t\tvar currentColumn:DataGridColumn = DataGridColumn(this._columns.getItemAt(i));\n\t\t\t\tif(i == this._resizingColumnIndex)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\telse if(i < this._resizingColumnIndex)\n\t\t\t\t{\n\t\t\t\t\t//we want these columns to maintain their width so that the\n\t\t\t\t\t//resized one will start at the same x position\n\t\t\t\t\t//however, we're not setting the width property on the\n\t\t\t\t\t//DataGridColumn because we want them to be able to resize\n\t\t\t\t\t//later if the whole DataGrid resizes.\n\t\t\t\t\theaderRenderer = IDataGridHeaderRenderer(this._headerGroup.getChildAt(i));\n\t\t\t\t\tthis._customColumnSizes[i] = headerRenderer.width;\n\t\t\t\t\ttotalMinWidth += headerRenderer.width;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(currentColumn.width === currentColumn.width) //!isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\ttotalMinWidth += currentColumn.width;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\ttotalMinWidth += currentColumn.minWidth;\n\t\t\t\t\t}\n\t\t\t\t\theaderRenderer = IDataGridHeaderRenderer(this._headerGroup.getChildAt(i));\n\t\t\t\t\tvar columnWidth:Number = headerRenderer.width;\n\t\t\t\t\ttotalWidthAfter += columnWidth;\n\t\t\t\t\tthis._customColumnSizes[i] = columnWidth;\n\t\t\t\t\tindicesAfter[indicesAfter.length] = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(indicesAfter.length == 0)\n\t\t\t{\n\t\t\t\t//if all of the columns after the resizing one have explicit\n\t\t\t\t//widths, we need to force one to be resized\n\t\t\t\tvar index:int = this._resizingColumnIndex + 1;\n\t\t\t\tindicesAfter[0] = index;\n\t\t\t\tcolumn = DataGridColumn(this._columns.getItemAt(index));\n\t\t\t\ttotalWidthAfter = column.width;\n\t\t\t\ttotalMinWidth -= totalWidthAfter;\n\t\t\t\ttotalMinWidth += column.minWidth;\n\t\t\t\tthis._customColumnSizes[index] = totalWidthAfter;\n\t\t\t\tcolumn.width = NaN;\n\t\t\t}\n\t\t\tvar newWidth:Number = preferredWidth;\n\t\t\tvar maxWidth:Number = this._headerGroup.width - totalMinWidth - this._leftViewPortOffset - this._rightViewPortOffset;\n\t\t\tif(newWidth > maxWidth)\n\t\t\t{\n\t\t\t\tnewWidth = maxWidth;\n\t\t\t}\n\t\t\tif(newWidth < column.minWidth)\n\t\t\t{\n\t\t\t\tnewWidth = column.minWidth;\n\t\t\t}\n\t\t\tthis._customColumnSizes[this._resizingColumnIndex] = newWidth;\n\n\t\t\t//the width to distribute may be positive or negative, depending on\n\t\t\t//whether the resized column was made smaller or larger\n\t\t\tvar widthToDistribute:Number = originalWidth - newWidth;\n\t\t\tthis.distributeWidthToIndices(widthToDistribute, indicesAfter, totalWidthAfter);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\t}\n}\n\nimport feathers.controls.renderers.IDataGridHeaderRenderer;\n\nimport starling.display.DisplayObject;\n\nclass HeaderRendererFactoryStorage\n{\n\tpublic var activeHeaderRenderers:Vector.<IDataGridHeaderRenderer> = new <IDataGridHeaderRenderer>[];\n\tpublic var inactiveHeaderRenderers:Vector.<IDataGridHeaderRenderer> = new <IDataGridHeaderRenderer>[];\n\tpublic var factory:Function = null;\n\tpublic var customHeaderRendererStyleName:String = null;\n\tpublic var columnIndex:int = -1;\n}\n\nclass DividerFactoryStorage\n{\n\tpublic var activeDividers:Vector.<DisplayObject> = new <DisplayObject>[];\n\tpublic var inactiveDividers:Vector.<DisplayObject> = new <DisplayObject>[];\n\tpublic var factory:Function = null;\n}\n"
  },
  {
    "path": "source/feathers/controls/DataGridColumn.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.data.SortOrder;\n\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\n\t/**\n\t * Dispatched when a property of the column changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Configures a column in a <code>DataGrid</code> component.\n\t *\n\t * @see feathers.controls.DataGrid\n\t *\n\t * @productversion Feathers 3.4.0\n\t */\n\tpublic class DataGridColumn extends EventDispatcher\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function DataGridColumn(dataField:String = null, headerText:String = null)\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.dataField = dataField;\n\t\t\tthis.headerText = headerText;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _headerText:String = null;\n\n\t\t/**\n\t\t * The text to display in the column's header.\n\t\t *\n\t\t * <p>In the following example, the header text is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * column.headerText = \"Customer Name\";</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get headerText():String\n\t\t{\n\t\t\treturn this._headerText;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set headerText(value:String):void\n\t\t{\n\t\t\tif(this._headerText === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._headerText = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _dataField:String = null;\n\n\t\t/**\n\t\t * The field in the item that contains the data to be displayed by\n\t\t * the cell renderers in this column. If the item does not have this\n\t\t * field, then the renderer may default to calling <code>toString()</code>\n\t\t * on the item.\n\t\t *\n\t\t * <p>In the following example, the data field is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * column.dataField = \"name\";</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get dataField():String\n\t\t{\n\t\t\treturn this._dataField;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set dataField(value:String):void\n\t\t{\n\t\t\tif(this._dataField === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._dataField = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _cellRendererFactory:Function = null;\n\n\t\t/**\n\t\t * A function called that is expected to return a new cell renderer.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t *\n\t\t * <pre>function():IDataGridCellRenderer</pre>\n\t\t *\n\t\t * <p>The following example provides a factory for the cell renderer:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * column.cellRendererFactory = function():IDataGridCellRenderer\n\t\t * {\n\t\t *     var cellRenderer:CustomCellRendererClass = new CustomCellRendererClass();\n\t\t *     cellRenderer.backgroundSkin = new Quad( 10, 10, 0xff0000 );\n\t\t *     return cellRenderer;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.renderers.IDataGridCellRenderer\n\t\t */\n\t\tpublic function get cellRendererFactory():Function\n\t\t{\n\t\t\treturn this._cellRendererFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set cellRendererFactory(value:Function):void\n\t\t{\n\t\t\tif(this._cellRendererFactory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._cellRendererFactory = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customCellRendererStyleName:String = null;\n\n\t\t/**\n\t\t * A style name to add to all cell renderers in this column. Typically\n\t\t * used by a theme to provide different skins to different columns.\n\t\t *\n\t\t * <p>The following example sets the cell renderer style name:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * column.customCellRendererStyleName = \"my-custom-cell-renderer\";</listing>\n\t\t *\n\t\t * <p>In your theme, you can target this sub-component name to provide\n\t\t * different skins than the default style:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * getStyleProviderForClass( DefaultDataGridCellRenderer ).setFunctionForStyleName( \"my-custom-cell-renderer\", setCustomCellRendererStyles );</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic function get customCellRendererStyleName():String\n\t\t{\n\t\t\treturn this._customCellRendererStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customCellRendererStyleName(value:String):void\n\t\t{\n\t\t\tif(this._customCellRendererStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customCellRendererStyleName = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _headerRendererFactory:Function = null;\n\n\t\t/**\n\t\t * A function called that is expected to return a new header renderer.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t *\n\t\t * <pre>function():IDataGridHeaderRenderer</pre>\n\t\t *\n\t\t * <p>The following example provides a factory for the header renderer:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * column.headerRendererFactory = function():IDataGridHeaderRenderer\n\t\t * {\n\t\t *     var headerRenderer:CustomHeaderRendererClass = new CustomHeaderRendererClass();\n\t\t *     headerRenderer.backgroundSkin = new Quad( 10, 10, 0xff0000 );\n\t\t *     return headerRenderer;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.renderers.IDataGridHeaderRenderer\n\t\t */\n\t\tpublic function get headerRendererFactory():Function\n\t\t{\n\t\t\treturn this._headerRendererFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set headerRendererFactory(value:Function):void\n\t\t{\n\t\t\tif(this._headerRendererFactory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._headerRendererFactory = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customHeaderRendererStyleName:String = null;\n\n\t\t/**\n\t\t * A style name to add to all header renderers in this column. Typically\n\t\t * used by a theme to provide different skins to different columns.\n\t\t *\n\t\t * <p>The following example sets the header renderer name:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * column.customHeaderRendererStyleName = \"my-custom-header-renderer\";</listing>\n\t\t *\n\t\t * <p>In your theme, you can target this sub-component name to provide\n\t\t * different skins than the default style:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * getStyleProviderForClass( DefaultDataGridHeaderRenderer ).setFunctionForStyleName( \"my-custom-header-renderer\", setCustomHeaderRendererStyles );</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic function get customHeaderRendererStyleName():String\n\t\t{\n\t\t\treturn this._customHeaderRendererStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customHeaderRendererStyleName(value:String):void\n\t\t{\n\t\t\tif(this._customHeaderRendererStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customHeaderRendererStyleName = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minWidth:Number = 10;\n\n\t\t/**\n\t\t * The minimum width of the column, in pixels.\n\t\t *\n\t\t * <p>The following example sets the column minimum width:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * column.minWidth = 200;</listing>\n\t\t *\n\t\t * @default 10\n\t\t */\n\t\tpublic function get minWidth():Number\n\t\t{\n\t\t\treturn this._minWidth;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minWidth(value:Number):void\n\t\t{\n\t\t\tif(this._minWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._minWidth = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _width:Number = NaN;\n\n\t\t/**\n\t\t * The width of the column, in pixels. If the width is set to\n\t\t * <code>NaN</code>, the column will be sized automatically by the\n\t\t * data grid's layout.\n\t\t *\n\t\t * <p>The following example sets the column width:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * column.width = 200;</listing>\n\t\t *\n\t\t * @default NaN\n\t\t */\n\t\tpublic function get width():Number\n\t\t{\n\t\t\treturn this._width;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set width(value:Number):void\n\t\t{\n\t\t\tif(this._width == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._width = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _sortCompareFunction:Function = null;\n\n\t\t/**\n\t\t * A function to compare each item in the collection to determine the\n\t\t * order when sorted.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function( a:Object, b:Object ):int</pre>\n\t\t *\n\t\t * <p>The return value should be <code>-1</code> if the first item\n\t\t * should appear before the second item when the collection is sorted.\n\t\t * The return value should be <code>1</code> if the first item should\n\t\t * appear after the second item when the collection in sorted. Finally,\n\t\t * the return value should be <code>0</code> if both items have the\n\t\t * same sort order.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #sortOrder\n\t\t */\n\t\tpublic function get sortCompareFunction():Function\n\t\t{\n\t\t\treturn this._sortCompareFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set sortCompareFunction(value:Function):void\n\t\t{\n\t\t\tif(this._sortCompareFunction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._sortCompareFunction = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _sortOrder:String = SortOrder.ASCENDING;\n\n\t\t/**\n\t\t * Indicates if the column may be sorted by triggering the\n\t\t * header renderer, and which direction it should be sorted\n\t\t * by default (ascending or descending).\n\t\t *\n\t\t * <p>Setting this property will not start a sort. It only provides the\n\t\t * initial order of the sort when triggered by the user.</p>\n\t\t *\n\t\t * <p>If the <code>sortableColumns</code> property of the\n\t\t * <code>DataGrid</code> is <code>false</code>, it takes precendence\n\t\t * over this property, and the column will not be sortable.</p>\n\t\t *\n\t\t * <p>The following example disables sorting:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * column.sortOrder = SortOrder.NONE;</listing>\n\t\t *\n\t\t * @default feathers.data.SortOrder.ASCENDING\n\t\t *\n\t\t * @see feathers.controls.DataGrid#sortableColumns\n\t\t * @see #sortCompareFunction\n\t\t * @see feathers.data.SortOrder#ASCENDING\n\t\t * @see feathers.data.SortOrder#DESCENDING\n\t\t * @see feathers.data.SortOrder#NONE\n\t\t */\n\t\tpublic function get sortOrder():String\n\t\t{\n\t\t\treturn this._sortOrder;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set sortOrder(value:String):void\n\t\t{\n\t\t\tif(this._sortOrder === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._sortOrder = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _resizable:Boolean = true;\n\n\t\t/**\n\t\t * Indicates if the column may be resized by dragging from its right edge.\n\t\t *\n\t\t * <p>If the <code>resizableColumns</code> property of the\n\t\t * <code>DataGrid</code> is <code>false</code>, it takes precendence\n\t\t * over this property, and the column will not be resizable.</p>\n\t\t *\n\t\t * <p>The following example disables resizing:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * column.resizable = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t *\n\t\t * @see feathers.controls.DataGrid#resizableColumns\n\t\t */\n\t\tpublic function get resizable():Boolean\n\t\t{\n\t\t\treturn this._resizable;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set resizable(value:Boolean):void\n\t\t{\n\t\t\tif(this._resizable === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._resizable = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/controls/DateTimeMode.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\t/**\n\t * Formats for date and time components.\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class DateTimeMode\n\t{\n\t\t/**\n\t\t * Both date and time will be displayed.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const DATE_AND_TIME:String = \"dateAndTime\";\n\n\t\t/**\n\t\t * Only the time will be displayed. The date will not be displayed.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const TIME:String = \"time\";\n\n\t\t/**\n\t\t * Only the date will be displayed. The time will not be displayed.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const DATE:String = \"date\";\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/DateTimeSpinner.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IMeasureDisplayObject;\n\timport feathers.core.IValidating;\n\timport feathers.data.IListCollection;\n\timport feathers.data.VectorCollection;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.HorizontalLayout;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.utils.math.roundDownToNearest;\n\timport feathers.utils.math.roundUpToNearest;\n\timport feathers.utils.skins.resetFluidChildDimensionsForMeasurement;\n\n\timport flash.globalization.DateTimeFormatter;\n\timport flash.globalization.DateTimeNameStyle;\n\timport flash.globalization.DateTimeStyle;\n\timport flash.globalization.LocaleID;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t/**\n\t * The background to display behind all content when the date time spinner\n\t * is disabled. The background skin is resized to fill the full width and\n\t * height of the date time spinner, and the lists are centered.\n\t *\n\t * <p>In the following example, the spinner is given a background skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * spinner.backgroundDisabledSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:backgroundSkin\n\t */\n\t[Style(name=\"backgroundDisabledSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The default background to display behind all content. The background\n\t * skin is resized to fill the full width and height of the date time\n\t * spinner, and the lists are centered.\n\t *\n\t * <p>In the following example, the spinner is given a background skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * spinner.backgroundSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:backgroundDisabledSkin\n\t */\n\t[Style(name=\"backgroundSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * A style name to add to the date time spinner's item renderer\n\t * sub-components. Typically used by a theme to provide different styles to\n\t * different date time spinners.\n\t *\n\t * <p>In the following example, a custom item renderer style name is passed\n\t * to the date time spinner:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * spinner.customItemRendererStyleName = \"my-custom-date-time-spinner-item-renderer\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( DefaultListItemRenderer ).setFunctionForStyleName( \"my-custom-date-time-spinner-item-renderer\", setCustomDateTimeSpinnerItemRendererStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #itemRendererFactory\n\t */\n\t[Style(name=\"customItemRendererStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to the date time spinner's list sub-components.\n\t * Typically used by a theme to provide different styles to different\n\t * date time spinners.\n\t *\n\t * <p>In the following example, a custom list style name is passed to\n\t * the date time spinner:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * spinner.customListStyleName = \"my-custom-spinner-list\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( SpinnerList ).setFunctionForStyleName( \"my-custom-spinner-list\", setCustomSpinnerListStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_LIST\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #listFactory\n\t */\n\t[Style(name=\"customListStyleName\",type=\"String\")]\n\n\t/**\n\t * Quickly sets all padding properties to the same value. The\n\t * <code>padding</code> getter always returns the value of\n\t * <code>paddingTop</code>, but the other padding values may be\n\t * different.\n\t *\n\t * <p>In the following example, the padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * spinner.padding = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:paddingTop\n\t * @see #style:paddingRight\n\t * @see #style:paddingBottom\n\t * @see #style:paddingLeft\n\t */\n\t[Style(name=\"padding\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the date time spinner's top edge and\n\t * the its content.\n\t *\n\t * <p>In the following example, the top padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * spinner.paddingTop = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingTop\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the date time spinner's right edge\n\t * and the its content.\n\t *\n\t * <p>In the following example, the right padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * spinner.paddingRight = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingRight\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the date time spinner's bottom edge\n\t * and the its content.\n\t *\n\t * <p>In the following example, the bottom padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * spinner.paddingBottom = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingBottom\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the date time spinner's left edge\n\t * and the its content.\n\t *\n\t * <p>In the following example, the left padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * spinner.paddingLeft = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingLeft\",type=\"Number\")]\n\n\t/**\n\t * The duration, in seconds, of the animation when the\n\t * <code>scrollToDate()</code> function is called, or when an invalid\n\t * date is selected.\n\t *\n\t * <p>In the following example, the duration of the animation that\n\t * changes the page when thrown is set to 250 milliseconds:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * spinner.scrollDuration = 0.25;</listing>\n\t *\n\t * @default 0.5\n\t *\n\t * @see #scrollToDate()\n\t */\n\t[Style(name=\"scrollDuration\",type=\"Number\")]\n\n\t/**\n\t * Dispatched when the spinner's value changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #value\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * A set of <code>SpinnerList</code> components that allow you to select the\n\t * date, the time, or the date and time.\n\t *\n\t * <p>The following example sets the date spinner's range and listens for\n\t * when the value changes:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var spinner:DateTimeSpinner = new DateTimeSpinner();\n\t * spinner.editingMode = DateTimeMode.DATE;\n\t * spinner.minimum = new Date(1970, 0, 1);\n\t * spinner.maximum = new Date(2050, 11, 31);\n\t * spinner.value = new Date();\n\t * spinner.addEventListener( Event.CHANGE, spinner_changeHandler );\n\t * this.addChild( spinner );</listing>\n\t *\n\t * @see ../../../help/date-time-spinner.html How to use the Feathers DateTimeSpinner component\n\t *\n\t * @productversion Feathers 2.3.0\n\t */\n\tpublic class DateTimeSpinner extends FeathersControl\n\t{\n\t\t/**\n\t\t * The default name to use with lists.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_LIST:String = \"feathers-date-time-spinner-list\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const MS_PER_DAY:int = 86400000;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const MIN_MONTH_VALUE:int = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const MAX_MONTH_VALUE:int = 11;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const MIN_DATE_VALUE:int = 1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const MAX_DATE_VALUE:int = 31;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const MIN_HOURS_VALUE:int = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const MAX_HOURS_VALUE_12HOURS:int = 11;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const MAX_HOURS_VALUE_24HOURS:int = 23;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const MIN_MINUTES_VALUE:int = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const MAX_MINUTES_VALUE:int = 59;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const HELPER_DATE:Date = new Date();\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const DAYS_IN_MONTH:Vector.<int> = new <int>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_LOCALE:String = \"locale\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_EDITING_MODE:String = \"editingMode\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_PENDING_SCROLL:String = \"pendingScroll\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_SPINNER_LIST_FACTORY:String = \"spinnerListFactory\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>DateTimeSpinner</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultListFactory():SpinnerList\n\t\t{\n\t\t\treturn new SpinnerList();\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function DateTimeSpinner()\n\t\t{\n\t\t\tsuper();\n\t\t\tif(DAYS_IN_MONTH.length == 0)\n\t\t\t{\n\t\t\t\tHELPER_DATE.setFullYear(2015); //this is pretty arbitrary\n\t\t\t\tfor(var i:int = MIN_MONTH_VALUE; i <= MAX_MONTH_VALUE; i++)\n\t\t\t\t{\n\t\t\t\t\t//subtract one date from the 1st of next month to figure out\n\t\t\t\t\t//the last date of the current month\n\t\t\t\t\tHELPER_DATE.setMonth(i + 1, -1);\n\t\t\t\t\tDAYS_IN_MONTH[i] = HELPER_DATE.date + 1;\n\t\t\t\t}\n\t\t\t\tDAYS_IN_MONTH.fixed = true;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the lists. This\n\t\t * variable is <code>protected</code> so that sub-classes can customize\n\t\t * the list style name in their constructors instead of using the\n\t\t * default style name defined by <code>DEFAULT_CHILD_STYLE_NAME_LIST</code>.\n\t\t *\n\t\t * <p>To customize the list style name without subclassing, see\n\t\t * <code>customListStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customListStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var listStyleName:String = DEFAULT_CHILD_STYLE_NAME_LIST;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var monthsList:SpinnerList;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var datesList:SpinnerList;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var yearsList:SpinnerList;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var dateAndTimeDatesList:SpinnerList;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var hoursList:SpinnerList;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var minutesList:SpinnerList;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var meridiemList:SpinnerList;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var listGroup:LayoutGroup;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn DateTimeSpinner.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _locale:String = LocaleID.DEFAULT;\n\n\t\t/**\n\t\t * The locale used to display the date. Supports values defined by\n\t\t * Unicode Technical Standard #35, such as <code>\"en_US\"</code>,\n\t\t * <code>\"fr_FR\"</code> or <code>\"ru_RU\"</code>.\n\t\t *\n\t\t * @default flash.globalization.LocaleID.DEFAULT\n\t\t *\n\t\t * @see http://unicode.org/reports/tr35/ Unicode Technical Standard #35\n\t\t */\n\t\tpublic function get locale():String\n\t\t{\n\t\t\treturn this._locale;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set locale(value:String):void\n\t\t{\n\t\t\tif(this._locale == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._locale = value;\n\t\t\tthis._formatter = null;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LOCALE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _value:Date;\n\n\t\t/**\n\t\t * The value of the date time spinner, between the minimum and maximum.\n\t\t *\n\t\t * <p>In the following example, the value is changed to a date:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * stepper.minimum = new Date(1970, 0, 1);\n\t\t * stepper.maximum = new Date(2050, 11, 31);\n\t\t * stepper.value = new Date(1995, 2, 7);</listing>\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #minimum\n\t\t * @see #maximum\n\t\t * @see #event:change\n\t\t */\n\t\tpublic function get value():Date\n\t\t{\n\t\t\treturn this._value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set value(value:Date):void\n\t\t{\n\t\t\tvar time:Number = value.time;\n\t\t\tif(this._minimum && this._minimum.time > time)\n\t\t\t{\n\t\t\t\ttime = this._minimum.time;\n\t\t\t}\n\t\t\tif(this._maximum && this._maximum.time < time)\n\t\t\t{\n\t\t\t\ttime = this._maximum.time;\n\t\t\t}\n\t\t\tif(this._value && this._value.time == time)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._value = new Date(time);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimum:Date;\n\n\t\t/**\n\t\t * The date time spinner's value will not go lower than the minimum.\n\t\t *\n\t\t * <p>In the following example, the minimum is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * spinner.minimum = new Date(1970, 0, 1);</listing>\n\t\t *\n\t\t * @see #value\n\t\t * @see #maximum\n\t\t */\n\t\tpublic function get minimum():Date\n\t\t{\n\t\t\treturn this._minimum;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minimum(value:Date):void\n\t\t{\n\t\t\tif(this._minimum == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._minimum = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maximum:Date;\n\n\t\t/**\n\t\t * The date time spinner's value will not go higher than the maximum.\n\t\t *\n\t\t * <p>In the following example, the maximum is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * spinner.maximum = new Date(2050, 11, 31);</listing>\n\t\t *\n\t\t * @see #value\n\t\t * @see #minimum\n\t\t */\n\t\tpublic function get maximum():Date\n\t\t{\n\t\t\treturn this._maximum;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maximum(value:Date):void\n\t\t{\n\t\t\tif(this._maximum == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._maximum = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minuteStep:int = 1;\n\n\t\t/**\n\t\t * In the list that allows selection of minutes, customizes the number\n\t\t * of minutes between each item. For instance, one might choose 15 or\n\t\t * 30 minute increments.\n\t\t *\n\t\t * <p>In the following example, the spinner uses 15 minute increments:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * spinner.minuteStep = 15;</listing>\n\t\t *\n\t\t * @default 1\n\t\t */\n\t\tpublic function get minuteStep():int\n\t\t{\n\t\t\treturn this._minuteStep;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minuteStep(value:int):void\n\t\t{\n\t\t\tif(60 % value != 0)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"minuteStep must evenly divide into 60.\");\n\t\t\t}\n\t\t\tif(this._minuteStep == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._minuteStep = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _editingMode:String = DateTimeMode.DATE_AND_TIME;\n\n\t\t/**\n\t\t * Determines which parts of the <code>Date</code> value may be edited.\n\t\t *\n\t\t * @default feathers.controls.DateTimeMode.DATE_AND_TIME\n\t\t *\n\t\t * @see feathers.controls.DateTimeMode#DATE_AND_TIME\n\t\t * @see feathers.controls.DateTimeMode#DATE\n\t\t * @see feathers.controls.DateTimeMode#TIME\n\t\t */\n\t\tpublic function get editingMode():String\n\t\t{\n\t\t\treturn this._editingMode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set editingMode(value:String):void\n\t\t{\n\t\t\tif(this._editingMode == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._editingMode = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_EDITING_MODE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _formatter:DateTimeFormatter;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _longestMonthNameIndex:int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _localeMonthNames:Vector.<String>;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _localeWeekdayNames:Vector.<String>;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _ignoreListChanges:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _monthFirst:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _showMeridiem:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastMeridiemValue:int = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _listMinYear:int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _listMaxYear:int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minYear:int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maxYear:int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minMonth:int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maxMonth:int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minDate:int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maxDate:int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minHours:int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maxHours:int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minMinute:int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maxMinute:int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _scrollDuration:Number = 0.5;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get scrollDuration():Number\n\t\t{\n\t\t\treturn this._scrollDuration;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set scrollDuration(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._scrollDuration == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._scrollDuration = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _itemRendererFactory:Function = null;\n\n\t\t/**\n\t\t * A function used to instantiate the date time spinner's item renderer\n\t\t * sub-components. A single factory will be shared by all\n\t\t * <code>SpinnerList</code> sub-components displayed by the\n\t\t * <code>DateTimeSpinner</code>. The item renderers must be instances of\n\t\t * <code>DefaultListItemRenderer</code>. This factory can be used to\n\t\t * change properties of the item renderer sub-components when they are\n\t\t * first created. For instance, if you are skinning Feathers components\n\t\t * without a theme, you might use this factory to style the item\n\t\t * renderer sub-components.\n\t\t *\n\t\t * <p>The factory should have the following function signature:</p>\n\t\t * <pre>function():DefaultListItemRenderer</pre>\n\t\t *\n\t\t * <p>In the following example, the date time spinner uses a custom item\n\t\t * renderer factory:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * spinner.itemRendererFactory = function():DefaultListItemRenderer\n\t\t * {\n\t\t *     var itemRenderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\t\t *     // set properties\n\t\t *     return itemRenderer;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.renderers.DefaultListItemRenderer\n\t\t * @see #itemRendererFactory\n\t\t */\n\t\tpublic function get itemRendererFactory():Function\n\t\t{\n\t\t\treturn this._itemRendererFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set itemRendererFactory(value:Function):void\n\t\t{\n\t\t\tif(this._itemRendererFactory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._itemRendererFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SPINNER_LIST_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _listFactory:Function;\n\n\t\t/**\n\t\t * A function used to instantiate the date time spinner's list\n\t\t * sub-components. The lists must be instances of\n\t\t * <code>SpinnerList</code>. This factory can be used to change\n\t\t * properties of the list sub-components when they are first created.\n\t\t * For instance, if you are skinning Feathers components without a\n\t\t * theme, you might use this factory to style the list sub-components.\n\t\t *\n\t\t * <p><strong>Warning:</strong> The <code>itemRendererFactory</code>\n\t\t * and <code>customItemRendererStyleName</code> properties of the\n\t\t * <code>SpinnerList</code> should not be set in the\n\t\t * <code>listFactory</code>. Instead, set the\n\t\t * <code>itemRendererFactory</code> and\n\t\t * <code>customItemRendererStyleName</code> properties of the\n\t\t * <code>DateTimeSpinner</code>.</p>\n\t\t *\n\t\t * <p>The factory should have the following function signature:</p>\n\t\t * <pre>function():SpinnerList</pre>\n\t\t *\n\t\t * <p>In the following example, the date time spinner uses a custom list\n\t\t * factory:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * spinner.listFactory = function():SpinnerList\n\t\t * {\n\t\t *     var list:SpinnerList = new SpinnerList();\n\t\t *     // set properties\n\t\t *     return list;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.SpinnerList\n\t\t * @see #itemRendererFactory\n\t\t */\n\t\tpublic function get listFactory():Function\n\t\t{\n\t\t\treturn this._listFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set listFactory(value:Function):void\n\t\t{\n\t\t\tif(this._listFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._listFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customListStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customListStyleName():String\n\t\t{\n\t\t\treturn this._customListStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customListStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customListStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customListStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SPINNER_LIST_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customItemRendererStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customItemRendererStyleName():String\n\t\t{\n\t\t\treturn this._customItemRendererStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customItemRendererStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customItemRendererStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customItemRendererStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SPINNER_LIST_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastValidate:Date;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _todayLabel:String = null;\n\n\t\t/**\n\t\t * If not <code>null</code>, and the <code>editingMode</code> property\n\t\t * is set to <code>DateTimeMode.DATE_AND_TIME</code> the date matching\n\t\t * today's current date will display this label instead of the date.\n\t\t *\n\t\t * <p>In the following example, the label for today is set:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * spinner.todayLabel = \"Today\";</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get todayLabel():String\n\t\t{\n\t\t\treturn this._todayLabel;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set todayLabel(value:String):void\n\t\t{\n\t\t\tif(this._todayLabel == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._todayLabel = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMaxWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMaxHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var currentBackgroundSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _backgroundSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundSkin():DisplayObject\n\t\t{\n\t\t\treturn this._backgroundSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSkin !== null &&\n\t\t\t\tthis.currentBackgroundSkin === this._backgroundSkin)\n\t\t\t{\n\t\t\t\tthis.removeCurrentBackgroundSkin(this._backgroundSkin);\n\t\t\t\tthis.currentBackgroundSkin = null;\n\t\t\t}\n\t\t\tthis._backgroundSkin = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SKIN);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _backgroundDisabledSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundDisabledSkin():DisplayObject\n\t\t{\n\t\t\treturn this._backgroundDisabledSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundDisabledSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundDisabledSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundDisabledSkin !== null &&\n\t\t\t\tthis.currentBackgroundSkin === this._backgroundDisabledSkin)\n\t\t\t{\n\t\t\t\tthis.removeCurrentBackgroundSkin(this._backgroundDisabledSkin);\n\t\t\t\tthis.currentBackgroundSkin = null;\n\t\t\t}\n\t\t\tthis._backgroundDisabledSkin = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SKIN);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get padding():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set padding(value:Number):void\n\t\t{\n\t\t\tthis.paddingTop = value;\n\t\t\tthis.paddingRight = value;\n\t\t\tthis.paddingBottom = value;\n\t\t\tthis.paddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingTop:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingTop():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingTop(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingTop = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingRight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingRight():Number\n\t\t{\n\t\t\treturn this._paddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingRight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingBottom:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingBottom():Number\n\t\t{\n\t\t\treturn this._paddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingBottom = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingLeft:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingLeft = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _amString:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _pmString:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var pendingScrollToDate:Date;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var pendingScrollDuration:Number;\n\n\t\t/**\n\t\t * After the next validation, animates the scroll positions of the lists\n\t\t * to a specific date. If the <code>animationDuration</code> argument is\n\t\t * <code>NaN</code> (the default value), the value of the\n\t\t * <code>scrollDuration</code> property is used instead. The duration is\n\t\t * measured in seconds.\n\t\t *\n\t\t * <p>Note: The <code>value</code> property will not be updated\n\t\t * immediately when calling <code>scrollToDate()</code>. Similar to how\n\t\t * the animation won't start until the next validation, the\n\t\t * <code>value</code> property will be updated at the same time.</p>\n\t\t *\n\t\t * <p>In the following example, we scroll to a specific date with\n\t\t * animation of 1.5 seconds:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * spinner.scrollToDate( new Date(2016, 0, 1), 1.5 );</listing>\n\t\t *\n\t\t * @see #style:scrollDuration\n\t\t */\n\t\tpublic function scrollToDate(date:Date, animationDuration:Number = NaN):void\n\t\t{\n\t\t\tif(this.pendingScrollToDate && this.pendingScrollToDate.time == date.time &&\n\t\t\t\tthis.pendingScrollDuration == animationDuration)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.pendingScrollToDate = date;\n\t\t\tthis.pendingScrollDuration = animationDuration;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_PENDING_SCROLL);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//we don't dispose it if the group is the parent because it'll\n\t\t\t//already get disposed in super.dispose()\n\t\t\tif(this._backgroundSkin !== null && this._backgroundSkin.parent !== this)\n\t\t\t{\n\t\t\t\tthis._backgroundSkin.dispose();\n\t\t\t}\n\t\t\tif(this._backgroundDisabledSkin !== null && this._backgroundDisabledSkin.parent !== this)\n\t\t\t{\n\t\t\t\tthis._backgroundDisabledSkin.dispose();\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tif(this.listGroup === null)\n\t\t\t{\n\t\t\t\tvar groupLayout:HorizontalLayout = new HorizontalLayout();\n\t\t\t\tgroupLayout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\t\tgroupLayout.verticalAlign = VerticalAlign.JUSTIFY;\n\t\t\t\tthis.listGroup = new LayoutGroup();\n\t\t\t\tthis.listGroup.layout = groupLayout;\n\t\t\t\tthis.addChild(this.listGroup);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar skinInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SKIN);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar editingModeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_EDITING_MODE);\n\t\t\tvar localeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_LOCALE);\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar pendingScrollInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_PENDING_SCROLL);\n\t\t\tvar spinnerListFactoryInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SPINNER_LIST_FACTORY);\n\n\t\t\tif(this._todayLabel)\n\t\t\t{\n\t\t\t\tthis._lastValidate = new Date();\n\t\t\t}\n\n\t\t\tif(skinInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshBackgroundSkin();\n\t\t\t}\n\n\t\t\tif(localeInvalid || editingModeInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshLocale();\n\t\t\t}\n\n\t\t\tif(localeInvalid || editingModeInvalid || spinnerListFactoryInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshLists(editingModeInvalid || spinnerListFactoryInvalid, localeInvalid);\n\t\t\t}\n\n\t\t\tif(localeInvalid || editingModeInvalid || dataInvalid || spinnerListFactoryInvalid)\n\t\t\t{\n\t\t\t\tthis.useDefaultsIfNeeded();\n\t\t\t\tthis.refreshValidRanges();\n\t\t\t\tthis.refreshSelection();\n\t\t\t}\n\n\t\t\tif(localeInvalid || editingModeInvalid || stateInvalid || spinnerListFactoryInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshEnabled();\n\t\t\t}\n\n\t\t\tthis.autoSizeIfNeeded();\n\n\t\t\tthis.layoutChildren();\n\n\t\t\tif(pendingScrollInvalid)\n\t\t\t{\n\t\t\t\tthis.handlePendingScroll();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvar measureBackground:IMeasureDisplayObject = this.currentBackgroundSkin as IMeasureDisplayObject;\n\t\t\tresetFluidChildDimensionsForMeasurement(this.currentBackgroundSkin,\n\t\t\t\tthis._explicitWidth, this._explicitHeight,\n\t\t\t\tthis._explicitMinWidth, this._explicitMinHeight,\n\t\t\t\tthis._explicitMaxWidth, this._explicitMaxHeight,\n\t\t\t\tthis._explicitBackgroundWidth, this._explicitBackgroundHeight,\n\t\t\t\tthis._explicitBackgroundMinWidth, this._explicitBackgroundMinHeight,\n\t\t\t\tthis._explicitBackgroundMaxWidth, this._explicitBackgroundMaxHeight);\n\t\t\tif(this.currentBackgroundSkin is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.currentBackgroundSkin).validate();\n\t\t\t}\n\n\t\t\tthis.listGroup.width = this._explicitWidth;\n\t\t\tthis.listGroup.height = this._explicitHeight;\n\t\t\tthis.listGroup.minWidth = this._explicitMinWidth;\n\t\t\tthis.listGroup.minHeight = this._explicitMinHeight;\n\t\t\tthis.listGroup.validate(); //minimum dimensions\n\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tif(measureBackground !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = measureBackground.minWidth;\n\t\t\t\t}\n\t\t\t\telse if(this.currentBackgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = this._explicitBackgroundMinWidth;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = 0;\n\t\t\t\t}\n\t\t\t\tvar listsMinWidth:Number = this.listGroup.minWidth;\n\t\t\t\tlistsMinWidth += this._paddingLeft + this._paddingRight;\n\t\t\t\tif(listsMinWidth > newMinWidth)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = listsMinWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tif(measureBackground !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = measureBackground.minHeight;\n\t\t\t\t}\n\t\t\t\telse if(this.currentBackgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = this._explicitBackgroundMinHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = 0;\n\t\t\t\t}\n\t\t\t\tvar listsMinHeight:Number = this.listGroup.minHeight;\n\t\t\t\tlistsMinHeight += this._paddingTop + this._paddingBottom;\n\t\t\t\tif(listsMinHeight > newMinHeight)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = listsMinHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//current dimensions\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this.currentBackgroundSkin.width;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewWidth = 0;\n\t\t\t\t}\n\t\t\t\tvar listsWidth:Number = this.listGroup.width + this._paddingLeft + this._paddingRight;\n\t\t\t\tif(listsWidth > newWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = listsWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this.currentBackgroundSkin.height;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewHeight = 0;\n\t\t\t\t}\n\t\t\t\tvar listsHeight:Number = this.listGroup.height + this._paddingTop + this._paddingBottom;\n\t\t\t\tif(listsHeight > newHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = listsHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * Choose the appropriate background skin based on the control's current\n\t\t * state.\n\t\t */\n\t\tprotected function refreshBackgroundSkin():void\n\t\t{\n\t\t\tvar oldBackgroundSkin:DisplayObject = this.currentBackgroundSkin;\n\t\t\tthis.currentBackgroundSkin = this.getCurrentBackgroundSkin();\n\t\t\tif(this.currentBackgroundSkin !== oldBackgroundSkin)\n\t\t\t{\n\t\t\t\tthis.removeCurrentBackgroundSkin(oldBackgroundSkin);\n\t\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(this.currentBackgroundSkin is IFeathersControl)\n\t\t\t\t\t{\n\t\t\t\t\t\tIFeathersControl(this.currentBackgroundSkin).initializeNow();\n\t\t\t\t\t}\n\t\t\t\t\tif(this.currentBackgroundSkin is IMeasureDisplayObject)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar measureSkin:IMeasureDisplayObject = IMeasureDisplayObject(this.currentBackgroundSkin);\n\t\t\t\t\t\tthis._explicitBackgroundWidth = measureSkin.explicitWidth;\n\t\t\t\t\t\tthis._explicitBackgroundHeight = measureSkin.explicitHeight;\n\t\t\t\t\t\tthis._explicitBackgroundMinWidth = measureSkin.explicitMinWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMinHeight = measureSkin.explicitMinHeight;\n\t\t\t\t\t\tthis._explicitBackgroundMaxWidth = measureSkin.explicitMaxWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMaxHeight = measureSkin.explicitMaxHeight;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._explicitBackgroundWidth = this.currentBackgroundSkin.width;\n\t\t\t\t\t\tthis._explicitBackgroundHeight = this.currentBackgroundSkin.height;\n\t\t\t\t\t\tthis._explicitBackgroundMinWidth = this._explicitBackgroundWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMinHeight = this._explicitBackgroundHeight;\n\t\t\t\t\t\tthis._explicitBackgroundMaxWidth = this._explicitBackgroundWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMaxHeight = this._explicitBackgroundHeight;\n\t\t\t\t\t}\n\t\t\t\t\tthis.addChildAt(this.currentBackgroundSkin, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function removeCurrentBackgroundSkin(skin:DisplayObject):void\n\t\t{\n\t\t\tif(skin === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(skin.parent === this)\n\t\t\t{\n\t\t\t\t//we need to restore these values so that they won't be lost the\n\t\t\t\t//next time that this skin is used for measurement\n\t\t\t\tskin.width = this._explicitBackgroundWidth;\n\t\t\t\tskin.height = this._explicitBackgroundHeight;\n\t\t\t\tif(skin is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar measureSkin:IMeasureDisplayObject = IMeasureDisplayObject(skin);\n\t\t\t\t\tmeasureSkin.minWidth = this._explicitBackgroundMinWidth;\n\t\t\t\t\tmeasureSkin.minHeight = this._explicitBackgroundMinHeight;\n\t\t\t\t\tmeasureSkin.maxWidth = this._explicitBackgroundMaxWidth;\n\t\t\t\t\tmeasureSkin.maxHeight = this._explicitBackgroundMaxHeight;\n\t\t\t\t}\n\t\t\t\tthis.setRequiresRedraw();\n\t\t\t\tskin.removeFromParent(false);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getCurrentBackgroundSkin():DisplayObject\n\t\t{\n\t\t\tif(!this._isEnabled && this._backgroundDisabledSkin !== null)\n\t\t\t{\n\t\t\t\treturn this._backgroundDisabledSkin;\n\t\t\t}\n\t\t\treturn this._backgroundSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshLists(createNewLists:Boolean, localeChanged:Boolean):void\n\t\t{\n\t\t\tif(createNewLists)\n\t\t\t{\n\t\t\t\tthis.createYearList();\n\t\t\t\tthis.createMonthList();\n\t\t\t\tthis.createDateList();\n\n\t\t\t\tthis.createHourList();\n\t\t\t\tthis.createMinuteList();\n\t\t\t\tthis.createMeridiemList();\n\n\t\t\t\tthis.createDateAndTimeDateList();\n\t\t\t}\n\t\t\telse if((this._showMeridiem && !this.meridiemList) ||\n\t\t\t\t(!this._showMeridiem && this.meridiemList))\n\t\t\t{\n\t\t\t\t//if the locale changes, we may need to create or destroy this\n\t\t\t\t//list, but the other lists can stay\n\t\t\t\tthis.createMeridiemList();\n\t\t\t}\n\n\t\t\tif(this._editingMode == DateTimeMode.DATE)\n\t\t\t{\n\t\t\t\t//does this locale show the month or the date first?\n\t\t\t\tif(this._monthFirst)\n\t\t\t\t{\n\t\t\t\t\tthis.listGroup.setChildIndex(this.monthsList, 0);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.listGroup.setChildIndex(this.datesList, 0);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(localeChanged)\n\t\t\t{\n\t\t\t\tif(this.monthsList)\n\t\t\t\t{\n\t\t\t\t\tvar monthsCollection:IListCollection = this.monthsList.dataProvider;\n\t\t\t\t\tif(monthsCollection)\n\t\t\t\t\t{\n\t\t\t\t\t\tmonthsCollection.updateAll();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this.dateAndTimeDatesList)\n\t\t\t\t{\n\t\t\t\t\tvar dateAndTimeDatesCollection:IListCollection = this.dateAndTimeDatesList.dataProvider;\n\t\t\t\t\tif(dateAndTimeDatesCollection)\n\t\t\t\t\t{\n\t\t\t\t\t\tdateAndTimeDatesCollection.updateAll();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createYearList():void\n\t\t{\n\t\t\tif(this.yearsList)\n\t\t\t{\n\t\t\t\tthis.listGroup.removeChild(this.yearsList, true);\n\t\t\t\tthis.yearsList = null;\n\t\t\t}\n\n\t\t\tif(this._editingMode !== DateTimeMode.DATE)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar listFactory:Function = (this._listFactory !== null) ? this._listFactory : defaultListFactory;\n\t\t\tthis.yearsList = SpinnerList(listFactory());\n\t\t\tvar listStyleName:String = (this._customListStyleName !== null) ? this._customListStyleName : this.listStyleName;\n\t\t\tthis.yearsList.styleNameList.add(listStyleName);\n\t\t\t//we'll set the data provider later, when we know what range\n\t\t\t//of years we need\n\n\t\t\t//for backwards compatibility, allow the listFactory to take\n\t\t\t//precedence if it also sets itemRendererFactory or\n\t\t\t//customItemRendererStyleName\n\t\t\tif(this._itemRendererFactory !== null)\n\t\t\t{\n\t\t\t\tthis.yearsList.itemRendererFactory = this._itemRendererFactory;\n\t\t\t}\n\t\t\tif(this._customItemRendererStyleName !== null)\n\t\t\t{\n\t\t\t\tthis.yearsList.customItemRendererStyleName = this._customItemRendererStyleName;\n\t\t\t}\n\t\t\tthis.yearsList.addEventListener(FeathersEventType.RENDERER_ADD, yearsList_rendererAddHandler);\n\t\t\tthis.yearsList.addEventListener(Event.CHANGE, yearsList_changeHandler);\n\t\t\tthis.listGroup.addChild(this.yearsList);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createMonthList():void\n\t\t{\n\t\t\tif(this.monthsList)\n\t\t\t{\n\t\t\t\tthis.listGroup.removeChild(this.monthsList, true);\n\t\t\t\tthis.monthsList = null;\n\t\t\t}\n\n\t\t\tif(this._editingMode !== DateTimeMode.DATE)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar listFactory:Function = (this._listFactory !== null) ? this._listFactory : defaultListFactory;\n\t\t\tthis.monthsList = SpinnerList(listFactory());\n\t\t\tvar listStyleName:String = (this._customListStyleName !== null) ? this._customListStyleName : this.listStyleName;\n\t\t\tthis.monthsList.styleNameList.add(listStyleName);\n\t\t\tthis.monthsList.dataProvider = new IntegerRangeCollection(MIN_MONTH_VALUE, MAX_MONTH_VALUE, 1);\n\t\t\tthis.monthsList.typicalItem = this._longestMonthNameIndex;\n\t\t\t//for backwards compatibility, allow the listFactory to take\n\t\t\t//precedence if it also sets itemRendererFactory or\n\t\t\t//customItemRendererStyleName\n\t\t\tif(this._itemRendererFactory !== null)\n\t\t\t{\n\t\t\t\tthis.monthsList.itemRendererFactory = this._itemRendererFactory;\n\t\t\t}\n\t\t\tif(this._customItemRendererStyleName !== null)\n\t\t\t{\n\t\t\t\tthis.monthsList.customItemRendererStyleName = this._customItemRendererStyleName;\n\t\t\t}\n\t\t\tthis.monthsList.addEventListener(FeathersEventType.RENDERER_ADD, monthsList_rendererAddHandler);\n\t\t\tthis.monthsList.addEventListener(Event.CHANGE, monthsList_changeHandler);\n\t\t\tthis.listGroup.addChildAt(this.monthsList, 0);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createDateList():void\n\t\t{\n\t\t\tif(this.datesList)\n\t\t\t{\n\t\t\t\tthis.listGroup.removeChild(this.datesList, true);\n\t\t\t\tthis.datesList = null;\n\t\t\t}\n\n\t\t\tif(this._editingMode !== DateTimeMode.DATE)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar listFactory:Function = (this._listFactory !== null) ? this._listFactory : defaultListFactory;\n\t\t\tthis.datesList = SpinnerList(listFactory());\n\t\t\tvar listStyleName:String = (this._customListStyleName !== null) ? this._customListStyleName : this.listStyleName;\n\t\t\tthis.datesList.styleNameList.add(listStyleName);\n\t\t\tthis.datesList.dataProvider = new IntegerRangeCollection(MIN_DATE_VALUE, MAX_DATE_VALUE, 1);\n\t\t\t//for backwards compatibility, allow the listFactory to take\n\t\t\t//precedence if it also sets itemRendererFactory or\n\t\t\t//customItemRendererStyleName\n\t\t\tif(this._itemRendererFactory !== null)\n\t\t\t{\n\t\t\t\tthis.datesList.itemRendererFactory = this._itemRendererFactory;\n\t\t\t}\n\t\t\tif(this._customItemRendererStyleName !== null)\n\t\t\t{\n\t\t\t\tthis.datesList.customItemRendererStyleName = this._customItemRendererStyleName;\n\t\t\t}\n\t\t\tthis.datesList.addEventListener(FeathersEventType.RENDERER_ADD, datesList_rendererAddHandler);\n\t\t\tthis.datesList.addEventListener(Event.CHANGE, datesList_changeHandler);\n\t\t\tthis.listGroup.addChildAt(this.datesList, 0);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createHourList():void\n\t\t{\n\t\t\tif(this.hoursList)\n\t\t\t{\n\t\t\t\tthis.listGroup.removeChild(this.hoursList, true);\n\t\t\t\tthis.hoursList = null;\n\t\t\t}\n\n\t\t\tif(this._editingMode === DateTimeMode.DATE)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar listFactory:Function = (this._listFactory !== null) ? this._listFactory : defaultListFactory;\n\t\t\tthis.hoursList = SpinnerList(listFactory());\n\t\t\tvar listStyleName:String = (this._customListStyleName !== null) ? this._customListStyleName : this.listStyleName;\n\t\t\tthis.hoursList.styleNameList.add(listStyleName);\n\t\t\t//for backwards compatibility, allow the listFactory to take\n\t\t\t//precedence if it also sets itemRendererFactory or\n\t\t\t//customItemRendererStyleName\n\t\t\tif(this._itemRendererFactory !== null)\n\t\t\t{\n\t\t\t\tthis.hoursList.itemRendererFactory = this._itemRendererFactory;\n\t\t\t}\n\t\t\tif(this._customItemRendererStyleName !== null)\n\t\t\t{\n\t\t\t\tthis.hoursList.customItemRendererStyleName = this._customItemRendererStyleName;\n\t\t\t}\n\t\t\tthis.hoursList.addEventListener(FeathersEventType.RENDERER_ADD, hoursList_rendererAddHandler);\n\t\t\tthis.hoursList.addEventListener(Event.CHANGE, hoursList_changeHandler);\n\t\t\tthis.listGroup.addChild(this.hoursList);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createMinuteList():void\n\t\t{\n\t\t\tif(this.minutesList)\n\t\t\t{\n\t\t\t\tthis.listGroup.removeChild(this.minutesList, true);\n\t\t\t\tthis.minutesList = null;\n\t\t\t}\n\n\t\t\tif(this._editingMode === DateTimeMode.DATE)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar listFactory:Function = (this._listFactory !== null) ? this._listFactory : defaultListFactory;\n\t\t\tthis.minutesList = SpinnerList(listFactory());\n\t\t\tvar listStyleName:String = (this._customListStyleName !== null) ? this._customListStyleName : this.listStyleName;\n\t\t\tthis.minutesList.styleNameList.add(listStyleName);\n\t\t\tthis.minutesList.dataProvider = new IntegerRangeCollection(MIN_MINUTES_VALUE, MAX_MINUTES_VALUE, this._minuteStep);\n\t\t\t//for backwards compatibility, allow the listFactory to take\n\t\t\t//precedence if it also sets itemRendererFactory or\n\t\t\t//customItemRendererStyleName\n\t\t\tif(this._itemRendererFactory !== null)\n\t\t\t{\n\t\t\t\tthis.minutesList.itemRendererFactory = this._itemRendererFactory;\n\t\t\t}\n\t\t\tif(this._customItemRendererStyleName !== null)\n\t\t\t{\n\t\t\t\tthis.minutesList.customItemRendererStyleName = this._customItemRendererStyleName;\n\t\t\t}\n\t\t\tthis.minutesList.addEventListener(FeathersEventType.RENDERER_ADD, minutesList_rendererAddHandler);\n\t\t\tthis.minutesList.addEventListener(Event.CHANGE, minutesList_changeHandler);\n\t\t\tthis.listGroup.addChild(this.minutesList);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createMeridiemList():void\n\t\t{\n\t\t\tif(this.meridiemList)\n\t\t\t{\n\t\t\t\tthis.listGroup.removeChild(this.meridiemList, true);\n\t\t\t\tthis.meridiemList = null;\n\t\t\t}\n\n\t\t\tif(!this._showMeridiem)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar listFactory:Function = (this._listFactory !== null) ? this._listFactory : defaultListFactory;\n\t\t\tthis.meridiemList = SpinnerList(listFactory());\n\t\t\tvar listStyleName:String = (this._customListStyleName !== null) ? this._customListStyleName : this.listStyleName;\n\t\t\tthis.meridiemList.styleNameList.add(listStyleName);\n\t\t\t//for backwards compatibility, allow the listFactory to take\n\t\t\t//precedence if it also sets itemRendererFactory or\n\t\t\t//customItemRendererStyleName\n\t\t\tif(this._itemRendererFactory !== null)\n\t\t\t{\n\t\t\t\tthis.meridiemList.itemRendererFactory = this._itemRendererFactory;\n\t\t\t}\n\t\t\tif(this._customItemRendererStyleName !== null)\n\t\t\t{\n\t\t\t\tthis.meridiemList.customItemRendererStyleName = this._customItemRendererStyleName;\n\t\t\t}\n\t\t\tthis.meridiemList.addEventListener(Event.CHANGE, meridiemList_changeHandler);\n\t\t\tthis.listGroup.addChild(this.meridiemList);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createDateAndTimeDateList():void\n\t\t{\n\t\t\tif(this.dateAndTimeDatesList)\n\t\t\t{\n\t\t\t\tthis.listGroup.removeChild(this.dateAndTimeDatesList, true);\n\t\t\t\tthis.dateAndTimeDatesList = null;\n\t\t\t}\n\n\t\t\tif(this._editingMode !== DateTimeMode.DATE_AND_TIME)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar listFactory:Function = (this._listFactory !== null) ? this._listFactory : defaultListFactory;\n\t\t\tthis.dateAndTimeDatesList = SpinnerList(listFactory());\n\t\t\tvar listStyleName:String = (this._customListStyleName !== null) ? this._customListStyleName : this.listStyleName;\n\t\t\tthis.dateAndTimeDatesList.styleNameList.add(listStyleName);\n\t\t\t//for backwards compatibility, allow the listFactory to take\n\t\t\t//precedence if it also sets itemRendererFactory or\n\t\t\t//customItemRendererStyleName\n\t\t\tif(this._itemRendererFactory !== null)\n\t\t\t{\n\t\t\t\tthis.dateAndTimeDatesList.itemRendererFactory = this._itemRendererFactory;\n\t\t\t}\n\t\t\tif(this._customItemRendererStyleName !== null)\n\t\t\t{\n\t\t\t\tthis.dateAndTimeDatesList.customItemRendererStyleName = this._customItemRendererStyleName;\n\t\t\t}\n\t\t\tthis.dateAndTimeDatesList.addEventListener(FeathersEventType.RENDERER_ADD, dateAndTimeDatesList_rendererAddHandler);\n\t\t\tthis.dateAndTimeDatesList.addEventListener(Event.CHANGE, dateAndTimeDatesList_changeHandler);\n\t\t\tthis.dateAndTimeDatesList.typicalItem = {};\n\t\t\tthis.listGroup.addChildAt(this.dateAndTimeDatesList, 0);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshLocale():void\n\t\t{\n\t\t\tif(!this._formatter || this._formatter.requestedLocaleIDName != this._locale)\n\t\t\t{\n\t\t\t\tthis._formatter = new DateTimeFormatter(this._locale, DateTimeStyle.SHORT, DateTimeStyle.SHORT);\n\t\t\t\tvar dateTimePattern:String = this._formatter.getDateTimePattern();\n\t\t\t\t//figure out if month or date should be displayed first\n\t\t\t\tvar monthIndex:int = dateTimePattern.indexOf(\"M\");\n\t\t\t\tvar dateIndex:int = dateTimePattern.indexOf(\"d\");\n\t\t\t\tthis._monthFirst = monthIndex < dateIndex;\n\t\t\t\t//figure out if this locale uses am/pm or 24-hour format\n\t\t\t\tthis._showMeridiem = this._editingMode !== DateTimeMode.DATE && dateTimePattern.indexOf(\"a\") >= 0;\n\t\t\t\tif(this._showMeridiem)\n\t\t\t\t{\n\t\t\t\t\tthis._formatter.setDateTimePattern(\"a\");\n\t\t\t\t\tHELPER_DATE.setHours(1);\n\t\t\t\t\t//different locales have different names for am and pm\n\t\t\t\t\t//as an example, see zh_CN\n\t\t\t\t\tthis._amString = this._formatter.format(HELPER_DATE);\n\t\t\t\t\tHELPER_DATE.setHours(13);\n\t\t\t\t\tthis._pmString = this._formatter.format(HELPER_DATE);\n\t\t\t\t\tthis._formatter.setDateTimePattern(dateTimePattern);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._editingMode === DateTimeMode.DATE)\n\t\t\t{\n\t\t\t\tthis._localeMonthNames = this._formatter.getMonthNames(DateTimeNameStyle.FULL);\n\t\t\t\tthis._localeWeekdayNames = null;\n\t\t\t}\n\t\t\telse if(this._editingMode === DateTimeMode.DATE_AND_TIME)\n\t\t\t{\n\t\t\t\tthis._localeMonthNames = this._formatter.getMonthNames(DateTimeNameStyle.SHORT_ABBREVIATION);\n\t\t\t\tthis._localeWeekdayNames = this._formatter.getWeekdayNames(DateTimeNameStyle.LONG_ABBREVIATION);\n\t\t\t}\n\t\t\telse //time only\n\t\t\t{\n\t\t\t\tthis._localeMonthNames = null;\n\t\t\t\tthis._localeWeekdayNames = null;\n\t\t\t}\n\t\t\tif(this._localeMonthNames !== null)\n\t\t\t{\n\t\t\t\tthis._longestMonthNameIndex = 0;\n\t\t\t\tvar longestMonth:String = this._localeMonthNames[0];\n\t\t\t\tvar monthCount:int = this._localeMonthNames.length;\n\t\t\t\tfor(var i:int = 1; i < monthCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar otherMonthName:String = this._localeMonthNames[i];\n\t\t\t\t\tif(otherMonthName.length > longestMonth.length)\n\t\t\t\t\t{\n\t\t\t\t\t\tlongestMonth = otherMonthName;\n\t\t\t\t\t\tthis._longestMonthNameIndex = i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshSelection():void\n\t\t{\n\t\t\tvar oldIgnoreListChanges:Boolean = this._ignoreListChanges;\n\t\t\tthis._ignoreListChanges = true;\n\n\t\t\tif(this._editingMode === DateTimeMode.DATE)\n\t\t\t{\n\t\t\t\tvar yearsCollection:IntegerRangeCollection = IntegerRangeCollection(this.yearsList.dataProvider);\n\t\t\t\tif(yearsCollection !== null)\n\t\t\t\t{\n\t\t\t\t\tyearsCollection.minimum = this._listMinYear;\n\t\t\t\t\tyearsCollection.maximum = this._listMaxYear;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.yearsList.dataProvider = new IntegerRangeCollection(this._listMinYear, this._listMaxYear, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //time only or both date and time\n\t\t\t{\n\t\t\t\tvar totalMS:Number = this._maximum.time - this._minimum.time;\n\t\t\t\tvar totalDays:int = totalMS / MS_PER_DAY;\n\n\t\t\t\tif(this._editingMode === DateTimeMode.DATE_AND_TIME)\n\t\t\t\t{\n\t\t\t\t\tvar dateAndTimeDatesCollection:IntegerRangeCollection = IntegerRangeCollection(this.dateAndTimeDatesList.dataProvider);\n\t\t\t\t\tif(dateAndTimeDatesCollection !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tdateAndTimeDatesCollection.maximum = totalDays;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.dateAndTimeDatesList.dataProvider = new IntegerRangeCollection(0, totalDays, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar hoursMinimum:Number = MIN_HOURS_VALUE;\n\t\t\t\tvar hoursMaximum:Number = this._showMeridiem ? MAX_HOURS_VALUE_12HOURS : MAX_HOURS_VALUE_24HOURS;\n\t\t\t\tvar hoursCollection:IntegerRangeCollection = IntegerRangeCollection(this.hoursList.dataProvider);\n\t\t\t\tif(hoursCollection !== null)\n\t\t\t\t{\n\t\t\t\t\thoursCollection.minimum = hoursMinimum;\n\t\t\t\t\thoursCollection.maximum = hoursMaximum;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.hoursList.dataProvider = new IntegerRangeCollection(hoursMinimum, hoursMaximum, 1);\n\t\t\t\t}\n\n\t\t\t\tif(this._showMeridiem && !this.meridiemList.dataProvider)\n\t\t\t\t{\n\t\t\t\t\tthis.meridiemList.dataProvider = new VectorCollection(new <String>[this._amString, this._pmString]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(this.monthsList && !this.monthsList.isScrolling)\n\t\t\t{\n\t\t\t\tthis.monthsList.selectedItem = this._value.month;\n\t\t\t}\n\t\t\tif(this.datesList && !this.datesList.isScrolling)\n\t\t\t{\n\t\t\t\tthis.datesList.selectedItem = this._value.date;\n\t\t\t}\n\t\t\tif(this.yearsList && !this.yearsList.isScrolling)\n\t\t\t{\n\t\t\t\tthis.yearsList.selectedItem = this._value.fullYear;\n\t\t\t}\n\n\t\t\tif(this.dateAndTimeDatesList)\n\t\t\t{\n\t\t\t\tthis.dateAndTimeDatesList.selectedIndex = (this._value.time - this._minimum.time) / MS_PER_DAY;\n\t\t\t}\n\t\t\tif(this.hoursList)\n\t\t\t{\n\t\t\t\tif(this._showMeridiem)\n\t\t\t\t{\n\t\t\t\t\tthis.hoursList.selectedIndex = this._value.hours % 12;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.hoursList.selectedIndex = this._value.hours;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this.minutesList)\n\t\t\t{\n\t\t\t\tthis.minutesList.selectedItem = this._value.minutes;\n\t\t\t}\n\t\t\tif(this.meridiemList)\n\t\t\t{\n\t\t\t\tthis.meridiemList.selectedIndex = (this._value.hours <= MAX_HOURS_VALUE_12HOURS) ? 0 : 1;\n\t\t\t}\n\t\t\tthis._ignoreListChanges = oldIgnoreListChanges;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshEnabled():void\n\t\t{\n\t\t\tvar listCount:int = this.listGroup.numChildren;\n\t\t\tfor(var i:int = 0; i < listCount; i++)\n\t\t\t{\n\t\t\t\tvar list:SpinnerList = SpinnerList(this.listGroup.getChildAt(i));\n\t\t\t\tlist.isEnabled = this._isEnabled;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getMinMonth(year:int):int\n\t\t{\n\t\t\tif(year == this._minYear)\n\t\t\t{\n\t\t\t\treturn this._minimum.month;\n\t\t\t}\n\t\t\treturn MIN_MONTH_VALUE;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getMaxMonth(year:int):int\n\t\t{\n\t\t\tif(year == this._maxYear)\n\t\t\t{\n\t\t\t\treturn this._maximum.month;\n\t\t\t}\n\t\t\treturn MAX_MONTH_VALUE;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getMinDate(year:int, month:int):int\n\t\t{\n\t\t\tif(year == this._minYear && month == this._minimum.month)\n\t\t\t{\n\t\t\t\treturn this._minimum.date;\n\t\t\t}\n\t\t\treturn MIN_DATE_VALUE;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getMaxDate(year:int, month:int):int\n\t\t{\n\t\t\tif(year == this._maxYear && month == this._maximum.month)\n\t\t\t{\n\t\t\t\treturn this._maximum.date;\n\t\t\t}\n\t\t\tif(month == 1) //february has a variable number of days\n\t\t\t{\n\t\t\t\t//subtract one date from march 1st to figure out the last\n\t\t\t\t//date of february for the specified year\n\t\t\t\tHELPER_DATE.setFullYear(year, month + 1, -1);\n\t\t\t\treturn HELPER_DATE.date + 1;\n\t\t\t}\n\t\t\t//all other months have been pre-calculated\n\t\t\treturn DAYS_IN_MONTH[month];\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getMinHours(year:int, month:int, date:int):int\n\t\t{\n\t\t\tif(this._editingMode === DateTimeMode.DATE_AND_TIME)\n\t\t\t{\n\t\t\t\tif(year == this._minYear && month == this._minimum.month &&\n\t\t\t\t\tdate == this._minimum.date)\n\t\t\t\t{\n\t\t\t\t\treturn this._minimum.hours;\n\t\t\t\t}\n\t\t\t\treturn MIN_HOURS_VALUE;\n\t\t\t}\n\t\t\treturn this._minimum.hours;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getMaxHours(year:int, month:int, date:int):int\n\t\t{\n\t\t\tif(this._editingMode === DateTimeMode.DATE_AND_TIME)\n\t\t\t{\n\t\t\t\tif(year == this._maxYear && month == this._maximum.month &&\n\t\t\t\t\tdate == this._maximum.date)\n\t\t\t\t{\n\t\t\t\t\treturn this._maximum.hours;\n\t\t\t\t}\n\t\t\t\treturn MAX_HOURS_VALUE_24HOURS;\n\t\t\t}\n\t\t\treturn this._maximum.hours;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getMinMinutes(year:int, month:int, date:int, hours:int):int\n\t\t{\n\t\t\tif(this._editingMode === DateTimeMode.DATE_AND_TIME)\n\t\t\t{\n\t\t\t\tif(year == this._minYear && month == this._minimum.month &&\n\t\t\t\t\tdate == this._minimum.date && hours == this._minimum.hours)\n\t\t\t\t{\n\t\t\t\t\treturn this._minimum.minutes;\n\t\t\t\t}\n\t\t\t\treturn MIN_MINUTES_VALUE;\n\t\t\t}\n\t\t\tif(hours == this._minHours)\n\t\t\t{\n\t\t\t\treturn this._minimum.minutes;\n\t\t\t}\n\t\t\treturn MIN_MINUTES_VALUE;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getMaxMinutes(year:int, month:int, date:int, hours:int):int\n\t\t{\n\t\t\tif(this._editingMode === DateTimeMode.DATE_AND_TIME)\n\t\t\t{\n\t\t\t\tif(year == this._maxYear && month == this._maximum.month &&\n\t\t\t\t\tdate == this._maximum.date && hours == this._maximum.hours)\n\t\t\t\t{\n\t\t\t\t\treturn this._maximum.minutes;\n\t\t\t\t}\n\t\t\t\treturn MAX_MINUTES_VALUE;\n\t\t\t}\n\t\t\tif(hours == this._maxHours)\n\t\t\t{\n\t\t\t\treturn this._maximum.minutes;\n\t\t\t}\n\t\t\treturn MAX_MINUTES_VALUE;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getValidDateForYearAndMonth(year:int, month:int):int\n\t\t{\n\t\t\tvar date:int = this._value.date;\n\t\t\tvar minDate:int = this.getMinDate(year, month);\n\t\t\tvar maxDate:int = this.getMaxDate(year, month);\n\t\t\tif(date < minDate)\n\t\t\t{\n\t\t\t\tdate = minDate;\n\t\t\t}\n\t\t\telse if(date > maxDate)\n\t\t\t{\n\t\t\t\tdate = maxDate;\n\t\t\t}\n\t\t\treturn date;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshValidRanges():void\n\t\t{\n\t\t\tvar oldMinYear:int = this._minYear;\n\t\t\tvar oldMaxYear:int = this._maxYear;\n\t\t\tvar oldMinMonth:int = this._minMonth;\n\t\t\tvar oldMaxMonth:int = this._maxMonth;\n\t\t\tvar oldMinDate:int = this._minDate;\n\t\t\tvar oldMaxDate:int = this._maxDate;\n\t\t\tvar oldMinHours:int = this._minHours;\n\t\t\tvar oldMaxHours:int = this._maxHours;\n\t\t\tvar oldMinMinutes:int = this._minMinute;\n\t\t\tvar oldMaxMinutes:int = this._maxMinute;\n\t\t\tvar currentYear:int = this._value.fullYear;\n\t\t\tvar currentMonth:int = this._value.month;\n\t\t\tvar currentDate:int = this._value.date;\n\t\t\tvar currentHours:int = this._value.hours;\n\n\t\t\tthis._minYear = this._minimum.fullYear;\n\t\t\tthis._maxYear = this._maximum.fullYear;\n\t\t\tthis._minMonth = this.getMinMonth(currentYear);\n\t\t\tthis._maxMonth = this.getMaxMonth(currentYear);\n\t\t\tthis._minDate = this.getMinDate(currentYear, currentMonth);\n\t\t\tthis._maxDate = this.getMaxDate(currentYear, currentMonth);\n\t\t\tthis._minHours = this.getMinHours(currentYear, currentMonth, currentDate);\n\t\t\tthis._maxHours = this.getMaxHours(currentYear, currentMonth, currentDate);\n\t\t\tthis._minMinute = this.getMinMinutes(currentYear, currentMonth, currentDate, currentHours);\n\t\t\tthis._maxMinute = this.getMaxMinutes(currentYear, currentMonth, currentDate, currentHours);\n\n\t\t\t//the item renderers in the lists may need to be enabled or disabled\n\t\t\t//after the ranges change, so we need to call updateAll() on the\n\t\t\t//collections\n\n\t\t\tvar yearsCollection:IListCollection = this.yearsList ? this.yearsList.dataProvider : null;\n\t\t\tif(yearsCollection && (oldMinYear != this._minYear || oldMaxYear != this._maxYear))\n\t\t\t{\n\t\t\t\t//we need to ensure that the item renderers are enabled\n\t\t\t\tyearsCollection.updateAll();\n\t\t\t}\n\t\t\tvar monthsCollection:IListCollection = this.monthsList ? this.monthsList.dataProvider : null;\n\t\t\tif(monthsCollection && (oldMinMonth != this._minMonth || oldMaxMonth != this._maxMonth))\n\t\t\t{\n\t\t\t\tmonthsCollection.updateAll();\n\t\t\t}\n\t\t\tvar datesCollection:IListCollection = this.datesList ? this.datesList.dataProvider : null;\n\t\t\tif(datesCollection && (oldMinDate != this._minDate || oldMaxDate != this._maxDate))\n\t\t\t{\n\t\t\t\tdatesCollection.updateAll();\n\t\t\t}\n\t\t\tvar dateAndTimeDatesCollection:IListCollection = this.dateAndTimeDatesList ? this.dateAndTimeDatesList.dataProvider : null;\n\t\t\tif(dateAndTimeDatesCollection &&\n\t\t\t\t(oldMinYear != this._minYear || oldMaxYear != this._maxYear ||\n\t\t\t\toldMinMonth != this._minMonth || oldMaxMonth != this._maxMonth ||\n\t\t\t\toldMinDate != this._minDate || oldMaxDate != this._maxDate))\n\t\t\t{\n\t\t\t\tdateAndTimeDatesCollection.updateAll();\n\t\t\t}\n\t\t\tvar hoursCollection:IListCollection = this.hoursList ? this.hoursList.dataProvider : null;\n\t\t\tif(hoursCollection && (oldMinHours != this._minHours || oldMaxHours != this._maxHours ||\n\t\t\t\t(this._showMeridiem && this._lastMeridiemValue != this.meridiemList.selectedIndex)))\n\t\t\t{\n\t\t\t\thoursCollection.updateAll();\n\t\t\t}\n\t\t\tvar minutesCollection:IListCollection = this.minutesList ? this.minutesList.dataProvider : null;\n\t\t\tif(minutesCollection && (oldMinMinutes != this._minMinute || oldMaxMinutes != this._maxMinute))\n\t\t\t{\n\t\t\t\tminutesCollection.updateAll();\n\t\t\t}\n\t\t\tif(this._showMeridiem)\n\t\t\t{\n\t\t\t\tthis._lastMeridiemValue = (this._value.hours <= MAX_HOURS_VALUE_12HOURS) ? 0 : 1;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function useDefaultsIfNeeded():void\n\t\t{\n\t\t\tif(!this._value)\n\t\t\t{\n\t\t\t\t//if we don't have a value, try to use today's date\n\t\t\t\tthis._value = new Date();\n\t\t\t\t//but if there's an existing range, keep the value in there\n\t\t\t\tif(this._minimum && this._value.time < this._minimum.time)\n\t\t\t\t{\n\t\t\t\t\tthis._value.time = this._minimum.time;\n\t\t\t\t}\n\t\t\t\telse if(this._maximum && this._value.time > this._maximum.time)\n\t\t\t\t{\n\t\t\t\t\tthis._value.time = this._maximum.time;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._minimum)\n\t\t\t{\n\t\t\t\t//we want to be able to see years outside the range between\n\t\t\t\t//minimum and maximum, even if we cannot select them. otherwise,\n\t\t\t\t//it'll look weird to loop back to the beginning or end.\n\t\t\t\tif(this._editingMode === DateTimeMode.DATE_AND_TIME)\n\t\t\t\t{\n\t\t\t\t\t//in this editing mode, the date is only controlled by one\n\t\t\t\t\t//spinner list, that increments by day. we shouldn't need to\n\t\t\t\t\t//go back more than a year.\n\t\t\t\t\tthis._listMinYear = this._minimum.fullYear - 1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//in this editing mode, the year, month, and date are\n\t\t\t\t\t//selected separately, so we should have a bigger range\n\t\t\t\t\tthis._listMinYear = this._minimum.fullYear - 10;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//if there's no minimum, we need to generate something that is\n\t\t\t//arbitrary, but acceptable for most needs\n\t\t\telse if(this._editingMode === DateTimeMode.DATE_AND_TIME)\n\t\t\t{\n\t\t\t\t//in this editing mode, the date is only controlled by one\n\t\t\t\t//spinner list, that increments by day. we shouldn't need to\n\t\t\t\t//go back more than a year.\n\t\t\t\tHELPER_DATE.time = this._value.time;\n\t\t\t\tthis._listMinYear = HELPER_DATE.fullYear - 1;\n\t\t\t\tthis._minimum = new Date(this._listMinYear, MIN_MONTH_VALUE, MIN_DATE_VALUE,\n\t\t\t\t\tMIN_HOURS_VALUE, MIN_MINUTES_VALUE);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//in this editing mode, the year, month, and date are\n\t\t\t\t//selected separately, so we should have a bigger range\n\t\t\t\tHELPER_DATE.time = this._value.time;\n\t\t\t\t//goes back 100 years, rounded down to the nearest half century\n\t\t\t\t//for 2015, this would give us 1900\n\t\t\t\t//for 2065, this would give us 1950\n\t\t\t\tthis._listMinYear = roundDownToNearest(HELPER_DATE.fullYear - 100, 50);\n\t\t\t\tthis._minimum = new Date(this._listMinYear, MIN_MONTH_VALUE, MIN_DATE_VALUE,\n\t\t\t\t\tMIN_HOURS_VALUE, MIN_MINUTES_VALUE);\n\t\t\t}\n\t\t\tif(this._maximum)\n\t\t\t{\n\t\t\t\tif(this._editingMode === DateTimeMode.DATE_AND_TIME)\n\t\t\t\t{\n\t\t\t\t\tthis._listMaxYear = this._maximum.fullYear + 1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._listMaxYear = this._maximum.fullYear + 10;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(this._editingMode === DateTimeMode.DATE_AND_TIME)\n\t\t\t{\n\t\t\t\t//in this editing mode, the date is only controlled by one\n\t\t\t\t//spinner list, that increments by day. we shouldn't need to\n\t\t\t\t//go forward more than a year.\n\t\t\t\tHELPER_DATE.time = this._value.time;\n\t\t\t\tthis._listMaxYear = HELPER_DATE.fullYear + 1;\n\t\t\t\tthis._maximum = new Date(this._listMaxYear, MAX_MONTH_VALUE,\n\t\t\t\t\tDAYS_IN_MONTH[MAX_MONTH_VALUE], MAX_HOURS_VALUE_24HOURS,\n\t\t\t\t\tMAX_MINUTES_VALUE);\n\t\t\t}\n\t\t\telse //date\n\t\t\t{\n\t\t\t\t//for 2015, this would give us 2150\n\t\t\t\t//for 2065, this would give us 2200\n\t\t\t\tHELPER_DATE.time = this._value.time;\n\t\t\t\tthis._listMaxYear = roundUpToNearest(HELPER_DATE.fullYear + 100, 50);\n\t\t\t\tthis._maximum = new Date(this._listMaxYear, MAX_MONTH_VALUE,\n\t\t\t\t\tDAYS_IN_MONTH[MAX_MONTH_VALUE], MAX_HOURS_VALUE_24HOURS,\n\t\t\t\t\tMAX_MINUTES_VALUE);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutChildren():void\n\t\t{\n\t\t\tif(this.currentBackgroundSkin !== null &&\n\t\t\t\t(this.currentBackgroundSkin.width != this.actualWidth ||\n\t\t\t\tthis.currentBackgroundSkin.height != this.actualHeight))\n\t\t\t{\n\t\t\t\tthis.currentBackgroundSkin.width = this.actualWidth;\n\t\t\t\tthis.currentBackgroundSkin.height = this.actualHeight;\n\t\t\t}\n\t\t\tthis.listGroup.x = this._paddingLeft;\n\t\t\tthis.listGroup.y = this._paddingTop;\n\t\t\tthis.listGroup.width = this.actualWidth - this._paddingLeft - this._paddingRight;\n\t\t\tthis.listGroup.height = this.actualHeight - this._paddingTop - this._paddingBottom;\n\t\t\tthis.listGroup.validate();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function handlePendingScroll():void\n\t\t{\n\t\t\tif(!this.pendingScrollToDate)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar pendingDate:Date = this.pendingScrollToDate;\n\t\t\tthis.pendingScrollToDate = null;\n\t\t\tvar duration:Number = this.pendingScrollDuration;\n\t\t\tif(duration !== duration) //isNaN\n\t\t\t{\n\t\t\t\tduration = this._scrollDuration;\n\t\t\t}\n\t\t\tif(this.yearsList)\n\t\t\t{\n\t\t\t\tvar year:int = pendingDate.fullYear;\n\t\t\t\tif(this.yearsList.selectedItem != year)\n\t\t\t\t{\n\t\t\t\t\tvar yearRange:IntegerRangeCollection = IntegerRangeCollection(this.yearsList.dataProvider);\n\t\t\t\t\tthis.yearsList.scrollToDisplayIndex(year - yearRange.minimum, duration);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this.monthsList)\n\t\t\t{\n\t\t\t\tvar month:int = pendingDate.month;\n\t\t\t\tif(this.monthsList.selectedItem != month)\n\t\t\t\t{\n\t\t\t\t\tthis.monthsList.scrollToDisplayIndex(month, duration);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this.datesList)\n\t\t\t{\n\t\t\t\tvar date:int = pendingDate.date;\n\t\t\t\tif(this.datesList.selectedItem != date)\n\t\t\t\t{\n\t\t\t\t\tthis.datesList.scrollToDisplayIndex(date - 1, duration);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this.dateAndTimeDatesList)\n\t\t\t{\n\t\t\t\tvar dateIndex:int = (pendingDate.time - this._minimum.time) / MS_PER_DAY;\n\t\t\t\tif(this.dateAndTimeDatesList.selectedIndex != dateIndex)\n\t\t\t\t{\n\t\t\t\t\tthis.dateAndTimeDatesList.scrollToDisplayIndex(dateIndex, duration);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this.hoursList)\n\t\t\t{\n\t\t\t\tvar hours:int = pendingDate.hours;\n\t\t\t\tif(this._showMeridiem)\n\t\t\t\t{\n\t\t\t\t\thours %= 12;\n\t\t\t\t}\n\t\t\t\tif(this.hoursList.selectedItem != hours)\n\t\t\t\t{\n\t\t\t\t\tthis.hoursList.scrollToDisplayIndex(hours, duration);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this.minutesList)\n\t\t\t{\n\t\t\t\tvar minutes:int = pendingDate.minutes;\n\t\t\t\tif(this.minutesList.selectedItem != minutes)\n\t\t\t\t{\n\t\t\t\t\tthis.minutesList.scrollToDisplayIndex(minutes, duration);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this.meridiemList)\n\t\t\t{\n\t\t\t\tvar index:int = (pendingDate.hours < MAX_HOURS_VALUE_12HOURS) ? 0 : 1;\n\t\t\t\tif(this.meridiemList.selectedIndex != index)\n\t\t\t\t{\n\t\t\t\t\tthis.meridiemList.scrollToDisplayIndex(index, duration);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function isMonthEnabled(month:int):Boolean\n\t\t{\n\t\t\treturn month >= this._minMonth && month <= this._maxMonth;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function isYearEnabled(year:int):Boolean\n\t\t{\n\t\t\treturn year >= this._minYear && year <= this._maxYear;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function isDateEnabled(date:int):Boolean\n\t\t{\n\t\t\treturn date >= this._minDate && date <= this._maxDate;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function isHourEnabled(hour:int):Boolean\n\t\t{\n\t\t\tif(this._showMeridiem && this.meridiemList.selectedIndex != 0)\n\t\t\t{\n\t\t\t\thour += 12;\n\t\t\t}\n\t\t\treturn hour >= this._minHours && hour <= this._maxHours;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function isMinuteEnabled(minute:int):Boolean\n\t\t{\n\t\t\treturn minute >= this._minMinute && minute <= this._maxMinute;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function formatHours(item:int):String\n\t\t{\n\t\t\tif(this._showMeridiem)\n\t\t\t{\n\t\t\t\tif(item == 0)\n\t\t\t\t{\n\t\t\t\t\titem = 12;\n\t\t\t\t}\n\t\t\t\treturn item.toString();\n\t\t\t}\n\t\t\tvar hours:String = item.toString();\n\t\t\tif(hours.length < 2)\n\t\t\t{\n\t\t\t\thours = \"0\" + hours;\n\t\t\t}\n\t\t\treturn hours;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function formatMinutes(item:int):String\n\t\t{\n\t\t\tvar minutes:String = item.toString();\n\t\t\tif(minutes.length < 2)\n\t\t\t{\n\t\t\t\tminutes = \"0\" + minutes;\n\t\t\t}\n\t\t\treturn minutes;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function formatDateAndTimeWeekday(item:Object):String\n\t\t{\n\t\t\tif(item is int)\n\t\t\t{\n\t\t\t\tHELPER_DATE.setTime(this._minimum.time);\n\t\t\t\tHELPER_DATE.setDate(HELPER_DATE.date + item);\n\t\t\t\tif(this._todayLabel)\n\t\t\t\t{\n\t\t\t\t\t//_lastValidate will be updated once per validation when\n\t\t\t\t\t//scrolling, which is better than creating many duplicate Date\n\t\t\t\t\t//objects in this function\n\t\t\t\t\tif(HELPER_DATE.fullYear == this._lastValidate.fullYear &&\n\t\t\t\t\t\tHELPER_DATE.month == this._lastValidate.month &&\n\t\t\t\t\t\tHELPER_DATE.date == this._lastValidate.date)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn \"\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this._localeWeekdayNames[HELPER_DATE.day] as String;\n\t\t\t}\n\t\t\t//this value is used for measurement to try to avoid truncated text.\n\t\t\t//it will not be displayed!\n\t\t\treturn \"Wom\";\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function formatDateAndTimeDate(item:Object):String\n\t\t{\n\t\t\tif(item is int)\n\t\t\t{\n\t\t\t\tHELPER_DATE.setTime(this._minimum.time);\n\t\t\t\tHELPER_DATE.setDate(HELPER_DATE.date + item);\n\t\t\t\tif(this._todayLabel)\n\t\t\t\t{\n\t\t\t\t\t//_lastValidate will be updated once per validation when\n\t\t\t\t\t//scrolling, which is better than creating many duplicate Date\n\t\t\t\t\t//objects in this function\n\t\t\t\t\tif(HELPER_DATE.fullYear == this._lastValidate.fullYear &&\n\t\t\t\t\t\tHELPER_DATE.month == this._lastValidate.month &&\n\t\t\t\t\t\tHELPER_DATE.date == this._lastValidate.date)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn this._todayLabel;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar monthName:String = this._localeMonthNames[HELPER_DATE.month] as String;\n\t\t\t\tif(this._monthFirst)\n\t\t\t\t{\n\t\t\t\t\treturn monthName + \" \" + HELPER_DATE.date;\n\t\t\t\t}\n\t\t\t\treturn HELPER_DATE.date + \" \" + monthName;\n\t\t\t}\n\t\t\t//this value is used for measurement to try to avoid truncated text.\n\t\t\t//it will not be displayed!\n\t\t\treturn \"Wom 30\";\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function formatMonthName(item:int):String\n\t\t{\n\t\t\treturn this._localeMonthNames[item] as String;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function validateNewValue():void\n\t\t{\n\t\t\tvar currentTime:Number = this._value.time;\n\t\t\tvar minimumTime:Number = this._minimum.time;\n\t\t\tvar maximumTime:Number = this._maximum.time;\n\t\t\tvar needsToScroll:Boolean = false;\n\t\t\tif(currentTime < minimumTime)\n\t\t\t{\n\t\t\t\tneedsToScroll = true;\n\t\t\t\tthis._value.setTime(minimumTime);\n\t\t\t}\n\t\t\telse if(currentTime > maximumTime)\n\t\t\t{\n\t\t\t\tneedsToScroll = true;\n\t\t\t\tthis._value.setTime(maximumTime);\n\t\t\t}\n\t\t\tif(needsToScroll)\n\t\t\t{\n\t\t\t\tthis.scrollToDate(this._value);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function updateHoursFromLists():Boolean\n\t\t{\n\t\t\tvar hours:int = this.hoursList.selectedItem as int;\n\t\t\tif(this.meridiemList && this.meridiemList.selectedIndex == 1)\n\t\t\t{\n\t\t\t\thours += 12;\n\t\t\t}\n\t\t\tif(this._value.hours == hours)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tthis._value.setHours(hours);\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function minutesList_rendererAddHandler(event:Event, itemRenderer:DefaultListItemRenderer):void\n\t\t{\n\t\t\titemRenderer.labelFunction = formatMinutes;\n\t\t\titemRenderer.enabledFunction = isMinuteEnabled;\n\t\t\titemRenderer.itemHasEnabled = true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function hoursList_rendererAddHandler(event:Event, itemRenderer:DefaultListItemRenderer):void\n\t\t{\n\t\t\titemRenderer.labelFunction = formatHours;\n\t\t\titemRenderer.enabledFunction = isHourEnabled;\n\t\t\titemRenderer.itemHasEnabled = true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dateAndTimeDatesList_rendererAddHandler(event:Event, itemRenderer:DefaultListItemRenderer):void\n\t\t{\n\t\t\titemRenderer.labelFunction = formatDateAndTimeDate;\n\t\t\titemRenderer.accessoryLabelFunction = formatDateAndTimeWeekday;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function monthsList_rendererAddHandler(event:Event, itemRenderer:DefaultListItemRenderer):void\n\t\t{\n\t\t\titemRenderer.labelFunction = formatMonthName;\n\t\t\titemRenderer.enabledFunction = isMonthEnabled;\n\t\t\titemRenderer.itemHasEnabled = true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function datesList_rendererAddHandler(event:Event, itemRenderer:DefaultListItemRenderer):void\n\t\t{\n\t\t\titemRenderer.enabledFunction = isDateEnabled;\n\t\t\titemRenderer.itemHasEnabled = true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function yearsList_rendererAddHandler(event:Event, itemRenderer:DefaultListItemRenderer):void\n\t\t{\n\t\t\titemRenderer.enabledFunction = isYearEnabled;\n\t\t\titemRenderer.itemHasEnabled = true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function monthsList_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreListChanges)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar month:int = this.monthsList.selectedItem as int;\n\t\t\tvar date:int = this.getValidDateForYearAndMonth(this._value.fullYear, month);\n\t\t\tvar needsToScroll:Boolean = this._value.date != date;\n\t\t\tif(!needsToScroll && this._value.month == month)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._value.setMonth(month, date);\n\t\t\tthis.validateNewValue();\n\t\t\tthis.refreshValidRanges();\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tif(needsToScroll)\n\t\t\t{\n\t\t\t\tthis.scrollToDate(this._value);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function datesList_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreListChanges)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar date:int = this.datesList.selectedItem as int;\n\t\t\tif(this._value.date == date)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._value.setDate(date);\n\t\t\tthis.validateNewValue();\n\t\t\tthis.refreshValidRanges();\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function yearsList_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreListChanges)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar year:int = this.yearsList.selectedItem as int;\n\t\t\tif(this._value.fullYear == year)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._value.setFullYear(year);\n\t\t\tthis.validateNewValue();\n\t\t\tthis.refreshValidRanges();\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dateAndTimeDatesList_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreListChanges)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._value.setFullYear(this._minimum.fullYear, this._minimum.month, this._minimum.date + this.dateAndTimeDatesList.selectedIndex);\n\t\t\tthis.validateNewValue();\n\t\t\tthis.refreshValidRanges();\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function hoursList_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreListChanges)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!this.updateHoursFromLists())\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.validateNewValue();\n\t\t\tthis.refreshValidRanges();\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function minutesList_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreListChanges)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar minutes:int = this.minutesList.selectedItem as int;\n\t\t\tif(this._value.minutes == minutes)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._value.setMinutes(minutes);\n\t\t\tthis.validateNewValue();\n\t\t\tthis.refreshValidRanges();\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function meridiemList_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreListChanges)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!this.updateHoursFromLists())\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.validateNewValue();\n\t\t\tthis.refreshValidRanges();\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\t}\n}\n\nimport feathers.data.IListCollection;\nimport feathers.events.CollectionEventType;\n\nimport starling.events.Event;\nimport starling.events.EventDispatcher;\n\nclass IntegerRangeCollection extends EventDispatcher implements IListCollection\n{\n\tpublic function IntegerRangeCollection(minimum:int = 0, maximum:int = 1, step:int = 1)\n\t{\n\t\tthis._minimum = minimum;\n\t\tthis._maximum = maximum;\n\t\tthis._step = step;\n\t}\n\n\tprotected var _minimum:int;\n\n\tpublic function get minimum():int\n\t{\n\t\treturn this._minimum;\n\t}\n\n\tpublic function set minimum(value:int):void\n\t{\n\t\tif(this._minimum == value)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tthis._minimum = value;\n\t\tthis.dispatchEventWith(CollectionEventType.RESET);\n\t\tthis.dispatchEventWith(Event.CHANGE);\n\t}\n\n\tprotected var _maximum:int;\n\n\tpublic function get maximum():int\n\t{\n\t\treturn this._maximum;\n\t}\n\n\tpublic function set maximum(value:int):void\n\t{\n\t\tif(this._maximum == value)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tthis._maximum = value;\n\t\tthis.dispatchEventWith(CollectionEventType.RESET);\n\t\tthis.dispatchEventWith(Event.CHANGE);\n\t}\n\n\tprotected var _step:int;\n\n\tpublic function get step():int\n\t{\n\t\treturn this._step;\n\t}\n\n\tpublic function set step(value:int):void\n\t{\n\t\tif(this._step == value)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tthis._step = value;\n\t\tthis.dispatchEventWith(CollectionEventType.RESET);\n\t\tthis.dispatchEventWith(Event.CHANGE);\n\t}\n\n\tpublic function get filterFunction():Function\n\t{\n\t\treturn null;\n\t}\n\n\tpublic function set filterFunction(value:Function):void\n\t{\n\t\tthrow new Error(\"Not implemented\");\n\t}\n\n\tpublic function get sortCompareFunction():Function\n\t{\n\t\treturn null;\n\t}\n\n\tpublic function set sortCompareFunction(value:Function):void\n\t{\n\t\tthrow new Error(\"Not implemented\");\n\t}\n\n\tpublic function get data():Object\n\t{\n\t\treturn null;\n\t}\n\n\tpublic function set data(value:Object):void\n\t{\n\t\tthrow new Error(\"Not implemented\");\n\t}\n\n\tpublic function get length():int\n\t{\n\t\treturn 1 + int((this._maximum - this._minimum) / this._step);\n\t}\n\n\tpublic function getItemAt(index:int):Object\n\t{\n\t\tvar maximum:int = this._maximum;\n\t\tvar result:int = this._minimum + index * this._step;\n\t\tif(result > maximum)\n\t\t{\n\t\t\tresult = maximum;\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic function contains(item:Object):Boolean\n\t{\n\t\tif(!(item is int))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tvar value:int = item as int;\n\t\treturn Math.ceil((value - this._minimum) / this._step) != -1;\n\t}\n\n\tpublic function getItemIndex(item:Object):int\n\t{\n\t\tif(!(item is int))\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\t\tvar value:int = item as int;\n\t\treturn Math.ceil((value - this._minimum) / this._step);\n\t}\n\n\tpublic function refreshFilter():void\n\t{\n\t\tthrow new Error(\"Not implemented\");\n\t}\n\n\tpublic function refresh():void\n\t{\n\t\tthrow new Error(\"Not implemented\");\n\t}\n\n\tpublic function setItemAt(item:Object, index:int):void\n\t{\n\t\tthrow new Error(\"Not implemented\");\n\t}\n\n\tpublic function addItem(item:Object):void\n\t{\n\t\tthrow new Error(\"Not implemented\");\n\t}\n\n\tpublic function addItemAt(item:Object, index:int):void\n\t{\n\t\tthrow new Error(\"Not implemented\");\n\t}\n\n\tpublic function push(item:Object):void\n\t{\n\t\tthrow new Error(\"Not implemented\");\n\t}\n\n\tpublic function shift():Object\n\t{\n\t\tthrow new Error(\"Not implemented\");\n\t}\n\n\tpublic function removeItem(item:Object):void\n\t{\n\t\tthrow new Error(\"Not implemented\");\n\t}\n\n\tpublic function removeItemAt(index:int):Object\n\t{\n\t\tthrow new Error(\"Not implemented\");\n\t}\n\n\tpublic function unshift(item:Object):void\n\t{\n\t\tthrow new Error(\"Not implemented\");\n\t}\n\n\tpublic function removeAll():void\n\t{\n\t\tthrow new Error(\"Not implemented\");\n\t}\n\n\tpublic function pop():Object\n\t{\n\t\tthrow new Error(\"Not implemented\");\n\t}\n\n\tpublic function addAll(collection:IListCollection):void\n\t{\n\t\tthrow new Error(\"Not implemented\");\n\t}\n\n\tpublic function addAllAt(collection:IListCollection, index:int):void\n\t{\n\t\tthrow new Error(\"Not implemented\");\n\t}\n\n\tpublic function reset(collection:IListCollection):void\n\t{\n\t\tthrow new Error(\"Not implemented\");\n\t}\n\n\tpublic function updateItemAt(index:int):void\n\t{\n\t\tthis.dispatchEventWith(CollectionEventType.UPDATE_ITEM, false, index);\n\t}\n\n\tpublic function updateAll():void\n\t{\n\t\tthis.dispatchEventWith(CollectionEventType.UPDATE_ALL);\n\t}\n\n\tpublic function dispose(callback:Function):void\n\t{\n\t\tthrow new Error(\"Not implemented\");\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/DecelerationRate.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\t/**\n\t * Deceleration rate, per millisecond.\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class DecelerationRate\n\t{\n\t\t/**\n\t\t * The default deceleration rate per millisecond.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const NORMAL:Number = 0.998;\n\n\t\t/**\n\t\t * Decelerates a bit faster than the normal amount.\n\t\t *\n\t\t * @see #NORMAL\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const FAST:Number = 0.99;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/DragGesture.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\t/**\n\t * Gestures used to drag content.\n\t */\n\tpublic class DragGesture\n\t{\n\t\t/**\n\t\t * The target may be dragged in the appropriate direction from any\n\t\t * location within its bounds.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const CONTENT:String = \"content\";\n\n\t\t/**\n\t\t * The target may be dragged in the appropriate direction starting from\n\t\t * near the target's edge.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const EDGE:String = \"edge\";\n\n\t\t/**\n\t\t * No gesture can be used to drag the target.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const NONE:String = \"none\";\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/Drawers.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.controls.supportClasses.BaseScreenNavigator;\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IValidating;\n\timport feathers.events.ExclusiveTouch;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.Orientation;\n\timport feathers.layout.RelativeDepth;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.system.DeviceCapabilities;\n\timport feathers.utils.display.getDisplayObjectDepthFromStage;\n\timport feathers.utils.math.roundToNearest;\n\n\timport flash.events.KeyboardEvent;\n\timport flash.geom.Point;\n\timport flash.ui.Keyboard;\n\timport flash.utils.getTimer;\n\n\timport starling.animation.Transitions;\n\timport starling.animation.Tween;\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.display.DisplayObjectContainer;\n\timport starling.display.Quad;\n\timport starling.display.Stage;\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\timport starling.events.ResizeEvent;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\t/**\n\t * The divider between the bottom drawer and the content when the bottom\n\t * drawer is docked.\n\t *\n\t * <p>In the following example, a <code>Quad</code> is added as the\n\t * bottom drawer divider:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var divider:Quad = new Quad( 2, 2, 0x999999 );\n\t * drawers.bottomDrawerDivider = quad;\n\t * drawers.bottomDrawerDockMode = Orientation.BOTH</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #bottomDrawer\n\t */\n\t[Style(name=\"bottomDrawerDivider\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The divider between the left drawer and the content when the left\n\t * drawer is docked.\n\t *\n\t * <p>In the following example, a <code>Quad</code> is added as the\n\t * left drawer divider:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var divider:Quad = new Quad( 2, 2, 0x999999 );\n\t * drawers.leftDrawerDivider = quad;\n\t * drawers.leftDrawerDockMode = Orientation.BOTH</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #leftDrawer\n\t */\n\t[Style(name=\"leftDrawerDivider\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * Determines whether the drawer opens above the content or below it.\n\t *\n\t * <p>In the following example, the drawers are opened above the\n\t * content:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * drawers.openMode = RelativeDepth.ABOVE;</listing>\n\t *\n\t * @default feathers.layout.RelativeDepth#BELOW\n\t *\n\t * @see feathers.layout.RelativeDepth#BELOW\n\t * @see feathers.layout.RelativeDepth#ABOVE\n\t */\n\t[Style(name=\"openMode\",type=\"String\")]\n\n\t/**\n\t * The duration, in seconds, of the animation when a drawer opens or\n\t * closes.\n\t *\n\t * <p>In the following example, the duration of the animation that opens\n\t * or closes a drawer is set to 500 milliseconds:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * drawers.openOrCloseDuration = 0.5;</listing>\n\t *\n\t * @default 0.25\n\t *\n\t * @see #style:openOrCloseEase\n\t */\n\t[Style(name=\"openOrCloseDuration\",type=\"Number\")]\n\n\t/**\n\t * The easing function used for opening or closing the drawers.\n\t *\n\t * <p>In the following example, the ease of the animation that opens and\n\t * closes a drawer is customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * drawers.openOrCloseEase = Transitions.EASE_IN_OUT;</listing>\n\t *\n\t * @default starling.animation.Transitions.EASE_OUT\n\t *\n\t * @see http://doc.starling-framework.org/core/starling/animation/Transitions.html starling.animation.Transitions\n\t * @see #style:openOrCloseDuration\n\t */\n\t[Style(name=\"openOrCloseEase\",type=\"Object\")]\n\n\t/**\n\t * An optional display object that appears above the content when a\n\t * drawer is open.\n\t *\n\t * <p>In the following example, a <code>Quad</code> is added as the\n\t * overlay skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var skin:Quad = new Quad( 10, 10, 0x000000 );\n\t * skin.alpha = 0.75;\n\t * drawers.overlaySkin = skin;</listing>\n\t *\n\t * @default null\n\t */\n\t[Style(name=\"overlaySkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The divider between the right drawer and the content when the right\n\t * drawer is docked.\n\t *\n\t * <p>In the following example, a <code>Quad</code> is added as the\n\t * right drawer divider:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var divider:Quad = new Quad( 2, 2, 0x999999 );\n\t * drawers.rightDrawerDivider = quad;\n\t * drawers.rightDrawerDockMode = Orientation.BOTH</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #rightDrawer\n\t */\n\t[Style(name=\"rightDrawerDivider\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The divider between the top drawer and the content when the top\n\t * drawer is docked.\n\t *\n\t * <p>In the following example, a <code>Quad</code> is added as the\n\t * top drawer divider:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var divider:Quad = new Quad( 2, 2, 0x999999 );\n\t * drawers.topDrawerDivider = quad;\n\t * drawers.topDrawerDockMode = Orientation.BOTH</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #topDrawer\n\t */\n\t[Style(name=\"topDrawerDivider\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * Dispatched when the user starts dragging the content to open or close a\n\t * drawer.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.BEGIN_INTERACTION\n\t * @see #event:endInteraction feathers.events.FeathersEventType.END_INTERACTION\n\t */\n\t[Event(name=\"beginInteraction\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the user stops dragging the content to open or close a\n\t * drawer. The drawer may continue opening or closing after this event is\n\t * dispatched if the user interaction has also triggered an animation.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.END_INTERACTION\n\t * @see #event:beginInteraction feathers.events.FeathersEventType.BEGIN_INTERACTION\n\t */\n\t[Event(name=\"endInteraction\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when a drawer has completed opening. The <code>data</code>\n\t * property of the event indicates which drawer is open.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The drawer that was opened.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.OPEN\n\t * @see #event:close starling.events.Event.CLOSE\n\t */\n\t[Event(name=\"open\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when a drawer has completed closing. The <code>data</code>\n\t * property of the event indicates which drawer was closed.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The drawer that was closed.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CLOSE\n\t * @see #event:open starling.events.Event.OPEN\n\t */\n\t[Event(name=\"close\",type=\"starling.events.Event\")]\n\n\t/**\n\t * A container that displays primary content in the center surrounded by\n\t * optional \"drawers\" that can open and close on the edges. Useful for\n\t * mobile-style app menus that slide open from the side of the screen.\n\t *\n\t * <p>Additionally, each drawer may be individually \"docked\" in an\n\t * always-open state, making this a useful application-level layout\n\t * container even if the drawers never need to be hidden. Docking behavior\n\t * may be limited to either portrait or landscape, or a drawer may be docked\n\t * in both orientations. By default, a drawer is not docked.</p>\n\t *\n\t * <p>The following example creates an app with a slide out menu to the\n\t * left of the main content:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var navigator:StackScreenNavigator = new StackScreenNavigator();\n\t * var list:List = new List();\n\t * // the navigator's screens, the list's data provider, and additional\n\t * // properties should be set here.\n\t * \n\t * var drawers:Drawers = new Drawers();\n\t * drawers.content = navigator;\n\t * drawers.leftDrawer = menu;\n\t * drawers.leftDrawerToggleEventType = Event.OPEN;\n\t * this.addChild( drawers );</listing>\n\t *\n\t * <p>In the example above, a screen in the <code>StackScreenNavigator</code>\n\t * component dispatches an event of type <code>Event.OPEN</code> when it\n\t * wants to display the slide out the <code>List</code> that is used as\n\t * the left drawer.</p>\n\t *\n\t * @see ../../../help/drawers.html How to use the Feathers Drawers component\n\t *\n\t * @productversion Feathers 1.2.0\n\t */\n\tpublic class Drawers extends FeathersControl\n\t{\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>Drawers</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * The field used to access the \"content event dispatcher\" of a\n\t\t * <code>ScreenNavigator</code> component, which happens to be the\n\t\t * currently active screen.\n\t\t *\n\t\t * @see #contentEventDispatcherField\n\t\t * @see feathers.controls.ScreenNavigator\n\t\t */\n\t\tprotected static const SCREEN_NAVIGATOR_CONTENT_EVENT_DISPATCHER_FIELD:String = \"activeScreen\";\n\n\t\t/**\n\t\t * @private\n\t\t * The current velocity is given high importance.\n\t\t */\n\t\tprivate static const CURRENT_VELOCITY_WEIGHT:Number = 2.33;\n\n\t\t/**\n\t\t * @private\n\t\t * Older saved velocities are given less importance.\n\t\t */\n\t\tprivate static const VELOCITY_WEIGHTS:Vector.<Number> = new <Number>[1, 1.33, 1.66, 2];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const MAXIMUM_SAVED_VELOCITY_COUNT:int = 4;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const HELPER_POINT:Point = new Point();\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function Drawers(content:IFeathersControl = null)\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.content = content;\n\t\t\tthis.addEventListener(Event.ADDED_TO_STAGE, drawers_addedToStageHandler);\n\t\t\tthis.addEventListener(Event.REMOVED_FROM_STAGE, drawers_removedFromStageHandler);\n\t\t\tthis.addEventListener(TouchEvent.TOUCH, drawers_touchHandler);\n\t\t}\n\n\t\t/**\n\t\t * The event dispatcher that controls opening and closing drawers with\n\t\t * events. Often, the event dispatcher is the content itself, but you\n\t\t * may specify a <code>contentEventDispatcherField</code> to access a\n\t\t * property of the content instead, or you may specify a\n\t\t * <code>contentEventDispatcherFunction</code> to run some more complex\n\t\t * code to access the event dispatcher.\n\t\t *\n\t\t * @see #contentEventDispatcherField\n\t\t * @see #contentEventDispatcherFunction\n\t\t */\n\t\tprotected var contentEventDispatcher:EventDispatcher;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn Drawers.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _originalContentWidth:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _originalContentHeight:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _content:IFeathersControl;\n\n\t\t/**\n\t\t * The primary content displayed in the center of the container.\n\t\t *\n\t\t * <p>If the primary content is a container where you'd prefer to listen\n\t\t * to events from its children, you may need to use properties like\n\t\t * <code>contentEventDispatcherField</code>, <code>contentEventDispatcherFunction</code>,\n\t\t * and <code>contentEventDispatcherChangeEventType</code> to ensure that\n\t\t * open and close events for drawers are correctly mapped to the correct\n\t\t * event dispatcher. If the content is dispatching the events, then those\n\t\t * properties should be set to <code>null</code>.</p>\n\t\t *\n\t\t * <p>In the following example, a <code>StackScreenNavigator</code> is added\n\t\t * as the content:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var navigator:StackScreenNavigator = new StackScreenNavigator();\n\t\t * // additional code to add the screens can go here\n\t\t * drawers.content = navigator;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #contentEventDispatcherField\n\t\t * @see #contentEventDispatcherFunction\n\t\t * @see #contentEventDispatcherChangeEventType\n\t\t */\n\t\tpublic function get content():IFeathersControl\n\t\t{\n\t\t\treturn this._content;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set content(value:IFeathersControl):void\n\t\t{\n\t\t\tif(this._content === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._content)\n\t\t\t{\n\t\t\t\tif(this._contentEventDispatcherChangeEventType)\n\t\t\t\t{\n\t\t\t\t\tthis._content.removeEventListener(this._contentEventDispatcherChangeEventType, content_eventDispatcherChangeHandler);\n\t\t\t\t}\n\t\t\t\tthis._content.removeEventListener(FeathersEventType.RESIZE, content_resizeHandler);\n\t\t\t\tif(this._content.parent === this)\n\t\t\t\t{\n\t\t\t\t\tthis.removeChild(DisplayObject(this._content), false);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._content = value;\n\t\t\tthis._originalContentWidth = NaN;\n\t\t\tthis._originalContentHeight = NaN;\n\t\t\tif(this._content)\n\t\t\t{\n\t\t\t\tif(this._content is BaseScreenNavigator)\n\t\t\t\t{\n\t\t\t\t\tthis.contentEventDispatcherField = SCREEN_NAVIGATOR_CONTENT_EVENT_DISPATCHER_FIELD;\n\t\t\t\t\tthis.contentEventDispatcherChangeEventType = Event.CHANGE;\n\t\t\t\t}\n\t\t\t\tif(this._contentEventDispatcherChangeEventType)\n\t\t\t\t{\n\t\t\t\t\tthis._content.addEventListener(this._contentEventDispatcherChangeEventType, content_eventDispatcherChangeHandler);\n\t\t\t\t}\n\t\t\t\tif(this._autoSizeMode === AutoSizeMode.CONTENT || !this.stage)\n\t\t\t\t{\n\t\t\t\t\tthis._content.addEventListener(FeathersEventType.RESIZE, content_resizeHandler);\n\t\t\t\t}\n\t\t\t\tif(this._openMode === RelativeDepth.ABOVE)\n\t\t\t\t{\n\t\t\t\t\tthis.addChildAt(DisplayObject(this._content), 0);\n\t\t\t\t}\n\t\t\t\telse //below\n\t\t\t\t{\n\t\t\t\t\t//the content should appear under the overlay skin, if it exists\n\t\t\t\t\tif(this._overlaySkin)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.addChildAt(DisplayObject(this._content), this.getChildIndex(this._overlaySkin));\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.addChild(DisplayObject(this._content));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _overlaySkinOriginalAlpha:Number = 1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _overlaySkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get overlaySkin():DisplayObject\n\t\t{\n\t\t\treturn this._overlaySkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set overlaySkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._overlaySkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._overlaySkin && this._overlaySkin.parent == this)\n\t\t\t{\n\t\t\t\tthis.removeChild(this._overlaySkin, false);\n\t\t\t}\n\t\t\tthis._overlaySkin = value;\n\t\t\tif(this._overlaySkin)\n\t\t\t{\n\t\t\t\tthis._overlaySkinOriginalAlpha = this._overlaySkin.alpha;\n\t\t\t\tthis._overlaySkin.visible = this.isTopDrawerOpen || this.isRightDrawerOpen || this.isBottomDrawerOpen || this.isLeftDrawerOpen;\n\t\t\t\tthis.addChild(this._overlaySkin);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _originalTopDrawerWidth:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _originalTopDrawerHeight:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _topDrawer:IFeathersControl;\n\n\t\t/**\n\t\t * The drawer that appears above the primary content.\n\t\t *\n\t\t * <p>In the following example, a <code>List</code> is added as the\n\t\t * top drawer:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var list:List = new List();\n\t\t * // set data provider and other properties here\n\t\t * drawers.topDrawer = list;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #topDrawerDockMode\n\t\t * @see #topDrawerToggleEventType\n\t\t */\n\t\tpublic function get topDrawer():IFeathersControl\n\t\t{\n\t\t\treturn this._topDrawer;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set topDrawer(value:IFeathersControl):void\n\t\t{\n\t\t\tif(this._topDrawer === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this.isTopDrawerOpen && value === null)\n\t\t\t{\n\t\t\t\tthis.isTopDrawerOpen = false;\n\t\t\t}\n\t\t\tif(this._topDrawer && this._topDrawer.parent === this)\n\t\t\t{\n\t\t\t\tthis.removeChild(DisplayObject(this._topDrawer), false);\n\t\t\t}\n\t\t\tthis._topDrawer = value;\n\t\t\tthis._originalTopDrawerWidth = NaN;\n\t\t\tthis._originalTopDrawerHeight = NaN;\n\t\t\tif(this._topDrawer)\n\t\t\t{\n\t\t\t\tthis._topDrawer.visible = false;\n\t\t\t\tthis._topDrawer.addEventListener(FeathersEventType.RESIZE, drawer_resizeHandler);\n\t\t\t\tif(this._openMode === RelativeDepth.ABOVE)\n\t\t\t\t{\n\t\t\t\t\tthis.addChild(DisplayObject(this._topDrawer));\n\t\t\t\t}\n\t\t\t\telse //below\n\t\t\t\t{\n\t\t\t\t\tthis.addChildAt(DisplayObject(this._topDrawer), 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _topDrawerDivider:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get topDrawerDivider():DisplayObject\n\t\t{\n\t\t\treturn this._topDrawerDivider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set topDrawerDivider(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._topDrawerDivider === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._topDrawerDivider && this._topDrawerDivider.parent == this)\n\t\t\t{\n\t\t\t\tthis.removeChild(this._topDrawerDivider, false);\n\t\t\t}\n\t\t\tthis._topDrawerDivider = value;\n\t\t\tif(this._topDrawerDivider)\n\t\t\t{\n\t\t\t\tthis._topDrawerDivider.visible = false;\n\t\t\t\tthis.addChild(this._topDrawerDivider);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _topDrawerDockMode:String = Orientation.NONE;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"portrait,landscape,both,none\")]\n\t\t/**\n\t\t * Determines if the top drawer is docked in all, some, or no stage\n\t\t * orientations. The current stage orientation is determined by\n\t\t * calculating the aspect ratio of the stage.\n\t\t *\n\t\t * <p>In the following example, the top drawer is docked in the\n\t\t * landscape stage orientation:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * drawers.topDrawerDockMode = Orientation.LANDSCAPE;</listing>\n\t\t *\n\t\t * @default feathers.layout.Orientation.NONE\n\t\t *\n\t\t * @see feathers.layout.Orientation#PORTRAIT\n\t\t * @see feathers.layout.Orientation#LANDSCAPE\n\t\t * @see feathers.layout.Orientation#NONE\n\t\t * @see feathers.layout.Orientation#BOTH\n\t\t * @see #topDrawer\n\t\t */\n\t\tpublic function get topDrawerDockMode():String\n\t\t{\n\t\t\treturn this._topDrawerDockMode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set topDrawerDockMode(value:String):void\n\t\t{\n\t\t\tif(this._topDrawerDockMode == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._topDrawerDockMode = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _topDrawerToggleEventType:String;\n\n\t\t/**\n\t\t * When this event is dispatched by the content event dispatcher, the\n\t\t * top drawer will toggle open and closed.\n\t\t *\n\t\t * <p>In the following example, the top drawer is toggled when the\n\t\t * content dispatches an event of type <code>Event.OPEN</code>:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * drawers.topDrawerToggleEventType = Event.OPEN;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #content\n\t\t * @see #topDrawer\n\t\t */\n\t\tpublic function get topDrawerToggleEventType():String\n\t\t{\n\t\t\treturn this._topDrawerToggleEventType;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set topDrawerToggleEventType(value:String):void\n\t\t{\n\t\t\tif(this._topDrawerToggleEventType == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this.contentEventDispatcher && this._topDrawerToggleEventType)\n\t\t\t{\n\t\t\t\tthis.contentEventDispatcher.removeEventListener(this._topDrawerToggleEventType, content_topDrawerToggleEventTypeHandler);\n\t\t\t}\n\t\t\tthis._topDrawerToggleEventType = value;\n\t\t\tif(this.contentEventDispatcher && this._topDrawerToggleEventType)\n\t\t\t{\n\t\t\t\tthis.contentEventDispatcher.addEventListener(this._topDrawerToggleEventType, content_topDrawerToggleEventTypeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isTopDrawerOpen:Boolean = false;\n\n\t\t/**\n\t\t * Indicates if the top drawer is currently open. If you want to check\n\t\t * if the top drawer is docked, check <code>isTopDrawerDocked</code>\n\t\t * instead.\n\t\t *\n\t\t * <p>To animate the top drawer open or closed, call\n\t\t * <code>toggleTopDrawer()</code>. Setting <code>isTopDrawerOpen</code>\n\t\t * will open or close the top drawer without animation.</p>\n\t\t *\n\t\t * <p>In the following example, we check if the top drawer is open:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * if( drawers.isTopDrawerOpen )\n\t\t * {\n\t\t *     // do something\n\t\t * }</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see #isTopDrawerDocked\n\t\t * @see #topDrawer\n\t\t * @see #toggleTopDrawer()\n\t\t */\n\t\tpublic function get isTopDrawerOpen():Boolean\n\t\t{\n\t\t\treturn this._topDrawer && this._isTopDrawerOpen;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isTopDrawerOpen(value:Boolean):void\n\t\t{\n\t\t\tif(this.isTopDrawerDocked || this._isTopDrawerOpen == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value)\n\t\t\t{\n\t\t\t\tthis.isRightDrawerOpen = false;\n\t\t\t\tthis.isBottomDrawerOpen = false;\n\t\t\t\tthis.isLeftDrawerOpen = false;\n\t\t\t}\n\t\t\tthis._isTopDrawerOpen = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * Indicates if the top drawer is currently docked. Docking behavior of\n\t\t * the top drawer is controlled with the <code>topDrawerDockMode</code>\n\t\t * property. To check if the top drawer is open, but not docked, use\n\t\t * the <code>isTopDrawerOpen</code> property.\n\t\t *\n\t\t * @see #topDrawer\n\t\t * @see #topDrawerDockMode\n\t\t * @see #isTopDrawerOpen\n\t\t */\n\t\tpublic function get isTopDrawerDocked():Boolean\n\t\t{\n\t\t\tif(!this._topDrawer)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(this._topDrawerDockMode === Orientation.BOTH)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif(this._topDrawerDockMode === Orientation.NONE)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar stage:Stage = this.stage;\n\t\t\tif(stage === null)\n\t\t\t{\n\t\t\t\t//fall back to the current stage, but it may be wrong...\n\t\t\t\tstage = Starling.current.stage;\n\t\t\t}\n\t\t\tif(stage.stageWidth > stage.stageHeight)\n\t\t\t{\n\t\t\t\treturn this._topDrawerDockMode === Orientation.LANDSCAPE;\n\t\t\t}\n\t\t\treturn this._topDrawerDockMode === Orientation.PORTRAIT;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _originalRightDrawerWidth:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _originalRightDrawerHeight:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _rightDrawer:IFeathersControl;\n\n\t\t/**\n\t\t * The drawer that appears to the right of the primary content.\n\t\t *\n\t\t * <p>In the following example, a <code>List</code> is added as the\n\t\t * right drawer:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var list:List = new List();\n\t\t * // set data provider and other properties here\n\t\t * drawers.rightDrawer = list;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #rightDrawerDockMode\n\t\t * @see #rightDrawerToggleEventType\n\t\t */\n\t\tpublic function get rightDrawer():IFeathersControl\n\t\t{\n\t\t\treturn this._rightDrawer;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set rightDrawer(value:IFeathersControl):void\n\t\t{\n\t\t\tif(this._rightDrawer == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this.isRightDrawerOpen && value === null)\n\t\t\t{\n\t\t\t\tthis.isRightDrawerOpen = false;\n\t\t\t}\n\t\t\tif(this._rightDrawer && this._rightDrawer.parent == this)\n\t\t\t{\n\t\t\t\tthis.removeChild(DisplayObject(this._rightDrawer), false);\n\t\t\t}\n\t\t\tthis._rightDrawer = value;\n\t\t\tthis._originalRightDrawerWidth = NaN;\n\t\t\tthis._originalRightDrawerHeight = NaN;\n\t\t\tif(this._rightDrawer)\n\t\t\t{\n\t\t\t\tthis._rightDrawer.visible = false;\n\t\t\t\tthis._rightDrawer.addEventListener(FeathersEventType.RESIZE, drawer_resizeHandler);\n\t\t\t\tif(this._openMode === RelativeDepth.ABOVE)\n\t\t\t\t{\n\t\t\t\t\tthis.addChild(DisplayObject(this._rightDrawer));\n\t\t\t\t}\n\t\t\t\telse //below\n\t\t\t\t{\n\t\t\t\t\tthis.addChildAt(DisplayObject(this._rightDrawer), 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _rightDrawerDivider:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get rightDrawerDivider():DisplayObject\n\t\t{\n\t\t\treturn this._rightDrawerDivider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set rightDrawerDivider(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._rightDrawerDivider === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._rightDrawerDivider && this._rightDrawerDivider.parent == this)\n\t\t\t{\n\t\t\t\tthis.removeChild(this._rightDrawerDivider, false);\n\t\t\t}\n\t\t\tthis._rightDrawerDivider = value;\n\t\t\tif(this._rightDrawerDivider)\n\t\t\t{\n\t\t\t\tthis._rightDrawerDivider.visible = false;\n\t\t\t\tthis.addChild(this._rightDrawerDivider);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _rightDrawerDockMode:String = Orientation.NONE;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"portrait,landscape,both,none\")]\n\t\t/**\n\t\t * Determines if the right drawer is docked in all, some, or no stage\n\t\t * orientations. The current stage orientation is determined by\n\t\t * calculating the aspect ratio of the stage.\n\t\t *\n\t\t * <p>In the following example, the right drawer is docked in the\n\t\t * landscape stage orientation:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * drawers.rightDrawerDockMode = Orientation.LANDSCAPE;</listing>\n\t\t *\n\t\t * @default feathers.layout.Orientation.NONE\n\t\t *\n\t\t * @see feathers.layout.Orientation#PORTRAIT\n\t\t * @see feathers.layout.Orientation#LANDSCAPE\n\t\t * @see feathers.layout.Orientation#NONE\n\t\t * @see feathers.layout.Orientation#BOTH\n\t\t * @see #rightDrawer\n\t\t */\n\t\tpublic function get rightDrawerDockMode():String\n\t\t{\n\t\t\treturn this._rightDrawerDockMode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set rightDrawerDockMode(value:String):void\n\t\t{\n\t\t\tif(this._rightDrawerDockMode == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._rightDrawerDockMode = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _rightDrawerToggleEventType:String;\n\n\t\t/**\n\t\t * When this event is dispatched by the content event dispatcher, the\n\t\t * right drawer will toggle open and closed.\n\t\t *\n\t\t * <p>In the following example, the right drawer is toggled when the\n\t\t * content dispatches an event of type <code>Event.OPEN</code>:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * drawers.rightDrawerToggleEventType = Event.OPEN;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #content\n\t\t * @see #rightDrawer\n\t\t */\n\t\tpublic function get rightDrawerToggleEventType():String\n\t\t{\n\t\t\treturn this._rightDrawerToggleEventType;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set rightDrawerToggleEventType(value:String):void\n\t\t{\n\t\t\tif(this._rightDrawerToggleEventType == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this.contentEventDispatcher && this._rightDrawerToggleEventType)\n\t\t\t{\n\t\t\t\tthis.contentEventDispatcher.removeEventListener(this._rightDrawerToggleEventType, content_rightDrawerToggleEventTypeHandler);\n\t\t\t}\n\t\t\tthis._rightDrawerToggleEventType = value;\n\t\t\tif(this.contentEventDispatcher && this._rightDrawerToggleEventType)\n\t\t\t{\n\t\t\t\tthis.contentEventDispatcher.addEventListener(this._rightDrawerToggleEventType, content_rightDrawerToggleEventTypeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isRightDrawerOpen:Boolean = false;\n\n\t\t/**\n\t\t * Indicates if the right drawer is currently open. If you want to check\n\t\t * if the right drawer is docked, check <code>isRightDrawerDocked</code>\n\t\t * instead.\n\t\t *\n\t\t * <p>To animate the right drawer open or closed, call\n\t\t * <code>toggleRightDrawer()</code>. Setting <code>isRightDrawerOpen</code>\n\t\t * will open or close the right drawer without animation.</p>\n\t\t *\n\t\t * <p>In the following example, we check if the right drawer is open:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * if( drawers.isRightDrawerOpen )\n\t\t * {\n\t\t *     // do something\n\t\t * }</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see #rightDrawer\n\t\t * @see #rightDrawerDockMode\n\t\t * @see #toggleRightDrawer()\n\t\t */\n\t\tpublic function get isRightDrawerOpen():Boolean\n\t\t{\n\t\t\treturn this._rightDrawer && this._isRightDrawerOpen;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isRightDrawerOpen(value:Boolean):void\n\t\t{\n\t\t\tif(this.isRightDrawerDocked || this._isRightDrawerOpen == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value)\n\t\t\t{\n\t\t\t\tthis.isTopDrawerOpen = false;\n\t\t\t\tthis.isBottomDrawerOpen = false;\n\t\t\t\tthis.isLeftDrawerOpen = false;\n\t\t\t}\n\t\t\tthis._isRightDrawerOpen = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * Indicates if the right drawer is currently docked. Docking behavior of\n\t\t * the right drawer is controlled with the <code>rightDrawerDockMode</code>\n\t\t * property. To check if the right drawer is open, but not docked, use\n\t\t * the <code>isRightDrawerOpen</code> property.\n\t\t *\n\t\t * @see #rightDrawer\n\t\t * @see #rightDrawerDockMode\n\t\t * @see #isRightDrawerOpen\n\t\t */\n\t\tpublic function get isRightDrawerDocked():Boolean\n\t\t{\n\t\t\tif(!this._rightDrawer)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(this._rightDrawerDockMode === Orientation.BOTH)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif(this._rightDrawerDockMode === Orientation.NONE)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar stage:Stage = this.stage;\n\t\t\tif(stage === null)\n\t\t\t{\n\t\t\t\t//fall back to the current stage, but it may be wrong...\n\t\t\t\tstage = Starling.current.stage;\n\t\t\t}\n\t\t\tif(stage.stageWidth > stage.stageHeight)\n\t\t\t{\n\t\t\t\treturn this._rightDrawerDockMode === Orientation.LANDSCAPE;\n\t\t\t}\n\t\t\treturn this._rightDrawerDockMode === Orientation.PORTRAIT;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _originalBottomDrawerWidth:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _originalBottomDrawerHeight:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _bottomDrawer:IFeathersControl;\n\n\t\t/**\n\t\t * The drawer that appears below the primary content.\n\t\t *\n\t\t * <p>In the following example, a <code>List</code> is added as the\n\t\t * bottom drawer:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var list:List = new List();\n\t\t * // set data provider and other properties here\n\t\t * drawers.bottomDrawer = list;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #bottomDrawerDockMode\n\t\t * @see #bottomDrawerToggleEventType\n\t\t */\n\t\tpublic function get bottomDrawer():IFeathersControl\n\t\t{\n\t\t\treturn this._bottomDrawer;\n\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set bottomDrawer(value:IFeathersControl):void\n\t\t{\n\t\t\tif(this._bottomDrawer === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this.isBottomDrawerOpen && value === null)\n\t\t\t{\n\t\t\t\tthis.isBottomDrawerOpen = false;\n\t\t\t}\n\t\t\tif(this._bottomDrawer && this._bottomDrawer.parent === this)\n\t\t\t{\n\t\t\t\tthis.removeChild(DisplayObject(this._bottomDrawer), false);\n\t\t\t}\n\t\t\tthis._bottomDrawer = value;\n\t\t\tthis._originalBottomDrawerWidth = NaN;\n\t\t\tthis._originalBottomDrawerHeight = NaN;\n\t\t\tif(this._bottomDrawer)\n\t\t\t{\n\t\t\t\tthis._bottomDrawer.visible = false;\n\t\t\t\tthis._bottomDrawer.addEventListener(FeathersEventType.RESIZE, drawer_resizeHandler);\n\t\t\t\tif(this._openMode === RelativeDepth.ABOVE)\n\t\t\t\t{\n\t\t\t\t\tthis.addChild(DisplayObject(this._bottomDrawer));\n\t\t\t\t}\n\t\t\t\telse //below\n\t\t\t\t{\n\t\t\t\t\tthis.addChildAt(DisplayObject(this._bottomDrawer), 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _bottomDrawerDivider:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get bottomDrawerDivider():DisplayObject\n\t\t{\n\t\t\treturn this._bottomDrawerDivider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set bottomDrawerDivider(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._bottomDrawerDivider === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._bottomDrawerDivider && this._bottomDrawerDivider.parent == this)\n\t\t\t{\n\t\t\t\tthis.removeChild(this._bottomDrawerDivider, false);\n\t\t\t}\n\t\t\tthis._bottomDrawerDivider = value;\n\t\t\tif(this._bottomDrawerDivider)\n\t\t\t{\n\t\t\t\tthis._bottomDrawerDivider.visible = false;\n\t\t\t\tthis.addChild(this._bottomDrawerDivider);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _bottomDrawerDockMode:String = Orientation.NONE;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"portrait,landscape,both,none\")]\n\t\t/**\n\t\t * Determines if the bottom drawer is docked in all, some, or no stage\n\t\t * orientations. The current stage orientation is determined by\n\t\t * calculating the aspect ratio of the stage.\n\t\t *\n\t\t * <p>In the following example, the bottom drawer is docked in the\n\t\t * landscape stage orientation:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * drawers.bottomDrawerDockMode = Orientation.LANDSCAPE;</listing>\n\t\t *\n\t\t * @default feathers.layout.Orientation.NONE\n\t\t *\n\t\t * @see feathers.layout.Orientation#PORTRAIT\n\t\t * @see feathers.layout.Orientation#LANDSCAPE\n\t\t * @see feathers.layout.Orientation#NONE\n\t\t * @see feathers.layout.Orientation#BOTH\n\t\t * @see #bottomDrawer\n\t\t */\n\t\tpublic function get bottomDrawerDockMode():String\n\t\t{\n\t\t\treturn this._bottomDrawerDockMode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set bottomDrawerDockMode(value:String):void\n\t\t{\n\t\t\tif(this._bottomDrawerDockMode == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._bottomDrawerDockMode = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _bottomDrawerToggleEventType:String;\n\n\t\t/**\n\t\t * When this event is dispatched by the content event dispatcher, the\n\t\t * bottom drawer will toggle open and closed.\n\t\t *\n\t\t * <p>In the following example, the bottom drawer is toggled when the\n\t\t * content dispatches an event of type <code>Event.OPEN</code>:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * drawers.bottomDrawerToggleEventType = Event.OPEN;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #content\n\t\t * @see #bottomDrawer\n\t\t */\n\t\tpublic function get bottomDrawerToggleEventType():String\n\t\t{\n\t\t\treturn this._bottomDrawerToggleEventType;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set bottomDrawerToggleEventType(value:String):void\n\t\t{\n\t\t\tif(this._bottomDrawerToggleEventType == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this.contentEventDispatcher && this._bottomDrawerToggleEventType)\n\t\t\t{\n\t\t\t\tthis.contentEventDispatcher.removeEventListener(this._bottomDrawerToggleEventType, content_bottomDrawerToggleEventTypeHandler);\n\t\t\t}\n\t\t\tthis._bottomDrawerToggleEventType = value;\n\t\t\tif(this.contentEventDispatcher && this._bottomDrawerToggleEventType)\n\t\t\t{\n\t\t\t\tthis.contentEventDispatcher.addEventListener(this._bottomDrawerToggleEventType, content_bottomDrawerToggleEventTypeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isBottomDrawerOpen:Boolean = false;\n\n\t\t/**\n\t\t * Indicates if the bottom drawer is currently open. If you want to check\n\t\t * if the bottom drawer is docked, check <code>isBottomDrawerDocked</code>\n\t\t * instead.\n\t\t *\n\t\t * <p>To animate the bottom drawer open or closed, call\n\t\t * <code>toggleBottomDrawer()</code>. Setting <code>isBottomDrawerOpen</code>\n\t\t * will open or close the bottom drawer without animation.</p>\n\t\t *\n\t\t * <p>In the following example, we check if the bottom drawer is open:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * if( drawers.isBottomDrawerOpen )\n\t\t * {\n\t\t *     // do something\n\t\t * }</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see #bottomDrawer\n\t\t * @see #isBottomDrawerOpen\n\t\t * @see #toggleBottomDrawer()\n\t\t */\n\t\tpublic function get isBottomDrawerOpen():Boolean\n\t\t{\n\t\t\treturn this._bottomDrawer && this._isBottomDrawerOpen;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isBottomDrawerOpen(value:Boolean):void\n\t\t{\n\t\t\tif(this.isBottomDrawerDocked || this._isBottomDrawerOpen == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value)\n\t\t\t{\n\t\t\t\tthis.isTopDrawerOpen = false;\n\t\t\t\tthis.isRightDrawerOpen = false;\n\t\t\t\tthis.isLeftDrawerOpen = false;\n\t\t\t}\n\t\t\tthis._isBottomDrawerOpen = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * Indicates if the bottom drawer is currently docked. Docking behavior of\n\t\t * the bottom drawer is controlled with the <code>bottomDrawerDockMode</code>\n\t\t * property. To check if the bottom drawer is open, but not docked, use\n\t\t * the <code>isBottomDrawerOpen</code> property.\n\t\t *\n\t\t * @see #bottomDrawer\n\t\t * @see #bottomDrawerDockMode\n\t\t * @see #isBottomDrawerOpen\n\t\t */\n\t\tpublic function get isBottomDrawerDocked():Boolean\n\t\t{\n\t\t\tif(!this._bottomDrawer)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(this._bottomDrawerDockMode === Orientation.BOTH)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif(this._bottomDrawerDockMode === Orientation.NONE)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar stage:Stage = this.stage;\n\t\t\tif(stage === null)\n\t\t\t{\n\t\t\t\t//fall back to the current stage, but it may be wrong...\n\t\t\t\tstage = Starling.current.stage;\n\t\t\t}\n\t\t\tif(stage.stageWidth > stage.stageHeight)\n\t\t\t{\n\t\t\t\treturn this._bottomDrawerDockMode === Orientation.LANDSCAPE;\n\t\t\t}\n\t\t\treturn this._bottomDrawerDockMode === Orientation.PORTRAIT;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _originalLeftDrawerWidth:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _originalLeftDrawerHeight:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _leftDrawer:IFeathersControl;\n\n\t\t/**\n\t\t * The drawer that appears below the primary content.\n\t\t *\n\t\t * <p>In the following example, a <code>List</code> is added as the\n\t\t * left drawer:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var list:List = new List();\n\t\t * // set data provider and other properties here\n\t\t * drawers.leftDrawer = list;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #leftDrawerDockMode\n\t\t * @see #leftDrawerToggleEventType\n\t\t */\n\t\tpublic function get leftDrawer():IFeathersControl\n\t\t{\n\t\t\treturn this._leftDrawer;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set leftDrawer(value:IFeathersControl):void\n\t\t{\n\t\t\tif(this._leftDrawer === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this.isLeftDrawerOpen && value === null)\n\t\t\t{\n\t\t\t\tthis.isLeftDrawerOpen = false;\n\t\t\t}\n\t\t\tif(this._leftDrawer && this._leftDrawer.parent === this)\n\t\t\t{\n\t\t\t\tthis.removeChild(DisplayObject(this._leftDrawer), false);\n\t\t\t}\n\t\t\tthis._leftDrawer = value;\n\t\t\tthis._originalLeftDrawerWidth = NaN;\n\t\t\tthis._originalLeftDrawerHeight = NaN;\n\t\t\tif(this._leftDrawer)\n\t\t\t{\n\t\t\t\tthis._leftDrawer.visible = false;\n\t\t\t\tthis._leftDrawer.addEventListener(FeathersEventType.RESIZE, drawer_resizeHandler);\n\t\t\t\tif(this._openMode === RelativeDepth.ABOVE)\n\t\t\t\t{\n\t\t\t\t\tthis.addChild(DisplayObject(this._leftDrawer));\n\t\t\t\t}\n\t\t\t\telse //below\n\t\t\t\t{\n\t\t\t\t\tthis.addChildAt(DisplayObject(this._leftDrawer), 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _leftDrawerDivider:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get leftDrawerDivider():DisplayObject\n\t\t{\n\t\t\treturn this._leftDrawerDivider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set leftDrawerDivider(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._leftDrawerDivider === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._leftDrawerDivider && this._leftDrawerDivider.parent == this)\n\t\t\t{\n\t\t\t\tthis.removeChild(this._leftDrawerDivider, false);\n\t\t\t}\n\t\t\tthis._leftDrawerDivider = value;\n\t\t\tif(this._leftDrawerDivider)\n\t\t\t{\n\t\t\t\tthis._leftDrawerDivider.visible = false;\n\t\t\t\tthis.addChild(this._leftDrawerDivider);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _leftDrawerDockMode:String = Orientation.NONE;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"portrait,landscape,both,none\")]\n\t\t/**\n\t\t * Determines if the left drawer is docked in all, some, or no stage\n\t\t * orientations. The current stage orientation is determined by\n\t\t * calculating the aspect ratio of the stage.\n\t\t *\n\t\t * <p>In the following example, the left drawer is docked in the\n\t\t * landscape stage orientation:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * drawers.leftDrawerDockMode = Orientation.LANDSCAPE;</listing>\n\t\t *\n\t\t * @default feathers.layout.Orientation.NONE\n\t\t *\n\t\t * @see feathers.layout.Orientation#PORTRAIT\n\t\t * @see feathers.layout.Orientation#LANDSCAPE\n\t\t * @see feathers.layout.Orientation#NONE\n\t\t * @see feathers.layout.Orientation#BOTH\n\t\t * @see #leftDrawer\n\t\t */\n\t\tpublic function get leftDrawerDockMode():String\n\t\t{\n\t\t\treturn this._leftDrawerDockMode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set leftDrawerDockMode(value:String):void\n\t\t{\n\t\t\tif(this._leftDrawerDockMode == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._leftDrawerDockMode = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _leftDrawerToggleEventType:String;\n\n\t\t/**\n\t\t * When this event is dispatched by the content event dispatcher, the\n\t\t * left drawer will toggle open and closed.\n\t\t *\n\t\t * <p>In the following example, the left drawer is toggled when the\n\t\t * content dispatches and event of type <code>Event.OPEN</code>:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * drawers.leftDrawerToggleEventType = Event.OPEN;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #content\n\t\t * @see #leftDrawer\n\t\t */\n\t\tpublic function get leftDrawerToggleEventType():String\n\t\t{\n\t\t\treturn this._leftDrawerToggleEventType;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set leftDrawerToggleEventType(value:String):void\n\t\t{\n\t\t\tif(this._leftDrawerToggleEventType == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this.contentEventDispatcher && this._leftDrawerToggleEventType)\n\t\t\t{\n\t\t\t\tthis.contentEventDispatcher.removeEventListener(this._leftDrawerToggleEventType, content_leftDrawerToggleEventTypeHandler);\n\t\t\t}\n\t\t\tthis._leftDrawerToggleEventType = value;\n\t\t\tif(this.contentEventDispatcher && this._leftDrawerToggleEventType)\n\t\t\t{\n\t\t\t\tthis.contentEventDispatcher.addEventListener(this._leftDrawerToggleEventType, content_leftDrawerToggleEventTypeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isLeftDrawerOpen:Boolean = false;\n\n\t\t/**\n\t\t * Indicates if the left drawer is currently open. If you want to check\n\t\t * if the left drawer is docked, check <code>isLeftDrawerDocked</code>\n\t\t * instead.\n\t\t *\n\t\t * <p>To animate the left drawer open or closed, call\n\t\t * <code>toggleLeftDrawer()</code>. Setting <code>isLeftDrawerOpen</code>\n\t\t * will open or close the left drawer without animation.</p>\n\t\t *\n\t\t * <p>In the following example, we check if the left drawer is open:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * if( drawers.isLeftDrawerOpen )\n\t\t * {\n\t\t *     // do something\n\t\t * }</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see #leftDrawer\n\t\t * @see #isLeftDrawerDocked\n\t\t * @see #toggleLeftDrawer()\n\t\t */\n\t\tpublic function get isLeftDrawerOpen():Boolean\n\t\t{\n\t\t\treturn this._leftDrawer && this._isLeftDrawerOpen;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isLeftDrawerOpen(value:Boolean):void\n\t\t{\n\t\t\tif(this.isLeftDrawerDocked || this._isLeftDrawerOpen == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value)\n\t\t\t{\n\t\t\t\tthis.isTopDrawerOpen = false;\n\t\t\t\tthis.isRightDrawerOpen = false;\n\t\t\t\tthis.isBottomDrawerOpen = false;\n\t\t\t}\n\t\t\tthis._isLeftDrawerOpen = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * Indicates if the left drawer is currently docked. Docking behavior of\n\t\t * the left drawer is controlled with the <code>leftDrawerDockMode</code>\n\t\t * property. To check if the left drawer is open, but not docked, use\n\t\t * the <code>isLeftDrawerOpen</code> property.\n\t\t *\n\t\t * @see #leftDrawer\n\t\t * @see #leftDrawerDockMode\n\t\t * @see #isLeftDrawerOpen\n\t\t */\n\t\tpublic function get isLeftDrawerDocked():Boolean\n\t\t{\n\t\t\tif(!this._leftDrawer)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(this._leftDrawerDockMode === Orientation.BOTH)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif(this._leftDrawerDockMode === Orientation.NONE)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar stage:Stage = this.stage;\n\t\t\tif(stage === null)\n\t\t\t{\n\t\t\t\t//fall back to the current stage, but it may be wrong...\n\t\t\t\tstage = Starling.current.stage;\n\t\t\t}\n\t\t\tif(stage.stageWidth > stage.stageHeight)\n\t\t\t{\n\t\t\t\treturn this._leftDrawerDockMode === Orientation.LANDSCAPE;\n\t\t\t}\n\t\t\treturn this._leftDrawerDockMode == Orientation.PORTRAIT;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _autoSizeMode:String = AutoSizeMode.STAGE;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"stage,content\")]\n\t\t/**\n\t\t * Determines how the drawers container will set its own size when its\n\t\t * dimensions (width and height) aren't set explicitly.\n\t\t *\n\t\t * <p>In the following example, the drawers container will be sized to\n\t\t * match its content:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * drawers.autoSizeMode = AutoSizeMode.CONTENT;</listing>\n\t\t *\n\t\t * @default feathers.controls.AutoSizeMode.STAGE\n\t\t *\n\t\t * @see feathers.controls.AutoSizeMode#STAGE\n\t\t * @see feathers.controls.AutoSizeMode#CONTENT\n\t\t */\n\t\tpublic function get autoSizeMode():String\n\t\t{\n\t\t\treturn this._autoSizeMode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set autoSizeMode(value:String):void\n\t\t{\n\t\t\tif(this._autoSizeMode == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._autoSizeMode = value;\n\t\t\tif(this._content !== null)\n\t\t\t{\n\t\t\t\tif(this._autoSizeMode == AutoSizeMode.CONTENT)\n\t\t\t\t{\n\t\t\t\t\tthis._content.addEventListener(FeathersEventType.RESIZE, content_resizeHandler);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._content.removeEventListener(FeathersEventType.RESIZE, content_resizeHandler);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _clipDrawers:Boolean = true;\n\n\t\t/**\n\t\t * Determines if the drawers are clipped while opening or closing. If\n\t\t * the content does not have a background, the drawers should\n\t\t * generally be clipped so that the drawer does not show under the\n\t\t * content. If the content has a fully opaque background that will\n\t\t * conceal the drawers, then clipping may be disabled to potentially\n\t\t * improve performance.\n\t\t *\n\t\t * <p>In the following example, clipping will be disabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * navigator.clipDrawers = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t *\n\t\t * @see #topDrawer\n\t\t * @see #rightDrawer\n\t\t * @see #bottomDrawer\n\t\t * @see #leftDrawer\n\t\t */\n\t\tpublic function get clipDrawers():Boolean\n\t\t{\n\t\t\treturn this._clipDrawers;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set clipDrawers(value:Boolean):void\n\t\t{\n\t\t\tif(this._clipDrawers == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._clipDrawers = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _openMode:String = RelativeDepth.BELOW;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"below,above\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get openMode():String\n\t\t{\n\t\t\treturn this._openMode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set openMode(value:String):void\n\t\t{\n\t\t\t//for legacy reasons, OPEN_MODE_ABOVE had a different string value\n\t\t\tif(value === \"overlay\")\n\t\t\t{\n\t\t\t\tvalue = RelativeDepth.ABOVE;\n\t\t\t}\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._openMode == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._openMode = value;\n\t\t\tif(this._content !== null)\n\t\t\t{\n\t\t\t\tif(this._openMode === RelativeDepth.ABOVE)\n\t\t\t\t{\n\t\t\t\t\tthis.setChildIndex(DisplayObject(this._content), 0);\n\t\t\t\t}\n\t\t\t\telse //below\n\t\t\t\t{\n\t\t\t\t\tif(this._overlaySkin)\n\t\t\t\t\t{\n\t\t\t\t\t\t//the content should below the overlay skin\n\t\t\t\t\t\tthis.setChildIndex(DisplayObject(this._content), this.numChildren - 1);\n\t\t\t\t\t\tthis.setChildIndex(this._overlaySkin, this.numChildren - 1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.setChildIndex(DisplayObject(this._content), this.numChildren - 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _openGesture:String = DragGesture.EDGE;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"content,edge,none\")]\n\t\t/**\n\t\t * An optional touch gesture used to open a drawer.\n\t\t *\n\t\t * <p>In the following example, the drawers are opened by dragging\n\t\t * anywhere inside the content:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * drawers.openGesture = DragGesture.CONTENT;</listing>\n\t\t *\n\t\t * @default feathers.controls.DragGesture.EDGE\n\t\t *\n\t\t * @see feathers.controls.DragGesture#NONE\n\t\t * @see feathers.controls.DragGesture#CONTENT\n\t\t * @see feathers.controls.DragGesture#EDGE\n\t\t * @see #openGestureEdgeSize\n\t\t */\n\t\tpublic function get openGesture():String\n\t\t{\n\t\t\treturn this._openGesture;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set openGesture(value:String):void\n\t\t{\n\t\t\tif(value === \"dragContent\")\n\t\t\t{\n\t\t\t\tvalue = DragGesture.CONTENT;\n\t\t\t}\n\t\t\telse if(value === \"dragContentEdge\")\n\t\t\t{\n\t\t\t\tvalue = DragGesture.EDGE;\n\t\t\t}\n\t\t\tthis._openGesture = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimumDragDistance:Number = 0.04;\n\n\t\t/**\n\t\t * The minimum physical distance (in inches) that a touch must move\n\t\t * before a drag gesture begins.\n\t\t *\n\t\t * <p>In the following example, the minimum drag distance is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * drawers.minimumDragDistance = 0.1;</listing>\n\t\t *\n\t\t * @default 0.04\n\t\t */\n\t\tpublic function get minimumDragDistance():Number\n\t\t{\n\t\t\treturn this._minimumDragDistance;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minimumDragDistance(value:Number):void\n\t\t{\n\t\t\tthis._minimumDragDistance = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimumDrawerThrowVelocity:Number = 5;\n\n\t\t/**\n\t\t * The minimum physical velocity (in inches per second) that a touch\n\t\t * must move before the a drawern can be \"thrown\" to open or close it.\n\t\t * Otherwise, it will settle open or closed based on which state is\n\t\t * closer when the touch ends.\n\t\t *\n\t\t * <p>In the following example, the minimum drawer throw velocity is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * drawers.minimumDrawerThrowVelocity = 2;</listing>\n\t\t *\n\t\t * @default 5\n\t\t */\n\t\tpublic function get minimumDrawerThrowVelocity():Number\n\t\t{\n\t\t\treturn this._minimumDrawerThrowVelocity;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minimumDrawerThrowVelocity(value:Number):void\n\t\t{\n\t\t\tthis._minimumDrawerThrowVelocity = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _openGestureEdgeSize:Number = 0.1;\n\n\t\t/**\n\t\t * The size (in inches) of the region near the edge of the content that\n\t\t * can be dragged when the <code>openGesture</code> property is set to\n\t\t * <code>DragGesture.EDGE</code>.\n\t\t *\n\t\t * <p>In the following example, the open gesture edge size is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * drawers.openGestureEdgeSize = 0.25;</listing>\n\t\t *\n\t\t * @default 0.1\n\t\t *\n\t\t * @see #openGesture\n\t\t * @see feathers.controls.DragGesture#EDGE\n\t\t */\n\t\tpublic function get openGestureEdgeSize():Number\n\t\t{\n\t\t\treturn this._openGestureEdgeSize;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set openGestureEdgeSize(value:Number):void\n\t\t{\n\t\t\tthis._openGestureEdgeSize = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _contentEventDispatcherChangeEventType:String;\n\n\t\t/**\n\t\t * The event dispatched by the content to indicate that the content\n\t\t * event dispatcher has changed. When this event is dispatched by the\n\t\t * content, the drawers container will listen for the drawer toggle\n\t\t * events from the new dispatcher that discovered using\n\t\t * <code>contentEventDispatcherField</code> or\n\t\t * <code>contentEventDispatcherFunction</code>.\n\t\t *\n\t\t * <p>For <code>StackScreenNavigator</code> and\n\t\t * <code>ScreenNavigator</code> components, this value is automatically\n\t\t * set to <code>Event.CHANGE</code>.</p>\n\t\t *\n\t\t * <p>In the following example, the drawers container will update its\n\t\t * content event dispatcher when the content dispatches an event of type\n\t\t * <code>Event.CHANGE</code>:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * drawers.contentEventDispatcherChangeEventType = Event.CHANGE;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #contentEventDispatcherField\n\t\t * @see #contentEventDispatcherFunction\n\t\t */\n\t\tpublic function get contentEventDispatcherChangeEventType():String\n\t\t{\n\t\t\treturn this._contentEventDispatcherChangeEventType;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set contentEventDispatcherChangeEventType(value:String):void\n\t\t{\n\t\t\tif(this._contentEventDispatcherChangeEventType == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._content !== null && this._contentEventDispatcherChangeEventType)\n\t\t\t{\n\t\t\t\tthis._content.removeEventListener(this._contentEventDispatcherChangeEventType, content_eventDispatcherChangeHandler);\n\t\t\t}\n\t\t\tthis._contentEventDispatcherChangeEventType = value;\n\t\t\tif(this._content !== null && this._contentEventDispatcherChangeEventType)\n\t\t\t{\n\t\t\t\tthis._content.addEventListener(this._contentEventDispatcherChangeEventType, content_eventDispatcherChangeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _contentEventDispatcherField:String;\n\n\t\t/**\n\t\t * A property of the <code>content</code> that references an event\n\t\t * dispatcher that dispatches events to toggle drawers open and closed.\n\t\t *\n\t\t * <p>For <code>StackScreenNavigator</code> and\n\t\t * <code>ScreenNavigator</code> components, this value is automatically\n\t\t * set to <code>\"activeScreen\"</code> to listen for events from the\n\t\t * currently active/visible screen.</p>\n\t\t *\n\t\t * <p>In the following example, the content event dispatcher field is\n\t\t * customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * drawers.contentEventDispatcherField = \"selectedChild\";</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #contentEventDispatcherFunction\n\t\t * @see #contentEventDispatcherChangeEventType\n\t\t * @see #topDrawerToggleEventType\n\t\t * @see #rightDrawerToggleEventType\n\t\t * @see #bottomDrawerToggleEventType\n\t\t * @see #leftDrawerToggleEventType\n\t\t */\n\t\tpublic function get contentEventDispatcherField():String\n\t\t{\n\t\t\treturn this._contentEventDispatcherField;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set contentEventDispatcherField(value:String):void\n\t\t{\n\t\t\tif(this._contentEventDispatcherField == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._contentEventDispatcherField = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _contentEventDispatcherFunction:Function;\n\n\t\t/**\n\t\t * A function that returns an event dispatcher that dispatches events to\n\t\t * toggle drawers open and closed.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t *\n\t\t * <pre>function( content:DisplayObject ):EventDispatcher</pre>\n\t\t *\n\t\t * <p>In the following example, the content event dispatcher function is\n\t\t * customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * drawers.contentEventDispatcherField = function( content:CustomView ):void\n\t\t * {\n\t\t *     return content.selectedChild;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #contentEventDispatcherField\n\t\t * @see #contentEventDispatcherChangeEventType\n\t\t * @see #topDrawerToggleEventType\n\t\t * @see #rightDrawerToggleEventType\n\t\t * @see #bottomDrawerToggleEventType\n\t\t * @see #leftDrawerToggleEventType\n\t\t */\n\t\tpublic function get contentEventDispatcherFunction():Function\n\t\t{\n\t\t\treturn this._contentEventDispatcherFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set contentEventDispatcherFunction(value:Function):void\n\t\t{\n\t\t\tif(this._contentEventDispatcherFunction == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._contentEventDispatcherFunction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _openOrCloseTween:Tween;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _openOrCloseDuration:Number = 0.25;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get openOrCloseDuration():Number\n\t\t{\n\t\t\treturn this._openOrCloseDuration;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set openOrCloseDuration(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._openOrCloseDuration = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _openOrCloseEase:Object = Transitions.EASE_OUT;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get openOrCloseEase():Object\n\t\t{\n\t\t\treturn this._openOrCloseEase;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set openOrCloseEase(value:Object):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._openOrCloseEase = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var isToggleTopDrawerPending:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var isToggleRightDrawerPending:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var isToggleBottomDrawerPending:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var isToggleLeftDrawerPending:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var pendingToggleDuration:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var touchPointID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isDragging:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isDraggingTopDrawer:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isDraggingRightDrawer:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isDraggingBottomDrawer:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isDraggingLeftDrawer:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _startTouchX:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _startTouchY:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentTouchX:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentTouchY:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _previousTouchTime:int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _previousTouchX:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _previousTouchY:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _velocityX:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _velocityY:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _previousVelocityX:Vector.<Number> = new <Number>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _previousVelocityY:Vector.<Number> = new <Number>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function hitTest(localPoint:Point):DisplayObject\n\t\t{\n\t\t\tvar result:DisplayObject = super.hitTest(localPoint);\n\t\t\tif(result)\n\t\t\t{\n\t\t\t\tif(this._isDragging)\n\t\t\t\t{\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t\tif(this.isTopDrawerOpen && result != this._topDrawer && !(this._topDrawer is DisplayObjectContainer && DisplayObjectContainer(this._topDrawer).contains(result)))\n\t\t\t\t{\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t\telse if(this.isRightDrawerOpen && result != this._rightDrawer && !(this._rightDrawer is DisplayObjectContainer && DisplayObjectContainer(this._rightDrawer).contains(result)))\n\t\t\t\t{\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t\telse if(this.isBottomDrawerOpen && result != this._bottomDrawer && !(this._bottomDrawer is DisplayObjectContainer && DisplayObjectContainer(this._bottomDrawer).contains(result)))\n\t\t\t\t{\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t\telse if(this.isLeftDrawerOpen && result != this._leftDrawer && !(this._leftDrawer is DisplayObjectContainer && DisplayObjectContainer(this._leftDrawer).contains(result)))\n\t\t\t\t{\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\t//we want to register touches in our hitArea as a last resort\n\t\t\tif(!this.visible || !this.touchable)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn this._hitArea.contains(localPoint.x, localPoint.y) ? this : null;\n\t\t}\n\n\t\t/**\n\t\t * Opens or closes the top drawer. If the <code>duration</code> argument\n\t\t * is <code>NaN</code>, the default <code>openOrCloseDuration</code> is\n\t\t * used. The default value of the <code>duration</code> argument is\n\t\t * <code>NaN</code>. Otherwise, this value is the duration of the\n\t\t * animation, in seconds.\n\t\t *\n\t\t * <p>To open or close the top drawer without animation, set the\n\t\t * <code>isTopDrawerOpen</code> property.</p>\n\t\t *\n\t\t * @see #isTopDrawerOpen\n\t\t * @see #openOrCloseDuration\n\t\t * @see #openOrCloseEase\n\t\t */\n\t\tpublic function toggleTopDrawer(duration:Number = NaN):void\n\t\t{\n\t\t\tif(!this._topDrawer || this.isTopDrawerDocked)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.pendingToggleDuration = duration;\n\t\t\tif(this.isToggleTopDrawerPending)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!this.isTopDrawerOpen)\n\t\t\t{\n\t\t\t\tthis.isRightDrawerOpen = false;\n\t\t\t\tthis.isBottomDrawerOpen = false;\n\t\t\t\tthis.isLeftDrawerOpen = false;\n\t\t\t}\n\t\t\tthis.isToggleTopDrawerPending = true;\n\t\t\tthis.isToggleRightDrawerPending = false;\n\t\t\tthis.isToggleBottomDrawerPending = false;\n\t\t\tthis.isToggleLeftDrawerPending = false;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * Opens or closes the right drawer. If the <code>duration</code> argument\n\t\t * is <code>NaN</code>, the default <code>openOrCloseDuration</code> is\n\t\t * used. The default value of the <code>duration</code> argument is\n\t\t * <code>NaN</code>. Otherwise, this value is the duration of the\n\t\t * animation, in seconds.\n\t\t *\n\t\t * <p>To open or close the right drawer without animation, set the\n\t\t * <code>isRightDrawerOpen</code> property.</p>\n\t\t *\n\t\t * @see #isRightDrawerOpen\n\t\t * @see #openOrCloseDuration\n\t\t * @see #openOrCloseEase\n\t\t */\n\t\tpublic function toggleRightDrawer(duration:Number = NaN):void\n\t\t{\n\t\t\tif(!this._rightDrawer || this.isRightDrawerDocked)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.pendingToggleDuration = duration;\n\t\t\tif(this.isToggleRightDrawerPending)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!this.isRightDrawerOpen)\n\t\t\t{\n\t\t\t\tthis.isTopDrawerOpen = false;\n\t\t\t\tthis.isBottomDrawerOpen = false;\n\t\t\t\tthis.isLeftDrawerOpen = false;\n\t\t\t}\n\t\t\tthis.isToggleTopDrawerPending = false;\n\t\t\tthis.isToggleRightDrawerPending = true;\n\t\t\tthis.isToggleBottomDrawerPending = false;\n\t\t\tthis.isToggleLeftDrawerPending = false;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * Opens or closes the bottom drawer. If the <code>duration</code> argument\n\t\t * is <code>NaN</code>, the default <code>openOrCloseDuration</code> is\n\t\t * used. The default value of the <code>duration</code> argument is\n\t\t * <code>NaN</code>. Otherwise, this value is the duration of the\n\t\t * animation, in seconds.\n\t\t *\n\t\t * <p>To open or close the bottom drawer without animation, set the\n\t\t * <code>isBottomDrawerOpen</code> property.</p>\n\t\t *\n\t\t * @see #isBottomDrawerOpen\n\t\t * @see #openOrCloseDuration\n\t\t * @see #openOrCloseEase\n\t\t */\n\t\tpublic function toggleBottomDrawer(duration:Number = NaN):void\n\t\t{\n\t\t\tif(!this._bottomDrawer || this.isBottomDrawerDocked)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.pendingToggleDuration = duration;\n\t\t\tif(this.isToggleBottomDrawerPending)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!this.isBottomDrawerOpen)\n\t\t\t{\n\t\t\t\tthis.isTopDrawerOpen = false;\n\t\t\t\tthis.isRightDrawerOpen = false;\n\t\t\t\tthis.isLeftDrawerOpen = false;\n\t\t\t}\n\t\t\tthis.isToggleTopDrawerPending = false;\n\t\t\tthis.isToggleRightDrawerPending = false;\n\t\t\tthis.isToggleBottomDrawerPending = true;\n\t\t\tthis.isToggleLeftDrawerPending = false;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * Opens or closes the left drawer. If the <code>duration</code> argument\n\t\t * is <code>NaN</code>, the default <code>openOrCloseDuration</code> is\n\t\t * used. The default value of the <code>duration</code> argument is\n\t\t * <code>NaN</code>. Otherwise, this value is the duration of the\n\t\t * animation, in seconds.\n\t\t *\n\t\t * <p>To open or close the left drawer without animation, set the\n\t\t * <code>isLeftDrawerOpen</code> property.</p>\n\t\t *\n\t\t * @see #isLeftDrawerOpen\n\t\t * @see #openOrCloseDuration\n\t\t * @see #openOrCloseEase\n\t\t */\n\t\tpublic function toggleLeftDrawer(duration:Number = NaN):void\n\t\t{\n\t\t\tif(!this._leftDrawer || this.isLeftDrawerDocked)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.pendingToggleDuration = duration;\n\t\t\tif(this.isToggleLeftDrawerPending)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!this.isLeftDrawerOpen)\n\t\t\t{\n\t\t\t\tthis.isTopDrawerOpen = false;\n\t\t\t\tthis.isRightDrawerOpen = false;\n\t\t\t\tthis.isBottomDrawerOpen = false;\n\t\t\t}\n\t\t\tthis.isToggleTopDrawerPending = false;\n\t\t\tthis.isToggleRightDrawerPending = false;\n\t\t\tthis.isToggleBottomDrawerPending = false;\n\t\t\tthis.isToggleLeftDrawerPending = true;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar layoutInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_LAYOUT);\n\t\t\tvar selectedInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SELECTED);\n\n\t\t\tif(dataInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshCurrentEventTarget();\n\t\t\t}\n\n\t\t\tif(sizeInvalid || layoutInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshDrawerStates();\n\t\t\t}\n\t\t\tif(sizeInvalid || layoutInvalid || selectedInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshOverlayState();\n\t\t\t}\n\n\t\t\tsizeInvalid = this.autoSizeIfNeeded() || sizeInvalid;\n\n\t\t\tthis.layoutChildren();\n\n\t\t\tthis.handlePendingActions();\n\t\t}\n\n\t\t/**\n\t\t * If the component's dimensions have not been set explicitly, it will\n\t\t * measure its content and determine an ideal size for itself. If the\n\t\t * <code>explicitWidth</code> or <code>explicitHeight</code> member\n\t\t * variables are set, those value will be used without additional\n\t\t * measurement. If one is set, but not the other, the dimension with the\n\t\t * explicit value will not be measured, but the other non-explicit\n\t\t * dimension will still need measurement.\n\t\t *\n\t\t * <p>Calls <code>saveMeasurements()</code> to set up the\n\t\t * <code>actualWidth</code> and <code>actualHeight</code> member\n\t\t * variables used for layout.</p>\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t */\n\t\tprotected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvar measureContent:Boolean = this._autoSizeMode === AutoSizeMode.CONTENT || !this.stage;\n\t\t\tvar isTopDrawerDocked:Boolean = this.isTopDrawerDocked;\n\t\t\tvar isRightDrawerDocked:Boolean = this.isRightDrawerDocked;\n\t\t\tvar isBottomDrawerDocked:Boolean = this.isBottomDrawerDocked;\n\t\t\tvar isLeftDrawerDocked:Boolean = this.isLeftDrawerDocked;\n\t\t\tif(measureContent)\n\t\t\t{\n\t\t\t\tif(this._content !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._content.validate();\n\t\t\t\t\tif(this._originalContentWidth !== this._originalContentWidth) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._originalContentWidth = this._content.width;\n\t\t\t\t\t}\n\t\t\t\t\tif(this._originalContentHeight !== this._originalContentHeight) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._originalContentHeight = this._content.height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(isTopDrawerDocked)\n\t\t\t\t{\n\t\t\t\t\tthis._topDrawer.validate();\n\t\t\t\t\tif(this._originalTopDrawerWidth !== this._originalTopDrawerWidth) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._originalTopDrawerWidth = this._topDrawer.width;\n\t\t\t\t\t}\n\t\t\t\t\tif(this._originalTopDrawerHeight !== this._originalTopDrawerHeight) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._originalTopDrawerHeight = this._topDrawer.height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(isRightDrawerDocked)\n\t\t\t\t{\n\t\t\t\t\tthis._rightDrawer.validate();\n\t\t\t\t\tif(this._originalRightDrawerWidth !== this._originalRightDrawerWidth) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._originalRightDrawerWidth = this._rightDrawer.width;\n\t\t\t\t\t}\n\t\t\t\t\tif(this._originalRightDrawerHeight !== this._originalRightDrawerHeight) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._originalRightDrawerHeight = this._rightDrawer.height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(isBottomDrawerDocked)\n\t\t\t\t{\n\t\t\t\t\tthis._bottomDrawer.validate();\n\t\t\t\t\tif(this._originalBottomDrawerWidth !== this._originalBottomDrawerWidth) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._originalBottomDrawerWidth = this._bottomDrawer.width;\n\t\t\t\t\t}\n\t\t\t\t\tif(this._originalBottomDrawerHeight !== this._originalBottomDrawerHeight) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._originalBottomDrawerHeight = this._bottomDrawer.height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(isLeftDrawerDocked)\n\t\t\t\t{\n\t\t\t\t\tthis._leftDrawer.validate();\n\t\t\t\t\tif(this._originalLeftDrawerWidth !== this._originalLeftDrawerWidth) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._originalLeftDrawerWidth = this._leftDrawer.width;\n\t\t\t\t\t}\n\t\t\t\t\tif(this._originalLeftDrawerHeight !== this._originalLeftDrawerHeight) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._originalLeftDrawerHeight = this._leftDrawer.height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tif(measureContent)\n\t\t\t\t{\n\t\t\t\t\tif(this._content !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewWidth = this._originalContentWidth;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewWidth = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif(isLeftDrawerDocked)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewWidth += this._originalLeftDrawerWidth;\n\t\t\t\t\t}\n\t\t\t\t\tif(isRightDrawerDocked)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewWidth += this._originalRightDrawerWidth;\n\t\t\t\t\t}\n\t\t\t\t\tif(isTopDrawerDocked && this._originalTopDrawerWidth > newWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewWidth = this._originalTopDrawerWidth;\n\t\t\t\t\t}\n\t\t\t\t\tif(isBottomDrawerDocked && this._originalBottomDrawerWidth > newWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewWidth = this._originalBottomDrawerWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this.stage.stageWidth;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tif(measureContent)\n\t\t\t\t{\n\t\t\t\t\tif(this._content !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewHeight = this._originalContentHeight;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewHeight = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif(isTopDrawerDocked)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewHeight += this._originalTopDrawerHeight;\n\t\t\t\t\t}\n\t\t\t\t\tif(isBottomDrawerDocked)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewHeight += this._originalBottomDrawerHeight;\n\t\t\t\t\t}\n\t\t\t\t\tif(isLeftDrawerDocked && this._originalLeftDrawerHeight > newHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewHeight = this._originalLeftDrawerHeight;\n\t\t\t\t\t}\n\t\t\t\t\tif(isRightDrawerDocked && this._originalRightDrawerHeight > newHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewHeight = this._originalRightDrawerHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this.stage.stageHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tif(measureContent)\n\t\t\t\t{\n\t\t\t\t\tif(this._content !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = this._content.minWidth;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif(isLeftDrawerDocked)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth += this._leftDrawer.minWidth;\n\t\t\t\t\t}\n\t\t\t\t\tif(isRightDrawerDocked)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth += this._rightDrawer.minWidth;\n\t\t\t\t\t}\n\t\t\t\t\tif(isTopDrawerDocked && this._topDrawer.minWidth > newMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = this._topDrawer.minWidth;\n\t\t\t\t\t}\n\t\t\t\t\tif(isBottomDrawerDocked && this._bottomDrawer.minWidth > newMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = this._bottomDrawer.minWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = this.stage.stageWidth;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tif(measureContent)\n\t\t\t\t{\n\t\t\t\t\tif(this._content !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = this._content.minHeight;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif(isTopDrawerDocked)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight += this._topDrawer.minHeight;\n\t\t\t\t\t}\n\t\t\t\t\tif(isBottomDrawerDocked)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight += this._bottomDrawer.minHeight;\n\t\t\t\t\t}\n\t\t\t\t\tif(isLeftDrawerDocked && this._leftDrawer.minHeight > newMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = this._leftDrawer.minHeight;\n\t\t\t\t\t}\n\t\t\t\t\tif(isRightDrawerDocked && this._rightDrawer.minHeight > newMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = this._rightDrawer.minHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = this.stage.stageHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * Positions and sizes the children.\n\t\t */\n\t\tprotected function layoutChildren():void\n\t\t{\n\t\t\tvar isTopDrawerOpen:Boolean = this.isTopDrawerOpen;\n\t\t\tvar isRightDrawerOpen:Boolean = this.isRightDrawerOpen;\n\t\t\tvar isBottomDrawerOpen:Boolean = this.isBottomDrawerOpen;\n\t\t\tvar isLeftDrawerOpen:Boolean = this.isLeftDrawerOpen;\n\t\t\tvar isTopDrawerDocked:Boolean = this.isTopDrawerDocked;\n\t\t\tvar isRightDrawerDocked:Boolean = this.isRightDrawerDocked;\n\t\t\tvar isBottomDrawerDocked:Boolean = this.isBottomDrawerDocked;\n\t\t\tvar isLeftDrawerDocked:Boolean = this.isLeftDrawerDocked;\n\n\t\t\tvar topDrawerHeight:Number = 0;\n\t\t\tvar bottomDrawerHeight:Number = 0;\n\t\t\tif(this._topDrawer !== null)\n\t\t\t{\n\t\t\t\tthis._topDrawer.width = this.actualWidth;\n\t\t\t\tthis._topDrawer.validate();\n\t\t\t\ttopDrawerHeight = this._topDrawer.height;\n\t\t\t\tif(this._topDrawerDivider !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._topDrawerDivider.width = this._topDrawer.width;\n\t\t\t\t\tif(this._topDrawerDivider is IValidating)\n\t\t\t\t\t{\n\t\t\t\t\t\tIValidating(this._topDrawerDivider).validate();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._bottomDrawer !== null)\n\t\t\t{\n\t\t\t\tthis._bottomDrawer.width = this.actualWidth;\n\t\t\t\tthis._bottomDrawer.validate();\n\t\t\t\tbottomDrawerHeight = this._bottomDrawer.height;\n\t\t\t\tif(this._bottomDrawerDivider !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._bottomDrawerDivider.width = this._bottomDrawer.width;\n\t\t\t\t\tif(this._bottomDrawerDivider is IValidating)\n\t\t\t\t\t{\n\t\t\t\t\t\tIValidating(this._bottomDrawerDivider).validate();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar contentHeight:Number = this.actualHeight;\n\t\t\tif(isTopDrawerDocked)\n\t\t\t{\n\t\t\t\tcontentHeight -= topDrawerHeight;\n\t\t\t\tif(this._topDrawerDivider !== null)\n\t\t\t\t{\n\t\t\t\t\tcontentHeight -= this._topDrawerDivider.height;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isBottomDrawerDocked)\n\t\t\t{\n\t\t\t\tcontentHeight -= bottomDrawerHeight;\n\t\t\t\tif(this._bottomDrawerDivider !== null)\n\t\t\t\t{\n\t\t\t\t\tcontentHeight -= this._bottomDrawerDivider.height;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(contentHeight < 0)\n\t\t\t{\n\t\t\t\tcontentHeight = 0;\n\t\t\t}\n\n\t\t\tvar rightDrawerWidth:Number = 0;\n\t\t\tvar leftDrawerWidth:Number = 0;\n\t\t\tif(this._rightDrawer !== null)\n\t\t\t{\n\t\t\t\tif(isRightDrawerDocked)\n\t\t\t\t{\n\t\t\t\t\tthis._rightDrawer.height = contentHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._rightDrawer.height = this.actualHeight;\n\t\t\t\t}\n\t\t\t\tthis._rightDrawer.validate();\n\t\t\t\trightDrawerWidth = this._rightDrawer.width;\n\t\t\t\tif(this._rightDrawerDivider !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._rightDrawerDivider.height = this._rightDrawer.height;\n\t\t\t\t\tif(this._rightDrawerDivider is IValidating)\n\t\t\t\t\t{\n\t\t\t\t\t\tIValidating(this._rightDrawerDivider).validate();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._leftDrawer !== null)\n\t\t\t{\n\t\t\t\tif(isLeftDrawerDocked)\n\t\t\t\t{\n\t\t\t\t\tthis._leftDrawer.height = contentHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._leftDrawer.height = this.actualHeight;\n\t\t\t\t}\n\t\t\t\tthis._leftDrawer.validate();\n\t\t\t\tleftDrawerWidth = this._leftDrawer.width;\n\t\t\t\tif(this._leftDrawerDivider !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._leftDrawerDivider.height = this._leftDrawer.height;\n\t\t\t\t\tif(this._leftDrawerDivider is IValidating)\n\t\t\t\t\t{\n\t\t\t\t\t\tIValidating(this._leftDrawerDivider).validate();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar contentWidth:Number = this.actualWidth;\n\t\t\tif(isLeftDrawerDocked)\n\t\t\t{\n\t\t\t\tcontentWidth -= leftDrawerWidth;\n\t\t\t\tif(this._leftDrawerDivider !== null)\n\t\t\t\t{\n\t\t\t\t\tcontentWidth -= this._leftDrawerDivider.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isRightDrawerDocked)\n\t\t\t{\n\t\t\t\tcontentWidth -= rightDrawerWidth;\n\t\t\t\tif(this._rightDrawerDivider !== null)\n\t\t\t\t{\n\t\t\t\t\tcontentWidth -= this._rightDrawerDivider.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(contentWidth < 0)\n\t\t\t{\n\t\t\t\tcontentWidth = 0;\n\t\t\t}\n\n\t\t\tvar contentX:Number = 0;\n\t\t\tif(isRightDrawerOpen && this._openMode === RelativeDepth.BELOW)\n\t\t\t{\n\t\t\t\tcontentX = -rightDrawerWidth;\n\t\t\t\tif(isLeftDrawerDocked)\n\t\t\t\t{\n\t\t\t\t\tcontentX += leftDrawerWidth;\n\t\t\t\t\tif(this._leftDrawerDivider)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontentX += this._leftDrawerDivider.width;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if((isLeftDrawerOpen && this._openMode === RelativeDepth.BELOW) || isLeftDrawerDocked)\n\t\t\t{\n\t\t\t\tcontentX = leftDrawerWidth;\n\t\t\t\tif(this._leftDrawerDivider && isLeftDrawerDocked)\n\t\t\t\t{\n\t\t\t\t\tcontentX += this._leftDrawerDivider.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar contentY:Number = 0;\n\t\t\tif(isBottomDrawerOpen && this._openMode === RelativeDepth.BELOW)\n\t\t\t{\n\t\t\t\tcontentY = -bottomDrawerHeight;\n\t\t\t\tif(isTopDrawerDocked)\n\t\t\t\t{\n\t\t\t\t\tcontentY += topDrawerHeight;\n\t\t\t\t\tif(this._topDrawerDivider)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontentY += this._topDrawerDivider.height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if((isTopDrawerOpen && this._openMode === RelativeDepth.BELOW) || isTopDrawerDocked)\n\t\t\t{\n\t\t\t\tcontentY = topDrawerHeight;\n\t\t\t\tif(this._topDrawerDivider && isTopDrawerDocked)\n\t\t\t\t{\n\t\t\t\t\tcontentY += this._topDrawerDivider.height;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._content !== null)\n\t\t\t{\n\t\t\t\tthis._content.x = contentX;\n\t\t\t\tthis._content.y = contentY;\n\t\t\t\tif(this._autoSizeMode !== AutoSizeMode.CONTENT)\n\t\t\t\t{\n\t\t\t\t\tthis._content.width = contentWidth;\n\t\t\t\t\tthis._content.height = contentHeight;\n\n\t\t\t\t\t//final validation to avoid juggler next frame issues\n\t\t\t\t\tthis._content.validate();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(this._topDrawer !== null)\n\t\t\t{\n\t\t\t\tvar topDrawerX:Number = 0;\n\t\t\t\tvar topDrawerY:Number = 0;\n\t\t\t\tif(isTopDrawerDocked)\n\t\t\t\t{\n\t\t\t\t\tif(isBottomDrawerOpen && this._openMode === RelativeDepth.BELOW)\n\t\t\t\t\t{\n\t\t\t\t\t\ttopDrawerY -= bottomDrawerHeight;\n\t\t\t\t\t}\n\t\t\t\t\tif(!isLeftDrawerDocked)\n\t\t\t\t\t{\n\t\t\t\t\t\ttopDrawerX = contentX;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(this._openMode === RelativeDepth.ABOVE &&\n\t\t\t\t\t!this._isTopDrawerOpen)\n\t\t\t\t{\n\t\t\t\t\ttopDrawerY -= topDrawerHeight;\n\t\t\t\t}\n\t\t\t\tthis._topDrawer.x = topDrawerX;\n\t\t\t\tthis._topDrawer.y = topDrawerY;\n\t\t\t\tthis._topDrawer.visible = isTopDrawerOpen || isTopDrawerDocked || this._isDraggingTopDrawer;\n\t\t\t\tif(this._topDrawerDivider !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._topDrawerDivider.visible = isTopDrawerDocked;\n\t\t\t\t\tthis._topDrawerDivider.x = topDrawerX;\n\t\t\t\t\tthis._topDrawerDivider.y = topDrawerY + topDrawerHeight;\n\t\t\t\t}\n\n\t\t\t\t//final validation to avoid juggler next frame issues\n\t\t\t\tthis._topDrawer.validate();\n\t\t\t}\n\n\t\t\tif(this._rightDrawer !== null)\n\t\t\t{\n\t\t\t\tvar rightDrawerX:Number = this.actualWidth - rightDrawerWidth;\n\t\t\t\tvar rightDrawerY:Number = 0;\n\t\t\t\tif(isRightDrawerDocked)\n\t\t\t\t{\n\t\t\t\t\trightDrawerX = contentX + contentWidth;\n\t\t\t\t\tif(this._rightDrawerDivider)\n\t\t\t\t\t{\n\t\t\t\t\t\trightDrawerX += this._rightDrawerDivider.width;\n\t\t\t\t\t}\n\t\t\t\t\trightDrawerY = contentY;\n\t\t\t\t}\n\t\t\t\telse if(this._openMode === RelativeDepth.ABOVE &&\n\t\t\t\t\t!this._isRightDrawerOpen)\n\t\t\t\t{\n\t\t\t\t\trightDrawerX += rightDrawerWidth;\n\t\t\t\t}\n\t\t\t\tthis._rightDrawer.x = rightDrawerX;\n\t\t\t\tthis._rightDrawer.y = rightDrawerY;\n\t\t\t\tthis._rightDrawer.visible = isRightDrawerOpen || isRightDrawerDocked || this._isDraggingRightDrawer;\n\t\t\t\tif(this._rightDrawerDivider !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._rightDrawerDivider.visible = isRightDrawerDocked;\n\t\t\t\t\tthis._rightDrawerDivider.x = rightDrawerX - this._rightDrawerDivider.width;\n\t\t\t\t\tthis._rightDrawerDivider.y = rightDrawerY;\n\t\t\t\t}\n\n\t\t\t\t//final validation to avoid juggler next frame issues\n\t\t\t\tthis._rightDrawer.validate();\n\t\t\t}\n\n\t\t\tif(this._bottomDrawer !== null)\n\t\t\t{\n\t\t\t\tvar bottomDrawerX:Number = 0;\n\t\t\t\tvar bottomDrawerY:Number = this.actualHeight - bottomDrawerHeight;\n\t\t\t\tif(isBottomDrawerDocked)\n\t\t\t\t{\n\t\t\t\t\tif(!isLeftDrawerDocked)\n\t\t\t\t\t{\n\t\t\t\t\t\tbottomDrawerX = contentX;\n\t\t\t\t\t}\n\t\t\t\t\tbottomDrawerY = contentY + contentHeight;\n\t\t\t\t\tif(this._bottomDrawerDivider)\n\t\t\t\t\t{\n\t\t\t\t\t\tbottomDrawerY += this._bottomDrawerDivider.height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(this._openMode === RelativeDepth.ABOVE &&\n\t\t\t\t\t!this._isBottomDrawerOpen)\n\t\t\t\t{\n\t\t\t\t\tbottomDrawerY += bottomDrawerHeight;\n\t\t\t\t}\n\t\t\t\tthis._bottomDrawer.x = bottomDrawerX;\n\t\t\t\tthis._bottomDrawer.y = bottomDrawerY;\n\t\t\t\tthis._bottomDrawer.visible = isBottomDrawerOpen || isBottomDrawerDocked || this._isDraggingBottomDrawer;\n\t\t\t\tif(this._bottomDrawerDivider !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._bottomDrawerDivider.visible = isBottomDrawerDocked;\n\t\t\t\t\tthis._bottomDrawerDivider.x = bottomDrawerX;\n\t\t\t\t\tthis._bottomDrawerDivider.y = bottomDrawerY - this._bottomDrawerDivider.height;\n\t\t\t\t}\n\n\t\t\t\t//final validation to avoid juggler next frame issues\n\t\t\t\tthis._bottomDrawer.validate();\n\t\t\t}\n\n\t\t\tif(this._leftDrawer !== null)\n\t\t\t{\n\t\t\t\tvar leftDrawerX:Number = 0;\n\t\t\t\tvar leftDrawerY:Number = 0;\n\t\t\t\tif(isLeftDrawerDocked)\n\t\t\t\t{\n\t\t\t\t\tif(isRightDrawerOpen && this._openMode === RelativeDepth.BELOW)\n\t\t\t\t\t{\n\t\t\t\t\t\tleftDrawerX -= rightDrawerWidth;\n\t\t\t\t\t}\n\t\t\t\t\tleftDrawerY = contentY;\n\t\t\t\t}\n\t\t\t\telse if(this._openMode === RelativeDepth.ABOVE &&\n\t\t\t\t\t!this._isLeftDrawerOpen)\n\t\t\t\t{\n\t\t\t\t\tleftDrawerX -= leftDrawerWidth;\n\t\t\t\t}\n\t\t\t\tthis._leftDrawer.x = leftDrawerX;\n\t\t\t\tthis._leftDrawer.y = leftDrawerY;\n\t\t\t\tthis._leftDrawer.visible = isLeftDrawerOpen || isLeftDrawerDocked || this._isDraggingLeftDrawer;\n\t\t\t\tif(this._leftDrawerDivider !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._leftDrawerDivider.visible = isLeftDrawerDocked;\n\t\t\t\t\tthis._leftDrawerDivider.x = leftDrawerX + leftDrawerWidth;\n\t\t\t\t\tthis._leftDrawerDivider.y = leftDrawerY;\n\t\t\t\t}\n\n\t\t\t\t//final validation to avoid juggler next frame issues\n\t\t\t\tthis._leftDrawer.validate();\n\t\t\t}\n\n\t\t\tif(this._overlaySkin !== null)\n\t\t\t{\n\t\t\t\tthis.positionOverlaySkin();\n\t\t\t\tthis._overlaySkin.width = this.actualWidth;\n\t\t\t\tthis._overlaySkin.height = this.actualHeight;\n\n\t\t\t\t//final validation to avoid juggler next frame issues\n\t\t\t\tif(this._overlaySkin is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this._overlaySkin).validate();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function handlePendingActions():void\n\t\t{\n\t\t\tif(this.isToggleTopDrawerPending)\n\t\t\t{\n\t\t\t\tthis._isTopDrawerOpen = !this._isTopDrawerOpen;\n\t\t\t\tthis.isToggleTopDrawerPending = false;\n\t\t\t\tthis.openOrCloseTopDrawer();\n\t\t\t}\n\t\t\telse if(this.isToggleRightDrawerPending)\n\t\t\t{\n\t\t\t\tthis._isRightDrawerOpen = !this._isRightDrawerOpen;\n\t\t\t\tthis.isToggleRightDrawerPending = false;\n\t\t\t\tthis.openOrCloseRightDrawer();\n\t\t\t}\n\t\t\telse if(this.isToggleBottomDrawerPending)\n\t\t\t{\n\t\t\t\tthis._isBottomDrawerOpen = !this._isBottomDrawerOpen;\n\t\t\t\tthis.isToggleBottomDrawerPending = false;\n\t\t\t\tthis.openOrCloseBottomDrawer();\n\t\t\t}\n\t\t\telse if(this.isToggleLeftDrawerPending)\n\t\t\t{\n\t\t\t\tthis._isLeftDrawerOpen = !this._isLeftDrawerOpen;\n\t\t\t\tthis.isToggleLeftDrawerPending = false;\n\t\t\t\tthis.openOrCloseLeftDrawer();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function openOrCloseTopDrawer():void\n\t\t{\n\t\t\tif(!this._topDrawer || this.isTopDrawerDocked)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._openOrCloseTween)\n\t\t\t{\n\t\t\t\tthis._openOrCloseTween.advanceTime(this._openOrCloseTween.totalTime);\n\t\t\t\tStarling.juggler.remove(this._openOrCloseTween);\n\t\t\t\tthis._openOrCloseTween = null;\n\t\t\t}\n\t\t\tthis.prepareTopDrawer();\n\t\t\tif(this._overlaySkin)\n\t\t\t{\n\t\t\t\tthis._overlaySkin.visible = true;\n\t\t\t\tif(this._isTopDrawerOpen)\n\t\t\t\t{\n\t\t\t\t\tthis._overlaySkin.alpha = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._overlaySkin.alpha = this._overlaySkinOriginalAlpha;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar targetPosition:Number = this._isTopDrawerOpen ? this._topDrawer.height : 0;\n\t\t\tvar duration:Number = this.pendingToggleDuration;\n\t\t\tif(duration !== duration) //isNaN\n\t\t\t{\n\t\t\t\tduration = this._openOrCloseDuration;\n\t\t\t}\n\t\t\tthis.pendingToggleDuration = NaN;\n\t\t\tif(this._openMode === RelativeDepth.ABOVE)\n\t\t\t{\n\t\t\t\ttargetPosition = targetPosition == 0 ? -this._topDrawer.height : 0;\n\t\t\t\tthis._openOrCloseTween = new Tween(this._topDrawer, duration, this._openOrCloseEase);\n\t\t\t}\n\t\t\telse //below\n\t\t\t{\n\t\t\t\tthis._openOrCloseTween = new Tween(this._content, duration, this._openOrCloseEase);\n\t\t\t}\n\t\t\tthis._openOrCloseTween.animate(\"y\", targetPosition);\n\t\t\tthis._openOrCloseTween.onUpdate = topDrawerOpenOrCloseTween_onUpdate;\n\t\t\tthis._openOrCloseTween.onComplete = topDrawerOpenOrCloseTween_onComplete;\n\t\t\tStarling.juggler.add(this._openOrCloseTween);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function openOrCloseRightDrawer():void\n\t\t{\n\t\t\tif(!this._rightDrawer || this.isRightDrawerDocked)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._openOrCloseTween)\n\t\t\t{\n\t\t\t\tthis._openOrCloseTween.advanceTime(this._openOrCloseTween.totalTime);\n\t\t\t\tStarling.juggler.remove(this._openOrCloseTween);\n\t\t\t\tthis._openOrCloseTween = null;\n\t\t\t}\n\t\t\tthis.prepareRightDrawer();\n\t\t\tif(this._overlaySkin)\n\t\t\t{\n\t\t\t\tthis._overlaySkin.visible = true;\n\t\t\t\tif(this._isRightDrawerOpen)\n\t\t\t\t{\n\t\t\t\t\tthis._overlaySkin.alpha = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._overlaySkin.alpha = this._overlaySkinOriginalAlpha;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar targetPosition:Number = 0;\n\t\t\tif(this._isRightDrawerOpen)\n\t\t\t{\n\t\t\t\ttargetPosition = -this._rightDrawer.width;\n\t\t\t}\n\t\t\tif(this.isLeftDrawerDocked && this._openMode === RelativeDepth.BELOW)\n\t\t\t{\n\t\t\t\ttargetPosition += this._leftDrawer.width;\n\t\t\t\tif(this._leftDrawerDivider)\n\t\t\t\t{\n\t\t\t\t\ttargetPosition += this._leftDrawerDivider.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar duration:Number = this.pendingToggleDuration;\n\t\t\tif(duration !== duration) //isNaN\n\t\t\t{\n\t\t\t\tduration = this._openOrCloseDuration;\n\t\t\t}\n\t\t\tthis.pendingToggleDuration = NaN;\n\t\t\tif(this._openMode === RelativeDepth.ABOVE)\n\t\t\t{\n\t\t\t\tthis._openOrCloseTween = new Tween(this._rightDrawer, duration, this._openOrCloseEase);\n\t\t\t\ttargetPosition += this.actualWidth;\n\t\t\t}\n\t\t\telse //below\n\t\t\t{\n\t\t\t\tthis._openOrCloseTween = new Tween(this._content, duration, this._openOrCloseEase);\n\t\t\t}\n\t\t\tthis._openOrCloseTween.animate(\"x\", targetPosition);\n\t\t\tthis._openOrCloseTween.onUpdate = rightDrawerOpenOrCloseTween_onUpdate;\n\t\t\tthis._openOrCloseTween.onComplete = rightDrawerOpenOrCloseTween_onComplete;\n\t\t\tStarling.juggler.add(this._openOrCloseTween);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function openOrCloseBottomDrawer():void\n\t\t{\n\t\t\tif(!this._bottomDrawer || this.isBottomDrawerDocked)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._openOrCloseTween)\n\t\t\t{\n\t\t\t\tthis._openOrCloseTween.advanceTime(this._openOrCloseTween.totalTime);\n\t\t\t\tStarling.juggler.remove(this._openOrCloseTween);\n\t\t\t\tthis._openOrCloseTween = null;\n\t\t\t}\n\t\t\tthis.prepareBottomDrawer();\n\t\t\tif(this._overlaySkin)\n\t\t\t{\n\t\t\t\tthis._overlaySkin.visible = true;\n\t\t\t\tif(this._isBottomDrawerOpen)\n\t\t\t\t{\n\t\t\t\t\tthis._overlaySkin.alpha = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._overlaySkin.alpha = this._overlaySkinOriginalAlpha;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar targetPosition:Number = 0;\n\t\t\tif(this._isBottomDrawerOpen)\n\t\t\t{\n\t\t\t\ttargetPosition = -this._bottomDrawer.height;\n\t\t\t}\n\t\t\tif(this.isTopDrawerDocked && this._openMode === RelativeDepth.BELOW)\n\t\t\t{\n\t\t\t\ttargetPosition += this._topDrawer.height;\n\t\t\t\tif(this._topDrawerDivider)\n\t\t\t\t{\n\t\t\t\t\ttargetPosition += this._topDrawerDivider.height;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar duration:Number = this.pendingToggleDuration;\n\t\t\tif(duration !== duration) //isNaN\n\t\t\t{\n\t\t\t\tduration = this._openOrCloseDuration;\n\t\t\t}\n\t\t\tthis.pendingToggleDuration = NaN;\n\t\t\tif(this._openMode === RelativeDepth.ABOVE)\n\t\t\t{\n\t\t\t\ttargetPosition += this.actualHeight;\n\t\t\t\tthis._openOrCloseTween = new Tween(this._bottomDrawer, duration, this._openOrCloseEase);\n\t\t\t}\n\t\t\telse //below\n\t\t\t{\n\t\t\t\tthis._openOrCloseTween = new Tween(this._content, duration, this._openOrCloseEase);\n\t\t\t}\n\t\t\tthis._openOrCloseTween.animate(\"y\", targetPosition);\n\t\t\tthis._openOrCloseTween.onUpdate = bottomDrawerOpenOrCloseTween_onUpdate;\n\t\t\tthis._openOrCloseTween.onComplete = bottomDrawerOpenOrCloseTween_onComplete;\n\t\t\tStarling.juggler.add(this._openOrCloseTween);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function openOrCloseLeftDrawer():void\n\t\t{\n\t\t\tif(!this._leftDrawer || this.isLeftDrawerDocked)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._openOrCloseTween)\n\t\t\t{\n\t\t\t\tthis._openOrCloseTween.advanceTime(this._openOrCloseTween.totalTime);\n\t\t\t\tStarling.juggler.remove(this._openOrCloseTween);\n\t\t\t\tthis._openOrCloseTween = null;\n\t\t\t}\n\t\t\tthis.prepareLeftDrawer();\n\t\t\tif(this._overlaySkin)\n\t\t\t{\n\t\t\t\tthis._overlaySkin.visible = true;\n\t\t\t\tif(this._isLeftDrawerOpen)\n\t\t\t\t{\n\t\t\t\t\tthis._overlaySkin.alpha = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._overlaySkin.alpha = this._overlaySkinOriginalAlpha;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar targetPosition:Number = this._isLeftDrawerOpen ? this._leftDrawer.width : 0;\n\t\t\tvar duration:Number = this.pendingToggleDuration;\n\t\t\tif(duration !== duration) //isNaN\n\t\t\t{\n\t\t\t\tduration = this._openOrCloseDuration;\n\t\t\t}\n\t\t\tthis.pendingToggleDuration = NaN;\n\t\t\tif(this._openMode === RelativeDepth.ABOVE)\n\t\t\t{\n\t\t\t\ttargetPosition = targetPosition == 0 ? -this._leftDrawer.width : 0;\n\t\t\t\tthis._openOrCloseTween = new Tween(this._leftDrawer, duration, this._openOrCloseEase);\n\t\t\t}\n\t\t\telse //below\n\t\t\t{\n\t\t\t\tthis._openOrCloseTween = new Tween(this._content, duration, this._openOrCloseEase);\n\t\t\t}\n\t\t\tthis._openOrCloseTween.animate(\"x\", targetPosition);\n\t\t\tthis._openOrCloseTween.onUpdate = leftDrawerOpenOrCloseTween_onUpdate;\n\t\t\tthis._openOrCloseTween.onComplete = leftDrawerOpenOrCloseTween_onComplete;\n\t\t\tStarling.juggler.add(this._openOrCloseTween);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function prepareTopDrawer():void\n\t\t{\n\t\t\tthis._topDrawer.visible = true;\n\t\t\tif(this._openMode === RelativeDepth.ABOVE)\n\t\t\t{\n\t\t\t\tif(this._overlaySkin)\n\t\t\t\t{\n\t\t\t\t\tthis.setChildIndex(this._overlaySkin, this.numChildren - 1);\n\t\t\t\t}\n\t\t\t\tthis.setChildIndex(DisplayObject(this._topDrawer), this.numChildren - 1);\n\t\t\t}\n\t\t\tif(!this._clipDrawers || this._openMode !== RelativeDepth.BELOW)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._topDrawer.mask === null)\n\t\t\t{\n\t\t\t\tvar mask:Quad = new Quad(1, 1, 0xff00ff);\n\t\t\t\t//the initial dimensions cannot be 0 or there's a runtime error,\n\t\t\t\t//and these values might be 0\n\t\t\t\tmask.width = this.actualWidth;\n\t\t\t\tmask.height = this._content.y;\n\t\t\t\tthis._topDrawer.mask = mask;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function prepareRightDrawer():void\n\t\t{\n\t\t\tthis._rightDrawer.visible = true;\n\t\t\tif(this._openMode === RelativeDepth.ABOVE)\n\t\t\t{\n\t\t\t\tif(this._overlaySkin)\n\t\t\t\t{\n\t\t\t\t\tthis.setChildIndex(this._overlaySkin, this.numChildren - 1);\n\t\t\t\t}\n\t\t\t\tthis.setChildIndex(DisplayObject(this._rightDrawer), this.numChildren - 1);\n\t\t\t}\n\t\t\tif(!this._clipDrawers || this._openMode !== RelativeDepth.BELOW)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._rightDrawer.mask === null)\n\t\t\t{\n\t\t\t\tvar mask:Quad = new Quad(1, 1, 0xff00ff);\n\t\t\t\t//the initial dimensions cannot be 0 or there's a runtime error,\n\t\t\t\t//and these values might be 0\n\t\t\t\tif(this.isLeftDrawerDocked)\n\t\t\t\t{\n\t\t\t\t\tmask.width = -this._leftDrawer.x;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tmask.width = -this._content.x;\n\t\t\t\t}\n\t\t\t\tmask.height = this.actualHeight;\n\t\t\t\tthis._rightDrawer.mask = mask;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function prepareBottomDrawer():void\n\t\t{\n\t\t\tthis._bottomDrawer.visible = true;\n\t\t\tif(this._openMode === RelativeDepth.ABOVE)\n\t\t\t{\n\t\t\t\tif(this._overlaySkin)\n\t\t\t\t{\n\t\t\t\t\tthis.setChildIndex(this._overlaySkin, this.numChildren - 1);\n\t\t\t\t}\n\t\t\t\tthis.setChildIndex(DisplayObject(this._bottomDrawer), this.numChildren - 1);\n\t\t\t}\n\t\t\tif(!this._clipDrawers || this._openMode !== RelativeDepth.BELOW)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._bottomDrawer.mask === null)\n\t\t\t{\n\t\t\t\tvar mask:Quad = new Quad(1, 1, 0xff00ff);\n\t\t\t\t//the initial dimensions cannot be 0 or there's a runtime error,\n\t\t\t\t//and these values might be 0\n\t\t\t\tmask.width = this.actualWidth;\n\t\t\t\tif(this.isTopDrawerDocked)\n\t\t\t\t{\n\t\t\t\t\tmask.height = -this._topDrawer.y;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tmask.height = -this._content.y;\n\t\t\t\t}\n\t\t\t\tthis._bottomDrawer.mask = mask;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function prepareLeftDrawer():void\n\t\t{\n\t\t\tthis._leftDrawer.visible = true;\n\t\t\tif(this._openMode === RelativeDepth.ABOVE)\n\t\t\t{\n\t\t\t\tif(this._overlaySkin)\n\t\t\t\t{\n\t\t\t\t\tthis.setChildIndex(this._overlaySkin, this.numChildren - 1);\n\t\t\t\t}\n\t\t\t\tthis.setChildIndex(DisplayObject(this._leftDrawer), this.numChildren - 1);\n\t\t\t}\n\t\t\tif(!this._clipDrawers || this._openMode !== RelativeDepth.BELOW)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._leftDrawer.mask === null)\n\t\t\t{\n\t\t\t\tvar mask:Quad = new Quad(1, 1, 0xff00ff);\n\t\t\t\t//the initial dimensions cannot be 0 or there's a runtime error,\n\t\t\t\t//and these values might be 0\n\t\t\t\tmask.width = this._content.x;\n\t\t\t\tmask.height = this.actualHeight;\n\t\t\t\tthis._leftDrawer.mask = mask;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Uses the content event dispatcher fields and functions to generate a\n\t\t * content event dispatcher icon for the content.\n\t\t *\n\t\t * <p>All of the content event dispatcher fields and functions, ordered\n\t\t * by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>contentEventDispatcherFunction</code></li>\n\t\t *     <li><code>contentEventDispatcherField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * @see #content\n\t\t * @see #contentEventDispatcherField\n\t\t * @see #contentEventDispatcherFunction\n\t\t * @see #contentEventDispatcherChangeEventType\n\t\t */\n\t\tprotected function contentToContentEventDispatcher():EventDispatcher\n\t\t{\n\t\t\tif(this._contentEventDispatcherFunction !== null)\n\t\t\t{\n\t\t\t\treturn this._contentEventDispatcherFunction(this._content) as EventDispatcher;\n\t\t\t}\n\t\t\telse if(this._contentEventDispatcherField !== null && this._content && (this._contentEventDispatcherField in this._content))\n\t\t\t{\n\t\t\t\treturn this._content[this._contentEventDispatcherField] as EventDispatcher;\n\t\t\t}\n\t\t\treturn this._content as EventDispatcher;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshCurrentEventTarget():void\n\t\t{\n\t\t\tif(this.contentEventDispatcher)\n\t\t\t{\n\t\t\t\tif(this._topDrawerToggleEventType)\n\t\t\t\t{\n\t\t\t\t\tthis.contentEventDispatcher.removeEventListener(this._topDrawerToggleEventType, content_topDrawerToggleEventTypeHandler);\n\t\t\t\t}\n\t\t\t\tif(this._rightDrawerToggleEventType)\n\t\t\t\t{\n\t\t\t\t\tthis.contentEventDispatcher.removeEventListener(this._rightDrawerToggleEventType, content_rightDrawerToggleEventTypeHandler);\n\t\t\t\t}\n\t\t\t\tif(this._bottomDrawerToggleEventType)\n\t\t\t\t{\n\t\t\t\t\tthis.contentEventDispatcher.removeEventListener(this._bottomDrawerToggleEventType, content_bottomDrawerToggleEventTypeHandler);\n\t\t\t\t}\n\t\t\t\tif(this._leftDrawerToggleEventType)\n\t\t\t\t{\n\t\t\t\t\tthis.contentEventDispatcher.removeEventListener(this._leftDrawerToggleEventType, content_leftDrawerToggleEventTypeHandler);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.contentEventDispatcher = this.contentToContentEventDispatcher();\n\t\t\tif(this.contentEventDispatcher)\n\t\t\t{\n\t\t\t\tif(this._topDrawerToggleEventType)\n\t\t\t\t{\n\t\t\t\t\tthis.contentEventDispatcher.addEventListener(this._topDrawerToggleEventType, content_topDrawerToggleEventTypeHandler);\n\t\t\t\t}\n\t\t\t\tif(this._rightDrawerToggleEventType)\n\t\t\t\t{\n\t\t\t\t\tthis.contentEventDispatcher.addEventListener(this._rightDrawerToggleEventType, content_rightDrawerToggleEventTypeHandler);\n\t\t\t\t}\n\t\t\t\tif(this._bottomDrawerToggleEventType)\n\t\t\t\t{\n\t\t\t\t\tthis.contentEventDispatcher.addEventListener(this._bottomDrawerToggleEventType, content_bottomDrawerToggleEventTypeHandler);\n\t\t\t\t}\n\t\t\t\tif(this._leftDrawerToggleEventType)\n\t\t\t\t{\n\t\t\t\t\tthis.contentEventDispatcher.addEventListener(this._leftDrawerToggleEventType, content_leftDrawerToggleEventTypeHandler);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshDrawerStates():void\n\t\t{\n\t\t\tif(this.isTopDrawerDocked && this._isTopDrawerOpen)\n\t\t\t{\n\t\t\t\tthis._isTopDrawerOpen = false;\n\t\t\t}\n\t\t\tif(this.isRightDrawerDocked && this._isRightDrawerOpen)\n\t\t\t{\n\t\t\t\tthis._isRightDrawerOpen = false;\n\t\t\t}\n\t\t\tif(this.isBottomDrawerDocked && this._isBottomDrawerOpen)\n\t\t\t{\n\t\t\t\tthis._isBottomDrawerOpen = false;\n\t\t\t}\n\t\t\tif(this.isLeftDrawerDocked && this._isLeftDrawerOpen)\n\t\t\t{\n\t\t\t\tthis._isLeftDrawerOpen = false;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshOverlayState():void\n\t\t{\n\t\t\tif(!this._overlaySkin || this._isDragging)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar showOverlay:Boolean = (this._isTopDrawerOpen && !this.isTopDrawerDocked) ||\n\t\t\t\t(this._isRightDrawerOpen && !this.isRightDrawerDocked) ||\n\t\t\t\t(this._isBottomDrawerOpen && !this.isBottomDrawerDocked) ||\n\t\t\t\t(this._isLeftDrawerOpen && !this.isLeftDrawerDocked);\n\t\t\tif(showOverlay !== this._overlaySkin.visible)\n\t\t\t{\n\t\t\t\tthis._overlaySkin.visible = showOverlay;\n\t\t\t\tthis._overlaySkin.alpha = showOverlay ? this._overlaySkinOriginalAlpha : 0;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function handleTapToClose(touch:Touch):void\n\t\t{\n\t\t\ttouch.getLocation(this.stage, HELPER_POINT);\n\t\t\tif(this !== this.stage.hitTest(HELPER_POINT))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this.isTopDrawerOpen)\n\t\t\t{\n\t\t\t\tthis._isTopDrawerOpen = false;\n\t\t\t\tthis.openOrCloseTopDrawer();\n\t\t\t}\n\t\t\telse if(this.isRightDrawerOpen)\n\t\t\t{\n\t\t\t\tthis._isRightDrawerOpen = false;\n\t\t\t\tthis.openOrCloseRightDrawer();\n\t\t\t}\n\t\t\telse if(this.isBottomDrawerOpen)\n\t\t\t{\n\t\t\t\tthis._isBottomDrawerOpen = false;\n\t\t\t\tthis.openOrCloseBottomDrawer();\n\t\t\t}\n\t\t\telse if(this.isLeftDrawerOpen)\n\t\t\t{\n\t\t\t\tthis._isLeftDrawerOpen = false;\n\t\t\t\tthis.openOrCloseLeftDrawer();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function handleTouchBegan(touch:Touch):void\n\t\t{\n\t\t\tvar exclusiveTouch:ExclusiveTouch = ExclusiveTouch.forStage(this.stage);\n\t\t\tif(exclusiveTouch.getClaim(touch.id))\n\t\t\t{\n\t\t\t\t//already claimed\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\ttouch.getLocation(this, HELPER_POINT);\n\t\t\tvar localX:Number = HELPER_POINT.x;\n\t\t\tvar localY:Number = HELPER_POINT.y;\n\t\t\tif(!this.isTopDrawerOpen && !this.isRightDrawerOpen && !this.isBottomDrawerOpen && !this.isLeftDrawerOpen)\n\t\t\t{\n\t\t\t\tif(this._openGesture === DragGesture.NONE)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(this._openGesture === DragGesture.EDGE)\n\t\t\t\t{\n\t\t\t\t\tvar isNearAnyEdge:Boolean = false;\n\t\t\t\t\tif(this._topDrawer && !this.isTopDrawerDocked)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar topInches:Number = localY / (DeviceCapabilities.dpi / starling.contentScaleFactor);\n\t\t\t\t\t\tif(topInches >= 0 && topInches <= this._openGestureEdgeSize)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tisNearAnyEdge = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(!isNearAnyEdge)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._rightDrawer && !this.isRightDrawerDocked)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar rightInches:Number = (this.actualWidth - localX) / (DeviceCapabilities.dpi / starling.contentScaleFactor);\n\t\t\t\t\t\t\tif(rightInches >= 0 && rightInches <= this._openGestureEdgeSize)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tisNearAnyEdge = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!isNearAnyEdge)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(this._bottomDrawer && !this.isBottomDrawerDocked)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar bottomInches:Number = (this.actualHeight - localY) / (DeviceCapabilities.dpi / starling.contentScaleFactor);\n\t\t\t\t\t\t\t\tif(bottomInches >= 0 && bottomInches <= this._openGestureEdgeSize)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tisNearAnyEdge = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!isNearAnyEdge)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(this._leftDrawer && !this.isLeftDrawerDocked)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar leftInches:Number = localX / (DeviceCapabilities.dpi / starling.contentScaleFactor);\n\t\t\t\t\t\t\t\t\tif(leftInches >= 0 && leftInches <= this._openGestureEdgeSize)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tisNearAnyEdge = true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(!isNearAnyEdge)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(this._openMode === RelativeDepth.BELOW && touch.target !== this)\n\t\t\t{\n\t\t\t\t//when the drawer is opened below, it will only close when\n\t\t\t\t//something outside of the drawer is touched\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//when the drawer is opened above, anything may be touched\n\n\t\t\tthis.touchPointID = touch.id;\n\t\t\tthis._velocityX = 0;\n\t\t\tthis._velocityY = 0;\n\t\t\tthis._previousVelocityX.length = 0;\n\t\t\tthis._previousVelocityY.length = 0;\n\t\t\tthis._previousTouchTime = getTimer();\n\t\t\tthis._previousTouchX = this._startTouchX = this._currentTouchX = localX;\n\t\t\tthis._previousTouchY = this._startTouchY = this._currentTouchY = localY;\n\t\t\tthis._isDragging = false;\n\t\t\tthis._isDraggingTopDrawer = false;\n\t\t\tthis._isDraggingRightDrawer = false;\n\t\t\tthis._isDraggingBottomDrawer = false;\n\t\t\tthis._isDraggingLeftDrawer = false;\n\n\t\t\texclusiveTouch.addEventListener(Event.CHANGE, exclusiveTouch_changeHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function handleTouchMoved(touch:Touch):void\n\t\t{\n\t\t\ttouch.getLocation(this, HELPER_POINT);\n\t\t\tthis._currentTouchX = HELPER_POINT.x;\n\t\t\tthis._currentTouchY = HELPER_POINT.y;\n\t\t\tvar now:int = getTimer();\n\t\t\tvar timeOffset:int = now - this._previousTouchTime;\n\t\t\tif(timeOffset > 0)\n\t\t\t{\n\t\t\t\t//we're keeping previous velocity updates to improve accuracy\n\t\t\t\tthis._previousVelocityX[this._previousVelocityX.length] = this._velocityX;\n\t\t\t\tif(this._previousVelocityX.length > MAXIMUM_SAVED_VELOCITY_COUNT)\n\t\t\t\t{\n\t\t\t\t\tthis._previousVelocityX.shift();\n\t\t\t\t}\n\t\t\t\tthis._previousVelocityY[this._previousVelocityY.length] = this._velocityY;\n\t\t\t\tif(this._previousVelocityY.length > MAXIMUM_SAVED_VELOCITY_COUNT)\n\t\t\t\t{\n\t\t\t\t\tthis._previousVelocityY.shift();\n\t\t\t\t}\n\t\t\t\tthis._velocityX = (this._currentTouchX - this._previousTouchX) / timeOffset;\n\t\t\t\tthis._velocityY = (this._currentTouchY - this._previousTouchY) / timeOffset;\n\t\t\t\tthis._previousTouchTime = now;\n\t\t\t\tthis._previousTouchX = this._currentTouchX;\n\t\t\t\tthis._previousTouchY = this._currentTouchY;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function handleDragEnd():void\n\t\t{\n\t\t\t//take the average for more accuracy\n\t\t\tvar sum:Number = this._velocityX * CURRENT_VELOCITY_WEIGHT;\n\t\t\tvar velocityCount:int = this._previousVelocityX.length;\n\t\t\tvar totalWeight:Number = CURRENT_VELOCITY_WEIGHT;\n\t\t\tfor(var i:int = 0; i < velocityCount; i++)\n\t\t\t{\n\t\t\t\tvar weight:Number = VELOCITY_WEIGHTS[i];\n\t\t\t\tsum += this._previousVelocityX.shift() * weight;\n\t\t\t\ttotalWeight += weight;\n\t\t\t}\n\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar inchesPerSecondX:Number = 1000 * (sum / totalWeight) / (DeviceCapabilities.dpi / starling.contentScaleFactor);\n\n\t\t\tsum = this._velocityY * CURRENT_VELOCITY_WEIGHT;\n\t\t\tvelocityCount = this._previousVelocityY.length;\n\t\t\ttotalWeight = CURRENT_VELOCITY_WEIGHT;\n\t\t\tfor(i = 0; i < velocityCount; i++)\n\t\t\t{\n\t\t\t\tweight = VELOCITY_WEIGHTS[i];\n\t\t\t\tsum += this._previousVelocityY.shift() * weight;\n\t\t\t\ttotalWeight += weight;\n\t\t\t}\n\t\t\tvar inchesPerSecondY:Number = 1000 * (sum / totalWeight) / (DeviceCapabilities.dpi / starling.contentScaleFactor);\n\n\t\t\tthis._isDragging = false;\n\t\t\tif(this._isDraggingTopDrawer)\n\t\t\t{\n\t\t\t\tthis._isDraggingTopDrawer = false;\n\t\t\t\tif(!this._isTopDrawerOpen && inchesPerSecondY > this._minimumDrawerThrowVelocity)\n\t\t\t\t{\n\t\t\t\t\tthis._isTopDrawerOpen = true;\n\t\t\t\t}\n\t\t\t\telse if(this._isTopDrawerOpen && inchesPerSecondY < -this._minimumDrawerThrowVelocity)\n\t\t\t\t{\n\t\t\t\t\tthis._isTopDrawerOpen = false;\n\t\t\t\t}\n\t\t\t\telse if(this._openMode === RelativeDepth.ABOVE)\n\t\t\t\t{\n\t\t\t\t\tthis._isTopDrawerOpen = roundToNearest(this._topDrawer.y, this._topDrawer.height) == 0;\n\t\t\t\t}\n\t\t\t\telse //below\n\t\t\t\t{\n\t\t\t\t\tthis._isTopDrawerOpen = roundToNearest(this._content.y, this._topDrawer.height) != 0;\n\t\t\t\t}\n\t\t\t\tthis.openOrCloseTopDrawer();\n\t\t\t}\n\t\t\telse if(this._isDraggingRightDrawer)\n\t\t\t{\n\t\t\t\tthis._isDraggingRightDrawer = false;\n\t\t\t\tif(!this._isRightDrawerOpen && inchesPerSecondX < -this._minimumDrawerThrowVelocity)\n\t\t\t\t{\n\t\t\t\t\tthis._isRightDrawerOpen = true;\n\t\t\t\t}\n\t\t\t\telse if(this._isRightDrawerOpen && inchesPerSecondX > this._minimumDrawerThrowVelocity)\n\t\t\t\t{\n\t\t\t\t\tthis._isRightDrawerOpen = false;\n\t\t\t\t}\n\t\t\t\telse if(this._openMode === RelativeDepth.ABOVE)\n\t\t\t\t{\n\t\t\t\t\tthis._isRightDrawerOpen = roundToNearest(this.actualWidth - this._rightDrawer.x, this._rightDrawer.width) != 0;\n\t\t\t\t}\n\t\t\t\telse //bottom\n\t\t\t\t{\n\t\t\t\t\tvar positionToCheck:Number = this._content.x;\n\t\t\t\t\tif(this.isLeftDrawerDocked)\n\t\t\t\t\t{\n\t\t\t\t\t\tpositionToCheck -= this._leftDrawer.width;\n\t\t\t\t\t}\n\t\t\t\t\tthis._isRightDrawerOpen = roundToNearest(positionToCheck, this._rightDrawer.width) != 0;\n\t\t\t\t}\n\t\t\t\tthis.openOrCloseRightDrawer();\n\t\t\t}\n\t\t\telse if(this._isDraggingBottomDrawer)\n\t\t\t{\n\t\t\t\tthis._isDraggingBottomDrawer = false;\n\t\t\t\tif(!this._isBottomDrawerOpen && inchesPerSecondY < -this._minimumDrawerThrowVelocity)\n\t\t\t\t{\n\t\t\t\t\tthis._isBottomDrawerOpen = true;\n\t\t\t\t}\n\t\t\t\telse if(this._isBottomDrawerOpen && inchesPerSecondY > this._minimumDrawerThrowVelocity)\n\t\t\t\t{\n\t\t\t\t\tthis._isBottomDrawerOpen = false;\n\t\t\t\t}\n\t\t\t\telse if(this._openMode === RelativeDepth.ABOVE)\n\t\t\t\t{\n\t\t\t\t\tthis._isBottomDrawerOpen = roundToNearest(this.actualHeight - this._bottomDrawer.y, this._bottomDrawer.height) != 0;\n\t\t\t\t}\n\t\t\t\telse //below\n\t\t\t\t{\n\t\t\t\t\tpositionToCheck = this._content.y;\n\t\t\t\t\tif(this.isTopDrawerDocked)\n\t\t\t\t\t{\n\t\t\t\t\t\tpositionToCheck -= this._topDrawer.height;\n\t\t\t\t\t}\n\t\t\t\t\tthis._isBottomDrawerOpen = roundToNearest(positionToCheck, this._bottomDrawer.height) != 0;\n\t\t\t\t}\n\t\t\t\tthis.openOrCloseBottomDrawer();\n\t\t\t}\n\t\t\telse if(this._isDraggingLeftDrawer)\n\t\t\t{\n\t\t\t\tthis._isDraggingLeftDrawer = false;\n\t\t\t\tif(!this._isLeftDrawerOpen && inchesPerSecondX > this._minimumDrawerThrowVelocity)\n\t\t\t\t{\n\t\t\t\t\tthis._isLeftDrawerOpen = true;\n\t\t\t\t}\n\t\t\t\telse if(this._isLeftDrawerOpen && inchesPerSecondX < -this._minimumDrawerThrowVelocity)\n\t\t\t\t{\n\t\t\t\t\tthis._isLeftDrawerOpen = false;\n\t\t\t\t}\n\t\t\t\telse if(this._openMode === RelativeDepth.ABOVE)\n\t\t\t\t{\n\t\t\t\t\tthis._isLeftDrawerOpen = roundToNearest(this._leftDrawer.x, this._leftDrawer.width) == 0;\n\t\t\t\t}\n\t\t\t\telse //below\n\t\t\t\t{\n\t\t\t\t\tthis._isLeftDrawerOpen = roundToNearest(this._content.x, this._leftDrawer.width) != 0;\n\t\t\t\t}\n\t\t\t\tthis.openOrCloseLeftDrawer();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function handleDragMove():void\n\t\t{\n\t\t\tvar contentX:Number = 0;\n\t\t\tvar contentY:Number = 0;\n\t\t\tif(this.isLeftDrawerDocked)\n\t\t\t{\n\t\t\t\tcontentX = this._leftDrawer.width;\n\t\t\t\tif(this._leftDrawerDivider !== null)\n\t\t\t\t{\n\t\t\t\t\tcontentX += this._leftDrawerDivider.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this.isTopDrawerDocked)\n\t\t\t{\n\t\t\t\tcontentY = this._topDrawer.height;\n\t\t\t\tif(this._topDrawerDivider !== null)\n\t\t\t\t{\n\t\t\t\t\tcontentY += this._topDrawerDivider.height;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._isDraggingLeftDrawer)\n\t\t\t{\n\t\t\t\tvar leftDrawerWidth:Number = this._leftDrawer.width;\n\t\t\t\tif(this.isLeftDrawerOpen)\n\t\t\t\t{\n\t\t\t\t\tcontentX = leftDrawerWidth + this._currentTouchX - this._startTouchX;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcontentX = this._currentTouchX - this._startTouchX;\n\t\t\t\t}\n\t\t\t\tif(contentX < 0)\n\t\t\t\t{\n\t\t\t\t\tcontentX = 0;\n\t\t\t\t}\n\t\t\t\tif(contentX > leftDrawerWidth)\n\t\t\t\t{\n\t\t\t\t\tcontentX = leftDrawerWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(this._isDraggingRightDrawer)\n\t\t\t{\n\t\t\t\tvar rightDrawerWidth:Number = this._rightDrawer.width;\n\t\t\t\tif(this.isRightDrawerOpen)\n\t\t\t\t{\n\t\t\t\t\tcontentX = -rightDrawerWidth + this._currentTouchX - this._startTouchX;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcontentX = this._currentTouchX - this._startTouchX;\n\t\t\t\t}\n\t\t\t\tif(contentX < -rightDrawerWidth)\n\t\t\t\t{\n\t\t\t\t\tcontentX = -rightDrawerWidth;\n\t\t\t\t}\n\t\t\t\tif(contentX > 0)\n\t\t\t\t{\n\t\t\t\t\tcontentX = 0;\n\t\t\t\t}\n\t\t\t\tif(this.isLeftDrawerDocked && this._openMode === RelativeDepth.BELOW)\n\t\t\t\t{\n\t\t\t\t\tcontentX += this._leftDrawer.width;\n\t\t\t\t\tif(this._leftDrawerDivider !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontentX += this._leftDrawerDivider.width;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(this._isDraggingTopDrawer)\n\t\t\t{\n\t\t\t\tvar topDrawerHeight:Number = this._topDrawer.height;\n\t\t\t\tif(this.isTopDrawerOpen)\n\t\t\t\t{\n\t\t\t\t\tcontentY = topDrawerHeight + this._currentTouchY - this._startTouchY;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcontentY = this._currentTouchY - this._startTouchY;\n\t\t\t\t}\n\t\t\t\tif(contentY < 0)\n\t\t\t\t{\n\t\t\t\t\tcontentY = 0;\n\t\t\t\t}\n\t\t\t\tif(contentY > topDrawerHeight)\n\t\t\t\t{\n\t\t\t\t\tcontentY = topDrawerHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(this._isDraggingBottomDrawer)\n\t\t\t{\n\t\t\t\tvar bottomDrawerHeight:Number = this._bottomDrawer.height;\n\t\t\t\tif(this.isBottomDrawerOpen)\n\t\t\t\t{\n\t\t\t\t\tcontentY = -bottomDrawerHeight + this._currentTouchY - this._startTouchY;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcontentY = this._currentTouchY - this._startTouchY;\n\t\t\t\t}\n\t\t\t\tif(contentY < -bottomDrawerHeight)\n\t\t\t\t{\n\t\t\t\t\tcontentY = -bottomDrawerHeight;\n\t\t\t\t}\n\t\t\t\tif(contentY > 0)\n\t\t\t\t{\n\t\t\t\t\tcontentY = 0;\n\t\t\t\t}\n\t\t\t\tif(this.isTopDrawerDocked && this._openMode === RelativeDepth.BELOW)\n\t\t\t\t{\n\t\t\t\t\tcontentY += this._topDrawer.height;\n\t\t\t\t\tif(this._topDrawerDivider !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontentY += this._topDrawerDivider.height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._openMode === RelativeDepth.ABOVE)\n\t\t\t{\n\t\t\t\tif(this._isDraggingTopDrawer)\n\t\t\t\t{\n\t\t\t\t\tthis._topDrawer.y = contentY - this._topDrawer.height;\n\t\t\t\t}\n\t\t\t\telse if(this._isDraggingRightDrawer)\n\t\t\t\t{\n\t\t\t\t\tthis._rightDrawer.x = this.actualWidth + contentX;\n\t\t\t\t}\n\t\t\t\telse if(this._isDraggingBottomDrawer)\n\t\t\t\t{\n\t\t\t\t\tthis._bottomDrawer.y = this.actualHeight + contentY;\n\t\t\t\t}\n\t\t\t\telse if(this._isDraggingLeftDrawer)\n\t\t\t\t{\n\t\t\t\t\tthis._leftDrawer.x = contentX - this._leftDrawer.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //below\n\t\t\t{\n\t\t\t\tthis._content.x = contentX;\n\t\t\t\tthis._content.y = contentY;\n\t\t\t}\n\t\t\tif(this._isDraggingTopDrawer)\n\t\t\t{\n\t\t\t\tthis.topDrawerOpenOrCloseTween_onUpdate();\n\t\t\t}\n\t\t\telse if(this._isDraggingRightDrawer)\n\t\t\t{\n\t\t\t\tthis.rightDrawerOpenOrCloseTween_onUpdate();\n\t\t\t}\n\t\t\telse if(this._isDraggingBottomDrawer)\n\t\t\t{\n\t\t\t\tthis.bottomDrawerOpenOrCloseTween_onUpdate();\n\t\t\t}\n\t\t\telse if(this._isDraggingLeftDrawer)\n\t\t\t{\n\t\t\t\tthis.leftDrawerOpenOrCloseTween_onUpdate();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function checkForDragToClose():void\n\t\t{\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar horizontalInchesMoved:Number = (this._currentTouchX - this._startTouchX) / (DeviceCapabilities.dpi / starling.contentScaleFactor);\n\t\t\tvar verticalInchesMoved:Number = (this._currentTouchY - this._startTouchY) / (DeviceCapabilities.dpi / starling.contentScaleFactor);\n\t\t\tif(this.isLeftDrawerOpen && horizontalInchesMoved <= -this._minimumDragDistance)\n\t\t\t{\n\t\t\t\tthis._isDragging = true;\n\t\t\t\tthis._isDraggingLeftDrawer = true;\n\t\t\t\tthis.prepareLeftDrawer();\n\t\t\t}\n\t\t\telse if(this.isRightDrawerOpen && horizontalInchesMoved >= this._minimumDragDistance)\n\t\t\t{\n\t\t\t\tthis._isDragging = true;\n\t\t\t\tthis._isDraggingRightDrawer = true;\n\t\t\t\tthis.prepareRightDrawer();\n\t\t\t}\n\t\t\telse if(this.isTopDrawerOpen && verticalInchesMoved <= -this._minimumDragDistance)\n\t\t\t{\n\t\t\t\tthis._isDragging = true;\n\t\t\t\tthis._isDraggingTopDrawer = true;\n\t\t\t\tthis.prepareTopDrawer();\n\t\t\t}\n\t\t\telse if(this.isBottomDrawerOpen && verticalInchesMoved >= this._minimumDragDistance)\n\t\t\t{\n\t\t\t\tthis._isDragging = true;\n\t\t\t\tthis._isDraggingBottomDrawer = true;\n\t\t\t\tthis.prepareBottomDrawer();\n\t\t\t}\n\n\t\t\tif(this._isDragging)\n\t\t\t{\n\t\t\t\tif(this._overlaySkin)\n\t\t\t\t{\n\t\t\t\t\tthis._overlaySkin.visible = true;\n\t\t\t\t\tthis._overlaySkin.alpha = this._overlaySkinOriginalAlpha;\n\t\t\t\t}\n\t\t\t\tthis._startTouchX = this._currentTouchX;\n\t\t\t\tthis._startTouchY = this._currentTouchY;\n\t\t\t\tvar exclusiveTouch:ExclusiveTouch = ExclusiveTouch.forStage(this.stage);\n\t\t\t\texclusiveTouch.removeEventListener(Event.CHANGE, exclusiveTouch_changeHandler);\n\t\t\t\texclusiveTouch.claimTouch(this.touchPointID, this);\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.BEGIN_INTERACTION);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function checkForDragToOpen():void\n\t\t{\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar horizontalInchesMoved:Number = (this._currentTouchX - this._startTouchX) / (DeviceCapabilities.dpi / starling.contentScaleFactor);\n\t\t\tvar verticalInchesMoved:Number = (this._currentTouchY - this._startTouchY) / (DeviceCapabilities.dpi / starling.contentScaleFactor);\n\t\t\tif(this._leftDrawer && !this.isLeftDrawerDocked && horizontalInchesMoved >= this._minimumDragDistance)\n\t\t\t{\n\t\t\t\tthis._isDragging = true;\n\t\t\t\tthis._isDraggingLeftDrawer = true;\n\t\t\t\tthis.prepareLeftDrawer();\n\t\t\t}\n\t\t\telse if(this._rightDrawer && !this.isRightDrawerDocked && horizontalInchesMoved <= -this._minimumDragDistance)\n\t\t\t{\n\t\t\t\tthis._isDragging = true;\n\t\t\t\tthis._isDraggingRightDrawer = true;\n\t\t\t\tthis.prepareRightDrawer();\n\t\t\t}\n\t\t\telse if(this._topDrawer && !this.isTopDrawerDocked && verticalInchesMoved >= this._minimumDragDistance)\n\t\t\t{\n\t\t\t\tthis._isDragging = true;\n\t\t\t\tthis._isDraggingTopDrawer = true;\n\t\t\t\tthis.prepareTopDrawer();\n\t\t\t}\n\t\t\telse if(this._bottomDrawer && !this.isBottomDrawerDocked && verticalInchesMoved <= -this._minimumDragDistance)\n\t\t\t{\n\t\t\t\tthis._isDragging = true;\n\t\t\t\tthis._isDraggingBottomDrawer = true;\n\t\t\t\tthis.prepareBottomDrawer();\n\t\t\t}\n\n\t\t\tif(this._isDragging)\n\t\t\t{\n\t\t\t\tif(this._overlaySkin)\n\t\t\t\t{\n\t\t\t\t\tthis._overlaySkin.visible = true;\n\t\t\t\t\tthis._overlaySkin.alpha = 0;\n\t\t\t\t}\n\t\t\t\tthis._startTouchX = this._currentTouchX;\n\t\t\t\tthis._startTouchY = this._currentTouchY;\n\t\t\t\tvar exclusiveTouch:ExclusiveTouch = ExclusiveTouch.forStage(this.stage);\n\t\t\t\texclusiveTouch.claimTouch(this.touchPointID, this);\n\t\t\t\texclusiveTouch.removeEventListener(Event.CHANGE, exclusiveTouch_changeHandler);\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.BEGIN_INTERACTION);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function positionOverlaySkin():void\n\t\t{\n\t\t\tif(this._overlaySkin === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this.isLeftDrawerDocked)\n\t\t\t{\n\t\t\t\tthis._overlaySkin.x = this._leftDrawer.x;\n\t\t\t}\n\t\t\telse if(this._openMode === RelativeDepth.ABOVE && this._leftDrawer)\n\t\t\t{\n\t\t\t\tthis._overlaySkin.x = this._leftDrawer.x + this._leftDrawer.width;\n\t\t\t}\n\t\t\telse //below or no left drawer\n\t\t\t{\n\t\t\t\tif(this._content !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._overlaySkin.x = this._content.x;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._overlaySkin.x = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(this.isTopDrawerDocked)\n\t\t\t{\n\t\t\t\tthis._overlaySkin.y = this._topDrawer.y;\n\t\t\t}\n\t\t\telse if(this._openMode === RelativeDepth.ABOVE && this._topDrawer)\n\t\t\t{\n\t\t\t\tthis._overlaySkin.y = this._topDrawer.y + this._topDrawer.height;\n\t\t\t}\n\t\t\telse //below or now top drawer\n\t\t\t{\n\t\t\t\tif(this._content !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._overlaySkin.y = this._content.y;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._overlaySkin.y = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function topDrawerOpenOrCloseTween_onUpdate():void\n\t\t{\n\t\t\tif(this._overlaySkin)\n\t\t\t{\n\t\t\t\tif(this._openMode === RelativeDepth.ABOVE)\n\t\t\t\t{\n\t\t\t\t\tvar ratio:Number = 1 + this._topDrawer.y / this._topDrawer.height;\n\t\t\t\t}\n\t\t\t\telse //below\n\t\t\t\t{\n\t\t\t\t\tratio = this._content.y / this._topDrawer.height;\n\t\t\t\t}\n\t\t\t\tthis._overlaySkin.alpha = this._overlaySkinOriginalAlpha * ratio;\n\t\t\t}\n\t\t\tthis.openOrCloseTween_onUpdate();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function rightDrawerOpenOrCloseTween_onUpdate():void\n\t\t{\n\t\t\tif(this._overlaySkin)\n\t\t\t{\n\t\t\t\tif(this._openMode === RelativeDepth.ABOVE)\n\t\t\t\t{\n\t\t\t\t\tvar ratio:Number = -(this._rightDrawer.x - this.actualWidth) / this._rightDrawer.width;\n\t\t\t\t}\n\t\t\t\telse //below\n\t\t\t\t{\n\t\t\t\t\tratio = (this.actualWidth - this._content.x - this._content.width) / this._rightDrawer.width;\n\t\t\t\t}\n\t\t\t\tthis._overlaySkin.alpha = this._overlaySkinOriginalAlpha * ratio;\n\t\t\t}\n\t\t\tthis.openOrCloseTween_onUpdate();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function bottomDrawerOpenOrCloseTween_onUpdate():void\n\t\t{\n\t\t\tif(this._overlaySkin)\n\t\t\t{\n\t\t\t\tif(this._openMode === RelativeDepth.ABOVE)\n\t\t\t\t{\n\t\t\t\t\tvar ratio:Number = -(this._bottomDrawer.y - this.actualHeight) / this._bottomDrawer.height;\n\t\t\t\t}\n\t\t\t\telse //below\n\t\t\t\t{\n\t\t\t\t\tratio = (this.actualHeight - this._content.y - this._content.height) / this._bottomDrawer.height;\n\t\t\t\t}\n\t\t\t\tthis._overlaySkin.alpha = this._overlaySkinOriginalAlpha * ratio;\n\t\t\t}\n\t\t\tthis.openOrCloseTween_onUpdate();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function leftDrawerOpenOrCloseTween_onUpdate():void\n\t\t{\n\t\t\tif(this._overlaySkin)\n\t\t\t{\n\t\t\t\tif(this._openMode === RelativeDepth.ABOVE)\n\t\t\t\t{\n\t\t\t\t\tvar ratio:Number = 1 + this._leftDrawer.x / this._leftDrawer.width;\n\t\t\t\t}\n\t\t\t\telse //below\n\t\t\t\t{\n\t\t\t\t\tratio = this._content.x / this._leftDrawer.width;\n\t\t\t\t}\n\t\t\t\tthis._overlaySkin.alpha = this._overlaySkinOriginalAlpha * ratio;\n\t\t\t}\n\t\t\tthis.openOrCloseTween_onUpdate();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function openOrCloseTween_onUpdate():void\n\t\t{\n\t\t\tif(this._clipDrawers && this._openMode === RelativeDepth.BELOW)\n\t\t\t{\n\t\t\t\tvar isTopDrawerDocked:Boolean = this.isTopDrawerDocked;\n\t\t\t\tvar isRightDrawerDocked:Boolean = this.isRightDrawerDocked;\n\t\t\t\tvar isBottomDrawerDocked:Boolean = this.isBottomDrawerDocked;\n\t\t\t\tvar isLeftDrawerDocked:Boolean = this.isLeftDrawerDocked;\n\t\t\t\tvar contentX:Number = this._content.x;\n\t\t\t\tvar contentY:Number = this._content.y;\n\t\t\t\tif(isTopDrawerDocked)\n\t\t\t\t{\n\t\t\t\t\tif(isLeftDrawerDocked)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar leftDrawerDockedWidth:Number = this._leftDrawer.width;\n\t\t\t\t\t\tif(this._leftDrawerDivider !== null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tleftDrawerDockedWidth += this._leftDrawerDivider.width;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._topDrawer.x = contentX - leftDrawerDockedWidth;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._topDrawer.x = contentX;\n\t\t\t\t\t}\n\t\t\t\t\tif(this._topDrawerDivider !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._topDrawerDivider.x = this._topDrawer.x;\n\t\t\t\t\t\tthis._topDrawerDivider.y = contentY - this._topDrawerDivider.height;\n\t\t\t\t\t\tthis._topDrawer.y = this._topDrawerDivider.y - this._topDrawer.height;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._topDrawer.y = contentY - this._topDrawer.height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(isRightDrawerDocked)\n\t\t\t\t{\n\t\t\t\t\tif(this._rightDrawerDivider !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._rightDrawerDivider.x = contentX + this._content.width;\n\t\t\t\t\t\tthis._rightDrawer.x = this._rightDrawerDivider.x + this._rightDrawerDivider.width;\n\t\t\t\t\t\tthis._rightDrawerDivider.y = contentY;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._rightDrawer.x = contentX + this._content.width;\n\t\t\t\t\t}\n\t\t\t\t\tthis._rightDrawer.y = contentY;\n\t\t\t\t}\n\t\t\t\tif(isBottomDrawerDocked)\n\t\t\t\t{\n\t\t\t\t\tif(isLeftDrawerDocked)\n\t\t\t\t\t{\n\t\t\t\t\t\tleftDrawerDockedWidth = this._leftDrawer.width;\n\t\t\t\t\t\tif(this._leftDrawerDivider !== null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tleftDrawerDockedWidth += this._leftDrawerDivider.width;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._bottomDrawer.x = contentX - leftDrawerDockedWidth;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._bottomDrawer.x = contentX;\n\t\t\t\t\t}\n\t\t\t\t\tif(this._bottomDrawerDivider !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._bottomDrawerDivider.x = this._bottomDrawer.x;\n\t\t\t\t\t\tthis._bottomDrawerDivider.y = contentY + this._content.height;\n\t\t\t\t\t\tthis._bottomDrawer.y = this._bottomDrawerDivider.y + this._bottomDrawerDivider.height;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._bottomDrawer.y = contentY + this._content.height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(isLeftDrawerDocked)\n\t\t\t\t{\n\t\t\t\t\tif(this._leftDrawerDivider !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._leftDrawerDivider.x = contentX - this._leftDrawerDivider.width;\n\t\t\t\t\t\tthis._leftDrawer.x = this._leftDrawerDivider.x - this._leftDrawer.width;\n\t\t\t\t\t\tthis._leftDrawerDivider.y = contentY;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._leftDrawer.x = contentX - this._leftDrawer.width;\n\t\t\t\t\t}\n\t\t\t\t\tthis._leftDrawer.y = contentY;\n\t\t\t\t}\n\t\t\t\tif(this._topDrawer !== null)\n\t\t\t\t{\n\t\t\t\t\tvar mask:Quad = this._topDrawer.mask as Quad;\n\t\t\t\t\tif(mask !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tmask.height = contentY;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this._rightDrawer !== null)\n\t\t\t\t{\n\t\t\t\t\tmask = this._rightDrawer.mask as Quad;\n\t\t\t\t\tif(mask !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar rightClipWidth:Number = -contentX;\n\t\t\t\t\t\tif(isLeftDrawerDocked)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trightClipWidth = -this._leftDrawer.x;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmask.x = this._rightDrawer.width - rightClipWidth;\n\t\t\t\t\t\tmask.width = rightClipWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this._bottomDrawer !== null)\n\t\t\t\t{\n\t\t\t\t\tmask = this._bottomDrawer.mask as Quad;\n\t\t\t\t\tif(mask !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar bottomClipHeight:Number = -contentY;\n\t\t\t\t\t\tif(isTopDrawerDocked)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbottomClipHeight = -this._topDrawer.y;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmask.y = this._bottomDrawer.height - bottomClipHeight;\n\t\t\t\t\t\tmask.height = bottomClipHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this._leftDrawer !== null)\n\t\t\t\t{\n\t\t\t\t\tmask = this._leftDrawer.mask as Quad;\n\t\t\t\t\tif(mask !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tmask.width = contentX;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(this._overlaySkin !== null)\n\t\t\t{\n\t\t\t\tthis.positionOverlaySkin();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function topDrawerOpenOrCloseTween_onComplete():void\n\t\t{\n\t\t\tif(this._overlaySkin)\n\t\t\t{\n\t\t\t\tthis._overlaySkin.alpha = this._overlaySkinOriginalAlpha;\n\t\t\t}\n\t\t\tthis._openOrCloseTween = null;\n\t\t\tthis._topDrawer.mask = null;\n\t\t\tvar isTopDrawerOpen:Boolean = this.isTopDrawerOpen;\n\t\t\tvar isTopDrawerDocked:Boolean = this.isTopDrawerDocked;\n\t\t\tthis._topDrawer.visible = isTopDrawerOpen || isTopDrawerDocked;\n\t\t\tif(this._overlaySkin)\n\t\t\t{\n\t\t\t\tthis._overlaySkin.visible = isTopDrawerOpen;\n\t\t\t}\n\t\t\tif(isTopDrawerOpen)\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(Event.OPEN, false, this._topDrawer);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(Event.CLOSE, false, this._topDrawer);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function rightDrawerOpenOrCloseTween_onComplete():void\n\t\t{\n\t\t\tthis._openOrCloseTween = null;\n\t\t\tthis._rightDrawer.mask = null;\n\t\t\tvar isRightDrawerOpen:Boolean = this.isRightDrawerOpen;\n\t\t\tvar isRightDrawerDocked:Boolean = this.isRightDrawerDocked;\n\t\t\tthis._rightDrawer.visible = isRightDrawerOpen || isRightDrawerDocked;\n\t\t\tif(this._overlaySkin)\n\t\t\t{\n\t\t\t\tthis._overlaySkin.visible = isRightDrawerOpen;\n\t\t\t}\n\t\t\tif(isRightDrawerOpen)\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(Event.OPEN, false, this._rightDrawer);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(Event.CLOSE, false, this._rightDrawer);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function bottomDrawerOpenOrCloseTween_onComplete():void\n\t\t{\n\t\t\tthis._openOrCloseTween = null;\n\t\t\tthis._bottomDrawer.mask = null;\n\t\t\tvar isBottomDrawerOpen:Boolean = this.isBottomDrawerOpen;\n\t\t\tvar isBottomDrawerDocked:Boolean = this.isBottomDrawerDocked;\n\t\t\tthis._bottomDrawer.visible = isBottomDrawerOpen || isBottomDrawerDocked;\n\t\t\tif(this._overlaySkin)\n\t\t\t{\n\t\t\t\tthis._overlaySkin.visible = isBottomDrawerOpen;\n\t\t\t}\n\t\t\tif(isBottomDrawerOpen)\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(Event.OPEN, false, this._bottomDrawer);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(Event.CLOSE, false, this._bottomDrawer);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function leftDrawerOpenOrCloseTween_onComplete():void\n\t\t{\n\t\t\tthis._openOrCloseTween = null;\n\t\t\tthis._leftDrawer.mask = null;\n\t\t\tvar isLeftDrawerOpen:Boolean = this.isLeftDrawerOpen;\n\t\t\tvar isLeftDrawerDocked:Boolean = this.isLeftDrawerDocked;\n\t\t\tthis._leftDrawer.visible = isLeftDrawerOpen || isLeftDrawerDocked;\n\t\t\tif(this._overlaySkin)\n\t\t\t{\n\t\t\t\tthis._overlaySkin.visible = isLeftDrawerOpen;\n\t\t\t}\n\t\t\tif(isLeftDrawerOpen)\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(Event.OPEN, false, this._leftDrawer);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(Event.CLOSE, false, this._leftDrawer);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function content_eventDispatcherChangeHandler(event:Event):void\n\t\t{\n\t\t\tthis.refreshCurrentEventTarget();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function drawers_addedToStageHandler(event:Event):void\n\t\t{\n\t\t\tthis.stage.addEventListener(ResizeEvent.RESIZE, stage_resizeHandler);\n\t\t\t//using priority here is a hack so that objects higher up in the\n\t\t\t//display list have a chance to cancel the event first.\n\t\t\tvar priority:int = -getDisplayObjectDepthFromStage(this);\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tstarling.nativeStage.addEventListener(KeyboardEvent.KEY_DOWN, drawers_nativeStage_keyDownHandler, false, priority, true);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function drawers_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tif(this.touchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar exclusiveTouch:ExclusiveTouch = ExclusiveTouch.forStage(this.stage);\n\t\t\t\texclusiveTouch.removeEventListener(Event.CHANGE, exclusiveTouch_changeHandler);\n\t\t\t}\n\t\t\tthis.touchPointID = -1;\n\t\t\tthis._isDragging = false;\n\t\t\tthis._isDraggingTopDrawer = false;\n\t\t\tthis._isDraggingRightDrawer = false;\n\t\t\tthis._isDraggingBottomDrawer = false;\n\t\t\tthis._isDraggingLeftDrawer = false;\n\t\t\tthis.stage.removeEventListener(ResizeEvent.RESIZE, stage_resizeHandler);\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tstarling.nativeStage.removeEventListener(KeyboardEvent.KEY_DOWN, drawers_nativeStage_keyDownHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function drawers_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled || this._openOrCloseTween)\n\t\t\t{\n\t\t\t\tthis.touchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this.touchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(this, null, this.touchPointID);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(touch.phase == TouchPhase.MOVED)\n\t\t\t\t{\n\t\t\t\t\tthis.handleTouchMoved(touch);\n\n\t\t\t\t\tif(!this._isDragging)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this.isTopDrawerOpen || this.isRightDrawerOpen || this.isBottomDrawerOpen || this.isLeftDrawerOpen)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.checkForDragToClose();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.checkForDragToOpen();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(this._isDragging)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.handleDragMove();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(touch.phase == TouchPhase.ENDED)\n\t\t\t\t{\n\t\t\t\t\tthis.touchPointID = -1;\n\t\t\t\t\tif(this._isDragging)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.handleDragEnd();\n\t\t\t\t\t\tthis.dispatchEventWith(FeathersEventType.END_INTERACTION);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tExclusiveTouch.forStage(this.stage).removeEventListener(Event.CHANGE, exclusiveTouch_changeHandler);\n\t\t\t\t\t\tif(this.isTopDrawerOpen || this.isRightDrawerOpen || this.isBottomDrawerOpen || this.isLeftDrawerOpen)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//there is no drag, so we may have a tap\n\t\t\t\t\t\t\tthis.handleTapToClose(touch);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(this, TouchPhase.BEGAN);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.handleTouchBegan(touch);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function exclusiveTouch_changeHandler(event:Event, touchID:int):void\n\t\t{\n\t\t\tif(this.touchPointID < 0 || this.touchPointID != touchID || this._isDragging)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar exclusiveTouch:ExclusiveTouch = ExclusiveTouch.forStage(this.stage);\n\t\t\tif(exclusiveTouch.getClaim(touchID) == this)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.touchPointID = -1;\n\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_resizeHandler(event:ResizeEvent):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function drawers_nativeStage_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(event.isDefaultPrevented())\n\t\t\t{\n\t\t\t\t//someone else already handled this one\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(event.keyCode == Keyboard.BACK)\n\t\t\t{\n\t\t\t\tvar isAnyDrawerOpen:Boolean = false;\n\t\t\t\tif(this.isTopDrawerOpen)\n\t\t\t\t{\n\t\t\t\t\tthis.toggleTopDrawer();\n\t\t\t\t\tisAnyDrawerOpen = true;\n\t\t\t\t}\n\t\t\t\telse if(this.isRightDrawerOpen)\n\t\t\t\t{\n\t\t\t\t\tthis.toggleRightDrawer();\n\t\t\t\t\tisAnyDrawerOpen = true;\n\t\t\t\t}\n\t\t\t\telse if(this.isBottomDrawerOpen)\n\t\t\t\t{\n\t\t\t\t\tthis.toggleBottomDrawer();\n\t\t\t\t\tisAnyDrawerOpen = true;\n\t\t\t\t}\n\t\t\t\telse if(this.isLeftDrawerOpen)\n\t\t\t\t{\n\t\t\t\t\tthis.toggleLeftDrawer();\n\t\t\t\t\tisAnyDrawerOpen = true;\n\t\t\t\t}\n\t\t\t\tif(isAnyDrawerOpen)\n\t\t\t\t{\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function content_topDrawerToggleEventTypeHandler(event:Event):void\n\t\t{\n\t\t\tif(!this._topDrawer || this.isTopDrawerDocked)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isTopDrawerOpen = !this._isTopDrawerOpen;\n\t\t\tthis.openOrCloseTopDrawer();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function content_rightDrawerToggleEventTypeHandler(event:Event):void\n\t\t{\n\t\t\tif(!this._rightDrawer || this.isRightDrawerDocked)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isRightDrawerOpen = !this._isRightDrawerOpen;\n\t\t\tthis.openOrCloseRightDrawer();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function content_bottomDrawerToggleEventTypeHandler(event:Event):void\n\t\t{\n\t\t\tif(!this._bottomDrawer || this.isBottomDrawerDocked)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isBottomDrawerOpen = !this._isBottomDrawerOpen;\n\t\t\tthis.openOrCloseBottomDrawer();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function content_leftDrawerToggleEventTypeHandler(event:Event):void\n\t\t{\n\t\t\tif(!this._leftDrawer || this.isLeftDrawerDocked)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isLeftDrawerOpen = !this._isLeftDrawerOpen;\n\t\t\tthis.openOrCloseLeftDrawer();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function content_resizeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._isValidating || this._autoSizeMode != AutoSizeMode.CONTENT)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function drawer_resizeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._isValidating)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/GroupedList.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.controls.renderers.DefaultGroupedListHeaderOrFooterRenderer;\n\timport feathers.controls.renderers.DefaultGroupedListItemRenderer;\n\timport feathers.controls.renderers.IGroupedListFooterRenderer;\n\timport feathers.controls.renderers.IGroupedListHeaderRenderer;\n\timport feathers.controls.renderers.IGroupedListItemRenderer;\n\timport feathers.controls.supportClasses.GroupedListDataViewPort;\n\timport feathers.core.IFocusContainer;\n\timport feathers.core.PropertyProxy;\n\timport feathers.data.IHierarchicalCollection;\n\timport feathers.events.CollectionEventType;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.ILayout;\n\timport feathers.layout.IVariableVirtualLayout;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.system.DeviceCapabilities;\n\n\timport flash.events.KeyboardEvent;\n\timport flash.geom.Point;\n\timport flash.ui.Keyboard;\n\n\timport starling.events.Event;\n\timport starling.utils.Pool;\n\n\t/**\n\t * A style name to add to all item renderers in this list. Typically\n\t * used by a theme to provide different styles to different grouped\n\t * lists.\n\t *\n\t * <p>The following example sets the item renderer style name:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * list.customItemRendererStyleName = \"my-custom-item-renderer\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different skins than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( DefaultGroupedListItemRenderer ).setFunctionForStyleName( \"my-custom-item-renderer\", setCustomItemRendererStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #style:customFirstItemRendererStyleName\n\t * @see #style:customLastItemRendererStyleName\n\t * @see #style:customSingleItemRendererStyleName\n\t */\n\t[Style(name=\"customItemRendererStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to all item renderers in this grouped list that\n\t * are the first item in a group. Typically used by a theme to provide\n\t * different styles to different grouped lists, and to differentiate\n\t * first items from regular items if they are created with the same\n\t * class. If this value is <code>null</code>, the regular\n\t * <code>customItemRendererStyleName</code> will be used instead.\n\t *\n\t * <p>The following example provides a style name for the first item\n\t * renderer in each group:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * list.customFirstItemRendererStyleName = \"my-custom-first-item-renderer\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( DefaultGroupedListItemRenderer ).setFunctionForStyleName( \"my-custom-first-item-renderer\", setCustomFirstItemRendererStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #style:customItemRendererStyleName\n\t * @see #style:customLastItemRendererStyleName\n\t * @see #style:customSingleItemRendererStyleName\n\t */\n\t[Style(name=\"customFirstItemRendererStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to all item renderers in this grouped list that\n\t * are the last item in a group. Typically used by a theme to provide\n\t * different styles to different grouped lists, and to differentiate\n\t * last items from regular items if they are created with the same\n\t * class. If this value is <code>null</code> the regular\n\t * <code>customItemRendererStyleName</code> will be used instead.\n\t *\n\t * <p>The following example provides a style name for the last item\n\t * renderer in each group:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * list.customLastItemRendererStyleName = \"my-custom-last-item-renderer\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( DefaultGroupedListItemRenderer ).setFunctionForStyleName( \"my-custom-last-item-renderer\", setCustomLastItemRendererStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #style:customItemRendererStyleName\n\t * @see #style:customFirstItemRendererStyleName\n\t * @see #style:customSingleItemRendererStyleName\n\t */\n\t[Style(name=\"customLastItemRendererStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to all item renderers in this grouped list that\n\t * are a single item in a group with no other items. Typically used by a\n\t * theme to provide different styles to different grouped lists, and to\n\t * differentiate single items from regular items if they are created\n\t * with the same class. If this value is <code>null</code> the regular\n\t * <code>customItemRendererStyleName</code> will be used instead.\n\t *\n\t * <p>The following example provides a style name for a single item\n\t * renderer in each group:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * list.customSingleItemRendererStyleName = \"my-custom-single-item-renderer\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different skins than the default style:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( DefaultGroupedListItemRenderer ).setFunctionForStyleName( \"my-custom-single-item-renderer\", setCustomSingleItemRendererStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #style:customItemRendererStyleName\n\t * @see #style:customFirstItemRendererStyleName\n\t * @see #style:customLastItemRendererStyleName\n\t */\n\t[Style(name=\"customSingleItemRendererStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to all header renderers in this grouped list.\n\t * Typically used by a theme to provide different styles to different\n\t * grouped lists.\n\t *\n\t * <p>The following example sets the header renderer style name:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * list.customHeaderRendererStyleName = \"my-custom-header-renderer\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different skins than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( DefaultGroupedListHeaderOrFooterRenderer ).setFunctionForStyleName( \"my-custom-header-renderer\", setCustomHeaderRendererStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see feathers.core.FeathersControl#styleNameList\n\t */\n\t[Style(name=\"customHeaderRendererStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to all footer renderers in this grouped list.\n\t * Typically used by a theme to provide different styles to different\n\t * grouped lists.\n\t *\n\t * <p>The following example sets the footer renderer style name:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * list.customFooterRendererStyleName = \"my-custom-footer-renderer\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( DefaultGroupedListHeaderOrFooterRenderer ).setFunctionForStyleName( \"my-custom-footer-renderer\", setCustomFooterRendererStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see feathers.core.FeathersControl#styleNameList\n\t */\n\t[Style(name=\"customFooterRendererStyleName\",type=\"String\")]\n\n\t/**\n\t * The duration, in seconds, of the animation when the selected item is\n\t * changed by keyboard navigation and the item scrolls into view.\n\t *\n\t * <p>In the following example, the duration of the animation that\n\t * scrolls the list to a new selected item is set to 500 milliseconds:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * list.keyScrollDuration = 0.5;</listing>\n\t *\n\t * @default 0.25\n\t */\n\t[Style(name=\"keyScrollDuration\",type=\"Number\")]\n\n\t/**\n\t * The layout algorithm used to position and, optionally, size the\n\t * list's items.\n\t *\n\t * <p>By default, if no layout is provided by the time that the list\n\t * initializes, a vertical layout with options targeted at touch screens\n\t * is created.</p>\n\t *\n\t * <p>The following example tells the list to use a horizontal layout:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var layout:HorizontalLayout = new HorizontalLayout();\n\t * layout.gap = 20;\n\t * layout.padding = 20;\n\t * list.layout = layout;</listing>\n\t */\n\t[Style(name=\"layout\",type=\"feathers.layout.ILayout\")]\n\n\t/**\n\t * Dispatched when the selected item changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #selectedItem\n\t * @see #selectedGroupIndex\n\t * @see #selectedItemIndex\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the the user taps or clicks an item renderer in the list.\n\t * The touch must remain within the bounds of the item renderer on release,\n\t * and the list must not have scrolled, to register as a tap or a click.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The item associated with the item\n\t *   renderer that was triggered.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.TRIGGERED\n\t */\n\t[Event(name=\"triggered\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item renderer is added to the list. When the layout is\n\t * virtualized, item renderers may not exist for every item in the data\n\t * provider. This event can be used to track which items currently have\n\t * renderers.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The item renderer that was added</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.RENDERER_ADD\n\t */\n\t[Event(name=\"rendererAdd\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item renderer is removed from the list. When the layout is\n\t * virtualized, item renderers may not exist for every item in the data\n\t * provider. This event can be used to track which items currently have\n\t * renderers.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The item renderer that was removed</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.RENDERER_REMOVE\n\t */\n\t[Event(name=\"rendererRemove\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Displays a list of items divided into groups or sections. Takes a\n\t * hierarchical provider limited to two levels of hierarchy. This component\n\t * supports scrolling, custom item (and header and footer) renderers, and\n\t * custom layouts.\n\t *\n\t * <p>Layouts may be, and are highly encouraged to be, <em>virtual</em>,\n\t * meaning that the List is capable of creating a limited number of item\n\t * renderers to display a subset of the data provider instead of creating a\n\t * renderer for every single item. This allows for optimal performance with\n\t * very large data providers.</p>\n\t *\n\t * <p>The following example creates a grouped list, gives it a data\n\t * provider, tells the item renderer how to interpret the data, and listens\n\t * for when the selection changes:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var list:GroupedList = new GroupedList();\n\t * \n\t * list.dataProvider = new ArrayHierarchicalCollection(\n\t * [\n\t *     {\n\t *         header: \"Dairy\",\n\t *         children:\n\t *         [\n\t *             { text: \"Milk\", thumbnail: textureAtlas.getTexture( \"milk\" ) },\n\t *             { text: \"Cheese\", thumbnail: textureAtlas.getTexture( \"cheese\" ) },\n\t *         ]\n\t *     },\n\t *     {\n\t *         header: \"Bakery\",\n\t *         children:\n\t *         [\n\t *             { text: \"Bread\", thumbnail: textureAtlas.getTexture( \"bread\" ) },\n\t *         ]\n\t *     },\n\t *     {\n\t *         header: \"Produce\",\n\t *         children:\n\t *         [\n\t *             { text: \"Bananas\", thumbnail: textureAtlas.getTexture( \"bananas\" ) },\n\t *             { text: \"Lettuce\", thumbnail: textureAtlas.getTexture( \"lettuce\" ) },\n\t *             { text: \"Onion\", thumbnail: textureAtlas.getTexture( \"onion\" ) },\n\t *         ]\n\t *     },\n\t * ]);\n\t * \n\t * list.itemRendererFactory = function():IGroupedListItemRenderer\n\t * {\n\t *     var renderer:DefaultGroupedListItemRenderer = new DefaultGroupedListItemRenderer();\n\t *     renderer.labelField = \"text\";\n\t *     renderer.iconSourceField = \"thumbnail\";\n\t *     return renderer;\n\t * };\n\t * \n\t * list.addEventListener( Event.CHANGE, list_changeHandler );\n\t * \n\t * this.addChild( list );</listing>\n\t *\n\t * @see ../../../help/grouped-list.html How to use the Feathers GroupedList component\n\t * @see ../../../help/default-item-renderers.html How to use the Feathers default item renderer\n\t * @see ../../../help/item-renderers.html Creating custom item renderers for the Feathers List and GroupedList components\n\t * @see feathers.controls.List\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class GroupedList extends Scroller implements IFocusContainer\n\t{\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>GroupedList</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * An alternate style name to use with <code>GroupedList</code> to allow\n\t\t * a theme to give it an inset style. If a theme does not provide a\n\t\t * style for an inset grouped list, the theme will automatically fall\n\t\t * back to using the default grouped list style.\n\t\t *\n\t\t * <p>An alternate style name should always be added to a component's\n\t\t * <code>styleNameList</code> before the component is initialized. If\n\t\t * the style name is added later, it will be ignored.</p>\n\t\t *\n\t\t * <p>In the following example, the inset style is applied to a grouped\n\t\t * list:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var list:GroupedList = new GroupedList();\n\t\t * list.styleNameList.add( GroupedList.ALTERNATE_STYLE_NAME_INSET_GROUPED_LIST );\n\t\t * this.addChild( list );</listing>\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const ALTERNATE_STYLE_NAME_INSET_GROUPED_LIST:String = \"feathers-inset-grouped-list\";\n\n\t\t/**\n\t\t * The default name to use with header renderers.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_HEADER_RENDERER:String = \"feathers-grouped-list-header-renderer\";\n\n\t\t/**\n\t\t * An alternate name to use with header renderers to give them an inset\n\t\t * style. This name is usually only referenced inside themes.\n\t\t *\n\t\t * <p>In the following example, the inset style is applied to a grouped\n\t\t * list's header:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.customHeaderRendererStyleName = GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_HEADER_RENDERER;</listing>\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const ALTERNATE_CHILD_STYLE_NAME_INSET_HEADER_RENDERER:String = \"feathers-grouped-list-inset-header-renderer\";\n\n\t\t/**\n\t\t * The default name to use with footer renderers.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_FOOTER_RENDERER:String = \"feathers-grouped-list-footer-renderer\";\n\n\t\t/**\n\t\t * An alternate name to use with footer renderers to give them an inset\n\t\t * style. This name is usually only referenced inside themes.\n\t\t *\n\t\t * <p>In the following example, the inset style is applied to a grouped\n\t\t * list's footer:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.customFooterRendererStyleName = GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_FOOTER_RENDERER;</listing>\n\t\t */\n\t\tpublic static const ALTERNATE_CHILD_STYLE_NAME_INSET_FOOTER_RENDERER:String = \"feathers-grouped-list-inset-footer-renderer\";\n\n\t\t/**\n\t\t * An alternate name to use with item renderers to give them an inset\n\t\t * style. This name is usually only referenced inside themes.\n\t\t *\n\t\t * <p>In the following example, the inset style is applied to a grouped\n\t\t * list's item renderer:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.customItemRendererStyleName = GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_ITEM_RENDERER;</listing>\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const ALTERNATE_CHILD_STYLE_NAME_INSET_ITEM_RENDERER:String = \"feathers-grouped-list-inset-item-renderer\";\n\n\t\t/**\n\t\t * An alternate name to use for item renderers to give them an inset\n\t\t * style. Typically meant to be used for the renderer of the first item\n\t\t * in a group. This name is usually only referenced inside themes.\n\t\t *\n\t\t * <p>In the following example, the inset style is applied to a grouped\n\t\t * list's first item renderer:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.customFirstItemRendererStyleName = GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_FIRST_ITEM_RENDERER;</listing>\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const ALTERNATE_CHILD_STYLE_NAME_INSET_FIRST_ITEM_RENDERER:String = \"feathers-grouped-list-inset-first-item-renderer\";\n\n\t\t/**\n\t\t * An alternate name to use for item renderers to give them an inset\n\t\t * style. Typically meant to be used for the renderer of the last item\n\t\t * in a group. This name is usually only referenced inside themes.\n\t\t *\n\t\t * <p>In the following example, the inset style is applied to a grouped\n\t\t * list's last item renderer:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.customLastItemRendererStyleName = GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_LAST_ITEM_RENDERER;</listing>\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const ALTERNATE_CHILD_STYLE_NAME_INSET_LAST_ITEM_RENDERER:String = \"feathers-grouped-list-inset-last-item-renderer\";\n\n\t\t/**\n\t\t * An alternate name to use for item renderers to give them an inset\n\t\t * style. Typically meant to be used for the renderer of an item in a\n\t\t * group that has no other items. This name is usually only referenced\n\t\t * inside themes.\n\t\t *\n\t\t * <p>In the following example, the inset style is applied to a grouped\n\t\t * list's single item renderer:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.customSingleItemRendererStyleName = GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_SINGLE_ITEM_RENDERER;</listing>\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const ALTERNATE_CHILD_STYLE_NAME_INSET_SINGLE_ITEM_RENDERER:String = \"feathers-grouped-list-inset-single-item-renderer\";\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function GroupedList()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * The guts of the List's functionality. Handles layout and selection.\n\t\t */\n\t\tprotected var dataViewPort:GroupedListDataViewPort;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn GroupedList.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function get isFocusEnabled():Boolean\n\t\t{\n\t\t\treturn (this._isSelectable || this._minHorizontalScrollPosition != this._maxHorizontalScrollPosition ||\n\t\t\t\tthis._minVerticalScrollPosition != this._maxVerticalScrollPosition) &&\n\t\t\t\tthis._isEnabled && this._isFocusEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isChildFocusEnabled:Boolean = true;\n\n\t\t/**\n\t\t * @copy feathers.core.IFocusContainer#isChildFocusEnabled\n\t\t *\n\t\t * @default true\n\t\t *\n\t\t * @see #isFocusEnabled\n\t\t */\n\t\tpublic function get isChildFocusEnabled():Boolean\n\t\t{\n\t\t\treturn this._isEnabled && this._isChildFocusEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isChildFocusEnabled(value:Boolean):void\n\t\t{\n\t\t\tthis._isChildFocusEnabled = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _layout:ILayout;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get layout():ILayout\n\t\t{\n\t\t\treturn this._layout;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set layout(value:ILayout):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._layout == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._layout)\n\t\t\t{\n\t\t\t\tthis._layout.removeEventListener(Event.SCROLL, layout_scrollHandler);\n\t\t\t}\n\t\t\tthis._layout = value;\n\t\t\tif(this._layout is IVariableVirtualLayout)\n\t\t\t{\n\t\t\t\tthis._layout.addEventListener(Event.SCROLL, layout_scrollHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _dataProvider:IHierarchicalCollection;\n\n\t\t/**\n\t\t * The collection of data displayed by the list. Changing this property\n\t\t * to a new value is considered a drastic change to the list's data, so\n\t\t * the horizontal and vertical scroll positions will be reset, and the\n\t\t * list's selection will be cleared.\n\t\t *\n\t\t * <p>The following example passes in a data provider and tells the item\n\t\t * renderer how to interpret the data:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.dataProvider = new ArrayHierarchicalCollection(\n\t\t * [\n\t\t *     {\n\t\t *     \t   header: \"Dairy\",\n\t\t *     \t   children:\n\t\t *     \t   [\n\t\t *     \t       { text: \"Milk\", thumbnail: textureAtlas.getTexture( \"milk\" ) },\n\t\t *     \t       { text: \"Cheese\", thumbnail: textureAtlas.getTexture( \"cheese\" ) },\n\t\t *     \t   ]\n\t\t *     },\n\t\t *     {\n\t\t *         header: \"Bakery\",\n\t\t *         children:\n\t\t *         [\n\t\t *             { text: \"Bread\", thumbnail: textureAtlas.getTexture( \"bread\" ) },\n\t\t *         ]\n\t\t *     },\n\t\t *     {\n\t\t *         header: \"Produce\",\n\t\t *         children:\n\t\t *         [\n\t\t *             { text: \"Bananas\", thumbnail: textureAtlas.getTexture( \"bananas\" ) },\n\t\t *             { text: \"Lettuce\", thumbnail: textureAtlas.getTexture( \"lettuce\" ) },\n\t\t *             { text: \"Onion\", thumbnail: textureAtlas.getTexture( \"onion\" ) },\n\t\t *         ]\n\t\t *     },\n\t\t * ]);\n\t\t * \n\t\t * list.itemRendererFactory = function():IGroupedListItemRenderer\n\t\t * {\n\t\t *     var renderer:DefaultGroupedListItemRenderer = new DefaultGroupedListItemRenderer();\n\t\t *     renderer.labelField = \"text\";\n\t\t *     renderer.iconSourceField = \"thumbnail\";\n\t\t *     return renderer;\n\t\t * };</listing>\n\t\t *\n\t\t * <p><em>Warning:</em> A grouped list's data provider cannot contain\n\t\t * duplicate items. To display the same item in multiple item renderers,\n\t\t * you must create separate objects with the same properties. This\n\t\t * restriction exists because it significantly improves performance.</p>\n\t\t *\n\t\t * <p><em>Warning:</em> If the data provider contains display objects,\n\t\t * concrete textures, or anything that needs to be disposed, those\n\t\t * objects will not be automatically disposed when the grouped list is\n\t\t * disposed. Similar to how <code>starling.display.Image</code> cannot\n\t\t * automatically dispose its texture because the texture may be used\n\t\t * by other display objects, a list cannot dispose its data provider\n\t\t * because the data provider may be used by other lists. See the\n\t\t * <code>dispose()</code> function on <code>IHierarchicalCollection</code>\n\t\t * to see how the data provider can be disposed properly.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.data.ArrayHierarchicalCollection\n\t\t * @see feathers.data.VectorHierarchicalCollection\n\t\t * @see feathers.data.XMLListHierarchicalCollection\n\t\t */\n\t\tpublic function get dataProvider():IHierarchicalCollection\n\t\t{\n\t\t\treturn this._dataProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set dataProvider(value:IHierarchicalCollection):void\n\t\t{\n\t\t\tif(this._dataProvider == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._dataProvider)\n\t\t\t{\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.ADD_ITEM, dataProvider_addItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.REMOVE_ITEM, dataProvider_removeItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.REMOVE_ALL, dataProvider_removeAllHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.REPLACE_ITEM, dataProvider_replaceItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.RESET, dataProvider_resetHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(Event.CHANGE, dataProvider_changeHandler);\n\t\t\t}\n\t\t\tthis._dataProvider = value;\n\t\t\tif(this._dataProvider)\n\t\t\t{\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.ADD_ITEM, dataProvider_addItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.REMOVE_ITEM, dataProvider_removeItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.REMOVE_ALL, dataProvider_removeAllHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.REPLACE_ITEM, dataProvider_replaceItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.RESET, dataProvider_resetHandler);\n\t\t\t\tthis._dataProvider.addEventListener(Event.CHANGE, dataProvider_changeHandler);\n\t\t\t}\n\n\t\t\t//reset the scroll position because this is a drastic change and\n\t\t\t//the data is probably completely different\n\t\t\tthis.horizontalScrollPosition = 0;\n\t\t\tthis.verticalScrollPosition = 0;\n\n\t\t\t//clear the selection for the same reason\n\t\t\tthis.setSelectedLocation(-1, -1);\n\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isSelectable:Boolean = true;\n\n\t\t/**\n\t\t * Determines if an item in the list may be selected.\n\t\t *\n\t\t * <p>The following example disables selection:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.isSelectable = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t *\n\t\t * @see #selectedItem\n\t\t * @see #selectedGroupIndex\n\t\t * @see #selectedItemIndex\n\t\t */\n\t\tpublic function get isSelectable():Boolean\n\t\t{\n\t\t\treturn this._isSelectable;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isSelectable(value:Boolean):void\n\t\t{\n\t\t\tif(this._isSelectable == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isSelectable = value;\n\t\t\tif(!this._isSelectable)\n\t\t\t{\n\t\t\t\tthis.setSelectedLocation(-1, -1);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _helperLocation:Vector.<int> = new <int>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectedGroupIndex:int = -1;\n\n\t\t/**\n\t\t * The group index of the currently selected item. Returns <code>-1</code>\n\t\t * if no item is selected.\n\t\t *\n\t\t * <p>Because the selection consists of both a group index and an item\n\t\t * index, this property does not have a setter. To change the selection,\n\t\t * call <code>setSelectedLocation()</code> instead.</p>\n\t\t *\n\t\t * <p>The following example listens for when selection changes and\n\t\t * requests the selected group index and selected item index:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * function list_changeHandler( event:Event ):void\n\t\t * {\n\t\t *     var list:List = GroupedList(event.currentTarget);\n\t\t *     var groupIndex:int = list.selectedGroupIndex;\n\t\t *     var itemIndex:int = list.selectedItemIndex;\n\t\t * \n\t\t * }\n\t\t * list.addEventListener( Event.CHANGE, list_changeHandler );</listing>\n\t\t *\n\t\t * @default -1\n\t\t *\n\t\t * @see #selectedItemIndex\n\t\t * @see #setSelectedLocation()\n\t\t */\n\t\tpublic function get selectedGroupIndex():int\n\t\t{\n\t\t\treturn this._selectedGroupIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectedItemIndex:int = -1;\n\n\t\t/**\n\t\t * The item index of the currently selected item. Returns <code>-1</code>\n\t\t * if no item is selected.\n\t\t *\n\t\t * <p>Because the selection consists of both a group index and an item\n\t\t * index, this property does not have a setter. To change the selection,\n\t\t * call <code>setSelectedLocation()</code> instead.</p>\n\t\t *\n\t\t * <p>The following example listens for when selection changes and\n\t\t * requests the selected group index and selected item index:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * function list_changeHandler( event:Event ):void\n\t\t * {\n\t\t *     var list:GroupedList = GroupedList( event.currentTarget );\n\t\t *     var groupIndex:int = list.selectedGroupIndex;\n\t\t *     var itemIndex:int = list.selectedItemIndex;\n\t\t * \n\t\t * }\n\t\t * list.addEventListener( Event.CHANGE, list_changeHandler );</listing>\n\t\t *\n\t\t * @default -1\n\t\t *\n\t\t * @see #selectedGroupIndex\n\t\t * @see #setSelectedLocation()\n\t\t */\n\t\tpublic function get selectedItemIndex():int\n\t\t{\n\t\t\treturn this._selectedItemIndex;\n\t\t}\n\n\t\t/**\n\t\t * The currently selected item. Returns <code>null</code> if no item is\n\t\t * selected.\n\t\t *\n\t\t * <p>The following example listens for when selection changes and\n\t\t * requests the selected item:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * function list_changeHandler( event:Event ):void\n\t\t * {\n\t\t *     var list:GroupedList = GroupedList( event.currentTarget );\n\t\t *     var item:Object = list.selectedItem;\n\t\t * \n\t\t * }\n\t\t * list.addEventListener( Event.CHANGE, list_changeHandler );</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get selectedItem():Object\n\t\t{\n\t\t\tif(!this._dataProvider || this._selectedGroupIndex < 0 || this._selectedItemIndex < 0)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tthis._helperLocation.length = 2;\n\t\t\tthis._helperLocation[0] = this._selectedGroupIndex;\n\t\t\tthis._helperLocation[1] = this._selectedItemIndex;\n\t\t\tvar result:Object = this._dataProvider.getItemAt(this._selectedGroupIndex, this._selectedItemIndex);\n\t\t\tthis._helperLocation.length = 0;\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedItem(value:Object):void\n\t\t{\n\t\t\tif(!this._dataProvider)\n\t\t\t{\n\t\t\t\tthis.setSelectedLocation(-1, -1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar result:Vector.<int> = this._dataProvider.getItemLocation(value);\n\t\t\tif(result.length == 2)\n\t\t\t{\n\t\t\t\tthis.setSelectedLocation(result[0], result[1]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.setSelectedLocation(-1, -1);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _itemRendererType:Class = DefaultGroupedListItemRenderer;\n\n\t\t/**\n\t\t * The class used to instantiate item renderers. Must implement the\n\t\t * <code>IGroupedListItemRenderer</code> interface.\n\t\t *\n\t\t * <p>To customize properties on the item renderer, use\n\t\t * <code>itemRendererFactory</code> instead.</p>\n\t\t *\n\t\t * <p>The following example changes the item renderer type:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.itemRendererType = CustomItemRendererClass;</listing>\n\t\t *\n\t\t * <p>The first item and last item in a group may optionally use\n\t\t * different item renderer types, if desired. Use the\n\t\t * <code>firstItemRendererType</code> and <code>lastItemRendererType</code>,\n\t\t * respectively. Additionally, if a group contains only one item, it may\n\t\t * also have a different type. Use the <code>singleItemRendererType</code>.\n\t\t * Finally, factories for each of these types may also be customized.</p>\n\t\t *\n\t\t * @default feathers.controls.renderers.DefaultGroupedListItemRenderer\n\t\t *\n\t\t * @see feathers.controls.renderers.IGroupedListItemRenderer\n\t\t * @see #itemRendererFactory\n\t\t * @see #firstItemRendererType\n\t\t * @see #lastItemRendererType\n\t\t * @see #singleItemRendererType\n\t\t */\n\t\tpublic function get itemRendererType():Class\n\t\t{\n\t\t\treturn this._itemRendererType;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set itemRendererType(value:Class):void\n\t\t{\n\t\t\tif(this._itemRendererType == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._itemRendererType = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _itemRendererFactories:Object;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _itemRendererFactory:Function;\n\n\t\t/**\n\t\t * A function called that is expected to return a new item renderer. Has\n\t\t * a higher priority than <code>itemRendererType</code>. Typically, you\n\t\t * would use an <code>itemRendererFactory</code> instead of an\n\t\t * <code>itemRendererType</code> if you wanted to initialize some\n\t\t * properties on each separate item renderer, such as skins.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t *\n\t\t * <pre>function():IGroupedListItemRenderer</pre>\n\t\t *\n\t\t * <p>The following example provides a factory for the item renderer:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.itemRendererFactory = function():IGroupedListItemRenderer\n\t\t * {\n\t\t *     var renderer:CustomItemRendererClass = new CustomItemRendererClass();\n\t\t *     renderer.backgroundSkin = new Quad( 10, 10, 0xff0000 );\n\t\t *     return renderer;\n\t\t * };</listing>\n\t\t *\n\t\t * <p>The first item and last item in a group may optionally use\n\t\t * different item renderer factories, if desired. Use the\n\t\t * <code>firstItemRendererFactory</code> and <code>lastItemRendererFactory</code>,\n\t\t * respectively. Additionally, if a group contains only one item, it may\n\t\t * also have a different factory. Use the <code>singleItemRendererFactory</code>.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.renderers.IGroupedListItemRenderer\n\t\t * @see #itemRendererType\n\t\t * @see #setItemRendererFactoryWithID()\n\t\t */\n\t\tpublic function get itemRendererFactory():Function\n\t\t{\n\t\t\treturn this._itemRendererFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set itemRendererFactory(value:Function):void\n\t\t{\n\t\t\tif(this._itemRendererFactory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._itemRendererFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _factoryIDFunction:Function;\n\n\t\t/**\n\t\t * When a list requires multiple item renderer types, this function is\n\t\t * used to determine which type of item renderer is required for a\n\t\t * specific item (or index). Returns the ID of the item renderer type\n\t\t * to use for the item, or <code>null</code> if the default\n\t\t * <code>itemRendererFactory</code> should be used.\n\t\t *\n\t\t * <p>The function is expected to have one of the following\n\t\t * signatures:</p>\n\t\t *\n\t\t * <pre>function(item:Object):String</pre>\n\t\t *\n\t\t * <pre>function(item:Object, groupIndex:int, itemIndex:int):String</pre>\n\t\t *\n\t\t * <p>The following example provides a <code>factoryIDFunction</code>:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * function regularItemFactory():IGroupedListItemRenderer\n\t\t * {\n\t\t *     return new DefaultGroupedListItemRenderer();\n\t\t * }\n\t\t * function firstItemFactory():IGroupedListItemRenderer\n\t\t * {\n\t\t *     return new CustomItemRenderer();\n\t\t * }\n\t\t * list.setItemRendererFactoryWithID( \"regular-item\", regularItemFactory );\n\t\t * list.setItemRendererFactoryWithID( \"first-item\", firstItemFactory );\n\t\t * \n\t\t * list.factoryIDFunction = function( item:Object, groupIndex:int, itemIndex:int ):String\n\t\t * {\n\t\t *     if(index == 0)\n\t\t *     {\n\t\t *         return \"first-item\";\n\t\t *     }\n\t\t *     return \"regular-item\";\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #setItemRendererFactoryWithID()\n\t\t * @see #itemRendererFactory\n\t\t */\n\t\tpublic function get factoryIDFunction():Function\n\t\t{\n\t\t\treturn this._factoryIDFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set factoryIDFunction(value:Function):void\n\t\t{\n\t\t\tif(this._factoryIDFunction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._factoryIDFunction = value;\n\t\t\tif(value !== null && this._itemRendererFactories === null)\n\t\t\t{\n\t\t\t\tthis._itemRendererFactories = {};\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _typicalItem:Object = null;\n\n\t\t/**\n\t\t * Used to auto-size the list when a virtualized layout is used. If the\n\t\t * list's width or height is unknown, the list will try to automatically\n\t\t * pick an ideal size. This item is used to create a sample item\n\t\t * renderer to measure item renderers that are virtual and not visible\n\t\t * in the viewport.\n\t\t *\n\t\t * <p>The following example provides a typical item:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.typicalItem = { text: \"A typical item\", thumbnail: texture };</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get typicalItem():Object\n\t\t{\n\t\t\treturn this._typicalItem;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set typicalItem(value:Object):void\n\t\t{\n\t\t\tif(this._typicalItem == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._typicalItem = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customItemRendererStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customItemRendererStyleName():String\n\t\t{\n\t\t\treturn this._customItemRendererStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customItemRendererStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customItemRendererStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customItemRendererStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _itemRendererProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for all of the list's item\n\t\t * renderers, and the properties will be passed down to every item\n\t\t * renderer when the list validates. The available properties\n\t\t * depend on which <code>IGroupedListItemRenderer</code> implementation\n\t\t * is returned by <code>itemRendererFactory</code>.\n\t\t *\n\t\t * <p>By default, the <code>itemRendererFactory</code> will return a\n\t\t * <code>DefaultGroupedListItemRenderer</code> instance. If you aren't\n\t\t * using a custom item renderer, you can refer to\n\t\t * <a href=\"renderers/DefaultGroupedListItemRenderer.html\"><code>feathers.controls.renderers.DefaultGroupedListItemRenderer</code></a>\n\t\t * for a list of available properties.</p>\n\t\t *\n\t\t * <p>These properties are shared by every item renderer, so anything\n\t\t * that cannot be shared (such as display objects, which cannot be added\n\t\t * to multiple parents) should be passed to item renderers using the\n\t\t * <code>itemRendererFactory</code> or in the theme.</p>\n\t\t *\n\t\t * <p>The following example customizes some item renderer properties\n\t\t * (this example assumes that the item renderer's label text renderer\n\t\t * is a <code>BitmapFontTextRenderer</code>):</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.itemRendererProperties.labelField = \"text\";\n\t\t * list.itemRendererProperties.accessoryField = \"control\";</listing>\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>itemRendererFactory</code> function instead\n\t\t * of using <code>itemRendererProperties</code> will result in better\n\t\t * performance.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #itemRendererFactory\n\t\t * @see feathers.controls.renderers.IGroupedListItemRenderer\n\t\t * @see feathers.controls.renderers.DefaultGroupedListItemRenderer\n\t\t */\n\t\tpublic function get itemRendererProperties():Object\n\t\t{\n\t\t\tif(!this._itemRendererProperties)\n\t\t\t{\n\t\t\t\tthis._itemRendererProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._itemRendererProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set itemRendererProperties(value:Object):void\n\t\t{\n\t\t\tif(this._itemRendererProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._itemRendererProperties)\n\t\t\t{\n\t\t\t\tthis._itemRendererProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._itemRendererProperties = PropertyProxy(value);\n\t\t\tif(this._itemRendererProperties)\n\t\t\t{\n\t\t\t\tthis._itemRendererProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _firstItemRendererType:Class;\n\n\t\t/**\n\t\t * The class used to instantiate the item renderer for the first item in\n\t\t * a group. Must implement the <code>IGroupedListItemRenderer</code>\n\t\t * interface.\n\t\t *\n\t\t * <p>The following example changes the first item renderer type:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.firstItemRendererType = CustomItemRendererClass;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.renderer.IGroupedListItemRenderer\n\t\t * @see #itemRendererType\n\t\t * @see #lastItemRendererType\n\t\t * @see #singleItemRendererType\n\t\t */\n\t\tpublic function get firstItemRendererType():Class\n\t\t{\n\t\t\treturn this._firstItemRendererType;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set firstItemRendererType(value:Class):void\n\t\t{\n\t\t\tif(this._firstItemRendererType == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._firstItemRendererType = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _firstItemRendererFactory:Function;\n\n\t\t/**\n\t\t * A function called that is expected to return a new item renderer for\n\t\t * the first item in a group. Has a higher priority than\n\t\t * <code>firstItemRendererType</code>. Typically, you would use an\n\t\t * <code>firstItemRendererFactory</code> instead of an\n\t\t * <code>firstItemRendererType</code> if you wanted to initialize some\n\t\t * properties on each separate item renderer, such as skins.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t *\n\t\t * <pre>function():IGroupedListItemRenderer</pre>\n\t\t *\n\t\t * <p>The following example provides a factory for the item renderer\n\t\t * used for the first item in a group:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.firstItemRendererFactory = function():IGroupedListItemRenderer\n\t\t * {\n\t\t *     var renderer:CustomItemRendererClass = new CustomItemRendererClass();\n\t\t *     renderer.backgroundSkin = new Quad( 10, 10, 0xff0000 );\n\t\t *     return renderer;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.renderers.IGroupedListItemRenderer\n\t\t * @see #firstItemRendererType\n\t\t * @see #itemRendererFactory\n\t\t * @see #lastItemRendererFactory\n\t\t * @see #singleItemRendererFactory\n\t\t */\n\t\tpublic function get firstItemRendererFactory():Function\n\t\t{\n\t\t\treturn this._firstItemRendererFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set firstItemRendererFactory(value:Function):void\n\t\t{\n\t\t\tif(this._firstItemRendererFactory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._firstItemRendererFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customFirstItemRendererStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customFirstItemRendererStyleName():String\n\t\t{\n\t\t\treturn this._customFirstItemRendererStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customFirstItemRendererStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customFirstItemRendererStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customFirstItemRendererStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastItemRendererType:Class;\n\n\t\t/**\n\t\t * The class used to instantiate the item renderer for the last item in\n\t\t * a group. Must implement the <code>IGroupedListItemRenderer</code>\n\t\t * interface.\n\t\t *\n\t\t * <p>The following example changes the last item renderer type:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.lastItemRendererType = CustomItemRendererClass;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.renderer.IGroupedListItemRenderer\n\t\t * @see #lastItemRendererFactory\n\t\t * @see #itemRendererType\n\t\t * @see #firstItemRendererType\n\t\t * @see #singleItemRendererType\n\t\t */\n\t\tpublic function get lastItemRendererType():Class\n\t\t{\n\t\t\treturn this._lastItemRendererType;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set lastItemRendererType(value:Class):void\n\t\t{\n\t\t\tif(this._lastItemRendererType == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._lastItemRendererType = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastItemRendererFactory:Function;\n\n\t\t/**\n\t\t * A function called that is expected to return a new item renderer for\n\t\t * the last item in a group. Has a higher priority than\n\t\t * <code>lastItemRendererType</code>. Typically, you would use an\n\t\t * <code>lastItemRendererFactory</code> instead of an\n\t\t * <code>lastItemRendererType</code> if you wanted to initialize some\n\t\t * properties on each separate item renderer, such as skins.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t *\n\t\t * <pre>function():IGroupedListItemRenderer</pre>\n\t\t *\n\t\t * <p>The following example provides a factory for the item renderer\n\t\t * used for the last item in a group:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.firstItemRendererFactory = function():IGroupedListItemRenderer\n\t\t * {\n\t\t *     var renderer:CustomItemRendererClass = new CustomItemRendererClass();\n\t\t *     renderer.backgroundSkin = new Quad( 10, 10, 0xff0000 );\n\t\t *     return renderer;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.renderers.IGroupedListItemRenderer\n\t\t * @see #lastItemRendererType\n\t\t * @see #itemRendererFactory\n\t\t * @see #firstItemRendererFactory\n\t\t * @see #singleItemRendererFactory\n\t\t */\n\t\tpublic function get lastItemRendererFactory():Function\n\t\t{\n\t\t\treturn this._lastItemRendererFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set lastItemRendererFactory(value:Function):void\n\t\t{\n\t\t\tif(this._lastItemRendererFactory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._lastItemRendererFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customLastItemRendererStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customLastItemRendererStyleName():String\n\t\t{\n\t\t\treturn this._customLastItemRendererStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customLastItemRendererStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customLastItemRendererStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customLastItemRendererStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _singleItemRendererType:Class;\n\n\t\t/**\n\t\t * The class used to instantiate the item renderer for an item in a\n\t\t * group with no other items. Must implement the\n\t\t * <code>IGroupedListItemRenderer</code> interface.\n\t\t *\n\t\t * <p>The following example changes the single item renderer type:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.singleItemRendererType = CustomItemRendererClass;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.renderer.IGroupedListItemRenderer\n\t\t * @see #singleItemRendererFactory\n\t\t * @see #itemRendererType\n\t\t * @see #firstItemRendererType\n\t\t * @see #lastItemRendererType\n\t\t */\n\t\tpublic function get singleItemRendererType():Class\n\t\t{\n\t\t\treturn this._singleItemRendererType;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set singleItemRendererType(value:Class):void\n\t\t{\n\t\t\tif(this._singleItemRendererType == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._singleItemRendererType = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _singleItemRendererFactory:Function;\n\n\t\t/**\n\t\t * A function called that is expected to return a new item renderer for\n\t\t * an item in a group with no other items. Has a higher priority than\n\t\t * <code>singleItemRendererType</code>. Typically, you would use an\n\t\t * <code>singleItemRendererFactory</code> instead of an\n\t\t * <code>singleItemRendererType</code> if you wanted to initialize some\n\t\t * properties on each separate item renderer, such as skins.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t *\n\t\t * <pre>function():IGroupedListItemRenderer</pre>\n\t\t *\n\t\t * <p>The following example provides a factory for the item renderer\n\t\t * used for when only one item appears in a group:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.firstItemRendererFactory = function():IGroupedListItemRenderer\n\t\t * {\n\t\t *     var renderer:CustomItemRendererClass = new CustomItemRendererClass();\n\t\t *     renderer.backgroundSkin = new Quad( 10, 10, 0xff0000 );\n\t\t *     return renderer;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.renderers.IGroupedListItemRenderer\n\t\t * @see #singleItemRendererType\n\t\t * @see #itemRendererFactory\n\t\t * @see #firstItemRendererFactory\n\t\t * @see #lastItemRendererFactory\n\t\t */\n\t\tpublic function get singleItemRendererFactory():Function\n\t\t{\n\t\t\treturn this._singleItemRendererFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set singleItemRendererFactory(value:Function):void\n\t\t{\n\t\t\tif(this._singleItemRendererFactory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._singleItemRendererFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customSingleItemRendererStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customSingleItemRendererStyleName():String\n\t\t{\n\t\t\treturn this._customSingleItemRendererStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customSingleItemRendererStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customSingleItemRendererStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customSingleItemRendererStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _headerRendererType:Class = DefaultGroupedListHeaderOrFooterRenderer;\n\n\t\t/**\n\t\t * The class used to instantiate header renderers. Must implement the\n\t\t * <code>IGroupedListHeaderOrFooterRenderer</code> interface.\n\t\t *\n\t\t * <p>The following example changes the header renderer type:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.headerRendererType = CustomHeaderRendererClass;</listing>\n\t\t *\n\t\t * @default feathers.controls.renderers.DefaultGroupedListHeaderOrFooterRenderer\n\t\t *\n\t\t * @see feathers.controls.renderers.IGroupedListHeaderOrFooterRenderer\n\t\t * @see #headerRendererFactory\n\t\t */\n\t\tpublic function get headerRendererType():Class\n\t\t{\n\t\t\treturn this._headerRendererType;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set headerRendererType(value:Class):void\n\t\t{\n\t\t\tif(this._headerRendererType == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._headerRendererType = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _headerRendererFactories:Object;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _headerRendererFactory:Function;\n\n\t\t/**\n\t\t * A function called that is expected to return a new header renderer.\n\t\t * Has a higher priority than <code>headerRendererType</code>.\n\t\t * Typically, you would use an <code>headerRendererFactory</code>\n\t\t * instead of a <code>headerRendererType</code> if you wanted to\n\t\t * initialize some properties on each separate header renderer, such as\n\t\t * skins.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t *\n\t\t * <pre>function():IGroupedListHeaderOrFooterRenderer</pre>\n\t\t *\n\t\t * <p>The following example provides a factory for the header renderer:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.itemRendererFactory = function():IGroupedListHeaderOrFooterRenderer\n\t\t * {\n\t\t *     var renderer:CustomHeaderRendererClass = new CustomHeaderRendererClass();\n\t\t *     renderer.backgroundSkin = new Quad( 10, 10, 0xff0000 );\n\t\t *     return renderer;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.renderers.IGroupedListHeaderOrFooterRenderer\n\t\t * @see #headerRendererType\n\t\t * @see #setHeaderRendererFactoryWithID()\n\t\t */\n\t\tpublic function get headerRendererFactory():Function\n\t\t{\n\t\t\treturn this._headerRendererFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set headerRendererFactory(value:Function):void\n\t\t{\n\t\t\tif(this._headerRendererFactory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._headerRendererFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _headerFactoryIDFunction:Function;\n\n\t\t/**\n\t\t * When a list requires multiple header renderer types, this function is\n\t\t * used to determine which type of header renderer is required for a\n\t\t * specific header (or group index). Returns the ID of the factory\n\t\t * to use for the header, or <code>null</code> if the default\n\t\t * <code>headerRendererFactory</code> should be used.\n\t\t *\n\t\t * <p>The function is expected to have one of the following\n\t\t * signatures:</p>\n\t\t *\n\t\t * <pre>function(header:Object):String</pre>\n\t\t *\n\t\t * <pre>function(header:Object, groupIndex:int):String</pre>\n\t\t *\n\t\t * <p>The following example provides a <code>headerFactoryIDFunction</code>:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * function regularHeaderFactory():IGroupedListHeaderRenderer\n\t\t * {\n\t\t *     return new DefaultGroupedListHeaderOrFooterRenderer();\n\t\t * }\n\t\t * function customHeaderFactory():IGroupedListHeaderRenderer\n\t\t * {\n\t\t *     return new CustomHeaderRenderer();\n\t\t * }\n\t\t * list.setHeaderRendererFactoryWithID( \"regular-header\", regularHeaderFactory );\n\t\t * list.setHeaderRendererFactoryWithID( \"custom-header\", customHeaderFactory );\n\t\t * \n\t\t * list.headerFactoryIDFunction = function( header:Object, groupIndex:int ):String\n\t\t * {\n\t\t *     //check if the subTitle property exists in the header data\n\t\t *     if( \"subTitle\" in header )\n\t\t *     {\n\t\t *         return \"custom-header\";\n\t\t *     }\n\t\t *     return \"regular-header\";\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #setHeaderRendererFactoryWithID()\n\t\t * @see #headerRendererFactory\n\t\t */\n\t\tpublic function get headerFactoryIDFunction():Function\n\t\t{\n\t\t\treturn this._headerFactoryIDFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set headerFactoryIDFunction(value:Function):void\n\t\t{\n\t\t\tif(this._headerFactoryIDFunction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._headerFactoryIDFunction = value;\n\t\t\tif(value !== null && this._headerRendererFactories === null)\n\t\t\t{\n\t\t\t\tthis._headerRendererFactories = {};\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customHeaderRendererStyleName:String = DEFAULT_CHILD_STYLE_NAME_HEADER_RENDERER;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customHeaderRendererStyleName():String\n\t\t{\n\t\t\treturn this._customHeaderRendererStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customHeaderRendererStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customHeaderRendererStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customHeaderRendererStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _headerRendererProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for all of the list's header\n\t\t * renderers, and the properties will be passed down to every header\n\t\t * renderer when the list validates. The available properties\n\t\t * depend on which <code>IGroupedListHeaderOrFooterRenderer</code>\n\t\t * implementation is returned by <code>headerRendererFactory</code>.\n\t\t *\n\t\t * <p>By default, the <code>headerRendererFactory</code> will return a\n\t\t * <code>DefaultGroupedListHeaderOrFooterRenderer</code> instance. If\n\t\t * you aren't using a custom header renderer, you can refer to\n\t\t * <a href=\"renderers/DefaultGroupedListHeaderOrFooterRenderer.html\"><code>feathers.controls.renderers.DefaultGroupedListHeaderOrFooterRenderer</code></a>\n\t\t * for a list of available properties.</p>\n\t\t *\n\t\t * <p>These properties are shared by every header renderer, so anything\n\t\t * that cannot be shared (such as display objects, which cannot be added\n\t\t * to multiple parents) should be passed to header renderers using the\n\t\t * <code>headerRendererFactory</code> or in the theme.</p>\n\t\t *\n\t\t * <p>The following example customizes some header renderer properties:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.headerRendererProperties.contentLabelField = \"headerText\";\n\t\t * list.headerRendererProperties.contentLabelStyleName = \"custom-header-renderer-content-label\";</listing>\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>headerRendererFactory</code> function instead\n\t\t * of using <code>headerRendererProperties</code> will result in better\n\t\t * performance.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #headerRendererFactory\n\t\t * @see feathers.controls.renderers.IGroupedListHeaderOrFooterRenderer\n\t\t * @see feathers.controls.renderers.DefaultGroupedListHeaderOrFooterRenderer\n\t\t */\n\t\tpublic function get headerRendererProperties():Object\n\t\t{\n\t\t\tif(!this._headerRendererProperties)\n\t\t\t{\n\t\t\t\tthis._headerRendererProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._headerRendererProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set headerRendererProperties(value:Object):void\n\t\t{\n\t\t\tif(this._headerRendererProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._headerRendererProperties)\n\t\t\t{\n\t\t\t\tthis._headerRendererProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._headerRendererProperties = PropertyProxy(value);\n\t\t\tif(this._headerRendererProperties)\n\t\t\t{\n\t\t\t\tthis._headerRendererProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _footerRendererType:Class = DefaultGroupedListHeaderOrFooterRenderer;\n\n\t\t/**\n\t\t * The class used to instantiate footer renderers. Must implement the\n\t\t * <code>IGroupedListHeaderOrFooterRenderer</code> interface.\n\t\t *\n\t\t * <p>The following example changes the footer renderer type:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.footerRendererType = CustomFooterRendererClass;</listing>\n\t\t *\n\t\t * @default feathers.controls.renderers.DefaultGroupedListHeaderOrFooterRenderer\n\t\t *\n\t\t * @see feathers.controls.renderers.IGroupedListHeaderOrFooterRenderer\n\t\t * @see #footerRendererFactory\n\t\t */\n\t\tpublic function get footerRendererType():Class\n\t\t{\n\t\t\treturn this._footerRendererType;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set footerRendererType(value:Class):void\n\t\t{\n\t\t\tif(this._footerRendererType == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._footerRendererType = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _footerRendererFactories:Object;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _footerRendererFactory:Function;\n\n\t\t/**\n\t\t * A function called that is expected to return a new footer renderer.\n\t\t * Has a higher priority than <code>footerRendererType</code>.\n\t\t * Typically, you would use an <code>footerRendererFactory</code>\n\t\t * instead of a <code>footerRendererType</code> if you wanted to\n\t\t * initialize some properties on each separate footer renderer, such as\n\t\t * skins.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t *\n\t\t * <pre>function():IGroupedListHeaderOrFooterRenderer</pre>\n\t\t *\n\t\t * <p>The following example provides a factory for the footer renderer:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.itemRendererFactory = function():IGroupedListHeaderOrFooterRenderer\n\t\t * {\n\t\t *     var renderer:CustomFooterRendererClass = new CustomFooterRendererClass();\n\t\t *     renderer.backgroundSkin = new Quad( 10, 10, 0xff0000 );\n\t\t *     return renderer;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.renderers.IGroupedListHeaderOrFooterRenderer\n\t\t * @see #footerRendererType\n\t\t * @see #setFooterRendererFactoryWithID()\n\t\t */\n\t\tpublic function get footerRendererFactory():Function\n\t\t{\n\t\t\treturn this._footerRendererFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set footerRendererFactory(value:Function):void\n\t\t{\n\t\t\tif(this._footerRendererFactory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._footerRendererFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _footerFactoryIDFunction:Function;\n\n\t\t/**\n\t\t * When a list requires multiple footer renderer types, this function is\n\t\t * used to determine which type of footer renderer is required for a\n\t\t * specific footer (or group index). Returns the ID of the factory\n\t\t * to use for the footer, or <code>null</code> if the default\n\t\t * <code>footerRendererFactory</code> should be used.\n\t\t *\n\t\t * <p>The function is expected to have one of the following\n\t\t * signatures:</p>\n\t\t *\n\t\t * <pre>function(footer:Object):String</pre>\n\t\t *\n\t\t * <pre>function(footer:Object, groupIndex:int):String</pre>\n\t\t *\n\t\t * <p>The following example provides a <code>footerFactoryIDFunction</code>:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * function regularFooterFactory():IGroupedListFooterRenderer\n\t\t * {\n\t\t *     return new DefaultGroupedListHeaderOrFooterRenderer();\n\t\t * }\n\t\t * function customFooterFactory():IGroupedListFooterRenderer\n\t\t * {\n\t\t *     return new CustomFooterRenderer();\n\t\t * }\n\t\t * list.setFooterRendererFactoryWithID( \"regular-footer\", regularFooterFactory );\n\t\t * list.setFooterRendererFactoryWithID( \"custom-footer\", customFooterFactory );\n\t\t * \n\t\t * list.footerFactoryIDFunction = function( footer:Object, groupIndex:int ):String\n\t\t * {\n\t\t *     //check if the footerAccessory property exists in the footer data\n\t\t *     if( \"footerAccessory\" in footer )\n\t\t *     {\n\t\t *         return \"custom-footer\";\n\t\t *     }\n\t\t *     return \"regular-footer\";\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #setFooterRendererFactoryWithID()\n\t\t * @see #footerRendererFactory\n\t\t */\n\t\tpublic function get footerFactoryIDFunction():Function\n\t\t{\n\t\t\treturn this._footerFactoryIDFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set footerFactoryIDFunction(value:Function):void\n\t\t{\n\t\t\tif(this._footerFactoryIDFunction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._footerFactoryIDFunction = value;\n\t\t\tif(value !== null && this._footerRendererFactories === null)\n\t\t\t{\n\t\t\t\tthis._footerRendererFactories = {};\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customFooterRendererStyleName:String = DEFAULT_CHILD_STYLE_NAME_FOOTER_RENDERER;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customFooterRendererStyleName():String\n\t\t{\n\t\t\treturn this._customFooterRendererStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customFooterRendererStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customFooterRendererStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customFooterRendererStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _footerRendererProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for all of the list's footer\n\t\t * renderers, and the properties will be passed down to every footer\n\t\t * renderer when the list validates. The available properties\n\t\t * depend on which <code>IGroupedListHeaderOrFooterRenderer</code>\n\t\t * implementation is returned by <code>footerRendererFactory</code>.\n\t\t *\n\t\t * <p>By default, the <code>footerRendererFactory</code> will return a\n\t\t * <code>DefaultGroupedListHeaderOrFooterRenderer</code> instance. If\n\t\t * you aren't using a custom footer renderer, you can refer to\n\t\t * <a href=\"renderers/DefaultGroupedListHeaderOrFooterRenderer.html\"><code>feathers.controls.renderers.DefaultGroupedListHeaderOrFooterRenderer</code></a>\n\t\t * for a list of available properties.</p>\n\t\t *\n\t\t * <p>These properties are shared by every footer renderer, so anything\n\t\t * that cannot be shared (such as display objects, which cannot be added\n\t\t * to multiple parents) should be passed to footer renderers using the\n\t\t * <code>footerRendererFactory</code> or in the theme.</p>\n\t\t *\n\t\t * <p>The following example customizes some footer renderer properties:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.footerRendererProperties.contentLabelField = \"footerText\";\n\t\t * list.footerRendererProperties.contentLabelStyleName = \"custom-footer-renderer-content-label\";</listing>\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>footerRendererFactory</code> function instead\n\t\t * of using <code>footerRendererProperties</code> will result in better\n\t\t * performance.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #footerRendererFactory\n\t\t * @see feathers.controls.renderers.IGroupedListHeaderOrFooterRenderer\n\t\t * @see feathers.controls.renderers.DefaultGroupedListHeaderOrFooterRenderer\n\t\t */\n\t\tpublic function get footerRendererProperties():Object\n\t\t{\n\t\t\tif(!this._footerRendererProperties)\n\t\t\t{\n\t\t\t\tthis._footerRendererProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._footerRendererProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set footerRendererProperties(value:Object):void\n\t\t{\n\t\t\tif(this._footerRendererProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._footerRendererProperties)\n\t\t\t{\n\t\t\t\tthis._footerRendererProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._footerRendererProperties = PropertyProxy(value);\n\t\t\tif(this._footerRendererProperties)\n\t\t\t{\n\t\t\t\tthis._footerRendererProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _headerField:String = \"header\";\n\n\t\t/**\n\t\t * The field in a group that contains the data for a header. If the\n\t\t * group does not have this field, and a <code>headerFunction</code> is\n\t\t * not defined, then no header will be displayed for the group. In other\n\t\t * words, a header is optional, and a group may not have one.\n\t\t *\n\t\t * <p>All of the header fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>headerFunction</code></li>\n\t\t *     <li><code>headerField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>The following example sets the header field:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.headerField = \"alphabet\";</listing>\n\t\t *\n\t\t * @default \"header\"\n\t\t *\n\t\t * @see #headerFunction\n\t\t */\n\t\tpublic function get headerField():String\n\t\t{\n\t\t\treturn this._headerField;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set headerField(value:String):void\n\t\t{\n\t\t\tif(this._headerField == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._headerField = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _headerFunction:Function;\n\n\t\t/**\n\t\t * A function used to generate header data for a specific group. If this\n\t\t * function is not null, then the <code>headerField</code> will be\n\t\t * ignored.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function( item:Object ):Object</pre>\n\t\t *\n\t\t * <p>All of the header fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>headerFunction</code></li>\n\t\t *     <li><code>headerField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>The following example sets the header function:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.headerFunction = function( group:Object ):Object\n\t\t * {\n\t\t *    return group.header;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #headerField\n\t\t */\n\t\tpublic function get headerFunction():Function\n\t\t{\n\t\t\treturn this._headerFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set headerFunction(value:Function):void\n\t\t{\n\t\t\tif(this._headerFunction == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._headerFunction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _footerField:String = \"footer\";\n\n\t\t/**\n\t\t * The field in a group that contains the data for a footer. If the\n\t\t * group does not have this field, and a <code>footerFunction</code> is\n\t\t * not defined, then no footer will be displayed for the group. In other\n\t\t * words, a footer is optional, and a group may not have one.\n\t\t *\n\t\t * <p>All of the footer fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>footerFunction</code></li>\n\t\t *     <li><code>footerField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>The following example sets the footer field:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.footerField = \"controls\";</listing>\n\t\t *\n\t\t * @default \"footer\"\n\t\t *\n\t\t * @see #footerFunction\n\t\t */\n\t\tpublic function get footerField():String\n\t\t{\n\t\t\treturn this._footerField;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set footerField(value:String):void\n\t\t{\n\t\t\tif(this._footerField == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._footerField = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _footerFunction:Function;\n\n\t\t/**\n\t\t * A function used to generate footer data for a specific group. If this\n\t\t * function is not null, then the <code>footerField</code> will be\n\t\t * ignored.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function( item:Object ):Object</pre>\n\t\t *\n\t\t * <p>All of the footer fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>footerFunction</code></li>\n\t\t *     <li><code>footerField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>The following example sets the footer function:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.footerFunction = function( group:Object ):Object\n\t\t * {\n\t\t *    return group.footer;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #footerField\n\t\t */\n\t\tpublic function get footerFunction():Function\n\t\t{\n\t\t\treturn this._footerFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set footerFunction(value:Function):void\n\t\t{\n\t\t\tif(this._footerFunction == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._footerFunction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _keyScrollDuration:Number = 0.25;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get keyScrollDuration():Number\n\t\t{\n\t\t\treturn this._keyScrollDuration;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set keyScrollDuration(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._keyScrollDuration == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._keyScrollDuration = value;\n\t\t}\n\n\t\t/**\n\t\t * The pending group index to scroll to after validating. A value of\n\t\t * <code>-1</code> means that the scroller won't scroll to a group after\n\t\t * validating.\n\t\t */\n\t\tprotected var pendingGroupIndex:int = -1;\n\n\t\t/**\n\t\t * The pending item index to scroll to after validating. A value of\n\t\t * <code>-1</code> means that the scroller won't scroll to an item after\n\t\t * validating.\n\t\t */\n\t\tprotected var pendingItemIndex:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//clearing selection now so that the data provider setter won't\n\t\t\t//cause a selection change that triggers events.\n\t\t\tthis._selectedGroupIndex = -1;\n\t\t\tthis._selectedItemIndex = -1;\n\t\t\tthis.dataProvider = null;\n\t\t\tthis.layout = null;\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function scrollToPosition(horizontalScrollPosition:Number, verticalScrollPosition:Number, animationDuration:Number = NaN):void\n\t\t{\n\t\t\tthis.pendingItemIndex = -1;\n\t\t\tsuper.scrollToPosition(horizontalScrollPosition, verticalScrollPosition, animationDuration);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function scrollToPageIndex(horizontalPageIndex:int, verticalPageIndex:int, animationDuration:Number = NaN):void\n\t\t{\n\t\t\tthis.pendingGroupIndex = -1;\n\t\t\tthis.pendingItemIndex = -1;\n\t\t\tsuper.scrollToPageIndex(horizontalPageIndex, verticalPageIndex, animationDuration);\n\t\t}\n\n\t\t/**\n\t\t * After the next validation, scrolls the list so that the specified\n\t\t * item is visible. If <code>animationDuration</code> is greater than\n\t\t * zero, the scroll will animate. The duration is in seconds.\n\t\t *\n\t\t * <p>The <code>itemIndex</code> parameter is optional. If set to\n\t\t * <code>-1</code>, the list will scroll to the start of the specified\n\t\t * group.</p>\n\t\t *\n\t\t * <p>In the following example, the list is scrolled to display the\n\t\t * third item in the second group:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.scrollToDisplayIndex( 1, 2 );</listing>\n\t\t *\n\t\t * <p>In the following example, the list is scrolled to display the\n\t\t * third group:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.scrollToDisplayIndex( 2 );</listing>\n\t\t */\n\t\tpublic function scrollToDisplayIndex(groupIndex:int, itemIndex:int = -1, animationDuration:Number = 0):void\n\t\t{\n\t\t\t//cancel any pending scroll to a different page or scroll position.\n\t\t\t//we can have only one type of pending scroll at a time.\n\t\t\tthis.hasPendingHorizontalPageIndex = false;\n\t\t\tthis.hasPendingVerticalPageIndex = false;\n\t\t\tthis.pendingHorizontalScrollPosition = NaN;\n\t\t\tthis.pendingVerticalScrollPosition = NaN;\n\t\t\tif(this.pendingGroupIndex == groupIndex &&\n\t\t\t\tthis.pendingItemIndex == itemIndex &&\n\t\t\t\tthis.pendingScrollDuration == animationDuration)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.pendingGroupIndex = groupIndex;\n\t\t\tthis.pendingItemIndex = itemIndex;\n\t\t\tthis.pendingScrollDuration = animationDuration;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_PENDING_SCROLL);\n\t\t}\n\n\t\t/**\n\t\t * Sets the selected group and item index.\n\t\t *\n\t\t * <p>In the following example, the third item in the second group\n\t\t * is selected:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.setSelectedLocation( 1, 2 );</listing>\n\t\t *\n\t\t * <p>In the following example, the selection is cleared:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.setSelectedLocation( -1, -1 );</listing>\n\t\t *\n\t\t * @see #selectedGroupIndex\n\t\t * @see #selectedItemIndex\n\t\t * @see #selectedItem\n\t\t */\n\t\tpublic function setSelectedLocation(groupIndex:int, itemIndex:int):void\n\t\t{\n\t\t\tif(this._selectedGroupIndex == groupIndex && this._selectedItemIndex == itemIndex)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif((groupIndex < 0 && itemIndex >= 0) || (groupIndex >= 0 && itemIndex < 0))\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"To deselect items, group index and item index must both be < 0.\");\n\t\t\t}\n\t\t\tthis._selectedGroupIndex = groupIndex;\n\t\t\tthis._selectedItemIndex = itemIndex;\n\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * Returns the item renderer factory associated with a specific ID.\n\t\t * Returns <code>null</code> if no factory is associated with the ID.\n\t\t *\n\t\t * @see #setItemRendererFactoryWithID()\n\t\t */\n\t\tpublic function getItemRendererFactoryWithID(id:String):Function\n\t\t{\n\t\t\tif(this._itemRendererFactories && (id in this._itemRendererFactories))\n\t\t\t{\n\t\t\t\treturn this._itemRendererFactories[id] as Function;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * Associates an item renderer factory with an ID to allow multiple\n\t\t * types of item renderers may be displayed in the list. A custom\n\t\t * <code>factoryIDFunction</code> may be specified to return the ID of\n\t\t * the factory to use for a specific item in the data provider.\n\t\t *\n\t\t * @see #factoryIDFunction\n\t\t * @see #getItemRendererFactoryWithID()\n\t\t */\n\t\tpublic function setItemRendererFactoryWithID(id:String, factory:Function):void\n\t\t{\n\t\t\tif(id === null)\n\t\t\t{\n\t\t\t\tthis.itemRendererFactory = factory;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._itemRendererFactories === null)\n\t\t\t{\n\t\t\t\tthis._itemRendererFactories = {};\n\t\t\t}\n\t\t\tif(factory !== null)\n\t\t\t{\n\t\t\t\tthis._itemRendererFactories[id] = factory;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdelete this._itemRendererFactories[id];\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Returns the header renderer factory associated with a specific ID.\n\t\t * Returns <code>null</code> if no factory is associated with the ID.\n\t\t *\n\t\t * @see #setHeaderRendererFactoryWithID()\n\t\t */\n\t\tpublic function getHeaderRendererFactoryWithID(id:String):Function\n\t\t{\n\t\t\tif(this._headerRendererFactories && (id in this._headerRendererFactories))\n\t\t\t{\n\t\t\t\treturn this._headerRendererFactories[id] as Function;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * Associates a header renderer factory with an ID to allow multiple\n\t\t * types of header renderers may be displayed in the list. A custom\n\t\t * <code>headerFactoryIDFunction</code> may be specified to return the\n\t\t * ID of the factory to use for a specific header in the data provider.\n\t\t *\n\t\t * @see #headerFactoryIDFunction\n\t\t * @see #getHeaderRendererFactoryWithID()\n\t\t */\n\t\tpublic function setHeaderRendererFactoryWithID(id:String, factory:Function):void\n\t\t{\n\t\t\tif(id === null)\n\t\t\t{\n\t\t\t\tthis.headerRendererFactory = factory;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._headerRendererFactories === null)\n\t\t\t{\n\t\t\t\tthis._headerRendererFactories = {};\n\t\t\t}\n\t\t\tif(factory !== null)\n\t\t\t{\n\t\t\t\tthis._headerRendererFactories[id] = factory;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdelete this._headerRendererFactories[id];\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Returns the footer renderer factory associated with a specific ID.\n\t\t * Returns <code>null</code> if no factory is associated with the ID.\n\t\t *\n\t\t * @see #setFooterRendererFactoryWithID()\n\t\t */\n\t\tpublic function getFooterRendererFactoryWithID(id:String):Function\n\t\t{\n\t\t\tif(this._footerRendererFactories && (id in this._footerRendererFactories))\n\t\t\t{\n\t\t\t\treturn this._footerRendererFactories[id] as Function;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * Associates a footer renderer factory with an ID to allow multiple\n\t\t * types of footer renderers may be displayed in the list. A custom\n\t\t * <code>footerFactoryIDFunction</code> may be specified to return the\n\t\t * ID of the factory to use for a specific footer in the data provider.\n\t\t *\n\t\t * @see #footerFactoryIDFunction\n\t\t * @see #getFooterRendererFactoryWithID()\n\t\t */\n\t\tpublic function setFooterRendererFactoryWithID(id:String, factory:Function):void\n\t\t{\n\t\t\tif(id === null)\n\t\t\t{\n\t\t\t\tthis.footerRendererFactory = factory;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._footerRendererFactories === null)\n\t\t\t{\n\t\t\t\tthis._footerRendererFactories = {};\n\t\t\t}\n\t\t\tif(factory !== null)\n\t\t\t{\n\t\t\t\tthis._footerRendererFactories[id] = factory;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdelete this._footerRendererFactories[id];\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Extracts header data from a group object.\n\t\t */\n\t\tpublic function groupToHeaderData(group:Object):Object\n\t\t{\n\t\t\tif(this._headerFunction != null)\n\t\t\t{\n\t\t\t\treturn this._headerFunction(group);\n\t\t\t}\n\t\t\telse if(this._headerField != null && group && group.hasOwnProperty(this._headerField))\n\t\t\t{\n\t\t\t\treturn group[this._headerField];\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * Extracts footer data from a group object.\n\t\t */\n\t\tpublic function groupToFooterData(group:Object):Object\n\t\t{\n\t\t\tif(this._footerFunction != null)\n\t\t\t{\n\t\t\t\treturn this._footerFunction(group);\n\t\t\t}\n\t\t\telse if(this._footerField != null && group && group.hasOwnProperty(this._footerField))\n\t\t\t{\n\t\t\t\treturn group[this._footerField];\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * Returns the current item renderer used to render a specific item. May\n\t\t * return <code>null</code> if an item doesn't currently have an item\n\t\t * renderer. Most lists use virtual layouts where only the visible items\n\t\t * will have an item renderer, so the result will usually be\n\t\t * <code>null</code> for most items in the data provider.\n\t\t *\n\t\t * @see ../../../help/faq/layout-virtualization.html What is layout virtualization?\n\t\t */\n\t\tpublic function itemToItemRenderer(item:Object):IGroupedListItemRenderer\n\t\t{\n\t\t\treturn this.dataViewPort.itemToItemRenderer(item);\n\t\t}\n\n\t\t/**\n\t\t * Returns the current header renderer used to render specific header\n\t\t * data. May return <code>null</code> if the header data doesn't\n\t\t * currently have a header renderer. Most lists use virtual layouts\n\t\t * where only the visible headers will have a header renderer, so the\n\t\t * result will usually be <code>null</code> for most header data in the\n\t\t * data provider.\n\t\t *\n\t\t * @see #groupToHeaderData()\n\t\t * @see ../../../help/faq/layout-virtualization.html What is layout virtualization?\n\t\t */\n\t\tpublic function headerDataToHeaderRenderer(headerData:Object):IGroupedListHeaderRenderer\n\t\t{\n\t\t\treturn this.dataViewPort.headerDataToHeaderRenderer(headerData);\n\t\t}\n\n\t\t/**\n\t\t * Returns the current footer renderer used to render specific footer\n\t\t * data. May return <code>null</code> if the footer data doesn't\n\t\t * currently have a footer renderer. Most lists use virtual layouts\n\t\t * where only the visible footers will have a footer renderer, so the\n\t\t * result will usually be <code>null</code> for most footer data in the\n\t\t * data provider.\n\t\t *\n\t\t * @see #groupToFooterData()\n\t\t * @see ../../../help/faq/layout-virtualization.html What is layout virtualization?\n\t\t */\n\t\tpublic function footerDataToFooterRenderer(footerData:Object):IGroupedListFooterRenderer\n\t\t{\n\t\t\treturn this.dataViewPort.footerDataToFooterRenderer(footerData);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tvar hasLayout:Boolean = this._layout !== null;\n\n\t\t\tsuper.initialize();\n\n\t\t\tif(!this.dataViewPort)\n\t\t\t{\n\t\t\t\tthis.viewPort = this.dataViewPort = new GroupedListDataViewPort();\n\t\t\t\tthis.dataViewPort.owner = this;\n\t\t\t\tthis.dataViewPort.addEventListener(Event.CHANGE, dataViewPort_changeHandler);\n\t\t\t\tthis.viewPort = this.dataViewPort;\n\t\t\t}\n\n\t\t\tif(!hasLayout)\n\t\t\t{\n\t\t\t\tif(this._hasElasticEdges &&\n\t\t\t\t\tthis._verticalScrollPolicy === ScrollPolicy.AUTO &&\n\t\t\t\t\tthis._scrollBarDisplayMode !== ScrollBarDisplayMode.FIXED)\n\t\t\t\t{\n\t\t\t\t\t//so that the elastic edges work even when the max scroll\n\t\t\t\t\t//position is 0, similar to iOS.\n\t\t\t\t\tthis._verticalScrollPolicy = ScrollPolicy.ON;\n\t\t\t\t}\n\n\t\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\t\tlayout.useVirtualLayout = true;\n\t\t\t\tlayout.padding = 0;\n\t\t\t\tlayout.gap = 0;\n\t\t\t\tlayout.horizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\t\tlayout.verticalAlign = VerticalAlign.TOP;\n\t\t\t\tlayout.stickyHeader = !this._styleNameList.contains(ALTERNATE_STYLE_NAME_INSET_GROUPED_LIST);\n\t\t\t\tthis.ignoreNextStyleRestriction();\n\t\t\t\tthis.layout = layout;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tthis.refreshDataViewPortProperties();\n\t\t\tsuper.draw();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshDataViewPortProperties():void\n\t\t{\n\t\t\tthis.dataViewPort.isSelectable = this._isSelectable;\n\t\t\tthis.dataViewPort.setSelectedLocation(this._selectedGroupIndex, this._selectedItemIndex);\n\t\t\tthis.dataViewPort.dataProvider = this._dataProvider;\n\t\t\tthis.dataViewPort.typicalItem = this._typicalItem;\n\n\t\t\tthis.dataViewPort.itemRendererType = this._itemRendererType;\n\t\t\tthis.dataViewPort.itemRendererFactory = this._itemRendererFactory;\n\t\t\tthis.dataViewPort.itemRendererFactories = this._itemRendererFactories;\n\t\t\tthis.dataViewPort.factoryIDFunction = this._factoryIDFunction;\n\t\t\tthis.dataViewPort.itemRendererProperties = this._itemRendererProperties;\n\t\t\tthis.dataViewPort.customItemRendererStyleName = this._customItemRendererStyleName;\n\n\t\t\tthis.dataViewPort.firstItemRendererType = this._firstItemRendererType;\n\t\t\tthis.dataViewPort.firstItemRendererFactory = this._firstItemRendererFactory;\n\t\t\tthis.dataViewPort.customFirstItemRendererStyleName = this._customFirstItemRendererStyleName;\n\n\t\t\tthis.dataViewPort.lastItemRendererType = this._lastItemRendererType;\n\t\t\tthis.dataViewPort.lastItemRendererFactory = this._lastItemRendererFactory;\n\t\t\tthis.dataViewPort.customLastItemRendererStyleName = this._customLastItemRendererStyleName;\n\n\t\t\tthis.dataViewPort.singleItemRendererType = this._singleItemRendererType;\n\t\t\tthis.dataViewPort.singleItemRendererFactory = this._singleItemRendererFactory;\n\t\t\tthis.dataViewPort.customSingleItemRendererStyleName = this._customSingleItemRendererStyleName;\n\n\t\t\tthis.dataViewPort.headerRendererType = this._headerRendererType;\n\t\t\tthis.dataViewPort.headerRendererFactory = this._headerRendererFactory;\n\t\t\tthis.dataViewPort.headerRendererFactories = this._headerRendererFactories;\n\t\t\tthis.dataViewPort.headerFactoryIDFunction = this._headerFactoryIDFunction;\n\t\t\tthis.dataViewPort.headerRendererProperties = this._headerRendererProperties;\n\t\t\tthis.dataViewPort.customHeaderRendererStyleName = this._customHeaderRendererStyleName;\n\n\t\t\tthis.dataViewPort.footerRendererType = this._footerRendererType;\n\t\t\tthis.dataViewPort.footerRendererFactory = this._footerRendererFactory;\n\t\t\tthis.dataViewPort.footerRendererFactories = this._footerRendererFactories;\n\t\t\tthis.dataViewPort.footerFactoryIDFunction = this._footerFactoryIDFunction;\n\t\t\tthis.dataViewPort.footerRendererProperties = this._footerRendererProperties;\n\t\t\tthis.dataViewPort.customFooterRendererStyleName = this._customFooterRendererStyleName;\n\n\t\t\tthis.dataViewPort.layout = this._layout;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function handlePendingScroll():void\n\t\t{\n\t\t\tif(this.pendingGroupIndex >= 0)\n\t\t\t{\n\t\t\t\tvar pendingData:Object = null;\n\t\t\t\tif(this._dataProvider !== null)\n\t\t\t\t{\n\t\t\t\t\tif(this.pendingItemIndex >= 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._helperLocation.length = 2;\n\t\t\t\t\t\tthis._helperLocation[0] = this._selectedGroupIndex;\n\t\t\t\t\t\tthis._helperLocation[1] = this._selectedItemIndex;\n\t\t\t\t\t\tpendingData = this._dataProvider.getItemAt(this.pendingGroupIndex, this.pendingItemIndex);\n\t\t\t\t\t\tthis._helperLocation.length = 0;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._helperLocation.length = 1;\n\t\t\t\t\t\tthis._helperLocation[0] = this._selectedGroupIndex;\n\t\t\t\t\t\tpendingData = this._dataProvider.getItemAt(this.pendingGroupIndex);\n\t\t\t\t\t\tthis._helperLocation.length = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(pendingData is Object)\n\t\t\t\t{\n\t\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\t\tthis.dataViewPort.getScrollPositionForIndex(this.pendingGroupIndex, this.pendingItemIndex, point);\n\t\t\t\t\tthis.pendingGroupIndex = -1;\n\t\t\t\t\tthis.pendingItemIndex = -1;\n\n\t\t\t\t\tvar targetHorizontalScrollPosition:Number = point.x;\n\t\t\t\t\tvar targetVerticalScrollPosition:Number = point.y;\n\t\t\t\t\tPool.putPoint(point);\n\t\t\t\t\tif(targetHorizontalScrollPosition < this._minHorizontalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\ttargetHorizontalScrollPosition = this._minHorizontalScrollPosition;\n\t\t\t\t\t}\n\t\t\t\t\telse if(targetHorizontalScrollPosition > this._maxHorizontalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\ttargetHorizontalScrollPosition = this._maxHorizontalScrollPosition;\n\t\t\t\t\t}\n\t\t\t\t\tif(targetVerticalScrollPosition < this._minVerticalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\ttargetVerticalScrollPosition = this._minVerticalScrollPosition;\n\t\t\t\t\t}\n\t\t\t\t\telse if(targetVerticalScrollPosition > this._maxVerticalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\ttargetVerticalScrollPosition = this._maxVerticalScrollPosition;\n\t\t\t\t\t}\n\t\t\t\t\tthis.throwTo(targetHorizontalScrollPosition, targetVerticalScrollPosition, this.pendingScrollDuration);\n\t\t\t\t}\n\t\t\t}\n\t\t\tsuper.handlePendingScroll();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function nativeStage_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(!this._isSelectable)\n\t\t\t{\n\t\t\t\t//not selectable, but should scroll\n\t\t\t\tsuper.nativeStage_keyDownHandler(event);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(event.isDefaultPrevented())\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!this._dataProvider)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._selectedGroupIndex != -1 && this._selectedItemIndex != -1 &&\n\t\t\t\t(event.keyCode == Keyboard.SPACE ||\n\t\t\t\t((event.keyLocation == 4 || DeviceCapabilities.simulateDPad) && event.keyCode == Keyboard.ENTER)))\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(Event.TRIGGERED, false, this.selectedItem);\n\t\t\t}\n\t\t\tif(event.keyCode == Keyboard.HOME || event.keyCode == Keyboard.END ||\n\t\t\t\tevent.keyCode == Keyboard.PAGE_UP || event.keyCode == Keyboard.PAGE_DOWN ||\n\t\t\t\tevent.keyCode == Keyboard.UP || event.keyCode == Keyboard.DOWN ||\n\t\t\t\tevent.keyCode == Keyboard.LEFT || event.keyCode == Keyboard.RIGHT)\n\t\t\t{\n\t\t\t\tthis.dataViewPort.calculateNavigationDestination(this._selectedGroupIndex, this._selectedItemIndex, event.keyCode, this._helperLocation);\n\t\t\t\tvar newGroupIndex:int = this._helperLocation[0];\n\t\t\t\tvar newItemIndex:int = this._helperLocation[1];\n\t\t\t\tif(newGroupIndex == -1 || newItemIndex == -1)\n\t\t\t\t{\n\t\t\t\t\tthis.setSelectedLocation(-1, -1);\n\t\t\t\t}\n\t\t\t\telse if(this._selectedGroupIndex != newGroupIndex || this._selectedItemIndex != newItemIndex)\n\t\t\t\t{\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tthis.setSelectedLocation(newGroupIndex, newItemIndex);\n\t\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\t\tthis.dataViewPort.getNearestScrollPositionForIndex(this._selectedGroupIndex, this.selectedItemIndex, point);\n\t\t\t\t\tthis.scrollToPosition(point.x, point.y, this._keyScrollDuration);\n\t\t\t\t\tPool.putPoint(point);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_resetHandler(event:Event):void\n\t\t{\n\t\t\tthis.horizontalScrollPosition = 0;\n\t\t\tthis.verticalScrollPosition = 0;\n\n\t\t\t//the entire data provider was replaced. select no item.\n\t\t\tthis.setSelectedLocation(-1, -1);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_addItemHandler(event:Event, indices:Array):void\n\t\t{\n\t\t\tif(this._selectedGroupIndex == -1)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar groupIndex:int = indices[0] as int;\n\t\t\tif(indices.length > 1) //adding an item to a group\n\t\t\t{\n\t\t\t\tvar itemIndex:int = indices[1] as int;\n\t\t\t\tif(this._selectedGroupIndex == groupIndex && this._selectedItemIndex >= itemIndex)\n\t\t\t\t{\n\t\t\t\t\t//adding an item at an index that is less than or equal to\n\t\t\t\t\t//the item that is selected. need to update the selected\n\t\t\t\t\t//item index.\n\t\t\t\t\tthis.setSelectedLocation(this._selectedGroupIndex, this._selectedItemIndex + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //adding an entire group\n\t\t\t{\n\t\t\t\t//adding a group before the group that the selected item is in.\n\t\t\t\t//need to update the selected group index.\n\t\t\t\tthis.setSelectedLocation(this._selectedGroupIndex + 1, this._selectedItemIndex);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_removeAllHandler(event:Event):void\n\t\t{\n\t\t\tthis.setSelectedLocation(-1, -1);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_removeItemHandler(event:Event, indices:Array):void\n\t\t{\n\t\t\tif(this._selectedGroupIndex == -1)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar groupIndex:int = indices[0] as int;\n\t\t\tif(indices.length > 1) //removing an item from a group\n\t\t\t{\n\t\t\t\tvar itemIndex:int = indices[1] as int;\n\t\t\t\tif(this._selectedGroupIndex == groupIndex)\n\t\t\t\t{\n\t\t\t\t\tif(this._selectedItemIndex == itemIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\t//removing the item that was selected.\n\t\t\t\t\t\t//now, nothing will be selected.\n\t\t\t\t\t\tthis.setSelectedLocation(-1, -1);\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._selectedItemIndex > itemIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\t//removing an item from the same group that appears\n\t\t\t\t\t\t//before the item that is selected. need to update the\n\t\t\t\t\t\t//selected item index.\n\t\t\t\t\t\tthis.setSelectedLocation(this._selectedGroupIndex, this._selectedItemIndex - 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //removing an entire group\n\t\t\t{\n\t\t\t\tif(this._selectedGroupIndex == groupIndex)\n\t\t\t\t{\n\t\t\t\t\t//removing the group that the selected item was in.\n\t\t\t\t\t//now, nothing will be selected.\n\t\t\t\t\tthis.setSelectedLocation(-1, -1);\n\t\t\t\t}\n\t\t\t\telse if(this._selectedGroupIndex > groupIndex)\n\t\t\t\t{\n\t\t\t\t\t//removing a group before the group that the selected item\n\t\t\t\t\t//is in. need to update the selected group index.\n\t\t\t\t\tthis.setSelectedLocation(this._selectedGroupIndex - 1, this._selectedItemIndex);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_replaceItemHandler(event:Event, indices:Array):void\n\t\t{\n\t\t\tif(this._selectedGroupIndex == -1)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar groupIndex:int = indices[0] as int;\n\t\t\tif(indices.length > 1) //replacing an item from a group\n\t\t\t{\n\t\t\t\tvar itemIndex:int = indices[1] as int;\n\t\t\t\tif(this._selectedGroupIndex == groupIndex && this._selectedItemIndex == itemIndex)\n\t\t\t\t{\n\t\t\t\t\t//replacing the selected item.\n\t\t\t\t\t//now, nothing will be selected.\n\t\t\t\t\tthis.setSelectedLocation(-1, -1);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(this._selectedGroupIndex == groupIndex) //replacing an entire group\n\t\t\t{\n\t\t\t\t//replacing the group with the selected item.\n\t\t\t\t//now, nothing will be selected.\n\t\t\t\tthis.setSelectedLocation(-1, -1);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataViewPort_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.setSelectedLocation(this.dataViewPort.selectedGroupIndex, this.dataViewPort.selectedItemIndex);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate function layout_scrollHandler(event:Event, scrollOffset:Point):void\n\t\t{\n\t\t\tvar layout:IVariableVirtualLayout = IVariableVirtualLayout(this._layout);\n\t\t\tif(!this.isScrolling || !layout.useVirtualLayout || !layout.hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar scrollOffsetX:Number = scrollOffset.x;\n\t\t\tthis._startHorizontalScrollPosition += scrollOffsetX;\n\t\t\tthis._horizontalScrollPosition += scrollOffsetX;\n\t\t\tif(this._horizontalAutoScrollTween)\n\t\t\t{\n\t\t\t\tthis._targetHorizontalScrollPosition += scrollOffsetX;\n\t\t\t\tthis.throwTo(this._targetHorizontalScrollPosition, NaN, this._horizontalAutoScrollTween.totalTime - this._horizontalAutoScrollTween.currentTime);\n\t\t\t}\n\n\t\t\tvar scrollOffsetY:Number = scrollOffset.y;\n\t\t\tthis._startVerticalScrollPosition += scrollOffsetY;\n\t\t\tthis._verticalScrollPosition += scrollOffsetY;\n\t\t\tif(this._verticalAutoScrollTween)\n\t\t\t{\n\t\t\t\tthis._targetVerticalScrollPosition += scrollOffsetY;\n\t\t\t\tthis.throwTo(NaN, this._targetVerticalScrollPosition, this._verticalAutoScrollTween.totalTime - this._verticalAutoScrollTween.currentTime);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/Header.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IMeasureDisplayObject;\n\timport feathers.core.ITextRenderer;\n\timport feathers.core.IValidating;\n\timport feathers.core.PropertyProxy;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.HorizontalLayout;\n\timport feathers.layout.LayoutBoundsResult;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.ViewPortBounds;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.system.DeviceCapabilities;\n\timport feathers.text.FontStylesSet;\n\timport feathers.utils.display.ScreenDensityScaleCalculator;\n\timport feathers.utils.skins.resetFluidChildDimensionsForMeasurement;\n\n\timport flash.display.Stage;\n\timport flash.display.StageDisplayState;\n\timport flash.events.FullScreenEvent;\n\timport flash.geom.Point;\n\timport flash.system.Capabilities;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.text.TextFormat;\n\timport starling.utils.Pool;\n\n\t/**\n\t * A display object displayed behind the header's content.\n\t *\n\t * <p>In the following example, the header's background skin is set to\n\t * a <code>Quad</code>:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * header.backgroundSkin = new Quad( 10, 10, 0xff0000 );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:backgroundDisabledSkin\n\t */\n\t[Style(name=\"backgroundSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * A background to display when the header is disabled. If the property\n\t * is <code>null</code>, the value of the <code>backgroundSkin</code>\n\t * property will be used instead.\n\t *\n\t * <p>In the following example, the header's disabled background skin is\n\t * set to a <code>Quad</code>:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * header.backgroundDisabledSkin = new Quad( 10, 10, 0x999999 );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:backgroundSkin\n\t */\n\t[Style(name=\"backgroundDisabledSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * A style name to add to the header's title text renderer\n\t * sub-component. Typically used by a theme to provide different styles\n\t * to different headers.\n\t *\n\t * <p>In the following example, a custom title style name is passed to\n\t * the header:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * header.customTitleStyleName = \"my-custom-header-title\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( BitmapFontTextRenderer ).setFunctionForStyleName( \"my-custom-header-title\", setCustomHeaderTitleStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_TITLE\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #titleFactory\n\t */\n\t[Style(name=\"customTitleStyleName\",type=\"String\")]\n\n\t/**\n\t * The font styles used to display the title's text when the header is\n\t * disabled.\n\t *\n\t * <p>In the following example, the disabled font styles are customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * header.disabledFontStyles = new TextFormat( \"Helvetica\", 20, 0x999999 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>titleFactory</code> to set more advanced styles on the\n\t * text renderer.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:fontStyles\n\t */\n\t[Style(name=\"disabledFontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The font styles used to display the title's text.\n\t *\n\t * <p>In the following example, the font styles are customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * header.fontStyles = new TextFormat( \"Helvetica\", 20, 0xcc0000 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>titleFactory</code> to set more advanced styles.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:disabledFontStyles\n\t */\n\t[Style(name=\"fontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * Quickly sets all padding properties to the same value. The\n\t * <code>padding</code> getter always returns the value of\n\t * <code>paddingTop</code>, but the other padding values may be\n\t * different.\n\t *\n\t * <p>In the following example, the header's padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * header.padding = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:paddingTop\n\t * @see #style:paddingRight\n\t * @see #style:paddingBottom\n\t * @see #style:paddingLeft\n\t */\n\t[Style(name=\"padding\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the header's top edge and the\n\t * header's content.\n\t *\n\t * <p>In the following example, the header's top padding is set to 20\n\t * pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * header.paddingTop = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingTop\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the header's right edge and the\n\t * header's content.\n\t *\n\t * <p>In the following example, the header's right padding is set to 20\n\t * pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * header.paddingRight = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingRight\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the header's bottom edge and\n\t * the header's content.\n\t *\n\t * <p>In the following example, the header's bottom padding is set to 20\n\t * pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * header.paddingBottom = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingBottom\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the header's left edge and the\n\t * header's content.\n\t *\n\t * <p>In the following example, the header's left padding is set to 20\n\t * pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * header.paddingLeft = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingLeft\",type=\"Number\")]\n\n\t/**\n\t * Space, in pixels, between items. The same value is used with the\n\t * <code>leftItems</code> and <code>rightItems</code>.\n\t *\n\t * <p>Set the <code>titleGap</code> to make the gap on the left and\n\t * right of the title use a different value.</p>\n\t *\n\t * <p>In the following example, the header's gap between items is set to\n\t * 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * header.gap = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:titleGap\n\t * @see #leftItems\n\t * @see #rightItems\n\t * @see #centerItems\n\t */\n\t[Style(name=\"gap\",type=\"Number\")]\n\n\t/**\n\t * The preferred horizontal position of the title.\n\t *\n\t * <p>If <code>titleAlign</code> is set to\n\t * <code>HorizontalAlign.LEFT</code>, but <code>leftItems</code> is not\n\t * empty, the title will be positioned slightly to the right of the\n\t * left items. If <code>centerItems</code> is also not empty, the title\n\t * will not be displayed.</p>\n\t *\n\t * <p>If <code>titleAlign</code> is set to\n\t * <code>HorizontalAlign.RIGHT</code>, but <code>rightItems</code> is\n\t * not empty, the title will be positioned slightly to the left of the\n\t * right items. If <code>centerItems</code> is also not empty, the title\n\t * will not be displayed.</p>\n\t *\n\t * <p>If <code>titleAlign</code> is set to\n\t * <code>HorizontalAlign.CENTER</code>, but <code>centerItems</code> is\n\t * not <code>null</code>, the title will not be displayed.</p>\n\t *\n\t * <p>In the following example, the header's title alignment is set to\n\t * prefer the left side:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * header.titleAlign = HorizontalAlign.LEFT;</listing>\n\t *\n\t * @default feathers.layout.HorizontalAlign.CENTER\n\t *\n\t * @see feathers.layout.HorizontalAlign#CENTER\n\t * @see feathers.layout.HorizontalAlign#LEFT\n\t * @see feathers.layout.HorizontalAlign#RIGHT\n\t */\n\t[Style(name=\"titleAlign\",type=\"String\")]\n\n\t/**\n\t * Space, in pixels, between the title and the left or right groups of\n\t * items. If <code>NaN</code> (the default), the default <code>gap</code>\n\t * property is used instead.\n\t *\n\t * <p>In the following example, the header's title gap is set to 20\n\t * pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * header.titleGap = 20;</listing>\n\t *\n\t * @default NaN\n\t *\n\t * @see #style:gap\n\t */\n\t[Style(name=\"titleGap\",type=\"Number\")]\n\n\t/**\n\t * If enabled, the header's top padding will be increased to account for\n\t * the height of the OS status bar when the app is rendered under the OS\n\t * status bar. The header will not add extra padding to apps that aren't\n\t * rendered under the OS status bar.\n\t *\n\t * <p>iOS started rendering apps that aren't full screen under the OS\n\t * status bar in version 7.</p>\n\t *\n\t * <p>In the following example, the header's padding will account for\n\t * the iOS status bar height:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * header.useExtraPaddingForOSStatusBar = true;</listing>\n\t *\n\t * @default false;\n\t *\n\t * @see #style:paddingTop\n\t */\n\t[Style(name=\"useExtraPaddingForOSStatusBar\",type=\"Boolean\")]\n\n\t/**\n\t * The alignment of the items vertically, on the y-axis.\n\t *\n\t * <p>In the following example, the header's vertical alignment is set\n\t * to the middle:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * header.verticalAlign = VerticalAlign.MIDDLE;</listing>\n\t *\n\t * @default feathers.layout.VerticalAlign.MIDDLE\n\t *\n\t * @see feathers.layout.VerticalAlign#TOP\n\t * @see feathers.layout.VerticalAlign#MIDDLE\n\t * @see feathers.layout.VerticalAlign#BOTTOM\n\t */\n\t[Style(name=\"verticalAlign\",type=\"String\")]\n\n\t/**\n\t * Determines if the text wraps to the next line when it reaches the\n\t * width (or max width) of the component.\n\t *\n\t * <p>In the following example, the header's title is wrapped:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * header.wordWrap = true;</listing>\n\t *\n\t * @default false\n\t */\n\t[Style(name=\"wordWrap\",type=\"Boolean\")]\n\n\t/**\n\t * A header that displays an optional title along with a horizontal regions\n\t * on the sides for additional UI controls. The left side is typically for\n\t * navigation (to display a back button, for example) and the right for\n\t * additional actions. The title is displayed in the center by default,\n\t * but it may be aligned to the left or right if there are no items on the\n\t * desired side.\n\t *\n\t * <p>In the following example, a header is created, given a title, and a\n\t * back button:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var header:Header = new Header();\n\t * header.title = \"I'm a header\";\n\t * \n\t * var backButton:Button = new Button();\n\t * backButton.label = \"Back\";\n\t * backButton.styleNameList.add( Button.ALTERNATE_STYLE_NAME_BACK_BUTTON );\n\t * backButton.addEventListener( Event.TRIGGERED, backButton_triggeredHandler );\n\t * header.leftItems = new &lt;DisplayObject&gt;[ backButton ];\n\t * \n\t * this.addChild( header );</listing>\n\t *\n\t * @see ../../../help/header.html How to use the Feathers Header component\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class Header extends FeathersControl\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_LEFT_CONTENT:String = \"leftContent\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_RIGHT_CONTENT:String = \"rightContent\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_CENTER_CONTENT:String = \"centerContent\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const IOS_STATUS_BAR_HEIGHT:Number = 20;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const IOS_NOTCH_STATUS_BAR_HEIGHT:Number = 44;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static var iOSStatusBarScaledHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const IOS_NAME_PREFIX:String = \"iOS \";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const OLD_IOS_NAME_PREFIX:String = \"iPhone OS \";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const STATUS_BAR_MIN_IOS_VERSION:int = 7;\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>Header</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the header's\n\t\t * items.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_ITEM:String = \"feathers-header-item\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the\n\t\t * header's title text renderer.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t * @see ../../../help/text-renderers.html Introduction to Feathers text renderers\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_TITLE:String = \"feathers-header-title\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const HELPER_BOUNDS:ViewPortBounds = new ViewPortBounds();\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const HELPER_LAYOUT_RESULT:LayoutBoundsResult = new LayoutBoundsResult();\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function Header()\n\t\t{\n\t\t\tsuper();\n\t\t\tif(this._fontStylesSet === null)\n\t\t\t{\n\t\t\t\tthis._fontStylesSet = new FontStylesSet();\n\t\t\t\tthis._fontStylesSet.addEventListener(Event.CHANGE, fontStyles_changeHandler);\n\t\t\t}\n\t\t\tthis.addEventListener(Event.ADDED_TO_STAGE, header_addedToStageHandler);\n\t\t\tthis.addEventListener(Event.REMOVED_FROM_STAGE, header_removedFromStageHandler);\n\t\t}\n\n\t\t/**\n\t\t * The text renderer for the header's title.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t *\n\t\t * @see #title\n\t\t * @see #titleFactory\n\t\t * @see #createTitle()\n\t\t */\n\t\tprotected var titleTextRenderer:ITextRenderer;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the header's\n\t\t * title text renderer. This variable is <code>protected</code> so that\n\t\t * sub-classes can customize the title text renderer style name in their\n\t\t * constructors instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_TITLE</code>.\n\t\t *\n\t\t * <p>To customize the title text renderer style name without\n\t\t * subclassing, see <code>customTitleStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customTitleStyleName\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var titleStyleName:String = DEFAULT_CHILD_STYLE_NAME_TITLE;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of each of the\n\t\t * header's items. This variable is <code>protected</code> so that\n\t\t * sub-classes can customize the item style name in their constructors\n\t\t * instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_ITEM</code>.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var itemStyleName:String = DEFAULT_CHILD_STYLE_NAME_ITEM;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var leftItemsWidth:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var rightItemsWidth:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t * The layout algorithm. Shared by both sides.\n\t\t */\n\t\tprotected var _layout:HorizontalLayout;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn Header.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _title:String = null;\n\n\t\t/**\n\t\t * The text displayed for the header's title.\n\t\t *\n\t\t * <p>In the following example, the header's title is set:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * header.title = \"I'm a Header\";</listing>\n\t\t *\n\t\t * @default \"\"\n\t\t *\n\t\t * @see #titleFactory\n\t\t */\n\t\tpublic function get title():String\n\t\t{\n\t\t\treturn this._title;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set title(value:String):void\n\t\t{\n\t\t\tif(this._title === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._title = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _titleFactory:Function;\n\n\t\t/**\n\t\t * A function used to instantiate the header's title text renderer\n\t\t * sub-component. By default, the header will use the global text\n\t\t * renderer factory, <code>FeathersControl.defaultTextRendererFactory()</code>,\n\t\t * to create the title text renderer. The title text renderer must be an\n\t\t * instance of <code>ITextRenderer</code>. This factory can be used to\n\t\t * change properties on the title text renderer when it is first\n\t\t * created. For instance, if you are skinning Feathers components\n\t\t * without a theme, you might use this factory to style the title text\n\t\t * renderer.\n\t\t *\n\t\t * <p>If you are not using a theme, the title factory can be used to\n\t\t * provide skin the title with appropriate text styles.</p>\n\t\t *\n\t\t * <p>The factory should have the following function signature:</p>\n\t\t * <pre>function():ITextRenderer</pre>\n\t\t *\n\t\t * <p>In the following example, a custom title factory is passed to the\n\t\t * header:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * header.titleFactory = function():ITextRenderer\n\t\t * {\n\t\t *     var titleRenderer:TextFieldTextRenderer = new TextFieldTextRenderer();\n\t\t *     titleRenderer.textFormat = new TextFormat( \"_sans\", 12, 0xff0000 );\n\t\t *     return titleRenderer;\n\t\t * }</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #title\n\t\t * @see feathers.core.ITextRenderer\n\t\t * @see feathers.core.FeathersControl#defaultTextRendererFactory\n\t\t */\n\t\tpublic function get titleFactory():Function\n\t\t{\n\t\t\treturn this._titleFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set titleFactory(value:Function):void\n\t\t{\n\t\t\tif(this._titleFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._titleFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _disposeItems:Boolean = true;\n\n\t\t/**\n\t\t * Determines if the <code>leftItems</code>, <code>centerItems</code>,\n\t\t * and <code>rightItems</code> are disposed or not when the header is\n\t\t * disposed.\n\t\t *\n\t\t * <p>If you change this value to <code>false</code>, you must dispose\n\t\t * the items manually. Failing to dispose the items may result in a\n\t\t * memory leak.</p>\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic function get disposeItems():Boolean\n\t\t{\n\t\t\treturn this._disposeItems;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disposeItems(value:Boolean):void\n\t\t{\n\t\t\tthis._disposeItems = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _ignoreItemResizing:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _leftItems:Vector.<DisplayObject>;\n\n\t\t/**\n\t\t * The UI controls that appear in the left region of the header.\n\t\t *\n\t\t * <p>If <code>leftItems</code> is not empty, and\n\t\t * <code>titleAlign</code> is <code>HorizontalAlign.LEFT</code>, the\n\t\t * title text renderer will appear to the right of the left items.</p>\n\t\t *\n\t\t * <p>In the following example, a back button is displayed on the left\n\t\t * side of the header:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var backButton:Button = new Button();\n\t\t * backButton.label = \"Back\";\n\t\t * backButton.styleNameList.add( Button.ALTERNATE_STYLE_NAME_BACK_BUTTON );\n\t\t * backButton.addEventListener( Event.TRIGGERED, backButton_triggeredHandler );\n\t\t * header.leftItems = new &lt;DisplayObject&gt;[ backButton ];</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get leftItems():Vector.<DisplayObject>\n\t\t{\n\t\t\treturn this._leftItems;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set leftItems(value:Vector.<DisplayObject>):void\n\t\t{\n\t\t\tif(this._leftItems == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._leftItems)\n\t\t\t{\n\t\t\t\tfor each(var item:DisplayObject in this._leftItems)\n\t\t\t\t{\n\t\t\t\t\tif(item is IFeathersControl)\n\t\t\t\t\t{\n\t\t\t\t\t\tIFeathersControl(item).styleNameList.remove(this.itemStyleName);\n\t\t\t\t\t\titem.removeEventListener(FeathersEventType.RESIZE, item_resizeHandler);\n\t\t\t\t\t}\n\t\t\t\t\titem.removeFromParent();\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._leftItems = value;\n\t\t\tif(this._leftItems)\n\t\t\t{\n\t\t\t\tfor each(item in this._leftItems)\n\t\t\t\t{\n\t\t\t\t\tif(item is IFeathersControl)\n\t\t\t\t\t{\n\t\t\t\t\t\titem.addEventListener(FeathersEventType.RESIZE, item_resizeHandler);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LEFT_CONTENT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _centerItems:Vector.<DisplayObject>;\n\n\t\t/**\n\t\t * The UI controls that appear in the center region of the header. If\n\t\t * <code>centerItems</code> is not empty, and <code>titleAlign</code>\n\t\t * is <code>HorizontalAlign.CENTER</code>, the title text renderer will\n\t\t * be hidden.\n\t\t *\n\t\t * <p>In the following example, a settings button is displayed in the\n\t\t * center of the header:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var settingsButton:Button = new Button();\n\t\t * settingsButton.label = \"Settings\";\n\t\t * settingsButton.addEventListener( Event.TRIGGERED, settingsButton_triggeredHandler );\n\t\t * header.centerItems = new &lt;DisplayObject&gt;[ settingsButton ];</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get centerItems():Vector.<DisplayObject>\n\t\t{\n\t\t\treturn this._centerItems;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set centerItems(value:Vector.<DisplayObject>):void\n\t\t{\n\t\t\tif(this._centerItems == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._centerItems)\n\t\t\t{\n\t\t\t\tfor each(var item:DisplayObject in this._centerItems)\n\t\t\t\t{\n\t\t\t\t\tif(item is IFeathersControl)\n\t\t\t\t\t{\n\t\t\t\t\t\tIFeathersControl(item).styleNameList.remove(this.itemStyleName);\n\t\t\t\t\t\titem.removeEventListener(FeathersEventType.RESIZE, item_resizeHandler);\n\t\t\t\t\t}\n\t\t\t\t\titem.removeFromParent();\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._centerItems = value;\n\t\t\tif(this._centerItems)\n\t\t\t{\n\t\t\t\tfor each(item in this._centerItems)\n\t\t\t\t{\n\t\t\t\t\tif(item is IFeathersControl)\n\t\t\t\t\t{\n\t\t\t\t\t\titem.addEventListener(FeathersEventType.RESIZE, item_resizeHandler);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_CENTER_CONTENT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _rightItems:Vector.<DisplayObject>;\n\n\t\t/**\n\t\t * The UI controls that appear in the right region of the header.\n\t\t *\n\t\t * <p>If <code>rightItems</code> is not empty, and\n\t\t * <code>titleAlign</code> is <code>HorizontalAlign.RIGHT</code>, the\n\t\t * title text renderer will appear to the left of the right items.</p>\n\t\t *\n\t\t * <p>In the following example, a settings button is displayed on the\n\t\t * right side of the header:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var settingsButton:Button = new Button();\n\t\t * settingsButton.label = \"Settings\";\n\t\t * settingsButton.addEventListener( Event.TRIGGERED, settingsButton_triggeredHandler );\n\t\t * header.rightItems = new &lt;DisplayObject&gt;[ settingsButton ];</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get rightItems():Vector.<DisplayObject>\n\t\t{\n\t\t\treturn this._rightItems;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set rightItems(value:Vector.<DisplayObject>):void\n\t\t{\n\t\t\tif(this._rightItems == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._rightItems)\n\t\t\t{\n\t\t\t\tfor each(var item:DisplayObject in this._rightItems)\n\t\t\t\t{\n\t\t\t\t\tif(item is IFeathersControl)\n\t\t\t\t\t{\n\t\t\t\t\t\tIFeathersControl(item).styleNameList.remove(this.itemStyleName);\n\t\t\t\t\t\titem.removeEventListener(FeathersEventType.RESIZE, item_resizeHandler);\n\t\t\t\t\t}\n\t\t\t\t\titem.removeFromParent();\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._rightItems = value;\n\t\t\tif(this._rightItems)\n\t\t\t{\n\t\t\t\tfor each(item in this._rightItems)\n\t\t\t\t{\n\t\t\t\t\tif(item is IFeathersControl)\n\t\t\t\t\t{\n\t\t\t\t\t\titem.addEventListener(FeathersEventType.RESIZE, item_resizeHandler);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_RIGHT_CONTENT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get padding():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set padding(value:Number):void\n\t\t{\n\t\t\tthis.paddingTop = value;\n\t\t\tthis.paddingRight = value;\n\t\t\tthis.paddingBottom = value;\n\t\t\tthis.paddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingTop:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingTop():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingTop(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingTop = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingRight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingRight():Number\n\t\t{\n\t\t\treturn this._paddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingRight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingBottom:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingBottom():Number\n\t\t{\n\t\t\treturn this._paddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingBottom = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingLeft:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingLeft = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _gap:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get gap():Number\n\t\t{\n\t\t\treturn _gap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set gap(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._gap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._gap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _titleGap:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get titleGap():Number\n\t\t{\n\t\t\treturn _titleGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set titleGap(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._titleGap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._titleGap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _useExtraPaddingForOSStatusBar:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get useExtraPaddingForOSStatusBar():Boolean\n\t\t{\n\t\t\treturn this._useExtraPaddingForOSStatusBar;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set useExtraPaddingForOSStatusBar(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._useExtraPaddingForOSStatusBar === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._useExtraPaddingForOSStatusBar = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalAlign:String = VerticalAlign.MIDDLE;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"top,middle,bottom\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get verticalAlign():String\n\t\t{\n\t\t\treturn this._verticalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalAlign(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._verticalAlign === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalAlign = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var currentBackgroundSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMaxWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMaxHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _backgroundSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundSkin():DisplayObject\n\t\t{\n\t\t\treturn this._backgroundSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSkin !== null &&\n\t\t\t\tthis.currentBackgroundSkin === this._backgroundSkin)\n\t\t\t{\n\t\t\t\tthis.removeCurrentBackgroundSkin(this._backgroundSkin);\n\t\t\t\tthis.currentBackgroundSkin = null;\n\t\t\t}\n\t\t\tthis._backgroundSkin = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _backgroundDisabledSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundDisabledSkin():DisplayObject\n\t\t{\n\t\t\treturn this._backgroundDisabledSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundDisabledSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundDisabledSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundDisabledSkin !== null &&\n\t\t\t\tthis.currentBackgroundSkin === this._backgroundDisabledSkin)\n\t\t\t{\n\t\t\t\tthis.removeCurrentBackgroundSkin(this._backgroundDisabledSkin);\n\t\t\t\tthis.currentBackgroundSkin = null;\n\t\t\t}\n\t\t\tthis._backgroundDisabledSkin = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fontStylesSet:FontStylesSet;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get fontStyles():TextFormat\n\t\t{\n\t\t\treturn this._fontStylesSet.format;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set fontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._fontStylesSet.format;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._fontStylesSet.format = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get disabledFontStyles():TextFormat\n\t\t{\n\t\t\treturn this._fontStylesSet.disabledFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disabledFontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._fontStylesSet.disabledFormat;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._fontStylesSet.disabledFormat = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _wordWrap:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get wordWrap():Boolean\n\t\t{\n\t\t\treturn this._wordWrap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set wordWrap(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._wordWrap === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._wordWrap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customTitleStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customTitleStyleName():String\n\t\t{\n\t\t\treturn this._customTitleStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customTitleStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customTitleStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customTitleStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _titleProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the header's title text renderer\n\t\t * sub-component, and the properties will be passed down to the text\n\t\t * renderer when the header validates. The available properties\n\t\t * depend on which <code>ITextRenderer</code> implementation is returned\n\t\t * by <code>textRendererFactory</code>. Refer to\n\t\t * <a href=\"../core/ITextRenderer.html\"><code>feathers.core.ITextRenderer</code></a>\n\t\t * for a list of available text renderer implementations.\n\t\t *\n\t\t * <p>In the following example, some properties are set for the header's\n\t\t * title text renderer (this example assumes that the title text renderer\n\t\t * is a <code>BitmapFontTextRenderer</code>):</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * header.titleProperties.textFormat = new BitmapFontTextFormat( bitmapFont );\n\t\t * header.titleProperties.wordWrap = true;</listing>\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>titleFactory</code> function instead\n\t\t * of using <code>titleProperties</code> will result in better\n\t\t * performance.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #titleFactory\n\t\t * @see feathers.core.ITextRenderer\n\t\t */\n\t\tpublic function get titleProperties():Object\n\t\t{\n\t\t\tif(!this._titleProperties)\n\t\t\t{\n\t\t\t\tthis._titleProperties = new PropertyProxy(titleProperties_onChange);\n\t\t\t}\n\t\t\treturn this._titleProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set titleProperties(value:Object):void\n\t\t{\n\t\t\tif(this._titleProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value && !(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvalue = PropertyProxy.fromObject(value);\n\t\t\t}\n\t\t\tif(this._titleProperties)\n\t\t\t{\n\t\t\t\tthis._titleProperties.removeOnChangeCallback(titleProperties_onChange);\n\t\t\t}\n\t\t\tthis._titleProperties = PropertyProxy(value);\n\t\t\tif(this._titleProperties)\n\t\t\t{\n\t\t\t\tthis._titleProperties.addOnChangeCallback(titleProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _titleAlign:String = HorizontalAlign.CENTER;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"center,left,right\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get titleAlign():String\n\t\t{\n\t\t\treturn this._titleAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set titleAlign(value:String):void\n\t\t{\n\t\t\tif(value === \"preferLeft\")\n\t\t\t{\n\t\t\t\tvalue = HorizontalAlign.LEFT;\n\t\t\t}\n\t\t\telse if(value === \"preferRight\")\n\t\t\t{\n\t\t\t\tvalue = HorizontalAlign.RIGHT;\n\t\t\t}\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._titleAlign === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._titleAlign = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * The number of text lines displayed by the header. The component may\n\t\t * contain multiple text lines if the text contains line breaks or if\n\t\t * the <code>wordWrap</code> property is enabled.\n\t\t *\n\t\t * @see #wordWrap\n\t\t */\n\t\tpublic function get numLines():int\n\t\t{\n\t\t\tif(this.titleTextRenderer === null)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn this.titleTextRenderer.numLines;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//we don't dispose it if the header is the parent because it'll\n\t\t\t//already get disposed in super.dispose()\n\t\t\tif(this._backgroundSkin !== null &&\n\t\t\t\tthis._backgroundSkin.parent !== this)\n\t\t\t{\n\t\t\t\tthis._backgroundSkin.dispose();\n\t\t\t}\n\t\t\tif(this._backgroundDisabledSkin !== null &&\n\t\t\t\tthis._backgroundDisabledSkin.parent !== this)\n\t\t\t{\n\t\t\t\tthis._backgroundDisabledSkin.dispose();\n\t\t\t}\n\t\t\tif(this._disposeItems)\n\t\t\t{\n\t\t\t\tfor each(var item:DisplayObject in this._leftItems)\n\t\t\t\t{\n\t\t\t\t\titem.dispose();\n\t\t\t\t}\n\t\t\t\tfor each(item in this._centerItems)\n\t\t\t\t{\n\t\t\t\t\titem.dispose();\n\t\t\t\t}\n\t\t\t\tfor each(item in this._rightItems)\n\t\t\t\t{\n\t\t\t\t\titem.dispose();\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.leftItems = null;\n\t\t\tthis.rightItems = null;\n\t\t\tthis.centerItems = null;\n\t\t\tif(this._fontStylesSet !== null)\n\t\t\t{\n\t\t\t\tthis._fontStylesSet.dispose();\n\t\t\t\tthis._fontStylesSet = null;\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tif(this._layout === null)\n\t\t\t{\n\t\t\t\tvar layout:HorizontalLayout = new HorizontalLayout();\n\t\t\t\tlayout.useVirtualLayout = false;\n\t\t\t\tlayout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\t\tthis._layout = layout;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar leftContentInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_LEFT_CONTENT);\n\t\t\tvar rightContentInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_RIGHT_CONTENT);\n\t\t\tvar centerContentInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_CENTER_CONTENT);\n\t\t\tvar textRendererInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_TEXT_RENDERER);\n\n\t\t\tif(textRendererInvalid)\n\t\t\t{\n\t\t\t\tthis.createTitle();\n\t\t\t}\n\n\t\t\tif(textRendererInvalid || dataInvalid)\n\t\t\t{\n\t\t\t\tthis.titleTextRenderer.text = this._title;\n\t\t\t}\n\n\t\t\tif(stateInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshBackground();\n\t\t\t}\n\n\t\t\tif(textRendererInvalid || stylesInvalid || sizeInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshLayout();\n\t\t\t}\n\t\t\tif(textRendererInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshTitleStyles();\n\t\t\t}\n\n\t\t\tvar oldIgnoreItemResizing:Boolean = this._ignoreItemResizing;\n\t\t\tthis._ignoreItemResizing = true;\n\t\t\tif(leftContentInvalid)\n\t\t\t{\n\t\t\t\tif(this._leftItems)\n\t\t\t\t{\n\t\t\t\t\tfor each(var item:DisplayObject in this._leftItems)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(item is IFeathersControl)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tIFeathersControl(item).styleNameList.add(this.itemStyleName);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.addChild(item);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(rightContentInvalid)\n\t\t\t{\n\t\t\t\tif(this._rightItems)\n\t\t\t\t{\n\t\t\t\t\tfor each(item in this._rightItems)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(item is IFeathersControl)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tIFeathersControl(item).styleNameList.add(this.itemStyleName);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.addChild(item);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(centerContentInvalid)\n\t\t\t{\n\t\t\t\tif(this._centerItems)\n\t\t\t\t{\n\t\t\t\t\tfor each(item in this._centerItems)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(item is IFeathersControl)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tIFeathersControl(item).styleNameList.add(this.itemStyleName);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.addChild(item);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._ignoreItemResizing = oldIgnoreItemResizing;\n\n\t\t\tif(stateInvalid || textRendererInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshEnabled();\n\t\t\t}\n\n\t\t\tsizeInvalid = this.autoSizeIfNeeded() || sizeInvalid;\n\n\t\t\tthis.layoutBackground();\n\n\t\t\tif(sizeInvalid || leftContentInvalid || rightContentInvalid || centerContentInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.leftItemsWidth = 0;\n\t\t\t\tthis.rightItemsWidth = 0;\n\t\t\t\tif(this._leftItems)\n\t\t\t\t{\n\t\t\t\t\tthis.layoutLeftItems();\n\t\t\t\t}\n\t\t\t\tif(this._rightItems)\n\t\t\t\t{\n\t\t\t\t\tthis.layoutRightItems();\n\t\t\t\t}\n\t\t\t\tif(this._centerItems)\n\t\t\t\t{\n\t\t\t\t\tthis.layoutCenterItems();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(textRendererInvalid || sizeInvalid || stylesInvalid || dataInvalid || leftContentInvalid || rightContentInvalid || centerContentInvalid)\n\t\t\t{\n\t\t\t\tthis.layoutTitle();\n\t\t\t}\n\n\t\t}\n\n\t\t/**\n\t\t * If the component's dimensions have not been set explicitly, it will\n\t\t * measure its content and determine an ideal size for itself. If the\n\t\t * <code>explicitWidth</code> or <code>explicitHeight</code> member\n\t\t * variables are set, those value will be used without additional\n\t\t * measurement. If one is set, but not the other, the dimension with the\n\t\t * explicit value will not be measured, but the other non-explicit\n\t\t * dimension will still need measurement.\n\t\t *\n\t\t * <p>Calls <code>saveMeasurements()</code> to set up the\n\t\t * <code>actualWidth</code> and <code>actualHeight</code> member\n\t\t * variables used for layout.</p>\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t */\n\t\tprotected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tresetFluidChildDimensionsForMeasurement(this.currentBackgroundSkin,\n\t\t\t\tthis._explicitWidth, this._explicitHeight,\n\t\t\t\tthis._explicitMinWidth, this._explicitMinHeight,\n\t\t\t\tthis._explicitMaxWidth, this._explicitMaxHeight,\n\t\t\t\tthis._explicitBackgroundWidth, this._explicitBackgroundHeight,\n\t\t\t\tthis._explicitBackgroundMinWidth, this._explicitBackgroundMinHeight,\n\t\t\t\tthis._explicitBackgroundMaxWidth, this._explicitBackgroundMaxHeight);\n\t\t\tvar measureSkin:IMeasureDisplayObject = this.currentBackgroundSkin as IMeasureDisplayObject;\n\t\t\tif(this.currentBackgroundSkin is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.currentBackgroundSkin).validate();\n\t\t\t}\n\n\t\t\tvar extraPaddingTop:Number = this.calculateExtraOSStatusBarPadding();\n\n\t\t\tvar totalContentWidth:Number = 0;\n\t\t\tvar maxContentHeight:Number = 0;\n\t\t\tvar hasLeftItems:Boolean = this._leftItems !== null && this._leftItems.length > 0;\n\t\t\tvar hasRightItems:Boolean = this._rightItems !== null && this._rightItems.length > 0;\n\t\t\tvar hasCenterItems:Boolean = this._centerItems !== null && this._centerItems.length > 0;\n\t\t\tvar oldIgnoreItemResizing:Boolean = this._ignoreItemResizing;\n\t\t\tthis._ignoreItemResizing = true;\n\t\t\tif(hasLeftItems)\n\t\t\t{\n\t\t\t\tvar itemCount:int = this._leftItems.length;\n\t\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar item:DisplayObject = this._leftItems[i];\n\t\t\t\t\tif(item is IValidating)\n\t\t\t\t\t{\n\t\t\t\t\t\tIValidating(item).validate();\n\t\t\t\t\t}\n\t\t\t\t\tvar itemWidth:Number = item.width;\n\t\t\t\t\tif(itemWidth === itemWidth) //!isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\ttotalContentWidth += itemWidth;\n\t\t\t\t\t\tif(i > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttotalContentWidth += this._gap;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tvar itemHeight:Number = item.height;\n\t\t\t\t\tif(itemHeight === itemHeight && //!isNaN\n\t\t\t\t\t\titemHeight > maxContentHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tmaxContentHeight = itemHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(hasCenterItems)\n\t\t\t{\n\t\t\t\titemCount = this._centerItems.length;\n\t\t\t\tfor(i = 0; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\titem = this._centerItems[i];\n\t\t\t\t\tif(item is IValidating)\n\t\t\t\t\t{\n\t\t\t\t\t\tIValidating(item).validate();\n\t\t\t\t\t}\n\t\t\t\t\titemWidth = item.width;\n\t\t\t\t\tif(itemWidth === itemWidth) //!isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\ttotalContentWidth += itemWidth;\n\t\t\t\t\t\tif(i > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttotalContentWidth += this._gap;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\titemHeight = item.height;\n\t\t\t\t\tif(itemHeight === itemHeight && //!isNaN\n\t\t\t\t\t\titemHeight > maxContentHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tmaxContentHeight = itemHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(hasRightItems)\n\t\t\t{\n\t\t\t\titemCount = this._rightItems.length;\n\t\t\t\tfor(i = 0; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\titem = this._rightItems[i];\n\t\t\t\t\tif(item is IValidating)\n\t\t\t\t\t{\n\t\t\t\t\t\tIValidating(item).validate();\n\t\t\t\t\t}\n\t\t\t\t\titemWidth = item.width;\n\t\t\t\t\tif(itemWidth === itemWidth) //!isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\ttotalContentWidth += itemWidth;\n\t\t\t\t\t\tif(i > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttotalContentWidth += this._gap;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\titemHeight = item.height;\n\t\t\t\t\tif(itemHeight === itemHeight && //!isNaN\n\t\t\t\t\t\titemHeight > maxContentHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tmaxContentHeight = itemHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._ignoreItemResizing = oldIgnoreItemResizing;\n\n\t\t\tif(this._titleAlign === HorizontalAlign.CENTER && hasCenterItems)\n\t\t\t{\n\t\t\t\tif(hasLeftItems)\n\t\t\t\t{\n\t\t\t\t\ttotalContentWidth += this._gap;\n\t\t\t\t}\n\t\t\t\tif(hasRightItems)\n\t\t\t\t{\n\t\t\t\t\ttotalContentWidth += this._gap;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(this._title !== null)\n\t\t\t{\n\t\t\t\tvar calculatedTitleGap:Number = this._titleGap;\n\t\t\t\tif(calculatedTitleGap !== calculatedTitleGap) //isNaN\n\t\t\t\t{\n\t\t\t\t\tcalculatedTitleGap = this._gap;\n\t\t\t\t}\n\t\t\t\tvar maxTitleWidth:Number = this._explicitWidth;\n\t\t\t\tif(needsWidth)\n\t\t\t\t{\n\t\t\t\t\tmaxTitleWidth = this._explicitMaxWidth;\n\t\t\t\t}\n\t\t\t\tmaxTitleWidth -= totalContentWidth;\n\t\t\t\tif(hasLeftItems)\n\t\t\t\t{\n\t\t\t\t\tmaxTitleWidth -= calculatedTitleGap;\n\t\t\t\t}\n\t\t\t\tif(hasCenterItems)\n\t\t\t\t{\n\t\t\t\t\tmaxTitleWidth -= calculatedTitleGap;\n\t\t\t\t}\n\t\t\t\tif(hasRightItems)\n\t\t\t\t{\n\t\t\t\t\tmaxTitleWidth -= calculatedTitleGap;\n\t\t\t\t}\n\t\t\t\tif(maxTitleWidth < 0)\n\t\t\t\t{\n\t\t\t\t\tmaxTitleWidth = 0;\n\t\t\t\t}\n\t\t\t\tthis.titleTextRenderer.maxWidth = maxTitleWidth;\n\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\tthis.titleTextRenderer.measureText(point);\n\t\t\t\tvar measuredTitleWidth:Number = point.x;\n\t\t\t\tvar measuredTitleHeight:Number = point.y;\n\t\t\t\tPool.putPoint(point);\n\t\t\t\tif(measuredTitleWidth === measuredTitleWidth) //!isNaN\n\t\t\t\t{\n\t\t\t\t\tif(hasLeftItems)\n\t\t\t\t\t{\n\t\t\t\t\t\tmeasuredTitleWidth += calculatedTitleGap;\n\t\t\t\t\t}\n\t\t\t\t\tif(hasRightItems)\n\t\t\t\t\t{\n\t\t\t\t\t\tmeasuredTitleWidth += calculatedTitleGap;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tmeasuredTitleWidth = 0;\n\t\t\t\t}\n\t\t\t\ttotalContentWidth += measuredTitleWidth;\n\t\t\t\tif(measuredTitleHeight === measuredTitleHeight && //!isNaN\n\t\t\t\t\tmeasuredTitleHeight > maxContentHeight)\n\t\t\t\t{\n\t\t\t\t\tmaxContentHeight = measuredTitleHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tnewWidth = totalContentWidth + this._paddingLeft + this._paddingRight;\n\t\t\t\tif(this.currentBackgroundSkin !== null &&\n\t\t\t\t\tthis.currentBackgroundSkin.width > newWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this.currentBackgroundSkin.width;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tnewHeight = maxContentHeight;\n\t\t\t\tnewHeight += this._paddingTop + this._paddingBottom;\n\t\t\t\tif(this.currentBackgroundSkin !== null &&\n\t\t\t\t\tthis.currentBackgroundSkin.height > newHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this.currentBackgroundSkin.height;\n\t\t\t\t}\n\t\t\t\t//normally, padding is included before before the background\n\t\t\t\t//skin's dimensions, but this is special extra padding that\n\t\t\t\t//should simply be added on top of the normal measurement. if\n\t\t\t\t//the explicit height of the background is large enough, this\n\t\t\t\t//extra padding could be swallowed instead.\n\t\t\t\tif(extraPaddingTop > 0)\n\t\t\t\t{\n\t\t\t\t\t//account for the minimum height before adding the padding\n\t\t\t\t\tif(newHeight < this._explicitMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewHeight = this._explicitMinHeight;\n\t\t\t\t\t}\n\t\t\t\t\tnewHeight += extraPaddingTop;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tnewMinWidth = totalContentWidth + this._paddingLeft + this._paddingRight;\n\t\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(measureSkin !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(measureSkin.minWidth > newMinWidth)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinWidth = measureSkin.minWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._explicitBackgroundMinWidth > newMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = this._explicitBackgroundMinWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tnewMinHeight = maxContentHeight;\n\t\t\t\tnewMinHeight += this._paddingTop + this._paddingBottom;\n\t\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(measureSkin !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(measureSkin.minHeight > newMinHeight)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinHeight = measureSkin.minHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._explicitBackgroundMinHeight > newMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = this._explicitBackgroundMinHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//set note above about why the extra padding is included after\n\t\t\t\t//the background skin\n\t\t\t\tif(extraPaddingTop > 0)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight += extraPaddingTop;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>titleTextRenderer</code> sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #title\n\t\t * @see #titleTextRenderer\n\t\t * @see #titleFactory\n\t\t */\n\t\tprotected function createTitle():void\n\t\t{\n\t\t\tif(this.titleTextRenderer)\n\t\t\t{\n\t\t\t\tthis.removeChild(DisplayObject(this.titleTextRenderer), true);\n\t\t\t\tthis.titleTextRenderer = null;\n\t\t\t}\n\n\t\t\tvar factory:Function = this._titleFactory != null ? this._titleFactory : FeathersControl.defaultTextRendererFactory;\n\t\t\tthis.titleTextRenderer = ITextRenderer(factory());\n\t\t\tvar uiTitleRenderer:IFeathersControl = IFeathersControl(this.titleTextRenderer);\n\t\t\tvar titleStyleName:String = this._customTitleStyleName != null ? this._customTitleStyleName : this.titleStyleName;\n\t\t\tuiTitleRenderer.styleNameList.add(titleStyleName);\n\t\t\tthis.addChild(DisplayObject(uiTitleRenderer));\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshBackground():void\n\t\t{\n\t\t\tvar oldBackgroundSkin:DisplayObject = this.currentBackgroundSkin;\n\t\t\tthis.currentBackgroundSkin = this._backgroundSkin;\n\t\t\tif(!this._isEnabled && this._backgroundDisabledSkin !== null)\n\t\t\t{\n\t\t\t\tthis.currentBackgroundSkin = this._backgroundDisabledSkin;\n\t\t\t}\n\t\t\tif(this.currentBackgroundSkin !== oldBackgroundSkin)\n\t\t\t{\n\t\t\t\tthis.removeCurrentBackgroundSkin(oldBackgroundSkin);\n\t\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(this.currentBackgroundSkin is IFeathersControl)\n\t\t\t\t\t{\n\t\t\t\t\t\tIFeathersControl(this.currentBackgroundSkin).initializeNow();\n\t\t\t\t\t}\n\t\t\t\t\tif(this.currentBackgroundSkin is IMeasureDisplayObject)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar measureSkin:IMeasureDisplayObject = IMeasureDisplayObject(this.currentBackgroundSkin);\n\t\t\t\t\t\tthis._explicitBackgroundWidth = measureSkin.explicitWidth;\n\t\t\t\t\t\tthis._explicitBackgroundHeight = measureSkin.explicitHeight;\n\t\t\t\t\t\tthis._explicitBackgroundMinWidth = measureSkin.explicitMinWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMinHeight = measureSkin.explicitMinHeight;\n\t\t\t\t\t\tthis._explicitBackgroundMaxWidth = measureSkin.explicitMaxWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMaxHeight = measureSkin.explicitMaxHeight;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._explicitBackgroundWidth = this.currentBackgroundSkin.width;\n\t\t\t\t\t\tthis._explicitBackgroundHeight = this.currentBackgroundSkin.height;\n\t\t\t\t\t\tthis._explicitBackgroundMinWidth = this._explicitBackgroundWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMinHeight = this._explicitBackgroundHeight;\n\t\t\t\t\t\tthis._explicitBackgroundMaxWidth = this._explicitBackgroundWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMaxHeight = this._explicitBackgroundHeight;\n\t\t\t\t\t}\n\t\t\t\t\tthis.addChildAt(this.currentBackgroundSkin, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function removeCurrentBackgroundSkin(skin:DisplayObject):void\n\t\t{\n\t\t\tif(skin === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(skin.parent === this)\n\t\t\t{\n\t\t\t\t//we need to restore these values so that they won't be lost the\n\t\t\t\t//next time that this skin is used for measurement\n\t\t\t\tskin.width = this._explicitBackgroundWidth;\n\t\t\t\tskin.height = this._explicitBackgroundHeight;\n\t\t\t\tif(skin is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar measureSkin:IMeasureDisplayObject = IMeasureDisplayObject(skin);\n\t\t\t\t\tmeasureSkin.minWidth = this._explicitBackgroundMinWidth;\n\t\t\t\t\tmeasureSkin.minHeight = this._explicitBackgroundMinHeight;\n\t\t\t\t\tmeasureSkin.maxWidth = this._explicitBackgroundMaxWidth;\n\t\t\t\t\tmeasureSkin.maxHeight = this._explicitBackgroundMaxHeight;\n\t\t\t\t}\n\t\t\t\tskin.removeFromParent(false);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshLayout():void\n\t\t{\n\t\t\tthis._layout.gap = this._gap;\n\t\t\tthis._layout.paddingTop = this._paddingTop + this.calculateExtraOSStatusBarPadding();\n\t\t\tthis._layout.paddingBottom = this._paddingBottom;\n\t\t\tthis._layout.verticalAlign = this._verticalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshEnabled():void\n\t\t{\n\t\t\tthis.titleTextRenderer.isEnabled = this._isEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshTitleStyles():void\n\t\t{\n\t\t\tthis.titleTextRenderer.fontStyles = this._fontStylesSet;\n\t\t\tthis.titleTextRenderer.wordWrap = this._wordWrap;\n\t\t\tfor(var propertyName:String in this._titleProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._titleProperties[propertyName];\n\t\t\t\tthis.titleTextRenderer[propertyName] = propertyValue;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function calculateExtraOSStatusBarPadding():Number\n\t\t{\n\t\t\tif(!this._useExtraPaddingForOSStatusBar)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t//first, we check if it's iOS or not. at this time, we only need to\n\t\t\t//use extra padding on iOS. android and others are fine.\n\t\t\tvar os:String = Capabilities.os;\n\t\t\tif(os.indexOf(IOS_NAME_PREFIX) != -1)\n\t\t\t{\n\t\t\t\tos = os.substring(IOS_NAME_PREFIX.length, os.indexOf(\".\"));\n\t\t\t}\n\t\t\telse if(os.indexOf(OLD_IOS_NAME_PREFIX) != -1)\n\t\t\t{\n\t\t\t\tos = os.substring(OLD_IOS_NAME_PREFIX.length, os.indexOf(\".\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t//then, we check the major version of iOS. the extra padding is not\n\t\t\t//required before version 7.\n\t\t\t//the version string will always contain major and minor values, so\n\t\t\t//search for the first . character.\n\t\t\tif(parseInt(os, 10) < STATUS_BAR_MIN_IOS_VERSION)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t//next, we check if the app is full screen or not. if it is full\n\t\t\t//screen, then the status bar isn't visible, and we don't need the\n\t\t\t//extra padding.\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar nativeStage:Stage = starling.nativeStage;\n\t\t\tif(nativeStage.displayState !== StageDisplayState.NORMAL)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\t//this value only needs to be calculated once\n\t\t\tif(iOSStatusBarScaledHeight !== iOSStatusBarScaledHeight) //isNaN\n\t\t\t{\n\t\t\t\t//uses the same mechanism as ScreenDensityScaleFactorManager,\n\t\t\t\t//but uses different density values\n\t\t\t\tvar scaleSelector:ScreenDensityScaleCalculator = new ScreenDensityScaleCalculator();\n\t\t\t\tscaleSelector.addScaleForDensity(168, 1); //original\n\t\t\t\tscaleSelector.addScaleForDensity(326, 2); //retina\n\t\t\t\tscaleSelector.addScaleForDensity(401, 3); //retina HD\n\t\t\t\tif(this.hasNotch())\n\t\t\t\t{\n\t\t\t\t\tiOSStatusBarScaledHeight = IOS_NOTCH_STATUS_BAR_HEIGHT * scaleSelector.getScale(DeviceCapabilities.dpi);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tiOSStatusBarScaledHeight = IOS_STATUS_BAR_HEIGHT * scaleSelector.getScale(DeviceCapabilities.dpi);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//while it probably won't change, contentScaleFactor shouldn't be\n\t\t\t//considered constant, so do this calculation every time\n\t\t\treturn iOSStatusBarScaledHeight / starling.contentScaleFactor;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function hasNotch():Boolean\n\t\t{\n\t\t\t//this is not an ideal way to detect the status bar height\n\t\t\t//because future devices will need to be added to this list\n\t\t\t//manually!\n\t\t\tvar osString:String = Capabilities.os;\n\t\t\tvar notchIDs:Vector.<String> = new <String>[\n\t\t\t\t\"iPhone10,3\", //iPhone X\n\t\t\t\t\"iPhone10,6\", //iPhone X\n\t\t\t\t\"iPhone11,2\", //iPhone XS\n\t\t\t\t\"iPhone11,4\", //iPhone XS Max\n\t\t\t\t\"iPhone11,6\", //iPhone XS Max\n\t\t\t\t\"iPhone11,8\", //iPhone XR\n\t\t\t];\n\t\t\tvar idCount:int = notchIDs.length;\n\t\t\tfor(var i:int = 0; i < idCount; i++)\n\t\t\t{\n\t\t\t\tvar id:String = notchIDs[i];\n\t\t\t\tvar index:int = osString.lastIndexOf(id);\n\t\t\t\tif(index != -1 && index == osString.length - id.length)\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutBackground():void\n\t\t{\n\t\t\tif(!this.currentBackgroundSkin)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.currentBackgroundSkin.width = this.actualWidth;\n\t\t\tthis.currentBackgroundSkin.height = this.actualHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutLeftItems():void\n\t\t{\n\t\t\tfor each(var item:DisplayObject in this._leftItems)\n\t\t\t{\n\t\t\t\tif(item is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(item).validate();\n\t\t\t\t}\n\t\t\t}\n\t\t\tHELPER_BOUNDS.x = HELPER_BOUNDS.y = 0;\n\t\t\tHELPER_BOUNDS.scrollX = HELPER_BOUNDS.scrollY = 0;\n\t\t\tHELPER_BOUNDS.explicitWidth = this.actualWidth;\n\t\t\tHELPER_BOUNDS.explicitHeight = this.actualHeight;\n\t\t\tthis._layout.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tthis._layout.paddingRight = 0;\n\t\t\tthis._layout.paddingLeft = this._paddingLeft;\n\t\t\tthis._layout.layout(this._leftItems, HELPER_BOUNDS, HELPER_LAYOUT_RESULT);\n\t\t\tthis.leftItemsWidth = HELPER_LAYOUT_RESULT.contentWidth;\n\t\t\tif(this.leftItemsWidth !== this.leftItemsWidth) //isNaN\n\t\t\t{\n\t\t\t\tthis.leftItemsWidth = 0;\n\t\t\t}\n\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutRightItems():void\n\t\t{\n\t\t\tfor each(var item:DisplayObject in this._rightItems)\n\t\t\t{\n\t\t\t\tif(item is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(item).validate();\n\t\t\t\t}\n\t\t\t}\n\t\t\tHELPER_BOUNDS.x = HELPER_BOUNDS.y = 0;\n\t\t\tHELPER_BOUNDS.scrollX = HELPER_BOUNDS.scrollY = 0;\n\t\t\tHELPER_BOUNDS.explicitWidth = this.actualWidth;\n\t\t\tHELPER_BOUNDS.explicitHeight = this.actualHeight;\n\t\t\tthis._layout.horizontalAlign = HorizontalAlign.RIGHT;\n\t\t\tthis._layout.paddingRight = this._paddingRight;\n\t\t\tthis._layout.paddingLeft = 0;\n\t\t\tthis._layout.layout(this._rightItems, HELPER_BOUNDS, HELPER_LAYOUT_RESULT);\n\t\t\tthis.rightItemsWidth = HELPER_LAYOUT_RESULT.contentWidth;\n\t\t\tif(this.rightItemsWidth !== this.rightItemsWidth) //isNaN\n\t\t\t{\n\t\t\t\tthis.rightItemsWidth = 0;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutCenterItems():void\n\t\t{\n\t\t\tfor each(var item:DisplayObject in this._centerItems)\n\t\t\t{\n\t\t\t\tif(item is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(item).validate();\n\t\t\t\t}\n\t\t\t}\n\t\t\tHELPER_BOUNDS.x = HELPER_BOUNDS.y = 0;\n\t\t\tHELPER_BOUNDS.scrollX = HELPER_BOUNDS.scrollY = 0;\n\t\t\tHELPER_BOUNDS.explicitWidth = this.actualWidth;\n\t\t\tHELPER_BOUNDS.explicitHeight = this.actualHeight;\n\t\t\tthis._layout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tthis._layout.paddingRight = this._paddingRight;\n\t\t\tthis._layout.paddingLeft = this._paddingLeft;\n\t\t\tthis._layout.layout(this._centerItems, HELPER_BOUNDS, HELPER_LAYOUT_RESULT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutTitle():void\n\t\t{\n\t\t\tvar hasLeftItems:Boolean = this._leftItems !== null && this._leftItems.length > 0;\n\t\t\tvar hasRightItems:Boolean = this._rightItems !== null && this._rightItems.length > 0;\n\t\t\tvar hasCenterItems:Boolean = this._centerItems !== null && this._centerItems.length > 0;\n\t\t\tif(this._titleAlign === HorizontalAlign.CENTER && hasCenterItems)\n\t\t\t{\n\t\t\t\tthis.titleTextRenderer.visible = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._titleAlign === HorizontalAlign.LEFT && hasLeftItems && hasCenterItems)\n\t\t\t{\n\t\t\t\tthis.titleTextRenderer.visible = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._titleAlign === HorizontalAlign.RIGHT && hasRightItems && hasCenterItems)\n\t\t\t{\n\t\t\t\tthis.titleTextRenderer.visible = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.titleTextRenderer.visible = true;\n\t\t\tvar calculatedTitleGap:Number = this._titleGap;\n\t\t\tif(calculatedTitleGap !== calculatedTitleGap) //isNaN\n\t\t\t{\n\t\t\t\tcalculatedTitleGap = this._gap;\n\t\t\t}\n\t\t\tvar leftOffset:Number = this._paddingLeft;\n\t\t\tif(hasLeftItems)\n\t\t\t{\n\t\t\t\t//leftItemsWidth already includes padding\n\t\t\t\tleftOffset = this.leftItemsWidth + calculatedTitleGap;\n\t\t\t}\n\t\t\tvar rightOffset:Number = this._paddingRight;\n\t\t\tif(hasRightItems)\n\t\t\t{\n\t\t\t\t//rightItemsWidth already includes padding\n\t\t\t\trightOffset = this.rightItemsWidth + calculatedTitleGap;\n\t\t\t}\n\t\t\tif(this._titleAlign === HorizontalAlign.LEFT)\n\t\t\t{\n\t\t\t\tvar titleMaxWidth:Number = this.actualWidth - leftOffset - rightOffset;\n\t\t\t\tif(titleMaxWidth < 0)\n\t\t\t\t{\n\t\t\t\t\ttitleMaxWidth = 0;\n\t\t\t\t}\n\t\t\t\tthis.titleTextRenderer.maxWidth = titleMaxWidth;\n\t\t\t\tthis.titleTextRenderer.validate();\n\t\t\t\tthis.titleTextRenderer.x = leftOffset;\n\t\t\t}\n\t\t\telse if(this._titleAlign === HorizontalAlign.RIGHT)\n\t\t\t{\n\t\t\t\ttitleMaxWidth = this.actualWidth - leftOffset - rightOffset;\n\t\t\t\tif(titleMaxWidth < 0)\n\t\t\t\t{\n\t\t\t\t\ttitleMaxWidth = 0;\n\t\t\t\t}\n\t\t\t\tthis.titleTextRenderer.maxWidth = titleMaxWidth;\n\t\t\t\tthis.titleTextRenderer.validate();\n\t\t\t\tthis.titleTextRenderer.x = this.actualWidth - this.titleTextRenderer.width - rightOffset;\n\t\t\t}\n\t\t\telse //center\n\t\t\t{\n\t\t\t\tvar actualWidthMinusPadding:Number = this.actualWidth - this._paddingLeft - this._paddingRight;\n\t\t\t\tif(actualWidthMinusPadding < 0)\n\t\t\t\t{\n\t\t\t\t\tactualWidthMinusPadding = 0;\n\t\t\t\t}\n\t\t\t\tvar actualWidthMinusOffsets:Number = this.actualWidth - leftOffset - rightOffset;\n\t\t\t\tif(actualWidthMinusOffsets < 0)\n\t\t\t\t{\n\t\t\t\t\tactualWidthMinusOffsets = 0;\n\t\t\t\t}\n\t\t\t\tthis.titleTextRenderer.maxWidth = actualWidthMinusOffsets;\n\t\t\t\tthis.titleTextRenderer.validate();\n\t\t\t\t//we try to keep the title centered between the paddings, if\n\t\t\t\t//possible. however, if the combined width of the left or right\n\t\t\t\t//items is too large to allow that, we center between the items.\n\t\t\t\t//this seems to match the behavior on iOS.\n\t\t\t\tvar idealTitlePosition:Number = this._paddingLeft + Math.round((actualWidthMinusPadding - this.titleTextRenderer.width) / 2);\n\t\t\t\tif(leftOffset > idealTitlePosition ||\n\t\t\t\t\t(idealTitlePosition + this.titleTextRenderer.width) > (this.actualWidth - rightOffset))\n\t\t\t\t{\n\t\t\t\t\tthis.titleTextRenderer.x = leftOffset + Math.round((actualWidthMinusOffsets - this.titleTextRenderer.width) / 2);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.titleTextRenderer.x = idealTitlePosition;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar paddingTop:Number = this._paddingTop + this.calculateExtraOSStatusBarPadding();\n\t\t\tswitch(this._verticalAlign)\n\t\t\t{\n\t\t\t\tcase VerticalAlign.TOP:\n\t\t\t\t{\n\t\t\t\t\tthis.titleTextRenderer.y = paddingTop;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase VerticalAlign.BOTTOM:\n\t\t\t\t{\n\t\t\t\t\tthis.titleTextRenderer.y = this.actualHeight - this._paddingBottom - this.titleTextRenderer.height;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: //center\n\t\t\t\t{\n\t\t\t\t\tthis.titleTextRenderer.y = paddingTop + Math.round((this.actualHeight - paddingTop - this._paddingBottom - this.titleTextRenderer.height) / 2);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function header_addedToStageHandler(event:Event):void\n\t\t{\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tstarling.nativeStage.addEventListener(\"fullScreen\", nativeStage_fullScreenHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function header_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tstarling.nativeStage.removeEventListener(\"fullScreen\", nativeStage_fullScreenHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function nativeStage_fullScreenHandler(event:FullScreenEvent):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function fontStyles_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function titleProperties_onChange(proxy:PropertyProxy, propertyName:String):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function item_resizeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreItemResizing)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/IDirectionalScrollBar.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\t/**\n\t * A scroll bar that supports both horizontal or vertical orientations. The\n\t * <code>feathers.controls.Scroller</code> class (and all subclasses) will\n\t * automatically set the <code>direction</code> property when an\n\t * <code>IDirectionalScrollBar</code> is returned by its scroll bar\n\t * factories.\n\t *\n\t * @productversion Feathers 2.0.0\n\t */\n\tpublic interface IDirectionalScrollBar extends IScrollBar\n\t{\n\t\t/**\n\t\t * The direction of the scroll bar, either horizontal or vertical.\n\t\t *\n\t\t * @see feathers.layout.Direction#HORIZONTAL\n\t\t * @see feathers.layout.Direction#VERTICAL\n\t\t */\n\t\tfunction get direction():String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set direction(value:String):void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/IRange.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.core.IFeathersControl;\n\n\t/**\n\t * Dispatched when the value changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #value\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * A UI component that displays a range of values from a minimum to a maximum.\n\t *\n\t * @productversion Feathers 1.3.0\n\t */\n\tpublic interface IRange extends IFeathersControl\n\t{\n\t\t/**\n\t\t * The minimum numeric value of the range.\n\t\t *\n\t\t * <p>In the following example, the minimum is changed to 0:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * component.minimum = 0;\n\t\t * component.maximum = 100;\n\t\t * component.step = 1;\n\t\t * component.page = 10\n\t\t * component.value = 12;</listing>\n\t\t */\n\t\tfunction get minimum():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set minimum(value:Number):void;\n\n\t\t/**\n\t\t * The maximum numeric value of the range.\n\t\t *\n\t\t * <p>In the following example, the maximum is changed to 100:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * component.minimum = 0;\n\t\t * component.maximum = 100;\n\t\t * component.step = 1;\n\t\t * component.page = 10\n\t\t * component.value = 12;</listing>\n\t\t */\n\t\tfunction get maximum():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set maximum(value:Number):void;\n\n\t\t/**\n\t\t * The current numeric value.\n\t\t *\n\t\t * <p>In the following example, the value is changed to 12:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * component.minimum = 0;\n\t\t * component.maximum = 100;\n\t\t * component.step = 1;\n\t\t * component.page = 10\n\t\t * component.value = 12;</listing>\n\t\t */\n\t\tfunction get value():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set value(value:Number):void;\n\n\t\t/**\n\t\t * The amount the value must change to increment or decrement.\n\t\t *\n\t\t * <p>In the following example, the step is changed to 1:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * component.minimum = 0;\n\t\t * component.maximum = 100;\n\t\t * component.step = 1;\n\t\t * component.page = 10\n\t\t * component.value = 12;</listing>\n\t\t */\n\t\tfunction get step():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set step(value:Number):void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/IScreen.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.core.IFeathersControl;\n\n\t/**\n\t * A screen to display in a screen navigator.\n\t *\n\t * @see feathers.controls.StackScreenNavigator\n\t * @see feathers.controls.ScreenNavigator\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic interface IScreen extends IFeathersControl\n\t{\n\t\t/**\n\t\t * The identifier for the screen. This value is passed in by the\n\t\t * <code>ScreenNavigator</code> when the screen is instantiated.\n\t\t */\n\t\tfunction get screenID():String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set screenID(value:String):void;\n\n\t\t/**\n\t\t * The screen navigator that is currently displaying this screen.\n\t\t */\n\t\tfunction get owner():Object;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set owner(value:Object):void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/IScrollBar.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\t/**\n\t * Dispatched when the scroll bar's value changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #value\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Minimum requirements for a scroll bar to be usable with a <code>Scroller</code>\n\t * component.\n\t *\n\t * @see Scroller\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic interface IScrollBar extends IRange\n\t{\n\t\t/**\n\t\t * The amount the scroll bar value must change to get from one \"page\" to\n\t\t * the next.\n\t\t *\n\t\t * <p>If this value is <code>0</code>, the <code>step</code> value\n\t\t * will be used instead. If the <code>step</code> value is\n\t\t * <code>0</code>, paging is not possible.</p>\n\t\t *\n\t\t * <p>In the following example, the page is changed to 10:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scrollBar.minimum = 0;\n\t\t * scrollBar.maximum = 100;\n\t\t * scrollBar.step = 1;\n\t\t * scrollBar.page = 10\n\t\t * scrollBar.value = 12;</listing>\n\t\t */\n\t\tfunction get page():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set page(value:Number):void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/IScrollContainer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.core.IFeathersControl;\n\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * Defines functions for a <code>Scroller</code> subclass that delegates\n\t * display list manipulations to its <code>IViewPort</code>.\n\t *\n\t * <p>Mainly intended for <code>ScrollContainer</code>, but other subclasses\n\t * of <code>Scroller</code> could possibly implement it too.</p>\n\t *\n\t * @see feathers.controls.Scroller\n\t * @see feathers.controls.ScrollContainer\n\t *\n\t * @productversion Feathers 1.3.0\n\t */\n\tpublic interface IScrollContainer extends IFeathersControl\n\t{\n\t\t/**\n\t\t * Returns the number of raw children that are added directly to the\n\t\t * <code>Scroller</code> rather than delegating the call to the view\n\t\t * port.\n\t\t */\n\t\tfunction get numRawChildren():int;\n\n\t\t/**\n\t\t * Gets the name of a direct child of the <code>Scroller</code> rather\n\t\t * than delegating the call to the view port.\n\t\t */\n\t\tfunction getRawChildByName(name:String):DisplayObject;\n\n\t\t/**\n\t\t * Gets the index of a direct child of the <code>Scroller</code> rather\n\t\t * than delegating the call to the view port.\n\t\t */\n\t\tfunction getRawChildIndex(child:DisplayObject):int;\n\n\t\t/**\n\t\t * Gets the direct child of the <code>Scroller</code> at a specific\n\t\t * index rather than delegating the call to the view port.\n\t\t */\n\t\tfunction getRawChildAt(index:int):DisplayObject;\n\n\t\t/**\n\t\t * Sets the index of a direct child of the <code>Scroller</code> rather\n\t\t * than delegating the call to the view port.\n\t\t */\n\t\tfunction setRawChildIndex(child:DisplayObject, index:int):void;\n\n\t\t/**\n\t\t * Adds a child to the <code>Scroller</code> rather than delegating the\n\t\t * call to the view port.\n\t\t */\n\t\tfunction addRawChild(child:DisplayObject):DisplayObject;\n\n\t\t/**\n\t\t * Adds a child to the <code>Scroller</code> at a specific index rather\n\t\t * than delegating the call to the view port.\n\t\t */\n\t\tfunction addRawChildAt(child:DisplayObject, index:int):DisplayObject;\n\n\t\t/**\n\t\t * Removes a child from the <code>Scroller</code> rather than delegating\n\t\t * the call to the view port.\n\t\t */\n\t\tfunction removeRawChild(child:DisplayObject, dispose:Boolean = false):DisplayObject;\n\n\t\t/**\n\t\t * Removes a child from the <code>Scroller</code> at a specific index\n\t\t * rather than delegating the call to the view port.\n\t\t */\n\t\tfunction removeRawChildAt(index:int, dispose:Boolean = false):DisplayObject;\n\n\t\t/**\n\t\t * Swaps the children of the <code>Scroller</code> rather than\n\t\t * delegating the call to the view port.\n\t\t */\n\t\tfunction swapRawChildren(child1:DisplayObject, child2:DisplayObject):void;\n\n\t\t/**\n\t\t * Swaps the children of the <code>Scroller</code> rather than\n\t\t * delegating the call to the view port.\n\t\t */\n\t\tfunction swapRawChildrenAt(index1:int, index2:int):void;\n\n\t\t/**\n\t\t * Sorts the children of the <code>Scroller</code> rather than\n\t\t * delegating the call to the view port.\n\t\t */\n\t\tfunction sortRawChildren(compareFunction:Function):void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/ImageLoader.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.core.FeathersControl;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.utils.textures.TextureCache;\n\n\timport flash.display.Bitmap;\n\timport flash.display.BitmapData;\n\timport flash.display.Loader;\n\timport flash.display.LoaderInfo;\n\timport flash.display3D.Context3DTextureFormat;\n\timport flash.errors.IllegalOperationError;\n\timport flash.events.ErrorEvent;\n\timport flash.events.Event;\n\timport flash.events.IOErrorEvent;\n\timport flash.events.ProgressEvent;\n\timport flash.events.SecurityErrorEvent;\n\timport flash.geom.Rectangle;\n\timport flash.net.URLLoader;\n\timport flash.net.URLLoaderDataFormat;\n\timport flash.net.URLRequest;\n\timport flash.system.ImageDecodingPolicy;\n\timport flash.system.LoaderContext;\n\timport flash.utils.ByteArray;\n\timport flash.utils.setTimeout;\n\n\timport starling.core.Starling;\n\timport starling.display.Image;\n\timport starling.display.Mesh;\n\timport starling.display.Quad;\n\timport starling.events.EnterFrameEvent;\n\timport starling.events.Event;\n\timport starling.styles.MeshStyle;\n\timport starling.textures.Texture;\n\timport starling.textures.TextureSmoothing;\n\timport starling.utils.RectangleUtil;\n\timport starling.utils.ScaleMode;\n\timport starling.utils.SystemUtil;\n\n\t/**\n\t * The tint value to use on the internal\n\t * <code>starling.display.Image</code>.\n\t *\n\t * <p>In the following example, the image loader's texture color is\n\t * customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * loader.color = 0xff00ff;</listing>\n\t *\n\t * @default 0xffffff\n\t *\n\t * @see http://doc.starling-framework.org/core/starling/display/Image.html#color starling.display.Image.color\n\t */\n\t[Style(name=\"color\",type=\"uint\")]\n\n\t/**\n\t * A texture to display while a URL source is loading.\n\t *\n\t * <p>In the following example, the image loader's loading texture is\n\t * customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * loader.source = \"http://example.com/example.png\";\n\t * loader.loadingTexture = texture;</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:errorTexture\n\t */\n\t[Style(name=\"loadingTexture\",type=\"starling.textures.Texture\")]\n\n\t/**\n\t * A texture to display when a URL source cannot be loaded for any\n\t * reason.\n\t *\n\t * <p>In the following example, the image loader's error texture is\n\t * customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * loader.source = \"http://example.com/example.png\";\n\t * loader.errorTexture = texture;</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:loadingTexture\n\t */\n\t[Style(name=\"errorTexture\",type=\"starling.textures.Texture\")]\n\n\t/**\n\t * The location where the content is aligned horizontally (on\n\t * the x-axis) when its width is larger or smaller than the width of\n\t * the <code>ImageLoader</code>.\n\t *\n\t * <p>If the <code>scaleContent</code> property is set to\n\t * <code>true</code>, the <code>horizontalAlign</code> property is\n\t * ignored.</p>\n\t *\n\t * <p>The following example aligns the content to the right:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * loader.horizontalAlign = HorizontalAlign.RIGHT;</listing>\n\t *\n\t * <p><strong>Note:</strong> The <code>HorizontalAlign.JUSTIFY</code>\n\t * constant is not supported.</p>\n\t *\n\t * @default feathers.layout.HorizontalAlign.LEFT\n\t *\n\t * @see #style:scaleContent\n\t * @see #style:scaleMode\n\t * @see feathers.layout.HorizontalAlign#LEFT\n\t * @see feathers.layout.HorizontalAlign#CENTER\n\t * @see feathers.layout.HorizontalAlign#RIGHT\n\t */\n\t[Style(name=\"horizontalAlign\",type=\"String\")]\n\n\t/**\n\t * Determines if the aspect ratio of the texture is maintained when the\n\t * dimensions of the <code>ImageLoader</code> are changed manually and\n\t * the new dimensions have a different aspect ratio than the texture.\n\t *\n\t * <p>If the <code>scaleContent</code> property is set to\n\t * <code>false</code> or if the <code>scale9Grid</code> property is not\n\t * <code>null</code>, the <code>maintainAspectRatio</code> property is\n\t * ignored.</p>\n\t *\n\t * <p>In the following example, the image loader's aspect ratio is not\n\t * maintained:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * loader.maintainAspectRatio = false;</listing>\n\t *\n\t * @default true\n\t *\n\t * @see #style:scaleContent\n\t * @see #style:scaleMode\n\t */\n\t[Style(name=\"maintainAspectRatio\",type=\"Boolean\")]\n\n\t/**\n\t * Quickly sets all padding properties to the same value. The\n\t * <code>padding</code> getter always returns the value of\n\t * <code>paddingTop</code>, but the other padding values may be\n\t * different.\n\t *\n\t * <p>In the following example, the image loader's padding is set to\n\t * 20 pixels on all sides:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * loader.padding = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:paddingTop\n\t * @see #style:paddingRight\n\t * @see #style:paddingBottom\n\t * @see #style:paddingLeft\n\t */\n\t[Style(name=\"padding\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the control's top edge and the\n\t * control's content. Value may be negative to extend the content\n\t * outside the edges of the control. Useful for skinning.\n\t *\n\t * <p>In the following example, the image loader's top padding is set\n\t * to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * loader.paddingTop = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingTop\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the control's right edge and the\n\t * control's content. Value may be negative to extend the content\n\t * outside the edges of the control. Useful for skinning.\n\t *\n\t * <p>In the following example, the image loader's right padding is set\n\t * to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * loader.paddingRight = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingRight\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the control's bottom edge and the\n\t * control's content. Value may be negative to extend the content\n\t * outside the edges of the control. Useful for skinning.\n\t *\n\t * <p>In the following example, the image loader's bottom padding is set\n\t * to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * loader.paddingBottom = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingBottom\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the control's left edge and the\n\t * control's content. Value may be negative to extend the content\n\t * outside the edges of the control. Useful for skinning.\n\t *\n\t * <p>In the following example, the image loader's left padding is set\n\t * to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * loader.paddingLeft = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingLeft\",type=\"Number\")]\n\n\t/**\n\t * The <code>pixelSnapping</code> value to use on the internal\n\t * <code>starling.display.Image</code>.\n\t *\n\t * <p>In the following example, the image loader's pixelSnapping is\n\t * disabled:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * loader.pixelSnapping = false;</listing>\n\t *\n\t * @default true\n\t *\n\t * @see http://doc.starling-framework.org/core/starling/display/Mesh.html#pixelSnapping starling.display.Mesh.pixelSnapping\n\t */\n\t[Style(name=\"pixelSnapping\",type=\"Boolean\")]\n\n\t/**\n\t * The <code>scale9Grid</code> value to use on the internal\n\t * <code>starling.display.Image</code>.\n\t *\n\t * <p>If this property is not <code>null</code>, the\n\t * <code>maintainAspectRatio</code> property will be ignored.</p>\n\t *\n\t * <p>In the following example, the image loader's scale9Grid is set to a\n\t * custom value:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * loader.scale9Grid = Rectangle(2, 3, 7, 12);</listing>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/core/starling/display/Image.html#scale9Grid starling.display.Image.scale9Grid\n\t */\n\t[Style(name=\"scale9Grid\",type=\"flash.geom.Rectangle\")]\n\n\t/**\n\t * Determines if the content will be scaled if the dimensions of the\n\t * <code>ImageLoader</code> are changed.\n\t *\n\t * <p>In the following example, the image loader's content is not\n\t * scaled:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * loader.scaleContent = false;</listing>\n\t *\n\t * @default true\n\t *\n\t * @see #style:horizontalAlign\n\t * @see #style:verticalAlign\n\t * @see #style:maintainAspectRatio\n\t * @see #style:scaleMode\n\t */\n\t[Style(name=\"scaleContent\",type=\"Boolean\")]\n\n\t/**\n\t * Determines how the texture is scaled if <code>scaleContent</code> and\n\t * <code>maintainAspectRatio</code> are both set to <code>true</code>.\n\t * See the <code>starling.utils.ScaleMode</code> class for details about\n\t * each scaling mode.\n\t *\n\t * <p>If the <code>scaleContent</code> property is set to\n\t * <code>false</code>, or the <code>maintainAspectRatio</code> property\n\t * is set to false, the <code>scaleMode</code> property is ignored.</p>\n\t *\n\t * <p>In the following example, the image loader's scale mode is changed:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * loader.scaleMode = ScaleMode.NO_BORDER;</listing>\n\t *\n\t * @default starling.utils.ScaleMode.SHOW_ALL\n\t *\n\t * @see #style:scaleContent\n\t * @see #style:maintainAspectRatio\n\t * @see http://doc.starling-framework.org/core/starling/utils/ScaleMode.html starling.utils.ScaleMode\n\t */\n\t[Style(name=\"scaleMode\",type=\"String\")]\n\n\t/**\n\t * The texture smoothing value to use on the internal\n\t * <code>starling.display.Image</code>.\n\t *\n\t * <p>In the following example, the image loader's smoothing is set to a\n\t * custom value:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * loader.textureSmoothing = TextureSmoothing.NONE;</listing>\n\t *\n\t * @default starling.textures.TextureSmoothing.BILINEAR\n\t *\n\t * @see http://doc.starling-framework.org/core/starling/textures/TextureSmoothing.html starling.textures.TextureSmoothing\n\t * @see http://doc.starling-framework.org/core/starling/display/Mesh.html#textureSmoothing starling.display.Mesh.textureSmoothing\n\t */\n\t[Style(name=\"textureSmoothing\",type=\"String\")]\n\n\t/**\n\t * The <code>tileGrid</code> value to use on the internal\n\t * <code>starling.display.Image</code>.\n\t *\n\t * <p>In the following example, the image loader's tileGrid is set to a\n\t * custom value:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * loader.tileGrid = Rectangle();</listing>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/core/starling/display/Image.html#tileGrid starling.display.Image.tileGrid\n\t */\n\t[Style(name=\"tileGrid\",type=\"flash.geom.Rectangle\")]\n\n\t/**\n\t * The location where the content is aligned vertically (on\n\t * the y-axis) when its height is larger or smaller than the height of\n\t * the <code>ImageLoader</code>.\n\t *\n\t * <p>If the <code>scaleContent</code> property is set to\n\t * <code>true</code>, the <code>verticalAlign</code> property is\n\t * ignored.</p>\n\t *\n\t * <p>The following example aligns the content to the bottom:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * loader.verticalAlign = VerticalAlign.BOTTOM;</listing>\n\t *\n\t * <p><strong>Note:</strong> The <code>VerticalAlign.JUSTIFY</code>\n\t * constant is not supported.</p>\n\t *\n\t * @default feathers.layout.VerticalAlign.TOP\n\t *\n\t * @see #style:scaleContent\n\t * @see #style:scaleMode\n\t * @see feathers.layout.VerticalAlign#TOP\n\t * @see feathers.layout.VerticalAlign#MIDDLE\n\t * @see feathers.layout.VerticalAlign#BOTTOM\n\t */\n\t[Style(name=\"verticalAlign\",type=\"String\")]\n\n\t/**\n\t * Dispatched when the source finishes loading, if the source is a URL. This\n\t * event is not dispatched when the source is a texture.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.COMPLETE\n\t */\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched periodically as the source loads, if the source is a URL. This\n\t * event is not dispatched when the source is a texture.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>A value between 0.0 and 1.0 to indicate\n\t *   how much image data has loaded.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.PROGRESS\n\t */\n\t[Event(name=\"progress\",type=\"starling.events.Event\")]\n\n\t/**\n\t * @private\n\t * DEPRECATED: Replaced by <code>Event.IO_ERROR</code> and\n\t * <code>Event.SECURITY_ERROR</code>.\n\t *\n\t * <p><strong>DEPRECATION WARNING:</strong> This event is deprecated\n\t * starting with Feathers 2.2. It will be removed in a future version of\n\t * Feathers according to the standard\n\t * <a target=\"_top\" href=\"../../../help/deprecation-policy.html\">Feathers deprecation policy</a>.</p>\n\t *\n\t * @eventType feathers.events.FeathersEventType.ERROR\n\t *\n\t * @see #event:ioError\n\t * @see #event:securityError\n\t */\n\t[Event(name=\"error\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched if an IO error occurs while loading the source content.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The <code>flash.events.IOErrorEvent</code>\n\t *   dispatched by the loader.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.IO_ERROR\n\t */\n\t[Event(name=\"ioError\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched if a security error occurs while loading the source content.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The <code>flash.events.SecurityErrorEvent</code>\n\t *   dispatched by the loader.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.SECURITY_ERROR\n\t */\n\t[Event(name=\"securityError\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Displays an image, either from an existing <code>Texture</code> object or\n\t * from an image file loaded with its URL. Supported image files include ATF\n\t * format and any bitmap formats that may be loaded by\n\t * <code>flash.display.Loader</code>, including JPG, GIF, and PNG.\n\t *\n\t * <p>The following example passes a URL to an image loader and listens for\n\t * its complete event:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var loader:ImageLoader = new ImageLoader();\n\t * loader.source = \"http://example.com/example.png\";\n\t * loader.addEventListener( Event.COMPLETE, loader_completeHandler );\n\t * this.addChild( loader );</listing>\n\t *\n\t * <p>The following example passes an existing texture to an image loader:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var loader:ImageLoader = new ImageLoader();\n\t * loader.source = Texture.fromBitmap( bitmap );\n\t * this.addChild( loader );</listing>\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class ImageLoader extends FeathersControl\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const HELPER_RECTANGLE:Rectangle = new Rectangle();\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const HELPER_RECTANGLE2:Rectangle = new Rectangle();\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const CONTEXT_LOST_WARNING:String = \"ImageLoader: Context lost while processing loaded image, retrying...\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const ATF_FILE_EXTENSION:String = \"atf\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static var textureQueueHead:ImageLoader;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static var textureQueueTail:ImageLoader;\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>ImageLoader</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function ImageLoader()\n\t\t{\n\t\t\tthis.isQuickHitAreaEnabled = true;\n\t\t}\n\n\t\t/**\n\t\t * The internal <code>starling.display.Image</code> child.\n\t\t */\n\t\tprotected var image:Image;\n\n\t\t/**\n\t\t * The internal <code>flash.display.Loader</code> used to load textures\n\t\t * from URLs.\n\t\t */\n\t\tprotected var loader:Loader;\n\n\t\t/**\n\t\t * The internal <code>flash.net.URLLoader</code> used to load raw data\n\t\t * from URLs.\n\t\t */\n\t\tprotected var urlLoader:URLLoader;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastURL:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _originalTextureWidth:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _originalTextureHeight:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentTextureWidth:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentTextureHeight:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentTexture:Texture;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isRestoringTexture:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _texture:Texture;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isTextureOwner:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn ImageLoader.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _source:Object;\n\n\t\t/**\n\t\t * The <code>Texture</code> to display, or a URL pointing to an image\n\t\t * file. Supported image files include ATF format and any bitmap formats\n\t\t * that may be loaded by <code>flash.display.Loader</code>, including\n\t\t * JPG, GIF, and PNG.\n\t\t *\n\t\t * <p>In the following example, the image loader's source is set to a\n\t\t * texture:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * loader.source = Texture.fromBitmap( bitmap );</listing>\n\t\t *\n\t\t * <p>In the following example, the image loader's source is set to the\n\t\t * URL of a PNG image:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * loader.source = \"http://example.com/example.png\";</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Loader.html\n\t\t * @see http://wiki.starling-framework.org/manual/atf_textures\n\t\t */\n\t\tpublic function get source():Object\n\t\t{\n\t\t\treturn this._source;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set source(value:Object):void\n\t\t{\n\t\t\tif(this._source == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isRestoringTexture = false;\n\t\t\tif(this._isInTextureQueue)\n\t\t\t{\n\t\t\t\tthis.removeFromTextureQueue();\n\t\t\t}\n\n\t\t\tvar oldTexture:Texture;\n\t\t\t//we should try to reuse the existing texture, if possible.\n\t\t\tif(this._isTextureOwner && value && !(value is Texture))\n\t\t\t{\n\t\t\t\toldTexture = this._texture;\n\t\t\t\tthis._isTextureOwner = false;\n\t\t\t}\n\t\t\tthis.cleanupTexture();\n\n\t\t\t//the source variable needs to be set after cleanupTexture() is\n\t\t\t//called because cleanupTexture() needs to know the old source if\n\t\t\t//a TextureCache is in use.\n\t\t\tthis._source = value;\n\n\t\t\tif(oldTexture)\n\t\t\t{\n\t\t\t\tthis._texture = oldTexture;\n\t\t\t\tthis._isTextureOwner = true;\n\t\t\t}\n\t\t\tif(this.image)\n\t\t\t{\n\t\t\t\tthis.image.visible = false;\n\t\t\t}\n\t\t\tthis.cleanupLoaders(true);\n\t\t\tthis._lastURL = null;\n\t\t\tif(this._source is Texture)\n\t\t\t{\n\t\t\t\tthis._isLoaded = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\n\t\t\t\tthis._isLoaded = false;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textureCache:TextureCache;\n\n\t\t/**\n\t\t * An optional cache for textures.\n\t\t *\n\t\t * <p>In the following example, a cache is provided for textures:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var cache:TextureCache = new TextureCache(30);\n\t\t * loader1.textureCache = cache;\n\t\t * loader2.textureCache = cache;</listing>\n\t\t *\n\t\t * <p><strong>Warning:</strong> the textures in the cache will not be\n\t\t * disposed automatically. When the cache is no longer needed (such as\n\t\t * when the <code>ImageLoader</code> components have all been disposed),\n\t\t * you must call the <code>dispose()</code> method on the\n\t\t * <code>TextureCache</code>. Failing to do so will result in a serious\n\t\t * memory leak.</p>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get textureCache():TextureCache\n\t\t{\n\t\t\treturn this._textureCache;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set textureCache(value:TextureCache):void\n\t\t{\n\t\t\tthis._textureCache = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _loadingTexture:Texture;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get loadingTexture():Texture\n\t\t{\n\t\t\treturn this._loadingTexture;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set loadingTexture(value:Texture):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._loadingTexture === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._loadingTexture = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _errorTexture:Texture;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get errorTexture():Texture\n\t\t{\n\t\t\treturn this._errorTexture;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set errorTexture(value:Texture):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._errorTexture === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._errorTexture = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isLoaded:Boolean = false;\n\n\t\t/**\n\t\t * Indicates if the source has completed loading, if the source is a\n\t\t * URL. Always returns <code>true</code> when the source is a texture.\n\t\t *\n\t\t * <p>In the following example, we check if the image loader's source\n\t\t * has finished loading:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * if( loader.isLoaded )\n\t\t * {\n\t\t *     //do something\n\t\t * }</listing>\n\t\t */\n\t\tpublic function get isLoaded():Boolean\n\t\t{\n\t\t\treturn this._isLoaded;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _textureScale:Number = 1;\n\n\t\t/**\n\t\t * Scales the texture dimensions during measurement, but does not set\n\t\t * the texture's scale factor. Useful for UI that should scale based on\n\t\t * screen density or resolution without accounting for\n\t\t * <code>contentScaleFactor</code>.\n\t\t *\n\t\t * <p>In the following example, the image loader's texture scale is\n\t\t * customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * loader.textureScale = 0.5;</listing>\n\t\t *\n\t\t * @default 1\n\t\t */\n\t\tpublic function get textureScale():Number\n\t\t{\n\t\t\treturn this._textureScale;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set textureScale(value:Number):void\n\t\t{\n\t\t\tif(this._textureScale == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textureScale = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _scaleFactor:Number = 1;\n\n\t\t/**\n\t\t * The scale factor value to pass to <code>Texture.fromBitmapData()</code>\n\t\t * when creating a texture loaded from a URL.\n\t\t *\n\t\t * <p>In the following example, the image loader's scale factor is\n\t\t * customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * loader.scaleFactor = 2;</listing>\n\t\t *\n\t\t * @default 1\n\t\t */\n\t\tpublic function get scaleFactor():Number\n\t\t{\n\t\t\treturn this._scaleFactor;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set scaleFactor(value:Number):void\n\t\t{\n\t\t\tif(this._scaleFactor == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._scaleFactor = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _textureSmoothing:String = TextureSmoothing.BILINEAR;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get textureSmoothing():String\n\t\t{\n\t\t\treturn this._textureSmoothing;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set textureSmoothing(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._textureSmoothing === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textureSmoothing = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _defaultStyle:MeshStyle = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _style:MeshStyle = null;\n\n\t\t/**\n\t\t * The style that is used to render the loader's image.\n\t\t *\n\t\t * <p>In the following example, the loader uses a custom style:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * loader.style = new CustomMeshStyle();</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get style():MeshStyle\n\t\t{\n\t\t\treturn this._style;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set style(value:MeshStyle):void\n\t\t{\n\t\t\tif(this._style == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._style = value;\n\t\t\tif(this._style)\n\t\t\t{\n\t\t\t\tthis._defaultStyle = null;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _scale9Grid:Rectangle;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get scale9Grid():Rectangle\n\t\t{\n\t\t\treturn this._scale9Grid;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set scale9Grid(value:Rectangle):void\n\t\t{\n\t\t\tif(this._scale9Grid == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._scale9Grid = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _tileGrid:Rectangle;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get tileGrid():Rectangle\n\t\t{\n\t\t\treturn this._tileGrid;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set tileGrid(value:Rectangle):void\n\t\t{\n\t\t\tif(this._tileGrid == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._tileGrid = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _pixelSnapping:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get pixelSnapping():Boolean\n\t\t{\n\t\t\treturn this._pixelSnapping;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set pixelSnapping(value:Boolean):void\n\t\t{\n\t\t\tif(this._pixelSnapping == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._pixelSnapping = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _color:uint = 0xffffff;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get color():uint\n\t\t{\n\t\t\treturn this._color;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set color(value:uint):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._color == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._color = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _textureFormat:String = Context3DTextureFormat.BGRA;\n\n\t\t/**\n\t\t * The texture format to use when creating a texture loaded from a URL.\n\t\t *\n\t\t * <p>In the following example, the image loader's texture format is set\n\t\t * to a custom value:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * loader.textureFormat = Context3DTextureFormat.BGRA_PACKED;</listing>\n\t\t *\n\t\t * @default flash.display3d.Context3DTextureFormat.BGRA\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display3D/Context3DTextureFormat.html flash.display3d.Context3DTextureFormat\n\t\t */\n\t\tpublic function get textureFormat():String\n\t\t{\n\t\t\treturn this._textureFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set textureFormat(value:String):void\n\t\t{\n\t\t\tif(this._textureFormat == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textureFormat = value;\n\t\t\tthis._lastURL = null;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _scaleContent:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get scaleContent():Boolean\n\t\t{\n\t\t\treturn this._scaleContent;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set scaleContent(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._scaleContent === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._scaleContent = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _maintainAspectRatio:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get maintainAspectRatio():Boolean\n\t\t{\n\t\t\treturn this._maintainAspectRatio;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maintainAspectRatio(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._maintainAspectRatio === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._maintainAspectRatio = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _scaleMode:String = ScaleMode.SHOW_ALL;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"showAll,noBorder,none\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get scaleMode():String\n\t\t{\n\t\t\treturn this._scaleMode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set scaleMode(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._scaleMode === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._scaleMode = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalAlign:String = HorizontalAlign.LEFT;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"left,center,right\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get horizontalAlign():String\n\t\t{\n\t\t\treturn this._horizontalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalAlign(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._horizontalAlign === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalAlign = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalAlign:String = VerticalAlign.TOP;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"top,middle,bottom\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get verticalAlign():String\n\t\t{\n\t\t\treturn _verticalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalAlign(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._verticalAlign === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalAlign = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * The original width of the source content, in pixels. This value will\n\t\t * be <code>0</code> until the source content finishes loading. If the\n\t\t * source is a texture, this value will be <code>0</code> until the\n\t\t * <code>ImageLoader</code> validates.\n\t\t */\n\t\tpublic function get originalSourceWidth():Number\n\t\t{\n\t\t\tif(this._originalTextureWidth === this._originalTextureWidth) //!isNaN\n\t\t\t{\n\t\t\t\treturn this._originalTextureWidth;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * The original height of the source content, in pixels. This value will\n\t\t * be <code>0</code> until the source content finishes loading. If the\n\t\t * source is a texture, this value will be <code>0</code> until the\n\t\t * <code>ImageLoader</code> validates.\n\t\t */\n\t\tpublic function get originalSourceHeight():Number\n\t\t{\n\t\t\tif(this._originalTextureHeight === this._originalTextureHeight) //!isNaN\n\t\t\t{\n\t\t\t\treturn this._originalTextureHeight;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _pendingBitmapDataTexture:BitmapData;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _pendingRawTextureData:ByteArray;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _delayTextureCreation:Boolean = false;\n\n\t\t/**\n\t\t * Determines if a loaded bitmap may be converted to a texture\n\t\t * immediately after loading. If <code>true</code>, the loaded bitmap\n\t\t * will be saved until this property is set to <code>false</code>, and\n\t\t * only then it will be used to create the texture.\n\t\t *\n\t\t * <p>This property is intended to be used while a parent container,\n\t\t * such as a <code>List</code>, is scrolling in order to keep scrolling\n\t\t * as smooth as possible. Creating textures is expensive and performance\n\t\t * can be affected by it. Set this property to <code>true</code> when\n\t\t * the <code>List</code> dispatches <code>FeathersEventType.SCROLL_START</code>\n\t\t * and set back to false when the <code>List</code> dispatches\n\t\t * <code>FeathersEventType.SCROLL_COMPLETE</code>. You may also need\n\t\t * to set to false if the <code>isScrolling</code> property of the\n\t\t * <code>List</code> is <code>true</code> before you listen to those\n\t\t * events.</p>\n\t\t *\n\t\t * <p>In the following example, the image loader's texture creation is\n\t\t * delayed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * loader.delayTextureCreation = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see #textureQueueDuration\n\t\t * @see feathers.controls.Scroller#event:scrollStart\n\t\t * @see feathers.controls.Scroller#event:scrollComplete\n\t\t * @see feathers.controls.Scroller#isScrolling\n\t\t */\n\t\tpublic function get delayTextureCreation():Boolean\n\t\t{\n\t\t\treturn this._delayTextureCreation;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set delayTextureCreation(value:Boolean):void\n\t\t{\n\t\t\tif(this._delayTextureCreation == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._delayTextureCreation = value;\n\t\t\tif(!this._delayTextureCreation)\n\t\t\t{\n\t\t\t\tthis.processPendingTexture();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isInTextureQueue:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textureQueuePrevious:ImageLoader;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textureQueueNext:ImageLoader;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _accumulatedPrepareTextureTime:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textureQueueDuration:Number = Number.POSITIVE_INFINITY;\n\n\t\t/**\n\t\t * If <code>delayTextureCreation</code> is <code>true</code> and the\n\t\t * duration is not <code>Number.POSITIVE_INFINITY</code>, the loader\n\t\t * will be added to a queue where the textures are uploaded to the GPU\n\t\t * in sequence to avoid significantly affecting performance. Useful for\n\t\t * lists where many textures may need to be uploaded during scrolling.\n\t\t *\n\t\t * <p>If the duration is <code>Number.POSITIVE_INFINITY</code>, the\n\t\t * default value, the texture will not be uploaded until\n\t\t * <code>delayTextureCreation</code> is set to <code>false</code>. In\n\t\t * this situation, the loader will not be added to the queue, and other\n\t\t * loaders with a duration won't be affected.</p>\n\t\t *\n\t\t * <p>In the following example, the image loader's texture creation is\n\t\t * delayed by half a second:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * loader.delayTextureCreation = true;\n\t\t * loader.textureQueueDuration = 0.5;</listing>\n\t\t *\n\t\t * @default Number.POSITIVE_INFINITY\n\t\t *\n\t\t * @see #delayTextureCreation\n\t\t */\n\t\tpublic function get textureQueueDuration():Number\n\t\t{\n\t\t\treturn this._textureQueueDuration;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set textureQueueDuration(value:Number):void\n\t\t{\n\t\t\tif(this._textureQueueDuration == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar oldDuration:Number = this._textureQueueDuration;\n\t\t\tthis._textureQueueDuration = value;\n\t\t\tif(this._delayTextureCreation)\n\t\t\t{\n\t\t\t\tif((this._pendingBitmapDataTexture || this._pendingRawTextureData) &&\n\t\t\t\t\toldDuration == Number.POSITIVE_INFINITY && this._textureQueueDuration < Number.POSITIVE_INFINITY)\n\t\t\t\t{\n\t\t\t\t\tthis.addToTextureQueue();\n\t\t\t\t}\n\t\t\t\telse if(this._isInTextureQueue && this._textureQueueDuration == Number.POSITIVE_INFINITY)\n\t\t\t\t{\n\t\t\t\t\tthis.removeFromTextureQueue();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get padding():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set padding(value:Number):void\n\t\t{\n\t\t\tthis.paddingTop = value;\n\t\t\tthis.paddingRight = value;\n\t\t\tthis.paddingBottom = value;\n\t\t\tthis.paddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingTop:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingTop():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingTop(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingTop = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingRight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingRight():Number\n\t\t{\n\t\t\treturn this._paddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingRight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingBottom:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingBottom():Number\n\t\t{\n\t\t\treturn this._paddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingBottom = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingLeft:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingLeft = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _asyncTextureUpload:Boolean = true;\n\n\t\t/**\n\t\t * Determines if textures loaded from URLs are uploaded asynchronously\n\t\t * or not.\n\t\t *\n\t\t * <p>Note: depending on the version of AIR and the platform it is\n\t\t * running on, textures may be uploaded synchronously, even when this\n\t\t * property is <code>true</code>.</p>\n\t\t *\n\t\t * <p>In the following example, the texture will be uploaded\n\t\t * synchronously:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * loader.asyncTextureUpload = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic function get asyncTextureUpload():Boolean\n\t\t{\n\t\t\treturn this._asyncTextureUpload;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set asyncTextureUpload(value:Boolean):void\n\t\t{\n\t\t\tthis._asyncTextureUpload = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _imageDecodingOnLoad:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _loaderContext:LoaderContext = null;\n\n\t\t/**\n\t\t * If the texture is loaded using <code>flash.display.Loader</code>,\n\t\t * a custom <code>flash.system.LoaderContext</code> may optionally\n\t\t * be provided.\n\t\t *\n\t\t * <p>In the following example, a custom loader context is provided:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var context:LoaderContext = new LoaderContext();\n\t\t * context.loadPolicyFile = true;\n\t\t * loader.loaderContext = context;\n\t\t * </listing>\n\t\t *\n\t\t * @see https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/system/LoaderContext.html flash.system.LoaderContext\n\t\t */\n\t\tpublic function get loaderContext():LoaderContext\n\t\t{\n\t\t\treturn this._loaderContext;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set loaderContext(value:LoaderContext):void\n\t\t{\n\t\t\tthis._loaderContext = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tthis._isRestoringTexture = false;\n\t\t\tthis.cleanupLoaders(true);\n\t\t\tthis.cleanupTexture();\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar layoutInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_LAYOUT);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\n\t\t\tif(dataInvalid)\n\t\t\t{\n\t\t\t\tthis.commitData();\n\t\t\t}\n\n\t\t\tif(dataInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.commitStyles();\n\t\t\t}\n\n\t\t\tsizeInvalid = this.autoSizeIfNeeded() || sizeInvalid;\n\n\t\t\tif(dataInvalid || layoutInvalid || sizeInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.layout();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * If the component's dimensions have not been set explicitly, it will\n\t\t * measure its content and determine an ideal size for itself. If the\n\t\t * <code>explicitWidth</code> or <code>explicitHeight</code> member\n\t\t * variables are set, those value will be used without additional\n\t\t * measurement. If one is set, but not the other, the dimension with the\n\t\t * explicit value will not be measured, but the other non-explicit\n\t\t * dimension will still need measurement.\n\t\t *\n\t\t * <p>Calls <code>saveMeasurements()</code> to set up the\n\t\t * <code>actualWidth</code> and <code>actualHeight</code> member\n\t\t * variables used for layout.</p>\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t */\n\t\tprotected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvar heightScale:Number = 1;\n\t\t\tvar widthScale:Number = 1;\n\t\t\tif(this._scaleContent && this._maintainAspectRatio &&\n\t\t\t\tthis._scaleMode !== ScaleMode.NONE &&\n\t\t\t\tthis._scale9Grid === null)\n\t\t\t{\n\t\t\t\tif(!needsHeight)\n\t\t\t\t{\n\t\t\t\t\theightScale = this._explicitHeight / (this._currentTextureHeight * this._textureScale);\n\t\t\t\t}\n\t\t\t\telse if(this._explicitMaxHeight < this._currentTextureHeight)\n\t\t\t\t{\n\t\t\t\t\theightScale = this._explicitMaxHeight / (this._currentTextureHeight * this._textureScale);\n\t\t\t\t}\n\t\t\t\telse if(this._explicitMinHeight > this._currentTextureHeight)\n\t\t\t\t{\n\t\t\t\t\theightScale = this._explicitMinHeight / (this._currentTextureHeight * this._textureScale);\n\t\t\t\t}\n\t\t\t\tif(!needsWidth)\n\t\t\t\t{\n\t\t\t\t\twidthScale = this._explicitWidth / (this._currentTextureWidth * this._textureScale);\n\t\t\t\t}\n\t\t\t\telse if(this._explicitMaxWidth < this._currentTextureWidth)\n\t\t\t\t{\n\t\t\t\t\twidthScale = this._explicitMaxWidth / (this._currentTextureWidth * this._textureScale);\n\t\t\t\t}\n\t\t\t\telse if(this._explicitMinWidth > this._currentTextureWidth)\n\t\t\t\t{\n\t\t\t\t\twidthScale = this._explicitMinWidth / (this._currentTextureWidth * this._textureScale);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tif(this._currentTextureWidth === this._currentTextureWidth) //!isNaN\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this._currentTextureWidth * this._textureScale * heightScale;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewWidth = 0;\n\t\t\t\t}\n\t\t\t\tnewWidth += this._paddingLeft + this._paddingRight;\n\t\t\t}\n\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tif(this._currentTextureHeight === this._currentTextureHeight) //!isNaN\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this._currentTextureHeight * this._textureScale * widthScale;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewHeight = 0;\n\t\t\t\t}\n\t\t\t\tnewHeight += this._paddingTop + this._paddingBottom;\n\t\t\t}\n\n\t\t\t//this ensures that an ImageLoader can recover from width or height\n\t\t\t//being set to 0 by percentWidth or percentHeight\n\t\t\tif(needsHeight && needsMinHeight)\n\t\t\t{\n\t\t\t\t//if no height values are set, use the original texture width\n\t\t\t\t//for the minWidth\n\t\t\t\theightScale = 1;\n\t\t\t}\n\t\t\tif(needsWidth && needsMinWidth)\n\t\t\t{\n\t\t\t\t//if no width values are set, use the original texture height\n\t\t\t\t//for the minHeight\n\t\t\t\twidthScale = 1;\n\t\t\t}\n\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tif(this._currentTextureWidth === this._currentTextureWidth) //!isNaN\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = this._currentTextureWidth * this._textureScale * heightScale;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = 0;\n\t\t\t\t}\n\t\t\t\tnewMinWidth += this._paddingLeft + this._paddingRight;\n\t\t\t}\n\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tif(this._currentTextureHeight === this._currentTextureHeight) //!isNaN\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = this._currentTextureHeight * this._textureScale * widthScale;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = 0;\n\t\t\t\t}\n\t\t\t\tnewMinHeight += this._paddingTop + this._paddingBottom;\n\t\t\t}\n\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function commitData():void\n\t\t{\n\t\t\tif(this._source is Texture)\n\t\t\t{\n\t\t\t\tthis._lastURL = null;\n\t\t\t\tthis._texture = Texture(this._source);\n\t\t\t\tthis.refreshCurrentTexture();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar sourceURL:String = this._source as String;\n\t\t\t\tif(!sourceURL)\n\t\t\t\t{\n\t\t\t\t\tthis._lastURL = null;\n\t\t\t\t}\n\t\t\t\telse if(sourceURL != this._lastURL)\n\t\t\t\t{\n\t\t\t\t\tthis._lastURL = sourceURL;\n\n\t\t\t\t\tif(this.findSourceInCache())\n\t\t\t\t\t{\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(isATFURL(sourceURL))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this.loader)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.loader = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!this.urlLoader)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.urlLoader = new URLLoader();\n\t\t\t\t\t\t\tthis.urlLoader.dataFormat = URLLoaderDataFormat.BINARY;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.urlLoader.addEventListener(flash.events.Event.COMPLETE, rawDataLoader_completeHandler);\n\t\t\t\t\t\tthis.urlLoader.addEventListener(ProgressEvent.PROGRESS, rawDataLoader_progressHandler);\n\t\t\t\t\t\tthis.urlLoader.addEventListener(IOErrorEvent.IO_ERROR, rawDataLoader_ioErrorHandler);\n\t\t\t\t\t\tthis.urlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, rawDataLoader_securityErrorHandler);\n\t\t\t\t\t\tthis.urlLoader.load(new URLRequest(sourceURL));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\telse //not ATF\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this.urlLoader)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.urlLoader = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!this.loader)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.loader = new Loader();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, loader_completeHandler);\n\t\t\t\t\t\tthis.loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loader_progressHandler);\n\t\t\t\t\t\tthis.loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loader_ioErrorHandler);\n\t\t\t\t\t\tthis.loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, loader_securityErrorHandler);\n\t\t\t\t\t\tif(this._loaderContext === null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//create a default loader context that checks\n\t\t\t\t\t\t\t//policy files, and also decodes images on load for\n\t\t\t\t\t\t\t//better performance\n\t\t\t\t\t\t\tthis._loaderContext = new LoaderContext(true);\n\t\t\t\t\t\t\tthis._loaderContext.imageDecodingPolicy = ImageDecodingPolicy.ON_LOAD;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//save this value because the _loaderContext might\n\t\t\t\t\t\t//change before we need to access it.\n\t\t\t\t\t\t//we will need it if we need to clean up the Loader.\n\t\t\t\t\t\tthis._imageDecodingOnLoad = this._loaderContext.imageDecodingPolicy === ImageDecodingPolicy.ON_LOAD;\n\t\t\t\t\t\tthis.loader.load(new URLRequest(sourceURL), this._loaderContext);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.refreshCurrentTexture();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function commitStyles():void\n\t\t{\n\t\t\tif(!this.image)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.image.textureSmoothing = this._textureSmoothing;\n\t\t\tthis.image.color = this._color;\n\t\t\tthis.image.scale9Grid = this._scale9Grid;\n\t\t\tthis.image.tileGrid = this._tileGrid;\n\t\t\tthis.image.pixelSnapping = this._pixelSnapping;\n\t\t\tif(this._style !== null)\n\t\t\t{\n\t\t\t\tthis.image.style = this._style;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(this._defaultStyle === null)\n\t\t\t\t{\n\t\t\t\t\tthis._defaultStyle = Mesh.createDefaultStyle(this.image);\n\t\t\t\t}\n\t\t\t\tthis.image.style = this._defaultStyle;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layout():void\n\t\t{\n\t\t\tif(!this.image || !this._currentTexture)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._scaleContent)\n\t\t\t{\n\t\t\t\tif(this._maintainAspectRatio && this._scale9Grid === null)\n\t\t\t\t{\n\t\t\t\t\tHELPER_RECTANGLE.x = 0;\n\t\t\t\t\tHELPER_RECTANGLE.y = 0;\n\t\t\t\t\tHELPER_RECTANGLE.width = this._currentTextureWidth * this._textureScale;\n\t\t\t\t\tHELPER_RECTANGLE.height = this._currentTextureHeight * this._textureScale;\n\t\t\t\t\tHELPER_RECTANGLE2.x = 0;\n\t\t\t\t\tHELPER_RECTANGLE2.y = 0;\n\t\t\t\t\tHELPER_RECTANGLE2.width = this.actualWidth - this._paddingLeft - this._paddingRight;\n\t\t\t\t\tHELPER_RECTANGLE2.height = this.actualHeight - this._paddingTop - this._paddingBottom;\n\t\t\t\t\tRectangleUtil.fit(HELPER_RECTANGLE, HELPER_RECTANGLE2, this._scaleMode, false, HELPER_RECTANGLE);\n\t\t\t\t\tthis.image.x = HELPER_RECTANGLE.x + this._paddingLeft;\n\t\t\t\t\tthis.image.y = HELPER_RECTANGLE.y + this._paddingTop;\n\t\t\t\t\tthis.image.width = HELPER_RECTANGLE.width;\n\t\t\t\t\tthis.image.height = HELPER_RECTANGLE.height;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.image.x = this._paddingLeft;\n\t\t\t\t\tthis.image.y = this._paddingTop;\n\t\t\t\t\tthis.image.width = this.actualWidth - this._paddingLeft - this._paddingRight;\n\t\t\t\t\tthis.image.height = this.actualHeight - this._paddingTop - this._paddingBottom;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar imageWidth:Number = this._currentTextureWidth * this._textureScale;\n\t\t\t\tvar imageHeight:Number = this._currentTextureHeight * this._textureScale;\n\t\t\t\tif(this._horizontalAlign === HorizontalAlign.RIGHT)\n\t\t\t\t{\n\t\t\t\t\tthis.image.x = this.actualWidth - this._paddingRight - imageWidth;\n\t\t\t\t}\n\t\t\t\telse if(this._horizontalAlign === HorizontalAlign.CENTER)\n\t\t\t\t{\n\t\t\t\t\tthis.image.x = this._paddingLeft + ((this.actualWidth - this._paddingLeft - this._paddingRight) - imageWidth) / 2;\n\t\t\t\t}\n\t\t\t\telse //left\n\t\t\t\t{\n\t\t\t\t\tthis.image.x = this._paddingLeft;\n\t\t\t\t}\n\t\t\t\tif(this._verticalAlign === VerticalAlign.BOTTOM)\n\t\t\t\t{\n\t\t\t\t\tthis.image.y = this.actualHeight - this._paddingBottom - imageHeight;\n\t\t\t\t}\n\t\t\t\telse if(this._verticalAlign === VerticalAlign.MIDDLE)\n\t\t\t\t{\n\t\t\t\t\tthis.image.y = this._paddingTop + ((this.actualHeight - this._paddingTop - this._paddingBottom) - imageHeight) / 2;\n\t\t\t\t}\n\t\t\t\telse //top\n\t\t\t\t{\n\t\t\t\t\tthis.image.y = this._paddingTop;\n\t\t\t\t}\n\t\t\t\tthis.image.width = imageWidth;\n\t\t\t\tthis.image.height = imageHeight;\n\t\t\t}\n\t\t\tif((!this._scaleContent || (this._maintainAspectRatio && this._scaleMode !== ScaleMode.SHOW_ALL)) &&\n\t\t\t\t(this.actualWidth != imageWidth || this.actualHeight != imageHeight))\n\t\t\t{\n\t\t\t\tvar mask:Quad = this.image.mask as Quad;\n\t\t\t\tif(mask !== null)\n\t\t\t\t{\n\t\t\t\t\tmask.x = 0;\n\t\t\t\t\tmask.y = 0;\n\t\t\t\t\tmask.width = this.actualWidth;\n\t\t\t\t\tmask.height = this.actualHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tmask = new Quad(1, 1, 0xff00ff);\n\t\t\t\t\t//the initial dimensions cannot be 0 or there's a runtime error,\n\t\t\t\t\t//and these values might be 0\n\t\t\t\t\tmask.width = this.actualWidth;\n\t\t\t\t\tmask.height = this.actualHeight;\n\t\t\t\t\tthis.image.mask = mask;\n\t\t\t\t\tthis.addChild(mask);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmask = this.image.mask as Quad;\n\t\t\t\tif(mask !== null)\n\t\t\t\t{\n\t\t\t\t\tmask.removeFromParent(true);\n\t\t\t\t\tthis.image.mask = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function isATFURL(sourceURL:String):Boolean\n\t\t{\n\t\t\tvar index:int = sourceURL.indexOf(\"?\");\n\t\t\tif(index >= 0)\n\t\t\t{\n\t\t\t\tsourceURL = sourceURL.substr(0, index);\n\t\t\t}\n\t\t\treturn sourceURL.toLowerCase().lastIndexOf(ATF_FILE_EXTENSION) == sourceURL.length - 3;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshCurrentTexture():void\n\t\t{\n\t\t\tvar newTexture:Texture = this._isLoaded ? this._texture : null;\n\t\t\tif(!newTexture)\n\t\t\t{\n\t\t\t\tif(this.loader || this.urlLoader)\n\t\t\t\t{\n\t\t\t\t\tnewTexture = this._loadingTexture;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewTexture = this._errorTexture;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(this._currentTexture == newTexture)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._currentTexture = newTexture;\n\n\t\t\tif(!this._currentTexture)\n\t\t\t{\n\t\t\t\tif(this.image)\n\t\t\t\t{\n\t\t\t\t\tthis.removeChild(this.image, true);\n\t\t\t\t\tthis.image = null;\n\t\t\t\t\tthis._defaultStyle = null;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//save the texture's frame so that we don't need to create a new\n\t\t\t//rectangle every time that we want to access it.\n\t\t\tvar frame:Rectangle = this._currentTexture.frame;\n\t\t\tif(frame)\n\t\t\t{\n\t\t\t\tthis._currentTextureWidth = frame.width;\n\t\t\t\tthis._currentTextureHeight = frame.height;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._currentTextureWidth = this._currentTexture.width;\n\t\t\t\tthis._currentTextureHeight = this._currentTexture.height;\n\t\t\t\tthis._originalTextureWidth = this._currentTexture.nativeWidth;\n\t\t\t\tthis._originalTextureHeight = this._currentTexture.nativeHeight;\n\t\t\t}\n\t\t\tif(!this.image)\n\t\t\t{\n\t\t\t\tthis.image = new Image(this._currentTexture);\n\t\t\t\tthis.addChild(this.image);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.image.texture = this._currentTexture;\n\t\t\t\tthis.image.readjustSize();\n\t\t\t}\n\t\t\tthis.image.visible = true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function cleanupTexture():void\n\t\t{\n\t\t\tif(this._texture)\n\t\t\t{\n\t\t\t\tif(this._isTextureOwner)\n\t\t\t\t{\n\t\t\t\t\tif(!SystemUtil.isDesktop && !SystemUtil.isApplicationActive)\n\t\t\t\t\t{\n\t\t\t\t\t\t//avoiding stage3d calls when a mobile application isn't active\n\t\t\t\t\t\tSystemUtil.executeWhenApplicationIsActive(this._texture.dispose);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._texture.dispose();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(this._textureCache !== null)\n\t\t\t\t{\n\t\t\t\t\tvar cacheKey:String = this.sourceToTextureCacheKey(this._source);\n\t\t\t\t\tif(cacheKey !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._textureCache.releaseTexture(cacheKey);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._pendingBitmapDataTexture)\n\t\t\t{\n\t\t\t\tthis._pendingBitmapDataTexture.dispose();\n\t\t\t}\n\t\t\tif(this._pendingRawTextureData)\n\t\t\t{\n\t\t\t\tthis._pendingRawTextureData.clear();\n\t\t\t}\n\t\t\tthis._currentTexture = null;\n\t\t\tthis._currentTextureWidth = NaN;\n\t\t\tthis._currentTextureHeight = NaN;\n\t\t\tthis._originalTextureWidth = NaN;\n\t\t\tthis._originalTextureHeight = NaN;\n\t\t\tthis._pendingBitmapDataTexture = null;\n\t\t\tthis._pendingRawTextureData = null;\n\t\t\tthis._texture = null;\n\t\t\tthis._isTextureOwner = false;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function cleanupLoaders(close:Boolean):void\n\t\t{\n\t\t\tif(this.urlLoader)\n\t\t\t{\n\t\t\t\tthis.urlLoader.removeEventListener(flash.events.Event.COMPLETE, rawDataLoader_completeHandler);\n\t\t\t\tthis.urlLoader.removeEventListener(ProgressEvent.PROGRESS, rawDataLoader_progressHandler);\n\t\t\t\tthis.urlLoader.removeEventListener(IOErrorEvent.IO_ERROR, rawDataLoader_ioErrorHandler);\n\t\t\t\tthis.urlLoader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, rawDataLoader_securityErrorHandler);\n\t\t\t\tif(close)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.urlLoader.close();\n\t\t\t\t\t}\n\t\t\t\t\tcatch(error:Error)\n\t\t\t\t\t{\n\t\t\t\t\t\t//no need to do anything in response\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.urlLoader = null;\n\t\t\t}\n\n\t\t\tif(this.loader)\n\t\t\t{\n\t\t\t\tthis.loader.contentLoaderInfo.removeEventListener(flash.events.Event.COMPLETE, loader_completeHandler);\n\t\t\t\tthis.loader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, loader_progressHandler);\n\t\t\t\tthis.loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, loader_ioErrorHandler);\n\t\t\t\tthis.loader.contentLoaderInfo.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, loader_securityErrorHandler);\n\t\t\t\tif(close)\n\t\t\t\t{\n\t\t\t\t\tvar closed:Boolean = false;\n\t\t\t\t\tif(!this._imageDecodingOnLoad)\n\t\t\t\t\t{\n\t\t\t\t\t\t//when using ImageDecodingPolicy.ON_LOAD, calling close()\n\t\t\t\t\t\t//seems to cause the image data to get stuck in memory,\n\t\t\t\t\t\t//unable to be garbage collected!\n\t\t\t\t\t\t//to clean up the memory, we need to wait for Event.COMPLETE\n\t\t\t\t\t\t//to dispose the BitmapData and call unload(). we can't do\n\t\t\t\t\t\t//either of those things here.\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.loader.close();\n\t\t\t\t\t\t\tclosed = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch(error:Error)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(!closed)\n\t\t\t\t\t{\n\t\t\t\t\t\t//if we couldn't close() the loader, for some reason,\n\t\t\t\t\t\t//our best option is to let it complete and clean\n\t\t\t\t\t\t//things up then.\n\t\t\t\t\t\tthis.loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, orphanedLoader_completeHandler);\n\t\t\t\t\t\t//be sure to add listeners for these events, or errors\n\t\t\t\t\t\t//could be thrown! issue #1627\n\t\t\t\t\t\tthis.loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, orphanedLoader_errorHandler);\n\t\t\t\t\t\tthis.loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, orphanedLoader_errorHandler);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.loader = null;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function findSourceInCache():Boolean\n\t\t{\n\t\t\tvar cacheKey:String = this.sourceToTextureCacheKey(this._source);\n\t\t\tif(this._textureCache !== null && !this._isRestoringTexture &&\n\t\t\t\tcacheKey !== null && this._textureCache.hasTexture(cacheKey))\n\t\t\t{\n\t\t\t\tthis._texture = this._textureCache.retainTexture(cacheKey);\n\t\t\t\tthis._isTextureOwner = false;\n\t\t\t\tthis._isRestoringTexture = false;\n\t\t\t\tthis._isLoaded = true;\n\t\t\t\tthis.refreshCurrentTexture();\n\t\t\t\tthis.dispatchEventWith(starling.events.Event.COMPLETE);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * Subclasses may override this method to support sources other than\n\t\t * URLs in the texture cache.\n\t\t */\n\t\tprotected function sourceToTextureCacheKey(source:Object):String\n\t\t{\n\t\t\tif(source is String)\n\t\t\t{\n\t\t\t\treturn source as String;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function verifyCurrentStarling():void\n\t\t{\n\t\t\tif(this.stage === null || Starling.current.stage === this.stage)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.stage.starling.makeCurrent();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function replaceBitmapDataTexture(bitmapData:BitmapData):void\n\t\t{\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tif(!starling.contextValid)\n\t\t\t{\n\t\t\t\t//this trace duplicates the behavior of AssetManager\n\t\t\t\ttrace(CONTEXT_LOST_WARNING);\n\t\t\t\tsetTimeout(replaceBitmapDataTexture, 1, bitmapData);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!SystemUtil.isDesktop && !SystemUtil.isApplicationActive)\n\t\t\t{\n\t\t\t\t//avoiding stage3d calls when a mobile application isn't active\n\t\t\t\tSystemUtil.executeWhenApplicationIsActive(replaceBitmapDataTexture, bitmapData);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.verifyCurrentStarling();\n\n\t\t\tif(this.findSourceInCache())\n\t\t\t{\n\t\t\t\t//someone else added this URL to the cache while we were in the\n\t\t\t\t//middle of loading it. we can reuse the texture from the cache!\n\n\t\t\t\t//don't forget to dispose the BitmapData, though...\n\t\t\t\tbitmapData.dispose();\n\n\t\t\t\t//then invalidate so that everything is resized correctly\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(!this._texture)\n\t\t\t{\n\t\t\t\t//skip Texture.fromBitmapData() because we don't want\n\t\t\t\t//it to create an onRestore function that will be\n\t\t\t\t//immediately discarded for garbage collection.\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tthis._texture = Texture.empty(bitmapData.width / this._scaleFactor,\n\t\t\t\t\t\tbitmapData.height / this._scaleFactor, true, false, false,\n\t\t\t\t\t\tthis._scaleFactor, this._textureFormat);\n\t\t\t\t}\n\t\t\t\tcatch(error:Error)\n\t\t\t\t{\n\t\t\t\t\tthis.cleanupTexture();\n\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\t\t\tthis.dispatchEventWith(starling.events.Event.IO_ERROR, false, new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, error.toString()));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._texture.root.onRestore = this.createTextureOnRestore(this._texture,\n\t\t\t\t\tthis._source, this._textureFormat, this._scaleFactor);\n\t\t\t\tif(this._textureCache)\n\t\t\t\t{\n\t\t\t\t\tvar cacheKey:String = this.sourceToTextureCacheKey(this._source);\n\t\t\t\t\tif(cacheKey !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._textureCache.addTexture(cacheKey, this._texture, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._asyncTextureUpload)\n\t\t\t{\n\t\t\t\tthis._texture.root.uploadBitmapData(bitmapData, function():void\n\t\t\t\t{\n\t\t\t\t\tif(image !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\t//this isn't technically required because other properties of\n\t\t\t\t\t\t//the Image will be changed, but to avoid potential future\n\t\t\t\t\t\t//refactoring headaches, it won't hurt to be extra careful.\n\t\t\t\t\t\timage.setRequiresRedraw();\n\t\t\t\t\t}\n\t\t\t\t\tbitmapData.dispose();\n\t\t\t\t\t_isTextureOwner = _textureCache === null;\n\t\t\t\t\t_isRestoringTexture = false;\n\t\t\t\t\t_isLoaded = true;\n\t\t\t\t\trefreshCurrentTexture();\n\t\t\t\t\tinvalidate(INVALIDATION_FLAG_DATA);\n\t\t\t\t\tdispatchEventWith(starling.events.Event.COMPLETE);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse //synchronous\n\t\t\t{\n\t\t\t\tthis._texture.root.uploadBitmapData(bitmapData);\n\t\t\t\tif(this.image !== null)\n\t\t\t\t{\n\t\t\t\t\t//this isn't technically required because other properties of\n\t\t\t\t\t//the Image will be changed, but to avoid potential future\n\t\t\t\t\t//refactoring headaches, it won't hurt to be extra careful.\n\t\t\t\t\tthis.image.setRequiresRedraw();\n\t\t\t\t}\n\t\t\t\tbitmapData.dispose();\n\t\t\t\tthis._isTextureOwner = this._textureCache === null;\n\t\t\t\tthis._isRestoringTexture = false;\n\t\t\t\tthis._isLoaded = true;\n\t\t\t\t//let's refresh the texture right away so that properties like\n\t\t\t\t//originalSourceWidth and originalSourceHeight return the\n\t\t\t\t//correct values in the Event.COMPLETE listeners.\n\t\t\t\tthis.refreshCurrentTexture();\n\t\t\t\t//we can still do other things later, like layout\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\t\tthis.dispatchEventWith(starling.events.Event.COMPLETE);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function replaceRawTextureData(rawData:ByteArray):void\n\t\t{\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tif(!starling.contextValid)\n\t\t\t{\n\t\t\t\t//this trace duplicates the behavior of AssetManager\n\t\t\t\ttrace(CONTEXT_LOST_WARNING);\n\t\t\t\tsetTimeout(replaceRawTextureData, 1, rawData);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!SystemUtil.isDesktop && !SystemUtil.isApplicationActive)\n\t\t\t{\n\t\t\t\t//avoiding stage3d calls when a mobile application isn't active\n\t\t\t\tSystemUtil.executeWhenApplicationIsActive(replaceRawTextureData, rawData);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.verifyCurrentStarling();\n\n\t\t\tif(this.findSourceInCache())\n\t\t\t{\n\t\t\t\t//someone else added this URL to the cache while we were in the\n\t\t\t\t//middle of loading it. we can reuse the texture from the cache!\n\n\t\t\t\t//don't forget to clear the ByteArray, though...\n\t\t\t\trawData.clear();\n\n\t\t\t\t//then invalidate so that everything is resized correctly\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this._texture)\n\t\t\t{\n\t\t\t\tthis._texture.root.uploadAtfData(rawData);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tthis._texture = Texture.fromAtfData(rawData, this._scaleFactor);\n\t\t\t\t}\n\t\t\t\tcatch(error:Error)\n\t\t\t\t{\n\t\t\t\t\tthis.cleanupTexture();\n\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\t\t\tthis.dispatchEventWith(starling.events.Event.IO_ERROR, false, new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, error.toString()));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._texture.root.onRestore = this.createTextureOnRestore(this._texture,\n\t\t\t\t\tthis._source, this._textureFormat, this._scaleFactor);\n\t\t\t\tif(this._textureCache)\n\t\t\t\t{\n\t\t\t\t\tvar cacheKey:String = this.sourceToTextureCacheKey(this._source);\n\t\t\t\t\tif(cacheKey !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._textureCache.addTexture(cacheKey, this._texture, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\trawData.clear();\n\t\t\t//if we have a cache for the textures, then the cache is the owner\n\t\t\t//because other ImageLoaders may use the same texture.\n\t\t\tthis._isTextureOwner = this._textureCache === null;\n\t\t\tthis._isRestoringTexture = false;\n\t\t\tthis._isLoaded = true;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\tthis.dispatchEventWith(starling.events.Event.COMPLETE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function addToTextureQueue():void\n\t\t{\n\t\t\tif(!this._delayTextureCreation)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Cannot add loader to delayed texture queue if delayTextureCreation is false.\");\n\t\t\t}\n\t\t\tif(this._textureQueueDuration == Number.POSITIVE_INFINITY)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Cannot add loader to delayed texture queue if textureQueueDuration is Number.POSITIVE_INFINITY.\");\n\t\t\t}\n\t\t\tif(this._isInTextureQueue)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Cannot add loader to delayed texture queue more than once.\");\n\t\t\t}\n\t\t\tthis.addEventListener(starling.events.Event.REMOVED_FROM_STAGE, imageLoader_removedFromStageHandler);\n\t\t\tthis._isInTextureQueue = true;\n\t\t\tif(textureQueueTail)\n\t\t\t{\n\t\t\t\ttextureQueueTail._textureQueueNext = this;\n\t\t\t\tthis._textureQueuePrevious = textureQueueTail;\n\t\t\t\ttextureQueueTail = this;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttextureQueueHead = this;\n\t\t\t\ttextureQueueTail = this;\n\t\t\t\tthis.preparePendingTexture();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function removeFromTextureQueue():void\n\t\t{\n\t\t\tif(!this._isInTextureQueue)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar previous:ImageLoader = this._textureQueuePrevious;\n\t\t\tvar next:ImageLoader = this._textureQueueNext;\n\t\t\tthis._textureQueuePrevious = null;\n\t\t\tthis._textureQueueNext = null;\n\t\t\tthis._isInTextureQueue = false;\n\t\t\tthis.removeEventListener(starling.events.Event.REMOVED_FROM_STAGE, imageLoader_removedFromStageHandler);\n\t\t\tthis.removeEventListener(EnterFrameEvent.ENTER_FRAME, processTextureQueue_enterFrameHandler);\n\t\t\tif(previous)\n\t\t\t{\n\t\t\t\tprevious._textureQueueNext = next;\n\t\t\t}\n\t\t\tif(next)\n\t\t\t{\n\t\t\t\tnext._textureQueuePrevious = previous;\n\t\t\t}\n\t\t\tvar wasHead:Boolean = textureQueueHead == this;\n\t\t\tvar wasTail:Boolean = textureQueueTail == this;\n\t\t\tif(wasTail)\n\t\t\t{\n\t\t\t\ttextureQueueTail = previous;\n\t\t\t\tif(wasHead)\n\t\t\t\t{\n\t\t\t\t\ttextureQueueHead = previous;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(wasHead)\n\t\t\t{\n\t\t\t\ttextureQueueHead = next;\n\t\t\t\tif(wasTail)\n\t\t\t\t{\n\t\t\t\t\ttextureQueueTail = next;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(wasHead && textureQueueHead)\n\t\t\t{\n\t\t\t\ttextureQueueHead.preparePendingTexture();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function preparePendingTexture():void\n\t\t{\n\t\t\tif(this._textureQueueDuration > 0)\n\t\t\t{\n\t\t\t\tthis._accumulatedPrepareTextureTime = 0;\n\t\t\t\tthis.addEventListener(EnterFrameEvent.ENTER_FRAME, processTextureQueue_enterFrameHandler);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.processPendingTexture();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function processPendingTexture():void\n\t\t{\n\t\t\tif(this._pendingBitmapDataTexture)\n\t\t\t{\n\t\t\t\tvar bitmapData:BitmapData = this._pendingBitmapDataTexture;\n\t\t\t\tthis._pendingBitmapDataTexture = null;\n\t\t\t\tthis.replaceBitmapDataTexture(bitmapData);\n\t\t\t}\n\t\t\tif(this._pendingRawTextureData)\n\t\t\t{\n\t\t\t\tvar rawData:ByteArray = this._pendingRawTextureData;\n\t\t\t\tthis._pendingRawTextureData = null;\n\t\t\t\tthis.replaceRawTextureData(rawData);\n\t\t\t}\n\t\t\tif(this._isInTextureQueue)\n\t\t\t{\n\t\t\t\tthis.removeFromTextureQueue();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createTextureOnRestore(texture:Texture, source:Object,\n\t\t\tformat:String, scaleFactor:Number):Function\n\t\t{\n\t\t\treturn function():void\n\t\t\t{\n\t\t\t\tif(_texture === texture)\n\t\t\t\t{\n\t\t\t\t\ttexture_onRestore();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t//this is a hacky way to handle restoring the texture when the\n\t\t\t\t//current ImageLoader is no longer displaying the texture being\n\t\t\t\t//restored.\n\t\t\t\tvar otherLoader:ImageLoader = new ImageLoader();\n\t\t\t\totherLoader.source = source;\n\t\t\t\totherLoader._texture = texture;\n\t\t\t\totherLoader._textureFormat = format;\n\t\t\t\totherLoader._scaleFactor = scaleFactor;\n\t\t\t\totherLoader.validate();\n\t\t\t\totherLoader.addEventListener(starling.events.Event.COMPLETE, onRestore_onComplete);\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function onRestore_onComplete(event:starling.events.Event):void\n\t\t{\n\t\t\tvar otherLoader:ImageLoader = ImageLoader(event.currentTarget);\n\t\t\totherLoader._isTextureOwner = false;\n\t\t\totherLoader._texture = null;\n\t\t\totherLoader.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function texture_onRestore():void\n\t\t{\n\t\t\t//reload the texture from the URL\n\t\t\tthis._isRestoringTexture = true;\n\t\t\tthis._lastURL = null;\n\t\t\tthis._isLoaded = false;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function processTextureQueue_enterFrameHandler(event:EnterFrameEvent):void\n\t\t{\n\t\t\tthis._accumulatedPrepareTextureTime += event.passedTime;\n\t\t\tif(this._accumulatedPrepareTextureTime >= this._textureQueueDuration)\n\t\t\t{\n\t\t\t\tthis.removeEventListener(EnterFrameEvent.ENTER_FRAME, processTextureQueue_enterFrameHandler);\n\t\t\t\tthis.processPendingTexture();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function imageLoader_removedFromStageHandler(event:starling.events.Event):void\n\t\t{\n\t\t\tif(this._isInTextureQueue)\n\t\t\t{\n\t\t\t\tthis.removeFromTextureQueue();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function loader_completeHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tvar bitmap:Bitmap = Bitmap(this.loader.content);\n\t\t\tthis.cleanupLoaders(false);\n\n\t\t\tvar bitmapData:BitmapData = bitmap.bitmapData;\n\n\t\t\t//if the upload is synchronous, attempt to reuse the existing\n\t\t\t//texture so that we don't need to create a new one.\n\t\t\t//when AIR-4198247 is fixed in a stable build, this can be removed\n\t\t\t//(perhaps with some kind of AIR version detection, though)\n\t\t\tvar canReuseTexture:Boolean =\n\t\t\t\tthis._texture !== null &&\n\t\t\t\t(!Texture.asyncBitmapUploadEnabled || !this._asyncTextureUpload) &&\n\t\t\t\tthis._texture.nativeWidth == bitmapData.width &&\n\t\t\t\tthis._texture.nativeHeight == bitmapData.height &&\n\t\t\t\tthis._texture.scale == this._scaleFactor &&\n\t\t\t\tthis._texture.format == this._textureFormat;\n\t\t\tif(!canReuseTexture)\n\t\t\t{\n\t\t\t\tthis.cleanupTexture();\n\t\t\t\tif(this._textureCache)\n\t\t\t\t{\n\t\t\t\t\t//we need to replace the current texture in the cache,\n\t\t\t\t\t//so we need to remove the old one so that the cache\n\t\t\t\t\t//doesn't throw an error because there's already a\n\t\t\t\t\t//texture with this key.\n\t\t\t\t\tvar key:String = this.sourceToTextureCacheKey(this._source);\n\t\t\t\t\tthis._textureCache.removeTexture(key);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._delayTextureCreation && !this._isRestoringTexture)\n\t\t\t{\n\t\t\t\tthis._pendingBitmapDataTexture = bitmapData;\n\t\t\t\tif(this._textureQueueDuration < Number.POSITIVE_INFINITY)\n\t\t\t\t{\n\t\t\t\t\tthis.addToTextureQueue();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.replaceBitmapDataTexture(bitmapData);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function loader_progressHandler(event:ProgressEvent):void\n\t\t{\n\t\t\tthis.dispatchEventWith(FeathersEventType.PROGRESS, false, event.bytesLoaded / event.bytesTotal);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function loader_ioErrorHandler(event:IOErrorEvent):void\n\t\t{\n\t\t\tthis.cleanupLoaders(false);\n\t\t\tthis.cleanupTexture();\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\tthis.dispatchEventWith(FeathersEventType.ERROR, false, event);\n\t\t\tthis.dispatchEventWith(starling.events.Event.IO_ERROR, false, event);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function loader_securityErrorHandler(event:SecurityErrorEvent):void\n\t\t{\n\t\t\tthis.cleanupLoaders(false);\n\t\t\tthis.cleanupTexture();\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\tthis.dispatchEventWith(FeathersEventType.ERROR, false, event);\n\t\t\tthis.dispatchEventWith(starling.events.Event.SECURITY_ERROR, false, event);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function orphanedLoader_completeHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tvar loaderInfo:LoaderInfo = LoaderInfo(event.currentTarget);\n\t\t\tloaderInfo.removeEventListener(flash.events.Event.COMPLETE, orphanedLoader_completeHandler);\n\t\t\tloaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, orphanedLoader_errorHandler);\n\t\t\tloaderInfo.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, orphanedLoader_errorHandler);\n\t\t\tvar loader:Loader = loaderInfo.loader;\n\t\t\tvar bitmap:Bitmap = Bitmap(loader.content);\n\t\t\tbitmap.bitmapData.dispose();\n\t\t\t//we could call unloadAndStop() and force the garbage collector to\n\t\t\t//run, but that could hurt performance, so let it happen naturally.\n\t\t\tloader.unload();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function orphanedLoader_errorHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tvar loaderInfo:LoaderInfo = LoaderInfo(event.currentTarget);\n\t\t\tloaderInfo.removeEventListener(flash.events.Event.COMPLETE, orphanedLoader_completeHandler);\n\t\t\tloaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, orphanedLoader_errorHandler);\n\t\t\tloaderInfo.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, orphanedLoader_errorHandler);\n\t\t\t//no need to do anything else. this listener only exists to avoid\n\t\t\t//a runtime error on an resource that is no longer required\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function rawDataLoader_completeHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tvar rawData:ByteArray = ByteArray(this.urlLoader.data);\n\t\t\tthis.cleanupLoaders(false);\n\n\t\t\t//only clear the texture if we're not restoring\n\t\t\tif(!this._isRestoringTexture)\n\t\t\t{\n\t\t\t\tthis.cleanupTexture();\n\t\t\t}\n\t\t\tif(this._delayTextureCreation && !this._isRestoringTexture)\n\t\t\t{\n\t\t\t\tthis._pendingRawTextureData = rawData;\n\t\t\t\tif(this._textureQueueDuration < Number.POSITIVE_INFINITY)\n\t\t\t\t{\n\t\t\t\t\tthis.addToTextureQueue();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.replaceRawTextureData(rawData);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function rawDataLoader_progressHandler(event:ProgressEvent):void\n\t\t{\n\t\t\tthis.dispatchEventWith(FeathersEventType.PROGRESS, false, event.bytesLoaded / event.bytesTotal);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function rawDataLoader_ioErrorHandler(event:ErrorEvent):void\n\t\t{\n\t\t\tthis.cleanupLoaders(false);\n\t\t\tthis.cleanupTexture();\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\tthis.dispatchEventWith(FeathersEventType.ERROR, false, event);\n\t\t\tthis.dispatchEventWith(starling.events.Event.IO_ERROR, false, event);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function rawDataLoader_securityErrorHandler(event:ErrorEvent):void\n\t\t{\n\t\t\tthis.cleanupLoaders(false);\n\t\t\tthis.cleanupTexture();\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\tthis.dispatchEventWith(FeathersEventType.ERROR, false, event);\n\t\t\tthis.dispatchEventWith(starling.events.Event.SECURITY_ERROR, false, event);\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/controls/ItemRendererLayoutOrder.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\t/**\n\t * Layout options for the default item renderers.\n\t *\n\t * @see feathers.controls.DefaultListItemRenderer\n\t * @see feathers.controls.DefaultGroupedListItemRenderer\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class ItemRendererLayoutOrder\n\t{\n\t\t/**\n\t\t * The layout order will be the label first, then the accessory relative\n\t\t * to the label, then the icon relative to both. Best used when the\n\t\t * accessory should be between the label and the icon or when the icon\n\t\t * position shouldn't be affected by the accessory.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const LABEL_ACCESSORY_ICON:String = \"labelAccessoryIcon\";\n\n\t\t/**\n\t\t * The layout order will be the label first, then the icon relative to\n\t\t * label, then the accessory relative to both.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const LABEL_ICON_ACCESSORY:String = \"labelIconAccessory\";\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/Label.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IMeasureDisplayObject;\n\timport feathers.core.ITextBaselineControl;\n\timport feathers.core.ITextRenderer;\n\timport feathers.core.IToolTip;\n\timport feathers.core.IValidating;\n\timport feathers.core.PropertyProxy;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.text.FontStylesSet;\n\timport feathers.utils.skins.resetFluidChildDimensionsForMeasurement;\n\n\timport flash.geom.Point;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.text.TextFormat;\n\timport starling.utils.Pool;\n\n\t/**\n\t * A background to display when the label is disabled.\n\t *\n\t * <p>In the following example, the label is given a disabled background skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * label.backgroundDisabledSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #backgroundSkin\n\t */\n\t[Style(name=\"backgroundDisabledSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The default background to display behind the label's text.\n\t *\n\t * <p>In the following example, the label is given a background skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * label.backgroundSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #backgroundDisabledSkin\n\t */\n\t[Style(name=\"backgroundSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * A style name to add to the label's text renderer sub-component.\n\t * Typically used by a theme to provide different styles to different\n\t * labels.\n\t *\n\t * <p>In the following example, a custom text renderer style name is\n\t * passed to the label:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * label.customTextRendererStyleName = \"my-custom-label-text-renderer\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( BitmapFontTextRenderer ).setFunctionForStyleName( \"my-custom-label-text-renderer\", setCustomLabelTextRendererStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_TEXT_RENDERER\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #textRendererFactory\n\t */\n\t[Style(name=\"customTextRendererStyleName\",type=\"String\")]\n\n\t/**\n\t * The font styles used to display the label's text when the label is\n\t * disabled.\n\t *\n\t * <p>In the following example, the disabled font styles are customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * label.disabledFontStyles = new TextFormat( \"Helvetica\", 20, 0x999999 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>textRendererFactory</code> to set more advanced styles on the\n\t * text renderer.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:fontStyles\n\t */\n\t[Style(name=\"disabledFontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The font styles used to display the label's text.\n\t *\n\t * <p>In the following example, the font styles are customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * label.fontStyles = new TextFormat( \"Helvetica\", 20, 0xcc0000 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>textRendererFactory</code> to set more advanced styles.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:disabledFontStyles\n\t */\n\t[Style(name=\"fontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * Quickly sets all padding properties to the same value. The\n\t * <code>padding</code> getter always returns the value of\n\t * <code>paddingTop</code>, but the other padding values may be\n\t * different.\n\t *\n\t * <p>In the following example, the padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * label.padding = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:paddingTop\n\t * @see #style:paddingRight\n\t * @see #style:paddingBottom\n\t * @see #style:paddingLeft\n\t */\n\t[Style(name=\"padding\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the label's top edge and the\n\t * label's text.\n\t *\n\t * <p>In the following example, the top padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * label.paddingTop = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingTop\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the label's right edge and\n\t * the label's text.\n\t *\n\t * <p>In the following example, the right padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * label.paddingRight = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingRight\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the label's bottom edge and\n\t * the label's text.\n\t *\n\t * <p>In the following example, the bottom padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * label.paddingBottom = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingBottom\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the label's left edge and the\n\t * label's text.\n\t *\n\t * <p>In the following example, the left padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * label.paddingLeft = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingLeft\",type=\"Number\")]\n\n\t/**\n\t * Determines if the text wraps to the next line when it reaches the\n\t * width (or max width) of the component.\n\t *\n\t * <p>In the following example, the label's text is wrapped:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * label.wordWrap = true;</listing>\n\t *\n\t * @default false\n\t */\n\t[Style(name=\"wordWrap\",type=\"Boolean\")]\n\n\t/**\n\t * Displays text using a text renderer.\n\t *\n\t * @see ../../../help/label.html How to use the Feathers Label component\n\t * @see ../../../help/text-renderers.html Introduction to Feathers text renderers\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class Label extends FeathersControl implements ITextBaselineControl, IToolTip\n\t{\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the text\n\t\t * renderer.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t * @see ../../../help/text-renderers.html Introduction to Feathers text renderers\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_TEXT_RENDERER:String = \"feathers-label-text-renderer\";\n\n\t\t/**\n\t\t * An alternate style name to use with <code>Label</code> to allow a\n\t\t * theme to give it a larger style meant for headings. If a theme does\n\t\t * not provide a style for a heading label, the theme will automatically\n\t\t * fall back to using the default style for a label.\n\t\t *\n\t\t * <p>An alternate style name should always be added to a component's\n\t\t * <code>styleNameList</code> before the component is initialized. If\n\t\t * the style name is added later, it will be ignored.</p>\n\t\t *\n\t\t * <p>In the following example, the heading style is applied to a label:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var label:Label = new Label();\n\t\t * label.text = \"Very Important Heading\";\n\t\t * label.styleNameList.add( Label.ALTERNATE_STYLE_NAME_HEADING );\n\t\t * this.addChild( label );</listing>\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const ALTERNATE_STYLE_NAME_HEADING:String = \"feathers-heading-label\";\n\n\t\t/**\n\t\t * An alternate style name to use with <code>Label</code> to allow a\n\t\t * theme to give it a smaller style meant for less-important details. If\n\t\t * a theme does not provide a style for a detail label, the theme will\n\t\t * automatically fall back to using the default style for a label.\n\t\t *\n\t\t * <p>An alternate style name should always be added to a component's\n\t\t * <code>styleNameList</code> before the component is initialized. If\n\t\t * the style name is added later, it will be ignored.</p>\n\t\t *\n\t\t * <p>In the following example, the detail style is applied to a label:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var label:Label = new Label();\n\t\t * label.text = \"Less important, detailed text\";\n\t\t * label.styleNameList.add( Label.ALTERNATE_STYLE_NAME_DETAIL );\n\t\t * this.addChild( label );</listing>\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const ALTERNATE_STYLE_NAME_DETAIL:String = \"feathers-detail-label\";\n\n\t\t/**\n\t\t * An alternate style name to use with <code>Label</code> to allow a\n\t\t * theme to give it a tool tip style for use with the tool tip manager.\n\t\t * If a theme does not provide a style for a tool tip label, the theme\n\t\t * will automatically fall back to using the default style for a label.\n\t\t *\n\t\t * <p>An alternate style name should always be added to a component's\n\t\t * <code>styleNameList</code> before the component is initialized. If\n\t\t * the style name is added later, it will be ignored.</p>\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const ALTERNATE_STYLE_NAME_TOOL_TIP:String = \"feathers-tool-tip\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>Label</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function Label()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.isQuickHitAreaEnabled = true;\n\t\t\tif(this._fontStylesSet === null)\n\t\t\t{\n\t\t\t\tthis._fontStylesSet = new FontStylesSet();\n\t\t\t\tthis._fontStylesSet.addEventListener(Event.CHANGE, fontStyles_changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the text\n\t\t * renderer. This variable is <code>protected</code> so that sub-classes\n\t\t * can customize the text renderer style name in their constructors\n\t\t * instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_TEXT_RENDERER</code>.\n\t\t *\n\t\t * <p>To customize the text renderer style name without subclassing, see\n\t\t * <code>customTextRendererStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customTextRendererStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var textRendererStyleName:String = DEFAULT_CHILD_STYLE_NAME_TEXT_RENDERER;\n\n\t\t/**\n\t\t * The text renderer.\n\t\t *\n\t\t * @see #createTextRenderer()\n\t\t * @see #textRendererFactory\n\t\t */\n\t\tprotected var textRenderer:ITextRenderer;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn Label.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _text:String = null;\n\n\t\t/**\n\t\t * The text displayed by the label.\n\t\t *\n\t\t * <p>In the following example, the label's text is updated:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * label.text = \"Hello World\";</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get text():String\n\t\t{\n\t\t\treturn this._text;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set text(value:String):void\n\t\t{\n\t\t\tif(this._text == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._text = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _wordWrap:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get wordWrap():Boolean\n\t\t{\n\t\t\treturn this._wordWrap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set wordWrap(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._wordWrap === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._wordWrap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * The baseline measurement of the text, in pixels.\n\t\t */\n\t\tpublic function get baseline():Number\n\t\t{\n\t\t\tif(!this.textRenderer)\n\t\t\t{\n\t\t\t\treturn this.scaledActualHeight;\n\t\t\t}\n\t\t\treturn this.scaleY * (this.textRenderer.y + this.textRenderer.baseline);\n\t\t}\n\n\t\t/**\n\t\t * The number of text lines displayed by the label. The component may\n\t\t * contain multiple text lines if the text contains line breaks or if\n\t\t * the <code>wordWrap</code> property is enabled.\n\t\t *\n\t\t * @see #wordWrap\n\t\t */\n\t\tpublic function get numLines():int\n\t\t{\n\t\t\tif(this.textRenderer === null)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn this.textRenderer.numLines;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textRendererFactory:Function;\n\n\t\t/**\n\t\t * A function used to instantiate the label's text renderer\n\t\t * sub-component. By default, the label will use the global text\n\t\t * renderer factory, <code>FeathersControl.defaultTextRendererFactory()</code>,\n\t\t * to create the text renderer. The text renderer must be an instance of\n\t\t * <code>ITextRenderer</code>. This factory can be used to change\n\t\t * properties on the text renderer when it is first created. For\n\t\t * instance, if you are skinning Feathers components without a theme,\n\t\t * you might use this factory to style the text renderer.\n\t\t *\n\t\t * <p>The factory should have the following function signature:</p>\n\t\t * <pre>function():ITextRenderer</pre>\n\t\t *\n\t\t * <p>In the following example, a custom text renderer factory is passed\n\t\t * to the label:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * label.textRendererFactory = function():ITextRenderer\n\t\t * {\n\t\t *     return new TextFieldTextRenderer();\n\t\t * }</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.ITextRenderer\n\t\t * @see feathers.core.FeathersControl#defaultTextRendererFactory\n\t\t */\n\t\tpublic function get textRendererFactory():Function\n\t\t{\n\t\t\treturn this._textRendererFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set textRendererFactory(value:Function):void\n\t\t{\n\t\t\tif(this._textRendererFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textRendererFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customTextRendererStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customTextRendererStyleName():String\n\t\t{\n\t\t\treturn this._customTextRendererStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customTextRendererStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customTextRendererStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customTextRendererStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fontStylesSet:FontStylesSet;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get fontStyles():TextFormat\n\t\t{\n\t\t\treturn this._fontStylesSet.format;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set fontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._fontStylesSet.format;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._fontStylesSet.format = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get disabledFontStyles():TextFormat\n\t\t{\n\t\t\treturn this._fontStylesSet.disabledFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disabledFontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._fontStylesSet.disabledFormat;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._fontStylesSet.disabledFormat = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textRendererProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the label's text renderer\n\t\t * sub-component, and the properties will be passed down to the text\n\t\t * renderer when the label validates. The available properties\n\t\t * depend on which <code>ITextRenderer</code> implementation is returned\n\t\t * by <code>textRendererFactory</code>. Refer to\n\t\t * <a href=\"../core/ITextRenderer.html\"><code>feathers.core.ITextRenderer</code></a>\n\t\t * for a list of available text renderer implementations.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>textRendererFactory</code> function\n\t\t * instead of using <code>textRendererProperties</code> will result in\n\t\t * better performance.</p>\n\t\t *\n\t\t * <p>In the following example, the label's text renderer's properties\n\t\t * are updated (this example assumes that the label text renderer is a\n\t\t * <code>TextFieldTextRenderer</code>):</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * label.textRendererProperties.textFormat = new TextFormat( \"Source Sans Pro\", 16, 0x333333 );\n\t\t * label.textRendererProperties.embedFonts = true;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #textRendererFactory\n\t\t * @see feathers.core.ITextRenderer\n\t\t */\n\t\tpublic function get textRendererProperties():Object\n\t\t{\n\t\t\tif(!this._textRendererProperties)\n\t\t\t{\n\t\t\t\tthis._textRendererProperties = new PropertyProxy(textRendererProperties_onChange);\n\t\t\t}\n\t\t\treturn this._textRendererProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set textRendererProperties(value:Object):void\n\t\t{\n\t\t\tif(this._textRendererProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value && !(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvalue = PropertyProxy.fromObject(value);\n\t\t\t}\n\t\t\tif(this._textRendererProperties)\n\t\t\t{\n\t\t\t\tthis._textRendererProperties.removeOnChangeCallback(textRendererProperties_onChange);\n\t\t\t}\n\t\t\tthis._textRendererProperties = PropertyProxy(value);\n\t\t\tif(this._textRendererProperties)\n\t\t\t{\n\t\t\t\tthis._textRendererProperties.addOnChangeCallback(textRendererProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitTextRendererWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitTextRendererHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitTextRendererMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitTextRendererMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitTextRendererMaxWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitTextRendererMaxHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMaxWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMaxHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var currentBackgroundSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _backgroundSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundSkin():DisplayObject\n\t\t{\n\t\t\treturn this._backgroundSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSkin !== null &&\n\t\t\t\tthis.currentBackgroundSkin === this._backgroundSkin)\n\t\t\t{\n\t\t\t\tthis.removeCurrentBackgroundSkin(this._backgroundSkin);\n\t\t\t\tthis.currentBackgroundSkin = null;\n\t\t\t}\n\t\t\tthis._backgroundSkin = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _backgroundDisabledSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundDisabledSkin():DisplayObject\n\t\t{\n\t\t\treturn this._backgroundDisabledSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundDisabledSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundDisabledSkin !== null &&\n\t\t\t\tthis.currentBackgroundSkin == this._backgroundDisabledSkin)\n\t\t\t{\n\t\t\t\tthis.removeCurrentBackgroundSkin(this._backgroundDisabledSkin);\n\t\t\t\tthis.currentBackgroundSkin = null;\n\t\t\t}\n\t\t\tthis._backgroundDisabledSkin = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get padding():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set padding(value:Number):void\n\t\t{\n\t\t\tthis.paddingTop = value;\n\t\t\tthis.paddingRight = value;\n\t\t\tthis.paddingBottom = value;\n\t\t\tthis.paddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingTop:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingTop():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingTop(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingTop = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingRight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingRight():Number\n\t\t{\n\t\t\treturn this._paddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingRight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingBottom:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingBottom():Number\n\t\t{\n\t\t\treturn this._paddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingBottom = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingLeft:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingLeft = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//we don't dispose it if the label is the parent because it'll\n\t\t\t//already get disposed in super.dispose()\n\t\t\tif(this._backgroundSkin !== null &&\n\t\t\t\tthis._backgroundSkin.parent !== this)\n\t\t\t{\n\t\t\t\tthis._backgroundSkin.dispose();\n\t\t\t}\n\t\t\tif(this._backgroundDisabledSkin !== null &&\n\t\t\t\tthis._backgroundDisabledSkin.parent !== this)\n\t\t\t{\n\t\t\t\tthis._backgroundDisabledSkin.dispose();\n\t\t\t}\n\t\t\tif(this._fontStylesSet !== null)\n\t\t\t{\n\t\t\t\tthis._fontStylesSet.dispose();\n\t\t\t\tthis._fontStylesSet = null;\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar textRendererInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_TEXT_RENDERER);\n\n\t\t\tif(sizeInvalid || stylesInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshBackgroundSkin();\n\t\t\t}\n\n\t\t\tif(textRendererInvalid)\n\t\t\t{\n\t\t\t\tthis.createTextRenderer();\n\t\t\t}\n\n\t\t\tif(textRendererInvalid || dataInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshTextRendererData();\n\t\t\t}\n\n\t\t\tif(textRendererInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshEnabled();\n\t\t\t}\n\n\t\t\tif(textRendererInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshTextRendererStyles();\n\t\t\t}\n\n\t\t\tsizeInvalid = this.autoSizeIfNeeded() || sizeInvalid;\n\n\t\t\tthis.layoutChildren();\n\t\t}\n\n\t\t/**\n\t\t * If the component's dimensions have not been set explicitly, it will\n\t\t * measure its content and determine an ideal size for itself. If the\n\t\t * <code>explicitWidth</code> or <code>explicitHeight</code> member\n\t\t * variables are set, those value will be used without additional\n\t\t * measurement. If one is set, but not the other, the dimension with the\n\t\t * explicit value will not be measured, but the other non-explicit\n\t\t * dimension will still need measurement.\n\t\t *\n\t\t * <p>Calls <code>saveMeasurements()</code> to set up the\n\t\t * <code>actualWidth</code> and <code>actualHeight</code> member\n\t\t * variables used for layout.</p>\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t */\n\t\tprotected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tresetFluidChildDimensionsForMeasurement(DisplayObject(this.textRenderer),\n\t\t\t\tthis._explicitWidth - this._paddingLeft - this._paddingRight,\n\t\t\t\tthis._explicitHeight - this._paddingTop - this._paddingBottom,\n\t\t\t\tthis._explicitMinWidth - this._paddingLeft - this._paddingRight,\n\t\t\t\tthis._explicitMinHeight - this._paddingTop - this._paddingBottom,\n\t\t\t\tthis._explicitMaxWidth - this._paddingLeft - this._paddingRight,\n\t\t\t\tthis._explicitMaxHeight - this._paddingTop - this._paddingBottom,\n\t\t\t\tthis._explicitTextRendererWidth, this._explicitTextRendererHeight,\n\t\t\t\tthis._explicitTextRendererMinWidth, this._explicitTextRendererMinHeight,\n\t\t\t\tthis._explicitTextRendererMaxWidth, this._explicitTextRendererMaxHeight);\n\t\t\tthis.textRenderer.maxWidth = this._explicitMaxWidth - this._paddingLeft - this._paddingRight;\n\t\t\tthis.textRenderer.maxHeight = this._explicitMaxHeight - this._paddingTop - this._paddingBottom;\n\t\t\tvar point:Point = Pool.getPoint();\n\t\t\tthis.textRenderer.measureText(point);\n\n\t\t\tvar measureBackground:IMeasureDisplayObject = this.currentBackgroundSkin as IMeasureDisplayObject;\n\t\t\tresetFluidChildDimensionsForMeasurement(this.currentBackgroundSkin,\n\t\t\t\tthis._explicitWidth, this._explicitHeight,\n\t\t\t\tthis._explicitMinWidth, this._explicitMinHeight,\n\t\t\t\tthis._explicitMaxWidth, this._explicitMaxHeight,\n\t\t\t\tthis._explicitBackgroundWidth, this._explicitBackgroundHeight,\n\t\t\t\tthis._explicitBackgroundMinWidth, this._explicitBackgroundMinHeight,\n\t\t\t\tthis._explicitBackgroundMaxWidth, this._explicitBackgroundMaxHeight);\n\t\t\tif(this.currentBackgroundSkin is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.currentBackgroundSkin).validate();\n\t\t\t}\n\n\t\t\t//minimum dimensions\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\t//if we don't have an explicitWidth, then the minimum width\n\t\t\t\t//should be small to allow wrapping or truncation\n\t\t\t\tif(this._text && !needsWidth)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = point.x;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = 0;\n\t\t\t\t}\n\t\t\t\tnewMinWidth += this._paddingLeft + this._paddingRight;\n\t\t\t\tvar backgroundMinWidth:Number = 0;\n\t\t\t\tif(measureBackground !== null)\n\t\t\t\t{\n\t\t\t\t\tbackgroundMinWidth = measureBackground.minWidth;\n\t\t\t\t}\n\t\t\t\telse if(this.currentBackgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tbackgroundMinWidth = this._explicitBackgroundMinWidth;\n\t\t\t\t}\n\t\t\t\tif(backgroundMinWidth > newMinWidth)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = backgroundMinWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tif(this._text)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = point.y;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = 0;\n\t\t\t\t}\n\t\t\t\tnewMinHeight += this._paddingTop + this._paddingBottom;\n\t\t\t\tvar backgroundMinHeight:Number = 0;\n\t\t\t\tif(measureBackground !== null)\n\t\t\t\t{\n\t\t\t\t\tbackgroundMinHeight = measureBackground.minHeight;\n\t\t\t\t}\n\t\t\t\telse if(this.currentBackgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tbackgroundMinHeight = this._explicitBackgroundMinHeight;\n\t\t\t\t}\n\t\t\t\tif(backgroundMinHeight > newMinHeight)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = backgroundMinHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tif(this._text)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = point.x;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewWidth = 0;\n\t\t\t\t}\n\t\t\t\tnewWidth += this._paddingLeft + this._paddingRight;\n\t\t\t\tif(this.currentBackgroundSkin !== null &&\n\t\t\t\t\tthis.currentBackgroundSkin.width > newWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this.currentBackgroundSkin.width;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tif(this._text)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = point.y;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewHeight = 0;\n\t\t\t\t}\n\t\t\t\tnewHeight += this._paddingTop + this._paddingBottom;\n\t\t\t\tif(this.currentBackgroundSkin !== null &&\n\t\t\t\t\tthis.currentBackgroundSkin.height > newHeight) //!isNaN\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this.currentBackgroundSkin.height;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tPool.putPoint(point);\n\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>textRenderer</code> sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #textRenderer\n\t\t * @see #textRendererFactory\n\t\t */\n\t\tprotected function createTextRenderer():void\n\t\t{\n\t\t\tif(this.textRenderer !== null)\n\t\t\t{\n\t\t\t\tthis.removeChild(DisplayObject(this.textRenderer), true);\n\t\t\t\tthis.textRenderer = null;\n\t\t\t}\n\n\t\t\tvar factory:Function = this._textRendererFactory != null ? this._textRendererFactory : FeathersControl.defaultTextRendererFactory;\n\t\t\tthis.textRenderer = ITextRenderer(factory());\n\t\t\tvar textRendererStyleName:String = this._customTextRendererStyleName != null ? this._customTextRendererStyleName : this.textRendererStyleName;\n\t\t\tthis.textRenderer.styleNameList.add(textRendererStyleName);\n\t\t\tthis.addChild(DisplayObject(this.textRenderer));\n\n\t\t\tthis.textRenderer.initializeNow();\n\t\t\tthis._explicitTextRendererWidth = this.textRenderer.explicitWidth;\n\t\t\tthis._explicitTextRendererHeight = this.textRenderer.explicitHeight;\n\t\t\tthis._explicitTextRendererMinWidth = this.textRenderer.explicitMinWidth;\n\t\t\tthis._explicitTextRendererMinHeight = this.textRenderer.explicitMinHeight;\n\t\t\tthis._explicitTextRendererMaxWidth = this.textRenderer.explicitMaxWidth;\n\t\t\tthis._explicitTextRendererMaxHeight = this.textRenderer.explicitMaxHeight;\n\t\t}\n\n\t\t/**\n\t\t * Choose the appropriate background skin based on the control's current\n\t\t * state.\n\t\t */\n\t\tprotected function refreshBackgroundSkin():void\n\t\t{\n\t\t\tvar newCurrentBackgroundSkin:DisplayObject = this._backgroundSkin;\n\t\t\tif(!this._isEnabled && this._backgroundDisabledSkin !== null)\n\t\t\t{\n\t\t\t\tnewCurrentBackgroundSkin = this._backgroundDisabledSkin;\n\t\t\t}\n\t\t\tif(this.currentBackgroundSkin !== newCurrentBackgroundSkin)\n\t\t\t{\n\t\t\t\tthis.removeCurrentBackgroundSkin(this.currentBackgroundSkin);\n\t\t\t\tthis.currentBackgroundSkin = newCurrentBackgroundSkin;\n\t\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(this.currentBackgroundSkin is IFeathersControl)\n\t\t\t\t\t{\n\t\t\t\t\t\tIFeathersControl(this.currentBackgroundSkin).initializeNow();\n\t\t\t\t\t}\n\t\t\t\t\tif(this.currentBackgroundSkin is IMeasureDisplayObject)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar measureSkin:IMeasureDisplayObject = IMeasureDisplayObject(this.currentBackgroundSkin);\n\t\t\t\t\t\tthis._explicitBackgroundWidth = measureSkin.explicitWidth;\n\t\t\t\t\t\tthis._explicitBackgroundHeight = measureSkin.explicitHeight;\n\t\t\t\t\t\tthis._explicitBackgroundMinWidth = measureSkin.explicitMinWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMinHeight = measureSkin.explicitMinHeight;\n\t\t\t\t\t\tthis._explicitBackgroundMaxWidth = measureSkin.explicitMaxWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMaxHeight = measureSkin.explicitMaxHeight;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._explicitBackgroundWidth = this.currentBackgroundSkin.width;\n\t\t\t\t\t\tthis._explicitBackgroundHeight = this.currentBackgroundSkin.height;\n\t\t\t\t\t\tthis._explicitBackgroundMinWidth = this._explicitBackgroundWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMinHeight = this._explicitBackgroundHeight;\n\t\t\t\t\t\tthis._explicitBackgroundMaxWidth = this._explicitBackgroundWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMaxHeight = this._explicitBackgroundHeight;\n\t\t\t\t\t}\n\t\t\t\t\tthis.addChildAt(this.currentBackgroundSkin, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function removeCurrentBackgroundSkin(skin:DisplayObject):void\n\t\t{\n\t\t\tif(skin === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(skin.parent === this)\n\t\t\t{\n\t\t\t\t//we need to restore these values so that they won't be lost the\n\t\t\t\t//next time that this skin is used for measurement\n\t\t\t\tskin.width = this._explicitBackgroundWidth;\n\t\t\t\tskin.height = this._explicitBackgroundHeight;\n\t\t\t\tif(skin is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar measureSkin:IMeasureDisplayObject = IMeasureDisplayObject(skin);\n\t\t\t\t\tmeasureSkin.minWidth = this._explicitBackgroundMinWidth;\n\t\t\t\t\tmeasureSkin.minHeight = this._explicitBackgroundMinHeight;\n\t\t\t\t\tmeasureSkin.maxWidth = this._explicitBackgroundMaxWidth;\n\t\t\t\t\tmeasureSkin.maxHeight = this._explicitBackgroundMaxHeight;\n\t\t\t\t}\n\t\t\t\tskin.removeFromParent(false);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Positions and sizes children based on the actual width and height\n\t\t * values.\n\t\t */\n\t\tprotected function layoutChildren():void\n\t\t{\n\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t{\n\t\t\t\tthis.currentBackgroundSkin.x = 0;\n\t\t\t\tthis.currentBackgroundSkin.y = 0;\n\t\t\t\tthis.currentBackgroundSkin.width = this.actualWidth;\n\t\t\t\tthis.currentBackgroundSkin.height = this.actualHeight;\n\t\t\t}\n\t\t\tthis.textRenderer.x = this._paddingLeft;\n\t\t\tthis.textRenderer.y = this._paddingTop;\n\t\t\tthis.textRenderer.width = this.actualWidth - this._paddingLeft - this._paddingRight;\n\t\t\tthis.textRenderer.height = this.actualHeight - this._paddingTop - this._paddingBottom;\n\t\t\tthis.textRenderer.validate();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshEnabled():void\n\t\t{\n\t\t\tthis.textRenderer.isEnabled = this._isEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshTextRendererData():void\n\t\t{\n\t\t\tthis.textRenderer.text = this._text;\n\t\t\tthis.textRenderer.visible = this._text && this._text.length > 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshTextRendererStyles():void\n\t\t{\n\t\t\tthis.textRenderer.fontStyles = this._fontStylesSet;\n\t\t\tthis.textRenderer.wordWrap = this._wordWrap;\n\t\t\tfor(var propertyName:String in this._textRendererProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._textRendererProperties[propertyName];\n\t\t\t\tthis.textRenderer[propertyName] = propertyValue;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function fontStyles_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textRendererProperties_onChange(proxy:PropertyProxy, propertyName:String):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/LayoutGroup.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IMeasureDisplayObject;\n\timport feathers.core.IValidating;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.ILayout;\n\timport feathers.layout.ILayoutDisplayObject;\n\timport feathers.layout.IVirtualLayout;\n\timport feathers.layout.LayoutBoundsResult;\n\timport feathers.layout.ViewPortBounds;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.utils.skins.resetFluidChildDimensionsForMeasurement;\n\n\timport flash.geom.Point;\n\n\timport starling.core.starling_internal;\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.filters.FragmentFilter;\n\timport starling.rendering.Painter;\n\n\t/**\n\t * The background to display behind all content when the layout group is\n\t * disabled. The background skin is resized to fill the full width and\n\t * height of the layout group.\n\t *\n\t * <p>In the following example, the group is given a background skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * group.backgroundDisabledSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:backgroundSkin\n\t */\n\t[Style(name=\"backgroundDisabledSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The default background to display behind all content. The background\n\t * skin is resized to fill the full width and height of the layout\n\t * group.\n\t *\n\t * <p>In the following example, the group is given a background skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * group.backgroundSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:backgroundDisabledSkin\n\t */\n\t[Style(name=\"backgroundSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * If true, the group will be clipped to its bounds. In other words,\n\t * anything appearing beyond the edges of the group will be masked or\n\t * hidden.\n\t *\n\t * <p>Since <code>LayoutGroup</code> is designed to be a light\n\t * container focused on performance, clipping is disabled by default.</p>\n\t *\n\t * <p>In the following example, clipping is enabled:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * group.clipContent = true;</listing>\n\t *\n\t * @default false\n\t */\n\t[Style(name=\"clipContent\",type=\"Boolean\")]\n\n\t/**\n\t * Controls the way that the group's children are positioned and sized.\n\t *\n\t * <p>The following example tells the group to use a horizontal layout:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var layout:HorizontalLayout = new HorizontalLayout();\n\t * layout.gap = 20;\n\t * layout.padding = 20;\n\t * container.layout = layout;</listing>\n\t *\n\t * @default null\n\t */\n\t[Style(name=\"layout\",type=\"feathers.layout.ILayout\")]\n\n\t/**\n\t * A generic container that supports layout. For a container that supports\n\t * scrolling and more robust skinning options, see <code>ScrollContainer</code>.\n\t *\n\t * <p>The following example creates a layout group with a horizontal\n\t * layout and adds two buttons to it:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var group:LayoutGroup = new LayoutGroup();\n\t * var layout:HorizontalLayout = new HorizontalLayout();\n\t * layout.gap = 20;\n\t * layout.padding = 20;\n\t * group.layout = layout;\n\t * this.addChild( group );\n\t * \n\t * var yesButton:Button = new Button();\n\t * yesButton.label = \"Yes\";\n\t * group.addChild( yesButton );\n\t * \n\t * var noButton:Button = new Button();\n\t * noButton.label = \"No\";\n\t * group.addChild( noButton );</listing>\n\t *\n\t * @see ../../../help/layout-group.html How to use the Feathers LayoutGroup component\n\t * @see feathers.controls.ScrollContainer\n\t *\n\t * @productversion Feathers 1.2.0\n\t */\n\tpublic class LayoutGroup extends FeathersControl\n\t{\n\t\t/**\n\t\t * Flag to indicate that the clipping has changed.\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_CLIPPING:String = \"clipping\";\n\n\t\t/**\n\t\t * An alternate style name to use with <code>LayoutGroup</code> to\n\t\t * allow a theme to give it a toolbar style. If a theme does not provide\n\t\t * a style for the toolbar container, the theme will automatically fall\n\t\t * back to using the default scroll container skin.\n\t\t *\n\t\t * <p>An alternate style name should always be added to a component's\n\t\t * <code>styleNameList</code> before the component is initialized. If\n\t\t * the style name is added later, it will be ignored.</p>\n\t\t *\n\t\t * <p>In the following example, the toolbar style is applied to a layout\n\t\t * group:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var group:LayoutGroup = new LayoutGroup();\n\t\t * group.styleNameList.add( LayoutGroup.ALTERNATE_STYLE_NAME_TOOLBAR );\n\t\t * this.addChild( group );</listing>\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const ALTERNATE_STYLE_NAME_TOOLBAR:String = \"feathers-toolbar-layout-group\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>LayoutGroup</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function LayoutGroup()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.addEventListener(Event.ADDED_TO_STAGE, layoutGroup_addedToStageHandler);\n\t\t\tthis.addEventListener(Event.REMOVED_FROM_STAGE, layoutGroup_removedFromStageHandler);\n\t\t}\n\n\t\t/**\n\t\t * The items added to the group.\n\t\t */\n\t\tprotected var items:Vector.<DisplayObject> = new <DisplayObject>[];\n\n\t\t/**\n\t\t * The view port bounds result object passed to the layout. Its values\n\t\t * should be set in <code>refreshViewPortBounds()</code>.\n\t\t */\n\t\tprotected var viewPortBounds:ViewPortBounds = new ViewPortBounds();\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _layoutResult:LayoutBoundsResult = new LayoutBoundsResult();\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn LayoutGroup.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _layout:ILayout;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get layout():ILayout\n\t\t{\n\t\t\treturn this._layout;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set layout(value:ILayout):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._layout == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._layout)\n\t\t\t{\n\t\t\t\tthis._layout.removeEventListener(Event.CHANGE, layout_changeHandler);\n\t\t\t}\n\t\t\tthis._layout = value;\n\t\t\tif(this._layout)\n\t\t\t{\n\t\t\t\tif(this._layout is IVirtualLayout)\n\t\t\t\t{\n\t\t\t\t\tIVirtualLayout(this._layout).useVirtualLayout = false;\n\t\t\t\t}\n\t\t\t\tthis._layout.addEventListener(Event.CHANGE, layout_changeHandler);\n\t\t\t\t//if we don't have a layout, nothing will need to be redrawn\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _clipContent:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get clipContent():Boolean\n\t\t{\n\t\t\treturn this._clipContent;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set clipContent(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._clipContent === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._clipContent = value;\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tthis.mask = null;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_CLIPPING);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMaxWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMaxHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var currentBackgroundSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _backgroundSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundSkin():DisplayObject\n\t\t{\n\t\t\treturn this._backgroundSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSkin !== null &&\n\t\t\t\tthis.currentBackgroundSkin === this._backgroundSkin)\n\t\t\t{\n\t\t\t\tthis.removeCurrentBackgroundSkin(this._backgroundSkin);\n\t\t\t\tthis.currentBackgroundSkin = null;\n\t\t\t}\n\t\t\tthis._backgroundSkin = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SKIN);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _backgroundDisabledSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundDisabledSkin():DisplayObject\n\t\t{\n\t\t\treturn this._backgroundDisabledSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundDisabledSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundDisabledSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundDisabledSkin !== null &&\n\t\t\t\tthis.currentBackgroundSkin === this._backgroundDisabledSkin)\n\t\t\t{\n\t\t\t\tthis.removeCurrentBackgroundSkin(this._backgroundDisabledSkin);\n\t\t\t\tthis.currentBackgroundSkin = null;\n\t\t\t}\n\t\t\tthis._backgroundDisabledSkin = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SKIN);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _autoSizeMode:String = AutoSizeMode.CONTENT;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"stage,content\")]\n\t\t/**\n\t\t * Determines how the layout group will set its own size when its\n\t\t * dimensions (width and height) aren't set explicitly.\n\t\t *\n\t\t * <p>In the following example, the layout group will be sized to\n\t\t * match the stage:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * group.autoSizeMode = AutoSizeMode.STAGE;</listing>\n\t\t *\n\t\t * <p>Usually defaults to <code>AutoSizeMode.CONTENT</code>. However, if\n\t\t * this component is the root of the Starling display list, defaults to\n\t\t * <code>AutoSizeMode.STAGE</code> instead.</p>\n\t\t *\n\t\t * @see feathers.controls.AutoSizeMode#STAGE\n\t\t * @see feathers.controls.AutoSizeMode#CONTENT\n\t\t */\n\t\tpublic function get autoSizeMode():String\n\t\t{\n\t\t\treturn this._autoSizeMode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set autoSizeMode(value:String):void\n\t\t{\n\t\t\tif(this._autoSizeMode == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._autoSizeMode = value;\n\t\t\tif(this.stage !== null)\n\t\t\t{\n\t\t\t\tif(this._autoSizeMode === AutoSizeMode.STAGE)\n\t\t\t\t{\n\t\t\t\t\tthis.stage.addEventListener(Event.RESIZE, stage_resizeHandler);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.stage.removeEventListener(Event.RESIZE, stage_resizeHandler);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _ignoreChildChanges:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t * This is similar to _ignoreChildChanges, but setInvalidationFlag()\n\t\t * may still be called.\n\t\t */\n\t\tprotected var _ignoreChildChangesButSetFlags:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function addChildAt(child:DisplayObject, index:int):DisplayObject\n\t\t{\n\t\t\tif(child is IFeathersControl)\n\t\t\t{\n\t\t\t\tchild.addEventListener(FeathersEventType.RESIZE, child_resizeHandler);\n\t\t\t}\n\t\t\tif(child is ILayoutDisplayObject)\n\t\t\t{\n\t\t\t\tchild.addEventListener(FeathersEventType.LAYOUT_DATA_CHANGE, child_layoutDataChangeHandler);\n\t\t\t}\n\t\t\tvar oldIndex:int = this.items.indexOf(child);\n\t\t\tif(oldIndex == index)\n\t\t\t{\n\t\t\t\treturn child;\n\t\t\t}\n\t\t\tif(oldIndex >= 0)\n\t\t\t{\n\t\t\t\tthis.items.removeAt(oldIndex);\n\t\t\t}\n\t\t\tthis.items.insertAt(index, child);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t\treturn super.addChildAt(child, index);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function removeChildAt(index:int, dispose:Boolean = false):DisplayObject\n\t\t{\n\t\t\tif(index >= 0 && index < this.items.length)\n\t\t\t{\n\t\t\t\tthis.items.removeAt(index);\n\t\t\t}\n\t\t\tvar child:DisplayObject = super.removeChildAt(index, dispose);\n\t\t\tif(child is IFeathersControl)\n\t\t\t{\n\t\t\t\tchild.removeEventListener(FeathersEventType.RESIZE, child_resizeHandler);\n\t\t\t}\n\t\t\tif(child is ILayoutDisplayObject)\n\t\t\t{\n\t\t\t\tchild.removeEventListener(FeathersEventType.LAYOUT_DATA_CHANGE, child_layoutDataChangeHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t\treturn child;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function setChildIndex(child:DisplayObject, index:int):void\n\t\t{\n\t\t\tsuper.setChildIndex(child, index);\n\t\t\tvar oldIndex:int = this.items.indexOf(child);\n\t\t\tif(oldIndex == index)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//the super function already checks if oldIndex < 0, and throws an\n\t\t\t//appropriate error, so no need to do it again!\n\n\t\t\tthis.items.removeAt(oldIndex);\n\t\t\tthis.items.insertAt(index, child);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function swapChildrenAt(index1:int, index2:int):void\n\t\t{\n\t\t\tsuper.swapChildrenAt(index1, index2);\n\t\t\tvar child1:DisplayObject = this.items[index1];\n\t\t\tvar child2:DisplayObject = this.items[index2];\n\t\t\tthis.items[index1] = child2;\n\t\t\tthis.items[index2] = child1;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function sortChildren(compareFunction:Function):void\n\t\t{\n\t\t\tsuper.sortChildren(compareFunction);\n\t\t\tthis.items.sort(compareFunction);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function hitTest(localPoint:Point):DisplayObject\n\t\t{\n\t\t\tvar localX:Number = localPoint.x;\n\t\t\tvar localY:Number = localPoint.y;\n\t\t\tvar result:DisplayObject = super.hitTest(localPoint);\n\t\t\tif(result)\n\t\t\t{\n\t\t\t\tif(!this._isEnabled)\n\t\t\t\t{\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tif(!this.visible || !this.touchable)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif(this.currentBackgroundSkin && this._hitArea.contains(localX, localY))\n\t\t\t{\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function render(painter:Painter):void\n\t\t{\n\t\t\tif(this.currentBackgroundSkin !== null &&\n\t\t\t\tthis.currentBackgroundSkin.visible &&\n\t\t\t\tthis.currentBackgroundSkin.alpha > 0)\n\t\t\t{\n\t\t\t\t//render() won't be called unless the LayoutGroup requires a\n\t\t\t\t//redraw, so it's not a performance issue to set this flag on\n\t\t\t\t//the background skin.\n\t\t\t\t//this is needed to ensure that the background skin position and\n\t\t\t\t//things are properly updated when the LayoutGroup is\n\t\t\t\t//transformed\n\t\t\t\tthis.currentBackgroundSkin.setRequiresRedraw();\n\n\t\t\t\tvar mask:DisplayObject = this.currentBackgroundSkin.mask;\n\t\t\t\tvar filter:FragmentFilter = this.currentBackgroundSkin.filter;\n\t\t\t\tpainter.pushState();\n\t\t\t\tpainter.setStateTo(this.currentBackgroundSkin.transformationMatrix, this.currentBackgroundSkin.alpha, this.currentBackgroundSkin.blendMode);\n\t\t\t\tif(mask !== null)\n\t\t\t\t{\n\t\t\t\t\tpainter.drawMask(mask);\n\t\t\t\t}\n\t\t\t\tif(filter !== null)\n\t\t\t\t{\n\t\t\t\t\tfilter.render(painter);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.currentBackgroundSkin.render(painter);\n\t\t\t\t}\n\t\t\t\tif(mask !== null)\n\t\t\t\t{\n\t\t\t\t\tpainter.eraseMask(mask);\n\t\t\t\t}\n\t\t\t\tpainter.popState();\n\t\t\t}\n\t\t\tsuper.render(painter);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t{\n\t\t\t\tthis.currentBackgroundSkin.starling_internal::setParent(null);\n\t\t\t}\n\t\t\t//we don't dispose it if the group is the parent because it'll\n\t\t\t//already get disposed in super.dispose()\n\t\t\tif(this._backgroundSkin !== null &&\n\t\t\t\tthis._backgroundSkin.parent !== this)\n\t\t\t{\n\t\t\t\tthis._backgroundSkin.dispose();\n\t\t\t}\n\t\t\tif(this._backgroundDisabledSkin !== null &&\n\t\t\t\tthis._backgroundDisabledSkin.parent !== this)\n\t\t\t{\n\t\t\t\tthis._backgroundDisabledSkin.dispose();\n\t\t\t}\n\t\t\tthis.layout = null;\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * Readjusts the layout of the group according to its current content.\n\t\t * Call this method when changes to the content cannot be automatically\n\t\t * detected by the container. For instance, Feathers components dispatch\n\t\t * <code>FeathersEventType.RESIZE</code> when their width and height\n\t\t * values change, but standard Starling display objects like\n\t\t * <code>Sprite</code> and <code>Image</code> do not.\n\t\t */\n\t\tpublic function readjustLayout():void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function validate():void\n\t\t{\n\t\t\t//for the start of validation, we're going to ignore when children\n\t\t\t//resize or dispatch changes to layout data. this allows subclasses\n\t\t\t//to modify children in draw() before the layout is applied.\n\t\t\tvar oldIgnoreChildChanges:Boolean = this._ignoreChildChangesButSetFlags;\n\t\t\tthis._ignoreChildChangesButSetFlags = true;\n\t\t\tsuper.validate();\n\t\t\t//if super.validate() returns without calling draw(), the flag\n\t\t\t//won't be reset before layout is called, so we need reset manually.\n\t\t\tthis._ignoreChildChangesButSetFlags = oldIgnoreChildChanges;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tif(this.stage !== null)\n\t\t\t{\n\t\t\t\t//we use starling.root because a pop-up's root and the stage\n\t\t\t\t//root may be different.\n\t\t\t\tif(this.stage.starling.root === this)\n\t\t\t\t{\n\t\t\t\t\tthis.autoSizeMode = AutoSizeMode.STAGE;\n\t\t\t\t}\n\t\t\t}\n\t\t\tsuper.initialize();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\t//children are allowed to change during draw() in a subclass up\n\t\t\t//until it calls super.draw().\n\t\t\tthis._ignoreChildChangesButSetFlags = false;\n\n\t\t\tvar layoutInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_LAYOUT);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\tvar clippingInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_CLIPPING);\n\t\t\t//we don't have scrolling, but a subclass might\n\t\t\tvar scrollInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SCROLL);\n\t\t\tvar skinInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SKIN);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\n\t\t\t//scrolling only affects the layout is requiresLayoutOnScroll is true\n\t\t\tif(!layoutInvalid && scrollInvalid && this._layout && this._layout.requiresLayoutOnScroll)\n\t\t\t{\n\t\t\t\tlayoutInvalid = true;\n\t\t\t}\n\n\t\t\tif(skinInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshBackgroundSkin();\n\t\t\t}\n\n\t\t\tif(sizeInvalid || layoutInvalid || skinInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshViewPortBounds();\n\t\t\t\tif(this._layout)\n\t\t\t\t{\n\t\t\t\t\tvar oldIgnoreChildChanges:Boolean = this._ignoreChildChanges;\n\t\t\t\t\tthis._ignoreChildChanges = true;\n\t\t\t\t\tthis._layout.layout(this.items, this.viewPortBounds, this._layoutResult);\n\t\t\t\t\tthis._ignoreChildChanges = oldIgnoreChildChanges;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.handleManualLayout();\n\t\t\t\t}\n\t\t\t\tthis.handleLayoutResult();\n\t\t\t\tthis.refreshBackgroundLayout();\n\n\t\t\t\t//final validation to avoid juggler next frame issues\n\t\t\t\tthis.validateChildren();\n\t\t\t}\n\n\t\t\tif(sizeInvalid || clippingInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshClipRect();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Choose the appropriate background skin based on the control's current\n\t\t * state.\n\t\t */\n\t\tprotected function refreshBackgroundSkin():void\n\t\t{\n\t\t\tvar oldBackgroundSkin:DisplayObject = this.currentBackgroundSkin;\n\t\t\tthis.currentBackgroundSkin = this.getCurrentBackgroundSkin();\n\t\t\tif(this.currentBackgroundSkin !== oldBackgroundSkin)\n\t\t\t{\n\t\t\t\tthis.removeCurrentBackgroundSkin(oldBackgroundSkin);\n\t\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(this.currentBackgroundSkin is IFeathersControl)\n\t\t\t\t\t{\n\t\t\t\t\t\tIFeathersControl(this.currentBackgroundSkin).initializeNow();\n\t\t\t\t\t}\n\t\t\t\t\tif(this.currentBackgroundSkin is IMeasureDisplayObject)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar measureSkin:IMeasureDisplayObject = IMeasureDisplayObject(this.currentBackgroundSkin);\n\t\t\t\t\t\tthis._explicitBackgroundWidth = measureSkin.explicitWidth;\n\t\t\t\t\t\tthis._explicitBackgroundHeight = measureSkin.explicitHeight;\n\t\t\t\t\t\tthis._explicitBackgroundMinWidth = measureSkin.explicitMinWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMinHeight = measureSkin.explicitMinHeight;\n\t\t\t\t\t\tthis._explicitBackgroundMaxWidth = measureSkin.explicitMaxWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMaxHeight = measureSkin.explicitMaxHeight;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._explicitBackgroundWidth = this.currentBackgroundSkin.width;\n\t\t\t\t\t\tthis._explicitBackgroundHeight = this.currentBackgroundSkin.height;\n\t\t\t\t\t\tthis._explicitBackgroundMinWidth = this._explicitBackgroundWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMinHeight = this._explicitBackgroundHeight;\n\t\t\t\t\t\tthis._explicitBackgroundMaxWidth = this._explicitBackgroundWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMaxHeight = this._explicitBackgroundHeight;\n\t\t\t\t\t}\n\t\t\t\t\tthis.currentBackgroundSkin.starling_internal::setParent(this);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function removeCurrentBackgroundSkin(skin:DisplayObject):void\n\t\t{\n\t\t\tif(skin === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(skin.parent === this)\n\t\t\t{\n\t\t\t\t//we need to restore these values so that they won't be lost the\n\t\t\t\t//next time that this skin is used for measurement\n\t\t\t\tskin.width = this._explicitBackgroundWidth;\n\t\t\t\tskin.height = this._explicitBackgroundHeight;\n\t\t\t\tif(skin is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar measureSkin:IMeasureDisplayObject = IMeasureDisplayObject(skin);\n\t\t\t\t\tmeasureSkin.minWidth = this._explicitBackgroundMinWidth;\n\t\t\t\t\tmeasureSkin.minHeight = this._explicitBackgroundMinHeight;\n\t\t\t\t\tmeasureSkin.maxWidth = this._explicitBackgroundMaxWidth;\n\t\t\t\t\tmeasureSkin.maxHeight = this._explicitBackgroundMaxHeight;\n\t\t\t\t}\n\t\t\t\tthis.setRequiresRedraw();\n\t\t\t\tskin.starling_internal::setParent(null);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getCurrentBackgroundSkin():DisplayObject\n\t\t{\n\t\t\tif(!this._isEnabled && this._backgroundDisabledSkin !== null)\n\t\t\t{\n\t\t\t\treturn this._backgroundDisabledSkin;\n\t\t\t}\n\t\t\treturn this._backgroundSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshBackgroundLayout():void\n\t\t{\n\t\t\tif(this.currentBackgroundSkin === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this.currentBackgroundSkin.width != this.actualWidth ||\n\t\t\t\tthis.currentBackgroundSkin.height != this.actualHeight)\n\t\t\t{\n\t\t\t\tthis.currentBackgroundSkin.width = this.actualWidth;\n\t\t\t\tthis.currentBackgroundSkin.height = this.actualHeight;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Refreshes the values in the <code>viewPortBounds</code> variable that\n\t\t * is passed to the layout.\n\t\t */\n\t\tprotected function refreshViewPortBounds():void\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\n\t\t\tresetFluidChildDimensionsForMeasurement(this.currentBackgroundSkin,\n\t\t\t\tthis._explicitWidth, this._explicitHeight,\n\t\t\t\tthis._explicitMinWidth, this._explicitMinHeight,\n\t\t\t\tthis._explicitMaxWidth, this._explicitMaxHeight,\n\t\t\t\tthis._explicitBackgroundWidth, this._explicitBackgroundHeight,\n\t\t\t\tthis._explicitBackgroundMinWidth, this._explicitBackgroundMinHeight,\n\t\t\t\tthis._explicitBackgroundMaxWidth, this._explicitBackgroundMaxHeight);\n\n\t\t\tthis.viewPortBounds.x = 0;\n\t\t\tthis.viewPortBounds.y = 0;\n\t\t\tthis.viewPortBounds.scrollX = 0;\n\t\t\tthis.viewPortBounds.scrollY = 0;\n\t\t\tif(needsWidth && this._autoSizeMode === AutoSizeMode.STAGE &&\n\t\t\t\tthis.stage !== null)\n\t\t\t{\n\t\t\t\tthis.viewPortBounds.explicitWidth = this.stage.stageWidth;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.viewPortBounds.explicitWidth = this._explicitWidth;\n\t\t\t}\n\t\t\tif(needsHeight && this._autoSizeMode === AutoSizeMode.STAGE &&\n\t\t\t\tthis.stage !== null)\n\t\t\t{\n\t\t\t\tthis.viewPortBounds.explicitHeight = this.stage.stageHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.viewPortBounds.explicitHeight = this._explicitHeight;\n\t\t\t}\n\t\t\tvar viewPortMinWidth:Number = this._explicitMinWidth;\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tviewPortMinWidth = 0;\n\t\t\t}\n\t\t\tvar viewPortMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tviewPortMinHeight = 0;\n\t\t\t}\n\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t{\n\t\t\t\t//because the layout might need it, we account for the\n\t\t\t\t//dimensions of the background skin when determining the minimum\n\t\t\t\t//dimensions of the view port.\n\t\t\t\t//we can't use the minimum dimensions of the background skin\n\t\t\t\tif(this.currentBackgroundSkin.width > viewPortMinWidth)\n\t\t\t\t{\n\t\t\t\t\tviewPortMinWidth = this.currentBackgroundSkin.width;\n\t\t\t\t}\n\t\t\t\tif(this.currentBackgroundSkin.height > viewPortMinHeight)\n\t\t\t\t{\n\t\t\t\t\tviewPortMinHeight = this.currentBackgroundSkin.height;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.viewPortBounds.minWidth = viewPortMinWidth;\n\t\t\tthis.viewPortBounds.minHeight = viewPortMinHeight;\n\t\t\tthis.viewPortBounds.maxWidth = this._explicitMaxWidth;\n\t\t\tthis.viewPortBounds.maxHeight = this._explicitMaxHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function handleLayoutResult():void\n\t\t{\n\t\t\t//the layout's dimensions are also the minimum dimensions\n\t\t\t//we calculate the minimum dimensions for the background skin in\n\t\t\t//refreshViewPortBounds() and let the layout handle it\n\t\t\tvar viewPortWidth:Number = this._layoutResult.viewPortWidth;\n\t\t\tvar viewPortHeight:Number = this._layoutResult.viewPortHeight;\n\t\t\tthis.saveMeasurements(viewPortWidth, viewPortHeight,\n\t\t\t\tviewPortWidth, viewPortHeight);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function handleManualLayout():void\n\t\t{\n\t\t\tvar maxX:Number = this.viewPortBounds.explicitWidth;\n\t\t\tif(maxX !== maxX) //isNaN\n\t\t\t{\n\t\t\t\tmaxX = 0;\n\t\t\t}\n\t\t\tvar maxY:Number = this.viewPortBounds.explicitHeight;\n\t\t\tif(maxY !== maxY) //isNaN\n\t\t\t{\n\t\t\t\tmaxY = 0;\n\t\t\t}\n\t\t\tvar oldIgnoreChildChanges:Boolean = this._ignoreChildChanges;\n\t\t\tthis._ignoreChildChanges = true;\n\t\t\tvar itemCount:int = this.items.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:DisplayObject = this.items[i];\n\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(item is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(item).validate();\n\t\t\t\t}\n\t\t\t\tvar itemMaxX:Number = item.x - item.pivotX + item.width;\n\t\t\t\tvar itemMaxY:Number = item.y - item.pivotY + item.height;\n\t\t\t\tif(itemMaxX === itemMaxX && //!isNaN\n\t\t\t\t\titemMaxX > maxX)\n\t\t\t\t{\n\t\t\t\t\tmaxX = itemMaxX;\n\t\t\t\t}\n\t\t\t\tif(itemMaxY === itemMaxY && //!isNaN\n\t\t\t\t\titemMaxY > maxY)\n\t\t\t\t{\n\t\t\t\t\tmaxY = itemMaxY;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._ignoreChildChanges = oldIgnoreChildChanges;\n\t\t\tthis._layoutResult.contentX = 0;\n\t\t\tthis._layoutResult.contentY = 0;\n\t\t\tthis._layoutResult.contentWidth = maxX;\n\t\t\tthis._layoutResult.contentHeight = maxY;\n\t\t\tif(this.viewPortBounds.explicitWidth === this.viewPortBounds.explicitWidth) //!isNaN\n\t\t\t{\n\t\t\t\tthis._layoutResult.viewPortWidth = this.viewPortBounds.explicitWidth;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar viewPortMinWidth:Number = this.viewPortBounds.minWidth;\n\t\t\t\tif(maxX < viewPortMinWidth)\n\t\t\t\t{\n\t\t\t\t\tmaxX = viewPortMinWidth;\n\t\t\t\t}\n\t\t\t\tvar viewPortMaxWidth:Number = this.viewPortBounds.maxWidth;\n\t\t\t\tif(maxX > viewPortMaxWidth)\n\t\t\t\t{\n\t\t\t\t\tmaxX = viewPortMaxWidth;\n\t\t\t\t}\n\t\t\t\tthis._layoutResult.viewPortWidth = maxX;\n\t\t\t}\n\t\t\tif(this.viewPortBounds.explicitHeight === this.viewPortBounds.explicitHeight)\n\t\t\t{\n\t\t\t\tthis._layoutResult.viewPortHeight = this.viewPortBounds.explicitHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar viewPortMinHeight:Number = this.viewPortBounds.minHeight;\n\t\t\t\tif(maxY < viewPortMinHeight)\n\t\t\t\t{\n\t\t\t\t\tmaxY = viewPortMinHeight;\n\t\t\t\t}\n\t\t\t\tvar viewPortMaxHeight:Number = this.viewPortBounds.maxHeight;\n\t\t\t\tif(maxY > viewPortMaxHeight)\n\t\t\t\t{\n\t\t\t\t\tmaxY = viewPortMaxHeight;\n\t\t\t\t}\n\t\t\t\tthis._layoutResult.viewPortHeight = maxY;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function validateChildren():void\n\t\t{\n\t\t\tif(this.currentBackgroundSkin is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.currentBackgroundSkin).validate();\n\t\t\t}\n\t\t\tvar itemCount:int = this.items.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:DisplayObject = this.items[i];\n\t\t\t\tif(item is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(item).validate();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshClipRect():void\n\t\t{\n\t\t\tif(!this._clipContent)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar mask:Quad = this.mask as Quad;\n\t\t\tif(mask)\n\t\t\t{\n\t\t\t\tmask.x = 0;\n\t\t\t\tmask.y = 0;\n\t\t\t\tmask.width = this.actualWidth;\n\t\t\t\tmask.height = this.actualHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmask = new Quad(1, 1, 0xff00ff);\n\t\t\t\t//the initial dimensions cannot be 0 or there's a runtime error,\n\t\t\t\t//and these values might be 0\n\t\t\t\tmask.width = this.actualWidth;\n\t\t\t\tmask.height = this.actualHeight;\n\t\t\t\tthis.mask = mask;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutGroup_addedToStageHandler(event:Event):void\n\t\t{\n\t\t\tif(this._autoSizeMode === AutoSizeMode.STAGE)\n\t\t\t{\n\t\t\t\t//if we validated before being added to the stage, or if we've\n\t\t\t\t//been removed from stage and added again, we need to be sure\n\t\t\t\t//that the new stage dimensions are accounted for.\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\n\t\t\t\tthis.stage.addEventListener(Event.RESIZE, stage_resizeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutGroup_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tthis.stage.removeEventListener(Event.RESIZE, stage_resizeHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layout_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function child_resizeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreChildChanges)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._ignoreChildChangesButSetFlags)\n\t\t\t{\n\t\t\t\tthis.setInvalidationFlag(INVALIDATION_FLAG_LAYOUT);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function child_layoutDataChangeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreChildChanges)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._ignoreChildChangesButSetFlags)\n\t\t\t{\n\t\t\t\tthis.setInvalidationFlag(INVALIDATION_FLAG_LAYOUT);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_resizeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/List.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.renderers.IListItemRenderer;\n\timport feathers.controls.supportClasses.ListDataViewPort;\n\timport feathers.core.IFocusContainer;\n\timport feathers.core.PropertyProxy;\n\timport feathers.data.IListCollection;\n\timport feathers.data.ListCollection;\n\timport feathers.dragDrop.IDragSource;\n\timport feathers.dragDrop.IDropTarget;\n\timport feathers.events.CollectionEventType;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.ILayout;\n\timport feathers.layout.ISpinnerLayout;\n\timport feathers.layout.IVariableVirtualLayout;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.system.DeviceCapabilities;\n\n\timport flash.events.KeyboardEvent;\n\timport flash.events.TransformGestureEvent;\n\timport flash.geom.Point;\n\timport flash.ui.Keyboard;\n\timport flash.utils.Dictionary;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.utils.Pool;\n\n\t/**\n\t * A style name to add to all item renderers in this list. Typically\n\t * used by a theme to provide different skins to different lists.\n\t *\n\t * <p>The following example sets the item renderer name:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * list.customItemRendererStyleName = \"my-custom-item-renderer\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component name to provide\n\t * different skins than the default style:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( DefaultListItemRenderer ).setFunctionForStyleName( \"my-custom-item-renderer\", setCustomItemRendererStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see feathers.core.FeathersControl#styleNameList\n\t */\n\t[Style(name=\"customItemRendererStyleName\",type=\"String\")]\n\n\t/**\n\t * A skin to display when dragging one an item to indicate where it can be\n\t * dropped.\n\t *\n\t * <p>In the following example, the list's drop indicator is provided:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * list.dropIndicatorSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t */\n\t[Style(name=\"dropIndicatorSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The duration, in seconds, of the animation when the selected item is\n\t * changed by keyboard navigation and the item scrolls into view.\n\t *\n\t * <p>In the following example, the duration of the animation that\n\t * scrolls the list to a new selected item is set to 500 milliseconds:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * list.keyScrollDuration = 0.5;</listing>\n\t *\n\t * @default 0.25\n\t */\n\t[Style(name=\"keyScrollDuration\",type=\"Number\")]\n\n\t/**\n\t * The layout algorithm used to position and, optionally, size the\n\t * list's items.\n\t *\n\t * <p>By default, if no layout is provided by the time that the list\n\t * initializes, a vertical layout with options targeted at touch screens\n\t * is created.</p>\n\t *\n\t * <p>The following example tells the list to use a horizontal layout:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var layout:HorizontalLayout = new HorizontalLayout();\n\t * layout.gap = 20;\n\t * layout.padding = 20;\n\t * list.layout = layout;</listing>\n\t *\n\t * @default null\n\t */\n\t[Style(name=\"layout\",type=\"feathers.layout.ILayout\")]\n\n\t/**\n\t * Dispatched when the selected item changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #selectedItem\n\t * @see #selectedIndex\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the the user taps or clicks an item renderer in the list.\n\t * The touch must remain within the bounds of the item renderer on release,\n\t * and the list must not have scrolled, to register as a tap or a click.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The item associated with the item\n\t *   renderer that was triggered.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.TRIGGERED\n\t */\n\t[Event(name=\"triggered\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item renderer is added to the list. When the layout is\n\t * virtualized, item renderers may not exist for every item in the data\n\t * provider. This event can be used to track which items currently have\n\t * renderers.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The item renderer that was added.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.RENDERER_ADD\n\t */\n\t[Event(name=\"rendererAdd\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item renderer is removed from the list. When the layout is\n\t * virtualized, item renderers may not exist for every item in the data\n\t * provider. This event can be used to track which items currently have\n\t * renderers.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The item renderer that was removed.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.RENDERER_REMOVE\n\t */\n\t[Event(name=\"rendererRemove\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Displays a one-dimensional list of items. Supports scrolling, custom\n\t * item renderers, and custom layouts.\n\t *\n\t * <p>Layouts may be, and are highly encouraged to be, <em>virtual</em>,\n\t * meaning that the List is capable of creating a limited number of item\n\t * renderers to display a subset of the data provider instead of creating a\n\t * renderer for every single item. This allows for optimal performance with\n\t * very large data providers.</p>\n\t *\n\t * <p>The following example creates a list, gives it a data provider, tells\n\t * the item renderer how to interpret the data, and listens for when the\n\t * selection changes:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var list:List = new List();\n\t * \n\t * list.dataProvider = new ArrayCollection(\n\t * [\n\t *     { text: \"Milk\", thumbnail: textureAtlas.getTexture( \"milk\" ) },\n\t *     { text: \"Eggs\", thumbnail: textureAtlas.getTexture( \"eggs\" ) },\n\t *     { text: \"Bread\", thumbnail: textureAtlas.getTexture( \"bread\" ) },\n\t *     { text: \"Chicken\", thumbnail: textureAtlas.getTexture( \"chicken\" ) },\n\t * ]);\n\t * \n\t * list.itemRendererFactory = function():IListItemRenderer\n\t * {\n\t *     var itemRenderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\t *     itemRenderer.labelField = \"text\";\n\t *     itemRenderer.iconSourceField = \"thumbnail\";\n\t *     return itemRenderer;\n\t * };\n\t * \n\t * list.addEventListener( Event.CHANGE, list_changeHandler );\n\t * \n\t * this.addChild( list );</listing>\n\t *\n\t * @see ../../../help/list.html How to use the Feathers List component\n\t * @see ../../../help/default-item-renderers.html How to use the Feathers default item renderer\n\t * @see ../../../help/item-renderers.html Creating custom item renderers for the Feathers List and GroupedList components\n\t * @see feathers.controls.GroupedList\n\t * @see feathers.controls.SpinnerList\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class List extends Scroller implements IFocusContainer, IDragSource, IDropTarget\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const DEFAULT_DRAG_FORMAT:String = \"feathers-list-item\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>List</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function List()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis._selectedIndices.addEventListener(Event.CHANGE, selectedIndices_changeHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * The guts of the List's functionality. Handles layout and selection.\n\t\t */\n\t\tprotected var dataViewPort:ListDataViewPort;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn List.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function get isFocusEnabled():Boolean\n\t\t{\n\t\t\treturn (this._isSelectable || this._minHorizontalScrollPosition != this._maxHorizontalScrollPosition ||\n\t\t\t\tthis._minVerticalScrollPosition != this._maxVerticalScrollPosition) &&\n\t\t\t\tthis._isEnabled && this._isFocusEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isChildFocusEnabled:Boolean = true;\n\n\t\t/**\n\t\t * @copy feathers.core.IFocusContainer#isChildFocusEnabled\n\t\t *\n\t\t * @default true\n\t\t *\n\t\t * @see #isFocusEnabled\n\t\t */\n\t\tpublic function get isChildFocusEnabled():Boolean\n\t\t{\n\t\t\treturn this._isEnabled && this._isChildFocusEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isChildFocusEnabled(value:Boolean):void\n\t\t{\n\t\t\tthis._isChildFocusEnabled = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _layout:ILayout;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get layout():ILayout\n\t\t{\n\t\t\treturn this._layout;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set layout(value:ILayout):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._layout == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!(this is SpinnerList) && value is ISpinnerLayout)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"Layouts that implement the ISpinnerLayout interface should be used with the SpinnerList component.\");\n\t\t\t}\n\t\t\tif(this._layout)\n\t\t\t{\n\t\t\t\tthis._layout.removeEventListener(Event.SCROLL, layout_scrollHandler);\n\t\t\t}\n\t\t\tthis._layout = value;\n\t\t\tif(this._layout is IVariableVirtualLayout)\n\t\t\t{\n\t\t\t\tthis._layout.addEventListener(Event.SCROLL, layout_scrollHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _addedItems:Dictionary = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _removedItems:Dictionary = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _dataProvider:IListCollection;\n\n\t\t/**\n\t\t * The collection of data displayed by the list. Changing this property\n\t\t * to a new value is considered a drastic change to the list's data, so\n\t\t * the horizontal and vertical scroll positions will be reset, and the\n\t\t * list's selection will be cleared.\n\t\t *\n\t\t * <p>The following example passes in a data provider and tells the item\n\t\t * renderer how to interpret the data:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.dataProvider = new ArrayCollection(\n\t\t * [\n\t\t *     { text: \"Milk\", thumbnail: textureAtlas.getTexture( \"milk\" ) },\n\t\t *     { text: \"Eggs\", thumbnail: textureAtlas.getTexture( \"eggs\" ) },\n\t\t *     { text: \"Bread\", thumbnail: textureAtlas.getTexture( \"bread\" ) },\n\t\t *     { text: \"Chicken\", thumbnail: textureAtlas.getTexture( \"chicken\" ) },\n\t\t * ]);\n\t\t * \n\t\t * list.itemRendererFactory = function():IListItemRenderer\n\t\t * {\n\t\t *     var renderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\t\t *     renderer.labelField = \"text\";\n\t\t *     renderer.iconSourceField = \"thumbnail\";\n\t\t *     return renderer;\n\t\t * };</listing>\n\t\t *\n\t\t * <p><em>Warning:</em> A list's data provider cannot contain duplicate\n\t\t * items. To display the same item in multiple item renderers, you must\n\t\t * create separate objects with the same properties. This restriction\n\t\t * exists because it significantly improves performance.</p>\n\t\t *\n\t\t * <p><em>Warning:</em> If the data provider contains display objects,\n\t\t * concrete textures, or anything that needs to be disposed, those\n\t\t * objects will not be automatically disposed when the list is disposed.\n\t\t * Similar to how <code>starling.display.Image</code> cannot\n\t\t * automatically dispose its texture because the texture may be used\n\t\t * by other display objects, a list cannot dispose its data provider\n\t\t * because the data provider may be used by other lists. See the\n\t\t * <code>dispose()</code> function on <code>IListCollection</code> to\n\t\t * see how the data provider can be disposed properly.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.data.IListCollection#dispose()\n\t\t * @see feathers.data.ArrayCollection\n\t\t * @see feathers.data.VectorCollection\n\t\t * @see feathers.data.XMLListCollection\n\t\t */\n\t\tpublic function get dataProvider():IListCollection\n\t\t{\n\t\t\treturn this._dataProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set dataProvider(value:IListCollection):void\n\t\t{\n\t\t\tif(this._dataProvider == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._dataProvider)\n\t\t\t{\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.SORT_CHANGE, dataProvider_sortChangeHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.FILTER_CHANGE, dataProvider_filterChangeHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.ADD_ITEM, dataProvider_addItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.REMOVE_ITEM, dataProvider_removeItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.REMOVE_ALL, dataProvider_removeAllHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.REPLACE_ITEM, dataProvider_replaceItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.RESET, dataProvider_resetHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(Event.CHANGE, dataProvider_changeHandler);\n\t\t\t}\n\t\t\tthis._dataProvider = value;\n\t\t\tif(this._dataProvider)\n\t\t\t{\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.SORT_CHANGE, dataProvider_sortChangeHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.FILTER_CHANGE, dataProvider_filterChangeHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.ADD_ITEM, dataProvider_addItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.REMOVE_ITEM, dataProvider_removeItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.REMOVE_ALL, dataProvider_removeAllHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.REPLACE_ITEM, dataProvider_replaceItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.RESET, dataProvider_resetHandler);\n\t\t\t\tthis._dataProvider.addEventListener(Event.CHANGE, dataProvider_changeHandler);\n\t\t\t}\n\n\t\t\t//reset the scroll position because this is a drastic change and\n\t\t\t//the data is probably completely different\n\t\t\tthis.horizontalScrollPosition = 0;\n\t\t\tthis.verticalScrollPosition = 0;\n\n\t\t\t//clear the selection for the same reason\n\t\t\tthis.selectedIndex = -1;\n\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isSelectable:Boolean = true;\n\n\t\t/**\n\t\t * Determines if items in the list may be selected. By default only a\n\t\t * single item may be selected at any given time. In other words, if\n\t\t * item A is selected, and the user selects item B, item A will be\n\t\t * deselected automatically. Set <code>allowMultipleSelection</code>\n\t\t * to <code>true</code> to select more than one item without\n\t\t * automatically deselecting other items.\n\t\t *\n\t\t * <p>The following example disables selection:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.isSelectable = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t *\n\t\t * @see #selectedItem\n\t\t * @see #selectedIndex\n\t\t * @see #allowMultipleSelection\n\t\t */\n\t\tpublic function get isSelectable():Boolean\n\t\t{\n\t\t\treturn this._isSelectable;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isSelectable(value:Boolean):void\n\t\t{\n\t\t\tif(this._isSelectable == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isSelectable = value;\n\t\t\tif(!this._isSelectable)\n\t\t\t{\n\t\t\t\tthis.selectedIndex = -1;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectedIndex:int = -1;\n\n\t\t/**\n\t\t * The index of the currently selected item. Returns <code>-1</code> if\n\t\t * no item is selected.\n\t\t *\n\t\t * <p>The following example selects an item by its index:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.selectedIndex = 2;</listing>\n\t\t *\n\t\t * <p>The following example clears the selected index:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.selectedIndex = -1;</listing>\n\t\t *\n\t\t * <p>The following example listens for when selection changes and\n\t\t * requests the selected index:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * function list_changeHandler( event:Event ):void\n\t\t * {\n\t\t *     var list:List = List( event.currentTarget );\n\t\t *     var index:int = list.selectedIndex;\n\t\t *     trace( \"change: \" + index );\n\t\t * }\n\t\t * list.addEventListener( Event.CHANGE, list_changeHandler );</listing>\n\t\t *\n\t\t * @default -1\n\t\t *\n\t\t * @see #selectedItem\n\t\t * @see #allowMultipleSelection\n\t\t * @see #selectedItems\n\t\t * @see #selectedIndices\n\t\t */\n\t\tpublic function get selectedIndex():int\n\t\t{\n\t\t\treturn this._selectedIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedIndex(value:int):void\n\t\t{\n\t\t\tif(this._selectedIndex == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value >= 0)\n\t\t\t{\n\t\t\t\tthis._selectedIndices.data = new <int>[value];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._selectedIndices.removeAll();\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * The currently selected item. Returns <code>null</code> if no item is\n\t\t * selected.\n\t\t *\n\t\t * <p>The following example changes the selected item:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.selectedItem = list.dataProvider.getItemAt(0);</listing>\n\t\t *\n\t\t * <p>The following example clears the selected item:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.selectedItem = null;</listing>\n\t\t *\n\t\t * <p>The following example listens for when selection changes and\n\t\t * requests the selected item:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * function list_changeHandler( event:Event ):void\n\t\t * {\n\t\t *     var list:List = List( event.currentTarget );\n\t\t *     var item:Object = list.selectedItem;\n\t\t *     trace( \"change: \" + item );\n\t\t * }\n\t\t * list.addEventListener( Event.CHANGE, list_changeHandler );</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #selectedIndex\n\t\t * @see #allowMultipleSelection\n\t\t * @see #selectedItems\n\t\t * @see #selectedIndices\n\t\t */\n\t\tpublic function get selectedItem():Object\n\t\t{\n\t\t\tif(!this._dataProvider || this._selectedIndex < 0 || this._selectedIndex >= this._dataProvider.length)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn this._dataProvider.getItemAt(this._selectedIndex);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedItem(value:Object):void\n\t\t{\n\t\t\tif(!this._dataProvider)\n\t\t\t{\n\t\t\t\tthis.selectedIndex = -1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.selectedIndex = this._dataProvider.getItemIndex(value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _allowMultipleSelection:Boolean = false;\n\n\t\t/**\n\t\t * If <code>true</code> multiple items may be selected at a time. If\n\t\t * <code>false</code>, then only a single item may be selected at a\n\t\t * time, and if the selection changes, other items are deselected. Has\n\t\t * no effect if <code>isSelectable</code> is <code>false</code>.\n\t\t *\n\t\t * <p>In the following example, multiple selection is enabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.allowMultipleSelection = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see #isSelectable\n\t\t * @see #selectedIndices\n\t\t * @see #selectedItems\n\t\t */\n\t\tpublic function get allowMultipleSelection():Boolean\n\t\t{\n\t\t\treturn this._allowMultipleSelection;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set allowMultipleSelection(value:Boolean):void\n\t\t{\n\t\t\tif(this._allowMultipleSelection == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._allowMultipleSelection = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectedIndices:ListCollection = new ListCollection(new <int>[]);\n\n\t\t/**\n\t\t * The indices of the currently selected items. Returns an empty <code>Vector.&lt;int&gt;</code>\n\t\t * if no items are selected. If <code>allowMultipleSelection</code> is\n\t\t * <code>false</code>, only one item may be selected at a time.\n\t\t *\n\t\t * <p>The following example selects two items by their indices:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.selectedIndices = new &lt;int&gt;[ 2, 3 ];</listing>\n\t\t *\n\t\t * <p>The following example clears the selected indices:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.selectedIndices = null;</listing>\n\t\t *\n\t\t * <p>The following example listens for when selection changes and\n\t\t * requests the selected indices:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * function list_changeHandler( event:Event ):void\n\t\t * {\n\t\t *     var list:List = List( event.currentTarget );\n\t\t *     var indices:Vector.&lt;int&gt; = list.selectedIndices;\n\t\t * \n\t\t * }\n\t\t * list.addEventListener( Event.CHANGE, list_changeHandler );</listing>\n\t\t *\n\t\t * @see #allowMultipleSelection\n\t\t * @see #selectedItems\n\t\t * @see #selectedIndex\n\t\t * @see #selectedItem\n\t\t */\n\t\tpublic function get selectedIndices():Vector.<int>\n\t\t{\n\t\t\treturn this._selectedIndices.data as Vector.<int>;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedIndices(value:Vector.<int>):void\n\t\t{\n\t\t\tvar oldValue:Vector.<int> = this._selectedIndices.data as Vector.<int>;\n\t\t\tif(oldValue == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tif(this._selectedIndices.length == 0)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._selectedIndices.removeAll();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(!this._allowMultipleSelection && value.length > 0)\n\t\t\t\t{\n\t\t\t\t\tvalue.length = 1;\n\t\t\t\t}\n\t\t\t\tthis._selectedIndices.data = value;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectedItems:Vector.<Object> = new <Object>[];\n\n\t\t/**\n\t\t * The currently selected item. The getter returns an empty\n\t\t * <code>Vector.&lt;Object&gt;</code> if no item is selected. If any\n\t\t * items are selected, the getter creates a new\n\t\t * <code>Vector.&lt;Object&gt;</code> to return a list of selected\n\t\t * items.\n\t\t *\n\t\t * <p>The following example selects two items:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.selectedItems = new &lt;Object&gt;[ list.dataProvider.getItemAt(2) , list.dataProvider.getItemAt(3) ];</listing>\n\t\t *\n\t\t * <p>The following example clears the selected items:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.selectedItems = null;</listing>\n\t\t *\n\t\t * <p>The following example listens for when selection changes and\n\t\t * requests the selected items:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * function list_changeHandler( event:Event ):void\n\t\t * {\n\t\t *     var list:List = List( event.currentTarget );\n\t\t *     var items:Vector.&lt;Object&gt; = list.selectedItems;\n\t\t * \n\t\t * }\n\t\t * list.addEventListener( Event.CHANGE, list_changeHandler );</listing>\n\t\t *\n\t\t * @see #allowMultipleSelection\n\t\t * @see #selectedIndices\n\t\t * @see #selectedIndex\n\t\t * @see #selectedItem\n\t\t */\n\t\tpublic function get selectedItems():Vector.<Object>\n\t\t{\n\t\t\treturn this._selectedItems;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedItems(value:Vector.<Object>):void\n\t\t{\n\t\t\tif(!value || !this._dataProvider)\n\t\t\t{\n\t\t\t\tthis.selectedIndex = -1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar indices:Vector.<int> = new <int>[];\n\t\t\tvar itemCount:int = value.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = value[i];\n\t\t\t\tvar index:int = this._dataProvider.getItemIndex(item);\n\t\t\t\tif(index >= 0)\n\t\t\t\t{\n\t\t\t\t\tindices.push(index);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.selectedIndices = indices;\n\t\t}\n\n\t\t/**\n\t\t * Returns the selected items, with the ability to pass in an optional\n\t\t * result vector. Better for performance than the <code>selectedItems</code>\n\t\t * getter because it can avoid the allocation, and possibly garbage\n\t\t * collection, of the result object.\n\t\t *\n\t\t * @see #selectedItems\n\t\t */\n\t\tpublic function getSelectedItems(result:Vector.<Object> = null):Vector.<Object>\n\t\t{\n\t\t\tif(result !== null)\n\t\t\t{\n\t\t\t\tresult.length = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult = new <Object>[];\n\t\t\t}\n\t\t\tif(!this._dataProvider)\n\t\t\t{\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tvar indexCount:int = this._selectedIndices.length;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tvar index:int = this._selectedIndices.getItemAt(i) as int;\n\t\t\t\tvar item:Object = this._dataProvider.getItemAt(index);\n\t\t\t\tresult[i] = item;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _itemRendererType:Class = DefaultListItemRenderer;\n\n\t\t/**\n\t\t * The class used to instantiate item renderers. Must implement the\n\t\t * <code>IListItemRenderer</code> interface.\n\t\t *\n\t\t * <p>To customize properties on the item renderer, use\n\t\t * <code>itemRendererFactory</code> instead.</p>\n\t\t *\n\t\t * <p>The following example changes the item renderer type:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.itemRendererType = CustomItemRendererClass;</listing>\n\t\t *\n\t\t * @default feathers.controls.renderers.DefaultListItemRenderer\n\t\t *\n\t\t * @see feathers.controls.renderers.IListItemRenderer\n\t\t * @see #itemRendererFactory\n\t\t */\n\t\tpublic function get itemRendererType():Class\n\t\t{\n\t\t\treturn this._itemRendererType;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set itemRendererType(value:Class):void\n\t\t{\n\t\t\tif(this._itemRendererType == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._itemRendererType = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _itemRendererFactories:Object;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _itemRendererFactory:Function;\n\n\t\t/**\n\t\t * A function called that is expected to return a new item renderer. Has\n\t\t * a higher priority than <code>itemRendererType</code>. Typically, you\n\t\t * would use an <code>itemRendererFactory</code> instead of an\n\t\t * <code>itemRendererType</code> if you wanted to initialize some\n\t\t * properties on each separate item renderer, such as skins.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t *\n\t\t * <pre>function():IListItemRenderer</pre>\n\t\t *\n\t\t * <p>The following example provides a factory for the item renderer:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.itemRendererFactory = function():IListItemRenderer\n\t\t * {\n\t\t *     var renderer:CustomItemRendererClass = new CustomItemRendererClass();\n\t\t *     renderer.backgroundSkin = new Quad( 10, 10, 0xff0000 );\n\t\t *     return renderer;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.renderers.IListItemRenderer\n\t\t * @see #itemRendererType\n\t\t * @see #setItemRendererFactoryWithID()\n\t\t */\n\t\tpublic function get itemRendererFactory():Function\n\t\t{\n\t\t\treturn this._itemRendererFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set itemRendererFactory(value:Function):void\n\t\t{\n\t\t\tif(this._itemRendererFactory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._itemRendererFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _factoryIDFunction:Function;\n\n\t\t/**\n\t\t * When a list requires multiple item renderer types, this function is\n\t\t * used to determine which type of item renderer is required for a\n\t\t * specific item (or index). Returns the ID of the item renderer type\n\t\t * to use for the item, or <code>null</code> if the default\n\t\t * <code>itemRendererFactory</code> should be used.\n\t\t *\n\t\t * <p>The function is expected to have one of the following\n\t\t * signatures:</p>\n\t\t *\n\t\t * <pre>function(item:Object):String</pre>\n\t\t *\n\t\t * <pre>function(item:Object, index:int):String</pre>\n\t\t *\n\t\t * <p>The following example provides a <code>factoryIDFunction</code>:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * function regularItemFactory():IListItemRenderer\n\t\t * {\n\t\t *     return new DefaultListItemRenderer();\n\t\t * }\n\t\t * function headerItemFactory():IListItemRenderer\n\t\t * {\n\t\t *     return new CustomItemRenderer();\n\t\t * }\n\t\t * list.setItemRendererFactoryWithID( \"regular-item\", regularItemFactory );\n\t\t * list.setItemRendererFactoryWithID( \"header-item\", listHeaderFactory );\n\t\t * \n\t\t * list.factoryIDFunction = function( item:Object, index:int ):String\n\t\t * {\n\t\t *     if(index == 0)\n\t\t *     {\n\t\t *         return \"header-item\";\n\t\t *     }\n\t\t *     return \"regular-item\";\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #setItemRendererFactoryWithID()\n\t\t * @see #itemRendererFactory\n\t\t */\n\t\tpublic function get factoryIDFunction():Function\n\t\t{\n\t\t\treturn this._factoryIDFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set factoryIDFunction(value:Function):void\n\t\t{\n\t\t\tif(this._factoryIDFunction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._factoryIDFunction = value;\n\t\t\tif(value !== null && this._itemRendererFactories === null)\n\t\t\t{\n\t\t\t\tthis._itemRendererFactories = {};\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _typicalItem:Object = null;\n\n\t\t/**\n\t\t * Used to auto-size the list when a virtualized layout is used. If the\n\t\t * list's width or height is unknown, the list will try to automatically\n\t\t * pick an ideal size. This item is used to create a sample item\n\t\t * renderer to measure item renderers that are virtual and not visible\n\t\t * in the viewport.\n\t\t *\n\t\t * <p>The following example provides a typical item:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.typicalItem = { text: \"A typical item\", thumbnail: texture };</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get typicalItem():Object\n\t\t{\n\t\t\treturn this._typicalItem;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set typicalItem(value:Object):void\n\t\t{\n\t\t\tif(this._typicalItem == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._typicalItem = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customItemRendererStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customItemRendererStyleName():String\n\t\t{\n\t\t\treturn this._customItemRendererStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customItemRendererStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customItemRendererStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customItemRendererStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _itemRendererProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for all of the list's item\n\t\t * renderers, and the properties will be passed down to every item\n\t\t * renderer when the list validates. The available properties\n\t\t * depend on which <code>IListItemRenderer</code> implementation is\n\t\t * returned by <code>itemRendererFactory</code>.\n\t\t *\n\t\t * <p>By default, the <code>itemRendererFactory</code> will return a\n\t\t * <code>DefaultListItemRenderer</code> instance. If you aren't using a\n\t\t * custom item renderer, you can refer to\n\t\t * <a href=\"renderers/DefaultListItemRenderer.html\"><code>feathers.controls.renderers.DefaultListItemRenderer</code></a>\n\t\t * for a list of available properties.</p>\n\t\t *\n\t\t * <p>These properties are shared by every item renderer, so anything\n\t\t * that cannot be shared (such as display objects, which cannot be added\n\t\t * to multiple parents) should be passed to item renderers using the\n\t\t * <code>itemRendererFactory</code> or in the theme.</p>\n\t\t *\n\t\t * <p>The following example customizes some item renderer properties\n\t\t * (this example assumes that the item renderer's label text renderer\n\t\t * is a <code>BitmapFontTextRenderer</code>):</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.itemRendererProperties.labelField = \"text\";\n\t\t * list.itemRendererProperties.accessoryField = \"control\";</listing>\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>itemRendererFactory</code> function\n\t\t * instead of using <code>itemRendererProperties</code> will result in\n\t\t * better performance.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #itemRendererFactory\n\t\t * @see feathers.controls.renderers.IListItemRenderer\n\t\t * @see feathers.controls.renderers.DefaultListItemRenderer\n\t\t */\n\t\tpublic function get itemRendererProperties():Object\n\t\t{\n\t\t\tif(!this._itemRendererProperties)\n\t\t\t{\n\t\t\t\tthis._itemRendererProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._itemRendererProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set itemRendererProperties(value:Object):void\n\t\t{\n\t\t\tif(this._itemRendererProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._itemRendererProperties)\n\t\t\t{\n\t\t\t\tthis._itemRendererProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._itemRendererProperties = PropertyProxy(value);\n\t\t\tif(this._itemRendererProperties)\n\t\t\t{\n\t\t\t\tthis._itemRendererProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _keyScrollDuration:Number = 0.25;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get keyScrollDuration():Number\n\t\t{\n\t\t\treturn this._keyScrollDuration;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set keyScrollDuration(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._keyScrollDuration = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _dragFormat:String = DEFAULT_DRAG_FORMAT;\n\n\t\t/**\n\t\t * Drag and drop is restricted to components that have the same\n\t\t * <code>dragFormat</code>.\n\t\t *\n\t\t * <p>In the following example, the drag format of two lists is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list1.dragFormat = \"my-custom-format\";\n\t\t * list2.dragFormat = \"my-custom-format\";</listing>\n\t\t *\n\t\t * @default \"feathers-list-item\"\n\t\t */\n\t\tpublic function get dragFormat():String\n\t\t{\n\t\t\treturn this._dragFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set dragFormat(value:String):void\n\t\t{\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = DEFAULT_DRAG_FORMAT;\n\t\t\t}\n\t\t\tif(this._dragFormat == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._dragFormat = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _dragEnabled:Boolean = false;\n\n\t\t/**\n\t\t * Indicates if this list can initiate drag and drop operations by\n\t\t * touching an item and dragging it. The <code>dragEnabled</code>\n\t\t * property enables dragging items, but dropping items must be enabled\n\t\t * separately with the <code>dropEnabled</code> property.\n\t\t *\n\t\t * <p>In the following example, a list's items may be dragged:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.dragEnabled = true;</listing>\n\t\t *\n\t\t * @see #dropEnabled\n\t\t * @see #dragFormat\n\t\t */\n\t\tpublic function get dragEnabled():Boolean\n\t\t{\n\t\t\treturn this._dragEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set dragEnabled(value:Boolean):void\n\t\t{\n\t\t\tif(this._dragEnabled == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._dragEnabled = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _dropEnabled:Boolean = false;\n\n\t\t/**\n\t\t * Indicates if this list can accept items that are dragged and\n\t\t * dropped over the list's hit area.\n\t\t *\n\t\t * <p>In the following example, a list's items may be dropped:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.dropEnabled = true;</listing>\n\t\t *\n\t\t * @see #dragEnabled\n\t\t * @see #dragFormat\n\t\t */\n\t\tpublic function get dropEnabled():Boolean\n\t\t{\n\t\t\treturn this._dropEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set dropEnabled(value:Boolean):void\n\t\t{\n\t\t\tif(this._dropEnabled == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._dropEnabled = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _dropIndicatorSkin:DisplayObject = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get dropIndicatorSkin():DisplayObject\n\t\t{\n\t\t\treturn this._dropIndicatorSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set dropIndicatorSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._dropIndicatorSkin = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimumAutoScrollDistance:Number = 0.2;\n\n\t\t/**\n\t\t * The minimum physical distance (in inches) that a touch must be from\n\t\t * the edge of the container during a drag and drop action before the\n\t\t * container starts scrolling.\n\t\t *\n\t\t * <p>In the following example, the minimum auto-scroll distance is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scroller.minimumAutoScrollDistance = 0.1;</listing>\n\t\t *\n\t\t * @default 0.3\n\t\t */\n\t\tpublic function get minimumAutoScrollDistance():Number\n\t\t{\n\t\t\treturn this._minimumAutoScrollDistance;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minimumAutoScrollDistance(value:Number):void\n\t\t{\n\t\t\tif(this._minimumAutoScrollDistance == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._minimumAutoScrollDistance = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * The pending item index to scroll to after validating. A value of\n\t\t * <code>-1</code> means that the scroller won't scroll to an item after\n\t\t * validating.\n\t\t */\n\t\tprotected var pendingItemIndex:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function scrollToPosition(horizontalScrollPosition:Number, verticalScrollPosition:Number, animationDuration:Number = NaN):void\n\t\t{\n\t\t\tthis.pendingItemIndex = -1;\n\t\t\tsuper.scrollToPosition(horizontalScrollPosition, verticalScrollPosition, animationDuration);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function scrollToPageIndex(horizontalPageIndex:int, verticalPageIndex:int, animationDuration:Number = NaN):void\n\t\t{\n\t\t\tthis.pendingItemIndex = -1;\n\t\t\tsuper.scrollToPageIndex(horizontalPageIndex, verticalPageIndex, animationDuration);\n\t\t}\n\n\t\t/**\n\t\t * Scrolls the list so that the specified item is visible. If\n\t\t * <code>animationDuration</code> is greater than zero, the scroll will\n\t\t * animate. The duration is in seconds.\n\t\t *\n\t\t * <p>If the layout is virtual with variable item dimensions, this\n\t\t * function may not accurately scroll to the exact correct position. A\n\t\t * virtual layout with variable item dimensions is often forced to\n\t\t * estimate positions, so the results aren't guaranteed to be accurate.</p>\n\t\t *\n\t\t * <p>If you want to scroll to the end of the list, it is better to use\n\t\t * <code>scrollToPosition()</code> with <code>maxHorizontalScrollPosition</code>\n\t\t * or <code>maxVerticalScrollPosition</code>.</p>\n\t\t *\n\t\t * <p>In the following example, the list is scrolled to display index 10:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.scrollToDisplayIndex( 10 );</listing>\n\t\t *\n\t\t * @param index The integer index of an item from the data provider.\n\t\t * @param animationDuration The length of time, in seconds, of the animation. May be zero to scroll instantly.\n\t\t *\n\t\t * @see #scrollToPosition()\n\t\t */\n\t\tpublic function scrollToDisplayIndex(index:int, animationDuration:Number = 0):void\n\t\t{\n\t\t\t//cancel any pending scroll to a different page or scroll position.\n\t\t\t//we can have only one type of pending scroll at a time.\n\t\t\tthis.hasPendingHorizontalPageIndex = false;\n\t\t\tthis.hasPendingVerticalPageIndex = false;\n\t\t\tthis.pendingHorizontalScrollPosition = NaN;\n\t\t\tthis.pendingVerticalScrollPosition = NaN;\n\t\t\tif(this.pendingItemIndex == index &&\n\t\t\t\tthis.pendingScrollDuration == animationDuration)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.pendingItemIndex = index;\n\t\t\tthis.pendingScrollDuration = animationDuration;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_PENDING_SCROLL);\n\t\t}\n\n\t\t/**\n\t\t * Returns the item renderer factory associated with a specific ID.\n\t\t * Returns <code>null</code> if no factory is associated with the ID.\n\t\t *\n\t\t * @see #setItemRendererFactoryWithID()\n\t\t */\n\t\tpublic function getItemRendererFactoryWithID(id:String):Function\n\t\t{\n\t\t\tif(this._itemRendererFactories && (id in this._itemRendererFactories))\n\t\t\t{\n\t\t\t\treturn this._itemRendererFactories[id] as Function;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * Associates an item renderer factory with an ID to allow multiple\n\t\t * types of item renderers may be displayed in the list. A custom\n\t\t * <code>factoryIDFunction</code> may be specified to return the ID of\n\t\t * the factory to use for a specific item in the data provider.\n\t\t *\n\t\t * @see #factoryIDFunction\n\t\t * @see #getItemRendererFactoryWithID()\n\t\t */\n\t\tpublic function setItemRendererFactoryWithID(id:String, factory:Function):void\n\t\t{\n\t\t\tif(id === null)\n\t\t\t{\n\t\t\t\tthis.itemRendererFactory = factory;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._itemRendererFactories === null)\n\t\t\t{\n\t\t\t\tthis._itemRendererFactories = {};\n\t\t\t}\n\t\t\tif(factory !== null)\n\t\t\t{\n\t\t\t\tthis._itemRendererFactories[id] = factory;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdelete this._itemRendererFactories[id];\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Returns the current item renderer used to render a specific item. May\n\t\t * return <code>null</code> if an item doesn't currently have an item\n\t\t * renderer. Most lists use virtual layouts where only the visible items\n\t\t * will have an item renderer, so the result will usually be\n\t\t * <code>null</code> for most items in the data provider.\n\t\t *\n\t\t * @see ../../../help/faq/layout-virtualization.html What is layout virtualization?\n\t\t */\n\t\tpublic function itemToItemRenderer(item:Object):IListItemRenderer\n\t\t{\n\t\t\treturn this.dataViewPort.itemToItemRenderer(item);\n\t\t}\n\n\t\t/**\n\t\t * Adds an item from the data provider and animates its item renderer\n\t\t * using an effect.\n\t\t *\n\t\t * <p>In the following example, an effect fades the item renderer's\n\t\t * <code>alpha</code> property from <code>0</code> to <code>1</code>:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.addItemWithEffect(newItem, list.dataProvider.length, Fade.createFadeBetweenEffect(0, 1));</listing>\n\t\t *\n\t\t * <p>A number of animated effects may be found in the\n\t\t * <a href=\"../motion/package-detail.html\">feathers.motion</a> package.\n\t\t * However, you are not limited to only these effects. It's possible\n\t\t * to create custom effects too.</p>\n\t\t *\n\t\t * <p>A custom effect function should have the following signature:</p>\n\t\t * <pre>function(target:DisplayObject):IEffectContext</pre>\n\t\t *\n\t\t * <p>The <code>IEffectContext</code> is used by the component to\n\t\t * control the effect, performing actions like playing the effect,\n\t\t * pausing it, or cancelling it.</p>\n\t\t *\n\t\t * <p>Custom animated effects that use\n\t\t * <code>starling.display.Tween</code> typically return a\n\t\t * <code>TweenEffectContext</code>. In the following example, we\n\t\t * recreate the <code>Fade.createFadeBetweenEffect()</code> used in the\n\t\t * previous example.</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * function customEffect(target:DisplayObject):IEffectContext\n\t\t * {\n\t\t *     target.alpha = 0;\n\t\t *     var tween:Tween = new Tween(target, 0.5, Transitions.EASE_OUT);\n\t\t *     tween.fadeTo(1);\n\t\t *     return new TweenEffectContext(target, tween);\n\t\t * }\n\t\t * list.addItemWithEffect(newItem, list.dataProvider.length, customEffect);</listing>\n\t\t *\n\t\t * @see #removeItemWithEffect()\n\t\t * @see feathers.data.IListCollection#addItem()\n\t\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t\t * @see feathers.motion.effectClasses.IEffectContext\n\t\t * @see feathers.motion.effectClasses.TweenEffectContext\n\t\t */\n\t\tpublic function addItemWithEffect(item:Object, index:int, effect:Function):void\n\t\t{\n\t\t\t//add to the data provider immediately\n\t\t\tthis._dataProvider.addItemAt(item, index);\n\t\t\tif(this._addedItems === null)\n\t\t\t{\n\t\t\t\tthis._addedItems = new Dictionary();\n\t\t\t}\n\t\t\tthis._addedItems[item] = effect;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * Removes an item from the data provider <strong>after</strong>\n\t\t * animating its item renderer using an effect.\n\t\t *\n\t\t * <p>In the following example, an effect fades the item renderer's\n\t\t * <code>alpha</code> property to <code>0</code>:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.removeItemWithEffect(newItem, list.dataProvider.length, Fade.createFadeOutEffect());</listing>\n\t\t *\n\t\t * <p>A number of animated effects may be found in the\n\t\t * <a href=\"../motion/package-detail.html\">feathers.motion</a> package.\n\t\t * However, you are not limited to only these effects. It's possible\n\t\t * to create custom effects too.</p>\n\t\t *\n\t\t * <p>A custom effect function should have the following signature:</p>\n\t\t * <pre>function(target:DisplayObject):IEffectContext</pre>\n\t\t *\n\t\t * <p>The <code>IEffectContext</code> is used by the component to\n\t\t * control the effect, performing actions like playing the effect,\n\t\t * pausing it, or cancelling it.</p>\n\t\t *\n\t\t * <p>Custom animated effects that use\n\t\t * <code>starling.display.Tween</code> typically return a\n\t\t * <code>TweenEffectContext</code>. In the following example, we\n\t\t * recreate the <code>Fade.createFadeOutEffect()</code> used in the\n\t\t * previous example.</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * function customEffect(target:DisplayObject):IEffectContext\n\t\t * {\n\t\t *     var tween:Tween = new Tween(target, 0.5, Transitions.EASE_OUT);\n\t\t *     tween.fadeTo(0);\n\t\t *     return new TweenEffectContext(target, tween);\n\t\t * }\n\t\t * list.removeItemWithEffect(newItem, customEffect);</listing>\n\t\t *\n\t\t * @see #addItemWithEffect()\n\t\t * @see feathers.data.IListCollection#removeItem()\n\t\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t\t * @see feathers.motion.effectClasses.IEffectContext\n\t\t * @see feathers.motion.effectClasses.TweenEffectContext\n\t\t */\n\t\tpublic function removeItemWithEffect(item:Object, effect:Function):void\n\t\t{\n\t\t\t//don't remove from the data provider yet because that will\n\t\t\t//immediately remove the item renderer. we'll wait until the effect\n\t\t\t//finishes instead.\n\t\t\tif(this._removedItems === null)\n\t\t\t{\n\t\t\t\tthis._removedItems = new Dictionary();\n\t\t\t}\n\t\t\tthis._removedItems[item] = effect;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//clearing selection now so that the data provider setter won't\n\t\t\t//cause a selection change that triggers events.\n\t\t\tthis._selectedIndices.removeEventListeners();\n\t\t\tthis._selectedIndex = -1;\n\t\t\tthis.dataProvider = null;\n\t\t\tthis.layout = null;\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tvar hasLayout:Boolean = this._layout !== null;\n\n\t\t\tsuper.initialize();\n\n\t\t\tif(!this.dataViewPort)\n\t\t\t{\n\t\t\t\tthis.viewPort = this.dataViewPort = new ListDataViewPort();\n\t\t\t\tthis.dataViewPort.owner = this;\n\t\t\t\tthis.viewPort = this.dataViewPort;\n\t\t\t}\n\n\t\t\tif(!hasLayout)\n\t\t\t{\n\t\t\t\tif(this._hasElasticEdges &&\n\t\t\t\t\tthis._verticalScrollPolicy === ScrollPolicy.AUTO &&\n\t\t\t\t\tthis._scrollBarDisplayMode !== ScrollBarDisplayMode.FIXED)\n\t\t\t\t{\n\t\t\t\t\t//so that the elastic edges work even when the max scroll\n\t\t\t\t\t//position is 0, similar to iOS.\n\t\t\t\t\tthis._verticalScrollPolicy = ScrollPolicy.ON;\n\t\t\t\t}\n\n\t\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\t\tlayout.useVirtualLayout = true;\n\t\t\t\tlayout.padding = 0;\n\t\t\t\tlayout.gap = 0;\n\t\t\t\tlayout.horizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\t\tlayout.verticalAlign = VerticalAlign.TOP;\n\t\t\t\tthis.ignoreNextStyleRestriction();\n\t\t\t\tthis.layout = layout;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tthis.refreshDataViewPortProperties();\n\t\t\tsuper.draw();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshDataViewPortProperties():void\n\t\t{\n\t\t\tthis.dataViewPort.isSelectable = this._isSelectable;\n\t\t\tthis.dataViewPort.allowMultipleSelection = this._allowMultipleSelection;\n\t\t\tthis.dataViewPort.selectedIndices = this._selectedIndices;\n\t\t\tthis.dataViewPort.dataProvider = this._dataProvider;\n\t\t\tthis.dataViewPort.itemRendererType = this._itemRendererType;\n\t\t\tthis.dataViewPort.itemRendererFactory = this._itemRendererFactory;\n\t\t\tthis.dataViewPort.itemRendererFactories = this._itemRendererFactories;\n\t\t\tthis.dataViewPort.factoryIDFunction = this._factoryIDFunction;\n\t\t\tthis.dataViewPort.itemRendererProperties = this._itemRendererProperties;\n\t\t\tthis.dataViewPort.customItemRendererStyleName = this._customItemRendererStyleName;\n\t\t\tthis.dataViewPort.typicalItem = this._typicalItem;\n\t\t\tthis.dataViewPort.layout = this._layout;\n\t\t\tthis.dataViewPort.addedItems = this._addedItems;\n\t\t\tthis.dataViewPort.removedItems = this._removedItems;\n\t\t\tthis.dataViewPort.dragFormat = this._dragFormat;\n\t\t\tthis.dataViewPort.dragEnabled = this._dragEnabled;\n\t\t\tthis.dataViewPort.dropEnabled = this._dropEnabled;\n\t\t\tthis.dataViewPort.dropIndicatorSkin = this._dropIndicatorSkin;\n\t\t\tthis.dataViewPort.minimumAutoScrollDistance = this._minimumAutoScrollDistance;\n\t\t\tthis._addedItems = null;\n\t\t\tthis._removedItems = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function handlePendingScroll():void\n\t\t{\n\t\t\tif(this.pendingItemIndex >= 0)\n\t\t\t{\n\t\t\t\tvar item:Object = null;\n\t\t\t\tif(this._dataProvider !== null)\n\t\t\t\t{\n\t\t\t\t\titem = this._dataProvider.getItemAt(this.pendingItemIndex);\n\t\t\t\t}\n\t\t\t\tif(item is Object)\n\t\t\t\t{\n\t\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\t\tthis.dataViewPort.getScrollPositionForIndex(this.pendingItemIndex, point);\n\t\t\t\t\tthis.pendingItemIndex = -1;\n\n\t\t\t\t\tvar targetHorizontalScrollPosition:Number = point.x;\n\t\t\t\t\tvar targetVerticalScrollPosition:Number = point.y;\n\t\t\t\t\tPool.putPoint(point);\n\t\t\t\t\tif(targetHorizontalScrollPosition < this._minHorizontalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\ttargetHorizontalScrollPosition = this._minHorizontalScrollPosition;\n\t\t\t\t\t}\n\t\t\t\t\telse if(targetHorizontalScrollPosition > this._maxHorizontalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\ttargetHorizontalScrollPosition = this._maxHorizontalScrollPosition;\n\t\t\t\t\t}\n\t\t\t\t\tif(targetVerticalScrollPosition < this._minVerticalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\ttargetVerticalScrollPosition = this._minVerticalScrollPosition;\n\t\t\t\t\t}\n\t\t\t\t\telse if(targetVerticalScrollPosition > this._maxVerticalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\ttargetVerticalScrollPosition = this._maxVerticalScrollPosition;\n\t\t\t\t\t}\n\t\t\t\t\tthis.throwTo(targetHorizontalScrollPosition, targetVerticalScrollPosition, this.pendingScrollDuration);\n\t\t\t\t}\n\t\t\t}\n\t\t\tsuper.handlePendingScroll();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function nativeStage_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(!this._isSelectable)\n\t\t\t{\n\t\t\t\t//not selectable, but should scroll\n\t\t\t\tsuper.nativeStage_keyDownHandler(event);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(event.isDefaultPrevented())\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!this._dataProvider)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._selectedIndex != -1 && (event.keyCode == Keyboard.SPACE ||\n\t\t\t\t((event.keyLocation == 4 || DeviceCapabilities.simulateDPad) && event.keyCode == Keyboard.ENTER)))\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(Event.TRIGGERED, false, this.selectedItem);\n\t\t\t}\n\t\t\tif(event.keyCode == Keyboard.HOME || event.keyCode == Keyboard.END ||\n\t\t\t\tevent.keyCode == Keyboard.PAGE_UP || event.keyCode == Keyboard.PAGE_DOWN ||\n\t\t\t\tevent.keyCode == Keyboard.UP || event.keyCode == Keyboard.DOWN ||\n\t\t\t\tevent.keyCode == Keyboard.LEFT || event.keyCode == Keyboard.RIGHT)\n\t\t\t{\n\t\t\t\tvar newIndex:int = this.dataViewPort.calculateNavigationDestination(this.selectedIndex, event.keyCode);\n\t\t\t\tif(this.selectedIndex != newIndex)\n\t\t\t\t{\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tthis.selectedIndex = newIndex;\n\t\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\t\tthis.dataViewPort.getNearestScrollPositionForIndex(this.selectedIndex, point);\n\t\t\t\t\tthis.scrollToPosition(point.x, point.y, this._keyScrollDuration);\n\t\t\t\t\tPool.putPoint(point);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function stage_gestureDirectionalTapHandler(event:TransformGestureEvent):void\n\t\t{\n\t\t\tif(event.isDefaultPrevented())\n\t\t\t{\n\t\t\t\t//something else has already handled this event\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar keyCode:uint = int.MAX_VALUE;\n\t\t\tif(event.offsetY < 0)\n\t\t\t{\n\t\t\t\tkeyCode = Keyboard.UP;\n\t\t\t}\n\t\t\telse if(event.offsetY > 0)\n\t\t\t{\n\t\t\t\tkeyCode = Keyboard.DOWN;\n\t\t\t}\n\t\t\telse if(event.offsetX > 0)\n\t\t\t{\n\t\t\t\tkeyCode = Keyboard.RIGHT;\n\t\t\t}\n\t\t\telse if(event.offsetX < 0)\n\t\t\t{\n\t\t\t\tkeyCode = Keyboard.LEFT;\n\t\t\t}\n\t\t\tif(keyCode == int.MAX_VALUE)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar newIndex:int = this.dataViewPort.calculateNavigationDestination(this.selectedIndex, keyCode);\n\t\t\tif(this.selectedIndex != newIndex)\n\t\t\t{\n\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t\t//event.preventDefault();\n\t\t\t\tthis.selectedIndex = newIndex;\n\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\tthis.dataViewPort.getNearestScrollPositionForIndex(this.selectedIndex, point);\n\t\t\t\tthis.scrollToPosition(point.x, point.y, this._keyScrollDuration);\n\t\t\t\tPool.putPoint(point);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_resetHandler(event:Event):void\n\t\t{\n\t\t\tthis.horizontalScrollPosition = 0;\n\t\t\tthis.verticalScrollPosition = 0;\n\n\t\t\t//the entire data provider was replaced. select no item.\n\t\t\tthis._selectedIndices.removeAll();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_addItemHandler(event:Event, index:int):void\n\t\t{\n\t\t\tif(this._selectedIndex == -1)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar selectionChanged:Boolean = false;\n\t\t\tvar newIndices:Vector.<int> = new <int>[];\n\t\t\tvar indexCount:int = this._selectedIndices.length;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tvar currentIndex:int = this._selectedIndices.getItemAt(i) as int;\n\t\t\t\tif(currentIndex >= index)\n\t\t\t\t{\n\t\t\t\t\tcurrentIndex++;\n\t\t\t\t\tselectionChanged = true;\n\t\t\t\t}\n\t\t\t\tnewIndices.push(currentIndex);\n\t\t\t}\n\t\t\tif(selectionChanged)\n\t\t\t{\n\t\t\t\tthis._selectedIndices.data = newIndices;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_removeAllHandler(event:Event):void\n\t\t{\n\t\t\tthis.selectedIndex = -1;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_removeItemHandler(event:Event, index:int):void\n\t\t{\n\t\t\tif(this._selectedIndex == -1)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar selectionChanged:Boolean = false;\n\t\t\tvar newIndices:Vector.<int> = new <int>[];\n\t\t\tvar indexCount:int = this._selectedIndices.length;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tvar currentIndex:int = this._selectedIndices.getItemAt(i) as int;\n\t\t\t\tif(currentIndex == index)\n\t\t\t\t{\n\t\t\t\t\tselectionChanged = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(currentIndex > index)\n\t\t\t\t\t{\n\t\t\t\t\t\tcurrentIndex--;\n\t\t\t\t\t\tselectionChanged = true;\n\t\t\t\t\t}\n\t\t\t\t\tnewIndices.push(currentIndex);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(selectionChanged)\n\t\t\t{\n\t\t\t\tthis._selectedIndices.data = newIndices;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshSelectedIndicesAfterFilterOrSort():void\n\t\t{\n\t\t\tif(this._selectedIndex == -1)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar selectionChanged:Boolean = false;\n\t\t\tvar newIndices:Vector.<int> = new <int>[];\n\t\t\tvar pushIndex:int = 0;\n\t\t\tvar count:int = this._selectedItems.length;\n\t\t\tfor(var i:int = 0; i < count; i++)\n\t\t\t{\n\t\t\t\tvar selectedItem:Object = this._selectedItems[i];\n\t\t\t\tvar oldIndex:int = this._selectedIndices.getItemAt(i) as int;\n\t\t\t\tvar newIndex:int = this._dataProvider.getItemIndex(selectedItem);\n\t\t\t\tif(newIndex >= 0)\n\t\t\t\t{\n\t\t\t\t\tif(newIndex != oldIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\t//the item was not filtered, but it moved to a new index\n\t\t\t\t\t\tselectionChanged = true;\n\t\t\t\t\t}\n\t\t\t\t\tnewIndices[pushIndex] = newIndex;\n\t\t\t\t\tpushIndex++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//the item is filtered, so it should not be selected\n\t\t\t\t\tselectionChanged = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(selectionChanged)\n\t\t\t{\n\t\t\t\tthis._selectedIndices.data = newIndices;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_filterChangeHandler(event:Event):void\n\t\t{\n\t\t\tthis.refreshSelectedIndicesAfterFilterOrSort();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_sortChangeHandler(event:Event):void\n\t\t{\n\t\t\tthis.refreshSelectedIndicesAfterFilterOrSort();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_replaceItemHandler(event:Event, index:int):void\n\t\t{\n\t\t\tif(this._selectedIndex == -1)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar indexOfIndex:int = this._selectedIndices.getItemIndex(index);\n\t\t\tif(indexOfIndex >= 0)\n\t\t\t{\n\t\t\t\tthis._selectedIndices.removeItemAt(indexOfIndex);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function selectedIndices_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.getSelectedItems(this._selectedItems);\n\t\t\tif(this._selectedIndices.length > 0)\n\t\t\t{\n\t\t\t\tthis._selectedIndex = this._selectedIndices.getItemAt(0) as int;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(this._selectedIndex < 0)\n\t\t\t\t{\n\t\t\t\t\t//no change\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._selectedIndex = -1;\n\t\t\t}\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate function layout_scrollHandler(event:Event, scrollOffset:Point):void\n\t\t{\n\t\t\tvar layout:IVariableVirtualLayout = IVariableVirtualLayout(this._layout);\n\t\t\tif(!this.isScrolling || !layout.useVirtualLayout || !layout.hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar scrollOffsetX:Number = scrollOffset.x;\n\t\t\tthis._startHorizontalScrollPosition += scrollOffsetX;\n\t\t\tthis._horizontalScrollPosition += scrollOffsetX;\n\t\t\tif(this._horizontalAutoScrollTween)\n\t\t\t{\n\t\t\t\tthis._targetHorizontalScrollPosition += scrollOffsetX;\n\t\t\t\tthis.throwTo(this._targetHorizontalScrollPosition, NaN, this._horizontalAutoScrollTween.totalTime - this._horizontalAutoScrollTween.currentTime);\n\t\t\t}\n\n\t\t\tvar scrollOffsetY:Number = scrollOffset.y;\n\t\t\tthis._startVerticalScrollPosition += scrollOffsetY;\n\t\t\tthis._verticalScrollPosition += scrollOffsetY;\n\t\t\tif(this._verticalAutoScrollTween)\n\t\t\t{\n\t\t\t\tthis._targetVerticalScrollPosition += scrollOffsetY;\n\t\t\t\tthis.throwTo(NaN, this._targetVerticalScrollPosition, this._verticalAutoScrollTween.totalTime - this._verticalAutoScrollTween.currentTime);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/controls/NumericStepper.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IAdvancedNativeFocusOwner;\n\timport feathers.core.ITextBaselineControl;\n\timport feathers.core.PropertyProxy;\n\timport feathers.events.ExclusiveTouch;\n\timport feathers.events.FeathersEventType;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.utils.math.clamp;\n\timport feathers.utils.math.roundToNearest;\n\timport feathers.utils.math.roundToPrecision;\n\n\timport flash.events.TimerEvent;\n\timport flash.ui.Keyboard;\n\timport flash.utils.Timer;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.events.KeyboardEvent;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\t/**\n\t * How the buttons are positioned relative to the text input.\n\t *\n\t * <p>In the following example, the button layout is set to place the\n\t * buttons on the right side, stacked vertically, for a desktop\n\t * appearance:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * stepper.buttonLayoutMode = NumericStepper.StepperButtonLayoutMode.RIGHT_SIDE_VERTICAL;</listing>\n\t *\n\t * @default feathers.controls.StepperButtonLayoutMode.SPLIT_HORIZONTAL\n\t *\n\t * @see feathers.controls.StepperButtonLayoutMode#SPLIT_HORIZONTAL\n\t * @see feathers.controls.StepperButtonLayoutMode#SPLIT_VERTICAL\n\t * @see feathers.controls.StepperButtonLayoutMode#RIGHT_SIDE_VERTICAL\n\t */\n\t[Style(name=\"buttonLayoutMode\",type=\"String\")]\n\n\t/**\n\t * The gap, in pixels, between the numeric stepper's increment and\n\t * decrement buttons when they are both positioned on the same side. If\n\t * the buttons are split between two sides, this value is not used.\n\t *\n\t * <p>In the following example, the gap between buttons is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * stepper.buttonLayoutMode = StepperButtonLayoutMode.RIGHT_SIDE_VERTICAL;\n\t * stepper.buttonGap = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:textInputGap\n\t * @see #style:buttonLayoutMode\n\t */\n\t[Style(name=\"buttonGap\",type=\"Number\")]\n\n\t/**\n\t * A style name to add to the numeric stepper's decrement button\n\t * sub-component. Typically used by a theme to provide different styles\n\t * to different numeric steppers.\n\t *\n\t * <p>In the following example, a custom decrement button style name is\n\t * passed to the stepper:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * stepper.customDecrementButtonStyleName = \"my-custom-decrement-button\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( Button ).setFunctionForStyleName( \"my-custom-decrement-button\", setCustomDecrementButtonStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_DECREMENT_BUTTON\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #decrementButtonFactory\n\t */\n\t[Style(name=\"customDecrementButtonStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to the numeric stepper's increment button\n\t * sub-component. Typically used by a theme to provide different styles\n\t * to different numeric steppers.\n\t *\n\t * <p>In the following example, a custom increment button style name is\n\t * passed to the stepper:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * stepper.customIncrementButtonStyleName = \"my-custom-increment-button\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( Button ).setFunctionForStyleName( \"my-custom-increment-button\", setCustomIncrementButtonStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_INCREMENT_BUTTON\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #incrementButtonFactory\n\t */\n\t[Style(name=\"customIncrementButtonStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to the numeric stepper's text input sub-component.\n\t * Typically used by a theme to provide different styles to different\n\t * text inputs.\n\t *\n\t * <p>In the following example, a custom text input style name is passed\n\t * to the stepper:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * stepper.customTextInputStyleName = \"my-custom-text-input\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( TextInput ).setFunctionForStyleName( \"my-custom-text-input\", setCustomTextInputStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_TEXT_INPUT\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #textInputFactory\n\t */\n\t[Style(name=\"customTextInputStyleName\",type=\"String\")]\n\n\t/**\n\t * The text displayed by the decrement button. Often, there is no text\n\t * displayed on this button and an icon is used instead.\n\t *\n\t * <p>In the following example, the decrement button's label is customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * stepper.decrementButtonLabel = \"-\";</listing>\n\t *\n\t * @default null\n\t */\n\t[Style(name=\"decrementButtonLabel\",type=\"String\")]\n\n\t/**\n\t * The text displayed by the increment button. Often, there is no text\n\t * displayed on this button and an icon is used instead.\n\t *\n\t * <p>In the following example, the increment button's label is customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * stepper.incrementButtonLabel = \"+\";</listing>\n\t *\n\t * @default null\n\t */\n\t[Style(name=\"incrementButtonLabel\",type=\"String\")]\n\n\t/**\n\t * The gap, in pixels, between the numeric stepper's text input and its\n\t * buttons. If the buttons are split, this gap is used on both sides. If\n\t * the buttons both appear on the same side, the gap is used only on\n\t * that side.\n\t *\n\t * <p>In the following example, the gap between the text input and buttons is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * stepper.textInputGap = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:buttonGap\n\t * @see #style:buttonLayoutMode\n\t */\n\t[Style(name=\"textInputGap\",type=\"Number\")]\n\n\t/**\n\t * Dispatched when the stepper's value changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #value\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Select a value between a minimum and a maximum by using increment and\n\t * decrement buttons or typing in a value in a text input.\n\t *\n\t * <p>The following example sets the stepper's range and listens for when\n\t * the value changes:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var stepper:NumericStepper = new NumericStepper();\n\t * stepper.minimum = 0;\n\t * stepper.maximum = 100;\n\t * stepper.step = 1;\n\t * stepper.value = 12;\n\t * stepper.addEventListener( Event.CHANGE, stepper_changeHandler );\n\t * this.addChild( stepper );</listing>\n\t *\n\t * @see ../../../help/numeric-stepper.html How to use the Feathers NumericStepper component\n\t *\n\t * @productversion Feathers 1.1.0\n\t */\n\tpublic class NumericStepper extends FeathersControl implements IRange, IAdvancedNativeFocusOwner, ITextBaselineControl\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_DECREMENT_BUTTON_FACTORY:String = \"decrementButtonFactory\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_INCREMENT_BUTTON_FACTORY:String = \"incrementButtonFactory\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_TEXT_INPUT_FACTORY:String = \"textInputFactory\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the decrement\n\t\t * button.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_DECREMENT_BUTTON:String = \"feathers-numeric-stepper-decrement-button\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the increment\n\t\t * button.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_INCREMENT_BUTTON:String = \"feathers-numeric-stepper-increment-button\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the text\n\t\t * input.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_TEXT_INPUT:String = \"feathers-numeric-stepper-text-input\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>NumericStepper</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultDecrementButtonFactory():Button\n\t\t{\n\t\t\treturn new Button();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultIncrementButtonFactory():Button\n\t\t{\n\t\t\treturn new Button();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultTextInputFactory():TextInput\n\t\t{\n\t\t\treturn new TextInput();\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function NumericStepper()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.addEventListener(Event.REMOVED_FROM_STAGE, numericStepper_removedFromStageHandler);\n\t\t}\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the decrement\n\t\t * button. This variable is <code>protected</code> so that sub-classes\n\t\t * can customize the decrement button style name in their constructors\n\t\t * instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_DECREMENT_BUTTON</code>.\n\t\t *\n\t\t * <p>To customize the decrement button name without subclassing, see\n\t\t * <code>customDecrementButtonStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customDecrementButtonStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var decrementButtonStyleName:String = DEFAULT_CHILD_STYLE_NAME_DECREMENT_BUTTON;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the increment\n\t\t * button. This variable is <code>protected</code> so that sub-classes\n\t\t * can customize the increment button style name in their constructors\n\t\t * instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_INCREMENT_BUTTON</code>.\n\t\t *\n\t\t * <p>To customize the increment button name without subclassing, see\n\t\t * <code>customIncrementButtonStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customIncrementButtonStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var incrementButtonStyleName:String = DEFAULT_CHILD_STYLE_NAME_INCREMENT_BUTTON;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the text input.\n\t\t * This variable is <code>protected</code> so that sub-classes can\n\t\t * customize the text input style name in their constructors instead of\n\t\t * using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_TEXT_INPUT</code>.\n\t\t *\n\t\t * <p>To customize the text input name without subclassing, see\n\t\t * <code>customTextInputStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customTextInputStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var textInputStyleName:String = DEFAULT_CHILD_STYLE_NAME_TEXT_INPUT;\n\n\t\t/**\n\t\t * The decrement button sub-component.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t *\n\t\t * @see #createDecrementButton()\n\t\t */\n\t\tprotected var decrementButton:Button;\n\n\t\t/**\n\t\t * The increment button sub-component.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t *\n\t\t * @see #createIncrementButton()\n\t\t */\n\t\tprotected var incrementButton:Button;\n\n\t\t/**\n\t\t * The text input sub-component.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t *\n\t\t * @see #createTextInput()\n\t\t */\n\t\tprotected var textInput:TextInput;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var textInputExplicitWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var textInputExplicitHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var textInputExplicitMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var textInputExplicitMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var touchPointID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textInputHasFocus:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn NumericStepper.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * A text input's text editor may be an <code>INativeFocusOwner</code>,\n\t\t * so we need to return the value of its <code>nativeFocus</code>\n\t\t * property.\n\t\t *\n\t\t * @see feathers.core.INativeFocusOwner\n\t\t */\n\t\tpublic function get nativeFocus():Object\n\t\t{\n\t\t\tif(this.textInput !== null)\n\t\t\t{\n\t\t\t\treturn this.textInput.nativeFocus;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _value:Number = 0;\n\n\t\t/**\n\t\t * The value of the numeric stepper, between the minimum and maximum.\n\t\t *\n\t\t * <p>In the following example, the value is changed to 12:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * stepper.minimum = 0;\n\t\t * stepper.maximum = 100;\n\t\t * stepper.step = 1;\n\t\t * stepper.value = 12;</listing>\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #minimum\n\t\t * @see #maximum\n\t\t * @see #step\n\t\t * @see #event:change\n\t\t */\n\t\tpublic function get value():Number\n\t\t{\n\t\t\treturn this._value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set value(newValue:Number):void\n\t\t{\n\t\t\tif(this._step != 0 && newValue != this._maximum && newValue != this._minimum)\n\t\t\t{\n\t\t\t\t//roundToPrecision helps us to avoid numbers like 1.00000000000000001\n\t\t\t\t//caused by the inaccuracies of floating point math.\n\t\t\t\tnewValue = roundToPrecision(roundToNearest(newValue - this._minimum, this._step) + this._minimum, 10);\n\t\t\t}\n\t\t\tnewValue = clamp(newValue, this._minimum, this._maximum);\n\t\t\tif(this._value == newValue)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._value = newValue;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimum:Number = 0;\n\n\t\t/**\n\t\t * The numeric stepper's value will not go lower than the minimum.\n\t\t *\n\t\t * <p>In the following example, the minimum is changed to 0:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * stepper.minimum = 0;\n\t\t * stepper.maximum = 100;\n\t\t * stepper.step = 1;\n\t\t * stepper.value = 12;</listing>\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #value\n\t\t * @see #maximum\n\t\t * @see #step\n\t\t */\n\t\tpublic function get minimum():Number\n\t\t{\n\t\t\treturn this._minimum;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minimum(value:Number):void\n\t\t{\n\t\t\tif(this._minimum == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._minimum = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maximum:Number = 0;\n\n\t\t/**\n\t\t * The numeric stepper's value will not go higher than the maximum.\n\t\t *\n\t\t * <p>In the following example, the maximum is changed to 100:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * stepper.minimum = 0;\n\t\t * stepper.maximum = 100;\n\t\t * stepper.step = 1;\n\t\t * stepper.value = 12;</listing>\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #value\n\t\t * @see #minimum\n\t\t * @see #step\n\t\t */\n\t\tpublic function get maximum():Number\n\t\t{\n\t\t\treturn this._maximum;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maximum(value:Number):void\n\t\t{\n\t\t\tif(this._maximum == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._maximum = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _step:Number = 0;\n\n\t\t/**\n\t\t * As the numeric stepper's buttons are pressed, the value is snapped to\n\t\t * a multiple of the step.\n\t\t *\n\t\t * <p>In the following example, the step is changed to 1:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * stepper.minimum = 0;\n\t\t * stepper.maximum = 100;\n\t\t * stepper.step = 1;\n\t\t * stepper.value = 12;</listing>\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #value\n\t\t * @see #minimum\n\t\t * @see #maximum\n\t\t */\n\t\tpublic function get step():Number\n\t\t{\n\t\t\treturn this._step;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set step(value:Number):void\n\t\t{\n\t\t\tif(this._step == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._step = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _useLeftAndRightKeys:Boolean = false;\n\n\t\t/**\n\t\t * Indicates if the <code>Keyboard.LEFT</code> and\n\t\t * <code>Keyboard.RIGHT</code> keys should be used to change the value\n\t\t * of the stepper, instead of the default <code>Keyboard.DOWN</code> and\n\t\t * <code>Keyboard.UP</code> keys.\n\t\t *\n\t\t * <p>In the following example, the left and right keys are preferred:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * stepper.useLeftAndRightKeys = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic function get useLeftAndRightKeys():Boolean\n\t\t{\n\t\t\treturn this._useLeftAndRightKeys;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set useLeftAndRightKeys(newValue:Boolean):void\n\t\t{\n\t\t\tthis._useLeftAndRightKeys = newValue;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _valueFormatFunction:Function;\n\n\t\t/**\n\t\t * A callback that formats the numeric stepper's value as a string to\n\t\t * display to the user.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function(value:Number):String</pre>\n\t\t *\n\t\t * <p>In the following example, the stepper's value format function is\n\t\t * customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * stepper.valueFormatFunction = function(value:Number):String\n\t\t * {\n\t\t *     return currencyFormatter.format(value, true);\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #valueParseFunction\n\t\t */\n\t\tpublic function get valueFormatFunction():Function\n\t\t{\n\t\t\treturn this._valueFormatFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set valueFormatFunction(value:Function):void\n\t\t{\n\t\t\tif(this._valueFormatFunction == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._valueFormatFunction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _valueParseFunction:Function;\n\n\t\t/**\n\t\t * A callback that accepts the displayed text of the numeric stepper and\n\t\t * converts it to a simple numeric value.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function(displayedText:String):Number</pre>\n\t\t *\n\t\t * <p>In the following example, the stepper's value parse function is\n\t\t * customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * stepper.valueParseFunction = function(displayedText:String):Number\n\t\t * {\n\t\t *     return currencyFormatter.parse(displayedText).value;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #valueFormatFunction\n\t\t */\n\t\tpublic function get valueParseFunction():Function\n\t\t{\n\t\t\treturn this._valueParseFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set valueParseFunction(value:Function):void\n\t\t{\n\t\t\tthis._valueParseFunction = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var currentRepeatAction:Function;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _repeatTimer:Timer;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _repeatDelay:Number = 0.05;\n\n\t\t/**\n\t\t * The time, in seconds, before actions are repeated. The first repeat\n\t\t * happens after a delay that is five times longer than the following\n\t\t * repeats.\n\t\t *\n\t\t * <p>In the following example, the stepper's repeat delay is set to\n\t\t * 500 milliseconds:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * stepper.repeatDelay = 0.5;</listing>\n\t\t *\n\t\t * @default 0.05\n\t\t */\n\t\tpublic function get repeatDelay():Number\n\t\t{\n\t\t\treturn this._repeatDelay;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set repeatDelay(value:Number):void\n\t\t{\n\t\t\tif(this._repeatDelay == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._repeatDelay = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _buttonLayoutMode:String = StepperButtonLayoutMode.SPLIT_HORIZONTAL;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"splitHorizontal,splitVertical,rightSideVertical\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get buttonLayoutMode():String\n\t\t{\n\t\t\treturn this._buttonLayoutMode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set buttonLayoutMode(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._buttonLayoutMode === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._buttonLayoutMode = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _buttonGap:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get buttonGap():Number\n\t\t{\n\t\t\treturn this._buttonGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set buttonGap(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._buttonGap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._buttonGap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textInputGap:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get textInputGap():Number\n\t\t{\n\t\t\treturn this._textInputGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set textInputGap(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._textInputGap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textInputGap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _decrementButtonFactory:Function;\n\n\t\t/**\n\t\t * A function used to generate the numeric stepper's decrement button\n\t\t * sub-component. The decrement button must be an instance of\n\t\t * <code>Button</code>. This factory can be used to change properties on\n\t\t * the decrement button when it is first created. For instance, if you\n\t\t * are skinning Feathers components without a theme, you might use this\n\t\t * factory to set skins and other styles on the decrement button.\n\t\t *\n\t\t * <p>The function should have the following signature:</p>\n\t\t * <pre>function():Button</pre>\n\t\t *\n\t\t * <p>In the following example, a custom decrement button factory is passed\n\t\t * to the stepper:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * stepper.decrementButtonFactory = function():Button\n\t\t * {\n\t\t *     var button:Button = new Button();\n\t\t *     button.defaultSkin = new Image( upTexture );\n\t\t *     button.downSkin = new Image( downTexture );\n\t\t *     return button;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.Button\n\t\t */\n\t\tpublic function get decrementButtonFactory():Function\n\t\t{\n\t\t\treturn this._decrementButtonFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set decrementButtonFactory(value:Function):void\n\t\t{\n\t\t\tif(this._decrementButtonFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._decrementButtonFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DECREMENT_BUTTON_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customDecrementButtonStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customDecrementButtonStyleName():String\n\t\t{\n\t\t\treturn this._customDecrementButtonStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customDecrementButtonStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customDecrementButtonStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customDecrementButtonStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DECREMENT_BUTTON_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _decrementButtonProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the numeric stepper's decrement\n\t\t * button sub-component, and the properties will be passed down to the\n\t\t * decrement button when the numeric stepper validates. For a list of\n\t\t * available properties, refer to <a href=\"Button.html\"><code>feathers.controls.Button</code></a>.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>decrementButtonFactory</code>\n\t\t * function instead of using <code>decrementButtonProperties</code> will\n\t\t * result in better performance.</p>\n\t\t *\n\t\t * <p>In the following example, the stepper's decrement button properties\n\t\t * are updated:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * stepper.decrementButtonProperties.defaultSkin = new Image( upTexture );\n\t\t * stepper.decrementButtonProperties.downSkin = new Image( downTexture );</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #decrementButtonFactory\n\t\t * @see feathers.controls.Button\n\t\t */\n\t\tpublic function get decrementButtonProperties():Object\n\t\t{\n\t\t\tif(!this._decrementButtonProperties)\n\t\t\t{\n\t\t\t\tthis._decrementButtonProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._decrementButtonProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set decrementButtonProperties(value:Object):void\n\t\t{\n\t\t\tif(this._decrementButtonProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._decrementButtonProperties)\n\t\t\t{\n\t\t\t\tthis._decrementButtonProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._decrementButtonProperties = PropertyProxy(value);\n\t\t\tif(this._decrementButtonProperties)\n\t\t\t{\n\t\t\t\tthis._decrementButtonProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _decrementButtonLabel:String = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get decrementButtonLabel():String\n\t\t{\n\t\t\treturn this._decrementButtonLabel;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set decrementButtonLabel(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._decrementButtonLabel === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._decrementButtonLabel = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _incrementButtonFactory:Function;\n\n\t\t/**\n\t\t * A function used to generate the numeric stepper's increment button\n\t\t * sub-component. The increment button must be an instance of\n\t\t * <code>Button</code>. This factory can be used to change properties on\n\t\t * the increment button when it is first created. For instance, if you\n\t\t * are skinning Feathers components without a theme, you might use this\n\t\t * factory to set skins and other styles on the increment button.\n\t\t *\n\t\t * <p>The function should have the following signature:</p>\n\t\t * <pre>function():Button</pre>\n\t\t *\n\t\t * <p>In the following example, a custom increment button factory is passed\n\t\t * to the stepper:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * stepper.incrementButtonFactory = function():Button\n\t\t * {\n\t\t *     var button:Button = new Button();\n\t\t *     button.defaultSkin = new Image( upTexture );\n\t\t *     button.downSkin = new Image( downTexture );\n\t\t *     return button;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.Button\n\t\t */\n\t\tpublic function get incrementButtonFactory():Function\n\t\t{\n\t\t\treturn this._incrementButtonFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set incrementButtonFactory(value:Function):void\n\t\t{\n\t\t\tif(this._incrementButtonFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._incrementButtonFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_INCREMENT_BUTTON_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customIncrementButtonStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customIncrementButtonStyleName():String\n\t\t{\n\t\t\treturn this._customIncrementButtonStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customIncrementButtonStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customIncrementButtonStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customIncrementButtonStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_INCREMENT_BUTTON_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _incrementButtonProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the numeric stepper's increment\n\t\t * button sub-component, and the properties will be passed down to the\n\t\t * increment button when the numeric stepper validates. For a list of\n\t\t * available properties, refer to <a href=\"Button.html\"><code>feathers.controls.Button</code></a>.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>incrementButtonFactory</code>\n\t\t * function instead of using <code>incrementButtonProperties</code> will\n\t\t * result in better performance.</p>\n\t\t *\n\t\t * <p>In the following example, the stepper's increment button properties\n\t\t * are updated:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * stepper.incrementButtonProperties.defaultSkin = new Image( upTexture );\n\t\t * stepper.incrementButtonProperties.downSkin = new Image( downTexture );</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #incrementButtonFactory\n\t\t * @see feathers.controls.Button\n\t\t */\n\t\tpublic function get incrementButtonProperties():Object\n\t\t{\n\t\t\tif(!this._incrementButtonProperties)\n\t\t\t{\n\t\t\t\tthis._incrementButtonProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._incrementButtonProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set incrementButtonProperties(value:Object):void\n\t\t{\n\t\t\tif(this._incrementButtonProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._incrementButtonProperties)\n\t\t\t{\n\t\t\t\tthis._incrementButtonProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._incrementButtonProperties = PropertyProxy(value);\n\t\t\tif(this._incrementButtonProperties)\n\t\t\t{\n\t\t\t\tthis._incrementButtonProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _incrementButtonLabel:String = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get incrementButtonLabel():String\n\t\t{\n\t\t\treturn this._incrementButtonLabel;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set incrementButtonLabel(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._incrementButtonLabel === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._incrementButtonLabel = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textInputFactory:Function;\n\n\t\t/**\n\t\t * A function used to generate the numeric stepper's text input\n\t\t * sub-component. The text input must be an instance of <code>TextInput</code>.\n\t\t * This factory can be used to change properties on the text input when\n\t\t * it is first created. For instance, if you are skinning Feathers\n\t\t * components without a theme, you might use this factory to set skins\n\t\t * and other styles on the text input.\n\t\t *\n\t\t * <p>The function should have the following signature:</p>\n\t\t * <pre>function():TextInput</pre>\n\t\t *\n\t\t * <p>In the following example, a custom text input factory is passed\n\t\t * to the stepper:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * stepper.textInputFactory = function():TextInput\n\t\t * {\n\t\t *     var textInput:TextInput = new TextInput();\n\t\t *     textInput.backgroundSkin = new Image( texture );\n\t\t *     return textInput;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.TextInput\n\t\t */\n\t\tpublic function get textInputFactory():Function\n\t\t{\n\t\t\treturn this._textInputFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set textInputFactory(value:Function):void\n\t\t{\n\t\t\tif(this._textInputFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textInputFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_INPUT_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customTextInputStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customTextInputStyleName():String\n\t\t{\n\t\t\treturn this._customTextInputStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customTextInputStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customTextInputStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customTextInputStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_INPUT_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textInputProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the numeric stepper's text\n\t\t * input sub-component, and the properties will be passed down to the\n\t\t * text input when the numeric stepper validates. For a list of\n\t\t * available properties, refer to <a href=\"TextInput.html\"><code>feathers.controls.TextInput</code></a>.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>textInputFactory</code> function\n\t\t * instead of using <code>textInputProperties</code> will result in\n\t\t * better performance.</p>\n\t\t *\n\t\t * <p>In the following example, the stepper's text input properties\n\t\t * are updated:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * stepper.textInputProperties.backgroundSkin = new Image( texture );</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #textInputFactory\n\t\t * @see feathers.controls.TextInput\n\t\t */\n\t\tpublic function get textInputProperties():Object\n\t\t{\n\t\t\tif(!this._textInputProperties)\n\t\t\t{\n\t\t\t\tthis._textInputProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._textInputProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set textInputProperties(value:Object):void\n\t\t{\n\t\t\tif(this._textInputProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._textInputProperties)\n\t\t\t{\n\t\t\t\tthis._textInputProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._textInputProperties = PropertyProxy(value);\n\t\t\tif(this._textInputProperties)\n\t\t\t{\n\t\t\t\tthis._textInputProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get baseline():Number\n\t\t{\n\t\t\tif(!this.textInput)\n\t\t\t{\n\t\t\t\treturn this.scaledActualHeight;\n\t\t\t}\n\t\t\treturn this.scaleY * (this.textInput.y + this.textInput.baseline);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get hasFocus():Boolean\n\t\t{\n\t\t\treturn this._hasFocus;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function setFocus():void\n\t\t{\n\t\t\tif(this.textInput === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.textInput.setFocus();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar decrementButtonFactoryInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DECREMENT_BUTTON_FACTORY);\n\t\t\tvar incrementButtonFactoryInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_INCREMENT_BUTTON_FACTORY);\n\t\t\tvar textInputFactoryInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_TEXT_INPUT_FACTORY);\n\t\t\tvar focusInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_FOCUS);\n\n\t\t\tif(decrementButtonFactoryInvalid)\n\t\t\t{\n\t\t\t\tthis.createDecrementButton();\n\t\t\t}\n\n\t\t\tif(incrementButtonFactoryInvalid)\n\t\t\t{\n\t\t\t\tthis.createIncrementButton();\n\t\t\t}\n\n\t\t\tif(textInputFactoryInvalid)\n\t\t\t{\n\t\t\t\tthis.createTextInput();\n\t\t\t}\n\n\t\t\tif(decrementButtonFactoryInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshDecrementButtonStyles();\n\t\t\t}\n\n\t\t\tif(incrementButtonFactoryInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshIncrementButtonStyles();\n\t\t\t}\n\n\t\t\tif(textInputFactoryInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshTextInputStyles();\n\t\t\t}\n\n\t\t\tif(textInputFactoryInvalid || dataInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshTypicalText();\n\t\t\t\tthis.refreshDisplayedText();\n\t\t\t}\n\n\t\t\tif(decrementButtonFactoryInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.decrementButton.isEnabled = this._isEnabled;\n\t\t\t}\n\n\t\t\tif(incrementButtonFactoryInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.incrementButton.isEnabled = this._isEnabled;\n\t\t\t}\n\n\t\t\tif(textInputFactoryInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.textInput.isEnabled = this._isEnabled;\n\t\t\t}\n\n\t\t\tsizeInvalid = this.autoSizeIfNeeded() || sizeInvalid;\n\n\t\t\tthis.layoutChildren();\n\n\t\t\tif(sizeInvalid || focusInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshFocusIndicator();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * If the component's dimensions have not been set explicitly, it will\n\t\t * measure its content and determine an ideal size for itself. If the\n\t\t * <code>explicitWidth</code> or <code>explicitHeight</code> member\n\t\t * variables are set, those value will be used without additional\n\t\t * measurement. If one is set, but not the other, the dimension with the\n\t\t * explicit value will not be measured, but the other non-explicit\n\t\t * dimension will still need measurement.\n\t\t *\n\t\t * <p>Calls <code>saveMeasurements()</code> to set up the\n\t\t * <code>actualWidth</code> and <code>actualHeight</code> member\n\t\t * variables used for layout.</p>\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t */\n\t\tprotected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\n\t\t\tthis.decrementButton.validate();\n\t\t\tthis.incrementButton.validate();\n\t\t\tvar decrementButtonWidth:Number = this.decrementButton.width;\n\t\t\tvar decrementButtonHeight:Number = this.decrementButton.height;\n\t\t\tvar decrementButtonMinWidth:Number = this.decrementButton.minWidth;\n\t\t\tvar decrementButtonMinHeight:Number = this.decrementButton.minHeight;\n\t\t\tvar incrementButtonWidth:Number = this.incrementButton.width;\n\t\t\tvar incrementButtonHeight:Number = this.incrementButton.height;\n\t\t\tvar incrementButtonMinWidth:Number = this.incrementButton.minWidth;\n\t\t\tvar incrementButtonMinHeight:Number = this.incrementButton.minHeight;\n\n\t\t\t//we'll default to the values set in the textInputFactory\n\t\t\tvar textInputWidth:Number = this.textInputExplicitWidth;\n\t\t\tvar textInputHeight:Number = this.textInputExplicitHeight;\n\t\t\tvar textInputMinWidth:Number = this.textInputExplicitMinWidth;\n\t\t\tvar textInputMinHeight:Number = this.textInputExplicitMinHeight;\n\t\t\tvar textInputMaxWidth:Number = Number.POSITIVE_INFINITY;\n\t\t\tvar textInputMaxHeight:Number = Number.POSITIVE_INFINITY;\n\n\t\t\tif(this._buttonLayoutMode === StepperButtonLayoutMode.RIGHT_SIDE_VERTICAL)\n\t\t\t{\n\t\t\t\tvar maxButtonWidth:Number = decrementButtonWidth;\n\t\t\t\tif(incrementButtonWidth > maxButtonWidth)\n\t\t\t\t{\n\t\t\t\t\tmaxButtonWidth = incrementButtonWidth;\n\t\t\t\t}\n\t\t\t\tvar maxButtonMinWidth:Number = decrementButtonMinWidth;\n\t\t\t\tif(incrementButtonMinWidth > maxButtonMinWidth)\n\t\t\t\t{\n\t\t\t\t\tmaxButtonMinWidth = incrementButtonMinWidth;\n\t\t\t\t}\n\n\t\t\t\tif(!needsWidth)\n\t\t\t\t{\n\t\t\t\t\ttextInputWidth = this._explicitWidth - maxButtonWidth - this._textInputGap;\n\t\t\t\t}\n\t\t\t\tif(!needsHeight)\n\t\t\t\t{\n\t\t\t\t\ttextInputHeight = this._explicitHeight;\n\t\t\t\t}\n\t\t\t\tif(!needsMinWidth)\n\t\t\t\t{\n\t\t\t\t\ttextInputMinWidth = this._explicitMinWidth - maxButtonMinWidth - this._textInputGap;\n\t\t\t\t\tif(this.textInputExplicitMinWidth > textInputMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\ttextInputMinWidth = this.textInputExplicitMinWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!needsMinHeight)\n\t\t\t\t{\n\t\t\t\t\ttextInputMinHeight = this._explicitMinHeight;\n\t\t\t\t\tif(this.textInputExplicitMinHeight > textInputMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\ttextInputMinHeight = this.textInputExplicitMinHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttextInputMaxWidth = this._explicitMaxWidth - maxButtonWidth - this._textInputGap;\n\t\t\t}\n\t\t\telse if(this._buttonLayoutMode === StepperButtonLayoutMode.SPLIT_VERTICAL)\n\t\t\t{\n\t\t\t\tif(!needsWidth)\n\t\t\t\t{\n\t\t\t\t\ttextInputWidth = this._explicitWidth;\n\t\t\t\t}\n\t\t\t\tif(!needsHeight)\n\t\t\t\t{\n\t\t\t\t\ttextInputHeight = this._explicitHeight - decrementButtonHeight - incrementButtonHeight;\n\t\t\t\t}\n\t\t\t\tif(!needsMinWidth)\n\t\t\t\t{\n\t\t\t\t\ttextInputMinWidth = this._explicitMinWidth;\n\t\t\t\t\tif(this.textInputExplicitMinWidth > textInputMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\ttextInputMinWidth = this.textInputExplicitMinWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!needsMinHeight)\n\t\t\t\t{\n\t\t\t\t\ttextInputMinHeight = this._explicitMinHeight - decrementButtonMinHeight - incrementButtonMinHeight;\n\t\t\t\t\tif(this.textInputExplicitMinHeight > textInputMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\ttextInputMinHeight = this.textInputExplicitMinHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttextInputMaxHeight = this._explicitMaxHeight - decrementButtonHeight - incrementButtonHeight;\n\t\t\t}\n\t\t\telse //split horizontal\n\t\t\t{\n\t\t\t\tif(!needsWidth)\n\t\t\t\t{\n\t\t\t\t\ttextInputWidth = this._explicitWidth - decrementButtonWidth - incrementButtonWidth;\n\t\t\t\t}\n\t\t\t\tif(!needsHeight)\n\t\t\t\t{\n\t\t\t\t\ttextInputHeight = this._explicitHeight;\n\t\t\t\t}\n\t\t\t\tif(!needsMinWidth)\n\t\t\t\t{\n\t\t\t\t\ttextInputMinWidth = this._explicitMinWidth - decrementButtonMinWidth - incrementButtonMinWidth;\n\t\t\t\t\tif(textInputMinWidth < this.textInputExplicitMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\ttextInputMinWidth = this.textInputExplicitMinWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!needsMinHeight)\n\t\t\t\t{\n\t\t\t\t\ttextInputMinHeight = this._explicitMinHeight;\n\t\t\t\t\tif(this.textInputExplicitMinHeight > textInputMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\ttextInputMinHeight = this.textInputExplicitMinHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttextInputMaxWidth = this._explicitMaxWidth - decrementButtonWidth - incrementButtonWidth;\n\t\t\t}\n\n\t\t\tif(textInputWidth < 0)\n\t\t\t{\n\t\t\t\ttextInputWidth = 0;\n\t\t\t}\n\t\t\tif(textInputHeight < 0)\n\t\t\t{\n\t\t\t\ttextInputHeight = 0;\n\t\t\t}\n\t\t\tif(textInputMinWidth < 0)\n\t\t\t{\n\t\t\t\ttextInputMinWidth = 0;\n\t\t\t}\n\t\t\tif(textInputMinHeight < 0)\n\t\t\t{\n\t\t\t\ttextInputMinHeight = 0;\n\t\t\t}\n\t\t\tthis.textInput.width = textInputWidth;\n\t\t\tthis.textInput.height = textInputHeight;\n\t\t\tthis.textInput.minWidth = textInputMinWidth;\n\t\t\tthis.textInput.minHeight = textInputMinHeight;\n\t\t\tthis.textInput.maxWidth = textInputMaxWidth;\n\t\t\tthis.textInput.maxHeight = textInputMaxHeight;\n\t\t\tthis.textInput.validate();\n\n\t\t\tif(this._buttonLayoutMode === StepperButtonLayoutMode.RIGHT_SIDE_VERTICAL)\n\t\t\t{\n\t\t\t\tif(needsWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this.textInput.width + maxButtonWidth + this._textInputGap;\n\t\t\t\t}\n\t\t\t\tif(needsHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = decrementButtonHeight + this._buttonGap + incrementButtonHeight;\n\t\t\t\t\tif(this.textInput.height > newHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewHeight = this.textInput.height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(needsMinWidth)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = this.textInput.minWidth + maxButtonMinWidth + this._textInputGap;\n\t\t\t\t}\n\t\t\t\tif(needsMinHeight)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = decrementButtonMinHeight + this._buttonGap + incrementButtonMinHeight;\n\t\t\t\t\tif(this.textInput.minHeight > newMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = this.textInput.minHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(this._buttonLayoutMode === StepperButtonLayoutMode.SPLIT_VERTICAL)\n\t\t\t{\n\t\t\t\tif(needsWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this.textInput.width;\n\t\t\t\t\tif(decrementButtonWidth > newWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewWidth = decrementButtonWidth;\n\t\t\t\t\t}\n\t\t\t\t\tif(incrementButtonWidth > newWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewWidth = incrementButtonWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(needsHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = decrementButtonHeight + this.textInput.height + incrementButtonHeight + 2 * this._textInputGap;\n\t\t\t\t}\n\t\t\t\tif(needsMinWidth)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = this.textInput.minWidth;\n\t\t\t\t\tif(decrementButtonMinWidth > newMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = decrementButtonMinWidth;\n\t\t\t\t\t}\n\t\t\t\t\tif(incrementButtonMinWidth > newMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = incrementButtonMinWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(needsMinHeight)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = decrementButtonMinHeight + this.textInput.minHeight + incrementButtonMinHeight + 2 * this._textInputGap;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //split horizontal\n\t\t\t{\n\t\t\t\tif(needsWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = decrementButtonWidth + this.textInput.width + incrementButtonWidth + 2 * this._textInputGap;\n\t\t\t\t}\n\t\t\t\tif(needsHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this.textInput.height;\n\t\t\t\t\tif(decrementButtonHeight > newHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewHeight = decrementButtonHeight;\n\t\t\t\t\t}\n\t\t\t\t\tif(incrementButtonHeight > newHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewHeight = incrementButtonHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(needsMinWidth)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = decrementButtonMinWidth + this.textInput.minWidth + incrementButtonMinWidth + 2 * this._textInputGap;\n\t\t\t\t}\n\t\t\t\tif(needsMinHeight)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = this.textInput.minHeight;\n\t\t\t\t\tif(decrementButtonMinHeight > newMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = decrementButtonMinHeight;\n\t\t\t\t\t}\n\t\t\t\t\tif(incrementButtonMinHeight > newMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = incrementButtonMinHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function decrement():void\n\t\t{\n\t\t\tthis.value = this._value - this._step;\n\t\t\tthis.validate();\n\t\t\tthis.textInput.selectRange(0, this.textInput.text.length);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function increment():void\n\t\t{\n\t\t\tthis.value = this._value + this._step;\n\t\t\tthis.validate();\n\t\t\tthis.textInput.selectRange(0, this.textInput.text.length);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function toMinimum():void\n\t\t{\n\t\t\tthis.value = this._minimum;\n\t\t\tthis.validate();\n\t\t\tthis.textInput.selectRange(0, this.textInput.text.length);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function toMaximum():void\n\t\t{\n\t\t\tthis.value = this._maximum;\n\t\t\tthis.validate();\n\t\t\tthis.textInput.selectRange(0, this.textInput.text.length);\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>decrementButton</code> sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #decrementButton\n\t\t * @see #decrementButtonFactory\n\t\t * @see #style:customDecrementButtonStyleName\n\t\t */\n\t\tprotected function createDecrementButton():void\n\t\t{\n\t\t\tif(this.decrementButton)\n\t\t\t{\n\t\t\t\tthis.decrementButton.removeFromParent(true);\n\t\t\t\tthis.decrementButton = null;\n\t\t\t}\n\n\t\t\tvar factory:Function = this._decrementButtonFactory != null ? this._decrementButtonFactory : defaultDecrementButtonFactory;\n\t\t\tvar decrementButtonStyleName:String = this._customDecrementButtonStyleName != null ? this._customDecrementButtonStyleName : this.decrementButtonStyleName;\n\t\t\tthis.decrementButton = Button(factory());\n\t\t\tthis.decrementButton.styleNameList.add(decrementButtonStyleName);\n\t\t\tthis.decrementButton.addEventListener(TouchEvent.TOUCH, decrementButton_touchHandler);\n\t\t\tthis.addChild(this.decrementButton);\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>incrementButton</code> sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #incrementButton\n\t\t * @see #incrementButtonFactory\n\t\t * @see #style:customIncrementButtonStyleName\n\t\t */\n\t\tprotected function createIncrementButton():void\n\t\t{\n\t\t\tif(this.incrementButton)\n\t\t\t{\n\t\t\t\tthis.incrementButton.removeFromParent(true);\n\t\t\t\tthis.incrementButton = null;\n\t\t\t}\n\n\t\t\tvar factory:Function = this._incrementButtonFactory != null ? this._incrementButtonFactory : defaultIncrementButtonFactory;\n\t\t\tvar incrementButtonStyleName:String = this._customIncrementButtonStyleName != null ? this._customIncrementButtonStyleName : this.incrementButtonStyleName;\n\t\t\tthis.incrementButton = Button(factory());\n\t\t\tthis.incrementButton.styleNameList.add(incrementButtonStyleName);\n\t\t\tthis.incrementButton.addEventListener(TouchEvent.TOUCH, incrementButton_touchHandler);\n\t\t\tthis.addChild(this.incrementButton);\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>textInput</code> sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #textInput\n\t\t * @see #textInputFactory\n\t\t * @see #style:customTextInputStyleName\n\t\t */\n\t\tprotected function createTextInput():void\n\t\t{\n\t\t\tif(this.textInput)\n\t\t\t{\n\t\t\t\tthis.textInput.removeFromParent(true);\n\t\t\t\tthis.textInput = null;\n\t\t\t}\n\n\t\t\tvar factory:Function = this._textInputFactory != null ? this._textInputFactory : defaultTextInputFactory;\n\t\t\tvar textInputStyleName:String = this._customTextInputStyleName != null ? this._customTextInputStyleName : this.textInputStyleName;\n\t\t\tthis.textInput = TextInput(factory());\n\t\t\tthis.textInput.styleNameList.add(textInputStyleName);\n\t\t\tthis.textInput.addEventListener(FeathersEventType.ENTER, textInput_enterHandler);\n\t\t\tthis.textInput.addEventListener(FeathersEventType.FOCUS_IN, textInput_focusInHandler);\n\t\t\tthis.textInput.addEventListener(FeathersEventType.FOCUS_OUT, textInput_focusOutHandler);\n\t\t\t//while we're setting isFocusEnabled to false on the text input when\n\t\t\t//we have a focus manager, we'll still be able to call setFocus() on\n\t\t\t//the text input manually.\n\t\t\tthis.textInput.isFocusEnabled = !this._focusManager;\n\t\t\tthis.addChild(this.textInput);\n\n\t\t\t//we will use these values for measurement, if possible\n\t\t\tthis.textInput.initializeNow();\n\t\t\tthis.textInputExplicitWidth = this.textInput.explicitWidth;\n\t\t\tthis.textInputExplicitHeight = this.textInput.explicitHeight;\n\t\t\tthis.textInputExplicitMinWidth = this.textInput.explicitMinWidth;\n\t\t\tthis.textInputExplicitMinHeight = this.textInput.explicitMinHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshDecrementButtonStyles():void\n\t\t{\n\t\t\tfor(var propertyName:String in this._decrementButtonProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._decrementButtonProperties[propertyName];\n\t\t\t\tthis.decrementButton[propertyName] = propertyValue;\n\t\t\t}\n\t\t\tthis.decrementButton.label = this._decrementButtonLabel;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshIncrementButtonStyles():void\n\t\t{\n\t\t\tfor(var propertyName:String in this._incrementButtonProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._incrementButtonProperties[propertyName];\n\t\t\t\tthis.incrementButton[propertyName] = propertyValue;\n\t\t\t}\n\t\t\tthis.incrementButton.label = this._incrementButtonLabel;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshTextInputStyles():void\n\t\t{\n\t\t\tfor(var propertyName:String in this._textInputProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._textInputProperties[propertyName];\n\t\t\t\tthis.textInput[propertyName] = propertyValue;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshDisplayedText():void\n\t\t{\n\t\t\tif(this._valueFormatFunction != null)\n\t\t\t{\n\t\t\t\tthis.textInput.text = this._valueFormatFunction(this._value);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.textInput.text = this._value.toString();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshTypicalText():void\n\t\t{\n\t\t\tvar typicalText:String = \"\";\n\t\t\tvar maxCharactersBeforeDecimal:Number = Math.max(int(this._minimum).toString().length, int(this._maximum).toString().length, int(this._step).toString().length);\n\n\t\t\t//roundToPrecision() helps us to avoid numbers like 1.00000000000000001\n\t\t\t//caused by the inaccuracies of floating point math.\n\t\t\tvar maxCharactersAfterDecimal:Number = Math.max(roundToPrecision(this._minimum - int(this._minimum), 10).toString().length,\n\t\t\t\troundToPrecision(this._maximum - int(this._maximum), 10).toString().length,\n\t\t\t\troundToPrecision(this._step - int(this._step), 10).toString().length) - 2;\n\t\t\tif(maxCharactersAfterDecimal < 0)\n\t\t\t{\n\t\t\t\tmaxCharactersAfterDecimal = 0;\n\t\t\t}\n\t\t\tvar characterCount:int = maxCharactersBeforeDecimal + maxCharactersAfterDecimal;\n\t\t\tfor(var i:int = 0; i < characterCount; i++)\n\t\t\t{\n\t\t\t\ttypicalText += \"0\";\n\t\t\t}\n\t\t\tif(maxCharactersAfterDecimal > 0)\n\t\t\t{\n\t\t\t\ttypicalText += \".\";\n\t\t\t}\n\t\t\tthis.textInput.typicalText = typicalText;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutChildren():void\n\t\t{\n\t\t\tif(this._buttonLayoutMode === StepperButtonLayoutMode.RIGHT_SIDE_VERTICAL)\n\t\t\t{\n\t\t\t\tvar buttonHeight:Number = (this.actualHeight - this._buttonGap) / 2;\n\t\t\t\tthis.incrementButton.y = 0;\n\t\t\t\tthis.incrementButton.height = buttonHeight;\n\t\t\t\tthis.incrementButton.validate();\n\n\t\t\t\tthis.decrementButton.y = buttonHeight + this._buttonGap;\n\t\t\t\tthis.decrementButton.height = buttonHeight;\n\t\t\t\tthis.decrementButton.validate();\n\n\t\t\t\tvar buttonWidth:Number = Math.max(this.decrementButton.width, this.incrementButton.width);\n\t\t\t\tvar buttonX:Number = this.actualWidth - buttonWidth;\n\t\t\t\tthis.decrementButton.x = buttonX;\n\t\t\t\tthis.incrementButton.x = buttonX;\n\n\t\t\t\tthis.textInput.x = 0;\n\t\t\t\tthis.textInput.y = 0;\n\t\t\t\tthis.textInput.width = buttonX - this._textInputGap;\n\t\t\t\tthis.textInput.height = this.actualHeight;\n\t\t\t}\n\t\t\telse if(this._buttonLayoutMode === StepperButtonLayoutMode.SPLIT_VERTICAL)\n\t\t\t{\n\t\t\t\tthis.incrementButton.x = 0;\n\t\t\t\tthis.incrementButton.y = 0;\n\t\t\t\tthis.incrementButton.width = this.actualWidth;\n\t\t\t\tthis.incrementButton.validate();\n\n\t\t\t\tthis.decrementButton.x = 0;\n\t\t\t\tthis.decrementButton.width = this.actualWidth;\n\t\t\t\tthis.decrementButton.validate();\n\t\t\t\tthis.decrementButton.y = this.actualHeight - this.decrementButton.height;\n\n\t\t\t\tthis.textInput.x = 0;\n\t\t\t\tthis.textInput.y = this.incrementButton.height + this._textInputGap;\n\t\t\t\tthis.textInput.width = this.actualWidth;\n\t\t\t\tthis.textInput.height = Math.max(0, this.actualHeight - this.decrementButton.height - this.incrementButton.height - 2 * this._textInputGap);\n\t\t\t}\n\t\t\telse //split horizontal\n\t\t\t{\n\t\t\t\tthis.decrementButton.x = 0;\n\t\t\t\tthis.decrementButton.y = 0;\n\t\t\t\tthis.decrementButton.height = this.actualHeight;\n\t\t\t\tthis.decrementButton.validate();\n\n\t\t\t\tthis.incrementButton.y = 0;\n\t\t\t\tthis.incrementButton.height = this.actualHeight;\n\t\t\t\tthis.incrementButton.validate();\n\t\t\t\tthis.incrementButton.x = this.actualWidth - this.incrementButton.width;\n\n\t\t\t\tthis.textInput.x = this.decrementButton.width + this._textInputGap;\n\t\t\t\tthis.textInput.width = this.actualWidth - this.decrementButton.width - this.incrementButton.width - 2 * this._textInputGap;\n\t\t\t\tthis.textInput.height = this.actualHeight;\n\t\t\t}\n\n\t\t\t//final validation to avoid juggler next frame issues\n\t\t\tthis.textInput.validate();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function startRepeatTimer(action:Function):void\n\t\t{\n\t\t\tif(this.touchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar exclusiveTouch:ExclusiveTouch = ExclusiveTouch.forStage(this.stage);\n\t\t\t\tvar claim:DisplayObject = exclusiveTouch.getClaim(this.touchPointID);\n\t\t\t\tif(claim != this)\n\t\t\t\t{\n\t\t\t\t\tif(claim)\n\t\t\t\t\t{\n\t\t\t\t\t\t//already claimed by another display object\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\texclusiveTouch.claimTouch(this.touchPointID, this);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.currentRepeatAction = action;\n\t\t\tif(this._repeatDelay > 0)\n\t\t\t{\n\t\t\t\tif(!this._repeatTimer)\n\t\t\t\t{\n\t\t\t\t\tthis._repeatTimer = new Timer(this._repeatDelay * 1000);\n\t\t\t\t\tthis._repeatTimer.addEventListener(TimerEvent.TIMER, repeatTimer_timerHandler);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._repeatTimer.reset();\n\t\t\t\t\tthis._repeatTimer.delay = this._repeatDelay * 1000;\n\t\t\t\t}\n\t\t\t\tthis._repeatTimer.start();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function parseTextInputValue():void\n\t\t{\n\t\t\tif(this._valueParseFunction != null)\n\t\t\t{\n\t\t\t\tvar newValue:Number = this._valueParseFunction(this.textInput.text);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tnewValue = parseFloat(this.textInput.text);\n\t\t\t}\n\t\t\tif(newValue === newValue) //!isNaN\n\t\t\t{\n\t\t\t\tthis.value = newValue;\n\t\t\t}\n\t\t\t//we need to force invalidation just to be sure that the text input\n\t\t\t//is displaying the correct value.\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function childProperties_onChange(proxy:PropertyProxy, name:Object):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function numericStepper_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tthis.touchPointID = -1;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function focusInHandler(event:Event):void\n\t\t{\n\t\t\tsuper.focusInHandler(event);\n\t\t\tthis.textInput.setFocus();\n\t\t\tthis.textInput.selectRange(0, this.textInput.text.length);\n\t\t\tthis.stage.addEventListener(KeyboardEvent.KEY_DOWN, stage_keyDownHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function focusOutHandler(event:Event):void\n\t\t{\n\t\t\tsuper.focusOutHandler(event);\n\t\t\tthis.textInput.clearFocus();\n\t\t\tthis.stage.removeEventListener(KeyboardEvent.KEY_DOWN, stage_keyDownHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textInput_enterHandler(event:Event):void\n\t\t{\n\t\t\tthis.parseTextInputValue();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textInput_focusInHandler(event:Event):void\n\t\t{\n\t\t\tthis._textInputHasFocus = true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textInput_focusOutHandler(event:Event):void\n\t\t{\n\t\t\tthis._textInputHasFocus = false;\n\t\t\tthis.parseTextInputValue();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function decrementButton_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\tthis.touchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this.touchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(this.decrementButton, TouchPhase.ENDED, this.touchPointID);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.touchPointID = -1;\n\t\t\t\tthis._repeatTimer.stop();\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.END_INTERACTION);\n\t\t\t}\n\t\t\telse //if we get here, we don't have a saved touch ID yet\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(this.decrementButton, TouchPhase.BEGAN);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(this._textInputHasFocus)\n\t\t\t\t{\n\t\t\t\t\tthis.parseTextInputValue();\n\t\t\t\t}\n\t\t\t\tthis.touchPointID = touch.id;\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.BEGIN_INTERACTION);\n\t\t\t\tthis.decrement();\n\t\t\t\tthis.startRepeatTimer(this.decrement);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function incrementButton_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\tthis.touchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this.touchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(this.incrementButton, TouchPhase.ENDED, this.touchPointID);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.touchPointID = -1;\n\t\t\t\tthis._repeatTimer.stop();\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.END_INTERACTION);\n\t\t\t}\n\t\t\telse //if we get here, we don't have a saved touch ID yet\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(this.incrementButton, TouchPhase.BEGAN);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(this._textInputHasFocus)\n\t\t\t\t{\n\t\t\t\t\tthis.parseTextInputValue();\n\t\t\t\t}\n\t\t\t\tthis.touchPointID = touch.id;\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.BEGIN_INTERACTION);\n\t\t\t\tthis.increment();\n\t\t\t\tthis.startRepeatTimer(this.increment);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(event.keyCode == Keyboard.HOME)\n\t\t\t{\n\t\t\t\t//prevent default so that text input selection doesn't change\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.toMinimum();\n\t\t\t}\n\t\t\telse if(event.keyCode == Keyboard.END)\n\t\t\t{\n\t\t\t\t//prevent default so that text input selection doesn't change\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.toMaximum();\n\t\t\t}\n\t\t\telse if(this._useLeftAndRightKeys)\n\t\t\t{\n\t\t\t\tif(event.keyCode == Keyboard.RIGHT)\n\t\t\t\t{\n\t\t\t\t\t//prevent default so that text input selection doesn't change\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tthis.increment();\n\t\t\t\t}\n\t\t\t\telse if(event.keyCode == Keyboard.LEFT)\n\t\t\t\t{\n\t\t\t\t\t//prevent default so that text input selection doesn't change\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tthis.decrement();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(event.keyCode == Keyboard.UP)\n\t\t\t{\n\t\t\t\t//prevent default so that text input selection doesn't change\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.increment();\n\t\t\t}\n\t\t\telse if(event.keyCode == Keyboard.DOWN)\n\t\t\t{\n\t\t\t\t//prevent default so that text input selection doesn't change\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.decrement();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function repeatTimer_timerHandler(event:TimerEvent):void\n\t\t{\n\t\t\tif(this._repeatTimer.currentCount < 5)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.currentRepeatAction();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/PageIndicator.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IValidating;\n\timport feathers.layout.Direction;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.HorizontalLayout;\n\timport feathers.layout.ILayout;\n\timport feathers.layout.IVirtualLayout;\n\timport feathers.layout.LayoutBoundsResult;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.layout.ViewPortBounds;\n\timport feathers.skins.IStyleProvider;\n\n\timport flash.geom.Point;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.utils.Pool;\n\n\t/**\n\t * The symbols may be positioned vertically or horizontally.\n\t *\n\t * <p>In the following example, the direction is changed to vertical:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * pages.direction = Direction.VERTICAL;</listing>\n\t *\n\t * <p><strong>Note:</strong> The <code>Direction.NONE</code>\n\t * constant is not supported.</p>\n\t *\n\t * @default feathers.layout.Direction.HORIZONTAL\n\t *\n\t * @see feathers.layout.Direction#HORIZONTAL\n\t * @see feathers.layout.Direction#VERTICAL\n\t */\n\t[Style(name=\"direction\",type=\"String\")]\n\n\t/**\n\t * The spacing, in pixels, between symbols.\n\t *\n\t * <p>In the following example, the gap between symbols is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * pages.gap = 20;</listing>\n\t *\n\t * @default 0\n\t */\n\t[Style(name=\"gap\",type=\"Number\")]\n\n\t/**\n\t * The alignment of the symbols on the horizontal axis.\n\t *\n\t * <p>In the following example, the symbols are horizontally aligned to\n\t * the right:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * pages.horizontalAlign = HorizontalAlign.RIGHT;</listing>\n\t *\n\t * <p><strong>Note:</strong> The <code>HorizontalAlign.JUSTIFY</code>\n\t * constant is not supported.</p>\n\t *\n\t * @default feathers.layout.HorizontalAlign.CENTER\n\t *\n\t * @see feathers.layout.HorizontalAlign#LEFT\n\t * @see feathers.layout.HorizontalAlign#CENTER\n\t * @see feathers.layout.HorizontalAlign#RIGHT\n\t */\n\t[Style(name=\"horizontalAlign\",type=\"String\")]\n\n\t/**\n\t * Determines how the selected index changes on touch.\n\t *\n\t * <p>In the following example, the interaction mode is changed to precise:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * pages.interactionMode = PageIndicatorInteractionMode.PRECISE;</listing>\n\t *\n\t * @default feathers.controls.PageIndicatorInteractionMode.PREVIOUS_NEXT\n\t *\n\t * @see feathers.controls.PageIndicatorInteractionMode#PREVIOUS_NEXT\n\t * @see feathers.controls.PageIndicatorInteractionMode#PRECISE\n\t */\n\t[Style(name=\"interactionMode\",type=\"String\")]\n\n\t/**\n\t * A function used to create a normal symbol. May be any Starling\n\t * display object.\n\t *\n\t * <p>This function should have the following signature:</p>\n\t * <pre>function():DisplayObject</pre>\n\t *\n\t * <p>In the following example, a custom normal symbol factory is provided\n\t * to the page indicator:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * pages.normalSymbolFactory = function():DisplayObject\n\t * {\n\t *     return new Image( texture );\n\t * };</listing>\n\t *\n\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html starling.display.DisplayObject\n\t * @see #style:selectedSymbolFactory\n\t */\n\t[Style(name=\"normalSymbolFactory\",type=\"Function\")]\n\n\t/**\n\t * Quickly sets all padding properties to the same value. The\n\t * <code>padding</code> getter always returns the value of\n\t * <code>paddingTop</code>, but the other padding values may be\n\t * different.\n\t *\n\t * <p>In the following example, the padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * pages.padding = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:paddingTop\n\t * @see #style:paddingRight\n\t * @see #style:paddingBottom\n\t * @see #style:paddingLeft\n\t */\n\t[Style(name=\"padding\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the top edge of the component\n\t * and the top edge of the content.\n\t *\n\t * <p>In the following example, the top padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * pages.paddingTop = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingTop\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the right edge of the component\n\t * and the right edge of the content.\n\t *\n\t * <p>In the following example, the right padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * pages.paddingRight = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingRight\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the bottom edge of the component\n\t * and the bottom edge of the content.\n\t *\n\t * <p>In the following example, the bottom padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * pages.paddingBottom = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingBottom\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the left edge of the component\n\t * and the left edge of the content.\n\t *\n\t * <p>In the following example, the left padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * pages.paddingLeft = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingLeft\",type=\"Number\")]\n\n\t/**\n\t * A function used to create a selected symbol. May be any Starling\n\t * display object.\n\t *\n\t * <p>This function should have the following signature:</p>\n\t * <pre>function():DisplayObject</pre>\n\t *\n\t * <p>In the following example, a custom selected symbol factory is provided\n\t * to the page indicator:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * pages.selectedSymbolFactory = function():DisplayObject\n\t * {\n\t *     return new Image( texture );\n\t * };</listing>\n\t *\n\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html starling.display.DisplayObject\n\t * @see #style:normalSymbolFactory\n\t */\n\t[Style(name=\"selectedSymbolFactory\",type=\"Function\")]\n\n\t/**\n\t * The alignment of the symbols on the vertical axis.\n\t *\n\t * <p>In the following example, the symbols are vertically aligned to\n\t * the bottom:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * pages.verticalAlign = VerticalAlign.BOTTOM;</listing>\n\t *\n\t * <p><strong>Note:</strong> The <code>VerticalAlign.JUSTIFY</code>\n\t * constant is not supported.</p>\n\t *\n\t * @default feathers.layout.VerticalAlign.MIDDLE\n\t *\n\t * @see feathers.layout.VerticalAlign#TOP\n\t * @see feathers.layout.VerticalAlign#MIDDLE\n\t * @see feathers.layout.VerticalAlign#BOTTOM\n\t */\n\t[Style(name=\"verticalAlign\",type=\"String\")]\n\n\t/**\n\t * Dispatched when the selected item changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #selectedIndex\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Displays a selected index, usually corresponding to a page index in\n\t * another UI control, using a highlighted symbol.\n\t *\n\t * @see ../../../help/page-indicator.html How to use the Feathers PageIndicator component\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class PageIndicator extends FeathersControl\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const LAYOUT_RESULT:LayoutBoundsResult = new LayoutBoundsResult();\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const SUGGESTED_BOUNDS:ViewPortBounds = new ViewPortBounds();\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>PageIndicator</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultSelectedSymbolFactory():Quad\n\t\t{\n\t\t\treturn new Quad(25, 25, 0xffffff);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultNormalSymbolFactory():Quad\n\t\t{\n\t\t\treturn new Quad(25, 25, 0xcccccc);\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function PageIndicator()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.isQuickHitAreaEnabled = true;\n\t\t\tthis.addEventListener(TouchEvent.TOUCH, touchHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var selectedSymbol:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var cache:Vector.<DisplayObject> = new <DisplayObject>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var unselectedSymbols:Vector.<DisplayObject> = new <DisplayObject>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var symbols:Vector.<DisplayObject> = new <DisplayObject>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var touchPointID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn PageIndicator.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _pageCount:int = 1;\n\n\t\t/**\n\t\t * The number of available pages.\n\t\t *\n\t\t * <p>In the following example, the page count is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * pages.pageCount = 5;</listing>\n\t\t *\n\t\t * @default 1\n\t\t */\n\t\tpublic function get pageCount():int\n\t\t{\n\t\t\treturn this._pageCount;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set pageCount(value:int):void\n\t\t{\n\t\t\tif(this._pageCount == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._pageCount = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectedIndex:int = 0;\n\n\t\t/**\n\t\t * The currently selected index.\n\t\t *\n\t\t * <p>In the following example, the page indicator's selected index is\n\t\t * changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * pages.selectedIndex = 2;</listing>\n\t\t *\n\t\t * <p>The following example listens for when selection changes and\n\t\t * requests the selected index:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * function pages_changeHandler( event:Event ):void\n\t\t * {\n\t\t *     var pages:PageIndicator = PageIndicator( event.currentTarget );\n\t\t *     var index:int = pages.selectedIndex;\n\t\t * \n\t\t * }\n\t\t * pages.addEventListener( Event.CHANGE, pages_changeHandler );</listing>\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get selectedIndex():int\n\t\t{\n\t\t\treturn this._selectedIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedIndex(value:int):void\n\t\t{\n\t\t\tvalue = Math.max(0, Math.min(value, this._pageCount - 1));\n\t\t\tif(this._selectedIndex == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._selectedIndex = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _interactionMode:String = PageIndicatorInteractionMode.PREVIOUS_NEXT;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"previousNext,precise\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get interactionMode():String\n\t\t{\n\t\t\treturn this._interactionMode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set interactionMode(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._interactionMode = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _layout:ILayout;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _direction:String = Direction.HORIZONTAL;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"horizontal,vertical\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get direction():String\n\t\t{\n\t\t\treturn this._direction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set direction(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._direction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._direction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalAlign:String = HorizontalAlign.CENTER;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"left,center,right\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get horizontalAlign():String\n\t\t{\n\t\t\treturn this._horizontalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalAlign(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._horizontalAlign === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalAlign = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalAlign:String = VerticalAlign.MIDDLE;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"top,middle,bottom\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get verticalAlign():String\n\t\t{\n\t\t\treturn this._verticalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalAlign(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._verticalAlign === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalAlign = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _gap:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get gap():Number\n\t\t{\n\t\t\treturn this._gap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set gap(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._gap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._gap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get padding():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set padding(value:Number):void\n\t\t{\n\t\t\tthis.paddingTop = value;\n\t\t\tthis.paddingRight = value;\n\t\t\tthis.paddingBottom = value;\n\t\t\tthis.paddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingTop:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingTop():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingTop(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingTop = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingRight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingRight():Number\n\t\t{\n\t\t\treturn this._paddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingRight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingBottom:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingBottom():Number\n\t\t{\n\t\t\treturn this._paddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingBottom = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingLeft:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingLeft = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _normalSymbolFactory:Function = defaultNormalSymbolFactory;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get normalSymbolFactory():Function\n\t\t{\n\t\t\treturn this._normalSymbolFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set normalSymbolFactory(value:Function):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._normalSymbolFactory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._normalSymbolFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectedSymbolFactory:Function = defaultSelectedSymbolFactory;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get selectedSymbolFactory():Function\n\t\t{\n\t\t\treturn this._selectedSymbolFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedSymbolFactory(value:Function):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._selectedSymbolFactory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._selectedSymbolFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar selectionInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SELECTED);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar layoutInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_LAYOUT);\n\n\t\t\tif(dataInvalid || selectionInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshSymbols(stylesInvalid);\n\t\t\t}\n\n\t\t\tthis.layoutSymbols(layoutInvalid);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshSymbols(symbolsInvalid:Boolean):void\n\t\t{\n\t\t\tthis.symbols.length = 0;\n\t\t\tvar temp:Vector.<DisplayObject> = this.cache;\n\t\t\tif(symbolsInvalid)\n\t\t\t{\n\t\t\t\tvar symbolCount:int = this.unselectedSymbols.length;\n\t\t\t\tfor(var i:int = 0; i < symbolCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar symbol:DisplayObject = this.unselectedSymbols.shift();\n\t\t\t\t\tthis.removeChild(symbol, true);\n\t\t\t\t}\n\t\t\t\tif(this.selectedSymbol)\n\t\t\t\t{\n\t\t\t\t\tthis.removeChild(this.selectedSymbol, true);\n\t\t\t\t\tthis.selectedSymbol = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.cache = this.unselectedSymbols;\n\t\t\tthis.unselectedSymbols = temp;\n\t\t\tfor(i = 0; i < this._pageCount; i++)\n\t\t\t{\n\t\t\t\tif(i == this._selectedIndex)\n\t\t\t\t{\n\t\t\t\t\tif(!this.selectedSymbol)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.selectedSymbol = this._selectedSymbolFactory();\n\t\t\t\t\t\tthis.addChild(this.selectedSymbol);\n\t\t\t\t\t}\n\t\t\t\t\tthis.symbols.push(this.selectedSymbol);\n\t\t\t\t\tif(this.selectedSymbol is IValidating)\n\t\t\t\t\t{\n\t\t\t\t\t\tIValidating(this.selectedSymbol).validate();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(this.cache.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tsymbol = this.cache.shift();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tsymbol = this._normalSymbolFactory();\n\t\t\t\t\t\tthis.addChild(symbol);\n\t\t\t\t\t}\n\t\t\t\t\tthis.unselectedSymbols.push(symbol);\n\t\t\t\t\tthis.symbols.push(symbol);\n\t\t\t\t\tif(symbol is IValidating)\n\t\t\t\t\t{\n\t\t\t\t\t\tIValidating(symbol).validate();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tsymbolCount = this.cache.length;\n\t\t\tfor(i = 0; i < symbolCount; i++)\n\t\t\t{\n\t\t\t\tsymbol = this.cache.shift();\n\t\t\t\tthis.removeChild(symbol, true);\n\t\t\t}\n\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutSymbols(layoutInvalid:Boolean):void\n\t\t{\n\t\t\tif(layoutInvalid)\n\t\t\t{\n\t\t\t\tif(this._direction == Direction.VERTICAL && !(this._layout is VerticalLayout))\n\t\t\t\t{\n\t\t\t\t\tthis._layout = new VerticalLayout();\n\t\t\t\t\tIVirtualLayout(this._layout).useVirtualLayout = false;\n\t\t\t\t}\n\t\t\t\telse if(this._direction != Direction.VERTICAL && !(this._layout is HorizontalLayout))\n\t\t\t\t{\n\t\t\t\t\tthis._layout = new HorizontalLayout();\n\t\t\t\t\tIVirtualLayout(this._layout).useVirtualLayout = false;\n\t\t\t\t}\n\t\t\t\tif(this._layout is VerticalLayout)\n\t\t\t\t{\n\t\t\t\t\tvar verticalLayout:VerticalLayout = VerticalLayout(this._layout);\n\t\t\t\t\tverticalLayout.paddingTop = this._paddingTop;\n\t\t\t\t\tverticalLayout.paddingRight = this._paddingRight;\n\t\t\t\t\tverticalLayout.paddingBottom = this._paddingBottom;\n\t\t\t\t\tverticalLayout.paddingLeft = this._paddingLeft;\n\t\t\t\t\tverticalLayout.gap = this._gap;\n\t\t\t\t\tverticalLayout.horizontalAlign = this._horizontalAlign;\n\t\t\t\t\tverticalLayout.verticalAlign = this._verticalAlign;\n\t\t\t\t}\n\t\t\t\tif(this._layout is HorizontalLayout)\n\t\t\t\t{\n\t\t\t\t\tvar horizontalLayout:HorizontalLayout = HorizontalLayout(this._layout);\n\t\t\t\t\thorizontalLayout.paddingTop = this._paddingTop;\n\t\t\t\t\thorizontalLayout.paddingRight = this._paddingRight;\n\t\t\t\t\thorizontalLayout.paddingBottom = this._paddingBottom;\n\t\t\t\t\thorizontalLayout.paddingLeft = this._paddingLeft;\n\t\t\t\t\thorizontalLayout.gap = this._gap;\n\t\t\t\t\thorizontalLayout.horizontalAlign = this._horizontalAlign;\n\t\t\t\t\thorizontalLayout.verticalAlign = this._verticalAlign;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSUGGESTED_BOUNDS.x = SUGGESTED_BOUNDS.y = 0;\n\t\t\tSUGGESTED_BOUNDS.scrollX = SUGGESTED_BOUNDS.scrollY = 0;\n\t\t\tSUGGESTED_BOUNDS.explicitWidth = this._explicitWidth;\n\t\t\tSUGGESTED_BOUNDS.explicitHeight = this._explicitHeight;\n\t\t\tSUGGESTED_BOUNDS.maxWidth = this._explicitMaxWidth;\n\t\t\tSUGGESTED_BOUNDS.maxHeight = this._explicitMaxHeight;\n\t\t\tSUGGESTED_BOUNDS.minWidth = this._explicitMinWidth;\n\t\t\tSUGGESTED_BOUNDS.minHeight = this._explicitMinHeight;\n\t\t\tthis._layout.layout(this.symbols, SUGGESTED_BOUNDS, LAYOUT_RESULT);\n\t\t\tthis.saveMeasurements(LAYOUT_RESULT.contentWidth, LAYOUT_RESULT.contentHeight,\n\t\t\t\tLAYOUT_RESULT.contentWidth, LAYOUT_RESULT.contentHeight);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled || this._pageCount < 2)\n\t\t\t{\n\t\t\t\tthis.touchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this.touchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(this, TouchPhase.ENDED, this.touchPointID);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.touchPointID = -1;\n\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\ttouch.getLocation(this.stage, point);\n\t\t\t\tvar isInBounds:Boolean = this.contains(this.stage.hitTest(point));\n\t\t\t\tif(isInBounds)\n\t\t\t\t{\n\t\t\t\t\tvar lastPageIndex:int = this._pageCount - 1;\n\t\t\t\t\tthis.globalToLocal(point, point);\n\t\t\t\t\tif(this._direction == Direction.VERTICAL)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._interactionMode === PageIndicatorInteractionMode.PRECISE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar symbolHeight:Number = this.selectedSymbol.height + (this.unselectedSymbols[0].height + this._gap) * lastPageIndex;\n\t\t\t\t\t\t\tvar newIndex:int = Math.round(lastPageIndex * (point.y - this.symbols[0].y) / symbolHeight);\n\t\t\t\t\t\t\tif(newIndex < 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tnewIndex = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if(newIndex > lastPageIndex)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tnewIndex = lastPageIndex;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis.selectedIndex = newIndex;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse //previous/next\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(point.y < this.selectedSymbol.y)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.selectedIndex = Math.max(0, this._selectedIndex - 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(point.y > (this.selectedSymbol.y + this.selectedSymbol.height))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.selectedIndex = Math.min(lastPageIndex, this._selectedIndex + 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._interactionMode === PageIndicatorInteractionMode.PRECISE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar symbolWidth:Number = this.selectedSymbol.width + (this.unselectedSymbols[0].width + this._gap) * lastPageIndex;\n\t\t\t\t\t\t\tnewIndex = Math.round(lastPageIndex * (point.x - this.symbols[0].x) / symbolWidth);\n\t\t\t\t\t\t\tif(newIndex < 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tnewIndex = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if(newIndex >= this._pageCount)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tnewIndex = lastPageIndex;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis.selectedIndex = newIndex;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse //previous/next\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(point.x < this.selectedSymbol.x)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.selectedIndex = Math.max(0, this._selectedIndex - 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(point.x > (this.selectedSymbol.x + this.selectedSymbol.width))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.selectedIndex = Math.min(lastPageIndex, this._selectedIndex + 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tPool.putPoint(point);\n\t\t\t}\n\t\t\telse //if we get here, we don't have a saved touch ID yet\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(this, TouchPhase.BEGAN);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.touchPointID = touch.id;\n\t\t\t}\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/PageIndicatorInteractionMode.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\t/**\n\t * Interaction modes for page indicators.\n\t *\n\t * @see feathers.controls.PageIndicator\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class PageIndicatorInteractionMode\n\t{\n\t\t/**\n\t\t * Touching the page indicator on the left of the selected symbol will\n\t\t * select the previous index and to the right of the selected symbol\n\t\t * will select the next index.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const PREVIOUS_NEXT:String = \"previousNext\";\n\n\t\t/**\n\t\t * Touching the page indicator on a symbol will select that symbol's\n\t\t * exact index.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const PRECISE:String = \"precise\";\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/Panel.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IFocusExtras;\n\timport feathers.core.IMeasureDisplayObject;\n\timport feathers.core.IValidating;\n\timport feathers.core.PropertyProxy;\n\timport feathers.events.FeathersEventType;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.utils.skins.resetFluidChildDimensionsForMeasurement;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t/**\n\t * A style name to add to the panel's header sub-component. Typically\n\t * used by a theme to provide different styles to different panels.\n\t *\n\t * <p>In the following example, a custom header style name is passed to\n\t * the panel:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * panel.customHeaderStyleName = \"my-custom-header\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default (this example assumes that the\n\t * header is a <code>Header</code>, but it can be any\n\t * <code>IFeathersControl</code>):</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( Header ).setFunctionForStyleName( \"my-custom-header\", setCustomHeaderStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_HEADER\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #headerFactory\n\t */\n\t[Style(name=\"customHeaderStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to the panel's footer sub-component. Typically\n\t * used by a theme to provide different styles to different panels.\n\t *\n\t * <p>In the following example, a custom footer style name is passed to\n\t * the panel:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * panel.customFooterStyleName = \"my-custom-footer\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default (this example assumes that the\n\t * footer is a <code>ScrollContainer</code>, but it can be any\n\t * <code>IFeathersControl</code>):</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( ScrollContainer ).setFunctionForStyleName( \"my-custom-footer\", setCustomFooterStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_FOOTER\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #footerFactory\n\t */\n\t[Style(name=\"customFooterStyleName\",type=\"String\")]\n\n\t/**\n\t * Quickly sets all outer padding properties to the same value. The\n\t * <code>outerPadding</code> getter always returns the value of\n\t * <code>outerPaddingTop</code>, but the other padding values may be\n\t * different.\n\t *\n\t * <p>In the following example, the outer padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * panel.outerPadding = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:outerPaddingTop\n\t * @see #style:outerPaddingRight\n\t * @see #style:outerPaddingBottom\n\t * @see #style:outerPaddingLeft\n\t * @see feathers.controls.Scroller#style:padding\n\t */\n\t[Style(name=\"outerPadding\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the panel's top edge and the\n\t * panel's header.\n\t *\n\t * <p>Note: The <code>paddingTop</code> property applies to the\n\t * middle content only, and it does not affect the header. Use\n\t * <code>outerPaddingTop</code> if you want to include padding above\n\t * the header. <code>outerPaddingTop</code> and <code>paddingTop</code>\n\t * may be used simultaneously to define padding around the outer edges\n\t * of the panel and additional padding around its middle content.</p>\n\t *\n\t * <p>In the following example, the top padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * panel.outerPaddingTop = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:outerPadding\n\t * @see feathers.controls.Scroller#style:paddingTop\n\t */\n\t[Style(name=\"outerPaddingTop\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the panel's right edge and the\n\t * panel's header, middle content, and footer.\n\t *\n\t * <p>Note: The <code>paddingRight</code> property applies to the middle\n\t * content only, and it does not affect the header or footer. Use\n\t * <code>outerPaddingRight</code> if you want to include padding around\n\t * the header and footer too. <code>outerPaddingRight</code> and\n\t * <code>paddingRight</code> may be used simultaneously to define\n\t * padding around the outer edges of the panel plus additional padding\n\t * around its middle content.</p>\n\t *\n\t * <p>In the following example, the right outer padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * panel.outerPaddingRight = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:outerPadding\n\t * @see feathers.controls.Scroller#style:paddingRight\n\t */\n\t[Style(name=\"outerPaddingRight\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the panel's bottom edge and the\n\t * panel's footer.\n\t *\n\t * <p>Note: The <code>paddingBottom</code> property applies to the\n\t * middle content only, and it does not affect the footer. Use\n\t * <code>outerPaddingBottom</code> if you want to include padding below\n\t * the footer. <code>outerPaddingBottom</code> and <code>paddingBottom</code>\n\t * may be used simultaneously to define padding around the outer edges\n\t * of the panel and additional padding around its middle content.</p>\n\t *\n\t * <p>In the following example, the bottom outer padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * panel.outerPaddingBottom = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:outerPadding\n\t * @see feathers.controls.Scroller#style:paddingBottom\n\t */\n\t[Style(name=\"outerPaddingBottom\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the panel's left edge and the\n\t * panel's header, middle content, and footer.\n\t *\n\t * <p>Note: The <code>paddingLeft</code> property applies to the middle\n\t * content only, and it does not affect the header or footer. Use\n\t * <code>outerPaddingLeft</code> if you want to include padding around\n\t * the header and footer too. <code>outerPaddingLeft</code> and\n\t * <code>paddingLeft</code> may be used simultaneously to define padding\n\t * around the outer edges of the panel and additional padding around its\n\t * middle content.</p>\n\t *\n\t * <p>In the following example, the left outer padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.outerPaddingLeft = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:outerPadding\n\t * @see feathers.controls.Scroller#style:paddingLeft\n\t */\n\t[Style(name=\"outerPaddingLeft\",type=\"Number\")]\n\n\t/**\n\t * A container with layout, optional scrolling, a header, and an optional\n\t * footer.\n\t *\n\t * <p>The following example creates a panel with a horizontal layout and\n\t * adds two buttons to it:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var panel:Panel = new Panel();\n\t * panel.title = \"Is it time to party?\";\n\t * \n\t * var layout:HorizontalLayout = new HorizontalLayout();\n\t * layout.gap = 20;\n\t * layout.padding = 20;\n\t * panel.layout = layout;\n\t * \n\t * this.addChild( panel );\n\t * \n\t * var yesButton:Button = new Button();\n\t * yesButton.label = \"Yes\";\n\t * panel.addChild( yesButton );\n\t * \n\t * var noButton:Button = new Button();\n\t * noButton.label = \"No\";\n\t * panel.addChild( noButton );</listing>\n\t *\n\t * @see ../../../help/panel.html How to use the Feathers Panel component\n\t *\n\t * @productversion Feathers 1.1.0\n\t */\n\tpublic class Panel extends ScrollContainer implements IFocusExtras\n\t{\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the header.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_HEADER:String = \"feathers-panel-header\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the footer.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_FOOTER:String = \"feathers-panel-footer\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>Panel</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_HEADER_FACTORY:String = \"headerFactory\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_FOOTER_FACTORY:String = \"footerFactory\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultHeaderFactory():IFeathersControl\n\t\t{\n\t\t\treturn new Header();\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function Panel()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * The header sub-component.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t *\n\t\t * @see #headerFactory\n\t\t * @see #createHeader()\n\t\t */\n\t\tprotected var header:IFeathersControl;\n\n\t\t/**\n\t\t * The footer sub-component.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t *\n\t\t * @see #footerFactory\n\t\t * @see #createFooter()\n\t\t */\n\t\tprotected var footer:IFeathersControl;\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the\n\t\t * header. This variable is <code>protected</code> so that sub-classes\n\t\t * can customize the header style name in their constructors instead of\n\t\t * using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_HEADER</code>.\n\t\t *\n\t\t * <p>To customize the header style name without subclassing, see\n\t\t * <code>customHeaderStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customHeaderStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var headerStyleName:String = DEFAULT_CHILD_STYLE_NAME_HEADER;\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the\n\t\t * footer. This variable is <code>protected</code> so that sub-classes\n\t\t * can customize the footer style name in their constructors instead of\n\t\t * using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_FOOTER</code>.\n\t\t *\n\t\t * <p>To customize the footer style name without subclassing, see\n\t\t * <code>customFooterStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customFooterStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var footerStyleName:String = DEFAULT_CHILD_STYLE_NAME_FOOTER;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn Panel.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitHeaderWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitHeaderHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitHeaderMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitHeaderMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitFooterWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitFooterHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitFooterMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitFooterMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _title:String = null;\n\n\t\t/**\n\t\t * The panel's title to display in the header.\n\t\t *\n\t\t * <p>By default, this value is passed to the <code>title</code>\n\t\t * property of the header, if that property exists. However, if the\n\t\t * header is not a <code>feathers.controls.Header</code> instance,\n\t\t * changing the value of <code>titleField</code> will allow the panel to\n\t\t * pass its title to a different property on the header instead.</p>\n\t\t *\n\t\t * <p>In the following example, a custom header factory is provided to\n\t\t * the panel:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * panel.title = \"Settings\";</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #headerTitleField\n\t\t * @see #headerFactory\n\t\t */\n\t\tpublic function get title():String\n\t\t{\n\t\t\treturn this._title;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set title(value:String):void\n\t\t{\n\t\t\tif(this._title == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._title = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _headerTitleField:String = \"title\";\n\n\t\t/**\n\t\t * A property of the header that should be used to display the panel's\n\t\t * title.\n\t\t *\n\t\t * <p>By default, this value is passed to the <code>title</code>\n\t\t * property of the header, if that property exists. However, if the\n\t\t * header is not a <code>feathers.controls.Header</code> instance,\n\t\t * changing the value of <code>titleField</code> will allow the panel to\n\t\t * pass the title to a different property name instead.</p>\n\t\t *\n\t\t * <p>In the following example, a <code>Button</code> is used as a\n\t\t * custom header, and the title is passed to its <code>label</code>\n\t\t * property:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * panel.headerFactory = function():IFeathersControl\n\t\t * {\n\t\t *     return new Button();\n\t\t * };\n\t\t * panel.titleField = \"label\";</listing>\n\t\t *\n\t\t * @default \"title\"\n\t\t *\n\t\t * @see #title\n\t\t * @see #headerFactory\n\t\t */\n\t\tpublic function get headerTitleField():String\n\t\t{\n\t\t\treturn this._headerTitleField;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set headerTitleField(value:String):void\n\t\t{\n\t\t\tif(this._headerTitleField == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._headerTitleField = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _headerFactory:Function;\n\n\t\t/**\n\t\t * A function used to generate the panel's header sub-component.\n\t\t * The header must be an instance of <code>IFeathersControl</code>, but\n\t\t * the default is an instance of <code>Header</code>. This factory can\n\t\t * be used to change properties on the header when it is first\n\t\t * created. For instance, if you are skinning Feathers components\n\t\t * without a theme, you might use this factory to set skins and other\n\t\t * styles on the header.\n\t\t *\n\t\t * <p>The function should have the following signature:</p>\n\t\t * <pre>function():IFeathersControl</pre>\n\t\t *\n\t\t * <p>In the following example, a custom header factory is provided to\n\t\t * the panel:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * panel.headerFactory = function():IFeathersControl\n\t\t * {\n\t\t *     var header:Header = new Header();\n\t\t *     var closeButton:Button = new Button();\n\t\t *     closeButton.label = \"Close\";\n\t\t *     closeButton.addEventListener( Event.TRIGGERED, closeButton_triggeredHandler );\n\t\t *     header.rightItems = new &lt;DisplayObject&gt;[ closeButton ];\n\t\t *     return header;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.Header\n\t\t */\n\t\tpublic function get headerFactory():Function\n\t\t{\n\t\t\treturn this._headerFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set headerFactory(value:Function):void\n\t\t{\n\t\t\tif(this._headerFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._headerFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_HEADER_FACTORY);\n\t\t\t//hack because the super class doesn't know anything about the\n\t\t\t//header factory\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customHeaderStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customHeaderStyleName():String\n\t\t{\n\t\t\treturn this._customHeaderStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customHeaderStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customHeaderStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customHeaderStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_HEADER_FACTORY);\n\t\t\t//hack because the super class doesn't know anything about the\n\t\t\t//header factory\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _headerProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the container's header\n\t\t * sub-component, and the properties will be passed down to the header\n\t\t * when the container validates. Any Feathers component may be used as\n\t\t * the container's header, so the available properties depend on which\n\t\t * type of component is returned by <code>headerFactory</code>.\n\t\t *\n\t\t * <p>By default, the <code>headerFactory</code> will return a\n\t\t * <code>Header</code> instance. If you aren't using a different type of\n\t\t * component as the container's header, you can refer to\n\t\t * <a href=\"Header.html\"><code>feathers.controls.Header</code></a>\n\t\t * for a list of available properties. Otherwise, refer to the\n\t\t * appropriate documentation for details about which properties are\n\t\t * available on the component that you're using as the header.</p>\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>headerFactory</code> function\n\t\t * instead of using <code>headerProperties</code> will result in better\n\t\t * performance.</p>\n\t\t *\n\t\t * <p>In the following example, the header properties are customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var closeButton:Button = new Button();\n\t\t * closeButton.label = \"Close\";\n\t\t * closeButton.addEventListener( Event.TRIGGERED, closeButton_triggeredHandler );\n\t\t * panel.headerProperties.rightItems = new &lt;DisplayObject&gt;[ closeButton ];</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #headerFactory\n\t\t * @see feathers.controls.Header\n\t\t */\n\t\tpublic function get headerProperties():Object\n\t\t{\n\t\t\tif(!this._headerProperties)\n\t\t\t{\n\t\t\t\tthis._headerProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._headerProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set headerProperties(value:Object):void\n\t\t{\n\t\t\tif(this._headerProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._headerProperties)\n\t\t\t{\n\t\t\t\tthis._headerProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._headerProperties = PropertyProxy(value);\n\t\t\tif(this._headerProperties)\n\t\t\t{\n\t\t\t\tthis._headerProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _footerFactory:Function;\n\n\t\t/**\n\t\t * A function used to generate the panel's footer sub-component.\n\t\t * The footer must be an instance of <code>IFeathersControl</code>, and\n\t\t * by default, there is no footer. This factory can be used to change\n\t\t * properties on the footer when it is first created. For instance, if\n\t\t * you are skinning Feathers components without a theme, you might use\n\t\t * this factory to set skins and other styles on the footer.\n\t\t *\n\t\t * <p>The function should have the following signature:</p>\n\t\t * <pre>function():IFeathersControl</pre>\n\t\t *\n\t\t * <p>In the following example, a custom footer factory is provided to\n\t\t * the panel:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * panel.footerFactory = function():IFeathersControl\n\t\t * {\n\t\t *     return new ScrollContainer();\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.FeathersControl\n\t\t */\n\t\tpublic function get footerFactory():Function\n\t\t{\n\t\t\treturn this._footerFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set footerFactory(value:Function):void\n\t\t{\n\t\t\tif(this._footerFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._footerFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_FOOTER_FACTORY);\n\t\t\t//hack because the super class doesn't know anything about the\n\t\t\t//header factory\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customFooterStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customFooterStyleName():String\n\t\t{\n\t\t\treturn this._customFooterStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customFooterStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customFooterStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customFooterStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_FOOTER_FACTORY);\n\t\t\t//hack because the super class doesn't know anything about the\n\t\t\t//header factory\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _footerProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the container's footer\n\t\t * sub-component, and the properties will be passed down to the footer\n\t\t * when the container validates. Any Feathers component may be used as\n\t\t * the container's footer, so the available properties depend on which\n\t\t * type of component is returned by <code>footerFactory</code>. Refer to\n\t\t * the appropriate documentation for details about which properties are\n\t\t * available on the component that you're using as the footer.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>footerFactory</code> function\n\t\t * instead of using <code>footerProperties</code> will result in better\n\t\t * performance.</p>\n\t\t *\n\t\t * <p>In the following example, the footer properties are customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * panel.footerProperties.verticalScrollPolicy = ScrollPolicy.OFF;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #footerFactory\n\t\t */\n\t\tpublic function get footerProperties():Object\n\t\t{\n\t\t\tif(!this._footerProperties)\n\t\t\t{\n\t\t\t\tthis._footerProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._footerProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set footerProperties(value:Object):void\n\t\t{\n\t\t\tif(this._footerProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._footerProperties)\n\t\t\t{\n\t\t\t\tthis._footerProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._footerProperties = PropertyProxy(value);\n\t\t\tif(this._footerProperties)\n\t\t\t{\n\t\t\t\tthis._footerProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _focusExtrasBefore:Vector.<DisplayObject> = new <DisplayObject>[];\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get focusExtrasBefore():Vector.<DisplayObject>\n\t\t{\n\t\t\treturn this._focusExtrasBefore;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _focusExtrasAfter:Vector.<DisplayObject> = new <DisplayObject>[];\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get focusExtrasAfter():Vector.<DisplayObject>\n\t\t{\n\t\t\treturn this._focusExtrasAfter;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get outerPadding():Number\n\t\t{\n\t\t\treturn this._outerPaddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set outerPadding(value:Number):void\n\t\t{\n\t\t\tthis.outerPaddingTop = value;\n\t\t\tthis.outerPaddingRight = value;\n\t\t\tthis.outerPaddingBottom = value;\n\t\t\tthis.outerPaddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _outerPaddingTop:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get outerPaddingTop():Number\n\t\t{\n\t\t\treturn this._outerPaddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set outerPaddingTop(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._outerPaddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._outerPaddingTop = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _outerPaddingRight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get outerPaddingRight():Number\n\t\t{\n\t\t\treturn this._outerPaddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set outerPaddingRight(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._outerPaddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._outerPaddingRight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _outerPaddingBottom:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get outerPaddingBottom():Number\n\t\t{\n\t\t\treturn this._outerPaddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set outerPaddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._outerPaddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._outerPaddingBottom = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _outerPaddingLeft:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get outerPaddingLeft():Number\n\t\t{\n\t\t\treturn this._outerPaddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set outerPaddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._outerPaddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._outerPaddingLeft = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _ignoreHeaderResizing:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _ignoreFooterResizing:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar headerFactoryInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_HEADER_FACTORY);\n\t\t\tvar footerFactoryInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_FOOTER_FACTORY);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\n\t\t\tif(headerFactoryInvalid)\n\t\t\t{\n\t\t\t\tthis.createHeader();\n\t\t\t}\n\n\t\t\tif(footerFactoryInvalid)\n\t\t\t{\n\t\t\t\tthis.createFooter();\n\t\t\t}\n\n\t\t\tif(headerFactoryInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshHeaderStyles();\n\t\t\t}\n\n\t\t\tif(footerFactoryInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshFooterStyles();\n\t\t\t}\n\n\t\t\tsuper.draw();\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\toverride protected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tif(this._autoSizeMode === AutoSizeMode.STAGE)\n\t\t\t{\n\t\t\t\t//the implementation in ScrollContainer can handle this\n\t\t\t\treturn super.autoSizeIfNeeded();\n\t\t\t}\n\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tresetFluidChildDimensionsForMeasurement(this.currentBackgroundSkin,\n\t\t\t\tthis._explicitWidth, this._explicitHeight,\n\t\t\t\tthis._explicitMinWidth, this._explicitMinHeight,\n\t\t\t\tthis._explicitMaxWidth, this._explicitMaxHeight,\n\t\t\t\tthis._explicitBackgroundWidth, this._explicitBackgroundHeight,\n\t\t\t\tthis._explicitBackgroundMinWidth, this._explicitBackgroundMinHeight,\n\t\t\t\tthis._explicitBackgroundMaxWidth, this._explicitBackgroundMaxHeight);\n\t\t\tvar measureBackground:IMeasureDisplayObject = this.currentBackgroundSkin as IMeasureDisplayObject;\n\t\t\tif(this.currentBackgroundSkin is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.currentBackgroundSkin).validate();\n\t\t\t}\n\n\t\t\t//we don't measure the header and footer here because they are\n\t\t\t//handled in calculateViewPortOffsets(), which is automatically\n\t\t\t//called by Scroller before autoSizeIfNeeded().\n\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tif(this._measureViewPort)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this._viewPort.visibleWidth;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewWidth = 0;\n\t\t\t\t}\n\t\t\t\t//we don't need to account for the icon and gap because it is\n\t\t\t\t//already included in the left offset\n\t\t\t\tnewWidth += this._rightViewPortOffset + this._leftViewPortOffset;\n\t\t\t\tvar headerWidth:Number = this.header.width + this._outerPaddingLeft + this._outerPaddingRight;\n\t\t\t\tif(headerWidth > newWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = headerWidth;\n\t\t\t\t}\n\t\t\t\tif(this.footer !== null)\n\t\t\t\t{\n\t\t\t\t\tvar footerWidth:Number = this.footer.width + this._outerPaddingLeft + this._outerPaddingRight;\n\t\t\t\t\tif(footerWidth > newWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewWidth = footerWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this.currentBackgroundSkin !== null &&\n\t\t\t\t\tthis.currentBackgroundSkin.width > newWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this.currentBackgroundSkin.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tif(this._measureViewPort)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this._viewPort.visibleHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewHeight = 0;\n\t\t\t\t}\n\t\t\t\tnewHeight += this._bottomViewPortOffset + this._topViewPortOffset;\n\t\t\t\t//we don't need to account for the header and footer because\n\t\t\t\t//they're already included in the top and bottom offsets\n\t\t\t\tif(this.currentBackgroundSkin !== null &&\n\t\t\t\t\tthis.currentBackgroundSkin.height > newHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this.currentBackgroundSkin.height;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tif(this._measureViewPort)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = this._viewPort.minVisibleWidth;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = 0;\n\t\t\t\t}\n\t\t\t\t//we don't need to account for the icon and gap because it is\n\t\t\t\t//already included in the left offset\n\t\t\t\tnewMinWidth += this._rightViewPortOffset + this._leftViewPortOffset;\n\t\t\t\tvar headerMinWidth:Number = this.header.minWidth + this._outerPaddingLeft + this._outerPaddingRight;\n\t\t\t\tif(headerMinWidth > newMinWidth)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = headerMinWidth;\n\t\t\t\t}\n\t\t\t\tif(this.footer !== null)\n\t\t\t\t{\n\t\t\t\t\tvar footerMinWidth:Number = this.footer.minWidth + this._outerPaddingLeft + this._outerPaddingRight;\n\t\t\t\t\tif(footerMinWidth > newMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = footerMinWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(measureBackground !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(measureBackground.minWidth > newMinWidth)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinWidth = measureBackground.minWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._explicitBackgroundMinWidth > newMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = this._explicitBackgroundMinWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tif(this._measureViewPort)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = this._viewPort.minVisibleHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = 0;\n\t\t\t\t}\n\t\t\t\tnewMinHeight += this._bottomViewPortOffset + this._topViewPortOffset;\n\t\t\t\t//we don't need to account for the header and footer because\n\t\t\t\t//they're already included in the top and bottom offsets\n\t\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(measureBackground !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(measureBackground.minHeight > newMinHeight)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinHeight = measureBackground.minHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._explicitBackgroundMinHeight > newMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = this._explicitBackgroundMinHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>header</code> sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #header\n\t\t * @see #headerFactory\n\t\t * @see #style:customHeaderStyleName\n\t\t */\n\t\tprotected function createHeader():void\n\t\t{\n\t\t\tif(this.header !== null)\n\t\t\t{\n\t\t\t\tthis.header.removeEventListener(FeathersEventType.RESIZE, header_resizeHandler);\n\t\t\t\tvar displayHeader:DisplayObject = DisplayObject(this.header);\n\t\t\t\tthis._focusExtrasBefore.splice(this._focusExtrasBefore.indexOf(displayHeader), 1);\n\t\t\t\tthis.removeRawChild(displayHeader, true);\n\t\t\t\tthis.header = null;\n\t\t\t}\n\n\t\t\tvar factory:Function = this._headerFactory != null ? this._headerFactory : defaultHeaderFactory;\n\t\t\tvar headerStyleName:String = this._customHeaderStyleName != null ? this._customHeaderStyleName : this.headerStyleName;\n\t\t\tthis.header = IFeathersControl(factory());\n\t\t\tthis.header.styleNameList.add(headerStyleName);\n\t\t\tdisplayHeader = DisplayObject(this.header);\n\t\t\tthis.addRawChild(displayHeader);\n\t\t\tthis._focusExtrasBefore.push(displayHeader);\n\t\t\tthis.header.addEventListener(FeathersEventType.RESIZE, header_resizeHandler);\n\n\t\t\tthis.header.initializeNow();\n\t\t\tthis._explicitHeaderWidth = this.header.explicitWidth;\n\t\t\tthis._explicitHeaderHeight = this.header.explicitHeight;\n\t\t\tthis._explicitHeaderMinWidth = this.header.explicitMinWidth;\n\t\t\tthis._explicitHeaderMinHeight = this.header.explicitMinHeight;\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>footer</code> sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #footer\n\t\t * @see #footerFactory\n\t\t * @see #style:customFooterStyleName\n\t\t */\n\t\tprotected function createFooter():void\n\t\t{\n\t\t\tif(this.footer !== null)\n\t\t\t{\n\t\t\t\tthis.footer.removeEventListener(FeathersEventType.RESIZE, footer_resizeHandler);\n\t\t\t\tvar displayFooter:DisplayObject = DisplayObject(this.footer);\n\t\t\t\tthis._focusExtrasAfter.splice(this._focusExtrasAfter.indexOf(displayFooter), 1);\n\t\t\t\tthis.removeRawChild(displayFooter, true);\n\t\t\t\tthis.footer = null;\n\t\t\t}\n\n\t\t\tif(this._footerFactory === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar footerStyleName:String = this._customFooterStyleName != null ? this._customFooterStyleName : this.footerStyleName;\n\t\t\tthis.footer = IFeathersControl(this._footerFactory());\n\t\t\tthis.footer.styleNameList.add(footerStyleName);\n\t\t\tthis.footer.addEventListener(FeathersEventType.RESIZE, footer_resizeHandler);\n\t\t\tdisplayFooter = DisplayObject(this.footer);\n\t\t\tthis.addRawChild(displayFooter);\n\t\t\tthis._focusExtrasAfter.push(displayFooter);\n\n\t\t\tthis.footer.initializeNow();\n\t\t\tthis._explicitFooterWidth = this.footer.explicitWidth;\n\t\t\tthis._explicitFooterHeight = this.footer.explicitHeight;\n\t\t\tthis._explicitFooterMinWidth = this.footer.explicitMinWidth;\n\t\t\tthis._explicitFooterMinHeight = this.footer.explicitMinHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshHeaderStyles():void\n\t\t{\n\t\t\tif(Object(this.header).hasOwnProperty(this._headerTitleField))\n\t\t\t{\n\t\t\t\tthis.header[this._headerTitleField] = this._title;\n\t\t\t}\n\t\t\tfor(var propertyName:String in this._headerProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._headerProperties[propertyName];\n\t\t\t\tthis.header[propertyName] = propertyValue;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshFooterStyles():void\n\t\t{\n\t\t\tfor(var propertyName:String in this._footerProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._footerProperties[propertyName];\n\t\t\t\tthis.footer[propertyName] = propertyValue;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function calculateViewPortOffsets(forceScrollBars:Boolean = false, useActualBounds:Boolean = false):void\n\t\t{\n\t\t\tsuper.calculateViewPortOffsets(forceScrollBars);\n\n\t\t\tthis._leftViewPortOffset += this._outerPaddingLeft;\n\t\t\tthis._rightViewPortOffset += this._outerPaddingRight;\n\n\t\t\tvar oldIgnoreHeaderResizing:Boolean = this._ignoreHeaderResizing;\n\t\t\tthis._ignoreHeaderResizing = true;\n\t\t\tif(useActualBounds)\n\t\t\t{\n\t\t\t\tthis.header.width = this.actualWidth - this._outerPaddingLeft - this._outerPaddingRight;\n\t\t\t\tthis.header.minWidth = this.actualMinWidth - this._outerPaddingLeft - this._outerPaddingRight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.header.width = this._explicitWidth - this._outerPaddingLeft - this._outerPaddingRight;\n\t\t\t\tthis.header.minWidth = this._explicitMinWidth - this._outerPaddingLeft - this._outerPaddingRight;\n\t\t\t}\n\t\t\tthis.header.maxWidth = this._explicitMaxWidth - this._outerPaddingLeft - this._outerPaddingRight;\n\t\t\tthis.header.height = this._explicitHeaderHeight;\n\t\t\tthis.header.minHeight = this._explicitHeaderMinHeight;\n\t\t\tthis.header.validate();\n\t\t\tthis._topViewPortOffset += this.header.height + this._outerPaddingTop;\n\t\t\tthis._ignoreHeaderResizing = oldIgnoreHeaderResizing;\n\n\t\t\tif(this.footer !== null)\n\t\t\t{\n\t\t\t\tvar oldIgnoreFooterResizing:Boolean = this._ignoreFooterResizing;\n\t\t\t\tthis._ignoreFooterResizing = true;\n\t\t\t\tif(useActualBounds)\n\t\t\t\t{\n\t\t\t\t\tthis.footer.width = this.actualWidth - this._outerPaddingLeft - this._outerPaddingRight;\n\t\t\t\t\tthis.footer.minWidth = this.actualMinWidth - this._outerPaddingLeft - this._outerPaddingRight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.footer.width = this._explicitWidth - this._outerPaddingLeft - this._outerPaddingRight;\n\t\t\t\t\tthis.footer.minWidth = this._explicitMinWidth - this._outerPaddingLeft - this._outerPaddingRight;\n\t\t\t\t}\n\t\t\t\tthis.footer.maxWidth = this._explicitMaxWidth - this._outerPaddingLeft - this._outerPaddingRight;\n\t\t\t\tthis.footer.height = this._explicitFooterHeight;\n\t\t\t\tthis.footer.minHeight = this._explicitFooterMinHeight;\n\t\t\t\tthis.footer.validate();\n\t\t\t\tthis._bottomViewPortOffset += this.footer.height + this._outerPaddingBottom;\n\t\t\t\tthis._ignoreFooterResizing = oldIgnoreFooterResizing;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._bottomViewPortOffset += this._outerPaddingBottom;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function layoutChildren():void\n\t\t{\n\t\t\tsuper.layoutChildren();\n\n\t\t\tvar oldIgnoreHeaderResizing:Boolean = this._ignoreHeaderResizing;\n\t\t\tthis._ignoreHeaderResizing = true;\n\t\t\tthis.header.x = this._outerPaddingLeft;\n\t\t\tthis.header.y = this._outerPaddingTop;\n\t\t\tthis.header.width = this.actualWidth - this._outerPaddingLeft - this._outerPaddingRight;\n\t\t\tthis.header.height = this._explicitHeaderHeight;\n\t\t\tthis.header.validate();\n\t\t\tthis._ignoreHeaderResizing = oldIgnoreHeaderResizing;\n\n\t\t\tif(this.footer !== null)\n\t\t\t{\n\t\t\t\tvar oldIgnoreFooterResizing:Boolean = this._ignoreFooterResizing;\n\t\t\t\tthis._ignoreFooterResizing = true;\n\t\t\t\tthis.footer.x = this._outerPaddingLeft;\n\t\t\t\tthis.footer.width = this.actualWidth - this._outerPaddingLeft - this._outerPaddingRight;\n\t\t\t\tthis.footer.height = this._explicitFooterHeight;\n\t\t\t\tthis.footer.validate();\n\t\t\t\tthis.footer.y = this.actualHeight - this.footer.height - this._outerPaddingBottom;\n\t\t\t\tthis._ignoreFooterResizing = oldIgnoreFooterResizing;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function header_resizeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreHeaderResizing)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function footer_resizeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreFooterResizing)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/PanelScreen.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.skins.IStyleProvider;\n\timport feathers.utils.display.getDisplayObjectDepthFromStage;\n\n\timport flash.events.KeyboardEvent;\n\timport flash.ui.Keyboard;\n\n\timport starling.events.Event;\n\n\t/**\n\t * Dispatched when the transition animation begins as the screen is shown\n\t * by the screen navigator.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.TRANSITION_IN_START\n\t */\n\t[Event(name=\"transitionInStart\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the transition animation finishes as the screen is shown\n\t * by the screen navigator.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.TRANSITION_IN_COMPLETE\n\t */\n\t[Event(name=\"transitionInComplete\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the transition animation begins as a different screen is\n\t * shown by the screen navigator and this screen is hidden.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.TRANSITION_OUT_START\n\t */\n\t[Event(name=\"transitionOutStart\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the transition animation finishes as a different screen\n\t * is shown by the screen navigator and this screen is hidden.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.TRANSITION_OUT_COMPLETE\n\t */\n\t[Event(name=\"transitionOutComplete\",type=\"starling.events.Event\")]\n\n\t/**\n\t * A screen for use with <code>ScreenNavigator</code>, based on <code>Panel</code>\n\t * in order to provide a header and layout.\n\t *\n\t * <p>This component is generally not instantiated directly. Instead it is\n\t * typically used as a super class for concrete implementations of screens.\n\t * With that in mind, no code example is included here.</p>\n\t *\n\t * <p>The following example provides a basic framework for a new panel screen:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * package\n\t * {\n\t *     import feathers.controls.PanelScreen;\n\t * \n\t *     public class CustomScreen extends PanelScreen\n\t *     {\n\t *         public function CustomScreen()\n\t *         {\n\t *             super();\n\t *         }\n\t * \n\t *         override protected function initialize():void\n\t *         {\n\t *             //runs once when screen is first added to the stage\n\t *             //a good place to add children and customize the layout\n\t * \n\t *             //don't forget to call this!\n\t *             super.initialize()\n\t *         }\n\t *     }\n\t * }</listing>\n\t *\n\t * @see ../../../panel-screen.html How to use the Feathers PanelScreen component\n\t * @see feathers.controls.StackScreenNavigator\n\t * @see feathers.controls.ScreenNavigator\n\t *\n\t * @productversion Feathers 1.1.0\n\t */\n\tpublic class PanelScreen extends Panel implements IScreen\n\t{\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the header.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_HEADER:String = \"feathers-panel-screen-header\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the footer.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_FOOTER:String = \"feathers-panel-screen-footer\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>PanelScreen</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function PanelScreen()\n\t\t{\n\t\t\tthis.addEventListener(Event.ADDED_TO_STAGE, panelScreen_addedToStageHandler);\n\t\t\tsuper();\n\t\t\tthis.headerStyleName = DEFAULT_CHILD_STYLE_NAME_HEADER;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn PanelScreen.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _screenID:String;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get screenID():String\n\t\t{\n\t\t\treturn this._screenID;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set screenID(value:String):void\n\t\t{\n\t\t\tthis._screenID = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _owner:Object;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get owner():Object\n\t\t{\n\t\t\treturn this._owner;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set owner(value:Object):void\n\t\t{\n\t\t\tthis._owner = value;\n\t\t}\n\n\t\t/**\n\t\t * Optional callback for the back hardware key. Automatically handles\n\t\t * keyboard events to cancel the default behavior.\n\t\t *\n\t\t * <p>This function has the following signature:</p>\n\t\t *\n\t\t * <pre>function():void</pre>\n\t\t *\n\t\t * <p>In the following example, a function will dispatch <code>Event.COMPLETE</code>\n\t\t * when the back button is pressed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * this.backButtonHandler = onBackButton;\n\t\t * \n\t\t * private function onBackButton():void\n\t\t * {\n\t\t *     this.dispatchEvent( Event.COMPLETE );\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tprotected var backButtonHandler:Function;\n\n\t\t/**\n\t\t * Optional callback for the menu hardware key. Automatically handles\n\t\t * keyboard events to cancel the default behavior.\n\t\t *\n\t\t * <p>This function has the following signature:</p>\n\t\t *\n\t\t * <pre>function():void</pre>\n\t\t *\n\t\t * <p>In the following example, a function will be called when the menu\n\t\t * button is pressed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * this.menuButtonHandler = onMenuButton;\n\t\t * \n\t\t * private function onMenuButton():void\n\t\t * {\n\t\t *     //do something with the menu button\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tprotected var menuButtonHandler:Function;\n\n\t\t/**\n\t\t * Optional callback for the search hardware key. Automatically handles\n\t\t * keyboard events to cancel the default behavior.\n\t\t *\n\t\t * <p>This function has the following signature:</p>\n\t\t *\n\t\t * <pre>function():void</pre>\n\t\t *\n\t\t * <p>In the following example, a function will be called when the search\n\t\t * button is pressed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * this.searchButtonHandler = onSearchButton;\n\t\t * \n\t\t * private function onSearchButton():void\n\t\t * {\n\t\t *     //do something with the search button\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tprotected var searchButtonHandler:Function;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function panelScreen_addedToStageHandler(event:Event):void\n\t\t{\n\t\t\tthis.addEventListener(Event.REMOVED_FROM_STAGE, panelScreen_removedFromStageHandler);\n\t\t\t//using priority here is a hack so that objects higher up in the\n\t\t\t//display list have a chance to cancel the event first.\n\t\t\tvar priority:int = -getDisplayObjectDepthFromStage(this);\n\t\t\tthis.stage.starling.nativeStage.addEventListener(KeyboardEvent.KEY_DOWN, panelScreen_nativeStage_keyDownHandler, false, priority, true);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function panelScreen_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tthis.removeEventListener(Event.REMOVED_FROM_STAGE, panelScreen_removedFromStageHandler);\n\t\t\tthis.stage.starling.nativeStage.removeEventListener(KeyboardEvent.KEY_DOWN, panelScreen_nativeStage_keyDownHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function panelScreen_nativeStage_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(event.isDefaultPrevented())\n\t\t\t{\n\t\t\t\t//someone else already handled this one\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this.backButtonHandler != null &&\n\t\t\t\tevent.keyCode == Keyboard.BACK)\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.backButtonHandler();\n\t\t\t}\n\n\t\t\tif(this.menuButtonHandler != null &&\n\t\t\t\tevent.keyCode == Keyboard.MENU)\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.menuButtonHandler();\n\t\t\t}\n\n\t\t\tif(this.searchButtonHandler != null &&\n\t\t\t\tevent.keyCode == Keyboard.SEARCH)\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.searchButtonHandler();\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/PickerList.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.controls.popups.CalloutPopUpContentManager;\n\timport feathers.controls.popups.DropDownPopUpContentManager;\n\timport feathers.controls.popups.IPersistentPopUpContentManager;\n\timport feathers.controls.popups.IPopUpContentManager;\n\timport feathers.controls.popups.IPopUpContentManagerWithPrompt;\n\timport feathers.controls.popups.VerticalCenteredPopUpContentManager;\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IFocusDisplayObject;\n\timport feathers.core.ITextBaselineControl;\n\timport feathers.core.IToggle;\n\timport feathers.core.PropertyProxy;\n\timport feathers.data.IListCollection;\n\timport feathers.events.CollectionEventType;\n\timport feathers.events.FeathersEventType;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.system.DeviceCapabilities;\n\n\timport flash.ui.Keyboard;\n\n\timport starling.core.Starling;\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\timport starling.events.KeyboardEvent;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.utils.SystemUtil;\n\n\t/**\n\t * A style name to add to the picker list's button sub-component.\n\t * Typically used by a theme to provide different styles to different\n\t * picker lists.\n\t *\n\t * <p>In the following example, a custom button style name is passed to\n\t * the picker list:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * list.customButtonStyleName = \"my-custom-button\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( Button ).setFunctionForStyleName( \"my-custom-button\", setCustomButtonStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_BUTTON\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #buttonFactory\n\t */\n\t[Style(name=\"customButtonStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to all item renderers in the pop-up list. Typically\n\t * used by a theme to provide different skins to different lists.\n\t *\n\t * <p>The following example sets the item renderer name:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * list.customItemRendererStyleName = \"my-custom-item-renderer\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component name to provide\n\t * different skins than the default style:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( DefaultListItemRenderer ).setFunctionForStyleName( \"my-custom-item-renderer\", setCustomItemRendererStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see feathers.core.FeathersControl#styleNameList\n\t */\n\t[Style(name=\"customItemRendererStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to the picker list's list sub-component.\n\t * Typically used by a theme to provide different styles to different\n\t * picker lists.\n\t *\n\t * <p>In the following example, a custom list style name is passed to the\n\t * picker list:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * list.customListStyleName = \"my-custom-list\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to provide\n\t * different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( List ).setFunctionForStyleName( \"my-custom-list\", setCustomListStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_LIST\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #listFactory\n\t */\n\t[Style(name=\"customListStyleName\",type=\"String\")]\n\n\t/**\n\t * A manager that handles the details of how to display the pop-up list.\n\t *\n\t * <p>In the following example, a pop-up content manager is provided:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * list.popUpContentManager = new CalloutPopUpContentManager();</listing>\n\t *\n\t * @default null\n\t */\n\t[Style(name=\"popUpContentManager\",type=\"feathers.controls.popups.IPopUpContentManager\")]\n\n\t/**\n\t * Determines if the <code>isSelected</code> property of the picker\n\t * list's button sub-component is toggled when the list is opened and\n\t * closed, if the class used to create the thumb implements the\n\t * <code>IToggle</code> interface. Useful for skinning to provide a\n\t * different appearance for the button based on whether the list is open\n\t * or not.\n\t *\n\t * <p>In the following example, the button is toggled on open and close:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * list.toggleButtonOnOpenAndClose = true;</listing>\n\t *\n\t * @default false\n\t *\n\t * @see feathers.core.IToggle\n\t * @see feathers.controls.ToggleButton\n\t */\n\t[Style(name=\"toggleButtonOnOpenAndClose\",type=\"Boolean\")]\n\n\t/**\n\t * Dispatched when the pop-up list is opened.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.OPEN\n\t */\n\t[Event(name=\"open\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the pop-up list is closed.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CLOSE\n\t */\n\t[Event(name=\"close\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the selected item changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #selectedItem\n\t * @see #selectedIndex\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Displays a button that may be triggered to display a pop-up list.\n\t * The list may be customized to display in different ways, such as a\n\t * drop-down, in a <code>Callout</code>, or as a modal overlay.\n\t *\n\t * <p>The following example creates a picker list, gives it a data provider,\n\t * tells the item renderer how to interpret the data, and listens for when\n\t * the selection changes:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var list:PickerList = new PickerList();\n\t * \n\t * list.dataProvider = new ArrayCollection(\n\t * [\n\t *     { text: \"Milk\", thumbnail: textureAtlas.getTexture( \"milk\" ) },\n\t *     { text: \"Eggs\", thumbnail: textureAtlas.getTexture( \"eggs\" ) },\n\t *     { text: \"Bread\", thumbnail: textureAtlas.getTexture( \"bread\" ) },\n\t *     { text: \"Chicken\", thumbnail: textureAtlas.getTexture( \"chicken\" ) },\n\t * ]);\n\t * \n\t * list.itemRendererFactory = function():IListItemRenderer\n\t * {\n\t *     var renderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\t *     renderer.labelField = \"text\";\n\t *     renderer.iconSourceField = \"thumbnail\";\n\t *     return renderer;\n\t * };\n\t * \n\t * list.addEventListener( Event.CHANGE, list_changeHandler );\n\t * \n\t * this.addChild( list );</listing>\n\t *\n\t * @see ../../../help/picker-list.html How to use the Feathers PickerList component\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class PickerList extends FeathersControl implements IFocusDisplayObject, ITextBaselineControl\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_BUTTON_FACTORY:String = \"buttonFactory\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_LIST_FACTORY:String = \"listFactory\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the button.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_BUTTON:String = \"feathers-picker-list-button\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the pop-up\n\t\t * list.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_LIST:String = \"feathers-picker-list-list\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>PickerList</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultButtonFactory():Button\n\t\t{\n\t\t\treturn new Button();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultListFactory():List\n\t\t{\n\t\t\treturn new List();\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function PickerList()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the\n\t\t * button. This variable is <code>protected</code> so that sub-classes\n\t\t * can customize the button style name in their constructors instead of\n\t\t * using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_BUTTON</code>.\n\t\t *\n\t\t * <p>To customize the button style name without subclassing, see\n\t\t * <code>customButtonStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customButtonStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var buttonStyleName:String = DEFAULT_CHILD_STYLE_NAME_BUTTON;\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the\n\t\t * pop-up list. This variable is <code>protected</code> so that\n\t\t * sub-classes can customize the list style name in their constructors\n\t\t * instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_LIST</code>.\n\t\t *\n\t\t * <p>To customize the pop-up list name without subclassing, see\n\t\t * <code>customListStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customListStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var listStyleName:String = DEFAULT_CHILD_STYLE_NAME_LIST;\n\n\t\t/**\n\t\t * The button sub-component.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t *\n\t\t * @see #buttonFactory\n\t\t * @see #createButton()\n\t\t */\n\t\tprotected var button:Button;\n\n\t\t/**\n\t\t * The list sub-component.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t *\n\t\t * @see #listFactory\n\t\t * @see #createList()\n\t\t */\n\t\tprotected var list:List;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn PickerList.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var buttonExplicitWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var buttonExplicitHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var buttonExplicitMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var buttonExplicitMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _dataProvider:IListCollection;\n\n\t\t/**\n\t\t * The collection of data displayed by the list.\n\t\t *\n\t\t * <p>The following example passes in a data provider and tells the item\n\t\t * renderer how to interpret the data:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.dataProvider = new ArrayCollection(\n\t\t * [\n\t\t *     { text: \"Milk\", thumbnail: textureAtlas.getTexture( \"milk\" ) },\n\t\t *     { text: \"Eggs\", thumbnail: textureAtlas.getTexture( \"eggs\" ) },\n\t\t *     { text: \"Bread\", thumbnail: textureAtlas.getTexture( \"bread\" ) },\n\t\t *     { text: \"Chicken\", thumbnail: textureAtlas.getTexture( \"chicken\" ) },\n\t\t * ]);\n\t\t * \n\t\t * list.itemRendererFactory = function():IListItemRenderer\n\t\t * {\n\t\t *     var renderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\t\t *     renderer.labelField = \"text\";\n\t\t *     renderer.iconSourceField = \"thumbnail\";\n\t\t *     return renderer;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.data.ArrayCollection\n\t\t * @see feathers.data.VectorCollection\n\t\t * @see feathers.data.XMLListCollection\n\t\t */\n\t\tpublic function get dataProvider():IListCollection\n\t\t{\n\t\t\treturn this._dataProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set dataProvider(value:IListCollection):void\n\t\t{\n\t\t\tif(this._dataProvider == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar oldSelectedIndex:int = this.selectedIndex;\n\t\t\tvar oldSelectedItem:Object = this.selectedItem;\n\t\t\tif(this._dataProvider)\n\t\t\t{\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.RESET, dataProvider_multipleEventHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.ADD_ITEM, dataProvider_multipleEventHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.REMOVE_ITEM, dataProvider_multipleEventHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.REMOVE_ALL, dataProvider_multipleEventHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.REPLACE_ITEM, dataProvider_multipleEventHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.UPDATE_ITEM, dataProvider_updateItemHandler);\n\t\t\t}\n\t\t\tthis._dataProvider = value;\n\t\t\tif(this._dataProvider)\n\t\t\t{\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.RESET, dataProvider_multipleEventHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.ADD_ITEM, dataProvider_multipleEventHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.REMOVE_ITEM, dataProvider_multipleEventHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.REMOVE_ALL, dataProvider_multipleEventHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.REPLACE_ITEM, dataProvider_multipleEventHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.UPDATE_ITEM, dataProvider_updateItemHandler);\n\t\t\t}\n\t\t\tif(!this._dataProvider || this._dataProvider.length == 0)\n\t\t\t{\n\t\t\t\tthis.selectedIndex = -1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.selectedIndex = 0;\n\t\t\t}\n\t\t\t//this ensures that Event.CHANGE will dispatch for selectedItem\n\t\t\t//changing, even if selectedIndex has not changed.\n\t\t\tif(this.selectedIndex == oldSelectedIndex && this.selectedItem != oldSelectedItem)\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _ignoreSelectionChanges:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectedIndex:int = -1;\n\n\t\t/**\n\t\t * The index of the currently selected item. Returns <code>-1</code> if\n\t\t * no item is selected.\n\t\t *\n\t\t * <p>The following example selects an item by its index:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.selectedIndex = 2;</listing>\n\t\t *\n\t\t * <p>The following example clears the selected index:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.selectedIndex = -1;</listing>\n\t\t *\n\t\t * <p>The following example listens for when selection changes and\n\t\t * requests the selected index:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * function list_changeHandler( event:Event ):void\n\t\t * {\n\t\t *     var list:PickerList = PickerList( event.currentTarget );\n\t\t *     var index:int = list.selectedIndex;\n\t\t * \n\t\t * }\n\t\t * list.addEventListener( Event.CHANGE, list_changeHandler );</listing>\n\t\t *\n\t\t * @default -1\n\t\t *\n\t\t * @see #selectedItem\n\t\t */\n\t\tpublic function get selectedIndex():int\n\t\t{\n\t\t\treturn this._selectedIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedIndex(value:int):void\n\t\t{\n\t\t\tif(this._selectedIndex == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._selectedIndex = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * The currently selected item. Returns <code>null</code> if no item is\n\t\t * selected.\n\t\t *\n\t\t * <p>The following example changes the selected item:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.selectedItem = list.dataProvider.getItemAt(0);</listing>\n\t\t *\n\t\t * <p>The following example clears the selected item:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.selectedItem = null;</listing>\n\t\t *\n\t\t * <p>The following example listens for when selection changes and\n\t\t * requests the selected item:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * function list_changeHandler( event:Event ):void\n\t\t * {\n\t\t *     var list:PickerList = PickerList( event.currentTarget );\n\t\t *     var item:Object = list.selectedItem;\n\t\t * \n\t\t * }\n\t\t * list.addEventListener( Event.CHANGE, list_changeHandler );</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #selectedIndex\n\t\t */\n\t\tpublic function get selectedItem():Object\n\t\t{\n\t\t\tif(!this._dataProvider || this._selectedIndex < 0 || this._selectedIndex >= this._dataProvider.length)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn this._dataProvider.getItemAt(this._selectedIndex);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedItem(value:Object):void\n\t\t{\n\t\t\tif(!this._dataProvider)\n\t\t\t{\n\t\t\t\tthis.selectedIndex = -1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.selectedIndex = this._dataProvider.getItemIndex(value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _prompt:String;\n\n\t\t/**\n\t\t * Text displayed by the button sub-component when no items are\n\t\t * currently selected.\n\t\t *\n\t\t * <p>In the following example, a prompt is given to the picker list\n\t\t * and the selected item is cleared to display the prompt:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.prompt = \"Select an Item\";\n\t\t * list.selectedIndex = -1;</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get prompt():String\n\t\t{\n\t\t\treturn this._prompt;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set prompt(value:String):void\n\t\t{\n\t\t\tif(this._prompt == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._prompt = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _labelField:String = \"label\";\n\n\t\t/**\n\t\t * The field in the selected item that contains the label text to be\n\t\t * displayed by the picker list's button control. If the selected item\n\t\t * does not have this field, and a <code>labelFunction</code> is not\n\t\t * defined, then the picker list will default to calling\n\t\t * <code>toString()</code> on the selected item. To omit the\n\t\t * label completely, define a <code>labelFunction</code> that returns an\n\t\t * empty string.\n\t\t *\n\t\t * <p><strong>Important:</strong> This value only affects the selected\n\t\t * item displayed by the picker list's button control. It will <em>not</em>\n\t\t * affect the label text of the pop-up list's item renderers.</p>\n\t\t *\n\t\t * <p>In the following example, the label field is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.labelField = \"text\";</listing>\n\t\t *\n\t\t * @default \"label\"\n\t\t *\n\t\t * @see #labelFunction\n\t\t */\n\t\tpublic function get labelField():String\n\t\t{\n\t\t\treturn this._labelField;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set labelField(value:String):void\n\t\t{\n\t\t\tif(this._labelField == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._labelField = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _labelFunction:Function;\n\n\t\t/**\n\t\t * A function used to generate label text for the selected item\n\t\t * displayed by the picker list's button control. If this\n\t\t * function is not null, then the <code>labelField</code> will be\n\t\t * ignored.\n\t\t *\n\t\t * <p><strong>Important:</strong> This value only affects the selected\n\t\t * item displayed by the picker list's button control. It will <em>not</em>\n\t\t * affect the label text of the pop-up list's item renderers.</p>\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function( item:Object ):String</pre>\n\t\t *\n\t\t * <p>All of the label fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>labelFunction</code></li>\n\t\t *     <li><code>labelField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the label field is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.labelFunction = function( item:Object ):String\n\t\t * {\n\t\t *     return item.firstName + \" \" + item.lastName;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #labelField\n\t\t */\n\t\tpublic function get labelFunction():Function\n\t\t{\n\t\t\treturn this._labelFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set labelFunction(value:Function):void\n\t\t{\n\t\t\tthis._labelFunction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _popUpContentManager:IPopUpContentManager;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get popUpContentManager():IPopUpContentManager\n\t\t{\n\t\t\treturn this._popUpContentManager;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set popUpContentManager(value:IPopUpContentManager):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._popUpContentManager === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._popUpContentManager is EventDispatcher)\n\t\t\t{\n\t\t\t\tvar dispatcher:EventDispatcher = EventDispatcher(this._popUpContentManager);\n\t\t\t\tdispatcher.removeEventListener(Event.OPEN, popUpContentManager_openHandler);\n\t\t\t\tdispatcher.removeEventListener(Event.CLOSE, popUpContentManager_closeHandler);\n\t\t\t}\n\t\t\tthis._popUpContentManager = value;\n\t\t\tif(this._popUpContentManager is EventDispatcher)\n\t\t\t{\n\t\t\t\tdispatcher = EventDispatcher(this._popUpContentManager);\n\t\t\t\tdispatcher.addEventListener(Event.OPEN, popUpContentManager_openHandler);\n\t\t\t\tdispatcher.addEventListener(Event.CLOSE, popUpContentManager_closeHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _typicalItem:Object = null;\n\n\t\t/**\n\t\t * Used to auto-size the list. If the list's width or height is NaN, the\n\t\t * list will try to automatically pick an ideal size. This item is\n\t\t * used in that process to create a sample item renderer.\n\t\t *\n\t\t * <p>The following example provides a typical item:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.typicalItem = { text: \"A typical item\", thumbnail: texture };</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get typicalItem():Object\n\t\t{\n\t\t\treturn this._typicalItem;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set typicalItem(value:Object):void\n\t\t{\n\t\t\tif(this._typicalItem == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._typicalItem = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _buttonFactory:Function;\n\n\t\t/**\n\t\t * A function used to generate the picker list's button sub-component.\n\t\t * The button must be an instance of <code>Button</code>. This factory\n\t\t * can be used to change properties on the button when it is first\n\t\t * created. For instance, if you are skinning Feathers components\n\t\t * without a theme, you might use this factory to set skins and other\n\t\t * styles on the button.\n\t\t *\n\t\t * <p>The function should have the following signature:</p>\n\t\t * <pre>function():Button</pre>\n\t\t *\n\t\t * <p>In the following example, a custom button factory is passed to the\n\t\t * picker list:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.buttonFactory = function():Button\n\t\t * {\n\t\t *     var button:Button = new Button();\n\t\t *     button.defaultSkin = new Image( upTexture );\n\t\t *     button.downSkin = new Image( downTexture );\n\t\t *     return button;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.Button\n\t\t */\n\t\tpublic function get buttonFactory():Function\n\t\t{\n\t\t\treturn this._buttonFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set buttonFactory(value:Function):void\n\t\t{\n\t\t\tif(this._buttonFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._buttonFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_BUTTON_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customButtonStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customButtonStyleName():String\n\t\t{\n\t\t\treturn this._customButtonStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customButtonStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customButtonStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customButtonStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_BUTTON_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _buttonProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the picker's button\n\t\t * sub-component, and the properties will be passed down to the button\n\t\t * when the picker validates. For a list of available\n\t\t * properties, refer to\n\t\t * <a href=\"Button.html\"><code>feathers.controls.Button</code></a>.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>buttonFactory</code> function\n\t\t * instead of using <code>buttonProperties</code> will result in better\n\t\t * performance.</p>\n\t\t *\n\t\t * <p>In the following example, the button properties are passed to the\n\t\t * picker list:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.buttonProperties.defaultSkin = new Image( upTexture );\n\t\t * list.buttonProperties.downSkin = new Image( downTexture );</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #buttonFactory\n\t\t * @see feathers.controls.Button\n\t\t */\n\t\tpublic function get buttonProperties():Object\n\t\t{\n\t\t\tif(!this._buttonProperties)\n\t\t\t{\n\t\t\t\tthis._buttonProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._buttonProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set buttonProperties(value:Object):void\n\t\t{\n\t\t\tif(this._buttonProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._buttonProperties)\n\t\t\t{\n\t\t\t\tthis._buttonProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._buttonProperties = PropertyProxy(value);\n\t\t\tif(this._buttonProperties)\n\t\t\t{\n\t\t\t\tthis._buttonProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _listFactory:Function;\n\n\t\t/**\n\t\t * A function used to generate the picker list's pop-up list\n\t\t * sub-component. The list must be an instance of <code>List</code>.\n\t\t * This factory can be used to change properties on the list when it is\n\t\t * first created. For instance, if you are skinning Feathers components\n\t\t * without a theme, you might use this factory to set skins and other\n\t\t * styles on the list.\n\t\t *\n\t\t * <p>The function should have the following signature:</p>\n\t\t * <pre>function():List</pre>\n\t\t *\n\t\t * <p>In the following example, a custom list factory is passed to the\n\t\t * picker list:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.listFactory = function():List\n\t\t * {\n\t\t *     var popUpList:List = new List();\n\t\t *     popUpList.backgroundSkin = new Image( texture );\n\t\t *     return popUpList;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.List\n\t\t */\n\t\tpublic function get listFactory():Function\n\t\t{\n\t\t\treturn this._listFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set listFactory(value:Function):void\n\t\t{\n\t\t\tif(this._listFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._listFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LIST_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customListStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customListStyleName():String\n\t\t{\n\t\t\treturn this._customListStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customListStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customListStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customListStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LIST_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _listProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the picker's pop-up list\n\t\t * sub-component, and the properties will be passed down to the pop-up\n\t\t * list when the picker validates. For a list of available\n\t\t * properties, refer to\n\t\t * <a href=\"List.html\"><code>feathers.controls.List</code></a>.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>listFactory</code> function\n\t\t * instead of using <code>listProperties</code> will result in better\n\t\t * performance.</p>\n\t\t *\n\t\t * <p>In the following example, the list properties are passed to the\n\t\t * picker list:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.listProperties.backgroundSkin = new Image( texture );</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #listFactory\n\t\t * @see feathers.controls.List\n\t\t */\n\t\tpublic function get listProperties():Object\n\t\t{\n\t\t\tif(!this._listProperties)\n\t\t\t{\n\t\t\t\tthis._listProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._listProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set listProperties(value:Object):void\n\t\t{\n\t\t\tif(this._listProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._listProperties)\n\t\t\t{\n\t\t\t\tthis._listProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._listProperties = PropertyProxy(value);\n\t\t\tif(this._listProperties)\n\t\t\t{\n\t\t\t\tthis._listProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _toggleButtonOnOpenAndClose:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get toggleButtonOnOpenAndClose():Boolean\n\t\t{\n\t\t\treturn this._toggleButtonOnOpenAndClose;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set toggleButtonOnOpenAndClose(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._toggleButtonOnOpenAndClose === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._toggleButtonOnOpenAndClose = value;\n\t\t\tif(this.button is IToggle)\n\t\t\t{\n\t\t\t\tif(this._toggleButtonOnOpenAndClose && this._popUpContentManager.isOpen)\n\t\t\t\t{\n\t\t\t\t\tIToggle(this.button).isSelected = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tIToggle(this.button).isSelected = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _itemRendererFactory:Function = null;\n\n\t\t/**\n\t\t * A function called that is expected to return a new item renderer.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t *\n\t\t * <pre>function():IListItemRenderer</pre>\n\t\t *\n\t\t * <p>The following example provides a factory for the item renderer:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.itemRendererFactory = function():IListItemRenderer\n\t\t * {\n\t\t *     var renderer:CustomItemRendererClass = new CustomItemRendererClass();\n\t\t *     renderer.backgroundSkin = new Quad( 10, 10, 0xff0000 );\n\t\t *     return renderer;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.renderers.IListItemRenderer\n\t\t */\n\t\tpublic function get itemRendererFactory():Function\n\t\t{\n\t\t\treturn this._itemRendererFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set itemRendererFactory(value:Function):void\n\t\t{\n\t\t\tif(this._itemRendererFactory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._itemRendererFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LIST_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customItemRendererStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customItemRendererStyleName():String\n\t\t{\n\t\t\treturn this._customItemRendererStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customItemRendererStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customItemRendererStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customItemRendererStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LIST_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get baseline():Number\n\t\t{\n\t\t\tif(!this.button)\n\t\t\t{\n\t\t\t\treturn this.scaledActualHeight;\n\t\t\t}\n\t\t\treturn this.scaleY * (this.button.y + this.button.baseline);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _triggered:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isOpenListPending:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isCloseListPending:Boolean = false;\n\n\t\t/**\n\t\t * Using <code>labelField</code> and <code>labelFunction</code>,\n\t\t * generates a label from the selected item to be displayed by the\n\t\t * picker list's button control.\n\t\t *\n\t\t * <p><strong>Important:</strong> This value only affects the selected\n\t\t * item displayed by the picker list's button control. It will <em>not</em>\n\t\t * affect the label text of the pop-up list's item renderers.</p>\n\t\t */\n\t\tpublic function itemToLabel(item:Object):String\n\t\t{\n\t\t\tif(this._labelFunction !== null)\n\t\t\t{\n\t\t\t\tvar labelResult:Object = this._labelFunction(item);\n\t\t\t\tif(labelResult is String)\n\t\t\t\t{\n\t\t\t\t\treturn labelResult as String;\n\t\t\t\t}\n\t\t\t\telse if(labelResult !== null)\n\t\t\t\t{\n\t\t\t\t\treturn labelResult.toString();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(this._labelField !== null && item !== null && item.hasOwnProperty(this._labelField))\n\t\t\t{\n\t\t\t\tlabelResult = item[this._labelField];\n\t\t\t\tif(labelResult is String)\n\t\t\t\t{\n\t\t\t\t\treturn labelResult as String;\n\t\t\t\t}\n\t\t\t\telse if(labelResult !== null)\n\t\t\t\t{\n\t\t\t\t\treturn labelResult.toString();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(item is String)\n\t\t\t{\n\t\t\t\treturn item as String;\n\t\t\t}\n\t\t\telse if(item !== null)\n\t\t\t{\n\t\t\t\t//we need to use strict equality here because the data can be\n\t\t\t\t//non-strictly equal to null\n\t\t\t\treturn item.toString();\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _buttonHasFocus:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _buttonTouchPointID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _listIsOpenOnTouchBegan:Boolean = false;\n\n\t\t/**\n\t\t * Opens the pop-up list, if it isn't already open.\n\t\t */\n\t\tpublic function openList():void\n\t\t{\n\t\t\tthis._isCloseListPending = false;\n\t\t\tif(this._popUpContentManager.isOpen)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!this._isValidating && this.isInvalid())\n\t\t\t{\n\t\t\t\tthis._isOpenListPending = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isOpenListPending = false;\n\t\t\tif(this._popUpContentManager is IPopUpContentManagerWithPrompt)\n\t\t\t{\n\t\t\t\tIPopUpContentManagerWithPrompt(this._popUpContentManager).prompt = this._prompt;\n\t\t\t}\n\t\t\tthis._popUpContentManager.open(this.list, this);\n\t\t\tthis.list.scrollToDisplayIndex(this._selectedIndex);\n\t\t\tthis.list.validate();\n\t\t\tif(this.list.focusManager)\n\t\t\t{\n\t\t\t\tthis.list.focusManager.focus = this.list;\n\t\t\t\tthis.stage.addEventListener(KeyboardEvent.KEY_UP, stage_keyUpHandler);\n\t\t\t\tthis.list.addEventListener(FeathersEventType.FOCUS_OUT, list_focusOutHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Closes the pop-up list, if it is open.\n\t\t */\n\t\tpublic function closeList():void\n\t\t{\n\t\t\tthis._isOpenListPending = false;\n\t\t\tif(!this._popUpContentManager.isOpen)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!this._isValidating && this.isInvalid())\n\t\t\t{\n\t\t\t\tthis._isCloseListPending = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isCloseListPending = false;\n\t\t\tthis.list.validate();\n\t\t\t//don't clean up anything from openList() in closeList(). The list\n\t\t\t//may be closed by removing it from the PopUpManager, which would\n\t\t\t//result in closeList() never being called.\n\t\t\t//instead, clean up in the Event.REMOVED_FROM_STAGE listener.\n\t\t\tthis._popUpContentManager.close();\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this.list)\n\t\t\t{\n\t\t\t\tthis.closeList();\n\t\t\t\tthis.list.dispose();\n\t\t\t\tthis.list = null;\n\t\t\t}\n\t\t\tif(this._popUpContentManager)\n\t\t\t{\n\t\t\t\tthis._popUpContentManager.dispose();\n\t\t\t\tthis._popUpContentManager = null;\n\t\t\t}\n\t\t\t//clearing selection now so that the data provider setter won't\n\t\t\t//cause a selection change that triggers events.\n\t\t\tthis._selectedIndex = -1;\n\t\t\tthis.dataProvider = null;\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function showFocus():void\n\t\t{\n\t\t\tif(!this.button)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.button.showFocus();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function hideFocus():void\n\t\t{\n\t\t\tif(!this.button)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.button.hideFocus();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tif(this._popUpContentManager === null)\n\t\t\t{\n\t\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\t\tif(SystemUtil.isDesktop)\n\t\t\t\t{\n\t\t\t\t\tvar popUpContentManager:IPopUpContentManager = new DropDownPopUpContentManager();\n\t\t\t\t}\n\t\t\t\telse if(DeviceCapabilities.isTablet(starling.nativeStage))\n\t\t\t\t{\n\t\t\t\t\tpopUpContentManager = new CalloutPopUpContentManager();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tpopUpContentManager = new VerticalCenteredPopUpContentManager();\n\t\t\t\t}\n\t\t\t\tthis.ignoreNextStyleRestriction();\n\t\t\t\tthis.popUpContentManager = popUpContentManager;\n\t\t\t}\n\t\t\tsuper.initialize();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar selectionInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SELECTED);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\tvar buttonFactoryInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_BUTTON_FACTORY);\n\t\t\tvar listFactoryInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_LIST_FACTORY);\n\n\t\t\tif(buttonFactoryInvalid)\n\t\t\t{\n\t\t\t\tthis.createButton();\n\t\t\t}\n\n\t\t\tif(listFactoryInvalid)\n\t\t\t{\n\t\t\t\tthis.createList();\n\t\t\t}\n\n\t\t\tif(buttonFactoryInvalid || stylesInvalid || selectionInvalid)\n\t\t\t{\n\t\t\t\t//this section asks the button to auto-size again, if our\n\t\t\t\t//explicit dimensions aren't set.\n\t\t\t\t//set this before buttonProperties is used because it might\n\t\t\t\t//contain width or height changes.\n\t\t\t\tif(this._explicitWidth !== this._explicitWidth) //isNaN\n\t\t\t\t{\n\t\t\t\t\tthis.button.width = NaN;\n\t\t\t\t}\n\t\t\t\tif(this._explicitHeight !== this._explicitHeight) //isNaN\n\t\t\t\t{\n\t\t\t\t\tthis.button.height = NaN;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(buttonFactoryInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshButtonProperties();\n\t\t\t}\n\n\t\t\tif(listFactoryInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshListProperties();\n\t\t\t}\n\n\t\t\tif(listFactoryInvalid || dataInvalid)\n\t\t\t{\n\t\t\t\tvar oldIgnoreSelectionChanges:Boolean = this._ignoreSelectionChanges;\n\t\t\t\tthis._ignoreSelectionChanges = true;\n\t\t\t\tthis.list.dataProvider = this._dataProvider;\n\t\t\t\tthis._ignoreSelectionChanges = oldIgnoreSelectionChanges;\n\t\t\t}\n\n\t\t\tif(buttonFactoryInvalid || listFactoryInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.button.isEnabled = this._isEnabled;\n\t\t\t\tthis.list.isEnabled = this._isEnabled;\n\t\t\t}\n\n\t\t\tif(buttonFactoryInvalid || dataInvalid || selectionInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshButtonLabel();\n\t\t\t}\n\t\t\tif(listFactoryInvalid || dataInvalid || selectionInvalid)\n\t\t\t{\n\t\t\t\toldIgnoreSelectionChanges = this._ignoreSelectionChanges;\n\t\t\t\tthis._ignoreSelectionChanges = true;\n\t\t\t\tthis.list.selectedIndex = this._selectedIndex;\n\t\t\t\tthis._ignoreSelectionChanges = oldIgnoreSelectionChanges;\n\t\t\t}\n\n\t\t\tthis.autoSizeIfNeeded();\n\t\t\tthis.layout();\n\n\t\t\tif(this.list.stage)\n\t\t\t{\n\t\t\t\t//final validation to avoid juggler next frame issues\n\t\t\t\t//only validate if it's on the display list, though, because the\n\t\t\t\t//popUpContentManager may need to place restrictions on\n\t\t\t\t//dimensions or make other important changes.\n\t\t\t\t//otherwise, the List may create an item renderer for every item\n\t\t\t\t//in the data provider, which is not good for performance!\n\t\t\t\tthis.list.validate();\n\t\t\t}\n\n\t\t\tthis.handlePendingActions();\n\t\t}\n\n\t\t/**\n\t\t * If the component's dimensions have not been set explicitly, it will\n\t\t * measure its content and determine an ideal size for itself. If the\n\t\t * <code>explicitWidth</code> or <code>explicitHeight</code> member\n\t\t * variables are set, those value will be used without additional\n\t\t * measurement. If one is set, but not the other, the dimension with the\n\t\t * explicit value will not be measured, but the other non-explicit\n\t\t * dimension will still need measurement.\n\t\t *\n\t\t * <p>Calls <code>saveMeasurements()</code> to set up the\n\t\t * <code>actualWidth</code> and <code>actualHeight</code> member\n\t\t * variables used for layout.</p>\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t */\n\t\tprotected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvar buttonWidth:Number = this._explicitWidth;\n\t\t\tif(buttonWidth !== buttonWidth) //isNaN\n\t\t\t{\n\t\t\t\t//we save the button's explicitWidth (and other explicit\n\t\t\t\t//dimensions) after the buttonFactory() returns so that\n\t\t\t\t//measurement always accounts for it, even after the button's\n\t\t\t\t//width is set by the PickerList\n\t\t\t\tbuttonWidth = this.buttonExplicitWidth;\n\t\t\t}\n\t\t\tvar buttonHeight:Number = this._explicitHeight;\n\t\t\tif(buttonHeight !== buttonHeight) //isNaN\n\t\t\t{\n\t\t\t\tbuttonHeight = this.buttonExplicitHeight;\n\t\t\t}\n\t\t\tvar buttonMinWidth:Number = this._explicitMinWidth;\n\t\t\tif(buttonMinWidth !== buttonMinWidth) //isNaN\n\t\t\t{\n\t\t\t\tbuttonMinWidth = this.buttonExplicitMinWidth;\n\t\t\t}\n\t\t\tvar buttonMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(buttonMinHeight !== buttonMinHeight) //isNaN\n\t\t\t{\n\t\t\t\tbuttonMinHeight = this.buttonExplicitMinHeight;\n\t\t\t}\n\t\t\tif(this._typicalItem !== null)\n\t\t\t{\n\t\t\t\tthis.button.label = this.itemToLabel(this._typicalItem);\n\t\t\t}\n\t\t\tthis.button.width = buttonWidth;\n\t\t\tthis.button.height = buttonHeight;\n\t\t\tthis.button.minWidth = buttonMinWidth;\n\t\t\tthis.button.minHeight = buttonMinHeight;\n\t\t\tthis.button.validate();\n\n\t\t\tif(this._typicalItem !== null)\n\t\t\t{\n\t\t\t\tthis.refreshButtonLabel();\n\t\t\t}\n\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tnewWidth = this.button.width;\n\t\t\t}\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tnewHeight = this.button.height;\n\t\t\t}\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tnewMinWidth = this.button.minWidth;\n\t\t\t}\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tnewMinHeight = this.button.minHeight;\n\t\t\t}\n\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>button</code> sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #button\n\t\t * @see #buttonFactory\n\t\t * @see #style:customButtonStyleName\n\t\t */\n\t\tprotected function createButton():void\n\t\t{\n\t\t\tif(this.button)\n\t\t\t{\n\t\t\t\tthis.button.removeFromParent(true);\n\t\t\t\tthis.button = null;\n\t\t\t}\n\n\t\t\tvar factory:Function = this._buttonFactory != null ? this._buttonFactory : defaultButtonFactory;\n\t\t\tvar buttonStyleName:String = this._customButtonStyleName != null ? this._customButtonStyleName : this.buttonStyleName;\n\t\t\tthis.button = Button(factory());\n\t\t\tif(this.button is ToggleButton)\n\t\t\t{\n\t\t\t\t//we'll control the value of isSelected manually\n\t\t\t\tToggleButton(this.button).isToggle = false;\n\t\t\t}\n\t\t\tthis.button.styleNameList.add(buttonStyleName);\n\t\t\tthis.button.addEventListener(TouchEvent.TOUCH, button_touchHandler);\n\t\t\tthis.button.addEventListener(Event.TRIGGERED, button_triggeredHandler);\n\t\t\tthis.addChild(this.button);\n\n\t\t\t//we will use these values for measurement, if possible\n\t\t\tthis.button.initializeNow();\n\t\t\tthis.buttonExplicitWidth = this.button.explicitWidth;\n\t\t\tthis.buttonExplicitHeight = this.button.explicitHeight;\n\t\t\tthis.buttonExplicitMinWidth = this.button.explicitMinWidth;\n\t\t\tthis.buttonExplicitMinHeight = this.button.explicitMinHeight;\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>list</code> sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #list\n\t\t * @see #listFactory\n\t\t * @see #style:customListStyleName\n\t\t */\n\t\tprotected function createList():void\n\t\t{\n\t\t\tif(this.list)\n\t\t\t{\n\t\t\t\tthis.list.removeFromParent(false);\n\t\t\t\t//disposing separately because the list may not have a parent\n\t\t\t\tthis.list.dispose();\n\t\t\t\tthis.list = null;\n\t\t\t}\n\n\t\t\tvar factory:Function = this._listFactory != null ? this._listFactory : defaultListFactory;\n\t\t\tvar listStyleName:String = this._customListStyleName != null ? this._customListStyleName : this.listStyleName;\n\t\t\tthis.list = List(factory());\n\t\t\tthis.list.focusOwner = this;\n\t\t\tthis.list.styleNameList.add(listStyleName);\n\t\t\t//for backwards compatibility, allow the listFactory to take\n\t\t\t//precedence if it also sets customItemRendererStyleName and our\n\t\t\t//value is null. if our value is not null, we'll use it.\n\t\t\tif(this._customItemRendererStyleName !== null)\n\t\t\t{\n\t\t\t\tthis.list.customItemRendererStyleName = this._customItemRendererStyleName;\n\t\t\t}\n\t\t\tif(this._itemRendererFactory !== null)\n\t\t\t{\n\t\t\t\tthis.list.itemRendererFactory = this._itemRendererFactory;\n\t\t\t}\n\t\t\tthis.list.addEventListener(Event.CHANGE, list_changeHandler);\n\t\t\tthis.list.addEventListener(Event.TRIGGERED, list_triggeredHandler);\n\t\t\tthis.list.addEventListener(TouchEvent.TOUCH, list_touchHandler);\n\t\t\tthis.list.addEventListener(Event.REMOVED_FROM_STAGE, list_removedFromStageHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshButtonLabel():void\n\t\t{\n\t\t\tif(this._selectedIndex >= 0)\n\t\t\t{\n\t\t\t\tthis.button.label = this.itemToLabel(this.selectedItem);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.button.label = this._prompt;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshButtonProperties():void\n\t\t{\n\t\t\tfor(var propertyName:String in this._buttonProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._buttonProperties[propertyName];\n\t\t\t\tthis.button[propertyName] = propertyValue;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshListProperties():void\n\t\t{\n\t\t\tfor(var propertyName:String in this._listProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._listProperties[propertyName];\n\t\t\t\tthis.list[propertyName] = propertyValue;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layout():void\n\t\t{\n\t\t\tthis.button.width = this.actualWidth;\n\t\t\tthis.button.height = this.actualHeight;\n\n\t\t\t//final validation to avoid juggler next frame issues\n\t\t\tthis.button.validate();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function handlePendingActions():void\n\t\t{\n\t\t\tif(this._isOpenListPending)\n\t\t\t{\n\t\t\t\tthis.openList();\n\t\t\t}\n\t\t\tif(this._isCloseListPending)\n\t\t\t{\n\t\t\t\tthis.closeList();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function focusInHandler(event:Event):void\n\t\t{\n\t\t\tsuper.focusInHandler(event);\n\t\t\tthis._buttonHasFocus = true;\n\t\t\tthis.button.dispatchEventWith(FeathersEventType.FOCUS_IN);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function focusOutHandler(event:Event):void\n\t\t{\n\t\t\tif(this._buttonHasFocus)\n\t\t\t{\n\t\t\t\tthis.button.dispatchEventWith(FeathersEventType.FOCUS_OUT);\n\t\t\t\tthis._buttonHasFocus = false;\n\t\t\t}\n\t\t\tsuper.focusOutHandler(event);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function childProperties_onChange(proxy:PropertyProxy, name:String):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function button_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(this._buttonTouchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(this.button, TouchPhase.ENDED, this._buttonTouchPointID);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._buttonTouchPointID = -1;\n\t\t\t\t//the button will dispatch Event.TRIGGERED before this touch\n\t\t\t\t//listener is called, so it is safe to clear this flag.\n\t\t\t\t//we're clearing it because Event.TRIGGERED may also be\n\t\t\t\t//dispatched after keyboard input.\n\t\t\t\tthis._listIsOpenOnTouchBegan = false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(this.button, TouchPhase.BEGAN);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._buttonTouchPointID = touch.id;\n\t\t\t\tthis._listIsOpenOnTouchBegan = this._popUpContentManager.isOpen;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function button_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tif(this._focusManager && this._listIsOpenOnTouchBegan)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._popUpContentManager.isOpen)\n\t\t\t{\n\t\t\t\tthis.closeList();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.openList();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function list_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreSelectionChanges ||\n\t\t\t\tthis._popUpContentManager is IPersistentPopUpContentManager)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.selectedIndex = this.list.selectedIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function popUpContentManager_openHandler(event:Event):void\n\t\t{\n\t\t\tif(this._toggleButtonOnOpenAndClose && this.button is IToggle)\n\t\t\t{\n\t\t\t\tIToggle(this.button).isSelected = true;\n\t\t\t}\n\t\t\tthis.list.revealScrollBars();\n\t\t\tthis.dispatchEventWith(Event.OPEN);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function popUpContentManager_closeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._popUpContentManager is IPersistentPopUpContentManager)\n\t\t\t{\n\t\t\t\tthis.selectedIndex = this.list.selectedIndex;\n\t\t\t}\n\t\t\tif(this._toggleButtonOnOpenAndClose && this.button is IToggle)\n\t\t\t{\n\t\t\t\tIToggle(this.button).isSelected = false;\n\t\t\t}\n\t\t\tthis.dispatchEventWith(Event.CLOSE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function list_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tif(this._focusManager)\n\t\t\t{\n\t\t\t\tthis.list.stage.removeEventListener(KeyboardEvent.KEY_UP, stage_keyUpHandler);\n\t\t\t\tthis.list.removeEventListener(FeathersEventType.FOCUS_OUT, list_focusOutHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function list_focusOutHandler(event:Event):void\n\t\t{\n\t\t\tif(!this._popUpContentManager.isOpen)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.closeList();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function list_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tif(!this._isEnabled ||\n\t\t\t\tthis._popUpContentManager is IPersistentPopUpContentManager)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._triggered = true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function list_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tvar touch:Touch = event.getTouch(this.list);\n\t\t\tif(touch === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(touch.phase === TouchPhase.BEGAN)\n\t\t\t{\n\t\t\t\tthis._triggered = false;\n\t\t\t}\n\t\t\tif(touch.phase === TouchPhase.ENDED && this._triggered)\n\t\t\t{\n\t\t\t\tthis.closeList();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_multipleEventHandler(event:Event):void\n\t\t{\n\t\t\t//we need to ensure that the pop-up list has received the new\n\t\t\t//selected index, or it might update the selected index to an\n\t\t\t//incorrect value after an item is added, removed, or replaced.\n\t\t\tthis.validate();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_updateItemHandler(event:Event, index:int):void\n\t\t{\n\t\t\tif(index == this._selectedIndex)\n\t\t\t{\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_keyUpHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(!this._popUpContentManager.isOpen)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(event.keyCode == Keyboard.ENTER)\n\t\t\t{\n\t\t\t\tthis.closeList();\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/controls/ProgressBar.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IMeasureDisplayObject;\n\timport feathers.core.IValidating;\n\timport feathers.layout.Direction;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.utils.math.clamp;\n\timport feathers.utils.skins.resetFluidChildDimensionsForMeasurement;\n\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * The primary background to display in the progress bar. The background\n\t * skin is displayed below the fill skin, and the fill skin is affected\n\t * by the padding, and the background skin may be seen around the edges.\n\t *\n\t * <p>The original width or height of the background skin will be one\n\t * of the values used to calculate the width or height of the progress\n\t * bar, if the <code>width</code> and <code>height</code> properties are\n\t * not set explicitly. The fill skin and padding values will also be\n\t * used.</p>\n\t *\n\t * <p>If the background skin is a Feathers component, the\n\t * <code>minWidth</code> or <code>minHeight</code> properties will be\n\t * one of the values used to calculate the width or height of the\n\t * progress bar. If the background skin is a regular Starling display\n\t * object, the original width and height of the display object will be\n\t * used to calculate the minimum dimensions instead.</p>\n\t *\n\t * <p>In the following example, the progress bar is given a background\n\t * skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * progress.backgroundSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:backgroundDisabledSkin\n\t * @see #style:fillSkin\n\t */\n\t[Style(name=\"backgroundSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * A background to display when the progress bar is disabled.\n\t *\n\t * <p>In the following example, the progress bar is given a disabled\n\t * background skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * progress.backgroundDisabledSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:backgroundSkin\n\t * @see #style:fillDisabledSkin\n\t */\n\t[Style(name=\"backgroundDisabledSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * Determines the direction that the progress bar fills. When this value\n\t * changes, the progress bar's width and height values do not change\n\t * automatically.\n\t *\n\t * <p>In the following example, the direction is set to vertical:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * progress.direction = Direction.VERTICAL;</listing>\n\t *\n\t * <p><strong>Note:</strong> The <code>Direction.NONE</code>\n\t * constant is not supported.</p>\n\t *\n\t * @default feathers.layout.Direction.HORIZONTAL\n\t *\n\t * @see feathers.layout.Direction#HORIZONTAL\n\t * @see feathers.layout.Direction#VERTICAL\n\t */\n\t[Style(name=\"direction\",type=\"String\")]\n\n\t/**\n\t * The primary fill to display in the progress bar. The fill skin is\n\t * displayed over the background skin, with padding around the edges of\n\t * the fill skin to reveal the background skin behind.\n\t *\n\t * <p>Note: The size of the <code>fillSkin</code>, at the time that it\n\t * is passed to the setter, will be used used as the size of the fill\n\t * when the progress bar is set to the minimum value. In other words,\n\t * if the fill of a horizontal progress bar with a value from 0 to 100\n\t * should be virtually invisible when the value is 0, then the\n\t * <code>fillSkin</code> should have a width of 0 when you pass it in.\n\t * On the other hand, if you're using an <code>Image</code> with a\n\t * <code>scale9Grid</code> as the skin, it may require a minimum width\n\t * before the image parts begin to overlap. In that case, the\n\t * <code>Image</code> instance passed to the <code>fillSkin</code>\n\t * setter should have a <code>width</code> value that is the same as\n\t * that minimum width value where the image parts do not overlap.</p>\n\t *\n\t * <p>In the following example, the progress bar is given a fill\n\t * skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * progress.fillSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:fillDisabledSkin\n\t * @see #style:backgroundSkin\n\t */\n\t[Style(name=\"fillSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * A fill to display when the progress bar is disabled.\n\t *\n\t * <p>In the following example, the progress bar is given a disabled fill\n\t * skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * progress.fillDisabledSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:fillSkin\n\t * @see #style:backgroundDisabledSkin\n\t */\n\t[Style(name=\"fillDisabledSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * Quickly sets all padding properties to the same value. The\n\t * <code>padding</code> getter always returns the value of\n\t * <code>paddingTop</code>, but the other padding values may be\n\t * different.\n\t *\n\t * <p>In the following example, the padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * progress.padding = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:paddingTop\n\t * @see #style:paddingRight\n\t * @see #style:paddingBottom\n\t * @see #style:paddingLeft\n\t */\n\t[Style(name=\"padding\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the progress bar's top edge and\n\t * the progress bar's content.\n\t *\n\t * <p>In the following example, the top padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * progress.paddingTop = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingTop\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the progress bar's right edge\n\t * and the progress bar's content.\n\t *\n\t * <p>In the following example, the right padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * progress.paddingRight = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingRight\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the progress bar's bottom edge\n\t * and the progress bar's content.\n\t *\n\t * <p>In the following example, the bottom padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * progress.paddingBottom = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingBottom\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the progress bar's left edge\n\t * and the progress bar's content.\n\t *\n\t * <p>In the following example, the left padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * progress.paddingLeft = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingLeft\",type=\"Number\")]\n\n\t/**\n\t * Displays the progress of a task over time. Non-interactive.\n\t *\n\t * <p>The following example creates a progress bar:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var progress:ProgressBar = new ProgressBar();\n\t * progress.minimum = 0;\n\t * progress.maximum = 100;\n\t * progress.value = 20;\n\t * this.addChild( progress );</listing>\n\t *\n\t * @see ../../../help/progress-bar.html How to use the Feathers ProgressBar component\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class ProgressBar extends FeathersControl\n\t{\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>ProgressBar</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function ProgressBar()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn ProgressBar.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _direction:String = Direction.HORIZONTAL;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"horizontal,vertical\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get direction():String\n\t\t{\n\t\t\treturn this._direction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set direction(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._direction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._direction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _value:Number = 0;\n\n\t\t/**\n\t\t * The value of the progress bar, between the minimum and maximum.\n\t\t *\n\t\t * <p>In the following example, the value is set to 12:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * progress.minimum = 0;\n\t\t * progress.maximum = 100;\n\t\t * progress.value = 12;</listing>\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #minimum\n\t\t * @see #maximum\n\t\t */\n\t\tpublic function get value():Number\n\t\t{\n\t\t\treturn this._value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set value(newValue:Number):void\n\t\t{\n\t\t\tnewValue = clamp(newValue, this._minimum, this._maximum);\n\t\t\tif(this._value == newValue)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._value = newValue;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimum:Number = 0;\n\n\t\t/**\n\t\t * The progress bar's value will not go lower than the minimum.\n\t\t *\n\t\t * <p>In the following example, the minimum is set to 0:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * progress.minimum = 0;\n\t\t * progress.maximum = 100;\n\t\t * progress.value = 12;</listing>\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #value\n\t\t * @see #maximum\n\t\t */\n\t\tpublic function get minimum():Number\n\t\t{\n\t\t\treturn this._minimum;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minimum(value:Number):void\n\t\t{\n\t\t\tif(this._minimum == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._minimum = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maximum:Number = 1;\n\n\t\t/**\n\t\t * The progress bar's value will not go higher than the maximum.\n\t\t *\n\t\t * <p>In the following example, the maximum is set to 100:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * progress.minimum = 0;\n\t\t * progress.maximum = 100;\n\t\t * progress.value = 12;</listing>\n\t\t *\n\t\t * @default 1\n\t\t *\n\t\t * @see #value\n\t\t * @see #minimum\n\t\t */\n\t\tpublic function get maximum():Number\n\t\t{\n\t\t\treturn this._maximum;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maximum(value:Number):void\n\t\t{\n\t\t\tif(this._maximum == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._maximum = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMaxWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMaxHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var currentBackground:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _backgroundSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundSkin():DisplayObject\n\t\t{\n\t\t\treturn this._backgroundSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSkin !== null &&\n\t\t\t\tthis.currentBackground === this._backgroundSkin)\n\t\t\t{\n\t\t\t\tthis.removeCurrentBackground(this._backgroundSkin);\n\t\t\t\tthis.currentBackground = null;\n\t\t\t}\n\t\t\tthis._backgroundSkin = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _backgroundDisabledSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundDisabledSkin():DisplayObject\n\t\t{\n\t\t\treturn this._backgroundDisabledSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundDisabledSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundDisabledSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundDisabledSkin !== null &&\n\t\t\t\tthis.currentBackground === this._backgroundDisabledSkin)\n\t\t\t{\n\t\t\t\tthis.removeCurrentBackground(this._backgroundDisabledSkin);\n\t\t\t\tthis.currentBackground = null;\n\t\t\t}\n\t\t\tthis._backgroundDisabledSkin = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * The width of the first fill skin that was displayed.\n\t\t */\n\t\tprotected var _originalFillWidth:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t * The width of the first fill skin that was displayed.\n\t\t */\n\t\tprotected var _originalFillHeight:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var currentFill:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fillSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get fillSkin():DisplayObject\n\t\t{\n\t\t\treturn this._fillSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set fillSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._fillSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._fillSkin && this._fillSkin != this._fillDisabledSkin)\n\t\t\t{\n\t\t\t\tthis.removeChild(this._fillSkin);\n\t\t\t}\n\t\t\tthis._fillSkin = value;\n\t\t\tif(this._fillSkin && this._fillSkin.parent != this)\n\t\t\t{\n\t\t\t\tthis._fillSkin.visible = false;\n\t\t\t\tthis.addChild(this._fillSkin);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fillDisabledSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get fillDisabledSkin():DisplayObject\n\t\t{\n\t\t\treturn this._fillDisabledSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set fillDisabledSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._fillDisabledSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._fillDisabledSkin && this._fillDisabledSkin != this._fillSkin)\n\t\t\t{\n\t\t\t\tthis.removeChild(this._fillDisabledSkin);\n\t\t\t}\n\t\t\tthis._fillDisabledSkin = value;\n\t\t\tif(this._fillDisabledSkin && this._fillDisabledSkin.parent != this)\n\t\t\t{\n\t\t\t\tthis._fillDisabledSkin.visible = false;\n\t\t\t\tthis.addChild(this._fillDisabledSkin);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get padding():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set padding(value:Number):void\n\t\t{\n\t\t\tthis.paddingTop = value;\n\t\t\tthis.paddingRight = value;\n\t\t\tthis.paddingBottom = value;\n\t\t\tthis.paddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingTop:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingTop():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingTop(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingTop = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingRight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingRight():Number\n\t\t{\n\t\t\treturn this._paddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingRight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingBottom:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingBottom():Number\n\t\t{\n\t\t\treturn this._paddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingBottom = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingLeft:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingLeft = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//we don't dispose it if the label is the parent because it'll\n\t\t\t//already get disposed in super.dispose()\n\t\t\tif(this._backgroundSkin !== null &&\n\t\t\t\tthis._backgroundSkin.parent !== this)\n\t\t\t{\n\t\t\t\tthis._backgroundSkin.dispose();\n\t\t\t}\n\t\t\tif(this._backgroundDisabledSkin !== null &&\n\t\t\t\tthis._backgroundDisabledSkin.parent !== this)\n\t\t\t{\n\t\t\t\tthis._backgroundDisabledSkin.dispose();\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\n\t\t\tif(stylesInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshBackground();\n\t\t\t\tthis.refreshFill();\n\t\t\t}\n\n\t\t\tthis.autoSizeIfNeeded();\n\n\t\t\tthis.layoutChildren();\n\n\t\t\tif(this.currentBackground is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.currentBackground).validate();\n\t\t\t}\n\t\t\tif(this.currentFill is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.currentFill).validate();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * If the component's dimensions have not been set explicitly, it will\n\t\t * measure its content and determine an ideal size for itself. If the\n\t\t * <code>explicitWidth</code> or <code>explicitHeight</code> member\n\t\t * variables are set, those value will be used without additional\n\t\t * measurement. If one is set, but not the other, the dimension with the\n\t\t * explicit value will not be measured, but the other non-explicit\n\t\t * dimension will still need measurement.\n\t\t *\n\t\t * <p>Calls <code>saveMeasurements()</code> to set up the\n\t\t * <code>actualWidth</code> and <code>actualHeight</code> member\n\t\t * variables used for layout.</p>\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t */\n\t\tprotected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvar measureBackground:IMeasureDisplayObject = this.currentBackground as IMeasureDisplayObject;\n\t\t\tresetFluidChildDimensionsForMeasurement(this.currentBackground,\n\t\t\t\tthis._explicitWidth, this._explicitHeight,\n\t\t\t\tthis._explicitMinWidth, this._explicitMinHeight,\n\t\t\t\tthis._explicitMaxWidth, this._explicitMaxHeight,\n\t\t\t\tthis._explicitBackgroundWidth, this._explicitBackgroundHeight,\n\t\t\t\tthis._explicitBackgroundMinWidth, this._explicitBackgroundMinHeight,\n\t\t\t\tthis._explicitBackgroundMaxWidth, this._explicitBackgroundMaxHeight);\n\t\t\tif(this.currentBackground is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.currentBackground).validate();\n\t\t\t}\n\t\t\tif(this.currentFill is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.currentFill).validate();\n\t\t\t}\n\n\t\t\t//minimum dimensions\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tif(measureBackground !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = measureBackground.minWidth;\n\t\t\t\t}\n\t\t\t\telse if(this.currentBackground !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = this._explicitBackgroundMinWidth;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = 0;\n\t\t\t\t}\n\t\t\t\tvar fillMinWidth:Number = this._originalFillWidth;\n\t\t\t\tif(this.currentFill is IFeathersControl)\n\t\t\t\t{\n\t\t\t\t\tfillMinWidth = IFeathersControl(this.currentFill).minWidth;\n\t\t\t\t}\n\t\t\t\tfillMinWidth += this._paddingLeft + this._paddingRight;\n\t\t\t\tif(fillMinWidth > newMinWidth)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = fillMinWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tif(measureBackground !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = measureBackground.minHeight;\n\t\t\t\t}\n\t\t\t\telse if(this.currentBackground !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = this._explicitBackgroundMinHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = 0;\n\t\t\t\t}\n\t\t\t\tvar fillMinHeight:Number = this._originalFillHeight;\n\t\t\t\tif(this.currentFill is IFeathersControl)\n\t\t\t\t{\n\t\t\t\t\tfillMinHeight = IFeathersControl(this.currentFill).minHeight;\n\t\t\t\t}\n\t\t\t\tfillMinHeight += this._paddingTop + this._paddingBottom;\n\t\t\t\tif(fillMinHeight > newMinHeight)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = fillMinHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//current dimensions\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tif(this.currentBackground !== null)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this.currentBackground.width;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewWidth = 0;\n\t\t\t\t}\n\t\t\t\tvar fillWidth:Number = this._originalFillWidth + this._paddingLeft + this._paddingRight;\n\t\t\t\tif(fillWidth > newWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = fillWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tif(this.currentBackground !== null)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this.currentBackground.height;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewHeight = 0;\n\t\t\t\t}\n\t\t\t\tvar fillHeight:Number = this._originalFillHeight + this._paddingTop + this._paddingBottom;\n\t\t\t\tif(fillHeight > newHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = fillHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshBackground():void\n\t\t{\n\t\t\tvar oldBackground:DisplayObject = this.currentBackground;\n\t\t\tthis.currentBackground = this._backgroundSkin;\n\t\t\tif(!this._isEnabled && this._backgroundDisabledSkin !== null)\n\t\t\t{\n\t\t\t\tthis.currentBackground = this._backgroundDisabledSkin;\n\t\t\t}\n\t\t\tif(oldBackground !== this.currentBackground)\n\t\t\t{\n\t\t\t\tthis.removeCurrentBackground(oldBackground);\n\t\t\t\tif(this.currentBackground !== null)\n\t\t\t\t{\n\t\t\t\t\tif(this.currentBackground is IFeathersControl)\n\t\t\t\t\t{\n\t\t\t\t\t\tIFeathersControl(this.currentBackground).initializeNow();\n\t\t\t\t\t}\n\t\t\t\t\tif(this.currentBackground is IMeasureDisplayObject)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar measureSkin:IMeasureDisplayObject = IMeasureDisplayObject(this.currentBackground);\n\t\t\t\t\t\tthis._explicitBackgroundWidth = measureSkin.explicitWidth;\n\t\t\t\t\t\tthis._explicitBackgroundHeight = measureSkin.explicitHeight;\n\t\t\t\t\t\tthis._explicitBackgroundMinWidth = measureSkin.explicitMinWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMinHeight = measureSkin.explicitMinHeight;\n\t\t\t\t\t\tthis._explicitBackgroundMaxWidth = measureSkin.explicitMaxWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMaxHeight = measureSkin.explicitMaxHeight;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._explicitBackgroundWidth = this.currentBackground.width;\n\t\t\t\t\t\tthis._explicitBackgroundHeight = this.currentBackground.height;\n\t\t\t\t\t\tthis._explicitBackgroundMinWidth = this._explicitBackgroundWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMinHeight = this._explicitBackgroundHeight;\n\t\t\t\t\t\tthis._explicitBackgroundMaxWidth = this._explicitBackgroundWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMaxHeight = this._explicitBackgroundHeight;\n\t\t\t\t\t}\n\t\t\t\t\tthis.addChildAt(this.currentBackground, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function removeCurrentBackground(skin:DisplayObject):void\n\t\t{\n\t\t\tif(skin === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(skin.parent === this)\n\t\t\t{\n\t\t\t\t//we need to restore these values so that they won't be lost the\n\t\t\t\t//next time that this skin is used for measurement\n\t\t\t\tskin.width = this._explicitBackgroundWidth;\n\t\t\t\tskin.height = this._explicitBackgroundHeight;\n\t\t\t\tif(skin is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar measureSkin:IMeasureDisplayObject = IMeasureDisplayObject(skin);\n\t\t\t\t\tmeasureSkin.minWidth = this._explicitBackgroundMinWidth;\n\t\t\t\t\tmeasureSkin.minHeight = this._explicitBackgroundMinHeight;\n\t\t\t\t\tmeasureSkin.maxWidth = this._explicitBackgroundMaxWidth;\n\t\t\t\t\tmeasureSkin.maxHeight = this._explicitBackgroundMaxHeight;\n\t\t\t\t}\n\t\t\t\tskin.removeFromParent(false);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshFill():void\n\t\t{\n\t\t\tthis.currentFill = this._fillSkin;\n\t\t\tif(this._fillDisabledSkin)\n\t\t\t{\n\t\t\t\tif(this._isEnabled)\n\t\t\t\t{\n\t\t\t\t\tthis._fillDisabledSkin.visible = false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.currentFill = this._fillDisabledSkin;\n\t\t\t\t\tif(this._backgroundSkin)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._fillSkin.visible = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this.currentFill)\n\t\t\t{\n\t\t\t\tif(this.currentFill is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this.currentFill).validate();\n\t\t\t\t}\n\t\t\t\tif(this._originalFillWidth !== this._originalFillWidth) //isNaN\n\t\t\t\t{\n\t\t\t\t\tthis._originalFillWidth = this.currentFill.width;\n\t\t\t\t}\n\t\t\t\tif(this._originalFillHeight !== this._originalFillHeight) //isNaN\n\t\t\t\t{\n\t\t\t\t\tthis._originalFillHeight = this.currentFill.height;\n\t\t\t\t}\n\t\t\t\tthis.currentFill.visible = true;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutChildren():void\n\t\t{\n\t\t\tif(this.currentBackground !== null)\n\t\t\t{\n\t\t\t\tthis.currentBackground.width = this.actualWidth;\n\t\t\t\tthis.currentBackground.height = this.actualHeight;\n\t\t\t}\n\n\t\t\tif(this._minimum == this._maximum)\n\t\t\t{\n\t\t\t\tvar percentage:Number = 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpercentage = (this._value - this._minimum) / (this._maximum - this._minimum);\n\t\t\t\tif(percentage < 0)\n\t\t\t\t{\n\t\t\t\t\tpercentage = 0;\n\t\t\t\t}\n\t\t\t\telse if(percentage > 1)\n\t\t\t\t{\n\t\t\t\t\tpercentage = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._direction === Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tvar calculatedHeight:Number = Math.round(percentage * (this.actualHeight - this._paddingTop - this._paddingBottom));\n\t\t\t\tif(calculatedHeight < this._originalFillHeight)\n\t\t\t\t{\n\t\t\t\t\tcalculatedHeight = this._originalFillHeight;\n\t\t\t\t\t//if the size is too small, and the value is equal to the\n\t\t\t\t\t//minimum, people don't expect to see the fill\n\t\t\t\t\tthis.currentFill.visible = this._value > this._minimum;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//if it was hidden before, we want to show it again\n\t\t\t\t\tthis.currentFill.visible = true;\n\t\t\t\t}\n\t\t\t\tthis.currentFill.width = this.actualWidth - this._paddingLeft - this._paddingRight;\n\t\t\t\tthis.currentFill.height = calculatedHeight;\n\t\t\t\tthis.currentFill.x = this._paddingLeft;\n\t\t\t\tthis.currentFill.y = this.actualHeight - this._paddingBottom - this.currentFill.height;\n\t\t\t}\n\t\t\telse //horizontal\n\t\t\t{\n\t\t\t\tvar calculatedWidth:Number = Math.round(percentage * (this.actualWidth - this._paddingLeft - this._paddingRight));\n\t\t\t\tif(calculatedWidth < this._originalFillWidth)\n\t\t\t\t{\n\t\t\t\t\tcalculatedWidth = this._originalFillWidth;\n\t\t\t\t\t//if the size is too small, and the value is equal to the\n\t\t\t\t\t//minimum, people don't expect to see the fill\n\t\t\t\t\tthis.currentFill.visible = this._value > this._minimum;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//if it was hidden before, we want to show it again\n\t\t\t\t\tthis.currentFill.visible = true;\n\t\t\t\t}\n\t\t\t\tthis.currentFill.width = calculatedWidth;\n\t\t\t\tthis.currentFill.height = this.actualHeight - this._paddingTop - this._paddingBottom;\n\t\t\t\tthis.currentFill.x = this._paddingLeft;\n\t\t\t\tthis.currentFill.y = this._paddingTop;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/PullViewDisplayMode.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\t/**\n\t * Constants that define how pull views are displayed in a container.\n\t *\n\t * @productversion Feathers 3.2.0\n\t */\n\tpublic class PullViewDisplayMode\n\t{\n\t\t/**\n\t\t * The pull view is fixed to the edge of the the scroller's view port.\n\t\t * If <code>hasElasticEdges</code> is <code>true</code>, the pull view\n\t\t * will be revealed under the scroller's content. If\n\t\t * <code>hasElasticEdges</code> is <code>false</code>, the pull view\n\t\t * will fade in above the scroller's content.\n\t\t *\n\t\t * @productversion Feathers 3.2.0\n\t\t */\n\t\tpublic static const FIXED:String = \"fixed\";\n\n\t\t/**\n\t\t * The pull view may be dragged with the scroller's content. If\n\t\t * <code>hasElasticEdges</code> is <code>false</code>, and the scroll\n\t\t * position reaches the minimum or maximum, the pull view may be dragged\n\t\t * while the content remains fixed.\n\t\t *\n\t\t * @productversion Feathers 3.2.0\n\t\t */\n\t\tpublic static const DRAG:String = \"drag\";\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/Radio.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.core.IGroupedToggle;\n\timport feathers.core.ToggleGroup;\n\timport feathers.skins.IStyleProvider;\n\n\timport flash.errors.IllegalOperationError;\n\n\timport starling.events.Event;\n\n\t[Exclude(name=\"isToggle\",kind=\"property\")]\n\n\t/**\n\t * A toggleable control that exists in a set that requires a single,\n\t * exclusive toggled item.\n\t *\n\t * <p>In the following example, a set of radios are created, along with a\n\t * toggle group to group them together:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var group:ToggleGroup = new ToggleGroup();\n\t * group.addEventListener( Event.CHANGE, group_changeHandler );\n\t * \n\t * var radio1:Radio = new Radio();\n\t * radio1.label = \"One\";\n\t * radio1.toggleGroup = group;\n\t * this.addChild( radio1 );\n\t * \n\t * var radio2:Radio = new Radio();\n\t * radio2.label = \"Two\";\n\t * radio2.toggleGroup = group;\n\t * this.addChild( radio2 );\n\t * \n\t * var radio3:Radio = new Radio();\n\t * radio3.label = \"Three\";\n\t * radio3.toggleGroup = group;\n\t * this.addChild( radio3 );</listing>\n\t *\n\t * @see ../../../help/radio.html How to use the Feathers Radio component\n\t * @see feathers.core.ToggleGroup\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class Radio extends ToggleButton implements IGroupedToggle\n\t{\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the label.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_LABEL:String = \"feathers-radio-label\";\n\n\t\t/**\n\t\t * If a <code>Radio</code> has not been added to a <code>ToggleGroup</code>,\n\t\t * it will automatically be added to this group. If the Radio's\n\t\t * <code>toggleGroup</code> property is set to a different group, it\n\t\t * will be automatically removed from this group, if required.\n\t\t */\n\t\tpublic static const defaultRadioGroup:ToggleGroup = new ToggleGroup();\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>Radio</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function Radio()\n\t\t{\n\t\t\tsuper();\n\t\t\tsuper.isToggle = true;\n\t\t\tthis.labelStyleName = DEFAULT_CHILD_STYLE_NAME_LABEL;\n\t\t\tthis.addEventListener(Event.ADDED_TO_STAGE, radio_addedToStageHandler);\n\t\t\tthis.addEventListener(Event.REMOVED_FROM_STAGE, radio_removedFromStageHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn Radio.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set isToggle(value:Boolean):void\n\t\t{\n\t\t\tthrow IllegalOperationError(\"Radio isToggle must always be true.\");\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set toggleGroup(value:ToggleGroup):void\n\t\t{\n\t\t\tif(this._toggleGroup === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//a null toggle group will automatically add it to\n\t\t\t//defaultRadioGroup. however, if toggleGroup is already\n\t\t\t//defaultRadioGroup, then we really want to use null because\n\t\t\t//otherwise we'd remove the radio from defaultRadioGroup and then\n\t\t\t//immediately add it back because ToggleGroup sets the toggleGroup\n\t\t\t//property to null when removing an item.\n\t\t\tif(!value && this._toggleGroup !== defaultRadioGroup && this.stage)\n\t\t\t{\n\t\t\t\tvalue = defaultRadioGroup;\n\t\t\t}\n\t\t\tsuper.toggleGroup = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function radio_addedToStageHandler(event:Event):void\n\t\t{\n\t\t\tif(!this._toggleGroup)\n\t\t\t{\n\t\t\t\tthis.toggleGroup = defaultRadioGroup;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function radio_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tif(this._toggleGroup == defaultRadioGroup)\n\t\t\t{\n\t\t\t\tthis._toggleGroup.removeItem(this);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/Screen.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.skins.IStyleProvider;\n\timport feathers.utils.display.getDisplayObjectDepthFromStage;\n\n\timport flash.events.KeyboardEvent;\n\timport flash.ui.Keyboard;\n\n\timport starling.events.Event;\n\n\t/**\n\t * Dispatched when the transition animation begins as the screen is shown\n\t * by the screen navigator.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.TRANSITION_IN_START\n\t */\n\t[Event(name=\"transitionInStart\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the transition animation finishes as the screen is shown\n\t * by the screen navigator.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.TRANSITION_IN_COMPLETE\n\t */\n\t[Event(name=\"transitionInComplete\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the transition animation begins as a different screen is\n\t * shown by the screen navigator and this screen is hidden.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.TRANSITION_OUT_START\n\t */\n\t[Event(name=\"transitionOutStart\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the transition animation finishes as a different screen\n\t * is shown by the screen navigator and this screen is hidden.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.TRANSITION_OUT_COMPLETE\n\t */\n\t[Event(name=\"transitionOutComplete\",type=\"starling.events.Event\")]\n\n\t/**\n\t * A basic screen to be displayed by <code>ScreenNavigator</code>. Provides\n\t * layout capabilities, but no scrolling.\n\t *\n\t * <p>The following example provides a basic framework for a new screen:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * package\n\t * {\n\t *     import feathers.controls.Screen;\n\t * \n\t *     public class CustomScreen extends Screen\n\t *     {\n\t *         public function CustomScreen()\n\t *         {\n\t *             super();\n\t *         }\n\t * \n\t *         override protected function initialize():void\n\t *         {\n\t *             //runs once when screen is first added to the stage\n\t *             //a good place to add children and customize the layout\n\t * \n\t *             //don't forget to call this!\n\t *             super.initialize()\n\t *         }\n\t *     }\n\t * }</listing>\n\t *\n\t * @see ../../../help/screen.html How to use the Feathers Screen component\n\t * @see feathers.controls.StackScreenNavigator\n\t * @see feathers.controls.ScreenNavigator\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class Screen extends LayoutGroup implements IScreen\n\t{\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>Screen</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function Screen()\n\t\t{\n\t\t\tthis.addEventListener(Event.ADDED_TO_STAGE, screen_addedToStageHandler);\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn Screen.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _screenID:String;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get screenID():String\n\t\t{\n\t\t\treturn this._screenID;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set screenID(value:String):void\n\t\t{\n\t\t\tthis._screenID = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _owner:Object;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get owner():Object\n\t\t{\n\t\t\treturn this._owner;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set owner(value:Object):void\n\t\t{\n\t\t\tthis._owner = value;\n\t\t}\n\n\t\t/**\n\t\t * Optional callback for the back hardware key. Automatically handles\n\t\t * keyboard events to cancel the default behavior.\n\t\t *\n\t\t * <p>This function has the following signature:</p>\n\t\t *\n\t\t * <pre>function():void</pre>\n\t\t *\n\t\t * <p>In the following example, a function will dispatch <code>Event.COMPLETE</code>\n\t\t * when the back button is pressed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * this.backButtonHandler = onBackButton;\n\t\t * \n\t\t * private function onBackButton():void\n\t\t * {\n\t\t *     this.dispatchEvent( Event.COMPLETE );\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tprotected var backButtonHandler:Function;\n\n\t\t/**\n\t\t * Optional callback for the menu hardware key. Automatically handles\n\t\t * keyboard events to cancel the default behavior.\n\t\t *\n\t\t * <p>This function has the following signature:</p>\n\t\t *\n\t\t * <pre>function():void</pre>\n\t\t *\n\t\t * <p>In the following example, a function will be called when the menu\n\t\t * button is pressed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * this.menuButtonHandler = onMenuButton;\n\t\t * \n\t\t * private function onMenuButton():void\n\t\t * {\n\t\t *     //do something with the menu button\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tprotected var menuButtonHandler:Function;\n\n\t\t/**\n\t\t * Optional callback for the search hardware key. Automatically handles\n\t\t * keyboard events to cancel the default behavior.\n\t\t *\n\t\t * <p>This function has the following signature:</p>\n\t\t *\n\t\t * <pre>function():void</pre>\n\t\t *\n\t\t * <p>In the following example, a function will be called when the search\n\t\t * button is pressed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * this.searchButtonHandler = onSearchButton;\n\t\t * \n\t\t * private function onSearchButton():void\n\t\t * {\n\t\t *     //do something with the search button\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tprotected var searchButtonHandler:Function;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function screen_addedToStageHandler(event:Event):void\n\t\t{\n\t\t\tif(event.target != this)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.addEventListener(Event.REMOVED_FROM_STAGE, screen_removedFromStageHandler);\n\t\t\t//using priority here is a hack so that objects higher up in the\n\t\t\t//display list have a chance to cancel the event first.\n\t\t\tvar priority:int = -getDisplayObjectDepthFromStage(this);\n\t\t\tthis.stage.starling.nativeStage.addEventListener(KeyboardEvent.KEY_DOWN, screen_nativeStage_keyDownHandler, false, priority, true);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function screen_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tif(event.target != this)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.removeEventListener(Event.REMOVED_FROM_STAGE, screen_removedFromStageHandler);\n\t\t\tthis.stage.starling.nativeStage.removeEventListener(KeyboardEvent.KEY_DOWN, screen_nativeStage_keyDownHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function screen_nativeStage_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(event.isDefaultPrevented())\n\t\t\t{\n\t\t\t\t//someone else already handled this one\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this.backButtonHandler != null &&\n\t\t\t\tevent.keyCode == Keyboard.BACK)\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.backButtonHandler();\n\t\t\t}\n\n\t\t\tif(this.menuButtonHandler != null &&\n\t\t\t\tevent.keyCode == Keyboard.MENU)\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.menuButtonHandler();\n\t\t\t}\n\n\t\t\tif(this.searchButtonHandler != null &&\n\t\t\t\tevent.keyCode == Keyboard.SEARCH)\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.searchButtonHandler();\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/controls/ScreenNavigator.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.controls.supportClasses.BaseScreenNavigator;\n\timport feathers.events.FeathersEventType;\n\timport feathers.skins.IStyleProvider;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t/**\n\t * Typically used to provide some kind of animation or visual effect,\n\t * this function is called when a new screen is shown.\n\t *\n\t * <p>In the following example, the screen navigator is given a\n\t * transition that fades in the new screen on top of the old screen:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * navigator.transition = Fade.createFadeInTransition();</listing>\n\t *\n\t * <p>A number of animated transitions may be found in the\n\t * <a href=\"../motion/package-detail.html\">feathers.motion</a> package.\n\t * However, you are not limited to only these transitions. It's possible\n\t * to create custom transitions too.</p>\n\t *\n\t * <p>A custom transition function should have the following signature:</p>\n\t * <pre>function(oldScreen:DisplayObject, newScreen:DisplayObject, completeCallback:Function):void</pre>\n\t *\n\t * <p>Either of the <code>oldScreen</code> and <code>newScreen</code>\n\t * arguments may be <code>null</code>, but never both. The\n\t * <code>oldScreen</code> argument will be <code>null</code> when the\n\t * first screen is displayed or when a new screen is displayed after\n\t * clearing the screen. The <code>newScreen</code> argument will\n\t * be null when clearing the screen.</p>\n\t *\n\t * <p>The <code>completeCallback</code> function <em>must</em> be called\n\t * when the transition effect finishes.This callback indicate to the\n\t * screen navigator that the transition has finished. This function has\n\t * the following signature:</p>\n\t *\n\t * <pre>function(cancelTransition:Boolean = false):void</pre>\n\t *\n\t * <p>The first argument defaults to <code>false</code>, meaning that\n\t * the transition completed successfully. In most cases, this callback\n\t * may be called without arguments. If a transition is cancelled before\n\t * completion (perhaps through some kind of user interaction), and the\n\t * previous screen should be restored, pass <code>true</code> as the\n\t * first argument to the callback to inform the screen navigator that\n\t * the transition is cancelled.</p>\n\t *\n\t * @default null\n\t *\n\t * @see #showScreen()\n\t * @see #clearScreen()\n\t * @see ../../../help/transitions.html Transitions for Feathers screen navigators\n\t */\n\t[Style(name=\"transition\",type=\"Function\")]\n\n\t/**\n\t * A \"view stack\"-like container that supports navigation between screens\n\t * (any display object) through events.\n\t *\n\t * <p>The following example creates a screen navigator, adds a screen and\n\t * displays it:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var navigator:ScreenNavigator = new ScreenNavigator();\n\t * navigator.addScreen( \"mainMenu\", new ScreenNavigatorItem( MainMenuScreen ) );\n\t * this.addChild( navigator );\n\t * navigator.showScreen( \"mainMenu\" );</listing>\n\t *\n\t * @see ../../../help/screen-navigator.html How to use the Feathers ScreenNavigator component\n\t * @see ../../../help/transitions.html Transitions for Feathers screen navigators\n\t * @see feathers.controls.ScreenNavigatorItem\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class ScreenNavigator extends BaseScreenNavigator\n\t{\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>ScreenNavigator</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function ScreenNavigator()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn ScreenNavigator.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _transition:Function;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get transition():Function\n\t\t{\n\t\t\treturn this._transition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set transition(value:Function):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._transition = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _screenEvents:Object = {};\n\n\t\t/**\n\t\t * Registers a new screen with a string identifier that can be used\n\t\t * to reference the screen in other calls, like <code>removeScreen()</code>\n\t\t * or <code>showScreen()</code>.\n\t\t *\n\t\t * @see #removeScreen()\n\t\t */\n\t\tpublic function addScreen(id:String, item:ScreenNavigatorItem):void\n\t\t{\n\t\t\tthis.addScreenInternal(id, item);\n\t\t}\n\n\t\t/**\n\t\t * Removes an existing screen using the identifier assigned to it in the\n\t\t * call to <code>addScreen()</code>.\n\t\t *\n\t\t * @see #removeAllScreens()\n\t\t * @see #addScreen()\n\t\t */\n\t\tpublic function removeScreen(id:String):ScreenNavigatorItem\n\t\t{\n\t\t\treturn ScreenNavigatorItem(this.removeScreenInternal(id));\n\t\t}\n\n\t\t/**\n\t\t * Returns the <code>ScreenNavigatorItem</code> instance with the\n\t\t * specified identifier.\n\t\t */\n\t\tpublic function getScreen(id:String):ScreenNavigatorItem\n\t\t{\n\t\t\tif(this._screens.hasOwnProperty(id))\n\t\t\t{\n\t\t\t\treturn ScreenNavigatorItem(this._screens[id]);\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * Displays a screen and returns a reference to it. If a previous\n\t\t * transition is running, the new screen will be queued, and no\n\t\t * reference will be returned.\n\t\t *\n\t\t * <p>An optional transition may be specified. If <code>null</code> the\n\t\t * <code>transition</code> property will be used instead.</p>\n\t\t *\n\t\t * @see #style:transition\n\t\t */\n\t\tpublic function showScreen(id:String, transition:Function = null):DisplayObject\n\t\t{\n\t\t\tif(this._activeScreenID === id)\n\t\t\t{\n\t\t\t\treturn this._activeScreen;\n\t\t\t}\n\t\t\tif(transition === null)\n\t\t\t{\n\t\t\t\ttransition = this._transition;\n\t\t\t}\n\t\t\treturn this.showScreenInternal(id, transition);\n\t\t}\n\n\t\t/**\n\t\t * Removes the current screen, leaving the <code>ScreenNavigator</code>\n\t\t * empty.\n\t\t *\n\t\t * <p>An optional transition may be specified. If <code>null</code> the\n\t\t * <code>transition</code> property will be used instead.</p>\n\t\t *\n\t\t * @see #style:transition\n\t\t */\n\t\tpublic function clearScreen(transition:Function = null):void\n\t\t{\n\t\t\tif(transition == null)\n\t\t\t{\n\t\t\t\ttransition = this._transition;\n\t\t\t}\n\t\t\tthis.clearScreenInternal(transition);\n\t\t\tthis.dispatchEventWith(FeathersEventType.CLEAR);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function prepareActiveScreen():void\n\t\t{\n\t\t\tvar item:ScreenNavigatorItem = ScreenNavigatorItem(this._screens[this._activeScreenID]);\n\t\t\tvar events:Object = item.events;\n\t\t\tvar savedScreenEvents:Object = {};\n\t\t\tfor(var eventName:String in events)\n\t\t\t{\n\t\t\t\tvar signal:Object = null;\n\t\t\t\tif(BaseScreenNavigator.SIGNAL_TYPE !== null &&\n\t\t\t\t\tthis._activeScreen.hasOwnProperty(eventName))\n\t\t\t\t{\n\t\t\t\t\tsignal = this._activeScreen[eventName] as BaseScreenNavigator.SIGNAL_TYPE;\n\t\t\t\t}\n\t\t\t\tvar eventAction:Object = events[eventName];\n\t\t\t\tif(eventAction is Function)\n\t\t\t\t{\n\t\t\t\t\tif(signal)\n\t\t\t\t\t{\n\t\t\t\t\t\tsignal.add(eventAction as Function);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._activeScreen.addEventListener(eventName, eventAction as Function);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(eventAction is String)\n\t\t\t\t{\n\t\t\t\t\tif(signal)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar eventListener:Function = this.createShowScreenSignalListener(eventAction as String, signal);\n\t\t\t\t\t\tsignal.add(eventListener);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\teventListener = this.createShowScreenEventListener(eventAction as String);\n\t\t\t\t\t\tthis._activeScreen.addEventListener(eventName, eventListener);\n\t\t\t\t\t}\n\t\t\t\t\tsavedScreenEvents[eventName] = eventListener;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthrow new TypeError(\"Unknown event action defined for screen:\", eventAction.toString());\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._screenEvents[this._activeScreenID] = savedScreenEvents;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function cleanupActiveScreen():void\n\t\t{\n\t\t\tvar item:ScreenNavigatorItem = ScreenNavigatorItem(this._screens[this._activeScreenID]);\n\t\t\tvar events:Object = item.events;\n\t\t\tvar savedScreenEvents:Object = this._screenEvents[this._activeScreenID];\n\t\t\tfor(var eventName:String in events)\n\t\t\t{\n\t\t\t\tvar signal:Object = null;\n\t\t\t\tif(BaseScreenNavigator.SIGNAL_TYPE !== null &&\n\t\t\t\t\tthis._activeScreen.hasOwnProperty(eventName))\n\t\t\t\t{\n\t\t\t\t\tsignal = this._activeScreen[eventName] as BaseScreenNavigator.SIGNAL_TYPE;\n\t\t\t\t}\n\t\t\t\tvar eventAction:Object = events[eventName];\n\t\t\t\tif(eventAction is Function)\n\t\t\t\t{\n\t\t\t\t\tif(signal)\n\t\t\t\t\t{\n\t\t\t\t\t\tsignal.remove(eventAction as Function);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._activeScreen.removeEventListener(eventName, eventAction as Function);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(eventAction is String)\n\t\t\t\t{\n\t\t\t\t\tvar eventListener:Function = savedScreenEvents[eventName] as Function;\n\t\t\t\t\tif(signal)\n\t\t\t\t\t{\n\t\t\t\t\t\tsignal.remove(eventListener);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._activeScreen.removeEventListener(eventName, eventListener);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._screenEvents[this._activeScreenID] = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createShowScreenEventListener(screenID:String):Function\n\t\t{\n\t\t\tvar self:ScreenNavigator = this;\n\t\t\tvar eventListener:Function = function(event:Event):void\n\t\t\t{\n\t\t\t\tself.showScreen(screenID);\n\t\t\t};\n\n\t\t\treturn eventListener;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createShowScreenSignalListener(screenID:String, signal:Object):Function\n\t\t{\n\t\t\tvar self:ScreenNavigator = this;\n\t\t\tif(signal.valueClasses.length == 1)\n\t\t\t{\n\t\t\t\t//shortcut to avoid the allocation of the rest array\n\t\t\t\tvar signalListener:Function = function(arg0:Object):void\n\t\t\t\t{\n\t\t\t\t\tself.showScreen(screenID);\n\t\t\t\t};\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tsignalListener = function(...rest:Array):void\n\t\t\t\t{\n\t\t\t\t\tself.showScreen(screenID);\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn signalListener;\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "source/feathers/controls/ScreenNavigatorItem.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.controls.supportClasses.IScreenNavigatorItem;\n\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * Data for an individual screen that will be displayed by a\n\t * <code>ScreenNavigator</code> component.\n\t *\n\t * <p>The following example creates a new <code>ScreenNavigatorItem</code>\n\t * using the <code>SettingsScreen</code> class to instantiate the screen\n\t * instance. When the screen is shown, its <code>settings</code> property\n\t * will be set. When the screen instance dispatches\n\t * <code>Event.COMPLETE</code>, the <code>ScreenNavigator</code> will\n\t * navigate to a screen with the ID <code>\"mainMenu\"</code>.</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var settingsData:Object = { volume: 0.8, difficulty: \"hard\" };\n\t * var item:ScreenNavigatorItem = new ScreenNavigatorItem( SettingsScreen );\n\t * item.properties.settings = settingsData;\n\t * item.setScreenIDForEvent( Event.COMPLETE, \"mainMenu\" );\n\t * navigator.addScreen( \"settings\", item );</listing>\n\t *\n\t * @see ../../../help/screen-navigator.html How to use the Feathers ScreenNavigator component\n\t * @see feathers.controls.ScreenNavigator\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class ScreenNavigatorItem implements IScreenNavigatorItem\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function ScreenNavigatorItem(screen:Object = null, events:Object = null, properties:Object = null)\n\t\t{\n\t\t\tthis._screen = screen;\n\t\t\tthis._events = events ? events : {};\n\t\t\tthis._properties = properties ? properties : {};\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _screen:Object;\n\n\t\t/**\n\t\t * The screen to be displayed by the <code>ScreenNavigator</code>. It\n\t\t * may be one of several possible types:\n\t\t *\n\t\t * <ul>\n\t\t *     <li>a <code>Class</code> that may be instantiated to create a <code>DisplayObject</code></li>\n\t\t *     <li>a <code>Function</code> that returns a <code>DisplayObject</code></li>\n\t\t *     <li>a Starling <code>DisplayObject</code> that is already instantiated</li>\n\t\t * </ul>\n\t\t *\n\t\t * <p>If the screen is a <code>Class</code> or a <code>Function</code>,\n\t\t * a new instance of the screen will be instantiated every time that it\n\t\t * is shown by the <code>ScreenNavigator</code>. The screen's state\n\t\t * will not be saved automatically. The screen's state may be saved in\n\t\t * <code>properties</code>, if needed.</p>\n\t\t *\n\t\t * <p>If the screen is a <code>DisplayObject</code>, the same instance\n\t\t * will be reused every time that it is shown by the\n\t\t * <code>ScreenNavigator</code>. When the screen is shown again, its\n\t\t * state will remain the same as when it was previously hidden. However,\n\t\t * the screen will also be kept in memory even when it isn't visible,\n\t\t * limiting the resources that are available for other screens.</p>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get screen():Object\n\t\t{\n\t\t\treturn this._screen;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set screen(value:Object):void\n\t\t{\n\t\t\tthis._screen = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _events:Object;\n\n\t\t/**\n\t\t * A set of key-value pairs representing actions that should be\n\t\t * triggered when events are dispatched by the screen when it is shown.\n\t\t * A pair's key is the event type to listen for (or the property name of\n\t\t * an <code>ISignal</code> instance), and a pair's value is one of two\n\t\t * possible types. When this event is dispatched, and a pair's value\n\t\t * is a <code>String</code>, the <code>ScreenNavigator</code> will show\n\t\t * another screen with an ID equal to the string value. When this event\n\t\t * is dispatched, and the pair's value is a <code>Function</code>, the\n\t\t * function will be called as if it were a listener for the event.\n\t\t *\n\t\t * @see #setFunctionForEvent()\n\t\t * @see #setScreenIDForEvent()\n\t\t */\n\t\tpublic function get events():Object\n\t\t{\n\t\t\treturn this._events;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set events(value:Object):void\n\t\t{\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = {};\n\t\t\t}\n\t\t\tthis._events = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _properties:Object;\n\n\t\t/**\n\t\t * A set of key-value pairs representing properties to be set on the\n\t\t * screen when it is shown. A pair's key is the name of the screen's\n\t\t * property, and a pair's value is the value to be passed to the\n\t\t * screen's property.\n\t\t */\n\t\tpublic function get properties():Object\n\t\t{\n\t\t\treturn this._properties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set properties(value:Object):void\n\t\t{\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = {};\n\t\t\t}\n\t\t\tthis._properties = value;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get canDispose():Boolean\n\t\t{\n\t\t\treturn !(this._screen is DisplayObject);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _transitionDelayEvent:String = null;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get transitionDelayEvent():String\n\t\t{\n\t\t\treturn this._transitionDelayEvent;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set transitionDelayEvent(value:String):void\n\t\t{\n\t\t\tthis._transitionDelayEvent = value;\n\t\t}\n\n\t\t/**\n\t\t * Specifies a function to call when an event is dispatched by the\n\t\t * screen.\n\t\t *\n\t\t * <p>If the screen is currently being displayed by a\n\t\t * <code>ScreenNavigator</code>, and you call\n\t\t * <code>setFunctionForEvent()</code> on the <code>ScreenNavigatorItem</code>,\n\t\t * the <code>ScreenNavigator</code> won't listen for the event until\n\t\t * the next time that the screen is shown.</p>\n\t\t *\n\t\t * @see #setScreenIDForEvent()\n\t\t * @see #clearEvent()\n\t\t * @see #events\n\t\t */\n\t\tpublic function setFunctionForEvent(eventType:String, action:Function):void\n\t\t{\n\t\t\tthis._events[eventType] = action;\n\t\t}\n\n\t\t/**\n\t\t * Specifies another screen to navigate to when an event is dispatched\n\t\t * by this screen. The other screen should be specified by its ID that\n\t\t * is registered with the <code>ScreenNavigator</code>.\n\t\t *\n\t\t * <p>If the screen is currently being displayed by a\n\t\t * <code>ScreenNavigator</code>, and you call\n\t\t * <code>setScreenIDForEvent()</code> on the <code>ScreenNavigatorItem</code>,\n\t\t * the <code>ScreenNavigator</code> won't listen for the event until the\n\t\t * next time that the screen is shown.</p>\n\t\t *\n\t\t * @see #setFunctionForEvent()\n\t\t * @see #clearEvent()\n\t\t * @see #events\n\t\t */\n\t\tpublic function setScreenIDForEvent(eventType:String, screenID:String):void\n\t\t{\n\t\t\tthis._events[eventType] = screenID;\n\t\t}\n\n\t\t/**\n\t\t * Cancels the action previously registered to be triggered when the\n\t\t * screen dispatches an event.\n\t\t *\n\t\t * @see #events\n\t\t */\n\t\tpublic function clearEvent(eventType:String):void\n\t\t{\n\t\t\tdelete this._events[eventType];\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getScreen():DisplayObject\n\t\t{\n\t\t\tvar screenInstance:DisplayObject;\n\t\t\tif(this._screen is Class)\n\t\t\t{\n\t\t\t\tvar ScreenType:Class = Class(this._screen);\n\t\t\t\tscreenInstance = new ScreenType();\n\t\t\t}\n\t\t\telse if(this._screen is Function)\n\t\t\t{\n\t\t\t\tscreenInstance = DisplayObject((this._screen as Function)());\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tscreenInstance = DisplayObject(this._screen);\n\t\t\t}\n\t\t\tif(!(screenInstance is DisplayObject))\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"ScreenNavigatorItem \\\"getScreen()\\\" must return a Starling display object.\");\n\t\t\t}\n\n\t\t\tif(this._properties)\n\t\t\t{\n\t\t\t\tfor(var propertyName:String in this._properties)\n\t\t\t\t{\n\t\t\t\t\tscreenInstance[propertyName] = this._properties[propertyName];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn screenInstance;\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/controls/ScrollBar.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IFocusDisplayObject;\n\timport feathers.core.IMeasureDisplayObject;\n\timport feathers.core.IValidating;\n\timport feathers.core.PropertyProxy;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.Direction;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.utils.math.clamp;\n\timport feathers.utils.math.roundDownToNearest;\n\timport feathers.utils.math.roundToNearest;\n\timport feathers.utils.math.roundUpToNearest;\n\n\timport flash.events.TimerEvent;\n\timport flash.geom.Point;\n\timport flash.utils.Timer;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.utils.Pool;\n\n\t/**\n\t * A style name to add to the scroll bar's decrement button\n\t * sub-component. Typically used by a theme to provide different styles\n\t * to different scroll bars.\n\t *\n\t * <p>In the following example, a custom decrement button style name is\n\t * passed to the scroll bar:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollBar.customDecrementButtonStyleName = \"my-custom-decrement-button\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different skins than the default style:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( Button ).setFunctionForStyleName( \"my-custom-decrement-button\", setCustomDecrementButtonStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_DECREMENT_BUTTON\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #decrementButtonFactory\n\t */\n\t[Style(name=\"customDecrementButtonStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to the scroll bar's increment button\n\t * sub-component. Typically used by a theme to provide different styles\n\t * to different scroll bars.\n\t *\n\t * <p>In the following example, a custom increment button style name is\n\t * passed to the scroll bar:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollBar.customIncrementButtonStyleName = \"my-custom-increment-button\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( Button ).setFunctionForStyleName( \"my-custom-increment-button\", setCustomIncrementButtonStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_INCREMENT_BUTTON\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #incrementButtonFactory\n\t */\n\t[Style(name=\"customIncrementButtonStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to the scroll bar's minimum track sub-component.\n\t * Typically used by a theme to provide different styles to different\n\t * scroll bars.\n\t *\n\t * <p>In the following example, a custom minimum track style name is\n\t * passed to the scroll bar:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollBar.customMinimumTrackStyleName = \"my-custom-minimum-track\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to provide\n\t * different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( Button ).setFunctionForStyleName( \"my-custom-minimum-track\", setCustomMinimumTrackStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_MINIMUM_TRACK\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #minimumTrackFactory\n\t */\n\t[Style(name=\"customMinimumTrackStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to the scroll bar's maximum track sub-component.\n\t * Typically used by a theme to provide different styles to different\n\t * scroll bars.\n\t *\n\t * <p>In the following example, a custom maximum track style name is\n\t * passed to the scroll bar:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollBar.customMaximumTrackStyleName = \"my-custom-maximum-track\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( Button ).setFunctionForStyleName( \"my-custom-maximum-track\", setCustomMaximumTrackStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_MAXIMUM_TRACK\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #maximumTrackFactory\n\t */\n\t[Style(name=\"customMaximumTrackStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to the scroll bar's thumb sub-component.\n\t * Typically used by a theme to provide different styles to different\n\t * scroll bars.\n\t *\n\t * <p>In the following example, a custom thumb style name is passed\n\t * to the scroll bar:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollBar.customThumbStyleName = \"my-custom-thumb\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( Button ).setFunctionForStyleName( \"my-custom-thumb\", setCustomThumbStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_THUMB\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #thumbFactory\n\t */\n\t[Style(name=\"customThumbStyleName\",type=\"String\")]\n\n\t/**\n\t * Determines if the scroll bar's thumb can be dragged horizontally or\n\t * vertically. When this value changes, the scroll bar's width and\n\t * height values do not change automatically.\n\t *\n\t * <p>Note: When using a <code>ScrollBar</code> with a scrolling\n\t * container, the container will automatically set the correct\n\t * <code>direction</code> value. Generally, you should not need to set this\n\t * style manually.</p>\n\t *\n\t * <p>In the following example, the direction is changed to vertical:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollBar.direction = Direction.VERTICAL;</listing>\n\t *\n\t * <p><strong>Note:</strong> The <code>Direction.NONE</code>\n\t * constant is not supported.</p>\n\t *\n\t * @default feathers.layout.Direction.HORIZONTAL\n\t *\n\t * @see feathers.layout.Direction#HORIZONTAL\n\t * @see feathers.layout.Direction#VERTICAL\n\t */\n\t[Style(name=\"direction\",type=\"String\")]\n\n\t/**\n\t * Determines if the scroll bar's thumb will be resized based on the\n\t * scrollable range, or if it will be rendered at its preferred size.\n\t *\n\t * <p>In the following example, the thumb size is fixed:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollBar.fixedThumbSize = true;</listing>\n\t *\n\t * @default false\n\t */\n\t[Style(name=\"fixedThumbSize\",type=\"Boolean\")]\n\n\t/**\n\t * Quickly sets all padding properties to the same value. The\n\t * <code>padding</code> getter always returns the value of\n\t * <code>paddingTop</code>, but the other padding values may be\n\t * different.\n\t *\n\t * <p>In the following example, the padding is changed to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollBar.padding = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:paddingTop\n\t * @see #style:paddingRight\n\t * @see #style:paddingBottom\n\t * @see #style:paddingLeft\n\t */\n\t[Style(name=\"padding\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, above the content, not\n\t * including the track(s).\n\t *\n\t * <p>In the following example, the top padding is changed to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollBar.paddingTop = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingTop\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, to the right of the content, not\n\t * including the track(s).\n\t *\n\t * <p>In the following example, the right padding is changed to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollBar.paddingRight = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingRight\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, below the content, not\n\t * including the track(s).\n\t *\n\t * <p>In the following example, the bottom padding is changed to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollBar.paddingBottom = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingBottom\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, to the left of the content, not\n\t * including the track(s).\n\t *\n\t * <p>In the following example, the left padding is changed to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollBar.paddingLeft = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingLeft\",type=\"Number\")]\n\n\t/**\n\t * Determines how the minimum and maximum track skins are positioned and\n\t * sized.\n\t *\n\t * <p>In the following example, the scroll bar is given two tracks:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollBar.trackLayoutMode = TrackLayoutMode.SPLIT;</listing>\n\t *\n\t * @default feathers.controls.TrackLayoutMode.SINGLE\n\t *\n\t * @see feathers.controls.TrackLayoutMode#SINGLE\n\t * @see feathers.controls.TrackLayoutMode#SPLIT\n\t */\n\t[Style(name=\"trackLayoutMode\",type=\"String\")]\n\n\t/**\n\t * Dispatched when the scroll bar's value changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the user starts interacting with the scroll bar's thumb,\n\t * track, or buttons.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.BEGIN_INTERACTION\n\t */\n\t[Event(name=\"beginInteraction\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the user stops interacting with the scroll bar's thumb,\n\t * track, or buttons.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.END_INTERACTION\n\t */\n\t[Event(name=\"endInteraction\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Select a value between a minimum and a maximum by dragging a thumb over\n\t * a physical range or by using step buttons. This is a desktop-centric\n\t * scroll bar with many skinnable parts. For mobile, the\n\t * <code>SimpleScrollBar</code> is probably a better choice as it provides\n\t * only the thumb to indicate position without all the extra chrome.\n\t *\n\t * <p>The following example updates a list to use scroll bars:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * list.horizontalScrollBarFactory = function():IScrollBar\n\t * {\n\t *     return new ScrollBar();\n\t * };\n\t * list.verticalScrollBarFactory = function():IScrollBar\n\t * {\n\t *     return new ScrollBar();\n\t * };</listing>\n\t *\n\t * @see ../../../help/scroll-bar.html How to use the Feathers ScrollBar component\n\t * @see feathers.controls.SimpleScrollBar\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class ScrollBar extends FeathersControl implements IDirectionalScrollBar\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_THUMB_FACTORY:String = \"thumbFactory\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_MINIMUM_TRACK_FACTORY:String = \"minimumTrackFactory\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_MAXIMUM_TRACK_FACTORY:String = \"maximumTrackFactory\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_DECREMENT_BUTTON_FACTORY:String = \"decrementButtonFactory\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_INCREMENT_BUTTON_FACTORY:String = \"incrementButtonFactory\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the minimum\n\t\t * track.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_MINIMUM_TRACK:String = \"feathers-scroll-bar-minimum-track\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the maximum\n\t\t * track.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_MAXIMUM_TRACK:String = \"feathers-scroll-bar-maximum-track\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the thumb.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_THUMB:String = \"feathers-scroll-bar-thumb\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the decrement\n\t\t * button.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_DECREMENT_BUTTON:String = \"feathers-scroll-bar-decrement-button\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the increment\n\t\t * button.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_INCREMENT_BUTTON:String = \"feathers-scroll-bar-increment-button\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>ScrollBar</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultThumbFactory():BasicButton\n\t\t{\n\t\t\treturn new Button();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultMinimumTrackFactory():BasicButton\n\t\t{\n\t\t\treturn new Button();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultMaximumTrackFactory():BasicButton\n\t\t{\n\t\t\treturn new Button();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultDecrementButtonFactory():BasicButton\n\t\t{\n\t\t\treturn new Button();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultIncrementButtonFactory():BasicButton\n\t\t{\n\t\t\treturn new Button();\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function ScrollBar()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.addEventListener(Event.REMOVED_FROM_STAGE, removedFromStageHandler);\n\t\t}\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the minimum\n\t\t * track. This variable is <code>protected</code> so that sub-classes\n\t\t * can customize the minimum track style name in their constructors\n\t\t * instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_MINIMUM_TRACK</code>.\n\t\t *\n\t\t * <p>To customize the minimum track style name without subclassing, see\n\t\t * <code>customMinimumTrackStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customMinimumTrackStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var minimumTrackStyleName:String = DEFAULT_CHILD_STYLE_NAME_MINIMUM_TRACK;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the maximum\n\t\t * track. This variable is <code>protected</code> so that sub-classes\n\t\t * can customize the maximum track style name in their constructors\n\t\t * instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_MAXIMUM_TRACK</code>.\n\t\t *\n\t\t * <p>To customize the maximum track style name without subclassing, see\n\t\t * <code>customMaximumTrackStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customMaximumTrackStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var maximumTrackStyleName:String = DEFAULT_CHILD_STYLE_NAME_MAXIMUM_TRACK;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the thumb. This\n\t\t * variable is <code>protected</code> so that sub-classes can customize\n\t\t * the thumb style name in their constructors instead of using the\n\t\t * default style name defined by <code>DEFAULT_CHILD_STYLE_NAME_THUMB</code>.\n\t\t *\n\t\t * <p>To customize the thumb style name without subclassing, see\n\t\t * <code>customThumbStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customThumbStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var thumbStyleName:String = DEFAULT_CHILD_STYLE_NAME_THUMB;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the decrement\n\t\t * button. This variable is <code>protected</code> so that sub-classes\n\t\t * can customize the decrement button style name in their constructors\n\t\t * instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_DECREMENT_BUTTON</code>.\n\t\t *\n\t\t * <p>To customize the decrement button style name without subclassing,\n\t\t * see <code>customDecrementButtonStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customDecrementButtonStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var decrementButtonStyleName:String = DEFAULT_CHILD_STYLE_NAME_DECREMENT_BUTTON;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the increment\n\t\t * button. This variable is <code>protected</code> so that sub-classes\n\t\t * can customize the increment button style name in their constructors\n\t\t * instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_INCREMENT_BUTTON</code>.\n\t\t *\n\t\t * <p>To customize the increment button style name without subclassing,\n\t\t * see <code>customIncrementButtonName</code>.</p>\n\t\t *\n\t\t * @see #style:customIncrementButtonStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var incrementButtonStyleName:String = DEFAULT_CHILD_STYLE_NAME_INCREMENT_BUTTON;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var thumbOriginalWidth:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var thumbOriginalHeight:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var minimumTrackOriginalWidth:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var minimumTrackOriginalHeight:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var maximumTrackOriginalWidth:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var maximumTrackOriginalHeight:Number = NaN;\n\n\t\t/**\n\t\t * The scroll bar's decrement button sub-component.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t *\n\t\t * @see #decrementButtonFactory\n\t\t * @see #createDecrementButton()\n\t\t */\n\t\tprotected var decrementButton:BasicButton;\n\n\t\t/**\n\t\t * The scroll bar's increment button sub-component.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t *\n\t\t * @see #incrementButtonFactory\n\t\t * @see #createIncrementButton()\n\t\t */\n\t\tprotected var incrementButton:BasicButton;\n\n\t\t/**\n\t\t * The scroll bar's thumb sub-component.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t *\n\t\t * @see #thumbFactory\n\t\t * @see #createThumb()\n\t\t */\n\t\tprotected var thumb:DisplayObject;\n\n\t\t/**\n\t\t * The scroll bar's minimum track sub-component.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t *\n\t\t * @see #minimumTrackFactory\n\t\t * @see #createMinimumTrack()\n\t\t */\n\t\tprotected var minimumTrack:DisplayObject;\n\n\t\t/**\n\t\t * The scroll bar's maximum track sub-component.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t *\n\t\t * @see #maximumTrackFactory\n\t\t * @see #createMaximumTrack()\n\t\t */\n\t\tprotected var maximumTrack:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimumTrackSkinExplicitWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimumTrackSkinExplicitHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimumTrackSkinExplicitMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimumTrackSkinExplicitMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maximumTrackSkinExplicitWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maximumTrackSkinExplicitHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maximumTrackSkinExplicitMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maximumTrackSkinExplicitMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn ScrollBar.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _direction:String = Direction.HORIZONTAL;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"horizontal,vertical\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get direction():String\n\t\t{\n\t\t\treturn this._direction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set direction(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._direction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._direction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DECREMENT_BUTTON_FACTORY);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_INCREMENT_BUTTON_FACTORY);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_MINIMUM_TRACK_FACTORY);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_MAXIMUM_TRACK_FACTORY);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_THUMB_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fixedThumbSize:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get fixedThumbSize():Boolean\n\t\t{\n\t\t\treturn this._fixedThumbSize;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set fixedThumbSize(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._fixedThumbSize === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._fixedThumbSize = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _value:Number = 0;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #minimum\n\t\t * @see #maximum\n\t\t * @see #step\n\t\t * @see #page\n\t\t * @see #event:change\n\t\t */\n\t\tpublic function get value():Number\n\t\t{\n\t\t\treturn this._value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set value(newValue:Number):void\n\t\t{\n\t\t\tnewValue = clamp(newValue, this._minimum, this._maximum);\n\t\t\tif(this._value == newValue)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._value = newValue;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\tif(this.liveDragging || !this.isDragging)\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimum:Number = 0;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #value\n\t\t * @see #maximum\n\t\t */\n\t\tpublic function get minimum():Number\n\t\t{\n\t\t\treturn this._minimum;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minimum(value:Number):void\n\t\t{\n\t\t\tif(this._minimum == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._minimum = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maximum:Number = 0;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #value\n\t\t * @see #minimum\n\t\t */\n\t\tpublic function get maximum():Number\n\t\t{\n\t\t\treturn this._maximum;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maximum(value:Number):void\n\t\t{\n\t\t\tif(this._maximum == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._maximum = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _step:Number = 0;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #value\n\t\t * @see #page\n\t\t */\n\t\tpublic function get step():Number\n\t\t{\n\t\t\treturn this._step;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set step(value:Number):void\n\t\t{\n\t\t\tthis._step = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _page:Number = 0;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #value\n\t\t * @see #step\n\t\t */\n\t\tpublic function get page():Number\n\t\t{\n\t\t\treturn this._page;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set page(value:Number):void\n\t\t{\n\t\t\tif(this._page == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._page = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get padding():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set padding(value:Number):void\n\t\t{\n\t\t\tthis.paddingTop = value;\n\t\t\tthis.paddingRight = value;\n\t\t\tthis.paddingBottom = value;\n\t\t\tthis.paddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingTop:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingTop():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingTop(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingTop = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingRight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingRight():Number\n\t\t{\n\t\t\treturn this._paddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingRight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingBottom:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingBottom():Number\n\t\t{\n\t\t\treturn this._paddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingBottom = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingLeft:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingLeft = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var currentRepeatAction:Function;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _repeatTimer:Timer;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _repeatDelay:Number = 0.05;\n\n\t\t/**\n\t\t * The time, in seconds, before actions are repeated. The first repeat\n\t\t * happens after a delay that is five times longer than the following\n\t\t * repeats.\n\t\t *\n\t\t * <p>In the following example, the repeat delay is changed to 500 milliseconds:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scrollBar.repeatDelay = 0.5;</listing>\n\t\t *\n\t\t * @default 0.05\n\t\t */\n\t\tpublic function get repeatDelay():Number\n\t\t{\n\t\t\treturn this._repeatDelay;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set repeatDelay(value:Number):void\n\t\t{\n\t\t\tif(this._repeatDelay == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._repeatDelay = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var isDragging:Boolean = false;\n\n\t\t/**\n\t\t * Determines if the scroll bar dispatches the <code>Event.CHANGE</code>\n\t\t * event every time the thumb moves, or only once it stops moving.\n\t\t *\n\t\t * <p>In the following example, live dragging is disabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scrollBar.liveDragging = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic var liveDragging:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _trackLayoutMode:String = TrackLayoutMode.SINGLE;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"single,split\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get trackLayoutMode():String\n\t\t{\n\t\t\treturn this._trackLayoutMode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set trackLayoutMode(value:String):void\n\t\t{\n\t\t\tif(value === \"minMax\")\n\t\t\t{\n\t\t\t\tvalue = TrackLayoutMode.SPLIT;\n\t\t\t}\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._trackLayoutMode === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._trackLayoutMode = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimumTrackFactory:Function;\n\n\t\t/**\n\t\t * A function used to generate the scroll bar's minimum track\n\t\t * sub-component. The minimum track must be an instance of\n\t\t * <code>BasicButton</code>. This factory can be used to change\n\t\t * properties on the minimum track when it is first created. For\n\t\t * instance, if you are skinning Feathers components without a theme,\n\t\t * you might use this factory to set skins and other styles on the\n\t\t * minimum track.\n\t\t *\n\t\t * <p>The function should have the following signature:</p>\n\t\t * <pre>function():BasicButton</pre>\n\t\t *\n\t\t * <p>In the following example, a custom minimum track factory is passed\n\t\t * to the scroll bar:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scrollBar.minimumTrackFactory = function():BasicButton\n\t\t * {\n\t\t *     var track:BasicButton = new BasicButton();\n\t\t *     track.defaultSkin = new Image( upTexture );\n\t\t *     track.downSkin = new Image( downTexture );\n\t\t *     return track;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.BasicButton\n\t\t */\n\t\tpublic function get minimumTrackFactory():Function\n\t\t{\n\t\t\treturn this._minimumTrackFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minimumTrackFactory(value:Function):void\n\t\t{\n\t\t\tif(this._minimumTrackFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._minimumTrackFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_MINIMUM_TRACK_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customMinimumTrackStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customMinimumTrackStyleName():String\n\t\t{\n\t\t\treturn this._customMinimumTrackStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customMinimumTrackStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customMinimumTrackStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customMinimumTrackStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_MINIMUM_TRACK_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimumTrackProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the scroll bar's \"minimum\"\n\t\t * track, and the properties will be passed down to the \"minimum\" track when\n\t\t * the scroll bar validates. For a list of available properties, refer to\n\t\t * <a href=\"Button.html\"><code>feathers.controls.BasicButton</code></a>.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>minimumTrackFactory</code> function\n\t\t * instead of using <code>minimumTrackProperties</code> will result in\n\t\t * better performance.</p>\n\t\t *\n\t\t * <p>In the following example, the scroll bar's minimum track properties\n\t\t * are updated:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scrollBar.minimumTrackProperties.defaultSkin = new Image( upTexture );\n\t\t * scrollBar.minimumTrackProperties.downSkin = new Image( downTexture );</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #minimumTrackFactory\n\t\t * @see feathers.controls.BasicButton\n\t\t */\n\t\tpublic function get minimumTrackProperties():Object\n\t\t{\n\t\t\tif(!this._minimumTrackProperties)\n\t\t\t{\n\t\t\t\tthis._minimumTrackProperties = new PropertyProxy(minimumTrackProperties_onChange);\n\t\t\t}\n\t\t\treturn this._minimumTrackProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minimumTrackProperties(value:Object):void\n\t\t{\n\t\t\tif(this._minimumTrackProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._minimumTrackProperties)\n\t\t\t{\n\t\t\t\tthis._minimumTrackProperties.removeOnChangeCallback(minimumTrackProperties_onChange);\n\t\t\t}\n\t\t\tthis._minimumTrackProperties = PropertyProxy(value);\n\t\t\tif(this._minimumTrackProperties)\n\t\t\t{\n\t\t\t\tthis._minimumTrackProperties.addOnChangeCallback(minimumTrackProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maximumTrackFactory:Function;\n\n\t\t/**\n\t\t * A function used to generate the scroll bar's maximum track\n\t\t * sub-component. The maximum track must be an instance of\n\t\t * <code>BasicButton</code>. This factory can be used to change\n\t\t * properties on the maximum track when it is first created. For\n\t\t * instance, if you are skinning Feathers components without a theme,\n\t\t * you might use this factory to set skins and other styles on the\n\t\t * maximum track.\n\t\t *\n\t\t * <p>The function should have the following signature:</p>\n\t\t * <pre>function():BasicButton</pre>\n\t\t *\n\t\t * <p>In the following example, a custom maximum track factory is passed\n\t\t * to the scroll bar:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scrollBar.maximumTrackFactory = function():BasicButton\n\t\t * {\n\t\t *     var track:BasicButton = new BasicButton();\n\t\t *     track.defaultSkin = new Image( upTexture );\n\t\t *     track.downSkin = new Image( downTexture );\n\t\t *     return track;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.BasicButton\n\t\t */\n\t\tpublic function get maximumTrackFactory():Function\n\t\t{\n\t\t\treturn this._maximumTrackFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maximumTrackFactory(value:Function):void\n\t\t{\n\t\t\tif(this._maximumTrackFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._maximumTrackFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_MAXIMUM_TRACK_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customMaximumTrackStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customMaximumTrackStyleName():String\n\t\t{\n\t\t\treturn this._customMaximumTrackStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customMaximumTrackStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customMaximumTrackStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customMaximumTrackStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_MAXIMUM_TRACK_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maximumTrackProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the scroll bar's \"maximum\"\n\t\t * track, and the properties will be passed down to the \"maximum\" track when\n\t\t * the scroll bar validates. For a list of available properties, refer to\n\t\t * <a href=\"Button.html\"><code>feathers.controls.BasicButton</code></a>.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>maximumTrackFactory</code> function\n\t\t * instead of using <code>maximumTrackProperties</code> will result in\n\t\t * better performance.</p>\n\t\t *\n\t\t * <p>In the following example, the scroll bar's maximum track properties\n\t\t * are updated:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scrollBar.maximumTrackProperties.defaultSkin = new Image( upTexture );\n\t\t * scrollBar.maximumTrackProperties.downSkin = new Image( downTexture );</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #maximumTrackFactory\n\t\t * @see feathers.controls.BasicButton\n\t\t */\n\t\tpublic function get maximumTrackProperties():Object\n\t\t{\n\t\t\tif(!this._maximumTrackProperties)\n\t\t\t{\n\t\t\t\tthis._maximumTrackProperties = new PropertyProxy(maximumTrackProperties_onChange);\n\t\t\t}\n\t\t\treturn this._maximumTrackProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maximumTrackProperties(value:Object):void\n\t\t{\n\t\t\tif(this._maximumTrackProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._maximumTrackProperties)\n\t\t\t{\n\t\t\t\tthis._maximumTrackProperties.removeOnChangeCallback(maximumTrackProperties_onChange);\n\t\t\t}\n\t\t\tthis._maximumTrackProperties = PropertyProxy(value);\n\t\t\tif(this._maximumTrackProperties)\n\t\t\t{\n\t\t\t\tthis._maximumTrackProperties.addOnChangeCallback(maximumTrackProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _thumbFactory:Function;\n\n\t\t/**\n\t\t * A function used to generate the scroll bar's thumb sub-component.\n\t\t * The thumb must be an instance of <code>Button</code>. This factory\n\t\t * can be used to change properties on the thumb when it is first\n\t\t * created. For instance, if you are skinning Feathers components\n\t\t * without a theme, you might use this factory to set skins and other\n\t\t * styles on the thumb.\n\t\t *\n\t\t * <p>The function should have the following signature:</p>\n\t\t * <pre>function():BasicButton</pre>\n\t\t *\n\t\t * <p>In the following example, a custom thumb factory is passed\n\t\t * to the scroll bar:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scrollBar.thumbFactory = function():BasicButton\n\t\t * {\n\t\t *     var thumb:BasicButton = new BasicButton();\n\t\t *     thumb.defaultSkin = new Image( upTexture );\n\t\t *     thumb.downSkin = new Image( downTexture );\n\t\t *     return thumb;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.BasicButton\n\t\t */\n\t\tpublic function get thumbFactory():Function\n\t\t{\n\t\t\treturn this._thumbFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set thumbFactory(value:Function):void\n\t\t{\n\t\t\tif(this._thumbFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._thumbFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_THUMB_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customThumbStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customThumbStyleName():String\n\t\t{\n\t\t\treturn this._customThumbStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customThumbStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customThumbStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customThumbStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_THUMB_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _thumbProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the scroll bar's thumb, and the\n\t\t * properties will be passed down to the thumb when the scroll bar\n\t\t * validates. For a list of available properties, refer to\n\t\t * <a href=\"Button.html\"><code>feathers.controls.BasicButton</code></a>.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>thumbFactory</code> function instead\n\t\t * of using <code>thumbProperties</code> will result in better\n\t\t * performance.</p>\n\t\t *\n\t\t * <p>In the following example, the scroll bar's thumb properties\n\t\t * are updated:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scrollBar.thumbProperties.defaultSkin = new Image( upTexture );\n\t\t * scrollBar.thumbProperties.downSkin = new Image( downTexture );</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #thumbFactory\n\t\t * @see feathers.controls.BasicButton\n\t\t */\n\t\tpublic function get thumbProperties():Object\n\t\t{\n\t\t\tif(!this._thumbProperties)\n\t\t\t{\n\t\t\t\tthis._thumbProperties = new PropertyProxy(thumbProperties_onChange);\n\t\t\t}\n\t\t\treturn this._thumbProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set thumbProperties(value:Object):void\n\t\t{\n\t\t\tif(this._thumbProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._thumbProperties)\n\t\t\t{\n\t\t\t\tthis._thumbProperties.removeOnChangeCallback(thumbProperties_onChange);\n\t\t\t}\n\t\t\tthis._thumbProperties = PropertyProxy(value);\n\t\t\tif(this._thumbProperties)\n\t\t\t{\n\t\t\t\tthis._thumbProperties.addOnChangeCallback(thumbProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _decrementButtonFactory:Function;\n\n\t\t/**\n\t\t * A function used to generate the scroll bar's decrement button\n\t\t * sub-component. The decrement button must be an instance of\n\t\t * <code>BasicButton</code>. This factory can be used to change\n\t\t * properties on the decrement button when it is first created. For\n\t\t * instance, if you are skinning Feathers components without a theme,\n\t\t * you might use this factory to set skins and other styles on the\n\t\t * decrement button.\n\t\t *\n\t\t * <p>The function should have the following signature:</p>\n\t\t * <pre>function():BasicButton</pre>\n\t\t *\n\t\t * <p>In the following example, a custom decrement button factory is passed\n\t\t * to the scroll bar:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scrollBar.decrementButtonFactory = function():BasicButton\n\t\t * {\n\t\t *     var button:BasicButton = new BasicButton();\n\t\t *     button.defaultSkin = new Image( upTexture );\n\t\t *     button.downSkin = new Image( downTexture );\n\t\t *     return button;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.BasicButton\n\t\t */\n\t\tpublic function get decrementButtonFactory():Function\n\t\t{\n\t\t\treturn this._decrementButtonFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set decrementButtonFactory(value:Function):void\n\t\t{\n\t\t\tif(this._decrementButtonFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._decrementButtonFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DECREMENT_BUTTON_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customDecrementButtonStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customDecrementButtonStyleName():String\n\t\t{\n\t\t\treturn this._customDecrementButtonStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customDecrementButtonStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customDecrementButtonStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customDecrementButtonStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DECREMENT_BUTTON_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _decrementButtonProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the scroll bar's decrement\n\t\t * button, and the properties will be passed down to the decrement\n\t\t * button when the scroll bar validates. For a list of available\n\t\t * properties, refer to\n\t\t * <a href=\"Button.html\"><code>feathers.controls.BasicButton</code></a>.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>decrementButtonFactory</code>\n\t\t * function instead of using <code>decrementButtonProperties</code> will\n\t\t * result in better performance.</p>\n\t\t *\n\t\t * <p>In the following example, the scroll bar's decrement button properties\n\t\t * are updated:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scrollBar.decrementButtonProperties.defaultSkin = new Image( upTexture );\n\t\t * scrollBar.decrementButtonProperties.downSkin = new Image( downTexture );</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #decrementButtonFactory\n\t\t * @see feathers.controls.BasicButton\n\t\t */\n\t\tpublic function get decrementButtonProperties():Object\n\t\t{\n\t\t\tif(!this._decrementButtonProperties)\n\t\t\t{\n\t\t\t\tthis._decrementButtonProperties = new PropertyProxy(decrementButtonProperties_onChange);\n\t\t\t}\n\t\t\treturn this._decrementButtonProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set decrementButtonProperties(value:Object):void\n\t\t{\n\t\t\tif(this._decrementButtonProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._decrementButtonProperties)\n\t\t\t{\n\t\t\t\tthis._decrementButtonProperties.removeOnChangeCallback(decrementButtonProperties_onChange);\n\t\t\t}\n\t\t\tthis._decrementButtonProperties = PropertyProxy(value);\n\t\t\tif(this._decrementButtonProperties)\n\t\t\t{\n\t\t\t\tthis._decrementButtonProperties.addOnChangeCallback(decrementButtonProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _incrementButtonFactory:Function;\n\n\t\t/**\n\t\t * A function used to generate the scroll bar's increment button\n\t\t * sub-component. The increment button must be an instance of\n\t\t * <code>BasicButton</code>. This factory can be used to change\n\t\t * properties on the increment button when it is first created. For\n\t\t * instance, if you are skinning Feathers components without a theme,\n\t\t * you might use this factory to set skins and other styles on the\n\t\t * increment button.\n\t\t *\n\t\t * <p>The function should have the following signature:</p>\n\t\t * <pre>function():BasicButton</pre>\n\t\t *\n\t\t * <p>In the following example, a custom increment button factory is passed\n\t\t * to the scroll bar:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scrollBar.incrementButtonFactory = function():BasicButton\n\t\t * {\n\t\t *     var button:BasicButton = new BasicButton();\n\t\t *     button.defaultSkin = new Image( upTexture );\n\t\t *     button.downSkin = new Image( downTexture );\n\t\t *     return button;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.BasicButton\n\t\t */\n\t\tpublic function get incrementButtonFactory():Function\n\t\t{\n\t\t\treturn this._incrementButtonFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set incrementButtonFactory(value:Function):void\n\t\t{\n\t\t\tif(this._incrementButtonFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._incrementButtonFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_INCREMENT_BUTTON_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customIncrementButtonStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customIncrementButtonStyleName():String\n\t\t{\n\t\t\treturn this._customIncrementButtonStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customIncrementButtonStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customIncrementButtonStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customIncrementButtonStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_INCREMENT_BUTTON_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _incrementButtonProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the scroll bar's increment\n\t\t * button, and the properties will be passed down to the increment\n\t\t * button when the scroll bar validates. For a list of available\n\t\t * properties, refer to\n\t\t * <a href=\"Button.html\"><code>feathers.controls.BasicButton</code></a>.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>incrementButtonFactory</code>\n\t\t * function instead of using <code>incrementButtonProperties</code> will\n\t\t * result in better performance.</p>\n\t\t *\n\t\t * <p>In the following example, the scroll bar's increment button properties\n\t\t * are updated:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scrollBar.incrementButtonProperties.defaultSkin = new Image( upTexture );\n\t\t * scrollBar.incrementButtonProperties.downSkin = new Image( downTexture );</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #incrementButtonFactory\n\t\t * @see feathers.controls.BasicButton\n\t\t */\n\t\tpublic function get incrementButtonProperties():Object\n\t\t{\n\t\t\tif(!this._incrementButtonProperties)\n\t\t\t{\n\t\t\t\tthis._incrementButtonProperties = new PropertyProxy(incrementButtonProperties_onChange);\n\t\t\t}\n\t\t\treturn this._incrementButtonProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set incrementButtonProperties(value:Object):void\n\t\t{\n\t\t\tif(this._incrementButtonProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._incrementButtonProperties)\n\t\t\t{\n\t\t\t\tthis._incrementButtonProperties.removeOnChangeCallback(incrementButtonProperties_onChange);\n\t\t\t}\n\t\t\tthis._incrementButtonProperties = PropertyProxy(value);\n\t\t\tif(this._incrementButtonProperties)\n\t\t\t{\n\t\t\t\tthis._incrementButtonProperties.addOnChangeCallback(incrementButtonProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _touchPointID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _touchStartX:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _touchStartY:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _thumbStartX:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _thumbStartY:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _pageStartValue:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _touchValue:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tif(this._value < this._minimum)\n\t\t\t{\n\t\t\t\tthis.value = this._minimum;\n\t\t\t}\n\t\t\telse if(this._value > this._maximum)\n\t\t\t{\n\t\t\t\tthis.value = this._maximum;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar layoutInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_LAYOUT);\n\t\t\tvar thumbFactoryInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_THUMB_FACTORY);\n\t\t\tvar minimumTrackFactoryInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_MINIMUM_TRACK_FACTORY);\n\t\t\tvar maximumTrackFactoryInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_MAXIMUM_TRACK_FACTORY);\n\t\t\tvar incrementButtonFactoryInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_INCREMENT_BUTTON_FACTORY);\n\t\t\tvar decrementButtonFactoryInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DECREMENT_BUTTON_FACTORY);\n\n\t\t\tif(thumbFactoryInvalid)\n\t\t\t{\n\t\t\t\tthis.createThumb();\n\t\t\t}\n\t\t\tif(minimumTrackFactoryInvalid)\n\t\t\t{\n\t\t\t\tthis.createMinimumTrack();\n\t\t\t}\n\t\t\tif(maximumTrackFactoryInvalid || layoutInvalid)\n\t\t\t{\n\t\t\t\tthis.createMaximumTrack();\n\t\t\t}\n\t\t\tif(decrementButtonFactoryInvalid)\n\t\t\t{\n\t\t\t\tthis.createDecrementButton();\n\t\t\t}\n\t\t\tif(incrementButtonFactoryInvalid)\n\t\t\t{\n\t\t\t\tthis.createIncrementButton();\n\t\t\t}\n\n\t\t\tif(thumbFactoryInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshThumbStyles();\n\t\t\t}\n\t\t\tif(minimumTrackFactoryInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshMinimumTrackStyles();\n\t\t\t}\n\t\t\tif((maximumTrackFactoryInvalid || stylesInvalid || layoutInvalid) && this.maximumTrack)\n\t\t\t{\n\t\t\t\tthis.refreshMaximumTrackStyles();\n\t\t\t}\n\t\t\tif(decrementButtonFactoryInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshDecrementButtonStyles();\n\t\t\t}\n\t\t\tif(incrementButtonFactoryInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshIncrementButtonStyles();\n\t\t\t}\n\n\t\t\tif(dataInvalid || stateInvalid || thumbFactoryInvalid ||\n\t\t\t\tminimumTrackFactoryInvalid || maximumTrackFactoryInvalid ||\n\t\t\t\tdecrementButtonFactoryInvalid || incrementButtonFactoryInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshEnabled();\n\t\t\t}\n\n\t\t\tsizeInvalid = this.autoSizeIfNeeded() || sizeInvalid;\n\n\t\t\tthis.layout();\n\t\t}\n\n\t\t/**\n\t\t * If the component's dimensions have not been set explicitly, it will\n\t\t * measure its content and determine an ideal size for itself. If the\n\t\t * <code>explicitWidth</code> or <code>explicitHeight</code> member\n\t\t * variables are set, those value will be used without additional\n\t\t * measurement. If one is set, but not the other, the dimension with the\n\t\t * explicit value will not be measured, but the other non-explicit\n\t\t * dimension will still need measurement.\n\t\t *\n\t\t * <p>Calls <code>saveMeasurements()</code> to set up the\n\t\t * <code>actualWidth</code> and <code>actualHeight</code> member\n\t\t * variables used for layout.</p>\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t */\n\t\tprotected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tif(this._direction === Direction.VERTICAL)\n\t\t\t{\n\t\t\t\treturn this.measureVertical();\n\t\t\t}\n\t\t\treturn this.measureHorizontal();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function measureHorizontal():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar isSingle:Boolean = this._trackLayoutMode === TrackLayoutMode.SINGLE;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tthis.minimumTrack.width = this._minimumTrackSkinExplicitWidth;\n\t\t\t}\n\t\t\telse if(isSingle)\n\t\t\t{\n\t\t\t\tthis.minimumTrack.width = this._explicitWidth;\n\t\t\t}\n\t\t\tif(this.minimumTrack is IMeasureDisplayObject)\n\t\t\t{\n\t\t\t\tvar measureMinTrack:IMeasureDisplayObject = IMeasureDisplayObject(this.minimumTrack);\n\t\t\t\tif(needsMinWidth)\n\t\t\t\t{\n\t\t\t\t\tmeasureMinTrack.minWidth = this._minimumTrackSkinExplicitMinWidth;\n\t\t\t\t}\n\t\t\t\telse if(isSingle)\n\t\t\t\t{\n\t\t\t\t\tvar minTrackMinWidth:Number = this._explicitMinWidth;\n\t\t\t\t\tif(this._minimumTrackSkinExplicitMinWidth > minTrackMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tminTrackMinWidth = this._minimumTrackSkinExplicitMinWidth;\n\t\t\t\t\t}\n\t\t\t\t\tmeasureMinTrack.minWidth = minTrackMinWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!isSingle)\n\t\t\t{\n\t\t\t\tif(needsWidth)\n\t\t\t\t{\n\t\t\t\t\tthis.maximumTrack.width = this._maximumTrackSkinExplicitWidth;\n\t\t\t\t}\n\t\t\t\tif(this.maximumTrack is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar measureMaxTrack:IMeasureDisplayObject = IMeasureDisplayObject(this.maximumTrack);\n\t\t\t\t\tif(needsMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tmeasureMaxTrack.minWidth = this._maximumTrackSkinExplicitMinWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this.minimumTrack is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.minimumTrack).validate();\n\t\t\t}\n\t\t\tif(this.maximumTrack is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.maximumTrack).validate();\n\t\t\t}\n\t\t\tif(this.thumb is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.thumb).validate();\n\t\t\t}\n\t\t\tif(this.decrementButton is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.decrementButton).validate();\n\t\t\t}\n\t\t\tif(this.incrementButton is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.incrementButton).validate();\n\t\t\t}\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tnewWidth = this.minimumTrack.width;\n\t\t\t\tif(!isSingle) //split\n\t\t\t\t{\n\t\t\t\t\tnewWidth += this.maximumTrack.width;\n\t\t\t\t}\n\t\t\t\tnewWidth += this.decrementButton.width + this.incrementButton.width;\n\t\t\t}\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tnewHeight = this.minimumTrack.height;\n\t\t\t\tif(!isSingle && //split\n\t\t\t\t\tthis.maximumTrack.height > newHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this.maximumTrack.height;\n\t\t\t\t}\n\t\t\t\tif(this.thumb.height > newHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this.thumb.height;\n\t\t\t\t}\n\t\t\t\tif(this.decrementButton.height > newHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this.decrementButton.height;\n\t\t\t\t}\n\t\t\t\tif(this.incrementButton.height > newHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this.incrementButton.height;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tif(measureMinTrack !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = measureMinTrack.minWidth;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = this.minimumTrack.width;\n\t\t\t\t}\n\t\t\t\tif(!isSingle) //split\n\t\t\t\t{\n\t\t\t\t\tif(measureMaxTrack !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth += measureMaxTrack.minWidth;\n\t\t\t\t\t}\n\t\t\t\t\telse if(this.maximumTrack.width > newMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth += this.maximumTrack.width;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this.decrementButton is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth += IMeasureDisplayObject(this.decrementButton).minWidth;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth += this.decrementButton.width;\n\t\t\t\t}\n\t\t\t\tif(this.incrementButton is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth += IMeasureDisplayObject(this.incrementButton).minWidth;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth += this.incrementButton.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tif(measureMinTrack !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = measureMinTrack.minHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = this.minimumTrack.height;\n\t\t\t\t}\n\t\t\t\tif(!isSingle) //split\n\t\t\t\t{\n\t\t\t\t\tif(measureMaxTrack !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(measureMaxTrack.minHeight > newMinHeight)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinHeight = measureMaxTrack.minHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(this.maximumTrack.height > newMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = this.maximumTrack.height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this.thumb is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar measureThumb:IMeasureDisplayObject = IMeasureDisplayObject(this.thumb);\n\t\t\t\t\tif(measureThumb.minHeight > newMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = measureThumb.minHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(this.thumb.height > newMinHeight)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = this.thumb.height;\n\t\t\t\t}\n\t\t\t\tif(this.decrementButton is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar measureDecrementButton:IMeasureDisplayObject = IMeasureDisplayObject(this.decrementButton);\n\t\t\t\t\tif(measureDecrementButton.minHeight > newMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = measureDecrementButton.minHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(this.decrementButton.height > newMinHeight)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = this.decrementButton.height;\n\t\t\t\t}\n\t\t\t\tif(this.incrementButton is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar measureIncrementButton:IMeasureDisplayObject = IMeasureDisplayObject(this.incrementButton);\n\t\t\t\t\tif(measureIncrementButton.minHeight > newMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = measureIncrementButton.minHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(this.incrementButton.height > newMinHeight)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = this.incrementButton.height;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function measureVertical():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar isSingle:Boolean = this._trackLayoutMode === TrackLayoutMode.SINGLE;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tthis.minimumTrack.height = this._minimumTrackSkinExplicitHeight;\n\t\t\t}\n\t\t\telse if(isSingle)\n\t\t\t{\n\t\t\t\tthis.minimumTrack.height = this._explicitHeight;\n\t\t\t}\n\t\t\tif(this.minimumTrack is IMeasureDisplayObject)\n\t\t\t{\n\t\t\t\tvar measureMinTrack:IMeasureDisplayObject = IMeasureDisplayObject(this.minimumTrack);\n\t\t\t\tif(needsMinHeight)\n\t\t\t\t{\n\t\t\t\t\tmeasureMinTrack.minHeight = this._minimumTrackSkinExplicitMinHeight;\n\t\t\t\t}\n\t\t\t\telse if(isSingle)\n\t\t\t\t{\n\t\t\t\t\tvar minTrackMinHeight:Number = this._explicitMinHeight;\n\t\t\t\t\tif(this._minimumTrackSkinExplicitMinHeight > minTrackMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tminTrackMinHeight = this._minimumTrackSkinExplicitMinHeight;\n\t\t\t\t\t}\n\t\t\t\t\tmeasureMinTrack.minHeight = minTrackMinHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!isSingle)\n\t\t\t{\n\t\t\t\tif(needsHeight)\n\t\t\t\t{\n\t\t\t\t\tthis.maximumTrack.height = this._maximumTrackSkinExplicitHeight;\n\t\t\t\t}\n\t\t\t\tif(this.maximumTrack is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar measureMaxTrack:IMeasureDisplayObject = IMeasureDisplayObject(this.maximumTrack);\n\t\t\t\t\tif(needsMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tmeasureMaxTrack.minHeight = this._maximumTrackSkinExplicitMinHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this.minimumTrack is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.minimumTrack).validate();\n\t\t\t}\n\t\t\tif(this.maximumTrack is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.maximumTrack).validate();\n\t\t\t}\n\t\t\tif(this.thumb is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.thumb).validate();\n\t\t\t}\n\t\t\tif(this.decrementButton is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.decrementButton).validate();\n\t\t\t}\n\t\t\tif(this.incrementButton is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.incrementButton).validate();\n\t\t\t}\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tnewWidth = this.minimumTrack.width;\n\t\t\t\tif(!isSingle && //split\n\t\t\t\t\tthis.maximumTrack.width > newWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this.maximumTrack.width;\n\t\t\t\t}\n\t\t\t\tif(this.thumb.width > newWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this.thumb.width;\n\t\t\t\t}\n\t\t\t\tif(this.decrementButton.width > newWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this.decrementButton.width;\n\t\t\t\t}\n\t\t\t\tif(this.incrementButton.width > newWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this.incrementButton.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tnewHeight = this.minimumTrack.height;\n\t\t\t\tif(!isSingle) //split\n\t\t\t\t{\n\t\t\t\t\tnewHeight += this.maximumTrack.height;\n\t\t\t\t}\n\t\t\t\tnewHeight += this.decrementButton.height + this.incrementButton.height;\n\t\t\t}\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tif(measureMinTrack !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = measureMinTrack.minWidth;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = this.minimumTrack.width;\n\t\t\t\t}\n\t\t\t\tif(!isSingle) //split\n\t\t\t\t{\n\t\t\t\t\tif(measureMaxTrack !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(measureMaxTrack.minWidth > newMinWidth)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinWidth = measureMaxTrack.minWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(this.maximumTrack.width > newMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = this.maximumTrack.width;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this.thumb is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar measureThumb:IMeasureDisplayObject = IMeasureDisplayObject(this.thumb);\n\t\t\t\t\tif(measureThumb.minWidth > newMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = measureThumb.minWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(this.thumb.width > newMinWidth)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = this.thumb.width;\n\t\t\t\t}\n\t\t\t\tif(this.decrementButton is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar measureDecrementButton:IMeasureDisplayObject = IMeasureDisplayObject(this.decrementButton);\n\t\t\t\t\tif(measureDecrementButton.minWidth > newMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = measureDecrementButton.minWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(this.decrementButton.width > newMinWidth)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = this.decrementButton.width;\n\t\t\t\t}\n\t\t\t\tif(this.incrementButton is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar measureIncrementButton:IMeasureDisplayObject = IMeasureDisplayObject(this.incrementButton);\n\t\t\t\t\tif(measureIncrementButton.minWidth > newMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = measureIncrementButton.minWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(this.incrementButton.width > newMinWidth)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = this.incrementButton.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tif(measureMinTrack !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = measureMinTrack.minHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = this.minimumTrack.height;\n\t\t\t\t}\n\t\t\t\tif(!isSingle) //split\n\t\t\t\t{\n\t\t\t\t\tif(measureMaxTrack !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight += measureMaxTrack.minHeight;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight += this.maximumTrack.height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this.decrementButton is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight += IMeasureDisplayObject(this.decrementButton).minHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight += this.decrementButton.height;\n\t\t\t\t}\n\t\t\t\tif(this.incrementButton is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight += IMeasureDisplayObject(this.incrementButton).minHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight += this.incrementButton.height;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>thumb</code> sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #thumb\n\t\t * @see #thumbFactory\n\t\t * @see #style:customThumbStyleName\n\t\t */\n\t\tprotected function createThumb():void\n\t\t{\n\t\t\tif(this.thumb)\n\t\t\t{\n\t\t\t\tthis.thumb.removeFromParent(true);\n\t\t\t\tthis.thumb = null;\n\t\t\t}\n\n\t\t\tvar factory:Function = this._thumbFactory != null ? this._thumbFactory : defaultThumbFactory;\n\t\t\tvar thumbStyleName:String = this._customThumbStyleName != null ? this._customThumbStyleName : this.thumbStyleName;\n\t\t\tvar thumb:BasicButton = BasicButton(factory());\n\t\t\tthumb.styleNameList.add(thumbStyleName);\n\t\t\tthumb.keepDownStateOnRollOut = true;\n\t\t\tif(thumb is IFocusDisplayObject)\n\t\t\t{\n\t\t\t\tthumb.isFocusEnabled = false;\n\t\t\t}\n\t\t\tthumb.addEventListener(TouchEvent.TOUCH, thumb_touchHandler);\n\t\t\tthis.addChild(thumb);\n\t\t\tthis.thumb = thumb;\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>minimumTrack</code> sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #minimumTrack\n\t\t * @see #minimumTrackFactory\n\t\t * @see #style:customMinimumTrackStyleName\n\t\t */\n\t\tprotected function createMinimumTrack():void\n\t\t{\n\t\t\tif(this.minimumTrack)\n\t\t\t{\n\t\t\t\tthis.minimumTrack.removeFromParent(true);\n\t\t\t\tthis.minimumTrack = null;\n\t\t\t}\n\n\t\t\tvar factory:Function = this._minimumTrackFactory != null ? this._minimumTrackFactory : defaultMinimumTrackFactory;\n\t\t\tvar minimumTrackStyleName:String = this._customMinimumTrackStyleName != null ? this._customMinimumTrackStyleName : this.minimumTrackStyleName;\n\t\t\tvar minimumTrack:BasicButton = BasicButton(factory());\n\t\t\tminimumTrack.styleNameList.add(minimumTrackStyleName);\n\t\t\tminimumTrack.keepDownStateOnRollOut = true;\n\t\t\tif(minimumTrack is IFocusDisplayObject)\n\t\t\t{\n\t\t\t\tminimumTrack.isFocusEnabled = false;\n\t\t\t}\n\t\t\tminimumTrack.addEventListener(TouchEvent.TOUCH, track_touchHandler);\n\t\t\tthis.addChildAt(minimumTrack, 0);\n\t\t\tthis.minimumTrack = minimumTrack;\n\n\t\t\tif(this.minimumTrack is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this.minimumTrack).initializeNow();\n\t\t\t}\n\t\t\tif(this.minimumTrack is IMeasureDisplayObject)\n\t\t\t{\n\t\t\t\tvar measureMinTrack:IMeasureDisplayObject = IMeasureDisplayObject(this.minimumTrack);\n\t\t\t\tthis._minimumTrackSkinExplicitWidth = measureMinTrack.explicitWidth;\n\t\t\t\tthis._minimumTrackSkinExplicitHeight = measureMinTrack.explicitHeight;\n\t\t\t\tthis._minimumTrackSkinExplicitMinWidth = measureMinTrack.explicitMinWidth;\n\t\t\t\tthis._minimumTrackSkinExplicitMinHeight = measureMinTrack.explicitMinHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//this is a regular display object, and we'll treat its\n\t\t\t\t//measurements as explicit when we auto-size the scroll bar\n\t\t\t\tthis._minimumTrackSkinExplicitWidth = this.minimumTrack.width;\n\t\t\t\tthis._minimumTrackSkinExplicitHeight = this.minimumTrack.height;\n\t\t\t\tthis._minimumTrackSkinExplicitMinWidth = this._minimumTrackSkinExplicitWidth;\n\t\t\t\tthis._minimumTrackSkinExplicitMinHeight = this._minimumTrackSkinExplicitHeight;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>maximumTrack</code> sub-component and\n\t\t * removes the old instance, if one exists. If the maximum track is not\n\t\t * needed, it will not be created.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #maximumTrack\n\t\t * @see #maximumTrackFactory\n\t\t * @see #style:customMaximumTrackStyleName\n\t\t */\n\t\tprotected function createMaximumTrack():void\n\t\t{\n\t\t\tif(this.maximumTrack)\n\t\t\t{\n\t\t\t\tthis.maximumTrack.removeFromParent(true);\n\t\t\t\tthis.maximumTrack = null;\n\t\t\t}\n\t\t\tif(this._trackLayoutMode !== TrackLayoutMode.SPLIT)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar factory:Function = this._maximumTrackFactory != null ? this._maximumTrackFactory : defaultMaximumTrackFactory;\n\t\t\tvar maximumTrackStyleName:String = this._customMaximumTrackStyleName != null ? this._customMaximumTrackStyleName : this.maximumTrackStyleName;\n\t\t\tvar maximumTrack:BasicButton = BasicButton(factory());\n\t\t\tmaximumTrack.styleNameList.add(maximumTrackStyleName);\n\t\t\tmaximumTrack.keepDownStateOnRollOut = true;\n\t\t\tif(maximumTrack is IFocusDisplayObject)\n\t\t\t{\n\t\t\t\tmaximumTrack.isFocusEnabled = false;\n\t\t\t}\n\t\t\tmaximumTrack.addEventListener(TouchEvent.TOUCH, track_touchHandler);\n\t\t\tthis.addChildAt(maximumTrack, 1);\n\t\t\tthis.maximumTrack = maximumTrack;\n\n\t\t\tif(this.maximumTrack is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this.maximumTrack).initializeNow();\n\t\t\t}\n\t\t\tif(this.maximumTrack is IMeasureDisplayObject)\n\t\t\t{\n\t\t\t\tvar measureMaxTrack:IMeasureDisplayObject = IMeasureDisplayObject(this.maximumTrack);\n\t\t\t\tthis._maximumTrackSkinExplicitWidth = measureMaxTrack.explicitWidth;\n\t\t\t\tthis._maximumTrackSkinExplicitHeight = measureMaxTrack.explicitHeight;\n\t\t\t\tthis._maximumTrackSkinExplicitMinWidth = measureMaxTrack.explicitMinWidth;\n\t\t\t\tthis._maximumTrackSkinExplicitMinHeight = measureMaxTrack.explicitMinHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//this is a regular display object, and we'll treat its\n\t\t\t\t//measurements as explicit when we auto-size the scroll bar\n\t\t\t\tthis._maximumTrackSkinExplicitWidth = this.maximumTrack.width;\n\t\t\t\tthis._maximumTrackSkinExplicitHeight = this.maximumTrack.height;\n\t\t\t\tthis._maximumTrackSkinExplicitMinWidth = this._maximumTrackSkinExplicitWidth;\n\t\t\t\tthis._maximumTrackSkinExplicitMinHeight = this._maximumTrackSkinExplicitHeight;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>decrementButton</code> sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #decrementButton\n\t\t * @see #decrementButtonFactory\n\t\t * @see #style:customDecremenButtonStyleName\n\t\t */\n\t\tprotected function createDecrementButton():void\n\t\t{\n\t\t\tif(this.decrementButton)\n\t\t\t{\n\t\t\t\tthis.decrementButton.removeFromParent(true);\n\t\t\t\tthis.decrementButton = null;\n\t\t\t}\n\n\t\t\tvar factory:Function = this._decrementButtonFactory != null ? this._decrementButtonFactory : defaultDecrementButtonFactory;\n\t\t\tvar decrementButtonStyleName:String = this._customDecrementButtonStyleName != null ? this._customDecrementButtonStyleName : this.decrementButtonStyleName;\n\t\t\tthis.decrementButton = BasicButton(factory());\n\t\t\tthis.decrementButton.styleNameList.add(decrementButtonStyleName);\n\t\t\tthis.decrementButton.keepDownStateOnRollOut = true;\n\t\t\tif(this.decrementButton is IFocusDisplayObject)\n\t\t\t{\n\t\t\t\tthis.decrementButton.isFocusEnabled = false;\n\t\t\t}\n\t\t\tthis.decrementButton.addEventListener(TouchEvent.TOUCH, decrementButton_touchHandler);\n\t\t\tthis.addChild(this.decrementButton);\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>incrementButton</code> sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #incrementButton\n\t\t * @see #incrementButtonFactory\n\t\t * @see #style:customIncrementButtonStyleName\n\t\t */\n\t\tprotected function createIncrementButton():void\n\t\t{\n\t\t\tif(this.incrementButton)\n\t\t\t{\n\t\t\t\tthis.incrementButton.removeFromParent(true);\n\t\t\t\tthis.incrementButton = null;\n\t\t\t}\n\n\t\t\tvar factory:Function = this._incrementButtonFactory != null ? this._incrementButtonFactory : defaultIncrementButtonFactory;\n\t\t\tvar incrementButtonStyleName:String = this._customIncrementButtonStyleName != null ? this._customIncrementButtonStyleName : this.incrementButtonStyleName;\n\t\t\tthis.incrementButton = BasicButton(factory());\n\t\t\tthis.incrementButton.styleNameList.add(incrementButtonStyleName);\n\t\t\tthis.incrementButton.keepDownStateOnRollOut = true;\n\t\t\tif(this.incrementButton is IFocusDisplayObject)\n\t\t\t{\n\t\t\t\tthis.incrementButton.isFocusEnabled = false;\n\t\t\t}\n\t\t\tthis.incrementButton.addEventListener(TouchEvent.TOUCH, incrementButton_touchHandler);\n\t\t\tthis.addChild(this.incrementButton);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshThumbStyles():void\n\t\t{\n\t\t\tfor(var propertyName:String in this._thumbProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._thumbProperties[propertyName];\n\t\t\t\tthis.thumb[propertyName] = propertyValue;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshMinimumTrackStyles():void\n\t\t{\n\t\t\tfor(var propertyName:String in this._minimumTrackProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._minimumTrackProperties[propertyName];\n\t\t\t\tthis.minimumTrack[propertyName] = propertyValue;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshMaximumTrackStyles():void\n\t\t{\n\t\t\tif(!this.maximumTrack)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor(var propertyName:String in this._maximumTrackProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._maximumTrackProperties[propertyName];\n\t\t\t\tthis.maximumTrack[propertyName] = propertyValue;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshDecrementButtonStyles():void\n\t\t{\n\t\t\tfor(var propertyName:String in this._decrementButtonProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._decrementButtonProperties[propertyName];\n\t\t\t\tthis.decrementButton[propertyName] = propertyValue;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshIncrementButtonStyles():void\n\t\t{\n\t\t\tfor(var propertyName:String in this._incrementButtonProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._incrementButtonProperties[propertyName];\n\t\t\t\tthis.incrementButton[propertyName] = propertyValue;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshEnabled():void\n\t\t{\n\t\t\tvar isEnabled:Boolean = this._isEnabled && this._maximum > this._minimum;\n\t\t\tif(this.thumb is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this.thumb).isEnabled = isEnabled;\n\t\t\t}\n\t\t\tif(this.minimumTrack is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this.minimumTrack).isEnabled = isEnabled;\n\t\t\t}\n\t\t\tif(this.maximumTrack is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this.maximumTrack).isEnabled = isEnabled;\n\t\t\t}\n\t\t\tthis.decrementButton.isEnabled = isEnabled;\n\t\t\tthis.incrementButton.isEnabled = isEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layout():void\n\t\t{\n\t\t\tthis.layoutStepButtons();\n\t\t\tthis.layoutThumb();\n\n\t\t\tif(this._trackLayoutMode == TrackLayoutMode.SPLIT)\n\t\t\t{\n\t\t\t\tthis.layoutTrackWithMinMax();\n\t\t\t}\n\t\t\telse //single\n\t\t\t{\n\t\t\t\tthis.layoutTrackWithSingle();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutStepButtons():void\n\t\t{\n\t\t\tif(this._direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tthis.decrementButton.x = (this.actualWidth - this.decrementButton.width) / 2;\n\t\t\t\tthis.decrementButton.y = 0;\n\t\t\t\tthis.incrementButton.x = (this.actualWidth - this.incrementButton.width) / 2;\n\t\t\t\tthis.incrementButton.y = this.actualHeight - this.incrementButton.height;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.decrementButton.x = 0;\n\t\t\t\tthis.decrementButton.y = (this.actualHeight - this.decrementButton.height) / 2;\n\t\t\t\tthis.incrementButton.x = this.actualWidth - this.incrementButton.width;\n\t\t\t\tthis.incrementButton.y = (this.actualHeight - this.incrementButton.height) / 2;\n\t\t\t}\n\t\t\tvar showButtons:Boolean = this._maximum != this._minimum;\n\t\t\tthis.decrementButton.visible = showButtons;\n\t\t\tthis.incrementButton.visible = showButtons;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutThumb():void\n\t\t{\n\t\t\tvar range:Number = this._maximum - this._minimum;\n\t\t\tthis.thumb.visible = range > 0 && range < Number.POSITIVE_INFINITY && this._isEnabled;\n\t\t\tif(!this.thumb.visible)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//this will auto-size the thumb, if needed\n\t\t\tif(this.thumb is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.thumb).validate();\n\t\t\t}\n\n\t\t\tvar contentWidth:Number = this.actualWidth - this._paddingLeft - this._paddingRight;\n\t\t\tvar contentHeight:Number = this.actualHeight - this._paddingTop - this._paddingBottom;\n\t\t\tvar adjustedPage:Number = this._page;\n\t\t\tif(this._page == 0)\n\t\t\t{\n\t\t\t\tadjustedPage = this._step;\n\t\t\t}\n\t\t\tif(adjustedPage > range)\n\t\t\t{\n\t\t\t\tadjustedPage = range;\n\t\t\t}\n\t\t\tif(this._direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tcontentHeight -= (this.decrementButton.height + this.incrementButton.height);\n\t\t\t\tvar thumbMinHeight:Number = this.thumbOriginalHeight;\n\t\t\t\tif(this.thumb is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tthumbMinHeight = IMeasureDisplayObject(this.thumb).minHeight;\n\t\t\t\t}\n\t\t\t\tthis.thumb.width = this.thumbOriginalWidth;\n\t\t\t\tif(this._fixedThumbSize)\n\t\t\t\t{\n\t\t\t\t\tthis.thumb.height = this.thumbOriginalHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.thumb.height = Math.max(thumbMinHeight, contentHeight * adjustedPage / range);\n\t\t\t\t}\n\t\t\t\tvar trackScrollableHeight:Number = contentHeight - this.thumb.height;\n\t\t\t\tthis.thumb.x = this._paddingLeft + (this.actualWidth - this._paddingLeft - this._paddingRight - this.thumb.width) / 2;\n\t\t\t\tthis.thumb.y = this.decrementButton.height + this._paddingTop + Math.max(0, Math.min(trackScrollableHeight, trackScrollableHeight * (this._value - this._minimum) / range));\n\t\t\t}\n\t\t\telse //horizontal\n\t\t\t{\n\t\t\t\tcontentWidth -= (this.decrementButton.width + this.decrementButton.width);\n\t\t\t\tvar thumbMinWidth:Number = this.thumbOriginalWidth;\n\t\t\t\tif(this.thumb is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tthumbMinWidth = IMeasureDisplayObject(this.thumb).minWidth;\n\t\t\t\t}\n\t\t\t\tif(this._fixedThumbSize)\n\t\t\t\t{\n\t\t\t\t\tthis.thumb.width = this.thumbOriginalWidth;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.thumb.width = Math.max(thumbMinWidth, contentWidth * adjustedPage / range);\n\t\t\t\t}\n\t\t\t\tthis.thumb.height = this.thumbOriginalHeight;\n\t\t\t\tvar trackScrollableWidth:Number = contentWidth - this.thumb.width;\n\t\t\t\tthis.thumb.x = this.decrementButton.width + this._paddingLeft + Math.max(0, Math.min(trackScrollableWidth, trackScrollableWidth * (this._value - this._minimum) / range));\n\t\t\t\tthis.thumb.y = this._paddingTop + (this.actualHeight - this._paddingTop - this._paddingBottom - this.thumb.height) / 2;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutTrackWithMinMax():void\n\t\t{\n\t\t\tvar range:Number = this._maximum - this._minimum;\n\t\t\tthis.minimumTrack.touchable = range > 0 && range < Number.POSITIVE_INFINITY;\n\t\t\tif(this.maximumTrack)\n\t\t\t{\n\t\t\t\tthis.maximumTrack.touchable = range > 0 && range < Number.POSITIVE_INFINITY;\n\t\t\t}\n\n\t\t\tvar showButtons:Boolean = this._maximum != this._minimum;\n\t\t\tif(this._direction === Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tthis.minimumTrack.x = 0;\n\t\t\t\tif(showButtons)\n\t\t\t\t{\n\t\t\t\t\tthis.minimumTrack.y = this.decrementButton.height;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.minimumTrack.y = 0;\n\t\t\t\t}\n\t\t\t\tthis.minimumTrack.width = this.actualWidth;\n\t\t\t\tthis.minimumTrack.height = (this.thumb.y + this.thumb.height / 2) - this.minimumTrack.y;\n\n\t\t\t\tthis.maximumTrack.x = 0;\n\t\t\t\tthis.maximumTrack.y = this.minimumTrack.y + this.minimumTrack.height;\n\t\t\t\tthis.maximumTrack.width = this.actualWidth;\n\t\t\t\tif(showButtons)\n\t\t\t\t{\n\t\t\t\t\tthis.maximumTrack.height = this.actualHeight - this.incrementButton.height - this.maximumTrack.y;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.maximumTrack.height = this.actualHeight - this.maximumTrack.y;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //horizontal\n\t\t\t{\n\t\t\t\tif(showButtons)\n\t\t\t\t{\n\t\t\t\t\tthis.minimumTrack.x = this.decrementButton.width;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.minimumTrack.x = 0;\n\t\t\t\t}\n\t\t\t\tthis.minimumTrack.y = 0;\n\t\t\t\tthis.minimumTrack.width = (this.thumb.x + this.thumb.width / 2) - this.minimumTrack.x;\n\t\t\t\tthis.minimumTrack.height = this.actualHeight;\n\n\t\t\t\tthis.maximumTrack.x = this.minimumTrack.x + this.minimumTrack.width;\n\t\t\t\tthis.maximumTrack.y = 0;\n\t\t\t\tif(showButtons)\n\t\t\t\t{\n\t\t\t\t\tthis.maximumTrack.width = this.actualWidth - this.incrementButton.width - this.maximumTrack.x;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.maximumTrack.width = this.actualWidth - this.maximumTrack.x;\n\t\t\t\t}\n\t\t\t\tthis.maximumTrack.height = this.actualHeight;\n\t\t\t}\n\n\t\t\t//final validation to avoid juggler next frame issues\n\t\t\tif(this.minimumTrack is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.minimumTrack).validate();\n\t\t\t}\n\t\t\tif(this.maximumTrack is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.maximumTrack).validate();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutTrackWithSingle():void\n\t\t{\n\t\t\tvar range:Number = this._maximum - this._minimum;\n\t\t\tthis.minimumTrack.touchable = range > 0 && range < Number.POSITIVE_INFINITY;\n\n\t\t\tvar showButtons:Boolean = this._maximum != this._minimum;\n\t\t\tif(this._direction === Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tthis.minimumTrack.x = 0;\n\t\t\t\tif(showButtons)\n\t\t\t\t{\n\t\t\t\t\tthis.minimumTrack.y = this.decrementButton.height;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.minimumTrack.y = 0;\n\t\t\t\t}\n\t\t\t\tthis.minimumTrack.width = this.actualWidth;\n\t\t\t\tif(showButtons)\n\t\t\t\t{\n\t\t\t\t\tthis.minimumTrack.height = this.actualHeight - this.minimumTrack.y - this.incrementButton.height;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.minimumTrack.height = this.actualHeight - this.minimumTrack.y;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //horizontal\n\t\t\t{\n\t\t\t\tif(showButtons)\n\t\t\t\t{\n\t\t\t\t\tthis.minimumTrack.x = this.decrementButton.width;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.minimumTrack.x = 0;\n\t\t\t\t}\n\t\t\t\tthis.minimumTrack.y = 0;\n\t\t\t\tif(showButtons)\n\t\t\t\t{\n\t\t\t\t\tthis.minimumTrack.width = this.actualWidth - this.minimumTrack.x - this.incrementButton.width;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.minimumTrack.width = this.actualWidth - this.minimumTrack.x;\n\t\t\t\t}\n\t\t\t\tthis.minimumTrack.height = this.actualHeight;\n\t\t\t}\n\n\t\t\t//final validation to avoid juggler next frame issues\n\t\t\tif(this.minimumTrack is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.minimumTrack).validate();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function locationToValue(location:Point):Number\n\t\t{\n\t\t\tvar percentage:Number = 0;\n\t\t\tif(this._direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tvar trackScrollableHeight:Number = this.actualHeight - this.thumb.height - this.decrementButton.height - this.incrementButton.height - this._paddingTop - this._paddingBottom;\n\t\t\t\tif(trackScrollableHeight > 0)\n\t\t\t\t{\n\t\t\t\t\tvar yOffset:Number = location.y - this._touchStartY - this._paddingTop;\n\t\t\t\t\tvar yPosition:Number = Math.min(Math.max(0, this._thumbStartY + yOffset - this.decrementButton.height), trackScrollableHeight);\n\t\t\t\t\tpercentage = yPosition / trackScrollableHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //horizontal\n\t\t\t{\n\t\t\t\tvar trackScrollableWidth:Number = this.actualWidth - this.thumb.width - this.decrementButton.width - this.incrementButton.width - this._paddingLeft - this._paddingRight;\n\t\t\t\tif(trackScrollableWidth > 0)\n\t\t\t\t{\n\t\t\t\t\tvar xOffset:Number = location.x - this._touchStartX - this._paddingLeft;\n\t\t\t\t\tvar xPosition:Number = Math.min(Math.max(0, this._thumbStartX + xOffset - this.decrementButton.width), trackScrollableWidth);\n\t\t\t\t\tpercentage = xPosition / trackScrollableWidth;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this._minimum + percentage * (this._maximum - this._minimum);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function decrement():void\n\t\t{\n\t\t\tthis.value -= this._step;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function increment():void\n\t\t{\n\t\t\tthis.value += this._step;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function adjustPage():void\n\t\t{\n\t\t\tvar range:Number = this._maximum - this._minimum;\n\t\t\tvar adjustedPage:Number = this._page;\n\t\t\tif(this._page == 0)\n\t\t\t{\n\t\t\t\tadjustedPage = this._step;\n\t\t\t}\n\t\t\tif(adjustedPage > range)\n\t\t\t{\n\t\t\t\tadjustedPage = range;\n\t\t\t}\n\t\t\tif(this._touchValue < this._pageStartValue)\n\t\t\t{\n\t\t\t\tvar newValue:Number = Math.max(this._touchValue, this._value - adjustedPage);\n\t\t\t\tif(this._step != 0 && newValue != this._maximum && newValue != this._minimum)\n\t\t\t\t{\n\t\t\t\t\tnewValue = roundDownToNearest(newValue, this._step);\n\t\t\t\t}\n\t\t\t\tthis.value = newValue;\n\t\t\t}\n\t\t\telse if(this._touchValue > this._pageStartValue)\n\t\t\t{\n\t\t\t\tnewValue = Math.min(this._touchValue, this._value + adjustedPage);\n\t\t\t\tif(this._step != 0 && newValue != this._maximum && newValue != this._minimum)\n\t\t\t\t{\n\t\t\t\t\tnewValue = roundUpToNearest(newValue, this._step);\n\t\t\t\t}\n\t\t\t\tthis.value = newValue;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function startRepeatTimer(action:Function):void\n\t\t{\n\t\t\tthis.currentRepeatAction = action;\n\t\t\tif(this._repeatDelay > 0)\n\t\t\t{\n\t\t\t\tif(!this._repeatTimer)\n\t\t\t\t{\n\t\t\t\t\tthis._repeatTimer = new Timer(this._repeatDelay * 1000);\n\t\t\t\t\tthis._repeatTimer.addEventListener(TimerEvent.TIMER, repeatTimer_timerHandler);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._repeatTimer.reset();\n\t\t\t\t\tthis._repeatTimer.delay = this._repeatDelay * 1000;\n\t\t\t\t}\n\t\t\t\tthis._repeatTimer.start();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function thumbProperties_onChange(proxy:PropertyProxy, name:Object):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function minimumTrackProperties_onChange(proxy:PropertyProxy, name:Object):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function maximumTrackProperties_onChange(proxy:PropertyProxy, name:Object):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function decrementButtonProperties_onChange(proxy:PropertyProxy, name:Object):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function incrementButtonProperties_onChange(proxy:PropertyProxy, name:Object):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tthis._touchPointID = -1;\n\t\t\tif(this._repeatTimer)\n\t\t\t{\n\t\t\t\tthis._repeatTimer.stop();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function track_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar track:DisplayObject = DisplayObject(event.currentTarget);\n\t\t\tif(this._touchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(track, null, this._touchPointID);\n\t\t\t\tif(touch === null)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(touch.phase === TouchPhase.MOVED)\n\t\t\t\t{\n\t\t\t\t\tvar location:Point = touch.getLocation(this, Pool.getPoint());\n\t\t\t\t\tthis._touchValue = this.locationToValue(location);\n\t\t\t\t\tPool.putPoint(location);\n\t\t\t\t}\n\t\t\t\telse if(touch.phase === TouchPhase.ENDED)\n\t\t\t\t{\n\t\t\t\t\tthis._touchPointID = -1;\n\t\t\t\t\tthis._repeatTimer.stop();\n\t\t\t\t\tthis.dispatchEventWith(FeathersEventType.END_INTERACTION);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(track, TouchPhase.BEGAN);\n\t\t\t\tif(touch === null)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._touchPointID = touch.id;\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.BEGIN_INTERACTION);\n\t\t\t\tlocation = touch.getLocation(this, Pool.getPoint());\n\t\t\t\tthis._touchStartX = location.x;\n\t\t\t\tthis._touchStartY = location.y;\n\t\t\t\tthis._thumbStartX = this._touchStartX;\n\t\t\t\tthis._thumbStartY = this._touchStartY;\n\t\t\t\tthis._touchValue = this.locationToValue(location);\n\t\t\t\tPool.putPoint(location);\n\t\t\t\tthis._pageStartValue = this._value;\n\t\t\t\tthis.adjustPage();\n\t\t\t\tthis.startRepeatTimer(this.adjustPage);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function thumb_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this._touchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(this.thumb, null, this._touchPointID);\n\t\t\t\tif(touch === null)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(touch.phase === TouchPhase.MOVED)\n\t\t\t\t{\n\t\t\t\t\tvar location:Point = touch.getLocation(this, Pool.getPoint());\n\t\t\t\t\tvar newValue:Number = this.locationToValue(location);\n\t\t\t\t\tPool.putPoint(location);\n\t\t\t\t\tif(this._step != 0 && newValue != this._maximum && newValue != this._minimum)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewValue = roundToNearest(newValue, this._step);\n\t\t\t\t\t}\n\t\t\t\t\tthis.value = newValue;\n\t\t\t\t}\n\t\t\t\telse if(touch.phase === TouchPhase.ENDED)\n\t\t\t\t{\n\t\t\t\t\tthis._touchPointID = -1;\n\t\t\t\t\tthis.isDragging = false;\n\t\t\t\t\tif(!this.liveDragging)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\t}\n\t\t\t\t\tthis.dispatchEventWith(FeathersEventType.END_INTERACTION);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(this.thumb, TouchPhase.BEGAN);\n\t\t\t\tif(touch === null)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlocation = touch.getLocation(this, Pool.getPoint());\n\t\t\t\tthis._touchPointID = touch.id;\n\t\t\t\tthis._thumbStartX = this.thumb.x;\n\t\t\t\tthis._thumbStartY = this.thumb.y;\n\t\t\t\tthis._touchStartX = location.x;\n\t\t\t\tthis._touchStartY = location.y;\n\t\t\t\tPool.putPoint(location);\n\t\t\t\tthis.isDragging = true;\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.BEGIN_INTERACTION);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function decrementButton_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this._touchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(this.decrementButton, TouchPhase.ENDED, this._touchPointID);\n\t\t\t\tif(touch === null)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t\tthis._repeatTimer.stop();\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.END_INTERACTION);\n\t\t\t}\n\t\t\telse //if we get here, we don't have a saved touch ID yet\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(this.decrementButton, TouchPhase.BEGAN);\n\t\t\t\tif(touch === null)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._touchPointID = touch.id;\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.BEGIN_INTERACTION);\n\t\t\t\tthis.decrement();\n\t\t\t\tthis.startRepeatTimer(this.decrement);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function incrementButton_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this._touchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(this.incrementButton, TouchPhase.ENDED, this._touchPointID);\n\t\t\t\tif(touch === null)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t\tthis._repeatTimer.stop();\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.END_INTERACTION);\n\t\t\t}\n\t\t\telse //if we get here, we don't have a saved touch ID yet\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(this.incrementButton, TouchPhase.BEGAN);\n\t\t\t\tif(touch === null)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._touchPointID = touch.id;\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.BEGIN_INTERACTION);\n\t\t\t\tthis.increment();\n\t\t\t\tthis.startRepeatTimer(this.increment);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function repeatTimer_timerHandler(event:TimerEvent):void\n\t\t{\n\t\t\tif(this._repeatTimer.currentCount < 5)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.currentRepeatAction();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/ScrollBarDisplayMode.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\t/**\n\t * Constants that define how scroll bars are displayed in a container.\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class ScrollBarDisplayMode\n\t{\n\t\t/**\n\t\t * The scroll bars appear above the scroller's view port, overlapping\n\t\t * the content, and they fade out when not in use.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const FLOAT:String = \"float\";\n\n\t\t/**\n\t\t * The scroll bars are always visible and appear next to the scroller's\n\t\t * view port, making the view port smaller than the scroller.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const FIXED:String = \"fixed\";\n\n\t\t/**\n\t\t * The scroll bars appear above the scroller's view port, overlapping\n\t\t * the content, but they do not fade out when not in use.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const FIXED_FLOAT:String = \"fixedFloat\";\n\n\t\t/**\n\t\t * The scroll bars are never visible.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const NONE:String = \"none\";\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/ScrollContainer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.controls.supportClasses.LayoutViewPort;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IFocusContainer;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.ILayout;\n\timport feathers.layout.ILayoutDisplayObject;\n\timport feathers.layout.IVirtualLayout;\n\timport feathers.skins.IStyleProvider;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.DisplayObjectContainer;\n\timport starling.events.Event;\n\n\t/**\n\t * Controls the way that the container's children are positioned and\n\t * sized.\n\t *\n\t * <p>The following example tells the container to use a horizontal layout:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var layout:HorizontalLayout = new HorizontalLayout();\n\t * layout.gap = 20;\n\t * layout.padding = 20;\n\t * container.layout = layout;</listing>\n\t *\n\t * @default null\n\t */\n\t[Style(name=\"layout\",type=\"feathers.layout.ILayout\")]\n\n\t/**\n\t * A generic container that supports layout, scrolling, and a background\n\t * skin. For a lighter container, see <code>LayoutGroup</code>, which\n\t * focuses specifically on layout without scrolling.\n\t *\n\t * <p>The following example creates a scroll container with a horizontal\n\t * layout and adds two buttons to it:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var container:ScrollContainer = new ScrollContainer();\n\t * var layout:HorizontalLayout = new HorizontalLayout();\n\t * layout.gap = 20;\n\t * layout.padding = 20;\n\t * container.layout = layout;\n\t * this.addChild( container );\n\t * \n\t * var yesButton:Button = new Button();\n\t * yesButton.label = \"Yes\";\n\t * container.addChild( yesButton );\n\t * \n\t * var noButton:Button = new Button();\n\t * noButton.label = \"No\";\n\t * container.addChild( noButton );</listing>\n\t *\n\t * @see ../../../help/scroll-container.html How to use the Feathers ScrollContainer component\n\t * @see feathers.controls.LayoutGroup\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class ScrollContainer extends Scroller implements IScrollContainer, IFocusContainer\n\t{\n\t\t/**\n\t\t * An alternate style name to use with <code>ScrollContainer</code> to\n\t\t * allow a theme to give it a toolbar style. If a theme does not provide\n\t\t * a style for the toolbar container, the theme will automatically fall\n\t\t * back to using the default scroll container skin.\n\t\t *\n\t\t * <p>An alternate style name should always be added to a component's\n\t\t * <code>styleNameList</code> before the component is initialized. If\n\t\t * the style name is added later, it will be ignored.</p>\n\t\t *\n\t\t * <p>In the following example, the toolbar style is applied to a scroll\n\t\t * container:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var container:ScrollContainer = new ScrollContainer();\n\t\t * container.styleNameList.add( ScrollContainer.ALTERNATE_STYLE_NAME_TOOLBAR );\n\t\t * this.addChild( container );</listing>\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const ALTERNATE_STYLE_NAME_TOOLBAR:String = \"feathers-toolbar-scroll-container\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>ScrollContainer</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function ScrollContainer()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.layoutViewPort = new LayoutViewPort();\n\t\t\tthis.viewPort = this.layoutViewPort;\n\t\t\tthis.addEventListener(Event.ADDED_TO_STAGE, scrollContainer_addedToStageHandler);\n\t\t\tthis.addEventListener(Event.REMOVED_FROM_STAGE, scrollContainer_removedFromStageHandler);\n\t\t}\n\n\t\t/**\n\t\t * A flag that indicates if the display list functions like <code>addChild()</code>\n\t\t * and <code>removeChild()</code> will be passed to the internal view\n\t\t * port.\n\t\t */\n\t\tprotected var displayListBypassEnabled:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var layoutViewPort:LayoutViewPort;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn ScrollContainer.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isChildFocusEnabled:Boolean = true;\n\n\t\t/**\n\t\t * @copy feathers.core.IFocusContainer#isChildFocusEnabled\n\t\t *\n\t\t * @default true\n\t\t *\n\t\t * @see #isFocusEnabled\n\t\t */\n\t\tpublic function get isChildFocusEnabled():Boolean\n\t\t{\n\t\t\treturn this._isEnabled && this._isChildFocusEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isChildFocusEnabled(value:Boolean):void\n\t\t{\n\t\t\tthis._isChildFocusEnabled = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _layout:ILayout;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get layout():ILayout\n\t\t{\n\t\t\treturn this._layout;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set layout(value:ILayout):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._layout === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._layout = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _autoSizeMode:String = AutoSizeMode.CONTENT;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"stage,content\")]\n\t\t/**\n\t\t * Determines how the container will set its own size when its\n\t\t * dimensions (width and height) aren't set explicitly.\n\t\t *\n\t\t * <p>In the following example, the container will be sized to\n\t\t * match the stage:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * container.autoSizeMode = AutoSizeMode.STAGE;</listing>\n\t\t *\n\t\t * <p>Usually defaults to <code>AutoSizeMode.CONTENT</code>. However, if\n\t\t * this component is the root of the Starling display list, defaults to\n\t\t * <code>AutoSizeMode.STAGE</code> instead.</p>\n\t\t *\n\t\t * @see feathers.controls.AutoSizeMode#STAGE\n\t\t * @see feathers.controls.AutoSizeMode#CONTENT\n\t\t */\n\t\tpublic function get autoSizeMode():String\n\t\t{\n\t\t\treturn this._autoSizeMode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set autoSizeMode(value:String):void\n\t\t{\n\t\t\tif(this._autoSizeMode == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._autoSizeMode = value;\n\t\t\tthis._measureViewPort = this._autoSizeMode != AutoSizeMode.STAGE;\n\t\t\tif(this.stage !== null)\n\t\t\t{\n\t\t\t\tif(this._autoSizeMode === AutoSizeMode.STAGE)\n\t\t\t\t{\n\t\t\t\t\tthis.stage.addEventListener(Event.RESIZE, scrollContainer_stage_resizeHandler);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.stage.removeEventListener(Event.RESIZE, scrollContainer_stage_resizeHandler);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _ignoreChildChanges:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t * This is similar to _ignoreChildChanges, but setInvalidationFlag()\n\t\t * may still be called.\n\t\t */\n\t\tprotected var _ignoreChildChangesButSetFlags:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function get numChildren():int\n\t\t{\n\t\t\tif(!this.displayListBypassEnabled)\n\t\t\t{\n\t\t\t\treturn super.numChildren;\n\t\t\t}\n\t\t\treturn DisplayObjectContainer(this.viewPort).numChildren;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get numRawChildren():int\n\t\t{\n\t\t\tvar oldBypass:Boolean = this.displayListBypassEnabled;\n\t\t\tthis.displayListBypassEnabled = false;\n\t\t\tvar result:int = super.numChildren;\n\t\t\tthis.displayListBypassEnabled = oldBypass;\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function getChildByName(name:String):DisplayObject\n\t\t{\n\t\t\tif(!this.displayListBypassEnabled)\n\t\t\t{\n\t\t\t\treturn super.getChildByName(name);\n\t\t\t}\n\t\t\treturn DisplayObjectContainer(this.viewPort).getChildByName(name);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getRawChildByName(name:String):DisplayObject\n\t\t{\n\t\t\tvar oldBypass:Boolean = this.displayListBypassEnabled;\n\t\t\tthis.displayListBypassEnabled = false;\n\t\t\tvar child:DisplayObject = super.getChildByName(name);\n\t\t\tthis.displayListBypassEnabled = oldBypass;\n\t\t\treturn child;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function getChildAt(index:int):DisplayObject\n\t\t{\n\t\t\tif(!this.displayListBypassEnabled)\n\t\t\t{\n\t\t\t\treturn super.getChildAt(index);\n\t\t\t}\n\t\t\treturn DisplayObjectContainer(this.viewPort).getChildAt(index);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getRawChildAt(index:int):DisplayObject\n\t\t{\n\t\t\tvar oldBypass:Boolean = this.displayListBypassEnabled;\n\t\t\tthis.displayListBypassEnabled = false;\n\t\t\tvar child:DisplayObject = super.getChildAt(index);\n\t\t\tthis.displayListBypassEnabled = oldBypass;\n\t\t\treturn child;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function addRawChild(child:DisplayObject):DisplayObject\n\t\t{\n\t\t\tvar oldBypass:Boolean = this.displayListBypassEnabled;\n\t\t\tthis.displayListBypassEnabled = false;\n\t\t\tif(child.parent == this)\n\t\t\t{\n\t\t\t\tsuper.setChildIndex(child, super.numChildren);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tchild = super.addChildAt(child, super.numChildren);\n\t\t\t}\n\t\t\tthis.displayListBypassEnabled = oldBypass;\n\t\t\treturn child;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function addChild(child:DisplayObject):DisplayObject\n\t\t{\n\t\t\treturn this.addChildAt(child, this.numChildren);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function addChildAt(child:DisplayObject, index:int):DisplayObject\n\t\t{\n\t\t\tif(!this.displayListBypassEnabled)\n\t\t\t{\n\t\t\t\treturn super.addChildAt(child, index);\n\t\t\t}\n\t\t\tvar result:DisplayObject = DisplayObjectContainer(this.viewPort).addChildAt(child, index);\n\t\t\tif(result is IFeathersControl)\n\t\t\t{\n\t\t\t\tresult.addEventListener(Event.RESIZE, child_resizeHandler);\n\t\t\t}\n\t\t\tif(result is ILayoutDisplayObject)\n\t\t\t{\n\t\t\t\tresult.addEventListener(FeathersEventType.LAYOUT_DATA_CHANGE, child_layoutDataChangeHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function addRawChildAt(child:DisplayObject, index:int):DisplayObject\n\t\t{\n\t\t\tvar oldBypass:Boolean = this.displayListBypassEnabled;\n\t\t\tthis.displayListBypassEnabled = false;\n\t\t\tchild = super.addChildAt(child, index);\n\t\t\tthis.displayListBypassEnabled = oldBypass;\n\t\t\treturn child;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function removeRawChild(child:DisplayObject, dispose:Boolean = false):DisplayObject\n\t\t{\n\t\t\tvar oldBypass:Boolean = this.displayListBypassEnabled;\n\t\t\tthis.displayListBypassEnabled = false;\n\t\t\tvar index:int = super.getChildIndex(child);\n\t\t\tif(index >= 0)\n\t\t\t{\n\t\t\t\tsuper.removeChildAt(index, dispose);\n\t\t\t}\n\t\t\tthis.displayListBypassEnabled = oldBypass;\n\t\t\treturn child;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function removeChildAt(index:int, dispose:Boolean = false):DisplayObject\n\t\t{\n\t\t\tif(!this.displayListBypassEnabled)\n\t\t\t{\n\t\t\t\treturn super.removeChildAt(index, dispose);\n\t\t\t}\n\t\t\tvar result:DisplayObject = DisplayObjectContainer(this.viewPort).removeChildAt(index, dispose);\n\t\t\tif(result is IFeathersControl)\n\t\t\t{\n\t\t\t\tresult.removeEventListener(Event.RESIZE, child_resizeHandler);\n\t\t\t}\n\t\t\tif(result is ILayoutDisplayObject)\n\t\t\t{\n\t\t\t\tresult.removeEventListener(FeathersEventType.LAYOUT_DATA_CHANGE, child_layoutDataChangeHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function removeRawChildAt(index:int, dispose:Boolean = false):DisplayObject\n\t\t{\n\t\t\tvar oldBypass:Boolean = this.displayListBypassEnabled;\n\t\t\tthis.displayListBypassEnabled = false;\n\t\t\tvar child:DisplayObject = super.removeChildAt(index, dispose);\n\t\t\tthis.displayListBypassEnabled = oldBypass;\n\t\t\treturn child;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function getChildIndex(child:DisplayObject):int\n\t\t{\n\t\t\tif(!this.displayListBypassEnabled)\n\t\t\t{\n\t\t\t\treturn super.getChildIndex(child);\n\t\t\t}\n\t\t\treturn DisplayObjectContainer(this.viewPort).getChildIndex(child);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getRawChildIndex(child:DisplayObject):int\n\t\t{\n\t\t\tvar oldBypass:Boolean = this.displayListBypassEnabled;\n\t\t\tthis.displayListBypassEnabled = false;\n\t\t\tvar index:int = super.getChildIndex(child);\n\t\t\tthis.displayListBypassEnabled = oldBypass;\n\t\t\treturn index;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function setChildIndex(child:DisplayObject, index:int):void\n\t\t{\n\t\t\tif(!this.displayListBypassEnabled)\n\t\t\t{\n\t\t\t\tsuper.setChildIndex(child, index);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tDisplayObjectContainer(this.viewPort).setChildIndex(child, index);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function setRawChildIndex(child:DisplayObject, index:int):void\n\t\t{\n\t\t\tvar oldBypass:Boolean = this.displayListBypassEnabled;\n\t\t\tthis.displayListBypassEnabled = false;\n\t\t\tsuper.setChildIndex(child, index);\n\t\t\tthis.displayListBypassEnabled = oldBypass;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function swapRawChildren(child1:DisplayObject, child2:DisplayObject):void\n\t\t{\n\t\t\tvar index1:int = this.getRawChildIndex(child1);\n\t\t\tvar index2:int = this.getRawChildIndex(child2);\n\t\t\tif(index1 < 0 || index2 < 0)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"Not a child of this container\");\n\t\t\t}\n\t\t\tvar oldBypass:Boolean = this.displayListBypassEnabled;\n\t\t\tthis.displayListBypassEnabled = false;\n\t\t\tthis.swapRawChildrenAt(index1, index2);\n\t\t\tthis.displayListBypassEnabled = oldBypass;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function swapChildrenAt(index1:int, index2:int):void\n\t\t{\n\t\t\tif(!this.displayListBypassEnabled)\n\t\t\t{\n\t\t\t\tsuper.swapChildrenAt(index1, index2);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tDisplayObjectContainer(this.viewPort).swapChildrenAt(index1, index2);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function swapRawChildrenAt(index1:int, index2:int):void\n\t\t{\n\t\t\tvar oldBypass:Boolean = this.displayListBypassEnabled;\n\t\t\tthis.displayListBypassEnabled = false;\n\t\t\tsuper.swapChildrenAt(index1, index2);\n\t\t\tthis.displayListBypassEnabled = oldBypass;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function sortChildren(compareFunction:Function):void\n\t\t{\n\t\t\tif(!this.displayListBypassEnabled)\n\t\t\t{\n\t\t\t\tsuper.sortChildren(compareFunction);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tDisplayObjectContainer(this.viewPort).sortChildren(compareFunction);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function sortRawChildren(compareFunction:Function):void\n\t\t{\n\t\t\tvar oldBypass:Boolean = this.displayListBypassEnabled;\n\t\t\tthis.displayListBypassEnabled = false;\n\t\t\tsuper.sortChildren(compareFunction);\n\t\t\tthis.displayListBypassEnabled = oldBypass;\n\t\t}\n\n\t\t/**\n\t\t * Readjusts the layout of the container according to its current\n\t\t * content. Call this method when changes to the content cannot be\n\t\t * automatically detected by the container. For instance, Feathers\n\t\t * components dispatch <code>FeathersEventType.RESIZE</code> when their\n\t\t * width and height values change, but standard Starling display objects\n\t\t * like <code>Sprite</code> and <code>Image</code> do not.\n\t\t */\n\t\tpublic function readjustLayout():void\n\t\t{\n\t\t\tthis.layoutViewPort.readjustLayout();\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function validate():void\n\t\t{\n\t\t\t//for the start of validation, we're going to ignore when children\n\t\t\t//resize or dispatch changes to layout data. this allows subclasses\n\t\t\t//to modify children in draw() before the layout is applied.\n\t\t\tvar oldIgnoreChildChanges:Boolean = this._ignoreChildChangesButSetFlags;\n\t\t\tthis._ignoreChildChangesButSetFlags = true;\n\t\t\tsuper.validate();\n\t\t\t//if super.validate() returns without calling draw(), the flag\n\t\t\t//won't be reset before layout is called, so we need reset manually.\n\t\t\tthis._ignoreChildChangesButSetFlags = oldIgnoreChildChanges;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tif(this.stage !== null)\n\t\t\t{\n\t\t\t\t//we use starling.root because a pop-up's root and the stage\n\t\t\t\t//root may be different.\n\t\t\t\tif(this.stage.starling.root === this)\n\t\t\t\t{\n\t\t\t\t\tthis.autoSizeMode = AutoSizeMode.STAGE;\n\t\t\t\t}\n\t\t\t}\n\t\t\tsuper.initialize();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\t//children are allowed to change during draw() in a subclass up\n\t\t\t//until it calls super.draw().\n\t\t\tthis._ignoreChildChangesButSetFlags = false;\n\n\t\t\tvar layoutInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_LAYOUT);\n\n\t\t\tif(layoutInvalid)\n\t\t\t{\n\t\t\t\tif(this._layout is IVirtualLayout)\n\t\t\t\t{\n\t\t\t\t\tIVirtualLayout(this._layout).useVirtualLayout = false;\n\t\t\t\t}\n\t\t\t\tthis.layoutViewPort.layout = this._layout;\n\t\t\t}\n\n\t\t\tvar oldIgnoreChildChanges:Boolean = this._ignoreChildChanges;\n\t\t\tthis._ignoreChildChanges = true;\n\t\t\tsuper.draw();\n\t\t\tthis._ignoreChildChanges = oldIgnoreChildChanges;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(this._autoSizeMode === AutoSizeMode.STAGE &&\n\t\t\t\tthis.stage !== null)\n\t\t\t{\n\t\t\t\tvar newWidth:Number = this.stage.stageWidth;\n\t\t\t\tvar newHeight:Number = this.stage.stageHeight;\n\t\t\t\treturn this.saveMeasurements(newWidth, newHeight, newWidth, newHeight);\n\t\t\t}\n\t\t\treturn super.autoSizeIfNeeded();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function scrollContainer_addedToStageHandler(event:Event):void\n\t\t{\n\t\t\tif(this._autoSizeMode === AutoSizeMode.STAGE)\n\t\t\t{\n\t\t\t\t//if we validated before being added to the stage, or if we've\n\t\t\t\t//been removed from stage and added again, we need to be sure\n\t\t\t\t//that the new stage dimensions are accounted for.\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\n\t\t\t\tthis.stage.addEventListener(Event.RESIZE, scrollContainer_stage_resizeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function scrollContainer_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tthis.stage.removeEventListener(Event.RESIZE, scrollContainer_stage_resizeHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function child_resizeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreChildChanges)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._ignoreChildChangesButSetFlags)\n\t\t\t{\n\t\t\t\tthis.setInvalidationFlag(INVALIDATION_FLAG_SIZE);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function child_layoutDataChangeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreChildChanges)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._ignoreChildChangesButSetFlags)\n\t\t\t{\n\t\t\t\tthis.setInvalidationFlag(INVALIDATION_FLAG_SIZE);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function scrollContainer_stage_resizeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/ScrollInteractionMode.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\t/**\n\t * Different ways that the user can interact with a scrolling container to\n\t * control its scroll position.\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class ScrollInteractionMode\n\t{\n\t\t/**\n\t\t * The user may touch anywhere on the scroller and drag to scroll. The\n\t\t * scroll bars will be visual indicator of position, but they will not\n\t\t * be interactive.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const TOUCH:String = \"touch\";\n\n\t\t/**\n\t\t * The user may only interact with the scroll bars to scroll. The user\n\t\t * cannot touch anywhere in the scroller's content and drag like a touch\n\t\t * interface.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const MOUSE:String = \"mouse\";\n\n\t\t/**\n\t\t * The user may touch anywhere on the scroller and drag to scroll, and\n\t\t * the scroll bars may be dragged separately. For most touch interfaces,\n\t\t * this is not a common behavior. The scroll bar on touch interfaces is\n\t\t * often simply a visual indicator and non-interactive.\n\t\t *\n\t\t * <p>One case where this mode might be used is a \"scroll bar\" that\n\t\t * displays a tappable alphabetical index to navigate a\n\t\t * <code>GroupedList</code> with alphabetical categories.</p>\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const TOUCH_AND_SCROLL_BARS:String = \"touchAndScrollBars\";\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/ScrollPolicy.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\t/**\n\t * Constants that define whether a container allows scrolling or not.\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class ScrollPolicy\n\t{\n\t\t/**\n\t\t * The scroller may scroll if the content is larger than the\n\t\t * view port's bounds. If the interaction mode is touch, the elastic\n\t\t * edges will only be active if the maximum scroll position is greater\n\t\t * than zero. If the scroll bar display mode is fixed, the scroll bar\n\t\t * will only be visible when the maximum scroll position is greater than\n\t\t * zero.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const AUTO:String = \"auto\";\n\n\t\t/**\n\t\t * The scroller will always scroll. If the interaction mode is touch,\n\t\t * elastic edges will always be active, even when the maximum scroll\n\t\t * position is zero. If the scroll bar display mode is fixed, the scroll\n\t\t * bar will always be visible.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const ON:String = \"on\";\n\n\t\t/**\n\t\t * The scroller does not scroll at all, even if the content is larger\n\t\t * than the view port's bounds. If the scroll bar display mode is fixed\n\t\t * or float, the scroll bar will never be visible.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const OFF:String = \"off\";\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/ScrollScreen.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.skins.IStyleProvider;\n\timport feathers.utils.display.getDisplayObjectDepthFromStage;\n\n\timport flash.events.KeyboardEvent;\n\timport flash.ui.Keyboard;\n\n\timport starling.events.Event;\n\n\t/**\n\t * Dispatched when the transition animation begins as the screen is shown\n\t * by the screen navigator.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.TRANSITION_IN_START\n\t */\n\t[Event(name=\"transitionInStart\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the transition animation finishes as the screen is shown\n\t * by the screen navigator.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.TRANSITION_IN_COMPLETE\n\t */\n\t[Event(name=\"transitionInComplete\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the transition animation begins as a different screen is\n\t * shown by the screen navigator and this screen is hidden.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.TRANSITION_OUT_START\n\t */\n\t[Event(name=\"transitionOutStart\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the transition animation finishes as a different screen\n\t * is shown by the screen navigator and this screen is hidden.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.TRANSITION_OUT_COMPLETE\n\t */\n\t[Event(name=\"transitionOutComplete\",type=\"starling.events.Event\")]\n\n\t/**\n\t * A screen for use with <code>ScreenNavigator</code>, based on\n\t * <code>ScrollContainer</code> in order to provide scrolling and layout.\n\t *\n\t * <p>This component is generally not instantiated directly. Instead it is\n\t * typically used as a super class for concrete implementations of screens.\n\t * With that in mind, no code example is included here.</p>\n\t *\n\t * <p>The following example provides a basic framework for a new scroll screen:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * package\n\t * {\n\t *     import feathers.controls.ScrollScreen;\n\t * \n\t *     public class CustomScreen extends ScrollScreen\n\t *     {\n\t *         public function CustomScreen()\n\t *         {\n\t *             super();\n\t *         }\n\t * \n\t *         override protected function initialize():void\n\t *         {\n\t *             //runs once when screen is first added to the stage\n\t *             //a good place to add children and customize the layout\n\t * \n\t *             //don't forget to call this!\n\t *             super.initialize()\n\t *         }\n\t *     }\n\t * }</listing>\n\t *\n\t * @see ../../../help/scroll-screen.html How to use the Feathers ScrollScreen component\n\t * @see feathers.controls.StackScreenNavigator\n\t * @see feathers.controls.ScreenNavigator\n\t *\n\t * @productversion Feathers 1.3.0\n\t */\n\tpublic class ScrollScreen extends ScrollContainer implements IScreen\n\t{\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>ScrollScreen</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function ScrollScreen()\n\t\t{\n\t\t\tthis.addEventListener(Event.ADDED_TO_STAGE, scrollScreen_addedToStageHandler);\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn ScrollScreen.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _screenID:String;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get screenID():String\n\t\t{\n\t\t\treturn this._screenID;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set screenID(value:String):void\n\t\t{\n\t\t\tthis._screenID = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _owner:Object;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get owner():Object\n\t\t{\n\t\t\treturn this._owner;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set owner(value:Object):void\n\t\t{\n\t\t\tthis._owner = value;\n\t\t}\n\n\t\t/**\n\t\t * Optional callback for the back hardware key. Automatically handles\n\t\t * keyboard events to cancel the default behavior.\n\t\t *\n\t\t * <p>This function has the following signature:</p>\n\t\t *\n\t\t * <pre>function():void</pre>\n\t\t *\n\t\t * <p>In the following example, a function will dispatch <code>Event.COMPLETE</code>\n\t\t * when the back button is pressed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * this.backButtonHandler = onBackButton;\n\t\t * \n\t\t * private function onBackButton():void\n\t\t * {\n\t\t *     this.dispatchEvent( Event.COMPLETE );\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tprotected var backButtonHandler:Function;\n\n\t\t/**\n\t\t * Optional callback for the menu hardware key. Automatically handles\n\t\t * keyboard events to cancel the default behavior.\n\t\t *\n\t\t * <p>This function has the following signature:</p>\n\t\t *\n\t\t * <pre>function():void</pre>\n\t\t *\n\t\t * <p>In the following example, a function will be called when the menu\n\t\t * button is pressed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * this.menuButtonHandler = onMenuButton;\n\t\t * \n\t\t * private function onMenuButton():void\n\t\t * {\n\t\t *     //do something with the menu button\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tprotected var menuButtonHandler:Function;\n\n\t\t/**\n\t\t * Optional callback for the search hardware key. Automatically handles\n\t\t * keyboard events to cancel the default behavior.\n\t\t *\n\t\t * <p>This function has the following signature:</p>\n\t\t *\n\t\t * <pre>function():void</pre>\n\t\t *\n\t\t * <p>In the following example, a function will be called when the search\n\t\t * button is pressed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * this.searchButtonHandler = onSearchButton;\n\t\t * \n\t\t * private function onSearchButton():void\n\t\t * {\n\t\t *     //do something with the search button\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tprotected var searchButtonHandler:Function;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function scrollScreen_addedToStageHandler(event:Event):void\n\t\t{\n\t\t\tthis.addEventListener(Event.REMOVED_FROM_STAGE, scrollScreen_removedFromStageHandler);\n\t\t\t//using priority here is a hack so that objects higher up in the\n\t\t\t//display list have a chance to cancel the event first.\n\t\t\tvar priority:int = -getDisplayObjectDepthFromStage(this);\n\t\t\tthis.stage.starling.nativeStage.addEventListener(KeyboardEvent.KEY_DOWN, scrollScreen_nativeStage_keyDownHandler, false, priority, true);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function scrollScreen_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tthis.removeEventListener(Event.REMOVED_FROM_STAGE, scrollScreen_removedFromStageHandler);\n\t\t\tthis.stage.starling.nativeStage.removeEventListener(KeyboardEvent.KEY_DOWN, scrollScreen_nativeStage_keyDownHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function scrollScreen_nativeStage_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(event.isDefaultPrevented())\n\t\t\t{\n\t\t\t\t//someone else already handled this one\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this.backButtonHandler != null &&\n\t\t\t\tevent.keyCode == Keyboard.BACK)\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.backButtonHandler();\n\t\t\t}\n\n\t\t\tif(this.menuButtonHandler != null &&\n\t\t\t\tevent.keyCode == Keyboard.MENU)\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.menuButtonHandler();\n\t\t\t}\n\n\t\t\tif(this.searchButtonHandler != null &&\n\t\t\t\tevent.keyCode == Keyboard.SEARCH)\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.searchButtonHandler();\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/ScrollText.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.controls.supportClasses.TextFieldViewPort;\n\timport feathers.core.INativeFocusOwner;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.text.FontStylesSet;\n\n\timport flash.text.AntiAliasType;\n\timport flash.text.GridFitType;\n\timport flash.text.StyleSheet;\n\timport flash.text.TextFormat;\n\n\timport starling.events.Event;\n\timport starling.text.TextFormat;\n\n\t/**\n\t * The type of anti-aliasing used for this text field, defined as\n\t * constants in the <code>flash.text.AntiAliasType</code> class.\n\t *\n\t * <p>In the following example, the anti-alias type is changed:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * textRenderer.antiAliasType = AntiAliasType.NORMAL;</listing>\n\t *\n\t * @default flash.text.AntiAliasType.ADVANCED\n\t *\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#antiAliasType Full description of flash.text.TextField.antiAliasType in Adobe's Flash Platform API Reference\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/AntiAliasType.html flash.text.AntiAliasType\n\t */\n\t[Style(name=\"antiAliasType\",type=\"String\")]\n\n\t/**\n\t * Specifies whether the text field has a background fill. Use the\n\t * <code>backgroundColor</code> property to set the background color of\n\t * a text field.\n\t *\n\t * <p>In the following example, the background is enabled:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollText.background = true;\n\t * scrollText.backgroundColor = 0xff0000;</listing>\n\t *\n\t * @default false\n\t *\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#background Full description of flash.text.TextField.background in Adobe's Flash Platform API Reference\n\t * @see #style:backgroundColor\n\t */\n\t[Style(name=\"background\",type=\"Boolean\")]\n\n\t/**\n\t * The color of the text field background that is displayed if the\n\t * <code>background</code> property is set to <code>true</code>.\n\t *\n\t * <p>In the following example, the background color is changed:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollText.background = true;\n\t * scrollText.backgroundColor = 0xff000ff;</listing>\n\t *\n\t * @default 0xffffff\n\t *\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#backgroundColor Full description of flash.text.TextField.backgroundColor in Adobe's Flash Platform API Reference\n\t * @see #style:background\n\t */\n\t[Style(name=\"backgroundColor\",type=\"uint\")]\n\n\t/**\n\t * Specifies whether the text field has a border. Use the\n\t * <code>borderColor</code> property to set the border color.\n\t *\n\t * <p>In the following example, the border is enabled:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollText.border = true;\n\t * scrollText.borderColor = 0xff0000;</listing>\n\t *\n\t * @default false\n\t *\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#border Full description of flash.text.TextField.border in Adobe's Flash Platform API Reference\n\t * @see #style:borderColor\n\t */\n\t[Style(name=\"border\",type=\"Boolean\")]\n\n\t/**\n\t * The color of the text field border that is displayed if the\n\t * <code>border</code> property is set to <code>true</code>.\n\t *\n\t * <p>In the following example, the border color is changed:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollText.border = true;\n\t * scrollText.borderColor = 0xff00ff;</listing>\n\t *\n\t * @default 0x000000\n\t *\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#borderColor Full description of flash.text.TextField.borderColor in Adobe's Flash Platform API Reference\n\t * @see #style:border\n\t */\n\t[Style(name=\"borderColor\",type=\"uint\")]\n\n\t/**\n\t * If set to <code>true</code>, an internal bitmap representation of the\n\t * <code>TextField</code> on the classic display list is cached by the\n\t * runtime. This caching may affect performance.\n\t *\n\t * <p>In the following example, bitmap caching is disabled:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollText.cacheAsBitmap = false;</listing>\n\t *\n\t * @default true\n\t *\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/DisplayObject.html#cacheAsBitmap Full description of flash.display.DisplayObject.cacheAsBitmap in Adobe's Flash Platform API Reference\n\t */\n\t[Style(name=\"cacheAsBitmap\",type=\"Boolean\")]\n\n\t/**\n\t * A boolean value that specifies whether extra white space (spaces,\n\t * line breaks, and so on) in a text field with HTML text is removed.\n\t *\n\t * <p>In the following example, whitespace is condensed:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollText.condenseWhite = true;</listing>\n\t *\n\t * @default false\n\t *\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#condenseWhite Full description of flash.text.TextField.condenseWhite in Adobe's Flash Platform API Reference\n\t * @see #isHTML\n\t */\n\t[Style(name=\"condenseWhite\",type=\"Boolean\")]\n\n\t/**\n\t * The font styles used to display the label's text when the label is\n\t * disabled.\n\t *\n\t * <p>If the <code>textFormat</code> property or the\n\t * <code>disabledTextFormat</code> property is not <code>null</code>,\n\t * the <code>disabledFontStyles</code> property will be ignored.</p>\n\t *\n\t * <p>In the following example, the disabled font styles are customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * label.disabledFontStyles = new TextFormat( \"Helvetica\", 20, 0x999999 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but <code>ScrollText</code> supports\n\t * a larger number of ways to be customized. Use the\n\t * <code>disabledTextFormat</code> property to set more advanced styles\n\t * on the text renderer. If the <code>disabledTextFormat</code> property\n\t * is not <code>null</code>, the <code>disabledFontStyles</code>\n\t * property will be ignored.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:fontStyles\n\t */\n\t[Style(name=\"disabledFontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * Advanced font formatting used to draw the text when the component is\n\t * disabled if <code>disabledFontStyles</code> cannot be used.\n\t *\n\t * <p>If this property is not <code>null</code>, the\n\t * <code>disabledFontStyles</code> property will be ignored.</p>\n\t *\n\t * <p>Note: It is considered best practice to use the\n\t * <code>fontStyles</code> and <code>disabledFontStyles</code>\n\t * properties with <code>starling.text.TextFormat</code> for font\n\t * formatting. The <code>textFormat</code> property is available for\n\t * advanced uses where features of <code>flash.text.TextField</code>\n\t * that are not exposed by Starling's <code>TextFormat</code> need to be\n\t * customized. In most cases, these advanced features are not required.</p>\n\t *\n\t * <p>In the following example, the disabled text format is changed:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * textRenderer.isEnabled = false;\n\t * textRenderer.disabledTextFormat = new TextFormat( \"_sans\", 16, 0xcccccc );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:disabledFontStyles\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextFormat.html flash.text.TextFormat\n\t */\n\t[Style(name=\"disabledTextFormat\",type=\"flash.text.TextFormat\")]\n\n\t/**\n\t * Specifies whether the text field is a password text field that hides\n\t * the input characters using asterisks instead of the actual\n\t * characters.\n\t *\n\t * <p>In the following example, the text is displayed as a password:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollText.displayAsPassword = true;</listing>\n\t *\n\t * @default false\n\t *\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#displayAsPassword Full description of flash.text.TextField.displayAsPassword in Adobe's Flash Platform API Reference\n\t */\n\t[Style(name=\"displayAsPassword\",type=\"Boolean\")]\n\n\t/**\n\t * If advanced <code>flash.text.TextFormat</code> styles are specified,\n\t * determines if the component should use an embedded font or not. If\n\t * the specified font is not actually embedded, the text may not be\n\t * displayed at all.\n\t *\n\t * <p>If the font styles are passed in using\n\t * <code>starling.text.TextFormat</code>, the component  will automatically\n\t * detect if a font is embedded or not, and the <code>embedFonts</code>\n\t * property will be ignored if it is set to <code>false</code>. Setting it\n\t * to <code>true</code> will force the component to always try to use\n\t * embedded fonts.</p>\n\t *\n\t * <p>In the following example, some text is formatted with an embedded\n\t * font:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollText.textFormat = new TextFormat( \"Source Sans Pro\", 16, 0x333333;\n\t * scrollText.embedFonts = true;</listing>\n\t *\n\t * @default false\n\t *\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#embedFonts Full description of flash.text.TextField.embedFonts in Adobe's Flash Platform API Reference\n\t * @see #textFormat\n\t */\n\t[Style(name=\"embedFonts\",type=\"Boolean\")]\n\n\t/**\n\t * The font styles used to display the label's text.\n\t *\n\t * <p>In the following example, the font styles are customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * label.fontStyles = new TextFormat( \"Helvetica\", 20, 0xcc0000 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but <code>ScrollText</code> supports\n\t * a larger number of ways to be customized. Use the\n\t * <code>textFormat</code> property to set more advanced styles\n\t * on the text renderer. If the <code>textFormat</code> property is not\n\t * <code>null</code>, the <code>fontStyles</code> property will be\n\t * ignored.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:disabledFontStyles\n\t */\n\t[Style(name=\"fontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * Determines whether Flash Player forces strong horizontal and vertical\n\t * lines to fit to a pixel or subpixel grid, or not at all using the\n\t * constants defined in the <code>flash.text.GridFitType</code> class.\n\t * This property applies only if the <code>antiAliasType</code> property\n\t * of the text field is set to <code>flash.text.AntiAliasType.ADVANCED</code>.\n\t *\n\t * <p>In the following example, the grid fit type is changed:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollText.gridFitType = GridFitType.SUBPIXEL;</listing>\n\t *\n\t * @default flash.text.GridFitType.PIXEL\n\t *\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#gridFitType Full description of flash.text.TextField.gridFitType in Adobe's Flash Platform API Reference\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/GridFitType.html flash.text.GridFitType\n\t * @see #style:antiAliasType\n\t */\n\t[Style(name=\"gridFitType\",type=\"String\")]\n\n\t/**\n\t * Quickly sets all outer padding properties to the same value. The\n\t * <code>outerPadding</code> getter always returns the value of\n\t * <code>outerPaddingTop</code>, but the other padding values may be\n\t * different.\n\t *\n\t * <p>In the following example, the outer padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * panel.outerPadding = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:outerPaddingTop\n\t * @see #style:outerPaddingRight\n\t * @see #style:outerPaddingBottom\n\t * @see #style:outerPaddingLeft\n\t * @see feathers.controls.Scroller#style:padding\n\t */\n\t[Style(name=\"outerPadding\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the view port's top edge and the\n\t * top edge of the component.\n\t *\n\t * <p>Note: The <code>paddingTop</code> property applies to padding inside\n\t * the view port, and may not be visible on all sides if the text may be\n\t * scroll. Use <code>outerPaddingTop</code> if you want to always display\n\t * padding on the top side of the component. <code>outerPaddingTop</code>\n\t * and <code>paddingTop</code> may be used simultaneously to define\n\t * padding around the outer edges of the container and additional padding\n\t * around the text.</p>\n\t *\n\t * <p>In the following example, the top padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * panel.outerPaddingTop = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:outerPadding\n\t * @see feathers.controls.Scroller#style:paddingTop\n\t */\n\t[Style(name=\"outerPaddingTop\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the view port's right edge and the\n\t * right edge of the component.\n\t *\n\t * <p>Note: The <code>paddingRight</code> property applies to padding inside\n\t * the view port, and may not be visible on all sides if the text may be\n\t * scroll. Use <code>outerPaddingRight</code> if you want to always display\n\t * padding on the right side of the component. <code>outerPaddingRight</code>\n\t * and <code>paddingRight</code> may be used simultaneously to define\n\t * padding around the outer edges of the container and additional padding\n\t * around the text.</p>\n\t *\n\t * <p>In the following example, the right outer padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * panel.outerPaddingRight = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:outerPadding\n\t * @see feathers.controls.Scroller#style:paddingRight\n\t */\n\t[Style(name=\"outerPaddingRight\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the view port's bottom edge and the\n\t * bottom edge of the component.\n\t *\n\t * <p>Note: The <code>paddingBottom</code> property applies to padding inside\n\t * the view port, and may not be visible on all sides if the text may be\n\t * scroll. Use <code>outerPaddingBottom</code> if you want to always display\n\t * padding on the bottom edge of the component. <code>outerPaddingBottom</code>\n\t * and <code>paddingBottom</code> may be used simultaneously to define\n\t * padding around the outer edges of the container and additional padding\n\t * around the text.</p>\n\t *\n\t * <p>In the following example, the bottom outer padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * panel.outerPaddingBottom = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:outerPadding\n\t * @see feathers.controls.Scroller#style:paddingBottom\n\t */\n\t[Style(name=\"outerPaddingBottom\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the view port's left edge and the\n\t * left edge of the component.\n\t *\n\t * <p>Note: The <code>paddingLeft</code> property applies to padding inside\n\t * the view port, and may not be visible on all sides if the text may be\n\t * scroll. Use <code>outerPaddingLeft</code> if you want to always display\n\t * padding on the left side of the component. <code>outerPaddingLeft</code>\n\t * and <code>paddingLeft</code> may be used simultaneously to define\n\t * padding around the outer edges of the container and additional padding\n\t * around the text.</p>\n\t *\n\t * <p>In the following example, the left outer padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollText.outerPaddingLeft = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:outerPadding\n\t * @see feathers.controls.Scroller#style:paddingLeft\n\t */\n\t[Style(name=\"outerPaddingLeft\",type=\"Number\")]\n\n\t/**\n\t * The sharpness of the glyph edges in this text field. This property\n\t * applies only if the <code>antiAliasType</code> property of the text\n\t * field is set to <code>flash.text.AntiAliasType.ADVANCED</code>. The\n\t * range for <code>sharpness</code> is a number from <code>-400</code>\n\t * to <code>400</code>.\n\t *\n\t * <p>In the following example, the sharpness is changed:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollText.sharpness = 200;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#sharpness Full description of flash.text.TextField.sharpness in Adobe's Flash Platform API Reference\n\t * @see #style:antiAliasType\n\t */\n\t[Style(name=\"sharpness\",type=\"Number\")]\n\n\t/**\n\t * The <code>StyleSheet</code> object to pass to the TextField.\n\t *\n\t * <p>In the following example, a style sheet is applied:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var style:StyleSheet = new StyleSheet();\n\t * var heading:Object = new Object();\n\t * heading.fontWeight = \"bold\";\n\t * heading.color = \"#FF0000\";\n\t * \n\t * var body:Object = new Object();\n\t * body.fontStyle = \"italic\";\n\t * \n\t * style.setStyle(\".heading\", heading);\n\t * style.setStyle(\"body\", body);\n\t * \n\t * scrollText.styleSheet = style;\n\t * scrollText.isHTML = true;\n\t * scrollText.text = \"&lt;body&gt;&lt;span class='heading'&gt;Hello&lt;/span&gt; World...&lt;/body&gt;\";</listing>\n\t *\n\t * @default null\n\t *\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#styleSheet Full description of flash.text.TextField.styleSheet in Adobe's Flash Platform API Reference\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/StyleSheet.html flash.text.StyleSheet\n\t * @see #isHTML\n\t */\n\t[Style(name=\"styleSheet\",type=\"flash.text.StyleSheet\")]\n\n\t/**\n\t * Advanced font formatting used to draw the text if\n\t * <code>fontStyles</code> cannot be used.\n\t *\n\t * <p>If this property is not <code>null</code>, the\n\t * <code>fontStyles</code> property will be ignored.</p>\n\t *\n\t * <p>Note: It is considered best practice to use the\n\t * <code>fontStyles</code> property and\n\t * <code>starling.text.TextFormat</code> for font formatting. The\n\t * <code>textFormat</code> property is available for advanced uses where\n\t * features of <code>flash.text.TextField</code> that are not exposed by\n\t * Starling's <code>TextFormat</code> need to be customized. In most\n\t * cases, these advanced features are not required.</p>\n\t *\n\t * <p>In the following example, the text is formatted:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollText.textFormat = new TextFormat( \"_sans\", 16, 0x333333 );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:fontStyles\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextFormat.html flash.text.TextFormat\n\t */\n\t[Style(name=\"textFormat\",type=\"flash.text.TextFormat\")]\n\n\t/**\n\t * The thickness of the glyph edges in this text field. This property\n\t * applies only if the <code>antiAliasType</code> property is set to\n\t * <code>flash.text.AntiAliasType.ADVANCED</code>. The range for\n\t * <code>thickness</code> is a number from <code>-200</code> to\n\t * <code>200</code>.\n\t *\n\t * <p>In the following example, the thickness is changed:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollText.thickness = 100;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#thickness Full description of flash.text.TextField.thickness in Adobe's Flash Platform API Reference\n\t * @see #style:antiAliasType\n\t */\n\t[Style(name=\"thickness\",type=\"Number\")]\n\n\t/**\n\t * Dispatched when an anchor (<code>&lt;a&gt;</code>) element in the HTML\n\t * text is triggered when the <code>href</code> attribute begins with\n\t * <code>\"event:\"</code>. This event is dispatched when the internal\n\t * <code>flash.text.TextField</code> dispatches its own\n\t * <code>TextEvent.LINK</code>.\n\t *\n\t * <p>The <code>data</code> property of the <code>Event</code> object that\n\t * is dispatched by the <code>ScrollText</code> contains the value of the\n\t * <code>text</code> property of the <code>TextEvent</code> that is\n\t * dispatched by the <code>flash.text.TextField</code>.</p>\n\t *\n\t * <p>The following example listens for <code>Event.TRIGGERED</code> on a\n\t * <code>ScrollText</code> component:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var scrollText:ScrollText = new ScrollText();\n\t * scrollText.text = \"&lt;a href=\\\"event:hello\\\"&gt;Hello&lt;/a&gt; World\";\n\t * scrollText.addEventListener( Event.TRIGGERED, scrollText_triggeredHandler );\n\t * this.addChild( scrollText );</listing>\n\t *\n\t * <p>The following example shows a listener for <code>Event.TRIGGERED</code>:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * function scrollText_triggeredHandler(event:Event):void\n\t * {\n\t *     trace( event.data ); //hello\n\t * }</listing>\n\t *\n\t * @eventType starling.events.Event.TRIGGERED\n\t *\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/TextEvent.html#LINK flash.events.TextEvent.LINK\n\t */\n\t[Event(name=\"triggered\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Displays long passages of text in a scrollable container using the\n\t * runtime's software-based <code>flash.text.TextField</code> as an overlay\n\t * above Starling content on the classic display list. This component will\n\t * <strong>always</strong> appear above Starling content. The only way to\n\t * put something above ScrollText is to put something above it on the\n\t * classic display list.\n\t *\n\t * <p>Meant as a workaround component for when TextFieldTextRenderer runs\n\t * into the runtime texture limits.</p>\n\t *\n\t * <p>Since this component is rendered with the runtime's software renderer,\n\t * rather than on the GPU, it may not perform very well on mobile devices\n\t * with high resolution screens.</p>\n\t *\n\t * <p>The following example displays some text:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var scrollText:ScrollText = new ScrollText();\n\t * scrollText.text = \"Hello World\";\n\t * this.addChild( scrollText );</listing>\n\t *\n\t * @see ../../../help/scroll-text.html How to use the Feathers ScrollText component\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html flash.text.TextField\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class ScrollText extends Scroller implements INativeFocusOwner\n\t{\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>ScrollText</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function ScrollText()\n\t\t{\n\t\t\tsuper();\n\t\t\tif(this._fontStylesSet === null)\n\t\t\t{\n\t\t\t\tthis._fontStylesSet = new FontStylesSet();\n\t\t\t\tthis._fontStylesSet.addEventListener(Event.CHANGE, fontStyles_changeHandler);\n\t\t\t}\n\t\t\tthis.textViewPort = new TextFieldViewPort();\n\t\t\tthis.textViewPort.addEventListener(Event.TRIGGERED, textViewPort_triggeredHandler);\n\t\t\tthis.viewPort = this.textViewPort;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var textViewPort:TextFieldViewPort;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn ScrollText.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get nativeFocus():Object\n\t\t{\n\t\t\tif(this.viewPort === null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn this.textViewPort.nativeFocus;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _text:String = \"\";\n\n\t\t/**\n\t\t * The text to display. If <code>isHTML</code> is <code>true</code>, the\n\t\t * text will be rendered as HTML with the same capabilities as the\n\t\t * <code>htmlText</code> property of <code>flash.text.TextField</code>.\n\t\t *\n\t\t * <p>In the following example, some text is displayed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scrollText.text = \"Hello World\";</listing>\n\t\t *\n\t\t * @default \"\"\n\t\t *\n\t\t * @see #isHTML\n\t\t */\n\t\tpublic function get text():String\n\t\t{\n\t\t\treturn this._text;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set text(value:String):void\n\t\t{\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = \"\";\n\t\t\t}\n\t\t\tif(this._text == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._text = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isHTML:Boolean = false;\n\n\t\t/**\n\t\t * Determines if the TextField should display the text as HTML or not.\n\t\t *\n\t\t * <p>In the following example, some HTML-formatted text is displayed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scrollText.isHTML = true;\n\t\t * scrollText.text = \"&lt;b&gt;Hello&lt;/b&gt; &lt;i&gt;World&lt;/i&gt;\";</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#htmlText flash.text.TextField.htmlText\n\t\t * @see #text\n\t\t */\n\t\tpublic function get isHTML():Boolean\n\t\t{\n\t\t\treturn this._isHTML;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isHTML(value:Boolean):void\n\t\t{\n\t\t\tif(this._isHTML == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isHTML = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fontStylesSet:FontStylesSet;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get fontStyles():starling.text.TextFormat\n\t\t{\n\t\t\treturn this._fontStylesSet.format;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set fontStyles(value:starling.text.TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._fontStylesSet.format = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get disabledFontStyles():starling.text.TextFormat\n\t\t{\n\t\t\treturn this._fontStylesSet.disabledFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disabledFontStyles(value:starling.text.TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._fontStylesSet.disabledFormat = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textFormat:flash.text.TextFormat;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get textFormat():flash.text.TextFormat\n\t\t{\n\t\t\treturn this._textFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set textFormat(value:flash.text.TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._textFormat === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textFormat = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _disabledTextFormat:flash.text.TextFormat;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get disabledTextFormat():flash.text.TextFormat\n\t\t{\n\t\t\treturn this._disabledTextFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disabledTextFormat(value:flash.text.TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._disabledTextFormat === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._disabledTextFormat = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _styleSheet:StyleSheet;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get styleSheet():StyleSheet\n\t\t{\n\t\t\treturn this._styleSheet;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set styleSheet(value:StyleSheet):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._styleSheet === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._styleSheet = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _embedFonts:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get embedFonts():Boolean\n\t\t{\n\t\t\treturn this._embedFonts;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set embedFonts(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._embedFonts === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._embedFonts = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _antiAliasType:String = AntiAliasType.ADVANCED;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get antiAliasType():String\n\t\t{\n\t\t\treturn this._antiAliasType;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set antiAliasType(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._antiAliasType === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._antiAliasType = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _background:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get background():Boolean\n\t\t{\n\t\t\treturn this._background;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set background(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._background === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._background = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _backgroundColor:uint = 0xffffff;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundColor():uint\n\t\t{\n\t\t\treturn this._backgroundColor;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundColor(value:uint):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundColor == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._backgroundColor = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _border:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get border():Boolean\n\t\t{\n\t\t\treturn this._border;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set border(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._border === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._border = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _borderColor:uint = 0x000000;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get borderColor():uint\n\t\t{\n\t\t\treturn this._borderColor;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set borderColor(value:uint):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._borderColor == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._borderColor = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _cacheAsBitmap:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get cacheAsBitmap():Boolean\n\t\t{\n\t\t\treturn this._cacheAsBitmap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set cacheAsBitmap(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._cacheAsBitmap === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._cacheAsBitmap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _condenseWhite:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get condenseWhite():Boolean\n\t\t{\n\t\t\treturn this._condenseWhite;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set condenseWhite(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._condenseWhite === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._condenseWhite = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _displayAsPassword:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get displayAsPassword():Boolean\n\t\t{\n\t\t\treturn this._displayAsPassword;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set displayAsPassword(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._displayAsPassword === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._displayAsPassword = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _gridFitType:String = GridFitType.PIXEL;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get gridFitType():String\n\t\t{\n\t\t\treturn this._gridFitType;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set gridFitType(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._gridFitType === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._gridFitType = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _sharpness:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get sharpness():Number\n\t\t{\n\t\t\treturn this._sharpness;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set sharpness(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._sharpness == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._sharpness = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _thickness:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get thickness():Number\n\t\t{\n\t\t\treturn this._thickness;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set thickness(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._thickness == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._thickness = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function get padding():Number\n\t\t{\n\t\t\treturn this._textPaddingTop;\n\t\t}\n\n\t\t//no setter for padding because the one in Scroller is acceptable\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textPaddingTop:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function get paddingTop():Number\n\t\t{\n\t\t\treturn this._textPaddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set paddingTop(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._textPaddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textPaddingTop = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textPaddingRight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function get paddingRight():Number\n\t\t{\n\t\t\treturn this._textPaddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._textPaddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textPaddingRight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textPaddingBottom:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function get paddingBottom():Number\n\t\t{\n\t\t\treturn this._textPaddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set paddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._textPaddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textPaddingBottom = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textPaddingLeft:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._textPaddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._textPaddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textPaddingLeft = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get outerPadding():Number\n\t\t{\n\t\t\treturn this._outerPaddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set outerPadding(value:Number):void\n\t\t{\n\t\t\tthis.outerPaddingTop = value;\n\t\t\tthis.outerPaddingRight = value;\n\t\t\tthis.outerPaddingBottom = value;\n\t\t\tthis.outerPaddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _outerPaddingTop:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get outerPaddingTop():Number\n\t\t{\n\t\t\treturn this._outerPaddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set outerPaddingTop(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._outerPaddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._outerPaddingTop = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _outerPaddingRight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get outerPaddingRight():Number\n\t\t{\n\t\t\treturn this._outerPaddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set outerPaddingRight(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._outerPaddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._outerPaddingRight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _outerPaddingBottom:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get outerPaddingBottom():Number\n\t\t{\n\t\t\treturn this._outerPaddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set outerPaddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._outerPaddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._outerPaddingBottom = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _outerPaddingLeft:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get outerPaddingLeft():Number\n\t\t{\n\t\t\treturn this._outerPaddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set outerPaddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._outerPaddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._outerPaddingLeft = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _visible:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function get visible():Boolean\n\t\t{\n\t\t\treturn this._visible;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set visible(value:Boolean):void\n\t\t{\n\t\t\tif(this._visible == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._visible = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _alpha:Number = 1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function get alpha():Number\n\t\t{\n\t\t\treturn this._alpha;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set alpha(value:Number):void\n\t\t{\n\t\t\tif(this._alpha == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._alpha = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this._fontStylesSet !== null)\n\t\t\t{\n\t\t\t\tthis._fontStylesSet.dispose();\n\t\t\t\tthis._fontStylesSet = null;\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar scrollInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SCROLL);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\n\t\t\tif(dataInvalid)\n\t\t\t{\n\t\t\t\tthis.textViewPort.text = this._text;\n\t\t\t\tthis.textViewPort.isHTML = this._isHTML;\n\t\t\t}\n\n\t\t\tif(stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.textViewPort.antiAliasType = this._antiAliasType;\n\t\t\t\tthis.textViewPort.background = this._background;\n\t\t\t\tthis.textViewPort.backgroundColor = this._backgroundColor;\n\t\t\t\tthis.textViewPort.border = this._border;\n\t\t\t\tthis.textViewPort.borderColor = this._borderColor;\n\t\t\t\tthis.textViewPort.cacheAsBitmap = this._cacheAsBitmap;\n\t\t\t\tthis.textViewPort.condenseWhite = this._condenseWhite;\n\t\t\t\tthis.textViewPort.displayAsPassword = this._displayAsPassword;\n\t\t\t\tthis.textViewPort.gridFitType = this._gridFitType;\n\t\t\t\tthis.textViewPort.sharpness = this._sharpness;\n\t\t\t\tthis.textViewPort.thickness = this._thickness;\n\t\t\t\tthis.textViewPort.textFormat = this._textFormat;\n\t\t\t\tthis.textViewPort.disabledTextFormat = this._disabledTextFormat;\n\t\t\t\tthis.textViewPort.fontStyles = this._fontStylesSet;\n\t\t\t\tthis.textViewPort.styleSheet = this._styleSheet;\n\t\t\t\tthis.textViewPort.embedFonts = this._embedFonts;\n\t\t\t\tthis.textViewPort.paddingTop = this._textPaddingTop;\n\t\t\t\tthis.textViewPort.paddingRight = this._textPaddingRight;\n\t\t\t\tthis.textViewPort.paddingBottom = this._textPaddingBottom;\n\t\t\t\tthis.textViewPort.paddingLeft = this._textPaddingLeft;\n\t\t\t\tthis.textViewPort.visible = this._visible;\n\t\t\t\tthis.textViewPort.alpha = this._alpha;\n\t\t\t}\n\n\t\t\tsuper.draw();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function calculateViewPortOffsets(forceScrollBars:Boolean = false, useActualBounds:Boolean = false):void\n\t\t{\n\t\t\tsuper.calculateViewPortOffsets(forceScrollBars);\n\n\t\t\tthis._topViewPortOffset += this._outerPaddingTop;\n\t\t\tthis._rightViewPortOffset += this._outerPaddingRight;\n\t\t\tthis._bottomViewPortOffset += this._outerPaddingBottom;\n\t\t\tthis._leftViewPortOffset += this._outerPaddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textViewPort_triggeredHandler(event:Event, link:String):void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.TRIGGERED, false, link);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function fontStyles_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/Scroller.as",
    "content": "﻿/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.controls.supportClasses.IViewPort;\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IFocusDisplayObject;\n\timport feathers.core.IMeasureDisplayObject;\n\timport feathers.core.IValidating;\n\timport feathers.core.PropertyProxy;\n\timport feathers.events.ExclusiveTouch;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.Direction;\n\timport feathers.layout.RelativePosition;\n\timport feathers.system.DeviceCapabilities;\n\timport feathers.utils.display.getDisplayObjectDepthFromStage;\n\timport feathers.utils.math.roundDownToNearest;\n\timport feathers.utils.math.roundToNearest;\n\timport feathers.utils.math.roundUpToNearest;\n\timport feathers.utils.skins.resetFluidChildDimensionsForMeasurement;\n\n\timport flash.errors.IllegalOperationError;\n\timport flash.events.KeyboardEvent;\n\timport flash.events.MouseEvent;\n\timport flash.events.TransformGestureEvent;\n\timport flash.geom.Point;\n\timport flash.geom.Rectangle;\n\timport flash.ui.Keyboard;\n\timport flash.utils.getQualifiedClassName;\n\timport flash.utils.getTimer;\n\n\timport starling.animation.Transitions;\n\timport starling.animation.Tween;\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.display.DisplayObjectContainer;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.utils.MathUtil;\n\timport starling.utils.Pool;\n\n\t/**\n\t * If <code>true</code>, the background's <code>visible</code> property\n\t * will be set to <code>false</code> when the scroll position is greater\n\t * than or equal to the minimum scroll position and less than or equal\n\t * to the maximum scroll position. The background will be visible when\n\t * the content is extended beyond the scrolling bounds, such as when\n\t * <code>hasElasticEdges</code> is <code>true</code>.\n\t *\n\t * <p>If the content is not fully opaque, this setting should not be\n\t * enabled.</p>\n\t *\n\t * <p>This setting may be enabled to potentially improve performance.</p>\n\t *\n\t * <p>In the following example, the background is automatically hidden:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.autoHideBackground = true;</listing>\n\t *\n\t * @default false\n\t * \n\t * @see #style:backgroundSkin\n\t */\n\t[Style(name=\"autoHideBackground\",type=\"Boolean\")]\n\n\t/**\n\t * The default background to display.\n\t *\n\t * <p>In the following example, the scroller is given a background skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.backgroundSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t * \n\t * @see #style:backgroundDisabledSkin\n\t */\n\t[Style(name=\"backgroundSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * A background to display when the container is disabled.\n\t *\n\t * <p>In the following example, the scroller is given a disabled background skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.backgroundDisabledSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:backgroundSkin\n\t */\n\t[Style(name=\"backgroundDisabledSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * If true, the viewport will be clipped to the scroller's bounds. In\n\t * other words, anything appearing outside the scroller's bounds will\n\t * not be visible.\n\t *\n\t * <p>To improve performance, turn off clipping and place other display\n\t * objects over the edges of the scroller to hide the content that\n\t * bleeds outside of the scroller's bounds.</p>\n\t *\n\t * <p>In the following example, clipping is disabled:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.clipContent = false;</listing>\n\t *\n\t * @default true\n\t */\n\t[Style(name=\"clipContent\",type=\"Boolean\")]\n\n\t/**\n\t * A style name to add to the container's horizontal scroll bar\n\t * sub-component. Typically used by a theme to provide different styles\n\t * to different containers.\n\t *\n\t * <p>In the following example, a custom horizontal scroll bar style\n\t * name is passed to the scroller:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.customHorizontalScrollBarStyleName = \"my-custom-horizontal-scroll-bar\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( SimpleScrollBar ).setFunctionForStyleName( \"my-custom-horizontal-scroll-bar\", setCustomHorizontalScrollBarStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_HORIZONTAL_SCROLL_BAR\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #horizontalScrollBarFactory\n\t */\n\t[Style(name=\"customHorizontalScrollBarStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to the container's vertical scroll bar\n\t * sub-component. Typically used by a theme to provide different styles\n\t * to different containers.\n\t *\n\t * <p>In the following example, a custom vertical scroll bar style name\n\t * is passed to the scroller:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.customVerticalScrollBarStyleName = \"my-custom-vertical-scroll-bar\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( SimpleScrollBar ).setFunctionForStyleName( \"my-custom-vertical-scroll-bar\", setCustomVerticalScrollBarStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_VERTICAL_SCROLL_BAR\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #verticalScrollBarFactory\n\t */\n\t[Style(name=\"customVerticalScrollBarStyleName\",type=\"String\")]\n\n\t/**\n\t * This value is used to decelerate the scroller when \"thrown\". The\n\t * velocity of a throw is multiplied by this value once per millisecond\n\t * to decelerate. A value greater than <code>0</code> and less than\n\t * <code>1</code> is expected.\n\t *\n\t * <p>In the following example, deceleration rate is lowered to adjust\n\t * the behavior of a throw:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.decelerationRate = DecelerationRate.FAST;</listing>\n\t *\n\t * @default feathers.controls.DecelerationRate.NORMAL\n\t *\n\t * @see feathers.controls.DecelerationRate#NORMAL\n\t * @see feathers.controls.DecelerationRate#FAST\n\t */\n\t[Style(name=\"decelerationRate\",type=\"Number\")]\n\n\t/**\n\t * If the scroll position goes outside the minimum or maximum bounds\n\t * when the scroller's content is being actively dragged, the scrolling\n\t * will be constrained using this multiplier. A value of <code>0</code>\n\t * means that the scroller will not go beyond its minimum or maximum\n\t * bounds. A value of <code>1</code> means that going beyond the minimum\n\t * or maximum bounds is completely unrestrained.\n\t *\n\t * <p>In the following example, the elasticity of dragging beyond the\n\t * scroller's edges is customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.elasticity = 0.5;</listing>\n\t *\n\t * @default 0.33\n\t *\n\t * @see #style:hasElasticEdges\n\t * @see #style:throwElasticity\n\t */\n\t[Style(name=\"elasticity\",type=\"Number\")]\n\n\t/**\n\t * The duration, in seconds, of the animation when a the scroller snaps\n\t * back to the minimum or maximum position after going out of bounds.\n\t *\n\t * <p>In the following example, the duration of the animation that snaps\n\t * the content back after pulling it beyond the edge is set to 750\n\t * milliseconds:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.elasticSnapDuration = 0.75;</listing>\n\t *\n\t * @default 0.5\n\t * \n\t * @see #style:hasElasticEdges\n\t */\n\t[Style(name=\"elasticSnapDuration\",type=\"Number\")]\n\n\t/**\n\t * Determines if the scrolling can go beyond the edges of the viewport.\n\t *\n\t * <p>In the following example, elastic edges are disabled:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.hasElasticEdges = false;</listing>\n\t *\n\t * @default true\n\t *\n\t * @see #style:elasticity\n\t * @see #style:throwElasticity\n\t */\n\t[Style(name=\"hasElasticEdges\",type=\"Boolean\")]\n\n\t/**\n\t * The duration, in seconds, of the animation when a scroll bar fades\n\t * out.\n\t *\n\t * <p>In the following example, the duration of the animation that hides\n\t * the scroll bars is set to 500 milliseconds:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.hideScrollBarAnimationDuration = 0.5;</listing>\n\t *\n\t * @default 0.2\n\t * \n\t * @see #style:scrollBarDisplayMode\n\t */\n\t[Style(name=\"hideScrollBarAnimationDuration\",type=\"Number\")]\n\n\t/**\n\t * The easing function used for hiding the scroll bars, if applicable.\n\t *\n\t * <p>In the following example, the ease of the animation that hides\n\t * the scroll bars is customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.hideScrollBarAnimationEase = Transitions.EASE_IN_OUT;</listing>\n\t *\n\t * @default starling.animation.Transitions.EASE_OUT\n\t *\n\t * @see http://doc.starling-framework.org/core/starling/animation/Transitions.html starling.animation.Transitions\n\t *\n\t * @see #style:scrollBarDisplayMode\n\t */\n\t[Style(name=\"hideScrollBarAnimationEase\",type=\"Object\")]\n\n\t/**\n\t * Determines where the horizontal scroll bar will be positioned.\n\t *\n\t * <p>In the following example, the scroll bars is positioned on the top:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.horizontalScrollBarPosition = RelativePosition.TOP;</listing>\n\t *\n\t * @default feathers.layout.RelativePosition.BOTTOM\n\t *\n\t * @see feathers.layout.RelativePosition#TOP\n\t * @see feathers.layout.RelativePosition#BOTTOM\n\t */\n\t[Style(name=\"horizontalScrollBarPosition\",type=\"String\")]\n\n\t/**\n\t * Determines how the user may interact with the scroller.\n\t *\n\t * <p>In the following example, the interaction mode is optimized for mouse:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.interactionMode = ScrollInteractionMode.MOUSE;</listing>\n\t *\n\t * @default feathers.controls.ScrollInteractionMode.TOUCH\n\t *\n\t * @see feathers.controls.ScrollInteractionMode#TOUCH\n\t * @see feathers.controls.ScrollInteractionMode#MOUSE\n\t * @see feathers.controls.ScrollInteractionMode#TOUCH_AND_SCROLL_BARS\n\t */\n\t[Style(name=\"interactionMode\",type=\"String\")]\n\n\t/**\n\t * The duration, in seconds, of the animation when the mouse wheel\n\t * initiates a scroll action.\n\t *\n\t * <p>In the following example, the duration of the animation that runs\n\t * when the mouse wheel is scrolled is set to 500 milliseconds:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.mouseWheelScrollDuration = 0.5;</listing>\n\t *\n\t * @default 0.35\n\t */\n\t[Style(name=\"mouseWheelScrollDuration\",type=\"Number\")]\n\n\t/**\n\t * Quickly sets all padding properties to the same value. The\n\t * <code>padding</code> getter always returns the value of\n\t * <code>paddingTop</code>, but the other padding values may be\n\t * different.\n\t *\n\t * <p>In the following example, the padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.padding = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:paddingTop\n\t * @see #style:paddingRight\n\t * @see #style:paddingBottom\n\t * @see #style:paddingLeft\n\t */\n\t[Style(name=\"padding\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the container's top edge and the\n\t * container's content.\n\t *\n\t * <p>In the following example, the top padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.paddingTop = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingTop\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the container's right edge and\n\t * the container's content.\n\t *\n\t * <p>In the following example, the right padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.paddingRight = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingRight\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the container's bottom edge and\n\t * the container's content.\n\t *\n\t * <p>In the following example, the bottom padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.paddingBottom = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingBottom\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the container's left edge and the\n\t * container's content.\n\t *\n\t * <p>In the following example, the left padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.paddingLeft = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingLeft\",type=\"Number\")]\n\n\t/**\n\t * The duration, in seconds, of the animation when the scroller is\n\t * thrown to a page.\n\t *\n\t * <p>In the following example, the duration of the animation that\n\t * changes the page when thrown is set to 250 milliseconds:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.pageThrowDuration = 0.25;</listing>\n\t *\n\t * @default 0.5\n\t */\n\t[Style(name=\"pageThrowDuration\",type=\"Number\")]\n\n\t/**\n\t * The duration, in seconds, that the scroll bars will be shown when\n\t * calling <code>revealScrollBars()</code>\n\t *\n\t * @default 1.0\n\t *\n\t * @see #revealScrollBars()\n\t */\n\t[Style(name=\"revealScrollBarsDuration\",type=\"Number\")]\n\n\t/**\n\t * Determines how the scroll bars are displayed.\n\t *\n\t * <p>In the following example, the scroll bars are fixed:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.scrollBarDisplayMode = ScrollBarDisplayMode.FIXED;</listing>\n\t *\n\t * @default feathers.controls.ScrollBarDisplayMode.FLOAT\n\t *\n\t * @see feathers.controls.ScrollBarDisplayMode#FLOAT\n\t * @see feathers.controls.ScrollBarDisplayMode#FIXED\n\t * @see feathers.controls.ScrollBarDisplayMode#FIXED_FLOAT\n\t * @see feathers.controls.ScrollBarDisplayMode#NONE\n\t */\n\t[Style(name=\"scrollBarDisplayMode\",type=\"String\")]\n\n\t/**\n\t * If enabled, the scroll position will always be adjusted to the nearest\n\t * pixel on the physical screen. Depending on the value of Starling's\n\t * <code>contentScaleFactor</code>, this may or may not result in an integer\n\t * value for the scroll position.\n\t *\n\t * <p>In the following example, the scroll position is not snapped to pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.snapScrollPositionsToPixels = false;</listing>\n\t *\n\t * @default true\n\t */\n\t[Style(name=\"snapScrollPositionsToPixels\",type=\"Boolean\")]\n\n\t/**\n\t * Determines if scrolling will snap to the nearest page.\n\t *\n\t * <p>In the following example, the scroller snaps to the nearest page:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.snapToPages = true;</listing>\n\t *\n\t * @default false\n\t */\n\t[Style(name=\"snapToPages\",type=\"Boolean\")]\n\n\t/**\n\t * The easing function used for \"throw\" animations.\n\t *\n\t * <p>In the following example, the ease of throwing animations is\n\t * customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.throwEase = Transitions.EASE_IN_OUT;</listing>\n\t *\n\t * @see http://doc.starling-framework.org/core/starling/animation/Transitions.html starling.animation.Transitions\n\t */\n\t[Style(name=\"throwEase\",type=\"Object\")]\n\n\t/**\n\t * If the scroll position goes outside the minimum or maximum bounds\n\t * when the scroller's content is \"thrown\", the scrolling will be\n\t * constrained using this multiplier. A value of <code>0</code> means\n\t * that the scroller will not go beyond its minimum or maximum bounds.\n\t * A value of <code>1</code> means that going beyond the minimum or\n\t * maximum bounds is completely unrestrained.\n\t *\n\t * <p>In the following example, the elasticity of throwing beyond the\n\t * scroller's edges is customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.throwElasticity = 0.1;</listing>\n\t *\n\t * @default 0.05\n\t *\n\t * @see #style:hasElasticEdges\n\t * @see #style:elasticity\n\t */\n\t[Style(name=\"throwElasticity\",type=\"Number\")]\n\n\t/**\n\t * If <code>true</code>, the duration of a \"throw\" animation will be the\n\t * same no matter the value of the throw's initial velocity. This value\n\t * may be set to <code>false</code> to have the scroller calculate a\n\t * variable duration based on the velocity of the throw.\n\t *\n\t * <p>It may seem unintuitive, but using the same fixed duration for any\n\t * velocity is recommended if you are looking to closely match the\n\t * behavior of native scrolling on iOS.</p>\n\t *\n\t * <p>In the following example, the behavior of a \"throw\" animation is\n\t * changed:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.useFixedThrowDuration = false;</listing>\n\t *\n\t * @default true\n\t *\n\t * @see #style:decelerationRate\n\t */\n\t[Style(name=\"useFixedThrowDuration\",type=\"Boolean\")]\n\n\t/**\n\t * Determines where the vertical scroll bar will be positioned.\n\t *\n\t * <p>In the following example, the scroll bars is positioned on the left:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scroller.verticalScrollBarPosition = RelativePosition.LEFT;</listing>\n\t *\n\t * @default feathers.layout.RelativePosition.RIGHT\n\t *\n\t * @see feathers.layout.RelativePosition#RIGHT\n\t * @see feathers.layout.RelativePosition#LEFT\n\t */\n\t[Style(name=\"verticalScrollBarPosition\",type=\"String\")]\n\n\t/**\n\t * Dispatched when the scroller scrolls in either direction or when the view\n\t * port's scrolling bounds have changed. Listen for <code>FeathersEventType.SCROLL_START</code>\n\t * to know when scrolling starts as a result of user interaction or when\n\t * scrolling is triggered by an animation. Similarly, listen for\n\t * <code>FeathersEventType.SCROLL_COMPLETE</code> to know when the scrolling\n\t * ends.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.SCROLL\n\t * @see #event:scrollStart feathers.events.FeathersEventType.SCROLL_START\n\t * @see #event:scrollComplete feathers.events.FeathersEventType.SCROLL_COMPLETE\n\t */\n\t[Event(name=\"scroll\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the scroller starts scrolling in either direction\n\t * as a result of either user interaction or animation.\n\t *\n\t * <p>Note: If <code>horizontalScrollPosition</code> or <code>verticalScrollPosition</code>\n\t * is set manually (in other words, the scrolling is not triggered by user\n\t * interaction or an animated scroll), no <code>FeathersEventType.SCROLL_START</code>\n\t * or <code>FeathersEventType.SCROLL_COMPLETE</code> events will be\n\t * dispatched.</p>\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.SCROLL_START\n\t * @see #event:scrollComplete feathers.events.FeathersEventType.SCROLL_COMPLETE\n\t * @see #event:scroll feathers.events.FeathersEventType.SCROLL\n\t */\n\t[Event(name=\"scrollStart\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the scroller finishes scrolling in either direction\n\t * as a result of either user interaction or animation. Animations may not\n\t * end at the same time that user interaction ends, so the event may be\n\t * delayed if user interaction triggers scrolling again.\n\t *\n\t * <p>Note: If <code>horizontalScrollPosition</code> or <code>verticalScrollPosition</code>\n\t * is set manually (in other words, the scrolling is not triggered by user\n\t * interaction or an animated scroll), no <code>FeathersEventType.SCROLL_START</code>\n\t * or <code>FeathersEventType.SCROLL_COMPLETE</code> events will be\n\t * dispatched.</p>\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.SCROLL_COMPLETE\n\t * @see #event:scrollStart feathers.events.FeathersEventType.SCROLL_START\n\t * @see #event:scroll feathers.events.FeathersEventType.SCROLL\n\t */\n\t[Event(name=\"scrollComplete\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the user starts dragging the scroller when\n\t * <code>ScrollInteractionMode.TOUCH</code> is enabled or when the user\n\t * starts interacting with the scroll bar.\n\t *\n\t * <p>Note: If <code>horizontalScrollPosition</code> or <code>verticalScrollPosition</code>\n\t * is set manually (in other words, the scrolling is not triggered by user\n\t * interaction), no <code>FeathersEventType.BEGIN_INTERACTION</code>\n\t * or <code>FeathersEventType.END_INTERACTION</code> events will be\n\t * dispatched.</p>\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.BEGIN_INTERACTION\n\t * @see #event:endInteraction feathers.events.FeathersEventType.END_INTERACTION\n\t * @see #event:scroll feathers.events.FeathersEventType.SCROLL\n\t */\n\t[Event(name=\"beginInteraction\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the user stops dragging the scroller when\n\t * <code>ScrollInteractionMode.TOUCH</code> is enabled or when the user\n\t * stops interacting with the scroll bar. The scroller may continue\n\t * scrolling after this event is dispatched if the user interaction has also\n\t * triggered an animation.\n\t *\n\t * <p>Note: If <code>horizontalScrollPosition</code> or <code>verticalScrollPosition</code>\n\t * is set manually (in other words, the scrolling is not triggered by user\n\t * interaction), no <code>FeathersEventType.BEGIN_INTERACTION</code>\n\t * or <code>FeathersEventType.END_INTERACTION</code> events will be\n\t * dispatched.</p>\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.END_INTERACTION\n\t * @see #event:beginInteraction feathers.events.FeathersEventType.BEGIN_INTERACTION\n\t * @see #event:scroll feathers.events.FeathersEventType.SCROLL\n\t */\n\t[Event(name=\"endInteraction\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the component receives focus.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.FOCUS_IN\n\t */\n\t[Event(name=\"focusIn\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the component loses focus.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.FOCUS_OUT\n\t */\n\t[Event(name=\"focusOut\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when a pull view is activated.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The pull view that was activated.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.UPDATE\n\t */\n\t[Event(name=\"update\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Allows horizontal and vertical scrolling of a <em>view port</em>. Not\n\t * meant to be used as a standalone container or component. Generally meant\n\t * to be the super class of another component that needs to support\n\t * scrolling. To put components in a generic scrollable container (with\n\t * optional layout), see <code>ScrollContainer</code>. To scroll long\n\t * passages of text, see <code>ScrollText</code>.\n\t *\n\t * <p>This component is generally not instantiated directly. Instead it is\n\t * typically used as a super class for other scrolling components like lists\n\t * and containers. With that in mind, no code example is included here.</p>\n\t *\n\t * @see feathers.controls.ScrollContainer\n\t *\n\t * @productversion Feathers 1.1.0\n\t */\n\tpublic class Scroller extends FeathersControl implements IFocusDisplayObject\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_SCROLL_BAR_RENDERER:String = \"scrollBarRenderer\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_PENDING_SCROLL:String = \"pendingScroll\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_PENDING_REVEAL_SCROLL_BARS:String = \"pendingRevealScrollBars\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_PENDING_PULL_VIEW:String = \"pendingPullView\";\n\n\t\t/**\n\t\t * Flag to indicate that the clipping has changed.\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_CLIPPING:String = \"clipping\";\n\n\t\t/**\n\t\t * @private\n\t\t * The point where we stop calculating velocity changes because floating\n\t\t * point issues can start to appear.\n\t\t */\n\t\tprivate static const MINIMUM_VELOCITY:Number = 0.02;\n\n\t\t/**\n\t\t * @private\n\t\t * The current velocity is given high importance.\n\t\t */\n\t\tprivate static const CURRENT_VELOCITY_WEIGHT:Number = 2.33;\n\n\t\t/**\n\t\t * @private\n\t\t * Older saved velocities are given less importance.\n\t\t */\n\t\tprivate static const VELOCITY_WEIGHTS:Vector.<Number> = new <Number>[1, 1.33, 1.66, 2];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const MAXIMUM_SAVED_VELOCITY_COUNT:int = 4;\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the\n\t\t * horizontal scroll bar.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_HORIZONTAL_SCROLL_BAR:String = \"feathers-scroller-horizontal-scroll-bar\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the vertical\n\t\t * scroll bar.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_VERTICAL_SCROLL_BAR:String = \"feathers-scroller-vertical-scroll-bar\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const PAGE_INDEX_EPSILON:Number = 0.01;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultScrollBarFactory():IScrollBar\n\t\t{\n\t\t\treturn new SimpleScrollBar();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultThrowEase(ratio:Number):Number\n\t\t{\n\t\t\tratio -= 1;\n\t\t\treturn 1 - ratio * ratio * ratio * ratio;\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function Scroller()\n\t\t{\n\t\t\tsuper();\n\n\t\t\tthis.addEventListener(Event.ADDED_TO_STAGE, scroller_addedToStageHandler);\n\t\t\tthis.addEventListener(Event.REMOVED_FROM_STAGE, scroller_removedFromStageHandler);\n\t\t}\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the horizontal\n\t\t * scroll bar. This variable is <code>protected</code> so that\n\t\t * sub-classes can customize the horizontal scroll bar style name in\n\t\t * their constructors instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_HORIZONTAL_SCROLL_BAR</code>.\n\t\t *\n\t\t * <p>To customize the horizontal scroll bar style name without\n\t\t * subclassing, see <code>customHorizontalScrollBarStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customHorizontalScrollBarStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var horizontalScrollBarStyleName:String = DEFAULT_CHILD_STYLE_NAME_HORIZONTAL_SCROLL_BAR;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the vertical\n\t\t * scroll bar. This variable is <code>protected</code> so that\n\t\t * sub-classes can customize the vertical scroll bar style name in their\n\t\t * constructors instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_VERTICAL_SCROLL_BAR</code>.\n\t\t *\n\t\t * <p>To customize the vertical scroll bar style name without\n\t\t * subclassing, see <code>customVerticalScrollBarStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customVerticalScrollBarStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var verticalScrollBarStyleName:String = DEFAULT_CHILD_STYLE_NAME_VERTICAL_SCROLL_BAR;\n\n\t\t/**\n\t\t * The horizontal scrollbar instance. May be null.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t *\n\t\t * @see #horizontalScrollBarFactory\n\t\t * @see #createScrollBars()\n\t\t */\n\t\tprotected var horizontalScrollBar:IScrollBar;\n\n\t\t/**\n\t\t * The vertical scrollbar instance. May be null.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t *\n\t\t * @see #verticalScrollBarFactory\n\t\t * @see #createScrollBars()\n\t\t */\n\t\tprotected var verticalScrollBar:IScrollBar;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function get isFocusEnabled():Boolean\n\t\t{\n\t\t\treturn (this._maxVerticalScrollPosition != this._minVerticalScrollPosition ||\n\t\t\t\tthis._maxHorizontalScrollPosition != this._minHorizontalScrollPosition) &&\n\t\t\t\tsuper.isFocusEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _topViewPortOffset:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _rightViewPortOffset:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _bottomViewPortOffset:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _leftViewPortOffset:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _hasHorizontalScrollBar:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _hasVerticalScrollBar:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalScrollBarTouchPointID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalScrollBarTouchPointID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _touchPointID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _startTouchX:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _startTouchY:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _startHorizontalScrollPosition:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _startVerticalScrollPosition:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentTouchX:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentTouchY:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _previousTouchTime:int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _previousTouchX:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _previousTouchY:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _velocityX:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _velocityY:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _previousVelocityX:Vector.<Number> = new <Number>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _previousVelocityY:Vector.<Number> = new <Number>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _pendingVelocityChange:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastViewPortWidth:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastViewPortHeight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _hasViewPortBoundsChanged:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalAutoScrollTween:Tween;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalAutoScrollTween:Tween;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _topPullTween:Tween;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _rightPullTween:Tween;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _bottomPullTween:Tween;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _leftPullTween:Tween;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isDraggingHorizontally:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isDraggingVertically:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var ignoreViewPortResizing:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _viewPort:IViewPort;\n\n\t\t/**\n\t\t * The display object displayed and scrolled within the Scroller.\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get viewPort():IViewPort\n\t\t{\n\t\t\treturn this._viewPort;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set viewPort(value:IViewPort):void\n\t\t{\n\t\t\tif(this._viewPort == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._viewPort !== null)\n\t\t\t{\n\t\t\t\tthis._viewPort.removeEventListener(FeathersEventType.RESIZE, viewPort_resizeHandler);\n\t\t\t\tthis.removeRawChildInternal(DisplayObject(this._viewPort));\n\t\t\t}\n\t\t\tthis._viewPort = value;\n\t\t\tif(this._viewPort !== null)\n\t\t\t{\n\t\t\t\tthis._viewPort.addEventListener(FeathersEventType.RESIZE, viewPort_resizeHandler);\n\t\t\t\tthis.addRawChildAtInternal(DisplayObject(this._viewPort), 0);\n\t\t\t\tif(this._viewPort is IFeathersControl)\n\t\t\t\t{\n\t\t\t\t\tIFeathersControl(this._viewPort).initializeNow();\n\t\t\t\t}\n\t\t\t\tthis._explicitViewPortWidth = this._viewPort.explicitWidth;\n\t\t\t\tthis._explicitViewPortHeight = this._viewPort.explicitHeight;\n\t\t\t\tthis._explicitViewPortMinWidth = this._viewPort.explicitMinWidth;\n\t\t\t\tthis._explicitViewPortMinHeight = this._viewPort.explicitMinHeight;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitViewPortWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitViewPortHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitViewPortMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitViewPortMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _measureViewPort:Boolean = true;\n\n\t\t/**\n\t\t * Determines if the dimensions of the view port are used when measuring\n\t\t * the scroller. If disabled, only children other than the view port\n\t\t * (such as the background skin) are used for measurement.\n\t\t *\n\t\t * <p>In the following example, the view port measurement is disabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scroller.measureViewPort = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic function get measureViewPort():Boolean\n\t\t{\n\t\t\treturn this._measureViewPort;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set measureViewPort(value:Boolean):void\n\t\t{\n\t\t\tif(this._measureViewPort == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._measureViewPort = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _snapToPages:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get snapToPages():Boolean\n\t\t{\n\t\t\treturn this._snapToPages;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set snapToPages(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._snapToPages === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._snapToPages = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _snapOnComplete:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalScrollBarFactory:Function = defaultScrollBarFactory;\n\n\t\t/**\n\t\t * Creates the horizontal scroll bar. The horizontal scroll bar must be\n\t\t * an instance of <code>IScrollBar</code>. This factory can be used to\n\t\t * change properties on the horizontal scroll bar when it is first\n\t\t * created. For instance, if you are skinning Feathers components\n\t\t * without a theme, you might use this factory to set skins and other\n\t\t * styles on the horizontal scroll bar.\n\t\t *\n\t\t * <p>This function is expected to have the following signature:</p>\n\t\t *\n\t\t * <pre>function():IScrollBar</pre>\n\t\t *\n\t\t * <p>In the following example, a custom horizontal scroll bar factory\n\t\t * is passed to the scroller:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scroller.horizontalScrollBarFactory = function():IScrollBar\n\t\t * {\n\t\t *     return new ScrollBar();\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.IScrollBar\n\t\t */\n\t\tpublic function get horizontalScrollBarFactory():Function\n\t\t{\n\t\t\treturn this._horizontalScrollBarFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalScrollBarFactory(value:Function):void\n\t\t{\n\t\t\tif(this._horizontalScrollBarFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalScrollBarFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL_BAR_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customHorizontalScrollBarStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customHorizontalScrollBarStyleName():String\n\t\t{\n\t\t\treturn this._customHorizontalScrollBarStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customHorizontalScrollBarStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customHorizontalScrollBarStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customHorizontalScrollBarStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL_BAR_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalScrollBarProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the container's horizontal\n\t\t * scroll bar, and the properties will be passed down to the horizontal\n\t\t * scroll bar when the container validates. The available properties\n\t\t * depend on which <code>IScrollBar</code> implementation is returned\n\t\t * by <code>horizontalScrollBarFactory</code>. Refer to\n\t\t * <a href=\"IScrollBar.html\"><code>feathers.controls.IScrollBar</code></a>\n\t\t * for a list of available scroll bar implementations.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>horizontalScrollBarFactory</code>\n\t\t * function instead of using <code>horizontalScrollBarProperties</code>\n\t\t * will result in better performance.</p>\n\t\t *\n\t\t * <p>In the following example, properties for the horizontal scroll bar\n\t\t * are passed to the scroller:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scroller.horizontalScrollBarProperties.liveDragging = false;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #horizontalScrollBarFactory\n\t\t * @see feathers.controls.IScrollBar\n\t\t * @see feathers.controls.SimpleScrollBar\n\t\t * @see feathers.controls.ScrollBar\n\t\t */\n\t\tpublic function get horizontalScrollBarProperties():Object\n\t\t{\n\t\t\tif(!this._horizontalScrollBarProperties)\n\t\t\t{\n\t\t\t\tthis._horizontalScrollBarProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._horizontalScrollBarProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalScrollBarProperties(value:Object):void\n\t\t{\n\t\t\tif(this._horizontalScrollBarProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._horizontalScrollBarProperties)\n\t\t\t{\n\t\t\t\tthis._horizontalScrollBarProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._horizontalScrollBarProperties = PropertyProxy(value);\n\t\t\tif(this._horizontalScrollBarProperties)\n\t\t\t{\n\t\t\t\tthis._horizontalScrollBarProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalScrollBarPosition:String = RelativePosition.RIGHT;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"right,left\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get verticalScrollBarPosition():String\n\t\t{\n\t\t\treturn this._verticalScrollBarPosition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalScrollBarPosition(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._verticalScrollBarPosition === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalScrollBarPosition = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalScrollBarPosition:String = RelativePosition.BOTTOM;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"bottom,top\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get horizontalScrollBarPosition():String\n\t\t{\n\t\t\treturn this._horizontalScrollBarPosition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalScrollBarPosition(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._horizontalScrollBarPosition === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalScrollBarPosition = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalScrollBarFactory:Function = defaultScrollBarFactory;\n\n\t\t/**\n\t\t * Creates the vertical scroll bar. The vertical scroll bar must be an\n\t\t * instance of <code>Button</code>. This factory can be used to change\n\t\t * properties on the vertical scroll bar when it is first created. For\n\t\t * instance, if you are skinning Feathers components without a theme,\n\t\t * you might use this factory to set skins and other styles on the\n\t\t * vertical scroll bar.\n\t\t *\n\t\t * <p>This function is expected to have the following signature:</p>\n\t\t *\n\t\t * <pre>function():IScrollBar</pre>\n\t\t *\n\t\t * <p>In the following example, a custom vertical scroll bar factory\n\t\t * is passed to the scroller:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scroller.verticalScrollBarFactory = function():IScrollBar\n\t\t * {\n\t\t *     return new ScrollBar();\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.IScrollBar\n\t\t */\n\t\tpublic function get verticalScrollBarFactory():Function\n\t\t{\n\t\t\treturn this._verticalScrollBarFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalScrollBarFactory(value:Function):void\n\t\t{\n\t\t\tif(this._verticalScrollBarFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalScrollBarFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL_BAR_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customVerticalScrollBarStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customVerticalScrollBarStyleName():String\n\t\t{\n\t\t\treturn this._customVerticalScrollBarStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customVerticalScrollBarStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customVerticalScrollBarStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customVerticalScrollBarStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL_BAR_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalScrollBarProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the container's vertical scroll\n\t\t * bar, and the properties will be passed down to the vertical scroll\n\t\t * bar when the container validates. The available properties depend on\n\t\t * which <code>IScrollBar</code> implementation is returned by\n\t\t * <code>verticalScrollBarFactory</code>. Refer to\n\t\t * <a href=\"IScrollBar.html\"><code>feathers.controls.IScrollBar</code></a>\n\t\t * for a list of available scroll bar implementations.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>verticalScrollBarFactory</code>\n\t\t * function instead of using <code>verticalScrollBarProperties</code>\n\t\t * will result in better performance.</p>\n\t\t *\n\t\t * <p>In the following example, properties for the vertical scroll bar\n\t\t * are passed to the container:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scroller.verticalScrollBarProperties.liveDragging = false;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #verticalScrollBarFactory\n\t\t * @see feathers.controls.IScrollBar\n\t\t * @see feathers.controls.SimpleScrollBar\n\t\t * @see feathers.controls.ScrollBar\n\t\t */\n\t\tpublic function get verticalScrollBarProperties():Object\n\t\t{\n\t\t\tif(!this._verticalScrollBarProperties)\n\t\t\t{\n\t\t\t\tthis._verticalScrollBarProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._verticalScrollBarProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalScrollBarProperties(value:Object):void\n\t\t{\n\t\t\tif(this._horizontalScrollBarProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._verticalScrollBarProperties)\n\t\t\t{\n\t\t\t\tthis._verticalScrollBarProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._verticalScrollBarProperties = PropertyProxy(value);\n\t\t\tif(this._verticalScrollBarProperties)\n\t\t\t{\n\t\t\t\tthis._verticalScrollBarProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var actualHorizontalScrollStep:Number = 1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var explicitHorizontalScrollStep:Number = NaN;\n\n\t\t/**\n\t\t * The number of pixels the horizontal scroll position can be adjusted\n\t\t * by a \"step\". Passed to the horizontal scroll bar, if one exists.\n\t\t * Touch scrolling is not affected by the step value.\n\t\t *\n\t\t * <p>In the following example, the horizontal scroll step is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scroller.horizontalScrollStep = 0;</listing>\n\t\t *\n\t\t * @default NaN\n\t\t */\n\t\tpublic function get horizontalScrollStep():Number\n\t\t{\n\t\t\treturn this.actualHorizontalScrollStep;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalScrollStep(value:Number):void\n\t\t{\n\t\t\tif(this.explicitHorizontalScrollStep == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.explicitHorizontalScrollStep = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _targetHorizontalScrollPosition:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalScrollPosition:Number = 0;\n\n\t\t/**\n\t\t * The number of pixels the container has been scrolled horizontally (on\n\t\t * the x-axis).\n\t\t *\n\t\t * <p>In the following example, the horizontal scroll position is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scroller.horizontalScrollPosition = scroller.maxHorizontalScrollPosition;</listing>\n\t\t *\n\t\t * @see #minHorizontalScrollPosition\n\t\t * @see #maxHorizontalScrollPosition\n\t\t */\n\t\tpublic function get horizontalScrollPosition():Number\n\t\t{\n\t\t\treturn this._horizontalScrollPosition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalScrollPosition(value:Number):void\n\t\t{\n\t\t\tif(this._horizontalScrollPosition == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value) //isNaN\n\t\t\t{\n\t\t\t\t//there isn't any recovery from this, so stop it early\n\t\t\t\tthrow new ArgumentError(\"horizontalScrollPosition cannot be NaN.\");\n\t\t\t}\n\t\t\tthis._horizontalScrollPosition = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minHorizontalScrollPosition:Number = 0;\n\n\t\t/**\n\t\t * The number of pixels the scroller may be scrolled horizontally to the\n\t\t * left. This value is automatically calculated based on the bounds of\n\t\t * the viewport. The <code>horizontalScrollPosition</code> property may\n\t\t * have a lower value than the minimum due to elastic edges. However,\n\t\t * once the user stops interacting with the scroller, it will\n\t\t * automatically animate back to the maximum or minimum position.\n\t\t *\n\t\t * @see #horizontalScrollPosition\n\t\t * @see #maxHorizontalScrollPosition\n\t\t */\n\t\tpublic function get minHorizontalScrollPosition():Number\n\t\t{\n\t\t\treturn this._minHorizontalScrollPosition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maxHorizontalScrollPosition:Number = 0;\n\n\t\t/**\n\t\t * The number of pixels the scroller may be scrolled horizontally to the\n\t\t * right. This value is automatically calculated based on the bounds of\n\t\t * the viewport. The <code>horizontalScrollPosition</code> property may\n\t\t * have a higher value than the maximum due to elastic edges. However,\n\t\t * once the user stops interacting with the scroller, it will\n\t\t * automatically animate back to the maximum or minimum position.\n\t\t *\n\t\t * @see #horizontalScrollPosition\n\t\t * @see #minHorizontalScrollPosition\n\t\t */\n\t\tpublic function get maxHorizontalScrollPosition():Number\n\t\t{\n\t\t\treturn this._maxHorizontalScrollPosition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalPageIndex:int = 0;\n\n\t\t/**\n\t\t * The index of the horizontal page, if snapping is enabled. If snapping\n\t\t * is disabled, the index will always be <code>0</code>.\n\t\t * \n\t\t * @see #horizontalPageCount\n\t\t * @see #minHorizontalPageIndex\n\t\t * @see #maxHorizontalPageIndex\n\t\t */\n\t\tpublic function get horizontalPageIndex():int\n\t\t{\n\t\t\tif(this.hasPendingHorizontalPageIndex)\n\t\t\t{\n\t\t\t\treturn this.pendingHorizontalPageIndex;\n\t\t\t}\n\t\t\treturn this._horizontalPageIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalPageIndex(value:int):void\n\t\t{\n\t\t\tif(!this._snapToPages)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"The horizontalPageIndex may not be set if snapToPages is false.\");\n\t\t\t}\n\t\t\tthis.hasPendingHorizontalPageIndex = false;\n\t\t\tthis.pendingHorizontalScrollPosition = NaN;\n\t\t\tif(this._horizontalPageIndex == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!this.isInvalid())\n\t\t\t{\n\t\t\t\tif(value < this._minHorizontalPageIndex)\n\t\t\t\t{\n\t\t\t\t\tvalue = this._minHorizontalPageIndex;\n\t\t\t\t}\n\t\t\t\telse if(value > this._maxHorizontalPageIndex)\n\t\t\t\t{\n\t\t\t\t\tvalue = this._maxHorizontalPageIndex;\n\t\t\t\t}\n\t\t\t\tthis._horizontalScrollPosition = this.actualPageWidth * value;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//minimum and maximum values haven't been calculated yet, so we\n\t\t\t\t//need to wait for validation to change the scroll position\n\t\t\t\tthis.hasPendingHorizontalPageIndex = true;\n\t\t\t\tthis.pendingHorizontalPageIndex = value;\n\t\t\t\tthis.pendingScrollDuration = 0;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minHorizontalPageIndex:int = 0;\n\n\t\t/**\n\t\t * The minimum horizontal page index that may be displayed by this\n\t\t * container, if page snapping is enabled.\n\t\t *\n\t\t * @see #snapToPages\n\t\t * @see #horizontalPageCount\n\t\t * @see #maxHorizontalPageIndex\n\t\t */\n\t\tpublic function get minHorizontalPageIndex():int\n\t\t{\n\t\t\treturn this._minHorizontalPageIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maxHorizontalPageIndex:int = 0;\n\n\t\t/**\n\t\t * The maximum horizontal page index that may be displayed by this\n\t\t * container, if page snapping is enabled.\n\t\t *\n\t\t * @see #snapToPages\n\t\t * @see #horizontalPageCount\n\t\t * @see #minHorizontalPageIndex\n\t\t */\n\t\tpublic function get maxHorizontalPageIndex():int\n\t\t{\n\t\t\treturn this._maxHorizontalPageIndex;\n\t\t}\n\n\t\t/**\n\t\t * The number of horizontal pages, if snapping is enabled. If snapping\n\t\t * is disabled, the page count will always be <code>1</code>.\n\t\t *\n\t\t * <p>If the scroller's view port supports infinite scrolling, this\n\t\t * property will return <code>int.MAX_VALUE</code>, since an\n\t\t * <code>int</code> cannot hold the value <code>Number.POSITIVE_INFINITY</code>.</p>\n\t\t *\n\t\t * @see #snapToPages\n\t\t * @see #horizontalPageIndex\n\t\t * @see #minHorizontalPageIndex\n\t\t * @see #maxHorizontalPageIndex\n\t\t */\n\t\tpublic function get horizontalPageCount():int\n\t\t{\n\t\t\tif(this._maxHorizontalPageIndex == int.MAX_VALUE ||\n\t\t\t\tthis._minHorizontalPageIndex == int.MIN_VALUE)\n\t\t\t{\n\t\t\t\treturn int.MAX_VALUE;\n\t\t\t}\n\t\t\treturn this._maxHorizontalPageIndex - this._minHorizontalPageIndex + 1;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalScrollPolicy:String = ScrollPolicy.AUTO;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"auto,on,off\")]\n\t\t/**\n\t\t * Determines whether the scroller may scroll horizontally (on the\n\t\t * x-axis) or not.\n\t\t *\n\t\t * <p>In the following example, horizontal scrolling is disabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scroller.horizontalScrollPolicy = ScrollPolicy.OFF;</listing>\n\t\t *\n\t\t * @default feathers.controls.ScrollPolicy.AUTO\n\t\t *\n\t\t * @see feathers.controls.ScrollPolicy#AUTO\n\t\t * @see feathers.controls.ScrollPolicy#ON\n\t\t * @see feathers.controls.ScrollPolicy#OFF\n\t\t */\n\t\tpublic function get horizontalScrollPolicy():String\n\t\t{\n\t\t\treturn this._horizontalScrollPolicy;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalScrollPolicy(value:String):void\n\t\t{\n\t\t\tif(this._horizontalScrollPolicy == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalScrollPolicy = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL_BAR_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var actualVerticalScrollStep:Number = 1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var explicitVerticalScrollStep:Number = NaN;\n\n\t\t/**\n\t\t * The number of pixels the vertical scroll position can be adjusted\n\t\t * by a \"step\". Passed to the vertical scroll bar, if one exists.\n\t\t * Touch scrolling is not affected by the step value.\n\t\t *\n\t\t * <p>In the following example, the vertical scroll step is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scroller.verticalScrollStep = 0;</listing>\n\t\t *\n\t\t * @default NaN\n\t\t */\n\t\tpublic function get verticalScrollStep():Number\n\t\t{\n\t\t\treturn this.actualVerticalScrollStep;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalScrollStep(value:Number):void\n\t\t{\n\t\t\tif(this.explicitVerticalScrollStep == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.explicitVerticalScrollStep = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalMouseWheelScrollStep:Number = NaN;\n\n\t\t/**\n\t\t * The number of pixels the vertical scroll position can be adjusted by\n\t\t * a \"step\" when using the mouse wheel. If this value is\n\t\t * <code>NaN</code>, the mouse wheel will use the same scroll step as the scroll bars.\n\t\t *\n\t\t * <p>In the following example, the vertical mouse wheel scroll step is\n\t\t * customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scroller.verticalMouseWheelScrollStep = 10;</listing>\n\t\t *\n\t\t * @default NaN\n\t\t */\n\t\tpublic function get verticalMouseWheelScrollStep():Number\n\t\t{\n\t\t\treturn this._verticalMouseWheelScrollStep;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalMouseWheelScrollStep(value:Number):void\n\t\t{\n\t\t\tif(this._verticalMouseWheelScrollStep == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalMouseWheelScrollStep = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _targetVerticalScrollPosition:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalScrollPosition:Number = 0;\n\n\t\t/**\n\t\t * The number of pixels the container has been scrolled vertically (on\n\t\t * the y-axis).\n\t\t *\n\t\t * <p>In the following example, the vertical scroll position is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scroller.verticalScrollPosition = scroller.maxVerticalScrollPosition;</listing>\n\t\t * \n\t\t * @see #minVerticalScrollPosition\n\t\t * @see #maxVerticalScrollPosition\n\t\t */\n\t\tpublic function get verticalScrollPosition():Number\n\t\t{\n\t\t\treturn this._verticalScrollPosition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalScrollPosition(value:Number):void\n\t\t{\n\t\t\tif(this._verticalScrollPosition == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value) //isNaN\n\t\t\t{\n\t\t\t\t//there isn't any recovery from this, so stop it early\n\t\t\t\tthrow new ArgumentError(\"verticalScrollPosition cannot be NaN.\");\n\t\t\t}\n\t\t\tthis._verticalScrollPosition = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minVerticalScrollPosition:Number = 0;\n\n\t\t/**\n\t\t * The number of pixels the scroller may be scrolled vertically beyond\n\t\t * the top edge. This value is automatically calculated based on the\n\t\t * bounds of the viewport. The <code>verticalScrollPosition</code>\n\t\t * property may have a lower value than the minimum due to elastic\n\t\t * edges. However, once the user stops interacting with the scroller, it\n\t\t * will automatically animate back to the maximum or minimum position.\n\t\t *\n\t\t * @see #verticalScrollPosition\n\t\t * @see #maxVerticalScrollPosition\n\t\t */\n\t\tpublic function get minVerticalScrollPosition():Number\n\t\t{\n\t\t\treturn this._minVerticalScrollPosition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maxVerticalScrollPosition:Number = 0;\n\n\t\t/**\n\t\t * The number of pixels the scroller may be scrolled vertically beyond\n\t\t * the bottom edge. This value is automatically calculated based on the\n\t\t * bounds of the viewport. The <code>verticalScrollPosition</code>\n\t\t * property may have a lower value than the minimum due to elastic\n\t\t * edges. However, once the user stops interacting with the scroller, it\n\t\t * will automatically animate back to the maximum or minimum position.\n\t\t *\n\t\t * @see #verticalScrollPosition\n\t\t * @see #minVerticalScrollPosition\n\t\t */\n\t\tpublic function get maxVerticalScrollPosition():Number\n\t\t{\n\t\t\treturn this._maxVerticalScrollPosition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalPageIndex:int = 0;\n\n\t\t/**\n\t\t * The index of the vertical page, if snapping is enabled. If snapping\n\t\t * is disabled, the index will always be <code>0</code>.\n\t\t *\n\t\t * @see #verticalPageCount\n\t\t * @see #minVerticalPageIndex\n\t\t * @see #maxVerticalPageIndex\n\t\t */\n\t\tpublic function get verticalPageIndex():int\n\t\t{\n\t\t\tif(this.hasPendingVerticalPageIndex)\n\t\t\t{\n\t\t\t\treturn this.pendingVerticalPageIndex;\n\t\t\t}\n\t\t\treturn this._verticalPageIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalPageIndex(value:int):void\n\t\t{\n\t\t\tif(!this._snapToPages)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"The verticalPageIndex may not be set if snapToPages is false.\");\n\t\t\t}\n\t\t\tthis.hasPendingVerticalPageIndex = false;\n\t\t\tthis.pendingVerticalScrollPosition = NaN;\n\t\t\tif(this._verticalPageIndex == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!this.isInvalid())\n\t\t\t{\n\t\t\t\tif(value < this._minVerticalPageIndex)\n\t\t\t\t{\n\t\t\t\t\tvalue = this._minVerticalPageIndex;\n\t\t\t\t}\n\t\t\t\telse if(value > this._maxVerticalPageIndex)\n\t\t\t\t{\n\t\t\t\t\tvalue = this._maxVerticalPageIndex;\n\t\t\t\t}\n\t\t\t\tthis._verticalScrollPosition = this.actualPageHeight * value;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//minimum and maximum values haven't been calculated yet, so we\n\t\t\t\t//need to wait for validation to change the scroll position\n\t\t\t\tthis.hasPendingVerticalPageIndex = true;\n\t\t\t\tthis.pendingVerticalPageIndex = value;\n\t\t\t\tthis.pendingScrollDuration = 0;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minVerticalPageIndex:int = 0;\n\n\t\t/**\n\t\t * The minimum vertical page index that may be displayed by this\n\t\t * container, if page snapping is enabled.\n\t\t *\n\t\t * @see #snapToPages\n\t\t * @see #verticalPageCount\n\t\t * @see #maxVerticalPageIndex\n\t\t */\n\t\tpublic function get minVerticalPageIndex():int\n\t\t{\n\t\t\treturn this._minVerticalPageIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maxVerticalPageIndex:int = 0;\n\n\t\t/**\n\t\t * The maximum vertical page index that may be displayed by this\n\t\t * container, if page snapping is enabled.\n\t\t *\n\t\t * @see #snapToPages\n\t\t * @see #verticalPageCount\n\t\t * @see #minVerticalPageIndex\n\t\t */\n\t\tpublic function get maxVerticalPageIndex():int\n\t\t{\n\t\t\treturn this._maxVerticalPageIndex;\n\t\t}\n\n\t\t/**\n\t\t * The number of vertical pages, if snapping is enabled. If snapping\n\t\t * is disabled, the page count will always be <code>1</code>.\n\t\t *\n\t\t * <p>If the scroller's view port supports infinite scrolling, this\n\t\t * property will return <code>int.MAX_VALUE</code>, since an\n\t\t * <code>int</code> cannot hold the value <code>Number.POSITIVE_INFINITY</code>.</p>\n\t\t *\n\t\t * @see #snapToPages\n\t\t * @see #verticalPageIndex\n\t\t * @see #minVerticalPageIndex\n\t\t * @see #maxVerticalPageIndex\n\t\t */\n\t\tpublic function get verticalPageCount():int\n\t\t{\n\t\t\tif(this._maxVerticalPageIndex == int.MAX_VALUE ||\n\t\t\t\tthis._minVerticalPageIndex == int.MIN_VALUE)\n\t\t\t{\n\t\t\t\treturn int.MAX_VALUE;\n\t\t\t}\n\t\t\treturn this._maxVerticalPageIndex - this._minVerticalPageIndex + 1;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalScrollPolicy:String = ScrollPolicy.AUTO;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"auto,on,off\")]\n\t\t/**\n\t\t * Determines whether the scroller may scroll vertically (on the\n\t\t * y-axis) or not.\n\t\t *\n\t\t * <p>In the following example, vertical scrolling is disabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scroller.verticalScrollPolicy = ScrollPolicy.OFF;</listing>\n\t\t *\n\t\t * @default feathers.controls.ScrollPolicy.AUTO\n\t\t *\n\t\t * @see feathers.controls.ScrollPolicy#AUTO\n\t\t * @see feathers.controls.ScrollPolicy#ON\n\t\t * @see feathers.controls.ScrollPolicy#OFF\n\t\t */\n\t\tpublic function get verticalScrollPolicy():String\n\t\t{\n\t\t\treturn this._verticalScrollPolicy;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalScrollPolicy(value:String):void\n\t\t{\n\t\t\tif(this._verticalScrollPolicy == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalScrollPolicy = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL_BAR_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _clipContent:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get clipContent():Boolean\n\t\t{\n\t\t\treturn this._clipContent;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set clipContent(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._clipContent === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._clipContent = value;\n\t\t\tif(!value && this._viewPort)\n\t\t\t{\n\t\t\t\tthis._viewPort.mask = null;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_CLIPPING);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var actualPageWidth:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var explicitPageWidth:Number = NaN;\n\n\t\t/**\n\t\t * When set, the horizontal pages snap to this width value instead of\n\t\t * the width of the scroller.\n\t\t *\n\t\t * <p>In the following example, the page width is set to 200 pixels:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scroller.pageWidth = 200;</listing>\n\t\t *\n\t\t * @see #snapToPages\n\t\t */\n\t\tpublic function get pageWidth():Number\n\t\t{\n\t\t\treturn this.actualPageWidth;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set pageWidth(value:Number):void\n\t\t{\n\t\t\tif(this.explicitPageWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar valueIsNaN:Boolean = value !== value; //isNaN\n\t\t\tif(valueIsNaN && this.explicitPageWidth !== this.explicitPageWidth) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.explicitPageWidth = value;\n\t\t\tif(valueIsNaN)\n\t\t\t{\n\t\t\t\t//we need to calculate this value during validation\n\t\t\t\tthis.actualPageWidth = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.actualPageWidth = this.explicitPageWidth;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var actualPageHeight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var explicitPageHeight:Number = NaN;\n\n\t\t/**\n\t\t * When set, the vertical pages snap to this height value instead of\n\t\t * the height of the scroller.\n\t\t *\n\t\t * <p>In the following example, the page height is set to 200 pixels:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scroller.pageHeight = 200;</listing>\n\t\t *\n\t\t * @see #snapToPages\n\t\t */\n\t\tpublic function get pageHeight():Number\n\t\t{\n\t\t\treturn this.actualPageHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set pageHeight(value:Number):void\n\t\t{\n\t\t\tif(this.explicitPageHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar valueIsNaN:Boolean = value !== value; //isNaN\n\t\t\tif(valueIsNaN && this.explicitPageHeight !== this.explicitPageHeight) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.explicitPageHeight = value;\n\t\t\tif(valueIsNaN)\n\t\t\t{\n\t\t\t\t//we need to calculate this value during validation\n\t\t\t\tthis.actualPageHeight = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.actualPageHeight = this.explicitPageHeight;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _hasElasticEdges:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get hasElasticEdges():Boolean\n\t\t{\n\t\t\treturn this._hasElasticEdges;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set hasElasticEdges(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._hasElasticEdges = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _elasticity:Number = 0.33;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get elasticity():Number\n\t\t{\n\t\t\treturn this._elasticity;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set elasticity(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._elasticity = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _throwElasticity:Number = 0.05;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get throwElasticity():Number\n\t\t{\n\t\t\treturn this._throwElasticity;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set throwElasticity(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._throwElasticity = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _scrollBarDisplayMode:String = ScrollBarDisplayMode.FLOAT;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"float,fixed,fixedFloat,none\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get scrollBarDisplayMode():String\n\t\t{\n\t\t\treturn this._scrollBarDisplayMode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set scrollBarDisplayMode(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._scrollBarDisplayMode === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._scrollBarDisplayMode = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL_BAR_RENDERER);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _interactionMode:String = ScrollInteractionMode.TOUCH;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"touch,mouse,touchAndScrollBars\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get interactionMode():String\n\t\t{\n\t\t\treturn this._interactionMode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set interactionMode(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._interactionMode === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._interactionMode = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMaxWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMaxHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var currentBackgroundSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _backgroundSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundSkin():DisplayObject\n\t\t{\n\t\t\treturn this._backgroundSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSkin !== null &&\n\t\t\t\tthis.currentBackgroundSkin === this._backgroundSkin)\n\t\t\t{\n\t\t\t\tthis.removeCurrentBackgroundSkin(this._backgroundSkin);\n\t\t\t\tthis.currentBackgroundSkin = null;\n\t\t\t}\n\t\t\tthis._backgroundSkin = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _backgroundDisabledSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundDisabledSkin():DisplayObject\n\t\t{\n\t\t\treturn this._backgroundDisabledSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundDisabledSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundDisabledSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundDisabledSkin !== null &&\n\t\t\t\tthis.currentBackgroundSkin === this._backgroundDisabledSkin)\n\t\t\t{\n\t\t\t\tthis.removeCurrentBackgroundSkin(this._backgroundDisabledSkin);\n\t\t\t\tthis.currentBackgroundSkin = null;\n\t\t\t}\n\t\t\tthis._backgroundDisabledSkin = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _autoHideBackground:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get autoHideBackground():Boolean\n\t\t{\n\t\t\treturn this._autoHideBackground;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set autoHideBackground(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._autoHideBackground === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._autoHideBackground = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimumDragDistance:Number = 0.04;\n\n\t\t/**\n\t\t * The minimum physical distance (in inches) that a touch must move\n\t\t * before the scroller starts scrolling.\n\t\t *\n\t\t * <p>In the following example, the minimum drag distance is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scroller.minimumDragDistance = 0.1;</listing>\n\t\t *\n\t\t * @default 0.04\n\t\t */\n\t\tpublic function get minimumDragDistance():Number\n\t\t{\n\t\t\treturn this._minimumDragDistance;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minimumDragDistance(value:Number):void\n\t\t{\n\t\t\tthis._minimumDragDistance = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimumPageThrowVelocity:Number = 5;\n\n\t\t/**\n\t\t * The minimum physical velocity (in inches per second) that a touch\n\t\t * must move before the scroller will \"throw\" to the next page.\n\t\t * Otherwise, it will settle to the nearest page.\n\t\t *\n\t\t * <p>In the following example, the minimum page throw velocity is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scroller.minimumPageThrowVelocity = 2;</listing>\n\t\t *\n\t\t * @default 5\n\t\t */\n\t\tpublic function get minimumPageThrowVelocity():Number\n\t\t{\n\t\t\treturn this._minimumPageThrowVelocity;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minimumPageThrowVelocity(value:Number):void\n\t\t{\n\t\t\tthis._minimumPageThrowVelocity = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get padding():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set padding(value:Number):void\n\t\t{\n\t\t\tthis.paddingTop = value;\n\t\t\tthis.paddingRight = value;\n\t\t\tthis.paddingBottom = value;\n\t\t\tthis.paddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingTop:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingTop():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingTop(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingTop = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingRight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingRight():Number\n\t\t{\n\t\t\treturn this._paddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingRight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingBottom:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingBottom():Number\n\t\t{\n\t\t\treturn this._paddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingBottom = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingLeft:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingLeft = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalScrollBarHideTween:Tween;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalScrollBarHideTween:Tween;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _hideScrollBarAnimationDuration:Number = 0.2;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get hideScrollBarAnimationDuration():Number\n\t\t{\n\t\t\treturn this._hideScrollBarAnimationDuration;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set hideScrollBarAnimationDuration(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._hideScrollBarAnimationDuration = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _hideScrollBarAnimationEase:Object = Transitions.EASE_OUT;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get hideScrollBarAnimationEase():Object\n\t\t{\n\t\t\treturn this._hideScrollBarAnimationEase;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set hideScrollBarAnimationEase(value:Object):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._hideScrollBarAnimationEase = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _elasticSnapDuration:Number = 0.5;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get elasticSnapDuration():Number\n\t\t{\n\t\t\treturn this._elasticSnapDuration;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set elasticSnapDuration(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._elasticSnapDuration = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * This value is precalculated. See the <code>decelerationRate</code>\n\t\t * setter for the dynamic calculation.\n\t\t */\n\t\tprotected var _logDecelerationRate:Number = -0.0020020026706730793;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _decelerationRate:Number = DecelerationRate.NORMAL;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get decelerationRate():Number\n\t\t{\n\t\t\treturn this._decelerationRate;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set decelerationRate(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._decelerationRate == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._decelerationRate = value;\n\t\t\tthis._logDecelerationRate = Math.log(this._decelerationRate);\n\t\t\tthis._fixedThrowDuration = -0.1 / Math.log(Math.pow(this._decelerationRate, 1000 / 60));\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * This value is precalculated. See the <code>decelerationRate</code>\n\t\t * setter for the dynamic calculation.\n\t\t */\n\t\tprotected var _fixedThrowDuration:Number = 2.996998998998728;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _useFixedThrowDuration:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get useFixedThrowDuration():Boolean\n\t\t{\n\t\t\treturn this._useFixedThrowDuration;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set useFixedThrowDuration(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._useFixedThrowDuration = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _pageThrowDuration:Number = 0.5;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get pageThrowDuration():Number\n\t\t{\n\t\t\treturn this._pageThrowDuration;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set pageThrowDuration(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._pageThrowDuration = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _mouseWheelScrollDuration:Number = 0.35;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get mouseWheelScrollDuration():Number\n\t\t{\n\t\t\treturn this._mouseWheelScrollDuration;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set mouseWheelScrollDuration(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._mouseWheelScrollDuration = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalMouseWheelScrollDirection:String = Direction.VERTICAL;\n\n\t\t/**\n\t\t * The direction of scrolling when the user scrolls the mouse wheel\n\t\t * vertically. In some cases, it is common for a container that only\n\t\t * scrolls horizontally to scroll even when the mouse wheel is scrolled\n\t\t * vertically.\n\t\t *\n\t\t * <p>In the following example, the direction of scrolling when using\n\t\t * the mouse wheel is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scroller.verticalMouseWheelScrollDirection = Direction.HORIZONTAL;</listing>\n\t\t *\n\t\t * @default feathers.layout.Direction.VERTICAL\n\t\t *\n\t\t * @see feathers.layout.Direction#HORIZONTAL\n\t\t * @see feathers.layout.Direction#VERTICAL\n\t\t */\n\t\tpublic function get verticalMouseWheelScrollDirection():String\n\t\t{\n\t\t\treturn this._verticalMouseWheelScrollDirection;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalMouseWheelScrollDirection(value:String):void\n\t\t{\n\t\t\tthis._verticalMouseWheelScrollDirection = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _throwEase:Object = defaultThrowEase;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get throwEase():Object\n\t\t{\n\t\t\treturn this._throwEase;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set throwEase(value:Object):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value == null)\n\t\t\t{\n\t\t\t\tvalue = defaultThrowEase;\n\t\t\t}\n\t\t\tthis._throwEase = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _snapScrollPositionsToPixels:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get snapScrollPositionsToPixels():Boolean\n\t\t{\n\t\t\treturn this._snapScrollPositionsToPixels;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set snapScrollPositionsToPixels(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._snapScrollPositionsToPixels === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._snapScrollPositionsToPixels = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalScrollBarIsScrolling:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalScrollBarIsScrolling:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isScrolling:Boolean = false;\n\n\t\t/**\n\t\t * Determines if the scroller is currently scrolling with user\n\t\t * interaction or with animation.\n\t\t */\n\t\tpublic function get isScrolling():Boolean\n\t\t{\n\t\t\treturn this._isScrolling;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isScrollingStopped:Boolean = false;\n\n\t\t/**\n\t\t * The pending horizontal scroll position to scroll to after validating.\n\t\t * A value of <code>NaN</code> means that the scroller won't scroll to a\n\t\t * horizontal position after validating.\n\t\t */\n\t\tprotected var pendingHorizontalScrollPosition:Number = NaN;\n\n\t\t/**\n\t\t * The pending vertical scroll position to scroll to after validating.\n\t\t * A value of <code>NaN</code> means that the scroller won't scroll to a\n\t\t * vertical position after validating.\n\t\t */\n\t\tprotected var pendingVerticalScrollPosition:Number = NaN;\n\n\t\t/**\n\t\t * A flag that indicates if the scroller should scroll to a new page\n\t\t * when it validates. If <code>true</code>, it will use the value of\n\t\t * <code>pendingHorizontalPageIndex</code> as the target page index.\n\t\t * \n\t\t * @see #pendingHorizontalPageIndex\n\t\t */\n\t\tprotected var hasPendingHorizontalPageIndex:Boolean = false;\n\n\t\t/**\n\t\t * A flag that indicates if the scroller should scroll to a new page\n\t\t * when it validates. If <code>true</code>, it will use the value of\n\t\t * <code>pendingVerticalPageIndex</code> as the target page index.\n\t\t *\n\t\t * @see #pendingVerticalPageIndex\n\t\t */\n\t\tprotected var hasPendingVerticalPageIndex:Boolean = false;\n\n\t\t/**\n\t\t * The pending horizontal page index to scroll to after validating. The\n\t\t * flag <code>hasPendingHorizontalPageIndex</code> must be set to true\n\t\t * if there is a pending page index to scroll to.\n\t\t * \n\t\t * @see #hasPendingHorizontalPageIndex\n\t\t */\n\t\tprotected var pendingHorizontalPageIndex:int;\n\n\t\t/**\n\t\t * The pending vertical page index to scroll to after validating. The\n\t\t * flag <code>hasPendingVerticalPageIndex</code> must be set to true\n\t\t * if there is a pending page index to scroll to.\n\t\t *\n\t\t * @see #hasPendingVerticalPageIndex\n\t\t */\n\t\tprotected var pendingVerticalPageIndex:int;\n\n\t\t/**\n\t\t * The duration of the pending scroll action.\n\t\t */\n\t\tprotected var pendingScrollDuration:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var isScrollBarRevealPending:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _revealScrollBarsDuration:Number = 1.0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get revealScrollBarsDuration():Number\n\t\t{\n\t\t\treturn this._revealScrollBarsDuration;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set revealScrollBarsDuration(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._revealScrollBarsDuration = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isTopPullViewPending:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isTopPullViewActive:Boolean = false;\n\n\t\t/**\n\t\t * Indicates if the <code>topPullView</code> has been activated. Set to\n\t\t * <code>false</code> to close the <code>topPullView</code>.\n\t\t * \n\t\t * <p>Note: Manually setting <code>isTopPullViewActive</code> to\n\t\t * <code>true</code> will not result in <code>Event.UPDATE</code> being\n\t\t * dispatched.</p>\n\t\t * \n\t\t * @see #topPullView\n\t\t */\n\t\tpublic function get isTopPullViewActive():Boolean\n\t\t{\n\t\t\treturn this._isTopPullViewActive;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isTopPullViewActive(value:Boolean):void\n\t\t{\n\t\t\tif(this._isTopPullViewActive === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._topPullView === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isTopPullViewActive = value;\n\t\t\tthis._isTopPullViewPending = true;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_PENDING_PULL_VIEW);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _topPullView:DisplayObject = null;\n\n\t\t/**\n\t\t * A view that is displayed at the top of the scroller's view port when\n\t\t * dragging down.\n\t\t *\n\t\t * <strong>Events</strong>\n\t\t * \n\t\t * <p>The scroller will dispatch <code>FeathersEventType.PULLING</code>\n\t\t * on the pull view as it is dragged into view. The event's\n\t\t * <code>data</code> property will be a value between <code>0</code> and\n\t\t * <code>1</code> to indicate how far the pull view has been dragged so\n\t\t * far. A value of <code>1</code> does not necessarily indicate that\n\t\t * the pull view has been activated yet. A value greater than\n\t\t * <code>1</code> is possible if <code>hasElasticEdges</code> is\n\t\t * <code>true</code>.</p>\n\t\t * \n\t\t * <p>When the pull view is activated by the user, the scroller will\n\t\t * dispatch <code>Event.UPDATE</code>. When the pull view should\n\t\t * be deactivated, set the <code>isTopPullViewActive</code> property\n\t\t * to <code>false</code>.</p>\n\t\t * \n\t\t * @default null\n\t\t *\n\t\t * @see #isTopPullViewActive\n\t\t * @see #topPullViewDisplayMode\n\t\t * @see #event:update starling.events.Event.UPDATE\n\t\t */\n\t\tpublic function get topPullView():DisplayObject\n\t\t{\n\t\t\treturn this._topPullView;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set topPullView(value:DisplayObject):void\n\t\t{\n\t\t\tif(this._topPullView !== null)\n\t\t\t{\n\t\t\t\tthis._topPullView.mask.dispose();\n\t\t\t\tthis._topPullView.mask = null;\n\t\t\t\tif(this._topPullView.parent === this)\n\t\t\t\t{\n\t\t\t\t\tthis.removeRawChildInternal(this._topPullView, false);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._topPullView = value;\n\t\t\tif(this._topPullView !== null)\n\t\t\t{\n\t\t\t\tthis._topPullView.mask = new Quad(1, 1, 0xff00ff);\n\t\t\t\tthis._topPullView.visible = false;\n\t\t\t\tthis.addRawChildInternal(this._topPullView);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.isTopPullViewActive = false;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _topPullViewDisplayMode:String = PullViewDisplayMode.DRAG;\n\n\t\t/**\n\t\t * Indicates whether the top pull view may be dragged with the content,\n\t\t * or if its position is fixed to the edge of the scroller.\n\t\t *\n\t\t * @default feathers.controls.PullViewDisplayMode.DRAG\n\t\t *\n\t\t * @see feathers.controls.PullViewDisplayMode#DRAG\n\t\t * @see feathers.controls.PullViewDisplayMode#FIXED\n\t\t * @see #topPullView\n\t\t */\n\t\tpublic function get topPullViewDisplayMode():String\n\t\t{\n\t\t\treturn this._topPullViewDisplayMode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set topPullViewDisplayMode(value:String):void\n\t\t{\n\t\t\tif(this._topPullViewDisplayMode === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._topPullViewDisplayMode = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _topPullViewRatio:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function get topPullViewRatio():Number\n\t\t{\n\t\t\treturn this._topPullViewRatio;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function set topPullViewRatio(value:Number):void\n\t\t{\n\t\t\tif(this._topPullViewRatio == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._topPullViewRatio = value;\n\t\t\tif(!this._isTopPullViewActive && this._topPullView !== null)\n\t\t\t{\n\t\t\t\tthis._topPullView.dispatchEventWith(FeathersEventType.PULLING, false, value);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isRightPullViewPending:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isRightPullViewActive:Boolean = false;\n\n\t\t/**\n\t\t * Indicates if the <code>rightPullView</code> has been activated. Set\n\t\t * to <code>false</code> to close the <code>rightPullView</code>.\n\t\t *\n\t\t * <p>Note: Manually setting <code>isRightPullViewActive</code> to\n\t\t * <code>true</code> will not result in <code>Event.UPDATE</code> being\n\t\t * dispatched.</p>\n\t\t *\n\t\t * @see #rightPullView\n\t\t */\n\t\tpublic function get isRightPullViewActive():Boolean\n\t\t{\n\t\t\treturn this._isRightPullViewActive;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isRightPullViewActive(value:Boolean):void\n\t\t{\n\t\t\tif(this._isRightPullViewActive === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._rightPullView === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isRightPullViewActive = value;\n\t\t\tthis._isRightPullViewPending = true;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_PENDING_PULL_VIEW);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _rightPullView:DisplayObject = null;\n\n\t\t/**\n\t\t * A view that is displayed to the right of the scroller's view port\n\t\t * when dragging to the left.\n\t\t *\n\t\t * <strong>Events</strong>\n\t\t *\n\t\t * <p>The scroller will dispatch <code>FeathersEventType.PULLING</code>\n\t\t * on the pull view as it is dragged into view. The event's\n\t\t * <code>data</code> property will be a value between <code>0</code> and\n\t\t * <code>1</code> to indicate how far the pull view has been dragged so\n\t\t * far. A value of <code>1</code> does not necessarily indicate that\n\t\t * the pull view has been activated yet. A value greater than\n\t\t * <code>1</code> is possible if <code>hasElasticEdges</code> is\n\t\t * <code>true</code>.</p>\n\t\t *\n\t\t * <p>When the pull view is activated by the user, the scroller will\n\t\t * dispatch <code>Event.UPDATE</code>. When the pull view should\n\t\t * be deactivated, set the <code>isRightPullViewActive</code> property\n\t\t * to <code>false</code>.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #isRightPullViewActive\n\t\t * @see #rightPullViewDisplayMode\n\t\t * @see #event:update starling.events.Event.UPDATE\n\t\t */\n\t\tpublic function get rightPullView():DisplayObject\n\t\t{\n\t\t\treturn this._rightPullView;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set rightPullView(value:DisplayObject):void\n\t\t{\n\t\t\tif(this._rightPullView !== null)\n\t\t\t{\n\t\t\t\tthis._rightPullView.mask.dispose();\n\t\t\t\tthis._rightPullView.mask = null;\n\t\t\t\tif(this._rightPullView.parent === this)\n\t\t\t\t{\n\t\t\t\t\tthis.removeRawChildInternal(this._rightPullView, false);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._rightPullView = value;\n\t\t\tif(this._rightPullView !== null)\n\t\t\t{\n\t\t\t\tthis._rightPullView.mask = new Quad(1, 1, 0xff00ff);\n\t\t\t\tthis._rightPullView.visible = false;\n\t\t\t\tthis.addRawChildInternal(this._rightPullView);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.isRightPullViewActive = false;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _rightPullViewDisplayMode:String = PullViewDisplayMode.DRAG;\n\n\t\t/**\n\t\t * Indicates whether the right pull view may be dragged with the\n\t\t * content, or if its position is fixed to the edge of the scroller.\n\t\t *\n\t\t * @default feathers.controls.PullViewDisplayMode.DRAG\n\t\t *\n\t\t * @see feathers.controls.PullViewDisplayMode#DRAG\n\t\t * @see feathers.controls.PullViewDisplayMode#FIXED\n\t\t * @see #rightPullView\n\t\t */\n\t\tpublic function get rightPullViewDisplayMode():String\n\t\t{\n\t\t\treturn this._rightPullViewDisplayMode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set rightPullViewDisplayMode(value:String):void\n\t\t{\n\t\t\tif(this._rightPullViewDisplayMode === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._rightPullViewDisplayMode = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _rightPullViewRatio:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function get rightPullViewRatio():Number\n\t\t{\n\t\t\treturn this._rightPullViewRatio;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function set rightPullViewRatio(value:Number):void\n\t\t{\n\t\t\tif(this._rightPullViewRatio == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._rightPullViewRatio = value;\n\t\t\tif(!this._isRightPullViewActive && this._rightPullView !== null)\n\t\t\t{\n\t\t\t\tthis._rightPullView.dispatchEventWith(FeathersEventType.PULLING, false, value);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isBottomPullViewPending:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isBottomPullViewActive:Boolean = false;\n\n\t\t/**\n\t\t * Indicates if the <code>bottomPullView</code> has been activated. Set\n\t\t * to <code>false</code> to close the <code>bottomPullView</code>.\n\t\t *\n\t\t * <p>Note: Manually setting <code>isBottomPullViewActive</code> to\n\t\t * <code>true</code> will not result in <code>Event.UPDATE</code> being\n\t\t * dispatched.</p>\n\t\t *\n\t\t * @see #bottomPullView\n\t\t */\n\t\tpublic function get isBottomPullViewActive():Boolean\n\t\t{\n\t\t\treturn this._isBottomPullViewActive;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isBottomPullViewActive(value:Boolean):void\n\t\t{\n\t\t\tif(this._isBottomPullViewActive === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._bottomPullView === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isBottomPullViewActive = value;\n\t\t\tthis._isBottomPullViewPending = true;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_PENDING_PULL_VIEW);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _bottomPullView:DisplayObject = null;\n\n\t\t/**\n\t\t * A view that is displayed at the bottom of the scroller's view port\n\t\t * when dragging up.\n\t\t *\n\t\t * <strong>Events</strong>\n\t\t *\n\t\t * <p>The scroller will dispatch <code>FeathersEventType.PULLING</code>\n\t\t * on the pull view as it is dragged into view. The event's\n\t\t * <code>data</code> property will be a value between <code>0</code> and\n\t\t * <code>1</code> to indicate how far the pull view has been dragged so\n\t\t * far. A value of <code>1</code> does not necessarily indicate that\n\t\t * the pull view has been activated yet. A value greater than\n\t\t * <code>1</code> is possible if <code>hasElasticEdges</code> is\n\t\t * <code>true</code>.</p>\n\t\t *\n\t\t * <p>When the pull view is activated by the user, the scroller will\n\t\t * dispatch <code>Event.UPDATE</code>. When the pull view should\n\t\t * be deactivated, set the <code>isBottomPullViewActive</code> property\n\t\t * to <code>false</code>.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #isBottomPullViewActive\n\t\t * @see #bottomPullViewDisplayMode\n\t\t * @see #event:update starling.events.Event.UPDATE\n\t\t */\n\t\tpublic function get bottomPullView():DisplayObject\n\t\t{\n\t\t\treturn this._bottomPullView;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set bottomPullView(value:DisplayObject):void\n\t\t{\n\t\t\tif(this._bottomPullView !== null)\n\t\t\t{\n\t\t\t\tthis._bottomPullView.mask.dispose();\n\t\t\t\tthis._bottomPullView.mask = null;\n\t\t\t\tif(this._bottomPullView.parent === this)\n\t\t\t\t{\n\t\t\t\t\tthis.removeRawChildInternal(this._bottomPullView, false);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._bottomPullView = value;\n\t\t\tif(this._bottomPullView !== null)\n\t\t\t{\n\t\t\t\tthis._bottomPullView.mask = new Quad(1, 1, 0xff00ff);\n\t\t\t\tthis._bottomPullView.visible = false;\n\t\t\t\tthis.addRawChildInternal(this._bottomPullView);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.isBottomPullViewActive = false;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _bottomPullViewDisplayMode:String = PullViewDisplayMode.DRAG;\n\n\t\t/**\n\t\t * Indicates whether the bottom pull view may be dragged with the\n\t\t * content, or if its position is fixed to the edge of the scroller.\n\t\t *\n\t\t * @default feathers.controls.PullViewDisplayMode.DRAG\n\t\t *\n\t\t * @see feathers.controls.PullViewDisplayMode#DRAG\n\t\t * @see feathers.controls.PullViewDisplayMode#FIXED\n\t\t * @see #bottomPullView\n\t\t */\n\t\tpublic function get bottomPullViewDisplayMode():String\n\t\t{\n\t\t\treturn this._bottomPullViewDisplayMode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set bottomPullViewDisplayMode(value:String):void\n\t\t{\n\t\t\tif(this._bottomPullViewDisplayMode === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._bottomPullViewDisplayMode = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _bottomPullViewRatio:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function get bottomPullViewRatio():Number\n\t\t{\n\t\t\treturn this._bottomPullViewRatio;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function set bottomPullViewRatio(value:Number):void\n\t\t{\n\t\t\tif(this._bottomPullViewRatio == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._bottomPullViewRatio = value;\n\t\t\tif(!this._isBottomPullViewActive && this._bottomPullView !== null)\n\t\t\t{\n\t\t\t\tthis._bottomPullView.dispatchEventWith(FeathersEventType.PULLING, false, value);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isLeftPullViewPending:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isLeftPullViewActive:Boolean = false;\n\n\t\t/**\n\t\t * Indicates if the <code>leftPullView</code> has been activated. Set to\n\t\t * <code>false</code> to close the <code>leftPullView</code>.\n\t\t *\n\t\t * <p>Note: Manually setting <code>isLeftpPullViewActive</code> to\n\t\t * <code>true</code> will not result in <code>Event.UPDATE</code> being\n\t\t * dispatched.</p>\n\t\t *\n\t\t * @see #leftPullView\n\t\t */\n\t\tpublic function get isLeftPullViewActive():Boolean\n\t\t{\n\t\t\treturn this._isLeftPullViewActive;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isLeftPullViewActive(value:Boolean):void\n\t\t{\n\t\t\tif(this._isLeftPullViewActive === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._leftPullView === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isLeftPullViewActive = value;\n\t\t\tthis._isLeftPullViewPending = true;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_PENDING_PULL_VIEW);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _leftPullView:DisplayObject = null;\n\n\t\t/**\n\t\t * A view that is displayed to the left of the scroller's view port\n\t\t * when dragging to the right.\n\t\t *\n\t\t * <strong>Events</strong>\n\t\t *\n\t\t * <p>The scroller will dispatch <code>FeathersEventType.PULLING</code>\n\t\t * on the pull view as it is dragged into view. The event's\n\t\t * <code>data</code> property will be a value between <code>0</code> and\n\t\t * <code>1</code> to indicate how far the pull view has been dragged so\n\t\t * far. A value of <code>1</code> does not necessarily indicate that\n\t\t * the pull view has been activated yet. A value greater than\n\t\t * <code>1</code> is possible if <code>hasElasticEdges</code> is\n\t\t * <code>true</code>.</p>\n\t\t *\n\t\t * <p>When the pull view is activated by the user, the scroller will\n\t\t * dispatch <code>Event.UPDATE</code>. When the pull view should\n\t\t * be deactivated, set the <code>isLeftPullViewActive</code> property\n\t\t * to <code>false</code>.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #isLeftPullViewActive\n\t\t * @see #leftPullViewDisplayMode\n\t\t * @see #event:update starling.events.Event.UPDATE\n\t\t */\n\t\tpublic function get leftPullView():DisplayObject\n\t\t{\n\t\t\treturn this._leftPullView;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set leftPullView(value:DisplayObject):void\n\t\t{\n\t\t\tif(this._leftPullView !== null)\n\t\t\t{\n\t\t\t\tthis._leftPullView.mask.dispose();\n\t\t\t\tthis._leftPullView.mask = null;\n\t\t\t\tif(this._leftPullView.parent === this)\n\t\t\t\t{\n\t\t\t\t\tthis.removeRawChildInternal(this._leftPullView, false);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._leftPullView = value;\n\t\t\tif(this._leftPullView !== null)\n\t\t\t{\n\t\t\t\tthis._leftPullView.mask = new Quad(1, 1, 0xff00ff);\n\t\t\t\tthis._leftPullView.visible = false;\n\t\t\t\tthis.addRawChildInternal(this._leftPullView);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.isLeftPullViewActive = false;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _leftPullViewRatio:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function get leftPullViewRatio():Number\n\t\t{\n\t\t\treturn this._leftPullViewRatio;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function set leftPullViewRatio(value:Number):void\n\t\t{\n\t\t\tif(this._leftPullViewRatio == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._leftPullViewRatio = value;\n\t\t\tif(!this._isLeftPullViewActive && this._leftPullView !== null)\n\t\t\t{\n\t\t\t\tthis._leftPullView.dispatchEventWith(FeathersEventType.PULLING, false, value);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _leftPullViewDisplayMode:String = PullViewDisplayMode.DRAG;\n\n\t\t/**\n\t\t * Indicates whether the left pull view may be dragged with the content,\n\t\t * or if its position is fixed to the edge of the scroller.\n\t\t *\n\t\t * @default feathers.controls.PullViewDisplayMode.DRAG\n\t\t *\n\t\t * @see feathers.controls.PullViewDisplayMode#DRAG\n\t\t * @see feathers.controls.PullViewDisplayMode#FIXED\n\t\t * @see #leftPullView\n\t\t */\n\t\tpublic function get leftPullViewDisplayMode():String\n\t\t{\n\t\t\treturn this._leftPullViewDisplayMode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set leftPullViewDisplayMode(value:String):void\n\t\t{\n\t\t\tif(this._leftPullViewDisplayMode === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._leftPullViewDisplayMode = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalAutoScrollTweenEndRatio:Number = 1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalAutoScrollTweenEndRatio:Number = 1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tstarling.nativeStage.removeEventListener(MouseEvent.MOUSE_WHEEL, nativeStage_mouseWheelHandler);\n\t\t\tstarling.nativeStage.removeEventListener(\"orientationChange\", nativeStage_orientationChangeHandler);\n\n\t\t\t//we don't dispose it if the scroller is the parent because it'll\n\t\t\t//already get disposed in super.dispose()\n\t\t\tif(this._backgroundSkin !== null &&\n\t\t\t\tthis._backgroundSkin.parent !== this)\n\t\t\t{\n\t\t\t\tthis._backgroundSkin.dispose();\n\t\t\t}\n\t\t\tif(this._backgroundDisabledSkin !== null &&\n\t\t\t\tthis._backgroundDisabledSkin.parent !== this)\n\t\t\t{\n\t\t\t\tthis._backgroundDisabledSkin.dispose();\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * If the user is scrolling with touch or if the scrolling is animated,\n\t\t * calling stopScrolling() will cause the scroller to ignore the drag\n\t\t * and stop animations. This function may only be called during scrolling,\n\t\t * so if you need to stop scrolling on a <code>TouchEvent</code> with\n\t\t * <code>TouchPhase.BEGAN</code>, you may need to wait for the scroller\n\t\t * to start scrolling before you can call this function.\n\t\t *\n\t\t * <p>In the following example, we listen for <code>FeathersEventType.SCROLL_START</code>\n\t\t * to stop scrolling:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scroller.addEventListener( FeathersEventType.SCROLL_START, function( event:Event ):void\n\t\t * {\n\t\t *     scroller.stopScrolling();\n\t\t * });</listing>\n\t\t */\n\t\tpublic function stopScrolling():void\n\t\t{\n\t\t\tif(this._horizontalAutoScrollTween)\n\t\t\t{\n\t\t\t\tStarling.juggler.remove(this._horizontalAutoScrollTween);\n\t\t\t\tthis._horizontalAutoScrollTween = null;\n\t\t\t}\n\t\t\tif(this._verticalAutoScrollTween)\n\t\t\t{\n\t\t\t\tStarling.juggler.remove(this._verticalAutoScrollTween);\n\t\t\t\tthis._verticalAutoScrollTween = null;\n\t\t\t}\n\t\t\tthis._isScrollingStopped = true;\n\t\t\tthis._velocityX = 0;\n\t\t\tthis._velocityY = 0;\n\t\t\tthis._previousVelocityX.length = 0;\n\t\t\tthis._previousVelocityY.length = 0;\n\t\t\tthis.hideHorizontalScrollBar();\n\t\t\tthis.hideVerticalScrollBar();\n\t\t}\n\n\t\t/**\n\t\t * After the next validation, animates the scroll positions to a\n\t\t * specific location. May scroll in only one direction by passing in a\n\t\t * value of <code>NaN</code> for either scroll position. If the\n\t\t * <code>animationDuration</code> argument is <code>NaN</code> (the\n\t\t * default value), the duration of a standard throw is used. The\n\t\t * duration is in seconds.\n\t\t *\n\t\t * <p>Because this function is primarily designed for animation, using a\n\t\t * duration of <code>0</code> may require a frame or two before the\n\t\t * scroll position updates.</p>\n\t\t *\n\t\t * <p>In the following example, we scroll to the maximum vertical scroll\n\t\t * position:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scroller.scrollToPosition( scroller.horizontalScrollPosition, scroller.maxVerticalScrollPosition );</listing>\n\t\t *\n\t\t * @see #horizontalScrollPosition\n\t\t * @see #verticalScrollPosition\n\t\t * @see #throwEase\n\t\t */\n\t\tpublic function scrollToPosition(horizontalScrollPosition:Number, verticalScrollPosition:Number, animationDuration:Number = NaN):void\n\t\t{\n\t\t\tif(animationDuration !== animationDuration) //isNaN\n\t\t\t{\n\t\t\t\tif(this._useFixedThrowDuration)\n\t\t\t\t{\n\t\t\t\t\tanimationDuration = this._fixedThrowDuration;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar point:Point = Pool.getPoint(horizontalScrollPosition - this._horizontalScrollPosition, verticalScrollPosition - this._verticalScrollPosition);\n\t\t\t\t\tanimationDuration = this.calculateDynamicThrowDuration(point.length * this._logDecelerationRate + MINIMUM_VELOCITY);\n\t\t\t\t\tPool.putPoint(point);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//cancel any pending scroll to a different page. we can have only\n\t\t\t//one type of pending scroll at a time.\n\t\t\tthis.hasPendingHorizontalPageIndex = false;\n\t\t\tthis.hasPendingVerticalPageIndex = false;\n\t\t\tif(this.pendingHorizontalScrollPosition == horizontalScrollPosition &&\n\t\t\t\tthis.pendingVerticalScrollPosition == verticalScrollPosition &&\n\t\t\t\tthis.pendingScrollDuration == animationDuration)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.pendingHorizontalScrollPosition = horizontalScrollPosition;\n\t\t\tthis.pendingVerticalScrollPosition = verticalScrollPosition;\n\t\t\tthis.pendingScrollDuration = animationDuration;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_PENDING_SCROLL);\n\t\t}\n\n\t\t/**\n\t\t * After the next validation, animates the scroll position to a specific\n\t\t * page index. To scroll in only one direction, pass in the value of the\n\t\t * <code>horizontalPageIndex</code> or the\n\t\t * <code>verticalPageIndex</code> property to the appropriate parameter.\n\t\t * If the <code>animationDuration</code> argument is <code>NaN</code>\n\t\t * (the default value) the value of the <code>pageThrowDuration</code>\n\t\t * property is used for the duration. The duration is in seconds.\n\t\t *\n\t\t * <p>You can only scroll to a page if the <code>snapToPages</code>\n\t\t * property is <code>true</code>.</p>\n\t\t *\n\t\t * <p>In the following example, we scroll to the last horizontal page:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scroller.scrollToPageIndex( scroller.horizontalPageCount - 1, scroller.verticalPageIndex );</listing>\n\t\t *\n\t\t * @see #snapToPages\n\t\t * @see #pageThrowDuration\n\t\t * @see #throwEase\n\t\t * @see #horizontalPageIndex\n\t\t * @see #verticalPageIndex\n\t\t */\n\t\tpublic function scrollToPageIndex(horizontalPageIndex:int, verticalPageIndex:int, animationDuration:Number = NaN):void\n\t\t{\n\t\t\tif(animationDuration !== animationDuration) //isNaN\n\t\t\t{\n\t\t\t\tanimationDuration = this._pageThrowDuration;\n\t\t\t}\n\t\t\t//cancel any pending scroll to a specific scroll position. we can\n\t\t\t//have only one type of pending scroll at a time.\n\t\t\tthis.pendingHorizontalScrollPosition = NaN;\n\t\t\tthis.pendingVerticalScrollPosition = NaN;\n\t\t\tthis.hasPendingHorizontalPageIndex = this._horizontalPageIndex !== horizontalPageIndex;\n\t\t\tthis.hasPendingVerticalPageIndex = this._verticalPageIndex !== verticalPageIndex;\n\t\t\tif(!this.hasPendingHorizontalPageIndex && !this.hasPendingVerticalPageIndex)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.pendingHorizontalPageIndex = horizontalPageIndex;\n\t\t\tthis.pendingVerticalPageIndex = verticalPageIndex;\n\t\t\tthis.pendingScrollDuration = animationDuration;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_PENDING_SCROLL);\n\t\t}\n\n\t\t/**\n\t\t * If the scroll bars are floating, briefly show them as a hint to the\n\t\t * user. Useful when first navigating to a screen to give the user\n\t\t * context about both the ability to scroll and the current scroll\n\t\t * position.\n\t\t *\n\t\t * @see #revealScrollBarsDuration\n\t\t */\n\t\tpublic function revealScrollBars():void\n\t\t{\n\t\t\tthis.isScrollBarRevealPending = true;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_PENDING_REVEAL_SCROLL_BARS);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function hitTest(localPoint:Point):DisplayObject\n\t\t{\n\t\t\t//save localX and localY because localPoint could change after the\n\t\t\t//call to super.hitTest().\n\t\t\tvar localX:Number = localPoint.x;\n\t\t\tvar localY:Number = localPoint.y;\n\t\t\t//first check the children for touches\n\t\t\tvar result:DisplayObject = super.hitTest(localPoint);\n\t\t\tif((this._isDraggingHorizontally || this._isDraggingVertically) &&\n\t\t\t\tthis.viewPort is DisplayObjectContainer &&\n\t\t\t\tDisplayObjectContainer(this.viewPort).contains(result))\n\t\t\t{\n\t\t\t\tresult = DisplayObject(this.viewPort);\n\t\t\t}\n\t\t\tif(result === null)\n\t\t\t{\n\t\t\t\t//we want to register touches in our hitArea as a last resort\n\t\t\t\tif(!this.visible || !this.touchable)\n\t\t\t\t{\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn this._hitArea.contains(localX, localY) ? this : null;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\t//we don't use this flag in this class, but subclasses will use it,\n\t\t\t//and it's better to handle it here instead of having them\n\t\t\t//invalidate unrelated flags\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\t//similarly, this flag may be set in subclasses\n\t\t\tvar layoutInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_LAYOUT);\n\t\t\tvar scrollInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SCROLL);\n\t\t\tvar clippingInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_CLIPPING);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar scrollBarInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SCROLL_BAR_RENDERER);\n\t\t\tvar pendingScrollInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_PENDING_SCROLL);\n\t\t\tvar pendingRevealScrollBarsInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_PENDING_REVEAL_SCROLL_BARS);\n\t\t\tvar pendingPullViewInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_PENDING_PULL_VIEW);\n\n\t\t\tif(scrollBarInvalid)\n\t\t\t{\n\t\t\t\tthis.createScrollBars();\n\t\t\t}\n\n\t\t\tif(sizeInvalid || stylesInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshBackgroundSkin();\n\t\t\t}\n\n\t\t\tif(scrollBarInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshScrollBarStyles();\n\t\t\t\tthis.refreshInteractionModeEvents();\n\t\t\t}\n\n\t\t\tif(scrollBarInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshEnabled();\n\t\t\t}\n\n\t\t\tif(this.horizontalScrollBar)\n\t\t\t{\n\t\t\t\tthis.horizontalScrollBar.validate();\n\t\t\t}\n\t\t\tif(this.verticalScrollBar)\n\t\t\t{\n\t\t\t\tthis.verticalScrollBar.validate();\n\t\t\t}\n\n\t\t\tvar oldMaxHorizontalScrollPosition:Number = this._maxHorizontalScrollPosition;\n\t\t\tvar oldMaxVerticalScrollPosition:Number = this._maxVerticalScrollPosition;\n\t\t\tvar needsMeasurement:Boolean = (scrollInvalid && this._viewPort.requiresMeasurementOnScroll) ||\n\t\t\t\tdataInvalid || sizeInvalid || stylesInvalid || scrollBarInvalid || stateInvalid || layoutInvalid;\n\t\t\tthis.refreshViewPort(needsMeasurement);\n\t\t\tif(oldMaxHorizontalScrollPosition != this._maxHorizontalScrollPosition)\n\t\t\t{\n\t\t\t\tthis.refreshHorizontalAutoScrollTweenEndRatio();\n\t\t\t\tscrollInvalid = true;\n\t\t\t}\n\t\t\tif(oldMaxVerticalScrollPosition != this._maxVerticalScrollPosition)\n\t\t\t{\n\t\t\t\tthis.refreshVerticalAutoScrollTweenEndRatio();\n\t\t\t\tscrollInvalid = true;\n\t\t\t}\n\t\t\tif(scrollInvalid)\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(Event.SCROLL);\n\t\t\t}\n\n\t\t\tthis.showOrHideChildren();\n\t\t\tthis.layoutChildren();\n\n\t\t\tif(scrollInvalid || sizeInvalid || stylesInvalid || scrollBarInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshScrollBarValues();\n\t\t\t}\n\n\t\t\tif(needsMeasurement || scrollInvalid || clippingInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshMask();\n\t\t\t}\n\t\t\tthis.refreshFocusIndicator();\n\n\t\t\tif(pendingScrollInvalid)\n\t\t\t{\n\t\t\t\tthis.handlePendingScroll();\n\t\t\t}\n\n\t\t\tif(pendingRevealScrollBarsInvalid)\n\t\t\t{\n\t\t\t\tthis.handlePendingRevealScrollBars();\n\t\t\t}\n\n\t\t\tif(pendingPullViewInvalid)\n\t\t\t{\n\t\t\t\tthis.handlePendingPullView();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshViewPort(measure:Boolean):void\n\t\t{\n\t\t\tif(this._snapScrollPositionsToPixels)\n\t\t\t{\n\t\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\t\tvar pixelSize:Number = 1 / starling.contentScaleFactor;\n\t\t\t\tthis._viewPort.horizontalScrollPosition = Math.round(this._horizontalScrollPosition / pixelSize) * pixelSize;\n\t\t\t\tthis._viewPort.verticalScrollPosition = Math.round(this._verticalScrollPosition / pixelSize) * pixelSize;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._viewPort.horizontalScrollPosition = this._horizontalScrollPosition;\n\t\t\t\tthis._viewPort.verticalScrollPosition = this._verticalScrollPosition;\n\t\t\t}\n\t\t\tif(!measure)\n\t\t\t{\n\t\t\t\tthis._viewPort.validate();\n\t\t\t\tthis.refreshScrollValues();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar loopCount:int = 0;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tthis._hasViewPortBoundsChanged = false;\n\t\t\t\t//if we don't need to do any measurement, we can skip\n\t\t\t\t//this stuff and improve performance\n\t\t\t\tif(this._measureViewPort)\n\t\t\t\t{\n\t\t\t\t\tthis.calculateViewPortOffsets(true, false);\n\t\t\t\t\tthis.refreshViewPortBoundsForMeasurement();\n\t\t\t\t}\n\t\t\t\tthis.calculateViewPortOffsets(false, false);\n\n\t\t\t\tthis.autoSizeIfNeeded();\n\n\t\t\t\t//just in case autoSizeIfNeeded() is overridden, we need to call\n\t\t\t\t//this again and use actualWidth/Height instead of\n\t\t\t\t//explicitWidth/Height.\n\t\t\t\tthis.calculateViewPortOffsets(false, true);\n\n\t\t\t\tthis.refreshViewPortBoundsForLayout();\n\t\t\t\tthis.refreshScrollValues();\n\t\t\t\tloopCount++;\n\t\t\t\tif(loopCount >= 10)\n\t\t\t\t{\n\t\t\t\t\t//if it still fails after ten tries, we've probably entered\n\t\t\t\t\t//an infinite loop. it could be things like rounding errors,\n\t\t\t\t\t//layout issues, or custom item renderers that don't measure\n\t\t\t\t\t//correctly\n\t\t\t\t\tthrow new Error(getQualifiedClassName(this) + \" stuck in an infinite loop during measurement and validation. This may be an issue with the layout or children, such as custom item renderers.\");\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile(this._hasViewPortBoundsChanged);\n\t\t\tthis._lastViewPortWidth = this._viewPort.width;\n\t\t\tthis._lastViewPortHeight = this._viewPort.height;\n\t\t}\n\n\t\t/**\n\t\t * If the component's dimensions have not been set explicitly, it will\n\t\t * measure its content and determine an ideal size for itself. If the\n\t\t * <code>explicitWidth</code> or <code>explicitHeight</code> member\n\t\t * variables are set, those value will be used without additional\n\t\t * measurement. If one is set, but not the other, the dimension with the\n\t\t * explicit value will not be measured, but the other non-explicit\n\t\t * dimension will still need measurement.\n\t\t *\n\t\t * <p>Calls <code>saveMeasurements()</code> to set up the\n\t\t * <code>actualWidth</code> and <code>actualHeight</code> member\n\t\t * variables used for layout.</p>\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t */\n\t\tprotected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tresetFluidChildDimensionsForMeasurement(this.currentBackgroundSkin,\n\t\t\t\tthis._explicitWidth, this._explicitHeight,\n\t\t\t\tthis._explicitMinWidth, this._explicitMinHeight,\n\t\t\t\tthis._explicitMaxWidth, this._explicitMaxHeight,\n\t\t\t\tthis._explicitBackgroundWidth, this._explicitBackgroundHeight,\n\t\t\t\tthis._explicitBackgroundMinWidth, this._explicitBackgroundMinHeight,\n\t\t\t\tthis._explicitBackgroundMaxWidth, this._explicitBackgroundMaxHeight);\n\t\t\tvar measureBackground:IMeasureDisplayObject = this.currentBackgroundSkin as IMeasureDisplayObject;\n\t\t\tif(this.currentBackgroundSkin is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.currentBackgroundSkin).validate();\n\t\t\t}\n\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tif(this._measureViewPort)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this._viewPort.visibleWidth;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewWidth = 0;\n\t\t\t\t}\n\t\t\t\tnewWidth += this._rightViewPortOffset + this._leftViewPortOffset;\n\t\t\t\tif(this.currentBackgroundSkin !== null &&\n\t\t\t\t\tthis.currentBackgroundSkin.width > newWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this.currentBackgroundSkin.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tif(this._measureViewPort)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this._viewPort.visibleHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewHeight = 0;\n\t\t\t\t}\n\t\t\t\tnewHeight += this._bottomViewPortOffset + this._topViewPortOffset;\n\t\t\t\tif(this.currentBackgroundSkin !== null &&\n\t\t\t\t\tthis.currentBackgroundSkin.height > newHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this.currentBackgroundSkin.height;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tif(this._measureViewPort)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = this._viewPort.minVisibleWidth;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = 0;\n\t\t\t\t}\n\t\t\t\tnewMinWidth += this._rightViewPortOffset + this._leftViewPortOffset;\n\t\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(measureBackground !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(measureBackground.minWidth > newMinWidth)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinWidth = measureBackground.minWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._explicitBackgroundMinWidth > newMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = this._explicitBackgroundMinWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tif(this._measureViewPort)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = this._viewPort.minVisibleHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = 0;\n\t\t\t\t}\n\t\t\t\tnewMinHeight += this._bottomViewPortOffset + this._topViewPortOffset;\n\t\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(measureBackground !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(measureBackground.minHeight > newMinHeight)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinHeight = measureBackground.minHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._explicitBackgroundMinHeight > newMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = this._explicitBackgroundMinHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>horizontalScrollBar</code> and\n\t\t * <code>verticalScrollBar</code> sub-components and removes the old\n\t\t * instances, if they exist.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #horizontalScrollBar\n\t\t * @see #verticalScrollBar\n\t\t * @see #horizontalScrollBarFactory\n\t\t * @see #verticalScrollBarFactory\n\t\t */\n\t\tprotected function createScrollBars():void\n\t\t{\n\t\t\tif(this.horizontalScrollBar)\n\t\t\t{\n\t\t\t\tthis.horizontalScrollBar.removeEventListener(FeathersEventType.BEGIN_INTERACTION, horizontalScrollBar_beginInteractionHandler);\n\t\t\t\tthis.horizontalScrollBar.removeEventListener(FeathersEventType.END_INTERACTION, horizontalScrollBar_endInteractionHandler);\n\t\t\t\tthis.horizontalScrollBar.removeEventListener(Event.CHANGE, horizontalScrollBar_changeHandler);\n\t\t\t\tthis.removeRawChildInternal(DisplayObject(this.horizontalScrollBar), true);\n\t\t\t\tthis.horizontalScrollBar = null;\n\t\t\t}\n\t\t\tif(this.verticalScrollBar)\n\t\t\t{\n\t\t\t\tthis.verticalScrollBar.removeEventListener(FeathersEventType.BEGIN_INTERACTION, verticalScrollBar_beginInteractionHandler);\n\t\t\t\tthis.verticalScrollBar.removeEventListener(FeathersEventType.END_INTERACTION, verticalScrollBar_endInteractionHandler);\n\t\t\t\tthis.verticalScrollBar.removeEventListener(Event.CHANGE, verticalScrollBar_changeHandler);\n\t\t\t\tthis.removeRawChildInternal(DisplayObject(this.verticalScrollBar), true);\n\t\t\t\tthis.verticalScrollBar = null;\n\t\t\t}\n\n\t\t\tif(this._scrollBarDisplayMode != ScrollBarDisplayMode.NONE &&\n\t\t\t\tthis._horizontalScrollPolicy != ScrollPolicy.OFF && this._horizontalScrollBarFactory != null)\n\t\t\t{\n\t\t\t\tthis.horizontalScrollBar = IScrollBar(this._horizontalScrollBarFactory());\n\t\t\t\tif(this.horizontalScrollBar is IDirectionalScrollBar)\n\t\t\t\t{\n\t\t\t\t\tIDirectionalScrollBar(this.horizontalScrollBar).direction = Direction.HORIZONTAL;\n\t\t\t\t}\n\t\t\t\tvar horizontalScrollBarStyleName:String = this._customHorizontalScrollBarStyleName != null ? this._customHorizontalScrollBarStyleName : this.horizontalScrollBarStyleName;\n\t\t\t\tthis.horizontalScrollBar.styleNameList.add(horizontalScrollBarStyleName);\n\t\t\t\tthis.horizontalScrollBar.addEventListener(Event.CHANGE, horizontalScrollBar_changeHandler);\n\t\t\t\tthis.horizontalScrollBar.addEventListener(FeathersEventType.BEGIN_INTERACTION, horizontalScrollBar_beginInteractionHandler);\n\t\t\t\tthis.horizontalScrollBar.addEventListener(FeathersEventType.END_INTERACTION, horizontalScrollBar_endInteractionHandler);\n\t\t\t\tthis.addRawChildInternal(DisplayObject(this.horizontalScrollBar));\n\t\t\t}\n\t\t\tif(this._scrollBarDisplayMode != ScrollBarDisplayMode.NONE &&\n\t\t\t\tthis._verticalScrollPolicy != ScrollPolicy.OFF && this._verticalScrollBarFactory != null)\n\t\t\t{\n\t\t\t\tthis.verticalScrollBar = IScrollBar(this._verticalScrollBarFactory());\n\t\t\t\tif(this.verticalScrollBar is IDirectionalScrollBar)\n\t\t\t\t{\n\t\t\t\t\tIDirectionalScrollBar(this.verticalScrollBar).direction = Direction.VERTICAL;\n\t\t\t\t}\n\t\t\t\tvar verticalScrollBarStyleName:String = this._customVerticalScrollBarStyleName != null ? this._customVerticalScrollBarStyleName : this.verticalScrollBarStyleName;\n\t\t\t\tthis.verticalScrollBar.styleNameList.add(verticalScrollBarStyleName);\n\t\t\t\tthis.verticalScrollBar.addEventListener(Event.CHANGE, verticalScrollBar_changeHandler);\n\t\t\t\tthis.verticalScrollBar.addEventListener(FeathersEventType.BEGIN_INTERACTION, verticalScrollBar_beginInteractionHandler);\n\t\t\t\tthis.verticalScrollBar.addEventListener(FeathersEventType.END_INTERACTION, verticalScrollBar_endInteractionHandler);\n\t\t\t\tthis.addRawChildInternal(DisplayObject(this.verticalScrollBar));\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Choose the appropriate background skin based on the control's current\n\t\t * state.\n\t\t */\n\t\tprotected function refreshBackgroundSkin():void\n\t\t{\n\t\t\tvar newCurrentBackgroundSkin:DisplayObject = this.getCurrentBackgroundSkin();\n\t\t\tif(this.currentBackgroundSkin !== newCurrentBackgroundSkin)\n\t\t\t{\n\t\t\t\tthis.removeCurrentBackgroundSkin(this.currentBackgroundSkin);\n\t\t\t\tthis.currentBackgroundSkin = newCurrentBackgroundSkin;\n\t\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(this.currentBackgroundSkin is IFeathersControl)\n\t\t\t\t\t{\n\t\t\t\t\t\tIFeathersControl(this.currentBackgroundSkin).initializeNow();\n\t\t\t\t\t}\n\t\t\t\t\tif(this.currentBackgroundSkin is IMeasureDisplayObject)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar measureSkin:IMeasureDisplayObject = IMeasureDisplayObject(this.currentBackgroundSkin);\n\t\t\t\t\t\tthis._explicitBackgroundWidth = measureSkin.explicitWidth;\n\t\t\t\t\t\tthis._explicitBackgroundHeight = measureSkin.explicitHeight;\n\t\t\t\t\t\tthis._explicitBackgroundMinWidth = measureSkin.explicitMinWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMinHeight = measureSkin.explicitMinHeight;\n\t\t\t\t\t\tthis._explicitBackgroundMaxWidth = measureSkin.explicitMaxWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMaxHeight = measureSkin.explicitMaxHeight;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._explicitBackgroundWidth = this.currentBackgroundSkin.width;\n\t\t\t\t\t\tthis._explicitBackgroundHeight = this.currentBackgroundSkin.height;\n\t\t\t\t\t\tthis._explicitBackgroundMinWidth = this._explicitBackgroundWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMinHeight = this._explicitBackgroundHeight;\n\t\t\t\t\t\tthis._explicitBackgroundMaxWidth = this._explicitBackgroundWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMaxHeight = this._explicitBackgroundHeight;\n\t\t\t\t\t}\n\t\t\t\t\tthis.addRawChildAtInternal(this.currentBackgroundSkin, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getCurrentBackgroundSkin():DisplayObject\n\t\t{\n\t\t\tvar newCurrentBackgroundSkin:DisplayObject = this._backgroundSkin;\n\t\t\tif(!this._isEnabled && this._backgroundDisabledSkin !== null)\n\t\t\t{\n\t\t\t\tnewCurrentBackgroundSkin = this._backgroundDisabledSkin;\n\t\t\t}\n\t\t\treturn newCurrentBackgroundSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function removeCurrentBackgroundSkin(skin:DisplayObject):void\n\t\t{\n\t\t\tif(skin === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(skin.parent === this)\n\t\t\t{\n\t\t\t\t//we need to restore these values so that they won't be lost the\n\t\t\t\t//next time that this skin is used for measurement\n\t\t\t\tskin.width = this._explicitBackgroundWidth;\n\t\t\t\tskin.height = this._explicitBackgroundHeight;\n\t\t\t\tif(skin is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar measureSkin:IMeasureDisplayObject = IMeasureDisplayObject(skin);\n\t\t\t\t\tmeasureSkin.minWidth = this._explicitBackgroundMinWidth;\n\t\t\t\t\tmeasureSkin.minHeight = this._explicitBackgroundMinHeight;\n\t\t\t\t\tmeasureSkin.maxWidth = this._explicitBackgroundMaxWidth;\n\t\t\t\t\tmeasureSkin.maxHeight = this._explicitBackgroundMaxHeight;\n\t\t\t\t}\n\t\t\t\tthis.removeRawChildInternal(skin);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshScrollBarStyles():void\n\t\t{\n\t\t\tif(this.horizontalScrollBar)\n\t\t\t{\n\t\t\t\tfor(var propertyName:String in this._horizontalScrollBarProperties)\n\t\t\t\t{\n\t\t\t\t\tvar propertyValue:Object = this._horizontalScrollBarProperties[propertyName];\n\t\t\t\t\tthis.horizontalScrollBar[propertyName] = propertyValue;\n\t\t\t\t}\n\t\t\t\tif(this._horizontalScrollBarHideTween)\n\t\t\t\t{\n\t\t\t\t\tStarling.juggler.remove(this._horizontalScrollBarHideTween);\n\t\t\t\t\tthis._horizontalScrollBarHideTween = null;\n\t\t\t\t}\n\t\t\t\tthis.horizontalScrollBar.alpha = this._scrollBarDisplayMode == ScrollBarDisplayMode.FLOAT ? 0 : 1;\n\t\t\t}\n\t\t\tif(this.verticalScrollBar)\n\t\t\t{\n\t\t\t\tfor(propertyName in this._verticalScrollBarProperties)\n\t\t\t\t{\n\t\t\t\t\tpropertyValue = this._verticalScrollBarProperties[propertyName];\n\t\t\t\t\tthis.verticalScrollBar[propertyName] = propertyValue;\n\t\t\t\t}\n\t\t\t\tif(this._verticalScrollBarHideTween)\n\t\t\t\t{\n\t\t\t\t\tStarling.juggler.remove(this._verticalScrollBarHideTween);\n\t\t\t\t\tthis._verticalScrollBarHideTween = null;\n\t\t\t\t}\n\t\t\t\tthis.verticalScrollBar.alpha = this._scrollBarDisplayMode == ScrollBarDisplayMode.FLOAT ? 0 : 1;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshEnabled():void\n\t\t{\n\t\t\tif(this._viewPort)\n\t\t\t{\n\t\t\t\tthis._viewPort.isEnabled = this._isEnabled;\n\t\t\t}\n\t\t\tif(this.horizontalScrollBar)\n\t\t\t{\n\t\t\t\tthis.horizontalScrollBar.isEnabled = this._isEnabled;\n\t\t\t}\n\t\t\tif(this.verticalScrollBar)\n\t\t\t{\n\t\t\t\tthis.verticalScrollBar.isEnabled = this._isEnabled;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function refreshFocusIndicator():void\n\t\t{\n\t\t\tif(this._focusIndicatorSkin)\n\t\t\t{\n\t\t\t\tif(this._hasFocus && this._showFocus)\n\t\t\t\t{\n\t\t\t\t\tif(this._focusIndicatorSkin.parent != this)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.addRawChildInternal(this._focusIndicatorSkin);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.setRawChildIndexInternal(this._focusIndicatorSkin, this.numRawChildrenInternal - 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(this._focusIndicatorSkin.parent == this)\n\t\t\t\t{\n\t\t\t\t\tthis.removeRawChildInternal(this._focusIndicatorSkin, false);\n\t\t\t\t}\n\t\t\t\tthis._focusIndicatorSkin.x = this._focusPaddingLeft;\n\t\t\t\tthis._focusIndicatorSkin.y = this._focusPaddingTop;\n\t\t\t\tthis._focusIndicatorSkin.width = this.actualWidth - this._focusPaddingLeft - this._focusPaddingRight;\n\t\t\t\tthis._focusIndicatorSkin.height = this.actualHeight - this._focusPaddingTop - this._focusPaddingBottom;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshViewPortBoundsForMeasurement():void\n\t\t{\n\t\t\tvar horizontalWidthOffset:Number = this._leftViewPortOffset + this._rightViewPortOffset;\n\t\t\tvar verticalHeightOffset:Number = this._topViewPortOffset + this._bottomViewPortOffset;\n\n\t\t\tresetFluidChildDimensionsForMeasurement(this.currentBackgroundSkin,\n\t\t\t\tthis._explicitWidth, this._explicitHeight,\n\t\t\t\tthis._explicitMinWidth, this._explicitMinHeight,\n\t\t\t\tthis._explicitMaxWidth, this._explicitMaxHeight,\n\t\t\t\tthis._explicitBackgroundWidth, this._explicitBackgroundHeight,\n\t\t\t\tthis._explicitBackgroundMinWidth, this._explicitBackgroundMinHeight,\n\t\t\t\tthis._explicitBackgroundMaxWidth, this._explicitBackgroundMaxHeight);\n\t\t\tvar measureBackground:IMeasureDisplayObject = this.currentBackgroundSkin as IMeasureDisplayObject;\n\t\t\tif(this.currentBackgroundSkin is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.currentBackgroundSkin).validate();\n\t\t\t}\n\n\t\t\t//we account for the explicit minimum dimensions of the view port\n\t\t\t//and the minimum dimensions of the background skin because it helps\n\t\t\t//the final measurements stabilize faster.\n\t\t\tvar viewPortMinWidth:Number = this._explicitMinWidth;\n\t\t\tif(viewPortMinWidth !== viewPortMinWidth || //isNaN\n\t\t\t\tthis._explicitViewPortMinWidth > viewPortMinWidth)\n\t\t\t{\n\t\t\t\tviewPortMinWidth = this._explicitViewPortMinWidth;\n\t\t\t}\n\t\t\tif(viewPortMinWidth !== viewPortMinWidth || //isNaN\n\t\t\t\tthis._explicitWidth > viewPortMinWidth)\n\t\t\t{\n\t\t\t\tviewPortMinWidth = this._explicitWidth;\n\t\t\t}\n\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t{\n\t\t\t\tvar backgroundMinWidth:Number = this.currentBackgroundSkin.width;\n\t\t\t\tif(measureBackground !== null)\n\t\t\t\t{\n\t\t\t\t\tbackgroundMinWidth = measureBackground.minWidth;\n\t\t\t\t}\n\t\t\t\tif(viewPortMinWidth !== viewPortMinWidth || //isNaN\n\t\t\t\t\tbackgroundMinWidth > viewPortMinWidth)\n\t\t\t\t{\n\t\t\t\t\tviewPortMinWidth = backgroundMinWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tviewPortMinWidth -= horizontalWidthOffset;\n\n\t\t\tvar viewPortMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(viewPortMinHeight !== viewPortMinHeight || //isNaN\n\t\t\t\tthis._explicitViewPortMinHeight > viewPortMinHeight)\n\t\t\t{\n\t\t\t\tviewPortMinHeight = this._explicitViewPortMinHeight;\n\t\t\t}\n\t\t\tif(viewPortMinHeight !== viewPortMinHeight || //isNaN\n\t\t\t\tthis._explicitHeight > viewPortMinHeight)\n\t\t\t{\n\t\t\t\tviewPortMinHeight = this._explicitHeight;\n\t\t\t}\n\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t{\n\t\t\t\tvar backgroundMinHeight:Number = this.currentBackgroundSkin.height;\n\t\t\t\tif(measureBackground !== null)\n\t\t\t\t{\n\t\t\t\t\tbackgroundMinHeight = measureBackground.minHeight;\n\t\t\t\t}\n\t\t\t\tif(viewPortMinHeight !== viewPortMinHeight || //isNaN\n\t\t\t\t\tbackgroundMinHeight > viewPortMinHeight)\n\t\t\t\t{\n\t\t\t\t\tviewPortMinHeight = backgroundMinHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tviewPortMinHeight -= verticalHeightOffset;\n\n\t\t\tvar oldIgnoreViewPortResizing:Boolean = this.ignoreViewPortResizing;\n\t\t\t//setting some of the properties below may result in a resize\n\t\t\t//event, which forces another layout pass for the view port and\n\t\t\t//hurts performance (because it needs to break out of an\n\t\t\t//infinite loop)\n\t\t\tthis.ignoreViewPortResizing = true;\n\n\t\t\t//if scroll bars are fixed, we're going to include the offsets even\n\t\t\t//if they may not be needed in the final pass. if not fixed, the\n\t\t\t//view port fills the entire bounds.\n\t\t\tthis._viewPort.visibleWidth = this._explicitWidth - horizontalWidthOffset;\n\t\t\tthis._viewPort.minVisibleWidth = this._explicitMinWidth - horizontalWidthOffset;\n\t\t\tthis._viewPort.maxVisibleWidth = this._explicitMaxWidth - horizontalWidthOffset;\n\t\t\tthis._viewPort.minWidth = viewPortMinWidth;\n\n\t\t\tthis._viewPort.visibleHeight = this._explicitHeight - verticalHeightOffset;\n\t\t\tthis._viewPort.minVisibleHeight = this._explicitMinHeight - verticalHeightOffset;\n\t\t\tthis._viewPort.maxVisibleHeight = this._explicitMaxHeight - verticalHeightOffset;\n\t\t\tthis._viewPort.minHeight = viewPortMinHeight;\n\t\t\tthis._viewPort.validate();\n\t\t\t//we don't want to listen for a resize event from the view port\n\t\t\t//while it is validating this time. during the next validation is\n\t\t\t//where it matters if the view port resizes. \n\t\t\tthis.ignoreViewPortResizing = oldIgnoreViewPortResizing;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshViewPortBoundsForLayout():void\n\t\t{\n\t\t\tvar horizontalWidthOffset:Number = this._leftViewPortOffset + this._rightViewPortOffset;\n\t\t\tvar verticalHeightOffset:Number = this._topViewPortOffset + this._bottomViewPortOffset;\n\n\t\t\tvar oldIgnoreViewPortResizing:Boolean = this.ignoreViewPortResizing;\n\t\t\t//setting some of the properties below may result in a resize\n\t\t\t//event, which forces another layout pass for the view port and\n\t\t\t//hurts performance (because it needs to break out of an\n\t\t\t//infinite loop)\n\t\t\tthis.ignoreViewPortResizing = true;\n\n\t\t\tvar visibleWidth:Number = this.actualWidth - horizontalWidthOffset;\n\t\t\t//we'll only set the view port's visibleWidth and visibleHeight if\n\t\t\t//our dimensions are explicit. this allows the view port to know\n\t\t\t//whether it needs to re-measure on scroll.\n\t\t\tif(this._viewPort.visibleWidth != visibleWidth)\n\t\t\t{\n\t\t\t\tthis._viewPort.visibleWidth = visibleWidth;\n\t\t\t}\n\t\t\tthis._viewPort.minVisibleWidth = this.actualMinWidth - horizontalWidthOffset;\n\t\t\tthis._viewPort.maxVisibleWidth = this._explicitMaxWidth - horizontalWidthOffset;\n\t\t\tthis._viewPort.minWidth = visibleWidth;\n\n\t\t\tvar visibleHeight:Number = this.actualHeight - verticalHeightOffset;\n\t\t\tif(this._viewPort.visibleHeight != visibleHeight)\n\t\t\t{\n\t\t\t\tthis._viewPort.visibleHeight = visibleHeight;\n\t\t\t}\n\t\t\tthis._viewPort.minVisibleHeight = this.actualMinHeight - verticalHeightOffset;\n\t\t\tthis._viewPort.maxVisibleHeight = this._explicitMaxHeight - verticalHeightOffset;\n\t\t\tthis._viewPort.minHeight = visibleHeight;\n\n\t\t\t//this time, we care whether a resize event is dispatched while the\n\t\t\t//view port is validating because it means we'll need to try another\n\t\t\t//measurement pass. we restore the flag before calling validate().\n\t\t\tthis.ignoreViewPortResizing = oldIgnoreViewPortResizing;\n\n\t\t\tthis._viewPort.validate();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshScrollValues():void\n\t\t{\n\t\t\tthis.refreshScrollSteps();\n\n\t\t\tvar oldMaxHSP:Number = this._maxHorizontalScrollPosition;\n\t\t\tvar oldMaxVSP:Number = this._maxVerticalScrollPosition;\n\t\t\tthis.refreshMinAndMaxScrollPositions();\n\t\t\tvar maximumPositionsChanged:Boolean = this._maxHorizontalScrollPosition != oldMaxHSP || this._maxVerticalScrollPosition != oldMaxVSP;\n\t\t\tif(maximumPositionsChanged && this._touchPointID < 0)\n\t\t\t{\n\t\t\t\tthis.clampScrollPositions();\n\t\t\t}\n\n\t\t\tthis.refreshPageCount();\n\t\t\tthis.refreshPageIndices();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function clampScrollPositions():void\n\t\t{\n\t\t\tif(!this._horizontalAutoScrollTween)\n\t\t\t{\n\t\t\t\tif(this._snapToPages)\n\t\t\t\t{\n\t\t\t\t\tthis._horizontalScrollPosition = roundToNearest(this._horizontalScrollPosition, this.actualPageWidth);\n\t\t\t\t}\n\t\t\t\tvar targetHorizontalScrollPosition:Number = this._horizontalScrollPosition;\n\t\t\t\tif(targetHorizontalScrollPosition < this._minHorizontalScrollPosition)\n\t\t\t\t{\n\t\t\t\t\ttargetHorizontalScrollPosition = this._minHorizontalScrollPosition;\n\t\t\t\t}\n\t\t\t\telse if(targetHorizontalScrollPosition > this._maxHorizontalScrollPosition)\n\t\t\t\t{\n\t\t\t\t\ttargetHorizontalScrollPosition = this._maxHorizontalScrollPosition;\n\t\t\t\t}\n\t\t\t\tthis.horizontalScrollPosition = targetHorizontalScrollPosition;\n\t\t\t}\n\t\t\tif(!this._verticalAutoScrollTween)\n\t\t\t{\n\t\t\t\tif(this._snapToPages)\n\t\t\t\t{\n\t\t\t\t\tthis._verticalScrollPosition = roundToNearest(this._verticalScrollPosition, this.actualPageHeight);\n\t\t\t\t}\n\t\t\t\tvar targetVerticalScrollPosition:Number = this._verticalScrollPosition;\n\t\t\t\tif(targetVerticalScrollPosition < this._minVerticalScrollPosition)\n\t\t\t\t{\n\t\t\t\t\ttargetVerticalScrollPosition = this._minVerticalScrollPosition;\n\t\t\t\t}\n\t\t\t\telse if(targetVerticalScrollPosition > this._maxVerticalScrollPosition)\n\t\t\t\t{\n\t\t\t\t\ttargetVerticalScrollPosition = this._maxVerticalScrollPosition;\n\t\t\t\t}\n\t\t\t\tthis.verticalScrollPosition = targetVerticalScrollPosition;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshScrollSteps():void\n\t\t{\n\t\t\tif(this.explicitHorizontalScrollStep !== this.explicitHorizontalScrollStep) //isNaN\n\t\t\t{\n\t\t\t\tif(this._viewPort)\n\t\t\t\t{\n\t\t\t\t\tthis.actualHorizontalScrollStep = this._viewPort.horizontalScrollStep;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.actualHorizontalScrollStep = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.actualHorizontalScrollStep = this.explicitHorizontalScrollStep;\n\t\t\t}\n\t\t\tif(this.explicitVerticalScrollStep !== this.explicitVerticalScrollStep) //isNaN\n\t\t\t{\n\t\t\t\tif(this._viewPort)\n\t\t\t\t{\n\t\t\t\t\tthis.actualVerticalScrollStep = this._viewPort.verticalScrollStep;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.actualVerticalScrollStep = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.actualVerticalScrollStep = this.explicitVerticalScrollStep;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshMinAndMaxScrollPositions():void\n\t\t{\n\t\t\tvar visibleViewPortWidth:Number = this.actualWidth - (this._leftViewPortOffset + this._rightViewPortOffset);\n\t\t\tvar visibleViewPortHeight:Number = this.actualHeight - (this._topViewPortOffset + this._bottomViewPortOffset);\n\t\t\tif(this.explicitPageWidth !== this.explicitPageWidth) //isNaN\n\t\t\t{\n\t\t\t\tthis.actualPageWidth = visibleViewPortWidth;\n\t\t\t}\n\t\t\tif(this.explicitPageHeight !== this.explicitPageHeight) //isNaN\n\t\t\t{\n\t\t\t\tthis.actualPageHeight = visibleViewPortHeight;\n\t\t\t}\n\t\t\tif(this._viewPort)\n\t\t\t{\n\t\t\t\tthis._minHorizontalScrollPosition = this._viewPort.contentX;\n\t\t\t\tif(this._viewPort.width == Number.POSITIVE_INFINITY)\n\t\t\t\t{\n\t\t\t\t\t//we don't want to risk the possibility of negative infinity\n\t\t\t\t\t//being added to positive infinity. the result is NaN.\n\t\t\t\t\tthis._maxHorizontalScrollPosition = Number.POSITIVE_INFINITY;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._maxHorizontalScrollPosition = this._minHorizontalScrollPosition + this._viewPort.width - visibleViewPortWidth;\n\t\t\t\t}\n\t\t\t\tif(this._maxHorizontalScrollPosition < this._minHorizontalScrollPosition)\n\t\t\t\t{\n\t\t\t\t\tthis._maxHorizontalScrollPosition = this._minHorizontalScrollPosition;\n\t\t\t\t}\n\t\t\t\tthis._minVerticalScrollPosition = this._viewPort.contentY;\n\t\t\t\tif(this._viewPort.height == Number.POSITIVE_INFINITY)\n\t\t\t\t{\n\t\t\t\t\t//we don't want to risk the possibility of negative infinity\n\t\t\t\t\t//being added to positive infinity. the result is NaN.\n\t\t\t\t\tthis._maxVerticalScrollPosition = Number.POSITIVE_INFINITY;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._maxVerticalScrollPosition = this._minVerticalScrollPosition + this._viewPort.height - visibleViewPortHeight;\n\t\t\t\t}\n\t\t\t\tif(this._maxVerticalScrollPosition < this._minVerticalScrollPosition)\n\t\t\t\t{\n\t\t\t\t\tthis._maxVerticalScrollPosition =  this._minVerticalScrollPosition;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._minHorizontalScrollPosition = 0;\n\t\t\t\tthis._minVerticalScrollPosition = 0;\n\t\t\t\tthis._maxHorizontalScrollPosition = 0;\n\t\t\t\tthis._maxVerticalScrollPosition = 0;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshPageCount():void\n\t\t{\n\t\t\tif(this._snapToPages)\n\t\t\t{\n\t\t\t\tvar horizontalScrollRange:Number = this._maxHorizontalScrollPosition - this._minHorizontalScrollPosition;\n\t\t\t\tif(horizontalScrollRange == Number.POSITIVE_INFINITY)\n\t\t\t\t{\n\t\t\t\t\t//trying to put positive infinity into an int results in 0\n\t\t\t\t\t//so we need a special case to provide a large int value.\n\t\t\t\t\tif(this._minHorizontalScrollPosition == Number.NEGATIVE_INFINITY)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._minHorizontalPageIndex = int.MIN_VALUE;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._minHorizontalPageIndex = 0;\n\t\t\t\t\t}\n\t\t\t\t\tthis._maxHorizontalPageIndex = int.MAX_VALUE;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._minHorizontalPageIndex = 0;\n\t\t\t\t\tvar unroundedPageIndex:Number = horizontalScrollRange / this.actualPageWidth;\n\t\t\t\t\tvar nearestPageIndex:int = Math.round(unroundedPageIndex);\n\t\t\t\t\tif(MathUtil.isEquivalent(unroundedPageIndex, nearestPageIndex, PAGE_INDEX_EPSILON))\n\t\t\t\t\t{\n\t\t\t\t\t\t//we almost always want to round up, but a\n\t\t\t\t\t\t//floating point math error, or a page width that\n\t\t\t\t\t\t//isn't an integer (when snapping to pixels) could\n\t\t\t\t\t\t//cause the page index to be off by one\n\t\t\t\t\t\tthis._maxHorizontalPageIndex = nearestPageIndex;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._maxHorizontalPageIndex = Math.ceil(unroundedPageIndex);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar verticalScrollRange:Number = this._maxVerticalScrollPosition - this._minVerticalScrollPosition;\n\t\t\t\tif(verticalScrollRange == Number.POSITIVE_INFINITY)\n\t\t\t\t{\n\t\t\t\t\t//trying to put positive infinity into an int results in 0\n\t\t\t\t\t//so we need a special case to provide a large int value.\n\t\t\t\t\tif(this._minVerticalScrollPosition == Number.NEGATIVE_INFINITY)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._minVerticalPageIndex = int.MIN_VALUE;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._minVerticalPageIndex = 0;\n\t\t\t\t\t}\n\t\t\t\t\tthis._maxVerticalPageIndex = int.MAX_VALUE;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._minVerticalPageIndex = 0;\n\t\t\t\t\tunroundedPageIndex = verticalScrollRange / this.actualPageHeight;\n\t\t\t\t\tnearestPageIndex = Math.round(unroundedPageIndex);\n\t\t\t\t\tif(MathUtil.isEquivalent(unroundedPageIndex, nearestPageIndex, PAGE_INDEX_EPSILON))\n\t\t\t\t\t{\n\t\t\t\t\t\t//we almost always want to round up, but a\n\t\t\t\t\t\t//floating point math error, or a page height that\n\t\t\t\t\t\t//isn't an integer (when snapping to pixels) could\n\t\t\t\t\t\t//cause the page index to be off by one\n\t\t\t\t\t\tthis._maxVerticalPageIndex = nearestPageIndex;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._maxVerticalPageIndex = Math.ceil(unroundedPageIndex);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._maxHorizontalPageIndex = 0;\n\t\t\t\tthis._maxHorizontalPageIndex = 0;\n\t\t\t\tthis._minVerticalPageIndex = 0;\n\t\t\t\tthis._maxVerticalPageIndex = 0;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshPageIndices():void\n\t\t{\n\t\t\tif(!this._horizontalAutoScrollTween && !this.hasPendingHorizontalPageIndex)\n\t\t\t{\n\t\t\t\tif(this._snapToPages)\n\t\t\t\t{\n\t\t\t\t\tif(this._horizontalScrollPosition == this._maxHorizontalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._horizontalPageIndex = this._maxHorizontalPageIndex;\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._horizontalScrollPosition == this._minHorizontalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._horizontalPageIndex = this._minHorizontalPageIndex;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._minHorizontalScrollPosition == Number.NEGATIVE_INFINITY && this._horizontalScrollPosition < 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar unroundedPageIndex:Number = this._horizontalScrollPosition / this.actualPageWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(this._maxHorizontalScrollPosition == Number.POSITIVE_INFINITY && this._horizontalScrollPosition >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunroundedPageIndex = this._horizontalScrollPosition / this.actualPageWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar adjustedHorizontalScrollPosition:Number = this._horizontalScrollPosition - this._minHorizontalScrollPosition;\n\t\t\t\t\t\t\tunroundedPageIndex = adjustedHorizontalScrollPosition / this.actualPageWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar nearestPageIndex:int = Math.round(unroundedPageIndex);\n\t\t\t\t\t\tif(unroundedPageIndex != nearestPageIndex &&\n\t\t\t\t\t\t\tMathUtil.isEquivalent(unroundedPageIndex, nearestPageIndex, PAGE_INDEX_EPSILON))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//we almost always want to round down, but a\n\t\t\t\t\t\t\t//floating point math error, or a page width that\n\t\t\t\t\t\t\t//isn't an integer (when snapping to pixels) could\n\t\t\t\t\t\t\t//cause the page index to be off by one\n\t\t\t\t\t\t\tthis._horizontalPageIndex = nearestPageIndex;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._horizontalPageIndex = Math.floor(unroundedPageIndex);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._horizontalPageIndex = this._minHorizontalPageIndex;\n\t\t\t\t}\n\t\t\t\tif(this._horizontalPageIndex < this._minHorizontalPageIndex)\n\t\t\t\t{\n\t\t\t\t\tthis._horizontalPageIndex = this._minHorizontalPageIndex;\n\t\t\t\t}\n\t\t\t\tif(this._horizontalPageIndex > this._maxHorizontalPageIndex)\n\t\t\t\t{\n\t\t\t\t\tthis._horizontalPageIndex = this._maxHorizontalPageIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!this._verticalAutoScrollTween && !this.hasPendingVerticalPageIndex)\n\t\t\t{\n\t\t\t\tif(this._snapToPages)\n\t\t\t\t{\n\t\t\t\t\tif(this._verticalScrollPosition == this._maxVerticalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._verticalPageIndex = this._maxVerticalPageIndex;\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._verticalScrollPosition == this._minVerticalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._verticalPageIndex = this._minVerticalPageIndex;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._minVerticalScrollPosition == Number.NEGATIVE_INFINITY && this._verticalScrollPosition < 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunroundedPageIndex = this._verticalScrollPosition / this.actualPageHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(this._maxVerticalScrollPosition == Number.POSITIVE_INFINITY && this._verticalScrollPosition >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunroundedPageIndex = this._verticalScrollPosition / this.actualPageHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar adjustedVerticalScrollPosition:Number = this._verticalScrollPosition - this._minVerticalScrollPosition;\n\t\t\t\t\t\t\tunroundedPageIndex = adjustedVerticalScrollPosition / this.actualPageHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnearestPageIndex = Math.round(unroundedPageIndex);\n\t\t\t\t\t\tif(unroundedPageIndex != nearestPageIndex &&\n\t\t\t\t\t\t\tMathUtil.isEquivalent(unroundedPageIndex, nearestPageIndex, PAGE_INDEX_EPSILON))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//we almost always want to round down, but a\n\t\t\t\t\t\t\t//floating point math error, or a page height that\n\t\t\t\t\t\t\t//isn't an integer (when snapping to pixels) could\n\t\t\t\t\t\t\t//cause the page index to be off by one\n\t\t\t\t\t\t\tthis._verticalPageIndex = nearestPageIndex;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._verticalPageIndex = Math.floor(unroundedPageIndex);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._verticalPageIndex = this._minVerticalScrollPosition;\n\t\t\t\t}\n\t\t\t\tif(this._verticalPageIndex < this._minVerticalScrollPosition)\n\t\t\t\t{\n\t\t\t\t\tthis._verticalPageIndex = this._minVerticalScrollPosition;\n\t\t\t\t}\n\t\t\t\tif(this._verticalPageIndex > this._maxVerticalPageIndex)\n\t\t\t\t{\n\t\t\t\t\tthis._verticalPageIndex = this._maxVerticalPageIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshScrollBarValues():void\n\t\t{\n\t\t\tif(this.horizontalScrollBar)\n\t\t\t{\n\t\t\t\tthis.horizontalScrollBar.minimum = this._minHorizontalScrollPosition;\n\t\t\t\tthis.horizontalScrollBar.maximum = this._maxHorizontalScrollPosition;\n\t\t\t\tthis.horizontalScrollBar.value = this._horizontalScrollPosition;\n\t\t\t\tthis.horizontalScrollBar.page = (this._maxHorizontalScrollPosition - this._minHorizontalScrollPosition) * this.actualPageWidth / this._viewPort.width;\n\t\t\t\tthis.horizontalScrollBar.step = this.actualHorizontalScrollStep;\n\t\t\t}\n\n\t\t\tif(this.verticalScrollBar)\n\t\t\t{\n\t\t\t\tthis.verticalScrollBar.minimum = this._minVerticalScrollPosition;\n\t\t\t\tthis.verticalScrollBar.maximum = this._maxVerticalScrollPosition;\n\t\t\t\tthis.verticalScrollBar.value = this._verticalScrollPosition;\n\t\t\t\tthis.verticalScrollBar.page = (this._maxVerticalScrollPosition - this._minVerticalScrollPosition) * this.actualPageHeight / this._viewPort.height;\n\t\t\t\tthis.verticalScrollBar.step = this.actualVerticalScrollStep;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function showOrHideChildren():void\n\t\t{\n\t\t\tvar childCount:int = this.numRawChildrenInternal;\n\t\t\tif(this.verticalScrollBar)\n\t\t\t{\n\t\t\t\tthis.verticalScrollBar.visible = this._hasVerticalScrollBar;\n\t\t\t\tthis.verticalScrollBar.touchable = this._hasVerticalScrollBar && this._interactionMode != ScrollInteractionMode.TOUCH;\n\t\t\t\tthis.setRawChildIndexInternal(DisplayObject(this.verticalScrollBar), childCount - 1);\n\t\t\t}\n\t\t\tif(this.horizontalScrollBar)\n\t\t\t{\n\t\t\t\tthis.horizontalScrollBar.visible = this._hasHorizontalScrollBar;\n\t\t\t\tthis.horizontalScrollBar.touchable = this._hasHorizontalScrollBar && this._interactionMode != ScrollInteractionMode.TOUCH;\n\t\t\t\tif(this.verticalScrollBar)\n\t\t\t\t{\n\t\t\t\t\tthis.setRawChildIndexInternal(DisplayObject(this.horizontalScrollBar), childCount - 2);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.setRawChildIndexInternal(DisplayObject(this.horizontalScrollBar), childCount - 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this.currentBackgroundSkin)\n\t\t\t{\n\t\t\t\tif(this._autoHideBackground)\n\t\t\t\t{\n\t\t\t\t\tthis.currentBackgroundSkin.visible = this._viewPort.width <= this.actualWidth ||\n\t\t\t\t\t\tthis._viewPort.height <= this.actualHeight ||\n\t\t\t\t\t\tthis._horizontalScrollPosition < 0 ||\n\t\t\t\t\t\tthis._horizontalScrollPosition > this._maxHorizontalScrollPosition ||\n\t\t\t\t\t\tthis._verticalScrollPosition < 0 ||\n\t\t\t\t\t\tthis._verticalScrollPosition > this._maxVerticalScrollPosition;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.currentBackgroundSkin.visible = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function calculateViewPortOffsetsForFixedHorizontalScrollBar(forceScrollBars:Boolean = false, useActualBounds:Boolean = false):void\n\t\t{\n\t\t\tif(this.horizontalScrollBar && (this._measureViewPort || useActualBounds))\n\t\t\t{\n\t\t\t\tvar scrollerWidth:Number = useActualBounds ? this.actualWidth : this._explicitWidth;\n\t\t\t\tif(!useActualBounds && !forceScrollBars &&\n\t\t\t\t\tscrollerWidth !== scrollerWidth) //isNaN\n\t\t\t\t{\n\t\t\t\t\t//even if explicitWidth is NaN, the view port might measure\n\t\t\t\t\t//a view port width smaller than its content width\n\t\t\t\t\tscrollerWidth = this._viewPort.visibleWidth + this._leftViewPortOffset + this._rightViewPortOffset;\n\t\t\t\t}\n\t\t\t\tvar totalWidth:Number = this._viewPort.width + this._leftViewPortOffset + this._rightViewPortOffset;\n\t\t\t\tif(forceScrollBars || this._horizontalScrollPolicy === ScrollPolicy.ON ||\n\t\t\t\t\t((totalWidth > scrollerWidth || totalWidth > this._explicitMaxWidth) &&\n\t\t\t\t\t\tthis._horizontalScrollPolicy !== ScrollPolicy.OFF))\n\t\t\t\t{\n\t\t\t\t\tthis._hasHorizontalScrollBar = true;\n\t\t\t\t\tif(this._scrollBarDisplayMode === ScrollBarDisplayMode.FIXED)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._horizontalScrollBarPosition === RelativePosition.TOP)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._topViewPortOffset += this.horizontalScrollBar.height;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._bottomViewPortOffset += this.horizontalScrollBar.height;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._hasHorizontalScrollBar = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._hasHorizontalScrollBar = false;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function calculateViewPortOffsetsForFixedVerticalScrollBar(forceScrollBars:Boolean = false, useActualBounds:Boolean = false):void\n\t\t{\n\t\t\tif(this.verticalScrollBar && (this._measureViewPort || useActualBounds))\n\t\t\t{\n\t\t\t\tvar scrollerHeight:Number = useActualBounds ? this.actualHeight : this._explicitHeight;\n\t\t\t\tif(!useActualBounds && !forceScrollBars &&\n\t\t\t\t\tscrollerHeight !== scrollerHeight) //isNaN\n\t\t\t\t{\n\t\t\t\t\t//even if explicitHeight is NaN, the view port might measure\n\t\t\t\t\t//a view port height smaller than its content height\n\t\t\t\t\tscrollerHeight = this._viewPort.visibleHeight + this._topViewPortOffset + this._bottomViewPortOffset;\n\t\t\t\t}\n\t\t\t\tvar totalHeight:Number = this._viewPort.height + this._topViewPortOffset + this._bottomViewPortOffset;\n\t\t\t\tif(forceScrollBars || this._verticalScrollPolicy === ScrollPolicy.ON ||\n\t\t\t\t\t((totalHeight > scrollerHeight || totalHeight > this._explicitMaxHeight) &&\n\t\t\t\t\t\tthis._verticalScrollPolicy !== ScrollPolicy.OFF))\n\t\t\t\t{\n\t\t\t\t\tthis._hasVerticalScrollBar = true;\n\t\t\t\t\tif(this._scrollBarDisplayMode === ScrollBarDisplayMode.FIXED)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._verticalScrollBarPosition === RelativePosition.LEFT)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._leftViewPortOffset += this.verticalScrollBar.width;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._rightViewPortOffset += this.verticalScrollBar.width;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._hasVerticalScrollBar = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._hasVerticalScrollBar = false;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function calculateViewPortOffsets(forceScrollBars:Boolean = false, useActualBounds:Boolean = false):void\n\t\t{\n\t\t\t//in fixed mode, if we determine that scrolling is required, we\n\t\t\t//remember the offsets for later. if scrolling is not needed, then\n\t\t\t//we will ignore the offsets from here forward\n\t\t\tthis._topViewPortOffset = this._paddingTop;\n\t\t\tthis._rightViewPortOffset = this._paddingRight;\n\t\t\tthis._bottomViewPortOffset = this._paddingBottom;\n\t\t\tthis._leftViewPortOffset = this._paddingLeft;\n\t\t\tthis.calculateViewPortOffsetsForFixedHorizontalScrollBar(forceScrollBars, useActualBounds);\n\t\t\tthis.calculateViewPortOffsetsForFixedVerticalScrollBar(forceScrollBars, useActualBounds);\n\t\t\t//we need to double check the horizontal scroll bar if the scroll\n\t\t\t//bars are fixed because adding a vertical scroll bar may require a\n\t\t\t//horizontal one too.\n\t\t\tif(this._scrollBarDisplayMode == ScrollBarDisplayMode.FIXED &&\n\t\t\t\tthis._hasVerticalScrollBar && !this._hasHorizontalScrollBar)\n\t\t\t{\n\t\t\t\tthis.calculateViewPortOffsetsForFixedHorizontalScrollBar(forceScrollBars, useActualBounds);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshInteractionModeEvents():void\n\t\t{\n\t\t\tif(this._interactionMode == ScrollInteractionMode.TOUCH || this._interactionMode == ScrollInteractionMode.TOUCH_AND_SCROLL_BARS)\n\t\t\t{\n\t\t\t\tthis.addEventListener(TouchEvent.TOUCH, scroller_touchHandler);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.removeEventListener(TouchEvent.TOUCH, scroller_touchHandler);\n\t\t\t}\n\n\t\t\tif((this._interactionMode == ScrollInteractionMode.MOUSE || this._interactionMode == ScrollInteractionMode.TOUCH_AND_SCROLL_BARS) &&\n\t\t\t\tthis._scrollBarDisplayMode == ScrollBarDisplayMode.FLOAT)\n\t\t\t{\n\t\t\t\tif(this.horizontalScrollBar)\n\t\t\t\t{\n\t\t\t\t\tthis.horizontalScrollBar.addEventListener(TouchEvent.TOUCH, horizontalScrollBar_touchHandler);\n\t\t\t\t}\n\t\t\t\tif(this.verticalScrollBar)\n\t\t\t\t{\n\t\t\t\t\tthis.verticalScrollBar.addEventListener(TouchEvent.TOUCH, verticalScrollBar_touchHandler);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(this.horizontalScrollBar)\n\t\t\t\t{\n\t\t\t\t\tthis.horizontalScrollBar.removeEventListener(TouchEvent.TOUCH, horizontalScrollBar_touchHandler);\n\t\t\t\t}\n\t\t\t\tif(this.verticalScrollBar)\n\t\t\t\t{\n\t\t\t\t\tthis.verticalScrollBar.removeEventListener(TouchEvent.TOUCH, verticalScrollBar_touchHandler);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Positions and sizes children based on the actual width and height\n\t\t * values.\n\t\t */\n\t\tprotected function layoutChildren():void\n\t\t{\n\t\t\tvar visibleWidth:Number = this.actualWidth - this._leftViewPortOffset - this._rightViewPortOffset;\n\t\t\tvar visibleHeight:Number = this.actualHeight - this._topViewPortOffset - this._bottomViewPortOffset;\n\n\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t{\n\t\t\t\tthis.currentBackgroundSkin.width = this.actualWidth;\n\t\t\t\tthis.currentBackgroundSkin.height = this.actualHeight;\n\t\t\t}\n\n\t\t\tif(this._snapScrollPositionsToPixels)\n\t\t\t{\n\t\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\t\tvar pixelSize:Number = 1 / starling.contentScaleFactor;\n\t\t\t\tthis._viewPort.x = Math.round((this._leftViewPortOffset - this._horizontalScrollPosition) / pixelSize) * pixelSize;\n\t\t\t\tthis._viewPort.y = Math.round((this._topViewPortOffset - this._verticalScrollPosition) / pixelSize) * pixelSize;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._viewPort.x = this._leftViewPortOffset - this._horizontalScrollPosition;\n\t\t\t\tthis._viewPort.y = this._topViewPortOffset - this._verticalScrollPosition;\n\t\t\t}\n\n\t\t\tthis.layoutPullViews();\n\t\t\tthis.layoutScrollBars();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutScrollBars():void\n\t\t{\n\t\t\tvar visibleWidth:Number = this.actualWidth - this._leftViewPortOffset - this._rightViewPortOffset;\n\t\t\tvar visibleHeight:Number = this.actualHeight - this._topViewPortOffset - this._bottomViewPortOffset;\n\t\t\tif(this.horizontalScrollBar !== null)\n\t\t\t{\n\t\t\t\tthis.horizontalScrollBar.validate();\n\t\t\t}\n\t\t\tif(this.verticalScrollBar !== null)\n\t\t\t{\n\t\t\t\tthis.verticalScrollBar.validate();\n\t\t\t}\n\t\t\tif(this.horizontalScrollBar !== null)\n\t\t\t{\n\t\t\t\tif(this._horizontalScrollBarPosition === RelativePosition.TOP)\n\t\t\t\t{\n\t\t\t\t\tthis.horizontalScrollBar.y = this._paddingTop;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.horizontalScrollBar.y = this._topViewPortOffset + visibleHeight;\n\t\t\t\t}\n\t\t\t\tthis.horizontalScrollBar.x = this._leftViewPortOffset;\n\t\t\t\tif(this._scrollBarDisplayMode !== ScrollBarDisplayMode.FIXED)\n\t\t\t\t{\n\t\t\t\t\tthis.horizontalScrollBar.y -= this.horizontalScrollBar.height;\n\t\t\t\t\tif((this._hasVerticalScrollBar || this._verticalScrollBarHideTween) && this.verticalScrollBar)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.horizontalScrollBar.width = visibleWidth - this.verticalScrollBar.width;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.horizontalScrollBar.width = visibleWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.horizontalScrollBar.width = visibleWidth;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(this.verticalScrollBar !== null)\n\t\t\t{\n\t\t\t\tif(this._verticalScrollBarPosition === RelativePosition.LEFT)\n\t\t\t\t{\n\t\t\t\t\tthis.verticalScrollBar.x = this._paddingLeft;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.verticalScrollBar.x = this._leftViewPortOffset + visibleWidth;\n\t\t\t\t}\n\t\t\t\tthis.verticalScrollBar.y = this._topViewPortOffset;\n\t\t\t\tif(this._scrollBarDisplayMode !== ScrollBarDisplayMode.FIXED)\n\t\t\t\t{\n\t\t\t\t\tthis.verticalScrollBar.x -= this.verticalScrollBar.width;\n\t\t\t\t\tif((this._hasHorizontalScrollBar || this._horizontalScrollBarHideTween) && this.horizontalScrollBar)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.verticalScrollBar.height = visibleHeight - this.horizontalScrollBar.height;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.verticalScrollBar.height = visibleHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.verticalScrollBar.height = visibleHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutPullViews():void\n\t\t{\n\t\t\tvar viewPortIndex:int = this.getRawChildIndexInternal(DisplayObject(this._viewPort));\n\t\t\tif(this._topPullView !== null)\n\t\t\t{\n\t\t\t\tif(this._topPullView is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this._topPullView).validate();\n\t\t\t\t}\n\t\t\t\tthis._topPullView.x = this._topPullView.pivotX * this._topPullView.scaleX +\n\t\t\t\t\t(this.actualWidth - this._topPullView.width) / 2;\n\t\t\t\t//if the animation is active, we don't want to interrupt it.\n\t\t\t\t//if the user starts dragging, the animation will be stopped.\n\t\t\t\tif(this._topPullTween === null)\n\t\t\t\t{\n\t\t\t\t\tvar pullViewSize:Number = this._topPullView.height;\n\t\t\t\t\tvar finalRatio:Number = this._topPullViewRatio;\n\t\t\t\t\tif(this._verticalScrollPosition < this._minVerticalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar scrollRatio:Number = (this._minVerticalScrollPosition - this._verticalScrollPosition) / pullViewSize;\n\t\t\t\t\t\tif(scrollRatio > finalRatio)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfinalRatio = scrollRatio;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(this._isTopPullViewActive && finalRatio < 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tfinalRatio = 1;\n\t\t\t\t\t}\n\t\t\t\t\tif(finalRatio > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._topPullViewDisplayMode === PullViewDisplayMode.FIXED)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._topPullView.y = this._topViewPortOffset +\n\t\t\t\t\t\t\t\tthis._topPullView.pivotY * this._topPullView.scaleY;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._topPullView.y = this._topViewPortOffset +\n\t\t\t\t\t\t\t\tthis._topPullView.pivotY * this._topPullView.scaleY +\n\t\t\t\t\t\t\t\t(finalRatio * pullViewSize) - pullViewSize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._topPullView.visible = true;\n\t\t\t\t\t\tthis.refreshTopPullViewMask();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._topPullView.visible = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar pullViewIndex:int = this.getRawChildIndexInternal(this._topPullView);\n\t\t\t\tif(this._topPullViewDisplayMode === PullViewDisplayMode.FIXED &&\n\t\t\t\t\tthis._hasElasticEdges)\n\t\t\t\t{\n\t\t\t\t\t//if fixed and elastic, the pull view should appear below\n\t\t\t\t\t//the view port\n\t\t\t\t\tif(viewPortIndex < pullViewIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.setRawChildIndexInternal(this._topPullView, viewPortIndex);\n\t\t\t\t\t\tviewPortIndex++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//otherwise, it should appear above\n\t\t\t\t\tif(viewPortIndex > pullViewIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.removeRawChildInternal(this._topPullView);\n\t\t\t\t\t\tthis.addRawChildAtInternal(this._topPullView, viewPortIndex);\n\t\t\t\t\t\tviewPortIndex--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._rightPullView !== null)\n\t\t\t{\n\t\t\t\tif(this._rightPullView is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this._rightPullView).validate();\n\t\t\t\t}\n\t\t\t\tthis._rightPullView.y = this._rightPullView.pivotY * this._rightPullView.scaleY +\n\t\t\t\t\t(this.actualHeight - this._rightPullView.height) / 2;\n\t\t\t\t//if the animation is active, we don't want to interrupt it.\n\t\t\t\t//if the user starts dragging, the animation will be stopped.\n\t\t\t\tif(this._rightPullTween === null)\n\t\t\t\t{\n\t\t\t\t\tpullViewSize = this._rightPullView.width;\n\t\t\t\t\tfinalRatio = this._rightPullViewRatio;\n\t\t\t\t\tif(this._horizontalScrollPosition > this._maxHorizontalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tscrollRatio = (this._horizontalScrollPosition - this._maxHorizontalScrollPosition) / pullViewSize;\n\t\t\t\t\t\tif(scrollRatio > finalRatio)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfinalRatio = scrollRatio;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(this._isRightPullViewActive && finalRatio < 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tfinalRatio = 1;\n\t\t\t\t\t}\n\t\t\t\t\tif(finalRatio > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._rightPullViewDisplayMode === PullViewDisplayMode.FIXED)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._rightPullView.x = this._rightPullView.pivotX * this._rightPullView.scaleX +\n\t\t\t\t\t\t\t\tthis.actualWidth - this._rightViewPortOffset - pullViewSize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._rightPullView.x = this._rightPullView.pivotX * this._rightPullView.scaleX +\n\t\t\t\t\t\t\t\tthis.actualWidth - this._rightViewPortOffset - (finalRatio * pullViewSize);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._rightPullView.visible = true;\n\t\t\t\t\t\tthis.refreshRightPullViewMask();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._rightPullView.visible = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tpullViewIndex = this.getRawChildIndexInternal(this._rightPullView);\n\t\t\t\tif(this._rightPullViewDisplayMode === PullViewDisplayMode.FIXED &&\n\t\t\t\t\tthis._hasElasticEdges)\n\t\t\t\t{\n\t\t\t\t\t//if fixed and elastic, the pull view should appear below\n\t\t\t\t\t//the view port\n\t\t\t\t\tif(viewPortIndex < pullViewIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.setRawChildIndexInternal(this._rightPullView, viewPortIndex);\n\t\t\t\t\t\tviewPortIndex++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//otherwise, it should appear above\n\t\t\t\t\tif(viewPortIndex > pullViewIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.removeRawChildInternal(this._rightPullView);\n\t\t\t\t\t\tthis.addRawChildAtInternal(this._rightPullView, viewPortIndex);\n\t\t\t\t\t\tviewPortIndex--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._bottomPullView !== null)\n\t\t\t{\n\t\t\t\tif(this._bottomPullView is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this._bottomPullView).validate();\n\t\t\t\t}\n\t\t\t\tthis._bottomPullView.x = this._bottomPullView.pivotX * this._bottomPullView.scaleX +\n\t\t\t\t\t(this.actualWidth - this._bottomPullView.width) / 2;\n\t\t\t\t//if the animation is active, we don't want to interrupt it.\n\t\t\t\t//if the user starts dragging, the animation will be stopped.\n\t\t\t\tif(this._bottomPullTween === null)\n\t\t\t\t{\n\t\t\t\t\tpullViewSize = this._bottomPullView.height;\n\t\t\t\t\tfinalRatio = this._bottomPullViewRatio;\n\t\t\t\t\tif(this._verticalScrollPosition > this._maxVerticalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\t//if the scroll position is greater than the pull\n\t\t\t\t\t\t//position, then prefer the scroll position\n\t\t\t\t\t\tscrollRatio = (this._verticalScrollPosition - this._maxVerticalScrollPosition) / pullViewSize;\n\t\t\t\t\t\tif(scrollRatio > finalRatio)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfinalRatio = scrollRatio;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(this._isBottomPullViewActive && finalRatio < 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tfinalRatio = 1;\n\t\t\t\t\t}\n\t\t\t\t\tif(finalRatio > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._bottomPullViewDisplayMode === PullViewDisplayMode.FIXED)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._bottomPullView.y = this._bottomPullView.pivotY * this._bottomPullView.scaleY +\n\t\t\t\t\t\t\t\tthis.actualHeight - this._bottomViewPortOffset - pullViewSize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._bottomPullView.y = this._bottomPullView.pivotY * this._bottomPullView.scaleY +\n\t\t\t\t\t\t\t\tthis.actualHeight - this._bottomViewPortOffset - (finalRatio * pullViewSize);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._bottomPullView.visible = true;\n\t\t\t\t\t\tthis.refreshBottomPullViewMask();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._bottomPullView.visible = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tpullViewIndex = this.getRawChildIndexInternal(this._bottomPullView);\n\t\t\t\tif(this._bottomPullViewDisplayMode === PullViewDisplayMode.FIXED &&\n\t\t\t\t\tthis._hasElasticEdges)\n\t\t\t\t{\n\t\t\t\t\t//if fixed and elastic, the pull view should appear below\n\t\t\t\t\t//the view port\n\t\t\t\t\tif(viewPortIndex < pullViewIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.setRawChildIndexInternal(this._bottomPullView, viewPortIndex);\n\t\t\t\t\t\tviewPortIndex++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//otherwise, it should appear above\n\t\t\t\t\tif(viewPortIndex > pullViewIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.removeRawChildInternal(this._bottomPullView);\n\t\t\t\t\t\tthis.addRawChildAtInternal(this._bottomPullView, viewPortIndex);\n\t\t\t\t\t\tviewPortIndex--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._leftPullView !== null)\n\t\t\t{\n\t\t\t\tif(this._leftPullView is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this._leftPullView).validate();\n\t\t\t\t}\n\t\t\t\tthis._leftPullView.y = this._leftPullView.pivotY * this._leftPullView.scaleY +\n\t\t\t\t\t(this.actualHeight - this._leftPullView.height) / 2;\n\t\t\t\t//if the animation is active, we don't want to interrupt it.\n\t\t\t\t//if the user starts dragging, the animation will be stopped.\n\t\t\t\tif(this._leftPullTween === null)\n\t\t\t\t{\n\t\t\t\t\tpullViewSize = this._leftPullView.width;\n\t\t\t\t\tfinalRatio = this._leftPullViewRatio;\n\t\t\t\t\tif(this._horizontalScrollPosition < this._minHorizontalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\t//if the scroll position is less than the pull position,\n\t\t\t\t\t\t//then prefer the scroll position\n\t\t\t\t\t\tscrollRatio = (this._minHorizontalScrollPosition - this._horizontalScrollPosition) / pullViewSize;\n\t\t\t\t\t\tif(scrollRatio > finalRatio)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfinalRatio = scrollRatio;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(this._isLeftPullViewActive && finalRatio < 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tfinalRatio = 1;\n\t\t\t\t\t}\n\t\t\t\t\tif(finalRatio > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._leftPullViewDisplayMode === PullViewDisplayMode.FIXED)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._leftPullView.x = this._leftViewPortOffset +\n\t\t\t\t\t\t\t\tthis._leftPullView.pivotX * this._leftPullView.scaleX;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._leftPullView.x = this._leftViewPortOffset +\n\t\t\t\t\t\t\t\tthis._leftPullView.pivotX * this._leftPullView.scaleX +\n\t\t\t\t\t\t\t\t (finalRatio * pullViewSize) - pullViewSize;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._leftPullView.visible = true;\n\t\t\t\t\t\tthis.refreshLeftPullViewMask();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._leftPullView.visible = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tpullViewIndex = this.getRawChildIndexInternal(this._leftPullView);\n\t\t\t\tif(this._leftPullViewDisplayMode === PullViewDisplayMode.FIXED &&\n\t\t\t\t\tthis._hasElasticEdges)\n\t\t\t\t{\n\t\t\t\t\t//if fixed and elastic, the pull view should appear below\n\t\t\t\t\t//the view port\n\t\t\t\t\tif(viewPortIndex < pullViewIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.setRawChildIndexInternal(this._leftPullView, viewPortIndex);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//otherwise, it should appear above\n\t\t\t\t\tif(viewPortIndex > pullViewIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.removeRawChildInternal(this._leftPullView);\n\t\t\t\t\t\tthis.addRawChildAtInternal(this._leftPullView, viewPortIndex);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshTopPullViewMask():void\n\t\t{\n\t\t\tvar pullViewHeight:Number = this._topPullView.height / this._topPullView.scaleY;\n\t\t\tvar mask:DisplayObject = this._topPullView.mask;\n\t\t\tvar maskHeight:Number = pullViewHeight + ((this._topPullView.y - this._topPullView.pivotY * this._topPullView.scaleY - this._paddingTop) / this._topPullView.scaleY);\n\t\t\tif(maskHeight < 0)\n\t\t\t{\n\t\t\t\tmaskHeight = 0;\n\t\t\t}\n\t\t\telse if(maskHeight > pullViewHeight)\n\t\t\t{\n\t\t\t\tmaskHeight = pullViewHeight;\n\t\t\t}\n\t\t\tmask.width = this._topPullView.width / this._topPullView.scaleX;\n\t\t\tmask.height = maskHeight;\n\t\t\tmask.x = 0;\n\t\t\tmask.y = pullViewHeight - maskHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshRightPullViewMask():void\n\t\t{\n\t\t\tvar pullViewWidth:Number = this._rightPullView.width / this._rightPullView.scaleX;\n\t\t\tvar mask:DisplayObject = this._rightPullView.mask;\n\t\t\tvar maskWidth:Number = this.actualWidth - this._rightViewPortOffset - ((this._rightPullView.x - this._rightPullView.pivotX / this._rightPullView.scaleX) / this._rightPullView.scaleX);\n\t\t\tif(maskWidth < 0)\n\t\t\t{\n\t\t\t\tmaskWidth = 0;\n\t\t\t}\n\t\t\telse if(maskWidth > pullViewWidth)\n\t\t\t{\n\t\t\t\tmaskWidth = pullViewWidth;\n\t\t\t}\n\t\t\tmask.width = maskWidth;\n\t\t\tmask.height = this._rightPullView.height / this._rightPullView.scaleY;\n\t\t\tmask.x = 0;\n\t\t\tmask.y = 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshBottomPullViewMask():void\n\t\t{\n\t\t\tvar pullViewHeight:Number = this._bottomPullView.height / this._bottomPullView.scaleY;\n\t\t\tvar mask:DisplayObject = this._bottomPullView.mask;\n\t\t\tvar maskHeight:Number = this.actualHeight - this._bottomViewPortOffset - ((this._bottomPullView.y - this._bottomPullView.pivotY / this._bottomPullView.scaleY) / this._bottomPullView.scaleY);\n\t\t\tif(maskHeight < 0)\n\t\t\t{\n\t\t\t\tmaskHeight = 0;\n\t\t\t}\n\t\t\telse if(maskHeight > pullViewHeight)\n\t\t\t{\n\t\t\t\tmaskHeight = pullViewHeight;\n\t\t\t}\n\t\t\tmask.width = this._bottomPullView.width / this._bottomPullView.scaleX;\n\t\t\tmask.height = maskHeight;\n\t\t\tmask.x = 0;\n\t\t\tmask.y = 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshLeftPullViewMask():void\n\t\t{\n\t\t\tvar pullViewWidth:Number = this._leftPullView.width / this._leftPullView.scaleX;\n\t\t\tvar mask:DisplayObject = this._leftPullView.mask;\n\t\t\tvar maskWidth:Number = pullViewWidth + ((this._leftPullView.x - this._leftPullView.pivotX * this._leftPullView.scaleX - this._paddingLeft) / this._leftPullView.scaleX);\n\t\t\tif(maskWidth < 0)\n\t\t\t{\n\t\t\t\tmaskWidth = 0;\n\t\t\t}\n\t\t\telse if(maskWidth > pullViewWidth)\n\t\t\t{\n\t\t\t\tmaskWidth = pullViewWidth;\n\t\t\t}\n\t\t\tmask.width = maskWidth;\n\t\t\tmask.height = this._leftPullView.height / this._leftPullView.scaleY;\n\t\t\tmask.x = pullViewWidth - maskWidth;\n\t\t\tmask.y = 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshMask():void\n\t\t{\n\t\t\tif(!this._clipContent)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar clipWidth:Number = this.actualWidth - this._leftViewPortOffset - this._rightViewPortOffset;\n\t\t\tif(clipWidth < 0)\n\t\t\t{\n\t\t\t\tclipWidth = 0;\n\t\t\t}\n\t\t\tvar clipHeight:Number = this.actualHeight - this._topViewPortOffset - this._bottomViewPortOffset;\n\t\t\tif(clipHeight < 0)\n\t\t\t{\n\t\t\t\tclipHeight = 0;\n\t\t\t}\n\t\t\tvar mask:Quad = this._viewPort.mask as Quad;\n\t\t\tif(!mask)\n\t\t\t{\n\t\t\t\tmask = new Quad(1, 1, 0xff0ff);\n\t\t\t\tthis._viewPort.mask = mask;\n\t\t\t}\n\t\t\tmask.x = this._horizontalScrollPosition;\n\t\t\tmask.y = this._verticalScrollPosition;\n\t\t\tmask.width = clipWidth;\n\t\t\tmask.height = clipHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function get numRawChildrenInternal():int\n\t\t{\n\t\t\tif(this is IScrollContainer)\n\t\t\t{\n\t\t\t\treturn IScrollContainer(this).numRawChildren;\n\t\t\t}\n\t\t\treturn this.numChildren;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function addRawChildInternal(child:DisplayObject):DisplayObject\n\t\t{\n\t\t\tif(this is IScrollContainer)\n\t\t\t{\n\t\t\t\treturn IScrollContainer(this).addRawChild(child);\n\t\t\t}\n\t\t\treturn this.addChild(child);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function addRawChildAtInternal(child:DisplayObject, index:int):DisplayObject\n\t\t{\n\t\t\tif(this is IScrollContainer)\n\t\t\t{\n\t\t\t\treturn IScrollContainer(this).addRawChildAt(child, index);\n\t\t\t}\n\t\t\treturn this.addChildAt(child, index);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function removeRawChildInternal(child:DisplayObject, dispose:Boolean = false):DisplayObject\n\t\t{\n\t\t\tif(this is IScrollContainer)\n\t\t\t{\n\t\t\t\treturn IScrollContainer(this).removeRawChild(child, dispose);\n\t\t\t}\n\t\t\treturn this.removeChild(child, dispose);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function removeRawChildAtInternal(index:int, dispose:Boolean = false):DisplayObject\n\t\t{\n\t\t\tif(this is IScrollContainer)\n\t\t\t{\n\t\t\t\treturn IScrollContainer(this).removeRawChildAt(index, dispose);\n\t\t\t}\n\t\t\treturn this.removeChildAt(index, dispose);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getRawChildIndexInternal(child:DisplayObject):int\n\t\t{\n\t\t\tif(this is IScrollContainer)\n\t\t\t{\n\t\t\t\treturn IScrollContainer(this).getRawChildIndex(child);\n\t\t\t}\n\t\t\treturn this.getChildIndex(child);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function setRawChildIndexInternal(child:DisplayObject, index:int):void\n\t\t{\n\t\t\tif(this is IScrollContainer)\n\t\t\t{\n\t\t\t\tIScrollContainer(this).setRawChildIndex(child, index);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.setChildIndex(child, index);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function updateHorizontalScrollFromTouchPosition(touchX:Number):void\n\t\t{\n\t\t\tvar offset:Number = this._startTouchX - touchX;\n\t\t\tvar position:Number = this._startHorizontalScrollPosition + offset;\n\t\t\tvar adjustedMinScrollPosition:Number = this._minHorizontalScrollPosition;\n\t\t\tif(this._isLeftPullViewActive && this._hasElasticEdges)\n\t\t\t{\n\t\t\t\tadjustedMinScrollPosition -= this._leftPullView.width;\n\t\t\t}\n\t\t\tvar adjustedMaxScrollPosition:Number = this._maxHorizontalScrollPosition;\n\t\t\tif(this._isRightPullViewActive && this._hasElasticEdges)\n\t\t\t{\n\t\t\t\tadjustedMaxScrollPosition += this._rightPullView.width;\n\t\t\t}\n\t\t\tif(position < adjustedMinScrollPosition)\n\t\t\t{\n\t\t\t\t//first, calculate the position as if elastic edges were enabled\n\t\t\t\tposition = position - (position - adjustedMinScrollPosition) * (1 - this._elasticity);\n\t\t\t\tif(this._leftPullView !== null && position < adjustedMinScrollPosition)\n\t\t\t\t{\n\t\t\t\t\tif(this._isLeftPullViewActive)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.leftPullViewRatio = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//save the difference between that position and the minimum\n\t\t\t\t\t\t//to use for the position of the pull view\n\t\t\t\t\t\tthis.leftPullViewRatio = (adjustedMinScrollPosition - position) / this._leftPullView.width;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this._rightPullView !== null && !this._isRightPullViewActive)\n\t\t\t\t{\n\t\t\t\t\tthis.rightPullViewRatio = 0;\n\t\t\t\t}\n\t\t\t\tif(!this._hasElasticEdges ||\n\t\t\t\t\t(this._isRightPullViewActive && this._minHorizontalScrollPosition == this._maxHorizontalScrollPosition))\n\t\t\t\t{\n\t\t\t\t\t//if elastic edges aren't enabled, use the minimum\n\t\t\t\t\tposition = adjustedMinScrollPosition;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(position > adjustedMaxScrollPosition)\n\t\t\t{\n\t\t\t\tposition = position - (position - adjustedMaxScrollPosition) * (1 - this._elasticity);\n\t\t\t\tif(this._rightPullView !== null && position > adjustedMaxScrollPosition)\n\t\t\t\t{\n\t\t\t\t\tif(this._isRightPullViewActive)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.rightPullViewRatio = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.rightPullViewRatio = (position - adjustedMaxScrollPosition) / this._rightPullView.width;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this._leftPullView !== null && !this._isLeftPullViewActive)\n\t\t\t\t{\n\t\t\t\t\tthis.leftPullViewRatio = 0;\n\t\t\t\t}\n\t\t\t\tif(!this._hasElasticEdges ||\n\t\t\t\t\t(this._isLeftPullViewActive && this._minHorizontalScrollPosition == this._maxHorizontalScrollPosition))\n\t\t\t\t{\n\t\t\t\t\tposition = adjustedMaxScrollPosition;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(this._leftPullView !== null && !this._isLeftPullViewActive)\n\t\t\t\t{\n\t\t\t\t\tthis.leftPullViewRatio = 0;\n\t\t\t\t}\n\t\t\t\tif(this._rightPullView !== null && !this._isRightPullViewActive)\n\t\t\t\t{\n\t\t\t\t\tthis.rightPullViewRatio = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._leftPullViewRatio > 0)\n\t\t\t{\n\t\t\t\tif(this._leftPullTween !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._leftPullTween.dispatchEventWith(Event.REMOVE_FROM_JUGGLER);\n\t\t\t\t\tthis._leftPullTween = null;\n\t\t\t\t}\n\t\t\t\t//ensure that the component invalidates, even if the\n\t\t\t\t//horizontalScrollPosition does not change\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t\t}\n\t\t\tif(this._rightPullViewRatio > 0)\n\t\t\t{\n\t\t\t\tif(this._rightPullTween !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._rightPullTween.dispatchEventWith(Event.REMOVE_FROM_JUGGLER);\n\t\t\t\t\tthis._rightPullTween = null;\n\t\t\t\t}\n\t\t\t\t//see note above with previous call to invalidate()\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t\t}\n\t\t\tthis.horizontalScrollPosition = position;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function updateVerticalScrollFromTouchPosition(touchY:Number):void\n\t\t{\n\t\t\tvar offset:Number = this._startTouchY - touchY;\n\t\t\tvar position:Number = this._startVerticalScrollPosition + offset;\n\t\t\tvar adjustedMinScrollPosition:Number = this._minVerticalScrollPosition;\n\t\t\tif(this._isTopPullViewActive && this._hasElasticEdges)\n\t\t\t{\n\t\t\t\tadjustedMinScrollPosition -= this._topPullView.height;\n\t\t\t}\n\t\t\tvar adjustedMaxScrollPosition:Number = this._maxVerticalScrollPosition;\n\t\t\tif(this._isBottomPullViewActive && this._hasElasticEdges)\n\t\t\t{\n\t\t\t\tadjustedMaxScrollPosition += this._bottomPullView.height;\n\t\t\t}\n\t\t\tif(position < adjustedMinScrollPosition)\n\t\t\t{\n\t\t\t\t//first, calculate the position as if elastic edges were enabled\n\t\t\t\tposition = position - (position - adjustedMinScrollPosition) * (1 - this._elasticity);\n\t\t\t\tif(this._topPullView !== null && position < adjustedMinScrollPosition)\n\t\t\t\t{\n\t\t\t\t\tif(this._isTopPullViewActive)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.topPullViewRatio = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.topPullViewRatio = (adjustedMinScrollPosition - position) / this._topPullView.height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this._bottomPullView !== null && !this._isBottomPullViewActive)\n\t\t\t\t{\n\t\t\t\t\tthis.bottomPullViewRatio = 0;\n\t\t\t\t}\n\t\t\t\tif(!this._hasElasticEdges ||\n\t\t\t\t\t(this._isBottomPullViewActive && this._minVerticalScrollPosition == this._maxVerticalScrollPosition))\n\t\t\t\t{\n\t\t\t\t\t//if elastic edges aren't enabled, use the minimum\n\t\t\t\t\tposition = adjustedMinScrollPosition;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(position > adjustedMaxScrollPosition)\n\t\t\t{\n\t\t\t\tposition = position - (position - adjustedMaxScrollPosition) * (1 - this._elasticity);\n\t\t\t\tif(this._bottomPullView !== null && position > adjustedMaxScrollPosition)\n\t\t\t\t{\n\t\t\t\t\tif(this._isBottomPullViewActive)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.bottomPullViewRatio = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.bottomPullViewRatio = (position - adjustedMaxScrollPosition) / this._bottomPullView.height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this._topPullView !== null && !this._isTopPullViewActive)\n\t\t\t\t{\n\t\t\t\t\tthis.topPullViewRatio = 0;\n\t\t\t\t}\n\t\t\t\tif(!this._hasElasticEdges ||\n\t\t\t\t\t(this._isTopPullViewActive && this._minVerticalScrollPosition == this._maxVerticalScrollPosition))\n\t\t\t\t{\n\t\t\t\t\tposition = adjustedMaxScrollPosition;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(this._topPullView !== null && !this._isTopPullViewActive)\n\t\t\t\t{\n\t\t\t\t\tthis.topPullViewRatio = 0;\n\t\t\t\t}\n\t\t\t\tif(this._bottomPullView !== null && !this._isBottomPullViewActive)\n\t\t\t\t{\n\t\t\t\t\tthis.bottomPullViewRatio = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._topPullViewRatio > 0)\n\t\t\t{\n\t\t\t\tif(this._topPullTween !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._topPullTween.dispatchEventWith(Event.REMOVE_FROM_JUGGLER);\n\t\t\t\t\tthis._topPullTween = null;\n\t\t\t\t}\n\t\t\t\t//ensure that the component invalidates, even if the\n\t\t\t\t//verticalScrollPosition does not change\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t\t}\n\t\t\tif(this._bottomPullViewRatio > 0)\n\t\t\t{\n\t\t\t\tif(this._bottomPullTween !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._bottomPullTween.dispatchEventWith(Event.REMOVE_FROM_JUGGLER);\n\t\t\t\t\tthis._bottomPullTween = null;\n\t\t\t\t}\n\t\t\t\t//see note above with previous call to invalidate()\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t\t}\n\t\t\tthis.verticalScrollPosition = position;\n\t\t}\n\n\t\t/**\n\t\t * Immediately throws the scroller to the specified position, with\n\t\t * optional animation. If you want to throw in only one direction, pass\n\t\t * in <code>NaN</code> for the value that you do not want to change. The\n\t\t * scroller should be validated before throwing.\n\t\t *\n\t\t * @see #scrollToPosition()\n\t\t */\n\t\tprotected function throwTo(targetHorizontalScrollPosition:Number = NaN, targetVerticalScrollPosition:Number = NaN, duration:Number = 0.5):void\n\t\t{\n\t\t\tvar changedPosition:Boolean = false;\n\t\t\tif(targetHorizontalScrollPosition === targetHorizontalScrollPosition) //!isNaN\n\t\t\t{\n\t\t\t\tif(this._snapToPages && targetHorizontalScrollPosition > this._minHorizontalScrollPosition &&\n\t\t\t\t\ttargetHorizontalScrollPosition < this._maxHorizontalScrollPosition)\n\t\t\t\t{\n\t\t\t\t\ttargetHorizontalScrollPosition = roundToNearest(targetHorizontalScrollPosition, this.actualPageWidth);\n\t\t\t\t}\n\t\t\t\tif(this._horizontalAutoScrollTween)\n\t\t\t\t{\n\t\t\t\t\tStarling.juggler.remove(this._horizontalAutoScrollTween);\n\t\t\t\t\tthis._horizontalAutoScrollTween = null;\n\t\t\t\t}\n\t\t\t\tif(this._horizontalScrollPosition != targetHorizontalScrollPosition)\n\t\t\t\t{\n\t\t\t\t\tchangedPosition = true;\n\t\t\t\t\tthis.revealHorizontalScrollBar();\n\t\t\t\t\tthis.startScroll();\n\t\t\t\t\tif(duration == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.horizontalScrollPosition = targetHorizontalScrollPosition;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._startHorizontalScrollPosition = this._horizontalScrollPosition;\n\t\t\t\t\t\tthis._targetHorizontalScrollPosition = targetHorizontalScrollPosition;\n\t\t\t\t\t\tthis._horizontalAutoScrollTween = new Tween(this, duration, this._throwEase);\n\t\t\t\t\t\tthis._horizontalAutoScrollTween.animate(\"horizontalScrollPosition\", targetHorizontalScrollPosition);\n\t\t\t\t\t\tif(this._snapScrollPositionsToPixels)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._horizontalAutoScrollTween.onUpdate = this.horizontalAutoScrollTween_onUpdate;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._horizontalAutoScrollTween.onComplete = this.horizontalAutoScrollTween_onComplete;\n\t\t\t\t\t\tStarling.juggler.add(this._horizontalAutoScrollTween);\n\t\t\t\t\t\tthis.refreshHorizontalAutoScrollTweenEndRatio();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.finishScrollingHorizontally();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(targetVerticalScrollPosition === targetVerticalScrollPosition) //!isNaN\n\t\t\t{\n\t\t\t\tif(this._snapToPages && targetVerticalScrollPosition > this._minVerticalScrollPosition &&\n\t\t\t\t\ttargetVerticalScrollPosition < this._maxVerticalScrollPosition)\n\t\t\t\t{\n\t\t\t\t\ttargetVerticalScrollPosition = roundToNearest(targetVerticalScrollPosition, this.actualPageHeight);\n\t\t\t\t}\n\t\t\t\tif(this._verticalAutoScrollTween)\n\t\t\t\t{\n\t\t\t\t\tStarling.juggler.remove(this._verticalAutoScrollTween);\n\t\t\t\t\tthis._verticalAutoScrollTween = null;\n\t\t\t\t}\n\t\t\t\tif(this._verticalScrollPosition != targetVerticalScrollPosition)\n\t\t\t\t{\n\t\t\t\t\tchangedPosition = true;\n\t\t\t\t\tthis.revealVerticalScrollBar();\n\t\t\t\t\tthis.startScroll();\n\t\t\t\t\tif(duration == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.verticalScrollPosition = targetVerticalScrollPosition;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._startVerticalScrollPosition = this._verticalScrollPosition;\n\t\t\t\t\t\tthis._targetVerticalScrollPosition = targetVerticalScrollPosition;\n\t\t\t\t\t\tthis._verticalAutoScrollTween = new Tween(this, duration, this._throwEase);\n\t\t\t\t\t\tthis._verticalAutoScrollTween.animate(\"verticalScrollPosition\", targetVerticalScrollPosition);\n\t\t\t\t\t\tif(this._snapScrollPositionsToPixels)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._verticalAutoScrollTween.onUpdate = this.verticalAutoScrollTween_onUpdate;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._verticalAutoScrollTween.onComplete = this.verticalAutoScrollTween_onComplete;\n\t\t\t\t\t\tStarling.juggler.add(this._verticalAutoScrollTween);\n\t\t\t\t\t\tthis.refreshVerticalAutoScrollTweenEndRatio();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.finishScrollingVertically();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(changedPosition && duration == 0)\n\t\t\t{\n\t\t\t\tthis.completeScroll();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Immediately throws the scroller to the specified page index, with\n\t\t * optional animation. If you want to throw in only one direction, pass\n\t\t * in the value from the <code>horizontalPageIndex</code> or\n\t\t * <code>verticalPageIndex</code> property to the appropriate parameter.\n\t\t * The scroller must be validated before throwing, to ensure that the\n\t\t * minimum and maximum scroll positions are accurate.\n\t\t *\n\t\t * @see #scrollToPageIndex()\n\t\t */\n\t\tprotected function throwToPage(targetHorizontalPageIndex:int, targetVerticalPageIndex:int, duration:Number = 0.5):void\n\t\t{\n\t\t\tvar targetHorizontalScrollPosition:Number = this._horizontalScrollPosition;\n\t\t\tif(targetHorizontalPageIndex >= this._minHorizontalPageIndex)\n\t\t\t{\n\t\t\t\ttargetHorizontalScrollPosition = this.actualPageWidth * targetHorizontalPageIndex;\n\t\t\t}\n\t\t\tif(targetHorizontalScrollPosition < this._minHorizontalScrollPosition)\n\t\t\t{\n\t\t\t\ttargetHorizontalScrollPosition = this._minHorizontalScrollPosition;\n\t\t\t}\n\t\t\tif(targetHorizontalScrollPosition > this._maxHorizontalScrollPosition)\n\t\t\t{\n\t\t\t\ttargetHorizontalScrollPosition = this._maxHorizontalScrollPosition;\n\t\t\t}\n\t\t\tvar targetVerticalScrollPosition:Number = this._verticalScrollPosition;\n\t\t\tif(targetVerticalPageIndex >= this._minVerticalPageIndex)\n\t\t\t{\n\t\t\t\ttargetVerticalScrollPosition = this.actualPageHeight * targetVerticalPageIndex;\n\t\t\t}\n\t\t\tif(targetVerticalScrollPosition < this._minVerticalScrollPosition)\n\t\t\t{\n\t\t\t\ttargetVerticalScrollPosition = this._minVerticalScrollPosition;\n\t\t\t}\n\t\t\tif(targetVerticalScrollPosition > this._maxVerticalScrollPosition)\n\t\t\t{\n\t\t\t\ttargetVerticalScrollPosition = this._maxVerticalScrollPosition;\n\t\t\t}\n\t\t\tif(targetHorizontalPageIndex >= this._minHorizontalPageIndex)\n\t\t\t{\n\t\t\t\tthis._horizontalPageIndex = targetHorizontalPageIndex;\n\t\t\t}\n\t\t\tif(targetVerticalPageIndex >= this._minVerticalPageIndex)\n\t\t\t{\n\t\t\t\tthis._verticalPageIndex = targetVerticalPageIndex;\n\t\t\t}\n\t\t\tthis.throwTo(targetHorizontalScrollPosition, targetVerticalScrollPosition, duration);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function calculateDynamicThrowDuration(pixelsPerMS:Number):Number\n\t\t{\n\t\t\treturn (Math.log(MINIMUM_VELOCITY / Math.abs(pixelsPerMS)) / this._logDecelerationRate) / 1000;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function calculateThrowDistance(pixelsPerMS:Number):Number\n\t\t{\n\t\t\treturn (pixelsPerMS - MINIMUM_VELOCITY) / this._logDecelerationRate;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function finishScrollingHorizontally():void\n\t\t{\n\t\t\tvar adjustedMinScrollPosition:Number = this._minHorizontalScrollPosition;\n\t\t\tif(this._isLeftPullViewActive && this._hasElasticEdges)\n\t\t\t{\n\t\t\t\tadjustedMinScrollPosition -= this._leftPullView.width;\n\t\t\t}\n\t\t\tvar adjustedMaxScrollPosition:Number = this._maxHorizontalScrollPosition;\n\t\t\tif(this._isRightPullViewActive && this._hasElasticEdges)\n\t\t\t{\n\t\t\t\tadjustedMaxScrollPosition += this._rightPullView.width;\n\t\t\t}\n\t\t\tvar targetHorizontalScrollPosition:Number = NaN;\n\t\t\tif(this._horizontalScrollPosition < adjustedMinScrollPosition)\n\t\t\t{\n\t\t\t\ttargetHorizontalScrollPosition = adjustedMinScrollPosition;\n\t\t\t}\n\t\t\telse if(this._horizontalScrollPosition > adjustedMaxScrollPosition)\n\t\t\t{\n\t\t\t\ttargetHorizontalScrollPosition = adjustedMaxScrollPosition;\n\t\t\t}\n\n\t\t\tthis._isDraggingHorizontally = false;\n\t\t\tif(targetHorizontalScrollPosition !== targetHorizontalScrollPosition) //isNaN\n\t\t\t{\n\t\t\t\tthis.completeScroll();\n\t\t\t}\n\t\t\telse if(Math.abs(targetHorizontalScrollPosition - this._horizontalScrollPosition) < 1)\n\t\t\t{\n\t\t\t\t//this distance is too small to animate. just finish now.\n\t\t\t\tthis.horizontalScrollPosition = targetHorizontalScrollPosition;\n\t\t\t\tthis.completeScroll();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.throwTo(targetHorizontalScrollPosition, NaN, this._elasticSnapDuration);\n\t\t\t}\n\t\t\tthis.restoreHorizontalPullViews();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function finishScrollingVertically():void\n\t\t{\n\t\t\tvar adjustedMinScrollPosition:Number = this._minVerticalScrollPosition;\n\t\t\tif(this._isTopPullViewActive && this._hasElasticEdges)\n\t\t\t{\n\t\t\t\tadjustedMinScrollPosition -= this._topPullView.height;\n\t\t\t}\n\t\t\tvar adjustedMaxScrollPosition:Number = this._maxVerticalScrollPosition;\n\t\t\tif(this._isBottomPullViewActive && this._hasElasticEdges)\n\t\t\t{\n\t\t\t\tadjustedMaxScrollPosition += this._bottomPullView.height;\n\t\t\t}\n\t\t\tvar targetVerticalScrollPosition:Number = NaN;\n\t\t\tif(this._verticalScrollPosition < adjustedMinScrollPosition)\n\t\t\t{\n\t\t\t\ttargetVerticalScrollPosition = adjustedMinScrollPosition;\n\t\t\t}\n\t\t\telse if(this._verticalScrollPosition > adjustedMaxScrollPosition)\n\t\t\t{\n\t\t\t\ttargetVerticalScrollPosition = adjustedMaxScrollPosition;\n\t\t\t}\n\n\t\t\tthis._isDraggingVertically = false;\n\t\t\tif(targetVerticalScrollPosition !== targetVerticalScrollPosition) //isNaN\n\t\t\t{\n\t\t\t\tthis.completeScroll();\n\t\t\t}\n\t\t\telse if(Math.abs(targetVerticalScrollPosition - this._verticalScrollPosition) < 1)\n\t\t\t{\n\t\t\t\t//this distance is too small to animate. just finish now.\n\t\t\t\tthis.verticalScrollPosition = targetVerticalScrollPosition;\n\t\t\t\tthis.completeScroll();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.throwTo(NaN, targetVerticalScrollPosition, this._elasticSnapDuration);\n\t\t\t}\n\t\t\tthis.restoreVerticalPullViews();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function restoreVerticalPullViews():void\n\t\t{\n\t\t\tif(this._topPullView !== null &&\n\t\t\t\tthis._topPullViewRatio > 0)\n\t\t\t{\n\t\t\t\tif(this._topPullTween !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._topPullTween.dispatchEventWith(Event.REMOVE_FROM_JUGGLER);\n\t\t\t\t\tthis._topPullTween = null;\n\t\t\t\t}\n\t\t\t\tif(this._topPullViewDisplayMode === PullViewDisplayMode.DRAG)\n\t\t\t\t{\n\t\t\t\t\tvar yPosition:Number = this._topViewPortOffset + \n\t\t\t\t\t\tthis._topPullView.pivotY * this._topPullView.scaleY;\n\t\t\t\t\tif(!this._isTopPullViewActive)\n\t\t\t\t\t{\n\t\t\t\t\t\tyPosition -= this._topPullView.height;\n\t\t\t\t\t}\n\t\t\t\t\tif(this._topPullView.y != yPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._topPullTween = new Tween(this._topPullView, this._elasticSnapDuration, this._throwEase);\n\t\t\t\t\t\tthis._topPullTween.animate(\"y\", yPosition);\n\t\t\t\t\t\tthis._topPullTween.onUpdate = this.refreshTopPullViewMask;\n\t\t\t\t\t\tthis._topPullTween.onComplete = this.topPullTween_onComplete;\n\t\t\t\t\t\tStarling.juggler.add(this._topPullTween);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.topPullTween_onComplete();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._bottomPullView !== null &&\n\t\t\t\tthis._bottomPullViewRatio > 0)\n\t\t\t{\n\t\t\t\tif(this._bottomPullTween !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._bottomPullTween.dispatchEventWith(Event.REMOVE_FROM_JUGGLER);\n\t\t\t\t\tthis._bottomPullTween = null;\n\t\t\t\t}\n\t\t\t\tif(this._bottomPullViewDisplayMode === PullViewDisplayMode.DRAG)\n\t\t\t\t{\n\t\t\t\t\tyPosition = this.actualHeight - this._bottomViewPortOffset +\n\t\t\t\t\t\tthis._bottomPullView.pivotY * this._bottomPullView.scaleY;\n\t\t\t\t\tif(this._isBottomPullViewActive)\n\t\t\t\t\t{\n\t\t\t\t\t\tyPosition -= this._bottomPullView.height;\n\t\t\t\t\t}\n\t\t\t\t\tif(this._bottomPullView.y != yPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._bottomPullTween = new Tween(this._bottomPullView, this._elasticSnapDuration, this._throwEase);\n\t\t\t\t\t\tthis._bottomPullTween.animate(\"y\", yPosition);\n\t\t\t\t\t\tthis._bottomPullTween.onUpdate = this.refreshBottomPullViewMask;\n\t\t\t\t\t\tthis._bottomPullTween.onComplete = this.bottomPullTween_onComplete;\n\t\t\t\t\t\tStarling.juggler.add(this._bottomPullTween);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.bottomPullTween_onComplete();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function restoreHorizontalPullViews():void\n\t\t{\n\t\t\tif(this._leftPullView !== null &&\n\t\t\t\tthis._leftPullViewRatio > 0)\n\t\t\t{\n\t\t\t\tif(this._leftPullTween !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._leftPullTween.dispatchEventWith(Event.REMOVE_FROM_JUGGLER);\n\t\t\t\t\tthis._leftPullTween = null;\n\t\t\t\t}\n\t\t\t\tif(this._leftPullViewDisplayMode === PullViewDisplayMode.DRAG)\n\t\t\t\t{\n\t\t\t\t\tvar xPosition:Number = this._leftViewPortOffset +\n\t\t\t\t\t\tthis._leftPullView.pivotX * this._leftPullView.scaleX;\n\t\t\t\t\tif(!this._isLeftPullViewActive)\n\t\t\t\t\t{\n\t\t\t\t\t\txPosition -= this._leftPullView.width;\n\t\t\t\t\t}\n\t\t\t\t\tif(this._leftPullView.x != xPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._leftPullTween = new Tween(this._leftPullView, this._elasticSnapDuration, this._throwEase);\n\t\t\t\t\t\tthis._leftPullTween.animate(\"x\", xPosition);\n\t\t\t\t\t\tthis._leftPullTween.onUpdate = this.refreshLeftPullViewMask;\n\t\t\t\t\t\tthis._leftPullTween.onComplete = this.leftPullTween_onComplete;\n\t\t\t\t\t\tStarling.juggler.add(this._leftPullTween);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.leftPullTween_onComplete();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._rightPullView !== null &&\n\t\t\t\tthis._rightPullViewRatio > 0)\n\t\t\t{\n\t\t\t\tif(this._rightPullTween !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._rightPullTween.dispatchEventWith(Event.REMOVE_FROM_JUGGLER);\n\t\t\t\t\tthis._rightPullTween = null;\n\t\t\t\t}\n\t\t\t\tif(this._rightPullViewDisplayMode === PullViewDisplayMode.DRAG)\n\t\t\t\t{\n\t\t\t\t\txPosition = this.actualWidth - this._rightViewPortOffset +\n\t\t\t\t\t\tthis._rightPullView.pivotX * this._rightPullView.scaleX;\n\t\t\t\t\tif(this._isRightPullViewActive)\n\t\t\t\t\t{\n\t\t\t\t\t\txPosition -= this._rightPullView.width;\n\t\t\t\t\t}\n\t\t\t\t\tif(this._rightPullView.x != xPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._rightPullTween = new Tween(this._rightPullView, this._elasticSnapDuration, this._throwEase);\n\t\t\t\t\t\tthis._rightPullTween.animate(\"x\", xPosition);\n\t\t\t\t\t\tthis._rightPullTween.onUpdate = this.refreshRightPullViewMask;\n\t\t\t\t\t\tthis._rightPullTween.onComplete = this.rightPullTween_onComplete;\n\t\t\t\t\t\tStarling.juggler.add(this._rightPullTween);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.rightPullTween_onComplete();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function throwHorizontally(pixelsPerMS:Number):void\n\t\t{\n\t\t\tif(this._snapToPages && !this._snapOnComplete)\n\t\t\t{\n\t\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\t\tvar inchesPerSecond:Number = 1000 * pixelsPerMS / (DeviceCapabilities.dpi / starling.contentScaleFactor);\n\t\t\t\tif(inchesPerSecond > this._minimumPageThrowVelocity)\n\t\t\t\t{\n\t\t\t\t\tvar snappedPageHorizontalScrollPosition:Number = roundDownToNearest(this._horizontalScrollPosition, this.actualPageWidth);\n\t\t\t\t}\n\t\t\t\telse if(inchesPerSecond < -this._minimumPageThrowVelocity)\n\t\t\t\t{\n\t\t\t\t\tsnappedPageHorizontalScrollPosition = roundUpToNearest(this._horizontalScrollPosition, this.actualPageWidth);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar lastPageWidth:Number = this._maxHorizontalScrollPosition % this.actualPageWidth;\n\t\t\t\t\tvar startOfLastPage:Number = this._maxHorizontalScrollPosition - lastPageWidth;\n\t\t\t\t\tif(lastPageWidth < this.actualPageWidth && this._horizontalScrollPosition >= startOfLastPage)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar lastPagePosition:Number = this._horizontalScrollPosition - startOfLastPage;\n\t\t\t\t\t\tif(inchesPerSecond > this._minimumPageThrowVelocity)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsnappedPageHorizontalScrollPosition = startOfLastPage + roundDownToNearest(lastPagePosition, lastPageWidth);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(inchesPerSecond < -this._minimumPageThrowVelocity)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsnappedPageHorizontalScrollPosition = startOfLastPage + roundUpToNearest(lastPagePosition, lastPageWidth);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsnappedPageHorizontalScrollPosition = startOfLastPage + roundToNearest(lastPagePosition, lastPageWidth);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tsnappedPageHorizontalScrollPosition = roundToNearest(this._horizontalScrollPosition, this.actualPageWidth);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(snappedPageHorizontalScrollPosition < this._minHorizontalScrollPosition)\n\t\t\t\t{\n\t\t\t\t\tsnappedPageHorizontalScrollPosition = this._minHorizontalScrollPosition;\n\t\t\t\t}\n\t\t\t\telse if(snappedPageHorizontalScrollPosition > this._maxHorizontalScrollPosition)\n\t\t\t\t{\n\t\t\t\t\tsnappedPageHorizontalScrollPosition = this._maxHorizontalScrollPosition;\n\t\t\t\t}\n\t\t\t\tif(snappedPageHorizontalScrollPosition == this._maxHorizontalScrollPosition)\n\t\t\t\t{\n\t\t\t\t\tvar targetHorizontalPageIndex:int = this._maxHorizontalPageIndex;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//we need to use Math.round() on these values to avoid\n\t\t\t\t\t//floating-point errors that could result in the values\n\t\t\t\t\t//being rounded down too far.\n\t\t\t\t\tif(this._minHorizontalScrollPosition == Number.NEGATIVE_INFINITY)\n\t\t\t\t\t{\n\t\t\t\t\t\ttargetHorizontalPageIndex = Math.round(snappedPageHorizontalScrollPosition / this.actualPageWidth);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\ttargetHorizontalPageIndex = Math.round((snappedPageHorizontalScrollPosition - this._minHorizontalScrollPosition) / this.actualPageWidth);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.throwToPage(targetHorizontalPageIndex, -1, this._pageThrowDuration);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar absPixelsPerMS:Number = Math.abs(pixelsPerMS);\n\t\t\tif(!this._snapToPages && absPixelsPerMS <= MINIMUM_VELOCITY)\n\t\t\t{\n\t\t\t\tthis.finishScrollingHorizontally();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar duration:Number = this._fixedThrowDuration;\n\t\t\tif(!this._useFixedThrowDuration)\n\t\t\t{\n\t\t\t\tduration = this.calculateDynamicThrowDuration(pixelsPerMS);\n\t\t\t}\n\t\t\tthis.throwTo(this._horizontalScrollPosition + this.calculateThrowDistance(pixelsPerMS), NaN, duration);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function throwVertically(pixelsPerMS:Number):void\n\t\t{\n\t\t\tif(this._snapToPages && !this._snapOnComplete)\n\t\t\t{\n\t\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\t\tvar inchesPerSecond:Number = 1000 * pixelsPerMS / (DeviceCapabilities.dpi / starling.contentScaleFactor);\n\t\t\t\tif(inchesPerSecond > this._minimumPageThrowVelocity)\n\t\t\t\t{\n\t\t\t\t\tvar snappedPageVerticalScrollPosition:Number = roundDownToNearest(this._verticalScrollPosition, this.actualPageHeight);\n\t\t\t\t}\n\t\t\t\telse if(inchesPerSecond < -this._minimumPageThrowVelocity)\n\t\t\t\t{\n\t\t\t\t\tsnappedPageVerticalScrollPosition = roundUpToNearest(this._verticalScrollPosition, this.actualPageHeight);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar lastPageHeight:Number = this._maxVerticalScrollPosition % this.actualPageHeight;\n\t\t\t\t\tvar startOfLastPage:Number = this._maxVerticalScrollPosition - lastPageHeight;\n\t\t\t\t\tif(lastPageHeight < this.actualPageHeight && this._verticalScrollPosition >= startOfLastPage)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar lastPagePosition:Number = this._verticalScrollPosition - startOfLastPage;\n\t\t\t\t\t\tif(inchesPerSecond > this._minimumPageThrowVelocity)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsnappedPageVerticalScrollPosition = startOfLastPage + roundDownToNearest(lastPagePosition, lastPageHeight);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(inchesPerSecond < -this._minimumPageThrowVelocity)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsnappedPageVerticalScrollPosition = startOfLastPage + roundUpToNearest(lastPagePosition, lastPageHeight);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsnappedPageVerticalScrollPosition = startOfLastPage + roundToNearest(lastPagePosition, lastPageHeight);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tsnappedPageVerticalScrollPosition = roundToNearest(this._verticalScrollPosition, this.actualPageHeight);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(snappedPageVerticalScrollPosition < this._minVerticalScrollPosition)\n\t\t\t\t{\n\t\t\t\t\tsnappedPageVerticalScrollPosition = this._minVerticalScrollPosition;\n\t\t\t\t}\n\t\t\t\telse if(snappedPageVerticalScrollPosition > this._maxVerticalScrollPosition)\n\t\t\t\t{\n\t\t\t\t\tsnappedPageVerticalScrollPosition = this._maxVerticalScrollPosition;\n\t\t\t\t}\n\t\t\t\tif(snappedPageVerticalScrollPosition == this._maxVerticalScrollPosition)\n\t\t\t\t{\n\t\t\t\t\tvar targetVerticalPageIndex:int = this._maxVerticalPageIndex;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//we need to use Math.round() on these values to avoid\n\t\t\t\t\t//floating-point errors that could result in the values\n\t\t\t\t\t//being rounded down too far.\n\t\t\t\t\tif(this._minVerticalScrollPosition == Number.NEGATIVE_INFINITY)\n\t\t\t\t\t{\n\t\t\t\t\t\ttargetVerticalPageIndex = Math.round(snappedPageVerticalScrollPosition / this.actualPageHeight);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\ttargetVerticalPageIndex = Math.round((snappedPageVerticalScrollPosition - this._minVerticalScrollPosition) / this.actualPageHeight);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.throwToPage(-1, targetVerticalPageIndex, this._pageThrowDuration);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar absPixelsPerMS:Number = Math.abs(pixelsPerMS);\n\t\t\tif(!this._snapToPages && absPixelsPerMS <= MINIMUM_VELOCITY)\n\t\t\t{\n\t\t\t\tthis.finishScrollingVertically();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar duration:Number = this._fixedThrowDuration;\n\t\t\tif(!this._useFixedThrowDuration)\n\t\t\t{\n\t\t\t\tduration = this.calculateDynamicThrowDuration(pixelsPerMS);\n\t\t\t}\n\t\t\tthis.throwTo(NaN, this._verticalScrollPosition + this.calculateThrowDistance(pixelsPerMS), duration);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function horizontalAutoScrollTween_onUpdateWithEndRatio():void\n\t\t{\n\t\t\tvar ratio:Number = this._horizontalAutoScrollTween.transitionFunc(this._horizontalAutoScrollTween.currentTime / this._horizontalAutoScrollTween.totalTime);\n\t\t\tif(ratio >= this._horizontalAutoScrollTweenEndRatio &&\n\t\t\t\tthis._horizontalAutoScrollTween.currentTime < this._horizontalAutoScrollTween.totalTime)\n\t\t\t{\n\t\t\t\t//check that the currentTime is less than totalTime because if\n\t\t\t\t//the tween is complete, we don't want it set to null before\n\t\t\t\t//the onComplete callback\n\t\t\t\tif(!this._hasElasticEdges)\n\t\t\t\t{\n\t\t\t\t\tif(this._horizontalScrollPosition < this._minHorizontalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._horizontalScrollPosition = this._minHorizontalScrollPosition;\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._horizontalScrollPosition > this._maxHorizontalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._horizontalScrollPosition = this._maxHorizontalScrollPosition;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tStarling.juggler.remove(this._horizontalAutoScrollTween);\n\t\t\t\tthis._horizontalAutoScrollTween = null;\n\t\t\t\tthis.finishScrollingHorizontally();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._snapScrollPositionsToPixels)\n\t\t\t{\n\t\t\t\tthis.horizontalAutoScrollTween_onUpdate();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function verticalAutoScrollTween_onUpdateWithEndRatio():void\n\t\t{\n\t\t\tvar ratio:Number = this._verticalAutoScrollTween.transitionFunc(this._verticalAutoScrollTween.currentTime / this._verticalAutoScrollTween.totalTime);\n\t\t\tif(ratio >= this._verticalAutoScrollTweenEndRatio &&\n\t\t\t\tthis._verticalAutoScrollTween.currentTime < this._verticalAutoScrollTween.totalTime)\n\t\t\t{\n\t\t\t\t//check that the currentTime is less than totalTime because if\n\t\t\t\t//the tween is complete, we don't want it set to null before\n\t\t\t\t//the onComplete callback\n\t\t\t\tif(!this._hasElasticEdges)\n\t\t\t\t{\n\t\t\t\t\tif(this._verticalScrollPosition < this._minVerticalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._verticalScrollPosition = this._minVerticalScrollPosition;\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._verticalScrollPosition > this._maxVerticalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._verticalScrollPosition = this._maxVerticalScrollPosition;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tStarling.juggler.remove(this._verticalAutoScrollTween);\n\t\t\t\tthis._verticalAutoScrollTween = null;\n\t\t\t\tthis.finishScrollingVertically();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._snapScrollPositionsToPixels)\n\t\t\t{\n\t\t\t\tthis.verticalAutoScrollTween_onUpdate();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshHorizontalAutoScrollTweenEndRatio():void\n\t\t{\n\t\t\tvar adjustedMinVerticalScrollPosition:Number = this._minHorizontalScrollPosition;\n\t\t\tif(this._isLeftPullViewActive && this._hasElasticEdges)\n\t\t\t{\n\t\t\t\tadjustedMinVerticalScrollPosition -= this._leftPullView.width;\n\t\t\t}\n\t\t\tvar adjustedMaxScrollPosition:Number = this._maxHorizontalScrollPosition;\n\t\t\tif(this._isRightPullViewActive && this._hasElasticEdges)\n\t\t\t{\n\t\t\t\tadjustedMaxScrollPosition += this._rightPullView.width;\n\t\t\t}\n\t\t\tvar distance:Number = Math.abs(this._targetHorizontalScrollPosition - this._startHorizontalScrollPosition);\n\t\t\tvar ratioOutOfBounds:Number = 0;\n\t\t\tif(this._targetHorizontalScrollPosition > adjustedMaxScrollPosition)\n\t\t\t{\n\t\t\t\tratioOutOfBounds = (this._targetHorizontalScrollPosition - adjustedMaxScrollPosition) / distance;\n\t\t\t}\n\t\t\telse if(this._targetHorizontalScrollPosition < adjustedMinVerticalScrollPosition)\n\t\t\t{\n\t\t\t\tratioOutOfBounds = (adjustedMinVerticalScrollPosition - this._targetHorizontalScrollPosition) / distance;\n\t\t\t}\n\t\t\tif(ratioOutOfBounds > 0)\n\t\t\t{\n\t\t\t\tif(this._hasElasticEdges)\n\t\t\t\t{\n\t\t\t\t\tthis._horizontalAutoScrollTweenEndRatio = (1 - ratioOutOfBounds) + (ratioOutOfBounds * this._throwElasticity);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._horizontalAutoScrollTweenEndRatio = 1 - ratioOutOfBounds;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._horizontalAutoScrollTweenEndRatio = 1;\n\t\t\t}\n\t\t\tif(this._horizontalAutoScrollTween)\n\t\t\t{\n\t\t\t\tif(this._horizontalAutoScrollTweenEndRatio < 1)\n\t\t\t\t{\n\t\t\t\t\tthis._horizontalAutoScrollTween.onUpdate = this.horizontalAutoScrollTween_onUpdateWithEndRatio;\n\t\t\t\t}\n\t\t\t\telse if(this._snapScrollPositionsToPixels)\n\t\t\t\t{\n\t\t\t\t\tthis._horizontalAutoScrollTween.onUpdate = this.horizontalAutoScrollTween_onUpdate;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshVerticalAutoScrollTweenEndRatio():void\n\t\t{\n\t\t\tvar adjustedMinVerticalScrollPosition:Number = this._minVerticalScrollPosition;\n\t\t\tif(this._isTopPullViewActive && this._hasElasticEdges)\n\t\t\t{\n\t\t\t\tadjustedMinVerticalScrollPosition -= this._topPullView.height;\n\t\t\t}\n\t\t\tvar adjustedMaxScrollPosition:Number = this._maxVerticalScrollPosition;\n\t\t\tif(this._isBottomPullViewActive && this._hasElasticEdges)\n\t\t\t{\n\t\t\t\tadjustedMaxScrollPosition += this._bottomPullView.height;\n\t\t\t}\n\t\t\tvar distance:Number = Math.abs(this._targetVerticalScrollPosition - this._startVerticalScrollPosition);\n\t\t\tvar ratioOutOfBounds:Number = 0;\n\t\t\tif(this._targetVerticalScrollPosition > adjustedMaxScrollPosition)\n\t\t\t{\n\t\t\t\tratioOutOfBounds = (this._targetVerticalScrollPosition - adjustedMaxScrollPosition) / distance;\n\t\t\t}\n\t\t\telse if(this._targetVerticalScrollPosition < adjustedMinVerticalScrollPosition)\n\t\t\t{\n\t\t\t\tratioOutOfBounds = (adjustedMinVerticalScrollPosition - this._targetVerticalScrollPosition) / distance;\n\t\t\t}\n\t\t\tif(ratioOutOfBounds > 0)\n\t\t\t{\n\t\t\t\tif(this._hasElasticEdges)\n\t\t\t\t{\n\t\t\t\t\tthis._verticalAutoScrollTweenEndRatio = (1 - ratioOutOfBounds) + (ratioOutOfBounds * this._throwElasticity);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._verticalAutoScrollTweenEndRatio = 1 - ratioOutOfBounds;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._verticalAutoScrollTweenEndRatio = 1;\n\t\t\t}\n\t\t\tif(this._verticalAutoScrollTween)\n\t\t\t{\n\t\t\t\tif(this._verticalAutoScrollTweenEndRatio < 1)\n\t\t\t\t{\n\t\t\t\t\tthis._verticalAutoScrollTween.onUpdate = this.verticalAutoScrollTween_onUpdateWithEndRatio;\n\t\t\t\t}\n\t\t\t\telse if(this._snapScrollPositionsToPixels)\n\t\t\t\t{\n\t\t\t\t\tthis._verticalAutoScrollTween.onUpdate = this.verticalAutoScrollTween_onUpdate;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function hideHorizontalScrollBar(delay:Number = 0):void\n\t\t{\n\t\t\tif(!this.horizontalScrollBar || this._scrollBarDisplayMode != ScrollBarDisplayMode.FLOAT || this._horizontalScrollBarHideTween)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this.horizontalScrollBar.alpha == 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._hideScrollBarAnimationDuration == 0 && delay == 0)\n\t\t\t{\n\t\t\t\tthis.horizontalScrollBar.alpha = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._horizontalScrollBarHideTween = new Tween(this.horizontalScrollBar, this._hideScrollBarAnimationDuration, this._hideScrollBarAnimationEase);\n\t\t\t\tthis._horizontalScrollBarHideTween.fadeTo(0);\n\t\t\t\tthis._horizontalScrollBarHideTween.delay = delay;\n\t\t\t\tthis._horizontalScrollBarHideTween.onComplete = horizontalScrollBarHideTween_onComplete;\n\t\t\t\tStarling.juggler.add(this._horizontalScrollBarHideTween);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function hideVerticalScrollBar(delay:Number = 0):void\n\t\t{\n\t\t\tif(!this.verticalScrollBar || this._scrollBarDisplayMode != ScrollBarDisplayMode.FLOAT || this._verticalScrollBarHideTween)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this.verticalScrollBar.alpha == 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._hideScrollBarAnimationDuration == 0 && delay == 0)\n\t\t\t{\n\t\t\t\tthis.verticalScrollBar.alpha = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._verticalScrollBarHideTween = new Tween(this.verticalScrollBar, this._hideScrollBarAnimationDuration, this._hideScrollBarAnimationEase);\n\t\t\t\tthis._verticalScrollBarHideTween.fadeTo(0);\n\t\t\t\tthis._verticalScrollBarHideTween.delay = delay;\n\t\t\t\tthis._verticalScrollBarHideTween.onComplete = verticalScrollBarHideTween_onComplete;\n\t\t\t\tStarling.juggler.add(this._verticalScrollBarHideTween);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function revealHorizontalScrollBar():void\n\t\t{\n\t\t\tif(!this.horizontalScrollBar || this._scrollBarDisplayMode != ScrollBarDisplayMode.FLOAT)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._horizontalScrollBarHideTween)\n\t\t\t{\n\t\t\t\tStarling.juggler.remove(this._horizontalScrollBarHideTween);\n\t\t\t\tthis._horizontalScrollBarHideTween = null;\n\t\t\t}\n\t\t\tthis.horizontalScrollBar.alpha = 1;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function revealVerticalScrollBar():void\n\t\t{\n\t\t\tif(!this.verticalScrollBar || this._scrollBarDisplayMode != ScrollBarDisplayMode.FLOAT)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._verticalScrollBarHideTween)\n\t\t\t{\n\t\t\t\tStarling.juggler.remove(this._verticalScrollBarHideTween);\n\t\t\t\tthis._verticalScrollBarHideTween = null;\n\t\t\t}\n\t\t\tthis.verticalScrollBar.alpha = 1;\n\t\t}\n\n\t\t/**\n\t\t * If scrolling hasn't already started, prepares the scroller to scroll\n\t\t * and dispatches <code>FeathersEventType.SCROLL_START</code>.\n\t\t */\n\t\tprotected function startScroll():void\n\t\t{\n\t\t\tif(this._isScrolling)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isScrolling = true;\n\t\t\tthis.dispatchEventWith(FeathersEventType.SCROLL_START);\n\t\t}\n\n\t\t/**\n\t\t * Prepares the scroller for normal interaction and dispatches\n\t\t * <code>FeathersEventType.SCROLL_COMPLETE</code>.\n\t\t */\n\t\tprotected function completeScroll():void\n\t\t{\n\t\t\tif(!this._isScrolling || this._verticalAutoScrollTween || this._horizontalAutoScrollTween ||\n\t\t\t\tthis._isDraggingHorizontally || this._isDraggingVertically ||\n\t\t\t\tthis._horizontalScrollBarIsScrolling || this._verticalScrollBarIsScrolling)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isScrolling = false;\n\t\t\tthis.hideHorizontalScrollBar();\n\t\t\tthis.hideVerticalScrollBar();\n\t\t\t//we validate to ensure that the final Event.SCROLL\n\t\t\t//dispatched before FeathersEventType.SCROLL_COMPLETE\n\t\t\tthis.validate();\n\t\t\tthis.dispatchEventWith(FeathersEventType.SCROLL_COMPLETE);\n\t\t}\n\n\t\t/**\n\t\t * Scrolls to a pending scroll position, if required.\n\t\t */\n\t\tprotected function handlePendingScroll():void\n\t\t{\n\t\t\tif(this.pendingHorizontalScrollPosition === this.pendingHorizontalScrollPosition ||\n\t\t\t\tthis.pendingVerticalScrollPosition === this.pendingVerticalScrollPosition) //!isNaN\n\t\t\t{\n\t\t\t\tthis.throwTo(this.pendingHorizontalScrollPosition, this.pendingVerticalScrollPosition, this.pendingScrollDuration);\n\t\t\t\tthis.pendingHorizontalScrollPosition = NaN;\n\t\t\t\tthis.pendingVerticalScrollPosition = NaN;\n\t\t\t}\n\t\t\tif(this.hasPendingHorizontalPageIndex && this.hasPendingVerticalPageIndex)\n\t\t\t{\n\t\t\t\t//both\n\t\t\t\tthis.throwToPage(this.pendingHorizontalPageIndex, this.pendingVerticalPageIndex, this.pendingScrollDuration);\n\t\t\t}\n\t\t\telse if(this.hasPendingHorizontalPageIndex)\n\t\t\t{\n\t\t\t\t//horizontal only\n\t\t\t\tthis.throwToPage(this.pendingHorizontalPageIndex, this._verticalPageIndex, this.pendingScrollDuration);\n\t\t\t}\n\t\t\telse if(this.hasPendingVerticalPageIndex)\n\t\t\t{\n\t\t\t\t//vertical only\n\t\t\t\tthis.throwToPage(this._horizontalPageIndex, this.pendingVerticalPageIndex, this.pendingScrollDuration);\n\t\t\t}\n\t\t\tthis.hasPendingHorizontalPageIndex = false;\n\t\t\tthis.hasPendingVerticalPageIndex = false;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function handlePendingRevealScrollBars():void\n\t\t{\n\t\t\tif(!this.isScrollBarRevealPending)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.isScrollBarRevealPending = false;\n\t\t\tif(this._scrollBarDisplayMode != ScrollBarDisplayMode.FLOAT)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.revealHorizontalScrollBar();\n\t\t\tthis.revealVerticalScrollBar();\n\t\t\tthis.hideHorizontalScrollBar(this._revealScrollBarsDuration);\n\t\t\tthis.hideVerticalScrollBar(this._revealScrollBarsDuration);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function handlePendingPullView():void\n\t\t{\n\t\t\tif(this._isTopPullViewPending)\n\t\t\t{\n\t\t\t\tthis._isTopPullViewPending = false;\n\t\t\t\tif(this._isTopPullViewActive)\n\t\t\t\t{\n\t\t\t\t\tif(this._topPullTween !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._topPullTween.dispatchEventWith(Event.REMOVE_FROM_JUGGLER);\n\t\t\t\t\t\tthis._topPullTween = null;\n\t\t\t\t\t}\n\t\t\t\t\tif(this._topPullView is IValidating)\n\t\t\t\t\t{\n\t\t\t\t\t\tIValidating(this._topPullView).validate();\n\t\t\t\t\t}\n\t\t\t\t\tthis._topPullView.visible = true;\n\t\t\t\t\tthis._topPullViewRatio = 1;\n\t\t\t\t\tif(this._topPullViewDisplayMode === PullViewDisplayMode.DRAG)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar targetY:Number = this._topViewPortOffset +\n\t\t\t\t\t\t\tthis._topPullView.pivotY * this._topPullView.scaleY;\n\t\t\t\t\t\tif(this.isCreated)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._topPullView.y = targetY - this._topPullView.height;\n\t\t\t\t\t\t\tthis._topPullTween = new Tween(this._topPullView, this._elasticSnapDuration, this._throwEase);\n\t\t\t\t\t\t\tthis._topPullTween.animate(\"y\", targetY);\n\t\t\t\t\t\t\tthis._topPullTween.onUpdate = this.refreshTopPullViewMask;\n\t\t\t\t\t\t\tthis._topPullTween.onComplete = this.topPullTween_onComplete;\n\t\t\t\t\t\t\tStarling.juggler.add(this._topPullTween);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if this is the first time the component validates,\n\t\t\t\t\t\t\t//we don't need animation\n\t\t\t\t\t\t\tthis._topPullView.y = targetY;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(this._isScrolling)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.restoreVerticalPullViews();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.finishScrollingVertically();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._isRightPullViewPending)\n\t\t\t{\n\t\t\t\tthis._isRightPullViewPending = false;\n\t\t\t\tif(this._isRightPullViewActive)\n\t\t\t\t{\n\t\t\t\t\tif(this._rightPullTween !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._rightPullTween.dispatchEventWith(Event.REMOVE_FROM_JUGGLER);\n\t\t\t\t\t\tthis._rightPullTween = null;\n\t\t\t\t\t}\n\t\t\t\t\tif(this._rightPullView is IValidating)\n\t\t\t\t\t{\n\t\t\t\t\t\tIValidating(this._rightPullView).validate();\n\t\t\t\t\t}\n\t\t\t\t\tthis._rightPullView.visible = true;\n\t\t\t\t\tthis._rightPullViewRatio = 1;\n\t\t\t\t\tif(this._rightPullViewDisplayMode === PullViewDisplayMode.DRAG)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar targetX:Number = this.actualWidth - this._rightViewPortOffset +\n\t\t\t\t\t\t\tthis._rightPullView.pivotX * this._rightPullView.scaleX -\n\t\t\t\t\t\t\tthis._rightPullView.width;\n\t\t\t\t\t\tif(this.isCreated)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._rightPullView.x = targetX + this._rightPullView.width;\n\t\t\t\t\t\t\tthis._rightPullTween = new Tween(this._rightPullView, this._elasticSnapDuration, this._throwEase);\n\t\t\t\t\t\t\tthis._rightPullTween.animate(\"x\", targetX);\n\t\t\t\t\t\t\tthis._rightPullTween.onUpdate = this.refreshRightPullViewMask;\n\t\t\t\t\t\t\tthis._rightPullTween.onComplete = this.rightPullTween_onComplete;\n\t\t\t\t\t\t\tStarling.juggler.add(this._rightPullTween);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if this is the first time the component validates,\n\t\t\t\t\t\t\t//we don't need animation\n\t\t\t\t\t\t\tthis._rightPullView.x = targetX;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(this._isScrolling)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.restoreHorizontalPullViews();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.finishScrollingHorizontally();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._isBottomPullViewPending)\n\t\t\t{\n\t\t\t\tthis._isBottomPullViewPending = false;\n\t\t\t\tif(this._isBottomPullViewActive)\n\t\t\t\t{\n\t\t\t\t\tif(this._bottomPullTween !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._bottomPullTween.dispatchEventWith(Event.REMOVE_FROM_JUGGLER);\n\t\t\t\t\t\tthis._bottomPullTween = null;\n\t\t\t\t\t}\n\t\t\t\t\tif(this._bottomPullView is IValidating)\n\t\t\t\t\t{\n\t\t\t\t\t\tIValidating(this._bottomPullView).validate();\n\t\t\t\t\t}\n\t\t\t\t\tthis._bottomPullView.visible = true;\n\t\t\t\t\tthis._bottomPullViewRatio = 1;\n\t\t\t\t\tif(this._bottomPullViewDisplayMode === PullViewDisplayMode.DRAG)\n\t\t\t\t\t{\n\t\t\t\t\t\ttargetY = this.actualHeight - this._bottomViewPortOffset +\n\t\t\t\t\t\t\tthis._bottomPullView.pivotY * this._bottomPullView.scaleY -\n\t\t\t\t\t\t\tthis._bottomPullView.height;\n\t\t\t\t\t\tif(this.isCreated)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._bottomPullView.y = targetY + this._bottomPullView.height;\n\t\t\t\t\t\t\tthis._bottomPullTween = new Tween(this._bottomPullView, this._elasticSnapDuration, this._throwEase);\n\t\t\t\t\t\t\tthis._bottomPullTween.animate(\"y\", targetY);\n\t\t\t\t\t\t\tthis._bottomPullTween.onUpdate = this.refreshBottomPullViewMask;\n\t\t\t\t\t\t\tthis._bottomPullTween.onComplete = this.bottomPullTween_onComplete;\n\t\t\t\t\t\t\tStarling.juggler.add(this._bottomPullTween);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._bottomPullView.y = targetY;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(this._isScrolling)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.restoreVerticalPullViews();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.finishScrollingVertically();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._isLeftPullViewPending)\n\t\t\t{\n\t\t\t\tthis._isLeftPullViewPending = false;\n\t\t\t\tif(this._isLeftPullViewActive)\n\t\t\t\t{\n\t\t\t\t\tif(this._leftPullTween !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._leftPullTween.dispatchEventWith(Event.REMOVE_FROM_JUGGLER);\n\t\t\t\t\t\tthis._leftPullTween = null;\n\t\t\t\t\t}\n\t\t\t\t\tif(this._leftPullView is IValidating)\n\t\t\t\t\t{\n\t\t\t\t\t\tIValidating(this._leftPullView).validate();\n\t\t\t\t\t}\n\t\t\t\t\tthis._leftPullView.visible = true;\n\t\t\t\t\tthis._leftPullViewRatio = 1;\n\t\t\t\t\tif(this._leftPullViewDisplayMode === PullViewDisplayMode.DRAG)\n\t\t\t\t\t{\n\t\t\t\t\t\ttargetX = this._leftViewPortOffset +\n\t\t\t\t\t\t\tthis._leftPullView.pivotX * this._leftPullView.scaleX;\n\t\t\t\t\t\tif(this.isCreated)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._leftPullView.x = targetX - this._leftPullView.width;\n\t\t\t\t\t\t\tthis._leftPullTween = new Tween(this._leftPullView, this._elasticSnapDuration, this._throwEase);\n\t\t\t\t\t\t\tthis._leftPullTween.animate(\"x\", targetX);\n\t\t\t\t\t\t\tthis._leftPullTween.onUpdate = this.refreshLeftPullViewMask;\n\t\t\t\t\t\t\tthis._leftPullTween.onComplete = this.leftPullTween_onComplete;\n\t\t\t\t\t\t\tStarling.juggler.add(this._leftPullTween);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if this is the first time the component validates,\n\t\t\t\t\t\t\t//we don't need animation\n\t\t\t\t\t\t\tthis._leftPullView.x = targetX;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(this._isScrolling)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.restoreHorizontalPullViews();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.finishScrollingHorizontally();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function checkForDrag():void\n\t\t{\n\t\t\tif(this._isScrollingStopped)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar horizontalInchesMoved:Number = (this._currentTouchX - this._startTouchX) / (DeviceCapabilities.dpi / starling.contentScaleFactor);\n\t\t\tvar verticalInchesMoved:Number = (this._currentTouchY - this._startTouchY) / (DeviceCapabilities.dpi / starling.contentScaleFactor);\n\t\t\tif(!this._isDraggingHorizontally &&\n\t\t\t\t(\n\t\t\t\t\tthis._horizontalScrollPolicy === ScrollPolicy.ON ||\n\t\t\t\t\t(this._horizontalScrollPolicy === ScrollPolicy.AUTO && this._minHorizontalScrollPosition != this._maxHorizontalScrollPosition) ||\n\t\t\t\t\t(this._leftPullView !== null && (this._currentTouchX > this._startTouchX || this._horizontalScrollPosition < this._minHorizontalScrollPosition)) ||\n\t\t\t\t\t(this._rightPullView !== null && (this._currentTouchX < this._startTouchX || this._horizontalScrollPosition > this._minHorizontalScrollPosition))\n\t\t\t\t) &&\n\t\t\t\t(\n\t\t\t\t\t((horizontalInchesMoved <= -this._minimumDragDistance) && (this._hasElasticEdges || this._horizontalScrollPosition < this._maxHorizontalScrollPosition || this._rightPullView !== null)) ||\n\t\t\t\t\t((horizontalInchesMoved >= this._minimumDragDistance) && (this._hasElasticEdges || this._horizontalScrollPosition > this._minHorizontalScrollPosition || this._leftPullView !== null))\n\t\t\t\t))\n\t\t\t{\n\t\t\t\tif(this.horizontalScrollBar)\n\t\t\t\t{\n\t\t\t\t\tthis.revealHorizontalScrollBar();\n\t\t\t\t}\n\t\t\t\tthis._startTouchX = this._currentTouchX;\n\t\t\t\tthis._startHorizontalScrollPosition = this._horizontalScrollPosition;\n\t\t\t\tthis._isDraggingHorizontally = true;\n\t\t\t\t//if we haven't already started dragging in the other direction,\n\t\t\t\t//we need to dispatch the event that says we're starting.\n\t\t\t\tif(!this._isDraggingVertically)\n\t\t\t\t{\n\t\t\t\t\tthis.dispatchEventWith(FeathersEventType.BEGIN_INTERACTION);\n\t\t\t\t\tvar exclusiveTouch:ExclusiveTouch = ExclusiveTouch.forStage(this.stage);\n\t\t\t\t\texclusiveTouch.removeEventListener(Event.CHANGE, exclusiveTouch_changeHandler);\n\t\t\t\t\texclusiveTouch.claimTouch(this._touchPointID, this);\n\t\t\t\t\tthis.startScroll();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!this._isDraggingVertically &&\n\t\t\t\t(\n\t\t\t\t\tthis._verticalScrollPolicy == ScrollPolicy.ON ||\n\t\t\t\t\t(this._verticalScrollPolicy == ScrollPolicy.AUTO && this._minVerticalScrollPosition != this._maxVerticalScrollPosition) ||\n\t\t\t\t\t(this._topPullView !== null && (this._currentTouchY > this._startTouchY || this._verticalScrollPosition < this._minVerticalScrollPosition)) ||\n\t\t\t\t\t(this._bottomPullView !== null && (this._currentTouchY < this._startTouchY || this._verticalScrollPosition > this._minVerticalScrollPosition))\n\t\t\t\t) &&\n\t\t\t\t(\n\t\t\t\t\t((verticalInchesMoved <= -this._minimumDragDistance) && (this._hasElasticEdges || this._verticalScrollPosition < this._maxVerticalScrollPosition || this._bottomPullView !== null)) ||\n\t\t\t\t\t((verticalInchesMoved >= this._minimumDragDistance) && (this._hasElasticEdges || this._verticalScrollPosition > this._minVerticalScrollPosition || this._topPullView !== null))\n\t\t\t\t))\n\t\t\t{\n\t\t\t\tif(this.verticalScrollBar)\n\t\t\t\t{\n\t\t\t\t\tthis.revealVerticalScrollBar();\n\t\t\t\t}\n\t\t\t\tthis._startTouchY = this._currentTouchY;\n\t\t\t\tthis._startVerticalScrollPosition = this._verticalScrollPosition;\n\t\t\t\tthis._isDraggingVertically = true;\n\t\t\t\tif(!this._isDraggingHorizontally)\n\t\t\t\t{\n\t\t\t\t\texclusiveTouch = ExclusiveTouch.forStage(this.stage);\n\t\t\t\t\texclusiveTouch.removeEventListener(Event.CHANGE, exclusiveTouch_changeHandler);\n\t\t\t\t\texclusiveTouch.claimTouch(this._touchPointID, this);\n\t\t\t\t\tthis.dispatchEventWith(FeathersEventType.BEGIN_INTERACTION);\n\t\t\t\t\tthis.startScroll();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._isDraggingHorizontally && !this._horizontalAutoScrollTween)\n\t\t\t{\n\t\t\t\tthis.updateHorizontalScrollFromTouchPosition(this._currentTouchX);\n\t\t\t}\n\t\t\tif(this._isDraggingVertically && !this._verticalAutoScrollTween)\n\t\t\t{\n\t\t\t\tthis.updateVerticalScrollFromTouchPosition(this._currentTouchY);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function saveVelocity():void\n\t\t{\n\t\t\tthis._pendingVelocityChange = false;\n\t\t\tif(this._isScrollingStopped)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar now:int = getTimer();\n\t\t\tvar timeOffset:int = now - this._previousTouchTime;\n\t\t\tif(timeOffset > 0)\n\t\t\t{\n\t\t\t\t//we're keeping previous velocity updates to improve accuracy\n\t\t\t\tthis._previousVelocityX[this._previousVelocityX.length] = this._velocityX;\n\t\t\t\tif(this._previousVelocityX.length > MAXIMUM_SAVED_VELOCITY_COUNT)\n\t\t\t\t{\n\t\t\t\t\tthis._previousVelocityX.shift();\n\t\t\t\t}\n\t\t\t\tthis._previousVelocityY[this._previousVelocityY.length] = this._velocityY;\n\t\t\t\tif(this._previousVelocityY.length > MAXIMUM_SAVED_VELOCITY_COUNT)\n\t\t\t\t{\n\t\t\t\t\tthis._previousVelocityY.shift();\n\t\t\t\t}\n\t\t\t\tthis._velocityX = (this._currentTouchX - this._previousTouchX) / timeOffset;\n\t\t\t\tthis._velocityY = (this._currentTouchY - this._previousTouchY) / timeOffset;\n\t\t\t\tthis._previousTouchTime = now;\n\t\t\t\tthis._previousTouchX = this._currentTouchX;\n\t\t\t\tthis._previousTouchY = this._currentTouchY;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function viewPort_resizeHandler(event:Event):void\n\t\t{\n\t\t\tif(this.ignoreViewPortResizing ||\n\t\t\t\t(this._viewPort.width == this._lastViewPortWidth && this._viewPort.height == this._lastViewPortHeight))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._lastViewPortWidth = this._viewPort.width;\n\t\t\tthis._lastViewPortHeight = this._viewPort.height;\n\t\t\tif(this._isValidating)\n\t\t\t{\n\t\t\t\tthis._hasViewPortBoundsChanged = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function childProperties_onChange(proxy:PropertyProxy, name:String):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function verticalScrollBar_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.verticalScrollPosition = this.verticalScrollBar.value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function horizontalScrollBar_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.horizontalScrollPosition = this.horizontalScrollBar.value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function horizontalScrollBar_beginInteractionHandler(event:Event):void\n\t\t{\n\t\t\tif(this._horizontalAutoScrollTween)\n\t\t\t{\n\t\t\t\tStarling.juggler.remove(this._horizontalAutoScrollTween);\n\t\t\t\tthis._horizontalAutoScrollTween = null;\n\t\t\t}\n\t\t\tthis._isDraggingHorizontally = false;\n\t\t\tthis._horizontalScrollBarIsScrolling = true;\n\t\t\tthis.dispatchEventWith(FeathersEventType.BEGIN_INTERACTION);\n\t\t\tif(!this._isScrolling)\n\t\t\t{\n\t\t\t\tthis.startScroll();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function horizontalScrollBar_endInteractionHandler(event:Event):void\n\t\t{\n\t\t\tthis._horizontalScrollBarIsScrolling = false;\n\t\t\tthis.dispatchEventWith(FeathersEventType.END_INTERACTION);\n\t\t\tthis.completeScroll();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function verticalScrollBar_beginInteractionHandler(event:Event):void\n\t\t{\n\t\t\tif(this._verticalAutoScrollTween)\n\t\t\t{\n\t\t\t\tStarling.juggler.remove(this._verticalAutoScrollTween);\n\t\t\t\tthis._verticalAutoScrollTween = null;\n\t\t\t}\n\t\t\tthis._isDraggingVertically = false;\n\t\t\tthis._verticalScrollBarIsScrolling = true;\n\t\t\tthis.dispatchEventWith(FeathersEventType.BEGIN_INTERACTION);\n\t\t\tif(!this._isScrolling)\n\t\t\t{\n\t\t\t\tthis.startScroll();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function verticalScrollBar_endInteractionHandler(event:Event):void\n\t\t{\n\t\t\tthis._verticalScrollBarIsScrolling = false;\n\t\t\tthis.dispatchEventWith(FeathersEventType.END_INTERACTION);\n\t\t\tthis.completeScroll();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function horizontalAutoScrollTween_onUpdate():void\n\t\t{\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar pixelSize:Number = 1 / starling.contentScaleFactor;\n\t\t\tvar viewPortX:Number = Math.round((this._leftViewPortOffset - this._horizontalScrollPosition) / pixelSize) * pixelSize;\n\t\t\tvar targetViewPortX:Number = Math.round((this._leftViewPortOffset - this._targetHorizontalScrollPosition) / pixelSize) * pixelSize;\n\t\t\tif(viewPortX == targetViewPortX)\n\t\t\t{\n\t\t\t\t//we've reached the snapped position, but the tween may not\n\t\t\t\t//have ended yet. since the user won't see any further changes,\n\t\t\t\t//force the tween to the end.\n\t\t\t\tthis._horizontalAutoScrollTween.advanceTime(this._horizontalAutoScrollTween.totalTime);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function horizontalAutoScrollTween_onComplete():void\n\t\t{\n\t\t\t//because the onUpdate callback may call advanceTime(), remove\n\t\t\t//the callbacks to be sure that they aren't called too many times.\n\t\t\tif(this._horizontalAutoScrollTween !== null)\n\t\t\t{\n\t\t\t\tthis._horizontalAutoScrollTween.onUpdate = null;\n\t\t\t\tthis._horizontalAutoScrollTween.onComplete = null;\n\t\t\t\tthis._horizontalAutoScrollTween = null;\n\t\t\t}\n\t\t\t//the page index will not have updated during the animation, so we\n\t\t\t//need to ensure that it is updated now.\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t\tthis.finishScrollingHorizontally();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function verticalAutoScrollTween_onUpdate():void\n\t\t{\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar pixelSize:Number = 1 / starling.contentScaleFactor;\n\t\t\tvar viewPortY:Number = Math.round((this._topViewPortOffset - this._verticalScrollPosition) / pixelSize) * pixelSize;\n\t\t\tvar targetViewPortY:Number = Math.round((this._topViewPortOffset - this._targetVerticalScrollPosition) / pixelSize) * pixelSize;\n\t\t\tif(viewPortY == targetViewPortY)\n\t\t\t{\n\t\t\t\t//we've reached the snapped position, but the tween may not\n\t\t\t\t//have ended yet. since the user won't see any further changes,\n\t\t\t\t//force the tween to the end.\n\t\t\t\tthis._verticalAutoScrollTween.advanceTime(this._verticalAutoScrollTween.totalTime);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function verticalAutoScrollTween_onComplete():void\n\t\t{\n\t\t\t//because the onUpdate callback may call advanceTime(), remove\n\t\t\t//the callbacks to be sure that they aren't called too many times.\n\t\t\tif(this._verticalAutoScrollTween !== null)\n\t\t\t{\n\t\t\t\tthis._verticalAutoScrollTween.onUpdate = null;\n\t\t\t\tthis._verticalAutoScrollTween.onComplete = null;\n\t\t\t\tthis._verticalAutoScrollTween = null;\n\t\t\t}\n\t\t\t//the page index will not have updated during the animation, so we\n\t\t\t//need to ensure that it is updated now.\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t\tthis.finishScrollingVertically();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function topPullTween_onComplete():void\n\t\t{\n\t\t\tthis._topPullTween = null;\n\t\t\tif(this._isTopPullViewActive)\n\t\t\t{\n\t\t\t\tthis._topPullViewRatio = 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._topPullViewRatio = 0;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function rightPullTween_onComplete():void\n\t\t{\n\t\t\tthis._rightPullTween = null;\n\t\t\tif(this._isRightPullViewActive)\n\t\t\t{\n\t\t\t\tthis._rightPullViewRatio = 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._rightPullViewRatio = 0;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function bottomPullTween_onComplete():void\n\t\t{\n\t\t\tthis._bottomPullTween = null;\n\t\t\tif(this._isBottomPullViewActive)\n\t\t\t{\n\t\t\t\tthis._bottomPullViewRatio = 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._bottomPullViewRatio = 0;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function leftPullTween_onComplete():void\n\t\t{\n\t\t\tthis._leftPullTween = null;\n\t\t\tif(this._isLeftPullViewActive)\n\t\t\t{\n\t\t\t\tthis._leftPullViewRatio = 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._leftPullViewRatio = 0;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function horizontalScrollBarHideTween_onComplete():void\n\t\t{\n\t\t\tthis._horizontalScrollBarHideTween = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function verticalScrollBarHideTween_onComplete():void\n\t\t{\n\t\t\tthis._verticalScrollBarHideTween = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function scroller_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\t//it's rare, but the stage could be null if the scroller is removed\n\t\t\t//in a listener for the same event.\n\t\t\tif(!this._isEnabled || this.stage === null)\n\t\t\t{\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._touchPointID != -1)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//any began touch is okay here. we don't need to check all touches.\n\t\t\tvar touch:Touch = event.getTouch(this, TouchPhase.BEGAN);\n\t\t\tif(touch === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this._interactionMode == ScrollInteractionMode.TOUCH_AND_SCROLL_BARS &&\n\t\t\t\t(event.interactsWith(DisplayObject(this.horizontalScrollBar)) || event.interactsWith(DisplayObject(this.verticalScrollBar))))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar touchPosition:Point = touch.getLocation(this, Pool.getPoint());\n\t\t\tvar touchX:Number = touchPosition.x;\n\t\t\tvar touchY:Number = touchPosition.y;\n\t\t\tPool.putPoint(touchPosition);\n\t\t\tif(touchX < this._leftViewPortOffset || touchY < this._topViewPortOffset ||\n\t\t\t\ttouchX >= (this.actualWidth - this._rightViewPortOffset) ||\n\t\t\t\ttouchY >= (this.actualHeight - this._bottomViewPortOffset))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar exclusiveTouch:ExclusiveTouch = ExclusiveTouch.forStage(this.stage);\n\t\t\tif(exclusiveTouch.getClaim(touch.id))\n\t\t\t{\n\t\t\t\t//already claimed\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//if the scroll policy is off, we shouldn't stop this animation\n\t\t\tif(this._horizontalAutoScrollTween !== null && this._horizontalScrollPolicy !== ScrollPolicy.OFF)\n\t\t\t{\n\t\t\t\tStarling.juggler.remove(this._horizontalAutoScrollTween);\n\t\t\t\tthis._horizontalAutoScrollTween = null;\n\t\t\t}\n\t\t\tif(this._verticalAutoScrollTween !== null && this._verticalScrollPolicy !== ScrollPolicy.OFF)\n\t\t\t{\n\t\t\t\tStarling.juggler.remove(this._verticalAutoScrollTween);\n\t\t\t\tthis._verticalAutoScrollTween = null;\n\t\t\t}\n\n\t\t\tthis._touchPointID = touch.id;\n\t\t\tthis._velocityX = 0;\n\t\t\tthis._velocityY = 0;\n\t\t\tthis._previousVelocityX.length = 0;\n\t\t\tthis._previousVelocityY.length = 0;\n\t\t\tthis._previousTouchTime = getTimer();\n\t\t\tthis._previousTouchX = this._startTouchX = this._currentTouchX = touchX;\n\t\t\tthis._previousTouchY = this._startTouchY = this._currentTouchY = touchY;\n\t\t\tthis._startHorizontalScrollPosition = this._horizontalScrollPosition;\n\t\t\tthis._startVerticalScrollPosition = this._verticalScrollPosition;\n\t\t\tthis._isScrollingStopped = false;\n\t\t\tif(!this._isScrolling || !this._snapToPages)\n\t\t\t{\n\t\t\t\t//if snapToPages is enabled, we need it to snap to the nearest\n\t\t\t\t//page on TouchPhase.ENDED, even if we don't drag again\n\t\t\t\t//BowlerHatLLC/feathersui-starling#1771\n\t\t\t\tthis._isDraggingVertically = false;\n\t\t\t\tthis._isDraggingHorizontally = false;\n\t\t\t}\n\t\t\tif(this._isScrolling)\n\t\t\t{\n\t\t\t\t//if it was scrolling, stop it immediately\n\t\t\t\tthis.completeScroll();\n\t\t\t}\n\n\t\t\tthis.addEventListener(Event.ENTER_FRAME, scroller_enterFrameHandler);\n\n\t\t\t//we need to listen on the stage because if we scroll the bottom or\n\t\t\t//right edge past the top of the scroller, it gets stuck and we stop\n\t\t\t//receiving touch events for \"this\".\n\t\t\tthis.stage.addEventListener(TouchEvent.TOUCH, stage_touchHandler);\n\n\t\t\texclusiveTouch.addEventListener(Event.CHANGE, exclusiveTouch_changeHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function scroller_enterFrameHandler(event:Event):void\n\t\t{\n\t\t\tthis.saveVelocity();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(this._touchPointID < 0)\n\t\t\t{\n\t\t\t\t//if the touch is claimed with ExclusiveTouch by a child, the\n\t\t\t\t//listener is removed, but the current event will keep bubbling\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar touch:Touch = event.getTouch(this.stage, null, this._touchPointID);\n\t\t\tif(touch === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(touch.phase === TouchPhase.MOVED)\n\t\t\t{\n\t\t\t\tvar touchPosition:Point = touch.getLocation(this, Pool.getPoint());\n\t\t\t\tthis._currentTouchX = touchPosition.x;\n\t\t\t\tthis._currentTouchY = touchPosition.y;\n\t\t\t\tPool.putPoint(touchPosition);\n\t\t\t\tthis.checkForDrag();\n\t\t\t\t//we don't call saveVelocity() on TouchPhase.MOVED because the\n\t\t\t\t//time interval may be very short, which could lead to\n\t\t\t\t//inaccurate results. instead, we wait for the next frame.\n\t\t\t\tthis._pendingVelocityChange = true;\n\t\t\t}\n\t\t\telse if(touch.phase === TouchPhase.ENDED)\n\t\t\t{\n\t\t\t\tif(this._pendingVelocityChange)\n\t\t\t\t{\n\t\t\t\t\t//we may need to do this one last time because the enter\n\t\t\t\t\t//frame listener may not have been called since the last\n\t\t\t\t\t//TouchPhase.MOVED\n\t\t\t\t\tthis.saveVelocity();\n\t\t\t\t}\n\t\t\t\tif(!this._isDraggingHorizontally && !this._isDraggingVertically)\n\t\t\t\t{\n\t\t\t\t\tExclusiveTouch.forStage(this.stage).removeEventListener(Event.CHANGE, exclusiveTouch_changeHandler);\n\t\t\t\t}\n\t\t\t\tthis.removeEventListener(Event.ENTER_FRAME, scroller_enterFrameHandler);\n\t\t\t\tthis.stage.removeEventListener(TouchEvent.TOUCH, stage_touchHandler);\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.END_INTERACTION);\n\n\t\t\t\tif(!this._isTopPullViewActive && this._isDraggingVertically &&\n\t\t\t\t\tthis._topPullView !== null &&\n\t\t\t\t\tthis._topPullViewRatio >= 1)\n\t\t\t\t{\n\t\t\t\t\tthis._isTopPullViewActive = true;\n\t\t\t\t\tthis._topPullView.dispatchEventWith(Event.UPDATE);\n\t\t\t\t\tthis.dispatchEventWith(Event.UPDATE, false, this._topPullView);\n\t\t\t\t}\n\t\t\t\tif(!this._isRightPullViewActive && this._isDraggingHorizontally &&\n\t\t\t\t\tthis._rightPullView !== null &&\n\t\t\t\t\tthis._rightPullViewRatio >= 1)\n\t\t\t\t{\n\t\t\t\t\tthis._isRightPullViewActive = true;\n\t\t\t\t\tthis._rightPullView.dispatchEventWith(Event.UPDATE);\n\t\t\t\t\tthis.dispatchEventWith(Event.UPDATE, false, this._rightPullView);\n\t\t\t\t}\n\t\t\t\tif(!this._isBottomPullViewActive && this._isDraggingVertically &&\n\t\t\t\t\tthis._bottomPullView !== null &&\n\t\t\t\t\tthis._bottomPullViewRatio >= 1)\n\t\t\t\t{\n\t\t\t\t\tthis._isBottomPullViewActive = true;\n\t\t\t\t\tthis._bottomPullView.dispatchEventWith(Event.UPDATE);\n\t\t\t\t\tthis.dispatchEventWith(Event.UPDATE, false, this._bottomPullView);\n\t\t\t\t}\n\t\t\t\tif(!this._isLeftPullViewActive && this._isDraggingHorizontally && \n\t\t\t\t\tthis._leftPullView !== null &&\n\t\t\t\t\tthis._leftPullViewRatio >= 1)\n\t\t\t\t{\n\t\t\t\t\tthis._isLeftPullViewActive = true;\n\t\t\t\t\tthis._leftPullView.dispatchEventWith(Event.UPDATE);\n\t\t\t\t\tthis.dispatchEventWith(Event.UPDATE, false, this._leftPullView);\n\t\t\t\t}\n\n\t\t\t\tvar isFinishingHorizontally:Boolean = false;\n\t\t\t\tvar adjustedMinHorizontalScrollPosition:Number = this._minHorizontalScrollPosition;\n\t\t\t\tif(this._isLeftPullViewActive && this._hasElasticEdges)\n\t\t\t\t{\n\t\t\t\t\tadjustedMinHorizontalScrollPosition -= this._leftPullView.width;\n\t\t\t\t}\n\t\t\t\tvar adjustedMaxHorizontalScrollPosition:Number = this._maxHorizontalScrollPosition;\n\t\t\t\tif(this._isRightPullViewActive && this._hasElasticEdges)\n\t\t\t\t{\n\t\t\t\t\tadjustedMaxHorizontalScrollPosition += this._rightPullView.width;\n\t\t\t\t}\n\t\t\t\tif(this._horizontalScrollPosition < adjustedMinHorizontalScrollPosition ||\n\t\t\t\t\tthis._horizontalScrollPosition > adjustedMaxHorizontalScrollPosition)\n\t\t\t\t{\n\t\t\t\t\tisFinishingHorizontally = true;\n\t\t\t\t\tthis.finishScrollingHorizontally();\n\t\t\t\t}\n\t\t\t\tvar isFinishingVertically:Boolean = false;\n\t\t\t\tvar adjustedMinVerticalScrollPosition:Number = this._minVerticalScrollPosition;\n\t\t\t\tif(this._isTopPullViewActive && this._hasElasticEdges)\n\t\t\t\t{\n\t\t\t\t\tadjustedMinVerticalScrollPosition -= this._topPullView.height;\n\t\t\t\t}\n\t\t\t\tvar adjustedMaxVerticalScrollPosition:Number = this._maxVerticalScrollPosition;\n\t\t\t\tif(this._isBottomPullViewActive && this._hasElasticEdges)\n\t\t\t\t{\n\t\t\t\t\tadjustedMaxVerticalScrollPosition += this._bottomPullView.height;\n\t\t\t\t}\n\t\t\t\tif(this._verticalScrollPosition < adjustedMinVerticalScrollPosition ||\n\t\t\t\t\tthis._verticalScrollPosition > adjustedMaxVerticalScrollPosition)\n\t\t\t\t{\n\t\t\t\t\tisFinishingVertically = true;\n\t\t\t\t\tthis.finishScrollingVertically();\n\t\t\t\t}\n\n\t\t\t\tif(isFinishingHorizontally && isFinishingVertically)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif(!isFinishingHorizontally)\n\t\t\t\t{\n\t\t\t\t\tif(this._isDraggingHorizontally)\n\t\t\t\t\t{\n\t\t\t\t\t\t//take the average for more accuracy\n\t\t\t\t\t\tvar sum:Number = this._velocityX * CURRENT_VELOCITY_WEIGHT;\n\t\t\t\t\t\tvar velocityCount:int = this._previousVelocityX.length;\n\t\t\t\t\t\tvar totalWeight:Number = CURRENT_VELOCITY_WEIGHT;\n\t\t\t\t\t\tfor(var i:int = 0; i < velocityCount; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar weight:Number = VELOCITY_WEIGHTS[i];\n\t\t\t\t\t\t\tsum += this._previousVelocityX.shift() * weight;\n\t\t\t\t\t\t\ttotalWeight += weight;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.throwHorizontally(sum / totalWeight);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.hideHorizontalScrollBar();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(!isFinishingVertically)\n\t\t\t\t{\n\t\t\t\t\tif(this._isDraggingVertically)\n\t\t\t\t\t{\n\t\t\t\t\t\tsum = this._velocityY * CURRENT_VELOCITY_WEIGHT;\n\t\t\t\t\t\tvelocityCount = this._previousVelocityY.length;\n\t\t\t\t\t\ttotalWeight = CURRENT_VELOCITY_WEIGHT;\n\t\t\t\t\t\tfor(i = 0; i < velocityCount; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tweight = VELOCITY_WEIGHTS[i];\n\t\t\t\t\t\t\tsum += this._previousVelocityY.shift() * weight;\n\t\t\t\t\t\t\ttotalWeight += weight;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.throwVertically(sum / totalWeight);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.hideVerticalScrollBar();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function exclusiveTouch_changeHandler(event:Event, touchID:int):void\n\t\t{\n\t\t\tif(this._touchPointID < 0 || this._touchPointID != touchID || this._isDraggingHorizontally || this._isDraggingVertically)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar exclusiveTouch:ExclusiveTouch = ExclusiveTouch.forStage(this.stage);\n\t\t\tif(exclusiveTouch.getClaim(touchID) == this)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._touchPointID = -1;\n\t\t\tthis.removeEventListener(Event.ENTER_FRAME, scroller_enterFrameHandler);\n\t\t\tthis.stage.removeEventListener(TouchEvent.TOUCH, stage_touchHandler);\n\t\t\texclusiveTouch.removeEventListener(Event.CHANGE, exclusiveTouch_changeHandler);\n\t\t\tthis.dispatchEventWith(FeathersEventType.END_INTERACTION);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function nativeStage_mouseWheelHandler(event:MouseEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif((this._verticalMouseWheelScrollDirection === Direction.VERTICAL && (this._maxVerticalScrollPosition == this._minVerticalScrollPosition || this._verticalScrollPolicy == ScrollPolicy.OFF)) ||\n\t\t\t\t(this._verticalMouseWheelScrollDirection === Direction.HORIZONTAL && (this._maxHorizontalScrollPosition == this._minHorizontalScrollPosition || this._horizontalScrollPolicy == ScrollPolicy.OFF)))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar nativeScaleFactor:Number = 1;\n\t\t\tif(starling.supportHighResolutions)\n\t\t\t{\n\t\t\t\tnativeScaleFactor = starling.nativeStage.contentsScaleFactor;\n\t\t\t}\n\t\t\tvar starlingViewPort:Rectangle = starling.viewPort;\n\t\t\tvar scaleFactor:Number = nativeScaleFactor / starling.contentScaleFactor;\n\t\t\tvar point:Point = Pool.getPoint(\n\t\t\t\t(event.stageX - starlingViewPort.x) * scaleFactor,\n\t\t\t\t(event.stageY - starlingViewPort.y) * scaleFactor);\n\t\t\tvar isContained:Boolean = this.stage !== null && this.contains(this.stage.hitTest(point));\n\t\t\tif(!isContained)\n\t\t\t{\n\t\t\t\tPool.putPoint(point);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.globalToLocal(point, point);\n\t\t\t\tvar localMouseX:Number = point.x;\n\t\t\t\tvar localMouseY:Number = point.y;\n\t\t\t\tPool.putPoint(point);\n\t\t\t\tif(localMouseX < this._leftViewPortOffset || localMouseY < this._topViewPortOffset ||\n\t\t\t\t\tlocalMouseX >= this.actualWidth - this._rightViewPortOffset ||\n\t\t\t\t\tlocalMouseY >= this.actualHeight - this._bottomViewPortOffset)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar targetHorizontalScrollPosition:Number = this._horizontalScrollPosition;\n\t\t\t\tvar targetVerticalScrollPosition:Number = this._verticalScrollPosition;\n\t\t\t\tvar scrollStep:Number = this._verticalMouseWheelScrollStep;\n\t\t\t\tif(this._verticalMouseWheelScrollDirection == Direction.HORIZONTAL)\n\t\t\t\t{\n\t\t\t\t\tif(scrollStep !== scrollStep) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\tscrollStep = this.actualHorizontalScrollStep;\n\t\t\t\t\t}\n\t\t\t\t\ttargetHorizontalScrollPosition -= event.delta * scrollStep;\n\t\t\t\t\tif(targetHorizontalScrollPosition < this._minHorizontalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\ttargetHorizontalScrollPosition = this._minHorizontalScrollPosition;\n\t\t\t\t\t}\n\t\t\t\t\telse if(targetHorizontalScrollPosition > this._maxHorizontalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\ttargetHorizontalScrollPosition = this._maxHorizontalScrollPosition;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse //vertical\n\t\t\t\t{\n\t\t\t\t\tif(scrollStep !== scrollStep) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\tscrollStep = this.actualVerticalScrollStep;\n\t\t\t\t\t}\n\t\t\t\t\ttargetVerticalScrollPosition -= event.delta * scrollStep;\n\t\t\t\t\tif(targetVerticalScrollPosition < this._minVerticalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\ttargetVerticalScrollPosition = this._minVerticalScrollPosition;\n\t\t\t\t\t}\n\t\t\t\t\telse if(targetVerticalScrollPosition > this._maxVerticalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\ttargetVerticalScrollPosition = this._maxVerticalScrollPosition;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.throwTo(targetHorizontalScrollPosition, targetVerticalScrollPosition, this._mouseWheelScrollDuration);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function nativeStage_orientationChangeHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tif(this._touchPointID < 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._startTouchX = this._previousTouchX = this._currentTouchX;\n\t\t\tthis._startTouchY = this._previousTouchY = this._currentTouchY;\n\t\t\tthis._startHorizontalScrollPosition = this._horizontalScrollPosition;\n\t\t\tthis._startVerticalScrollPosition = this._verticalScrollPosition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function horizontalScrollBar_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\tthis._horizontalScrollBarTouchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar displayHorizontalScrollBar:DisplayObject = DisplayObject(event.currentTarget);\n\t\t\tif(this._horizontalScrollBarTouchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(displayHorizontalScrollBar, TouchPhase.ENDED, this._horizontalScrollBarTouchPointID);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis._horizontalScrollBarTouchPointID = -1;\n\t\t\t\tvar touchPosition:Point = touch.getLocation(displayHorizontalScrollBar, Pool.getPoint());\n\t\t\t\tvar isInBounds:Boolean = this.horizontalScrollBar.hitTest(touchPosition) !== null;\n\t\t\t\tPool.putPoint(touchPosition);\n\t\t\t\tif(!isInBounds)\n\t\t\t\t{\n\t\t\t\t\tthis.hideHorizontalScrollBar();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(displayHorizontalScrollBar, TouchPhase.BEGAN);\n\t\t\t\tif(touch)\n\t\t\t\t{\n\t\t\t\t\tthis._horizontalScrollBarTouchPointID = touch.id;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(this._isScrolling)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttouch = event.getTouch(displayHorizontalScrollBar, TouchPhase.HOVER);\n\t\t\t\tif(touch)\n\t\t\t\t{\n\t\t\t\t\tthis.revealHorizontalScrollBar();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t//end hover\n\t\t\t\tthis.hideHorizontalScrollBar();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function verticalScrollBar_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\tthis._verticalScrollBarTouchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar displayVerticalScrollBar:DisplayObject = DisplayObject(event.currentTarget);\n\t\t\tif(this._verticalScrollBarTouchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(displayVerticalScrollBar, TouchPhase.ENDED, this._verticalScrollBarTouchPointID);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis._verticalScrollBarTouchPointID = -1;\n\t\t\t\tvar touchPosition:Point = touch.getLocation(displayVerticalScrollBar, Pool.getPoint());\n\t\t\t\tvar isInBounds:Boolean = this.verticalScrollBar.hitTest(touchPosition) !== null;\n\t\t\t\tPool.putPoint(touchPosition);\n\t\t\t\tif(!isInBounds)\n\t\t\t\t{\n\t\t\t\t\tthis.hideVerticalScrollBar();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(displayVerticalScrollBar, TouchPhase.BEGAN);\n\t\t\t\tif(touch)\n\t\t\t\t{\n\t\t\t\t\tthis._verticalScrollBarTouchPointID = touch.id;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(this._isScrolling)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttouch = event.getTouch(displayVerticalScrollBar, TouchPhase.HOVER);\n\t\t\t\tif(touch)\n\t\t\t\t{\n\t\t\t\t\tthis.revealVerticalScrollBar();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t//end hover\n\t\t\t\tthis.hideVerticalScrollBar();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function scroller_addedToStageHandler(event:Event):void\n\t\t{\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tstarling.nativeStage.addEventListener(MouseEvent.MOUSE_WHEEL, nativeStage_mouseWheelHandler, false, 0, true);\n\t\t\tstarling.nativeStage.addEventListener(\"orientationChange\", nativeStage_orientationChangeHandler, false, 0, true);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function scroller_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tstarling.nativeStage.removeEventListener(MouseEvent.MOUSE_WHEEL, nativeStage_mouseWheelHandler);\n\t\t\tstarling.nativeStage.removeEventListener(\"orientationChange\", nativeStage_orientationChangeHandler);\n\t\t\tif(this._touchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar exclusiveTouch:ExclusiveTouch = ExclusiveTouch.forStage(this.stage);\n\t\t\t\texclusiveTouch.removeEventListener(Event.CHANGE, exclusiveTouch_changeHandler);\n\t\t\t}\n\t\t\tthis._touchPointID = -1;\n\t\t\tthis._horizontalScrollBarTouchPointID = -1;\n\t\t\tthis._verticalScrollBarTouchPointID = -1;\n\t\t\tthis._isDraggingHorizontally = false;\n\t\t\tthis._isDraggingVertically = false;\n\t\t\tthis._velocityX = 0;\n\t\t\tthis._velocityY = 0;\n\t\t\tthis._previousVelocityX.length = 0;\n\t\t\tthis._previousVelocityY.length = 0;\n\t\t\tthis._horizontalScrollBarIsScrolling = false;\n\t\t\tthis._verticalScrollBarIsScrolling = false;\n\t\t\tthis.removeEventListener(Event.ENTER_FRAME, scroller_enterFrameHandler);\n\t\t\tthis.stage.removeEventListener(TouchEvent.TOUCH, stage_touchHandler);\n\t\t\tif(this._verticalAutoScrollTween)\n\t\t\t{\n\t\t\t\tStarling.juggler.remove(this._verticalAutoScrollTween);\n\t\t\t\tthis._verticalAutoScrollTween = null;\n\t\t\t}\n\t\t\tif(this._horizontalAutoScrollTween)\n\t\t\t{\n\t\t\t\tStarling.juggler.remove(this._horizontalAutoScrollTween);\n\t\t\t\tthis._horizontalAutoScrollTween = null;\n\t\t\t}\n\t\t\tif(this._topPullTween)\n\t\t\t{\n\t\t\t\tthis._topPullTween.dispatchEventWith(Event.REMOVE_FROM_JUGGLER);\n\t\t\t\tthis._topPullTween = null;\n\t\t\t}\n\t\t\tif(this._rightPullTween)\n\t\t\t{\n\t\t\t\tthis._rightPullTween.dispatchEventWith(Event.REMOVE_FROM_JUGGLER);\n\t\t\t\tthis._rightPullTween = null;\n\t\t\t}\n\t\t\tif(this._bottomPullTween)\n\t\t\t{\n\t\t\t\tthis._bottomPullTween.dispatchEventWith(Event.REMOVE_FROM_JUGGLER);\n\t\t\t\tthis._bottomPullTween = null;\n\t\t\t}\n\t\t\tif(this._leftPullTween)\n\t\t\t{\n\t\t\t\tthis._leftPullTween.dispatchEventWith(Event.REMOVE_FROM_JUGGLER);\n\t\t\t\tthis._leftPullTween = null;\n\t\t\t}\n\n\t\t\t//if we stopped the animation while the list was outside the scroll\n\t\t\t//bounds, then let's account for that\n\t\t\tvar oldHorizontalScrollPosition:Number = this._horizontalScrollPosition;\n\t\t\tvar oldVerticalScrollPosition:Number = this._verticalScrollPosition;\n\t\t\tif(this._horizontalScrollPosition < this._minHorizontalScrollPosition)\n\t\t\t{\n\t\t\t\tthis._horizontalScrollPosition = this._minHorizontalScrollPosition;\n\t\t\t}\n\t\t\telse if(this._horizontalScrollPosition > this._maxHorizontalScrollPosition)\n\t\t\t{\n\t\t\t\tthis._horizontalScrollPosition = this._maxHorizontalScrollPosition;\n\t\t\t}\n\t\t\tif(this._verticalScrollPosition < this._minVerticalScrollPosition)\n\t\t\t{\n\t\t\t\tthis._verticalScrollPosition = this._minVerticalScrollPosition;\n\t\t\t}\n\t\t\telse if(this._verticalScrollPosition > this._maxVerticalScrollPosition)\n\t\t\t{\n\t\t\t\tthis._verticalScrollPosition = this._maxVerticalScrollPosition;\n\t\t\t}\n\t\t\tif(oldHorizontalScrollPosition != this._horizontalScrollPosition ||\n\t\t\t\toldVerticalScrollPosition != this._verticalScrollPosition)\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(Event.SCROLL);\n\t\t\t}\n\t\t\tthis.completeScroll();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function focusInHandler(event:Event):void\n\t\t{\n\t\t\tsuper.focusInHandler(event);\n\t\t\t//using priority here is a hack so that objects deeper in the\n\t\t\t//display list have a chance to cancel the event first.\n\t\t\tvar priority:int = -getDisplayObjectDepthFromStage(this);\n\t\t\tthis.stage.starling.nativeStage.addEventListener(KeyboardEvent.KEY_DOWN, nativeStage_keyDownHandler, false, priority, true);\n\t\t\tthis.stage.starling.nativeStage.addEventListener(\"gestureDirectionalTap\", stage_gestureDirectionalTapHandler, false, priority, true);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function focusOutHandler(event:Event):void\n\t\t{\n\t\t\tsuper.focusOutHandler(event);\n\t\t\tthis.stage.starling.nativeStage.removeEventListener(KeyboardEvent.KEY_DOWN, nativeStage_keyDownHandler);\n\t\t\tthis.stage.starling.nativeStage.removeEventListener(\"gestureDirectionalTap\", stage_gestureDirectionalTapHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function nativeStage_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(event.isDefaultPrevented())\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar newHorizontalScrollPosition:Number = this._horizontalScrollPosition;\n\t\t\tvar newVerticalScrollPosition:Number = this._verticalScrollPosition;\n\t\t\tif(event.keyCode == Keyboard.HOME)\n\t\t\t{\n\t\t\t\tnewVerticalScrollPosition = this._minVerticalScrollPosition;\n\t\t\t}\n\t\t\telse if(event.keyCode == Keyboard.END)\n\t\t\t{\n\t\t\t\tnewVerticalScrollPosition = this._maxVerticalScrollPosition;\n\t\t\t}\n\t\t\telse if(event.keyCode == Keyboard.PAGE_UP)\n\t\t\t{\n\t\t\t\tnewVerticalScrollPosition = Math.max(this._minVerticalScrollPosition, this._verticalScrollPosition - this.viewPort.visibleHeight);\n\t\t\t}\n\t\t\telse if(event.keyCode == Keyboard.PAGE_DOWN)\n\t\t\t{\n\t\t\t\tnewVerticalScrollPosition = Math.min(this._maxVerticalScrollPosition, this._verticalScrollPosition + this.viewPort.visibleHeight);\n\t\t\t}\n\t\t\telse if(event.keyCode == Keyboard.UP)\n\t\t\t{\n\t\t\t\tnewVerticalScrollPosition = Math.max(this._minVerticalScrollPosition, this._verticalScrollPosition - this.verticalScrollStep);\n\t\t\t}\n\t\t\telse if(event.keyCode == Keyboard.DOWN)\n\t\t\t{\n\t\t\t\tnewVerticalScrollPosition = Math.min(this._maxVerticalScrollPosition, this._verticalScrollPosition + this.verticalScrollStep);\n\t\t\t}\n\t\t\telse if(event.keyCode == Keyboard.LEFT)\n\t\t\t{\n\t\t\t\tnewHorizontalScrollPosition = Math.max(this._minHorizontalScrollPosition, this._horizontalScrollPosition - this.horizontalScrollStep);\n\t\t\t}\n\t\t\telse if(event.keyCode == Keyboard.RIGHT)\n\t\t\t{\n\t\t\t\tnewHorizontalScrollPosition = Math.min(this._maxHorizontalScrollPosition, this._horizontalScrollPosition + this.horizontalScrollStep);\n\t\t\t}\n\t\t\tif(this._horizontalScrollPosition != newHorizontalScrollPosition &&\n\t\t\t\tthis._horizontalScrollPolicy != ScrollPolicy.OFF)\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.horizontalScrollPosition = newHorizontalScrollPosition;\n\t\t\t}\n\t\t\tif(this._verticalScrollPosition != newVerticalScrollPosition &&\n\t\t\t\tthis._verticalScrollPolicy != ScrollPolicy.OFF)\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.verticalScrollPosition = newVerticalScrollPosition;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_gestureDirectionalTapHandler(event:TransformGestureEvent):void\n\t\t{\n\t\t\tif(event.isDefaultPrevented())\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar newHorizontalScrollPosition:Number = this._horizontalScrollPosition;\n\t\t\tvar newVerticalScrollPosition:Number = this._verticalScrollPosition;\n\t\t\tif(event.offsetY < 0)\n\t\t\t{\n\t\t\t\tnewVerticalScrollPosition = Math.max(this._minVerticalScrollPosition, this._verticalScrollPosition - this.verticalScrollStep);\n\t\t\t}\n\t\t\telse if(event.offsetY > 0)\n\t\t\t{\n\t\t\t\tnewVerticalScrollPosition = Math.min(this._maxVerticalScrollPosition, this._verticalScrollPosition + this.verticalScrollStep);\n\t\t\t}\n\t\t\telse if(event.offsetX < 0)\n\t\t\t{\n\t\t\t\tnewHorizontalScrollPosition = Math.max(this._maxHorizontalScrollPosition, this._horizontalScrollPosition - this.horizontalScrollStep);\n\t\t\t}\n\t\t\telse if(event.offsetX > 0)\n\t\t\t{\n\t\t\t\tnewHorizontalScrollPosition = Math.min(this._maxHorizontalScrollPosition, this._horizontalScrollPosition + this.horizontalScrollStep);\n\t\t\t}\n\t\t\tif(this._horizontalScrollPosition != newHorizontalScrollPosition)\n\t\t\t{\n\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t\t//event.preventDefault();\n\t\t\t\tthis.horizontalScrollPosition = newHorizontalScrollPosition;\n\t\t\t}\n\t\t\tif(this._verticalScrollPosition != newVerticalScrollPosition)\n\t\t\t{\n\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t\t//event.preventDefault();\n\t\t\t\tthis.verticalScrollPosition = newVerticalScrollPosition;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/SimpleScrollBar.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IFocusDisplayObject;\n\timport feathers.core.IMeasureDisplayObject;\n\timport feathers.core.IValidating;\n\timport feathers.core.PropertyProxy;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.Direction;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.utils.math.clamp;\n\timport feathers.utils.math.roundDownToNearest;\n\timport feathers.utils.math.roundToNearest;\n\timport feathers.utils.math.roundUpToNearest;\n\n\timport flash.events.TimerEvent;\n\timport flash.geom.Point;\n\timport flash.utils.Timer;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.utils.Pool;\n\n\t/**\n\t * A style name to add to the scroll bar's thumb sub-component.\n\t * Typically used by a theme to provide different styles to different\n\t * scroll bars.\n\t *\n\t * <p>In the following example, a custom thumb style name is passed\n\t * to the scroll bar:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollBar.customThumbStyleName = \"my-custom-thumb\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( Button ).setFunctionForStyleName( \"my-custom-thumb\", setCustomThumbStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_THUMB\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #thumbFactory\n\t */\n\t[Style(name=\"customThumbStyleName\",type=\"String\")]\n\n\t/**\n\t * Determines if the scroll bar's thumb can be dragged horizontally or\n\t * vertically. When this value changes, the scroll bar's width and\n\t * height values do not change automatically.\n\t *\n\t * <p>Note: When using a <code>SimpleScrollBar</code> with a scrolling\n\t * container, the container will automatically set the correct\n\t * <code>direction</code> value. Generally, you should not need to set this\n\t * style manually.</p>\n\t *\n\t * <p>In the following example, the direction is changed to vertical:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollBar.direction = Direction.VERTICAL;</listing>\n\t *\n\t * <p><strong>Note:</strong> The <code>Direction.NONE</code>\n\t * constant is not supported.</p>\n\t *\n\t * @default feathers.layout.Direction.HORIZONTAL\n\t *\n\t * @see feathers.layout.Direction#HORIZONTAL\n\t * @see feathers.layout.Direction#VERTICAL\n\t */\n\t[Style(name=\"direction\",type=\"String\")]\n\n\t/**\n\t * Determines if the scroll bar's thumb will be resized based on the\n\t * scrollable range, or if it will be rendered at its preferred size.\n\t *\n\t * <p>In the following example, the thumb size is fixed:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollBar.fixedThumbSize = true;</listing>\n\t *\n\t * @default false\n\t */\n\t[Style(name=\"fixedThumbSize\",type=\"Boolean\")]\n\n\t/**\n\t * Quickly sets all padding properties to the same value. The\n\t * <code>padding</code> getter always returns the value of\n\t * <code>paddingTop</code>, but the other padding values may be\n\t * different.\n\t *\n\t * <p>In the following example, the padding is changed to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollBar.padding = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:paddingTop\n\t * @see #style:paddingRight\n\t * @see #style:paddingBottom\n\t * @see #style:paddingLeft\n\t */\n\t[Style(name=\"padding\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, above the thumb.\n\t *\n\t * <p>In the following example, the top padding is changed to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollBar.paddingTop = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingTop\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, to the right of the thumb.\n\t *\n\t * <p>In the following example, the right padding is changed to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollBar.paddingRight = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingRight\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, below the thumb.\n\t *\n\t * <p>In the following example, the bottom padding is changed to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollBar.paddingBottom = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingBottom\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, to the left of the thumb.\n\t *\n\t * <p>In the following example, the left padding is changed to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * scrollBar.paddingLeft = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingLeft\",type=\"Number\")]\n\n\t/**\n\t * Dispatched when the scroll bar's value changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #value\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the user starts dragging the scroll bar's thumb.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.BEGIN_INTERACTION\n\t */\n\t[Event(name=\"beginInteraction\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the user stops dragging the scroll bar's thumb.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.END_INTERACTION\n\t */\n\t[Event(name=\"endInteraction\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Select a value between a minimum and a maximum by dragging a thumb over\n\t * a physical range. This type of scroll bar does not have a visible track,\n\t * and it does not have increment and decrement buttons. It is ideal for\n\t * mobile applications where the scroll bar is often simply a visual element\n\t * to indicate the scroll position. For a more feature-rich scroll bar,\n\t * see the <code>ScrollBar</code> component.\n\t *\n\t * <p>The following example updates a list to use simple scroll bars:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * list.horizontalScrollBarFactory = function():IScrollBar\n\t * {\n\t *     return new SimpleScrollBar();\n\t * };\n\t * list.verticalScrollBarFactory = function():IScrollBar\n\t * {\n\t *     return new SimpleScrollBar();\n\t * };</listing>\n\t *\n\t * @see ../../../help/simple-scroll-bar.html How to use the Feathers SimpleScrollBar component\n\t * @see feathers.controls.ScrollBar\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class SimpleScrollBar extends FeathersControl implements IDirectionalScrollBar\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_THUMB_FACTORY:String = \"thumbFactory\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the thumb.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_THUMB:String = \"feathers-simple-scroll-bar-thumb\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>SimpleScrollBar</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultThumbFactory():BasicButton\n\t\t{\n\t\t\treturn new Button();\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function SimpleScrollBar()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.addEventListener(Event.REMOVED_FROM_STAGE, removedFromStageHandler);\n\t\t}\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the thumb. This\n\t\t * variable is <code>protected</code> so that sub-classes can customize\n\t\t * the thumb style name in their constructors instead of using the\n\t\t * default style name defined by <code>DEFAULT_CHILD_STYLE_NAME_THUMB</code>.\n\t\t *\n\t\t * <p>To customize the thumb style name without subclassing, see\n\t\t * <code>customThumbStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customThumbStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var thumbStyleName:String = DEFAULT_CHILD_STYLE_NAME_THUMB;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _thumbExplicitWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _thumbExplicitHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _thumbExplicitMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _thumbExplicitMinHeight:Number;\n\n\t\t/**\n\t\t * The thumb sub-component.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t *\n\t\t * @see #thumbFactory\n\t\t * @see #createThumb()\n\t\t */\n\t\tprotected var thumb:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var track:Quad;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn SimpleScrollBar.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _direction:String = Direction.HORIZONTAL;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"horizontal,vertical\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get direction():String\n\t\t{\n\t\t\treturn this._direction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set direction(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._direction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._direction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_THUMB_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fixedThumbSize:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get fixedThumbSize():Boolean\n\t\t{\n\t\t\treturn this._fixedThumbSize;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set fixedThumbSize(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._fixedThumbSize === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._fixedThumbSize = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * Determines if the value should be clamped to the range between the\n\t\t * minimum and maximum. If <code>false</code> and the value is outside of the range,\n\t\t * the thumb will shrink as if the range were increasing.\n\t\t *\n\t\t * <p>In the following example, the clamping behavior is updated:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scrollBar.clampToRange = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic var clampToRange:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _value:Number = 0;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #maximum\n\t\t * @see #minimum\n\t\t * @see #step\n\t\t * @see #page\n\t\t * @see #event:change\n\t\t */\n\t\tpublic function get value():Number\n\t\t{\n\t\t\treturn this._value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set value(newValue:Number):void\n\t\t{\n\t\t\tif(this.clampToRange)\n\t\t\t{\n\t\t\t\tnewValue = clamp(newValue, this._minimum, this._maximum);\n\t\t\t}\n\t\t\tif(this._value == newValue)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._value = newValue;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\tif(this.liveDragging || !this.isDragging)\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimum:Number = 0;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #value\n\t\t * @see #maximum\n\t\t */\n\t\tpublic function get minimum():Number\n\t\t{\n\t\t\treturn this._minimum;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minimum(value:Number):void\n\t\t{\n\t\t\tif(this._minimum == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._minimum = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maximum:Number = 0;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #value\n\t\t * @see #minimum\n\t\t */\n\t\tpublic function get maximum():Number\n\t\t{\n\t\t\treturn this._maximum;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maximum(value:Number):void\n\t\t{\n\t\t\tif(this._maximum == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._maximum = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _step:Number = 0;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #value\n\t\t * @see #page\n\t\t */\n\t\tpublic function get step():Number\n\t\t{\n\t\t\treturn this._step;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set step(value:Number):void\n\t\t{\n\t\t\tthis._step = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _page:Number = 0;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #value\n\t\t * @see #step\n\t\t */\n\t\tpublic function get page():Number\n\t\t{\n\t\t\treturn this._page;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set page(value:Number):void\n\t\t{\n\t\t\tif(this._page == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._page = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get padding():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set padding(value:Number):void\n\t\t{\n\t\t\tthis.paddingTop = value;\n\t\t\tthis.paddingRight = value;\n\t\t\tthis.paddingBottom = value;\n\t\t\tthis.paddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingTop:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingTop():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingTop(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingTop = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingRight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingRight():Number\n\t\t{\n\t\t\treturn this._paddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingRight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingBottom:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingBottom():Number\n\t\t{\n\t\t\treturn this._paddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingBottom = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingLeft:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingLeft = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var currentRepeatAction:Function;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _repeatTimer:Timer;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _repeatDelay:Number = 0.05;\n\n\t\t/**\n\t\t * The time, in seconds, before actions are repeated. The first repeat\n\t\t * happens after a delay that is five times longer than the following\n\t\t * repeats.\n\t\t *\n\t\t * <p>In the following example, the repeat delay is changed to 500 milliseconds:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scrollBar.repeatDelay = 0.5;</listing>\n\t\t *\n\t\t * @default 0.05\n\t\t */\n\t\tpublic function get repeatDelay():Number\n\t\t{\n\t\t\treturn this._repeatDelay;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set repeatDelay(value:Number):void\n\t\t{\n\t\t\tif(this._repeatDelay == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._repeatDelay = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var isDragging:Boolean = false;\n\n\t\t/**\n\t\t * Determines if the scroll bar dispatches the <code>Event.CHANGE</code>\n\t\t * event every time the thumb moves, or only once it stops moving.\n\t\t *\n\t\t * <p>In the following example, live dragging is disabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scrollBar.liveDragging = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic var liveDragging:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _thumbFactory:Function;\n\n\t\t/**\n\t\t * A function used to generate the scroll bar's thumb sub-component.\n\t\t * The thumb must be an instance of <code>BasicButton</code>. This\n\t\t * factory can be used to change properties on the thumb when it is\n\t\t * first created. For instance, if you are skinning Feathers components\n\t\t * without a theme, you might use this factory to set skins and other\n\t\t * styles on the thumb.\n\t\t *\n\t\t * <p>The function should have the following signature:</p>\n\t\t * <pre>function():BasicButton</pre>\n\t\t *\n\t\t * <p>In the following example, a custom thumb factory is passed\n\t\t * to the scroll bar:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scrollBar.thumbFactory = function():BasicButton\n\t\t * {\n\t\t *     var thumb:BasicButton = new BasicButton();\n\t\t *     var skin:ImageSkin = new ImageSkin( upTexture );\n\t\t *     skin.setTextureForState( ButtonState.DOWN, downTexture );\n\t\t *     thumb.defaultSkin = skin;\n\t\t *     return thumb;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.BasicButton\n\t\t */\n\t\tpublic function get thumbFactory():Function\n\t\t{\n\t\t\treturn this._thumbFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set thumbFactory(value:Function):void\n\t\t{\n\t\t\tif(this._thumbFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._thumbFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_THUMB_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customThumbStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customThumbStyleName():String\n\t\t{\n\t\t\treturn this._customThumbStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customThumbStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customThumbStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customThumbStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_THUMB_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _thumbProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the scroll bar's thumb, and the\n\t\t * properties will be passed down to the thumb when the scroll bar\n\t\t * validates. For a list of available properties, refer to\n\t\t * <a href=\"Button.html\"><code>feathers.controls.BasicButton</code></a>.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>thumbFactory</code> function instead\n\t\t * of using <code>thumbProperties</code> will result in better\n\t\t * performance.</p>\n\t\t *\n\t\t * <p>In the following example, the scroll bar's thumb properties\n\t\t * are updated:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scrollBar.thumbProperties.defaultSkin = new Image( upTexture );\n\t\t * scrollBar.thumbProperties.downSkin = new Image( downTexture );</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #thumbFactory\n\t\t * @see feathers.controls.BasicButton\n\t\t */\n\t\tpublic function get thumbProperties():Object\n\t\t{\n\t\t\tif(!this._thumbProperties)\n\t\t\t{\n\t\t\t\tthis._thumbProperties = new PropertyProxy(thumbProperties_onChange);\n\t\t\t}\n\t\t\treturn this._thumbProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set thumbProperties(value:Object):void\n\t\t{\n\t\t\tif(this._thumbProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._thumbProperties)\n\t\t\t{\n\t\t\t\tthis._thumbProperties.removeOnChangeCallback(thumbProperties_onChange);\n\t\t\t}\n\t\t\tthis._thumbProperties = PropertyProxy(value);\n\t\t\tif(this._thumbProperties)\n\t\t\t{\n\t\t\t\tthis._thumbProperties.addOnChangeCallback(thumbProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _touchPointID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _touchStartX:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _touchStartY:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _thumbStartX:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _thumbStartY:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _touchValue:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _pageStartValue:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tif(!this.track)\n\t\t\t{\n\t\t\t\tthis.track = new Quad(10, 10, 0xff00ff);\n\t\t\t\tthis.track.alpha = 0;\n\t\t\t\tthis.track.addEventListener(TouchEvent.TOUCH, track_touchHandler);\n\t\t\t\tthis.addChild(this.track);\n\t\t\t}\n\t\t\tif(this._value < this._minimum)\n\t\t\t{\n\t\t\t\tthis.value = this._minimum;\n\t\t\t}\n\t\t\telse if(this._value > this._maximum)\n\t\t\t{\n\t\t\t\tthis.value = this._maximum;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar thumbFactoryInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_THUMB_FACTORY);\n\n\t\t\tif(thumbFactoryInvalid)\n\t\t\t{\n\t\t\t\tthis.createThumb();\n\t\t\t}\n\n\t\t\tif(thumbFactoryInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshThumbStyles();\n\t\t\t}\n\n\t\t\tif(dataInvalid || thumbFactoryInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshEnabled();\n\t\t\t}\n\n\t\t\tsizeInvalid = this.autoSizeIfNeeded() || sizeInvalid;\n\n\t\t\tthis.layout();\n\t\t}\n\n\t\t/**\n\t\t * If the component's dimensions have not been set explicitly, it will\n\t\t * measure its content and determine an ideal size for itself. If the\n\t\t * <code>explicitWidth</code> or <code>explicitHeight</code> member\n\t\t * variables are set, those value will be used without additional\n\t\t * measurement. If one is set, but not the other, the dimension with the\n\t\t * explicit value will not be measured, but the other non-explicit\n\t\t * dimension will still need measurement.\n\t\t *\n\t\t * <p>Calls <code>saveMeasurements()</code> to set up the\n\t\t * <code>actualWidth</code> and <code>actualHeight</code> member\n\t\t * variables used for layout.</p>\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t */\n\t\tprotected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tthis.thumb.width = this._thumbExplicitWidth;\n\t\t\tthis.thumb.height = this._thumbExplicitHeight;\n\t\t\tvar measureThumb:IMeasureDisplayObject;\n\t\t\tif(this.thumb is IMeasureDisplayObject)\n\t\t\t{\n\t\t\t\tmeasureThumb = IMeasureDisplayObject(this.thumb);\n\t\t\t\tmeasureThumb.minWidth = this._thumbExplicitMinWidth;\n\t\t\t\tmeasureThumb.minHeight = this._thumbExplicitMinHeight;\n\t\t\t}\n\t\t\tif(this.thumb is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.thumb).validate();\n\t\t\t}\n\n\t\t\tvar range:Number = this._maximum - this._minimum;\n\t\t\tvar adjustedPage:Number = this._page;\n\t\t\tif(adjustedPage == 0)\n\t\t\t{\n\t\t\t\t//fall back to using step!\n\t\t\t\tadjustedPage = this._step;\n\t\t\t}\n\t\t\tif(adjustedPage > range)\n\t\t\t{\n\t\t\t\tadjustedPage = range;\n\t\t\t}\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tnewWidth = this.thumb.width;\n\t\t\t\tif(this._direction !== Direction.VERTICAL && adjustedPage != 0)\n\t\t\t\t{\n\t\t\t\t\tnewWidth *= range / adjustedPage;\n\t\t\t\t}\n\t\t\t\tnewWidth += this._paddingLeft + this._paddingRight;\n\t\t\t}\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tnewHeight = this.thumb.height;\n\t\t\t\tif(this._direction === Direction.VERTICAL && adjustedPage != 0)\n\t\t\t\t{\n\t\t\t\t\tnewHeight *= range / adjustedPage;\n\t\t\t\t}\n\t\t\t\tnewHeight += this._paddingTop + this._paddingBottom;\n\t\t\t}\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tif(measureThumb !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = measureThumb.minWidth;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = this.thumb.width;\n\t\t\t\t}\n\t\t\t\tif(this._direction !== Direction.VERTICAL && adjustedPage != 0)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth *= range / adjustedPage;\n\t\t\t\t}\n\t\t\t\tnewMinWidth += this._paddingLeft + this._paddingRight;\n\t\t\t}\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tif(measureThumb !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = measureThumb.minHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = this.thumb.height;\n\t\t\t\t}\n\t\t\t\tif(this._direction === Direction.VERTICAL && adjustedPage != 0)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight *= range / adjustedPage;\n\t\t\t\t}\n\t\t\t\tnewMinHeight += this._paddingTop + this._paddingBottom;\n\t\t\t}\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>thumb</code> sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #thumb\n\t\t * @see #thumbFactory\n\t\t * @see #style:customThumbStyleName\n\t\t */\n\t\tprotected function createThumb():void\n\t\t{\n\t\t\tif(this.thumb)\n\t\t\t{\n\t\t\t\tthis.thumb.removeFromParent(true);\n\t\t\t\tthis.thumb = null;\n\t\t\t}\n\n\t\t\tvar factory:Function = this._thumbFactory != null ? this._thumbFactory : defaultThumbFactory;\n\t\t\tvar thumbStyleName:String = this._customThumbStyleName != null ? this._customThumbStyleName : this.thumbStyleName;\n\t\t\tvar thumb:BasicButton = BasicButton(factory());\n\t\t\tthumb.styleNameList.add(thumbStyleName);\n\t\t\tif(thumb is IFocusDisplayObject)\n\t\t\t{\n\t\t\t\tthumb.isFocusEnabled = false;\n\t\t\t}\n\t\t\tthumb.keepDownStateOnRollOut = true;\n\t\t\tthumb.addEventListener(TouchEvent.TOUCH, thumb_touchHandler);\n\t\t\tthis.addChild(thumb);\n\t\t\tthis.thumb = thumb;\n\n\t\t\tif(this.thumb is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this.thumb).initializeNow();\n\t\t\t}\n\t\t\tif(this.thumb is IMeasureDisplayObject)\n\t\t\t{\n\t\t\t\tvar measureThumb:IMeasureDisplayObject = IMeasureDisplayObject(this.thumb);\n\t\t\t\tthis._thumbExplicitWidth = measureThumb.explicitWidth;\n\t\t\t\tthis._thumbExplicitHeight = measureThumb.explicitHeight;\n\t\t\t\tthis._thumbExplicitMinWidth = measureThumb.explicitMinWidth;\n\t\t\t\tthis._thumbExplicitMinHeight = measureThumb.explicitMinHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//this is a regular display object, and we'll treat its\n\t\t\t\t//measurements as explicit when we auto-size the scroll bar\n\t\t\t\tthis._thumbExplicitWidth = this.thumb.width;\n\t\t\t\tthis._thumbExplicitHeight = this.thumb.height;\n\t\t\t\tthis._thumbExplicitMinWidth = this._thumbExplicitWidth;\n\t\t\t\tthis._thumbExplicitMinHeight = this._thumbExplicitHeight;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshThumbStyles():void\n\t\t{\n\t\t\tfor(var propertyName:String in this._thumbProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._thumbProperties[propertyName];\n\t\t\t\tthis.thumb[propertyName] = propertyValue;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshEnabled():void\n\t\t{\n\t\t\tif(this.thumb is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this.thumb).isEnabled = this._isEnabled && this._maximum > this._minimum;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layout():void\n\t\t{\n\t\t\tthis.track.width = this.actualWidth;\n\t\t\tthis.track.height = this.actualHeight;\n\n\t\t\tvar range:Number = this._maximum - this._minimum;\n\t\t\tthis.thumb.visible = range > 0;\n\t\t\tif(!this.thumb.visible)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//this will auto-size the thumb, if needed\n\t\t\tif(this.thumb is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.thumb).validate();\n\t\t\t}\n\n\t\t\tvar contentWidth:Number = this.actualWidth - this._paddingLeft - this._paddingRight;\n\t\t\tvar contentHeight:Number = this.actualHeight - this._paddingTop - this._paddingBottom;\n\t\t\tvar adjustedPage:Number = this._page;\n\t\t\tif(this._page == 0)\n\t\t\t{\n\t\t\t\tadjustedPage = this._step;\n\t\t\t}\n\t\t\telse if(adjustedPage > range)\n\t\t\t{\n\t\t\t\tadjustedPage = range;\n\t\t\t}\n\t\t\tvar valueOffset:Number = 0;\n\t\t\tif(this._value < this._minimum)\n\t\t\t{\n\t\t\t\tvalueOffset = (this._minimum - this._value);\n\t\t\t}\n\t\t\tif(this._value > this._maximum)\n\t\t\t{\n\t\t\t\tvalueOffset = (this._value - this._maximum);\n\t\t\t}\n\t\t\tif(this._direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tthis.thumb.width = contentWidth;\n\t\t\t\tvar thumbMinHeight:Number = this._thumbExplicitMinHeight;\n\t\t\t\tif(this.thumb is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tthumbMinHeight = IMeasureDisplayObject(this.thumb).minHeight;\n\t\t\t\t}\n\t\t\t\tif(this._fixedThumbSize)\n\t\t\t\t{\n\t\t\t\t\tthis.thumb.height = this._thumbExplicitHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar thumbHeight:Number = contentHeight * adjustedPage / range;\n\t\t\t\t\tvar heightOffset:Number = contentHeight - thumbHeight;\n\t\t\t\t\tif(heightOffset > thumbHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\theightOffset = thumbHeight;\n\t\t\t\t\t}\n\t\t\t\t\theightOffset *= valueOffset / (range * thumbHeight / contentHeight);\n\t\t\t\t\tthumbHeight -= heightOffset;\n\t\t\t\t\tif(thumbHeight < thumbMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tthumbHeight = thumbMinHeight;\n\t\t\t\t\t}\n\t\t\t\t\tthis.thumb.height = thumbHeight;\n\t\t\t\t}\n\t\t\t\tthis.thumb.x = this._paddingLeft + (this.actualWidth - this._paddingLeft - this._paddingRight - this.thumb.width) / 2;\n\t\t\t\tvar trackScrollableHeight:Number = contentHeight - this.thumb.height;\n\t\t\t\tvar thumbY:Number = trackScrollableHeight * (this._value - this._minimum) / range;\n\t\t\t\tif(thumbY > trackScrollableHeight)\n\t\t\t\t{\n\t\t\t\t\tthumbY = trackScrollableHeight;\n\t\t\t\t}\n\t\t\t\telse if(thumbY < 0)\n\t\t\t\t{\n\t\t\t\t\tthumbY = 0;\n\t\t\t\t}\n\t\t\t\tthis.thumb.y = this._paddingTop + thumbY;\n\t\t\t}\n\t\t\telse //horizontal\n\t\t\t{\n\t\t\t\tvar thumbMinWidth:Number = this._thumbExplicitMinWidth;\n\t\t\t\tif(this.thumb is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tthumbMinWidth = IMeasureDisplayObject(this.thumb).minWidth;\n\t\t\t\t}\n\t\t\t\tif(this._fixedThumbSize)\n\t\t\t\t{\n\t\t\t\t\tthis.thumb.width = this._thumbExplicitWidth;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar thumbWidth:Number = contentWidth * adjustedPage / range;\n\t\t\t\t\tvar widthOffset:Number = contentWidth - thumbWidth;\n\t\t\t\t\tif(widthOffset > thumbWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\twidthOffset = thumbWidth;\n\t\t\t\t\t}\n\t\t\t\t\twidthOffset *= valueOffset / (range * thumbWidth / contentWidth);\n\t\t\t\t\tthumbWidth -= widthOffset;\n\t\t\t\t\tif(thumbWidth < thumbMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tthumbWidth = thumbMinWidth;\n\t\t\t\t\t}\n\t\t\t\t\tthis.thumb.width = thumbWidth;\n\t\t\t\t}\n\t\t\t\tthis.thumb.height = contentHeight;\n\t\t\t\tvar trackScrollableWidth:Number = contentWidth - this.thumb.width;\n\t\t\t\tvar thumbX:Number = trackScrollableWidth * (this._value - this._minimum) / range;\n\t\t\t\tif(thumbX > trackScrollableWidth)\n\t\t\t\t{\n\t\t\t\t\tthumbX = trackScrollableWidth;\n\t\t\t\t}\n\t\t\t\telse if(thumbX < 0)\n\t\t\t\t{\n\t\t\t\t\tthumbX = 0;\n\t\t\t\t}\n\t\t\t\tthis.thumb.x = this._paddingLeft + thumbX;\n\t\t\t\tthis.thumb.y = this._paddingTop + (this.actualHeight - this._paddingTop - this._paddingBottom - this.thumb.height) / 2;\n\t\t\t}\n\n\t\t\t//final validation to avoid juggler next frame issues\n\t\t\tif(this.thumb is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.thumb).validate();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function locationToValue(location:Point):Number\n\t\t{\n\t\t\tvar percentage:Number = 0;\n\t\t\tif(this._direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tvar trackScrollableHeight:Number = this.actualHeight - this.thumb.height - this._paddingTop - this._paddingBottom;\n\t\t\t\tif(trackScrollableHeight > 0)\n\t\t\t\t{\n\t\t\t\t\tvar yOffset:Number = location.y - this._touchStartY - this._paddingTop;\n\t\t\t\t\tvar yPosition:Number = Math.min(Math.max(0, this._thumbStartY + yOffset), trackScrollableHeight);\n\t\t\t\t\tpercentage = yPosition / trackScrollableHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //horizontal\n\t\t\t{\n\t\t\t\tvar trackScrollableWidth:Number = this.actualWidth - this.thumb.width - this._paddingLeft - this._paddingRight;\n\t\t\t\tif(trackScrollableWidth > 0)\n\t\t\t\t{\n\t\t\t\t\tvar xOffset:Number = location.x - this._touchStartX - this._paddingLeft;\n\t\t\t\t\tvar xPosition:Number = Math.min(Math.max(0, this._thumbStartX + xOffset), trackScrollableWidth);\n\t\t\t\t\tpercentage = xPosition / trackScrollableWidth;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this._minimum + percentage * (this._maximum - this._minimum);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function adjustPage():void\n\t\t{\n\t\t\tvar range:Number = this._maximum - this._minimum;\n\t\t\tvar adjustedPage:Number = this._page;\n\t\t\tif(adjustedPage == 0)\n\t\t\t{\n\t\t\t\tadjustedPage = this._step;\n\t\t\t}\n\t\t\tif(adjustedPage > range)\n\t\t\t{\n\t\t\t\tadjustedPage = range;\n\t\t\t}\n\t\t\tif(this._touchValue < this._pageStartValue)\n\t\t\t{\n\t\t\t\tvar newValue:Number = Math.max(this._touchValue, this._value - adjustedPage);\n\t\t\t\tif(this._step != 0 && newValue != this._maximum && newValue != this._minimum)\n\t\t\t\t{\n\t\t\t\t\tnewValue = roundDownToNearest(newValue, this._step);\n\t\t\t\t}\n\t\t\t\tnewValue = clamp(newValue, this._minimum, this._maximum);\n\t\t\t\tthis.value = newValue;\n\t\t\t}\n\t\t\telse if(this._touchValue > this._pageStartValue)\n\t\t\t{\n\t\t\t\tnewValue = Math.min(this._touchValue, this._value + adjustedPage);\n\t\t\t\tif(this._step != 0 && newValue != this._maximum && newValue != this._minimum)\n\t\t\t\t{\n\t\t\t\t\tnewValue = roundUpToNearest(newValue, this._step);\n\t\t\t\t}\n\t\t\t\tnewValue = clamp(newValue, this._minimum, this._maximum);\n\t\t\t\tthis.value = newValue;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function startRepeatTimer(action:Function):void\n\t\t{\n\t\t\tthis.currentRepeatAction = action;\n\t\t\tif(this._repeatDelay > 0)\n\t\t\t{\n\t\t\t\tif(!this._repeatTimer)\n\t\t\t\t{\n\t\t\t\t\tthis._repeatTimer = new Timer(this._repeatDelay * 1000);\n\t\t\t\t\tthis._repeatTimer.addEventListener(TimerEvent.TIMER, repeatTimer_timerHandler);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._repeatTimer.reset();\n\t\t\t\t\tthis._repeatTimer.delay = this._repeatDelay * 1000;\n\t\t\t\t}\n\t\t\t\tthis._repeatTimer.start();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function thumbProperties_onChange(proxy:PropertyProxy, name:Object):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tthis._touchPointID = -1;\n\t\t\tif(this._repeatTimer)\n\t\t\t{\n\t\t\t\tthis._repeatTimer.stop();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function track_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this._touchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(track, null, this._touchPointID);\n\t\t\t\tif(touch === null)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(touch.phase === TouchPhase.MOVED)\n\t\t\t\t{\n\t\t\t\t\tvar location:Point = touch.getLocation(this, Pool.getPoint());\n\t\t\t\t\tthis._touchValue = this.locationToValue(location);\n\t\t\t\t\tPool.putPoint(location);\n\t\t\t\t}\n\t\t\t\telse if(touch.phase === TouchPhase.ENDED)\n\t\t\t\t{\n\t\t\t\t\tthis._touchPointID = -1;\n\t\t\t\t\tthis._repeatTimer.stop();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(this.track, TouchPhase.BEGAN);\n\t\t\t\tif(touch === null)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._touchPointID = touch.id;\n\t\t\t\tlocation = touch.getLocation(this, Pool.getPoint());\n\t\t\t\tthis._touchStartX = location.x;\n\t\t\t\tthis._touchStartY = location.y;\n\t\t\t\tthis._thumbStartX = this._touchStartX;\n\t\t\t\tthis._thumbStartY = this._touchStartY;\n\t\t\t\tthis._touchValue = this.locationToValue(location);\n\t\t\t\tPool.putPoint(location);\n\t\t\t\tthis._pageStartValue = this._value;\n\t\t\t\tthis.adjustPage();\n\t\t\t\tthis.startRepeatTimer(this.adjustPage);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function thumb_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this._touchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(this.thumb, null, this._touchPointID);\n\t\t\t\tif(touch === null)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(touch.phase === TouchPhase.MOVED)\n\t\t\t\t{\n\t\t\t\t\tvar location:Point = touch.getLocation(this, Pool.getPoint());\n\t\t\t\t\tvar newValue:Number = this.locationToValue(location);\n\t\t\t\t\tPool.putPoint(location);\n\t\t\t\t\tif(this._step != 0 && newValue != this._maximum && newValue != this._minimum)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewValue = roundToNearest(newValue, this._step);\n\t\t\t\t\t}\n\t\t\t\t\tthis.value = newValue;\n\t\t\t\t}\n\t\t\t\telse if(touch.phase === TouchPhase.ENDED)\n\t\t\t\t{\n\t\t\t\t\tthis._touchPointID = -1;\n\t\t\t\t\tthis.isDragging = false;\n\t\t\t\t\tif(!this.liveDragging)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\t}\n\t\t\t\t\tthis.dispatchEventWith(FeathersEventType.END_INTERACTION);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(this.thumb, TouchPhase.BEGAN);\n\t\t\t\tif(touch === null)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlocation = touch.getLocation(this, Pool.getPoint());\n\t\t\t\tthis._touchPointID = touch.id;\n\t\t\t\tthis._thumbStartX = this.thumb.x;\n\t\t\t\tthis._thumbStartY = this.thumb.y;\n\t\t\t\tthis._touchStartX = location.x;\n\t\t\t\tthis._touchStartY = location.y;\n\t\t\t\tPool.putPoint(location);\n\t\t\t\tthis.isDragging = true;\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.BEGIN_INTERACTION);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function repeatTimer_timerHandler(event:TimerEvent):void\n\t\t{\n\t\t\tif(this._repeatTimer.currentCount < 5)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.currentRepeatAction();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/Slider.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IFocusDisplayObject;\n\timport feathers.core.IMeasureDisplayObject;\n\timport feathers.core.IValidating;\n\timport feathers.core.PropertyProxy;\n\timport feathers.events.ExclusiveTouch;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.Direction;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.utils.math.clamp;\n\timport feathers.utils.math.roundDownToNearest;\n\timport feathers.utils.math.roundToNearest;\n\timport feathers.utils.math.roundUpToNearest;\n\n\timport flash.events.TimerEvent;\n\timport flash.geom.Point;\n\timport flash.ui.Keyboard;\n\timport flash.utils.Timer;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.events.KeyboardEvent;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.utils.Pool;\n\n\t/**\n\t * A style name to add to the slider's maximum track sub-component.\n\t * Typically used by a theme to provide different skins to different\n\t * sliders.\n\t *\n\t * <p>In the following example, a custom maximum track style name is\n\t * passed to the slider:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * slider.customMaximumTrackStyleName = \"my-custom-maximum-track\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( Button ).setFunctionForStyleName( \"my-custom-maximum-track\", setCustomMaximumTrackStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_MAXIMUM_TRACK\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #maximumTrackFactory\n\t */\n\t[Style(name=\"customMaximumTrackStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to the slider's minimum track sub-component.\n\t * Typically used by a theme to provide different styles to different\n\t * sliders.\n\t *\n\t * <p>In the following example, a custom minimum track style name is\n\t * passed to the slider:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * slider.customMinimumTrackStyleName = \"my-custom-minimum-track\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( Button ).setFunctionForStyleName( \"my-custom-minimum-track\", setCustomMinimumTrackStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_MINIMUM_TRACK\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #minimumTrackFactory\n\t */\n\t[Style(name=\"customMinimumTrackStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to the slider's thumb sub-component. Typically\n\t * used by a theme to provide different styles to different sliders.\n\t *\n\t * <p>In the following example, a custom thumb style name is passed\n\t * to the slider:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * slider.customThumbStyleName = \"my-custom-thumb\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( Button ).setFunctionForStyleName( \"my-custom-thumb\", setCustomThumbStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_THUMB\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #thumbFactory\n\t */\n\t[Style(name=\"customThumbStyleName\",type=\"String\")]\n\n\t/**\n\t * Determines if the slider's thumb can be dragged horizontally or\n\t * vertically. When this value changes, the slider's width and height\n\t * values do not change automatically.\n\t *\n\t * <p>In the following example, the direction is changed to vertical:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * slider.direction = Direction.VERTICAL;</listing>\n\t *\n\t * <p><strong>Note:</strong> The <code>Direction.NONE</code>\n\t * constant is not supported.</p>\n\t *\n\t * @default feathers.layout.Direction.HORIZONTAL\n\t *\n\t * @see feathers.layout.Direction#HORIZONTAL\n\t * @see feathers.layout.Direction#VERTICAL\n\t */\n\t[Style(name=\"direction\",type=\"String\")]\n\n\t/**\n\t * The space, in pixels, between the maximum position of the thumb and\n\t * the maximum edge of the track. May be negative to extend the range\n\t * of the thumb.\n\t *\n\t * <p>In the following example, maximum padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * slider.maximumPadding = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:minimumPadding\n\t */\n\t[Style(name=\"maximumPadding\",type=\"Number\")]\n\n\t/**\n\t * The space, in pixels, between the minimum position of the thumb and\n\t * the minimum edge of the track. May be negative to extend the range of\n\t * the thumb.\n\t *\n\t * <p>In the following example, minimum padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * slider.minimumPadding = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:maximumPadding\n\t */\n\t[Style(name=\"minimumPadding\",type=\"Number\")]\n\n\t/**\n\t * Determines if the thumb should be displayed.\n\t *\n\t * <p>In the following example, the thumb is hidden:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * slider.showThumb = false;</listing>\n\t *\n\t * @default true\n\t */\n\t[Style(name=\"showThumb\",type=\"Boolean\")]\n\n\t/**\n\t * Offsets the position of the thumb by a certain number of pixels in a\n\t * direction perpendicular to the track. This does not affect the\n\t * measurement of the slider. The slider will measure itself as if the\n\t * thumb were not offset from its original position.\n\t *\n\t * <p>In the following example, the thumb is offset by 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * slider.thumbOffset = 20;</listing>\n\t *\n\t * @default 0\n\t */\n\t[Style(name=\"thumbOffset\",type=\"Number\")]\n\n\t/**\n\t * Determines how the slider's value changes when the track is touched.\n\t *\n\t * <p>If <code>showThumb</code> is set to <code>false</code>, the slider\n\t * will always behave as if <code>trackInteractionMode</code> has been\n\t * set to <code>TrackInteractionMode.TO_VALUE</code>. In other\n\t * words, the value of <code>trackInteractionMode</code> may be ignored\n\t * if the thumb is hidden.</p>\n\t *\n\t * <p>In the following example, the slider's track interaction is changed:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * slider.trackScaleMode = TrackInteractionMode.BY_PAGE;</listing>\n\t *\n\t * @default TrackInteractionMode.TO_VALUE\n\t *\n\t * @see feathers.controls.TrackInteractionMode#TO_VALUE\n\t * @see feathers.controls.TrackInteractionMode#BY_PAGE\n\t * @see #page\n\t */\n\t[Style(name=\"trackInteractionMode\",type=\"String\")]\n\n\t/**\n\t * Determines how the minimum and maximum track skins are positioned and\n\t * sized.\n\t *\n\t * <p>In the following example, the slider is given two tracks:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * slider.trackLayoutMode = TrackLayoutMode.SPLIT;</listing>\n\t *\n\t * @default feathers.controls.TrackLayoutMode.SINGLE\n\t *\n\t * @see feathers.controls.TrackLayoutMode#SINGLE\n\t * @see feathers.controls.TrackLayoutMode#SPLIT\n\t * @see #style:trackScaleMode\n\t */\n\t[Style(name=\"trackLayoutMode\",type=\"String\")]\n\n\t/**\n\t * Determines how the minimum and maximum track skins are positioned and\n\t * sized.\n\t *\n\t * <p>In the following example, the slider's track layout is customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * slider.trackScaleMode = TrackScaleMode.EXACT_FIT;</listing>\n\t *\n\t * @default feathers.controls.TrackScaleMode.DIRECTIONAL\n\t *\n\t * @see feathers.controls.TrackScaleMode#DIRECTIONAL\n\t * @see feathers.controls.TrackScaleMode#EXACT_FIT\n\t * @see #style:trackLayoutMode\n\t */\n\t[Style(name=\"trackScaleMode\",type=\"String\")]\n\n\t/**\n\t * Dispatched when the slider's value changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #value\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the user starts dragging the slider's thumb or track.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.BEGIN_INTERACTION\n\t */\n\t[Event(name=\"beginInteraction\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the user stops dragging the slider's thumb or track.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.END_INTERACTION\n\t */\n\t[Event(name=\"endInteraction\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Select a value between a minimum and a maximum by dragging a thumb over\n\t * the bounds of a track. The slider's track is divided into two parts split\n\t * by the thumb.\n\t *\n\t * <p>The following example sets the slider's range and listens for when the\n\t * value changes:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var slider:Slider = new Slider();\n\t * slider.minimum = 0;\n\t * slider.maximum = 100;\n\t * slider.step = 1;\n\t * slider.page = 10;\n\t * slider.value = 12;\n\t * slider.addEventListener( Event.CHANGE, slider_changeHandler );\n\t * this.addChild( slider );</listing>\n\t *\n\t * @see ../../../help/slider.html How to use the Feathers Slider component\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class Slider extends FeathersControl implements IDirectionalScrollBar, IFocusDisplayObject\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_THUMB_FACTORY:String = \"thumbFactory\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_MINIMUM_TRACK_FACTORY:String = \"minimumTrackFactory\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_MAXIMUM_TRACK_FACTORY:String = \"maximumTrackFactory\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the\n\t\t * minimum track.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_MINIMUM_TRACK:String = \"feathers-slider-minimum-track\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the\n\t\t * maximum track.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_MAXIMUM_TRACK:String = \"feathers-slider-maximum-track\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the thumb.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_THUMB:String = \"feathers-slider-thumb\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>Slider</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultThumbFactory():BasicButton\n\t\t{\n\t\t\treturn new Button();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultMinimumTrackFactory():BasicButton\n\t\t{\n\t\t\treturn new Button();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultMaximumTrackFactory():BasicButton\n\t\t{\n\t\t\treturn new Button();\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function Slider()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.addEventListener(Event.REMOVED_FROM_STAGE, slider_removedFromStageHandler);\n\t\t}\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the minimum\n\t\t * track. This variable is <code>protected</code> so that sub-classes\n\t\t * can customize the minimum track style name in their constructors\n\t\t * instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_MINIMUM_TRACK</code>.\n\t\t *\n\t\t * <p>To customize the minimum track style name without subclassing, see\n\t\t * <code>customMinimumTrackStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customMinimumTrackStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var minimumTrackStyleName:String = DEFAULT_CHILD_STYLE_NAME_MINIMUM_TRACK;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the maximum\n\t\t * track. This variable is <code>protected</code> so that sub-classes\n\t\t * can customize the maximum track style name in their constructors\n\t\t * instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_MAXIMUM_TRACK</code>.\n\t\t *\n\t\t * <p>To customize the maximum track style name without subclassing, see\n\t\t * <code>customMaximumTrackStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customMaximumTrackStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var maximumTrackStyleName:String = DEFAULT_CHILD_STYLE_NAME_MAXIMUM_TRACK;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the thumb. This\n\t\t * variable is <code>protected</code> so that sub-classes can customize\n\t\t * the thumb style name in their constructors instead of using the\n\t\t * default style name defined by <code>DEFAULT_CHILD_STYLE_NAME_THUMB</code>.\n\t\t *\n\t\t * <p>To customize the thumb style name without subclassing, see\n\t\t * <code>customThumbStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customThumbStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var thumbStyleName:String = DEFAULT_CHILD_STYLE_NAME_THUMB;\n\n\t\t/**\n\t\t * The thumb sub-component.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t *\n\t\t * @see #thumbFactory\n\t\t * @see #createThumb()\n\t\t */\n\t\tprotected var thumb:DisplayObject;\n\n\t\t/**\n\t\t * The minimum track sub-component.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t *\n\t\t * @see #minimumTrackFactory\n\t\t * @see #createMinimumTrack()\n\t\t */\n\t\tprotected var minimumTrack:DisplayObject;\n\n\t\t/**\n\t\t * The maximum track sub-component.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t *\n\t\t * @see #maximumTrackFactory\n\t\t * @see #createMaximumTrack()\n\t\t */\n\t\tprotected var maximumTrack:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimumTrackSkinExplicitWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimumTrackSkinExplicitHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimumTrackSkinExplicitMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimumTrackSkinExplicitMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maximumTrackSkinExplicitWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maximumTrackSkinExplicitHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maximumTrackSkinExplicitMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maximumTrackSkinExplicitMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn Slider.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _direction:String = Direction.HORIZONTAL;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"horizontal,vertical\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get direction():String\n\t\t{\n\t\t\treturn this._direction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set direction(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._direction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._direction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_MINIMUM_TRACK_FACTORY);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_MAXIMUM_TRACK_FACTORY);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_THUMB_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _value:Number = 0;\n\n\t\t/**\n\t\t * The value of the slider, between the minimum and maximum.\n\t\t *\n\t\t * <p>In the following example, the value is changed to 12:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * slider.minimum = 0;\n\t\t * slider.maximum = 100;\n\t\t * slider.step = 1;\n\t\t * slider.page = 10\n\t\t * slider.value = 12;</listing>\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #minimum\n\t\t * @see #maximum\n\t\t * @see #step\n\t\t * @see #page\n\t\t */\n\t\tpublic function get value():Number\n\t\t{\n\t\t\treturn this._value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set value(newValue:Number):void\n\t\t{\n\t\t\tif(this._step != 0 && newValue != this._maximum && newValue != this._minimum)\n\t\t\t{\n\t\t\t\tnewValue = roundToNearest(newValue - this._minimum, this._step) + this._minimum;\n\t\t\t}\n\t\t\tnewValue = clamp(newValue, this._minimum, this._maximum);\n\t\t\tif(this._value == newValue)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._value = newValue;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\tif(this.liveDragging || !this.isDragging)\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimum:Number = 0;\n\n\t\t/**\n\t\t * The slider's value will not go lower than the minimum.\n\t\t *\n\t\t * <p>In the following example, the minimum is set to 0:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * slider.minimum = 0;\n\t\t * slider.maximum = 100;\n\t\t * slider.step = 1;\n\t\t * slider.page = 10\n\t\t * slider.value = 12;</listing>\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #value\n\t\t * @see #maximum\n\t\t */\n\t\tpublic function get minimum():Number\n\t\t{\n\t\t\treturn this._minimum;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minimum(value:Number):void\n\t\t{\n\t\t\tif(this._minimum == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._minimum = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maximum:Number = 0;\n\n\t\t/**\n\t\t * The slider's value will not go higher than the maximum. The maximum\n\t\t * is zero (<code>0</code>), by default, and it should almost always be\n\t\t * changed to something more appropriate.\n\t\t *\n\t\t * <p>In the following example, the maximum is set to 100:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * slider.minimum = 0;\n\t\t * slider.maximum = 100;\n\t\t * slider.step = 1;\n\t\t * slider.page = 10\n\t\t * slider.value = 12;</listing>\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #value\n\t\t * @see #minimum\n\t\t */\n\t\tpublic function get maximum():Number\n\t\t{\n\t\t\treturn this._maximum;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maximum(value:Number):void\n\t\t{\n\t\t\tif(this._maximum == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._maximum = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _step:Number = 0;\n\n\t\t/**\n\t\t * As the slider's thumb is dragged, the value is snapped to a multiple\n\t\t * of the step. Paging using the slider's track will use the <code>step</code>\n\t\t * value if the <code>page</code> value is <code>NaN</code>. If the\n\t\t * <code>step</code> is zero (<code>0</code>), paging with the track will not be possible.\n\t\t *\n\t\t * <p>In the following example, the step is changed to 1:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * slider.minimum = 0;\n\t\t * slider.maximum = 100;\n\t\t * slider.step = 1;\n\t\t * slider.page = 10;\n\t\t * slider.value = 10;</listing>\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #value\n\t\t * @see #page\n\t\t */\n\t\tpublic function get step():Number\n\t\t{\n\t\t\treturn this._step;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set step(value:Number):void\n\t\t{\n\t\t\tif(this._step == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._step = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _page:Number = NaN;\n\n\t\t/**\n\t\t * If the <code>trackInteractionMode</code> property is set to\n\t\t * <code>TrackInteractionMode.BY_PAGE</code>, and the slider's\n\t\t * track is touched, and the thumb is shown, the slider value will be\n\t\t * incremented or decremented by the page value. If the\n\t\t * <code>trackInteractionMode</code> property is set to\n\t\t * <code>TrackInteractionMode.TO_VALUE</code>, this property will be\n\t\t * ignored.\n\t\t *\n\t\t * <p>If this value is <code>NaN</code>, the <code>step</code> value\n\t\t * will be used instead. If the <code>step</code> value is zero, paging\n\t\t * with the track is not possible.</p>\n\t\t *\n\t\t * <p>In the following example, the page is changed to 10:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * slider.minimum = 0;\n\t\t * slider.maximum = 100;\n\t\t * slider.step = 1;\n\t\t * slider.page = 10\n\t\t * slider.value = 12;</listing>\n\t\t *\n\t\t * @default NaN\n\t\t *\n\t\t * @see #value\n\t\t * @see #page\n\t\t * @see #style:trackInteractionMode\n\t\t */\n\t\tpublic function get page():Number\n\t\t{\n\t\t\treturn this._page;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set page(value:Number):void\n\t\t{\n\t\t\tif(this._page == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._page = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var isDragging:Boolean = false;\n\n\t\t/**\n\t\t * Determines if the slider dispatches the <code>Event.CHANGE</code>\n\t\t * event every time the thumb moves, or only once it stops moving.\n\t\t *\n\t\t * <p>In the following example, live dragging is disabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * slider.liveDragging = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic var liveDragging:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _showThumb:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get showThumb():Boolean\n\t\t{\n\t\t\treturn this._showThumb;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set showThumb(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._showThumb === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._showThumb = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _thumbOffset:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get thumbOffset():Number\n\t\t{\n\t\t\treturn this._thumbOffset;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set thumbOffset(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._thumbOffset == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._thumbOffset = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimumPadding:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get minimumPadding():Number\n\t\t{\n\t\t\treturn this._minimumPadding;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minimumPadding(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._minimumPadding == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._minimumPadding = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maximumPadding:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get maximumPadding():Number\n\t\t{\n\t\t\treturn this._maximumPadding;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maximumPadding(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._maximumPadding == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._maximumPadding = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _trackLayoutMode:String = TrackLayoutMode.SINGLE;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"single,split\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get trackLayoutMode():String\n\t\t{\n\t\t\treturn this._trackLayoutMode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set trackLayoutMode(value:String):void\n\t\t{\n\t\t\tif(value === \"minMax\")\n\t\t\t{\n\t\t\t\tvalue = TrackLayoutMode.SPLIT;\n\t\t\t}\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._trackLayoutMode === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._trackLayoutMode = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _trackScaleMode:String = TrackScaleMode.DIRECTIONAL;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"exactFit,directional\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get trackScaleMode():String\n\t\t{\n\t\t\treturn this._trackScaleMode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set trackScaleMode(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._trackScaleMode === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._trackScaleMode = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _trackInteractionMode:String = TrackInteractionMode.TO_VALUE;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"toValue,byPage\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get trackInteractionMode():String\n\t\t{\n\t\t\treturn this._trackInteractionMode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set trackInteractionMode(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._trackInteractionMode = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var currentRepeatAction:Function;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _repeatTimer:Timer;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _repeatDelay:Number = 0.05;\n\n\t\t/**\n\t\t * The time, in seconds, before actions are repeated. The first repeat\n\t\t * happens after a delay that is five times longer than the following\n\t\t * repeats.\n\t\t *\n\t\t * <p>In the following example, the slider's repeat delay is set to\n\t\t * 500 milliseconds:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * slider.repeatDelay = 0.5;</listing>\n\t\t *\n\t\t * @default 0.05\n\t\t */\n\t\tpublic function get repeatDelay():Number\n\t\t{\n\t\t\treturn this._repeatDelay;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set repeatDelay(value:Number):void\n\t\t{\n\t\t\tif(this._repeatDelay == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._repeatDelay = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimumTrackFactory:Function;\n\n\t\t/**\n\t\t * A function used to generate the slider's minimum track sub-component.\n\t\t * The minimum track must be an instance of <code>BasicButton</code> (or\n\t\t * a subclass). This factory can be used to change properties on the\n\t\t * minimum track when it is first created. For instance, if you are\n\t\t * skinning Feathers components without a theme, you might use this\n\t\t * factory to set skins and other styles on the minimum track.\n\t\t *\n\t\t * <p>The function should have the following signature:</p>\n\t\t * <pre>function():BasicButton</pre>\n\t\t *\n\t\t * <p>In the following example, a custom minimum track factory is passed\n\t\t * to the slider:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * slider.minimumTrackFactory = function():BasicButton\n\t\t * {\n\t\t *     var track:BasicButton = new BasicButton();\n\t\t *     var skin:ImageSkin = new ImageSkin( upTexture );\n\t\t *     skin.setTextureForState( ButtonState.DOWN, downTexture );\n\t\t *     track.defaultSkin = skin;\n\t\t *     return track;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.BasicButton\n\t\t */\n\t\tpublic function get minimumTrackFactory():Function\n\t\t{\n\t\t\treturn this._minimumTrackFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minimumTrackFactory(value:Function):void\n\t\t{\n\t\t\tif(this._minimumTrackFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._minimumTrackFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_MINIMUM_TRACK_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customMinimumTrackStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customMinimumTrackStyleName():String\n\t\t{\n\t\t\treturn this._customMinimumTrackStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customMinimumTrackStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customMinimumTrackStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customMinimumTrackStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_MINIMUM_TRACK_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimumTrackProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the slider's \"minimum\" track,\n\t\t * and the properties will be passed down to the \"minimum\" track when\n\t\t * the slider validates. For a list of available properties, refer to\n\t\t * <a href=\"BasicButton.html\"><code>feathers.controls.BasicButton</code></a>.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>minimumTrackFactory</code> function\n\t\t * instead of using <code>minimumTrackProperties</code> will result in\n\t\t * better performance.</p>\n\t\t *\n\t\t * <p>In the following example, the slider's minimum track properties\n\t\t * are updated:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * slider.minimumTrackProperties.defaultSkin = new Image( upTexture );\n\t\t * slider.minimumTrackProperties.downSkin = new Image( downTexture );</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #minimumTrackFactory\n\t\t * @see feathers.controls.BasicButton\n\t\t */\n\t\tpublic function get minimumTrackProperties():Object\n\t\t{\n\t\t\tif(!this._minimumTrackProperties)\n\t\t\t{\n\t\t\t\tthis._minimumTrackProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._minimumTrackProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minimumTrackProperties(value:Object):void\n\t\t{\n\t\t\tif(this._minimumTrackProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._minimumTrackProperties)\n\t\t\t{\n\t\t\t\tthis._minimumTrackProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._minimumTrackProperties = PropertyProxy(value);\n\t\t\tif(this._minimumTrackProperties)\n\t\t\t{\n\t\t\t\tthis._minimumTrackProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maximumTrackFactory:Function;\n\n\t\t/**\n\t\t * A function used to generate the slider's maximum track sub-component.\n\t\t * The maximum track must be an instance of <code>BasicButton</code> (or\n\t\t * a subclass). This factory can be used to change properties on the\n\t\t * maximum track when it is first created. For instance, if you are\n\t\t * skinning Feathers components without a theme, you might use this\n\t\t * factory to set skins and other styles on the maximum track.\n\t\t *\n\t\t * <p>The function should have the following signature:</p>\n\t\t * <pre>function():BasicButton</pre>\n\t\t *\n\t\t * <p>In the following example, a custom maximum track factory is passed\n\t\t * to the slider:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * slider.maximumTrackFactory = function():BasicButton\n\t\t * {\n\t\t *     var track:BasicButton = new BasicButton();\n\t\t *     var skin:ImageSkin = new ImageSkin( upTexture );\n\t\t *     skin.setTextureForState( ButtonState.DOWN, downTexture );\n\t\t *     track.defaultSkin = skin;\n\t\t *     return track;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.BasicButton\n\t\t */\n\t\tpublic function get maximumTrackFactory():Function\n\t\t{\n\t\t\treturn this._maximumTrackFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maximumTrackFactory(value:Function):void\n\t\t{\n\t\t\tif(this._maximumTrackFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._maximumTrackFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_MAXIMUM_TRACK_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customMaximumTrackStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customMaximumTrackStyleName():String\n\t\t{\n\t\t\treturn this._customMaximumTrackStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customMaximumTrackStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customMaximumTrackStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customMaximumTrackStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_MAXIMUM_TRACK_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maximumTrackProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the slider's \"maximum\" track,\n\t\t * and the properties will be passed down to the \"maximum\" track when\n\t\t * the slider validates. For a list of available properties, refer to\n\t\t * <a href=\"BasicButton.html\"><code>feathers.controls.BasicButton</code></a>.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>maximumTrackFactory</code> function\n\t\t * instead of using <code>maximumTrackProperties</code> will result in\n\t\t * better performance.</p>\n\t\t *\n\t\t * <p>In the following example, the slider's maximum track properties\n\t\t * are updated:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * slider.maximumTrackProperties.defaultSkin = new Image( upTexture );\n\t\t * slider.maximumTrackProperties.downSkin = new Image( downTexture );</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #maximumTrackFactory\n\t\t * @see feathers.controls.BasicButton\n\t\t */\n\t\tpublic function get maximumTrackProperties():Object\n\t\t{\n\t\t\tif(!this._maximumTrackProperties)\n\t\t\t{\n\t\t\t\tthis._maximumTrackProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._maximumTrackProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maximumTrackProperties(value:Object):void\n\t\t{\n\t\t\tif(this._maximumTrackProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._maximumTrackProperties)\n\t\t\t{\n\t\t\t\tthis._maximumTrackProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._maximumTrackProperties = PropertyProxy(value);\n\t\t\tif(this._maximumTrackProperties)\n\t\t\t{\n\t\t\t\tthis._maximumTrackProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _thumbFactory:Function;\n\n\t\t/**\n\t\t * A function used to generate the slider's thumb sub-component.\n\t\t * The thumb must be an instance of <code>BasicButton</code> (or a\n\t\t * subclass). This factory can be used to change properties on the thumb\n\t\t * when it is first created. For instance, if you are skinning Feathers\n\t\t * components without a theme, you might use this factory to set skins\n\t\t * and other styles on the thumb.\n\t\t *\n\t\t * <p>The function should have the following signature:</p>\n\t\t * <pre>function():BasicButton</pre>\n\t\t *\n\t\t * <p>In the following example, a custom thumb factory is passed\n\t\t * to the slider:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * slider.thumbFactory = function():BasicButton\n\t\t * {\n\t\t *     var thumb:BasicButton = new BasicButton();\n\t\t *     var skin:ImageSkin = new ImageSkin( upTexture );\n\t\t *     skin.setTextureForState( ButtonState.DOWN, downTexture );\n\t\t *     thumb.defaultSkin = skin;\n\t\t *     return thumb;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.BasicButton\n\t\t */\n\t\tpublic function get thumbFactory():Function\n\t\t{\n\t\t\treturn this._thumbFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set thumbFactory(value:Function):void\n\t\t{\n\t\t\tif(this._thumbFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._thumbFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_THUMB_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customThumbStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customThumbStyleName():String\n\t\t{\n\t\t\treturn this._customThumbStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customThumbStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customThumbStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customThumbStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_THUMB_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _thumbProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the slider's thumb, and the\n\t\t * properties will be passed down to the thumb when the slider\n\t\t * validates. For a list of available properties, refer to\n\t\t * <a href=\"BasicButton.html\"><code>feathers.controls.BasicButton</code></a>.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>thumbFactory</code> function instead\n\t\t * of using <code>thumbProperties</code> will result in better\n\t\t * performance.</p>\n\t\t *\n\t\t * <p>In the following example, the slider's thumb properties\n\t\t * are updated:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * slider.thumbProperties.defaultSkin = new Image( upTexture );\n\t\t * slider.thumbProperties.downSkin = new Image( downTexture );</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.BasicButton\n\t\t * @see #thumbFactory\n\t\t */\n\t\tpublic function get thumbProperties():Object\n\t\t{\n\t\t\tif(!this._thumbProperties)\n\t\t\t{\n\t\t\t\tthis._thumbProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._thumbProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set thumbProperties(value:Object):void\n\t\t{\n\t\t\tif(this._thumbProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._thumbProperties)\n\t\t\t{\n\t\t\t\tthis._thumbProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._thumbProperties = PropertyProxy(value);\n\t\t\tif(this._thumbProperties)\n\t\t\t{\n\t\t\t\tthis._thumbProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _touchPointID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _touchStartX:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _touchStartY:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _thumbStartX:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _thumbStartY:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _touchValue:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _pageStartValue:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function hitTest(local:Point):DisplayObject\n\t\t{\n\t\t\tvar result:DisplayObject = super.hitTest(local);\n\t\t\tif(result !== null && this._trackInteractionMode === TrackInteractionMode.TO_VALUE)\n\t\t\t{\n\t\t\t\treturn this.thumb;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tif(this._value < this._minimum)\n\t\t\t{\n\t\t\t\tthis.value = this._minimum;\n\t\t\t}\n\t\t\telse if(this._value > this._maximum)\n\t\t\t{\n\t\t\t\tthis.value = this._maximum;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar focusInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_FOCUS);\n\t\t\tvar layoutInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_LAYOUT);\n\t\t\tvar thumbFactoryInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_THUMB_FACTORY);\n\t\t\tvar minimumTrackFactoryInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_MINIMUM_TRACK_FACTORY);\n\t\t\tvar maximumTrackFactoryInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_MAXIMUM_TRACK_FACTORY);\n\n\t\t\tif(thumbFactoryInvalid)\n\t\t\t{\n\t\t\t\tthis.createThumb();\n\t\t\t}\n\n\t\t\tif(minimumTrackFactoryInvalid)\n\t\t\t{\n\t\t\t\tthis.createMinimumTrack();\n\t\t\t}\n\n\t\t\tif(maximumTrackFactoryInvalid || layoutInvalid)\n\t\t\t{\n\t\t\t\tthis.createMaximumTrack();\n\t\t\t}\n\n\t\t\tif(thumbFactoryInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshThumbStyles();\n\t\t\t}\n\t\t\tif(minimumTrackFactoryInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshMinimumTrackStyles();\n\t\t\t}\n\t\t\tif((maximumTrackFactoryInvalid || layoutInvalid || stylesInvalid) && this.maximumTrack)\n\t\t\t{\n\t\t\t\tthis.refreshMaximumTrackStyles();\n\t\t\t}\n\n\t\t\tif(stateInvalid || thumbFactoryInvalid || minimumTrackFactoryInvalid ||\n\t\t\t\tmaximumTrackFactoryInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshEnabled();\n\t\t\t}\n\n\t\t\tsizeInvalid = this.autoSizeIfNeeded() || sizeInvalid;\n\n\t\t\tthis.layoutChildren();\n\n\t\t\tif(sizeInvalid || focusInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshFocusIndicator();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * If the component's dimensions have not been set explicitly, it will\n\t\t * measure its content and determine an ideal size for itself. If the\n\t\t * <code>explicitWidth</code> or <code>explicitHeight</code> member\n\t\t * variables are set, those value will be used without additional\n\t\t * measurement. If one is set, but not the other, the dimension with the\n\t\t * explicit value will not be measured, but the other non-explicit\n\t\t * dimension will still need measurement.\n\t\t *\n\t\t * <p>Calls <code>saveMeasurements()</code> to set up the\n\t\t * <code>actualWidth</code> and <code>actualHeight</code> member\n\t\t * variables used for layout.</p>\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t */\n\t\tprotected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tif(this._direction === Direction.VERTICAL)\n\t\t\t{\n\t\t\t\treturn this.measureVertical();\n\t\t\t}\n\t\t\treturn this.measureHorizontal();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function measureVertical():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar isSingle:Boolean = this._trackLayoutMode === TrackLayoutMode.SINGLE;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tthis.minimumTrack.height = this._minimumTrackSkinExplicitHeight;\n\t\t\t}\n\t\t\telse if(isSingle)\n\t\t\t{\n\t\t\t\tthis.minimumTrack.height = this._explicitHeight;\n\t\t\t}\n\t\t\tif(this.minimumTrack is IMeasureDisplayObject)\n\t\t\t{\n\t\t\t\tvar measureMinTrack:IMeasureDisplayObject = IMeasureDisplayObject(this.minimumTrack);\n\t\t\t\tif(needsMinHeight)\n\t\t\t\t{\n\t\t\t\t\tmeasureMinTrack.minHeight = this._minimumTrackSkinExplicitMinHeight;\n\t\t\t\t}\n\t\t\t\telse if(isSingle)\n\t\t\t\t{\n\t\t\t\t\tvar minTrackMinHeight:Number = this._explicitMinHeight;\n\t\t\t\t\tif(this._minimumTrackSkinExplicitMinHeight > minTrackMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tminTrackMinHeight = this._minimumTrackSkinExplicitMinHeight;\n\t\t\t\t\t}\n\t\t\t\t\tmeasureMinTrack.minHeight = minTrackMinHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!isSingle)\n\t\t\t{\n\t\t\t\tif(needsHeight)\n\t\t\t\t{\n\t\t\t\t\tthis.maximumTrack.height = this._maximumTrackSkinExplicitHeight;\n\t\t\t\t}\n\t\t\t\tif(this.maximumTrack is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar measureMaxTrack:IMeasureDisplayObject = IMeasureDisplayObject(this.maximumTrack);\n\t\t\t\t\tif(needsMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tmeasureMaxTrack.minHeight = this._maximumTrackSkinExplicitMinHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this.minimumTrack is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.minimumTrack).validate();\n\t\t\t}\n\t\t\tif(this.maximumTrack is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.maximumTrack).validate();\n\t\t\t}\n\t\t\tif(this.thumb is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.thumb).validate();\n\t\t\t}\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tnewWidth = this.minimumTrack.width;\n\t\t\t\tif(!isSingle && //split\n\t\t\t\t\tthis.maximumTrack.width > newWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this.maximumTrack.width;\n\t\t\t\t}\n\t\t\t\tif(this.thumb.width > newWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this.thumb.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tnewHeight = this.minimumTrack.height;\n\t\t\t\tif(!isSingle) //split\n\t\t\t\t{\n\t\t\t\t\tif(this.maximumTrack.height > newHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewHeight = this.maximumTrack.height;\n\t\t\t\t\t}\n\t\t\t\t\tnewHeight += this.thumb.height / 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tif(measureMinTrack !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = measureMinTrack.minWidth;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = this.minimumTrack.width;\n\t\t\t\t}\n\t\t\t\tif(!isSingle) //split\n\t\t\t\t{\n\t\t\t\t\tif(measureMaxTrack !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(measureMaxTrack.minWidth > newMinWidth)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinWidth = measureMaxTrack.minWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(this.maximumTrack.width > newMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = this.maximumTrack.width;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this.thumb is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar measureThumb:IMeasureDisplayObject = IMeasureDisplayObject(this.thumb);\n\t\t\t\t\tif(measureThumb.minWidth > newMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = measureThumb.minWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(this.thumb.width > newMinWidth)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = this.thumb.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tif(measureMinTrack !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = measureMinTrack.minHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = this.minimumTrack.height;\n\t\t\t\t}\n\t\t\t\tif(!isSingle) //split\n\t\t\t\t{\n\t\t\t\t\tif(measureMaxTrack !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(measureMaxTrack.minHeight > newMinHeight)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinHeight = measureMaxTrack.minHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = this.maximumTrack.height;\n\t\t\t\t\t}\n\t\t\t\t\tif(this.thumb is IMeasureDisplayObject)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight += IMeasureDisplayObject(this.thumb).minHeight / 2;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight += this.thumb.height / 2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function measureHorizontal():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar isSingle:Boolean = this._trackLayoutMode === TrackLayoutMode.SINGLE;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tthis.minimumTrack.width = this._minimumTrackSkinExplicitWidth;\n\t\t\t}\n\t\t\telse if(isSingle)\n\t\t\t{\n\t\t\t\tthis.minimumTrack.width = this._explicitWidth;\n\t\t\t}\n\t\t\tif(this.minimumTrack is IMeasureDisplayObject)\n\t\t\t{\n\t\t\t\tvar measureMinTrack:IMeasureDisplayObject = IMeasureDisplayObject(this.minimumTrack);\n\t\t\t\tif(needsMinWidth)\n\t\t\t\t{\n\t\t\t\t\tmeasureMinTrack.minWidth = this._minimumTrackSkinExplicitMinWidth;\n\t\t\t\t}\n\t\t\t\telse if(isSingle)\n\t\t\t\t{\n\t\t\t\t\tvar minTrackMinWidth:Number = this._explicitMinWidth;\n\t\t\t\t\tif(this._minimumTrackSkinExplicitMinWidth > minTrackMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tminTrackMinWidth = this._minimumTrackSkinExplicitMinWidth;\n\t\t\t\t\t}\n\t\t\t\t\tmeasureMinTrack.minWidth = minTrackMinWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!isSingle)\n\t\t\t{\n\t\t\t\tif(needsWidth)\n\t\t\t\t{\n\t\t\t\t\tthis.maximumTrack.width = this._maximumTrackSkinExplicitWidth;\n\t\t\t\t}\n\t\t\t\tif(this.maximumTrack is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar measureMaxTrack:IMeasureDisplayObject = IMeasureDisplayObject(this.maximumTrack);\n\t\t\t\t\tif(needsMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tmeasureMaxTrack.minWidth = this._maximumTrackSkinExplicitMinWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this.minimumTrack is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.minimumTrack).validate();\n\t\t\t}\n\t\t\tif(this.maximumTrack is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.maximumTrack).validate();\n\t\t\t}\n\t\t\tif(this.thumb is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.thumb).validate();\n\t\t\t}\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tnewWidth = this.minimumTrack.width;\n\t\t\t\tif(!isSingle) //split\n\t\t\t\t{\n\t\t\t\t\tif(this.maximumTrack.width > newWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewWidth = this.maximumTrack.width;\n\t\t\t\t\t}\n\t\t\t\t\tnewWidth += this.thumb.width / 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tnewHeight = this.minimumTrack.height;\n\t\t\t\tif(!isSingle && //split\n\t\t\t\t\tthis.maximumTrack.height > newHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this.maximumTrack.height;\n\t\t\t\t}\n\t\t\t\tif(this.thumb.height > newHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this.thumb.height;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tif(measureMinTrack !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = measureMinTrack.minWidth;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = this.minimumTrack.width;\n\t\t\t\t}\n\t\t\t\tif(!isSingle) //split\n\t\t\t\t{\n\t\t\t\t\tif(measureMaxTrack !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(measureMaxTrack.minWidth > newMinWidth)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinWidth = measureMaxTrack.minWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(this.maximumTrack.width > newMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = this.maximumTrack.width;\n\t\t\t\t\t}\n\t\t\t\t\tif(this.thumb is IMeasureDisplayObject)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth += IMeasureDisplayObject(this.thumb).minWidth / 2;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth += this.thumb.width / 2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tif(measureMinTrack !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = measureMinTrack.minHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = this.minimumTrack.height;\n\t\t\t\t}\n\t\t\t\tif(!isSingle) //split\n\t\t\t\t{\n\t\t\t\t\tif(measureMaxTrack !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(measureMaxTrack.minHeight > newMinHeight)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinHeight = measureMaxTrack.minHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(this.maximumTrack.height > newMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = this.maximumTrack.height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this.thumb is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar measureThumb:IMeasureDisplayObject = IMeasureDisplayObject(this.thumb);\n\t\t\t\t\tif(measureThumb.minHeight > newMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = measureThumb.minHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(this.thumb.height > newMinHeight)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = this.thumb.height;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>thumb</code> sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #thumb\n\t\t * @see #thumbFactory\n\t\t * @see #style:customThumbStyleName\n\t\t */\n\t\tprotected function createThumb():void\n\t\t{\n\t\t\tif(this.thumb)\n\t\t\t{\n\t\t\t\tthis.thumb.removeFromParent(true);\n\t\t\t\tthis.thumb = null;\n\t\t\t}\n\n\t\t\tvar factory:Function = this._thumbFactory != null ? this._thumbFactory : defaultThumbFactory;\n\t\t\tvar thumbStyleName:String = this._customThumbStyleName != null ? this._customThumbStyleName : this.thumbStyleName;\n\t\t\tvar thumb:BasicButton = BasicButton(factory());\n\t\t\tthumb.styleNameList.add(thumbStyleName);\n\t\t\tthumb.keepDownStateOnRollOut = true;\n\t\t\tthumb.addEventListener(TouchEvent.TOUCH, thumb_touchHandler);\n\t\t\tthis.addChild(thumb);\n\t\t\tthis.thumb = thumb;\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>minimumTrack</code> sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #minimumTrack\n\t\t * @see #minimumTrackFactory\n\t\t * @see #style:customMinimumTrackStyleName\n\t\t */\n\t\tprotected function createMinimumTrack():void\n\t\t{\n\t\t\tif(this.minimumTrack)\n\t\t\t{\n\t\t\t\tthis.minimumTrack.removeFromParent(true);\n\t\t\t\tthis.minimumTrack = null;\n\t\t\t}\n\n\t\t\tvar factory:Function = this._minimumTrackFactory != null ? this._minimumTrackFactory : defaultMinimumTrackFactory;\n\t\t\tvar minimumTrackStyleName:String = this._customMinimumTrackStyleName != null ? this._customMinimumTrackStyleName : this.minimumTrackStyleName;\n\t\t\tvar minimumTrack:BasicButton = BasicButton(factory());\n\t\t\tminimumTrack.styleNameList.add(minimumTrackStyleName);\n\t\t\tminimumTrack.keepDownStateOnRollOut = true;\n\t\t\tminimumTrack.addEventListener(TouchEvent.TOUCH, track_touchHandler);\n\t\t\tthis.addChildAt(minimumTrack, 0);\n\t\t\tthis.minimumTrack = minimumTrack;\n\n\t\t\tif(this.minimumTrack is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this.minimumTrack).initializeNow();\n\t\t\t}\n\t\t\tif(this.minimumTrack is IMeasureDisplayObject)\n\t\t\t{\n\t\t\t\tvar measureMinTrack:IMeasureDisplayObject = IMeasureDisplayObject(this.minimumTrack);\n\t\t\t\tthis._minimumTrackSkinExplicitWidth = measureMinTrack.explicitWidth;\n\t\t\t\tthis._minimumTrackSkinExplicitHeight = measureMinTrack.explicitHeight;\n\t\t\t\tthis._minimumTrackSkinExplicitMinWidth = measureMinTrack.explicitMinWidth;\n\t\t\t\tthis._minimumTrackSkinExplicitMinHeight = measureMinTrack.explicitMinHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//this is a regular display object, and we'll treat its\n\t\t\t\t//measurements as explicit when we auto-size the slider\n\t\t\t\tthis._minimumTrackSkinExplicitWidth = this.minimumTrack.width;\n\t\t\t\tthis._minimumTrackSkinExplicitHeight = this.minimumTrack.height;\n\t\t\t\tthis._minimumTrackSkinExplicitMinWidth = this._minimumTrackSkinExplicitWidth;\n\t\t\t\tthis._minimumTrackSkinExplicitMinHeight = this._minimumTrackSkinExplicitHeight;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>maximumTrack</code> sub-component and\n\t\t * removes the old instance, if one exists. If the maximum track is not\n\t\t * needed, it will not be created.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #maximumTrack\n\t\t * @see #maximumTrackFactory\n\t\t * @see #style:customMaximumTrackStyleName\n\t\t */\n\t\tprotected function createMaximumTrack():void\n\t\t{\n\t\t\tif(this.maximumTrack !== null)\n\t\t\t{\n\t\t\t\tthis.maximumTrack.removeFromParent(true);\n\t\t\t\tthis.maximumTrack = null;\n\t\t\t}\n\t\t\tif(this._trackLayoutMode === TrackLayoutMode.SINGLE)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar factory:Function = this._maximumTrackFactory != null ? this._maximumTrackFactory : defaultMaximumTrackFactory;\n\t\t\tvar maximumTrackStyleName:String = this._customMaximumTrackStyleName != null ? this._customMaximumTrackStyleName : this.maximumTrackStyleName;\n\t\t\tvar maximumTrack:BasicButton = BasicButton(factory());\n\t\t\tmaximumTrack.styleNameList.add(maximumTrackStyleName);\n\t\t\tmaximumTrack.keepDownStateOnRollOut = true;\n\t\t\tmaximumTrack.addEventListener(TouchEvent.TOUCH, track_touchHandler);\n\t\t\tthis.addChildAt(maximumTrack, 1);\n\t\t\tthis.maximumTrack = maximumTrack;\n\n\t\t\tif(this.maximumTrack is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this.maximumTrack).initializeNow();\n\t\t\t}\n\t\t\tif(this.maximumTrack is IMeasureDisplayObject)\n\t\t\t{\n\t\t\t\tvar measureMaxTrack:IMeasureDisplayObject = IMeasureDisplayObject(this.maximumTrack);\n\t\t\t\tthis._maximumTrackSkinExplicitWidth = measureMaxTrack.explicitWidth;\n\t\t\t\tthis._maximumTrackSkinExplicitHeight = measureMaxTrack.explicitHeight;\n\t\t\t\tthis._maximumTrackSkinExplicitMinWidth = measureMaxTrack.explicitMinWidth;\n\t\t\t\tthis._maximumTrackSkinExplicitMinHeight = measureMaxTrack.explicitMinHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//this is a regular display object, and we'll treat its\n\t\t\t\t//measurements as explicit when we auto-size the slider\n\t\t\t\tthis._maximumTrackSkinExplicitWidth = this.maximumTrack.width;\n\t\t\t\tthis._maximumTrackSkinExplicitHeight = this.maximumTrack.height;\n\t\t\t\tthis._maximumTrackSkinExplicitMinWidth = this._maximumTrackSkinExplicitWidth;\n\t\t\t\tthis._maximumTrackSkinExplicitMinHeight = this._maximumTrackSkinExplicitHeight;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshThumbStyles():void\n\t\t{\n\t\t\tfor(var propertyName:String in this._thumbProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._thumbProperties[propertyName];\n\t\t\t\tthis.thumb[propertyName] = propertyValue;\n\t\t\t}\n\t\t\tthis.thumb.visible = this._showThumb;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshMinimumTrackStyles():void\n\t\t{\n\t\t\tfor(var propertyName:String in this._minimumTrackProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._minimumTrackProperties[propertyName];\n\t\t\t\tthis.minimumTrack[propertyName] = propertyValue;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshMaximumTrackStyles():void\n\t\t{\n\t\t\tif(!this.maximumTrack)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor(var propertyName:String in this._maximumTrackProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._maximumTrackProperties[propertyName];\n\t\t\t\tthis.maximumTrack[propertyName] = propertyValue;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshEnabled():void\n\t\t{\n\t\t\tif(this.thumb is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this.thumb).isEnabled = this._isEnabled;\n\t\t\t}\n\t\t\tif(this.minimumTrack is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this.minimumTrack).isEnabled = this._isEnabled;\n\t\t\t}\n\t\t\tif(this.maximumTrack is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this.maximumTrack).isEnabled = this._isEnabled;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutChildren():void\n\t\t{\n\t\t\tthis.layoutThumb();\n\n\t\t\tif(this._trackLayoutMode == TrackLayoutMode.SPLIT)\n\t\t\t{\n\t\t\t\tthis.layoutTrackWithMinMax();\n\t\t\t}\n\t\t\telse //single\n\t\t\t{\n\t\t\t\tthis.layoutTrackWithSingle();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutThumb():void\n\t\t{\n\t\t\t//this will auto-size the thumb, if needed\n\t\t\tif(this.thumb is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.thumb).validate();\n\t\t\t}\n\n\t\t\tif(this._minimum == this._maximum)\n\t\t\t{\n\t\t\t\tvar percentage:Number = 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpercentage = (this._value - this._minimum) / (this._maximum - this._minimum);\n\t\t\t\tif(percentage < 0)\n\t\t\t\t{\n\t\t\t\t\tpercentage = 0;\n\t\t\t\t}\n\t\t\t\telse if(percentage > 1)\n\t\t\t\t{\n\t\t\t\t\tpercentage = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tvar trackScrollableHeight:Number = this.actualHeight - this.thumb.height - this._minimumPadding - this._maximumPadding;\n\t\t\t\tthis.thumb.x = Math.round((this.actualWidth - this.thumb.width) / 2) + this._thumbOffset;\n\t\t\t\t//maximum is at the top, so we need to start the y position of\n\t\t\t\t//the thumb from the maximum padding\n\t\t\t\tthis.thumb.y = Math.round(this._maximumPadding + trackScrollableHeight * (1 - percentage));\n\t\t\t}\n\t\t\telse //horizontal\n\t\t\t{\n\t\t\t\tvar trackScrollableWidth:Number = this.actualWidth - this.thumb.width - this._minimumPadding - this._maximumPadding;\n\t\t\t\t//minimum is at the left, so we need to start the x position of\n\t\t\t\t//the thumb from the minimum padding\n\t\t\t\tthis.thumb.x = Math.round(this._minimumPadding + (trackScrollableWidth * percentage));\n\t\t\t\tthis.thumb.y = Math.round((this.actualHeight - this.thumb.height) / 2) + this._thumbOffset;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutTrackWithMinMax():void\n\t\t{\n\t\t\tif(this._direction === Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tvar maximumTrackHeight:Number = Math.round(this.thumb.y + (this.thumb.height / 2));\n\t\t\t\tthis.maximumTrack.y = 0;\n\t\t\t\tthis.maximumTrack.height = maximumTrackHeight;\n\t\t\t\tthis.minimumTrack.y = maximumTrackHeight;\n\t\t\t\tthis.minimumTrack.height = this.actualHeight - maximumTrackHeight;\n\t\t\t\tif(this._trackScaleMode === TrackScaleMode.EXACT_FIT)\n\t\t\t\t{\n\t\t\t\t\tthis.maximumTrack.x = 0;\n\t\t\t\t\tthis.maximumTrack.width = this.actualWidth;\n\t\t\t\t\tthis.minimumTrack.x = 0;\n\t\t\t\t\tthis.minimumTrack.width = this.actualWidth;\n\t\t\t\t}\n\t\t\t\telse //directional\n\t\t\t\t{\n\t\t\t\t\tthis.maximumTrack.width = this._maximumTrackSkinExplicitWidth;\n\t\t\t\t\tthis.minimumTrack.width = this._minimumTrackSkinExplicitWidth;\n\t\t\t\t}\n\n\t\t\t\t//final validation to avoid juggler next frame issues\n\t\t\t\tif(this.minimumTrack is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this.minimumTrack).validate();\n\t\t\t\t}\n\t\t\t\tif(this.maximumTrack is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this.maximumTrack).validate();\n\t\t\t\t}\n\n\t\t\t\tif(this._trackScaleMode === TrackScaleMode.DIRECTIONAL)\n\t\t\t\t{\n\t\t\t\t\tthis.maximumTrack.x = Math.round((this.actualWidth - this.maximumTrack.width) / 2);\n\t\t\t\t\tthis.minimumTrack.x = Math.round((this.actualWidth - this.minimumTrack.width) / 2);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //horizontal\n\t\t\t{\n\t\t\t\tvar minimumTrackWidth:Number = Math.round(this.thumb.x + (this.thumb.width / 2));\n\t\t\t\tthis.minimumTrack.x = 0;\n\t\t\t\tthis.minimumTrack.width = minimumTrackWidth;\n\t\t\t\tthis.maximumTrack.x = minimumTrackWidth;\n\t\t\t\tthis.maximumTrack.width = this.actualWidth - minimumTrackWidth;\n\n\t\t\t\tif(this._trackScaleMode === TrackScaleMode.EXACT_FIT)\n\t\t\t\t{\n\t\t\t\t\tthis.minimumTrack.y = 0;\n\t\t\t\t\tthis.minimumTrack.height = this.actualHeight;\n\t\t\t\t\tthis.maximumTrack.y = 0;\n\t\t\t\t\tthis.maximumTrack.height = this.actualHeight;\n\t\t\t\t}\n\t\t\t\telse //directional\n\t\t\t\t{\n\t\t\t\t\tthis.minimumTrack.height = this._minimumTrackSkinExplicitHeight;\n\t\t\t\t\tthis.maximumTrack.height = this._maximumTrackSkinExplicitHeight;\n\t\t\t\t}\n\n\t\t\t\t//final validation to avoid juggler next frame issues\n\t\t\t\tif(this.minimumTrack is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this.minimumTrack).validate();\n\t\t\t\t}\n\t\t\t\tif(this.maximumTrack is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this.maximumTrack).validate();\n\t\t\t\t}\n\n\t\t\t\tif(this._trackScaleMode === TrackScaleMode.DIRECTIONAL)\n\t\t\t\t{\n\t\t\t\t\tthis.minimumTrack.y = Math.round((this.actualHeight - this.minimumTrack.height) / 2);\n\t\t\t\t\tthis.maximumTrack.y = Math.round((this.actualHeight - this.maximumTrack.height) / 2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutTrackWithSingle():void\n\t\t{\n\t\t\tif(this._direction === Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tthis.minimumTrack.y = 0;\n\t\t\t\tthis.minimumTrack.height = this.actualHeight;\n\t\t\t\tif(this._trackScaleMode === TrackScaleMode.EXACT_FIT)\n\t\t\t\t{\n\t\t\t\t\tthis.minimumTrack.x = 0;\n\t\t\t\t\tthis.minimumTrack.width = this.actualWidth;\n\t\t\t\t}\n\t\t\t\telse //directional\n\t\t\t\t{\n\t\t\t\t\t//we'll calculate x after validation in case the track needs\n\t\t\t\t\t//to auto-size\n\t\t\t\t\tthis.minimumTrack.width = this._minimumTrackSkinExplicitWidth;\n\t\t\t\t}\n\n\t\t\t\t//final validation to avoid juggler next frame issues\n\t\t\t\tif(this.minimumTrack is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this.minimumTrack).validate();\n\t\t\t\t}\n\n\t\t\t\tif(this._trackScaleMode === TrackScaleMode.DIRECTIONAL)\n\t\t\t\t{\n\t\t\t\t\tthis.minimumTrack.x = Math.round((this.actualWidth - this.minimumTrack.width) / 2);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //horizontal\n\t\t\t{\n\t\t\t\tthis.minimumTrack.x = 0;\n\t\t\t\tthis.minimumTrack.width = this.actualWidth;\n\t\t\t\tif(this._trackScaleMode === TrackScaleMode.EXACT_FIT)\n\t\t\t\t{\n\t\t\t\t\tthis.minimumTrack.y = 0;\n\t\t\t\t\tthis.minimumTrack.height = this.actualHeight;\n\t\t\t\t}\n\t\t\t\telse //directional\n\t\t\t\t{\n\t\t\t\t\t//we'll calculate y after validation in case the track needs\n\t\t\t\t\t//to auto-size\n\t\t\t\t\tthis.minimumTrack.height = this._minimumTrackSkinExplicitHeight;\n\t\t\t\t}\n\n\t\t\t\t//final validation to avoid juggler next frame issues\n\t\t\t\tif(this.minimumTrack is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this.minimumTrack).validate();\n\t\t\t\t}\n\n\t\t\t\tif(this._trackScaleMode === TrackScaleMode.DIRECTIONAL)\n\t\t\t\t{\n\t\t\t\t\tthis.minimumTrack.y = Math.round((this.actualHeight - this.minimumTrack.height) / 2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function locationToValue(location:Point):Number\n\t\t{\n\t\t\tvar percentage:Number;\n\t\t\tif(this._direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tvar trackScrollableHeight:Number = this.actualHeight - this.thumb.height - this._minimumPadding - this._maximumPadding;\n\t\t\t\tvar yOffset:Number = location.y - this._touchStartY - this._maximumPadding;\n\t\t\t\tvar yPosition:Number = Math.min(Math.max(0, this._thumbStartY + yOffset), trackScrollableHeight);\n\t\t\t\tpercentage = 1 - (yPosition / trackScrollableHeight);\n\t\t\t}\n\t\t\telse //horizontal\n\t\t\t{\n\t\t\t\tvar trackScrollableWidth:Number = this.actualWidth - this.thumb.width - this._minimumPadding - this._maximumPadding;\n\t\t\t\tvar xOffset:Number = location.x - this._touchStartX - this._minimumPadding;\n\t\t\t\tvar xPosition:Number = Math.min(Math.max(0, this._thumbStartX + xOffset), trackScrollableWidth);\n\t\t\t\tpercentage = xPosition / trackScrollableWidth;\n\t\t\t}\n\n\t\t\treturn this._minimum + percentage * (this._maximum - this._minimum);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function startRepeatTimer(action:Function):void\n\t\t{\n\t\t\tthis.currentRepeatAction = action;\n\t\t\tif(this._repeatDelay > 0)\n\t\t\t{\n\t\t\t\tif(!this._repeatTimer)\n\t\t\t\t{\n\t\t\t\t\tthis._repeatTimer = new Timer(this._repeatDelay * 1000);\n\t\t\t\t\tthis._repeatTimer.addEventListener(TimerEvent.TIMER, repeatTimer_timerHandler);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._repeatTimer.reset();\n\t\t\t\t\tthis._repeatTimer.delay = this._repeatDelay * 1000;\n\t\t\t\t}\n\t\t\t\tthis._repeatTimer.start();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function adjustPage():void\n\t\t{\n\t\t\tvar page:Number = this._page;\n\t\t\tif(page !== page) //isNaN\n\t\t\t{\n\t\t\t\tpage = this._step;\n\t\t\t}\n\t\t\tif(this._touchValue < this._pageStartValue)\n\t\t\t{\n\t\t\t\tvar newValue:Number = Math.max(this._touchValue, this._value - page);\n\t\t\t\tif(this._step != 0 && newValue != this._maximum && newValue != this._minimum)\n\t\t\t\t{\n\t\t\t\t\tnewValue = roundDownToNearest(newValue, this._step);\n\t\t\t\t}\n\t\t\t\tthis.value = newValue;\n\t\t\t}\n\t\t\telse if(this._touchValue > this._pageStartValue)\n\t\t\t{\n\t\t\t\tnewValue = Math.min(this._touchValue, this._value + page);\n\t\t\t\tif(this._step != 0 && newValue != this._maximum && newValue != this._minimum)\n\t\t\t\t{\n\t\t\t\t\tnewValue = roundUpToNearest(newValue, this._step);\n\t\t\t\t}\n\t\t\t\tthis.value = newValue;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function childProperties_onChange(proxy:PropertyProxy, name:Object):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function slider_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tthis._touchPointID = -1;\n\t\t\tvar wasDragging:Boolean = this.isDragging;\n\t\t\tthis.isDragging = false;\n\t\t\tif(wasDragging && !this.liveDragging)\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function focusInHandler(event:Event):void\n\t\t{\n\t\t\tsuper.focusInHandler(event);\n\t\t\tthis.stage.addEventListener(KeyboardEvent.KEY_DOWN, stage_keyDownHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function focusOutHandler(event:Event):void\n\t\t{\n\t\t\tsuper.focusOutHandler(event);\n\t\t\tthis.stage.removeEventListener(KeyboardEvent.KEY_DOWN, stage_keyDownHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function track_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar track:DisplayObject = DisplayObject(event.currentTarget);\n\t\t\tif(this._touchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(track, null, this._touchPointID);\n\t\t\t\tif(touch === null)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(touch.phase === TouchPhase.MOVED)\n\t\t\t\t{\n\t\t\t\t\tvar location:Point = touch.getLocation(this, Pool.getPoint());\n\t\t\t\t\tthis._touchValue = this.locationToValue(location);\n\t\t\t\t\tPool.putPoint(location);\n\t\t\t\t\tif(!this._showThumb || this._trackInteractionMode !== TrackInteractionMode.BY_PAGE)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.value = this._touchValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(touch.phase === TouchPhase.ENDED)\n\t\t\t\t{\n\t\t\t\t\tif(this._repeatTimer !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._repeatTimer.stop();\n\t\t\t\t\t}\n\t\t\t\t\tthis._touchPointID = -1;\n\t\t\t\t\tthis.isDragging = false;\n\t\t\t\t\tif(!this.liveDragging)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\t}\n\t\t\t\t\tthis.dispatchEventWith(FeathersEventType.END_INTERACTION);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(track, TouchPhase.BEGAN);\n\t\t\t\tif(touch === null)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlocation = touch.getLocation(this, Pool.getPoint());\n\t\t\t\tthis._touchPointID = touch.id;\n\t\t\t\tif(this._direction == Direction.VERTICAL)\n\t\t\t\t{\n\t\t\t\t\tthis._thumbStartX = location.x;\n\t\t\t\t\tthis._thumbStartY = Math.min(this.actualHeight - this.thumb.height - this._maximumPadding, Math.max(this._minimumPadding, location.y - this.thumb.height / 2));\n\t\t\t\t}\n\t\t\t\telse //horizontal\n\t\t\t\t{\n\t\t\t\t\tthis._thumbStartX = Math.min(this.actualWidth - this.thumb.width - this._maximumPadding, Math.max(this._minimumPadding, location.x - this.thumb.width / 2));\n\t\t\t\t\tthis._thumbStartY = location.y;\n\t\t\t\t}\n\t\t\t\tthis._touchStartX = location.x;\n\t\t\t\tthis._touchStartY = location.y;\n\t\t\t\tthis._touchValue = this.locationToValue(location);\n\t\t\t\tPool.putPoint(location);\n\t\t\t\tthis._pageStartValue = this._value;\n\t\t\t\tthis.isDragging = true;\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.BEGIN_INTERACTION);\n\t\t\t\tif(this._showThumb && this._trackInteractionMode === TrackInteractionMode.BY_PAGE)\n\t\t\t\t{\n\t\t\t\t\tthis.adjustPage();\n\t\t\t\t\tthis.startRepeatTimer(this.adjustPage);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.value = this._touchValue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function thumb_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this._trackInteractionMode === TrackInteractionMode.TO_VALUE)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(this.thumb, null, this._touchPointID);\n\t\t\t\tif(touch !== null)\n\t\t\t\t{\n\t\t\t\t\tvar location:Point = touch.getLocation(this.thumb, Pool.getPoint());\n\t\t\t\t\tif(this.thumb.hitTest(location) === null)\n\t\t\t\t\t{\n\t\t\t\t\t\t//the touch is not actually on the thumb, so behave as\n\t\t\t\t\t\t//if the track were touched\n\t\t\t\t\t\tPool.putPoint(location);\n\t\t\t\t\t\tthis.track_touchHandler(event);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t//the touch is on the thumb\n\t\t\t\t\tPool.putPoint(location);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(this._touchPointID >= 0)\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(this.thumb, null, this._touchPointID);\n\t\t\t\tif(touch === null)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(touch.phase === TouchPhase.MOVED)\n\t\t\t\t{\n\t\t\t\t\tvar exclusiveTouch:ExclusiveTouch = ExclusiveTouch.forStage(this.stage);\n\t\t\t\t\tvar claim:DisplayObject = exclusiveTouch.getClaim(this._touchPointID);\n\t\t\t\t\tif(claim != this)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(claim)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//already claimed by another display object\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\texclusiveTouch.claimTouch(this._touchPointID, this);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlocation = touch.getLocation(this, Pool.getPoint());\n\t\t\t\t\tthis.value = this.locationToValue(location);\n\t\t\t\t\tPool.putPoint(location);\n\t\t\t\t}\n\t\t\t\telse if(touch.phase === TouchPhase.ENDED)\n\t\t\t\t{\n\t\t\t\t\tthis._touchPointID = -1;\n\t\t\t\t\tthis.isDragging = false;\n\t\t\t\t\tif(!this.liveDragging)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\t}\n\t\t\t\t\tthis.dispatchEventWith(FeathersEventType.END_INTERACTION);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(this.thumb, TouchPhase.BEGAN);\n\t\t\t\tif(touch === null)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlocation = touch.getLocation(this, Pool.getPoint());\n\t\t\t\tthis._touchPointID = touch.id;\n\t\t\t\tthis._thumbStartX = this.thumb.x;\n\t\t\t\tthis._thumbStartY = this.thumb.y;\n\t\t\t\tthis._touchStartX = location.x;\n\t\t\t\tthis._touchStartY = location.y;\n\t\t\t\tPool.putPoint(location);\n\t\t\t\tthis.isDragging = true;\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.BEGIN_INTERACTION);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(event.keyCode == Keyboard.HOME)\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.value = this._minimum;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(event.keyCode == Keyboard.END)\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.value = this._maximum;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar page:Number = this._page;\n\t\t\tif(page !== page) //isNaN\n\t\t\t{\n\t\t\t\tpage = this._step;\n\t\t\t}\n\t\t\tif(this._direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tif(event.keyCode == Keyboard.UP)\n\t\t\t\t{\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tif(event.shiftKey)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.value += page;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.value += this._step;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(event.keyCode == Keyboard.DOWN)\n\t\t\t\t{\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tif(event.shiftKey)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.value -= page;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.value -= this._step;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(event.keyCode == Keyboard.LEFT)\n\t\t\t\t{\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tif(event.shiftKey)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.value -= page;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.value -= this._step;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(event.keyCode == Keyboard.RIGHT)\n\t\t\t\t{\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tif(event.shiftKey)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.value += page;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.value += this._step;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function repeatTimer_timerHandler(event:TimerEvent):void\n\t\t{\n\t\t\tvar exclusiveTouch:ExclusiveTouch = ExclusiveTouch.forStage(this.stage);\n\t\t\tvar claim:DisplayObject = exclusiveTouch.getClaim(this._touchPointID);\n\t\t\tif(claim && claim != this)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._repeatTimer.currentCount < 5)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.currentRepeatAction();\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/controls/SpinnerList.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.controls.renderers.IListItemRenderer;\n\timport feathers.core.IValidating;\n\timport feathers.data.IListCollection;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.ILayout;\n\timport feathers.layout.ISpinnerLayout;\n\timport feathers.layout.VerticalSpinnerLayout;\n\timport feathers.skins.IStyleProvider;\n\n\timport flash.events.KeyboardEvent;\n\timport flash.events.TransformGestureEvent;\n\timport flash.geom.Rectangle;\n\timport flash.ui.Keyboard;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t/**\n\t * Determines if the <code>selectionOverlaySkin</code> is hidden when\n\t * the list is not focused.\n\t *\n\t * <listing version=\"3.0\">\n\t * list.hideSelectionOverlayUnlessFocused = true;</listing>\n\t *\n\t * <p>Note: If the <code>showSelectionOverlay</code> property is\n\t * <code>false</code>, the <code>selectionOverlaySkin</code> will always\n\t * be hidden.</p>\n\t *\n\t * @default false\n\t *\n\t * @see #style:selectionOverlaySkin\n\t * @see #style:showSelectionOverlay\n\t */\n\t[Style(name=\"hideSelectionOverlayUnlessFocused\",type=\"Boolean\")]\n\n\t/**\n\t * An optional skin to display in the horizontal or vertical center of\n\t * the list to highlight the currently selected item. If the list\n\t * scrolls vertically, the <code>selectionOverlaySkin</code> will fill\n\t * the entire width of the list, and it will be positioned in the\n\t * vertical center. If the list scrolls horizontally, the\n\t * <code>selectionOverlaySkin</code> will fill the entire height of the\n\t * list, and it will be positioned in the horizontal center.\n\t *\n\t * <p>The following example gives the spinner list a selection overlay\n\t * skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * list.selectionOverlaySkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t */\n\t[Style(name=\"selectionOverlaySkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * Determines if the <code>selectionOverlaySkin</code> is visible or hidden.\n\t *\n\t * <p>The following example hides the selection overlay skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * list.showSelectionOverlay = false;</listing>\n\t *\n\t * @default true\n\t *\n\t * @see #style:selectionOverlaySkin\n\t * @see #style:hideSelectionOverlayUnlessFocused\n\t */\n\t[Style(name=\"showSelectionOverlay\",type=\"Boolean\")]\n\n\t/**\n\t * A customized <code>List</code> component where scrolling updates the\n\t * the selected item. Layouts may loop infinitely.\n\t *\n\t * <p>The following example creates a list, gives it a data provider, tells\n\t * the item renderer how to interpret the data, and listens for when the\n\t * selection changes:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var list:SpinnerList = new SpinnerList();\n\t * \n\t * list.dataProvider = new ArrayCollection(\n\t * [\n\t *     { text: \"Milk\", thumbnail: textureAtlas.getTexture( \"milk\" ) },\n\t *     { text: \"Eggs\", thumbnail: textureAtlas.getTexture( \"eggs\" ) },\n\t *     { text: \"Bread\", thumbnail: textureAtlas.getTexture( \"bread\" ) },\n\t *     { text: \"Chicken\", thumbnail: textureAtlas.getTexture( \"chicken\" ) },\n\t * ]);\n\t * \n\t * list.itemRendererFactory = function():IListItemRenderer\n\t * {\n\t *     var renderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\t *     renderer.labelField = \"text\";\n\t *     renderer.iconSourceField = \"thumbnail\";\n\t *     return renderer;\n\t * };\n\t * \n\t * list.addEventListener( Event.CHANGE, list_changeHandler );\n\t * \n\t * this.addChild( list );</listing>\n\t *\n\t * @see ../../../help/spinner-list.html How to use the Feathers SpinnerList component\n\t *\n\t * @productversion Feathers 2.1.0\n\t */\n\tpublic class SpinnerList extends List\n\t{\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>SpinnerList</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function SpinnerList()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis._scrollBarDisplayMode = ScrollBarDisplayMode.NONE;\n\t\t\tthis._snapToPages = true;\n\t\t\tthis._snapOnComplete = true;\n\t\t\tthis.decelerationRate = DecelerationRate.FAST;\n\t\t\tthis.addEventListener(Event.TRIGGERED, spinnerList_triggeredHandler);\n\t\t\tthis.addEventListener(FeathersEventType.SCROLL_COMPLETE, spinnerList_scrollCompleteHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\tif(SpinnerList.globalStyleProvider)\n\t\t\t{\n\t\t\t\treturn SpinnerList.globalStyleProvider;\n\t\t\t}\n\t\t\treturn List.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * <code>SpinnerList</code> requires that the <code>snapToPages</code>\n\t\t * property is set to <code>true</code>. Attempts to set it to\n\t\t * <code>false</code> will result in a runtime error.\n\t\t *\n\t\t * @throws ArgumentError SpinnerList requires snapToPages to be true.\n\t\t */\n\t\toverride public function set snapToPages(value:Boolean):void\n\t\t{\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"SpinnerList requires snapToPages to be true.\");\n\t\t\t}\n\t\t\tsuper.snapToPages = value;\n\t\t}\n\n\t\t/**\n\t\t * <code>SpinnerList</code> requires that the <code>allowMultipleSelection</code>\n\t\t * property is set to <code>false</code>. Attempts to set it to\n\t\t * <code>true</code> will result in a runtime error.\n\t\t *\n\t\t * @throws ArgumentError SpinnerList requires allowMultipleSelection to be false.\n\t\t */\n\t\toverride public function set allowMultipleSelection(value:Boolean):void\n\t\t{\n\t\t\tif(value)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"SpinnerList requires allowMultipleSelection to be false.\");\n\t\t\t}\n\t\t\tsuper.allowMultipleSelection = value;\n\t\t}\n\n\t\t/**\n\t\t * <code>SpinnerList</code> requires that the <code>isSelectable</code>\n\t\t * property is set to <code>true</code>. Attempts to set it to\n\t\t * <code>false</code> will result in a runtime error.\n\t\t *\n\t\t * @throws ArgumentError SpinnerList requires isSelectable to be true.\n\t\t */\n\t\toverride public function set isSelectable(value:Boolean):void\n\t\t{\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"SpinnerList requires isSelectable to be true.\");\n\t\t\t}\n\t\t\tsuper.isSelectable = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _spinnerLayout:ISpinnerLayout;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set layout(value:ILayout):void\n\t\t{\n\t\t\tif(value && !(value is ISpinnerLayout))\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"SpinnerList requires layouts to implement the ISpinnerLayout interface.\");\n\t\t\t}\n\t\t\tsuper.layout = value;\n\t\t\tthis._spinnerLayout = ISpinnerLayout(value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set selectedIndex(value:int):void\n\t\t{\n\t\t\tif(value < 0 && this._dataProvider !== null && this._dataProvider.length > 0)\n\t\t\t{\n\t\t\t\t//a SpinnerList must always select an item, unless the data\n\t\t\t\t//provider is empty\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._selectedIndex != value)\n\t\t\t{\n\t\t\t\tthis.scrollToDisplayIndex(value, 0);\n\t\t\t}\n\t\t\tsuper.selectedIndex = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set selectedItem(value:Object):void\n\t\t{\n\t\t\tif(this._dataProvider === null)\n\t\t\t{\n\t\t\t\tthis.selectedIndex = -1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar index:int = this._dataProvider.getItemIndex(value);\n\t\t\tif(index < 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.selectedIndex = index;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set dataProvider(value:IListCollection):void\n\t\t{\n\t\t\tif(this._dataProvider == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsuper.dataProvider = value;\n\t\t\tif(!this._dataProvider || this._dataProvider.length == 0)\n\t\t\t{\n\t\t\t\tthis.selectedIndex = -1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.selectedIndex = 0;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectionOverlaySkin:DisplayObject = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get selectionOverlaySkin():DisplayObject\n\t\t{\n\t\t\treturn this._selectionOverlaySkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectionOverlaySkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._selectionOverlaySkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._selectionOverlaySkin && this._selectionOverlaySkin.parent == this)\n\t\t\t{\n\t\t\t\tthis.removeRawChildInternal(this._selectionOverlaySkin);\n\t\t\t}\n\t\t\tthis._selectionOverlaySkin = value;\n\t\t\tif(this._selectionOverlaySkin)\n\t\t\t{\n\t\t\t\tthis.addRawChildInternal(this._selectionOverlaySkin);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _showSelectionOverlay:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get showSelectionOverlay():Boolean\n\t\t{\n\t\t\treturn this._showSelectionOverlay;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set showSelectionOverlay(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._showSelectionOverlay === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._showSelectionOverlay = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _hideSelectionOverlayUnlessFocused:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get hideSelectionOverlayUnlessFocused():Boolean\n\t\t{\n\t\t\treturn this._hideSelectionOverlayUnlessFocused;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set hideSelectionOverlayUnlessFocused(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._hideSelectionOverlayUnlessFocused === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._hideSelectionOverlayUnlessFocused = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\t//SpinnerList has a different default layout than its superclass,\n\t\t\t//List, so set it before calling super.initialize()\n\t\t\tif(this._layout === null)\n\t\t\t{\n\t\t\t\tif(this._hasElasticEdges &&\n\t\t\t\t\tthis._verticalScrollPolicy === ScrollPolicy.AUTO &&\n\t\t\t\t\tthis._scrollBarDisplayMode !== ScrollBarDisplayMode.FIXED)\n\t\t\t\t{\n\t\t\t\t\t//so that the elastic edges work even when the max scroll\n\t\t\t\t\t//position is 0, similar to iOS.\n\t\t\t\t\tthis._verticalScrollPolicy = ScrollPolicy.ON;\n\t\t\t\t}\n\n\t\t\t\tvar layout:VerticalSpinnerLayout = new VerticalSpinnerLayout();\n\t\t\t\tlayout.useVirtualLayout = true;\n\t\t\t\tlayout.padding = 0;\n\t\t\t\tlayout.gap = 0;\n\t\t\t\tlayout.horizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\t\tlayout.requestedRowCount = 4;\n\t\t\t\tthis.ignoreNextStyleRestriction();\n\t\t\t\tthis.layout = layout;\n\t\t\t}\n\n\t\t\tsuper.initialize();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function refreshMinAndMaxScrollPositions():void\n\t\t{\n\t\t\tvar oldActualPageWidth:Number = this.actualPageWidth;\n\t\t\tvar oldActualPageHeight:Number = this.actualPageHeight;\n\t\t\tsuper.refreshMinAndMaxScrollPositions();\n\t\t\tif(this._maxVerticalScrollPosition != this._minVerticalScrollPosition)\n\t\t\t{\n\t\t\t\tthis.actualPageHeight = this._spinnerLayout.snapInterval;\n\t\t\t\tif(!this.isScrolling && this.pendingItemIndex == -1 &&\n\t\t\t\t\tthis.actualPageHeight != oldActualPageHeight)\n\t\t\t\t{\n\t\t\t\t\t//if the height of items have changed, we need to tweak the\n\t\t\t\t\t//scroll position to re-center the selected item.\n\t\t\t\t\t//we don't do this if the user is currently scrolling or if\n\t\t\t\t\t//the selected index has changed (which will set\n\t\t\t\t\t//pendingItemIndex).\n\t\t\t\t\tvar verticalPageIndex:int = this.calculateNearestPageIndexForItem(this._selectedIndex, this._verticalPageIndex, this._maxVerticalPageIndex);\n\t\t\t\t\tthis._verticalScrollPosition = this.actualPageHeight * verticalPageIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(this._maxHorizontalScrollPosition != this._minHorizontalScrollPosition)\n\t\t\t{\n\t\t\t\tthis.actualPageWidth = this._spinnerLayout.snapInterval;\n\t\t\t\tif(!this.isScrolling && this.pendingItemIndex == -1 &&\n\t\t\t\t\tthis.actualPageWidth != oldActualPageWidth)\n\t\t\t\t{\n\t\t\t\t\tvar horizontalPageIndex:int = this.calculateNearestPageIndexForItem(this._selectedIndex, this._horizontalPageIndex, this._maxHorizontalPageIndex);\n\t\t\t\t\tthis._horizontalScrollPosition = this.actualPageWidth * horizontalPageIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function handlePendingScroll():void\n\t\t{\n\t\t\tif(this.pendingItemIndex >= 0)\n\t\t\t{\n\t\t\t\tvar itemIndex:int = this.pendingItemIndex;\n\t\t\t\tthis.pendingItemIndex = -1;\n\t\t\t\tif(this._maxVerticalPageIndex != this._minVerticalPageIndex)\n\t\t\t\t{\n\t\t\t\t\tthis.pendingVerticalPageIndex = this.calculateNearestPageIndexForItem(itemIndex, this._verticalPageIndex, this._maxVerticalPageIndex);\n\t\t\t\t\tthis.hasPendingVerticalPageIndex = this.pendingVerticalPageIndex != this._verticalPageIndex;\n\t\t\t\t}\n\t\t\t\telse if(this._maxHorizontalPageIndex != this._minHorizontalPageIndex)\n\t\t\t\t{\n\t\t\t\t\tthis.pendingHorizontalPageIndex = this.calculateNearestPageIndexForItem(itemIndex, this._horizontalPageIndex, this._maxHorizontalPageIndex);\n\t\t\t\t\tthis.hasPendingHorizontalPageIndex = this.pendingHorizontalPageIndex != this._horizontalPageIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t\tsuper.handlePendingScroll();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function layoutChildren():void\n\t\t{\n\t\t\tsuper.layoutChildren();\n\n\t\t\tif(this._selectionOverlaySkin !== null)\n\t\t\t{\n\t\t\t\tif(this._showSelectionOverlay && this._hideSelectionOverlayUnlessFocused &&\n\t\t\t\t\tthis._focusManager !== null && this._isFocusEnabled)\n\t\t\t\t{\n\t\t\t\t\tthis._selectionOverlaySkin.visible = this._hasFocus;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._selectionOverlaySkin.visible = this._showSelectionOverlay;\n\t\t\t\t}\n\t\t\t\tvar selectionBounds:Rectangle = this._spinnerLayout.selectionBounds;\n\t\t\t\tthis._selectionOverlaySkin.x = this._leftViewPortOffset + selectionBounds.x;\n\t\t\t\tthis._selectionOverlaySkin.y = this._topViewPortOffset + selectionBounds.y;\n\t\t\t\tthis._selectionOverlaySkin.width = selectionBounds.width;\n\t\t\t\tthis._selectionOverlaySkin.height = selectionBounds.height;\n\t\t\t\tif(this._selectionOverlaySkin is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this._selectionOverlaySkin).validate();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function calculateNearestPageIndexForItem(itemIndex:int, currentPageIndex:int, maxPageIndex:int):int\n\t\t{\n\t\t\tif(maxPageIndex != int.MAX_VALUE)\n\t\t\t{\n\t\t\t\treturn itemIndex;\n\t\t\t}\n\t\t\tvar itemCount:int = this._dataProvider.length;\n\t\t\tvar fullDataProviderOffsets:int = currentPageIndex / itemCount;\n\t\t\tvar currentItemIndex:int = currentPageIndex % itemCount;\n\t\t\tif(itemIndex < currentItemIndex)\n\t\t\t{\n\t\t\t\tvar previousPageIndex:Number = fullDataProviderOffsets * itemCount + itemIndex;\n\t\t\t\tvar nextPageIndex:Number = (fullDataProviderOffsets + 1) * itemCount + itemIndex;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpreviousPageIndex = (fullDataProviderOffsets - 1) * itemCount + itemIndex;\n\t\t\t\tnextPageIndex = fullDataProviderOffsets * itemCount + itemIndex;\n\t\t\t}\n\t\t\tif((nextPageIndex - currentPageIndex) < (currentPageIndex - previousPageIndex))\n\t\t\t{\n\t\t\t\treturn nextPageIndex;\n\t\t\t}\n\t\t\treturn previousPageIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function scroller_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tif(this._verticalAutoScrollTween)\n\t\t\t{\n\t\t\t\tthis._verticalAutoScrollTween.advanceTime(this._verticalAutoScrollTween.totalTime);\n\t\t\t}\n\t\t\tif(this._horizontalAutoScrollTween)\n\t\t\t{\n\t\t\t\tthis._horizontalAutoScrollTween.advanceTime(this._horizontalAutoScrollTween.totalTime);\n\t\t\t}\n\t\t\tsuper.scroller_removedFromStageHandler(event);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function spinnerList_scrollCompleteHandler(event:Event):void\n\t\t{\n\t\t\tvar itemCount:int = this._dataProvider.length;\n\t\t\tif(this._maxVerticalPageIndex != this._minVerticalPageIndex)\n\t\t\t{\n\t\t\t\tvar pageIndex:int = this._verticalPageIndex % itemCount;\n\t\t\t}\n\t\t\telse if(this._maxHorizontalPageIndex != this._minHorizontalPageIndex)\n\t\t\t{\n\t\t\t\tpageIndex = this._horizontalPageIndex % itemCount;\n\t\t\t}\n\t\t\tif(pageIndex < 0)\n\t\t\t{\n\t\t\t\tpageIndex = itemCount + pageIndex;\n\t\t\t}\n\t\t\tvar item:Object = this._dataProvider.getItemAt(pageIndex);\n\t\t\tvar itemRenderer:IListItemRenderer = this.itemToItemRenderer(item);\n\t\t\tif(itemRenderer !== null && !itemRenderer.isEnabled)\n\t\t\t{\n\t\t\t\t//if the item renderer isn't enabled, we cannot select it\n\t\t\t\t//go back to the previously selected index\n\t\t\t\tif(this._maxVerticalPageIndex != this._minVerticalPageIndex)\n\t\t\t\t{\n\t\t\t\t\tthis.scrollToPageIndex(this._horizontalPageIndex, this._selectedIndex, this._pageThrowDuration);\n\t\t\t\t}\n\t\t\t\telse if(this._maxHorizontalPageIndex != this._minHorizontalPageIndex)\n\t\t\t\t{\n\t\t\t\t\tthis.scrollToPageIndex(this._selectedIndex, this._verticalPageIndex, this._pageThrowDuration);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.selectedIndex = pageIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function spinnerList_triggeredHandler(event:Event, item:Object):void\n\t\t{\n\t\t\tvar itemIndex:int = this._dataProvider.getItemIndex(item);\n\t\t\t//property must change immediately, but the animation can take longer\n\t\t\tthis.selectedIndex = itemIndex;\n\t\t\tif(this._maxVerticalPageIndex != this._minVerticalPageIndex)\n\t\t\t{\n\t\t\t\titemIndex = this.calculateNearestPageIndexForItem(itemIndex, this._verticalPageIndex, this._maxVerticalPageIndex);\n\t\t\t\tthis.throwToPage(this._horizontalPageIndex, itemIndex, this._pageThrowDuration);\n\t\t\t}\n\t\t\telse if(this._maxHorizontalPageIndex != this._minHorizontalPageIndex)\n\t\t\t{\n\t\t\t\titemIndex = this.calculateNearestPageIndexForItem(itemIndex, this._horizontalPageIndex, this._maxHorizontalPageIndex);\n\t\t\t\tthis.throwToPage(itemIndex, this._verticalPageIndex, this._pageThrowDuration);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function dataProvider_removeItemHandler(event:Event, index:int):void\n\t\t{\n\t\t\tsuper.dataProvider_removeItemHandler(event, index);\n\t\t\tif(this._maxVerticalPageIndex != this._minVerticalPageIndex)\n\t\t\t{\n\t\t\t\tvar itemIndex:int = this.calculateNearestPageIndexForItem(this._selectedIndex, this._verticalPageIndex, this._maxVerticalPageIndex);\n\t\t\t\tif(itemIndex > this._dataProvider.length)\n\t\t\t\t{\n\t\t\t\t\titemIndex -= this._dataProvider.length;\n\t\t\t\t}\n\t\t\t\tthis.scrollToDisplayIndex(itemIndex, 0);\n\t\t\t}\n\t\t\telse if(this._maxHorizontalPageIndex != this._minHorizontalPageIndex)\n\t\t\t{\n\t\t\t\titemIndex = this.calculateNearestPageIndexForItem(this._selectedIndex, this._horizontalPageIndex, this._maxHorizontalPageIndex);\n\t\t\t\tif(itemIndex > this._dataProvider.length)\n\t\t\t\t{\n\t\t\t\t\titemIndex -= this._dataProvider.length;\n\t\t\t\t}\n\t\t\t\tthis.scrollToDisplayIndex(itemIndex, 0);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function dataProvider_addItemHandler(event:Event, index:int):void\n\t\t{\n\t\t\tsuper.dataProvider_addItemHandler(event, index);\n\t\t\tif(this._maxVerticalPageIndex != this._minVerticalPageIndex)\n\t\t\t{\n\t\t\t\tvar itemIndex:int = this.calculateNearestPageIndexForItem(this._selectedIndex, this._verticalPageIndex, this._maxVerticalPageIndex);\n\t\t\t\tif(itemIndex > this._dataProvider.length)\n\t\t\t\t{\n\t\t\t\t\titemIndex -= this._dataProvider.length;\n\t\t\t\t}\n\t\t\t\tthis.scrollToDisplayIndex(itemIndex, 0);\n\t\t\t}\n\t\t\telse if(this._maxHorizontalPageIndex != this._minHorizontalPageIndex)\n\t\t\t{\n\t\t\t\titemIndex = this.calculateNearestPageIndexForItem(this._selectedIndex, this._horizontalPageIndex, this._maxHorizontalPageIndex);\n\t\t\t\tif(itemIndex > this._dataProvider.length)\n\t\t\t\t{\n\t\t\t\t\titemIndex -= this._dataProvider.length;\n\t\t\t\t}\n\t\t\t\tthis.scrollToDisplayIndex(itemIndex, 0);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function nativeStage_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(event.isDefaultPrevented())\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!this._dataProvider)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(event.keyCode == Keyboard.HOME || event.keyCode == Keyboard.END ||\n\t\t\t\tevent.keyCode == Keyboard.PAGE_UP || event.keyCode == Keyboard.PAGE_DOWN ||\n\t\t\t\tevent.keyCode == Keyboard.UP || event.keyCode == Keyboard.DOWN ||\n\t\t\t\tevent.keyCode == Keyboard.LEFT || event.keyCode == Keyboard.RIGHT)\n\t\t\t{\n\t\t\t\tvar newIndex:int = this.dataViewPort.calculateNavigationDestination(this.selectedIndex, event.keyCode);\n\t\t\t\tif(this.selectedIndex != newIndex)\n\t\t\t\t{\n\t\t\t\t\t//property must change immediately, but the animation can take longer\n\t\t\t\t\tthis.selectedIndex = newIndex;\n\t\t\t\t\tif(this._maxVerticalPageIndex != this._minVerticalPageIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tvar pageIndex:int = this.calculateNearestPageIndexForItem(newIndex, this._verticalPageIndex, this._maxVerticalPageIndex);\n\t\t\t\t\t\tthis.throwToPage(this._horizontalPageIndex, pageIndex, this._pageThrowDuration);\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._maxHorizontalPageIndex != this._minHorizontalPageIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tpageIndex = this.calculateNearestPageIndexForItem(newIndex, this._horizontalPageIndex, this._maxHorizontalPageIndex);\n\t\t\t\t\t\tthis.throwToPage(pageIndex, this._verticalPageIndex, this._pageThrowDuration);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function stage_gestureDirectionalTapHandler(event:TransformGestureEvent):void\n\t\t{\n\t\t\tif(event.isDefaultPrevented())\n\t\t\t{\n\t\t\t\t//something else has already handled this event\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar keyCode:uint = int.MAX_VALUE;\n\t\t\tif(event.offsetY < 0)\n\t\t\t{\n\t\t\t\tkeyCode = Keyboard.UP;\n\t\t\t}\n\t\t\telse if(event.offsetY > 0)\n\t\t\t{\n\t\t\t\tkeyCode = Keyboard.DOWN;\n\t\t\t}\n\t\t\telse if(event.offsetX > 0)\n\t\t\t{\n\t\t\t\tkeyCode = Keyboard.RIGHT;\n\t\t\t}\n\t\t\telse if(event.offsetX < 0)\n\t\t\t{\n\t\t\t\tkeyCode = Keyboard.LEFT;\n\t\t\t}\n\t\t\tif(keyCode == int.MAX_VALUE)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar newIndex:int = this.dataViewPort.calculateNavigationDestination(this.selectedIndex, keyCode);\n\t\t\tif(this.selectedIndex != newIndex)\n\t\t\t{\n\t\t\t\t//property must change immediately, but the animation can take longer\n\t\t\t\tthis.selectedIndex = newIndex;\n\t\t\t\tif(this._maxVerticalPageIndex != this._minVerticalPageIndex)\n\t\t\t\t{\n\t\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t\t\t//event.preventDefault();\n\t\t\t\t\tvar pageIndex:int = this.calculateNearestPageIndexForItem(newIndex, this._verticalPageIndex, this._maxVerticalPageIndex);\n\t\t\t\t\tthis.throwToPage(this._horizontalPageIndex, pageIndex, this._pageThrowDuration);\n\t\t\t\t}\n\t\t\t\telse if(this._maxHorizontalPageIndex != this._minHorizontalPageIndex)\n\t\t\t\t{\n\t\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t\t\t//event.preventDefault();\n\t\t\t\t\tpageIndex = this.calculateNearestPageIndexForItem(newIndex, this._horizontalPageIndex, this._maxHorizontalPageIndex);\n\t\t\t\t\tthis.throwToPage(pageIndex, this._verticalPageIndex, this._pageThrowDuration);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/StackScreenNavigator.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.controls.supportClasses.BaseScreenNavigator;\n\timport feathers.events.ExclusiveTouch;\n\timport feathers.events.FeathersEventType;\n\timport feathers.motion.effectClasses.IEffectContext;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.system.DeviceCapabilities;\n\n\timport flash.geom.Point;\n\timport flash.utils.getTimer;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.utils.Pool;\n\n\t/**\n\t * Typically used to provide some kind of animation or visual effect,\n\t * this function that is called when the screen navigator pushes a new\n\t * screen onto the stack.\n\t *\n\t * <p>In the following example, the screen navigator is given a push\n\t * transition that slides the screens to the left:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * navigator.pushTransition = Slide.createSlideLeftTransition();</listing>\n\t *\n\t * <p>A number of animated transitions may be found in the\n\t * <a href=\"../motion/package-detail.html\">feathers.motion</a> package.\n\t * However, you are not limited to only these transitions. It's possible\n\t * to create custom transitions too.</p>\n\t *\n\t * <p>A custom transition function should have the following signature:</p>\n\t * <pre>function(oldScreen:DisplayObject, newScreen:DisplayObject, completeCallback:Function):void</pre>\n\t *\n\t * <p>Either of the <code>oldScreen</code> and <code>newScreen</code>\n\t * arguments may be <code>null</code>, but never both. The\n\t * <code>oldScreen</code> argument will be <code>null</code> when the\n\t * first screen is displayed or when a new screen is displayed after\n\t * clearing the screen. The <code>newScreen</code> argument will\n\t * be null when clearing the screen.</p>\n\t *\n\t * <p>The <code>completeCallback</code> function <em>must</em> be called\n\t * when the transition effect finishes. This callback indicate to the\n\t * screen navigator that the transition has finished. This function has\n\t * the following signature:</p>\n\t *\n\t * <pre>function(cancelTransition:Boolean = false):void</pre>\n\t *\n\t * <p>The first argument defaults to <code>false</code>, meaning that\n\t * the transition completed successfully. In most cases, this callback\n\t * may be called without arguments. If a transition is cancelled before\n\t * completion (perhaps through some kind of user interaction), and the\n\t * previous screen should be restored, pass <code>true</code> as the\n\t * first argument to the callback to inform the screen navigator that\n\t * the transition is cancelled.</p>\n\t *\n\t * @default null\n\t *\n\t * @see ../../../help/transitions.html Transitions for Feathers screen navigators\n\t * @see #pushScreen()\n\t * @see #popTransition\n\t * @see #popToRootTransition\n\t */\n\t[Style(name=\"pushTransition\",type=\"Function\")]\n\n\t/**\n\t * Typically used to provide some kind of animation or visual effect,\n\t * this function that is called when the screen navigator pops a screen\n\t * from the top of the stack.\n\t *\n\t * <p>In the following example, the screen navigator is given a pop\n\t * transition that slides the screens to the right:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * navigator.popTransition = Slide.createSlideRightTransition();</listing>\n\t *\n\t * <p>A number of animated transitions may be found in the\n\t * <a href=\"../motion/package-detail.html\">feathers.motion</a> package.\n\t * However, you are not limited to only these transitions. It's possible\n\t * to create custom transitions too.</p>\n\t *\n\t * <p>A custom transition function should have the following signature:</p>\n\t * <pre>function(oldScreen:DisplayObject, newScreen:DisplayObject, completeCallback:Function):void</pre>\n\t *\n\t * <p>Either of the <code>oldScreen</code> and <code>newScreen</code>\n\t * arguments may be <code>null</code>, but never both. The\n\t * <code>oldScreen</code> argument will be <code>null</code> when the\n\t * first screen is displayed or when a new screen is displayed after\n\t * clearing the screen. The <code>newScreen</code> argument will\n\t * be null when clearing the screen.</p>\n\t *\n\t * <p>The <code>completeCallback</code> function <em>must</em> be called\n\t * when the transition effect finishes. This callback indicate to the\n\t * screen navigator that the transition has finished. This function has\n\t * the following signature:</p>\n\t *\n\t * <pre>function(cancelTransition:Boolean = false):void</pre>\n\t *\n\t * <p>The first argument defaults to <code>false</code>, meaning that\n\t * the transition completed successfully. In most cases, this callback\n\t * may be called without arguments. If a transition is cancelled before\n\t * completion (perhaps through some kind of user interaction), and the\n\t * previous screen should be restored, pass <code>true</code> as the\n\t * first argument to the callback to inform the screen navigator that\n\t * the transition is cancelled.</p>\n\t *\n\t * @default null\n\t *\n\t * @see ../../../help/transitions.html Transitions for Feathers screen navigators\n\t * @see #popScreen()\n\t * @see #pushTransition\n\t * @see #popToRootTransition\n\t */\n\t[Style(name=\"popTransition\",type=\"Function\")]\n\n\t/**\n\t * Typically used to provide some kind of animation or visual effect, a\n\t * function that is called when the screen navigator clears its stack,\n\t * to show the first screen that was pushed onto the stack.\n\t *\n\t * <p>If this property is <code>null</code>, the value of the\n\t * <code>popTransition</code> property will be used instead.</p>\n\t *\n\t * <p>In the following example, a custom pop to root transition is\n\t * passed to the screen navigator:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * navigator.popToRootTransition = Fade.createFadeInTransition();</listing>\n\t *\n\t * <p>A number of animated transitions may be found in the\n\t * <a href=\"../motion/package-detail.html\">feathers.motion</a> package.\n\t * However, you are not limited to only these transitions. It's possible\n\t * to create custom transitions too.</p>\n\t *\n\t * <p>A custom transition function should have the following signature:</p>\n\t * <pre>function(oldScreen:DisplayObject, newScreen:DisplayObject, completeCallback:Function):void</pre>\n\t *\n\t * <p>Either of the <code>oldScreen</code> and <code>newScreen</code>\n\t * arguments may be <code>null</code>, but never both. The\n\t * <code>oldScreen</code> argument will be <code>null</code> when the\n\t * first screen is displayed or when a new screen is displayed after\n\t * clearing the screen. The <code>newScreen</code> argument will\n\t * be null when clearing the screen.</p>\n\t *\n\t * <p>The <code>completeCallback</code> function <em>must</em> be called\n\t * when the transition effect finishes. This callback indicate to the\n\t * screen navigator that the transition has finished. This function has\n\t * the following signature:</p>\n\t *\n\t * <pre>function(cancelTransition:Boolean = false):void</pre>\n\t *\n\t * <p>The first argument defaults to <code>false</code>, meaning that\n\t * the transition completed successfully. In most cases, this callback\n\t * may be called without arguments. If a transition is cancelled before\n\t * completion (perhaps through some kind of user interaction), and the\n\t * previous screen should be restored, pass <code>true</code> as the\n\t * first argument to the callback to inform the screen navigator that\n\t * the transition is cancelled.</p>\n\t *\n\t * @default null\n\t *\n\t * @see ../../../help/transitions.html Transitions for Feathers screen navigators\n\t * @see #popToRootScreen()\n\t * @see #pushTransition\n\t * @see #popTransition\n\t */\n\t[Style(name=\"popToRootTransition\",type=\"Function\")]\n\n\t/**\n\t * A \"view stack\"-like container that supports navigation between screens\n\t * (any display object) through events.\n\t *\n\t * <p>The following example creates a screen navigator, adds a screen and\n\t * displays it:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var navigator:StackScreenNavigator = new StackScreenNavigator();\n\t * navigator.addScreen( \"mainMenu\", new StackScreenNavigatorItem( MainMenuScreen ) );\n\t * this.addChild( navigator );\n\t * \n\t * navigator.rootScreenID = \"mainMenu\";</listing>\n\t *\n\t * @see ../../../help/stack-screen-navigator.html How to use the Feathers StackScreenNavigator component\n\t * @see ../../../help/transitions.html Transitions for Feathers screen navigators\n\t * @see feathers.controls.StackScreenNavigatorItem\n\t *\n\t * @productversion Feathers 2.1.0\n\t */\n\tpublic class StackScreenNavigator extends BaseScreenNavigator\n\t{\n\t\t/**\n\t\t * @private\n\t\t * The current velocity is given high importance.\n\t\t */\n\t\tprivate static const CURRENT_VELOCITY_WEIGHT:Number = 2.33;\n\n\t\t/**\n\t\t * @private\n\t\t * Older saved velocities are given less importance.\n\t\t */\n\t\tprivate static const VELOCITY_WEIGHTS:Vector.<Number> = new <Number>[1, 1.33, 1.66, 2];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const MAXIMUM_SAVED_VELOCITY_COUNT:int = 4;\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>StackScreenNavigator</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function StackScreenNavigator()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.addEventListener(FeathersEventType.INITIALIZE, stackScreenNavigator_initializeHandler);\n\t\t\tthis.addEventListener(TouchEvent.TOUCH, stackScreenNavigator_touchHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn StackScreenNavigator.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _touchPointID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isDragging:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _dragCancelled:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _startTouchX:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentTouchX:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _previousTouchTime:int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _previousTouchX:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _velocityX:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _previousVelocityX:Vector.<Number> = new <Number>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _pushTransition:Function;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get pushTransition():Function\n\t\t{\n\t\t\treturn this._pushTransition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set pushTransition(value:Function):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._pushTransition = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _popTransition:Function;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get popTransition():Function\n\t\t{\n\t\t\treturn this._popTransition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set popTransition(value:Function):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._popTransition = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _popToRootTransition:Function = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get popToRootTransition():Function\n\t\t{\n\t\t\treturn this._popToRootTransition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set popToRootTransition(value:Function):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._popToRootTransition = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _poppedStackItem:StackItem = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _stack:Vector.<StackItem> = new <StackItem>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get stackCount():int\n\t\t{\n\t\t\tvar stackLength:int = this._stack.length;\n\t\t\tif(stackLength > 0)\n\t\t\t{\n\t\t\t\treturn this._stack.length + 1;\n\t\t\t}\n\t\t\tif(this._activeScreen)\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _pushScreenEvents:Object = {};\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _replaceScreenEvents:Object;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _popScreenEvents:Vector.<String>;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _popToRootScreenEvents:Vector.<String>;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _tempRootScreenID:String;\n\n\t\t/**\n\t\t * Sets the first screen at the bottom of the stack, or the root screen.\n\t\t * When this screen is shown, there will be no transition.\n\t\t *\n\t\t * <p>If the stack contains screens when you set this property, they\n\t\t * will be removed from the stack. In other words, setting this property\n\t\t * will clear the stack, erasing the current history.</p>\n\t\t *\n\t\t * <p>In the following example, the root screen is set:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * navigator.rootScreenID = \"someScreen\";</listing>\n\t\t *\n\t\t * @see #popToRootScreen()\n\t\t */\n\t\tpublic function get rootScreenID():String\n\t\t{\n\t\t\tif(this._tempRootScreenID !== null)\n\t\t\t{\n\t\t\t\treturn this._tempRootScreenID;\n\t\t\t}\n\t\t\telse if(this._stack.length == 0)\n\t\t\t{\n\t\t\t\treturn this._activeScreenID;\n\t\t\t}\n\t\t\treturn this._stack[0].id;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set rootScreenID(value:String):void\n\t\t{\n\t\t\tif(this._isInitialized)\n\t\t\t{\n\t\t\t\t//we may have delayed showing the root screen until after\n\t\t\t\t//initialization, but this property could be set between when\n\t\t\t\t//_isInitialized is set to true and when the screen is actually\n\t\t\t\t//shown, so we need to clear this variable, just in case.\n\t\t\t\tthis._tempRootScreenID = null;\n\n\t\t\t\t//this clears the whole stack and starts fresh\n\t\t\t\tthis._stack.length = 0;\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\t//show without a transition because we're not navigating.\n\t\t\t\t\t//we're forcibly replacing the root screen.\n\t\t\t\t\tthis.showScreenInternal(value, null);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.clearScreenInternal(null);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._tempRootScreenID = value;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimumDragDistance:Number = 0.04;\n\n\t\t/**\n\t\t * The minimum physical distance (in inches) that a touch must move\n\t\t * before a drag gesture begins when <code>isSwipeToPopEnabled</code>\n\t\t * is <code>true</code>.\n\t\t *\n\t\t * <p>In the following example, the minimum drag distance is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scroller.minimumDragDistance = 0.1;</listing>\n\t\t *\n\t\t * @default 0.04\n\t\t *\n\t\t * @see #isSwipeToPopEnabled\n\t\t */\n\t\tpublic function get minimumDragDistance():Number\n\t\t{\n\t\t\treturn this._minimumDragDistance;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minimumDragDistance(value:Number):void\n\t\t{\n\t\t\tthis._minimumDragDistance = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimumSwipeVelocity:Number = 5;\n\n\t\t/**\n\t\t * The minimum physical velocity (in inches per second) that a touch\n\t\t * must move before a swipe is detected. Otherwise, it will settle which\n\t\t * screen to navigate to based on which one is closer when the touch ends.\n\t\t *\n\t\t * <p>In the following example, the minimum swipe velocity is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * navigator.minimumSwipeVelocity = 2;</listing>\n\t\t *\n\t\t * @default 5\n\t\t *\n\t\t * @see #isSwipeToPopEnabled\n\t\t */\n\t\tpublic function get minimumSwipeVelocity():Number\n\t\t{\n\t\t\treturn this._minimumSwipeVelocity;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minimumSwipeVelocity(value:Number):void\n\t\t{\n\t\t\tthis._minimumSwipeVelocity = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isSwipeToPopEnabled:Boolean = false;\n\n\t\t/**\n\t\t * Determines if the swipe gesture to pop the current screen is enabled.\n\t\t *\n\t\t * <p>In the following example, swiping to go back is enabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * navigator.isSwipeToPopEnabled = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic function get isSwipeToPopEnabled():Boolean\n\t\t{\n\t\t\treturn this._isSwipeToPopEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isSwipeToPopEnabled(value:Boolean):void\n\t\t{\n\t\t\tthis._isSwipeToPopEnabled = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _swipeToPopGestureEdgeSize:Number = 0.1;\n\n\t\t/**\n\t\t * The size (in inches) of the region near the left edge of the content\n\t\t * that can be dragged when <code>isSwipeToPopEnabled</code> is\n\t\t * <code>true</code>.\n\t\t *\n\t\t * <p>In the following example, the swipe-to-pop gesture edge size is\n\t\t * customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * drawers.swipeToPopGestureEdgeSize = 0.25;</listing>\n\t\t *\n\t\t * @default 0.1\n\t\t *\n\t\t * @see #isSwipeToPopEnabled\n\t\t */\n\t\tpublic function get swipeToPopGestureEdgeSize():Number\n\t\t{\n\t\t\treturn this._swipeToPopGestureEdgeSize;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set swipeToPopGestureEdgeSize(value:Number):void\n\t\t{\n\t\t\tthis._swipeToPopGestureEdgeSize = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _savedTransitionOnComplete:Function = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _dragEffectContext:IEffectContext = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _dragEffectTransition:Function = null;\n\n\t\t/**\n\t\t * Registers a new screen with a string identifier that can be used\n\t\t * to reference the screen in other calls, like <code>removeScreen()</code>\n\t\t * or <code>pushScreen()</code>.\n\t\t *\n\t\t * @see #removeScreen()\n\t\t */\n\t\tpublic function addScreen(id:String, item:StackScreenNavigatorItem):void\n\t\t{\n\t\t\tthis.addScreenInternal(id, item);\n\t\t}\n\n\t\t/**\n\t\t * Removes an existing screen using the identifier assigned to it in the\n\t\t * call to <code>addScreen()</code>.\n\t\t *\n\t\t * @see #removeAllScreens()\n\t\t * @see #addScreen()\n\t\t */\n\t\tpublic function removeScreen(id:String):StackScreenNavigatorItem\n\t\t{\n\t\t\tvar stackCount:int = this._stack.length;\n\t\t\tfor(var i:int = stackCount - 1; i >= 0; i--)\n\t\t\t{\n\t\t\t\tvar item:StackItem = this._stack[i];\n\t\t\t\tif(item.id === id)\n\t\t\t\t{\n\t\t\t\t\tthis._stack.removeAt(i);\n\t\t\t\t\t//don't break here because there might be multiple screens\n\t\t\t\t\t//with this ID in the stack\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn StackScreenNavigatorItem(this.removeScreenInternal(id));\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function removeAllScreens():void\n\t\t{\n\t\t\tthis._stack.length = 0;\n\t\t\tsuper.removeAllScreens();\n\t\t}\n\n\t\t/**\n\t\t * Returns the <code>StackScreenNavigatorItem</code> instance with the\n\t\t * specified identifier.\n\t\t */\n\t\tpublic function getScreen(id:String):StackScreenNavigatorItem\n\t\t{\n\t\t\tif(this._screens.hasOwnProperty(id))\n\t\t\t{\n\t\t\t\treturn StackScreenNavigatorItem(this._screens[id]);\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * Pushes a screen onto the top of the stack.\n\t\t *\n\t\t * <p>A set of key-value pairs representing properties on the previous\n\t\t * screen may be passed in. If the new screen is popped, these values\n\t\t * may be used to restore the previous screen's state.</p>\n\t\t *\n\t\t * <p>An optional transition may be specified. If <code>null</code> the\n\t\t * <code>pushTransition</code> property will be used instead.</p>\n\t\t *\n\t\t * <p>Returns a reference to the new screen, unless a transition is\n\t\t * currently active. In that case, the new screen will be queued until\n\t\t * the transition has completed, and no reference will be returned.</p>\n\t\t *\n\t\t * @see #pushTransition\n\t\t */\n\t\tpublic function pushScreen(id:String, savedPreviousScreenProperties:Object = null, transition:Function = null):DisplayObject\n\t\t{\n\t\t\tif(transition === null)\n\t\t\t{\n\t\t\t\tvar item:StackScreenNavigatorItem = this.getScreen(id);\n\t\t\t\tif(item && item.pushTransition !== null)\n\t\t\t\t{\n\t\t\t\t\ttransition = item.pushTransition;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttransition = this.pushTransition;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._activeScreenID)\n\t\t\t{\n\t\t\t\tthis._stack[this._stack.length] = new StackItem(this._activeScreenID, savedPreviousScreenProperties);\n\t\t\t}\n\t\t\telse if(savedPreviousScreenProperties)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"Cannot save properties for the previous screen because there is no previous screen.\");\n\t\t\t}\n\t\t\treturn this.showScreenInternal(id, transition);\n\t\t}\n\n\t\t/**\n\t\t * Pops the current screen from the top of the stack, returning to the\n\t\t * previous screen.\n\t\t *\n\t\t * <p>An optional transition may be specified. If <code>null</code> the\n\t\t * <code>popTransition</code> property will be used instead.</p>\n\t\t *\n\t\t * <p>Returns a reference to the new screen, unless a transition is\n\t\t * currently active. In that case, the new screen will be queued until\n\t\t * the transition has completed, and no reference will be returned.</p>\n\t\t *\n\t\t * @see #popTransition\n\t\t */\n\t\tpublic function popScreen(transition:Function = null):DisplayObject\n\t\t{\n\t\t\tif(this._stack.length == 0)\n\t\t\t{\n\t\t\t\treturn this._activeScreen;\n\t\t\t}\n\t\t\tif(transition === null)\n\t\t\t{\n\t\t\t\tvar screenItem:StackScreenNavigatorItem = this.getScreen(this._activeScreenID);\n\t\t\t\tif(screenItem && screenItem.popTransition !== null)\n\t\t\t\t{\n\t\t\t\t\ttransition = screenItem.popTransition;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttransition = this.popTransition;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._poppedStackItem = this._stack.pop();\n\t\t\treturn this.showScreenInternal(this._poppedStackItem.id, transition, this._poppedStackItem.properties);\n\t\t}\n\n\t\t/**\n\t\t * Returns to the root screen, at the bottom of the stack.\n\t\t *\n\t\t * <p>An optional transition may be specified. If <code>null</code>, the\n\t\t * <code>popToRootTransition</code> or <code>popTransition</code>\n\t\t * property will be used instead.</p>\n\t\t *\n\t\t * <p>Returns a reference to the new screen, unless a transition is\n\t\t * currently active. In that case, the new screen will be queued until\n\t\t * the transition has completed, and no reference will be returned.</p>\n\t\t *\n\t\t * @see #popToRootTransition\n\t\t * @see #popTransition\n\t\t */\n\t\tpublic function popToRootScreen(transition:Function = null):DisplayObject\n\t\t{\n\t\t\tif(this._stack.length == 0)\n\t\t\t{\n\t\t\t\treturn this._activeScreen;\n\t\t\t}\n\t\t\tif(transition == null)\n\t\t\t{\n\t\t\t\ttransition = this.popToRootTransition;\n\t\t\t\tif(transition == null)\n\t\t\t\t{\n\t\t\t\t\ttransition = this.popTransition;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar item:StackItem = this._stack[0];\n\t\t\tthis._stack.length = 0;\n\t\t\treturn this.showScreenInternal(item.id, transition, item.properties);\n\t\t}\n\n\t\t/**\n\t\t * Pops all screens from the stack, leaving the\n\t\t * <code>StackScreenNavigator</code> empty.\n\t\t *\n\t\t * <p>An optional transition may be specified. If <code>null</code>, the\n\t\t * <code>popTransition</code> property will be used instead.</p>\n\t\t *\n\t\t * @see #popTransition\n\t\t */\n\t\tpublic function popAll(transition:Function = null):void\n\t\t{\n\t\t\tif(!this._activeScreen)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(transition == null)\n\t\t\t{\n\t\t\t\ttransition = this.popTransition;\n\t\t\t}\n\t\t\tthis._stack.length = 0;\n\t\t\tthis.clearScreenInternal(transition);\n\t\t}\n\n\t\t/**\n\t\t * Returns to the root screen, at the bottom of the stack, but replaces\n\t\t * it with a new root screen.\n\t\t *\n\t\t * <p>An optional transition may be specified. If <code>null</code>, the\n\t\t * <code>popToRootTransition</code> or <code>popTransition</code>\n\t\t * property will be used instead.</p>\n\t\t *\n\t\t * <p>Returns a reference to the new screen, unless a transition is\n\t\t * currently active. In that case, the new screen will be queued until\n\t\t * the transition has completed, and no reference will be returned.</p>\n\t\t *\n\t\t * @see #popToRootTransition\n\t\t * @see #popTransition\n\t\t */\n\t\tpublic function popToRootScreenAndReplace(id:String, transition:Function = null):DisplayObject\n\t\t{\n\t\t\tif(transition == null)\n\t\t\t{\n\t\t\t\ttransition = this.popToRootTransition;\n\t\t\t\tif(transition == null)\n\t\t\t\t{\n\t\t\t\t\ttransition = this.popTransition;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._stack.length = 0;\n\t\t\treturn this.showScreenInternal(id, transition);\n\t\t}\n\n\t\t/**\n\t\t * Replaces the current screen on the top of the stack with a new\n\t\t * screen. May be used in the case where you want to navigate from\n\t\t * screen A to screen B and then to screen C, but when popping screen C,\n\t\t * you want to skip screen B and return to screen A.\n\t\t *\n\t\t * <p>Returns a reference to the new screen, unless a transition is\n\t\t * currently active. In that case, the new screen will be queued until\n\t\t * the transition has completed, and no reference will be returned.</p>\n\t\t *\n\t\t * <p>An optional transition may be specified. If <code>null</code> the\n\t\t * <code>pushTransition</code> property will be used instead.</p>\n\t\t *\n\t\t * @see #pushTransition\n\t\t */\n\t\tpublic function replaceScreen(id:String, transition:Function = null):DisplayObject\n\t\t{\n\t\t\tif(transition === null)\n\t\t\t{\n\t\t\t\tvar item:StackScreenNavigatorItem = this.getScreen(id);\n\t\t\t\tif(item && item.pushTransition !== null)\n\t\t\t\t{\n\t\t\t\t\ttransition = item.pushTransition;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttransition = this.pushTransition;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.showScreenInternal(id, transition);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function hitTest(local:Point):DisplayObject\n\t\t{\n\t\t\tvar result:DisplayObject = super.hitTest(local);\n\t\t\tif(this._isDragging && result !== null)\n\t\t\t{\n\t\t\t\t//don't allow touches to reach children while dragging\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function prepareActiveScreen():void\n\t\t{\n\t\t\tvar item:StackScreenNavigatorItem = StackScreenNavigatorItem(this._screens[this._activeScreenID]);\n\t\t\tthis.addPushEventsToActiveScreen(item);\n\t\t\tthis.addReplaceEventsToActiveScreen(item);\n\t\t\tthis.addPopEventsToActiveScreen(item);\n\t\t\tthis.addPopToRootEventsToActiveScreen(item);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function cleanupActiveScreen():void\n\t\t{\n\t\t\tvar item:StackScreenNavigatorItem = StackScreenNavigatorItem(this._screens[this._activeScreenID]);\n\t\t\tthis.removePushEventsFromActiveScreen(item);\n\t\t\tthis.removeReplaceEventsFromActiveScreen(item);\n\t\t\tthis.removePopEventsFromActiveScreen(item);\n\t\t\tthis.removePopToRootEventsFromActiveScreen(item);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function addPushEventsToActiveScreen(item:StackScreenNavigatorItem):void\n\t\t{\n\t\t\tvar events:Object = item.pushEvents;\n\t\t\tvar savedScreenEvents:Object = {};\n\t\t\tfor(var eventName:String in events)\n\t\t\t{\n\t\t\t\tvar signal:Object = null;\n\t\t\t\tif(BaseScreenNavigator.SIGNAL_TYPE !== null &&\n\t\t\t\t\tthis._activeScreen.hasOwnProperty(eventName))\n\t\t\t\t{\n\t\t\t\t\tsignal = this._activeScreen[eventName] as BaseScreenNavigator.SIGNAL_TYPE;\n\t\t\t\t}\n\t\t\t\tvar eventAction:Object = events[eventName];\n\t\t\t\tif(eventAction is Function)\n\t\t\t\t{\n\t\t\t\t\tif(signal)\n\t\t\t\t\t{\n\t\t\t\t\t\tsignal.add(eventAction as Function);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._activeScreen.addEventListener(eventName, eventAction as Function);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(eventAction is String)\n\t\t\t\t{\n\t\t\t\t\tif(signal)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar eventListener:Function = this.createPushScreenSignalListener(eventAction as String, signal);\n\t\t\t\t\t\tsignal.add(eventListener);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\teventListener = this.createPushScreenEventListener(eventAction as String);\n\t\t\t\t\t\tthis._activeScreen.addEventListener(eventName, eventListener);\n\t\t\t\t\t}\n\t\t\t\t\tsavedScreenEvents[eventName] = eventListener;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthrow new TypeError(\"Unknown push event action defined for screen:\", eventAction.toString());\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._pushScreenEvents[this._activeScreenID] = savedScreenEvents;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function removePushEventsFromActiveScreen(item:StackScreenNavigatorItem):void\n\t\t{\n\t\t\tvar pushEvents:Object = item.pushEvents;\n\t\t\tvar savedScreenEvents:Object = this._pushScreenEvents[this._activeScreenID];\n\t\t\tfor(var eventName:String in pushEvents)\n\t\t\t{\n\t\t\t\tvar signal:Object = null;\n\t\t\t\tif(BaseScreenNavigator.SIGNAL_TYPE !== null &&\n\t\t\t\t\tthis._activeScreen.hasOwnProperty(eventName))\n\t\t\t\t{\n\t\t\t\t\tsignal = this._activeScreen[eventName] as BaseScreenNavigator.SIGNAL_TYPE;\n\t\t\t\t}\n\t\t\t\tvar eventAction:Object = pushEvents[eventName];\n\t\t\t\tif(eventAction is Function)\n\t\t\t\t{\n\t\t\t\t\tif(signal)\n\t\t\t\t\t{\n\t\t\t\t\t\tsignal.remove(eventAction as Function);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._activeScreen.removeEventListener(eventName, eventAction as Function);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(eventAction is String)\n\t\t\t\t{\n\t\t\t\t\tvar eventListener:Function = savedScreenEvents[eventName] as Function;\n\t\t\t\t\tif(signal)\n\t\t\t\t\t{\n\t\t\t\t\t\tsignal.remove(eventListener);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._activeScreen.removeEventListener(eventName, eventListener);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._pushScreenEvents[this._activeScreenID] = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function addReplaceEventsToActiveScreen(item:StackScreenNavigatorItem):void\n\t\t{\n\t\t\tvar events:Object = item.replaceEvents;\n\t\t\tif(!events)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedScreenEvents:Object = {};\n\t\t\tfor(var eventName:String in events)\n\t\t\t{\n\t\t\t\tvar signal:Object = null;\n\t\t\t\tif(BaseScreenNavigator.SIGNAL_TYPE !== null &&\n\t\t\t\t\tthis._activeScreen.hasOwnProperty(eventName))\n\t\t\t\t{\n\t\t\t\t\tsignal = this._activeScreen[eventName] as BaseScreenNavigator.SIGNAL_TYPE;\n\t\t\t\t}\n\t\t\t\tvar eventAction:Object = events[eventName];\n\t\t\t\tif(eventAction is String)\n\t\t\t\t{\n\t\t\t\t\tif(signal)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar eventListener:Function = this.createReplaceScreenSignalListener(eventAction as String, signal);\n\t\t\t\t\t\tsignal.add(eventListener);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\teventListener = this.createReplaceScreenEventListener(eventAction as String);\n\t\t\t\t\t\tthis._activeScreen.addEventListener(eventName, eventListener);\n\t\t\t\t\t}\n\t\t\t\t\tsavedScreenEvents[eventName] = eventListener;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthrow new TypeError(\"Unknown replace event action defined for screen:\", eventAction.toString());\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!this._replaceScreenEvents)\n\t\t\t{\n\t\t\t\tthis._replaceScreenEvents = {};\n\t\t\t}\n\t\t\tthis._replaceScreenEvents[this._activeScreenID] = savedScreenEvents;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function removeReplaceEventsFromActiveScreen(item:StackScreenNavigatorItem):void\n\t\t{\n\t\t\tvar replaceEvents:Object = item.replaceEvents;\n\t\t\tif(!replaceEvents)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedScreenEvents:Object = this._replaceScreenEvents[this._activeScreenID];\n\t\t\tfor(var eventName:String in replaceEvents)\n\t\t\t{\n\t\t\t\tvar signal:Object = null;\n\t\t\t\tif(BaseScreenNavigator.SIGNAL_TYPE !== null &&\n\t\t\t\t\tthis._activeScreen.hasOwnProperty(eventName))\n\t\t\t\t{\n\t\t\t\t\tsignal = this._activeScreen[eventName] as BaseScreenNavigator.SIGNAL_TYPE;\n\t\t\t\t}\n\t\t\t\tvar eventAction:Object = replaceEvents[eventName];\n\t\t\t\tif(eventAction is String)\n\t\t\t\t{\n\t\t\t\t\tvar eventListener:Function = savedScreenEvents[eventName] as Function;\n\t\t\t\t\tif(signal)\n\t\t\t\t\t{\n\t\t\t\t\t\tsignal.remove(eventListener);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._activeScreen.removeEventListener(eventName, eventListener);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._replaceScreenEvents[this._activeScreenID] = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function addPopEventsToActiveScreen(item:StackScreenNavigatorItem):void\n\t\t{\n\t\t\tif(!item.popEvents)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//creating a copy because this array could change before the screen\n\t\t\t//is removed.\n\t\t\tvar popEvents:Vector.<String> = item.popEvents.slice();\n\t\t\tvar eventCount:int = popEvents.length;\n\t\t\tfor(var i:int = 0; i < eventCount; i++)\n\t\t\t{\n\t\t\t\tvar eventName:String = popEvents[i];\n\t\t\t\tvar signal:Object = null;\n\t\t\t\tif(BaseScreenNavigator.SIGNAL_TYPE !== null &&\n\t\t\t\t\tthis._activeScreen.hasOwnProperty(eventName))\n\t\t\t\t{\n\t\t\t\t\tsignal = this._activeScreen[eventName] as BaseScreenNavigator.SIGNAL_TYPE;\n\t\t\t\t}\n\t\t\t\tif(signal)\n\t\t\t\t{\n\t\t\t\t\tsignal.add(popSignalListener);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._activeScreen.addEventListener(eventName, popEventListener);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._popScreenEvents = popEvents;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function removePopEventsFromActiveScreen(item:StackScreenNavigatorItem):void\n\t\t{\n\t\t\tif(!this._popScreenEvents)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar eventCount:int = this._popScreenEvents.length;\n\t\t\tfor(var i:int = 0; i < eventCount; i++)\n\t\t\t{\n\t\t\t\tvar eventName:String = this._popScreenEvents[i];\n\t\t\t\tvar signal:Object = null;\n\t\t\t\tif(BaseScreenNavigator.SIGNAL_TYPE !== null &&\n\t\t\t\t\tthis._activeScreen.hasOwnProperty(eventName))\n\t\t\t\t{\n\t\t\t\t\tsignal = this._activeScreen[eventName] as BaseScreenNavigator.SIGNAL_TYPE;\n\t\t\t\t}\n\t\t\t\tif(signal)\n\t\t\t\t{\n\t\t\t\t\tsignal.remove(popSignalListener);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._activeScreen.removeEventListener(eventName, popEventListener);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._popScreenEvents = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function removePopToRootEventsFromActiveScreen(item:StackScreenNavigatorItem):void\n\t\t{\n\t\t\tif(!this._popToRootScreenEvents)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar eventCount:int = this._popToRootScreenEvents.length;\n\t\t\tfor(var i:int = 0; i < eventCount; i++)\n\t\t\t{\n\t\t\t\tvar eventName:String = this._popToRootScreenEvents[i];\n\t\t\t\tvar signal:Object = null;\n\t\t\t\tif(BaseScreenNavigator.SIGNAL_TYPE !== null &&\n\t\t\t\t\tthis._activeScreen.hasOwnProperty(eventName))\n\t\t\t\t{\n\t\t\t\t\tsignal = this._activeScreen[eventName] as BaseScreenNavigator.SIGNAL_TYPE;\n\t\t\t\t}\n\t\t\t\tif(signal)\n\t\t\t\t{\n\t\t\t\t\tsignal.remove(popToRootSignalListener);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._activeScreen.removeEventListener(eventName, popToRootEventListener);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._popToRootScreenEvents = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function addPopToRootEventsToActiveScreen(item:StackScreenNavigatorItem):void\n\t\t{\n\t\t\tif(!item.popToRootEvents)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//creating a copy because this array could change before the screen\n\t\t\t//is removed.\n\t\t\tvar popToRootEvents:Vector.<String> = item.popToRootEvents.slice();\n\t\t\tvar eventCount:int = popToRootEvents.length;\n\t\t\tfor(var i:int = 0; i < eventCount; i++)\n\t\t\t{\n\t\t\t\tvar eventName:String = popToRootEvents[i];\n\t\t\t\tvar signal:Object = null;\n\t\t\t\tif(BaseScreenNavigator.SIGNAL_TYPE !== null &&\n\t\t\t\t\tthis._activeScreen.hasOwnProperty(eventName))\n\t\t\t\t{\n\t\t\t\t\tsignal = this._activeScreen[eventName] as BaseScreenNavigator.SIGNAL_TYPE;\n\t\t\t\t}\n\t\t\t\tif(signal)\n\t\t\t\t{\n\t\t\t\t\tsignal.add(popToRootSignalListener);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._activeScreen.addEventListener(eventName, popToRootEventListener);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._popToRootScreenEvents = popToRootEvents;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createPushScreenEventListener(screenID:String):Function\n\t\t{\n\t\t\tvar self:StackScreenNavigator = this;\n\t\t\tvar eventListener:Function = function(event:Event, data:Object):void\n\t\t\t{\n\t\t\t\tself.pushScreen(screenID, data);\n\t\t\t};\n\n\t\t\treturn eventListener;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createPushScreenSignalListener(screenID:String, signal:Object):Function\n\t\t{\n\t\t\tvar self:StackScreenNavigator = this;\n\t\t\tif(signal.valueClasses.length == 1)\n\t\t\t{\n\t\t\t\t//shortcut to avoid the allocation of the rest array\n\t\t\t\tvar signalListener:Function = function(arg0:Object):void\n\t\t\t\t{\n\t\t\t\t\tself.pushScreen(screenID, arg0);\n\t\t\t\t};\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tsignalListener = function(...rest:Array):void\n\t\t\t\t{\n\t\t\t\t\tvar data:Object;\n\t\t\t\t\tif(rest.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tdata = rest[0];\n\t\t\t\t\t}\n\t\t\t\t\tself.pushScreen(screenID, data);\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn signalListener;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createReplaceScreenEventListener(screenID:String):Function\n\t\t{\n\t\t\tvar self:StackScreenNavigator = this;\n\t\t\tvar eventListener:Function = function(event:Event):void\n\t\t\t{\n\t\t\t\tself.replaceScreen(screenID);\n\t\t\t};\n\n\t\t\treturn eventListener;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createReplaceScreenSignalListener(screenID:String, signal:Object):Function\n\t\t{\n\t\t\tvar self:StackScreenNavigator = this;\n\t\t\tif(signal.valueClasses.length == 0)\n\t\t\t{\n\t\t\t\t//shortcut to avoid the allocation of the rest array\n\t\t\t\tvar signalListener:Function = function():void\n\t\t\t\t{\n\t\t\t\t\tself.replaceScreen(screenID);\n\t\t\t\t};\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tsignalListener = function(...rest:Array):void\n\t\t\t\t{\n\t\t\t\t\tself.replaceScreen(screenID);\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn signalListener;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function handleTouchBegan(touch:Touch):void\n\t\t{\n\t\t\tvar exclusiveTouch:ExclusiveTouch = ExclusiveTouch.forStage(this.stage);\n\t\t\tif(exclusiveTouch.getClaim(touch.id))\n\t\t\t{\n\t\t\t\t//already claimed\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar point:Point = Pool.getPoint();\n\t\t\ttouch.getLocation(this, point);\n\t\t\tvar localX:Number = point.x;\n\t\t\tPool.putPoint(point);\n\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar leftInches:Number = localX / (DeviceCapabilities.dpi / starling.contentScaleFactor);\n\t\t\tif(leftInches < 0 || leftInches > this._swipeToPopGestureEdgeSize)\n\t\t\t{\n\t\t\t\t//we're not close enough to the edge\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._touchPointID = touch.id;\n\t\t\tthis._velocityX = 0;\n\t\t\tthis._previousVelocityX.length = 0;\n\t\t\tthis._previousTouchTime = getTimer();\n\t\t\tthis._previousTouchX = this._startTouchX = this._currentTouchX = localX;\n\t\t\tthis._isDragging = false;\n\t\t\tthis._dragCancelled = false;\n\n\t\t\texclusiveTouch.addEventListener(Event.CHANGE, exclusiveTouch_changeHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function handleTouchMoved(touch:Touch):void\n\t\t{\n\t\t\tvar point:Point = Pool.getPoint();\n\t\t\ttouch.getLocation(this, point);\n\t\t\tthis._currentTouchX = point.x;\n\t\t\tPool.putPoint(point);\n\t\t\tvar now:int = getTimer();\n\t\t\tvar timeOffset:int = now - this._previousTouchTime;\n\t\t\tif(timeOffset > 0)\n\t\t\t{\n\t\t\t\t//we're keeping previous velocity updates to improve accuracy\n\t\t\t\tthis._previousVelocityX[this._previousVelocityX.length] = this._velocityX;\n\t\t\t\tif(this._previousVelocityX.length > MAXIMUM_SAVED_VELOCITY_COUNT)\n\t\t\t\t{\n\t\t\t\t\tthis._previousVelocityX.shift();\n\t\t\t\t}\n\t\t\t\tthis._velocityX = (this._currentTouchX - this._previousTouchX) / timeOffset;\n\t\t\t\tthis._previousTouchTime = now;\n\t\t\t\tthis._previousTouchX = this._currentTouchX;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dragTransition(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function):void\n\t\t{\n\t\t\tthis._savedTransitionOnComplete = onComplete;\n\t\t\tthis._dragEffectContext = this._dragEffectTransition(this._previousScreenInTransition, this._activeScreen, null, true);\n\t\t\tthis._dragEffectTransition = null;\n\t\t\tthis.handleDragMove();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function handleDragMove():void\n\t\t{\n\t\t\tif(this._dragEffectContext === null)\n\t\t\t{\n\t\t\t\t//the transition may not have started yet\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar offsetX:Number = this._currentTouchX - this._startTouchX;\n\t\t\tthis._dragEffectContext.position = offsetX / this.screenContainer.width;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function handleDragEnd():void\n\t\t{\n\t\t\tif(this._dragEffectContext === null)\n\t\t\t{\n\t\t\t\t//if we're waiting to start the transition for performance\n\t\t\t\t//reasons, force it to start immediately\n\t\t\t\tif(this._waitingTransition !== null)\n\t\t\t\t{\n\t\t\t\t\tthis.startWaitingTransition();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._dragCancelled = false;\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\n\t\t\tvar sum:Number = this._velocityX * CURRENT_VELOCITY_WEIGHT;\n\t\t\tvar velocityCount:int = this._previousVelocityX.length;\n\t\t\tvar totalWeight:Number = CURRENT_VELOCITY_WEIGHT;\n\t\t\tfor(var i:int = 0; i < velocityCount; i++)\n\t\t\t{\n\t\t\t\tvar weight:Number = VELOCITY_WEIGHTS[i];\n\t\t\t\tsum += this._previousVelocityX.shift() * weight;\n\t\t\t\ttotalWeight += weight;\n\t\t\t}\n\n\t\t\tvar inchesPerSecondX:Number = 1000 * (sum / totalWeight) / (DeviceCapabilities.dpi / starling.contentScaleFactor);\n\t\t\tif(inchesPerSecondX < -this._minimumSwipeVelocity)\n\t\t\t{\n\t\t\t\t//force back to current screen\n\t\t\t\tif(this._isDragging)\n\t\t\t\t{\n\t\t\t\t\tthis._dragCancelled = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar offsetX:Number = this._currentTouchX - this._startTouchX;\n\t\t\t\tvar ratio:Number = offsetX / this.screenContainer.width;\n\t\t\t\tif(ratio <= 0.5)\n\t\t\t\t{\n\t\t\t\t\tif(this._isDragging)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._dragCancelled = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._dragEffectContext.addEventListener(Event.COMPLETE, dragEffectContext_completeHandler);\n\t\t\tif(this._dragCancelled)\n\t\t\t{\n\t\t\t\tthis._dragEffectContext.playReverse();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._dragEffectContext.play();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function checkForDrag():void\n\t\t{\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar horizontalInchesMoved:Number = (this._currentTouchX - this._startTouchX) / (DeviceCapabilities.dpi / starling.contentScaleFactor);\n\t\t\tif(horizontalInchesMoved < this._minimumDragDistance)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._dragEffectTransition = null;\n\t\t\tvar screenItem:StackScreenNavigatorItem = this.getScreen(this._activeScreenID);\n\t\t\tif(screenItem && screenItem.popTransition !== null)\n\t\t\t{\n\t\t\t\tthis._dragEffectTransition = screenItem.popTransition;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._dragEffectTransition = this.popTransition;\n\t\t\t}\n\n\t\t\t//if no transition has been specified, use the default\n\t\t\tif(this._dragEffectTransition === null)\n\t\t\t{\n\t\t\t\tthis._dragEffectTransition = defaultTransition;\n\t\t\t}\n\n\t\t\t//if this is an old transition that doesn't support being managed,\n\t\t\t//simply start it without management.\n\t\t\tif(this._dragEffectTransition.length < 4)\n\t\t\t{\n\t\t\t\tthis._dragEffectTransition = null;\n\t\t\t\tthis.popScreen();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._isDragging = true;\n\t\t\tthis.popScreen(dragTransition);\n\t\t\tthis._startTouchX = this._currentTouchX;\n\t\t\tvar exclusiveTouch:ExclusiveTouch = ExclusiveTouch.forStage(this.stage);\n\t\t\texclusiveTouch.removeEventListener(Event.CHANGE, exclusiveTouch_changeHandler);\n\t\t\texclusiveTouch.claimTouch(this._touchPointID, this);\n\t\t\tthis.dispatchEventWith(FeathersEventType.BEGIN_INTERACTION);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function transitionComplete(cancelTransition:Boolean = false):void\n\t\t{\n\t\t\tthis._poppedStackItem = null;\n\t\t\tsuper.transitionComplete(cancelTransition);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function popEventListener(event:Event):void\n\t\t{\n\t\t\tthis.popScreen();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function popSignalListener(...rest:Array):void\n\t\t{\n\t\t\tthis.popScreen();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function popToRootEventListener(event:Event):void\n\t\t{\n\t\t\tthis.popToRootScreen();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function popToRootSignalListener(...rest:Array):void\n\t\t{\n\t\t\tthis.popToRootScreen();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stackScreenNavigator_initializeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._tempRootScreenID !== null)\n\t\t\t{\n\t\t\t\tvar screenID:String = this._tempRootScreenID;\n\t\t\t\tthis._tempRootScreenID = null;\n\t\t\t\tthis.showScreenInternal(screenID, null);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stackScreenNavigator_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled || !this._isSwipeToPopEnabled || (this._stack.length == 0 && !this._isDragging))\n\t\t\t{\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._touchPointID != -1)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(this, null, this._touchPointID);\n\t\t\t\tif(touch === null)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(touch.phase === TouchPhase.MOVED)\n\t\t\t\t{\n\t\t\t\t\tthis.handleTouchMoved(touch);\n\n\t\t\t\t\tif(!this._isDragging)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.checkForDrag();\n\t\t\t\t\t}\n\t\t\t\t\tif(this._isDragging)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.handleDragMove();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(touch.phase === TouchPhase.ENDED)\n\t\t\t\t{\n\t\t\t\t\tthis._touchPointID = -1;\n\t\t\t\t\tif(this._isDragging)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.handleDragEnd();\n\t\t\t\t\t\tthis.dispatchEventWith(FeathersEventType.END_INTERACTION);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(this, TouchPhase.BEGAN);\n\t\t\t\tif(touch === null)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.handleTouchBegan(touch);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function exclusiveTouch_changeHandler(event:Event, touchID:int):void\n\t\t{\n\t\t\tif(this._touchPointID == -1 || this._touchPointID != touchID || this._isDragging)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar exclusiveTouch:ExclusiveTouch = ExclusiveTouch.forStage(this.stage);\n\t\t\tif(exclusiveTouch.getClaim(touchID) === this)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._touchPointID = -1;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dragEffectContext_completeHandler(event:Event):void\n\t\t{\n\t\t\tthis._dragEffectContext.removeEventListeners();\n\t\t\tthis._dragEffectContext = null;\n\t\t\tthis._isDragging = false;\n\t\t\tvar cancelled:Boolean = this._dragCancelled;\n\t\t\tthis._dragCancelled = false;\n\t\t\tvar onComplete:Function = this._savedTransitionOnComplete;\n\t\t\tthis._savedTransitionOnComplete = null;\n\t\t\tif(cancelled)\n\t\t\t{\n\t\t\t\tthis._stack[this._stack.length] = this._poppedStackItem;\n\t\t\t}\n\t\t\tonComplete(cancelled);\n\t\t}\n\t}\n}\n\nfinal class StackItem\n{\n\tpublic function StackItem(id:String, properties:Object)\n\t{\n\t\tthis.id = id;\n\t\tthis.properties = properties;\n\t}\n\n\tpublic var id:String;\n\tpublic var properties:Object;\n}\n"
  },
  {
    "path": "source/feathers/controls/StackScreenNavigatorItem.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.controls.supportClasses.IScreenNavigatorItem;\n\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * Data for an individual screen that will be displayed by a\n\t * <code>StackScreenNavigator</code> component.\n\t *\n\t * <p>The following example creates a new\n\t * <code>StackScreenNavigatorItem</code> using the\n\t * <code>SettingsScreen</code> class to instantiate the screen instance.\n\t * When the screen is shown, its <code>settings</code> property will be set.\n\t * When the screen instance dispatches the\n\t * <code>SettingsScreen.SHOW_ADVANCED_SETTINGS</code> event, the\n\t * <code>StackScreenNavigator</code> will push a screen with the ID\n\t * <code>\"advancedSettings\"</code> onto its stack. When the screen instance\n\t * dispatches <code>Event.COMPLETE</code>, the <code>StackScreenNavigator</code>\n\t * will pop the screen instance from its stack.</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var settingsData:Object = { volume: 0.8, difficulty: \"hard\" };\n\t * var item:StackScreenNavigatorItem = new StackScreenNavigatorItem( SettingsScreen );\n\t * item.properties.settings = settingsData;\n\t * item.setScreenIDForPushEvent( SettingsScreen.SHOW_ADVANCED_SETTINGS, \"advancedSettings\" );\n\t * item.addPopEvent( Event.COMPLETE );\n\t * navigator.addScreen( \"settings\", item );</listing>\n\t *\n\t * @see ../../../help/stack-screen-navigator.html How to use the Feathers StackScreenNavigator component\n\t * @see feathers.controls.StackScreenNavigator\n\t *\n\t * @productversion Feathers 2.1.0\n\t */\n\tpublic class StackScreenNavigatorItem implements IScreenNavigatorItem\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t *\n\t\t * @param screen The screen to display. Must be a <code>Class</code>, <code>Function</code>, or Starling display object.\n\t\t * @param pushEvents The screen navigator push a new screen when these events are dispatched.\n\t\t * @param popEvent An event that pops the screen from the top of the stack.\n\t\t * @param properties A set of key-value pairs to pass to the screen when it is shown.\n\t\t */\n\t\tpublic function StackScreenNavigatorItem(screen:Object = null, pushEvents:Object = null, popEvent:String = null, properties:Object = null)\n\t\t{\n\t\t\tthis._screen = screen;\n\t\t\tthis._pushEvents = pushEvents ? pushEvents : {};\n\t\t\tif(popEvent)\n\t\t\t{\n\t\t\t\tthis.addPopEvent(popEvent);\n\t\t\t}\n\t\t\tthis._properties = properties ? properties : {};\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _screen:Object;\n\n\t\t/**\n\t\t * The screen to be displayed by the <code>ScreenNavigator</code>. It\n\t\t * may be one of several possible types:\n\t\t *\n\t\t * <ul>\n\t\t *     <li>a <code>Class</code> that may be instantiated to create a <code>DisplayObject</code></li>\n\t\t *     <li>a <code>Function</code> that returns a <code>DisplayObject</code></li>\n\t\t *     <li>a Starling <code>DisplayObject</code> that is already instantiated</li>\n\t\t * </ul>\n\t\t *\n\t\t * <p>If the screen is a <code>Class</code> or a <code>Function</code>,\n\t\t * a new instance of the screen will be instantiated every time that it\n\t\t * is shown by the <code>ScreenNavigator</code>. The screen's state\n\t\t * will not be saved automatically. The screen's state may be saved in\n\t\t * <code>properties</code>, if needed.</p>\n\t\t *\n\t\t * <p>If the screen is a <code>DisplayObject</code>, the same instance\n\t\t * will be reused every time that it is shown by the\n\t\t * <code>ScreenNavigator</code> When the screen is shown again, its\n\t\t * state will remain the same as when it was previously hidden. However,\n\t\t * the screen will also be kept in memory even when it isn't visible,\n\t\t * limiting the resources that are available for other screens.</p>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get screen():Object\n\t\t{\n\t\t\treturn this._screen;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set screen(value:Object):void\n\t\t{\n\t\t\tthis._screen = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _pushEvents:Object;\n\n\t\t/**\n\t\t * A set of key-value pairs representing actions that should be\n\t\t * triggered when events are dispatched by the screen when it is shown.\n\t\t * A pair's key is the event type to listen for (or the property name of\n\t\t * an <code>ISignal</code> instance), and a pair's value is one of two\n\t\t * possible types. When this event is dispatched, and a pair's value\n\t\t * is a <code>String</code>, the <code>StackScreenNavigator</code> will\n\t\t * show another screen with an ID equal to the string value. When this\n\t\t * event is dispatched, and the pair's value is a <code>Function</code>,\n\t\t * the function will be called as if it were a listener for the event.\n\t\t *\n\t\t * @see #setFunctionForPushEvent()\n\t\t * @see #setScreenIDForPushEvent()\n\t\t */\n\t\tpublic function get pushEvents():Object\n\t\t{\n\t\t\treturn this._pushEvents;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set pushEvents(value:Object):void\n\t\t{\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = {};\n\t\t\t}\n\t\t\tthis._pushEvents = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _replaceEvents:Object;\n\n\t\t/**\n\t\t * A set of key-value pairs representing actions that should be\n\t\t * triggered when events are dispatched by the screen when it is shown.\n\t\t * A pair's key is the event type to listen for (or the property name of\n\t\t * an <code>ISignal</code> instance), and a pair's value is a\n\t\t * <code>String</code> that is the ID of another screen that will\n\t\t * replace the currently active screen.\n\t\t *\n\t\t * @see #setScreenIDForReplaceEvent()\n\t\t */\n\t\tpublic function get replaceEvents():Object\n\t\t{\n\t\t\treturn this._replaceEvents;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set replaceEvents(value:Object):void\n\t\t{\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = {};\n\t\t\t}\n\t\t\tthis._replaceEvents = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _popEvents:Vector.<String>;\n\n\t\t/**\n\t\t * A list of events that will cause the screen navigator to pop this\n\t\t * screen off the top of the stack.\n\t\t *\n\t\t * @see #addPopEvent()\n\t\t * @see #removePopEvent()\n\t\t */\n\t\tpublic function get popEvents():Vector.<String>\n\t\t{\n\t\t\treturn this._popEvents;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set popEvents(value:Vector.<String>):void\n\t\t{\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new <String>[];\n\t\t\t}\n\t\t\tthis._popEvents = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _popToRootEvents:Vector.<String>;\n\n\t\t/**\n\t\t * A list of events that will cause the screen navigator to clear its\n\t\t * stack and show the first screen added to the stack.\n\t\t *\n\t\t * @see #addPopToRootEvent()\n\t\t * @see #removePopToRootEvent()\n\t\t */\n\t\tpublic function get popToRootEvents():Vector.<String>\n\t\t{\n\t\t\treturn this._popToRootEvents;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set popToRootEvents(value:Vector.<String>):void\n\t\t{\n\t\t\tthis._popToRootEvents = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _properties:Object;\n\n\t\t/**\n\t\t * A set of key-value pairs representing properties to be set on the\n\t\t * screen when it is shown. A pair's key is the name of the screen's\n\t\t * property, and a pair's value is the value to be passed to the\n\t\t * screen's property.\n\t\t */\n\t\tpublic function get properties():Object\n\t\t{\n\t\t\treturn this._properties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set properties(value:Object):void\n\t\t{\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = {};\n\t\t\t}\n\t\t\tthis._properties = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _pushTransition:Function;\n\n\t\t/**\n\t\t * A custom push transition for this screen only. If <code>null</code>,\n\t\t * the default <code>pushTransition</code> defined by the\n\t\t * <code>StackScreenNavigator</code> will be used.\n\t\t *\n\t\t * <p>In the following example, the screen navigator item is given a\n\t\t * push transition:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * item.pushTransition = Slide.createSlideLeftTransition();</listing>\n\t\t *\n\t\t * <p>A number of animated transitions may be found in the\n\t\t * <a href=\"../motion/package-detail.html\">feathers.motion</a> package.\n\t\t * However, you are not limited to only these transitions. It's possible\n\t\t * to create custom transitions too.</p>\n\t\t *\n\t\t * <p>A custom transition function should have the following signature:</p>\n\t\t * <pre>function(oldScreen:DisplayObject, newScreen:DisplayObject, completeCallback:Function):void</pre>\n\t\t *\n\t\t * <p>Either of the <code>oldScreen</code> and <code>newScreen</code>\n\t\t * arguments may be <code>null</code>, but never both. The\n\t\t * <code>oldScreen</code> argument will be <code>null</code> when the\n\t\t * first screen is displayed or when a new screen is displayed after\n\t\t * clearing the screen. The <code>newScreen</code> argument will\n\t\t * be null when clearing the screen.</p>\n\t\t *\n\t\t * <p>The <code>completeCallback</code> function <em>must</em> be called\n\t\t * when the transition effect finishes. This callback indicate to the\n\t\t * screen navigator that the transition has finished. This function has\n\t\t * the following signature:</p>\n\t\t *\n\t\t * <pre>function(cancelTransition:Boolean = false):void</pre>\n\t\t *\n\t\t * <p>The first argument defaults to <code>false</code>, meaning that\n\t\t * the transition completed successfully. In most cases, this callback\n\t\t * may be called without arguments. If a transition is cancelled before\n\t\t * completion (perhaps through some kind of user interaction), and the\n\t\t * previous screen should be restored, pass <code>true</code> as the\n\t\t * first argument to the callback to inform the screen navigator that\n\t\t * the transition is cancelled.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see ../../../help/transitions.html Transitions for Feathers screen navigators\n\t\t */\n\t\tpublic function get pushTransition():Function\n\t\t{\n\t\t\treturn this._pushTransition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set pushTransition(value:Function):void\n\t\t{\n\t\t\tthis._pushTransition = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _popTransition:Function;\n\n\t\t/**\n\t\t * A custom pop transition for this screen only. If <code>null</code>,\n\t\t * the default <code>popTransition</code> defined by the\n\t\t * <code>StackScreenNavigator</code> will be used.\n\t\t *\n\t\t * <p>In the following example, the screen navigator item is given a\n\t\t * pop transition:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * item.popTransition = Slide.createSlideRightTransition();</listing>\n\t\t *\n\t\t * <p>A number of animated transitions may be found in the\n\t\t * <a href=\"../motion/package-detail.html\">feathers.motion</a> package.\n\t\t * However, you are not limited to only these transitions. It's possible\n\t\t * to create custom transitions too.</p>\n\t\t *\n\t\t * <p>The function should have the following signature:</p>\n\t\t * <pre>function(oldScreen:DisplayObject, newScreen:DisplayObject, completeCallback:Function):void</pre>\n\t\t *\n\t\t * <p>Either of the <code>oldScreen</code> and <code>newScreen</code>\n\t\t * arguments may be <code>null</code>, but never both. The\n\t\t * <code>oldScreen</code> argument will be <code>null</code> when the\n\t\t * first screen is displayed or when a new screen is displayed after\n\t\t * clearing the screen. The <code>newScreen</code> argument will\n\t\t * be null when clearing the screen.</p>\n\t\t *\n\t\t * <p>The <code>completeCallback</code> function <em>must</em> be called\n\t\t * when the transition effect finishes. This callback indicate to the\n\t\t * screen navigator that the transition has finished. This function has\n\t\t * the following signature:</p>\n\t\t *\n\t\t * <pre>function(cancelTransition:Boolean = false):void</pre>\n\t\t *\n\t\t * <p>The first argument defaults to <code>false</code>, meaning that\n\t\t * the transition completed successfully. In most cases, this callback\n\t\t * may be called without arguments. If a transition is cancelled before\n\t\t * completion (perhaps through some kind of user interaction), and the\n\t\t * previous screen should be restored, pass <code>true</code> as the\n\t\t * first argument to the callback to inform the screen navigator that\n\t\t * the transition is cancelled.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see ../../../help/transitions.html Transitions for Feathers screen navigators\n\t\t */\n\t\tpublic function get popTransition():Function\n\t\t{\n\t\t\treturn this._popTransition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set popTransition(value:Function):void\n\t\t{\n\t\t\tthis._popTransition = value;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get canDispose():Boolean\n\t\t{\n\t\t\treturn !(this._screen is DisplayObject);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _transitionDelayEvent:String = null;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get transitionDelayEvent():String\n\t\t{\n\t\t\treturn this._transitionDelayEvent;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set transitionDelayEvent(value:String):void\n\t\t{\n\t\t\tthis._transitionDelayEvent = value;\n\t\t}\n\n\t\t/**\n\t\t * Specifies a function to call when an event is dispatched by the\n\t\t * screen.\n\t\t *\n\t\t * <p>If the screen is currently being displayed by a\n\t\t * <code>StackScreenNavigator</code>, and you call\n\t\t * <code>setFunctionForPushEvent()</code> on the <code>StackScreenNavigatorItem</code>,\n\t\t * the <code>StackScreenNavigator</code> won't listen for the event\n\t\t * until the next time that the screen is shown.</p>\n\t\t *\n\t\t * @see #setScreenIDForPushEvent()\n\t\t * @see #clearEvent()\n\t\t * @see #events\n\t\t */\n\t\tpublic function setFunctionForPushEvent(eventType:String, action:Function):void\n\t\t{\n\t\t\tthis._pushEvents[eventType] = action;\n\t\t}\n\n\t\t/**\n\t\t * Specifies another screen to push on the stack when an event is\n\t\t * dispatched by this screen. The other screen should be specified by\n\t\t * its ID that was registered with a call to <code>addScreen()</code> on\n\t\t * the <code>StackScreenNavigator</code>.\n\t\t *\n\t\t * <p>If the screen is currently being displayed by a\n\t\t * <code>StackScreenNavigator</code>, and you call\n\t\t * <code>setScreenIDForPushEvent()</code> on the <code>StackScreenNavigatorItem</code>,\n\t\t * the <code>StackScreenNavigator</code> won't listen for the event\n\t\t * until the next time that the screen is shown.</p>\n\t\t *\n\t\t * @see #setFunctionForPushEvent()\n\t\t * @see #clearPushEvent()\n\t\t * @see #pushEvents\n\t\t */\n\t\tpublic function setScreenIDForPushEvent(eventType:String, screenID:String):void\n\t\t{\n\t\t\tthis._pushEvents[eventType] = screenID;\n\t\t}\n\n\t\t/**\n\t\t * Cancels the \"push\" action previously registered to be triggered when\n\t\t * the screen dispatches an event.\n\t\t *\n\t\t * @see #pushEvents\n\t\t */\n\t\tpublic function clearPushEvent(eventType:String):void\n\t\t{\n\t\t\tdelete this._pushEvents[eventType];\n\t\t}\n\n\t\t/**\n\t\t * Specifies another screen to replace this screen on the top of the\n\t\t * stack when an event is dispatched by this screen. The other screen\n\t\t * should be specified by its ID that was registered with a call to\n\t\t * <code>addScreen()</code> on the <code>StackScreenNavigator</code>.\n\t\t *\n\t\t * <p>If the screen is currently being displayed by a\n\t\t * <code>StackScreenNavigator</code>, and you call\n\t\t * <code>setScreenIDForPushEvent()</code> on the <code>StackScreenNavigatorItem</code>,\n\t\t * the <code>StackScreenNavigator</code> won't listen for the event\n\t\t * until the next time that the screen is shown.</p>\n\t\t *\n\t\t * @see #clearReplaceEvent()\n\t\t * @see #replaceEvents\n\t\t */\n\t\tpublic function setScreenIDForReplaceEvent(eventType:String, screenID:String):void\n\t\t{\n\t\t\tif(!this._replaceEvents)\n\t\t\t{\n\t\t\t\tthis._replaceEvents = {};\n\t\t\t}\n\t\t\tthis._replaceEvents[eventType] = screenID;\n\t\t}\n\n\t\t/**\n\t\t * Cancels the \"replace\" action previously registered to be triggered\n\t\t * when the screen dispatches an event.\n\t\t *\n\t\t * @see #replaceEvents\n\t\t */\n\t\tpublic function clearReplaceEvent(eventType:String):void\n\t\t{\n\t\t\tif(!this._replaceEvents)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdelete this._replaceEvents[eventType];\n\t\t}\n\n\t\t/**\n\t\t * Specifies an event dispatched by the screen that will cause the\n\t\t * <code>StackScreenNavigator</code> to pop the screen off the top of\n\t\t * the stack and return to the previous screen.\n\t\t *\n\t\t * <p>If the screen is currently being displayed by a\n\t\t * <code>StackScreenNavigator</code>, and you call\n\t\t * <code>addPopEvent()</code> on the <code>StackScreenNavigatorItem</code>,\n\t\t * the <code>StackScreenNavigator</code> won't listen for the event\n\t\t * until the next time that the screen is shown.</p>\n\t\t *\n\t\t * @see #removePopEvent()\n\t\t * @see #popEvents\n\t\t */\n\t\tpublic function addPopEvent(eventType:String):void\n\t\t{\n\t\t\tif(!this._popEvents)\n\t\t\t{\n\t\t\t\tthis._popEvents = new <String>[];\n\t\t\t}\n\t\t\tvar index:int = this._popEvents.indexOf(eventType);\n\t\t\tif(index >= 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._popEvents[this._popEvents.length] = eventType;\n\t\t}\n\n\t\t/**\n\t\t * Removes an event that would cause the <code>StackScreenNavigator</code>\n\t\t * to remove this screen from the top of the stack.\n\t\t *\n\t\t * <p>If the screen is currently being displayed by a\n\t\t * <code>StackScreenNavigator</code>, and you call\n\t\t * <code>removePopEvent()</code> on the <code>StackScreenNavigatorItem</code>,\n\t\t * the <code>StackScreenNavigator</code> won't remove the listener for\n\t\t * the event on the currently displayed screen. The event listener won't\n\t\t * be added the next time that the screen is shown.</p>\n\t\t *\n\t\t * @see #addPopEvent()\n\t\t * @see #popEvents\n\t\t */\n\t\tpublic function removePopEvent(eventType:String):void\n\t\t{\n\t\t\tif(!this._popEvents)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar index:int = this._popEvents.indexOf(eventType);\n\t\t\tif(index == -1)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._popEvents.removeAt(index);\n\t\t}\n\n\t\t/**\n\t\t * Specifies an event dispatched by the screen that will cause the\n\t\t * <code>StackScreenNavigator</code> to pop the screen off the top of\n\t\t * the stack and return to the previous screen.\n\t\t *\n\t\t * <p>If the screen is currently being displayed by a\n\t\t * <code>StackScreenNavigator</code>, and you call\n\t\t * <code>addPopToRootEvent()</code> on the <code>StackScreenNavigatorItem</code>,\n\t\t * the <code>StackScreenNavigator</code> won't listen for the event\n\t\t * until the next time that the screen is shown.</p>\n\t\t *\n\t\t * @see #removePopToRootEvent()\n\t\t * @see #popToRootEvents\n\t\t */\n\t\tpublic function addPopToRootEvent(eventType:String):void\n\t\t{\n\t\t\tif(!this._popToRootEvents)\n\t\t\t{\n\t\t\t\tthis._popToRootEvents = new <String>[];\n\t\t\t}\n\t\t\tvar index:int = this._popToRootEvents.indexOf(eventType);\n\t\t\tif(index >= 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._popToRootEvents[this._popToRootEvents.length] = eventType;\n\t\t}\n\n\t\t/**\n\t\t * Removes an event that would have cause the <code>StackScreenNavigator</code>\n\t\t * to clear its stack to show the first screen added to the stack.\n\t\t *\n\t\t * <p>If the screen is currently being displayed by a\n\t\t * <code>StackScreenNavigator</code>, and you call\n\t\t * <code>removePopEvent()</code> on the <code>StackScreenNavigatorItem</code>,\n\t\t * the <code>StackScreenNavigator</code> won't remove the listener for\n\t\t * the event on the currently displayed screen. The event listener won't\n\t\t * be added the next time that the screen is shown.</p>\n\t\t *\n\t\t * @see #addPopToRootEvent()\n\t\t * @see #popToRootEvents\n\t\t */\n\t\tpublic function removePopToRootEvent(eventType:String):void\n\t\t{\n\t\t\tif(!this._popToRootEvents)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar index:int = this._popToRootEvents.indexOf(eventType);\n\t\t\tif(index == -1)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._popToRootEvents.removeAt(index);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getScreen():DisplayObject\n\t\t{\n\t\t\tvar screenInstance:DisplayObject;\n\t\t\tif(this._screen is Class)\n\t\t\t{\n\t\t\t\tvar ScreenType:Class = Class(this._screen);\n\t\t\t\tscreenInstance = new ScreenType();\n\t\t\t}\n\t\t\telse if(this._screen is Function)\n\t\t\t{\n\t\t\t\tscreenInstance = DisplayObject((this._screen as Function)());\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tscreenInstance = DisplayObject(this._screen);\n\t\t\t}\n\t\t\tif(!(screenInstance is DisplayObject))\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"StackScreenNavigatorItem \\\"getScreen()\\\" must return a Starling display object.\");\n\t\t\t}\n\t\t\tif(this._properties)\n\t\t\t{\n\t\t\t\tfor(var propertyName:String in this._properties)\n\t\t\t\t{\n\t\t\t\t\tscreenInstance[propertyName] = this._properties[propertyName];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn screenInstance;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/StepperButtonLayoutMode.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\t/**\n\t * Layout options for stepper controls.\n\t *\n\t * @see feathers.controls.NumericStepper\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class StepperButtonLayoutMode\n\t{\n\t\t/**\n\t\t * The decrement button will be placed on the left side of the text\n\t\t * input and the increment button will be placed on the right side of\n\t\t * the text input.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const SPLIT_HORIZONTAL:String = \"splitHorizontal\";\n\n\t\t/**\n\t\t * The decrement button will be placed below the text input and the\n\t\t * increment button will be placed above the text input.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const SPLIT_VERTICAL:String = \"splitVertical\";\n\n\t\t/**\n\t\t * Both the decrement and increment button will be placed on the right\n\t\t * side of the text input. The increment button will be above the\n\t\t * decrement button.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const RIGHT_SIDE_VERTICAL:String = \"rightSideVertical\";\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/TabBar.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IFocusDisplayObject;\n\timport feathers.core.IMeasureDisplayObject;\n\timport feathers.core.ITextBaselineControl;\n\timport feathers.core.IValidating;\n\timport feathers.core.PropertyProxy;\n\timport feathers.core.ToggleGroup;\n\timport feathers.data.IListCollection;\n\timport feathers.dragDrop.DragData;\n\timport feathers.dragDrop.DragDropManager;\n\timport feathers.dragDrop.IDragSource;\n\timport feathers.dragDrop.IDropTarget;\n\timport feathers.events.CollectionEventType;\n\timport feathers.events.DragDropEvent;\n\timport feathers.events.ExclusiveTouch;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.Direction;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.HorizontalLayout;\n\timport feathers.layout.LayoutBoundsResult;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.layout.ViewPortBounds;\n\timport feathers.skins.IStyleProvider;\n\n\timport flash.geom.Point;\n\timport flash.ui.Keyboard;\n\timport flash.utils.Dictionary;\n\n\timport starling.animation.Transitions;\n\timport starling.animation.Tween;\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.events.KeyboardEvent;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.utils.Pool;\n\n\t/**\n\t * A style name to add to the first tab in this tab bar. Typically used\n\t * by a theme to provide different styles to the first tab.\n\t *\n\t * <p>In the following example, a custom first tab style name is\n\t * provided to the tab bar:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * tabs.customFirstTabStyleName = \"my-custom-first-tab\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( ToggleButton ).setFunctionForStyleName( \"my-custom-first-tab\", setCustomFirstTabStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #style:customTabStyleName\n\t * @see #style:customLastTabStyleName\n\t */\n\t[Style(name=\"customFirstTabStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to the last tab in this tab bar. Typically used\n\t * by a theme to provide different styles to the last tab.\n\t *\n\t * <p>In the following example, a custom last tab style name is provided\n\t * to the tab bar:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * tabs.customLastTabStyleName = \"my-custom-last-tab\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( ToggleButton ).setFunctionForStyleName( \"my-custom-last-tab\", setCustomLastTabStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #style:customTabStyleName\n\t * @see #style:customFirstTabStyleName\n\t */\n\t[Style(name=\"customLastTabStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to all tabs in this tab bar. Typically used by a\n\t * theme to provide different styles to different tab bars.\n\t *\n\t * <p>In the following example, a custom tab style name is provided to\n\t * the tab bar:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * tabs.customTabStyleName = \"my-custom-tab\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( ToggleButton ).setFunctionForStyleName( \"my-custom-tab\", setCustomTabStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_TAB\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #style:customFirstTabStyleName\n\t * @see #style:customLastTabStyleName\n\t */\n\t[Style(name=\"customTabStyleName\",type=\"String\")]\n\n\t/**\n\t * The tab bar layout is either vertical or horizontal.\n\t *\n\t * <p>In the following example, the tab bar's direction is set to\n\t * vertical:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * tabs.direction = Direction.VERTICAL;</listing>\n\t *\n\t * <p><strong>Note:</strong> The <code>Direction.NONE</code>\n\t * constant is not supported.</p>\n\t *\n\t * @default feathers.layout.Direction.HORIZONTAL\n\t *\n\t * @see feathers.layout.Direction#HORIZONTAL\n\t * @see feathers.layout.Direction#VERTICAL\n\t */\n\t[Style(name=\"direction\",type=\"String\")]\n\n\t/**\n\t * If <code>true</code>, the tabs will be equally sized in the direction\n\t * of the layout. In other words, if the tab bar is horizontal, each tab\n\t * will have the same width, and if the tab bar is vertical, each tab\n\t * will have the same height. If <code>false</code>, the tabs will be\n\t * sized to their ideal dimensions.\n\t *\n\t * <p>The following example aligns the tabs to the middle without distributing them:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * tabs.direction = Direction.VERTICAL;\n\t * tabs.verticalAlign = VerticalAlign.MIDDLE;\n\t * tabs.distributeTabSizes = false;</listing>\n\t *\n\t * @default true\n\t */\n\t[Style(name=\"distributeTabSizes\",type=\"Boolean\")]\n\n\t/**\n\t * A skin to display when dragging one an item to indicate where it can be\n\t * dropped.\n\t *\n\t * <p>In the following example, the tab bar's drop indicator is provided:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * tabs.dropIndicatorSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t */\n\t[Style(name=\"dropIndicatorSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * Space, in pixels, between the first two tabs. If <code>NaN</code>,\n\t * the default <code>gap</code> property will be used.\n\t *\n\t * <p>The following example sets the gap between the first and second\n\t * tab to a different value than the standard gap:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * tabs.firstGap = 30;\n\t * tabs.gap = 20;</listing>\n\t *\n\t * @default NaN\n\t *\n\t * @see #style:gap\n\t * @see #style:lastGap\n\t */\n\t[Style(name=\"firstGap\",type=\"Number\")]\n\n\t/**\n\t * Space, in pixels, between tabs.\n\t *\n\t * <p>In the following example, the tab bar's gap is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * tabs.gap = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:firstGap\n\t * @see #style:lastGap\n\t */\n\t[Style(name=\"gap\",type=\"Number\")]\n\n\t/**\n\t * Determines how the tabs are horizontally aligned within the bounds\n\t * of the tab bar (on the x-axis).\n\t *\n\t * <p>The following example aligns the tabs to the left:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * tabs.horizontalAlign = HorizontalAlign.LEFT;</listing>\n\t *\n\t * @default feathers.layout.HorizontalAlign.JUSTIFY\n\t *\n\t * @see feathers.layout.HorizontalAlign#LEFT\n\t * @see feathers.layout.HorizontalAlign#CENTER\n\t * @see feathers.layout.HorizontalAlign#RIGHT\n\t * @see feathers.layout.HorizontalAlign#JUSTIFY\n\t */\n\t[Style(name=\"horizontalAlign\",type=\"String\")]\n\n\t/**\n\t * Space, in pixels, between the last two tabs. If <code>NaN</code>,\n\t * the default <code>gap</code> property will be used.\n\t *\n\t * <p>The following example sets the gap between the last and next to last\n\t * tab to a different value than the standard gap:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * tabs.lastGap = 30;\n\t * tabs.gap = 20;</listing>\n\t *\n\t * @default NaN\n\t *\n\t * @see #style:gap\n\t * @see #style:firstGap\n\t */\n\t[Style(name=\"lastGap\",type=\"Number\")]\n\n\t/**\n\t * Quickly sets all padding properties to the same value. The\n\t * <code>padding</code> getter always returns the value of\n\t * <code>paddingTop</code>, but the other padding values may be\n\t * different.\n\t *\n\t * <p>In the following example, the padding of all sides of the tab bar\n\t * is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * tabs.padding = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:paddingTop\n\t * @see #style:paddingRight\n\t * @see #style:paddingBottom\n\t * @see #style:paddingLeft\n\t */\n\t[Style(name=\"padding\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the tab bar's top edge and the\n\t * tabs.\n\t *\n\t * <p>In the following example, the padding on the top edge of the\n\t * tab bar is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * tabs.paddingTop = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingTop\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the tab bar's right edge and\n\t * the tabs.\n\t *\n\t * <p>In the following example, the padding on the right edge of the\n\t * tab bar is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * tabs.paddingRight = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingRight\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the tab bar's bottom edge and\n\t * the tabs.\n\t *\n\t * <p>In the following example, the padding on the bottom edge of the\n\t * tab bar is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * tabs.paddingBottom = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingBottom\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the tab bar's left edge and the\n\t * tabs.\n\t *\n\t * <p>In the following example, the padding on the left edge of the\n\t * tab bar is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * tabs.paddingLeft = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingLeft\",type=\"Number\")]\n\n\t/**\n\t * The time, in seconds, of the animation that changes the position and\n\t * size of the <code>selectionSkin</code> skin when the selected\n\t * tab changes.\n\t *\n\t * <p>The following example customizes the duration to 500ms:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * tabs.selectionChangeDuration = 0.5;</listing>\n\t *\n\t * @default 0.25\n\t *\n\t * @see #style:selectionSkin\n\t * @see #style:selectionChangeEase\n\t */\n\t[Style(name=\"selectionChangeDuration\",type=\"Number\")]\n\n\t/**\n\t * The easing function used for moving and resizing the\n\t * <code>selectionSkin</code> when the selected tab changes.\n\t *\n\t * <p>In the following example, the ease of the animation that moves\n\t * the <code>selectionSkin</code> is customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * tabs.selectionChangeEase = Transitions.EASE_IN_OUT;</listing>\n\t *\n\t * @default starling.animation.Transitions.EASE_OUT\n\t *\n\t * @see http://doc.starling-framework.org/core/starling/animation/Transitions.html starling.animation.Transitions\n\t * @see #style:selectionSkin\n\t * @see #style:selectionChangeDuration\n\t */\n\t[Style(name=\"selectionChangeEase\",type=\"Object\")]\n\n\t/**\n\t * A skin displayed over the selected tab. Its position is animated when\n\t * the selection changes.\n\t *\n\t * <p>The following example passes the tab bar a selection skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var skin:Image = new Image(texture)\n\t * skin.scale9Grid = new Rectangle(1, 2, 4, 4);\n\t * tabs.selectionSkin = skin;</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:selectionChangeDuration\n\t * @see #style:selectionChangeEase\n\t */\n\t[Style(name=\"selectionSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * Determines how the tabs are vertically aligned within the bounds\n\t * of the tab bar (on the y-axis).\n\t *\n\t * <p>The following example aligns the tabs to the top:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * tabs.verticalAlign = VerticalAlign.TOP;</listing>\n\t *\n\t * @default feathers.layout.VerticalAlign.JUSTIFY\n\t *\n\t * @see feathers.layout.VerticalAlign#TOP\n\t * @see feathers.layout.VerticalAlign#MIDDLE\n\t * @see feathers.layout.VerticalAlign#BOTTOM\n\t * @see feathers.layout.VerticalAlign#JUSTIFY\n\t */\n\t[Style(name=\"verticalAlign\",type=\"String\")]\n\n\t/**\n\t * Dispatched when the selected tab changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #selectedItem\n\t * @see #selectedIndex\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when one of the tabs is triggered. The <code>data</code>\n\t * property of the event contains the item from the data provider that is\n\t * associated with the tab that was triggered.\n\t *\n\t * <p>The following example listens to <code>Event.TRIGGERED</code> on the\n\t * tab bar:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * tabs.dataProvider = new ArrayCollection(\n\t * [\n\t *     { label: \"1\" },\n\t *     { label: \"2\" },\n\t *     { label: \"3\" },\n\t * ]);\n\t * tabs.addEventListener( Event.TRIGGERED, function( event:Event, data:Object ):void\n\t * {\n\t *    trace( \"The tab with label \\\"\" + data.label + \"\\\" was triggered.\" );\n\t * }</listing>\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The item associated with the tab\n\t *   that was triggered.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.TRIGGERED\n\t */\n\t[Event(name=\"triggered\",type=\"starling.events.Event\")]\n\n\t/**\n\t * A line of tabs (vertical or horizontal), where one may be selected at a\n\t * time.\n\t *\n\t * <p>The following example sets the data provider, selects the second tab,\n\t * and listens for when the selection changes:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var tabs:TabBar = new TabBar();\n\t * tabs.dataProvider = new ArrayCollection(\n\t * [\n\t *     { label: \"One\" },\n\t *     { label: \"Two\" },\n\t *     { label: \"Three\" },\n\t * ]);\n\t * tabs.selectedIndex = 1;\n\t * tabs.addEventListener( Event.CHANGE, tabs_changeHandler );\n\t * this.addChild( tabs );</listing>\n\t *\n\t * @see ../../../help/tab-bar.html How to use the Feathers TabBar component\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class TabBar extends FeathersControl implements IFocusDisplayObject, ITextBaselineControl, IDragSource, IDropTarget\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_TAB_FACTORY:String = \"tabFactory\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const DEFAULT_TAB_FIELDS:Vector.<String> = new <String>\n\t\t[\n\t\t\t\"upIcon\",\n\t\t\t\"downIcon\",\n\t\t\t\"hoverIcon\",\n\t\t\t\"disabledIcon\",\n\t\t\t\"defaultSelectedIcon\",\n\t\t\t\"selectedUpIcon\",\n\t\t\t\"selectedDownIcon\",\n\t\t\t\"selectedHoverIcon\",\n\t\t\t\"selectedDisabledIcon\",\n\t\t\t\"name\"\n\t\t];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const DEFAULT_DRAG_FORMAT:String = \"feathers-tab-bar-item\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the tabs.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_TAB:String = \"feathers-tab-bar-tab\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>TabBar</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultTabFactory():ToggleButton\n\t\t{\n\t\t\treturn new ToggleButton();\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function TabBar()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the tabs. This\n\t\t * variable is <code>protected</code> so that sub-classes can customize\n\t\t * the tab style name in their constructors instead of using the default\n\t\t * style name defined by <code>DEFAULT_CHILD_STYLE_NAME_TAB</code>.\n\t\t *\n\t\t * <p>To customize the tab style name without subclassing, see\n\t\t * <code>customTabStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customTabStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var tabStyleName:String = DEFAULT_CHILD_STYLE_NAME_TAB;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the first tab.\n\t\t * This variable is <code>protected</code> so that sub-classes can\n\t\t * customize the first tab style name in their constructors instead of\n\t\t * using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_TAB</code>.\n\t\t *\n\t\t * <p>To customize the first tab name without subclassing, see\n\t\t * <code>customFirstTabStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customFirstTabStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var firstTabStyleName:String = DEFAULT_CHILD_STYLE_NAME_TAB;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the last tab.\n\t\t * This variable is <code>protected</code> so that sub-classes can\n\t\t * customize the last tab style name in their constructors instead of\n\t\t * using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_TAB</code>.\n\t\t *\n\t\t * <p>To customize the last tab name without subclassing, see\n\t\t * <code>customLastTabStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customLastTabStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var lastTabStyleName:String = DEFAULT_CHILD_STYLE_NAME_TAB;\n\n\t\t/**\n\t\t * The toggle group.\n\t\t */\n\t\tprotected var toggleGroup:ToggleGroup;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var activeFirstTab:ToggleButton;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var inactiveFirstTab:ToggleButton;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var activeLastTab:ToggleButton;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var inactiveLastTab:ToggleButton;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _layoutItems:Vector.<DisplayObject> = new <DisplayObject>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var activeTabs:Vector.<ToggleButton> = new <ToggleButton>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var inactiveTabs:Vector.<ToggleButton> = new <ToggleButton>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _tabToItem:Dictionary = new Dictionary(true);\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn TabBar.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _dataProvider:IListCollection;\n\n\t\t/**\n\t\t * The collection of data to be displayed with tabs. The default\n\t\t * <em>tab initializer</em> interprets this data to customize the tabs\n\t\t * with various fields available to buttons, including the following:\n\t\t *\n\t\t * <ul>\n\t\t *     <li>label</li>\n\t\t *     <li>defaultIcon</li>\n\t\t *     <li>upIcon</li>\n\t\t *     <li>downIcon</li>\n\t\t *     <li>hoverIcon</li>\n\t\t *     <li>disabledIcon</li>\n\t\t *     <li>defaultSelectedIcon</li>\n\t\t *     <li>selectedUpIcon</li>\n\t\t *     <li>selectedDownIcon</li>\n\t\t *     <li>selectedHoverIcon</li>\n\t\t *     <li>selectedDisabledIcon</li>\n\t\t *     <li>isEnabled</li>\n\t\t *     <li>name</li>\n\t\t * </ul>\n\t\t *\n\t\t * <p>The following example passes in a data provider:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.dataProvider = new ArrayCollection(\n\t\t * [\n\t\t *     { label: \"General\", defaultIcon: new Image( generalTexture ) },\n\t\t *     { label: \"Security\", defaultIcon: new Image( securityTexture ) },\n\t\t *     { label: \"Advanced\", defaultIcon: new Image( advancedTexture ) },\n\t\t * ]);</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #tabInitializer\n\t\t * @see feathers.data.ArrayCollection\n\t\t * @see feathers.data.VectorCollection\n\t\t * @see feathers.data.XMLListCollection\n\t\t */\n\t\tpublic function get dataProvider():IListCollection\n\t\t{\n\t\t\treturn this._dataProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set dataProvider(value:IListCollection):void\n\t\t{\n\t\t\tif(this._dataProvider == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar oldSelectedIndex:int = this.selectedIndex;\n\t\t\tvar oldSelectedItem:Object = this.selectedItem;\n\t\t\tif(this._dataProvider)\n\t\t\t{\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.ADD_ITEM, dataProvider_addItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.REMOVE_ITEM, dataProvider_removeItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.REMOVE_ALL, dataProvider_removeAllHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.REPLACE_ITEM, dataProvider_replaceItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.FILTER_CHANGE, dataProvider_filterChangeHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.SORT_CHANGE, dataProvider_sortChangeHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.UPDATE_ITEM, dataProvider_updateItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.UPDATE_ALL, dataProvider_updateAllHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.RESET, dataProvider_resetHandler);\n\t\t\t}\n\t\t\tthis._dataProvider = value;\n\t\t\tif(this._dataProvider)\n\t\t\t{\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.ADD_ITEM, dataProvider_addItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.REMOVE_ITEM, dataProvider_removeItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.REMOVE_ALL, dataProvider_removeAllHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.REPLACE_ITEM, dataProvider_replaceItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.FILTER_CHANGE, dataProvider_filterChangeHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.SORT_CHANGE, dataProvider_sortChangeHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.UPDATE_ITEM, dataProvider_updateItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.UPDATE_ALL, dataProvider_updateAllHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.RESET, dataProvider_resetHandler);\n\t\t\t}\n\t\t\tif(!this._dataProvider || this._dataProvider.length == 0)\n\t\t\t{\n\t\t\t\tthis.selectedIndex = -1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.selectedIndex = 0;\n\t\t\t}\n\t\t\t//this ensures that Event.CHANGE will dispatch for selectedItem\n\t\t\t//changing, even if selectedIndex has not changed.\n\t\t\tif(this.selectedIndex == oldSelectedIndex && this.selectedItem != oldSelectedItem)\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var verticalLayout:VerticalLayout;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var horizontalLayout:HorizontalLayout;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _viewPortBounds:ViewPortBounds = new ViewPortBounds();\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _layoutResult:LayoutBoundsResult = new LayoutBoundsResult();\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _direction:String = Direction.HORIZONTAL;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"horizontal,vertical\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get direction():String\n\t\t{\n\t\t\treturn this._direction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set direction(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._direction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._direction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalAlign:String = HorizontalAlign.JUSTIFY;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"left,center,right,justify\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get horizontalAlign():String\n\t\t{\n\t\t\treturn this._horizontalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalAlign(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._horizontalAlign === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalAlign = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalAlign:String = VerticalAlign.JUSTIFY;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"top,middle,bottom,justify\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get verticalAlign():String\n\t\t{\n\t\t\treturn this._verticalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalAlign(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._verticalAlign === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalAlign = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectionSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get selectionSkin():DisplayObject\n\t\t{\n\t\t\treturn this._selectionSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectionSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._selectionSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._selectionSkin !== null &&\n\t\t\t\tthis._selectionSkin.parent === this)\n\t\t\t{\n\t\t\t\tthis._selectionSkin.removeFromParent(false);\n\t\t\t}\n\t\t\tthis._selectionSkin = value;\n\t\t\tif(this._selectionSkin !== null)\n\t\t\t{\n\t\t\t\tthis._selectionSkin.touchable = false;\n\t\t\t\tthis.addChild(this._selectionSkin);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectionChangeTween:Tween;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectionChangeDuration:Number = 0.25;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get selectionChangeDuration():Number\n\t\t{\n\t\t\treturn this._selectionChangeDuration;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectionChangeDuration(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._selectionChangeDuration = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectionChangeEase:Object = Transitions.EASE_OUT;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get selectionChangeEase():Object\n\t\t{\n\t\t\treturn this._selectionChangeEase;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectionChangeEase(value:Object):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._selectionChangeEase = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _distributeTabSizes:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get distributeTabSizes():Boolean\n\t\t{\n\t\t\treturn this._distributeTabSizes;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set distributeTabSizes(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._distributeTabSizes === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._distributeTabSizes = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _gap:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get gap():Number\n\t\t{\n\t\t\treturn this._gap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set gap(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._gap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._gap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _firstGap:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get firstGap():Number\n\t\t{\n\t\t\treturn this._firstGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set firstGap(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._firstGap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._firstGap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastGap:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get lastGap():Number\n\t\t{\n\t\t\treturn this._lastGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set lastGap(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._lastGap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._lastGap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get padding():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set padding(value:Number):void\n\t\t{\n\t\t\tthis.paddingTop = value;\n\t\t\tthis.paddingRight = value;\n\t\t\tthis.paddingBottom = value;\n\t\t\tthis.paddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingTop:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingTop():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingTop(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingTop = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingRight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingRight():Number\n\t\t{\n\t\t\treturn this._paddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingRight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingBottom:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingBottom():Number\n\t\t{\n\t\t\treturn this._paddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingBottom = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingLeft:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingLeft = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _tabFactory:Function = defaultTabFactory;\n\n\t\t/**\n\t\t * Creates each tab. A tab must be an instance of\n\t\t * <code>ToggleButton</code>. This factory can be used to change\n\t\t * properties on the tabs when they are first created. For instance, if\n\t\t * you are skinning Feathers components without a theme, you might use\n\t\t * this factory to set skins and other styles on a tab.\n\t\t *\n\t\t * <p>Optionally, the first tab and the last tab may be different than\n\t\t * the other tabs in the middle. Use the <code>firstTabFactory</code>\n\t\t * and/or the <code>lastTabFactory</code> to customize one or both of\n\t\t * these tabs.</p>\n\t\t *\n\t\t * <p>This function is expected to have the following signature:</p>\n\t\t *\n\t\t * <pre>function():ToggleButton</pre>\n\t\t *\n\t\t * <p>In the following example, a custom tab factory is passed to the\n\t\t * tab bar:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * tabs.tabFactory = function():ToggleButton\n\t\t * {\n\t\t *     var tab:ToggleButton = new ToggleButton();\n\t\t *     tab.defaultSkin = new Image( upTexture );\n\t\t *     tab.defaultSelectedSkin = new Image( selectedTexture );\n\t\t *     tab.downSkin = new Image( downTexture );\n\t\t *     return tab;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.ToggleButton\n\t\t * @see #firstTabFactory\n\t\t * @see #lastTabFactory\n\t\t */\n\t\tpublic function get tabFactory():Function\n\t\t{\n\t\t\treturn this._tabFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set tabFactory(value:Function):void\n\t\t{\n\t\t\tif(this._tabFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._tabFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TAB_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _firstTabFactory:Function;\n\n\t\t/**\n\t\t * If not <code>null</code>, creates the first tab. If the\n\t\t * <code>firstTabFactory</code> is <code>null</code>, then the tab bar\n\t\t * will use the <code>tabFactory</code>. The first tab must be an\n\t\t * instance of <code>ToggleButton</code>. This factory can be used to\n\t\t * change properties on the first tab when it is initially created. For\n\t\t * instance, if you are skinning Feathers components without a theme,\n\t\t * you might use this factory to set skins and other styles on the first\n\t\t * tab.\n\t\t *\n\t\t * <p>This function is expected to have the following signature:</p>\n\t\t *\n\t\t * <pre>function():ToggleButton</pre>\n\t\t *\n\t\t * <p>In the following example, a custom first tab factory is passed to the\n\t\t * tab bar:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * tabs.firstTabFactory = function():ToggleButton\n\t\t * {\n\t\t *     var tab:ToggleButton = new ToggleButton();\n\t\t *     tab.defaultSkin = new Image( upTexture );\n\t\t *     tab.defaultSelectedSkin = new Image( selectedTexture );\n\t\t *     tab.downSkin = new Image( downTexture );\n\t\t *     return tab;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.ToggleButton\n\t\t * @see #tabFactory\n\t\t * @see #lastTabFactory\n\t\t */\n\t\tpublic function get firstTabFactory():Function\n\t\t{\n\t\t\treturn this._firstTabFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set firstTabFactory(value:Function):void\n\t\t{\n\t\t\tif(this._firstTabFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._firstTabFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TAB_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastTabFactory:Function;\n\n\t\t/**\n\t\t * If not <code>null</code>, creates the last tab. If the\n\t\t * <code>lastTabFactory</code> is <code>null</code>, then the tab bar\n\t\t * will use the <code>tabFactory</code>. The last tab must be an\n\t\t * instance of <code>ToggleButton</code>. This factory can be used to\n\t\t * change properties on the last tab when it is initially created. For\n\t\t * instance, if you are skinning Feathers components without a theme,\n\t\t * you might use this factory to set skins and other styles on the last\n\t\t * tab.\n\t\t *\n\t\t * <p>This function is expected to have the following signature:</p>\n\t\t *\n\t\t * <pre>function():ToggleButton</pre>\n\t\t *\n\t\t * <p>In the following example, a custom last tab factory is passed to the\n\t\t * tab bar:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * tabs.lastTabFactory = function():ToggleButton\n\t\t * {\n\t\t *     var tab:ToggleButton = new Button();\n\t\t *     tab.defaultSkin = new Image( upTexture );\n\t\t *     tab.defaultSelectedSkin = new Image( selectedTexture );\n\t\t *     tab.downSkin = new Image( downTexture );\n\t\t *     return tab;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.ToggleButton\n\t\t * @see #tabFactory\n\t\t * @see #firstTabFactory\n\t\t */\n\t\tpublic function get lastTabFactory():Function\n\t\t{\n\t\t\treturn this._lastTabFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set lastTabFactory(value:Function):void\n\t\t{\n\t\t\tif(this._lastTabFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._lastTabFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TAB_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _tabInitializer:Function = defaultTabInitializer;\n\n\t\t/**\n\t\t * Modifies the properties of an individual tab, using an item from the\n\t\t * data provider. The default initializer will set the tab's label and\n\t\t * icons. A custom tab initializer can be provided to update additional\n\t\t * properties or to use different field names in the data provider.\n\t\t *\n\t\t * <p>This function is expected to have the following signature:</p>\n\t\t * <pre>function( tab:ToggleButton, item:Object ):void</pre>\n\t\t *\n\t\t * <p>In the following example, a custom tab initializer is passed to the\n\t\t * tab bar:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * tabs.tabInitializer = function( tab:ToggleButton, item:Object ):void\n\t\t * {\n\t\t *     tab.label = item.text;\n\t\t *     tab.defaultIcon = item.icon;\n\t\t * };</listing>\n\t\t *\n\t\t * @see #dataProvider\n\t\t * @see #tabReleaser\n\t\t */\n\t\tpublic function get tabInitializer():Function\n\t\t{\n\t\t\treturn this._tabInitializer;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set tabInitializer(value:Function):void\n\t\t{\n\t\t\tif(this._tabInitializer == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._tabInitializer = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _tabReleaser:Function = defaultTabReleaser;\n\n\t\t/**\n\t\t * Resets the properties of an individual tab, using the item from the\n\t\t * data provider that was associated with the tab.\n\t\t *\n\t\t * <p>This function is expected to have one of the following signatures:</p>\n\t\t * <pre>function( tab:ToggleButton ):void</pre>\n\t\t * <pre>function( tab:ToggleButton, oldItem:Object ):void</pre>\n\t\t *\n\t\t * <p>In the following example, a custom tab releaser is passed to the\n\t\t * tab bar:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * tabs.tabReleaser = function( tab:ToggleButton, oldItem:Object ):void\n\t\t * {\n\t\t *     tab.label = null;\n\t\t *     tab.defaultIcon = null;\n\t\t * };</listing>\n\t\t *\n\t\t * @see #tabInitializer\n\t\t */\n\t\tpublic function get tabReleaser():Function\n\t\t{\n\t\t\treturn this._tabReleaser;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set tabReleaser(value:Function):void\n\t\t{\n\t\t\tif(this._tabReleaser == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._tabReleaser = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _labelField:String = \"label\";\n\n\t\t/**\n\t\t * The field in the item that contains the label text to be displayed by\n\t\t * the tabs. If the item does not have this field, and a\n\t\t * <code>labelFunction</code> is not defined, then the tabs will\n\t\t * default to calling <code>toString()</code> on the item.\n\t\t *\n\t\t * <p>All of the label fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>labelFunction</code></li>\n\t\t *     <li><code>labelField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the label field is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * tabs.labelField = \"text\";</listing>\n\t\t *\n\t\t * @default \"label\"\n\t\t *\n\t\t * @see #labelFunction\n\t\t */\n\t\tpublic function get labelField():String\n\t\t{\n\t\t\treturn this._labelField;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set labelField(value:String):void\n\t\t{\n\t\t\tif(this._labelField == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._labelField = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _labelFunction:Function;\n\n\t\t/**\n\t\t * A function used to generate label text for a specific tab. If this\n\t\t * function is not <code>null</code>, then the <code>labelField</code>\n\t\t * will be ignored.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function( item:Object ):String</pre>\n\t\t *\n\t\t * <p>All of the label fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>labelFunction</code></li>\n\t\t *     <li><code>labelField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the label function is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * tabs.labelFunction = function( item:Object ):String\n\t\t * {\n\t\t *    return item.label + \" (\" + item.unread + \")\";\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #labelField\n\t\t */\n\t\tpublic function get labelFunction():Function\n\t\t{\n\t\t\treturn this._labelFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set labelFunction(value:Function):void\n\t\t{\n\t\t\tif(this._labelFunction == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._labelFunction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _enabledField:String = \"isEnabled\";\n\n\t\t/**\n\t\t * The field in the item that determines if the tab is enabled. If the\n\t\t * item does not have this field, and a <code>enabledFunction</code> is\n\t\t * not defined, then the tab will default to being enabled, unless the\n\t\t * tab bar is not enabled. All tabs will always be disabled if the tab\n\t\t * bar is disabled.\n\t\t *\n\t\t * <p>All of the label fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>enabledFunction</code></li>\n\t\t *     <li><code>enabledField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the enabled field is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * tabs.enabledField = \"isEnabled\";</listing>\n\t\t *\n\t\t * @default \"enabled\"\n\t\t *\n\t\t * @see #enabledFunction\n\t\t */\n\t\tpublic function get enabledField():String\n\t\t{\n\t\t\treturn this._enabledField;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set enabledField(value:String):void\n\t\t{\n\t\t\tif(this._enabledField == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._enabledField = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _iconField:String = \"defaultIcon\";\n\t\t//I'd like to use \"icon\" here instead, but defaultIcon is needed for\n\t\t//backwards compatibility...\n\n\t\t/**\n\t\t * The field in the item that contains a display object to be displayed\n\t\t * as an icon or other graphic next to the label in the tab.\n\t\t *\n\t\t * <p>Warning: It is your responsibility to dispose all icons\n\t\t * included in the data provider and accessed with <code>iconField</code>,\n\t\t * or any display objects returned by <code>iconFunction</code>.\n\t\t * These display objects will not be disposed when the list is disposed.\n\t\t * Not disposing an icon may result in a memory leak.</p>\n\t\t *\n\t\t * <p>All of the icon fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>iconFunction</code></li>\n\t\t *     <li><code>iconField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the icon field is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * tabs.iconField = \"photo\";</listing>\n\t\t *\n\t\t * @default \"icon\"\n\t\t *\n\t\t * @see #iconFunction\n\t\t */\n\t\tpublic function get iconField():String\n\t\t{\n\t\t\treturn this._iconField;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set iconField(value:String):void\n\t\t{\n\t\t\tif(this._iconField == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._iconField = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _iconFunction:Function;\n\n\t\t/**\n\t\t * A function used to generate an icon for a specific tab, based on its\n\t\t * associated item in the data provider.\n\t\t *\n\t\t * <p>Note: This function may be called more than once for each\n\t\t * individual item in the tab bar's data provider. The function should\n\t\t * not simply return a new icon every time. This will result in the\n\t\t * unnecessary creation and destruction of many icons, which will\n\t\t * overwork the garbage collector, hurt performance, and possibly lead\n\t\t * to memory leaks. It's better to return a new icon the first time this\n\t\t * function is called for a particular item and then return the same\n\t\t * icon if that item is passed to this function again.</p>\n\t\t *\n\t\t * <p>Warning: It is your responsibility to dispose all icons\n\t\t * included in the data provider and accessed with <code>iconField</code>,\n\t\t * or any display objects returned by <code>iconFunction</code>.\n\t\t * These display objects will not be disposed when the list is disposed.\n\t\t * Not disposing an icon may result in a memory leak.</p>\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function( item:Object ):DisplayObject</pre>\n\t\t *\n\t\t * <p>All of the icon fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>iconFunction</code></li>\n\t\t *     <li><code>iconField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the icon function is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var cachedIcons:Dictionary = new Dictionary( true );\n\t\t * tabs.iconFunction = function( item:Object ):DisplayObject\n\t\t * {\n\t\t *    if(item in cachedIcons)\n\t\t *    {\n\t\t *        return cachedIcons[item];\n\t\t *    }\n\t\t *    var icon:Image = new Image( textureAtlas.getTexture( item.textureName ) );\n\t\t *    cachedIcons[item] = icon;\n\t\t *    return icon;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #iconField\n\t\t */\n\t\tpublic function get iconFunction():Function\n\t\t{\n\t\t\treturn this._iconFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set iconFunction(value:Function):void\n\t\t{\n\t\t\tif(this._iconFunction == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._iconFunction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _enabledFunction:Function;\n\n\t\t/**\n\t\t * A function used to determine if a specific tab is enabled. If this\n\t\t * function is not <code>null</code>, then the <code>enabledField</code>\n\t\t * will be ignored.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function( item:Object ):Boolean</pre>\n\t\t *\n\t\t * <p>All of the enabled fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>enabledFunction</code></li>\n\t\t *     <li><code>enabledField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the enabled function is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * tabs.enabledFunction = function( item:Object ):Boolean\n\t\t * {\n\t\t *    return item.isEnabled;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #enabledField\n\t\t */\n\t\tpublic function get enabledFunction():Function\n\t\t{\n\t\t\treturn this._enabledFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set enabledFunction(value:Function):void\n\t\t{\n\t\t\tif(this._enabledFunction == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._enabledFunction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _ignoreSelectionChanges:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectedIndex:int = -1;\n\n\t\t/**\n\t\t * The index of the currently selected tab. Returns -1 if no tab is\n\t\t * selected.\n\t\t *\n\t\t * <p>In the following example, the tab bar's selected index is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * tabs.selectedIndex = 2;</listing>\n\t\t *\n\t\t * <p>The following example listens for when selection changes and\n\t\t * requests the selected index:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * function tabs_changeHandler( event:Event ):void\n\t\t * {\n\t\t *     var tabs:TabBar = TabBar( event.currentTarget );\n\t\t *     var index:int = tabs.selectedIndex;\n\t\t * \n\t\t * }\n\t\t * tabs.addEventListener( Event.CHANGE, tabs_changeHandler );</listing>\n\t\t *\n\t\t * @default -1\n\t\t *\n\t\t * @see #selectedItem\n\t\t */\n\t\tpublic function get selectedIndex():int\n\t\t{\n\t\t\treturn this._selectedIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedIndex(value:int):void\n\t\t{\n\t\t\tthis._animateSelectionChange = false;\n\t\t\tif(this._selectedIndex == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._selectedIndex = value;\n\t\t\tthis.refreshSelectedItem();\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectedItem:Object = null;\n\n\t\t/**\n\t\t * The currently selected item from the data provider. Returns\n\t\t * <code>null</code> if no item is selected.\n\t\t *\n\t\t * <p>In the following example, the tab bar's selected item is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * tabs.selectedItem = tabs.dataProvider.getItemAt(2);</listing>\n\t\t *\n\t\t * <p>The following example listens for when selection changes and\n\t\t * requests the selected item:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * function tabs_changeHandler( event:Event ):void\n\t\t * {\n\t\t *     var tabs:TabBar = TabBar( event.currentTarget );\n\t\t *     var item:Object = tabs.selectedItem;\n\t\t * \n\t\t * }\n\t\t * tabs.addEventListener( Event.CHANGE, tabs_changeHandler );</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #selectedIndex\n\t\t */\n\t\tpublic function get selectedItem():Object\n\t\t{\n\t\t\treturn this._selectedItem;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedItem(value:Object):void\n\t\t{\n\t\t\tif(this._selectedItem === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//we don't need to set _animateSelectionChange to false because we\n\t\t\t//always call the selectedIndex setter below, which sets it;\n\t\t\tif(this._dataProvider === null)\n\t\t\t{\n\t\t\t\tthis.selectedIndex = -1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar newIndex:int = this._dataProvider.getItemIndex(value);\n\t\t\tif(newIndex == -1)\n\t\t\t{\n\t\t\t\tthis.selectedIndex = -1;\n\t\t\t}\n\t\t\telse if(this._selectedIndex != newIndex)\n\t\t\t{\n\t\t\t\tthis.selectedIndex = newIndex;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//it's possible for the item to change, but not the index\n\t\t\t\tthis._animateSelectionChange = false;\n\t\t\t\tthis._selectedItem = value;\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customTabStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customTabStyleName():String\n\t\t{\n\t\t\treturn this._customTabStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customTabStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customTabStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customTabStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TAB_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customFirstTabStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customFirstTabStyleName():String\n\t\t{\n\t\t\treturn this._customFirstTabStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customFirstTabStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customFirstTabStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customFirstTabStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TAB_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customLastTabStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customLastTabStyleName():String\n\t\t{\n\t\t\treturn this._customLastTabStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customLastTabStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customLastTabStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customLastTabStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TAB_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _tabProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for all of the tab bar's tabs, and\n\t\t * the properties will be passed down to every tab when the tab bar\n\t\t * validates. For a list of available properties, refer to\n\t\t * <a href=\"ToggleButton.html\"><code>feathers.controls.ToggleButton</code></a>.\n\t\t *\n\t\t * <p>These properties are shared by every tab, so anything that cannot\n\t\t * be shared (such as display objects, which cannot be added to multiple\n\t\t * parents) should be passed to tabs using the <code>tabFactory</code>\n\t\t * or in the theme.</p>\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>tabFactory</code> function instead\n\t\t * of using <code>tabProperties</code> will result in better\n\t\t * performance.</p>\n\t\t *\n\t\t * <p>In the following example, the tab bar's tab properties are updated:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * tabs.tabProperties.iconPosition = RelativePosition.RIGHT;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #tabFactory\n\t\t * @see feathers.controls.ToggleButton\n\t\t */\n\t\tpublic function get tabProperties():Object\n\t\t{\n\t\t\tif(!this._tabProperties)\n\t\t\t{\n\t\t\t\tthis._tabProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._tabProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set tabProperties(value:Object):void\n\t\t{\n\t\t\tif(this._tabProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._tabProperties)\n\t\t\t{\n\t\t\t\tthis._tabProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._tabProperties = PropertyProxy(value);\n\t\t\tif(this._tabProperties)\n\t\t\t{\n\t\t\t\tthis._tabProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get baseline():Number\n\t\t{\n\t\t\tif(!this.activeTabs || this.activeTabs.length == 0)\n\t\t\t{\n\t\t\t\treturn this.scaledActualHeight;\n\t\t\t}\n\t\t\tvar firstTab:ToggleButton = this.activeTabs[0];\n\t\t\treturn this.scaleY * (firstTab.y + firstTab.baseline);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _animateSelectionChange:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _dragFormat:String = DEFAULT_DRAG_FORMAT;\n\n\t\t/**\n\t\t * Drag and drop is restricted to components that have the same\n\t\t * <code>dragFormat</code>.\n\t\t *\n\t\t * <p>In the following example, the drag format of two tab bars is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * tabs1.dragFormat = \"my-custom-format\";\n\t\t * tabs2.dragFormat = \"my-custom-format\";</listing>\n\t\t *\n\t\t * @default \"feathers-tab-bar-item\"\n\t\t */\n\t\tpublic function get dragFormat():String\n\t\t{\n\t\t\treturn this._dragFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set dragFormat(value:String):void\n\t\t{\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = DEFAULT_DRAG_FORMAT;\n\t\t\t}\n\t\t\tif(this._dragFormat == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._dragFormat = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _dragTouchPointID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _droppedOnSelf:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _dragEnabled:Boolean = false;\n\n\t\t/**\n\t\t * Indicates if this tab bar can initiate drag and drop operations by\n\t\t * touching an item and dragging it. The <code>dragEnabled</code>\n\t\t * property enables dragging items, but dropping items must be enabled\n\t\t * separately with the <code>dropEnabled</code> property.\n\t\t *\n\t\t * <p>In the following example, a tab bar's items may be dragged:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * tabs.dragEnabled = true;</listing>\n\t\t *\n\t\t * @see #dropEnabled\n\t\t * @see #dragFormat\n\t\t */\n\t\tpublic function get dragEnabled():Boolean\n\t\t{\n\t\t\treturn this._dragEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set dragEnabled(value:Boolean):void\n\t\t{\n\t\t\tif(this._dragEnabled == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._dragEnabled = value;\n\t\t\tif(this._dragEnabled)\n\t\t\t{\n\t\t\t\tthis.addEventListener(DragDropEvent.DRAG_COMPLETE, dragCompleteHandler);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.removeEventListener(DragDropEvent.DRAG_COMPLETE, dragCompleteHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _dropEnabled:Boolean = false;\n\n\t\t/**\n\t\t * Indicates if this tab bar can accept items that are dragged and\n\t\t * dropped over the tab bar's hit area.\n\t\t *\n\t\t * <p>In the following example, a tab bar's items may be dropped:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * tabs.dropEnabled = true;</listing>\n\t\t *\n\t\t * @see #dragEnabled\n\t\t * @see #dragFormat\n\t\t */\n\t\tpublic function get dropEnabled():Boolean\n\t\t{\n\t\t\treturn this._dropEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set dropEnabled(value:Boolean):void\n\t\t{\n\t\t\tif(this._dropEnabled == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._dropEnabled = value;\n\t\t\tif(this._dropEnabled)\n\t\t\t{\n\t\t\t\tthis.addEventListener(DragDropEvent.DRAG_ENTER, dragEnterHandler);\n\t\t\t\tthis.addEventListener(DragDropEvent.DRAG_MOVE, dragMoveHandler);\n\t\t\t\tthis.addEventListener(DragDropEvent.DRAG_EXIT, dragExitHandler);\n\t\t\t\tthis.addEventListener(DragDropEvent.DRAG_DROP, dragDropHandler);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.removeEventListener(DragDropEvent.DRAG_ENTER, dragEnterHandler);\n\t\t\t\tthis.removeEventListener(DragDropEvent.DRAG_MOVE, dragMoveHandler);\n\t\t\t\tthis.removeEventListener(DragDropEvent.DRAG_EXIT, dragExitHandler);\n\t\t\t\tthis.removeEventListener(DragDropEvent.DRAG_DROP, dragDropHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitDropIndicatorWidth:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitDropIndicatorHeight:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _dropIndicatorSkin:DisplayObject = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get dropIndicatorSkin():DisplayObject\n\t\t{\n\t\t\treturn this._dropIndicatorSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set dropIndicatorSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._dropIndicatorSkin = value;\n\t\t\tif(this._dropIndicatorSkin is IMeasureDisplayObject)\n\t\t\t{\n\t\t\t\tvar measureSkin:IMeasureDisplayObject = IMeasureDisplayObject(this._dropIndicatorSkin);\n\t\t\t\tthis._explicitDropIndicatorWidth = measureSkin.explicitWidth;\n\t\t\t\tthis._explicitDropIndicatorHeight = measureSkin.explicitHeight;\n\t\t\t}\n\t\t\telse if(this._dropIndicatorSkin)\n\t\t\t{\n\t\t\t\tthis._explicitDropIndicatorWidth = this._dropIndicatorSkin.width;\n\t\t\t\tthis._explicitDropIndicatorHeight = this._dropIndicatorSkin.height;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this._dropIndicatorSkin !== null &&\n\t\t\t\tthis._dropIndicatorSkin.parent === null)\n\t\t\t{\n\t\t\t\tthis._dropIndicatorSkin.dispose();\n\t\t\t\tthis._dropIndicatorSkin = null;\n\t\t\t}\n\n\t\t\t//clearing selection now so that the data provider setter won't\n\t\t\t//cause a selection change that triggers events.\n\t\t\tthis._selectedIndex = -1;\n\t\t\t//this flag also ensures that removing items from the ToggleGroup\n\t\t\t//won't result in selection events\n\t\t\tthis._ignoreSelectionChanges = true;\n\n\t\t\t//the tabs may contain things that shouldn't be disposed, so clean\n\t\t\t//them up before super.dispose()\n\t\t\tvar tabCount:int = this.activeTabs.length;\n\t\t\tfor(var i:int = 0; i < tabCount; i++)\n\t\t\t{\n\t\t\t\tvar tab:ToggleButton = this.activeTabs.shift();\n\t\t\t\tthis.destroyTab(tab);\n\t\t\t}\n\n\t\t\t//ensures that listeners are removed to avoid memory leaks\n\t\t\tthis.dataProvider = null;\n\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * Changes the <code>selectedIndex</code> property, but animates the\n\t\t * <code>selectionSkin</code> to the new position, as if the user\n\t\t * triggered a tab.\n\t\t *\n\t\t * @see #selectedIndex\n\t\t */\n\t\tpublic function setSelectedIndexWithAnimation(selectedIndex:int):void\n\t\t{\n\t\t\tif(this._selectedIndex == selectedIndex)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._selectedIndex = selectedIndex;\n\t\t\tthis.refreshSelectedItem();\n\t\t\t//set this flag before dispatching the event because the TabBar\n\t\t\t//might be forced to validate in an event listener\n\t\t\tthis._animateSelectionChange = true;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * Changes the <code>selectedItem</code> property, but animates the\n\t\t * <code>selectionSkin</code> to the new position, as if the user\n\t\t * triggered a tab.\n\t\t *\n\t\t * @see #selectedItem\n\t\t * @see #selectedIndex\n\t\t * @see #setSelectedIndexWithAnimation()\n\t\t */\n\t\tpublic function setSelectedItemWithAnimation(selectedItem:Object):void\n\t\t{\n\t\t\tif(this.selectedItem == selectedItem)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar selectedIndex:int = -1;\n\t\t\tif(this._dataProvider !== null)\n\t\t\t{\n\t\t\t\tselectedIndex = this._dataProvider.getItemIndex(selectedItem);\n\t\t\t}\n\t\t\tthis.setSelectedIndexWithAnimation(selectedIndex);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tthis.toggleGroup = new ToggleGroup();\n\t\t\tthis.toggleGroup.isSelectionRequired = true;\n\t\t\tthis.toggleGroup.addEventListener(Event.CHANGE, toggleGroup_changeHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar selectionInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SELECTED);\n\t\t\tvar tabFactoryInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_TAB_FACTORY);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\n\t\t\tif(dataInvalid || tabFactoryInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshTabs(tabFactoryInvalid);\n\t\t\t}\n\n\t\t\tif(dataInvalid || tabFactoryInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshTabStyles();\n\t\t\t}\n\n\t\t\tif(dataInvalid || tabFactoryInvalid || selectionInvalid)\n\t\t\t{\n\t\t\t\tthis.commitSelection();\n\t\t\t}\n\n\t\t\tif(dataInvalid || tabFactoryInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.commitEnabled();\n\t\t\t}\n\n\t\t\tif(stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshLayoutStyles();\n\t\t\t}\n\n\t\t\tthis.layoutTabs();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function commitSelection():void\n\t\t{\n\t\t\tthis.toggleGroup.selectedIndex = this._selectedIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function commitEnabled():void\n\t\t{\n\t\t\tfor each(var tab:ToggleButton in this.activeTabs)\n\t\t\t{\n\t\t\t\ttab.isEnabled &&= this._isEnabled;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshTabStyles():void\n\t\t{\n\t\t\tfor(var propertyName:String in this._tabProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._tabProperties[propertyName];\n\t\t\t\tfor each(var tab:ToggleButton in this.activeTabs)\n\t\t\t\t{\n\t\t\t\t\ttab[propertyName] = propertyValue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshLayoutStyles():void\n\t\t{\n\t\t\tif(this._direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tif(this.horizontalLayout)\n\t\t\t\t{\n\t\t\t\t\tthis.horizontalLayout = null;\n\t\t\t\t}\n\t\t\t\tif(!this.verticalLayout)\n\t\t\t\t{\n\t\t\t\t\tthis.verticalLayout = new VerticalLayout();\n\t\t\t\t\tthis.verticalLayout.useVirtualLayout = false;\n\t\t\t\t}\n\t\t\t\tthis.verticalLayout.distributeHeights = this._distributeTabSizes;\n\t\t\t\tthis.verticalLayout.horizontalAlign = this._horizontalAlign;\n\t\t\t\tthis.verticalLayout.verticalAlign = (this._verticalAlign == VerticalAlign.JUSTIFY) ? VerticalAlign.TOP : this._verticalAlign;\n\t\t\t\tthis.verticalLayout.gap = this._gap;\n\t\t\t\tthis.verticalLayout.firstGap = this._firstGap;\n\t\t\t\tthis.verticalLayout.lastGap = this._lastGap;\n\t\t\t\tthis.verticalLayout.paddingTop = this._paddingTop;\n\t\t\t\tthis.verticalLayout.paddingRight = this._paddingRight;\n\t\t\t\tthis.verticalLayout.paddingBottom = this._paddingBottom;\n\t\t\t\tthis.verticalLayout.paddingLeft = this._paddingLeft;\n\t\t\t}\n\t\t\telse //horizontal\n\t\t\t{\n\t\t\t\tif(this.verticalLayout)\n\t\t\t\t{\n\t\t\t\t\tthis.verticalLayout = null;\n\t\t\t\t}\n\t\t\t\tif(!this.horizontalLayout)\n\t\t\t\t{\n\t\t\t\t\tthis.horizontalLayout = new HorizontalLayout();\n\t\t\t\t\tthis.horizontalLayout.useVirtualLayout = false;\n\t\t\t\t}\n\t\t\t\tthis.horizontalLayout.distributeWidths = this._distributeTabSizes;\n\t\t\t\tthis.horizontalLayout.horizontalAlign = (this._horizontalAlign == HorizontalAlign.JUSTIFY) ? HorizontalAlign.LEFT : this._horizontalAlign;\n\t\t\t\tthis.horizontalLayout.verticalAlign = this._verticalAlign;\n\t\t\t\tthis.horizontalLayout.gap = this._gap;\n\t\t\t\tthis.horizontalLayout.firstGap = this._firstGap;\n\t\t\t\tthis.horizontalLayout.lastGap = this._lastGap;\n\t\t\t\tthis.horizontalLayout.paddingTop = this._paddingTop;\n\t\t\t\tthis.horizontalLayout.paddingRight = this._paddingRight;\n\t\t\t\tthis.horizontalLayout.paddingBottom = this._paddingBottom;\n\t\t\t\tthis.horizontalLayout.paddingLeft = this._paddingLeft;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function commitTabData(tab:ToggleButton, item:Object):void\n\t\t{\n\t\t\tif(item !== null)\n\t\t\t{\n\t\t\t\tif(this._labelFunction !== null)\n\t\t\t\t{\n\t\t\t\t\ttab.label = this._labelFunction(item);\n\t\t\t\t}\n\t\t\t\telse if(this._labelField !== null && item !== null && this._labelField in item)\n\t\t\t\t{\n\t\t\t\t\ttab.label = item[this._labelField];\n\t\t\t\t}\n\t\t\t\telse if(item is String)\n\t\t\t\t{\n\t\t\t\t\ttab.label = item as String;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttab.label = item.toString();\n\t\t\t\t}\n\t\t\t\tif(this._iconFunction !== null)\n\t\t\t\t{\n\t\t\t\t\ttab.defaultIcon = this._iconFunction(item);\n\t\t\t\t}\n\t\t\t\telse if(this._iconField !== null && item !== null && this._iconField in item)\n\t\t\t\t{\n\t\t\t\t\ttab.defaultIcon = item[this._iconField] as DisplayObject;\n\t\t\t\t}\n\t\t\t\tif(this._enabledFunction !== null)\n\t\t\t\t{\n\t\t\t\t\t//we account for this._isEnabled later\n\t\t\t\t\ttab.isEnabled = this._enabledFunction(item);\n\t\t\t\t}\n\t\t\t\telse if(this._enabledField !== null && item !== null && this._enabledField in item)\n\t\t\t\t{\n\t\t\t\t\t//we account for this._isEnabled later\n\t\t\t\t\ttab.isEnabled = item[this._enabledField] as Boolean;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttab.isEnabled = this._isEnabled;\n\t\t\t\t}\n\t\t\t\tif(this._tabInitializer !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._tabInitializer(tab, item);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttab.label = \"\";\n\t\t\t\ttab.isEnabled = this._isEnabled;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function defaultTabInitializer(tab:ToggleButton, item:Object):void\n\t\t{\n\t\t\tif(item !== null)\n\t\t\t{\n\t\t\t\tfor each(var field:String in DEFAULT_TAB_FIELDS)\n\t\t\t\t{\n\t\t\t\t\tif(item.hasOwnProperty(field))\n\t\t\t\t\t{\n\t\t\t\t\t\ttab[field] = item[field];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function defaultTabReleaser(tab:ToggleButton, oldItem:Object):void\n\t\t{\n\t\t\tfor each(var field:String in DEFAULT_TAB_FIELDS)\n\t\t\t{\n\t\t\t\tif(oldItem.hasOwnProperty(field))\n\t\t\t\t{\n\t\t\t\t\ttab[field] = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshTabs(isFactoryInvalid:Boolean):void\n\t\t{\n\t\t\tvar oldIgnoreSelectionChanges:Boolean = this._ignoreSelectionChanges;\n\t\t\tthis._ignoreSelectionChanges = true;\n\t\t\tvar oldSelectedIndex:int = this.toggleGroup.selectedIndex;\n\t\t\tthis.toggleGroup.removeAllItems();\n\t\t\tvar temp:Vector.<ToggleButton> = this.inactiveTabs;\n\t\t\tthis.inactiveTabs = this.activeTabs;\n\t\t\tthis.activeTabs = temp;\n\t\t\tthis.activeTabs.length = 0;\n\t\t\tthis._layoutItems.length = 0;\n\t\t\ttemp = null;\n\t\t\tif(isFactoryInvalid)\n\t\t\t{\n\t\t\t\tthis.clearInactiveTabs();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(this.activeFirstTab)\n\t\t\t\t{\n\t\t\t\t\tthis.inactiveTabs.shift();\n\t\t\t\t}\n\t\t\t\tthis.inactiveFirstTab = this.activeFirstTab;\n\n\t\t\t\tif(this.activeLastTab)\n\t\t\t\t{\n\t\t\t\t\tthis.inactiveTabs.pop();\n\t\t\t\t}\n\t\t\t\tthis.inactiveLastTab = this.activeLastTab;\n\t\t\t}\n\t\t\tthis.activeFirstTab = null;\n\t\t\tthis.activeLastTab = null;\n\n\t\t\tvar pushIndex:int = 0;\n\t\t\tvar itemCount:int = this._dataProvider ? this._dataProvider.length : 0;\n\t\t\tvar lastItemIndex:int = itemCount - 1;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = this._dataProvider.getItemAt(i);\n\t\t\t\tif(i == 0)\n\t\t\t\t{\n\t\t\t\t\tvar tab:ToggleButton = this.activeFirstTab = this.createFirstTab(item);\n\t\t\t\t}\n\t\t\t\telse if(i == lastItemIndex)\n\t\t\t\t{\n\t\t\t\t\ttab = this.activeLastTab = this.createLastTab(item);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttab = this.createTab(item);\n\t\t\t\t}\n\t\t\t\tthis.toggleGroup.addItem(tab);\n\t\t\t\tthis.activeTabs[pushIndex] = tab;\n\t\t\t\tthis._layoutItems[pushIndex] = tab;\n\t\t\t\tpushIndex++;\n\t\t\t}\n\n\t\t\tthis.clearInactiveTabs();\n\t\t\tthis._ignoreSelectionChanges = oldIgnoreSelectionChanges;\n\t\t\tif(oldSelectedIndex >= 0)\n\t\t\t{\n\t\t\t\tvar newSelectedIndex:int = this.activeTabs.length - 1;\n\t\t\t\tif(oldSelectedIndex < newSelectedIndex)\n\t\t\t\t{\n\t\t\t\t\tnewSelectedIndex = oldSelectedIndex;\n\t\t\t\t}\n\t\t\t\t//removing all items from the ToggleGroup clears the selection,\n\t\t\t\t//so we need to set it back to the old value (or a new clamped\n\t\t\t\t//value). we want the change event to dispatch only if the old\n\t\t\t\t//value and the new value don't match.\n\t\t\t\tthis._ignoreSelectionChanges = oldSelectedIndex == newSelectedIndex;\n\t\t\t\tthis.toggleGroup.selectedIndex = newSelectedIndex;\n\t\t\t\tthis._ignoreSelectionChanges = oldIgnoreSelectionChanges;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function clearInactiveTabs():void\n\t\t{\n\t\t\tvar itemCount:int = this.inactiveTabs.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar tab:ToggleButton = this.inactiveTabs.shift();\n\t\t\t\tthis.destroyTab(tab);\n\t\t\t}\n\n\t\t\tif(this.inactiveFirstTab)\n\t\t\t{\n\t\t\t\tthis.destroyTab(this.inactiveFirstTab);\n\t\t\t\tthis.inactiveFirstTab = null;\n\t\t\t}\n\n\t\t\tif(this.inactiveLastTab)\n\t\t\t{\n\t\t\t\tthis.destroyTab(this.inactiveLastTab);\n\t\t\t\tthis.inactiveLastTab = null;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createFirstTab(item:Object):ToggleButton\n\t\t{\n\t\t\tvar isNewInstance:Boolean = false;\n\t\t\tif(this.inactiveFirstTab !== null)\n\t\t\t{\n\t\t\t\tvar tab:ToggleButton = this.inactiveFirstTab;\n\t\t\t\tthis.releaseTab(tab);\n\t\t\t\tthis.inactiveFirstTab = null;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tisNewInstance = true;\n\t\t\t\tvar factory:Function = this._firstTabFactory != null ? this._firstTabFactory : this._tabFactory;\n\t\t\t\ttab = ToggleButton(factory());\n\t\t\t\tif(this._customFirstTabStyleName)\n\t\t\t\t{\n\t\t\t\t\ttab.styleNameList.add(this._customFirstTabStyleName);\n\t\t\t\t}\n\t\t\t\telse if(this._customTabStyleName)\n\t\t\t\t{\n\t\t\t\t\ttab.styleNameList.add(this._customTabStyleName);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttab.styleNameList.add(this.firstTabStyleName);\n\t\t\t\t}\n\t\t\t\ttab.isToggle = true;\n\t\t\t\tthis.addChild(tab);\n\t\t\t}\n\t\t\tthis.commitTabData(tab, item);\n\t\t\tthis._tabToItem[tab] = item;\n\t\t\tif(isNewInstance)\n\t\t\t{\n\t\t\t\t//we need to listen for events after the initializer\n\t\t\t\t//is called to avoid runtime errors because the tab may be\n\t\t\t\t//disposed by the time listeners in the initializer are called.\n\t\t\t\tthis.addTabListeners(tab);\n\t\t\t}\n\t\t\treturn tab;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createLastTab(item:Object):ToggleButton\n\t\t{\n\t\t\tvar isNewInstance:Boolean = false;\n\t\t\tif(this.inactiveLastTab !== null)\n\t\t\t{\n\t\t\t\tvar tab:ToggleButton = this.inactiveLastTab;\n\t\t\t\tthis.releaseTab(tab);\n\t\t\t\tthis.inactiveLastTab = null;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tisNewInstance = true;\n\t\t\t\tvar factory:Function = this._lastTabFactory != null ? this._lastTabFactory : this._tabFactory;\n\t\t\t\ttab = ToggleButton(factory());\n\t\t\t\tif(this._customLastTabStyleName)\n\t\t\t\t{\n\t\t\t\t\ttab.styleNameList.add(this._customLastTabStyleName);\n\t\t\t\t}\n\t\t\t\telse if(this._customTabStyleName)\n\t\t\t\t{\n\t\t\t\t\ttab.styleNameList.add(this._customTabStyleName);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttab.styleNameList.add(this.lastTabStyleName);\n\t\t\t\t}\n\t\t\t\ttab.isToggle = true;\n\t\t\t\tthis.addChild(tab);\n\t\t\t}\n\t\t\tthis.commitTabData(tab, item);\n\t\t\tthis._tabToItem[tab] = item;\n\t\t\tif(isNewInstance)\n\t\t\t{\n\t\t\t\t//we need to listen for events after the initializer\n\t\t\t\t//is called to avoid runtime errors because the tab may be\n\t\t\t\t//disposed by the time listeners in the initializer are called.\n\t\t\t\tthis.addTabListeners(tab);\n\t\t\t}\n\t\t\treturn tab;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createTab(item:Object):ToggleButton\n\t\t{\n\t\t\tvar isNewInstance:Boolean = false;\n\t\t\tif(this.inactiveTabs.length == 0)\n\t\t\t{\n\t\t\t\tisNewInstance = true;\n\t\t\t\tvar tab:ToggleButton = ToggleButton(this._tabFactory());\n\t\t\t\tif(this._customTabStyleName)\n\t\t\t\t{\n\t\t\t\t\ttab.styleNameList.add(this._customTabStyleName);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttab.styleNameList.add(this.tabStyleName);\n\t\t\t\t}\n\t\t\t\ttab.isToggle = true;\n\t\t\t\tthis.addChild(tab);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttab = this.inactiveTabs.shift();\n\t\t\t\tthis.releaseTab(tab);\n\t\t\t}\n\t\t\tthis.commitTabData(tab, item);\n\t\t\tthis._tabToItem[tab] = item;\n\t\t\tif(isNewInstance)\n\t\t\t{\n\t\t\t\t//we need to listen for events after the initializer\n\t\t\t\t//is called to avoid runtime errors because the tab may be\n\t\t\t\t//disposed by the time listeners in the initializer are called.\n\t\t\t\tthis.addTabListeners(tab);\n\t\t\t}\n\t\t\treturn tab;\n\t\t}\n\n\t\tprotected function addTabListeners(tab:ToggleButton):void\n\t\t{\n\t\t\ttab.addEventListener(Event.TRIGGERED, tab_triggeredHandler);\n\t\t\ttab.addEventListener(TouchEvent.TOUCH, tab_drag_touchHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function releaseTab(tab:ToggleButton):void\n\t\t{\n\t\t\tvar item:Object = this._tabToItem[tab];\n\t\t\tdelete this._tabToItem[tab];\n\t\t\tif(this._labelFunction !== null || this._labelField in item)\n\t\t\t{\n\t\t\t\ttab.label = null;\n\t\t\t}\n\t\t\tif(this._iconFunction !== null || this._iconField in item)\n\t\t\t{\n\t\t\t\ttab.defaultIcon = null;\n\t\t\t}\n\t\t\tif(this._tabReleaser !== null)\n\t\t\t{\n\t\t\t\tif(this._tabReleaser.length == 1)\n\t\t\t\t{\n\t\t\t\t\tthis._tabReleaser(tab);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._tabReleaser(tab, item);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function destroyTab(tab:ToggleButton):void\n\t\t{\n\t\t\tthis.toggleGroup.removeItem(tab);\n\t\t\tthis.releaseTab(tab);\n\t\t\ttab.removeEventListener(Event.TRIGGERED, tab_triggeredHandler);\n\t\t\ttab.removeEventListener(TouchEvent.TOUCH, tab_drag_touchHandler);\n\t\t\tthis.removeChild(tab, true);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutTabs():void\n\t\t{\n\t\t\tthis._viewPortBounds.x = 0;\n\t\t\tthis._viewPortBounds.y = 0;\n\t\t\tthis._viewPortBounds.scrollX = 0;\n\t\t\tthis._viewPortBounds.scrollY = 0;\n\t\t\tthis._viewPortBounds.explicitWidth = this._explicitWidth;\n\t\t\tthis._viewPortBounds.explicitHeight = this._explicitHeight;\n\t\t\tthis._viewPortBounds.minWidth = this._explicitMinWidth;\n\t\t\tthis._viewPortBounds.minHeight = this._explicitMinHeight;\n\t\t\tthis._viewPortBounds.maxWidth = this._explicitMaxWidth;\n\t\t\tthis._viewPortBounds.maxHeight = this._explicitMaxHeight;\n\t\t\tif(this.verticalLayout)\n\t\t\t{\n\t\t\t\tthis.verticalLayout.layout(this._layoutItems, this._viewPortBounds, this._layoutResult);\n\t\t\t}\n\t\t\telse if(this.horizontalLayout)\n\t\t\t{\n\t\t\t\tthis.horizontalLayout.layout(this._layoutItems, this._viewPortBounds, this._layoutResult);\n\t\t\t}\n\n\t\t\tvar contentWidth:Number = this._layoutResult.contentWidth;\n\t\t\tvar contentHeight:Number = this._layoutResult.contentHeight;\n\t\t\t//minimum dimensions are the same as the measured dimensions\n\t\t\tthis.saveMeasurements(contentWidth, contentHeight, contentWidth, contentHeight);\n\n\t\t\t//final validation to avoid juggler next frame issues\n\t\t\tfor each(var tab:ToggleButton in this.activeTabs)\n\t\t\t{\n\t\t\t\ttab.validate();\n\t\t\t}\n\t\t\tif(this._selectionSkin !== null)\n\t\t\t{\n\t\t\t\t//always on top\n\t\t\t\tthis.setChildIndex(this._selectionSkin, this.numChildren - 1);\n\n\t\t\t\tif(this._selectionChangeTween !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._selectionChangeTween.advanceTime(this._selectionChangeTween.totalTime);\n\t\t\t\t}\n\t\t\t\tif(this._selectedIndex >= 0)\n\t\t\t\t{\n\t\t\t\t\tthis._selectionSkin.visible = true;\n\t\t\t\t\ttab = this.activeTabs[this._selectedIndex];\n\t\t\t\t\tif(this._animateSelectionChange)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._selectionChangeTween = new Tween(this._selectionSkin, this._selectionChangeDuration, this._selectionChangeEase);\n\t\t\t\t\t\tif(this._direction === Direction.VERTICAL)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._selectionChangeTween.animate(\"y\", tab.y);\n\t\t\t\t\t\t\tthis._selectionChangeTween.animate(\"height\", tab.height);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse //horizontal\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._selectionChangeTween.animate(\"x\", tab.x);\n\t\t\t\t\t\t\tthis._selectionChangeTween.animate(\"width\", tab.width);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._selectionChangeTween.onComplete = selectionChangeTween_onComplete;\n\t\t\t\t\t\tStarling.juggler.add(this._selectionChangeTween);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._direction === Direction.VERTICAL)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._selectionSkin.y = tab.y;\n\t\t\t\t\t\t\tthis._selectionSkin.height = tab.height;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse //horizontal\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._selectionSkin.x = tab.x;\n\t\t\t\t\t\t\tthis._selectionSkin.width = tab.width;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._selectionSkin.visible = false;\n\t\t\t\t}\n\t\t\t\tthis._animateSelectionChange = false;\n\t\t\t\tif(this._selectionSkin is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this._selectionSkin).validate();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function showFocus():void\n\t\t{\n\t\t\tif(!this._hasFocus)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._showFocus = true;\n\t\t\tthis.showFocusedTab();\n\t\t\tthis.invalidate(INVALIDATION_FLAG_FOCUS);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function hideFocus():void\n\t\t{\n\t\t\tif(!this._hasFocus)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._showFocus = false;\n\t\t\tthis.hideFocusedTab();\n\t\t\tthis.invalidate(INVALIDATION_FLAG_FOCUS);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function hideFocusedTab():void\n\t\t{\n\t\t\tif(this._focusedTabIndex < 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar focusedTab:ToggleButton = this.activeTabs[this._focusedTabIndex];\n\t\t\tfocusedTab.hideFocus();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function showFocusedTab():void\n\t\t{\n\t\t\tif(!this._showFocus || this._focusedTabIndex < 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar tab:ToggleButton = this.activeTabs[this._focusedTabIndex];\n\t\t\ttab.showFocus();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function focusedTabFocusIn():void\n\t\t{\n\t\t\tif(this._focusedTabIndex < 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar tab:ToggleButton = this.activeTabs[this._focusedTabIndex];\n\t\t\ttab.dispatchEventWith(FeathersEventType.FOCUS_IN);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function focusedTabFocusOut():void\n\t\t{\n\t\t\tif(this._focusedTabIndex < 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar tab:ToggleButton = this.activeTabs[this._focusedTabIndex];\n\t\t\ttab.dispatchEventWith(FeathersEventType.FOCUS_OUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshSelectedItem():void\n\t\t{\n\t\t\tif(this._selectedIndex == -1)\n\t\t\t{\n\t\t\t\tthis._selectedItem = null;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._selectedItem = this._dataProvider.getItemAt(this._selectedIndex);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getDropIndex(event:DragDropEvent):int\n\t\t{\n\t\t\tvar point:Point = Pool.getPoint(event.localX, event.localY);\n\t\t\tthis.localToGlobal(point, point);\n\t\t\tvar globalX:Number = point.x;\n\t\t\tvar globalY:Number = point.y;\n\t\t\tPool.putPoint(point);\n\n\t\t\tvar tabCount:int = this.activeTabs.length;\n\t\t\tfor(var i:int = 0; i < tabCount; i++)\n\t\t\t{\n\t\t\t\tvar tab:ToggleButton = this.activeTabs[i];\n\t\t\t\tif(this._direction === Direction.HORIZONTAL)\n\t\t\t\t{\n\t\t\t\t\tpoint = Pool.getPoint(tab.width / 2, 0);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tpoint = Pool.getPoint(0, tab.height / 2);\n\t\t\t\t}\n\t\t\t\ttab.localToGlobal(point, point);\n\t\t\t\tvar tabGlobalMiddleX:Number = point.x;\n\t\t\t\tvar tabGlobalMiddleY:Number = point.y;\n\t\t\t\tPool.putPoint(point);\n\t\t\t\tif(this._direction === Direction.VERTICAL)\n\t\t\t\t{\n\t\t\t\t\tif(globalY < tabGlobalMiddleY)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse //horizontal\n\t\t\t\t{\n\t\t\t\t\tif(globalX < tabGlobalMiddleX)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tabCount;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshDropIndicator(event:DragDropEvent):void\n\t\t{\n\t\t\tif(!this._dropIndicatorSkin)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar dropIndex:int = this.getDropIndex(event);\n\t\t\tif(this._direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tvar dropIndicatorY:Number = 0;\n\t\t\t\tif(dropIndex == this.activeTabs.length)\n\t\t\t\t{\n\t\t\t\t\tdropIndicatorY = this.actualHeight - this._dropIndicatorSkin.height;\n\t\t\t\t}\n\t\t\t\telse if(dropIndex == 0)\n\t\t\t\t{\n\t\t\t\t\tdropIndicatorY = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar tab:ToggleButton = this.activeTabs[dropIndex];\n\t\t\t\t\tdropIndicatorY = tab.y - (this._gap + this._dropIndicatorSkin.height) / 2;\n\t\t\t\t}\n\t\t\t\tthis._dropIndicatorSkin.x = 0;\n\t\t\t\tthis._dropIndicatorSkin.y = dropIndicatorY;\n\t\t\t\tthis._dropIndicatorSkin.width = this.actualWidth;\n\t\t\t\t//just in case the direction changed, reset this value\n\t\t\t\tthis._dropIndicatorSkin.height = this._explicitDropIndicatorHeight;\n\t\t\t}\n\t\t\telse //horizontal\n\t\t\t{\n\t\t\t\tvar dropIndicatorX:Number = 0;\n\t\t\t\tif(dropIndex == this.activeTabs.length)\n\t\t\t\t{\n\t\t\t\t\tdropIndicatorX = this.actualWidth - this._dropIndicatorSkin.width;\n\t\t\t\t}\n\t\t\t\telse if(dropIndex == 0)\n\t\t\t\t{\n\t\t\t\t\tdropIndicatorX = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttab = this.activeTabs[dropIndex];\n\t\t\t\t\tdropIndicatorX = tab.x - (this._gap + this._dropIndicatorSkin.width) / 2;\n\t\t\t\t}\n\t\t\t\tthis._dropIndicatorSkin.x = dropIndicatorX;\n\t\t\t\tthis._dropIndicatorSkin.y = 0;\n\t\t\t\t//just in case the direction changed, reset this value\n\t\t\t\tthis._dropIndicatorSkin.width = this._explicitDropIndicatorWidth;\n\t\t\t\tthis._dropIndicatorSkin.height = this.actualHeight;\n\t\t\t}\n\t\t\tthis.addChild(this._dropIndicatorSkin);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function childProperties_onChange(proxy:PropertyProxy, name:String):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function selectionChangeTween_onComplete():void\n\t\t{\n\t\t\tthis._selectionChangeTween = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function focusInHandler(event:Event):void\n\t\t{\n\t\t\tsuper.focusInHandler(event);\n\t\t\tthis._focusedTabIndex = this._selectedIndex;\n\t\t\tthis.focusedTabFocusIn();\n\t\t\tthis.stage.addEventListener(KeyboardEvent.KEY_DOWN, stage_keyDownHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function focusOutHandler(event:Event):void\n\t\t{\n\t\t\tsuper.focusOutHandler(event);\n\t\t\tthis.hideFocusedTab();\n\t\t\tthis.focusedTabFocusOut();\n\t\t\tthis.stage.removeEventListener(KeyboardEvent.KEY_DOWN, stage_keyDownHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _focusedTabIndex:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!this._dataProvider || this._dataProvider.length == 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar newFocusedTabIndex:int = this._focusedTabIndex;\n\t\t\tvar maxFocusedTabIndex:int = this._dataProvider.length - 1;\n\t\t\tif(event.keyCode == Keyboard.HOME)\n\t\t\t{\n\t\t\t\tthis.selectedIndex = newFocusedTabIndex = 0;\n\t\t\t}\n\t\t\telse if(event.keyCode == Keyboard.END)\n\t\t\t{\n\t\t\t\tthis.selectedIndex = newFocusedTabIndex = maxFocusedTabIndex;\n\t\t\t}\n\t\t\telse if(event.keyCode == Keyboard.PAGE_UP)\n\t\t\t{\n\t\t\t\tnewFocusedTabIndex--;\n\t\t\t\tif(newFocusedTabIndex < 0)\n\t\t\t\t{\n\t\t\t\t\tnewFocusedTabIndex = maxFocusedTabIndex;\n\t\t\t\t}\n\t\t\t\tthis.selectedIndex = newFocusedTabIndex;\n\t\t\t}\n\t\t\telse if(event.keyCode == Keyboard.PAGE_DOWN)\n\t\t\t{\n\t\t\t\tnewFocusedTabIndex++;\n\t\t\t\tif(newFocusedTabIndex > maxFocusedTabIndex)\n\t\t\t\t{\n\t\t\t\t\tnewFocusedTabIndex = 0;\n\t\t\t\t}\n\t\t\t\tthis.selectedIndex = newFocusedTabIndex;\n\t\t\t}\n\t\t\telse if(event.keyCode == Keyboard.UP || event.keyCode == Keyboard.LEFT)\n\t\t\t{\n\t\t\t\tnewFocusedTabIndex--;\n\t\t\t\tif(newFocusedTabIndex < 0)\n\t\t\t\t{\n\t\t\t\t\tnewFocusedTabIndex = maxFocusedTabIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(event.keyCode == Keyboard.DOWN || event.keyCode == Keyboard.RIGHT)\n\t\t\t{\n\t\t\t\tnewFocusedTabIndex++;\n\t\t\t\tif(newFocusedTabIndex > maxFocusedTabIndex)\n\t\t\t\t{\n\t\t\t\t\tnewFocusedTabIndex = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(newFocusedTabIndex >= 0 && newFocusedTabIndex != this._focusedTabIndex)\n\t\t\t{\n\t\t\t\tthis.hideFocusedTab();\n\t\t\t\tthis.focusedTabFocusOut();\n\t\t\t\tthis._focusedTabIndex = newFocusedTabIndex;\n\t\t\t\tthis.focusedTabFocusIn();\n\t\t\t\tthis.showFocusedTab();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function tab_triggeredHandler(event:Event):void\n\t\t{\n\t\t\t//if this was called after dispose, ignore it\n\t\t\tif(!this._dataProvider || !this.activeTabs)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar tab:ToggleButton = ToggleButton(event.currentTarget);\n\t\t\tvar index:int = this.activeTabs.indexOf(tab);\n\t\t\tvar item:Object = this._dataProvider.getItemAt(index);\n\t\t\tthis.dispatchEventWith(Event.TRIGGERED, false, item);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dragEnterHandler(event:DragDropEvent):void\n\t\t{\n\t\t\tif(!this._dropEnabled)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!event.dragData.hasDataForFormat(this._dragFormat))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tDragDropManager.acceptDrag(this);\n\t\t\tthis.refreshDropIndicator(event);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dragMoveHandler(event:DragDropEvent):void\n\t\t{\n\t\t\tif(!this._dropEnabled)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!event.dragData.hasDataForFormat(this._dragFormat))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.refreshDropIndicator(event);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dragExitHandler(event:DragDropEvent):void\n\t\t{\n\t\t\tif(this._dropIndicatorSkin)\n\t\t\t{\n\t\t\t\tthis._dropIndicatorSkin.removeFromParent(false);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dragDropHandler(event:DragDropEvent):void\n\t\t{\n\t\t\tif(this._dropIndicatorSkin)\n\t\t\t{\n\t\t\t\tthis._dropIndicatorSkin.removeFromParent(false);\n\t\t\t}\n\t\t\tvar index:int = this.getDropIndex(event);\n\t\t\tvar item:Object = event.dragData.getDataForFormat(this._dragFormat);\n\t\t\tvar selectItem:Boolean = this._selectedItem == item;\n\t\t\tif(event.dragSource == this)\n\t\t\t{\n\t\t\t\t//if we wait to remove this item in the dragComplete handler,\n\t\t\t\t//the wrong index might be removed.\n\t\t\t\tvar oldIndex:int = this._dataProvider.getItemIndex(item);\n\t\t\t\tthis._dataProvider.removeItemAt(oldIndex);\n\t\t\t\tthis._droppedOnSelf = true;\n\t\t\t\tif(index > oldIndex)\n\t\t\t\t{\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._dataProvider.addItemAt(item, index);\n\t\t\tif(selectItem)\n\t\t\t{\n\t\t\t\tthis.selectedIndex = index;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dragCompleteHandler(event:DragDropEvent):void\n\t\t{\n\t\t\tif(!event.isDropped)\n\t\t\t{\n\t\t\t\t//nothing to modify\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._droppedOnSelf)\n\t\t\t{\n\t\t\t\t//already modified the data provider in the dragDrop handler\n\t\t\t\tthis._droppedOnSelf = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar item:Object = event.dragData.getDataForFormat(this._dragFormat);\n\t\t\tthis._dataProvider.removeItem(item);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function tab_drag_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._dragEnabled)\n\t\t\t{\n\t\t\t\tthis._dragTouchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(DragDropManager.isDragging)\n\t\t\t{\n\t\t\t\tthis._dragTouchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar tab:ToggleButton = ToggleButton(event.currentTarget);\n\t\t\tif(this._dragTouchPointID != -1)\n\t\t\t{\n\t\t\t\tvar exclusiveTouch:ExclusiveTouch = ExclusiveTouch.forStage(tab.stage);\n\t\t\t\tif(exclusiveTouch.getClaim(this._dragTouchPointID))\n\t\t\t\t{\n\t\t\t\t\tthis._dragTouchPointID = -1;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar touch:Touch = event.getTouch(tab, null, this._dragTouchPointID);\n\t\t\t\tif(touch.phase == TouchPhase.MOVED)\n\t\t\t\t{\n\t\t\t\t\tvar index:int = this.activeTabs.indexOf(tab);\n\t\t\t\t\tvar item:Object = this._dataProvider.getItemAt(index);\n\t\t\t\t\tvar dragData:DragData = new DragData();\n\t\t\t\t\tdragData.setDataForFormat(this._dragFormat, item);\n\t\t\t\t\tvar avatar:ToggleButton = this.createTab(item);\n\t\t\t\t\tavatar.width = tab.width;\n\t\t\t\t\tavatar.height = tab.height;\n\t\t\t\t\tavatar.alpha = 0.8;\n\t\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\t\ttouch.getLocation(tab, point);\n\t\t\t\t\tthis._droppedOnSelf = false;\n\t\t\t\t\tDragDropManager.startDrag(this, touch, dragData, avatar, -point.x, -point.y);\n\t\t\t\t\tPool.putPoint(point);\n\t\t\t\t\texclusiveTouch.claimTouch(this._dragTouchPointID, tab);\n\t\t\t\t\tthis._dragTouchPointID = -1;\n\t\t\t\t}\n\t\t\t\telse if(touch.phase == TouchPhase.ENDED)\n\t\t\t\t{\n\t\t\t\t\tthis._dragTouchPointID = -1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//we aren't tracking another touch, so let's look for a new one.\n\t\t\t\ttouch = event.getTouch(tab, TouchPhase.BEGAN);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\t//we only care about the began phase. ignore all other\n\t\t\t\t\t//phases when we don't have a saved touch ID.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._dragTouchPointID = touch.id;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function toggleGroup_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreSelectionChanges)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//it should only get here if the change happened by the user\n\t\t\t//triggering a tab.\n\t\t\tthis.setSelectedIndexWithAnimation(this.toggleGroup.selectedIndex);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_addItemHandler(event:Event, index:int):void\n\t\t{\n\t\t\tif(this._selectedIndex >= index)\n\t\t\t{\n\t\t\t\t//we're keeping the same selected item, but the selected index\n\t\t\t\t//will change, so we need to manually dispatch the change event\n\t\t\t\tthis.selectedIndex += 1;\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_removeAllHandler(event:Event):void\n\t\t{\n\t\t\tthis.selectedIndex = -1;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_removeItemHandler(event:Event, index:int):void\n\t\t{\n\t\t\tif(this._selectedIndex > index)\n\t\t\t{\n\t\t\t\t//the same item is selected, but its index has changed.\n\t\t\t\tthis.selectedIndex -= 1;\n\t\t\t}\n\t\t\telse if(this._selectedIndex == index)\n\t\t\t{\n\t\t\t\tvar oldIndex:int = this._selectedIndex;\n\t\t\t\tvar newIndex:int = oldIndex;\n\t\t\t\tvar maxIndex:int = this._dataProvider.length - 1;\n\t\t\t\tif(newIndex > maxIndex)\n\t\t\t\t{\n\t\t\t\t\tnewIndex = maxIndex;\n\t\t\t\t}\n\t\t\t\tif(oldIndex == newIndex)\n\t\t\t\t{\n\t\t\t\t\t//we're keeping the same selected index, but the selected\n\t\t\t\t\t//item will change, so we need to manually dispatch the\n\t\t\t\t\t//change event\n\t\t\t\t\tthis.refreshSelectedItem();\n\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//we're selecting both a different index and a different\n\t\t\t\t\t//item, so we'll just call the selectedIndex setter\n\t\t\t\t\tthis.selectedIndex = newIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_resetHandler(event:Event):void\n\t\t{\n\t\t\tif(this._dataProvider.length > 0)\n\t\t\t{\n\t\t\t\t//the data provider has changed drastically. we should reset the\n\t\t\t\t//selection to the first item.\n\t\t\t\tif(this._selectedIndex != 0)\n\t\t\t\t{\n\t\t\t\t\tthis.selectedIndex = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//we're keeping the same selected index, but the selected\n\t\t\t\t\t//item will change, so we need to manually dispatch the\n\t\t\t\t\t//change event\n\t\t\t\t\tthis.refreshSelectedItem();\n\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(this._selectedIndex >= 0)\n\t\t\t{\n\t\t\t\tthis.selectedIndex = -1;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_replaceItemHandler(event:Event, index:int):void\n\t\t{\n\t\t\tif(this._selectedIndex == index)\n\t\t\t{\n\t\t\t\t//we're keeping the same selected index, but the selected\n\t\t\t\t//item will change, so we need to manually dispatch the\n\t\t\t\t//change event\n\t\t\t\tthis.refreshSelectedItem();\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshSelectedIndicesAfterFilterOrSort():void\n\t\t{\n\t\t\tvar oldIndex:int = this._dataProvider.getItemIndex(this._selectedItem);\n\t\t\tif(oldIndex == -1)\n\t\t\t{\n\t\t\t\t//the selected item was filtered\n\t\t\t\tvar newIndex:int = this._selectedIndex;\n\t\t\t\tvar maxIndex:int = this._dataProvider.length - 1;\n\t\t\t\tif(newIndex > maxIndex)\n\t\t\t\t{\n\t\t\t\t\t//try to keep the same selectedIndex, but use the largest\n\t\t\t\t\t//index if the same one can't be used\n\t\t\t\t\tnewIndex = maxIndex;\n\t\t\t\t}\n\t\t\t\tif(newIndex != -1)\n\t\t\t\t{\n\t\t\t\t\tthis.selectedItem = this._dataProvider.getItemAt(newIndex);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.selectedIndex = -1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(oldIndex != this._selectedIndex)\n\t\t\t{\n\t\t\t\t//the selectedItem is the same, but its index has changed\n\t\t\t\tthis.selectedIndex = oldIndex;\n\t\t\t}\n\t\t}\n\n\t\tprotected function dataProvider_sortChangeHandler(event:Event):void\n\t\t{\n\t\t\tthis.refreshSelectedIndicesAfterFilterOrSort();\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_filterChangeHandler(event:Event):void\n\t\t{\n\t\t\tthis.refreshSelectedIndicesAfterFilterOrSort();\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_updateItemHandler(event:Event, index:int):void\n\t\t{\n\t\t\t//no need to dispatch a change event. the index and the item are the\n\t\t\t//same. the item's properties have changed, but that doesn't require\n\t\t\t//a change event.\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_updateAllHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/TabNavigator.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.controls.supportClasses.BaseScreenNavigator;\n\timport feathers.core.IFeathersControl;\n\timport feathers.data.IListCollection;\n\timport feathers.data.VectorCollection;\n\timport feathers.events.ExclusiveTouch;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.Direction;\n\timport feathers.layout.RelativePosition;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.system.DeviceCapabilities;\n\n\timport flash.geom.Point;\n\timport flash.utils.getTimer;\n\n\timport starling.animation.Transitions;\n\timport starling.animation.Tween;\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.utils.Pool;\n\n\t/**\n\t * A style name to add to the navigator's tab bar sub-component.\n\t * Typically used by a theme to provide different styles to different\n\t * navigators.\n\t *\n\t * <p>In the following example, a custom tab bar style name is passed\n\t * to the navigator:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * navigator.customTabBarStyleName = \"my-custom-tab-bar\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( TabBar ).setFunctionForStyleName( \"my-custom-tab-bar\", setCustomTabBarStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_TAB_BAR\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #tabBarFactory\n\t */\n\t[Style(name=\"customTabBarStyleName\",type=\"String\")]\n\n\t/**\n\t * The duration, in seconds, of the animation for a swipe gesture.\n\t *\n\t * <p>In the following example, the duration of the animation for a swipe\n\t * gesture is set to 500 milliseconds:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * navigator.swipeDuration = 0.5;</listing>\n\t *\n\t * @default 0.25\n\t *\n\t * @see #style:swipeEase\n\t * @see #isSwipeEnabled\n\t */\n\t[Style(name=\"swipeDuration\",type=\"Number\")]\n\n\t/**\n\t * The easing function used with the animation for a swipe gesture.\n\t *\n\t * <p>In the following example, the ease of the animation for a swipe\n\t * gesture is customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * navigator.swipeEase = Transitions.EASE_IN_OUT;</listing>\n\t *\n\t * @default starling.animation.Transitions.EASE_OUT\n\t *\n\t * @see http://doc.starling-framework.org/core/starling/animation/Transitions.html starling.animation.Transitions\n\t * @see #style:swipeDuration\n\t * @see #isSwipeEnabled\n\t */\n\t[Style(name=\"swipeEase\",type=\"Object\")]\n\n\t/**\n\t * The location of the tab bar.\n\t *\n\t * <p>The following example positions the tab bar on the top of the\n\t * navigator:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * navigator.tabBarPosition = RelativePosition.TOP;</listing>\n\t *\n\t * @default feathers.layout.RelativePosition.BOTTOM\n\t *\n\t * @see feathers.layout.RelativePosition#TOP\n\t * @see feathers.layout.RelativePosition#RIGHT\n\t * @see feathers.layout.RelativePosition#BOTTOM\n\t * @see feathers.layout.RelativePosition#LEFT\n\t */\n\t[Style(name=\"tabBarPosition\",type=\"String\")]\n\n\t/**\n\t * Typically used to provide some kind of animation or visual effect,\n\t * this function is called when a new screen is shown.\n\t *\n\t * <p>In the following example, the tab navigator is given a\n\t * transition that fades in the new screen on top of the old screen:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * navigator.transition = Fade.createFadeInTransition();</listing>\n\t *\n\t * <p>A number of animated transitions may be found in the\n\t * <a href=\"../motion/package-detail.html\">feathers.motion</a> package.\n\t * However, you are not limited to only these transitions. It's possible\n\t * to create custom transitions too.</p>\n\t *\n\t * <p>A custom transition function should have the following signature:</p>\n\t * <pre>function(oldScreen:DisplayObject, newScreen:DisplayObject, completeCallback:Function):void</pre>\n\t *\n\t * <p>Either of the <code>oldScreen</code> and <code>newScreen</code>\n\t * arguments may be <code>null</code>, but never both. The\n\t * <code>oldScreen</code> argument will be <code>null</code> when the\n\t * first screen is displayed or when a new screen is displayed after\n\t * clearing the screen. The <code>newScreen</code> argument will\n\t * be null when clearing the screen.</p>\n\t *\n\t * <p>The <code>completeCallback</code> function <em>must</em> be called\n\t * when the transition effect finishes.This callback indicate to the\n\t * tab navigator that the transition has finished. This function has\n\t * the following signature:</p>\n\t *\n\t * <pre>function(cancelTransition:Boolean = false):void</pre>\n\t *\n\t * <p>The first argument defaults to <code>false</code>, meaning that\n\t * the transition completed successfully. In most cases, this callback\n\t * may be called without arguments. If a transition is cancelled before\n\t * completion (perhaps through some kind of user interaction), and the\n\t * previous screen should be restored, pass <code>true</code> as the\n\t * first argument to the callback to inform the tab navigator that\n\t * the transition is cancelled.</p>\n\t *\n\t * @default null\n\t *\n\t * @see ../../../help/transitions.html Transitions for Feathers screen navigators\n\t * @see #showScreen()\n\t */\n\t[Style(name=\"transition\",type=\"Function\")]\n\n\t/**\n\t * Dispatched when one of the tabs is triggered. The <code>data</code>\n\t * property of the event contains the <code>TabNavigatorItem</code> that is\n\t * associated with the tab that was triggered.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The <code>TabNavigatorItem</code>\n\t *   associated with the tab that was triggered.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.TRIGGERED\n\t */\n\t[Event(name=\"triggered\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the user starts a swipe gesture to switch tabs.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.BEGIN_INTERACTION\n\t * @see #event:endInteraction feathers.events.FeathersEventType.END_INTERACTION\n\t * @see #isSwipeEnabled\n\t */\n\t[Event(name=\"beginInteraction\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the user stops a swipe gesture. If the user interaction\n\t * has also triggered an animation, the content may continue moving after\n\t * this event is dispatched.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.END_INTERACTION\n\t * @see #event:beginInteraction feathers.events.FeathersEventType.BEGIN_INTERACTION\n\t * @see #isSwipeEnabled\n\t */\n\t[Event(name=\"endInteraction\",type=\"starling.events.Event\")]\n\n\t/**\n\t * A tabbed container.\n\t *\n\t * <p>The following example creates a tab navigator, adds a couple of tabs\n\t * and displays the navigator:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var navigator:TabNavigator = new TabNavigator();\n\t * navigator.addScreen( \"newsFeed\", new TabNavigatorItem( NewsFeedTab, \"News\" ) );\n\t * navigator.addScreen( \"profile\", new TabNavigatorItem( ProfileTab, \"Profile\" ) );\n\t * this.addChild( navigator );\n\t * </listing>\n\t *\n\t * @see ../../../help/tab-navigator.html How to use the Feathers TabNavigator component\n\t * @see feathers.controls.TabNavigatorItem\n\t *\n\t * @productversion Feathers 3.1.0\n\t */\n\tpublic class TabNavigator extends BaseScreenNavigator\n\t{\n\t\t/**\n\t\t * @private\n\t\t * The current velocity is given high importance.\n\t\t */\n\t\tprivate static const CURRENT_VELOCITY_WEIGHT:Number = 2.33;\n\n\t\t/**\n\t\t * @private\n\t\t * Older saved velocities are given less importance.\n\t\t */\n\t\tprivate static const VELOCITY_WEIGHTS:Vector.<Number> = new <Number>[1, 1.33, 1.66, 2];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const MAXIMUM_SAVED_VELOCITY_COUNT:int = 4;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_TAB_BAR_FACTORY:String = \"tabBarFactory\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the tab\n\t\t * bar.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_TAB_BAR:String = \"feathers-tab-navigator-tab-bar\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>TabNavigator</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultTabBarFactory():TabBar\n\t\t{\n\t\t\treturn new TabBar();\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function TabNavigator()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.screenContainer = new LayoutGroup();\n\t\t\tthis.screenContainer.addEventListener(TouchEvent.TOUCH, screenContainer_touchHandler);\n\t\t\tthis.addChild(this.screenContainer);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn TabNavigator.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var touchPointID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectedIndex:int = -1;\n\n\t\t/**\n\t\t * The index of the currently selected tab. Returns <code>-1</code> if\n\t\t * no tab is selected.\n\t\t *\n\t\t * <p>In the following example, the tab navigator's selected index is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * navigator.selectedIndex = 2;</listing>\n\t\t *\n\t\t * <p>The following example listens for when selection changes and\n\t\t * requests the selected index:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * function navigator_changeHandler( event:Event ):void\n\t\t * {\n\t\t *     var navigator:TabNavigator = TabNavigator( event.currentTarget );\n\t\t *     var index:int = navigator.selectedIndex;\n\t\t * \n\t\t * }\n\t\t * navigator.addEventListener( Event.CHANGE, navigator_changeHandler );</listing>\n\t\t *\n\t\t * @default -1\n\t\t */\n\t\tpublic function get selectedIndex():int\n\t\t{\n\t\t\treturn this._selectedIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedIndex(value:int):void\n\t\t{\n\t\t\tif(this._selectedIndex == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._selectedIndex = value;\n\t\t\tif(value < 0)\n\t\t\t{\n\t\t\t\tthis.clearScreenInternal();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar id:String = this._tabBarDataProvider.getItemAt(this._selectedIndex) as String;\n\t\t\t\tif(this._activeScreenID === id)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.showScreen(id);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the tab bar.\n\t\t * This variable is <code>protected</code> so that sub-classes can\n\t\t * customize the tab bar style name in their constructors instead of\n\t\t * using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_TAB_BAR</code>.\n\t\t *\n\t\t * <p>To customize the tab bar style name without subclassing, see\n\t\t * <code>customTabBarStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customTabBarStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var tabBarStyleName:String = DEFAULT_CHILD_STYLE_NAME_TAB_BAR;\n\n\t\t//this would be a VectorCollection with a Vector.<String>, but the ASC1\n\t\t//compiler doesn't like it!\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _tabBarDataProvider:IListCollection = new VectorCollection(new <String>[]);\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _ignoreTabBarChanges:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var tabBar:TabBar;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _tabBarFactory:Function;\n\n\t\t/**\n\t\t * A function used to generate the navigator's tab bar sub-component.\n\t\t * The tab bar must be an instance of <code>TabBar</code> (or a\n\t\t * subclass). This factory can be used to change properties on the tab\n\t\t * bar when it is first created. For instance, if you are skinning\n\t\t * Feathers components without a theme, you might use this factory to\n\t\t * set skins and other styles on the tab bar.\n\t\t *\n\t\t * <p>The function should have the following signature:</p>\n\t\t * <pre>function():TabBar</pre>\n\t\t *\n\t\t * <p>In the following example, a custom tab bar factory is passed\n\t\t * to the navigator:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * navigator.tabBarFactory = function():TabBar\n\t\t * {\n\t\t *     var tabs:TabBar = new TabBar();\n\t\t *     tabs.distributeTabSizes = true;\n\t\t *     return tabs;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.TabBar\n\t\t */\n\t\tpublic function get tabBarFactory():Function\n\t\t{\n\t\t\treturn this._tabBarFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set tabBarFactory(value:Function):void\n\t\t{\n\t\t\tif(this._tabBarFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._tabBarFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TAB_BAR_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customTabBarStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customTabBarStyleName():String\n\t\t{\n\t\t\treturn this._customTabBarStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customTabBarStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customTabBarStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customTabBarStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TAB_BAR_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _tabBarPosition:String = RelativePosition.BOTTOM;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"top,right,bottom,left\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get tabBarPosition():String\n\t\t{\n\t\t\treturn this._tabBarPosition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set tabBarPosition(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._tabBarPosition === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._tabBarPosition = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TAB_BAR_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _transition:Function;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get transition():Function\n\t\t{\n\t\t\treturn this._transition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set transition(value:Function):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._transition = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _dragCancelled:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isDragging:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isDraggingPrevious:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isDraggingNext:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _swipeTween:Tween = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isSwipeEnabled:Boolean = false;\n\n\t\t/**\n\t\t * Determines if the swipe gesture to switch between tabs is enabled.\n\t\t *\n\t\t * <p>In the following example, swiping between tabs is enabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * navigator.isSwipeEnabled = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic function get isSwipeEnabled():Boolean\n\t\t{\n\t\t\treturn this._isSwipeEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isSwipeEnabled(value:Boolean):void\n\t\t{\n\t\t\tthis._isSwipeEnabled = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _swipeDuration:Number = 0.25;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get swipeDuration():Number\n\t\t{\n\t\t\treturn this._swipeDuration;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set swipeDuration(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._swipeDuration = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _swipeEase:Object = Transitions.EASE_OUT;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get swipeEase():Object\n\t\t{\n\t\t\treturn this._swipeEase;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set swipeEase(value:Object):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._swipeEase = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimumDragDistance:Number = 0.04;\n\n\t\t/**\n\t\t * The minimum physical distance (in inches) that a touch must move\n\t\t * before a drag gesture begins.\n\t\t *\n\t\t * <p>In the following example, the minimum drag distance is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * scroller.minimumDragDistance = 0.1;</listing>\n\t\t *\n\t\t * @default 0.04\n\t\t */\n\t\tpublic function get minimumDragDistance():Number\n\t\t{\n\t\t\treturn this._minimumDragDistance;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minimumDragDistance(value:Number):void\n\t\t{\n\t\t\tthis._minimumDragDistance = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimumSwipeVelocity:Number = 5;\n\n\t\t/**\n\t\t * The minimum physical velocity (in inches per second) that a touch\n\t\t * must move before a swipe is detected. Otherwise, it will settle which\n\t\t * screen to navigate to based on which one is closer when the touch ends.\n\t\t *\n\t\t * <p>In the following example, the minimum swipe velocity is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * navigator.minimumSwipeVelocity = 2;</listing>\n\t\t *\n\t\t * @default 5\n\t\t */\n\t\tpublic function get minimumSwipeVelocity():Number\n\t\t{\n\t\t\treturn this._minimumSwipeVelocity;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minimumSwipeVelocity(value:Number):void\n\t\t{\n\t\t\tthis._minimumSwipeVelocity = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _startTouchX:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _startTouchY:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentTouchX:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentTouchY:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _previousTouchTime:int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _previousTouchX:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _previousTouchY:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _velocityX:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _velocityY:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _previousVelocityX:Vector.<Number> = new <Number>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _previousVelocityY:Vector.<Number> = new <Number>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _savedTransitionOnComplete:Function;\n\n\t\t/**\n\t\t * Registers a new screen with a string identifier that can be used\n\t\t * to reference the screen in other calls, like <code>removeScreen()</code>\n\t\t * or <code>showScreen()</code>.\n\t\t *\n\t\t * @see #addScreenAt()\n\t\t * @see #removeScreen()\n\t\t * @see #removeScreenAt()\n\t\t */\n\t\tpublic function addScreen(id:String, item:TabNavigatorItem):void\n\t\t{\n\t\t\tthis.addScreenAt(id, item, this._tabBarDataProvider.length);\n\t\t}\n\n\t\t/**\n\t\t * Registers a new screen with a string identifier that can be used\n\t\t * to reference the screen in other calls, like <code>removeScreen()</code>\n\t\t * or <code>showScreen()</code>.\n\t\t *\n\t\t * @see #addScreen()\n\t\t * @see #removeScreen()\n\t\t * @see #removeScreenAt()\n\t\t */\n\t\tpublic function addScreenAt(id:String, item:TabNavigatorItem, index:int):void\n\t\t{\n\t\t\tthis.addScreenInternal(id, item);\n\t\t\tthis._tabBarDataProvider.addItemAt(id, index);\n\t\t\tif(this._selectedIndex < 0 && this._tabBarDataProvider.length == 1)\n\t\t\t{\n\t\t\t\tthis.selectedIndex = 0;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Removes an existing screen using the identifier assigned to it in the\n\t\t * call to <code>addScreen()</code> or <code>addScreenAt()</code>.\n\t\t *\n\t\t * @see #removeScreenAt()\n\t\t * @see #removeAllScreens()\n\t\t * @see #addScreen()\n\t\t * @see #addScreenAt()\n\t\t */\n\t\tpublic function removeScreen(id:String):TabNavigatorItem\n\t\t{\n\t\t\tthis._tabBarDataProvider.removeItem(id);\n\t\t\treturn TabNavigatorItem(this.removeScreenInternal(id));\n\t\t}\n\n\t\t/**\n\t\t * Removes an existing screen using the identifier assigned to it in the\n\t\t * call to <code>addScreen()</code>.\n\t\t *\n\t\t * @see #removeScreen()\n\t\t * @see #removeAllScreens()\n\t\t * @see #addScreen()\n\t\t * @see #addScreenAt()\n\t\t */\n\t\tpublic function removeScreenAt(index:int):TabNavigatorItem\n\t\t{\n\t\t\tvar id:String = this._tabBarDataProvider.removeItemAt(index) as String;\n\t\t\treturn TabNavigatorItem(this.removeScreenInternal(id));\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function removeAllScreens():void\n\t\t{\n\t\t\tthis._tabBarDataProvider.removeAll();\n\t\t\tsuper.removeAllScreens();\n\t\t}\n\n\t\t/**\n\t\t *\n\t\t * Displays the screen with the specified id. An optional transition may\n\t\t * be passed in. If <code>null</code> the <code>transition</code>\n\t\t * property will be used instead.\n\t\t *\n\t\t * <p>Returns a reference to the new screen, unless a transition is\n\t\t * currently active. In that case, the new screen will be queued until\n\t\t * the transition has completed, and no reference will be returned.</p>\n\t\t *\n\t\t * @see #transition\n\t\t */\n\t\tpublic function showScreen(id:String, transition:Function = null):DisplayObject\n\t\t{\n\t\t\tif(this._activeScreenID === id)\n\t\t\t{\n\t\t\t\t//if we're already showing this id, do nothing\n\t\t\t\treturn this._activeScreen;\n\t\t\t}\n\t\t\tif(transition === null)\n\t\t\t{\n\t\t\t\tvar item:TabNavigatorItem = this.getScreen(id);\n\t\t\t\tif(item !== null && item.transition !== null)\n\t\t\t\t{\n\t\t\t\t\ttransition = item.transition;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttransition = this.transition;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//showScreenInternal() dispatches Event.CHANGE, so we want to be\n\t\t\t//sure that the selectedIndex property returns the correct value\n\t\t\tthis._selectedIndex = this._tabBarDataProvider.getItemIndex(id);\n\t\t\tvar result:DisplayObject = this.showScreenInternal(id, transition);\n\t\t\t//however, we don't want to set the tab bar's selectedIndex before\n\t\t\t//calling setScreenInternal() because it would cause showScreen()\n\t\t\t//to be called again if we did it first\n\t\t\tthis.tabBar.selectedIndex = this._selectedIndex;\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * Returns the <code>TabNavigatorItem</code> instance with the\n\t\t * specified identifier.\n\t\t */\n\t\tpublic function getScreen(id:String):TabNavigatorItem\n\t\t{\n\t\t\tif(this._screens.hasOwnProperty(id))\n\t\t\t{\n\t\t\t\treturn TabNavigatorItem(this._screens[id]);\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function hitTest(localPoint:Point):DisplayObject\n\t\t{\n\t\t\tvar result:DisplayObject = super.hitTest(localPoint);\n\t\t\tif(result)\n\t\t\t{\n\t\t\t\tif(this._isDragging)\n\t\t\t\t{\n\t\t\t\t\treturn this.screenContainer;\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\t//we want to register touches in our hitArea as a last resort\n\t\t\tif(!this.visible || !this.touchable)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn this._hitArea.contains(localPoint.x, localPoint.y) ? this.screenContainer : null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar tabBarFactoryInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_TAB_BAR_FACTORY);\n\n\t\t\tif(tabBarFactoryInvalid)\n\t\t\t{\n\t\t\t\tthis.createTabBar();\n\t\t\t}\n\n\t\t\tsuper.draw();\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>tabBar</code> sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #tabBar\n\t\t * @see #tabBarFactory\n\t\t * @see #style:customTabBarStyleName\n\t\t */\n\t\tprotected function createTabBar():void\n\t\t{\n\t\t\tif(this.tabBar)\n\t\t\t{\n\t\t\t\tthis.tabBar.removeFromParent(true);\n\t\t\t\tthis.tabBar = null;\n\t\t\t}\n\n\t\t\tvar factory:Function = this._tabBarFactory != null ? this._tabBarFactory : defaultTabBarFactory;\n\t\t\tvar tabBarStyleName:String = this._customTabBarStyleName != null ? this._customTabBarStyleName : this.tabBarStyleName;\n\t\t\tthis.tabBar = TabBar(factory());\n\t\t\tthis.tabBar.styleNameList.add(tabBarStyleName);\n\t\t\tif(this._tabBarPosition === RelativePosition.LEFT ||\n\t\t\t\tthis._tabBarPosition === RelativePosition.RIGHT)\n\t\t\t{\n\t\t\t\tthis.tabBar.direction = Direction.VERTICAL;\n\t\t\t}\n\t\t\telse //top or bottom\n\t\t\t{\n\t\t\t\tthis.tabBar.direction = Direction.HORIZONTAL;\n\t\t\t}\n\t\t\tthis.tabBar.addEventListener(Event.CHANGE, tabBar_changeHandler);\n\t\t\tthis.tabBar.addEventListener(Event.TRIGGERED, tabBar_triggeredHandler);\n\t\t\tthis.tabBar.dataProvider = this._tabBarDataProvider;\n\t\t\tthis.tabBar.labelFunction = this.getTabLabel;\n\t\t\tthis.tabBar.iconFunction = this.getTabIcon;\n\t\t\tthis.addChild(this.tabBar);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getTabLabel(id:String):String\n\t\t{\n\t\t\tvar item:TabNavigatorItem = this.getScreen(id);\n\t\t\treturn item.label;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getTabIcon(id:String):DisplayObject\n\t\t{\n\t\t\tvar item:TabNavigatorItem = this.getScreen(id);\n\t\t\treturn item.icon;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function prepareActiveScreen():void\n\t\t{\n\t\t\tif(this._activeScreen is StackScreenNavigator)\n\t\t\t{\n\t\t\t\t//always show root screen when switching to this tab\n\t\t\t\tStackScreenNavigator(this._activeScreen).popToRootScreen(defaultTransition);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function cleanupActiveScreen():void\n\t\t{\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function layoutChildren():void\n\t\t{\n\t\t\tvar screenWidth:Number = this.actualWidth;\n\t\t\tvar screenHeight:Number = this.actualHeight;\n\t\t\tif(this._tabBarPosition === RelativePosition.LEFT ||\n\t\t\t\tthis._tabBarPosition === RelativePosition.RIGHT)\n\t\t\t{\n\t\t\t\tthis.tabBar.y = 0;\n\t\t\t\tthis.tabBar.height = this.actualHeight;\n\t\t\t\tthis.tabBar.validate();\n\t\t\t\tif(this._tabBarPosition === RelativePosition.LEFT)\n\t\t\t\t{\n\t\t\t\t\tthis.tabBar.x = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.tabBar.x = this.actualWidth - this.tabBar.width;\n\t\t\t\t}\n\t\t\t\tscreenWidth -= this.tabBar.width;\n\t\t\t}\n\t\t\telse //top or bottom\n\t\t\t{\n\t\t\t\tthis.tabBar.x = 0;\n\t\t\t\tthis.tabBar.width = this.actualWidth;\n\t\t\t\tthis.tabBar.validate();\n\t\t\t\tif(this._tabBarPosition === RelativePosition.TOP)\n\t\t\t\t{\n\t\t\t\t\tthis.tabBar.y = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.tabBar.y = this.actualHeight - this.tabBar.height;\n\t\t\t\t}\n\t\t\t\tscreenHeight -= this.tabBar.height;\n\t\t\t}\n\n\t\t\tif(this._tabBarPosition === RelativePosition.LEFT)\n\t\t\t{\n\t\t\t\tthis.screenContainer.x = this.tabBar.width;\n\t\t\t}\n\t\t\telse //top, bottom, or right\n\t\t\t{\n\t\t\t\tthis.screenContainer.x = 0;\n\t\t\t}\n\t\t\tif(this._tabBarPosition === RelativePosition.TOP)\n\t\t\t{\n\t\t\t\tthis.screenContainer.y = this.tabBar.height;\n\t\t\t}\n\t\t\telse //right, left, or bottom\n\t\t\t{\n\t\t\t\tthis.screenContainer.y = 0;\n\t\t\t}\n\t\t\tthis.screenContainer.width = screenWidth;\n\t\t\tthis.screenContainer.height = screenHeight;\n\t\t\tif(this._activeScreen !== null)\n\t\t\t{\n\t\t\t\tthis._activeScreen.x = 0;\n\t\t\t\tthis._activeScreen.y = 0;\n\t\t\t\tthis._activeScreen.width = screenWidth;\n\t\t\t\tthis._activeScreen.height = screenHeight;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function tabBar_triggeredHandler(event:Event, id:String):void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.TRIGGERED, false, this.getScreen(id));\n\t\t\tif(id !== this._activeScreenID)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._activeScreen is StackScreenNavigator)\n\t\t\t{\n\t\t\t\tvar navigator:StackScreenNavigator = StackScreenNavigator(this._activeScreen);\n\t\t\t\tnavigator.popToRootScreen();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function tabBar_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreTabBarChanges)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar id:String = this.tabBar.selectedItem as String;\n\t\t\tif(this._activeScreenID === id)\n\t\t\t{\n\t\t\t\t//we're already showing this screen, so no need to do anything\n\t\t\t\t//this probably isn't a bug because we sometimes update the\n\t\t\t\t//tab bar's selected index after the activeScreenID is updated\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar transition:Function = null;\n\t\t\tif(this._activeScreenID === null)\n\t\t\t{\n\t\t\t\ttransition = defaultTransition;\n\t\t\t}\n\t\t\tthis.showScreen(id, transition);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function exclusiveTouch_changeHandler(event:Event, touchID:int):void\n\t\t{\n\t\t\tif(this.touchPointID < 0 || this.touchPointID != touchID || this._isDragging)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar exclusiveTouch:ExclusiveTouch = ExclusiveTouch.forStage(this.stage);\n\t\t\tif(exclusiveTouch.getClaim(touchID) == this)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.touchPointID = -1;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dragTransition(oldScreen:IFeathersControl, newScreen:IFeathersControl, onComplete:Function):void\n\t\t{\n\t\t\tthis._savedTransitionOnComplete = onComplete;\n\t\t\tif(this._swipeTween !== null)\n\t\t\t{\n\t\t\t\t//it's possible that TouchPhase.ENDED is dispatched before the\n\t\t\t\t//transition starts. if that's the case, the tween will already\n\t\t\t\t//be created, and we simply add it to the juggler.\n\t\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\t\tstarling.juggler.add(this._swipeTween);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.handleDragMove();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function handleTouchBegan(touch:Touch):void\n\t\t{\n\t\t\tvar exclusiveTouch:ExclusiveTouch = ExclusiveTouch.forStage(this.stage);\n\t\t\tif(exclusiveTouch.getClaim(touch.id))\n\t\t\t{\n\t\t\t\t//already claimed\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar point:Point = Pool.getPoint();\n\t\t\ttouch.getLocation(this, point);\n\t\t\tvar localX:Number = point.x;\n\t\t\tvar localY:Number = point.y;\n\t\t\tPool.putPoint(point);\n\n\t\t\tthis.touchPointID = touch.id;\n\t\t\tthis._velocityX = 0;\n\t\t\tthis._velocityY = 0;\n\t\t\tthis._previousVelocityX.length = 0;\n\t\t\tthis._previousVelocityY.length = 0;\n\t\t\tthis._previousTouchTime = getTimer();\n\t\t\tthis._previousTouchX = this._startTouchX = this._currentTouchX = localX;\n\t\t\tthis._previousTouchY = this._startTouchY = this._currentTouchY = localY;\n\t\t\tthis._isDraggingPrevious = false;\n\t\t\tthis._isDraggingNext = false;\n\t\t\tthis._isDragging = false;\n\t\t\tthis._dragCancelled = false;\n\n\t\t\texclusiveTouch.addEventListener(Event.CHANGE, exclusiveTouch_changeHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function handleTouchMoved(touch:Touch):void\n\t\t{\n\t\t\tvar point:Point = Pool.getPoint();\n\t\t\ttouch.getLocation(this, point);\n\t\t\tthis._currentTouchX = point.x;\n\t\t\tthis._currentTouchY = point.y;\n\t\t\tPool.putPoint(point);\n\t\t\tvar now:int = getTimer();\n\t\t\tvar timeOffset:int = now - this._previousTouchTime;\n\t\t\tif(timeOffset > 0)\n\t\t\t{\n\t\t\t\t//we're keeping previous velocity updates to improve accuracy\n\t\t\t\tthis._previousVelocityX[this._previousVelocityX.length] = this._velocityX;\n\t\t\t\tif(this._previousVelocityX.length > MAXIMUM_SAVED_VELOCITY_COUNT)\n\t\t\t\t{\n\t\t\t\t\tthis._previousVelocityX.shift();\n\t\t\t\t}\n\t\t\t\tthis._previousVelocityY[this._previousVelocityY.length] = this._velocityY;\n\t\t\t\tif(this._previousVelocityY.length > MAXIMUM_SAVED_VELOCITY_COUNT)\n\t\t\t\t{\n\t\t\t\t\tthis._previousVelocityY.shift();\n\t\t\t\t}\n\t\t\t\tthis._velocityX = (this._currentTouchX - this._previousTouchX) / timeOffset;\n\t\t\t\tthis._velocityY = (this._currentTouchY - this._previousTouchY) / timeOffset;\n\t\t\t\tthis._previousTouchTime = now;\n\t\t\t\tthis._previousTouchX = this._currentTouchX;\n\t\t\t\tthis._previousTouchY = this._currentTouchY;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function handleDragMove():void\n\t\t{\n\t\t\tif(this._tabBarPosition === RelativePosition.LEFT ||\n\t\t\t\tthis._tabBarPosition === RelativePosition.RIGHT)\n\t\t\t{\n\t\t\t\tthis._previousScreenInTransition.y = this._currentTouchY - this._startTouchY;\n\t\t\t}\n\t\t\telse //top or bottom\n\t\t\t{\n\t\t\t\tthis._previousScreenInTransition.x = this._currentTouchX - this._startTouchX;\n\t\t\t}\n\t\t\tthis.swipeTween_onUpdate();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function transitionComplete(cancelTransition:Boolean = false):void\n\t\t{\n\t\t\tif(cancelTransition)\n\t\t\t{\n\t\t\t\tthis._selectedIndex = this._tabBarDataProvider.getItemIndex(this._previousScreenInTransitionID);\n\t\t\t\tvar oldIgnoreTabBarChanges:Boolean = this._ignoreTabBarChanges;\n\t\t\t\tthis._ignoreTabBarChanges = true;\n\t\t\t\tthis.tabBar.selectedIndex = this._selectedIndex;\n\t\t\t\tthis._ignoreTabBarChanges = oldIgnoreTabBarChanges;\n\t\t\t}\n\t\t\tsuper.transitionComplete(cancelTransition);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function swipeTween_onUpdate():void\n\t\t{\n\t\t\tif(this._tabBarPosition === RelativePosition.LEFT ||\n\t\t\t\tthis._tabBarPosition === RelativePosition.RIGHT)\n\t\t\t{\n\t\t\t\tif(this._isDraggingPrevious)\n\t\t\t\t{\n\t\t\t\t\tthis._activeScreen.x = this._previousScreenInTransition.x;\n\t\t\t\t\tthis._activeScreen.y = this._previousScreenInTransition.y - this._activeScreen.height;\n\t\t\t\t}\n\t\t\t\telse if(this._isDraggingNext)\n\t\t\t\t{\n\t\t\t\t\tthis._activeScreen.x = this._previousScreenInTransition.x;\n\t\t\t\t\tthis._activeScreen.y = this._previousScreenInTransition.y + this._previousScreenInTransition.height;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //top or bottom\n\t\t\t{\n\t\t\t\tif(this._isDraggingPrevious)\n\t\t\t\t{\n\t\t\t\t\tthis._activeScreen.x = this._previousScreenInTransition.x - this._activeScreen.width;\n\t\t\t\t\tthis._activeScreen.y = this._previousScreenInTransition.y;\n\t\t\t\t}\n\t\t\t\telse if(this._isDraggingNext)\n\t\t\t\t{\n\t\t\t\t\tthis._activeScreen.x = this._previousScreenInTransition.x + this._previousScreenInTransition.width;\n\t\t\t\t\tthis._activeScreen.y = this._previousScreenInTransition.y;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function swipeTween_onComplete():void\n\t\t{\n\t\t\tthis._swipeTween = null;\n\t\t\tthis._isDragging = false;\n\t\t\tthis._isDraggingPrevious = false;\n\t\t\tthis._isDraggingNext = false;\n\t\t\tvar cancelled:Boolean = this._dragCancelled;\n\t\t\tthis._dragCancelled = false;\n\t\t\tvar onComplete:Function = this._savedTransitionOnComplete;\n\t\t\tthis._savedTransitionOnComplete = null;\n\t\t\tonComplete(cancelled);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function handleDragEnd():void\n\t\t{\n\t\t\tthis._dragCancelled = false;\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tif(this._tabBarPosition === RelativePosition.LEFT ||\n\t\t\t\tthis._tabBarPosition === RelativePosition.RIGHT)\n\t\t\t{\n\t\t\t\t//take the average for more accuracy\n\t\t\t\tvar sum:Number = this._velocityY * CURRENT_VELOCITY_WEIGHT;\n\t\t\t\tvar velocityCount:int = this._previousVelocityY.length;\n\t\t\t\tvar totalWeight:Number = CURRENT_VELOCITY_WEIGHT;\n\t\t\t\tfor(var i:int = 0; i < velocityCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar weight:Number = VELOCITY_WEIGHTS[i];\n\t\t\t\t\tsum += this._previousVelocityY.shift() * weight;\n\t\t\t\t\ttotalWeight += weight;\n\t\t\t\t}\n\t\t\t\tvar inchesPerSecondY:Number = 1000 * (sum / totalWeight) / (DeviceCapabilities.dpi / starling.contentScaleFactor);\n\n\t\t\t\tif(inchesPerSecondY < -this._minimumSwipeVelocity)\n\t\t\t\t{\n\t\t\t\t\t//force next\n\t\t\t\t\tif(this._isDraggingPrevious)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._dragCancelled = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(inchesPerSecondY > this._minimumSwipeVelocity)\n\t\t\t\t{\n\t\t\t\t\t//force previous\n\t\t\t\t\tif(this._isDraggingNext)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._dragCancelled = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(this._activeScreen.y >= (this.screenContainer.height / 2))\n\t\t\t\t{\n\t\t\t\t\tif(this._isDraggingNext)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._dragCancelled = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(this._activeScreen.y <= -(this.screenContainer.height / 2))\n\t\t\t\t{\n\t\t\t\t\tif(this._isDraggingPrevious)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._dragCancelled = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //top or bottom\n\t\t\t{\n\t\t\t\tsum = this._velocityX * CURRENT_VELOCITY_WEIGHT;\n\t\t\t\tvelocityCount = this._previousVelocityX.length;\n\t\t\t\ttotalWeight = CURRENT_VELOCITY_WEIGHT;\n\t\t\t\tfor(i = 0; i < velocityCount; i++)\n\t\t\t\t{\n\t\t\t\t\tweight = VELOCITY_WEIGHTS[i];\n\t\t\t\t\tsum += this._previousVelocityX.shift() * weight;\n\t\t\t\t\ttotalWeight += weight;\n\t\t\t\t}\n\n\t\t\t\tvar inchesPerSecondX:Number = 1000 * (sum / totalWeight) / (DeviceCapabilities.dpi / starling.contentScaleFactor);\n\n\t\t\t\tif(inchesPerSecondX < -this._minimumSwipeVelocity)\n\t\t\t\t{\n\t\t\t\t\t//force next\n\t\t\t\t\tif(this._isDraggingPrevious)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._dragCancelled = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(inchesPerSecondX > this._minimumSwipeVelocity)\n\t\t\t\t{\n\t\t\t\t\t//force previous\n\t\t\t\t\tif(this._isDraggingNext)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._dragCancelled = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(this._activeScreen.x >= (this.screenContainer.width / 2))\n\t\t\t\t{\n\t\t\t\t\tif(this._isDraggingNext)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._dragCancelled = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(this._activeScreen.x <= -(this.screenContainer.width / 2))\n\t\t\t\t{\n\t\t\t\t\tif(this._isDraggingPrevious)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._dragCancelled = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._swipeTween = new Tween(this._previousScreenInTransition, this._swipeDuration, this._swipeEase);\n\t\t\tif(this._tabBarPosition === RelativePosition.LEFT ||\n\t\t\t\tthis._tabBarPosition === RelativePosition.RIGHT)\n\t\t\t{\n\t\t\t\tif(this._dragCancelled)\n\t\t\t\t{\n\t\t\t\t\tthis._swipeTween.animate(\"y\", 0);\n\t\t\t\t}\n\t\t\t\telse if(this._isDraggingPrevious)\n\t\t\t\t{\n\t\t\t\t\tthis._swipeTween.animate(\"y\", this.screenContainer.height);\n\t\t\t\t}\n\t\t\t\telse if(this._isDraggingNext)\n\t\t\t\t{\n\t\t\t\t\tthis._swipeTween.animate(\"y\", -this.screenContainer.height);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //top or bottom\n\t\t\t{\n\t\t\t\tif(this._dragCancelled)\n\t\t\t\t{\n\t\t\t\t\tthis._swipeTween.animate(\"x\", 0);\n\t\t\t\t}\n\t\t\t\telse if(this._isDraggingPrevious)\n\t\t\t\t{\n\t\t\t\t\tthis._swipeTween.animate(\"x\", this.screenContainer.width);\n\t\t\t\t}\n\t\t\t\telse if(this._isDraggingNext)\n\t\t\t\t{\n\t\t\t\t\tthis._swipeTween.animate(\"x\", -this.screenContainer.width);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._swipeTween.onUpdate = this.swipeTween_onUpdate;\n\t\t\tthis._swipeTween.onComplete = this.swipeTween_onComplete;\n\t\t\tif(this._savedTransitionOnComplete !== null)\n\t\t\t{\n\t\t\t\t//it's possible that we get here before the transition has\n\t\t\t\t//officially start. if that's the case, we won't add the tween\n\t\t\t\t//to the juggler now, and we'll do it later.\n\t\t\t\tstarling.juggler.add(this._swipeTween);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function checkForDrag():void\n\t\t{\n\t\t\tvar maxIndex:int = this._tabBarDataProvider.length - 1;\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar horizontalInchesMoved:Number = (this._currentTouchX - this._startTouchX) / (DeviceCapabilities.dpi / starling.contentScaleFactor);\n\t\t\tvar verticalInchesMoved:Number = (this._currentTouchY - this._startTouchY) / (DeviceCapabilities.dpi / starling.contentScaleFactor);\n\t\t\tif(this._tabBarPosition === RelativePosition.LEFT ||\n\t\t\t\tthis._tabBarPosition === RelativePosition.RIGHT)\n\t\t\t{\n\t\t\t\tif(this._selectedIndex > 0 && verticalInchesMoved >= this._minimumDragDistance)\n\t\t\t\t{\n\t\t\t\t\tthis._isDraggingPrevious = true;\n\t\t\t\t}\n\t\t\t\telse if(this._selectedIndex < maxIndex && verticalInchesMoved <= -this._minimumDragDistance)\n\t\t\t\t{\n\t\t\t\t\tthis._isDraggingNext = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //top or bottom\n\t\t\t{\n\t\t\t\tif(this._selectedIndex > 0 && horizontalInchesMoved >= this._minimumDragDistance)\n\t\t\t\t{\n\t\t\t\t\tthis._isDraggingPrevious = true;\n\t\t\t\t}\n\t\t\t\telse if(this._selectedIndex < maxIndex && horizontalInchesMoved <= -this._minimumDragDistance)\n\t\t\t\t{\n\t\t\t\t\tthis._isDraggingNext = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(this._isDraggingPrevious)\n\t\t\t{\n\t\t\t\tvar previousIndex:int = this._selectedIndex - 1;\n\t\t\t\tthis._isDragging = true;\n\t\t\t\tvar previousID:String = this._tabBarDataProvider.getItemAt(previousIndex) as String;\n\t\t\t\tthis.showScreen(previousID, dragTransition);\n\t\t\t}\n\t\t\tif(this._isDraggingNext)\n\t\t\t{\n\t\t\t\tvar nextIndex:int = this._selectedIndex + 1;\n\t\t\t\tthis._isDragging = true;\n\t\t\t\tvar nextID:String = this._tabBarDataProvider.getItemAt(nextIndex) as String;\n\t\t\t\tthis.showScreen(nextID, dragTransition);\n\t\t\t}\n\t\t\tif(this._isDragging)\n\t\t\t{\n\t\t\t\tthis._startTouchX = this._currentTouchX;\n\t\t\t\tthis._startTouchY = this._currentTouchY;\n\t\t\t\tvar exclusiveTouch:ExclusiveTouch = ExclusiveTouch.forStage(this.stage);\n\t\t\t\texclusiveTouch.removeEventListener(Event.CHANGE, exclusiveTouch_changeHandler);\n\t\t\t\texclusiveTouch.claimTouch(this.touchPointID, this);\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.BEGIN_INTERACTION);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function screenContainer_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled || this._swipeTween !== null || !this._isSwipeEnabled)\n\t\t\t{\n\t\t\t\tthis.touchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this.touchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(this.screenContainer, null, this.touchPointID);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(touch.phase == TouchPhase.MOVED)\n\t\t\t\t{\n\t\t\t\t\tthis.handleTouchMoved(touch);\n\n\t\t\t\t\tif(!this._isDragging)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.checkForDrag();\n\t\t\t\t\t}\n\t\t\t\t\tif(this._isDragging)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.handleDragMove();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(touch.phase == TouchPhase.ENDED)\n\t\t\t\t{\n\t\t\t\t\tthis.touchPointID = -1;\n\t\t\t\t\tif(this._isDragging)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.handleDragEnd();\n\t\t\t\t\t\tthis.dispatchEventWith(FeathersEventType.END_INTERACTION);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(this.screenContainer, TouchPhase.BEGAN);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.handleTouchBegan(touch);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/TabNavigatorItem.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.controls.supportClasses.IScreenNavigatorItem;\n\n\timport starling.display.DisplayObject;\n\n\t//it's required by IScreenNavigatorItem, but we always return null\n\t[Exclude(name=\"transitionDelayEvent\",kind=\"property\")]\n\n\t/**\n\t * Data for an individual tab that will be displayed by a\n\t * <code>TabNavigator</code> component.\n\t *\n\t * @see ../../../help/tab-navigator.html How to use the Feathers TabNavigator component\n\t * @see feathers.controls.TabNavigator\n\t *\n\t * @productversion Feathers 3.1.0\n\t */\n\tpublic class TabNavigatorItem implements IScreenNavigatorItem\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function TabNavigatorItem(classOrFunctionOrDisplayObject:Object = null,\n\t\t\tlabel:String = null, icon:DisplayObject = null)\n\t\t{\n\t\t\tif(classOrFunctionOrDisplayObject is DisplayObject)\n\t\t\t{\n\t\t\t\tthis.screenDisplayObject = DisplayObject(classOrFunctionOrDisplayObject);\n\t\t\t}\n\t\t\telse if(classOrFunctionOrDisplayObject is Class)\n\t\t\t{\n\t\t\t\tthis.screenClass = classOrFunctionOrDisplayObject as Class;\n\t\t\t}\n\t\t\telse if(classOrFunctionOrDisplayObject is Function)\n\t\t\t{\n\t\t\t\tthis.screenFunction = classOrFunctionOrDisplayObject as Function;\n\t\t\t}\n\t\t\telse if(classOrFunctionOrDisplayObject !== null)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"Unknown view type. Must be Class, Function, or DisplayObject.\");\n\t\t\t}\n\t\t\tthis._label = label;\n\t\t\tthis._icon = icon;\n\t\t\tthis._properties = {};\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _screenClass:Class;\n\n\t\t/**\n\t\t * A <code>Class</code> that may be instantiated to create a\n\t\t * <code>DisplayObject</code> instance to display when the associated\n\t\t * tab is selected. A new instance of the screen will be instantiated\n\t\t * every time that it is shown by the <code>TabNavigator</code>. The\n\t\t * screen's state will not be saved automatically, but it may be saved\n\t\t * in <code>properties</code>, if needed.\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #screenFunction\n\t\t * @see #screenDisplayObject\n\t\t */\n\t\tpublic function get screenClass():Class\n\t\t{\n\t\t\treturn this._screenClass;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set screenClass(value:Class):void\n\t\t{\n\t\t\tif(this._screenClass === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._screenClass = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tthis.screenFunction = null;\n\t\t\t\tthis.screenDisplayObject = null;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _screenFunction:Function;\n\n\t\t/**\n\t\t * A <code>Function</code> that may be called to return a\n\t\t * <code>DisplayObject</code> instance to display when the associated\n\t\t * tab is selected. A new instance of the screen will be instantiated\n\t\t * every time that it is shown by the <code>TabNavigator</code>. The\n\t\t * screen's state will not be saved automatically, but it may be saved\n\t\t * in <code>properties</code>, if needed.\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #screenClass\n\t\t * @see #screenDisplayObject\n\t\t */\n\t\tpublic function get screenFunction():Function\n\t\t{\n\t\t\treturn this._screenFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set screenFunction(value:Function):void\n\t\t{\n\t\t\tif(this._screenFunction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._screenFunction = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tthis.screenClass = null;\n\t\t\t\tthis.screenDisplayObject = null;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _screenDisplayObject:DisplayObject;\n\n\t\t/**\n\t\t * A display object to be displayed by the <code>TabNavigator</code>\n\t\t * when the associted tab is selected. The same instance will be reused\n\t\t * every time that it is shown by the <code>TabNavigator</code>. Whe\n\t\t * the screen is hidden and shown again, its state will remain the same\n\t\t * as when it was hidden. However, the screen will also be kept in\n\t\t * memory even when it isn't displayed, limiting the resources that are\n\t\t * available for other views.\n\t\t *\n\t\t * <p>Using <code>screenClass</code> or <code>screenFunction</code>\n\t\t * instead of <code>screenDisplayObject</code> is the recommended best\n\t\t * practice. In general, <code>screenDisplayObject</code> should only be\n\t\t * used in rare situations where instantiating a new screen would be\n\t\t * extremely expensive.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #screenClass\n\t\t * @see #screenFunction\n\t\t */\n\t\tpublic function get screenDisplayObject():DisplayObject\n\t\t{\n\t\t\treturn this._screenDisplayObject;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set screenDisplayObject(value:DisplayObject):void\n\t\t{\n\t\t\tif(this._screenDisplayObject === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._screenDisplayObject = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tthis.screenClass = null;\n\t\t\t\tthis.screenFunction = null;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _label:String;\n\n\t\t/**\n\t\t * The label to display on the tab.\n\t\t */\n\t\tpublic function get label():String\n\t\t{\n\t\t\treturn this._label;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set label(value:String):void\n\t\t{\n\t\t\tthis._label = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _icon:DisplayObject;\n\n\t\t/**\n\t\t * The optional icon to display on the tab.\n\t\t */\n\t\tpublic function get icon():DisplayObject\n\t\t{\n\t\t\treturn this._icon;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set icon(value:DisplayObject):void\n\t\t{\n\t\t\tthis._icon = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _properties:Object;\n\n\t\t/**\n\t\t * A set of key-value pairs representing properties to be set on the\n\t\t * screen when it is shown. A pair's key is the name of the screen's\n\t\t * property, and a pair's value is the value to be passed to the\n\t\t * screen's property.\n\t\t */\n\t\tpublic function get properties():Object\n\t\t{\n\t\t\treturn this._properties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set properties(value:Object):void\n\t\t{\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = {};\n\t\t\t}\n\t\t\tthis._properties = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _transition:Function;\n\n\t\t/**\n\t\t * A custom transition for this screen only. If <code>null</code>,\n\t\t * the default <code>transition</code> defined by the\n\t\t * <code>TabNavigator</code> will be used.\n\t\t *\n\t\t * <p>In the following example, the tab navigator item is given a custom\n\t\t * transition:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * item.transition = Fade.createFadeInTransition();</listing>\n\t\t *\n\t\t * <p>A number of animated transitions may be found in the\n\t\t * <a href=\"../motion/package-detail.html\">feathers.motion</a> package.\n\t\t * However, you are not limited to only these transitions. It's possible\n\t\t * to create custom transitions too.</p>\n\t\t *\n\t\t * <p>A custom transition function should have the following signature:</p>\n\t\t * <pre>function(oldScreen:DisplayObject, newScreen:DisplayObject, completeCallback:Function):void</pre>\n\t\t *\n\t\t * <p>Either of the <code>oldScreen</code> and <code>newScreen</code>\n\t\t * arguments may be <code>null</code>, but never both. The\n\t\t * <code>oldScreen</code> argument will be <code>null</code> when the\n\t\t * first screen is displayed or when a new screen is displayed after\n\t\t * clearing the screen. The <code>newScreen</code> argument will\n\t\t * be null when clearing the screen.</p>\n\t\t *\n\t\t * <p>The <code>completeCallback</code> function <em>must</em> be called\n\t\t * when the transition effect finishes. This callback indicate to the\n\t\t * tab navigator that the transition has finished. This function has\n\t\t * the following signature:</p>\n\t\t *\n\t\t * <pre>function(cancelTransition:Boolean = false):void</pre>\n\t\t *\n\t\t * <p>The first argument defaults to <code>false</code>, meaning that\n\t\t * the transition completed successfully. In most cases, this callback\n\t\t * may be called without arguments. If a transition is cancelled before\n\t\t * completion (perhaps through some kind of user interaction), and the\n\t\t * previous screen should be restored, pass <code>true</code> as the\n\t\t * first argument to the callback to inform the tab navigator that\n\t\t * the transition is cancelled.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.TabNavigator#transition\n\t\t * @see ../../../help/transitions.html Transitions for Feathers screen navigators\n\t\t */\n\t\tpublic function get transition():Function\n\t\t{\n\t\t\treturn this._transition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set transition(value:Function):void\n\t\t{\n\t\t\tthis._transition = value;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get canDispose():Boolean\n\t\t{\n\t\t\treturn this._screenDisplayObject === null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get transitionDelayEvent():String\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getScreen():DisplayObject\n\t\t{\n\t\t\tvar viewInstance:DisplayObject;\n\t\t\tif(this._screenDisplayObject !== null)\n\t\t\t{\n\t\t\t\tviewInstance = this._screenDisplayObject;\n\t\t\t}\n\t\t\telse if(this._screenClass !== null)\n\t\t\t{\n\t\t\t\tvar ViewType:Class = Class(this._screenClass);\n\t\t\t\tviewInstance = new ViewType();\n\t\t\t}\n\t\t\telse if(this._screenFunction !== null)\n\t\t\t{\n\t\t\t\tviewInstance = DisplayObject(this._screenFunction.call());\n\t\t\t}\n\t\t\tif(!(viewInstance is DisplayObject))\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"TabNavigatorItem \\\"getScreen()\\\" must return a Starling display object.\");\n\t\t\t}\n\t\t\tif(this._properties)\n\t\t\t{\n\t\t\t\tfor(var propertyName:String in this._properties)\n\t\t\t\t{\n\t\t\t\t\tviewInstance[propertyName] = this._properties[propertyName];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn viewInstance;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/TextArea.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.controls.text.ITextEditorViewPort;\n\timport feathers.controls.text.TextFieldTextEditorViewPort;\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IAdvancedNativeFocusOwner;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IMeasureDisplayObject;\n\timport feathers.core.INativeFocusOwner;\n\timport feathers.core.IStateContext;\n\timport feathers.core.IStateObserver;\n\timport feathers.core.ITextRenderer;\n\timport feathers.core.PopUpManager;\n\timport feathers.core.PropertyProxy;\n\timport feathers.events.FeathersEventType;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.text.FontStylesSet;\n\n\timport flash.events.KeyboardEvent;\n\timport flash.geom.Point;\n\timport flash.ui.Mouse;\n\timport flash.ui.MouseCursor;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.text.TextFormat;\n\timport starling.utils.Pool;\n\n\t/**\n\t * A display object displayed behind the text area's content when it\n\t * is disabled.\n\t *\n\t * <p>In the following example, the text area's disabled background skin\n\t * is specified:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * textArea.isEnabled = false;\n\t * textArea.backgroundDisabledSkin = new Image( texture );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setSkinForState()</code> with\n\t * <code>TextInputState.DISABLED</code> to set the same skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var skin:Image = new Image( texture );\n\t * textArea.setSkinForState( TextInputState.DISABLED, skin );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:backgroundSkin\n\t * @see #setSkinForState()\n\t */\n\t[Style(name=\"backgroundDisabledSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * A display object displayed behind the text area's content when it\n\t * has focus.\n\t *\n\t * <p>In the following example, the text area's focused background skin is\n\t * specified:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * textArea.backgroundFocusedSkin = new Image( texture );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setSkinForState()</code> with\n\t * <code>TextInputState.FOCUSED</code> to set the same skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var skin:Image = new Image( texture );\n\t * textArea.setSkinForState( TextInputState.FOCUSED, skin );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:backgroundSkin\n\t * @see #setSkinForState()\n\t */\n\t[Style(name=\"backgroundFocusedSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The skin used for the text area's error state. If <code>null</code>,\n\t * then <code>backgroundSkin</code> is used instead.\n\t *\n\t * <p>The following example gives the text area a skin for the error state:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * textArea.backgroundErrorSkin = new Image( texture );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setSkinForState()</code> with\n\t * <code>TextInputState.ERROR</code> to set the same skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var skin:Image = new Image( texture );\n\t * textArea.setSkinForState( TextInputState.ERROR, skin );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:backgroundSkin\n\t * @see #setSkinForState()\n\t */\n\t[Style(name=\"backgroundErrorSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * A style name to add to the text area's error callout sub-component.\n\t * Typically used by a theme to provide different styles to different\n\t * text areas.\n\t *\n\t * <p>In the following example, a custom error callout style name\n\t * is passed to the text area:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * textArea.customErrorCalloutStyleName = \"my-custom-text-area-error-callout\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( Callout ).setFunctionForStyleName( \"my-custom-text-area-error-callout\", setCustomTextAreaErrorCalloutStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_ERROR_CALLOUT\n\t * @see feathers.core.FeathersControl#styleNameList\n\t */\n\t[Style(name=\"customErrorCalloutStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to the text area's prompt text renderer\n\t * sub-component. Typically used by a theme to provide different styles\n\t * to different text inputs.\n\t *\n\t * <p>In the following example, a custom prompt text renderer style name\n\t * is passed to the text area:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * textArea.customPromptStyleName = \"my-custom-text-area-prompt\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( BitmapFontTextRenderer ).setFunctionForStyleName( \"my-custom-text-area-prompt\", setCustomTextAreaPromptStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_PROMPT\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #promptFactory\n\t */\n\t[Style(name=\"customPromptStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to the text area's text editor sub-component.\n\t * Typically used by a theme to provide different styles to different\n\t * text areas.\n\t *\n\t * <p>In the following example, a custom text editor style name is\n\t * passed to the text area:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * textArea.customTextEditorStyleName = \"my-custom-text-area-text-editor\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( TextFieldTextEditorViewPort ).setFunctionForStyleName( \"my-custom-text-area-text-editor\", setCustomTextAreaTextEditorStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_TEXT_EDITOR\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #textEditorFactory\n\t */\n\t[Style(name=\"customTextEditorStyleName\",type=\"String\")]\n\n\t/**\n\t * The font styles used to display the text area's text when the text\n\t * area is disabled.\n\t *\n\t * <p>In the following example, the disabled font styles are customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * textArea.disabledFontStyles = new TextFormat( \"Helvetica\", 20, 0x999999 );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setFontStylesForState()</code> with\n\t * <code>TextInputState.DISABLED</code> to set the same font styles:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var fontStyles:TextFormat = new TextFormat( \"Helvetica\", 20, 0x999999 );\n\t * textArea.setFontStylesForState( TextInputState.DISABLED, fontStyles );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text editor being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>textEditorFactory</code> to set more advanced styles on the\n\t * text editor.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:fontStyles\n\t * @see #setFontStylesForState()\n\t */\n\t[Style(name=\"disabledFontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The font styles used to display the text area's text.\n\t *\n\t * <p>In the following example, the font styles are customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * textArea.fontStyles = new TextFormat( \"Helvetica\", 20, 0xcc0000 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text editor being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>textEditorFactory</code> to set more advanced styles on the\n\t * text editor.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:disabledFontStyles\n\t * @see #setFontStylesForState()\n\t */\n\t[Style(name=\"fontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * Quickly sets all inner padding properties to the same value. The\n\t * <code>innerPadding</code> getter always returns the value of\n\t * <code>innerPaddingTop</code>, but the other innert padding values may be\n\t * different.\n\t *\n\t * <p>The following example gives the button 20 pixels of padding on all\n\t * sides:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * textArea.innerPadding = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:innerPaddingTop\n\t * @see #style:innerPaddingRight\n\t * @see #style:innerPaddingBottom\n\t * @see #style:innerPaddingLeft\n\t */\n\t[Style(name=\"innerPadding\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the text area's top edge and the\n\t * text area's content.\n\t *\n\t * <p>The following example gives the text area 20 pixels of inner padding\n\t * on the top edge only:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * textArea.innerPaddingTop = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:innerPadding\n\t */\n\t[Style(name=\"innerPaddingTop\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the text area's right edge and the\n\t * text area's content.\n\t *\n\t * <p>The following example gives the text area 20 pixels of inner padding\n\t * on the right edge only:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * textArea.innerPaddingRight = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:innerPadding\n\t */\n\t[Style(name=\"innerPaddingRight\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the text area's bottom edge and the\n\t * text area's content.\n\t *\n\t * <p>The following example gives the text area 20 pixels of inner padding\n\t * on the bottom edge only:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * textArea.innerPaddingBottom = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:innerPadding\n\t */\n\t[Style(name=\"innerPaddingBottom\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the text area's left edge and the\n\t * text area's content.\n\t *\n\t * <p>The following example gives the text area 20 pixels of inner padding\n\t * on the left edge only:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * textArea.innerPaddingLeft = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:innerPadding\n\t */\n\t[Style(name=\"innerPaddingLeft\",type=\"Number\")]\n\n\t/**\n\t * The font styles used to display the text area's prompt when the text area\n\t * is disabled.\n\t *\n\t * <p>In the following example, the disabled font styles are customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * textArea.promptDisabledFontStyles = new TextFormat( \"Helvetica\", 20, 0x999999 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>promptFactory</code> to set more advanced styles on the\n\t * text renderer.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:promptFontStyles\n\t * @see #setPromptFontStylesForState()\n\t */\n\t[Style(name=\"promptDisabledFontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The font styles used to display the text area's prompt text.\n\t *\n\t * <p>In the following example, the font styles are customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * textArea.promptFontStyles = new TextFormat( \"Helvetica\", 20, 0xcc0000 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>promptFactory</code> to set more advanced styles on the\n\t * text renderer.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:promptDisabledFontStyles\n\t * @see #setPromptFontStylesForState()\n\t */\n\t[Style(name=\"promptFontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * Dispatched when the text area's <code>text</code> property changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #text\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the display object's state changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.STATE_CHANGE\n\t *\n\t * @see #currentState\n\t */\n\t[Event(name=\"stateChange\",type=\"starling.events.Event\")]\n\n\t/**\n\t * A text entry control that allows users to enter and edit multiple lines\n\t * of uniformly-formatted text with the ability to scroll.\n\t *\n\t * <p>The following example sets the text in a text area, selects the text,\n\t * and listens for when the text value changes:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var textArea:TextArea = new TextArea();\n\t * textArea.text = \"Hello\\nWorld\"; //it's multiline!\n\t * textArea.selectRange( 0, textArea.text.length );\n\t * textArea.addEventListener( Event.CHANGE, textArea_changeHandler );\n\t * this.addChild( textArea );</listing>\n\t *\n\t * @see ../../../help/text-area.html How to use the Feathers TextArea component\n\t * @see feathers.controls.TextInput\n\t *\n\t * @productversion Feathers 1.1.0\n\t */\n\tpublic class TextArea extends Scroller implements IAdvancedNativeFocusOwner, IStateContext\n\t{\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the text\n\t\t * editor.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_TEXT_EDITOR:String = \"feathers-text-area-text-editor\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the\n\t\t * prompt text renderer.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_PROMPT:String = \"feathers-text-input-prompt\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the\n\t\t * error callout.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_ERROR_CALLOUT:String = \"feathers-text-area-error-callout\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_ERROR_CALLOUT_FACTORY:String = \"errorCalloutFactory\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_PROMPT_FACTORY:String = \"promptFactory\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>TextArea</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\tprivate static function defaultErrorCalloutFactory():TextCallout\n\t\t{\n\t\t\treturn new TextCallout();\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function TextArea()\n\t\t{\n\t\t\tsuper();\n\t\t\tif(this._fontStylesSet === null)\n\t\t\t{\n\t\t\t\tthis._fontStylesSet = new FontStylesSet();\n\t\t\t\tthis._fontStylesSet.addEventListener(Event.CHANGE, fontStyles_changeHandler);\n\t\t\t}\n\t\t\tif(this._promptFontStylesSet === null)\n\t\t\t{\n\t\t\t\tthis._promptFontStylesSet = new FontStylesSet();\n\t\t\t\tthis._promptFontStylesSet.addEventListener(Event.CHANGE, fontStyles_changeHandler);\n\t\t\t}\n\t\t\tthis._measureViewPort = false;\n\t\t\tthis.addEventListener(TouchEvent.TOUCH, textArea_touchHandler);\n\t\t\tthis.addEventListener(Event.REMOVED_FROM_STAGE, textArea_removedFromStageHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var textEditorViewPort:ITextEditorViewPort;\n\n\t\t/**\n\t\t * The <code>TextCallout</code> that displays the value of the\n\t\t * <code>errorString</code> property. The value may be <code>null</code>\n\t\t * if there is no current error string or if the text area doesn't have\n\t\t * focus.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t */\n\t\tprotected var callout:TextCallout;\n\n\t\t/**\n\t\t * The prompt text renderer sub-component.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t */\n\t\tprotected var promptTextRenderer:ITextRenderer;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the text editor.\n\t\t * This variable is <code>protected</code> so that sub-classes can\n\t\t * customize the text editor style name in their constructors instead of\n\t\t * using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_TEXT_EDITOR</code>.\n\t\t *\n\t\t * <p>To customize the text editor style name without subclassing, see\n\t\t * <code>customTextEditorStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customTextEditorStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var textEditorStyleName:String = DEFAULT_CHILD_STYLE_NAME_TEXT_EDITOR;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the prompt text\n\t\t * renderer. This variable is <code>protected</code> so that sub-classes\n\t\t * can customize the prompt text renderer style name in their\n\t\t * constructors instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_PROMPT</code>.\n\t\t *\n\t\t * <p>To customize the prompt text renderer style name without\n\t\t * subclassing, see <code>customPromptStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customPromptStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var promptStyleName:String = DEFAULT_CHILD_STYLE_NAME_PROMPT;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the error\n\t\t * callout. This variable is <code>protected</code> so that sub-classes\n\t\t * can customize the error callout text renderer style name in their\n\t\t * constructors instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_ERROR_CALLOUT</code>.\n\t\t *\n\t\t * <p>To customize the error callout style name without subclassing, see\n\t\t * <code>customErrorCalloutStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customErrorCalloutStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var errorCalloutStyleName:String = DEFAULT_CHILD_STYLE_NAME_ERROR_CALLOUT;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textEditorHasFocus:Boolean = false;\n\n\t\t/**\n\t\t * A text editor may be an <code>INativeFocusOwner</code>, so we need to\n\t\t * return the value of its <code>nativeFocus</code> property. If not,\n\t\t * then we return <code>null</code>.\n\t\t *\n\t\t * @see feathers.core.INativeFocusOwner\n\t\t */\n\t\tpublic function get nativeFocus():Object\n\t\t{\n\t\t\tif(this.textEditorViewPort is INativeFocusOwner)\n\t\t\t{\n\t\t\t\treturn INativeFocusOwner(this.textEditorViewPort).nativeFocus;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isWaitingToSetFocus:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _pendingSelectionBeginIndex:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _pendingSelectionEndIndex:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textAreaTouchPointID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _oldMouseCursor:String = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _ignoreTextChanges:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn TextArea.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function get isFocusEnabled():Boolean\n\t\t{\n\t\t\tif(this._isEditable)\n\t\t\t{\n\t\t\t\t//the behavior is different when editable.\n\t\t\t\treturn this._isEnabled && this._isFocusEnabled;\n\t\t\t}\n\t\t\treturn super.isFocusEnabled;\n\t\t}\n\n\t\t/**\n\t\t * When the <code>FocusManager</code> isn't enabled, <code>hasFocus</code>\n\t\t * can be used instead of <code>FocusManager.focus == textArea</code>\n\t\t * to determine if the text area has focus.\n\t\t */\n\t\tpublic function get hasFocus():Boolean\n\t\t{\n\t\t\tif(!this._focusManager)\n\t\t\t{\n\t\t\t\treturn this._textEditorHasFocus;\n\t\t\t}\n\t\t\treturn this._hasFocus;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set isEnabled(value:Boolean):void\n\t\t{\n\t\t\tsuper.isEnabled = value;\n\t\t\tthis.refreshState();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentState:String = TextInputState.ENABLED;\n\n\t\t/**\n\t\t * The current state of the text area.\n\t\t *\n\t\t * @see feathers.controls.TextInputState\n\t\t * @see #event:stateChange feathers.events.FeathersEventType.STATE_CHANGE\n\t\t */\n\t\tpublic function get currentState():String\n\t\t{\n\t\t\treturn this._currentState;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _text:String = \"\";\n\n\t\t/**\n\t\t * The text displayed by the text area. The text area dispatches\n\t\t * <code>Event.CHANGE</code> when the value of the <code>text</code>\n\t\t * property changes for any reason.\n\t\t *\n\t\t * <p>In the following example, the text area's text is updated:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textArea.text = \"Hello World\";</listing>\n\t\t *\n\t\t * @see #event:change\n\t\t *\n\t\t * @default \"\"\n\t\t */\n\t\tpublic function get text():String\n\t\t{\n\t\t\treturn this._text;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set text(value:String):void\n\t\t{\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\t//don't allow null or undefined\n\t\t\t\tvalue = \"\";\n\t\t\t}\n\t\t\tif(this._text == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._text = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _prompt:String = null;\n\n\t\t/**\n\t\t * The prompt, hint, or description text displayed by the text area when\n\t\t * the value of its text is empty.\n\t\t *\n\t\t * <p>In the following example, the text area's prompt is updated:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textArea.prompt = \"User Name\";</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get prompt():String\n\t\t{\n\t\t\treturn this._prompt;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set prompt(value:String):void\n\t\t{\n\t\t\tif(this._prompt == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._prompt = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maxChars:int = 0;\n\n\t\t/**\n\t\t * The maximum number of characters that may be entered.\n\t\t *\n\t\t * <p>In the following example, the text area's maximum characters is\n\t\t * specified:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textArea.maxChars = 10;</listing>\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get maxChars():int\n\t\t{\n\t\t\treturn this._maxChars;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maxChars(value:int):void\n\t\t{\n\t\t\tif(this._maxChars == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._maxChars = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _restrict:String;\n\n\t\t/**\n\t\t * Limits the set of characters that may be entered.\n\t\t *\n\t\t * <p>In the following example, the text area's allowed characters are\n\t\t * restricted:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textArea.restrict = \"0-9;</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get restrict():String\n\t\t{\n\t\t\treturn this._restrict;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set restrict(value:String):void\n\t\t{\n\t\t\tif(this._restrict == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._restrict = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isEditable:Boolean = true;\n\n\t\t/**\n\t\t * Determines if the text area is editable. If the text area is not\n\t\t * editable, it will still appear enabled.\n\t\t *\n\t\t * <p>In the following example, the text area is not editable:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textArea.isEditable = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic function get isEditable():Boolean\n\t\t{\n\t\t\treturn this._isEditable;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isEditable(value:Boolean):void\n\t\t{\n\t\t\tif(this._isEditable == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isEditable = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _errorString:String = null;\n\n\t\t/**\n\t\t * Error text to display in a <code>Callout</code> when the text area\n\t\t * has focus. When this value is not <code>null</code> the text area's\n\t\t * state is changed to <code>TextInputState.ERROR</code>.\n\t\t *\n\t\t * An empty string will change the background, but no\n\t\t * <code>Callout</code> will appear on focus.\n\t\t *\n\t\t * To clear an error, the <code>errorString</code> property must be set\n\t\t * to <code>null</code>\n\t\t *\n\t\t * <p>The following example displays an error string:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textArea.errorString = \"Something is wrong\";</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #currentState\n\t\t */\n\t\tpublic function get errorString():String\n\t\t{\n\t\t\treturn this._errorString;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set errorString(value:String):void\n\t\t{\n\t\t\tif(this._errorString === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._errorString = value;\n\t\t\tthis.refreshState();\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _stateToSkin:Object = {};\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function get backgroundDisabledSkin():DisplayObject\n\t\t{\n\t\t\treturn this.getSkinForState(TextInputState.DISABLED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set backgroundDisabledSkin(value:DisplayObject):void\n\t\t{\n\t\t\tthis.setSkinForState(TextInputState.DISABLED, value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundFocusedSkin():DisplayObject\n\t\t{\n\t\t\treturn this.getSkinForState(TextInputState.FOCUSED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundFocusedSkin(value:DisplayObject):void\n\t\t{\n\t\t\tthis.setSkinForState(TextInputState.FOCUSED, value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundErrorSkin():DisplayObject\n\t\t{\n\t\t\treturn this.getSkinForState(TextInputState.ERROR);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundErrorSkin(value:DisplayObject):void\n\t\t{\n\t\t\tthis.setSkinForState(TextInputState.ERROR, value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fontStylesSet:FontStylesSet;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get fontStyles():TextFormat\n\t\t{\n\t\t\treturn this._fontStylesSet.format;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set fontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._fontStylesSet.format;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._fontStylesSet.format = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get disabledFontStyles():TextFormat\n\t\t{\n\t\t\treturn this._fontStylesSet.disabledFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disabledFontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._fontStylesSet.disabledFormat;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._fontStylesSet.disabledFormat = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textEditorFactory:Function;\n\n\t\t/**\n\t\t * A function used to instantiate the text editor view port. If\n\t\t * <code>null</code>, a <code>TextFieldTextEditorViewPort</code> will\n\t\t * be instantiated. The text editor must be an instance of\n\t\t * <code>ITextEditorViewPort</code>. This factory can be used to change\n\t\t * properties on the text editor view port when it is first created. For\n\t\t * instance, if you are skinning Feathers components without a theme,\n\t\t * you might use this factory to set styles on the text editor view\n\t\t * port.\n\t\t *\n\t\t * <p>The factory should have the following function signature:</p>\n\t\t * <pre>function():ITextEditorViewPort</pre>\n\t\t *\n\t\t * <p>In the following example, a custom text editor factory is passed\n\t\t * to the text area:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textArea.textEditorFactory = function():ITextEditorViewPort\n\t\t * {\n\t\t *     return new TextFieldTextEditorViewPort();\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.text.ITextEditorViewPort\n\t\t */\n\t\tpublic function get textEditorFactory():Function\n\t\t{\n\t\t\treturn this._textEditorFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set textEditorFactory(value:Function):void\n\t\t{\n\t\t\tif(this._textEditorFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textEditorFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_EDITOR);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customTextEditorStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customTextEditorStyleName():String\n\t\t{\n\t\t\treturn this._customTextEditorStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customTextEditorStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customTextEditorStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customTextEditorStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textEditorProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the text area's text editor\n\t\t * sub-component, and the properties will be passed down to the\n\t\t * text editor when the text area validates. The available properties\n\t\t * depend on which <code>ITextEditorViewPort</code> implementation is\n\t\t * returned by <code>textEditorFactory</code>. Refer to\n\t\t * <a href=\"text/ITextEditorViewPort.html\"><code>feathers.controls.text.ITextEditorViewPort</code></a>\n\t\t * for a list of available text editor implementations for text area.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>textEditorFactory</code> function\n\t\t * instead of using <code>textEditorProperties</code> will result in\n\t\t * better performance.</p>\n\t\t *\n\t\t * <p>In the following example, the text input's text editor properties\n\t\t * are specified (this example assumes that the text editor is a\n\t\t * <code>TextFieldTextEditorViewPort</code>):</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textArea.textEditorProperties.textFormat = new TextFormat( \"Source Sans Pro\", 16, 0x333333);\n\t\t * textArea.textEditorProperties.embedFonts = true;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #textEditorFactory\n\t\t * @see feathers.controls.text.ITextEditorViewPort\n\t\t */\n\t\tpublic function get textEditorProperties():Object\n\t\t{\n\t\t\tif(!this._textEditorProperties)\n\t\t\t{\n\t\t\t\tthis._textEditorProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._textEditorProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set textEditorProperties(value:Object):void\n\t\t{\n\t\t\tif(this._textEditorProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._textEditorProperties)\n\t\t\t{\n\t\t\t\tthis._textEditorProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._textEditorProperties = PropertyProxy(value);\n\t\t\tif(this._textEditorProperties)\n\t\t\t{\n\t\t\t\tthis._textEditorProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _promptFontStylesSet:FontStylesSet;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get promptFontStyles():TextFormat\n\t\t{\n\t\t\treturn this._promptFontStylesSet.format;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set promptFontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._promptFontStylesSet.format;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._promptFontStylesSet.format = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get promptDisabledFontStyles():TextFormat\n\t\t{\n\t\t\treturn this._promptFontStylesSet.disabledFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set promptDisabledFontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._promptFontStylesSet.disabledFormat;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._promptFontStylesSet.disabledFormat = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _promptFactory:Function;\n\n\t\t/**\n\t\t * A function used to instantiate the prompt text renderer. If null,\n\t\t * <code>FeathersControl.defaultTextRendererFactory</code> is used\n\t\t * instead. The prompt text renderer must be an instance of\n\t\t * <code>ITextRenderer</code>. This factory can be used to change\n\t\t * properties on the prompt when it is first created. For instance, if\n\t\t * you are skinning Feathers components without a theme, you might use\n\t\t * this factory to set styles on the prompt.\n\t\t *\n\t\t * <p>The factory should have the following function signature:</p>\n\t\t * <pre>function():ITextRenderer</pre>\n\t\t *\n\t\t * <p>If the <code>prompt</code> property is <code>null</code>, the\n\t\t * prompt text renderer will not be created.</p>\n\t\t *\n\t\t * <p>In the following example, a custom prompt factory is passed to the\n\t\t * text input:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * input.promptFactory = function():ITextRenderer\n\t\t * {\n\t\t *     return new TextFieldTextRenderer();\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #prompt\n\t\t * @see feathers.core.ITextRenderer\n\t\t * @see feathers.core.FeathersControl#defaultTextRendererFactory\n\t\t */\n\t\tpublic function get promptFactory():Function\n\t\t{\n\t\t\treturn this._promptFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set promptFactory(value:Function):void\n\t\t{\n\t\t\tif(this._promptFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._promptFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_PROMPT_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customPromptStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customPromptStyleName():String\n\t\t{\n\t\t\treturn this._customPromptStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customPromptStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customPromptStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customPromptStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t}\n\t\t\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _errorCalloutFactory:Function;\n\t\t\n\t\t/**\n\t\t * A function used to instantiate the error text callout. If null,\n\t\t * <code>new TextCallout()</code> is used instead.\n\t\t * The error text callout must be an instance of\n\t\t * <code>TextCallout</code>. This factory can be used to change\n\t\t * properties on the callout when it is first created. For instance, if\n\t\t * you are skinning Feathers components without a theme, you might use\n\t\t * this factory to set styles on the callout.\n\t\t *\n\t\t * <p>The factory should have the following function signature:</p>\n\t\t * <pre>function():TextCallout</pre>\n\t\t *\n\t\t * <p>In the following example, a custom error callout factory is passed\n\t\t * to the text area:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textArea.errorCalloutFactory = function():TextCallout\n\t\t * {\n\t\t *     return new TextCallout();\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #errorString\n\t\t * @see feathers.controls.TextCallout\n\t\t */\n\t\tpublic function get errorCalloutFactory():Function\n\t\t{\n\t\t\treturn this._errorCalloutFactory;\n\t\t}\n\t\t\n\t\tpublic function set errorCalloutFactory(value:Function):void\n\t\t{\n\t\t\tif(this._errorCalloutFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._errorCalloutFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ERROR_CALLOUT_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customErrorCalloutStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customErrorCalloutStyleName():String\n\t\t{\n\t\t\treturn this._customErrorCalloutStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customErrorCalloutStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customErrorCalloutStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customErrorCalloutStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ERROR_CALLOUT_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get innerPadding():Number\n\t\t{\n\t\t\treturn this._innerPaddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set innerPadding(value:Number):void\n\t\t{\n\t\t\tthis.innerPaddingTop = value;\n\t\t\tthis.innerPaddingRight = value;\n\t\t\tthis.innerPaddingBottom = value;\n\t\t\tthis.innerPaddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _innerPaddingTop:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get innerPaddingTop():Number\n\t\t{\n\t\t\treturn this._innerPaddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set innerPaddingTop(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._innerPaddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._innerPaddingTop = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _innerPaddingRight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get innerPaddingRight():Number\n\t\t{\n\t\t\treturn this._innerPaddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set innerPaddingRight(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._innerPaddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._innerPaddingRight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _innerPaddingBottom:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\t[Deprecated(since=\"4.2.0\",replacement=\"innerPaddingBottom\")]\n\t\tpublic function get paddinnerPaddingBottomingBottom():Number\n\t\t{\n\t\t\treturn this._innerPaddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get innerPaddingBottom():Number\n\t\t{\n\t\t\treturn this._innerPaddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set innerPaddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._innerPaddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._innerPaddingBottom = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _innerPaddingLeft:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get innerPaddingLeft():Number\n\t\t{\n\t\t\treturn this._innerPaddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set innerPaddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._innerPaddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._innerPaddingLeft = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.core.ITextEditor#selectionBeginIndex\n\t\t */\n\t\tpublic function get selectionBeginIndex():int\n\t\t{\n\t\t\tif(this._pendingSelectionBeginIndex >= 0)\n\t\t\t{\n\t\t\t\treturn this._pendingSelectionBeginIndex;\n\t\t\t}\n\t\t\tif(this.textEditorViewPort)\n\t\t\t{\n\t\t\t\treturn this.textEditorViewPort.selectionBeginIndex;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.core.ITextEditor#selectionEndIndex\n\t\t */\n\t\tpublic function get selectionEndIndex():int\n\t\t{\n\t\t\tif(this._pendingSelectionEndIndex >= 0)\n\t\t\t{\n\t\t\t\treturn this._pendingSelectionEndIndex;\n\t\t\t}\n\t\t\tif(this.textEditorViewPort)\n\t\t\t{\n\t\t\t\treturn this.textEditorViewPort.selectionEndIndex;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * Focuses the text area control so that it may be edited.\n\t\t */\n\t\tpublic function setFocus():void\n\t\t{\n\t\t\tif(this._textEditorHasFocus)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this.textEditorViewPort)\n\t\t\t{\n\t\t\t\tthis._isWaitingToSetFocus = false;\n\t\t\t\tthis.textEditorViewPort.setFocus();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._isWaitingToSetFocus = true;\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Manually removes focus from the text area control.\n\t\t */\n\t\tpublic function clearFocus():void\n\t\t{\n\t\t\tthis._isWaitingToSetFocus = false;\n\t\t\tif(!this.textEditorViewPort || !this._textEditorHasFocus)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.textEditorViewPort.clearFocus();\n\t\t}\n\n\t\t/**\n\t\t * Sets the range of selected characters. If both values are the same,\n\t\t * or the end index is <code>-1</code>, the text insertion position is\n\t\t * changed and nothing is selected.\n\t\t */\n\t\tpublic function selectRange(beginIndex:int, endIndex:int = -1):void\n\t\t{\n\t\t\tif(endIndex < 0)\n\t\t\t{\n\t\t\t\tendIndex = beginIndex;\n\t\t\t}\n\t\t\tif(beginIndex < 0)\n\t\t\t{\n\t\t\t\tthrow new RangeError(\"Expected begin index greater than or equal to 0. Received \" + beginIndex + \".\");\n\t\t\t}\n\t\t\tif(endIndex > this._text.length)\n\t\t\t{\n\t\t\t\tthrow new RangeError(\"Expected begin index less than \" + this._text.length + \". Received \" + endIndex + \".\");\n\t\t\t}\n\n\t\t\t//if it's invalid, we need to wait until validation before changing\n\t\t\t//the selection\n\t\t\tif(this.textEditorViewPort !== null && (this._isValidating || !this.isInvalid()))\n\t\t\t{\n\t\t\t\tthis._pendingSelectionBeginIndex = -1;\n\t\t\t\tthis._pendingSelectionEndIndex = -1;\n\t\t\t\tthis.textEditorViewPort.selectRange(beginIndex, endIndex);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._pendingSelectionBeginIndex = beginIndex;\n\t\t\t\tthis._pendingSelectionEndIndex = endIndex;\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//we don't dispose it if the text area is the parent because it'll\n\t\t\t//already get disposed in super.dispose()\n\t\t\tfor(var state:String in this._stateToSkin)\n\t\t\t{\n\t\t\t\tvar skin:DisplayObject = this._stateToSkin[state] as DisplayObject;\n\t\t\t\tif(skin !== null && skin.parent !== this)\n\t\t\t\t{\n\t\t\t\t\tskin.dispose();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._fontStylesSet !== null)\n\t\t\t{\n\t\t\t\tthis._fontStylesSet.dispose();\n\t\t\t\tthis._fontStylesSet = null;\n\t\t\t}\n\t\t\tif(this._promptFontStylesSet !== null)\n\t\t\t{\n\t\t\t\tthis._promptFontStylesSet.dispose();\n\t\t\t\tthis._promptFontStylesSet = null;\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * Gets the font styles to be used to display the text area's text when\n\t\t * the text area's <code>currentState</code> property matches the\n\t\t * specified state value.\n\t\t *\n\t\t * <p>If font styles are not defined for a specific state, returns\n\t\t * <code>null</code>.</p>\n\t\t *\n\t\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t\t * @see #setFontStylesForState()\n\t\t * @see #style:fontStyles\n\t\t */\n\t\tpublic function getFontStylesForState(state:String):TextFormat\n\t\t{\n\t\t\tif(this._fontStylesSet === null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn this._fontStylesSet.getFormatForState(state);\n\t\t}\n\n\t\t/**\n\t\t * Sets the font styles to be used to display the text area's text when\n\t\t * the text area's <code>currentState</code> property matches the\n\t\t * specified state value.\n\t\t *\n\t\t * <p>If font styles are not defined for a specific state, the value of\n\t\t * the <code>fontStyles</code> property will be used instead.</p>\n\t\t *\n\t\t * <p>Note: if the text editor has been customized with advanced font\n\t\t * formatting, it may override the values specified with\n\t\t * <code>setFontStylesForState()</code> and properties like\n\t\t * <code>fontStyles</code> and <code>disabledFontStyles</code>.</p>\n\t\t *\n\t\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t\t * @see #style:fontStyles\n\t\t */\n\t\tpublic function setFontStylesForState(state:String, format:TextFormat):void\n\t\t{\n\t\t\tvar key:String = \"setFontStylesForState--\" + state;\n\t\t\tif(this.processStyleRestriction(key))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(key);\n\t\t\t}\n\t\t\tvar oldFormat:TextFormat = this._fontStylesSet.getFormatForState(state);\n\t\t\tif(oldFormat !== null)\n\t\t\t{\n\t\t\t\toldFormat.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._fontStylesSet.setFormatForState(state, format);\n\t\t\tif(format !== null)\n\t\t\t{\n\t\t\t\tformat.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Gets the font styles to be used to display the text area's prompt\n\t\t * when the text area's <code>currentState</code> property matches the\n\t\t * specified state value.\n\t\t *\n\t\t * <p>If prompt font styles are not defined for a specific state, returns\n\t\t * <code>null</code>.</p>\n\t\t *\n\t\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t\t * @see #setPromptFontStylesForState()\n\t\t * @see #promptFontStyles\n\t\t */\n\t\tpublic function getPromptFontStylesForState(state:String):TextFormat\n\t\t{\n\t\t\tif(this._promptFontStylesSet === null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn this._promptFontStylesSet.getFormatForState(state);\n\t\t}\n\n\t\t/**\n\t\t * Sets the font styles to be used to display the text area's prompt\n\t\t * when the text area's <code>currentState</code> property matches the\n\t\t * specified state value.\n\t\t *\n\t\t * <p>If prompt font styles are not defined for a specific state, the\n\t\t * value of the <code>promptFontStyles</code> property will be used instead.</p>\n\t\t *\n\t\t * <p>Note: if the text renderer has been customized with advanced font\n\t\t * formatting, it may override the values specified with\n\t\t * <code>setPromptFontStylesForState()</code> and properties like\n\t\t * <code>promptFontStyles</code> and <code>promptDisabledFontStyles</code>.</p>\n\t\t *\n\t\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t\t * @see #promptFontStyles\n\t\t */\n\t\tpublic function setPromptFontStylesForState(state:String, format:TextFormat):void\n\t\t{\n\t\t\tvar key:String = \"setPromptFontStylesForState--\" + state;\n\t\t\tif(this.processStyleRestriction(key))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(key);\n\t\t\t}\n\t\t\tvar oldFormat:TextFormat = this._promptFontStylesSet.getFormatForState(state);\n\t\t\tif(oldFormat !== null)\n\t\t\t{\n\t\t\t\toldFormat.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._promptFontStylesSet.setFormatForState(state, format);\n\t\t\tif(format !== null)\n\t\t\t{\n\t\t\t\tformat.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Gets the skin to be used by the text area when its\n\t\t * <code>currentState</code> property matches the specified state value.\n\t\t *\n\t\t * <p>If a skin is not defined for a specific state, returns\n\t\t * <code>null</code>.</p>\n\t\t *\n\t\t * @see #setSkinForState()\n\t\t * @see feathers.controls.TextInputState\n\t\t */\n\t\tpublic function getSkinForState(state:String):DisplayObject\n\t\t{\n\t\t\treturn this._stateToSkin[state] as DisplayObject;\n\t\t}\n\n\t\t/**\n\t\t * Sets the skin to be used by the text area when its\n\t\t * <code>currentState</code> property matches the specified state value.\n\t\t *\n\t\t * <p>If a skin is not defined for a specific state, the value of the\n\t\t * <code>backgroundSkin</code> property will be used instead.</p>\n\t\t *\n\t\t * @see #backgroundSkin\n\t\t * @see #getSkinForState()\n\t\t * @see feathers.controls.TextInputState\n\t\t */\n\t\tpublic function setSkinForState(state:String, skin:DisplayObject):void\n\t\t{\n\t\t\tvar key:String = \"setSkinForState--\" + state;\n\t\t\tif(this.processStyleRestriction(key))\n\t\t\t{\n\t\t\t\tif(skin !== null)\n\t\t\t\t{\n\t\t\t\t\tskin.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(skin !== null)\n\t\t\t{\n\t\t\t\tthis._stateToSkin[state] = skin;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdelete this._stateToSkin[state];\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar textEditorInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_TEXT_EDITOR);\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar promptFactoryInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_PROMPT_FACTORY);\n\n\t\t\tif(textEditorInvalid)\n\t\t\t{\n\t\t\t\tthis.createTextEditor();\n\t\t\t}\n\n\t\t\tif(promptFactoryInvalid || (this._prompt !== null && !this.promptTextRenderer))\n\t\t\t{\n\t\t\t\tthis.createPrompt();\n\t\t\t}\n\n\t\t\tif(textEditorInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshTextEditorProperties();\n\t\t\t}\n\n\t\t\tif(textEditorInvalid || dataInvalid)\n\t\t\t{\n\t\t\t\tvar oldIgnoreTextChanges:Boolean = this._ignoreTextChanges;\n\t\t\t\tthis._ignoreTextChanges = true;\n\t\t\t\tthis.textEditorViewPort.text = this._text;\n\t\t\t\tthis._ignoreTextChanges = oldIgnoreTextChanges;\n\t\t\t}\n\n\t\t\tif(promptFactoryInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshPromptProperties();\n\t\t\t}\n\n\t\t\tif(this.promptTextRenderer)\n\t\t\t{\n\t\t\t\tif(promptFactoryInvalid || dataInvalid || stylesInvalid)\n\t\t\t\t{\n\t\t\t\t\tthis.promptTextRenderer.visible = this._prompt && this._text.length == 0;\n\t\t\t\t}\n\n\t\t\t\tif(promptFactoryInvalid || stateInvalid)\n\t\t\t\t{\n\t\t\t\t\tthis.promptTextRenderer.isEnabled = this._isEnabled;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(textEditorInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.textEditorViewPort.isEnabled = this._isEnabled;\n\t\t\t\tif(!this._isEnabled && Mouse.supportsNativeCursor && this._oldMouseCursor)\n\t\t\t\t{\n\t\t\t\t\tMouse.cursor = this._oldMouseCursor;\n\t\t\t\t\tthis._oldMouseCursor = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tsuper.draw();\n\n\t\t\t//the state might not change if the text input has focus when\n\t\t\t//the error string changes, so check for styles too!\n\t\t\tif(stateInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshErrorCallout();\n\t\t\t}\n\n\t\t\tthis.doPendingActions();\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>textEditorViewPort</code> sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #textEditorViewPort\n\t\t * @see #textEditorFactory\n\t\t */\n\t\tprotected function createTextEditor():void\n\t\t{\n\t\t\tif(this.textEditorViewPort)\n\t\t\t{\n\t\t\t\tthis.textEditorViewPort.removeEventListener(Event.CHANGE, textEditor_changeHandler);\n\t\t\t\tthis.textEditorViewPort.removeEventListener(FeathersEventType.FOCUS_IN, textEditor_focusInHandler);\n\t\t\t\tthis.textEditorViewPort.removeEventListener(FeathersEventType.FOCUS_OUT, textEditor_focusOutHandler);\n\t\t\t\tthis.textEditorViewPort = null;\n\t\t\t}\n\n\t\t\tif(this._textEditorFactory != null)\n\t\t\t{\n\t\t\t\tthis.textEditorViewPort = ITextEditorViewPort(this._textEditorFactory());\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.textEditorViewPort = new TextFieldTextEditorViewPort();\n\t\t\t}\n\t\t\tvar textEditorStyleName:String = this._customTextEditorStyleName != null ? this._customTextEditorStyleName : this.textEditorStyleName;\n\t\t\tthis.textEditorViewPort.styleNameList.add(textEditorStyleName);\n\t\t\tif(this.textEditorViewPort is IStateObserver)\n\t\t\t{\n\t\t\t\tIStateObserver(this.textEditorViewPort).stateContext = this;\n\t\t\t}\n\t\t\tthis.textEditorViewPort.addEventListener(Event.CHANGE, textEditor_changeHandler);\n\t\t\tthis.textEditorViewPort.addEventListener(FeathersEventType.FOCUS_IN, textEditor_focusInHandler);\n\t\t\tthis.textEditorViewPort.addEventListener(FeathersEventType.FOCUS_OUT, textEditor_focusOutHandler);\n\n\t\t\tvar oldViewPort:ITextEditorViewPort = ITextEditorViewPort(this._viewPort);\n\t\t\tthis.viewPort = this.textEditorViewPort;\n\t\t\tif(oldViewPort)\n\t\t\t{\n\t\t\t\t//the view port setter won't do this\n\t\t\t\toldViewPort.dispose();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createPrompt():void\n\t\t{\n\t\t\tif(this.promptTextRenderer)\n\t\t\t{\n\t\t\t\tthis.removeChild(DisplayObject(this.promptTextRenderer), true);\n\t\t\t\tthis.promptTextRenderer = null;\n\t\t\t}\n\n\t\t\tif(this._prompt === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar factory:Function = this._promptFactory != null ? this._promptFactory : FeathersControl.defaultTextRendererFactory;\n\t\t\tthis.promptTextRenderer = ITextRenderer(factory());\n\t\t\tvar promptStyleName:String = this._customPromptStyleName != null ? this._customPromptStyleName : this.promptStyleName;\n\t\t\tthis.promptTextRenderer.styleNameList.add(promptStyleName);\n\t\t\tthis.addChild(DisplayObject(this.promptTextRenderer));\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createErrorCallout():void\n\t\t{\n\t\t\tif(this.callout !== null)\n\t\t\t{\n\t\t\t\tthis.callout.removeFromParent(true);\n\t\t\t\tthis.callout = null;\n\t\t\t}\n\n\t\t\tif(this._errorString === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n \t\t\tvar factory:Function = this._errorCalloutFactory != null ? this._errorCalloutFactory : defaultErrorCalloutFactory;\n \t\t\tthis.callout = TextCallout(factory());\n\t\t\tvar errorCalloutStyleName:String = this._customErrorCalloutStyleName != null ? this._customErrorCalloutStyleName : this.errorCalloutStyleName;\n\t\t\tthis.callout.styleNameList.add(errorCalloutStyleName);\n\t\t\tthis.callout.closeOnKeys = null;\n\t\t\tthis.callout.closeOnTouchBeganOutside = false;\n\t\t\tthis.callout.closeOnTouchEndedOutside = false;\n\t\t\tthis.callout.touchable = false;\n\t\t\tthis.callout.origin = this;\n\t\t\tPopUpManager.addPopUp(this.callout, false, false);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function changeState(state:String):void\n\t\t{\n\t\t\tif(this._currentState === state)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._currentState = state;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STATE);\n\t\t\tthis.dispatchEventWith(FeathersEventType.STATE_CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function doPendingActions():void\n\t\t{\n\t\t\tif(this._isWaitingToSetFocus || (this._focusManager && this._focusManager.focus == this))\n\t\t\t{\n\t\t\t\tthis._isWaitingToSetFocus = false;\n\t\t\t\tif(!this._textEditorHasFocus)\n\t\t\t\t{\n\t\t\t\t\tthis.textEditorViewPort.setFocus();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._pendingSelectionBeginIndex >= 0)\n\t\t\t{\n\t\t\t\tvar beginIndex:int = this._pendingSelectionBeginIndex;\n\t\t\t\tvar endIndex:int = this._pendingSelectionEndIndex;\n\t\t\t\tthis._pendingSelectionBeginIndex = -1;\n\t\t\t\tthis._pendingSelectionEndIndex = -1;\n\t\t\t\tthis.selectRange(beginIndex, endIndex);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshTextEditorProperties():void\n\t\t{\n\t\t\tthis.textEditorViewPort.fontStyles = this._fontStylesSet;\n\t\t\tthis.textEditorViewPort.maxChars = this._maxChars;\n\t\t\tthis.textEditorViewPort.restrict = this._restrict;\n\t\t\tthis.textEditorViewPort.isEditable = this._isEditable;\n\t\t\tthis.textEditorViewPort.paddingTop = this._innerPaddingTop;\n\t\t\tthis.textEditorViewPort.paddingRight = this._innerPaddingRight;\n\t\t\tthis.textEditorViewPort.paddingBottom = this._innerPaddingBottom;\n\t\t\tthis.textEditorViewPort.paddingLeft = this._innerPaddingLeft;\n\t\t\tfor(var propertyName:String in this._textEditorProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._textEditorProperties[propertyName];\n\t\t\t\tthis.textEditorViewPort[propertyName] = propertyValue;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshPromptProperties():void\n\t\t{\n\t\t\tif(!this.promptTextRenderer)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.promptTextRenderer.text = this._prompt;\n\t\t\tthis.promptTextRenderer.fontStyles = this._promptFontStylesSet;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function refreshBackgroundSkin():void\n\t\t{\n\t\t\tvar oldSkin:DisplayObject = this.currentBackgroundSkin;\n\t\t\tthis.currentBackgroundSkin = this.getCurrentBackgroundSkin();\n\t\t\tif(oldSkin !== this.currentBackgroundSkin)\n\t\t\t{\n\t\t\t\tif(oldSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(oldSkin is IStateObserver)\n\t\t\t\t\t{\n\t\t\t\t\t\tIStateObserver(oldSkin).stateContext = null;\n\t\t\t\t\t}\n\t\t\t\t\tthis.removeChild(oldSkin, false);\n\t\t\t\t}\n\t\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(this.currentBackgroundSkin is IStateObserver)\n\t\t\t\t\t{\n\t\t\t\t\t\tIStateObserver(this.currentBackgroundSkin).stateContext = this;\n\t\t\t\t\t}\n\t\t\t\t\tthis.addChildAt(this.currentBackgroundSkin, 0);\n\t\t\t\t\tif(this.currentBackgroundSkin is IFeathersControl)\n\t\t\t\t\t{\n\t\t\t\t\t\tIFeathersControl(this.currentBackgroundSkin).initializeNow();\n\t\t\t\t\t}\n\t\t\t\t\tif(this.currentBackgroundSkin is IMeasureDisplayObject)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar measureSkin:IMeasureDisplayObject = IMeasureDisplayObject(this.currentBackgroundSkin);\n\t\t\t\t\t\tthis._explicitBackgroundWidth = measureSkin.explicitWidth;\n\t\t\t\t\t\tthis._explicitBackgroundHeight = measureSkin.explicitHeight;\n\t\t\t\t\t\tthis._explicitBackgroundMinWidth = measureSkin.explicitMinWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMinHeight = measureSkin.explicitMinHeight;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._explicitBackgroundWidth = this.currentBackgroundSkin.width;\n\t\t\t\t\t\tthis._explicitBackgroundHeight = this.currentBackgroundSkin.height;\n\t\t\t\t\t\tthis._explicitBackgroundMinWidth = this._explicitBackgroundWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMinHeight = this._explicitBackgroundHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function getCurrentBackgroundSkin():DisplayObject\n\t\t{\n\t\t\tvar result:DisplayObject = this._stateToSkin[this._currentState] as DisplayObject;\n\t\t\tif(result !== null)\n\t\t\t{\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\treturn this._backgroundSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshState():void\n\t\t{\n\t\t\tif(this._isEnabled)\n\t\t\t{\n\t\t\t\tif(this._textEditorHasFocus)\n\t\t\t\t{\n\t\t\t\t\tthis.changeState(TextInputState.FOCUSED);\n\t\t\t\t}\n\t\t\t\telse if(this._errorString !== null)\n\t\t\t\t{\n\t\t\t\t\tthis.changeState(TextInputState.ERROR);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.changeState(TextInputState.ENABLED);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.changeState(TextInputState.DISABLED);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshErrorCallout():void\n\t\t{\n\t\t\tif(this._textEditorHasFocus && this.callout === null &&\n\t\t\t\tthis._errorString !== null && this._errorString.length > 0)\n\t\t\t{\n\t\t\t\tthis.createErrorCallout();\n\t\t\t}\n\t\t\telse if(this.callout !== null &&\n\t\t\t\t(!this._textEditorHasFocus || this._errorString === null || this._errorString.length == 0))\n\t\t\t{\n\t\t\t\tthis.callout.removeFromParent(true);\n\t\t\t\tthis.callout = null;\n\t\t\t}\n\t\t\tif(this.callout !== null)\n\t\t\t{\n\t\t\t\tthis.callout.text = this._errorString;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function layoutChildren():void\n\t\t{\n\t\t\tsuper.layoutChildren();\n\n\t\t\tif(this.promptTextRenderer !== null)\n\t\t\t{\n\t\t\t\tthis.promptTextRenderer.x = this._leftViewPortOffset + this._innerPaddingLeft;\n\t\t\t\tthis.promptTextRenderer.y = this._topViewPortOffset + this._innerPaddingTop;\n\t\t\t\tthis.promptTextRenderer.width = this.actualWidth - this._leftViewPortOffset - this._rightViewPortOffset - this._innerPaddingLeft - this._innerPaddingRight;\n\t\t\t\tthis.promptTextRenderer.height = this.actualHeight - this._topViewPortOffset - this._bottomViewPortOffset - this._innerPaddingTop - this._innerPaddingBottom;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function setFocusOnTextEditorWithTouch(touch:Touch):void\n\t\t{\n\t\t\tif(!this.isFocusEnabled)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar point:Point = Pool.getPoint();\n\t\t\ttouch.getLocation(this.stage, point);\n\t\t\tvar isInBounds:Boolean = this.contains(this.stage.hitTest(point));\n\t\t\tif(!this._textEditorHasFocus && isInBounds)\n\t\t\t{\n\t\t\t\tthis.globalToLocal(point, point);\n\t\t\t\tpoint.x -= this._paddingLeft;\n\t\t\t\tpoint.y -= this._paddingTop;\n\t\t\t\t//we account for the scroll position in the text editor view\n\t\t\t\t//port, so don't do it here!\n\t\t\t\tthis._isWaitingToSetFocus = false;\n\t\t\t\tthis.textEditorViewPort.setFocus(point);\n\t\t\t}\n\t\t\tPool.putPoint(point);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textArea_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\tthis._textAreaTouchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar horizontalScrollBar:DisplayObject = DisplayObject(this.horizontalScrollBar);\n\t\t\tvar verticalScrollBar:DisplayObject = DisplayObject(this.verticalScrollBar);\n\t\t\tif(this._textAreaTouchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(this, TouchPhase.ENDED, this._textAreaTouchPointID);\n\t\t\t\tif(!touch || touch.isTouching(verticalScrollBar) || touch.isTouching(horizontalScrollBar))\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.removeEventListener(Event.SCROLL, textArea_scrollHandler);\n\t\t\t\tthis._textAreaTouchPointID = -1;\n\t\t\t\tif(this.textEditorViewPort.setTouchFocusOnEndedPhase)\n\t\t\t\t{\n\t\t\t\t\tthis.setFocusOnTextEditorWithTouch(touch);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(this, TouchPhase.BEGAN);\n\t\t\t\tif(touch)\n\t\t\t\t{\n\t\t\t\t\tif(touch.isTouching(verticalScrollBar) || touch.isTouching(horizontalScrollBar))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tthis._textAreaTouchPointID = touch.id;\n\t\t\t\t\tif(!this.textEditorViewPort.setTouchFocusOnEndedPhase)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.setFocusOnTextEditorWithTouch(touch);\n\t\t\t\t\t}\n\t\t\t\t\tthis.addEventListener(Event.SCROLL, textArea_scrollHandler);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttouch = event.getTouch(this, TouchPhase.HOVER);\n\t\t\t\tif(touch)\n\t\t\t\t{\n\t\t\t\t\tif(touch.isTouching(verticalScrollBar) || touch.isTouching(horizontalScrollBar))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif(Mouse.supportsNativeCursor && !this._oldMouseCursor)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._oldMouseCursor = Mouse.cursor;\n\t\t\t\t\t\tMouse.cursor = MouseCursor.IBEAM;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t//end hover\n\t\t\t\tif(Mouse.supportsNativeCursor && this._oldMouseCursor)\n\t\t\t\t{\n\t\t\t\t\tMouse.cursor = this._oldMouseCursor;\n\t\t\t\t\tthis._oldMouseCursor = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textArea_scrollHandler(event:Event):void\n\t\t{\n\t\t\tthis.removeEventListener(Event.SCROLL, textArea_scrollHandler);\n\t\t\tthis._textAreaTouchPointID = -1;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textArea_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tif(!this._focusManager && this._textEditorHasFocus)\n\t\t\t{\n\t\t\t\tthis.clearFocus();\n\t\t\t}\n\t\t\tthis._isWaitingToSetFocus = false;\n\t\t\tthis._textEditorHasFocus = false;\n\t\t\tthis._textAreaTouchPointID = -1;\n\t\t\tthis.removeEventListener(Event.SCROLL, textArea_scrollHandler);\n\t\t\tif(Mouse.supportsNativeCursor && this._oldMouseCursor)\n\t\t\t{\n\t\t\t\tMouse.cursor = this._oldMouseCursor;\n\t\t\t\tthis._oldMouseCursor = null;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function focusInHandler(event:Event):void\n\t\t{\n\t\t\tif(!this._focusManager)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsuper.focusInHandler(event);\n\t\t\tthis.setFocus();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function focusOutHandler(event:Event):void\n\t\t{\n\t\t\tif(!this._focusManager)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsuper.focusOutHandler(event);\n\t\t\tthis.textEditorViewPort.clearFocus();\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STATE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function nativeStage_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(this._isEditable)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsuper.nativeStage_keyDownHandler(event);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textEditor_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreTextChanges)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.text = this.textEditorViewPort.text;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textEditor_focusInHandler(event:Event):void\n\t\t{\n\t\t\tthis._textEditorHasFocus = true;\n\t\t\tthis.refreshState();\n\t\t\tthis.refreshErrorCallout();\n\t\t\tthis._touchPointID = -1;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STATE);\n\t\t\tif(this._focusManager && this.isFocusEnabled && this._focusManager.focus !== this)\n\t\t\t{\n\t\t\t\t//if setFocus() was called manually, we need to notify the focus\n\t\t\t\t//manager (unless isFocusEnabled is false).\n\t\t\t\t//if the focus manager already knows that we have focus, it will\n\t\t\t\t//simply return without doing anything.\n\t\t\t\tthis._focusManager.focus = this;\n\t\t\t}\n\t\t\telse if(!this._focusManager)\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.FOCUS_IN);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textEditor_focusOutHandler(event:Event):void\n\t\t{\n\t\t\tthis._textEditorHasFocus = false;\n\t\t\tthis.refreshState();\n\t\t\tthis.refreshErrorCallout();\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STATE);\n\t\t\tif(this._focusManager && this._focusManager.focus === this)\n\t\t\t{\n\t\t\t\t//if clearFocus() was called manually, we need to notify the\n\t\t\t\t//focus manager if it still thinks we have focus.\n\t\t\t\tthis._focusManager.focus = null;\n\t\t\t}\n\t\t\telse if(!this._focusManager)\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.FOCUS_OUT);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function fontStyles_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/TextCallout.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.core.FeathersControl;\n\timport feathers.core.ITextRenderer;\n\timport feathers.core.IToolTip;\n\timport feathers.core.PopUpManager;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.text.FontStylesSet;\n\n\timport flash.ui.Keyboard;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.EnterFrameEvent;\n\timport starling.events.Event;\n\timport starling.text.TextFormat;\n\n\t[Exclude(name=\"content\",kind=\"property\")]\n\n\t/**\n\t * A style name to add to the callout's text renderer sub-component.\n\t * Typically used by a theme to provide different styles to different\n\t * callouts.\n\t *\n\t * <p>In the following example, a custom text renderer style name is\n\t * passed to the callout:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.customTextRendererStyleName = \"my-custom-text-callout-text-renderer\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( BitmapFontTextRenderer ).setFunctionForStyleName( \"my-custom-text-callout-text-renderer\", setCustomTextCalloutTextRendererStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_TEXT_RENDERER\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #textRendererFactory\n\t */\n\t[Style(name=\"customTextRendererStyleName\",type=\"String\")]\n\n\t/**\n\t * The font styles used to display the callout's text when the callout is\n\t * disabled.\n\t *\n\t * <p>In the following example, the disabled font styles are customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * callout.disabledFontStyles = new TextFormat( \"Helvetica\", 20, 0x999999 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>textRendererFactory</code> to set more advanced styles on the\n\t * text renderer.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:fontStyles\n\t */\n\t[Style(name=\"disabledFontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The font styles used to display the callout's text.\n\t *\n\t * <p>In the following example, the font styles are customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * callout.fontStyles = new TextFormat( \"Helvetica\", 20, 0xcc0000 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>textRendererFactory</code> to set more advanced styles.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:disabledFontStyles\n\t */\n\t[Style(name=\"fontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * Determines if the text wraps to the next line when it reaches the\n\t * width (or max width) of the component.\n\t *\n\t * <p>In the following example, the text is not wrapped:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * label.wordWrap = false;</listing>\n\t *\n\t * @default true\n\t */\n\t[Style(name=\"wordWrap\",type=\"Boolean\")]\n\n\t/**\n\t * Dispatched when the callout is closed.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CLOSE\n\t */\n\t[Event(name=\"close\",type=\"starling.events.Event\")]\n\n\t/**\n\t * A special <code>Callout</code> designed to display text.\n\t *\n\t * <p>In the following example, a text callout is shown when a\n\t * <code>Button</code> is triggered:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.addEventListener( Event.TRIGGERED, button_triggeredHandler );\n\t * \n\t * function button_triggeredHandler( event:Event ):void\n\t * {\n\t *     var button:Button = Button( event.currentTarget );\n\t *     Callout.show( \"Hello World\", button );\n\t * }</listing>\n\t *\n\t * @see ../../../help/text-callout.html How to use the Feathers Callout component\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class TextCallout extends Callout implements IToolTip\n\t{\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the text\n\t\t * renderer sub-component.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t * @see ../../../help/text-renderers.html Introduction to Feathers text renderers\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_TEXT_RENDERER:String = \"feathers-text-callout-text-renderer\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>Label</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Returns a new <code>TextCallout</code> instance when\n\t\t * <code>TextCallout.show()</code> is called. If one wishes to skin the\n\t\t * callout manually or change its behavior, a custom factory may be\n\t\t * provided.\n\t\t *\n\t\t * <p>This function is expected to have the following signature:</p>\n\t\t *\n\t\t * <pre>function():TextCallout</pre>\n\t\t *\n\t\t * <p>The following example shows how to create a custom text callout factory:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * TextCallout.calloutFactory = function():TextCallout\n\t\t * {\n\t\t *     var callout:TextCallout = new TextCallout();\n\t\t *     //set properties here!\n\t\t *     return callout;\n\t\t * };</listing>\n\t\t *\n\t\t * <p>Note: the default callout factory sets the following properties:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * callout.closeOnTouchBeganOutside = true;\n\t\t * callout.closeOnTouchEndedOutside = true;\n\t\t * callout.closeOnKeys = new &lt;uint&gt;[Keyboard.BACK, Keyboard.ESCAPE];</listing>\n\t\t *\n\t\t * @see #show()\n\t\t */\n\t\tpublic static var calloutFactory:Function = defaultCalloutFactory;\n\n\t\t/**\n\t\t * The default factory that creates callouts when\n\t\t * <code>TextCallout.show()</code> is called. To use a different\n\t\t * factory, you need to set <code>TextCallout.calloutFactory</code> to a\n\t\t * <code>Function</code> instance.\n\t\t */\n\t\tpublic static function defaultCalloutFactory():TextCallout\n\t\t{\n\t\t\tvar callout:TextCallout = new TextCallout();\n\t\t\tcallout.closeOnTouchBeganOutside = true;\n\t\t\tcallout.closeOnTouchEndedOutside = true;\n\t\t\tcallout.closeOnKeys = new <uint>[Keyboard.BACK, Keyboard.ESCAPE];\n\t\t\treturn callout;\n\t\t}\n\n\t\t/**\n\t\t * Creates a callout that displays some text, and then positions and\n\t\t * sizes it automatically based on an origin rectangle and the specified\n\t\t * positions, relative to the origin.\n\t\t *\n\t\t * <p>In the following example, a text callout is shown when a\n\t\t * <code>Button</code> is triggered:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * button.addEventListener( Event.TRIGGERED, button_triggeredHandler );\n\t\t * \n\t\t * function button_triggeredHandler( event:Event ):void\n\t\t * {\n\t\t *     var button:Button = Button( event.currentTarget );\n\t\t *     TextCallout.show( \"Hello World\", button );\n\t\t * }</listing>\n\t\t */\n\t\tpublic static function show(text:String, origin:DisplayObject, supportedPositions:Vector.<String> = null,\n\t\t\tisModal:Boolean = true, customCalloutFactory:Function = null, customOverlayFactory:Function = null):TextCallout\n\t\t{\n\t\t\tif(!origin.stage)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"TextCallout origin must be added to the stage.\");\n\t\t\t}\n\t\t\tvar factory:Function = customCalloutFactory;\n\t\t\tif(factory === null)\n\t\t\t{\n\t\t\t\tfactory = calloutFactory;\n\t\t\t\tif(factory === null)\n\t\t\t\t{\n\t\t\t\t\tfactory = defaultCalloutFactory;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar callout:TextCallout = TextCallout(factory());\n\t\t\tcallout.text = text;\n\t\t\tcallout.supportedPositions = supportedPositions;\n\t\t\tcallout.origin = origin;\n\t\t\tfactory = customOverlayFactory;\n\t\t\tif(factory == null)\n\t\t\t{\n\t\t\t\tfactory = calloutOverlayFactory;\n\t\t\t\tif(factory == null)\n\t\t\t\t{\n\t\t\t\t\tfactory = PopUpManager.defaultOverlayFactory;\n\t\t\t\t}\n\t\t\t}\n\t\t\tPopUpManager.addPopUp(callout, isModal, false, factory);\n\t\t\tcallout.validate();\n\t\t\treturn callout;\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function TextCallout()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.isQuickHitAreaEnabled = true;\n\t\t\tif(this._fontStylesSet === null)\n\t\t\t{\n\t\t\t\tthis._fontStylesSet = new FontStylesSet();\n\t\t\t\tthis._fontStylesSet.addEventListener(Event.CHANGE, fontStyles_changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * The text renderer.\n\t\t *\n\t\t * @see #createTextRenderer()\n\t\t * @see #textRendererFactory\n\t\t */\n\t\tprotected var textRenderer:ITextRenderer;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the text\n\t\t * renderer sub-component. This variable is <code>protected</code> so\n\t\t * that sub-classes can customize the label text renderer style name in\n\t\t * their constructors instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_TEXT_RENDERER</code>.\n\t\t *\n\t\t * <p>To customize the text renderer style name without subclassing, see\n\t\t * <code>customTextRendererStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customTextRendererStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var textRendererStyleName:String = DEFAULT_CHILD_STYLE_NAME_TEXT_RENDERER;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _text:String;\n\n\t\t/**\n\t\t * The text to display in the callout.\n\t\t */\n\t\tpublic function get text():String\n\t\t{\n\t\t\treturn this._text;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set text(value:String):void\n\t\t{\n\t\t\tif(this._text === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._text = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _wordWrap:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get wordWrap():Boolean\n\t\t{\n\t\t\treturn this._wordWrap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set wordWrap(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._wordWrap === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._wordWrap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fontStylesSet:FontStylesSet;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get fontStyles():TextFormat\n\t\t{\n\t\t\treturn this._fontStylesSet.format;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set fontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._fontStylesSet.format;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._fontStylesSet.format = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get disabledFontStyles():TextFormat\n\t\t{\n\t\t\treturn this._fontStylesSet.disabledFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disabledFontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._fontStylesSet.disabledFormat;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._fontStylesSet.disabledFormat = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textRendererFactory:Function;\n\n\t\t/**\n\t\t * A function used to instantiate the callout's text renderer\n\t\t * sub-component. By default, the callout will use the global text\n\t\t * renderer factory, <code>FeathersControl.defaultTextRendererFactory()</code>,\n\t\t * to create the text renderer. The text renderer must be an instance of\n\t\t * <code>ITextRenderer</code>. This factory can be used to change\n\t\t * properties on the text renderer when it is first created. For\n\t\t * instance, if you are skinning Feathers components without a theme,\n\t\t * you might use this factory to style the text renderer.\n\t\t *\n\t\t * <p>The factory should have the following function signature:</p>\n\t\t * <pre>function():ITextRenderer</pre>\n\t\t *\n\t\t * <p>In the following example, a custom text renderer factory is passed\n\t\t * to the callout:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * callout.textRendererFactory = function():ITextRenderer\n\t\t * {\n\t\t *     return new TextFieldTextRenderer();\n\t\t * }</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.ITextRenderer\n\t\t * @see feathers.core.FeathersControl#defaultTextRendererFactory\n\t\t */\n\t\tpublic function get textRendererFactory():Function\n\t\t{\n\t\t\treturn this._textRendererFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set textRendererFactory(value:Function):void\n\t\t{\n\t\t\tif(this._textRendererFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textRendererFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customTextRendererStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customTextRendererStyleName():String\n\t\t{\n\t\t\treturn this._customTextRendererStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customTextRendererStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customTextRendererStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customTextRendererStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\tif(TextCallout.globalStyleProvider !== null)\n\t\t\t{\n\t\t\t\treturn TextCallout.globalStyleProvider;\n\t\t\t}\n\t\t\treturn Callout.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this._fontStylesSet !== null)\n\t\t\t{\n\t\t\t\tthis._fontStylesSet.dispose();\n\t\t\t\tthis._fontStylesSet = null;\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar textRendererInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_TEXT_RENDERER);\n\n\t\t\tif(textRendererInvalid)\n\t\t\t{\n\t\t\t\tthis.createTextRenderer();\n\t\t\t}\n\n\t\t\tif(textRendererInvalid || dataInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshTextRendererData();\n\t\t\t}\n\n\t\t\tif(textRendererInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshTextRendererStyles();\n\t\t\t}\n\t\t\tsuper.draw();\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>textRenderer</code> sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #textRenderer\n\t\t * @see #textRendererFactory\n\t\t * @see #style:customTextRendererStyleName\n\t\t */\n\t\tprotected function createTextRenderer():void\n\t\t{\n\t\t\tif(this.textRenderer !== null)\n\t\t\t{\n\t\t\t\tthis.removeChild(DisplayObject(this.textRenderer), true);\n\t\t\t\tthis.textRenderer = null;\n\t\t\t}\n\n\t\t\tvar factory:Function = this._textRendererFactory != null ? this._textRendererFactory : FeathersControl.defaultTextRendererFactory;\n\t\t\tthis.textRenderer = ITextRenderer(factory());\n\t\t\tvar textRendererStyleName:String = this._customTextRendererStyleName !== null ? this._customTextRendererStyleName : this.textRendererStyleName;\n\t\t\tthis.textRenderer.styleNameList.add(textRendererStyleName);\n\t\t\tthis.content = DisplayObject(this.textRenderer);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshTextRendererData():void\n\t\t{\n\t\t\tthis.textRenderer.text = this._text;\n\t\t\tthis.textRenderer.visible = this._text && this._text.length > 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshTextRendererStyles():void\n\t\t{\n\t\t\tthis.textRenderer.wordWrap = this._wordWrap;\n\t\t\tthis.textRenderer.fontStyles = this._fontStylesSet;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function callout_enterFrameHandler(event:EnterFrameEvent):void\n\t\t{\n\t\t\t//wait for validation\n\t\t\tif(this.isCreated)\n\t\t\t{\n\t\t\t\tthis.positionRelativeToOrigin();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function fontStyles_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/TextInput.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IAdvancedNativeFocusOwner;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IFocusDisplayObject;\n\timport feathers.core.IMeasureDisplayObject;\n\timport feathers.core.IMultilineTextEditor;\n\timport feathers.core.INativeFocusOwner;\n\timport feathers.core.IStateContext;\n\timport feathers.core.IStateObserver;\n\timport feathers.core.ITextBaselineControl;\n\timport feathers.core.ITextEditor;\n\timport feathers.core.ITextRenderer;\n\timport feathers.core.IValidating;\n\timport feathers.core.PopUpManager;\n\timport feathers.core.PropertyProxy;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.RelativePosition;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.text.FontStylesSet;\n\timport feathers.utils.skins.resetFluidChildDimensionsForMeasurement;\n\n\timport flash.geom.Point;\n\timport flash.ui.Mouse;\n\timport flash.ui.MouseCursor;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.text.TextFormat;\n\timport starling.utils.Pool;\n\n\t/**\n\t * The skin used for the input's disabled state. If <code>null</code>,\n\t * then <code>backgroundSkin</code> is used instead.\n\t *\n\t * <p>The following example gives the input a skin for the disabled state:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * input.backgroundDisabledSkin = new Image( texture );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setSkinForState()</code> with\n\t * <code>TextInputState.DISABLED</code> to set the same skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var skin:Image = new Image( texture );\n\t * input.setSkinForState( TextInputState.DISABLED, skin );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:backgroundSkin\n\t * @see #setSkinForState()\n\t * @see feathers.controls.TextInputState#DISABLED\n\t */\n\t[Style(name=\"backgroundDisabledSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The skin used for the input's enabled state. If <code>null</code>,\n\t * then <code>backgroundSkin</code> is used instead.\n\t *\n\t * <p>The following example gives the input a skin for the enabled state:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * input.backgroundEnabledSkin = new Image( texture );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setSkinForState()</code> with\n\t * <code>TextInputState.ENABLED</code> to set the same skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var skin:Image = new Image( texture );\n\t * input.setSkinForState( TextInputState.ENABLED, skin );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:backgroundSkin\n\t * @see #setSkinForState()\n\t * @see feathers.controls.TextInputState#ENABLED\n\t */\n\t[Style(name=\"backgroundEnabledSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The skin used for the input's error state. If <code>null</code>,\n\t * then <code>backgroundSkin</code> is used instead.\n\t *\n\t * <p>The following example gives the input a skin for the error state:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * input.backgroundErrorSkin = new Image( texture );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setSkinForState()</code> with\n\t * <code>TextInputState.ERROR</code> to set the same skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var skin:Image = new Image( texture );\n\t * input.setSkinForState( TextInputState.ERROR, skin );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:backgroundSkin\n\t * @see #setSkinForState()\n\t * @see feathers.controls.TextInputState#ERROR\n\t */\n\t[Style(name=\"backgroundErrorSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The skin used for the input's focused state. If <code>null</code>,\n\t * then <code>backgroundSkin</code> is used instead.\n\t *\n\t * <p>The following example gives the input a skin for the focused state:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * input.backgroundFocusedSkin = new Image( texture );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setSkinForState()</code> with\n\t * <code>TextInputState.FOCUSED</code> to set the same skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var skin:Image = new Image( texture );\n\t * input.setSkinForState( TextInputState.FOCUSED, skin );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:backgroundSkin\n\t * @see #setSkinForState()\n\t * @see feathers.controls.TextInputState#FOCUSED\n\t */\n\t[Style(name=\"backgroundFocusedSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The skin used when no other skin is defined for the current state.\n\t * Intended for use when multiple states should use the same skin.\n\t *\n\t * <p>The following example gives the input a default skin to use for\n\t * all states when no specific skin is available:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * input.backgroundSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #setSkinForState()\n\t */\n\t[Style(name=\"backgroundSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * A style name to add to the text input's error callout sub-component.\n\t * Typically used by a theme to provide different styles to different\n\t * text inputs.\n\t *\n\t * <p>In the following example, a custom error callout style name\n\t * is passed to the text input:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * input.customErrorCalloutStyleName = \"my-custom-text-input-error-callout\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( Callout ).setFunctionForStyleName( \"my-custom-text-input-error-callout\", setCustomTextInputErrorCalloutStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_ERROR_CALLOUT\n\t * @see feathers.core.FeathersControl#styleNameList\n\t */\n\t[Style(name=\"customErrorCalloutStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to the text input's prompt text renderer\n\t * sub-component. Typically used by a theme to provide different styles\n\t * to different text inputs.\n\t *\n\t * <p>In the following example, a custom prompt text renderer style name\n\t * is passed to the text input:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * input.customPromptStyleName = \"my-custom-text-input-prompt\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( BitmapFontTextRenderer ).setFunctionForStyleName( \"my-custom-text-input-prompt\", setCustomTextInputPromptStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_PROMPT\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #promptFactory\n\t */\n\t[Style(name=\"customPromptStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to the text input's text editor sub-component.\n\t * Typically used by a theme to provide different styles to different\n\t * text inputs.\n\t *\n\t * <p>In the following example, a custom text editor style name is\n\t * passed to the text input:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * input.customTextEditorStyleName = \"my-custom-text-input-text-editor\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( StageTextTextEditor ).setFunctionForStyleName( \"my-custom-text-input-text-editor\", setCustomTextInputTextEditorStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_TEXT_EDITOR\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #textEditorFactory\n\t */\n\t[Style(name=\"customTextEditorStyleName\",type=\"String\")]\n\n\t/**\n\t * The icon used when no other icon is defined for the current state.\n\t * Intended for use when multiple states should use the same icon.\n\t *\n\t * <p>The following example gives the input a default icon to use for\n\t * all states when no specific icon is available:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * input.defaultIcon = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #setIconForState()\n\t */\n\t[Style(name=\"defaultIcon\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The font styles used to display the input's text when the input is\n\t * disabled.\n\t *\n\t * <p>In the following example, the disabled font styles are customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * input.disabledFontStyles = new TextFormat( \"Helvetica\", 20, 0x999999 );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setFontStylesForState()</code> with\n\t * <code>TextInputState.DISABLED</code> to set the same font styles:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var fontStyles:TextFormat = new TextFormat( \"Helvetica\", 20, 0x999999 );\n\t * input.setFontStylesForState( TextInputState.DISABLED, fontStyles );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text editor being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>textEditorFactory</code> to set more advanced styles on the\n\t * text editor.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:fontStyles\n\t * @see #setFontStylesForState()\n\t * @see feathers.controls.TextInputState#DISABLED\n\t */\n\t[Style(name=\"disabledFontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The icon used for the input's disabled state. If <code>null</code>,\n\t * then <code>defaultIcon</code> is used instead.\n\t *\n\t * <p>The following example gives the input an icon for the disabled state:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.disabledIcon = new Image( texture );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setIconForState()</code> with\n\t * <code>TextInputState.DISABLED</code> to set the same icon:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var icon:Image = new Image( texture );\n\t * input.setIconForState( TextInputState.DISABLED, icon );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:defaultIcon\n\t * @see #setIconForState()\n\t * @see feathers.controls.TextInputState#DISABLED\n\t */\n\t[Style(name=\"disabledIcon\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The icon used for the input's enabled state. If <code>null</code>,\n\t * then <code>defaultIcon</code> is used instead.\n\t *\n\t * <p>The following example gives the input an icon for the enabled state:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.enabledIcon = new Image( texture );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setIconForState()</code> with\n\t * <code>TextInputState.ENABLED</code> to set the same icon:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var icon:Image = new Image( texture );\n\t * input.setIconForState( TextInputState.ENABLED, icon );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:defaultIcon\n\t * @see #setIconForState()\n\t * @see feathers.controls.TextInputState#ENABLED\n\t */\n\t[Style(name=\"enabledIcon\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The icon used for the input's error state. If <code>null</code>,\n\t * then <code>defaultIcon</code> is used instead.\n\t *\n\t * <p>The following example gives the input an icon for the error state:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.errorIcon = new Image( texture );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setIconForState()</code> with\n\t * <code>TextInputState.ERROR</code> to set the same icon:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var icon:Image = new Image( texture );\n\t * input.setIconForState( TextInputState.ERROR, icon );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:defaultIcon\n\t * @see #setIconForState()\n\t * @see feathers.controls.TextInputState#ERROR\n\t */\n\t[Style(name=\"errorIcon\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The icon used for the input's focused state. If <code>null</code>,\n\t * then <code>defaultIcon</code> is used instead.\n\t *\n\t * <p>The following example gives the input an icon for the focused state:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.focusedIcon = new Image( texture );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setIconForState()</code> with\n\t * <code>TextInputState.FOCUSED</code> to set the same icon:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var icon:Image = new Image( texture );\n\t * input.setIconForState( TextInputState.FOCUSED, icon );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:defaultIcon\n\t * @see #setIconForState()\n\t * @see feathers.controls.TextInputState#FOCUSED\n\t */\n\t[Style(name=\"focusedIcon\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The font styles used to display the input's text.\n\t *\n\t * <p>In the following example, the font styles are customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * input.fontStyles = new TextFormat( \"Helvetica\", 20, 0xcc0000 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text editor being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>textEditorFactory</code> to set more advanced styles on the\n\t * text editor.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:disabledFontStyles\n\t * @see #setFontStylesForState()\n\t */\n\t[Style(name=\"fontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The space, in pixels, between the icon and the text editor, if an\n\t * icon exists.\n\t *\n\t * <p>The following example creates a gap of 50 pixels between the icon\n\t * and the text editor:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.defaultIcon = new Image( texture );\n\t * button.gap = 50;</listing>\n\t *\n\t * @default 0\n\t */\n\t[Style(name=\"gap\",type=\"Number\")]\n\n\t/**\n\t * The location of the icon, relative to the text renderer.\n\t *\n\t * <p>The following example positions the icon to the right of the\n\t * text renderer:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * input.defaultIcon = new Image( texture );\n\t * input.iconPosition = RelativePosition.RIGHT;</listing>\n\t *\n\t * @default feathers.layout.RelativePosition.LEFT\n\t *\n\t * @see feathers.layout.RelativePosition#RIGHT\n\t * @see feathers.layout.RelativePosition#LEFT\n\t */\n\t[Style(name=\"iconPosition\",type=\"String\")]\n\n\t/**\n\t * Quickly sets all padding properties to the same value. The\n\t * <code>padding</code> getter always returns the value of\n\t * <code>paddingTop</code>, but the other padding values may be\n\t * different.\n\t *\n\t * <p>In the following example, the text input's padding is set to\n\t * 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * input.padding = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:paddingTop\n\t * @see #style:paddingRight\n\t * @see #style:paddingBottom\n\t * @see #style:paddingLeft\n\t */\n\t[Style(name=\"padding\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the input's top edge and the\n\t * input's content.\n\t *\n\t * <p>In the following example, the text input's top padding is set to\n\t * 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * input.paddingTop = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingTop\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the input's right edge and the\n\t * input's content.\n\t *\n\t * <p>In the following example, the text input's right padding is set to\n\t * 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * input.paddingRight = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingRight\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the input's bottom edge and\n\t * the input's content.\n\t *\n\t * <p>In the following example, the text input's bottom padding is set to\n\t * 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * input.paddingBottom = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingBottom\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the input's left edge and the\n\t * input's content.\n\t *\n\t * <p>In the following example, the text input's left padding is set to\n\t * 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * input.paddingLeft = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingLeft\",type=\"Number\")]\n\n\t/**\n\t * The font styles used to display the input's prompt when the input is\n\t * disabled.\n\t *\n\t * <p>In the following example, the disabled font styles are customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * input.promptDisabledFontStyles = new TextFormat( \"Helvetica\", 20, 0x999999 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>promptFactory</code> to set more advanced styles on the\n\t * text renderer.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:promptFontStyles\n\t * @see #setPromptFontStylesForState()\n\t */\n\t[Style(name=\"promptDisabledFontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The font styles used to display the input's prompt text.\n\t *\n\t * <p>In the following example, the font styles are customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * input.promptFontStyles = new TextFormat( \"Helvetica\", 20, 0xcc0000 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>promptFactory</code> to set more advanced styles on the\n\t * text renderer.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:promptDisabledFontStyles\n\t * @see #setPromptFontStylesForState()\n\t */\n\t[Style(name=\"promptFontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * If not <code>null</code>, the dimensions of the\n\t * <code>typicalText</code> will be used in the calculation of the text\n\t * input's full dimensions. If the text input's dimensions haven't been\n\t * set explicitly, it's calculated dimensions will be at least large\n\t * enough to display the <code>typicalText</code>. Other children, such\n\t * as the background skin and the prompt text renderer may also affect\n\t * the dimensions of the text input, allowing it to, potentially, be\n\t * bigger than the rendered <code>typicalText</code>.\n\t *\n\t * <p>In the following example, the text input's typical text is\n\t * updated:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * input.text = \"We want to allow the text input to show all of this text\";</listing>\n\t *\n\t * @default null\n\t */\n\t[Style(name=\"typicalText\",type=\"String\")]\n\n\t/**\n\t * The location where the text editor is aligned vertically (on\n\t * the y-axis).\n\t *\n\t * <p>The following example aligns the text editor to the top:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * input.verticalAlign = VerticalAlign.TOP;</listing>\n\t *\n\t * @default feathers.layout.VerticalAlign.MIDDLE\n\t *\n\t * @see feathers.layout.VerticalAlign#TOP\n\t * @see feathers.layout.VerticalAlign#MIDDLE\n\t * @see feathers.layout.VerticalAlign#BOTTOM\n\t * @see feathers.layout.VerticalAlign#JUSTIFY\n\t */\n\t[Style(name=\"verticalAlign\",type=\"String\")]\n\n\t/**\n\t * Dispatched when the text input's <code>text</code> property changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #text\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the user presses the Enter key while the text input\n\t * has focus. This event may not be dispatched at all times. Certain text\n\t * editors will not dispatch an event for the enter key on some platforms,\n\t * depending on the values of certain properties. This may include the\n\t * default values for some platforms! If you've encountered this issue,\n\t * please see the specific text editor's API documentation for complete\n\t * details of this event's limitations and requirements.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.ENTER\n\t */\n\t[Event(name=\"enter\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the text input receives focus.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.FOCUS_IN\n\t */\n\t[Event(name=\"focusIn\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the text input loses focus.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.FOCUS_OUT\n\t */\n\t[Event(name=\"focusOut\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the soft keyboard is about the be activated by the text\n\t * editor. Not all text editors will activate a soft keyboard.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.SOFT_KEYBOARD_ACTIVATING\n\t */\n\t[Event(name=\"softKeyboardActivating\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the soft keyboard is activated by the text editor. Not\n\t * all text editors will activate a soft keyboard.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.SOFT_KEYBOARD_ACTIVATE\n\t */\n\t[Event(name=\"softKeyboardActivate\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the soft keyboard is deactivated by the text editor. Not\n\t * all text editors will activate a soft keyboard.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.SOFT_KEYBOARD_DEACTIVATE\n\t */\n\t[Event(name=\"softKeyboardDeactivate\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the display object's state changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.STATE_CHANGE\n\t *\n\t * @see #currentState\n\t */\n\t[Event(name=\"stateChange\",type=\"starling.events.Event\")]\n\n\t/**\n\t * A text entry control that allows users to enter and edit a single line of\n\t * uniformly-formatted text.\n\t *\n\t * <p>The following example sets the text in a text input, selects the text,\n\t * and listens for when the text value changes:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var input:TextInput = new TextInput();\n\t * input.text = \"Hello World\";\n\t * input.selectRange( 0, input.text.length );\n\t * input.addEventListener( Event.CHANGE, input_changeHandler );\n\t * this.addChild( input );</listing>\n\t *\n\t * @see ../../../help/text-input.html How to use the Feathers TextInput component\n\t * @see ../../../help/text-editors.html Introduction to Feathers text editors\n\t * @see feathers.core.ITextEditor\n\t * @see feathers.controls.AutoComplete\n\t * @see feathers.controls.TextArea\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class TextInput extends FeathersControl implements ITextBaselineControl, IAdvancedNativeFocusOwner, IStateContext\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_PROMPT_FACTORY:String = \"promptFactory\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_ERROR_CALLOUT_FACTORY:String = \"errorCalloutFactory\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the text\n\t\t * editor.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_TEXT_EDITOR:String = \"feathers-text-input-text-editor\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the\n\t\t * prompt text renderer.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_PROMPT:String = \"feathers-text-input-prompt\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the\n\t\t * error callout.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_ERROR_CALLOUT:String = \"feathers-text-input-error-callout\";\n\n\t\t/**\n\t\t * An alternate style name to use with <code>TextInput</code> to allow a\n\t\t * theme to give it a search input style. If a theme does not provide a\n\t\t * style for the search text input, the theme will automatically fal\n\t\t * back to using the default text input style.\n\t\t *\n\t\t * <p>An alternate style name should always be added to a component's\n\t\t * <code>styleNameList</code> before the component is initialized. If\n\t\t * the style name is added later, it will be ignored.</p>\n\t\t *\n\t\t * <p>In the following example, the search style is applied to a text\n\t\t * input:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var input:TextInput = new TextInput();\n\t\t * input.styleNameList.add( TextInput.ALTERNATE_STYLE_NAME_SEARCH_TEXT_INPUT );\n\t\t * this.addChild( input );</listing>\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const ALTERNATE_STYLE_NAME_SEARCH_TEXT_INPUT:String = \"feathers-search-text-input\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>TextInput</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\tprivate static function defaultErrorCalloutFactory():TextCallout\n\t\t{\n\t\t\treturn new TextCallout();\n\t\t}\n\t\t\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function TextInput()\n\t\t{\n\t\t\tsuper();\n\t\t\tif(this._fontStylesSet === null)\n\t\t\t{\n\t\t\t\tthis._fontStylesSet = new FontStylesSet();\n\t\t\t\tthis._fontStylesSet.addEventListener(Event.CHANGE, fontStyles_changeHandler);\n\t\t\t}\n\t\t\tif(this._promptFontStylesSet === null)\n\t\t\t{\n\t\t\t\tthis._promptFontStylesSet = new FontStylesSet();\n\t\t\t\tthis._promptFontStylesSet.addEventListener(Event.CHANGE, fontStyles_changeHandler);\n\t\t\t}\n\t\t\tthis.addEventListener(TouchEvent.TOUCH, textInput_touchHandler);\n\t\t\tthis.addEventListener(Event.REMOVED_FROM_STAGE, textInput_removedFromStageHandler);\n\t\t}\n\n\t\t/**\n\t\t * The text editor sub-component.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t */\n\t\tprotected var textEditor:ITextEditor;\n\n\t\t/**\n\t\t * The prompt text renderer sub-component.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t */\n\t\tprotected var promptTextRenderer:ITextRenderer;\n\n\t\t/**\n\t\t * The currently selected background, based on state.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t */\n\t\tprotected var currentBackground:DisplayObject;\n\n\t\t/**\n\t\t * The currently visible icon. The value will be <code>null</code> if\n\t\t * there is no currently visible icon.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t */\n\t\tprotected var currentIcon:DisplayObject;\n\n\t\t/**\n\t\t * The <code>TextCallout</code> that displays the value of the\n\t\t * <code>errorString</code> property. The value may be\n\t\t * <code>null</code> if there is no current error string or the text\n\t\t * input does not have focus.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t */\n\t\tprotected var callout:TextCallout;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the text editor.\n\t\t * This variable is <code>protected</code> so that sub-classes can\n\t\t * customize the text editor style name in their constructors instead of\n\t\t * using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_TEXT_EDITOR</code>.\n\t\t *\n\t\t * <p>To customize the text editor style name without subclassing, see\n\t\t * <code>customTextEditorStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customTextEditorStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var textEditorStyleName:String = DEFAULT_CHILD_STYLE_NAME_TEXT_EDITOR;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the prompt text\n\t\t * renderer. This variable is <code>protected</code> so that sub-classes\n\t\t * can customize the prompt text renderer style name in their\n\t\t * constructors instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_PROMPT</code>.\n\t\t *\n\t\t * <p>To customize the prompt text renderer style name without\n\t\t * subclassing, see <code>customPromptStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customPromptStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var promptStyleName:String = DEFAULT_CHILD_STYLE_NAME_PROMPT;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the error\n\t\t * callout. This variable is <code>protected</code> so that sub-classes\n\t\t * can customize the prompt text renderer style name in their\n\t\t * constructors instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_ERROR_CALLOUT</code>.\n\t\t *\n\t\t * <p>To customize the error callout style name without subclassing, see\n\t\t * <code>customErrorCalloutStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customErrorCalloutStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var errorCalloutStyleName:String = DEFAULT_CHILD_STYLE_NAME_ERROR_CALLOUT;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textEditorHasFocus:Boolean = false;\n\n\t\t/**\n\t\t * A text editor may be an <code>INativeFocusOwner</code>, so we need to\n\t\t * return the value of its <code>nativeFocus</code> property. If not,\n\t\t * then we return <code>null</code>.\n\t\t *\n\t\t * @see feathers.core.INativeFocusOwner\n\t\t */\n\t\tpublic function get nativeFocus():Object\n\t\t{\n\t\t\tif(this.textEditor is INativeFocusOwner)\n\t\t\t{\n\t\t\t\treturn INativeFocusOwner(this.textEditor).nativeFocus;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function get maintainTouchFocus():Boolean\n\t\t{\n\t\t\tif(this.textEditor is IFocusDisplayObject)\n\t\t\t{\n\t\t\t\treturn IFocusDisplayObject(this.textEditor).maintainTouchFocus;\n\t\t\t}\n\t\t\treturn super.maintainTouchFocus;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _ignoreTextChanges:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _touchPointID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn TextInput.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * When the <code>FocusManager</code> isn't enabled, <code>hasFocus</code>\n\t\t * can be used instead of <code>FocusManager.focus == textInput</code>\n\t\t * to determine if the text input has focus.\n\t\t */\n\t\tpublic function get hasFocus():Boolean\n\t\t{\n\t\t\treturn this._textEditorHasFocus;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set isEnabled(value:Boolean):void\n\t\t{\n\t\t\tsuper.isEnabled = value;\n\t\t\tthis.refreshState();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentState:String = TextInputState.ENABLED;\n\n\t\t/**\n\t\t * The current state of the text input.\n\t\t *\n\t\t * @see feathers.controls.TextInputState\n\t\t * @see #event:stateChange feathers.events.FeathersEventType.STATE_CHANGE\n\t\t */\n\t\tpublic function get currentState():String\n\t\t{\n\t\t\treturn this._currentState;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _text:String = \"\";\n\n\t\t/**\n\t\t * The text displayed by the text input. The text input dispatches\n\t\t * <code>Event.CHANGE</code> when the value of the <code>text</code>\n\t\t * property changes for any reason.\n\t\t *\n\t\t * <p>In the following example, the text input's text is updated:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * input.text = \"Hello World\";</listing>\n\t\t *\n\t\t * @see #event:change\n\t\t *\n\t\t * @default \"\"\n\t\t */\n\t\tpublic function get text():String\n\t\t{\n\t\t\treturn this._text;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set text(value:String):void\n\t\t{\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\t//don't allow null or undefined\n\t\t\t\tvalue = \"\";\n\t\t\t}\n\t\t\tif(this._text == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._text = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * The baseline measurement of the text, in pixels.\n\t\t */\n\t\tpublic function get baseline():Number\n\t\t{\n\t\t\tif(!this.textEditor)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn this.textEditor.y + this.textEditor.baseline;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _prompt:String = null;\n\n\t\t/**\n\t\t * The prompt, hint, or description text displayed by the input when the\n\t\t * value of its text is empty.\n\t\t *\n\t\t * <p>In the following example, the text input's prompt is updated:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * input.prompt = \"User Name\";</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get prompt():String\n\t\t{\n\t\t\treturn this._prompt;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set prompt(value:String):void\n\t\t{\n\t\t\tif(this._prompt == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._prompt = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _typicalText:String = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get typicalText():String\n\t\t{\n\t\t\treturn this._typicalText;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set typicalText(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._typicalText === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._typicalText = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maxChars:int = 0;\n\n\t\t/**\n\t\t * The maximum number of characters that may be entered. If <code>0</code>,\n\t\t * any number of characters may be entered.\n\t\t *\n\t\t * <p>In the following example, the text input's maximum characters is\n\t\t * specified:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * input.maxChars = 10;</listing>\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get maxChars():int\n\t\t{\n\t\t\treturn this._maxChars;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maxChars(value:int):void\n\t\t{\n\t\t\tif(this._maxChars == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._maxChars = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _restrict:String;\n\n\t\t/**\n\t\t * Limits the set of characters that may be entered.\n\t\t *\n\t\t * <p>In the following example, the text input's allowed characters are\n\t\t * restricted:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * input.restrict = \"0-9\";</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get restrict():String\n\t\t{\n\t\t\treturn this._restrict;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set restrict(value:String):void\n\t\t{\n\t\t\tif(this._restrict == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._restrict = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _displayAsPassword:Boolean = false;\n\n\t\t/**\n\t\t * Determines if the entered text will be masked so that it cannot be\n\t\t * seen, such as for a password input.\n\t\t *\n\t\t * <p>In the following example, the text input's text is displayed as\n\t\t * a password:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * input.displayAsPassword = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic function get displayAsPassword():Boolean\n\t\t{\n\t\t\treturn this._displayAsPassword;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set displayAsPassword(value:Boolean):void\n\t\t{\n\t\t\tif(this._displayAsPassword == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._displayAsPassword = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isEditable:Boolean = true;\n\n\t\t/**\n\t\t * Determines if the text input is editable. If the text input is not\n\t\t * editable, it will still appear enabled.\n\t\t *\n\t\t * <p>In the following example, the text input is not editable:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * input.isEditable = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t *\n\t\t * @see #isSelectable\n\t\t */\n\t\tpublic function get isEditable():Boolean\n\t\t{\n\t\t\treturn this._isEditable;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isEditable(value:Boolean):void\n\t\t{\n\t\t\tif(this._isEditable == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isEditable = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isSelectable:Boolean = true;\n\n\t\t/**\n\t\t * If the <code>isEditable</code> property is set to <code>false</code>,\n\t\t * the <code>isSelectable</code> property determines if the text is\n\t\t * selectable. If the <code>isEditable</code> property is set to\n\t\t * <code>true</code>, the text will always be selectable.\n\t\t *\n\t\t * <p>In the following example, the text input is not selectable:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * input.isEditable = false;\n\t\t * input.isSelectable = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t *\n\t\t * @see #isEditable\n\t\t */\n\t\tpublic function get isSelectable():Boolean\n\t\t{\n\t\t\treturn this._isSelectable;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isSelectable(value:Boolean):void\n\t\t{\n\t\t\tif(this._isSelectable == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isSelectable = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _errorString:String = null;\n\n\t\t/**\n\t\t * Error text to display in a <code>Callout</code> when the input has\n\t\t * focus. When this value is not <code>null</code> the input's state is\n\t\t * changed to <code>TextInputState.ERROR</code>.\n\t\t *\n\t\t * An empty string will change the background, but no\n\t\t * <code>Callout</code> will appear on focus.\n\t\t *\n\t\t * To clear an error, the <code>errorString</code> property must be set\n\t\t * to <code>null</code>\n\t\t *\n\t\t * <p>The following example displays an error string:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * input.errorString = \"Something is wrong\";</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #currentState\n\t\t */\n\t\tpublic function get errorString():String\n\t\t{\n\t\t\treturn this._errorString;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set errorString(value:String):void\n\t\t{\n\t\t\tif(this._errorString === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._errorString = value;\n\t\t\tthis.refreshState();\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fontStylesSet:FontStylesSet;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get fontStyles():TextFormat\n\t\t{\n\t\t\treturn this._fontStylesSet.format;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set fontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._fontStylesSet.format;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._fontStylesSet.format = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get disabledFontStyles():TextFormat\n\t\t{\n\t\t\treturn this._fontStylesSet.disabledFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disabledFontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._fontStylesSet.disabledFormat;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._fontStylesSet.disabledFormat = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textEditorFactory:Function;\n\n\t\t/**\n\t\t * A function used to instantiate the text editor. If null,\n\t\t * <code>FeathersControl.defaultTextEditorFactory</code> is used\n\t\t * instead. The text editor must be an instance of\n\t\t * <code>ITextEditor</code>. This factory can be used to change\n\t\t * properties on the text editor when it is first created. For instance,\n\t\t * if you are skinning Feathers components without a theme, you might\n\t\t * use this factory to set styles on the text editor.\n\t\t *\n\t\t * <p>The factory should have the following function signature:</p>\n\t\t * <pre>function():ITextEditor</pre>\n\t\t *\n\t\t * <p>In the following example, a custom text editor factory is passed\n\t\t * to the text input:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * input.textEditorFactory = function():ITextEditor\n\t\t * {\n\t\t *     return new TextFieldTextEditor();\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.ITextEditor\n\t\t * @see feathers.core.FeathersControl#defaultTextEditorFactory\n\t\t */\n\t\tpublic function get textEditorFactory():Function\n\t\t{\n\t\t\treturn this._textEditorFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set textEditorFactory(value:Function):void\n\t\t{\n\t\t\tif(this._textEditorFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textEditorFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_EDITOR);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customTextEditorStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customTextEditorStyleName():String\n\t\t{\n\t\t\treturn this._customTextEditorStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customTextEditorStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customTextEditorStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customTextEditorStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _promptFontStylesSet:FontStylesSet;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get promptFontStyles():TextFormat\n\t\t{\n\t\t\treturn this._promptFontStylesSet.format;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set promptFontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._promptFontStylesSet.format;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._promptFontStylesSet.format = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get promptDisabledFontStyles():TextFormat\n\t\t{\n\t\t\treturn this._promptFontStylesSet.disabledFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set promptDisabledFontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._promptFontStylesSet.disabledFormat;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._promptFontStylesSet.disabledFormat = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _promptFactory:Function;\n\n\t\t/**\n\t\t * A function used to instantiate the prompt text renderer. If null,\n\t\t * <code>FeathersControl.defaultTextRendererFactory</code> is used\n\t\t * instead. The prompt text renderer must be an instance of\n\t\t * <code>ITextRenderer</code>. This factory can be used to change\n\t\t * properties on the prompt when it is first created. For instance, if\n\t\t * you are skinning Feathers components without a theme, you might use\n\t\t * this factory to set styles on the prompt.\n\t\t *\n\t\t * <p>The factory should have the following function signature:</p>\n\t\t * <pre>function():ITextRenderer</pre>\n\t\t *\n\t\t * <p>If the <code>prompt</code> property is <code>null</code>, the\n\t\t * prompt text renderer will not be created.</p>\n\t\t *\n\t\t * <p>In the following example, a custom prompt factory is passed to the\n\t\t * text input:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * input.promptFactory = function():ITextRenderer\n\t\t * {\n\t\t *     return new TextFieldTextRenderer();\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #prompt\n\t\t * @see feathers.core.ITextRenderer\n\t\t * @see feathers.core.FeathersControl#defaultTextRendererFactory\n\t\t */\n\t\tpublic function get promptFactory():Function\n\t\t{\n\t\t\treturn this._promptFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set promptFactory(value:Function):void\n\t\t{\n\t\t\tif(this._promptFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._promptFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_PROMPT_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customPromptStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customPromptStyleName():String\n\t\t{\n\t\t\treturn this._customPromptStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customPromptStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customPromptStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customPromptStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_PROMPT_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _promptProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the input's prompt text\n\t\t * renderer sub-component, and the properties will be passed down to the\n\t\t * text renderer when the input validates. The available properties\n\t\t * depend on which <code>ITextRenderer</code> implementation is returned\n\t\t * by <code>messageFactory</code>. Refer to\n\t\t * <a href=\"../core/ITextRenderer.html\"><code>feathers.core.ITextRenderer</code></a>\n\t\t * for a list of available text renderer implementations.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>promptFactory</code> function\n\t\t * instead of using <code>promptProperties</code> will result in\n\t\t * better performance.</p>\n\t\t *\n\t\t * <p>In the following example, the text input's prompt's properties are\n\t\t * updated (this example assumes that the prompt text renderer is a\n\t\t * <code>TextFieldTextRenderer</code>):</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * input.promptProperties.textFormat = new TextFormat( \"Source Sans Pro\", 16, 0x333333 );\n\t\t * input.promptProperties.embedFonts = true;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #prompt\n\t\t * @see #promptFactory\n\t\t * @see feathers.core.ITextRenderer\n\t\t */\n\t\tpublic function get promptProperties():Object\n\t\t{\n\t\t\tif(!this._promptProperties)\n\t\t\t{\n\t\t\t\tthis._promptProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._promptProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set promptProperties(value:Object):void\n\t\t{\n\t\t\tif(this._promptProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._promptProperties)\n\t\t\t{\n\t\t\t\tthis._promptProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._promptProperties = PropertyProxy(value);\n\t\t\tif(this._promptProperties)\n\t\t\t{\n\t\t\t\tthis._promptProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\t\t\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _errorCalloutFactory:Function;\n\t\t\n\t\t/**\n\t\t * A function used to instantiate the error text callout. If null,\n\t\t * <code>new TextCallout()</code> is used instead.\n\t\t * The error text callout must be an instance of\n\t\t * <code>TextCallout</code>. This factory can be used to change\n\t\t * properties on the callout when it is first created. For instance, if\n\t\t * you are skinning Feathers components without a theme, you might use\n\t\t * this factory to set styles on the callout.\n\t\t *\n\t\t * <p>The factory should have the following function signature:</p>\n\t\t * <pre>function():TextCallout</pre>\n\t\t *\n\t\t * <p>In the following example, a custom error callout factory is passed\n\t\t * to the text input:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * input.errorCalloutFactory = function():TextCallout\n\t\t * {\n\t\t *     return new TextCallout();\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #errorString\n\t\t * @see feathers.controls.TextCallout\n\t\t */\n\t\tpublic function get errorCalloutFactory():Function\n\t\t{\n\t\t\treturn this._errorCalloutFactory;\n\t\t}\n\t\t\n\t\tpublic function set errorCalloutFactory(value:Function):void\n\t\t{\n\t\t\tif(this._errorCalloutFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._errorCalloutFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ERROR_CALLOUT_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customErrorCalloutStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customErrorCalloutStyleName():String\n\t\t{\n\t\t\treturn this._customErrorCalloutStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customErrorCalloutStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customErrorCalloutStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customErrorCalloutStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ERROR_CALLOUT_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMaxWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMaxHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _backgroundSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundSkin():DisplayObject\n\t\t{\n\t\t\treturn this._backgroundSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSkin !== null &&\n\t\t\t\tthis.currentBackground === this._backgroundSkin)\n\t\t\t{\n\t\t\t\t//if this skin needs to be reused somewhere else, we need to\n\t\t\t\t//properly clean it up\n\t\t\t\tthis.removeCurrentBackground(this._backgroundSkin);\n\t\t\t\tthis.currentBackground = null;\n\t\t\t}\n\t\t\tthis._backgroundSkin = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SKIN);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _stateToSkin:Object = {};\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundEnabledSkin():DisplayObject\n\t\t{\n\t\t\treturn this.getSkinForState(TextInputState.ENABLED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundEnabledSkin(value:DisplayObject):void\n\t\t{\n\t\t\tthis.setSkinForState(TextInputState.ENABLED, value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundFocusedSkin():DisplayObject\n\t\t{\n\t\t\treturn this.getSkinForState(TextInputState.FOCUSED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundFocusedSkin(value:DisplayObject):void\n\t\t{\n\t\t\tthis.setSkinForState(TextInputState.FOCUSED, value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundErrorSkin():DisplayObject\n\t\t{\n\t\t\treturn this.getSkinForState(TextInputState.ERROR);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundErrorSkin(value:DisplayObject):void\n\t\t{\n\t\t\tthis.setSkinForState(TextInputState.ERROR, value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundDisabledSkin():DisplayObject\n\t\t{\n\t\t\treturn this.getSkinForState(TextInputState.DISABLED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundDisabledSkin(value:DisplayObject):void\n\t\t{\n\t\t\tthis.setSkinForState(TextInputState.DISABLED, value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * The width of the first icon that was displayed.\n\t\t */\n\t\tprotected var _originalIconWidth:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t * The height of the first icon that was displayed.\n\t\t */\n\t\tprotected var _originalIconHeight:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _defaultIcon:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get defaultIcon():DisplayObject\n\t\t{\n\t\t\treturn this._defaultIcon;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set defaultIcon(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._defaultIcon === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._defaultIcon = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _stateToIcon:Object = {};\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get enabledIcon():DisplayObject\n\t\t{\n\t\t\treturn this.getIconForState(TextInputState.ENABLED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set enabledIcon(value:DisplayObject):void\n\t\t{\n\t\t\tthis.setIconForState(TextInputState.ENABLED, value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get disabledIcon():DisplayObject\n\t\t{\n\t\t\treturn this.getIconForState(TextInputState.DISABLED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disabledIcon(value:DisplayObject):void\n\t\t{\n\t\t\tthis.setIconForState(TextInputState.DISABLED, value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get focusedIcon():DisplayObject\n\t\t{\n\t\t\treturn this.getIconForState(TextInputState.FOCUSED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set focusedIcon(value:DisplayObject):void\n\t\t{\n\t\t\tthis.setIconForState(TextInputState.FOCUSED, value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get errorIcon():DisplayObject\n\t\t{\n\t\t\treturn this.getIconForState(TextInputState.ERROR);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set errorIcon(value:DisplayObject):void\n\t\t{\n\t\t\tthis.setIconForState(TextInputState.ERROR, value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _iconPosition:String = RelativePosition.LEFT;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"left,right\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get iconPosition():String\n\t\t{\n\t\t\treturn this._iconPosition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set iconPosition(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._iconPosition === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._iconPosition = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _gap:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get gap():Number\n\t\t{\n\t\t\treturn this._gap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set gap(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._gap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._gap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get padding():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set padding(value:Number):void\n\t\t{\n\t\t\tthis.paddingTop = value;\n\t\t\tthis.paddingRight = value;\n\t\t\tthis.paddingBottom = value;\n\t\t\tthis.paddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingTop:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingTop():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingTop(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingTop = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingRight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingRight():Number\n\t\t{\n\t\t\treturn this._paddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingRight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingBottom:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingBottom():Number\n\t\t{\n\t\t\treturn this._paddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingBottom = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingLeft:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingLeft = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalAlign:String = VerticalAlign.MIDDLE;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"top,middle,bottom,justify\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get verticalAlign():String\n\t\t{\n\t\t\treturn this._verticalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalAlign(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._verticalAlign === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalAlign = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * Flag indicating that the text editor should get focus after it is\n\t\t * created.\n\t\t */\n\t\tprotected var _isWaitingToSetFocus:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _pendingSelectionBeginIndex:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _pendingSelectionEndIndex:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _oldMouseCursor:String = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textEditorProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the input's text editor\n\t\t * sub-component, and the properties will be passed down to the\n\t\t * text editor when the input validates. The available properties\n\t\t * depend on which <code>ITextEditor</code> implementation is returned\n\t\t * by <code>textEditorFactory</code>. Refer to\n\t\t * <a href=\"../core/ITextEditor.html\"><code>feathers.core.ITextEditor</code></a>\n\t\t * for a list of available text editor implementations.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>textEditorFactory</code> function\n\t\t * instead of using <code>textEditorProperties</code> will result in\n\t\t * better performance.</p>\n\t\t *\n\t\t * <p>In the following example, the text input's text editor properties\n\t\t * are specified (this example assumes that the text editor is a\n\t\t * <code>StageTextTextEditor</code>):</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * input.textEditorProperties.fontName = \"Helvetica\";\n\t\t * input.textEditorProperties.fontSize = 16;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #textEditorFactory\n\t\t * @see feathers.core.ITextEditor\n\t\t */\n\t\tpublic function get textEditorProperties():Object\n\t\t{\n\t\t\tif(!this._textEditorProperties)\n\t\t\t{\n\t\t\t\tthis._textEditorProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._textEditorProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set textEditorProperties(value:Object):void\n\t\t{\n\t\t\tif(this._textEditorProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._textEditorProperties)\n\t\t\t{\n\t\t\t\tthis._textEditorProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._textEditorProperties = PropertyProxy(value);\n\t\t\tif(this._textEditorProperties)\n\t\t\t{\n\t\t\t\tthis._textEditorProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.core.ITextEditor#selectionBeginIndex\n\t\t */\n\t\tpublic function get selectionBeginIndex():int\n\t\t{\n\t\t\tif(this._pendingSelectionBeginIndex >= 0)\n\t\t\t{\n\t\t\t\treturn this._pendingSelectionBeginIndex;\n\t\t\t}\n\t\t\tif(this.textEditor)\n\t\t\t{\n\t\t\t\treturn this.textEditor.selectionBeginIndex;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.core.ITextEditor#selectionEndIndex\n\t\t */\n\t\tpublic function get selectionEndIndex():int\n\t\t{\n\t\t\tif(this._pendingSelectionEndIndex >= 0)\n\t\t\t{\n\t\t\t\treturn this._pendingSelectionEndIndex;\n\t\t\t}\n\t\t\tif(this.textEditor)\n\t\t\t{\n\t\t\t\treturn this.textEditor.selectionEndIndex;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set visible(value:Boolean):void\n\t\t{\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tthis._isWaitingToSetFocus = false;\n\t\t\t}\n\t\t\tsuper.visible = value;\n\t\t\t//call clearFocus() after setting super.visible because the text\n\t\t\t//editor may check the visible property\n\t\t\tif(!value && this._textEditorHasFocus)\n\t\t\t{\n\t\t\t\tthis.textEditor.clearFocus();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function hitTest(localPoint:Point):DisplayObject\n\t\t{\n\t\t\tif(!this.visible || !this.touchable)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif(this.mask && !this.hitTestMask(localPoint))\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn this._hitArea.containsPoint(localPoint) ? DisplayObject(this.textEditor) : null;\n\t\t}\n\n\t\t/**\n\t\t * Focuses the text input control so that it may be edited, and selects\n\t\t * all of its text. Call <code>selectRange()</code> after\n\t\t * <code>setFocus()</code> to select a different range.\n\t\t *\n\t\t * @see #selectRange()\n\t\t */\n\t\tpublic function setFocus():void\n\t\t{\n\t\t\t//if the text editor has focus, no need to set focus\n\t\t\t//if this is invisible, it wouldn't make sense to set focus\n\t\t\t//if there's a touch point ID, we'll be setting focus on our own\n\t\t\tif(this._textEditorHasFocus || !this.visible || this._touchPointID >= 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._isEditable || this._isSelectable)\n\t\t\t{\n\t\t\t\tthis.selectRange(0, this._text.length);\n\t\t\t}\n\t\t\tif(this.textEditor)\n\t\t\t{\n\t\t\t\tthis._isWaitingToSetFocus = false;\n\t\t\t\tthis.textEditor.setFocus();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._isWaitingToSetFocus = true;\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Manually removes focus from the text input control.\n\t\t */\n\t\tpublic function clearFocus():void\n\t\t{\n\t\t\tthis._isWaitingToSetFocus = false;\n\t\t\tif(!this.textEditor || !this._textEditorHasFocus)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.textEditor.clearFocus();\n\t\t}\n\n\t\t/**\n\t\t * Sets the range of selected characters. If both values are the same,\n\t\t * or the end index is <code>-1</code>, the text insertion position is\n\t\t * changed and nothing is selected.\n\t\t */\n\t\tpublic function selectRange(beginIndex:int, endIndex:int = -1):void\n\t\t{\n\t\t\tif(endIndex < 0)\n\t\t\t{\n\t\t\t\tendIndex = beginIndex;\n\t\t\t}\n\t\t\tif(beginIndex < 0)\n\t\t\t{\n\t\t\t\tthrow new RangeError(\"Expected begin index >= 0. Received \" + beginIndex + \".\");\n\t\t\t}\n\t\t\tif(endIndex > this._text.length)\n\t\t\t{\n\t\t\t\tthrow new RangeError(\"Expected end index <= \" + this._text.length + \". Received \" + endIndex + \".\");\n\t\t\t}\n\n\t\t\t//if it's invalid, we need to wait until validation before changing\n\t\t\t//the selection\n\t\t\tif(this.textEditor && (this._isValidating || !this.isInvalid()))\n\t\t\t{\n\t\t\t\tthis._pendingSelectionBeginIndex = -1;\n\t\t\t\tthis._pendingSelectionEndIndex = -1;\n\t\t\t\tthis.textEditor.selectRange(beginIndex, endIndex);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._pendingSelectionBeginIndex = beginIndex;\n\t\t\t\tthis._pendingSelectionEndIndex = endIndex;\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Gets the font styles to be used to display the input's text when the\n\t\t * input's <code>currentState</code> property matches the specified\n\t\t * state value.\n\t\t *\n\t\t * <p>If font styles are not defined for a specific state, returns\n\t\t * <code>null</code>.</p>\n\t\t *\n\t\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t\t * @see #setFontStylesForState()\n\t\t * @see #style:fontStyles\n\t\t */\n\t\tpublic function getFontStylesForState(state:String):TextFormat\n\t\t{\n\t\t\tif(this._fontStylesSet === null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn this._fontStylesSet.getFormatForState(state);\n\t\t}\n\n\t\t/**\n\t\t * Sets the font styles to be used to display the input's text when the\n\t\t * input's <code>currentState</code> property matches the specified\n\t\t * state value.\n\t\t *\n\t\t * <p>If font styles are not defined for a specific state, the value of\n\t\t * the <code>fontStyles</code> property will be used instead.</p>\n\t\t *\n\t\t * <p>Note: if the text editor has been customized with advanced font\n\t\t * formatting, it may override the values specified with\n\t\t * <code>setFontStylesForState()</code> and properties like\n\t\t * <code>fontStyles</code> and <code>disabledFontStyles</code>.</p>\n\t\t *\n\t\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t\t * @see #style:fontStyles\n\t\t */\n\t\tpublic function setFontStylesForState(state:String, format:TextFormat):void\n\t\t{\n\t\t\tvar key:String = \"setFontStylesForState--\" + state;\n\t\t\tif(this.processStyleRestriction(key))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(key);\n\t\t\t}\n\t\t\tvar oldFormat:TextFormat = this._fontStylesSet.getFormatForState(state);\n\t\t\tif(oldFormat !== null)\n\t\t\t{\n\t\t\t\toldFormat.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._fontStylesSet.setFormatForState(state, format);\n\t\t\tif(format !== null)\n\t\t\t{\n\t\t\t\tformat.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Gets the font styles to be used to display the input's prompt when\n\t\t * the input's <code>currentState</code> property matches the specified\n\t\t * state value.\n\t\t *\n\t\t * <p>If prompt font styles are not defined for a specific state, returns\n\t\t * <code>null</code>.</p>\n\t\t *\n\t\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t\t * @see #setPromptFontStylesForState()\n\t\t * @see #promptFontStyles\n\t\t */\n\t\tpublic function getPromptFontStylesForState(state:String):TextFormat\n\t\t{\n\t\t\tif(this._promptFontStylesSet === null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn this._promptFontStylesSet.getFormatForState(state);\n\t\t}\n\n\t\t/**\n\t\t * Sets the font styles to be used to display the input's prompt when\n\t\t * the input's <code>currentState</code> property matches the specified\n\t\t * state value.\n\t\t *\n\t\t * <p>If prompt font styles are not defined for a specific state, the\n\t\t * value of the <code>promptFontStyles</code> property will be used instead.</p>\n\t\t *\n\t\t * <p>Note: if the text renderer has been customized with advanced font\n\t\t * formatting, it may override the values specified with\n\t\t * <code>setPromptFontStylesForState()</code> and properties like\n\t\t * <code>promptFontStyles</code> and <code>promptDisabledFontStyles</code>.</p>\n\t\t *\n\t\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t\t * @see #promptFontStyles\n\t\t */\n\t\tpublic function setPromptFontStylesForState(state:String, format:TextFormat):void\n\t\t{\n\t\t\tvar key:String = \"setPromptFontStylesForState--\" + state;\n\t\t\tif(this.processStyleRestriction(key))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(key);\n\t\t\t}\n\t\t\tvar oldFormat:TextFormat = this._promptFontStylesSet.getFormatForState(state);\n\t\t\tif(oldFormat !== null)\n\t\t\t{\n\t\t\t\toldFormat.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._promptFontStylesSet.setFormatForState(state, format);\n\t\t\tif(format !== null)\n\t\t\t{\n\t\t\t\tformat.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Gets the skin to be used by the text input when the input's\n\t\t * <code>currentState</code> property matches the specified state value.\n\t\t *\n\t\t * <p>If a skin is not defined for a specific state, returns\n\t\t * <code>null</code>.</p>\n\t\t *\n\t\t * @see #setSkinForState()\n\t\t * @see feathers.controls.TextInputState\n\t\t */\n\t\tpublic function getSkinForState(state:String):DisplayObject\n\t\t{\n\t\t\treturn this._stateToSkin[state] as DisplayObject;\n\t\t}\n\n\t\t/**\n\t\t * Sets the skin to be used by the text input when the input's\n\t\t * <code>currentState</code> property matches the specified state value.\n\t\t *\n\t\t * <p>If a skin is not defined for a specific state, the value of the\n\t\t * <code>backgroundSkin</code> property will be used instead.</p>\n\t\t *\n\t\t * @see #backgroundSkin\n\t\t * @see #getSkinForState()\n\t\t * @see feathers.controls.TextInputState\n\t\t */\n\t\tpublic function setSkinForState(state:String, skin:DisplayObject):void\n\t\t{\n\t\t\tvar key:String = \"setSkinForState--\" + state;\n\t\t\tif(this.processStyleRestriction(key))\n\t\t\t{\n\t\t\t\tif(skin !== null)\n\t\t\t\t{\n\t\t\t\t\tskin.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar oldSkin:DisplayObject = this._stateToSkin[state] as DisplayObject;\n\t\t\tif(oldSkin !== null &&\n\t\t\t\tthis.currentBackground === oldSkin)\n\t\t\t{\n\t\t\t\t//if this skin needs to be reused somewhere else, we need to\n\t\t\t\t//properly clean it up\n\t\t\t\tthis.removeCurrentBackground(oldSkin);\n\t\t\t\tthis.currentBackground = null;\n\t\t\t}\n\t\t\tif(skin !== null)\n\t\t\t{\n\t\t\t\tthis._stateToSkin[state] = skin;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdelete this._stateToSkin[state];\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * Gets the icon to be used by the text input when the input's\n\t\t * <code>currentState</code> property matches the specified state value.\n\t\t *\n\t\t * <p>If a icon is not defined for a specific state, returns\n\t\t * <code>null</code>.</p>\n\t\t *\n\t\t * @see #setIconForState()\n\t\t */\n\t\tpublic function getIconForState(state:String):DisplayObject\n\t\t{\n\t\t\treturn this._stateToIcon[state] as DisplayObject;\n\t\t}\n\n\t\t/**\n\t\t * Sets the icon to be used by the text input when the input's\n\t\t * <code>currentState</code> property matches the specified state value.\n\t\t *\n\t\t * <p>If an icon is not defined for a specific state, the value of the\n\t\t * <code>defaultIcon</code> property will be used instead.</p>\n\t\t *\n\t\t * @see #defaultIcon\n\t\t * @see #getIconForState()\n\t\t */\n\t\tpublic function setIconForState(state:String, icon:DisplayObject):void\n\t\t{\n\t\t\tvar key:String = \"setIconForState--\" + state;\n\t\t\tif(this.processStyleRestriction(key))\n\t\t\t{\n\t\t\t\tif(icon !== null)\n\t\t\t\t{\n\t\t\t\t\ticon.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(icon !== null)\n\t\t\t{\n\t\t\t\tthis._stateToIcon[state] = icon;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdelete this._stateToIcon[state];\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//we don't dispose it if the text input is the parent because it'll\n\t\t\t//already get disposed in super.dispose()\n\t\t\tif(this._backgroundSkin !== null && this._backgroundSkin.parent !== this)\n\t\t\t{\n\t\t\t\tthis._backgroundSkin.dispose();\n\t\t\t}\n\t\t\tfor(var state:String in this._stateToSkin)\n\t\t\t{\n\t\t\t\tvar skin:DisplayObject = this._stateToSkin[state] as DisplayObject;\n\t\t\t\tif(skin !== null && skin.parent !== this)\n\t\t\t\t{\n\t\t\t\t\tskin.dispose();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._defaultIcon !== null && this._defaultIcon.parent !== this)\n\t\t\t{\n\t\t\t\tthis._defaultIcon.dispose();\n\t\t\t}\n\t\t\tfor(state in this._stateToIcon)\n\t\t\t{\n\t\t\t\tvar icon:DisplayObject = this._stateToIcon[state] as DisplayObject;\n\t\t\t\tif(icon !== null && icon.parent !== this)\n\t\t\t\t{\n\t\t\t\t\ticon.dispose();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._fontStylesSet !== null)\n\t\t\t{\n\t\t\t\tthis._fontStylesSet.dispose();\n\t\t\t\tthis._fontStylesSet = null;\n\t\t\t}\n\t\t\tif(this._promptFontStylesSet !== null)\n\t\t\t{\n\t\t\t\tthis._promptFontStylesSet.dispose();\n\t\t\t\tthis._promptFontStylesSet = null;\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar skinInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SKIN);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\tvar textEditorInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_TEXT_EDITOR);\n\t\t\tvar promptFactoryInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_PROMPT_FACTORY);\n\t\t\tvar focusInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_FOCUS);\n\n\t\t\tif(textEditorInvalid)\n\t\t\t{\n\t\t\t\tthis.createTextEditor();\n\t\t\t}\n\n\t\t\tif(promptFactoryInvalid || (this._prompt !== null && !this.promptTextRenderer))\n\t\t\t{\n\t\t\t\tthis.createPrompt();\n\t\t\t}\n\n\t\t\tif(textEditorInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshTextEditorProperties();\n\t\t\t}\n\n\t\t\tif(promptFactoryInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshPromptProperties();\n\t\t\t}\n\n\t\t\tif(textEditorInvalid || dataInvalid)\n\t\t\t{\n\t\t\t\tvar oldIgnoreTextChanges:Boolean = this._ignoreTextChanges;\n\t\t\t\tthis._ignoreTextChanges = true;\n\t\t\t\tthis.textEditor.text = this._text;\n\t\t\t\tthis._ignoreTextChanges = oldIgnoreTextChanges;\n\t\t\t}\n\n\t\t\tif(this.promptTextRenderer)\n\t\t\t{\n\t\t\t\tif(promptFactoryInvalid || dataInvalid || stylesInvalid)\n\t\t\t\t{\n\t\t\t\t\tthis.promptTextRenderer.visible = this._prompt && this._text.length == 0;\n\t\t\t\t}\n\n\t\t\t\tif(promptFactoryInvalid || stateInvalid)\n\t\t\t\t{\n\t\t\t\t\tthis.promptTextRenderer.isEnabled = this._isEnabled;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(textEditorInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.textEditor.isEnabled = this._isEnabled;\n\t\t\t\tif(!this._isEnabled && Mouse.supportsNativeCursor && this._oldMouseCursor)\n\t\t\t\t{\n\t\t\t\t\tMouse.cursor = this._oldMouseCursor;\n\t\t\t\t\tthis._oldMouseCursor = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(stateInvalid || skinInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshBackgroundSkin();\n\t\t\t}\n\t\t\tif(stateInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshIcon();\n\t\t\t}\n\n\t\t\tsizeInvalid = this.autoSizeIfNeeded() || sizeInvalid;\n\n\t\t\tthis.layoutChildren();\n\n\t\t\t//the state might not change if the text input has focus when\n\t\t\t//the error string changes, so check for styles too!\n\t\t\tif(stateInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshErrorCallout();\n\t\t\t}\n\n\t\t\tif(sizeInvalid || focusInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshFocusIndicator();\n\t\t\t}\n\n\t\t\tthis.doPendingActions();\n\t\t}\n\n\t\t/**\n\t\t * If the component's dimensions have not been set explicitly, it will\n\t\t * measure its content and determine an ideal size for itself. If the\n\t\t * <code>explicitWidth</code> or <code>explicitHeight</code> member\n\t\t * variables are set, those value will be used without additional\n\t\t * measurement. If one is set, but not the other, the dimension with the\n\t\t * explicit value will not be measured, but the other non-explicit\n\t\t * dimension will still need measurement.\n\t\t *\n\t\t * <p>Calls <code>saveMeasurements()</code> to set up the\n\t\t * <code>actualWidth</code> and <code>actualHeight</code> member\n\t\t * variables used for layout.</p>\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t */\n\t\tprotected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvar measureBackground:IMeasureDisplayObject = this.currentBackground as IMeasureDisplayObject;\n\t\t\tresetFluidChildDimensionsForMeasurement(this.currentBackground,\n\t\t\t\tthis._explicitWidth, this._explicitHeight,\n\t\t\t\tthis._explicitMinWidth, this._explicitMinHeight,\n\t\t\t\tthis._explicitMaxWidth, this._explicitMaxHeight,\n\t\t\t\tthis._explicitBackgroundWidth, this._explicitBackgroundHeight,\n\t\t\t\tthis._explicitBackgroundMinWidth, this._explicitBackgroundMinHeight,\n\t\t\t\tthis._explicitBackgroundMaxWidth, this._explicitBackgroundMaxHeight);\n\t\t\tif(this.currentBackground is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.currentBackground).validate();\n\t\t\t}\n\t\t\tif(this.currentIcon is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.currentIcon).validate();\n\t\t\t}\n\n\t\t\tvar measuredContentWidth:Number = 0;\n\t\t\tvar measuredContentHeight:Number = 0;\n\n\t\t\t//if the typicalText is specified, the dimensions of the text editor\n\t\t\t//can affect the final dimensions. otherwise, the background skin or\n\t\t\t//prompt should be used for measurement.\n\t\t\tif(this._typicalText !== null)\n\t\t\t{\n\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\tvar oldTextEditorWidth:Number = this.textEditor.width;\n\t\t\t\tvar oldTextEditorHeight:Number = this.textEditor.height;\n\t\t\t\tvar oldIgnoreTextChanges:Boolean = this._ignoreTextChanges;\n\t\t\t\tthis._ignoreTextChanges = true;\n\t\t\t\tthis.textEditor.setSize(NaN, NaN);\n\t\t\t\tthis.textEditor.text = this._typicalText;\n\t\t\t\tthis.textEditor.measureText(point);\n\t\t\t\tthis.textEditor.text = this._text;\n\t\t\t\tthis._ignoreTextChanges = oldIgnoreTextChanges;\n\t\t\t\tmeasuredContentWidth = point.x;\n\t\t\t\tmeasuredContentHeight = point.y;\n\t\t\t\tPool.putPoint(point);\n\t\t\t}\n\t\t\tif(this._prompt !== null)\n\t\t\t{\n\t\t\t\tpoint = Pool.getPoint();\n\t\t\t\tthis.promptTextRenderer.setSize(NaN, NaN);\n\t\t\t\tthis.promptTextRenderer.measureText(point);\n\t\t\t\tif(point.x > measuredContentWidth)\n\t\t\t\t{\n\t\t\t\t\tmeasuredContentWidth = point.x;\n\t\t\t\t}\n\t\t\t\tif(point.y > measuredContentHeight)\n\t\t\t\t{\n\t\t\t\t\tmeasuredContentHeight = point.y;\n\t\t\t\t}\n\t\t\t\tPool.putPoint(point);\n\t\t\t}\n\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tnewWidth = measuredContentWidth;\n\t\t\t\tif(this._originalIconWidth === this._originalIconWidth) //!isNaN\n\t\t\t\t{\n\t\t\t\t\tnewWidth += this._originalIconWidth + this._gap;\n\t\t\t\t}\n\t\t\t\tnewWidth += this._paddingLeft + this._paddingRight;\n\t\t\t\tif(this.currentBackground !== null &&\n\t\t\t\t\tthis.currentBackground.width > newWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this.currentBackground.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tnewHeight = measuredContentHeight;\n\t\t\t\tif(this._originalIconHeight === this._originalIconHeight && //!isNaN\n\t\t\t\t\tthis._originalIconHeight > newHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this._originalIconHeight;\n\t\t\t\t}\n\t\t\t\tnewHeight += this._paddingTop + this._paddingBottom;\n\t\t\t\tif(this.currentBackground !== null &&\n\t\t\t\t\tthis.currentBackground.height > newHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this.currentBackground.height;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tnewMinWidth = measuredContentWidth;\n\t\t\t\tif(this.currentIcon is IFeathersControl)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth += IFeathersControl(this.currentIcon).minWidth + this._gap;\n\t\t\t\t}\n\t\t\t\telse if(this._originalIconWidth === this._originalIconWidth)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth += this._originalIconWidth + this._gap;\n\t\t\t\t}\n\t\t\t\tnewMinWidth += this._paddingLeft + this._paddingRight;\n\t\t\t\tvar backgroundMinWidth:Number = 0;\n\t\t\t\tif(measureBackground !== null)\n\t\t\t\t{\n\t\t\t\t\tbackgroundMinWidth = measureBackground.minWidth;\n\t\t\t\t}\n\t\t\t\telse if(this.currentBackground !== null)\n\t\t\t\t{\n\t\t\t\t\tbackgroundMinWidth = this._explicitBackgroundMinWidth;\n\t\t\t\t}\n\t\t\t\tif(backgroundMinWidth > newMinWidth)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = backgroundMinWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tnewMinHeight = measuredContentHeight;\n\t\t\t\tif(this.currentIcon is IFeathersControl)\n\t\t\t\t{\n\t\t\t\t\tvar iconMinHeight:Number = IFeathersControl(this.currentIcon).minHeight;\n\t\t\t\t\tif(iconMinHeight > newMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = iconMinHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(this._originalIconHeight === this._originalIconHeight && //!isNaN\n\t\t\t\t\tthis._originalIconHeight > newMinHeight)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = this._originalIconHeight;\n\t\t\t\t}\n\t\t\t\tnewMinHeight += this._paddingTop + this._paddingBottom;\n\t\t\t\tvar backgroundMinHeight:Number = 0;\n\t\t\t\tif(measureBackground !== null)\n\t\t\t\t{\n\t\t\t\t\tbackgroundMinHeight = measureBackground.minHeight;\n\t\t\t\t}\n\t\t\t\telse if(this.currentBackground !== null)\n\t\t\t\t{\n\t\t\t\t\tbackgroundMinHeight = this._explicitBackgroundMinHeight;\n\t\t\t\t}\n\t\t\t\tif(backgroundMinHeight > newMinHeight)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = backgroundMinHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar isMultiline:Boolean = this.textEditor is IMultilineTextEditor && IMultilineTextEditor(this.textEditor).multiline;\n\t\t\tif(this._typicalText !== null && (this._verticalAlign == VerticalAlign.JUSTIFY || isMultiline))\n\t\t\t{\n\t\t\t\tthis.textEditor.width = oldTextEditorWidth;\n\t\t\t\tthis.textEditor.height = oldTextEditorHeight;\n\t\t\t}\n\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>textEditor</code> sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #textEditor\n\t\t * @see #textEditorFactory\n\t\t */\n\t\tprotected function createTextEditor():void\n\t\t{\n\t\t\tif(this.textEditor)\n\t\t\t{\n\t\t\t\tthis.removeChild(DisplayObject(this.textEditor), true);\n\t\t\t\tthis.textEditor.removeEventListener(Event.CHANGE, textEditor_changeHandler);\n\t\t\t\tthis.textEditor.removeEventListener(FeathersEventType.ENTER, textEditor_enterHandler);\n\t\t\t\tthis.textEditor.removeEventListener(FeathersEventType.FOCUS_IN, textEditor_focusInHandler);\n\t\t\t\tthis.textEditor.removeEventListener(FeathersEventType.FOCUS_OUT, textEditor_focusOutHandler);\n\t\t\t\tthis.textEditor = null;\n\t\t\t}\n\n\t\t\tvar factory:Function = this._textEditorFactory != null ? this._textEditorFactory : FeathersControl.defaultTextEditorFactory;\n\t\t\tthis.textEditor = ITextEditor(factory());\n\t\t\tvar textEditorStyleName:String = this._customTextEditorStyleName != null ? this._customTextEditorStyleName : this.textEditorStyleName;\n\t\t\tthis.textEditor.styleNameList.add(textEditorStyleName);\n\t\t\tif(this.textEditor is IStateObserver)\n\t\t\t{\n\t\t\t\tIStateObserver(this.textEditor).stateContext = this;\n\t\t\t}\n\t\t\tthis.textEditor.addEventListener(Event.CHANGE, textEditor_changeHandler);\n\t\t\tthis.textEditor.addEventListener(FeathersEventType.ENTER, textEditor_enterHandler);\n\t\t\tthis.textEditor.addEventListener(FeathersEventType.FOCUS_IN, textEditor_focusInHandler);\n\t\t\tthis.textEditor.addEventListener(FeathersEventType.FOCUS_OUT, textEditor_focusOutHandler);\n\t\t\tthis.addChild(DisplayObject(this.textEditor));\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createPrompt():void\n\t\t{\n\t\t\tif(this.promptTextRenderer)\n\t\t\t{\n\t\t\t\tthis.removeChild(DisplayObject(this.promptTextRenderer), true);\n\t\t\t\tthis.promptTextRenderer = null;\n\t\t\t}\n\n\t\t\tif(this._prompt === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar factory:Function = this._promptFactory != null ? this._promptFactory : FeathersControl.defaultTextRendererFactory;\n\t\t\tthis.promptTextRenderer = ITextRenderer(factory());\n\t\t\tvar promptStyleName:String = this._customPromptStyleName != null ? this._customPromptStyleName : this.promptStyleName;\n\t\t\tthis.promptTextRenderer.styleNameList.add(promptStyleName);\n\t\t\tthis.addChild(DisplayObject(this.promptTextRenderer));\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createErrorCallout():void\n\t\t{\n\t\t\tif(this.callout !== null)\n\t\t\t{\n\t\t\t\tthis.callout.removeFromParent(true);\n\t\t\t\tthis.callout = null;\n\t\t\t}\n\n\t\t\tif(this._errorString === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tvar factory:Function = this._errorCalloutFactory != null ? this._errorCalloutFactory : defaultErrorCalloutFactory;\n\t\t\tthis.callout = TextCallout(factory());\n\t\t\tvar errorCalloutStyleName:String = this._customErrorCalloutStyleName != null ? this._customErrorCalloutStyleName : this.errorCalloutStyleName;\n\t\t\tthis.callout.styleNameList.add(errorCalloutStyleName);\n\t\t\tthis.callout.closeOnKeys = null;\n\t\t\tthis.callout.closeOnTouchBeganOutside = false;\n\t\t\tthis.callout.closeOnTouchEndedOutside = false;\n\t\t\tthis.callout.touchable = false;\n\t\t\tthis.callout.origin = this;\n\t\t\tPopUpManager.addPopUp(this.callout, false, false);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function changeState(state:String):void\n\t\t{\n\t\t\tif(this._currentState === state)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._currentState = state;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STATE);\n\t\t\tthis.dispatchEventWith(FeathersEventType.STATE_CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function doPendingActions():void\n\t\t{\n\t\t\tif(this._isWaitingToSetFocus)\n\t\t\t{\n\t\t\t\tthis._isWaitingToSetFocus = false;\n\t\t\t\tif(!this._textEditorHasFocus)\n\t\t\t\t{\n\t\t\t\t\tif((this._isEditable || this._isSelectable) &&\n\t\t\t\t\t\tthis._pendingSelectionBeginIndex < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._pendingSelectionBeginIndex = 0;\n\t\t\t\t\t\tthis._pendingSelectionEndIndex = this._text.length;\n\t\t\t\t\t}\n\t\t\t\t\tthis.textEditor.setFocus();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._pendingSelectionBeginIndex >= 0)\n\t\t\t{\n\t\t\t\tvar startIndex:int = this._pendingSelectionBeginIndex;\n\t\t\t\tvar endIndex:int = this._pendingSelectionEndIndex;\n\t\t\t\tthis._pendingSelectionBeginIndex = -1;\n\t\t\t\tthis._pendingSelectionEndIndex = -1;\n\t\t\t\tif(endIndex >= 0)\n\t\t\t\t{\n\t\t\t\t\tvar textLength:int = this._text.length;\n\t\t\t\t\tif(endIndex > textLength)\n\t\t\t\t\t{\n\t\t\t\t\t\tendIndex = textLength;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.selectRange(startIndex, endIndex);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshTextEditorProperties():void\n\t\t{\n\t\t\tthis.textEditor.displayAsPassword = this._displayAsPassword;\n\t\t\tthis.textEditor.maxChars = this._maxChars;\n\t\t\tthis.textEditor.restrict = this._restrict;\n\t\t\tthis.textEditor.isEditable = this._isEditable;\n\t\t\tthis.textEditor.isSelectable = this._isSelectable;\n\t\t\tthis.textEditor.fontStyles = this._fontStylesSet;\n\t\t\tfor(var propertyName:String in this._textEditorProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._textEditorProperties[propertyName];\n\t\t\t\tthis.textEditor[propertyName] = propertyValue;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshPromptProperties():void\n\t\t{\n\t\t\tif(!this.promptTextRenderer)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.promptTextRenderer.text = this._prompt;\n\t\t\tthis.promptTextRenderer.fontStyles = this._promptFontStylesSet;\n\t\t\tfor(var propertyName:String in this._promptProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._promptProperties[propertyName];\n\t\t\t\tthis.promptTextRenderer[propertyName] = propertyValue;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Sets the <code>currentBackground</code> property.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t */\n\t\tprotected function refreshBackgroundSkin():void\n\t\t{\n\t\t\tvar oldSkin:DisplayObject = this.currentBackground;\n\t\t\tthis.currentBackground = this.getCurrentSkin();\n\t\t\tif(this.currentBackground !== oldSkin)\n\t\t\t{\n\t\t\t\tthis.removeCurrentBackground(oldSkin);\n\t\t\t\tif(this.currentBackground !== null)\n\t\t\t\t{\n\t\t\t\t\tif(this.currentBackground is IStateObserver)\n\t\t\t\t\t{\n\t\t\t\t\t\tIStateObserver(this.currentBackground).stateContext = this;\n\t\t\t\t\t}\n\t\t\t\t\tif(this.currentBackground is IFeathersControl)\n\t\t\t\t\t{\n\t\t\t\t\t\tIFeathersControl(this.currentBackground).initializeNow();\n\t\t\t\t\t}\n\t\t\t\t\tif(this.currentBackground is IMeasureDisplayObject)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar measureSkin:IMeasureDisplayObject = IMeasureDisplayObject(this.currentBackground);\n\t\t\t\t\t\tthis._explicitBackgroundWidth = measureSkin.explicitWidth;\n\t\t\t\t\t\tthis._explicitBackgroundHeight = measureSkin.explicitHeight;\n\t\t\t\t\t\tthis._explicitBackgroundMinWidth = measureSkin.explicitMinWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMinHeight = measureSkin.explicitMinHeight;\n\t\t\t\t\t\tthis._explicitBackgroundMaxWidth = measureSkin.explicitMaxWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMaxHeight = measureSkin.explicitMaxHeight;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._explicitBackgroundWidth = this.currentBackground.width;\n\t\t\t\t\t\tthis._explicitBackgroundHeight = this.currentBackground.height;\n\t\t\t\t\t\tthis._explicitBackgroundMinWidth = this._explicitBackgroundWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMinHeight = this._explicitBackgroundHeight;\n\t\t\t\t\t\tthis._explicitBackgroundMaxWidth = this._explicitBackgroundWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMaxHeight = this._explicitBackgroundHeight;\n\t\t\t\t\t}\n\t\t\t\t\tthis.addChildAt(this.currentBackground, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function removeCurrentBackground(skin:DisplayObject):void\n\t\t{\n\t\t\tif(skin === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(skin is IStateObserver)\n\t\t\t{\n\t\t\t\tIStateObserver(skin).stateContext = null;\n\t\t\t}\n\t\t\tif(skin.parent === this)\n\t\t\t{\n\t\t\t\t//we need to restore these values so that they won't be lost the\n\t\t\t\t//next time that this skin is used for measurement\n\t\t\t\tskin.width = this._explicitBackgroundWidth;\n\t\t\t\tskin.height = this._explicitBackgroundHeight;\n\t\t\t\tif(skin is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar measureSkin:IMeasureDisplayObject = IMeasureDisplayObject(skin);\n\t\t\t\t\tmeasureSkin.minWidth = this._explicitBackgroundMinWidth;\n\t\t\t\t\tmeasureSkin.minHeight = this._explicitBackgroundMinHeight;\n\t\t\t\t\tmeasureSkin.maxWidth = this._explicitBackgroundMaxWidth;\n\t\t\t\t\tmeasureSkin.maxHeight = this._explicitBackgroundMaxHeight;\n\t\t\t\t}\n\t\t\t\tskin.removeFromParent(false);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Sets the <code>currentIcon</code> property.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t */\n\t\tprotected function refreshIcon():void\n\t\t{\n\t\t\tvar oldIcon:DisplayObject = this.currentIcon;\n\t\t\tthis.currentIcon = this.getCurrentIcon();\n\t\t\tif(this.currentIcon is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this.currentIcon).isEnabled = this._isEnabled;\n\t\t\t}\n\t\t\tif(this.currentIcon !== oldIcon)\n\t\t\t{\n\t\t\t\tif(oldIcon)\n\t\t\t\t{\n\t\t\t\t\tif(oldIcon is IStateObserver)\n\t\t\t\t\t{\n\t\t\t\t\t\tIStateObserver(oldIcon).stateContext = null;\n\t\t\t\t\t}\n\t\t\t\t\tthis.removeChild(oldIcon, false);\n\t\t\t\t}\n\t\t\t\tif(this.currentIcon)\n\t\t\t\t{\n\t\t\t\t\tif(this.currentIcon is IStateObserver)\n\t\t\t\t\t{\n\t\t\t\t\t\tIStateObserver(this.currentIcon).stateContext = this;\n\t\t\t\t\t}\n\t\t\t\t\t//we want the icon to appear below the text editor\n\t\t\t\t\tvar index:int = this.getChildIndex(DisplayObject(this.textEditor));\n\t\t\t\t\tthis.addChildAt(this.currentIcon, index);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this.currentIcon &&\n\t\t\t\t(this._originalIconWidth !== this._originalIconWidth || //isNaN\n\t\t\t\tthis._originalIconHeight !== this._originalIconHeight)) //isNaN\n\t\t\t{\n\t\t\t\tif(this.currentIcon is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this.currentIcon).validate();\n\t\t\t\t}\n\t\t\t\tthis._originalIconWidth = this.currentIcon.width;\n\t\t\t\tthis._originalIconHeight = this.currentIcon.height;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getCurrentSkin():DisplayObject\n\t\t{\n\t\t\tvar result:DisplayObject = this._stateToSkin[this._currentState] as DisplayObject;\n\t\t\tif(result !== null)\n\t\t\t{\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\treturn this._backgroundSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getCurrentIcon():DisplayObject\n\t\t{\n\t\t\tvar result:DisplayObject = this._stateToIcon[this._currentState] as DisplayObject;\n\t\t\tif(result !== null)\n\t\t\t{\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\treturn this._defaultIcon;\n\t\t}\n\n\t\t/**\n\t\t * Positions and sizes the text input's children.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t */\n\t\tprotected function layoutChildren():void\n\t\t{\n\t\t\tif(this.currentBackground !== null)\n\t\t\t{\n\t\t\t\tthis.currentBackground.visible = true;\n\t\t\t\tthis.currentBackground.touchable = true;\n\t\t\t\tthis.currentBackground.width = this.actualWidth;\n\t\t\t\tthis.currentBackground.height = this.actualHeight;\n\t\t\t}\n\n\t\t\tif(this.currentIcon is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.currentIcon).validate();\n\t\t\t}\n\n\t\t\tif(this.currentIcon !== null)\n\t\t\t{\n\t\t\t\tif(this._iconPosition === RelativePosition.RIGHT)\n\t\t\t\t{\n\t\t\t\t\tthis.currentIcon.x = this.actualWidth - this.currentIcon.width - this._paddingRight;\n\t\t\t\t\tthis.textEditor.x = this._paddingLeft;\n\t\t\t\t\tif(this.promptTextRenderer !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.promptTextRenderer.x = this._paddingLeft;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse //left\n\t\t\t\t{\n\t\t\t\t\tthis.currentIcon.x = this._paddingLeft;\n\t\t\t\t\tthis.textEditor.x = this.currentIcon.x + this.currentIcon.width + this._gap;\n\t\t\t\t\tif(this.promptTextRenderer !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.promptTextRenderer.x = this.currentIcon.x + this.currentIcon.width + this._gap;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.textEditor.x = this._paddingLeft;\n\t\t\t\tif(this.promptTextRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\tthis.promptTextRenderer.x = this._paddingLeft;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar textEditorWidth:Number = this.actualWidth - this._paddingRight - this.textEditor.x;\n\t\t\tif(this.currentIcon !== null && this._iconPosition === RelativePosition.RIGHT)\n\t\t\t{\n\t\t\t\ttextEditorWidth -= (this.currentIcon.width + this._gap);\n\t\t\t}\n\t\t\tthis.textEditor.width = textEditorWidth;\n\t\t\tif(this.promptTextRenderer !== null)\n\t\t\t{\n\t\t\t\tthis.promptTextRenderer.width = textEditorWidth;\n\t\t\t}\n\n\t\t\tvar isMultiline:Boolean = this.textEditor is IMultilineTextEditor && IMultilineTextEditor(this.textEditor).multiline;\n\t\t\tif(isMultiline || this._verticalAlign === VerticalAlign.JUSTIFY)\n\t\t\t{\n\t\t\t\t//multiline is treated the same as justify\n\t\t\t\tthis.textEditor.height = this.actualHeight - this._paddingTop - this._paddingBottom;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//clear the height and auto-size instead\n\t\t\t\tthis.textEditor.height = NaN;\n\t\t\t}\n\t\t\tthis.textEditor.validate();\n\t\t\tif(this.promptTextRenderer !== null)\n\t\t\t{\n\t\t\t\tthis.promptTextRenderer.validate();\n\t\t\t}\n\n\t\t\tvar biggerHeight:Number = this.textEditor.height;\n\t\t\tvar biggerBaseline:Number = this.textEditor.baseline;\n\t\t\tif(this.promptTextRenderer !== null)\n\t\t\t{\n\t\t\t\tvar promptBaseline:Number = this.promptTextRenderer.baseline;\n\t\t\t\tvar promptHeight:Number = this.promptTextRenderer.height;\n\t\t\t\tif(promptBaseline > biggerBaseline)\n\t\t\t\t{\n\t\t\t\t\tbiggerBaseline = promptBaseline;\n\t\t\t\t}\n\t\t\t\tif(promptHeight > biggerHeight)\n\t\t\t\t{\n\t\t\t\t\tbiggerHeight = promptHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(isMultiline)\n\t\t\t{\n\t\t\t\tthis.textEditor.y = this._paddingTop + biggerBaseline - this.textEditor.baseline;\n\t\t\t\tif(this.promptTextRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\tthis.promptTextRenderer.y = this._paddingTop + biggerBaseline - promptBaseline;\n\t\t\t\t\tthis.promptTextRenderer.height = this.actualHeight - this.promptTextRenderer.y - this._paddingBottom;\n\t\t\t\t}\n\t\t\t\tif(this.currentIcon !== null)\n\t\t\t\t{\n\t\t\t\t\tthis.currentIcon.y = this._paddingTop;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tswitch(this._verticalAlign)\n\t\t\t\t{\n\t\t\t\t\tcase VerticalAlign.JUSTIFY:\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.textEditor.y = this._paddingTop + biggerBaseline - this.textEditor.baseline;\n\t\t\t\t\t\tif(this.promptTextRenderer)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.promptTextRenderer.y = this._paddingTop + biggerBaseline - promptBaseline;\n\t\t\t\t\t\t\tthis.promptTextRenderer.height = this.actualHeight - this.promptTextRenderer.y - this._paddingBottom;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(this.currentIcon)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.currentIcon.y = this._paddingTop;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase VerticalAlign.TOP:\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.textEditor.y = this._paddingTop + biggerBaseline - this.textEditor.baseline;\n\t\t\t\t\t\tif(this.promptTextRenderer)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.promptTextRenderer.y = this._paddingTop + biggerBaseline - promptBaseline;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(this.currentIcon)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.currentIcon.y = this._paddingTop;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase VerticalAlign.BOTTOM:\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.textEditor.y = this.actualHeight - this._paddingBottom - biggerHeight + biggerBaseline - this.textEditor.baseline;\n\t\t\t\t\t\tif(this.promptTextRenderer)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.promptTextRenderer.y = this.actualHeight - this._paddingBottom - biggerHeight + biggerBaseline - promptBaseline;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(this.currentIcon)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.currentIcon.y = this.actualHeight - this._paddingBottom - this.currentIcon.height;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tdefault: //middle\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.textEditor.y = biggerBaseline - this.textEditor.baseline + this._paddingTop + Math.round((this.actualHeight - this._paddingTop - this._paddingBottom - biggerHeight) / 2);\n\t\t\t\t\t\tif(this.promptTextRenderer)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.promptTextRenderer.y = biggerBaseline - promptBaseline + this._paddingTop + Math.round((this.actualHeight - this._paddingTop - this._paddingBottom - biggerHeight) / 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(this.currentIcon)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.currentIcon.y = this._paddingTop + Math.round((this.actualHeight - this._paddingTop - this._paddingBottom - this.currentIcon.height) / 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function setFocusOnTextEditorWithTouch(touch:Touch):void\n\t\t{\n\t\t\tif(!this.isFocusEnabled)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar point:Point = Pool.getPoint();\n\t\t\ttouch.getLocation(this.stage, point);\n\t\t\tvar isInBounds:Boolean = this.contains(this.stage.hitTest(point));\n\t\t\t//if the focus manager is enabled, _hasFocus will determine if we\n\t\t\t//pass focus to the text editor.\n\t\t\t//if there is no focus manager, then we check if the touch is in\n\t\t\t//the bounds of the text input.\n\t\t\tif((this._hasFocus || isInBounds) && !this._textEditorHasFocus)\n\t\t\t{\n\t\t\t\tthis.textEditor.globalToLocal(point, point);\n\t\t\t\tthis._isWaitingToSetFocus = false;\n\t\t\t\tthis.textEditor.setFocus(point);\n\t\t\t}\n\t\t\tPool.putPoint(point);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshState():void\n\t\t{\n\t\t\tif(this._isEnabled)\n\t\t\t{\n\t\t\t\t//this component can have focus while its text editor does not\n\t\t\t\t//have focus. StageText, in particular, can't receive focus\n\t\t\t\t//when its enabled property is false, but we still want to show\n\t\t\t\t//that the input is focused.\n\t\t\t\tif(this._textEditorHasFocus || this._hasFocus)\n\t\t\t\t{\n\t\t\t\t\tthis.changeState(TextInputState.FOCUSED);\n\t\t\t\t}\n\t\t\t\telse if(this._errorString !== null)\n\t\t\t\t{\n\t\t\t\t\tthis.changeState(TextInputState.ERROR);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.changeState(TextInputState.ENABLED);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.changeState(TextInputState.DISABLED);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshErrorCallout():void\n\t\t{\n\t\t\tif(this._textEditorHasFocus && this.callout === null &&\n\t\t\t\tthis._errorString !== null && this._errorString.length > 0)\n\t\t\t{\n\t\t\t\tthis.createErrorCallout();\n\t\t\t}\n\t\t\telse if(this.callout !== null &&\n\t\t\t\t(!this._textEditorHasFocus || this._errorString === null || this._errorString.length == 0))\n\t\t\t{\n\t\t\t\tthis.callout.removeFromParent(true);\n\t\t\t\tthis.callout = null;\n\t\t\t}\n\t\t\tif(this.callout !== null)\n\t\t\t{\n\t\t\t\tthis.callout.text = this._errorString;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function childProperties_onChange(proxy:PropertyProxy, name:Object):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textInput_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tif(!this._focusManager && this._textEditorHasFocus)\n\t\t\t{\n\t\t\t\tthis.clearFocus();\n\t\t\t}\n\t\t\tthis._textEditorHasFocus = false;\n\t\t\tthis._isWaitingToSetFocus = false;\n\t\t\tthis._touchPointID = -1;\n\t\t\tif(Mouse.supportsNativeCursor && this._oldMouseCursor)\n\t\t\t{\n\t\t\t\tMouse.cursor = this._oldMouseCursor;\n\t\t\t\tthis._oldMouseCursor = null;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textInput_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this._touchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(this, TouchPhase.ENDED, this._touchPointID);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\ttouch.getLocation(this.stage, point);\n\t\t\t\tvar isInBounds:Boolean = this.contains(this.stage.hitTest(point));\n\t\t\t\tPool.putPoint(point);\n\t\t\t\tif(!isInBounds)\n\t\t\t\t{\n\t\t\t\t\t//if not in bounds on TouchPhase.ENDED, there won't be a\n\t\t\t\t\t//hover end event, so we need to clear the mouse cursor\n\t\t\t\t\tif(Mouse.supportsNativeCursor && this._oldMouseCursor)\n\t\t\t\t\t{\n\t\t\t\t\t\tMouse.cursor = this._oldMouseCursor;\n\t\t\t\t\t\tthis._oldMouseCursor = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t\tif(this.textEditor.setTouchFocusOnEndedPhase)\n\t\t\t\t{\n\t\t\t\t\tthis.setFocusOnTextEditorWithTouch(touch);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(this, TouchPhase.BEGAN);\n\t\t\t\tif(touch)\n\t\t\t\t{\n\t\t\t\t\tthis._touchPointID = touch.id;\n\t\t\t\t\tif(!this.textEditor.setTouchFocusOnEndedPhase)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.setFocusOnTextEditorWithTouch(touch);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttouch = event.getTouch(this, TouchPhase.HOVER);\n\t\t\t\tif(touch)\n\t\t\t\t{\n\t\t\t\t\tif((this._isEditable || this._isSelectable) &&\n\t\t\t\t\t\tMouse.supportsNativeCursor && !this._oldMouseCursor)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._oldMouseCursor = Mouse.cursor;\n\t\t\t\t\t\tMouse.cursor = MouseCursor.IBEAM;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t//end hover\n\t\t\t\tif(Mouse.supportsNativeCursor && this._oldMouseCursor)\n\t\t\t\t{\n\t\t\t\t\tMouse.cursor = this._oldMouseCursor;\n\t\t\t\t\tthis._oldMouseCursor = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function focusInHandler(event:Event):void\n\t\t{\n\t\t\tif(!this._focusManager)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsuper.focusInHandler(event);\n\t\t\t//in some cases the text editor cannot receive focus, so it won't\n\t\t\t//dispatch an event. we need to detect the focused state using the\n\t\t\t//_hasFocus variable\n\t\t\tthis.refreshState();\n\t\t\tthis.setFocus();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function focusOutHandler(event:Event):void\n\t\t{\n\t\t\tif(!this._focusManager)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsuper.focusOutHandler(event);\n\t\t\t//similar to above, we refresh the state based on the _hasFocus\n\t\t\t//because the text editor may not be able to receive focus\n\t\t\tthis.refreshState();\n\t\t\tthis.textEditor.clearFocus();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textEditor_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreTextChanges)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.text = this.textEditor.text;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textEditor_enterHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(FeathersEventType.ENTER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textEditor_focusInHandler(event:Event):void\n\t\t{\n\t\t\tif(!this.visible)\n\t\t\t{\n\t\t\t\tthis.textEditor.clearFocus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textEditorHasFocus = true;\n\t\t\tthis.refreshState();\n\t\t\tthis.refreshErrorCallout();\n\t\t\tif(this._focusManager !== null && this.isFocusEnabled)\n\t\t\t{\n\t\t\t\tif(this._focusManager.focus !== this)\n\t\t\t\t{\n\t\t\t\t\t//if setFocus() was called manually, we need to notify the focus\n\t\t\t\t\t//manager (unless isFocusEnabled is false).\n\t\t\t\t\t//if the focus manager already knows that we have focus, it will\n\t\t\t\t\t//simply return without doing anything.\n\t\t\t\t\tthis._focusManager.focus = this;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.FOCUS_IN);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textEditor_focusOutHandler(event:Event):void\n\t\t{\n\t\t\tthis._textEditorHasFocus = false;\n\t\t\tthis.refreshState();\n\t\t\tthis.refreshErrorCallout();\n\t\t\tif(this._focusManager !== null && this.isFocusEnabled)\n\t\t\t{\n\t\t\t\tif(this._focusManager.focus === this)\n\t\t\t\t{\n\t\t\t\t\t//if clearFocus() was called manually, we need to notify the\n\t\t\t\t\t//focus manager if it still thinks we have focus.\n\t\t\t\t\tthis._focusManager.focus = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.FOCUS_OUT);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function fontStyles_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/TextInputState.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\t/**\n\t * States for text input components.\n\t *\n\t * @see feathers.controls.TextInput\n\t * @see feathers.controls.TextArea\n\t * @see feathers.controls.AutoComplete\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class TextInputState\n\t{\n\t\t/**\n\t\t * The default state, when the input is enabled.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const ENABLED:String = \"enabled\";\n\n\t\t/**\n\t\t * The disabled state, when the input is not enabled.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const DISABLED:String = \"disabled\";\n\n\t\t/**\n\t\t * The focused state, when the input is currently in focus and the user\n\t\t * can interact with it.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const FOCUSED:String = \"focused\";\n\n\t\t/**\n\t\t * The state when the input has an error string.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const ERROR:String = \"error\";\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/Toast.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IMeasureDisplayObject;\n\timport feathers.core.ITextRenderer;\n\timport feathers.core.IValidating;\n\timport feathers.core.PopUpManager;\n\timport feathers.data.IListCollection;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.RelativePosition;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.motion.Fade;\n\timport feathers.motion.effectClasses.IEffectContext;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.system.DeviceCapabilities;\n\timport feathers.text.FontStylesSet;\n\timport feathers.utils.skins.resetFluidChildDimensionsForMeasurement;\n\n\timport flash.geom.Point;\n\timport flash.utils.Dictionary;\n\timport flash.utils.getTimer;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.display.DisplayObjectContainer;\n\timport starling.events.Event;\n\timport starling.text.TextFormat;\n\timport starling.utils.Pool;\n\n\t/**\n\t * The primary background to display behind the toast's content.\n\t *\n\t * <p>In the following example, the toast's background is set to an image:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toast.backgroundSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t */\n\t[Style(name=\"backgroundSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * A style name to add to the toast's actions button group sub-component.\n\t * Typically used by a theme to provide different styles to different toasts.\n\t *\n\t * <p>In the following example, a custom actions button group style name is\n\t * passed to the toast:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toast.customActionsStyleName = \"my-custom-toast-actions\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( ButtonGroup ).setFunctionForStyleName( \"my-custom-toast-actions\", setCustomToastActionsStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_ACTIONS\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #actionsFactory\n\t */\n\t[Style(name=\"customActionsStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to the toast's message text renderer\n\t * sub-component. Typically used by a theme to provide different styles\n\t * to different toasts.\n\t *\n\t * <p>In the following example, a custom message style name is passed to\n\t * the toast:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toast.customMessageStyleName = \"my-custom-toast-message\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( BitmapFontTextRenderer ).setFunctionForStyleName( \"my-custom-toast-message\", setCustomToastMessageStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_MESSAGE\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #messageFactory\n\t */\n\t[Style(name=\"customLabelStyleName\",type=\"String\")]\n\n\t/**\n\t * The font styles used to display the toast's message when the button is\n\t * disabled.\n\t *\n\t * <p>In the following example, the disabled font styles are customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toast.disabledFontStyles = new TextFormat( \"Helvetica\", 20, 0x999999 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>messageFactory</code> to set more advanced styles on the\n\t * text renderer.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:fontStyles\n\t */\n\t[Style(name=\"disabledFontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The font styles used to display the toast's message.\n\t *\n\t * <p>In the following example, the font styles are customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toast.fontStyles = new TextFormat( \"Helvetica\", 20, 0xcc0000 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>messageFactory</code> to set more advanced styles.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #disabledFontStyles\n\t */\n\t[Style(name=\"fontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The space, in pixels, between the message text renderer and the actions\n\t * button group. Applies to either horizontal or vertical spacing, depending\n\t * on the value of <code>actionsPosition</code>.\n\t *\n\t * <p>If <code>gap</code> is set to <code>Number.POSITIVE_INFINITY</code>,\n\t * the message and actions will be positioned as far apart as possible. In\n\t * other words, they will be positioned at the edges of the toast,\n\t * adjusted for padding.</p>\n\t *\n\t * <p>The following example creates a gap of 50 pixels between the label\n\t * and the icon:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toast.gap = 50;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:iconPosition\n\t * @see #style:minGap\n\t */\n\t[Style(name=\"gap\",type=\"Number\")]\n\n\t/**\n\t * If the value of the <code>gap</code> property is\n\t * <code>Number.POSITIVE_INFINITY</code>, meaning that the gap will\n\t * fill as much space as possible, the final calculated value will not be\n\t * smaller than the value of the <code>minGap</code> property.\n\t *\n\t * <p>The following example ensures that the gap is never smaller than\n\t * 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toast.gap = Number.POSITIVE_INFINITY;\n\t * toast.minGap = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:gap\n\t */\n\t[Style(name=\"minGap\",type=\"Number\")]\n\n\t/**\n\t * Quickly sets all padding properties to the same value. The\n\t * <code>padding</code> getter always returns the value of\n\t * <code>paddingTop</code>, but the other padding values may be\n\t * different.\n\t *\n\t * <p>In the following example, the padding of all sides of the toast\n\t * is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toast.padding = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:paddingTop\n\t * @see #style:paddingRight\n\t * @see #style:paddingBottom\n\t * @see #style:paddingLeft\n\t */\n\t[Style(name=\"padding\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the toast's top edge and the\n\t * toast's content.\n\t *\n\t * <p>In the following example, the padding on the top edge of the\n\t * toast is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toast.paddingTop = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingTop\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the toast's right edge and\n\t * the toast's content.\n\t *\n\t * <p>In the following example, the padding on the right edge of the\n\t * toast is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toast.paddingRight = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingRight\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the toast's bottom edge and\n\t * the toast's content.\n\t *\n\t * <p>In the following example, the padding on the bottom edge of the\n\t * toast is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toast.paddingBottom = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingBottom\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the toast's left edge and the\n\t * toast's content.\n\t *\n\t * <p>In the following example, the padding on the left edge of the\n\t * toast is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toast.paddingLeft = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingLeft\",type=\"Number\")]\n\n\t/**\n\t * Dispatched when the toast is opened. This event is dispatched after the\n\t * <code>openEffect</code> has completed, if one is defined.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.OPEN\n\t *\n\t * @see #openEffect\n\t * @see #event:close starling.events.Event.CLOSE\n\t */\n\t[Event(name=\"open\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the toast is closed. This event is dispatched after the\n\t * <code>closeEffect</code> has completed, if one is defined.\n\t *\n\t * <p>The <code>data</code> property of the event object will contain\n\t * the item from the <code>ButtonGroup</code> data provider for the button\n\t * that is triggered. If no button is triggered, then the <code>data</code>\n\t * property will be <code>null</code>.</p>\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The triggered button, or\n\t *   <code>null</code></td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CLOSE\n\t *\n\t * @see #close()\n\t * @see #closeEffect\n\t * @see #event:open starling.events.Event.OPEN\n\t */\n\t[Event(name=\"close\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Displays a notification-like message in a popup over the rest of your\n\t * app's content. May contain a message and optional actions, or completely\n\t * custom content.\n\t *\n\t * <p>In the following example, a toast displaying a message and actions is\n\t * triggered:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.addEventListener( Event.TRIGGERED, button_triggeredHandler );\n\t * \n\t * function button_triggeredHandler( event:Event ):void\n\t * {\n\t *     Toast.showMessageWithActions( \"Item deleted\", new ArrayCollection([{ label: \"Undo\" }]) );\n\t * }</listing>\n\t *\n\t * <p><a href=\"https://feathersui.com/help/beta-policy.html\" target=\"_blank\"><strong>Beta Component:</strong></a> This is a new component, and its APIs\n\t * may need some changes between now and the next version of Feathers to\n\t * account for overlooked requirements or other issues. Upgrading to future\n\t * versions of Feathers may involve manual changes to your code that uses\n\t * this component. The\n\t * <a href=\"https://feathersui.com/help/deprecation-policy.html\" target=\"_blank\">Feathers deprecation policy</a>\n\t * will not go into effect until this component's status is upgraded from\n\t * beta to stable.</p>\n\t *\n\t * @see ../../../help/toast.html How to use the Feathers Toast component\n\t * @see #showMessage()\n\t * @see #showMessageWithActions()\n\t * @see #showContent()\n\t *\n\t * @productversion Feathers 4.0.0\n\t */\n\tpublic class Toast extends FeathersControl\n\t{\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the\n\t\t * message text renderer.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t * @see ../../../help/text-renderers.html Introduction to Feathers text renderers\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_MESSAGE:String = \"feathers-toast-message\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the\n\t\t * actions button group.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_ACTIONS:String = \"feathers-toast-actions\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_ACTIONS_FACTORY:String = \"actionsFactory\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>Toast</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static var _maxVisibleToasts:int = 1;\n\n\t\t/**\n\t\t * The maximum number of toasts that can be displayed simultaneously.\n\t\t * Additional toasts will be queued up to display after the current\n\t\t * toasts are removed.\n\t\t */\n\t\tpublic static function get maxVisibleToasts():int\n\t\t{\n\t\t\treturn _maxVisibleToasts;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic static function set maxVisibleToasts(value:int):void\n\t\t{\n\t\t\tif(_maxVisibleToasts == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value <= 0)\n\t\t\t{\n\t\t\t\tthrow new RangeError(\"maxVisibleToasts must be greater than 0.\");\n\t\t\t}\n\t\t\t_maxVisibleToasts = value;\n\t\t\twhile(_activeToasts.length < _maxVisibleToasts && _queue.length > 0)\n\t\t\t{\n\t\t\t\tshowNextInQueue();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static var _queueMode:String = ToastQueueMode.CANCEL_TIMEOUT;\n\n\t\t/**\n\t\t * Determines how timeouts are treated when toasts need to be queued up\n\t\t * because there are already <code>maxVisibleToasts</code> visible.\n\t\t * Either waits until the timeout is complete, or immediately closes an\n\t\t * existing toast and shows the queued toast after the closing effect is\n\t\t * done.\n\t\t */\n\t\tpublic static function get queueMode():String\n\t\t{\n\t\t\treturn _queueMode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic static function set queueMode(value:String):void\n\t\t{\n\t\t\t_queueMode = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static var _toastFactory:Function = defaultToastFactory;\n\n\t\t/**\n\t\t * Used to create a new <code>Toast</code> instance in the\n\t\t * <code>showMessage()</code>, <code>showMessageWithActions()</code>, or\n\t\t * <code>showContent()</code> functions. Useful for customizing the\n\t\t * styles of toasts without a theme.\n\t\t *\n\t\t * <p>This function is expected to have the following signature:</p>\n\t\t *\n\t\t * <pre>function():Toast</pre>\n\t\t *\n\t\t * <p>The following example shows how to create a custom toast factory:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * Toast.toastFactory = function():Toast\n\t\t * {\n\t\t *     var toast:Toast = new Toast();\n\t\t *     toast.backgroundSkin = new Image( texture );\n\t\t *     toast.padding = 10;\n\t\t *     return toast;\n\t\t * };</listing>\n\t\t *\n\t\t * @see #showMessage()\n\t\t * @see #showMessageWithStyles()\n\t\t * @see #showContent()\n\t\t */\n\t\tpublic static function get toastFactory():Function\n\t\t{\n\t\t\treturn Toast._toastFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic static function set toastFactory(value:Function):void\n\t\t{\n\t\t\tToast._toastFactory = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static var _containerFactory:Function = defaultContainerFactory;\n\n\t\t/**\n\t\t * Create a container for toasts that is added to the pop-up manager.\n\t\t * Useful for customizing the layout of toasts.\n\t\t *\n\t\t * <p>This function is expected to have the following signature:</p>\n\t\t *\n\t\t * <pre>function():DisplayObjectContainer</pre>\n\t\t *\n\t\t * <p>The following example shows how to create a custom toast container:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * Toast.containerFactory = function():DisplayObjectContainer\n\t\t * {\n\t\t *     var container:LayoutGroup = new LayoutGroup();\n\t\t *     container.layout = new VerticalLayout();\n\t\t *     return container;\n\t\t * };</listing>\n\t\t *\n\t\t * @see #showMessage()\n\t\t * @see #showMessageWithStyles()\n\t\t * @see #showContent()\n\t\t */\n\t\tpublic static function get containerFactory():Function\n\t\t{\n\t\t\treturn Toast._containerFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic static function set containerFactory(value:Function):void\n\t\t{\n\t\t\tToast._containerFactory = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static var _activeToasts:Vector.<Toast> = new <Toast>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static var _queue:Vector.<Toast> = new <Toast>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static var _containers:Dictionary = new Dictionary(true);\n\n\t\t/**\n\t\t * Shows a toast with custom content.\n\t\t *\n\t\t * @see #showMessage()\n\t\t * @see #showMessageWithActions()\n\t\t */\n\t\tpublic static function showContent(content:DisplayObject, timeout:Number = 4, toastFactory:Function = null):Toast\n\t\t{\n\t\t\tvar factory:Function = toastFactory !== null ? toastFactory : Toast._toastFactory;\n\t\t\tif(factory === null)\n\t\t\t{\n\t\t\t\tfactory = defaultToastFactory;\n\t\t\t}\n\t\t\tvar toast:Toast = Toast(factory());\n\t\t\ttoast.content = content;\n\t\t\treturn showToast(toast, timeout);\n\t\t}\n\n\t\t/**\n\t\t * Shows a toast with a simple text message.\n\t\t *\n\t\t * @see #showMessageWithActions()\n\t\t * @see #showContent()\n\t\t */\n\t\tpublic static function showMessage(message:String, timeout:Number = 4, toastFactory:Function = null):Toast\n\t\t{\n\t\t\tvar factory:Function = toastFactory !== null ? toastFactory : Toast._toastFactory;\n\t\t\tif(factory === null)\n\t\t\t{\n\t\t\t\tfactory = defaultToastFactory;\n\t\t\t}\n\t\t\tvar toast:Toast = Toast(factory());\n\t\t\ttoast.message = message;\n\t\t\treturn showToast(toast, timeout);\n\t\t}\n\n\t\t/**\n\t\t * Shows a toast with a text message and some action buttons.\n\t\t *\n\t\t * @see #showMessage()\n\t\t * @see #showContent()\n\t\t */\n\t\tpublic static function showMessageWithActions(message:String, actions:IListCollection, timeout:Number = 4, toastFactory:Function = null):Toast\n\t\t{\n\t\t\tvar factory:Function = toastFactory !== null ? toastFactory : Toast._toastFactory;\n\t\t\tif(factory === null)\n\t\t\t{\n\t\t\t\tfactory = defaultToastFactory;\n\t\t\t}\n\t\t\tvar toast:Toast = Toast(factory());\n\t\t\ttoast.message = message;\n\t\t\ttoast.actions = actions;\n\t\t\treturn showToast(toast, timeout);\n\t\t}\n\n\t\t/**\n\t\t * Shows a toast instance.\n\t\t *\n\t\t * @see #showMessage()\n\t\t * @see #showMessageWithActions()\n\t\t * @see #showContent()\n\t\t */\n\t\tpublic static function showToast(toast:Toast, timeout:Number):Toast\n\t\t{\n\t\t\ttoast.timeout = timeout;\n\t\t\tif(_activeToasts.length >= _maxVisibleToasts)\n\t\t\t{\n\t\t\t\t_queue[_queue.length] = toast;\n\t\t\t\tif(_queueMode == ToastQueueMode.CANCEL_TIMEOUT)\n\t\t\t\t{\n\t\t\t\t\tvar toastCount:int = _activeToasts.length;\n\t\t\t\t\tfor(var i:int = 0; i < toastCount; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar activeToast:Toast = _activeToasts[i];\n\t\t\t\t\t\tif(activeToast.timeout < Number.POSITIVE_INFINITY &&\n\t\t\t\t\t\t\t!activeToast.isClosing)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tactiveToast.close(activeToast.disposeOnSelfClose);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn toast;\n\t\t\t}\n\t\t\t_activeToasts[_activeToasts.length] = toast;\n\t\t\ttoast.addEventListener(Event.CLOSE, toast_closeHandler);\n\t\t\tvar container:DisplayObjectContainer = getContainerForStarling(Starling.current);\n\t\t\tcontainer.addChild(toast);\n\t\t\tif(container is IValidating)\n\t\t\t{\n\t\t\t\t//validate the parent container before opening the toast because\n\t\t\t\t//we want to be sure that the toast is positioned properly in\n\t\t\t\t//the layout for things that may rely on the position, like\n\t\t\t\t//openEffect\n\t\t\t\tIValidating(container).validate();\n\t\t\t}\n\t\t\ttoast.open();\n\t\t\treturn toast;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function showNextInQueue():void\n\t\t{\n\t\t\tif(_queue.length == 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdo\n\t\t\t{\n\t\t\t\tvar toast:Toast = _queue.shift();\n\t\t\t}\n\t\t\t//keep skipping toasts that have a timeout\n\t\t\twhile(_queueMode == ToastQueueMode.CANCEL_TIMEOUT &&\n\t\t\t\t_queue.length > 0 &&\n\t\t\t\ttoast.timeout < Number.POSITIVE_INFINITY);\n\t\t\tshowToast(toast, toast.timeout);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function toast_closeHandler(event:Event):void\n\t\t{\n\t\t\tvar toast:Toast = Toast(event.currentTarget);\n\t\t\ttoast.removeEventListener(Event.CLOSE, toast_closeHandler);\n\t\t\tvar index:int = _activeToasts.indexOf(toast);\n\t\t\t_activeToasts.removeAt(index);\n\t\t\tshowNextInQueue();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function getContainerForStarling(starling:Starling):DisplayObjectContainer\n\t\t{\n\t\t\tif(starling in Toast._containers)\n\t\t\t{\n\t\t\t\tvar container:DisplayObjectContainer = DisplayObjectContainer(Toast._containers[starling]);\n\t\t\t\t// always move it to the top, so that new toasts don't appear\n\t\t\t\t// behind other pop-ups added after the first toast\n\t\t\t\tcontainer.parent.setChildIndex(container, container.parent.numChildren - 1);\n\t\t\t\treturn container;\n\t\t\t}\n\t\t\tvar factory:Function = Toast._containerFactory !== null ? Toast._containerFactory : defaultContainerFactory;\n\t\t\tcontainer = DisplayObjectContainer(factory());\n\t\t\tToast._containers[starling] = container;\n\t\t\tcontainer.addEventListener(Event.REMOVED_FROM_STAGE, function(event:Event):void\n\t\t\t{\n\t\t\t\tdelete Toast._containers[starling];\n\t\t\t});\n\t\t\tPopUpManager.forStarling(starling).addPopUp(container, false, false);\n\t\t\treturn container;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultToastFactory():Toast\n\t\t{\n\t\t\treturn new Toast();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultContainerFactory():DisplayObjectContainer\n\t\t{\n\t\t\tvar container:LayoutGroup = new LayoutGroup();\n\t\t\tcontainer.autoSizeMode = AutoSizeMode.STAGE;\n\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\tlayout.verticalAlign = VerticalAlign.BOTTOM;\n\t\t\tif(DeviceCapabilities.isPhone())\n\t\t\t{\n\t\t\t\tlayout.horizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlayout.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\t}\n\t\t\tcontainer.layout = layout;\n\t\t\treturn container;\n\t\t}\n\n\t\t/**\n\t\t * The default factory that creates the action button group. To use a\n\t\t * different factory, you need to set <code>actionsFactory</code>\n\t\t * to a <code>Function</code> instance.\n\t\t */\n\t\tpublic static function defaultActionsFactory():ButtonGroup\n\t\t{\n\t\t\treturn new ButtonGroup();\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function Toast()\n\t\t{\n\t\t\tsuper();\n\t\t\tif(this._fontStylesSet === null)\n\t\t\t{\n\t\t\t\tthis._fontStylesSet = new FontStylesSet();\n\t\t\t\tthis._fontStylesSet.addEventListener(Event.CHANGE, fontStyles_changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the toast's\n\t\t * message text renderer. This variable is <code>protected</code> so\n\t\t * that sub-classes can customize the message style name in their\n\t\t * constructors instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_MESSAGE</code>.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var messageStyleName:String = DEFAULT_CHILD_STYLE_NAME_MESSAGE;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the toast's\n\t\t * actions button group. This variable is <code>protected</code> so\n\t\t * that sub-classes can customize the actions style name in their\n\t\t * constructors instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_ACTIONS</code>.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var actionsStyleName:String = DEFAULT_CHILD_STYLE_NAME_ACTIONS;\n\n\t\t/**\n\t\t * The message text renderer sub-component.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t */\n\t\tprotected var messageTextRenderer:ITextRenderer = null;\n\n\t\t/**\n\t\t * The actions button group sub-component.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t */\n\t\tprotected var actionsGroup:ButtonGroup = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn Toast.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitMessageWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitMessageHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitMessageMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitMessageMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitMessageMaxWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitMessageMaxHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _message:String = null;\n\n\t\t/**\n\t\t * The toast's main text content.\n\t\t */\n\t\tpublic function get message():String\n\t\t{\n\t\t\treturn this._message;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set message(value:String):void\n\t\t{\n\t\t\tif(this._message == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._message = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _actions:IListCollection = null;\n\n\t\t/**\n\t\t * The data provider of the toast's <code>ButtonGroup</code>.\n\t\t */\n\t\tpublic function get actions():IListCollection\n\t\t{\n\t\t\treturn this._actions;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set actions(value:IListCollection):void\n\t\t{\n\t\t\tif(this._actions == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._actions = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitContentWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitContentHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitContentMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitContentMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitContentMaxWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitContentMaxHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _content:DisplayObject = null;\n\n\t\t/**\n\t\t * Optional custom content to display in the toast.\n\t\t */\n\t\tpublic function get content():DisplayObject\n\t\t{\n\t\t\treturn this._content;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set content(value:DisplayObject):void\n\t\t{\n\t\t\tif(this._content == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._content && this._content.parent == this)\n\t\t\t{\n\t\t\t\tthis._content.removeFromParent(false);\n\t\t\t}\n\t\t\tthis._content = value;\n\t\t\tif(this._content)\n\t\t\t{\n\t\t\t\tif(this._content is IFeathersControl)\n\t\t\t\t{\n\t\t\t\t\tIFeathersControl(this._content).initializeNow();\n\t\t\t\t}\n\t\t\t\tif(this._content is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar measureContent:IMeasureDisplayObject = IMeasureDisplayObject(this._content);\n\t\t\t\t\tthis._explicitContentWidth = measureContent.explicitWidth;\n\t\t\t\t\tthis._explicitContentHeight = measureContent.explicitHeight;\n\t\t\t\t\tthis._explicitContentMinWidth = measureContent.explicitMinWidth;\n\t\t\t\t\tthis._explicitContentMinHeight = measureContent.explicitMinHeight;\n\t\t\t\t\tthis._explicitContentMaxWidth = measureContent.explicitMaxWidth;\n\t\t\t\t\tthis._explicitContentMaxHeight = measureContent.explicitMaxHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._explicitContentWidth = this._content.width;\n\t\t\t\t\tthis._explicitContentHeight = this._content.height;\n\t\t\t\t\tthis._explicitContentMinWidth = this._explicitContentWidth;\n\t\t\t\t\tthis._explicitContentMinHeight = this._explicitContentHeight;\n\t\t\t\t\tthis._explicitContentMaxWidth = this._explicitContentWidth;\n\t\t\t\t\tthis._explicitContentMaxHeight = this._explicitContentHeight;\n\t\t\t\t}\n\t\t\t\tthis.addChild(this._content);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ACTIONS_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _startTime:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _timeout:Number = Number.POSITIVE_INFINITY;\n\n\t\t/**\n\t\t * The time, in seconds, when the toast will automatically close. Set\n\t\t * to <code>Number.POSITIVE_INFINITY</code> to require the toast to be\n\t\t * closed manually.\n\t\t *\n\t\t * @default Number.POSITIVE_INFINITY\n\t\t */\n\t\tpublic function get timeout():Number\n\t\t{\n\t\t\treturn this._timeout;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set timeout(value:Number):void\n\t\t{\n\t\t\tif(this._timeout == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._timeout = value;\n\t\t\tif(this._isOpen)\n\t\t\t{\n\t\t\t\tthis.startTimeout();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _openEffectContext:IEffectContext = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _openEffect:Function = Fade.createFadeInEffect();\n\n\t\t/**\n\t\t * An optional effect that is activated when the toast is opened.\n\t\t *\n\t\t * <p>In the following example, a open effect fades the toast's\n\t\t * <code>alpha</code> property from <code>0</code> to <code>1</code>:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * toast.openEffect = Fade.createFadeBetweenEffect(0, 1);</listing>\n\t\t *\n\t\t * <p>A number of animated effects may be found in the\n\t\t * <a href=\"../motion/package-detail.html\">feathers.motion</a> package.\n\t\t * However, you are not limited to only these effects. It's possible\n\t\t * to create custom effects too.</p>\n\t\t *\n\t\t * <p>A custom effect function should have the following signature:</p>\n\t\t * <pre>function(target:DisplayObject):IEffectContext</pre>\n\t\t *\n\t\t * <p>The <code>IEffectContext</code> is used by the component to\n\t\t * control the effect, performing actions like playing the effect,\n\t\t * pausing it, or cancelling it.</p>\n\t\t *\n\t\t * <p>Custom animated effects that use\n\t\t * <code>starling.display.Tween</code> typically return a\n\t\t * <code>TweenEffectContext</code>. In the following example, we\n\t\t * recreate the <code>Fade.createFadeBetweenEffect()</code> used in the\n\t\t * previous example.</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * toast.closeEffect = function(target:DisplayObject):IEffectContext\n\t\t * {\n\t\t *     toast.alpha = 0;\n\t\t *     var tween:Tween = new Tween(target, 0.5, Transitions.EASE_OUT);\n\t\t *     tween.fadeTo(1);\n\t\t *     return new TweenEffectContext(target, tween);\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.FeathersControl#closeEffect\n\t\t * @see #showToast()\n\t\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t\t * @see feathers.motion.effectClasses.IEffectContext\n\t\t * @see feathers.motion.effectClasses.TweenEffectContext\n\t\t */\n\t\tpublic function get openEffect():Function\n\t\t{\n\t\t\treturn this._openEffect;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set openEffect(value:Function):void\n\t\t{\n\t\t\tif(this._openEffect == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._openEffect = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _closeEffectContext:IEffectContext = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _closeEffect:Function = Fade.createFadeOutEffect();\n\n\t\t/**\n\t\t * An optional effect that is activated when the toast is closed.\n\t\t *\n\t\t * <p>In the following example, a close effect fades the toast's\n\t\t * <code>alpha</code> property from <code>1</code> to <code>0</code>:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * toast.closeEffect = Fade.createFadeBetweenEffect(1, 0);</listing>\n\t\t *\n\t\t * <p>A number of animated effects may be found in the\n\t\t * <a href=\"../motion/package-detail.html\">feathers.motion</a> package.\n\t\t * However, you are not limited to only these effects. It's possible\n\t\t * to create custom effects too.</p>\n\t\t *\n\t\t * <p>A custom effect function should have the following signature:</p>\n\t\t * <pre>function(target:DisplayObject):IEffectContext</pre>\n\t\t *\n\t\t * <p>The <code>IEffectContext</code> is used by the component to\n\t\t * control the effect, performing actions like playing the effect,\n\t\t * pausing it, or cancelling it.</p>\n\t\t *\n\t\t * <p>Custom animated effects that use\n\t\t * <code>starling.display.Tween</code> typically return a\n\t\t * <code>TweenEffectContext</code>. In the following example, we\n\t\t * recreate the <code>Fade.createFadeBetweenEffect()</code> used in the\n\t\t * previous example.</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * toast.closeEffect = function(target:DisplayObject):IEffectContext\n\t\t * {\n\t\t *     toast.alpha = 1;\n\t\t *     var tween:Tween = new Tween(target, 0.5, Transitions.EASE_OUT);\n\t\t *     tween.fadeTo(0);\n\t\t *     return new TweenEffectContext(target, tween);\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.FeathersControl#openEffect\n\t\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t\t * @see feathers.motion.effectClasses.IEffectContext\n\t\t * @see feathers.motion.effectClasses.TweenEffectContext\n\t\t */\n\t\tpublic function get closeEffect():Function\n\t\t{\n\t\t\treturn this._closeEffect;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set closeEffect(value:Function):void\n\t\t{\n\t\t\tif(this._closeEffect == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._closeEffect = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fontStylesSet:FontStylesSet = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get fontStyles():TextFormat\n\t\t{\n\t\t\treturn this._fontStylesSet.format;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set fontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._fontStylesSet.format;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._fontStylesSet.format = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get disabledFontStyles():TextFormat\n\t\t{\n\t\t\treturn this._fontStylesSet.disabledFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disabledFontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._fontStylesSet.disabledFormat;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._fontStylesSet.disabledFormat = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _messageFactory:Function = null;\n\n\t\t/**\n\t\t * A function used to instantiate the toast's message text renderer\n\t\t * sub-component. By default, the toast will use the global text\n\t\t * renderer factory, <code>FeathersControl.defaultTextRendererFactory()</code>,\n\t\t * to create the message text renderer. The message text renderer must\n\t\t * be an instance of <code>ITextRenderer</code>. This factory can be\n\t\t * used to change properties on the message text renderer when it is\n\t\t * first created. For instance, if you are skinning Feathers components\n\t\t * without a theme, you might use this factory to style the message text\n\t\t * renderer.\n\t\t *\n\t\t * <p>If you are not using a theme, the message factory can be used to\n\t\t * provide skin the message text renderer with appropriate text styles.</p>\n\t\t *\n\t\t * <p>The factory should have the following function signature:</p>\n\t\t * <pre>function():ITextRenderer</pre>\n\t\t *\n\t\t * <p>In the following example, a custom message factory is passed to\n\t\t * the toast:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * toast.messageFactory = function():ITextRenderer\n\t\t * {\n\t\t *     var messageRenderer:TextFieldTextRenderer = new TextFieldTextRenderer();\n\t\t *     messageRenderer.textFormat = new TextFormat( \"_sans\", 12, 0xff0000 );\n\t\t *     return messageRenderer;\n\t\t * }</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #message\n\t\t * @see feathers.core.ITextRenderer\n\t\t * @see feathers.core.FeathersControl#defaultTextRendererFactory\n\t\t */\n\t\tpublic function get messageFactory():Function\n\t\t{\n\t\t\treturn this._messageFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set messageFactory(value:Function):void\n\t\t{\n\t\t\tif(this._messageFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._messageFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customMessageStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customMessageStyleName():String\n\t\t{\n\t\t\treturn this._customMessageStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customMessageStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customMessageStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customMessageStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _actionsFactory:Function = null;\n\n\t\t/**\n\t\t * A function used to generate the toast's button group sub-component.\n\t\t * The button group must be an instance of <code>ButtonGroup</code>.\n\t\t * This factory can be used to change properties on the button group\n\t\t * when it is first created. For instance, if you are skinning Feathers\n\t\t * components without a theme, you might use this factory to set skins\n\t\t * and other styles on the button group.\n\t\t *\n\t\t * <p>The function should have the following signature:</p>\n\t\t * <pre>function():ButtonGroup</pre>\n\t\t *\n\t\t * <p>In the following example, a custom button group factory is\n\t\t * provided to the toast:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * toast.actionsFactory = function():ButtonGroup\n\t\t * {\n\t\t *     return new ButtonGroup();\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.ButtonGroup\n\t\t */\n\t\tpublic function get actionsFactory():Function\n\t\t{\n\t\t\treturn this._actionsFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set actionsFactory(value:Function):void\n\t\t{\n\t\t\tif(this._actionsFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._actionsFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ACTIONS_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customActionsStyleName:String = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customActionsStyleName():String\n\t\t{\n\t\t\treturn this._customActionsStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customActionsStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customActionsStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customActionsStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ACTIONS_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _disposeFromCloseCall:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _disposeOnSelfClose:Boolean = true;\n\n\t\t/**\n\t\t * Determines if the toast will be disposed when <code>close()</code>\n\t\t * is called internally. Close may be called internally in a variety of\n\t\t * cases, depending on values such as <code>timeout</code> and\n\t\t * <code>actions</code>. If set to <code>false</code>, you may reuse the\n\t\t * toast later by passing it to <code>Toast.showToast()</code>.\n\t\t *\n\t\t * <p>In the following example, the toast will not be disposed when it\n\t\t * closes itself:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * toast.disposeOnSelfClose = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t *\n\t\t * @see #close()\n\t\t * @see #disposeContent\n\t\t */\n\t\tpublic function get disposeOnSelfClose():Boolean\n\t\t{\n\t\t\treturn this._disposeOnSelfClose;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disposeOnSelfClose(value:Boolean):void\n\t\t{\n\t\t\tthis._disposeOnSelfClose = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic var _disposeContent:Boolean = true;\n\n\t\t/**\n\t\t * Determines if the toast's content will be disposed when the toast\n\t\t * is disposed. If set to <code>false</code>, the toast's content may\n\t\t * be added to the display list again later.\n\t\t *\n\t\t * <p>In the following example, the toast's content will not be\n\t\t * disposed when the toast is disposed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * toast.disposeContent = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t *\n\t\t * @see #disposeOnSelfClose\n\t\t */\n\t\tpublic function get disposeContent():Boolean\n\t\t{\n\t\t\treturn this._disposeContent;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disposeContent(value:Boolean):void\n\t\t{\n\t\t\tthis._disposeContent = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _closeData:Object = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isClosing:Boolean = false;\n\n\t\t/**\n\t\t * Indicates if the toast is currently closing.\n\t\t *\n\t\t * @see #isOpening\n\t\t * @see #isOpen\n\t\t */\n\t\tpublic function get isClosing():Boolean\n\t\t{\n\t\t\treturn this._isClosing;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isOpening:Boolean = false;\n\n\t\t/**\n\t\t * Indicates if the toast is currently opening.\n\t\t *\n\t\t * @see #isClosing\n\t\t */\n\t\tpublic function get isOpening():Boolean\n\t\t{\n\t\t\treturn this._isOpening;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isOpen:Boolean = false;\n\n\t\t/**\n\t\t * Indicates if the toast is currently open. Does not change from\n\t\t * <code>false</code> to <code>true</code> until the open effect has\n\t\t * completed. Similarly, does not change from <code>true</code> to\n\t\t * <code>false</code> until the close effect has completed.\n\t\t *\n\t\t * @see #isOpening\n\t\t * @see #isClosing\n\t\t * @see #event:open starling.events.Event.OPEN\n\t\t * @see #event:close starling.events.Event.CLOSE\n\t\t */\n\t\tpublic function get isOpen():Boolean\n\t\t{\n\t\t\treturn this._isOpen;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundSkinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundSkinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundSkinMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundSkinMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundSkinMaxWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundSkinMaxHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _backgroundSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundSkin():DisplayObject\n\t\t{\n\t\t\treturn this._backgroundSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSkin !== null && this._backgroundSkin.parent === this)\n\t\t\t{\n\t\t\t\t//we need to restore these values so that they won't be lost the\n\t\t\t\t//next time that this skin is used for measurement\n\t\t\t\tthis._backgroundSkin.width = this._explicitBackgroundSkinWidth;\n\t\t\t\tthis._backgroundSkin.height = this._explicitBackgroundSkinHeight;\n\t\t\t\tif(this._backgroundSkin is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar measureSkin:IMeasureDisplayObject = IMeasureDisplayObject(this._backgroundSkin);\n\t\t\t\t\tmeasureSkin.minWidth = this._explicitBackgroundSkinMinWidth;\n\t\t\t\t\tmeasureSkin.minHeight = this._explicitBackgroundSkinMinHeight;\n\t\t\t\t\tmeasureSkin.maxWidth = this._explicitBackgroundSkinMaxWidth;\n\t\t\t\t\tmeasureSkin.maxHeight = this._explicitBackgroundSkinMaxHeight;\n\t\t\t\t}\n\t\t\t\tthis._backgroundSkin.removeFromParent(false);\n\t\t\t}\n\t\t\tthis._backgroundSkin = value;\n\t\t\tif(this._backgroundSkin !== null)\n\t\t\t{\n\t\t\t\tif(this._backgroundSkin is IFeathersControl)\n\t\t\t\t{\n\t\t\t\t\tIFeathersControl(this._backgroundSkin).initializeNow();\n\t\t\t\t}\n\t\t\t\tif(this._backgroundSkin is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tmeasureSkin = IMeasureDisplayObject(this._backgroundSkin);\n\t\t\t\t\tthis._explicitBackgroundSkinWidth = measureSkin.explicitWidth;\n\t\t\t\t\tthis._explicitBackgroundSkinHeight = measureSkin.explicitHeight;\n\t\t\t\t\tthis._explicitBackgroundSkinMinWidth = measureSkin.explicitMinWidth;\n\t\t\t\t\tthis._explicitBackgroundSkinMinHeight = measureSkin.explicitMinHeight;\n\t\t\t\t\tthis._explicitBackgroundSkinMaxWidth = measureSkin.explicitMaxWidth;\n\t\t\t\t\tthis._explicitBackgroundSkinMaxHeight = measureSkin.explicitMaxHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._explicitBackgroundSkinWidth = this._backgroundSkin.width;\n\t\t\t\t\tthis._explicitBackgroundSkinHeight = this._backgroundSkin.height;\n\t\t\t\t\tthis._explicitBackgroundSkinMinWidth = this._explicitBackgroundSkinWidth;\n\t\t\t\t\tthis._explicitBackgroundSkinMinHeight = this._explicitBackgroundSkinHeight;\n\t\t\t\t\tthis._explicitBackgroundSkinMaxWidth = this._explicitBackgroundSkinWidth;\n\t\t\t\t\tthis._explicitBackgroundSkinMaxHeight = this._explicitBackgroundSkinHeight;\n\t\t\t\t}\n\t\t\t\tthis.addChildAt(this._backgroundSkin, 0);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get padding():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set padding(value:Number):void\n\t\t{\n\t\t\tthis.paddingTop = value;\n\t\t\tthis.paddingRight = value;\n\t\t\tthis.paddingBottom = value;\n\t\t\tthis.paddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingTop:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingTop():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingTop(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingTop = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingRight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingRight():Number\n\t\t{\n\t\t\treturn this._paddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingRight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingBottom:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingBottom():Number\n\t\t{\n\t\t\treturn this._paddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingBottom = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingLeft:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingLeft = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalAlign:String = HorizontalAlign.CENTER;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"left,center,right\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get horizontalAlign():String\n\t\t{\n\t\t\treturn this._horizontalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalAlign(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._horizontalAlign === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalAlign = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalAlign:String = VerticalAlign.MIDDLE;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"top,middle,bottom\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get verticalAlign():String\n\t\t{\n\t\t\treturn this._verticalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalAlign(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._verticalAlign === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalAlign = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _gap:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get gap():Number\n\t\t{\n\t\t\treturn this._gap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set gap(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._gap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._gap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minGap:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get minGap():Number\n\t\t{\n\t\t\treturn this._minGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minGap(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._minGap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._minGap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _actionsPosition:String = RelativePosition.RIGHT;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"top,right,bottom,left\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get actionsPosition():String\n\t\t{\n\t\t\treturn this._actionsPosition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set actionsPosition(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._actionsPosition === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._actionsPosition = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this._fontStylesSet !== null)\n\t\t\t{\n\t\t\t\tthis._fontStylesSet.dispose();\n\t\t\t\tthis._fontStylesSet = null;\n\t\t\t}\n\t\t\tvar savedContent:DisplayObject = this._content;\n\t\t\tthis.content = null;\n\t\t\t//remove the content safely if it should not be disposed\n\t\t\tif(savedContent !== null && this._disposeContent)\n\t\t\t{\n\t\t\t\tsavedContent.dispose();\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t *\n\t\t * @see #showToast()\n\t\t */\n\t\tprotected function open():void\n\t\t{\n\t\t\tif(this._isOpen || this._isOpening)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._suspendEffectsCount == 0 && this._closeEffectContext !== null)\n\t\t\t{\n\t\t\t\tthis._closeEffectContext.interrupt();\n\t\t\t\tthis._closeEffectContext = null;\n\t\t\t}\n\t\t\tif(this._openEffect !== null)\n\t\t\t{\n\t\t\t\tthis._isOpening = true;\n\t\t\t\tthis._openEffectContext = IEffectContext(this._openEffect(this));\n\t\t\t\tthis._openEffectContext.addEventListener(Event.COMPLETE, openEffectContext_completeHandler);\n\t\t\t\tthis._openEffectContext.play();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.completeOpen();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Closes the toast and optionally disposes it. If a\n\t\t * <code>closeEffect</code> has been specified, it will be played.\n\t\t *\n\t\t * @see #closeEffect\n\t\t */\n\t\tpublic function close(dispose:Boolean = true):void\n\t\t{\n\t\t\tthis.closeToast(null, dispose);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar textRendererInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t\tvar actionsInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_ACTIONS_FACTORY);\n\n\t\t\tif(textRendererInvalid)\n\t\t\t{\n\t\t\t\tthis.createMessage();\n\t\t\t}\n\n\t\t\tif(actionsInvalid)\n\t\t\t{\n\t\t\t\tthis.createActions();\n\t\t\t}\n\n\t\t\tif(textRendererInvalid || dataInvalid)\n\t\t\t{\n\t\t\t\tif(this.messageTextRenderer)\n\t\t\t\t{\n\t\t\t\t\tthis.messageTextRenderer.text = this._message;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(textRendererInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshMessageStyles();\n\t\t\t}\n\n\t\t\tif(actionsInvalid || dataInvalid)\n\t\t\t{\n\t\t\t\tif(this.actionsGroup)\n\t\t\t\t{\n\t\t\t\t\tthis.actionsGroup.dataProvider = this._actions;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tsizeInvalid = this.autoSizeIfNeeded() || sizeInvalid;\n\n\t\t\tthis.layoutChildren();\n\t\t}\n\n\t\t/**\n\t\t * If the component's dimensions have not been set explicitly, it will\n\t\t * measure its content and determine an ideal size for itself. If the\n\t\t * <code>explicitWidth</code> or <code>explicitHeight</code> member\n\t\t * variables are set, those value will be used without additional\n\t\t * measurement. If one is set, but not the other, the dimension with the\n\t\t * explicit value will not be measured, but the other non-explicit\n\t\t * dimension will still need measurement.\n\t\t *\n\t\t * <p>Calls <code>saveMeasurements()</code> to set up the\n\t\t * <code>actualWidth</code> and <code>actualHeight</code> member\n\t\t * variables used for layout.</p>\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t */\n\t\tprotected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvar adjustedGap:Number = this._gap;\n\t\t\tif(adjustedGap == Number.POSITIVE_INFINITY)\n\t\t\t{\n\t\t\t\tadjustedGap = this._minGap;\n\t\t\t}\n\n\t\t\tresetFluidChildDimensionsForMeasurement(this._backgroundSkin,\n\t\t\t\tthis._explicitWidth, this._explicitHeight,\n\t\t\t\tthis._explicitMinWidth, this._explicitMinHeight,\n\t\t\t\tthis._explicitMaxWidth, this._explicitMaxHeight,\n\t\t\t\tthis._explicitBackgroundSkinWidth, this._explicitBackgroundSkinHeight,\n\t\t\t\tthis._explicitBackgroundSkinMinWidth, this._explicitBackgroundSkinMinHeight,\n\t\t\t\tthis._explicitBackgroundSkinMaxWidth, this._explicitBackgroundSkinMaxHeight);\n\t\t\tvar measureSkin:IMeasureDisplayObject = this._backgroundSkin as IMeasureDisplayObject;\n\n\t\t\tresetFluidChildDimensionsForMeasurement(this._content,\n\t\t\t\tthis._explicitWidth, this._explicitHeight,\n\t\t\t\tthis._explicitMinWidth, this._explicitMinHeight,\n\t\t\t\tthis._explicitMaxWidth, this._explicitMaxHeight,\n\t\t\t\tthis._explicitContentWidth, this._explicitContentHeight,\n\t\t\t\tthis._explicitContentMinWidth, this._explicitContentMinHeight,\n\t\t\t\tthis._explicitContentMaxWidth, this._explicitContentMaxHeight);\n\t\t\tvar measureContent:IMeasureDisplayObject = this._content as IMeasureDisplayObject;\n\n\t\t\tif(this._content is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this._content).validate();\n\t\t\t}\n\t\t\tvar messageSize:Point = Pool.getPoint();\n\t\t\tif(this.messageTextRenderer !== null)\n\t\t\t{\n\t\t\t\tthis.refreshMessageTextRendererDimensions(true);\n\t\t\t\tthis.messageTextRenderer.measureText(messageSize);\n\t\t\t}\n\t\t\tif(this.actionsGroup)\n\t\t\t{\n\t\t\t\tthis.actionsGroup.validate();\n\t\t\t}\n\t\t\tif(this._backgroundSkin is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this._backgroundSkin).validate();\n\t\t\t}\n\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tif(this._content !== null)\n\t\t\t\t{\n\t\t\t\t\tif(measureContent !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = measureContent.minWidth;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = this._content.width;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(this.messageTextRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = messageSize.x;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = 0;\n\t\t\t\t}\n\t\t\t\tif(this.actionsGroup !== null)\n\t\t\t\t{\n\t\t\t\t\tif(this.messageTextRenderer !== null) //both message and actions\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._actionsPosition !== RelativePosition.TOP &&\n\t\t\t\t\t\t\tthis._actionsPosition !== RelativePosition.BOTTOM)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinWidth += adjustedGap;\n\t\t\t\t\t\t\tnewMinWidth += this.actionsGroup.minWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse //top or bottom\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar iconMinWidth:Number = this.actionsGroup.minWidth;\n\t\t\t\t\t\t\tif(iconMinWidth > newMinWidth)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tnewMinWidth = iconMinWidth;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse //no message\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = this.actionsGroup.minWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnewMinWidth += this._paddingLeft + this._paddingRight;\n\t\t\t\tif(this._backgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(measureSkin !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(measureSkin.minWidth > newMinWidth)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinWidth = measureSkin.minWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._explicitBackgroundSkinMinWidth > newMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = this._explicitBackgroundSkinMinWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tif(this._content !== null)\n\t\t\t\t{\n\t\t\t\t\tif(measureContent !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = measureContent.minHeight;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = this._content.height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(this.messageTextRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = messageSize.y;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = 0;\n\t\t\t\t}\n\t\t\t\tif(this.actionsGroup !== null)\n\t\t\t\t{\n\t\t\t\t\tif(this.messageTextRenderer !== null) //both message and actions\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._actionsPosition === RelativePosition.TOP ||\n\t\t\t\t\t\t\tthis._actionsPosition === RelativePosition.BOTTOM)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinHeight += adjustedGap;\n\t\t\t\t\t\t\tnewMinHeight += this.actionsGroup.minHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse //left or right\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar iconMinHeight:Number = this.actionsGroup.minHeight;\n\t\t\t\t\t\t\tif(iconMinHeight > newMinHeight)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tnewMinHeight = iconMinHeight;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse //no message\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = this.actionsGroup.minHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnewMinHeight += this._paddingTop + this._paddingBottom;\n\t\t\t\tif(this._backgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(measureSkin !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(measureSkin.minHeight > newMinHeight)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinHeight = measureSkin.minHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._explicitBackgroundSkinMinHeight > newMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = this._explicitBackgroundSkinMinHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tif(this._content !== null)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this._content.width;\n\t\t\t\t}\n\t\t\t\telse if(this.messageTextRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = messageSize.x;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewWidth = 0;\n\t\t\t\t}\n\t\t\t\tif(this.actionsGroup !== null)\n\t\t\t\t{\n\t\t\t\t\tif(this.messageTextRenderer !== null) //both message and actions\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._actionsPosition !== RelativePosition.TOP &&\n\t\t\t\t\t\t\tthis._actionsPosition !== RelativePosition.BOTTOM)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewWidth += adjustedGap + this.actionsGroup.width;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(this.actionsGroup.width > newWidth) //top or bottom\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewWidth = this.actionsGroup.width;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse //no message\n\t\t\t\t\t{\n\t\t\t\t\t\tnewWidth = this.actionsGroup.width;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnewWidth += this._paddingLeft + this._paddingRight;\n\t\t\t\tif(this._backgroundSkin !== null &&\n\t\t\t\t\tthis._backgroundSkin.width > newWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this._backgroundSkin.width;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tif(this._content !== null)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this._content.height;\n\t\t\t\t}\n\t\t\t\telse if(this.messageTextRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = messageSize.y;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewHeight = 0;\n\t\t\t\t}\n\t\t\t\tif(this.actionsGroup !== null)\n\t\t\t\t{\n\t\t\t\t\tif(this.messageTextRenderer !== null) //both message and actions\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._actionsPosition === RelativePosition.TOP ||\n\t\t\t\t\t\t\tthis._actionsPosition === RelativePosition.BOTTOM)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewHeight += adjustedGap + this.actionsGroup.height;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(this.actionsGroup.height > newHeight) //left or right\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewHeight = this.actionsGroup.height;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse //no message\n\t\t\t\t\t{\n\t\t\t\t\t\tnewHeight = this.actionsGroup.height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnewHeight += this._paddingTop + this._paddingBottom;\n\t\t\t\tif(this._backgroundSkin !== null &&\n\t\t\t\t\tthis._backgroundSkin.height > newHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this._backgroundSkin.height;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tPool.putPoint(messageSize);\n\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshMessageTextRendererDimensions(forMeasurement:Boolean):void\n\t\t{\n\t\t\tif(this.actionsGroup !== null)\n\t\t\t{\n\t\t\t\tthis.actionsGroup.validate();\n\t\t\t}\n\t\t\tif(!this.messageTextRenderer)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar calculatedWidth:Number = this.actualWidth;\n\t\t\tvar calculatedHeight:Number = this.actualHeight;\n\t\t\tif(forMeasurement)\n\t\t\t{\n\t\t\t\tcalculatedWidth = this._explicitWidth;\n\t\t\t\tif(calculatedWidth !== calculatedWidth) //isNaN\n\t\t\t\t{\n\t\t\t\t\tcalculatedWidth = this._explicitMaxWidth;\n\t\t\t\t}\n\t\t\t\tcalculatedHeight = this._explicitHeight;\n\t\t\t\tif(calculatedHeight !== calculatedHeight) //isNaN\n\t\t\t\t{\n\t\t\t\t\tcalculatedHeight = this._explicitMaxHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcalculatedWidth -= (this._paddingLeft + this._paddingRight);\n\t\t\tcalculatedHeight -= (this._paddingTop + this._paddingBottom);\n\t\t\tif(this.actionsGroup !== null)\n\t\t\t{\n\t\t\t\tvar adjustedGap:Number = this._gap;\n\t\t\t\tif(adjustedGap == Number.POSITIVE_INFINITY)\n\t\t\t\t{\n\t\t\t\t\tadjustedGap = this._minGap;\n\t\t\t\t}\n\t\t\t\tif(this._actionsPosition === RelativePosition.LEFT ||\n\t\t\t\t\tthis._actionsPosition === RelativePosition.RIGHT)\n\t\t\t\t{\n\t\t\t\t\tcalculatedWidth -= (this.actionsGroup.width + adjustedGap);\n\t\t\t\t}\n\t\t\t\tif(this._actionsPosition === RelativePosition.TOP || this._actionsPosition === RelativePosition.BOTTOM)\n\t\t\t\t{\n\t\t\t\t\tcalculatedHeight -= (this.actionsGroup.height + adjustedGap);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(calculatedWidth < 0)\n\t\t\t{\n\t\t\t\tcalculatedWidth = 0;\n\t\t\t}\n\t\t\tif(calculatedHeight < 0)\n\t\t\t{\n\t\t\t\tcalculatedHeight = 0;\n\t\t\t}\n\t\t\tif(calculatedWidth > this._explicitMessageMaxWidth)\n\t\t\t{\n\t\t\t\tcalculatedWidth = this._explicitMessageMaxWidth;\n\t\t\t}\n\t\t\tif(calculatedHeight > this._explicitMessageMaxHeight)\n\t\t\t{\n\t\t\t\tcalculatedHeight = this._explicitMessageMaxHeight;\n\t\t\t}\n\t\t\tthis.messageTextRenderer.width = this._explicitMessageWidth;\n\t\t\tthis.messageTextRenderer.height = this._explicitMessageHeight;\n\t\t\tthis.messageTextRenderer.minWidth = this._explicitMessageMinWidth;\n\t\t\tthis.messageTextRenderer.minHeight = this._explicitMessageMinHeight;\n\t\t\tthis.messageTextRenderer.maxWidth = calculatedWidth;\n\t\t\tthis.messageTextRenderer.maxHeight = calculatedHeight;\n\t\t\tthis.messageTextRenderer.validate();\n\t\t\tif(!forMeasurement)\n\t\t\t{\n\t\t\t\tcalculatedWidth = this.messageTextRenderer.width;\n\t\t\t\tcalculatedHeight = this.messageTextRenderer.height;\n\t\t\t\t//setting all of these dimensions explicitly means that the text\n\t\t\t\t//renderer won't measure itself again when it validates, which\n\t\t\t\t//helps performance. we'll reset them when the toast needs to\n\t\t\t\t//measure itself.\n\t\t\t\tthis.messageTextRenderer.width = calculatedWidth;\n\t\t\t\tthis.messageTextRenderer.height = calculatedHeight;\n\t\t\t\tthis.messageTextRenderer.minWidth = calculatedWidth;\n\t\t\t\tthis.messageTextRenderer.minHeight = calculatedHeight;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>messageTextRenderer</code> sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #message\n\t\t * @see #messageTextRenderer\n\t\t * @see #messageFactory\n\t\t */\n\t\tprotected function createMessage():void\n\t\t{\n\t\t\tif(this.messageTextRenderer)\n\t\t\t{\n\t\t\t\tthis.removeChild(DisplayObject(this.messageTextRenderer), true);\n\t\t\t\tthis.messageTextRenderer = null;\n\t\t\t}\n\n\t\t\tif(this._message === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar factory:Function = this._messageFactory != null ? this._messageFactory : FeathersControl.defaultTextRendererFactory;\n\t\t\tthis.messageTextRenderer = ITextRenderer(factory());\n\t\t\tthis.messageTextRenderer.wordWrap = true;\n\t\t\tvar messageStyleName:String = this._customMessageStyleName != null ? this._customMessageStyleName : this.messageStyleName;\n\t\t\tvar uiTextRenderer:IFeathersControl = IFeathersControl(this.messageTextRenderer);\n\t\t\tuiTextRenderer.styleNameList.add(messageStyleName);\n\t\t\tuiTextRenderer.touchable = false;\n\t\t\tthis.addChild(DisplayObject(this.messageTextRenderer));\n\t\t\tthis._explicitMessageWidth = this.messageTextRenderer.explicitWidth;\n\t\t\tthis._explicitMessageHeight = this.messageTextRenderer.explicitHeight;\n\t\t\tthis._explicitMessageMinWidth = this.messageTextRenderer.explicitMinWidth;\n\t\t\tthis._explicitMessageMinHeight = this.messageTextRenderer.explicitMinHeight;\n\t\t\tthis._explicitMessageMaxWidth = this.messageTextRenderer.explicitMaxWidth;\n\t\t\tthis._explicitMessageMaxHeight = this.messageTextRenderer.explicitMaxHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshMessageStyles():void\n\t\t{\n\t\t\tif(!this.messageTextRenderer)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.messageTextRenderer.fontStyles = this._fontStylesSet;\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>actionsGroup</code> sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #actionsGroup\n\t\t * @see #actionsFactory\n\t\t * @see #style:customActionsStyleName\n\t\t */\n\t\tprotected function createActions():void\n\t\t{\n\t\t\tif(this.actionsGroup)\n\t\t\t{\n\t\t\t\tthis.actionsGroup.removeEventListener(Event.TRIGGERED, actionsGroup_triggeredHandler);\n\t\t\t\tthis.removeChild(this.actionsGroup, true);\n\t\t\t\tthis.actionsGroup = null;\n\t\t\t}\n\n\t\t\tif(this._actions === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar factory:Function = this._actionsFactory !== null ? this._actionsFactory : defaultActionsFactory;\n\t\t\tif(factory === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar actionsStyleName:String = this._customActionsStyleName != null ? this._customActionsStyleName : this.actionsStyleName;\n\t\t\tthis.actionsGroup = ButtonGroup(factory());\n\t\t\tthis.actionsGroup.styleNameList.add(actionsStyleName);\n\t\t\tthis.actionsGroup.addEventListener(Event.TRIGGERED, actionsGroup_triggeredHandler);\n\t\t\tthis.addChild(this.actionsGroup);\n\t\t}\n\n\t\t/**\n\t\t * Positions and sizes the toast's content.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t */\n\t\tprotected function layoutChildren():void\n\t\t{\n\t\t\tif(this._backgroundSkin)\n\t\t\t{\n\t\t\t\tthis._backgroundSkin.width = this.actualWidth;\n\t\t\t\tthis._backgroundSkin.height = this.actualHeight;\n\t\t\t}\n\t\t\tif(this._content)\n\t\t\t{\n\t\t\t\tthis._content.x = this._paddingLeft;\n\t\t\t\tthis._content.y = this._paddingTop;\n\t\t\t\tthis._content.width = this.actualWidth - this._paddingLeft - this._paddingRight;\n\t\t\t\tthis._content.height = this.actualHeight - this._paddingTop - this._paddingBottom;\n\t\t\t}\n\n\t\t\tthis.refreshMessageTextRendererDimensions(false);\n\t\t\tif(this.actionsGroup)\n\t\t\t{\n\t\t\t\tthis.positionSingleChild(DisplayObject(this.messageTextRenderer));\n\t\t\t\tthis.positionActionsRelativeToMessage();\n\t\t\t}\n\t\t\telse if(this.messageTextRenderer)\n\t\t\t{\n\t\t\t\tthis.positionSingleChild(DisplayObject(this.messageTextRenderer));\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function positionSingleChild(displayObject:DisplayObject):void\n\t\t{\n\t\t\tif(this._horizontalAlign == HorizontalAlign.LEFT)\n\t\t\t{\n\t\t\t\tdisplayObject.x = this._paddingLeft;\n\t\t\t}\n\t\t\telse if(this._horizontalAlign == HorizontalAlign.RIGHT)\n\t\t\t{\n\t\t\t\tdisplayObject.x = this.actualWidth - this._paddingRight - displayObject.width;\n\t\t\t}\n\t\t\telse //center\n\t\t\t{\n\t\t\t\tdisplayObject.x = this._paddingLeft + Math.round((this.actualWidth - this._paddingLeft - this._paddingRight - displayObject.width) / 2);\n\t\t\t}\n\t\t\tif(this._verticalAlign == VerticalAlign.TOP)\n\t\t\t{\n\t\t\t\tdisplayObject.y = this._paddingTop;\n\t\t\t}\n\t\t\telse if(this._verticalAlign == VerticalAlign.BOTTOM)\n\t\t\t{\n\t\t\t\tdisplayObject.y = this.actualHeight - this._paddingBottom - displayObject.height;\n\t\t\t}\n\t\t\telse //middle\n\t\t\t{\n\t\t\t\tdisplayObject.y = this._paddingTop + Math.round((this.actualHeight - this._paddingTop - this._paddingBottom - displayObject.height) / 2);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function positionActionsRelativeToMessage():void\n\t\t{\n\t\t\tif(this._actionsPosition == RelativePosition.TOP)\n\t\t\t{\n\t\t\t\tif(this._gap == Number.POSITIVE_INFINITY)\n\t\t\t\t{\n\t\t\t\t\tthis.actionsGroup.y = this._paddingTop;\n\t\t\t\t\tthis.messageTextRenderer.y = this.actualHeight - this._paddingBottom - this.messageTextRenderer.height;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(this._verticalAlign == VerticalAlign.TOP)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.messageTextRenderer.y += this.actionsGroup.height + this._gap;\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._verticalAlign == VerticalAlign.MIDDLE)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.messageTextRenderer.y += Math.round((this.actionsGroup.height + this._gap) / 2);\n\t\t\t\t\t}\n\t\t\t\t\tthis.actionsGroup.y = this.messageTextRenderer.y - this.actionsGroup.height - this._gap;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(this._actionsPosition == RelativePosition.RIGHT)\n\t\t\t{\n\t\t\t\tif(this._gap == Number.POSITIVE_INFINITY)\n\t\t\t\t{\n\t\t\t\t\tthis.messageTextRenderer.x = this._paddingLeft;\n\t\t\t\t\tthis.actionsGroup.x = this.actualWidth - this._paddingRight - this.actionsGroup.width;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(this._horizontalAlign == HorizontalAlign.RIGHT)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.messageTextRenderer.x -= this.actionsGroup.width + this._gap;\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._horizontalAlign == HorizontalAlign.CENTER)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.messageTextRenderer.x -= Math.round((this.actionsGroup.width + this._gap) / 2);\n\t\t\t\t\t}\n\t\t\t\t\tthis.actionsGroup.x = this.messageTextRenderer.x + this.messageTextRenderer.width + this._gap;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(this._actionsPosition == RelativePosition.BOTTOM)\n\t\t\t{\n\t\t\t\tif(this._gap == Number.POSITIVE_INFINITY)\n\t\t\t\t{\n\t\t\t\t\tthis.messageTextRenderer.y = this._paddingTop;\n\t\t\t\t\tthis.actionsGroup.y = this.actualHeight - this._paddingBottom - this.actionsGroup.height;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(this._verticalAlign == VerticalAlign.BOTTOM)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.messageTextRenderer.y -= this.actionsGroup.height + this._gap;\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._verticalAlign == VerticalAlign.MIDDLE)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.messageTextRenderer.y -= Math.round((this.actionsGroup.height + this._gap) / 2);\n\t\t\t\t\t}\n\t\t\t\t\tthis.actionsGroup.y = this.messageTextRenderer.y + this.messageTextRenderer.height + this._gap;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(this._actionsPosition == RelativePosition.LEFT)\n\t\t\t{\n\t\t\t\tif(this._gap == Number.POSITIVE_INFINITY)\n\t\t\t\t{\n\t\t\t\t\tthis.actionsGroup.x = this._paddingLeft;\n\t\t\t\t\tthis.messageTextRenderer.x = this.actualWidth - this._paddingRight - this.messageTextRenderer.width;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(this._horizontalAlign == HorizontalAlign.LEFT)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.messageTextRenderer.x += this._gap + this.actionsGroup.width;\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._horizontalAlign == HorizontalAlign.CENTER)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.messageTextRenderer.x += Math.round((this._gap + this.actionsGroup.width) / 2);\n\t\t\t\t\t}\n\t\t\t\t\tthis.actionsGroup.x = this.messageTextRenderer.x - this._gap - this.actionsGroup.width;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(this._actionsPosition == RelativePosition.LEFT || this._actionsPosition == RelativePosition.RIGHT)\n\t\t\t{\n\t\t\t\tif(this._verticalAlign == VerticalAlign.TOP)\n\t\t\t\t{\n\t\t\t\t\tthis.actionsGroup.y = this._paddingTop;\n\t\t\t\t}\n\t\t\t\telse if(this._verticalAlign == VerticalAlign.BOTTOM)\n\t\t\t\t{\n\t\t\t\t\tthis.actionsGroup.y = this.actualHeight - this._paddingBottom - this.actionsGroup.height;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.actionsGroup.y = this._paddingTop + Math.round((this.actualHeight - this._paddingTop - this._paddingBottom - this.actionsGroup.height) / 2);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //top or bottom\n\t\t\t{\n\t\t\t\tif(this._horizontalAlign == HorizontalAlign.LEFT)\n\t\t\t\t{\n\t\t\t\t\tthis.actionsGroup.x = this._paddingLeft;\n\t\t\t\t}\n\t\t\t\telse if(this._horizontalAlign == HorizontalAlign.RIGHT)\n\t\t\t\t{\n\t\t\t\t\tthis.actionsGroup.x = this.actualWidth - this._paddingRight - this.actionsGroup.width;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.actionsGroup.x = this._paddingLeft + Math.round((this.actualWidth - this._paddingLeft - this._paddingRight - this.actionsGroup.width) / 2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function startTimeout():void\n\t\t{\n\t\t\tif(this._timeout == Number.POSITIVE_INFINITY)\n\t\t\t{\n\t\t\t\tthis.removeEventListener(Event.ENTER_FRAME, this.toast_timeout_enterFrameHandler);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._startTime = getTimer();\n\t\t\tthis.addEventListener(Event.ENTER_FRAME, this.toast_timeout_enterFrameHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function completeClose():void\n\t\t{\n\t\t\tvar closeData:Object = this._closeData;\n\t\t\tvar dispose:Boolean = this._disposeFromCloseCall;\n\t\t\tthis._closeEffectContext = null;\n\t\t\tthis._closeData = null;\n\t\t\tthis._disposeFromCloseCall = false;\n\t\t\tthis._isClosing = false;\n\t\t\tthis._isOpen = false;\n\t\t\t//remove from parent before dispatching close so that the parent\n\t\t\t//layout is updated before any new toasts are added, but don't\n\t\t\t//dispose the toast yet!\n\t\t\tthis.removeFromParent(false);\n\t\t\tthis.dispatchEventWith(Event.CLOSE, false, closeData);\n\t\t\tif(dispose)\n\t\t\t{\n\t\t\t\t//dispose after the close event has been dispatched so that the\n\t\t\t\t//listeners aren't removed\n\t\t\t\tthis.dispose();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function completeOpen():void\n\t\t{\n\t\t\tthis._openEffectContext = null;\n\t\t\tthis._isOpening = false;\n\t\t\tthis._isOpen = true;\n\t\t\tthis.dispatchEventWith(Event.OPEN);\n\t\t\tthis.startTimeout();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function toast_timeout_enterFrameHandler(event:Event):void\n\t\t{\n\t\t\tvar totalTime:int = (getTimer() - this._startTime) / 1000;\n\t\t\tif(totalTime > this._timeout)\n\t\t\t{\n\t\t\t\tthis.close(this._disposeOnSelfClose);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function fontStyles_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function closeToast(data:Object, dispose:Boolean):void\n\t\t{\n\t\t\tif(!this.parent || this._isClosing)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._suspendEffectsCount == 0 && this._openEffectContext !== null)\n\t\t\t{\n\t\t\t\tthis._openEffectContext.interrupt();\n\t\t\t\tthis._openEffectContext = null;\n\t\t\t}\n\t\t\tthis._isClosing = true;\n\t\t\tthis._closeData = data;\n\t\t\tthis._disposeFromCloseCall = dispose;\n\t\t\tthis.removeEventListener(Event.ENTER_FRAME, this.toast_timeout_enterFrameHandler);\n\t\t\tif(this._closeEffect !== null)\n\t\t\t{\n\t\t\t\tthis._closeEffectContext = IEffectContext(this._closeEffect(this));\n\t\t\t\tthis._closeEffectContext.addEventListener(Event.COMPLETE, closeEffectContext_completeHandler);\n\t\t\t\tthis._closeEffectContext.play();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.completeClose();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function actionsGroup_triggeredHandler(event:Event, data:Object):void\n\t\t{\n\t\t\tthis.closeToast(data, this._disposeOnSelfClose);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function closeEffectContext_completeHandler(event:Event):void\n\t\t{\n\t\t\tthis.completeClose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function openEffectContext_completeHandler(event:Event):void\n\t\t{\n\t\t\tthis.completeOpen();\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/controls/ToastQueueMode.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\t/**\n\t * Constants to control how the toast queue will behave when the maximum\n\t * number of allowed toasts are visible.\n\t *\n\t * @productversion Feathers 4.0.0\n\t *\n\t * @see feathers.controls.Toast\n\t */\n\tpublic class ToastQueueMode\n\t{\n\t\t/**\n\t\t * If a new toast is queued up, and any of the active toasts have a\n\t\t * timeout, the timeout is cancelled immediately, and the new toast is\n\t\t * displayed after the active toast has finished closing.\n\t\t *\n\t\t * @productversion Feathers 4.0.0\n\t\t */\n\t\tpublic static const CANCEL_TIMEOUT:String = \"cancelTimeout\";\n\n\t\t/**\n\t\t * If a new toast is queued up, waits indefinitely until the next active\n\t\t * toast closes.\n\t\t *\n\t\t * @productversion Feathers 4.0.0\n\t\t */\n\t\tpublic static const WAIT_FOR_TIMEOUT:String = \"waitForTimeout\";\n\t}\n}"
  },
  {
    "path": "source/feathers/controls/ToggleButton.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.core.IGroupedToggle;\n\timport feathers.core.ToggleGroup;\n\timport feathers.events.FeathersEventType;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.utils.keyboard.KeyToSelect;\n\timport feathers.utils.touch.TapToSelect;\n\n\timport flash.ui.Keyboard;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.text.TextFormat;\n\n\t[Exclude(name=\"defaultSelectedLabelProperties\",kind=\"property\")]\n\t[Exclude(name=\"selectedUpLabelProperties\",kind=\"property\")]\n\t[Exclude(name=\"selectedDownLabelProperties\",kind=\"property\")]\n\t[Exclude(name=\"selectedHoverLabelProperties\",kind=\"property\")]\n\t[Exclude(name=\"selectedDisabledLabelProperties\",kind=\"property\")]\n\n\t/**\n\t * The icon used when no other icon is defined for the current state\n\t * when the button is selected. Has a higher priority than\n\t * <code>defaultIcon</code>, but a lower priority than other selected\n\t * icons.\n\t *\n\t * <p>This property will be ignored if a function is passed to the\n\t * <code>stateToIconFunction</code> property.</p>\n\t *\n\t * <p>The following example gives the button a default icon to use for\n\t * all selected states when no specific icon is available:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.defaultSelectedIcon = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:defaultIcon\n\t * @see #setIconForState()\n\t */\n\t[Style(name=\"defaultSelectedIcon\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The skin used when no other skin is defined for the current state\n\t * when the button is selected. Has a higher priority than\n\t * <code>defaultSkin</code>, but a lower priority than other selected\n\t * skins.\n\t *\n\t * <p>This property will be ignored if a function is passed to the\n\t * <code>stateToSkinFunction</code> property.</p>\n\t *\n\t * <p>The following example gives the button a default skin to use for\n\t * all selected states when no specific skin is available:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.defaultSelectedSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:defaultSkin\n\t * @see #setSkinForState()\n\t */\n\t[Style(name=\"defaultSelectedSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * If not <code>NaN</code>, the button renders at this scale when selected.\n\t * Otherwise, defaults to <code>1</code>.\n\t *\n\t * <p>The following example scales the button when selected:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.scaleWhenSelected = 0.9;</listing>\n\t *\n\t * @default 1\n\t *\n\t * @see #isSelected\n\t * @see #getScaleForState()\n\t * @see #setScaleForState()\n\t */\n\t[Style(name=\"scaleWhenSelected\",type=\"Number\")]\n\n\t/**\n\t * The icon used for the button's disabled state when the button is\n\t * selected. If <code>null</code>, then <code>defaultSelectedIcon</code>\n\t * is used instead. If <code>defaultSelectedIcon</code> is also\n\t * <code>null</code>, then <code>defaultIcon</code> is used.\n\t *\n\t * <p>This property will be ignored if a function is passed to the\n\t * <code>stateToIconFunction</code> property.</p>\n\t *\n\t * <p>The following example gives the button an icon for the selected disabled state:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.selectedDisabledIcon = new Image( texture );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setIconForState()</code> with\n\t * <code>ButtonState.DISABLED_AND_SELECTED</code> to set the same icon:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var icon:Image = new Image( texture );\n\t * button.setIconForState( ButtonState.DISABLED_AND_SELECTED, icon );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:defaultIcon\n\t * @see #style:defaultSelectedIcon\n\t * @see feathers.controls.ButtonState#DISABLED_AND_SELECTED\n\t */\n\t[Style(name=\"selectedDisabledIcon\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The skin used for the button's disabled state when the button is\n\t * selected. If <code>null</code>, then <code>defaultSelectedSkin</code>\n\t * is used instead. If <code>defaultSelectedSkin</code> is also\n\t * <code>null</code>, then <code>defaultSkin</code> is used.\n\t *\n\t * <p>This property will be ignored if a function is passed to the\n\t * <code>stateToSkinFunction</code> property.</p>\n\t *\n\t * <p>The following example gives the button a skin for the selected disabled state:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.selectedDisabledSkin = new Image( texture );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setSkinForState()</code> with\n\t * <code>ButtonState.DISABLED_AND_SELECTED</code> to set the same skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var skin:Image = new Image( texture );\n\t * button.setSkinForState( ButtonState.DISABLED_AND_SELECTED, skin );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:defaultSkin\n\t * @see #style:defaultSelectedSkin\n\t * @see feathers.controls.ButtonState#DISABLED_AND_SELECTED\n\t */\n\t[Style(name=\"selectedDisabledSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The font styles used to display the button's text when the button is\n\t * selected.\n\t *\n\t * <p>In the following example, the selected font styles are customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.selectedFontStyles = new TextFormat( \"Helvetica\", 20, 0x999999 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>labelFactory</code> to set more advanced styles on the\n\t * text renderer.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:fontStyles\n\t */\n\t[Style(name=\"selectedFontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The icon used for the button's hover state when the button is\n\t * selected. If <code>null</code>, then <code>defaultSelectedIcon</code>\n\t * is used instead. If <code>defaultSelectedIcon</code> is also\n\t * <code>null</code>, then <code>defaultIcon</code> is used.\n\t *\n\t * <p>This property will be ignored if a function is passed to the\n\t * <code>stateToIconFunction</code> property.</p>\n\t *\n\t * <p>The following example gives the button an icon for the selected hover state:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.selectedHoverIcon = new Image( texture );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setIconForState()</code> with\n\t * <code>ButtonState.HOVER_AND_SELECTED</code> to set the same icon:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var icon:Image = new Image( texture );\n\t * button.setIconForState( ButtonState.HOVER_AND_SELECTED, icon );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:defaultIcon\n\t * @see #style:defaultSelectedIcon\n\t * @see feathers.controls.ButtonState#HOVER_AND_SELECTED\n\t */\n\t[Style(name=\"selectedHoverIcon\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The skin used for the button's hover state when the button is\n\t * selected. If <code>null</code>, then <code>defaultSelectedSkin</code>\n\t * is used instead. If <code>defaultSelectedSkin</code> is also\n\t * <code>null</code>, then <code>defaultSkin</code> is used.\n\t *\n\t * <p>This property will be ignored if a function is passed to the\n\t * <code>stateToSkinFunction</code> property.</p>\n\t *\n\t * <p>The following example gives the button a skin for the selected hover state:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.selectedHoverSkin = new Image( texture );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setSkinForState()</code> with\n\t * <code>ButtonState.HOVER_AND_SELECTED</code> to set the same skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var skin:Image = new Image( texture );\n\t * button.setSkinForState( ButtonState.HOVER_AND_SELECTED, skin );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:defaultSkin\n\t * @see #style:defaultSelectedSkin\n\t * @see feathers.controls.ButtonState#HOVER_AND_SELECTED\n\t */\n\t[Style(name=\"selectedHoverSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The icon used for the button's down state when the button is\n\t * selected. If <code>null</code>, then <code>defaultSelectedIcon</code>\n\t * is used instead. If <code>defaultSelectedIcon</code> is also\n\t * <code>null</code>, then <code>defaultIcon</code> is used.\n\t *\n\t * <p>This property will be ignored if a function is passed to the\n\t * <code>stateToIconFunction</code> property.</p>\n\t *\n\t * <p>The following example gives the button an icon for the selected down state:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.selectedDownIcon = new Image( texture );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setIconForState()</code> with\n\t * <code>ButtonState.DOWN_AND_SELECTED</code> to set the same icon:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var icon:Image = new Image( texture );\n\t * button.setIconForState( ButtonState.DOWN_AND_SELECTED, icon );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:defaultIcon\n\t * @see #style:defaultSelectedIcon\n\t * @see feathers.controls.ButtonState#DOWN_AND_SELECTED\n\t */\n\t[Style(name=\"selectedDownIcon\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The skin used for the button's down state when the button is\n\t * selected. If <code>null</code>, then <code>defaultSelectedSkin</code>\n\t * is used instead. If <code>defaultSelectedSkin</code> is also\n\t * <code>null</code>, then <code>defaultSkin</code> is used.\n\t *\n\t * <p>This property will be ignored if a function is passed to the\n\t * <code>stateToSkinFunction</code> property.</p>\n\t *\n\t * <p>The following example gives the button a skin for the selected down state:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.selectedDownSkin = new Image( texture );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setSkinForState()</code> with\n\t * <code>ButtonState.DOWN_AND_SELECTED</code> to set the same skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var skin:Image = new Image( texture );\n\t * button.setSkinForState( ButtonState.DOWN_AND_SELECTED, skin );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:defaultSkin\n\t * @see #style:defaultSelectedSkin\n\t * @see feathers.controls.ButtonState#DOWN_AND_SELECTED\n\t */\n\t[Style(name=\"selectedDownSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The icon used for the button's up state when the button is\n\t * selected. If <code>null</code>, then <code>defaultSelectedIcon</code>\n\t * is used instead. If <code>defaultSelectedIcon</code> is also\n\t * <code>null</code>, then <code>defaultIcon</code> is used.\n\t *\n\t * <p>This property will be ignored if a function is passed to the\n\t * <code>stateToIconFunction</code> property.</p>\n\t *\n\t * <p>The following example gives the button an icon for the selected up state:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.selectedUpIcon = new Image( texture );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setIconForState()</code> with\n\t * <code>ButtonState.UP_AND_SELECTED</code> to set the same icon:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var icon:Image = new Image( texture );\n\t * button.setIconForState( ButtonState.UP_AND_SELECTED, icon );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:defaultIcon\n\t * @see #style:defaultSelectedIcon\n\t * @see feathers.controls.ButtonState#UP_AND_SELECTED\n\t */\n\t[Style(name=\"selectedUpIcon\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The skin used for the button's up state when the button is selected.\n\t * If <code>null</code>, then <code>defaultSelectedSkin</code> is used\n\t * instead. If <code>defaultSelectedSkin</code> is also\n\t * <code>null</code>, then <code>defaultSkin</code> is used.\n\t *\n\t * <p>This property will be ignored if a function is passed to the\n\t * <code>stateToSkinFunction</code> property.</p>\n\t *\n\t * <p>The following example gives the button a skin for the selected up state:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.selectedUpSkin = new Image( texture );</listing>\n\t *\n\t * <p>Alternatively, you may use <code>setSkinForState()</code> with\n\t * <code>ButtonState.UP_AND_SELECTED</code> to set the same skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var skin:Image = new Image( texture );\n\t * button.setSkinForState( ButtonState.UP_AND_SELECTED, skin );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:defaultSkin\n\t * @see #style:defaultSelectedSkin\n\t * @see feathers.controls.ButtonState#UP_AND_SELECTED\n\t */\n\t[Style(name=\"selectedUpSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * Dispatched when the button is selected or deselected either\n\t * programmatically or as a result of user interaction. The value of the\n\t * <code>isSelected</code> property indicates whether the button is selected\n\t * or not. Use interaction may only change selection when the\n\t * <code>isToggle</code> property is set to <code>true</code>.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t *\n\t * @see #isSelected\n\t * @see #isToggle\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * A button that may be selected and deselected when triggered.\n\t *\n\t * <p>The following example creates a toggle button, and listens for when\n\t * its selection changes:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var button:ToggleButton = new ToggleButton();\n\t * button.label = \"Click Me\";\n\t * button.addEventListener( Event.CHANGE, button_changeHandler );\n\t * this.addChild( button );</listing>\n\t *\n\t * @see ../../../help/toggle-button.html How to use the Feathers ToggleButton component\n\t *\n\t * @productversion Feathers 2.0.0\n\t */\n\tpublic class ToggleButton extends Button implements IGroupedToggle\n\t{\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>ToggleButton</code>\n\t\t * components. If <code>null</code>, falls back to using\n\t\t * <code>Button.globalStyleProvider</code> instead.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t * @see feathers.controls.Button#globalStyleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function ToggleButton()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\tif(ToggleButton.globalStyleProvider)\n\t\t\t{\n\t\t\t\treturn ToggleButton.globalStyleProvider;\n\t\t\t}\n\t\t\treturn Button.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function get currentState():String\n\t\t{\n\t\t\tif(this._isSelected)\n\t\t\t{\n\t\t\t\treturn super.currentState + \"AndSelected\";\n\t\t\t}\n\t\t\treturn super.currentState;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var tapToSelect:TapToSelect;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var keyToSelect:KeyToSelect;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var dpadEnterKeyToSelect:KeyToSelect;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isToggle:Boolean = true;\n\n\t\t/**\n\t\t * Determines if the button may be selected or deselected as a result of\n\t\t * user interaction. If <code>true</code>, the value of the\n\t\t * <code>isSelected</code> property will be toggled when the button is\n\t\t * triggered.\n\t\t *\n\t\t * <p>The following example disables the ability to toggle:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * button.isToggle = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t *\n\t\t * @see #isSelected\n\t\t * @see #event:triggered Event.TRIGGERED\n\t\t */\n\t\tpublic function get isToggle():Boolean\n\t\t{\n\t\t\treturn this._isToggle;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isToggle(value:Boolean):void\n\t\t{\n\t\t\tif(this._isToggle === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isToggle = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isSelected:Boolean = false;\n\n\t\t/**\n\t\t * Indicates if the button is selected or not. The button may be\n\t\t * selected programmatically, even if <code>isToggle</code> is <code>false</code>,\n\t\t * but generally, <code>isToggle</code> should be set to <code>true</code>\n\t\t * to allow the user to select and deselect it by triggering the button\n\t\t * with a click or tap. If focus management is enabled, a button may\n\t\t * also be triggered with the spacebar when the button has focus.\n\t\t *\n\t\t * <p>The following example enables the button to toggle and selects it\n\t\t * automatically:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * button.isToggle = true;\n\t\t * button.isSelected = true;</listing>\n\t\t *\n\t\t * <p><strong>Warning:</strong> Do not listen to\n\t\t * <code>Event.TRIGGERED</code> to be notified when the\n\t\t * <code>isSelected</code> property changes. You must listen to\n\t\t * <code>Event.CHANGE</code>.</p>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see #event:change Event.CHANGE\n\t\t * @see #isToggle\n\t\t */\n\t\tpublic function get isSelected():Boolean\n\t\t{\n\t\t\treturn this._isSelected;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isSelected(value:Boolean):void\n\t\t{\n\t\t\tif(this._isSelected === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isSelected = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STATE);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tthis.dispatchEventWith(FeathersEventType.STATE_CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _toggleGroup:ToggleGroup;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get toggleGroup():ToggleGroup\n\t\t{\n\t\t\treturn this._toggleGroup;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set toggleGroup(value:ToggleGroup):void\n\t\t{\n\t\t\tif(this._toggleGroup == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._toggleGroup && this._toggleGroup.hasItem(this))\n\t\t\t{\n\t\t\t\tthis._toggleGroup.removeItem(this);\n\t\t\t}\n\t\t\tthis._toggleGroup = value;\n\t\t\tif(this._toggleGroup && !this._toggleGroup.hasItem(this))\n\t\t\t{\n\t\t\t\tthis._toggleGroup.addItem(this);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _defaultSelectedSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get defaultSelectedSkin():DisplayObject\n\t\t{\n\t\t\treturn this._defaultSelectedSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set defaultSelectedSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._defaultSelectedSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._defaultSelectedSkin !== null &&\n\t\t\t\tthis.currentSkin === this._defaultSelectedSkin)\n\t\t\t{\n\t\t\t\t//if this icon needs to be reused somewhere else, we need to\n\t\t\t\t//properly clean it up\n\t\t\t\tthis.removeCurrentSkin(this._defaultSelectedSkin);\n\t\t\t\tthis.currentSkin = null;\n\t\t\t}\n\t\t\tthis._defaultSelectedSkin = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get selectedUpSkin():DisplayObject\n\t\t{\n\t\t\treturn this.getSkinForState(ButtonState.UP_AND_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedUpSkin(value:DisplayObject):void\n\t\t{\n\t\t\tthis.setSkinForState(ButtonState.UP_AND_SELECTED, value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get selectedDownSkin():DisplayObject\n\t\t{\n\t\t\treturn this.getSkinForState(ButtonState.DOWN_AND_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedDownSkin(value:DisplayObject):void\n\t\t{\n\t\t\tthis.setSkinForState(ButtonState.DOWN_AND_SELECTED, value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get selectedHoverSkin():DisplayObject\n\t\t{\n\t\t\treturn this.getSkinForState(ButtonState.HOVER_AND_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedHoverSkin(value:DisplayObject):void\n\t\t{\n\t\t\tthis.setSkinForState(ButtonState.HOVER_AND_SELECTED, value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get selectedDisabledSkin():DisplayObject\n\t\t{\n\t\t\treturn this.getSkinForState(ButtonState.DISABLED_AND_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedDisabledSkin(value:DisplayObject):void\n\t\t{\n\t\t\tthis.setSkinForState(ButtonState.DISABLED_AND_SELECTED, value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get selectedFontStyles():TextFormat\n\t\t{\n\t\t\treturn this._fontStylesSet.selectedFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedFontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._fontStylesSet.selectedFormat;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._fontStylesSet.selectedFormat = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _defaultSelectedIcon:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get defaultSelectedIcon():DisplayObject\n\t\t{\n\t\t\treturn this._defaultSelectedIcon;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set defaultSelectedIcon(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._defaultSelectedIcon === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._defaultSelectedIcon !== null &&\n\t\t\t\tthis.currentIcon === this._defaultSelectedIcon)\n\t\t\t{\n\t\t\t\t//if this icon needs to be reused somewhere else, we need to\n\t\t\t\t//properly clean it up\n\t\t\t\tthis.removeCurrentIcon(this._defaultSelectedIcon);\n\t\t\t\tthis.currentIcon = null;\n\t\t\t}\n\t\t\tthis._defaultSelectedIcon = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get selectedUpIcon():DisplayObject\n\t\t{\n\t\t\treturn this.getIconForState(ButtonState.UP_AND_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedUpIcon(value:DisplayObject):void\n\t\t{\n\t\t\tthis.setIconForState(ButtonState.UP_AND_SELECTED, value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get selectedDownIcon():DisplayObject\n\t\t{\n\t\t\treturn this.getIconForState(ButtonState.DOWN_AND_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedDownIcon(value:DisplayObject):void\n\t\t{\n\t\t\tthis.setIconForState(ButtonState.DOWN_AND_SELECTED, value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get selectedHoverIcon():DisplayObject\n\t\t{\n\t\t\treturn this.getIconForState(ButtonState.HOVER_AND_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedHoverIcon(value:DisplayObject):void\n\t\t{\n\t\t\tthis.setIconForState(ButtonState.HOVER_AND_SELECTED, value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get selectedDisabledIcon():DisplayObject\n\t\t{\n\t\t\treturn this.getIconForState(ButtonState.DISABLED_AND_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedDisabledIcon(value:DisplayObject):void\n\t\t{\n\t\t\tthis.setIconForState(ButtonState.DISABLED_AND_SELECTED, value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _scaleWhenSelected:Number = 1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get scaleWhenSelected():Number\n\t\t{\n\t\t\treturn this._scaleWhenSelected;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set scaleWhenSelected(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._scaleWhenSelected == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._scaleWhenSelected = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this._defaultSelectedSkin && this._defaultSelectedSkin.parent !== this)\n\t\t\t{\n\t\t\t\tthis._defaultSelectedSkin.dispose();\n\t\t\t}\n\t\t\tif(this._defaultSelectedIcon && this._defaultSelectedIcon.parent !== this)\n\t\t\t{\n\t\t\t\tthis._defaultSelectedIcon.dispose();\n\t\t\t}\n\t\t\tif(this.keyToSelect !== null)\n\t\t\t{\n\t\t\t\t//setting the target to null will remove listeners and do any\n\t\t\t\t//other clean up that is needed\n\t\t\t\tthis.keyToSelect.target = null;\n\t\t\t}\n\t\t\tif(this.dpadEnterKeyToSelect !== null)\n\t\t\t{\n\t\t\t\tthis.dpadEnterKeyToSelect.target = null;\n\t\t\t}\n\t\t\tif(this.tapToSelect !== null)\n\t\t\t{\n\t\t\t\tthis.tapToSelect.target = null;\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tsuper.initialize();\n\t\t\tif(!this.tapToSelect)\n\t\t\t{\n\t\t\t\tthis.tapToSelect = new TapToSelect(this);\n\t\t\t\tthis.longPress.tapToSelect = this.tapToSelect;\n\t\t\t}\n\t\t\tif(!this.keyToSelect)\n\t\t\t{\n\t\t\t\tthis.keyToSelect = new KeyToSelect(this);\n\t\t\t}\n\t\t\tif(!this.dpadEnterKeyToSelect)\n\t\t\t{\n\t\t\t\tthis.dpadEnterKeyToSelect = new KeyToSelect(this, Keyboard.ENTER);\n\t\t\t\tthis.dpadEnterKeyToState.keyLocation = 4; //KeyLocation.D_PAD is only in AIR\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\n\t\t\tif(stylesInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshSelectionEvents();\n\t\t\t}\n\n\t\t\tsuper.draw();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function getCurrentSkin():DisplayObject\n\t\t{\n\t\t\t//we use the currentState getter here instead of the variable\n\t\t\t//because the variable does not keep track of the selection\n\t\t\tvar result:DisplayObject = this._stateToSkin[this.currentState] as DisplayObject;\n\t\t\tif(result !== null)\n\t\t\t{\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tif(this._isSelected && this._defaultSelectedSkin !== null)\n\t\t\t{\n\t\t\t\treturn this._defaultSelectedSkin;\n\t\t\t}\n\t\t\treturn this._defaultSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function getCurrentIcon():DisplayObject\n\t\t{\n\t\t\t//we use the currentState getter here instead of the variable\n\t\t\t//because the variable does not keep track of the selection\n\t\t\tvar result:DisplayObject = this._stateToIcon[this.currentState] as DisplayObject;\n\t\t\tif(result !== null)\n\t\t\t{\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tif(this._isSelected && this._defaultSelectedIcon !== null)\n\t\t\t{\n\t\t\t\treturn this._defaultSelectedIcon;\n\t\t\t}\n\t\t\treturn this._defaultIcon;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function getScaleForCurrentState(state:String = null):Number\n\t\t{\n\t\t\tif(state === null)\n\t\t\t{\n\t\t\t\tstate = this.currentState;\n\t\t\t}\n\t\t\tif(state in this._stateToScale)\n\t\t\t{\n\t\t\t\treturn this._stateToScale[state];\n\t\t\t}\n\t\t\telse if(this._isSelected)\n\t\t\t{\n\t\t\t\treturn this._scaleWhenSelected;\n\t\t\t}\n\t\t\treturn 1;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshSelectionEvents():void\n\t\t{\n\t\t\tthis.tapToSelect.isEnabled = this._isEnabled && this._isToggle;\n\t\t\tthis.tapToSelect.tapToDeselect = this._isToggle;\n\t\t\tthis.keyToSelect.isEnabled = this._isEnabled && this._isToggle;\n\t\t\tthis.keyToSelect.keyToDeselect = this._isToggle;\n\t\t\tthis.dpadEnterKeyToSelect.isEnabled = this._isEnabled && this._isToggle;\n\t\t\tthis.dpadEnterKeyToSelect.keyToDeselect = this._isToggle;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/ToggleState.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\t/**\n\t * States for simple toggle components.\n\t *\n\t * @see feathers.core.IToggle\n\t * @see feathers.controls.ToggleSwitch\n\t *\n\t * @productversion Feathers 3.1.0\n\t */\n\tpublic class ToggleState\n\t{\n\t\t/**\n\t\t * The state where the component is not selected. If the component\n\t\t * implements the <code>IToggle</code> interface, the\n\t\t * <code>isSelected</code> property will be <code>false</code>.\n\t\t *\n\t\t * @see feathers.core.IToggle\n\t\t *\n\t\t * @productversion Feathers 3.1.0\n\t\t */\n\t\tpublic static const NOT_SELECTED:String = \"notSelected\";\n\n\t\t/**\n\t\t * The state where the component is selected. If the component\n\t\t * implements the <code>IToggle</code> interface, the\n\t\t * <code>isSelected</code> property will be <code>true</code>.\n\t\t *\n\t\t * @see feathers.core.IToggle\n\t\t *\n\t\t * @productversion Feathers 3.1.0\n\t\t */\n\t\tpublic static const SELECTED:String = \"selected\";\n\n\t\t/**\n\t\t * The state where the component is not selected and disabled. If the\n\t\t * component implements the <code>IToggle</code> interface, the\n\t\t * <code>isSelected</code> property will be <code>false</code>. The\n\t\t * <code>isEnabled</code> property will be <code>false</code>.\n\t\t *\n\t\t * @see feathers.core.IToggle\n\t\t *\n\t\t * @productversion Feathers 3.1.0\n\t\t */\n\t\tpublic static const DISABLED:String = \"disabled\";\n\n\t\t/**\n\t\t * The state where the component is selected and disabled. If the\n\t\t * component implements the <code>IToggle</code> interface, the\n\t\t * <code>isSelected</code> property will be <code>true</code>. The\n\t\t * <code>isEnabled</code> property will be <code>false</code>.\n\t\t *\n\t\t * @see feathers.core.IToggle\n\t\t *\n\t\t * @productversion Feathers 3.1.0\n\t\t */\n\t\tpublic static const SELECTED_AND_DISABLED:String = \"selectedAndDisabled\";\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/ToggleSwitch.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IFocusDisplayObject;\n\timport feathers.core.IMeasureDisplayObject;\n\timport feathers.core.IStateContext;\n\timport feathers.core.ITextBaselineControl;\n\timport feathers.core.ITextRenderer;\n\timport feathers.core.IToggle;\n\timport feathers.core.IValidating;\n\timport feathers.core.PropertyProxy;\n\timport feathers.events.ExclusiveTouch;\n\timport feathers.events.FeathersEventType;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.system.DeviceCapabilities;\n\timport feathers.text.FontStylesSet;\n\n\timport flash.geom.Point;\n\timport flash.ui.KeyLocation;\n\timport flash.ui.Keyboard;\n\n\timport starling.animation.Transitions;\n\timport starling.animation.Tween;\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.KeyboardEvent;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.text.TextFormat;\n\timport starling.utils.SystemUtil;\n\n\t/**\n\t * A style name to add to the toggle switch's on label text renderer\n\t * sub-component. Typically used by a theme to provide different styles\n\t * to different buttons.\n\t *\n\t * <p>In the following example, a custom on label style name is passed\n\t * to the toggle switch:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toggle.customOnLabelStyleName = \"my-custom-toggle-on-label\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( BitmapFontTextRenderer ).setFunctionForStyleName( \"my-custom-toggle-on-label\", setCustomToggleSwitchOnLabelStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_ON_LABEL\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #onLabelFactory\n\t */\n\t[Style(name=\"customOnLabelStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to the toggle switch's on track sub-component.\n\t * Typically used by a theme to provide different styles to different\n\t * toggle switches.\n\t *\n\t * <p>In the following example, a custom on track style name is passed to\n\t * the toggle switch:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toggle.customOnTrackStyleName = \"my-custom-on-track\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( Button ).setFunctionForStyleName( \"my-custom-on-track\", setCustomOnTrackStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_ON_TRACK\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #onTrackFactory\n\t */\n\t[Style(name=\"customOnTrackStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to the toggle switch's off label text renderer\n\t * sub-component. Typically used by a theme to provide different styles\n\t * to different toggle switches.\n\t *\n\t * <p>In the following example, a custom off label style name is passed\n\t * to the toggle switch:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toggle.customOffLabelStyleName = \"my-custom-toggle-off-label\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( BitmapFontTextRenderer ).setFunctionForStyleName( \"my-custom-toggle-off-label\", setCustomToggleSwitchOffLabelStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_OFF_LABEL\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #offLabelFactory\n\t */\n\t[Style(name=\"customOffLabelStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to the toggle switch's off track sub-component.\n\t * Typically used by a theme to provide different styles to different\n\t * toggle switches.\n\t *\n\t * <p>In the following example, a custom off track style name is passed\n\t * to the toggle switch:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toggle.customOffTrackStyleName = \"my-custom-off-track\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( Button ).setFunctionForStyleName( \"my-custom-off-track\", setCustomOffTrackStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_OFF_TRACK\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #offTrackFactory\n\t */\n\t[Style(name=\"customOffTrackStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to the toggle switch's thumb sub-component.\n\t * Typically used by a theme to provide different styles to different\n\t * toggle switches.\n\t *\n\t * <p>In the following example, a custom thumb style name is passed to\n\t * the toggle switch:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toggle.customThumbStyleName = \"my-custom-thumb\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( Button ).setFunctionForStyleName( \"my-custom-thumb\", setCustomThumbStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_THUMB\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #thumbFactory\n\t */\n\t[Style(name=\"customThumbStyleName\",type=\"String\")]\n\n\t/**\n\t * The font styles used to display the on label's text when the toggle\n\t * switch is disabled.\n\t *\n\t * <p>In the following example, the on labels' disabled font styles are\n\t * customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toggle.onLabelDisabledFontStyles = new TextFormat( \"Helvetica\", 20, 0x999999 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>onLabelFactory</code> to set more advanced styles on the\n\t * text renderer.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:onLabelFontStyles\n\t */\n\t[Style(name=\"onLabelDisabledFontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The font styles used to display the on label's text.\n\t *\n\t * <p>In the following example, the on label's font styles are\n\t * customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toggle.onLabelFontStyles = new TextFormat( \"Helvetica\", 20, 0xcc0000 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>onLabelFactory</code> to set more advanced styles.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:onLabelDisabledFontStyles\n\t * @see #style:onLabelSelectedFontStyles\n\t * @see #setOnLabelFontStylesForState();\n\t */\n\t[Style(name=\"onLabelFontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The font styles used to display the on label's text when the toggle\n\t * switch is selected.\n\t *\n\t * <p>In the following example, the on label's selected font styles are\n\t * customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toggle.onLabelSelectedFontStyles = new TextFormat( \"Helvetica\", 20, 0xff0000 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>onLabelFactory</code> to set more advanced styles on the\n\t * text renderer.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:onLabelFontStyles\n\t */\n\t[Style(name=\"onLabelSelectedFontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The text to display in the \"on\" label text renderer.\n\t *\n\t * <p>In the following example, the toggle switch's \"on\" label text is\n\t * updated:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toggle.onText = \"on\";</listing>\n\t *\n\t * @default \"ON\"\n\t *\n\t * @see #style:offText\n\t */\n\t[Style(name=\"onText\",type=\"String\")]\n\n\t/**\n\t * The font styles used to display the off label's text when the toggle\n\t * switch is disabled.\n\t *\n\t * <p>In the following example, the off labels' disabled font styles are\n\t * customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toggle.offLabelDisabledFontStyles = new TextFormat( \"Helvetica\", 20, 0x999999 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>offLabelFactory</code> to set more advanced styles on the\n\t * text renderer.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:offLabelFontStyles\n\t */\n\t[Style(name=\"offLabelDisabledFontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The font styles used to display the off label's text.\n\t *\n\t * <p>In the following example, the off label's font styles are\n\t * customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toggle.offLabelFontStyles = new TextFormat( \"Helvetica\", 20, 0xcc0000 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>offLabelFactory</code> to set more advanced styles.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:offLabelDisabledFontStyles\n\t * @see #style:offLabelSelectedFontStyles\n\t * @see #setOffLabelFontStylesForState();\n\t */\n\t[Style(name=\"offLabelFontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The font styles used to display the off label's text when the toggle\n\t * switch is selected.\n\t *\n\t * <p>In the following example, the off label's selected font styles are\n\t * customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toggle.offLabelSelectedFontStyles = new TextFormat( \"Helvetica\", 20, 0xff0000 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>offLabelFactory</code> to set more advanced styles on the\n\t * text renderer.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:offLabelFontStyles\n\t */\n\t[Style(name=\"offLabelSelectedFontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The text to display in the \"off\" label text renderer.\n\t *\n\t * <p>In the following example, the toggle switch's off label text is\n\t * updated:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toggle.offText = \"off\";</listing>\n\t *\n\t * @default \"OFF\"\n\t *\n\t * @see #style:onText\n\t */\n\t[Style(name=\"offText\",type=\"String\")]\n\n\t/**\n\t * The minimum space, in pixels, between the switch's left edge and the\n\t * switch's content.\n\t *\n\t * <p>In the following example, the toggle switch's left padding is\n\t * set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toggle.paddingLeft = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:paddingRight\n\t */\n\t[Style(name=\"paddingLeft\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the switch's right edge and the\n\t * switch's content.\n\t *\n\t * <p>In the following example, the toggle switch's right padding is\n\t * set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toggle.paddingRight = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:paddingLeft\n\t */\n\t[Style(name=\"paddingRight\",type=\"Number\")]\n\n\t/**\n\t * Determines if the labels should be drawn. The onTrackSkin and\n\t * offTrackSkin backgrounds may include the text instead.\n\t *\n\t * <p>In the following example, the toggle switch's labels are hidden:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toggle.showLabels = false;</listing>\n\t *\n\t * @default true\n\t */\n\t[Style(name=\"showLabels\",type=\"Boolean\")]\n\n\t/**\n\t * Determines if the thumb should be displayed. This stops interaction\n\t * while still displaying the background.\n\t *\n\t * <p>In the following example, the toggle switch's thumb is hidden:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toggle.showThumb = false;</listing>\n\t *\n\t * @default true\n\t */\n\t[Style(name=\"showThumb\",type=\"Boolean\")]\n\n\t/**\n\t * The duration, in seconds, of the animation when the toggle switch\n\t * is toggled and animates the position of the thumb.\n\t *\n\t * <p>In the following example, the duration of the toggle switch thumb\n\t * animation is updated:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toggle.toggleDuration = 0.5;</listing>\n\t *\n\t * @default 0.15\n\t */\n\t[Style(name=\"toggleDuration\",type=\"Number\")]\n\n\t/**\n\t * The easing function used for toggle animations.\n\t *\n\t * <p>In the following example, the easing function used by the toggle\n\t * switch's thumb animation is updated:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toggle.toggleEase = Transitions.EASE_IN_OUT;</listing>\n\t *\n\t * @default starling.animation.Transitions.EASE_OUT\n\t *\n\t * @see http://doc.starling-framework.org/core/starling/animation/Transitions.html starling.animation.Transitions\n\t */\n\t[Style(name=\"toggleEase\",type=\"Object\")]\n\n\t/**\n\t * Determines if the <code>isSelected</code> property of the thumb\n\t * is updated to match the <code>isSelected</code> property of the\n\t * toggle switch, if the class used to create the thumb implements the\n\t * <code>IToggle</code> interface. Useful for skinning to provide a\n\t * different appearance for the thumb based on whether the toggle switch\n\t * is selected or not.\n\t *\n\t * <p>In the following example, the thumb selection is toggled:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toggle.toggleThumbSelection = true;</listing>\n\t *\n\t * @default false\n\t *\n\t * @see feathers.core.IToggle\n\t * @see feathers.controls.ToggleButton\n\t */\n\t[Style(name=\"toggleThumbSelection\",type=\"Boolean\")]\n\n\t/**\n\t * Determines how the on and off track skins are positioned and sized.\n\t *\n\t * <p>In the following example, the toggle switch's track layout mode is\n\t * updated to use two tracks:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toggle.trackLayoutMode = TrackLayoutMode.SPLIT;</listing>\n\t *\n\t * @default feathers.controls.TrackLayoutMode.SINGLE\n\t *\n\t * @see feathers.controls.TrackLayoutMode#SINGLE\n\t * @see feathers.controls.TrackLayoutMode#SPLIT\n\t * @see #style:trackScaleMode\n\t */\n\t[Style(name=\"trackLayoutMode\",type=\"String\")]\n\n\t/**\n\t * Determines how the on and off track skins are positioned and sized.\n\t *\n\t * <p>In the following example, the toggle switch's track scale is\n\t * customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * toggle.trackScaleMode = TrackScaleMode.EXACT_FIT;</listing>\n\t *\n\t * @default feathers.controls.TrackScaleMode.DIRECTIONAL\n\t *\n\t * @see feathers.controls.TrackScaleMode#DIRECTIONAL\n\t * @see feathers.controls.TrackScaleMode#EXACT_FIT\n\t * @see #style:trackLayoutMode\n\t */\n\t[Style(name=\"trackScaleMode\",type=\"String\")]\n\n\t/**\n\t * @copy feathers.core.IToggle#event:change\n\t *\n\t * @see #isSelected\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the display object's state changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.STATE_CHANGE\n\t *\n\t * @see #currentState\n\t */\n\t[Event(name=\"stateChange\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Similar to a light switch with on and off states. Generally considered an\n\t * alternative to a check box.\n\t *\n\t * <p>The following example programmatically selects a toggle switch and\n\t * listens for when the selection changes:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var toggle:ToggleSwitch = new ToggleSwitch();\n\t * toggle.isSelected = true;\n\t * toggle.addEventListener( Event.CHANGE, toggle_changeHandler );\n\t * this.addChild( toggle );</listing>\n\t *\n\t * @see ../../../help/toggle-switch.html How to use the Feathers ToggleSwitch component\n\t * @see feathers.controls.Check\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class ToggleSwitch extends FeathersControl implements IToggle, IFocusDisplayObject, ITextBaselineControl, IStateContext\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const HELPER_POINT:Point = new Point();\n\n\t\t/**\n\t\t * @private\n\t\t * The minimum physical distance (in inches) that a touch must move\n\t\t * before the scroller starts scrolling.\n\t\t */\n\t\tprivate static const MINIMUM_DRAG_DISTANCE:Number = 0.04;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_THUMB_FACTORY:String = \"thumbFactory\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_ON_TRACK_FACTORY:String = \"onTrackFactory\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_OFF_TRACK_FACTORY:String = \"offTrackFactory\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the \"off\n\t\t * label\" text renderer.\n\t\t *\n\t\t * <p>Note: the \"off label\" text renderer is not a\n\t\t * <code>feathers.controls.Label</code>. It is an instance of one of the\n\t\t * <code>ITextRenderer</code> implementations.</p>\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t * @see ../../../help/text-renderers.html Introduction to Feathers text renderers\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_OFF_LABEL:String = \"feathers-toggle-switch-off-label\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the \"on\n\t\t * label\" text renderer.\n\t\t *\n\t\t * <p>Note: the \"on label\" text renderer is not a\n\t\t * <code>feathers.controls.Label</code>. It is an instance of one of the\n\t\t * <code>ITextRenderer</code> implementations.</p>\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t * @see ../../../help/text-renderers.html Introduction to Feathers text renderers\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_ON_LABEL:String = \"feathers-toggle-switch-on-label\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the off track.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_OFF_TRACK:String = \"feathers-toggle-switch-off-track\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the on track.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_ON_TRACK:String = \"feathers-toggle-switch-on-track\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the thumb.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_THUMB:String = \"feathers-toggle-switch-thumb\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>ToggleSwitch</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultThumbFactory():BasicButton\n\t\t{\n\t\t\treturn new Button();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultOnTrackFactory():BasicButton\n\t\t{\n\t\t\treturn new Button();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultOffTrackFactory():BasicButton\n\t\t{\n\t\t\treturn new Button();\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function ToggleSwitch()\n\t\t{\n\t\t\tsuper();\n\t\t\tif(this._onLabelFontStylesSet === null)\n\t\t\t{\n\t\t\t\tthis._onLabelFontStylesSet = new FontStylesSet();\n\t\t\t\tthis._onLabelFontStylesSet.addEventListener(Event.CHANGE, fontStyles_changeHandler);\n\t\t\t}\n\t\t\tif(this._offLabelFontStylesSet === null)\n\t\t\t{\n\t\t\t\tthis._offLabelFontStylesSet = new FontStylesSet();\n\t\t\t\tthis._offLabelFontStylesSet.addEventListener(Event.CHANGE, fontStyles_changeHandler);\n\t\t\t}\n\t\t\tthis.addEventListener(TouchEvent.TOUCH, toggleSwitch_touchHandler);\n\t\t\tthis.addEventListener(Event.REMOVED_FROM_STAGE, toggleSwitch_removedFromStageHandler);\n\t\t}\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the off label\n\t\t * text renderer. This variable is <code>protected</code> so that\n\t\t * sub-classes can customize the on label text renderer style name in\n\t\t * their constructors instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_ON_LABEL</code>.\n\t\t *\n\t\t * <p>To customize the \"on\" label text renderer style name without\n\t\t * subclassing, see <code>customOnLabelStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customOnLabelStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var onLabelStyleName:String = DEFAULT_CHILD_STYLE_NAME_ON_LABEL;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the off label\n\t\t * text renderer. This variable is <code>protected</code> so that\n\t\t * sub-classes can customize the off label text renderer style name in\n\t\t * their constructors instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_OFF_LABEL</code>.\n\t\t *\n\t\t * <p>To customize the \"off\" label text renderer style name without\n\t\t * subclassing, see <code>customOffLabelStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customOffLabelStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var offLabelStyleName:String = DEFAULT_CHILD_STYLE_NAME_OFF_LABEL;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the on track.\n\t\t * This variable is <code>protected</code> so that sub-classes can\n\t\t * customize the on track style name in their constructors instead of\n\t\t * using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_ON_TRACK</code>.\n\t\t *\n\t\t * <p>To customize the on track style name without subclassing, see\n\t\t * <code>customOnTrackStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customOnTrackStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var onTrackStyleName:String = DEFAULT_CHILD_STYLE_NAME_ON_TRACK;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the off track.\n\t\t * This variable is <code>protected</code> so that sub-classes can\n\t\t * customize the off track style name in their constructors instead of\n\t\t * using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_OFF_TRACK</code>.\n\t\t *\n\t\t * <p>To customize the off track style name without subclassing, see\n\t\t * <code>customOffTrackStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customOffTrackStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var offTrackStyleName:String = DEFAULT_CHILD_STYLE_NAME_OFF_TRACK;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the thumb. This\n\t\t * variable is <code>protected</code> so that sub-classes can customize\n\t\t * the thumb style name in their constructors instead of using the\n\t\t * default stylename defined by <code>DEFAULT_CHILD_STYLE_NAME_THUMB</code>.\n\t\t *\n\t\t * <p>To customize the thumb style name without subclassing, see\n\t\t * <code>customThumbStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customThumbStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var thumbStyleName:String = DEFAULT_CHILD_STYLE_NAME_THUMB;\n\n\t\t/**\n\t\t * The thumb sub-component.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t *\n\t\t * @see #thumbFactory\n\t\t * @see #createThumb()\n\t\t */\n\t\tprotected var thumb:DisplayObject;\n\n\t\t/**\n\t\t * The \"on\" text renderer sub-component.\n\t\t *\n\t\t * @see #labelFactory\n\t\t */\n\t\tprotected var onTextRenderer:ITextRenderer;\n\n\t\t/**\n\t\t * The \"off\" text renderer sub-component.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t *\n\t\t * @see #labelFactory\n\t\t */\n\t\tprotected var offTextRenderer:ITextRenderer;\n\n\t\t/**\n\t\t * The \"on\" track sub-component.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t *\n\t\t * @see #onTrackFactory\n\t\t * @see #createOnTrack()\n\t\t */\n\t\tprotected var onTrack:DisplayObject;\n\n\t\t/**\n\t\t * The \"off\" track sub-component.\n\t\t *\n\t\t * <p>For internal use in subclasses.</p>\n\t\t *\n\t\t * @see #offTrackFactory\n\t\t * @see #createOffTrack()\n\t\t */\n\t\tprotected var offTrack:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn ToggleSwitch.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentState:String = ToggleState.NOT_SELECTED;\n\n\t\t/**\n\t\t * The current state of the toggle switch.\n\t\t *\n\t\t * @see feathers.controls.ToggleState\n\t\t * @see #event:stateChange feathers.events.FeathersEventType.STATE_CHANGE\n\t\t */\n\t\tpublic function get currentState():String\n\t\t{\n\t\t\treturn this._currentState;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set isEnabled(value:Boolean):void\n\t\t{\n\t\t\tif(this._isEnabled === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsuper.isEnabled = value;\n\t\t\tthis.resetState();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingRight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingRight():Number\n\t\t{\n\t\t\treturn this._paddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingRight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingLeft:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingLeft = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _showLabels:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get showLabels():Boolean\n\t\t{\n\t\t\treturn _showLabels;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set showLabels(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._showLabels === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._showLabels = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _showThumb:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get showThumb():Boolean\n\t\t{\n\t\t\treturn this._showThumb;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set showThumb(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._showThumb === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._showThumb = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _trackLayoutMode:String = TrackLayoutMode.SINGLE;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"single,split\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get trackLayoutMode():String\n\t\t{\n\t\t\treturn this._trackLayoutMode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set trackLayoutMode(value:String):void\n\t\t{\n\t\t\tif(value === \"onOff\")\n\t\t\t{\n\t\t\t\tvalue = TrackLayoutMode.SPLIT;\n\t\t\t}\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._trackLayoutMode === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._trackLayoutMode = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _trackScaleMode:String = TrackScaleMode.DIRECTIONAL;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"exactFit,directional\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get trackScaleMode():String\n\t\t{\n\t\t\treturn this._trackScaleMode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set trackScaleMode(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._trackScaleMode === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._trackScaleMode = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _defaultLabelProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the toggle switch's label text\n\t\t * renderers when the toggle switch is enabled, and the properties will\n\t\t * be passed down to the text renderers when the toggle switch\n\t\t * validates. The available properties depend on which\n\t\t * <code>ITextRenderer</code> implementation is returned by\n\t\t * <code>labelFactory</code> (possibly <code>onLabelFactory</code> or\n\t\t * <code>offLabelFactory</code> instead). Refer to\n\t\t * <a href=\"../core/ITextRenderer.html\"><code>feathers.core.ITextRenderer</code></a>\n\t\t * for a list of available text renderer implementations.\n\t\t *\n\t\t * <p>In the following example, the toggle switch's default label\n\t\t * properties are updated (this example assumes that the label text\n\t\t * renderers are of type <code>TextFieldTextRenderer</code>):</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * toggle.defaultLabelProperties.textFormat = new TextFormat( \"Source Sans Pro\", 16, 0x333333 );\n\t\t * toggle.defaultLabelProperties.embedFonts = true;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #labelFactory\n\t\t * @see #onLabelFactory\n\t\t * @see #offLabelFactory\n\t\t * @see feathers.core.ITextRenderer\n\t\t */\n\t\tpublic function get defaultLabelProperties():Object\n\t\t{\n\t\t\tif(!this._defaultLabelProperties)\n\t\t\t{\n\t\t\t\tthis._defaultLabelProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._defaultLabelProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set defaultLabelProperties(value:Object):void\n\t\t{\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvalue = PropertyProxy.fromObject(value);\n\t\t\t}\n\t\t\tif(this._defaultLabelProperties)\n\t\t\t{\n\t\t\t\tthis._defaultLabelProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._defaultLabelProperties = PropertyProxy(value);\n\t\t\tif(this._defaultLabelProperties)\n\t\t\t{\n\t\t\t\tthis._defaultLabelProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _disabledLabelProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the toggle switch's label text\n\t\t * renderers when the toggle switch is disabled, and the properties will\n\t\t * be passed down to the text renderers when the toggle switch\n\t\t * validates. The available properties depend on which\n\t\t * <code>ITextRenderer</code> implementation is returned by\n\t\t * <code>labelFactory</code> (possibly <code>onLabelFactory</code> or\n\t\t * <code>offLabelFactory</code> instead). Refer to\n\t\t * <a href=\"../core/ITextRenderer.html\"><code>feathers.core.ITextRenderer</code></a>\n\t\t * for a list of available text renderer implementations.\n\t\t *\n\t\t * <p>In the following example, the toggle switch's disabled label\n\t\t * properties are updated (this example assumes that the label text\n\t\t * renderers are of type <code>TextFieldTextRenderer</code>):</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * toggle.disabledLabelProperties.textFormat = new TextFormat( \"Source Sans Pro\", 16, 0x333333 );\n\t\t * toggle.disabledLabelProperties.embedFonts = true;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #labelFactory\n\t\t * @see #onLabelFactory\n\t\t * @see #offLabelFactory\n\t\t * @see feathers.core.ITextRenderer\n\t\t */\n\t\tpublic function get disabledLabelProperties():Object\n\t\t{\n\t\t\tif(!this._disabledLabelProperties)\n\t\t\t{\n\t\t\t\tthis._disabledLabelProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._disabledLabelProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disabledLabelProperties(value:Object):void\n\t\t{\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvalue = PropertyProxy.fromObject(value);\n\t\t\t}\n\t\t\tif(this._disabledLabelProperties)\n\t\t\t{\n\t\t\t\tthis._disabledLabelProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._disabledLabelProperties = PropertyProxy(value);\n\t\t\tif(this._disabledLabelProperties)\n\t\t\t{\n\t\t\t\tthis._disabledLabelProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _onLabelProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the toggle switch's \"on\" label\n\t\t * text renderer, and the properties will be passed down to the text\n\t\t * renderer when the toggle switch validates. If <code>null</code>, then\n\t\t * <code>defaultLabelProperties</code> is used instead.\n\t\t *\n\t\t * <p>The available properties depend on which\n\t\t * <code>ITextRenderer</code> implementation is returned by\n\t\t * <code>labelFactory</code> (possibly <code>onLabelFactory</code>\n\t\t * instead). Refer to\n\t\t * <a href=\"../core/ITextRenderer.html\"><code>feathers.core.ITextRenderer</code></a>\n\t\t * for a list of available text renderer implementations.</p>\n\t\t *\n\t\t * <p>In the following example, the toggle switch's on label properties\n\t\t * are updated (this example assumes that the on label text renderer is a\n\t\t * <code>TextFieldTextRenderer</code>):</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * toggle.onLabelProperties.textFormat = new TextFormat( \"Source Sans Pro\", 16, 0x333333 );\n\t\t * toggle.onLabelProperties.embedFonts = true;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #labelFactory\n\t\t * @see feathers.core.ITextRenderer\n\t\t */\n\t\tpublic function get onLabelProperties():Object\n\t\t{\n\t\t\tif(!this._onLabelProperties)\n\t\t\t{\n\t\t\t\tthis._onLabelProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._onLabelProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set onLabelProperties(value:Object):void\n\t\t{\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvalue = PropertyProxy.fromObject(value);\n\t\t\t}\n\t\t\tif(this._onLabelProperties)\n\t\t\t{\n\t\t\t\tthis._onLabelProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._onLabelProperties = PropertyProxy(value);\n\t\t\tif(this._onLabelProperties)\n\t\t\t{\n\t\t\t\tthis._onLabelProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _offLabelProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the toggle switch's \"off\" label\n\t\t * text renderer, and the properties will be passed down to the text\n\t\t * renderer when the toggle switch validates. If <code>null</code>, then\n\t\t * <code>defaultLabelProperties</code> is used instead.\n\t\t *\n\t\t * <p>The available properties depend on which\n\t\t * <code>ITextRenderer</code> implementation is returned by\n\t\t * <code>labelFactory</code> (possibly <code>offLabelFactory</code>\n\t\t * instead). Refer to\n\t\t * <a href=\"../core/ITextRenderer.html\"><code>feathers.core.ITextRenderer</code></a>\n\t\t * for a list of available text renderer implementations.</p>\n\t\t *\n\t\t * <p>In the following example, the toggle switch's off label properties\n\t\t * are updated (this example assumes that the off label text renderer is a\n\t\t * <code>TextFieldTextRenderer</code>):</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * toggle.offLabelProperties.textFormat = new TextFormat( \"Source Sans Pro\", 16, 0x333333 );\n\t\t * toggle.offLabelProperties.embedFonts = true;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #labelFactory\n\t\t * @see feathers.core.ITextRenderer\n\t\t */\n\t\tpublic function get offLabelProperties():Object\n\t\t{\n\t\t\tif(!this._offLabelProperties)\n\t\t\t{\n\t\t\t\tthis._offLabelProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._offLabelProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set offLabelProperties(value:Object):void\n\t\t{\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvalue = PropertyProxy.fromObject(value);\n\t\t\t}\n\t\t\tif(this._offLabelProperties)\n\t\t\t{\n\t\t\t\tthis._offLabelProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._offLabelProperties = PropertyProxy(value);\n\t\t\tif(this._offLabelProperties)\n\t\t\t{\n\t\t\t\tthis._offLabelProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _labelFactory:Function;\n\n\t\t/**\n\t\t * A function used to instantiate the toggle switch's label text\n\t\t * renderer sub-components, if specific factories for those label text\n\t\t * renderers are not provided. The label text renderers must be\n\t\t * instances of <code>ITextRenderer</code>. This factory can be used to\n\t\t * change properties of the label text renderers when they are first\n\t\t * created. For instance, if you are skinning Feathers components\n\t\t * without a theme, you might use this factory to style the label text\n\t\t * renderers.\n\t\t *\n\t\t * <p>The factory should have the following function signature:</p>\n\t\t * <pre>function():ITextRenderer</pre>\n\t\t *\n\t\t * <p>In the following example, the toggle switch uses a custom label\n\t\t * factory:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * toggle.labelFactory = function():ITextRenderer\n\t\t * {\n\t\t *     return new TextFieldTextRenderer();\n\t\t * }</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #onLabelFactory\n\t\t * @see #offLabelFactory\n\t\t * @see feathers.core.ITextRenderer\n\t\t * @see feathers.core.FeathersControl#defaultTextRendererFactory\n\t\t */\n\t\tpublic function get labelFactory():Function\n\t\t{\n\t\t\treturn this._labelFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set labelFactory(value:Function):void\n\t\t{\n\t\t\tif(this._labelFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._labelFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _onLabelFontStylesSet:FontStylesSet;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get onLabelFontStyles():TextFormat\n\t\t{\n\t\t\treturn this._onLabelFontStylesSet.format;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set onLabelFontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._onLabelFontStylesSet.format;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._onLabelFontStylesSet.format = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get onLabelDisabledFontStyles():TextFormat\n\t\t{\n\t\t\treturn this._onLabelFontStylesSet.disabledFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set onLabelDisabledFontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._onLabelFontStylesSet.disabledFormat;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._onLabelFontStylesSet.disabledFormat = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get onLabelSelectedFontStyles():TextFormat\n\t\t{\n\t\t\treturn this._onLabelFontStylesSet.selectedFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set onLabelSelectedFontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._onLabelFontStylesSet.selectedFormat;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._onLabelFontStylesSet.selectedFormat = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _onLabelFactory:Function;\n\n\t\t/**\n\t\t * A function used to instantiate the toggle switch's on label text\n\t\t * renderer sub-component. The on label text renderer must be an\n\t\t * instance of <code>ITextRenderer</code>. This factory can be used to\n\t\t * change properties of the on label text renderer when it is first\n\t\t * created. For instance, if you are skinning Feathers components\n\t\t * without a theme, you might use this factory to style the on label\n\t\t * text renderer.\n\t\t *\n\t\t * <p>If an <code>onLabelFactory</code> is not provided, the default\n\t\t * <code>labelFactory</code> will be used.</p>\n\t\t *\n\t\t * <p>The factory should have the following function signature:</p>\n\t\t * <pre>function():ITextRenderer</pre>\n\t\t *\n\t\t * <p>In the following example, the toggle switch uses a custom on label\n\t\t * factory:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * toggle.onLabelFactory = function():ITextRenderer\n\t\t * {\n\t\t *     return new TextFieldTextRenderer();\n\t\t * }</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #labelFactory\n\t\t * @see #offLabelFactory\n\t\t * @see feathers.core.ITextRenderer\n\t\t * @see feathers.core.FeathersControl#defaultTextRendererFactory\n\t\t */\n\t\tpublic function get onLabelFactory():Function\n\t\t{\n\t\t\treturn this._onLabelFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set onLabelFactory(value:Function):void\n\t\t{\n\t\t\tif(this._onLabelFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._onLabelFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customOnLabelStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customOnLabelStyleName():String\n\t\t{\n\t\t\treturn this._customOnLabelStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customOnLabelStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customOnLabelStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customOnLabelStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _offLabelFontStylesSet:FontStylesSet;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get offLabelFontStyles():TextFormat\n\t\t{\n\t\t\treturn this._offLabelFontStylesSet.format;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set offLabelFontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._offLabelFontStylesSet.format;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._offLabelFontStylesSet.format = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get offLabelDisabledFontStyles():TextFormat\n\t\t{\n\t\t\treturn this._offLabelFontStylesSet.disabledFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set offLabelDisabledFontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._offLabelFontStylesSet.disabledFormat;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._offLabelFontStylesSet.disabledFormat = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get offLabelSelectedFontStyles():TextFormat\n\t\t{\n\t\t\treturn this._offLabelFontStylesSet.selectedFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set offLabelSelectedFontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._offLabelFontStylesSet.selectedFormat;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._offLabelFontStylesSet.selectedFormat = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _offLabelFactory:Function;\n\n\t\t/**\n\t\t * A function used to instantiate the toggle switch's off label text\n\t\t * renderer sub-component. The off label text renderer must be an\n\t\t * instance of <code>ITextRenderer</code>. This factory can be used to\n\t\t * change properties of the off label text renderer when it is first\n\t\t * created. For instance, if you are skinning Feathers components\n\t\t * without a theme, you might use this factory to style the off label\n\t\t * text renderer.\n\t\t *\n\t\t * <p>If an <code>offLabelFactory</code> is not provided, the default\n\t\t * <code>labelFactory</code> will be used.</p>\n\t\t *\n\t\t * <p>The factory should have the following function signature:</p>\n\t\t * <pre>function():ITextRenderer</pre>\n\t\t *\n\t\t * <p>In the following example, the toggle switch uses a custom on label\n\t\t * factory:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * toggle.offLabelFactory = function():ITextRenderer\n\t\t * {\n\t\t *     return new TextFieldTextRenderer();\n\t\t * }</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #labelFactory\n\t\t * @see #onLabelFactory\n\t\t * @see feathers.core.ITextRenderer\n\t\t * @see feathers.core.FeathersControl#defaultTextRendererFactory\n\t\t */\n\t\tpublic function get offLabelFactory():Function\n\t\t{\n\t\t\treturn this._offLabelFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set offLabelFactory(value:Function):void\n\t\t{\n\t\t\tif(this._offLabelFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._offLabelFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customOffLabelStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customOffLabelStyleName():String\n\t\t{\n\t\t\treturn this._customOffLabelStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customOffLabelStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customOffLabelStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customOffLabelStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _onTrackSkinExplicitWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _onTrackSkinExplicitHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _onTrackSkinExplicitMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _onTrackSkinExplicitMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _offTrackSkinExplicitWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _offTrackSkinExplicitHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _offTrackSkinExplicitMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _offTrackSkinExplicitMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isSelected:Boolean = false;\n\n\t\t/**\n\t\t * Indicates if the toggle switch is selected (ON) or not (OFF).\n\t\t *\n\t\t * <p>In the following example, the toggle switch is selected:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * toggle.isSelected = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see #setSelectionWithAnimation()\n\t\t */\n\t\tpublic function get isSelected():Boolean\n\t\t{\n\t\t\treturn this._isSelected;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isSelected(value:Boolean):void\n\t\t{\n\t\t\tthis._animateSelectionChange = false;\n\t\t\tif(this._isSelected == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isSelected = value;\n\t\t\tthis.resetState();\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _toggleThumbSelection:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get toggleThumbSelection():Boolean\n\t\t{\n\t\t\treturn this._toggleThumbSelection;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set toggleThumbSelection(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._toggleThumbSelection === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._toggleThumbSelection = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _toggleDuration:Number = 0.15;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get toggleDuration():Number\n\t\t{\n\t\t\treturn this._toggleDuration;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set toggleDuration(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._toggleDuration = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _toggleEase:Object = Transitions.EASE_OUT;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get toggleEase():Object\n\t\t{\n\t\t\treturn this._toggleEase;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set toggleEase(value:Object):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._toggleEase = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _onText:String = \"ON\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get onText():String\n\t\t{\n\t\t\treturn this._onText;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set onText(value:String):void\n\t\t{\n\t\t\tif(value === null)\n\t\t\t{\n\t\t\t\tvalue = \"\";\n\t\t\t}\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._onText === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._onText = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _offText:String = \"OFF\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get offText():String\n\t\t{\n\t\t\treturn this._offText;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set offText(value:String):void\n\t\t{\n\t\t\tif(value === null)\n\t\t\t{\n\t\t\t\tvalue = \"\";\n\t\t\t}\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._offText === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._offText = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _toggleTween:Tween;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _ignoreTapHandler:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _touchPointID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _thumbStartX:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _touchStartX:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _animateSelectionChange:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _onTrackFactory:Function;\n\n\t\t/**\n\t\t * A function used to generate the toggle switch's \"on\" track\n\t\t * sub-component. The \"on\" track must be an instance of\n\t\t * <code>BasicButton</code> (or a subclass). This factory can be used to\n\t\t * change properties on the \"on\" track when it is first created. For\n\t\t * instance, if you are skinning Feathers components without a theme,\n\t\t * you might use this factory to set skins and other styles on the \"on\"\n\t\t * track.\n\t\t *\n\t\t * <p>The function should have the following signature:</p>\n\t\t * <pre>function():BasicButton</pre>\n\t\t *\n\t\t * <p>In the following example, a custom on track factory is passed to\n\t\t * the toggle switch:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * toggle.onTrackFactory = function():BasicButton\n\t\t * {\n\t\t *     var onTrack:BasicButton = new BasicButton();\n\t\t *     onTrack.defaultSkin = new Image( texture );\n\t\t *     return onTrack;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.BasicButton\n\t\t */\n\t\tpublic function get onTrackFactory():Function\n\t\t{\n\t\t\treturn this._onTrackFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set onTrackFactory(value:Function):void\n\t\t{\n\t\t\tif(this._onTrackFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._onTrackFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ON_TRACK_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customOnTrackStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customOnTrackStyleName():String\n\t\t{\n\t\t\treturn this._customOnTrackStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customOnTrackStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customOnTrackStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customOnTrackStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ON_TRACK_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _onTrackProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the toggle switch's \"on\" track,\n\t\t * and the properties will be passed down to the \"on\" track when the\n\t\t * toggle switch validates. For a list of available properties,\n\t\t * refer to <a href=\"BasicButton.html\"><code>feathers.controls.BasicButton</code></a>.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>onTrackFactory</code> function\n\t\t * instead of using <code>onTrackProperties</code> will result in\n\t\t * better performance.</p>\n\t\t *\n\t\t * <p>In the following example, the toggle switch's on track properties\n\t\t * are updated:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * toggle.onTrackProperties.defaultSkin = new Image( texture );</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.BasicButton\n\t\t * @see #onTrackFactory\n\t\t */\n\t\tpublic function get onTrackProperties():Object\n\t\t{\n\t\t\tif(!this._onTrackProperties)\n\t\t\t{\n\t\t\t\tthis._onTrackProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._onTrackProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set onTrackProperties(value:Object):void\n\t\t{\n\t\t\tif(this._onTrackProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._onTrackProperties)\n\t\t\t{\n\t\t\t\tthis._onTrackProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._onTrackProperties = PropertyProxy(value);\n\t\t\tif(this._onTrackProperties)\n\t\t\t{\n\t\t\t\tthis._onTrackProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _offTrackFactory:Function;\n\n\t\t/**\n\t\t * A function used to generate the toggle switch's \"off\" track\n\t\t * sub-component. The \"off\" track must be an instance of\n\t\t * <code>BasicButton</code> (or a subclass). This factory can be used to\n\t\t * change properties on the \"off\" track when it is first created. For\n\t\t * instance, if you are skinning Feathers components without a theme,\n\t\t * you might use this factory to set skins and other styles on the \"off\"\n\t\t * track.\n\t\t *\n\t\t * <p>The function should have the following signature:</p>\n\t\t * <pre>function():BasicButton</pre>\n\t\t *\n\t\t * <p>In the following example, a custom off track factory is passed to\n\t\t * the toggle switch:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * toggle.offTrackFactory = function():BasicButton\n\t\t * {\n\t\t *     var offTrack:BasicButton = new BasicButton();\n\t\t *     offTrack.defaultSkin = new Image( texture );\n\t\t *     return offTrack;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.BasicButton\n\t\t */\n\t\tpublic function get offTrackFactory():Function\n\t\t{\n\t\t\treturn this._offTrackFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set offTrackFactory(value:Function):void\n\t\t{\n\t\t\tif(this._offTrackFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._offTrackFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_OFF_TRACK_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customOffTrackStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customOffTrackStyleName():String\n\t\t{\n\t\t\treturn this._customOffTrackStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customOffTrackStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customOffTrackStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customOffTrackStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_OFF_TRACK_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _offTrackProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the toggle switch's \"off\" track,\n\t\t * and the properties will be passed down to the \"off\" track when the\n\t\t * toggle switch validates. For a list of available properties,\n\t\t * refer to <a href=\"BasicButton.html\"><code>feathers.controls.BasicButton</code></a>.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>offTrackFactory</code> function\n\t\t * instead of using <code>offTrackProperties</code> will result in\n\t\t * better performance.</p>\n\t\t *\n\t\t * <p>In the following example, the toggle switch's off track properties\n\t\t * are updated:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * toggle.offTrackProperties.defaultSkin = new Image( texture );</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.BasicButton\n\t\t * @see #offTrackFactory\n\t\t */\n\t\tpublic function get offTrackProperties():Object\n\t\t{\n\t\t\tif(!this._offTrackProperties)\n\t\t\t{\n\t\t\t\tthis._offTrackProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._offTrackProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set offTrackProperties(value:Object):void\n\t\t{\n\t\t\tif(this._offTrackProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._offTrackProperties)\n\t\t\t{\n\t\t\t\tthis._offTrackProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._offTrackProperties = PropertyProxy(value);\n\t\t\tif(this._offTrackProperties)\n\t\t\t{\n\t\t\t\tthis._offTrackProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _thumbFactory:Function;\n\n\t\t/**\n\t\t * A function used to generate the toggle switch's thumb sub-component.\n\t\t * The thumb must be an instance of <code>BasicButton</code> (or a\n\t\t * subclass). This factory can be used to change properties on the thumb\n\t\t * when it is first created. For instance, if you are skinning Feathers\n\t\t * components without a theme, you might use <code>thumbFactory</code>\n\t\t * to set skins and other styles on the thumb.\n\t\t *\n\t\t * <p>The function should have the following signature:</p>\n\t\t * <pre>function():BasicButton</pre>\n\t\t *\n\t\t * <p>In the following example, a custom thumb factory is passed to the\n\t\t * toggle switch:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * toggle.thumbFactory = function():BasicButton\n\t\t * {\n\t\t *     var button:BasicButton = new BasicButton();\n\t\t *     button.defaultSkin = new Image( texture );\n\t\t *     return button;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.BasicButton\n\t\t */\n\t\tpublic function get thumbFactory():Function\n\t\t{\n\t\t\treturn this._thumbFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set thumbFactory(value:Function):void\n\t\t{\n\t\t\tif(this._thumbFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._thumbFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_THUMB_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customThumbStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customThumbStyleName():String\n\t\t{\n\t\t\treturn this._customThumbStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customThumbStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customThumbStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customThumbStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_THUMB_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _thumbProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the toggle switch's thumb\n\t\t * sub-component, and the properties will be passed down to the thumb\n\t\t * when the toggle switch validates. For a list of available properties,\n\t\t * refer to <a href=\"BasicButton.html\"><code>feathers.controls.BasicButton</code></a>.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>thumbFactory</code> function instead\n\t\t * of using <code>thumbProperties</code> will result in better\n\t\t * performance.</p>\n\t\t *\n\t\t * <p>In the following example, the toggle switch's thumb properties\n\t\t * are updated:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * toggle.thumbProperties.defaultSkin = new Image( texture );</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.BasicButton\n\t\t * @see #thumbFactory\n\t\t */\n\t\tpublic function get thumbProperties():Object\n\t\t{\n\t\t\tif(!this._thumbProperties)\n\t\t\t{\n\t\t\t\tthis._thumbProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._thumbProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set thumbProperties(value:Object):void\n\t\t{\n\t\t\tif(this._thumbProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._thumbProperties)\n\t\t\t{\n\t\t\t\tthis._thumbProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._thumbProperties = PropertyProxy(value);\n\t\t\tif(this._thumbProperties)\n\t\t\t{\n\t\t\t\tthis._thumbProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get baseline():Number\n\t\t{\n\t\t\tif(!this.onTextRenderer)\n\t\t\t{\n\t\t\t\treturn this.scaledActualHeight;\n\t\t\t}\n\t\t\treturn this.scaleY * (this.onTextRenderer.y + this.onTextRenderer.baseline);\n\t\t}\n\n\t\t/**\n\t\t * Changes the <code>isSelected</code> property, but animates the thumb\n\t\t * to the new position, as if the user tapped the toggle switch.\n\t\t *\n\t\t * @see #isSelected\n\t\t */\n\t\tpublic function setSelectionWithAnimation(isSelected:Boolean):void\n\t\t{\n\t\t\tif(this._isSelected == isSelected)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.isSelected = isSelected;\n\t\t\tthis._animateSelectionChange = true;\n\t\t}\n\n\t\t/**\n\t\t * Gets the font styles to be used to display the toggle switch's on\n\t\t * label text when the toggle switch's <code>currentState</code>\n\t\t * property matches the specified state value.\n\t\t *\n\t\t * <p>If font styles are not defined for a specific state, returns\n\t\t * <code>null</code>.</p>\n\t\t *\n\t\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t\t * @see #setOnLabelFontStylesForState()\n\t\t * @see #onLabelFontStyles\n\t\t */\n\t\tpublic function getOnLabelFontStylesForState(state:String):TextFormat\n\t\t{\n\t\t\tif(this._onLabelFontStylesSet === null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn this._onLabelFontStylesSet.getFormatForState(state);\n\t\t}\n\n\t\t/**\n\t\t * Sets the font styles to be used to display the toggle switch's on\n\t\t * label text when the toggle switch's <code>currentState</code>\n\t\t * property matches the specified state value.\n\t\t *\n\t\t * <p>If font styles are not defined for a specific state, the value of\n\t\t * the <code>onLabelFontStyles</code> property will be used instead.</p>\n\t\t *\n\t\t * <p>Note: if the text renderer has been customized with advanced font\n\t\t * formatting, it may override the values specified with\n\t\t * <code>setOnLabelFontStylesForState()</code> and properties like\n\t\t * <code>onLabelFontStyles</code> and <code>onLabelDisabledFontStyles</code>.</p>\n\t\t *\n\t\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t\t * @see #onLabelFontStyles\n\t\t */\n\t\tpublic function setOnLabelFontStylesForState(state:String, format:TextFormat):void\n\t\t{\n\t\t\tvar key:String = \"setOnLabelFontStylesForState--\" + state;\n\t\t\tif(this.processStyleRestriction(key))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(key);\n\t\t\t}\n\t\t\tvar oldFormat:TextFormat = this._onLabelFontStylesSet.getFormatForState(state);\n\t\t\tif(oldFormat !== null)\n\t\t\t{\n\t\t\t\toldFormat.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._onLabelFontStylesSet.setFormatForState(state, format);\n\t\t\tif(format !== null)\n\t\t\t{\n\t\t\t\tformat.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Gets the font styles to be used to display the toggle switch's off\n\t\t * label text when the toggle switch's <code>currentState</code>\n\t\t * property matches the specified state value.\n\t\t *\n\t\t * <p>If font styles are not defined for a specific state, returns\n\t\t * <code>null</code>.</p>\n\t\t *\n\t\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t\t * @see #setOffLabelFontStylesForState()\n\t\t * @see #offLabelFontStyles\n\t\t */\n\t\tpublic function getOffLabelFontStylesForState(state:String):TextFormat\n\t\t{\n\t\t\tif(this._offLabelFontStylesSet === null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn this._offLabelFontStylesSet.getFormatForState(state);\n\t\t}\n\n\t\t/**\n\t\t * Sets the font styles to be used to display the toggle switch's off\n\t\t * label text when the toggle switch's <code>currentState</code>\n\t\t * property matches the specified state value.\n\t\t *\n\t\t * <p>If font styles are not defined for a specific state, the value of\n\t\t * the <code>offLabelFontStyles</code> property will be used instead.</p>\n\t\t *\n\t\t * <p>Note: if the text renderer has been customized with advanced font\n\t\t * formatting, it may override the values specified with\n\t\t * <code>setOffLabelFontStylesForState()</code> and properties like\n\t\t * <code>offLabelFontStyles</code> and <code>offLabelDisabledFontStyles</code>.</p>\n\t\t *\n\t\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t\t * @see #offLabelFontStyles\n\t\t */\n\t\tpublic function setOffLabelFontStylesForState(state:String, format:TextFormat):void\n\t\t{\n\t\t\tvar key:String = \"setOffLabelFontStylesForState--\" + state;\n\t\t\tif(this.processStyleRestriction(key))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(key);\n\t\t\t}\n\t\t\tvar oldFormat:TextFormat = this._offLabelFontStylesSet.getFormatForState(state);\n\t\t\tif(oldFormat !== null)\n\t\t\t{\n\t\t\t\toldFormat.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._offLabelFontStylesSet.setFormatForState(state, format);\n\t\t\tif(format !== null)\n\t\t\t{\n\t\t\t\tformat.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this._onLabelFontStylesSet !== null)\n\t\t\t{\n\t\t\t\tthis._onLabelFontStylesSet.dispose();\n\t\t\t\tthis._onLabelFontStylesSet = null;\n\t\t\t}\n\t\t\tif(this._offLabelFontStylesSet !== null)\n\t\t\t{\n\t\t\t\tthis._offLabelFontStylesSet.dispose();\n\t\t\t\tthis._offLabelFontStylesSet = null;\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar selectionInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SELECTED);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar focusInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_FOCUS);\n\t\t\tvar layoutInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_LAYOUT);\n\t\t\tvar textRendererInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t\tvar thumbFactoryInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_THUMB_FACTORY);\n\t\t\tvar onTrackFactoryInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_ON_TRACK_FACTORY);\n\t\t\tvar offTrackFactoryInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_OFF_TRACK_FACTORY);\n\n\t\t\tif(thumbFactoryInvalid)\n\t\t\t{\n\t\t\t\tthis.createThumb();\n\t\t\t}\n\n\t\t\tif(onTrackFactoryInvalid)\n\t\t\t{\n\t\t\t\tthis.createOnTrack();\n\t\t\t}\n\n\t\t\tif(offTrackFactoryInvalid || layoutInvalid)\n\t\t\t{\n\t\t\t\tthis.createOffTrack();\n\t\t\t}\n\n\t\t\tif(textRendererInvalid)\n\t\t\t{\n\t\t\t\tthis.createLabels();\n\t\t\t}\n\n\t\t\tif(textRendererInvalid || stylesInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshOnLabelStyles();\n\t\t\t\tthis.refreshOffLabelStyles();\n\t\t\t}\n\n\t\t\tif(thumbFactoryInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshThumbStyles();\n\t\t\t}\n\t\t\tif(onTrackFactoryInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshOnTrackStyles();\n\t\t\t}\n\t\t\tif((offTrackFactoryInvalid || layoutInvalid || stylesInvalid) && this.offTrack)\n\t\t\t{\n\t\t\t\tthis.refreshOffTrackStyles();\n\t\t\t}\n\n\t\t\tif(stateInvalid || layoutInvalid || thumbFactoryInvalid || onTrackFactoryInvalid ||\n\t\t\t\tonTrackFactoryInvalid || textRendererInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshEnabled();\n\t\t\t}\n\n\t\t\tsizeInvalid = this.autoSizeIfNeeded() || sizeInvalid;\n\n\t\t\tif(sizeInvalid || stylesInvalid || selectionInvalid)\n\t\t\t{\n\t\t\t\tthis.updateSelection();\n\t\t\t}\n\n\t\t\tthis.layoutChildren();\n\n\t\t\tif(sizeInvalid || focusInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshFocusIndicator();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * If the component's dimensions have not been set explicitly, it will\n\t\t * measure its content and determine an ideal size for itself. If the\n\t\t * <code>explicitWidth</code> or <code>explicitHeight</code> member\n\t\t * variables are set, those value will be used without additional\n\t\t * measurement. If one is set, but not the other, the dimension with the\n\t\t * explicit value will not be measured, but the other non-explicit\n\t\t * dimension will still need measurement.\n\t\t *\n\t\t * <p>Calls <code>saveMeasurements()</code> to set up the\n\t\t * <code>actualWidth</code> and <code>actualHeight</code> member\n\t\t * variables used for layout.</p>\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t */\n\t\tprotected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar isSingle:Boolean = this._trackLayoutMode === TrackLayoutMode.SINGLE;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tthis.onTrack.width = this._onTrackSkinExplicitWidth;\n\t\t\t}\n\t\t\telse if(isSingle)\n\t\t\t{\n\t\t\t\tthis.onTrack.width = this._explicitWidth;\n\t\t\t}\n\t\t\tif(this.onTrack is IMeasureDisplayObject)\n\t\t\t{\n\t\t\t\tvar measureOnTrack:IMeasureDisplayObject = IMeasureDisplayObject(this.onTrack);\n\t\t\t\tif(needsMinWidth)\n\t\t\t\t{\n\t\t\t\t\tmeasureOnTrack.minWidth = this._onTrackSkinExplicitMinWidth;\n\t\t\t\t}\n\t\t\t\telse if(isSingle)\n\t\t\t\t{\n\t\t\t\t\tvar minTrackMinWidth:Number = this._explicitMinWidth;\n\t\t\t\t\tif(this._onTrackSkinExplicitMinWidth > minTrackMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tminTrackMinWidth = this._onTrackSkinExplicitMinWidth;\n\t\t\t\t\t}\n\t\t\t\t\tmeasureOnTrack.minWidth = minTrackMinWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!isSingle)\n\t\t\t{\n\t\t\t\tif(needsWidth)\n\t\t\t\t{\n\t\t\t\t\tthis.offTrack.width = this._offTrackSkinExplicitWidth;\n\t\t\t\t}\n\t\t\t\tif(this.offTrack is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar measureOffTrack:IMeasureDisplayObject = IMeasureDisplayObject(this.offTrack);\n\t\t\t\t\tif(needsMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tmeasureOffTrack.minWidth = this._offTrackSkinExplicitMinWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this.onTrack is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.onTrack).validate();\n\t\t\t}\n\t\t\tif(this.offTrack is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.offTrack).validate();\n\t\t\t}\n\t\t\tif(this.thumb is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.thumb).validate();\n\t\t\t}\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tnewWidth = this.onTrack.width;\n\t\t\t\tif(!isSingle) //split\n\t\t\t\t{\n\t\t\t\t\tif(this.offTrack.width > newWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewWidth = this.offTrack.width;\n\t\t\t\t\t}\n\t\t\t\t\tnewWidth += this.thumb.width / 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tnewHeight = this.onTrack.height;\n\t\t\t\tif(!isSingle && //split\n\t\t\t\t\tthis.offTrack.height > newHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this.offTrack.height;\n\t\t\t\t}\n\t\t\t\tif(this.thumb.height > newHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this.thumb.height;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tif(measureOnTrack !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = measureOnTrack.minWidth;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = this.onTrack.width;\n\t\t\t\t}\n\t\t\t\tif(!isSingle) //split\n\t\t\t\t{\n\t\t\t\t\tif(measureOffTrack !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(measureOffTrack.minWidth > newMinWidth)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinWidth = measureOffTrack.minWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(this.offTrack.width > newMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = this.offTrack.width;\n\t\t\t\t\t}\n\t\t\t\t\tif(this.thumb is IMeasureDisplayObject)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth += IMeasureDisplayObject(this.thumb).minWidth / 2;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth += this.thumb.width / 2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tif(measureOnTrack !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = measureOnTrack.minHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = this.onTrack.height;\n\t\t\t\t}\n\t\t\t\tif(!isSingle) //split\n\t\t\t\t{\n\t\t\t\t\tif(measureOffTrack !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(measureOffTrack.minHeight > newMinHeight)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinHeight = measureOffTrack.minHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(this.offTrack.height > newMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = this.offTrack.height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this.thumb is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar measureThumb:IMeasureDisplayObject = IMeasureDisplayObject(this.thumb);\n\t\t\t\t\tif(measureThumb.minHeight > newMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = measureThumb.minHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(this.thumb.height > newMinHeight)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = this.thumb.height;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>thumb</code> sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #thumb\n\t\t * @see #thumbFactory\n\t\t * @see #style:customThumbStyleName\n\t\t */\n\t\tprotected function createThumb():void\n\t\t{\n\t\t\tif(this.thumb !== null)\n\t\t\t{\n\t\t\t\tthis.thumb.removeFromParent(true);\n\t\t\t\tthis.thumb = null;\n\t\t\t}\n\n\t\t\tvar factory:Function = this._thumbFactory != null ? this._thumbFactory : defaultThumbFactory;\n\t\t\tvar thumbStyleName:String = this._customThumbStyleName != null ? this._customThumbStyleName : this.thumbStyleName;\n\t\t\tvar thumb:BasicButton = BasicButton(factory());\n\t\t\tthumb.styleNameList.add(thumbStyleName);\n\t\t\tthumb.keepDownStateOnRollOut = true;\n\t\t\tthumb.addEventListener(TouchEvent.TOUCH, thumb_touchHandler);\n\t\t\tthis.addChild(thumb);\n\t\t\tthis.thumb = thumb;\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>onTrack</code> sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #onTrack\n\t\t * @see #onTrackFactory\n\t\t * @see #style:customOnTrackStyleName\n\t\t */\n\t\tprotected function createOnTrack():void\n\t\t{\n\t\t\tif(this.onTrack !== null)\n\t\t\t{\n\t\t\t\tthis.onTrack.removeFromParent(true);\n\t\t\t\tthis.onTrack = null;\n\t\t\t}\n\n\t\t\tvar factory:Function = this._onTrackFactory != null ? this._onTrackFactory : defaultOnTrackFactory;\n\t\t\tvar onTrackStyleName:String = this._customOnTrackStyleName != null ? this._customOnTrackStyleName : this.onTrackStyleName;\n\t\t\tvar onTrack:BasicButton = BasicButton(factory());\n\t\t\tonTrack.styleNameList.add(onTrackStyleName);\n\t\t\tonTrack.keepDownStateOnRollOut = true;\n\t\t\tthis.addChildAt(onTrack, 0);\n\t\t\tthis.onTrack = onTrack;\n\n\t\t\tif(this.onTrack is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this.onTrack).initializeNow();\n\t\t\t}\n\t\t\tif(this.onTrack is IMeasureDisplayObject)\n\t\t\t{\n\t\t\t\tvar measureOnTrack:IMeasureDisplayObject = IMeasureDisplayObject(this.onTrack);\n\t\t\t\tthis._onTrackSkinExplicitWidth = measureOnTrack.explicitWidth;\n\t\t\t\tthis._onTrackSkinExplicitHeight = measureOnTrack.explicitHeight;\n\t\t\t\tthis._onTrackSkinExplicitMinWidth = measureOnTrack.explicitMinWidth;\n\t\t\t\tthis._onTrackSkinExplicitMinHeight = measureOnTrack.explicitMinHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//this is a regular display object, and we'll treat its\n\t\t\t\t//measurements as explicit when we auto-size the toggle switch\n\t\t\t\tthis._onTrackSkinExplicitWidth = this.onTrack.width;\n\t\t\t\tthis._onTrackSkinExplicitHeight = this.onTrack.height;\n\t\t\t\tthis._onTrackSkinExplicitMinWidth = this._onTrackSkinExplicitWidth;\n\t\t\t\tthis._onTrackSkinExplicitMinHeight = this._onTrackSkinExplicitHeight;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>offTrack</code> sub-component and\n\t\t * removes the old instance, if one exists. If the off track is not\n\t\t * needed, it will not be created.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #offTrack\n\t\t * @see #offTrackFactory\n\t\t * @see #style:customOffTrackStyleName\n\t\t */\n\t\tprotected function createOffTrack():void\n\t\t{\n\t\t\tif(this.offTrack !== null)\n\t\t\t{\n\t\t\t\tthis.offTrack.removeFromParent(true);\n\t\t\t\tthis.offTrack = null;\n\t\t\t}\n\t\t\tif(this._trackLayoutMode === TrackLayoutMode.SINGLE)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar factory:Function = this._offTrackFactory != null ? this._offTrackFactory : defaultOffTrackFactory;\n\t\t\tvar offTrackStyleName:String = this._customOffTrackStyleName != null ? this._customOffTrackStyleName : this.offTrackStyleName;\n\t\t\tvar offTrack:BasicButton = BasicButton(factory());\n\t\t\toffTrack.styleNameList.add(offTrackStyleName);\n\t\t\toffTrack.keepDownStateOnRollOut = true;\n\t\t\tthis.addChildAt(offTrack, 1);\n\t\t\tthis.offTrack = offTrack;\n\n\t\t\tif(this.offTrack is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this.offTrack).initializeNow();\n\t\t\t}\n\t\t\tif(this.offTrack is IMeasureDisplayObject)\n\t\t\t{\n\t\t\t\tvar measureOffTrack:IMeasureDisplayObject = IMeasureDisplayObject(this.offTrack);\n\t\t\t\tthis._offTrackSkinExplicitWidth = measureOffTrack.explicitWidth;\n\t\t\t\tthis._offTrackSkinExplicitHeight = measureOffTrack.explicitHeight;\n\t\t\t\tthis._offTrackSkinExplicitMinWidth = measureOffTrack.explicitMinWidth;\n\t\t\t\tthis._offTrackSkinExplicitMinHeight = measureOffTrack.explicitMinHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//this is a regular display object, and we'll treat its\n\t\t\t\t//measurements as explicit when we auto-size the toggle switch\n\t\t\t\tthis._offTrackSkinExplicitWidth = this.offTrack.width;\n\t\t\t\tthis._offTrackSkinExplicitHeight = this.offTrack.height;\n\t\t\t\tthis._offTrackSkinExplicitMinWidth = this._offTrackSkinExplicitWidth;\n\t\t\t\tthis._offTrackSkinExplicitMinHeight = this._offTrackSkinExplicitHeight;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createLabels():void\n\t\t{\n\t\t\tif(this.offTextRenderer)\n\t\t\t{\n\t\t\t\tthis.removeChild(DisplayObject(this.offTextRenderer), true);\n\t\t\t\tthis.offTextRenderer = null;\n\t\t\t}\n\t\t\tif(this.onTextRenderer)\n\t\t\t{\n\t\t\t\tthis.removeChild(DisplayObject(this.onTextRenderer), true);\n\t\t\t\tthis.onTextRenderer = null;\n\t\t\t}\n\n\t\t\tvar index:int = this.getChildIndex(this.thumb);\n\t\t\tvar offLabelFactory:Function = this._offLabelFactory;\n\t\t\tif(offLabelFactory == null)\n\t\t\t{\n\t\t\t\toffLabelFactory = this._labelFactory;\n\t\t\t}\n\t\t\tif(offLabelFactory == null)\n\t\t\t{\n\t\t\t\toffLabelFactory = FeathersControl.defaultTextRendererFactory;\n\t\t\t}\n\t\t\tthis.offTextRenderer = ITextRenderer(offLabelFactory());\n\t\t\tthis.offTextRenderer.stateContext = this;\n\t\t\tvar offLabelStyleName:String = this._customOffLabelStyleName != null ? this._customOffLabelStyleName : this.offLabelStyleName;\n\t\t\tthis.offTextRenderer.styleNameList.add(offLabelStyleName);\n\t\t\tvar mask:Quad = new Quad(1, 1, 0xff00ff);\n\t\t\t//the initial dimensions cannot be 0 or there's a runtime error\n\t\t\tmask.width = 0;\n\t\t\tmask.height = 0;\n\t\t\tthis.offTextRenderer.mask = mask;\n\t\t\tthis.addChildAt(DisplayObject(this.offTextRenderer), index);\n\n\t\t\tvar onLabelFactory:Function = this._onLabelFactory;\n\t\t\tif(onLabelFactory == null)\n\t\t\t{\n\t\t\t\tonLabelFactory = this._labelFactory;\n\t\t\t}\n\t\t\tif(onLabelFactory == null)\n\t\t\t{\n\t\t\t\tonLabelFactory = FeathersControl.defaultTextRendererFactory;\n\t\t\t}\n\t\t\tthis.onTextRenderer = ITextRenderer(onLabelFactory());\n\t\t\tthis.onTextRenderer.stateContext = this;\n\t\t\tvar onLabelStyleName:String = this._customOnLabelStyleName != null ? this._customOnLabelStyleName : this.onLabelStyleName;\n\t\t\tthis.onTextRenderer.styleNameList.add(onLabelStyleName);\n\t\t\tmask = new Quad(1, 1, 0xff00ff);\n\t\t\t//the initial dimensions cannot be 0 or there's a runtime error\n\t\t\tmask.width = 0;\n\t\t\tmask.height = 0;\n\t\t\tthis.onTextRenderer.mask = mask;\n\t\t\tthis.addChildAt(DisplayObject(this.onTextRenderer), index);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function changeState(state:String):void\n\t\t{\n\t\t\tif(this._currentState === state)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._currentState = state;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STATE);\n\t\t\tthis.dispatchEventWith(FeathersEventType.STATE_CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function resetState():void\n\t\t{\n\t\t\tif(this._isEnabled)\n\t\t\t{\n\t\t\t\tif(this._isSelected)\n\t\t\t\t{\n\t\t\t\t\tthis.changeState(ToggleState.SELECTED);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.changeState(ToggleState.NOT_SELECTED);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(this._isSelected)\n\t\t\t\t{\n\t\t\t\t\tthis.changeState(ToggleState.SELECTED_AND_DISABLED);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.changeState(ToggleState.DISABLED);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutChildren():void\n\t\t{\n\t\t\tif(this.thumb is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.thumb).validate();\n\t\t\t}\n\t\t\tthis.thumb.y = (this.actualHeight - this.thumb.height) / 2;\n\n\t\t\tvar maxLabelWidth:Number = Math.max(0, this.actualWidth - this.thumb.width - this._paddingLeft - this._paddingRight);\n\t\t\tvar totalLabelHeight:Number = Math.max(this.onTextRenderer.height, this.offTextRenderer.height);\n\n\t\t\tvar mask:DisplayObject = this.onTextRenderer.mask;\n\t\t\tmask.width = maxLabelWidth;\n\t\t\tmask.height = totalLabelHeight;\n\n\t\t\tthis.onTextRenderer.y = (this.actualHeight - totalLabelHeight) / 2;\n\n\t\t\tmask = this.offTextRenderer.mask;\n\t\t\tmask.width = maxLabelWidth;\n\t\t\tmask.height = totalLabelHeight;\n\n\t\t\tthis.offTextRenderer.y = (this.actualHeight - totalLabelHeight) / 2;\n\n\t\t\tthis.layoutTracks();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutTracks():void\n\t\t{\n\t\t\tvar maxLabelWidth:Number = Math.max(0, this.actualWidth - this.thumb.width - this._paddingLeft - this._paddingRight);\n\t\t\tvar thumbOffset:Number = this.thumb.x - this._paddingLeft;\n\n\t\t\tvar onScrollOffset:Number = maxLabelWidth - thumbOffset - (maxLabelWidth - this.onTextRenderer.width) / 2;\n\t\t\tvar currentMask:DisplayObject = this.onTextRenderer.mask;\n\t\t\tcurrentMask.x = onScrollOffset;\n\t\t\tthis.onTextRenderer.x = this._paddingLeft - onScrollOffset;\n\n\t\t\tvar offScrollOffset:Number = -thumbOffset - (maxLabelWidth - this.offTextRenderer.width) / 2;\n\t\t\tcurrentMask = this.offTextRenderer.mask;\n\t\t\tcurrentMask.x = offScrollOffset;\n\t\t\tthis.offTextRenderer.x = this.actualWidth - this._paddingRight - maxLabelWidth - offScrollOffset;\n\n\t\t\tif(this._trackLayoutMode == TrackLayoutMode.SPLIT)\n\t\t\t{\n\t\t\t\tthis.layoutTrackWithOnOff();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.layoutTrackWithSingle();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function updateSelection():void\n\t\t{\n\t\t\tif(this.thumb is IToggle)\n\t\t\t{\n\t\t\t\tvar toggleThumb:IToggle = IToggle(this.thumb);\n\t\t\t\tif(this._toggleThumbSelection)\n\t\t\t\t{\n\t\t\t\t\ttoggleThumb.isSelected = this._isSelected;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttoggleThumb.isSelected = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this.thumb is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.thumb).validate();\n\t\t\t}\n\n\t\t\tvar xPosition:Number = this._paddingLeft;\n\t\t\tif(this._isSelected)\n\t\t\t{\n\t\t\t\txPosition = this.actualWidth - this.thumb.width - this._paddingRight;\n\t\t\t}\n\n\t\t\t//stop the tween, no matter what\n\t\t\tif(this._toggleTween)\n\t\t\t{\n\t\t\t\tStarling.juggler.remove(this._toggleTween);\n\t\t\t\tthis._toggleTween = null;\n\t\t\t}\n\n\t\t\tif(this._animateSelectionChange)\n\t\t\t{\n\t\t\t\tthis._toggleTween = new Tween(this.thumb, this._toggleDuration, this._toggleEase);\n\t\t\t\tthis._toggleTween.animate(\"x\", xPosition);\n\t\t\t\tthis._toggleTween.onUpdate = selectionTween_onUpdate;\n\t\t\t\tthis._toggleTween.onComplete = selectionTween_onComplete;\n\t\t\t\tStarling.juggler.add(this._toggleTween);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.thumb.x = xPosition;\n\t\t\t}\n\t\t\tthis._animateSelectionChange = false;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshOnLabelStyles():void\n\t\t{\n\t\t\t//no need to style the label field if there's no text to display\n\t\t\tif(!this._showLabels || !this._showThumb)\n\t\t\t{\n\t\t\t\tthis.onTextRenderer.visible = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.onTextRenderer.fontStyles = this._onLabelFontStylesSet;\n\t\t\tvar properties:PropertyProxy;\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\tproperties = this._disabledLabelProperties;\n\t\t\t}\n\t\t\tif(!properties && this._onLabelProperties)\n\t\t\t{\n\t\t\t\tproperties = this._onLabelProperties;\n\t\t\t}\n\t\t\tif(!properties)\n\t\t\t{\n\t\t\t\tproperties = this._defaultLabelProperties;\n\t\t\t}\n\n\t\t\tthis.onTextRenderer.text = this._onText;\n\t\t\tif(properties)\n\t\t\t{\n\t\t\t\tvar displayRenderer:DisplayObject = DisplayObject(this.onTextRenderer);\n\t\t\t\tfor(var propertyName:String in properties)\n\t\t\t\t{\n\t\t\t\t\tvar propertyValue:Object = properties[propertyName];\n\t\t\t\t\tdisplayRenderer[propertyName] = propertyValue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.onTextRenderer.validate();\n\t\t\tthis.onTextRenderer.visible = true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshOffLabelStyles():void\n\t\t{\n\t\t\t//no need to style the label field if there's no text to display\n\t\t\tif(!this._showLabels || !this._showThumb)\n\t\t\t{\n\t\t\t\tthis.offTextRenderer.visible = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.offTextRenderer.fontStyles = this._offLabelFontStylesSet;\n\t\t\tvar properties:PropertyProxy;\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\tproperties = this._disabledLabelProperties;\n\t\t\t}\n\t\t\tif(!properties && this._offLabelProperties)\n\t\t\t{\n\t\t\t\tproperties = this._offLabelProperties;\n\t\t\t}\n\t\t\tif(!properties)\n\t\t\t{\n\t\t\t\tproperties = this._defaultLabelProperties;\n\t\t\t}\n\n\t\t\tthis.offTextRenderer.text = this._offText;\n\t\t\tif(properties)\n\t\t\t{\n\t\t\t\tvar displayRenderer:DisplayObject = DisplayObject(this.offTextRenderer);\n\t\t\t\tfor(var propertyName:String in properties)\n\t\t\t\t{\n\t\t\t\t\tvar propertyValue:Object = properties[propertyName];\n\t\t\t\t\tdisplayRenderer[propertyName] = propertyValue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.offTextRenderer.validate();\n\t\t\tthis.offTextRenderer.visible = true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshThumbStyles():void\n\t\t{\n\t\t\tfor(var propertyName:String in this._thumbProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._thumbProperties[propertyName];\n\t\t\t\tthis.thumb[propertyName] = propertyValue;\n\t\t\t}\n\t\t\tthis.thumb.visible = this._showThumb;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshOnTrackStyles():void\n\t\t{\n\t\t\tfor(var propertyName:String in this._onTrackProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._onTrackProperties[propertyName];\n\t\t\t\tthis.onTrack[propertyName] = propertyValue;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshOffTrackStyles():void\n\t\t{\n\t\t\tif(!this.offTrack)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor(var propertyName:String in this._offTrackProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._offTrackProperties[propertyName];\n\t\t\t\tthis.offTrack[propertyName] = propertyValue;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshEnabled():void\n\t\t{\n\t\t\tif(this.thumb is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this.thumb).isEnabled = this._isEnabled;\n\t\t\t}\n\t\t\tif(this.onTrack is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this.onTrack).isEnabled = this._isEnabled;\n\t\t\t}\n\t\t\tif(this.offTrack is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this.offTrack).isEnabled = this._isEnabled;\n\t\t\t}\n\t\t\tthis.onTextRenderer.isEnabled = this._isEnabled;\n\t\t\tthis.offTextRenderer.isEnabled = this._isEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutTrackWithOnOff():void\n\t\t{\n\t\t\tvar onTrackWidth:Number = Math.round(this.thumb.x + (this.thumb.width / 2));\n\t\t\tthis.onTrack.x = 0;\n\t\t\tthis.onTrack.width = onTrackWidth;\n\t\t\tthis.offTrack.x = onTrackWidth;\n\t\t\tthis.offTrack.width = this.actualWidth - onTrackWidth;\n\t\t\tif(this._trackScaleMode === TrackScaleMode.EXACT_FIT)\n\t\t\t{\n\t\t\t\tthis.onTrack.y = 0;\n\t\t\t\tthis.onTrack.height = this.actualHeight;\n\n\t\t\t\tthis.offTrack.y = 0;\n\t\t\t\tthis.offTrack.height = this.actualHeight;\n\t\t\t}\n\n\t\t\t//final validation to avoid juggler next frame issues\n\t\t\tif(this.onTrack is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.onTrack).validate();\n\t\t\t}\n\t\t\tif(this.offTrack is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.offTrack).validate();\n\t\t\t}\n\n\t\t\tif(this._trackScaleMode === TrackScaleMode.DIRECTIONAL)\n\t\t\t{\n\t\t\t\tthis.onTrack.y = Math.round((this.actualHeight - this.onTrack.height) / 2);\n\t\t\t\tthis.offTrack.y = Math.round((this.actualHeight - this.offTrack.height) / 2);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutTrackWithSingle():void\n\t\t{\n\t\t\tthis.onTrack.x = 0;\n\t\t\tthis.onTrack.width = this.actualWidth;\n\t\t\tif(this._trackScaleMode === TrackScaleMode.EXACT_FIT)\n\t\t\t{\n\t\t\t\tthis.onTrack.y = 0;\n\t\t\t\tthis.onTrack.height = this.actualHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//we'll calculate y after validation in case the track needs\n\t\t\t\t//to auto-size\n\t\t\t\tthis.onTrack.height = this._onTrackSkinExplicitHeight;\n\t\t\t}\n\n\t\t\t//final validation to avoid juggler next frame issues\n\t\t\tif(this.onTrack is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.onTrack).validate();\n\t\t\t}\n\n\t\t\tif(this._trackScaleMode === TrackScaleMode.DIRECTIONAL)\n\t\t\t{\n\t\t\t\tthis.onTrack.y = Math.round((this.actualHeight - this.onTrack.height) / 2);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function childProperties_onChange(proxy:PropertyProxy, name:Object):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function toggleSwitch_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tthis._touchPointID = -1;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function focusInHandler(event:Event):void\n\t\t{\n\t\t\tsuper.focusInHandler(event);\n\t\t\tthis.stage.addEventListener(KeyboardEvent.KEY_DOWN, stage_keyDownHandler);\n\t\t\tthis.stage.addEventListener(KeyboardEvent.KEY_UP, stage_keyUpHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function focusOutHandler(event:Event):void\n\t\t{\n\t\t\tsuper.focusOutHandler(event);\n\t\t\tthis.stage.removeEventListener(KeyboardEvent.KEY_DOWN, stage_keyDownHandler);\n\t\t\tthis.stage.removeEventListener(KeyboardEvent.KEY_UP, stage_keyUpHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function toggleSwitch_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(this._ignoreTapHandler)\n\t\t\t{\n\t\t\t\tthis._ignoreTapHandler = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar touch:Touch = event.getTouch(this, TouchPhase.ENDED);\n\t\t\tif(!touch)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._touchPointID = -1;\n\t\t\ttouch.getLocation(this.stage, HELPER_POINT);\n\t\t\tvar isInBounds:Boolean = this.contains(this.stage.hitTest(HELPER_POINT));\n\t\t\tif(isInBounds)\n\t\t\t{\n\t\t\t\tthis.setSelectionWithAnimation(!this._isSelected);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function thumb_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this._touchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(this.thumb, null, this._touchPointID);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttouch.getLocation(this, HELPER_POINT);\n\t\t\t\tvar trackScrollableWidth:Number = this.actualWidth - this._paddingLeft - this._paddingRight - this.thumb.width;\n\t\t\t\tif(touch.phase == TouchPhase.MOVED)\n\t\t\t\t{\n\t\t\t\t\tvar exclusiveTouch:ExclusiveTouch = ExclusiveTouch.forStage(this.stage);\n\t\t\t\t\tvar claim:DisplayObject = exclusiveTouch.getClaim(this._touchPointID);\n\t\t\t\t\tif(claim !== this)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(claim)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//already claimed by another display object\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\texclusiveTouch.claimTouch(this._touchPointID, this);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tvar xOffset:Number = HELPER_POINT.x - this._touchStartX;\n\t\t\t\t\tvar xPosition:Number = Math.min(Math.max(this._paddingLeft, this._thumbStartX + xOffset), this._paddingLeft + trackScrollableWidth);\n\t\t\t\t\tthis.thumb.x = xPosition;\n\t\t\t\t\tthis.layoutTracks();\n\t\t\t\t}\n\t\t\t\telse if(touch.phase == TouchPhase.ENDED)\n\t\t\t\t{\n\t\t\t\t\tvar pixelsMoved:Number = Math.abs(HELPER_POINT.x - this._touchStartX);\n\t\t\t\t\tvar inchesMoved:Number = pixelsMoved / DeviceCapabilities.dpi;\n\t\t\t\t\tif(inchesMoved > MINIMUM_DRAG_DISTANCE || (SystemUtil.isDesktop && pixelsMoved >= 1))\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._touchPointID = -1;\n\t\t\t\t\t\tthis._ignoreTapHandler = true;\n\t\t\t\t\t\tthis.setSelectionWithAnimation(this.thumb.x > (this._paddingLeft + trackScrollableWidth / 2));\n\t\t\t\t\t\t//we still need to invalidate, even if there's no change\n\t\t\t\t\t\t//because the thumb may be in the middle!\n\t\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(this.thumb, TouchPhase.BEGAN);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttouch.getLocation(this, HELPER_POINT);\n\t\t\t\tthis._touchPointID = touch.id;\n\t\t\t\tthis._thumbStartX = this.thumb.x;\n\t\t\t\tthis._touchStartX = HELPER_POINT.x;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(event.keyCode == Keyboard.ESCAPE)\n\t\t\t{\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t}\n\t\t\tif(this._touchPointID != -1 || !(event.keyCode == Keyboard.SPACE || (event.keyCode == Keyboard.ENTER && (event.keyLocation == KeyLocation.D_PAD || DeviceCapabilities.simulateDPad))))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._touchPointID = int.MAX_VALUE;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_keyUpHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(this._touchPointID != int.MAX_VALUE || !(event.keyCode == Keyboard.SPACE || (event.keyCode == Keyboard.ENTER && (event.keyLocation == KeyLocation.D_PAD || DeviceCapabilities.simulateDPad))))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._touchPointID = -1;\n\t\t\tthis.setSelectionWithAnimation(!this._isSelected);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function selectionTween_onUpdate():void\n\t\t{\n\t\t\tthis.layoutTracks();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function selectionTween_onComplete():void\n\t\t{\n\t\t\tthis._toggleTween = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function fontStyles_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/controls/TrackInteractionMode.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\t/**\n\t * Interaction modes for components with a track.\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class TrackInteractionMode\n\t{\n\t\t/**\n\t\t * When the track is touched, the slider's thumb jumps directly to the\n\t\t * touch position, and the slider's <code>value</code> property is\n\t\t * updated to match as if the thumb were dragged to that position, and\n\t\t * the thumb may continue to be dragged until the touch ends.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const TO_VALUE:String = \"toValue\";\n\n\t\t/**\n\t\t * When the track is touched, the <code>value</code> is increased or\n\t\t * decreased (depending on the location of the touch) by the value of\n\t\t * the <code>page</code> property.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const BY_PAGE:String = \"byPage\";\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/TrackLayoutMode.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\t/**\n\t * Layout modes for components with a thumb that is dragged along a track.\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class TrackLayoutMode\n\t{\n\t\t/**\n\t\t * The component has only one track, that fills its full length.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const SINGLE:String = \"single\";\n\n\t\t/**\n\t\t * The component has multiple tracks, meeting in the middle of the thumb\n\t\t * and filling the available space on each side. The tracks will be\n\t\t * resized as the thumb moves.\n\t\t *\n\t\t * <p>This track layout mode is designed for components where the track\n\t\t * on different sides of the thumb may be colored differently to show\n\t\t * the value \"filling up\" as the thumb is dragged.</p>\n\t\t *\n\t\t * <p>Since the tracks will be resized when the thumb is dragged,\n\t\t * consider using a display object that is capable of resizing without\n\t\t * distortion, such as an <code>Image</code> with a\n\t\t * <code>scale9Grid</code> or a <code>tileGrid</code>.</p>\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const SPLIT:String = \"split\";\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/TrackScaleMode.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\t/**\n\t * How the track is sized perpendicular to the direction it is dragged.\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class TrackScaleMode\n\t{\n\t\t/**\n\t\t * The track dimensions fill the full width and height of the component.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const EXACT_FIT:String = \"exactFit\";\n\n\t\t/**\n\t\t * If the component's direction is horizontal, the width of the track\n\t\t * will fill the full width of the component, and if the component's\n\t\t * direction is vertical, the height of the track will fill the full\n\t\t * height of the component. The other edge will not be scaled, and its\n\t\t * preferred size will be used instead.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const DIRECTIONAL:String = \"directional\";\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/Tree.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.controls.Scroller;\n\timport feathers.controls.renderers.DefaultTreeItemRenderer;\n\timport feathers.controls.renderers.ITreeItemRenderer;\n\timport feathers.controls.supportClasses.TreeDataViewPort;\n\timport feathers.data.ArrayCollection;\n\timport feathers.data.IHierarchicalCollection;\n\timport feathers.events.CollectionEventType;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.ILayout;\n\timport feathers.layout.IVariableVirtualLayout;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.system.DeviceCapabilities;\n\n\timport flash.events.KeyboardEvent;\n\timport flash.geom.Point;\n\timport flash.ui.Keyboard;\n\n\timport starling.events.Event;\n\timport starling.utils.Pool;\n\n\t/**\n\t * A style name to add to all item renderers in this tree. Typically\n\t * used by a theme to provide different styles to different trees.\n\t *\n\t * <p>The following example sets the item renderer style name:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * tree.customItemRendererStyleName = \"my-custom-item-renderer\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different skins than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( DefaultTreeItemRenderer ).setFunctionForStyleName( \"my-custom-item-renderer\", setCustomItemRendererStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see feathers.core.FeathersControl#styleNameList\n\t */\n\t[Style(name=\"customItemRendererStyleName\",type=\"String\")]\n\n\t/**\n\t * The duration, in seconds, of the animation when the selected item is\n\t * changed by keyboard navigation and the item scrolls into view.\n\t *\n\t * <p>In the following example, the duration of the animation that\n\t * scrolls the tree to a new selected item is set to 500 milliseconds:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * tree.keyScrollDuration = 0.5;</listing>\n\t *\n\t * @default 0.25\n\t */\n\t[Style(name=\"keyScrollDuration\",type=\"Number\")]\n\n\t/**\n\t * The layout algorithm used to position and, optionally, size the\n\t * tree's items.\n\t *\n\t * <p>By default, if no layout is provided by the time that the tree\n\t * initializes, a vertical layout with options targeted at touch screens\n\t * is created.</p>\n\t *\n\t * <p>The following example tells the tree to use a horizontal layout:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var layout:HorizontalLayout = new HorizontalLayout();\n\t * layout.gap = 20;\n\t * layout.padding = 20;\n\t * tree.layout = layout;</listing>\n\t */\n\t[Style(name=\"layout\",type=\"feathers.layout.ILayout\")]\n\n\t/**\n\t * Dispatched when the selected item changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #selectedItem\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the the user taps or clicks an item renderer in the tree.\n\t * The touch must remain within the bounds of the item renderer on release,\n\t * and the tree must not have scrolled, to register as a tap or a click.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The item associated with the item\n\t *   renderer that was triggered.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.TRIGGERED\n\t */\n\t[Event(name=\"triggered\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item renderer is added to the tree. When the layout is\n\t * virtualized, item renderers may not exist for every item in the data\n\t * provider. This event can be used to track which items currently have\n\t * renderers.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The item renderer that was added</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.RENDERER_ADD\n\t */\n\t[Event(name=\"rendererAdd\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item renderer is removed from the tree. When the layout is\n\t * virtualized, item renderers may not exist for every item in the data\n\t * provider. This event can be used to track which items currently have\n\t * renderers.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The item renderer that was removed</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.RENDERER_REMOVE\n\t */\n\t[Event(name=\"rendererRemove\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when a branch is opened.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The data for the branch that was opened</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.OPEN\n\t *\n\t * @see #event:close starling.events.Event.CLOSE\n\t * @see #isBranchOpen()\n\t * @see #toggleBranch()\n\t */\n\t[Event(name=\"open\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when a branch is closed.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The data for the branch that was closed</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CLOSE\n\t *\n\t * @see #event:open starling.events.Event.OPEN\n\t * @see #isBranchOpen()\n\t * @see #toggleBranch()\n\t */\n\t[Event(name=\"close\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Displays a hierarchical tree of items. Supports scrolling, custom item\n\t * renderers, and custom layouts.\n\t *\n\t * <p>The following example creates a tree, gives it a data provider, and\n\t * tells the item renderer how to interpret the data:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var tree:Tree = new Tree();\n\t * \n\t * tree.dataProvider = new ArrayHierarchicalCollection(\n\t * [\n\t *     {\n\t *         text: \"Node 1\",\n\t *         children:\n\t *         [\n\t *             {\n\t *                 text: \"Node 1A\",\n\t *                 children:\n\t *                 [\n\t *                     { text: \"Node 1A-I\" },\n\t *                     { text: \"Node 1A-II\" },\n\t *                 ]\n\t *             },\n\t *             { text: \"Node 1B\" },\n\t *         ]\n\t *     },\n\t *     { text: \"Node 2\" },\n\t *     {\n\t *         text: \"Node 3\",\n\t *         children:\n\t *         [\n\t *             { text: \"Node 3A\" },\n\t *             { text: \"Node 3B\" },\n\t *             { text: \"Node 3C\" },\n\t *         ]\n\t *     }\n\t * ]);\n\t * \n\t * tree.itemRendererFactory = function():ITreeItemRenderer\n\t * {\n\t *     var itemRenderer:DefaultTreeItemRenderer = new DefaultTreeItemRenderer();\n\t *     itemRenderer.labelField = \"text\";\n\t *     return itemRenderer;\n\t * };\n\t * \n\t * this.addChild( tree );</listing>\n\t *\n\t * @see ../../../help/tree.html How to use the Feathers Tree component\n\t * @see ../../../help/default-item-renderers.html How to use the Feathers default item renderer\n\t * @see ../../../help/item-renderers.html Creating custom item renderers for the Feathers Tree component\n\t *\n\t * @productversion Feathers 3.3.0\n\t */\n\tpublic class Tree extends Scroller\n\t{\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>Tree</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function Tree()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * The guts of the Tree's functionality. Handles layout and selection.\n\t\t */\n\t\tprotected var dataViewPort:TreeDataViewPort;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn Tree.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function get isFocusEnabled():Boolean\n\t\t{\n\t\t\treturn (this._isSelectable || this._minHorizontalScrollPosition != this._maxHorizontalScrollPosition ||\n\t\t\t\tthis._minVerticalScrollPosition != this._maxVerticalScrollPosition) &&\n\t\t\t\tthis._isEnabled && this._isFocusEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _dataProvider:IHierarchicalCollection = null;\n\n\t\t/**\n\t\t * The collection of data displayed by the tree. Changing this property\n\t\t * to a new value is considered a drastic change to the tree's data, so\n\t\t * the horizontal and vertical scroll positions will be reset, and the\n\t\t * tree's selection will be cleared.\n\t\t *\n\t\t * <p>The following example passes in a data provider and tells the item\n\t\t * renderer how to interpret the data:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * tree.dataProvider = new ArrayHierarchicalCollection(\n\t\t * [\n\t\t *     {\n\t\t *         text: \"Node 1\",\n\t\t *         children:\n\t\t *         [\n\t\t *             {\n\t\t *                 text: \"Node 1A\",\n\t\t *                 children:\n\t\t *                 [\n\t\t *                     { text: \"Node 1A-I\" },\n\t\t *                     { text: \"Node 1A-II\" },\n\t\t *                 ]\n\t\t *             },\n\t\t *             { text: \"Node 1B\" },\n\t\t *         ]\n\t\t *     },\n\t\t *     { text: \"Node 2\" },\n\t\t *     {\n\t\t *         text: \"Node 3\",\n\t\t *         children:\n\t\t *         [\n\t\t *             { text: \"Node 3A\" },\n\t\t *             { text: \"Node 3B\" },\n\t\t *             { text: \"Node 3C\" },\n\t\t *         ]\n\t\t *     }\n\t\t * ]);\n\t\t * \n\t\t * tree.itemRendererFactory = function():ITreeItemRenderer\n\t\t * {\n\t\t *     var itemRenderer:DefaultTreeItemRenderer = new DefaultTreeItemRenderer();\n\t\t *     itemRenderer.labelField = \"text\";\n\t\t *     return itemRenderer;\n\t\t * };</listing>\n\t\t *\n\t\t * <p><em>Warning:</em> A tree's data provider cannot contain duplicate\n\t\t * items. To display the same item in multiple item renderers, you must\n\t\t * create separate objects with the same properties. This restriction\n\t\t * exists because it significantly improves performance.</p>\n\t\t *\n\t\t * <p><em>Warning:</em> If the data provider contains display objects,\n\t\t * concrete textures, or anything that needs to be disposed, those\n\t\t * objects will not be automatically disposed when the list is disposed.\n\t\t * Similar to how <code>starling.display.Image</code> cannot\n\t\t * automatically dispose its texture because the texture may be used\n\t\t * by other display objects, a list cannot dispose its data provider\n\t\t * because the data provider may be used by other lists. See the\n\t\t * <code>dispose()</code> function on <code>IHierarchicalCollection</code> to\n\t\t * see how the data provider can be disposed properly.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.data.IHierarchicalCollection#dispose()\n\t\t * @see feathers.data.ArrayHierarchicalCollection\n\t\t * @see feathers.data.VectorHierarchicalCollection\n\t\t * @see feathers.data.XMLListHierarchicalCollection\n\t\t */\n\t\tpublic function get dataProvider():IHierarchicalCollection\n\t\t{\n\t\t\treturn this._dataProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set dataProvider(value:IHierarchicalCollection):void\n\t\t{\n\t\t\tif(this._dataProvider === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._dataProvider !== null)\n\t\t\t{\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.REMOVE_ITEM, dataProvider_removeItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.REMOVE_ALL, dataProvider_removeAllHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.REPLACE_ITEM, dataProvider_replaceItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.RESET, dataProvider_resetHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(Event.CHANGE, dataProvider_changeHandler);\n\t\t\t}\n\t\t\tthis._dataProvider = value;\n\t\t\tif(this._dataProvider !== null)\n\t\t\t{\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.REMOVE_ITEM, dataProvider_removeItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.REMOVE_ALL, dataProvider_removeAllHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.REPLACE_ITEM, dataProvider_replaceItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.RESET, dataProvider_resetHandler);\n\t\t\t\tthis._dataProvider.addEventListener(Event.CHANGE, dataProvider_changeHandler);\n\t\t\t}\n\n\t\t\t//reset the scroll position because this is a drastic change and\n\t\t\t//the data is probably completely different\n\t\t\tthis.horizontalScrollPosition = 0;\n\t\t\tthis.verticalScrollPosition = 0;\n\n\t\t\t//clear the selection for the same reason\n\t\t\tthis.selectedItem = null;\n\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isSelectable:Boolean = true;\n\n\t\t/**\n\t\t * Determines if an item in the tree may be selected.\n\t\t *\n\t\t * <p>The following example disables selection:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * tree.isSelectable = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t *\n\t\t * @see #selectedItem\n\t\t */\n\t\tpublic function get isSelectable():Boolean\n\t\t{\n\t\t\treturn this._isSelectable;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isSelectable(value:Boolean):void\n\t\t{\n\t\t\tif(this._isSelectable === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isSelectable = value;\n\t\t\tif(!this._isSelectable)\n\t\t\t{\n\t\t\t\tthis.selectedItem = null;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _helperLocation:Vector.<int> = new <int>[];\n\n\t\t/**\n\t\t * The currently selected location. Returns an empty\n\t\t * <code>Vector.&lt;int&gt;</code> if no item is selected.\n\t\t *\n\t\t * <p>The following example listens for when selection changes and\n\t\t * requests the selected location:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * function tree_changeHandler( event:Event ):void\n\t\t * {\n\t\t *     var tree:Tree = Tree( event.currentTarget );\n\t\t *     var location:Vector.&lt;int&gt; = tree.selectedLocation;\n\t\t * \n\t\t * }\n\t\t * tree.addEventListener( Event.CHANGE, tree_changeHandler );</listing>\n\t\t *\n\t\t * <p>Alternatively, you may use the <code>getSelectedLocation()</code>\n\t\t * method to get the selected location without creating a new\n\t\t * <code>Vector.&lt;int&gt;</code> instance, to avoid garbage\n\t\t * collection of temporary objects.</p>\n\t\t *\n\t\t * @see #getSelectedLocation()\n\t\t */\n\t\tpublic function get selectedLocation():Vector.<int>\n\t\t{\n\t\t\treturn this.getSelectedLocation();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedLocation(value:Vector.<int>):void\n\t\t{\n\t\t\tvar item:Object = this._dataProvider.getItemAtLocation(value);\n\t\t\tthis.selectedItem = item;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectedItem:Object = null;\n\n\t\t/**\n\t\t * The currently selected item. Returns <code>null</code> if no item is\n\t\t * selected.\n\t\t *\n\t\t * <p>The following example listens for when selection changes and\n\t\t * requests the selected item:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * function tree_changeHandler( event:Event ):void\n\t\t * {\n\t\t *     var tree:Tree = Tree( event.currentTarget );\n\t\t *     var item:Object = tree.selectedItem;\n\t\t * \n\t\t * }\n\t\t * tree.addEventListener( Event.CHANGE, tree_changeHandler );</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get selectedItem():Object\n\t\t{\n\t\t\treturn this._selectedItem;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedItem(value:Object):void\n\t\t{\n\t\t\tif(this._selectedItem === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._dataProvider === null)\n\t\t\t{\n\t\t\t\tvalue = null;\n\t\t\t}\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvar result:Vector.<int> = this._dataProvider.getItemLocation(value, this._helperLocation);\n\t\t\t\tif(result === null || result.length == 0)\n\t\t\t\t{\n\t\t\t\t\tvalue = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._selectedItem === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._selectedItem = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _layout:ILayout;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get layout():ILayout\n\t\t{\n\t\t\treturn this._layout;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set layout(value:ILayout):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._layout === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._layout !== null)\n\t\t\t{\n\t\t\t\tthis._layout.removeEventListener(Event.SCROLL, layout_scrollHandler);\n\t\t\t}\n\t\t\tthis._layout = value;\n\t\t\tif(this._layout is IVariableVirtualLayout)\n\t\t\t{\n\t\t\t\tthis._layout.addEventListener(Event.SCROLL, layout_scrollHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _itemRendererType:Class = DefaultTreeItemRenderer;\n\n\t\t/**\n\t\t * The class used to instantiate item renderers. Must implement the\n\t\t * <code>ITreeItemRenderer</code> interface.\n\t\t *\n\t\t * <p>To customize properties on the item renderer, use\n\t\t * <code>itemRendererFactory</code> instead.</p>\n\t\t *\n\t\t * <p>The following example changes the item renderer type:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * tree.itemRendererType = CustomItemRendererClass;</listing>\n\t\t *\n\t\t * @default feathers.controls.renderers.DefaultTreeItemRenderer\n\t\t *\n\t\t * @see feathers.controls.renderers.ITreeItemRenderer\n\t\t * @see #itemRendererFactory\n\t\t */\n\t\tpublic function get itemRendererType():Class\n\t\t{\n\t\t\treturn this._itemRendererType;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set itemRendererType(value:Class):void\n\t\t{\n\t\t\tif(this._itemRendererType === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._itemRendererType = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _itemRendererFactories:Object;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _itemRendererFactory:Function;\n\n\t\t/**\n\t\t * A function called that is expected to return a new item renderer. Has\n\t\t * a higher priority than <code>itemRendererType</code>. Typically, you\n\t\t * would use an <code>itemRendererFactory</code> instead of an\n\t\t * <code>itemRendererType</code> if you wanted to initialize some\n\t\t * properties on each separate item renderer, such as skins.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t *\n\t\t * <pre>function():ITreeItemRenderer</pre>\n\t\t *\n\t\t * <p>The following example provides a factory for the item renderer:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * tree.itemRendererFactory = function():ITreeItemRenderer\n\t\t * {\n\t\t *     var renderer:CustomItemRendererClass = new CustomItemRendererClass();\n\t\t *     renderer.backgroundSkin = new Quad( 10, 10, 0xff0000 );\n\t\t *     return renderer;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.renderers.ITreeItemRenderer\n\t\t * @see #itemRendererType\n\t\t * @see #setItemRendererFactoryWithID()\n\t\t */\n\t\tpublic function get itemRendererFactory():Function\n\t\t{\n\t\t\treturn this._itemRendererFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set itemRendererFactory(value:Function):void\n\t\t{\n\t\t\tif(this._itemRendererFactory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._itemRendererFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _factoryIDFunction:Function;\n\n\t\t/**\n\t\t * When a tree requires multiple item renderer types, this function is\n\t\t * used to determine which type of item renderer is required for a\n\t\t * specific item (or index). Returns the ID of the item renderer type\n\t\t * to use for the item, or <code>null</code> if the default\n\t\t * <code>itemRendererFactory</code> should be used.\n\t\t *\n\t\t * <p>The function is expected to have one of the following\n\t\t * signatures:</p>\n\t\t *\n\t\t * <pre>function(item:Object):String</pre>\n\t\t *\n\t\t * <pre>function(item:Object, location:Vector.&lt;int&gt;):String</pre>\n\t\t *\n\t\t * <p>The following example provides a <code>factoryIDFunction</code>:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * function regularItemFactory():ITreeItemRenderer\n\t\t * {\n\t\t *     return new DefaultTreeItemRenderer();\n\t\t * }\n\t\t * function firstItemFactory():ITreeItemRenderer\n\t\t * {\n\t\t *     return new CustomItemRenderer();\n\t\t * }\n\t\t * tree.setItemRendererFactoryWithID( \"regular-item\", regularItemFactory );\n\t\t * tree.setItemRendererFactoryWithID( \"first-item\", firstItemFactory );\n\t\t * \n\t\t * tree.factoryIDFunction = function( item:Object, location:Vector.&lt;int&gt; ):String\n\t\t * {\n\t\t *     if(location.length == 1 &amp;&amp; location[0] == 0)\n\t\t *     {\n\t\t *         return \"first-item\";\n\t\t *     }\n\t\t *     return \"regular-item\";\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #setItemRendererFactoryWithID()\n\t\t * @see #itemRendererFactory\n\t\t */\n\t\tpublic function get factoryIDFunction():Function\n\t\t{\n\t\t\treturn this._factoryIDFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set factoryIDFunction(value:Function):void\n\t\t{\n\t\t\tif(this._factoryIDFunction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._factoryIDFunction = value;\n\t\t\tif(value !== null && this._itemRendererFactories === null)\n\t\t\t{\n\t\t\t\tthis._itemRendererFactories = {};\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _typicalItem:Object = null;\n\n\t\t/**\n\t\t * Used to auto-size the tree when a virtualized layout is used. If the\n\t\t * tree's width or height is unknown, the tree will try to automatically\n\t\t * pick an ideal size. This item is used to create a sample item\n\t\t * renderer to measure item renderers that are virtual and not visible\n\t\t * in the viewport.\n\t\t *\n\t\t * <p>The following example provides a typical item:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * tree.typicalItem = { text: \"A typical item\", thumbnail: texture };</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get typicalItem():Object\n\t\t{\n\t\t\treturn this._typicalItem;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set typicalItem(value:Object):void\n\t\t{\n\t\t\tif(this._typicalItem === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._typicalItem = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customItemRendererStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customItemRendererStyleName():String\n\t\t{\n\t\t\treturn this._customItemRendererStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customItemRendererStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customItemRendererStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customItemRendererStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _keyScrollDuration:Number = 0.25;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get keyScrollDuration():Number\n\t\t{\n\t\t\treturn this._keyScrollDuration;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set keyScrollDuration(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._keyScrollDuration == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._keyScrollDuration = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var pendingLocation:Vector.<int> = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//clearing selection now so that the data provider setter won't\n\t\t\t//cause a selection change that triggers events.\n\t\t\tthis._selectedItem = null;\n\t\t\tthis.dataProvider = null;\n\t\t\tthis.layout = null;\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * Returns the item renderer factory associated with a specific ID.\n\t\t * Returns <code>null</code> if no factory is associated with the ID.\n\t\t *\n\t\t * @see #setItemRendererFactoryWithID()\n\t\t */\n\t\tpublic function getItemRendererFactoryWithID(id:String):Function\n\t\t{\n\t\t\tif(this._itemRendererFactories && (id in this._itemRendererFactories))\n\t\t\t{\n\t\t\t\treturn this._itemRendererFactories[id] as Function;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * Associates an item renderer factory with an ID to allow multiple\n\t\t * types of item renderers may be displayed in the tree. A custom\n\t\t * <code>factoryIDFunction</code> may be specified to return the ID of\n\t\t * the factory to use for a specific item in the data provider.\n\t\t *\n\t\t * @see #factoryIDFunction\n\t\t * @see #getItemRendererFactoryWithID()\n\t\t */\n\t\tpublic function setItemRendererFactoryWithID(id:String, factory:Function):void\n\t\t{\n\t\t\tif(id === null)\n\t\t\t{\n\t\t\t\tthis.itemRendererFactory = factory;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._itemRendererFactories === null)\n\t\t\t{\n\t\t\t\tthis._itemRendererFactories = {};\n\t\t\t}\n\t\t\tif(factory !== null)\n\t\t\t{\n\t\t\t\tthis._itemRendererFactories[id] = factory;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdelete this._itemRendererFactories[id];\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Returns the current item renderer used to render a specific item. May\n\t\t * return <code>null</code> if an item doesn't currently have an item\n\t\t * renderer. Most trees use virtual layouts where only the visible items\n\t\t * will have an item renderer, so the result will usually be\n\t\t * <code>null</code> for most items in the data provider.\n\t\t *\n\t\t * @see ../../../help/faq/layout-virtualization.html What is layout virtualization?\n\t\t */\n\t\tpublic function itemToItemRenderer(item:Object):ITreeItemRenderer\n\t\t{\n\t\t\treturn this.dataViewPort.itemToItemRenderer(item);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _openBranches:ArrayCollection = new ArrayCollection();\n\n\t\t/**\n\t\t * Opens or closes a branch.\n\t\t *\n\t\t * @see #isBranchOpen()\n\t\t * @see #event:open starling.events.Event.OPEN\n\t\t * @see #event:close starling.events.Event.CLOSE\n\t\t */\n\t\tpublic function toggleBranch(branch:Object, open:Boolean):void\n\t\t{\n\t\t\tif(this._dataProvider === null || !this._dataProvider.isBranch(branch))\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"toggleBranch() may not open an item that is not a branch.\");\n\t\t\t}\n\t\t\tvar index:int = this._openBranches.getItemIndex(branch);\n\t\t\tif(open)\n\t\t\t{\n\t\t\t\tif(index != -1)\n\t\t\t\t{\n\t\t\t\t\t//the branch is already open\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._openBranches.addItem(branch);\n\t\t\t\tthis.dispatchEventWith(Event.OPEN, false, branch);\n\t\t\t}\n\t\t\telse //close\n\t\t\t{\n\t\t\t\tif(index == -1)\n\t\t\t\t{\n\t\t\t\t\t//the branch is already closed\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._openBranches.removeItem(branch);\n\t\t\t\tthis.dispatchEventWith(Event.CLOSE, false, branch);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Indicates if a branch from the data provider is open or closed.\n\t\t *\n\t\t * @see #toggleBranch()\n\t\t * @see #event:open starling.events.Event.OPEN\n\t\t * @see #event:close starling.events.Event.CLOSE\n\t\t */\n\t\tpublic function isBranchOpen(branch:Object):Boolean\n\t\t{\n\t\t\tif(this._dataProvider === null || !this._dataProvider.isBranch(branch))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn this._openBranches.getItemIndex(branch) != -1;\n\t\t}\n\n\t\t/**\n\t\t * Returns the currently selected location, or an empty\n\t\t * <code>Vector.&lt;int&gt;</code>, if no item is currently selected.\n\t\t *\n\t\t * <p>The following example listens for when selection changes and\n\t\t * requests the selected location:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * function tree_changeHandler( event:Event ):void\n\t\t * {\n\t\t *     var tree:Tree = Tree( event.currentTarget );\n\t\t *     var result:Vector.&lt;int&gt; = new &lt;int&gt;[];\n\t\t *     var location:Vector.&lt;int&gt; = tree.getSelectedLocation(result);\n\t\t * }\n\t\t * tree.addEventListener( Event.CHANGE, tree_changeHandler );</listing>\n\t\t *\n\t\t * @see #selectedItem\n\t\t * @see #selectedLocation\n\t\t */\n\t\tpublic function getSelectedLocation(result:Vector.<int> = null):Vector.<int>\n\t\t{\n\t\t\tif(result === null)\n\t\t\t{\n\t\t\t\tresult = new <int>[];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult.length = 0;\n\t\t\t}\n\t\t\tif(this._dataProvider === null || this._selectedItem === null)\n\t\t\t{\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\treturn this._dataProvider.getItemLocation(this._selectedItem, result);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function scrollToPosition(horizontalScrollPosition:Number, verticalScrollPosition:Number, animationDuration:Number = NaN):void\n\t\t{\n\t\t\tthis.pendingLocation = null;\n\t\t\tsuper.scrollToPosition(horizontalScrollPosition, verticalScrollPosition, animationDuration);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function scrollToPageIndex(horizontalPageIndex:int, verticalPageIndex:int, animationDuration:Number = NaN):void\n\t\t{\n\t\t\tthis.pendingLocation = null;\n\t\t\tsuper.scrollToPageIndex(horizontalPageIndex, verticalPageIndex, animationDuration);\n\t\t}\n\n\t\t/**\n\t\t * After the next validation, scrolls the list so that the specified\n\t\t * item is visible. If <code>animationDuration</code> is greater than\n\t\t * zero, the scroll will animate. The duration is in seconds.\n\t\t *\n\t\t * <p>In the following example, the list is scrolled to display the\n\t\t * third item in the second branch:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * tree.scrollToDisplayLocation( new &lt;int&gt;[1, 2] );</listing>\n\t\t */\n\t\tpublic function scrollToDisplayLocation(location:Vector.<int>, animationDuration:Number = 0):void\n\t\t{\n\t\t\t//cancel any pending scroll to a different page or scroll position.\n\t\t\t//we can have only one type of pending scroll at a time.\n\t\t\tthis.hasPendingHorizontalPageIndex = false;\n\t\t\tthis.hasPendingVerticalPageIndex = false;\n\t\t\tthis.pendingHorizontalScrollPosition = NaN;\n\t\t\tthis.pendingVerticalScrollPosition = NaN;\n\t\t\tif(this.pendingLocation !== null &&\n\t\t\t\tthis.pendingLocation.length == location.length &&\n\t\t\t\tthis.pendingScrollDuration == animationDuration)\n\t\t\t{\n\t\t\t\tvar locationsEqual:Boolean = this.pendingLocation.every(function(item:int, index:int, source:Vector.<int>):Boolean\n\t\t\t\t{\n\t\t\t\t\treturn item == location[index];\n\t\t\t\t});\n\t\t\t\tif(locationsEqual)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.pendingLocation = location;\n\t\t\tthis.pendingScrollDuration = animationDuration;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_PENDING_SCROLL);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tvar hasLayout:Boolean = this._layout !== null;\n\n\t\t\tsuper.initialize();\n\n\t\t\tif(!this.dataViewPort)\n\t\t\t{\n\t\t\t\tthis.viewPort = this.dataViewPort = new TreeDataViewPort();\n\t\t\t\tthis.dataViewPort.owner = this;\n\t\t\t\tthis.dataViewPort.addEventListener(Event.CHANGE, dataViewPort_changeHandler);\n\t\t\t\tthis.viewPort = this.dataViewPort;\n\t\t\t}\n\n\t\t\tif(!hasLayout)\n\t\t\t{\n\t\t\t\tif(this._hasElasticEdges &&\n\t\t\t\t\tthis._verticalScrollPolicy === ScrollPolicy.AUTO &&\n\t\t\t\t\tthis._scrollBarDisplayMode !== ScrollBarDisplayMode.FIXED)\n\t\t\t\t{\n\t\t\t\t\t//so that the elastic edges work even when the max scroll\n\t\t\t\t\t//position is 0, similar to iOS.\n\t\t\t\t\tthis._verticalScrollPolicy = ScrollPolicy.ON;\n\t\t\t\t}\n\n\t\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\t\tlayout.useVirtualLayout = true;\n\t\t\t\tlayout.padding = 0;\n\t\t\t\tlayout.gap = 0;\n\t\t\t\tlayout.horizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\t\tlayout.verticalAlign = VerticalAlign.TOP;\n\t\t\t\tthis.ignoreNextStyleRestriction();\n\t\t\t\tthis.layout = layout;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tthis.refreshDataViewPortProperties();\n\t\t\tsuper.draw();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function handlePendingScroll():void\n\t\t{\n\t\t\tif(this.pendingLocation !== null)\n\t\t\t{\n\t\t\t\tvar pendingData:Object = null;\n\t\t\t\tif(this._dataProvider !== null)\n\t\t\t\t{\n\t\t\t\t\tpendingData = this._dataProvider.getItemAtLocation(this.pendingLocation);\n\t\t\t\t}\n\t\t\t\tif(pendingData is Object)\n\t\t\t\t{\n\t\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\t\tvar result:Point = this.dataViewPort.getScrollPositionForLocation(this.pendingLocation, point);\n\t\t\t\t\tthis.pendingLocation = null;\n\t\t\t\t\tif(result === null)\n\t\t\t\t\t{\n\t\t\t\t\t\t//we can't scroll to that location...\n\t\t\t\t\t\t//probably because the branch isn't open!\n\t\t\t\t\t\tPool.putPoint(point);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar targetHorizontalScrollPosition:Number = point.x;\n\t\t\t\t\t\tvar targetVerticalScrollPosition:Number = point.y;\n\t\t\t\t\t\tPool.putPoint(point);\n\t\t\t\t\t\tif(targetHorizontalScrollPosition < this._minHorizontalScrollPosition)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttargetHorizontalScrollPosition = this._minHorizontalScrollPosition;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(targetHorizontalScrollPosition > this._maxHorizontalScrollPosition)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttargetHorizontalScrollPosition = this._maxHorizontalScrollPosition;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(targetVerticalScrollPosition < this._minVerticalScrollPosition)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttargetVerticalScrollPosition = this._minVerticalScrollPosition;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(targetVerticalScrollPosition > this._maxVerticalScrollPosition)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttargetVerticalScrollPosition = this._maxVerticalScrollPosition;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.throwTo(targetHorizontalScrollPosition, targetVerticalScrollPosition, this.pendingScrollDuration);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tsuper.handlePendingScroll();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshDataViewPortProperties():void\n\t\t{\n\t\t\tthis.dataViewPort.isSelectable = this._isSelectable;\n\t\t\tthis.dataViewPort.selectedItem = this._selectedItem;\n\t\t\tthis.dataViewPort.dataProvider = this._dataProvider;\n\t\t\tthis.dataViewPort.typicalItem = this._typicalItem;\n\t\t\tthis.dataViewPort.openBranches = this._openBranches;\n\n\t\t\tthis.dataViewPort.itemRendererType = this._itemRendererType;\n\t\t\tthis.dataViewPort.itemRendererFactory = this._itemRendererFactory;\n\t\t\tthis.dataViewPort.itemRendererFactories = this._itemRendererFactories;\n\t\t\tthis.dataViewPort.factoryIDFunction = this._factoryIDFunction;\n\t\t\tthis.dataViewPort.customItemRendererStyleName = this._customItemRendererStyleName;\n\n\t\t\tthis.dataViewPort.layout = this._layout;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function validateSelectedItemIsInCollection():void\n\t\t{\n\t\t\tif(this._selectedItem === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar selectedItemLocation:Vector.<int> = this._dataProvider.getItemLocation(this._selectedItem, this._helperLocation);\n\t\t\tif(selectedItemLocation === null || selectedItemLocation.length == 0)\n\t\t\t{\n\t\t\t\tthis.selectedItem = null;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataViewPort_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.selectedItem = this.dataViewPort.selectedItem;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_resetHandler(event:Event):void\n\t\t{\n\t\t\tthis.horizontalScrollPosition = 0;\n\t\t\tthis.verticalScrollPosition = 0;\n\n\t\t\t//the entire data provider was replaced. select no item.\n\t\t\tthis.selectedItem = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_removeAllHandler(event:Event):void\n\t\t{\n\t\t\tthis.selectedItem = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_removeItemHandler(event:Event, indices:Array):void\n\t\t{\n\t\t\tthis.validateSelectedItemIsInCollection();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_filterChangeHandler(event:Event):void\n\t\t{\n\t\t\tthis.validateSelectedItemIsInCollection();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dataProvider_replaceItemHandler(event:Event, indices:Array):void\n\t\t{\n\t\t\tthis.validateSelectedItemIsInCollection();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate function layout_scrollHandler(event:Event, scrollOffset:Point):void\n\t\t{\n\t\t\tvar layout:IVariableVirtualLayout = IVariableVirtualLayout(this._layout);\n\t\t\tif(!this.isScrolling || !layout.useVirtualLayout || !layout.hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar scrollOffsetX:Number = scrollOffset.x;\n\t\t\tthis._startHorizontalScrollPosition += scrollOffsetX;\n\t\t\tthis._horizontalScrollPosition += scrollOffsetX;\n\t\t\tif(this._horizontalAutoScrollTween)\n\t\t\t{\n\t\t\t\tthis._targetHorizontalScrollPosition += scrollOffsetX;\n\t\t\t\tthis.throwTo(this._targetHorizontalScrollPosition, NaN, this._horizontalAutoScrollTween.totalTime - this._horizontalAutoScrollTween.currentTime);\n\t\t\t}\n\n\t\t\tvar scrollOffsetY:Number = scrollOffset.y;\n\t\t\tthis._startVerticalScrollPosition += scrollOffsetY;\n\t\t\tthis._verticalScrollPosition += scrollOffsetY;\n\t\t\tif(this._verticalAutoScrollTween)\n\t\t\t{\n\t\t\t\tthis._targetVerticalScrollPosition += scrollOffsetY;\n\t\t\t\tthis.throwTo(NaN, this._targetVerticalScrollPosition, this._verticalAutoScrollTween.totalTime - this._verticalAutoScrollTween.currentTime);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function nativeStage_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(!this._isSelectable)\n\t\t\t{\n\t\t\t\t//not selectable, but should scroll\n\t\t\t\tsuper.nativeStage_keyDownHandler(event);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(event.isDefaultPrevented())\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!this._dataProvider)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._selectedItem !== null &&\n\t\t\t\t(event.keyCode == Keyboard.SPACE ||\n\t\t\t\t((event.keyLocation == 4 || DeviceCapabilities.simulateDPad) && event.keyCode == Keyboard.ENTER)))\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(Event.TRIGGERED, false, this.selectedItem);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/controls/WebView.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls\n{\n\timport feathers.core.FeathersControl;\n\timport feathers.events.FeathersEventType;\n\timport feathers.utils.geom.matrixToScaleX;\n\timport feathers.utils.geom.matrixToScaleY;\n\n\timport flash.errors.IllegalOperationError;\n\timport flash.events.ErrorEvent;\n\timport flash.geom.Matrix;\n\timport flash.geom.Point;\n\timport flash.geom.Rectangle;\n\timport flash.utils.getDefinitionByName;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.rendering.Painter;\n\timport starling.utils.MatrixUtil;\n\timport starling.utils.Pool;\n\n\t/**\n\t * Dispatched when a URL has finished loading with <code>loadURL()</code> or a\n\t * string has finished loading with <code>loadString()</code>.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.COMPLETE\n\t *\n\t * @see #loadURL()\n\t * @see #loadString()\n\t */\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Indicates that the <code>location</code> property has changed.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #location\n\t *\n\t * @eventType feathers.events.FeathersEventType.LOCATION_CHANGE\n\t */\n\t[Event(name=\"locationChange\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Indicates that the <code>location</code> property is about to change.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The <code>flash.events.LocationChangeEvent</code>\n\t *   dispatched by the <code>StageWebView</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #location\n\t *\n\t * @eventType feathers.events.FeathersEventType.LOCATION_CHANGING\n\t */\n\t[Event(name=\"locationChanging\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Indicates that an error occurred in the <code>StageWebView</code>.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The <code>flash.events.ErrorEvent</code>\n\t *   dispatched by the <code>StageWebView</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.ERROR\n\t */\n\t[Event(name=\"error\",type=\"starling.events.Event\")]\n\n\t/**\n\t * A Feathers component that displays a web browser in Adobe AIR, using the\n\t * <code>flash.media.StageWebView</code> class.\n\t *\n\t * <p>Warning: This component is only compatible with Adobe AIR. It cannot\n\t * be used with Adobe Flash Player in a web browser.</p>\n\t *\n\t * @see ../../../help/web-view.html How to use the Feathers WebView component\n\t *\n\t * @productversion Feathers 2.1.0\n\t */\n\tpublic class WebView extends FeathersControl\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const STAGE_WEB_VIEW_NOT_SUPPORTED_ERROR:String = \"Feathers WebView is only supported in Adobe AIR. It cannot be used in Adobe Flash Player.\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const USE_NATIVE_ERROR:String = \"The useNative property may only be set before the WebView component validates for the first time.\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const DEFAULT_SIZE:Number = 320;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const DEFAULT_MIN_SIZE:Number = 50;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const STAGE_WEB_VIEW_FULLY_QUALIFIED_CLASS_NAME:String = \"flash.media.StageWebView\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static var STAGE_WEB_VIEW_CLASS:Class;\n\n\t\t/**\n\t\t * Indicates if this component is supported on the current platform.\n\t\t */\n\t\tpublic static function get isSupported():Boolean\n\t\t{\n\t\t\tif(!STAGE_WEB_VIEW_CLASS)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tSTAGE_WEB_VIEW_CLASS = Class(getDefinitionByName(STAGE_WEB_VIEW_FULLY_QUALIFIED_CLASS_NAME));\n\t\t\t\t}\n\t\t\t\tcatch(error:Error)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn STAGE_WEB_VIEW_CLASS.isSupported;\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function WebView()\n\t\t{\n\t\t\tthis.addEventListener(Event.ADDED_TO_STAGE, webView_addedToStageHandler);\n\t\t\tthis.addEventListener(Event.REMOVED_FROM_STAGE, webView_removedFromStageHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var stageWebView:Object;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _useNative:Boolean = false;\n\n\t\t/**\n\t\t * Determines if the system native web browser control is used or if\n\t\t * Adobe AIR's embedded version of the WebKit engine is used.\n\t\t *\n\t\t * <p>Note: Although it is not prohibited, with some content, failures can occur when the same process uses both the embedded and the system WebKit, so it is recommended that all StageWebViews in a given application be constructed with the same value for useNative. In addition, as HTMLLoader depends on the embedded WebKit, applications using HTMLLoader should only construct StageWebViews with useNative set to false.</p>\n\t\t */\n\t\tpublic function get useNative():Boolean\n\t\t{\n\t\t\treturn this._useNative;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set useNative(value:Boolean):void\n\t\t{\n\t\t\tif(this.isCreated)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(USE_NATIVE_ERROR);\n\t\t\t}\n\t\t\tthis._useNative = value;\n\t\t}\n\n\t\t/**\n\t\t * The URL of the currently loaded page.\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/StageWebView.html#location Full description of flash.media.StageWebView.location in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get location():String\n\t\t{\n\t\t\tif(this.stageWebView)\n\t\t\t{\n\t\t\t\treturn this.stageWebView.location;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * The title of the currently loaded page.\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/StageWebView.html#title Full description of flash.media.StageWebView.title in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get title():String\n\t\t{\n\t\t\tif(this.stageWebView)\n\t\t\t{\n\t\t\t\treturn this.stageWebView.title;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * Indicates if the web view can navigate back in its history.\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/StageWebView.html#isHistoryBackEnabled Full description of flash.media.StageWebView.isHistoryBackEnabled in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get isHistoryBackEnabled():Boolean\n\t\t{\n\t\t\tif(this.stageWebView)\n\t\t\t{\n\t\t\t\treturn this.stageWebView.isHistoryBackEnabled;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * Indicates if the web view can navigate forward in its history.\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/StageWebView.html#isHistoryForwardEnabled Full description of flash.media.StageWebView.isHistoryForwardEnabled in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get isHistoryForwardEnabled():Boolean\n\t\t{\n\t\t\tif(this.stageWebView)\n\t\t\t{\n\t\t\t\treturn this.stageWebView.isHistoryForwardEnabled;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this.stageWebView)\n\t\t\t{\n\t\t\t\tthis.stageWebView.stage = null;\n\t\t\t\tthis.stageWebView.dispose();\n\t\t\t\tthis.stageWebView = null;\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function render(painter:Painter):void\n\t\t{\n\t\t\tthis.refreshViewPort();\n\t\t\tsuper.render(painter);\n\t\t}\n\n\t\t/**\n\t\t * Loads the specified URL.\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/StageWebView.html#loadURL() Full description of flash.media.StageWebView.loadURL() in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function loadURL(url:String):void\n\t\t{\n\t\t\tthis.validate();\n\t\t\tthis.stageWebView.loadURL(url);\n\t\t}\n\n\t\t/**\n\t\t * Renders the specified HTML or XHTML string.\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/StageWebView.html#loadString() Full description of flash.media.StageWebView.loadString() in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function loadString(text:String, mimeType:String = \"text/html\"):void\n\t\t{\n\t\t\tthis.validate();\n\t\t\tthis.stageWebView.loadString(text, mimeType);\n\t\t}\n\n\t\t/**\n\t\t * Stops the current page from loading.\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/StageWebView.html#stop() Full description of flash.media.StageWebView.stop() in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function stop():void\n\t\t{\n\t\t\tthis.validate();\n\t\t\tthis.stageWebView.stop();\n\t\t}\n\n\t\t/**\n\t\t * Reloads the currently loaded page.\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/StageWebView.html#reload() Full description of flash.media.StageWebView.reload() in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function reload():void\n\t\t{\n\t\t\tthis.validate();\n\t\t\tthis.stageWebView.reload();\n\t\t}\n\n\t\t/**\n\t\t * Navigates to the previous page in the browsing history.\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/StageWebView.html#historyBack() Full description of flash.media.StageWebView.historyBack() in Adobe's Flash Platform API Reference\n\t\t * @see #isHistoryBackEnabled\n\t\t */\n\t\tpublic function historyBack():void\n\t\t{\n\t\t\tthis.validate();\n\t\t\tthis.stageWebView.historyBack();\n\t\t}\n\n\t\t/**\n\t\t * Navigates to the next page in the browsing history.\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/StageWebView.html#historyForward() Full description of flash.media.StageWebView.historyForward() in Adobe's Flash Platform API Reference\n\t\t * @see #isHistoryForwardEnabled\n\t\t */\n\t\tpublic function historyForward():void\n\t\t{\n\t\t\tthis.validate();\n\t\t\tthis.stageWebView.historyForward();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tthis.createStageWebView();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\tsizeInvalid = this.autoSizeIfNeeded() || sizeInvalid;\n\t\t\tif(sizeInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshViewPort();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * If the component's dimensions have not been set explicitly, it will\n\t\t * measure its content and determine an ideal size for itself. If the\n\t\t * <code>explicitWidth</code> or <code>explicitHeight</code> member\n\t\t * variables are set, those value will be used without additional\n\t\t * measurement. If one is set, but not the other, the dimension with the\n\t\t * explicit value will not be measured, but the other non-explicit\n\t\t * dimension will still need measurement.\n\t\t *\n\t\t * <p>Calls <code>saveMeasurements()</code> to set up the\n\t\t * <code>actualWidth</code> and <code>actualHeight</code> member\n\t\t * variables used for layout.</p>\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t */\n\t\tprotected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tnewWidth = DEFAULT_SIZE;\n\t\t\t}\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tnewHeight = DEFAULT_SIZE;\n\t\t\t}\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tnewMinWidth = DEFAULT_MIN_SIZE;\n\t\t\t}\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tnewMinHeight = DEFAULT_MIN_SIZE;\n\t\t\t}\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * Creates the <code>StageWebView</code> instance.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t */\n\t\tprotected function createStageWebView():void\n\t\t{\n\t\t\tif(isSupported)\n\t\t\t{\n\t\t\t\tthis.stageWebView = new STAGE_WEB_VIEW_CLASS(this._useNative);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(STAGE_WEB_VIEW_NOT_SUPPORTED_ERROR);\n\t\t\t}\n\t\t\tthis.stageWebView.addEventListener(ErrorEvent.ERROR, stageWebView_errorHandler);\n\t\t\t//we're using the string here because this class is AIR-only\n\t\t\tthis.stageWebView.addEventListener(\"locationChange\", stageWebView_locationChangeHandler);\n\t\t\tthis.stageWebView.addEventListener(\"locationChanging\", stageWebView_locationChangingHandler);\n\t\t\tthis.stageWebView.addEventListener(flash.events.Event.COMPLETE, stageWebView_completeHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshViewPort():void\n\t\t{\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar starlingViewPort:Rectangle = starling.viewPort;\n\t\t\tvar stageWebViewViewPort:Rectangle = this.stageWebView.viewPort;\n\t\t\tif(!stageWebViewViewPort)\n\t\t\t{\n\t\t\t\tstageWebViewViewPort = new Rectangle();\n\t\t\t}\n\n\t\t\tvar point:Point = Pool.getPoint();\n\t\t\tvar matrix:Matrix = Pool.getMatrix();\n\t\t\tthis.getTransformationMatrix(this.stage, matrix);\n\t\t\tvar globalScaleX:Number = matrixToScaleX(matrix);\n\t\t\tvar globalScaleY:Number = matrixToScaleY(matrix);\n\t\t\tMatrixUtil.transformCoords(matrix, 0, 0, point);\n\t\t\tvar nativeScaleFactor:Number = 1;\n\t\t\tif(starling.supportHighResolutions)\n\t\t\t{\n\t\t\t\tnativeScaleFactor = starling.nativeStage.contentsScaleFactor;\n\t\t\t}\n\t\t\tvar scaleFactor:Number = starling.contentScaleFactor / nativeScaleFactor;\n\t\t\tstageWebViewViewPort.x = Math.round(starlingViewPort.x + point.x * scaleFactor);\n\t\t\tstageWebViewViewPort.y = Math.round(starlingViewPort.y + point.y * scaleFactor);\n\t\t\tvar viewPortWidth:Number = Math.round(this.actualWidth * scaleFactor * globalScaleX);\n\t\t\tif(viewPortWidth < 1 ||\n\t\t\t\tviewPortWidth !== viewPortWidth) //isNaN\n\t\t\t{\n\t\t\t\tviewPortWidth = 1;\n\t\t\t}\n\t\t\tvar viewPortHeight:Number = Math.round(this.actualHeight * scaleFactor * globalScaleY);\n\t\t\tif(viewPortHeight < 1 ||\n\t\t\t\tviewPortHeight !== viewPortHeight) //isNaN\n\t\t\t{\n\t\t\t\tviewPortHeight = 1;\n\t\t\t}\n\t\t\tstageWebViewViewPort.width = viewPortWidth;\n\t\t\tstageWebViewViewPort.height = viewPortHeight;\n\t\t\tthis.stageWebView.viewPort = stageWebViewViewPort;\n\t\t\tPool.putPoint(point);\n\t\t\tPool.putMatrix(matrix);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function webView_addedToStageHandler(event:Event):void\n\t\t{\n\t\t\tthis.stageWebView.stage = this.stage.starling.nativeStage;\n\t\t\tthis.addEventListener(Event.ENTER_FRAME, webView_enterFrameHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function webView_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tif(this.stageWebView)\n\t\t\t{\n\t\t\t\tthis.stageWebView.stage = null;\n\t\t\t}\n\t\t\tthis.removeEventListener(Event.ENTER_FRAME, webView_enterFrameHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function webView_enterFrameHandler(event:Event):void\n\t\t{\n\t\t\tvar target:DisplayObject = this;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tif(!target.visible)\n\t\t\t\t{\n\t\t\t\t\tthis.stageWebView.stage = null;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttarget = target.parent;\n\t\t\t}\n\t\t\twhile(target);\n\t\t\tthis.stageWebView.stage = this.stage.starling.nativeStage;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stageWebView_errorHandler(event:ErrorEvent):void\n\t\t{\n\t\t\tthis.dispatchEventWith(FeathersEventType.ERROR, false, event);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stageWebView_locationChangeHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(FeathersEventType.LOCATION_CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stageWebView_locationChangingHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(FeathersEventType.LOCATION_CHANGING, false, event);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stageWebView_completeHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/popups/BottomDrawerPopUpContentManager.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.popups\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Header;\n\timport feathers.controls.Panel;\n\timport feathers.core.PopUpManager;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.utils.display.getDisplayObjectDepthFromStage;\n\timport feathers.utils.geom.matrixToScaleX;\n\timport feathers.utils.geom.matrixToScaleY;\n\n\timport flash.errors.IllegalOperationError;\n\timport flash.events.KeyboardEvent;\n\timport flash.geom.Matrix;\n\timport flash.geom.Point;\n\timport flash.ui.Keyboard;\n\n\timport starling.animation.Transitions;\n\timport starling.animation.Tween;\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.display.Stage;\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\timport starling.events.ResizeEvent;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.utils.Pool;\n\n\t/**\n\t * Dispatched when the pop-up content opens.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.OPEN\n\t */\n\t[Event(name=\"open\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the pop-up content closes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CLOSE\n\t */\n\t[Event(name=\"close\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Displays pop-up content as a mobile-style drawer that opens from the\n\t * bottom of the stage.\n\t *\n\t * @productversion Feathers 2.3.0\n\t */\n\tpublic class BottomDrawerPopUpContentManager extends EventDispatcher implements IPersistentPopUpContentManager, IPopUpContentManagerWithPrompt\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultPanelFactory():Panel\n\t\t{\n\t\t\treturn new Panel();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultCloseButtonFactory():Button\n\t\t{\n\t\t\treturn new Button();\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function BottomDrawerPopUpContentManager()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var panel:Panel;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var content:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var isClosing:Boolean = false;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get isOpen():Boolean\n\t\t{\n\t\t\treturn this.content !== null;\n\t\t}\n\n\t\t/**\n\t\t * Creates the <code>Panel</code> that wraps the content.\n\t\t *\n\t\t * <p>In the following example, a custom panel factory is provided:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * manager.panelFactory = function():Panel\n\t\t * {\n\t\t *     var panel:Panel = new Panel();\n\t\t *     panel.backgroundSkin = new Image( texture );\n\t\t *     return panel;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.Panel\n\t\t */\n\t\tpublic var panelFactory:Function = null;\n\n\t\t/**\n\t\t * Adds a style name to the <code>Panel</code> that wraps the content.\n\t\t *\n\t\t * <p>In the following example, a custom style name is provided:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * manager.customPanelStyleName = \"my-custom-pop-up-panel\";</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.Panel\n\t\t */\n\t\tpublic var customPanelStyleName:String = null;\n\n\t\t/**\n\t\t * Creates the <code>Button</code> that closes the pop-up.\n\t\t *\n\t\t * <p>In the following example, a custom close button factory is provided:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * manager.closeButtonFactory = function():Button\n\t\t * {\n\t\t *     var closeButton:Button = new Button();\n\t\t *     closeButton.defaultSkin = new Image( texture );\n\t\t *     return closeButton;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.Button\n\t\t */\n\t\tpublic var closeButtonFactory:Function = null;\n\n\t\t/**\n\t\t * Adds a style name to the close button.\n\t\t *\n\t\t * <p>In the following example, a custom style name is provided:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * manager.customCloseButtonStyleName = \"my-custom-close-button\";</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.Button\n\t\t */\n\t\tpublic var customCloseButtonStyleName:String = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _prompt:String;\n\n\t\t/**\n\t\t * A prompt to display in the panel's title.\n\t\t *\n\t\t * <p>Note: If using this manager with a component that has its own\n\t\t * prompt (like <code>PickerList</code>), this value may be overridden\n\t\t * by the component.</p>\n\t\t *\n\t\t * <p>In the following example, a custom title is provided:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * manager.prompt = \"Pick a value\";</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get prompt():String\n\t\t{\n\t\t\treturn this._prompt;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set prompt(value:String):void\n\t\t{\n\t\t\tthis._prompt = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _closeButtonLabel:String = \"Done\";\n\n\t\t/**\n\t\t * The text to display in the label of the close button.\n\t\t *\n\t\t * <p>In the following example, a custom close button label is provided:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * manager.closeButtonLabel = \"Save\";</listing>\n\t\t *\n\t\t * @default \"Done\"\n\t\t */\n\t\tpublic function get closeButtonLabel():String\n\t\t{\n\t\t\treturn this._closeButtonLabel;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set closeButtonLabel(value:String):void\n\t\t{\n\t\t\tthis._closeButtonLabel = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _openOrCloseDuration:Number = 0.5;\n\n\t\t/**\n\t\t * The duration, in seconds, of the animation to open or close the\n\t\t * pop-up.\n\t\t *\n\t\t * <p>In the following example, the duration is changed to 2 seconds:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * manager.openOrCloseDuration = 2.0;</listing>\n\t\t *\n\t\t * @default 0.5\n\t\t */\n\t\tpublic function get openOrCloseDuration():Number\n\t\t{\n\t\t\treturn this._openOrCloseDuration;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set openOrCloseDuration(value:Number):void\n\t\t{\n\t\t\tthis._openOrCloseDuration = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _openOrCloseEase:Object = Transitions.EASE_OUT;\n\n\t\t/**\n\t\t * The easing function used for opening or closing the pop-up.\n\t\t *\n\t\t * <p>In the following example, the animation ease is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * manager.openOrCloseEase = Transitions.EASE_IN_OUT;</listing>\n\t\t *\n\t\t * @default starling.animation.Transitions.EASE_OUT\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/animation/Transitions.html starling.animation.Transitions\n\t\t * @see #openOrCloseDuration\n\t\t */\n\t\tpublic function get openOrCloseEase():Object\n\t\t{\n\t\t\treturn this._openOrCloseEase;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set openOrCloseEase(value:Object):void\n\t\t{\n\t\t\tthis._openOrCloseEase = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _overlayFactory:Function = null;\n\n\t\t/**\n\t\t * This function may be used to customize the modal overlay displayed by\n\t\t * the pop-up manager. If the value of <code>overlayFactory</code> is\n\t\t * <code>null</code>, the pop-up manager's default overlay factory will\n\t\t * be used instead.\n\t\t *\n\t\t * <p>This function is expected to have the following signature:</p>\n\t\t * <pre>function():DisplayObject</pre>\n\t\t *\n\t\t * <p>In the following example, the overlay is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * manager.overlayFactory = function():DisplayObject\n\t\t * {\n\t\t *     var quad:Quad = new Quad(1, 1, 0xff00ff);\n\t\t *     quad.alpha = 0;\n\t\t *     return quad;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.PopUpManager#overlayFactory\n\t\t */\n\t\tpublic function get overlayFactory():Function\n\t\t{\n\t\t\treturn this._overlayFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set overlayFactory(value:Function):void\n\t\t{\n\t\t\tthis._overlayFactory = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var touchPointID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var openTween:Tween;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var closeTween:Tween;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function open(content:DisplayObject, source:DisplayObject):void\n\t\t{\n\t\t\tif(this.isOpen)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Pop-up content is already open. Close the previous content before opening new content.\");\n\t\t\t}\n\n\t\t\tthis.content = content;\n\n\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\tlayout.horizontalAlign = HorizontalAlign.JUSTIFY;\n\n\t\t\tvar panelFactory:Function = (this.panelFactory !== null) ? this.panelFactory : defaultPanelFactory;\n\t\t\tthis.panel = Panel(panelFactory());\n\t\t\tif(this.customPanelStyleName)\n\t\t\t{\n\t\t\t\tthis.panel.styleNameList.add(this.customPanelStyleName);\n\t\t\t}\n\t\t\tthis.panel.title = this._prompt;\n\t\t\tthis.panel.layout = layout;\n\t\t\tthis.panel.headerFactory = headerFactory;\n\t\t\tthis.panel.touchable = false;\n\t\t\tthis.panel.addChild(content);\n\n\t\t\t//make sure the content is scaled the same as the source\n\t\t\tvar matrix:Matrix = Pool.getMatrix();\n\t\t\tsource.getTransformationMatrix(PopUpManager.root, matrix);\n\t\t\tpanel.scaleX = matrixToScaleX(matrix);\n\t\t\tpanel.scaleY = matrixToScaleY(matrix);\n\t\t\tPool.putMatrix(matrix);\n\n\t\t\tPopUpManager.addPopUp(this.panel, true, false, this._overlayFactory);\n\t\t\tthis.layout();\n\n\t\t\tthis.panel.addEventListener(Event.REMOVED_FROM_STAGE, panel_removedFromStageHandler);\n\n\t\t\tvar stage:Stage = Starling.current.stage;\n\t\t\tstage.addEventListener(TouchEvent.TOUCH, stage_touchHandler);\n\t\t\tstage.addEventListener(ResizeEvent.RESIZE, stage_resizeHandler);\n\n\t\t\t//using priority here is a hack so that objects higher up in the\n\t\t\t//display list have a chance to cancel the event first.\n\t\t\tvar priority:int = -getDisplayObjectDepthFromStage(this.panel);\n\t\t\tStarling.current.nativeStage.addEventListener(KeyboardEvent.KEY_DOWN, nativeStage_keyDownHandler, false, priority, true);\n\n\t\t\tthis.panel.y = this.panel.stage.stageHeight;\n\t\t\tthis.openTween = new Tween(this.panel, this.openOrCloseDuration, this.openOrCloseEase);\n\t\t\tthis.openTween.moveTo(0, this.panel.stage.stageHeight - this.panel.height);\n\t\t\tthis.openTween.onComplete = openTween_onComplete;\n\t\t\tStarling.juggler.add(this.openTween);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function close():void\n\t\t{\n\t\t\tif(!this.isOpen || this.isClosing)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this.openTween)\n\t\t\t{\n\t\t\t\tStarling.juggler.remove(this.openTween);\n\t\t\t\tthis.openTween = null;\n\t\t\t}\n\t\t\tif(this.content.stage)\n\t\t\t{\n\t\t\t\tthis.isClosing = true;\n\t\t\t\tthis.panel.touchable = false;\n\t\t\t\tthis.closeTween = new Tween(this.panel, this.openOrCloseDuration, this.openOrCloseEase);\n\t\t\t\tthis.closeTween.moveTo(0, this.panel.stage.stageHeight);\n\t\t\t\tthis.closeTween.onComplete = closeTween_onComplete;\n\t\t\t\tStarling.juggler.add(this.closeTween);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.cleanup();\n\t\t\t\tthis.dispatchEventWith(Event.CLOSE);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function dispose():void\n\t\t{\n\t\t\tthis.close();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function headerFactory():Header\n\t\t{\n\t\t\tvar header:Header = new Header();\n\t\t\tvar closeButtonFactory:Function = (this.closeButtonFactory !== null) ? this.closeButtonFactory : defaultCloseButtonFactory;\n\t\t\tvar closeButton:Button = Button(closeButtonFactory());\n\t\t\tif(this.customCloseButtonStyleName !== null)\n\t\t\t{\n\t\t\t\tcloseButton.styleNameList.add(this.customCloseButtonStyleName);\n\t\t\t}\n\t\t\tcloseButton.label = this.closeButtonLabel;\n\t\t\tcloseButton.addEventListener(Event.TRIGGERED, closeButton_triggeredHandler);\n\t\t\theader.rightItems = new <DisplayObject>[closeButton];\n\t\t\treturn header;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layout():void\n\t\t{\n\t\t\tthis.panel.width = this.panel.stage.stageWidth;\n\t\t\tthis.panel.x = 0;\n\t\t\tthis.panel.maxHeight = this.panel.stage.stageHeight;\n\t\t\tthis.panel.validate();\n\t\t\tthis.panel.y = this.panel.stage.stageHeight - this.panel.height;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function cleanup():void\n\t\t{\n\t\t\tvar stage:Stage = Starling.current.stage;\n\t\t\tstage.removeEventListener(TouchEvent.TOUCH, stage_touchHandler);\n\t\t\tstage.removeEventListener(ResizeEvent.RESIZE, stage_resizeHandler);\n\t\t\tStarling.current.nativeStage.removeEventListener(KeyboardEvent.KEY_DOWN, nativeStage_keyDownHandler);\n\n\t\t\tif(this.panel)\n\t\t\t{\n\t\t\t\tthis.panel.removeEventListener(Event.REMOVED_FROM_STAGE, panel_removedFromStageHandler);\n\t\t\t\tif(this.panel.contains(this.content))\n\t\t\t\t{\n\t\t\t\t\tthis.panel.removeChild(this.content, false);\n\t\t\t\t}\n\t\t\t\tthis.panel.removeFromParent(true);\n\t\t\t\tthis.panel = null;\n\t\t\t}\n\t\t\tthis.content = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function openTween_onComplete():void\n\t\t{\n\t\t\tthis.openTween = null;\n\t\t\tthis.panel.touchable = true;\n\t\t\tthis.dispatchEventWith(Event.OPEN);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function closeTween_onComplete():void\n\t\t{\n\t\t\tthis.isClosing = false;\n\t\t\tthis.closeTween = null;\n\t\t\tthis.cleanup();\n\t\t\tthis.dispatchEventWith(Event.CLOSE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function closeButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.close();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function panel_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tthis.close();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function nativeStage_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(event.isDefaultPrevented())\n\t\t\t{\n\t\t\t\t//someone else already handled this one\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(event.keyCode != Keyboard.BACK && event.keyCode != Keyboard.ESCAPE)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//don't let the OS handle the event\n\t\t\tevent.preventDefault();\n\n\t\t\tthis.close();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_resizeHandler(event:ResizeEvent):void\n\t\t{\n\t\t\tif(this.closeTween)\n\t\t\t{\n\t\t\t\tthis.closeTween.advanceTime(this.closeTween.totalTime);\n\t\t\t\t//the onComplete callback will remove the panel, so no layout is\n\t\t\t\t//required.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this.openTween)\n\t\t\t{\n\t\t\t\t//just stop the animation and go to the final layout\n\t\t\t\tStarling.juggler.remove(this.openTween);\n\t\t\t\tthis.openTween = null;\n\t\t\t}\n\t\t\tthis.layout();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!PopUpManager.isTopLevelPopUp(this.panel))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar stage:Stage = Starling.current.stage;\n\t\t\tif(this.touchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(stage, TouchPhase.ENDED, this.touchPointID);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\ttouch.getLocation(stage, point);\n\t\t\t\tvar hitTestResult:DisplayObject = stage.hitTest(point);\n\t\t\t\tPool.putPoint(point);\n\t\t\t\tif(!this.panel.contains(hitTestResult))\n\t\t\t\t{\n\t\t\t\t\tthis.touchPointID = -1;\n\t\t\t\t\tthis.close();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(stage, TouchPhase.BEGAN);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tpoint = Pool.getPoint();\n\t\t\t\ttouch.getLocation(stage, point);\n\t\t\t\thitTestResult = stage.hitTest(point);\n\t\t\t\tPool.putPoint(point);\n\t\t\t\tif(this.panel.contains(hitTestResult))\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.touchPointID = touch.id;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/popups/CalloutPopUpContentManager.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.popups\n{\n\timport feathers.controls.Callout;\n\timport feathers.core.PopUpManager;\n\timport feathers.utils.geom.matrixToScaleX;\n\timport feathers.utils.geom.matrixToScaleY;\n\n\timport flash.errors.IllegalOperationError;\n\timport flash.geom.Matrix;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\timport starling.utils.Pool;\n\n\t/**\n\t * Dispatched when the pop-up content opens.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.OPEN\n\t */\n\t[Event(name=\"open\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the pop-up content closes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CLOSE\n\t */\n\t[Event(name=\"close\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Displays pop-up content (such as the List in a PickerList) in a Callout.\n\t *\n\t * @see feathers.controls.PickerList\n\t * @see feathers.controls.Callout\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class CalloutPopUpContentManager extends EventDispatcher implements IPopUpContentManager\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function CalloutPopUpContentManager()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * The factory used to create the <code>Callout</code> instance. If\n\t\t * <code>null</code>, <code>Callout.calloutFactory()</code> will be used.\n\t\t *\n\t\t * <p>Note: If you change this value while a callout is open, the new\n\t\t * value will not go into effect until the callout is closed and a new\n\t\t * callout is opened.</p>\n\t\t *\n\t\t * @see feathers.controls.Callout#calloutFactory\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic var calloutFactory:Function;\n\n\t\t/**\n\t\t * The position of the callout, relative to its origin. Accepts a\n\t\t * <code>Vector.&lt;String&gt;</code> containing one or more of the\n\t\t * constants from <code>feathers.layout.RelativePosition</code> or\n\t\t * <code>null</code>. If <code>null</code>, the callout will attempt to\n\t\t * position itself using values in the following order:\n\t\t *\n\t\t * <ul>\n\t\t *     <li><code>RelativePosition.BOTTOM</code></li>\n\t\t *     <li><code>RelativePosition.TOP</code></li>\n\t\t *     <li><code>RelativePosition.RIGHT</code></li>\n\t\t *     <li><code>RelativePosition.LEFT</code></li>\n\t\t * </ul>\n\t\t *\n\t\t * <p>Note: If you change this value while a callout is open, the new\n\t\t * value will not go into effect until the callout is closed and a new\n\t\t * callout is opened.</p>\n\t\t *\n\t\t * <p>In the following example, the callout's supported positions are\n\t\t * restricted to the top and bottom of the origin:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * manager.supportedPositions = new &lt;String&gt;[RelativePosition.TOP, RelativePosition.BOTTOM];</listing>\n\t\t *\n\t\t * <p>In the following example, the callout's position is restricted to\n\t\t * the right of the origin:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * manager.supportedPositions = new &lt;String&gt;[RelativePosition.RIGHT];</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.layout.RelativePosition#TOP\n\t\t * @see feathers.layout.RelativePosition#RIGHT\n\t\t * @see feathers.layout.RelativePosition#BOTTOM\n\t\t * @see feathers.layout.RelativePosition#LEFT\n\t\t */\n\t\tpublic var supportedPositions:Vector.<String> = Callout.DEFAULT_POSITIONS;\n\n\t\t/**\n\t\t * Determines if the callout will be modal or not.\n\t\t *\n\t\t * <p>Note: If you change this value while a callout is open, the new\n\t\t * value will not go into effect until the callout is closed and a new\n\t\t * callout is opened.</p>\n\t\t *\n\t\t * <p>In the following example, the callout is not modal:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * manager.isModal = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic var isModal:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _overlayFactory:Function = null;\n\n\t\t/**\n\t\t * If <code>isModal</code> is <code>true</code>, this function may be\n\t\t * used to customize the modal overlay displayed by the pop-up manager.\n\t\t * If the value of <code>overlayFactory</code> is <code>null</code>, the\n\t\t * pop-up manager's default overlay factory will be used instead.\n\t\t *\n\t\t * <p>This function is expected to have the following signature:</p>\n\t\t * <pre>function():DisplayObject</pre>\n\t\t *\n\t\t * <p>In the following example, the overlay is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * manager.isModal = true;\n\t\t * manager.overlayFactory = function():DisplayObject\n\t\t * {\n\t\t *     var quad:Quad = new Quad(1, 1, 0xff00ff);\n\t\t *     quad.alpha = 0;\n\t\t *     return quad;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.PopUpManager#overlayFactory\n\t\t */\n\t\tpublic function get overlayFactory():Function\n\t\t{\n\t\t\treturn this._overlayFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set overlayFactory(value:Function):void\n\t\t{\n\t\t\tthis._overlayFactory = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var content:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var callout:Callout;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get isOpen():Boolean\n\t\t{\n\t\t\treturn this.content !== null;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function open(content:DisplayObject, source:DisplayObject):void\n\t\t{\n\t\t\tif(this.isOpen)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Pop-up content is already open. Close the previous content before opening new content.\");\n\t\t\t}\n\n\t\t\tvar scaledCalloutFactory:Function = this.calloutFactory;\n\t\t\t//make sure the content is scaled the same as the source\n\t\t\tvar matrix:Matrix = Pool.getMatrix();\n\t\t\tsource.getTransformationMatrix(PopUpManager.root, matrix);\n\t\t\tvar contentScaleX:Number = matrixToScaleX(matrix);\n\t\t\tvar contentScaleY:Number = matrixToScaleY(matrix);\n\t\t\tPool.putMatrix(matrix);\n\t\t\tif(contentScaleX != 1 || contentScaleY != 1)\n\t\t\t{\n\t\t\t\tvar originalCalloutFactory:Function = this.calloutFactory;\n\t\t\t\tif(originalCalloutFactory === null)\n\t\t\t\t{\n\t\t\t\t\toriginalCalloutFactory = Callout.calloutFactory;\n\t\t\t\t}\n\t\t\t\tscaledCalloutFactory = function():Callout\n\t\t\t\t{\n\t\t\t\t\tvar callout:Callout = originalCalloutFactory();\n\t\t\t\t\tcallout.scaleX = contentScaleX;\n\t\t\t\t\tcallout.scaleY = contentScaleY;\n\t\t\t\t\treturn callout;\n\t\t\t\t};\n\n\t\t\t}\n\n\t\t\tthis.content = content;\n\t\t\tthis.callout = Callout.show(content, source, this.supportedPositions, this.isModal, scaledCalloutFactory, this._overlayFactory);\n\t\t\tthis.callout.addEventListener(Event.REMOVED_FROM_STAGE, callout_removedFromStageHandler);\n\t\t\tthis.dispatchEventWith(Event.OPEN);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function close():void\n\t\t{\n\t\t\tif(!this.isOpen)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.callout.close();\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function dispose():void\n\t\t{\n\t\t\tthis.close();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function cleanup():void\n\t\t{\n\t\t\tthis.content = null;\n\t\t\tthis.callout.content = null;\n\t\t\tthis.callout.removeEventListener(Event.REMOVED_FROM_STAGE, callout_removedFromStageHandler);\n\t\t\tthis.callout = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function callout_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tthis.cleanup();\n\t\t\tthis.dispatchEventWith(Event.CLOSE);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/popups/DropDownPopUpContentManager.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.popups\n{\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IValidating;\n\timport feathers.core.PopUpManager;\n\timport feathers.core.ValidationQueue;\n\timport feathers.display.RenderDelegate;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.RelativePosition;\n\timport feathers.utils.display.getDisplayObjectDepthFromStage;\n\timport feathers.utils.geom.matrixToScaleX;\n\timport feathers.utils.geom.matrixToScaleY;\n\n\timport flash.errors.IllegalOperationError;\n\timport flash.events.KeyboardEvent;\n\timport flash.geom.Matrix;\n\timport flash.geom.Point;\n\timport flash.geom.Rectangle;\n\timport flash.ui.Keyboard;\n\n\timport starling.animation.Transitions;\n\timport starling.animation.Tween;\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.display.DisplayObjectContainer;\n\timport starling.display.Quad;\n\timport starling.display.Stage;\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\timport starling.events.ResizeEvent;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.utils.Pool;\n\n\t/**\n\t * Dispatched when the pop-up content opens.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.OPEN\n\t */\n\t[Event(name=\"open\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the pop-up content closes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CLOSE\n\t */\n\t[Event(name=\"close\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Displays pop-up content as a desktop-style drop-down.\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class DropDownPopUpContentManager extends EventDispatcher implements IPopUpContentManager\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function DropDownPopUpContentManager()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var content:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var source:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _delegate:RenderDelegate;\n\n\t\t/**\n\t\t * @private\n\t\t * Stores the same value as the content property, but the content\n\t\t * property may be set to null before the animation ends.\n\t\t */\n\t\tprotected var _openCloseTweenTarget:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _openCloseTween:Tween;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get isOpen():Boolean\n\t\t{\n\t\t\treturn this.content !== null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isModal:Boolean = false;\n\n\t\t/**\n\t\t * Determines if the pop-up will be modal or not.\n\t\t *\n\t\t * <p>Note: If you change this value while a pop-up is displayed, the\n\t\t * new value will not go into effect until the pop-up is removed and a\n\t\t * new pop-up is added.</p>\n\t\t *\n\t\t * <p>In the following example, the pop-up is modal:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * manager.isModal = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic function get isModal():Boolean\n\t\t{\n\t\t\treturn this._isModal;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isModal(value:Boolean):void\n\t\t{\n\t\t\tthis._isModal = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _overlayFactory:Function;\n\n\t\t/**\n\t\t * If <code>isModal</code> is <code>true</code>, this function may be\n\t\t * used to customize the modal overlay displayed by the pop-up manager.\n\t\t * If the value of <code>overlayFactory</code> is <code>null</code>, the\n\t\t * pop-up manager's default overlay factory will be used instead.\n\t\t *\n\t\t * <p>This function is expected to have the following signature:</p>\n\t\t * <pre>function():DisplayObject</pre>\n\t\t *\n\t\t * <p>In the following example, the overlay is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * manager.isModal = true;\n\t\t * manager.overlayFactory = function():DisplayObject\n\t\t * {\n\t\t *     var quad:Quad = new Quad(1, 1, 0xff00ff);\n\t\t *     quad.alpha = 0;\n\t\t *     return quad;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.PopUpManager#overlayFactory\n\t\t */\n\t\tpublic function get overlayFactory():Function\n\t\t{\n\t\t\treturn this._overlayFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set overlayFactory(value:Function):void\n\t\t{\n\t\t\tthis._overlayFactory = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _gap:Number = 0;\n\n\t\t/**\n\t\t * The space, in pixels, between the source and the pop-up.\n\t\t */\n\t\tpublic function get gap():Number\n\t\t{\n\t\t\treturn this._gap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set gap(value:Number):void\n\t\t{\n\t\t\tthis._gap = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _openCloseDuration:Number = 0.2;\n\n\t\t/**\n\t\t * The duration, in seconds, of the open and close animation.\n\t\t */\n\t\tpublic function get openCloseDuration():Number\n\t\t{\n\t\t\treturn this._openCloseDuration;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set openCloseDuration(value:Number):void\n\t\t{\n\t\t\tthis._openCloseDuration = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _openCloseEase:Object = Transitions.EASE_OUT;\n\n\t\t/**\n\t\t * The easing function to use for the open and close animation.\n\t\t */\n\t\tpublic function get openCloseEase():Object\n\t\t{\n\t\t\treturn this._openCloseEase;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set openCloseEase(value:Object):void\n\t\t{\n\t\t\tthis._openCloseEase = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _actualDirection:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _primaryDirection:String = RelativePosition.BOTTOM;\n\n\t\t/**\n\t\t * The preferred position of the pop-up, relative to the source. If\n\t\t * there is not enough space to position pop-up at the preferred\n\t\t * position, it may be positioned elsewhere.\n\t\t *\n\t\t * @default feathers.layout.RelativePosition.BOTTOM\n\t\t *\n\t\t * @see feathers.layout.RelativePosition#BOTTOM\n\t\t * @see feathers.layout.RelativePosition#TOP\n\t\t */\n\t\tpublic function get primaryDirection():String\n\t\t{\n\t\t\treturn this._primaryDirection;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set primaryDirection(value:String):void\n\t\t{\n\t\t\tif(value === \"up\")\n\t\t\t{\n\t\t\t\tvalue = RelativePosition.TOP;\n\t\t\t}\n\t\t\telse if(value === \"down\")\n\t\t\t{\n\t\t\t\tvalue = RelativePosition.BOTTOM;\n\t\t\t}\n\t\t\tthis._primaryDirection = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fitContentMinWidthToOrigin:Boolean = true;\n\n\t\t/**\n\t\t * If enabled, the pop-up content's <code>minWidth</code> property will\n\t\t * be set to the <code>width</code> property of the origin, if it is\n\t\t * smaller.\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic function get fitContentMinWidthToOrigin():Boolean\n\t\t{\n\t\t\treturn this._fitContentMinWidthToOrigin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set fitContentMinWidthToOrigin(value:Boolean):void\n\t\t{\n\t\t\tthis._fitContentMinWidthToOrigin = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastOriginX:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastOriginY:Number;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function open(content:DisplayObject, source:DisplayObject):void\n\t\t{\n\t\t\tif(this.isOpen)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Pop-up content is already open. Close the previous content before opening new content.\");\n\t\t\t}\n\n\t\t\t//make sure the content is scaled the same as the source\n\t\t\tvar matrix:Matrix = Pool.getMatrix();\n\t\t\tsource.getTransformationMatrix(PopUpManager.root, matrix);\n\t\t\tcontent.scaleX = matrixToScaleX(matrix);\n\t\t\tcontent.scaleY = matrixToScaleY(matrix);\n\t\t\tPool.putMatrix(matrix);\n\n\t\t\tthis.content = content;\n\t\t\tthis.source = source;\n\t\t\tPopUpManager.addPopUp(content, this._isModal, false, this._overlayFactory);\n\t\t\tif(content is IFeathersControl)\n\t\t\t{\n\t\t\t\tcontent.addEventListener(FeathersEventType.RESIZE, content_resizeHandler);\n\t\t\t}\n\t\t\tcontent.addEventListener(Event.REMOVED_FROM_STAGE, content_removedFromStageHandler);\n\t\t\tthis.layout();\n\t\t\tif(this._openCloseTween !== null)\n\t\t\t{\n\t\t\t\tthis._openCloseTween.advanceTime(this._openCloseTween.totalTime);\n\t\t\t}\n\t\t\tif(this._openCloseDuration > 0)\n\t\t\t{\n\t\t\t\tthis._delegate = new RenderDelegate(content);\n\t\t\t\tthis._delegate.scaleX = content.scaleX;\n\t\t\t\tthis._delegate.scaleY = content.scaleY;\n\t\t\t\t//temporarily hide the content while the delegate is displayed\n\t\t\t\tcontent.visible = false;\n\t\t\t\tPopUpManager.addPopUp(this._delegate, false, false);\n\t\t\t\tthis._delegate.x = content.x;\n\t\t\t\tif(this._actualDirection === RelativePosition.TOP)\n\t\t\t\t{\n\t\t\t\t\tthis._delegate.y = content.y + content.height;\n\t\t\t\t}\n\t\t\t\telse //bottom\n\t\t\t\t{\n\t\t\t\t\tthis._delegate.y = content.y - content.height;\n\t\t\t\t}\n\t\t\t\tvar mask:Quad = new Quad(1, 1, 0xff00ff);\n\t\t\t\tmask.width = content.width / content.scaleX;\n\t\t\t\tmask.height = 0;\n\t\t\t\tthis._delegate.mask = mask;\n\t\t\t\tmask.height = 0;\n\t\t\t\tthis._openCloseTween = new Tween(this._delegate, this._openCloseDuration, this._openCloseEase);\n\t\t\t\tthis._openCloseTweenTarget = content;\n\t\t\t\tthis._openCloseTween.animate(\"y\", content.y);\n\t\t\t\tthis._openCloseTween.onUpdate = openCloseTween_onUpdate;\n\t\t\t\tthis._openCloseTween.onComplete = openTween_onComplete;\n\t\t\t\tStarling.juggler.add(this._openCloseTween);\n\t\t\t}\n\t\t\tvar stage:Stage = this.source.stage;\n\t\t\tstage.addEventListener(TouchEvent.TOUCH, stage_touchHandler);\n\t\t\tstage.addEventListener(ResizeEvent.RESIZE, stage_resizeHandler);\n\t\t\tstage.addEventListener(Event.ENTER_FRAME, stage_enterFrameHandler);\n\n\t\t\t//using priority here is a hack so that objects higher up in the\n\t\t\t//display list have a chance to cancel the event first.\n\t\t\tvar priority:int = -getDisplayObjectDepthFromStage(this.content);\n\t\t\tStarling.current.nativeStage.addEventListener(KeyboardEvent.KEY_DOWN, nativeStage_keyDownHandler, false, priority, true);\n\t\t\tthis.dispatchEventWith(Event.OPEN);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function close():void\n\t\t{\n\t\t\tif(!this.isOpen)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._openCloseTween !== null)\n\t\t\t{\n\t\t\t\tthis._openCloseTween.advanceTime(this._openCloseTween.totalTime);\n\t\t\t}\n\t\t\tvar content:DisplayObject = this.content;\n\t\t\tthis.source = null;\n\t\t\tthis.content = null;\n\t\t\tvar stage:Stage = content.stage;\n\t\t\tstage.removeEventListener(TouchEvent.TOUCH, stage_touchHandler);\n\t\t\tstage.removeEventListener(ResizeEvent.RESIZE, stage_resizeHandler);\n\t\t\tstage.removeEventListener(Event.ENTER_FRAME, stage_enterFrameHandler);\n\t\t\tstage.starling.nativeStage.removeEventListener(KeyboardEvent.KEY_DOWN, nativeStage_keyDownHandler);\n\t\t\tif(content is IFeathersControl)\n\t\t\t{\n\t\t\t\tcontent.removeEventListener(FeathersEventType.RESIZE, content_resizeHandler);\n\t\t\t}\n\t\t\tcontent.removeEventListener(Event.REMOVED_FROM_STAGE, content_removedFromStageHandler);\n\t\t\tif(content.parent)\n\t\t\t{\n\t\t\t\tcontent.removeFromParent(false);\n\t\t\t}\n\t\t\tif(this._openCloseDuration > 0)\n\t\t\t{\n\t\t\t\tthis._delegate = new RenderDelegate(content);\n\t\t\t\tthis._delegate.scaleX = content.scaleX;\n\t\t\t\tthis._delegate.scaleY = content.scaleY;\n\t\t\t\tPopUpManager.addPopUp(this._delegate, false, false);\n\t\t\t\tthis._delegate.x = content.x;\n\t\t\t\tthis._delegate.y = content.y;\n\t\t\t\tvar mask:Quad = new Quad(1, 1, 0xff00ff);\n\t\t\t\tmask.width = content.width / content.scaleX;\n\t\t\t\tmask.height = content.height / content.scaleY;\n\t\t\t\tthis._delegate.mask = mask;\n\t\t\t\tthis._openCloseTween = new Tween(this._delegate, this._openCloseDuration, this._openCloseEase);\n\t\t\t\tthis._openCloseTweenTarget = content;\n\t\t\t\tif(this._actualDirection === RelativePosition.TOP)\n\t\t\t\t{\n\t\t\t\t\tthis._openCloseTween.animate(\"y\", content.y + content.height);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._openCloseTween.animate(\"y\", content.y - content.height);\n\t\t\t\t}\n\t\t\t\tthis._openCloseTween.onUpdate = openCloseTween_onUpdate;\n\t\t\t\tthis._openCloseTween.onComplete = closeTween_onComplete;\n\t\t\t\tStarling.juggler.add(this._openCloseTween);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(Event.CLOSE);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function dispose():void\n\t\t{\n\t\t\tthis.openCloseDuration = 0;\n\t\t\tthis.close();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layout():void\n\t\t{\n\t\t\tif(this.source is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.source).validate();\n\t\t\t\tif(!this.isOpen)\n\t\t\t\t{\n\t\t\t\t\t//it's possible that the source will close its pop-up during\n\t\t\t\t\t//validation, so we should check for that.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar originBoundsInParent:Rectangle = this.source.getBounds(PopUpManager.root);\n\t\t\tvar sourceWidth:Number = originBoundsInParent.width;\n\t\t\tvar hasSetBounds:Boolean = false;\n\t\t\tvar uiContent:IFeathersControl = this.content as IFeathersControl;\n\t\t\tif(this._fitContentMinWidthToOrigin && uiContent && uiContent.minWidth < sourceWidth)\n\t\t\t{\n\t\t\t\tuiContent.minWidth = sourceWidth;\n\t\t\t\thasSetBounds = true;\n\t\t\t}\n\t\t\tif(this.content is IValidating)\n\t\t\t{\n\t\t\t\tuiContent.validate();\n\t\t\t}\n\t\t\tif(!hasSetBounds && this._fitContentMinWidthToOrigin && this.content.width < sourceWidth)\n\t\t\t{\n\t\t\t\tthis.content.width = sourceWidth;\n\t\t\t}\n\n\t\t\tvar stage:Stage = this.source.stage;\n\n\t\t\t//we need to be sure that the source is properly positioned before\n\t\t\t//positioning the content relative to it.\n\t\t\tvar validationQueue:ValidationQueue = ValidationQueue.forStarling(stage.starling);\n\t\t\tif(validationQueue && !validationQueue.isValidating)\n\t\t\t{\n\t\t\t\t//force a COMPLETE validation of everything\n\t\t\t\t//but only if we're not already doing that...\n\t\t\t\tvalidationQueue.advanceTime(0);\n\t\t\t}\n\n\t\t\toriginBoundsInParent = this.source.getBounds(PopUpManager.root);\n\t\t\tthis._lastOriginX = originBoundsInParent.x;\n\t\t\tthis._lastOriginY = originBoundsInParent.y;\n\n\t\t\tvar stageDimensionsInParent:Point = new Point(stage.stageWidth, stage.stageHeight);\n\t\t\tPopUpManager.root.globalToLocal(stageDimensionsInParent, stageDimensionsInParent);\n\n\t\t\tvar downSpace:Number = (stageDimensionsInParent.y - this.content.height) - (originBoundsInParent.y + originBoundsInParent.height + this._gap);\n\t\t\t//skip this if the primary direction is up\n\t\t\tif(this._primaryDirection == RelativePosition.BOTTOM && downSpace >= 0)\n\t\t\t{\n\t\t\t\tlayoutBelow(originBoundsInParent, stageDimensionsInParent);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar upSpace:Number = originBoundsInParent.y - this._gap - this.content.height;\n\t\t\tif(upSpace >= 0)\n\t\t\t{\n\t\t\t\tlayoutAbove(originBoundsInParent, stageDimensionsInParent);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//do what we skipped earlier if the primary direction is up\n\t\t\tif(this._primaryDirection == RelativePosition.TOP && downSpace >= 0)\n\t\t\t{\n\t\t\t\tlayoutBelow(originBoundsInParent, stageDimensionsInParent);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//worst case: pick the side that has the most available space\n\t\t\tif(upSpace >= downSpace)\n\t\t\t{\n\t\t\t\tlayoutAbove(originBoundsInParent, stageDimensionsInParent);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlayoutBelow(originBoundsInParent, stageDimensionsInParent);\n\t\t\t}\n\n\t\t\t//the content is too big for the space, so we need to adjust it to\n\t\t\t//fit properly\n\t\t\tvar newMaxHeight:Number = stageDimensionsInParent.y - (originBoundsInParent.y + originBoundsInParent.height);\n\t\t\tif(uiContent)\n\t\t\t{\n\t\t\t\tif(uiContent.maxHeight > newMaxHeight)\n\t\t\t\t{\n\t\t\t\t\tuiContent.maxHeight = newMaxHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(this.content.height > newMaxHeight)\n\t\t\t{\n\t\t\t\tthis.content.height = newMaxHeight;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutAbove(originBoundsInParent:Rectangle, stageDimensionsInParent:Point):void\n\t\t{\n\t\t\tthis._actualDirection = RelativePosition.TOP;\n\t\t\tthis.content.x = this.calculateXPosition(originBoundsInParent, stageDimensionsInParent);\n\t\t\tthis.content.y = originBoundsInParent.y - this.content.height - this._gap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutBelow(originBoundsInParent:Rectangle, stageDimensionsInParent:Point):void\n\t\t{\n\t\t\tthis._actualDirection = RelativePosition.BOTTOM;\n\t\t\tthis.content.x = this.calculateXPosition(originBoundsInParent, stageDimensionsInParent);\n\t\t\tthis.content.y = originBoundsInParent.y + originBoundsInParent.height + this._gap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function calculateXPosition(originBoundsInParent:Rectangle, stageDimensionsInParent:Point):Number\n\t\t{\n\t\t\tvar idealXPosition:Number = originBoundsInParent.x;\n\t\t\tvar fallbackXPosition:Number = idealXPosition + originBoundsInParent.width - this.content.width;\n\t\t\tvar maxXPosition:Number = stageDimensionsInParent.x - this.content.width;\n\t\t\tvar xPosition:Number = idealXPosition;\n\t\t\tif(xPosition > maxXPosition)\n\t\t\t{\n\t\t\t\tif(fallbackXPosition >= 0)\n\t\t\t\t{\n\t\t\t\t\txPosition = fallbackXPosition;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\txPosition = maxXPosition;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(xPosition < 0)\n\t\t\t{\n\t\t\t\txPosition = 0;\n\t\t\t}\n\t\t\treturn xPosition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function openCloseTween_onUpdate():void\n\t\t{\n\t\t\tvar mask:DisplayObject = this._delegate.mask;\n\t\t\tif(this._actualDirection === RelativePosition.TOP)\n\t\t\t{\n\t\t\t\tmask.height = (this._openCloseTweenTarget.height - (this._delegate.y - this._openCloseTweenTarget.y)) / this._openCloseTweenTarget.scaleY;\n\t\t\t\tmask.y = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmask.height = (this._openCloseTweenTarget.height - (this._openCloseTweenTarget.y - this._delegate.y)) / this._openCloseTweenTarget.scaleY;\n\t\t\t\tmask.y = (this._openCloseTweenTarget.height / this._openCloseTweenTarget.scaleY) - mask.height;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function openCloseTween_onComplete():void\n\t\t{\n\t\t\tthis._openCloseTween = null;\n\t\t\tthis._delegate.removeFromParent(true);\n\t\t\tthis._delegate = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function openTween_onComplete():void\n\t\t{\n\t\t\tthis.openCloseTween_onComplete();\n\t\t\tthis.content.visible = true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function closeTween_onComplete():void\n\t\t{\n\t\t\tthis.openCloseTween_onComplete();\n\t\t\tthis.dispatchEventWith(Event.CLOSE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function content_resizeHandler(event:Event):void\n\t\t{\n\t\t\tthis.layout();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_enterFrameHandler(event:Event):void\n\t\t{\n\t\t\tvar rect:Rectangle = Pool.getRectangle();\n\t\t\tthis.source.getBounds(PopUpManager.root, rect);\n\t\t\tvar rectX:Number = rect.x;\n\t\t\tvar rectY:Number = rect.y;\n\t\t\tPool.putRectangle(rect);\n\t\t\tif(rectY != this._lastOriginX || rectY != this._lastOriginY)\n\t\t\t{\n\t\t\t\tthis.layout();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function content_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tthis.close();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function nativeStage_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(event.isDefaultPrevented())\n\t\t\t{\n\t\t\t\t//someone else already handled this one\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(event.keyCode != Keyboard.BACK && event.keyCode != Keyboard.ESCAPE)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//don't let the OS handle the event\n\t\t\tevent.preventDefault();\n\n\t\t\tthis.close();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_resizeHandler(event:ResizeEvent):void\n\t\t{\n\t\t\tthis.layout();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tvar target:DisplayObject = DisplayObject(event.target);\n\t\t\tif(this.content == target || (this.content is DisplayObjectContainer && DisplayObjectContainer(this.content).contains(target)))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this.source == target || (this.source is DisplayObjectContainer && DisplayObjectContainer(this.source).contains(target)))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!PopUpManager.isTopLevelPopUp(this.content))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//any began touch is okay here. we don't need to check all touches\n\t\t\tvar stage:Stage = Stage(event.currentTarget);\n\t\t\tvar touch:Touch = event.getTouch(stage, TouchPhase.BEGAN);\n\t\t\tif(!touch)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.close();\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/controls/popups/IPersistentPopUpContentManager.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.popups\n{\n\t/**\n\t * An <code>IPopUpContentManager</code> that wraps its content in a custom\n\t * UI that should keep the content open until closed by the user.\n\t *\n\t * <p>For example, a <code>PickerList</code> using this type of manager\n\t * would keep its pop-up open after a list item is selected or triggered.\n\t * The manager will provide its own custom UI to close itself, such as a\n\t * close button.</p>\n\t *\n\t * @productversion Feathers 2.3.0\n\t */\n\tpublic interface IPersistentPopUpContentManager extends IPopUpContentManager\n\t{\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/popups/IPopUpContentManager.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.popups\n{\n\timport feathers.core.IFeathersEventDispatcher;\n\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * Dispatched when the pop-up content opens.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.OPEN\n\t */\n\t[Event(name=\"open\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the pop-up content closes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CLOSE\n\t */\n\t[Event(name=\"close\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Automatically manages pop-up content layout and positioning.\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic interface IPopUpContentManager extends IFeathersEventDispatcher\n\t{\n\t\t/**\n\t\t * Indicates if the pop-up content is open or not.\n\t\t */\n\t\tfunction get isOpen():Boolean;\n\n\t\t/**\n\t\t * Displays the pop-up content.\n\t\t *\n\t\t * @param content\t\tThe content for the pop-up content manager to display.\n\t\t * @param source\t\tThe source of the pop-up. May be used to position and/or size the pop-up. May be completely ignored instead.\n\t\t */\n\t\tfunction open(content:DisplayObject, source:DisplayObject):void;\n\n\t\t/**\n\t\t * Closes the pop-up content. If it is not opened, nothing happens.\n\t\t */\n\t\tfunction close():void;\n\n\t\t/**\n\t\t * Cleans up the manager.\n\t\t */\n\t\tfunction dispose():void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/popups/IPopUpContentManagerWithPrompt.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.popups\n{\n\t/**\n\t * A custom <code>IPopUpContentManager</code> that has a prompt that may\n\t * be customized by the parent component.\n\t *\n\t * @productversion Feathers 2.3.0\n\t */\n\tpublic interface IPopUpContentManagerWithPrompt extends IPopUpContentManager\n\t{\n\t\t/**\n\t\t * Some descriptive text to display with the pop-up.\n\t\t */\n\t\tfunction get prompt():String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set prompt(value:String):void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/popups/VerticalCenteredPopUpContentManager.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.popups\n{\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IValidating;\n\timport feathers.core.PopUpManager;\n\timport feathers.events.FeathersEventType;\n\timport feathers.utils.display.getDisplayObjectDepthFromStage;\n\timport feathers.utils.geom.matrixToScaleX;\n\timport feathers.utils.geom.matrixToScaleY;\n\n\timport flash.errors.IllegalOperationError;\n\timport flash.events.KeyboardEvent;\n\timport flash.geom.Matrix;\n\timport flash.geom.Point;\n\timport flash.ui.Keyboard;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.display.DisplayObjectContainer;\n\timport starling.display.Stage;\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\timport starling.events.ResizeEvent;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.utils.Pool;\n\n\t/**\n\t * Dispatched when the pop-up content opens.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.OPEN\n\t */\n\t[Event(name=\"open\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the pop-up content closes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CLOSE\n\t */\n\t[Event(name=\"close\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Displays a pop-up at the center of the stage, filling the vertical space.\n\t * The content will be sized horizontally so that it is no larger than the\n\t * the width or height of the stage (whichever is smaller).\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class VerticalCenteredPopUpContentManager extends EventDispatcher implements IPopUpContentManager\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function VerticalCenteredPopUpContentManager()\n\t\t{\n\t\t}\n\n\t\t/**\n\t\t * Quickly sets all margin properties to the same value. The\n\t\t * <code>margin</code> getter always returns the value of\n\t\t * <code>marginTop</code>, but the other padding values may be\n\t\t * different.\n\t\t *\n\t\t * <p>The following example gives the pop-up a minimum of 20 pixels of\n\t\t * margin on all sides:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * manager.margin = 20;</listing>\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #marginTop\n\t\t * @see #marginRight\n\t\t * @see #marginBottom\n\t\t * @see #marginLeft\n\t\t */\n\t\tpublic function get margin():Number\n\t\t{\n\t\t\treturn this.marginTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set margin(value:Number):void\n\t\t{\n\t\t\tthis.marginTop = value;\n\t\t\tthis.marginRight = value;\n\t\t\tthis.marginBottom = value;\n\t\t\tthis.marginLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * The minimum space, in pixels, between the top edge of the content and\n\t\t * the top edge of the stage.\n\t\t *\n\t\t * <p>The following example gives the pop-up a minimum of 20 pixels of\n\t\t * margin on the top:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * manager.marginTop = 20;</listing>\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #margin\n\t\t */\n\t\tpublic var marginTop:Number = 0;\n\n\t\t/**\n\t\t * The minimum space, in pixels, between the right edge of the content\n\t\t * and the right edge of the stage.\n\t\t *\n\t\t * <p>The following example gives the pop-up a minimum of 20 pixels of\n\t\t * margin on the right:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * manager.marginRight = 20;</listing>\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #margin\n\t\t */\n\t\tpublic var marginRight:Number = 0;\n\n\t\t/**\n\t\t * The minimum space, in pixels, between the bottom edge of the content\n\t\t * and the bottom edge of the stage.\n\t\t *\n\t\t * <p>The following example gives the pop-up a minimum of 20 pixels of\n\t\t * margin on the bottom:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * manager.marginBottom = 20;</listing>\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #margin\n\t\t */\n\t\tpublic var marginBottom:Number = 0;\n\n\t\t/**\n\t\t * The minimum space, in pixels, between the left edge of the content\n\t\t * and the left edge of the stage.\n\t\t *\n\t\t * <p>The following example gives the pop-up a minimum of 20 pixels of\n\t\t * margin on the left:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * manager.marginLeft = 20;</listing>\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #margin\n\t\t */\n\t\tpublic var marginLeft:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _overlayFactory:Function = null;\n\n\t\t/**\n\t\t * This function may be used to customize the modal overlay displayed by\n\t\t * the pop-up manager. If the value of <code>overlayFactory</code> is\n\t\t * <code>null</code>, the pop-up manager's default overlay factory will\n\t\t * be used instead.\n\t\t *\n\t\t * <p>This function is expected to have the following signature:</p>\n\t\t * <pre>function():DisplayObject</pre>\n\t\t *\n\t\t * <p>In the following example, the overlay is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * manager.overlayFactory = function():DisplayObject\n\t\t * {\n\t\t *     var quad:Quad = new Quad(1, 1, 0xff00ff);\n\t\t *     quad.alpha = 0;\n\t\t *     return quad;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.PopUpManager#overlayFactory\n\t\t */\n\t\tpublic function get overlayFactory():Function\n\t\t{\n\t\t\treturn this._overlayFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set overlayFactory(value:Function):void\n\t\t{\n\t\t\tthis._overlayFactory = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var content:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var touchPointID:int = -1;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get isOpen():Boolean\n\t\t{\n\t\t\treturn this.content !== null;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function open(content:DisplayObject, source:DisplayObject):void\n\t\t{\n\t\t\tif(this.isOpen)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Pop-up content is already open. Close the previous content before opening new content.\");\n\t\t\t}\n\n\t\t\t//make sure the content is scaled the same as the source\n\t\t\tvar matrix:Matrix = Pool.getMatrix();\n\t\t\tsource.getTransformationMatrix(PopUpManager.root, matrix);\n\t\t\tcontent.scaleX = matrixToScaleX(matrix);\n\t\t\tcontent.scaleY = matrixToScaleY(matrix);\n\t\t\tPool.putMatrix(matrix);\n\n\t\t\tthis.content = content;\n\t\t\tPopUpManager.addPopUp(this.content, true, false, this._overlayFactory);\n\t\t\tif(this.content is IFeathersControl)\n\t\t\t{\n\t\t\t\tthis.content.addEventListener(FeathersEventType.RESIZE, content_resizeHandler);\n\t\t\t}\n\t\t\tthis.content.addEventListener(Event.REMOVED_FROM_STAGE, content_removedFromStageHandler);\n\t\t\tthis.layout();\n\t\t\tvar stage:Stage = Starling.current.stage;\n\t\t\tstage.addEventListener(TouchEvent.TOUCH, stage_touchHandler);\n\t\t\tstage.addEventListener(ResizeEvent.RESIZE, stage_resizeHandler);\n\n\t\t\t//using priority here is a hack so that objects higher up in the\n\t\t\t//display list have a chance to cancel the event first.\n\t\t\tvar priority:int = -getDisplayObjectDepthFromStage(this.content);\n\t\t\tStarling.current.nativeStage.addEventListener(KeyboardEvent.KEY_DOWN, nativeStage_keyDownHandler, false, priority, true);\n\t\t\tthis.dispatchEventWith(Event.OPEN);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function close():void\n\t\t{\n\t\t\tif(!this.isOpen)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar content:DisplayObject = this.content;\n\t\t\tthis.content = null;\n\t\t\tvar stage:Stage = Starling.current.stage;\n\t\t\tstage.removeEventListener(TouchEvent.TOUCH, stage_touchHandler);\n\t\t\tstage.removeEventListener(ResizeEvent.RESIZE, stage_resizeHandler);\n\t\t\tStarling.current.nativeStage.removeEventListener(KeyboardEvent.KEY_DOWN, nativeStage_keyDownHandler);\n\t\t\tif(content is IFeathersControl)\n\t\t\t{\n\t\t\t\tcontent.removeEventListener(FeathersEventType.RESIZE, content_resizeHandler);\n\t\t\t}\n\t\t\tcontent.removeEventListener(Event.REMOVED_FROM_STAGE, content_removedFromStageHandler);\n\t\t\tif(content.parent)\n\t\t\t{\n\t\t\t\tcontent.removeFromParent(false);\n\t\t\t}\n\t\t\tthis.dispatchEventWith(Event.CLOSE);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function dispose():void\n\t\t{\n\t\t\tthis.close();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layout():void\n\t\t{\n\t\t\tvar stage:Stage = Starling.current.stage;\n\t\t\tvar point:Point = Pool.getPoint(stage.stageWidth, stage.stageHeight);\n\t\t\tPopUpManager.root.globalToLocal(point, point);\n\t\t\tvar parentWidth:Number = point.x;\n\t\t\tvar parentHeight:Number = point.y;\n\t\t\tPool.putPoint(point);\n\t\t\tvar maxWidth:Number = parentWidth;\n\t\t\tif(maxWidth > parentHeight)\n\t\t\t{\n\t\t\t\tmaxWidth = parentHeight;\n\t\t\t}\n\t\t\tmaxWidth -= (this.marginLeft + this.marginRight);\n\t\t\tvar maxHeight:Number = parentHeight - this.marginTop - this.marginBottom;\n\t\t\tvar hasSetBounds:Boolean = false;\n\t\t\tif(this.content is IFeathersControl)\n\t\t\t{\n\t\t\t\t//if it's a ui control that is able to auto-size, this section\n\t\t\t\t//will ensure that the control stays within the required bounds.\n\t\t\t\tvar uiContent:IFeathersControl = IFeathersControl(this.content);\n\t\t\t\tuiContent.minWidth = maxWidth;\n\t\t\t\tuiContent.maxWidth = maxWidth;\n\t\t\t\tuiContent.maxHeight = maxHeight;\n\t\t\t\thasSetBounds = true;\n\t\t\t}\n\t\t\tif(this.content is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.content).validate();\n\t\t\t}\n\t\t\tif(!hasSetBounds)\n\t\t\t{\n\t\t\t\t//if it's not a ui control, and the control's explicit width and\n\t\t\t\t//height values are greater than our maximum bounds, then we\n\t\t\t\t//will enforce the maximum bounds the hard way.\n\t\t\t\tif(this.content.width > maxWidth)\n\t\t\t\t{\n\t\t\t\t\tthis.content.width = maxWidth;\n\t\t\t\t}\n\t\t\t\tif(this.content.height > maxHeight)\n\t\t\t\t{\n\t\t\t\t\tthis.content.height = maxHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//round to the nearest pixel to avoid unnecessary smoothing\n\t\t\tthis.content.x = Math.round((parentWidth - this.content.width) / 2);\n\t\t\tthis.content.y = Math.round((parentHeight - this.content.height) / 2);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function content_resizeHandler(event:Event):void\n\t\t{\n\t\t\tthis.layout();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function content_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tthis.close();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function nativeStage_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(event.isDefaultPrevented())\n\t\t\t{\n\t\t\t\t//someone else already handled this one\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(event.keyCode != Keyboard.BACK && event.keyCode != Keyboard.ESCAPE)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//don't let the OS handle the event\n\t\t\tevent.preventDefault();\n\n\t\t\tthis.close();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_resizeHandler(event:ResizeEvent):void\n\t\t{\n\t\t\tthis.layout();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!PopUpManager.isTopLevelPopUp(this.content))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar stage:Stage = Starling.current.stage;\n\t\t\tif(this.touchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(stage, TouchPhase.ENDED, this.touchPointID);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\ttouch.getLocation(stage, point);\n\t\t\t\tvar hitTestResult:DisplayObject = stage.hitTest(point);\n\t\t\t\tPool.putPoint(point);\n\t\t\t\tvar isInBounds:Boolean = false;\n\t\t\t\tif(this.content is DisplayObjectContainer)\n\t\t\t\t{\n\t\t\t\t\tisInBounds = DisplayObjectContainer(this.content).contains(hitTestResult);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tisInBounds = this.content == hitTestResult;\n\t\t\t\t}\n\t\t\t\tif(!isInBounds)\n\t\t\t\t{\n\t\t\t\t\tthis.touchPointID = -1;\n\t\t\t\t\tthis.close();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(stage, TouchPhase.BEGAN);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tpoint = Pool.getPoint();\n\t\t\t\ttouch.getLocation(stage, point);\n\t\t\t\thitTestResult = stage.hitTest(point);\n\t\t\t\tPool.putPoint(point);\n\t\t\t\tisInBounds = false;\n\t\t\t\tif(this.content is DisplayObjectContainer)\n\t\t\t\t{\n\t\t\t\t\tisInBounds = DisplayObjectContainer(this.content).contains(hitTestResult);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tisInBounds = this.content == hitTestResult;\n\t\t\t\t}\n\t\t\t\tif(isInBounds)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.touchPointID = touch.id;\n\t\t\t}\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/renderers/BaseDefaultItemRenderer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.renderers\n{\n\timport feathers.controls.ButtonState;\n\timport feathers.controls.ImageLoader;\n\timport feathers.controls.ItemRendererLayoutOrder;\n\timport feathers.controls.Scroller;\n\timport feathers.controls.ToggleButton;\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IFocusContainer;\n\timport feathers.core.IMeasureDisplayObject;\n\timport feathers.core.IStateObserver;\n\timport feathers.core.ITextRenderer;\n\timport feathers.core.IValidating;\n\timport feathers.core.PropertyProxy;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.RelativePosition;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.text.FontStylesSet;\n\timport feathers.utils.skins.resetFluidChildDimensionsForMeasurement;\n\timport feathers.utils.touch.DelayedDownTouchToState;\n\n\timport flash.geom.Point;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.DisplayObjectContainer;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.text.TextFormat;\n\n\t[Exclude(name=\"stateToAccessoryFunction\",kind=\"property\")]\n\n\t/**\n\t * The location of the accessory, relative to one of the other children.\n\t * Use <code>RelativePosition.MANUAL</code> to position the accessory\n\t * from the top-left corner.\n\t *\n\t * <p>In the following example, the accessory is placed on the bottom:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * renderer.accessoryPosition = RelativePosition.BOTTOM;</listing>\n\t *\n\t * @default feathers.layout.RelativePosition.RIGHT\n\t *\n\t * @see feathers.layout.RelativePosition#TOP\n\t * @see feathers.layout.RelativePosition#RIGHT\n\t * @see feathers.layout.RelativePosition#BOTTOM\n\t * @see feathers.layout.RelativePosition#LEFT\n\t * @see feathers.layout.RelativePosition#MANUAL\n\t * @see #style:layoutOrder\n\t * @see #style:iconPosition\n\t */\n\t[Style(name=\"accessoryPosition\",type=\"String\")]\n\n\t/**\n\t * Offsets the x position of the accessory by a certain number of pixels.\n\t *\n\t * <p>In the following example, the accessory x position is adjusted by 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * renderer.accessoryOffsetX = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:accessoryOffsetY\n\t */\n\t[Style(name=\"accessoryOffsetX\",type=\"Number\")]\n\n\t/**\n\t * Offsets the y position of the accessory by a certain number of pixels.\n\t *\n\t * <p>In the following example, the accessory y position is adjusted by 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * renderer.accessoryOffsetY = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:accessoryOffsetX\n\t */\n\t[Style(name=\"accessoryOffsetY\",type=\"Number\")]\n\n\t/**\n\t * The space, in pixels, between the accessory and the other child it is\n\t * positioned relative to. Applies to either horizontal or vertical\n\t * spacing, depending on the value of <code>accessoryPosition</code>. If\n\t * the value is <code>NaN</code>, the value of the <code>gap</code>\n\t * property will be used instead.\n\t *\n\t * <p>If <code>accessoryGap</code> is set to <code>Number.POSITIVE_INFINITY</code>,\n\t * the accessory and the component it is relative to will be positioned\n\t * as far apart as possible.</p>\n\t *\n\t * <p>In the following example, the accessory gap is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * renderer.accessoryGap = 20;</listing>\n\t *\n\t * @default NaN\n\t *\n\t * @see #style:gap\n\t * @see #style:accessoryPosition\n\t */\n\t[Style(name=\"accessoryGap\",type=\"Number\")]\n\n\t/**\n\t * A style name to add to the item renderer's accessory loader\n\t * sub-component. Typically used by a theme to provide different styles\n\t * to different item renderers.\n\t *\n\t * <p>In the following example, a custom accessory loader style name is\n\t * passed to the item renderer:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * itemRenderer.customAccessoryLoaderStyleName = \"my-custom-accessory-loader\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( ImageLoader ).setFunctionForStyleName( \"my-custom-accessory-loader\", setCustomAccessoryLoaderStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_ACCESSORY_LOADER\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #accessoryLoaderFactory\n\t */\n\t[Style(name=\"customAccessoryLoaderStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to the item renderer's accessory label text\n\t * renderer sub-component. Typically used by a theme to provide\n\t * different styles to different item renderers.\n\t *\n\t * <p>In the following example, a custom accessory label style name is\n\t * passed to the item renderer:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * itemRenderer.customAccessoryLabelStyleName = \"my-custom-accessory-label\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( BitmapFontTextRenderer ).setFunctionForStyleName( \"my-custom-accessory-label\", setCustomAccessoryLabelStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_ACCESSORY_LABEL\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #accessoryLabelFactory\n\t */\n\t[Style(name=\"customAccessoryLabelStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to the item renderer's icon loader sub-component.\n\t * Typically used by a theme to provide different styles to different\n\t * item renderers.\n\t *\n\t * <p>In the following example, a custom icon loader style name is passed\n\t * to the item renderer:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * itemRenderer.customIconLodaerStyleName = \"my-custom-icon-loader\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( ImageLoader ).setFunctionForStyleName( \"my-custom-icon-loader\", setCustomIconLoaderStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_ICON_LOADER\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #iconLoaderFactory\n\t */\n\t[Style(name=\"customIconLoaderStyleName\",type=\"String\")]\n\n\t/**\n\t * A style name to add to the item renderer's icon label text renderer\n\t * sub-component. Typically used by a theme to provide  different styles\n\t * to different item renderers.\n\t *\n\t * <p>In the following example, a custom icon label style name is passed\n\t * to the item renderer:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * itemRenderer.customIconLabelStyleName = \"my-custom-icon-label\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( BitmapFontTextRenderer ).setFunctionForStyleName( \"my-custom-icon-label\", setCustomIconLabelStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_ICON_LABEL\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #iconLabelFactory\n\t */\n\t[Style(name=\"customIconLabelStyleName\",type=\"String\")]\n\n\t/**\n\t * The accessory's position will be based on which other child (the\n\t * label or the icon) the accessory should be relative to.\n\t *\n\t * <p>The <code>accessoryPositionOrigin</code> property will be ignored\n\t * if <code>accessoryPosition</code> is set to <code>RelativePosition.MANUAL</code>.</p>\n\t *\n\t * <p>In the following example, the layout order is changed:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * renderer.layoutOrder = ItemRendererLayoutOrder.LABEL_ACCESSORY_ICON;</listing>\n\t *\n\t * @default feathers.controls.ItemRendererLayoutOrder.LABEL_ICON_ACCESSORY\n\t *\n\t * @see feathers.controls.ItemRendererLayoutOrder#LABEL_ICON_ACCESSORY\n\t * @see feathers.controls.ItemRendererLayoutOrder#LABEL_ACCESSORY_ICON\n\t * @see #style:accessoryPosition\n\t * @see #style:iconPosition\n\t */\n\t[Style(name=\"layoutOrder\",type=\"String\")]\n\n\t/**\n\t * If the value of the <code>accessoryGap</code> property is\n\t * <code>Number.POSITIVE_INFINITY</code>, meaning that the gap will\n\t * fill as much space as possible, the final calculated value will not be\n\t * smaller than the value of the <code>minAccessoryGap</code> property.\n\t * If the value of <code>minAccessoryGap</code> is <code>NaN</code>, the\n\t * value of the <code>minGap</code> property will be used instead.\n\t *\n\t * <p>The following example ensures that the gap is never smaller than\n\t * 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.gap = Number.POSITIVE_INFINITY;\n\t * button.minGap = 20;</listing>\n\t *\n\t * <listing version=\"3.0\">\n\t * renderer.accessoryGap = 20;</listing>\n\t *\n\t * @default NaN\n\t *\n\t * @see #style:accessoryGap\n\t */\n\t[Style(name=\"minAccessoryGap\",type=\"Number\")]\n\n\t/**\n\t * The font styles used to display the item renderer's icon label text.\n\t *\n\t * <p>In the following example, the icon label font styles are\n\t * customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * itemRenderer.iconLabelFontStyles = new TextFormat( \"Helvetica\", 20, 0xcc0000 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>iconLabelFactory</code> to set more advanced styles.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:iconLabelDisabledFontStyles\n\t * @see #style:iconLabelSelectedFontStyles\n\t * @see #setIconLabelFontStylesForState()\n\t */\n\t[Style(name=\"iconLabelFontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The font styles used to display the item renderer's icon label text\n\t * when the item renderer is disabled.\n\t *\n\t * <p>In the following example, the icon label disabled font styles are\n\t * customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * itemRenderer.iconLabelDisabledFontStyles = new TextFormat( \"Helvetica\", 20, 0x999999 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>iconLabelFactory</code> to set more advanced styles on the\n\t * text renderer.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:iconLabelFontStyles\n\t * @see #setIconLabelFontStylesForState()\n\t */\n\t[Style(name=\"iconLabelDisabledFontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The font styles used to display the item renderer's icon label text\n\t * when the item renderer is selected.\n\t *\n\t * <p>In the following example, the icon label selected font styles are\n\t * customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * itemRenderer.iconLabelSelectedFontStyles = new TextFormat( \"Helvetica\", 20, 0x999999 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>iconLabelFactory</code> to set more advanced styles on the\n\t * text renderer.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:iconLabelFontStyles\n\t * @see #setIconLabelFontStylesForState()\n\t */\n\t[Style(name=\"iconLabelSelectedFontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The font styles used to display the item renderer's accessory label\n\t * text.\n\t *\n\t * <p>In the following example, the accessory label font styles are\n\t * customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * itemRenderer.accessoryLabelFontStyles = new TextFormat( \"Helvetica\", 20, 0xcc0000 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>accessoryLabelFactory</code> to set more advanced styles.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:accessoryLabelDisabledFontStyles\n\t * @see #style:accessoryLabelSelectedFontStyles\n\t * @see #setAccessoryLabelFontStylesForState()\n\t */\n\t[Style(name=\"accessoryLabelFontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The font styles used to display the item renderer's accessory label\n\t * text when the item renderer is disabled.\n\t *\n\t * <p>In the following example, the accessory label disabled font styles\n\t * are customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * itemRenderer.accessoryLabelDisabledFontStyles = new TextFormat( \"Helvetica\", 20, 0x999999 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>accessoryLabelFactory</code> to set more advanced styles on the\n\t * text renderer.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #accessoryLabelFontStyles\n\t * @see #setAccessoryLabelFontStylesForState()\n\t */\n\t[Style(name=\"accessoryLabelDisabledFontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The font styles used to display the item renderer's accessory label\n\t * text when the item renderer is selected.\n\t *\n\t * <p>In the following example, the accessory label selected font styles\n\t * are customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * itemRenderer.accessoryLabelSelectedFontStyles = new TextFormat( \"Helvetica\", 20, 0x999999 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>accessoryLabelFactory</code> to set more advanced styles on the\n\t * text renderer.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #accessoryLabelFontStyles\n\t * @see #setAccessoryLabelFontStylesForState()\n\t */\n\t[Style(name=\"accessoryLabelSelectedFontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * If true, the down state (and subsequent state changes) will be delayed\n\t * to improve the user experience when scrolling on a touch screen. Without\n\t * the delay, the down state will appear immediately and then disappear once\n\t * touch-based scrolling begins. This might be described as flickering,\n\t * which is typically undesirable.\n\t *\n\t * <p>In the following example, the state delay timer is disabled:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * renderer.useStateDelayTimer = false;</listing>\n\t *\n\t * @default true\n\t */\n\t[Style(name=\"useStateDelayTimer\",type=\"Boolean\")]\n\n\t/**\n\t * An abstract class for item renderer implementations.\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class BaseDefaultItemRenderer extends ToggleButton implements IFocusContainer\n\t{\n\t\t/**\n\t\t * An alternate style name to use with the default item renderer to\n\t\t * allow a theme to give it a \"drill-down\" style. If a theme\n\t\t * does not provide a style for a drill-down item renderer, the theme\n\t\t * will automatically fall back to using the default item renderer\n\t\t * style.\n\t\t *\n\t\t * <p>An alternate style name should always be added to a component's\n\t\t * <code>styleNameList</code> before the component is initialized. If\n\t\t * the style name is added later, it will be ignored.</p>\n\t\t *\n\t\t * <p>In the following example, the drill-down style is applied to\n\t\t * a list's item renderers:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.itemRendererFactory = function():IListItemRenderer\n\t\t * {\n\t\t *     var itemRenderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\t\t *     itemRenderer.styleNameList.add( DefaultListItemRenderer.ALTERNATE_STYLE_NAME_DRILL_DOWN );\n\t\t *     return itemRenderer;\n\t\t * };</listing>\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const ALTERNATE_STYLE_NAME_DRILL_DOWN:String = \"feathers-drill-down-item-renderer\";\n\n\t\t/**\n\t\t * An alternate style name to use with the default item renderer to\n\t\t * allow a theme to give it a \"check\" style. If a theme does not provide\n\t\t * a style for a check item renderer, the theme will automatically fall\n\t\t * back to using the default item renderer style.\n\t\t *\n\t\t * <p>An alternate style name should always be added to a component's\n\t\t * <code>styleNameList</code> before the component is initialized. If\n\t\t * the style name is added later, it will be ignored.</p>\n\t\t *\n\t\t * <p>In the following example, the check item renderer style is applied\n\t\t * to a list's item renderers:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * list.itemRendererFactory = function():IListItemRenderer\n\t\t * {\n\t\t *     var itemRenderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\t\t *     itemRenderer.styleNameList.add( DefaultListItemRenderer.ALTERNATE_STYLE_NAME_CHECK );\n\t\t *     return itemRenderer;\n\t\t * };</listing>\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const ALTERNATE_STYLE_NAME_CHECK:String = \"feathers-check-item-renderer\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the\n\t\t * primary label.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_LABEL:String = \"feathers-item-renderer-label\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the icon\n\t\t * label, if it exists.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_ICON_LABEL:String = \"feathers-item-renderer-icon-label\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the icon\n\t\t * loader, if it exists.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_ICON_LOADER:String = \"feathers-item-renderer-icon-loader\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the\n\t\t * accessory label, if it exists.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_ACCESSORY_LABEL:String = \"feathers-item-renderer-accessory-label\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the\n\t\t * accessory loader, if it exists.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_ACCESSORY_LOADER:String = \"feathers-item-renderer-accessory-loader\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const HELPER_POINT:Point = new Point();\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultLoaderFactory():ImageLoader\n\t\t{\n\t\t\treturn new ImageLoader();\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function BaseDefaultItemRenderer()\n\t\t{\n\t\t\tsuper();\n\t\t\tif(this._iconLabelFontStylesSet === null)\n\t\t\t{\n\t\t\t\tthis._iconLabelFontStylesSet = new FontStylesSet();\n\t\t\t\tthis._iconLabelFontStylesSet.addEventListener(Event.CHANGE, fontStyles_changeHandler);\n\t\t\t}\n\t\t\tif(this._accessoryLabelFontStylesSet === null)\n\t\t\t{\n\t\t\t\tthis._accessoryLabelFontStylesSet = new FontStylesSet();\n\t\t\t\tthis._accessoryLabelFontStylesSet.addEventListener(Event.CHANGE, fontStyles_changeHandler);\n\t\t\t}\n\t\t\tthis._explicitIsEnabled = this._isEnabled;\n\t\t\tthis.labelStyleName = DEFAULT_CHILD_STYLE_NAME_LABEL;\n\t\t\tthis.isFocusEnabled = false;\n\t\t\tthis.isQuickHitAreaEnabled = false;\n\t\t\tthis.addEventListener(Event.REMOVED_FROM_STAGE, itemRenderer_removedFromStageHandler);\n\t\t}\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the icon label\n\t\t * text renderer, if it exists. This variable is <code>protected</code>\n\t\t * so that sub-classes can customize the icon label text renderer style\n\t\t * name in their constructors instead of using the default style name\n\t\t * defined by <code>DEFAULT_CHILD_STYLE_NAME_ICON_LABEL</code>.\n\t\t *\n\t\t * <p>To customize the icon label text renderer style name without\n\t\t * subclassing, see <code>customIconLabelStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customIconLabelStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var iconLabelStyleName:String = DEFAULT_CHILD_STYLE_NAME_ICON_LABEL;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the icon loader,\n\t\t * if it exists. This variable is <code>protected</code>\n\t\t * so that sub-classes can customize the icon loader style name in their\n\t\t * constructors instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_ICON_LOADER</code>.\n\t\t *\n\t\t * <p>To customize the icon loader style name without subclassing, see\n\t\t * <code>customIconLoaderStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customIconLoaderStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var iconLoaderStyleName:String = DEFAULT_CHILD_STYLE_NAME_ICON_LOADER;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the accessory\n\t\t * label text renderer, if it exists. This variable is\n\t\t * <code>protected</code> so that sub-classes can customize the\n\t\t * accessory label text renderer style name in their constructors\n\t\t * instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_ACCESSORY_LABEL</code>.\n\t\t *\n\t\t * <p>To customize the accessory label text renderer style name without\n\t\t * subclassing, see <code>customAccessoryLabelStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customAccessoryLabelStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var accessoryLabelStyleName:String = DEFAULT_CHILD_STYLE_NAME_ACCESSORY_LABEL;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the accessory\n\t\t * loader, if it exists. This variable is <code>protected</code> so that\n\t\t * sub-classes can customize the accessory loader style name in their\n\t\t * constructors instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_ACCESSORY_LOADER</code>.\n\t\t *\n\t\t * <p>To customize the accessory loader style name without subclassing,\n\t\t * see <code>customAccessoryLoaderStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customAccessoryLoaderStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var accessoryLoaderStyleName:String = DEFAULT_CHILD_STYLE_NAME_ACCESSORY_LOADER;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isChildFocusEnabled:Boolean = true;\n\n\t\t/**\n\t\t * @copy feathers.core.IFocusContainer#isChildFocusEnabled\n\t\t *\n\t\t * @default true\n\t\t *\n\t\t * @see #isFocusEnabled\n\t\t */\n\t\tpublic function get isChildFocusEnabled():Boolean\n\t\t{\n\t\t\treturn this._isEnabled && this._isChildFocusEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isChildFocusEnabled(value:Boolean):void\n\t\t{\n\t\t\tthis._isChildFocusEnabled = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var skinLoader:ImageLoader;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var iconLoader:ImageLoader;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var iconLabel:ITextRenderer;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var accessoryLoader:ImageLoader;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var accessoryLabel:ITextRenderer;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var currentAccessory:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _skinIsFromItem:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _iconIsFromItem:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _accessoryIsFromItem:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set defaultIcon(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._defaultIcon === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.replaceIcon(null);\n\t\t\tthis._iconIsFromItem = false;\n\t\t\tsuper.defaultIcon = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set defaultSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._defaultSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.replaceSkin(null);\n\t\t\tthis._skinIsFromItem = false;\n\t\t\tsuper.defaultSkin = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _data:Object;\n\n\t\t/**\n\t\t * The item displayed by this renderer. This property is set by the\n\t\t * list, and should not be set manually.\n\t\t */\n\t\tpublic function get data():Object\n\t\t{\n\t\t\treturn this._data;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set data(value:Object):void\n\t\t{\n\t\t\t//we need to use strict equality here because the data can be\n\t\t\t//non-strictly equal to null\n\t\t\tif(this._data === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._data = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _owner:Scroller;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _factoryID:String;\n\n\t\t/**\n\t\t * @copy feathers.controls.renderers.IListItemRenderer#factoryID\n\t\t */\n\t\tpublic function get factoryID():String\n\t\t{\n\t\t\treturn this._factoryID;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set factoryID(value:String):void\n\t\t{\n\t\t\tthis._factoryID = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _useStateDelayTimer:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get useStateDelayTimer():Boolean\n\t\t{\n\t\t\treturn this._useStateDelayTimer;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set useStateDelayTimer(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._useStateDelayTimer = value;\n\t\t}\n\n\t\t/**\n\t\t * Determines if the item renderer can be selected even if\n\t\t * <code>isToggle</code> is set to <code>false</code>. Subclasses are\n\t\t * expected to change this value, if required.\n\t\t */\n\t\tprotected var isSelectableWithoutToggle:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _itemHasLabel:Boolean = true;\n\n\t\t/**\n\t\t * If true, the label will come from the renderer's item using the\n\t\t * appropriate field or function for the label. If false, the label may\n\t\t * be set externally.\n\t\t *\n\t\t * <p>In the following example, the item doesn't have a label:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.itemHasLabel = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t *\n\t\t * @see #labelField\n\t\t * @see #labelFunction\n\t\t * @see #label\n\t\t */\n\t\tpublic function get itemHasLabel():Boolean\n\t\t{\n\t\t\treturn this._itemHasLabel;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set itemHasLabel(value:Boolean):void\n\t\t{\n\t\t\tif(this._itemHasLabel == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._itemHasLabel = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _itemHasIcon:Boolean = true;\n\n\t\t/**\n\t\t * If true, the icon will come from the renderer's item using the\n\t\t * appropriate field or function for the icon. If false, the icon may\n\t\t * be skinned for each state externally.\n\t\t *\n\t\t * <p>In the following example, the item doesn't have an icon:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.itemHasIcon = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic function get itemHasIcon():Boolean\n\t\t{\n\t\t\treturn this._itemHasIcon;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set itemHasIcon(value:Boolean):void\n\t\t{\n\t\t\tif(this._itemHasIcon == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._itemHasIcon = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _itemHasAccessory:Boolean = true;\n\n\t\t/**\n\t\t * If true, the accessory will come from the renderer's item using the\n\t\t * appropriate field or function for the accessory. If false, the\n\t\t * accessory may be set using other means.\n\t\t *\n\t\t * <p>In the following example, the item doesn't have an accessory:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.itemHasAccessory = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic function get itemHasAccessory():Boolean\n\t\t{\n\t\t\treturn this._itemHasAccessory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set itemHasAccessory(value:Boolean):void\n\t\t{\n\t\t\tif(this._itemHasAccessory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._itemHasAccessory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _itemHasSkin:Boolean = false;\n\n\t\t/**\n\t\t * If true, the skin will come from the renderer's item using the\n\t\t * appropriate field or function for the skin. If false, the skin may\n\t\t * be set for each state externally.\n\t\t *\n\t\t * <p>In the following example, the item has a skin:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.itemHasSkin = true;\n\t\t * renderer.skinField = \"background\";</listing>\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic function get itemHasSkin():Boolean\n\t\t{\n\t\t\treturn this._itemHasSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set itemHasSkin(value:Boolean):void\n\t\t{\n\t\t\tif(this._itemHasSkin == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._itemHasSkin = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _itemHasSelectable:Boolean = false;\n\n\t\t/**\n\t\t * If true, the ability to select the renderer will come from the\n\t\t * renderer's item using the appropriate field or function for\n\t\t * selectable. If false, the renderer will be selectable if its owner\n\t\t * is selectable.\n\t\t *\n\t\t * <p>In the following example, the item doesn't have an accessory:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.itemHasSelectable = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see #selectableField\n\t\t * @see #selectableFunction\n\t\t */\n\t\tpublic function get itemHasSelectable():Boolean\n\t\t{\n\t\t\treturn this._itemHasSelectable;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set itemHasSelectable(value:Boolean):void\n\t\t{\n\t\t\tif(this._itemHasSelectable == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._itemHasSelectable = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _itemHasEnabled:Boolean = false;\n\n\t\t/**\n\t\t * If true, the renderer's enabled state will come from the renderer's\n\t\t * item using the appropriate field or function for enabled. If false,\n\t\t * the renderer will be enabled if its owner is enabled.\n\t\t *\n\t\t * <p>In the following example, the item doesn't have an accessory:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.itemHasEnabled = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see #enabledField\n\t\t * @see #enabledFunction\n\t\t */\n\t\tpublic function get itemHasEnabled():Boolean\n\t\t{\n\t\t\treturn this._itemHasEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set itemHasEnabled(value:Boolean):void\n\t\t{\n\t\t\tif(this._itemHasEnabled == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._itemHasEnabled = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _accessoryPosition:String = RelativePosition.RIGHT;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"top,right,bottom,left,manual\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get accessoryPosition():String\n\t\t{\n\t\t\treturn this._accessoryPosition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set accessoryPosition(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._accessoryPosition === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._accessoryPosition = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _layoutOrder:String = ItemRendererLayoutOrder.LABEL_ICON_ACCESSORY;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"labelIconAccessory,labelAccessoryIcon\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get layoutOrder():String\n\t\t{\n\t\t\treturn this._layoutOrder;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set layoutOrder(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._layoutOrder === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._layoutOrder = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _accessoryOffsetX:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get accessoryOffsetX():Number\n\t\t{\n\t\t\treturn this._accessoryOffsetX;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set accessoryOffsetX(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._accessoryOffsetX == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._accessoryOffsetX = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _accessoryOffsetY:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get accessoryOffsetY():Number\n\t\t{\n\t\t\treturn this._accessoryOffsetY;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set accessoryOffsetY(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._accessoryOffsetY == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._accessoryOffsetY = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _accessoryGap:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get accessoryGap():Number\n\t\t{\n\t\t\treturn this._accessoryGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set accessoryGap(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._accessoryGap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._accessoryGap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minAccessoryGap:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get minAccessoryGap():Number\n\t\t{\n\t\t\treturn this._minAccessoryGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minAccessoryGap(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._minAccessoryGap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._minAccessoryGap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _defaultAccessory:DisplayObject;\n\n\t\t/**\n\t\t * The accessory used when no other accessory is defined for the current\n\t\t * state. Intended to be used when multiple states should share the same\n\t\t * accessory.\n\t\t *\n\t\t * <p>This property will be ignored if a function is passed to the\n\t\t * <code>stateToAccessoryFunction</code> property. This property may be\n\t\t * ignored if the <code>itemHasAccessory</code> property is\n\t\t * <code>true</code>.</p>\n\t\t *\n\t\t * <p>The following example gives the item renderer a default accessory\n\t\t * to use for all states when no specific accessory is available:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * itemRenderer.defaultAccessory = new Image( texture );</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #setAccessoryForState()\n\t\t * @see #itemHasAccessory\n\t\t */\n\t\tpublic function get defaultAccessory():DisplayObject\n\t\t{\n\t\t\treturn this._defaultAccessory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set defaultAccessory(value:DisplayObject):void\n\t\t{\n\t\t\tif(this._defaultAccessory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.replaceAccessory(null);\n\t\t\tthis._accessoryIsFromItem = false;\n\t\t\tthis._defaultAccessory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _stateToAccessory:Object = {};\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var accessoryTouchPointID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _stopScrollingOnAccessoryTouch:Boolean = true;\n\n\t\t/**\n\t\t * If enabled, calls owner.stopScrolling() when TouchEvents are\n\t\t * dispatched by the accessory.\n\t\t *\n\t\t * <p>In the following example, the list won't stop scrolling when the\n\t\t * accessory is touched:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.stopScrollingOnAccessoryTouch = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic function get stopScrollingOnAccessoryTouch():Boolean\n\t\t{\n\t\t\treturn this._stopScrollingOnAccessoryTouch;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set stopScrollingOnAccessoryTouch(value:Boolean):void\n\t\t{\n\t\t\tthis._stopScrollingOnAccessoryTouch = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isSelectableOnAccessoryTouch:Boolean = false;\n\n\t\t/**\n\t\t * If enabled, the item renderer may be selected by touching the\n\t\t * accessory. By default, the accessory will not trigger selection when\n\t\t * using <code>defaultAccessory</code>, <code>accessoryField</code>, or\n\t\t * <code>accessoryFunction</code> and the accessory is a Feathers\n\t\t * component.\n\t\t *\n\t\t * <p>In the following example, the item renderer can be selected when\n\t\t * the accessory is touched:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.isSelectableOnAccessoryTouch = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic function get isSelectableOnAccessoryTouch():Boolean\n\t\t{\n\t\t\treturn this._isSelectableOnAccessoryTouch;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isSelectableOnAccessoryTouch(value:Boolean):void\n\t\t{\n\t\t\tthis._isSelectableOnAccessoryTouch = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _delayTextureCreationOnScroll:Boolean = false;\n\n\t\t/**\n\t\t * If enabled, automatically manages the <code>delayTextureCreation</code>\n\t\t * property on accessory and icon <code>ImageLoader</code> instances\n\t\t * when the owner scrolls. This applies to the loaders created when the\n\t\t * following properties are set: <code>accessorySourceField</code>,\n\t\t * <code>accessorySourceFunction</code>, <code>iconSourceField</code>,\n\t\t * and <code>iconSourceFunction</code>.\n\t\t *\n\t\t * <p>In the following example, any loaded textures won't be uploaded to\n\t\t * the GPU until the owner stops scrolling:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.delayTextureCreationOnScroll = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic function get delayTextureCreationOnScroll():Boolean\n\t\t{\n\t\t\treturn this._delayTextureCreationOnScroll;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set delayTextureCreationOnScroll(value:Boolean):void\n\t\t{\n\t\t\tthis._delayTextureCreationOnScroll = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _labelField:String = \"label\";\n\n\t\t/**\n\t\t * The field in the item that contains the label text to be displayed by\n\t\t * the renderer. If the item does not have this field, and a\n\t\t * <code>labelFunction</code> is not defined, then the renderer will\n\t\t * default to calling <code>toString()</code> on the item. To omit the\n\t\t * label completely, either provide a custom item renderer without a\n\t\t * label or define a <code>labelFunction</code> that returns an empty\n\t\t * string.\n\t\t *\n\t\t * <p>All of the label fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>labelFunction</code></li>\n\t\t *     <li><code>labelField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the label field is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.labelField = \"text\";</listing>\n\t\t *\n\t\t * @default \"label\"\n\t\t *\n\t\t * @see #labelFunction\n\t\t */\n\t\tpublic function get labelField():String\n\t\t{\n\t\t\treturn this._labelField;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set labelField(value:String):void\n\t\t{\n\t\t\tif(this._labelField == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._labelField = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _labelFunction:Function;\n\n\t\t/**\n\t\t * A function used to generate label text for a specific item. If this\n\t\t * function is not null, then the <code>labelField</code> will be\n\t\t * ignored.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function( item:Object ):String</pre>\n\t\t *\n\t\t * <p>If the item renderer is an <code>IListItemRenderer</code>, the\n\t\t * function may optionally have the following signature instead:</p>\n\t\t * <pre>function( item:Object, index:int ):String</pre>\n\t\t *\n\t\t * <p>If the item renderer is an <code>IGroupedListItemRenderer</code>,\n\t\t * the function may optionally have the following signature instead:</p>\n\t\t * <pre>function( item:Object, groupIndex:int, itemIndex:int ):String</pre>\n\t\t *\n\t\t * <p>All of the label fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>labelFunction</code></li>\n\t\t *     <li><code>labelField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the label function is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.labelFunction = function( item:Object ):String\n\t\t * {\n\t\t *    return item.firstName + \" \" + item.lastName;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #labelField\n\t\t */\n\t\tpublic function get labelFunction():Function\n\t\t{\n\t\t\treturn this._labelFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set labelFunction(value:Function):void\n\t\t{\n\t\t\tif(this._labelFunction == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._labelFunction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _iconField:String = \"icon\";\n\n\t\t/**\n\t\t * The field in the item that contains a display object to be displayed\n\t\t * as an icon or other graphic next to the label in the renderer.\n\t\t *\n\t\t * <p>Warning: It is your responsibility to dispose all icons\n\t\t * included in the data provider and accessed with <code>iconField</code>,\n\t\t * or any display objects returned by <code>iconFunction</code>.\n\t\t * These display objects will not be disposed when the list is disposed.\n\t\t * Not disposing an icon may result in a memory leak.</p>\n\t\t *\n\t\t * <p>All of the icon fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>iconSourceFunction</code></li>\n\t\t *     <li><code>iconSourceField</code></li>\n\t\t *     <li><code>iconLabelFunction</code></li>\n\t\t *     <li><code>iconLabelField</code></li>\n\t\t *     <li><code>iconFunction</code></li>\n\t\t *     <li><code>iconField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the icon field is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.iconField = \"photo\";</listing>\n\t\t *\n\t\t * @default \"icon\"\n\t\t *\n\t\t * @see #itemHasIcon\n\t\t * @see #iconFunction\n\t\t * @see #iconSourceField\n\t\t * @see #iconSourceFunction\n\t\t */\n\t\tpublic function get iconField():String\n\t\t{\n\t\t\treturn this._iconField;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set iconField(value:String):void\n\t\t{\n\t\t\tif(this._iconField == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._iconField = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _iconFunction:Function;\n\n\t\t/**\n\t\t * A function used to generate an icon for a specific item.\n\t\t *\n\t\t * <p>Note: As the list scrolls, this function will almost always be\n\t\t * called more than once for each individual item in the list's data\n\t\t * provider. Your function should not simply return a new icon every\n\t\t * time. This will result in the unnecessary creation and destruction of\n\t\t * many icons, which will overwork the garbage collector and hurt\n\t\t * performance. It's better to return a new icon the first time this\n\t\t * function is called for a particular item and then return the same\n\t\t * icon if that item is passed to this function again.</p>\n\t\t *\n\t\t * <p>Warning: It is your responsibility to dispose all icons\n\t\t * included in the data provider and accessed with <code>iconField</code>,\n\t\t * or any display objects returned by <code>iconFunction</code>.\n\t\t * These display objects will not be disposed when the list is disposed.\n\t\t * Not disposing an icon may result in a memory leak.</p>\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function( item:Object ):DisplayObject</pre>\n\t\t *\n\t\t * <p>If the item renderer is an <code>IListItemRenderer</code>, the\n\t\t * function may optionally have the following signature instead:</p>\n\t\t * <pre>function( item:Object, index:int ):DisplayObject</pre>\n\t\t *\n\t\t * <p>If the item renderer is an <code>IGroupedListItemRenderer</code>,\n\t\t * the function may optionally have the following signature instead:</p>\n\t\t * <pre>function( item:Object, groupIndex:int, itemIndex:int ):DisplayObject</pre>\n\t\t *\n\t\t * <p>All of the icon fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>iconSourceFunction</code></li>\n\t\t *     <li><code>iconSourceField</code></li>\n\t\t *     <li><code>iconLabelFunction</code></li>\n\t\t *     <li><code>iconLabelField</code></li>\n\t\t *     <li><code>iconFunction</code></li>\n\t\t *     <li><code>iconField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the icon function is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.iconFunction = function( item:Object ):DisplayObject\n\t\t * {\n\t\t *    if(item in cachedIcons)\n\t\t *    {\n\t\t *        return cachedIcons[item];\n\t\t *    }\n\t\t *    var icon:Image = new Image( textureAtlas.getTexture( item.textureName ) );\n\t\t *    cachedIcons[item] = icon;\n\t\t *    return icon;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #itemHasIcon\n\t\t * @see #iconField\n\t\t * @see #iconSourceField\n\t\t * @see #iconSourceFunction\n\t\t */\n\t\tpublic function get iconFunction():Function\n\t\t{\n\t\t\treturn this._iconFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set iconFunction(value:Function):void\n\t\t{\n\t\t\tif(this._iconFunction == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._iconFunction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _iconSourceField:String = \"iconSource\";\n\n\t\t/**\n\t\t * The field in the item that contains a <code>starling.textures.Texture</code>\n\t\t * or a URL that points to a bitmap to be used as the item renderer's\n\t\t * icon. The renderer will automatically manage and reuse an internal\n\t\t * <code>ImageLoader</code> sub-component and this value will be passed\n\t\t * to the <code>source</code> property. The <code>ImageLoader</code> may\n\t\t * be customized by changing the <code>iconLoaderFactory</code>.\n\t\t *\n\t\t * <p>Using an icon source will result in better performance than\n\t\t * passing in an <code>ImageLoader</code> or <code>Image</code> through\n\t\t * a <code>iconField</code> or <code>iconFunction</code>\n\t\t * because the renderer can avoid costly display list manipulation.</p>\n\t\t *\n\t\t * <p>All of the icon fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>iconSourceFunction</code></li>\n\t\t *     <li><code>iconSourceField</code></li>\n\t\t *     <li><code>iconLabelFunction</code></li>\n\t\t *     <li><code>iconLabelField</code></li>\n\t\t *     <li><code>iconFunction</code></li>\n\t\t *     <li><code>iconField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the icon source field is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.iconSourceField = \"texture\";</listing>\n\t\t *\n\t\t * @default \"iconSource\"\n\t\t *\n\t\t * @see feathers.controls.ImageLoader#source\n\t\t * @see #itemHasIcon\n\t\t * @see #iconLoaderFactory\n\t\t * @see #iconSourceFunction\n\t\t * @see #iconField\n\t\t * @see #iconFunction\n\t\t */\n\t\tpublic function get iconSourceField():String\n\t\t{\n\t\t\treturn this._iconSourceField;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set iconSourceField(value:String):void\n\t\t{\n\t\t\tif(this._iconSourceField == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._iconSourceField = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _iconSourceFunction:Function;\n\n\t\t/**\n\t\t * A function used to generate a <code>starling.textures.Texture</code>\n\t\t * or a URL that points to a bitmap to be used as the item renderer's\n\t\t * icon. The renderer will automatically manage and reuse an internal\n\t\t * <code>ImageLoader</code> sub-component and this value will be passed\n\t\t * to the <code>source</code> property. The <code>ImageLoader</code> may\n\t\t * be customized by changing the <code>iconLoaderFactory</code>.\n\t\t *\n\t\t * <p>Using an icon source will result in better performance than\n\t\t * passing in an <code>ImageLoader</code> or <code>Image</code> through\n\t\t * a <code>iconField</code> or <code>iconFunction</code>\n\t\t * because the renderer can avoid costly display list manipulation.</p>\n\t\t *\n\t\t * <p>Note: As the list scrolls, this function will almost always be\n\t\t * called more than once for each individual item in the list's data\n\t\t * provider. Your function should not simply return a new texture every\n\t\t * time. This will result in the unnecessary creation and destruction of\n\t\t * many textures, which will overwork the garbage collector and hurt\n\t\t * performance. Creating a new texture at all is dangerous, unless you\n\t\t * are absolutely sure to dispose it when necessary because neither the\n\t\t * list nor its item renderer will dispose of the texture for you. If\n\t\t * you are absolutely sure that you are managing the texture memory with\n\t\t * proper disposal, it's better to return a new texture the first\n\t\t * time this function is called for a particular item and then return\n\t\t * the same texture if that item is passed to this function again.</p>\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function( item:Object ):Object</pre>\n\t\t *\n\t\t * <p>If the item renderer is an <code>IListItemRenderer</code>, the\n\t\t * function may optionally have the following signature instead:</p>\n\t\t * <pre>function( item:Object, index:int ):Object</pre>\n\t\t *\n\t\t * <p>If the item renderer is an <code>IGroupedListItemRenderer</code>,\n\t\t * the function may optionally have the following signature instead:</p>\n\t\t * <pre>function( item:Object, groupIndex:int, itemIndex:int ):Object</pre>\n\t\t *\n\t\t * <p>The return value is a valid value for the <code>source</code>\n\t\t * property of an <code>ImageLoader</code> component.</p>\n\t\t *\n\t\t * <p>All of the icon fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>iconSourceFunction</code></li>\n\t\t *     <li><code>iconSourceField</code></li>\n\t\t *     <li><code>iconLabelFunction</code></li>\n\t\t *     <li><code>iconLabelField</code></li>\n\t\t *     <li><code>iconFunction</code></li>\n\t\t *     <li><code>iconField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the icon source function is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.iconSourceFunction = function( item:Object ):Object\n\t\t * {\n\t\t *    return \"http://www.example.com/thumbs/\" + item.name + \"-thumb.png\";\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.ImageLoader#source\n\t\t * @see #itemHasIcon\n\t\t * @see #iconLoaderFactory\n\t\t * @see #iconSourceField\n\t\t * @see #iconField\n\t\t * @see #iconFunction\n\t\t */\n\t\tpublic function get iconSourceFunction():Function\n\t\t{\n\t\t\treturn this._iconSourceFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set iconSourceFunction(value:Function):void\n\t\t{\n\t\t\tif(this._iconSourceFunction == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._iconSourceFunction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _iconLabelField:String = \"iconLabel\";\n\n\t\t/**\n\t\t * The field in the item that contains a string to be displayed in a\n\t\t * renderer-managed <code>ITextRenderer</code> in the icon position of\n\t\t * the renderer. The renderer will automatically reuse an internal\n\t\t * <code>ITextRenderer</code> and swap the text when the data changes.\n\t\t * This <code>ITextRenderer</code> may be skinned by changing the\n\t\t * <code>iconLabelFactory</code>.\n\t\t *\n\t\t * <p>Using an icon label will result in better performance than\n\t\t * passing in an <code>ITextRenderer</code> through a <code>iconField</code>\n\t\t * or <code>iconFunction</code> because the renderer can avoid\n\t\t * costly display list manipulation.</p>\n\t\t *\n\t\t * <p>All of the icon fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>iconSourceFunction</code></li>\n\t\t *     <li><code>iconSourceField</code></li>\n\t\t *     <li><code>iconLabelFunction</code></li>\n\t\t *     <li><code>iconLabelField</code></li>\n\t\t *     <li><code>iconFunction</code></li>\n\t\t *     <li><code>iconField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the icon label field is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.iconLabelField = \"text\";</listing>\n\t\t *\n\t\t * @default \"iconLabel\"\n\t\t *\n\t\t * @see #itemHasIcon\n\t\t * @see #iconLabelFactory\n\t\t * @see #iconLabelFunction\n\t\t * @see #iconField\n\t\t * @see #iconFunction\n\t\t * @see #iconySourceField\n\t\t * @see #iconSourceFunction\n\t\t */\n\t\tpublic function get iconLabelField():String\n\t\t{\n\t\t\treturn this._iconLabelField;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set iconLabelField(value:String):void\n\t\t{\n\t\t\tif(this._iconLabelField == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._iconLabelField = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _iconLabelFunction:Function;\n\n\t\t/**\n\t\t * A function that returns a string to be displayed in a\n\t\t * renderer-managed <code>ITextRenderer</code> in the icon position of\n\t\t * the renderer. The renderer will automatically reuse an internal\n\t\t * <code>ITextRenderer</code> and swap the text when the data changes.\n\t\t * This <code>ITextRenderer</code> may be skinned by changing the\n\t\t * <code>iconLabelFactory</code>.\n\t\t *\n\t\t * <p>Using an icon label will result in better performance than\n\t\t * passing in an <code>ITextRenderer</code> through a <code>iconField</code>\n\t\t * or <code>iconFunction</code> because the renderer can avoid costly\n\t\t * display list manipulation.</p>\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function( item:Object ):String</pre>\n\t\t *\n\t\t * <p>If the item renderer is an <code>IListItemRenderer</code>, the\n\t\t * function may optionally have the following signature instead:</p>\n\t\t * <pre>function( item:Object, index:int ):String</pre>\n\t\t *\n\t\t * <p>If the item renderer is an <code>IGroupedListItemRenderer</code>,\n\t\t * the function may optionally have the following signature instead:</p>\n\t\t * <pre>function( item:Object, groupIndex:int, itemIndex:int ):String</pre>\n\t\t *\n\t\t * <p>All of the icon fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>iconSourceFunction</code></li>\n\t\t *     <li><code>iconSourceField</code></li>\n\t\t *     <li><code>iconLabelFunction</code></li>\n\t\t *     <li><code>iconLabelField</code></li>\n\t\t *     <li><code>iconFunction</code></li>\n\t\t *     <li><code>iconField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the icon label function is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.iconLabelFunction = function( item:Object ):String\n\t\t * {\n\t\t *    return item.firstName + \" \" + item.lastName;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #itemHasIcon\n\t\t * @see #iconLabelFactory\n\t\t * @see #iconLabelField\n\t\t * @see #iconField\n\t\t * @see #iconFunction\n\t\t * @see #iconSourceField\n\t\t * @see #iconSourceFunction\n\t\t */\n\t\tpublic function get iconLabelFunction():Function\n\t\t{\n\t\t\treturn this._iconLabelFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set iconLabelFunction(value:Function):void\n\t\t{\n\t\t\tif(this._iconLabelFunction == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._iconLabelFunction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customIconLoaderStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customIconLoaderStyleName():String\n\t\t{\n\t\t\treturn this._customIconLoaderStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customIconLoaderStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customIconLoaderStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customIconLoaderStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customIconLabelStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customIconLabelStyleName():String\n\t\t{\n\t\t\treturn this._customIconLabelStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customIconLabelStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customIconLabelStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customIconLabelStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _accessoryField:String = \"accessory\";\n\n\t\t/**\n\t\t * The field in the item that contains a display object to be positioned\n\t\t * in the accessory position of the renderer. If you wish to display an\n\t\t * <code>Image</code> in the accessory position, it's better for\n\t\t * performance to use <code>accessorySourceField</code> instead.\n\t\t *\n\t\t * <p>Warning: It is your responsibility to dispose all accessories\n\t\t * included in the data provider and accessed with <code>accessoryField</code>,\n\t\t * or any display objects returned by <code>accessoryFunction</code>.\n\t\t * These display objects will not be disposed when the list is disposed.\n\t\t * Not disposing an accessory may result in a memory leak.</p>\n\t\t *\n\t\t * <p>All of the accessory fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>accessorySourceFunction</code></li>\n\t\t *     <li><code>accessorySourceField</code></li>\n\t\t *     <li><code>accessoryLabelFunction</code></li>\n\t\t *     <li><code>accessoryLabelField</code></li>\n\t\t *     <li><code>accessoryFunction</code></li>\n\t\t *     <li><code>accessoryField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the accessory field is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.accessoryField = \"component\";</listing>\n\t\t *\n\t\t * @default \"accessory\"\n\t\t *\n\t\t * @see #itemHasAccessory\n\t\t * @see #accessorySourceField\n\t\t * @see #accessoryFunction\n\t\t * @see #accessorySourceFunction\n\t\t * @see #accessoryLabelField\n\t\t * @see #accessoryLabelFunction\n\t\t */\n\t\tpublic function get accessoryField():String\n\t\t{\n\t\t\treturn this._accessoryField;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set accessoryField(value:String):void\n\t\t{\n\t\t\tif(this._accessoryField == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._accessoryField = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _accessoryFunction:Function;\n\n\t\t/**\n\t\t * A function that returns a display object to be positioned in the\n\t\t * accessory position of the renderer. If you wish to display an\n\t\t * <code>Image</code> in the accessory position, it's better for\n\t\t * performance to use <code>accessorySourceFunction</code> instead.\n\t\t *\n\t\t * <p>Note: As the list scrolls, this function will almost always be\n\t\t * called more than once for each individual item in the list's data\n\t\t * provider. Your function should not simply return a new accessory\n\t\t * every time. This will result in the unnecessary creation and\n\t\t * destruction of many icons, which will overwork the garbage collector\n\t\t * and hurt performance. It's better to return a new accessory the first\n\t\t * time this function is called for a particular item and then return\n\t\t * the same accessory if that item is passed to this function again.</p>\n\t\t *\n\t\t * <p>Warning: It is your responsibility to dispose all accessories\n\t\t * included in the data provider and accessed with <code>accessoryField</code>,\n\t\t * or any display objects returned by <code>accessoryFunction</code>.\n\t\t * These display objects will not be disposed when the list is disposed.\n\t\t * Not disposing an accessory may result in a memory leak.</p>\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function( item:Object ):DisplayObject</pre>\n\t\t *\n\t\t * <p>If the item renderer is an <code>IListItemRenderer</code>, the\n\t\t * function may optionally have the following signature instead:</p>\n\t\t * <pre>function( item:Object, index:int ):DisplayObject</pre>\n\t\t *\n\t\t * <p>If the item renderer is an <code>IGroupedListItemRenderer</code>,\n\t\t * the function may optionally have the following signature instead:</p>\n\t\t * <pre>function( item:Object, groupIndex:int, itemIndex:int ):DisplayObject</pre>\n\t\t *\n\t\t * <p>All of the accessory fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>accessorySourceFunction</code></li>\n\t\t *     <li><code>accessorySourceField</code></li>\n\t\t *     <li><code>accessoryLabelFunction</code></li>\n\t\t *     <li><code>accessoryLabelField</code></li>\n\t\t *     <li><code>accessoryFunction</code></li>\n\t\t *     <li><code>accessoryField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the accessory function is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.accessoryFunction = function( item:Object ):DisplayObject\n\t\t * {\n\t\t *    if(item in cachedAccessories)\n\t\t *    {\n\t\t *        return cachedAccessories[item];\n\t\t *    }\n\t\t *    var accessory:DisplayObject = createAccessoryForItem( item );\n\t\t *    cachedAccessories[item] = accessory;\n\t\t *    return accessory;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t **\n\t\t * @see #itemHasAccessory\n\t\t * @see #accessoryField\n\t\t * @see #accessorySourceField\n\t\t * @see #accessorySourceFunction\n\t\t * @see #accessoryLabelField\n\t\t * @see #accessoryLabelFunction\n\t\t */\n\t\tpublic function get accessoryFunction():Function\n\t\t{\n\t\t\treturn this._accessoryFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set accessoryFunction(value:Function):void\n\t\t{\n\t\t\tif(this._accessoryFunction == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._accessoryFunction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _accessorySourceField:String = \"accessorySource\";\n\n\t\t/**\n\t\t * A field in the item that contains a <code>starling.textures.Texture</code>\n\t\t * or a URL that points to a bitmap to be used as the item renderer's\n\t\t * accessory. The renderer will automatically manage and reuse an internal\n\t\t * <code>ImageLoader</code> sub-component and this value will be passed\n\t\t * to the <code>source</code> property. The <code>ImageLoader</code> may\n\t\t * be customized by changing the <code>accessoryLoaderFactory</code>.\n\t\t *\n\t\t * <p>Using an accessory source will result in better performance than\n\t\t * passing in an <code>ImageLoader</code> or <code>Image</code> through\n\t\t * a <code>accessoryField</code> or <code>accessoryFunction</code> because\n\t\t * the renderer can avoid costly display list manipulation.</p>\n\t\t *\n\t\t * <p>All of the accessory fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>accessorySourceFunction</code></li>\n\t\t *     <li><code>accessorySourceField</code></li>\n\t\t *     <li><code>accessoryLabelFunction</code></li>\n\t\t *     <li><code>accessoryLabelField</code></li>\n\t\t *     <li><code>accessoryFunction</code></li>\n\t\t *     <li><code>accessoryField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the accessory source field is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.accessorySourceField = \"texture\";</listing>\n\t\t *\n\t\t * @default \"accessorySource\"\n\t\t *\n\t\t * @see feathers.controls.ImageLoader#source\n\t\t * @see #itemHasAccessory\n\t\t * @see #accessoryLoaderFactory\n\t\t * @see #accessorySourceFunction\n\t\t * @see #accessoryField\n\t\t * @see #accessoryFunction\n\t\t * @see #accessoryLabelField\n\t\t * @see #accessoryLabelFunction\n\t\t */\n\t\tpublic function get accessorySourceField():String\n\t\t{\n\t\t\treturn this._accessorySourceField;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set accessorySourceField(value:String):void\n\t\t{\n\t\t\tif(this._accessorySourceField == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._accessorySourceField = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _accessorySourceFunction:Function;\n\n\t\t/**\n\t\t * A function that generates a <code>starling.textures.Texture</code>\n\t\t * or a URL that points to a bitmap to be used as the item renderer's\n\t\t * accessory. The renderer will automatically manage and reuse an internal\n\t\t * <code>ImageLoader</code> sub-component and this value will be passed\n\t\t * to the <code>source</code> property. The <code>ImageLoader</code> may\n\t\t * be customized by changing the <code>accessoryLoaderFactory</code>.\n\t\t *\n\t\t * <p>Using an accessory source will result in better performance than\n\t\t * passing in an <code>ImageLoader</code> or <code>Image</code> through\n\t\t * a <code>accessoryField</code> or <code>accessoryFunction</code>\n\t\t * because the renderer can avoid costly display list manipulation.</p>\n\t\t *\n\t\t * <p>Note: As the list scrolls, this function will almost always be\n\t\t * called more than once for each individual item in the list's data\n\t\t * provider. Your function should not simply return a new texture every\n\t\t * time. This will result in the unnecessary creation and destruction of\n\t\t * many textures, which will overwork the garbage collector and hurt\n\t\t * performance. Creating a new texture at all is dangerous, unless you\n\t\t * are absolutely sure to dispose it when necessary because neither the\n\t\t * list nor its item renderer will dispose of the texture for you. If\n\t\t * you are absolutely sure that you are managing the texture memory with\n\t\t * proper disposal, it's better to return a new texture the first\n\t\t * time this function is called for a particular item and then return\n\t\t * the same texture if that item is passed to this function again.</p>\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function( item:Object ):Object</pre>\n\t\t *\n\t\t * <p>If the item renderer is an <code>IListItemRenderer</code>, the\n\t\t * function may optionally have the following signature instead:</p>\n\t\t * <pre>function( item:Object, index:int ):Object</pre>\n\t\t *\n\t\t * <p>If the item renderer is an <code>IGroupedListItemRenderer</code>,\n\t\t * the function may optionally have the following signature instead:</p>\n\t\t * <pre>function( item:Object, groupIndex:int, itemIndex:int ):Object</pre>\n\t\t *\n\t\t * <p>The return value is a valid value for the <code>source</code>\n\t\t * property of an <code>ImageLoader</code> component.</p>\n\t\t *\n\t\t * <p>All of the accessory fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>accessorySourceFunction</code></li>\n\t\t *     <li><code>accessorySourceField</code></li>\n\t\t *     <li><code>accessoryLabelFunction</code></li>\n\t\t *     <li><code>accessoryLabelField</code></li>\n\t\t *     <li><code>accessoryFunction</code></li>\n\t\t *     <li><code>accessoryField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the accessory source function is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.accessorySourceFunction = function( item:Object ):Object\n\t\t * {\n\t\t *    return \"http://www.example.com/thumbs/\" + item.name + \"-thumb.png\";\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.ImageLoader#source\n\t\t * @see #itemHasAccessory\n\t\t * @see #accessoryLoaderFactory\n\t\t * @see #accessorySourceField\n\t\t * @see #accessoryField\n\t\t * @see #accessoryFunction\n\t\t * @see #accessoryLabelField\n\t\t * @see #accessoryLabelFunction\n\t\t */\n\t\tpublic function get accessorySourceFunction():Function\n\t\t{\n\t\t\treturn this._accessorySourceFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set accessorySourceFunction(value:Function):void\n\t\t{\n\t\t\tif(this._accessorySourceFunction == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._accessorySourceFunction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _accessoryLabelField:String = \"accessoryLabel\";\n\n\t\t/**\n\t\t * The field in the item that contains a string to be displayed in a\n\t\t * renderer-managed <code>ITextRenderer</code> in the accessory position\n\t\t * of the renderer. The renderer will automatically reuse an internal\n\t\t * <code>ITextRenderer</code> and swap the text when the data changes.\n\t\t * This <code>ITextRenderer</code> may be skinned by changing the\n\t\t * <code>accessoryLabelFactory</code>.\n\t\t *\n\t\t * <p>Using an accessory label will result in better performance than\n\t\t * passing in a <code>ITextRenderer</code> through an <code>accessoryField</code>\n\t\t * or <code>accessoryFunction</code> because the renderer can avoid\n\t\t * costly display list manipulation.</p>\n\t\t *\n\t\t * <p>All of the accessory fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>accessorySourceFunction</code></li>\n\t\t *     <li><code>accessorySourceField</code></li>\n\t\t *     <li><code>accessoryLabelFunction</code></li>\n\t\t *     <li><code>accessoryLabelField</code></li>\n\t\t *     <li><code>accessoryFunction</code></li>\n\t\t *     <li><code>accessoryField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the accessory label field is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.accessoryLabelField = \"text\";</listing>\n\t\t *\n\t\t * @default \"accessoryLabel\"\n\t\t **\n\t\t * @see #itemHasAccessory\n\t\t * @see #accessoryLabelFactory\n\t\t * @see #accessoryLabelFunction\n\t\t * @see #accessoryField\n\t\t * @see #accessoryFunction\n\t\t * @see #accessorySourceField\n\t\t * @see #accessorySourceFunction\n\t\t */\n\t\tpublic function get accessoryLabelField():String\n\t\t{\n\t\t\treturn this._accessoryLabelField;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set accessoryLabelField(value:String):void\n\t\t{\n\t\t\tif(this._accessoryLabelField == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._accessoryLabelField = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _accessoryLabelFunction:Function;\n\n\t\t/**\n\t\t * A function that returns a string to be displayed in a\n\t\t * renderer-managed <code>ITextRenderer</code> in the accessory position\n\t\t * of the renderer. The renderer will automatically reuse an internal\n\t\t * <code>ITextRenderer</code> and swap the text when the data changes.\n\t\t * This <code>ITextRenderer</code> may be skinned by changing the\n\t\t * <code>accessoryLabelFactory</code>.\n\t\t *\n\t\t * <p>Using an accessory label will result in better performance than\n\t\t * passing in an <code>ITextRenderer</code> through an <code>accessoryField</code>\n\t\t * or <code>accessoryFunction</code> because the renderer can avoid\n\t\t * costly display list manipulation.</p>\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function( item:Object ):String</pre>\n\t\t *\n\t\t * <p>If the item renderer is an <code>IListItemRenderer</code>, the\n\t\t * function may optionally have the following signature instead:</p>\n\t\t * <pre>function( item:Object, index:int ):String</pre>\n\t\t *\n\t\t * <p>If the item renderer is an <code>IGroupedListItemRenderer</code>,\n\t\t * the function may optionally have the following signature instead:</p>\n\t\t * <pre>function( item:Object, groupIndex:int, itemIndex:int ):String</pre>\n\t\t *\n\t\t * <p>All of the accessory fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>accessorySourceFunction</code></li>\n\t\t *     <li><code>accessorySourceField</code></li>\n\t\t *     <li><code>accessoryLabelFunction</code></li>\n\t\t *     <li><code>accessoryLabelField</code></li>\n\t\t *     <li><code>accessoryFunction</code></li>\n\t\t *     <li><code>accessoryField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the accessory label function is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.accessoryLabelFunction = function( item:Object ):String\n\t\t * {\n\t\t *    return item.firstName + \" \" + item.lastName;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t **\n\t\t * @see #itemHasAccessory\n\t\t * @see #accessoryLabelFactory\n\t\t * @see #accessoryLabelField\n\t\t * @see #accessoryField\n\t\t * @see #accessoryFunction\n\t\t * @see #accessorySourceField\n\t\t * @see #accessorySourceFunction\n\t\t */\n\t\tpublic function get accessoryLabelFunction():Function\n\t\t{\n\t\t\treturn this._accessoryLabelFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set accessoryLabelFunction(value:Function):void\n\t\t{\n\t\t\tif(this._accessoryLabelFunction == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._accessoryLabelFunction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customAccessoryLabelStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customAccessoryLabelStyleName():String\n\t\t{\n\t\t\treturn this._customAccessoryLabelStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customAccessoryLabelStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customAccessoryLabelStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customAccessoryLabelStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customAccessoryLoaderStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customAccessoryLoaderStyleName():String\n\t\t{\n\t\t\treturn this._customAccessoryLoaderStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customAccessoryLoaderStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customAccessoryLoaderStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customAccessoryLoaderStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _skinField:String = \"skin\";\n\n\t\t/**\n\t\t * The field in the item that contains a display object to be displayed\n\t\t * as a background skin.\n\t\t *\n\t\t * <p>All of the icon fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>skinSourceFunction</code></li>\n\t\t *     <li><code>skinSourceField</code></li>\n\t\t *     <li><code>skinFunction</code></li>\n\t\t *     <li><code>skinField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the skin field is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.itemHasSkin = true;\n\t\t * renderer.skinField = \"background\";</listing>\n\t\t *\n\t\t * @default \"skin\"\n\t\t *\n\t\t * @see #itemHasSkin\n\t\t * @see #skinFunction\n\t\t * @see #skinSourceField\n\t\t * @see #skinSourceFunction\n\t\t */\n\t\tpublic function get skinField():String\n\t\t{\n\t\t\treturn this._skinField;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set skinField(value:String):void\n\t\t{\n\t\t\tif(this._skinField == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._skinField = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _skinFunction:Function;\n\n\t\t/**\n\t\t * A function used to generate a background skin for a specific item.\n\t\t *\n\t\t * <p>Note: As the list scrolls, this function will almost always be\n\t\t * called more than once for each individual item in the list's data\n\t\t * provider. Your function should not simply return a new display object\n\t\t * every time. This will result in the unnecessary creation and\n\t\t * destruction of many skins, which will overwork the garbage collector\n\t\t * and hurt performance. It's better to return a new skin the first time\n\t\t * this function is called for a particular item and then return the same\n\t\t * skin if that item is passed to this function again.</p>\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function( item:Object ):DisplayObject</pre>\n\t\t *\n\t\t * <p>If the item renderer is an <code>IListItemRenderer</code>, the\n\t\t * function may optionally have the following signature instead:</p>\n\t\t * <pre>function( item:Object, index:int ):DisplayObject</pre>\n\t\t *\n\t\t * <p>If the item renderer is an <code>IGroupedListItemRenderer</code>,\n\t\t * the function may optionally have the following signature instead:</p>\n\t\t * <pre>function( item:Object, groupIndex:int, itemIndex:int ):DisplayObject</pre>\n\t\t *\n\t\t * <p>All of the skin fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>skinSourceFunction</code></li>\n\t\t *     <li><code>skinSourceField</code></li>\n\t\t *     <li><code>skinFunction</code></li>\n\t\t *     <li><code>skinField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the skin function is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.itemHasSkin = true;\n\t\t * renderer.skinFunction = function( item:Object ):DisplayObject\n\t\t * {\n\t\t *    if(item in cachedSkin)\n\t\t *    {\n\t\t *        return cachedSkin[item];\n\t\t *    }\n\t\t *    var skin:Image = new Image( textureAtlas.getTexture( item.textureName ) );\n\t\t *    cachedSkin[item] = skin;\n\t\t *    return skin;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #itemHasSkin\n\t\t * @see #skinField\n\t\t * @see #skinSourceField\n\t\t * @see #skinSourceFunction\n\t\t */\n\t\tpublic function get skinFunction():Function\n\t\t{\n\t\t\treturn this._skinFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set skinFunction(value:Function):void\n\t\t{\n\t\t\tif(this._skinFunction == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._skinFunction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _skinSourceField:String = \"skinSource\";\n\n\t\t/**\n\t\t * The field in the item that contains a <code>starling.textures.Texture</code>\n\t\t * or a URL that points to a bitmap to be used as the item renderer's\n\t\t * skin. The renderer will automatically manage and reuse an internal\n\t\t * <code>ImageLoader</code> sub-component and this value will be passed\n\t\t * to the <code>source</code> property. The <code>ImageLoader</code> may\n\t\t * be customized by changing the <code>skinLoaderFactory</code>.\n\t\t *\n\t\t * <p>Using a skin source will result in better performance than\n\t\t * passing in an <code>ImageLoader</code> or <code>Image</code> through\n\t\t * a <code>skinField</code> or <code>skinFunction</code>\n\t\t * because the renderer can avoid costly display list manipulation.</p>\n\t\t *\n\t\t * <p>All of the skin fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>skinSourceFunction</code></li>\n\t\t *     <li><code>skinSourceField</code></li>\n\t\t *     <li><code>skinFunction</code></li>\n\t\t *     <li><code>skinField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the skin source field is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.itemHasSkin = true;\n\t\t * renderer.skinSourceField = \"texture\";</listing>\n\t\t *\n\t\t * @default \"skinSource\"\n\t\t *\n\t\t * @see feathers.controls.ImageLoader#source\n\t\t * @see #itemHasSkin\n\t\t * @see #skinLoaderFactory\n\t\t * @see #skinSourceFunction\n\t\t * @see #skinField\n\t\t * @see #skinFunction\n\t\t */\n\t\tpublic function get skinSourceField():String\n\t\t{\n\t\t\treturn this._skinSourceField;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set skinSourceField(value:String):void\n\t\t{\n\t\t\tif(this._skinSourceField == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._skinSourceField = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _skinSourceFunction:Function;\n\n\t\t/**\n\t\t * A function used to generate a <code>starling.textures.Texture</code>\n\t\t * or a URL that points to a bitmap to be used as the item renderer's\n\t\t * skin. The renderer will automatically manage and reuse an internal\n\t\t * <code>ImageLoader</code> sub-component and this value will be passed\n\t\t * to the <code>source</code> property. The <code>ImageLoader</code> may\n\t\t * be customized by changing the <code>skinLoaderFactory</code>.\n\t\t *\n\t\t * <p>Using a skin source will result in better performance than\n\t\t * passing in an <code>ImageLoader</code> or <code>Image</code> through\n\t\t * a <code>skinField</code> or <code>skinnFunction</code>\n\t\t * because the renderer can avoid costly display list manipulation.</p>\n\t\t *\n\t\t * <p>Note: As the list scrolls, this function will almost always be\n\t\t * called more than once for each individual item in the list's data\n\t\t * provider. Your function should not simply return a new texture every\n\t\t * time. This will result in the unnecessary creation and destruction of\n\t\t * many textures, which will overwork the garbage collector and hurt\n\t\t * performance. Creating a new texture at all is dangerous, unless you\n\t\t * are absolutely sure to dispose it when necessary because neither the\n\t\t * list nor its item renderer will dispose of the texture for you. If\n\t\t * you are absolutely sure that you are managing the texture memory with\n\t\t * proper disposal, it's better to return a new texture the first\n\t\t * time this function is called for a particular item and then return\n\t\t * the same texture if that item is passed to this function again.</p>\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function( item:Object ):Object</pre>\n\t\t *\n\t\t * <p>If the item renderer is an <code>IListItemRenderer</code>, the\n\t\t * function may optionally have the following signature instead:</p>\n\t\t * <pre>function( item:Object, index:int ):Object</pre>\n\t\t *\n\t\t * <p>If the item renderer is an <code>IGroupedListItemRenderer</code>,\n\t\t * the function may optionally have the following signature instead:</p>\n\t\t * <pre>function( item:Object, groupIndex:int, itemIndex:int ):Object</pre>\n\t\t *\n\t\t * <p>The return value is a valid value for the <code>source</code>\n\t\t * property of an <code>ImageLoader</code> component.</p>\n\t\t *\n\t\t * <p>All of the skin fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>skinSourceFunction</code></li>\n\t\t *     <li><code>skinSourceField</code></li>\n\t\t *     <li><code>skinFunction</code></li>\n\t\t *     <li><code>skinField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the skin source function is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.itemHasSkin = true;\n\t\t * renderer.skinSourceFunction = function( item:Object ):Object\n\t\t * {\n\t\t *    return \"http://www.example.com/images/\" + item.name + \"-skin.png\";\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.ImageLoader#source\n\t\t * @see #itemHasSkin\n\t\t * @see #skinLoaderFactory\n\t\t * @see #skinSourceField\n\t\t * @see #skinField\n\t\t * @see #skinFunction\n\t\t */\n\t\tpublic function get skinSourceFunction():Function\n\t\t{\n\t\t\treturn this._skinSourceFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set skinSourceFunction(value:Function):void\n\t\t{\n\t\t\tif(this._skinSourceFunction == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._skinSourceFunction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectableField:String = \"selectable\";\n\n\t\t/**\n\t\t * The field in the item that determines if the item renderer can be\n\t\t * selected, if the list allows selection. If the item does not have\n\t\t * this field, and a <code>selectableFunction</code> is not defined,\n\t\t * then the renderer will default to being selectable.\n\t\t *\n\t\t * <p>All of the label fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>selectableFunction</code></li>\n\t\t *     <li><code>selectableField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the selectable field is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.itemHasSelectable = true;\n\t\t * renderer.selectableField = \"isSelectable\";</listing>\n\t\t *\n\t\t * @default \"selectable\"\n\t\t *\n\t\t * @see #selectableFunction\n\t\t * @see #itemHasSelectable\n\t\t */\n\t\tpublic function get selectableField():String\n\t\t{\n\t\t\treturn this._selectableField;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectableField(value:String):void\n\t\t{\n\t\t\tif(this._selectableField == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._selectableField = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectableFunction:Function;\n\n\t\t/**\n\t\t * A function used to determine if a specific item is selectable. If this\n\t\t * function is not null, then the <code>selectableField</code> will be\n\t\t * ignored.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function( item:Object ):Boolean</pre>\n\t\t *\n\t\t * <p>If the item renderer is an <code>IListItemRenderer</code>, the\n\t\t * function may optionally have the following signature instead:</p>\n\t\t * <pre>function( item:Object, index:int ):Boolean</pre>\n\t\t *\n\t\t * <p>If the item renderer is an <code>IGroupedListItemRenderer</code>,\n\t\t * the function may optionally have the following signature instead:</p>\n\t\t * <pre>function( item:Object, groupIndex:int, itemIndex:int ):Boolean</pre>\n\t\t *\n\t\t * <p>All of the selectable fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>selectableFunction</code></li>\n\t\t *     <li><code>selectableField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the selectable function is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.itemHasSelectable = true;\n\t\t * renderer.selectableFunction = function( item:Object ):Boolean\n\t\t * {\n\t\t *    return item.isSelectable;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #selectableField\n\t\t * @see #itemHasSelectable\n\t\t */\n\t\tpublic function get selectableFunction():Function\n\t\t{\n\t\t\treturn this._selectableFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectableFunction(value:Function):void\n\t\t{\n\t\t\tif(this._selectableFunction == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._selectableFunction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _enabledField:String = \"enabled\";\n\n\t\t/**\n\t\t * The field in the item that determines if the item renderer is\n\t\t * enabled, if the list is enabled. If the item does not have\n\t\t * this field, and a <code>enabledFunction</code> is not defined,\n\t\t * then the renderer will default to being enabled.\n\t\t *\n\t\t * <p>All of the label fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>enabledFunction</code></li>\n\t\t *     <li><code>enabledField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the enabled field is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.itemHasEnabled = true;\n\t\t * renderer.enabledField = \"isEnabled\";</listing>\n\t\t *\n\t\t * @default \"enabled\"\n\t\t *\n\t\t * @see #enabledFunction\n\t\t * @see #itemHasEnabled\n\t\t */\n\t\tpublic function get enabledField():String\n\t\t{\n\t\t\treturn this._enabledField;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set enabledField(value:String):void\n\t\t{\n\t\t\tif(this._enabledField == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._enabledField = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _enabledFunction:Function;\n\n\t\t/**\n\t\t * A function used to determine if a specific item is enabled. If this\n\t\t * function is not null, then the <code>enabledField</code> will be\n\t\t * ignored.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function( item:Object ):Boolean</pre>\n\t\t *\n\t\t * <p>If the item renderer is an <code>IListItemRenderer</code>, the\n\t\t * function may optionally have the following signature instead:</p>\n\t\t * <pre>function( item:Object, index:int ):Boolean</pre>\n\t\t *\n\t\t * <p>If the item renderer is an <code>IGroupedListItemRenderer</code>,\n\t\t * the function may optionally have the following signature instead:</p>\n\t\t * <pre>function( item:Object, groupIndex:int, itemIndex:int ):Boolean</pre>\n\t\t *\n\t\t * <p>All of the enabled fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>enabledFunction</code></li>\n\t\t *     <li><code>enabledField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the enabled function is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.itemHasEnabled = true;\n\t\t * renderer.enabledFunction = function( item:Object ):Boolean\n\t\t * {\n\t\t *    return item.isEnabled;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #enabledField\n\t\t * @see #itemHasEnabled\n\t\t */\n\t\tpublic function get enabledFunction():Function\n\t\t{\n\t\t\treturn this._enabledFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set enabledFunction(value:Function):void\n\t\t{\n\t\t\tif(this._enabledFunction == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._enabledFunction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitIsToggle:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set isToggle(value:Boolean):void\n\t\t{\n\t\t\tif(this._explicitIsToggle == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsuper.isToggle = value;\n\t\t\tthis._explicitIsToggle = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitIsEnabled:Boolean;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set isEnabled(value:Boolean):void\n\t\t{\n\t\t\tif(this._explicitIsEnabled == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._explicitIsEnabled = value;\n\t\t\tsuper.isEnabled = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _iconLoaderFactory:Function = defaultLoaderFactory;\n\n\t\t/**\n\t\t * A function that generates an <code>ImageLoader</code> that uses the result\n\t\t * of <code>iconSourceField</code> or <code>iconSourceFunction</code>.\n\t\t * Useful for transforming the <code>ImageLoader</code> in some way. For\n\t\t * example, you might want to scale the texture for current screen\n\t\t * density or apply pixel snapping.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function():ImageLoader</pre>\n\t\t *\n\t\t * <p>In the following example, the loader factory is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.iconLoaderFactory = function():ImageLoader\n\t\t * {\n\t\t *    var loader:ImageLoader = new ImageLoader();\n\t\t *    loader.scaleFactor = 2;\n\t\t *    return loader;\n\t\t * };</listing>\n\t\t *\n\t\t * @default function():ImageLoader { return new ImageLoader(); }\n\t\t *\n\t\t * @see feathers.controls.ImageLoader\n\t\t * @see #iconSourceField\n\t\t * @see #iconSourceFunction\n\t\t */\n\t\tpublic function get iconLoaderFactory():Function\n\t\t{\n\t\t\treturn this._iconLoaderFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set iconLoaderFactory(value:Function):void\n\t\t{\n\t\t\tif(this._iconLoaderFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._iconLoaderFactory = value;\n\t\t\tthis._iconIsFromItem = false;\n\t\t\tthis.replaceIcon(null);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _iconLabelFontStylesSet:FontStylesSet;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get iconLabelFontStyles():TextFormat\n\t\t{\n\t\t\treturn this._iconLabelFontStylesSet.format;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set iconLabelFontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._iconLabelFontStylesSet.format;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._iconLabelFontStylesSet.format = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get iconLabelDisabledFontStyles():TextFormat\n\t\t{\n\t\t\treturn this._iconLabelFontStylesSet.disabledFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set iconLabelDisabledFontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._iconLabelFontStylesSet.disabledFormat;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._iconLabelFontStylesSet.disabledFormat = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get iconLabelSelectedFontStyles():TextFormat\n\t\t{\n\t\t\treturn this._iconLabelFontStylesSet.selectedFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set iconLabelSelectedFontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._iconLabelFontStylesSet.selectedFormat;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._iconLabelFontStylesSet.selectedFormat = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _iconLabelFactory:Function;\n\n\t\t/**\n\t\t * A function that generates <code>ITextRenderer</code> that uses the result\n\t\t * of <code>iconLabelField</code> or <code>iconLabelFunction</code>.\n\t\t * CAn be used to set properties on the <code>ITextRenderer</code>.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function():ITextRenderer</pre>\n\t\t *\n\t\t * <p>In the following example, the icon label factory is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.iconLabelFactory = function():ITextRenderer\n\t\t * {\n\t\t *    var renderer:TextFieldTextRenderer = new TextFieldTextRenderer();\n\t\t *    renderer.textFormat = new TextFormat( \"Source Sans Pro\", 16, 0x333333 );\n\t\t *    renderer.embedFonts = true;\n\t\t *    return renderer;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.ITextRenderer\n\t\t * @see feathers.core.FeathersControl#defaultTextRendererFactory\n\t\t * @see #iconLabelField\n\t\t * @see #iconLabelFunction\n\t\t */\n\t\tpublic function get iconLabelFactory():Function\n\t\t{\n\t\t\treturn this._iconLabelFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set iconLabelFactory(value:Function):void\n\t\t{\n\t\t\tif(this._iconLabelFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._iconLabelFactory = value;\n\t\t\tthis._iconIsFromItem = false;\n\t\t\tthis.replaceIcon(null);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _iconLabelProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the icon label text renderer\n\t\t * sub-component (if using <code>iconLabelField</code> or\n\t\t * <code>iconLabelFunction</code>), and the properties will be passed\n\t\t * down to the text renderer when this component validates. The\n\t\t * available properties depend on which <code>ITextRenderer</code>\n\t\t * implementation is returned by <code>iconLabelFactory</code>. Refer to\n\t\t * <a href=\"../../core/ITextRenderer.html\"><code>feathers.core.ITextRenderer</code></a>\n\t\t * for a list of available text renderer implementations.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>iconLabelFactory</code>\n\t\t * function instead of using <code>iconLabelProperties</code> will\n\t\t * result in better performance.</p>\n\t\t *\n\t\t * <p>In the following example, the icon label properties are customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.&#64;iconLabelProperties.textFormat = new TextFormat( \"Source Sans Pro\", 16, 0x333333 );\n\t\t * renderer.&#64;iconLabelProperties.embedFonts = true;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.ITextRenderer\n\t\t * @see #iconLabelFactory\n\t\t * @see #iconLabelField\n\t\t * @see #iconLabelFunction\n\t\t */\n\t\tpublic function get iconLabelProperties():Object\n\t\t{\n\t\t\tif(!this._iconLabelProperties)\n\t\t\t{\n\t\t\t\tthis._iconLabelProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._iconLabelProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set iconLabelProperties(value:Object):void\n\t\t{\n\t\t\tif(this._iconLabelProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._iconLabelProperties)\n\t\t\t{\n\t\t\t\tthis._iconLabelProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._iconLabelProperties = PropertyProxy(value);\n\t\t\tif(this._iconLabelProperties)\n\t\t\t{\n\t\t\t\tthis._iconLabelProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _accessoryLoaderFactory:Function = defaultLoaderFactory;\n\n\t\t/**\n\t\t * A function that generates an <code>ImageLoader</code> that uses the result\n\t\t * of <code>accessorySourceField</code> or <code>accessorySourceFunction</code>.\n\t\t * Useful for transforming the <code>ImageLoader</code> in some way. For\n\t\t * example, you might want to scale the texture for current screen\n\t\t * density or apply pixel snapping.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function():ImageLoader</pre>\n\t\t *\n\t\t * <p>In the following example, the loader factory is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.accessoryLoaderFactory = function():ImageLoader\n\t\t * {\n\t\t *    var loader:ImageLoader = new ImageLoader();\n\t\t *    loader.scaleFactor = 2;\n\t\t *    return loader;\n\t\t * };</listing>\n\t\t *\n\t\t * @default function():ImageLoader { return new ImageLoader(); }\n\t\t *\n\t\t * @see feathers.controls.ImageLoader\n\t\t * @see #accessorySourceField;\n\t\t * @see #accessorySourceFunction;\n\t\t */\n\t\tpublic function get accessoryLoaderFactory():Function\n\t\t{\n\t\t\treturn this._accessoryLoaderFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set accessoryLoaderFactory(value:Function):void\n\t\t{\n\t\t\tif(this._accessoryLoaderFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._accessoryLoaderFactory = value;\n\t\t\tthis._accessoryIsFromItem = false;\n\t\t\tthis.replaceAccessory(null);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _accessoryLabelFontStylesSet:FontStylesSet;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get accessoryLabelFontStyles():TextFormat\n\t\t{\n\t\t\treturn this._accessoryLabelFontStylesSet.format;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set accessoryLabelFontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._accessoryLabelFontStylesSet.format;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._accessoryLabelFontStylesSet.format = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get accessoryLabelDisabledFontStyles():TextFormat\n\t\t{\n\t\t\treturn this._accessoryLabelFontStylesSet.disabledFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set accessoryLabelDisabledFontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._accessoryLabelFontStylesSet.disabledFormat;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._accessoryLabelFontStylesSet.disabledFormat = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get accessoryLabelSelectedFontStyles():TextFormat\n\t\t{\n\t\t\treturn this._accessoryLabelFontStylesSet.selectedFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set accessoryLabelSelectedFontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._accessoryLabelFontStylesSet.selectedFormat;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._accessoryLabelFontStylesSet.selectedFormat = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _accessoryLabelFactory:Function;\n\n\t\t/**\n\t\t * A function that generates <code>ITextRenderer</code> that uses the result\n\t\t * of <code>accessoryLabelField</code> or <code>accessoryLabelFunction</code>.\n\t\t * CAn be used to set properties on the <code>ITextRenderer</code>.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function():ITextRenderer</pre>\n\t\t *\n\t\t * <p>In the following example, the accessory label factory is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.accessoryLabelFactory = function():ITextRenderer\n\t\t * {\n\t\t *    var renderer:TextFieldTextRenderer = new TextFieldTextRenderer();\n\t\t *    renderer.textFormat = new TextFormat( \"Source Sans Pro\", 16, 0x333333 );\n\t\t *    renderer.embedFonts = true;\n\t\t *    return renderer;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.ITextRenderer\n\t\t * @see feathers.core.FeathersControl#defaultTextRendererFactory\n\t\t * @see #accessoryLabelField\n\t\t * @see #accessoryLabelFunction\n\t\t */\n\t\tpublic function get accessoryLabelFactory():Function\n\t\t{\n\t\t\treturn this._accessoryLabelFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set accessoryLabelFactory(value:Function):void\n\t\t{\n\t\t\tif(this._accessoryLabelFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._accessoryLabelFactory = value;\n\t\t\tthis._accessoryIsFromItem = false;\n\t\t\tthis.replaceAccessory(null);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _accessoryLabelProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the accessory label text\n\t\t * renderer sub-component (if using <code>accessoryLabelField</code> or\n\t\t * <code>accessoryLabelFunction</code>), and the properties will be\n\t\t * passed down to the text renderer when this component validates. The\n\t\t * available properties depend on which <code>ITextRenderer</code>\n\t\t * implementation is returned by <code>accessoryLabelFactory</code>.\n\t\t * Refer to <a href=\"../../core/ITextRenderer.html\"><code>feathers.core.ITextRenderer</code></a>\n\t\t * for a list of available text renderer implementations.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>accessoryLabelFactory</code>\n\t\t * function instead of using <code>accessoryLabelProperties</code> will\n\t\t * result in better performance.</p>\n\t\t *\n\t\t * <p>In the following example, the accessory label properties are customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.&#64;accessoryLabelProperties.textFormat = new TextFormat( \"Source Sans Pro\", 16, 0x333333 );\n\t\t * renderer.&#64;accessoryLabelProperties.embedFonts = true;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.ITextRenderer\n\t\t * @see #accessoryLabelFactory\n\t\t * @see #accessoryLabelField\n\t\t * @see #accessoryLabelFunction\n\t\t */\n\t\tpublic function get accessoryLabelProperties():Object\n\t\t{\n\t\t\tif(!this._accessoryLabelProperties)\n\t\t\t{\n\t\t\t\tthis._accessoryLabelProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._accessoryLabelProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set accessoryLabelProperties(value:Object):void\n\t\t{\n\t\t\tif(this._accessoryLabelProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._accessoryLabelProperties)\n\t\t\t{\n\t\t\t\tthis._accessoryLabelProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._accessoryLabelProperties = PropertyProxy(value);\n\t\t\tif(this._accessoryLabelProperties)\n\t\t\t{\n\t\t\t\tthis._accessoryLabelProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _skinLoaderFactory:Function = defaultLoaderFactory;\n\n\t\t/**\n\t\t * A function that generates an <code>ImageLoader</code> that uses the result\n\t\t * of <code>skinSourceField</code> or <code>skinSourceFunction</code>.\n\t\t * Useful for transforming the <code>ImageLoader</code> in some way. For\n\t\t * example, you might want to scale the texture for current screen\n\t\t * density or apply pixel snapping.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function():ImageLoader</pre>\n\t\t *\n\t\t * <p>In the following example, the loader factory is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.skinLoaderFactory = function():ImageLoader\n\t\t * {\n\t\t *    var loader:ImageLoader = new ImageLoader();\n\t\t *    loader.scaleFactor = 2;\n\t\t *    return loader;\n\t\t * };</listing>\n\t\t *\n\t\t * @default function():ImageLoader { return new ImageLoader(); }\n\t\t *\n\t\t * @see feathers.controls.ImageLoader\n\t\t * @see #skinSourceField\n\t\t * @see #skinSourceFunction\n\t\t */\n\t\tpublic function get skinLoaderFactory():Function\n\t\t{\n\t\t\treturn this._skinLoaderFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set skinLoaderFactory(value:Function):void\n\t\t{\n\t\t\tif(this._skinLoaderFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._skinLoaderFactory = value;\n\t\t\tthis._skinIsFromItem = false;\n\t\t\tthis.replaceSkin(null);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _ignoreAccessoryResizes:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _topOffset:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _rightOffset:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _bottomOffset:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _leftOffset:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this._iconIsFromItem)\n\t\t\t{\n\t\t\t\tthis.replaceIcon(null);\n\t\t\t}\n\t\t\tif(this._accessoryIsFromItem)\n\t\t\t{\n\t\t\t\tthis.replaceAccessory(null);\n\t\t\t}\n\t\t\tif(this._skinIsFromItem)\n\t\t\t{\n\t\t\t\tthis.replaceSkin(null);\n\t\t\t}\n\t\t\tif(this._iconLabelFontStylesSet !== null)\n\t\t\t{\n\t\t\t\tthis._iconLabelFontStylesSet.dispose();\n\t\t\t\tthis._iconLabelFontStylesSet = null;\n\t\t\t}\n\t\t\tif(this._accessoryLabelFontStylesSet !== null)\n\t\t\t{\n\t\t\t\tthis._accessoryLabelFontStylesSet.dispose();\n\t\t\t\tthis._accessoryLabelFontStylesSet = null;\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * Using <code>labelField</code> and <code>labelFunction</code>,\n\t\t * generates a label from the item.\n\t\t *\n\t\t * <p>All of the label fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>labelFunction</code></li>\n\t\t *     <li><code>labelField</code></li>\n\t\t * </ol>\n\t\t */\n\t\tpublic function itemToLabel(item:Object):String\n\t\t{\n\t\t\tif(this._labelFunction !== null)\n\t\t\t{\n\t\t\t\tvar labelResult:Object;\n\t\t\t\tif(this is IListItemRenderer && this._labelFunction.length == 2)\n\t\t\t\t{\n\t\t\t\t\tlabelResult = this._labelFunction(item, IListItemRenderer(this).index);\n\t\t\t\t}\n\t\t\t\telse if(this is IGroupedListItemRenderer && this._labelFunction.length == 3)\n\t\t\t\t{\n\t\t\t\t\tvar groupItemRenderer:IGroupedListItemRenderer = IGroupedListItemRenderer(this);\n\t\t\t\t\tlabelResult = this._labelFunction(item, groupItemRenderer.groupIndex, groupItemRenderer.itemIndex);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tlabelResult = this._labelFunction(item);\n\t\t\t\t}\n\t\t\t\tif(labelResult is String)\n\t\t\t\t{\n\t\t\t\t\treturn labelResult as String;\n\t\t\t\t}\n\t\t\t\telse if(labelResult !== null)\n\t\t\t\t{\n\t\t\t\t\treturn labelResult.toString();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(this._labelField !== null && item !== null && item.hasOwnProperty(this._labelField))\n\t\t\t{\n\t\t\t\tlabelResult = item[this._labelField];\n\t\t\t\tif(labelResult is String)\n\t\t\t\t{\n\t\t\t\t\treturn labelResult as String;\n\t\t\t\t}\n\t\t\t\telse if(labelResult !== null)\n\t\t\t\t{\n\t\t\t\t\treturn labelResult.toString();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(item is String)\n\t\t\t{\n\t\t\t\treturn item as String;\n\t\t\t}\n\t\t\telse if(item !== null)\n\t\t\t{\n\t\t\t\t//we need to use strict equality here because the data can be\n\t\t\t\t//non-strictly equal to null\n\t\t\t\treturn item.toString();\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * Uses the icon fields and functions to generate an icon for a specific\n\t\t * item.\n\t\t *\n\t\t * <p>All of the icon fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>iconSourceFunction</code></li>\n\t\t *     <li><code>iconSourceField</code></li>\n\t\t *     <li><code>iconLabelFunction</code></li>\n\t\t *     <li><code>iconLabelField</code></li>\n\t\t *     <li><code>iconFunction</code></li>\n\t\t *     <li><code>iconField</code></li>\n\t\t * </ol>\n\t\t */\n\t\tprotected function itemToIcon(item:Object):DisplayObject\n\t\t{\n\t\t\tif(this._iconSourceFunction !== null)\n\t\t\t{\n\t\t\t\tvar source:Object;\n\t\t\t\tif(this is IListItemRenderer && this._iconSourceFunction.length == 2)\n\t\t\t\t{\n\t\t\t\t\tsource = this._iconSourceFunction(item, IListItemRenderer(this).index);\n\t\t\t\t}\n\t\t\t\telse if(this is IGroupedListItemRenderer && this._iconSourceFunction.length == 3)\n\t\t\t\t{\n\t\t\t\t\tvar groupItemRenderer:IGroupedListItemRenderer = IGroupedListItemRenderer(this);\n\t\t\t\t\tsource = this._iconSourceFunction(item, groupItemRenderer.groupIndex, groupItemRenderer.itemIndex);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tsource = this._iconSourceFunction(item);\n\t\t\t\t}\n\t\t\t\tthis.refreshIconSource(source);\n\t\t\t\treturn this.iconLoader;\n\t\t\t}\n\t\t\telse if(this._iconSourceField !== null && item !== null && item.hasOwnProperty(this._iconSourceField))\n\t\t\t{\n\t\t\t\tsource = item[this._iconSourceField];\n\t\t\t\tthis.refreshIconSource(source);\n\t\t\t\treturn this.iconLoader;\n\t\t\t}\n\t\t\telse if(this._iconLabelFunction !== null)\n\t\t\t{\n\t\t\t\tvar labelResult:Object;\n\t\t\t\tif(this is IListItemRenderer && this._iconLabelFunction.length == 2)\n\t\t\t\t{\n\t\t\t\t\tlabelResult = this._iconLabelFunction(item, IListItemRenderer(this).index);\n\t\t\t\t}\n\t\t\t\telse if(this is IGroupedListItemRenderer && this._iconLabelFunction.length == 3)\n\t\t\t\t{\n\t\t\t\t\tgroupItemRenderer = IGroupedListItemRenderer(this);\n\t\t\t\t\tlabelResult = this._iconLabelFunction(item, groupItemRenderer.groupIndex, groupItemRenderer.itemIndex);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tlabelResult = this._iconLabelFunction(item);\n\t\t\t\t}\n\t\t\t\tif(labelResult is String)\n\t\t\t\t{\n\t\t\t\t\tthis.refreshIconLabel(labelResult as String);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.refreshIconLabel(labelResult.toString());\n\t\t\t\t}\n\t\t\t\treturn DisplayObject(this.iconLabel);\n\t\t\t}\n\t\t\telse if(this._iconLabelField !== null && item !== null && item.hasOwnProperty(this._iconLabelField))\n\t\t\t{\n\t\t\t\tlabelResult = item[this._iconLabelField];\n\t\t\t\tif(labelResult is String)\n\t\t\t\t{\n\t\t\t\t\tthis.refreshIconLabel(labelResult as String);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.refreshIconLabel(labelResult.toString());\n\t\t\t\t}\n\t\t\t\treturn DisplayObject(this.iconLabel);\n\t\t\t}\n\t\t\telse if(this._iconFunction !== null)\n\t\t\t{\n\t\t\t\tif(this is IListItemRenderer && this._iconFunction.length == 2)\n\t\t\t\t{\n\t\t\t\t\treturn this._iconFunction(item, IListItemRenderer(this).index) as DisplayObject;\n\t\t\t\t}\n\t\t\t\telse if(this is IGroupedListItemRenderer && this._iconFunction.length == 3)\n\t\t\t\t{\n\t\t\t\t\tgroupItemRenderer = IGroupedListItemRenderer(this);\n\t\t\t\t\treturn this._iconFunction(item, groupItemRenderer.groupIndex, groupItemRenderer.itemIndex) as DisplayObject;\n\t\t\t\t}\n\t\t\t\treturn this._iconFunction(item) as DisplayObject;\n\t\t\t}\n\t\t\telse if(this._iconField !== null && item !== null && item.hasOwnProperty(this._iconField))\n\t\t\t{\n\t\t\t\treturn item[this._iconField] as DisplayObject;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * Uses the accessory fields and functions to generate an accessory for\n\t\t * a specific item.\n\t\t *\n\t\t * <p>All of the accessory fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>accessorySourceFunction</code></li>\n\t\t *     <li><code>accessorySourceField</code></li>\n\t\t *     <li><code>accessoryLabelFunction</code></li>\n\t\t *     <li><code>accessoryLabelField</code></li>\n\t\t *     <li><code>accessoryFunction</code></li>\n\t\t *     <li><code>accessoryField</code></li>\n\t\t * </ol>\n\t\t */\n\t\tprotected function itemToAccessory(item:Object):DisplayObject\n\t\t{\n\t\t\tif(this._accessorySourceFunction !== null)\n\t\t\t{\n\t\t\t\tvar source:Object;\n\t\t\t\tif(this is IListItemRenderer && this._accessorySourceFunction.length == 2)\n\t\t\t\t{\n\t\t\t\t\tsource = this._accessorySourceFunction(item, IListItemRenderer(this).index);\n\t\t\t\t}\n\t\t\t\telse if(this is IGroupedListItemRenderer && this._accessorySourceFunction.length == 3)\n\t\t\t\t{\n\t\t\t\t\tvar groupItemRenderer:IGroupedListItemRenderer = IGroupedListItemRenderer(this);\n\t\t\t\t\tsource = this._accessorySourceFunction(item, groupItemRenderer.groupIndex, groupItemRenderer.itemIndex);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tsource = this._accessorySourceFunction(item);\n\t\t\t\t}\n\t\t\t\tthis.refreshAccessorySource(source);\n\t\t\t\treturn this.accessoryLoader;\n\t\t\t}\n\t\t\telse if(this._accessorySourceField !== null && item !== null && item.hasOwnProperty(this._accessorySourceField))\n\t\t\t{\n\t\t\t\tsource = item[this._accessorySourceField];\n\t\t\t\tthis.refreshAccessorySource(source);\n\t\t\t\treturn this.accessoryLoader;\n\t\t\t}\n\t\t\telse if(this._accessoryLabelFunction !== null)\n\t\t\t{\n\t\t\t\tvar labelResult:Object;\n\t\t\t\tif(this is IListItemRenderer && this._accessoryLabelFunction.length == 2)\n\t\t\t\t{\n\t\t\t\t\tlabelResult = this._accessoryLabelFunction(item, IListItemRenderer(this).index);\n\t\t\t\t}\n\t\t\t\telse if(this is IGroupedListItemRenderer && this._accessoryLabelFunction.length == 3)\n\t\t\t\t{\n\t\t\t\t\tgroupItemRenderer = IGroupedListItemRenderer(this);\n\t\t\t\t\tlabelResult = this._accessoryLabelFunction(item, groupItemRenderer.groupIndex, groupItemRenderer.itemIndex);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tlabelResult = this._accessoryLabelFunction(item);\n\t\t\t\t}\n\t\t\t\tif(labelResult is String)\n\t\t\t\t{\n\t\t\t\t\tthis.refreshAccessoryLabel(labelResult as String);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.refreshAccessoryLabel(labelResult.toString());\n\t\t\t\t}\n\t\t\t\treturn DisplayObject(this.accessoryLabel);\n\t\t\t}\n\t\t\telse if(this._accessoryLabelField !== null && item !== null && item.hasOwnProperty(this._accessoryLabelField))\n\t\t\t{\n\t\t\t\tlabelResult = item[this._accessoryLabelField];\n\t\t\t\tif(labelResult is String)\n\t\t\t\t{\n\t\t\t\t\tthis.refreshAccessoryLabel(labelResult as String);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.refreshAccessoryLabel(labelResult.toString());\n\t\t\t\t}\n\t\t\t\treturn DisplayObject(this.accessoryLabel);\n\t\t\t}\n\t\t\telse if(this._accessoryFunction !== null)\n\t\t\t{\n\t\t\t\tif(this is IListItemRenderer && this._accessoryFunction.length == 2)\n\t\t\t\t{\n\t\t\t\t\treturn this._accessoryFunction(item, IListItemRenderer(this).index) as DisplayObject;\n\t\t\t\t}\n\t\t\t\telse if(this is IGroupedListItemRenderer && this._accessoryFunction.length == 3)\n\t\t\t\t{\n\t\t\t\t\tgroupItemRenderer = IGroupedListItemRenderer(this);\n\t\t\t\t\treturn this._accessoryFunction(item, groupItemRenderer.groupIndex, groupItemRenderer.itemIndex) as DisplayObject;\n\t\t\t\t}\n\t\t\t\treturn this._accessoryFunction(item) as DisplayObject;\n\t\t\t}\n\t\t\telse if(this._accessoryField !== null && item !== null && item.hasOwnProperty(this._accessoryField))\n\t\t\t{\n\t\t\t\treturn item[this._accessoryField] as DisplayObject;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * Uses the skin fields and functions to generate a skin for a specific\n\t\t * item.\n\t\t *\n\t\t * <p>All of the skin fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>skinSourceFunction</code></li>\n\t\t *     <li><code>skinSourceField</code></li>\n\t\t *     <li><code>skinFunction</code></li>\n\t\t *     <li><code>skinField</code></li>\n\t\t * </ol>\n\t\t */\n\t\tprotected function itemToSkin(item:Object):DisplayObject\n\t\t{\n\t\t\tif(this._skinSourceFunction !== null)\n\t\t\t{\n\t\t\t\tvar source:Object;\n\t\t\t\tif(this is IListItemRenderer && this._skinSourceFunction.length == 2)\n\t\t\t\t{\n\t\t\t\t\tsource = this._skinSourceFunction(item, IListItemRenderer(this).index);\n\t\t\t\t}\n\t\t\t\telse if(this is IGroupedListItemRenderer && this._skinSourceFunction.length == 3)\n\t\t\t\t{\n\t\t\t\t\tvar groupItemRenderer:IGroupedListItemRenderer = IGroupedListItemRenderer(this);\n\t\t\t\t\tsource = this._skinSourceFunction(item, groupItemRenderer.groupIndex, groupItemRenderer.itemIndex);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tsource = this._skinSourceFunction(item);\n\t\t\t\t}\n\t\t\t\tthis.refreshSkinSource(source);\n\t\t\t\treturn this.skinLoader;\n\t\t\t}\n\t\t\telse if(this._skinSourceField !== null && item !== null && item.hasOwnProperty(this._skinSourceField))\n\t\t\t{\n\t\t\t\tsource = item[this._skinSourceField];\n\t\t\t\tthis.refreshSkinSource(source);\n\t\t\t\treturn this.skinLoader;\n\t\t\t}\n\t\t\telse if(this._skinFunction !== null)\n\t\t\t{\n\t\t\t\tif(this is IListItemRenderer && this._skinFunction.length == 2)\n\t\t\t\t{\n\t\t\t\t\treturn this._skinFunction(item, IListItemRenderer(this).index) as DisplayObject;\n\t\t\t\t}\n\t\t\t\telse if(this is IGroupedListItemRenderer && this._skinFunction.length == 3)\n\t\t\t\t{\n\t\t\t\t\tgroupItemRenderer = IGroupedListItemRenderer(this);\n\t\t\t\t\treturn this._skinFunction(item, groupItemRenderer.groupIndex, groupItemRenderer.itemIndex) as DisplayObject;\n\t\t\t\t}\n\t\t\t\treturn this._skinFunction(item) as DisplayObject;\n\t\t\t}\n\t\t\telse if(this._skinField !== null && item !== null && item.hasOwnProperty(this._skinField))\n\t\t\t{\n\t\t\t\treturn item[this._skinField] as DisplayObject;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * Uses the selectable fields and functions to generate a selectable\n\t\t * value for a specific item.\n\t\t *\n\t\t * <p>All of the selectable fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>selectableFunction</code></li>\n\t\t *     <li><code>selectableField</code></li>\n\t\t * </ol>\n\t\t */\n\t\tprotected function itemToSelectable(item:Object):Boolean\n\t\t{\n\t\t\tif(this._selectableFunction !== null)\n\t\t\t{\n\t\t\t\tif(this is IListItemRenderer && this._selectableFunction.length == 2)\n\t\t\t\t{\n\t\t\t\t\treturn this._selectableFunction(item, IListItemRenderer(this).index) as Boolean;\n\t\t\t\t}\n\t\t\t\telse if(this is IGroupedListItemRenderer && this._selectableFunction.length == 3)\n\t\t\t\t{\n\t\t\t\t\tvar groupItemRenderer:IGroupedListItemRenderer = IGroupedListItemRenderer(this);\n\t\t\t\t\treturn this._selectableFunction(item, groupItemRenderer.groupIndex, groupItemRenderer.itemIndex) as Boolean;\n\t\t\t\t}\n\t\t\t\treturn this._selectableFunction(item) as Boolean;\n\t\t\t}\n\t\t\telse if(this._selectableField !== null && item !== null && item.hasOwnProperty(this._selectableField))\n\t\t\t{\n\t\t\t\treturn item[this._selectableField] as Boolean;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t * Uses the enabled fields and functions to generate a enabled value for\n\t\t * a specific item.\n\t\t *\n\t\t * <p>All of the enabled fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>enabledFunction</code></li>\n\t\t *     <li><code>enabledField</code></li>\n\t\t * </ol>\n\t\t */\n\t\tprotected function itemToEnabled(item:Object):Boolean\n\t\t{\n\t\t\tif(this._enabledFunction !== null)\n\t\t\t{\n\t\t\t\tif(this is IListItemRenderer && this._enabledFunction.length == 2)\n\t\t\t\t{\n\t\t\t\t\treturn this._enabledFunction(item, IListItemRenderer(this).index) as Boolean;\n\t\t\t\t}\n\t\t\t\telse if(this is IGroupedListItemRenderer && this._enabledFunction.length == 3)\n\t\t\t\t{\n\t\t\t\t\tvar groupItemRenderer:IGroupedListItemRenderer = IGroupedListItemRenderer(this);\n\t\t\t\t\treturn this._enabledFunction(item, groupItemRenderer.groupIndex, groupItemRenderer.itemIndex) as Boolean;\n\t\t\t\t}\n\t\t\t\treturn this._enabledFunction(item) as Boolean;\n\t\t\t}\n\t\t\telse if(this._enabledField !== null && item !== null && item.hasOwnProperty(this._enabledField))\n\t\t\t{\n\t\t\t\treturn item[this._enabledField] as Boolean;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t * Gets the font styles to be used to display the item renderer's icon\n\t\t * label text when the item renderer's <code>currentState</code>\n\t\t * property matches the specified state value.\n\t\t *\n\t\t * <p>If icon label font styles are not defined for a specific state,\n\t\t * returns <code>null</code>.</p>\n\t\t *\n\t\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t\t * @see #setIconLabelFontStylesForState()\n\t\t * @see #iconLabelFontStyles\n\t\t */\n\t\tpublic function getIconLabelFontStylesForState(state:String):TextFormat\n\t\t{\n\t\t\tif(this._iconLabelFontStylesSet === null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn this._iconLabelFontStylesSet.getFormatForState(state);\n\t\t}\n\n\t\t/**\n\t\t * Sets the font styles to be used to display the icon label's text when\n\t\t * the item renderer's <code>currentState</code> property matches the\n\t\t * specified state value.\n\t\t *\n\t\t * <p>If font styles are not defined for a specific state, the value of\n\t\t * the <code>iconLabelFontStyles</code> property will be used instead.</p>\n\t\t *\n\t\t * <p>Note: if the text renderer has been customized with advanced font\n\t\t * formatting, it may override the values specified with\n\t\t * <code>setIconLabelFontStylesForState()</code> and properties like\n\t\t * <code>iconLabelFontStyles</code> and\n\t\t * <code>disabledIconLabelFontStyles</code>.</p>\n\t\t *\n\t\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t\t * @see #iconLabelFontStyles\n\t\t */\n\t\tpublic function setIconLabelFontStylesForState(state:String, format:TextFormat):void\n\t\t{\n\t\t\tvar key:String = \"setIconLabelFontStylesForState--\" + state;\n\t\t\tif(this.processStyleRestriction(key))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(key);\n\t\t\t}\n\t\t\tvar oldFormat:TextFormat = this._iconLabelFontStylesSet.getFormatForState(state);\n\t\t\tif(oldFormat !== null)\n\t\t\t{\n\t\t\t\toldFormat.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._iconLabelFontStylesSet.setFormatForState(state, format);\n\t\t\tif(format !== null)\n\t\t\t{\n\t\t\t\tformat.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Gets the font styles to be used to display the item renderer's\n\t\t * accessory label text when the item renderer's\n\t\t * <code>currentState</code> property matches the specified state value.\n\t\t *\n\t\t * <p>If icon label font styles are not defined for a specific state,\n\t\t * returns <code>null</code>.</p>\n\t\t *\n\t\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t\t * @see #setAccessoryLabelFontStylesForState()\n\t\t * @see #accessoryLabelfontStyles\n\t\t */\n\t\tpublic function getAccessoryLabelFontStylesForState(state:String):TextFormat\n\t\t{\n\t\t\tif(this._accessoryLabelFontStylesSet === null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn this._accessoryLabelFontStylesSet.getFormatForState(state);\n\t\t}\n\n\t\t/**\n\t\t * Sets the font styles to be used to display the accessory label's text\n\t\t * when the item renderer's <code>currentState</code> property matches\n\t\t * the specified state value.\n\t\t *\n\t\t * <p>If font styles are not defined for a specific state, the value of\n\t\t * the <code>accessoryLabelFontStyles</code> property will be used instead.</p>\n\t\t *\n\t\t * <p>Note: if the text renderer has been customized with advanced font\n\t\t * formatting, it may override the values specified with\n\t\t * <code>setAccessoryLabelFontStylesForState()</code> and properties like\n\t\t * <code>accessoryLabelFontStyles</code> and\n\t\t * <code>disabledAccessoryLabelFontStyles</code>.</p>\n\t\t *\n\t\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t\t * @see #accessoryLabelFontStyles\n\t\t */\n\t\tpublic function setAccessoryLabelFontStylesForState(state:String, format:TextFormat):void\n\t\t{\n\t\t\tvar key:String = \"setAccessoryLabelFontStylesForState--\" + state;\n\t\t\tif(this.processStyleRestriction(key))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(key);\n\t\t\t}\n\t\t\tvar oldFormat:TextFormat = this._accessoryLabelFontStylesSet.getFormatForState(state);\n\t\t\tif(oldFormat !== null)\n\t\t\t{\n\t\t\t\toldFormat.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._accessoryLabelFontStylesSet.setFormatForState(state, format);\n\t\t\tif(format !== null)\n\t\t\t{\n\t\t\t\tformat.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Gets the accessory to be used by the item renderer when the item\n\t\t * renderer's <code>currentState</code> property matches the specified\n\t\t * state value.\n\t\t *\n\t\t * <p>If a accessory is not defined for a specific state, returns\n\t\t * <code>null</code>.</p>\n\t\t *\n\t\t * @see #setAccessoryForState()\n\t\t */\n\t\tpublic function getAccessoryForState(state:String):DisplayObject\n\t\t{\n\t\t\treturn this._stateToAccessory[state] as DisplayObject;\n\t\t}\n\n\t\t/**\n\t\t * Sets the accessory to be used by the item renderer when the item\n\t\t * renderer's <code>currentState</code> property matches the specified\n\t\t * state value.\n\t\t *\n\t\t * <p>If an accessory is not defined for a specific state, the value of\n\t\t * the <code>defaultAccessory</code> property will be used instead.</p>\n\t\t *\n\t\t * @see #defaultAccessory\n\t\t */\n\t\tpublic function setAccessoryForState(state:String, accessory:DisplayObject):void\n\t\t{\n\t\t\tif(accessory !== null)\n\t\t\t{\n\t\t\t\tthis._stateToAccessory[state] = accessory;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdelete this._stateToAccessory[state];\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tif(this.touchToState === null && this._useStateDelayTimer)\n\t\t\t{\n\t\t\t\tthis.touchToState = new DelayedDownTouchToState(this, this.changeState);\n\t\t\t}\n\t\t\tsuper.initialize();\n\t\t\tthis.tapToTrigger.customHitTest = this.hitTestWithAccessory;\n\t\t\tthis.tapToSelect.customHitTest = this.hitTestWithAccessory;\n\t\t\tthis.longPress.customHitTest = this.hitTestWithAccessory;\n\t\t\tthis.touchToState.customHitTest = this.hitTestWithAccessory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tif(dataInvalid)\n\t\t\t{\n\t\t\t\tthis.commitData();\n\t\t\t}\n\t\t\tif(stateInvalid || dataInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshAccessory();\n\t\t\t}\n\t\t\tthis.refreshOffsets();\n\t\t\tsuper.draw();\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\toverride protected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvar oldIgnoreAccessoryResizes:Boolean = this._ignoreAccessoryResizes;\n\t\t\tthis._ignoreAccessoryResizes = true;\n\t\t\tvar labelRenderer:ITextRenderer = null;\n\t\t\tif(this._label !== null && this.labelTextRenderer !== null)\n\t\t\t{\n\t\t\t\tlabelRenderer = this.labelTextRenderer;\n\t\t\t\tthis.refreshLabelTextRendererDimensions(true);\n\t\t\t\tthis.labelTextRenderer.measureText(HELPER_POINT);\n\t\t\t}\n\t\t\tif(this.currentIcon is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.currentIcon).validate();\n\t\t\t}\n\t\t\tif(this.currentAccessory is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.currentAccessory).validate();\n\t\t\t}\n\n\t\t\tresetFluidChildDimensionsForMeasurement(this.currentSkin,\n\t\t\t\tthis._explicitWidth, this._explicitHeight,\n\t\t\t\tthis._explicitMinWidth, this._explicitMinHeight,\n\t\t\t\tthis._explicitMaxWidth, this._explicitMaxHeight,\n\t\t\t\tthis._explicitSkinWidth, this._explicitSkinHeight,\n\t\t\t\tthis._explicitSkinMinWidth, this._explicitSkinMinHeight,\n\t\t\t\tthis._explicitSkinMaxWidth, this._explicitSkinMaxHeight);\n\t\t\tvar measureSkin:IMeasureDisplayObject = this.currentSkin as IMeasureDisplayObject;\n\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tif(labelRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = HELPER_POINT.x;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewWidth = 0;\n\t\t\t\t}\n\t\t\t\tif(this._layoutOrder === ItemRendererLayoutOrder.LABEL_ACCESSORY_ICON)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this.addAccessoryWidth(newWidth);\n\t\t\t\t\tnewWidth = this.addIconWidth(newWidth);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this.addIconWidth(newWidth);\n\t\t\t\t\tnewWidth = this.addAccessoryWidth(newWidth);\n\t\t\t\t}\n\t\t\t\tnewWidth += this._leftOffset + this._rightOffset;\n\t\t\t\tif(this.currentSkin !== null &&\n\t\t\t\t\tthis.currentSkin.width > newWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this.currentSkin.width;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tif(labelRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = HELPER_POINT.y;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewHeight = 0;\n\t\t\t\t}\n\t\t\t\tif(this._layoutOrder === ItemRendererLayoutOrder.LABEL_ACCESSORY_ICON)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this.addAccessoryHeight(newHeight);\n\t\t\t\t\tnewHeight = this.addIconHeight(newHeight);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this.addIconHeight(newHeight);\n\t\t\t\t\tnewHeight = this.addAccessoryHeight(newHeight);\n\t\t\t\t}\n\t\t\t\tnewHeight += this._topOffset + this._bottomOffset;\n\t\t\t\tif(this.currentSkin !== null &&\n\t\t\t\t\tthis.currentSkin.height > newHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this.currentSkin.height;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tif(labelRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = HELPER_POINT.x;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = 0;\n\t\t\t\t}\n\t\t\t\tif(this._layoutOrder === ItemRendererLayoutOrder.LABEL_ACCESSORY_ICON)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = this.addAccessoryWidth(newMinWidth);\n\t\t\t\t\tnewMinWidth = this.addIconWidth(newMinWidth);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = this.addIconWidth(newMinWidth);\n\t\t\t\t\tnewMinWidth = this.addAccessoryWidth(newMinWidth);\n\t\t\t\t}\n\t\t\t\tnewMinWidth += this._leftOffset + this._rightOffset;\n\t\t\t\tif(this.currentSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(measureSkin !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(measureSkin.minWidth > newMinWidth)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinWidth = measureSkin.minWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._explicitSkinMinWidth > newMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = this._explicitSkinMinWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tif(labelRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = HELPER_POINT.y;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = 0;\n\t\t\t\t}\n\t\t\t\tif(this._layoutOrder === ItemRendererLayoutOrder.LABEL_ACCESSORY_ICON)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = this.addAccessoryHeight(newMinHeight);\n\t\t\t\t\tnewMinHeight = this.addIconHeight(newMinHeight);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = this.addIconHeight(newMinHeight);\n\t\t\t\t\tnewMinHeight = this.addAccessoryHeight(newMinHeight);\n\t\t\t\t}\n\t\t\t\tnewMinHeight += this._topOffset + this._bottomOffset;\n\t\t\t\tif(this.currentSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(measureSkin !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(measureSkin.minHeight > newMinHeight)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinHeight = measureSkin.minHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._explicitSkinMinHeight > newMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = this._explicitSkinMinHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._ignoreAccessoryResizes = oldIgnoreAccessoryResizes;\n\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function changeState(value:String):void\n\t\t{\n\t\t\tif(this._isEnabled && !this._isToggle &&\n\t\t\t\t(!this.isSelectableWithoutToggle || (this._itemHasSelectable && !this.itemToSelectable(this._data))))\n\t\t\t{\n\t\t\t\tvalue = ButtonState.UP;\n\t\t\t}\n\t\t\tsuper.changeState(value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function addIconWidth(width:Number):Number\n\t\t{\n\t\t\tif(!this.currentIcon)\n\t\t\t{\n\t\t\t\treturn width;\n\t\t\t}\n\t\t\tvar iconWidth:Number = this.currentIcon.width;\n\t\t\tif(iconWidth !== iconWidth) //isNaN\n\t\t\t{\n\t\t\t\treturn width;\n\t\t\t}\n\n\t\t\tvar hasPreviousItem:Boolean = width === width; //!isNaN\n\t\t\tif(!hasPreviousItem)\n\t\t\t{\n\t\t\t\twidth = 0;\n\t\t\t}\n\n\t\t\tif(this._iconPosition == RelativePosition.LEFT || this._iconPosition == RelativePosition.LEFT_BASELINE || this._iconPosition == RelativePosition.RIGHT || this._iconPosition == RelativePosition.RIGHT_BASELINE)\n\t\t\t{\n\t\t\t\tif(hasPreviousItem)\n\t\t\t\t{\n\t\t\t\t\tvar adjustedGap:Number = this._gap;\n\t\t\t\t\tif(this._gap == Number.POSITIVE_INFINITY)\n\t\t\t\t\t{\n\t\t\t\t\t\tadjustedGap = this._minGap;\n\t\t\t\t\t}\n\t\t\t\t\twidth += adjustedGap;\n\t\t\t\t}\n\t\t\t\twidth += iconWidth;\n\t\t\t}\n\t\t\telse if(iconWidth > width)\n\t\t\t{\n\t\t\t\twidth = iconWidth;\n\t\t\t}\n\t\t\treturn width;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function addAccessoryWidth(width:Number):Number\n\t\t{\n\t\t\tif(!this.currentAccessory)\n\t\t\t{\n\t\t\t\treturn width;\n\t\t\t}\n\t\t\tvar accessoryWidth:Number = this.currentAccessory.width;\n\t\t\tif(accessoryWidth !== accessoryWidth) //isNaN\n\t\t\t{\n\t\t\t\treturn width;\n\t\t\t}\n\n\t\t\tvar hasPreviousItem:Boolean = width === width; //!isNaN;\n\t\t\tif(!hasPreviousItem)\n\t\t\t{\n\t\t\t\twidth = 0;\n\t\t\t}\n\n\t\t\tif(this._accessoryPosition == RelativePosition.LEFT || this._accessoryPosition == RelativePosition.RIGHT)\n\t\t\t{\n\t\t\t\tif(hasPreviousItem)\n\t\t\t\t{\n\t\t\t\t\tvar adjustedAccessoryGap:Number = this._accessoryGap;\n\t\t\t\t\t//for some reason, if we do the !== check on a local variable right\n\t\t\t\t\t//here, compiling with the flex 4.6 SDK will throw a VerifyError\n\t\t\t\t\t//for a stack overflow.\n\t\t\t\t\t//we could change the !== check back to isNaN() instead, but\n\t\t\t\t\t//isNaN() can allocate an object that needs garbage collection.\n\t\t\t\t\tif(this._accessoryGap !== this._accessoryGap) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\tadjustedAccessoryGap = this._gap;\n\t\t\t\t\t}\n\t\t\t\t\tif(adjustedAccessoryGap == Number.POSITIVE_INFINITY)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._minAccessoryGap !== this._minAccessoryGap) //isNaN\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tadjustedAccessoryGap = this._minGap;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tadjustedAccessoryGap = this._minAccessoryGap;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\twidth += adjustedAccessoryGap;\n\t\t\t\t}\n\t\t\t\twidth += accessoryWidth;\n\t\t\t}\n\t\t\telse if(accessoryWidth > width)\n\t\t\t{\n\t\t\t\twidth = accessoryWidth;\n\t\t\t}\n\t\t\treturn width;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function addIconHeight(height:Number):Number\n\t\t{\n\t\t\tif(this.currentIcon === null)\n\t\t\t{\n\t\t\t\treturn height;\n\t\t\t}\n\t\t\tvar iconHeight:Number = this.currentIcon.height;\n\t\t\tif(iconHeight !== iconHeight) //isNaN\n\t\t\t{\n\t\t\t\treturn height;\n\t\t\t}\n\n\t\t\tvar hasPreviousItem:Boolean = height === height; //!isNaN\n\t\t\tif(!hasPreviousItem)\n\t\t\t{\n\t\t\t\theight = 0;\n\t\t\t}\n\n\t\t\tif(this._iconPosition === RelativePosition.TOP || this._iconPosition === RelativePosition.BOTTOM)\n\t\t\t{\n\t\t\t\tif(hasPreviousItem)\n\t\t\t\t{\n\t\t\t\t\tvar adjustedGap:Number = this._gap;\n\t\t\t\t\tif(this._gap == Number.POSITIVE_INFINITY)\n\t\t\t\t\t{\n\t\t\t\t\t\tadjustedGap = this._minGap;\n\t\t\t\t\t}\n\t\t\t\t\theight += adjustedGap;\n\t\t\t\t}\n\t\t\t\theight += iconHeight;\n\t\t\t}\n\t\t\telse if(iconHeight > height)\n\t\t\t{\n\t\t\t\theight = iconHeight;\n\t\t\t}\n\t\t\treturn height;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function addAccessoryHeight(height:Number):Number\n\t\t{\n\t\t\tif(this.currentAccessory === null)\n\t\t\t{\n\t\t\t\treturn height;\n\t\t\t}\n\t\t\tvar accessoryHeight:Number = this.currentAccessory.height;\n\t\t\tif(accessoryHeight !== accessoryHeight) //isNaN\n\t\t\t{\n\t\t\t\treturn height;\n\t\t\t}\n\n\t\t\tvar hasPreviousItem:Boolean = height === height; //!isNaN\n\t\t\tif(!hasPreviousItem)\n\t\t\t{\n\t\t\t\theight = 0;\n\t\t\t}\n\n\t\t\tif(this._accessoryPosition === RelativePosition.TOP || this._accessoryPosition === RelativePosition.BOTTOM)\n\t\t\t{\n\t\t\t\tif(hasPreviousItem)\n\t\t\t\t{\n\t\t\t\t\tvar adjustedAccessoryGap:Number = this._accessoryGap;\n\t\t\t\t\t//for some reason, if we do the !== check on a local variable right\n\t\t\t\t\t//here, compiling with the flex 4.6 SDK will throw a VerifyError\n\t\t\t\t\t//for a stack overflow.\n\t\t\t\t\t//we could change the !== check back to isNaN() instead, but\n\t\t\t\t\t//isNaN() can allocate an object that needs garbage collection.\n\t\t\t\t\tif(this._accessoryGap !== this._accessoryGap) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\tadjustedAccessoryGap = this._gap;\n\t\t\t\t\t}\n\t\t\t\t\tif(adjustedAccessoryGap == Number.POSITIVE_INFINITY)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._minAccessoryGap !== this._minAccessoryGap) //isNaN\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tadjustedAccessoryGap = this._minGap;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tadjustedAccessoryGap = this._minAccessoryGap;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\theight += adjustedAccessoryGap;\n\t\t\t\t}\n\t\t\t\theight += accessoryHeight;\n\t\t\t}\n\t\t\telse if(accessoryHeight > height)\n\t\t\t{\n\t\t\t\theight = accessoryHeight;\n\t\t\t}\n\t\t\treturn height;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getDataToRender():Object\n\t\t{\n\t\t\treturn this._data;\n\t\t}\n\n\t\t/**\n\t\t * Updates the renderer to display the item's data. Override this\n\t\t * function to pass data to sub-components and react to data changes.\n\t\t *\n\t\t * <p>Don't forget to handle the case where the data is <code>null</code>.</p>\n\t\t */\n\t\tprotected function commitData():void\n\t\t{\n\t\t\tvar dataToRender:Object = this.getDataToRender();\n\t\t\t//we need to use strict equality here because the data can be\n\t\t\t//non-strictly equal to null\n\t\t\tif(dataToRender !== null)\n\t\t\t{\n\t\t\t\tif(this._itemHasLabel)\n\t\t\t\t{\n\t\t\t\t\tthis._label = this.itemToLabel(dataToRender);\n\t\t\t\t\t//we don't need to invalidate because the label setter\n\t\t\t\t\t//uses the same data invalidation flag that triggered this\n\t\t\t\t\t//call to commitData(), so we're already properly invalid.\n\t\t\t\t}\n\t\t\t\tif(this._itemHasSkin)\n\t\t\t\t{\n\t\t\t\t\tvar newSkin:DisplayObject = this.itemToSkin(dataToRender);\n\t\t\t\t\tthis._skinIsFromItem = newSkin != null;\n\t\t\t\t\tthis.replaceSkin(newSkin);\n\t\t\t\t}\n\t\t\t\telse if(this._skinIsFromItem)\n\t\t\t\t{\n\t\t\t\t\tthis._skinIsFromItem = false;\n\t\t\t\t\tthis.replaceSkin(null);\n\t\t\t\t}\n\t\t\t\tif(this._itemHasIcon)\n\t\t\t\t{\n\t\t\t\t\tvar newIcon:DisplayObject = this.itemToIcon(dataToRender);\n\t\t\t\t\tthis._iconIsFromItem = newIcon != null;\n\t\t\t\t\tthis.replaceIcon(newIcon);\n\t\t\t\t}\n\t\t\t\telse if(this._iconIsFromItem)\n\t\t\t\t{\n\t\t\t\t\tthis._iconIsFromItem = false;\n\t\t\t\t\tthis.replaceIcon(null);\n\t\t\t\t}\n\t\t\t\tif(this._itemHasAccessory)\n\t\t\t\t{\n\t\t\t\t\tvar newAccessory:DisplayObject = this.itemToAccessory(dataToRender);\n\t\t\t\t\tthis._accessoryIsFromItem = newAccessory != null;\n\t\t\t\t\tthis.replaceAccessory(newAccessory);\n\t\t\t\t}\n\t\t\t\telse if(this._accessoryIsFromItem)\n\t\t\t\t{\n\t\t\t\t\tthis._accessoryIsFromItem = false;\n\t\t\t\t\tthis.replaceAccessory(null);\n\t\t\t\t}\n\t\t\t\tif(this._itemHasSelectable)\n\t\t\t\t{\n\t\t\t\t\tthis._isToggle = this._explicitIsToggle && this.itemToSelectable(dataToRender);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._isToggle = this._explicitIsToggle;\n\t\t\t\t}\n\t\t\t\tif(this._itemHasEnabled)\n\t\t\t\t{\n\t\t\t\t\tthis.refreshIsEnabled(this._explicitIsEnabled && this.itemToEnabled(dataToRender));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.refreshIsEnabled(this._explicitIsEnabled);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(this._itemHasLabel)\n\t\t\t\t{\n\t\t\t\t\tthis._label = \"\";\n\t\t\t\t}\n\t\t\t\tif(this._itemHasIcon || this._iconIsFromItem)\n\t\t\t\t{\n\t\t\t\t\tthis._iconIsFromItem = false;\n\t\t\t\t\tthis.replaceIcon(null);\n\t\t\t\t}\n\t\t\t\tif(this._itemHasSkin || this._skinIsFromItem)\n\t\t\t\t{\n\t\t\t\t\tthis._skinIsFromItem = false;\n\t\t\t\t\tthis.replaceSkin(null);\n\t\t\t\t}\n\t\t\t\tif(this._itemHasAccessory || this._accessoryIsFromItem)\n\t\t\t\t{\n\t\t\t\t\tthis._accessoryIsFromItem = false;\n\t\t\t\t\tthis.replaceAccessory(null);\n\t\t\t\t}\n\t\t\t\tif(this._itemHasSelectable)\n\t\t\t\t{\n\t\t\t\t\tthis._isToggle = this._explicitIsToggle;\n\t\t\t\t}\n\t\t\t\tif(this._itemHasEnabled)\n\t\t\t\t{\n\t\t\t\t\tthis.refreshIsEnabled(this._explicitIsEnabled);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshIsEnabled(value:Boolean):void\n\t\t{\n\t\t\tif(this._isEnabled == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isEnabled = value;\n\t\t\tif(this._isEnabled)\n\t\t\t{\n\t\t\t\t//might be in another state for some reason\n\t\t\t\t//let's only change to up if needed\n\t\t\t\tif(this._currentState == ButtonState.DISABLED)\n\t\t\t\t{\n\t\t\t\t\tthis._currentState = ButtonState.UP;\n\t\t\t\t}\n\t\t\t\tthis.touchable = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._currentState = ButtonState.DISABLED;\n\t\t\t\tthis.touchable = false;\n\t\t\t}\n\t\t\tthis.setInvalidationFlag(INVALIDATION_FLAG_STATE);\n\t\t\tthis.dispatchEventWith(FeathersEventType.STATE_CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function replaceIcon(newIcon:DisplayObject):void\n\t\t{\n\t\t\tif(this.iconLoader && this.iconLoader != newIcon)\n\t\t\t{\n\t\t\t\tthis.iconLoader.removeEventListener(Event.COMPLETE, loader_completeOrErrorHandler);\n\t\t\t\tthis.iconLoader.removeEventListener(FeathersEventType.ERROR, loader_completeOrErrorHandler);\n\t\t\t\tthis.iconLoader.dispose();\n\t\t\t\tthis.iconLoader = null;\n\t\t\t}\n\n\t\t\tif(this.iconLabel && this.iconLabel != newIcon)\n\t\t\t{\n\t\t\t\t//we can dispose this one, though, since we created it\n\t\t\t\tthis.iconLabel.dispose();\n\t\t\t\tthis.iconLabel = null;\n\t\t\t}\n\n\t\t\tif(this._itemHasIcon && this.currentIcon && this.currentIcon != newIcon && this.currentIcon.parent == this)\n\t\t\t{\n\t\t\t\t//the icon is created using the data provider, and it is not\n\t\t\t\t//created inside this class, so it is not our responsibility to\n\t\t\t\t//dispose the icon. if we dispose it, it may break something.\n\t\t\t\tthis.currentIcon.removeFromParent(false);\n\t\t\t\tthis.currentIcon = null;\n\t\t\t}\n\t\t\t//we're using currentIcon above, but we're emulating calling the\n\t\t\t//defaultIcon setter here. the Button class sets the currentIcon\n\t\t\t//elsewhere, so we want to take advantage of that exisiting code.\n\n\t\t\t//we're not calling the defaultIcon setter directly because we're in\n\t\t\t//the middle of validating, and it will just invalidate, which will\n\t\t\t//require another validation later. we want the Button class to\n\t\t\t//process the new icon immediately when we call super.draw().\n\t\t\tif(this._defaultIcon !== newIcon)\n\t\t\t{\n\t\t\t\tthis._defaultIcon = newIcon;\n\t\t\t\t//we don't need to do a full invalidation. the superclass will\n\t\t\t\t//correctly see this flag when we call super.draw().\n\t\t\t\tthis.setInvalidationFlag(INVALIDATION_FLAG_STYLES);\n\t\t\t}\n\n\t\t\tif(this.iconLoader !== null)\n\t\t\t{\n\t\t\t\tthis.iconLoader.delayTextureCreation = this._delayTextureCreationOnScroll && this._owner !== null && this._owner.isScrolling;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function replaceAccessory(newAccessory:DisplayObject):void\n\t\t{\n\t\t\tif(this.accessoryLoader && this.accessoryLoader != newAccessory)\n\t\t\t{\n\t\t\t\tthis.accessoryLoader.removeEventListener(Event.COMPLETE, loader_completeOrErrorHandler);\n\t\t\t\tthis.accessoryLoader.removeEventListener(FeathersEventType.ERROR, loader_completeOrErrorHandler);\n\t\t\t\tthis.accessoryLoader.dispose();\n\t\t\t\tthis.accessoryLoader = null;\n\t\t\t}\n\n\t\t\tif(this.accessoryLabel && this.accessoryLabel != newAccessory)\n\t\t\t{\n\t\t\t\t//we can dispose this one, though, since we created it\n\t\t\t\tthis.accessoryLabel.dispose();\n\t\t\t\tthis.accessoryLabel = null;\n\t\t\t}\n\n\t\t\tif(this._itemHasAccessory && this.currentAccessory && this.currentAccessory != newAccessory && this.currentAccessory.parent == this)\n\t\t\t{\n\t\t\t\t//the icon is created using the data provider, and it is not\n\t\t\t\t//created inside this class, so it is not our responsibility to\n\t\t\t\t//dispose the icon. if we dispose it, it may break something.\n\t\t\t\tthis.currentAccessory.removeFromParent(false);\n\t\t\t\tthis.currentAccessory = null;\n\t\t\t}\n\t\t\t//we're using currentIcon above, but we're emulating calling the\n\t\t\t//defaultIcon setter here. the Button class sets the currentIcon\n\t\t\t//elsewhere, so we want to take advantage of that exisiting code.\n\n\t\t\t//we're not calling the defaultIcon setter directly because we're in\n\t\t\t//the middle of validating, and it will just invalidate, which will\n\t\t\t//require another validation later. we want the Button class to\n\t\t\t//process the new icon immediately when we call super.draw().\n\t\t\tif(this._defaultAccessory !== newAccessory)\n\t\t\t{\n\t\t\t\tthis._defaultAccessory = newAccessory;\n\t\t\t\t//we don't need to do a full invalidation. the superclass will\n\t\t\t\t//correctly see this flag when we call super.draw().\n\t\t\t\tthis.setInvalidationFlag(INVALIDATION_FLAG_STYLES);\n\t\t\t}\n\n\t\t\tif(this.accessoryLoader !== null)\n\t\t\t{\n\t\t\t\tthis.accessoryLoader.delayTextureCreation = this._delayTextureCreationOnScroll && this._owner !== null && this._owner.isScrolling;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function replaceSkin(newSkin:DisplayObject):void\n\t\t{\n\t\t\tif(this.skinLoader && this.skinLoader != newSkin)\n\t\t\t{\n\t\t\t\tthis.skinLoader.removeEventListener(Event.COMPLETE, loader_completeOrErrorHandler);\n\t\t\t\tthis.skinLoader.removeEventListener(FeathersEventType.ERROR, loader_completeOrErrorHandler);\n\t\t\t\tthis.skinLoader.dispose();\n\t\t\t\tthis.skinLoader = null;\n\t\t\t}\n\n\t\t\tif(this._itemHasSkin && this.currentSkin && this.currentSkin != newSkin && this.currentSkin.parent == this)\n\t\t\t{\n\t\t\t\t//the icon is created using the data provider, and it is not\n\t\t\t\t//created inside this class, so it is not our responsibility to\n\t\t\t\t//dispose the icon. if we dispose it, it may break something.\n\t\t\t\tthis.currentSkin.removeFromParent(false);\n\t\t\t\tthis.currentSkin = null;\n\t\t\t}\n\t\t\t//we're using currentIcon above, but we're emulating calling the\n\t\t\t//defaultIcon setter here. the Button class sets the currentIcon\n\t\t\t//elsewhere, so we want to take advantage of that exisiting code.\n\n\t\t\t//we're not calling the defaultSkin setter directly because we're in\n\t\t\t//the middle of validating, and it will just invalidate, which will\n\t\t\t//require another validation later. we want the Button class to\n\t\t\t//process the new skin immediately when we call super.draw().\n\t\t\tif(this._defaultSkin !== newSkin)\n\t\t\t{\n\t\t\t\tthis._defaultSkin = newSkin;\n\t\t\t\t//we don't need to do a full invalidation. the superclass will\n\t\t\t\t//correctly see this flag when we call super.draw().\n\t\t\t\tthis.setInvalidationFlag(INVALIDATION_FLAG_STYLES);\n\t\t\t}\n\n\t\t\tif(this.skinLoader !== null)\n\t\t\t{\n\t\t\t\tthis.skinLoader.delayTextureCreation = this._delayTextureCreationOnScroll && this._owner !== null && this._owner.isScrolling;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function refreshIcon():void\n\t\t{\n\t\t\tsuper.refreshIcon();\n\t\t\tif(this.iconLabel !== null)\n\t\t\t{\n\t\t\t\tthis.iconLabel.fontStyles = this._iconLabelFontStylesSet;\n\t\t\t\tvar displayIconLabel:DisplayObject = DisplayObject(this.iconLabel);\n\t\t\t\tfor(var propertyName:String in this._iconLabelProperties)\n\t\t\t\t{\n\t\t\t\t\tvar propertyValue:Object = this._iconLabelProperties[propertyName];\n\t\t\t\t\tdisplayIconLabel[propertyName] = propertyValue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshAccessory():void\n\t\t{\n\t\t\tvar oldAccessory:DisplayObject = this.currentAccessory;\n\t\t\tthis.currentAccessory = this.getCurrentAccessory();\n\t\t\tif(this.currentAccessory is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this.currentAccessory).isEnabled = this._isEnabled;\n\t\t\t}\n\t\t\tif(this.currentAccessory != oldAccessory)\n\t\t\t{\n\t\t\t\tif(oldAccessory)\n\t\t\t\t{\n\t\t\t\t\tif(oldAccessory is IStateObserver)\n\t\t\t\t\t{\n\t\t\t\t\t\tIStateObserver(oldAccessory).stateContext = null;\n\t\t\t\t\t}\n\t\t\t\t\tif(oldAccessory is IFeathersControl)\n\t\t\t\t\t{\n\t\t\t\t\t\tIFeathersControl(oldAccessory).removeEventListener(FeathersEventType.RESIZE, accessory_resizeHandler);\n\t\t\t\t\t\tIFeathersControl(oldAccessory).removeEventListener(TouchEvent.TOUCH, accessory_touchHandler);\n\t\t\t\t\t}\n\t\t\t\t\tthis.removeChild(oldAccessory, false);\n\t\t\t\t}\n\t\t\t\tif(this.currentAccessory)\n\t\t\t\t{\n\t\t\t\t\tif(this.currentAccessory is IStateObserver)\n\t\t\t\t\t{\n\t\t\t\t\t\tIStateObserver(this.currentAccessory).stateContext = this;\n\t\t\t\t\t}\n\t\t\t\t\tthis.addChild(this.currentAccessory);\n\t\t\t\t\tif(this.currentAccessory is IFeathersControl)\n\t\t\t\t\t{\n\t\t\t\t\t\tIFeathersControl(this.currentAccessory).addEventListener(FeathersEventType.RESIZE, accessory_resizeHandler);\n\t\t\t\t\t\tIFeathersControl(this.currentAccessory).addEventListener(TouchEvent.TOUCH, accessory_touchHandler);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this.accessoryLabel !== null)\n\t\t\t{\n\t\t\t\tthis.accessoryLabel.fontStyles = this._accessoryLabelFontStylesSet;\n\t\t\t\tvar displayAccessoryLabel:DisplayObject = DisplayObject(this.accessoryLabel);\n\t\t\t\tfor(var propertyName:String in this._accessoryLabelProperties)\n\t\t\t\t{\n\t\t\t\t\tvar propertyValue:Object = this._accessoryLabelProperties[propertyName];\n\t\t\t\t\tdisplayAccessoryLabel[propertyName] = propertyValue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getCurrentAccessory():DisplayObject\n\t\t{\n\t\t\t//we use the currentState getter here instead of the variable\n\t\t\t//because the variable does not keep track of the selection\n\t\t\tvar result:DisplayObject = this._stateToAccessory[this.currentState] as DisplayObject;\n\t\t\tif(result !== null)\n\t\t\t{\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\treturn this._defaultAccessory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshIconSource(source:Object):void\n\t\t{\n\t\t\tif(!this.iconLoader)\n\t\t\t{\n\t\t\t\tthis.iconLoader = this._iconLoaderFactory();\n\t\t\t\tthis.iconLoader.addEventListener(Event.COMPLETE, loader_completeOrErrorHandler);\n\t\t\t\tthis.iconLoader.addEventListener(Event.IO_ERROR, loader_completeOrErrorHandler);\n\t\t\t\tthis.iconLoader.addEventListener(Event.SECURITY_ERROR, loader_completeOrErrorHandler);\n\t\t\t\tvar iconLoaderStyleName:String = this._customIconLoaderStyleName != null ? this._customIconLoaderStyleName : this.iconLoaderStyleName;\n\t\t\t\tthis.iconLoader.styleNameList.add(iconLoaderStyleName);\n\t\t\t}\n\t\t\tthis.iconLoader.source = source;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshIconLabel(label:String):void\n\t\t{\n\t\t\tif(this.iconLabel === null)\n\t\t\t{\n\t\t\t\tvar factory:Function = this._iconLabelFactory != null ? this._iconLabelFactory : FeathersControl.defaultTextRendererFactory;\n\t\t\t\tthis.iconLabel = ITextRenderer(factory());\n\t\t\t\tif(this.iconLabel is IStateObserver)\n\t\t\t\t{\n\t\t\t\t\tIStateObserver(this.iconLabel).stateContext = this;\n\t\t\t\t}\n\t\t\t\tvar iconLabelStyleName:String = this._customIconLabelStyleName != null ? this._customIconLabelStyleName : this.iconLabelStyleName;\n\t\t\t\tthis.iconLabel.styleNameList.add(iconLabelStyleName);\n\t\t\t}\n\t\t\tthis.iconLabel.text = label;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshAccessorySource(source:Object):void\n\t\t{\n\t\t\tif(!this.accessoryLoader)\n\t\t\t{\n\t\t\t\tthis.accessoryLoader = this._accessoryLoaderFactory();\n\t\t\t\tthis.accessoryLoader.addEventListener(Event.COMPLETE, loader_completeOrErrorHandler);\n\t\t\t\tthis.accessoryLoader.addEventListener(Event.IO_ERROR, loader_completeOrErrorHandler);\n\t\t\t\tthis.accessoryLoader.addEventListener(Event.SECURITY_ERROR, loader_completeOrErrorHandler);\n\t\t\t\tvar accessoryLoaderStyleName:String = this._customAccessoryLoaderStyleName != null ? this._customAccessoryLoaderStyleName : this.accessoryLoaderStyleName;\n\t\t\t\tthis.accessoryLoader.styleNameList.add(accessoryLoaderStyleName);\n\t\t\t}\n\t\t\tthis.accessoryLoader.source = source;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshAccessoryLabel(label:String):void\n\t\t{\n\t\t\tif(this.accessoryLabel === null)\n\t\t\t{\n\t\t\t\tvar factory:Function = this._accessoryLabelFactory != null ? this._accessoryLabelFactory : FeathersControl.defaultTextRendererFactory;\n\t\t\t\tthis.accessoryLabel = ITextRenderer(factory());\n\t\t\t\tif(this.accessoryLabel is IStateObserver)\n\t\t\t\t{\n\t\t\t\t\tIStateObserver(this.accessoryLabel).stateContext = this;\n\t\t\t\t}\n\t\t\t\tvar accessoryLabelStyleName:String = this._customAccessoryLabelStyleName != null ? this._customAccessoryLabelStyleName : this.accessoryLabelStyleName;\n\t\t\t\tthis.accessoryLabel.styleNameList.add(accessoryLabelStyleName);\n\t\t\t}\n\t\t\tthis.accessoryLabel.text = label;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshSkinSource(source:Object):void\n\t\t{\n\t\t\tif(!this.skinLoader)\n\t\t\t{\n\t\t\t\tthis.skinLoader = this._skinLoaderFactory();\n\t\t\t\tthis.skinLoader.addEventListener(Event.COMPLETE, loader_completeOrErrorHandler);\n\t\t\t\tthis.skinLoader.addEventListener(FeathersEventType.ERROR, loader_completeOrErrorHandler);\n\t\t\t}\n\t\t\tthis.skinLoader.source = source;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function layoutContent():void\n\t\t{\n\t\t\tvar oldIgnoreAccessoryResizes:Boolean = this._ignoreAccessoryResizes;\n\t\t\tthis._ignoreAccessoryResizes = true;\n\t\t\tvar oldIgnoreIconResizes:Boolean = this._ignoreIconResizes;\n\t\t\tthis._ignoreIconResizes = true;\n\t\t\tthis.refreshLabelTextRendererDimensions(false);\n\t\t\tvar labelRenderer:DisplayObject = null;\n\t\t\tif(this._label !== null && this.labelTextRenderer !== null)\n\t\t\t{\n\t\t\t\tlabelRenderer = DisplayObject(this.labelTextRenderer);\n\t\t\t}\n\t\t\tvar iconIsInLayout:Boolean = this.currentIcon && this._iconPosition != RelativePosition.MANUAL;\n\t\t\tvar accessoryIsInLayout:Boolean = this.currentAccessory && this._accessoryPosition != RelativePosition.MANUAL;\n\t\t\tvar accessoryGap:Number = this._accessoryGap;\n\t\t\tif(accessoryGap !== accessoryGap) //isNaN\n\t\t\t{\n\t\t\t\taccessoryGap = this._gap;\n\t\t\t}\n\t\t\tif(labelRenderer && iconIsInLayout && accessoryIsInLayout)\n\t\t\t{\n\t\t\t\tthis.positionSingleChild(labelRenderer);\n\t\t\t\tif(this._layoutOrder == ItemRendererLayoutOrder.LABEL_ACCESSORY_ICON)\n\t\t\t\t{\n\t\t\t\t\tthis.positionRelativeToOthers(this.currentAccessory, labelRenderer, null, this._accessoryPosition, accessoryGap, null, 0);\n\t\t\t\t\tvar iconPosition:String = this._iconPosition;\n\t\t\t\t\tif(iconPosition == RelativePosition.LEFT_BASELINE)\n\t\t\t\t\t{\n\t\t\t\t\t\ticonPosition = RelativePosition.LEFT;\n\t\t\t\t\t}\n\t\t\t\t\telse if(iconPosition == RelativePosition.RIGHT_BASELINE)\n\t\t\t\t\t{\n\t\t\t\t\t\ticonPosition = RelativePosition.RIGHT;\n\t\t\t\t\t}\n\t\t\t\t\tthis.positionRelativeToOthers(this.currentIcon, labelRenderer, this.currentAccessory, iconPosition, this._gap, this._accessoryPosition, accessoryGap);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.positionLabelAndIcon();\n\t\t\t\t\tthis.positionRelativeToOthers(this.currentAccessory, labelRenderer, this.currentIcon, this._accessoryPosition, accessoryGap, this._iconPosition, this._gap);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(labelRenderer)\n\t\t\t{\n\t\t\t\tthis.positionSingleChild(labelRenderer);\n\t\t\t\t//we won't position both the icon and accessory here, otherwise\n\t\t\t\t//we would have gone into the previous conditional\n\t\t\t\tif(iconIsInLayout)\n\t\t\t\t{\n\t\t\t\t\tthis.positionLabelAndIcon();\n\t\t\t\t}\n\t\t\t\telse if(accessoryIsInLayout)\n\t\t\t\t{\n\t\t\t\t\tthis.positionRelativeToOthers(this.currentAccessory, labelRenderer, null, this._accessoryPosition, accessoryGap, null, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(iconIsInLayout)\n\t\t\t{\n\t\t\t\tthis.positionSingleChild(this.currentIcon);\n\t\t\t\tif(accessoryIsInLayout)\n\t\t\t\t{\n\t\t\t\t\tthis.positionRelativeToOthers(this.currentAccessory, this.currentIcon, null, this._accessoryPosition, accessoryGap, null, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(accessoryIsInLayout)\n\t\t\t{\n\t\t\t\tthis.positionSingleChild(this.currentAccessory);\n\t\t\t}\n\n\t\t\tif(this.currentAccessory)\n\t\t\t{\n\t\t\t\tif(!accessoryIsInLayout)\n\t\t\t\t{\n\t\t\t\t\tthis.currentAccessory.x = this._leftOffset;\n\t\t\t\t\tthis.currentAccessory.y = this._topOffset;\n\t\t\t\t}\n\t\t\t\tthis.currentAccessory.x += this._accessoryOffsetX;\n\t\t\t\tthis.currentAccessory.y += this._accessoryOffsetY;\n\t\t\t}\n\t\t\tif(this.currentIcon)\n\t\t\t{\n\t\t\t\tif(!iconIsInLayout)\n\t\t\t\t{\n\t\t\t\t\tthis.currentIcon.x = this._leftOffset;\n\t\t\t\t\tthis.currentIcon.y = this._topOffset;\n\t\t\t\t}\n\t\t\t\tthis.currentIcon.x += this._iconOffsetX;\n\t\t\t\tthis.currentIcon.y += this._iconOffsetY;\n\t\t\t}\n\t\t\tif(labelRenderer)\n\t\t\t{\n\t\t\t\tthis.labelTextRenderer.x += this._labelOffsetX;\n\t\t\t\tthis.labelTextRenderer.y += this._labelOffsetY;\n\t\t\t}\n\t\t\tthis._ignoreIconResizes = oldIgnoreIconResizes;\n\t\t\tthis._ignoreAccessoryResizes = oldIgnoreAccessoryResizes;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshOffsets():void\n\t\t{\n\t\t\tthis._topOffset = this._paddingTop;\n\t\t\tthis._rightOffset = this._paddingRight;\n\t\t\tthis._bottomOffset = this._paddingBottom;\n\t\t\tthis._leftOffset = this._paddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function refreshLabelTextRendererDimensions(forMeasurement:Boolean):void\n\t\t{\n\t\t\tvar oldIgnoreIconResizes:Boolean = this._ignoreIconResizes;\n\t\t\tthis._ignoreIconResizes = true;\n\t\t\tvar calculatedWidth:Number = this.actualWidth;\n\t\t\tif(forMeasurement)\n\t\t\t{\n\t\t\t\tcalculatedWidth = this._explicitWidth;\n\t\t\t\tif(calculatedWidth !== calculatedWidth) //isNaN\n\t\t\t\t{\n\t\t\t\t\tcalculatedWidth = this._explicitMaxWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcalculatedWidth -= (this._leftOffset + this._rightOffset);\n\t\t\tvar calculatedHeight:Number = this.actualHeight;\n\t\t\tif(forMeasurement)\n\t\t\t{\n\t\t\t\tcalculatedHeight = this._explicitHeight;\n\t\t\t\tif(calculatedHeight !== calculatedHeight) //isNaN\n\t\t\t\t{\n\t\t\t\t\tcalculatedHeight = this._explicitMaxHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcalculatedHeight -= (this._topOffset + this._bottomOffset);\n\n\t\t\tvar adjustedGap:Number = this._gap;\n\t\t\tif(adjustedGap == Number.POSITIVE_INFINITY)\n\t\t\t{\n\t\t\t\tadjustedGap = this._minGap;\n\t\t\t}\n\t\t\tvar adjustedAccessoryGap:Number = this._accessoryGap;\n\t\t\tif(adjustedAccessoryGap !== adjustedAccessoryGap) //isNaN\n\t\t\t{\n\t\t\t\tadjustedAccessoryGap = this._gap;\n\t\t\t}\n\t\t\tif(adjustedAccessoryGap == Number.POSITIVE_INFINITY)\n\t\t\t{\n\t\t\t\tadjustedAccessoryGap = this._minAccessoryGap;\n\t\t\t\tif(adjustedAccessoryGap !== adjustedAccessoryGap) //isNaN\n\t\t\t\t{\n\t\t\t\t\tadjustedAccessoryGap = this._minGap;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar hasIconToLeftOrRight:Boolean = this.currentIcon && (this._iconPosition == RelativePosition.LEFT || this._iconPosition == RelativePosition.LEFT_BASELINE ||\n\t\t\t\tthis._iconPosition == RelativePosition.RIGHT || this._iconPosition == RelativePosition.RIGHT_BASELINE);\n\t\t\tvar hasIconToTopOrBottom:Boolean = this.currentIcon && (this._iconPosition == RelativePosition.TOP || this._iconPosition == RelativePosition.BOTTOM);\n\t\t\tvar hasAccessoryToLeftOrRight:Boolean = this.currentAccessory && (this._accessoryPosition == RelativePosition.LEFT || this._accessoryPosition == RelativePosition.RIGHT);\n\t\t\tvar hasAccessoryToTopOrBottom:Boolean = this.currentAccessory && (this._accessoryPosition == RelativePosition.TOP || this._accessoryPosition == RelativePosition.BOTTOM);\n\n\t\t\tif(this.accessoryLabel)\n\t\t\t{\n\t\t\t\tvar iconAffectsAccessoryLabelMaxWidth:Boolean = hasIconToLeftOrRight &&\n\t\t\t\t\t(hasAccessoryToLeftOrRight || this._layoutOrder === ItemRendererLayoutOrder.LABEL_ACCESSORY_ICON);\n\t\t\t\tif(this.iconLabel)\n\t\t\t\t{\n\t\t\t\t\tthis.iconLabel.maxWidth = calculatedWidth - adjustedGap;\n\t\t\t\t\tif(this.iconLabel.maxWidth < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.iconLabel.maxWidth = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this.currentIcon is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this.currentIcon).validate();\n\t\t\t\t}\n\t\t\t\tif(iconAffectsAccessoryLabelMaxWidth)\n\t\t\t\t{\n\t\t\t\t\tcalculatedWidth -= (this.currentIcon.width + adjustedGap);\n\t\t\t\t}\n\t\t\t\tif(calculatedWidth < 0)\n\t\t\t\t{\n\t\t\t\t\tcalculatedWidth = 0;\n\t\t\t\t}\n\t\t\t\tthis.accessoryLabel.maxWidth = calculatedWidth;\n\t\t\t\tthis.accessoryLabel.maxHeight = calculatedHeight;\n\t\t\t\tif(hasIconToLeftOrRight && this.currentIcon && !iconAffectsAccessoryLabelMaxWidth)\n\t\t\t\t{\n\t\t\t\t\tcalculatedWidth -= (this.currentIcon.width + adjustedGap);\n\t\t\t\t}\n\t\t\t\tif(this.currentAccessory is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this.currentAccessory).validate();\n\t\t\t\t}\n\t\t\t\tif(hasAccessoryToLeftOrRight)\n\t\t\t\t{\n\t\t\t\t\tcalculatedWidth -= (this.currentAccessory.width + adjustedAccessoryGap);\n\t\t\t\t}\n\t\t\t\tif(hasAccessoryToTopOrBottom)\n\t\t\t\t{\n\t\t\t\t\tcalculatedHeight -= (this.currentAccessory.height + adjustedAccessoryGap);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(this.iconLabel)\n\t\t\t{\n\t\t\t\tvar accessoryAffectsIconLabelMaxWidth:Boolean = hasAccessoryToLeftOrRight &&\n\t\t\t\t\t(hasIconToLeftOrRight || this._layoutOrder === ItemRendererLayoutOrder.LABEL_ICON_ACCESSORY);\n\t\t\t\tif(this.currentAccessory is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this.currentAccessory).validate();\n\t\t\t\t}\n\t\t\t\tif(accessoryAffectsIconLabelMaxWidth)\n\t\t\t\t{\n\t\t\t\t\tcalculatedWidth -= (adjustedAccessoryGap + this.currentAccessory.width);\n\t\t\t\t}\n\t\t\t\tif(calculatedWidth < 0)\n\t\t\t\t{\n\t\t\t\t\tcalculatedWidth = 0;\n\t\t\t\t}\n\t\t\t\tthis.iconLabel.maxWidth = calculatedWidth;\n\t\t\t\tthis.iconLabel.maxHeight = calculatedHeight;\n\t\t\t\tif(hasAccessoryToLeftOrRight && this.currentAccessory && !accessoryAffectsIconLabelMaxWidth)\n\t\t\t\t{\n\t\t\t\t\tcalculatedWidth -= (adjustedAccessoryGap + this.currentAccessory.width);\n\t\t\t\t}\n\t\t\t\tif(this.currentIcon is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this.currentIcon).validate();\n\t\t\t\t}\n\t\t\t\tif(hasIconToLeftOrRight)\n\t\t\t\t{\n\t\t\t\t\tcalculatedWidth -= (this.currentIcon.width + adjustedGap);\n\t\t\t\t}\n\t\t\t\tif(hasIconToTopOrBottom)\n\t\t\t\t{\n\t\t\t\t\tcalculatedHeight -= (this.currentIcon.height + adjustedGap);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(this.currentIcon is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this.currentIcon).validate();\n\t\t\t\t}\n\t\t\t\tif(hasIconToLeftOrRight)\n\t\t\t\t{\n\t\t\t\t\tcalculatedWidth -= (adjustedGap + this.currentIcon.width);\n\t\t\t\t}\n\t\t\t\tif(hasIconToTopOrBottom)\n\t\t\t\t{\n\t\t\t\t\tcalculatedHeight -= (adjustedGap + this.currentIcon.height);\n\t\t\t\t}\n\t\t\t\tif(this.currentAccessory is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this.currentAccessory).validate();\n\t\t\t\t}\n\t\t\t\tif(hasAccessoryToLeftOrRight)\n\t\t\t\t{\n\t\t\t\t\tcalculatedWidth -= (adjustedAccessoryGap + this.currentAccessory.width);\n\t\t\t\t}\n\t\t\t\tif(hasAccessoryToTopOrBottom)\n\t\t\t\t{\n\t\t\t\t\tcalculatedHeight -= (adjustedAccessoryGap + this.currentAccessory.height);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(calculatedWidth < 0)\n\t\t\t{\n\t\t\t\tcalculatedWidth = 0;\n\t\t\t}\n\t\t\tif(calculatedHeight < 0)\n\t\t\t{\n\t\t\t\tcalculatedHeight = 0;\n\t\t\t}\n\t\t\tif(calculatedWidth > this._explicitLabelMaxWidth)\n\t\t\t{\n\t\t\t\tcalculatedWidth = this._explicitLabelMaxWidth;\n\t\t\t}\n\t\t\tif(calculatedHeight > this._explicitLabelMaxHeight)\n\t\t\t{\n\t\t\t\tcalculatedHeight = this._explicitLabelMaxHeight;\n\t\t\t}\n\t\t\tif(this.labelTextRenderer !== null)\n\t\t\t{\n\t\t\t\tthis.labelTextRenderer.width = this._explicitLabelWidth;\n\t\t\t\tthis.labelTextRenderer.height = this._explicitLabelHeight;\n\t\t\t\tthis.labelTextRenderer.minWidth = this._explicitLabelMinWidth;\n\t\t\t\tthis.labelTextRenderer.minHeight = this._explicitLabelMinHeight;\n\t\t\t\tthis.labelTextRenderer.maxWidth = calculatedWidth;\n\t\t\t\tthis.labelTextRenderer.maxHeight = calculatedHeight;\n\t\t\t\tthis.labelTextRenderer.validate();\n\t\t\t\tif(!forMeasurement)\n\t\t\t\t{\n\t\t\t\t\tcalculatedWidth = this.labelTextRenderer.width;\n\t\t\t\t\tcalculatedHeight = this.labelTextRenderer.height;\n\t\t\t\t\t//setting all of these dimensions explicitly means that the\n\t\t\t\t\t//text renderer won't measure itself again when it\n\t\t\t\t\t//validates, which helps performance. we'll reset them when\n\t\t\t\t\t//the item renderer needs to measure itself.\n\t\t\t\t\tthis.labelTextRenderer.width = calculatedWidth;\n\t\t\t\t\tthis.labelTextRenderer.height = calculatedHeight;\n\t\t\t\t\tthis.labelTextRenderer.minWidth = calculatedWidth;\n\t\t\t\t\tthis.labelTextRenderer.minHeight = calculatedHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._ignoreIconResizes = oldIgnoreIconResizes;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function positionSingleChild(displayObject:DisplayObject):void\n\t\t{\n\t\t\tif(this._horizontalAlign === HorizontalAlign.LEFT)\n\t\t\t{\n\t\t\t\tdisplayObject.x = this._leftOffset;\n\t\t\t}\n\t\t\telse if(this._horizontalAlign === HorizontalAlign.RIGHT)\n\t\t\t{\n\t\t\t\tdisplayObject.x = this.actualWidth - this._rightOffset - displayObject.width;\n\t\t\t}\n\t\t\telse //center\n\t\t\t{\n\t\t\t\tdisplayObject.x = this._leftOffset + Math.round((this.actualWidth - this._leftOffset - this._rightOffset - displayObject.width) / 2);\n\t\t\t}\n\t\t\tif(this._verticalAlign === VerticalAlign.TOP)\n\t\t\t{\n\t\t\t\tdisplayObject.y = this._topOffset;\n\t\t\t}\n\t\t\telse if(this._verticalAlign === VerticalAlign.BOTTOM)\n\t\t\t{\n\t\t\t\tdisplayObject.y = this.actualHeight - this._bottomOffset - displayObject.height;\n\t\t\t}\n\t\t\telse //middle\n\t\t\t{\n\t\t\t\tdisplayObject.y = this._topOffset + Math.round((this.actualHeight - this._topOffset - this._bottomOffset - displayObject.height) / 2);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function positionRelativeToOthers(object:DisplayObject, relativeTo:DisplayObject, relativeTo2:DisplayObject, position:String, gap:Number, otherPosition:String, otherGap:Number):void\n\t\t{\n\t\t\tvar relativeToX:Number = relativeTo.x;\n\t\t\tif(relativeTo2 !== null && relativeTo2.x < relativeToX)\n\t\t\t{\n\t\t\t\trelativeToX = relativeTo2.x;\n\t\t\t}\n\t\t\tvar relativeToY:Number = relativeTo.y;\n\t\t\tif(relativeTo2 !== null && relativeTo2.y < relativeToY)\n\t\t\t{\n\t\t\t\trelativeToY = relativeTo2.y;\n\t\t\t}\n\t\t\tvar relativeToWidth:Number = relativeTo.width;\n\t\t\tif(relativeTo2 !== null)\n\t\t\t{\n\t\t\t\trelativeToWidth = relativeTo.x + relativeTo.width;\n\t\t\t\tvar relativeToWidth2:Number = relativeTo2.x + relativeTo2.width;\n\t\t\t\tif(relativeToWidth2 > relativeToWidth)\n\t\t\t\t{\n\t\t\t\t\trelativeToWidth = relativeToWidth2;\n\t\t\t\t}\n\t\t\t\trelativeToWidth -= relativeToX;\n\t\t\t}\n\t\t\tvar relativeToHeight:Number = relativeTo.height;\n\t\t\tif(relativeTo2 !== null)\n\t\t\t{\n\t\t\t\trelativeToHeight = relativeTo.y + relativeTo.height;\n\t\t\t\tvar relativeToHeight2:Number = relativeTo2.y + relativeTo2.height;\n\t\t\t\tif(relativeToHeight2 > relativeToHeight)\n\t\t\t\t{\n\t\t\t\t\trelativeToHeight = relativeToHeight2;\n\t\t\t\t}\n\t\t\t\trelativeToHeight -= relativeToY;\n\t\t\t}\n\t\t\tvar newRelativeToX:Number = relativeToX;\n\t\t\tvar newRelativeToY:Number = relativeToY;\n\t\t\tif(position == RelativePosition.TOP)\n\t\t\t{\n\t\t\t\tif(gap == Number.POSITIVE_INFINITY)\n\t\t\t\t{\n\t\t\t\t\tobject.y = this._topOffset;\n\t\t\t\t\tnewRelativeToY = this.actualHeight - this._bottomOffset - relativeToHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(this._verticalAlign == VerticalAlign.TOP)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewRelativeToY += object.height + gap;\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._verticalAlign == VerticalAlign.MIDDLE)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewRelativeToY += Math.round((object.height + gap) / 2);\n\t\t\t\t\t}\n\t\t\t\t\tif(relativeTo2 != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar newRelativeToY2:Number = this._topOffset + object.height + gap;\n\t\t\t\t\t\tif(newRelativeToY2 > newRelativeToY)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewRelativeToY = newRelativeToY2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tobject.y = newRelativeToY - object.height - gap;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(position == RelativePosition.RIGHT)\n\t\t\t{\n\t\t\t\tif(gap == Number.POSITIVE_INFINITY)\n\t\t\t\t{\n\t\t\t\t\tnewRelativeToX = this._leftOffset;\n\t\t\t\t\tobject.x = this.actualWidth - this._rightOffset - object.width;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(this._horizontalAlign == HorizontalAlign.RIGHT)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewRelativeToX -= (object.width + gap);\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._horizontalAlign == HorizontalAlign.CENTER)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewRelativeToX -= Math.round((object.width + gap) / 2);\n\t\t\t\t\t}\n\t\t\t\t\tif(relativeTo2 !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar newRelativeToX2:Number = this.actualWidth - this._rightOffset - object.width - relativeToWidth - gap;\n\t\t\t\t\t\tif(newRelativeToX2 < newRelativeToX)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewRelativeToX = newRelativeToX2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tobject.x = newRelativeToX + relativeToWidth + gap;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(position == RelativePosition.BOTTOM)\n\t\t\t{\n\t\t\t\tif(gap == Number.POSITIVE_INFINITY)\n\t\t\t\t{\n\t\t\t\t\tnewRelativeToY = this._topOffset;\n\t\t\t\t\tobject.y = this.actualHeight - this._bottomOffset - object.height;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(this._verticalAlign == VerticalAlign.BOTTOM)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewRelativeToY -= (object.height + gap);\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._verticalAlign == VerticalAlign.MIDDLE)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewRelativeToY -= Math.round((object.height + gap) / 2);\n\t\t\t\t\t}\n\t\t\t\t\tif(relativeTo2 !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewRelativeToY2 = this.actualHeight - this._bottomOffset - object.height - relativeToHeight - gap;\n\t\t\t\t\t\tif(newRelativeToY2 < newRelativeToY)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewRelativeToY = newRelativeToY2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tobject.y = newRelativeToY + relativeToHeight + gap;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(position == RelativePosition.LEFT)\n\t\t\t{\n\t\t\t\tif(gap == Number.POSITIVE_INFINITY)\n\t\t\t\t{\n\t\t\t\t\tobject.x = this._leftOffset;\n\t\t\t\t\tnewRelativeToX = this.actualWidth - this._rightOffset - relativeToWidth;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(this._horizontalAlign == HorizontalAlign.LEFT)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewRelativeToX += gap + object.width;\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._horizontalAlign == HorizontalAlign.CENTER)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewRelativeToX += Math.round((gap + object.width) / 2);\n\t\t\t\t\t}\n\t\t\t\t\tif(relativeTo2 !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewRelativeToX2 = this._leftOffset + object.width + gap;\n\t\t\t\t\t\tif(newRelativeToX2 > newRelativeToX)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewRelativeToX = newRelativeToX2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tobject.x = newRelativeToX - gap - object.width;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar offsetX:Number = newRelativeToX - relativeToX;\n\t\t\tvar offsetY:Number = newRelativeToY - relativeToY;\n\t\t\tif(!relativeTo2 || otherGap != Number.POSITIVE_INFINITY || !(\n\t\t\t\t(position == RelativePosition.TOP && otherPosition == RelativePosition.TOP) ||\n\t\t\t\t(position == RelativePosition.RIGHT && otherPosition == RelativePosition.RIGHT) ||\n\t\t\t\t(position == RelativePosition.BOTTOM && otherPosition == RelativePosition.BOTTOM) ||\n\t\t\t\t(position == RelativePosition.LEFT && otherPosition == RelativePosition.LEFT)\n\t\t\t))\n\t\t\t{\n\t\t\t\trelativeTo.x += offsetX;\n\t\t\t\trelativeTo.y += offsetY;\n\t\t\t}\n\t\t\tif(relativeTo2)\n\t\t\t{\n\t\t\t\tif(otherGap != Number.POSITIVE_INFINITY || !(\n\t\t\t\t\t(position == RelativePosition.LEFT && otherPosition == RelativePosition.RIGHT) ||\n\t\t\t\t\t(position == RelativePosition.RIGHT && otherPosition == RelativePosition.LEFT) ||\n\t\t\t\t\t(position == RelativePosition.TOP && otherPosition == RelativePosition.BOTTOM) ||\n\t\t\t\t\t(position == RelativePosition.BOTTOM && otherPosition == RelativePosition.TOP)\n\t\t\t\t))\n\t\t\t\t{\n\t\t\t\t\trelativeTo2.x += offsetX;\n\t\t\t\t\trelativeTo2.y += offsetY;\n\t\t\t\t}\n\t\t\t\tif(gap == Number.POSITIVE_INFINITY && otherGap == Number.POSITIVE_INFINITY)\n\t\t\t\t{\n\t\t\t\t\tif(position == RelativePosition.RIGHT && otherPosition == RelativePosition.LEFT)\n\t\t\t\t\t{\n\t\t\t\t\t\trelativeTo.x = relativeTo2.x + Math.round((object.x - relativeTo2.x + relativeTo2.width - relativeTo.width) / 2);\n\t\t\t\t\t}\n\t\t\t\t\telse if(position == RelativePosition.LEFT && otherPosition == RelativePosition.RIGHT)\n\t\t\t\t\t{\n\t\t\t\t\t\trelativeTo.x = object.x + Math.round((relativeTo2.x - object.x + object.width - relativeTo.width) / 2);\n\t\t\t\t\t}\n\t\t\t\t\telse if(position == RelativePosition.RIGHT && otherPosition == RelativePosition.RIGHT)\n\t\t\t\t\t{\n\t\t\t\t\t\trelativeTo2.x = relativeTo.x + Math.round((object.x - relativeTo.x + relativeTo.width - relativeTo2.width) / 2);\n\t\t\t\t\t}\n\t\t\t\t\telse if(position == RelativePosition.LEFT && otherPosition == RelativePosition.LEFT)\n\t\t\t\t\t{\n\t\t\t\t\t\trelativeTo2.x = object.x + Math.round((relativeTo.x - object.x + object.width - relativeTo2.width) / 2);\n\t\t\t\t\t}\n\t\t\t\t\telse if(position == RelativePosition.BOTTOM && otherPosition == RelativePosition.TOP)\n\t\t\t\t\t{\n\t\t\t\t\t\trelativeTo.y = relativeTo2.y + Math.round((object.y - relativeTo2.y + relativeTo2.height - relativeTo.height) / 2);\n\t\t\t\t\t}\n\t\t\t\t\telse if(position == RelativePosition.TOP && otherPosition == RelativePosition.BOTTOM)\n\t\t\t\t\t{\n\t\t\t\t\t\trelativeTo.y = object.y + Math.round((relativeTo2.y - object.y + object.height - relativeTo.height) / 2);\n\t\t\t\t\t}\n\t\t\t\t\telse if(position == RelativePosition.BOTTOM && otherPosition == RelativePosition.BOTTOM)\n\t\t\t\t\t{\n\t\t\t\t\t\trelativeTo2.y = relativeTo.y + Math.round((object.y - relativeTo.y + relativeTo.height - relativeTo2.height) / 2);\n\t\t\t\t\t}\n\t\t\t\t\telse if(position == RelativePosition.TOP && otherPosition == RelativePosition.TOP)\n\t\t\t\t\t{\n\t\t\t\t\t\trelativeTo2.y = object.y + Math.round((relativeTo.y - object.y + object.height - relativeTo2.height) / 2);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(position == RelativePosition.LEFT || position == RelativePosition.RIGHT)\n\t\t\t{\n\t\t\t\tif(this._verticalAlign == VerticalAlign.TOP)\n\t\t\t\t{\n\t\t\t\t\tobject.y = this._topOffset;\n\t\t\t\t}\n\t\t\t\telse if(this._verticalAlign == VerticalAlign.BOTTOM)\n\t\t\t\t{\n\t\t\t\t\tobject.y = this.actualHeight - this._bottomOffset - object.height;\n\t\t\t\t}\n\t\t\t\telse //middle\n\t\t\t\t{\n\t\t\t\t\tobject.y = this._topOffset + Math.round((this.actualHeight - this._topOffset - this._bottomOffset - object.height) / 2);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(position == RelativePosition.TOP || position == RelativePosition.BOTTOM)\n\t\t\t{\n\t\t\t\tif(this._horizontalAlign == HorizontalAlign.LEFT)\n\t\t\t\t{\n\t\t\t\t\tobject.x = this._leftOffset;\n\t\t\t\t}\n\t\t\t\telse if(this._horizontalAlign == HorizontalAlign.RIGHT)\n\t\t\t\t{\n\t\t\t\t\tobject.x = this.actualWidth - this._rightOffset - object.width;\n\t\t\t\t}\n\t\t\t\telse //center\n\t\t\t\t{\n\t\t\t\t\tobject.x = this._leftOffset + Math.round((this.actualWidth - this._leftOffset - this._rightOffset - object.width) / 2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function refreshSelectionEvents():void\n\t\t{\n\t\t\tvar selectionEnabled:Boolean = this._isEnabled &&\n\t\t\t\t(this._isToggle || this.isSelectableWithoutToggle);\n\t\t\tif(this._itemHasSelectable)\n\t\t\t{\n\t\t\t\tselectionEnabled &&= this.itemToSelectable(this._data);\n\t\t\t}\n\t\t\tif(this.accessoryTouchPointID >= 0)\n\t\t\t{\n\t\t\t\tselectionEnabled &&= this._isSelectableOnAccessoryTouch;\n\t\t\t}\n\t\t\tthis.tapToSelect.isEnabled = selectionEnabled;\n\t\t\tthis.tapToSelect.tapToDeselect = this._isToggle;\n\t\t\tthis.keyToSelect.isEnabled = false;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function hitTestWithAccessory(localPosition:Point):Boolean\n\t\t{\n\t\t\tif(this._isQuickHitAreaEnabled ||\n\t\t\t\tthis._isSelectableOnAccessoryTouch ||\n\t\t\t\tthis.currentAccessory === null ||\n\t\t\t\tthis.currentAccessory === this.accessoryLabel ||\n\t\t\t\tthis.currentAccessory === this.accessoryLoader)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif(this.currentAccessory is DisplayObjectContainer)\n\t\t\t{\n\t\t\t\tvar container:DisplayObjectContainer = DisplayObjectContainer(this.currentAccessory);\n\t\t\t\treturn !container.contains(this.hitTest(localPosition));\n\t\t\t}\n\t\t\treturn this.hitTest(localPosition) !== this.currentAccessory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function owner_scrollStartHandler(event:Event):void\n\t\t{\n\t\t\tif(this._delayTextureCreationOnScroll)\n\t\t\t{\n\t\t\t\tif(this.accessoryLoader)\n\t\t\t\t{\n\t\t\t\t\tthis.accessoryLoader.delayTextureCreation = true;\n\t\t\t\t}\n\t\t\t\tif(this.iconLoader)\n\t\t\t\t{\n\t\t\t\t\tthis.iconLoader.delayTextureCreation = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(this.accessoryTouchPointID >= 0)\n\t\t\t{\n\t\t\t\tthis._owner.stopScrolling();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function owner_scrollCompleteHandler(event:Event):void\n\t\t{\n\t\t\tif(this._delayTextureCreationOnScroll)\n\t\t\t{\n\t\t\t\tif(this.accessoryLoader)\n\t\t\t\t{\n\t\t\t\t\tthis.accessoryLoader.delayTextureCreation = false;\n\t\t\t\t}\n\t\t\t\tif(this.iconLoader)\n\t\t\t\t{\n\t\t\t\t\tthis.iconLoader.delayTextureCreation = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function itemRenderer_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tthis.accessoryTouchPointID = -1;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function accessory_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\tthis.accessoryTouchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!this._stopScrollingOnAccessoryTouch ||\n\t\t\t\tthis.currentAccessory === this.accessoryLabel ||\n\t\t\t\tthis.currentAccessory === this.accessoryLoader)\n\t\t\t{\n\t\t\t\t//do nothing\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this.accessoryTouchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(this.currentAccessory, TouchPhase.ENDED, this.accessoryTouchPointID);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.accessoryTouchPointID = -1;\n\t\t\t\tthis.refreshSelectionEvents();\n\t\t\t}\n\t\t\telse //if we get here, we don't have a saved touch ID yet\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(this.currentAccessory, TouchPhase.BEGAN);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.accessoryTouchPointID = touch.id;\n\t\t\t\tthis.refreshSelectionEvents();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function accessory_resizeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreAccessoryResizes)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function loader_completeOrErrorHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/controls/renderers/DefaultDataGridCellRenderer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.renderers\n{\n\timport feathers.controls.DataGrid;\n\timport feathers.controls.DataGridColumn;\n\timport feathers.events.FeathersEventType;\n\timport feathers.skins.IStyleProvider;\n\n\t/**\n\t * The default cell renderer for the <code>DataGrid</code> component.\n\t * Supports up to three optional sub-views, including a label to display\n\t * text, an icon to display an image, and an \"accessory\" to display a UI\n\t * component or another display object (with shortcuts for including a\n\t * second image or a second label).\n\t *\n\t * @see feathers.controls.DataGrid\n\t *\n\t * @productversion Feathers 3.4.0\n\t */\n\tpublic class DefaultDataGridCellRenderer extends BaseDefaultItemRenderer implements IDataGridCellRenderer\n\t{\n\t\t/**\n\t\t * @copy feathers.controls.renderers.BaseDefaultItemRenderer#ALTERNATE_STYLE_NAME_CHECK\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const ALTERNATE_STYLE_NAME_CHECK:String = \"feathers-check-item-renderer\";\n\n\t\t/**\n\t\t * @copy feathers.controls.renderers.BaseDefaultItemRenderer#DEFAULT_CHILD_STYLE_NAME_LABEL\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_LABEL:String = \"feathers-item-renderer-label\";\n\n\t\t/**\n\t\t * @copy feathers.controls.renderers.BaseDefaultItemRenderer#DEFAULT_CHILD_STYLE_NAME_ICON_LABEL\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_ICON_LABEL:String = \"feathers-item-renderer-icon-label\";\n\n\t\t/**\n\t\t * @copy feathers.controls.renderers.BaseDefaultItemRenderer#DEFAULT_CHILD_STYLE_NAME_ACCESSORY_LABEL\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_ACCESSORY_LABEL:String = \"feathers-item-renderer-accessory-label\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>DefaultListItemRenderer</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function DefaultDataGridCellRenderer()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn DefaultDataGridCellRenderer.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _rowIndex:int = -1;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get rowIndex():int\n\t\t{\n\t\t\treturn this._rowIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set rowIndex(value:int):void\n\t\t{\n\t\t\tif(this._rowIndex == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._rowIndex = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _columnIndex:int = -1;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get columnIndex():int\n\t\t{\n\t\t\treturn this._columnIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set columnIndex(value:int):void\n\t\t{\n\t\t\tif(this._columnIndex == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._columnIndex = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _dataField:String = null;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get dataField():String\n\t\t{\n\t\t\treturn this._dataField;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set dataField(value:String):void\n\t\t{\n\t\t\tif(this._dataField === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._dataField = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _column:DataGridColumn = null;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get column():DataGridColumn\n\t\t{\n\t\t\treturn this._column;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set column(value:DataGridColumn):void\n\t\t{\n\t\t\tif(this._column === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._column = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get owner():DataGrid\n\t\t{\n\t\t\treturn DataGrid(this._owner);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set owner(value:DataGrid):void\n\t\t{\n\t\t\tif(this._owner === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._owner)\n\t\t\t{\n\t\t\t\tthis._owner.removeEventListener(FeathersEventType.SCROLL_START, owner_scrollStartHandler);\n\t\t\t\tthis._owner.removeEventListener(FeathersEventType.SCROLL_COMPLETE, owner_scrollCompleteHandler);\n\t\t\t}\n\t\t\tthis._owner = value;\n\t\t\tif(this._owner)\n\t\t\t{\n\t\t\t\tvar grid:DataGrid = DataGrid(this._owner);\n\t\t\t\tthis.isSelectableWithoutToggle = grid.isSelectable;\n\t\t\t\tif(grid.allowMultipleSelection)\n\t\t\t\t{\n\t\t\t\t\t//toggling is forced in this case\n\t\t\t\t\tthis.isToggle = true;\n\t\t\t\t}\n\t\t\t\tthis._owner.addEventListener(FeathersEventType.SCROLL_START, owner_scrollStartHandler);\n\t\t\t\tthis._owner.addEventListener(FeathersEventType.SCROLL_COMPLETE, owner_scrollCompleteHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tthis.owner = null;\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tsuper.initialize();\n\t\t\t//every cell in a row should be affected by touches anywhere\n\t\t\t//in the row, so use the parent as the target\n\t\t\tthis.touchToState.target = this.parent;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function getDataToRender():Object\n\t\t{\n\t\t\tif(this._data === null || this._dataField === null)\n\t\t\t{\n\t\t\t\treturn this._data;\n\t\t\t}\n\t\t\treturn this._data[this._dataField];\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/controls/renderers/DefaultDataGridHeaderRenderer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.renderers\n{\n\timport feathers.controls.DataGrid;\n\timport feathers.controls.DataGridColumn;\n\timport feathers.controls.ImageLoader;\n\timport feathers.controls.renderers.IDataGridHeaderRenderer;\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IMeasureDisplayObject;\n\timport feathers.core.ITextRenderer;\n\timport feathers.core.IValidating;\n\timport feathers.data.SortOrder;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.text.FontStylesSet;\n\timport feathers.utils.skins.resetFluidChildDimensionsForMeasurement;\n\timport feathers.utils.touch.TapToTrigger;\n\n\timport flash.geom.Point;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.text.TextFormat;\n\timport starling.utils.Pool;\n\n\t/**\n\t * A background to behind the header renderer's content.\n\t *\n\t * <p>In the following example, the header renderers is given a\n\t * background skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * headerRenderer.backgroundSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:backgroundDisabledSkin\n\t */\n\t[Style(name=\"backgroundSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * A background to display when the header renderer is disabled.\n\t *\n\t * <p>In the following example, the header renderers is given a\n\t * disabled background skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * headerRenderer.backgroundDisabledSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:backgroundSkin\n\t */\n\t[Style(name=\"backgroundDisabledSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * A style name to add to the header renderer's text renderer\n\t * sub-component. Typically used by a theme to provide different styles to\n\t * different header renderers.\n\t *\n\t * <p>In the following example, a custom text renderer style name is passed\n\t * to the header renderer:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * headerRenderer.customTextRendererStyleName = \"my-custom-header-text\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( BitmapFontTextRenderer ).setFunctionForStyleName( \"my-custom-header-text\", setCustomHeaderTextStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_TEXT_RENDERER\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #textRendererFactory\n\t */\n\t[Style(name=\"customTextRendererStyleName\",type=\"String\")]\n\n\t/**\n\t * The font styles used to display the header renderer's text when the\n\t * component is disabled.\n\t *\n\t * <p>In the following example, the disabled font styles are customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * headerRenderer.disabledFontStyles = new TextFormat( \"Helvetica\", 20, 0x999999 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>textRendererFactory</code> to set more advanced styles on the\n\t * text renderer.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:fontStyles\n\t */\n\t[Style(name=\"disabledFontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The font styles used to display the header renderer's text.\n\t *\n\t * <p>In the following example, the font styles are customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * headerRenderer.fontStyles = new TextFormat( \"Helvetica\", 20, 0xcc0000 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>textRendererFactory</code> to set more advanced styles.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:disabledFontStyles\n\t */\n\t[Style(name=\"fontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The location where the header renderer's content is aligned horizontally\n\t * (on the x-axis).\n\t *\n\t * <p>In the following example, the horizontal alignment is changed to\n\t * right:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * headerRenderer.horizontalAlign = HorizontalAlign.RIGHT;</listing>\n\t *\n\t * <p><strong>Note:</strong> The <code>HorizontalAlign.JUSTIFY</code>\n\t * constant is not supported.</p>\n\t *\n\t * @default feathers.layout.HorizontalAlign.LEFT\n\t *\n\t * @see feathers.layout.HorizontalAlign#LEFT\n\t * @see feathers.layout.HorizontalAlign#CENTER\n\t * @see feathers.layout.HorizontalAlign#RIGHT\n\t */\n\t[Style(name=\"horizontalAlign\",type=\"String\")]\n\n\t/**\n\t * Quickly sets all padding properties to the same value. The\n\t * <code>padding</code> getter always returns the value of\n\t * <code>paddingTop</code>, but the other padding values may be\n\t * different.\n\t *\n\t * <p>In the following example, the padding on all four sides is set to 20\n\t * pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * headerRenderer.padding = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:paddingTop\n\t * @see #style:paddingRight\n\t * @see #style:paddingBottom\n\t * @see #style:paddingLeft\n\t */\n\t[Style(name=\"padding\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the component's top edge and\n\t * the component's content.\n\t *\n\t * <p>In the following example, the top padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * headerRenderer.paddingTop = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingTop\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the component's right edge\n\t * and the component's content.\n\t *\n\t * <p>In the following example, the right padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * headerRenderer.paddingRight = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingRight\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the component's bottom edge\n\t * and the component's content.\n\t *\n\t * <p>In the following example, the bottom padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * headerRenderer.paddingBottom = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingBottom\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the component's left edge\n\t * and the component's content.\n\t *\n\t * <p>In the following example, the left padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * headerRenderer.paddingLeft = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingLeft\",type=\"Number\")]\n\n\t/**\n\t * An icon to display when the column is sorted in ascending order.\n\t *\n\t * <p>In the following example, sort ascending icon is customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * headerRenderer.sortAscendingIcon = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:sortDescendingIcon\n\t */\n\t[Style(name=\"sortAscendingIcon\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * An icon to display when the column is sorted in descending order.\n\t *\n\t * <p>In the following example, the sort descending icon is customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * headerRenderer.sortDescendingIcon = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:sortAscendingIcon\n\t */\n\t[Style(name=\"sortDescendingIcon\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The location where the header renderer's content is aligned vertically\n\t * (on the y-axis).\n\t *\n\t * <p>In the following example, the vertical alignment is changed to\n\t * bottom:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * headerRenderer.verticalAlign = VerticalAlign.BOTTOM;</listing>\n\t *\n\t * <p><strong>Note:</strong> The <code>VerticalAlign.JUSTIFY</code>\n\t * constant is not supported.</p>\n\t *\n\t * @default feathers.layout.VerticalAlign.MIDDLE\n\t *\n\t * @see feathers.layout.VerticalAlign#TOP\n\t * @see feathers.layout.VerticalAlign#MIDDLE\n\t * @see feathers.layout.VerticalAlign#BOTTOM\n\t */\n\t[Style(name=\"verticalAlign\",type=\"String\")]\n\n\t/**\n\t * Determines if the text wraps to the next line when it reaches the\n\t * width (or max width) of the component.\n\t *\n\t * <p>In the following example, the header renderer's text is wrapped:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * headerRenderer.wordWrap = true;</listing>\n\t *\n\t * @default false\n\t */\n\t[Style(name=\"wordWrap\",type=\"Boolean\")]\n\n\t/**\n\t * Dispatched when the the user taps or clicks the header renderer. The touch\n\t * must remain within the bounds of the header renderer on release to register\n\t * as a tap or a click.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.TRIGGERED\n\t */\n\t[Event(name=\"triggered\",type=\"starling.events.Event\")]\n\n\t/**\n\t * The default renderer used for headers in a <code>DataGrid</code> component.\n\t *\n\t * @see feathers.controls.DataGrid\n\t *\n\t * @productversion Feathers 3.4.0\n\t */\n\tpublic class DefaultDataGridHeaderRenderer extends FeathersControl implements IDataGridHeaderRenderer\n\t{\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the\n\t\t * text renderer.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_TEXT_RENDERER:String = \"feathers-data-grid-header-renderer-text-renderer\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>DefaultDataGridHeaderRenderer</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultImageLoaderFactory():ImageLoader\n\t\t{\n\t\t\treturn new ImageLoader();\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function DefaultDataGridHeaderRenderer()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.isQuickHitAreaEnabled = true;\n\t\t\tif(this._fontStylesSet === null)\n\t\t\t{\n\t\t\t\tthis._fontStylesSet = new FontStylesSet();\n\t\t\t\tthis._fontStylesSet.addEventListener(Event.CHANGE, fontStyles_changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _tapToTrigger:TapToTrigger = null;\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the text\n\t\t * renderer. This variable is <code>protected</code> so that\n\t\t * sub-classes can customize the label text renderer style name in their\n\t\t * constructors instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_TEXT_RENDERER</code>.\n\t\t *\n\t\t * <p>To customize the text renderer style name without\n\t\t * subclassing, see <code>customTextRendererStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customTextRendererStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var textRendererStyleName:String = DEFAULT_CHILD_STYLE_NAME_TEXT_RENDERER;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var textRenderer:ITextRenderer;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn DefaultDataGridHeaderRenderer.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _data:DataGridColumn = null;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get data():DataGridColumn\n\t\t{\n\t\t\treturn this._data;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set data(value:DataGridColumn):void\n\t\t{\n\t\t\tif(this._data == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._data = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _columnIndex:int = -1;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get columnIndex():int\n\t\t{\n\t\t\treturn this._columnIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set columnIndex(value:int):void\n\t\t{\n\t\t\tthis._columnIndex = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _owner:DataGrid = null;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get owner():DataGrid\n\t\t{\n\t\t\treturn this._owner;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set owner(value:DataGrid):void\n\t\t{\n\t\t\tif(this._owner === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._owner = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _sortOrder:String = SortOrder.NONE;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get sortOrder():String\n\t\t{\n\t\t\treturn this._sortOrder;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set sortOrder(value:String):void\n\t\t{\n\t\t\tif(this._sortOrder === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._sortOrder = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalAlign:String = HorizontalAlign.LEFT;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"left,center,right\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get horizontalAlign():String\n\t\t{\n\t\t\treturn this._horizontalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalAlign(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._horizontalAlign === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalAlign = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalAlign:String = VerticalAlign.MIDDLE;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"top,middle,bottom\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get verticalAlign():String\n\t\t{\n\t\t\treturn _verticalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalAlign(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._verticalAlign === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalAlign = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fontStylesSet:FontStylesSet;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get fontStyles():TextFormat\n\t\t{\n\t\t\treturn this._fontStylesSet.format;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set fontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._fontStylesSet.format;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._fontStylesSet.format = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get disabledFontStyles():TextFormat\n\t\t{\n\t\t\treturn this._fontStylesSet.disabledFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disabledFontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._fontStylesSet.disabledFormat;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._fontStylesSet.disabledFormat = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _wordWrap:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get wordWrap():Boolean\n\t\t{\n\t\t\treturn this._wordWrap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set wordWrap(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._wordWrap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textRendererFactory:Function = null;\n\n\t\t/**\n\t\t * A function that generates an <code>ITextRenderer</code> that\n\t\t * displays the header's text. The factory may be used to set custom\n\t\t * properties on the <code>ITextRenderer</code>.\n\t\t *\n\t\t * <p>In the following example, a custom text renderer factory is passed\n\t\t * to the renderer:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * headerRenderer.textRendererFactory = function():ITextRenderer\n\t\t * {\n\t\t *     var textRenderer:TextFieldTextRenderer = new TextFieldTextRenderer();\n\t\t *     textRenderer.textFormat = new TextFormat( \"Source Sans Pro\", 16, 0x333333 );\n\t\t *     textRenderer.embedFonts = true;\n\t\t *     return textRenderer;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.ITextRenderer\n\t\t * @see feathers.core.FeathersControl#defaultTextRendererFactory\n\t\t */\n\t\tpublic function get textRendererFactory():Function\n\t\t{\n\t\t\treturn this._textRendererFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set textRendererFactory(value:Function):void\n\t\t{\n\t\t\tif(this._textRendererFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textRendererFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customTextRendererStyleName:String = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customTextRendererStyleName():String\n\t\t{\n\t\t\treturn this._customTextRendererStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customTextRendererStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customTextRendererStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customTextRendererStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMaxWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMaxHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitTextRendererWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitTextRendererHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitTextRendererMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitTextRendererMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitTextRendererMaxWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitTextRendererMaxHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var currentBackgroundSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _backgroundSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundSkin():DisplayObject\n\t\t{\n\t\t\treturn this._backgroundSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSkin !== null &&\n\t\t\t\tthis.currentBackgroundSkin === this._backgroundSkin)\n\t\t\t{\n\t\t\t\tthis.removeCurrentBackgroundSkin(this._backgroundSkin);\n\t\t\t\tthis.currentBackgroundSkin = null;\n\t\t\t}\n\t\t\tthis._backgroundSkin = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _backgroundDisabledSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundDisabledSkin():DisplayObject\n\t\t{\n\t\t\treturn this._backgroundDisabledSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundDisabledSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundDisabledSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundDisabledSkin !== null &&\n\t\t\t\tthis.currentBackgroundSkin === this._backgroundDisabledSkin)\n\t\t\t{\n\t\t\t\tthis.removeCurrentBackgroundSkin(this._backgroundDisabledSkin);\n\t\t\t\tthis.currentBackgroundSkin = null;\n\t\t\t}\n\t\t\tthis._backgroundDisabledSkin = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var currentSortIcon:DisplayObject = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _sortAscendingIcon:DisplayObject = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get sortAscendingIcon():DisplayObject\n\t\t{\n\t\t\treturn this._sortAscendingIcon;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set sortAscendingIcon(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._sortAscendingIcon === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._sortAscendingIcon !== null &&\n\t\t\t\tthis.currentSortIcon === this._sortAscendingIcon)\n\t\t\t{\n\t\t\t\tthis.removeCurrentSortIcon(this._sortAscendingIcon);\n\t\t\t\tthis.currentSortIcon = null;\n\t\t\t}\n\t\t\tthis._sortAscendingIcon = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _sortDescendingIcon:DisplayObject = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get sortDescendingIcon():DisplayObject\n\t\t{\n\t\t\treturn this._sortDescendingIcon;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set sortDescendingIcon(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._sortDescendingIcon === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._sortDescendingIcon !== null &&\n\t\t\t\tthis.currentSortIcon === this._sortDescendingIcon)\n\t\t\t{\n\t\t\t\tthis.removeCurrentSortIcon(this._sortDescendingIcon);\n\t\t\t\tthis.currentSortIcon = null;\n\t\t\t}\n\t\t\tthis._sortDescendingIcon = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get padding():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set padding(value:Number):void\n\t\t{\n\t\t\tthis.paddingTop = value;\n\t\t\tthis.paddingRight = value;\n\t\t\tthis.paddingBottom = value;\n\t\t\tthis.paddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingTop:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingTop():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingTop(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingTop = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingRight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingRight():Number\n\t\t{\n\t\t\treturn this._paddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingRight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingBottom:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingBottom():Number\n\t\t{\n\t\t\treturn this._paddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingBottom = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingLeft:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingLeft = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * The number of text lines displayed by the renderer. The component may\n\t\t * contain multiple text lines if the text contains line breaks or if\n\t\t * the <code>wordWrap</code> property is enabled.\n\t\t *\n\t\t * @see #wordWrap\n\t\t */\n\t\tpublic function get numLines():int\n\t\t{\n\t\t\tif(this.textRenderer === null)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn this.textRenderer.numLines;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//we don't dispose it if the renderer is the parent because it'll\n\t\t\t//already get disposed in super.dispose()\n\t\t\tif(this._backgroundSkin !== null &&\n\t\t\t\tthis._backgroundSkin.parent !== this)\n\t\t\t{\n\t\t\t\tthis._backgroundSkin.dispose();\n\t\t\t}\n\t\t\tif(this._backgroundDisabledSkin !== null &&\n\t\t\t\tthis._backgroundDisabledSkin.parent !== this)\n\t\t\t{\n\t\t\t\tthis._backgroundDisabledSkin.dispose();\n\t\t\t}\n\t\t\tif(this._fontStylesSet !== null)\n\t\t\t{\n\t\t\t\tthis._fontStylesSet.dispose();\n\t\t\t\tthis._fontStylesSet = null;\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * Determines which text to display in the header.\n\t\t */\n\t\tprotected function itemToText(item:DataGridColumn):String\n\t\t{\n\t\t\tif(item !== null)\n\t\t\t{\n\t\t\t\tif(item.headerText !== null)\n\t\t\t\t{\n\t\t\t\t\treturn item.headerText;\n\t\t\t\t}\n\t\t\t\telse if(item.dataField !== null)\n\t\t\t\t{\n\t\t\t\t\treturn item.dataField;\n\t\t\t\t}\n\t\t\t\treturn Object(item).toString();\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tsuper.initialize();\n\n\t\t\tif(this._tapToTrigger === null)\n\t\t\t{\n\t\t\t\tthis._tapToTrigger = new TapToTrigger(this);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\tvar textRendererInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_TEXT_RENDERER);\n\n\t\t\tif(stylesInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshBackgroundSkin();\n\t\t\t}\n\n\t\t\tif(stylesInvalid || dataInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshSortIcon();\n\t\t\t}\n\n\t\t\tif(textRendererInvalid)\n\t\t\t{\n\t\t\t\tthis.createTextRenderer();\n\t\t\t}\n\n\t\t\tif(textRendererInvalid || dataInvalid)\n\t\t\t{\n\t\t\t\tthis.commitData();\n\t\t\t}\n\n\t\t\tif(dataInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshTextRendererStyles();\n\t\t\t}\n\n\t\t\tif(dataInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshEnabled();\n\t\t\t}\n\n\t\t\tsizeInvalid = this.autoSizeIfNeeded() || sizeInvalid;\n\t\t\tthis.layoutChildren();\n\t\t}\n\n\t\t/**\n\t\t * If the component's dimensions have not been set explicitly, it will\n\t\t * measure its content and determine an ideal size for itself. If the\n\t\t * <code>explicitWidth</code> or <code>explicitHeight</code> member\n\t\t * variables are set, those value will be used without additional\n\t\t * measurement. If one is set, but not the other, the dimension with the\n\t\t * explicit value will not be measured, but the other non-explicit\n\t\t * dimension will still need measurement.\n\t\t *\n\t\t * <p>Calls <code>saveMeasurements()</code> to set up the\n\t\t * <code>actualWidth</code> and <code>actualHeight</code> member\n\t\t * variables used for layout.</p>\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t */\n\t\tprotected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tresetFluidChildDimensionsForMeasurement(DisplayObject(this.textRenderer),\n\t\t\t\tthis._explicitWidth - this._paddingLeft - this._paddingRight,\n\t\t\t\tthis._explicitHeight - this._paddingTop - this._paddingBottom,\n\t\t\t\tthis._explicitMinWidth - this._paddingLeft - this._paddingRight,\n\t\t\t\tthis._explicitMinHeight - this._paddingTop - this._paddingBottom,\n\t\t\t\tthis._explicitMaxWidth - this._paddingLeft - this._paddingRight,\n\t\t\t\tthis._explicitMaxHeight - this._paddingTop - this._paddingBottom,\n\t\t\t\tthis._explicitTextRendererWidth, this._explicitTextRendererHeight,\n\t\t\t\tthis._explicitTextRendererMinWidth, this._explicitTextRendererMinHeight,\n\t\t\t\tthis._explicitTextRendererMaxWidth, this._explicitTextRendererMaxHeight);\n\t\t\tthis.textRenderer.maxWidth = this._explicitMaxWidth - this._paddingLeft - this._paddingRight;\n\t\t\tthis.textRenderer.maxHeight = this._explicitMaxHeight - this._paddingTop - this._paddingBottom;\n\t\t\tvar point:Point = Pool.getPoint();\n\t\t\tthis.textRenderer.measureText(point);\n\n\t\t\tresetFluidChildDimensionsForMeasurement(this.currentBackgroundSkin,\n\t\t\t\tthis._explicitWidth, this._explicitHeight,\n\t\t\t\tthis._explicitMinWidth, this._explicitMinHeight,\n\t\t\t\tthis._explicitMaxWidth, this._explicitMaxHeight,\n\t\t\t\tthis._explicitBackgroundWidth, this._explicitBackgroundHeight,\n\t\t\t\tthis._explicitBackgroundMinWidth, this._explicitBackgroundMinHeight,\n\t\t\t\tthis._explicitBackgroundMaxWidth, this._explicitBackgroundMaxHeight);\n\t\t\tvar measureSkin:IMeasureDisplayObject = this.currentBackgroundSkin as IMeasureDisplayObject;\n\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tnewWidth = point.x;\n\t\t\t\tnewWidth += this._paddingLeft + this._paddingRight;\n\t\t\t\tif(this.currentBackgroundSkin !== null &&\n\t\t\t\t\tthis.currentBackgroundSkin.width > newWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this.currentBackgroundSkin.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tnewHeight = point.y;\n\t\t\t\tnewHeight += this._paddingTop + this._paddingBottom;\n\t\t\t\tif(this.currentBackgroundSkin !== null &&\n\t\t\t\t\tthis.currentBackgroundSkin.height > newHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this.currentBackgroundSkin.height;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tnewMinWidth = point.x;\n\t\t\t\tnewMinWidth += this._paddingLeft + this._paddingRight;\n\t\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(measureSkin !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(measureSkin.minWidth > newMinWidth)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinWidth = measureSkin.minWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._explicitBackgroundMinWidth > newMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = this._explicitBackgroundMinWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tnewMinHeight = point.y;\n\t\t\t\tnewMinHeight += this._paddingTop + this._paddingBottom;\n\t\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(measureSkin !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(measureSkin.minHeight > newMinHeight)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinHeight = measureSkin.minHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._explicitBackgroundMinHeight > newMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = this._explicitBackgroundMinHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tPool.putPoint(point);\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshBackgroundSkin():void\n\t\t{\n\t\t\tvar oldBackgroundSkin:DisplayObject = this.currentBackgroundSkin;\n\t\t\tthis.currentBackgroundSkin = this._backgroundSkin;\n\t\t\tif(!this._isEnabled && this._backgroundDisabledSkin !== null)\n\t\t\t{\n\t\t\t\tthis.currentBackgroundSkin = this._backgroundDisabledSkin;\n\t\t\t}\n\t\t\tif(oldBackgroundSkin !== this.currentBackgroundSkin)\n\t\t\t{\n\t\t\t\tthis.removeCurrentBackgroundSkin(oldBackgroundSkin);\n\t\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(this.currentBackgroundSkin is IFeathersControl)\n\t\t\t\t\t{\n\t\t\t\t\t\tIFeathersControl(this.currentBackgroundSkin).initializeNow();\n\t\t\t\t\t}\n\t\t\t\t\tif(this.currentBackgroundSkin is IMeasureDisplayObject)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar measureSkin:IMeasureDisplayObject = IMeasureDisplayObject(this.currentBackgroundSkin);\n\t\t\t\t\t\tthis._explicitBackgroundWidth = measureSkin.explicitWidth;\n\t\t\t\t\t\tthis._explicitBackgroundHeight = measureSkin.explicitHeight;\n\t\t\t\t\t\tthis._explicitBackgroundMinWidth = measureSkin.explicitMinWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMinHeight = measureSkin.explicitMinHeight;\n\t\t\t\t\t\tthis._explicitBackgroundMaxWidth = measureSkin.explicitMaxWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMaxHeight = measureSkin.explicitMaxHeight;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._explicitBackgroundWidth = this.currentBackgroundSkin.width;\n\t\t\t\t\t\tthis._explicitBackgroundHeight = this.currentBackgroundSkin.height;\n\t\t\t\t\t\tthis._explicitBackgroundMinWidth = this._explicitBackgroundWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMinHeight = this._explicitBackgroundHeight;\n\t\t\t\t\t\tthis._explicitBackgroundMaxWidth = this._explicitBackgroundWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMaxHeight = this._explicitBackgroundHeight;\n\t\t\t\t\t}\n\t\t\t\t\tthis.addChildAt(this.currentBackgroundSkin, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshSortIcon():void\n\t\t{\n\t\t\tvar oldSortIcon:DisplayObject = this.currentSortIcon;\n\t\t\tthis.currentSortIcon = null;\n\t\t\tif(this._sortOrder === SortOrder.ASCENDING)\n\t\t\t{\n\t\t\t\tthis.currentSortIcon = this._sortAscendingIcon;\n\t\t\t}\n\t\t\telse if(this._sortOrder === SortOrder.DESCENDING)\n\t\t\t{\n\t\t\t\tthis.currentSortIcon = this._sortDescendingIcon;\n\t\t\t}\n\t\t\tif(oldSortIcon !== this.currentSortIcon)\n\t\t\t{\n\t\t\t\tthis.removeCurrentSortIcon(oldSortIcon);\n\t\t\t\tif(this.currentSortIcon !== null)\n\t\t\t\t{\n\t\t\t\t\tthis.addChild(this.currentSortIcon);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function removeCurrentBackgroundSkin(skin:DisplayObject):void\n\t\t{\n\t\t\tif(skin === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(skin.parent === this)\n\t\t\t{\n\t\t\t\t//we need to restore these values so that they won't be lost the\n\t\t\t\t//next time that this skin is used for measurement\n\t\t\t\tskin.width = this._explicitBackgroundWidth;\n\t\t\t\tskin.height = this._explicitBackgroundHeight;\n\t\t\t\tif(skin is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar measureSkin:IMeasureDisplayObject = IMeasureDisplayObject(skin);\n\t\t\t\t\tmeasureSkin.minWidth = this._explicitBackgroundMinWidth;\n\t\t\t\t\tmeasureSkin.minHeight = this._explicitBackgroundMinHeight;\n\t\t\t\t\tmeasureSkin.maxWidth = this._explicitBackgroundMaxWidth;\n\t\t\t\t\tmeasureSkin.maxHeight = this._explicitBackgroundMaxHeight;\n\t\t\t\t}\n\t\t\t\tskin.removeFromParent(false);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function removeCurrentSortIcon(icon:DisplayObject):void\n\t\t{\n\t\t\tif(icon === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(icon.parent === this)\n\t\t\t{\n\t\t\t\ticon.removeFromParent(false);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createTextRenderer():void\n\t\t{\n\t\t\tif(this.textRenderer !== null)\n\t\t\t{\n\t\t\t\tthis.removeChild(DisplayObject(this.textRenderer), true);\n\t\t\t\tthis.textRenderer = null;\n\t\t\t}\n\n\t\t\tvar factory:Function = this._textRendererFactory != null ? this._textRendererFactory : FeathersControl.defaultTextRendererFactory;\n\t\t\tthis.textRenderer = ITextRenderer(factory());\n\t\t\tvar textRendererStyleName:String = this._customTextRendererStyleName != null ? this._customTextRendererStyleName : this.textRendererStyleName;\n\t\t\tthis.textRenderer.styleNameList.add(textRendererStyleName);\n\t\t\tthis.addChild(DisplayObject(this.textRenderer));\n\n\t\t\tthis.textRenderer.initializeNow();\n\t\t\tthis._explicitTextRendererWidth = this.textRenderer.explicitWidth;\n\t\t\tthis._explicitTextRendererHeight = this.textRenderer.explicitHeight;\n\t\t\tthis._explicitTextRendererMinWidth = this.textRenderer.explicitMinWidth;\n\t\t\tthis._explicitTextRendererMinHeight = this.textRenderer.explicitMinHeight;\n\t\t\tthis._explicitTextRendererMaxWidth = this.textRenderer.explicitMaxWidth;\n\t\t\tthis._explicitTextRendererMaxHeight = this.textRenderer.explicitMaxHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function commitData():void\n\t\t{\n\t\t\tif(this._owner)\n\t\t\t{\n\t\t\t\tthis.textRenderer.text = this.itemToText(this._data);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.textRenderer.text = null;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshEnabled():void\n\t\t{\n\t\t\tthis.textRenderer.isEnabled = this._isEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshTextRendererStyles():void\n\t\t{\n\t\t\tthis.textRenderer.fontStyles = this._fontStylesSet;\n\t\t\tthis.textRenderer.wordWrap = this._wordWrap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutChildren():void\n\t\t{\n\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t{\n\t\t\t\tthis.currentBackgroundSkin.width = this.actualWidth;\n\t\t\t\tthis.currentBackgroundSkin.height = this.actualHeight;\n\t\t\t}\n\n\t\t\tif(this.currentSortIcon is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.currentSortIcon).validate();\n\t\t\t}\n\t\t\tvar availableTextWidth:Number = this.actualWidth - this._paddingLeft - this._paddingRight;\n\t\t\tif(this.currentSortIcon)\n\t\t\t{\n\t\t\t\tavailableTextWidth -= this.currentSortIcon.width;\n\t\t\t}\n\n\t\t\tthis.textRenderer.width = this._explicitTextRendererWidth;\n\t\t\tthis.textRenderer.height = this._explicitTextRendererHeight;\n\t\t\tthis.textRenderer.minWidth = this._explicitTextRendererMinWidth;\n\t\t\tthis.textRenderer.minHeight = this._explicitTextRendererMinHeight;\n\t\t\tthis.textRenderer.maxWidth = availableTextWidth;\n\t\t\tthis.textRenderer.maxHeight = this._explicitTextRendererMaxHeight;\n\t\t\tthis.textRenderer.validate();\n\n\t\t\tswitch(this._horizontalAlign)\n\t\t\t{\n\t\t\t\tcase HorizontalAlign.CENTER:\n\t\t\t\t{\n\t\t\t\t\tthis.textRenderer.x = this._paddingLeft + (availableTextWidth - this.textRenderer.width) / 2;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase HorizontalAlign.RIGHT:\n\t\t\t\t{\n\t\t\t\t\tthis.textRenderer.x = this._paddingLeft + availableTextWidth - this.textRenderer.width;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: //left\n\t\t\t\t{\n\t\t\t\t\tthis.textRenderer.x = this._paddingLeft;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this.currentSortIcon !== null)\n\t\t\t{\n\t\t\t\tthis.currentSortIcon.x = this.actualWidth - this._paddingRight - this.currentSortIcon.width;\n\t\t\t}\n\n\t\t\tswitch(this._verticalAlign)\n\t\t\t{\n\t\t\t\tcase VerticalAlign.TOP:\n\t\t\t\t{\n\t\t\t\t\tthis.textRenderer.y = this._paddingTop;\n\t\t\t\t\tif(this.currentSortIcon !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.currentSortIcon.y = this._paddingTop;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase VerticalAlign.BOTTOM:\n\t\t\t\t{\n\t\t\t\t\tthis.textRenderer.y = this.actualHeight - this._paddingBottom - this.textRenderer.height;\n\t\t\t\t\tif(this.currentSortIcon !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.currentSortIcon.y = this.actualHeight - this._paddingBottom - this.currentSortIcon.height;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: //middle\n\t\t\t\t{\n\t\t\t\t\tthis.textRenderer.y = this._paddingTop + (this.actualHeight - this._paddingTop - this._paddingBottom - this.textRenderer.height) / 2;\n\t\t\t\t\tif(this.currentSortIcon !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.currentSortIcon.y = this._paddingTop + (this.actualHeight - this._paddingTop - this._paddingBottom - this.currentSortIcon.height) / 2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function fontStyles_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/renderers/DefaultGroupedListHeaderOrFooterRenderer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.renderers\n{\n\timport feathers.controls.GroupedList;\n\timport feathers.controls.ImageLoader;\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IMeasureDisplayObject;\n\timport feathers.core.ITextRenderer;\n\timport feathers.core.IValidating;\n\timport feathers.core.PropertyProxy;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.text.FontStylesSet;\n\timport feathers.utils.skins.resetFluidChildDimensionsForMeasurement;\n\n\timport flash.geom.Point;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.text.TextFormat;\n\n\t/**\n\t * A background to behind the component's content.\n\t *\n\t * <p>In the following example, the header renderers is given a\n\t * background skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * renderer.backgroundSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:backgroundDisabledSkin\n\t */\n\t[Style(name=\"backgroundSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * A background to display when the component is disabled.\n\t *\n\t * <p>In the following example, the header renderers is given a\n\t * disabled background skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * renderer.backgroundDisabledSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:backgroundSkin\n\t */\n\t[Style(name=\"backgroundDisabledSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * A style name to add to the renderer's label text renderer\n\t * sub-component. Typically used by a theme to provide different styles\n\t * to different renderers.\n\t *\n\t * <p>In the following example, a custom label style name is passed to\n\t * the renderer:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * renderer.customContentLabelStyleName = \"my-custom-header-or-footer-renderer-label\";</listing>\n\t *\n\t * <p>In your theme, you can target this sub-component style name to\n\t * provide different styles than the default:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * getStyleProviderForClass( BitmapFontTextRenderer ).setFunctionForStyleName( \"my-custom-header-or-footer-label\", setCustomHeaderOrFooterLabelStyles );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #DEFAULT_CHILD_STYLE_NAME_CONTENT_LABEL\n\t * @see feathers.core.FeathersControl#styleNameList\n\t * @see #contentLabelFactory\n\t */\n\t[Style(name=\"customContentLabelStyleName\",type=\"String\")]\n\n\t/**\n\t * The font styles used to display the content label's text when the\n\t * component is disabled.\n\t *\n\t * <p>In the following example, the disabled font styles are customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * renderer.disabledFontStyles = new TextFormat( \"Helvetica\", 20, 0x999999 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>contentLabelFactory</code> to set more advanced styles on the\n\t * text renderer.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:fontStyles\n\t */\n\t[Style(name=\"disabledFontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The font styles used to display the content label's text.\n\t *\n\t * <p>In the following example, the font styles are customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * renderer.fontStyles = new TextFormat( \"Helvetica\", 20, 0xcc0000 );</listing>\n\t *\n\t * <p>Note: The <code>starling.text.TextFormat</code> class defines a\n\t * number of common font styles, but the text renderer being used may\n\t * support a larger number of ways to be customized. Use the\n\t * <code>contentLabelFactory</code> to set more advanced styles.</p>\n\t *\n\t * @default null\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t * @see #style:disabledFontStyles\n\t */\n\t[Style(name=\"fontStyles\",type=\"starling.text.TextFormat\")]\n\n\t/**\n\t * The location where the renderer's content is aligned horizontally\n\t * (on the x-axis).\n\t *\n\t * <p>In the following example, the horizontal alignment is changed to\n\t * right:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * renderer.horizontalAlign = HorizontalAlign.RIGHT;</listing>\n\t *\n\t * @default feathers.layout.HorizontalAlign.LEFT\n\t *\n\t * @see feathers.layout.HorizontalAlign#LEFT\n\t * @see feathers.layout.HorizontalAlign#CENTER\n\t * @see feathers.layout.HorizontalAlign#RIGHT\n\t * @see feathers.layout.HorizontalAlign#JUSTIFY\n\t */\n\t[Style(name=\"horizontalAlign\",type=\"String\")]\n\n\t/**\n\t * Quickly sets all padding properties to the same value. The\n\t * <code>padding</code> getter always returns the value of\n\t * <code>paddingTop</code>, but the other padding values may be\n\t * different.\n\t *\n\t * <p>In the following example, the padding on all four sides is set to 20\n\t * pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * renderer.padding = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:paddingTop\n\t * @see #style:paddingRight\n\t * @see #style:paddingBottom\n\t * @see #style:paddingLeft\n\t */\n\t[Style(name=\"padding\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the component's top edge and\n\t * the component's content.\n\t *\n\t * <p>In the following example, the top padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * renderer.paddingTop = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingTop\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the component's right edge\n\t * and the component's content.\n\t *\n\t * <p>In the following example, the right padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * renderer.paddingRight = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingRight\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the component's bottom edge\n\t * and the component's content.\n\t *\n\t * <p>In the following example, the bottom padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * renderer.paddingBottom = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingBottom\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the component's left edge\n\t * and the component's content.\n\t *\n\t * <p>In the following example, the left padding is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * renderer.paddingLeft = 20;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:padding\n\t */\n\t[Style(name=\"paddingLeft\",type=\"Number\")]\n\n\t/**\n\t * The location where the renderer's content is aligned vertically (on\n\t * the y-axis).\n\t *\n\t * <p>In the following example, the vertical alignment is changed to\n\t * bottom:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * renderer.verticalAlign = VerticalAlign.BOTTOM;</listing>\n\t *\n\t * @default feathers.layout.VerticalAlign.MIDDLE\n\t *\n\t * @see feathers.layout.VerticalAlign#TOP\n\t * @see feathers.layout.VerticalAlign#MIDDLE\n\t * @see feathers.layout.VerticalAlign#BOTTOM\n\t * @see feathers.layout.VerticalAlign#JUSTIFY\n\t */\n\t[Style(name=\"verticalAlign\",type=\"String\")]\n\n\t/**\n\t * Determines if the text wraps to the next line when it reaches the\n\t * width (or max width) of the component.\n\t *\n\t * <p>In the following example, the renderer's text is wrapped:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * renderer.wordWrap = true;</listing>\n\t *\n\t * @default false\n\t */\n\t[Style(name=\"wordWrap\",type=\"Boolean\")]\n\n\t/**\n\t * The default renderer used for headers and footers in a GroupedList\n\t * control.\n\t *\n\t * @see feathers.controls.GroupedList\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class DefaultGroupedListHeaderOrFooterRenderer extends FeathersControl implements IGroupedListHeaderRenderer, IGroupedListFooterRenderer\n\t{\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the\n\t\t * content label.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_CONTENT_LABEL:String = \"feathers-header-footer-renderer-content-label\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>DefaultGroupedListHeaderOrFooterRenderer</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const HELPER_POINT:Point = new Point();\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultImageLoaderFactory():ImageLoader\n\t\t{\n\t\t\treturn new ImageLoader();\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function DefaultGroupedListHeaderOrFooterRenderer()\n\t\t{\n\t\t\tsuper();\n\t\t\tif(this._fontStylesSet === null)\n\t\t\t{\n\t\t\t\tthis._fontStylesSet = new FontStylesSet();\n\t\t\t\tthis._fontStylesSet.addEventListener(Event.CHANGE, fontStyles_changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * The value added to the <code>styleNameList</code> of the content\n\t\t * label text renderer. This variable is <code>protected</code> so that\n\t\t * sub-classes can customize the label text renderer style name in their\n\t\t * constructors instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_CONTENT_LABEL</code>.\n\t\t *\n\t\t * <p>To customize the content label text renderer style name without\n\t\t * subclassing, see <code>customContentLabelStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customContentLabelStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var contentLabelStyleName:String = DEFAULT_CHILD_STYLE_NAME_CONTENT_LABEL;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var contentImage:ImageLoader;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var contentLabel:ITextRenderer;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var content:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn DefaultGroupedListHeaderOrFooterRenderer.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _data:Object;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get data():Object\n\t\t{\n\t\t\treturn this._data;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set data(value:Object):void\n\t\t{\n\t\t\tif(this._data == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._data = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _groupIndex:int = -1;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get groupIndex():int\n\t\t{\n\t\t\treturn this._groupIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set groupIndex(value:int):void\n\t\t{\n\t\t\tthis._groupIndex = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _layoutIndex:int = -1;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get layoutIndex():int\n\t\t{\n\t\t\treturn this._layoutIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set layoutIndex(value:int):void\n\t\t{\n\t\t\tthis._layoutIndex = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _owner:GroupedList;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get owner():GroupedList\n\t\t{\n\t\t\treturn this._owner;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set owner(value:GroupedList):void\n\t\t{\n\t\t\tif(this._owner == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._owner = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _factoryID:String;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get factoryID():String\n\t\t{\n\t\t\treturn this._factoryID;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set factoryID(value:String):void\n\t\t{\n\t\t\tthis._factoryID = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalAlign:String = HorizontalAlign.LEFT;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"left,center,right,justify\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get horizontalAlign():String\n\t\t{\n\t\t\treturn this._horizontalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalAlign(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._horizontalAlign === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalAlign = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalAlign:String = VerticalAlign.MIDDLE;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"top,middle,bottom,justify\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get verticalAlign():String\n\t\t{\n\t\t\treturn _verticalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalAlign(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._verticalAlign === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalAlign = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _contentField:String = \"content\";\n\n\t\t/**\n\t\t * The field in the item that contains a display object to be positioned\n\t\t * in the content position of the renderer. If you wish to display a\n\t\t * texture in the content position, it's better for performance to use\n\t\t * <code>contentSourceField</code> instead.\n\t\t *\n\t\t * <p>All of the content fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>contentSourceFunction</code></li>\n\t\t *     <li><code>contentSourceField</code></li>\n\t\t *     <li><code>contentLabelFunction</code></li>\n\t\t *     <li><code>contentLabelField</code></li>\n\t\t *     <li><code>contentFunction</code></li>\n\t\t *     <li><code>contentField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the content field is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.contentField = \"header\";</listing>\n\t\t *\n\t\t * @default \"content\"\n\t\t *\n\t\t * @see #contentSourceField\n\t\t * @see #contentFunction\n\t\t * @see #contentSourceFunction\n\t\t * @see #contentLabelField\n\t\t * @see #contentLabelFunction\n\t\t */\n\t\tpublic function get contentField():String\n\t\t{\n\t\t\treturn this._contentField;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set contentField(value:String):void\n\t\t{\n\t\t\tif(this._contentField == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._contentField = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _contentFunction:Function;\n\n\t\t/**\n\t\t * A function that returns a display object to be positioned in the\n\t\t * content position of the renderer. If you wish to display a texture in\n\t\t * the content position, it's better for performance to use\n\t\t * <code>contentSourceFunction</code> instead.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function( item:Object ):DisplayObject</pre>\n\t\t *\n\t\t * <p>All of the content fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>contentSourceFunction</code></li>\n\t\t *     <li><code>contentSourceField</code></li>\n\t\t *     <li><code>contentLabelFunction</code></li>\n\t\t *     <li><code>contentLabelField</code></li>\n\t\t *     <li><code>contentFunction</code></li>\n\t\t *     <li><code>contentField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the content function is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.contentFunction = function( item:Object ):DisplayObject\n\t\t * {\n\t\t *    if(item in cachedContent)\n\t\t *    {\n\t\t *        return cachedContent[item];\n\t\t *    }\n\t\t *    var content:DisplayObject = createContentForHeader( item );\n\t\t *    cachedContent[item] = content;\n\t\t *    return content;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #contentField\n\t\t * @see #contentSourceField\n\t\t * @see #contentSourceFunction\n\t\t * @see #contentLabelField\n\t\t * @see #contentLabelFunction\n\t\t */\n\t\tpublic function get contentFunction():Function\n\t\t{\n\t\t\treturn this._contentFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set contentFunction(value:Function):void\n\t\t{\n\t\t\tif(this._contentFunction == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._contentFunction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _contentSourceField:String = \"source\";\n\n\t\t/**\n\t\t * The field in the data that contains a <code>starling.textures.Texture</code>\n\t\t * or a URL that points to a bitmap to be used as the renderer's\n\t\t * content. The renderer will automatically manage and reuse an internal\n\t\t * <code>ImageLoader</code> sub-component and this value will be passed\n\t\t * to the <code>source</code> property. The <code>ImageLoader</code> may\n\t\t * be customized by changing the <code>contentLoaderFactory</code>.\n\t\t *\n\t\t * <p>Using an content source will result in better performance than\n\t\t * passing in an <code>ImageLoader</code> or <code>Image</code> through\n\t\t * <code>contentField</code> or <code>contentFunction</code> because the\n\t\t * renderer can avoid costly display list manipulation.</p>\n\t\t *\n\t\t * <p>All of the content fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>contentSourceFunction</code></li>\n\t\t *     <li><code>contentSourceField</code></li>\n\t\t *     <li><code>contentLabelFunction</code></li>\n\t\t *     <li><code>contentLabelField</code></li>\n\t\t *     <li><code>contentFunction</code></li>\n\t\t *     <li><code>contentField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the content source field is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.contentSourceField = \"texture\";</listing>\n\t\t *\n\t\t * @default \"source\"\n\t\t *\n\t\t * @see feathers.controls.ImageLoader#source\n\t\t * @see #contentLoaderFactory\n\t\t * @see #contentSourceFunction\n\t\t * @see #contentField\n\t\t * @see #contentFunction\n\t\t * @see #contentLabelField\n\t\t * @see #contentLabelFunction\n\t\t */\n\t\tpublic function get contentSourceField():String\n\t\t{\n\t\t\treturn this._contentSourceField;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set contentSourceField(value:String):void\n\t\t{\n\t\t\tif(this._contentSourceField == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._contentSourceField = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _contentSourceFunction:Function;\n\n\t\t/**\n\t\t * A function used to generate a <code>starling.textures.Texture</code>\n\t\t * or a URL that points to a bitmap to be used as the renderer's\n\t\t * content. The renderer will automatically manage and reuse an internal\n\t\t * <code>ImageLoader</code> sub-component and this value will be passed\n\t\t * to the <code>source</code> property. The <code>ImageLoader</code> may\n\t\t * be customized by changing the <code>contentLoaderFactory</code>.\n\t\t *\n\t\t * <p>Using an content source will result in better performance than\n\t\t * passing in an <code>ImageLoader</code> or <code>Image</code> through\n\t\t * <code>contentField</code> or <code>contentFunction</code> because the\n\t\t * renderer can avoid costly display list manipulation.</p>\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function( item:Object ):Object</pre>\n\t\t *\n\t\t * <p>The return value is a valid value for the <code>source</code>\n\t\t * property of an <code>ImageLoader</code> component.</p>\n\t\t *\n\t\t * <p>All of the content fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>contentSourceFunction</code></li>\n\t\t *     <li><code>contentSourceField</code></li>\n\t\t *     <li><code>contentLabelFunction</code></li>\n\t\t *     <li><code>contentLabelField</code></li>\n\t\t *     <li><code>contentFunction</code></li>\n\t\t *     <li><code>contentField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the content source function is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.contentSourceFunction = function( item:Object ):Object\n\t\t * {\n\t\t *    return \"http://www.example.com/thumbs/\" + item.name + \"-thumb.png\";\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.controls.ImageLoader#source\n\t\t * @see #contentLoaderFactory\n\t\t * @see #contentSourceField\n\t\t * @see #contentField\n\t\t * @see #contentFunction\n\t\t * @see #contentLabelField\n\t\t * @see #contentLabelFunction\n\t\t */\n\t\tpublic function get contentSourceFunction():Function\n\t\t{\n\t\t\treturn this._contentSourceFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set contentSourceFunction(value:Function):void\n\t\t{\n\t\t\tif(this.contentSourceFunction == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._contentSourceFunction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _contentLabelField:String = \"label\";\n\n\t\t/**\n\t\t * The field in the item that contains a string to be displayed in a\n\t\t * renderer-managed <code>Label</code> in the content position of the\n\t\t * renderer. The renderer will automatically reuse an internal\n\t\t * <code>Label</code> and swap the text when the data changes. This\n\t\t * <code>Label</code> may be skinned by changing the\n\t\t * <code>contentLabelFactory</code>.\n\t\t *\n\t\t * <p>Using an content label will result in better performance than\n\t\t * passing in a <code>Label</code> through a <code>contentField</code>\n\t\t * or <code>contentFunction</code> because the renderer can avoid\n\t\t * costly display list manipulation.</p>\n\t\t *\n\t\t * <p>All of the content fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>contentTextureFunction</code></li>\n\t\t *     <li><code>contentTextureField</code></li>\n\t\t *     <li><code>contentLabelFunction</code></li>\n\t\t *     <li><code>contentLabelField</code></li>\n\t\t *     <li><code>contentFunction</code></li>\n\t\t *     <li><code>contentField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the content label field is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.contentLabelField = \"text\";</listing>\n\t\t *\n\t\t * @default \"label\"\n\t\t *\n\t\t * @see #contentLabelFactory\n\t\t * @see #contentLabelFunction\n\t\t * @see #contentField\n\t\t * @see #contentFunction\n\t\t * @see #contentSourceField\n\t\t * @see #contentSourceFunction\n\t\t */\n\t\tpublic function get contentLabelField():String\n\t\t{\n\t\t\treturn this._contentLabelField;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set contentLabelField(value:String):void\n\t\t{\n\t\t\tif(this._contentLabelField == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._contentLabelField = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _contentLabelFunction:Function;\n\n\t\t/**\n\t\t * A function that returns a string to be displayed in a\n\t\t * renderer-managed <code>Label</code> in the content position of the\n\t\t * renderer. The renderer will automatically reuse an internal\n\t\t * <code>Label</code> and swap the text when the data changes. This\n\t\t * <code>Label</code> may be skinned by changing the\n\t\t * <code>contentLabelFactory</code>.\n\t\t *\n\t\t * <p>Using an content label will result in better performance than\n\t\t * passing in a <code>Label</code> through a <code>contentField</code>\n\t\t * or <code>contentFunction</code> because the renderer can avoid\n\t\t * costly display list manipulation.</p>\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function( item:Object ):String</pre>\n\t\t *\n\t\t * <p>All of the content fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>contentTextureFunction</code></li>\n\t\t *     <li><code>contentTextureField</code></li>\n\t\t *     <li><code>contentLabelFunction</code></li>\n\t\t *     <li><code>contentLabelField</code></li>\n\t\t *     <li><code>contentFunction</code></li>\n\t\t *     <li><code>contentField</code></li>\n\t\t * </ol>\n\t\t *\n\t\t * <p>In the following example, the content label function is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.contentLabelFunction = function( item:Object ):String\n\t\t * {\n\t\t *    return item.category + \" > \" + item.subCategory;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #contentLabelFactory\n\t\t * @see #contentLabelField\n\t\t * @see #contentField\n\t\t * @see #contentFunction\n\t\t * @see #contentSourceField\n\t\t * @see #contentSourceFunction\n\t\t */\n\t\tpublic function get contentLabelFunction():Function\n\t\t{\n\t\t\treturn this._contentLabelFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set contentLabelFunction(value:Function):void\n\t\t{\n\t\t\tif(this._contentLabelFunction == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._contentLabelFunction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _contentLoaderFactory:Function = defaultImageLoaderFactory;\n\n\t\t/**\n\t\t * A function that generates an <code>ImageLoader</code> that uses the result\n\t\t * of <code>contentSourceField</code> or <code>contentSourceFunction</code>.\n\t\t * Useful for transforming the <code>ImageLoader</code> in some way. For\n\t\t * example, you might want to scale it for current screen density or\n\t\t * apply pixel snapping.\n\t\t *\n\t\t * <p>In the following example, a custom content loader factory is passed\n\t\t * to the renderer:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.contentLoaderFactory = function():ImageLoader\n\t\t * {\n\t\t *     var loader:ImageLoader = new ImageLoader();\n\t\t *     loader.scaleFactor = 2;\n\t\t *     return loader;\n\t\t * };</listing>\n\t\t *\n\t\t * @default function():ImageLoader { return new ImageLoader(); }\n\t\t *\n\t\t * @see feathers.controls.ImageLoader\n\t\t * @see #contentSourceField\n\t\t * @see #contentSourceFunction\n\t\t */\n\t\tpublic function get contentLoaderFactory():Function\n\t\t{\n\t\t\treturn this._contentLoaderFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set contentLoaderFactory(value:Function):void\n\t\t{\n\t\t\tif(this._contentLoaderFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._contentLoaderFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fontStylesSet:FontStylesSet;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get fontStyles():TextFormat\n\t\t{\n\t\t\treturn this._fontStylesSet.format;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set fontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._fontStylesSet.format;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._fontStylesSet.format = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get disabledFontStyles():TextFormat\n\t\t{\n\t\t\treturn this._fontStylesSet.disabledFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disabledFontStyles(value:TextFormat):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar savedCallee:Function = arguments.callee;\n\t\t\tfunction changeHandler(event:Event):void\n\t\t\t{\n\t\t\t\tprocessStyleRestriction(savedCallee);\n\t\t\t}\n\t\t\tvar oldValue:TextFormat = this._fontStylesSet.disabledFormat;\n\t\t\tif(oldValue !== null)\n\t\t\t{\n\t\t\t\toldValue.removeEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t\tthis._fontStylesSet.disabledFormat = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tvalue.addEventListener(Event.CHANGE, changeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _wordWrap:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get wordWrap():Boolean\n\t\t{\n\t\t\treturn this._wordWrap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set wordWrap(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._wordWrap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _contentLabelFactory:Function;\n\n\t\t/**\n\t\t * A function that generates an <code>ITextRenderer</code> that uses the result\n\t\t * of <code>contentLabelField</code> or <code>contentLabelFunction</code>.\n\t\t * Can be used to set properties on the <code>ITextRenderer</code>.\n\t\t *\n\t\t * <p>In the following example, a custom content label factory is passed\n\t\t * to the renderer:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.contentLabelFactory = function():ITextRenderer\n\t\t * {\n\t\t *     var renderer:TextFieldTextRenderer = new TextFieldTextRenderer();\n\t\t *     renderer.textFormat = new TextFormat( \"Source Sans Pro\", 16, 0x333333 );\n\t\t *     renderer.embedFonts = true;\n\t\t *     return renderer;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.ITextRenderer\n\t\t * @see feathers.core.FeathersControl#defaultTextRendererFactory\n\t\t * @see #contentLabelField\n\t\t * @see #contentLabelFunction\n\t\t */\n\t\tpublic function get contentLabelFactory():Function\n\t\t{\n\t\t\treturn this._contentLabelFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set contentLabelFactory(value:Function):void\n\t\t{\n\t\t\tif(this._contentLabelFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._contentLabelFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customContentLabelStyleName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customContentLabelStyleName():String\n\t\t{\n\t\t\treturn this._customContentLabelStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customContentLabelStyleName(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._customContentLabelStyleName === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customContentLabelStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_TEXT_RENDERER);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _contentLabelProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the content label text renderer\n\t\t * sub-component, and the properties will be passed down to the\n\t\t * text renderer when this component validates. The available properties\n\t\t * depend on which <code>ITextRenderer</code> implementation is returned\n\t\t * by <code>contentLabelFactory</code>. Refer to\n\t\t * <a href=\"../../core/ITextRenderer.html\"><code>feathers.core.ITextRenderer</code></a>\n\t\t * for a list of available text renderer implementations.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>In the following example, a custom content label properties are\n\t\t * customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.contentLabelProperties.textFormat = new TextFormat( \"Source Sans Pro\", 16, 0x333333 );\n\t\t * renderer.contentLabelProperties.embedFonts = true;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.ITextRenderer\n\t\t * @see #contentLabelField\n\t\t * @see #contentLabelFunction\n\t\t */\n\t\tpublic function get contentLabelProperties():Object\n\t\t{\n\t\t\tif(!this._contentLabelProperties)\n\t\t\t{\n\t\t\t\tthis._contentLabelProperties = new PropertyProxy(contentLabelProperties_onChange);\n\t\t\t}\n\t\t\treturn this._contentLabelProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set contentLabelProperties(value:Object):void\n\t\t{\n\t\t\tif(this._contentLabelProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._contentLabelProperties)\n\t\t\t{\n\t\t\t\tthis._contentLabelProperties.removeOnChangeCallback(contentLabelProperties_onChange);\n\t\t\t}\n\t\t\tthis._contentLabelProperties = PropertyProxy(value);\n\t\t\tif(this._contentLabelProperties)\n\t\t\t{\n\t\t\t\tthis._contentLabelProperties.addOnChangeCallback(contentLabelProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMaxWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitBackgroundMaxHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitContentWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitContentHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitContentMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitContentMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitContentMaxWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitContentMaxHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var currentBackgroundSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _backgroundSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundSkin():DisplayObject\n\t\t{\n\t\t\treturn this._backgroundSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSkin !== null &&\n\t\t\t\tthis.currentBackgroundSkin === this._backgroundSkin)\n\t\t\t{\n\t\t\t\tthis.removeCurrentBackgroundSkin(this._backgroundSkin);\n\t\t\t\tthis.currentBackgroundSkin = null;\n\t\t\t}\n\t\t\tthis._backgroundSkin = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _backgroundDisabledSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundDisabledSkin():DisplayObject\n\t\t{\n\t\t\treturn this._backgroundDisabledSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundDisabledSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundDisabledSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundDisabledSkin !== null &&\n\t\t\t\tthis.currentBackgroundSkin === this._backgroundDisabledSkin)\n\t\t\t{\n\t\t\t\tthis.removeCurrentBackgroundSkin(this._backgroundDisabledSkin);\n\t\t\t\tthis.currentBackgroundSkin = null;\n\t\t\t}\n\t\t\tthis._backgroundDisabledSkin = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get padding():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set padding(value:Number):void\n\t\t{\n\t\t\tthis.paddingTop = value;\n\t\t\tthis.paddingRight = value;\n\t\t\tthis.paddingBottom = value;\n\t\t\tthis.paddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingTop:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingTop():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingTop(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingTop = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingRight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingRight():Number\n\t\t{\n\t\t\treturn this._paddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingRight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingBottom:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingBottom():Number\n\t\t{\n\t\t\treturn this._paddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingBottom = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingLeft:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._paddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingLeft = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * The number of text lines displayed by the renderer. The component may\n\t\t * contain multiple text lines if the text contains line breaks or if\n\t\t * the <code>wordWrap</code> property is enabled.\n\t\t *\n\t\t * @see #wordWrap\n\t\t */\n\t\tpublic function get numLines():int\n\t\t{\n\t\t\tif(this.contentLabel === null)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn this.contentLabel.numLines;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//we don't dispose it if the renderer is the parent because it'll\n\t\t\t//already get disposed in super.dispose()\n\t\t\tif(this._backgroundSkin !== null &&\n\t\t\t\tthis._backgroundSkin.parent !== this)\n\t\t\t{\n\t\t\t\tthis._backgroundSkin.dispose();\n\t\t\t}\n\t\t\tif(this._backgroundDisabledSkin !== null &&\n\t\t\t\tthis._backgroundDisabledSkin.parent !== this)\n\t\t\t{\n\t\t\t\tthis._backgroundDisabledSkin.dispose();\n\t\t\t}\n\n\t\t\t//the content may have come from outside of this class. it's up\n\t\t\t//to that code to dispose of the content. in fact, if we disposed\n\t\t\t//of it here, we might screw something up!\n\t\t\tif(this.content)\n\t\t\t{\n\t\t\t\tthis.content.removeFromParent();\n\t\t\t}\n\n\t\t\t//however, we need to dispose these, if they exist, since we made\n\t\t\t//them here.\n\t\t\tif(this.contentImage)\n\t\t\t{\n\t\t\t\tthis.contentImage.dispose();\n\t\t\t\tthis.contentImage = null;\n\t\t\t}\n\t\t\tif(this.contentLabel)\n\t\t\t{\n\t\t\t\tDisplayObject(this.contentLabel).dispose();\n\t\t\t\tthis.contentLabel = null;\n\t\t\t}\n\t\t\tif(this._fontStylesSet !== null)\n\t\t\t{\n\t\t\t\tthis._fontStylesSet.dispose();\n\t\t\t\tthis._fontStylesSet = null;\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * Uses the content fields and functions to generate content for a\n\t\t * specific group header or footer.\n\t\t *\n\t\t * <p>All of the content fields and functions, ordered by priority:</p>\n\t\t * <ol>\n\t\t *     <li><code>contentTextureFunction</code></li>\n\t\t *     <li><code>contentTextureField</code></li>\n\t\t *     <li><code>contentLabelFunction</code></li>\n\t\t *     <li><code>contentLabelField</code></li>\n\t\t *     <li><code>contentFunction</code></li>\n\t\t *     <li><code>contentField</code></li>\n\t\t * </ol>\n\t\t */\n\t\tprotected function itemToContent(item:Object):DisplayObject\n\t\t{\n\t\t\tif(this._contentSourceFunction != null)\n\t\t\t{\n\t\t\t\tvar source:Object = this._contentSourceFunction(item);\n\t\t\t\tthis.refreshContentSource(source);\n\t\t\t\treturn this.contentImage;\n\t\t\t}\n\t\t\telse if(this._contentSourceField != null && item && item.hasOwnProperty(this._contentSourceField))\n\t\t\t{\n\t\t\t\tsource = item[this._contentSourceField];\n\t\t\t\tthis.refreshContentSource(source);\n\t\t\t\treturn this.contentImage;\n\t\t\t}\n\t\t\telse if(this._contentLabelFunction != null)\n\t\t\t{\n\t\t\t\tvar labelResult:Object = this._contentLabelFunction(item);\n\t\t\t\tif(labelResult is String)\n\t\t\t\t{\n\t\t\t\t\tthis.refreshContentLabel(labelResult as String);\n\t\t\t\t}\n\t\t\t\telse if(labelResult !== null)\n\t\t\t\t{\n\t\t\t\t\tthis.refreshContentLabel(labelResult.toString());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.refreshContentLabel(null);\n\t\t\t\t}\n\t\t\t\treturn DisplayObject(this.contentLabel);\n\t\t\t}\n\t\t\telse if(this._contentLabelField != null && item && item.hasOwnProperty(this._contentLabelField))\n\t\t\t{\n\t\t\t\tlabelResult = item[this._contentLabelField];\n\t\t\t\tif(labelResult is String)\n\t\t\t\t{\n\t\t\t\t\tthis.refreshContentLabel(labelResult as String);\n\t\t\t\t}\n\t\t\t\telse if(labelResult !== null)\n\t\t\t\t{\n\t\t\t\t\tthis.refreshContentLabel(labelResult.toString());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.refreshContentLabel(null);\n\t\t\t\t}\n\t\t\t\treturn DisplayObject(this.contentLabel);\n\t\t\t}\n\t\t\telse if(this._contentFunction != null)\n\t\t\t{\n\t\t\t\treturn this._contentFunction(item) as DisplayObject;\n\t\t\t}\n\t\t\telse if(this._contentField != null && item && item.hasOwnProperty(this._contentField))\n\t\t\t{\n\t\t\t\treturn item[this._contentField] as DisplayObject;\n\t\t\t}\n\t\t\telse if(item is String)\n\t\t\t{\n\t\t\t\tthis.refreshContentLabel(item as String);\n\t\t\t\treturn DisplayObject(this.contentLabel);\n\t\t\t}\n\t\t\telse if(item !== null)\n\t\t\t{\n\t\t\t\tthis.refreshContentLabel(item.toString());\n\t\t\t\treturn DisplayObject(this.contentLabel);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.refreshContentLabel(null);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\n\t\t\tif(stylesInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshBackgroundSkin();\n\t\t\t}\n\n\t\t\tif(dataInvalid)\n\t\t\t{\n\t\t\t\tthis.commitData();\n\t\t\t}\n\n\t\t\tif(dataInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshContentLabelStyles();\n\t\t\t}\n\n\t\t\tif(dataInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshEnabled();\n\t\t\t}\n\n\t\t\tsizeInvalid = this.autoSizeIfNeeded() || sizeInvalid;\n\t\t\tthis.layoutChildren();\n\t\t}\n\n\t\t/**\n\t\t * If the component's dimensions have not been set explicitly, it will\n\t\t * measure its content and determine an ideal size for itself. If the\n\t\t * <code>explicitWidth</code> or <code>explicitHeight</code> member\n\t\t * variables are set, those value will be used without additional\n\t\t * measurement. If one is set, but not the other, the dimension with the\n\t\t * explicit value will not be measured, but the other non-explicit\n\t\t * dimension will still need measurement.\n\t\t *\n\t\t * <p>Calls <code>saveMeasurements()</code> to set up the\n\t\t * <code>actualWidth</code> and <code>actualHeight</code> member\n\t\t * variables used for layout.</p>\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t */\n\t\tprotected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar measureContent:IMeasureDisplayObject = this.content as IMeasureDisplayObject;\n\t\t\tif(this.contentLabel !== null)\n\t\t\t{\n\t\t\t\t//special case for label to allow word wrap\n\t\t\t\tvar labelMaxWidth:Number = this._explicitWidth;\n\t\t\t\tif(needsWidth)\n\t\t\t\t{\n\t\t\t\t\tlabelMaxWidth = this._explicitMaxWidth;\n\t\t\t\t}\n\t\t\t\tthis.contentLabel.maxWidth = labelMaxWidth - this._paddingLeft - this._paddingRight;\n\t\t\t\tthis.contentLabel.measureText(HELPER_POINT);\n\t\t\t}\n\t\t\telse if(this.content !== null)\n\t\t\t{\n\t\t\t\tif(this._horizontalAlign === HorizontalAlign.JUSTIFY && this._verticalAlign === VerticalAlign.JUSTIFY)\n\t\t\t\t{\n\t\t\t\t\tresetFluidChildDimensionsForMeasurement(this.content,\n\t\t\t\t\t\tthis._explicitWidth - this._paddingLeft - this._paddingRight,\n\t\t\t\t\t\tthis._explicitHeight - this._paddingTop - this._paddingBottom,\n\t\t\t\t\t\tthis._explicitMinWidth - this._paddingLeft - this._paddingRight,\n\t\t\t\t\t\tthis._explicitMinHeight - this._paddingTop - this._paddingBottom,\n\t\t\t\t\t\tthis._explicitMaxWidth - this._paddingLeft - this._paddingRight,\n\t\t\t\t\t\tthis._explicitMaxHeight - this._paddingTop - this._paddingBottom,\n\t\t\t\t\t\tthis._explicitContentWidth, this._explicitContentHeight,\n\t\t\t\t\t\tthis._explicitContentMinWidth, this._explicitContentMinHeight,\n\t\t\t\t\t\tthis._explicitContentMaxWidth, this._explicitContentMaxHeight);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.content.width = this._explicitContentWidth;\n\t\t\t\t\tthis.content.height = this._explicitContentHeight;\n\t\t\t\t\tif(measureContent !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tmeasureContent.minWidth = this._explicitContentMinWidth;\n\t\t\t\t\t\tmeasureContent.minHeight = this._explicitContentMinHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this.content is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this.content).validate();\n\t\t\t\t}\n\t\t\t}\n\t\t\tresetFluidChildDimensionsForMeasurement(this.currentBackgroundSkin,\n\t\t\t\tthis._explicitWidth, this._explicitHeight,\n\t\t\t\tthis._explicitMinWidth, this._explicitMinHeight,\n\t\t\t\tthis._explicitMaxWidth, this._explicitMaxHeight,\n\t\t\t\tthis._explicitBackgroundWidth, this._explicitBackgroundHeight,\n\t\t\t\tthis._explicitBackgroundMinWidth, this._explicitBackgroundMinHeight,\n\t\t\t\tthis._explicitBackgroundMaxWidth, this._explicitBackgroundMaxHeight);\n\t\t\tvar measureSkin:IMeasureDisplayObject = this.currentBackgroundSkin as IMeasureDisplayObject;\n\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tif(this.contentLabel !== null)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = HELPER_POINT.x;\n\t\t\t\t}\n\t\t\t\telse if(this.content !== null)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this.content.width;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewWidth = 0;\n\t\t\t\t}\n\t\t\t\tnewWidth += this._paddingLeft + this._paddingRight;\n\t\t\t\tif(this.currentBackgroundSkin !== null &&\n\t\t\t\t\tthis.currentBackgroundSkin.width > newWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this.currentBackgroundSkin.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tif(this.contentLabel !== null)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = HELPER_POINT.y;\n\t\t\t\t}\n\t\t\t\telse if(this.content !== null)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this.content.height;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewHeight = 0;\n\t\t\t\t}\n\t\t\t\tnewHeight += this._paddingTop + this._paddingBottom;\n\t\t\t\tif(this.currentBackgroundSkin !== null &&\n\t\t\t\t\tthis.currentBackgroundSkin.height > newHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this.currentBackgroundSkin.height;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tif(this.contentLabel !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = HELPER_POINT.x;\n\t\t\t\t}\n\t\t\t\telse if(measureContent !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = measureContent.minWidth;\n\t\t\t\t}\n\t\t\t\telse if(this.content !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = this.content.width;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = 0;\n\t\t\t\t}\n\t\t\t\tnewMinWidth += this._paddingLeft + this._paddingRight;\n\t\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(measureSkin !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(measureSkin.minWidth > newMinWidth)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinWidth = measureSkin.minWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._explicitBackgroundMinWidth > newMinWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = this._explicitBackgroundMinWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tif(this.contentLabel !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = HELPER_POINT.y;\n\t\t\t\t}\n\t\t\t\telse if(measureContent !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = measureContent.minHeight;\n\t\t\t\t}\n\t\t\t\telse if(this.content !== null)\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = this.content.height;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = 0;\n\t\t\t\t}\n\t\t\t\tnewMinHeight += this._paddingTop + this._paddingBottom;\n\t\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(measureSkin !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(measureSkin.minHeight > newMinHeight)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewMinHeight = measureSkin.minHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._explicitBackgroundMinHeight > newMinHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = this._explicitBackgroundMinHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshBackgroundSkin():void\n\t\t{\n\t\t\tvar oldBackgroundSkin:DisplayObject = this.currentBackgroundSkin;\n\t\t\tthis.currentBackgroundSkin = this._backgroundSkin;\n\t\t\tif(!this._isEnabled && this._backgroundDisabledSkin !== null)\n\t\t\t{\n\t\t\t\tthis.currentBackgroundSkin = this._backgroundDisabledSkin;\n\t\t\t}\n\t\t\tif(oldBackgroundSkin !== this.currentBackgroundSkin)\n\t\t\t{\n\t\t\t\tthis.removeCurrentBackgroundSkin(oldBackgroundSkin);\n\t\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tif(this.currentBackgroundSkin is IFeathersControl)\n\t\t\t\t\t{\n\t\t\t\t\t\tIFeathersControl(this.currentBackgroundSkin).initializeNow();\n\t\t\t\t\t}\n\t\t\t\t\tif(this.currentBackgroundSkin is IMeasureDisplayObject)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar measureSkin:IMeasureDisplayObject = IMeasureDisplayObject(this.currentBackgroundSkin);\n\t\t\t\t\t\tthis._explicitBackgroundWidth = measureSkin.explicitWidth;\n\t\t\t\t\t\tthis._explicitBackgroundHeight = measureSkin.explicitHeight;\n\t\t\t\t\t\tthis._explicitBackgroundMinWidth = measureSkin.explicitMinWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMinHeight = measureSkin.explicitMinHeight;\n\t\t\t\t\t\tthis._explicitBackgroundMaxWidth = measureSkin.explicitMaxWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMaxHeight = measureSkin.explicitMaxHeight;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._explicitBackgroundWidth = this.currentBackgroundSkin.width;\n\t\t\t\t\t\tthis._explicitBackgroundHeight = this.currentBackgroundSkin.height;\n\t\t\t\t\t\tthis._explicitBackgroundMinWidth = this._explicitBackgroundWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMinHeight = this._explicitBackgroundHeight;\n\t\t\t\t\t\tthis._explicitBackgroundMaxWidth = this._explicitBackgroundWidth;\n\t\t\t\t\t\tthis._explicitBackgroundMaxHeight = this._explicitBackgroundHeight;\n\t\t\t\t\t}\n\t\t\t\t\tthis.addChildAt(this.currentBackgroundSkin, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function removeCurrentBackgroundSkin(skin:DisplayObject):void\n\t\t{\n\t\t\tif(skin === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(skin.parent === this)\n\t\t\t{\n\t\t\t\t//we need to restore these values so that they won't be lost the\n\t\t\t\t//next time that this skin is used for measurement\n\t\t\t\tskin.width = this._explicitBackgroundWidth;\n\t\t\t\tskin.height = this._explicitBackgroundHeight;\n\t\t\t\tif(skin is IMeasureDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar measureSkin:IMeasureDisplayObject = IMeasureDisplayObject(skin);\n\t\t\t\t\tmeasureSkin.minWidth = this._explicitBackgroundMinWidth;\n\t\t\t\t\tmeasureSkin.minHeight = this._explicitBackgroundMinHeight;\n\t\t\t\t\tmeasureSkin.maxWidth = this._explicitBackgroundMaxWidth;\n\t\t\t\t\tmeasureSkin.maxHeight = this._explicitBackgroundMaxHeight;\n\t\t\t\t}\n\t\t\t\tskin.removeFromParent(false);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function commitData():void\n\t\t{\n\t\t\tif(this._owner)\n\t\t\t{\n\t\t\t\tvar newContent:DisplayObject = this.itemToContent(this._data);\n\t\t\t\tif(newContent !== this.content)\n\t\t\t\t{\n\t\t\t\t\tif(this.content !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.content.removeFromParent();\n\t\t\t\t\t}\n\t\t\t\t\tthis.content = newContent;\n\t\t\t\t\tif(this.content !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.addChild(this.content);\n\t\t\t\t\t\tif(this.content is IFeathersControl)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tIFeathersControl(this.content).initializeNow();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(this.content is IMeasureDisplayObject)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar measureSkin:IMeasureDisplayObject = IMeasureDisplayObject(this.content);\n\t\t\t\t\t\t\tthis._explicitContentWidth = measureSkin.explicitWidth;\n\t\t\t\t\t\t\tthis._explicitContentHeight = measureSkin.explicitHeight;\n\t\t\t\t\t\t\tthis._explicitContentMinWidth = measureSkin.explicitMinWidth;\n\t\t\t\t\t\t\tthis._explicitContentMinHeight = measureSkin.explicitMinHeight;\n\t\t\t\t\t\t\tthis._explicitContentMaxWidth = measureSkin.explicitMaxWidth;\n\t\t\t\t\t\t\tthis._explicitContentMaxHeight = measureSkin.explicitMaxHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._explicitContentWidth = this.content.width;\n\t\t\t\t\t\t\tthis._explicitContentHeight = this.content.height;\n\t\t\t\t\t\t\tthis._explicitContentMinWidth = this._explicitContentWidth;\n\t\t\t\t\t\t\tthis._explicitContentMinHeight = this._explicitContentHeight;\n\t\t\t\t\t\t\tthis._explicitContentMaxWidth = this._explicitContentWidth;\n\t\t\t\t\t\t\tthis._explicitContentMaxHeight = this._explicitContentHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(this.content)\n\t\t\t\t{\n\t\t\t\t\tthis.content.removeFromParent();\n\t\t\t\t\tthis.content = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshContentSource(source:Object):void\n\t\t{\n\t\t\tif(!this.contentImage)\n\t\t\t{\n\t\t\t\tthis.contentImage = this._contentLoaderFactory();\n\t\t\t}\n\t\t\tthis.contentImage.source = source;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshContentLabel(label:String):void\n\t\t{\n\t\t\tif(label !== null)\n\t\t\t{\n\t\t\t\tif(this.contentLabel === null)\n\t\t\t\t{\n\t\t\t\t\tvar factory:Function = this._contentLabelFactory != null ? this._contentLabelFactory : FeathersControl.defaultTextRendererFactory;\n\t\t\t\t\tthis.contentLabel = ITextRenderer(factory());\n\t\t\t\t\tvar contentLabelStyleName:String = this._customContentLabelStyleName != null ? this._customContentLabelStyleName : this.contentLabelStyleName;\n\t\t\t\t\tFeathersControl(this.contentLabel).styleNameList.add(contentLabelStyleName);\n\t\t\t\t}\n\t\t\t\tthis.contentLabel.text = label;\n\t\t\t}\n\t\t\telse if(this.contentLabel !== null)\n\t\t\t{\n\t\t\t\tDisplayObject(this.contentLabel).removeFromParent(true);\n\t\t\t\tthis.contentLabel = null;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshEnabled():void\n\t\t{\n\t\t\tif(this.content is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this.content).isEnabled = this._isEnabled;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshContentLabelStyles():void\n\t\t{\n\t\t\tif(this.contentLabel === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.contentLabel.fontStyles = this._fontStylesSet;\n\t\t\tthis.contentLabel.wordWrap = this._wordWrap;\n\t\t\tfor(var propertyName:String in this._contentLabelProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._contentLabelProperties[propertyName];\n\t\t\t\tthis.contentLabel[propertyName] = propertyValue;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutChildren():void\n\t\t{\n\t\t\tif(this.currentBackgroundSkin !== null)\n\t\t\t{\n\t\t\t\tthis.currentBackgroundSkin.width = this.actualWidth;\n\t\t\t\tthis.currentBackgroundSkin.height = this.actualHeight;\n\t\t\t}\n\n\t\t\tif(this.content === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this.contentLabel !== null)\n\t\t\t{\n\t\t\t\tthis.contentLabel.maxWidth = this.actualWidth - this._paddingLeft - this._paddingRight;\n\t\t\t}\n\n\t\t\tif(this.content is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this.content).validate();\n\t\t\t}\n\t\t\tswitch(this._horizontalAlign)\n\t\t\t{\n\t\t\t\tcase HorizontalAlign.CENTER:\n\t\t\t\t{\n\t\t\t\t\tthis.content.x = this._paddingLeft + (this.actualWidth - this._paddingLeft - this._paddingRight - this.content.width) / 2;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase HorizontalAlign.RIGHT:\n\t\t\t\t{\n\t\t\t\t\tthis.content.x = this.actualWidth - this._paddingRight - this.content.width;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase HorizontalAlign.JUSTIFY:\n\t\t\t\t{\n\t\t\t\t\tthis.content.x = this._paddingLeft;\n\t\t\t\t\tthis.content.width = this.actualWidth - this._paddingLeft - this._paddingRight;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: //left\n\t\t\t\t{\n\t\t\t\t\tthis.content.x = this._paddingLeft;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tswitch(this._verticalAlign)\n\t\t\t{\n\t\t\t\tcase VerticalAlign.TOP:\n\t\t\t\t{\n\t\t\t\t\tthis.content.y = this._paddingTop;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase VerticalAlign.BOTTOM:\n\t\t\t\t{\n\t\t\t\t\tthis.content.y = this.actualHeight - this._paddingBottom - this.content.height;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase VerticalAlign.JUSTIFY:\n\t\t\t\t{\n\t\t\t\t\tthis.content.y = this._paddingTop;\n\t\t\t\t\tthis.content.height = this.actualHeight - this._paddingTop - this._paddingBottom;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: //middle\n\t\t\t\t{\n\t\t\t\t\tthis.content.y = this._paddingTop + (this.actualHeight - this._paddingTop - this._paddingBottom - this.content.height) / 2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function fontStyles_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function contentLabelProperties_onChange(proxy:PropertyProxy, name:String):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/renderers/DefaultGroupedListItemRenderer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.renderers\n{\n\timport feathers.controls.GroupedList;\n\timport feathers.events.FeathersEventType;\n\timport feathers.skins.IStyleProvider;\n\n\t/**\n\t * The default item renderer for a GroupedList control. Supports up to three\n\t * optional sub-views, including a label to display text, an icon to display\n\t * an image, and an \"accessory\" to display a UI control or another display\n\t * object (with shortcuts for including a second image or a second label).\n\t *\n\t * @see feathers.controls.GroupedList\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class DefaultGroupedListItemRenderer extends BaseDefaultItemRenderer implements IGroupedListItemRenderer\n\t{\n\t\t/**\n\t\t * @copy feathers.controls.renderers.BaseDefaultItemRenderer#ALTERNATE_STYLE_NAME_DRILL_DOWN\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const ALTERNATE_STYLE_NAME_DRILL_DOWN:String = \"feathers-drill-down-item-renderer\";\n\n\t\t/**\n\t\t * @copy feathers.controls.renderers.BaseDefaultItemRenderer#ALTERNATE_STYLE_NAME_CHECK\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const ALTERNATE_STYLE_NAME_CHECK:String = \"feathers-check-item-renderer\";\n\n\t\t/**\n\t\t * @copy feathers.controls.renderers.BaseDefaultItemRenderer#DEFAULT_CHILD_STYLE_NAME_LABEL\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_LABEL:String = \"feathers-item-renderer-label\";\n\n\t\t/**\n\t\t * @copy feathers.controls.renderers.BaseDefaultItemRenderer#DEFAULT_CHILD_STYLE_NAME_ICON_LABEL\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_ICON_LABEL:String = \"feathers-item-renderer-icon-label\";\n\n\t\t/**\n\t\t * @copy feathers.controls.renderers.BaseDefaultItemRenderer#DEFAULT_CHILD_STYLE_NAME_ACCESSORY_LABEL\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_ACCESSORY_LABEL:String = \"feathers-item-renderer-accessory-label\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>DefaultGroupedListItemRenderer</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function DefaultGroupedListItemRenderer()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn DefaultGroupedListItemRenderer.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _groupIndex:int = -1;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get groupIndex():int\n\t\t{\n\t\t\treturn this._groupIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set groupIndex(value:int):void\n\t\t{\n\t\t\tthis._groupIndex = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _itemIndex:int = -1;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get itemIndex():int\n\t\t{\n\t\t\treturn this._itemIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set itemIndex(value:int):void\n\t\t{\n\t\t\tthis._itemIndex = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _layoutIndex:int = -1;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get layoutIndex():int\n\t\t{\n\t\t\treturn this._layoutIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set layoutIndex(value:int):void\n\t\t{\n\t\t\tthis._layoutIndex = value;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get owner():GroupedList\n\t\t{\n\t\t\treturn GroupedList(this._owner);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set owner(value:GroupedList):void\n\t\t{\n\t\t\tif(this._owner == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._owner)\n\t\t\t{\n\t\t\t\tthis._owner.removeEventListener(FeathersEventType.SCROLL_START, owner_scrollStartHandler);\n\t\t\t\tthis._owner.removeEventListener(FeathersEventType.SCROLL_COMPLETE, owner_scrollCompleteHandler);\n\t\t\t}\n\t\t\tthis._owner = value;\n\t\t\tif(this._owner)\n\t\t\t{\n\t\t\t\tvar list:GroupedList = GroupedList(this._owner);\n\t\t\t\tthis.isSelectableWithoutToggle = list.isSelectable;\n\t\t\t\tthis._owner.addEventListener(FeathersEventType.SCROLL_START, owner_scrollStartHandler);\n\t\t\t\tthis._owner.addEventListener(FeathersEventType.SCROLL_COMPLETE, owner_scrollCompleteHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tthis.owner = null;\n\t\t\tsuper.dispose();\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/controls/renderers/DefaultListItemRenderer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.renderers\n{\n\timport feathers.controls.List;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IValidating;\n\timport feathers.events.FeathersEventType;\n\timport feathers.skins.IStyleProvider;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t/**\n\t * An optional icon used to drag and drop the list item.\n\t *\n\t * <p>The following example gives the item renderer a drag icon:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * itemRenderer.dragIcon = new Image( texture );</listing>\n\t *\n\t * @default null\n\t */\n\t[Style(name=\"dragIcon\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The default item renderer for List control. Supports up to three optional\n\t * sub-views, including a label to display text, an icon to display an\n\t * image, and an \"accessory\" to display a UI control or another display\n\t * object (with shortcuts for including a second image or a second label).\n\t *\n\t * @see feathers.controls.List\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class DefaultListItemRenderer extends BaseDefaultItemRenderer implements IListItemRenderer, IDragAndDropItemRenderer\n\t{\n\t\t/**\n\t\t * @copy feathers.controls.renderers.BaseDefaultItemRenderer#ALTERNATE_STYLE_NAME_DRILL_DOWN\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const ALTERNATE_STYLE_NAME_DRILL_DOWN:String = \"feathers-drill-down-item-renderer\";\n\n\t\t/**\n\t\t * @copy feathers.controls.renderers.BaseDefaultItemRenderer#ALTERNATE_STYLE_NAME_CHECK\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const ALTERNATE_STYLE_NAME_CHECK:String = \"feathers-check-item-renderer\";\n\n\t\t/**\n\t\t * @copy feathers.controls.renderers.BaseDefaultItemRenderer#DEFAULT_CHILD_STYLE_NAME_LABEL\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_LABEL:String = \"feathers-item-renderer-label\";\n\n\t\t/**\n\t\t * @copy feathers.controls.renderers.BaseDefaultItemRenderer#DEFAULT_CHILD_STYLE_NAME_ICON_LABEL\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_ICON_LABEL:String = \"feathers-item-renderer-icon-label\";\n\n\t\t/**\n\t\t * @copy feathers.controls.renderers.BaseDefaultItemRenderer#DEFAULT_CHILD_STYLE_NAME_ACCESSORY_LABEL\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_ACCESSORY_LABEL:String = \"feathers-item-renderer-accessory-label\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>DefaultListItemRenderer</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function DefaultListItemRenderer()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn DefaultListItemRenderer.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _index:int = -1;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get index():int\n\t\t{\n\t\t\treturn this._index;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set index(value:int):void\n\t\t{\n\t\t\tthis._index = value;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get owner():List\n\t\t{\n\t\t\treturn List(this._owner);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set owner(value:List):void\n\t\t{\n\t\t\tif(this._owner === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._owner)\n\t\t\t{\n\t\t\t\tthis._owner.removeEventListener(FeathersEventType.SCROLL_START, owner_scrollStartHandler);\n\t\t\t\tthis._owner.removeEventListener(FeathersEventType.SCROLL_COMPLETE, owner_scrollCompleteHandler);\n\t\t\t}\n\t\t\tthis._owner = value;\n\t\t\tif(this._owner)\n\t\t\t{\n\t\t\t\tvar list:List = List(this._owner);\n\t\t\t\tthis.isSelectableWithoutToggle = list.isSelectable;\n\t\t\t\tif(list.allowMultipleSelection)\n\t\t\t\t{\n\t\t\t\t\t//toggling is forced in this case\n\t\t\t\t\tthis.isToggle = true;\n\t\t\t\t}\n\t\t\t\tthis._owner.addEventListener(FeathersEventType.SCROLL_START, owner_scrollStartHandler);\n\t\t\t\tthis._owner.addEventListener(FeathersEventType.SCROLL_COMPLETE, owner_scrollCompleteHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _dragEnabled:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get dragEnabled():Boolean\n\t\t{\n\t\t\treturn this._dragEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set dragEnabled(value:Boolean):void\n\t\t{\n\t\t\tif(this._dragEnabled === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._dragEnabled = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _dragIcon:DisplayObject = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get dragIcon():DisplayObject\n\t\t{\n\t\t\treturn this._dragIcon;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set dragIcon(value:DisplayObject):void\n\t\t{\n\t\t\tif(this._dragIcon === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._dragIcon !== null)\n\t\t\t{\n\t\t\t\tif(this._dragIcon is IFeathersControl)\n\t\t\t\t{\n\t\t\t\t\tIFeathersControl(this._dragIcon).removeEventListener(FeathersEventType.RESIZE, dragIcon_resizeHandler);\n\t\t\t\t}\n\t\t\t\t//if this icon needs to be reused somewhere else, we need to\n\t\t\t\t//properly clean it up\n\t\t\t\tif(this._dragIcon.parent === this)\n\t\t\t\t{\n\t\t\t\t\tthis._dragIcon.removeFromParent(false);\n\t\t\t\t}\n\t\t\t\tthis._dragIcon = null;\n\t\t\t}\n\t\t\tthis._dragIcon = value;\n\t\t\tif(this._dragIcon !== null)\n\t\t\t{\n\t\t\t\tthis.addChild(this._dragIcon);\n\t\t\t\tif(this._dragIcon is IFeathersControl)\n\t\t\t\t{\n\t\t\t\t\tIFeathersControl(this._dragIcon).addEventListener(FeathersEventType.RESIZE, dragIcon_resizeHandler);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _dragGap:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get dragGap():Number\n\t\t{\n\t\t\treturn this._dragGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set dragGap(value:Number):void\n\t\t{\n\t\t\tif(this._dragGap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._dragGap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _ignoreDragIconResizes:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get dragProxy():DisplayObject\n\t\t{\n\t\t\treturn this._dragIcon;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tthis.owner = null;\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function refreshOffsets():void\n\t\t{\n\t\t\tsuper.refreshOffsets();\n\t\t\tvar dragGap:Number = this._gap;\n\t\t\tif(this._dragGap === this._dragGap) //!isNaN\n\t\t\t{\n\t\t\t\tdragGap = this._dragGap;\n\t\t\t}\n\t\t\tif(this._dragEnabled && this._dragIcon !== null)\n\t\t\t{\n\t\t\t\tvar oldIgnoreIconResizes:Boolean = this._ignoreDragIconResizes;\n\t\t\t\tthis._ignoreDragIconResizes = true;\n\t\t\t\tif(this._dragIcon is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this._dragIcon).validate();\n\t\t\t\t}\n\t\t\t\tthis._ignoreDragIconResizes = oldIgnoreIconResizes;\n\t\t\t\tthis._leftOffset += this._dragIcon.width + dragGap;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function layoutContent():void\n\t\t{\n\t\t\tsuper.layoutContent();\n\t\t\tif(this._dragIcon !== null)\n\t\t\t{\n\t\t\t\tif(this._dragEnabled)\n\t\t\t\t{\n\t\t\t\t\tvar oldIgnoreIconResizes:Boolean = this._ignoreDragIconResizes;\n\t\t\t\t\tthis._ignoreDragIconResizes = true;\n\t\t\t\t\tif(this._dragIcon is IValidating)\n\t\t\t\t\t{\n\t\t\t\t\t\tIValidating(this._dragIcon).validate();\n\t\t\t\t\t}\n\t\t\t\t\tthis._ignoreDragIconResizes = oldIgnoreIconResizes;\n\t\t\t\t\tthis._dragIcon.x = this._paddingLeft;\n\t\t\t\t\tthis._dragIcon.y = this._paddingTop + ((this.actualHeight - this._paddingTop - this._paddingBottom) - this._dragIcon.height) / 2;\n\t\t\t\t\tthis._dragIcon.visible = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._dragIcon.visible = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dragIcon_resizeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreDragIconResizes)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/controls/renderers/DefaultTreeItemRenderer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.renderers\n{\n\timport feathers.controls.BasicButton;\n\timport feathers.controls.Tree;\n\timport feathers.controls.renderers.ITreeItemRenderer;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IStateObserver;\n\timport feathers.core.IValidating;\n\timport feathers.events.FeathersEventType;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.utils.touch.TapToTrigger;\n\n\timport flash.geom.Point;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.DisplayObjectContainer;\n\timport starling.events.Event;\n\n\t/**\n\t * The icon used to indicate if the tree item is a branch.\n\t *\n\t * <p>The following example gives the item renderer a branch icon:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * itemRenderer.branchIcon = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:branchOpenIcon\n\t * @see #style:branchClosedIcon\n\t */\n\t[Style(name=\"branchIcon\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The icon used to indicate if the tree item is an open branch. If\n\t * <code>null</code>, the <code>branchIcon</code> will be used instead.\n\t *\n\t * <p>The following example gives the item renderer a branch open icon:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * itemRenderer.branchOpenIcon = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:branchClosedIcon\n\t */\n\t[Style(name=\"branchOpenIcon\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The icon used to indicate if the tree item is a closed branch. If\n\t * <code>null</code>, the <code>branchIcon</code> will be used instead.\n\t *\n\t * <p>The following example gives the item renderer a branch closed icon:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * itemRenderer.branchClosedIcon = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:branchOpenIcon\n\t */\n\t[Style(name=\"branchClosedIcon\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The space, in pixels, between the disclosure icon and left edge of the\n\t * other children in the item renderer. If the value is <code>NaN</code>,\n\t * the value of the <code>gap</code> property will be used instead.\n\t *\n\t * <p>In the following example, the disclosure gap is set to 20 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * itemRenderer.disclosureGap = 20;</listing>\n\t *\n\t * @default NaN\n\t *\n\t * @see #style:gap\n\t */\n\t[Style(name=\"disclosureGap\",type=\"Number\")]\n\n\t/**\n\t * The icon used to indicate if the tree item is open or closed.\n\t *\n\t * <p>The following example gives the item renderer a disclosure icon:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * itemRenderer.disclosureIcon = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:disclosureOpenIcon\n\t * @see #style:disclosureClosedIcon\n\t */\n\t[Style(name=\"disclosureIcon\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The icon used to indicate if the tree item is open. If\n\t * <code>null</code>, the <code>disclosureIcon</code> will be used instead.\n\t *\n\t * <p>The following example gives the item renderer a disclosure open icon:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * itemRenderer.disclosureOpenIcon = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:disclosureClosedIcon\n\t */\n\t[Style(name=\"disclosureOpenIcon\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The icon used to indicate if the tree item is closed. If\n\t * <code>null</code>, the <code>disclosureIcon</code> will be used instead.\n\t *\n\t * <p>The following example gives the item renderer a disclosure closed icon:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * itemRenderer.disclosureClosedIcon = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:disclosureOpenIcon\n\t */\n\t[Style(name=\"disclosureClosedIcon\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The size, in pixels, of the indentation when an item is a child of a branch.\n\t *\n\t * <p>In the following example, the indentation is set to 15 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * itemRenderer.indentation = 15;</listing>\n\t *\n\t * @default 10\n\t */\n\t[Style(name=\"indentation\",type=\"Number\")]\n\n\t/**\n\t * The icon used to indicate if the tree item is a leaf.\n\t *\n\t * <p>The following example gives the item renderer a leaf icon:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * itemRenderer.leafIcon = new Image( texture );</listing>\n\t *\n\t * @default null\n\t */\n\t[Style(name=\"leafIcon\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * The default item renderer for Tree control. Supports up to three optional\n\t * sub-views, including a label to display text, an icon to display an\n\t * image, and an \"accessory\" to display a UI control or another display\n\t * object (with shortcuts for including a second image or a second label).\n\t *\n\t * @see feathers.controls.Tree\n\t *\n\t * @productversion Feathers 3.3.0\n\t */\n\tpublic class DefaultTreeItemRenderer extends BaseDefaultItemRenderer implements ITreeItemRenderer\n\t{\n\t\t/**\n\t\t * @copy feathers.controls.renderers.BaseDefaultItemRenderer#DEFAULT_CHILD_STYLE_NAME_LABEL\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_LABEL:String = \"feathers-item-renderer-label\";\n\n\t\t/**\n\t\t * @copy feathers.controls.renderers.BaseDefaultItemRenderer#DEFAULT_CHILD_STYLE_NAME_ICON_LABEL\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_ICON_LABEL:String = \"feathers-item-renderer-icon-label\";\n\n\t\t/**\n\t\t * @copy feathers.controls.renderers.BaseDefaultItemRenderer#DEFAULT_CHILD_STYLE_NAME_ACCESSORY_LABEL\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_ACCESSORY_LABEL:String = \"feathers-item-renderer-accessory-label\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>DefaultTreeItemRenderer</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function DefaultTreeItemRenderer()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.addEventListener(Event.TRIGGERED, treeItemRenderer_triggeredHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _ignoreDisclosureIconResizes:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _ignoreBranchOrLeafIconResizes:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _disclosureIconTapToTrigger:TapToTrigger = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentDisclosureIcon:DisplayObject = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _disclosureIcon:DisplayObject = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get disclosureIcon():DisplayObject\n\t\t{\n\t\t\treturn this._disclosureIcon;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disclosureIcon(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._disclosureIcon === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._disclosureIcon !== null &&\n\t\t\t\tthis._currentDisclosureIcon === this._disclosureIcon)\n\t\t\t{\n\t\t\t\t//if this icon needs to be reused somewhere else, we need to\n\t\t\t\t//properly clean it up\n\t\t\t\tthis.removeCurrentDisclosureIcon(this._disclosureIcon);\n\t\t\t\tthis._currentDisclosureIcon = null;\n\t\t\t}\n\t\t\tthis._disclosureIcon = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _disclosureOpenIcon:DisplayObject = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get disclosureOpenIcon():DisplayObject\n\t\t{\n\t\t\treturn this._disclosureOpenIcon;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disclosureOpenIcon(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._disclosureOpenIcon === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._disclosureOpenIcon !== null &&\n\t\t\t\tthis._currentDisclosureIcon === this._disclosureOpenIcon)\n\t\t\t{\n\t\t\t\t//if this icon needs to be reused somewhere else, we need to\n\t\t\t\t//properly clean it up\n\t\t\t\tthis.removeCurrentDisclosureIcon(this._disclosureOpenIcon);\n\t\t\t\tthis._currentDisclosureIcon = null;\n\t\t\t}\n\t\t\tthis._disclosureOpenIcon = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _disclosureClosedIcon:DisplayObject = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get disclosureClosedIcon():DisplayObject\n\t\t{\n\t\t\treturn this._disclosureClosedIcon;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disclosureClosedIcon(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._disclosureClosedIcon === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._disclosureClosedIcon !== null &&\n\t\t\t\tthis._currentDisclosureIcon === this._disclosureClosedIcon)\n\t\t\t{\n\t\t\t\t//if this icon needs to be reused somewhere else, we need to\n\t\t\t\t//properly clean it up\n\t\t\t\tthis.removeCurrentDisclosureIcon(this._disclosureClosedIcon);\n\t\t\t\tthis._currentDisclosureIcon = null;\n\t\t\t}\n\t\t\tthis._disclosureClosedIcon = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentBranchOrLeafIcon:DisplayObject = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _branchIcon:DisplayObject = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get branchIcon():DisplayObject\n\t\t{\n\t\t\treturn this._branchIcon;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set branchIcon(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._branchIcon === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._branchIcon !== null &&\n\t\t\t\tthis._currentBranchOrLeafIcon === this._branchIcon)\n\t\t\t{\n\t\t\t\t//if this icon needs to be reused somewhere else, we need to\n\t\t\t\t//properly clean it up\n\t\t\t\tthis.removeCurrentBranchOrLeafIcon(this._branchIcon);\n\t\t\t\tthis._currentBranchOrLeafIcon = null;\n\t\t\t}\n\t\t\tthis._branchIcon = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _branchOpenIcon:DisplayObject = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get branchOpenIcon():DisplayObject\n\t\t{\n\t\t\treturn this._branchOpenIcon;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set branchOpenIcon(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._branchOpenIcon === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._branchOpenIcon !== null &&\n\t\t\t\tthis._currentBranchOrLeafIcon === this._branchOpenIcon)\n\t\t\t{\n\t\t\t\t//if this icon needs to be reused somewhere else, we need to\n\t\t\t\t//properly clean it up\n\t\t\t\tthis.removeCurrentBranchOrLeafIcon(this._branchOpenIcon);\n\t\t\t\tthis._currentBranchOrLeafIcon = null;\n\t\t\t}\n\t\t\tthis._branchOpenIcon = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _branchClosedIcon:DisplayObject = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get branchClosedIcon():DisplayObject\n\t\t{\n\t\t\treturn this._branchClosedIcon;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set branchClosedIcon(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._branchOpenIcon === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._branchClosedIcon !== null &&\n\t\t\t\tthis._currentBranchOrLeafIcon === this._branchClosedIcon)\n\t\t\t{\n\t\t\t\t//if this icon needs to be reused somewhere else, we need to\n\t\t\t\t//properly clean it up\n\t\t\t\tthis.removeCurrentBranchOrLeafIcon(this._branchClosedIcon);\n\t\t\t\tthis._currentBranchOrLeafIcon = null;\n\t\t\t}\n\t\t\tthis._branchClosedIcon = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _leafIcon:DisplayObject = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get leafIcon():DisplayObject\n\t\t{\n\t\t\treturn this._leafIcon;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set leafIcon(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._leafIcon === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._leafIcon !== null &&\n\t\t\t\tthis._currentBranchOrLeafIcon === this._leafIcon)\n\t\t\t{\n\t\t\t\t//if this icon needs to be reused somewhere else, we need to\n\t\t\t\t//properly clean it up\n\t\t\t\tthis.removeCurrentBranchOrLeafIcon(this._leafIcon);\n\t\t\t\tthis._currentBranchOrLeafIcon = null;\n\t\t\t}\n\t\t\tthis._leafIcon = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn DefaultTreeItemRenderer.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get owner():Tree\n\t\t{\n\t\t\treturn Tree(this._owner);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set owner(value:Tree):void\n\t\t{\n\t\t\tif(this._owner === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._owner)\n\t\t\t{\n\t\t\t\tthis._owner.removeEventListener(FeathersEventType.SCROLL_START, owner_scrollStartHandler);\n\t\t\t\tthis._owner.removeEventListener(FeathersEventType.SCROLL_COMPLETE, owner_scrollCompleteHandler);\n\t\t\t}\n\t\t\tthis._owner = value;\n\t\t\tif(this._owner)\n\t\t\t{\n\t\t\t\tvar list:Tree = Tree(this._owner);\n\t\t\t\tthis.isSelectableWithoutToggle = list.isSelectable;\n\t\t\t\tthis._owner.addEventListener(FeathersEventType.SCROLL_START, owner_scrollStartHandler);\n\t\t\t\tthis._owner.addEventListener(FeathersEventType.SCROLL_COMPLETE, owner_scrollCompleteHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _location:Vector.<int> = null;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get location():Vector.<int>\n\t\t{\n\t\t\treturn this._location;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set location(value:Vector.<int>):void\n\t\t{\n\t\t\tif(this._location === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._location = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _layoutIndex:int = -1;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get layoutIndex():int\n\t\t{\n\t\t\treturn this._layoutIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set layoutIndex(value:int):void\n\t\t{\n\t\t\tthis._layoutIndex = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _indentation:Number = 10;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get indentation():Number\n\t\t{\n\t\t\treturn this._indentation;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set indentation(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._indentation == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._indentation = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _disclosureGap:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get disclosureGap():Number\n\t\t{\n\t\t\treturn this._disclosureGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disclosureGap(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._disclosureGap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._disclosureGap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isOpen:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get isOpen():Boolean\n\t\t{\n\t\t\treturn this._isOpen;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isOpen(value:Boolean):void\n\t\t{\n\t\t\tif(this._isOpen === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isOpen = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isBranch:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get isBranch():Boolean\n\t\t{\n\t\t\treturn this._isBranch;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isBranch(value:Boolean):void\n\t\t{\n\t\t\tif(this._isBranch === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isBranch = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//we don't dispose it if the item renderer is the parent because\n\t\t\t//it'll already get disposed in super.dispose()\n\t\t\tif(this._disclosureIcon !== null && this._disclosureIcon.parent !== this)\n\t\t\t{\n\t\t\t\tthis._disclosureIcon.dispose();\n\t\t\t}\n\t\t\tif(this._disclosureOpenIcon !== null && this._disclosureOpenIcon.parent !== this)\n\t\t\t{\n\t\t\t\tthis._disclosureOpenIcon.dispose();\n\t\t\t}\n\t\t\tif(this._disclosureClosedIcon !== null && this._disclosureClosedIcon.parent !== this)\n\t\t\t{\n\t\t\t\tthis._disclosureClosedIcon.dispose();\n\t\t\t}\n\t\t\tif(this._branchIcon !== null && this._branchIcon.parent !== this)\n\t\t\t{\n\t\t\t\tthis._branchIcon.dispose();\n\t\t\t}\n\t\t\tif(this._branchOpenIcon !== null && this._branchOpenIcon.parent !== this)\n\t\t\t{\n\t\t\t\tthis._branchOpenIcon.dispose();\n\t\t\t}\n\t\t\tif(this._branchClosedIcon !== null && this._branchClosedIcon.parent !== this)\n\t\t\t{\n\t\t\t\tthis._branchClosedIcon.dispose();\n\t\t\t}\n\t\t\tif(this._leafIcon !== null && this._leafIcon.parent !== this)\n\t\t\t{\n\t\t\t\tthis._leafIcon.dispose();\n\t\t\t}\n\t\t\tthis.owner = null;\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tif(dataInvalid || stateInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshDisclosureIcon();\n\t\t\t\tthis.refreshBranchOrLeafIcon();\n\t\t\t}\n\t\t\tsuper.draw();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function refreshOffsets():void\n\t\t{\n\t\t\tsuper.refreshOffsets();\n\t\t\tif(this._location !== null)\n\t\t\t{\n\t\t\t\t//if the data provider is empty, but the tree has a typicalItem,\n\t\t\t\t//the location will be null\n\t\t\t\tthis._leftOffset += this._indentation * (this._location.length - 1);\n\t\t\t}\n\t\t\tvar disclosureGap:Number = this._gap;\n\t\t\tif(this._disclosureGap === this._disclosureGap) //!isNaN\n\t\t\t{\n\t\t\t\tdisclosureGap = this._disclosureGap;\n\t\t\t}\n\t\t\tif(this._currentDisclosureIcon !== null)\n\t\t\t{\n\t\t\t\tvar oldIgnoreIconResizes:Boolean = this._ignoreDisclosureIconResizes;\n\t\t\t\tthis._ignoreDisclosureIconResizes = true;\n\t\t\t\tif(this._currentDisclosureIcon is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this._currentDisclosureIcon).validate();\n\t\t\t\t}\n\t\t\t\tthis._ignoreDisclosureIconResizes = oldIgnoreIconResizes;\n\t\t\t\tthis._leftOffset += this._currentDisclosureIcon.width + disclosureGap;\n\t\t\t\tif(this._isBranch)\n\t\t\t\t{\n\t\t\t\t\tthis._currentDisclosureIcon.visible = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._currentDisclosureIcon.visible = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._currentBranchOrLeafIcon !== null)\n\t\t\t{\n\t\t\t\toldIgnoreIconResizes = this._ignoreBranchOrLeafIconResizes;\n\t\t\t\tthis._ignoreBranchOrLeafIconResizes = true;\n\t\t\t\tif(this._currentBranchOrLeafIcon is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this._currentBranchOrLeafIcon).validate();\n\t\t\t\t}\n\t\t\t\tthis._ignoreBranchOrLeafIconResizes = oldIgnoreIconResizes;\n\t\t\t\tthis._leftOffset += this._currentBranchOrLeafIcon.width + disclosureGap;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function layoutContent():void\n\t\t{\n\t\t\tsuper.layoutContent();\n\t\t\tvar indent:Number = this._paddingLeft;\n\t\t\tif(this._location !== null)\n\t\t\t{\n\t\t\t\tindent += this._indentation * (this._location.length - 1);\n\t\t\t}\n\t\t\tif(this._currentDisclosureIcon !== null)\n\t\t\t{\n\t\t\t\tvar oldIgnoreIconResizes:Boolean = this._ignoreDisclosureIconResizes;\n\t\t\t\tthis._ignoreDisclosureIconResizes = true;\n\t\t\t\tif(this._currentDisclosureIcon is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this._currentDisclosureIcon).validate();\n\t\t\t\t}\n\t\t\t\tthis._ignoreDisclosureIconResizes = oldIgnoreIconResizes;\n\t\t\t\tthis._currentDisclosureIcon.x = indent;\n\t\t\t\tthis._currentDisclosureIcon.y = this._paddingTop + ((this.actualHeight - this._paddingTop - this._paddingBottom) - this._currentDisclosureIcon.height) / 2;\n\t\t\t\tindent += this._currentDisclosureIcon.width + this._gap;\n\t\t\t}\n\t\t\tif(this._currentBranchOrLeafIcon !== null)\n\t\t\t{\n\t\t\t\toldIgnoreIconResizes = this._ignoreBranchOrLeafIconResizes;\n\t\t\t\tthis._ignoreBranchOrLeafIconResizes = true;\n\t\t\t\tif(this._currentBranchOrLeafIcon is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this._currentBranchOrLeafIcon).validate();\n\t\t\t\t}\n\t\t\t\tthis._ignoreBranchOrLeafIconResizes = oldIgnoreIconResizes;\n\t\t\t\tthis._currentBranchOrLeafIcon.x = indent;\n\t\t\t\tthis._currentBranchOrLeafIcon.y = this._paddingTop + ((this.actualHeight - this._paddingTop - this._paddingBottom) - this._currentBranchOrLeafIcon.height) / 2;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function hitTestWithAccessory(localPosition:Point):Boolean\n\t\t{\n\t\t\tif(this._currentDisclosureIcon !== null)\n\t\t\t{\n\t\t\t\tif(this._currentDisclosureIcon is DisplayObjectContainer)\n\t\t\t\t{\n\t\t\t\t\tvar container:DisplayObjectContainer = DisplayObjectContainer(this._currentDisclosureIcon);\n\t\t\t\t\tif(container.contains(this.hitTest(localPosition)))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this.hitTest(localPosition) === this._currentDisclosureIcon)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn super.hitTestWithAccessory(localPosition);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getCurrentDisclosureIcon():DisplayObject\n\t\t{\n\t\t\tvar newIcon:DisplayObject = this._disclosureIcon;\n\t\t\tif(this._isOpen && this._disclosureOpenIcon !== null)\n\t\t\t{\n\t\t\t\tnewIcon = this._disclosureOpenIcon;\n\t\t\t}\n\t\t\telse if(!this._isOpen && this._disclosureClosedIcon !== null)\n\t\t\t{\n\t\t\t\tnewIcon = this._disclosureClosedIcon;\n\t\t\t}\n\t\t\treturn newIcon;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getCurrentBranchOrLeafIcon():DisplayObject\n\t\t{\n\t\t\tvar newIcon:DisplayObject = this._leafIcon;\n\t\t\tif(this._isBranch)\n\t\t\t{\n\t\t\t\tnewIcon = this._branchIcon;\n\t\t\t\tif(this._isOpen && this._branchOpenIcon !== null)\n\t\t\t\t{\n\t\t\t\t\tnewIcon = this._branchOpenIcon;\n\t\t\t\t}\n\t\t\t\telse if(!this._isOpen && this._branchClosedIcon !== null)\n\t\t\t\t{\n\t\t\t\t\tnewIcon = this._branchClosedIcon;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn newIcon;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function removeCurrentDisclosureIcon(icon:DisplayObject):void\n\t\t{\n\t\t\tif(icon === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(icon is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(icon).removeEventListener(FeathersEventType.RESIZE, currentDisclosureIcon_resizeHandler);\n\t\t\t}\n\t\t\ticon.removeEventListener(Event.TRIGGERED, disclosureIcon_triggeredHandler);\n\t\t\tif(icon is IStateObserver)\n\t\t\t{\n\t\t\t\tIStateObserver(icon).stateContext = null;\n\t\t\t}\n\t\t\tif(icon.parent === this)\n\t\t\t{\n\t\t\t\tthis.removeChild(icon, false);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function removeCurrentBranchOrLeafIcon(icon:DisplayObject):void\n\t\t{\n\t\t\tif(icon === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(icon is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(icon).removeEventListener(FeathersEventType.RESIZE, currentBranchOrLeafIcon_resizeHandler);\n\t\t\t}\n\t\t\tif(icon is IStateObserver)\n\t\t\t{\n\t\t\t\tIStateObserver(icon).stateContext = null;\n\t\t\t}\n\t\t\tif(icon.parent === this)\n\t\t\t{\n\t\t\t\tthis.removeChild(icon, false);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshDisclosureIcon():void\n\t\t{\n\t\t\tvar oldIcon:DisplayObject = this._currentDisclosureIcon;\n\t\t\tthis._currentDisclosureIcon = this.getCurrentDisclosureIcon();\n\t\t\tif(this._currentDisclosureIcon is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this._currentDisclosureIcon).isEnabled = this._isEnabled;\n\t\t\t}\n\t\t\tif(this._currentDisclosureIcon !== oldIcon)\n\t\t\t{\n\t\t\t\tif(oldIcon !== null)\n\t\t\t\t{\n\t\t\t\t\tthis.removeCurrentDisclosureIcon(oldIcon);\n\t\t\t\t}\n\t\t\t\tif(this._currentDisclosureIcon !== null)\n\t\t\t\t{\n\t\t\t\t\tif(this._currentDisclosureIcon is IStateObserver)\n\t\t\t\t\t{\n\t\t\t\t\t\tIStateObserver(this._currentDisclosureIcon).stateContext = this;\n\t\t\t\t\t}\n\t\t\t\t\tthis.addChild(this._currentDisclosureIcon);\n\t\t\t\t\tif(!(this._currentDisclosureIcon is BasicButton))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._disclosureIconTapToTrigger !== null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._disclosureIconTapToTrigger.target = this._currentDisclosureIcon;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._disclosureIconTapToTrigger = new TapToTrigger(this._currentDisclosureIcon);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis._currentDisclosureIcon.addEventListener(Event.TRIGGERED, disclosureIcon_triggeredHandler);\n\t\t\t\t\tif(this._currentDisclosureIcon is IFeathersControl)\n\t\t\t\t\t{\n\t\t\t\t\t\tIFeathersControl(this._currentDisclosureIcon).addEventListener(FeathersEventType.RESIZE, currentDisclosureIcon_resizeHandler);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._disclosureIconTapToTrigger = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshBranchOrLeafIcon():void\n\t\t{\n\t\t\tvar oldIcon:DisplayObject = this._currentBranchOrLeafIcon;\n\t\t\tthis._currentBranchOrLeafIcon = this.getCurrentBranchOrLeafIcon();\n\t\t\tif(this._currentBranchOrLeafIcon is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this._currentBranchOrLeafIcon).isEnabled = this._isEnabled;\n\t\t\t}\n\t\t\tif(this._currentBranchOrLeafIcon !== oldIcon)\n\t\t\t{\n\t\t\t\tif(oldIcon !== null)\n\t\t\t\t{\n\t\t\t\t\tthis.removeCurrentBranchOrLeafIcon(oldIcon);\n\t\t\t\t}\n\t\t\t\tif(this._currentBranchOrLeafIcon !== null)\n\t\t\t\t{\n\t\t\t\t\tif(this._currentBranchOrLeafIcon is IStateObserver)\n\t\t\t\t\t{\n\t\t\t\t\t\tIStateObserver(this._currentBranchOrLeafIcon).stateContext = this;\n\t\t\t\t\t}\n\t\t\t\t\tthis.addChild(this._currentBranchOrLeafIcon);\n\t\t\t\t\tif(this._currentBranchOrLeafIcon is IFeathersControl)\n\t\t\t\t\t{\n\t\t\t\t\t\tIFeathersControl(this._currentBranchOrLeafIcon).addEventListener(FeathersEventType.RESIZE, currentBranchOrLeafIcon_resizeHandler);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function disclosureIcon_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis.owner.toggleBranch(this._data, !this._isOpen);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function treeItemRenderer_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tif((this._currentDisclosureIcon !== null && !this._isQuickHitAreaEnabled) || !this._isBranch)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//if there is no disclosure icon, then the branch is toggled simply\n\t\t\t//by triggering it with a click/tap\n\t\t\tthis.owner.toggleBranch(this._data, !this._isOpen);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function currentDisclosureIcon_resizeHandler():void\n\t\t{\n\t\t\tif(this._ignoreDisclosureIconResizes)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function currentBranchOrLeafIcon_resizeHandler():void\n\t\t{\n\t\t\tif(this._ignoreBranchOrLeafIconResizes)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/controls/renderers/IDataGridCellRenderer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.renderers\n{\n\timport feathers.controls.DataGrid;\n\timport feathers.controls.DataGridColumn;\n\timport feathers.core.IToggle;\n\timport feathers.layout.ILayoutDisplayObject;\n\n\t/**\n\t * Interface to implement a renderer for a data grid cell.\n\t *\n\t * @productversion Feathers 3.4.0\n\t */\n\tpublic interface IDataGridCellRenderer extends IToggle, ILayoutDisplayObject\n\t{\n\t\t/**\n\t\t * An item from the data grid's data provider. The data may change if this\n\t\t * item renderer is reused for a new item because it's no longer needed\n\t\t * for the original item.\n\t\t *\n\t\t * <p>This property is set by the data grid, and should not be set manually.</p>\n\t\t *\n\t\t * @see #dataField\n\t\t */\n\t\tfunction get data():Object;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set data(value:Object):void;\n\n\t\t/**\n\t\t * The column where the cell is rendered in the data grid.\n\t\t *\n\t\t * <p>This property is set by the data grid, and should not be set manually.</p>\n\t\t */\n\t\tfunction get column():DataGridColumn;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set column(value:DataGridColumn):void;\n\n\t\t/**\n\t\t * The index (numeric position, starting from zero) of the item within\n\t\t * the data grid's columns.\n\t\t *\n\t\t * <p>This property is set by the data grid, and should not be set manually.</p>\n\t\t */\n\t\tfunction get columnIndex():int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set columnIndex(value:int):void;\n\n\t\t/**\n\t\t * The index (numeric position, starting from zero) of the item within\n\t\t * the data grid's data provider. Like the <code>data</code> property,\n\t\t * this value may change if this item renderer is reused by the list\n\t\t * for a different item.\n\t\t *\n\t\t * <p>This property is set by the data grid, and should not be set manually.</p>\n\t\t */\n\t\tfunction get rowIndex():int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set rowIndex(value:int):void;\n\n\t\t/**\n\t\t * The field used to access this column's data from the item within the\n\t\t * data grid's data provider. Like the <code>data</code> property, this\n\t\t * value may change if this item renderer is reused by the data grid\n\t\t * for a different item.\n\t\t *\n\t\t * <p>This property is set by the data grid, and should not be set manually.</p>\n\t\t *\n\t\t * @see #data\n\t\t */\n\t\tfunction get dataField():String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set dataField(value:String):void;\n\n\t\t/**\n\t\t * The data grid that contains this cell renderer.\n\t\t *\n\t\t * <p>This property is set by the data grid, and should not be set manually.</p>\n\t\t */\n\t\tfunction get owner():DataGrid;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set owner(value:DataGrid):void;\n\t}\n}"
  },
  {
    "path": "source/feathers/controls/renderers/IDataGridHeaderRenderer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.renderers\n{\n\timport feathers.controls.DataGrid;\n\timport feathers.controls.DataGridColumn;\n\timport feathers.core.IFeathersControl;\n\timport feathers.layout.ILayoutDisplayObject;\n\n\t/**\n\t * Dispatched when the the user taps or clicks the header renderer. The touch\n\t * must remain within the bounds of the header renderer on release to register\n\t * as a tap or a click.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.TRIGGERED\n\t *\n\t * @see feathers.utils.touch.TapToTrigger\n\t */\n\t[Event(name=\"triggered\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Interface to implement a renderer for a data grid header.\n\t *\n\t * @productversion Feathers 3.4.0\n\t */\n\tpublic interface IDataGridHeaderRenderer extends IFeathersControl, ILayoutDisplayObject\n\t{\n\t\t/**\n\t\t * A column from a data grid. The data may change if this header\n\t\t * renderer is reused for a new column because it's no longer needed\n\t\t * for the original column.\n\t\t *\n\t\t * <p>This property is set by the data grid, and should not be set manually.</p>\n\t\t */\n\t\tfunction get data():DataGridColumn;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set data(value:DataGridColumn):void;\n\n\t\t/**\n\t\t * The index of the header within the layout.\n\t\t *\n\t\t * <p>This property is set by the data grid, and should not be set manually.</p>\n\t\t */\n\t\tfunction get columnIndex():int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set columnIndex(value:int):void;\n\n\t\t/**\n\t\t * The data grid that contains this header renderer.\n\t\t *\n\t\t * <p>This property is set by the data grid, and should not be set manually.</p>\n\t\t */\n\t\tfunction get owner():DataGrid;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set owner(value:DataGrid):void;\n\n\t\t/**\n\t\t * Indicates if this column is sorted.\n\t\t *\n\t\t * <p>This property is set by the data grid, and should not be set manually.</p>\n\t\t *\n\t\t * @see feathers.data.SortOrder\n\t\t */\n\t\tfunction get sortOrder():String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set sortOrder(value:String):void;\n\t}\n}"
  },
  {
    "path": "source/feathers/controls/renderers/IDragAndDropItemRenderer.as",
    "content": "package feathers.controls.renderers\n{\n\timport starling.display.DisplayObject;\n\n\tpublic interface IDragAndDropItemRenderer\n\t{\n\t\t/**\n\t\t * Indicates if the owner has enabled drag actions.\n\t\t *\n\t\t * <p>This property is set by the list, and should not be set manually.</p>\n\t\t */\n\t\tfunction get dragEnabled():Boolean;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set dragEnabled(value:Boolean):void;\n\n\t\t/**\n\t\t * An optional display object to use to trigger drag and drop in the\n\t\t * list component. If <code>null</code>, the entire item renderer can\n\t\t * be dragged.\n\t\t */\n\t\tfunction get dragProxy():DisplayObject;\n\t}\n}"
  },
  {
    "path": "source/feathers/controls/renderers/IGroupedListFooterRenderer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.renderers\n{\n\timport feathers.controls.GroupedList;\n\timport feathers.core.IFeathersControl;\n\n\t/**\n\t * Interface to implement a renderer for a grouped list footer.\n\t *\n\t * @see feathers.controls.GroupedList\n\t *\n\t * @productversion Feathers 2.3.0\n\t */\n\tpublic interface IGroupedListFooterRenderer extends IFeathersControl\n\t{\n\t\t/**\n\t\t * Data for a footer renderer from the grouped list's data provider.\n\t\t * A footer renderer should be designed with the assumption that its\n\t\t * <code>data</code> will change as the list scrolls.\n\t\t *\n\t\t * <p>This property is set automatically by the list, and it should not\n\t\t * be set manually.</p>\n\t\t */\n\t\tfunction get data():Object;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set data(value:Object):void;\n\n\t\t/**\n\t\t * The index of the group within the data provider of the grouped list.\n\t\t *\n\t\t * <p>This property is set automatically by the list, and it should not\n\t\t * be set manually.</p>\n\t\t */\n\t\tfunction get groupIndex():int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set groupIndex(value:int):void;\n\n\t\t/**\n\t\t * The index of this display object within the layout.\n\t\t *\n\t\t * <p>This property is set automatically by the list, and it should not\n\t\t * be set manually.</p>\n\t\t */\n\t\tfunction get layoutIndex():int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set layoutIndex(value:int):void;\n\n\t\t/**\n\t\t * The grouped list that contains this footer renderer.\n\t\t *\n\t\t * <p>This property is set automatically by the list, and it should not\n\t\t * be set manually.</p>\n\t\t */\n\t\tfunction get owner():GroupedList;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set owner(value:GroupedList):void;\n\n\t\t/**\n\t\t * The ID of the factory used to create this footer renderer.\n\t\t *\n\t\t * <p>This property is set by the list, and should not be set manually.</p>\n\t\t */\n\t\tfunction get factoryID():String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set factoryID(value:String):void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/renderers/IGroupedListHeaderRenderer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.renderers\n{\n\timport feathers.controls.GroupedList;\n\timport feathers.core.IFeathersControl;\n\n\t/**\n\t * Interface to implement a renderer for a grouped list header.\n\t *\n\t * @see feathers.controls.GroupedList\n\t *\n\t * @productversion Feathers 2.3.0\n\t */\n\tpublic interface IGroupedListHeaderRenderer extends IFeathersControl\n\t{\n\t\t/**\n\t\t * Data for a header renderer from the grouped list's data provider.\n\t\t * A header renderer should be designed with the assumption that its\n\t\t * <code>data</code> will change as the list scrolls.\n\t\t *\n\t\t * <p>This property is set automatically by the list, and it should not\n\t\t * be set manually.</p>\n\t\t */\n\t\tfunction get data():Object;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set data(value:Object):void;\n\n\t\t/**\n\t\t * The index of the group within the data provider of the grouped list.\n\t\t *\n\t\t * <p>This property is set automatically by the list, and it should not\n\t\t * be set manually.</p>\n\t\t */\n\t\tfunction get groupIndex():int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set groupIndex(value:int):void;\n\n\t\t/**\n\t\t * The index of this display object within the layout.\n\t\t *\n\t\t * <p>This property is set automatically by the list, and it should not\n\t\t * be set manually.</p>\n\t\t */\n\t\tfunction get layoutIndex():int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set layoutIndex(value:int):void;\n\n\t\t/**\n\t\t * The grouped list that contains this header renderer.\n\t\t *\n\t\t * <p>This property is set automatically by the list, and it should not\n\t\t * be set manually.</p>\n\t\t */\n\t\tfunction get owner():GroupedList;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set owner(value:GroupedList):void;\n\n\t\t/**\n\t\t * The ID of the factory used to create this header renderer.\n\t\t *\n\t\t * <p>This property is set by the list, and should not be set manually.</p>\n\t\t */\n\t\tfunction get factoryID():String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set factoryID(value:String):void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/renderers/IGroupedListItemRenderer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.renderers\n{\n\timport feathers.controls.GroupedList;\n\timport feathers.core.IToggle;\n\n\t/**\n\t * Dispatched when the the user taps or clicks the item renderer. The touch\n\t * must remain within the bounds of the item renderer on release to register\n\t * as a tap or a click.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.TRIGGERED\n\t *\n\t * @see feathers.utils.touch.TapToTrigger\n\t */\n\t[Event(name=\"triggered\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Interface to implement a renderer for a grouped list item.\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic interface IGroupedListItemRenderer extends IToggle\n\t{\n\t\t/**\n\t\t * An item from the grouped list's data provider. The data may change if\n\t\t * this item renderer is reused for a new item because it's no longer\n\t\t * needed for the original item.\n\t\t *\n\t\t * <p>This property is set by the list, and should not be set manually.</p>\n\t\t */\n\t\tfunction get data():Object;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set data(value:Object):void;\n\n\t\t/**\n\t\t * The index of the item's parent group within the data provider of the\n\t\t * grouped list.\n\t\t *\n\t\t * <p>This property is set by the list, and should not be set manually.</p>\n\t\t */\n\t\tfunction get groupIndex():int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set groupIndex(value:int):void;\n\n\t\t/**\n\t\t * The index of the item within its parent group.\n\t\t *\n\t\t * <p>This property is set by the list, and should not be set manually.</p>\n\t\t */\n\t\tfunction get itemIndex():int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set itemIndex(value:int):void;\n\n\t\t/**\n\t\t * The index of the item within the layout.\n\t\t *\n\t\t * <p>This property is set by the list, and should not be set manually.</p>\n\t\t */\n\t\tfunction get layoutIndex():int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set layoutIndex(value:int):void;\n\n\t\t/**\n\t\t * The grouped list that contains this item renderer.\n\t\t *\n\t\t * <p>This property is set by the list, and should not be set manually.</p>\n\t\t */\n\t\tfunction get owner():GroupedList;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set owner(value:GroupedList):void;\n\n\t\t/**\n\t\t * The ID of the factory used to create this item renderer.\n\t\t *\n\t\t * <p>This property is set by the list, and should not be set manually.</p>\n\t\t */\n\t\tfunction get factoryID():String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set factoryID(value:String):void;\n\t}\n}"
  },
  {
    "path": "source/feathers/controls/renderers/IListItemRenderer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.renderers\n{\n\timport feathers.controls.List;\n\timport feathers.core.IToggle;\n\n\t/**\n\t * Dispatched when the the user taps or clicks the item renderer. The touch\n\t * must remain within the bounds of the item renderer on release to register\n\t * as a tap or a click.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.TRIGGERED\n\t *\n\t * @see feathers.utils.touch.TapToTrigger\n\t */\n\t[Event(name=\"triggered\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Interface to implement a renderer for a list item.\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic interface IListItemRenderer extends IToggle\n\t{\n\t\t/**\n\t\t * An item from the list's data provider. The data may change if this\n\t\t * item renderer is reused for a new item because it's no longer needed\n\t\t * for the original item.\n\t\t *\n\t\t * <p>This property is set by the list, and should not be set manually.</p>\n\t\t */\n\t\tfunction get data():Object;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set data(value:Object):void;\n\n\t\t/**\n\t\t * The index (numeric position, starting from zero) of the item within\n\t\t * the list's data provider. Like the <code>data</code> property, this\n\t\t * value may change if this item renderer is reused by the list for a\n\t\t * different item.\n\t\t *\n\t\t * <p>This property is set by the list, and should not be set manually.</p>\n\t\t */\n\t\tfunction get index():int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set index(value:int):void;\n\n\t\t/**\n\t\t * The list that contains this item renderer.\n\t\t *\n\t\t * <p>This property is set by the list, and should not be set manually.</p>\n\t\t */\n\t\tfunction get owner():List;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set owner(value:List):void;\n\n\t\t/**\n\t\t * The ID of the factory used to create this item renderer.\n\t\t *\n\t\t * <p>This property is set by the list, and should not be set manually.</p>\n\t\t */\n\t\tfunction get factoryID():String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set factoryID(value:String):void;\n\t}\n}"
  },
  {
    "path": "source/feathers/controls/renderers/ITreeItemRenderer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.renderers\n{\n\timport feathers.controls.Tree;\n\timport feathers.core.IToggle;\n\n\t/**\n\t * Dispatched when the the user taps or clicks the item renderer. The touch\n\t * must remain within the bounds of the item renderer on release to register\n\t * as a tap or a click.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.TRIGGERED\n\t *\n\t * @see feathers.utils.touch.TapToTrigger\n\t */\n\t[Event(name=\"triggered\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Interface to implement a renderer for a tree item.\n\t *\n\t * @productversion Feathers 3.3.0\n\t */\n\tpublic interface ITreeItemRenderer extends IToggle\n\t{\n\t\t/**\n\t\t * An item from the tree's data provider. The data may change if this\n\t\t * item renderer is reused for a new item because it's no longer needed\n\t\t * for the original item.\n\t\t *\n\t\t * <p>This property is set by the tree, and it should not be set manually.</p>\n\t\t */\n\t\tfunction get data():Object;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set data(value:Object):void;\n\n\t\t/**\n\t\t * The tree that contains this item renderer.\n\t\t *\n\t\t * <p>This property is set by the tree, and it should not be set manually.</p>\n\t\t */\n\t\tfunction get owner():Tree;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set owner(value:Tree):void;\n\n\t\t/**\n\t\t * The location (a vector of numeric indices, starting from zero) of\n\t\t * the item within the tree's data provider. Like the <code>data</code>\n\t\t * property, this value may change if this item renderer is reused by\n\t\t * the tree for a different item.\n\t\t *\n\t\t * <p>This property is set by the tree, and it should not be set manually.</p>\n\t\t */\n\t\tfunction get location():Vector.<int>;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set location(value:Vector.<int>):void;\n\n\t\t/**\n\t\t * The index of the item within the layout.\n\t\t *\n\t\t * <p>This property is set by the tree, and should not be set manually.</p>\n\t\t */\n\t\tfunction get layoutIndex():int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set layoutIndex(value:int):void;\n\n\t\t/**\n\t\t * The ID of the factory used to create this item renderer.\n\t\t *\n\t\t * <p>This property is set by the tree, and it should not be set manually.</p>\n\t\t */\n\t\tfunction get factoryID():String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set factoryID(value:String):void;\n\n\t\t/**\n\t\t * Indicates if the data is a branch or a leaf.\n\t\t *\n\t\t * <p>This property is set by the tree, and it should not be set manually.</p>\n\t\t *\n\t\t * @see #isOpen\n\t\t */\n\t\tfunction get isBranch():Boolean;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set isBranch(value:Boolean):void;\n\n\t\t/**\n\t\t * Indicates if a branch is open or closed. An item that is not a\n\t\t * branch will always return <code>false</code>.\n\t\t *\n\t\t * <p>This property is set by the tree, and it should not be set manually.</p>\n\t\t *\n\t\t * @see #isBranch\n\t\t */\n\t\tfunction get isOpen():Boolean;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set isOpen(value:Boolean):void;\n\t}\n}"
  },
  {
    "path": "source/feathers/controls/renderers/LayoutGroupDataGridCellRenderer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.renderers\n{\n\timport feathers.controls.DataGrid;\n\timport feathers.controls.DataGridColumn;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.skins.IStyleProvider;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t/**\n\t * The background to display behind all content when the item renderer\n\t * is selected. The background skin is resized to fill the full width\n\t * and height of the layout group.\n\t *\n\t * <p>In the following example, the group is given a selected background\n\t * skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * group.backgroundSelectedSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t */\n\t[Style(name=\"backgroundSelectedSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * Based on <code>LayoutGroup</code>, this component is meant as a base\n\t * class for creating a custom item renderer for a <code>DataGrid</code>\n\t * component.\n\t *\n\t * <p>Sub-components may be created and added inside <code>initialize()</code>.\n\t * This is a good place to add event listeners and to set the layout.</p>\n\t *\n\t * <p>The <code>data</code> property may be parsed inside <code>commitData()</code>.\n\t * Use this function to change properties in your sub-components.</p>\n\t *\n\t * <p>Sub-components may be positioned manually, but a layout may be\n\t * provided as well. An <code>AnchorLayout</code> is recommended for fluid\n\t * layouts that can automatically adjust positions when the grid resizes.\n\t * Create <code>AnchorLayoutData</code> objects to define the constraints.</p>\n\t *\n\t * @see feathers.controls.DataGrid\n\t *\n\t * @productversion Feathers 3.4.0\n\t */\n\tpublic class LayoutGroupDataGridCellRenderer extends LayoutGroup implements IDataGridCellRenderer\n\t{\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>LayoutGroupDataGridCellRenderer</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function LayoutGroupDataGridCellRenderer()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn LayoutGroupDataGridCellRenderer.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _rowIndex:int = -1;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get rowIndex():int\n\t\t{\n\t\t\treturn this._rowIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set rowIndex(value:int):void\n\t\t{\n\t\t\tthis._rowIndex = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _columnIndex:int = -1;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get columnIndex():int\n\t\t{\n\t\t\treturn this._columnIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set columnIndex(value:int):void\n\t\t{\n\t\t\tthis._columnIndex = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _owner:DataGrid = null;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get owner():DataGrid\n\t\t{\n\t\t\treturn this._owner;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set owner(value:DataGrid):void\n\t\t{\n\t\t\tif(this._owner == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._owner = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _data:Object = null;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get data():Object\n\t\t{\n\t\t\treturn this._data;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set data(value:Object):void\n\t\t{\n\t\t\tif(this._data == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._data = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\t//LayoutGroup doesn't know about INVALIDATION_FLAG_DATA, so we need\n\t\t\t//set set another flag that it understands.\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _dataField:String = null;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get dataField():String\n\t\t{\n\t\t\treturn this._dataField;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set dataField(value:String):void\n\t\t{\n\t\t\tif(this._dataField === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._dataField = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _column:DataGridColumn = null;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get column():DataGridColumn\n\t\t{\n\t\t\treturn this._column;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set column(value:DataGridColumn):void\n\t\t{\n\t\t\tif(this._column === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._column = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isSelected:Boolean;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get isSelected():Boolean\n\t\t{\n\t\t\treturn this._isSelected;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isSelected(value:Boolean):void\n\t\t{\n\t\t\tif(this._isSelected == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isSelected = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\t//the state flag is needed for updating the background\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STATE);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _backgroundSelectedSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundSelectedSkin():DisplayObject\n\t\t{\n\t\t\treturn this._backgroundSelectedSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundSelectedSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSelectedSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSelectedSkin !== null &&\n\t\t\t\tthis.currentBackgroundSkin === this._backgroundSelectedSkin)\n\t\t\t{\n\t\t\t\tthis.removeCurrentBackgroundSkin(this._backgroundSelectedSkin);\n\t\t\t\tthis.currentBackgroundSkin = null;\n\t\t\t}\n\t\t\tthis._backgroundSelectedSkin = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SKIN);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tthis.owner = null;\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\t//children are allowed to change during draw() in a subclass up\n\t\t\t//until it calls super.draw().\n\t\t\tthis._ignoreChildChangesButSetFlags = false;\n\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar scrollInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SCROLL);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\tvar layoutInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_LAYOUT);\n\n\t\t\tif(dataInvalid)\n\t\t\t{\n\t\t\t\tthis.commitData();\n\t\t\t}\n\n\t\t\tif(scrollInvalid || sizeInvalid || layoutInvalid)\n\t\t\t{\n\t\t\t\tthis._ignoreChildChanges = true;\n\t\t\t\tthis.preLayout();\n\t\t\t\tthis._ignoreChildChanges = false;\n\t\t\t}\n\n\t\t\tsuper.draw();\n\n\t\t\tif(scrollInvalid || sizeInvalid || layoutInvalid)\n\t\t\t{\n\t\t\t\tthis._ignoreChildChanges = true;\n\t\t\t\tthis.postLayout();\n\t\t\t\tthis._ignoreChildChanges = false;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Makes final changes to the layout before it updates the item\n\t\t * renderer's children. If your layout requires changing the\n\t\t * <code>layoutData</code> property on the item renderer's\n\t\t * sub-components, override the <code>preLayout()</code> function to\n\t\t * make those changes.\n\t\t *\n\t\t * <p>In subclasses, if you create properties that affect the layout,\n\t\t * invalidate using <code>INVALIDATION_FLAG_LAYOUT</code> to trigger a\n\t\t * call to the <code>preLayout()</code> function when the component\n\t\t * validates.</p>\n\t\t *\n\t\t * <p>The final width and height of the item renderer are not yet known\n\t\t * when this function is called. It is meant mainly for adjusting values\n\t\t * used by fluid layouts, such as constraints or percentages. If you\n\t\t * need io access the final width and height of the item renderer,\n\t\t * override the <code>postLayout()</code> function instead.</p>\n\t\t *\n\t\t * @see #postLayout()\n\t\t */\n\t\tprotected function preLayout():void\n\t\t{\n\n\t\t}\n\n\t\t/**\n\t\t * Called after the layout updates the item renderer's children. If any\n\t\t * children are excluded from the layout, you can update them in the\n\t\t * <code>postLayout()</code> function if you need to use the final width\n\t\t * and height in any calculations.\n\t\t *\n\t\t * <p>In subclasses, if you create properties that affect the layout,\n\t\t * invalidate using <code>INVALIDATION_FLAG_LAYOUT</code> to trigger a\n\t\t * call to the <code>postLayout()</code> function when the component\n\t\t * validates.</p>\n\t\t *\n\t\t * <p>To make changes to the layout before it updates the item\n\t\t * renderer's children, override the <code>preLayout()</code> function\n\t\t * instead.</p>\n\t\t *\n\t\t * @see #preLayout()\n\t\t */\n\t\tprotected function postLayout():void\n\t\t{\n\n\t\t}\n\n\t\t/**\n\t\t * Updates the renderer to display the item's data. Override this\n\t\t * function to pass data to sub-components and react to data changes.\n\t\t *\n\t\t * <p>Don't forget to handle the case where the data is <code>null</code>.</p>\n\t\t */\n\t\tprotected function commitData():void\n\t\t{\n\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function getCurrentBackgroundSkin():DisplayObject\n\t\t{\n\t\t\tif(!this._isEnabled && this._backgroundDisabledSkin !== null)\n\t\t\t{\n\t\t\t\treturn this._backgroundDisabledSkin;\n\t\t\t}\n\t\t\tif(this._isSelected && this._backgroundSelectedSkin !== null)\n\t\t\t{\n\t\t\t\treturn this._backgroundSelectedSkin;\n\t\t\t}\n\t\t\treturn this._backgroundSkin;\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/renderers/LayoutGroupGroupedListHeaderOrFooterRenderer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.renderers\n{\n\timport feathers.controls.GroupedList;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.skins.IStyleProvider;\n\n\timport starling.events.Event;\n\n\t/**\n\t * Based on <code>LayoutGroup</code>, this component is meant as a base\n\t * class for creating a custom header or footer renderer for a\n\t * <code>GroupedList</code> component.\n\t *\n\t * <p>Sub-components may be created and added inside <code>initialize()</code>.\n\t * This is a good place to add event listeners and to set the layout.</p>\n\t *\n\t * <p>The <code>data</code> property may be parsed inside <code>commitData()</code>.\n\t * Use this function to change properties in your sub-components.</p>\n\t *\n\t * <p>Sub-components may be positioned manually, but a layout may be\n\t * provided as well. An <code>AnchorLayout</code> is recommended for fluid\n\t * layouts that can automatically adjust positions when the list resizes.\n\t * Create <code>AnchorLayoutData</code> objects to define the constraints.</p>\n\t *\n\t * @see feathers.controls.GroupedList\n\t *\n\t * @productversion Feathers 1.2.0\n\t */\n\tpublic class LayoutGroupGroupedListHeaderOrFooterRenderer extends LayoutGroup implements IGroupedListHeaderRenderer, IGroupedListFooterRenderer\n\t{\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>LayoutGroupGroupedListHeaderOrFooterRenderer</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function LayoutGroupGroupedListHeaderOrFooterRenderer()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn LayoutGroupGroupedListHeaderOrFooterRenderer.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _groupIndex:int = -1;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get groupIndex():int\n\t\t{\n\t\t\treturn this._groupIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set groupIndex(value:int):void\n\t\t{\n\t\t\tthis._groupIndex = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _layoutIndex:int = -1;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get layoutIndex():int\n\t\t{\n\t\t\treturn this._layoutIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set layoutIndex(value:int):void\n\t\t{\n\t\t\tthis._layoutIndex = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _owner:GroupedList;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get owner():GroupedList\n\t\t{\n\t\t\treturn this._owner;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set owner(value:GroupedList):void\n\t\t{\n\t\t\tif(this._owner == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._owner = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _factoryID:String;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get factoryID():String\n\t\t{\n\t\t\treturn this._factoryID;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set factoryID(value:String):void\n\t\t{\n\t\t\tthis._factoryID = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _data:Object;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get data():Object\n\t\t{\n\t\t\treturn this._data;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set data(value:Object):void\n\t\t{\n\t\t\tif(this._data == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._data = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\t//LayoutGroup doesn't know about INVALIDATION_FLAG_DATA, so we need\n\t\t\t//set set another flag that it understands.\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isSelected:Boolean;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get isSelected():Boolean\n\t\t{\n\t\t\treturn this._isSelected;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isSelected(value:Boolean):void\n\t\t{\n\t\t\tif(this._isSelected == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isSelected = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tthis.owner = null;\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\t//children are allowed to change during draw() in a subclass up\n\t\t\t//until it calls super.draw().\n\t\t\tthis._ignoreChildChangesButSetFlags = false;\n\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar scrollInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SCROLL);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\tvar layoutInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_LAYOUT);\n\n\t\t\tif(dataInvalid)\n\t\t\t{\n\t\t\t\tthis.commitData();\n\t\t\t}\n\n\t\t\tif(scrollInvalid || sizeInvalid || layoutInvalid)\n\t\t\t{\n\t\t\t\tthis._ignoreChildChanges = true;\n\t\t\t\tthis.preLayout();\n\t\t\t\tthis._ignoreChildChanges = false;\n\t\t\t}\n\n\t\t\tsuper.draw();\n\n\t\t\tif(scrollInvalid || sizeInvalid || layoutInvalid)\n\t\t\t{\n\t\t\t\tthis._ignoreChildChanges = true;\n\t\t\t\tthis.postLayout();\n\t\t\t\tthis._ignoreChildChanges = false;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Makes final changes to the layout before it updates the item\n\t\t * renderer's children. If your layout requires changing the\n\t\t * <code>layoutData</code> property on the item renderer's\n\t\t * sub-components, override the <code>preLayout()</code> function to\n\t\t * make those changes.\n\t\t *\n\t\t * <p>In subclasses, if you create properties that affect the layout,\n\t\t * invalidate using <code>INVALIDATION_FLAG_LAYOUT</code> to trigger a\n\t\t * call to the <code>preLayout()</code> function when the component\n\t\t * validates.</p>\n\t\t *\n\t\t * <p>The final width and height of the item renderer are not yet known\n\t\t * when this function is called. It is meant mainly for adjusting values\n\t\t * used by fluid layouts, such as constraints or percentages. If you\n\t\t * need io access the final width and height of the item renderer,\n\t\t * override the <code>postLayout()</code> function instead.</p>\n\t\t *\n\t\t * @see #postLayout()\n\t\t */\n\t\tprotected function preLayout():void\n\t\t{\n\n\t\t}\n\n\t\t/**\n\t\t * Called after the layout updates the item renderer's children. If any\n\t\t * children are excluded from the layout, you can update them in the\n\t\t * <code>postLayout()</code> function if you need to use the final width\n\t\t * and height in any calculations.\n\t\t *\n\t\t * <p>In subclasses, if you create properties that affect the layout,\n\t\t * invalidate using <code>INVALIDATION_FLAG_LAYOUT</code> to trigger a\n\t\t * call to the <code>postLayout()</code> function when the component\n\t\t * validates.</p>\n\t\t *\n\t\t * <p>To make changes to the layout before it updates the item\n\t\t * renderer's children, override the <code>preLayout()</code> function\n\t\t * instead.</p>\n\t\t *\n\t\t * @see #preLayout()\n\t\t */\n\t\tprotected function postLayout():void\n\t\t{\n\n\t\t}\n\n\t\t/**\n\t\t * Updates the renderer to display the item's data. Override this\n\t\t * function to pass data to sub-components and react to data changes.\n\t\t *\n\t\t * <p>Don't forget to handle the case where the data is <code>null</code>.</p>\n\t\t */\n\t\tprotected function commitData():void\n\t\t{\n\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/renderers/LayoutGroupGroupedListItemRenderer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.renderers\n{\n\timport feathers.controls.GroupedList;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.skins.IStyleProvider;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t/**\n\t * The background to display behind all content when the item renderer\n\t * is selected. The background skin is resized to fill the full width\n\t * and height of the layout group.\n\t *\n\t * <p>In the following example, the group is given a selected background\n\t * skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * group.backgroundSelectedSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t */\n\t[Style(name=\"backgroundSelectedSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * Based on <code>LayoutGroup</code>, this component is meant as a base\n\t * class for creating a custom item renderer for a <code>GroupedList</code>\n\t * component.\n\t *\n\t * <p>Sub-components may be created and added inside <code>initialize()</code>.\n\t * This is a good place to add event listeners and to set the layout.</p>\n\t *\n\t * <p>The <code>data</code> property may be parsed inside <code>commitData()</code>.\n\t * Use this function to change properties in your sub-components.</p>\n\t *\n\t * <p>Sub-components may be positioned manually, but a layout may be\n\t * provided as well. An <code>AnchorLayout</code> is recommended for fluid\n\t * layouts that can automatically adjust positions when the list resizes.\n\t * Create <code>AnchorLayoutData</code> objects to define the constraints.</p>\n\t *\n\t * @see feathers.controls.GroupedList\n\t *\n\t * @productversion Feathers 1.2.0\n\t */\n\tpublic class LayoutGroupGroupedListItemRenderer extends LayoutGroup implements IGroupedListItemRenderer\n\t{\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>LayoutGroupGroupedListItemRenderer</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function LayoutGroupGroupedListItemRenderer()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn LayoutGroupGroupedListItemRenderer.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _groupIndex:int = -1;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get groupIndex():int\n\t\t{\n\t\t\treturn this._groupIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set groupIndex(value:int):void\n\t\t{\n\t\t\tthis._groupIndex = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _itemIndex:int = -1;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get itemIndex():int\n\t\t{\n\t\t\treturn this._itemIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set itemIndex(value:int):void\n\t\t{\n\t\t\tthis._itemIndex = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _layoutIndex:int = -1;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get layoutIndex():int\n\t\t{\n\t\t\treturn this._layoutIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set layoutIndex(value:int):void\n\t\t{\n\t\t\tthis._layoutIndex = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _owner:GroupedList;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get owner():GroupedList\n\t\t{\n\t\t\treturn this._owner;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set owner(value:GroupedList):void\n\t\t{\n\t\t\tif(this._owner == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._owner = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _data:Object;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get data():Object\n\t\t{\n\t\t\treturn this._data;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set data(value:Object):void\n\t\t{\n\t\t\tif(this._data == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._data = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\t//LayoutGroup doesn't know about INVALIDATION_FLAG_DATA, so we need\n\t\t\t//set set another flag that it understands.\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isSelected:Boolean;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get isSelected():Boolean\n\t\t{\n\t\t\treturn this._isSelected;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isSelected(value:Boolean):void\n\t\t{\n\t\t\tif(this._isSelected == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isSelected = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\t//the state flag is needed for updating the background\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STATE);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _factoryID:String;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get factoryID():String\n\t\t{\n\t\t\treturn this._factoryID;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set factoryID(value:String):void\n\t\t{\n\t\t\tthis._factoryID = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _backgroundSelectedSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundSelectedSkin():DisplayObject\n\t\t{\n\t\t\treturn this._backgroundSelectedSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundSelectedSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSelectedSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSelectedSkin !== null &&\n\t\t\t\tthis.currentBackgroundSkin === this._backgroundSelectedSkin)\n\t\t\t{\n\t\t\t\tthis.removeCurrentBackgroundSkin(this._backgroundSelectedSkin);\n\t\t\t\tthis.currentBackgroundSkin = null;\n\t\t\t}\n\t\t\tthis._backgroundSelectedSkin = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SKIN);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tthis.owner = null;\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\t//children are allowed to change during draw() in a subclass up\n\t\t\t//until it calls super.draw().\n\t\t\tthis._ignoreChildChangesButSetFlags = false;\n\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar scrollInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SCROLL);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\tvar layoutInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_LAYOUT);\n\n\t\t\tif(dataInvalid)\n\t\t\t{\n\t\t\t\tthis.commitData();\n\t\t\t}\n\n\t\t\tif(scrollInvalid || sizeInvalid || layoutInvalid)\n\t\t\t{\n\t\t\t\tthis._ignoreChildChanges = true;\n\t\t\t\tthis.preLayout();\n\t\t\t\tthis._ignoreChildChanges = false;\n\t\t\t}\n\n\t\t\tsuper.draw();\n\n\t\t\tif(scrollInvalid || sizeInvalid || layoutInvalid)\n\t\t\t{\n\t\t\t\tthis._ignoreChildChanges = true;\n\t\t\t\tthis.postLayout();\n\t\t\t\tthis._ignoreChildChanges = false;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Makes final changes to the layout before it updates the item\n\t\t * renderer's children. If your layout requires changing the\n\t\t * <code>layoutData</code> property on the item renderer's\n\t\t * sub-components, override the <code>preLayout()</code> function to\n\t\t * make those changes.\n\t\t *\n\t\t * <p>In subclasses, if you create properties that affect the layout,\n\t\t * invalidate using <code>INVALIDATION_FLAG_LAYOUT</code> to trigger a\n\t\t * call to the <code>preLayout()</code> function when the component\n\t\t * validates.</p>\n\t\t *\n\t\t * <p>The final width and height of the item renderer are not yet known\n\t\t * when this function is called. It is meant mainly for adjusting values\n\t\t * used by fluid layouts, such as constraints or percentages. If you\n\t\t * need io access the final width and height of the item renderer,\n\t\t * override the <code>postLayout()</code> function instead.</p>\n\t\t *\n\t\t * @see #postLayout()\n\t\t */\n\t\tprotected function preLayout():void\n\t\t{\n\n\t\t}\n\n\t\t/**\n\t\t * Called after the layout updates the item renderer's children. If any\n\t\t * children are excluded from the layout, you can update them in the\n\t\t * <code>postLayout()</code> function if you need to use the final width\n\t\t * and height in any calculations.\n\t\t *\n\t\t * <p>In subclasses, if you create properties that affect the layout,\n\t\t * invalidate using <code>INVALIDATION_FLAG_LAYOUT</code> to trigger a\n\t\t * call to the <code>postLayout()</code> function when the component\n\t\t * validates.</p>\n\t\t *\n\t\t * <p>To make changes to the layout before it updates the item\n\t\t * renderer's children, override the <code>preLayout()</code> function\n\t\t * instead.</p>\n\t\t *\n\t\t * @see #preLayout()\n\t\t */\n\t\tprotected function postLayout():void\n\t\t{\n\n\t\t}\n\n\t\t/**\n\t\t * Updates the renderer to display the item's data. Override this\n\t\t * function to pass data to sub-components and react to data changes.\n\t\t *\n\t\t * <p>Don't forget to handle the case where the data is <code>null</code>.</p>\n\t\t */\n\t\tprotected function commitData():void\n\t\t{\n\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function getCurrentBackgroundSkin():DisplayObject\n\t\t{\n\t\t\tif(!this._isEnabled && this._backgroundDisabledSkin !== null)\n\t\t\t{\n\t\t\t\treturn this._backgroundDisabledSkin;\n\t\t\t}\n\t\t\tif(this._isSelected && this._backgroundSelectedSkin !== null)\n\t\t\t{\n\t\t\t\treturn this._backgroundSelectedSkin;\n\t\t\t}\n\t\t\treturn this._backgroundSkin;\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/renderers/LayoutGroupListItemRenderer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.renderers\n{\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.List;\n\timport feathers.skins.IStyleProvider;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t/**\n\t * The background to display behind all content when the item renderer\n\t * is selected. The background skin is resized to fill the full width\n\t * and height of the layout group.\n\t *\n\t * <p>In the following example, the group is given a selected background\n\t * skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * group.backgroundSelectedSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t */\n\t[Style(name=\"backgroundSelectedSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * Based on <code>LayoutGroup</code>, this component is meant as a base\n\t * class for creating a custom item renderer for a <code>List</code>\n\t * component.\n\t *\n\t * <p>Sub-components may be created and added inside <code>initialize()</code>.\n\t * This is a good place to add event listeners and to set the layout.</p>\n\t *\n\t * <p>The <code>data</code> property may be parsed inside <code>commitData()</code>.\n\t * Use this function to change properties in your sub-components.</p>\n\t *\n\t * <p>Sub-components may be positioned manually, but a layout may be\n\t * provided as well. An <code>AnchorLayout</code> is recommended for fluid\n\t * layouts that can automatically adjust positions when the list resizes.\n\t * Create <code>AnchorLayoutData</code> objects to define the constraints.</p>\n\t *\n\t * @see feathers.controls.List\n\t *\n\t * @productversion Feathers 1.2.0\n\t */\n\tpublic class LayoutGroupListItemRenderer extends LayoutGroup implements IListItemRenderer\n\t{\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>LayoutGroupListItemRenderer</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function LayoutGroupListItemRenderer()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn LayoutGroupListItemRenderer.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _index:int = -1;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get index():int\n\t\t{\n\t\t\treturn this._index;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set index(value:int):void\n\t\t{\n\t\t\tthis._index = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _owner:List;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get owner():List\n\t\t{\n\t\t\treturn this._owner;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set owner(value:List):void\n\t\t{\n\t\t\tif(this._owner == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._owner = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _data:Object;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get data():Object\n\t\t{\n\t\t\treturn this._data;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set data(value:Object):void\n\t\t{\n\t\t\tif(this._data == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._data = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\t//LayoutGroup doesn't know about INVALIDATION_FLAG_DATA, so we need\n\t\t\t//set set another flag that it understands.\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isSelected:Boolean;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get isSelected():Boolean\n\t\t{\n\t\t\treturn this._isSelected;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isSelected(value:Boolean):void\n\t\t{\n\t\t\tif(this._isSelected == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isSelected = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\t//the state flag is needed for updating the background\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STATE);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _factoryID:String;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get factoryID():String\n\t\t{\n\t\t\treturn this._factoryID;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set factoryID(value:String):void\n\t\t{\n\t\t\tthis._factoryID = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _backgroundSelectedSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundSelectedSkin():DisplayObject\n\t\t{\n\t\t\treturn this._backgroundSelectedSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundSelectedSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSelectedSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSelectedSkin !== null &&\n\t\t\t\tthis.currentBackgroundSkin === this._backgroundSelectedSkin)\n\t\t\t{\n\t\t\t\tthis.removeCurrentBackgroundSkin(this._backgroundSelectedSkin);\n\t\t\t\tthis.currentBackgroundSkin = null;\n\t\t\t}\n\t\t\tthis._backgroundSelectedSkin = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SKIN);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tthis.owner = null;\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\t//children are allowed to change during draw() in a subclass up\n\t\t\t//until it calls super.draw().\n\t\t\tthis._ignoreChildChangesButSetFlags = false;\n\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar scrollInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SCROLL);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\tvar layoutInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_LAYOUT);\n\n\t\t\tif(dataInvalid)\n\t\t\t{\n\t\t\t\tthis.commitData();\n\t\t\t}\n\n\t\t\tif(scrollInvalid || sizeInvalid || layoutInvalid)\n\t\t\t{\n\t\t\t\tthis._ignoreChildChanges = true;\n\t\t\t\tthis.preLayout();\n\t\t\t\tthis._ignoreChildChanges = false;\n\t\t\t}\n\n\t\t\tsuper.draw();\n\n\t\t\tif(scrollInvalid || sizeInvalid || layoutInvalid)\n\t\t\t{\n\t\t\t\tthis._ignoreChildChanges = true;\n\t\t\t\tthis.postLayout();\n\t\t\t\tthis._ignoreChildChanges = false;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Makes final changes to the layout before it updates the item\n\t\t * renderer's children. If your layout requires changing the\n\t\t * <code>layoutData</code> property on the item renderer's\n\t\t * sub-components, override the <code>preLayout()</code> function to\n\t\t * make those changes.\n\t\t *\n\t\t * <p>In subclasses, if you create properties that affect the layout,\n\t\t * invalidate using <code>INVALIDATION_FLAG_LAYOUT</code> to trigger a\n\t\t * call to the <code>preLayout()</code> function when the component\n\t\t * validates.</p>\n\t\t *\n\t\t * <p>The final width and height of the item renderer are not yet known\n\t\t * when this function is called. It is meant mainly for adjusting values\n\t\t * used by fluid layouts, such as constraints or percentages. If you\n\t\t * need io access the final width and height of the item renderer,\n\t\t * override the <code>postLayout()</code> function instead.</p>\n\t\t *\n\t\t * @see #postLayout()\n\t\t */\n\t\tprotected function preLayout():void\n\t\t{\n\n\t\t}\n\n\t\t/**\n\t\t * Called after the layout updates the item renderer's children. If any\n\t\t * children are excluded from the layout, you can update them in the\n\t\t * <code>postLayout()</code> function if you need to use the final width\n\t\t * and height in any calculations.\n\t\t *\n\t\t * <p>In subclasses, if you create properties that affect the layout,\n\t\t * invalidate using <code>INVALIDATION_FLAG_LAYOUT</code> to trigger a\n\t\t * call to the <code>postLayout()</code> function when the component\n\t\t * validates.</p>\n\t\t *\n\t\t * <p>To make changes to the layout before it updates the item\n\t\t * renderer's children, override the <code>preLayout()</code> function\n\t\t * instead.</p>\n\t\t *\n\t\t * @see #preLayout()\n\t\t */\n\t\tprotected function postLayout():void\n\t\t{\n\n\t\t}\n\n\t\t/**\n\t\t * Updates the renderer to display the item's data. Override this\n\t\t * function to pass data to sub-components and react to data changes.\n\t\t *\n\t\t * <p>Don't forget to handle the case where the data is <code>null</code>.</p>\n\t\t */\n\t\tprotected function commitData():void\n\t\t{\n\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function getCurrentBackgroundSkin():DisplayObject\n\t\t{\n\t\t\tif(!this._isEnabled && this._backgroundDisabledSkin !== null)\n\t\t\t{\n\t\t\t\treturn this._backgroundDisabledSkin;\n\t\t\t}\n\t\t\tif(this._isSelected && this._backgroundSelectedSkin !== null)\n\t\t\t{\n\t\t\t\treturn this._backgroundSelectedSkin;\n\t\t\t}\n\t\t\treturn this._backgroundSkin;\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/renderers/LayoutGroupTreeItemRenderer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.renderers\n{\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.Tree;\n\timport feathers.skins.IStyleProvider;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t/**\n\t * The background to display behind all content when the item renderer\n\t * is selected. The background skin is resized to fill the full width\n\t * and height of the layout group.\n\t *\n\t * <p>In the following example, the group is given a selected background\n\t * skin:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * group.backgroundSelectedSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t */\n\t[Style(name=\"backgroundSelectedSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * Based on <code>LayoutGroup</code>, this component is meant as a base\n\t * class for creating a custom item renderer for a <code>Tree</code>\n\t * component.\n\t *\n\t * <p>Sub-components may be created and added inside <code>initialize()</code>.\n\t * This is a good place to add event listeners and to set the layout.</p>\n\t *\n\t * <p>The <code>data</code> property may be parsed inside <code>commitData()</code>.\n\t * Use this function to change properties in your sub-components.</p>\n\t *\n\t * <p>Sub-components may be positioned manually, but a layout may be\n\t * provided as well. An <code>AnchorLayout</code> is recommended for fluid\n\t * layouts that can automatically adjust positions when the list resizes.\n\t * Create <code>AnchorLayoutData</code> objects to define the constraints.</p>\n\t *\n\t * @see feathers.controls.Tree\n\t *\n\t * @productversion Feathers 1.2.0\n\t */\n\tpublic class LayoutGroupTreeItemRenderer extends LayoutGroup implements ITreeItemRenderer\n\t{\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>LayoutGroupTreeItemRenderer</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function LayoutGroupTreeItemRenderer()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn LayoutGroupTreeItemRenderer.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _location:Vector.<int> = null;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get location():Vector.<int>\n\t\t{\n\t\t\treturn this._location;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set location(value:Vector.<int>):void\n\t\t{\n\t\t\tthis._location = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _layoutIndex:int = -1;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get layoutIndex():int\n\t\t{\n\t\t\treturn this._layoutIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set layoutIndex(value:int):void\n\t\t{\n\t\t\tthis._layoutIndex = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _owner:Tree;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get owner():Tree\n\t\t{\n\t\t\treturn this._owner;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set owner(value:Tree):void\n\t\t{\n\t\t\tif(this._owner == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._owner = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _data:Object;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get data():Object\n\t\t{\n\t\t\treturn this._data;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set data(value:Object):void\n\t\t{\n\t\t\tif(this._data == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._data = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\t//LayoutGroup doesn't know about INVALIDATION_FLAG_DATA, so we need\n\t\t\t//set set another flag that it understands.\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isSelected:Boolean;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get isSelected():Boolean\n\t\t{\n\t\t\treturn this._isSelected;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isSelected(value:Boolean):void\n\t\t{\n\t\t\tif(this._isSelected == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isSelected = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\t//the state flag is needed for updating the background\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STATE);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isBranch:Boolean;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get isBranch():Boolean\n\t\t{\n\t\t\treturn this._isBranch;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isBranch(value:Boolean):void\n\t\t{\n\t\t\tif(this._isBranch === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isBranch = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isOpen:Boolean;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get isOpen():Boolean\n\t\t{\n\t\t\treturn this._isOpen;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isOpen(value:Boolean):void\n\t\t{\n\t\t\tif(this._isOpen === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isOpen = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _factoryID:String;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get factoryID():String\n\t\t{\n\t\t\treturn this._factoryID;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set factoryID(value:String):void\n\t\t{\n\t\t\tthis._factoryID = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _backgroundSelectedSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get backgroundSelectedSkin():DisplayObject\n\t\t{\n\t\t\treturn this._backgroundSelectedSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundSelectedSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSelectedSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._backgroundSelectedSkin !== null &&\n\t\t\t\tthis.currentBackgroundSkin === this._backgroundSelectedSkin)\n\t\t\t{\n\t\t\t\tthis.removeCurrentBackgroundSkin(this._backgroundSelectedSkin);\n\t\t\t\tthis.currentBackgroundSkin = null;\n\t\t\t}\n\t\t\tthis._backgroundSelectedSkin = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SKIN);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tthis.owner = null;\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\t//children are allowed to change during draw() in a subclass up\n\t\t\t//until it calls super.draw().\n\t\t\tthis._ignoreChildChangesButSetFlags = false;\n\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar scrollInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SCROLL);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\tvar layoutInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_LAYOUT);\n\n\t\t\tif(dataInvalid)\n\t\t\t{\n\t\t\t\tthis.commitData();\n\t\t\t}\n\n\t\t\tif(scrollInvalid || sizeInvalid || layoutInvalid)\n\t\t\t{\n\t\t\t\tthis._ignoreChildChanges = true;\n\t\t\t\tthis.preLayout();\n\t\t\t\tthis._ignoreChildChanges = false;\n\t\t\t}\n\n\t\t\tsuper.draw();\n\n\t\t\tif(scrollInvalid || sizeInvalid || layoutInvalid)\n\t\t\t{\n\t\t\t\tthis._ignoreChildChanges = true;\n\t\t\t\tthis.postLayout();\n\t\t\t\tthis._ignoreChildChanges = false;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Makes final changes to the layout before it updates the item\n\t\t * renderer's children. If your layout requires changing the\n\t\t * <code>layoutData</code> property on the item renderer's\n\t\t * sub-components, override the <code>preLayout()</code> function to\n\t\t * make those changes.\n\t\t *\n\t\t * <p>In subclasses, if you create properties that affect the layout,\n\t\t * invalidate using <code>INVALIDATION_FLAG_LAYOUT</code> to trigger a\n\t\t * call to the <code>preLayout()</code> function when the component\n\t\t * validates.</p>\n\t\t *\n\t\t * <p>The final width and height of the item renderer are not yet known\n\t\t * when this function is called. It is meant mainly for adjusting values\n\t\t * used by fluid layouts, such as constraints or percentages. If you\n\t\t * need io access the final width and height of the item renderer,\n\t\t * override the <code>postLayout()</code> function instead.</p>\n\t\t *\n\t\t * @see #postLayout()\n\t\t */\n\t\tprotected function preLayout():void\n\t\t{\n\n\t\t}\n\n\t\t/**\n\t\t * Called after the layout updates the item renderer's children. If any\n\t\t * children are excluded from the layout, you can update them in the\n\t\t * <code>postLayout()</code> function if you need to use the final width\n\t\t * and height in any calculations.\n\t\t *\n\t\t * <p>In subclasses, if you create properties that affect the layout,\n\t\t * invalidate using <code>INVALIDATION_FLAG_LAYOUT</code> to trigger a\n\t\t * call to the <code>postLayout()</code> function when the component\n\t\t * validates.</p>\n\t\t *\n\t\t * <p>To make changes to the layout before it updates the item\n\t\t * renderer's children, override the <code>preLayout()</code> function\n\t\t * instead.</p>\n\t\t *\n\t\t * @see #preLayout()\n\t\t */\n\t\tprotected function postLayout():void\n\t\t{\n\n\t\t}\n\n\t\t/**\n\t\t * Updates the renderer to display the item's data. Override this\n\t\t * function to pass data to sub-components and react to data changes.\n\t\t *\n\t\t * <p>Don't forget to handle the case where the data is <code>null</code>.</p>\n\t\t */\n\t\tprotected function commitData():void\n\t\t{\n\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function getCurrentBackgroundSkin():DisplayObject\n\t\t{\n\t\t\tif(!this._isEnabled && this._backgroundDisabledSkin !== null)\n\t\t\t{\n\t\t\t\treturn this._backgroundDisabledSkin;\n\t\t\t}\n\t\t\tif(this._isSelected && this._backgroundSelectedSkin !== null)\n\t\t\t{\n\t\t\t\treturn this._backgroundSelectedSkin;\n\t\t\t}\n\t\t\treturn this._backgroundSkin;\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/supportClasses/BaseScreenNavigator.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.supportClasses\n{\n\timport feathers.controls.AutoSizeMode;\n\timport feathers.controls.IScreen;\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IMeasureDisplayObject;\n\timport feathers.core.IValidating;\n\timport feathers.events.FeathersEventType;\n\timport feathers.utils.skins.resetFluidChildDimensionsForMeasurement;\n\n\timport flash.errors.IllegalOperationError;\n\timport flash.utils.getDefinitionByName;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.DisplayObjectContainer;\n\timport starling.display.Quad;\n\timport starling.errors.AbstractMethodError;\n\timport starling.events.Event;\n\n\t/**\n\t * Dispatched when the active screen changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #activeScreen\n\t * @see #activeScreenID\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the current screen is removed and there is no active\n\t * screen.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.CLEAR\n\t */\n\t[Event(name=\"clear\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the transition between screens begins.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.TRANSITION_START\n\t */\n\t[Event(name=\"transitionStart\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the transition between screens has completed.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.TRANSITION_COMPLETE\n\t */\n\t[Event(name=\"transitionComplete\",type=\"starling.events.Event\")]\n\n\t/**\n\t * A base class for screen navigator components that isn't meant to be\n\t * instantiated directly. It should only be subclassed.\n\t *\n\t * @see feathers.controls.StackScreenNavigator\n\t * @see feathers.controls.ScreenNavigator\n\t *\n\t * @productversion Feathers 2.1.0\n\t */\n\tpublic class BaseScreenNavigator extends FeathersControl\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static var SIGNAL_TYPE:Class;\n\n\t\t/**\n\t\t * The default transition function.\n\t\t */\n\t\tprotected static function defaultTransition(oldScreen:DisplayObject, newScreen:DisplayObject, completeCallback:Function):void\n\t\t{\n\t\t\t//in short, do nothing\n\t\t\tcompleteCallback();\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function BaseScreenNavigator()\n\t\t{\n\t\t\tsuper();\n\t\t\tif(Object(this).constructor == BaseScreenNavigator)\n\t\t\t{\n\t\t\t\tthrow new Error(FeathersControl.ABSTRACT_CLASS_ERROR);\n\t\t\t}\n\t\t\tif(!SIGNAL_TYPE)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tSIGNAL_TYPE = Class(getDefinitionByName(\"org.osflash.signals.ISignal\"));\n\t\t\t\t}\n\t\t\t\tcatch(error:Error)\n\t\t\t\t{\n\t\t\t\t\t//signals not being used\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.screenContainer = this;\n\t\t\tthis.addEventListener(Event.ADDED_TO_STAGE, screenNavigator_addedToStageHandler);\n\t\t\tthis.addEventListener(Event.REMOVED_FROM_STAGE, screenNavigator_removedFromStageHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _activeScreenID:String;\n\n\t\t/**\n\t\t * The string identifier for the currently active screen.\n\t\t */\n\t\tpublic function get activeScreenID():String\n\t\t{\n\t\t\treturn this._activeScreenID;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _activeScreen:DisplayObject;\n\n\t\t/**\n\t\t * A reference to the currently active screen.\n\t\t */\n\t\tpublic function get activeScreen():DisplayObject\n\t\t{\n\t\t\treturn this._activeScreen;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var screenContainer:DisplayObjectContainer;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _activeScreenExplicitWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _activeScreenExplicitHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _activeScreenExplicitMinWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _activeScreenExplicitMinHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _activeScreenExplicitMaxWidth:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _activeScreenExplicitMaxHeight:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _screens:Object = {};\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _previousScreenInTransitionID:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _previousScreenInTransition:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _nextScreenID:String = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _nextScreenTransition:Function = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _clearAfterTransition:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _delayedTransition:Function = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _waitingForDelayedTransition:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _clipContent:Boolean = false;\n\n\t\t/**\n\t\t * Determines if the navigator's content should be clipped to the width\n\t\t * and height.\n\t\t *\n\t\t * <p>In the following example, clipping is enabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * navigator.clipContent = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic function get clipContent():Boolean\n\t\t{\n\t\t\treturn this._clipContent;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set clipContent(value:Boolean):void\n\t\t{\n\t\t\tif(this._clipContent == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._clipContent = value;\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tthis.mask = null;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _autoSizeMode:String = AutoSizeMode.STAGE;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"stage,content\")]\n\t\t/**\n\t\t * Determines how the screen navigator will set its own size when its\n\t\t * dimensions (width and height) aren't set explicitly.\n\t\t *\n\t\t * <p>In the following example, the screen navigator will be sized to\n\t\t * match its content:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * navigator.autoSizeMode = AutoSizeMode.CONTENT;</listing>\n\t\t *\n\t\t * @default feathers.controls.AutoSizeMode.STAGE\n\t\t *\n\t\t * @see feathers.controls.AutoSizeMode#STAGE\n\t\t * @see feathers.controls.AutoSizeMode#CONTENT\n\t\t */\n\t\tpublic function get autoSizeMode():String\n\t\t{\n\t\t\treturn this._autoSizeMode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set autoSizeMode(value:String):void\n\t\t{\n\t\t\tif(this._autoSizeMode == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._autoSizeMode = value;\n\t\t\tif(this._activeScreen)\n\t\t\t{\n\t\t\t\tif(this._autoSizeMode == AutoSizeMode.CONTENT)\n\t\t\t\t{\n\t\t\t\t\tthis._activeScreen.addEventListener(Event.RESIZE, activeScreen_resizeHandler);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._activeScreen.removeEventListener(Event.RESIZE, activeScreen_resizeHandler);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _waitingTransition:Function;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _waitingForTransitionFrameCount:int = 1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isTransitionActive:Boolean = false;\n\n\t\t/**\n\t\t * Indicates whether the screen navigator is currently transitioning\n\t\t * between screens.\n\t\t */\n\t\tpublic function get isTransitionActive():Boolean\n\t\t{\n\t\t\treturn this._isTransitionActive;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this._activeScreen)\n\t\t\t{\n\t\t\t\tthis.cleanupActiveScreen();\n\t\t\t\tthis._activeScreen = null;\n\t\t\t\tthis._activeScreenID = null;\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * Removes all screens that were added with <code>addScreen()</code>.\n\t\t *\n\t\t * @see #addScreen()\n\t\t */\n\t\tpublic function removeAllScreens():void\n\t\t{\n\t\t\tif(this._isTransitionActive)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Cannot remove all screens while a transition is active.\");\n\t\t\t}\n\t\t\tif(this._activeScreen)\n\t\t\t{\n\t\t\t\t//if someone meant to have a transition, they would have called\n\t\t\t\t//clearScreen()\n\t\t\t\tthis.clearScreenInternal(null);\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.CLEAR);\n\t\t\t}\n\t\t\tfor(var id:String in this._screens)\n\t\t\t{\n\t\t\t\tdelete this._screens[id];\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Determines if the specified screen identifier has been added with\n\t\t * <code>addScreen()</code>.\n\t\t *\n\t\t * @see #addScreen()\n\t\t */\n\t\tpublic function hasScreen(id:String):Boolean\n\t\t{\n\t\t\treturn this._screens.hasOwnProperty(id);\n\t\t}\n\n\t\t/**\n\t\t * Returns a list of the screen identifiers that have been added.\n\t\t */\n\t\tpublic function getScreenIDs(result:Vector.<String> = null):Vector.<String>\n\t\t{\n\t\t\tif(result)\n\t\t\t{\n\t\t\t\tresult.length = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult = new <String>[];\n\t\t\t}\n\t\t\tvar pushIndex:int = 0;\n\t\t\tfor(var id:String in this._screens)\n\t\t\t{\n\t\t\t\tresult[pushIndex] = id;\n\t\t\t\tpushIndex++;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\tvar selectionInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SELECTED);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\n\t\t\tsizeInvalid = this.autoSizeIfNeeded() || sizeInvalid;\n\n\t\t\tthis.layoutChildren();\n\n\t\t\tif(stylesInvalid || sizeInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshMask();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * If the component's dimensions have not been set explicitly, it will\n\t\t * measure its content and determine an ideal size for itself. If the\n\t\t * <code>explicitWidth</code> or <code>explicitHeight</code> member\n\t\t * variables are set, those value will be used without additional\n\t\t * measurement. If one is set, but not the other, the dimension with the\n\t\t * explicit value will not be measured, but the other non-explicit\n\t\t * dimension will still need measurement.\n\t\t *\n\t\t * <p>Calls <code>saveMeasurements()</code> to set up the\n\t\t * <code>actualWidth</code> and <code>actualHeight</code> member\n\t\t * variables used for layout.</p>\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t */\n\t\tprotected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvar needsToMeasureContent:Boolean = this._autoSizeMode === AutoSizeMode.CONTENT || this.stage === null;\n\t\t\tvar measureScreen:IMeasureDisplayObject = this._activeScreen as IMeasureDisplayObject;\n\t\t\tif(needsToMeasureContent)\n\t\t\t{\n\t\t\t\tif(this._activeScreen !== null)\n\t\t\t\t{\n\t\t\t\t\tresetFluidChildDimensionsForMeasurement(this._activeScreen,\n\t\t\t\t\t\tthis._explicitWidth, this._explicitHeight,\n\t\t\t\t\t\tthis._explicitMinWidth, this._explicitMinHeight,\n\t\t\t\t\t\tthis._explicitMaxWidth, this._explicitMaxHeight,\n\t\t\t\t\t\tthis._activeScreenExplicitWidth, this._activeScreenExplicitHeight,\n\t\t\t\t\t\tthis._activeScreenExplicitMinWidth, this._activeScreenExplicitMinHeight,\n\t\t\t\t\t\tthis._activeScreenExplicitMaxWidth, this._activeScreenExplicitMaxHeight);\n\t\t\t\t\tif(this._activeScreen is IValidating)\n\t\t\t\t\t{\n\t\t\t\t\t\tIValidating(this._activeScreen).validate();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tif(needsToMeasureContent)\n\t\t\t\t{\n\t\t\t\t\tif(this._activeScreen !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewWidth = this._activeScreen.width;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewWidth = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this.stage.stageWidth;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tif(needsToMeasureContent)\n\t\t\t\t{\n\t\t\t\t\tif(this._activeScreen !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewHeight = this._activeScreen.height;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewHeight = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this.stage.stageHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tif(needsToMeasureContent)\n\t\t\t\t{\n\t\t\t\t\tif(measureScreen !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = measureScreen.minWidth;\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._activeScreen !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = this._activeScreen.width;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinWidth = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = this.stage.stageWidth;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tif(needsToMeasureContent)\n\t\t\t\t{\n\t\t\t\t\tif(measureScreen !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = measureScreen.minHeight;\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._activeScreen !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = this._activeScreen.height;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewMinHeight = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinHeight = this.stage.stageHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function addScreenInternal(id:String, item:IScreenNavigatorItem):void\n\t\t{\n\t\t\tif(this._screens.hasOwnProperty(id))\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"Screen with id '\" + id + \"' already defined. Cannot add two screens with the same id.\");\n\t\t\t}\n\t\t\tthis._screens[id] = item;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshMask():void\n\t\t{\n\t\t\tif(!this._clipContent)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar mask:DisplayObject = this.mask as Quad;\n\t\t\tif(mask)\n\t\t\t{\n\t\t\t\tmask.width = this.actualWidth;\n\t\t\t\tmask.height = this.actualHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmask = new Quad(1, 1, 0xff00ff);\n\t\t\t\t//the initial dimensions cannot be 0 or there's a runtime error,\n\t\t\t\t//and these values might be 0\n\t\t\t\tmask.width = this.actualWidth;\n\t\t\t\tmask.height = this.actualHeight;\n\t\t\t\tthis.mask = mask;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function removeScreenInternal(id:String):IScreenNavigatorItem\n\t\t{\n\t\t\tif(!this._screens.hasOwnProperty(id))\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"Screen '\" + id + \"' cannot be removed because it has not been added.\");\n\t\t\t}\n\t\t\tif(this._isTransitionActive && (id == this._previousScreenInTransitionID || id == this._activeScreenID))\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Cannot remove a screen while it is transitioning in or out.\");\n\t\t\t}\n\t\t\tif(this._activeScreenID == id)\n\t\t\t{\n\t\t\t\t//if someone meant to have a transition, they would have called\n\t\t\t\t//clearScreen()\n\t\t\t\tthis.clearScreenInternal(null);\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.CLEAR);\n\t\t\t}\n\t\t\tvar item:IScreenNavigatorItem = IScreenNavigatorItem(this._screens[id]);\n\t\t\tdelete this._screens[id];\n\t\t\treturn item;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function showScreenInternal(id:String, transition:Function, properties:Object = null):DisplayObject\n\t\t{\n\t\t\tif(!this.hasScreen(id))\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"Screen with id '\" + id + \"' cannot be shown because it has not been defined.\");\n\t\t\t}\n\n\t\t\tif(this._isTransitionActive)\n\t\t\t{\n\t\t\t\tthis._nextScreenID = id;\n\t\t\t\tthis._nextScreenTransition = transition;\n\t\t\t\tthis._clearAfterTransition = false;\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tthis._previousScreenInTransition = this._activeScreen;\n\t\t\tthis._previousScreenInTransitionID = this._activeScreenID;\n\t\t\tif(this._activeScreen !== null)\n\t\t\t{\n\t\t\t\tthis.cleanupActiveScreen();\n\t\t\t}\n\n\t\t\tthis._isTransitionActive = true;\n\n\t\t\tvar item:IScreenNavigatorItem = IScreenNavigatorItem(this._screens[id]);\n\t\t\tthis._activeScreen = item.getScreen();\n\t\t\tthis._activeScreenID = id;\n\t\t\tif(item.transitionDelayEvent !== null)\n\t\t\t{\n\t\t\t\tthis._waitingForDelayedTransition = true;\n\t\t\t\tthis._activeScreen.addEventListener(item.transitionDelayEvent, screen_transitionDelayHandler);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._waitingForDelayedTransition = false;\n\t\t\t}\n\t\t\tfor(var propertyName:String in properties)\n\t\t\t{\n\t\t\t\tthis._activeScreen[propertyName] = properties[propertyName];\n\t\t\t}\n\t\t\tif(this._activeScreen is IScreen)\n\t\t\t{\n\t\t\t\tvar screen:IScreen = IScreen(this._activeScreen);\n\t\t\t\tscreen.screenID = this._activeScreenID;\n\t\t\t\tscreen.owner = this; //subclasses will implement the interface\n\t\t\t}\n\t\t\tif(this._autoSizeMode === AutoSizeMode.CONTENT || !this.stage)\n\t\t\t{\n\t\t\t\tthis._activeScreen.addEventListener(Event.RESIZE, activeScreen_resizeHandler);\n\t\t\t}\n\t\t\tthis.prepareActiveScreen();\n\t\t\tvar isSameInstance:Boolean = this._previousScreenInTransition === this._activeScreen;\n\t\t\tthis.screenContainer.addChild(this._activeScreen);\n\t\t\tif(this._activeScreen is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this._activeScreen).initializeNow();\n\t\t\t}\n\t\t\tvar measureScreen:IMeasureDisplayObject = this._activeScreen as IMeasureDisplayObject;\n\t\t\tif(measureScreen !== null)\n\t\t\t{\n\t\t\t\tthis._activeScreenExplicitWidth = measureScreen.explicitWidth;\n\t\t\t\tthis._activeScreenExplicitHeight = measureScreen.explicitHeight;\n\t\t\t\tthis._activeScreenExplicitMinWidth = measureScreen.explicitMinWidth;\n\t\t\t\tthis._activeScreenExplicitMinHeight = measureScreen.explicitMinHeight;\n\t\t\t\tthis._activeScreenExplicitMaxWidth = measureScreen.explicitMaxWidth;\n\t\t\t\tthis._activeScreenExplicitMaxHeight = measureScreen.explicitMaxHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._activeScreenExplicitWidth = this._activeScreen.width;\n\t\t\t\tthis._activeScreenExplicitHeight = this._activeScreen.height;\n\t\t\t\tthis._activeScreenExplicitMinWidth = this._activeScreenExplicitWidth;\n\t\t\t\tthis._activeScreenExplicitMinHeight = this._activeScreenExplicitHeight;\n\t\t\t\tthis._activeScreenExplicitMaxWidth = this._activeScreenExplicitWidth;\n\t\t\t\tthis._activeScreenExplicitMaxHeight = this._activeScreenExplicitHeight;\n\t\t\t}\n\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\tif(this._validationQueue && !this._validationQueue.isValidating)\n\t\t\t{\n\t\t\t\t//force a COMPLETE validation of everything\n\t\t\t\t//but only if we're not already doing that...\n\t\t\t\tthis._validationQueue.advanceTime(0);\n\t\t\t}\n\t\t\telse if(!this._isValidating)\n\t\t\t{\n\t\t\t\tthis.validate();\n\t\t\t}\n\n\t\t\tif(isSameInstance)\n\t\t\t{\n\t\t\t\t//we can't transition if both screens are the same display\n\t\t\t\t//object, so skip the transition!\n\t\t\t\tthis._previousScreenInTransition = null;\n\t\t\t\tthis._previousScreenInTransitionID = null;\n\t\t\t\tthis._isTransitionActive = false;\n\t\t\t}\n\t\t\telse if(item.transitionDelayEvent !== null && this._waitingForDelayedTransition)\n\t\t\t{\n\t\t\t\tthis._waitingForDelayedTransition = false;\n\t\t\t\tthis._activeScreen.visible = false;\n\t\t\t\tthis._delayedTransition = transition;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(item.transitionDelayEvent !== null)\n\t\t\t\t{\n\t\t\t\t\t//if we skipped the delay because the event was already\n\t\t\t\t\t//dispatched, then don't forget to remove the listener\n\t\t\t\t\tthis._activeScreen.removeEventListener(item.transitionDelayEvent, screen_transitionDelayHandler);\n\t\t\t\t}\n\t\t\t\tthis.startTransition(transition);\n\t\t\t}\n\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\treturn this._activeScreen;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function clearScreenInternal(transition:Function = null):void\n\t\t{\n\t\t\tif(this._activeScreen === null)\n\t\t\t{\n\t\t\t\t//no screen visible.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this._isTransitionActive)\n\t\t\t{\n\t\t\t\tthis._nextScreenID = null;\n\t\t\t\tthis._clearAfterTransition = true;\n\t\t\t\tthis._nextScreenTransition = transition;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.cleanupActiveScreen();\n\n\t\t\tthis._isTransitionActive = true;\n\t\t\tthis._previousScreenInTransition = this._activeScreen;\n\t\t\tthis._previousScreenInTransitionID = this._activeScreenID;\n\t\t\tthis._activeScreen = null;\n\t\t\tthis._activeScreenID = null;\n\n\t\t\tthis.dispatchEventWith(FeathersEventType.TRANSITION_START);\n\t\t\tthis._previousScreenInTransition.dispatchEventWith(FeathersEventType.TRANSITION_OUT_START);\n\t\t\tif(transition !== null)\n\t\t\t{\n\t\t\t\tthis._waitingForTransitionFrameCount = 0;\n\t\t\t\tthis._waitingTransition = transition;\n\t\t\t\t//this is a workaround for an issue with transition performance.\n\t\t\t\t//see the comment in the listener for details.\n\t\t\t\tthis.addEventListener(Event.ENTER_FRAME, waitingForTransition_enterFrameHandler);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdefaultTransition(this._previousScreenInTransition, this._activeScreen, transitionComplete);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function prepareActiveScreen():void\n\t\t{\n\t\t\tthrow new AbstractMethodError();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function cleanupActiveScreen():void\n\t\t{\n\t\t\tthrow new AbstractMethodError();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutChildren():void\n\t\t{\n\t\t\tif(this._activeScreen !== null)\n\t\t\t{\n\t\t\t\tif(this._activeScreen.width != this.actualWidth)\n\t\t\t\t{\n\t\t\t\t\tthis._activeScreen.width = this.actualWidth;\n\t\t\t\t}\n\t\t\t\tif(this._activeScreen.height != this.actualHeight)\n\t\t\t\t{\n\t\t\t\t\tthis._activeScreen.height = this.actualHeight;\n\t\t\t\t}\n\t\t\t\tif(this._activeScreen is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this._activeScreen).validate();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function startTransition(transition:Function):void\n\t\t{\n\t\t\tthis.dispatchEventWith(FeathersEventType.TRANSITION_START);\n\t\t\tthis._activeScreen.dispatchEventWith(FeathersEventType.TRANSITION_IN_START);\n\t\t\tif(this._previousScreenInTransition !== null)\n\t\t\t{\n\t\t\t\tthis._previousScreenInTransition.dispatchEventWith(FeathersEventType.TRANSITION_OUT_START);\n\t\t\t}\n\t\t\tif(transition !== null && transition !== defaultTransition)\n\t\t\t{\n\t\t\t\t//temporarily make the active screen invisible because the\n\t\t\t\t//transition doesn't start right away.\n\t\t\t\tthis._activeScreen.visible = false;\n\t\t\t\tthis._waitingForTransitionFrameCount = 0;\n\t\t\t\tthis._waitingTransition = transition;\n\t\t\t\t//this is a workaround for an issue with transition performance.\n\t\t\t\t//see the comment in the listener for details.\n\t\t\t\tthis.addEventListener(Event.ENTER_FRAME, waitingForTransition_enterFrameHandler);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//the screen may have been hidden if the transition was delayed\n\t\t\t\tthis._activeScreen.visible = true;\n\t\t\t\tdefaultTransition(this._previousScreenInTransition, this._activeScreen, transitionComplete);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function startWaitingTransition():void\n\t\t{\n\t\t\tthis.removeEventListener(Event.ENTER_FRAME, waitingForTransition_enterFrameHandler);\n\t\t\tif(this._activeScreen)\n\t\t\t{\n\t\t\t\tthis._activeScreen.visible = true;\n\t\t\t}\n\n\t\t\tvar transition:Function = this._waitingTransition;\n\t\t\tthis._waitingTransition = null;\n\t\t\ttransition(this._previousScreenInTransition, this._activeScreen, transitionComplete);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function transitionComplete(cancelTransition:Boolean = false):void\n\t\t{\n\t\t\t//consider the transition still active if something is already\n\t\t\t//queued up to happen next. if an event listener asks to show a new\n\t\t\t//screen, it needs to replace what is queued up.\n\t\t\tthis._isTransitionActive = this._clearAfterTransition || this._nextScreenID;\n\t\t\tif(cancelTransition)\n\t\t\t{\n\t\t\t\tif(this._activeScreen !== null)\n\t\t\t\t{\n\t\t\t\t\tvar item:IScreenNavigatorItem = IScreenNavigatorItem(this._screens[this._activeScreenID]);\n\t\t\t\t\tthis.cleanupActiveScreen();\n\t\t\t\t\tthis.screenContainer.removeChild(this._activeScreen, item.canDispose);\n\t\t\t\t\tif(!item.canDispose)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._activeScreen.width = this._activeScreenExplicitWidth;\n\t\t\t\t\t\tthis._activeScreen.height = this._activeScreenExplicitHeight;\n\t\t\t\t\t\tvar measureScreen:IMeasureDisplayObject = this._activeScreen as IMeasureDisplayObject;\n\t\t\t\t\t\tif(measureScreen !== null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmeasureScreen.minWidth = this._activeScreenExplicitMinWidth;\n\t\t\t\t\t\t\tmeasureScreen.minHeight = this._activeScreenExplicitMinHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis._activeScreen = this._previousScreenInTransition;\n\t\t\t\tthis._activeScreenID = this._previousScreenInTransitionID;\n\t\t\t\tthis._previousScreenInTransition = null;\n\t\t\t\tthis._previousScreenInTransitionID = null;\n\t\t\t\tthis.prepareActiveScreen();\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.TRANSITION_CANCEL);\n\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//we need to save these in local variables because a new\n\t\t\t\t//transition may be started in the listeners for the transition\n\t\t\t\t//complete events, and that will overwrite them.\n\t\t\t\tvar activeScreen:DisplayObject = this._activeScreen;\n\t\t\t\tvar previousScreen:DisplayObject = this._previousScreenInTransition;\n\t\t\t\tvar previousScreenID:String = this._previousScreenInTransitionID;\n\t\t\t\titem = IScreenNavigatorItem(this._screens[previousScreenID]);\n\t\t\t\tthis._previousScreenInTransition = null;\n\t\t\t\tthis._previousScreenInTransitionID = null;\n\t\t\t\tif(previousScreen !== null)\n\t\t\t\t{\n\t\t\t\t\tpreviousScreen.dispatchEventWith(FeathersEventType.TRANSITION_OUT_COMPLETE);\n\t\t\t\t}\n\t\t\t\tif(activeScreen !== null)\n\t\t\t\t{\n\t\t\t\t\tactiveScreen.dispatchEventWith(FeathersEventType.TRANSITION_IN_COMPLETE);\n\t\t\t\t}\n\t\t\t\t//we need to dispatch this event before the previous screen's\n\t\t\t\t//owner property is set to null because legacy code that was\n\t\t\t\t//written before TRANSITION_OUT_COMPLETE existed may be using\n\t\t\t\t//this event for the same purpose.\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.TRANSITION_COMPLETE);\n\t\t\t\tif(previousScreen !== null)\n\t\t\t\t{\n\t\t\t\t\tif(previousScreen is IScreen)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar screen:IScreen = IScreen(previousScreen);\n\t\t\t\t\t\tscreen.screenID = null;\n\t\t\t\t\t\tscreen.owner = null;\n\t\t\t\t\t}\n\t\t\t\t\tpreviousScreen.removeEventListener(Event.RESIZE, activeScreen_resizeHandler);\n\t\t\t\t\tthis.screenContainer.removeChild(previousScreen, item.canDispose);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._isTransitionActive = false;\n\t\t\tvar nextTransition:Function = this._nextScreenTransition;\n\t\t\tthis._nextScreenTransition = null;\n\t\t\tif(this._clearAfterTransition)\n\t\t\t{\n\t\t\t\tthis._clearAfterTransition = false;\n\t\t\t\tthis.clearScreenInternal(nextTransition);\n\t\t\t}\n\t\t\telse if(this._nextScreenID !== null)\n\t\t\t{\n\t\t\t\tvar nextScreenID:String = this._nextScreenID;\n\t\t\t\tthis._nextScreenID = null;\n\t\t\t\tthis.showScreenInternal(nextScreenID, nextTransition);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function screenNavigator_addedToStageHandler(event:Event):void\n\t\t{\n\t\t\tif(this._autoSizeMode === AutoSizeMode.STAGE)\n\t\t\t{\n\t\t\t\t//if we validated before being added to the stage, or if we've\n\t\t\t\t//been removed from stage and added again, we need to be sure\n\t\t\t\t//that the new stage dimensions are accounted for.\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t\tthis.stage.addEventListener(Event.RESIZE, stage_resizeHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function screenNavigator_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tthis.stage.removeEventListener(Event.RESIZE, stage_resizeHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function activeScreen_resizeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._isValidating || this._autoSizeMode != AutoSizeMode.CONTENT)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_resizeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function screen_transitionDelayHandler(event:Event):void\n\t\t{\n\t\t\tthis._activeScreen.removeEventListener(event.type, screen_transitionDelayHandler);\n\t\t\tvar wasWaiting:Boolean = this._waitingForDelayedTransition;\n\t\t\tthis._waitingForDelayedTransition = false;\n\t\t\tif(wasWaiting)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar transition:Function = this._delayedTransition;\n\t\t\tthis._delayedTransition = null;\n\t\t\tthis.startTransition(transition);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate function waitingForTransition_enterFrameHandler(event:Event):void\n\t\t{\n\t\t\t//we need to wait a couple of frames before we can start the\n\t\t\t//transition to make it as smooth as possible. this feels a little\n\t\t\t//hacky, to be honest, but I can't figure out why waiting only one\n\t\t\t//frame won't do the trick. the delay is so small though that it's\n\t\t\t//virtually impossible to notice.\n\t\t\tif(this._waitingForTransitionFrameCount < 2)\n\t\t\t{\n\t\t\t\tthis._waitingForTransitionFrameCount++;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.startWaitingTransition();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/supportClasses/DataGridDataViewPort.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.supportClasses\n{\n\timport feathers.controls.DataGrid;\n\timport feathers.controls.Scroller;\n\timport feathers.controls.renderers.IDataGridCellRenderer;\n\timport feathers.controls.supportClasses.DataGridRowRenderer;\n\timport feathers.controls.supportClasses.IViewPort;\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IValidating;\n\timport feathers.data.IListCollection;\n\timport feathers.data.ListCollection;\n\timport feathers.events.CollectionEventType;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.ILayout;\n\timport feathers.layout.IVariableVirtualLayout;\n\timport feathers.layout.IVirtualLayout;\n\timport feathers.layout.LayoutBoundsResult;\n\timport feathers.layout.ViewPortBounds;\n\n\timport flash.errors.IllegalOperationError;\n\timport flash.geom.Point;\n\timport flash.utils.Dictionary;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.utils.Pool;\n\n\t/**\n\t * @private\n\t * Used internally by DataGrid. Not meant to be used on its own.\n\t *\n\t * @see feathers.controls.DataGrid\n\t *\n\t * @productversion Feathers 3.4.0\n\t */\n\tpublic class DataGridDataViewPort extends FeathersControl implements IViewPort\n\t{\n\t\tprivate static const INVALIDATION_FLAG_ROW_RENDERER_FACTORY:String = \"rowRendererFactory\";\n\t\tprivate static const HELPER_VECTOR:Vector.<int> = new <int>[];\n\n\t\tpublic function DataGridDataViewPort()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _viewPortBounds:ViewPortBounds = new ViewPortBounds();\n\n\t\tprivate var _layoutResult:LayoutBoundsResult = new LayoutBoundsResult();\n\n\t\tprivate var _typicalRowIsInDataProvider:Boolean = false;\n\t\tprivate var _typicalRowRenderer:DataGridRowRenderer;\n\t\tprivate var _rows:Vector.<DisplayObject> = new <DisplayObject>[];\n\t\tprivate var _rowRendererMap:Dictionary = new Dictionary(true);\n\t\tprivate var _unrenderedRows:Vector.<int> = new <int>[];\n\t\tprivate var _rowStorage:RowRendererFactoryStorage = new RowRendererFactoryStorage();\n\t\tprivate var _minimumRowCount:int = 0;\n\n\t\tprivate var _actualMinVisibleWidth:Number = 0;\n\n\t\tprivate var _explicitMinVisibleWidth:Number;\n\n\t\tpublic function get minVisibleWidth():Number\n\t\t{\n\t\t\tif(this._explicitMinVisibleWidth !== this._explicitMinVisibleWidth) //isNaN\n\t\t\t{\n\t\t\t\treturn this._actualMinVisibleWidth;\n\t\t\t}\n\t\t\treturn this._explicitMinVisibleWidth;\n\t\t}\n\n\t\tpublic function set minVisibleWidth(value:Number):void\n\t\t{\n\t\t\tif(this._explicitMinVisibleWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar valueIsNaN:Boolean = value !== value; //isNaN\n\t\t\tif(valueIsNaN &&\n\t\t\t\tthis._explicitMinVisibleWidth !== this._explicitMinVisibleWidth) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar oldValue:Number = this._explicitMinVisibleWidth;\n\t\t\tthis._explicitMinVisibleWidth = value;\n\t\t\tif(valueIsNaN)\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleWidth = 0;\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleWidth = value;\n\t\t\t\tif(this._explicitVisibleWidth !== this._explicitVisibleWidth && //isNaN\n\t\t\t\t\t(this._actualVisibleWidth < value || this._actualVisibleWidth == oldValue))\n\t\t\t\t{\n\t\t\t\t\t//only invalidate if this change might affect the visibleWidth\n\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate var _maxVisibleWidth:Number = Number.POSITIVE_INFINITY;\n\n\t\tpublic function get maxVisibleWidth():Number\n\t\t{\n\t\t\treturn this._maxVisibleWidth;\n\t\t}\n\n\t\tpublic function set maxVisibleWidth(value:Number):void\n\t\t{\n\t\t\tif(this._maxVisibleWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value) //isNaN\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"maxVisibleWidth cannot be NaN\");\n\t\t\t}\n\t\t\tvar oldValue:Number = this._maxVisibleWidth;\n\t\t\tthis._maxVisibleWidth = value;\n\t\t\tif(this._explicitVisibleWidth !== this._explicitVisibleWidth && //isNaN\n\t\t\t\t(this._actualVisibleWidth > value || this._actualVisibleWidth == oldValue))\n\t\t\t{\n\t\t\t\t//only invalidate if this change might affect the visibleWidth\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\tprivate var _actualVisibleWidth:Number = 0;\n\n\t\tprivate var _explicitVisibleWidth:Number = NaN;\n\n\t\tpublic function get visibleWidth():Number\n\t\t{\n\t\t\treturn this._actualVisibleWidth;\n\t\t}\n\n\t\tpublic function set visibleWidth(value:Number):void\n\t\t{\n\t\t\tif(this._explicitVisibleWidth == value ||\n\t\t\t\t(value !== value && this._explicitVisibleWidth !== this._explicitVisibleWidth)) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._explicitVisibleWidth = value;\n\t\t\tif(this._actualVisibleWidth != value)\n\t\t\t{\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\tprivate var _actualMinVisibleHeight:Number = 0;\n\n\t\tprivate var _explicitMinVisibleHeight:Number;\n\n\t\tpublic function get minVisibleHeight():Number\n\t\t{\n\t\t\tif(this._explicitMinVisibleHeight !== this._explicitMinVisibleHeight) //isNaN\n\t\t\t{\n\t\t\t\treturn this._actualMinVisibleHeight;\n\t\t\t}\n\t\t\treturn this._explicitMinVisibleHeight;\n\t\t}\n\n\t\tpublic function set minVisibleHeight(value:Number):void\n\t\t{\n\t\t\tif(this._explicitMinVisibleHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar valueIsNaN:Boolean = value !== value; //isNaN\n\t\t\tif(valueIsNaN &&\n\t\t\t\tthis._explicitMinVisibleHeight !== this._explicitMinVisibleHeight) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar oldValue:Number = this._explicitMinVisibleHeight;\n\t\t\tthis._explicitMinVisibleHeight = value;\n\t\t\tif(valueIsNaN)\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleHeight = 0;\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleHeight = value;\n\t\t\t\tif(this._explicitVisibleHeight !== this._explicitVisibleHeight && //isNaN\n\t\t\t\t\t(this._actualVisibleHeight < value || this._actualVisibleHeight == oldValue))\n\t\t\t\t{\n\t\t\t\t\t//only invalidate if this change might affect the visibleHeight\n\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate var _maxVisibleHeight:Number = Number.POSITIVE_INFINITY;\n\n\t\tpublic function get maxVisibleHeight():Number\n\t\t{\n\t\t\treturn this._maxVisibleHeight;\n\t\t}\n\n\t\tpublic function set maxVisibleHeight(value:Number):void\n\t\t{\n\t\t\tif(this._maxVisibleHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value) //isNaN\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"maxVisibleHeight cannot be NaN\");\n\t\t\t}\n\t\t\tvar oldValue:Number = this._maxVisibleHeight;\n\t\t\tthis._maxVisibleHeight = value;\n\t\t\tif(this._explicitVisibleHeight !== this._explicitVisibleHeight && //isNaN\n\t\t\t\t(this._actualVisibleHeight > value || this._actualVisibleHeight == oldValue))\n\t\t\t{\n\t\t\t\t//only invalidate if this change might affect the visibleHeight\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\tprivate var _actualVisibleHeight:Number = 0;\n\n\t\tprivate var _explicitVisibleHeight:Number = NaN;\n\n\t\tpublic function get visibleHeight():Number\n\t\t{\n\t\t\treturn this._actualVisibleHeight;\n\t\t}\n\n\t\tpublic function set visibleHeight(value:Number):void\n\t\t{\n\t\t\tif(this._explicitVisibleHeight == value ||\n\t\t\t\t(value !== value && this._explicitVisibleHeight !== this._explicitVisibleHeight)) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._explicitVisibleHeight = value;\n\t\t\tif(this._actualVisibleHeight != value)\n\t\t\t{\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\tprotected var _contentX:Number = 0;\n\n\t\tpublic function get contentX():Number\n\t\t{\n\t\t\treturn this._contentX;\n\t\t}\n\n\t\tprotected var _contentY:Number = 0;\n\n\t\tpublic function get contentY():Number\n\t\t{\n\t\t\treturn this._contentY;\n\t\t}\n\n\t\tprivate var _horizontalScrollPosition:Number = 0;\n\n\t\tpublic function get horizontalScrollPosition():Number\n\t\t{\n\t\t\treturn this._horizontalScrollPosition;\n\t\t}\n\n\t\tpublic function set horizontalScrollPosition(value:Number):void\n\t\t{\n\t\t\tif(this._horizontalScrollPosition == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalScrollPosition = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t}\n\n\t\tprivate var _verticalScrollPosition:Number = 0;\n\n\t\tpublic function get verticalScrollPosition():Number\n\t\t{\n\t\t\treturn this._verticalScrollPosition;\n\t\t}\n\n\t\tpublic function set verticalScrollPosition(value:Number):void\n\t\t{\n\t\t\tif(this._verticalScrollPosition == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalScrollPosition = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t}\n\n\t\tpublic function get horizontalScrollStep():Number\n\t\t{\n\t\t\tvar rowRenderer:DisplayObject = null;\n\t\t\tvar virtualLayout:IVirtualLayout = this._layout as IVirtualLayout;\n\t\t\tif(virtualLayout === null || !virtualLayout.useVirtualLayout)\n\t\t\t{\n\t\t\t\tif(this._rows.length > 0)\n\t\t\t\t{\n\t\t\t\t\trowRenderer = this._rows[0] as DisplayObject;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(rowRenderer === null)\n\t\t\t{\n\t\t\t\trowRenderer = this._typicalRowRenderer as DisplayObject;\n\t\t\t}\n\t\t\tif(rowRenderer === null)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tvar rowRendererWidth:Number = rowRenderer.width;\n\t\t\tvar rowRendererHeight:Number = rowRenderer.height;\n\t\t\tif(rowRendererWidth < rowRendererHeight)\n\t\t\t{\n\t\t\t\treturn rowRendererWidth;\n\t\t\t}\n\t\t\treturn rowRendererHeight;\n\t\t}\n\n\t\tpublic function get verticalScrollStep():Number\n\t\t{\n\t\t\tvar rowRenderer:DisplayObject = null;\n\t\t\tvar virtualLayout:IVirtualLayout = this._layout as IVirtualLayout;\n\t\t\tif(virtualLayout === null || !virtualLayout.useVirtualLayout)\n\t\t\t{\n\t\t\t\tif(this._rows.length > 0)\n\t\t\t\t{\n\t\t\t\t\trowRenderer = this._rows[0] as DisplayObject;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(rowRenderer === null)\n\t\t\t{\n\t\t\t\trowRenderer = this._typicalRowRenderer as DisplayObject;\n\t\t\t}\n\t\t\tif(rowRenderer === null)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tvar rowRendererWidth:Number = rowRenderer.width;\n\t\t\tvar rowRendererHeight:Number = rowRenderer.height;\n\t\t\tif(rowRendererWidth < rowRendererHeight)\n\t\t\t{\n\t\t\t\treturn rowRendererWidth;\n\t\t\t}\n\t\t\treturn rowRendererHeight;\n\t\t}\n\n\t\tprivate var _owner:DataGrid = null;\n\n\t\tpublic function get owner():DataGrid\n\t\t{\n\t\t\treturn this._owner;\n\t\t}\n\n\t\tpublic function set owner(value:DataGrid):void\n\t\t{\n\t\t\tthis._owner = value;\n\t\t}\n\n\t\tprivate var _updateForDataReset:Boolean = false;\n\n\t\tprivate var _dataProvider:IListCollection = null;\n\n\t\tpublic function get dataProvider():IListCollection\n\t\t{\n\t\t\treturn this._dataProvider;\n\t\t}\n\n\t\tpublic function set dataProvider(value:IListCollection):void\n\t\t{\n\t\t\tif(this._dataProvider == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._dataProvider)\n\t\t\t{\n\t\t\t\tthis._dataProvider.removeEventListener(Event.CHANGE, dataProvider_changeHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.RESET, dataProvider_resetHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.FILTER_CHANGE, dataProvider_filterChangeHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.ADD_ITEM, dataProvider_addItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.REMOVE_ITEM, dataProvider_removeItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.REPLACE_ITEM, dataProvider_replaceItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.UPDATE_ITEM, dataProvider_updateItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.UPDATE_ALL, dataProvider_updateAllHandler);\n\t\t\t}\n\t\t\tthis._dataProvider = value;\n\t\t\tif(this._dataProvider)\n\t\t\t{\n\t\t\t\tthis._dataProvider.addEventListener(Event.CHANGE, dataProvider_changeHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.RESET, dataProvider_resetHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.FILTER_CHANGE, dataProvider_filterChangeHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.ADD_ITEM, dataProvider_addItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.REMOVE_ITEM, dataProvider_removeItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.REPLACE_ITEM, dataProvider_replaceItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.UPDATE_ITEM, dataProvider_updateItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.UPDATE_ALL, dataProvider_updateAllHandler);\n\t\t\t}\n\t\t\tif(this._layout is IVariableVirtualLayout)\n\t\t\t{\n\t\t\t\tIVariableVirtualLayout(this._layout).resetVariableVirtualCache();\n\t\t\t}\n\t\t\tthis._updateForDataReset = true;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\tprotected var _columns:IListCollection = null;\n\n\t\tpublic function get columns():IListCollection\n\t\t{\n\t\t\treturn this._columns;\n\t\t}\n\n\t\tpublic function set columns(value:IListCollection):void\n\t\t{\n\t\t\tif(this._columns == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._columns)\n\t\t\t{\n\t\t\t\tthis._columns.removeEventListener(Event.CHANGE, columns_changeHandler);\n\t\t\t}\n\t\t\tthis._columns = value;\n\t\t\tif(this._columns)\n\t\t\t{\n\t\t\t\tthis._columns.addEventListener(Event.CHANGE, columns_changeHandler);\n\t\t\t}\n\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\tprivate var _ignoreLayoutChanges:Boolean = false;\n\t\tprivate var _ignoreRendererResizing:Boolean = false;\n\n\t\tprivate var _layout:ILayout = null;\n\n\t\tpublic function get layout():ILayout\n\t\t{\n\t\t\treturn this._layout;\n\t\t}\n\n\t\tpublic function set layout(value:ILayout):void\n\t\t{\n\t\t\tif(this._layout == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._layout)\n\t\t\t{\n\t\t\t\tthis._layout.removeEventListener(Event.CHANGE, layout_changeHandler);\n\t\t\t}\n\t\t\tthis._layout = value;\n\t\t\tif(this._layout)\n\t\t\t{\n\t\t\t\tif(this._layout is IVariableVirtualLayout)\n\t\t\t\t{\n\t\t\t\t\tIVariableVirtualLayout(this._layout).resetVariableVirtualCache();\n\t\t\t\t}\n\t\t\t\tthis._layout.addEventListener(Event.CHANGE, layout_changeHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\tprivate var _typicalItem:Object = null;\n\n\t\tpublic function get typicalItem():Object\n\t\t{\n\t\t\treturn this._typicalItem;\n\t\t}\n\n\t\tpublic function set typicalItem(value:Object):void\n\t\t{\n\t\t\tif(this._typicalItem == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._typicalItem = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\tprivate var _customColumnSizes:Vector.<Number> = null;\n\n\t\tpublic function get customColumnSizes():Vector.<Number>\n\t\t{\n\t\t\treturn this._customColumnSizes;\n\t\t}\n\n\t\tpublic function set customColumnSizes(value:Vector.<Number>):void\n\t\t{\n\t\t\tif(this._customColumnSizes === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customColumnSizes = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\tprivate var _ignoreSelectionChanges:Boolean = false;\n\n\t\tprivate var _isSelectable:Boolean = true;\n\n\t\tpublic function get isSelectable():Boolean\n\t\t{\n\t\t\treturn this._isSelectable;\n\t\t}\n\n\t\tpublic function set isSelectable(value:Boolean):void\n\t\t{\n\t\t\tif(this._isSelectable == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isSelectable = value;\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tthis.selectedIndices = null;\n\t\t\t}\n\t\t}\n\n\t\tprivate var _allowMultipleSelection:Boolean = false;\n\n\t\tpublic function get allowMultipleSelection():Boolean\n\t\t{\n\t\t\treturn this._allowMultipleSelection;\n\t\t}\n\n\t\tpublic function set allowMultipleSelection(value:Boolean):void\n\t\t{\n\t\t\tthis._allowMultipleSelection = value;\n\t\t}\n\n\t\tprivate var _selectedIndices:ListCollection;\n\n\t\tpublic function get selectedIndices():ListCollection\n\t\t{\n\t\t\treturn this._selectedIndices;\n\t\t}\n\n\t\tpublic function set selectedIndices(value:ListCollection):void\n\t\t{\n\t\t\tif(this._selectedIndices == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._selectedIndices)\n\t\t\t{\n\t\t\t\tthis._selectedIndices.removeEventListener(Event.CHANGE, selectedIndices_changeHandler);\n\t\t\t}\n\t\t\tthis._selectedIndices = value;\n\t\t\tif(this._selectedIndices)\n\t\t\t{\n\t\t\t\tthis._selectedIndices.addEventListener(Event.CHANGE, selectedIndices_changeHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\n\t\tpublic function get requiresMeasurementOnScroll():Boolean\n\t\t{\n\t\t\treturn this._layout.requiresLayoutOnScroll &&\n\t\t\t\t(this._explicitVisibleWidth !== this._explicitVisibleWidth || //isNaN\n\t\t\t\tthis._explicitVisibleHeight !== this._explicitVisibleHeight); //isNaN\n\t\t}\n\n\t\tpublic function calculateNavigationDestination(index:int, keyCode:uint):int\n\t\t{\n\t\t\treturn this._layout.calculateNavigationDestination(this._rows, index, keyCode, this._layoutResult);\n\t\t}\n\n\t\tpublic function getScrollPositionForIndex(index:int, result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\t\t\treturn this._layout.getScrollPositionForIndex(index, this._rows,\n\t\t\t\t0, 0, this._actualVisibleWidth, this._actualVisibleHeight, result);\n\t\t}\n\n\t\tpublic function getNearestScrollPositionForIndex(index:int, result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\t\t\treturn this._layout.getNearestScrollPositionForIndex(index,\n\t\t\t\tthis._horizontalScrollPosition, this._verticalScrollPosition,\n\t\t\t\tthis._rows, 0, 0, this._actualVisibleWidth, this._actualVisibleHeight, result);\n\t\t}\n\n\t\tpublic function itemToCellRenderer(item:Object, columnIndex:int):IDataGridCellRenderer\n\t\t{\n\t\t\tvar rowRenderer:DataGridRowRenderer = this._rowRendererMap[item] as DataGridRowRenderer;\n\t\t\tif(rowRenderer === null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn rowRenderer.getCellRendererForColumn(columnIndex);\n\t\t}\n\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tthis.refreshInactiveRowRenderers(true);\n\t\t\tthis.owner = null;\n\t\t\tthis.layout = null;\n\t\t\tthis.dataProvider = null;\n\t\t\tthis.columns = null;\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar scrollInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SCROLL);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\tvar selectionInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SELECTED);\n\t\t\tvar rowRendererInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_ROW_RENDERER_FACTORY);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar layoutInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_LAYOUT);\n\n\t\t\t//scrolling only affects the layout is requiresLayoutOnScroll is true\n\t\t\tif(!layoutInvalid && scrollInvalid && this._layout && this._layout.requiresLayoutOnScroll)\n\t\t\t{\n\t\t\t\tlayoutInvalid = true;\n\t\t\t}\n\n\t\t\tvar basicsInvalid:Boolean = sizeInvalid || dataInvalid || layoutInvalid || rowRendererInvalid;\n\n\t\t\tvar oldIgnoreRendererResizing:Boolean = this._ignoreRendererResizing;\n\t\t\tthis._ignoreRendererResizing = true;\n\t\t\tvar oldIgnoreLayoutChanges:Boolean = this._ignoreLayoutChanges;\n\t\t\tthis._ignoreLayoutChanges = true;\n\n\t\t\tif(scrollInvalid || sizeInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshViewPortBounds();\n\t\t\t}\n\t\t\tif(basicsInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshInactiveRowRenderers(false);\n\t\t\t}\n\t\t\tif(dataInvalid || layoutInvalid || rowRendererInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshLayoutTypicalItem();\n\t\t\t}\n\t\t\tif(basicsInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshRowRenderers();\n\t\t\t}\n\t\t\tif(selectionInvalid || basicsInvalid)\n\t\t\t{\n\t\t\t\t//unlike resizing renderers and layout changes, we only want to\n\t\t\t\t//stop listening for selection changes when we're forcibly\n\t\t\t\t//updating selection. other property changes on item renderers\n\t\t\t\t//can validly change selection, and we need to detect that.\n\t\t\t\tvar oldIgnoreSelectionChanges:Boolean = this._ignoreSelectionChanges;\n\t\t\t\tthis._ignoreSelectionChanges = true;\n\t\t\t\tthis.refreshSelection();\n\t\t\t\tthis._ignoreSelectionChanges = oldIgnoreSelectionChanges;\n\t\t\t}\n\t\t\tif(stateInvalid || basicsInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshEnabled();\n\t\t\t}\n\t\t\tthis._ignoreLayoutChanges = oldIgnoreLayoutChanges;\n\n\t\t\tif(stateInvalid || selectionInvalid || stylesInvalid || basicsInvalid)\n\t\t\t{\n\t\t\t\tthis._layout.layout(this._rows, this._viewPortBounds, this._layoutResult);\n\t\t\t}\n\n\t\t\tthis._ignoreRendererResizing = oldIgnoreRendererResizing;\n\n\t\t\tthis._contentX = this._layoutResult.contentX;\n\t\t\tthis._contentY = this._layoutResult.contentY;\n\t\t\tthis.saveMeasurements(this._layoutResult.contentWidth, this._layoutResult.contentHeight,\n\t\t\t\tthis._layoutResult.contentWidth, this._layoutResult.contentHeight);\n\t\t\tthis._actualVisibleWidth = this._layoutResult.viewPortWidth;\n\t\t\tthis._actualVisibleHeight = this._layoutResult.viewPortHeight;\n\t\t\tthis._actualMinVisibleWidth = this._layoutResult.viewPortWidth;\n\t\t\tthis._actualMinVisibleHeight = this._layoutResult.viewPortHeight;\n\n\t\t\t//final validation to avoid juggler next frame issues\n\t\t\tthis.validateRowRenderers();\n\t\t}\n\n\t\tprivate function refreshViewPortBounds():void\n\t\t{\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinVisibleWidth !== this._explicitMinVisibleWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinVisibleHeight !== this._explicitMinVisibleHeight; //isNaN\n\t\t\tthis._viewPortBounds.x = 0;\n\t\t\tthis._viewPortBounds.y = 0;\n\t\t\tthis._viewPortBounds.scrollX = this._horizontalScrollPosition;\n\t\t\tthis._viewPortBounds.scrollY = this._verticalScrollPosition;\n\t\t\tthis._viewPortBounds.explicitWidth = this._explicitVisibleWidth;\n\t\t\tthis._viewPortBounds.explicitHeight = this._explicitVisibleHeight;\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tthis._viewPortBounds.minWidth = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._viewPortBounds.minWidth = this._explicitMinVisibleWidth;\n\t\t\t}\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tthis._viewPortBounds.minHeight = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._viewPortBounds.minHeight = this._explicitMinVisibleHeight;\n\t\t\t}\n\t\t\tthis._viewPortBounds.maxWidth = this._maxVisibleWidth;\n\t\t\tthis._viewPortBounds.maxHeight = this._maxVisibleHeight;\n\t\t}\n\n\t\tprivate function refreshInactiveRowRenderers(forceCleanup:Boolean):void\n\t\t{\n\t\t\tvar temp:Vector.<DataGridRowRenderer> = this._rowStorage.inactiveRowRenderers;\n\t\t\tthis._rowStorage.inactiveRowRenderers = this._rowStorage.activeRowRenderers;\n\t\t\tthis._rowStorage.activeRowRenderers = temp;\n\t\t\tif(this._rowStorage.activeRowRenderers.length > 0)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"DataGridDataViewPort: active row renderers should be empty.\");\n\t\t\t}\n\t\t\tif(forceCleanup)\n\t\t\t{\n\t\t\t\tthis.recoverInactiveRowRenderers();\n\t\t\t\tthis.freeInactiveRowRenderers(0);\n\t\t\t\tif(this._typicalRowRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\tif(this._typicalRowIsInDataProvider)\n\t\t\t\t\t{\n\t\t\t\t\t\tdelete this._rowRendererMap[this._typicalRowRenderer.data];\n\t\t\t\t\t}\n\t\t\t\t\tthis.destroyRowRenderer(this._typicalRowRenderer);\n\t\t\t\t\tthis._typicalRowRenderer = null;\n\t\t\t\t\tthis._typicalRowIsInDataProvider = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._rows.length = 0;\n\t\t}\n\n\t\tprivate function recoverInactiveRowRenderers():void\n\t\t{\n\t\t\tvar inactiveRowRenderers:Vector.<DataGridRowRenderer> = this._rowStorage.inactiveRowRenderers;\n\t\t\tvar itemCount:int = inactiveRowRenderers.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar rowRenderer:DataGridRowRenderer = inactiveRowRenderers[i];\n\t\t\t\tif(rowRenderer === null || rowRenderer.data === null)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tthis._owner.dispatchEventWith(FeathersEventType.RENDERER_REMOVE, false, rowRenderer);\n\t\t\t\tdelete this._rowRendererMap[rowRenderer.data];\n\t\t\t}\n\t\t}\n\n\t\tprivate function freeInactiveRowRenderers(minimumItemCount:int):void\n\t\t{\n\t\t\tvar inactiveRowRenderers:Vector.<DataGridRowRenderer> = this._rowStorage.inactiveRowRenderers;\n\t\t\tvar activeRowRenderers:Vector.<DataGridRowRenderer> = this._rowStorage.activeRowRenderers;\n\t\t\tvar activeRowRenderersCount:int = activeRowRenderers.length;\n\n\t\t\t//we may keep around some extra renderers to avoid too much\n\t\t\t//allocation and garbage collection. they'll be hidden.\n\t\t\tvar itemCount:int = inactiveRowRenderers.length;\n\t\t\tvar keepCount:int = minimumItemCount - activeRowRenderersCount;\n\t\t\tif(keepCount > itemCount)\n\t\t\t{\n\t\t\t\tkeepCount = itemCount;\n\t\t\t}\n\t\t\tfor(var i:int = 0; i < keepCount; i++)\n\t\t\t{\n\t\t\t\tvar rowRenderer:DataGridRowRenderer = inactiveRowRenderers.shift();\n\t\t\t\tif(rowRenderer === null)\n\t\t\t\t{\n\t\t\t\t\tkeepCount++;\n\t\t\t\t\tif(itemCount < keepCount)\n\t\t\t\t\t{\n\t\t\t\t\t\tkeepCount = itemCount;\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\trowRenderer.data = null;\n\t\t\t\trowRenderer.columns = null;\n\t\t\t\trowRenderer.index = -1;\n\t\t\t\trowRenderer.visible = false;\n\t\t\t\trowRenderer.customColumnSizes = null;\n\t\t\t\tactiveRowRenderers[activeRowRenderersCount] = rowRenderer;\n\t\t\t\tactiveRowRenderersCount++;\n\t\t\t}\n\t\t\titemCount -= keepCount;\n\t\t\tfor(i = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\trowRenderer = inactiveRowRenderers.shift();\n\t\t\t\tif(rowRenderer === null)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tthis.destroyRowRenderer(rowRenderer);\n\t\t\t}\n\t\t}\n\n\t\tprivate function createRowRenderer(item:Object, rowIndex:int, useCache:Boolean, isTemporary:Boolean):DataGridRowRenderer\n\t\t{\n\t\t\tvar inactiveRowRenderers:Vector.<DataGridRowRenderer> = this._rowStorage.inactiveRowRenderers;\n\t\t\tvar activeRowRenderers:Vector.<DataGridRowRenderer> = this._rowStorage.activeRowRenderers;\n\t\t\tvar rowRenderer:DataGridRowRenderer = null;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tif(!useCache || isTemporary || inactiveRowRenderers.length == 0)\n\t\t\t\t{\n\t\t\t\t\trowRenderer = new DataGridRowRenderer();\n\t\t\t\t\tthis.addChild(DisplayObject(rowRenderer));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\trowRenderer = inactiveRowRenderers.shift();\n\t\t\t\t}\n\t\t\t\t//wondering why this all is in a loop?\n\t\t\t\t//_inactiveRenderers.shift() may return null because we're\n\t\t\t\t//storing null values instead of calling splice() to improve\n\t\t\t\t//performance.\n\t\t\t}\n\t\t\twhile(rowRenderer === null);\n\t\t\trowRenderer.data = item;\n\t\t\trowRenderer.columns = this._columns;\n\t\t\trowRenderer.index = rowIndex;\n\t\t\trowRenderer.owner = this._owner;\n\t\t\trowRenderer.customColumnSizes = this._customColumnSizes;\n\n\t\t\tif(!isTemporary)\n\t\t\t{\n\t\t\t\tthis._rowRendererMap[item] = rowRenderer;\n\t\t\t\tactiveRowRenderers[activeRowRenderers.length] = rowRenderer;\n\t\t\t\trowRenderer.addEventListener(Event.TRIGGERED, rowRenderer_triggeredHandler);\n\t\t\t\trowRenderer.addEventListener(Event.CHANGE, rowRenderer_changeHandler);\n\t\t\t\trowRenderer.addEventListener(FeathersEventType.RESIZE, rowRenderer_resizeHandler);\n\t\t\t\tthis._owner.dispatchEventWith(FeathersEventType.RENDERER_ADD, false, rowRenderer);\n\t\t\t}\n\n\t\t\treturn rowRenderer;\n\t\t}\n\n\t\tprivate function destroyRowRenderer(rowRenderer:DataGridRowRenderer):void\n\t\t{\n\t\t\trowRenderer.removeEventListener(Event.TRIGGERED, rowRenderer_triggeredHandler);\n\t\t\trowRenderer.removeEventListener(Event.CHANGE, rowRenderer_changeHandler);\n\t\t\trowRenderer.removeEventListener(FeathersEventType.RESIZE, rowRenderer_resizeHandler);\n\t\t\trowRenderer.data = null;\n\t\t\trowRenderer.columns = null;\n\t\t\trowRenderer.index = -1;\n\t\t\tthis.removeChild(DisplayObject(rowRenderer), true);\n\t\t\trowRenderer.owner = null;\n\t\t}\n\n\t\tprivate function refreshLayoutTypicalItem():void\n\t\t{\n\t\t\tvar virtualLayout:IVirtualLayout = this._layout as IVirtualLayout;\n\t\t\tif(virtualLayout === null || !virtualLayout.useVirtualLayout)\n\t\t\t{\n\t\t\t\t//the old layout was virtual, but this one isn't\n\t\t\t\tif(!this._typicalRowIsInDataProvider && this._typicalRowRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\t//it's safe to destroy this renderer\n\t\t\t\t\tthis.destroyRowRenderer(this._typicalRowRenderer);\n\t\t\t\t\tthis._typicalRowRenderer = null;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar typicalItemIndex:int = 0;\n\t\t\tvar newTypicalItemIsInDataProvider:Boolean = false;\n\t\t\tvar typicalItem:Object = this._typicalItem;\n\t\t\tif(typicalItem !== null)\n\t\t\t{\n\t\t\t\tif(this._dataProvider !== null)\n\t\t\t\t{\n\t\t\t\t\ttypicalItemIndex = this._dataProvider.getItemIndex(typicalItem);\n\t\t\t\t\tnewTypicalItemIsInDataProvider = typicalItemIndex >= 0;\n\t\t\t\t}\n\t\t\t\tif(typicalItemIndex < 0)\n\t\t\t\t{\n\t\t\t\t\ttypicalItemIndex = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(this._dataProvider !== null && this._dataProvider.length > 0)\n\t\t\t\t{\n\t\t\t\t\tnewTypicalItemIsInDataProvider = true;\n\t\t\t\t\ttypicalItem = this._dataProvider.getItemAt(0);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//#1645 The typicalItem can be null if the data provider contains\n\t\t\t//a null value at index 0. this is the only time we allow null.\n\t\t\tif(typicalItem !== null || newTypicalItemIsInDataProvider)\n\t\t\t{\n\t\t\t\tvar typicalRenderer:DataGridRowRenderer = this._rowRendererMap[typicalItem] as DataGridRowRenderer;\n\t\t\t\tif(typicalRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\t//at this point, the item already has a row renderer.\n\t\t\t\t\t//(this doesn't necessarily mean that the current typical\n\t\t\t\t\t//item was the typical item last time this function was\n\t\t\t\t\t//called)\n\n\t\t\t\t\t//the index may have changed if items were added, removed or\n\t\t\t\t\t//reordered in the data provider\n\t\t\t\t\ttypicalRenderer.index = typicalItemIndex;\n\t\t\t\t}\n\t\t\t\tif(typicalRenderer === null && this._typicalRowRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\t//the typical item has changed, and doesn't have a row\n\t\t\t\t\t//renderer yet. the previous typical item had a row\n\t\t\t\t\t//renderer, so we will try to reuse it.\n\n\t\t\t\t\t//we can reuse the existing typical row renderer if the old\n\t\t\t\t\t//typical item wasn't in the data provider. otherwise, it\n\t\t\t\t\t//may still be needed for the same item.\n\t\t\t\t\tvar canReuse:Boolean = !this._typicalRowIsInDataProvider;\n\t\t\t\t\tvar oldTypicalItemRemoved:Boolean = this._typicalRowIsInDataProvider &&\n\t\t\t\t\t\tthis._dataProvider && this._dataProvider.getItemIndex(this._typicalRowRenderer.data) < 0;\n\t\t\t\t\tif(!canReuse && oldTypicalItemRemoved)\n\t\t\t\t\t{\n\t\t\t\t\t\t//special case: if the old typical item was in the data\n\t\t\t\t\t\t//provider, but it has been removed, it's safe to reuse.\n\t\t\t\t\t\tcanReuse = true;\n\t\t\t\t\t}\n\t\t\t\t\tif(canReuse)\n\t\t\t\t\t{\n\t\t\t\t\t\t//we can reuse the item renderer used for the old\n\t\t\t\t\t\t//typical item!\n\n\t\t\t\t\t\t//if the old typical item was in the data provider,\n\t\t\t\t\t\t//remove it from the renderer map.\n\t\t\t\t\t\tif(this._typicalRowIsInDataProvider)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdelete this._rowRendererMap[this._typicalRowRenderer.data];\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttypicalRenderer = this._typicalRowRenderer;\n\t\t\t\t\t\ttypicalRenderer.data = typicalItem;\n\t\t\t\t\t\ttypicalRenderer.index = typicalItemIndex;\n\t\t\t\t\t\t//if the new typical item is in the data provider, add it\n\t\t\t\t\t\t//to the renderer map.\n\t\t\t\t\t\tif(newTypicalItemIsInDataProvider)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._rowRendererMap[typicalItem] = typicalRenderer;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(typicalRenderer === null)\n\t\t\t\t{\n\t\t\t\t\t//if we still don't have a typical row renderer, we need to\n\t\t\t\t\t//create a new one.\n\t\t\t\t\ttypicalRenderer = this.createRowRenderer(typicalItem, typicalItemIndex, false, !newTypicalItemIsInDataProvider);\n\t\t\t\t\tif(!this._typicalRowIsInDataProvider && this._typicalRowRenderer !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\t//get rid of the old typical row renderer if it isn't\n\t\t\t\t\t\t//needed anymore.  since it was not in the data\n\t\t\t\t\t\t//provider, we don't need to mess with the renderer map\n\t\t\t\t\t\t//dictionary or dispatch any events.\n\t\t\t\t\t\tthis.destroyRowRenderer(this._typicalRowRenderer);\n\t\t\t\t\t\tthis._typicalRowRenderer = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvirtualLayout.typicalItem = DisplayObject(typicalRenderer);\n\t\t\tthis._typicalRowRenderer = typicalRenderer;\n\t\t\tthis._typicalRowIsInDataProvider = newTypicalItemIsInDataProvider;\n\t\t\tif(this._typicalRowRenderer !== null && !this._typicalRowIsInDataProvider)\n\t\t\t{\n\t\t\t\t//we need to know if this item renderer resizes to adjust the\n\t\t\t\t//layout because the layout may use this item renderer to resize\n\t\t\t\t//the other item renderers\n\t\t\t\tthis._typicalRowRenderer.addEventListener(FeathersEventType.RESIZE, rowRenderer_resizeHandler);\n\t\t\t}\n\t\t}\n\n\t\tprivate function refreshRowRenderers():void\n\t\t{\n\t\t\tif(this._typicalRowRenderer !== null && this._typicalRowIsInDataProvider)\n\t\t\t{\n\t\t\t\tvar inactiveRowRenderers:Vector.<DataGridRowRenderer> = this._rowStorage.inactiveRowRenderers;\n\t\t\t\tvar activeRowRenderers:Vector.<DataGridRowRenderer> = this._rowStorage.activeRowRenderers;\n\t\t\t\t//this renderer is already is use by the typical item, so we\n\t\t\t\t//don't want to allow it to be used by other items.\n\t\t\t\tvar inactiveIndex:int = inactiveRowRenderers.indexOf(this._typicalRowRenderer);\n\t\t\t\tif(inactiveIndex >= 0)\n\t\t\t\t{\n\t\t\t\t\tinactiveRowRenderers[inactiveIndex] = null;\n\t\t\t\t}\n\t\t\t\t//if refreshLayoutTypicalItem() was called, it will have already\n\t\t\t\t//added the typical row renderer to the active renderers. if\n\t\t\t\t//not, we need to do it here.\n\t\t\t\tvar activeRendererCount:int = activeRowRenderers.length;\n\t\t\t\tif(activeRendererCount == 0)\n\t\t\t\t{\n\t\t\t\t\tactiveRowRenderers[activeRendererCount] = this._typicalRowRenderer;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.findUnrenderedRowData();\n\t\t\tthis.recoverInactiveRowRenderers();\n\t\t\tthis.renderUnrenderedRowData();\n\t\t\tthis.freeInactiveRowRenderers(this._minimumRowCount);\n\t\t}\n\n\t\tprivate function findUnrenderedRowData():void\n\t\t{\n\t\t\tvar itemCount:int = 0;\n\t\t\tif(this._dataProvider !== null)\n\t\t\t{\n\t\t\t\titemCount = this._dataProvider.length;\n\t\t\t}\n\t\t\tvar virtualLayout:IVirtualLayout = this._layout as IVirtualLayout;\n\t\t\tvar useVirtualLayout:Boolean = virtualLayout && virtualLayout.useVirtualLayout;\n\t\t\tif(useVirtualLayout)\n\t\t\t{\n\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\tvirtualLayout.measureViewPort(itemCount, this._viewPortBounds, point);\n\t\t\t\tvirtualLayout.getVisibleIndicesAtScrollPosition(this._horizontalScrollPosition, this._verticalScrollPosition, point.x, point.y, itemCount, HELPER_VECTOR);\n\t\t\t\tPool.putPoint(point);\n\t\t\t}\n\n\t\t\tthis._rows.length = itemCount;\n\n\t\t\tvar unrenderedItemCount:int = itemCount;\n\t\t\tif(useVirtualLayout)\n\t\t\t{\n\t\t\t\tunrenderedItemCount = HELPER_VECTOR.length;\n\t\t\t}\n\t\t\tif(useVirtualLayout && this._typicalRowIsInDataProvider && this._typicalRowRenderer &&\n\t\t\t\tHELPER_VECTOR.indexOf(this._typicalRowRenderer.index) >= 0)\n\t\t\t{\n\t\t\t\t//add an extra item renderer if the typical item is from the\n\t\t\t\t//data provider and it is visible. this helps keep the number of\n\t\t\t\t//item renderers constant!\n\t\t\t\tthis._minimumRowCount = unrenderedItemCount + 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._minimumRowCount = unrenderedItemCount;\n\t\t\t}\n\n\t\t\tvar unrenderedDataLastIndex:int = this._unrenderedRows.length;\n\t\t\tfor(var i:int = 0; i < unrenderedItemCount; i++)\n\t\t\t{\n\t\t\t\tvar index:int = i;\n\t\t\t\tif(useVirtualLayout)\n\t\t\t\t{\n\t\t\t\t\tindex = HELPER_VECTOR[i];\n\t\t\t\t}\n\t\t\t\tif(index < 0 || index >= itemCount)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tvar item:Object = this._dataProvider.getItemAt(index);\n\t\t\t\tvar rowRenderer:DataGridRowRenderer = this._rowRendererMap[item] as DataGridRowRenderer;\n\t\t\t\tif(rowRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\t//the index may have changed if items were added, removed or\n\t\t\t\t\t//reordered in the data provider\n\t\t\t\t\trowRenderer.index = index;\n\t\t\t\t\t//if this row renderer used to be the typical row\n\t\t\t\t\t//renderer, but it isn't anymore, it may have been set invisible!\n\t\t\t\t\trowRenderer.visible = true;\n\t\t\t\t\trowRenderer.customColumnSizes = this._customColumnSizes;\n\t\t\t\t\tif(this._updateForDataReset)\n\t\t\t\t\t{\n\t\t\t\t\t\t//similar to calling updateItemAt(), replacing the data\n\t\t\t\t\t\t//provider or resetting its source means that we should\n\t\t\t\t\t\t//trick the item renderer into thinking it has new data.\n\t\t\t\t\t\t//many developers seem to expect this behavior, so while\n\t\t\t\t\t\t//it's not the most optimal for performance, it saves on\n\t\t\t\t\t\t//support time in the forums. thankfully, it's still\n\t\t\t\t\t\t//somewhat optimized since the same item renderer will\n\t\t\t\t\t\t//receive the same data, and the children generally\n\t\t\t\t\t\t//won't have changed much, if at all.\n\t\t\t\t\t\trowRenderer.data = null;\n\t\t\t\t\t\trowRenderer.data = item;\n\t\t\t\t\t}\n\n\t\t\t\t\t//the typical row renderer is a special case, and we will\n\t\t\t\t\t//have already put it into the active renderers, so we don't\n\t\t\t\t\t//want to do it again!\n\t\t\t\t\tif(this._typicalRowRenderer !== rowRenderer)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar activeRowRenderers:Vector.<DataGridRowRenderer> = this._rowStorage.activeRowRenderers;\n\t\t\t\t\t\tvar inactiveRowRenderers:Vector.<DataGridRowRenderer> = this._rowStorage.inactiveRowRenderers;\n\t\t\t\t\t\tactiveRowRenderers[activeRowRenderers.length] = rowRenderer;\n\t\t\t\t\t\tvar inactiveIndex:int = inactiveRowRenderers.indexOf(rowRenderer);\n\t\t\t\t\t\tif(inactiveIndex >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinactiveRowRenderers[inactiveIndex] = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthrow new IllegalOperationError(\"DataGridDataViewPort: row renderer map contains bad data. This may be caused by duplicate items in the data provider, which is not allowed.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis._rows[index] = DisplayObject(rowRenderer);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._unrenderedRows[unrenderedDataLastIndex] = index;\n\t\t\t\t\tunrenderedDataLastIndex++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//update the typical row renderer's visibility\n\t\t\tif(this._typicalRowRenderer !== null)\n\t\t\t{\n\t\t\t\tif(useVirtualLayout && this._typicalRowIsInDataProvider)\n\t\t\t\t{\n\t\t\t\t\tindex = HELPER_VECTOR.indexOf(this._typicalRowRenderer.index);\n\t\t\t\t\tif(index >= 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._typicalRowRenderer.visible = true;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._typicalRowRenderer.visible = false;\n\n\t\t\t\t\t\t//uncomment these lines to see a hidden typical row for\n\t\t\t\t\t\t//debugging purposes...\n\t\t\t\t\t\t/*this._typicalRowRenderer.visible = true;\n\t\t\t\t\t\tthis._typicalRowRenderer.x = this._horizontalScrollPosition;\n\t\t\t\t\t\tthis._typicalRowRenderer.y = this._verticalScrollPosition;*/\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._typicalRowRenderer.visible = this._typicalRowIsInDataProvider;\n\t\t\t\t}\n\t\t\t}\n\t\t\tHELPER_VECTOR.length = 0;\n\t\t}\n\n\t\tprivate function renderUnrenderedRowData():void\n\t\t{\n\t\t\tvar rowRendererCount:int = this._unrenderedRows.length;\n\t\t\tfor(var i:int = 0; i < rowRendererCount; i++)\n\t\t\t{\n\t\t\t\tvar rowIndex:int = this._unrenderedRows.shift();\n\t\t\t\tvar item:Object = this._dataProvider.getItemAt(rowIndex);\n\t\t\t\tvar rowRenderer:DataGridRowRenderer = this.createRowRenderer(\n\t\t\t\t\titem, rowIndex, true, false);\n\t\t\t\trowRenderer.visible = true;\n\t\t\t\tthis._rows[rowIndex] = DisplayObject(rowRenderer);\n\t\t\t}\n\t\t}\n\n\t\tprivate function refreshSelection():void\n\t\t{\n\t\t\tvar itemCount:int = this._rows.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar rowRenderer:DataGridRowRenderer = this._rows[i] as DataGridRowRenderer;\n\t\t\t\tif(rowRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\trowRenderer.isSelected = this._selectedIndices.getItemIndex(rowRenderer.index) >= 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function refreshEnabled():void\n\t\t{\n\t\t\tvar itemCount:int = this._rows.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar control:IFeathersControl = this._rows[i] as IFeathersControl;\n\t\t\t\tif(control !== null)\n\t\t\t\t{\n\t\t\t\t\tcontrol.isEnabled = this._isEnabled;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function validateRowRenderers():void\n\t\t{\n\t\t\tvar itemCount:int = this._rows.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:IValidating = this._rows[i] as IValidating;\n\t\t\t\tif(item !== null)\n\t\t\t\t{\n\t\t\t\t\titem.validate();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function invalidateParent(flag:String = INVALIDATION_FLAG_ALL):void\n\t\t{\n\t\t\tScroller(this.parent).invalidate(flag);\n\t\t}\n\n\t\tprivate function columns_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\tprivate function dataProvider_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\tprivate function dataProvider_addItemHandler(event:Event, index:int):void\n\t\t{\n\t\t\tvar layout:IVariableVirtualLayout = this._layout as IVariableVirtualLayout;\n\t\t\tif(!layout || !layout.hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlayout.addToVariableVirtualCacheAtIndex(index);\n\t\t}\n\n\t\tprivate function dataProvider_removeItemHandler(event:Event, index:int):void\n\t\t{\n\t\t\tvar layout:IVariableVirtualLayout = this._layout as IVariableVirtualLayout;\n\t\t\tif(!layout || !layout.hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlayout.removeFromVariableVirtualCacheAtIndex(index);\n\t\t}\n\n\t\tprivate function dataProvider_replaceItemHandler(event:Event, index:int):void\n\t\t{\n\t\t\tvar layout:IVariableVirtualLayout = this._layout as IVariableVirtualLayout;\n\t\t\tif(!layout || !layout.hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlayout.resetVariableVirtualCacheAtIndex(index);\n\t\t}\n\n\t\tprivate function dataProvider_resetHandler(event:Event):void\n\t\t{\n\t\t\tthis._updateForDataReset = true;\n\n\t\t\tvar layout:IVariableVirtualLayout = this._layout as IVariableVirtualLayout;\n\t\t\tif(!layout || !layout.hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlayout.resetVariableVirtualCache();\n\t\t}\n\n\t\tprivate function dataProvider_filterChangeHandler(event:Event):void\n\t\t{\n\t\t\tvar layout:IVariableVirtualLayout = this._layout as IVariableVirtualLayout;\n\t\t\tif(!layout || !layout.hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//we don't know exactly which indices have changed, so reset the\n\t\t\t//whole cache.\n\t\t\tlayout.resetVariableVirtualCache();\n\t\t}\n\n\t\tprivate function dataProvider_updateItemHandler(event:Event, index:int):void\n\t\t{\n\t\t\tvar item:Object = this._dataProvider.getItemAt(index);\n\t\t\tvar rowRenderer:DataGridRowRenderer = this._rowRendererMap[item] as DataGridRowRenderer;\n\t\t\tif(rowRenderer === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//in order to display the same item with modified properties, this\n\t\t\t//hack tricks the item renderer into thinking that it has been given\n\t\t\t//a different item to render.\n\t\t\trowRenderer.data = null;\n\t\t\trowRenderer.data = item;\n\t\t\tif(this._explicitVisibleWidth !== this._explicitVisibleWidth || //isNaN\n\t\t\t\tthis._explicitVisibleHeight !== this._explicitVisibleHeight) //isNaN\n\t\t\t{\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\tthis.invalidateParent(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\tprivate function dataProvider_updateAllHandler(event:Event):void\n\t\t{\n\t\t\t//we're treating this similar to the RESET event because enough\n\t\t\t//users are treating UPDATE_ALL similarly. technically, UPDATE_ALL\n\t\t\t//is supposed to affect only existing items, but it's confusing when\n\t\t\t//new items are added and not displayed.\n\t\t\tthis._updateForDataReset = true;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\n\t\t\tvar layout:IVariableVirtualLayout = this._layout as IVariableVirtualLayout;\n\t\t\tif(!layout || !layout.hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlayout.resetVariableVirtualCache();\n\t\t}\n\n\t\tprivate function rowRenderer_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tvar rowRenderer:DataGridRowRenderer = DataGridRowRenderer(event.currentTarget);\n\t\t\tthis.parent.dispatchEventWith(Event.TRIGGERED, false, rowRenderer.data);\n\t\t}\n\n\t\tprivate function rowRenderer_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreSelectionChanges)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar rowRenderer:DataGridRowRenderer = DataGridRowRenderer(event.currentTarget);\n\t\t\tif(!this._isSelectable || this._owner.isScrolling)\n\t\t\t{\n\t\t\t\trowRenderer.isSelected = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar isSelected:Boolean = rowRenderer.isSelected;\n\t\t\tvar index:int = rowRenderer.index;\n\t\t\tif(this._allowMultipleSelection)\n\t\t\t{\n\t\t\t\tvar indexOfIndex:int = this._selectedIndices.getItemIndex(index);\n\t\t\t\tif(isSelected && indexOfIndex < 0)\n\t\t\t\t{\n\t\t\t\t\tthis._selectedIndices.addItem(index);\n\t\t\t\t}\n\t\t\t\telse if(!isSelected && indexOfIndex >= 0)\n\t\t\t\t{\n\t\t\t\t\tthis._selectedIndices.removeItemAt(indexOfIndex);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(isSelected)\n\t\t\t{\n\t\t\t\tthis._selectedIndices.data = new <int>[index];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._selectedIndices.removeAll();\n\t\t\t}\n\t\t}\n\n\t\tprivate function rowRenderer_resizeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreRendererResizing)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t\tthis.invalidateParent(INVALIDATION_FLAG_LAYOUT);\n\t\t\tif(event.currentTarget === this._typicalRowRenderer && !this._typicalRowIsInDataProvider)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar layout:IVariableVirtualLayout = this._layout as IVariableVirtualLayout;\n\t\t\tif(!layout || !layout.hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar rowRenderer:DataGridRowRenderer = DataGridRowRenderer(event.currentTarget);\n\t\t\tlayout.resetVariableVirtualCacheAtIndex(rowRenderer.index, DisplayObject(rowRenderer));\n\t\t}\n\n\t\tprivate function layout_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreLayoutChanges)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t\tthis.invalidateParent(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\tprivate function selectedIndices_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\t}\n}\n\nimport feathers.controls.supportClasses.DataGridRowRenderer;\n\nclass RowRendererFactoryStorage\n{\n\tpublic function RowRendererFactoryStorage()\n\t{\n\n\t}\n\n\tpublic var activeRowRenderers:Vector.<DataGridRowRenderer> = new <DataGridRowRenderer>[];\n\tpublic var inactiveRowRenderers:Vector.<DataGridRowRenderer> = new <DataGridRowRenderer>[];\n}"
  },
  {
    "path": "source/feathers/controls/supportClasses/DataGridRowRenderer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.supportClasses\n{\n\timport feathers.controls.DataGrid;\n\timport feathers.controls.DataGridColumn;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.renderers.DefaultDataGridCellRenderer;\n\timport feathers.controls.renderers.IDataGridCellRenderer;\n\timport feathers.core.IToggle;\n\timport feathers.data.IListCollection;\n\timport feathers.events.CollectionEventType;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.HorizontalLayout;\n\timport feathers.layout.HorizontalLayoutData;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.utils.touch.TapToSelect;\n\timport feathers.utils.touch.TapToTrigger;\n\n\timport flash.errors.IllegalOperationError;\n\timport flash.utils.Dictionary;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t/**\n\t * @private\n\t * Used internally by DataGrid. Not meant to be used on its own.\n\t *\n\t * @see feathers.controls.DataGrid\n\t *\n\t * @productversion Feathers 3.4.0\n\t */\n\tpublic class DataGridRowRenderer extends LayoutGroup implements IToggle\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultCellRendererFactory():IDataGridCellRenderer\n\t\t{\n\t\t\treturn new DefaultDataGridCellRenderer();\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function DataGridRowRenderer()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _tapToTrigger:TapToTrigger = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _tapToSelect:TapToSelect = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _unrenderedData:Vector.<int> = new <int>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _cellRendererMap:Dictionary = new Dictionary(true);\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _defaultStorage:CellRendererFactoryStorage = new CellRendererFactoryStorage();\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _additionalStorage:Vector.<CellRendererFactoryStorage> = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _index:int = -1;\n\n\t\t/**\n\t\t * The index (numeric position, starting from zero) of the item within\n\t\t * the data grid's dat provider.\n\t\t *\n\t\t * <p>This property is set by the data grid, and should not be set manually.</p>\n\t\t */\n\t\tpublic function get index():int\n\t\t{\n\t\t\treturn this._index;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set index(value:int):void\n\t\t{\n\t\t\tif(this._index == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._index = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _owner:DataGrid = null;\n\n\t\t/**\n\t\t * The <code>DataGrid</code> component that owns this row renderer.\n\t\t *\n\t\t * <p>This property is set by the data grid, and should not be set manually.</p>\n\t\t */\n\t\tpublic function get owner():DataGrid\n\t\t{\n\t\t\treturn this._owner;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set owner(value:DataGrid):void\n\t\t{\n\t\t\tif(this._owner === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._owner = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _data:Object = null;\n\n\t\t/**\n\t\t * The item from the data provider that is rendered by this row.\n\t\t *\n\t\t * <p>This property is set by the data grid, and should not be set manually.</p>\n\t\t */\n\t\tpublic function get data():Object\n\t\t{\n\t\t\treturn this._data;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set data(value:Object):void\n\t\t{\n\t\t\tif(this._data === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._data = value;\n\t\t\tif(value === null)\n\t\t\t{\n\t\t\t\t//ensure that the data property of each cell renderer\n\t\t\t\t//is set to null before being set to any new value\n\t\t\t\tthis._updateForDataReset = true;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _updateForDataReset:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _columns:IListCollection = null;\n\n\t\t/**\n\t\t * The columns from the data grid.\n\t\t *\n\t\t * <p>This property is set by the data grid, and should not be set manually.</p>\n\t\t */\n\t\tpublic function get columns():IListCollection\n\t\t{\n\t\t\treturn this._columns;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set columns(value:IListCollection):void\n\t\t{\n\t\t\tif(this._columns === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._columns !== null)\n\t\t\t{\n\t\t\t\tthis._columns.removeEventListener(Event.CHANGE, columns_changeHandler);\n\t\t\t\tthis._columns.removeEventListener(CollectionEventType.RESET, columns_resetHandler);\n\t\t\t\tthis._columns.removeEventListener(CollectionEventType.UPDATE_ALL, columns_updateAllHandler);\n\t\t\t}\n\t\t\tthis._columns = value;\n\t\t\tif(this._columns !== null)\n\t\t\t{\n\t\t\t\tthis._columns.addEventListener(Event.CHANGE, columns_changeHandler);\n\t\t\t\tthis._columns.addEventListener(CollectionEventType.RESET, columns_resetHandler);\n\t\t\t\tthis._columns.addEventListener(CollectionEventType.UPDATE_ALL, columns_updateAllHandler);\n\t\t\t}\n\t\t\tthis._updateForDataReset = true;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isSelected:Boolean;\n\n\t\t/**\n\t\t * Indicates if the row is selected or not.\n\t\t *\n\t\t * <p>This property is set by the data grid, and should not be set manually.</p>\n\t\t */\n\t\tpublic function get isSelected():Boolean\n\t\t{\n\t\t\treturn this._isSelected;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isSelected(value:Boolean):void\n\t\t{\n\t\t\tif(this._isSelected === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isSelected = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _customColumnSizes:Vector.<Number> = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get customColumnSizes():Vector.<Number>\n\t\t{\n\t\t\treturn this._customColumnSizes;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customColumnSizes(value:Vector.<Number>):void\n\t\t{\n\t\t\tif(this._customColumnSizes === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customColumnSizes = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\t/**\n\t\t * Returns the cell renderer for the specified column index, or\n\t\t * <code>null</code>, if no cell renderer can be found.\n\t\t */\n\t\tpublic function getCellRendererForColumn(columnIndex:int):IDataGridCellRenderer\n\t\t{\n\t\t\tvar column:DataGridColumn = DataGridColumn(this._columns.getItemAt(columnIndex));\n\t\t\tvar storage:CellRendererFactoryStorage = this.factoryToStorage(column.cellRendererFactory);\n\t\t\tvar activeCellRenderers:Vector.<IDataGridCellRenderer> = storage.activeCellRenderers;\n\t\t\tif(columnIndex < 0 || columnIndex > activeCellRenderers.length)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn IDataGridCellRenderer(activeCellRenderers[columnIndex]);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tthis.refreshInactiveCellRenderers(this._defaultStorage, true);\n\t\t\tif(this._additionalStorage !== null)\n\t\t\t{\n\t\t\t\tvar storageCount:int = this._additionalStorage.length;\n\t\t\t\tfor(var i:int = 0; i < storageCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar storage:CellRendererFactoryStorage = this._additionalStorage[i];\n\t\t\t\t\tthis.refreshInactiveCellRenderers(storage, true);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.owner = null;\n\t\t\tthis.data = null;\n\t\t\tthis.columns = null;\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tsuper.initialize();\n\n\t\t\tif(this._layout === null)\n\t\t\t{\n\t\t\t\tvar layout:HorizontalLayout = new HorizontalLayout();\n\t\t\t\tlayout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\t\tlayout.useVirtualLayout = false;\n\t\t\t\tthis._layout = layout;\n\t\t\t}\n\n\t\t\tif(this._tapToTrigger === null)\n\t\t\t{\n\t\t\t\tthis._tapToTrigger = new TapToTrigger(this);\n\t\t\t}\n\n\t\t\tif(this._tapToSelect === null)\n\t\t\t{\n\t\t\t\tthis._tapToSelect = new TapToSelect(this);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar oldIgnoreChildChanges:Boolean = this._ignoreChildChanges;\n\t\t\tthis._ignoreChildChanges = true;\n\t\t\tthis.preLayout();\n\t\t\tthis._ignoreChildChanges = oldIgnoreChildChanges;\n\n\t\t\tthis.refreshSelectionEvents();\n\n\t\t\tsuper.draw();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function preLayout():void\n\t\t{\n\t\t\tthis.refreshInactiveCellRenderers(this._defaultStorage, false);\n\t\t\tif(this._additionalStorage !== null)\n\t\t\t{\n\t\t\t\tvar storageCount:int = this._additionalStorage.length;\n\t\t\t\tfor(var i:int = 0; i < storageCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar storage:CellRendererFactoryStorage = this._additionalStorage[i];\n\t\t\t\t\tthis.refreshInactiveCellRenderers(storage, false);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.findUnrenderedData();\n\t\t\tthis.recoverInactiveCellRenderers(this._defaultStorage);\n\t\t\tif(this._additionalStorage !== null)\n\t\t\t{\n\t\t\t\tstorageCount = this._additionalStorage.length;\n\t\t\t\tfor(i = 0; i < storageCount; i++)\n\t\t\t\t{\n\t\t\t\t\tstorage = this._additionalStorage[i];\n\t\t\t\t\tthis.recoverInactiveCellRenderers(storage);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.renderUnrenderedData();\n\t\t\tthis.freeInactiveCellRenderers(this._defaultStorage);\n\t\t\tif(this._additionalStorage !== null)\n\t\t\t{\n\t\t\t\tstorageCount = this._additionalStorage.length;\n\t\t\t\tfor(i = 0; i < storageCount; i++)\n\t\t\t\t{\n\t\t\t\t\tstorage = this._additionalStorage[i];\n\t\t\t\t\tthis.freeInactiveCellRenderers(storage);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tthis._updateForDataReset = false;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshSelectionEvents():void\n\t\t{\n\t\t\tthis._tapToSelect.isEnabled = this._isEnabled;\n\t\t\tthis._tapToSelect.tapToDeselect = this._owner.allowMultipleSelection;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createCellRenderer(columnIndex:int, column:DataGridColumn):IDataGridCellRenderer\n\t\t{\n\t\t\tvar cellRenderer:IDataGridCellRenderer = null;\n\t\t\tvar storage:CellRendererFactoryStorage = this.factoryToStorage(column.cellRendererFactory);\n\t\t\tvar activeCellRenderers:Vector.<IDataGridCellRenderer> = storage.activeCellRenderers;\n\t\t\tvar inactiveCellRenderers:Vector.<IDataGridCellRenderer> = storage.inactiveCellRenderers;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tif(inactiveCellRenderers.length == 0)\n\t\t\t\t{\n\t\t\t\t\tvar cellRendererFactory:Function = column.cellRendererFactory;\n\t\t\t\t\tif(cellRendererFactory === null)\n\t\t\t\t\t{\n\t\t\t\t\t\tcellRendererFactory = this._owner.cellRendererFactory;\n\t\t\t\t\t}\n\t\t\t\t\tif(cellRendererFactory === null)\n\t\t\t\t\t{\n\t\t\t\t\t\tcellRendererFactory = defaultCellRendererFactory;\n\t\t\t\t\t}\n\t\t\t\t\tcellRenderer = IDataGridCellRenderer(cellRendererFactory());\n\t\t\t\t\tvar customCellRendererStyleName:String = column.customCellRendererStyleName;\n\t\t\t\t\tif(customCellRendererStyleName === null)\n\t\t\t\t\t{\n\t\t\t\t\t\tcustomCellRendererStyleName = this._owner.customCellRendererStyleName;\n\t\t\t\t\t}\n\t\t\t\t\tif(customCellRendererStyleName !== null && customCellRendererStyleName.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tcellRenderer.styleNameList.add(customCellRendererStyleName);\n\t\t\t\t\t}\n\t\t\t\t\tthis.addChildAt(DisplayObject(cellRenderer), columnIndex);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcellRenderer = inactiveCellRenderers.shift();\n\t\t\t\t}\n\t\t\t\t//wondering why this all is in a loop?\n\t\t\t\t//_inactiveRenderers.shift() may return null because we're\n\t\t\t\t//storing null values instead of calling splice() to improve\n\t\t\t\t//performance.\n\t\t\t}\n\t\t\twhile(cellRenderer === null);\n\t\t\tthis.refreshCellRendererProperties(cellRenderer, columnIndex, column);\n\n\t\t\tcolumn.addEventListener(Event.CHANGE, column_changeHandler);\n\n\t\t\tthis._cellRendererMap[column] = cellRenderer;\n\t\t\tactiveCellRenderers[activeCellRenderers.length] = cellRenderer;\n\t\t\tthis._owner.dispatchEventWith(FeathersEventType.RENDERER_ADD, false, cellRenderer);\n\n\t\t\treturn cellRenderer;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function destroyCellRenderer(cellRenderer:IDataGridCellRenderer):void\n\t\t{\n\t\t\tif(cellRenderer.column !== null)\n\t\t\t{\n\t\t\t\tcellRenderer.column.removeEventListener(Event.CHANGE, column_changeHandler);\n\t\t\t}\n\t\t\tcellRenderer.data = null;\n\t\t\tcellRenderer.owner = null;\n\t\t\tcellRenderer.rowIndex = -1;\n\t\t\tcellRenderer.columnIndex = -1;\n\t\t\tthis.removeChild(DisplayObject(cellRenderer), true);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function factoryToStorage(factory:Function):CellRendererFactoryStorage\n\t\t{\n\t\t\tif(factory !== null)\n\t\t\t{\n\t\t\t\tif(this._additionalStorage === null)\n\t\t\t\t{\n\t\t\t\t\tthis._additionalStorage = new <CellRendererFactoryStorage>[];\n\t\t\t\t}\n\t\t\t\tvar storageCount:int = this._additionalStorage.length;\n\t\t\t\tfor(var i:int = 0; i < storageCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar storage:CellRendererFactoryStorage = this._additionalStorage[i];\n\t\t\t\t\tif(storage.factory === factory)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn storage;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstorage = new CellRendererFactoryStorage(factory);\n\t\t\t\tthis._additionalStorage[this._additionalStorage.length] = storage;\n\t\t\t\treturn storage;\n\t\t\t}\n\t\t\treturn this._defaultStorage;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshInactiveCellRenderers(storage:CellRendererFactoryStorage, forceCleanup:Boolean):void\n\t\t{\n\t\t\tvar temp:Vector.<IDataGridCellRenderer> = storage.inactiveCellRenderers;\n\t\t\tstorage.inactiveCellRenderers = storage.activeCellRenderers;\n\t\t\tstorage.activeCellRenderers = temp;\n\t\t\tif(storage.activeCellRenderers.length > 0)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"DataGridRowRenderer: active cell renderers should be empty.\");\n\t\t\t}\n\t\t\tif(forceCleanup)\n\t\t\t{\n\t\t\t\tthis.recoverInactiveCellRenderers(storage);\n\t\t\t\tthis.freeInactiveCellRenderers(storage);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function findUnrenderedData():void\n\t\t{\n\t\t\tvar columns:IListCollection = this._owner.columns;\n\t\t\tvar columnCount:int = columns.length;\n\t\t\tvar unrenderedDataLastIndex:int = this._unrenderedData.length;\n\t\t\tfor(var i:int = 0; i < columnCount; i++)\n\t\t\t{\n\t\t\t\tif(i < 0 || i >= columnCount)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tvar column:DataGridColumn = DataGridColumn(columns.getItemAt(i));\n\t\t\t\tvar cellRenderer:IDataGridCellRenderer = this._cellRendererMap[column] as IDataGridCellRenderer;\n\t\t\t\tif(cellRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\t//the properties may have changed if items were added, removed or\n\t\t\t\t\t//reordered in the data provider\n\t\t\t\t\tthis.refreshCellRendererProperties(cellRenderer, i, column);\n\n\t\t\t\t\tvar storage:CellRendererFactoryStorage = this.factoryToStorage(column.cellRendererFactory);\n\t\t\t\t\tvar activeCellRenderers:Vector.<IDataGridCellRenderer> = storage.activeCellRenderers;\n\t\t\t\t\tvar inactiveCellRenderers:Vector.<IDataGridCellRenderer> = storage.inactiveCellRenderers;\n\n\t\t\t\t\tactiveCellRenderers[activeCellRenderers.length] = cellRenderer;\n\t\t\t\t\tvar inactiveIndex:int = inactiveCellRenderers.indexOf(cellRenderer);\n\t\t\t\t\tif(inactiveIndex >= 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tinactiveCellRenderers[inactiveIndex] = null;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new IllegalOperationError(\"DataGridRowRenderer: cell renderer map contains bad data. This may be caused by duplicate items in the data provider, which is not allowed.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._unrenderedData[unrenderedDataLastIndex] = i;\n\t\t\t\t\tunrenderedDataLastIndex++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function recoverInactiveCellRenderers(storage:CellRendererFactoryStorage):void\n\t\t{\n\t\t\tvar inactiveCellRenderers:Vector.<IDataGridCellRenderer> = storage.inactiveCellRenderers;\n\t\t\tvar itemCount:int = inactiveCellRenderers.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar cellRenderer:IDataGridCellRenderer = inactiveCellRenderers[i];\n\t\t\t\tif(cellRenderer === null || cellRenderer.column === null)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tthis._owner.dispatchEventWith(FeathersEventType.RENDERER_REMOVE, false, cellRenderer);\n\t\t\t\tdelete this._cellRendererMap[cellRenderer.column];\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function renderUnrenderedData():void\n\t\t{\n\t\t\tvar columns:IListCollection = this._owner.columns;\n\t\t\tvar cellRendererCount:int = this._unrenderedData.length;\n\t\t\tfor(var i:int = 0; i < cellRendererCount; i++)\n\t\t\t{\n\t\t\t\tvar columnIndex:int = this._unrenderedData.shift();\n\t\t\t\tvar column:DataGridColumn = DataGridColumn(columns.getItemAt(i));\n\t\t\t\tvar cellRenderer:IDataGridCellRenderer = this.createCellRenderer(columnIndex, column);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function freeInactiveCellRenderers(storage:CellRendererFactoryStorage):void\n\t\t{\n\t\t\tvar activeCellRenderers:Vector.<IDataGridCellRenderer> = storage.activeCellRenderers;\n\t\t\tvar inactiveCellRenderers:Vector.<IDataGridCellRenderer> = storage.inactiveCellRenderers;\n\t\t\tvar activeCellRenderersCount:int = activeCellRenderers.length;\n\t\t\tvar itemCount:int = inactiveCellRenderers.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar cellRenderer:IDataGridCellRenderer = inactiveCellRenderers.shift();\n\t\t\t\tif(cellRenderer === null)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tthis.destroyCellRenderer(cellRenderer);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshCellRendererProperties(cellRenderer:IDataGridCellRenderer, columnIndex:int, column:DataGridColumn):void\n\t\t{\n\t\t\tif(this._updateForDataReset)\n\t\t\t{\n\t\t\t\t//similar to calling updateItemAt(), replacing the data\n\t\t\t\t//provider or resetting its source means that we should\n\t\t\t\t//trick the item renderer into thinking it has new data.\n\t\t\t\t//many developers seem to expect this behavior, so while\n\t\t\t\t//it's not the most optimal for performance, it saves on\n\t\t\t\t//support time in the forums. thankfully, it's still\n\t\t\t\t//somewhat optimized since the same item renderer will\n\t\t\t\t//receive the same data, and the children generally\n\t\t\t\t//won't have changed much, if at all.\n\t\t\t\tcellRenderer.data = null;\n\t\t\t\tcellRenderer.column = null;\n\t\t\t}\n\t\t\tcellRenderer.owner = this._owner;\n\t\t\tcellRenderer.data = this._data;\n\t\t\tcellRenderer.rowIndex = this._index;\n\t\t\tcellRenderer.column = column;\n\t\t\tcellRenderer.columnIndex = columnIndex;\n\t\t\tcellRenderer.isSelected = this._isSelected;\n\t\t\tcellRenderer.dataField = column.dataField;\n\t\t\tcellRenderer.minWidth = column.minWidth;\n\t\t\tif(column.width === column.width) //!isNaN\n\t\t\t{\n\t\t\t\tcellRenderer.width = column.width;\n\t\t\t\tcellRenderer.layoutData = null;\n\t\t\t}\n\t\t\telse if(this._customColumnSizes !== null && columnIndex < this._customColumnSizes.length)\n\t\t\t{\n\t\t\t\tcellRenderer.width = this._customColumnSizes[columnIndex];\n\t\t\t\tcellRenderer.layoutData = null;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar layoutData:HorizontalLayoutData = cellRenderer.layoutData as HorizontalLayoutData;\n\t\t\t\tif(layoutData === null)\n\t\t\t\t{\n\t\t\t\t\tcellRenderer.layoutData = new HorizontalLayoutData(100, NaN);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tlayoutData.percentWidth = 100;\n\t\t\t\t\tlayoutData.percentHeight = NaN;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.setChildIndex(DisplayObject(cellRenderer), columnIndex);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function columns_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function columns_resetHandler(event:Event):void\n\t\t{\n\t\t\tthis._updateForDataReset = true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function columns_updateAllHandler(event:Event):void\n\t\t{\n\t\t\t//we're treating this similar to the RESET event because enough\n\t\t\t//users are treating UPDATE_ALL similarly. technically, UPDATE_ALL\n\t\t\t//is supposed to affect only existing items, but it's confusing when\n\t\t\t//new items are added and not displayed.\n\t\t\tthis._updateForDataReset = true;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function column_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\t//since we extend LayoutGroup, and the DataGridColumn includes some\n\t\t\t//layout information, we need to use this flag too\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\t}\n}\n\nimport feathers.controls.renderers.IDataGridCellRenderer;\n\nclass CellRendererFactoryStorage\n{\n\tpublic function CellRendererFactoryStorage(factory:Function = null)\n\t{\n\t\tthis.factory = factory;\n\t}\n\n\tpublic var activeCellRenderers:Vector.<IDataGridCellRenderer> = new <IDataGridCellRenderer>[];\n\tpublic var inactiveCellRenderers:Vector.<IDataGridCellRenderer> = new <IDataGridCellRenderer>[];\n\tpublic var factory:Function;\n}\n"
  },
  {
    "path": "source/feathers/controls/supportClasses/GroupedListDataViewPort.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.supportClasses\n{\n\timport feathers.controls.GroupedList;\n\timport feathers.controls.Scroller;\n\timport feathers.controls.renderers.IGroupedListFooterRenderer;\n\timport feathers.controls.renderers.IGroupedListHeaderRenderer;\n\timport feathers.controls.renderers.IGroupedListItemRenderer;\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IValidating;\n\timport feathers.core.PropertyProxy;\n\timport feathers.data.IHierarchicalCollection;\n\timport feathers.events.CollectionEventType;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.IGroupedLayout;\n\timport feathers.layout.ILayout;\n\timport feathers.layout.IVariableVirtualLayout;\n\timport feathers.layout.IVirtualLayout;\n\timport feathers.layout.LayoutBoundsResult;\n\timport feathers.layout.ViewPortBounds;\n\n\timport flash.errors.IllegalOperationError;\n\timport flash.geom.Point;\n\timport flash.utils.Dictionary;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.utils.Pool;\n\n\t/**\n\t * @private\n\t * Used internally by GroupedList. Not meant to be used on its own.\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class GroupedListDataViewPort extends FeathersControl implements IViewPort\n\t{\n\t\tprivate static const INVALIDATION_FLAG_ITEM_RENDERER_FACTORY:String = \"itemRendererFactory\";\n\n\t\tprivate static const FIRST_ITEM_RENDERER_FACTORY_ID:String = \"GroupedListDataViewPort-first\";\n\t\tprivate static const SINGLE_ITEM_RENDERER_FACTORY_ID:String = \"GroupedListDataViewPort-single\";\n\t\tprivate static const LAST_ITEM_RENDERER_FACTORY_ID:String = \"GroupedListDataViewPort-last\";\n\n\t\tprivate static const HELPER_VECTOR:Vector.<int> = new <int>[];\n\t\tprivate static const LOCATION_HELPER_VECTOR:Vector.<int> = new <int>[];\n\n\t\tpublic function GroupedListDataViewPort()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _viewPortBounds:ViewPortBounds = new ViewPortBounds();\n\n\t\tprivate var _layoutResult:LayoutBoundsResult = new LayoutBoundsResult();\n\n\t\tprivate var _actualMinVisibleWidth:Number = 0;\n\n\t\tprivate var _explicitMinVisibleWidth:Number;\n\n\t\tpublic function get minVisibleWidth():Number\n\t\t{\n\t\t\tif(this._explicitMinVisibleWidth !== this._explicitMinVisibleWidth) //isNaN\n\t\t\t{\n\t\t\t\treturn this._actualMinVisibleWidth;\n\t\t\t}\n\t\t\treturn this._explicitMinVisibleWidth;\n\t\t}\n\n\t\tpublic function set minVisibleWidth(value:Number):void\n\t\t{\n\t\t\tif(this._explicitMinVisibleWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar valueIsNaN:Boolean = value !== value; //isNaN\n\t\t\tif(valueIsNaN &&\n\t\t\t\tthis._explicitMinVisibleWidth !== this._explicitMinVisibleWidth) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar oldValue:Number = this._explicitMinVisibleWidth;\n\t\t\tthis._explicitMinVisibleWidth = value;\n\t\t\tif(valueIsNaN)\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleWidth = 0;\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleWidth = value;\n\t\t\t\tif(this._explicitVisibleWidth !== this._explicitVisibleWidth && //isNaN\n\t\t\t\t\t(this._actualVisibleWidth < value || this._actualVisibleWidth == oldValue))\n\t\t\t\t{\n\t\t\t\t\t//only invalidate if this change might affect the visibleWidth\n\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate var _maxVisibleWidth:Number = Number.POSITIVE_INFINITY;\n\n\t\tpublic function get maxVisibleWidth():Number\n\t\t{\n\t\t\treturn this._maxVisibleWidth;\n\t\t}\n\n\t\tpublic function set maxVisibleWidth(value:Number):void\n\t\t{\n\t\t\tif(this._maxVisibleWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value) //isNaN\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"maxVisibleWidth cannot be NaN\");\n\t\t\t}\n\t\t\tvar oldValue:Number = this._maxVisibleWidth;\n\t\t\tthis._maxVisibleWidth = value;\n\t\t\tif(this._explicitVisibleWidth !== this._explicitVisibleWidth && //isNaN\n\t\t\t\t(this._actualVisibleWidth > value || this._actualVisibleWidth == oldValue))\n\t\t\t{\n\t\t\t\t//only invalidate if this change might affect the visibleWidth\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\tprivate var _actualVisibleWidth:Number = NaN;\n\n\t\tprivate var _explicitVisibleWidth:Number = NaN;\n\n\t\tpublic function get visibleWidth():Number\n\t\t{\n\t\t\treturn this._actualVisibleWidth;\n\t\t}\n\n\t\tpublic function set visibleWidth(value:Number):void\n\t\t{\n\t\t\tif(this._explicitVisibleWidth == value ||\n\t\t\t\t(value !== value && this._explicitVisibleWidth !== this._explicitVisibleWidth)) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._explicitVisibleWidth = value;\n\t\t\tif(this._actualVisibleWidth != value)\n\t\t\t{\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\tprivate var _actualMinVisibleHeight:Number = 0;\n\n\t\tprivate var _explicitMinVisibleHeight:Number;\n\n\t\tpublic function get minVisibleHeight():Number\n\t\t{\n\t\t\tif(this._explicitMinVisibleHeight !== this._explicitMinVisibleHeight) //isNaN\n\t\t\t{\n\t\t\t\treturn this._actualMinVisibleHeight;\n\t\t\t}\n\t\t\treturn this._explicitMinVisibleHeight;\n\t\t}\n\n\t\tpublic function set minVisibleHeight(value:Number):void\n\t\t{\n\t\t\tif(this._explicitMinVisibleHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar valueIsNaN:Boolean = value !== value; //isNaN\n\t\t\tif(valueIsNaN &&\n\t\t\t\tthis._explicitMinVisibleHeight !== this._explicitMinVisibleHeight) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar oldValue:Number = this._explicitMinVisibleHeight;\n\t\t\tthis._explicitMinVisibleHeight = value;\n\t\t\tif(valueIsNaN)\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleHeight = 0;\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleHeight = value;\n\t\t\t\tif(this._explicitVisibleHeight !== this._explicitVisibleHeight && //isNaN\n\t\t\t\t\t(this._actualVisibleHeight < value || this._actualVisibleHeight == oldValue))\n\t\t\t\t{\n\t\t\t\t\t//only invalidate if this change might affect the visibleHeight\n\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate var _maxVisibleHeight:Number = Number.POSITIVE_INFINITY;\n\n\t\tpublic function get maxVisibleHeight():Number\n\t\t{\n\t\t\treturn this._maxVisibleHeight;\n\t\t}\n\n\t\tpublic function set maxVisibleHeight(value:Number):void\n\t\t{\n\t\t\tif(this._maxVisibleHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value) //isNaN\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"maxVisibleHeight cannot be NaN\");\n\t\t\t}\n\t\t\tvar oldValue:Number = this._maxVisibleHeight;\n\t\t\tthis._maxVisibleHeight = value;\n\t\t\tif(this._explicitVisibleHeight !== this._explicitVisibleHeight && //isNaN\n\t\t\t\t(this._actualVisibleHeight > value || this._actualVisibleHeight == oldValue))\n\t\t\t{\n\t\t\t\t//only invalidate if this change might affect the visibleHeight\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\tprivate var _actualVisibleHeight:Number;\n\n\t\tprivate var _explicitVisibleHeight:Number = NaN;\n\n\t\tpublic function get visibleHeight():Number\n\t\t{\n\t\t\treturn this._actualVisibleHeight;\n\t\t}\n\n\t\tpublic function set visibleHeight(value:Number):void\n\t\t{\n\t\t\tif(this._explicitVisibleHeight == value ||\n\t\t\t\t(value !== value && this._explicitVisibleHeight !== this._explicitVisibleHeight)) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._explicitVisibleHeight = value;\n\t\t\tif(this._actualVisibleHeight != value)\n\t\t\t{\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\tprotected var _contentX:Number = 0;\n\n\t\tpublic function get contentX():Number\n\t\t{\n\t\t\treturn this._contentX;\n\t\t}\n\n\t\tprotected var _contentY:Number = 0;\n\n\t\tpublic function get contentY():Number\n\t\t{\n\t\t\treturn this._contentY;\n\t\t}\n\n\t\tpublic function get horizontalScrollStep():Number\n\t\t{\n\t\t\tvar itemRenderer:DisplayObject = null;\n\t\t\tvar virtualLayout:IVirtualLayout = this._layout as IVirtualLayout;\n\t\t\tif(virtualLayout === null || !virtualLayout.useVirtualLayout)\n\t\t\t{\n\t\t\t\tif(this._layoutItems.length > 0)\n\t\t\t\t{\n\t\t\t\t\titemRenderer = this._layoutItems[0] as DisplayObject;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(itemRenderer === null)\n\t\t\t{\n\t\t\t\titemRenderer = this._typicalItemRenderer as DisplayObject;\n\t\t\t}\n\t\t\tif(itemRenderer === null)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tvar itemRendererWidth:Number = itemRenderer.width;\n\t\t\tvar itemRendererHeight:Number = itemRenderer.height;\n\t\t\tif(itemRendererWidth < itemRendererHeight)\n\t\t\t{\n\t\t\t\treturn itemRendererWidth;\n\t\t\t}\n\t\t\treturn itemRendererHeight;\n\t\t}\n\n\t\tpublic function get verticalScrollStep():Number\n\t\t{\n\t\t\tvar itemRenderer:DisplayObject = null;\n\t\t\tvar virtualLayout:IVirtualLayout = this._layout as IVirtualLayout;\n\t\t\tif(virtualLayout === null || !virtualLayout.useVirtualLayout)\n\t\t\t{\n\t\t\t\tif(this._layoutItems.length > 0)\n\t\t\t\t{\n\t\t\t\t\titemRenderer = this._layoutItems[0] as DisplayObject;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(itemRenderer === null)\n\t\t\t{\n\t\t\t\titemRenderer = this._typicalItemRenderer as DisplayObject;\n\t\t\t}\n\t\t\tif(itemRenderer === null)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tvar itemRendererWidth:Number = itemRenderer.width;\n\t\t\tvar itemRendererHeight:Number = itemRenderer.height;\n\t\t\tif(itemRendererWidth < itemRendererHeight)\n\t\t\t{\n\t\t\t\treturn itemRendererWidth;\n\t\t\t}\n\t\t\treturn itemRendererHeight;\n\t\t}\n\n\t\tprivate var _layoutItems:Vector.<DisplayObject> = new <DisplayObject>[];\n\n\t\tprivate var _typicalItemIsInDataProvider:Boolean = false;\n\t\tprivate var _typicalItemRenderer:IGroupedListItemRenderer;\n\n\t\tprivate var _unrenderedItems:Vector.<int> = new <int>[];\n\t\tprivate var _defaultItemRendererStorage:ItemRendererFactoryStorage = new ItemRendererFactoryStorage();\n\t\tprivate var _itemStorageMap:Object = {};\n\t\tprivate var _itemRendererMap:Dictionary = new Dictionary(true);\n\n\t\tprivate var _unrenderedHeaders:Vector.<int> = new <int>[];\n\t\tprivate var _defaultHeaderRendererStorage:HeaderRendererFactoryStorage = new HeaderRendererFactoryStorage();\n\t\tprivate var _headerStorageMap:Object;\n\t\tprivate var _headerRendererMap:Dictionary = new Dictionary(true);\n\n\t\tprivate var _unrenderedFooters:Vector.<int> = new <int>[];\n\t\tprivate var _defaultFooterRendererStorage:FooterRendererFactoryStorage = new FooterRendererFactoryStorage();\n\t\tprivate var _footerStorageMap:Object;\n\t\tprivate var _footerRendererMap:Dictionary = new Dictionary(true);\n\n\t\tprivate var _headerIndices:Vector.<int> = new <int>[];\n\t\tprivate var _footerIndices:Vector.<int> = new <int>[];\n\n\t\tprivate var _owner:GroupedList;\n\n\t\tpublic function get owner():GroupedList\n\t\t{\n\t\t\treturn this._owner;\n\t\t}\n\n\t\tpublic function set owner(value:GroupedList):void\n\t\t{\n\t\t\tthis._owner = value;\n\t\t}\n\n\t\tprivate var _updateForDataReset:Boolean = false;\n\n\t\tprivate var _dataProvider:IHierarchicalCollection;\n\n\t\tpublic function get dataProvider():IHierarchicalCollection\n\t\t{\n\t\t\treturn this._dataProvider;\n\t\t}\n\n\t\tpublic function set dataProvider(value:IHierarchicalCollection):void\n\t\t{\n\t\t\tif(this._dataProvider == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._dataProvider)\n\t\t\t{\n\t\t\t\tthis._dataProvider.removeEventListener(Event.CHANGE, dataProvider_changeHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.RESET, dataProvider_resetHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.ADD_ITEM, dataProvider_addItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.REMOVE_ITEM, dataProvider_removeItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.REPLACE_ITEM, dataProvider_replaceItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.UPDATE_ITEM, dataProvider_updateItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.UPDATE_ALL, dataProvider_updateAllHandler);\n\t\t\t}\n\t\t\tthis._dataProvider = value;\n\t\t\tif(this._dataProvider)\n\t\t\t{\n\t\t\t\tthis._dataProvider.addEventListener(Event.CHANGE, dataProvider_changeHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.RESET, dataProvider_resetHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.ADD_ITEM, dataProvider_addItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.REMOVE_ITEM, dataProvider_removeItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.REPLACE_ITEM, dataProvider_replaceItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.UPDATE_ITEM, dataProvider_updateItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.UPDATE_ALL, dataProvider_updateAllHandler);\n\t\t\t}\n\t\t\tif(this._layout is IVariableVirtualLayout)\n\t\t\t{\n\t\t\t\tIVariableVirtualLayout(this._layout).resetVariableVirtualCache();\n\t\t\t}\n\t\t\tthis._updateForDataReset = true;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\tprivate var _isSelectable:Boolean = true;\n\n\t\tpublic function get isSelectable():Boolean\n\t\t{\n\t\t\treturn this._isSelectable;\n\t\t}\n\n\t\tpublic function set isSelectable(value:Boolean):void\n\t\t{\n\t\t\tif(this._isSelectable == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isSelectable = value;\n\t\t\tif(!this._isSelectable)\n\t\t\t{\n\t\t\t\tthis.setSelectedLocation(-1, -1);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\n\t\tprivate var _selectedGroupIndex:int = -1;\n\n\t\tpublic function get selectedGroupIndex():int\n\t\t{\n\t\t\treturn this._selectedGroupIndex;\n\t\t}\n\n\t\tprivate var _selectedItemIndex:int = -1;\n\n\t\tpublic function get selectedItemIndex():int\n\t\t{\n\t\t\treturn this._selectedItemIndex;\n\t\t}\n\n\t\tprivate var _itemRendererType:Class;\n\n\t\tpublic function get itemRendererType():Class\n\t\t{\n\t\t\treturn this._itemRendererType;\n\t\t}\n\n\t\tpublic function set itemRendererType(value:Class):void\n\t\t{\n\t\t\tif(this._itemRendererType == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._itemRendererType = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _itemRendererFactory:Function;\n\n\t\tpublic function get itemRendererFactory():Function\n\t\t{\n\t\t\treturn this._itemRendererFactory;\n\t\t}\n\n\t\tpublic function set itemRendererFactory(value:Function):void\n\t\t{\n\t\t\tif(this._itemRendererFactory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._itemRendererFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _itemRendererFactories:Object;\n\n\t\tpublic function get itemRendererFactories():Object\n\t\t{\n\t\t\treturn this._itemRendererFactories;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set itemRendererFactories(value:Object):void\n\t\t{\n\t\t\tif(this._itemRendererFactories === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._itemRendererFactories = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _factoryIDFunction:Function;\n\n\t\tpublic function get factoryIDFunction():Function\n\t\t{\n\t\t\treturn this._factoryIDFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set factoryIDFunction(value:Function):void\n\t\t{\n\t\t\tif(this._factoryIDFunction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._factoryIDFunction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _customItemRendererStyleName:String;\n\n\t\tpublic function get customItemRendererStyleName():String\n\t\t{\n\t\t\treturn this._customItemRendererStyleName;\n\t\t}\n\n\t\tpublic function set customItemRendererStyleName(value:String):void\n\t\t{\n\t\t\tif(this._customItemRendererStyleName == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customItemRendererStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _typicalItem:Object = null;\n\n\t\tpublic function get typicalItem():Object\n\t\t{\n\t\t\treturn this._typicalItem;\n\t\t}\n\n\t\tpublic function set typicalItem(value:Object):void\n\t\t{\n\t\t\tif(this._typicalItem == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._typicalItem = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\tprivate var _itemRendererProperties:PropertyProxy;\n\n\t\tpublic function get itemRendererProperties():PropertyProxy\n\t\t{\n\t\t\treturn this._itemRendererProperties;\n\t\t}\n\n\t\tpublic function set itemRendererProperties(value:PropertyProxy):void\n\t\t{\n\t\t\tif(this._itemRendererProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._itemRendererProperties)\n\t\t\t{\n\t\t\t\tthis._itemRendererProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._itemRendererProperties = PropertyProxy(value);\n\t\t\tif(this._itemRendererProperties)\n\t\t\t{\n\t\t\t\tthis._itemRendererProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\tprivate var _firstItemRendererType:Class;\n\n\t\tpublic function get firstItemRendererType():Class\n\t\t{\n\t\t\treturn this._firstItemRendererType;\n\t\t}\n\n\t\tpublic function set firstItemRendererType(value:Class):void\n\t\t{\n\t\t\tif(this._firstItemRendererType == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._firstItemRendererType = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _firstItemRendererFactory:Function;\n\n\t\tpublic function get firstItemRendererFactory():Function\n\t\t{\n\t\t\treturn this._firstItemRendererFactory;\n\t\t}\n\n\t\tpublic function set firstItemRendererFactory(value:Function):void\n\t\t{\n\t\t\tif(this._firstItemRendererFactory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._firstItemRendererFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _customFirstItemRendererStyleName:String;\n\n\t\tpublic function get customFirstItemRendererStyleName():String\n\t\t{\n\t\t\treturn this._customFirstItemRendererStyleName;\n\t\t}\n\n\t\tpublic function set customFirstItemRendererStyleName(value:String):void\n\t\t{\n\t\t\tif(this._customFirstItemRendererStyleName == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customFirstItemRendererStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _lastItemRendererType:Class;\n\n\t\tpublic function get lastItemRendererType():Class\n\t\t{\n\t\t\treturn this._lastItemRendererType;\n\t\t}\n\n\t\tpublic function set lastItemRendererType(value:Class):void\n\t\t{\n\t\t\tif(this._lastItemRendererType == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._lastItemRendererType = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _lastItemRendererFactory:Function;\n\n\t\tpublic function get lastItemRendererFactory():Function\n\t\t{\n\t\t\treturn this._lastItemRendererFactory;\n\t\t}\n\n\t\tpublic function set lastItemRendererFactory(value:Function):void\n\t\t{\n\t\t\tif(this._lastItemRendererFactory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._lastItemRendererFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _customLastItemRendererStyleName:String;\n\n\t\tpublic function get customLastItemRendererStyleName():String\n\t\t{\n\t\t\treturn this._customLastItemRendererStyleName;\n\t\t}\n\n\t\tpublic function set customLastItemRendererStyleName(value:String):void\n\t\t{\n\t\t\tif(this._customLastItemRendererStyleName == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customLastItemRendererStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _singleItemRendererType:Class;\n\n\t\tpublic function get singleItemRendererType():Class\n\t\t{\n\t\t\treturn this._singleItemRendererType;\n\t\t}\n\n\t\tpublic function set singleItemRendererType(value:Class):void\n\t\t{\n\t\t\tif(this._singleItemRendererType == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._singleItemRendererType = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _singleItemRendererFactory:Function;\n\n\t\tpublic function get singleItemRendererFactory():Function\n\t\t{\n\t\t\treturn this._singleItemRendererFactory;\n\t\t}\n\n\t\tpublic function set singleItemRendererFactory(value:Function):void\n\t\t{\n\t\t\tif(this._singleItemRendererFactory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._singleItemRendererFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _customSingleItemRendererStyleName:String;\n\n\t\tpublic function get customSingleItemRendererStyleName():String\n\t\t{\n\t\t\treturn this._customSingleItemRendererStyleName;\n\t\t}\n\n\t\tpublic function set customSingleItemRendererStyleName(value:String):void\n\t\t{\n\t\t\tif(this._customSingleItemRendererStyleName == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customSingleItemRendererStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _headerRendererType:Class;\n\n\t\tpublic function get headerRendererType():Class\n\t\t{\n\t\t\treturn this._headerRendererType;\n\t\t}\n\n\t\tpublic function set headerRendererType(value:Class):void\n\t\t{\n\t\t\tif(this._headerRendererType == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._headerRendererType = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _headerRendererFactory:Function;\n\n\t\tpublic function get headerRendererFactory():Function\n\t\t{\n\t\t\treturn this._headerRendererFactory;\n\t\t}\n\n\t\tpublic function set headerRendererFactory(value:Function):void\n\t\t{\n\t\t\tif(this._headerRendererFactory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._headerRendererFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _headerRendererFactories:Object;\n\n\t\tpublic function get headerRendererFactories():Object\n\t\t{\n\t\t\treturn this._headerRendererFactories;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set headerRendererFactories(value:Object):void\n\t\t{\n\t\t\tif(this._headerRendererFactories === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._headerRendererFactories = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tthis._headerStorageMap = {};\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _headerFactoryIDFunction:Function;\n\n\t\tpublic function get headerFactoryIDFunction():Function\n\t\t{\n\t\t\treturn this._headerFactoryIDFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set headerFactoryIDFunction(value:Function):void\n\t\t{\n\t\t\tif(this._headerFactoryIDFunction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._headerFactoryIDFunction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _customHeaderRendererStyleName:String;\n\n\t\tpublic function get customHeaderRendererStyleName():String\n\t\t{\n\t\t\treturn this._customHeaderRendererStyleName;\n\t\t}\n\n\t\tpublic function set customHeaderRendererStyleName(value:String):void\n\t\t{\n\t\t\tif(this._customHeaderRendererStyleName == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customHeaderRendererStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _headerRendererProperties:PropertyProxy;\n\n\t\tpublic function get headerRendererProperties():PropertyProxy\n\t\t{\n\t\t\treturn this._headerRendererProperties;\n\t\t}\n\n\t\tpublic function set headerRendererProperties(value:PropertyProxy):void\n\t\t{\n\t\t\tif(this._headerRendererProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._headerRendererProperties)\n\t\t\t{\n\t\t\t\tthis._headerRendererProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._headerRendererProperties = PropertyProxy(value);\n\t\t\tif(this._headerRendererProperties)\n\t\t\t{\n\t\t\t\tthis._headerRendererProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\tprivate var _footerRendererType:Class;\n\n\t\tpublic function get footerRendererType():Class\n\t\t{\n\t\t\treturn this._footerRendererType;\n\t\t}\n\n\t\tpublic function set footerRendererType(value:Class):void\n\t\t{\n\t\t\tif(this._footerRendererType == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._footerRendererType = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _footerRendererFactory:Function;\n\n\t\tpublic function get footerRendererFactory():Function\n\t\t{\n\t\t\treturn this._footerRendererFactory;\n\t\t}\n\n\t\tpublic function set footerRendererFactory(value:Function):void\n\t\t{\n\t\t\tif(this._footerRendererFactory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._footerRendererFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _footerRendererFactories:Object;\n\n\t\tpublic function get footerRendererFactories():Object\n\t\t{\n\t\t\treturn this._footerRendererFactories;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set footerRendererFactories(value:Object):void\n\t\t{\n\t\t\tif(this._footerRendererFactories === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._footerRendererFactories = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tthis._footerStorageMap = {};\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _footerFactoryIDFunction:Function;\n\n\t\tpublic function get footerFactoryIDFunction():Function\n\t\t{\n\t\t\treturn this._footerFactoryIDFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set footerFactoryIDFunction(value:Function):void\n\t\t{\n\t\t\tif(this._footerFactoryIDFunction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._footerFactoryIDFunction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _customFooterRendererStyleName:String;\n\n\t\tpublic function get customFooterRendererStyleName():String\n\t\t{\n\t\t\treturn this._customFooterRendererStyleName;\n\t\t}\n\n\t\tpublic function set customFooterRendererStyleName(value:String):void\n\t\t{\n\t\t\tif(this._customFooterRendererStyleName == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customFooterRendererStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _footerRendererProperties:PropertyProxy;\n\n\t\tpublic function get footerRendererProperties():PropertyProxy\n\t\t{\n\t\t\treturn this._footerRendererProperties;\n\t\t}\n\n\t\tpublic function set footerRendererProperties(value:PropertyProxy):void\n\t\t{\n\t\t\tif(this._footerRendererProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._footerRendererProperties)\n\t\t\t{\n\t\t\t\tthis._footerRendererProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._footerRendererProperties = PropertyProxy(value);\n\t\t\tif(this._footerRendererProperties)\n\t\t\t{\n\t\t\t\tthis._footerRendererProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\tprivate var _ignoreLayoutChanges:Boolean = false;\n\t\tprivate var _ignoreRendererResizing:Boolean = false;\n\n\t\tprivate var _layout:ILayout;\n\n\t\tpublic function get layout():ILayout\n\t\t{\n\t\t\treturn this._layout;\n\t\t}\n\n\t\tpublic function set layout(value:ILayout):void\n\t\t{\n\t\t\tif(this._layout == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._layout)\n\t\t\t{\n\t\t\t\tthis._layout.removeEventListener(Event.CHANGE, layout_changeHandler);\n\t\t\t}\n\t\t\tthis._layout = value;\n\t\t\tif(this._layout)\n\t\t\t{\n\t\t\t\tif(this._layout is IVariableVirtualLayout)\n\t\t\t\t{\n\t\t\t\t\tvar variableVirtualLayout:IVariableVirtualLayout = IVariableVirtualLayout(this._layout);\n\n\t\t\t\t\t//headers and footers are almost always going to have a\n\t\t\t\t\t//different height, so we might as well force it because if\n\t\t\t\t\t//we don't, there will be a lot of support requests\n\t\t\t\t\tvariableVirtualLayout.hasVariableItemDimensions = true;\n\n\t\t\t\t\tvariableVirtualLayout.resetVariableVirtualCache();\n\t\t\t\t}\n\t\t\t\tthis._layout.addEventListener(Event.CHANGE, layout_changeHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\tprivate var _horizontalScrollPosition:Number = 0;\n\n\t\tpublic function get horizontalScrollPosition():Number\n\t\t{\n\t\t\treturn this._horizontalScrollPosition;\n\t\t}\n\n\t\tpublic function set horizontalScrollPosition(value:Number):void\n\t\t{\n\t\t\tif(this._horizontalScrollPosition == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalScrollPosition = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t}\n\n\t\tprivate var _verticalScrollPosition:Number = 0;\n\n\t\tpublic function get verticalScrollPosition():Number\n\t\t{\n\t\t\treturn this._verticalScrollPosition;\n\t\t}\n\n\t\tpublic function set verticalScrollPosition(value:Number):void\n\t\t{\n\t\t\tif(this._verticalScrollPosition == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalScrollPosition = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t}\n\n\t\tpublic function get requiresMeasurementOnScroll():Boolean\n\t\t{\n\t\t\treturn this._layout.requiresLayoutOnScroll &&\n\t\t\t\t(this._explicitVisibleWidth !== this._explicitVisibleWidth ||\n\t\t\t\tthis._explicitVisibleHeight !== this._explicitVisibleHeight);\n\t\t}\n\n\t\tprivate var _minimumItemCount:int;\n\t\tprivate var _minimumHeaderCount:int;\n\t\tprivate var _minimumFooterCount:int;\n\t\tprivate var _minimumFirstAndLastItemCount:int;\n\t\tprivate var _minimumSingleItemCount:int;\n\n\t\tprivate var _ignoreSelectionChanges:Boolean = false;\n\n\t\tpublic function setSelectedLocation(groupIndex:int, itemIndex:int):void\n\t\t{\n\t\t\tif(this._selectedGroupIndex == groupIndex && this._selectedItemIndex == itemIndex)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif((groupIndex < 0 && itemIndex >= 0) || (groupIndex >= 0 && itemIndex < 0))\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"To deselect items, group index and item index must both be < 0.\");\n\t\t\t}\n\t\t\tthis._selectedGroupIndex = groupIndex;\n\t\t\tthis._selectedItemIndex = itemIndex;\n\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\tpublic function calculateNavigationDestination(groupIndex:int, itemIndex:int, keyCode:uint, result:Vector.<int>):void\n\t\t{\n\t\t\tvar displayIndex:int = this.locationToDisplayIndex(groupIndex, itemIndex);\n\t\t\tvar newDisplayIndex:int = this._layout.calculateNavigationDestination(this._layoutItems, displayIndex, keyCode, this._layoutResult);\n\t\t\tthis.displayIndexToLocation(newDisplayIndex, result);\n\t\t}\n\n\t\tpublic function getScrollPositionForIndex(groupIndex:int, itemIndex:int, result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\n\t\t\tvar displayIndex:int = this.locationToDisplayIndex(groupIndex, itemIndex);\n\t\t\treturn this._layout.getScrollPositionForIndex(displayIndex, this._layoutItems,\n\t\t\t\t0, 0, this._actualVisibleWidth, this._actualVisibleHeight, result);\n\t\t}\n\n\t\tpublic function getNearestScrollPositionForIndex(groupIndex:int, itemIndex:int, result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\n\t\t\tvar displayIndex:int = this.locationToDisplayIndex(groupIndex, itemIndex);\n\t\t\treturn this._layout.getNearestScrollPositionForIndex(displayIndex, this._horizontalScrollPosition,\n\t\t\t\tthis._verticalScrollPosition, this._layoutItems, 0, 0, this._actualVisibleWidth, this._actualVisibleHeight, result);\n\t\t}\n\n\t\tpublic function itemToItemRenderer(item:Object):IGroupedListItemRenderer\n\t\t{\n\t\t\tif(item is XML || item is XMLList)\n\t\t\t{\n\t\t\t\treturn IGroupedListItemRenderer(this._itemRendererMap[item.toXMLString()]);\n\t\t\t}\n\t\t\treturn IGroupedListItemRenderer(this._itemRendererMap[item]);\n\t\t}\n\n\t\tpublic function headerDataToHeaderRenderer(headerData:Object):IGroupedListHeaderRenderer\n\t\t{\n\t\t\tif(headerData is XML || headerData is XMLList)\n\t\t\t{\n\t\t\t\treturn IGroupedListHeaderRenderer(this._headerRendererMap[headerData.toXMLString()]);\n\t\t\t}\n\t\t\treturn IGroupedListHeaderRenderer(this._headerRendererMap[headerData]);\n\t\t}\n\n\t\tpublic function footerDataToFooterRenderer(footerData:Object):IGroupedListFooterRenderer\n\t\t{\n\t\t\tif(footerData is XML || footerData is XMLList)\n\t\t\t{\n\t\t\t\treturn IGroupedListFooterRenderer(this._footerRendererMap[footerData.toXMLString()]);\n\t\t\t}\n\t\t\treturn IGroupedListFooterRenderer(this._footerRendererMap[footerData]);\n\t\t}\n\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tthis.refreshInactiveRenderers(true);\n\t\t\tthis.owner = null;\n\t\t\tthis.dataProvider = null;\n\t\t\tthis.layout = null;\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar scrollInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SCROLL);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\tvar selectionInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SELECTED);\n\t\t\tvar itemRendererInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar layoutInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_LAYOUT);\n\n\t\t\t//scrolling only affects the layout is requiresLayoutOnScroll is true\n\t\t\tif(!layoutInvalid && scrollInvalid && this._layout && this._layout.requiresLayoutOnScroll)\n\t\t\t{\n\t\t\t\tlayoutInvalid = true;\n\t\t\t}\n\n\t\t\tvar basicsInvalid:Boolean = sizeInvalid || dataInvalid || layoutInvalid || itemRendererInvalid;\n\n\t\t\tvar oldIgnoreRendererResizing:Boolean = this._ignoreRendererResizing;\n\t\t\tthis._ignoreRendererResizing = true;\n\t\t\tvar oldIgnoreLayoutChanges:Boolean = this._ignoreLayoutChanges;\n\t\t\tthis._ignoreLayoutChanges = true;\n\n\t\t\tif(scrollInvalid || sizeInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshViewPortBounds();\n\t\t\t}\n\t\t\tif(basicsInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshInactiveRenderers(itemRendererInvalid);\n\t\t\t}\n\t\t\tif(dataInvalid || layoutInvalid || itemRendererInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshLayoutTypicalItem();\n\t\t\t}\n\t\t\tif(basicsInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshRenderers();\n\t\t\t}\n\t\t\tif(stylesInvalid || basicsInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshHeaderRendererStyles();\n\t\t\t\tthis.refreshFooterRendererStyles();\n\t\t\t\tthis.refreshItemRendererStyles();\n\t\t\t}\n\t\t\tif(selectionInvalid || basicsInvalid)\n\t\t\t{\n\t\t\t\t//unlike resizing renderers and layout changes, we only want to\n\t\t\t\t//stop listening for selection changes when we're forcibly\n\t\t\t\t//updating selection. other property changes on item renderers\n\t\t\t\t//can validly change selection, and we need to detect that.\n\t\t\t\tvar oldIgnoreSelectionChanges:Boolean = this._ignoreSelectionChanges;\n\t\t\t\tthis._ignoreSelectionChanges = true;\n\t\t\t\tthis.refreshSelection();\n\t\t\t\tthis._ignoreSelectionChanges = oldIgnoreSelectionChanges;\n\t\t\t}\n\t\t\tif(stateInvalid || basicsInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshEnabled();\n\t\t\t}\n\t\t\tthis._ignoreLayoutChanges = oldIgnoreLayoutChanges;\n\n\t\t\tif(stateInvalid || selectionInvalid || stylesInvalid || basicsInvalid)\n\t\t\t{\n\t\t\t\tthis._layout.layout(this._layoutItems, this._viewPortBounds, this._layoutResult);\n\t\t\t}\n\n\t\t\tthis._ignoreRendererResizing = oldIgnoreRendererResizing;\n\n\t\t\tthis._contentX = this._layoutResult.contentX;\n\t\t\tthis._contentY = this._layoutResult.contentY;\n\t\t\tthis.saveMeasurements(this._layoutResult.contentWidth, this._layoutResult.contentHeight,\n\t\t\t\tthis._layoutResult.contentWidth, this._layoutResult.contentHeight);\n\t\t\tthis._actualVisibleWidth = this._layoutResult.viewPortWidth;\n\t\t\tthis._actualVisibleHeight = this._layoutResult.viewPortHeight;\n\t\t\tthis._actualMinVisibleWidth = this._layoutResult.viewPortWidth;\n\t\t\tthis._actualMinVisibleHeight = this._layoutResult.viewPortHeight;\n\n\t\t\t//final validation to avoid juggler next frame issues\n\t\t\tthis.validateRenderers();\n\t\t}\n\n\t\tprivate function validateRenderers():void\n\t\t{\n\t\t\tvar itemCount:int = this._layoutItems.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:IValidating = this._layoutItems[i] as IValidating;\n\t\t\t\tif(item)\n\t\t\t\t{\n\t\t\t\t\titem.validate();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function refreshEnabled():void\n\t\t{\n\t\t\tfor each(var item:DisplayObject in this._layoutItems)\n\t\t\t{\n\t\t\t\tvar control:IFeathersControl = item as IFeathersControl;\n\t\t\t\tif(control)\n\t\t\t\t{\n\t\t\t\t\tcontrol.isEnabled = this._isEnabled;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function invalidateParent(flag:String = INVALIDATION_FLAG_ALL):void\n\t\t{\n\t\t\tScroller(this.parent).invalidate(flag);\n\t\t}\n\n\t\tprivate function refreshLayoutTypicalItem():void\n\t\t{\n\t\t\tvar virtualLayout:IVirtualLayout = this._layout as IVirtualLayout;\n\t\t\tif(!virtualLayout || !virtualLayout.useVirtualLayout)\n\t\t\t{\n\t\t\t\tif(!this._typicalItemIsInDataProvider && this._typicalItemRenderer)\n\t\t\t\t{\n\t\t\t\t\t//the old layout was virtual, but this one isn't\n\t\t\t\t\tthis.destroyItemRenderer(this._typicalItemRenderer);\n\t\t\t\t\tthis._typicalItemRenderer = null;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar newTypicalItemIsInDataProvider:Boolean = false;\n\t\t\tvar typicalItem:Object = this._typicalItem;\n\t\t\tvar groupCount:int = 0;\n\t\t\tvar typicalGroupLength:int = 0;\n\t\t\tvar typicalItemGroupIndex:int = 0;\n\t\t\tvar typicalItemItemIndex:int = 0;\n\t\t\tif(this._dataProvider)\n\t\t\t{\n\t\t\t\tif(typicalItem !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._dataProvider.getItemLocation(typicalItem, HELPER_VECTOR);\n\t\t\t\t\tif(HELPER_VECTOR.length > 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewTypicalItemIsInDataProvider = true;\n\t\t\t\t\t\ttypicalItemGroupIndex = HELPER_VECTOR[0];\n\t\t\t\t\t\ttypicalItemItemIndex = HELPER_VECTOR[1];\n\t\t\t\t\t\tHELPER_VECTOR.length = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tgroupCount = this._dataProvider.getLengthAtLocation();\n\t\t\t\t\tif(groupCount > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor(var i:int = 0; i < groupCount; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tLOCATION_HELPER_VECTOR.length = 1;\n\t\t\t\t\t\t\tLOCATION_HELPER_VECTOR[0] = i;\n\t\t\t\t\t\t\ttypicalGroupLength = this._dataProvider.getLengthAtLocation(LOCATION_HELPER_VECTOR);\n\t\t\t\t\t\t\tif(typicalGroupLength > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tnewTypicalItemIsInDataProvider = true;\n\t\t\t\t\t\t\t\ttypicalItemGroupIndex = i;\n\t\t\t\t\t\t\t\tLOCATION_HELPER_VECTOR.length = 2;\n\t\t\t\t\t\t\t\tLOCATION_HELPER_VECTOR[1] = 0;\n\t\t\t\t\t\t\t\ttypicalItem = this._dataProvider.getItemAtLocation(LOCATION_HELPER_VECTOR);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tLOCATION_HELPER_VECTOR.length = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//#1645 The typicalItem can be null if the data provider contains\n\t\t\t//a null value at index 0. this is the only time we allow null.\n\t\t\tif(typicalItem !== null || newTypicalItemIsInDataProvider)\n\t\t\t{\n\t\t\t\tvar typicalItemRenderer:IGroupedListItemRenderer = this.itemToItemRenderer(typicalItem);\n\t\t\t\tif(typicalItemRenderer)\n\t\t\t\t{\n\t\t\t\t\t//at this point, the item already has an item renderer.\n\t\t\t\t\t//(this doesn't necessarily mean that the current typical\n\t\t\t\t\t//item was the typical item last time this function was\n\t\t\t\t\t//called)\n\n\t\t\t\t\t//the indices may have changed if items were added, removed,\n\t\t\t\t\t//or reordered in the data provider\n\t\t\t\t\ttypicalItemRenderer.groupIndex = typicalItemGroupIndex;\n\t\t\t\t\ttypicalItemRenderer.itemIndex = typicalItemItemIndex;\n\t\t\t\t}\n\t\t\t\tif(!typicalItemRenderer && this._typicalItemRenderer)\n\t\t\t\t{\n\t\t\t\t\t//the typical item has changed, and doesn't have an item\n\t\t\t\t\t//renderer yet. the previous typical item had an item\n\t\t\t\t\t//renderer, so we will try to reuse it.\n\n\t\t\t\t\tvar canReuse:Boolean = !this._typicalItemIsInDataProvider;\n\t\t\t\t\tif(canReuse)\n\t\t\t\t\t{\n\t\t\t\t\t\t//we can't reuse if the factoryID has changed, though!\n\t\t\t\t\t\tvar factoryID:String = this.getFactoryID(typicalItem, typicalItemGroupIndex, typicalItemItemIndex);\n\t\t\t\t\t\tif(this._typicalItemRenderer.factoryID !== factoryID)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcanReuse = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(canReuse)\n\t\t\t\t\t{\n\t\t\t\t\t\t//we can reuse the item renderer used for the old\n\t\t\t\t\t\t//typical item!\n\t\t\t\t\t\ttypicalItemRenderer = this._typicalItemRenderer;\n\t\t\t\t\t\ttypicalItemRenderer.data = typicalItem;\n\t\t\t\t\t\ttypicalItemRenderer.groupIndex = typicalItemGroupIndex;\n\t\t\t\t\t\ttypicalItemRenderer.itemIndex = typicalItemItemIndex;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!typicalItemRenderer)\n\t\t\t\t{\n\t\t\t\t\ttypicalItemRenderer = this.createItemRenderer(typicalItem, 0, 0, 0, false, !newTypicalItemIsInDataProvider);\n\t\t\t\t\tif(!this._typicalItemIsInDataProvider && this._typicalItemRenderer)\n\t\t\t\t\t{\n\t\t\t\t\t\t//get rid of the old one if it isn't needed anymore\n\t\t\t\t\t\t//since it is not in the data provider, we don't need to mess\n\t\t\t\t\t\t//with the renderer map dictionary.\n\t\t\t\t\t\tthis.destroyItemRenderer(this._typicalItemRenderer);\n\t\t\t\t\t\tthis._typicalItemRenderer = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvirtualLayout.typicalItem = DisplayObject(typicalItemRenderer);\n\t\t\tthis._typicalItemRenderer = typicalItemRenderer;\n\t\t\tthis._typicalItemIsInDataProvider = newTypicalItemIsInDataProvider;\n\t\t\tif(this._typicalItemRenderer && !this._typicalItemIsInDataProvider)\n\t\t\t{\n\t\t\t\t//we need to know if this item renderer resizes to adjust the\n\t\t\t\t//layout because the layout may use this item renderer to resize\n\t\t\t\t//the other item renderers\n\t\t\t\tthis._typicalItemRenderer.addEventListener(FeathersEventType.RESIZE, itemRenderer_resizeHandler);\n\t\t\t}\n\t\t}\n\n\t\tprivate function refreshItemRendererStyles():void\n\t\t{\n\t\t\tfor each(var item:DisplayObject in this._layoutItems)\n\t\t\t{\n\t\t\t\tvar itemRenderer:IGroupedListItemRenderer = item as IGroupedListItemRenderer;\n\t\t\t\tif(itemRenderer)\n\t\t\t\t{\n\t\t\t\t\tthis.refreshOneItemRendererStyles(itemRenderer);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function refreshHeaderRendererStyles():void\n\t\t{\n\t\t\tfor each(var item:DisplayObject in this._layoutItems)\n\t\t\t{\n\t\t\t\tvar headerRenderer:IGroupedListHeaderRenderer = item as IGroupedListHeaderRenderer;\n\t\t\t\tif(headerRenderer)\n\t\t\t\t{\n\t\t\t\t\tthis.refreshOneHeaderRendererStyles(headerRenderer);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function refreshFooterRendererStyles():void\n\t\t{\n\t\t\tfor each(var item:DisplayObject in this._layoutItems)\n\t\t\t{\n\t\t\t\tvar footerRenderer:IGroupedListFooterRenderer = item as IGroupedListFooterRenderer;\n\t\t\t\tif(footerRenderer)\n\t\t\t\t{\n\t\t\t\t\tthis.refreshOneFooterRendererStyles(footerRenderer);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function refreshOneItemRendererStyles(renderer:IGroupedListItemRenderer):void\n\t\t{\n\t\t\tvar displayRenderer:DisplayObject = DisplayObject(renderer);\n\t\t\tfor(var propertyName:String in this._itemRendererProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._itemRendererProperties[propertyName];\n\t\t\t\tdisplayRenderer[propertyName] = propertyValue;\n\t\t\t}\n\t\t}\n\n\t\tprivate function refreshOneHeaderRendererStyles(renderer:IGroupedListHeaderRenderer):void\n\t\t{\n\t\t\tvar displayRenderer:DisplayObject = DisplayObject(renderer);\n\t\t\tfor(var propertyName:String in this._headerRendererProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._headerRendererProperties[propertyName];\n\t\t\t\tdisplayRenderer[propertyName] = propertyValue;\n\t\t\t}\n\t\t}\n\n\t\tprivate function refreshOneFooterRendererStyles(renderer:IGroupedListFooterRenderer):void\n\t\t{\n\t\t\tvar displayRenderer:DisplayObject = DisplayObject(renderer);\n\t\t\tfor(var propertyName:String in this._footerRendererProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._footerRendererProperties[propertyName];\n\t\t\t\tdisplayRenderer[propertyName] = propertyValue;\n\t\t\t}\n\t\t}\n\n\t\tprivate function refreshSelection():void\n\t\t{\n\t\t\tfor each(var item:DisplayObject in this._layoutItems)\n\t\t\t{\n\t\t\t\tvar itemRenderer:IGroupedListItemRenderer = item as IGroupedListItemRenderer;\n\t\t\t\tif(itemRenderer)\n\t\t\t\t{\n\t\t\t\t\titemRenderer.isSelected = itemRenderer.groupIndex == this._selectedGroupIndex &&\n\t\t\t\t\t\titemRenderer.itemIndex == this._selectedItemIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function refreshViewPortBounds():void\n\t\t{\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinVisibleWidth !== this._explicitMinVisibleWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinVisibleHeight !== this._explicitMinVisibleHeight; //isNaN\n\t\t\tthis._viewPortBounds.x = 0;\n\t\t\tthis._viewPortBounds.y = 0;\n\t\t\tthis._viewPortBounds.scrollX = this._horizontalScrollPosition;\n\t\t\tthis._viewPortBounds.scrollY = this._verticalScrollPosition;\n\t\t\tthis._viewPortBounds.explicitWidth = this._explicitVisibleWidth;\n\t\t\tthis._viewPortBounds.explicitHeight = this._explicitVisibleHeight;\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tthis._viewPortBounds.minWidth = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._viewPortBounds.minWidth = this._explicitMinVisibleWidth;\n\t\t\t}\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tthis._viewPortBounds.minHeight = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._viewPortBounds.minHeight = this._explicitMinVisibleHeight;\n\t\t\t}\n\t\t\tthis._viewPortBounds.maxWidth = this._maxVisibleWidth;\n\t\t\tthis._viewPortBounds.maxHeight = this._maxVisibleHeight;\n\t\t}\n\n\t\tprivate function refreshInactiveRenderers(itemRendererTypeIsInvalid:Boolean):void\n\t\t{\n\t\t\tthis.refreshInactiveItemRenderers(this._defaultItemRendererStorage, itemRendererTypeIsInvalid);\n\t\t\tfor(var factoryID:String in this._itemStorageMap)\n\t\t\t{\n\t\t\t\tvar itemStorage:ItemRendererFactoryStorage = ItemRendererFactoryStorage(this._itemStorageMap[factoryID]);\n\t\t\t\tthis.refreshInactiveItemRenderers(itemStorage, itemRendererTypeIsInvalid);\n\t\t\t}\n\n\t\t\tthis.refreshInactiveHeaderRenderers(this._defaultHeaderRendererStorage, itemRendererTypeIsInvalid);\n\t\t\tfor(factoryID in this._headerStorageMap)\n\t\t\t{\n\t\t\t\tvar headerStorage:HeaderRendererFactoryStorage = HeaderRendererFactoryStorage(this._headerStorageMap[factoryID]);\n\t\t\t\tthis.refreshInactiveHeaderRenderers(headerStorage, itemRendererTypeIsInvalid);\n\t\t\t}\n\n\t\t\tthis.refreshInactiveFooterRenderers(this._defaultFooterRendererStorage, itemRendererTypeIsInvalid);\n\t\t\tfor(factoryID in this._footerStorageMap)\n\t\t\t{\n\t\t\t\tvar footerStorage:FooterRendererFactoryStorage = FooterRendererFactoryStorage(this._footerStorageMap[factoryID]);\n\t\t\t\tthis.refreshInactiveFooterRenderers(footerStorage, itemRendererTypeIsInvalid);\n\t\t\t}\n\n\t\t\tif(itemRendererTypeIsInvalid && this._typicalItemRenderer)\n\t\t\t{\n\t\t\t\tif(this._typicalItemIsInDataProvider)\n\t\t\t\t{\n\t\t\t\t\tvar item:Object = this._typicalItemRenderer.data;\n\t\t\t\t\tif(item is XML || item is XMLList)\n\t\t\t\t\t{\n\t\t\t\t\t\tdelete this._itemRendererMap[item.toXMLString()];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tdelete this._itemRendererMap[item];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.destroyItemRenderer(this._typicalItemRenderer);\n\t\t\t\tthis._typicalItemRenderer = null;\n\t\t\t\tthis._typicalItemIsInDataProvider = false;\n\t\t\t}\n\n\t\t\tthis._headerIndices.length = 0;\n\t\t\tthis._footerIndices.length = 0;\n\t\t}\n\n\t\tprivate function refreshInactiveItemRenderers(storage:ItemRendererFactoryStorage, itemRendererTypeIsInvalid:Boolean):void\n\t\t{\n\t\t\tvar temp:Vector.<IGroupedListItemRenderer> = storage.inactiveItemRenderers;\n\t\t\tstorage.inactiveItemRenderers = storage.activeItemRenderers;\n\t\t\tstorage.activeItemRenderers = temp;\n\t\t\tif(storage.activeItemRenderers.length > 0)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"GroupedListDataViewPort: active item renderers should be empty.\");\n\t\t\t}\n\n\t\t\tif(itemRendererTypeIsInvalid)\n\t\t\t{\n\t\t\t\tthis.recoverInactiveItemRenderers(storage);\n\t\t\t\tthis.freeInactiveItemRenderers(storage, 0);\n\t\t\t}\n\t\t}\n\n\t\tprivate function refreshInactiveHeaderRenderers(storage:HeaderRendererFactoryStorage, itemRendererTypeIsInvalid:Boolean):void\n\t\t{\n\t\t\tvar temp:Vector.<IGroupedListHeaderRenderer> = storage.inactiveHeaderRenderers;\n\t\t\tstorage.inactiveHeaderRenderers = storage.activeHeaderRenderers;\n\t\t\tstorage.activeHeaderRenderers = temp;\n\t\t\tif(storage.activeHeaderRenderers.length > 0)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"GroupedListDataViewPort: active header renderers should be empty.\");\n\t\t\t}\n\n\t\t\tif(itemRendererTypeIsInvalid)\n\t\t\t{\n\t\t\t\tthis.recoverInactiveHeaderRenderers(storage);\n\t\t\t\tthis.freeInactiveHeaderRenderers(storage, 0);\n\t\t\t}\n\t\t}\n\n\t\tprivate function refreshInactiveFooterRenderers(storage:FooterRendererFactoryStorage, itemRendererTypeIsInvalid:Boolean):void\n\t\t{\n\t\t\tvar temp:Vector.<IGroupedListFooterRenderer> = storage.inactiveFooterRenderers;\n\t\t\tstorage.inactiveFooterRenderers = storage.activeFooterRenderers;\n\t\t\tstorage.activeFooterRenderers = temp;\n\t\t\tif(storage.activeFooterRenderers.length > 0)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"GroupedListDataViewPort: active footer renderers should be empty.\");\n\t\t\t}\n\n\t\t\tif(itemRendererTypeIsInvalid)\n\t\t\t{\n\t\t\t\tthis.recoverInactiveFooterRenderers(storage);\n\t\t\t\tthis.freeInactiveFooterRenderers(storage, 0);\n\t\t\t}\n\t\t}\n\n\t\tprivate function refreshRenderers():void\n\t\t{\n\t\t\tif(this._typicalItemRenderer)\n\t\t\t{\n\t\t\t\tif(this._typicalItemIsInDataProvider)\n\t\t\t\t{\n\t\t\t\t\tvar itemStorage:ItemRendererFactoryStorage = this.factoryIDToStorage(this._typicalItemRenderer.factoryID,\n\t\t\t\t\t\tthis._typicalItemRenderer.groupIndex, this._typicalItemRenderer.itemIndex);\n\t\t\t\t\tvar inactiveItemRenderers:Vector.<IGroupedListItemRenderer> = itemStorage.inactiveItemRenderers;\n\t\t\t\t\tvar activeItemRenderers:Vector.<IGroupedListItemRenderer> = itemStorage.activeItemRenderers;\n\n\t\t\t\t\t//this renderer is already is use by the typical item, so we\n\t\t\t\t\t//don't want to allow it to be used by other items.\n\t\t\t\t\tvar inactiveIndex:int = inactiveItemRenderers.indexOf(this._typicalItemRenderer);\n\t\t\t\t\tif(inactiveIndex >= 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tinactiveItemRenderers.removeAt(inactiveIndex);\n\t\t\t\t\t}\n\t\t\t\t\t//if refreshLayoutTypicalItem() was called, it will have already\n\t\t\t\t\t//added the typical item renderer to the active renderers. if\n\t\t\t\t\t//not, we need to do it here.\n\t\t\t\t\tvar activeRenderersCount:int = activeItemRenderers.length;\n\t\t\t\t\tif(activeRenderersCount == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tactiveItemRenderers[activeRenderersCount] = this._typicalItemRenderer;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//we need to set the typical item renderer's properties here\n\t\t\t\t//because they may be needed for proper measurement in a virtual\n\t\t\t\t//layout.\n\t\t\t\tthis.refreshOneItemRendererStyles(this._typicalItemRenderer);\n\t\t\t}\n\n\t\t\tthis.findUnrenderedData();\n\t\t\tthis.recoverInactiveItemRenderers(this._defaultItemRendererStorage);\n\t\t\tif(this._itemStorageMap)\n\t\t\t{\n\t\t\t\tfor(var factoryID:String in this._itemStorageMap)\n\t\t\t\t{\n\t\t\t\t\titemStorage = ItemRendererFactoryStorage(this._itemStorageMap[factoryID]);\n\t\t\t\t\tthis.recoverInactiveItemRenderers(itemStorage);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.recoverInactiveHeaderRenderers(this._defaultHeaderRendererStorage);\n\t\t\tif(this._headerStorageMap)\n\t\t\t{\n\t\t\t\tfor(factoryID in this._headerStorageMap)\n\t\t\t\t{\n\t\t\t\t\tvar headerStorage:HeaderRendererFactoryStorage = HeaderRendererFactoryStorage(this._headerStorageMap[factoryID]);\n\t\t\t\t\tthis.recoverInactiveHeaderRenderers(headerStorage);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.recoverInactiveFooterRenderers(this._defaultFooterRendererStorage);\n\t\t\tif(this._footerStorageMap)\n\t\t\t{\n\t\t\t\tfor(factoryID in this._footerStorageMap)\n\t\t\t\t{\n\t\t\t\t\tvar footerStorage:FooterRendererFactoryStorage = FooterRendererFactoryStorage(this._footerStorageMap[factoryID]);\n\t\t\t\t\tthis.recoverInactiveFooterRenderers(footerStorage);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.renderUnrenderedData();\n\n\t\t\tthis.freeInactiveItemRenderers(this._defaultItemRendererStorage, this._minimumItemCount);\n\t\t\tif(this._itemStorageMap)\n\t\t\t{\n\t\t\t\tfor(factoryID in this._itemStorageMap)\n\t\t\t\t{\n\t\t\t\t\titemStorage = ItemRendererFactoryStorage(this._itemStorageMap[factoryID]);\n\t\t\t\t\tthis.freeInactiveItemRenderers(itemStorage, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.freeInactiveHeaderRenderers(this._defaultHeaderRendererStorage, this._minimumHeaderCount);\n\t\t\tif(this._headerStorageMap)\n\t\t\t{\n\t\t\t\tfor(factoryID in this._headerStorageMap)\n\t\t\t\t{\n\t\t\t\t\theaderStorage = HeaderRendererFactoryStorage(this._headerStorageMap[factoryID]);\n\t\t\t\t\tthis.freeInactiveHeaderRenderers(headerStorage, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.freeInactiveFooterRenderers(this._defaultFooterRendererStorage, this._minimumFooterCount);\n\t\t\tif(this._footerStorageMap)\n\t\t\t{\n\t\t\t\tfor(factoryID in this._footerStorageMap)\n\t\t\t\t{\n\t\t\t\t\tfooterStorage = FooterRendererFactoryStorage(this._footerStorageMap[factoryID]);\n\t\t\t\t\tthis.freeInactiveFooterRenderers(footerStorage, 1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._updateForDataReset = false;\n\t\t}\n\n\t\tprivate function findUnrenderedData():void\n\t\t{\n\t\t\tvar groupCount:int = this._dataProvider ? this._dataProvider.getLengthAtLocation() : 0;\n\t\t\tvar totalLayoutCount:int = 0;\n\t\t\tvar totalHeaderCount:int = 0;\n\t\t\tvar totalFooterCount:int = 0;\n\t\t\tvar totalSingleItemCount:int = 0;\n\t\t\tvar averageItemsPerGroup:int = 0;\n\t\t\tLOCATION_HELPER_VECTOR.length = 1;\n\t\t\tfor(var i:int = 0; i < groupCount; i++)\n\t\t\t{\n\t\t\t\tLOCATION_HELPER_VECTOR[0] = i;\n\t\t\t\tvar group:Object = this._dataProvider.getItemAtLocation(LOCATION_HELPER_VECTOR);\n\t\t\t\tif(this._owner.groupToHeaderData(group) !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._headerIndices[totalHeaderCount] = totalLayoutCount;\n\t\t\t\t\ttotalLayoutCount++;\n\t\t\t\t\ttotalHeaderCount++;\n\t\t\t\t}\n\t\t\t\tvar currentItemCount:int = this._dataProvider.getLengthAtLocation(LOCATION_HELPER_VECTOR);\n\t\t\t\ttotalLayoutCount += currentItemCount;\n\t\t\t\taverageItemsPerGroup += currentItemCount;\n\t\t\t\tif(currentItemCount == 0)\n\t\t\t\t{\n\t\t\t\t\ttotalSingleItemCount++;\n\t\t\t\t}\n\t\t\t\tif(this._owner.groupToFooterData(group) !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._footerIndices[totalFooterCount] = totalLayoutCount;\n\t\t\t\t\ttotalLayoutCount++;\n\t\t\t\t\ttotalFooterCount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tLOCATION_HELPER_VECTOR.length = 0;\n\t\t\tthis._layoutItems.length = totalLayoutCount;\n\t\t\tif(this._layout is IGroupedLayout)\n\t\t\t{\n\t\t\t\tIGroupedLayout(this._layout).headerIndices = this._headerIndices;\n\t\t\t}\n\t\t\tvar virtualLayout:IVirtualLayout = this._layout as IVirtualLayout;\n\t\t\tvar useVirtualLayout:Boolean = virtualLayout && virtualLayout.useVirtualLayout;\n\t\t\tif(useVirtualLayout)\n\t\t\t{\n\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\tvirtualLayout.measureViewPort(totalLayoutCount, this._viewPortBounds, point);\n\t\t\t\tvar viewPortWidth:Number = point.x;\n\t\t\t\tvar viewPortHeight:Number = point.y;\n\t\t\t\tPool.putPoint(point);\n\t\t\t\tvirtualLayout.getVisibleIndicesAtScrollPosition(this._horizontalScrollPosition, this._verticalScrollPosition, viewPortWidth, viewPortHeight, totalLayoutCount, HELPER_VECTOR);\n\n\t\t\t\taverageItemsPerGroup /= groupCount;\n\n\t\t\t\tif(this._typicalItemRenderer)\n\t\t\t\t{\n\t\t\t\t\tvar minimumTypicalItemEdge:Number = this._typicalItemRenderer.height;\n\t\t\t\t\tif(this._typicalItemRenderer.width < minimumTypicalItemEdge)\n\t\t\t\t\t{\n\t\t\t\t\t\tminimumTypicalItemEdge = this._typicalItemRenderer.width;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar maximumViewPortEdge:Number = viewPortWidth;\n\t\t\t\t\tif(viewPortHeight > viewPortWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tmaximumViewPortEdge = viewPortHeight;\n\t\t\t\t\t}\n\t\t\t\t\tthis._minimumFirstAndLastItemCount = this._minimumSingleItemCount = this._minimumHeaderCount = this._minimumFooterCount = Math.ceil(maximumViewPortEdge / (minimumTypicalItemEdge * averageItemsPerGroup));\n\t\t\t\t\tthis._minimumHeaderCount = Math.min(this._minimumHeaderCount, totalHeaderCount);\n\t\t\t\t\tthis._minimumFooterCount = Math.min(this._minimumFooterCount, totalFooterCount);\n\t\t\t\t\tthis._minimumSingleItemCount = Math.min(this._minimumSingleItemCount, totalSingleItemCount);\n\n\t\t\t\t\t//assumes that zero headers/footers might be visible\n\t\t\t\t\tthis._minimumItemCount = Math.ceil(maximumViewPortEdge / minimumTypicalItemEdge) + 1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._minimumFirstAndLastItemCount = 1;\n\t\t\t\t\tthis._minimumHeaderCount = 1;\n\t\t\t\t\tthis._minimumFooterCount = 1;\n\t\t\t\t\tthis._minimumSingleItemCount = 1;\n\t\t\t\t\tthis._minimumItemCount = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar currentIndex:int = 0;\n\t\t\tfor(i = 0; i < groupCount; i++)\n\t\t\t{\n\t\t\t\tLOCATION_HELPER_VECTOR.length = 1;\n\t\t\t\tLOCATION_HELPER_VECTOR[0] = i;\n\t\t\t\tgroup = this._dataProvider.getItemAtLocation(LOCATION_HELPER_VECTOR);\n\t\t\t\tLOCATION_HELPER_VECTOR.length = 0;\n\t\t\t\tvar header:Object = this._owner.groupToHeaderData(group);\n\t\t\t\tif(header !== null)\n\t\t\t\t{\n\t\t\t\t\t//the end index is included in the visible items\n\t\t\t\t\tif(useVirtualLayout && HELPER_VECTOR.indexOf(currentIndex) < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._layoutItems[currentIndex] = null;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.findRendererForHeader(header, i, currentIndex);\n\t\t\t\t\t}\n\t\t\t\t\tcurrentIndex++;\n\t\t\t\t}\n\t\t\t\tLOCATION_HELPER_VECTOR.length = 1;\n\t\t\t\tLOCATION_HELPER_VECTOR[0] = i;\n\t\t\t\tcurrentItemCount = this._dataProvider.getLengthAtLocation(LOCATION_HELPER_VECTOR);\n\t\t\t\tLOCATION_HELPER_VECTOR.length = 0;\n\t\t\t\tfor(var j:int = 0; j < currentItemCount; j++)\n\t\t\t\t{\n\t\t\t\t\tif(useVirtualLayout && HELPER_VECTOR.indexOf(currentIndex) < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._typicalItemRenderer && this._typicalItemIsInDataProvider &&\n\t\t\t\t\t\t\tthis._typicalItemRenderer.groupIndex == i &&\n\t\t\t\t\t\t\tthis._typicalItemRenderer.itemIndex == j)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//the indices may have changed if items were added, removed,\n\t\t\t\t\t\t\t//or reordered in the data provider\n\t\t\t\t\t\t\tthis._typicalItemRenderer.layoutIndex = currentIndex;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._layoutItems[currentIndex] = null;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tLOCATION_HELPER_VECTOR.length = 2;\n\t\t\t\t\t\tLOCATION_HELPER_VECTOR[0] = i;\n\t\t\t\t\t\tLOCATION_HELPER_VECTOR[1] = j;\n\t\t\t\t\t\tvar item:Object = this._dataProvider.getItemAtLocation(LOCATION_HELPER_VECTOR);\n\t\t\t\t\t\tLOCATION_HELPER_VECTOR.length = 0;\n\t\t\t\t\t\tthis.findRendererForItem(item, i, j, currentIndex);\n\t\t\t\t\t}\n\t\t\t\t\tcurrentIndex++;\n\t\t\t\t}\n\t\t\t\tvar footer:Object = this._owner.groupToFooterData(group);\n\t\t\t\tif(footer !== null)\n\t\t\t\t{\n\t\t\t\t\tif(useVirtualLayout && HELPER_VECTOR.indexOf(currentIndex) < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._layoutItems[currentIndex] = null;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.findRendererForFooter(footer, i, currentIndex);\n\t\t\t\t\t}\n\t\t\t\t\tcurrentIndex++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tLOCATION_HELPER_VECTOR.length = 0;\n\t\t\t//update the typical item renderer's visibility\n\t\t\tif(this._typicalItemRenderer)\n\t\t\t{\n\t\t\t\tif(useVirtualLayout && this._typicalItemIsInDataProvider)\n\t\t\t\t{\n\t\t\t\t\tvar index:int = HELPER_VECTOR.indexOf(this._typicalItemRenderer.layoutIndex);\n\t\t\t\t\tif(index >= 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._typicalItemRenderer.visible = true;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._typicalItemRenderer.visible = false;\n\n\t\t\t\t\t\t//uncomment these lines to see a hidden typical item for\n\t\t\t\t\t\t//debugging purposes...\n\t\t\t\t\t\t/*this._typicalItemRenderer.visible = true;\n\t\t\t\t\t\tthis._typicalItemRenderer.x = this._horizontalScrollPosition;\n\t\t\t\t\t\tthis._typicalItemRenderer.y = this._verticalScrollPosition;*/\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._typicalItemRenderer.visible = this._typicalItemIsInDataProvider;\n\t\t\t\t}\n\t\t\t}\n\t\t\tHELPER_VECTOR.length = 0;\n\t\t}\n\n\t\tprivate function findRendererForItem(item:Object, groupIndex:int, itemIndex:int, layoutIndex:int):void\n\t\t{\n\t\t\tvar itemRenderer:IGroupedListItemRenderer = this.itemToItemRenderer(item);\n\t\t\tif(this._factoryIDFunction !== null && itemRenderer !== null)\n\t\t\t{\n\t\t\t\tvar newFactoryID:String = this.getFactoryID(itemRenderer.data, groupIndex, itemIndex);\n\t\t\t\tif(newFactoryID !== itemRenderer.factoryID)\n\t\t\t\t{\n\t\t\t\t\titemRenderer = null;\n\t\t\t\t\tif(item is XML || item is XMLList)\n\t\t\t\t\t{\n\t\t\t\t\t\tdelete this._itemRendererMap[item.toXMLString()];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tdelete this._itemRendererMap[item];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(itemRenderer !== null)\n\t\t\t{\n\t\t\t\t//the indices may have changed if items were added, removed,\n\t\t\t\t//or reordered in the data provider\n\t\t\t\titemRenderer.groupIndex = groupIndex;\n\t\t\t\titemRenderer.itemIndex = itemIndex;\n\t\t\t\titemRenderer.layoutIndex = layoutIndex;\n\t\t\t\tif(this._updateForDataReset)\n\t\t\t\t{\n\t\t\t\t\t//similar to calling updateItemAt(), replacing the data\n\t\t\t\t\t//provider or resetting its source means that we should\n\t\t\t\t\t//trick the item renderer into thinking it has new data.\n\t\t\t\t\t//many developers seem to expect this behavior, so while\n\t\t\t\t\t//it's not the most optimal for performance, it saves on\n\t\t\t\t\t//support time in the forums. thankfully, it's still\n\t\t\t\t\t//somewhat optimized since the same item renderer will\n\t\t\t\t\t//receive the same data, and the children generally\n\t\t\t\t\t//won't have changed much, if at all.\n\t\t\t\t\titemRenderer.data = null;\n\t\t\t\t\titemRenderer.data = item;\n\t\t\t\t}\n\n\t\t\t\t//the typical item renderer is a special case, and we will\n\t\t\t\t//have already put it into the active renderers, so we don't\n\t\t\t\t//want to do it again!\n\t\t\t\tif(this._typicalItemRenderer !== itemRenderer)\n\t\t\t\t{\n\t\t\t\t\tvar storage:ItemRendererFactoryStorage = this.factoryIDToStorage(itemRenderer.factoryID,\n\t\t\t\t\t\titemRenderer.groupIndex, itemRenderer.itemIndex);\n\t\t\t\t\tvar activeItemRenderers:Vector.<IGroupedListItemRenderer> = storage.activeItemRenderers;\n\t\t\t\t\tvar inactiveItemRenderers:Vector.<IGroupedListItemRenderer> = storage.inactiveItemRenderers;\n\t\t\t\t\tactiveItemRenderers[activeItemRenderers.length] = itemRenderer;\n\t\t\t\t\tvar inactiveIndex:int = inactiveItemRenderers.indexOf(itemRenderer);\n\t\t\t\t\tif(inactiveIndex >= 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tinactiveItemRenderers.removeAt(inactiveIndex);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new IllegalOperationError(\"GroupedListDataViewPort: item renderer map contains bad data. This may be caused by duplicate items in the data provider, which is not allowed.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\titemRenderer.visible = true;\n\t\t\t\tthis._layoutItems[layoutIndex] = DisplayObject(itemRenderer);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar pushIndex:int = this._unrenderedItems.length;\n\t\t\t\tthis._unrenderedItems[pushIndex] = groupIndex;\n\t\t\t\tpushIndex++;\n\t\t\t\tthis._unrenderedItems[pushIndex] = itemIndex;\n\t\t\t\tpushIndex++;\n\t\t\t\tthis._unrenderedItems[pushIndex] = layoutIndex;\n\t\t\t}\n\t\t}\n\n\t\tprivate function findRendererForHeader(header:Object, groupIndex:int, layoutIndex:int):void\n\t\t{\n\t\t\tvar headerRenderer:IGroupedListHeaderRenderer = this.headerDataToHeaderRenderer(header);\n\t\t\tif(this._headerFactoryIDFunction !== null && headerRenderer !== null)\n\t\t\t{\n\t\t\t\tvar newFactoryID:String = this.getHeaderFactoryID(headerRenderer.data, groupIndex);\n\t\t\t\tif(newFactoryID !== headerRenderer.factoryID)\n\t\t\t\t{\n\t\t\t\t\theaderRenderer = null;\n\t\t\t\t\tif(header is XML || header is XMLList)\n\t\t\t\t\t{\n\t\t\t\t\t\tdelete this._headerRendererMap[header.toXMLString()];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tdelete this._headerRendererMap[header];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(headerRenderer !== null)\n\t\t\t{\n\t\t\t\theaderRenderer.groupIndex = groupIndex;\n\t\t\t\theaderRenderer.layoutIndex = layoutIndex;\n\t\t\t\tif(this._updateForDataReset)\n\t\t\t\t{\n\t\t\t\t\t//see comments in item renderer section below\n\t\t\t\t\theaderRenderer.data = null;\n\t\t\t\t\theaderRenderer.data = header;\n\t\t\t\t}\n\t\t\t\tvar storage:HeaderRendererFactoryStorage = this.headerFactoryIDToStorage(headerRenderer.factoryID);\n\t\t\t\tvar activeHeaderRenderers:Vector.<IGroupedListHeaderRenderer> = storage.activeHeaderRenderers;\n\t\t\t\tvar inactiveHeaderRenderers:Vector.<IGroupedListHeaderRenderer> = storage.inactiveHeaderRenderers;\n\t\t\t\tactiveHeaderRenderers[activeHeaderRenderers.length] = headerRenderer;\n\t\t\t\tvar inactiveIndex:int = inactiveHeaderRenderers.indexOf(headerRenderer);\n\t\t\t\tif(inactiveIndex >= 0)\n\t\t\t\t{\n\t\t\t\t\tinactiveHeaderRenderers.removeAt(inactiveIndex);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthrow new IllegalOperationError(\"GroupedListDataViewPort: header renderer map contains bad data. This may be caused by duplicate headers in the data provider, which is not allowed.\");\n\t\t\t\t}\n\t\t\t\theaderRenderer.visible = true;\n\t\t\t\tthis._layoutItems[layoutIndex] = DisplayObject(headerRenderer);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar pushIndex:int = this._unrenderedHeaders.length;\n\t\t\t\tthis._unrenderedHeaders[pushIndex] = groupIndex;\n\t\t\t\tpushIndex++;\n\t\t\t\tthis._unrenderedHeaders[pushIndex] = layoutIndex;\n\t\t\t}\n\t\t}\n\n\t\tprivate function findRendererForFooter(footer:Object, groupIndex:int, layoutIndex:int):void\n\t\t{\n\t\t\tvar footerRenderer:IGroupedListFooterRenderer = this.footerDataToFooterRenderer(footer);\n\t\t\tif(this._footerFactoryIDFunction !== null && footerRenderer !== null)\n\t\t\t{\n\t\t\t\tvar newFactoryID:String = this.getFooterFactoryID(footerRenderer.data, groupIndex);\n\t\t\t\tif(newFactoryID !== footerRenderer.factoryID)\n\t\t\t\t{\n\t\t\t\t\tfooterRenderer = null;\n\t\t\t\t\tif(footer is XML || footer is XMLList)\n\t\t\t\t\t{\n\t\t\t\t\t\tdelete this._footerRendererMap[footer.toXMLString()];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tdelete this._footerRendererMap[footer];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(footerRenderer !== null)\n\t\t\t{\n\t\t\t\tfooterRenderer.groupIndex = groupIndex;\n\t\t\t\tfooterRenderer.layoutIndex = layoutIndex;\n\t\t\t\tif(this._updateForDataReset)\n\t\t\t\t{\n\t\t\t\t\t//see comments in item renderer section above\n\t\t\t\t\tfooterRenderer.data = null;\n\t\t\t\t\tfooterRenderer.data = footer;\n\t\t\t\t}\n\t\t\t\tvar storage:FooterRendererFactoryStorage = this.footerFactoryIDToStorage(footerRenderer.factoryID);\n\t\t\t\tvar activeFooterRenderers:Vector.<IGroupedListFooterRenderer> = storage.activeFooterRenderers;\n\t\t\t\tvar inactiveFooterRenderers:Vector.<IGroupedListFooterRenderer> = storage.inactiveFooterRenderers;\n\t\t\t\tactiveFooterRenderers[activeFooterRenderers.length] = footerRenderer;\n\t\t\t\tvar inactiveIndex:int = inactiveFooterRenderers.indexOf(footerRenderer);\n\t\t\t\tif(inactiveIndex >= 0)\n\t\t\t\t{\n\t\t\t\t\tinactiveFooterRenderers.removeAt(inactiveIndex);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthrow new IllegalOperationError(\"GroupedListDataViewPort: footer renderer map contains bad data. This may be caused by duplicate footers in the data provider, which is not allowed.\");\n\t\t\t\t}\n\t\t\t\tfooterRenderer.visible = true;\n\t\t\t\tthis._layoutItems[layoutIndex] = DisplayObject(footerRenderer);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar pushIndex:int = this._unrenderedFooters.length;\n\t\t\t\tthis._unrenderedFooters[pushIndex] = groupIndex;\n\t\t\t\tpushIndex++;\n\t\t\t\tthis._unrenderedFooters[pushIndex] = layoutIndex;\n\t\t\t}\n\t\t}\n\n\t\tprivate function renderUnrenderedData():void\n\t\t{\n\t\t\tLOCATION_HELPER_VECTOR.length = 2;\n\t\t\tvar rendererCount:int = this._unrenderedItems.length;\n\t\t\tfor(var i:int = 0; i < rendererCount; i += 3)\n\t\t\t{\n\t\t\t\tvar groupIndex:int = this._unrenderedItems.shift();\n\t\t\t\tvar itemIndex:int = this._unrenderedItems.shift();\n\t\t\t\tvar layoutIndex:int = this._unrenderedItems.shift();\n\t\t\t\tLOCATION_HELPER_VECTOR[0] = groupIndex;\n\t\t\t\tLOCATION_HELPER_VECTOR[1] = itemIndex;\n\t\t\t\tvar item:Object = this._dataProvider.getItemAtLocation(LOCATION_HELPER_VECTOR);\n\t\t\t\tvar itemRenderer:IGroupedListItemRenderer = this.createItemRenderer(\n\t\t\t\t\titem, groupIndex, itemIndex, layoutIndex, true, false);\n\t\t\t\tthis._layoutItems[layoutIndex] = DisplayObject(itemRenderer);\n\t\t\t}\n\n\t\t\tLOCATION_HELPER_VECTOR.length = 1;\n\t\t\trendererCount = this._unrenderedHeaders.length;\n\t\t\tfor(i = 0; i < rendererCount; i += 2)\n\t\t\t{\n\t\t\t\tgroupIndex = this._unrenderedHeaders.shift();\n\t\t\t\tlayoutIndex = this._unrenderedHeaders.shift();\n\t\t\t\tLOCATION_HELPER_VECTOR[0] = groupIndex;\n\t\t\t\titem = this._dataProvider.getItemAtLocation(LOCATION_HELPER_VECTOR);\n\t\t\t\titem = this._owner.groupToHeaderData(item);\n\t\t\t\tvar headerRenderer:IGroupedListHeaderRenderer = this.createHeaderRenderer(item, groupIndex, layoutIndex, false);\n\t\t\t\tthis._layoutItems[layoutIndex] = DisplayObject(headerRenderer);\n\t\t\t}\n\n\t\t\trendererCount = this._unrenderedFooters.length;\n\t\t\tfor(i = 0; i < rendererCount; i += 2)\n\t\t\t{\n\t\t\t\tgroupIndex = this._unrenderedFooters.shift();\n\t\t\t\tlayoutIndex = this._unrenderedFooters.shift();\n\t\t\t\tLOCATION_HELPER_VECTOR[0] = groupIndex;\n\t\t\t\titem = this._dataProvider.getItemAtLocation(LOCATION_HELPER_VECTOR);\n\t\t\t\titem = this._owner.groupToFooterData(item);\n\t\t\t\tvar footerRenderer:IGroupedListFooterRenderer = this.createFooterRenderer(item, groupIndex, layoutIndex, false);\n\t\t\t\tthis._layoutItems[layoutIndex] = DisplayObject(footerRenderer);\n\t\t\t}\n\t\t\tLOCATION_HELPER_VECTOR.length = 0;\n\t\t}\n\n\t\tprivate function recoverInactiveItemRenderers(storage:ItemRendererFactoryStorage):void\n\t\t{\n\t\t\tvar inactiveItemRenderers:Vector.<IGroupedListItemRenderer> = storage.inactiveItemRenderers;\n\t\t\tvar rendererCount:int = inactiveItemRenderers.length;\n\t\t\tfor(var i:int = 0; i < rendererCount; i++)\n\t\t\t{\n\t\t\t\tvar itemRenderer:IGroupedListItemRenderer = inactiveItemRenderers[i];\n\t\t\t\tif(!itemRenderer || itemRenderer.groupIndex < 0)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tthis._owner.dispatchEventWith(FeathersEventType.RENDERER_REMOVE, false, itemRenderer);\n\t\t\t\tvar item:Object = itemRenderer.data;\n\t\t\t\tif(item is XML || item is XMLList)\n\t\t\t\t{\n\t\t\t\t\tdelete this._itemRendererMap[item.toXMLString()];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tdelete this._itemRendererMap[item];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function recoverInactiveHeaderRenderers(storage:HeaderRendererFactoryStorage):void\n\t\t{\n\t\t\tvar inactiveHeaderRenderers:Vector.<IGroupedListHeaderRenderer> = storage.inactiveHeaderRenderers;\n\t\t\tvar headerRendererCount:int = inactiveHeaderRenderers.length;\n\t\t\tfor(var i:int = 0; i < headerRendererCount; i++)\n\t\t\t{\n\t\t\t\tvar headerRenderer:IGroupedListHeaderRenderer = inactiveHeaderRenderers[i];\n\t\t\t\tif(!headerRenderer)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tthis._owner.dispatchEventWith(FeathersEventType.RENDERER_REMOVE, false, headerRenderer);\n\t\t\t\tvar headerData:Object = headerRenderer.data;\n\t\t\t\tif(headerData is XML || headerData is XMLList)\n\t\t\t\t{\n\t\t\t\t\tdelete this._headerRendererMap[headerData.toXMLString()];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tdelete this._headerRendererMap[headerData];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function recoverInactiveFooterRenderers(storage:FooterRendererFactoryStorage):void\n\t\t{\n\t\t\tvar inactiveFooterRenderers:Vector.<IGroupedListFooterRenderer> = storage.inactiveFooterRenderers;\n\t\t\tvar footerRendererCount:int = inactiveFooterRenderers.length;\n\t\t\tfor(var i:int = 0; i < footerRendererCount; i++)\n\t\t\t{\n\t\t\t\tvar footerRenderer:IGroupedListFooterRenderer = inactiveFooterRenderers[i];\n\t\t\t\tif(!footerRenderer)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tthis._owner.dispatchEventWith(FeathersEventType.RENDERER_REMOVE, false, footerRenderer);\n\t\t\t\tvar footerData:Object = footerRenderer.data;\n\t\t\t\tif(footerData is XML || footerData is XMLList)\n\t\t\t\t{\n\t\t\t\t\tdelete this._footerRendererMap[footerData.toXMLString()];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tdelete this._footerRendererMap[footerData];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function freeInactiveItemRenderers(storage:ItemRendererFactoryStorage, minimumItemCount:int):void\n\t\t{\n\t\t\tvar inactiveItemRenderers:Vector.<IGroupedListItemRenderer> = storage.inactiveItemRenderers;\n\t\t\tvar activeItemRenderers:Vector.<IGroupedListItemRenderer> = storage.activeItemRenderers;\n\t\t\tvar activeItemRenderersCount:int = activeItemRenderers.length;\n\n\t\t\t//we may keep around some extra renderers to avoid too much\n\t\t\t//allocation and garbage collection. they'll be hidden.\n\t\t\tvar keepCount:int = minimumItemCount - activeItemRenderersCount;\n\t\t\tif(keepCount > inactiveItemRenderers.length)\n\t\t\t{\n\t\t\t\tkeepCount = inactiveItemRenderers.length;\n\t\t\t}\n\t\t\tfor(var i:int = 0; i < keepCount; i++)\n\t\t\t{\n\t\t\t\tvar itemRenderer:IGroupedListItemRenderer = inactiveItemRenderers.shift();\n\t\t\t\titemRenderer.data = null;\n\t\t\t\titemRenderer.groupIndex = -1;\n\t\t\t\titemRenderer.itemIndex = -1;\n\t\t\t\titemRenderer.layoutIndex = -1;\n\t\t\t\titemRenderer.visible = false;\n\t\t\t\tactiveItemRenderers[activeItemRenderersCount] = itemRenderer;\n\t\t\t\tactiveItemRenderersCount++;\n\t\t\t}\n\t\t\tvar rendererCount:int = inactiveItemRenderers.length;\n\t\t\tfor(i = 0; i < rendererCount; i++)\n\t\t\t{\n\t\t\t\titemRenderer = inactiveItemRenderers.shift();\n\t\t\t\tif(!itemRenderer)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tthis.destroyItemRenderer(itemRenderer);\n\t\t\t}\n\t\t}\n\n\t\tprivate function freeInactiveHeaderRenderers(storage:HeaderRendererFactoryStorage, minimumHeaderCount:int):void\n\t\t{\n\t\t\tvar inactiveHeaderRenderers:Vector.<IGroupedListHeaderRenderer> = storage.inactiveHeaderRenderers;\n\t\t\tvar activeHeaderRenderers:Vector.<IGroupedListHeaderRenderer> = storage.activeHeaderRenderers;\n\t\t\tvar activeHeaderRenderersCount:int = activeHeaderRenderers.length;\n\n\t\t\tvar keepCount:int = minimumHeaderCount - activeHeaderRenderersCount;\n\t\t\tif(keepCount > inactiveHeaderRenderers.length)\n\t\t\t{\n\t\t\t\tkeepCount = inactiveHeaderRenderers.length;\n\t\t\t}\n\t\t\tfor(var i:int = 0; i < keepCount; i++)\n\t\t\t{\n\t\t\t\tvar headerRenderer:IGroupedListHeaderRenderer = inactiveHeaderRenderers.shift();\n\t\t\t\theaderRenderer.visible = false;\n\t\t\t\theaderRenderer.data = null;\n\t\t\t\theaderRenderer.groupIndex = -1;\n\t\t\t\theaderRenderer.layoutIndex = -1;\n\t\t\t\tactiveHeaderRenderers[activeHeaderRenderersCount] = headerRenderer;\n\t\t\t\tactiveHeaderRenderersCount++;\n\t\t\t}\n\t\t\tvar inactiveHeaderRendererCount:int = inactiveHeaderRenderers.length;\n\t\t\tfor(i = 0; i < inactiveHeaderRendererCount; i++)\n\t\t\t{\n\t\t\t\theaderRenderer = inactiveHeaderRenderers.shift();\n\t\t\t\tif(!headerRenderer)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tthis.destroyHeaderRenderer(headerRenderer);\n\t\t\t}\n\t\t}\n\n\t\tprivate function freeInactiveFooterRenderers(storage:FooterRendererFactoryStorage, minimumFooterCount:int):void\n\t\t{\n\t\t\tvar inactiveFooterRenderers:Vector.<IGroupedListFooterRenderer> = storage.inactiveFooterRenderers;\n\t\t\tvar activeFooterRenderers:Vector.<IGroupedListFooterRenderer> = storage.activeFooterRenderers;\n\t\t\tvar activeFooterRenderersCount:int = activeFooterRenderers.length;\n\n\t\t\tvar keepCount:int = minimumFooterCount - activeFooterRenderersCount;\n\t\t\tif(keepCount > inactiveFooterRenderers.length)\n\t\t\t{\n\t\t\t\tkeepCount = inactiveFooterRenderers.length;\n\t\t\t}\n\t\t\tfor(var i:int = 0; i < keepCount; i++)\n\t\t\t{\n\t\t\t\tvar footerRenderer:IGroupedListFooterRenderer = inactiveFooterRenderers.shift();\n\t\t\t\tfooterRenderer.visible = false;\n\t\t\t\tfooterRenderer.data = null;\n\t\t\t\tfooterRenderer.groupIndex = -1;\n\t\t\t\tfooterRenderer.layoutIndex = -1;\n\t\t\t\tactiveFooterRenderers[activeFooterRenderersCount] = footerRenderer;\n\t\t\t\tactiveFooterRenderersCount++;\n\t\t\t}\n\t\t\tvar inactiveFooterRendererCount:int = inactiveFooterRenderers.length;\n\t\t\tfor(i = 0; i < inactiveFooterRendererCount; i++)\n\t\t\t{\n\t\t\t\tfooterRenderer = inactiveFooterRenderers.shift();\n\t\t\t\tif(!footerRenderer)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tthis.destroyFooterRenderer(footerRenderer);\n\t\t\t}\n\t\t}\n\n\t\tprivate function createItemRenderer(item:Object, groupIndex:int, itemIndex:int,\n\t\t\tlayoutIndex:int, useCache:Boolean, isTemporary:Boolean):IGroupedListItemRenderer\n\t\t{\n\t\t\tvar factoryID:String = this.getFactoryID(item, groupIndex, itemIndex);\n\t\t\tvar itemRendererFactory:Function = this.factoryIDToFactory(factoryID, groupIndex, itemIndex);\n\t\t\tvar storage:ItemRendererFactoryStorage = this.factoryIDToStorage(factoryID, groupIndex, itemIndex);\n\t\t\tvar customStyleName:String = this.indexToCustomStyleName(groupIndex, itemIndex);\n\t\t\tvar inactiveItemRenderers:Vector.<IGroupedListItemRenderer> = storage.inactiveItemRenderers;\n\t\t\tvar activeItemRenderers:Vector.<IGroupedListItemRenderer> = storage.activeItemRenderers;\n\t\t\tif(!useCache || isTemporary || inactiveItemRenderers.length == 0)\n\t\t\t{\n\t\t\t\tvar itemRenderer:IGroupedListItemRenderer;\n\t\t\t\tif(itemRendererFactory !== null)\n\t\t\t\t{\n\t\t\t\t\titemRenderer = IGroupedListItemRenderer(itemRendererFactory());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar ItemRendererType:Class = this.indexToItemRendererType(groupIndex, itemIndex);\n\t\t\t\t\titemRenderer = IGroupedListItemRenderer(new ItemRendererType());\n\t\t\t\t}\n\t\t\t\tvar uiRenderer:IFeathersControl = IFeathersControl(itemRenderer);\n\t\t\t\tif(customStyleName && customStyleName.length > 0)\n\t\t\t\t{\n\t\t\t\t\tuiRenderer.styleNameList.add(customStyleName);\n\t\t\t\t}\n\t\t\t\tthis.addChild(DisplayObject(itemRenderer));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\titemRenderer = inactiveItemRenderers.shift();\n\t\t\t}\n\t\t\titemRenderer.data = item;\n\t\t\titemRenderer.groupIndex = groupIndex;\n\t\t\titemRenderer.itemIndex = itemIndex;\n\t\t\titemRenderer.layoutIndex = layoutIndex;\n\t\t\titemRenderer.owner = this._owner;\n\t\t\titemRenderer.factoryID = factoryID;\n\t\t\titemRenderer.visible = true;\n\n\t\t\tif(!isTemporary)\n\t\t\t{\n\t\t\t\tif(item is XML || item is XMLList)\n\t\t\t\t{\n\t\t\t\t\tthis._itemRendererMap[item.toXMLString()] = itemRenderer;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._itemRendererMap[item] = itemRenderer;\n\t\t\t\t}\n\t\t\t\tactiveItemRenderers.push(itemRenderer);\n\t\t\t\titemRenderer.addEventListener(Event.TRIGGERED, renderer_triggeredHandler);\n\t\t\t\titemRenderer.addEventListener(Event.CHANGE, renderer_changeHandler);\n\t\t\t\titemRenderer.addEventListener(FeathersEventType.RESIZE, itemRenderer_resizeHandler);\n\t\t\t\tthis._owner.dispatchEventWith(FeathersEventType.RENDERER_ADD, false, itemRenderer);\n\t\t\t}\n\n\t\t\treturn itemRenderer;\n\t\t}\n\n\t\tprivate function createHeaderRenderer(header:Object, groupIndex:int, layoutIndex:int, isTemporary:Boolean = false):IGroupedListHeaderRenderer\n\t\t{\n\t\t\tvar factoryID:String = this.getHeaderFactoryID(header, groupIndex);\n\t\t\tvar headerRendererFactory:Function = this.headerFactoryIDToFactory(factoryID);\n\t\t\tvar storage:HeaderRendererFactoryStorage = this.headerFactoryIDToStorage(factoryID);\n\t\t\tvar inactiveHeaderRenderers:Vector.<IGroupedListHeaderRenderer> = storage.inactiveHeaderRenderers;\n\t\t\tvar activeHeaderRenderers:Vector.<IGroupedListHeaderRenderer> = storage.activeHeaderRenderers;\n\t\t\tif(isTemporary || inactiveHeaderRenderers.length == 0)\n\t\t\t{\n\t\t\t\tvar headerRenderer:IGroupedListHeaderRenderer;\n\t\t\t\tif(headerRendererFactory !== null)\n\t\t\t\t{\n\t\t\t\t\theaderRenderer = IGroupedListHeaderRenderer(headerRendererFactory());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\theaderRenderer = IGroupedListHeaderRenderer(new this._headerRendererType());\n\t\t\t\t}\n\t\t\t\tvar uiRenderer:IFeathersControl = IFeathersControl(headerRenderer);\n\t\t\t\tif(this._customHeaderRendererStyleName && this._customHeaderRendererStyleName.length > 0)\n\t\t\t\t{\n\t\t\t\t\tuiRenderer.styleNameList.add(this._customHeaderRendererStyleName);\n\t\t\t\t}\n\t\t\t\tthis.addChild(DisplayObject(headerRenderer));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\theaderRenderer = inactiveHeaderRenderers.shift();\n\t\t\t}\n\t\t\theaderRenderer.data = header;\n\t\t\theaderRenderer.groupIndex = groupIndex;\n\t\t\theaderRenderer.layoutIndex = layoutIndex;\n\t\t\theaderRenderer.owner = this._owner;\n\t\t\theaderRenderer.factoryID = factoryID;\n\t\t\theaderRenderer.visible = true;\n\n\t\t\tif(!isTemporary)\n\t\t\t{\n\t\t\t\tif(header is XML || header is XMLList)\n\t\t\t\t{\n\t\t\t\t\tthis._headerRendererMap[header.toXMLString()] = headerRenderer;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._headerRendererMap[header] = headerRenderer;\n\t\t\t\t}\n\t\t\t\tactiveHeaderRenderers.push(headerRenderer);\n\t\t\t\theaderRenderer.addEventListener(FeathersEventType.RESIZE, headerRenderer_resizeHandler);\n\t\t\t\tthis._owner.dispatchEventWith(FeathersEventType.RENDERER_ADD, false, headerRenderer);\n\t\t\t}\n\n\t\t\treturn headerRenderer;\n\t\t}\n\n\t\tprivate function createFooterRenderer(footer:Object, groupIndex:int, layoutIndex:int, isTemporary:Boolean = false):IGroupedListFooterRenderer\n\t\t{\n\t\t\tvar factoryID:String = this.getFooterFactoryID(footer, groupIndex);\n\t\t\tvar footerRendererFactory:Function = this.footerFactoryIDToFactory(factoryID);\n\t\t\tvar storage:FooterRendererFactoryStorage = this.footerFactoryIDToStorage(factoryID);\n\t\t\tvar inactiveFooterRenderers:Vector.<IGroupedListFooterRenderer> = storage.inactiveFooterRenderers;\n\t\t\tvar activeFooterRenderers:Vector.<IGroupedListFooterRenderer> = storage.activeFooterRenderers;\n\t\t\tif(isTemporary || inactiveFooterRenderers.length == 0)\n\t\t\t{\n\t\t\t\tvar footerRenderer:IGroupedListFooterRenderer;\n\t\t\t\tif(footerRendererFactory !== null)\n\t\t\t\t{\n\t\t\t\t\tfooterRenderer = IGroupedListFooterRenderer(footerRendererFactory());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tfooterRenderer = IGroupedListFooterRenderer(new this._footerRendererType());\n\t\t\t\t}\n\t\t\t\tvar uiRenderer:IFeathersControl = IFeathersControl(footerRenderer);\n\t\t\t\tif(this._customFooterRendererStyleName && this._customFooterRendererStyleName.length > 0)\n\t\t\t\t{\n\t\t\t\t\tuiRenderer.styleNameList.add(this._customFooterRendererStyleName);\n\t\t\t\t}\n\t\t\t\tthis.addChild(DisplayObject(footerRenderer));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfooterRenderer = inactiveFooterRenderers.shift();\n\t\t\t}\n\t\t\tfooterRenderer.data = footer;\n\t\t\tfooterRenderer.groupIndex = groupIndex;\n\t\t\tfooterRenderer.layoutIndex = layoutIndex;\n\t\t\tfooterRenderer.owner = this._owner;\n\t\t\tfooterRenderer.factoryID = factoryID;\n\t\t\tfooterRenderer.visible = true;\n\n\t\t\tif(!isTemporary)\n\t\t\t{\n\t\t\t\tif(footer is XML || footer is XMLList)\n\t\t\t\t{\n\t\t\t\t\tthis._footerRendererMap[footer.toXMLString()] = footerRenderer;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._footerRendererMap[footer] = footerRenderer;\n\t\t\t\t}\n\t\t\t\tactiveFooterRenderers[activeFooterRenderers.length] = footerRenderer;\n\t\t\t\tfooterRenderer.addEventListener(FeathersEventType.RESIZE, footerRenderer_resizeHandler);\n\t\t\t\tthis._owner.dispatchEventWith(FeathersEventType.RENDERER_ADD, false, footerRenderer);\n\t\t\t}\n\n\t\t\treturn footerRenderer;\n\t\t}\n\n\t\tprivate function destroyItemRenderer(renderer:IGroupedListItemRenderer):void\n\t\t{\n\t\t\trenderer.removeEventListener(Event.TRIGGERED, renderer_triggeredHandler);\n\t\t\trenderer.removeEventListener(Event.CHANGE, renderer_changeHandler);\n\t\t\trenderer.removeEventListener(FeathersEventType.RESIZE, itemRenderer_resizeHandler);\n\t\t\trenderer.owner = null;\n\t\t\trenderer.data = null;\n\t\t\tthis.removeChild(DisplayObject(renderer), true);\n\t\t}\n\n\t\tprivate function destroyHeaderRenderer(renderer:IGroupedListHeaderRenderer):void\n\t\t{\n\t\t\trenderer.removeEventListener(FeathersEventType.RESIZE, headerRenderer_resizeHandler);\n\t\t\trenderer.owner = null;\n\t\t\trenderer.data = null;\n\t\t\tthis.removeChild(DisplayObject(renderer), true);\n\t\t}\n\n\t\tprivate function destroyFooterRenderer(renderer:IGroupedListFooterRenderer):void\n\t\t{\n\t\t\trenderer.removeEventListener(FeathersEventType.RESIZE, footerRenderer_resizeHandler);\n\t\t\trenderer.owner = null;\n\t\t\trenderer.data = null;\n\t\t\tthis.removeChild(DisplayObject(renderer), true);\n\t\t}\n\n\t\tprivate function groupToHeaderDisplayIndex(groupIndex:int):int\n\t\t{\n\t\t\tLOCATION_HELPER_VECTOR.length = 1;\n\t\t\tLOCATION_HELPER_VECTOR[0] = groupIndex;\n\t\t\tvar group:Object = this._dataProvider.getItemAtLocation(LOCATION_HELPER_VECTOR);\n\t\t\tvar header:Object = this._owner.groupToHeaderData(group);\n\t\t\tif(!header)\n\t\t\t{\n\t\t\t\tLOCATION_HELPER_VECTOR.length = 0;\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tLOCATION_HELPER_VECTOR.length = 1;\n\t\t\tvar displayIndex:int = 0;\n\t\t\tvar groupCount:int = this._dataProvider.getLengthAtLocation();\n\t\t\tfor(var i:int = 0; i < groupCount; i++)\n\t\t\t{\n\t\t\t\tLOCATION_HELPER_VECTOR[0] = i;\n\t\t\t\tgroup = this._dataProvider.getItemAtLocation(LOCATION_HELPER_VECTOR);\n\t\t\t\theader = this._owner.groupToHeaderData(group);\n\t\t\t\tif(header)\n\t\t\t\t{\n\t\t\t\t\tif(groupIndex == i)\n\t\t\t\t\t{\n\t\t\t\t\t\tLOCATION_HELPER_VECTOR.length = 0;\n\t\t\t\t\t\treturn displayIndex;\n\t\t\t\t\t}\n\t\t\t\t\tdisplayIndex++;\n\t\t\t\t}\n\t\t\t\tvar groupLength:int = this._dataProvider.getLengthAtLocation(LOCATION_HELPER_VECTOR);\n\t\t\t\tfor(var j:int = 0; j < groupLength; j++)\n\t\t\t\t{\n\t\t\t\t\tdisplayIndex++;\n\t\t\t\t}\n\t\t\t\tvar footer:Object = this._owner.groupToFooterData(group);\n\t\t\t\tif(footer)\n\t\t\t\t{\n\t\t\t\t\tdisplayIndex++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tLOCATION_HELPER_VECTOR.length = 0;\n\t\t\treturn -1;\n\t\t}\n\n\t\tprivate function groupToFooterDisplayIndex(groupIndex:int):int\n\t\t{\n\t\t\tLOCATION_HELPER_VECTOR.length = 1;\n\t\t\tLOCATION_HELPER_VECTOR[0] = groupIndex;\n\t\t\tvar group:Object = this._dataProvider.getItemAtLocation(LOCATION_HELPER_VECTOR);\n\t\t\tvar footer:Object = this._owner.groupToFooterData(group);\n\t\t\tif(!footer)\n\t\t\t{\n\t\t\t\tLOCATION_HELPER_VECTOR.length = 0;\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tLOCATION_HELPER_VECTOR.length = 1;\n\t\t\tvar displayIndex:int = 0;\n\t\t\tvar groupCount:int = this._dataProvider.getLengthAtLocation();\n\t\t\tfor(var i:int = 0; i < groupCount; i++)\n\t\t\t{\n\t\t\t\tLOCATION_HELPER_VECTOR[0] = i;\n\t\t\t\tgroup = this._dataProvider.getItemAtLocation(LOCATION_HELPER_VECTOR);\n\t\t\t\tvar header:Object = this._owner.groupToHeaderData(group);\n\t\t\t\tif(header)\n\t\t\t\t{\n\t\t\t\t\tdisplayIndex++;\n\t\t\t\t}\n\t\t\t\tvar groupLength:int = this._dataProvider.getLengthAtLocation(LOCATION_HELPER_VECTOR);\n\t\t\t\tfor(var j:int = 0; j < groupLength; j++)\n\t\t\t\t{\n\t\t\t\t\tdisplayIndex++;\n\t\t\t\t}\n\t\t\t\tfooter = this._owner.groupToFooterData(group);\n\t\t\t\tif(footer)\n\t\t\t\t{\n\t\t\t\t\tif(groupIndex == i)\n\t\t\t\t\t{\n\t\t\t\t\t\tLOCATION_HELPER_VECTOR.length = 0;\n\t\t\t\t\t\treturn displayIndex;\n\t\t\t\t\t}\n\t\t\t\t\tdisplayIndex++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tLOCATION_HELPER_VECTOR.length = 0;\n\t\t\treturn -1;\n\t\t}\n\n\t\tprivate function displayIndexToLocation(displayIndex:int, result:Vector.<int>):void\n\t\t{\n\t\t\tresult.length = 2;\n\t\t\tLOCATION_HELPER_VECTOR.length = 1;\n\t\t\tvar totalCount:int = 0;\n\t\t\tvar groupCount:int = this._dataProvider.getLengthAtLocation();\n\t\t\tfor(var i:int = 0; i < groupCount; i++)\n\t\t\t{\n\t\t\t\tLOCATION_HELPER_VECTOR[0] = i;\n\t\t\t\tvar group:Object = this._dataProvider.getItemAtLocation(LOCATION_HELPER_VECTOR);\n\t\t\t\tvar header:Object = this._owner.groupToHeaderData(group);\n\t\t\t\tif(header !== null)\n\t\t\t\t{\n\t\t\t\t\ttotalCount++;\n\t\t\t\t}\n\t\t\t\tvar groupLength:int = this._dataProvider.getLengthAtLocation(LOCATION_HELPER_VECTOR);\n\t\t\t\ttotalCount += groupLength;\n\t\t\t\tif(totalCount > displayIndex)\n\t\t\t\t{\n\t\t\t\t\tvar itemIndex:int = displayIndex - (totalCount - groupLength);\n\t\t\t\t\tif(itemIndex == -1)\n\t\t\t\t\t{\n\t\t\t\t\t\tresult[0] = -1;\n\t\t\t\t\t\tresult[1] = -1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tresult[0] = i;\n\t\t\t\t\t\tresult[1] = itemIndex;\n\t\t\t\t\t}\n\t\t\t\t\tLOCATION_HELPER_VECTOR.length = 0;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar footer:Object = this._owner.groupToFooterData(group);\n\t\t\t\tif(footer !== null)\n\t\t\t\t{\n\t\t\t\t\ttotalCount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//we didn't find it!\n\t\t\tresult[0] = -1;\n\t\t\tresult[1] = -1;\n\t\t\tLOCATION_HELPER_VECTOR.length = 0;\n\t\t}\n\n\t\tprivate function locationToDisplayIndex(groupIndex:int, itemIndex:int):int\n\t\t{\n\t\t\tLOCATION_HELPER_VECTOR.length = 1;\n\t\t\tvar displayIndex:int = 0;\n\t\t\tvar groupCount:int = this._dataProvider.getLengthAtLocation();\n\t\t\tfor(var i:int = 0; i < groupCount; i++)\n\t\t\t{\n\t\t\t\tif(itemIndex < 0 && groupIndex == i)\n\t\t\t\t{\n\t\t\t\t\tLOCATION_HELPER_VECTOR.length = 0;\n\t\t\t\t\treturn displayIndex;\n\t\t\t\t}\n\t\t\t\tLOCATION_HELPER_VECTOR[0] = i;\n\t\t\t\tvar group:Object = this._dataProvider.getItemAtLocation(LOCATION_HELPER_VECTOR);\n\t\t\t\tvar header:Object = this._owner.groupToHeaderData(group);\n\t\t\t\tif(header)\n\t\t\t\t{\n\t\t\t\t\tdisplayIndex++;\n\t\t\t\t}\n\t\t\t\tvar groupLength:int = this._dataProvider.getLengthAtLocation(LOCATION_HELPER_VECTOR);\n\t\t\t\tfor(var j:int = 0; j < groupLength; j++)\n\t\t\t\t{\n\t\t\t\t\tif(groupIndex == i && itemIndex == j)\n\t\t\t\t\t{\n\t\t\t\t\t\tLOCATION_HELPER_VECTOR.length = 0;\n\t\t\t\t\t\treturn displayIndex;\n\t\t\t\t\t}\n\t\t\t\t\tdisplayIndex++;\n\t\t\t\t}\n\t\t\t\tvar footer:Object = this._owner.groupToFooterData(group);\n\t\t\t\tif(footer)\n\t\t\t\t{\n\t\t\t\t\tdisplayIndex++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tLOCATION_HELPER_VECTOR.length = 0;\n\t\t\treturn -1;\n\t\t}\n\n\t\tprivate function indexToItemRendererType(groupIndex:int, itemIndex:int):Class\n\t\t{\n\t\t\tvar groupLength:int = 0;\n\t\t\tif(this._dataProvider !== null && this._dataProvider.getLengthAtLocation() > 0)\n\t\t\t{\n\t\t\t\tLOCATION_HELPER_VECTOR.length = 1;\n\t\t\t\tLOCATION_HELPER_VECTOR[0] = groupIndex;\n\t\t\t\tgroupLength = this._dataProvider.getLengthAtLocation(LOCATION_HELPER_VECTOR);\n\t\t\t\tLOCATION_HELPER_VECTOR.length = 0;\n\t\t\t}\n\t\t\tif(itemIndex == 0)\n\t\t\t{\n\t\t\t\tif(this._singleItemRendererType !== null && groupLength == 1)\n\t\t\t\t{\n\t\t\t\t\treturn this._singleItemRendererType;\n\t\t\t\t}\n\t\t\t\telse if(this._firstItemRendererType !== null)\n\t\t\t\t{\n\t\t\t\t\treturn this._firstItemRendererType;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._lastItemRendererType !== null && itemIndex == (groupLength - 1))\n\t\t\t{\n\t\t\t\treturn this._lastItemRendererType;\n\t\t\t}\n\t\t\treturn this._itemRendererType;\n\t\t}\n\n\t\tprivate function indexToCustomStyleName(groupIndex:int, itemIndex:int):String\n\t\t{\n\t\t\tvar groupLength:int = 0;\n\t\t\tif(this._dataProvider !== null && this._dataProvider.getLengthAtLocation() > 0)\n\t\t\t{\n\t\t\t\tLOCATION_HELPER_VECTOR.length = 1;\n\t\t\t\tLOCATION_HELPER_VECTOR[0] = groupIndex;\n\t\t\t\tgroupLength = this._dataProvider.getLengthAtLocation(LOCATION_HELPER_VECTOR);\n\t\t\t\tLOCATION_HELPER_VECTOR.length = 0;\n\t\t\t}\n\t\t\tif(itemIndex == 0)\n\t\t\t{\n\t\t\t\tif(this._customSingleItemRendererStyleName !== null && groupLength == 1)\n\t\t\t\t{\n\t\t\t\t\treturn this._customSingleItemRendererStyleName;\n\t\t\t\t}\n\t\t\t\telse if(this._customFirstItemRendererStyleName !== null)\n\t\t\t\t{\n\t\t\t\t\treturn this._customFirstItemRendererStyleName;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._customLastItemRendererStyleName !== null && itemIndex == (groupLength - 1))\n\t\t\t{\n\t\t\t\treturn this._customLastItemRendererStyleName;\n\t\t\t}\n\t\t\treturn this._customItemRendererStyleName;\n\t\t}\n\n\t\tprivate function getFactoryID(item:Object, groupIndex:int, itemIndex:int):String\n\t\t{\n\t\t\tvar factoryID:String = null;\n\t\t\tif(this._factoryIDFunction !== null)\n\t\t\t{\n\t\t\t\tif(this._factoryIDFunction.length == 1)\n\t\t\t\t{\n\t\t\t\t\tfactoryID = this._factoryIDFunction(item);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tfactoryID = this._factoryIDFunction(item, groupIndex, itemIndex);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(factoryID !== null)\n\t\t\t{\n\t\t\t\treturn factoryID;\n\t\t\t}\n\t\t\tvar groupLength:int = 0;\n\t\t\tif(this._dataProvider !== null && this._dataProvider.getLengthAtLocation() > 0)\n\t\t\t{\n\t\t\t\tLOCATION_HELPER_VECTOR.length = 1;\n\t\t\t\tLOCATION_HELPER_VECTOR[0] = groupIndex;\n\t\t\t\tgroupLength = this._dataProvider.getLengthAtLocation(LOCATION_HELPER_VECTOR);\n\t\t\t\tLOCATION_HELPER_VECTOR.length = 0;\n\t\t\t}\n\t\t\tif(itemIndex == 0)\n\t\t\t{\n\t\t\t\tif((this._singleItemRendererType !== null ||\n\t\t\t\t\tthis._singleItemRendererFactory !== null ||\n\t\t\t\t\tthis._customSingleItemRendererStyleName !== null) &&\n\t\t\t\t\tgroupLength == 1)\n\t\t\t\t{\n\t\t\t\t\treturn SINGLE_ITEM_RENDERER_FACTORY_ID;\n\t\t\t\t}\n\t\t\t\telse if(this._firstItemRendererType !== null || this._firstItemRendererFactory !== null || this._customFirstItemRendererStyleName !== null)\n\t\t\t\t{\n\t\t\t\t\treturn FIRST_ITEM_RENDERER_FACTORY_ID;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif((this._lastItemRendererType !== null ||\n\t\t\t\tthis._lastItemRendererFactory !== null ||\n\t\t\t\tthis._customLastItemRendererStyleName !== null) &&\n\t\t\t\titemIndex == (groupLength - 1))\n\t\t\t{\n\t\t\t\treturn LAST_ITEM_RENDERER_FACTORY_ID;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tprivate function factoryIDToFactory(id:String, groupIndex:int, itemIndex:int):Function\n\t\t{\n\t\t\tif(id !== null)\n\t\t\t{\n\t\t\t\tif(id === FIRST_ITEM_RENDERER_FACTORY_ID)\n\t\t\t\t{\n\t\t\t\t\tif(this._firstItemRendererFactory !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn this._firstItemRendererFactory;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\treturn this._itemRendererFactory;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(id === LAST_ITEM_RENDERER_FACTORY_ID)\n\t\t\t\t{\n\t\t\t\t\tif(this._lastItemRendererFactory !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn this._lastItemRendererFactory;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\treturn this._itemRendererFactory;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(id === SINGLE_ITEM_RENDERER_FACTORY_ID)\n\t\t\t\t{\n\t\t\t\t\tif(this._singleItemRendererFactory !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn this._singleItemRendererFactory;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\treturn this._itemRendererFactory;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(id in this._itemRendererFactories)\n\t\t\t\t{\n\t\t\t\t\treturn this._itemRendererFactories[id] as Function;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthrow new ReferenceError(\"Cannot find item renderer factory for ID \\\"\" + id + \"\\\".\");\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this._itemRendererFactory;\n\t\t}\n\n\t\tprivate function factoryIDToStorage(id:String, groupIndex:int, itemIndex:int):ItemRendererFactoryStorage\n\t\t{\n\t\t\tif(id !== null)\n\t\t\t{\n\t\t\t\tif(id in this._itemStorageMap)\n\t\t\t\t{\n\t\t\t\t\treturn ItemRendererFactoryStorage(this._itemStorageMap[id]);\n\t\t\t\t}\n\t\t\t\tvar storage:ItemRendererFactoryStorage = new ItemRendererFactoryStorage();\n\t\t\t\tthis._itemStorageMap[id] = storage;\n\t\t\t\treturn storage;\n\t\t\t}\n\t\t\treturn this._defaultItemRendererStorage;\n\t\t}\n\n\t\tprivate function getHeaderFactoryID(header:Object, groupIndex:int):String\n\t\t{\n\t\t\tif(this._headerFactoryIDFunction === null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif(this._headerFactoryIDFunction.length == 1)\n\t\t\t{\n\t\t\t\treturn this._headerFactoryIDFunction(header);\n\t\t\t}\n\t\t\treturn this._headerFactoryIDFunction(header, groupIndex);\n\t\t}\n\n\t\tprivate function getFooterFactoryID(footer:Object, groupIndex:int):String\n\t\t{\n\t\t\tif(this._footerFactoryIDFunction === null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif(this._footerFactoryIDFunction.length == 1)\n\t\t\t{\n\t\t\t\treturn this._footerFactoryIDFunction(footer);\n\t\t\t}\n\t\t\treturn this._footerFactoryIDFunction(footer, groupIndex);\n\t\t}\n\n\t\tprivate function headerFactoryIDToFactory(id:String):Function\n\t\t{\n\t\t\tif(id !== null)\n\t\t\t{\n\t\t\t\tif(id in this._headerRendererFactories)\n\t\t\t\t{\n\t\t\t\t\treturn this._headerRendererFactories[id] as Function;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthrow new ReferenceError(\"Cannot find header renderer factory for ID \\\"\" + id + \"\\\".\");\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this._headerRendererFactory;\n\t\t}\n\n\t\tprivate function headerFactoryIDToStorage(id:String):HeaderRendererFactoryStorage\n\t\t{\n\t\t\tif(id !== null)\n\t\t\t{\n\t\t\t\tif(id in this._headerStorageMap)\n\t\t\t\t{\n\t\t\t\t\treturn HeaderRendererFactoryStorage(this._headerStorageMap[id]);\n\t\t\t\t}\n\t\t\t\tvar storage:HeaderRendererFactoryStorage = new HeaderRendererFactoryStorage();\n\t\t\t\tthis._headerStorageMap[id] = storage;\n\t\t\t\treturn storage;\n\t\t\t}\n\t\t\treturn this._defaultHeaderRendererStorage;\n\t\t}\n\n\t\tprivate function footerFactoryIDToFactory(id:String):Function\n\t\t{\n\t\t\tif(id !== null)\n\t\t\t{\n\t\t\t\tif(id in this._footerRendererFactories)\n\t\t\t\t{\n\t\t\t\t\treturn this._footerRendererFactories[id] as Function;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthrow new ReferenceError(\"Cannot find footer renderer factory for ID \\\"\" + id + \"\\\".\");\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this._footerRendererFactory;\n\t\t}\n\n\t\tprivate function footerFactoryIDToStorage(id:String):FooterRendererFactoryStorage\n\t\t{\n\t\t\tif(id !== null)\n\t\t\t{\n\t\t\t\tif(id in this._footerStorageMap)\n\t\t\t\t{\n\t\t\t\t\treturn FooterRendererFactoryStorage(this._footerStorageMap[id]);\n\t\t\t\t}\n\t\t\t\tvar storage:FooterRendererFactoryStorage = new FooterRendererFactoryStorage();\n\t\t\t\tthis._footerStorageMap[id] = storage;\n\t\t\t\treturn storage;\n\t\t\t}\n\t\t\treturn this._defaultFooterRendererStorage;\n\t\t}\n\n\t\tprivate function childProperties_onChange(proxy:PropertyProxy, name:String):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\tprivate function dataProvider_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\tprivate function dataProvider_addItemHandler(event:Event, indices:Array):void\n\t\t{\n\t\t\tvar layout:IVariableVirtualLayout = this._layout as IVariableVirtualLayout;\n\t\t\tif(!layout || !layout.hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar groupIndex:int = indices[0] as int;\n\t\t\tif(indices.length > 1) //adding an item\n\t\t\t{\n\t\t\t\tvar itemIndex:int = indices[1] as int;\n\t\t\t\tvar itemDisplayIndex:int = this.locationToDisplayIndex(groupIndex, itemIndex);\n\t\t\t\tlayout.addToVariableVirtualCacheAtIndex(itemDisplayIndex);\n\t\t\t}\n\t\t\telse //adding a whole group\n\t\t\t{\n\t\t\t\tvar headerDisplayIndex:int = this.groupToHeaderDisplayIndex(groupIndex);\n\t\t\t\tif(headerDisplayIndex >= 0)\n\t\t\t\t{\n\t\t\t\t\tlayout.addToVariableVirtualCacheAtIndex(headerDisplayIndex);\n\t\t\t\t}\n\t\t\t\tLOCATION_HELPER_VECTOR.length = 1;\n\t\t\t\tLOCATION_HELPER_VECTOR[0] = groupIndex;\n\t\t\t\tvar groupLength:int = this._dataProvider.getLengthAtLocation(LOCATION_HELPER_VECTOR);\n\t\t\t\tLOCATION_HELPER_VECTOR.length = 0;\n\t\t\t\tif(groupLength > 0)\n\t\t\t\t{\n\t\t\t\t\tvar displayIndex:int = headerDisplayIndex;\n\t\t\t\t\tif(displayIndex < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayIndex = this.locationToDisplayIndex(groupIndex, 0);\n\t\t\t\t\t}\n\t\t\t\t\tgroupLength += displayIndex;\n\t\t\t\t\tfor(var i:int = displayIndex; i < groupLength; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tlayout.addToVariableVirtualCacheAtIndex(displayIndex);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar footerDisplayIndex:int = this.groupToFooterDisplayIndex(groupIndex);\n\t\t\t\tif(footerDisplayIndex >= 0)\n\t\t\t\t{\n\t\t\t\t\tlayout.addToVariableVirtualCacheAtIndex(footerDisplayIndex);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function dataProvider_removeItemHandler(event:Event, indices:Array):void\n\t\t{\n\t\t\tvar layout:IVariableVirtualLayout = this._layout as IVariableVirtualLayout;\n\t\t\tif(!layout || !layout.hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar groupIndex:int = indices[0] as int;\n\t\t\tif(indices.length > 1) //removing an item\n\t\t\t{\n\t\t\t\tvar itemIndex:int = indices[1] as int;\n\t\t\t\tvar displayIndex:int = this.locationToDisplayIndex(groupIndex, itemIndex);\n\t\t\t\tlayout.removeFromVariableVirtualCacheAtIndex(displayIndex);\n\t\t\t}\n\t\t\telse //removing a whole group\n\t\t\t{\n\t\t\t\t//TODO: figure out the length of the previous group so that we\n\t\t\t\t//don't need to reset the whole cache\n\t\t\t\tlayout.resetVariableVirtualCache();\n\t\t\t}\n\t\t}\n\n\t\tprivate function dataProvider_replaceItemHandler(event:Event, indices:Array):void\n\t\t{\n\t\t\tvar layout:IVariableVirtualLayout = this._layout as IVariableVirtualLayout;\n\t\t\tif(!layout || !layout.hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar groupIndex:int = indices[0] as int;\n\t\t\tif(indices.length > 1) //replacing an item\n\t\t\t{\n\t\t\t\tvar itemIndex:int = indices[1] as int;\n\t\t\t\tvar displayIndex:int = this.locationToDisplayIndex(groupIndex, itemIndex);\n\t\t\t\tlayout.resetVariableVirtualCacheAtIndex(displayIndex);\n\t\t\t}\n\t\t\telse //replacing a whole group\n\t\t\t{\n\t\t\t\t//TODO: figure out the length of the previous group so that we\n\t\t\t\t//don't need to reset the whole cache\n\t\t\t\tlayout.resetVariableVirtualCache();\n\t\t\t}\n\t\t}\n\n\t\tprivate function dataProvider_resetHandler(event:Event):void\n\t\t{\n\t\t\tthis._updateForDataReset = true;\n\n\t\t\tvar layout:IVariableVirtualLayout = this._layout as IVariableVirtualLayout;\n\t\t\tif(!layout || !layout.hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlayout.resetVariableVirtualCache();\n\t\t}\n\n\t\tprivate function dataProvider_updateItemHandler(event:Event, indices:Array):void\n\t\t{\n\t\t\tvar groupIndex:int = indices[0] as int;\n\t\t\tif(indices.length > 1) //updating a single item\n\t\t\t{\n\t\t\t\tvar itemIndex:int = indices[1] as int;\n\t\t\t\tLOCATION_HELPER_VECTOR.length = 2;\n\t\t\t\tLOCATION_HELPER_VECTOR[0] = groupIndex;\n\t\t\t\tLOCATION_HELPER_VECTOR[1] = itemIndex;\n\t\t\t\tvar item:Object = this._dataProvider.getItemAtLocation(LOCATION_HELPER_VECTOR);\n\t\t\t\tLOCATION_HELPER_VECTOR.length = 0;\n\t\t\t\tvar itemRenderer:IGroupedListItemRenderer = this.itemToItemRenderer(item);\n\t\t\t\tif(itemRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\t//in order to display the same item with modified properties, this\n\t\t\t\t\t//hack tricks the item renderer into thinking that it has been given\n\t\t\t\t\t//a different item to render.\n\t\t\t\t\titemRenderer.data = null;\n\t\t\t\t\titemRenderer.data = item;\n\t\t\t\t\tif(this._explicitVisibleWidth !== this._explicitVisibleWidth || //isNaN\n\t\t\t\t\t\tthis._explicitVisibleHeight !== this._explicitVisibleHeight) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\t\t\tthis.invalidateParent(INVALIDATION_FLAG_SIZE);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //updating a whole group\n\t\t\t{\n\t\t\t\tLOCATION_HELPER_VECTOR.length = 1;\n\t\t\t\tLOCATION_HELPER_VECTOR[0] = groupIndex;\n\t\t\t\tvar groupLength:int = this._dataProvider.getLengthAtLocation(LOCATION_HELPER_VECTOR);\n\t\t\t\tLOCATION_HELPER_VECTOR.length = 2;\n\t\t\t\tfor(var i:int = 0; i < groupLength; i++)\n\t\t\t\t{\n\t\t\t\t\tLOCATION_HELPER_VECTOR[1] = i;\n\t\t\t\t\titem = this._dataProvider.getItemAtLocation(LOCATION_HELPER_VECTOR);\n\t\t\t\t\tif(item !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\titemRenderer = this.itemToItemRenderer(item);\n\t\t\t\t\t\tif(itemRenderer !== null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titemRenderer.data = null;\n\t\t\t\t\t\t\titemRenderer.data = item;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tLOCATION_HELPER_VECTOR.length = 1;\n\t\t\t\tvar group:Object = this._dataProvider.getItemAtLocation(LOCATION_HELPER_VECTOR);\n\t\t\t\tLOCATION_HELPER_VECTOR.length = 0;\n\t\t\t\titem = this._owner.groupToHeaderData(group);\n\t\t\t\tif(item)\n\t\t\t\t{\n\t\t\t\t\tvar headerRenderer:IGroupedListHeaderRenderer = this.headerDataToHeaderRenderer(item);\n\t\t\t\t\tif(headerRenderer)\n\t\t\t\t\t{\n\t\t\t\t\t\theaderRenderer.data = null;\n\t\t\t\t\t\theaderRenderer.data = item;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\titem = this._owner.groupToFooterData(group);\n\t\t\t\tif(item)\n\t\t\t\t{\n\t\t\t\t\tvar footerRenderer:IGroupedListFooterRenderer = this.footerDataToFooterRenderer(item);\n\t\t\t\t\tif(footerRenderer)\n\t\t\t\t\t{\n\t\t\t\t\t\tfooterRenderer.data = null;\n\t\t\t\t\t\tfooterRenderer.data = item;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//we need to invalidate because the group may have more or fewer items\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\n\t\t\t\tvar layout:IVariableVirtualLayout = this._layout as IVariableVirtualLayout;\n\t\t\t\tif(layout === null || !layout.hasVariableItemDimensions)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t//TODO: figure out the length of the previous group so that we\n\t\t\t\t//don't need to reset the whole cache\n\t\t\t\tlayout.resetVariableVirtualCache();\n\t\t\t}\n\t\t}\n\n\t\tprivate function dataProvider_updateAllHandler(event:Event):void\n\t\t{\n\t\t\t//we're treating this similar to the RESET event because enough\n\t\t\t//users are treating UPDATE_ALL similarly. technically, UPDATE_ALL\n\t\t\t//is supposed to affect only existing items, but it's confusing when\n\t\t\t//new items are added and not displayed.\n\t\t\tthis._updateForDataReset = true;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\n\t\t\tvar layout:IVariableVirtualLayout = this._layout as IVariableVirtualLayout;\n\t\t\tif(!layout || !layout.hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlayout.resetVariableVirtualCache();\n\t\t}\n\n\t\tprivate function layout_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreLayoutChanges)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t\tthis.invalidateParent(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\tprivate function itemRenderer_resizeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreRendererResizing)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(event.currentTarget === this._typicalItemRenderer && !this._typicalItemIsInDataProvider)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar renderer:IGroupedListItemRenderer = IGroupedListItemRenderer(event.currentTarget);\n\t\t\tif(renderer.layoutIndex < 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t\tthis.invalidateParent(INVALIDATION_FLAG_LAYOUT);\n\t\t\tvar layout:IVariableVirtualLayout = this._layout as IVariableVirtualLayout;\n\t\t\tif(!layout || !layout.hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlayout.resetVariableVirtualCacheAtIndex(renderer.layoutIndex, DisplayObject(renderer));\n\t\t}\n\n\t\tprivate function headerRenderer_resizeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreRendererResizing)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar renderer:IGroupedListHeaderRenderer = IGroupedListHeaderRenderer(event.currentTarget);\n\t\t\tif(renderer.layoutIndex < 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t\tthis.invalidateParent(INVALIDATION_FLAG_LAYOUT);\n\t\t\tvar layout:IVariableVirtualLayout = this._layout as IVariableVirtualLayout;\n\t\t\tif(!layout || !layout.hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlayout.resetVariableVirtualCacheAtIndex(renderer.layoutIndex, DisplayObject(renderer));\n\t\t}\n\n\t\tprivate function footerRenderer_resizeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreRendererResizing)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar renderer:IGroupedListFooterRenderer = IGroupedListFooterRenderer(event.currentTarget);\n\t\t\tif(renderer.layoutIndex < 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t\tthis.invalidateParent(INVALIDATION_FLAG_LAYOUT);\n\t\t\tvar layout:IVariableVirtualLayout = this._layout as IVariableVirtualLayout;\n\t\t\tif(!layout || !layout.hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlayout.resetVariableVirtualCacheAtIndex(renderer.layoutIndex, DisplayObject(renderer));\n\t\t}\n\n\t\tprivate function renderer_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tvar renderer:IGroupedListItemRenderer = IGroupedListItemRenderer(event.currentTarget);\n\t\t\tthis.parent.dispatchEventWith(Event.TRIGGERED, false, renderer.data);\n\t\t}\n\n\t\tprivate function renderer_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreSelectionChanges)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar renderer:IGroupedListItemRenderer = IGroupedListItemRenderer(event.currentTarget);\n\t\t\tif(!this._isSelectable || this._owner.isScrolling)\n\t\t\t{\n\t\t\t\trenderer.isSelected = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(renderer.isSelected)\n\t\t\t{\n\t\t\t\tthis.setSelectedLocation(renderer.groupIndex, renderer.itemIndex);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.setSelectedLocation(-1, -1);\n\t\t\t}\n\t\t}\n\t}\n}\n\nimport feathers.controls.renderers.IGroupedListFooterRenderer;\nimport feathers.controls.renderers.IGroupedListHeaderRenderer;\nimport feathers.controls.renderers.IGroupedListItemRenderer;\n\nclass ItemRendererFactoryStorage\n{\n\tpublic function ItemRendererFactoryStorage()\n\t{\n\n\t}\n\n\tpublic var activeItemRenderers:Vector.<IGroupedListItemRenderer> = new <IGroupedListItemRenderer>[];\n\tpublic var inactiveItemRenderers:Vector.<IGroupedListItemRenderer> = new <IGroupedListItemRenderer>[];\n}\n\nclass HeaderRendererFactoryStorage\n{\n\tpublic function HeaderRendererFactoryStorage()\n\t{\n\n\t}\n\n\tpublic var activeHeaderRenderers:Vector.<IGroupedListHeaderRenderer> = new <IGroupedListHeaderRenderer>[];\n\tpublic var inactiveHeaderRenderers:Vector.<IGroupedListHeaderRenderer> = new <IGroupedListHeaderRenderer>[];\n}\n\nclass FooterRendererFactoryStorage\n{\n\tpublic function FooterRendererFactoryStorage()\n\t{\n\n\t}\n\n\tpublic var activeFooterRenderers:Vector.<IGroupedListFooterRenderer> = new <IGroupedListFooterRenderer>[];\n\tpublic var inactiveFooterRenderers:Vector.<IGroupedListFooterRenderer> = new <IGroupedListFooterRenderer>[];\n}\n"
  },
  {
    "path": "source/feathers/controls/supportClasses/IScreenNavigatorItem.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.supportClasses\n{\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * @private\n\t * A simple interface for screen navigator items to be used by\n\t * <code>BaseScreenNavigator</code>.\n\t *\n\t * @see BaseScreenNavigator\n\t *\n\t * @productversion Feathers 2.1.0\n\t */\n\tpublic interface IScreenNavigatorItem\n\t{\n\t\t/**\n\t\t * An optional event that the screen will dispatch when it's ready for\n\t\t * the transition to start. If <code>null</code>, the transition will\n\t\t * start immediately.\n\t\t *\n\t\t * <p>Useful for loading assets or doing other long tasks to prepare\n\t\t * the screen before it is shown. It is recommended to display some\n\t\t * kind of progress indicator over the previous screen during this\n\t\t * delay to ensure that users don't get confused and think that the\n\t\t * app has frozen.</p>\n\t\t */\n\t\tfunction get transitionDelayEvent():String;\n\n\t\t/**\n\t\t * Determines if a display object returned by <code>getScreen()</code>\n\t\t * can be disposed or not when a screen is no longer active.\n\t\t *\n\t\t * @see #getScreen()\n\t\t */\n\t\tfunction get canDispose():Boolean;\n\n\t\t/**\n\t\t * Returns a display object instance of this screen.\n\t\t */\n\t\tfunction getScreen():DisplayObject;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/supportClasses/IViewPort.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.supportClasses\n{\n\timport feathers.core.IFeathersControl;\n\n\t/**\n\t * Interface used for the view port of scrolling containers.\n\t *\n\t * @see feathers.controls.Scroller\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic interface IViewPort extends IFeathersControl\n\t{\n\t\tfunction get visibleWidth():Number;\n\t\tfunction set visibleWidth(value:Number):void;\n\t\tfunction get minVisibleWidth():Number;\n\t\tfunction set minVisibleWidth(value:Number):void;\n\t\tfunction get maxVisibleWidth():Number;\n\t\tfunction set maxVisibleWidth(value:Number):void;\n\t\tfunction get visibleHeight():Number;\n\t\tfunction set visibleHeight(value:Number):void;\n\t\tfunction get minVisibleHeight():Number;\n\t\tfunction set minVisibleHeight(value:Number):void;\n\t\tfunction get maxVisibleHeight():Number;\n\t\tfunction set maxVisibleHeight(value:Number):void;\n\n\t\tfunction get contentX():Number;\n\t\tfunction get contentY():Number;\n\n\t\tfunction get horizontalScrollPosition():Number;\n\t\tfunction set horizontalScrollPosition(value:Number):void;\n\t\tfunction get verticalScrollPosition():Number;\n\t\tfunction set verticalScrollPosition(value:Number):void;\n\t\tfunction get horizontalScrollStep():Number;\n\t\tfunction get verticalScrollStep():Number;\n\n\t\tfunction get requiresMeasurementOnScroll():Boolean;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/supportClasses/LayoutViewPort.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.supportClasses\n{\n\timport feathers.controls.AutoSizeMode;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.core.IValidating;\n\timport feathers.layout.ILayoutDisplayObject;\n\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * @private\n\t * Used internally by ScrollContainer. Not meant to be used on its own.\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class LayoutViewPort extends LayoutGroup implements IViewPort\n\t{\n\t\tpublic function LayoutViewPort()\n\t\t{\n\t\t}\n\n\t\tprivate var _actualMinVisibleWidth:Number = 0;\n\n\t\tprivate var _explicitMinVisibleWidth:Number;\n\n\t\tpublic function get minVisibleWidth():Number\n\t\t{\n\t\t\tif(this._explicitMinVisibleWidth !== this._explicitMinVisibleWidth) //isNaN\n\t\t\t{\n\t\t\t\treturn this._actualMinVisibleWidth;\n\t\t\t}\n\t\t\treturn this._explicitMinVisibleWidth;\n\t\t}\n\n\t\tpublic function set minVisibleWidth(value:Number):void\n\t\t{\n\t\t\tif(this._explicitMinVisibleWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar valueIsNaN:Boolean = value !== value; //isNaN\n\t\t\tif(valueIsNaN &&\n\t\t\t\tthis._explicitMinVisibleWidth !== this._explicitMinVisibleWidth) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar oldValue:Number = this._explicitMinVisibleWidth;\n\t\t\tthis._explicitMinVisibleWidth = value;\n\t\t\tif(valueIsNaN)\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleWidth = 0;\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleWidth = value;\n\t\t\t\tif(this._explicitVisibleWidth !== this._explicitVisibleWidth && //isNaN\n\t\t\t\t\t(this._actualVisibleWidth < value || this._actualVisibleWidth == oldValue))\n\t\t\t\t{\n\t\t\t\t\t//only invalidate if this change might affect the visibleWidth\n\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate var _maxVisibleWidth:Number = Number.POSITIVE_INFINITY;\n\n\t\tpublic function get maxVisibleWidth():Number\n\t\t{\n\t\t\treturn this._maxVisibleWidth;\n\t\t}\n\n\t\tpublic function set maxVisibleWidth(value:Number):void\n\t\t{\n\t\t\tif(this._maxVisibleWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value) //isNaN\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"maxVisibleWidth cannot be NaN\");\n\t\t\t}\n\t\t\tvar oldValue:Number = this._maxVisibleWidth;\n\t\t\tthis._maxVisibleWidth = value;\n\t\t\tif(this._explicitVisibleWidth !== this._explicitVisibleWidth && //isNaN\n\t\t\t\t(this._actualVisibleWidth > value || this._actualVisibleWidth == oldValue))\n\t\t\t{\n\t\t\t\t//only invalidate if this change might affect the visibleWidth\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\tprivate var _actualVisibleWidth:Number = 0;\n\n\t\tprivate var _explicitVisibleWidth:Number;\n\n\t\tpublic function get visibleWidth():Number\n\t\t{\n\t\t\tif(this._explicitVisibleWidth !== this._explicitVisibleWidth) //isNaN\n\t\t\t{\n\t\t\t\treturn this._actualVisibleWidth;\n\t\t\t}\n\t\t\treturn this._explicitVisibleWidth;\n\t\t}\n\n\t\tpublic function set visibleWidth(value:Number):void\n\t\t{\n\t\t\tif(this._explicitVisibleWidth == value ||\n\t\t\t\t(value !== value && this._explicitVisibleWidth !== this._explicitVisibleWidth)) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._explicitVisibleWidth = value;\n\t\t\tif(this._actualVisibleWidth != value)\n\t\t\t{\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\tprivate var _actualMinVisibleHeight:Number = 0;\n\n\t\tprivate var _explicitMinVisibleHeight:Number;\n\n\t\tpublic function get minVisibleHeight():Number\n\t\t{\n\t\t\tif(this._explicitMinVisibleHeight !== this._explicitMinVisibleHeight) //isNaN\n\t\t\t{\n\t\t\t\treturn this._actualMinVisibleHeight;\n\t\t\t}\n\t\t\treturn this._explicitMinVisibleHeight;\n\t\t}\n\n\t\tpublic function set minVisibleHeight(value:Number):void\n\t\t{\n\t\t\tif(this._explicitMinVisibleHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar valueIsNaN:Boolean = value !== value; //isNaN\n\t\t\tif(valueIsNaN &&\n\t\t\t\tthis._explicitMinVisibleHeight !== this._explicitMinVisibleHeight) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar oldValue:Number = this._explicitMinVisibleHeight;\n\t\t\tthis._explicitMinVisibleHeight = value;\n\t\t\tif(valueIsNaN)\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleHeight = 0;\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleHeight = value;\n\t\t\t\tif(this._explicitVisibleHeight !== this._explicitVisibleHeight && //isNaN\n\t\t\t\t\t(this._actualVisibleHeight < value || this._actualVisibleHeight == oldValue))\n\t\t\t\t{\n\t\t\t\t\t//only invalidate if this change might affect the visibleHeight\n\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate var _maxVisibleHeight:Number = Number.POSITIVE_INFINITY;\n\n\t\tpublic function get maxVisibleHeight():Number\n\t\t{\n\t\t\treturn this._maxVisibleHeight;\n\t\t}\n\n\t\tpublic function set maxVisibleHeight(value:Number):void\n\t\t{\n\t\t\tif(this._maxVisibleHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value) //isNaN\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"maxVisibleHeight cannot be NaN\");\n\t\t\t}\n\t\t\tvar oldValue:Number = this._maxVisibleHeight;\n\t\t\tthis._maxVisibleHeight = value;\n\t\t\tif(this._explicitVisibleHeight !== this._explicitVisibleHeight && //isNaN\n\t\t\t\t(this._actualVisibleHeight > value || this._actualVisibleHeight == oldValue))\n\t\t\t{\n\t\t\t\t//only invalidate if this change might affect the visibleHeight\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\tprivate var _actualVisibleHeight:Number = 0;\n\n\t\tprivate var _explicitVisibleHeight:Number;\n\n\t\tpublic function get visibleHeight():Number\n\t\t{\n\t\t\tif(this._explicitVisibleHeight !== this._explicitVisibleHeight) //isNaN\n\t\t\t{\n\t\t\t\treturn this._actualVisibleHeight;\n\t\t\t}\n\t\t\treturn this._explicitVisibleHeight;\n\t\t}\n\n\t\tpublic function set visibleHeight(value:Number):void\n\t\t{\n\t\t\tif(this._explicitVisibleHeight == value ||\n\t\t\t\t(value !== value && this._explicitVisibleHeight !== this._explicitVisibleHeight)) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._explicitVisibleHeight = value;\n\t\t\tif(this._actualVisibleHeight != value)\n\t\t\t{\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\tprivate var _contentX:Number = 0;\n\n\t\tpublic function get contentX():Number\n\t\t{\n\t\t\treturn this._contentX;\n\t\t}\n\n\t\tprivate var _contentY:Number = 0;\n\n\t\tpublic function get contentY():Number\n\t\t{\n\t\t\treturn this._contentY;\n\t\t}\n\n\t\tpublic function get horizontalScrollStep():Number\n\t\t{\n\t\t\tif(this.actualWidth < this.actualHeight)\n\t\t\t{\n\t\t\t\treturn this.actualWidth / 10;\n\t\t\t}\n\t\t\treturn this.actualHeight / 10;\n\t\t}\n\n\t\tpublic function get verticalScrollStep():Number\n\t\t{\n\t\t\tif(this.actualWidth < this.actualHeight)\n\t\t\t{\n\t\t\t\treturn this.actualWidth / 10;\n\t\t\t}\n\t\t\treturn this.actualHeight / 10;\n\t\t}\n\n\t\tprivate var _horizontalScrollPosition:Number = 0;\n\n\t\tpublic function get horizontalScrollPosition():Number\n\t\t{\n\t\t\treturn this._horizontalScrollPosition;\n\t\t}\n\n\t\tpublic function set horizontalScrollPosition(value:Number):void\n\t\t{\n\t\t\tif(this._horizontalScrollPosition == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalScrollPosition = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t}\n\n\t\tprivate var _verticalScrollPosition:Number = 0;\n\n\t\tpublic function get verticalScrollPosition():Number\n\t\t{\n\t\t\treturn this._verticalScrollPosition;\n\t\t}\n\n\t\tpublic function set verticalScrollPosition(value:Number):void\n\t\t{\n\t\t\tif(this._verticalScrollPosition == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalScrollPosition = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t}\n\n\t\tpublic function get requiresMeasurementOnScroll():Boolean\n\t\t{\n\t\t\treturn this._layout !== null && this._layout.requiresLayoutOnScroll &&\n\t\t\t\t(this._explicitVisibleWidth !== this._explicitVisibleWidth || //isNaN\n\t\t\t\tthis._explicitVisibleHeight !== this._explicitVisibleHeight); //isNaN\n\t\t}\n\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tthis.layout = null;\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\toverride protected function refreshViewPortBounds():void\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitVisibleWidth !== this._explicitVisibleWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitVisibleHeight !== this._explicitVisibleHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinVisibleWidth !== this._explicitMinVisibleWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinVisibleHeight !== this._explicitMinVisibleHeight; //isNaN\n\n\t\t\tthis.viewPortBounds.x = 0;\n\t\t\tthis.viewPortBounds.y = 0;\n\t\t\tthis.viewPortBounds.scrollX = this._horizontalScrollPosition;\n\t\t\tthis.viewPortBounds.scrollY = this._verticalScrollPosition;\n\t\t\tif(this._autoSizeMode === AutoSizeMode.STAGE && needsWidth)\n\t\t\t{\n\t\t\t\tthis.viewPortBounds.explicitWidth = this.stage.stageWidth;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//layouts can handle NaN for explicit dimensions\n\t\t\t\tthis.viewPortBounds.explicitWidth = this._explicitVisibleWidth;\n\t\t\t}\n\t\t\tif(this._autoSizeMode === AutoSizeMode.STAGE && needsHeight)\n\t\t\t{\n\t\t\t\tthis.viewPortBounds.explicitHeight = this.stage.stageHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//layouts can handle NaN for explicit dimensions\n\t\t\t\tthis.viewPortBounds.explicitHeight = this._explicitVisibleHeight;\n\t\t\t}\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\t//layouts don't expect NaN for minimum dimensions\n\t\t\t\tthis.viewPortBounds.minWidth = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.viewPortBounds.minWidth = this._explicitMinVisibleWidth;\n\t\t\t}\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\t//layouts don't expect NaN for minimum dimensions\n\t\t\t\tthis.viewPortBounds.minHeight = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.viewPortBounds.minHeight = this._explicitMinVisibleHeight;\n\t\t\t}\n\t\t\tthis.viewPortBounds.maxWidth = this._maxVisibleWidth;\n\t\t\tthis.viewPortBounds.maxHeight = this._maxVisibleHeight;\n\t\t}\n\n\t\toverride protected function handleLayoutResult():void\n\t\t{\n\t\t\tvar contentWidth:Number = this._layoutResult.contentWidth;\n\t\t\tvar contentHeight:Number = this._layoutResult.contentHeight;\n\t\t\tthis.saveMeasurements(contentWidth, contentHeight,\n\t\t\t\tcontentWidth, contentHeight);\n\t\t\tthis._contentX = this._layoutResult.contentX;\n\t\t\tthis._contentY = this._layoutResult.contentY;\n\t\t\tvar viewPortWidth:Number = this._layoutResult.viewPortWidth;\n\t\t\tvar viewPortHeight:Number = this._layoutResult.viewPortHeight;\n\t\t\tthis._actualVisibleWidth = viewPortWidth;\n\t\t\tthis._actualVisibleHeight = viewPortHeight;\n\t\t\tthis._actualMinVisibleWidth = viewPortWidth;\n\t\t\tthis._actualMinVisibleHeight = viewPortHeight;\n\t\t}\n\n\t\toverride protected function handleManualLayout():void\n\t\t{\n\t\t\tvar minX:Number = 0;\n\t\t\tvar minY:Number = 0;\n\t\t\tvar explicitViewPortWidth:Number = this.viewPortBounds.explicitWidth;\n\t\t\tvar maxX:Number = explicitViewPortWidth;\n\t\t\t//for some reason, if we don't call a function right here,\n\t\t\t//compiling with the flex 4.6 SDK will throw a VerifyError\n\t\t\t//for a stack overflow.\n\t\t\t//we could change the !== check back to isNaN() instead, but\n\t\t\t//isNaN() can allocate an object, so we should call a different\n\t\t\t//function without allocation.\n\t\t\tthis.doNothing();\n\t\t\tif(maxX !== maxX) //isNaN\n\t\t\t{\n\t\t\t\tmaxX = 0;\n\t\t\t}\n\t\t\tvar explicitViewPortHeight:Number = this.viewPortBounds.explicitHeight;\n\t\t\tvar maxY:Number = explicitViewPortHeight;\n\t\t\t//see explanation above the previous call to this function.\n\t\t\tthis.doNothing();\n\t\t\tif(maxY !== maxY) //isNaN\n\t\t\t{\n\t\t\t\tmaxY = 0;\n\t\t\t}\n\t\t\tthis._ignoreChildChanges = true;\n\t\t\tvar itemCount:int = this.items.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:DisplayObject = this.items[i];\n\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(item is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(item).validate();\n\t\t\t\t}\n\t\t\t\tvar itemX:Number = item.x - item.pivotX * item.scaleX;\n\t\t\t\tvar itemY:Number = item.y - item.pivotY * item.scaleY;\n\t\t\t\tvar itemMaxX:Number = itemX + item.width;\n\t\t\t\tvar itemMaxY:Number = itemY + item.height;\n\t\t\t\tif(itemX === itemX && //!isNaN\n\t\t\t\t\titemX < minX)\n\t\t\t\t{\n\t\t\t\t\tminX = itemX;\n\t\t\t\t}\n\t\t\t\tif(itemY === itemY && //!isNaN\n\t\t\t\t\titemY < minY)\n\t\t\t\t{\n\t\t\t\t\tminY = itemY;\n\t\t\t\t}\n\t\t\t\tif(itemMaxX === itemMaxX && //!isNaN\n\t\t\t\t\titemMaxX > maxX)\n\t\t\t\t{\n\t\t\t\t\tmaxX = itemMaxX;\n\t\t\t\t}\n\t\t\t\tif(itemMaxY === itemMaxY && //!isNaN\n\t\t\t\t\titemMaxY > maxY)\n\t\t\t\t{\n\t\t\t\t\tmaxY = itemMaxY;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar minWidth:Number = this.viewPortBounds.minWidth;\n\t\t\tvar maxWidth:Number = this.viewPortBounds.maxWidth;\n\t\t\tvar minHeight:Number = this.viewPortBounds.minHeight;\n\t\t\tvar maxHeight:Number = this.viewPortBounds.maxHeight;\n\t\t\tvar calculatedWidth:Number = maxX - minX;\n\t\t\tif(calculatedWidth < minWidth)\n\t\t\t{\n\t\t\t\tcalculatedWidth = minWidth;\n\t\t\t}\n\t\t\telse if(calculatedWidth > maxWidth)\n\t\t\t{\n\t\t\t\tcalculatedWidth = maxWidth;\n\t\t\t}\n\t\t\tvar calculatedHeight:Number = maxY - minY;\n\t\t\tif(calculatedHeight < minHeight)\n\t\t\t{\n\t\t\t\tcalculatedHeight = minHeight;\n\t\t\t}\n\t\t\telse if(calculatedHeight > maxHeight)\n\t\t\t{\n\t\t\t\tcalculatedHeight = maxHeight;\n\t\t\t}\n\t\t\tthis._ignoreChildChanges = false;\n\t\t\tif(explicitViewPortWidth !== explicitViewPortWidth) //isNaN\n\t\t\t{\n\t\t\t\tthis._actualVisibleWidth = calculatedWidth;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._actualVisibleWidth = explicitViewPortWidth;\n\t\t\t}\n\t\t\tif(explicitViewPortHeight !== explicitViewPortHeight) //isNaN\n\t\t\t{\n\t\t\t\tthis._actualVisibleHeight = calculatedHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._actualVisibleHeight = explicitViewPortHeight;\n\t\t\t}\n\t\t\tthis._layoutResult.contentX = minX;\n\t\t\tthis._layoutResult.contentY = minY;\n\t\t\tthis._layoutResult.contentWidth = calculatedWidth;\n\t\t\tthis._layoutResult.contentHeight = calculatedHeight;\n\t\t\tthis._layoutResult.viewPortWidth = calculatedWidth;\n\t\t\tthis._layoutResult.viewPortHeight = calculatedHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * This function is here to work around a bug in the Flex 4.6 SDK\n\t\t * compiler. For explanation, see the places where it gets called.\n\t\t */\n\t\tprotected function doNothing():void {}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/supportClasses/ListDataViewPort.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.supportClasses\n{\n\timport feathers.controls.List;\n\timport feathers.controls.Scroller;\n\timport feathers.controls.renderers.IDragAndDropItemRenderer;\n\timport feathers.controls.renderers.IListItemRenderer;\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IMeasureDisplayObject;\n\timport feathers.core.IValidating;\n\timport feathers.core.PropertyProxy;\n\timport feathers.data.IListCollection;\n\timport feathers.data.ListCollection;\n\timport feathers.display.RenderDelegate;\n\timport feathers.dragDrop.DragData;\n\timport feathers.dragDrop.DragDropManager;\n\timport feathers.events.CollectionEventType;\n\timport feathers.events.DragDropEvent;\n\timport feathers.events.ExclusiveTouch;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.IDragDropLayout;\n\timport feathers.layout.ILayout;\n\timport feathers.layout.ISpinnerLayout;\n\timport feathers.layout.ITrimmedVirtualLayout;\n\timport feathers.layout.IVariableVirtualLayout;\n\timport feathers.layout.IVirtualLayout;\n\timport feathers.layout.LayoutBoundsResult;\n\timport feathers.layout.ViewPortBounds;\n\timport feathers.motion.effectClasses.IEffectContext;\n\timport feathers.system.DeviceCapabilities;\n\n\timport flash.errors.IllegalOperationError;\n\timport flash.geom.Point;\n\timport flash.utils.Dictionary;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.EnterFrameEvent;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.utils.Pool;\n\n\t/**\n\t * @private\n\t * Used internally by List. Not meant to be used on its own.\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class ListDataViewPort extends FeathersControl implements IViewPort\n\t{\n\t\tprivate static const INVALIDATION_FLAG_ITEM_RENDERER_FACTORY:String = \"itemRendererFactory\";\n\n\t\tprivate static const HELPER_VECTOR:Vector.<int> = new <int>[];\n\n\t\tpublic function ListDataViewPort()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _viewPortBounds:ViewPortBounds = new ViewPortBounds();\n\n\t\tprivate var _layoutResult:LayoutBoundsResult = new LayoutBoundsResult();\n\n\t\tprivate var _actualMinVisibleWidth:Number = 0;\n\n\t\tprivate var _explicitMinVisibleWidth:Number;\n\n\t\tpublic function get minVisibleWidth():Number\n\t\t{\n\t\t\tif(this._explicitMinVisibleWidth !== this._explicitMinVisibleWidth) //isNaN\n\t\t\t{\n\t\t\t\treturn this._actualMinVisibleWidth;\n\t\t\t}\n\t\t\treturn this._explicitMinVisibleWidth;\n\t\t}\n\n\t\tpublic function set minVisibleWidth(value:Number):void\n\t\t{\n\t\t\tif(this._explicitMinVisibleWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar valueIsNaN:Boolean = value !== value; //isNaN\n\t\t\tif(valueIsNaN &&\n\t\t\t\tthis._explicitMinVisibleWidth !== this._explicitMinVisibleWidth) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar oldValue:Number = this._explicitMinVisibleWidth;\n\t\t\tthis._explicitMinVisibleWidth = value;\n\t\t\tif(valueIsNaN)\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleWidth = 0;\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleWidth = value;\n\t\t\t\tif(this.explicitVisibleWidth !== this.explicitVisibleWidth && //isNaN\n\t\t\t\t\t(this.actualVisibleWidth < value || this.actualVisibleWidth == oldValue))\n\t\t\t\t{\n\t\t\t\t\t//only invalidate if this change might affect the visibleWidth\n\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate var _maxVisibleWidth:Number = Number.POSITIVE_INFINITY;\n\n\t\tpublic function get maxVisibleWidth():Number\n\t\t{\n\t\t\treturn this._maxVisibleWidth;\n\t\t}\n\n\t\tpublic function set maxVisibleWidth(value:Number):void\n\t\t{\n\t\t\tif(this._maxVisibleWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value) //isNaN\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"maxVisibleWidth cannot be NaN\");\n\t\t\t}\n\t\t\tvar oldValue:Number = this._maxVisibleWidth;\n\t\t\tthis._maxVisibleWidth = value;\n\t\t\tif(this.explicitVisibleWidth !== this.explicitVisibleWidth && //isNaN\n\t\t\t\t(this.actualVisibleWidth > value || this.actualVisibleWidth == oldValue))\n\t\t\t{\n\t\t\t\t//only invalidate if this change might affect the visibleWidth\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\tprivate var actualVisibleWidth:Number = 0;\n\n\t\tprivate var explicitVisibleWidth:Number = NaN;\n\n\t\tpublic function get visibleWidth():Number\n\t\t{\n\t\t\treturn this.actualVisibleWidth;\n\t\t}\n\n\t\tpublic function set visibleWidth(value:Number):void\n\t\t{\n\t\t\tif(this.explicitVisibleWidth == value ||\n\t\t\t\t(value !== value && this.explicitVisibleWidth !== this.explicitVisibleWidth)) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.explicitVisibleWidth = value;\n\t\t\tif(this.actualVisibleWidth != value)\n\t\t\t{\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\tprivate var _actualMinVisibleHeight:Number = 0;\n\n\t\tprivate var _explicitMinVisibleHeight:Number;\n\n\t\tpublic function get minVisibleHeight():Number\n\t\t{\n\t\t\tif(this._explicitMinVisibleHeight !== this._explicitMinVisibleHeight) //isNaN\n\t\t\t{\n\t\t\t\treturn this._actualMinVisibleHeight;\n\t\t\t}\n\t\t\treturn this._explicitMinVisibleHeight;\n\t\t}\n\n\t\tpublic function set minVisibleHeight(value:Number):void\n\t\t{\n\t\t\tif(this._explicitMinVisibleHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar valueIsNaN:Boolean = value !== value; //isNaN\n\t\t\tif(valueIsNaN &&\n\t\t\t\tthis._explicitMinVisibleHeight !== this._explicitMinVisibleHeight) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar oldValue:Number = this._explicitMinVisibleHeight;\n\t\t\tthis._explicitMinVisibleHeight = value;\n\t\t\tif(valueIsNaN)\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleHeight = 0;\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleHeight = value;\n\t\t\t\tif(this.explicitVisibleHeight !== this.explicitVisibleHeight && //isNaN\n\t\t\t\t\t(this.actualVisibleHeight < value || this.actualVisibleHeight == oldValue))\n\t\t\t\t{\n\t\t\t\t\t//only invalidate if this change might affect the visibleHeight\n\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate var _maxVisibleHeight:Number = Number.POSITIVE_INFINITY;\n\n\t\tpublic function get maxVisibleHeight():Number\n\t\t{\n\t\t\treturn this._maxVisibleHeight;\n\t\t}\n\n\t\tpublic function set maxVisibleHeight(value:Number):void\n\t\t{\n\t\t\tif(this._maxVisibleHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value) //isNaN\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"maxVisibleHeight cannot be NaN\");\n\t\t\t}\n\t\t\tvar oldValue:Number = this._maxVisibleHeight;\n\t\t\tthis._maxVisibleHeight = value;\n\t\t\tif(this.explicitVisibleHeight !== this.explicitVisibleHeight && //isNaN\n\t\t\t\t(this.actualVisibleHeight > value || this.actualVisibleHeight == oldValue))\n\t\t\t{\n\t\t\t\t//only invalidate if this change might affect the visibleHeight\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\tprivate var actualVisibleHeight:Number = 0;\n\n\t\tprivate var explicitVisibleHeight:Number = NaN;\n\n\t\tpublic function get visibleHeight():Number\n\t\t{\n\t\t\treturn this.actualVisibleHeight;\n\t\t}\n\n\t\tpublic function set visibleHeight(value:Number):void\n\t\t{\n\t\t\tif(this.explicitVisibleHeight == value ||\n\t\t\t\t(value !== value && this.explicitVisibleHeight !== this.explicitVisibleHeight)) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.explicitVisibleHeight = value;\n\t\t\tif(this.actualVisibleHeight != value)\n\t\t\t{\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\tprotected var _contentX:Number = 0;\n\n\t\tpublic function get contentX():Number\n\t\t{\n\t\t\treturn this._contentX;\n\t\t}\n\n\t\tprotected var _contentY:Number = 0;\n\n\t\tpublic function get contentY():Number\n\t\t{\n\t\t\treturn this._contentY;\n\t\t}\n\n\t\tprivate var _typicalItemIsInDataProvider:Boolean = false;\n\t\tprivate var _typicalItemRenderer:IListItemRenderer;\n\t\tprivate var _unrenderedData:Array = [];\n\t\tprivate var _layoutItems:Vector.<DisplayObject> = new <DisplayObject>[];\n\t\tprivate var _defaultStorage:ItemRendererFactoryStorage = new ItemRendererFactoryStorage();\n\t\tprivate var _storageMap:Object;\n\t\tprivate var _rendererMap:Dictionary = new Dictionary(true);\n\t\tprivate var _minimumItemCount:int;\n\n\t\tprivate var _layoutIndexOffset:int = 0;\n\t\tprivate var _layoutIndexRolloverIndex:int = -1;\n\n\t\tprivate var _owner:List;\n\n\t\tpublic function get owner():List\n\t\t{\n\t\t\treturn this._owner;\n\t\t}\n\n\t\tpublic function set owner(value:List):void\n\t\t{\n\t\t\tif(this._owner == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._owner)\n\t\t\t{\n\t\t\t\tthis._owner.removeEventListener(DragDropEvent.DRAG_ENTER, dragEnterHandler);\n\t\t\t\tthis._owner.removeEventListener(DragDropEvent.DRAG_MOVE, dragMoveHandler);\n\t\t\t\tthis._owner.removeEventListener(DragDropEvent.DRAG_EXIT, dragExitHandler);\n\t\t\t\tthis._owner.removeEventListener(DragDropEvent.DRAG_DROP, dragDropHandler);\n\t\t\t\tthis._owner.removeEventListener(DragDropEvent.DRAG_COMPLETE, dragCompleteHandler);\n\t\t\t}\n\t\t\tthis._owner = value;\n\t\t\tif(this._owner)\n\t\t\t{\n\t\t\t\tthis._owner.addEventListener(DragDropEvent.DRAG_ENTER, dragEnterHandler);\n\t\t\t\tthis._owner.addEventListener(DragDropEvent.DRAG_MOVE, dragMoveHandler);\n\t\t\t\tthis._owner.addEventListener(DragDropEvent.DRAG_EXIT, dragExitHandler);\n\t\t\t\tthis._owner.addEventListener(DragDropEvent.DRAG_DROP, dragDropHandler);\n\t\t\t\tthis._owner.addEventListener(DragDropEvent.DRAG_COMPLETE, dragCompleteHandler);\n\t\t\t}\n\t\t}\n\n\t\tprivate var _updateForDataReset:Boolean = false;\n\n\t\tprivate var _dataProvider:IListCollection;\n\n\t\tpublic function get dataProvider():IListCollection\n\t\t{\n\t\t\treturn this._dataProvider;\n\t\t}\n\n\t\tpublic function set dataProvider(value:IListCollection):void\n\t\t{\n\t\t\tif(this._dataProvider == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._dataProvider)\n\t\t\t{\n\t\t\t\tthis._dataProvider.removeEventListener(Event.CHANGE, dataProvider_changeHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.RESET, dataProvider_resetHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.FILTER_CHANGE, dataProvider_filterChangeHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.ADD_ITEM, dataProvider_addItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.REMOVE_ITEM, dataProvider_removeItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.REPLACE_ITEM, dataProvider_replaceItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.UPDATE_ITEM, dataProvider_updateItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.UPDATE_ALL, dataProvider_updateAllHandler);\n\t\t\t}\n\t\t\tthis._dataProvider = value;\n\t\t\tif(this._dataProvider)\n\t\t\t{\n\t\t\t\tthis._dataProvider.addEventListener(Event.CHANGE, dataProvider_changeHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.RESET, dataProvider_resetHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.FILTER_CHANGE, dataProvider_filterChangeHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.ADD_ITEM, dataProvider_addItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.REMOVE_ITEM, dataProvider_removeItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.REPLACE_ITEM, dataProvider_replaceItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.UPDATE_ITEM, dataProvider_updateItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.UPDATE_ALL, dataProvider_updateAllHandler);\n\t\t\t}\n\t\t\tif(this._layout is IVariableVirtualLayout)\n\t\t\t{\n\t\t\t\tIVariableVirtualLayout(this._layout).resetVariableVirtualCache();\n\t\t\t}\n\t\t\tthis._updateForDataReset = true;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\tprivate var _itemRendererType:Class;\n\n\t\tpublic function get itemRendererType():Class\n\t\t{\n\t\t\treturn this._itemRendererType;\n\t\t}\n\n\t\tpublic function set itemRendererType(value:Class):void\n\t\t{\n\t\t\tif(this._itemRendererType == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._itemRendererType = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _itemRendererFactory:Function;\n\n\t\tpublic function get itemRendererFactory():Function\n\t\t{\n\t\t\treturn this._itemRendererFactory;\n\t\t}\n\n\t\tpublic function set itemRendererFactory(value:Function):void\n\t\t{\n\t\t\tif(this._itemRendererFactory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._itemRendererFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _itemRendererFactories:Object;\n\n\t\tpublic function get itemRendererFactories():Object\n\t\t{\n\t\t\treturn this._itemRendererFactories;\n\t\t}\n\n\t\tpublic function set itemRendererFactories(value:Object):void\n\t\t{\n\t\t\tif(this._itemRendererFactories === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._itemRendererFactories = value;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tthis._storageMap = {};\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _factoryIDFunction:Function;\n\n\t\tpublic function get factoryIDFunction():Function\n\t\t{\n\t\t\treturn this._factoryIDFunction;\n\t\t}\n\n\t\tpublic function set factoryIDFunction(value:Function):void\n\t\t{\n\t\t\tif(this._factoryIDFunction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._factoryIDFunction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _customItemRendererStyleName:String;\n\n\t\tpublic function get customItemRendererStyleName():String\n\t\t{\n\t\t\treturn this._customItemRendererStyleName;\n\t\t}\n\n\t\tpublic function set customItemRendererStyleName(value:String):void\n\t\t{\n\t\t\tif(this._customItemRendererStyleName == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customItemRendererStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _typicalItem:Object = null;\n\n\t\tpublic function get typicalItem():Object\n\t\t{\n\t\t\treturn this._typicalItem;\n\t\t}\n\n\t\tpublic function set typicalItem(value:Object):void\n\t\t{\n\t\t\tif(this._typicalItem == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._typicalItem = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\tprivate var _itemRendererProperties:PropertyProxy;\n\n\t\tpublic function get itemRendererProperties():PropertyProxy\n\t\t{\n\t\t\treturn this._itemRendererProperties;\n\t\t}\n\n\t\tpublic function set itemRendererProperties(value:PropertyProxy):void\n\t\t{\n\t\t\tif(this._itemRendererProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._itemRendererProperties)\n\t\t\t{\n\t\t\t\tthis._itemRendererProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._itemRendererProperties = PropertyProxy(value);\n\t\t\tif(this._itemRendererProperties)\n\t\t\t{\n\t\t\t\tthis._itemRendererProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\tprivate var _ignoreLayoutChanges:Boolean = false;\n\t\tprivate var _ignoreRendererResizing:Boolean = false;\n\n\t\tprivate var _layout:ILayout;\n\n\t\tpublic function get layout():ILayout\n\t\t{\n\t\t\treturn this._layout;\n\t\t}\n\n\t\tpublic function set layout(value:ILayout):void\n\t\t{\n\t\t\tif(this._layout == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._layout)\n\t\t\t{\n\t\t\t\tthis._layout.removeEventListener(Event.CHANGE, layout_changeHandler);\n\t\t\t}\n\t\t\tthis._layout = value;\n\t\t\tif(this._layout)\n\t\t\t{\n\t\t\t\tif(this._layout is IVariableVirtualLayout)\n\t\t\t\t{\n\t\t\t\t\tIVariableVirtualLayout(this._layout).resetVariableVirtualCache();\n\t\t\t\t}\n\t\t\t\tthis._layout.addEventListener(Event.CHANGE, layout_changeHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\tpublic function get horizontalScrollStep():Number\n\t\t{\n\t\t\tvar itemRenderer:DisplayObject = null;\n\t\t\tvar virtualLayout:IVirtualLayout = this._layout as IVirtualLayout;\n\t\t\tif(virtualLayout === null || !virtualLayout.useVirtualLayout)\n\t\t\t{\n\t\t\t\tif(this._layoutItems.length > 0)\n\t\t\t\t{\n\t\t\t\t\titemRenderer = this._layoutItems[0] as DisplayObject;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(itemRenderer === null)\n\t\t\t{\n\t\t\t\titemRenderer = this._typicalItemRenderer as DisplayObject;\n\t\t\t}\n\t\t\tif(itemRenderer === null)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tvar itemRendererWidth:Number = itemRenderer.width;\n\t\t\tvar itemRendererHeight:Number = itemRenderer.height;\n\t\t\tif(itemRendererWidth < itemRendererHeight)\n\t\t\t{\n\t\t\t\treturn itemRendererWidth;\n\t\t\t}\n\t\t\treturn itemRendererHeight;\n\t\t}\n\n\t\tpublic function get verticalScrollStep():Number\n\t\t{\n\t\t\tvar itemRenderer:DisplayObject = null;\n\t\t\tvar virtualLayout:IVirtualLayout = this._layout as IVirtualLayout;\n\t\t\tif(virtualLayout === null || !virtualLayout.useVirtualLayout)\n\t\t\t{\n\t\t\t\tif(this._layoutItems.length > 0)\n\t\t\t\t{\n\t\t\t\t\titemRenderer = this._layoutItems[0] as DisplayObject;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(itemRenderer === null)\n\t\t\t{\n\t\t\t\titemRenderer = this._typicalItemRenderer as DisplayObject;\n\t\t\t}\n\t\t\tif(itemRenderer === null)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tvar itemRendererWidth:Number = itemRenderer.width;\n\t\t\tvar itemRendererHeight:Number = itemRenderer.height;\n\t\t\tif(itemRendererWidth < itemRendererHeight)\n\t\t\t{\n\t\t\t\treturn itemRendererWidth;\n\t\t\t}\n\t\t\treturn itemRendererHeight;\n\t\t}\n\n\t\tprivate var _horizontalScrollPosition:Number = 0;\n\n\t\tpublic function get horizontalScrollPosition():Number\n\t\t{\n\t\t\treturn this._horizontalScrollPosition;\n\t\t}\n\n\t\tpublic function set horizontalScrollPosition(value:Number):void\n\t\t{\n\t\t\tif(this._horizontalScrollPosition == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalScrollPosition = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t}\n\n\t\tprivate var _verticalScrollPosition:Number = 0;\n\n\t\tpublic function get verticalScrollPosition():Number\n\t\t{\n\t\t\treturn this._verticalScrollPosition;\n\t\t}\n\n\t\tpublic function set verticalScrollPosition(value:Number):void\n\t\t{\n\t\t\tif(this._verticalScrollPosition == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalScrollPosition = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t}\n\n\t\tprivate var _ignoreSelectionChanges:Boolean = false;\n\n\t\tprivate var _isSelectable:Boolean = true;\n\n\t\tpublic function get isSelectable():Boolean\n\t\t{\n\t\t\treturn this._isSelectable;\n\t\t}\n\n\t\tpublic function set isSelectable(value:Boolean):void\n\t\t{\n\t\t\tif(this._isSelectable == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isSelectable = value;\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tthis.selectedIndices = null;\n\t\t\t}\n\t\t}\n\n\t\tprivate var _allowMultipleSelection:Boolean = false;\n\n\t\tpublic function get allowMultipleSelection():Boolean\n\t\t{\n\t\t\treturn this._allowMultipleSelection;\n\t\t}\n\n\t\tpublic function set allowMultipleSelection(value:Boolean):void\n\t\t{\n\t\t\tthis._allowMultipleSelection = value;\n\t\t}\n\n\t\tprivate var _selectedIndices:ListCollection;\n\n\t\tpublic function get selectedIndices():ListCollection\n\t\t{\n\t\t\treturn this._selectedIndices;\n\t\t}\n\n\t\tpublic function set selectedIndices(value:ListCollection):void\n\t\t{\n\t\t\tif(this._selectedIndices == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._selectedIndices)\n\t\t\t{\n\t\t\t\tthis._selectedIndices.removeEventListener(Event.CHANGE, selectedIndices_changeHandler);\n\t\t\t}\n\t\t\tthis._selectedIndices = value;\n\t\t\tif(this._selectedIndices)\n\t\t\t{\n\t\t\t\tthis._selectedIndices.addEventListener(Event.CHANGE, selectedIndices_changeHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\n\t\tprotected var _addItemEffectContexts:Vector.<IEffectContext> = null;\n\n\t\tprotected var _removeItemEffectContexts:Vector.<IEffectContext> = null;\n\n\t\tprotected var _addedItems:Dictionary = null;\n\n\t\tpublic function get addedItems():Dictionary\n\t\t{\n\t\t\treturn this._addedItems;\n\t\t}\n\n\t\tpublic function set addedItems(value:Dictionary):void\n\t\t{\n\t\t\tif(this._addedItems === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._addedItems = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\tprotected var _removedItems:Dictionary = null;\n\n\t\tpublic function get removedItems():Dictionary\n\t\t{\n\t\t\treturn this._removedItems;\n\t\t}\n\n\t\tpublic function set removedItems(value:Dictionary):void\n\t\t{\n\t\t\tif(this._removedItems === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._removedItems = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\tprotected var _dragTouchPointID:int = -1;\n\n\t\tprotected var _dragFormat:String;\n\n\t\tpublic function get dragFormat():String\n\t\t{\n\t\t\treturn this._dragFormat;\n\t\t}\n\n\t\tpublic function set dragFormat(value:String):void\n\t\t{\n\t\t\tthis._dragFormat = value;\n\t\t}\n\n\t\tprotected var _dragEnabled:Boolean = false;\n\n\t\tpublic function get dragEnabled():Boolean\n\t\t{\n\t\t\treturn this._dragEnabled;\n\t\t}\n\n\t\tpublic function set dragEnabled(value:Boolean):void\n\t\t{\n\t\t\tthis._dragEnabled = value;\n\t\t}\n\n\t\tprotected var _dropEnabled:Boolean = false;\n\n\t\tpublic function get dropEnabled():Boolean\n\t\t{\n\t\t\treturn this._dropEnabled;\n\t\t}\n\n\t\tpublic function set dropEnabled(value:Boolean):void\n\t\t{\n\t\t\tthis._dropEnabled = value;\n\t\t}\n\n\t\tprotected var _minimumAutoScrollDistance:Number = 0.04;\n\n\t\tpublic function get minimumAutoScrollDistance():Number\n\t\t{\n\t\t\treturn this._minimumAutoScrollDistance;\n\t\t}\n\n\t\tpublic function set minimumAutoScrollDistance(value:Number):void\n\t\t{\n\t\t\tthis._minimumAutoScrollDistance = value;\n\t\t}\n\n\t\tprotected var _droppedOnSelf:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitDropIndicatorWidth:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitDropIndicatorHeight:Number = NaN;\n\n\t\tprotected var _dropIndicatorSkin:DisplayObject = null;\n\n\t\tpublic function get dropIndicatorSkin():DisplayObject\n\t\t{\n\t\t\treturn this._dropIndicatorSkin;\n\t\t}\n\n\t\tpublic function set dropIndicatorSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this._dropIndicatorSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._dropIndicatorSkin = value;\n\t\t\tif(this._dropIndicatorSkin is IMeasureDisplayObject)\n\t\t\t{\n\t\t\t\tvar measureSkin:IMeasureDisplayObject = IMeasureDisplayObject(this._dropIndicatorSkin);\n\t\t\t\tthis._explicitDropIndicatorWidth = measureSkin.explicitWidth;\n\t\t\t\tthis._explicitDropIndicatorHeight = measureSkin.explicitHeight;\n\t\t\t}\n\t\t\telse if(this._dropIndicatorSkin)\n\t\t\t{\n\t\t\t\tthis._explicitDropIndicatorWidth = this._dropIndicatorSkin.width;\n\t\t\t\tthis._explicitDropIndicatorHeight = this._dropIndicatorSkin.height;\n\t\t\t}\n\t\t}\n\n\t\tprotected var _startDragX:Number;\n\t\tprotected var _startDragY:Number;\n\n\t\tprotected var _dragLocalX:Number = -1;\n\t\tprotected var _dragLocalY:Number = -1;\n\n\t\tprotected var _acceptedDrag:Boolean = false;\n\n\t\tprotected var _minimumDragDropDistance:Number = 0.04;\n\n\t\tpublic function get minimumDragDropDistance():Number\n\t\t{\n\t\t\treturn this._minimumDragDropDistance;\n\t\t}\n\n\t\tpublic function set minimumDragDropDistance(value:Number):void\n\t\t{\n\t\t\tthis._minimumDragDropDistance = value;\n\t\t}\n\n\t\tpublic function get requiresMeasurementOnScroll():Boolean\n\t\t{\n\t\t\treturn this._layout.requiresLayoutOnScroll &&\n\t\t\t\t(this.explicitVisibleWidth !== this.explicitVisibleWidth ||\n\t\t\t\tthis.explicitVisibleHeight !== this.explicitVisibleHeight);\n\t\t}\n\n\t\tpublic function calculateNavigationDestination(index:int, keyCode:uint):int\n\t\t{\n\t\t\treturn this._layout.calculateNavigationDestination(this._layoutItems, index, keyCode, this._layoutResult);\n\t\t}\n\n\t\tpublic function getScrollPositionForIndex(index:int, result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\t\t\treturn this._layout.getScrollPositionForIndex(index, this._layoutItems,\n\t\t\t\t0, 0, this.actualVisibleWidth, this.actualVisibleHeight, result);\n\t\t}\n\n\t\tpublic function getNearestScrollPositionForIndex(index:int, result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\t\t\treturn this._layout.getNearestScrollPositionForIndex(index,\n\t\t\t\tthis._horizontalScrollPosition, this._verticalScrollPosition,\n\t\t\t\tthis._layoutItems, 0, 0, this.actualVisibleWidth, this.actualVisibleHeight, result);\n\t\t}\n\n\t\tpublic function itemToItemRenderer(item:Object):IListItemRenderer\n\t\t{\n\t\t\treturn IListItemRenderer(this._rendererMap[item]);\n\t\t}\n\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this._dropIndicatorSkin !== null &&\n\t\t\t\tthis._dropIndicatorSkin.parent === null)\n\t\t\t{\n\t\t\t\tthis._dropIndicatorSkin.dispose();\n\t\t\t\tthis._dropIndicatorSkin = null;\n\t\t\t}\n\t\t\tthis.refreshInactiveRenderers(null, true);\n\t\t\tif(this._storageMap)\n\t\t\t{\n\t\t\t\tfor(var factoryID:String in this._storageMap)\n\t\t\t\t{\n\t\t\t\t\tthis.refreshInactiveRenderers(factoryID, true);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.owner = null;\n\t\t\tthis.layout = null;\n\t\t\tthis.dataProvider = null;\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function hitTest(localPoint:Point):DisplayObject\n\t\t{\n\t\t\tvar result:DisplayObject = super.hitTest(localPoint);\n\t\t\tif(result && this._acceptedDrag)\n\t\t\t{\n\t\t\t\treturn this._owner;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar scrollInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SCROLL);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\tvar selectionInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SELECTED);\n\t\t\tvar itemRendererInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar layoutInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_LAYOUT);\n\n\t\t\t//scrolling only affects the layout is requiresLayoutOnScroll is true\n\t\t\tif(!layoutInvalid && scrollInvalid && this._layout && this._layout.requiresLayoutOnScroll)\n\t\t\t{\n\t\t\t\tlayoutInvalid = true;\n\t\t\t}\n\n\t\t\tvar basicsInvalid:Boolean = sizeInvalid || dataInvalid || layoutInvalid || itemRendererInvalid;\n\n\t\t\tvar oldIgnoreRendererResizing:Boolean = this._ignoreRendererResizing;\n\t\t\tthis._ignoreRendererResizing = true;\n\t\t\tvar oldIgnoreLayoutChanges:Boolean = this._ignoreLayoutChanges;\n\t\t\tthis._ignoreLayoutChanges = true;\n\n\t\t\tif(scrollInvalid || sizeInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshViewPortBounds();\n\t\t\t}\n\t\t\tif(basicsInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshInactiveRenderers(null, itemRendererInvalid);\n\t\t\t\tif(this._storageMap)\n\t\t\t\t{\n\t\t\t\t\tfor(var factoryID:String in this._storageMap)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.refreshInactiveRenderers(factoryID, itemRendererInvalid);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(dataInvalid || layoutInvalid || itemRendererInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshLayoutTypicalItem();\n\t\t\t}\n\t\t\tif(basicsInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshRenderers();\n\t\t\t}\n\t\t\tif(stylesInvalid || basicsInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshItemRendererStyles();\n\t\t\t}\n\t\t\tif(selectionInvalid || basicsInvalid)\n\t\t\t{\n\t\t\t\t//unlike resizing renderers and layout changes, we only want to\n\t\t\t\t//stop listening for selection changes when we're forcibly\n\t\t\t\t//updating selection. other property changes on item renderers\n\t\t\t\t//can validly change selection, and we need to detect that.\n\t\t\t\tvar oldIgnoreSelectionChanges:Boolean = this._ignoreSelectionChanges;\n\t\t\t\tthis._ignoreSelectionChanges = true;\n\t\t\t\tthis.refreshSelection();\n\t\t\t\tthis._ignoreSelectionChanges = oldIgnoreSelectionChanges;\n\t\t\t}\n\t\t\tif(stateInvalid || basicsInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshEnabled();\n\t\t\t}\n\t\t\tthis._ignoreLayoutChanges = oldIgnoreLayoutChanges;\n\n\t\t\tif(stateInvalid || selectionInvalid || stylesInvalid || basicsInvalid)\n\t\t\t{\n\t\t\t\tthis._layout.layout(this._layoutItems, this._viewPortBounds, this._layoutResult);\n\t\t\t}\n\n\t\t\tthis._ignoreRendererResizing = oldIgnoreRendererResizing;\n\n\t\t\tthis._contentX = this._layoutResult.contentX;\n\t\t\tthis._contentY = this._layoutResult.contentY;\n\t\t\tthis.saveMeasurements(this._layoutResult.contentWidth, this._layoutResult.contentHeight,\n\t\t\t\tthis._layoutResult.contentWidth, this._layoutResult.contentHeight);\n\t\t\tthis.actualVisibleWidth = this._layoutResult.viewPortWidth;\n\t\t\tthis.actualVisibleHeight = this._layoutResult.viewPortHeight;\n\t\t\tthis._actualMinVisibleWidth = this._layoutResult.viewPortWidth;\n\t\t\tthis._actualMinVisibleHeight = this._layoutResult.viewPortHeight;\n\n\t\t\t//final validation to avoid juggler next frame issues\n\t\t\tthis.validateItemRenderers();\n\n\t\t\tthis.handlePendingItemRendererEffects();\n\n\t\t\tif(scrollInvalid && this.hasEventListener(Event.ENTER_FRAME, this.dragScroll_enterFrameHandler))\n\t\t\t{\n\t\t\t\tthis.refreshDropIndicator(this._dragLocalX, this._dragLocalY);\n\t\t\t}\n\t\t}\n\n\t\tprivate function handlePendingItemRendererEffects():void\n\t\t{\n\t\t\tif(this._addedItems !== null)\n\t\t\t{\n\t\t\t\tif(this._addItemEffectContexts === null)\n\t\t\t\t{\n\t\t\t\t\tthis._addItemEffectContexts = new <IEffectContext>[];\n\t\t\t\t}\n\t\t\t\tfor(var item:Object in this._addedItems)\n\t\t\t\t{\n\t\t\t\t\tvar itemRenderer:IListItemRenderer = this._rendererMap[item] as IListItemRenderer;\n\t\t\t\t\tif(itemRenderer !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.interruptRemoveItemEffects(itemRenderer, false);\n\t\t\t\t\t\tvar effect:Function = this._addedItems[item] as Function;\n\t\t\t\t\t\tvar context:IEffectContext = IEffectContext(effect(itemRenderer));\n\t\t\t\t\t\tcontext.addEventListener(Event.COMPLETE, addedItemEffectContext_completeHandler);\n\t\t\t\t\t\tthis._addItemEffectContexts[this._addItemEffectContexts.length] = context;\n\t\t\t\t\t\tcontext.play();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis._addedItems = null;\n\t\t\t}\n\t\t\tif(this._removedItems !== null)\n\t\t\t{\n\t\t\t\tif(this._removeItemEffectContexts === null)\n\t\t\t\t{\n\t\t\t\t\tthis._removeItemEffectContexts = new <IEffectContext>[];\n\t\t\t\t}\n\t\t\t\tfor(item in this._removedItems)\n\t\t\t\t{\n\t\t\t\t\titemRenderer = this._rendererMap[item] as IListItemRenderer;\n\t\t\t\t\tif(itemRenderer !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.interruptRemoveItemEffects(itemRenderer, true);\n\t\t\t\t\t\tthis.interruptAddItemEffects(itemRenderer);\n\t\t\t\t\t\teffect = this._removedItems[item] as Function;\n\t\t\t\t\t\tcontext = IEffectContext(effect(itemRenderer));\n\t\t\t\t\t\tcontext.addEventListener(Event.COMPLETE, removedItemEffectContext_completeHandler);\n\t\t\t\t\t\tthis._removeItemEffectContexts[this._removeItemEffectContexts.length] = context;\n\t\t\t\t\t\tcontext.play();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis._removedItems = null;\n\t\t\t}\n\t\t}\n\n\t\tprivate function interruptAddItemEffects(itemRenderer:IListItemRenderer):void\n\t\t{\n\t\t\tif(this._addItemEffectContexts === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar contextCount:int = this._addItemEffectContexts.length;\n\t\t\tfor(var i:int = 0; i < contextCount; i++)\n\t\t\t{\n\t\t\t\tvar context:IEffectContext = this._addItemEffectContexts[i];\n\t\t\t\tif(context.target !== itemRenderer)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tcontext.interrupt();\n\t\t\t\t//we've removed this context, so check the same index again\n\t\t\t\t//because it won't be the same context, and don't go beyond the\n\t\t\t\t//new, smaller length\n\t\t\t\ti--;\n\t\t\t\tcontextCount--;\n\t\t\t}\n\t\t}\n\n\t\tprivate function interruptRemoveItemEffects(itemRenderer:IListItemRenderer, stop:Boolean):void\n\t\t{\n\t\t\tif(this._removeItemEffectContexts === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar contextCount:int = this._removeItemEffectContexts.length;\n\t\t\tfor(var i:int = 0; i < contextCount; i++)\n\t\t\t{\n\t\t\t\tvar context:IEffectContext = this._removeItemEffectContexts[i];\n\t\t\t\tif(context.target !== itemRenderer)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(stop)\n\t\t\t\t{\n\t\t\t\t\tcontext.stop();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcontext.interrupt();\n\t\t\t\t}\n\t\t\t\t//we've removed this context, so check the same index again\n\t\t\t\t//because it won't be the same context, and don't go beyond the\n\t\t\t\t//new, smaller length\n\t\t\t\ti--;\n\t\t\t\tcontextCount--;\n\t\t\t}\n\t\t}\n\n\t\tprivate function invalidateParent(flag:String = INVALIDATION_FLAG_ALL):void\n\t\t{\n\t\t\tScroller(this.parent).invalidate(flag);\n\t\t}\n\n\t\tprivate function validateItemRenderers():void\n\t\t{\n\t\t\tvar itemCount:int = this._layoutItems.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:IValidating = this._layoutItems[i] as IValidating;\n\t\t\t\tif(item)\n\t\t\t\t{\n\t\t\t\t\titem.validate();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function refreshLayoutTypicalItem():void\n\t\t{\n\t\t\tvar virtualLayout:IVirtualLayout = this._layout as IVirtualLayout;\n\t\t\tif(!virtualLayout || !virtualLayout.useVirtualLayout)\n\t\t\t{\n\t\t\t\t//the old layout was virtual, but this one isn't\n\t\t\t\tif(!this._typicalItemIsInDataProvider && this._typicalItemRenderer)\n\t\t\t\t{\n\t\t\t\t\t//it's safe to destroy this renderer\n\t\t\t\t\tthis.destroyRenderer(this._typicalItemRenderer);\n\t\t\t\t\tthis._typicalItemRenderer = null;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar typicalItemIndex:int = 0;\n\t\t\tvar newTypicalItemIsInDataProvider:Boolean = false;\n\t\t\tvar typicalItem:Object = this._typicalItem;\n\t\t\tif(typicalItem !== null)\n\t\t\t{\n\t\t\t\tif(this._dataProvider)\n\t\t\t\t{\n\t\t\t\t\ttypicalItemIndex = this._dataProvider.getItemIndex(typicalItem);\n\t\t\t\t\tnewTypicalItemIsInDataProvider = typicalItemIndex >= 0;\n\t\t\t\t}\n\t\t\t\tif(typicalItemIndex < 0)\n\t\t\t\t{\n\t\t\t\t\ttypicalItemIndex = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(this._dataProvider && this._dataProvider.length > 0)\n\t\t\t\t{\n\t\t\t\t\tnewTypicalItemIsInDataProvider = true;\n\t\t\t\t\ttypicalItem = this._dataProvider.getItemAt(0);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//#1645 The typicalItem can be null if the data provider contains\n\t\t\t//a null value at index 0. this is the only time we allow null.\n\t\t\tif(typicalItem !== null || newTypicalItemIsInDataProvider)\n\t\t\t{\n\t\t\t\tvar typicalRenderer:IListItemRenderer = IListItemRenderer(this._rendererMap[typicalItem]);\n\t\t\t\tif(typicalRenderer)\n\t\t\t\t{\n\t\t\t\t\t//at this point, the item already has an item renderer.\n\t\t\t\t\t//(this doesn't necessarily mean that the current typical\n\t\t\t\t\t//item was the typical item last time this function was\n\t\t\t\t\t//called)\n\n\t\t\t\t\t//the index may have changed if items were added, removed or\n\t\t\t\t\t//reordered in the data provider\n\t\t\t\t\ttypicalRenderer.index = typicalItemIndex;\n\t\t\t\t\tif(typicalRenderer is IDragAndDropItemRenderer)\n\t\t\t\t\t{\n\t\t\t\t\t\tIDragAndDropItemRenderer(typicalRenderer).dragEnabled = this._dragEnabled;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!typicalRenderer && this._typicalItemRenderer)\n\t\t\t\t{\n\t\t\t\t\t//the typical item has changed, and doesn't have an item\n\t\t\t\t\t//renderer yet. the previous typical item had an item\n\t\t\t\t\t//renderer, so we will try to reuse it.\n\n\t\t\t\t\t//we can reuse the existing typical item renderer if the old\n\t\t\t\t\t//typical item wasn't in the data provider. otherwise, it\n\t\t\t\t\t//may still be needed for the same item.\n\t\t\t\t\tvar canReuse:Boolean = !this._typicalItemIsInDataProvider;\n\t\t\t\t\tvar oldTypicalItemRemoved:Boolean = this._typicalItemIsInDataProvider &&\n\t\t\t\t\t\tthis._dataProvider && this._dataProvider.getItemIndex(this._typicalItemRenderer.data) < 0;\n\t\t\t\t\tif(!canReuse && oldTypicalItemRemoved)\n\t\t\t\t\t{\n\t\t\t\t\t\t//special case: if the old typical item was in the data\n\t\t\t\t\t\t//provider, but it has been removed, it's safe to reuse.\n\t\t\t\t\t\tcanReuse = true;\n\t\t\t\t\t}\n\t\t\t\t\tif(canReuse)\n\t\t\t\t\t{\n\t\t\t\t\t\t//we can't reuse if the factoryID has changed, though!\n\t\t\t\t\t\tvar factoryID:String = null;\n\t\t\t\t\t\tif(this._factoryIDFunction !== null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfactoryID = this.getFactoryID(typicalItem, typicalItemIndex);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(this._typicalItemRenderer.factoryID !== factoryID)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcanReuse = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(canReuse)\n\t\t\t\t\t{\n\t\t\t\t\t\t//we can reuse the item renderer used for the old\n\t\t\t\t\t\t//typical item!\n\n\t\t\t\t\t\t//if the old typical item was in the data provider,\n\t\t\t\t\t\t//remove it from the renderer map.\n\t\t\t\t\t\tif(this._typicalItemIsInDataProvider)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdelete this._rendererMap[this._typicalItemRenderer.data];\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttypicalRenderer = this._typicalItemRenderer;\n\t\t\t\t\t\ttypicalRenderer.data = typicalItem;\n\t\t\t\t\t\ttypicalRenderer.index = typicalItemIndex;\n\t\t\t\t\t\t//if the new typical item is in the data provider, add it\n\t\t\t\t\t\t//to the renderer map.\n\t\t\t\t\t\tif(newTypicalItemIsInDataProvider)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._rendererMap[typicalItem] = typicalRenderer;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!typicalRenderer)\n\t\t\t\t{\n\t\t\t\t\t//if we still don't have a typical item renderer, we need to\n\t\t\t\t\t//create a new one.\n\t\t\t\t\ttypicalRenderer = this.createRenderer(typicalItem, typicalItemIndex, false, !newTypicalItemIsInDataProvider);\n\t\t\t\t\tif(!this._typicalItemIsInDataProvider && this._typicalItemRenderer)\n\t\t\t\t\t{\n\t\t\t\t\t\t//get rid of the old typical item renderer if it isn't\n\t\t\t\t\t\t//needed anymore.  since it was not in the data\n\t\t\t\t\t\t//provider, we don't need to mess with the renderer map\n\t\t\t\t\t\t//dictionary or dispatch any events.\n\t\t\t\t\t\tthis.destroyRenderer(this._typicalItemRenderer);\n\t\t\t\t\t\tthis._typicalItemRenderer = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvirtualLayout.typicalItem = DisplayObject(typicalRenderer);\n\t\t\tthis._typicalItemRenderer = typicalRenderer;\n\t\t\tthis._typicalItemIsInDataProvider = newTypicalItemIsInDataProvider;\n\t\t\tif(this._typicalItemRenderer && !this._typicalItemIsInDataProvider)\n\t\t\t{\n\t\t\t\t//we need to know if this item renderer resizes to adjust the\n\t\t\t\t//layout because the layout may use this item renderer to resize\n\t\t\t\t//the other item renderers\n\t\t\t\tthis._typicalItemRenderer.addEventListener(FeathersEventType.RESIZE, renderer_resizeHandler);\n\t\t\t}\n\t\t}\n\n\t\tprivate function refreshItemRendererStyles():void\n\t\t{\n\t\t\tfor each(var item:DisplayObject in this._layoutItems)\n\t\t\t{\n\t\t\t\tvar itemRenderer:IListItemRenderer = item as IListItemRenderer;\n\t\t\t\tif(itemRenderer)\n\t\t\t\t{\n\t\t\t\t\tthis.refreshOneItemRendererStyles(itemRenderer);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function refreshOneItemRendererStyles(renderer:IListItemRenderer):void\n\t\t{\n\t\t\tvar displayRenderer:DisplayObject = DisplayObject(renderer);\n\t\t\tfor(var propertyName:String in this._itemRendererProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._itemRendererProperties[propertyName];\n\t\t\t\tdisplayRenderer[propertyName] = propertyValue;\n\t\t\t}\n\t\t}\n\n\t\tprivate function refreshSelection():void\n\t\t{\n\t\t\tfor each(var item:DisplayObject in this._layoutItems)\n\t\t\t{\n\t\t\t\tvar itemRenderer:IListItemRenderer = item as IListItemRenderer;\n\t\t\t\tif(itemRenderer)\n\t\t\t\t{\n\t\t\t\t\titemRenderer.isSelected = this._selectedIndices.getItemIndex(itemRenderer.index) >= 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function refreshEnabled():void\n\t\t{\n\t\t\tfor each(var item:DisplayObject in this._layoutItems)\n\t\t\t{\n\t\t\t\tvar control:IFeathersControl = item as IFeathersControl;\n\t\t\t\tif(control)\n\t\t\t\t{\n\t\t\t\t\tcontrol.isEnabled = this._isEnabled;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function refreshViewPortBounds():void\n\t\t{\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinVisibleWidth !== this._explicitMinVisibleWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinVisibleHeight !== this._explicitMinVisibleHeight; //isNaN\n\t\t\tthis._viewPortBounds.x = 0;\n\t\t\tthis._viewPortBounds.y = 0;\n\t\t\tthis._viewPortBounds.scrollX = this._horizontalScrollPosition;\n\t\t\tthis._viewPortBounds.scrollY = this._verticalScrollPosition;\n\t\t\tthis._viewPortBounds.explicitWidth = this.explicitVisibleWidth;\n\t\t\tthis._viewPortBounds.explicitHeight = this.explicitVisibleHeight;\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tthis._viewPortBounds.minWidth = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._viewPortBounds.minWidth = this._explicitMinVisibleWidth;\n\t\t\t}\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tthis._viewPortBounds.minHeight = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._viewPortBounds.minHeight = this._explicitMinVisibleHeight;\n\t\t\t}\n\t\t\tthis._viewPortBounds.maxWidth = this._maxVisibleWidth;\n\t\t\tthis._viewPortBounds.maxHeight = this._maxVisibleHeight;\n\t\t}\n\n\t\tprivate function refreshInactiveRenderers(factoryID:String, itemRendererTypeIsInvalid:Boolean):void\n\t\t{\n\t\t\tif(factoryID !== null)\n\t\t\t{\n\t\t\t\tvar storage:ItemRendererFactoryStorage = ItemRendererFactoryStorage(this._storageMap[factoryID]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstorage = this._defaultStorage;\n\t\t\t}\n\t\t\tvar temp:Vector.<IListItemRenderer> = storage.inactiveItemRenderers;\n\t\t\tstorage.inactiveItemRenderers = storage.activeItemRenderers;\n\t\t\tstorage.activeItemRenderers = temp;\n\t\t\tif(storage.activeItemRenderers.length > 0)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"ListDataViewPort: active renderers should be empty.\");\n\t\t\t}\n\t\t\tif(itemRendererTypeIsInvalid)\n\t\t\t{\n\t\t\t\tthis.recoverInactiveRenderers(storage);\n\t\t\t\tthis.freeInactiveRenderers(storage, 0);\n\t\t\t\tif(this._typicalItemRenderer && this._typicalItemRenderer.factoryID === factoryID)\n\t\t\t\t{\n\t\t\t\t\tif(this._typicalItemIsInDataProvider)\n\t\t\t\t\t{\n\t\t\t\t\t\tdelete this._rendererMap[this._typicalItemRenderer.data];\n\t\t\t\t\t}\n\t\t\t\t\tthis.destroyRenderer(this._typicalItemRenderer);\n\t\t\t\t\tthis._typicalItemRenderer = null;\n\t\t\t\t\tthis._typicalItemIsInDataProvider = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._layoutItems.length = 0;\n\t\t}\n\n\t\tprivate function refreshRenderers():void\n\t\t{\n\t\t\tif(this._typicalItemRenderer)\n\t\t\t{\n\t\t\t\tif(this._typicalItemIsInDataProvider)\n\t\t\t\t{\n\t\t\t\t\tvar storage:ItemRendererFactoryStorage = this.factoryIDToStorage(this._typicalItemRenderer.factoryID);\n\t\t\t\t\tvar inactiveItemRenderers:Vector.<IListItemRenderer> = storage.inactiveItemRenderers;\n\t\t\t\t\tvar activeItemRenderers:Vector.<IListItemRenderer> = storage.activeItemRenderers;\n\t\t\t\t\t//this renderer is already is use by the typical item, so we\n\t\t\t\t\t//don't want to allow it to be used by other items.\n\t\t\t\t\tvar inactiveIndex:int = inactiveItemRenderers.indexOf(this._typicalItemRenderer);\n\t\t\t\t\tif(inactiveIndex >= 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tinactiveItemRenderers[inactiveIndex] = null;\n\t\t\t\t\t}\n\t\t\t\t\t//if refreshLayoutTypicalItem() was called, it will have already\n\t\t\t\t\t//added the typical item renderer to the active renderers. if\n\t\t\t\t\t//not, we need to do it here.\n\t\t\t\t\tvar activeRendererCount:int = activeItemRenderers.length;\n\t\t\t\t\tif(activeRendererCount == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tactiveItemRenderers[activeRendererCount] = this._typicalItemRenderer;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//we need to set the typical item renderer's properties here\n\t\t\t\t//because they may be needed for proper measurement in a virtual\n\t\t\t\t//layout.\n\t\t\t\tthis.refreshOneItemRendererStyles(this._typicalItemRenderer);\n\t\t\t}\n\n\t\t\tthis.findUnrenderedData();\n\t\t\tthis.recoverInactiveRenderers(this._defaultStorage);\n\t\t\tif(this._storageMap)\n\t\t\t{\n\t\t\t\tfor(var factoryID:String in this._storageMap)\n\t\t\t\t{\n\t\t\t\t\tstorage = ItemRendererFactoryStorage(this._storageMap[factoryID]);\n\t\t\t\t\tthis.recoverInactiveRenderers(storage);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.renderUnrenderedData();\n\t\t\tthis.freeInactiveRenderers(this._defaultStorage, this._minimumItemCount);\n\t\t\tif(this._storageMap)\n\t\t\t{\n\t\t\t\tfor(factoryID in this._storageMap)\n\t\t\t\t{\n\t\t\t\t\tstorage = ItemRendererFactoryStorage(this._storageMap[factoryID]);\n\t\t\t\t\tthis.freeInactiveRenderers(storage, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._updateForDataReset = false;\n\t\t}\n\n\t\tprivate function findUnrenderedData():void\n\t\t{\n\t\t\tvar itemCount:int = this._dataProvider ? this._dataProvider.length : 0;\n\t\t\tvar virtualLayout:IVirtualLayout = this._layout as IVirtualLayout;\n\t\t\tvar useVirtualLayout:Boolean = virtualLayout && virtualLayout.useVirtualLayout;\n\t\t\tif(useVirtualLayout)\n\t\t\t{\n\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\tvirtualLayout.measureViewPort(itemCount, this._viewPortBounds, point);\n\t\t\t\tvirtualLayout.getVisibleIndicesAtScrollPosition(this._horizontalScrollPosition, this._verticalScrollPosition, point.x, point.y, itemCount, HELPER_VECTOR);\n\t\t\t\tPool.putPoint(point);\n\t\t\t}\n\n\t\t\tvar unrenderedItemCount:int = useVirtualLayout ? HELPER_VECTOR.length : itemCount;\n\t\t\tif(useVirtualLayout && this._typicalItemIsInDataProvider && this._typicalItemRenderer &&\n\t\t\t\tHELPER_VECTOR.indexOf(this._typicalItemRenderer.index) >= 0)\n\t\t\t{\n\t\t\t\t//add an extra item renderer if the typical item is from the\n\t\t\t\t//data provider and it is visible. this helps keep the number of\n\t\t\t\t//item renderers constant!\n\t\t\t\tthis._minimumItemCount = unrenderedItemCount + 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._minimumItemCount = unrenderedItemCount;\n\t\t\t}\n\t\t\tvar canUseBeforeAndAfter:Boolean = this._layout is ITrimmedVirtualLayout && useVirtualLayout &&\n\t\t\t\t(!(this._layout is IVariableVirtualLayout) || !IVariableVirtualLayout(this._layout).hasVariableItemDimensions) &&\n\t\t\t\tunrenderedItemCount > 0;\n\t\t\tif(canUseBeforeAndAfter)\n\t\t\t{\n\t\t\t\tvar minIndex:int = HELPER_VECTOR[0];\n\t\t\t\tvar maxIndex:int = minIndex;\n\t\t\t\tfor(var i:int = 1; i < unrenderedItemCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar index:int = HELPER_VECTOR[i];\n\t\t\t\t\tif(index < minIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\tminIndex = index;\n\t\t\t\t\t}\n\t\t\t\t\tif(index > maxIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\tmaxIndex = index;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this._layout is ISpinnerLayout &&\n\t\t\t\t\tminIndex == 0 &&\n\t\t\t\t\tmaxIndex == (this._dataProvider.length - 1) &&\n\t\t\t\t\tHELPER_VECTOR[0] > HELPER_VECTOR[HELPER_VECTOR.length - 1])\n\t\t\t\t{\n\t\t\t\t\tvar newMin:int = HELPER_VECTOR[0] - this._dataProvider.length;\n\t\t\t\t\tvar newMax:int = HELPER_VECTOR[HELPER_VECTOR.length - 1];\n\t\t\t\t\tvar beforeItemCount:int = newMin;\n\t\t\t\t\tvar afterItemCount:int = itemCount - 1 - newMax + beforeItemCount;\n\t\t\t\t\tthis._layoutItems.length = HELPER_VECTOR.length;\n\t\t\t\t\tthis._layoutIndexOffset = -beforeItemCount;\n\t\t\t\t\tthis._layoutIndexRolloverIndex = HELPER_VECTOR[0];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbeforeItemCount = minIndex - 1;\n\t\t\t\t\tif(beforeItemCount < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tbeforeItemCount = 0;\n\t\t\t\t\t}\n\t\t\t\t\tafterItemCount = itemCount - 1 - maxIndex;\n\n\t\t\t\t\tthis._layoutItems.length = itemCount - beforeItemCount - afterItemCount;\n\t\t\t\t\tthis._layoutIndexOffset = -beforeItemCount;\n\t\t\t\t\tthis._layoutIndexRolloverIndex = -1;\n\t\t\t\t}\n\t\t\t\tvar trimmedLayout:ITrimmedVirtualLayout = ITrimmedVirtualLayout(this._layout);\n\t\t\t\ttrimmedLayout.beforeVirtualizedItemCount = beforeItemCount;\n\t\t\t\ttrimmedLayout.afterVirtualizedItemCount = afterItemCount;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._layoutIndexOffset = 0;\n\t\t\t\tthis._layoutItems.length = itemCount;\n\t\t\t}\n\n\t\t\tvar unrenderedDataLastIndex:int = this._unrenderedData.length;\n\t\t\tfor(i = 0; i < unrenderedItemCount; i++)\n\t\t\t{\n\t\t\t\tindex = useVirtualLayout ? HELPER_VECTOR[i] : i;\n\t\t\t\tif(index < 0 || index >= itemCount)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tvar item:Object = this._dataProvider.getItemAt(index);\n\t\t\t\tvar itemRenderer:IListItemRenderer = IListItemRenderer(this._rendererMap[item]);\n\t\t\t\tif(this._factoryIDFunction !== null && itemRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\tvar newFactoryID:String = this.getFactoryID(itemRenderer.data, index);\n\t\t\t\t\tif(newFactoryID !== itemRenderer.factoryID)\n\t\t\t\t\t{\n\t\t\t\t\t\titemRenderer = null;\n\t\t\t\t\t\tdelete this._rendererMap[item];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(itemRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\t//the index may have changed if items were added, removed or\n\t\t\t\t\t//reordered in the data provider\n\t\t\t\t\titemRenderer.index = index;\n\t\t\t\t\tif(itemRenderer is IDragAndDropItemRenderer)\n\t\t\t\t\t{\n\t\t\t\t\t\tIDragAndDropItemRenderer(itemRenderer).dragEnabled = this._dragEnabled;\n\t\t\t\t\t}\n\t\t\t\t\t//if this item renderer used to be the typical item\n\t\t\t\t\t//renderer, but it isn't anymore, it may have been set invisible!\n\t\t\t\t\titemRenderer.visible = true;\n\t\t\t\t\tif(this._updateForDataReset)\n\t\t\t\t\t{\n\t\t\t\t\t\t//similar to calling updateItemAt(), replacing the data\n\t\t\t\t\t\t//provider or resetting its source means that we should\n\t\t\t\t\t\t//trick the item renderer into thinking it has new data.\n\t\t\t\t\t\t//many developers seem to expect this behavior, so while\n\t\t\t\t\t\t//it's not the most optimal for performance, it saves on\n\t\t\t\t\t\t//support time in the forums. thankfully, it's still\n\t\t\t\t\t\t//somewhat optimized since the same item renderer will\n\t\t\t\t\t\t//receive the same data, and the children generally\n\t\t\t\t\t\t//won't have changed much, if at all.\n\t\t\t\t\t\titemRenderer.data = null;\n\t\t\t\t\t\titemRenderer.data = item;\n\t\t\t\t\t}\n\n\t\t\t\t\t//the typical item renderer is a special case, and we will\n\t\t\t\t\t//have already put it into the active renderers, so we don't\n\t\t\t\t\t//want to do it again!\n\t\t\t\t\tif(this._typicalItemRenderer !== itemRenderer)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar storage:ItemRendererFactoryStorage = this.factoryIDToStorage(itemRenderer.factoryID);\n\t\t\t\t\t\tvar activeItemRenderers:Vector.<IListItemRenderer> = storage.activeItemRenderers;\n\t\t\t\t\t\tvar inactiveItemRenderers:Vector.<IListItemRenderer> = storage.inactiveItemRenderers;\n\t\t\t\t\t\tactiveItemRenderers[activeItemRenderers.length] = itemRenderer;\n\t\t\t\t\t\tvar inactiveIndex:int = inactiveItemRenderers.indexOf(itemRenderer);\n\t\t\t\t\t\tif(inactiveIndex >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinactiveItemRenderers[inactiveIndex] = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthrow new IllegalOperationError(\"ListDataViewPort: renderer map contains bad data. This may be caused by duplicate items in the data provider, which is not allowed.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(this._layoutIndexRolloverIndex == -1 || index < this._layoutIndexRolloverIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar layoutIndex:int = index + this._layoutIndexOffset;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tlayoutIndex = index - this._dataProvider.length + this._layoutIndexOffset;\n\t\t\t\t\t}\n\t\t\t\t\tthis._layoutItems[layoutIndex] = DisplayObject(itemRenderer);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._unrenderedData[unrenderedDataLastIndex] = item;\n\t\t\t\t\tunrenderedDataLastIndex++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//update the typical item renderer's visibility\n\t\t\tif(this._typicalItemRenderer)\n\t\t\t{\n\t\t\t\tif(useVirtualLayout && this._typicalItemIsInDataProvider)\n\t\t\t\t{\n\t\t\t\t\tindex = HELPER_VECTOR.indexOf(this._typicalItemRenderer.index);\n\t\t\t\t\tif(index >= 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._typicalItemRenderer.visible = true;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._typicalItemRenderer.visible = false;\n\n\t\t\t\t\t\t//uncomment these lines to see a hidden typical item for\n\t\t\t\t\t\t//debugging purposes...\n\t\t\t\t\t\t/*this._typicalItemRenderer.visible = true;\n\t\t\t\t\t\tthis._typicalItemRenderer.x = this._horizontalScrollPosition;\n\t\t\t\t\t\tthis._typicalItemRenderer.y = this._verticalScrollPosition;*/\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._typicalItemRenderer.visible = this._typicalItemIsInDataProvider;\n\t\t\t\t}\n\t\t\t}\n\t\t\tHELPER_VECTOR.length = 0;\n\t\t}\n\n\t\tprivate function renderUnrenderedData():void\n\t\t{\n\t\t\tvar itemCount:int = this._unrenderedData.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = this._unrenderedData.shift();\n\t\t\t\tvar index:int = this._dataProvider.getItemIndex(item);\n\t\t\t\tvar renderer:IListItemRenderer = this.createRenderer(item, index, true, false);\n\t\t\t\trenderer.visible = true;\n\t\t\t\tif(this._layoutIndexRolloverIndex == -1 || index < this._layoutIndexRolloverIndex)\n\t\t\t\t{\n\t\t\t\t\tvar layoutIndex:int = index + this._layoutIndexOffset;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tlayoutIndex = index - this._dataProvider.length + this._layoutIndexOffset;\n\t\t\t\t}\n\t\t\t\tthis._layoutItems[layoutIndex] = DisplayObject(renderer);\n\t\t\t}\n\t\t}\n\n\t\tprivate function recoverInactiveRenderers(storage:ItemRendererFactoryStorage):void\n\t\t{\n\t\t\tvar inactiveItemRenderers:Vector.<IListItemRenderer> = storage.inactiveItemRenderers;\n\n\t\t\tvar itemCount:int = inactiveItemRenderers.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar itemRenderer:IListItemRenderer = inactiveItemRenderers[i];\n\t\t\t\tif(!itemRenderer || itemRenderer.index < 0)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tthis._owner.dispatchEventWith(FeathersEventType.RENDERER_REMOVE, false, itemRenderer);\n\t\t\t\tdelete this._rendererMap[itemRenderer.data];\n\t\t\t}\n\t\t}\n\n\t\tprivate function freeInactiveRenderers(storage:ItemRendererFactoryStorage, minimumItemCount:int):void\n\t\t{\n\t\t\tvar inactiveItemRenderers:Vector.<IListItemRenderer> = storage.inactiveItemRenderers;\n\t\t\tvar activeItemRenderers:Vector.<IListItemRenderer> = storage.activeItemRenderers;\n\t\t\tvar activeItemRenderersCount:int = activeItemRenderers.length;\n\n\t\t\t//we may keep around some extra renderers to avoid too much\n\t\t\t//allocation and garbage collection. they'll be hidden.\n\t\t\tvar itemCount:int = inactiveItemRenderers.length;\n\t\t\tvar keepCount:int = minimumItemCount - activeItemRenderersCount;\n\t\t\tif(keepCount > itemCount)\n\t\t\t{\n\t\t\t\tkeepCount = itemCount;\n\t\t\t}\n\t\t\tfor(var i:int = 0; i < keepCount; i++)\n\t\t\t{\n\t\t\t\tvar itemRenderer:IListItemRenderer = inactiveItemRenderers.shift();\n\t\t\t\tif(!itemRenderer)\n\t\t\t\t{\n\t\t\t\t\tkeepCount++;\n\t\t\t\t\tif(itemCount < keepCount)\n\t\t\t\t\t{\n\t\t\t\t\t\tkeepCount = itemCount;\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\titemRenderer.data = null;\n\t\t\t\titemRenderer.index = -1;\n\t\t\t\titemRenderer.visible = false;\n\t\t\t\tactiveItemRenderers[activeItemRenderersCount] = itemRenderer;\n\t\t\t\tactiveItemRenderersCount++;\n\t\t\t}\n\t\t\titemCount -= keepCount;\n\t\t\tfor(i = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\titemRenderer = inactiveItemRenderers.shift();\n\t\t\t\tif(!itemRenderer)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tthis.destroyRenderer(itemRenderer);\n\t\t\t}\n\t\t}\n\n\t\tprivate function createRenderer(item:Object, index:int, useCache:Boolean, isTemporary:Boolean):IListItemRenderer\n\t\t{\n\t\t\tvar factoryID:String = null;\n\t\t\tif(this._factoryIDFunction !== null)\n\t\t\t{\n\t\t\t\tfactoryID = this.getFactoryID(item, index);\n\t\t\t}\n\t\t\tvar itemRendererFactory:Function = this.factoryIDToFactory(factoryID);\n\t\t\tvar storage:ItemRendererFactoryStorage = this.factoryIDToStorage(factoryID);\n\t\t\tvar inactiveItemRenderers:Vector.<IListItemRenderer> = storage.inactiveItemRenderers;\n\t\t\tvar activeItemRenderers:Vector.<IListItemRenderer> = storage.activeItemRenderers;\n\t\t\tvar itemRenderer:IListItemRenderer;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tif(!useCache || isTemporary || inactiveItemRenderers.length == 0)\n\t\t\t\t{\n\t\t\t\t\tif(itemRendererFactory !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\titemRenderer = IListItemRenderer(itemRendererFactory());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\titemRenderer = IListItemRenderer(new this._itemRendererType());\n\t\t\t\t\t}\n\t\t\t\t\tif(this._customItemRendererStyleName && this._customItemRendererStyleName.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\titemRenderer.styleNameList.add(this._customItemRendererStyleName);\n\t\t\t\t\t}\n\t\t\t\t\tthis.addChild(DisplayObject(itemRenderer));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\titemRenderer = inactiveItemRenderers.shift();\n\t\t\t\t}\n\t\t\t\t//wondering why this all is in a loop?\n\t\t\t\t//_inactiveRenderers.shift() may return null because we're\n\t\t\t\t//storing null values instead of calling splice() to improve\n\t\t\t\t//performance.\n\t\t\t}\n\t\t\twhile(!itemRenderer);\n\t\t\titemRenderer.data = item;\n\t\t\titemRenderer.index = index;\n\t\t\titemRenderer.owner = this._owner;\n\t\t\titemRenderer.factoryID = factoryID;\n\t\t\tif(itemRenderer is IDragAndDropItemRenderer)\n\t\t\t{\n\t\t\t\tIDragAndDropItemRenderer(itemRenderer).dragEnabled = this._dragEnabled;\n\t\t\t}\n\n\t\t\tif(!isTemporary)\n\t\t\t{\n\t\t\t\tthis._rendererMap[item] = itemRenderer;\n\t\t\t\tactiveItemRenderers[activeItemRenderers.length] = itemRenderer;\n\t\t\t\titemRenderer.addEventListener(Event.TRIGGERED, renderer_triggeredHandler);\n\t\t\t\titemRenderer.addEventListener(Event.CHANGE, renderer_changeHandler);\n\t\t\t\titemRenderer.addEventListener(FeathersEventType.RESIZE, renderer_resizeHandler);\n\t\t\t\titemRenderer.addEventListener(TouchEvent.TOUCH, itemRenderer_drag_touchHandler);\n\t\t\t\tthis._owner.dispatchEventWith(FeathersEventType.RENDERER_ADD, false, itemRenderer);\n\t\t\t}\n\n\t\t\treturn itemRenderer;\n\t\t}\n\n\t\tprivate function destroyRenderer(renderer:IListItemRenderer):void\n\t\t{\n\t\t\trenderer.removeEventListener(Event.TRIGGERED, renderer_triggeredHandler);\n\t\t\trenderer.removeEventListener(Event.CHANGE, renderer_changeHandler);\n\t\t\trenderer.removeEventListener(FeathersEventType.RESIZE, renderer_resizeHandler);\n\t\t\trenderer.removeEventListener(TouchEvent.TOUCH, itemRenderer_drag_touchHandler);\n\t\t\trenderer.owner = null;\n\t\t\trenderer.data = null;\n\t\t\trenderer.factoryID = null;\n\t\t\tthis.removeChild(DisplayObject(renderer), true);\n\t\t}\n\n\t\tprivate function getFactoryID(item:Object, index:int):String\n\t\t{\n\t\t\tif(this._factoryIDFunction === null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif(this._factoryIDFunction.length == 1)\n\t\t\t{\n\t\t\t\treturn this._factoryIDFunction(item);\n\t\t\t}\n\t\t\treturn this._factoryIDFunction(item, index);\n\t\t}\n\n\t\tprivate function factoryIDToFactory(id:String):Function\n\t\t{\n\t\t\tif(id !== null)\n\t\t\t{\n\t\t\t\tif(id in this._itemRendererFactories)\n\t\t\t\t{\n\t\t\t\t\treturn this._itemRendererFactories[id] as Function;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthrow new ReferenceError(\"Cannot find item renderer factory for ID \\\"\" + id + \"\\\".\");\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this._itemRendererFactory;\n\t\t}\n\n\t\tprivate function factoryIDToStorage(id:String):ItemRendererFactoryStorage\n\t\t{\n\t\t\tif(id !== null)\n\t\t\t{\n\t\t\t\tif(id in this._storageMap)\n\t\t\t\t{\n\t\t\t\t\treturn ItemRendererFactoryStorage(this._storageMap[id]);\n\t\t\t\t}\n\t\t\t\tvar storage:ItemRendererFactoryStorage = new ItemRendererFactoryStorage();\n\t\t\t\tthis._storageMap[id] = storage;\n\t\t\t\treturn storage;\n\t\t\t}\n\t\t\treturn this._defaultStorage;\n\t\t}\n\n\t\tprotected function refreshDropIndicator(localX:Number, localY:Number):void\n\t\t{\n\t\t\tif(!this._dropIndicatorSkin || !(this._layout is IDragDropLayout))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar layout:IDragDropLayout = IDragDropLayout(this._layout);\n\t\t\tthis._dropIndicatorSkin.width = this._explicitDropIndicatorWidth;\n\t\t\tthis._dropIndicatorSkin.height = this._explicitDropIndicatorHeight;\n\n\t\t\tvar dropX:Number = this._horizontalScrollPosition + localX;\n\t\t\tvar dropY:Number = this._verticalScrollPosition + localY;\n\t\t\tvar dropIndex:int = layout.getDropIndex(dropX, dropY,\n\t\t\t\tthis._layoutItems, 0, 0, this.actualVisibleWidth, this.actualVisibleHeight);\n\t\t\tlayout.positionDropIndicator(this._dropIndicatorSkin, dropIndex,\n\t\t\t\tdropX, dropY, this._layoutItems, this.actualVisibleWidth, this.actualVisibleHeight);\n\t\t\tthis.addChild(this._dropIndicatorSkin);\n\t\t}\n\n\t\tprivate function childProperties_onChange(proxy:PropertyProxy, name:String):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\tprivate function dataProvider_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\tprivate function dataProvider_addItemHandler(event:Event, index:int):void\n\t\t{\n\t\t\tvar layout:IVariableVirtualLayout = this._layout as IVariableVirtualLayout;\n\t\t\tif(!layout || !layout.hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlayout.addToVariableVirtualCacheAtIndex(index);\n\t\t}\n\n\t\tprivate function dataProvider_removeItemHandler(event:Event, index:int):void\n\t\t{\n\t\t\tvar layout:IVariableVirtualLayout = this._layout as IVariableVirtualLayout;\n\t\t\tif(!layout || !layout.hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlayout.removeFromVariableVirtualCacheAtIndex(index);\n\t\t}\n\n\t\tprivate function dataProvider_replaceItemHandler(event:Event, index:int):void\n\t\t{\n\t\t\tvar layout:IVariableVirtualLayout = this._layout as IVariableVirtualLayout;\n\t\t\tif(!layout || !layout.hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlayout.resetVariableVirtualCacheAtIndex(index);\n\t\t}\n\n\t\tprivate function dataProvider_resetHandler(event:Event):void\n\t\t{\n\t\t\tthis._updateForDataReset = true;\n\n\t\t\tvar layout:IVariableVirtualLayout = this._layout as IVariableVirtualLayout;\n\t\t\tif(!layout || !layout.hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlayout.resetVariableVirtualCache();\n\t\t}\n\n\t\tprivate function dataProvider_filterChangeHandler(event:Event):void\n\t\t{\n\t\t\tvar layout:IVariableVirtualLayout = this._layout as IVariableVirtualLayout;\n\t\t\tif(!layout || !layout.hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//we don't know exactly which indices have changed, so reset the\n\t\t\t//whole cache.\n\t\t\tlayout.resetVariableVirtualCache();\n\t\t}\n\n\t\tprivate function dataProvider_updateItemHandler(event:Event, index:int):void\n\t\t{\n\t\t\tvar item:Object = this._dataProvider.getItemAt(index);\n\t\t\tvar renderer:IListItemRenderer = IListItemRenderer(this._rendererMap[item]);\n\t\t\tif(renderer === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//in order to display the same item with modified properties, this\n\t\t\t//hack tricks the item renderer into thinking that it has been given\n\t\t\t//a different item to render.\n\t\t\trenderer.data = null;\n\t\t\trenderer.data = item;\n\t\t\tif(this.explicitVisibleWidth !== this.explicitVisibleWidth || //isNaN\n\t\t\t\tthis.explicitVisibleHeight !== this.explicitVisibleHeight) //isNaN\n\t\t\t{\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\tthis.invalidateParent(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\tprivate function dataProvider_updateAllHandler(event:Event):void\n\t\t{\n\t\t\t//we're treating this similar to the RESET event because enough\n\t\t\t//users are treating UPDATE_ALL similarly. technically, UPDATE_ALL\n\t\t\t//is supposed to affect only existing items, but it's confusing when\n\t\t\t//new items are added and not displayed.\n\t\t\tthis._updateForDataReset = true;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\n\t\t\tvar layout:IVariableVirtualLayout = this._layout as IVariableVirtualLayout;\n\t\t\tif(!layout || !layout.hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlayout.resetVariableVirtualCache();\n\t\t}\n\n\t\tprivate function layout_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreLayoutChanges)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t\tthis.invalidateParent(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\tprivate function renderer_resizeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreRendererResizing)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t\tthis.invalidateParent(INVALIDATION_FLAG_LAYOUT);\n\t\t\tif(event.currentTarget === this._typicalItemRenderer && !this._typicalItemIsInDataProvider)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar layout:IVariableVirtualLayout = this._layout as IVariableVirtualLayout;\n\t\t\tif(!layout || !layout.hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar renderer:IListItemRenderer = IListItemRenderer(event.currentTarget);\n\t\t\tlayout.resetVariableVirtualCacheAtIndex(renderer.index, DisplayObject(renderer));\n\t\t}\n\n\t\tprivate function renderer_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tvar renderer:IListItemRenderer = IListItemRenderer(event.currentTarget);\n\t\t\tthis.parent.dispatchEventWith(Event.TRIGGERED, false, renderer.data);\n\t\t}\n\n\t\tprivate function renderer_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreSelectionChanges)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar renderer:IListItemRenderer = IListItemRenderer(event.currentTarget);\n\t\t\tif(!this._isSelectable || this._owner.isScrolling)\n\t\t\t{\n\t\t\t\trenderer.isSelected = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar isSelected:Boolean = renderer.isSelected;\n\t\t\tvar index:int = renderer.index;\n\t\t\tif(this._allowMultipleSelection)\n\t\t\t{\n\t\t\t\tvar indexOfIndex:int = this._selectedIndices.getItemIndex(index);\n\t\t\t\tif(isSelected && indexOfIndex < 0)\n\t\t\t\t{\n\t\t\t\t\tthis._selectedIndices.addItem(index);\n\t\t\t\t}\n\t\t\t\telse if(!isSelected && indexOfIndex >= 0)\n\t\t\t\t{\n\t\t\t\t\tthis._selectedIndices.removeItemAt(indexOfIndex);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(isSelected)\n\t\t\t{\n\t\t\t\tthis._selectedIndices.data = new <int>[index];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._selectedIndices.removeAll();\n\t\t\t}\n\t\t}\n\n\t\tprivate function selectedIndices_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\n\t\tprivate function addedItemEffectContext_completeHandler(event:Event):void\n\t\t{\n\t\t\tvar context:IEffectContext = IEffectContext(event.currentTarget);\n\t\t\tcontext.removeEventListener(Event.COMPLETE, addedItemEffectContext_completeHandler);\n\t\t\tvar index:int = this._addItemEffectContexts.indexOf(context);\n\t\t\tthis._addItemEffectContexts.removeAt(index);\n\t\t}\n\n\t\tprivate function removedItemEffectContext_completeHandler(event:Event):void\n\t\t{\n\t\t\tvar context:IEffectContext = IEffectContext(event.currentTarget);\n\t\t\tcontext.removeEventListener(Event.COMPLETE, removedItemEffectContext_completeHandler);\n\t\t\tvar contextIndex:int = this._removeItemEffectContexts.indexOf(context);\n\t\t\tthis._removeItemEffectContexts.removeAt(contextIndex);\n\t\t\t//if it was stopped before completing, we won't remove the item from\n\t\t\t//the data provider\n\t\t\tif(event.data === true)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar itemRenderer:IListItemRenderer = IListItemRenderer(context.target);\n\t\t\t//don't remove it from the data provider until the effect is done\n\t\t\t//because we don't want to remove it from the layout yet\n\t\t\tthis._dataProvider.removeItem(itemRenderer.data);\n\n\t\t\t//we're going to completely destroy this item renderer because the\n\t\t\t//effect may have left it in a state where it won't be valid for\n\t\t\t//use by a new item. for instance, if the item faded out, it would\n\t\t\t//start out invisible (unless an item added effect faded it back in,\n\t\t\t//but we can't assume that).\n\n\t\t\t//recover\n\t\t\tthis._owner.dispatchEventWith(FeathersEventType.RENDERER_REMOVE, false, itemRenderer);\n\t\t\tdelete this._rendererMap[itemRenderer.data];\n\n\t\t\t//free\n\t\t\tvar storage:ItemRendererFactoryStorage = this.factoryIDToStorage(itemRenderer.factoryID);\n\t\t\tvar activeItemRenderers:Vector.<IListItemRenderer> = storage.activeItemRenderers;\n\t\t\tvar activeIndex:int = activeItemRenderers.indexOf(itemRenderer);\n\t\t\tactiveItemRenderers.removeAt(activeIndex);\n\t\t\tthis.destroyRenderer(itemRenderer);\n\t\t}\n\n\t\tprotected function dragEnterHandler(event:DragDropEvent):void\n\t\t{\n\t\t\tthis._acceptedDrag = false;\n\t\t\tif(!this._dropEnabled)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!event.dragData.hasDataForFormat(this._dragFormat))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tDragDropManager.acceptDrag(this._owner);\n\t\t\tthis.refreshDropIndicator(event.localX, event.localY);\n\n\t\t\tthis._acceptedDrag = true;\n\t\t\tthis._dragLocalX = event.localX;\n\t\t\tthis._dragLocalY = event.localY;\n\t\t\tthis.addEventListener(Event.ENTER_FRAME, dragScroll_enterFrameHandler);\n\t\t}\n\n\t\tprotected function dragMoveHandler(event:DragDropEvent):void\n\t\t{\n\t\t\tif(!this._dropEnabled)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!event.dragData.hasDataForFormat(this._dragFormat))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.refreshDropIndicator(event.localX, event.localY);\n\n\t\t\tthis._dragLocalX = event.localX;\n\t\t\tthis._dragLocalY = event.localY;\n\t\t}\n\n\t\tprotected function dragScroll_enterFrameHandler(event:EnterFrameEvent):void\n\t\t{\n\t\t\tvar starling:Starling = this.stage.starling;\n\t\t\tvar minAutoScrollPixels:Number = this._minimumAutoScrollDistance * (DeviceCapabilities.dpi / starling.contentScaleFactor);\n\t\t\tvar velocity:Number = event.passedTime * 500;\n\t\t\tif(this._owner.maxVerticalScrollPosition > this._owner.minVerticalScrollPosition)\n\t\t\t{\n\t\t\t\tif(this._verticalScrollPosition < this._owner.maxVerticalScrollPosition &&\n\t\t\t\t\tthis._dragLocalY > (this.visibleHeight - minAutoScrollPixels))\n\t\t\t\t{\n\t\t\t\t\tvelocity *= (1 - ((this.visibleHeight - this._dragLocalY) / minAutoScrollPixels));\n\t\t\t\t}\n\t\t\t\telse if(this._verticalScrollPosition > this._owner.minVerticalScrollPosition &&\n\t\t\t\t\tthis._dragLocalY < minAutoScrollPixels)\n\t\t\t\t{\n\t\t\t\t\tvelocity *= -(1 - (this._dragLocalY / minAutoScrollPixels));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvelocity = 0;\n\t\t\t\t}\n\t\t\t\tif(velocity != 0)\n\t\t\t\t{\n\t\t\t\t\tvar verticalScrollPosition:Number = this._owner.verticalScrollPosition + velocity;\n\t\t\t\t\tif(verticalScrollPosition > this._owner.maxVerticalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tverticalScrollPosition = this._owner.maxVerticalScrollPosition;\n\t\t\t\t\t}\n\t\t\t\t\telse if(verticalScrollPosition < this._owner.minVerticalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tverticalScrollPosition = this._owner.minVerticalScrollPosition;\n\t\t\t\t\t}\n\t\t\t\t\tthis._owner.verticalScrollPosition = verticalScrollPosition;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._owner.maxHorizontalScrollPosition > this._owner.minHorizontalScrollPosition)\n\t\t\t{\n\t\t\t\tif(this._horizontalScrollPosition < this._owner.maxHorizontalScrollPosition &&\n\t\t\t\t\tthis._dragLocalX > (this.visibleWidth - minAutoScrollPixels))\n\t\t\t\t{\n\t\t\t\t\tvelocity *= (1 - ((this.visibleWidth - this._dragLocalX) / minAutoScrollPixels));\n\t\t\t\t}\n\t\t\t\telse if(this._horizontalScrollPosition > this._owner.minHorizontalScrollPosition &&\n\t\t\t\t\tthis._dragLocalX < minAutoScrollPixels)\n\t\t\t\t{\n\t\t\t\t\tvelocity *= -(1 - (this._dragLocalX / minAutoScrollPixels));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvelocity = 0;\n\t\t\t\t}\n\t\t\t\tif(velocity != 0)\n\t\t\t\t{\n\t\t\t\t\tvar horizontalScrollPosition:Number = this._owner.horizontalScrollPosition + velocity;\n\t\t\t\t\tif(horizontalScrollPosition > this._owner.maxHorizontalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\thorizontalScrollPosition = this._owner.maxHorizontalScrollPosition;\n\t\t\t\t\t}\n\t\t\t\t\telse if(horizontalScrollPosition < this._owner.minHorizontalScrollPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\thorizontalScrollPosition = this._owner.minHorizontalScrollPosition;\n\t\t\t\t\t}\n\t\t\t\t\tthis._owner.horizontalScrollPosition = horizontalScrollPosition;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprotected function dragExitHandler(event:DragDropEvent):void\n\t\t{\n\t\t\tthis._acceptedDrag = false;\n\t\t\tif(this._dropIndicatorSkin)\n\t\t\t{\n\t\t\t\tthis._dropIndicatorSkin.removeFromParent(false);\n\t\t\t}\n\t\t\tthis._dragLocalX = -1;\n\t\t\tthis._dragLocalY = -1;\n\t\t\tthis.removeEventListener(Event.ENTER_FRAME, dragScroll_enterFrameHandler);\n\t\t}\n\n\t\tprotected function dragDropHandler(event:DragDropEvent):void\n\t\t{\n\t\t\tthis._acceptedDrag = false;\n\t\t\tif(this._dropIndicatorSkin)\n\t\t\t{\n\t\t\t\tthis._dropIndicatorSkin.removeFromParent(false);\n\t\t\t}\n\t\t\tthis._dragLocalX = -1;\n\t\t\tthis._dragLocalY = -1;\n\t\t\tthis.removeEventListener(Event.ENTER_FRAME, dragScroll_enterFrameHandler);\n\n\t\t\tvar item:Object = event.dragData.getDataForFormat(this._dragFormat);\n\t\t\tvar dropIndex:int = this._dataProvider.length;\n\t\t\tif(this._layout is IDragDropLayout)\n\t\t\t{\n\t\t\t\tvar layout:IDragDropLayout = IDragDropLayout(this._layout);\n\t\t\t\tdropIndex = layout.getDropIndex(\n\t\t\t\t\tthis._horizontalScrollPosition + event.localX,\n\t\t\t\t\tthis._verticalScrollPosition + event.localY,\n\t\t\t\t\tthis._layoutItems, 0, 0, this.actualVisibleWidth, this.actualVisibleHeight);\n\t\t\t}\n\t\t\tvar dropOffset:int = 0;\n\t\t\tif(event.dragSource == this._owner)\n\t\t\t{\n\t\t\t\tvar oldIndex:int = this._dataProvider.getItemIndex(item);\n\t\t\t\tif(oldIndex < dropIndex)\n\t\t\t\t{\n\t\t\t\t\tdropOffset = -1;\n\t\t\t\t}\n\n\t\t\t\t//if we wait to remove this item in the dragComplete handler,\n\t\t\t\t//the wrong index might be removed.\n\t\t\t\tthis._dataProvider.removeItem(item);\n\t\t\t\tthis._droppedOnSelf = true;\n\t\t\t}\n\t\t\tthis._dataProvider.addItemAt(item, dropIndex + dropOffset);\n\t\t}\n\n\t\tprotected function dragCompleteHandler(event:DragDropEvent):void\n\t\t{\n\t\t\tif(!event.isDropped)\n\t\t\t{\n\t\t\t\t//nothing to modify\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._droppedOnSelf)\n\t\t\t{\n\t\t\t\t//already modified the data provider in the dragDrop handler\n\t\t\t\tthis._droppedOnSelf = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar item:Object = event.dragData.getDataForFormat(this._dragFormat);\n\t\t\tthis._dataProvider.removeItem(item);\n\t\t}\n\n\t\tprotected function itemRenderer_drag_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._dragEnabled || !this.stage)\n\t\t\t{\n\t\t\t\tthis._dragTouchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar itemRenderer:IListItemRenderer = IListItemRenderer(event.currentTarget);\n\t\t\tif(DragDropManager.isDragging)\n\t\t\t{\n\t\t\t\tthis._dragTouchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(itemRenderer is IDragAndDropItemRenderer)\n\t\t\t{\n\t\t\t\tvar dragProxy:DisplayObject = IDragAndDropItemRenderer(itemRenderer).dragProxy;\n\t\t\t\tif(dragProxy)\n\t\t\t\t{\n\t\t\t\t\tvar touch:Touch = event.getTouch(dragProxy, null, this._dragTouchPointID);\n\t\t\t\t\tif(!touch)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._dragTouchPointID != -1)\n\t\t\t{\n\t\t\t\tvar exclusiveTouch:ExclusiveTouch = ExclusiveTouch.forStage(this.stage);\n\t\t\t\tif(exclusiveTouch.getClaim(this._dragTouchPointID))\n\t\t\t\t{\n\t\t\t\t\tthis._dragTouchPointID = -1;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttouch = event.getTouch(DisplayObject(itemRenderer), null, this._dragTouchPointID);\n\t\t\t\tif(touch.phase == TouchPhase.MOVED)\n\t\t\t\t{\n\t\t\t\t\tvar point:Point = touch.getLocation(this, Pool.getPoint());\n\t\t\t\t\tvar currentDragX:Number = point.x;\n\t\t\t\t\tvar currentDragY:Number = point.y;\n\t\t\t\t\tPool.putPoint(point);\n\n\t\t\t\t\tvar starling:Starling = this.stage.starling;\n\t\t\t\t\tvar verticalInchesMoved:Number = (currentDragX - this._startDragX) / (DeviceCapabilities.dpi / starling.contentScaleFactor);\n\t\t\t\t\tvar horizontalInchesMoved:Number = (currentDragY - this._startDragY) / (DeviceCapabilities.dpi / starling.contentScaleFactor);\n\t\t\t\t\tif(Math.abs(horizontalInchesMoved) > this._minimumDragDropDistance ||\n\t\t\t\t\t\tMath.abs(verticalInchesMoved) > this._minimumDragDropDistance)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar dragData:DragData = new DragData();\n\t\t\t\t\t\tdragData.setDataForFormat(this._dragFormat, itemRenderer.data);\n\n\t\t\t\t\t\t//we don't create a new item renderer here because\n\t\t\t\t\t\t//it might remove accessories or icons from the original\n\t\t\t\t\t\t//item renderer that is still visible in the list.\n\t\t\t\t\t\tvar avatar:RenderDelegate = new RenderDelegate(DisplayObject(itemRenderer));\n\t\t\t\t\t\tavatar.touchable = false;\n\t\t\t\t\t\tavatar.alpha = 0.8;\n\n\t\t\t\t\t\tthis._droppedOnSelf = false;\n\t\t\t\t\t\tpoint = touch.getLocation(DisplayObject(itemRenderer), Pool.getPoint());\n\t\t\t\t\t\tDragDropManager.startDrag(this._owner, touch, dragData, DisplayObject(avatar), -point.x, -point.y);\n\t\t\t\t\t\tPool.putPoint(point);\n\t\t\t\t\t\texclusiveTouch.claimTouch(this._dragTouchPointID, DisplayObject(itemRenderer));\n\t\t\t\t\t\tthis._dragTouchPointID = -1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(touch.phase == TouchPhase.ENDED)\n\t\t\t\t{\n\t\t\t\t\tthis._dragTouchPointID = -1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//we aren't tracking another touch, so let's look for a new one.\n\t\t\t\ttouch = event.getTouch(DisplayObject(itemRenderer), TouchPhase.BEGAN);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\t//we only care about the began phase. ignore all other\n\t\t\t\t\t//phases when we don't have a saved touch ID.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._dragTouchPointID = touch.id;\n\t\t\t\tpoint = touch.getLocation(this, Pool.getPoint());\n\t\t\t\tthis._startDragX = point.x;\n\t\t\t\tthis._startDragY = point.y;\n\t\t\t\tPool.putPoint(point);\n\t\t\t}\n\t\t}\n\t}\n}\n\nimport feathers.controls.renderers.IListItemRenderer;\n\nclass ItemRendererFactoryStorage\n{\n\tpublic function ItemRendererFactoryStorage()\n\t{\n\n\t}\n\n\tpublic var activeItemRenderers:Vector.<IListItemRenderer> = new <IListItemRenderer>[];\n\tpublic var inactiveItemRenderers:Vector.<IListItemRenderer> = new <IListItemRenderer>[];\n}"
  },
  {
    "path": "source/feathers/controls/supportClasses/TextFieldViewPort.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.supportClasses\n{\n\timport feathers.core.FeathersControl;\n\timport feathers.text.FontStylesSet;\n\timport feathers.utils.geom.matrixToRotation;\n\timport feathers.utils.geom.matrixToScaleX;\n\timport feathers.utils.geom.matrixToScaleY;\n\n\timport flash.display.Sprite;\n\timport flash.events.TextEvent;\n\timport flash.geom.Matrix;\n\timport flash.geom.Point;\n\timport flash.geom.Rectangle;\n\timport flash.text.AntiAliasType;\n\timport flash.text.FontType;\n\timport flash.text.GridFitType;\n\timport flash.text.StyleSheet;\n\timport flash.text.TextField;\n\timport flash.text.TextFieldAutoSize;\n\timport flash.text.TextFormat;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.rendering.Painter;\n\timport starling.text.TextFormat;\n\timport starling.utils.MatrixUtil;\n\timport starling.utils.Pool;\n\timport starling.utils.SystemUtil;\n\n\t/**\n\t * @private\n\t * Used internally by ScrollText. Not meant to be used on its own.\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class TextFieldViewPort extends FeathersControl implements IViewPort\n\t{\n\t\tpublic function TextFieldViewPort()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);\n\t\t\tthis.addEventListener(Event.REMOVED_FROM_STAGE, removedFromStageHandler);\n\t\t}\n\n\t\tprivate var _textFieldContainer:Sprite;\n\t\tprivate var _textField:TextField;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get nativeFocus():TextField\n\t\t{\n\t\t\treturn this._textField;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _text:String = \"\";\n\n\t\t/**\n\t\t * @see feathers.controls.ScrollText#text\n\t\t */\n\t\tpublic function get text():String\n\t\t{\n\t\t\treturn this._text;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set text(value:String):void\n\t\t{\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = \"\";\n\t\t\t}\n\t\t\tif(this._text == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._text = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _isHTML:Boolean = false;\n\n\t\t/**\n\t\t * @see feathers.controls.ScrollText#isHTML\n\t\t */\n\t\tpublic function get isHTML():Boolean\n\t\t{\n\t\t\treturn this._isHTML;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isHTML(value:Boolean):void\n\t\t{\n\t\t\tif(this._isHTML == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isHTML = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fontStylesTextFormat:flash.text.TextFormat;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fontStyles:FontStylesSet;\n\n\t\t/**\n\t\t * Generic font styles.\n\t\t */\n\t\tpublic function get fontStyles():FontStylesSet\n\t\t{\n\t\t\treturn this._fontStyles;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set fontStyles(value:FontStylesSet):void\n\t\t{\n\t\t\tif(this._fontStyles === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._fontStyles !== null)\n\t\t\t{\n\t\t\t\tthis._fontStyles.removeEventListener(Event.CHANGE, fontStylesSet_changeHandler);\n\t\t\t}\n\t\t\tthis._fontStyles = value;\n\t\t\tif(this._fontStyles !== null)\n\t\t\t{\n\t\t\t\tthis._fontStyles.addEventListener(Event.CHANGE, fontStylesSet_changeHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _currentTextFormat:flash.text.TextFormat;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _textFormat:flash.text.TextFormat;\n\n\t\t/**\n\t\t * @see feathers.controls.ScrollText#textFormat\n\t\t */\n\t\tpublic function get textFormat():flash.text.TextFormat\n\t\t{\n\t\t\treturn this._textFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set textFormat(value:flash.text.TextFormat):void\n\t\t{\n\t\t\tif(this._textFormat == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textFormat = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _disabledTextFormat:flash.text.TextFormat;\n\n\t\t/**\n\t\t * @see feathers.controls.ScrollText#disabledTextFormat\n\t\t */\n\t\tpublic function get disabledTextFormat():flash.text.TextFormat\n\t\t{\n\t\t\treturn this._disabledTextFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disabledTextFormat(value:flash.text.TextFormat):void\n\t\t{\n\t\t\tif(this._disabledTextFormat == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._disabledTextFormat = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _styleSheet:StyleSheet;\n\n\t\t/**\n\t\t * @see feathers.controls.ScrollText#styleSheet\n\t\t */\n\t\tpublic function get styleSheet():StyleSheet\n\t\t{\n\t\t\treturn this._styleSheet;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set styleSheet(value:StyleSheet):void\n\t\t{\n\t\t\tif(this._styleSheet == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._styleSheet = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _embedFonts:Boolean = false;\n\n\t\t/**\n\t\t * @see feathers.controls.ScrollText#embedFonts\n\t\t */\n\t\tpublic function get embedFonts():Boolean\n\t\t{\n\t\t\treturn this._embedFonts;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set embedFonts(value:Boolean):void\n\t\t{\n\t\t\tif(this._embedFonts == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._embedFonts = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _antiAliasType:String = AntiAliasType.ADVANCED;\n\n\t\t/**\n\t\t * @see feathers.controls.ScrollText#antiAliasType\n\t\t */\n\t\tpublic function get antiAliasType():String\n\t\t{\n\t\t\treturn this._antiAliasType;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set antiAliasType(value:String):void\n\t\t{\n\t\t\tif(this._antiAliasType == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._antiAliasType = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _background:Boolean = false;\n\n\t\t/**\n\t\t * @see feathers.controls.ScrollText#background\n\t\t */\n\t\tpublic function get background():Boolean\n\t\t{\n\t\t\treturn this._background;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set background(value:Boolean):void\n\t\t{\n\t\t\tif(this._background == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._background = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _backgroundColor:uint = 0xffffff;\n\n\t\t/**\n\t\t * @see feathers.controls.ScrollText#backgroundColor\n\t\t */\n\t\tpublic function get backgroundColor():uint\n\t\t{\n\t\t\treturn this._backgroundColor;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundColor(value:uint):void\n\t\t{\n\t\t\tif(this._backgroundColor == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._backgroundColor = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _border:Boolean = false;\n\n\t\t/**\n\t\t * @see feathers.controls.ScrollText#border\n\t\t */\n\t\tpublic function get border():Boolean\n\t\t{\n\t\t\treturn this._border;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set border(value:Boolean):void\n\t\t{\n\t\t\tif(this._border == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._border = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _borderColor:uint = 0x000000;\n\n\t\t/**\n\t\t * @see feathers.controls.ScrollText#borderColor\n\t\t */\n\t\tpublic function get borderColor():uint\n\t\t{\n\t\t\treturn this._borderColor;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set borderColor(value:uint):void\n\t\t{\n\t\t\tif(this._borderColor == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._borderColor = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _cacheAsBitmap:Boolean = true;\n\n\t\t/**\n\t\t * @see feathers.controls.ScrollText#cacheAsBitmap\n\t\t */\n\t\tpublic function get cacheAsBitmap():Boolean\n\t\t{\n\t\t\treturn this._cacheAsBitmap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set cacheAsBitmap(value:Boolean):void\n\t\t{\n\t\t\tif(this._cacheAsBitmap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._cacheAsBitmap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _condenseWhite:Boolean = false;\n\n\t\t/**\n\t\t * @see feathers.controls.ScrollText#condenseWhite\n\t\t */\n\t\tpublic function get condenseWhite():Boolean\n\t\t{\n\t\t\treturn this._condenseWhite;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set condenseWhite(value:Boolean):void\n\t\t{\n\t\t\tif(this._condenseWhite == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._condenseWhite = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _displayAsPassword:Boolean = false;\n\n\t\t/**\n\t\t * @see feathers.controls.ScrollText#displayAsPassword\n\t\t */\n\t\tpublic function get displayAsPassword():Boolean\n\t\t{\n\t\t\treturn this._displayAsPassword;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set displayAsPassword(value:Boolean):void\n\t\t{\n\t\t\tif(this._displayAsPassword == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._displayAsPassword = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _gridFitType:String = GridFitType.PIXEL;\n\n\t\t/**\n\t\t * @see feathers.controls.ScrollText#gridFitType\n\t\t */\n\t\tpublic function get gridFitType():String\n\t\t{\n\t\t\treturn this._gridFitType;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set gridFitType(value:String):void\n\t\t{\n\t\t\tif(this._gridFitType == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._gridFitType = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _sharpness:Number = 0;\n\n\t\t/**\n\t\t * @see feathers.controls.ScrollText#sharpness\n\t\t */\n\t\tpublic function get sharpness():Number\n\t\t{\n\t\t\treturn this._sharpness;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set sharpness(value:Number):void\n\t\t{\n\t\t\tif(this._sharpness == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._sharpness = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _thickness:Number = 0;\n\n\t\t/**\n\t\t * @see feathers.controls.ScrollText#thickness\n\t\t */\n\t\tpublic function get thickness():Number\n\t\t{\n\t\t\treturn this._thickness;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set thickness(value:Number):void\n\t\t{\n\t\t\tif(this._thickness == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._thickness = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\tprivate var _actualMinVisibleWidth:Number = 0;\n\n\t\tprivate var _explicitMinVisibleWidth:Number;\n\n\t\tpublic function get minVisibleWidth():Number\n\t\t{\n\t\t\tif(this._explicitMinVisibleWidth !== this._explicitMinVisibleWidth) //isNaN\n\t\t\t{\n\t\t\t\treturn this._actualMinVisibleWidth;\n\t\t\t}\n\t\t\treturn this._explicitMinVisibleWidth;\n\t\t}\n\n\t\tpublic function set minVisibleWidth(value:Number):void\n\t\t{\n\t\t\tif(this._explicitMinVisibleWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar valueIsNaN:Boolean = value !== value; //isNaN\n\t\t\tif(valueIsNaN &&\n\t\t\t\tthis._explicitMinVisibleWidth !== this._explicitMinVisibleWidth) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar oldValue:Number = this._explicitMinVisibleWidth;\n\t\t\tthis._explicitMinVisibleWidth = value;\n\t\t\tif(valueIsNaN)\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleWidth = 0;\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleWidth = value;\n\t\t\t\tif(this._explicitVisibleWidth !== this._explicitVisibleWidth && //isNaN\n\t\t\t\t\t(this._actualVisibleWidth < value || this._actualVisibleWidth == oldValue))\n\t\t\t\t{\n\t\t\t\t\t//only invalidate if this change might affect the visibleWidth\n\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate var _maxVisibleWidth:Number = Number.POSITIVE_INFINITY;\n\n\t\tpublic function get maxVisibleWidth():Number\n\t\t{\n\t\t\treturn this._maxVisibleWidth;\n\t\t}\n\n\t\tpublic function set maxVisibleWidth(value:Number):void\n\t\t{\n\t\t\tif(this._maxVisibleWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value) //isNaN\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"maxVisibleWidth cannot be NaN\");\n\t\t\t}\n\t\t\tvar oldValue:Number = this._maxVisibleWidth;\n\t\t\tthis._maxVisibleWidth = value;\n\t\t\tif(this._explicitVisibleWidth !== this._explicitVisibleWidth && //isNaN\n\t\t\t\t(this._actualVisibleWidth > value || this._actualVisibleWidth == oldValue))\n\t\t\t{\n\t\t\t\t//only invalidate if this change might affect the visibleWidth\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\tprivate var _actualVisibleWidth:Number = 0;\n\n\t\tprivate var _explicitVisibleWidth:Number = NaN;\n\n\t\tpublic function get visibleWidth():Number\n\t\t{\n\t\t\tif(this._explicitVisibleWidth !== this._explicitVisibleWidth) //isNaN\n\t\t\t{\n\t\t\t\treturn this._actualVisibleWidth;\n\t\t\t}\n\t\t\treturn this._explicitVisibleWidth;\n\t\t}\n\n\t\tpublic function set visibleWidth(value:Number):void\n\t\t{\n\t\t\tif(this._explicitVisibleWidth == value ||\n\t\t\t\t(value !== value && this._explicitVisibleWidth !== this._explicitVisibleWidth)) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._explicitVisibleWidth = value;\n\t\t\tif(this._actualVisibleWidth != value)\n\t\t\t{\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\tprivate var _actualMinVisibleHeight:Number = 0;\n\n\t\tprivate var _explicitMinVisibleHeight:Number;\n\n\t\tpublic function get minVisibleHeight():Number\n\t\t{\n\t\t\tif(this._explicitMinVisibleHeight !== this._explicitMinVisibleHeight) //isNaN\n\t\t\t{\n\t\t\t\treturn this._actualMinVisibleHeight;\n\t\t\t}\n\t\t\treturn this._explicitMinVisibleHeight;\n\t\t}\n\n\t\tpublic function set minVisibleHeight(value:Number):void\n\t\t{\n\t\t\tif(this._explicitMinVisibleHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar valueIsNaN:Boolean = value !== value; //isNaN\n\t\t\tif(valueIsNaN &&\n\t\t\t\tthis._explicitMinVisibleHeight !== this._explicitMinVisibleHeight) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar oldValue:Number = this._explicitMinVisibleHeight;\n\t\t\tthis._explicitMinVisibleHeight = value;\n\t\t\tif(valueIsNaN)\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleHeight = 0;\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleHeight = value;\n\t\t\t\tif(this._explicitVisibleHeight !== this._explicitVisibleHeight && //isNaN\n\t\t\t\t\t(this._actualVisibleHeight < value || this._actualVisibleHeight == oldValue))\n\t\t\t\t{\n\t\t\t\t\t//only invalidate if this change might affect the visibleHeight\n\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate var _maxVisibleHeight:Number = Number.POSITIVE_INFINITY;\n\n\t\tpublic function get maxVisibleHeight():Number\n\t\t{\n\t\t\treturn this._maxVisibleHeight;\n\t\t}\n\n\t\tpublic function set maxVisibleHeight(value:Number):void\n\t\t{\n\t\t\tif(this._maxVisibleHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value) //isNaN\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"maxVisibleHeight cannot be NaN\");\n\t\t\t}\n\t\t\tvar oldValue:Number = this._maxVisibleHeight;\n\t\t\tthis._maxVisibleHeight = value;\n\t\t\tif(this._explicitVisibleHeight !== this._explicitVisibleHeight && //isNaN\n\t\t\t\t(this._actualVisibleHeight > value || this._actualVisibleHeight == oldValue))\n\t\t\t{\n\t\t\t\t//only invalidate if this change might affect the visibleHeight\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\tprivate var _actualVisibleHeight:Number = 0;\n\n\t\tprivate var _explicitVisibleHeight:Number = NaN;\n\n\t\tpublic function get visibleHeight():Number\n\t\t{\n\t\t\tif(this._explicitVisibleHeight !== this._explicitVisibleHeight) //isNaN\n\t\t\t{\n\t\t\t\treturn this._actualVisibleHeight;\n\t\t\t}\n\t\t\treturn this._explicitVisibleHeight;\n\t\t}\n\n\t\tpublic function set visibleHeight(value:Number):void\n\t\t{\n\t\t\tif(this._explicitVisibleHeight == value ||\n\t\t\t\t(value !== value && this._explicitVisibleHeight !== this._explicitVisibleHeight)) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._explicitVisibleHeight = value;\n\t\t\tif(this._actualVisibleHeight != value)\n\t\t\t{\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\tpublic function get contentX():Number\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\n\t\tpublic function get contentY():Number\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\n\t\tprivate var _scrollStep:Number;\n\n\t\tpublic function get horizontalScrollStep():Number\n\t\t{\n\t\t\treturn this._scrollStep;\n\t\t}\n\n\t\tpublic function get verticalScrollStep():Number\n\t\t{\n\t\t\treturn this._scrollStep;\n\t\t}\n\n\t\tprivate var _horizontalScrollPosition:Number = 0;\n\n\t\tpublic function get horizontalScrollPosition():Number\n\t\t{\n\t\t\treturn this._horizontalScrollPosition;\n\t\t}\n\n\t\tpublic function set horizontalScrollPosition(value:Number):void\n\t\t{\n\t\t\tif(this._horizontalScrollPosition == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalScrollPosition = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t}\n\n\t\tprivate var _verticalScrollPosition:Number = 0;\n\n\t\tpublic function get verticalScrollPosition():Number\n\t\t{\n\t\t\treturn this._verticalScrollPosition;\n\t\t}\n\n\t\tpublic function set verticalScrollPosition(value:Number):void\n\t\t{\n\t\t\tif(this._verticalScrollPosition == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalScrollPosition = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t}\n\n\t\tpublic function get requiresMeasurementOnScroll():Boolean\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tprivate var _paddingTop:Number = 0;\n\n\t\tpublic function get paddingTop():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\tpublic function set paddingTop(value:Number):void\n\t\t{\n\t\t\tif(this._paddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingTop = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\tprivate var _paddingRight:Number = 0;\n\n\t\tpublic function get paddingRight():Number\n\t\t{\n\t\t\treturn this._paddingRight;\n\t\t}\n\n\t\tpublic function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this._paddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingRight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\tprivate var _paddingBottom:Number = 0;\n\n\t\tpublic function get paddingBottom():Number\n\t\t{\n\t\t\treturn this._paddingBottom;\n\t\t}\n\n\t\tpublic function set paddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this._paddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingBottom = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\tprivate var _paddingLeft:Number = 0;\n\n\t\tpublic function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\tpublic function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this._paddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingLeft = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\toverride public function render(painter:Painter):void\n\t\t{\n\t\t\t//this component is an overlay above Starling, and it should be\n\t\t\t//excluded from the render cache\n\t\t\tpainter.excludeFromCache(this);\n\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar starlingViewPort:Rectangle = starling.viewPort;\n\t\t\tvar matrix:Matrix = Pool.getMatrix();\n\t\t\tvar point:Point = Pool.getPoint();\n\t\t\tthis.parent.getTransformationMatrix(this.stage, matrix);\n\t\t\tMatrixUtil.transformCoords(matrix, 0, 0, point);\n\t\t\tvar nativeScaleFactor:Number = 1;\n\t\t\tif(starling.supportHighResolutions)\n\t\t\t{\n\t\t\t\tnativeScaleFactor = starling.nativeStage.contentsScaleFactor;\n\t\t\t}\n\t\t\tvar scaleFactor:Number = starling.contentScaleFactor / nativeScaleFactor;\n\t\t\tthis._textFieldContainer.x = starlingViewPort.x + point.x * scaleFactor;\n\t\t\tthis._textFieldContainer.y = starlingViewPort.y + point.y * scaleFactor;\n\t\t\tthis._textFieldContainer.scaleX = matrixToScaleX(matrix) * scaleFactor;\n\t\t\tthis._textFieldContainer.scaleY = matrixToScaleY(matrix) * scaleFactor;\n\t\t\tthis._textFieldContainer.rotation = matrixToRotation(matrix) * 180 / Math.PI;\n\t\t\tthis._textFieldContainer.alpha = painter.state.alpha;\n\t\t\tPool.putPoint(point);\n\t\t\tPool.putMatrix(matrix);\n\t\t\tsuper.render(painter);\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tthis._textFieldContainer = new Sprite();\n\t\t\tthis._textFieldContainer.visible = false;\n\t\t\tthis._textField = new TextField();\n\t\t\tthis._textField.autoSize = TextFieldAutoSize.LEFT;\n\t\t\tthis._textField.selectable = false;\n\t\t\tthis._textField.mouseWheelEnabled = false;\n\t\t\tthis._textField.wordWrap = true;\n\t\t\tthis._textField.multiline = true;\n\t\t\tthis._textField.addEventListener(TextEvent.LINK, textField_linkHandler);\n\t\t\tthis._textFieldContainer.addChild(this._textField);\n\t\t}\n\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\tvar scrollInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SCROLL);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\n\t\t\tif(stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshTextFormat();\n\t\t\t\tthis._textField.antiAliasType = this._antiAliasType;\n\t\t\t\tthis._textField.background = this._background;\n\t\t\t\tthis._textField.backgroundColor = this._backgroundColor;\n\t\t\t\tthis._textField.border = this._border;\n\t\t\t\tthis._textField.borderColor = this._borderColor;\n\t\t\t\tthis._textField.condenseWhite = this._condenseWhite;\n\t\t\t\tthis._textField.displayAsPassword = this._displayAsPassword;\n\t\t\t\tthis._textField.gridFitType = this._gridFitType;\n\t\t\t\tthis._textField.sharpness = this._sharpness;\n\t\t\t\tthis._textField.thickness = this._thickness;\n\t\t\t\tthis._textField.cacheAsBitmap = this._cacheAsBitmap;\n\t\t\t\tthis._textField.x = this._paddingLeft;\n\t\t\t\tthis._textField.y = this._paddingTop;\n\t\t\t}\n\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tif(dataInvalid || stylesInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tif(this._styleSheet !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._textField.embedFonts = this._embedFonts;\n\t\t\t\t\tthis._textField.styleSheet = this._styleSheet;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(!this._embedFonts &&\n\t\t\t\t\t\tthis._currentTextFormat === this._fontStylesTextFormat)\n\t\t\t\t\t{\n\t\t\t\t\t\t//when font styles are passed in from the parent component, we\n\t\t\t\t\t\t//automatically determine if the TextField should use embedded\n\t\t\t\t\t\t//fonts, unless embedFonts is explicitly true\n\t\t\t\t\t\tthis._textField.embedFonts = SystemUtil.isEmbeddedFont(\n\t\t\t\t\t\t\tthis._currentTextFormat.font, this._currentTextFormat.bold,\n\t\t\t\t\t\t\tthis._currentTextFormat.italic, FontType.EMBEDDED);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._textField.embedFonts = this._embedFonts;\n\t\t\t\t\t}\n\t\t\t\t\tthis._textField.styleSheet = null;\n\t\t\t\t\tthis._textField.defaultTextFormat = this._currentTextFormat;\n\t\t\t\t}\n\t\t\t\tif(this._isHTML)\n\t\t\t\t{\n\t\t\t\t\tthis._textField.htmlText = this._text;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._textField.text = this._text;\n\t\t\t\t}\n\t\t\t\tthis._scrollStep = this._textField.getLineMetrics(0).height * starling.contentScaleFactor;\n\t\t\t}\n\n\t\t\tvar calculatedVisibleWidth:Number = this._explicitVisibleWidth;\n\t\t\tif(calculatedVisibleWidth != calculatedVisibleWidth)\n\t\t\t{\n\t\t\t\tif(this.stage !== null)\n\t\t\t\t{\n\t\t\t\t\tcalculatedVisibleWidth = this.stage.stageWidth;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcalculatedVisibleWidth = starling.stage.stageWidth;\n\t\t\t\t}\n\t\t\t\tif(calculatedVisibleWidth < this._explicitMinVisibleWidth)\n\t\t\t\t{\n\t\t\t\t\tcalculatedVisibleWidth = this._explicitMinVisibleWidth;\n\t\t\t\t}\n\t\t\t\telse if(calculatedVisibleWidth > this._maxVisibleWidth)\n\t\t\t\t{\n\t\t\t\t\tcalculatedVisibleWidth = this._maxVisibleWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._textField.width = calculatedVisibleWidth - this._paddingLeft - this._paddingRight;\n\t\t\tvar totalContentHeight:Number = this._textField.height + this._paddingTop + this._paddingBottom;\n\t\t\tvar calculatedVisibleHeight:Number = this._explicitVisibleHeight;\n\t\t\tif(calculatedVisibleHeight != calculatedVisibleHeight)\n\t\t\t{\n\t\t\t\tcalculatedVisibleHeight = totalContentHeight;\n\t\t\t\tif(calculatedVisibleHeight < this._explicitMinVisibleHeight)\n\t\t\t\t{\n\t\t\t\t\tcalculatedVisibleHeight = this._explicitMinVisibleHeight;\n\t\t\t\t}\n\t\t\t\telse if(calculatedVisibleHeight > this._maxVisibleHeight)\n\t\t\t\t{\n\t\t\t\t\tcalculatedVisibleHeight = this._maxVisibleHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tsizeInvalid = this.saveMeasurements(\n\t\t\t\tcalculatedVisibleWidth, totalContentHeight,\n\t\t\t\tcalculatedVisibleWidth, totalContentHeight) || sizeInvalid;\n\t\t\tthis._actualVisibleWidth = calculatedVisibleWidth;\n\t\t\tthis._actualVisibleHeight = calculatedVisibleHeight;\n\t\t\tthis._actualMinVisibleWidth = calculatedVisibleWidth;\n\t\t\tthis._actualMinVisibleHeight = calculatedVisibleHeight;\n\n\t\t\tif(sizeInvalid || scrollInvalid)\n\t\t\t{\n\t\t\t\tvar scrollRect:Rectangle = this._textFieldContainer.scrollRect;\n\t\t\t\tif(!scrollRect)\n\t\t\t\t{\n\t\t\t\t\tscrollRect = new Rectangle();\n\t\t\t\t}\n\t\t\t\tscrollRect.width = calculatedVisibleWidth;\n\t\t\t\tscrollRect.height = calculatedVisibleHeight;\n\t\t\t\tscrollRect.x = this._horizontalScrollPosition;\n\t\t\t\tscrollRect.y = this._verticalScrollPosition;\n\t\t\t\tthis._textFieldContainer.scrollRect = scrollRect;\n\t\t\t}\n\t\t}\n\n\t\tprotected function refreshTextFormat():void\n\t\t{\n\t\t\tif(!this._isEnabled && this._disabledTextFormat !== null)\n\t\t\t{\n\t\t\t\tthis._currentTextFormat = this._disabledTextFormat;\n\t\t\t}\n\t\t\telse if(this._textFormat !== null)\n\t\t\t{\n\t\t\t\tthis._currentTextFormat = this._textFormat;\n\t\t\t}\n\t\t\telse if(this._fontStyles !== null)\n\t\t\t{\n\t\t\t\tthis._currentTextFormat = this.getTextFormatFromFontStyles();\n\t\t\t}\n\t\t}\n\n\t\tprotected function getTextFormatFromFontStyles():flash.text.TextFormat\n\t\t{\n\t\t\tif(this.isInvalid(INVALIDATION_FLAG_STYLES) ||\n\t\t\t\tthis.isInvalid(INVALIDATION_FLAG_STATE))\n\t\t\t{\n\t\t\t\tvar fontStylesFormat:starling.text.TextFormat;\n\t\t\t\tif(this._fontStyles !== null)\n\t\t\t\t{\n\t\t\t\t\tfontStylesFormat = this._fontStyles.getTextFormatForTarget(this);\n\t\t\t\t}\n\t\t\t\tif(fontStylesFormat !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._fontStylesTextFormat = fontStylesFormat.toNativeFormat(this._fontStylesTextFormat);\n\t\t\t\t}\n\t\t\t\telse if(this._fontStylesTextFormat === null)\n\t\t\t\t{\n\t\t\t\t\t//fallback to a default so that something is displayed\n\t\t\t\t\tthis._fontStylesTextFormat = new flash.text.TextFormat();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this._fontStylesTextFormat;\n\t\t}\n\n\t\tprivate function addedToStageHandler(event:Event):void\n\t\t{\n\t\t\tthis.stage.starling.nativeStage.addChild(this._textFieldContainer);\n\t\t\tthis.addEventListener(Event.ENTER_FRAME, enterFrameHandler);\n\t\t}\n\n\t\tprivate function removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tthis.stage.starling.nativeStage.removeChild(this._textFieldContainer);\n\t\t\tthis.removeEventListener(Event.ENTER_FRAME, enterFrameHandler);\n\t\t}\n\n\t\tprivate function enterFrameHandler(event:Event):void\n\t\t{\n\t\t\tvar target:DisplayObject = this;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tif(!target.visible)\n\t\t\t\t{\n\t\t\t\t\tthis._textFieldContainer.visible = false;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttarget = target.parent;\n\t\t\t}\n\t\t\twhile(target);\n\t\t\tthis._textFieldContainer.visible = true;\n\t\t}\n\n\t\tprotected function textField_linkHandler(event:TextEvent):void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.TRIGGERED, false, event.text);\n\t\t}\n\n\t\tprotected function fontStylesSet_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/supportClasses/TreeDataViewPort.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.supportClasses\n{\n\timport feathers.controls.Scroller;\n\timport feathers.controls.Tree;\n\timport feathers.controls.renderers.ITreeItemRenderer;\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IValidating;\n\timport feathers.data.IHierarchicalCollection;\n\timport feathers.data.IListCollection;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.ILayout;\n\timport feathers.layout.IVariableVirtualLayout;\n\timport feathers.layout.IVirtualLayout;\n\timport feathers.layout.LayoutBoundsResult;\n\timport feathers.layout.ViewPortBounds;\n\n\timport flash.errors.IllegalOperationError;\n\timport flash.geom.Point;\n\timport flash.utils.Dictionary;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.utils.Pool;\n\n\t/**\n\t * @private\n\t * Used internally by Tree. Not meant to be used on its own.\n\t *\n\t * @productversion Feathers 3.3.0\n\t */\n\tpublic class TreeDataViewPort extends FeathersControl implements IViewPort\n\t{\n\t\tprivate static const INVALIDATION_FLAG_ITEM_RENDERER_FACTORY:String = \"itemRendererFactory\";\n\t\tprivate static const HELPER_VECTOR:Vector.<int> = new <int>[];\n\t\tprivate static const LOCATION_HELPER_VECTOR:Vector.<int> = new <int>[];\n\n\t\tpublic function TreeDataViewPort()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprivate var _viewPortBounds:ViewPortBounds = new ViewPortBounds();\n\n\t\tprivate var _layoutResult:LayoutBoundsResult = new LayoutBoundsResult();\n\n\t\tprivate var _actualMinVisibleWidth:Number = 0;\n\n\t\tprivate var _explicitMinVisibleWidth:Number;\n\n\t\tpublic function get minVisibleWidth():Number\n\t\t{\n\t\t\tif(this._explicitMinVisibleWidth !== this._explicitMinVisibleWidth) //isNaN\n\t\t\t{\n\t\t\t\treturn this._actualMinVisibleWidth;\n\t\t\t}\n\t\t\treturn this._explicitMinVisibleWidth;\n\t\t}\n\n\t\tpublic function set minVisibleWidth(value:Number):void\n\t\t{\n\t\t\tif(this._explicitMinVisibleWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar valueIsNaN:Boolean = value !== value; //isNaN\n\t\t\tif(valueIsNaN &&\n\t\t\t\tthis._explicitMinVisibleWidth !== this._explicitMinVisibleWidth) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar oldValue:Number = this._explicitMinVisibleWidth;\n\t\t\tthis._explicitMinVisibleWidth = value;\n\t\t\tif(valueIsNaN)\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleWidth = 0;\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleWidth = value;\n\t\t\t\tif(this._explicitVisibleWidth !== this._explicitVisibleWidth && //isNaN\n\t\t\t\t\t(this._actualVisibleWidth < value || this._actualVisibleWidth == oldValue))\n\t\t\t\t{\n\t\t\t\t\t//only invalidate if this change might affect the visibleWidth\n\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate var _maxVisibleWidth:Number = Number.POSITIVE_INFINITY;\n\n\t\tpublic function get maxVisibleWidth():Number\n\t\t{\n\t\t\treturn this._maxVisibleWidth;\n\t\t}\n\n\t\tpublic function set maxVisibleWidth(value:Number):void\n\t\t{\n\t\t\tif(this._maxVisibleWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value) //isNaN\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"maxVisibleWidth cannot be NaN\");\n\t\t\t}\n\t\t\tvar oldValue:Number = this._maxVisibleWidth;\n\t\t\tthis._maxVisibleWidth = value;\n\t\t\tif(this._explicitVisibleWidth !== this._explicitVisibleWidth && //isNaN\n\t\t\t\t(this._actualVisibleWidth > value || this._actualVisibleWidth == oldValue))\n\t\t\t{\n\t\t\t\t//only invalidate if this change might affect the visibleWidth\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\tprivate var _actualVisibleWidth:Number = NaN;\n\n\t\tprivate var _explicitVisibleWidth:Number = NaN;\n\n\t\tpublic function get visibleWidth():Number\n\t\t{\n\t\t\treturn this._actualVisibleWidth;\n\t\t}\n\n\t\tpublic function set visibleWidth(value:Number):void\n\t\t{\n\t\t\tif(this._explicitVisibleWidth == value ||\n\t\t\t\t(value !== value && this._explicitVisibleWidth !== this._explicitVisibleWidth)) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._explicitVisibleWidth = value;\n\t\t\tif(this._actualVisibleWidth != value)\n\t\t\t{\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\tprivate var _actualMinVisibleHeight:Number = 0;\n\n\t\tprivate var _explicitMinVisibleHeight:Number;\n\n\t\tpublic function get minVisibleHeight():Number\n\t\t{\n\t\t\tif(this._explicitMinVisibleHeight !== this._explicitMinVisibleHeight) //isNaN\n\t\t\t{\n\t\t\t\treturn this._actualMinVisibleHeight;\n\t\t\t}\n\t\t\treturn this._explicitMinVisibleHeight;\n\t\t}\n\n\t\tpublic function set minVisibleHeight(value:Number):void\n\t\t{\n\t\t\tif(this._explicitMinVisibleHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar valueIsNaN:Boolean = value !== value; //isNaN\n\t\t\tif(valueIsNaN &&\n\t\t\t\tthis._explicitMinVisibleHeight !== this._explicitMinVisibleHeight) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar oldValue:Number = this._explicitMinVisibleHeight;\n\t\t\tthis._explicitMinVisibleHeight = value;\n\t\t\tif(valueIsNaN)\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleHeight = 0;\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleHeight = value;\n\t\t\t\tif(this._explicitVisibleHeight !== this._explicitVisibleHeight && //isNaN\n\t\t\t\t\t(this._actualVisibleHeight < value || this._actualVisibleHeight == oldValue))\n\t\t\t\t{\n\t\t\t\t\t//only invalidate if this change might affect the visibleHeight\n\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate var _maxVisibleHeight:Number = Number.POSITIVE_INFINITY;\n\n\t\tpublic function get maxVisibleHeight():Number\n\t\t{\n\t\t\treturn this._maxVisibleHeight;\n\t\t}\n\n\t\tpublic function set maxVisibleHeight(value:Number):void\n\t\t{\n\t\t\tif(this._maxVisibleHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value) //isNaN\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"maxVisibleHeight cannot be NaN\");\n\t\t\t}\n\t\t\tvar oldValue:Number = this._maxVisibleHeight;\n\t\t\tthis._maxVisibleHeight = value;\n\t\t\tif(this._explicitVisibleHeight !== this._explicitVisibleHeight && //isNaN\n\t\t\t\t(this._actualVisibleHeight > value || this._actualVisibleHeight == oldValue))\n\t\t\t{\n\t\t\t\t//only invalidate if this change might affect the visibleHeight\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\tprivate var _actualVisibleHeight:Number;\n\n\t\tprivate var _explicitVisibleHeight:Number = NaN;\n\n\t\tpublic function get visibleHeight():Number\n\t\t{\n\t\t\treturn this._actualVisibleHeight;\n\t\t}\n\n\t\tpublic function set visibleHeight(value:Number):void\n\t\t{\n\t\t\tif(this._explicitVisibleHeight == value ||\n\t\t\t\t(value !== value && this._explicitVisibleHeight !== this._explicitVisibleHeight)) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._explicitVisibleHeight = value;\n\t\t\tif(this._actualVisibleHeight != value)\n\t\t\t{\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\tprotected var _contentX:Number = 0;\n\n\t\tpublic function get contentX():Number\n\t\t{\n\t\t\treturn this._contentX;\n\t\t}\n\n\t\tprotected var _contentY:Number = 0;\n\n\t\tpublic function get contentY():Number\n\t\t{\n\t\t\treturn this._contentY;\n\t\t}\n\n\t\tpublic function get horizontalScrollStep():Number\n\t\t{\n\t\t\tvar itemRenderer:DisplayObject = null;\n\t\t\tvar virtualLayout:IVirtualLayout = this._layout as IVirtualLayout;\n\t\t\tif(virtualLayout === null || !virtualLayout.useVirtualLayout)\n\t\t\t{\n\t\t\t\tif(this._layoutItems.length > 0)\n\t\t\t\t{\n\t\t\t\t\titemRenderer = this._layoutItems[0] as DisplayObject;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(itemRenderer === null)\n\t\t\t{\n\t\t\t\titemRenderer = this._typicalItemRenderer as DisplayObject;\n\t\t\t}\n\t\t\tif(itemRenderer === null)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tvar itemRendererWidth:Number = itemRenderer.width;\n\t\t\tvar itemRendererHeight:Number = itemRenderer.height;\n\t\t\tif(itemRendererWidth < itemRendererHeight)\n\t\t\t{\n\t\t\t\treturn itemRendererWidth;\n\t\t\t}\n\t\t\treturn itemRendererHeight;\n\t\t}\n\n\t\tpublic function get verticalScrollStep():Number\n\t\t{\n\t\t\tvar itemRenderer:DisplayObject = null;\n\t\t\tvar virtualLayout:IVirtualLayout = this._layout as IVirtualLayout;\n\t\t\tif(virtualLayout === null || !virtualLayout.useVirtualLayout)\n\t\t\t{\n\t\t\t\tif(this._layoutItems.length > 0)\n\t\t\t\t{\n\t\t\t\t\titemRenderer = this._layoutItems[0] as DisplayObject;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(itemRenderer === null)\n\t\t\t{\n\t\t\t\titemRenderer = this._typicalItemRenderer as DisplayObject;\n\t\t\t}\n\t\t\tif(itemRenderer === null)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tvar itemRendererWidth:Number = itemRenderer.width;\n\t\t\tvar itemRendererHeight:Number = itemRenderer.height;\n\t\t\tif(itemRendererWidth < itemRendererHeight)\n\t\t\t{\n\t\t\t\treturn itemRendererWidth;\n\t\t\t}\n\t\t\treturn itemRendererHeight;\n\t\t}\n\n\t\tprivate var _owner:Tree = null;\n\n\t\tpublic function get owner():Tree\n\t\t{\n\t\t\treturn this._owner;\n\t\t}\n\n\t\tpublic function set owner(value:Tree):void\n\t\t{\n\t\t\tthis._owner = value;\n\t\t}\n\n\t\tprivate var _updateForDataReset:Boolean = false;\n\n\t\tprivate var _dataProvider:IHierarchicalCollection = null;\n\n\t\tpublic function get dataProvider():IHierarchicalCollection\n\t\t{\n\t\t\treturn this._dataProvider;\n\t\t}\n\n\t\tpublic function set dataProvider(value:IHierarchicalCollection):void\n\t\t{\n\t\t\tif(this._dataProvider == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._dataProvider)\n\t\t\t{\n\t\t\t\tthis._dataProvider.removeEventListener(Event.CHANGE, dataProvider_changeHandler);\n\t\t\t\t/*this._dataProvider.removeEventListener(CollectionEventType.RESET, dataProvider_resetHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.ADD_ITEM, dataProvider_addItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.REMOVE_ITEM, dataProvider_removeItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.REPLACE_ITEM, dataProvider_replaceItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.UPDATE_ITEM, dataProvider_updateItemHandler);\n\t\t\t\tthis._dataProvider.removeEventListener(CollectionEventType.UPDATE_ALL, dataProvider_updateAllHandler);*/\n\t\t\t}\n\t\t\tthis._dataProvider = value;\n\t\t\tif(this._dataProvider)\n\t\t\t{\n\t\t\t\tthis._dataProvider.addEventListener(Event.CHANGE, dataProvider_changeHandler);\n\t\t\t\t/*this._dataProvider.addEventListener(CollectionEventType.RESET, dataProvider_resetHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.ADD_ITEM, dataProvider_addItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.REMOVE_ITEM, dataProvider_removeItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.REPLACE_ITEM, dataProvider_replaceItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.UPDATE_ITEM, dataProvider_updateItemHandler);\n\t\t\t\tthis._dataProvider.addEventListener(CollectionEventType.UPDATE_ALL, dataProvider_updateAllHandler);*/\n\t\t\t}\n\t\t\tif(this._layout is IVariableVirtualLayout)\n\t\t\t{\n\t\t\t\tIVariableVirtualLayout(this._layout).resetVariableVirtualCache();\n\t\t\t}\n\t\t\tthis._updateForDataReset = true;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\tprivate var _ignoreLayoutChanges:Boolean = false;\n\t\tprivate var _ignoreRendererResizing:Boolean = false;\n\n\t\tprivate var _layout:ILayout = null;\n\n\t\tpublic function get layout():ILayout\n\t\t{\n\t\t\treturn this._layout;\n\t\t}\n\n\t\tpublic function set layout(value:ILayout):void\n\t\t{\n\t\t\tif(this._layout == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._layout)\n\t\t\t{\n\t\t\t\tthis._layout.removeEventListener(Event.CHANGE, layout_changeHandler);\n\t\t\t}\n\t\t\tthis._layout = value;\n\t\t\tif(this._layout)\n\t\t\t{\n\t\t\t\tif(this._layout is IVariableVirtualLayout)\n\t\t\t\t{\n\t\t\t\t\tvar variableVirtualLayout:IVariableVirtualLayout = IVariableVirtualLayout(this._layout);\n\t\t\t\t\tvariableVirtualLayout.resetVariableVirtualCache();\n\t\t\t\t}\n\t\t\t\tthis._layout.addEventListener(Event.CHANGE, layout_changeHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\tprivate var _horizontalScrollPosition:Number = 0;\n\n\t\tpublic function get horizontalScrollPosition():Number\n\t\t{\n\t\t\treturn this._horizontalScrollPosition;\n\t\t}\n\n\t\tpublic function set horizontalScrollPosition(value:Number):void\n\t\t{\n\t\t\tif(this._horizontalScrollPosition == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalScrollPosition = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t}\n\n\t\tprivate var _verticalScrollPosition:Number = 0;\n\n\t\tpublic function get verticalScrollPosition():Number\n\t\t{\n\t\t\treturn this._verticalScrollPosition;\n\t\t}\n\n\t\tpublic function set verticalScrollPosition(value:Number):void\n\t\t{\n\t\t\tif(this._verticalScrollPosition == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalScrollPosition = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t}\n\n\t\tpublic function get requiresMeasurementOnScroll():Boolean\n\t\t{\n\t\t\treturn this._layout.requiresLayoutOnScroll &&\n\t\t\t\t(this._explicitVisibleWidth !== this._explicitVisibleWidth || //isNaN\n\t\t\t\tthis._explicitVisibleHeight !== this._explicitVisibleHeight); //isNaN\n\t\t}\n\n\t\tprivate var _ignoreSelectionChanges:Boolean = false;\n\n\t\tprivate var _isSelectable:Boolean = true;\n\n\t\tpublic function get isSelectable():Boolean\n\t\t{\n\t\t\treturn this._isSelectable;\n\t\t}\n\n\t\tpublic function set isSelectable(value:Boolean):void\n\t\t{\n\t\t\tif(this._isSelectable == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isSelectable = value;\n\t\t\tif(!this._isSelectable)\n\t\t\t{\n\t\t\t\tthis.selectedItem = null;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\n\t\tprivate var _selectedItem:Object = null;\n\n\t\tpublic function get selectedItem():Object\n\t\t{\n\t\t\treturn this._selectedItem;\n\t\t}\n\n\t\tpublic function set selectedItem(value:Object):void\n\t\t{\n\t\t\tif(this._selectedItem == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._selectedItem = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\tprivate var _typicalItem:Object = null;\n\n\t\tpublic function get typicalItem():Object\n\t\t{\n\t\t\treturn this._typicalItem;\n\t\t}\n\n\t\tpublic function set typicalItem(value:Object):void\n\t\t{\n\t\t\tif(this._typicalItem == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._typicalItem = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\tprivate var _itemRendererType:Class;\n\n\t\tpublic function get itemRendererType():Class\n\t\t{\n\t\t\treturn this._itemRendererType;\n\t\t}\n\n\t\tpublic function set itemRendererType(value:Class):void\n\t\t{\n\t\t\tif(this._itemRendererType == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._itemRendererType = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _itemRendererFactory:Function;\n\n\t\tpublic function get itemRendererFactory():Function\n\t\t{\n\t\t\treturn this._itemRendererFactory;\n\t\t}\n\n\t\tpublic function set itemRendererFactory(value:Function):void\n\t\t{\n\t\t\tif(this._itemRendererFactory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._itemRendererFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _itemRendererFactories:Object;\n\n\t\tpublic function get itemRendererFactories():Object\n\t\t{\n\t\t\treturn this._itemRendererFactories;\n\t\t}\n\n\t\tpublic function set itemRendererFactories(value:Object):void\n\t\t{\n\t\t\tif(this._itemRendererFactories === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._itemRendererFactories = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _factoryIDFunction:Function;\n\n\t\tpublic function get factoryIDFunction():Function\n\t\t{\n\t\t\treturn this._factoryIDFunction;\n\t\t}\n\n\t\tpublic function set factoryIDFunction(value:Function):void\n\t\t{\n\t\t\tif(this._factoryIDFunction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._factoryIDFunction = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _customItemRendererStyleName:String;\n\n\t\tpublic function get customItemRendererStyleName():String\n\t\t{\n\t\t\treturn this._customItemRendererStyleName;\n\t\t}\n\n\t\tpublic function set customItemRendererStyleName(value:String):void\n\t\t{\n\t\t\tif(this._customItemRendererStyleName == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customItemRendererStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t}\n\n\t\tprivate var _openBranches:IListCollection;\n\n\t\tpublic function get openBranches():IListCollection\n\t\t{\n\t\t\treturn this._openBranches;\n\t\t}\n\n\t\tpublic function set openBranches(value:IListCollection):void\n\t\t{\n\t\t\tif(this._openBranches == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._openBranches !== null)\n\t\t\t{\n\t\t\t\tthis._openBranches.removeEventListener(Event.CHANGE, openBranches_changeHandler);\n\t\t\t}\n\t\t\tthis._openBranches = value;\n\t\t\tif(this._openBranches !== null)\n\t\t\t{\n\t\t\t\tthis._openBranches.addEventListener(Event.CHANGE, openBranches_changeHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\tprivate var _typicalItemIsInDataProvider:Boolean = false;\n\t\tprivate var _typicalItemRenderer:ITreeItemRenderer;\n\n\t\tprivate var _layoutItems:Vector.<DisplayObject> = new <DisplayObject>[];\n\n\t\tprivate var _unrenderedItems:Array = [];\n\t\tprivate var _defaultItemRendererStorage:ItemRendererFactoryStorage = new ItemRendererFactoryStorage();\n\t\tprivate var _itemStorageMap:Object = {};\n\t\tprivate var _itemRendererMap:Dictionary = new Dictionary(true);\n\t\tprivate var _minimumItemCount:int;\n\n\t\tpublic function calculateNavigationDestination(location:Vector.<int>, keyCode:uint, result:Vector.<int>):void\n\t\t{\n\t\t\tvar displayIndex:int = this.locationToDisplayIndex(location, false);\n\t\t\tif(displayIndex == -1)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"Cannot calculate navigation destination for location: \" + location);\n\t\t\t}\n\t\t\tvar newDisplayIndex:int = this._layout.calculateNavigationDestination(this._layoutItems, displayIndex, keyCode, this._layoutResult);\n\t\t\tthis.displayIndexToLocation(newDisplayIndex, result);\n\t\t}\n\n\t\tpublic function getScrollPositionForLocation(location:Vector.<int>, result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\n\t\t\tvar displayIndex:int = this.locationToDisplayIndex(location, true);\n\t\t\tif(displayIndex == -1)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"Cannot calculate scroll position for location: \" + location);\n\t\t\t}\n\t\t\treturn this._layout.getScrollPositionForIndex(displayIndex, this._layoutItems,\n\t\t\t\t0, 0, this._actualVisibleWidth, this._actualVisibleHeight, result);\n\t\t}\n\n\t\tpublic function getNearestScrollPositionForIndex(location:Vector.<int>, result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\n\t\t\tvar displayIndex:int = this.locationToDisplayIndex(location, true);\n\t\t\tif(displayIndex == -1)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"Cannot calculate nearest scroll position for location: \" + location);\n\t\t\t}\n\t\t\treturn this._layout.getNearestScrollPositionForIndex(displayIndex, this._horizontalScrollPosition,\n\t\t\t\tthis._verticalScrollPosition, this._layoutItems, 0, 0, this._actualVisibleWidth, this._actualVisibleHeight, result);\n\t\t}\n\n\t\tpublic function itemToItemRenderer(item:Object):ITreeItemRenderer\n\t\t{\n\t\t\tif(item is XML || item is XMLList)\n\t\t\t{\n\t\t\t\treturn ITreeItemRenderer(this._itemRendererMap[item.toXMLString()]);\n\t\t\t}\n\t\t\treturn ITreeItemRenderer(this._itemRendererMap[item]);\n\t\t}\n\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tthis.refreshInactiveItemRenderers(null, true);\n\t\t\tif(this._itemStorageMap)\n\t\t\t{\n\t\t\t\tfor(var factoryID:String in this._itemStorageMap)\n\t\t\t\t{\n\t\t\t\t\tthis.refreshInactiveItemRenderers(factoryID, true);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.owner = null;\n\t\t\tthis.dataProvider = null;\n\t\t\tthis.layout = null;\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar scrollInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SCROLL);\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\t\t\tvar selectionInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SELECTED);\n\t\t\tvar itemRendererInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_ITEM_RENDERER_FACTORY);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar layoutInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_LAYOUT);\n\n\t\t\t//scrolling only affects the layout is requiresLayoutOnScroll is true\n\t\t\tif(!layoutInvalid && scrollInvalid && this._layout && this._layout.requiresLayoutOnScroll)\n\t\t\t{\n\t\t\t\tlayoutInvalid = true;\n\t\t\t}\n\n\t\t\tvar basicsInvalid:Boolean = sizeInvalid || dataInvalid || layoutInvalid || itemRendererInvalid;\n\n\t\t\tvar oldIgnoreRendererResizing:Boolean = this._ignoreRendererResizing;\n\t\t\tthis._ignoreRendererResizing = true;\n\t\t\tvar oldIgnoreLayoutChanges:Boolean = this._ignoreLayoutChanges;\n\t\t\tthis._ignoreLayoutChanges = true;\n\n\t\t\tif(scrollInvalid || sizeInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshViewPortBounds();\n\t\t\t}\n\t\t\tif(basicsInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshInactiveItemRenderers(null, itemRendererInvalid);\n\t\t\t\tif(this._itemStorageMap)\n\t\t\t\t{\n\t\t\t\t\tfor(var factoryID:String in this._itemStorageMap)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.refreshInactiveItemRenderers(factoryID, itemRendererInvalid);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(dataInvalid || layoutInvalid || itemRendererInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshLayoutTypicalItem();\n\t\t\t}\n\t\t\tif(basicsInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshItemRenderers();\n\t\t\t}\n\t\t\tif(selectionInvalid || basicsInvalid)\n\t\t\t{\n\t\t\t\t//unlike resizing renderers and layout changes, we only want to\n\t\t\t\t//stop listening for selection changes when we're forcibly\n\t\t\t\t//updating selection. other property changes on item renderers\n\t\t\t\t//can validly change selection, and we need to detect that.\n\t\t\t\tvar oldIgnoreSelectionChanges:Boolean = this._ignoreSelectionChanges;\n\t\t\t\tthis._ignoreSelectionChanges = true;\n\t\t\t\tthis.refreshSelection();\n\t\t\t\tthis._ignoreSelectionChanges = oldIgnoreSelectionChanges;\n\t\t\t}\n\t\t\tif(stateInvalid || basicsInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshEnabled();\n\t\t\t}\n\t\t\tthis._ignoreLayoutChanges = oldIgnoreLayoutChanges;\n\n\t\t\tif(stateInvalid || selectionInvalid || stylesInvalid || basicsInvalid)\n\t\t\t{\n\t\t\t\tthis._layout.layout(this._layoutItems, this._viewPortBounds, this._layoutResult);\n\t\t\t}\n\n\t\t\tthis._ignoreRendererResizing = oldIgnoreRendererResizing;\n\n\t\t\tthis._contentX = this._layoutResult.contentX;\n\t\t\tthis._contentY = this._layoutResult.contentY;\n\t\t\tthis.saveMeasurements(this._layoutResult.contentWidth, this._layoutResult.contentHeight,\n\t\t\t\tthis._layoutResult.contentWidth, this._layoutResult.contentHeight);\n\t\t\tthis._actualVisibleWidth = this._layoutResult.viewPortWidth;\n\t\t\tthis._actualVisibleHeight = this._layoutResult.viewPortHeight;\n\t\t\tthis._actualMinVisibleWidth = this._layoutResult.viewPortWidth;\n\t\t\tthis._actualMinVisibleHeight = this._layoutResult.viewPortHeight;\n\n\t\t\t//final validation to avoid juggler next frame issues\n\t\t\tthis.validateRenderers();\n\t\t}\n\n\t\tprivate function displayIndexToLocation(displayIndex:int, result:Vector.<int>):void\n\t\t{\n\t\t}\n\n\t\tprivate var _displayIndex:int;\n\n\t\tprivate function locationToDisplayIndex(location:Vector.<int>, returnNearestIfBranchNotOpen:Boolean):int\n\t\t{\n\t\t\tthis._displayIndex = -1;\n\t\t\tvar result:Object = this.locationToDisplayIndexAtBranch(new <int>[], location, returnNearestIfBranchNotOpen);\n\t\t\tif(result !== null)\n\t\t\t{\n\t\t\t\treturn this._displayIndex;\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\n\t\tprivate function locationToDisplayIndexAtBranch(locationOfBranch:Vector.<int>, locationToFind:Vector.<int>, returnNearestIfBranchNotOpen:Boolean):Object\n\t\t{\n\t\t\tvar childCount:int = this._dataProvider.getLengthAtLocation(locationOfBranch);\n\t\t\tfor(var i:int = 0; i < childCount; i++)\n\t\t\t{\n\t\t\t\tthis._displayIndex++;\n\t\t\t\tlocationOfBranch[locationOfBranch.length] = i;\n\t\t\t\tvar child:Object = this._dataProvider.getItemAtLocation(locationOfBranch);\n\t\t\t\tif(locationOfBranch.length == locationToFind.length)\n\t\t\t\t{\n\t\t\t\t\tvar every:Boolean = locationOfBranch.every(function(item:int, index:int, source:Vector.<int>):Boolean\n\t\t\t\t\t{\n\t\t\t\t\t\treturn item === locationToFind[index];\n\t\t\t\t\t});\n\t\t\t\t\tif(every)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn child;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this._dataProvider.isBranch(child))\n\t\t\t\t{\n\t\t\t\t\tif(this.owner.isBranchOpen(child))\n\t\t\t\t\t{\n\t\t\t\t\t\tvar result:Object = this.locationToDisplayIndexAtBranch(locationOfBranch, locationToFind, returnNearestIfBranchNotOpen);\n\t\t\t\t\t\tif(result)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn result;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(returnNearestIfBranchNotOpen)\n\t\t\t\t\t{\n\t\t\t\t\t\t//if the location is inside a closed branch\n\t\t\t\t\t\t//return that branch\n\t\t\t\t\t\tevery = locationOfBranch.every(function(item:int, index:int, source:Vector.<int>):Boolean\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn item === locationToFind[index];\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif(every)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn child;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlocationOfBranch.length--;\n\t\t\t}\n\t\t\t//location was not found!\n\t\t\treturn null;\n\t\t}\n\n\t\tprivate function refreshViewPortBounds():void\n\t\t{\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinVisibleWidth !== this._explicitMinVisibleWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinVisibleHeight !== this._explicitMinVisibleHeight; //isNaN\n\t\t\tthis._viewPortBounds.x = 0;\n\t\t\tthis._viewPortBounds.y = 0;\n\t\t\tthis._viewPortBounds.scrollX = this._horizontalScrollPosition;\n\t\t\tthis._viewPortBounds.scrollY = this._verticalScrollPosition;\n\t\t\tthis._viewPortBounds.explicitWidth = this._explicitVisibleWidth;\n\t\t\tthis._viewPortBounds.explicitHeight = this._explicitVisibleHeight;\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tthis._viewPortBounds.minWidth = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._viewPortBounds.minWidth = this._explicitMinVisibleWidth;\n\t\t\t}\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tthis._viewPortBounds.minHeight = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._viewPortBounds.minHeight = this._explicitMinVisibleHeight;\n\t\t\t}\n\t\t\tthis._viewPortBounds.maxWidth = this._maxVisibleWidth;\n\t\t\tthis._viewPortBounds.maxHeight = this._maxVisibleHeight;\n\t\t}\n\n\t\tprivate function refreshLayoutTypicalItem():void\n\t\t{\n\t\t\tvar virtualLayout:IVirtualLayout = this._layout as IVirtualLayout;\n\t\t\tif(virtualLayout === null || !virtualLayout.useVirtualLayout)\n\t\t\t{\n\t\t\t\t//the old layout was virtual, but this one isn't\n\t\t\t\tif(!this._typicalItemIsInDataProvider && this._typicalItemRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\t//it's safe to destroy this renderer\n\t\t\t\t\tthis.destroyItemRenderer(this._typicalItemRenderer);\n\t\t\t\t\tthis._typicalItemRenderer = null;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar typicalItemLocation:Vector.<int> = null;\n\t\t\tvar newTypicalItemIsInDataProvider:Boolean = false;\n\t\t\tvar typicalItem:Object = this._typicalItem;\n\t\t\tif(typicalItem !== null)\n\t\t\t{\n\t\t\t\tif(this._dataProvider !== null)\n\t\t\t\t{\n\t\t\t\t\ttypicalItemLocation = this._dataProvider.getItemLocation(typicalItem);\n\t\t\t\t\tnewTypicalItemIsInDataProvider = typicalItemLocation !== null && typicalItemLocation.length > 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(this._dataProvider !== null && this._dataProvider.getLengthAtLocation() > 0)\n\t\t\t\t{\n\t\t\t\t\tnewTypicalItemIsInDataProvider = true;\n\t\t\t\t\ttypicalItem = this._dataProvider.getItemAt(0);\n\t\t\t\t\ttypicalItemLocation = new <int>[0];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//#1645 The typicalItem can be null if the data provider contains\n\t\t\t//a null value at index 0. this is the only time we allow null.\n\t\t\tif(typicalItem !== null || newTypicalItemIsInDataProvider)\n\t\t\t{\n\t\t\t\tvar typicalItemRenderer:ITreeItemRenderer = this.itemToItemRenderer(typicalItem);\n\t\t\t\tif(typicalItemRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\t//at this point, the item already has an item renderer.\n\t\t\t\t\t//(this doesn't necessarily mean that the current typical\n\t\t\t\t\t//item was the typical item last time this function was\n\t\t\t\t\t//called)\n\n\t\t\t\t\t//the location may have changed if items were added,\n\t\t\t\t\t//removed or reordered in the data provider\n\t\t\t\t\ttypicalItemRenderer.location = typicalItemLocation;\n\t\t\t\t}\n\t\t\t\tif(typicalItemRenderer === null && this._typicalItemRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\t//the typical item has changed, and doesn't have an item\n\t\t\t\t\t//renderer yet. the previous typical item had an item\n\t\t\t\t\t//renderer, so we will try to reuse it.\n\n\t\t\t\t\t//we can reuse the existing typical item renderer if the old\n\t\t\t\t\t//typical item wasn't in the data provider. otherwise, it\n\t\t\t\t\t//may still be needed for the same item.\n\t\t\t\t\tvar canReuse:Boolean = !this._typicalItemIsInDataProvider;\n\t\t\t\t\tvar oldTypicalItemRemoved:Boolean = this._typicalItemIsInDataProvider &&\n\t\t\t\t\t\tthis._dataProvider !== null && this._dataProvider.getItemLocation(this._typicalItemRenderer.data) === null;\n\t\t\t\t\tif(!canReuse && oldTypicalItemRemoved)\n\t\t\t\t\t{\n\t\t\t\t\t\t//special case: if the old typical item was in the data\n\t\t\t\t\t\t//provider, but it has been removed, it's safe to reuse.\n\t\t\t\t\t\tcanReuse = true;\n\t\t\t\t\t}\n\t\t\t\t\tif(canReuse)\n\t\t\t\t\t{\n\t\t\t\t\t\t//we can't reuse if the factoryID has changed, though!\n\t\t\t\t\t\tvar factoryID:String = null;\n\t\t\t\t\t\tif(this._factoryIDFunction !== null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfactoryID = this.getFactoryID(typicalItem, typicalItemLocation);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(this._typicalItemRenderer.factoryID !== factoryID)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcanReuse = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(canReuse)\n\t\t\t\t\t{\n\t\t\t\t\t\t//we can reuse the item renderer used for the old\n\t\t\t\t\t\t//typical item!\n\n\t\t\t\t\t\t//if the old typical item was in the data provider,\n\t\t\t\t\t\t//remove it from the renderer map.\n\t\t\t\t\t\tif(this._typicalItemIsInDataProvider)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar oldData:Object = this._typicalItemRenderer.data;\n\t\t\t\t\t\t\tif(oldData is XML || oldData is XMLList)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdelete this._itemRendererMap[oldData.toXMLString()];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdelete this._itemRendererMap[oldData];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttypicalItemRenderer = this._typicalItemRenderer;\n\t\t\t\t\t\ttypicalItemRenderer.data = typicalItem;\n\t\t\t\t\t\ttypicalItemRenderer.location = typicalItemLocation;\n\t\t\t\t\t\t//if the new typical item is in the data provider, add it\n\t\t\t\t\t\t//to the renderer map.\n\t\t\t\t\t\tif(newTypicalItemIsInDataProvider)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(typicalItem is XML || typicalItem is XMLList)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis._itemRendererMap[typicalItem.toXMLString()] = typicalItemRenderer;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis._itemRendererMap[typicalItem] = typicalItemRenderer;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(typicalItemRenderer === null)\n\t\t\t\t{\n\t\t\t\t\t//if we still don't have a typical item renderer, we need to\n\t\t\t\t\t//create a new one.\n\t\t\t\t\ttypicalItemRenderer = this.createItemRenderer(typicalItem, typicalItemLocation, 0, false, !newTypicalItemIsInDataProvider);\n\t\t\t\t\tif(!this._typicalItemIsInDataProvider && this._typicalItemRenderer !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\t//get rid of the old typical item renderer if it isn't\n\t\t\t\t\t\t//needed anymore.  since it was not in the data\n\t\t\t\t\t\t//provider, we don't need to mess with the renderer map\n\t\t\t\t\t\t//dictionary or dispatch any events.\n\t\t\t\t\t\tthis.destroyItemRenderer(this._typicalItemRenderer);\n\t\t\t\t\t\tthis._typicalItemRenderer = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvirtualLayout.typicalItem = DisplayObject(typicalItemRenderer);\n\t\t\tthis._typicalItemRenderer = typicalItemRenderer;\n\t\t\tthis._typicalItemIsInDataProvider = newTypicalItemIsInDataProvider;\n\t\t\tif(this._typicalItemRenderer !== null && !this._typicalItemIsInDataProvider)\n\t\t\t{\n\t\t\t\t//we need to know if this item renderer resizes to adjust the\n\t\t\t\t//layout because the layout may use this item renderer to resize\n\t\t\t\t//the other item renderers\n\t\t\t\tthis._typicalItemRenderer.addEventListener(FeathersEventType.RESIZE, itemRenderer_resizeHandler);\n\t\t\t}\n\t\t}\n\n\t\tprivate function refreshItemRenderers():void\n\t\t{\n\t\t\tif(this._typicalItemRenderer !== null && this._typicalItemIsInDataProvider)\n\t\t\t{\n\t\t\t\tvar storage:ItemRendererFactoryStorage = this.factoryIDToStorage(this._typicalItemRenderer.factoryID);\n\t\t\t\tvar inactiveItemRenderers:Vector.<ITreeItemRenderer> = storage.inactiveItemRenderers;\n\t\t\t\tvar activeItemRenderers:Vector.<ITreeItemRenderer> = storage.activeItemRenderers;\n\t\t\t\t//this renderer is already is use by the typical item, so we\n\t\t\t\t//don't want to allow it to be used by other items.\n\t\t\t\tvar inactiveIndex:int = inactiveItemRenderers.indexOf(this._typicalItemRenderer);\n\t\t\t\tif(inactiveIndex >= 0)\n\t\t\t\t{\n\t\t\t\t\tinactiveItemRenderers[inactiveIndex] = null;\n\t\t\t\t}\n\t\t\t\t//if refreshLayoutTypicalItem() was called, it will have already\n\t\t\t\t//added the typical item renderer to the active renderers. if\n\t\t\t\t//not, we need to do it here.\n\t\t\t\tvar activeRendererCount:int = activeItemRenderers.length;\n\t\t\t\tif(activeRendererCount == 0)\n\t\t\t\t{\n\t\t\t\t\tactiveItemRenderers[activeRendererCount] = this._typicalItemRenderer;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.findUnrenderedData();\n\t\t\tthis.recoverInactiveItemRenderers(this._defaultItemRendererStorage);\n\t\t\tif(this._itemStorageMap)\n\t\t\t{\n\t\t\t\tfor(var factoryID:String in this._itemStorageMap)\n\t\t\t\t{\n\t\t\t\t\tstorage = ItemRendererFactoryStorage(this._itemStorageMap[factoryID]);\n\t\t\t\t\tthis.recoverInactiveItemRenderers(storage);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.renderUnrenderedData();\n\t\t\tthis.freeInactiveItemRenderers(this._defaultItemRendererStorage, this._minimumItemCount);\n\t\t\tif(this._itemStorageMap)\n\t\t\t{\n\t\t\t\tfor(factoryID in this._itemStorageMap)\n\t\t\t\t{\n\t\t\t\t\tstorage = ItemRendererFactoryStorage(this._itemStorageMap[factoryID]);\n\t\t\t\t\tthis.freeInactiveItemRenderers(storage, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._updateForDataReset = false;\n\t\t}\n\n\t\tprivate function findTotalLayoutCount(location:Vector.<int>):int\n\t\t{\n\t\t\tvar itemCount:int = 0;\n\t\t\tif(this._dataProvider !== null)\n\t\t\t{\n\t\t\t\titemCount = this._dataProvider.getLengthAtLocation(location);\n\t\t\t}\n\t\t\tvar result:int = itemCount;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tlocation[location.length] = i;\n\t\t\t\tvar item:Object = this._dataProvider.getItemAtLocation(location);\n\t\t\t\tif(this._dataProvider.isBranch(item) &&\n\t\t\t\t\tthis._openBranches.contains(item))\n\t\t\t\t{\n\t\t\t\t\tresult += this.findTotalLayoutCount(location);\n\t\t\t\t}\n\t\t\t\tlocation.length--;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tprivate function findUnrenderedDataForLocation(location:Vector.<int>, currentIndex:int):int\n\t\t{\n\t\t\tvar virtualLayout:IVirtualLayout = this._layout as IVirtualLayout;\n\t\t\tvar useVirtualLayout:Boolean = virtualLayout !== null && virtualLayout.useVirtualLayout;\n\t\t\tvar itemCount:int = 0;\n\t\t\tif(this._dataProvider !== null)\n\t\t\t{\n\t\t\t\titemCount = this._dataProvider.getLengthAtLocation(location);\n\t\t\t}\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tlocation[location.length] = i;\n\t\t\t\tvar item:Object = this._dataProvider.getItemAtLocation(location);\n\n\t\t\t\tif(useVirtualLayout && HELPER_VECTOR.indexOf(currentIndex) == -1)\n\t\t\t\t{\n\t\t\t\t\tif(this._typicalItemRenderer !== null &&\n\t\t\t\t\t\tthis._typicalItemIsInDataProvider &&\n\t\t\t\t\t\tthis._typicalItemRenderer.data === item)\n\t\t\t\t\t{\n\t\t\t\t\t\t//the index may have changed if items were added, removed,\n\t\t\t\t\t\t//or reordered in the data provider\n\t\t\t\t\t\tthis._typicalItemRenderer.layoutIndex = currentIndex;\n\t\t\t\t\t}\n\t\t\t\t\tthis._layoutItems[currentIndex] = null;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.findRendererForItem(item, location.slice(), currentIndex);\n\t\t\t\t}\n\t\t\t\tcurrentIndex++;\n\n\t\t\t\tif(this._dataProvider.isBranch(item) &&\n\t\t\t\t\tthis._openBranches.contains(item))\n\t\t\t\t{\n\t\t\t\t\tcurrentIndex = this.findUnrenderedDataForLocation(location, currentIndex);\n\t\t\t\t}\n\t\t\t\tlocation.length--;\n\t\t\t}\n\t\t\treturn currentIndex;\n\t\t}\n\n\t\tprivate function findUnrenderedData():void\n\t\t{\n\t\t\tLOCATION_HELPER_VECTOR.length = 0;\n\t\t\tvar totalLayoutCount:int = this.findTotalLayoutCount(LOCATION_HELPER_VECTOR);\n\t\t\tLOCATION_HELPER_VECTOR.length = 0;\n\t\t\tthis._layoutItems.length = totalLayoutCount;\n\t\t\tvar virtualLayout:IVirtualLayout = this._layout as IVirtualLayout;\n\t\t\tvar useVirtualLayout:Boolean = virtualLayout !== null && virtualLayout.useVirtualLayout;\n\t\t\tif(useVirtualLayout)\n\t\t\t{\n\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\tvirtualLayout.measureViewPort(totalLayoutCount, this._viewPortBounds, point);\n\t\t\t\tvar viewPortWidth:Number = point.x;\n\t\t\t\tvar viewPortHeight:Number = point.y;\n\t\t\t\tPool.putPoint(point);\n\t\t\t\tvirtualLayout.getVisibleIndicesAtScrollPosition(this._horizontalScrollPosition, this._verticalScrollPosition, viewPortWidth, viewPortHeight, totalLayoutCount, HELPER_VECTOR);\n\n\t\t\t\tif(this._typicalItemRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\tvar minimumTypicalItemEdge:Number = this._typicalItemRenderer.height;\n\t\t\t\t\tif(this._typicalItemRenderer.width < minimumTypicalItemEdge)\n\t\t\t\t\t{\n\t\t\t\t\t\tminimumTypicalItemEdge = this._typicalItemRenderer.width;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar maximumViewPortEdge:Number = viewPortWidth;\n\t\t\t\t\tif(viewPortHeight > viewPortWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tmaximumViewPortEdge = viewPortHeight;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._minimumItemCount = Math.ceil(maximumViewPortEdge / minimumTypicalItemEdge) + 1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._minimumItemCount = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tLOCATION_HELPER_VECTOR.length = 0;\n\t\t\tthis.findUnrenderedDataForLocation(LOCATION_HELPER_VECTOR, 0);\n\t\t\tLOCATION_HELPER_VECTOR.length = 0;\n\t\t\t//update the typical item renderer's visibility\n\t\t\tif(this._typicalItemRenderer !== null)\n\t\t\t{\n\t\t\t\tif(useVirtualLayout && this._typicalItemIsInDataProvider)\n\t\t\t\t{\n\t\t\t\t\tvar index:int = HELPER_VECTOR.indexOf(this._typicalItemRenderer.layoutIndex);\n\t\t\t\t\tif(index >= 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._typicalItemRenderer.visible = true;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._typicalItemRenderer.visible = false;\n\n\t\t\t\t\t\t//uncomment these lines to see a hidden typical item for\n\t\t\t\t\t\t//debugging purposes...\n\t\t\t\t\t\t/*this._typicalItemRenderer.visible = true;\n\t\t\t\t\t\tthis._typicalItemRenderer.x = this._horizontalScrollPosition;\n\t\t\t\t\t\tthis._typicalItemRenderer.y = this._verticalScrollPosition;*/\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._typicalItemRenderer.visible = this._typicalItemIsInDataProvider;\n\t\t\t\t}\n\t\t\t}\n\t\t\tHELPER_VECTOR.length = 0;\n\t\t}\n\n\t\tprivate function findRendererForItem(item:Object, location:Vector.<int>, layoutIndex:int):void\n\t\t{\n\t\t\tvar itemRenderer:ITreeItemRenderer = this.itemToItemRenderer(item);\n\t\t\tif(this._factoryIDFunction !== null && itemRenderer !== null)\n\t\t\t{\n\t\t\t\tvar newFactoryID:String = this.getFactoryID(itemRenderer.data, location);\n\t\t\t\tif(newFactoryID !== itemRenderer.factoryID)\n\t\t\t\t{\n\t\t\t\t\titemRenderer = null;\n\t\t\t\t\tif(item is XML || item is XMLList)\n\t\t\t\t\t{\n\t\t\t\t\t\tdelete this._itemRendererMap[item.toXMLString()];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tdelete this._itemRendererMap[item];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(itemRenderer !== null)\n\t\t\t{\n\t\t\t\t//the indices may have changed if items were added, removed,\n\t\t\t\t//or reordered in the data provider\n\t\t\t\titemRenderer.location = location;\n\t\t\t\titemRenderer.layoutIndex = layoutIndex;\n\t\t\t\titemRenderer.isOpen = this._dataProvider.isBranch(item) && this._openBranches.contains(item);\n\t\t\t\tif(this._updateForDataReset)\n\t\t\t\t{\n\t\t\t\t\t//similar to calling updateItemAt(), replacing the data\n\t\t\t\t\t//provider or resetting its source means that we should\n\t\t\t\t\t//trick the item renderer into thinking it has new data.\n\t\t\t\t\t//many developers seem to expect this behavior, so while\n\t\t\t\t\t//it's not the most optimal for performance, it saves on\n\t\t\t\t\t//support time in the forums. thankfully, it's still\n\t\t\t\t\t//somewhat optimized since the same item renderer will\n\t\t\t\t\t//receive the same data, and the children generally\n\t\t\t\t\t//won't have changed much, if at all.\n\t\t\t\t\titemRenderer.data = null;\n\t\t\t\t\titemRenderer.data = item;\n\t\t\t\t}\n\n\t\t\t\t//the typical item renderer is a special case, and we will\n\t\t\t\t//have already put it into the active renderers, so we don't\n\t\t\t\t//want to do it again!\n\t\t\t\tif(this._typicalItemRenderer !== itemRenderer)\n\t\t\t\t{\n\t\t\t\t\tvar storage:ItemRendererFactoryStorage = this.factoryIDToStorage(itemRenderer.factoryID);\n\t\t\t\t\tvar activeItemRenderers:Vector.<ITreeItemRenderer> = storage.activeItemRenderers;\n\t\t\t\t\tvar inactiveItemRenderers:Vector.<ITreeItemRenderer> = storage.inactiveItemRenderers;\n\t\t\t\t\tactiveItemRenderers[activeItemRenderers.length] = itemRenderer;\n\t\t\t\t\tvar inactiveIndex:int = inactiveItemRenderers.indexOf(itemRenderer);\n\t\t\t\t\tif(inactiveIndex >= 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tinactiveItemRenderers.removeAt(inactiveIndex);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new IllegalOperationError(\"TreeDataViewPort: item renderer map contains bad data. This may be caused by duplicate items in the data provider, which is not allowed.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\titemRenderer.visible = true;\n\t\t\t\tthis._layoutItems[layoutIndex] = DisplayObject(itemRenderer);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar pushIndex:int = this._unrenderedItems.length;\n\t\t\t\tthis._unrenderedItems[pushIndex] = location;\n\t\t\t\tpushIndex++;\n\t\t\t\tthis._unrenderedItems[pushIndex] = layoutIndex;\n\t\t\t}\n\t\t}\n\n\t\tprivate function renderUnrenderedData():void\n\t\t{\n\t\t\tLOCATION_HELPER_VECTOR.length = 2;\n\t\t\tvar rendererCount:int = this._unrenderedItems.length;\n\t\t\tfor(var i:int = 0; i < rendererCount; i += 2)\n\t\t\t{\n\t\t\t\tvar location:Vector.<int> = this._unrenderedItems.shift();\n\t\t\t\tvar layoutIndex:int = this._unrenderedItems.shift();\n\t\t\t\tvar item:Object = this._dataProvider.getItemAtLocation(location);\n\t\t\t\tvar itemRenderer:ITreeItemRenderer = this.createItemRenderer(\n\t\t\t\t\titem, location, layoutIndex, true, false);\n\t\t\t\titemRenderer.visible = true;\n\t\t\t\tthis._layoutItems[layoutIndex] = DisplayObject(itemRenderer);\n\t\t\t}\n\t\t\tLOCATION_HELPER_VECTOR.length = 0;\n\t\t}\n\n\t\tprivate function refreshInactiveItemRenderers(factoryID:String, itemRendererTypeIsInvalid:Boolean):void\n\t\t{\n\t\t\tif(factoryID !== null)\n\t\t\t{\n\t\t\t\tvar storage:ItemRendererFactoryStorage = ItemRendererFactoryStorage(this._itemStorageMap[factoryID]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstorage = this._defaultItemRendererStorage;\n\t\t\t}\n\t\t\tvar temp:Vector.<ITreeItemRenderer> = storage.inactiveItemRenderers;\n\t\t\tstorage.inactiveItemRenderers = storage.activeItemRenderers;\n\t\t\tstorage.activeItemRenderers = temp;\n\t\t\tif(storage.activeItemRenderers.length > 0)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"TreeDataViewPort: active renderers should be empty.\");\n\t\t\t}\n\t\t\tif(itemRendererTypeIsInvalid)\n\t\t\t{\n\t\t\t\tthis.recoverInactiveItemRenderers(storage);\n\t\t\t\tthis.freeInactiveItemRenderers(storage, 0);\n\t\t\t\tif(this._typicalItemRenderer && this._typicalItemRenderer.factoryID === factoryID)\n\t\t\t\t{\n\t\t\t\t\tif(this._typicalItemIsInDataProvider)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar item:Object = this._typicalItemRenderer.data;\n\t\t\t\t\t\tif(item is XML || item is XMLList)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdelete this._itemRendererMap[item.toXMLString()];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdelete this._itemRendererMap[item];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.destroyItemRenderer(this._typicalItemRenderer);\n\t\t\t\t\tthis._typicalItemRenderer = null;\n\t\t\t\t\tthis._typicalItemIsInDataProvider = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._layoutItems.length = 0;\n\t\t}\n\n\t\tprivate function recoverInactiveItemRenderers(storage:ItemRendererFactoryStorage):void\n\t\t{\n\t\t\tvar inactiveItemRenderers:Vector.<ITreeItemRenderer> = storage.inactiveItemRenderers;\n\n\t\t\tvar itemCount:int = inactiveItemRenderers.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar itemRenderer:ITreeItemRenderer = inactiveItemRenderers[i];\n\t\t\t\tif(itemRenderer === null || itemRenderer.data === null)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tthis._owner.dispatchEventWith(FeathersEventType.RENDERER_REMOVE, false, itemRenderer);\n\t\t\t\tvar item:Object = itemRenderer.data;\n\t\t\t\tif(item is XML || item is XMLList)\n\t\t\t\t{\n\t\t\t\t\tdelete this._itemRendererMap[item.toXMLString()];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tdelete this._itemRendererMap[item];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function freeInactiveItemRenderers(storage:ItemRendererFactoryStorage, minimumItemCount:int):void\n\t\t{\n\t\t\tvar inactiveItemRenderers:Vector.<ITreeItemRenderer> = storage.inactiveItemRenderers;\n\t\t\tvar activeItemRenderers:Vector.<ITreeItemRenderer> = storage.activeItemRenderers;\n\t\t\tvar activeItemRenderersCount:int = activeItemRenderers.length;\n\n\t\t\t//we may keep around some extra renderers to avoid too much\n\t\t\t//allocation and garbage collection. they'll be hidden.\n\t\t\tvar itemCount:int = inactiveItemRenderers.length;\n\t\t\tvar keepCount:int = minimumItemCount - activeItemRenderersCount;\n\t\t\tif(keepCount > itemCount)\n\t\t\t{\n\t\t\t\tkeepCount = itemCount;\n\t\t\t}\n\t\t\tfor(var i:int = 0; i < keepCount; i++)\n\t\t\t{\n\t\t\t\tvar itemRenderer:ITreeItemRenderer = inactiveItemRenderers.shift();\n\t\t\t\tif(!itemRenderer)\n\t\t\t\t{\n\t\t\t\t\tkeepCount++;\n\t\t\t\t\tif(itemCount < keepCount)\n\t\t\t\t\t{\n\t\t\t\t\t\tkeepCount = itemCount;\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\titemRenderer.data = null;\n\t\t\t\titemRenderer.location = null;\n\t\t\t\titemRenderer.visible = false;\n\t\t\t\tactiveItemRenderers[activeItemRenderersCount] = itemRenderer;\n\t\t\t\tactiveItemRenderersCount++;\n\t\t\t}\n\t\t\titemCount -= keepCount;\n\t\t\tfor(i = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\titemRenderer = inactiveItemRenderers.shift();\n\t\t\t\tif(!itemRenderer)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tthis.destroyItemRenderer(itemRenderer);\n\t\t\t}\n\t\t}\n\n\t\tprivate function createItemRenderer(item:Object, location:Vector.<int>, layoutIndex:int, useCache:Boolean, isTemporary:Boolean):ITreeItemRenderer\n\t\t{\n\t\t\tvar factoryID:String = null;\n\t\t\tif(this._factoryIDFunction !== null)\n\t\t\t{\n\t\t\t\tfactoryID = this.getFactoryID(item, location);\n\t\t\t}\n\t\t\tvar itemRendererFactory:Function = this.factoryIDToFactory(factoryID);\n\t\t\tvar storage:ItemRendererFactoryStorage = this.factoryIDToStorage(factoryID);\n\t\t\tvar inactiveItemRenderers:Vector.<ITreeItemRenderer> = storage.inactiveItemRenderers;\n\t\t\tvar activeItemRenderers:Vector.<ITreeItemRenderer> = storage.activeItemRenderers;\n\t\t\tvar itemRenderer:ITreeItemRenderer;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tif(!useCache || isTemporary || inactiveItemRenderers.length == 0)\n\t\t\t\t{\n\t\t\t\t\tif(itemRendererFactory !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\titemRenderer = ITreeItemRenderer(itemRendererFactory());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\titemRenderer = ITreeItemRenderer(new this._itemRendererType());\n\t\t\t\t\t}\n\t\t\t\t\tif(this._customItemRendererStyleName && this._customItemRendererStyleName.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\titemRenderer.styleNameList.add(this._customItemRendererStyleName);\n\t\t\t\t\t}\n\t\t\t\t\tthis.addChild(DisplayObject(itemRenderer));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\titemRenderer = inactiveItemRenderers.shift();\n\t\t\t\t}\n\t\t\t\t//wondering why this all is in a loop?\n\t\t\t\t//_inactiveRenderers.shift() may return null because we're\n\t\t\t\t//storing null values instead of calling splice() to improve\n\t\t\t\t//performance.\n\t\t\t}\n\t\t\twhile(!itemRenderer);\n\t\t\titemRenderer.data = item;\n\t\t\titemRenderer.owner = this._owner;\n\t\t\titemRenderer.factoryID = factoryID;\n\t\t\titemRenderer.location = location;\n\t\t\titemRenderer.layoutIndex = layoutIndex;\n\t\t\tvar isBranch:Boolean = this._dataProvider !== null && this._dataProvider.isBranch(item);\n\t\t\titemRenderer.isBranch = isBranch;\n\t\t\titemRenderer.isOpen = isBranch && this._openBranches.contains(item);\n\n\t\t\tif(!isTemporary)\n\t\t\t{\n\t\t\t\tif(item is XML || item is XMLList)\n\t\t\t\t{\n\t\t\t\t\tthis._itemRendererMap[item.toXMLString()] = itemRenderer;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._itemRendererMap[item] = itemRenderer;\n\t\t\t\t}\n\t\t\t\tactiveItemRenderers[activeItemRenderers.length] = itemRenderer;\n\t\t\t\titemRenderer.addEventListener(Event.TRIGGERED, itemRenderer_triggeredHandler);\n\t\t\t\titemRenderer.addEventListener(Event.CHANGE, itemRenderer_changeHandler);\n\t\t\t\titemRenderer.addEventListener(FeathersEventType.RESIZE, itemRenderer_resizeHandler);\n\t\t\t\tthis._owner.dispatchEventWith(FeathersEventType.RENDERER_ADD, false, itemRenderer);\n\t\t\t}\n\n\t\t\treturn itemRenderer;\n\t\t}\n\n\t\tprivate function destroyItemRenderer(itemRenderer:ITreeItemRenderer):void\n\t\t{\n\t\t\titemRenderer.removeEventListener(Event.TRIGGERED, itemRenderer_triggeredHandler);\n\t\t\titemRenderer.removeEventListener(Event.CHANGE, itemRenderer_changeHandler);\n\t\t\titemRenderer.removeEventListener(FeathersEventType.RESIZE, itemRenderer_resizeHandler);\n\t\t\titemRenderer.owner = null;\n\t\t\titemRenderer.data = null;\n\t\t\titemRenderer.location = null;\n\t\t\titemRenderer.layoutIndex = -1;\n\t\t\titemRenderer.factoryID = null;\n\t\t\tthis.removeChild(DisplayObject(itemRenderer), true);\n\t\t}\n\n\t\tprivate function getFactoryID(item:Object, location:Vector.<int>):String\n\t\t{\n\t\t\tif(this._factoryIDFunction === null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif(this._factoryIDFunction.length == 2)\n\t\t\t{\n\t\t\t\treturn this._factoryIDFunction(item, location);\n\t\t\t}\n\t\t\treturn this._factoryIDFunction(item);\n\t\t}\n\n\t\tprivate function factoryIDToFactory(id:String):Function\n\t\t{\n\t\t\tif(id !== null)\n\t\t\t{\n\t\t\t\tif(id in this._itemRendererFactories)\n\t\t\t\t{\n\t\t\t\t\treturn this._itemRendererFactories[id] as Function;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthrow new ReferenceError(\"Cannot find item renderer factory for ID \\\"\" + id + \"\\\".\");\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this._itemRendererFactory;\n\t\t}\n\n\t\tprivate function factoryIDToStorage(id:String):ItemRendererFactoryStorage\n\t\t{\n\t\t\tif(id !== null)\n\t\t\t{\n\t\t\t\tif(id in this._itemStorageMap)\n\t\t\t\t{\n\t\t\t\t\treturn ItemRendererFactoryStorage(this._itemStorageMap[id]);\n\t\t\t\t}\n\t\t\t\tvar storage:ItemRendererFactoryStorage = new ItemRendererFactoryStorage();\n\t\t\t\tthis._itemStorageMap[id] = storage;\n\t\t\t\treturn storage;\n\t\t\t}\n\t\t\treturn this._defaultItemRendererStorage;\n\t\t}\n\n\t\tprivate function invalidateParent(flag:String = INVALIDATION_FLAG_ALL):void\n\t\t{\n\t\t\tScroller(this.parent).invalidate(flag);\n\t\t}\n\n\t\tprivate function refreshSelection():void\n\t\t{\n\t\t\tfor each(var item:DisplayObject in this._layoutItems)\n\t\t\t{\n\t\t\t\tvar itemRenderer:ITreeItemRenderer = item as ITreeItemRenderer;\n\t\t\t\tif(itemRenderer !== null)\n\t\t\t\t{\n\t\t\t\t\titemRenderer.isSelected = itemRenderer.data === this._selectedItem;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function refreshEnabled():void\n\t\t{\n\t\t\tfor each(var item:DisplayObject in this._layoutItems)\n\t\t\t{\n\t\t\t\tvar control:IFeathersControl = item as IFeathersControl;\n\t\t\t\tif(control !== null)\n\t\t\t\t{\n\t\t\t\t\tcontrol.isEnabled = this._isEnabled;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function validateRenderers():void\n\t\t{\n\t\t\tvar itemCount:int = this._layoutItems.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:IValidating = this._layoutItems[i] as IValidating;\n\t\t\t\tif(item !== null)\n\t\t\t\t{\n\t\t\t\t\titem.validate();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate function layout_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreLayoutChanges)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t\tthis.invalidateParent(INVALIDATION_FLAG_LAYOUT);\n\t\t}\n\n\t\tprivate function dataProvider_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\tprivate function itemRenderer_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tvar itemRenderer:ITreeItemRenderer = ITreeItemRenderer(event.currentTarget);\n\t\t\tthis.parent.dispatchEventWith(Event.TRIGGERED, false, itemRenderer.data);\n\t\t}\n\n\t\tprivate function itemRenderer_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreSelectionChanges)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar itemRenderer:ITreeItemRenderer = ITreeItemRenderer(event.currentTarget);\n\t\t\tif(!this._isSelectable || this._owner.isScrolling)\n\t\t\t{\n\t\t\t\titemRenderer.isSelected = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar isSelected:Boolean = itemRenderer.isSelected;\n\t\t\tif(isSelected)\n\t\t\t{\n\t\t\t\tthis.selectedItem = itemRenderer.data;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.selectedItem = null;\n\t\t\t}\n\t\t}\n\n\t\tprivate function itemRenderer_resizeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreRendererResizing)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t\tthis.invalidateParent(INVALIDATION_FLAG_LAYOUT);\n\t\t\tif(event.currentTarget === this._typicalItemRenderer && !this._typicalItemIsInDataProvider)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar layout:IVariableVirtualLayout = this._layout as IVariableVirtualLayout;\n\t\t\tif(!layout || !layout.hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar itemRenderer:ITreeItemRenderer = ITreeItemRenderer(event.currentTarget);\n\t\t\tlayout.resetVariableVirtualCacheAtIndex(itemRenderer.layoutIndex, DisplayObject(itemRenderer));\n\t\t}\n\n\t\tprivate function openBranches_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\t}\n}\n\nimport feathers.controls.renderers.ITreeItemRenderer;\n\nclass ItemRendererFactoryStorage\n{\n\tpublic function ItemRendererFactoryStorage()\n\t{\n\n\t}\n\n\tpublic var activeItemRenderers:Vector.<ITreeItemRenderer> = new <ITreeItemRenderer>[];\n\tpublic var inactiveItemRenderers:Vector.<ITreeItemRenderer> = new <ITreeItemRenderer>[];\n}"
  },
  {
    "path": "source/feathers/controls/text/BaseTextRenderer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.text\n{\n\timport feathers.core.FeathersControl;\n\timport feathers.core.IStateContext;\n\timport feathers.core.IStateObserver;\n\timport feathers.events.FeathersEventType;\n\timport feathers.text.FontStylesSet;\n\n\timport starling.events.Event;\n\n\t/**\n\t * A base class for text renderers that implements some common properties.\n\t *\n\t * @productversion Feathers 3.1.0\n\t */\n\tpublic class BaseTextRenderer extends FeathersControl implements IStateObserver\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function BaseTextRenderer()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _text:String = null;\n\n\t\t/**\n\t\t * @copy feathers.core.ITextRenderer#text\n\t\t */\n\t\tpublic function get text():String\n\t\t{\n\t\t\treturn this._text;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set text(value:String):void\n\t\t{\n\t\t\tif(this._text == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._text = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _stateContext:IStateContext;\n\n\t\t/**\n\t\t * When the text renderer observes a state context, the text renderer\n\t\t * may change its font styles based on the current state of that\n\t\t * context. Typically, a relevant component will automatically assign\n\t\t * itself as the state context of a text renderer, so this property is\n\t\t * typically meant for internal use only.\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #setFontStylesForState()\n\t\t */\n\t\tpublic function get stateContext():IStateContext\n\t\t{\n\t\t\treturn this._stateContext;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set stateContext(value:IStateContext):void\n\t\t{\n\t\t\tif(this._stateContext === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._stateContext)\n\t\t\t{\n\t\t\t\tthis._stateContext.removeEventListener(FeathersEventType.STATE_CHANGE, stateContext_stateChangeHandler);\n\t\t\t}\n\t\t\tthis._stateContext = value;\n\t\t\tif(this._stateContext)\n\t\t\t{\n\t\t\t\tthis._stateContext.addEventListener(FeathersEventType.STATE_CHANGE, stateContext_stateChangeHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STATE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _wordWrap:Boolean = false;\n\n\t\t/**\n\t\t * @copy feathers.core.ITextRenderer#wordWrap\n\t\t */\n\t\tpublic function get wordWrap():Boolean\n\t\t{\n\t\t\treturn this._wordWrap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set wordWrap(value:Boolean):void\n\t\t{\n\t\t\tif(this._wordWrap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._wordWrap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fontStyles:FontStylesSet;\n\n\t\t/**\n\t\t * @copy feathers.core.ITextRenderer#fontStyles\n\t\t */\n\t\tpublic function get fontStyles():FontStylesSet\n\t\t{\n\t\t\treturn this._fontStyles;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set fontStyles(value:FontStylesSet):void\n\t\t{\n\t\t\tif(this._fontStyles === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._fontStyles !== null)\n\t\t\t{\n\t\t\t\tthis._fontStyles.removeEventListener(Event.CHANGE, fontStylesSet_changeHandler);\n\t\t\t}\n\t\t\tthis._fontStyles = value;\n\t\t\tif(this._fontStyles !== null)\n\t\t\t{\n\t\t\t\tthis._fontStyles.addEventListener(Event.CHANGE, fontStylesSet_changeHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tthis.stateContext = null;\n\t\t\tthis.fontStyles = null;\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stateContext_stateChangeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STATE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function fontStylesSet_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/text/BitmapFontTextEditor.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.text\n{\n\timport feathers.core.FocusManager;\n\timport feathers.core.INativeFocusOwner;\n\timport feathers.core.ITextEditor;\n\timport feathers.events.FeathersEventType;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.utils.text.TextInputNavigation;\n\timport feathers.utils.text.TextInputRestrict;\n\n\timport flash.desktop.Clipboard;\n\timport flash.desktop.ClipboardFormats;\n\timport flash.display.Sprite;\n\timport flash.display.Stage;\n\timport flash.events.Event;\n\timport flash.events.TextEvent;\n\timport flash.geom.Point;\n\timport flash.text.TextFormatAlign;\n\timport flash.ui.Keyboard;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.KeyboardEvent;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.rendering.Painter;\n\timport starling.text.BitmapChar;\n\timport starling.text.BitmapFont;\n\timport starling.utils.Pool;\n\n\t/**\n\t * Dispatched when the text property changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #text\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the user presses the Enter key while the editor has\n\t * focus.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.ENTER\n\t */\n\t[Event(name=\"enter\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the text editor receives focus.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.FOCUS_IN\n\t */\n\t[Event(name=\"focusIn\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the text editor loses focus.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.FOCUS_OUT\n\t */\n\t[Event(name=\"focusOut\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Text that may be edited at runtime by the user with the\n\t * <code>TextInput</code> component, rendered with\n\t * <a href=\"http://wiki.starling-framework.org/manual/displaying_text#bitmap_fonts\" target=\"_top\">bitmap fonts</a>.\n\t *\n\t * <p>The following example shows how to use\n\t * <code>BitmapFontTextEditor</code> with a <code>TextInput</code>:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var input:TextInput = new TextInput();\n\t * input.textEditorFactory = function():ITextEditor\n\t * {\n\t *     return new BitmapFontTextEditor();\n\t * };\n\t * this.addChild( input );</listing>\n\t *\n\t * <p><strong>Warning:</strong> This text editor is intended for use in\n\t * desktop applications only, and it does not provide support for software\n\t * keyboards on mobile devices.</p>\n\t *\n\t * @see feathers.controls.TextInput\n\t * @see ../../../../help/text-editors.html Introduction to Feathers text editors\n\t * @see http://wiki.starling-framework.org/manual/displaying_text#bitmap_fonts Starling Wiki: Displaying Text with Bitmap Fonts\n\t *\n\t * @productversion Feathers 2.0.0\n\t */\n\tpublic class BitmapFontTextEditor extends BitmapFontTextRenderer implements ITextEditor, INativeFocusOwner\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const LINE_FEED:String = \"\\n\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const CARRIAGE_RETURN:String = \"\\r\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>BitmapFontTextEditor</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function BitmapFontTextEditor()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis._text = \"\";\n\t\t\tthis.isQuickHitAreaEnabled = true;\n\t\t\tthis.truncateToFit = false;\n\t\t\tthis.addEventListener(TouchEvent.TOUCH, textEditor_touchHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectionSkin:DisplayObject;\n\n\t\t/**\n\t\t * The skin that indicates the currently selected range of text.\n\t\t */\n\t\tpublic function get selectionSkin():DisplayObject\n\t\t{\n\t\t\treturn this._selectionSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectionSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._selectionSkin == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._selectionSkin && this._selectionSkin.parent == this)\n\t\t\t{\n\t\t\t\tthis._selectionSkin.removeFromParent();\n\t\t\t}\n\t\t\tthis._selectionSkin = value;\n\t\t\tif(this._selectionSkin)\n\t\t\t{\n\t\t\t\tthis._selectionSkin.visible = false;\n\t\t\t\tthis.addChildAt(this._selectionSkin, 0);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _cursorDelay:Number = 0.53;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _cursorDelayID:uint = uint.MAX_VALUE;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _cursorSkin:DisplayObject;\n\n\t\t/**\n\t\t * The skin that indicates the current position where text may be\n\t\t * entered.\n\t\t */\n\t\tpublic function get cursorSkin():DisplayObject\n\t\t{\n\t\t\treturn this._cursorSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set cursorSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._cursorSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._cursorSkin !== null && this._cursorSkin.parent === this)\n\t\t\t{\n\t\t\t\tthis._cursorSkin.removeFromParent();\n\t\t\t}\n\t\t\tthis._cursorSkin = value;\n\t\t\tif(this._cursorSkin !== null)\n\t\t\t{\n\t\t\t\tthis._cursorSkin.visible = false;\n\t\t\t\tthis.addChild(this._cursorSkin);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _unmaskedText:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _displayAsPassword:Boolean = false;\n\n\t\t/**\n\t\t * <p>This property is managed by the <code>TextInput</code>.</p>\n\t\t *\n\t\t * @copy feathers.controls.TextInput#displayAsPassword\n\t\t *\n\t\t * @see feathers.controls.TextInput#displayAsPassword\n\t\t * @see #passwordCharCode\n\t\t */\n\t\tpublic function get displayAsPassword():Boolean\n\t\t{\n\t\t\treturn this._displayAsPassword;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set displayAsPassword(value:Boolean):void\n\t\t{\n\t\t\tif(this._displayAsPassword == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._displayAsPassword = value;\n\t\t\tif(this._displayAsPassword)\n\t\t\t{\n\t\t\t\tthis._unmaskedText = this._text;\n\t\t\t\tthis.refreshMaskedText();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._text = this._unmaskedText;\n\t\t\t\tthis._unmaskedText = null;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _passwordCharCode:int = 42; //asterisk\n\n\t\t/**\n\t\t * The character code of the character used to display a password.\n\t\t *\n\t\t * <p>In the following example, the substitute character for passwords\n\t\t * is set to a bullet:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.displayAsPassword = true;\n\t\t * textEditor.passwordCharCode = \"•\".charCodeAt(0);</listing>\n\t\t *\n\t\t * @default 42 (asterisk)\n\t\t *\n\t\t * @see #displayAsPassword\n\t\t */\n\t\tpublic function get passwordCharCode():int\n\t\t{\n\t\t\treturn this._passwordCharCode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set passwordCharCode(value:int):void\n\t\t{\n\t\t\tif(this._passwordCharCode == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._passwordCharCode = value;\n\t\t\tif(this._displayAsPassword)\n\t\t\t{\n\t\t\t\tthis.refreshMaskedText();\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isEditable:Boolean = true;\n\n\t\t/**\n\t\t * <p>This property is managed by the <code>TextInput</code>.</p>\n\t\t *\n\t\t * @copy feathers.controls.TextInput#isEditable\n\t\t *\n\t\t * @see feathers.controls.TextInput#isEditable\n\t\t */\n\t\tpublic function get isEditable():Boolean\n\t\t{\n\t\t\treturn this._isEditable;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isEditable(value:Boolean):void\n\t\t{\n\t\t\tif(this._isEditable == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isEditable = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isSelectable:Boolean = true;\n\n\t\t/**\n\t\t * <p>This property is managed by the <code>TextInput</code>.</p>\n\t\t *\n\t\t * @copy feathers.controls.TextInput#isSelectable\n\t\t *\n\t\t * @see feathers.controls.TextInput#isSelectable\n\t\t */\n\t\tpublic function get isSelectable():Boolean\n\t\t{\n\t\t\treturn this._isSelectable;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isSelectable(value:Boolean):void\n\t\t{\n\t\t\tif(this._isSelectable == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isSelectable = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic function get setTouchFocusOnEndedPhase():Boolean\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function get text():String\n\t\t{\n\t\t\tif(this._displayAsPassword)\n\t\t\t{\n\t\t\t\treturn this._unmaskedText;\n\t\t\t}\n\t\t\treturn this._text;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set text(value:String):void\n\t\t{\n\t\t\tif(value === null)\n\t\t\t{\n\t\t\t\t//don't allow null or undefined\n\t\t\t\tvalue = \"\";\n\t\t\t}\n\t\t\tvar currentValue:String = this._text;\n\t\t\tif(this._displayAsPassword)\n\t\t\t{\n\t\t\t\tcurrentValue = this._unmaskedText;\n\t\t\t}\n\t\t\tif(currentValue == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._displayAsPassword)\n\t\t\t{\n\t\t\t\tthis._unmaskedText = value;\n\t\t\t\tthis.refreshMaskedText();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._text = value;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\tvar textLength:int = this._text.length;\n\t\t\t//we need to account for the possibility that the text is in the\n\t\t\t//middle of being selected when it changes\n\t\t\tif(this._selectionAnchorIndex > textLength)\n\t\t\t{\n\t\t\t\tthis._selectionAnchorIndex = textLength;\n\t\t\t}\n\t\t\t//then, we need to make sure the selected range is still valid\n\t\t\tif(this._selectionBeginIndex > textLength)\n\t\t\t{\n\t\t\t\tthis.selectRange(textLength, textLength);\n\t\t\t}\n\t\t\telse if(this._selectionEndIndex > textLength)\n\t\t\t{\n\t\t\t\tthis.selectRange(this._selectionBeginIndex, textLength);\n\t\t\t}\n\t\t\tthis.dispatchEventWith(starling.events.Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maxChars:int = 0;\n\n\t\t/**\n\t\t * <p>This property is managed by the <code>TextInput</code>.</p>\n\t\t *\n\t\t * @copy feathers.controls.TextInput#maxChars\n\t\t *\n\t\t * @see feathers.controls.TextInput#maxChars\n\t\t */\n\t\tpublic function get maxChars():int\n\t\t{\n\t\t\treturn this._maxChars;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maxChars(value:int):void\n\t\t{\n\t\t\tif(this._maxChars == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._maxChars = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _restrict:TextInputRestrict;\n\n\t\t/**\n\t\t * <p>This property is managed by the <code>TextInput</code>.</p>\n\t\t *\n\t\t * @copy feathers.controls.TextInput#restrict\n\t\t *\n\t\t * @see feathers.controls.TextInput#restrict\n\t\t */\n\t\tpublic function get restrict():String\n\t\t{\n\t\t\tif(!this._restrict)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn this._restrict.restrict;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set restrict(value:String):void\n\t\t{\n\t\t\tif(this._restrict && this._restrict.restrict === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!this._restrict && value === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value === null)\n\t\t\t{\n\t\t\t\tthis._restrict = null;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(this._restrict)\n\t\t\t\t{\n\t\t\t\t\tthis._restrict.restrict = value;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\n\t\t\t\t\tthis._restrict = new TextInputRestrict(value);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectionBeginIndex:int = 0;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @see #selectionEndIndex\n\t\t */\n\t\tpublic function get selectionBeginIndex():int\n\t\t{\n\t\t\treturn this._selectionBeginIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectionEndIndex:int = 0;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @see #selectionBeginIndex\n\t\t */\n\t\tpublic function get selectionEndIndex():int\n\t\t{\n\t\t\treturn this._selectionEndIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectionAnchorIndex:int = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _scrollX:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var touchPointID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _nativeFocus:Sprite;\n\n\t\t/**\n\t\t * @copy feathers.core.INativeFocusOwner#nativeFocus\n\t\t */\n\t\tpublic function get nativeFocus():Object\n\t\t{\n\t\t\treturn this._nativeFocus;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isWaitingToSetFocus:Boolean = false;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function setFocus(position:Point = null):void\n\t\t{\n\t\t\tif(this._hasFocus && !position)\n\t\t\t{\n\t\t\t\t//we already have focus, and there isn't a touch position, we\n\t\t\t\t//can ignore this because nothing would change\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._nativeFocus !== null)\n\t\t\t{\n\t\t\t\tif(this._nativeFocus.parent === null)\n\t\t\t\t{\n\t\t\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\t\t\tstarling.nativeStage.addChild(this._nativeFocus);\n\t\t\t\t}\n\t\t\t\tvar newIndex:int = -1;\n\t\t\t\tif(position !== null)\n\t\t\t\t{\n\t\t\t\t\tnewIndex = this.getSelectionIndexAtPoint(position.x, position.y);\n\t\t\t\t}\n\t\t\t\tif(newIndex >= 0)\n\t\t\t\t{\n\t\t\t\t\tthis.selectRange(newIndex, newIndex);\n\t\t\t\t}\n\t\t\t\tthis.focusIn();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._isWaitingToSetFocus = true;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function clearFocus():void\n\t\t{\n\t\t\tif(!this._hasFocus)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._hasFocus = false;\n\t\t\tthis._cursorSkin.visible = false;\n\t\t\tthis._selectionSkin.visible = false;\n\t\t\tthis.refreshCursorBlink();\n\t\t\tthis.stage.removeEventListener(TouchEvent.TOUCH, stage_touchHandler);\n\t\t\tthis.stage.removeEventListener(KeyboardEvent.KEY_DOWN, stage_keyDownHandler);\n\t\t\tthis.removeEventListener(starling.events.Event.ENTER_FRAME, hasFocus_enterFrameHandler);\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar nativeStage:Stage = starling.nativeStage;\n\t\t\tif(nativeStage.focus === this._nativeFocus)\n\t\t\t{\n\t\t\t\t//only clear the native focus when our native target has focus\n\t\t\t\t//because otherwise another component may lose focus.\n\n\t\t\t\t//for consistency with StageTextTextEditor and\n\t\t\t\t//TextFieldTextEditor, we set the native stage's focus to null\n\t\t\t\t//here instead of setting it to the native stage due to issues\n\t\t\t\t//with those text editors on Android.\n\t\t\t\tnativeStage.focus = null;\n\t\t\t}\n\t\t\tthis.dispatchEventWith(FeathersEventType.FOCUS_OUT);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function selectRange(beginIndex:int, endIndex:int):void\n\t\t{\n\t\t\tif(!this._isEditable && !this._isSelectable)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(endIndex < beginIndex)\n\t\t\t{\n\t\t\t\tvar temp:int = endIndex;\n\t\t\t\tendIndex = beginIndex;\n\t\t\t\tbeginIndex = temp;\n\t\t\t}\n\t\t\tthis._selectionBeginIndex = beginIndex;\n\t\t\tthis._selectionEndIndex = endIndex;\n\t\t\tif(beginIndex == endIndex)\n\t\t\t{\n\t\t\t\tthis._selectionAnchorIndex = beginIndex;\n\t\t\t\tif(beginIndex < 0)\n\t\t\t\t{\n\t\t\t\t\tthis._cursorSkin.visible = false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//cursor skin is not shown if isSelectable === true and\n\t\t\t\t\t//isEditable is false\n\t\t\t\t\tthis._cursorSkin.visible = this._hasFocus && this._isEditable;\n\t\t\t\t}\n\t\t\t\tthis._selectionSkin.visible = false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._cursorSkin.visible = false;\n\t\t\t\tthis._selectionSkin.visible = true;\n\t\t\t}\n\t\t\tthis.refreshCursorBlink();\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this._nativeFocus && this._nativeFocus.parent)\n\t\t\t{\n\t\t\t\tthis._nativeFocus.parent.removeChild(this._nativeFocus);\n\t\t\t}\n\t\t\tthis._nativeFocus = null;\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function render(painter:Painter):void\n\t\t{\n\t\t\tvar oldBatchX:Number = this._batchX;\n\t\t\tvar oldCursorX:Number = this._cursorSkin.x;\n\t\t\tthis._batchX -= this._scrollX;\n\t\t\tthis._cursorSkin.x -= this._scrollX;\n\t\t\tsuper.render(painter);\n\t\t\tthis._batchX = oldBatchX;\n\t\t\tthis._cursorSkin.x = oldCursorX;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tif(!this._nativeFocus)\n\t\t\t{\n\t\t\t\tthis._nativeFocus = new Sprite();\n\t\t\t\t//let's ensure that this can only get focus through code\n\t\t\t\tthis._nativeFocus.tabEnabled = false;\n\t\t\t\tthis._nativeFocus.tabChildren = false;\n\t\t\t\tthis._nativeFocus.mouseEnabled = false;\n\t\t\t\tthis._nativeFocus.mouseChildren = false;\n\t\t\t\t//adds support for mobile\n\t\t\t\tthis._nativeFocus.needsSoftKeyboard = true;\n\t\t\t}\n\t\t\tthis._nativeFocus.addEventListener(flash.events.Event.CUT, nativeFocus_cutHandler, false, 0, true);\n\t\t\tthis._nativeFocus.addEventListener(flash.events.Event.COPY, nativeFocus_copyHandler, false, 0, true);\n\t\t\tthis._nativeFocus.addEventListener(flash.events.Event.PASTE, nativeFocus_pasteHandler, false, 0, true);\n\t\t\tthis._nativeFocus.addEventListener(flash.events.Event.SELECT_ALL, nativeFocus_selectAllHandler, false, 0, true);\n\t\t\tthis._nativeFocus.addEventListener(TextEvent.TEXT_INPUT, nativeFocus_textInputHandler, false, 0, true);\n\t\t\tif(!this._cursorSkin)\n\t\t\t{\n\t\t\t\tthis.ignoreNextStyleRestriction();\n\t\t\t\tthis.cursorSkin = new Quad(1, 1, 0x000000);\n\t\t\t}\n\t\t\tif(!this._selectionSkin)\n\t\t\t{\n\t\t\t\tthis.ignoreNextStyleRestriction();\n\t\t\t\tthis.selectionSkin = new Quad(1, 1, 0x000000);\n\t\t\t}\n\t\t\tsuper.initialize();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar selectionInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SELECTED);\n\n\t\t\tsuper.draw();\n\n\t\t\tif(dataInvalid || selectionInvalid)\n\t\t\t{\n\t\t\t\tthis.positionCursorAtCharIndex(this.getCursorIndexFromSelectionRange());\n\t\t\t\tthis.positionSelectionBackground();\n\t\t\t}\n\n\t\t\tvar mask:Quad = this.mask as Quad;\n\t\t\tif(mask)\n\t\t\t{\n\t\t\t\tmask.x = 0;\n\t\t\t\tmask.y = 0;\n\t\t\t\tmask.width = this.actualWidth;\n\t\t\t\tmask.height = this.actualHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmask = new Quad(1, 1, 0xff00ff);\n\t\t\t\t//the initial dimensions cannot be 0 or there's a runtime error,\n\t\t\t\t//and these values might be 0\n\t\t\t\tmask.width = this.actualWidth;\n\t\t\t\tmask.height = this.actualHeight;\n\t\t\t\tthis.mask = mask;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function layoutCharacters(result:MeasureTextResult = null):MeasureTextResult\n\t\t{\n\t\t\tresult = super.layoutCharacters(result);\n\t\t\tif(this._explicitWidth === this._explicitWidth && //!isNaN\n\t\t\t\tresult.width > this._explicitWidth)\n\t\t\t{\n\t\t\t\tthis._characterBatch.clear();\n\t\t\t\tvar oldTextAlign:String = this._currentTextFormat.align;\n\t\t\t\tthis._currentTextFormat.align = TextFormatAlign.LEFT;\n\t\t\t\tresult = super.layoutCharacters(result);\n\t\t\t\tthis._currentTextFormat.align = oldTextAlign;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function refreshTextFormat():void\n\t\t{\n\t\t\tsuper.refreshTextFormat();\n\t\t\tif(this._cursorSkin)\n\t\t\t{\n\t\t\t\tvar font:BitmapFont = this._currentTextFormat.font;\n\t\t\t\tvar customSize:Number = this._currentTextFormat.size;\n\t\t\t\tvar scale:Number = customSize / font.size;\n\t\t\t\tif(scale !== scale) //isNaN\n\t\t\t\t{\n\t\t\t\t\tscale = 1;\n\t\t\t\t}\n\t\t\t\tthis._cursorSkin.height = font.lineHeight * scale;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshMaskedText():void\n\t\t{\n\t\t\tthis._text = \"\";\n\t\t\tvar textLength:int = this._unmaskedText.length;\n\t\t\tvar maskChar:String = String.fromCharCode(this._passwordCharCode);\n\t\t\tfor(var i:int = 0; i < textLength; i++)\n\t\t\t{\n\t\t\t\tthis._text += maskChar;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function focusIn():void\n\t\t{\n\t\t\tvar showSelection:Boolean = (this._isEditable || this._isSelectable) &&\n\t\t\t\tthis._selectionBeginIndex >= 0 &&\n\t\t\t\tthis._selectionBeginIndex != this._selectionEndIndex;\n\t\t\tvar showCursor:Boolean = this._isEditable &&\n\t\t\t\tthis._selectionBeginIndex >= 0 &&\n\t\t\t\tthis._selectionBeginIndex == this._selectionEndIndex;\n\t\t\tthis._cursorSkin.visible = showCursor;\n\t\t\tthis._selectionSkin.visible = showSelection;\n\t\t\tthis.refreshCursorBlink();\n\t\t\tif(!FocusManager.isEnabledForStage(this.stage))\n\t\t\t{\n\t\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\t\t//if there isn't a focus manager, we need to set focus manually\n\t\t\t\tstarling.nativeStage.focus = this._nativeFocus;\n\t\t\t}\n\t\t\tif(this._isEditable)\n\t\t\t{\n\t\t\t\tthis._nativeFocus.requestSoftKeyboard();\n\t\t\t}\n\t\t\tif(this._hasFocus)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//we're reusing this variable. since this isn't a display object\n\t\t\t//that the focus manager can see, it's not being used anyway.\n\t\t\tthis._hasFocus = true;\n\t\t\tthis.stage.addEventListener(TouchEvent.TOUCH, stage_touchHandler);\n\t\t\tthis.stage.addEventListener(KeyboardEvent.KEY_DOWN, stage_keyDownHandler);\n\t\t\tthis.addEventListener(starling.events.Event.ENTER_FRAME, hasFocus_enterFrameHandler);\n\t\t\tthis.dispatchEventWith(FeathersEventType.FOCUS_IN);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshCursorBlink():void\n\t\t{\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tif(this._cursorDelayID == uint.MAX_VALUE && this._cursorSkin.visible)\n\t\t\t{\n\t\t\t\tthis._cursorSkin.alpha = 1;\n\t\t\t\tthis._cursorDelayID = starling.juggler.delayCall(toggleCursorSkin, this._cursorDelay);\n\t\t\t}\n\t\t\telse if(this._cursorDelayID != uint.MAX_VALUE && !this._cursorSkin.visible)\n\t\t\t{\n\t\t\t\tstarling.juggler.removeByID(this._cursorDelayID);\n\t\t\t\tthis._cursorDelayID = uint.MAX_VALUE;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function toggleCursorSkin():void\n\t\t{\n\t\t\tif(this._cursorSkin.alpha > 0)\n\t\t\t{\n\t\t\t\tthis._cursorSkin.alpha = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._cursorSkin.alpha = 1;\n\t\t\t}\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tthis._cursorDelayID = starling.juggler.delayCall(toggleCursorSkin, this._cursorDelay);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getSelectionIndexAtPoint(pointX:Number, pointY:Number):int\n\t\t{\n\t\t\tif(!this._text || pointX <= 0)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tvar font:BitmapFont = this._currentTextFormat.font;\n\t\t\tvar customSize:Number = this._currentTextFormat.size;\n\t\t\tvar customLetterSpacing:Number = this._currentTextFormat.letterSpacing;\n\t\t\tvar isKerningEnabled:Boolean = this._currentTextFormat.isKerningEnabled;\n\t\t\tvar scale:Number = customSize / font.size;\n\t\t\tif(scale !== scale) //isNaN\n\t\t\t{\n\t\t\t\tscale = 1;\n\t\t\t}\n\t\t\tvar align:String = this._currentTextFormat.align;\n\t\t\tif(align !== TextFormatAlign.LEFT)\n\t\t\t{\n\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\tthis.measureTextInternal(point, false);\n\t\t\t\tvar lineWidth:Number = point.x;\n\t\t\t\tPool.putPoint(point);\n\t\t\t\tvar hasExplicitWidth:Boolean = this._explicitWidth === this._explicitWidth; //!isNaN\n\t\t\t\tvar maxLineWidth:Number = hasExplicitWidth ? this._explicitWidth : this._explicitMaxWidth;\n\t\t\t\tif(maxLineWidth > lineWidth)\n\t\t\t\t{\n\t\t\t\t\tif(align === TextFormatAlign.RIGHT)\n\t\t\t\t\t{\n\t\t\t\t\t\tpointX -= maxLineWidth - lineWidth;\n\t\t\t\t\t}\n\t\t\t\t\telse //center\n\t\t\t\t\t{\n\t\t\t\t\t\tpointX -= (maxLineWidth - lineWidth) / 2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar currentX:Number = 0;\n\t\t\tvar previousCharID:Number = NaN;\n\t\t\tvar charCount:int = this._text.length;\n\t\t\tfor(var i:int = 0; i < charCount; i++)\n\t\t\t{\n\t\t\t\tvar charID:int = this._text.charCodeAt(i);\n\t\t\t\tvar charData:BitmapChar = font.getChar(charID);\n\t\t\t\tif(!charData)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tvar currentKerning:Number = 0;\n\t\t\t\tif(isKerningEnabled &&\n\t\t\t\t\tpreviousCharID === previousCharID) //!isNaN\n\t\t\t\t{\n\t\t\t\t\tcurrentKerning = charData.getKerning(previousCharID) * scale;\n\t\t\t\t}\n\t\t\t\tvar charWidth:Number = customLetterSpacing + currentKerning + charData.xAdvance * scale;\n\t\t\t\tif(pointX >= currentX && pointX < (currentX + charWidth))\n\t\t\t\t{\n\t\t\t\t\tif(pointX > (currentX + charWidth / 2))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn i + 1;\n\t\t\t\t\t}\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t\tcurrentX += charWidth;\n\t\t\t\tpreviousCharID = charID;\n\t\t\t}\n\t\t\tif(pointX >= currentX)\n\t\t\t{\n\t\t\t\treturn this._text.length;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getXPositionOfIndex(index:int):Number\n\t\t{\n\t\t\tvar font:BitmapFont = this._currentTextFormat.font;\n\t\t\tvar customSize:Number = this._currentTextFormat.size;\n\t\t\tvar customLetterSpacing:Number = this._currentTextFormat.letterSpacing;\n\t\t\tvar isKerningEnabled:Boolean = this._currentTextFormat.isKerningEnabled;\n\t\t\tvar scale:Number = customSize / font.size;\n\t\t\tif(scale !== scale) //isNaN\n\t\t\t{\n\t\t\t\tscale = 1;\n\t\t\t}\n\t\t\tvar xPositionOffset:Number = 0;\n\t\t\tvar align:String = this._currentTextFormat.align;\n\t\t\tif(align !== TextFormatAlign.LEFT)\n\t\t\t{\n\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\tthis.measureTextInternal(point, false);\n\t\t\t\tvar lineWidth:Number = point.x;\n\t\t\t\tPool.putPoint(point);\n\t\t\t\tvar hasExplicitWidth:Boolean = this._explicitWidth === this._explicitWidth; //!isNaN\n\t\t\t\tvar maxLineWidth:Number = hasExplicitWidth ? this._explicitWidth : this._explicitMaxWidth;\n\t\t\t\tif(maxLineWidth > lineWidth)\n\t\t\t\t{\n\t\t\t\t\tif(align === TextFormatAlign.RIGHT)\n\t\t\t\t\t{\n\t\t\t\t\t\txPositionOffset = maxLineWidth - lineWidth;\n\t\t\t\t\t}\n\t\t\t\t\telse //center\n\t\t\t\t\t{\n\t\t\t\t\t\txPositionOffset = (maxLineWidth - lineWidth) / 2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar currentX:Number = 0;\n\t\t\tvar previousCharID:Number = NaN;\n\t\t\tvar charCount:int = this._text.length;\n\t\t\tif(index < charCount)\n\t\t\t{\n\t\t\t\tcharCount = index;\n\t\t\t}\n\t\t\tfor(var i:int = 0; i < charCount; i++)\n\t\t\t{\n\t\t\t\tvar charID:int = this._text.charCodeAt(i);\n\t\t\t\tvar charData:BitmapChar = font.getChar(charID);\n\t\t\t\tif(!charData)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tvar currentKerning:Number = 0;\n\t\t\t\tif(isKerningEnabled &&\n\t\t\t\t\tpreviousCharID === previousCharID) //!isNaN\n\t\t\t\t{\n\t\t\t\t\tcurrentKerning = charData.getKerning(previousCharID) * scale;\n\t\t\t\t}\n\t\t\t\tcurrentX += customLetterSpacing + currentKerning + charData.xAdvance * scale;\n\t\t\t\tpreviousCharID = charID;\n\t\t\t}\n\t\t\treturn currentX + xPositionOffset;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function positionCursorAtCharIndex(index:int):void\n\t\t{\n\t\t\tif(index < 0)\n\t\t\t{\n\t\t\t\tindex = 0;\n\t\t\t}\n\t\t\tvar cursorX:Number = this.getXPositionOfIndex(index);\n\t\t\tcursorX = int(cursorX - (this._cursorSkin.width / 2));\n\t\t\tthis._cursorSkin.x = cursorX;\n\t\t\tthis._cursorSkin.y = this._verticalAlignOffsetY;\n\n\t\t\t//then we update the scroll to always show the cursor\n\t\t\tvar minScrollX:Number = cursorX + this._cursorSkin.width - this.actualWidth;\n\t\t\tvar maxScrollX:Number = this.getXPositionOfIndex(this._text.length) - this.actualWidth;\n\t\t\tif(maxScrollX < 0)\n\t\t\t{\n\t\t\t\tmaxScrollX = 0;\n\t\t\t}\n\t\t\tif(this._scrollX < minScrollX)\n\t\t\t{\n\t\t\t\tthis._scrollX = minScrollX;\n\t\t\t}\n\t\t\telse if(this._scrollX > cursorX)\n\t\t\t{\n\t\t\t\tthis._scrollX = cursorX;\n\t\t\t}\n\t\t\tif(this._scrollX > maxScrollX)\n\t\t\t{\n\t\t\t\tthis._scrollX = maxScrollX;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getCursorIndexFromSelectionRange():int\n\t\t{\n\t\t\tvar cursorIndex:int = this._selectionEndIndex;\n\t\t\tif(this.touchPointID >= 0 && this._selectionAnchorIndex >= 0 && this._selectionAnchorIndex == this._selectionEndIndex)\n\t\t\t{\n\t\t\t\tcursorIndex = this._selectionBeginIndex;\n\t\t\t}\n\t\t\treturn cursorIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function positionSelectionBackground():void\n\t\t{\n\t\t\tvar font:BitmapFont = this._currentTextFormat.font;\n\t\t\tvar customSize:Number = this._currentTextFormat.size;\n\t\t\tvar scale:Number = customSize / font.size;\n\t\t\tif(scale !== scale) //isNaN\n\t\t\t{\n\t\t\t\tscale = 1;\n\t\t\t}\n\n\t\t\tvar startX:Number = this.getXPositionOfIndex(this._selectionBeginIndex) - this._scrollX;\n\t\t\tif(startX < 0)\n\t\t\t{\n\t\t\t\tstartX = 0;\n\t\t\t}\n\t\t\tvar endX:Number = this.getXPositionOfIndex(this._selectionEndIndex) - this._scrollX;\n\t\t\tif(endX < 0)\n\t\t\t{\n\t\t\t\tendX = 0;\n\t\t\t}\n\t\t\tthis._selectionSkin.x = startX;\n\t\t\tthis._selectionSkin.width = endX - startX;\n\t\t\tthis._selectionSkin.y = this._verticalAlignOffsetY;\n\t\t\tthis._selectionSkin.height = font.lineHeight * scale;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getSelectedText():String\n\t\t{\n\t\t\tif(this._selectionBeginIndex == this._selectionEndIndex)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn this._text.substr(this._selectionBeginIndex, this._selectionEndIndex - this._selectionBeginIndex);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function deleteSelectedText():void\n\t\t{\n\t\t\tvar currentValue:String = this._text;\n\t\t\tif(this._displayAsPassword)\n\t\t\t{\n\t\t\t\tcurrentValue = this._unmaskedText;\n\t\t\t}\n\t\t\tthis.text = currentValue.substr(0, this._selectionBeginIndex) + currentValue.substr(this._selectionEndIndex);\n\t\t\tthis.selectRange(this._selectionBeginIndex, this._selectionBeginIndex);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function replaceSelectedText(text:String):void\n\t\t{\n\t\t\tvar currentValue:String = this._text;\n\t\t\tif(this._displayAsPassword)\n\t\t\t{\n\t\t\t\tcurrentValue = this._unmaskedText;\n\t\t\t}\n\t\t\tvar newText:String = currentValue.substr(0, this._selectionBeginIndex) + text + currentValue.substr(this._selectionEndIndex);\n\t\t\tif(this._maxChars > 0 && newText.length > this._maxChars)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.text = newText;\n\t\t\tvar selectionIndex:int = this._selectionBeginIndex + text.length;\n\t\t\tthis.selectRange(selectionIndex, selectionIndex);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function hasFocus_enterFrameHandler(event:starling.events.Event):void\n\t\t{\n\t\t\tvar target:DisplayObject = this;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tif(!target.visible)\n\t\t\t\t{\n\t\t\t\t\tthis.clearFocus();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ttarget = target.parent;\n\t\t\t}\n\t\t\twhile(target);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textEditor_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled || (!this._isEditable && !this._isSelectable))\n\t\t\t{\n\t\t\t\tthis.touchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this.touchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(this, null, this.touchPointID);\n\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\ttouch.getLocation(this, point);\n\t\t\t\tpoint.x += this._scrollX;\n\t\t\t\tthis.selectRange(this._selectionAnchorIndex, this.getSelectionIndexAtPoint(point.x, point.y));\n\t\t\t\tPool.putPoint(point);\n\t\t\t\tif(touch.phase === TouchPhase.ENDED)\n\t\t\t\t{\n\t\t\t\t\tthis.touchPointID = -1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //if we get here, we don't have a saved touch ID yet\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(this, TouchPhase.BEGAN);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(touch.tapCount == 2)\n\t\t\t\t{\n\t\t\t\t\tvar start:int = TextInputNavigation.findCurrentWordStartIndex(this._text, this._selectionBeginIndex);\n\t\t\t\t\tvar end:int = TextInputNavigation.findCurrentWordEndIndex(this._text, this._selectionEndIndex);\n\t\t\t\t\tthis.selectRange(start, end);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse if(touch.tapCount > 2)\n\t\t\t\t{\n\t\t\t\t\tthis.selectRange(0, this._text.length);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.touchPointID = touch.id;\n\t\t\t\tpoint = Pool.getPoint();\n\t\t\t\ttouch.getLocation(this, point);\n\t\t\t\tpoint.x += this._scrollX;\n\t\t\t\tif(event.shiftKey)\n\t\t\t\t{\n\t\t\t\t\tif(this._selectionAnchorIndex < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._selectionAnchorIndex = this._selectionBeginIndex;\n\t\t\t\t\t}\n\t\t\t\t\tthis.selectRange(this._selectionAnchorIndex, this.getSelectionIndexAtPoint(point.x, point.y));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.setFocus(point);\n\t\t\t\t}\n\t\t\t\tPool.putPoint(point);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(FocusManager.isEnabledForStage(this.stage))\n\t\t\t{\n\t\t\t\t//let the focus manager handle clearing focus\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar touch:Touch = event.getTouch(this.stage, TouchPhase.BEGAN);\n\t\t\tif(!touch) //we only care about began touches\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar point:Point = Pool.getPoint();\n\t\t\ttouch.getLocation(this.stage, point);\n\t\t\tvar isInBounds:Boolean = this.contains(this.stage.hitTest(point));\n\t\t\tPool.putPoint(point);\n\t\t\tif(isInBounds) //if the touch is in the text editor, it's all good\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//if the touch begins anywhere else, it's a focus out!\n\t\t\tthis.clearFocus();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled || (!this._isEditable && !this._isSelectable) ||\n\t\t\t\tthis.touchPointID >= 0 || event.isDefaultPrevented())\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//ignore select all, cut, copy, and paste\n\t\t\tvar charCode:uint = event.charCode;\n\t\t\tif(event.ctrlKey && (charCode == 97 || charCode == 99 || charCode == 118 || charCode == 120)) //a, c, p, and x\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar newIndex:int = -1;\n\t\t\tif(!FocusManager.isEnabledForStage(this.stage) && event.keyCode == Keyboard.TAB)\n\t\t\t{\n\t\t\t\tthis.clearFocus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if(event.keyCode == Keyboard.HOME || event.keyCode == Keyboard.UP)\n\t\t\t{\n\t\t\t\tnewIndex = 0;\n\t\t\t\tif(event.shiftKey)\n\t\t\t\t{\n\t\t\t\t\tthis.selectRange(newIndex, this._selectionAnchorIndex);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(event.keyCode == Keyboard.END || event.keyCode == Keyboard.DOWN)\n\t\t\t{\n\t\t\t\tnewIndex = this._text.length;\n\t\t\t\tif(event.shiftKey)\n\t\t\t\t{\n\t\t\t\t\tthis.selectRange(this._selectionAnchorIndex, newIndex);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(event.keyCode == Keyboard.LEFT)\n\t\t\t{\n\t\t\t\tif(event.shiftKey)\n\t\t\t\t{\n\t\t\t\t\tif(this._selectionAnchorIndex >= 0 && this._selectionAnchorIndex == this._selectionBeginIndex &&\n\t\t\t\t\t\tthis._selectionBeginIndex != this._selectionEndIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewIndex = this._selectionEndIndex - 1;\n\t\t\t\t\t\tthis.selectRange(this._selectionBeginIndex, newIndex);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewIndex = this._selectionBeginIndex - 1;\n\t\t\t\t\t\tif(newIndex < 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewIndex = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.selectRange(newIndex, this._selectionEndIndex);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse if(this._selectionBeginIndex != this._selectionEndIndex)\n\t\t\t\t{\n\t\t\t\t\tnewIndex = this._selectionBeginIndex;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(event.altKey || event.ctrlKey)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewIndex = TextInputNavigation.findPreviousWordStartIndex(this._text, this._selectionBeginIndex);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewIndex = this._selectionBeginIndex - 1;\n\t\t\t\t\t}\n\t\t\t\t\tif(newIndex < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewIndex = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(event.keyCode == Keyboard.RIGHT)\n\t\t\t{\n\t\t\t\tif(event.shiftKey)\n\t\t\t\t{\n\t\t\t\t\tif(this._selectionAnchorIndex >= 0 && this._selectionAnchorIndex == this._selectionEndIndex &&\n\t\t\t\t\t\tthis._selectionBeginIndex != this._selectionEndIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewIndex = this._selectionBeginIndex + 1;\n\t\t\t\t\t\tthis.selectRange(newIndex, this._selectionEndIndex);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewIndex = this._selectionEndIndex + 1;\n\t\t\t\t\t\tif(newIndex < 0 || newIndex > this._text.length)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewIndex = this._text.length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.selectRange(this._selectionBeginIndex, newIndex);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse if(this._selectionBeginIndex != this._selectionEndIndex)\n\t\t\t\t{\n\t\t\t\t\tnewIndex = this._selectionEndIndex;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(event.altKey || event.ctrlKey)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewIndex = TextInputNavigation.findNextWordStartIndex(this._text, this._selectionEndIndex);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewIndex = this._selectionEndIndex + 1;\n\t\t\t\t\t}\n\t\t\t\t\tif(newIndex < 0 || newIndex > this._text.length)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewIndex = this._text.length;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(newIndex < 0)\n\t\t\t{\n\t\t\t\tif(event.keyCode == Keyboard.ENTER)\n\t\t\t\t{\n\t\t\t\t\tthis.dispatchEventWith(FeathersEventType.ENTER);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t//everything after this point edits the text, so return if the text\n\t\t\t\t//editor isn't editable.\n\t\t\t\tif(!this._isEditable)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar currentValue:String = this._text;\n\t\t\t\tif(this._displayAsPassword)\n\t\t\t\t{\n\t\t\t\t\tcurrentValue = this._unmaskedText;\n\t\t\t\t}\n\t\t\t\tif(event.keyCode == Keyboard.DELETE)\n\t\t\t\t{\n\t\t\t\t\tif(event.altKey || event.ctrlKey)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar nextWordStartIndex:int = TextInputNavigation.findNextWordStartIndex(this._text, this._selectionEndIndex);\n\t\t\t\t\t\tthis.text = currentValue.substr(0, this._selectionBeginIndex) + currentValue.substr(nextWordStartIndex);\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._selectionBeginIndex != this._selectionEndIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.deleteSelectedText();\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._selectionEndIndex < currentValue.length)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.text = currentValue.substr(0, this._selectionBeginIndex) + currentValue.substr(this._selectionEndIndex + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(event.keyCode == Keyboard.BACKSPACE)\n\t\t\t\t{\n\t\t\t\t\tif(event.altKey || event.ctrlKey)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewIndex = TextInputNavigation.findPreviousWordStartIndex(this._text, this._selectionBeginIndex);\n\t\t\t\t\t\tthis.text = currentValue.substr(0, newIndex) + currentValue.substr(this._selectionEndIndex);\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._selectionBeginIndex != this._selectionEndIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.deleteSelectedText();\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._selectionBeginIndex > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewIndex = this._selectionBeginIndex - 1;\n\t\t\t\t\t\tthis.text = currentValue.substr(0, this._selectionBeginIndex - 1) + currentValue.substr(this._selectionEndIndex);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(newIndex >= 0)\n\t\t\t{\n\t\t\t\tthis.selectRange(newIndex, newIndex);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function nativeFocus_textInputHandler(event:TextEvent):void\n\t\t{\n\t\t\tif(!this._isEditable || !this._isEnabled)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar text:String = event.text;\n\t\t\tif(text === CARRIAGE_RETURN || text === LINE_FEED)\n\t\t\t{\n\t\t\t\t//ignore new lines\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar charCode:int = text.charCodeAt(0);\n\t\t\tif(!this._restrict || this._restrict.isCharacterAllowed(charCode))\n\t\t\t{\n\t\t\t\tthis.replaceSelectedText(text);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function nativeFocus_selectAllHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tif(!this._isEnabled || (!this._isEditable && !this._isSelectable))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._selectionAnchorIndex = 0;\n\t\t\tthis.selectRange(0, this._text.length);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function nativeFocus_cutHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tif(!this._isEnabled || (!this._isEditable && !this._isSelectable) ||\n\t\t\t\tthis._selectionBeginIndex == this._selectionEndIndex || this._displayAsPassword)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tClipboard.generalClipboard.setData(ClipboardFormats.TEXT_FORMAT, this.getSelectedText());\n\t\t\tif(!this._isEditable)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.deleteSelectedText();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function nativeFocus_copyHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tif(!this._isEnabled || (!this._isEditable && !this._isSelectable) ||\n\t\t\t\tthis._selectionBeginIndex == this._selectionEndIndex || this._displayAsPassword)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tClipboard.generalClipboard.setData(ClipboardFormats.TEXT_FORMAT, this.getSelectedText());\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function nativeFocus_pasteHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tif(!this._isEditable || !this._isEnabled)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar pastedText:String = Clipboard.generalClipboard.getData(ClipboardFormats.TEXT_FORMAT) as String;\n\t\t\tif(pastedText === null)\n\t\t\t{\n\t\t\t\t//the clipboard doesn't contain any text to paste\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//new lines are not allowed\n\t\t\tpastedText = pastedText.replace(/[\\n\\r]/g, \"\");\n\t\t\tif(this._restrict)\n\t\t\t{\n\t\t\t\tpastedText = this._restrict.filterText(pastedText);\n\t\t\t}\n\t\t\tthis.replaceSelectedText(pastedText);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/text/BitmapFontTextRenderer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.text\n{\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.ITextRenderer;\n\timport feathers.core.IToggle;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.text.BitmapFontTextFormat;\n\n\timport flash.geom.Point;\n\timport flash.geom.Rectangle;\n\timport flash.text.TextFormatAlign;\n\n\timport starling.display.Image;\n\timport starling.display.MeshBatch;\n\timport starling.rendering.Painter;\n\timport starling.styles.MeshStyle;\n\timport starling.text.BitmapChar;\n\timport starling.text.BitmapFont;\n\timport starling.text.TextField;\n\timport starling.text.TextFormat;\n\timport starling.textures.Texture;\n\timport starling.utils.Align;\n\timport starling.utils.MathUtil;\n\timport starling.utils.Pool;\n\n\t/**\n\t * Renders text using\n\t * <a href=\"http://wiki.starling-framework.org/manual/displaying_text#bitmap_fonts\" target=\"_top\">bitmap fonts</a>.\n\t *\n\t * <p>The following example shows how to use\n\t * <code>BitmapFontTextRenderer</code> with a <code>Label</code>:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var label:Label = new Label();\n\t * label.text = \"I am the very model of a modern Major General\";\n\t * label.textRendererFactory = function():ITextRenderer\n\t * {\n\t *     return new BitmapFontTextRenderer();\n\t * };\n\t * this.addChild( label );</listing>\n\t *\n\t * @see ../../../../help/text-renderers.html Introduction to Feathers text renderers\n\t * @see ../../../../help/bitmap-font-text-renderer.html How to use the Feathers BitmapFontTextRenderer component\n\t * @see http://wiki.starling-framework.org/manual/displaying_text#bitmap_fonts Starling Wiki: Displaying Text with Bitmap Fonts\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class BitmapFontTextRenderer extends BaseTextRenderer implements ITextRenderer\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const HELPER_RESULT:MeasureTextResult = new MeasureTextResult();\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const CHARACTER_ID_SPACE:int = 32;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const CHARACTER_ID_TAB:int = 9;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const CHARACTER_ID_LINE_FEED:int = 10;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const CHARACTER_ID_CARRIAGE_RETURN:int = 13;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static var CHARACTER_BUFFER:Vector.<CharLocation>;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static var CHAR_LOCATION_POOL:Vector.<CharLocation>;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const FUZZY_MAX_WIDTH_PADDING:Number = 0.000001;\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>BitmapFontTextRenderer</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function BitmapFontTextRenderer()\n\t\t{\n\t\t\tsuper();\n\t\t\tif(!CHAR_LOCATION_POOL)\n\t\t\t{\n\t\t\t\t//compiler doesn't like referencing CharLocation class in a\n\t\t\t\t//static constant\n\t\t\t\tCHAR_LOCATION_POOL = new <CharLocation>[];\n\t\t\t}\n\t\t\tif(!CHARACTER_BUFFER)\n\t\t\t{\n\t\t\t\tCHARACTER_BUFFER = new <CharLocation>[];\n\t\t\t}\n\t\t\tthis.isQuickHitAreaEnabled = true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _characterBatch:MeshBatch = null;\n\n\t\t/**\n\t\t * @private\n\t\t * This variable may be used by subclasses to affect the x position of\n\t\t * the text.\n\t\t */\n\t\tprotected var _batchX:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textFormatChanged:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentFontStyles:TextFormat = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fontStylesTextFormat:BitmapFontTextFormat;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentVerticalAlign:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalAlignOffsetY:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentTextFormat:BitmapFontTextFormat;\n\n\t\t/**\n\t\t * For debugging purposes, the current\n\t\t * <code>feathers.text.BitmapFontTextFormat</code> used to render the\n\t\t * text. Updated during validation, and may be <code>null</code> before\n\t\t * the first validation.\n\t\t *\n\t\t * <p>Do not modify this value. It is meant for testing and debugging\n\t\t * only. Use the parent's <code>starling.text.TextFormat</code> font\n\t\t * styles APIs instead.</p>\n\t\t */\n\t\tpublic function get currentTextFormat():BitmapFontTextFormat\n\t\t{\n\t\t\treturn this._currentTextFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn BitmapFontTextRenderer.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set maxWidth(value:Number):void\n\t\t{\n\t\t\t//this is a special case because truncation may bypass normal rules\n\t\t\t//for determining if changing maxWidth should invalidate\n\t\t\tvar needsInvalidate:Boolean = value > this._explicitMaxWidth && this._lastLayoutIsTruncated;\n\t\t\tsuper.maxWidth = value;\n\t\t\tif(needsInvalidate)\n\t\t\t{\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _numLines:int = 0;\n\n\t\t/**\n\t\t * @copy feathers.core.ITextRenderer#numLines\n\t\t */\n\t\tpublic function get numLines():int\n\t\t{\n\t\t\treturn this._numLines;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textFormatForState:Object;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textFormat:BitmapFontTextFormat;\n\n\t\t/**\n\t\t * Advanced font formatting used to draw the text, if\n\t\t * <code>fontStyles</code> and <code>starling.text.TextFormat</code>\n\t\t * cannot be used on the parent component because the other features of\n\t\t * bitmap fonts are required.\n\t\t *\n\t\t * <p>In the following example, the text format is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.textFormat = new BitmapFontTextFormat( bitmapFont );</listing>\n\t\t *\n\t\t * <p><strong>Warning:</strong> If this property is not\n\t\t * <code>null</code>, any <code>starling.text.TextFormat</code> font\n\t\t * styles that are passed in from the parent component may be ignored.\n\t\t * In other words, advanced font styling with\n\t\t * <code>BitmapFontTextFormat</code> will always take precedence.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #setTextFormatForState()\n\t\t * @see #disabledTextFormat\n\t\t * @see #selectedTextFormat\n\t\t */\n\t\tpublic function get textFormat():BitmapFontTextFormat\n\t\t{\n\t\t\treturn this._textFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set textFormat(value:BitmapFontTextFormat):void\n\t\t{\n\t\t\tif(this._textFormat == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textFormat = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _disabledTextFormat:BitmapFontTextFormat;\n\n\t\t/**\n\t\t * Advanced font formatting used to draw the text when the component is\n\t\t * disabled, if <code>disabledFontStyles</code> and\n\t\t * <code>starling.text.TextFormat</code> cannot be used on the parent\n\t\t * component because the other features of bitmap fonts are required.\n\t\t *\n\t\t * <p>In the following example, the disabled text format is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.isEnabled = false;\n\t\t * textRenderer.disabledTextFormat = new BitmapFontTextFormat( bitmapFont );</listing>\n\t\t *\n\t\t * <p><strong>Warning:</strong> If this property is not\n\t\t * <code>null</code>, any <code>starling.text.TextFormat</code> font\n\t\t * styles that are passed in from the parent component may be ignored.\n\t\t * In other words, advanced font styling with\n\t\t * <code>BitmapFontTextFormat</code> will always take precedence.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #textFormat\n\t\t * @see #selectedTextFormat\n\t\t */\n\t\tpublic function get disabledTextFormat():BitmapFontTextFormat\n\t\t{\n\t\t\treturn this._disabledTextFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disabledTextFormat(value:BitmapFontTextFormat):void\n\t\t{\n\t\t\tif(this._disabledTextFormat == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._disabledTextFormat = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectedTextFormat:BitmapFontTextFormat;\n\n\t\t/**\n\t\t * Advanced font formatting used to draw the text when the\n\t\t * <code>stateContext</code> is disabled, if\n\t\t * <code>selectedFontStyles</code> and\n\t\t * <code>starling.text.TextFormat</code> cannot be used on the parent\n\t\t * component because the other features of bitmap fonts are required.\n\t\t *\n\t\t * <p>In the following example, the selected text format is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.selectedTextFormat = new BitmapFontTextFormat( bitmapFont );</listing>\n\t\t *\n\t\t * <p><strong>Warning:</strong> If this property is not\n\t\t * <code>null</code>, any <code>starling.text.TextFormat</code> font\n\t\t * styles that are passed in from the parent component may be ignored.\n\t\t * In other words, advanced font styling with\n\t\t * <code>BitmapFontTextFormat</code> will always take precedence.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #stateContext\n\t\t * @see feathers.core.IToggle\n\t\t * @see #textFormat\n\t\t * @see #disabledTextFormat\n\t\t */\n\t\tpublic function get selectedTextFormat():BitmapFontTextFormat\n\t\t{\n\t\t\treturn this._selectedTextFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedTextFormat(value:BitmapFontTextFormat):void\n\t\t{\n\t\t\tif(this._selectedTextFormat == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._selectedTextFormat = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textureSmoothing:String = null;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"bilinear,trilinear,none\")]\n\t\t/**\n\t\t * A texture smoothing value passed to each character image. If\n\t\t * <code>null</code>, defaults to the value specified by the\n\t\t * <code>smoothing</code> property of the <code>BitmapFont</code>.\n\t\t *\n\t\t * <p>In the following example, the texture smoothing is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.textureSmoothing = TextureSmoothing.NONE;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/textures/TextureSmoothing.html starling.textures.TextureSmoothing\n\t\t */\n\t\tpublic function get textureSmoothing():String\n\t\t{\n\t\t\treturn this._textureSmoothing;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set textureSmoothing(value:String):void\n\t\t{\n\t\t\tif(this._textureSmoothing == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textureSmoothing = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _pixelSnapping:Boolean = true;\n\n\t\t/**\n\t\t * Determines if the position of the text should be snapped to the\n\t\t * nearest whole pixel when rendered. When snapped to a whole pixel, the\n\t\t * text is often more readable. When not snapped, the text may become\n\t\t * blurry due to texture smoothing.\n\t\t *\n\t\t * <p>In the following example, the text is not snapped to pixels:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.pixelSnapping = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic function get pixelSnapping():Boolean\n\t\t{\n\t\t\treturn _pixelSnapping;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set pixelSnapping(value:Boolean):void\n\t\t{\n\t\t\tif(this._pixelSnapping === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._pixelSnapping = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _breakLongWords:Boolean = false;\n\n\t\t/**\n\t\t * If <code>wordWrap</code> is <code>true</code>, determines if words\n\t\t * longer than the width of the text renderer will break in the middle\n\t\t * or if the word will extend outside the edges until it ends.\n\t\t *\n\t\t * <p>In the following example, the text will break long words:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.breakLongWords = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see #wordWrap\n\t\t */\n\t\tpublic function get breakLongWords():Boolean\n\t\t{\n\t\t\treturn _breakLongWords;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set breakLongWords(value:Boolean):void\n\t\t{\n\t\t\tif(this._breakLongWords === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._breakLongWords = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _truncateToFit:Boolean = true;\n\n\t\t/**\n\t\t * If word wrap is disabled, and the text is longer than the width of\n\t\t * the label, the text may be truncated using <code>truncationText</code>.\n\t\t *\n\t\t * <p>This feature may be disabled to improve performance.</p>\n\t\t *\n\t\t * <p>This feature does not currently support the truncation of text\n\t\t * displayed on multiple lines.</p>\n\t\t *\n\t\t * <p>In the following example, truncation is disabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.truncateToFit = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t *\n\t\t * @see #truncationText\n\t\t */\n\t\tpublic function get truncateToFit():Boolean\n\t\t{\n\t\t\treturn _truncateToFit;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set truncateToFit(value:Boolean):void\n\t\t{\n\t\t\tif(this._truncateToFit == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._truncateToFit = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _truncationText:String = \"...\";\n\n\t\t/**\n\t\t * The text to display at the end of the label if it is truncated.\n\t\t *\n\t\t * <p>In the following example, the truncation text is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.truncationText = \" [more]\";</listing>\n\t\t *\n\t\t * @default \"...\"\n\t\t */\n\t\tpublic function get truncationText():String\n\t\t{\n\t\t\treturn _truncationText;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set truncationText(value:String):void\n\t\t{\n\t\t\tif(this._truncationText == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._truncationText = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _useSeparateBatch:Boolean = true;\n\n\t\t/**\n\t\t * Determines if the characters are batched normally by Starling or if\n\t\t * they're batched separately. Batching separately may improve\n\t\t * performance for text that changes often, while batching normally\n\t\t * may be better when a lot of text is displayed on screen at once.\n\t\t *\n\t\t * <p>In the following example, separate batching is disabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.useSeparateBatch = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic function get useSeparateBatch():Boolean\n\t\t{\n\t\t\treturn this._useSeparateBatch;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set useSeparateBatch(value:Boolean):void\n\t\t{\n\t\t\tif(this._useSeparateBatch == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._useSeparateBatch = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _defaultStyle:MeshStyle = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _style:MeshStyle = null;\n\n\t\t/**\n\t\t * The style that is used to render the text's mesh.\n\t\t *\n\t\t * <p>In the following example, the text renderer uses a custom style:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.style = new DistanceFieldStyle();</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get style():MeshStyle\n\t\t{\n\t\t\treturn this._style;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set style(value:MeshStyle):void\n\t\t{\n\t\t\tif(this._style == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._style = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get baseline():Number\n\t\t{\n\t\t\tif(this._currentTextFormat === null)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tvar font:BitmapFont = this._currentTextFormat.font;\n\t\t\tvar formatSize:Number = this._currentTextFormat.size;\n\t\t\tvar fontSizeScale:Number = formatSize / font.size;\n\t\t\tif(fontSizeScale !== fontSizeScale) //isNaN\n\t\t\t{\n\t\t\t\tfontSizeScale = 1;\n\t\t\t}\n\t\t\tvar baseline:Number = font.baseline;\n\t\t\t//for some reason, if we do the !== check on a local variable right\n\t\t\t//here, compiling with the flex 4.6 SDK will throw a VerifyError\n\t\t\t//for a stack overflow.\n\t\t\t//we could change the !== check back to isNaN() instead, but\n\t\t\t//isNaN() can allocate an object that needs garbage collection.\n\t\t\tthis._compilerWorkaround = baseline;\n\t\t\tif(baseline !== baseline) //isNaN\n\t\t\t{\n\t\t\t\treturn font.lineHeight * fontSizeScale;\n\t\t\t}\n\t\t\treturn baseline * fontSizeScale;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _image:Image = null;\n\n\t\t/**\n\t\t * @private\n\t\t * This function is here to work around a bug in the Flex 4.6 SDK\n\t\t * compiler. For explanation, see the places where it gets called.\n\t\t */\n\t\tprivate var _compilerWorkaround:Object;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function render(painter:Painter):void\n\t\t{\n\t\t\tthis._characterBatch.x = this._batchX;\n\t\t\tthis._characterBatch.y = this._verticalAlignOffsetY;\n\t\t\tsuper.render(painter);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function measureText(result:Point = null):Point\n\t\t{\n\t\t\treturn this.measureTextInternal(result, true);\n\t\t}\n\n\t\t/**\n\t\t * Gets the advanced <code>BitmapFontTextFormat</code> font formatting\n\t\t * passed in using <code>setTextFormatForState()</code> for the\n\t\t * specified state.\n\t\t *\n\t\t * <p>If an <code>BitmapFontTextFormat</code> is not defined for a\n\t\t * specific state, returns <code>null</code>.</p>\n\t\t *\n\t\t * @see #setTextFormatForState()\n\t\t */\n\t\tpublic function getTextFormatForState(state:String):BitmapFontTextFormat\n\t\t{\n\t\t\tif(this._textFormatForState === null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn BitmapFontTextFormat(this._textFormatForState[state]);\n\t\t}\n\n\t\t/**\n\t\t * Sets the advanced <code>BitmapFontTextFormat</code> font formatting\n\t\t * to be used by the text renderer when the <code>currentState</code>\n\t\t * property of the <code>stateContext</code> matches the specified state\n\t\t * value. For advanced use cases where\n\t\t * <code>starling.text.TextFormat</code> cannot be used on the parent\n\t\t * component because other features of bitmap fonts are required.\n\t\t *\n\t\t * <p>If an <code>BitmapFontTextFormat</code> is not defined for a\n\t\t * specific state, the value of the <code>textFormat</code> property\n\t\t * will be used instead.</p>\n\t\t *\n\t\t * <p>If the <code>disabledTextFormat</code> property is not\n\t\t * <code>null</code> and the <code>isEnabled</code> property is\n\t\t * <code>false</code>, all other text formats will be ignored.</p>\n\t\t *\n\t\t * @see #stateContext\n\t\t * @see #textFormat\n\t\t */\n\t\tpublic function setTextFormatForState(state:String, textFormat:BitmapFontTextFormat):void\n\t\t{\n\t\t\tif(textFormat)\n\t\t\t{\n\t\t\t\tif(!this._textFormatForState)\n\t\t\t\t{\n\t\t\t\t\tthis._textFormatForState = {};\n\t\t\t\t}\n\t\t\t\tthis._textFormatForState[state] = textFormat;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdelete this._textFormatForState[state];\n\t\t\t}\n\t\t\t//if the context's current state is the state that we're modifying,\n\t\t\t//we need to use the new value immediately.\n\t\t\tif(this._stateContext && this._stateContext.currentState === state)\n\t\t\t{\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_STATE);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tif(this._characterBatch === null)\n\t\t\t{\n\t\t\t\tthis._characterBatch = new MeshBatch();\n\t\t\t\tthis._characterBatch.touchable = false;\n\t\t\t\tthis.addChild(this._characterBatch);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastLayoutWidth:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastLayoutHeight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastLayoutIsTruncated:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\n\t\t\tif(stylesInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshTextFormat();\n\t\t\t}\n\n\t\t\tif(stylesInvalid)\n\t\t\t{\n\t\t\t\tthis._characterBatch.pixelSnapping = this._pixelSnapping;\n\t\t\t\tthis._characterBatch.batchable = !this._useSeparateBatch;\n\t\t\t}\n\n\t\t\t//sometimes, we can determine that the layout will be exactly\n\t\t\t//the same without needing to update. this will result in much\n\t\t\t//better performance.\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tif(newWidth !== newWidth) //isNaN\n\t\t\t{\n\t\t\t\tnewWidth = this._explicitMaxWidth;\n\t\t\t}\n\n\t\t\t//sometimes, we can determine that the dimensions will be exactly\n\t\t\t//the same without needing to refresh the text lines. this will\n\t\t\t//result in much better performance.\n\t\t\tif(this._wordWrap)\n\t\t\t{\n\t\t\t\t//when word wrapped, we need to measure again any time that the\n\t\t\t\t//width changes.\n\t\t\t\tvar sizeInvalid:Boolean = newWidth != this._lastLayoutWidth;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//we can skip measuring again more frequently when the text is\n\t\t\t\t//a single line.\n\n\t\t\t\t//if the width is smaller than the last layout width, we need to\n\t\t\t\t//measure again. when it's larger, the result won't change...\n\t\t\t\tsizeInvalid = newWidth < this._lastLayoutWidth;\n\n\t\t\t\t//...unless the text was previously truncated!\n\t\t\t\tsizeInvalid ||= (this._lastLayoutIsTruncated && newWidth != this._lastLayoutWidth);\n\n\t\t\t\t//... or the text is aligned\n\t\t\t\tsizeInvalid ||= this._currentTextFormat.align !== TextFormatAlign.LEFT;\n\t\t\t}\n\n\t\t\tif(dataInvalid || sizeInvalid || stylesInvalid || this._textFormatChanged)\n\t\t\t{\n\t\t\t\tthis._textFormatChanged = false;\n\t\t\t\tthis._characterBatch.clear();\n\t\t\t\tif(!this._currentTextFormat || this._text === null)\n\t\t\t\t{\n\t\t\t\t\tthis.saveMeasurements(0, 0, 0, 0);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.layoutCharacters(HELPER_RESULT);\n\t\t\t\t//for some reason, we can't just set the style once...\n\t\t\t\t//we need to set up every time after layout\n\t\t\t\tif(this._style !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._characterBatch.style = this._style;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//getDefaultMeshStyle doesn't exist in Starling 2.2\n\t\t\t\t\tthis._defaultStyle = this._currentTextFormat.font.getDefaultMeshStyle(this._defaultStyle, this._currentFontStyles, null);\n\t\t\t\t\tif(this._defaultStyle)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._characterBatch.style = this._defaultStyle;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis._lastLayoutWidth = HELPER_RESULT.width;\n\t\t\t\tthis._lastLayoutHeight = HELPER_RESULT.height;\n\t\t\t\tthis._lastLayoutIsTruncated = HELPER_RESULT.isTruncated;\n\t\t\t}\n\t\t\tthis.saveMeasurements(this._lastLayoutWidth, this._lastLayoutHeight,\n\t\t\t\tthis._lastLayoutWidth, this._lastLayoutHeight);\n\t\t\tthis._verticalAlignOffsetY = this.getVerticalAlignOffsetY();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutCharacters(result:MeasureTextResult = null):MeasureTextResult\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new MeasureTextResult();\n\t\t\t}\n\t\t\tthis._numLines = 1;\n\n\t\t\tvar font:BitmapFont = this._currentTextFormat.font;\n\t\t\tvar customSize:Number = this._currentTextFormat.size;\n\t\t\tvar customLetterSpacing:Number = this._currentTextFormat.letterSpacing;\n\t\t\tvar isKerningEnabled:Boolean = this._currentTextFormat.isKerningEnabled;\n\t\t\tvar scale:Number = customSize / font.size;\n\t\t\tif(scale !== scale) //isNaN\n\t\t\t{\n\t\t\t\tscale = 1;\n\t\t\t}\n\t\t\tvar lineHeight:Number = font.lineHeight * scale + this._currentTextFormat.leading;\n\t\t\tvar offsetX:Number = font.offsetX * scale;\n\t\t\tvar offsetY:Number = font.offsetY * scale;\n\n\t\t\tvar hasExplicitWidth:Boolean = this._explicitWidth === this._explicitWidth; //!isNaN\n\t\t\tvar isAligned:Boolean = this._currentTextFormat.align != TextFormatAlign.LEFT;\n\t\t\tvar maxLineWidth:Number = hasExplicitWidth ? this._explicitWidth : this._explicitMaxWidth;\n\t\t\tif(isAligned && maxLineWidth == Number.POSITIVE_INFINITY)\n\t\t\t{\n\t\t\t\t//we need to measure the text to get the maximum line width\n\t\t\t\t//so that we can align the text\n\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\tthis.measureText(point);\n\t\t\t\tmaxLineWidth = point.x;\n\t\t\t\tPool.putPoint(point);\n\t\t\t}\n\t\t\tvar textToDraw:String = this._text;\n\t\t\tif(this._truncateToFit)\n\t\t\t{\n\t\t\t\tvar truncatedText:String = this.getTruncatedText(maxLineWidth);\n\t\t\t\tresult.isTruncated = truncatedText !== textToDraw;\n\t\t\t\ttextToDraw = truncatedText;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult.isTruncated = false;\n\t\t\t}\n\t\t\tCHARACTER_BUFFER.length = 0;\n\n\t\t\tvar maxX:Number = 0;\n\t\t\tvar currentX:Number = 0;\n\t\t\tvar currentY:Number = 0;\n\t\t\tvar previousCharID:Number = NaN;\n\t\t\tvar isWordComplete:Boolean = false;\n\t\t\tvar startXOfPreviousWord:Number = 0;\n\t\t\tvar widthOfWhitespaceAfterWord:Number = 0;\n\t\t\tvar wordLength:int = 0;\n\t\t\tvar wordCountForLine:int = 0;\n\t\t\tvar charData:BitmapChar = null;\n\t\t\tvar charCount:int = textToDraw ? textToDraw.length : 0;\n\t\t\tfor(var i:int = 0; i < charCount; i++)\n\t\t\t{\n\t\t\t\tisWordComplete = false;\n\t\t\t\tvar charID:int = textToDraw.charCodeAt(i);\n\t\t\t\tif(charID == CHARACTER_ID_LINE_FEED || charID == CHARACTER_ID_CARRIAGE_RETURN) //new line \\n or \\r\n\t\t\t\t{\n\t\t\t\t\t//remove whitespace after the final character in the line\n\t\t\t\t\tcurrentX -= customLetterSpacing;\n\t\t\t\t\tif(charData !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tcurrentX -= (charData.xAdvance - charData.width) * scale;\n\t\t\t\t\t}\n\t\t\t\t\tif(currentX < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tcurrentX = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif(this._wordWrap || isAligned)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.alignBuffer(maxLineWidth, currentX, 0);\n\t\t\t\t\t\tthis.addBufferToBatch(0);\n\t\t\t\t\t}\n\t\t\t\t\tif(maxX < currentX)\n\t\t\t\t\t{\n\t\t\t\t\t\tmaxX = currentX;\n\t\t\t\t\t}\n\t\t\t\t\tpreviousCharID = NaN;\n\t\t\t\t\tcurrentX = 0;\n\t\t\t\t\tcurrentY += lineHeight;\n\t\t\t\t\tstartXOfPreviousWord = 0;\n\t\t\t\t\twidthOfWhitespaceAfterWord = 0;\n\t\t\t\t\twordLength = 0;\n\t\t\t\t\twordCountForLine = 0;\n\t\t\t\t\tthis._numLines++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tcharData = font.getChar(charID);\n\t\t\t\tif(charData === null)\n\t\t\t\t{\n\t\t\t\t\ttrace(\"Missing character \" + String.fromCharCode(charID) + \" in font \" + font.name + \".\");\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif(isKerningEnabled &&\n\t\t\t\t\tpreviousCharID === previousCharID) //!isNaN\n\t\t\t\t{\n\t\t\t\t\tcurrentX += charData.getKerning(previousCharID) * scale;\n\t\t\t\t}\n\n\t\t\t\tvar xAdvance:Number = charData.xAdvance * scale;\n\t\t\t\tif(this._wordWrap)\n\t\t\t\t{\n\t\t\t\t\tvar currentCharIsWhitespace:Boolean = charID == CHARACTER_ID_SPACE || charID == CHARACTER_ID_TAB;\n\t\t\t\t\tvar previousCharIsWhitespace:Boolean = previousCharID == CHARACTER_ID_SPACE || previousCharID == CHARACTER_ID_TAB;\n\t\t\t\t\tif(currentCharIsWhitespace)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(!previousCharIsWhitespace)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//this is the spacing after the last character\n\t\t\t\t\t\t\t//that isn't whitespace\n\t\t\t\t\t\t\tvar previousCharData:BitmapChar = font.getChar(previousCharID);\n\t\t\t\t\t\t\twidthOfWhitespaceAfterWord = customLetterSpacing + (previousCharData.xAdvance - previousCharData.width) * scale;\n\t\t\t\t\t\t}\n\t\t\t\t\t\twidthOfWhitespaceAfterWord += xAdvance;\n\t\t\t\t\t}\n\t\t\t\t\telse if(previousCharIsWhitespace)\n\t\t\t\t\t{\n\t\t\t\t\t\tstartXOfPreviousWord = currentX;\n\t\t\t\t\t\twordLength = 0;\n\t\t\t\t\t\twordCountForLine++;\n\t\t\t\t\t\tisWordComplete = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t//we may need to move to a new line at the same time\n\t\t\t\t\t//that our previous word in the buffer can be batched\n\t\t\t\t\t//so we need to add the buffer here rather than after\n\t\t\t\t\t//the next section\n\t\t\t\t\tif(isWordComplete && !isAligned)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.addBufferToBatch(0);\n\t\t\t\t\t}\n\n\t\t\t\t\t//floating point errors can cause unnecessary line breaks,\n\t\t\t\t\t//so we're going to be a little bit fuzzy on the greater\n\t\t\t\t\t//than check. such tiny numbers shouldn't break anything.\n\t\t\t\t\tvar charWidth:Number = charData.width * scale;\n\t\t\t\t\tif(!currentCharIsWhitespace && (wordCountForLine > 0 || this._breakLongWords) && ((currentX + charWidth) - maxLineWidth) > FUZZY_MAX_WIDTH_PADDING)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(wordCountForLine == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if we're breaking long words, this is where we break.\n\t\t\t\t\t\t\t//we need to pretend that there's a word before this one.\n\t\t\t\t\t\t\twordLength = 0;\n\t\t\t\t\t\t\tstartXOfPreviousWord = currentX;\n\t\t\t\t\t\t\twidthOfWhitespaceAfterWord = 0;\n\t\t\t\t\t\t\tif(previousCharID === previousCharID) //!isNaN\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tpreviousCharData = font.getChar(previousCharID);\n\t\t\t\t\t\t\t\twidthOfWhitespaceAfterWord = customLetterSpacing + (previousCharData.xAdvance - previousCharData.width) * scale;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!isAligned)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis.addBufferToBatch(0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(isAligned)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.trimBuffer(wordLength);\n\t\t\t\t\t\t\tthis.alignBuffer(maxLineWidth, startXOfPreviousWord - widthOfWhitespaceAfterWord, wordLength);\n\t\t\t\t\t\t\tthis.addBufferToBatch(wordLength);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.moveBufferedCharacters(-startXOfPreviousWord, lineHeight, 0);\n\t\t\t\t\t\t//we're just reusing this variable to avoid creating a\n\t\t\t\t\t\t//new one. it'll be reset to 0 in a moment.\n\t\t\t\t\t\twidthOfWhitespaceAfterWord = startXOfPreviousWord - widthOfWhitespaceAfterWord;\n\t\t\t\t\t\tif(maxX < widthOfWhitespaceAfterWord)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmaxX = widthOfWhitespaceAfterWord;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpreviousCharID = NaN;\n\t\t\t\t\t\tcurrentX -= startXOfPreviousWord;\n\t\t\t\t\t\tcurrentY += lineHeight;\n\t\t\t\t\t\tstartXOfPreviousWord = 0;\n\t\t\t\t\t\twidthOfWhitespaceAfterWord = 0;\n\t\t\t\t\t\twordLength = 0;\n\t\t\t\t\t\tisWordComplete = false;\n\t\t\t\t\t\twordCountForLine = 0;\n\t\t\t\t\t\tthis._numLines++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this._wordWrap || isAligned)\n\t\t\t\t{\n\t\t\t\t\tvar charLocation:CharLocation = CHAR_LOCATION_POOL.length > 0 ? CHAR_LOCATION_POOL.shift() : new CharLocation();\n\t\t\t\t\tcharLocation.char = charData;\n\t\t\t\t\tcharLocation.x = currentX + offsetX + charData.xOffset * scale;\n\t\t\t\t\tcharLocation.y = currentY + offsetY + charData.yOffset * scale;\n\t\t\t\t\tcharLocation.scale = scale;\n\t\t\t\t\tCHARACTER_BUFFER[CHARACTER_BUFFER.length] = charLocation;\n\t\t\t\t\twordLength++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.addCharacterToBatch(charData,\n\t\t\t\t\t\tcurrentX + offsetX + charData.xOffset * scale,\n\t\t\t\t\t\tcurrentY + offsetY + charData.yOffset * scale,\n\t\t\t\t\t\tscale);\n\t\t\t\t}\n\n\t\t\t\tcurrentX += xAdvance + customLetterSpacing;\n\t\t\t\tpreviousCharID = charID;\n\t\t\t}\n\t\t\t//remove whitespace after the final character in the final line\n\t\t\tcurrentX = currentX - customLetterSpacing;\n\t\t\tif(charData !== null)\n\t\t\t{\n\t\t\t\tcurrentX -= (charData.xAdvance - charData.width) * scale;\n\t\t\t}\n\t\t\tif(currentX < 0)\n\t\t\t{\n\t\t\t\tcurrentX = 0;\n\t\t\t}\n\t\t\tif(this._wordWrap || isAligned)\n\t\t\t{\n\t\t\t\tthis.alignBuffer(maxLineWidth, currentX, 0);\n\t\t\t\tthis.addBufferToBatch(0);\n\t\t\t}\n\t\t\t//if the text ends in extra whitespace, the currentX value will be\n\t\t\t//larger than the max line width. we'll remove that and add extra\n\t\t\t//lines.\n\t\t\tif(this._wordWrap)\n\t\t\t{\n\t\t\t\twhile(currentX > maxLineWidth && !MathUtil.isEquivalent(currentX, maxLineWidth))\n\t\t\t\t{\n\t\t\t\t\tcurrentX -= maxLineWidth;\n\t\t\t\t\tcurrentY += lineHeight;\n\t\t\t\t\tif(maxLineWidth == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//we don't want to get stuck in an infinite loop!\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(maxX < currentX)\n\t\t\t{\n\t\t\t\tmaxX = currentX;\n\t\t\t}\n\n\t\t\tif(isAligned && !hasExplicitWidth)\n\t\t\t{\n\t\t\t\tvar align:String = this._currentTextFormat.align;\n\t\t\t\tif(align == TextFormatAlign.CENTER)\n\t\t\t\t{\n\t\t\t\t\tthis._batchX = (maxX - maxLineWidth) / 2;\n\t\t\t\t}\n\t\t\t\telse if(align == TextFormatAlign.RIGHT)\n\t\t\t\t{\n\t\t\t\t\tthis._batchX = maxX - maxLineWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._batchX = 0;\n\t\t\t}\n\t\t\tthis._characterBatch.x = this._batchX;\n\n\t\t\tresult.width = maxX;\n\t\t\tresult.height = currentY + lineHeight - this._currentTextFormat.leading;\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function trimBuffer(skipCount:int):void\n\t\t{\n\t\t\tvar countToRemove:int = 0;\n\t\t\tvar charCount:int = CHARACTER_BUFFER.length - skipCount;\n\t\t\tfor(var i:int = charCount - 1; i >= 0; i--)\n\t\t\t{\n\t\t\t\tvar charLocation:CharLocation = CHARACTER_BUFFER[i];\n\t\t\t\tvar charData:BitmapChar = charLocation.char;\n\t\t\t\tvar charID:int = charData.charID;\n\t\t\t\tif(charID == CHARACTER_ID_SPACE || charID == CHARACTER_ID_TAB)\n\t\t\t\t{\n\t\t\t\t\tcountToRemove++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(countToRemove > 0)\n\t\t\t{\n\t\t\t\tCHARACTER_BUFFER.splice(i + 1, countToRemove);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function alignBuffer(maxLineWidth:Number, currentLineWidth:Number, skipCount:int):void\n\t\t{\n\t\t\tvar align:String = this._currentTextFormat.align;\n\t\t\tif(align == TextFormatAlign.CENTER)\n\t\t\t{\n\t\t\t\tthis.moveBufferedCharacters(Math.round((maxLineWidth - currentLineWidth) / 2), 0, skipCount);\n\t\t\t}\n\t\t\telse if(align == TextFormatAlign.RIGHT)\n\t\t\t{\n\t\t\t\tthis.moveBufferedCharacters(maxLineWidth - currentLineWidth, 0, skipCount);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function addBufferToBatch(skipCount:int):void\n\t\t{\n\t\t\tvar charCount:int = CHARACTER_BUFFER.length - skipCount;\n\t\t\tvar pushIndex:int = CHAR_LOCATION_POOL.length;\n\t\t\tfor(var i:int = 0; i < charCount; i++)\n\t\t\t{\n\t\t\t\tvar charLocation:CharLocation = CHARACTER_BUFFER.shift();\n\t\t\t\tthis.addCharacterToBatch(charLocation.char, charLocation.x, charLocation.y, charLocation.scale);\n\t\t\t\tcharLocation.char = null;\n\t\t\t\tCHAR_LOCATION_POOL[pushIndex] = charLocation;\n\t\t\t\tpushIndex++;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function moveBufferedCharacters(xOffset:Number, yOffset:Number, skipCount:int):void\n\t\t{\n\t\t\tvar charCount:int = CHARACTER_BUFFER.length - skipCount;\n\t\t\tfor(var i:int = 0; i < charCount; i++)\n\t\t\t{\n\t\t\t\tvar charLocation:CharLocation = CHARACTER_BUFFER[i];\n\t\t\t\tcharLocation.x += xOffset;\n\t\t\t\tcharLocation.y += yOffset;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function addCharacterToBatch(charData:BitmapChar, x:Number, y:Number, scale:Number, painter:Painter = null):void\n\t\t{\n\t\t\tvar texture:Texture = charData.texture;\n\t\t\tvar frame:Rectangle = texture.frame;\n\t\t\tif(frame)\n\t\t\t{\n\t\t\t\tif(frame.width == 0 || frame.height == 0)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(texture.width == 0 || texture.height == 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar font:BitmapFont = this._currentTextFormat.font;\n\t\t\tif(this._image === null)\n\t\t\t{\n\t\t\t\tthis._image = new Image(texture);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._image.texture = texture;\n\t\t\t\tthis._image.readjustSize();\n\t\t\t}\n\t\t\tthis._image.scaleX = scale;\n\t\t\tthis._image.scaleY = scale;\n\t\t\tthis._image.x = x;\n\t\t\tthis._image.y = y;\n\t\t\tthis._image.color = this._currentTextFormat.color;\n\t\t\tif(this._textureSmoothing !== null)\n\t\t\t{\n\t\t\t\tthis._image.textureSmoothing = this._textureSmoothing;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._image.textureSmoothing = font.smoothing;\n\t\t\t}\n\n\t\t\tif(painter !== null)\n\t\t\t{\n\t\t\t\tpainter.pushState();\n\t\t\t\tpainter.setStateTo(this._image.transformationMatrix);\n\t\t\t\tpainter.batchMesh(this._image);\n\t\t\t\tpainter.popState();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._characterBatch.addMesh(this._image);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshTextFormat():void\n\t\t{\n\t\t\tvar textFormat:BitmapFontTextFormat;\n\t\t\tif(this._stateContext !== null)\n\t\t\t{\n\t\t\t\tif(this._textFormatForState !== null)\n\t\t\t\t{\n\t\t\t\t\tvar currentState:String = this._stateContext.currentState;\n\t\t\t\t\tif(currentState in this._textFormatForState)\n\t\t\t\t\t{\n\t\t\t\t\t\ttextFormat = BitmapFontTextFormat(this._textFormatForState[currentState]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(textFormat === null && this._disabledTextFormat !== null &&\n\t\t\t\t\tthis._stateContext is IFeathersControl && !IFeathersControl(this._stateContext).isEnabled)\n\t\t\t\t{\n\t\t\t\t\ttextFormat = this._disabledTextFormat;\n\t\t\t\t}\n\t\t\t\tif(textFormat === null && this._selectedTextFormat !== null &&\n\t\t\t\t\tthis._stateContext is IToggle && IToggle(this._stateContext).isSelected)\n\t\t\t\t{\n\t\t\t\t\ttextFormat = this._selectedTextFormat;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //no state context\n\t\t\t{\n\t\t\t\t//we can still check if the text renderer is disabled to see if\n\t\t\t\t//we should use disabledTextFormat\n\t\t\t\tif(!this._isEnabled && this._disabledTextFormat !== null)\n\t\t\t\t{\n\t\t\t\t\ttextFormat = this._disabledTextFormat;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(textFormat === null)\n\t\t\t{\n\t\t\t\ttextFormat = this._textFormat;\n\t\t\t}\n\t\t\tif(textFormat === null)\n\t\t\t{\n\t\t\t\ttextFormat = this.getTextFormatFromFontStyles();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//when using BitmapFontTextFormat, vertical align is always top\n\t\t\t\tthis._currentVerticalAlign = Align.TOP;\n\t\t\t\tif(this._currentFontStyles === null)\n\t\t\t\t{\n\t\t\t\t\tthis._currentFontStyles = new TextFormat();\n\t\t\t\t}\n\t\t\t\t//we need the size to determine the default mesh style\n\t\t\t\tthis._currentFontStyles.size = textFormat.size;\n\t\t\t}\n\t\t\tif(this._currentTextFormat !== textFormat)\n\t\t\t{\n\t\t\t\tthis._currentTextFormat = textFormat;\n\t\t\t\tthis._textFormatChanged = true;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getTextFormatFromFontStyles():BitmapFontTextFormat\n\t\t{\n\t\t\tif(this.isInvalid(INVALIDATION_FLAG_STYLES) ||\n\t\t\t\tthis.isInvalid(INVALIDATION_FLAG_STATE))\n\t\t\t{\n\t\t\t\tvar textFormat:TextFormat;\n\t\t\t\tif(this._fontStyles !== null)\n\t\t\t\t{\n\t\t\t\t\ttextFormat = this._fontStyles.getTextFormatForTarget(this);\n\t\t\t\t\tthis._currentFontStyles = textFormat;\n\t\t\t\t}\n\t\t\t\tif(textFormat !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._fontStylesTextFormat = new BitmapFontTextFormat(\n\t\t\t\t\t\ttextFormat.font, textFormat.size, textFormat.color,\n\t\t\t\t\t\ttextFormat.horizontalAlign, textFormat.leading);\n\t\t\t\t\tthis._fontStylesTextFormat.isKerningEnabled = textFormat.kerning;\n\t\t\t\t\tthis._fontStylesTextFormat.letterSpacing = textFormat.letterSpacing;\n\t\t\t\t\tthis._currentVerticalAlign = textFormat.verticalAlign;\n\t\t\t\t}\n\t\t\t\telse if(this._fontStylesTextFormat === null)\n\t\t\t\t{\n\t\t\t\t\t//let's fall back to using Starling's embedded mini font if no\n\t\t\t\t\t//text format has been specified\n\n\t\t\t\t\t//if it's not registered, do that first\n\t\t\t\t\tif(!TextField.getBitmapFont(BitmapFont.MINI))\n\t\t\t\t\t{\n\t\t\t\t\t\tvar font:BitmapFont = new BitmapFont();\n\t\t\t\t\t\tTextField.registerCompositor(font, font.name);\n\t\t\t\t\t}\n\t\t\t\t\tthis._fontStylesTextFormat = new BitmapFontTextFormat(BitmapFont.MINI, NaN, 0x000000);\n\t\t\t\t\tthis._currentVerticalAlign = Align.TOP;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this._fontStylesTextFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function measureTextInternal(result:Point, useExplicit:Boolean):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\n\t\t\tvar needsWidth:Boolean = !useExplicit || this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = !useExplicit || this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight)\n\t\t\t{\n\t\t\t\tresult.x = this._explicitWidth;\n\t\t\t\tresult.y = this._explicitHeight;\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tif(this.isInvalid(INVALIDATION_FLAG_STYLES) || this.isInvalid(INVALIDATION_FLAG_STATE))\n\t\t\t{\n\t\t\t\tthis.refreshTextFormat();\n\t\t\t}\n\n\t\t\tif(!this._currentTextFormat || this._text === null)\n\t\t\t{\n\t\t\t\tresult.setTo(0, 0);\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tvar font:BitmapFont = this._currentTextFormat.font;\n\t\t\tvar customSize:Number = this._currentTextFormat.size;\n\t\t\tvar customLetterSpacing:Number = this._currentTextFormat.letterSpacing;\n\t\t\tvar isKerningEnabled:Boolean = this._currentTextFormat.isKerningEnabled;\n\t\t\tvar scale:Number = customSize / font.size;\n\t\t\tif(scale !== scale) //isNaN\n\t\t\t{\n\t\t\t\tscale = 1;\n\t\t\t}\n\t\t\tvar lineHeight:Number = font.lineHeight * scale + this._currentTextFormat.leading;\n\t\t\tvar maxLineWidth:Number = this._explicitWidth;\n\t\t\tif(maxLineWidth !== maxLineWidth) //isNaN\n\t\t\t{\n\t\t\t\tmaxLineWidth = this._explicitMaxWidth;\n\t\t\t}\n\n\t\t\tvar maxX:Number = 0;\n\t\t\tvar currentX:Number = 0;\n\t\t\tvar currentY:Number = 0;\n\t\t\tvar previousCharID:Number = NaN;\n\t\t\tvar charCount:int = this._text.length;\n\t\t\tvar startXOfPreviousWord:Number = 0;\n\t\t\tvar widthOfWhitespaceAfterWord:Number = 0;\n\t\t\tvar wordCountForLine:int = 0;\n\t\t\tvar line:String = \"\";\n\t\t\tvar word:String = \"\";\n\t\t\tvar charData:BitmapChar = null;\n\t\t\tfor(var i:int = 0; i < charCount; i++)\n\t\t\t{\n\t\t\t\tvar charID:int = this._text.charCodeAt(i);\n\t\t\t\tif(charID == CHARACTER_ID_LINE_FEED || charID == CHARACTER_ID_CARRIAGE_RETURN) //new line \\n or \\r\n\t\t\t\t{\n\t\t\t\t\t//remove whitespace after the final character in the line\n\t\t\t\t\tcurrentX -= customLetterSpacing;\n\t\t\t\t\tif(charData !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tcurrentX -= (charData.xAdvance - charData.width) * scale;\n\t\t\t\t\t}\n\t\t\t\t\tif(currentX < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tcurrentX = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif(maxX < currentX)\n\t\t\t\t\t{\n\t\t\t\t\t\tmaxX = currentX;\n\t\t\t\t\t}\n\t\t\t\t\tpreviousCharID = NaN;\n\t\t\t\t\tcurrentX = 0;\n\t\t\t\t\tcurrentY += lineHeight;\n\t\t\t\t\tstartXOfPreviousWord = 0;\n\t\t\t\t\twordCountForLine = 0;\n\t\t\t\t\twidthOfWhitespaceAfterWord = 0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tcharData = font.getChar(charID);\n\t\t\t\tif(charData === null)\n\t\t\t\t{\n\t\t\t\t\ttrace(\"Missing character \" + String.fromCharCode(charID) + \" in font \" + font.name + \".\");\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif(isKerningEnabled &&\n\t\t\t\t\tpreviousCharID === previousCharID) //!isNaN\n\t\t\t\t{\n\t\t\t\t\tcurrentX += charData.getKerning(previousCharID) * scale;\n\t\t\t\t}\n\n\t\t\t\tvar xAdvance:Number = charData.xAdvance * scale;\n\t\t\t\tif(this._wordWrap)\n\t\t\t\t{\n\t\t\t\t\tvar currentCharIsWhitespace:Boolean = charID == CHARACTER_ID_SPACE || charID == CHARACTER_ID_TAB;\n\t\t\t\t\tvar previousCharIsWhitespace:Boolean = previousCharID == CHARACTER_ID_SPACE || previousCharID == CHARACTER_ID_TAB;\n\t\t\t\t\tif(currentCharIsWhitespace)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(!previousCharIsWhitespace)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//this is the spacing after the last character\n\t\t\t\t\t\t\t//that isn't whitespace\n\t\t\t\t\t\t\tvar previousCharData:BitmapChar = font.getChar(previousCharID);\n\t\t\t\t\t\t\twidthOfWhitespaceAfterWord = customLetterSpacing + (previousCharData.xAdvance - previousCharData.width) * scale;\n\t\t\t\t\t\t}\n\t\t\t\t\t\twidthOfWhitespaceAfterWord += xAdvance;\n\t\t\t\t\t}\n\t\t\t\t\telse if(previousCharIsWhitespace)\n\t\t\t\t\t{\n\t\t\t\t\t\tstartXOfPreviousWord = currentX;\n\t\t\t\t\t\twordCountForLine++;\n\t\t\t\t\t\tline += word;\n\t\t\t\t\t\tword = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tvar charWidth:Number = charData.width * scale;\n\t\t\t\t\tif(!currentCharIsWhitespace && (wordCountForLine > 0 || this._breakLongWords) && (currentX + charWidth) > maxLineWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(wordCountForLine == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if we're breaking long words, this is where we break\n\t\t\t\t\t\t\tstartXOfPreviousWord = currentX;\n\t\t\t\t\t\t\tif(previousCharID === previousCharID) //!isNaN\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tpreviousCharData = font.getChar(previousCharID);\n\t\t\t\t\t\t\t\twidthOfWhitespaceAfterWord = customLetterSpacing + (previousCharData.xAdvance - previousCharData.width) * scale;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//we're just reusing this variable to avoid creating a\n\t\t\t\t\t\t//new one. it'll be reset to 0 in a moment.\n\t\t\t\t\t\twidthOfWhitespaceAfterWord = startXOfPreviousWord - widthOfWhitespaceAfterWord;\n\t\t\t\t\t\tif(maxX < widthOfWhitespaceAfterWord)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmaxX = widthOfWhitespaceAfterWord;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpreviousCharID = NaN;\n\t\t\t\t\t\tcurrentX -= startXOfPreviousWord;\n\t\t\t\t\t\tcurrentY += lineHeight;\n\t\t\t\t\t\tstartXOfPreviousWord = 0;\n\t\t\t\t\t\twidthOfWhitespaceAfterWord = 0;\n\t\t\t\t\t\twordCountForLine = 0;\n\t\t\t\t\t\tline = \"\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcurrentX += xAdvance + customLetterSpacing;\n\t\t\t\tpreviousCharID = charID;\n\t\t\t\tword += String.fromCharCode(charID);\n\t\t\t}\n\t\t\t//remove whitespace after the final character in the final line\n\t\t\tcurrentX -= customLetterSpacing;\n\t\t\tif(charData !== null)\n\t\t\t{\n\t\t\t\tcurrentX -= (charData.xAdvance - charData.width) * scale;\n\t\t\t}\n\t\t\tif(currentX < 0)\n\t\t\t{\n\t\t\t\tcurrentX = 0;\n\t\t\t}\n\t\t\t//if the text ends in extra whitespace, the currentX value will be\n\t\t\t//larger than the max line width. we'll remove that and add extra\n\t\t\t//lines.\n\t\t\tif(this._wordWrap)\n\t\t\t{\n\t\t\t\twhile(currentX > maxLineWidth && !MathUtil.isEquivalent(currentX, maxLineWidth))\n\t\t\t\t{\n\t\t\t\t\tcurrentX -= maxLineWidth;\n\t\t\t\t\tcurrentY += lineHeight;\n\t\t\t\t\tif(maxLineWidth == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//we don't want to get stuck in an infinite loop!\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(maxX < currentX)\n\t\t\t{\n\t\t\t\tmaxX = currentX;\n\t\t\t}\n\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tresult.x = maxX;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult.x = this._explicitWidth;\n\t\t\t}\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tresult.y = currentY + lineHeight - this._currentTextFormat.leading;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult.y = this._explicitHeight;\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getTruncatedText(width:Number):String\n\t\t{\n\t\t\tif(!this._text)\n\t\t\t{\n\t\t\t\t//this shouldn't be called if _text is null, but just in case...\n\t\t\t\treturn \"\";\n\t\t\t}\n\n\t\t\t//if the width is infinity or the string is multiline, don't allow truncation\n\t\t\tif(width == Number.POSITIVE_INFINITY || this._wordWrap || this._text.indexOf(String.fromCharCode(CHARACTER_ID_LINE_FEED)) >= 0 || this._text.indexOf(String.fromCharCode(CHARACTER_ID_CARRIAGE_RETURN)) >= 0)\n\t\t\t{\n\t\t\t\treturn this._text;\n\t\t\t}\n\n\t\t\tvar font:BitmapFont = this._currentTextFormat.font;\n\t\t\tvar customSize:Number = this._currentTextFormat.size;\n\t\t\tvar customLetterSpacing:Number = this._currentTextFormat.letterSpacing;\n\t\t\tvar isKerningEnabled:Boolean = this._currentTextFormat.isKerningEnabled;\n\t\t\tvar scale:Number = customSize / font.size;\n\t\t\tif(scale !== scale) //isNaN\n\t\t\t{\n\t\t\t\tscale = 1;\n\t\t\t}\n\t\t\tvar currentX:Number = 0;\n\t\t\tvar previousCharID:Number = NaN;\n\t\t\tvar charCount:int = this._text.length;\n\t\t\tvar truncationIndex:int = -1;\n\t\t\tfor(var i:int = 0; i < charCount; i++)\n\t\t\t{\n\t\t\t\tvar charID:int = this._text.charCodeAt(i);\n\t\t\t\tvar charData:BitmapChar = font.getChar(charID);\n\t\t\t\tif(charData === null)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tvar currentKerning:Number = 0;\n\t\t\t\tif(isKerningEnabled &&\n\t\t\t\t\tpreviousCharID === previousCharID) //!isNaN\n\t\t\t\t{\n\t\t\t\t\tcurrentKerning = charData.getKerning(previousCharID) * scale;\n\t\t\t\t}\n\t\t\t\tvar charWidth:Number = charData.width * scale;\n\t\t\t\t//add only the width of the character and not the xAdvance\n\t\t\t\t//because the final character doesn't have whitespace after it\n\t\t\t\tcurrentX += currentKerning + charWidth;\n\t\t\t\tif(currentX > width)\n\t\t\t\t{\n\t\t\t\t\t//floating point errors can cause unnecessary truncation,\n\t\t\t\t\t//so we're going to be a little bit fuzzy on the greater\n\t\t\t\t\t//than check. such tiny numbers shouldn't break anything.\n\t\t\t\t\tvar difference:Number = Math.abs(currentX - width);\n\t\t\t\t\tif(difference > FUZZY_MAX_WIDTH_PADDING)\n\t\t\t\t\t{\n\t\t\t\t\t\ttruncationIndex = i;\n\t\t\t\t\t\t//add the extra whitespace back to the end because we'll\n\t\t\t\t\t\t//be appending the truncation text (...)\n\t\t\t\t\t\tcurrentX += (charData.xAdvance * scale) - charWidth;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//add the extra whitespace to the end for the next character\n\t\t\t\tcurrentX += customLetterSpacing + (charData.xAdvance * scale) - charWidth;\n\t\t\t\tpreviousCharID = charID;\n\t\t\t}\n\n\t\t\tif(truncationIndex >= 0)\n\t\t\t{\n\t\t\t\t//first add the width of the truncation text (...)\n\t\t\t\tcharCount = this._truncationText.length;\n\t\t\t\tfor(i = 0; i < charCount; i++)\n\t\t\t\t{\n\t\t\t\t\tcharID = this._truncationText.charCodeAt(i);\n\t\t\t\t\tcharData = font.getChar(charID);\n\t\t\t\t\tif(charData === null)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tcurrentKerning = 0;\n\t\t\t\t\tif(isKerningEnabled &&\n\t\t\t\t\t\tpreviousCharID === previousCharID) //!isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\tcurrentKerning = charData.getKerning(previousCharID) * scale;\n\t\t\t\t\t}\n\t\t\t\t\tcurrentX += currentKerning + charData.xAdvance * scale + customLetterSpacing;\n\t\t\t\t\tpreviousCharID = charID;\n\t\t\t\t}\n\t\t\t\tcurrentX -= customLetterSpacing;\n\t\t\t\tif(charData !== null)\n\t\t\t\t{\n\t\t\t\t\tcurrentX -= (charData.xAdvance - charData.width) * scale;\n\t\t\t\t}\n\n\t\t\t\t//then work our way backwards until we fit into the width\n\t\t\t\tfor(i = truncationIndex; i >= 0; i--)\n\t\t\t\t{\n\t\t\t\t\tcharID = this._text.charCodeAt(i);\n\t\t\t\t\tpreviousCharID = (i > 0) ? this._text.charCodeAt(i - 1) : NaN;\n\t\t\t\t\tcharData = font.getChar(charID);\n\t\t\t\t\tif(charData === null)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tcurrentKerning = 0;\n\t\t\t\t\tif(isKerningEnabled &&\n\t\t\t\t\t\tpreviousCharID === previousCharID) //!isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\tcurrentKerning = charData.getKerning(previousCharID) * scale;\n\t\t\t\t\t}\n\t\t\t\t\tcurrentX -= (currentKerning + charData.xAdvance * scale + customLetterSpacing);\n\t\t\t\t\tif(currentX <= width)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn this._text.substr(0, i) + this._truncationText;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this._truncationText;\n\t\t\t}\n\t\t\treturn this._text;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getVerticalAlignOffsetY():Number\n\t\t{\n\t\t\tvar font:BitmapFont = this._currentTextFormat.font;\n\t\t\tvar customSize:Number = this._currentTextFormat.size;\n\t\t\tvar scale:Number = customSize / font.size;\n\t\t\tif(scale !== scale) //isNaN\n\t\t\t{\n\t\t\t\tscale = 1;\n\t\t\t}\n\t\t\tvar lineHeight:Number = font.lineHeight * scale + this._currentTextFormat.leading;\n\t\t\tvar textHeight:Number = this._numLines * lineHeight;\n\t\t\tif(textHeight > this.actualHeight)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tif(this._currentVerticalAlign === Align.BOTTOM)\n\t\t\t{\n\t\t\t\treturn (this.actualHeight - textHeight);\n\t\t\t}\n\t\t\telse if(this._currentVerticalAlign === Align.CENTER)\n\t\t\t{\n\t\t\t\treturn (this.actualHeight - textHeight) / 2;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\t}\n}\n\nimport starling.text.BitmapChar;\n\nclass CharLocation\n{\n\tpublic function CharLocation()\n\t{\n\n\t}\n\n\tpublic var char:BitmapChar;\n\tpublic var scale:Number;\n\tpublic var x:Number;\n\tpublic var y:Number;\n}\n"
  },
  {
    "path": "source/feathers/controls/text/ITextEditorViewPort.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.text\n{\n\timport feathers.controls.supportClasses.IViewPort;\n\timport feathers.core.ITextEditor;\n\n\t/**\n\t * Handles the editing of multiline text.\n\t *\n\t * @see feathers.controls.TextArea\n\t *\n\t * @productversion Feathers 1.1.0\n\t */\n\tpublic interface ITextEditorViewPort extends ITextEditor, IViewPort\n\t{\n\t\t/**\n\t\t * The padding between the top edge of the viewport and the text.\n\t\t */\n\t\tfunction get paddingTop():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set paddingTop(value:Number):void;\n\n\t\t/**\n\t\t * The padding between the right edge of the viewport and the text.\n\t\t */\n\t\tfunction get paddingRight():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set paddingRight(value:Number):void;\n\n\t\t/**\n\t\t * The padding between the bottom edge of the viewport and the text.\n\t\t */\n\t\tfunction get paddingBottom():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set paddingBottom(value:Number):void;\n\n\t\t/**\n\t\t * The padding between the left edge of the viewport and the text.\n\t\t */\n\t\tfunction get paddingLeft():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set paddingLeft(value:Number):void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/text/MeasureTextResult.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.text\n{\n\t/**\n\t * The result of text measurement.\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class MeasureTextResult\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function MeasureTextResult(width:Number = 0, height:Number = 0,\n\t\t\tisTruncated:Boolean = false)\n\t\t{\n\t\t\tthis.width = width;\n\t\t\tthis.height = height;\n\t\t\tthis.isTruncated = isTruncated;\n\t\t}\n\n\t\t/**\n\t\t * The measured width of the text.\n\t\t */\n\t\tpublic var width:Number;\n\n\t\t/**\n\t\t * The measured height of the text.\n\t\t */\n\t\tpublic var height:Number;\n\n\t\t/**\n\t\t * Indicates if the text needed to be truncated.\n\t\t */\n\t\tpublic var isTruncated:Boolean;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/text/StageTextTextEditor.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.text\n{\n\timport feathers.core.BaseTextEditor;\n\timport feathers.core.FocusManager;\n\timport feathers.core.IFocusDisplayObject;\n\timport feathers.core.IMultilineTextEditor;\n\timport feathers.core.INativeFocusOwner;\n\timport feathers.events.FeathersEventType;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.system.DeviceCapabilities;\n\timport feathers.text.StageTextField;\n\timport feathers.utils.display.nativeToGlobal;\n\timport feathers.utils.geom.matrixToScaleX;\n\timport feathers.utils.geom.matrixToScaleY;\n\n\timport flash.display.BitmapData;\n\timport flash.display.Stage;\n\timport flash.events.Event;\n\timport flash.events.FocusEvent;\n\timport flash.events.KeyboardEvent;\n\timport flash.events.SoftKeyboardEvent;\n\timport flash.geom.Matrix;\n\timport flash.geom.Matrix3D;\n\timport flash.geom.Point;\n\timport flash.geom.Rectangle;\n\timport flash.geom.Vector3D;\n\timport flash.system.Capabilities;\n\timport flash.text.TextField;\n\timport flash.text.TextFieldAutoSize;\n\timport flash.text.TextFormat;\n\timport flash.text.TextFormatAlign;\n\timport flash.text.engine.FontPosture;\n\timport flash.text.engine.FontWeight;\n\timport flash.ui.KeyLocation;\n\timport flash.ui.Keyboard;\n\timport flash.utils.getDefinitionByName;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.display.DisplayObjectContainer;\n\timport starling.display.Image;\n\timport starling.events.Event;\n\timport starling.rendering.Painter;\n\timport starling.text.TextFormat;\n\timport starling.textures.ConcreteTexture;\n\timport starling.textures.Texture;\n\timport starling.utils.Align;\n\timport starling.utils.MatrixUtil;\n\timport starling.utils.Pool;\n\timport starling.utils.SystemUtil;\n\n\t/**\n\t * Dispatched when the text property changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #text\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the user presses the Enter key while the editor has\n\t * focus. This event may not be dispatched on some platforms, depending on\n\t * the value of <code>returnKeyLabel</code>. This issue may even occur when\n\t * using the <em>default value</em> of <code>returnKeyLabel</code>!\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #returnKeyLabel\n\t *\n\t * @eventType feathers.events.FeathersEventType.ENTER\n\t */\n\t[Event(name=\"enter\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the text editor receives focus.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.FOCUS_IN\n\t */\n\t[Event(name=\"focusIn\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the text editor loses focus.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.FOCUS_OUT\n\t */\n\t[Event(name=\"focusOut\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the soft keyboard is about to activate. Not all text\n\t * editors will activate a soft keyboard.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.SOFT_KEYBOARD_ACTIVATING\n\t */\n\t[Event(name=\"softKeyboardActivating\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the soft keyboard is activated. Not all text editors will\n\t * activate a soft keyboard.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.SOFT_KEYBOARD_ACTIVATE\n\t */\n\t[Event(name=\"softKeyboardActivate\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the soft keyboard is deactivated. Not all text editors\n\t * will activate a soft keyboard.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.SOFT_KEYBOARD_DEACTIVATE\n\t */\n\t[Event(name=\"softKeyboardDeactivate\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Text that may be edited at runtime by the user with the\n\t * <code>TextInput</code> component, rendered with the native\n\t * <code>flash.text.StageText</code> class in Adobe AIR and the custom\n\t * <code>feathers.text.StageTextField</code> class in Adobe Flash Player\n\t * (<code>StageTextField</code> simulates <code>StageText</code> using\n\t * <code>flash.text.TextField</code>). When not in focus, the\n\t * <code>StageText</code> (or <code>StageTextField</code>) is drawn to\n\t * <code>BitmapData</code> and uploaded to a texture on the GPU. Textures\n\t * are managed internally by this component, and they will be automatically\n\t * disposed when the component is disposed.\n\t *\n\t * <p>The following example shows how to use\n\t * <code>StageTextTextEditor</code> with a <code>TextInput</code>:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var input:TextInput = new TextInput();\n\t * input.textEditorFactory = function():ITextEditor\n\t * {\n\t *     return new StageTextTextEditor();\n\t * };\n\t * this.addChild( input );</listing>\n\t *\n\t * @see feathers.controls.TextInput\n\t * @see ../../../../help/text-editors.html Introduction to Feathers text editors\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/StageText.html flash.text.StageText\n\t * @see feathers.text.StageTextField\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class StageTextTextEditor extends BaseTextEditor implements IMultilineTextEditor, INativeFocusOwner\n\t{\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>StageTextTextEditor</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * @private\n\t\t * The minimum position of the StageText view port. A runtime will be\n\t\t * thrown if the x or y position is smaller than this value.\n\t\t */\n\t\tprotected static const MIN_VIEW_PORT_POSITION:Number = -8192;\n\n\t\t/**\n\t\t * @private\n\t\t * The maximum position of the StageText view port. A runtime will be\n\t\t * thrown if the x or y position (including width and height) is larger\n\t\t * than this value.\n\t\t */\n\t\tprotected static const MAX_VIEW_PORT_POSITION:Number = 8191;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function StageTextTextEditor()\n\t\t{\n\t\t\tthis._stageTextIsTextField = /^(Windows|Mac OS|Linux) .*/.exec(Capabilities.os) ||\n\t\t\t\t(Capabilities.playerType === \"Desktop\" && Capabilities.isDebugger);\n\t\t\tthis.isQuickHitAreaEnabled = true;\n\t\t\tthis.addEventListener(starling.events.Event.REMOVED_FROM_STAGE, textEditor_removedFromStageHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * The StageText instance. It's typed Object so that a replacement class\n\t\t * can be used in browser-based Flash Player.\n\t\t */\n\t\tprotected var stageText:Object;\n\n\t\t/**\n\t\t * @copy feathers.core.INativeFocusOwner#nativeFocus\n\t\t */\n\t\tpublic function get nativeFocus():Object\n\t\t{\n\t\t\tif(!this._isEditable)\n\t\t\t{\n\t\t\t\t//assignFocus() doesn't work if StageText's editable property\n\t\t\t\t//is false, so we'll just let the FocusManager take care of it\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn this.stageText;\n\t\t}\n\n\t\t/**\n\t\t * An image that displays a snapshot of the native <code>StageText</code>\n\t\t * in the Starling display list when the editor doesn't have focus.\n\t\t */\n\t\tprotected var textSnapshot:Image;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _needsNewTexture:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _needsTextureUpdate:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _ignoreStageTextChanges:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _measureTextField:TextField;\n\n\t\t/**\n\t\t * @private\n\t\t * This flag tells us if StageText is implemented by a TextField under\n\t\t * the hood. We want to eliminate that damn TextField gutter to improve\n\t\t * consistency across platforms.\n\t\t */\n\t\tprotected var _stageTextIsTextField:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _stageTextHasFocus:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isWaitingToSetFocus:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _pendingSelectionBeginIndex:int = -1;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get selectionBeginIndex():int\n\t\t{\n\t\t\tif(this._pendingSelectionBeginIndex >= 0)\n\t\t\t{\n\t\t\t\treturn this._pendingSelectionBeginIndex;\n\t\t\t}\n\t\t\tif(this.stageText)\n\t\t\t{\n\t\t\t\treturn this.stageText.selectionAnchorIndex;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _pendingSelectionEndIndex:int = -1;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get selectionEndIndex():int\n\t\t{\n\t\t\tif(this._pendingSelectionEndIndex >= 0)\n\t\t\t{\n\t\t\t\treturn this._pendingSelectionEndIndex;\n\t\t\t}\n\t\t\tif(this.stageText)\n\t\t\t{\n\t\t\t\treturn this.stageText.selectionActiveIndex;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _stageTextIsComplete:Boolean = false;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get baseline():Number\n\t\t{\n\t\t\tif(!this._measureTextField)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn this._measureTextField.getLineMetrics(0).ascent;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _autoCapitalize:String = \"none\";\n\n\t\t/**\n\t\t * Controls how a device applies auto capitalization to user input. This\n\t\t * property is only a hint to the underlying platform, because not all\n\t\t * devices and operating systems support this functionality.\n\t\t *\n\t\t * <p>In the following example, the auto capitalize behavior is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.autoCapitalize = AutoCapitalize.WORD;</listing>\n\t\t *\n\t\t * @default flash.text.AutoCapitalize.NONE\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/StageText.html#autoCapitalize Full description of flash.text.StageText.autoCapitalize in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get autoCapitalize():String\n\t\t{\n\t\t\treturn this._autoCapitalize;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set autoCapitalize(value:String):void\n\t\t{\n\t\t\tif(this._autoCapitalize == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._autoCapitalize = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _autoCorrect:Boolean = false;\n\n\t\t/**\n\t\t * Indicates whether a device auto-corrects user input for spelling or\n\t\t * punctuation mistakes. This property is only a hint to the underlying\n\t\t * platform, because not all devices and operating systems support this\n\t\t * functionality.\n\t\t *\n\t\t * <p>In the following example, auto correct is enabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.autoCorrect = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/StageText.html#autoCorrect Full description of flash.text.StageText.autoCorrect in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get autoCorrect():Boolean\n\t\t{\n\t\t\treturn this._autoCorrect;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set autoCorrect(value:Boolean):void\n\t\t{\n\t\t\tif(this._autoCorrect == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._autoCorrect = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _color:uint = uint.MAX_VALUE;\n\n\t\t/**\n\t\t * Specifies text color as a number containing three 8-bit RGB\n\t\t * components.\n\t\t *\n\t\t * <p>In the following example, the text color is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.color = 0xff9900;</listing>\n\t\t *\n\t\t * @default 0x000000\n\t\t *\n\t\t * @see #disabledColor\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/StageText.html#color Full description of flash.text.StageText.color in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get color():uint\n\t\t{\n\t\t\treturn this._color;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set color(value:uint):void\n\t\t{\n\t\t\tif(this._color == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._color = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _disabledColor:uint = uint.MAX_VALUE;\n\n\t\t/**\n\t\t * Specifies text color when the component is disabled as a number\n\t\t * containing three 8-bit RGB components.\n\t\t *\n\t\t * <p>In the following example, the text color is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.isEnabled = false;\n\t\t * textEditor.disabledColor = 0xff9900;</listing>\n\t\t *\n\t\t * @default 0x999999\n\t\t *\n\t\t * @see #disabledColor\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/StageText.html#color Full description of flash.text.StageText.color in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get disabledColor():uint\n\t\t{\n\t\t\treturn this._disabledColor;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disabledColor(value:uint):void\n\t\t{\n\t\t\tif(this._disabledColor == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._disabledColor = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _displayAsPassword:Boolean = false;\n\n\t\t/**\n\t\t * <p>This property is managed by the <code>TextInput</code>.</p>\n\t\t *\n\t\t * @copy feathers.controls.TextInput#displayAsPassword\n\t\t *\n\t\t * @see feathers.controls.TextInput#displayAsPassword\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/StageText.html#displayAsPassword Full description of flash.text.StageText.displayAsPassword in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get displayAsPassword():Boolean\n\t\t{\n\t\t\treturn this._displayAsPassword;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set displayAsPassword(value:Boolean):void\n\t\t{\n\t\t\tif(this._displayAsPassword == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._displayAsPassword = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isEditable:Boolean = true;\n\n\t\t/**\n\t\t * <p>This property is managed by the <code>TextInput</code>.</p>\n\t\t *\n\t\t * @copy feathers.controls.TextInput#isEditable\n\t\t *\n\t\t * @see feathers.controls.TextInput#isEditable\n\t\t */\n\t\tpublic function get isEditable():Boolean\n\t\t{\n\t\t\treturn this._isEditable;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isEditable(value:Boolean):void\n\t\t{\n\t\t\tif(this._isEditable == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isEditable = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isSelectable:Boolean = true;\n\n\t\t/**\n\t\t * <p><strong>Warning:</strong> This property is ignored because\n\t\t * <code>flash.text.StageText</code> does not support selectable text\n\t\t * that is not editable.</p>\n\t\t *\n\t\t * @copy feathers.controls.TextInput#isSelectable\n\t\t *\n\t\t * @see feathers.controls.TextInput#isSelectable\n\t\t */\n\t\tpublic function get isSelectable():Boolean\n\t\t{\n\t\t\treturn this._isSelectable;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isSelectable(value:Boolean):void\n\t\t{\n\t\t\tif(this._isSelectable == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isSelectable = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic function get setTouchFocusOnEndedPhase():Boolean\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fontFamily:String = null;\n\n\t\t/**\n\t\t * Indicates the name of the current font family. A value of null\n\t\t * indicates the system default.\n\t\t *\n\t\t * <p>In the following example, the font family is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.fontFamily = \"Source Sans Pro\";</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/StageText.html#fontFamily Full description of flash.text.StageText.fontFamily in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get fontFamily():String\n\t\t{\n\t\t\treturn this._fontFamily;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set fontFamily(value:String):void\n\t\t{\n\t\t\tif(this._fontFamily == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._fontFamily = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fontPosture:String;\n\n\t\t/**\n\t\t * Specifies the font posture, using constants defined in the\n\t\t * <code>flash.text.engine.FontPosture</code> class.\n\t\t *\n\t\t * <p>In the following example, the font posture is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.fontPosture = FontPosture.ITALIC;</listing>\n\t\t *\n\t\t * @default flash.text.engine.FontPosture.NORMAL\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/StageText.html#fontPosture Full description of flash.text.StageText.fontPosture in Adobe's Flash Platform API Reference\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/engine/FontPosture.html flash.text.engine.FontPosture\n\t\t */\n\t\tpublic function get fontPosture():String\n\t\t{\n\t\t\treturn this._fontPosture;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set fontPosture(value:String):void\n\t\t{\n\t\t\tif(this._fontPosture == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._fontPosture = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fontSize:int = 0;\n\n\t\t/**\n\t\t * The size in pixels for the current font family.\n\t\t *\n\t\t * <p>In the following example, the font size is increased to 16 pixels:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.fontSize = 16;</listing>\n\t\t *\n\t\t * @default 12\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/StageText.html#fontSize Full description of flash.text.StageText.fontSize in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get fontSize():int\n\t\t{\n\t\t\treturn this._fontSize;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set fontSize(value:int):void\n\t\t{\n\t\t\tif(this._fontSize == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._fontSize = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fontWeight:String = null;\n\n\t\t/**\n\t\t * Specifies the font weight, using constants defined in the\n\t\t * <code>flash.text.engine.FontWeight</code> class.\n\t\t *\n\t\t * <p>In the following example, the font weight is changed to bold:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.fontWeight = FontWeight.BOLD;</listing>\n\t\t *\n\t\t * @default flash.text.engine.FontWeight.NORMAL\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/StageText.html#fontWeight Full description of flash.text.StageText.fontWeight in Adobe's Flash Platform API Reference\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/engine/FontWeight.html flash.text.engine.FontWeight\n\t\t */\n\t\tpublic function get fontWeight():String\n\t\t{\n\t\t\treturn this._fontWeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set fontWeight(value:String):void\n\t\t{\n\t\t\tif(this._fontWeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._fontWeight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _locale:String = \"en\";\n\n\t\t/**\n\t\t * Indicates the locale of the text. <code>StageText</code> uses the\n\t\t * standard locale identifiers. For example <code>\"en\"</code>,\n\t\t * <code>\"en_US\"</code> and <code>\"en-US\"</code> are all English.\n\t\t *\n\t\t * <p>In the following example, the locale is changed to Russian:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.locale = \"ru\";</listing>\n\t\t *\n\t\t * @default \"en\"\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/StageText.html#locale Full description of flash.text.StageText.locale in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get locale():String\n\t\t{\n\t\t\treturn this._locale;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set locale(value:String):void\n\t\t{\n\t\t\tif(this._locale == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._locale = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maxChars:int = 0;\n\n\t\t/**\n\t\t * <p>This property is managed by the <code>TextInput</code>.</p>\n\t\t *\n\t\t * @copy feathers.controls.TextInput#maxChars\n\t\t *\n\t\t * @see feathers.controls.TextInput#maxChars\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/StageText.html#maxChars Full description of flash.text.StageText.maxChars in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get maxChars():int\n\t\t{\n\t\t\treturn this._maxChars;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maxChars(value:int):void\n\t\t{\n\t\t\tif(this._maxChars == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._maxChars = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _multiline:Boolean = false;\n\n\t\t/**\n\t\t * Indicates whether the StageText object can display more than one line\n\t\t * of text. This property is configurable after the text editor is\n\t\t * created, unlike a regular <code>StageText</code> instance. The text\n\t\t * editor will dispose and recreate its internal <code>StageText</code>\n\t\t * instance if the value of the <code>multiline</code> property is\n\t\t * changed after the <code>StageText</code> is initially created.\n\t\t *\n\t\t * <p>In the following example, multiline is enabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.multiline = true;</listing>\n\t\t *\n\t\t * When setting this property to <code>true</code>, it is recommended\n\t\t * that the text input's <code>verticalAlign</code> property is set to\n\t\t * <code>VerticalAlign.JUSTIFY</code>.\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/StageText.html#multiline Full description of flash.text.StageText.multiline in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get multiline():Boolean\n\t\t{\n\t\t\treturn this._multiline;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set multiline(value:Boolean):void\n\t\t{\n\t\t\tif(this._multiline == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._multiline = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _restrict:String;\n\n\t\t/**\n\t\t * <p>This property is managed by the <code>TextInput</code>.</p>\n\t\t *\n\t\t * @copy feathers.controls.TextInput#restrict\n\t\t *\n\t\t * @see feathers.controls.TextInput#restrict\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/StageText.html#restrict Full description of flash.text.StageText.restrict in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get restrict():String\n\t\t{\n\t\t\treturn this._restrict;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set restrict(value:String):void\n\t\t{\n\t\t\tif(this._restrict == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._restrict = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _returnKeyLabel:String = \"default\";\n\n\t\t/**\n\t\t * Indicates the label on the Return key for devices that feature a soft\n\t\t * keyboard. The available values are constants defined in the\n\t\t * <code>flash.text.ReturnKeyLabel</code> class. This property is only a\n\t\t * hint to the underlying platform, because not all devices and\n\t\t * operating systems support this functionality.\n\t\t *\n\t\t * <p>In the following example, the return key label is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.returnKeyLabel = ReturnKeyLabel.GO;</listing>\n\t\t *\n\t\t * @default flash.text.ReturnKeyLabel.DEFAULT\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/StageText.html#returnKeyLabel Full description of flash.text.StageText.returnKeyLabel in Adobe's Flash Platform API Reference\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/ReturnKeyLabel.html flash.text.ReturnKeyLabel\n\t\t */\n\t\tpublic function get returnKeyLabel():String\n\t\t{\n\t\t\treturn this._returnKeyLabel;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set returnKeyLabel(value:String):void\n\t\t{\n\t\t\tif(this._returnKeyLabel == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._returnKeyLabel = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _softKeyboardType:String = \"default\";\n\n\t\t/**\n\t\t * Controls the appearance of the soft keyboard. Valid values are\n\t\t * defined as constants in the <code>flash.text.SoftKeyboardType</code>\n\t\t * class. This property is only a hint to the underlying platform,\n\t\t * because not all devices and operating systems support this\n\t\t * functionality.\n\t\t *\n\t\t * <p>In the following example, the soft keyboard type is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.softKeyboardType = SoftKeyboardType.NUMBER;</listing>\n\t\t *\n\t\t * @default flash.text.SoftKeyboardType.DEFAULT\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/StageText.html#softKeyboardType Full description of flash.text.StageText.softKeyboardType in Adobe's Flash Platform API Reference\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/SoftKeyboardType.html flash.text.SoftKeyboardType\n\t\t */\n\t\tpublic function get softKeyboardType():String\n\t\t{\n\t\t\treturn this._softKeyboardType;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set softKeyboardType(value:String):void\n\t\t{\n\t\t\tif(this._softKeyboardType == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._softKeyboardType = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textAlign:String;\n\n\t\t/**\n\t\t * Indicates the paragraph alignment. Valid values are defined as\n\t\t * constants in the <code>flash.text.TextFormatAlign</code> class.\n\t\t *\n\t\t * <p>In the following example, the text is centered:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.textAlign = TextFormatAlign.CENTER;</listing>\n\t\t *\n\t\t * @default flash.text.TextFormatAlign.START\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/StageText.html#textAlign Full description of flash.text.StageText.textAlign in Adobe's Flash Platform API Reference\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextFormatAlign.html flash.text.TextFormatAlign\n\t\t */\n\t\tpublic function get textAlign():String\n\t\t{\n\t\t\treturn this._textAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set textAlign(value:String):void\n\t\t{\n\t\t\tif(this._textAlign == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textAlign = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maintainTouchFocus:Boolean = false;\n\n\t\t/**\n\t\t * If enabled, the text editor will remain in focus, even if something\n\t\t * else is touched.\n\t\t *\n\t\t * <p>Note: If the <code>FocusManager</code> is enabled, this property\n\t\t * will be ignored.</p>\n\t\t *\n\t\t * <p>In the following example, touch focus is maintained:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.maintainTouchFocus = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t */\n\t\toverride public function get maintainTouchFocus():Boolean\n\t\t{\n\t\t\treturn this._maintainTouchFocus;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maintainTouchFocus(value:Boolean):void\n\t\t{\n\t\t\tthis._maintainTouchFocus = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastGlobalScaleX:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastGlobalScaleY:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _updateSnapshotOnScaleChange:Boolean = false;\n\n\t\t/**\n\t\t * Refreshes the texture snapshot every time that the text editor is\n\t\t * scaled. Based on the scale in global coordinates, so scaling the\n\t\t * parent will require a new snapshot.\n\t\t *\n\t\t * <p>Warning: setting this property to true may result in reduced\n\t\t * performance because every change of the scale requires uploading a\n\t\t * new texture to the GPU. Use with caution. Consider setting this\n\t\t * property to false temporarily during animations that modify the\n\t\t * scale.</p>\n\t\t *\n\t\t * <p>In the following example, the snapshot will be updated when the\n\t\t * text editor is scaled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.updateSnapshotOnScaleChange = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic function get updateSnapshotOnScaleChange():Boolean\n\t\t{\n\t\t\treturn this._updateSnapshotOnScaleChange;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set updateSnapshotOnScaleChange(value:Boolean):void\n\t\t{\n\t\t\tif(this._updateSnapshotOnScaleChange == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._updateSnapshotOnScaleChange = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * The default value doesn't use the constant because it's available in\n\t\t * AIR only, and not Flash Player.\n\t\t */\n\t\tprotected var _clearButtonMode:String = \"whileEditing\";\n\n\t\t/**\n\t\t * Determines when the clear button is displayed or hidden by the\n\t\t * <code>StageText</code> object.\n\t\t *\n\t\t * <p>In the following example, the clear button is always hidden:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.clearButtonMode = StageTextClearButtonMode.NEVER;</listing>\n\t\t *\n\t\t * <p>Requires <code>-swf-version=34</code> or newer.</p>\n\t\t *\n\t\t * @default flash.text.StageTextClearButtonMode.WHILE_EDITING\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/StageText.html#clearButtonMode Full description of flash.text.StageText.clearButtonMode in Adobe's Flash Platform API Reference\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/StageTextClearButtonMode.html Full description of flash.text.StageTextClearButtonMode in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get clearButtonMode():String\n\t\t{\n\t\t\treturn this._clearButtonMode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set clearButtonMode(value:String):void\n\t\t{\n\t\t\tif(this._clearButtonMode == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._clearButtonMode = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this._measureTextField !== null)\n\t\t\t{\n\t\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\t\tstarling.nativeStage.removeChild(this._measureTextField);\n\t\t\t\tthis._measureTextField = null;\n\t\t\t}\n\n\t\t\tif(this.stageText)\n\t\t\t{\n\t\t\t\tthis.disposeStageText();\n\t\t\t}\n\n\t\t\tif(this.textSnapshot)\n\t\t\t{\n\t\t\t\t//avoid the need to call dispose(). we'll create a new snapshot\n\t\t\t\t//when the renderer is added to stage again.\n\t\t\t\tthis.textSnapshot.texture.dispose();\n\t\t\t\tthis.removeChild(this.textSnapshot, true);\n\t\t\t\tthis.textSnapshot = null;\n\t\t\t}\n\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function render(painter:Painter):void\n\t\t{\n\t\t\tif(this._stageTextHasFocus)\n\t\t\t{\n\t\t\t\tpainter.excludeFromCache(this);\n\t\t\t}\n\t\t\tif(this.textSnapshot !== null && this._updateSnapshotOnScaleChange)\n\t\t\t{\n\t\t\t\tvar matrix:Matrix = Pool.getMatrix();\n\t\t\t\tthis.getTransformationMatrix(this.stage, matrix);\n\t\t\t\tif(matrixToScaleX(matrix) != this._lastGlobalScaleX ||\n\t\t\t\t\tmatrixToScaleY(matrix) != this._lastGlobalScaleY)\n\t\t\t\t{\n\t\t\t\t\t//the snapshot needs to be updated because the scale has\n\t\t\t\t\t//changed since the last snapshot was taken.\n\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\t\tthis.validate();\n\t\t\t\t}\n\t\t\t\tPool.putMatrix(matrix);\n\t\t\t}\n\t\t\tif(this._needsTextureUpdate)\n\t\t\t{\n\t\t\t\tthis._needsTextureUpdate = false;\n\t\t\t\tvar hasText:Boolean = this._text.length > 0;\n\t\t\t\tif(hasText)\n\t\t\t\t{\n\t\t\t\t\tthis.refreshSnapshot();\n\t\t\t\t}\n\t\t\t\tif(this.textSnapshot)\n\t\t\t\t{\n\t\t\t\t\tthis.textSnapshot.visible = !this._stageTextHasFocus;\n\t\t\t\t\tthis.textSnapshot.alpha = hasText ? 1 : 0;\n\t\t\t\t}\n\t\t\t\tif(!this._stageTextHasFocus)\n\t\t\t\t{\n\t\t\t\t\t//hide the StageText after the snapshot is created\n\t\t\t\t\t//native controls don't necessarily render at the same time\n\t\t\t\t\t//as starling, and we don't want to see the text disappear\n\t\t\t\t\t//for a moment\n\t\t\t\t\tthis.stageText.visible = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//we'll skip this if the text field isn't visible to avoid running\n\t\t\t//that code every frame.\n\t\t\tif(this.stageText !== null && this.stageText.visible)\n\t\t\t{\n\t\t\t\tthis.refreshViewPortAndFontSize();\n\t\t\t}\n\n\t\t\tif(this.textSnapshot)\n\t\t\t{\n\t\t\t\tthis.positionSnapshot();\n\t\t\t}\n\n\t\t\tsuper.render(painter);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function setFocus(position:Point = null):void\n\t\t{\n\t\t\t//setting the editable property of a StageText to false seems to be\n\t\t\t//ignored on Android, so this is the workaround\n\t\t\tif(!this._isEditable && SystemUtil.platform === \"AND\")\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!this._isEditable && !this._isSelectable)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this.stage !== null && this.stageText.stage === null)\n\t\t\t{\n\t\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\t\tthis.stageText.stage = starling.nativeStage;\n\t\t\t}\n\t\t\tif(this.stageText && this._stageTextIsComplete)\n\t\t\t{\n\t\t\t\tif(position)\n\t\t\t\t{\n\t\t\t\t\tvar positionX:Number = position.x + 2;\n\t\t\t\t\tvar positionY:Number = position.y + 2;\n\t\t\t\t\tif(positionX < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._pendingSelectionBeginIndex = this._pendingSelectionEndIndex = 0;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._pendingSelectionBeginIndex = this._measureTextField.getCharIndexAtPoint(positionX, positionY);\n\t\t\t\t\t\tif(this._pendingSelectionBeginIndex < 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(this._multiline)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar lineIndex:int = int(positionY / this._measureTextField.getLineMetrics(0).height);\n\t\t\t\t\t\t\t\ttry\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tthis._pendingSelectionBeginIndex = this._measureTextField.getLineOffset(lineIndex) + this._measureTextField.getLineLength(lineIndex);\n\t\t\t\t\t\t\t\t\tif(this._pendingSelectionBeginIndex != this._text.length)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tthis._pendingSelectionBeginIndex--;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcatch(error:Error)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//we may be checking for a line beyond the\n\t\t\t\t\t\t\t\t\t//end that doesn't exist\n\t\t\t\t\t\t\t\t\tthis._pendingSelectionBeginIndex = this._text.length;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis._pendingSelectionBeginIndex = this._measureTextField.getCharIndexAtPoint(positionX, this._measureTextField.getLineMetrics(0).ascent / 2);\n\t\t\t\t\t\t\t\tif(this._pendingSelectionBeginIndex < 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tthis._pendingSelectionBeginIndex = this._text.length;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar bounds:Rectangle = this._measureTextField.getCharBoundaries(this._pendingSelectionBeginIndex);\n\t\t\t\t\t\t\tvar boundsX:Number = bounds.x;\n\t\t\t\t\t\t\tif(bounds && (boundsX + bounds.width - positionX) < (positionX - boundsX))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis._pendingSelectionBeginIndex++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._pendingSelectionEndIndex = this._pendingSelectionBeginIndex;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._pendingSelectionBeginIndex = this._pendingSelectionEndIndex = -1;\n\t\t\t\t}\n\t\t\t\tthis.stageText.visible = true;\n\t\t\t\tif(!this._isEditable)\n\t\t\t\t{\n\t\t\t\t\t//assignFocus() does not work unless the StageText's\n\t\t\t\t\t//editable property is true, but we want the text to be\n\t\t\t\t\t//selectable. as a workaround, we temporarily set editable\n\t\t\t\t\t//to true before calling assignFocus(). once the StageText\n\t\t\t\t\t//has focus, we'll set it back to false.\n\t\t\t\t\tthis.stageText.editable = true;\n\t\t\t\t}\n\t\t\t\tif(!this._stageTextHasFocus)\n\t\t\t\t{\n\t\t\t\t\t//on iOS, calling assignFocus() when the StageText already\n\t\t\t\t\t//has focus seems to make it harder to change the selection\n\t\t\t\t\t//with a touch and hold gesture. the soft keyboard appears\n\t\t\t\t\t//to close and re-open on touch begin more often.\n\t\t\t\t\tthis.stageText.assignFocus();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._isWaitingToSetFocus = true;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function clearFocus():void\n\t\t{\n\t\t\tif(!this._stageTextHasFocus)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\t//setting the focus to Starling.current.nativeStage doesn't work\n\t\t\t//here, so we need to use null. on Android, if we give focus to the\n\t\t\t//nativeStage, focus will be removed from the StageText, but the\n\t\t\t//soft keyboard will incorrectly remain open.\n\t\t\tstarling.nativeStage.focus = null;\n\t\t\tif(!this.isParentChainVisible())\n\t\t\t{\n\t\t\t\t//this normally happens in render(), but if we're not visible,\n\t\t\t\t//we need to hide the StageText manually.\n\t\t\t\tthis.stageText.visible = false;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function selectRange(beginIndex:int, endIndex:int):void\n\t\t{\n\t\t\tif(this._stageTextIsComplete && this.stageText)\n\t\t\t{\n\t\t\t\tthis._pendingSelectionBeginIndex = -1;\n\t\t\t\tthis._pendingSelectionEndIndex = -1;\n\t\t\t\tthis.stageText.selectRange(beginIndex, endIndex);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._pendingSelectionBeginIndex = beginIndex;\n\t\t\t\tthis._pendingSelectionEndIndex = endIndex;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function measureText(result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight)\n\t\t\t{\n\t\t\t\tresult.x = this._explicitWidth;\n\t\t\t\tresult.y = this._explicitHeight;\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\t//if a parent component validates before we're added to the stage,\n\t\t\t//measureText() may be called before initialization, so we need to\n\t\t\t//force it.\n\t\t\tif(!this._isInitialized)\n\t\t\t{\n\t\t\t\tthis.initializeNow();\n\t\t\t}\n\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\n\t\t\tif(stylesInvalid || dataInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshMeasureProperties();\n\t\t\t}\n\n\t\t\tresult = this.measure(result);\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tif(this._measureTextField !== null && this._measureTextField.parent === null)\n\t\t\t{\n\t\t\t\tstarling.nativeStage.addChild(this._measureTextField);\n\t\t\t}\n\t\t\telse if(!this._measureTextField)\n\t\t\t{\n\t\t\t\tthis._measureTextField = new TextField();\n\t\t\t\tthis._measureTextField.visible = false;\n\t\t\t\tthis._measureTextField.mouseEnabled = this._measureTextField.mouseWheelEnabled = false;\n\t\t\t\tthis._measureTextField.autoSize = TextFieldAutoSize.LEFT;\n\t\t\t\tthis._measureTextField.multiline = false;\n\t\t\t\tthis._measureTextField.wordWrap = false;\n\t\t\t\tthis._measureTextField.embedFonts = false;\n\t\t\t\tthis._measureTextField.defaultTextFormat = new flash.text.TextFormat(null, 11, 0x000000, false, false, false);\n\t\t\t\tstarling.nativeStage.addChild(this._measureTextField);\n\t\t\t}\n\n\t\t\tthis.createStageText();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\n\t\t\tthis.commit();\n\n\t\t\tsizeInvalid = this.autoSizeIfNeeded() || sizeInvalid;\n\n\t\t\tthis.layout(sizeInvalid);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function commit():void\n\t\t{\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\n\t\t\tif(stylesInvalid || dataInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshMeasureProperties();\n\t\t\t}\n\n\t\t\tvar oldIgnoreStageTextChanges:Boolean = this._ignoreStageTextChanges;\n\t\t\tthis._ignoreStageTextChanges = true;\n\t\t\tif(stateInvalid || stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshStageTextProperties();\n\t\t\t}\n\n\t\t\tif(dataInvalid)\n\t\t\t{\n\t\t\t\tif(this.stageText.text != this._text)\n\t\t\t\t{\n\t\t\t\t\tif(this._pendingSelectionBeginIndex < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._pendingSelectionBeginIndex = this.stageText.selectionActiveIndex;\n\t\t\t\t\t\tthis._pendingSelectionEndIndex = this.stageText.selectionAnchorIndex;\n\t\t\t\t\t}\n\t\t\t\t\tthis.stageText.text = this._text;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._ignoreStageTextChanges = oldIgnoreStageTextChanges;\n\n\t\t\tif(stylesInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.stageText.editable = this._isEditable && this._isEnabled;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function measure(result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\n\t\t\tthis._measureTextField.autoSize = TextFieldAutoSize.LEFT;\n\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tnewWidth = this._measureTextField.textWidth;\n\t\t\t\tif(newWidth < this._explicitMinWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this._explicitMinWidth;\n\t\t\t\t}\n\t\t\t\telse if(newWidth > this._explicitMaxWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this._explicitMaxWidth;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//the +4 is accounting for the TextField gutter\n\t\t\tthis._measureTextField.width = newWidth + 4;\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tif(this._stageTextIsTextField)\n\t\t\t\t{\n\t\t\t\t\t//we know that the StageText implementation is using\n\t\t\t\t\t//TextField internally, so textHeight will be accurate.\n\t\t\t\t\tnewHeight = this._measureTextField.textHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//since we're measuring with TextField, but rendering with\n\t\t\t\t\t//StageText, we're using height instead of textHeight here to be\n\t\t\t\t\t//sure that the measured size is on the larger side, in case the\n\t\t\t\t\t//rendered size is actually bigger than textHeight\n\t\t\t\t\t//if only StageText had an API for text measurement, we wouldn't\n\t\t\t\t\t//be in this mess...\n\t\t\t\t\tnewHeight = this._measureTextField.height;\n\t\t\t\t}\n\t\t\t\tif(newHeight < this._explicitMinHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this._explicitMinHeight;\n\t\t\t\t}\n\t\t\t\telse if(newHeight > this._explicitMaxHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this._explicitMaxHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._measureTextField.autoSize = TextFieldAutoSize.NONE;\n\n\t\t\t//put the width and height back just in case we measured without\n\t\t\t//a full validation\n\t\t\t//the +4 is accounting for the TextField gutter\n\t\t\tthis._measureTextField.width = this.actualWidth + 4;\n\t\t\tthis._measureTextField.height = this.actualHeight;\n\n\t\t\tresult.x = newWidth;\n\t\t\tresult.y = newHeight;\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layout(sizeInvalid:Boolean):void\n\t\t{\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar skinInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SKIN);\n\n\t\t\tif(sizeInvalid || stylesInvalid || skinInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\t\tthis.refreshViewPortAndFontSize();\n\t\t\t\tthis.refreshMeasureTextFieldDimensions();\n\t\t\t\tvar viewPort:Rectangle = this.stageText.viewPort;\n\t\t\t\tvar textureRoot:ConcreteTexture = this.textSnapshot ? this.textSnapshot.texture.root : null;\n\t\t\t\tthis._needsNewTexture = this._needsNewTexture || !this.textSnapshot ||\n\t\t\t\t\t(textureRoot !== null && (textureRoot.scale != starling.contentScaleFactor ||\n\t\t\t\t\tviewPort.width != textureRoot.nativeWidth || viewPort.height != textureRoot.nativeHeight));\n\t\t\t}\n\n\t\t\tif(!this._stageTextHasFocus && (stateInvalid || stylesInvalid || dataInvalid || sizeInvalid || this._needsNewTexture))\n\t\t\t{\n\t\t\t\tif(!this.isParentChainVisible())\n\t\t\t\t{\n\t\t\t\t\t//issue #1620\n\t\t\t\t\t//our parent has been hidden, so our render() method won't\n\t\t\t\t\t//be called, and we need to hide the StageText.\n\t\t\t\t\tthis.stageText.visible = false;\n\t\t\t\t}\n\t\t\t\t//we're going to update the texture in render() because\n\t\t\t\t//there's a chance that it will be updated more than once per\n\t\t\t\t//frame if we do it here.\n\t\t\t\tthis._needsTextureUpdate = true;\n\t\t\t\tthis.setRequiresRedraw();\n\t\t\t}\n\n\t\t\tthis.doPendingActions();\n\t\t}\n\n\t\t/**\n\t\t * If the component's dimensions have not been set explicitly, it will\n\t\t * measure its content and determine an ideal size for itself. If the\n\t\t * <code>explicitWidth</code> or <code>explicitHeight</code> member\n\t\t * variables are set, those value will be used without additional\n\t\t * measurement. If one is set, but not the other, the dimension with the\n\t\t * explicit value will not be measured, but the other non-explicit\n\t\t * dimension will still need measurement.\n\t\t *\n\t\t * <p>Calls <code>saveMeasurements()</code> to set up the\n\t\t * <code>actualWidth</code> and <code>actualHeight</code> member\n\t\t * variables used for layout.</p>\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t */\n\t\tprotected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvar point:Point = Pool.getPoint();\n\t\t\tthis.measure(point);\n\t\t\tvar result:Boolean = this.saveMeasurements(point.x, point.y, point.x, point.y);\n\t\t\tPool.putPoint(point);\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshMeasureProperties():void\n\t\t{\n\t\t\tthis._measureTextField.displayAsPassword = this._displayAsPassword;\n\t\t\tthis._measureTextField.maxChars = this._maxChars;\n\t\t\tthis._measureTextField.restrict = this._restrict;\n\t\t\tthis._measureTextField.multiline = this._multiline;\n\t\t\tthis._measureTextField.wordWrap = this._multiline;\n\t\t\tvar measureFormat:flash.text.TextFormat = this._measureTextField.defaultTextFormat;\n\t\t\tvar fontStylesFormat:starling.text.TextFormat;\n\t\t\tif(this._fontStyles !== null)\n\t\t\t{\n\t\t\t\tfontStylesFormat = this._fontStyles.getTextFormatForTarget(this);\n\t\t\t}\n\n\t\t\tif(this._fontFamily !== null)\n\t\t\t{\n\t\t\t\tmeasureFormat.font = this._fontFamily;\n\t\t\t}\n\t\t\telse if(fontStylesFormat !== null)\n\t\t\t{\n\t\t\t\tmeasureFormat.font = fontStylesFormat.font;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmeasureFormat.font = null;\n\t\t\t}\n\n\t\t\tif(this._fontSize > 0)\n\t\t\t{\n\t\t\t\tmeasureFormat.size = this._fontSize;\n\t\t\t}\n\t\t\telse if(fontStylesFormat !== null)\n\t\t\t{\n\t\t\t\tmeasureFormat.size = fontStylesFormat.size;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmeasureFormat.size = 12;\n\t\t\t}\n\n\t\t\tif(this._fontWeight !== null)\n\t\t\t{\n\t\t\t\tmeasureFormat.bold = this._fontWeight === FontWeight.BOLD;\n\t\t\t}\n\t\t\telse if(fontStylesFormat !== null)\n\t\t\t{\n\t\t\t\tmeasureFormat.bold = fontStylesFormat.bold;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmeasureFormat.bold = false;\n\t\t\t}\n\n\t\t\tif(this._fontPosture !== null)\n\t\t\t{\n\t\t\t\tmeasureFormat.italic = this._fontPosture === FontPosture.ITALIC;\n\t\t\t}\n\t\t\telse if(fontStylesFormat !== null)\n\t\t\t{\n\t\t\t\tmeasureFormat.italic = fontStylesFormat.italic;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmeasureFormat.italic = false;\n\t\t\t}\n\t\t\t//color and alignment are ignored because they don't affect\n\t\t\t//measurement\n\n\t\t\tthis._measureTextField.defaultTextFormat = measureFormat;\n\t\t\tthis._measureTextField.setTextFormat(measureFormat);\n\t\t\tif(this._text.length == 0)\n\t\t\t{\n\t\t\t\tthis._measureTextField.text = \" \";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._measureTextField.text = this._text;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshStageTextProperties():void\n\t\t{\n\t\t\tif(this.stageText.multiline != this._multiline)\n\t\t\t{\n\t\t\t\tif(this.stageText)\n\t\t\t\t{\n\t\t\t\t\tthis.disposeStageText();\n\t\t\t\t}\n\t\t\t\tthis.createStageText();\n\t\t\t}\n\n\t\t\tvar textFormat:starling.text.TextFormat;\n\t\t\tif(this._fontStyles !== null)\n\t\t\t{\n\t\t\t\ttextFormat = this._fontStyles.getTextFormatForTarget(this);\n\t\t\t}\n\t\t\tthis.stageText.autoCapitalize = this._autoCapitalize;\n\t\t\tthis.stageText.autoCorrect = this._autoCorrect;\n\t\t\tif(this._isEnabled)\n\t\t\t{\n\t\t\t\tif(this._color == uint.MAX_VALUE)\n\t\t\t\t{\n\t\t\t\t\tif(textFormat !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.stageText.color = textFormat.color;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.stageText.color = 0x000000;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.stageText.color = this._color;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //disabled\n\t\t\t{\n\t\t\t\tif(this._disabledColor == uint.MAX_VALUE)\n\t\t\t\t{\n\t\t\t\t\tif(this._color == uint.MAX_VALUE)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(textFormat !== null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.stageText.color = textFormat.color;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.stageText.color = 0x000000;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.stageText.color = this._color;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.stageText.color = this._disabledColor;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.stageText.displayAsPassword = this._displayAsPassword;\n\t\t\tvar fontFamily:String = this._fontFamily;\n\t\t\tif(fontFamily === null && textFormat !== null)\n\t\t\t{\n\t\t\t\tfontFamily = textFormat.font;\n\t\t\t} //default to null\n\t\t\tthis.stageText.fontFamily = fontFamily;\n\t\t\tvar fontPosture:String = this._fontPosture;\n\t\t\tif(fontPosture === null)\n\t\t\t{\n\t\t\t\tif(textFormat !== null && textFormat.italic)\n\t\t\t\t{\n\t\t\t\t\tfontPosture = FontPosture.ITALIC;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tfontPosture = FontPosture.NORMAL;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.stageText.fontPosture = fontPosture;\n\t\t\tvar fontWeight:String = this._fontWeight;\n\t\t\tif(fontWeight === null)\n\t\t\t{\n\t\t\t\tif(textFormat !== null && textFormat.bold)\n\t\t\t\t{\n\t\t\t\t\tfontWeight = FontWeight.BOLD;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tfontWeight = FontWeight.NORMAL;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.stageText.fontWeight = fontWeight;\n\t\t\tthis.stageText.locale = this._locale;\n\t\t\tthis.stageText.maxChars = this._maxChars;\n\t\t\tthis.stageText.restrict = this._restrict;\n\t\t\tthis.stageText.returnKeyLabel = this._returnKeyLabel;\n\t\t\tthis.stageText.softKeyboardType = this._softKeyboardType;\n\t\t\tvar textAlign:String = this._textAlign;\n\t\t\tif(textAlign === null)\n\t\t\t{\n\t\t\t\tif(textFormat !== null && textFormat.horizontalAlign)\n\t\t\t\t{\n\t\t\t\t\ttextAlign = textFormat.horizontalAlign;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttextAlign = TextFormatAlign.START;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.stageText.textAlign = textAlign;\n\t\t\tif(\"clearButtonMode\" in this.stageText)\n\t\t\t{\n\t\t\t\tthis.stageText.clearButtonMode = this._clearButtonMode;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function doPendingActions():void\n\t\t{\n\t\t\tif(this._isWaitingToSetFocus)\n\t\t\t{\n\t\t\t\tthis._isWaitingToSetFocus = false;\n\t\t\t\tthis.setFocus();\n\t\t\t}\n\t\t\tif(this._pendingSelectionBeginIndex >= 0)\n\t\t\t{\n\t\t\t\tvar startIndex:int = this._pendingSelectionBeginIndex;\n\t\t\t\tvar endIndex:int = (this._pendingSelectionEndIndex < 0) ? this._pendingSelectionBeginIndex : this._pendingSelectionEndIndex;\n\t\t\t\tthis._pendingSelectionBeginIndex = -1;\n\t\t\t\tthis._pendingSelectionEndIndex = -1;\n\t\t\t\tif(this.stageText.selectionAnchorIndex != startIndex || this.stageText.selectionActiveIndex != endIndex)\n\t\t\t\t{\n\t\t\t\t\t//if the same range is already selected, don't try to do it\n\t\t\t\t\t//again because on iOS, if the StageText is multiline, this\n\t\t\t\t\t//will cause the clipboard menu to appear when it shouldn't.\n\t\t\t\t\tthis.selectRange(startIndex, endIndex);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function texture_onRestore():void\n\t\t{\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tif(this.textSnapshot.texture.scale != starling.contentScaleFactor)\n\t\t\t{\n\t\t\t\t//if we've changed between scale factors, we need to recreate\n\t\t\t\t//the texture to match the new scale factor.\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.refreshSnapshot();\n\t\t\t\tif(this.textSnapshot)\n\t\t\t\t{\n\t\t\t\t\tthis.textSnapshot.visible = !this._stageTextHasFocus;\n\t\t\t\t\tthis.textSnapshot.alpha = this._text.length > 0 ? 1 : 0;\n\t\t\t\t}\n\t\t\t\tif(!this._stageTextHasFocus)\n\t\t\t\t{\n\t\t\t\t\tthis.stageText.visible = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshSnapshot():void\n\t\t{\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\t//StageText's stage property cannot be null when we call\n\t\t\t//drawViewPortToBitmapData()\n\t\t\tif(this.stage !== null && this.stageText.stage === null)\n\t\t\t{\n\t\t\t\tthis.stageText.stage = starling.nativeStage;\n\t\t\t}\n\t\t\tif(this.stageText.stage === null)\n\t\t\t{\n\t\t\t\t//we need to keep a flag active so that the snapshot will be\n\t\t\t\t//refreshed after the text editor is added to the stage\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar viewPort:Rectangle = this.stageText.viewPort;\n\t\t\tif(viewPort.width == 0 || viewPort.height == 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar nativeScaleFactor:Number = 1;\n\t\t\tif(starling.supportHighResolutions)\n\t\t\t{\n\t\t\t\tnativeScaleFactor = starling.nativeStage.contentsScaleFactor;\n\t\t\t}\n\t\t\t//StageText sucks because it requires that the BitmapData's width\n\t\t\t//and height exactly match its view port width and height.\n\t\t\t//(may be doubled on Retina Mac)\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar bitmapData:BitmapData = new BitmapData(viewPort.width * nativeScaleFactor, viewPort.height * nativeScaleFactor, true, 0x00ff00ff);\n\t\t\t\tthis.stageText.drawViewPortToBitmapData(bitmapData);\n\t\t\t}\n\t\t\tcatch(error:Error)\n\t\t\t{\n\t\t\t\t//drawing stage text to the bitmap data at double size may fail\n\t\t\t\t//on runtime versions less than 15, so fall back to using a\n\t\t\t\t//snapshot that is half size. it's not ideal, but better than\n\t\t\t\t//nothing.\n\t\t\t\tbitmapData.dispose();\n\t\t\t\tbitmapData = new BitmapData(viewPort.width, viewPort.height, true, 0x00ff00ff);\n\t\t\t\tthis.stageText.drawViewPortToBitmapData(bitmapData);\n\t\t\t}\n\n\t\t\tvar newTexture:Texture;\n\t\t\tif(!this.textSnapshot || this._needsNewTexture)\n\t\t\t{\n\t\t\t\tvar scaleFactor:Number = starling.contentScaleFactor;\n\t\t\t\t//skip Texture.fromBitmapData() because we don't want\n\t\t\t\t//it to create an onRestore function that will be\n\t\t\t\t//immediately discarded for garbage collection.\n\t\t\t\tnewTexture = Texture.empty(bitmapData.width / scaleFactor, bitmapData.height / scaleFactor,\n\t\t\t\t\ttrue, false, false, scaleFactor);\n\t\t\t\tnewTexture.root.uploadBitmapData(bitmapData);\n\t\t\t\tnewTexture.root.onRestore = texture_onRestore;\n\t\t\t}\n\t\t\tif(!this.textSnapshot)\n\t\t\t{\n\t\t\t\tthis.textSnapshot = new Image(newTexture);\n\t\t\t\tthis.textSnapshot.pixelSnapping = true;\n\t\t\t\tthis.addChild(this.textSnapshot);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(this._needsNewTexture)\n\t\t\t\t{\n\t\t\t\t\tthis.textSnapshot.texture.dispose();\n\t\t\t\t\tthis.textSnapshot.texture = newTexture;\n\t\t\t\t\tthis.textSnapshot.readjustSize();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//this is faster, if we haven't resized the bitmapdata\n\t\t\t\t\tvar existingTexture:Texture = this.textSnapshot.texture;\n\t\t\t\t\texistingTexture.root.uploadBitmapData(bitmapData);\n\t\t\t\t\t//however, the image won't be notified that its\n\t\t\t\t\t//texture has changed, so we need to do it manually\n\t\t\t\t\tthis.textSnapshot.setRequiresRedraw();\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar matrix:Matrix = Pool.getMatrix();\n\t\t\tthis.getTransformationMatrix(this.stage, matrix);\n\t\t\tvar globalScaleX:Number = matrixToScaleX(matrix);\n\t\t\tvar globalScaleY:Number = matrixToScaleY(matrix);\n\t\t\tPool.putMatrix(matrix);\n\t\t\tif(this._updateSnapshotOnScaleChange)\n\t\t\t{\n\t\t\t\tthis.textSnapshot.scaleX = 1 / globalScaleX;\n\t\t\t\tthis.textSnapshot.scaleY = 1 / globalScaleY;\n\t\t\t\tthis._lastGlobalScaleX = globalScaleX;\n\t\t\t\tthis._lastGlobalScaleY = globalScaleY;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.textSnapshot.scaleX = 1;\n\t\t\t\tthis.textSnapshot.scaleY = 1;\n\t\t\t}\n\t\t\tif(nativeScaleFactor > 1 && bitmapData.width == viewPort.width)\n\t\t\t{\n\t\t\t\t//when we fall back to using a snapshot that is half size on\n\t\t\t\t//older runtimes, we need to scale it up.\n\t\t\t\tthis.textSnapshot.scaleX *= nativeScaleFactor;\n\t\t\t\tthis.textSnapshot.scaleY *= nativeScaleFactor;\n\t\t\t}\n\t\t\tbitmapData.dispose();\n\t\t\tthis._needsNewTexture = false;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshViewPortAndFontSize():void\n\t\t{\n\t\t\tvar matrix:Matrix = Pool.getMatrix();\n\t\t\tvar point:Point = Pool.getPoint();\n\t\t\tvar desktopGutterPositionOffset:Number = 0;\n\t\t\tvar desktopGutterDimensionsOffset:Number = 0;\n\t\t\tif(this._stageTextIsTextField)\n\t\t\t{\n\t\t\t\tdesktopGutterPositionOffset = 2;\n\t\t\t\tdesktopGutterDimensionsOffset = 4;\n\t\t\t}\n\t\t\tthis.getTransformationMatrix(this.stage, matrix);\n\t\t\tif(this._stageTextHasFocus || this._updateSnapshotOnScaleChange)\n\t\t\t{\n\t\t\t\tvar globalScaleX:Number = matrixToScaleX(matrix);\n\t\t\t\tvar globalScaleY:Number = matrixToScaleY(matrix);\n\t\t\t\tvar smallerGlobalScale:Number = globalScaleX;\n\t\t\t\tif(globalScaleY < smallerGlobalScale)\n\t\t\t\t{\n\t\t\t\t\tsmallerGlobalScale = globalScaleY;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tglobalScaleX = 1;\n\t\t\t\tglobalScaleY = 1;\n\t\t\t\tsmallerGlobalScale = 1;\n\t\t\t}\n\t\t\tvar verticalAlignOffsetY:Number = this.getVerticalAlignmentOffsetY();\n\t\t\tif(this.is3D)\n\t\t\t{\n\t\t\t\tvar matrix3D:Matrix3D = Pool.getMatrix3D();\n\t\t\t\tvar point3D:Vector3D = Pool.getPoint3D();\n\t\t\t\tthis.getTransformationMatrix3D(this.stage, matrix3D);\n\t\t\t\tMatrixUtil.transformCoords3D(matrix3D, -desktopGutterPositionOffset, -desktopGutterPositionOffset + verticalAlignOffsetY, 0, point3D);\n\t\t\t\tpoint.setTo(point3D.x, point3D.y);\n\t\t\t\tPool.putPoint3D(point3D);\n\t\t\t\tPool.putMatrix3D(matrix3D);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tMatrixUtil.transformCoords(matrix, -desktopGutterPositionOffset, -desktopGutterPositionOffset + verticalAlignOffsetY, point);\n\t\t\t}\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar nativeScaleFactor:Number = 1;\n\t\t\tif(starling.supportHighResolutions)\n\t\t\t{\n\t\t\t\tnativeScaleFactor = starling.nativeStage.contentsScaleFactor;\n\t\t\t}\n\t\t\tvar scaleFactor:Number = starling.contentScaleFactor / nativeScaleFactor;\n\t\t\tvar starlingViewPort:Rectangle = starling.viewPort;\n\t\t\tvar stageTextViewPort:Rectangle = this.stageText.viewPort;\n\t\t\tif(!stageTextViewPort)\n\t\t\t{\n\t\t\t\tstageTextViewPort = new Rectangle();\n\t\t\t}\n\t\t\tvar viewPortWidth:Number = Math.round((this.actualWidth + desktopGutterDimensionsOffset) * scaleFactor * globalScaleX);\n\t\t\tif(viewPortWidth < 1 ||\n\t\t\t\tviewPortWidth !== viewPortWidth) //isNaN\n\t\t\t{\n\t\t\t\tviewPortWidth = 1;\n\t\t\t}\n\t\t\tvar viewPortHeight:Number = Math.round((this.actualHeight + desktopGutterDimensionsOffset) * scaleFactor * globalScaleY);\n\t\t\tif(viewPortHeight < 1 ||\n\t\t\t\tviewPortHeight !== viewPortHeight) //isNaN\n\t\t\t{\n\t\t\t\tviewPortHeight = 1;\n\t\t\t}\n\t\t\tstageTextViewPort.width = viewPortWidth;\n\t\t\tstageTextViewPort.height = viewPortHeight;\n\t\t\tvar viewPortX:Number = Math.round(starlingViewPort.x + (point.x * scaleFactor));\n\t\t\tif((viewPortX + viewPortWidth) > MAX_VIEW_PORT_POSITION)\n\t\t\t{\n\t\t\t\tviewPortX = MAX_VIEW_PORT_POSITION - viewPortWidth;\n\t\t\t}\n\t\t\t//the previous calculation may have pushed the value below the\n\t\t\t//minimum, so it shouldn't be else if (BowlerHatLLC/feathersui-starling#1779)\n\t\t\tif(viewPortX < MIN_VIEW_PORT_POSITION)\n\t\t\t{\n\t\t\t\tviewPortX = MIN_VIEW_PORT_POSITION;\n\t\t\t}\n\t\t\tvar viewPortY:Number = Math.round(starlingViewPort.y + (point.y * scaleFactor));\n\t\t\tif((viewPortY + viewPortHeight) > MAX_VIEW_PORT_POSITION)\n\t\t\t{\n\t\t\t\tviewPortY = MAX_VIEW_PORT_POSITION - viewPortHeight;\n\t\t\t}\n\t\t\t//the previous calculation may have pushed the value below the\n\t\t\t//minimum, so it shouldn't be else if (BowlerHatLLC/feathersui-starling#1779)\n\t\t\tif(viewPortY < MIN_VIEW_PORT_POSITION)\n\t\t\t{\n\t\t\t\tviewPortY = MIN_VIEW_PORT_POSITION;\n\t\t\t}\n\t\t\tstageTextViewPort.x = viewPortX;\n\t\t\tstageTextViewPort.y = viewPortY;\n\t\t\tthis.stageText.viewPort = stageTextViewPort;\n\n\t\t\tvar fontSize:int = 12;\n\t\t\tif(this._fontSize > 0)\n\t\t\t{\n\t\t\t\tfontSize = this._fontSize;\n\t\t\t}\n\t\t\telse if(this._fontStyles !== null)\n\t\t\t{\n\t\t\t\tvar textFormat:starling.text.TextFormat = this._fontStyles.getTextFormatForTarget(this);\n\t\t\t\tif(textFormat !== null)\n\t\t\t\t{\n\t\t\t\t\tfontSize = textFormat.size;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//StageText's fontSize property is an int, so we need to\n\t\t\t//specifically avoid using Number here.\n\t\t\tvar newFontSize:int = fontSize * scaleFactor * smallerGlobalScale;\n\t\t\tif(this.stageText.fontSize != newFontSize)\n\t\t\t{\n\t\t\t\t//we need to check if this value has changed because on iOS\n\t\t\t\t//if displayAsPassword is set to true, the new character\n\t\t\t\t//will not be shown if the font size changes. instead, it\n\t\t\t\t//immediately changes to a bullet. (Github issue #881)\n\t\t\t\tthis.stageText.fontSize = newFontSize;\n\t\t\t}\n\t\t\tPool.putPoint(point);\n\t\t\tPool.putMatrix(matrix);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshMeasureTextFieldDimensions():void\n\t\t{\n\t\t\t//the +4 is accounting for the TextField gutter\n\t\t\tthis._measureTextField.width = this.actualWidth + 4;\n\t\t\tthis._measureTextField.height = this.actualHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function positionSnapshot():void\n\t\t{\n\t\t\tvar matrix:Matrix = Pool.getMatrix();\n\t\t\tthis.getTransformationMatrix(this.stage, matrix);\n\t\t\tvar desktopGutterPositionOffset:Number = 0;\n\t\t\tif(this._stageTextIsTextField)\n\t\t\t{\n\t\t\t\tdesktopGutterPositionOffset = 2;\n\t\t\t}\n\t\t\tthis.textSnapshot.x = Math.round(matrix.tx) - matrix.tx - desktopGutterPositionOffset;\n\t\t\tthis.textSnapshot.y = Math.round(matrix.ty) - matrix.ty - desktopGutterPositionOffset +\n\t\t\t\tthis.getVerticalAlignmentOffsetY();\n\t\t\tPool.putMatrix(matrix);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function disposeStageText():void\n\t\t{\n\t\t\tif(!this.stageText)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.stageText.removeEventListener(flash.events.Event.CHANGE, stageText_changeHandler);\n\t\t\tthis.stageText.removeEventListener(KeyboardEvent.KEY_DOWN, stageText_keyDownHandler);\n\t\t\tthis.stageText.removeEventListener(KeyboardEvent.KEY_UP, stageText_keyUpHandler);\n\t\t\tthis.stageText.removeEventListener(FocusEvent.FOCUS_IN, stageText_focusInHandler);\n\t\t\tthis.stageText.removeEventListener(FocusEvent.FOCUS_OUT, stageText_focusOutHandler);\n\t\t\tthis.stageText.removeEventListener(flash.events.Event.COMPLETE, stageText_completeHandler);\n\t\t\tthis.stageText.removeEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATE, stageText_softKeyboardActivateHandler);\n\t\t\tthis.stageText.removeEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATING, stageText_softKeyboardActivatingHandler);\n\t\t\tthis.stageText.removeEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_DEACTIVATE, stageText_softKeyboardDeactivateHandler);\n\t\t\tthis.stageText.stage = null;\n\t\t\tthis.stageText.dispose();\n\t\t\tthis.stageText = null;\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the <code>stageText</code> instance.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t */\n\t\tprotected function createStageText():void\n\t\t{\n\t\t\tthis._stageTextIsComplete = false;\n\t\t\tvar StageTextType:Class;\n\t\t\tvar initOptions:Object;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tStageTextType = Class(getDefinitionByName(\"flash.text.StageText\"));\n\t\t\t\tvar StageTextInitOptionsType:Class = Class(getDefinitionByName(\"flash.text.StageTextInitOptions\"));\n\t\t\t\tinitOptions = new StageTextInitOptionsType(this._multiline);\n\t\t\t}\n\t\t\tcatch(error:Error)\n\t\t\t{\n\t\t\t\tStageTextType = StageTextField;\n\t\t\t\tinitOptions = { multiline: this._multiline };\n\t\t\t}\n\t\t\tthis.stageText = new StageTextType(initOptions);\n\t\t\tthis.stageText.visible = false;\n\t\t\tthis.stageText.addEventListener(flash.events.Event.CHANGE, stageText_changeHandler);\n\t\t\tthis.stageText.addEventListener(KeyboardEvent.KEY_DOWN, stageText_keyDownHandler);\n\t\t\tthis.stageText.addEventListener(KeyboardEvent.KEY_UP, stageText_keyUpHandler);\n\t\t\tthis.stageText.addEventListener(FocusEvent.FOCUS_IN, stageText_focusInHandler);\n\t\t\tthis.stageText.addEventListener(FocusEvent.FOCUS_OUT, stageText_focusOutHandler);\n\t\t\tthis.stageText.addEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATE, stageText_softKeyboardActivateHandler);\n\t\t\tthis.stageText.addEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATING, stageText_softKeyboardActivatingHandler);\n\t\t\tthis.stageText.addEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_DEACTIVATE, stageText_softKeyboardDeactivateHandler);\n\t\t\tthis.stageText.addEventListener(flash.events.Event.COMPLETE, stageText_completeHandler);\n\t\t\tthis.stageText.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, stageText_mouseFocusChangeHandler);\n\t\t\tthis.invalidate();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getVerticalAlignment():String\n\t\t{\n\t\t\tvar verticalAlign:String = null;\n\t\t\tif(this._fontStyles !== null)\n\t\t\t{\n\t\t\t\tvar format:starling.text.TextFormat = this._fontStyles.getTextFormatForTarget(this);\n\t\t\t\tif(format !== null)\n\t\t\t\t{\n\t\t\t\t\tverticalAlign = format.verticalAlign;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(verticalAlign === null)\n\t\t\t{\n\t\t\t\tverticalAlign = Align.TOP;\n\t\t\t}\n\t\t\treturn verticalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getVerticalAlignmentOffsetY():Number\n\t\t{\n\t\t\tvar verticalAlign:String = this.getVerticalAlignment();\n\t\t\tif(this._measureTextField.textHeight > this.actualHeight)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tif(verticalAlign === Align.BOTTOM)\n\t\t\t{\n\t\t\t\treturn (this.actualHeight - this._measureTextField.textHeight);\n\t\t\t}\n\t\t\telse if(verticalAlign === Align.CENTER)\n\t\t\t{\n\t\t\t\treturn (this.actualHeight - this._measureTextField.textHeight) / 2;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dispatchKeyFocusChangeEvent(event:KeyboardEvent):void\n\t\t{\n\t\t\tvar focusEvent:FocusEvent = new FocusEvent(FocusEvent.KEY_FOCUS_CHANGE, true, false, null, event.shiftKey, event.keyCode);\n\t\t\tthis.stage.starling.nativeStage.dispatchEvent(focusEvent);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function dispatchKeyboardEventToStage(event:KeyboardEvent):void\n\t\t{\n\t\t\tthis.stage.starling.nativeStage.dispatchEvent(event);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function isParentChainVisible():Boolean\n\t\t{\n\t\t\tvar target:DisplayObject = this;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tif(!target.visible)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\ttarget = target.parent;\n\t\t\t}\n\t\t\twhile(target);\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textEditor_removedFromStageHandler(event:starling.events.Event):void\n\t\t{\n\t\t\t//remove this from the stage, if needed\n\t\t\t//it will be added back next time we receive focus\n\t\t\tthis.stageText.stage = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stageText_changeHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tif(this._ignoreStageTextChanges)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.text = this.stageText.text;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stageText_completeHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tthis.stageText.removeEventListener(flash.events.Event.COMPLETE, stageText_completeHandler);\n\t\t\tthis.invalidate();\n\n\t\t\tthis._stageTextIsComplete = true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stageText_focusInHandler(event:FocusEvent):void\n\t\t{\n\t\t\tthis._stageTextHasFocus = true;\n\t\t\tif(!this._isEditable)\n\t\t\t{\n\t\t\t\t//see the other half of this hack in setFocus()\n\t\t\t\tthis.stageText.editable = false;\n\t\t\t}\n\t\t\tthis.addEventListener(starling.events.Event.ENTER_FRAME, hasFocus_enterFrameHandler);\n\t\t\tif(this.textSnapshot)\n\t\t\t{\n\t\t\t\tthis.textSnapshot.visible = false;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SKIN);\n\t\t\tthis.dispatchEventWith(FeathersEventType.FOCUS_IN);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stageText_focusOutHandler(event:FocusEvent):void\n\t\t{\n\t\t\tthis._stageTextHasFocus = false;\n\t\t\t//since StageText doesn't expose its scroll position, we need to\n\t\t\t//set the selection back to the beginning to scroll there. it's a\n\t\t\t//hack, but so is everything about StageText.\n\t\t\t//in other news, why won't 0,0 work here?\n\t\t\tthis.stageText.selectRange(1, 1);\n\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SKIN);\n\t\t\tthis.dispatchEventWith(FeathersEventType.FOCUS_OUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function hasFocus_enterFrameHandler(event:starling.events.Event):void\n\t\t{\n\t\t\tif(this._stageTextHasFocus)\n\t\t\t{\n\t\t\t\tif(!this.isParentChainVisible())\n\t\t\t\t{\n\t\t\t\t\tthis.stageText.stage.focus = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.removeEventListener(starling.events.Event.ENTER_FRAME, hasFocus_enterFrameHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stageText_mouseFocusChangeHandler(event:FocusEvent):void\n\t\t{\n\t\t\tvar nativeStage:Stage = this.stage.starling.nativeStage;\n\t\t\tvar point:Point = Pool.getPoint(nativeStage.mouseX, nativeStage.mouseY);\n\t\t\tnativeToGlobal(point, this.stage.starling, point);\n\t\t\tvar result:DisplayObject = this.stage.hitTest(point);\n\t\t\twhile(result !== null)\n\t\t\t{\n\t\t\t\tvar focusResult:IFocusDisplayObject = result as IFocusDisplayObject;\n\t\t\t\tif(focusResult !== null)\n\t\t\t\t{\n\t\t\t\t\tvar focusOwner:IFocusDisplayObject = focusResult.focusOwner;\n\t\t\t\t\tif(focusOwner !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(focusOwner is DisplayObjectContainer &&\n\t\t\t\t\t\t\tDisplayObjectContainer(focusOwner).contains(this))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//this mouseFocusChange event won't reach the native\n\t\t\t\t\t\t\t//stage, so the FocusManager can't prevent it\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse if(focusResult.isFocusEnabled)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tresult = result.parent;\n\t\t\t}\n\t\t\tif(!this._maintainTouchFocus)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stageText_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(!this._multiline && (event.keyCode == Keyboard.ENTER || event.keyCode == Keyboard.NEXT))\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.ENTER);\n\t\t\t}\n\t\t\telse if(event.keyCode == Keyboard.BACK)\n\t\t\t{\n\t\t\t\t//even a listener on the stage won't detect the back key press that\n\t\t\t\t//will close the application if the StageText has focus, so we\n\t\t\t\t//always need to prevent it here\n\t\t\t\tevent.preventDefault();\n\t\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\t\tstarling.nativeStage.focus = starling.nativeStage;\n\t\t\t}\n\t\t\tif(FocusManager.isEnabledForStage(this.stage))\n\t\t\t{\n\t\t\t\tif(event.keyCode == Keyboard.TAB)\n\t\t\t\t{\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tthis.dispatchKeyFocusChangeEvent(event);\n\t\t\t\t}\n\t\t\t\tif((event.keyLocation == KeyLocation.D_PAD || DeviceCapabilities.simulateDPad) &&\n\t\t\t\t\t(event.keyCode == Keyboard.ENTER || event.keyCode == Keyboard.UP || event.keyCode == Keyboard.DOWN))\n\t\t\t\t{\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tthis.dispatchKeyboardEventToStage(event);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stageText_keyUpHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(!this._multiline && (event.keyCode == Keyboard.ENTER || event.keyCode == Keyboard.NEXT))\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t\tif(event.keyCode == Keyboard.TAB && FocusManager.isEnabledForStage(this.stage))\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stageText_softKeyboardActivateHandler(event:SoftKeyboardEvent):void\n\t\t{\n\t\t\tthis.dispatchEventWith(FeathersEventType.SOFT_KEYBOARD_ACTIVATE, true);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stageText_softKeyboardActivatingHandler(event:SoftKeyboardEvent):void\n\t\t{\n\t\t\tthis.dispatchEventWith(FeathersEventType.SOFT_KEYBOARD_ACTIVATING, true);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stageText_softKeyboardDeactivateHandler(event:SoftKeyboardEvent):void\n\t\t{\n\t\t\tthis.dispatchEventWith(FeathersEventType.SOFT_KEYBOARD_DEACTIVATE, true);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/text/StageTextTextEditorViewPort.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.text\n{\n\timport feathers.skins.IStyleProvider;\n\n\timport flash.geom.Point;\n\timport flash.geom.Rectangle;\n\timport flash.text.TextFieldAutoSize;\n\n\timport starling.core.Starling;\n\n\t/**\n\t * @private\n\t * A text editor view port for the <code>TextArea</code> component that uses\n\t * <code>flash.text.StageText</code>.\n\t *\n\t * <p><strong>WARNING!</strong> This component isn't recommended for use in\n\t * production apps. It is buggy because <code>StageText</code> has a limited\n\t * API that doesn't expose things like scroll position.</p>\n\t *\n\t * @see feathers.controls.TextArea\n\t *\n\t * @productversion Feathers 2.3.0\n\t */\n\tpublic class StageTextTextEditorViewPort extends StageTextTextEditor implements ITextEditorViewPort\n\t{\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>StageTextTextEditorViewPort</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function StageTextTextEditorViewPort()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.multiline = true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * Quickly sets all padding properties to the same value. The\n\t\t * <code>padding</code> getter always returns the value of\n\t\t * <code>paddingTop</code>, but the other padding values may be\n\t\t * different.\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #paddingTop\n\t\t * @see #paddingRight\n\t\t * @see #paddingBottom\n\t\t * @see #paddingLeft\n\t\t */\n\t\tpublic function get padding():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set padding(value:Number):void\n\t\t{\n\t\t\tthis.paddingTop = value;\n\t\t\tthis.paddingRight = value;\n\t\t\tthis.paddingBottom = value;\n\t\t\tthis.paddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingTop:Number = 0;\n\n\t\t/**\n\t\t * The minimum space, in pixels, between the view port's top edge and\n\t\t * the view port's content.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingTop():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingTop(value:Number):void\n\t\t{\n\t\t\tif(this._paddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingTop = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingRight:Number = 0;\n\n\t\t/**\n\t\t * The minimum space, in pixels, between the view port's right edge and\n\t\t * the view port's content.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingRight():Number\n\t\t{\n\t\t\treturn this._paddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this._paddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingRight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingBottom:Number = 0;\n\n\t\t/**\n\t\t * The minimum space, in pixels, between the view port's bottom edge and\n\t\t * the view port's content.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingBottom():Number\n\t\t{\n\t\t\treturn this._paddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this._paddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingBottom = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingLeft:Number = 0;\n\n\t\t/**\n\t\t * The minimum space, in pixels, between the view port's left edge and\n\t\t * the view port's content.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this._paddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingLeft = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _minVisibleWidth:Number = 0;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get minVisibleWidth():Number\n\t\t{\n\t\t\treturn this._minVisibleWidth;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minVisibleWidth(value:Number):void\n\t\t{\n\t\t\tif(this._minVisibleWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value) //isNaN\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"minVisibleWidth cannot be NaN\");\n\t\t\t}\n\t\t\tthis._minVisibleWidth = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _maxVisibleWidth:Number = Number.POSITIVE_INFINITY;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get maxVisibleWidth():Number\n\t\t{\n\t\t\treturn this._maxVisibleWidth;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maxVisibleWidth(value:Number):void\n\t\t{\n\t\t\tif(this._maxVisibleWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value) //isNaN\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"maxVisibleWidth cannot be NaN\");\n\t\t\t}\n\t\t\tthis._maxVisibleWidth = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _visibleWidth:Number = NaN;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get visibleWidth():Number\n\t\t{\n\t\t\treturn this._visibleWidth;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set visibleWidth(value:Number):void\n\t\t{\n\t\t\tif(this._visibleWidth == value ||\n\t\t\t\t(value !== value && this._visibleWidth !== this._visibleWidth)) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._visibleWidth = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _minVisibleHeight:Number = 0;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get minVisibleHeight():Number\n\t\t{\n\t\t\treturn this._minVisibleHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minVisibleHeight(value:Number):void\n\t\t{\n\t\t\tif(this._minVisibleHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value) //isNaN\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"minVisibleHeight cannot be NaN\");\n\t\t\t}\n\t\t\tthis._minVisibleHeight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _maxVisibleHeight:Number = Number.POSITIVE_INFINITY;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get maxVisibleHeight():Number\n\t\t{\n\t\t\treturn this._maxVisibleHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maxVisibleHeight(value:Number):void\n\t\t{\n\t\t\tif(this._maxVisibleHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value) //isNaN\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"maxVisibleHeight cannot be NaN\");\n\t\t\t}\n\t\t\tthis._maxVisibleHeight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _visibleHeight:Number = NaN;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get visibleHeight():Number\n\t\t{\n\t\t\treturn this._visibleHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set visibleHeight(value:Number):void\n\t\t{\n\t\t\tif(this._visibleHeight == value ||\n\t\t\t\t(value !== value && this._visibleHeight !== this._visibleHeight)) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._visibleHeight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\tpublic function get contentX():Number\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\n\t\tpublic function get contentY():Number\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _scrollStep:int = 1;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get horizontalScrollStep():Number\n\t\t{\n\t\t\treturn this._scrollStep;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get verticalScrollStep():Number\n\t\t{\n\t\t\treturn this._scrollStep;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _horizontalScrollPosition:Number = 0;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get horizontalScrollPosition():Number\n\t\t{\n\t\t\treturn this._horizontalScrollPosition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalScrollPosition(value:Number):void\n\t\t{\n\t\t\t//this value is basically ignored because the text does not scroll\n\t\t\t//horizontally. instead, it wraps.\n\t\t\tthis._horizontalScrollPosition = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _verticalScrollPosition:Number = 0;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get verticalScrollPosition():Number\n\t\t{\n\t\t\treturn this._verticalScrollPosition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalScrollPosition(value:Number):void\n\t\t{\n\t\t\t//this value is basically ignored because the StageText handles\n\t\t\t//scrolling automatically.\n\t\t\tthis._verticalScrollPosition = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get requiresMeasurementOnScroll():Boolean\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function measure(result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\n\t\t\tvar needsWidth:Boolean = this._visibleWidth !== this._visibleWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._visibleHeight !== this._visibleHeight; //isNaN\n\n\t\t\tthis._measureTextField.autoSize = TextFieldAutoSize.LEFT;\n\n\t\t\tvar newWidth:Number = this._visibleWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tnewWidth = this._measureTextField.textWidth + this._paddingLeft + this._paddingRight;\n\t\t\t\tif(newWidth < this._minVisibleWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this._minVisibleWidth;\n\t\t\t\t}\n\t\t\t\telse if(newWidth > this._maxVisibleWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this._maxVisibleWidth;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//the +4 is accounting for the TextField gutter\n\t\t\tthis._measureTextField.width = newWidth + 4;\n\t\t\tvar newHeight:Number = this._visibleHeight;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\t//since we're measuring with TextField, but rendering with\n\t\t\t\t//StageText, we're using height instead of textHeight here to be\n\t\t\t\t//sure that the measured size is on the larger side, in case the\n\t\t\t\t//rendered size is actually bigger than textHeight\n\t\t\t\t//if only StageText had an API for text measurement, we wouldn't\n\t\t\t\t//be in this mess...\n\t\t\t\tnewHeight = this._measureTextField.height + this._paddingTop + this._paddingBottom;\n\t\t\t\tif(newHeight < this._minVisibleHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this._minVisibleHeight;\n\t\t\t\t}\n\t\t\t\telse if(newHeight > this._maxVisibleHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this._maxVisibleHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._measureTextField.autoSize = TextFieldAutoSize.NONE;\n\n\t\t\t//put the width and height back just in case we measured without\n\t\t\t//a full validation\n\t\t\t//the +4 is accounting for the TextField gutter\n\t\t\tthis._measureTextField.width = this.actualWidth + 4;\n\t\t\tthis._measureTextField.height = this.actualHeight;\n\n\t\t\tresult.x = newWidth;\n\t\t\tresult.y = newHeight;\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function refreshViewPortAndFontSize():void\n\t\t{\n\t\t\tsuper.refreshViewPortAndFontSize();\n\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar nativeScaleFactor:Number = 1;\n\t\t\tif(starling.supportHighResolutions)\n\t\t\t{\n\t\t\t\tnativeScaleFactor = starling.nativeStage.contentsScaleFactor;\n\t\t\t}\n\t\t\tvar scaleFactor:Number = starling.contentScaleFactor / nativeScaleFactor;\n\n\t\t\tvar viewPort:Rectangle = this.stageText.viewPort;\n\t\t\tviewPort.x += (this._paddingLeft * scaleFactor);\n\t\t\tviewPort.y += (this._paddingTop * scaleFactor);\n\t\t\tviewPort.width -= ((this._paddingLeft + this._paddingRight) * scaleFactor);\n\t\t\tviewPort.height -= ((this._paddingTop + this._paddingBottom) * scaleFactor);\n\t\t\tthis.stageText.viewPort = viewPort;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function positionSnapshot():void\n\t\t{\n\t\t\tsuper.positionSnapshot();\n\t\t\tthis.textSnapshot.x += this._paddingLeft;\n\t\t\tthis.textSnapshot.y += this._paddingRight;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/text/TextBlockTextEditor.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.text\n{\n\timport feathers.core.FocusManager;\n\timport feathers.core.IIMETextEditor;\n\timport feathers.core.INativeFocusOwner;\n\timport feathers.events.FeathersEventType;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.utils.text.TextEditorIMEClient;\n\timport feathers.utils.text.TextInputNavigation;\n\timport feathers.utils.text.TextInputRestrict;\n\n\timport flash.desktop.Clipboard;\n\timport flash.desktop.ClipboardFormats;\n\timport flash.display.DisplayObjectContainer;\n\timport flash.display.Sprite;\n\timport flash.display.Stage;\n\timport flash.events.Event;\n\timport flash.events.TextEvent;\n\timport flash.geom.Point;\n\timport flash.geom.Rectangle;\n\timport flash.text.TextFormatAlign;\n\timport flash.text.engine.TextElement;\n\timport flash.text.engine.TextLine;\n\timport flash.text.ime.CompositionAttributeRange;\n\timport flash.ui.Keyboard;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.KeyboardEvent;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.rendering.Painter;\n\timport starling.utils.Pool;\n\n\t/**\n\t * Dispatched when the text property changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #text\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the user presses the Enter key while the editor has\n\t * focus.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.ENTER\n\t */\n\t[Event(name=\"enter\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the text editor receives focus.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.FOCUS_IN\n\t */\n\t[Event(name=\"focusIn\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the text editor loses focus.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.FOCUS_OUT\n\t */\n\t[Event(name=\"focusOut\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Text that may be edited at runtime by the user with the\n\t * <code>TextInput</code> component, rendered with a native\n\t * <code>flash.text.engine.TextBlock</code> from\n\t * <a href=\"http://help.adobe.com/en_US/as3/dev/WS9dd7ed846a005b294b857bfa122bd808ea6-8000.html\" target=\"_top\">Flash Text Engine</a>\n\t * (sometimes abbreviated as FTE). Draws the text to <code>BitmapData</code>\n\t * to convert to Starling textures. Textures are managed internally by this\n\t * component, and they will be automatically disposed when the component is\n\t * disposed.\n\t *\n\t * <p><strong>Warning:</strong> This text editor is intended for use in\n\t * desktop applications only, and it does not provide support for software\n\t * keyboards on mobile devices.</p>\n\t *\n\t * <p>The following example shows how to use\n\t * <code>TextBlockTextEditor</code> with a <code>TextInput</code>:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var input:TextInput = new TextInput();\n\t * input.textEditorFactory = function():ITextEditor\n\t * {\n\t *     return new TextBlockTextEditor();\n\t * };\n\t * this.addChild( input );</listing>\n\t *\n\t * @see feathers.controls.TextInput\n\t * @see ../../../../help/text-editors.html Introduction to Feathers text editors\n\t * @see http://help.adobe.com/en_US/as3/dev/WS9dd7ed846a005b294b857bfa122bd808ea6-8000.html Using the Flash Text Engine in ActionScript 3.0 Developer's Guide\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/engine/TextBlock.html flash.text.engine.TextBlock\n\t *\n\t * @productversion Feathers 2.0.0\n\t */\n\tpublic class TextBlockTextEditor extends TextBlockTextRenderer implements IIMETextEditor, INativeFocusOwner\n\t{\n\t\t/**\n\t\t * The text will be positioned to the left edge.\n\t\t *\n\t\t * @see feathers.controls.text.TextBlockTextRenderer#textAlign\n\t\t */\n\t\tpublic static const TEXT_ALIGN_LEFT:String = \"left\";\n\n\t\t/**\n\t\t * The text will be centered horizontally.\n\t\t *\n\t\t * @see feathers.controls.text.TextBlockTextRenderer#textAlign\n\t\t */\n\t\tpublic static const TEXT_ALIGN_CENTER:String = \"center\";\n\n\t\t/**\n\t\t * The text will be positioned to the right edge.\n\t\t *\n\t\t * @see feathers.controls.text.TextBlockTextRenderer#textAlign\n\t\t */\n\t\tpublic static const TEXT_ALIGN_RIGHT:String = \"right\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>TextBlockTextEditor</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function TextBlockTextEditor()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis._text = \"\";\n\t\t\tthis._textElement = new TextElement(this._text);\n\t\t\tthis._content = this._textElement;\n\t\t\tthis.isQuickHitAreaEnabled = true;\n\t\t\tthis.truncateToFit = false;\n\t\t\tthis.addEventListener(TouchEvent.TOUCH, textEditor_touchHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _ignoreNextTextInputEvent:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _imeText:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _imeCursorIndex:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectionSkin:DisplayObject;\n\n\t\t/**\n\t\t * The skin that indicates the currently selected range of text.\n\t\t */\n\t\tpublic function get selectionSkin():DisplayObject\n\t\t{\n\t\t\treturn this._selectionSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectionSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._selectionSkin == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._selectionSkin && this._selectionSkin.parent == this)\n\t\t\t{\n\t\t\t\tthis._selectionSkin.removeFromParent();\n\t\t\t}\n\t\t\tthis._selectionSkin = value;\n\t\t\tif(this._selectionSkin)\n\t\t\t{\n\t\t\t\tthis._selectionSkin.visible = false;\n\t\t\t\tthis.addChildAt(this._selectionSkin, 0);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _cursorDelay:Number = 0.53;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _cursorDelayID:uint = uint.MAX_VALUE;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _cursorSkin:DisplayObject;\n\n\t\t/**\n\t\t * The skin that indicates the current position where text may be\n\t\t * entered.\n\t\t */\n\t\tpublic function get cursorSkin():DisplayObject\n\t\t{\n\t\t\treturn this._cursorSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set cursorSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._cursorSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._cursorSkin !== null && this._cursorSkin.parent === this)\n\t\t\t{\n\t\t\t\tthis._cursorSkin.removeFromParent();\n\t\t\t}\n\t\t\tthis._cursorSkin = value;\n\t\t\tif(this._cursorSkin !== null)\n\t\t\t{\n\t\t\t\tthis._cursorSkin.visible = false;\n\t\t\t\tthis.addChild(this._cursorSkin);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _unmaskedText:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _displayAsPassword:Boolean = false;\n\n\t\t/**\n\t\t * <p>This property is managed by the <code>TextInput</code>.</p>\n\t\t *\n\t\t * @copy feathers.controls.TextInput#displayAsPassword\n\t\t *\n\t\t * @see feathers.controls.TextInput#displayAsPassword\n\t\t *\n\t\t * @see #passwordCharCode\n\t\t */\n\t\tpublic function get displayAsPassword():Boolean\n\t\t{\n\t\t\treturn this._displayAsPassword;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set displayAsPassword(value:Boolean):void\n\t\t{\n\t\t\tif(this._displayAsPassword == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._displayAsPassword = value;\n\t\t\tif(this._displayAsPassword)\n\t\t\t{\n\t\t\t\tthis._unmaskedText = this._text;\n\t\t\t\tthis.refreshMaskedText();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._text = this._unmaskedText;\n\t\t\t\tthis._unmaskedText = null;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _passwordCharCode:int = 42; //asterisk\n\n\t\t/**\n\t\t * The character code of the character used to display a password.\n\t\t *\n\t\t * <p>In the following example, the substitute character for passwords\n\t\t * is set to a bullet:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.displayAsPassword = true;\n\t\t * textEditor.passwordCharCode = \"•\".charCodeAt(0);</listing>\n\t\t *\n\t\t * @default 42 (asterisk)\n\t\t *\n\t\t * @see #displayAsPassword\n\t\t */\n\t\tpublic function get passwordCharCode():int\n\t\t{\n\t\t\treturn this._passwordCharCode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set passwordCharCode(value:int):void\n\t\t{\n\t\t\tif(this._passwordCharCode == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._passwordCharCode = value;\n\t\t\tif(this._displayAsPassword)\n\t\t\t{\n\t\t\t\tthis.refreshMaskedText();\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isEditable:Boolean = true;\n\n\t\t/**\n\t\t * <p>This property is managed by the <code>TextInput</code>.</p>\n\t\t *\n\t\t * @copy feathers.controls.TextInput#isEditable\n\t\t *\n\t\t * @see feathers.controls.TextInput#isEditable\n\t\t */\n\t\tpublic function get isEditable():Boolean\n\t\t{\n\t\t\treturn this._isEditable;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isEditable(value:Boolean):void\n\t\t{\n\t\t\tif(this._isEditable == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isEditable = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isSelectable:Boolean = true;\n\n\t\t/**\n\t\t * <p>This property is managed by the <code>TextInput</code>.</p>\n\t\t *\n\t\t * @copy feathers.controls.TextInput#isSelectable\n\t\t *\n\t\t * @see feathers.controls.TextInput#isSelectable\n\t\t */\n\t\tpublic function get isSelectable():Boolean\n\t\t{\n\t\t\treturn this._isSelectable;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isSelectable(value:Boolean):void\n\t\t{\n\t\t\tif(this._isSelectable == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isSelectable = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic function get setTouchFocusOnEndedPhase():Boolean\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function get text():String\n\t\t{\n\t\t\tif(this._displayAsPassword)\n\t\t\t{\n\t\t\t\treturn this._unmaskedText;\n\t\t\t}\n\t\t\treturn this._text;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set text(value:String):void\n\t\t{\n\t\t\tif(value === null)\n\t\t\t{\n\t\t\t\t//don't allow null or undefined\n\t\t\t\tvalue = \"\";\n\t\t\t}\n\t\t\tvar currentValue:String = this._text;\n\t\t\tif(this._displayAsPassword)\n\t\t\t{\n\t\t\t\tcurrentValue = this._unmaskedText;\n\t\t\t}\n\t\t\tif(currentValue == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._displayAsPassword)\n\t\t\t{\n\t\t\t\tthis._unmaskedText = value;\n\t\t\t\tthis.refreshMaskedText();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tsuper.text = value;\n\t\t\t}\n\t\t\tvar textLength:int = this._text.length;\n\t\t\t//we need to account for the possibility that the text is in the\n\t\t\t//middle of being selected when it changes\n\t\t\tif(this._selectionAnchorIndex > textLength)\n\t\t\t{\n\t\t\t\tthis._selectionAnchorIndex = textLength;\n\t\t\t}\n\t\t\t//then, we need to make sure the selected range is still valid\n\t\t\tif(this._selectionBeginIndex > textLength)\n\t\t\t{\n\t\t\t\tthis.selectRange(textLength, textLength);\n\t\t\t}\n\t\t\telse if(this._selectionEndIndex > textLength)\n\t\t\t{\n\t\t\t\tthis.selectRange(this._selectionBeginIndex, textLength);\n\t\t\t}\n\t\t\tthis.dispatchEventWith(starling.events.Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maxChars:int = 0;\n\n\t\t/**\n\t\t * <p>This property is managed by the <code>TextInput</code>.</p>\n\t\t *\n\t\t * @copy feathers.controls.TextInput#maxChars\n\t\t *\n\t\t * @see feathers.controls.TextInput#maxChars\n\t\t */\n\t\tpublic function get maxChars():int\n\t\t{\n\t\t\treturn this._maxChars;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maxChars(value:int):void\n\t\t{\n\t\t\tif(this._maxChars == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._maxChars = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _restrict:TextInputRestrict;\n\n\t\t/**\n\t\t * <p>This property is managed by the <code>TextInput</code>.</p>\n\t\t *\n\t\t * @copy feathers.controls.TextInput#restrict\n\t\t *\n\t\t * @see feathers.controls.TextInput#restrict\n\t\t */\n\t\tpublic function get restrict():String\n\t\t{\n\t\t\tif(!this._restrict)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn this._restrict.restrict;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set restrict(value:String):void\n\t\t{\n\t\t\tif(this._restrict && this._restrict.restrict === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!this._restrict && value === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value === null)\n\t\t\t{\n\t\t\t\tthis._restrict = null;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(this._restrict)\n\t\t\t\t{\n\t\t\t\t\tthis._restrict.restrict = value;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\n\t\t\t\t\tthis._restrict = new TextInputRestrict(value);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectionBeginIndex:int = 0;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @see #selectionEndIndex\n\t\t */\n\t\tpublic function get selectionBeginIndex():int\n\t\t{\n\t\t\treturn this._selectionBeginIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectionEndIndex:int = 0;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @see #selectionBeginIndex\n\t\t */\n\t\tpublic function get selectionEndIndex():int\n\t\t{\n\t\t\treturn this._selectionEndIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectionAnchorIndex:int = 0;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @see #selectionActiveIndex\n\t\t */\n\t\tpublic function get selectionAnchorIndex():int\n\t\t{\n\t\t\treturn this._selectionAnchorIndex;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @see #selectionAnchorIndex\n\t\t */\n\t\tpublic function get selectionActiveIndex():int\n\t\t{\n\t\t\tif(this._selectionAnchorIndex == this._selectionBeginIndex)\n\t\t\t{\n\t\t\t\treturn this._selectionEndIndex;\n\t\t\t}\n\t\t\treturn this._selectionBeginIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var touchPointID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _nativeFocus:Sprite;\n\n\t\t/**\n\t\t * @copy feathers.core.INativeFocusOwner#nativeFocus\n\t\t */\n\t\tpublic function get nativeFocus():Object\n\t\t{\n\t\t\treturn this._nativeFocus;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isWaitingToSetFocus:Boolean = false;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function setFocus(position:Point = null):void\n\t\t{\n\t\t\tif(this._hasFocus && !position)\n\t\t\t{\n\t\t\t\t//we already have focus, and there isn't a touch position, we\n\t\t\t\t//can ignore this because nothing would change\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._nativeFocus !== null)\n\t\t\t{\n\t\t\t\tif(this._nativeFocus.parent === null)\n\t\t\t\t{\n\t\t\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\t\t\tstarling.nativeStage.addChild(this._nativeFocus);\n\t\t\t\t}\n\t\t\t\tvar newIndex:int = -1;\n\t\t\t\tif(position !== null)\n\t\t\t\t{\n\t\t\t\t\tnewIndex = this.getSelectionIndexAtPoint(position.x, position.y);\n\t\t\t\t}\n\t\t\t\tif(newIndex >= 0)\n\t\t\t\t{\n\t\t\t\t\tthis.selectRange(newIndex, newIndex);\n\t\t\t\t}\n\t\t\t\tthis.focusIn();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._isWaitingToSetFocus = true;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function clearFocus():void\n\t\t{\n\t\t\tif(!this._hasFocus)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._hasFocus = false;\n\t\t\tthis._cursorSkin.visible = false;\n\t\t\tthis._selectionSkin.visible = false;\n\t\t\tthis.refreshCursorBlink();\n\t\t\tthis.stage.removeEventListener(TouchEvent.TOUCH, stage_touchHandler);\n\t\t\tthis.stage.removeEventListener(KeyboardEvent.KEY_DOWN, stage_keyDownHandler);\n\t\t\tthis.removeEventListener(starling.events.Event.ENTER_FRAME, hasFocus_enterFrameHandler);\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar nativeStage:Stage = starling.nativeStage;\n\t\t\tif(nativeStage.focus === this._nativeFocus)\n\t\t\t{\n\t\t\t\t//only clear the native focus when our native target has focus\n\t\t\t\t//because otherwise another component may lose focus.\n\n\t\t\t\t//for consistency with StageTextTextEditor and\n\t\t\t\t//TextFieldTextEditor, we set the native stage's focus to null\n\t\t\t\t//here instead of setting it to the native stage due to issues\n\t\t\t\t//with those text editors on Android.\n\t\t\t\tnativeStage.focus = null;\n\t\t\t}\n\t\t\tthis.dispatchEventWith(FeathersEventType.FOCUS_OUT);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function selectRange(beginIndex:int, endIndex:int):void\n\t\t{\n\t\t\tif(!this._isEditable && !this._isSelectable)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(endIndex < beginIndex)\n\t\t\t{\n\t\t\t\tvar temp:int = endIndex;\n\t\t\t\tendIndex = beginIndex;\n\t\t\t\tbeginIndex = temp;\n\t\t\t}\n\t\t\tthis._selectionBeginIndex = beginIndex;\n\t\t\tthis._selectionEndIndex = endIndex;\n\t\t\tif(beginIndex == endIndex)\n\t\t\t{\n\t\t\t\tthis._selectionAnchorIndex = beginIndex;\n\t\t\t\tif(beginIndex < 0)\n\t\t\t\t{\n\t\t\t\t\tthis._cursorSkin.visible = false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//cursor skin is not shown if isSelectable === true and\n\t\t\t\t\t//isEditable is false\n\t\t\t\t\tthis._cursorSkin.visible = this._hasFocus && this._isEditable;\n\t\t\t\t}\n\t\t\t\tthis._selectionSkin.visible = false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._cursorSkin.visible = false;\n\t\t\t\tthis._selectionSkin.visible = true;\n\t\t\t}\n\t\t\tthis.refreshCursorBlink();\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this._nativeFocus && this._nativeFocus.parent)\n\t\t\t{\n\t\t\t\tthis._nativeFocus.parent.removeChild(this._nativeFocus);\n\t\t\t}\n\t\t\tthis._nativeFocus = null;\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function render(painter:Painter):void\n\t\t{\n\t\t\tvar oldSnapshotX:Number = this._textSnapshotOffsetX;\n\t\t\tvar oldCursorX:Number = this._cursorSkin.x;\n\t\t\tthis._cursorSkin.x -= this._textSnapshotScrollX;\n\t\t\tsuper.render(painter);\n\t\t\tthis._textSnapshotOffsetX = oldSnapshotX;\n\t\t\tthis._cursorSkin.x = oldCursorX;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tif(!this._nativeFocus)\n\t\t\t{\n\t\t\t\tthis._nativeFocus = new TextEditorIMEClient(this, imeClientStartCallback, imeClientUpdateCallback, imeClientConfirmCallback);\n\t\t\t\t//let's ensure that this can only get focus through code\n\t\t\t\tthis._nativeFocus.tabEnabled = false;\n\t\t\t\tthis._nativeFocus.tabChildren = false;\n\t\t\t\tthis._nativeFocus.mouseEnabled = false;\n\t\t\t\tthis._nativeFocus.mouseChildren = false;\n\t\t\t\t//adds support for mobile\n\t\t\t\tthis._nativeFocus.needsSoftKeyboard = true;\n\t\t\t}\n\t\t\tthis._nativeFocus.addEventListener(flash.events.Event.CUT, nativeFocus_cutHandler, false, 0, true);\n\t\t\tthis._nativeFocus.addEventListener(flash.events.Event.COPY, nativeFocus_copyHandler, false, 0, true);\n\t\t\tthis._nativeFocus.addEventListener(flash.events.Event.PASTE, nativeFocus_pasteHandler, false, 0, true);\n\t\t\tthis._nativeFocus.addEventListener(flash.events.Event.SELECT_ALL, nativeFocus_selectAllHandler, false, 0, true);\n\t\t\tthis._nativeFocus.addEventListener(TextEvent.TEXT_INPUT, nativeFocus_textInputHandler, false, 0, true);\n\t\t\tif(this._cursorSkin === null)\n\t\t\t{\n\t\t\t\tthis.ignoreNextStyleRestriction();\n\t\t\t\tthis.cursorSkin = new Quad(1, 1, 0x000000);\n\t\t\t}\n\t\t\tif(this._selectionSkin === null)\n\t\t\t{\n\t\t\t\tthis.ignoreNextStyleRestriction();\n\t\t\t\tthis.selectionSkin = new Quad(1, 1, 0x000000);\n\t\t\t}\n\t\t\tsuper.initialize();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar selectionInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SELECTED);\n\t\t\tsuper.draw();\n\t\t\tif(dataInvalid || selectionInvalid)\n\t\t\t{\n\t\t\t\tthis.positionCursorAtCharIndex(this.getCursorIndexFromSelectionRange());\n\t\t\t\tthis.positionSelectionBackground();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function refreshTextElementText():void\n\t\t{\n\t\t\tif(this._textElement === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar displayText:String = this._text;\n\t\t\tif(this._imeText !== null)\n\t\t\t{\n\t\t\t\tdisplayText = this._imeText;\n\t\t\t}\n\t\t\tif(displayText)\n\t\t\t{\n\t\t\t\tthis._textElement.text = displayText;\n\t\t\t\tif(displayText !== null && displayText.charAt(displayText.length - 1) == \" \")\n\t\t\t\t{\n\t\t\t\t\t//add an invisible control character because FTE apparently\n\t\t\t\t\t//doesn't think that it's important to include trailing\n\t\t\t\t\t//spaces in its width measurement.\n\t\t\t\t\tthis._textElement.text += String.fromCharCode(3);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//similar to above. this hack ensures that the baseline is\n\t\t\t\t//measured properly when the text is an empty string.\n\t\t\t\tthis._textElement.text = String.fromCharCode(3);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function refreshTextLines(textLines:Vector.<TextLine>,\n\t\t\ttextLineParent:DisplayObjectContainer, width:Number, height:Number,\n\t\t\tresult:MeasureTextResult = null):MeasureTextResult\n\t\t{\n\t\t\tresult = super.refreshTextLines(textLines, textLineParent, width, height, result);\n\t\t\tif(textLines !== this._measurementTextLines &&\n\t\t\t\ttextLineParent.width > width)\n\t\t\t{\n\t\t\t\tthis.alignTextLines(textLines, width, TextFormatAlign.LEFT);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshMaskedText():void\n\t\t{\n\t\t\tvar newText:String = \"\";\n\t\t\tvar textLength:int = this._unmaskedText.length;\n\t\t\tvar maskChar:String = String.fromCharCode(this._passwordCharCode);\n\t\t\tfor(var i:int = 0; i < textLength; i++)\n\t\t\t{\n\t\t\t\tnewText += maskChar;\n\t\t\t}\n\t\t\tsuper.text = newText;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function focusIn():void\n\t\t{\n\t\t\tvar showSelection:Boolean = (this._isEditable || this._isSelectable) &&\n\t\t\t\tthis._selectionBeginIndex >= 0 &&\n\t\t\t\tthis._selectionBeginIndex != this._selectionEndIndex;\n\t\t\tvar showCursor:Boolean = this._isEditable &&\n\t\t\t\tthis._selectionBeginIndex >= 0 &&\n\t\t\t\tthis._selectionBeginIndex == this._selectionEndIndex;\n\t\t\tthis._cursorSkin.visible = showCursor;\n\t\t\tthis._selectionSkin.visible = showSelection;\n\t\t\tthis.refreshCursorBlink();\n\t\t\tif(!FocusManager.isEnabledForStage(this.stage))\n\t\t\t{\n\t\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\t\t//if there isn't a focus manager, we need to set focus manually\n\t\t\t\tstarling.nativeStage.focus = this._nativeFocus;\n\t\t\t}\n\t\t\tif(this._isEditable)\n\t\t\t{\n\t\t\t\tthis._nativeFocus.requestSoftKeyboard();\n\t\t\t}\n\t\t\tif(this._hasFocus)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//we're reusing this variable. since this isn't a display object\n\t\t\t//that the focus manager can see, it's not being used anyway.\n\t\t\tthis._hasFocus = true;\n\t\t\tthis.stage.addEventListener(TouchEvent.TOUCH, stage_touchHandler);\n\t\t\tthis.stage.addEventListener(KeyboardEvent.KEY_DOWN, stage_keyDownHandler);\n\t\t\tthis.addEventListener(starling.events.Event.ENTER_FRAME, hasFocus_enterFrameHandler);\n\t\t\tthis.dispatchEventWith(FeathersEventType.FOCUS_IN);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshCursorBlink():void\n\t\t{\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tif(this._cursorDelayID == uint.MAX_VALUE && this._cursorSkin.visible)\n\t\t\t{\n\t\t\t\tthis._cursorSkin.alpha = 1;\n\t\t\t\tthis._cursorDelayID = starling.juggler.delayCall(toggleCursorSkin, this._cursorDelay);\n\t\t\t}\n\t\t\telse if(this._cursorDelayID != uint.MAX_VALUE && !this._cursorSkin.visible)\n\t\t\t{\n\t\t\t\tstarling.juggler.removeByID(this._cursorDelayID);\n\t\t\t\tthis._cursorDelayID = uint.MAX_VALUE;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function toggleCursorSkin():void\n\t\t{\n\t\t\tif(this._cursorSkin.alpha > 0)\n\t\t\t{\n\t\t\t\tthis._cursorSkin.alpha = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._cursorSkin.alpha = 1;\n\t\t\t}\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tthis._cursorDelayID = starling.juggler.delayCall(toggleCursorSkin, this._cursorDelay);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getSelectionIndexAtPoint(pointX:Number, pointY:Number):int\n\t\t{\n\t\t\tif(!this._text || this._textLines.length == 0)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tvar line:TextLine = this._textLines[0];\n\t\t\tif((pointX - line.x) <= 0)\n\t\t\t{\n\t\t\t\tif(this._bidiLevel == 1)\n\t\t\t\t{\n\t\t\t\t\treturn this._text.length;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\telse if((pointX - line.x) >= line.width)\n\t\t\t{\n\t\t\t\tif(this._bidiLevel == 1)\n\t\t\t\t{\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\treturn this._text.length;\n\t\t\t}\n\t\t\tvar atomIndex:int = line.getAtomIndexAtPoint(pointX, pointY);\n\t\t\tif(atomIndex < 0)\n\t\t\t{\n\t\t\t\t//try again with the middle of the line\n\t\t\t\tatomIndex = line.getAtomIndexAtPoint(pointX, line.ascent / 2);\n\t\t\t}\n\t\t\tif(atomIndex < 0)\n\t\t\t{\n\t\t\t\t//worse case: we couldn't figure it out at all\n\t\t\t\treturn this._text.length;\n\t\t\t}\n\t\t\t//we're constraining the atom index to the text length because we\n\t\t\t//may have added an invisible control character at the end due to\n\t\t\t//the fact that FTE won't include trailing spaces in measurement\n\t\t\tif(atomIndex > this._text.length)\n\t\t\t{\n\t\t\t\tatomIndex = this._text.length;\n\t\t\t}\n\t\t\tvar atomBounds:Rectangle = line.getAtomBounds(atomIndex);\n\t\t\tif((pointX - line.x - atomBounds.x) > atomBounds.width / 2)\n\t\t\t{\n\t\t\t\treturn atomIndex + 1;\n\t\t\t}\n\t\t\treturn atomIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getXPositionOfCharIndex(index:int):Number\n\t\t{\n\t\t\tvar displayText:String = this._text;\n\t\t\tif(this._imeText !== null)\n\t\t\t{\n\t\t\t\tdisplayText = this._imeText;\n\t\t\t}\n\t\t\tif(!displayText || this._textLines.length == 0)\n\t\t\t{\n\t\t\t\tif(this._currentHorizontalAlign == TextFormatAlign.CENTER)\n\t\t\t\t{\n\t\t\t\t\treturn Math.round(this.actualWidth / 2);\n\t\t\t\t}\n\t\t\t\telse if(this._currentHorizontalAlign == TextFormatAlign.RIGHT)\n\t\t\t\t{\n\t\t\t\t\treturn this.actualWidth;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tvar line:TextLine = this._textLines[0];\n\t\t\tif(index === displayText.length)\n\t\t\t{\n\t\t\t\tif(this._bidiLevel == 1)\n\t\t\t\t{\n\t\t\t\t\treturn line.x;\n\t\t\t\t}\n\t\t\t\treturn line.x + line.width;\n\t\t\t}\n\t\t\tvar atomIndex:int = line.getAtomIndexAtCharIndex(index);\n\t\t\tvar atomBounds:Rectangle = line.getAtomBounds(atomIndex);\n\t\t\tvar result:Number = line.x + atomBounds.x;\n\t\t\tif(this._bidiLevel == 1)\n\t\t\t{\n\t\t\t\tresult += atomBounds.width;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function positionCursorAtCharIndex(index:int):void\n\t\t{\n\t\t\tif(index < 0)\n\t\t\t{\n\t\t\t\tindex = 0;\n\t\t\t}\n\t\t\tvar cursorX:Number = this.getXPositionOfCharIndex(index);\n\t\t\tcursorX = int(cursorX - (this._cursorSkin.width / 2));\n\t\t\tthis._cursorSkin.x = cursorX;\n\t\t\tthis._cursorSkin.y = this._verticalAlignOffsetY;\n\t\t\tif(this._textLines.length > 0)\n\t\t\t{\n\t\t\t\tvar line:TextLine = this._textLines[0];\n\t\t\t\tthis._cursorSkin.height = this.calculateLineAscent(line) + line.totalDescent;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._cursorSkin.height = this.currentElementFormat.fontSize;\n\t\t\t}\n\n\t\t\t//then we update the scroll to always show the cursor\n\t\t\tvar minScrollX:Number = cursorX + this._cursorSkin.width - this.actualWidth;\n\t\t\tvar displayText:String = this._text;\n\t\t\tif(this._imeText !== null)\n\t\t\t{\n\t\t\t\tdisplayText = this._imeText;\n\t\t\t}\n\t\t\tvar maxScrollX:Number = this.getXPositionOfCharIndex(displayText.length) - this.actualWidth;\n\t\t\tif(maxScrollX < 0)\n\t\t\t{\n\t\t\t\tmaxScrollX = 0;\n\t\t\t}\n\t\t\tvar oldScrollX:Number = this._textSnapshotScrollX;\n\t\t\tif(this._textSnapshotScrollX < minScrollX)\n\t\t\t{\n\t\t\t\tthis._textSnapshotScrollX = minScrollX;\n\t\t\t}\n\t\t\telse if(this._textSnapshotScrollX > cursorX)\n\t\t\t{\n\t\t\t\tthis._textSnapshotScrollX = cursorX;\n\t\t\t}\n\t\t\tif(this._textSnapshotScrollX > maxScrollX)\n\t\t\t{\n\t\t\t\tthis._textSnapshotScrollX = maxScrollX;\n\t\t\t}\n\t\t\tif(this._textSnapshotScrollX != oldScrollX)\n\t\t\t{\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getCursorIndexFromSelectionRange():int\n\t\t{\n\t\t\tif(this._imeCursorIndex >= 0)\n\t\t\t{\n\t\t\t\treturn this._imeCursorIndex;\n\t\t\t}\n\t\t\tvar cursorIndex:int = this._selectionEndIndex;\n\t\t\tif(this.touchPointID >= 0 && this._selectionAnchorIndex >= 0 && this._selectionAnchorIndex == this._selectionEndIndex)\n\t\t\t{\n\t\t\t\tcursorIndex = this._selectionBeginIndex;\n\t\t\t}\n\t\t\treturn cursorIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function positionSelectionBackground():void\n\t\t{\n\t\t\tvar displayText:String = this._text;\n\t\t\tif(this._imeText !== null)\n\t\t\t{\n\t\t\t\tdisplayText = this._imeText;\n\t\t\t}\n\t\t\tvar beginIndex:int = this._selectionBeginIndex;\n\t\t\tif(beginIndex > displayText.length)\n\t\t\t{\n\t\t\t\tbeginIndex = displayText.length;\n\t\t\t}\n\t\t\tvar startX:Number = this.getXPositionOfCharIndex(beginIndex) - this._textSnapshotScrollX;\n\t\t\tif(startX < 0)\n\t\t\t{\n\t\t\t\tstartX = 0;\n\t\t\t}\n\t\t\tvar endIndex:int = this._selectionEndIndex;\n\t\t\tif(endIndex > displayText.length)\n\t\t\t{\n\t\t\t\tendIndex = displayText.length;\n\t\t\t}\n\t\t\tvar endX:Number = this.getXPositionOfCharIndex(endIndex) - this._textSnapshotScrollX;\n\t\t\tif(endX < 0)\n\t\t\t{\n\t\t\t\tendX = 0;\n\t\t\t}\n\t\t\telse if(endX > this.actualWidth)\n\t\t\t{\n\t\t\t\tendX = this.actualWidth;\n\t\t\t}\n\t\t\tthis._selectionSkin.x = startX;\n\t\t\tthis._selectionSkin.width = endX - startX;\n\t\t\tthis._selectionSkin.y = this._verticalAlignOffsetY;\n\t\t\tif(this._textLines.length > 0)\n\t\t\t{\n\t\t\t\tvar line:TextLine = this._textLines[0];\n\t\t\t\tthis._selectionSkin.height = this.calculateLineAscent(line) + line.totalDescent;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._selectionSkin.height = this.currentElementFormat.fontSize;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getSelectedText():String\n\t\t{\n\t\t\tif(this._selectionBeginIndex == this._selectionEndIndex)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn this._text.substr(this._selectionBeginIndex, this._selectionEndIndex - this._selectionBeginIndex);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function deleteSelectedText():void\n\t\t{\n\t\t\tvar currentValue:String = this._text;\n\t\t\tif(this._displayAsPassword)\n\t\t\t{\n\t\t\t\tcurrentValue = this._unmaskedText;\n\t\t\t}\n\t\t\tthis.text = currentValue.substr(0, this._selectionBeginIndex) + currentValue.substr(this._selectionEndIndex);\n\t\t\tthis.validate();\n\t\t\tthis.selectRange(this._selectionBeginIndex, this._selectionBeginIndex);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function replaceSelectedText(text:String):void\n\t\t{\n\t\t\tvar currentValue:String = this._text;\n\t\t\tif(this._displayAsPassword)\n\t\t\t{\n\t\t\t\tcurrentValue = this._unmaskedText;\n\t\t\t}\n\t\t\tvar newText:String = currentValue.substr(0, this._selectionBeginIndex) + text + currentValue.substr(this._selectionEndIndex);\n\t\t\tif(this._maxChars > 0 && newText.length > this._maxChars)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.text = newText;\n\t\t\tthis.validate();\n\t\t\tvar selectionIndex:int = this._selectionBeginIndex + text.length;\n\t\t\tthis.selectRange(selectionIndex, selectionIndex);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function imeClientStartCallback():void\n\t\t{\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function imeClientUpdateCallback(text:String, attributes:Vector.<CompositionAttributeRange>, compositionStartIndex:int, compositionEndIndex:int):void\n\t\t{\n\t\t\tvar currentValue:String = this._text;\n\t\t\tif(this._displayAsPassword)\n\t\t\t{\n\t\t\t\tcurrentValue = this._unmaskedText;\n\t\t\t}\n\t\t\tthis._imeText = currentValue.substr(0, this._selectionBeginIndex) + text + currentValue.substr(this._selectionEndIndex);\n\t\t\tthis._imeCursorIndex = this._selectionBeginIndex + compositionStartIndex;\n\t\t\tthis._cursorSkin.visible = this._hasFocus;\n\t\t\tthis._selectionSkin.visible = false;\n\t\t\tthis.setInvalidationFlag(INVALIDATION_FLAG_DATA);\n\t\t\tthis.validate();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function imeClientConfirmCallback(text:String = null, preserveSelection:Boolean = false):void\n\t\t{\n\t\t\t//the focus will dispatch an extra TextEvent.TEXT_INPUT event, for\n\t\t\t//some reason. we need to ignore it or extra text will be displayed.\n\t\t\tthis._ignoreNextTextInputEvent = true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function hasFocus_enterFrameHandler(event:starling.events.Event):void\n\t\t{\n\t\t\tvar target:DisplayObject = this;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tif(!target.visible)\n\t\t\t\t{\n\t\t\t\t\tthis.clearFocus();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ttarget = target.parent;\n\t\t\t}\n\t\t\twhile(target);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textEditor_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled || (!this._isEditable && !this._isSelectable))\n\t\t\t{\n\t\t\t\tthis.touchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this.touchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(this, null, this.touchPointID);\n\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\ttouch.getLocation(this, point);\n\t\t\t\tpoint.x += this._textSnapshotScrollX;\n\t\t\t\tthis.selectRange(this._selectionAnchorIndex, this.getSelectionIndexAtPoint(point.x, point.y));\n\t\t\t\tPool.putPoint(point);\n\t\t\t\tif(touch.phase == TouchPhase.ENDED)\n\t\t\t\t{\n\t\t\t\t\tthis.touchPointID = -1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //if we get here, we don't have a saved touch ID yet\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(this, TouchPhase.BEGAN);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(touch.tapCount == 2)\n\t\t\t\t{\n\t\t\t\t\tvar start:int = TextInputNavigation.findCurrentWordStartIndex(this._text, this._selectionBeginIndex);\n\t\t\t\t\tvar end:int = TextInputNavigation.findCurrentWordEndIndex(this._text, this._selectionEndIndex);\n\t\t\t\t\tthis.selectRange(start, end);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse if(touch.tapCount > 2)\n\t\t\t\t{\n\t\t\t\t\tthis.selectRange(0, this._text.length);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.touchPointID = touch.id;\n\t\t\t\tpoint = Pool.getPoint();\n\t\t\t\ttouch.getLocation(this, point);\n\t\t\t\tpoint.x += this._textSnapshotScrollX;\n\t\t\t\tif(event.shiftKey)\n\t\t\t\t{\n\t\t\t\t\tif(this._selectionAnchorIndex < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._selectionAnchorIndex = this._selectionBeginIndex;\n\t\t\t\t\t}\n\t\t\t\t\tthis.selectRange(this._selectionAnchorIndex, this.getSelectionIndexAtPoint(point.x, point.y));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.setFocus(point);\n\t\t\t\t}\n\t\t\t\tPool.putPoint(point);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(FocusManager.isEnabledForStage(this.stage))\n\t\t\t{\n\t\t\t\t//let the focus manager handle clearing focus\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar touch:Touch = event.getTouch(this.stage, TouchPhase.BEGAN);\n\t\t\tif(!touch) //we only care about began touches\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar point:Point = Pool.getPoint();\n\t\t\ttouch.getLocation(this.stage, point);\n\t\t\tvar isInBounds:Boolean = this.contains(this.stage.hitTest(point));\n\t\t\tPool.putPoint(point);\n\t\t\tif(isInBounds) //if the touch is in the text editor, it's all good\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//if the touch begins anywhere else, it's a focus out!\n\t\t\tthis.clearFocus();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled || (!this._isEditable && !this._isSelectable) ||\n\t\t\t\tthis.touchPointID >= 0 || event.isDefaultPrevented())\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//ignore select all, cut, copy, and paste\n\t\t\tvar charCode:uint = event.charCode;\n\t\t\tif(event.ctrlKey && (charCode == 97 || charCode == 99 || charCode == 118 || charCode == 120)) //a, c, p, and x\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar newIndex:int = -1;\n\t\t\tif(!FocusManager.isEnabledForStage(this.stage) && event.keyCode == Keyboard.TAB)\n\t\t\t{\n\t\t\t\tthis.clearFocus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if(event.keyCode == Keyboard.HOME || event.keyCode == Keyboard.UP)\n\t\t\t{\n\t\t\t\tnewIndex = 0;\n\t\t\t\tif(event.shiftKey)\n\t\t\t\t{\n\t\t\t\t\tthis.selectRange(newIndex, this._selectionAnchorIndex);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(event.keyCode == Keyboard.END || event.keyCode == Keyboard.DOWN)\n\t\t\t{\n\t\t\t\tnewIndex = this._text.length;\n\t\t\t\tif(event.shiftKey)\n\t\t\t\t{\n\t\t\t\t\tthis.selectRange(this._selectionAnchorIndex, newIndex);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(event.keyCode == Keyboard.LEFT)\n\t\t\t{\n\t\t\t\tif(event.shiftKey)\n\t\t\t\t{\n\t\t\t\t\tif(this._selectionAnchorIndex >= 0 && this._selectionAnchorIndex == this._selectionBeginIndex &&\n\t\t\t\t\t\tthis._selectionBeginIndex != this._selectionEndIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewIndex = this._selectionEndIndex - 1;\n\t\t\t\t\t\tthis.selectRange(this._selectionBeginIndex, newIndex);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewIndex = this._selectionBeginIndex - 1;\n\t\t\t\t\t\tif(newIndex < 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewIndex = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.selectRange(newIndex, this._selectionEndIndex);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse if(this._selectionBeginIndex != this._selectionEndIndex)\n\t\t\t\t{\n\t\t\t\t\tnewIndex = this._selectionBeginIndex;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(event.altKey || event.ctrlKey)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewIndex = TextInputNavigation.findPreviousWordStartIndex(this._text, this._selectionBeginIndex);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewIndex = this._selectionBeginIndex - 1;\n\t\t\t\t\t}\n\t\t\t\t\tif(newIndex < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewIndex = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(event.keyCode == Keyboard.RIGHT)\n\t\t\t{\n\t\t\t\tif(event.shiftKey)\n\t\t\t\t{\n\t\t\t\t\tif(this._selectionAnchorIndex >= 0 && this._selectionAnchorIndex == this._selectionEndIndex &&\n\t\t\t\t\t\tthis._selectionBeginIndex != this._selectionEndIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewIndex = this._selectionBeginIndex + 1;\n\t\t\t\t\t\tthis.selectRange(newIndex, this._selectionEndIndex);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewIndex = this._selectionEndIndex + 1;\n\t\t\t\t\t\tif(newIndex < 0 || newIndex > this._text.length)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewIndex = this._text.length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.selectRange(this._selectionBeginIndex, newIndex);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse if(this._selectionBeginIndex != this._selectionEndIndex)\n\t\t\t\t{\n\t\t\t\t\tnewIndex = this._selectionEndIndex;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(event.altKey || event.ctrlKey)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewIndex = TextInputNavigation.findNextWordStartIndex(this._text, this._selectionEndIndex);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewIndex = this._selectionEndIndex + 1;\n\t\t\t\t\t}\n\t\t\t\t\tif(newIndex < 0 || newIndex > this._text.length)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewIndex = this._text.length;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(newIndex < 0)\n\t\t\t{\n\t\t\t\tif(event.keyCode == Keyboard.ENTER)\n\t\t\t\t{\n\t\t\t\t\tthis.dispatchEventWith(FeathersEventType.ENTER);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t//everything after this point edits the text, so return if the text\n\t\t\t\t//editor isn't editable.\n\t\t\t\tif(!this._isEditable)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar currentValue:String = this._text;\n\t\t\t\tif(this._displayAsPassword)\n\t\t\t\t{\n\t\t\t\t\tcurrentValue = this._unmaskedText;\n\t\t\t\t}\n\t\t\t\tif(event.keyCode == Keyboard.DELETE)\n\t\t\t\t{\n\t\t\t\t\tif(event.altKey || event.ctrlKey)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar nextWordStartIndex:int = TextInputNavigation.findNextWordStartIndex(this._text, this._selectionEndIndex);\n\t\t\t\t\t\tthis.text = currentValue.substr(0, this._selectionBeginIndex) + currentValue.substr(nextWordStartIndex);\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._selectionBeginIndex != this._selectionEndIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.deleteSelectedText();\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._selectionEndIndex < currentValue.length)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.text = currentValue.substr(0, this._selectionBeginIndex) + currentValue.substr(this._selectionEndIndex + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(event.keyCode == Keyboard.BACKSPACE)\n\t\t\t\t{\n\t\t\t\t\tif(event.altKey || event.ctrlKey)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewIndex = TextInputNavigation.findPreviousWordStartIndex(this._text, this._selectionBeginIndex);\n\t\t\t\t\t\tthis.text = currentValue.substr(0, newIndex) + currentValue.substr(this._selectionEndIndex);\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._selectionBeginIndex != this._selectionEndIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.deleteSelectedText();\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._selectionBeginIndex > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewIndex = this._selectionBeginIndex - 1;\n\t\t\t\t\t\tthis.text = currentValue.substr(0, this._selectionBeginIndex - 1) + currentValue.substr(this._selectionEndIndex);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(newIndex >= 0)\n\t\t\t{\n\t\t\t\tthis.validate();\n\t\t\t\tthis.selectRange(newIndex, newIndex);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function nativeFocus_textInputHandler(event:TextEvent):void\n\t\t{\n\t\t\tif(this._ignoreNextTextInputEvent)\n\t\t\t{\n\t\t\t\tthis._ignoreNextTextInputEvent = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!this._isEditable || !this._isEnabled)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._imeText = null;\n\t\t\tthis._imeCursorIndex = -1;\n\t\t\tvar text:String = event.text;\n\t\t\tif(text === CARRIAGE_RETURN || text === LINE_FEED)\n\t\t\t{\n\t\t\t\t//ignore new lines\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar charCode:int = text.charCodeAt(0);\n\t\t\tif(!this._restrict || this._restrict.isCharacterAllowed(charCode))\n\t\t\t{\n\t\t\t\tthis.replaceSelectedText(text);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function nativeFocus_selectAllHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tif(!this._isEnabled || (!this._isEditable && !this._isSelectable))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._selectionAnchorIndex = 0;\n\t\t\tthis.selectRange(0, this._text.length);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function nativeFocus_cutHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tif(!this._isEnabled || (!this._isEditable && !this._isSelectable) ||\n\t\t\t\tthis._selectionBeginIndex == this._selectionEndIndex || this._displayAsPassword)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tClipboard.generalClipboard.setData(ClipboardFormats.TEXT_FORMAT, this.getSelectedText());\n\t\t\tif(!this._isEditable)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.deleteSelectedText();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function nativeFocus_copyHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tif(!this._isEnabled || (!this._isEditable && !this._isSelectable) ||\n\t\t\t\tthis._selectionBeginIndex == this._selectionEndIndex || this._displayAsPassword)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tClipboard.generalClipboard.setData(ClipboardFormats.TEXT_FORMAT, this.getSelectedText());\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function nativeFocus_pasteHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tif(!this._isEditable || !this._isEnabled)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar pastedText:String = Clipboard.generalClipboard.getData(ClipboardFormats.TEXT_FORMAT) as String;\n\t\t\tif(pastedText === null)\n\t\t\t{\n\t\t\t\t//the clipboard doesn't contain any text to paste\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//new lines are not allowed\n\t\t\tpastedText = pastedText.replace(/[\\n\\r]/g, \"\");\n\t\t\tif(this._restrict)\n\t\t\t{\n\t\t\t\tpastedText = this._restrict.filterText(pastedText);\n\t\t\t}\n\t\t\tthis.replaceSelectedText(pastedText);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/text/TextBlockTextRenderer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.text\n{\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.ITextRenderer;\n\timport feathers.core.IToggle;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.utils.geom.matrixToScaleX;\n\timport feathers.utils.geom.matrixToScaleY;\n\timport feathers.utils.textures.calculateSnapshotTextureDimensions;\n\n\timport flash.display.BitmapData;\n\timport flash.display.DisplayObjectContainer;\n\timport flash.display.Sprite;\n\timport flash.display3D.Context3DProfile;\n\timport flash.filters.BitmapFilter;\n\timport flash.geom.Matrix;\n\timport flash.geom.Point;\n\timport flash.geom.Rectangle;\n\timport flash.text.FontType;\n\timport flash.text.engine.ContentElement;\n\timport flash.text.engine.ElementFormat;\n\timport flash.text.engine.FontDescription;\n\timport flash.text.engine.FontLookup;\n\timport flash.text.engine.FontPosture;\n\timport flash.text.engine.FontWeight;\n\timport flash.text.engine.Kerning;\n\timport flash.text.engine.SpaceJustifier;\n\timport flash.text.engine.TabStop;\n\timport flash.text.engine.TextBaseline;\n\timport flash.text.engine.TextBlock;\n\timport flash.text.engine.TextElement;\n\timport flash.text.engine.TextJustifier;\n\timport flash.text.engine.TextLine;\n\timport flash.text.engine.TextRotation;\n\n\timport starling.core.Starling;\n\timport starling.display.Image;\n\timport starling.rendering.Painter;\n\timport starling.text.TextFormat;\n\timport starling.textures.ConcreteTexture;\n\timport starling.textures.Texture;\n\timport starling.utils.Align;\n\timport starling.utils.MathUtil;\n\timport starling.utils.Pool;\n\timport starling.utils.SystemUtil;\n\n\t/**\n\t * Renders text with a native <code>flash.text.engine.TextBlock</code> from\n\t * <a href=\"http://help.adobe.com/en_US/as3/dev/WS9dd7ed846a005b294b857bfa122bd808ea6-8000.html\" target=\"_top\">Flash Text Engine</a>\n\t * (sometimes abbreviated as FTE), and draws it to <code>BitmapData</code>\n\t * before uploading it to a texture on the GPU. Textures are managed\n\t * internally by this component, and they will be automatically disposed\n\t * when the component is disposed.\n\t *\n\t * <p>For longer passages of text, this component will stitch together\n\t * multiple individual textures both horizontally and vertically, as a grid,\n\t * if required. This may require quite a lot of texture memory, possibly\n\t * exceeding the limits of some mobile devices, so use this component with\n\t * caution when displaying a lot of text.</p>\n\t *\n\t * <p>The following example shows how to use\n\t * <code>TextBlockTextRenderer</code> with a <code>Label</code>:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var label:Label = new Label();\n\t * label.text = \"I am the very model of a modern Major General\";\n\t * label.textRendererFactory = function():ITextRenderer\n\t * {\n\t *     return new TextBlockTextRenderer();\n\t * };\n\t * this.addChild( label );</listing>\n\t *\n\t * <strong>Embedding Fonts</strong>\n\t *\n\t * <p>This text renderer supports embedded TrueType or OpenType fonts.</p>\n\t *\n\t * <p>In the following example, a TrueType font is included with\n\t * <code>[Embed]</code> metadata:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * [Embed(source=\"path/to/font.ttf\",fontFamily=\"MyCustomFont\",fontWeight=\"normal\",fontStyle=\"normal\",mimeType=\"application/x-font\",embedAsCFF=\"true\")]\n\t * private static const MY_CUSTOM_FONT:Class;</listing>\n\t *\n\t * <p>The <code>source</code> field should point to the font file, relative\n\t * to the current <code>.as</code> file that contains the metadata.</p>\n\t *\n\t * <p>Set the <code>fontFamily</code> field to the string value that you\n\t * want to use when referencing this font in code. For example, you would\n\t * use this name when you create a <code>starling.text.TextFormat</code>\n\t * object. Replace \"MyCustomFont\" with an appropriate name for your font.</p>\n\t *\n\t * <p><strong>Tip:</strong> For best results, try not to set the exact same\n\t * name in the <code>fontFamily</code> field as the name of device font\n\t * installed on your system. Debugging embedded font issues can be\n\t * frustrating when you see the correct font on your development computer,\n\t * but it's a different font on other devices. If you use a font name that\n\t * doesn't exist on your development computer, you'll see when something is\n\t * wrong immediately, instead of discovering it later when you're testing\n\t * on other devices.</p>\n\t *\n\t * <p>If the font is bold, set the <code>fontWeight</code> field to \"bold\".\n\t * Otherwise, set it to \"normal\".</p>\n\t *\n\t * <p>If the font is italic, set the <code>fontStyle</code> field to\n\t * \"italic\". Otherwise, set it to \"normal\".</p>\n\t *\n\t * <p>Since the text renderer is based on Flash Text Engine, you\n\t * <strong>must</strong> set the <code>embedAsCFF</code> field to\n\t * \"true\".</p>\n\t *\n\t * @see ../../../../help/text-renderers.html Introduction to Feathers text renderers\n\t * @see ../../../../help/text-block-text-renderer.html How to use the Feathers TextBlockTextRenderer component\n\t * @see http://help.adobe.com/en_US/as3/dev/WS9dd7ed846a005b294b857bfa122bd808ea6-8000.html Using the Flash Text Engine in ActionScript 3.0 Developer's Guide\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/engine/TextBlock.html flash.text.engine.TextBlock\n\t *\n\t * @productversion Feathers 1.3.0\n\t */\n\tpublic class TextBlockTextRenderer extends BaseTextRenderer implements ITextRenderer\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const HELPER_POINT:Point = new Point();\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const HELPER_RESULT:MeasureTextResult = new MeasureTextResult();\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const HELPER_MATRIX:Matrix = new Matrix();\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static var HELPER_TEXT_LINES:Vector.<TextLine> = new <TextLine>[];\n\n\t\t/**\n\t\t * @private\n\t\t * This is enforced by the runtime.\n\t\t */\n\t\tprotected static const MAX_TEXT_LINE_WIDTH:Number = 1000000;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const LINE_FEED:String = \"\\n\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const CARRIAGE_RETURN:String = \"\\r\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const FUZZY_TRUNCATION_DIFFERENCE:Number = 0.000001;\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>TextBlockTextRenderer</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function TextBlockTextRenderer()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.isQuickHitAreaEnabled = true;\n\t\t}\n\n\t\t/**\n\t\t * The TextBlock instance used to render the text before taking a\n\t\t * texture snapshot.\n\t\t */\n\t\tprotected var textBlock:TextBlock;\n\n\t\t/**\n\t\t * An image that displays a snapshot of the native <code>TextBlock</code>\n\t\t * in the Starling display list when the editor doesn't have focus.\n\t\t */\n\t\tprotected var textSnapshot:Image;\n\n\t\t/**\n\t\t * If multiple snapshots are needed due to texture size limits, the\n\t\t * snapshots appearing after the first are stored here.\n\t\t */\n\t\tprotected var textSnapshots:Vector.<Image>;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textSnapshotScrollX:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textSnapshotScrollY:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textSnapshotOffsetX:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textSnapshotOffsetY:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textSnapshotNativeFiltersWidth:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textSnapshotNativeFiltersHeight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastGlobalScaleX:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastGlobalScaleY:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastGlobalContentScaleFactor:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textLineContainer:Sprite;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textLines:Vector.<TextLine> = new <TextLine>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _measurementTextLineContainer:Sprite;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _measurementTextLines:Vector.<TextLine> = new <TextLine>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _previousLayoutActualWidth:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _previousLayoutActualHeight:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _savedTextLinesWidth:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _savedTextLinesHeight:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _snapshotWidth:int = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _snapshotHeight:int = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _snapshotVisibleWidth:int = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _snapshotVisibleHeight:int = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _needsNewTexture:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _needsTextureUpdate:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _truncationOffset:int = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textElement:TextElement;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn TextBlockTextRenderer.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set maxWidth(value:Number):void\n\t\t{\n\t\t\t//this is a special case because truncation may bypass normal rules\n\t\t\t//for determining if changing maxWidth should invalidate\n\t\t\tvar needsInvalidate:Boolean = value > this._explicitMaxWidth && this._lastMeasurementWasTruncated;\n\t\t\tsuper.maxWidth = value;\n\t\t\tif(needsInvalidate)\n\t\t\t{\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.core.ITextRenderer#numLines\n\t\t */\n\t\tpublic function get numLines():int\n\t\t{\n\t\t\treturn this._textLines.length;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set text(value:String):void\n\t\t{\n\t\t\tif(this._text == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._textElement === null)\n\t\t\t{\n\t\t\t\tthis._textElement = new TextElement(value);\n\t\t\t}\n\t\t\tthis.content = this._textElement;\n\t\t\tsuper.text = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _content:ContentElement;\n\n\t\t/**\n\t\t * Sets the contents of the <code>TextBlock</code> to a complex value\n\t\t * that may contain graphics and text with multiple formats.\n\t\t *\n\t\t * <p>In the following example, the content is set to a\n\t\t * <code>GroupElement</code> that contains text with multiple\n\t\t * formats:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var format1:ElementFormat = new ElementFormat(new FontDescription(\"_sans\"), 20, 0x000000);\n\t\t * var format2:ElementFormat = new ElementFormat(new FontDescription(\"_sans\"), 20, 0xff0000);\n\t\t * var format3:ElementFormat = new ElementFormat(new FontDescription(\"_sans\", FontWeight.NORMAL, FontPosture.ITALIC), 20, 0x000000);\n\t\t * var text1:TextElement = new TextElement(\"Different \", format1);\n\t\t * var text2:TextElement = new TextElement(\"colors\", format2);\n\t\t * var text3:TextElement = new TextElement(\" and \", format1);\n\t\t * var text4:TextElement = new TextElement(\"styles\", format3);\n\t\t * var elements:Vector.&lt;ContentElement&gt; = new &lt;ContentElement&gt;[text1, text2, text3, text4];\n\t\t * var group:GroupElement = new GroupElement(elements);\n\t\t * \n\t\t * var textRenderer:TextBlockTextRenderer = new TextBlockTextRenderer();\n\t\t * textRenderer.content = group;</listing>\n\t\t *\n\t\t * <p>In the following example, the content is set to a\n\t\t * <code>GroupElement</code> that contains both text and a bitmap\n\t\t * graphic:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var format:ElementFormat = new ElementFormat(new FontDescription(\"_sans\"), 20);\n\t\t * var text:TextElement = new TextElement(\"Hi there! \", format);\n\t\t * var bitmap:Bitmap = new EmbeddedBitmap(); //a bitmap included with [Embed]\n\t\t * var graphic:GraphicElement = new GraphicElement(bitmap, bitmap.width, bitmap.height, format);\n\t\t * var elements:Vector.&lt;ContentElement&gt; = new &lt;ContentElement&gt;[text, graphic];\n\t\t * var group:GroupElement = new GroupElement(elements);\n\t\t * \n\t\t * var textRenderer:TextBlockTextRenderer = new TextBlockTextRenderer();\n\t\t * textRenderer.content = group;</listing>\n\t\t *\n\t\t * <p>Note: The <code>content</code> property cannot be used when the\n\t\t * <code>TextBlockTextRenderer</code> receives its text from a parent\n\t\t * component, such as a <code>Label</code> or a <code>Button</code>.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #text\n\t\t */\n\t\tpublic function get content():ContentElement\n\t\t{\n\t\t\treturn this._content;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set content(value:ContentElement):void\n\t\t{\n\t\t\tif(this._content === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value is TextElement)\n\t\t\t{\n\t\t\t\tthis._textElement = TextElement(value);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._textElement = null;\n\t\t\t}\n\t\t\tthis._content = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * For debugging purposes, the current\n\t\t * <code>flash.text.engine.ElementFormat</code> used to render the text.\n\t\t * Updated during validation, and may be <code>null</code> before the\n\t\t * first validation.\n\t\t *\n\t\t * <p>Do not modify this value. It is meant for testing and debugging\n\t\t * only. Use the parent's <code>starling.text.TextFormat</code> font\n\t\t * styles APIs instead.</p>\n\t\t */\n\t\tpublic function get currentElementFormat():ElementFormat\n\t\t{\n\t\t\tif(this._textElement === null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn this._textElement.elementFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fontStylesElementFormat:ElementFormat;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentVerticalAlign:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentHorizontalAlign:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalAlignOffsetY:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _elementFormatForState:Object;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _elementFormat:ElementFormat;\n\n\t\t/**\n\t\t * Advanced font formatting used to draw the text, if\n\t\t * <code>fontStyles</code> and <code>starling.text.TextFormat</code>\n\t\t * cannot be used on the parent component because the full capabilities\n\t\t * of Flash Text Engine are required.\n\t\t *\n\t\t * <p>In the following example, the element format is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.elementFormat = new ElementFormat( new FontDescription( \"Source Sans Pro\" ) );</listing>\n\t\t *\n\t\t * <p><strong>Warning:</strong> If this property is not\n\t\t * <code>null</code>, any <code>starling.text.TextFormat</code> font\n\t\t * styles that are passed in from the parent component may be ignored.\n\t\t * In other words, advanced font styling with <code>ElementFormat</code>\n\t\t * will always take precedence.</p>\n\t\t *\n\t\t * <p><strong>Warning:</strong> This property will be ignored if the\n\t\t * <code>content</code> property is customized with Flash Text Engine\n\t\t * rich text objects such as <code>GroupElement</code> and\n\t\t * <code>GraphicElement</code>.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #setElementFormatForState()\n\t\t * @see #disabledElementFormat\n\t\t * @see #selectedElementFormat\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/engine/ElementFormat.html flash.text.engine.ElementFormat\n\t\t */\n\t\tpublic function get elementFormat():ElementFormat\n\t\t{\n\t\t\treturn this._elementFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set elementFormat(value:ElementFormat):void\n\t\t{\n\t\t\tif(this._elementFormat == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._elementFormat = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _disabledElementFormat:ElementFormat;\n\n\t\t/**\n\t\t * Advanced font formatting used to draw the text when the component\n\t\t * is disabled, if <code>disabledFontStyles</code> and\n\t\t * <code>starling.text.TextFormat</code> cannot be used on the parent\n\t\t * component because the full capabilities of Flash Text Engine are\n\t\t * required.\n\t\t *\n\t\t * <p>In the following example, the disabled element format is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.isEnabled = false;\n\t\t * textRenderer.disabledElementFormat = new ElementFormat( new FontDescription( \"Source Sans Pro\" ) );</listing>\n\t\t *\n\t\t * <p><strong>Warning:</strong> If this property is not\n\t\t * <code>null</code>, any <code>starling.text.TextFormat</code> font\n\t\t * styles that are passed in from the parent component may be ignored.\n\t\t * In other words, advanced font styling with <code>ElementFormat</code>\n\t\t * will always take precedence.</p>\n\t\t *\n\t\t * <p><strong>Warning:</strong> This property will be ignored if the\n\t\t * <code>content</code> property is customized with Flash Text Engine\n\t\t * rich text objects such as <code>GroupElement</code> and\n\t\t * <code>GraphicElement</code>.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #elementFormat\n\t\t * @see #selectedElementFormat\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/engine/ElementFormat.html flash.text.engine.ElementFormat\n\t\t */\n\t\tpublic function get disabledElementFormat():ElementFormat\n\t\t{\n\t\t\treturn this._disabledElementFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disabledElementFormat(value:ElementFormat):void\n\t\t{\n\t\t\tif(this._disabledElementFormat == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._disabledElementFormat = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectedElementFormat:ElementFormat;\n\n\t\t/**\n\t\t * Advanced font formatting used to draw the text when the\n\t\t * <code>stateContext</code> is selected, if\n\t\t * <code>selectedFontStyles</code> and\n\t\t * <code>starling.text.TextFormat</code> cannot be used on the parent\n\t\t * component because the full capabilities of Flash Text Engine are\n\t\t * required.\n\t\t *\n\t\t * <p>In the following example, the selected element format is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.selectedElementFormat = new ElementFormat( new FontDescription( \"Source Sans Pro\" ) );</listing>\n\t\t *\n\t\t * <p><strong>Warning:</strong> If this property is not\n\t\t * <code>null</code>, any <code>starling.text.TextFormat</code> font\n\t\t * styles that are passed in from the parent component may be ignored.\n\t\t * In other words, advanced font styling with <code>ElementFormat</code>\n\t\t * will always take precedence.</p>\n\t\t *\n\t\t * <p><strong>Warning:</strong> This property will be ignored if the\n\t\t * <code>content</code> property is customized with Flash Text Engine\n\t\t * rich text objects such as <code>GroupElement</code> and\n\t\t * <code>GraphicElement</code>.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #stateContext\n\t\t * @see feathers.core.IToggle\n\t\t * @see #elementFormat\n\t\t * @see #disabledElementFormat\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/engine/ElementFormat.html flash.text.engine.ElementFormat\n\t\t */\n\t\tpublic function get selectedElementFormat():ElementFormat\n\t\t{\n\t\t\treturn this._selectedElementFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedElementFormat(value:ElementFormat):void\n\t\t{\n\t\t\tif(this._selectedElementFormat == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._selectedElementFormat = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentLeading:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _leading:Number = NaN;\n\n\t\t/**\n\t\t * The amount of vertical space, in pixels, between lines.\n\t\t *\n\t\t * <p>If <code>leading</code> is <code>NaN</code> the leading from the\n\t\t * <code>starling.text.TextFormat</code> font styles may be used. If no\n\t\t * <code>starling.text.TextFormat</code> font styles have been provided\n\t\t * by the parent component, the leading will default to <code>0</code>.</p>\n\t\t *\n\t\t * <p>In the following example, the leading is changed to 20 pixels:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.leading = 20;</listing>\n\t\t *\n\t\t * @default NaN\n\t\t */\n\t\tpublic function get leading():Number\n\t\t{\n\t\t\treturn this._leading;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set leading(value:Number):void\n\t\t{\n\t\t\tif(this._leading == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._leading = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textAlign:String = null;\n\n\t\t/**\n\t\t * The alignment of the text. For justified text, see the\n\t\t * <code>textJustifier</code> property.\n\t\t *\n\t\t * <p>If <code>textAlign</code> is <code>null</code> the horizontal\n\t\t * alignment from the <code>starling.text.TextFormat</code> font styles\n\t\t * may be used. If no <code>starling.text.TextFormat</code> font styles\n\t\t * have been provided by the parent component, the alignment will\n\t\t * default to <code>HorizontalAlign.LEFT</code>.</p>\n\t\t *\n\t\t * <p>In the following example, the text alignment is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.textAlign = HorizontalAlign.CENTER;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.layout.HorizontalAlign#LEFT\n\t\t * @see feathers.layout.HorizontalAlign#CENTER\n\t\t * @see feathers.layout.HorizontalAlign#RIGHT\n\t\t * @see #textJustifier\n\t\t */\n\t\tpublic function get textAlign():String\n\t\t{\n\t\t\treturn this._textAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set textAlign(value:String):void\n\t\t{\n\t\t\tif(this._textAlign == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textAlign = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get baseline():Number\n\t\t{\n\t\t\tif(this._textLines.length == 0)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn this.calculateLineAscent(this._textLines[0]);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _applyNonLinearFontScaling:Boolean = true;\n\n\t\t/**\n\t\t * Specifies that you want to enhance screen appearance at the expense\n\t\t * of what-you-see-is-what-you-get (WYSIWYG) print fidelity.\n\t\t *\n\t\t * <p>In the following example, this property is changed to false:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.applyNonLinearFontScaling = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/engine/TextBlock.html#applyNonLinearFontScaling Full description of flash.text.engine.TextBlock.applyNonLinearFontScaling in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get applyNonLinearFontScaling():Boolean\n\t\t{\n\t\t\treturn this._applyNonLinearFontScaling;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set applyNonLinearFontScaling(value:Boolean):void\n\t\t{\n\t\t\tif(this._applyNonLinearFontScaling == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._applyNonLinearFontScaling = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _baselineFontDescription:FontDescription;\n\n\t\t/**\n\t\t * The font used to determine the baselines for all the lines created from the block, independent of their content.\n\t\t *\n\t\t * <p>In the following example, the baseline font description is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.baselineFontDescription = new FontDescription( \"Source Sans Pro\", FontWeight.BOLD );</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/engine/TextBlock.html#baselineFontDescription Full description of flash.text.engine.TextBlock.baselineFontDescription in Adobe's Flash Platform API Reference\n\t\t * @see #baselineFontSize\n\t\t */\n\t\tpublic function get baselineFontDescription():FontDescription\n\t\t{\n\t\t\treturn this._baselineFontDescription;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set baselineFontDescription(value:FontDescription):void\n\t\t{\n\t\t\tif(this._baselineFontDescription == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._baselineFontDescription = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _baselineFontSize:Number = 12;\n\n\t\t/**\n\t\t * The font size used to calculate the baselines for the lines created\n\t\t * from the block.\n\t\t *\n\t\t * <p>In the following example, the baseline font size is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.baselineFontSize = 20;</listing>\n\t\t *\n\t\t * @default 12\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/engine/TextBlock.html#baselineFontSize Full description of flash.text.engine.TextBlock.baselineFontSize in Adobe's Flash Platform API Reference\n\t\t * @see #baselineFontDescription\n\t\t */\n\t\tpublic function get baselineFontSize():Number\n\t\t{\n\t\t\treturn this._baselineFontSize;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set baselineFontSize(value:Number):void\n\t\t{\n\t\t\tif(this._baselineFontSize == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._baselineFontSize = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _baselineZero:String = TextBaseline.ROMAN;\n\n\t\t/**\n\t\t * Specifies which baseline is at y=0 for lines created from this block.\n\t\t *\n\t\t * <p>In the following example, the baseline zero is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.baselineZero = TextBaseline.ASCENT;</listing>\n\t\t *\n\t\t * @default TextBaseline.ROMAN\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/engine/TextBlock.html#baselineZero Full description of flash.text.engine.TextBlock.baselineZero in Adobe's Flash Platform API Reference\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/engine/TextBaseline.html flash.text.engine.TextBaseline\n\t\t */\n\t\tpublic function get baselineZero():String\n\t\t{\n\t\t\treturn this._baselineZero;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set baselineZero(value:String):void\n\t\t{\n\t\t\tif(this._baselineZero == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._baselineZero = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _bidiLevel:int = 0;\n\n\t\t/**\n\t\t * Specifies the bidirectional paragraph embedding level of the text\n\t\t * block.\n\t\t *\n\t\t * <p>In the following example, the bidi level is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.bidiLevel = 1;</listing>\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/engine/TextBlock.html#bidiLevel Full description of flash.text.engine.TextBlock.bidiLevel in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get bidiLevel():int\n\t\t{\n\t\t\treturn this._bidiLevel;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set bidiLevel(value:int):void\n\t\t{\n\t\t\tif(this._bidiLevel == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._bidiLevel = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lineRotation:String = TextRotation.ROTATE_0;\n\n\t\t/**\n\t\t * Rotates the text lines in the text block as a unit.\n\t\t *\n\t\t * <p>In the following example, the line rotation is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.lineRotation = TextRotation.ROTATE_90;</listing>\n\t\t *\n\t\t * @default TextRotation.ROTATE_0\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/engine/TextBlock.html#lineRotation Full description of flash.text.engine.TextBlock.lineRotation in Adobe's Flash Platform API Reference\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/engine/TextRotation.html flash.text.engine.TextRotation\n\t\t */\n\t\tpublic function get lineRotation():String\n\t\t{\n\t\t\treturn this._lineRotation;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set lineRotation(value:String):void\n\t\t{\n\t\t\tif(this._lineRotation == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._lineRotation = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _tabStops:Vector.<TabStop>;\n\n\t\t/**\n\t\t * Specifies the tab stops for the text in the text block, in the form\n\t\t * of a <code>Vector</code> of <code>TabStop</code> objects.\n\t\t *\n\t\t * <p>In the following example, the tab stops changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.tabStops = new &lt;TabStop&gt;[ new TabStop( TabAlignment.CENTER ) ];</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/engine/TextBlock.html#tabStops Full description of flash.text.engine.TextBlock.tabStops in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get tabStops():Vector.<TabStop>\n\t\t{\n\t\t\treturn this._tabStops;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set tabStops(value:Vector.<TabStop>):void\n\t\t{\n\t\t\tif(this._tabStops == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._tabStops = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textJustifier:TextJustifier = new SpaceJustifier();\n\n\t\t/**\n\t\t * Specifies the <code>TextJustifier</code> to use during line creation.\n\t\t *\n\t\t * <p>In the following example, the text justifier is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.textJustifier = new SpaceJustifier( \"en\", LineJustification.ALL_BUT_LAST );</listing>\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/engine/TextBlock.html#textJustifier Full description of flash.text.engine.TextBlock.textJustifier in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get textJustifier():TextJustifier\n\t\t{\n\t\t\treturn this._textJustifier;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set textJustifier(value:TextJustifier):void\n\t\t{\n\t\t\tif(this._textJustifier == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textJustifier = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _userData:*;\n\n\t\t/**\n\t\t * Provides a way for the application to associate arbitrary data with\n\t\t * the text block.\n\t\t *\n\t\t * <p>In the following example, the user data is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.userData = { author: \"William Shakespeare\", title: \"Much Ado About Nothing\" };</listing>\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/engine/TextBlock.html#userData Full description of flash.text.engine.TextBlock.userData in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get userData():*\n\t\t{\n\t\t\treturn this._userData;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set userData(value:*):void\n\t\t{\n\t\t\tif(this._userData === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._userData = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _pixelSnapping:Boolean = true;\n\n\t\t/**\n\t\t * Determines if the text should be snapped to the nearest whole pixel\n\t\t * when rendered. When this is <code>false</code>, text may be displayed\n\t\t * on sub-pixels, which often results in blurred rendering due to\n\t\t * texture smoothing.\n\t\t *\n\t\t * <p>In the following example, the text is not snapped to pixels:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.pixelSnapping = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic function get pixelSnapping():Boolean\n\t\t{\n\t\t\treturn this._pixelSnapping;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set pixelSnapping(value:Boolean):void\n\t\t{\n\t\t\tif(this._pixelSnapping === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._pixelSnapping = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maxTextureDimensions:int = 2048;\n\n\t\t/**\n\t\t * The maximum size of individual textures that are managed by this text\n\t\t * renderer. Must be a power of 2. A larger value will create fewer\n\t\t * individual textures, but a smaller value may use less overall texture\n\t\t * memory by incrementing over smaller powers of two.\n\t\t *\n\t\t * <p>In the following example, the maximum size of the textures is\n\t\t * changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.maxTextureDimensions = 4096;</listing>\n\t\t *\n\t\t * @default 2048\n\t\t */\n\t\tpublic function get maxTextureDimensions():int\n\t\t{\n\t\t\treturn this._maxTextureDimensions;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maxTextureDimensions(value:int):void\n\t\t{\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\t//check if we can use rectangle textures or not\n\t\t\tif(starling.profile === Context3DProfile.BASELINE_CONSTRAINED)\n\t\t\t{\n\t\t\t\tvalue = MathUtil.getNextPowerOfTwo(value);\n\t\t\t}\n\t\t\tif(this._maxTextureDimensions == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._maxTextureDimensions = value;\n\t\t\tthis._needsNewTexture = true;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _nativeFilters:Array;\n\n\t\t/**\n\t\t * Native filters to pass to the <code>flash.text.engine.TextLine</code>\n\t\t * instances before creating the texture snapshot.\n\t\t *\n\t\t * <p>In the following example, the native filters are changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.nativeFilters = [ new GlowFilter() ];</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/DisplayObject.html#filters Full description of flash.display.DisplayObject.filters in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get nativeFilters():Array\n\t\t{\n\t\t\treturn this._nativeFilters;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set nativeFilters(value:Array):void\n\t\t{\n\t\t\tif(this._nativeFilters == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._nativeFilters = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _truncationText:String = \"...\";\n\n\t\t/**\n\t\t * The text to display at the end of the label if it is truncated.\n\t\t *\n\t\t * <p>In the following example, the truncation text is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.truncationText = \" [more]\";</listing>\n\t\t *\n\t\t * @default \"...\"\n\t\t *\n\t\t * @see #truncateToFit\n\t\t */\n\t\tpublic function get truncationText():String\n\t\t{\n\t\t\treturn _truncationText;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set truncationText(value:String):void\n\t\t{\n\t\t\tif(this._truncationText == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._truncationText = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _truncateToFit:Boolean = true;\n\n\t\t/**\n\t\t * If word wrap is disabled, and the text is longer than the width of\n\t\t * the label, the text may be truncated using <code>truncationText</code>.\n\t\t *\n\t\t * <p>This feature may be disabled to improve performance.</p>\n\t\t *\n\t\t * <p>This feature only works when the <code>text</code> property is\n\t\t * set to a string value. If the <code>content</code> property is set\n\t\t * instead, then the content will not be truncated.</p>\n\t\t *\n\t\t * <p>This feature does not currently support the truncation of text\n\t\t * displayed on multiple lines.</p>\n\t\t *\n\t\t * <p>In the following example, truncation is disabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.truncateToFit = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t *\n\t\t * @see #truncationText\n\t\t */\n\t\tpublic function get truncateToFit():Boolean\n\t\t{\n\t\t\treturn _truncateToFit;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set truncateToFit(value:Boolean):void\n\t\t{\n\t\t\tif(this._truncateToFit == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._truncateToFit = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _updateSnapshotOnScaleChange:Boolean = false;\n\n\t\t/**\n\t\t * Refreshes the texture snapshot every time that the text renderer is\n\t\t * scaled. Based on the scale in global coordinates, so scaling the\n\t\t * parent will require a new snapshot.\n\t\t *\n\t\t * <p>Warning: setting this property to true may result in reduced\n\t\t * performance because every change of the scale requires uploading a\n\t\t * new texture to the GPU. Use with caution. Consider setting this\n\t\t * property to false temporarily during animations that modify the\n\t\t * scale.</p>\n\t\t *\n\t\t * <p>In the following example, the snapshot will be updated when the\n\t\t * text renderer is scaled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.updateSnapshotOnScaleChange = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic function get updateSnapshotOnScaleChange():Boolean\n\t\t{\n\t\t\treturn this._updateSnapshotOnScaleChange;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set updateSnapshotOnScaleChange(value:Boolean):void\n\t\t{\n\t\t\tif(this._updateSnapshotOnScaleChange == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._updateSnapshotOnScaleChange = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastMeasurementWidth:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastMeasurementHeight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastMeasurementWasTruncated:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textBlockChanged:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this.textSnapshot)\n\t\t\t{\n\t\t\t\tthis.textSnapshot.texture.dispose();\n\t\t\t\tthis.removeChild(this.textSnapshot, true);\n\t\t\t\tthis.textSnapshot = null;\n\t\t\t}\n\t\t\tif(this.textSnapshots)\n\t\t\t{\n\t\t\t\tvar snapshotCount:int = this.textSnapshots.length;\n\t\t\t\tfor(var i:int = 0; i < snapshotCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar snapshot:Image = this.textSnapshots[i];\n\t\t\t\t\tsnapshot.texture.dispose();\n\t\t\t\t\tthis.removeChild(snapshot, true);\n\t\t\t\t}\n\t\t\t\tthis.textSnapshots = null;\n\t\t\t}\n\t\t\t//this isn't necessary, but if a memory leak keeps the text renderer\n\t\t\t//from being garbage collected, freeing up these things may help\n\t\t\t//ease memory pressure from native filters and other expensive stuff\n\t\t\tthis.textBlock = null;\n\t\t\tthis._textLineContainer = null;\n\t\t\tthis._textLines = null;\n\t\t\tthis._measurementTextLineContainer = null;\n\t\t\tthis._measurementTextLines = null;\n\t\t\tthis._textElement = null;\n\t\t\tthis._content = null;\n\n\t\t\tthis._previousLayoutActualWidth = NaN;\n\t\t\tthis._previousLayoutActualHeight = NaN;\n\n\t\t\tthis._needsNewTexture = false;\n\t\t\tthis._snapshotWidth = 0;\n\t\t\tthis._snapshotHeight = 0;\n\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function render(painter:Painter):void\n\t\t{\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tif(this._updateSnapshotOnScaleChange)\n\t\t\t{\n\t\t\t\tthis.getTransformationMatrix(this.stage, HELPER_MATRIX);\n\t\t\t\tvar globalScaleX:Number = matrixToScaleX(HELPER_MATRIX);\n\t\t\t\tvar globalScaleY:Number = matrixToScaleY(HELPER_MATRIX);\n\t\t\t\tif(globalScaleX != this._lastGlobalScaleX ||\n\t\t\t\t\tglobalScaleY != this._lastGlobalScaleY ||\n\t\t\t\t\tstarling.contentScaleFactor != this._lastGlobalContentScaleFactor)\n\t\t\t\t{\n\t\t\t\t\t//the snapshot needs to be updated because the scale has\n\t\t\t\t\t//changed since the last snapshot was taken.\n\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\t\tthis.validate();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._needsTextureUpdate)\n\t\t\t{\n\t\t\t\tthis._needsTextureUpdate = false;\n\t\t\t\tif(this._content !== null)\n\t\t\t\t{\n\t\t\t\t\tthis.refreshSnapshot();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this.textSnapshot !== null)\n\t\t\t{\n\t\t\t\tvar scaleFactor:Number = starling.contentScaleFactor;\n\t\t\t\tif(!this._nativeFilters || this._nativeFilters.length == 0)\n\t\t\t\t{\n\t\t\t\t\tvar offsetX:Number = 0;\n\t\t\t\t\tvar offsetY:Number = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\toffsetX = this._textSnapshotOffsetX / scaleFactor;\n\t\t\t\t\toffsetY = this._textSnapshotOffsetY / scaleFactor;\n\t\t\t\t}\n\t\t\t\toffsetY += this._verticalAlignOffsetY * scaleFactor;\n\n\t\t\t\tvar snapshotIndex:int = -1;\n\t\t\t\tvar totalBitmapWidth:Number = this._snapshotWidth;\n\t\t\t\tvar totalBitmapHeight:Number = this._snapshotHeight;\n\t\t\t\tvar xPosition:Number = offsetX;\n\t\t\t\tvar yPosition:Number = offsetY;\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\tvar currentBitmapWidth:Number = totalBitmapWidth;\n\t\t\t\t\tif(currentBitmapWidth > this._maxTextureDimensions)\n\t\t\t\t\t{\n\t\t\t\t\t\tcurrentBitmapWidth = this._maxTextureDimensions;\n\t\t\t\t\t}\n\t\t\t\t\tdo\n\t\t\t\t\t{\n\t\t\t\t\t\tvar currentBitmapHeight:Number = totalBitmapHeight;\n\t\t\t\t\t\tif(currentBitmapHeight > this._maxTextureDimensions)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcurrentBitmapHeight = this._maxTextureDimensions;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(snapshotIndex < 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar snapshot:Image = this.textSnapshot;\n\t\t\t\t\t\t\tsnapshot.visible = this._snapshotWidth > 0 && this._snapshotHeight > 0 && this._content !== null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsnapshot = this.textSnapshots[snapshotIndex];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsnapshot.pixelSnapping = this._pixelSnapping;\n\t\t\t\t\t\tsnapshot.x = xPosition / scaleFactor;\n\t\t\t\t\t\tsnapshot.y = yPosition / scaleFactor;\n\t\t\t\t\t\tsnapshotIndex++;\n\t\t\t\t\t\tyPosition += currentBitmapHeight;\n\t\t\t\t\t\ttotalBitmapHeight -= currentBitmapHeight;\n\t\t\t\t\t}\n\t\t\t\t\twhile(totalBitmapHeight > 0);\n\t\t\t\t\txPosition += currentBitmapWidth;\n\t\t\t\t\ttotalBitmapWidth -= currentBitmapWidth;\n\t\t\t\t\tyPosition = offsetY;\n\t\t\t\t\ttotalBitmapHeight = this._snapshotHeight;\n\t\t\t\t}\n\t\t\t\twhile(totalBitmapWidth > 0);\n\t\t\t}\n\t\t\tsuper.render(painter);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function measureText(result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight)\n\t\t\t{\n\t\t\t\tresult.x = this._explicitWidth;\n\t\t\t\tresult.y = this._explicitHeight;\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\t//if a parent component validates before we're added to the stage,\n\t\t\t//measureText() may be called before initialization, so we need to\n\t\t\t//force it.\n\t\t\tif(!this._isInitialized)\n\t\t\t{\n\t\t\t\tthis.initializeNow();\n\t\t\t}\n\n\t\t\tthis.commit();\n\n\t\t\tresult = this.measure(result);\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * Gets the advanced <code>ElementFormat</code> font formatting passed\n\t\t * in using <code>setElementFormatForState()</code> for the specified\n\t\t * state.\n\t\t *\n\t\t * <p>If an <code>ElementFormat</code> is not defined for a specific\n\t\t * state, returns <code>null</code>.</p>\n\t\t *\n\t\t * @see #setElementFormatForState()\n\t\t */\n\t\tpublic function getElementFormatForState(state:String):ElementFormat\n\t\t{\n\t\t\tif(this._elementFormatForState === null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn ElementFormat(this._elementFormatForState[state]);\n\t\t}\n\n\t\t/**\n\t\t * Sets the advanced <code>ElementFormat</code> font formatting to be\n\t\t * used by the text renderer when the <code>currentState</code> property\n\t\t * of the <code>stateContext</code> matches the specified state value.\n\t\t * For advanced use cases where <code>starling.text.TextFormat</code>\n\t\t * cannot be used on the parent component because the full capabilities\n\t\t * of Flash Text Engine are required.\n\t\t *\n\t\t * <p>If an <code>ElementFormat</code> is not defined for a specific\n\t\t * state, the value of the <code>elementFormat</code> property will be\n\t\t * used instead.</p>\n\t\t *\n\t\t * <p>If the <code>disabledElementFormat</code> property is not\n\t\t * <code>null</code> and the <code>isEnabled</code> property is\n\t\t * <code>false</code>, all other element formats will be ignored.</p>\n\t\t *\n\t\t * @see #stateContext\n\t\t * @see #elementFormat\n\t\t */\n\t\tpublic function setElementFormatForState(state:String, elementFormat:ElementFormat):void\n\t\t{\n\t\t\tif(elementFormat)\n\t\t\t{\n\t\t\t\tif(!this._elementFormatForState)\n\t\t\t\t{\n\t\t\t\t\tthis._elementFormatForState = {};\n\t\t\t\t}\n\t\t\t\tthis._elementFormatForState[state] = elementFormat;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdelete this._elementFormatForState[state];\n\t\t\t}\n\t\t\t//if the context's current state is the state that we're modifying,\n\t\t\t//we need to use the new value immediately.\n\t\t\tif(this._stateContext && this._stateContext.currentState === state)\n\t\t\t{\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_STATE);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tif(!this.textBlock)\n\t\t\t{\n\t\t\t\tthis.textBlock = new TextBlock();\n\t\t\t}\n\t\t\tif(!this._textLineContainer)\n\t\t\t{\n\t\t\t\tthis._textLineContainer = new Sprite();\n\t\t\t}\n\t\t\tif(!this._measurementTextLineContainer)\n\t\t\t{\n\t\t\t\tthis._measurementTextLineContainer = new Sprite();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\n\t\t\tthis.commit();\n\n\t\t\tsizeInvalid = this.autoSizeIfNeeded() || sizeInvalid;\n\n\t\t\tthis.layout(sizeInvalid);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function commit():void\n\t\t{\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\n\t\t\tif(dataInvalid || stylesInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshElementFormat();\n\t\t\t}\n\n\t\t\tif(stylesInvalid)\n\t\t\t{\n\t\t\t\tthis._textBlockChanged = true;\n\t\t\t\tthis.textBlock.applyNonLinearFontScaling = this._applyNonLinearFontScaling;\n\t\t\t\tthis.textBlock.baselineFontDescription = this._baselineFontDescription;\n\t\t\t\tthis.textBlock.baselineFontSize = this._baselineFontSize;\n\t\t\t\tthis.textBlock.baselineZero = this._baselineZero;\n\t\t\t\tthis.textBlock.bidiLevel = this._bidiLevel;\n\t\t\t\tthis.textBlock.lineRotation = this._lineRotation;\n\t\t\t\tthis.textBlock.tabStops = this._tabStops;\n\t\t\t\tthis.textBlock.textJustifier = this._textJustifier;\n\t\t\t\tthis.textBlock.userData = this._userData;\n\n\t\t\t\tthis._textLineContainer.filters = this._nativeFilters;\n\t\t\t}\n\n\t\t\tif(dataInvalid)\n\t\t\t{\n\t\t\t\tthis._textBlockChanged = true;\n\t\t\t\tthis.textBlock.content = this._content;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function measure(result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tnewWidth = this._explicitMaxWidth;\n\t\t\t}\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tnewHeight = this._explicitMaxHeight;\n\t\t\t}\n\n\t\t\t//sometimes, we can determine that the dimensions will be exactly\n\t\t\t//the same without needing to refresh the text lines. this will\n\t\t\t//result in much better performance.\n\t\t\tif(this._wordWrap)\n\t\t\t{\n\t\t\t\t//when word wrapped, we need to measure again any time that the\n\t\t\t\t//width changes.\n\t\t\t\tvar needsMeasurement:Boolean = newWidth != this._lastMeasurementWidth;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//we can skip measuring again more frequently when the text is\n\t\t\t\t//a single line.\n\n\t\t\t\t//if the width is smaller than the last layout width, we need to\n\t\t\t\t//measure again. when it's larger, the result won't change...\n\t\t\t\tneedsMeasurement = newWidth < this._lastMeasurementWidth;\n\n\t\t\t\t//...unless the text was previously truncated!\n\t\t\t\tneedsMeasurement ||= (this._lastMeasurementWasTruncated && newWidth != this._lastMeasurementWidth);\n\t\t\t}\n\t\t\tif(this._textBlockChanged || needsMeasurement)\n\t\t\t{\n\t\t\t\tthis.refreshTextLines(this._measurementTextLines, this._measurementTextLineContainer, newWidth, newHeight, HELPER_RESULT);\n\t\t\t\tthis._lastMeasurementWidth = HELPER_RESULT.width;\n\t\t\t\tthis._lastMeasurementHeight = HELPER_RESULT.height;\n\t\t\t\tthis._lastMeasurementWasTruncated = HELPER_RESULT.isTruncated;\n\t\t\t\tthis._textBlockChanged = false;\n\t\t\t}\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tnewWidth = Math.ceil(this._measurementTextLineContainer.width);\n\t\t\t\tif(newWidth > this._explicitMaxWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this._explicitMaxWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tnewHeight = Math.ceil(this._lastMeasurementHeight);\n\t\t\t\tif(newHeight <= 0 && this._textElement !== null)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this._textElement.elementFormat.fontSize;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tresult.x = newWidth;\n\t\t\tresult.y = newHeight;\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layout(sizeInvalid:Boolean):void\n\t\t{\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\n\t\t\t//first, we check if something will have changed the appearance of\n\t\t\t//the text lines. they will always need to be refreshed for that.\n\t\t\t//if not, we check if the actualWidth and actualHeight have changed\n\t\t\t//since the last time we did layout. sizeInvalid will often be\n\t\t\t//triggered by changing maxWidth or something for measurement, so we\n\t\t\t//need to be more specific.\n\t\t\tvar contentStateChanged:Boolean = stylesInvalid || dataInvalid || stateInvalid ||\n\t\t\t\tthis.actualWidth != this._previousLayoutActualWidth ||\n\t\t\t\tthis.actualHeight != this._previousLayoutActualHeight;\n\t\t\tif(contentStateChanged)\n\t\t\t{\n\t\t\t\tthis._previousLayoutActualWidth = this.actualWidth;\n\t\t\t\tthis._previousLayoutActualHeight = this.actualHeight;\n\t\t\t\tif(this._content !== null)\n\t\t\t\t{\n\t\t\t\t\tthis.refreshTextLines(this._textLines, this._textLineContainer, this.actualWidth, this.actualHeight, HELPER_RESULT);\n\t\t\t\t\t//since refreshTextLines() isn't called every time that\n\t\t\t\t\t//calculateSnapshotDimensions() is called, we need to save\n\t\t\t\t\t//these values\n\t\t\t\t\tthis._savedTextLinesWidth = HELPER_RESULT.width;\n\t\t\t\t\tthis._savedTextLinesHeight = HELPER_RESULT.height;\n\t\t\t\t\tthis._verticalAlignOffsetY = this.getVerticalAlignOffsetY();\n\t\t\t\t}\n\t\t\t}\n\t\t\t//on the other hand, sizeInvalid will always indicate that the\n\t\t\t//snapshot dimensions need to be revisited\n\t\t\tif(contentStateChanged || sizeInvalid)\n\t\t\t{\n\t\t\t\tthis.calculateSnapshotDimensions();\n\t\t\t}\n\n\t\t\tif(contentStateChanged || this._needsNewTexture)\n\t\t\t{\n\t\t\t\t//we're going to update the texture in render() because\n\t\t\t\t//there's a chance that it will be updated more than once per\n\t\t\t\t//frame if we do it here.\n\t\t\t\tthis._needsTextureUpdate = true;\n\t\t\t\tthis.setRequiresRedraw();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * If the component's dimensions have not been set explicitly, it will\n\t\t * measure its content and determine an ideal size for itself. If the\n\t\t * <code>explicitWidth</code> or <code>explicitHeight</code> member\n\t\t * variables are set, those value will be used without additional\n\t\t * measurement. If one is set, but not the other, the dimension with the\n\t\t * explicit value will not be measured, but the other non-explicit\n\t\t * dimension will still need measurement.\n\t\t *\n\t\t * <p>Calls <code>saveMeasurements()</code> to set up the\n\t\t * <code>actualWidth</code> and <code>actualHeight</code> member\n\t\t * variables used for layout.</p>\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t */\n\t\tprotected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif(needsWidth || needsHeight)\n\t\t\t{\n\t\t\t\t//since the minimum dimensions are based on the regular\n\t\t\t\t//dimensions, we don't need to measure if only minimum\n\t\t\t\t//dimensions are required\n\t\t\t\tthis.measure(HELPER_POINT);\n\t\t\t}\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tnewWidth = HELPER_POINT.x;\n\t\t\t}\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tnewHeight = HELPER_POINT.y;\n\t\t\t}\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tif(needsWidth)\n\t\t\t\t{\n\t\t\t\t\t//this allows wrapping or truncation\n\t\t\t\t\tnewMinWidth = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = newWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tnewMinHeight = newHeight;\n\t\t\t}\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function measureNativeFilters(bitmapData:BitmapData, result:Rectangle = null):Rectangle\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Rectangle();\n\t\t\t}\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar scaleFactor:Number = starling.contentScaleFactor;\n\t\t\tvar resultX:Number = 0;\n\t\t\tvar resultY:Number = 0;\n\t\t\tvar resultWidth:Number = 0;\n\t\t\tvar resultHeight:Number = 0;\n\t\t\tvar filterCount:int = this._nativeFilters.length;\n\t\t\tfor(var i:int = 0; i < filterCount; i++)\n\t\t\t{\n\t\t\t\tvar filter:BitmapFilter = this._nativeFilters[i];\n\t\t\t\tvar filterRect:Rectangle = bitmapData.generateFilterRect(bitmapData.rect, filter);\n\t\t\t\tvar filterX:Number = filterRect.x;\n\t\t\t\tvar filterY:Number = filterRect.y;\n\t\t\t\tvar filterWidth:Number = filterRect.width * scaleFactor;\n\t\t\t\tvar filterHeight:Number = filterRect.height * scaleFactor;\n\t\t\t\tif(resultX > filterX)\n\t\t\t\t{\n\t\t\t\t\tresultX = filterX;\n\t\t\t\t}\n\t\t\t\tif(resultY > filterY)\n\t\t\t\t{\n\t\t\t\t\tresultY = filterY;\n\t\t\t\t}\n\t\t\t\tif(resultWidth < filterWidth)\n\t\t\t\t{\n\t\t\t\t\tresultWidth = filterWidth;\n\t\t\t\t}\n\t\t\t\tif(resultHeight < filterHeight)\n\t\t\t\t{\n\t\t\t\t\tresultHeight = filterHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult.setTo(resultX, resultY, resultWidth, resultHeight);\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshElementFormat():void\n\t\t{\n\t\t\tvar elementFormat:ElementFormat;\n\t\t\tif(this._stateContext !== null)\n\t\t\t{\n\t\t\t\tif(this._elementFormatForState !== null)\n\t\t\t\t{\n\t\t\t\t\tvar currentState:String = this._stateContext.currentState;\n\t\t\t\t\tif(currentState in this._elementFormatForState)\n\t\t\t\t\t{\n\t\t\t\t\t\telementFormat = ElementFormat(this._elementFormatForState[currentState]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(elementFormat === null && this._disabledElementFormat !== null &&\n\t\t\t\t\tthis._stateContext is IFeathersControl && !IFeathersControl(this._stateContext).isEnabled)\n\t\t\t\t{\n\t\t\t\t\telementFormat = this._disabledElementFormat;\n\t\t\t\t}\n\t\t\t\tif(elementFormat === null && this._selectedElementFormat !== null &&\n\t\t\t\t\tthis._stateContext is IToggle && IToggle(this._stateContext).isSelected)\n\t\t\t\t{\n\t\t\t\t\telementFormat = this._selectedElementFormat;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //no state context\n\t\t\t{\n\t\t\t\t//we can still check if the text renderer is disabled to see if\n\t\t\t\t//we should use disabledElementFormat\n\t\t\t\tif(!this._isEnabled && this._disabledElementFormat !== null)\n\t\t\t\t{\n\t\t\t\t\telementFormat = this._disabledElementFormat;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(elementFormat === null)\n\t\t\t{\n\t\t\t\telementFormat = this._elementFormat;\n\t\t\t}\n\t\t\t//ElementFormat is considered more advanced, so it gets precedence\n\t\t\t//over starling.text.TextFormat font styles\n\t\t\tif(elementFormat === null)\n\t\t\t{\n\t\t\t\telementFormat = this.getElementFormatFromFontStyles();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//if using ElementFormat, vertical align is always top\n\t\t\t\tthis._currentVerticalAlign = Align.TOP;\n\t\t\t\t//these are defaults in case textAlign and leading are not set\n\t\t\t\tthis._currentHorizontalAlign = Align.CENTER;\n\t\t\t\tthis._currentLeading = 0;\n\t\t\t}\n\t\t\tif(this._textAlign !== null)\n\t\t\t{\n\t\t\t\tthis._currentHorizontalAlign = this._textAlign;\n\t\t\t}\n\t\t\tif(this._leading === this._leading) //!isNaN\n\t\t\t{\n\t\t\t\tthis._currentLeading = this._leading;\n\t\t\t}\n\t\t\tif(this._textElement === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._textElement.elementFormat !== elementFormat)\n\t\t\t{\n\t\t\t\tthis._textBlockChanged = true;\n\t\t\t\tthis._textElement.elementFormat = elementFormat;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getElementFormatFromFontStyles():ElementFormat\n\t\t{\n\t\t\tif(this.isInvalid(INVALIDATION_FLAG_STYLES) ||\n\t\t\t\tthis.isInvalid(INVALIDATION_FLAG_STATE))\n\t\t\t{\n\t\t\t\tvar textFormat:TextFormat;\n\t\t\t\tif(this._fontStyles !== null)\n\t\t\t\t{\n\t\t\t\t\ttextFormat = this._fontStyles.getTextFormatForTarget(this);\n\t\t\t\t}\n\t\t\t\tif(textFormat !== null)\n\t\t\t\t{\n\t\t\t\t\tvar fontWeight:String = FontWeight.NORMAL;\n\t\t\t\t\tif(textFormat.bold)\n\t\t\t\t\t{\n\t\t\t\t\t\tfontWeight = FontWeight.BOLD;\n\t\t\t\t\t}\n\t\t\t\t\tvar fontPosture:String = FontPosture.NORMAL;\n\t\t\t\t\tif(textFormat.italic)\n\t\t\t\t\t{\n\t\t\t\t\t\tfontPosture = FontPosture.ITALIC;\n\t\t\t\t\t}\n\t\t\t\t\tvar fontLookup:String = FontLookup.DEVICE;\n\t\t\t\t\tif(SystemUtil.isEmbeddedFont(textFormat.font, textFormat.bold, textFormat.italic, FontType.EMBEDDED_CFF))\n\t\t\t\t\t{\n\t\t\t\t\t\tfontLookup = FontLookup.EMBEDDED_CFF;\n\t\t\t\t\t}\n\t\t\t\t\tvar fontDescription:FontDescription =\n\t\t\t\t\t\tnew FontDescription(textFormat.font, fontWeight, fontPosture, fontLookup);\n\t\t\t\t\tthis._fontStylesElementFormat = new ElementFormat(fontDescription, textFormat.size, textFormat.color);\n\t\t\t\t\tif(textFormat.kerning)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._fontStylesElementFormat.kerning = Kerning.ON;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._fontStylesElementFormat.kerning = Kerning.OFF;\n\t\t\t\t\t}\n\t\t\t\t\tvar letterSpacing:Number = textFormat.letterSpacing / 2;\n\t\t\t\t\t//adobe documentation recommends splitting it between\n\t\t\t\t\t//left and right\n\t\t\t\t\t//http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/engine/ElementFormat.html#trackingRight\n\t\t\t\t\tthis._fontStylesElementFormat.trackingRight = letterSpacing;\n\t\t\t\t\tthis._fontStylesElementFormat.trackingLeft = letterSpacing;\n\t\t\t\t\tthis._currentLeading = textFormat.leading;\n\t\t\t\t\tthis._currentVerticalAlign = textFormat.verticalAlign;\n\t\t\t\t\tthis._currentHorizontalAlign = textFormat.horizontalAlign;\n\t\t\t\t}\n\t\t\t\telse if(this._fontStylesElementFormat === null)\n\t\t\t\t{\n\t\t\t\t\t//fallback to a default so that something is displayed\n\t\t\t\t\tthis._fontStylesElementFormat = new ElementFormat();\n\t\t\t\t\tthis._currentLeading = 0;\n\t\t\t\t\tthis._currentVerticalAlign = Align.TOP;\n\t\t\t\t\tthis._currentHorizontalAlign = Align.LEFT;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this._fontStylesElementFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createTextureOnRestoreCallback(snapshot:Image):void\n\t\t{\n\t\t\tvar self:TextBlockTextRenderer = this;\n\t\t\tvar texture:Texture = snapshot.texture;\n\t\t\ttexture.root.onRestore = function():void\n\t\t\t{\n\t\t\t\tvar starling:Starling = self.stage !== null ? self.stage.starling : Starling.current;\n\t\t\t\tvar scaleFactor:Number = starling.contentScaleFactor;\n\t\t\t\tif(texture.scale != scaleFactor)\n\t\t\t\t{\n\t\t\t\t\t//if we've changed between scale factors, we need to\n\t\t\t\t\t//recreate the texture to match the new scale factor.\n\t\t\t\t\tinvalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tHELPER_MATRIX.identity();\n\t\t\t\t\tHELPER_MATRIX.scale(scaleFactor, scaleFactor);\n\t\t\t\t\tvar offsetY:Number = self.getVerticalAlignOffsetY();\n\t\t\t\t\tvar bitmapData:BitmapData = self.drawTextLinesRegionToBitmapData(\n\t\t\t\t\t\tsnapshot.x, snapshot.y - offsetY, texture.nativeWidth, texture.nativeHeight);\n\t\t\t\t\ttexture.root.uploadBitmapData(bitmapData);\n\t\t\t\t\tbitmapData.dispose();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function drawTextLinesRegionToBitmapData(textLinesX:Number, textLinesY:Number,\n\t\t\tbitmapWidth:Number, bitmapHeight:Number, bitmapData:BitmapData = null):BitmapData\n\t\t{\n\t\t\tvar clipWidth:Number = this._snapshotVisibleWidth - textLinesX;\n\t\t\tvar clipHeight:Number = this._snapshotVisibleHeight - textLinesY;\n\t\t\tif(!bitmapData || bitmapData.width != bitmapWidth || bitmapData.height != bitmapHeight)\n\t\t\t{\n\t\t\t\tif(bitmapData)\n\t\t\t\t{\n\t\t\t\t\tbitmapData.dispose();\n\t\t\t\t}\n\t\t\t\tbitmapData = new BitmapData(bitmapWidth, bitmapHeight, true, 0x00ff00ff);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//clear the bitmap data and reuse it\n\t\t\t\tbitmapData.fillRect(bitmapData.rect, 0x00ff00ff);\n\t\t\t}\n\t\t\tvar nativeScaleFactor:Number = 1;\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tif(starling && starling.supportHighResolutions)\n\t\t\t{\n\t\t\t\tnativeScaleFactor = starling.nativeStage.contentsScaleFactor;\n\t\t\t}\n\t\t\tHELPER_MATRIX.tx = -textLinesX - this._textSnapshotScrollX * nativeScaleFactor - this._textSnapshotOffsetX;\n\t\t\tHELPER_MATRIX.ty = -textLinesY - this._textSnapshotScrollY * nativeScaleFactor - this._textSnapshotOffsetY;\n\t\t\tvar rect:Rectangle = Pool.getRectangle(0, 0, clipWidth, clipHeight);\n\t\t\tbitmapData.draw(this._textLineContainer, HELPER_MATRIX, null, null, rect);\n\t\t\tPool.putRectangle(rect);\n\t\t\treturn bitmapData;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function calculateSnapshotDimensions():void\n\t\t{\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar scaleFactor:Number = starling.contentScaleFactor;\n\t\t\tthis._lastGlobalContentScaleFactor = scaleFactor;\n\t\t\t//these are getting put into an int later, so we don't want it\n\t\t\t//to possibly round down and cut off part of the text.\n\t\t\tif(this._savedTextLinesWidth < this.actualWidth)\n\t\t\t{\n\t\t\t\tvar rectangleSnapshotWidth:Number = Math.ceil(this._savedTextLinesWidth * scaleFactor);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\trectangleSnapshotWidth = Math.ceil(this.actualWidth * scaleFactor);\n\t\t\t}\n\t\t\tif(this._savedTextLinesHeight < this.actualHeight)\n\t\t\t{\n\t\t\t\tvar rectangleSnapshotHeight:Number = Math.ceil(this._savedTextLinesHeight * scaleFactor);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\trectangleSnapshotHeight = Math.ceil(this.actualHeight * scaleFactor);\n\t\t\t}\n\t\t\tif(this._updateSnapshotOnScaleChange)\n\t\t\t{\n\t\t\t\tthis.getTransformationMatrix(this.stage, HELPER_MATRIX);\n\t\t\t\tthis._lastGlobalScaleX = matrixToScaleX(HELPER_MATRIX);\n\t\t\t\tthis._lastGlobalScaleY = matrixToScaleY(HELPER_MATRIX);\n\t\t\t\trectangleSnapshotWidth *= this._lastGlobalScaleX;\n\t\t\t\trectangleSnapshotHeight *= this._lastGlobalScaleY;\n\t\t\t}\n\t\t\tif(rectangleSnapshotWidth >= 1 && rectangleSnapshotHeight >= 1 &&\n\t\t\t\tthis._nativeFilters !== null && this._nativeFilters.length > 0)\n\t\t\t{\n\t\t\t\trectangleSnapshotWidth = this._textSnapshotNativeFiltersWidth;\n\t\t\t\trectangleSnapshotHeight = this._textSnapshotNativeFiltersHeight;\n\t\t\t}\n\t\t\tvar point:Point = Pool.getPoint();\n\t\t\tcalculateSnapshotTextureDimensions(rectangleSnapshotWidth,\n\t\t\t\trectangleSnapshotHeight, this._maxTextureDimensions,\n\t\t\t\tstarling.profile !== Context3DProfile.BASELINE_CONSTRAINED, point);\n\t\t\t//the full dimensions of the texture\n\t\t\tthis._snapshotWidth = point.x;\n\t\t\tthis._snapshotHeight = point.y;\n\t\t\t//the clipping dimensions of the texture, if it is next power-of-two\n\t\t\tthis._snapshotVisibleWidth = rectangleSnapshotWidth;\n\t\t\tthis._snapshotVisibleHeight = rectangleSnapshotHeight;\n\t\t\tPool.putPoint(point);\n\n\t\t\tvar textureRoot:ConcreteTexture = this.textSnapshot ? this.textSnapshot.texture.root : null;\n\t\t\tthis._needsNewTexture = this._needsNewTexture || this.textSnapshot === null ||\n\t\t\t\t(textureRoot !== null && (textureRoot.scale != scaleFactor ||\n\t\t\t\tthis._snapshotWidth != textureRoot.nativeWidth || this._snapshotHeight != textureRoot.nativeHeight));\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshSnapshot():void\n\t\t{\n\t\t\tif(this._snapshotWidth <= 0 || this._snapshotHeight <= 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar scaleFactor:Number = starling.contentScaleFactor;\n\t\t\tif(this._updateSnapshotOnScaleChange)\n\t\t\t{\n\t\t\t\tthis.getTransformationMatrix(this.stage, HELPER_MATRIX);\n\t\t\t\tvar globalScaleX:Number = matrixToScaleX(HELPER_MATRIX);\n\t\t\t\tvar globalScaleY:Number = matrixToScaleY(HELPER_MATRIX);\n\t\t\t}\n\t\t\tHELPER_MATRIX.identity();\n\t\t\tHELPER_MATRIX.scale(scaleFactor, scaleFactor);\n\t\t\tif(this._updateSnapshotOnScaleChange)\n\t\t\t{\n\t\t\t\tHELPER_MATRIX.scale(globalScaleX, globalScaleY);\n\t\t\t}\n\t\t\tvar totalBitmapWidth:Number = this._snapshotWidth;\n\t\t\tvar totalBitmapHeight:Number = this._snapshotHeight;\n\t\t\tvar xPosition:Number = 0;\n\t\t\tvar yPosition:Number = 0;\n\t\t\tvar bitmapData:BitmapData;\n\t\t\tvar snapshotIndex:int = -1;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tvar currentBitmapWidth:Number = totalBitmapWidth;\n\t\t\t\tif(currentBitmapWidth > this._maxTextureDimensions)\n\t\t\t\t{\n\t\t\t\t\tcurrentBitmapWidth = this._maxTextureDimensions;\n\t\t\t\t}\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\tvar currentBitmapHeight:Number = totalBitmapHeight;\n\t\t\t\t\tif(currentBitmapHeight > this._maxTextureDimensions)\n\t\t\t\t\t{\n\t\t\t\t\t\tcurrentBitmapHeight = this._maxTextureDimensions;\n\t\t\t\t\t}\n\t\t\t\t\tbitmapData = this.drawTextLinesRegionToBitmapData(xPosition, yPosition,\n\t\t\t\t\t\tcurrentBitmapWidth, currentBitmapHeight, bitmapData);\n\t\t\t\t\tvar newTexture:Texture;\n\t\t\t\t\tif(!this.textSnapshot || this._needsNewTexture)\n\t\t\t\t\t{\n\t\t\t\t\t\t//skip Texture.fromBitmapData() because we don't want\n\t\t\t\t\t\t//it to create an onRestore function that will be\n\t\t\t\t\t\t//immediately discarded for garbage collection.\n\t\t\t\t\t\tnewTexture = Texture.empty(bitmapData.width / scaleFactor, bitmapData.height / scaleFactor,\n\t\t\t\t\t\t\ttrue, false, false, scaleFactor);\n\t\t\t\t\t\tnewTexture.root.uploadBitmapData(bitmapData);\n\t\t\t\t\t}\n\t\t\t\t\tvar snapshot:Image = null;\n\t\t\t\t\tif(snapshotIndex >= 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(!this.textSnapshots)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.textSnapshots = new <Image>[];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(this.textSnapshots.length > snapshotIndex)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsnapshot = this.textSnapshots[snapshotIndex];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tsnapshot = this.textSnapshot;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!snapshot)\n\t\t\t\t\t{\n\t\t\t\t\t\tsnapshot = new Image(newTexture);\n\t\t\t\t\t\tthis.addChild(snapshot);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._needsNewTexture)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsnapshot.texture.dispose();\n\t\t\t\t\t\t\tsnapshot.texture = newTexture;\n\t\t\t\t\t\t\tsnapshot.readjustSize();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//this is faster, if we haven't resized the bitmapdata\n\t\t\t\t\t\t\tvar existingTexture:Texture = snapshot.texture;\n\t\t\t\t\t\t\texistingTexture.root.uploadBitmapData(bitmapData);\n\t\t\t\t\t\t\t//however, the image won't be notified that its\n\t\t\t\t\t\t\t//texture has changed, so we need to do it manually\n\t\t\t\t\t\t\tthis.textSnapshot.setRequiresRedraw();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(newTexture)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.createTextureOnRestoreCallback(snapshot);\n\t\t\t\t\t}\n\t\t\t\t\tif(snapshotIndex >= 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.textSnapshots[snapshotIndex] = snapshot;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.textSnapshot = snapshot;\n\t\t\t\t\t}\n\t\t\t\t\tsnapshot.x = xPosition / scaleFactor;\n\t\t\t\t\tsnapshot.y = yPosition / scaleFactor;\n\t\t\t\t\tif(this._updateSnapshotOnScaleChange)\n\t\t\t\t\t{\n\t\t\t\t\t\tsnapshot.scaleX = 1 / globalScaleX;\n\t\t\t\t\t\tsnapshot.scaleY = 1 / globalScaleY;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tsnapshot.scale = 1;\n\t\t\t\t\t}\n\t\t\t\t\tsnapshotIndex++;\n\t\t\t\t\tyPosition += currentBitmapHeight;\n\t\t\t\t\ttotalBitmapHeight -= currentBitmapHeight;\n\t\t\t\t}\n\t\t\t\twhile(totalBitmapHeight > 0);\n\t\t\t\txPosition += currentBitmapWidth;\n\t\t\t\ttotalBitmapWidth -= currentBitmapWidth;\n\t\t\t\tyPosition = 0;\n\t\t\t\ttotalBitmapHeight = this._snapshotHeight;\n\t\t\t}\n\t\t\twhile(totalBitmapWidth > 0);\n\t\t\tbitmapData.dispose();\n\t\t\tif(this.textSnapshots)\n\t\t\t{\n\t\t\t\tvar snapshotCount:int = this.textSnapshots.length;\n\t\t\t\tfor(var i:int = snapshotIndex; i < snapshotCount; i++)\n\t\t\t\t{\n\t\t\t\t\tsnapshot = this.textSnapshots[i];\n\t\t\t\t\tsnapshot.texture.dispose();\n\t\t\t\t\tsnapshot.removeFromParent(true);\n\t\t\t\t}\n\t\t\t\tif(snapshotIndex == 0)\n\t\t\t\t{\n\t\t\t\t\tthis.textSnapshots = null;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.textSnapshots.length = snapshotIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._updateSnapshotOnScaleChange)\n\t\t\t{\n\t\t\t\tthis._lastGlobalScaleX = globalScaleX;\n\t\t\t\tthis._lastGlobalScaleY = globalScaleY;\n\t\t\t\tthis._lastGlobalContentScaleFactor = scaleFactor;\n\t\t\t}\n\t\t\tthis._needsNewTexture = false;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * the ascent alone doesn't account for diacritical marks,\n\t\t * like accents and things. however, increasing the ascent by\n\t\t * the value of the descent seems to be a good approximation.\n\t\t */\n\t\tprotected function calculateLineAscent(line:TextLine):Number\n\t\t{\n\t\t\tvar calculatedAscent:Number = line.ascent + line.descent;\n\t\t\tif(line.totalAscent > calculatedAscent)\n\t\t\t{\n\t\t\t\tcalculatedAscent = line.totalAscent;\n\t\t\t}\n\t\t\treturn calculatedAscent;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshTextElementText():void\n\t\t{\n\t\t\tif(this._textElement === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar newText:String = this._text;\n\t\t\tif(newText !== null && newText.length > 0)\n\t\t\t{\n\t\t\t\tif(newText.charAt(newText.length - 1) === \" \")\n\t\t\t\t{\n\t\t\t\t\t//add an invisible control character because FTE apparently\n\t\t\t\t\t//doesn't think that it's important to include trailing\n\t\t\t\t\t//spaces in its width measurement.\n\t\t\t\t\tnewText += String.fromCharCode(3);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//similar to above. this hack ensures that the baseline is\n\t\t\t\t//measured properly when the text is an empty string.\n\t\t\t\tnewText = String.fromCharCode(3);\n\t\t\t}\n\t\t\tthis._textElement.text = newText;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshTextLines(textLines:Vector.<TextLine>,\n\t\t\ttextLineParent:DisplayObjectContainer, width:Number, height:Number,\n\t\t\tresult:MeasureTextResult = null):MeasureTextResult\n\t\t{\n\t\t\t//clamp the width and height values to a valid range so that it\n\t\t\t//doesn't break the measurement\n\t\t\tif(width < 0)\n\t\t\t{\n\t\t\t\twidth = 0;\n\t\t\t}\n\t\t\telse if(width > MAX_TEXT_LINE_WIDTH)\n\t\t\t{\n\t\t\t\twidth = MAX_TEXT_LINE_WIDTH;\n\t\t\t}\n\t\t\tif(height < 0)\n\t\t\t{\n\t\t\t\theight = 0;\n\t\t\t}\n\n\t\t\tvar lineCount:int = textLines.length;\n\t\t\t//copy the invalid text lines over to the helper vector so that we\n\t\t\t//can reuse them\n\t\t\tHELPER_TEXT_LINES.length = 0;\n\t\t\tfor(var i:int = 0; i < lineCount; i++)\n\t\t\t{\n\t\t\t\tHELPER_TEXT_LINES[i] = textLines[i];\n\t\t\t}\n\t\t\ttextLines.length = 0;\n\n\t\t\tthis.refreshTextElementText();\n\n\t\t\tvar wasTruncated:Boolean = false;\n\t\t\tvar maxLineWidth:Number = 0;\n\t\t\tvar yPosition:Number = 0;\n\t\t\tif(width >= 0)\n\t\t\t{\n\t\t\t\tvar line:TextLine = null;\n\t\t\t\tvar lineStartIndex:int = 0;\n\t\t\t\tvar canTruncate:Boolean = this._truncateToFit && this._textElement && !this._wordWrap;\n\t\t\t\tvar pushIndex:int = textLines.length;\n\t\t\t\tvar inactiveTextLineCount:int = HELPER_TEXT_LINES.length;\n\t\t\t\twhile(true)\n\t\t\t\t{\n\t\t\t\t\tthis._truncationOffset = 0;\n\t\t\t\t\tvar previousLine:TextLine = line;\n\t\t\t\t\tvar lineWidth:Number = width;\n\t\t\t\t\tif(!this._wordWrap)\n\t\t\t\t\t{\n\t\t\t\t\t\tlineWidth = MAX_TEXT_LINE_WIDTH;\n\t\t\t\t\t}\n\t\t\t\t\tif(inactiveTextLineCount > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar inactiveLine:TextLine = HELPER_TEXT_LINES[0];\n\t\t\t\t\t\tline = this.textBlock.recreateTextLine(inactiveLine, previousLine, lineWidth, 0, true);\n\t\t\t\t\t\tif(line)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tHELPER_TEXT_LINES.shift();\n\t\t\t\t\t\t\tinactiveTextLineCount--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tline = this.textBlock.createTextLine(previousLine, lineWidth, 0, true);\n\t\t\t\t\t\tif(line)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttextLineParent.addChild(line);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(!line)\n\t\t\t\t\t{\n\t\t\t\t\t\t//end of text\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tvar lineLength:int = line.rawTextLength;\n\t\t\t\t\tvar isTruncated:Boolean = false;\n\t\t\t\t\tvar difference:Number = 0;\n\t\t\t\t\twhile(canTruncate && (difference = line.width - width) > FUZZY_TRUNCATION_DIFFERENCE)\n\t\t\t\t\t{\n\t\t\t\t\t\tisTruncated = true;\n\t\t\t\t\t\tif(this._truncationOffset == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//this will quickly skip all of the characters after\n\t\t\t\t\t\t\t//the maximum width of the line, instead of going\n\t\t\t\t\t\t\t//one by one.\n\t\t\t\t\t\t\tvar endIndex:int = line.getAtomIndexAtPoint(width, 0);\n\t\t\t\t\t\t\tif(endIndex >= 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis._truncationOffset = line.rawTextLength - endIndex;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._truncationOffset++;\n\t\t\t\t\t\tvar truncatedTextLength:int = lineLength - this._truncationOffset;\n\t\t\t\t\t\t//we want to start at this line so that the previous\n\t\t\t\t\t\t//lines don't become invalid.\n\t\t\t\t\t\tvar truncatedText:String = this._text.substr(lineStartIndex, truncatedTextLength) + this._truncationText;\n\t\t\t\t\t\tvar lineBreakIndex:int = this._text.indexOf(LINE_FEED, lineStartIndex);\n\t\t\t\t\t\tif(lineBreakIndex < 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlineBreakIndex = this._text.indexOf(CARRIAGE_RETURN, lineStartIndex);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(lineBreakIndex >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttruncatedText += this._text.substr(lineBreakIndex);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._textElement.text = truncatedText;\n\t\t\t\t\t\tline = this.textBlock.recreateTextLine(line, null, lineWidth, 0, true);\n\t\t\t\t\t\tif(truncatedTextLength <= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(pushIndex > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tyPosition += this._currentLeading;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(line.width > maxLineWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tmaxLineWidth = line.width;\n\t\t\t\t\t}\n\t\t\t\t\tyPosition += this.calculateLineAscent(line);\n\t\t\t\t\tline.y = yPosition;\n\t\t\t\t\tyPosition += line.totalDescent;\n\t\t\t\t\ttextLines[pushIndex] = line;\n\t\t\t\t\tpushIndex++;\n\t\t\t\t\tlineStartIndex += lineLength;\n\t\t\t\t\twasTruncated ||= isTruncated;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(textLines !== this._measurementTextLines)\n\t\t\t{\n\t\t\t\t//no need to align the measurement text lines because they won't\n\t\t\t\t//be rendered\n\t\t\t\tthis.alignTextLines(textLines, width, this._currentHorizontalAlign);\n\t\t\t}\n\t\t\tif(this._currentHorizontalAlign === Align.RIGHT)\n\t\t\t{\n\t\t\t\tmaxLineWidth = width;\n\t\t\t}\n\t\t\telse if(this._currentHorizontalAlign === Align.CENTER)\n\t\t\t{\n\t\t\t\tmaxLineWidth = (width + maxLineWidth) / 2;\n\t\t\t}\n\n\t\t\tinactiveTextLineCount = HELPER_TEXT_LINES.length;\n\t\t\tfor(i = 0; i < inactiveTextLineCount; i++)\n\t\t\t{\n\t\t\t\tline = HELPER_TEXT_LINES[i];\n\t\t\t\ttextLineParent.removeChild(line);\n\t\t\t}\n\t\t\tHELPER_TEXT_LINES.length = 0;\n\t\t\tif(result === null)\n\t\t\t{\n\t\t\t\tresult = new MeasureTextResult(maxLineWidth, yPosition, wasTruncated);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult.width = maxLineWidth;\n\t\t\t\tresult.height = yPosition;\n\t\t\t\tresult.isTruncated = wasTruncated;\n\t\t\t}\n\n\t\t\tif(textLines !== this._measurementTextLines)\n\t\t\t{\n\t\t\t\tif(result.width >= 1 && result.height >= 1 &&\n\t\t\t\t\tthis._nativeFilters !== null && this._nativeFilters.length > 0)\n\t\t\t\t{\n\t\t\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\t\t\tvar scaleFactor:Number = starling.contentScaleFactor;\n\t\t\t\t\tHELPER_MATRIX.identity();\n\t\t\t\t\tHELPER_MATRIX.scale(scaleFactor, scaleFactor);\n\t\t\t\t\tvar bitmapData:BitmapData = new BitmapData(result.width, result.height, true, 0x00ff00ff);\n\t\t\t\t\tvar rect:Rectangle = Pool.getRectangle();\n\t\t\t\t\tbitmapData.draw(this._textLineContainer, HELPER_MATRIX, null, null, rect);\n\t\t\t\t\tthis.measureNativeFilters(bitmapData, rect);\n\t\t\t\t\tbitmapData.dispose();\n\t\t\t\t\tbitmapData = null;\n\t\t\t\t\tthis._textSnapshotOffsetX = rect.x;\n\t\t\t\t\tthis._textSnapshotOffsetY = rect.y;\n\t\t\t\t\tthis._textSnapshotNativeFiltersWidth = rect.width;\n\t\t\t\t\tthis._textSnapshotNativeFiltersHeight = rect.height;\n\t\t\t\t\tPool.putRectangle(rect);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._textSnapshotOffsetX = 0;\n\t\t\t\t\tthis._textSnapshotOffsetY = 0;\n\t\t\t\t\tthis._textSnapshotNativeFiltersWidth = 0;\n\t\t\t\t\tthis._textSnapshotNativeFiltersHeight = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getVerticalAlignOffsetY():Number\n\t\t{\n\t\t\tif(this._savedTextLinesHeight > this.actualHeight)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tif(this._currentVerticalAlign === Align.BOTTOM)\n\t\t\t{\n\t\t\t\treturn (this.actualHeight - this._savedTextLinesHeight);\n\t\t\t}\n\t\t\telse if(this._currentVerticalAlign === Align.CENTER)\n\t\t\t{\n\t\t\t\treturn (this.actualHeight - this._savedTextLinesHeight) / 2;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function alignTextLines(textLines:Vector.<TextLine>, width:Number, textAlign:String):void\n\t\t{\n\t\t\tvar lineCount:int = textLines.length;\n\t\t\tfor(var i:int = 0; i < lineCount; i++)\n\t\t\t{\n\t\t\t\tvar line:TextLine = textLines[i];\n\t\t\t\tif(textAlign == HorizontalAlign.CENTER)\n\t\t\t\t{\n\t\t\t\t\tline.x = (width - line.width) / 2;\n\t\t\t\t}\n\t\t\t\telse if(textAlign == HorizontalAlign.RIGHT)\n\t\t\t\t{\n\t\t\t\t\tline.x = width - line.width;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tline.x = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/text/TextFieldTextEditor.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.text\n{\n\timport feathers.core.BaseTextEditor;\n\timport feathers.core.FocusManager;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.INativeFocusOwner;\n\timport feathers.core.ITextEditor;\n\timport feathers.events.FeathersEventType;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.utils.geom.matrixToRotation;\n\timport feathers.utils.geom.matrixToScaleX;\n\timport feathers.utils.geom.matrixToScaleY;\n\n\timport flash.display.BitmapData;\n\timport flash.display.Stage;\n\timport flash.display3D.Context3DProfile;\n\timport flash.events.FocusEvent;\n\timport flash.events.KeyboardEvent;\n\timport flash.events.SoftKeyboardEvent;\n\timport flash.geom.Matrix;\n\timport flash.geom.Matrix3D;\n\timport flash.geom.Point;\n\timport flash.geom.Rectangle;\n\timport flash.geom.Vector3D;\n\timport flash.text.AntiAliasType;\n\timport flash.text.FontType;\n\timport flash.text.GridFitType;\n\timport flash.text.TextField;\n\timport flash.text.TextFieldAutoSize;\n\timport flash.text.TextFieldType;\n\timport flash.text.TextFormat;\n\timport flash.ui.Keyboard;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.display.Image;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.rendering.Painter;\n\timport starling.text.TextFormat;\n\timport starling.textures.ConcreteTexture;\n\timport starling.textures.Texture;\n\timport starling.utils.Align;\n\timport starling.utils.MathUtil;\n\timport starling.utils.MatrixUtil;\n\timport starling.utils.Pool;\n\timport starling.utils.SystemUtil;\n\n\t/**\n\t * Dispatched when the text property changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #text\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the user presses the Enter key while the editor has focus.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.ENTER\n\t */\n\t[Event(name=\"enter\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the text editor receives focus.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.FOCUS_IN\n\t */\n\t[Event(name=\"focusIn\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the text editor loses focus.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.FOCUS_OUT\n\t */\n\t[Event(name=\"focusOut\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the soft keyboard is about to activate. Not all text\n\t * editors will activate a soft keyboard.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.SOFT_KEYBOARD_ACTIVATING\n\t */\n\t[Event(name=\"softKeyboardActivating\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the soft keyboard is activated. Not all text editors will\n\t * activate a soft keyboard.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.SOFT_KEYBOARD_ACTIVATE\n\t */\n\t[Event(name=\"softKeyboardActivate\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the soft keyboard is deactivated. Not all text editors\n\t * will activate a soft keyboard.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.SOFT_KEYBOARD_DEACTIVATE\n\t */\n\t[Event(name=\"softKeyboardDeactivate\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Text that may be edited at runtime by the user with the\n\t * <code>TextInput</code> component, using the native\n\t * <code>flash.text.TextField</code> class with its <code>type</code>\n\t * property set to <code>flash.text.TextInputType.INPUT</code>. When not in\n\t * focus, the <code>TextField</code> is drawn to <code>BitmapData</code> and\n\t * uploaded to a texture on the GPU. Textures are managed internally by this\n\t * component, and they will be automatically disposed when the component is\n\t * disposed.\n\t *\n\t * <p>For desktop apps, <code>TextFieldTextEditor</code> is recommended\n\t * instead of <code>StageTextTextEditor</code>. <code>StageTextTextEditor</code>\n\t * will still work in desktop apps, but it is more appropriate for mobile\n\t * apps.</p>\n\t *\n\t * <p>The following example shows how to use\n\t * <code>TextFieldTextEditor</code> with a <code>TextInput</code>:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var input:TextInput = new TextInput();\n\t * input.textEditorFactory = function():ITextEditor\n\t * {\n\t *     return new TextFieldTextEditor();\n\t * };\n\t * this.addChild( input );</listing>\n\t *\n\t * @see feathers.controls.TextInput\n\t * @see ../../../../help/text-editors.html Introduction to Feathers text editors\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html flash.text.TextField\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class TextFieldTextEditor extends BaseTextEditor implements ITextEditor, INativeFocusOwner\n\t{\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>TextFieldTextEditor</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function TextFieldTextEditor()\n\t\t{\n\t\t\tthis.isQuickHitAreaEnabled = true;\n\t\t\tthis.addEventListener(Event.ADDED_TO_STAGE, textEditor_addedToStageHandler);\n\t\t\tthis.addEventListener(Event.REMOVED_FROM_STAGE, textEditor_removedFromStageHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * The text field sub-component.\n\t\t */\n\t\tprotected var textField:TextField;\n\n\t\t/**\n\t\t * @copy feathers.core.INativeFocusOwner#nativeFocus\n\t\t */\n\t\tpublic function get nativeFocus():Object\n\t\t{\n\t\t\treturn this.textField;\n\t\t}\n\n\t\t/**\n\t\t * An image that displays a snapshot of the native <code>TextField</code>\n\t\t * in the Starling display list when the editor doesn't have focus.\n\t\t */\n\t\tprotected var textSnapshot:Image;\n\n\t\t/**\n\t\t * The separate text field sub-component used for measurement.\n\t\t * Typically, the main text field often doesn't report correct values\n\t\t * for a full frame if its dimensions are changed too often.\n\t\t */\n\t\tprotected var measureTextField:TextField;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _snapshotWidth:int = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _snapshotHeight:int = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textFieldSnapshotClipRect:Rectangle = new Rectangle();\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textFieldOffsetX:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textFieldOffsetY:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastGlobalScaleX:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastGlobalScaleY:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _needsTextureUpdate:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _needsNewTexture:Boolean = false;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get baseline():Number\n\t\t{\n\t\t\tif(!this.textField)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tvar gutterDimensionsOffset:Number = 0;\n\t\t\tif(this._useGutter || this._border)\n\t\t\t{\n\t\t\t\tgutterDimensionsOffset = 2;\n\t\t\t}\n\t\t\treturn gutterDimensionsOffset + this.textField.getLineMetrics(0).ascent;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _previousStarlingTextFormat:starling.text.TextFormat;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentStarlingTextFormat:starling.text.TextFormat;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _previousTextFormat:flash.text.TextFormat;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentTextFormat:flash.text.TextFormat;\n\n\t\t/**\n\t\t * For debugging purposes, the current\n\t\t * <code>flash.text.TextFormat</code> used to render the text. Updated\n\t\t * during validation, and may be <code>null</code> before the first\n\t\t * validation.\n\t\t *\n\t\t * <p>Do not modify this value. It is meant for testing and debugging\n\t\t * only. Use the parent's <code>starling.text.TextFormat</code> font\n\t\t * styles APIs instead.</p>\n\t\t */\n\t\tpublic function get currentTextFormat():flash.text.TextFormat\n\t\t{\n\t\t\treturn this._currentTextFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textFormatForState:Object;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fontStylesTextFormat:flash.text.TextFormat;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textFormat:flash.text.TextFormat;\n\n\t\t/**\n\t\t * Advanced font formatting used to draw the text, if\n\t\t * <code>fontStyles</code> and <code>starling.text.TextFormat</code>\n\t\t * cannot be used on the parent component because the full capabilities\n\t\t * of <code>flash.text.TextField</code> are required.\n\t\t *\n\t\t * <p>In the following example, the text format is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.textFormat = new TextFormat( \"Source Sans Pro\" );;</listing>\n\t\t *\n\t\t * <p><strong>Warning:</strong> If this property is not\n\t\t * <code>null</code>, any <code>starling.text.TextFormat</code> font\n\t\t * styles that are passed in from the parent component may be ignored.\n\t\t * In other words, advanced font styling with\n\t\t * <code>flash.text.TextFormat</code> will always take precedence.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #setTextFormatForState()\n\t\t * @see #disabledTextFormat\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextFormat.html flash.text.TextFormat\n\t\t */\n\t\tpublic function get textFormat():flash.text.TextFormat\n\t\t{\n\t\t\treturn this._textFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set textFormat(value:flash.text.TextFormat):void\n\t\t{\n\t\t\tif(this._textFormat == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textFormat = value;\n\t\t\t//since the text format has changed, the comparison will return\n\t\t\t//false whether we use the real previous format or null. might as\n\t\t\t//well remove the reference to an object we don't need anymore.\n\t\t\tthis._previousTextFormat = null;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _disabledTextFormat:flash.text.TextFormat;\n\n\t\t/**\n\t\t * Advanced font formatting used to draw the text when the component is\n\t\t * disabled, if <code>disabledFontStyles</code> and\n\t\t * <code>starling.text.TextFormat</code> cannot be used on the parent\n\t\t * component because the full capabilities of\n\t\t * <code>flash.text.TextField</code> are required.\n\t\t *\n\t\t * <p>In the following example, the disabled text format is changed:</p>\n\t\t *\n\t\t * <p><strong>Warning:</strong> If this property is not\n\t\t * <code>null</code>, any <code>starling.text.TextFormat</code> font\n\t\t * styles that are passed in from the parent component may be ignored.\n\t\t * In other words, advanced font styling with\n\t\t * <code>flash.text.TextFormat</code> will always take precedence.</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.isEnabled = false;\n\t\t * textEditor.disabledTextFormat = new TextFormat( \"Source Sans Pro\" );</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #textFormat\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextFormat.html flash.text.TextFormat\n\t\t */\n\t\tpublic function get disabledTextFormat():flash.text.TextFormat\n\t\t{\n\t\t\treturn this._disabledTextFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disabledTextFormat(value:flash.text.TextFormat):void\n\t\t{\n\t\t\tif(this._disabledTextFormat == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._disabledTextFormat = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _embedFonts:Boolean = false;\n\n\t\t/**\n\t\t * If advanced <code>flash.text.TextFormat</code> styles are specified,\n\t\t * determines if the TextField should use an embedded font or not. If\n\t\t * the specified font is not embedded, the text may not be displayed at\n\t\t * all.\n\t\t *\n\t\t * <p>If the font styles are passed in from the parent component, the\n\t\t * text renderer will automatically detect if a font is embedded or not,\n\t\t * and the <code>embedFonts</code> property will be ignored if it is set\n\t\t * to <code>false</code>. Setting it to <code>true</code> will force the\n\t\t * <code>TextField</code> to always try to use embedded fonts.</p>\n\t\t *\n\t\t * <p>In the following example, the font is embedded:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.embedFonts = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#embedFonts Full description of flash.text.TextField.embedFonts in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get embedFonts():Boolean\n\t\t{\n\t\t\treturn this._embedFonts;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set embedFonts(value:Boolean):void\n\t\t{\n\t\t\tif(this._embedFonts == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._embedFonts = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _wordWrap:Boolean = false;\n\n\t\t/**\n\t\t * Determines if the TextField wraps text to the next line.\n\t\t *\n\t\t * <p>In the following example, word wrap is enabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.wordWrap = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#wordWrap Full description of flash.text.TextField.wordWrap in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get wordWrap():Boolean\n\t\t{\n\t\t\treturn this._wordWrap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set wordWrap(value:Boolean):void\n\t\t{\n\t\t\tif(this._wordWrap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._wordWrap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _multiline:Boolean = false;\n\n\t\t/**\n\t\t * Indicates whether field is a multiline text field.\n\t\t *\n\t\t * <p>In the following example, multiline is enabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.multiline = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#multiline Full description of flash.text.TextField.multiline in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get multiline():Boolean\n\t\t{\n\t\t\treturn this._multiline;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set multiline(value:Boolean):void\n\t\t{\n\t\t\tif(this._multiline == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._multiline = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isHTML:Boolean = false;\n\n\t\t/**\n\t\t * Determines if the TextField should display the value of the\n\t\t * <code>text</code> property as HTML or not.\n\t\t *\n\t\t * <p>In the following example, the text is displayed as HTML:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.isHTML = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#htmlText flash.text.TextField.htmlText\n\t\t */\n\t\tpublic function get isHTML():Boolean\n\t\t{\n\t\t\treturn this._isHTML;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isHTML(value:Boolean):void\n\t\t{\n\t\t\tif(this._isHTML == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isHTML = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _alwaysShowSelection:Boolean = false;\n\n\t\t/**\n\t\t * When set to <code>true</code> and the text field is not in focus,\n\t\t * Flash Player highlights the selection in the text field in gray. When\n\t\t * set to <code>false</code> and the text field is not in focus, Flash\n\t\t * Player does not highlight the selection in the text field.\n\t\t *\n\t\t * <p>In the following example, the selection is always shown:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.alwaysShowSelection = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#alwaysShowSelection Full description of flash.text.TextField.alwaysShowSelection in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get alwaysShowSelection():Boolean\n\t\t{\n\t\t\treturn this._alwaysShowSelection;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set alwaysShowSelection(value:Boolean):void\n\t\t{\n\t\t\tif(this._alwaysShowSelection == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._alwaysShowSelection = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _displayAsPassword:Boolean = false;\n\n\t\t/**\n\t\t * <p>This property is managed by the <code>TextInput</code>.</p>\n\t\t *\n\t\t * Specifies whether the text field is a password text field that hides\n\t\t * the input characters using asterisks instead of the actual\n\t\t * characters.\n\t\t *\n\t\t * @see feathers.controls.TextInput#displayAsPassword\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#displayAsPassword Full description of flash.text.TextField.displayAsPassword in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get displayAsPassword():Boolean\n\t\t{\n\t\t\treturn this._displayAsPassword;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set displayAsPassword(value:Boolean):void\n\t\t{\n\t\t\tif(this._displayAsPassword == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._displayAsPassword = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maxChars:int = 0;\n\n\t\t/**\n\t\t * <p>This property is managed by the <code>TextInput</code>.</p>\n\t\t *\n\t\t * @copy feathers.controls.TextInput#maxChars\n\t\t *\n\t\t * @see feathers.controls.TextInput#maxChars\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#maxChars Full description of flash.text.TextField.maxChars in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get maxChars():int\n\t\t{\n\t\t\treturn this._maxChars;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maxChars(value:int):void\n\t\t{\n\t\t\tif(this._maxChars == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._maxChars = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _restrict:String;\n\n\t\t/**\n\t\t * <p>This property is managed by the <code>TextInput</code>.</p>\n\t\t *\n\t\t * @copy feathers.controls.TextInput#restrict\n\t\t *\n\t\t * @see feathers.controls.TextInput#restrict\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#restrict Full description of flash.text.TextField.restrict in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get restrict():String\n\t\t{\n\t\t\treturn this._restrict;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set restrict(value:String):void\n\t\t{\n\t\t\tif(this._restrict == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._restrict = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isEditable:Boolean = true;\n\n\t\t/**\n\t\t * <p>This property is managed by the <code>TextInput</code>.</p>\n\t\t *\n\t\t * @copy feathers.controls.TextInput#isEditable\n\t\t *\n\t\t * @see feathers.controls.TextInput#isEditable\n\t\t */\n\t\tpublic function get isEditable():Boolean\n\t\t{\n\t\t\treturn this._isEditable;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isEditable(value:Boolean):void\n\t\t{\n\t\t\tif(this._isEditable == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isEditable = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isSelectable:Boolean = true;\n\n\t\t/**\n\t\t * <p>This property is managed by the <code>TextInput</code>.</p>\n\t\t *\n\t\t * @copy feathers.controls.TextInput#isSelectable\n\t\t *\n\t\t * @see feathers.controls.TextInput#isSelectable\n\t\t */\n\t\tpublic function get isSelectable():Boolean\n\t\t{\n\t\t\treturn this._isSelectable;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isSelectable(value:Boolean):void\n\t\t{\n\t\t\tif(this._isSelectable == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isSelectable = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _antiAliasType:String = AntiAliasType.ADVANCED;\n\n\t\t/**\n\t\t * The type of anti-aliasing used for this text field, defined as\n\t\t * constants in the <code>flash.text.AntiAliasType</code> class. You can\n\t\t * control this setting only if the font is embedded (with the\n\t\t * <code>embedFonts</code> property set to true).\n\t\t *\n\t\t * <p>In the following example, the anti-alias type is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.antiAliasType = AntiAliasType.NORMAL;</listing>\n\t\t *\n\t\t * @default flash.text.AntiAliasType.ADVANCED\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#antiAliasType Full description of flash.text.TextField.antiAliasType in Adobe's Flash Platform API Reference\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/AntiAliasType.html flash.text.AntiAliasType\n\t\t * @see #embedFonts\n\t\t */\n\t\tpublic function get antiAliasType():String\n\t\t{\n\t\t\treturn this._antiAliasType;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set antiAliasType(value:String):void\n\t\t{\n\t\t\tif(this._antiAliasType == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._antiAliasType = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _gridFitType:String = GridFitType.PIXEL;\n\n\t\t/**\n\t\t * Determines whether Flash Player forces strong horizontal and vertical\n\t\t * lines to fit to a pixel or subpixel grid, or not at all using the\n\t\t * constants defined in the <code>flash.text.GridFitType</code> class.\n\t\t * This property applies only if the <code>antiAliasType</code> property\n\t\t * of the text field is set to <code>flash.text.AntiAliasType.ADVANCED</code>.\n\t\t *\n\t\t * <p>In the following example, the grid fit type is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.gridFitType = GridFitType.SUBPIXEL;</listing>\n\t\t *\n\t\t * @default flash.text.GridFitType.PIXEL\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#gridFitType Full description of flash.text.TextField.gridFitType in Adobe's Flash Platform API Reference\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/GridFitType.html flash.text.GridFitType\n\t\t * @see #antiAliasType\n\t\t */\n\t\tpublic function get gridFitType():String\n\t\t{\n\t\t\treturn this._gridFitType;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set gridFitType(value:String):void\n\t\t{\n\t\t\tif(this._gridFitType == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._gridFitType = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _sharpness:Number = 0;\n\n\t\t/**\n\t\t * The sharpness of the glyph edges in this text field. This property\n\t\t * applies only if the <code>antiAliasType</code> property of the text\n\t\t * field is set to <code>flash.text.AntiAliasType.ADVANCED</code>. The\n\t\t * range for <code>sharpness</code> is a number from <code>-400</code>\n\t\t * to <code>400</code>.\n\t\t *\n\t\t * <p>In the following example, the sharpness is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.sharpness = 200;</listing>\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#sharpness Full description of flash.text.TextField.sharpness in Adobe's Flash Platform API Reference\n\t\t * @see #antiAliasType\n\t\t */\n\t\tpublic function get sharpness():Number\n\t\t{\n\t\t\treturn this._sharpness;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set sharpness(value:Number):void\n\t\t{\n\t\t\tif(this._sharpness == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._sharpness = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _thickness:Number = 0;\n\n\t\t/**\n\t\t * The thickness of the glyph edges in this text field. This property\n\t\t * applies only if the <code>antiAliasType</code> property is set to\n\t\t * <code>flash.text.AntiAliasType.ADVANCED</code>. The range for\n\t\t * <code>thickness</code> is a number from <code>-200</code> to\n\t\t * <code>200</code>.\n\t\t *\n\t\t * <p>In the following example, the thickness is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.thickness = 100;</listing>\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#thickness Full description of flash.text.TextField.thickness in Adobe's Flash Platform API Reference\n\t\t * @see #antiAliasType\n\t\t */\n\t\tpublic function get thickness():Number\n\t\t{\n\t\t\treturn this._thickness;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set thickness(value:Number):void\n\t\t{\n\t\t\tif(this._thickness == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._thickness = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _background:Boolean = false;\n\n\t\t/**\n\t\t * Specifies whether the text field has a background fill. Use the\n\t\t * <code>backgroundColor</code> property to set the background color of\n\t\t * a text field.\n\t\t *\n\t\t * <p>In the following example, the background is enabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.background = true;\n\t\t * textRenderer.backgroundColor = 0xff0000;</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#background Full description of flash.text.TextField.background in Adobe's Flash Platform API Reference\n\t\t * @see #backgroundColor\n\t\t */\n\t\tpublic function get background():Boolean\n\t\t{\n\t\t\treturn this._background;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set background(value:Boolean):void\n\t\t{\n\t\t\tif(this._background == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._background = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _backgroundColor:uint = 0xffffff;\n\n\t\t/**\n\t\t * The color of the text field background that is displayed if the\n\t\t * <code>background</code> property is set to <code>true</code>.\n\t\t *\n\t\t * <p>In the following example, the background color is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.background = true;\n\t\t * textRenderer.backgroundColor = 0xff000ff;</listing>\n\t\t *\n\t\t * @default 0xffffff\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#backgroundColor Full description of flash.text.TextField.backgroundColor in Adobe's Flash Platform API Reference\n\t\t * @see #background\n\t\t */\n\t\tpublic function get backgroundColor():uint\n\t\t{\n\t\t\treturn this._backgroundColor;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundColor(value:uint):void\n\t\t{\n\t\t\tif(this._backgroundColor == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._backgroundColor = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _border:Boolean = false;\n\n\t\t/**\n\t\t * Specifies whether the text field has a border. Use the\n\t\t * <code>borderColor</code> property to set the border color.\n\t\t *\n\t\t * <p>Note: If <code>border</code> is set to <code>true</code>, the\n\t\t * component will behave as if <code>useGutter</code> is also set to\n\t\t * <code>true</code> because the border will not render correctly\n\t\t * without the gutter.</p>\n\t\t *\n\t\t * <p>In the following example, the border is enabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.border = true;\n\t\t * textRenderer.borderColor = 0xff0000;</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#border Full description of flash.text.TextField.border in Adobe's Flash Platform API Reference\n\t\t * @see #borderColor\n\t\t */\n\t\tpublic function get border():Boolean\n\t\t{\n\t\t\treturn this._border;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set border(value:Boolean):void\n\t\t{\n\t\t\tif(this._border == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._border = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _borderColor:uint = 0x000000;\n\n\t\t/**\n\t\t * The color of the text field border that is displayed if the\n\t\t * <code>border</code> property is set to <code>true</code>.\n\t\t *\n\t\t * <p>In the following example, the border color is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.border = true;\n\t\t * textRenderer.borderColor = 0xff00ff;</listing>\n\t\t *\n\t\t * @default 0x000000\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#borderColor Full description of flash.text.TextField.borderColor in Adobe's Flash Platform API Reference\n\t\t * @see #border\n\t\t */\n\t\tpublic function get borderColor():uint\n\t\t{\n\t\t\treturn this._borderColor;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set borderColor(value:uint):void\n\t\t{\n\t\t\tif(this._borderColor == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._borderColor = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _useGutter:Boolean = false;\n\n\t\t/**\n\t\t * Determines if the 2-pixel gutter around the edges of the\n\t\t * <code>flash.text.TextField</code> will be used in measurement and\n\t\t * layout. To visually align with other text renderers and text editors,\n\t\t * it is often best to leave the gutter disabled.\n\t\t *\n\t\t * <p>Returns <code>true</code> if the <code>border</code> property is\n\t\t * <code>true</code>.</p>\n\t\t *\n\t\t * <p>In the following example, the gutter is enabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.useGutter = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic function get useGutter():Boolean\n\t\t{\n\t\t\treturn this._useGutter || this._border;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set useGutter(value:Boolean):void\n\t\t{\n\t\t\tif(this._useGutter == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._useGutter = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get setTouchFocusOnEndedPhase():Boolean\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textFieldHasFocus:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isWaitingToSetFocus:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _pendingSelectionBeginIndex:int = -1;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get selectionBeginIndex():int\n\t\t{\n\t\t\tif(this._pendingSelectionBeginIndex >= 0)\n\t\t\t{\n\t\t\t\treturn this._pendingSelectionBeginIndex;\n\t\t\t}\n\t\t\tif(this.textField)\n\t\t\t{\n\t\t\t\treturn this.textField.selectionBeginIndex;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _pendingSelectionEndIndex:int = -1;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get selectionEndIndex():int\n\t\t{\n\t\t\tif(this._pendingSelectionEndIndex >= 0)\n\t\t\t{\n\t\t\t\treturn this._pendingSelectionEndIndex;\n\t\t\t}\n\t\t\tif(this.textField)\n\t\t\t{\n\t\t\t\treturn this.textField.selectionEndIndex;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maintainTouchFocus:Boolean = false;\n\n\t\t/**\n\t\t * If enabled, the text editor will remain in focus, even if something\n\t\t * else is touched.\n\t\t *\n\t\t * <p>Note: If the <code>FocusManager</code> is enabled, this property\n\t\t * will be ignored.</p>\n\t\t *\n\t\t * <p>In the following example, touch focus is maintained:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.maintainTouchFocus = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t */\n\t\toverride public function get maintainTouchFocus():Boolean\n\t\t{\n\t\t\treturn this._maintainTouchFocus;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maintainTouchFocus(value:Boolean):void\n\t\t{\n\t\t\tthis._maintainTouchFocus = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _updateSnapshotOnScaleChange:Boolean = false;\n\n\t\t/**\n\t\t * Refreshes the texture snapshot every time that the text editor is\n\t\t * scaled. Based on the scale in global coordinates, so scaling the\n\t\t * parent will require a new snapshot.\n\t\t *\n\t\t * <p>Warning: setting this property to true may result in reduced\n\t\t * performance because every change of the scale requires uploading a\n\t\t * new texture to the GPU. Use with caution. Consider setting this\n\t\t * property to false temporarily during animations that modify the\n\t\t * scale.</p>\n\t\t *\n\t\t * <p>In the following example, the snapshot will be updated when the\n\t\t * text editor is scaled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.updateSnapshotOnScaleChange = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic function get updateSnapshotOnScaleChange():Boolean\n\t\t{\n\t\t\treturn this._updateSnapshotOnScaleChange;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set updateSnapshotOnScaleChange(value:Boolean):void\n\t\t{\n\t\t\tif(this._updateSnapshotOnScaleChange == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._updateSnapshotOnScaleChange = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _useSnapshotDelayWorkaround:Boolean = false;\n\n\t\t/**\n\t\t * Fixes an issue where <code>flash.text.TextField</code> renders\n\t\t * incorrectly when drawn to <code>BitmapData</code> by waiting one\n\t\t * frame.\n\t\t *\n\t\t * <p>Warning: enabling this workaround may cause slight flickering\n\t\t * after the <code>text</code> property is changed.</p>\n\t\t *\n\t\t * <p>In the following example, the workaround is enabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.useSnapshotDelayWorkaround = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic function get useSnapshotDelayWorkaround():Boolean\n\t\t{\n\t\t\treturn this._useSnapshotDelayWorkaround;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set useSnapshotDelayWorkaround(value:Boolean):void\n\t\t{\n\t\t\tif(this._useSnapshotDelayWorkaround == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._useSnapshotDelayWorkaround = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _softKeyboard:String = \"default\"; //constant is available in AIR only\n\n\t\t/**\n\t\t * Customizes the soft keyboard that is displayed on a touch screen\n\t\t * when the text editor has focus.\n\t\t *\n\t\t * <p>In the following example, the soft keyboard type is customized:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.softKeyboard = SoftKeyboardType.NUMBER;</listing>\n\t\t *\n\t\t * @default flash.text.SoftKeyboardType.DEFAULT\n\t\t *\n\t\t * @see https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/SoftKeyboardType.html flash.text.SoftKeyboardType\n\t\t */\n\t\tpublic function get softKeyboard():String\n\t\t{\n\t\t\treturn this._softKeyboard;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set softKeyboard(value:String):void\n\t\t{\n\t\t\tif(this._softKeyboard === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._softKeyboard = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _resetScrollOnFocusOut:Boolean = true;\n\n\t\t/**\n\t\t * Indicates of the text editor resets its current scroll position to\n\t\t * 0 on focus out.\n\t\t *\n\t\t * <p>In the following example, the scroll position is not reset on focus out:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.resetScrollOnFocusOut = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic function get resetScrollOnFocusOut():Boolean\n\t\t{\n\t\t\treturn this._resetScrollOnFocusOut;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set resetScrollOnFocusOut(value:Boolean):void\n\t\t{\n\t\t\tthis._resetScrollOnFocusOut = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this.textSnapshot)\n\t\t\t{\n\t\t\t\t//avoid the need to call dispose(). we'll create a new snapshot\n\t\t\t\t//when the renderer is added to stage again.\n\t\t\t\tthis.textSnapshot.texture.dispose();\n\t\t\t\tthis.removeChild(this.textSnapshot, true);\n\t\t\t\tthis.textSnapshot = null;\n\t\t\t}\n\n\t\t\tif(this.textField)\n\t\t\t{\n\t\t\t\tif(this.textField.parent)\n\t\t\t\t{\n\t\t\t\t\tthis.textField.parent.removeChild(this.textField);\n\t\t\t\t}\n\t\t\t\tthis.textField.removeEventListener(flash.events.Event.CHANGE, textField_changeHandler);\n\t\t\t\tthis.textField.removeEventListener(FocusEvent.FOCUS_IN, textField_focusInHandler);\n\t\t\t\tthis.textField.removeEventListener(FocusEvent.FOCUS_OUT, textField_focusOutHandler);\n\t\t\t\tthis.textField.removeEventListener(KeyboardEvent.KEY_DOWN, textField_keyDownHandler);\n\t\t\t\tthis.textField.removeEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATING, textField_softKeyboardActivatingHandler);\n\t\t\t\tthis.textField.removeEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATE, textField_softKeyboardActivateHandler);\n\t\t\t\tthis.textField.removeEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_DEACTIVATE, textField_softKeyboardDeactivateHandler);\n\t\t\t}\n\t\t\t//this isn't necessary, but if a memory leak keeps the text renderer\n\t\t\t//from being garbage collected, freeing up the text field may help\n\t\t\t//ease major memory pressure from native filters\n\t\t\tthis.textField = null;\n\t\t\tthis.measureTextField = null;\n\n\t\t\tthis.stateContext = null;\n\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function render(painter:Painter):void\n\t\t{\n\t\t\tif(this.textSnapshot !== null && this._updateSnapshotOnScaleChange)\n\t\t\t{\n\t\t\t\tvar matrix:Matrix = Pool.getMatrix();\n\t\t\t\tthis.getTransformationMatrix(this.stage, matrix);\n\t\t\t\tif(matrixToScaleX(matrix) != this._lastGlobalScaleX ||\n\t\t\t\t\tmatrixToScaleY(matrix) != this._lastGlobalScaleY)\n\t\t\t\t{\n\t\t\t\t\t//the snapshot needs to be updated because the scale has\n\t\t\t\t\t//changed since the last snapshot was taken.\n\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\t\tthis.validate();\n\t\t\t\t}\n\t\t\t\tPool.putMatrix(matrix);\n\t\t\t}\n\t\t\tif(this._needsTextureUpdate)\n\t\t\t{\n\t\t\t\tthis._needsTextureUpdate = false;\n\t\t\t\tif(this._useSnapshotDelayWorkaround)\n\t\t\t\t{\n\t\t\t\t\t//sometimes, we need to wait a frame for flash.text.TextField\n\t\t\t\t\t//to render properly when drawing to BitmapData.\n\t\t\t\t\tthis.addEventListener(Event.ENTER_FRAME, refreshSnapshot_enterFrameHandler);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.refreshSnapshot();\n\t\t\t\t}\n\t\t\t\tthis.positionSnapshot();\n\t\t\t}\n\t\t\t//we'll skip this if the text field isn't visible to avoid running\n\t\t\t//that code every frame.\n\t\t\tif(this.textField && this.textField.visible)\n\t\t\t{\n\t\t\t\tthis.transformTextField();\n\t\t\t}\n\t\t\tsuper.render(painter);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function setFocus(position:Point = null):void\n\t\t{\n\t\t\tif(this.textField !== null)\n\t\t\t{\n\t\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\t\tif(this.textField.parent === null)\n\t\t\t\t{\n\t\t\t\t\tstarling.nativeStage.addChild(this.textField);\n\t\t\t\t}\n\t\t\t\tif(position !== null)\n\t\t\t\t{\n\t\t\t\t\tvar nativeScaleFactor:Number = 1;\n\t\t\t\t\tif(starling.supportHighResolutions)\n\t\t\t\t\t{\n\t\t\t\t\t\tnativeScaleFactor = starling.nativeStage.contentsScaleFactor;\n\t\t\t\t\t}\n\t\t\t\t\tvar scaleFactor:Number = starling.contentScaleFactor / nativeScaleFactor;\n\t\t\t\t\tvar scaleX:Number = this.textField.scaleX;\n\t\t\t\t\tvar scaleY:Number = this.textField.scaleY;\n\t\t\t\t\tvar gutterPositionOffset:Number = 2;\n\t\t\t\t\tif(this._useGutter || this._border)\n\t\t\t\t\t{\n\t\t\t\t\t\tgutterPositionOffset = 0;\n\t\t\t\t\t}\n\t\t\t\t\tvar positionX:Number = position.x + gutterPositionOffset;\n\t\t\t\t\tvar positionY:Number = position.y + gutterPositionOffset;\n\t\t\t\t\tif(positionX < gutterPositionOffset)\n\t\t\t\t\t{\n\t\t\t\t\t\t//account for negative positions\n\t\t\t\t\t\tpositionX = gutterPositionOffset;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar maxPositionX:Number = (this.textField.width / scaleX) - gutterPositionOffset;\n\t\t\t\t\t\tif(positionX > maxPositionX)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpositionX = maxPositionX;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(positionY < gutterPositionOffset)\n\t\t\t\t\t{\n\t\t\t\t\t\t//account for negative positions\n\t\t\t\t\t\tpositionY = gutterPositionOffset;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar maxPositionY:Number = (this.textField.height / scaleY) - gutterPositionOffset;\n\t\t\t\t\t\tif(positionY > maxPositionY)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpositionY = maxPositionY;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis._pendingSelectionBeginIndex = this.getSelectionIndexAtPoint(positionX, positionY);\n\t\t\t\t\tif(this._pendingSelectionBeginIndex < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._multiline)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar lineIndex:int = this.textField.getLineIndexAtPoint((this.textField.width / 2) / scaleX, positionY);\n\t\t\t\t\t\t\ttry\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis._pendingSelectionBeginIndex = this.textField.getLineOffset(lineIndex) + this.textField.getLineLength(lineIndex);\n\t\t\t\t\t\t\t\tif(this._pendingSelectionBeginIndex != this._text.length)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tthis._pendingSelectionBeginIndex--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcatch(error:Error)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//we may be checking for a line beyond the\n\t\t\t\t\t\t\t\t//end that doesn't exist\n\t\t\t\t\t\t\t\tthis._pendingSelectionBeginIndex = this._text.length;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._pendingSelectionBeginIndex = this.getSelectionIndexAtPoint(positionX, this.textField.getLineMetrics(0).ascent / 2);\n\t\t\t\t\t\t\tif(this._pendingSelectionBeginIndex < 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis._pendingSelectionBeginIndex = this._text.length;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar bounds:Rectangle = this.textField.getCharBoundaries(this._pendingSelectionBeginIndex);\n\t\t\t\t\t\t//bounds should never be null because the character\n\t\t\t\t\t\t//index passed to getCharBoundaries() comes from a\n\t\t\t\t\t\t//call to getCharIndexAtPoint(). however, a user\n\t\t\t\t\t\t//reported that a null reference error happened\n\t\t\t\t\t\t//here! I couldn't reproduce, but I might as well\n\t\t\t\t\t\t//assume that the runtime has a bug. won't hurt.\n\t\t\t\t\t\tif(bounds)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar boundsX:Number = bounds.x;\n\t\t\t\t\t\t\tif(bounds && (boundsX + bounds.width - positionX) < (positionX - boundsX))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis._pendingSelectionBeginIndex++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis._pendingSelectionEndIndex = this._pendingSelectionBeginIndex;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._pendingSelectionBeginIndex = this._pendingSelectionEndIndex = -1;\n\t\t\t\t}\n\t\t\t\tif(!FocusManager.isEnabledForStage(this.stage))\n\t\t\t\t{\n\t\t\t\t\tstarling.nativeStage.focus = this.textField;\n\t\t\t\t}\n\t\t\t\tthis.textField.requestSoftKeyboard();\n\t\t\t\tif(this._textFieldHasFocus)\n\t\t\t\t{\n\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SELECTED);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._isWaitingToSetFocus = true;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function clearFocus():void\n\t\t{\n\t\t\tif(!this._textFieldHasFocus)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar nativeStage:Stage = starling.nativeStage;\n\t\t\tif(nativeStage.focus === this.textField)\n\t\t\t{\n\t\t\t\t//only clear the native focus when our native target has focus\n\t\t\t\t//because otherwise another component may lose focus.\n\n\t\t\t\t//setting the focus to Starling.current.nativeStage doesn't work\n\t\t\t\t//here, so we need to use null. on Android, if we give focus to the\n\t\t\t\t//nativeStage, focus will be removed from the StageText, but the\n\t\t\t\t//soft keyboard will incorrectly remain open.\n\t\t\t\tnativeStage.focus = null;\n\n\t\t\t\t//previously, there was a comment here that said that the native\n\t\t\t\t//stage focus should not be set to null. this was due to an\n\t\t\t\t//issue in focus manager where focus would be restored\n\t\t\t\t//incorrectly if the stage focus became null. this issue was\n\t\t\t\t//fixed, and it is now considered safe to use null.\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function selectRange(beginIndex:int, endIndex:int):void\n\t\t{\n\t\t\tif(!this._isEditable && !this._isSelectable)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this.textField)\n\t\t\t{\n\t\t\t\tif(!this._isValidating)\n\t\t\t\t{\n\t\t\t\t\tthis.validate();\n\t\t\t\t}\n\t\t\t\tthis.textField.setSelection(beginIndex, endIndex);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._pendingSelectionBeginIndex = beginIndex;\n\t\t\t\tthis._pendingSelectionEndIndex = endIndex;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function measureText(result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight)\n\t\t\t{\n\t\t\t\tresult.x = this._explicitWidth;\n\t\t\t\tresult.y = this._explicitHeight;\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\t//if a parent component validates before we're added to the stage,\n\t\t\t//measureText() may be called before initialization, so we need to\n\t\t\t//force it.\n\t\t\tif(!this._isInitialized)\n\t\t\t{\n\t\t\t\tthis.initializeNow();\n\t\t\t}\n\n\t\t\tthis.commit();\n\n\t\t\tresult = this.measure(result);\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * Gets the advanced <code>flash.text.TextFormat</code> font formatting\n\t\t * passed in using <code>setTextFormatForState()</code> for the\n\t\t * specified state.\n\t\t *\n\t\t * <p>If an <code>flash.text.TextFormat</code> is not defined for a\n\t\t * specific state, returns <code>null</code>.</p>\n\t\t *\n\t\t * @see #setTextFormatForState()\n\t\t */\n\t\tpublic function getTextFormatForState(state:String):flash.text.TextFormat\n\t\t{\n\t\t\tif(this._textFormatForState === null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn flash.text.TextFormat(this._textFormatForState[state]);\n\t\t}\n\n\t\t/**\n\t\t * Sets the advanced <code>flash.text.TextFormat</code> font formatting\n\t\t * to be used by the text editor when the <code>currentState</code>\n\t\t * property of the <code>stateContext</code> matches the specified state\n\t\t * value.\n\t\t *\n\t\t * <p>If an <code>TextFormat</code> is not defined for a specific\n\t\t * state, the value of the <code>textFormat</code> property will be\n\t\t * used instead.</p>\n\t\t *\n\t\t * <p>If the <code>disabledTextFormat</code> property is not\n\t\t * <code>null</code> and the <code>isEnabled</code> property is\n\t\t * <code>false</code>, all other text formats will be ignored.</p>\n\t\t *\n\t\t * @see #stateContext\n\t\t * @see #textFormat\n\t\t */\n\t\tpublic function setTextFormatForState(state:String, textFormat:flash.text.TextFormat):void\n\t\t{\n\t\t\tif(textFormat)\n\t\t\t{\n\t\t\t\tif(!this._textFormatForState)\n\t\t\t\t{\n\t\t\t\t\tthis._textFormatForState = {};\n\t\t\t\t}\n\t\t\t\tthis._textFormatForState[state] = textFormat;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdelete this._textFormatForState[state];\n\t\t\t}\n\t\t\t//if the context's current state is the state that we're modifying,\n\t\t\t//we need to use the new value immediately.\n\t\t\tif(this._stateContext && this._stateContext.currentState === state)\n\t\t\t{\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_STATE);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tthis.textField = new TextField();\n\t\t\t//let's ensure that the text field can only get keyboard focus\n\t\t\t//through code. no need to set mouseEnabled to false since the text\n\t\t\t//field won't be visible until it needs to be interactive, so it\n\t\t\t//can't receive focus with mouse/touch anyway.\n\t\t\tthis.textField.tabEnabled = false;\n\t\t\tthis.textField.visible = false;\n\t\t\tthis.textField.needsSoftKeyboard = true;\n\t\t\tthis.textField.addEventListener(flash.events.Event.CHANGE, textField_changeHandler);\n\t\t\tthis.textField.addEventListener(FocusEvent.FOCUS_IN, textField_focusInHandler);\n\t\t\tthis.textField.addEventListener(FocusEvent.FOCUS_OUT, textField_focusOutHandler);\n\t\t\tthis.textField.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, textField_mouseFocusChangeHandler);\n\t\t\tthis.textField.addEventListener(KeyboardEvent.KEY_DOWN, textField_keyDownHandler);\n\t\t\tthis.textField.addEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATING, textField_softKeyboardActivatingHandler);\n\t\t\tthis.textField.addEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATE, textField_softKeyboardActivateHandler);\n\t\t\tthis.textField.addEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_DEACTIVATE, textField_softKeyboardDeactivateHandler);\n\t\t\t//when adding more events here, don't forget to remove them when the\n\t\t\t//text editor is disposed\n\n\t\t\tthis.measureTextField = new TextField();\n\t\t\tthis.measureTextField.autoSize = TextFieldAutoSize.LEFT;\n\t\t\tthis.measureTextField.selectable = false;\n\t\t\tthis.measureTextField.tabEnabled = false;\n\t\t\tthis.measureTextField.mouseWheelEnabled = false;\n\t\t\tthis.measureTextField.mouseEnabled = false;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\n\t\t\tthis.commit();\n\n\t\t\tsizeInvalid = this.autoSizeIfNeeded() || sizeInvalid;\n\n\t\t\tthis.layout(sizeInvalid);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function commit():void\n\t\t{\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\n\t\t\tif(dataInvalid || stylesInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshTextFormat();\n\t\t\t\tthis.commitStylesAndData(this.textField);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * If the component's dimensions have not been set explicitly, it will\n\t\t * measure its content and determine an ideal size for itself. If the\n\t\t * <code>explicitWidth</code> or <code>explicitHeight</code> member\n\t\t * variables are set, those value will be used without additional\n\t\t * measurement. If one is set, but not the other, the dimension with the\n\t\t * explicit value will not be measured, but the other non-explicit\n\t\t * dimension will still need measurement.\n\t\t *\n\t\t * <p>Calls <code>saveMeasurements()</code> to set up the\n\t\t * <code>actualWidth</code> and <code>actualHeight</code> member\n\t\t * variables used for layout.</p>\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t */\n\t\tprotected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvar point:Point = Pool.getPoint();\n\t\t\tthis.measure(point);\n\t\t\tvar result:Boolean = this.saveMeasurements(point.x, point.y, point.x, point.y);\n\t\t\tPool.putPoint(point);\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function measure(result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\n\t\t\tif(!needsWidth && !needsHeight)\n\t\t\t{\n\t\t\t\tresult.x = this._explicitWidth;\n\t\t\t\tresult.y = this._explicitHeight;\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tthis.commitStylesAndData(this.measureTextField);\n\n\t\t\tvar gutterDimensionsOffset:Number = 4;\n\t\t\tif(this._useGutter || this._border)\n\t\t\t{\n\t\t\t\tgutterDimensionsOffset = 0;\n\t\t\t}\n\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tthis.measureTextField.wordWrap = false;\n\t\t\t\tnewWidth = this.measureTextField.width - gutterDimensionsOffset;\n\t\t\t\tif(newWidth < this._explicitMinWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this._explicitMinWidth;\n\t\t\t\t}\n\t\t\t\telse if(newWidth > this._explicitMaxWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this._explicitMaxWidth;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tthis.measureTextField.wordWrap = this._wordWrap;\n\t\t\t\tthis.measureTextField.width = newWidth + gutterDimensionsOffset;\n\t\t\t\tnewHeight = this.measureTextField.height - gutterDimensionsOffset;\n\t\t\t\tif(this._useGutter || this._border)\n\t\t\t\t{\n\t\t\t\t\tnewHeight += 4;\n\t\t\t\t}\n\t\t\t\tif(newHeight < this._explicitMinHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this._explicitMinHeight;\n\t\t\t\t}\n\t\t\t\telse if(newHeight > this._explicitMaxHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this._explicitMaxHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tresult.x = newWidth;\n\t\t\tresult.y = newHeight;\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function commitStylesAndData(textField:TextField):void\n\t\t{\n\t\t\ttextField.antiAliasType = this._antiAliasType;\n\t\t\ttextField.background = this._background;\n\t\t\ttextField.backgroundColor = this._backgroundColor;\n\t\t\ttextField.border = this._border;\n\t\t\ttextField.borderColor = this._borderColor;\n\t\t\ttextField.gridFitType = this._gridFitType;\n\t\t\ttextField.sharpness = this._sharpness;\n\t\t\ttextField.thickness = this._thickness;\n\t\t\ttextField.maxChars = this._maxChars;\n\t\t\ttextField.restrict = this._restrict;\n\t\t\ttextField.alwaysShowSelection = this._alwaysShowSelection;\n\t\t\ttextField.displayAsPassword = this._displayAsPassword;\n\t\t\ttextField.wordWrap = this._wordWrap;\n\t\t\ttextField.multiline = this._multiline;\n\t\t\t//The softKeyboard property is not available in Flash Player.\n\t\t\t//It's only available in AIR.\n\t\t\tif(\"softKeyboard\" in textField)\n\t\t\t{\n\t\t\t\ttextField[\"softKeyboard\"] = this._softKeyboard;\n\t\t\t}\n\t\t\tif(!this._embedFonts &&\n\t\t\t\tthis._currentTextFormat === this._fontStylesTextFormat)\n\t\t\t{\n\t\t\t\t//when font styles are passed in from the parent component, we\n\t\t\t\t//automatically determine if the TextField should use embedded\n\t\t\t\t//fonts, unless embedFonts is explicitly true\n\t\t\t\ttextField.embedFonts = SystemUtil.isEmbeddedFont(\n\t\t\t\t\tthis._currentTextFormat.font, this._currentTextFormat.bold,\n\t\t\t\t\tthis._currentTextFormat.italic, FontType.EMBEDDED);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttextField.embedFonts = this._embedFonts;\n\t\t\t}\n\t\t\ttextField.type = this._isEditable ? TextFieldType.INPUT : TextFieldType.DYNAMIC;\n\t\t\ttextField.selectable = this._isEnabled && (this._isEditable || this._isSelectable);\n\n\t\t\tvar isFormatDifferent:Boolean = false;\n\t\t\tif(textField === this.textField)\n\t\t\t{\n\t\t\t\t//for some reason, textField.defaultTextFormat always fails\n\t\t\t\t//comparison against currentTextFormat. if we save to a member\n\t\t\t\t//variable and compare against that instead, it works.\n\t\t\t\t//I guess text field creates a different TextFormat object.\n\t\t\t\tif(this._currentTextFormat === this._fontStylesTextFormat)\n\t\t\t\t{\n\t\t\t\t\tisFormatDifferent = this._previousStarlingTextFormat !== this._currentStarlingTextFormat;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tisFormatDifferent = this._previousTextFormat !== this._currentTextFormat;\n\t\t\t\t}\n\t\t\t\tthis._previousStarlingTextFormat = this._currentStarlingTextFormat;\n\t\t\t\tthis._previousTextFormat = this._currentTextFormat;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//for measurement\n\t\t\t\tisFormatDifferent = true;\n\t\t\t}\n\t\t\ttextField.defaultTextFormat = this._currentTextFormat;\n\n\t\t\tif(this._isHTML)\n\t\t\t{\n\t\t\t\tif(isFormatDifferent || textField.htmlText != this._text)\n\t\t\t\t{\n\t\t\t\t\tif(textField == this.textField && this._pendingSelectionBeginIndex < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//if the TextFormat has changed from the last commit,\n\t\t\t\t\t\t//the selection range may be lost when we set the text\n\t\t\t\t\t\t//so we need to save it to restore later.\n\t\t\t\t\t\tthis._pendingSelectionBeginIndex = this.textField.selectionBeginIndex;\n\t\t\t\t\t\tthis._pendingSelectionEndIndex = this.textField.selectionEndIndex;\n\t\t\t\t\t}\n\t\t\t\t\t//the TextField's text should be updated after a TextFormat\n\t\t\t\t\t//change because otherwise it will keep using the old one.\n\t\t\t\t\ttextField.htmlText = this._text;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(isFormatDifferent || textField.text != this._text)\n\t\t\t\t{\n\t\t\t\t\tif(textField == this.textField && this._pendingSelectionBeginIndex < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._pendingSelectionBeginIndex = this.textField.selectionBeginIndex;\n\t\t\t\t\t\tthis._pendingSelectionEndIndex = this.textField.selectionEndIndex;\n\t\t\t\t\t}\n\t\t\t\t\ttextField.text = this._text;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshTextFormat():void\n\t\t{\n\t\t\tvar textFormat:flash.text.TextFormat;\n\t\t\tif(this._stateContext !== null)\n\t\t\t{\n\t\t\t\tif(this._textFormatForState !== null)\n\t\t\t\t{\n\t\t\t\t\tvar currentState:String = this._stateContext.currentState;\n\t\t\t\t\tif(currentState in this._textFormatForState)\n\t\t\t\t\t{\n\t\t\t\t\t\ttextFormat = flash.text.TextFormat(this._textFormatForState[currentState]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(textFormat === null && this._disabledTextFormat !== null &&\n\t\t\t\t\tthis._stateContext is IFeathersControl && !IFeathersControl(this._stateContext).isEnabled)\n\t\t\t\t{\n\t\t\t\t\ttextFormat = this._disabledTextFormat;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //no state context\n\t\t\t{\n\t\t\t\t//we can still check if the text renderer is disabled to see if\n\t\t\t\t//we should use disabledTextFormat\n\t\t\t\tif(!this._isEnabled && this._disabledTextFormat !== null)\n\t\t\t\t{\n\t\t\t\t\ttextFormat = this._disabledTextFormat;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(textFormat === null)\n\t\t\t{\n\t\t\t\ttextFormat = this._textFormat;\n\t\t\t}\n\t\t\t//flash.text.TextFormat is considered more advanced, so it gets\n\t\t\t//precedence over starling.text.TextFormat font styles\n\t\t\tif(textFormat === null)\n\t\t\t{\n\t\t\t\ttextFormat = this.getTextFormatFromFontStyles();\n\t\t\t}\n\t\t\tthis._currentTextFormat = textFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getTextFormatFromFontStyles():flash.text.TextFormat\n\t\t{\n\t\t\tif(this.isInvalid(INVALIDATION_FLAG_STYLES) ||\n\t\t\t\tthis.isInvalid(INVALIDATION_FLAG_STATE))\n\t\t\t{\n\t\t\t\tif(this._fontStyles !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._currentStarlingTextFormat = this._fontStyles.getTextFormatForTarget(this);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._currentStarlingTextFormat = null;\n\t\t\t\t}\n\t\t\t\tif(this._currentStarlingTextFormat !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._fontStylesTextFormat = this._currentStarlingTextFormat.toNativeFormat(this._fontStylesTextFormat);\n\t\t\t\t}\n\t\t\t\telse if(this._fontStylesTextFormat === null)\n\t\t\t\t{\n\t\t\t\t\t//fallback to a default so that something is displayed\n\t\t\t\t\tthis._fontStylesTextFormat = new flash.text.TextFormat();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this._fontStylesTextFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getVerticalAlignment():String\n\t\t{\n\t\t\tvar verticalAlign:String = null;\n\t\t\tif(this._fontStyles !== null)\n\t\t\t{\n\t\t\t\tvar format:starling.text.TextFormat = this._fontStyles.getTextFormatForTarget(this);\n\t\t\t\tif(format !== null)\n\t\t\t\t{\n\t\t\t\t\tverticalAlign = format.verticalAlign;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(verticalAlign === null)\n\t\t\t{\n\t\t\t\tverticalAlign = Align.TOP;\n\t\t\t}\n\t\t\treturn verticalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getVerticalAlignmentOffsetY():Number\n\t\t{\n\t\t\tvar verticalAlign:String = this.getVerticalAlignment();\n\t\t\tvar textFieldTextHeight:Number = this.textField.textHeight;\n\t\t\tif(textFieldTextHeight > this.actualHeight)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tif(verticalAlign === Align.BOTTOM)\n\t\t\t{\n\t\t\t\treturn this.actualHeight - textFieldTextHeight;\n\t\t\t}\n\t\t\telse if(verticalAlign === Align.CENTER)\n\t\t\t{\n\t\t\t\treturn (this.actualHeight - textFieldTextHeight) / 2;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layout(sizeInvalid:Boolean):void\n\t\t{\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\n\t\t\tif(sizeInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshSnapshotParameters();\n\t\t\t\tthis.refreshTextFieldSize();\n\t\t\t\tthis.transformTextField();\n\t\t\t\tthis.positionSnapshot();\n\t\t\t}\n\n\t\t\tthis.checkIfNewSnapshotIsNeeded();\n\n\t\t\tif(!this._textFieldHasFocus && (sizeInvalid || stylesInvalid || dataInvalid || stateInvalid || this._needsNewTexture))\n\t\t\t{\n\t\t\t\t//we're going to update the texture in render() because\n\t\t\t\t//there's a chance that it will be updated more than once per\n\t\t\t\t//frame if we do it here.\n\t\t\t\tthis._needsTextureUpdate = true;\n\t\t\t\tthis.setRequiresRedraw();\n\t\t\t}\n\t\t\tthis.doPendingActions();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getSelectionIndexAtPoint(pointX:Number, pointY:Number):int\n\t\t{\n\t\t\treturn this.textField.getCharIndexAtPoint(pointX, pointY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshTextFieldSize():void\n\t\t{\n\t\t\tvar gutterDimensionsOffset:Number = 4;\n\t\t\tif(this._useGutter || this._border)\n\t\t\t{\n\t\t\t\tgutterDimensionsOffset = 0;\n\t\t\t}\n\t\t\tthis.textField.width = this.actualWidth + gutterDimensionsOffset;\n\t\t\tthis.textField.height = this.actualHeight + gutterDimensionsOffset;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshSnapshotParameters():void\n\t\t{\n\t\t\tthis._textFieldOffsetX = 0;\n\t\t\tthis._textFieldOffsetY = 0;\n\t\t\tthis._textFieldSnapshotClipRect.x = 0;\n\t\t\tthis._textFieldSnapshotClipRect.y = 0;\n\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar scaleFactor:Number = starling.contentScaleFactor;\n\t\t\tvar clipWidth:Number = this.actualWidth * scaleFactor;\n\t\t\tif(this._updateSnapshotOnScaleChange)\n\t\t\t{\n\t\t\t\tvar matrix:Matrix = Pool.getMatrix();\n\t\t\t\tthis.getTransformationMatrix(this.stage, matrix);\n\t\t\t\tclipWidth *= matrixToScaleX(matrix);\n\t\t\t}\n\t\t\tif(clipWidth < 0)\n\t\t\t{\n\t\t\t\tclipWidth = 0;\n\t\t\t}\n\t\t\tvar clipHeight:Number = this.actualHeight * scaleFactor;\n\t\t\tif(this._updateSnapshotOnScaleChange)\n\t\t\t{\n\t\t\t\tclipHeight *= matrixToScaleY(matrix);\n\t\t\t\tPool.putMatrix(matrix);\n\t\t\t}\n\t\t\tif(clipHeight < 0)\n\t\t\t{\n\t\t\t\tclipHeight = 0;\n\t\t\t}\n\t\t\tthis._textFieldSnapshotClipRect.width = clipWidth;\n\t\t\tthis._textFieldSnapshotClipRect.height = clipHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function transformTextField():void\n\t\t{\n\t\t\t//there used to be some code here that returned immediately if the\n\t\t\t//TextField wasn't visible. some mobile devices displayed the text\n\t\t\t//at the wrong scale if the TextField weren't transformed before\n\t\t\t//being made visible, so I had to remove it. I moved the visible\n\t\t\t//check into render(), since it can still benefit from the\n\t\t\t//optimization there. see issue #1104.\n\n\t\t\tvar matrix:Matrix = Pool.getMatrix();\n\t\t\tvar point:Point = Pool.getPoint();\n\t\t\tthis.getTransformationMatrix(this.stage, matrix);\n\t\t\tvar globalScaleX:Number = matrixToScaleX(matrix);\n\t\t\tvar globalScaleY:Number = matrixToScaleY(matrix);\n\t\t\tvar smallerGlobalScale:Number = globalScaleX;\n\t\t\tif(globalScaleY < smallerGlobalScale)\n\t\t\t{\n\t\t\t\tsmallerGlobalScale = globalScaleY;\n\t\t\t}\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar nativeScaleFactor:Number = 1;\n\t\t\tif(starling.supportHighResolutions)\n\t\t\t{\n\t\t\t\tnativeScaleFactor = starling.nativeStage.contentsScaleFactor;\n\t\t\t}\n\t\t\tvar scaleFactor:Number = starling.contentScaleFactor / nativeScaleFactor;\n\t\t\tvar gutterPositionOffset:Number = 0;\n\t\t\tif(!this._useGutter || this._border)\n\t\t\t{\n\t\t\t\tgutterPositionOffset = 2 * smallerGlobalScale;\n\t\t\t}\n\t\t\tvar verticalAlignOffsetY:Number = this.getVerticalAlignmentOffsetY();\n\t\t\tif(this.is3D)\n\t\t\t{\n\t\t\t\tvar matrix3D:Matrix3D = Pool.getMatrix3D();\n\t\t\t\tvar point3D:Vector3D = Pool.getPoint3D();\n\t\t\t\tthis.getTransformationMatrix3D(this.stage, matrix3D);\n\t\t\t\tMatrixUtil.transformCoords3D(matrix3D, -gutterPositionOffset, -gutterPositionOffset + verticalAlignOffsetY, 0, point3D);\n\t\t\t\tpoint.setTo(point3D.x, point3D.y);\n\t\t\t\tPool.putPoint3D(point3D);\n\t\t\t\tPool.putMatrix3D(matrix3D);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tMatrixUtil.transformCoords(matrix, -gutterPositionOffset, -gutterPositionOffset + verticalAlignOffsetY, point);\n\t\t\t}\n\t\t\tvar starlingViewPort:Rectangle = starling.viewPort;\n\t\t\tthis.textField.x = Math.round(starlingViewPort.x + (point.x * scaleFactor));\n\t\t\tthis.textField.y = Math.round(starlingViewPort.y + (point.y * scaleFactor));\n\t\t\tthis.textField.rotation = matrixToRotation(matrix) * 180 / Math.PI;\n\t\t\tthis.textField.scaleX = matrixToScaleX(matrix) * scaleFactor;\n\t\t\tthis.textField.scaleY = matrixToScaleY(matrix) * scaleFactor;\n\n\t\t\tPool.putPoint(point);\n\t\t\tPool.putMatrix(matrix);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function positionSnapshot():void\n\t\t{\n\t\t\tif(!this.textSnapshot)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar matrix:Matrix = Pool.getMatrix();\n\t\t\tthis.getTransformationMatrix(this.stage, matrix);\n\t\t\tthis.textSnapshot.x = Math.round(matrix.tx) - matrix.tx;\n\t\t\tthis.textSnapshot.y = Math.round(matrix.ty) - matrix.ty;\n\t\t\tthis.textSnapshot.y += this.getVerticalAlignmentOffsetY();\n\t\t\tPool.putMatrix(matrix);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function checkIfNewSnapshotIsNeeded():void\n\t\t{\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar canUseRectangleTexture:Boolean = starling.profile !== Context3DProfile.BASELINE_CONSTRAINED;\n\t\t\tif(canUseRectangleTexture)\n\t\t\t{\n\t\t\t\tthis._snapshotWidth = this._textFieldSnapshotClipRect.width;\n\t\t\t\tthis._snapshotHeight = this._textFieldSnapshotClipRect.height;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._snapshotWidth = MathUtil.getNextPowerOfTwo(this._textFieldSnapshotClipRect.width);\n\t\t\t\tthis._snapshotHeight = MathUtil.getNextPowerOfTwo(this._textFieldSnapshotClipRect.height);\n\t\t\t}\n\t\t\tvar textureRoot:ConcreteTexture = this.textSnapshot ? this.textSnapshot.texture.root : null;\n\t\t\tthis._needsNewTexture = this._needsNewTexture || !this.textSnapshot ||\n\t\t\t\t(textureRoot !== null && (textureRoot.scale != starling.contentScaleFactor ||\n\t\t\t\tthis._snapshotWidth != textureRoot.nativeWidth || this._snapshotHeight != textureRoot.nativeHeight));\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function doPendingActions():void\n\t\t{\n\t\t\tif(this._isWaitingToSetFocus)\n\t\t\t{\n\t\t\t\tthis._isWaitingToSetFocus = false;\n\t\t\t\tthis.setFocus();\n\t\t\t}\n\n\t\t\tif(this._pendingSelectionBeginIndex >= 0)\n\t\t\t{\n\t\t\t\tvar startIndex:int = this._pendingSelectionBeginIndex;\n\t\t\t\tvar endIndex:int = this._pendingSelectionEndIndex;\n\t\t\t\tthis._pendingSelectionBeginIndex = -1;\n\t\t\t\tthis._pendingSelectionEndIndex = -1;\n\t\t\t\tthis.selectRange(startIndex, endIndex);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function texture_onRestore():void\n\t\t{\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tif(this.textSnapshot && this.textSnapshot.texture &&\n\t\t\t\tthis.textSnapshot.texture.scale != starling.contentScaleFactor)\n\t\t\t{\n\t\t\t\t//if we've changed between scale factors, we need to recreate\n\t\t\t\t//the texture to match the new scale factor.\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.refreshSnapshot();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshSnapshot():void\n\t\t{\n\t\t\tif(this._snapshotWidth <= 0 || this._snapshotHeight <= 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar gutterPositionOffset:Number = 2;\n\t\t\tif(this._useGutter || this._border)\n\t\t\t{\n\t\t\t\tgutterPositionOffset = 0;\n\t\t\t}\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar scaleFactor:Number = starling.contentScaleFactor;\n\t\t\tvar matrix:Matrix = Pool.getMatrix();\n\t\t\tif(this._updateSnapshotOnScaleChange)\n\t\t\t{\n\t\t\t\tthis.getTransformationMatrix(this.stage, matrix);\n\t\t\t\tvar globalScaleX:Number = matrixToScaleX(matrix);\n\t\t\t\tvar globalScaleY:Number = matrixToScaleY(matrix);\n\t\t\t}\n\t\t\tmatrix.identity();\n\t\t\tmatrix.translate(this._textFieldOffsetX - gutterPositionOffset, this._textFieldOffsetY - gutterPositionOffset);\n\t\t\tmatrix.scale(scaleFactor, scaleFactor);\n\t\t\tif(this._updateSnapshotOnScaleChange)\n\t\t\t{\n\t\t\t\tmatrix.scale(globalScaleX, globalScaleY);\n\t\t\t}\n\t\t\tvar bitmapData:BitmapData = new BitmapData(this._snapshotWidth, this._snapshotHeight, true, 0x00ff00ff);\n\t\t\tbitmapData.draw(this.textField, matrix, null, null, this._textFieldSnapshotClipRect);\n\t\t\tPool.putMatrix(matrix);\n\t\t\tvar newTexture:Texture;\n\t\t\tif(!this.textSnapshot || this._needsNewTexture)\n\t\t\t{\n\t\t\t\t//skip Texture.fromBitmapData() because we don't want\n\t\t\t\t//it to create an onRestore function that will be\n\t\t\t\t//immediately discarded for garbage collection.\n\t\t\t\tnewTexture = Texture.empty(bitmapData.width / scaleFactor, bitmapData.height / scaleFactor,\n\t\t\t\t\ttrue, false, false, scaleFactor);\n\t\t\t\tnewTexture.root.uploadBitmapData(bitmapData);\n\t\t\t\tnewTexture.root.onRestore = texture_onRestore;\n\t\t\t}\n\t\t\tif(!this.textSnapshot)\n\t\t\t{\n\t\t\t\tthis.textSnapshot = new Image(newTexture);\n\t\t\t\tthis.textSnapshot.pixelSnapping = true;\n\t\t\t\tthis.addChild(this.textSnapshot);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(this._needsNewTexture)\n\t\t\t\t{\n\t\t\t\t\tthis.textSnapshot.texture.dispose();\n\t\t\t\t\tthis.textSnapshot.texture = newTexture;\n\t\t\t\t\tthis.textSnapshot.readjustSize();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//this is faster, if we haven't resized the bitmapdata\n\t\t\t\t\tvar existingTexture:Texture = this.textSnapshot.texture;\n\t\t\t\t\texistingTexture.root.uploadBitmapData(bitmapData);\n\t\t\t\t\t//however, the image won't be notified that its\n\t\t\t\t\t//texture has changed, so we need to do it manually\n\t\t\t\t\tthis.textSnapshot.setRequiresRedraw();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._updateSnapshotOnScaleChange)\n\t\t\t{\n\t\t\t\tthis.textSnapshot.scaleX = 1 / globalScaleX;\n\t\t\t\tthis.textSnapshot.scaleY = 1 / globalScaleY;\n\t\t\t\tthis._lastGlobalScaleX = globalScaleX;\n\t\t\t\tthis._lastGlobalScaleY = globalScaleY;\n\t\t\t}\n\t\t\tthis.textSnapshot.alpha = this._text.length > 0 ? 1 : 0;\n\t\t\tbitmapData.dispose();\n\t\t\tthis._needsNewTexture = false;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textEditor_addedToStageHandler(event:Event):void\n\t\t{\n\t\t\tif(this.textField.parent === null)\n\t\t\t{\n\t\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\t\t//the text field needs to be on the native stage to measure properly\n\t\t\t\tstarling.nativeStage.addChild(this.textField);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textEditor_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tif(this.textField.parent)\n\t\t\t{\n\t\t\t\t//remove this from the stage, if needed\n\t\t\t\t//it will be added back next time we receive focus\n\t\t\t\tthis.textField.parent.removeChild(this.textField);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function hasFocus_enterFrameHandler(event:Event):void\n\t\t{\n\t\t\tif(this.textSnapshot)\n\t\t\t{\n\t\t\t\tthis.textSnapshot.visible = !this._textFieldHasFocus;\n\t\t\t}\n\t\t\tthis.textField.visible = this._textFieldHasFocus;\n\n\t\t\tif(this._textFieldHasFocus)\n\t\t\t{\n\t\t\t\tvar target:DisplayObject = this;\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\tif(!target.visible)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.clearFocus();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\ttarget = target.parent;\n\t\t\t\t}\n\t\t\t\twhile(target);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.removeEventListener(Event.ENTER_FRAME, hasFocus_enterFrameHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshSnapshot_enterFrameHandler(event:Event):void\n\t\t{\n\t\t\tthis.removeEventListener(Event.ENTER_FRAME, refreshSnapshot_enterFrameHandler);\n\t\t\tthis.refreshSnapshot();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(this._maintainTouchFocus || FocusManager.isEnabledForStage(this.stage))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar touch:Touch = event.getTouch(this.stage, TouchPhase.BEGAN);\n\t\t\tif(!touch) //we only care about began touches\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar point:Point = Pool.getPoint();\n\t\t\ttouch.getLocation(this.stage, point);\n\t\t\tvar isInBounds:Boolean = this.contains(this.stage.hitTest(point));\n\t\t\tPool.putPoint(point);\n\t\t\tif(isInBounds) //if the touch is in the text editor, it's all good\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//if the touch begins anywhere else, it's a focus out!\n\t\t\tthis.clearFocus();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textField_changeHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tif(this._isHTML)\n\t\t\t{\n\t\t\t\tthis.text = this.textField.htmlText;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.text = this.textField.text;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textField_focusInHandler(event:FocusEvent):void\n\t\t{\n\t\t\tthis._textFieldHasFocus = true;\n\t\t\tthis.stage.addEventListener(TouchEvent.TOUCH, stage_touchHandler);\n\t\t\tthis.addEventListener(Event.ENTER_FRAME, hasFocus_enterFrameHandler);\n\t\t\tthis.dispatchEventWith(FeathersEventType.FOCUS_IN);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textField_focusOutHandler(event:FocusEvent):void\n\t\t{\n\t\t\tthis._textFieldHasFocus = false;\n\t\t\tthis.stage.removeEventListener(TouchEvent.TOUCH, stage_touchHandler);\n\n\t\t\tif(this._resetScrollOnFocusOut)\n\t\t\t{\n\t\t\t\tthis.textField.scrollH = this.textField.scrollV = 0;\n\t\t\t}\n\n\t\t\t//the text may have changed, so we invalidate the data flag\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\tthis.dispatchEventWith(FeathersEventType.FOCUS_OUT);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textField_mouseFocusChangeHandler(event:FocusEvent):void\n\t\t{\n\t\t\tif(!this._maintainTouchFocus)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textField_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(event.keyCode == Keyboard.ENTER)\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.ENTER);\n\t\t\t}\n\t\t\telse if(!FocusManager.isEnabledForStage(this.stage) && event.keyCode == Keyboard.TAB)\n\t\t\t{\n\t\t\t\tthis.clearFocus();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textField_softKeyboardActivateHandler(event:SoftKeyboardEvent):void\n\t\t{\n\t\t\tthis.dispatchEventWith(FeathersEventType.SOFT_KEYBOARD_ACTIVATE, true);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textField_softKeyboardActivatingHandler(event:SoftKeyboardEvent):void\n\t\t{\n\t\t\tthis.dispatchEventWith(FeathersEventType.SOFT_KEYBOARD_ACTIVATING, true);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textField_softKeyboardDeactivateHandler(event:SoftKeyboardEvent):void\n\t\t{\n\t\t\tthis.dispatchEventWith(FeathersEventType.SOFT_KEYBOARD_DEACTIVATE, true);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function fontStylesSet_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis._previousStarlingTextFormat = null;\n\t\t\tsuper.fontStylesSet_changeHandler(event);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/text/TextFieldTextEditorViewPort.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.text\n{\n\timport feathers.controls.Scroller;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.utils.geom.matrixToRotation;\n\timport feathers.utils.geom.matrixToScaleX;\n\timport feathers.utils.geom.matrixToScaleY;\n\timport feathers.utils.math.roundToNearest;\n\n\timport flash.events.Event;\n\timport flash.events.FocusEvent;\n\timport flash.geom.Matrix;\n\timport flash.geom.Point;\n\timport flash.geom.Rectangle;\n\timport flash.text.TextField;\n\n\timport starling.core.Starling;\n\timport starling.utils.MatrixUtil;\n\timport starling.utils.Pool;\n\n\t/**\n\t * A text editor view port for the <code>TextArea</code> component that uses\n\t * <code>flash.text.TextField</code>.\n\t *\n\t * @see feathers.controls.TextArea\n\t *\n\t * @productversion Feathers 1.1.0\n\t */\n\tpublic class TextFieldTextEditorViewPort extends TextFieldTextEditor implements ITextEditorViewPort\n\t{\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>TextFieldTextEditorViewPort</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function TextFieldTextEditorViewPort()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.multiline = true;\n\t\t\tthis.wordWrap = true;\n\t\t\tthis.resetScrollOnFocusOut = false;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _ignoreScrolling:Boolean = false;\n\n\t\tprivate var _actualMinVisibleWidth:Number = 0;\n\n\t\tprivate var _explicitMinVisibleWidth:Number;\n\n\t\tpublic function get minVisibleWidth():Number\n\t\t{\n\t\t\tif(this._explicitMinVisibleWidth !== this._explicitMinVisibleWidth) //isNaN\n\t\t\t{\n\t\t\t\treturn this._actualMinVisibleWidth;\n\t\t\t}\n\t\t\treturn this._explicitMinVisibleWidth;\n\t\t}\n\n\t\tpublic function set minVisibleWidth(value:Number):void\n\t\t{\n\t\t\tif(this._explicitMinVisibleWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar valueIsNaN:Boolean = value !== value; //isNaN\n\t\t\tif(valueIsNaN &&\n\t\t\t\tthis._explicitMinVisibleWidth !== this._explicitMinVisibleWidth) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar oldValue:Number = this._explicitMinVisibleWidth;\n\t\t\tthis._explicitMinVisibleWidth = value;\n\t\t\tif(valueIsNaN)\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleWidth = 0;\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleWidth = value;\n\t\t\t\tif(this._explicitVisibleWidth !== this._explicitVisibleWidth && //isNaN\n\t\t\t\t\t(this._actualVisibleWidth < value || this._actualVisibleWidth == oldValue))\n\t\t\t\t{\n\t\t\t\t\t//only invalidate if this change might affect the visibleWidth\n\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate var _maxVisibleWidth:Number = Number.POSITIVE_INFINITY;\n\n\t\tpublic function get maxVisibleWidth():Number\n\t\t{\n\t\t\treturn this._maxVisibleWidth;\n\t\t}\n\n\t\tpublic function set maxVisibleWidth(value:Number):void\n\t\t{\n\t\t\tif(this._maxVisibleWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value) //isNaN\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"maxVisibleWidth cannot be NaN\");\n\t\t\t}\n\t\t\tvar oldValue:Number = this._maxVisibleWidth;\n\t\t\tthis._maxVisibleWidth = value;\n\t\t\tif(this._explicitVisibleWidth !== this._explicitVisibleWidth && //isNaN\n\t\t\t\t(this._actualVisibleWidth > value || this._actualVisibleWidth == oldValue))\n\t\t\t{\n\t\t\t\t//only invalidate if this change might affect the visibleWidth\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\tprivate var _actualVisibleWidth:Number = 0;\n\n\t\tprivate var _explicitVisibleWidth:Number;\n\n\t\tpublic function get visibleWidth():Number\n\t\t{\n\t\t\tif(this._explicitVisibleWidth !== this._explicitVisibleWidth) //isNaN\n\t\t\t{\n\t\t\t\treturn this._actualVisibleWidth;\n\t\t\t}\n\t\t\treturn this._explicitVisibleWidth;\n\t\t}\n\n\t\tpublic function set visibleWidth(value:Number):void\n\t\t{\n\t\t\tif(this._explicitVisibleWidth == value ||\n\t\t\t\t(value !== value && this._explicitVisibleWidth !== this._explicitVisibleWidth)) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._explicitVisibleWidth = value;\n\t\t\tif(this._actualVisibleWidth != value)\n\t\t\t{\n\t\t\t\tthis._actualVisibleWidth = value;\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\tprivate var _actualMinVisibleHeight:Number = 0;\n\n\t\tprivate var _explicitMinVisibleHeight:Number;\n\n\t\tpublic function get minVisibleHeight():Number\n\t\t{\n\t\t\tif(this._explicitMinVisibleHeight !== this._explicitMinVisibleHeight) //isNaN\n\t\t\t{\n\t\t\t\treturn this._actualMinVisibleHeight;\n\t\t\t}\n\t\t\treturn this._explicitMinVisibleHeight;\n\t\t}\n\n\t\tpublic function set minVisibleHeight(value:Number):void\n\t\t{\n\t\t\tif(this._explicitMinVisibleHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar valueIsNaN:Boolean = value !== value; //isNaN\n\t\t\tif(valueIsNaN &&\n\t\t\t\tthis._explicitMinVisibleHeight !== this._explicitMinVisibleHeight) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar oldValue:Number = this._explicitMinVisibleHeight;\n\t\t\tthis._explicitMinVisibleHeight = value;\n\t\t\tif(valueIsNaN)\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleHeight = 0;\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleHeight = value;\n\t\t\t\tif(this._explicitVisibleHeight !== this._explicitVisibleHeight && //isNaN\n\t\t\t\t\t(this._actualVisibleHeight < value || this._actualVisibleHeight == oldValue))\n\t\t\t\t{\n\t\t\t\t\t//only invalidate if this change might affect the visibleHeight\n\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate var _maxVisibleHeight:Number = Number.POSITIVE_INFINITY;\n\n\t\tpublic function get maxVisibleHeight():Number\n\t\t{\n\t\t\treturn this._maxVisibleHeight;\n\t\t}\n\n\t\tpublic function set maxVisibleHeight(value:Number):void\n\t\t{\n\t\t\tif(this._maxVisibleHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value) //isNaN\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"maxVisibleHeight cannot be NaN\");\n\t\t\t}\n\t\t\tvar oldValue:Number = this._maxVisibleHeight;\n\t\t\tthis._maxVisibleHeight = value;\n\t\t\tif(this._explicitVisibleHeight !== this._explicitVisibleHeight && //isNaN\n\t\t\t\t(this._actualVisibleHeight > value || this._actualVisibleHeight == oldValue))\n\t\t\t{\n\t\t\t\t//only invalidate if this change might affect the visibleHeight\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\tprivate var _actualVisibleHeight:Number = 0;\n\n\t\tprivate var _explicitVisibleHeight:Number;\n\n\t\tpublic function get visibleHeight():Number\n\t\t{\n\t\t\tif(this._explicitVisibleHeight !== this._explicitVisibleHeight) //isNaN\n\t\t\t{\n\t\t\t\treturn this._actualVisibleHeight;\n\t\t\t}\n\t\t\treturn this._explicitVisibleHeight;\n\t\t}\n\n\t\tpublic function set visibleHeight(value:Number):void\n\t\t{\n\t\t\tif(this._explicitVisibleHeight == value ||\n\t\t\t\t(value !== value && this._explicitVisibleHeight !== this._explicitVisibleHeight)) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._explicitVisibleHeight = value;\n\t\t\tif(this._actualVisibleHeight != value)\n\t\t\t{\n\t\t\t\tthis._actualVisibleHeight = value;\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get contentX():Number\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get contentY():Number\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _scrollStep:int = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get horizontalScrollStep():Number\n\t\t{\n\t\t\treturn this._scrollStep;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get verticalScrollStep():Number\n\t\t{\n\t\t\treturn this._scrollStep;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _horizontalScrollPosition:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get horizontalScrollPosition():Number\n\t\t{\n\t\t\treturn this._horizontalScrollPosition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalScrollPosition(value:Number):void\n\t\t{\n\t\t\t//this value is basically ignored because the text does not scroll\n\t\t\t//horizontally. instead, it wraps.\n\t\t\tthis._horizontalScrollPosition = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _verticalScrollPosition:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get verticalScrollPosition():Number\n\t\t{\n\t\t\treturn this._verticalScrollPosition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalScrollPosition(value:Number):void\n\t\t{\n\t\t\tif(this._verticalScrollPosition == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalScrollPosition = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t\t//hack because the superclass doesn't know about the scroll flag\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get requiresMeasurementOnScroll():Boolean\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function get baseline():Number\n\t\t{\n\t\t\treturn super.baseline + this._paddingTop + this._verticalScrollPosition;\n\t\t}\n\n\t\t/**\n\t\t * Quickly sets all padding properties to the same value. The\n\t\t * <code>padding</code> getter always returns the value of\n\t\t * <code>paddingTop</code>, but the other padding values may be\n\t\t * different.\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #paddingTop\n\t\t * @see #paddingRight\n\t\t * @see #paddingBottom\n\t\t * @see #paddingLeft\n\t\t */\n\t\tpublic function get padding():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set padding(value:Number):void\n\t\t{\n\t\t\tthis.paddingTop = value;\n\t\t\tthis.paddingRight = value;\n\t\t\tthis.paddingBottom = value;\n\t\t\tthis.paddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingTop:Number = 0;\n\n\t\t/**\n\t\t * The minimum space, in pixels, between the view port's top edge and\n\t\t * the view port's content.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingTop():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingTop(value:Number):void\n\t\t{\n\t\t\tif(this._paddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingTop = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingRight:Number = 0;\n\n\t\t/**\n\t\t * The minimum space, in pixels, between the view port's right edge and\n\t\t * the view port's content.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingRight():Number\n\t\t{\n\t\t\treturn this._paddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this._paddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingRight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingBottom:Number = 0;\n\n\t\t/**\n\t\t * The minimum space, in pixels, between the view port's bottom edge and\n\t\t * the view port's content.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingBottom():Number\n\t\t{\n\t\t\treturn this._paddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this._paddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingBottom = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingLeft:Number = 0;\n\n\t\t/**\n\t\t * The minimum space, in pixels, between the view port's left edge and\n\t\t * the view port's content.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this._paddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingLeft = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function setFocus(position:Point = null):void\n\t\t{\n\t\t\tif(position !== null)\n\t\t\t{\n\t\t\t\tposition.x -= this._paddingLeft;\n\t\t\t\tposition.y -= this._paddingTop;\n\t\t\t}\n\t\t\tsuper.setFocus(position);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar result:Boolean = super.autoSizeIfNeeded();\n\t\t\tvar needsWidth:Boolean = this._explicitVisibleWidth !== this._explicitVisibleWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitVisibleHeight !== this._explicitVisibleHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinVisibleWidth !== this._explicitMinVisibleWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinVisibleHeight !== this._explicitMinVisibleHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tthis._actualVisibleWidth = this.actualWidth;\n\t\t\t}\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tthis._actualVisibleHeight = this.actualHeight;\n\t\t\t}\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleWidth = this.actualMinWidth;\n\t\t\t}\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tthis._actualMinVisibleHeight = this.actualMinHeight;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function measure(result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\n\t\t\tvar needsWidth:Boolean = this._explicitVisibleWidth !== this._explicitVisibleWidth; //isNaN\n\n\t\t\tthis.commitStylesAndData(this.measureTextField);\n\n\t\t\tvar gutterDimensionsOffset:Number = 4;\n\t\t\tif(this._useGutter)\n\t\t\t{\n\t\t\t\tgutterDimensionsOffset = 0;\n\t\t\t}\n\n\t\t\tvar newWidth:Number = this._explicitVisibleWidth;\n\t\t\tthis.measureTextField.width = newWidth - this._paddingLeft - this._paddingRight + gutterDimensionsOffset;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\t//this.measureTextField.wordWrap = false;\n\t\t\t\tnewWidth = this.measureTextField.width + this._paddingLeft + this._paddingRight - gutterDimensionsOffset;\n\t\t\t\tif(this._explicitMinVisibleWidth === this._explicitMinVisibleWidth && //!isNaN\n\t\t\t\t\tnewWidth < this._explicitMinVisibleWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this._explicitMinVisibleWidth;\n\t\t\t\t}\n\t\t\t\telse if(newWidth > this._maxVisibleWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this._maxVisibleWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//this.measureTextField.width = newWidth - this._paddingLeft - this._paddingRight + gutterDimensionsOffset;\n\t\t\t//this.measureTextField.wordWrap = true;\n\t\t\tvar newHeight:Number = this.measureTextField.height + this._paddingTop + this._paddingBottom - gutterDimensionsOffset;\n\t\t\tif(this._useGutter)\n\t\t\t{\n\t\t\t\tnewHeight += 4;\n\t\t\t}\n\t\t\tif(this._explicitVisibleHeight === this._explicitVisibleHeight) //!isNaN\n\t\t\t{\n\t\t\t\tif(newHeight < this._explicitVisibleHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this._explicitVisibleHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(this._explicitMinVisibleHeight === this._explicitMinVisibleHeight) //!isNaN\n\t\t\t{\n\t\t\t\tif(newHeight < this._explicitMinVisibleHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this._explicitMinVisibleHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tresult.x = newWidth;\n\t\t\tresult.y = newHeight;\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function refreshSnapshotParameters():void\n\t\t{\n\t\t\tvar textFieldWidth:Number = this._actualVisibleWidth - this._paddingLeft - this._paddingRight;\n\t\t\tif(textFieldWidth !== textFieldWidth) //isNaN\n\t\t\t{\n\t\t\t\tif(this._maxVisibleWidth < Number.POSITIVE_INFINITY)\n\t\t\t\t{\n\t\t\t\t\ttextFieldWidth = this._maxVisibleWidth - this._paddingLeft - this._paddingRight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttextFieldWidth = this._actualMinVisibleWidth - this._paddingLeft - this._paddingRight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar textFieldHeight:Number = this._actualVisibleHeight - this._paddingTop - this._paddingBottom;\n\t\t\tif(textFieldHeight !== textFieldHeight) //isNaN\n\t\t\t{\n\t\t\t\tif(this._maxVisibleHeight < Number.POSITIVE_INFINITY)\n\t\t\t\t{\n\t\t\t\t\ttextFieldHeight = this._maxVisibleHeight - this._paddingTop - this._paddingBottom;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttextFieldHeight = this._actualMinVisibleHeight - this._paddingTop - this._paddingBottom;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._textFieldOffsetX = 0;\n\t\t\tthis._textFieldOffsetY = 0;\n\t\t\tthis._textFieldSnapshotClipRect.x = 0;\n\t\t\tthis._textFieldSnapshotClipRect.y = 0;\n\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar scaleFactor:Number = starling.contentScaleFactor;\n\t\t\tvar clipWidth:Number = textFieldWidth * scaleFactor;\n\t\t\tif(this._updateSnapshotOnScaleChange)\n\t\t\t{\n\t\t\t\tvar matrix:Matrix = Pool.getMatrix();\n\t\t\t\tthis.getTransformationMatrix(this.stage, matrix);\n\t\t\t\tclipWidth *= matrixToScaleX(matrix);\n\t\t\t}\n\t\t\tif(clipWidth < 0)\n\t\t\t{\n\t\t\t\tclipWidth = 0;\n\t\t\t}\n\t\t\tvar clipHeight:Number = textFieldHeight * scaleFactor;\n\t\t\tif(this._updateSnapshotOnScaleChange)\n\t\t\t{\n\t\t\t\tclipHeight *= matrixToScaleY(matrix);\n\t\t\t\tPool.putMatrix(matrix);\n\t\t\t}\n\t\t\tif(clipHeight < 0)\n\t\t\t{\n\t\t\t\tclipHeight = 0;\n\t\t\t}\n\t\t\tthis._textFieldSnapshotClipRect.width = clipWidth;\n\t\t\tthis._textFieldSnapshotClipRect.height = clipHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function refreshTextFieldSize():void\n\t\t{\n\t\t\tvar oldIgnoreScrolling:Boolean = this._ignoreScrolling;\n\t\t\tvar gutterDimensionsOffset:Number = 4;\n\t\t\tif(this._useGutter)\n\t\t\t{\n\t\t\t\tgutterDimensionsOffset = 0;\n\t\t\t}\n\t\t\tthis._ignoreScrolling = true;\n\t\t\tthis.textField.width = this._actualVisibleWidth - this._paddingLeft - this._paddingRight + gutterDimensionsOffset;\n\t\t\tvar textFieldHeight:Number = this._actualVisibleHeight - this._paddingTop - this._paddingBottom + gutterDimensionsOffset;\n\t\t\tif(this.textField.height != textFieldHeight)\n\t\t\t{\n\t\t\t\tthis.textField.height = textFieldHeight;\n\t\t\t}\n\t\t\tvar scroller:Scroller = Scroller(this.parent);\n\t\t\tthis.textField.scrollV = Math.round(1 + ((this.textField.maxScrollV - 1) * (this._verticalScrollPosition / scroller.maxVerticalScrollPosition)));\n\t\t\tthis._ignoreScrolling = oldIgnoreScrolling;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function commitStylesAndData(textField:TextField):void\n\t\t{\n\t\t\tsuper.commitStylesAndData(textField);\n\t\t\tif(textField == this.textField)\n\t\t\t{\n\t\t\t\tthis._scrollStep = textField.getLineMetrics(0).height;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function transformTextField():void\n\t\t{\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar nativeScaleFactor:Number = 1;\n\t\t\tif(starling.supportHighResolutions)\n\t\t\t{\n\t\t\t\tnativeScaleFactor = starling.nativeStage.contentsScaleFactor;\n\t\t\t}\n\t\t\tvar scaleFactor:Number = starling.contentScaleFactor / nativeScaleFactor;\n\t\t\tvar matrix:Matrix = Pool.getMatrix();\n\t\t\tvar point:Point = Pool.getPoint();\n\t\t\tthis.getTransformationMatrix(this.stage, matrix);\n\t\t\tMatrixUtil.transformCoords(matrix, 0, 0, point);\n\t\t\tvar scaleX:Number = matrixToScaleX(matrix) * scaleFactor;\n\t\t\tvar scaleY:Number = matrixToScaleY(matrix) * scaleFactor;\n\t\t\tvar offsetX:Number = Math.round(this._paddingLeft * scaleX);\n\t\t\tvar offsetY:Number = Math.round((this._paddingTop + this._verticalScrollPosition) * scaleY);\n\t\t\tvar starlingViewPort:Rectangle = starling.viewPort;\n\t\t\tvar gutterPositionOffset:Number = 2;\n\t\t\tif(this._useGutter)\n\t\t\t{\n\t\t\t\tgutterPositionOffset = 0;\n\t\t\t}\n\t\t\tthis.textField.x = offsetX + Math.round(starlingViewPort.x + (point.x * scaleFactor) - gutterPositionOffset * scaleX);\n\t\t\tthis.textField.y = offsetY + Math.round(starlingViewPort.y + (point.y * scaleFactor) - gutterPositionOffset * scaleY);\n\t\t\tthis.textField.rotation = matrixToRotation(matrix) * 180 / Math.PI;\n\t\t\tthis.textField.scaleX = scaleX;\n\t\t\tthis.textField.scaleY = scaleY;\n\t\t\tPool.putPoint(point);\n\t\t\tPool.putMatrix(matrix);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function positionSnapshot():void\n\t\t{\n\t\t\tif(!this.textSnapshot)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar matrix:Matrix = Pool.getMatrix();\n\t\t\tthis.getTransformationMatrix(this.stage, matrix);\n\t\t\tthis.textSnapshot.x = this._paddingLeft + Math.round(matrix.tx) - matrix.tx;\n\t\t\tthis.textSnapshot.y = this._paddingTop + this._verticalScrollPosition + Math.round(matrix.ty) - matrix.ty;\n\t\t\tPool.putMatrix(matrix);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function checkIfNewSnapshotIsNeeded():void\n\t\t{\n\t\t\tsuper.checkIfNewSnapshotIsNeeded();\n\t\t\tthis._needsNewTexture ||= this.isInvalid(INVALIDATION_FLAG_SCROLL);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function textField_focusInHandler(event:FocusEvent):void\n\t\t{\n\t\t\tthis.textField.addEventListener(Event.SCROLL, textField_scrollHandler);\n\t\t\tsuper.textField_focusInHandler(event);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function textField_focusOutHandler(event:FocusEvent):void\n\t\t{\n\t\t\tthis.textField.removeEventListener(Event.SCROLL, textField_scrollHandler);\n\t\t\tsuper.textField_focusOutHandler(event);\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function textField_scrollHandler(event:Event):void\n\t\t{\n\t\t\t//for some reason, the text field's scroll positions don't work\n\t\t\t//properly unless we access the values here. weird.\n\t\t\tvar scrollH:Number = this.textField.scrollH;\n\t\t\tvar scrollV:Number = this.textField.scrollV;\n\t\t\tif(this._ignoreScrolling)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar scroller:Scroller = Scroller(this.parent);\n\t\t\tif(scroller.maxVerticalScrollPosition > 0 && this.textField.maxScrollV > 1)\n\t\t\t{\n\t\t\t\tvar calculatedVerticalScrollPosition:Number = scroller.maxVerticalScrollPosition * (scrollV - 1) / (this.textField.maxScrollV - 1);\n\t\t\t\tscroller.verticalScrollPosition = roundToNearest(calculatedVerticalScrollPosition, this._scrollStep);\n\t\t\t}\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "source/feathers/controls/text/TextFieldTextRenderer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.controls.text\n{\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.ITextRenderer;\n\timport feathers.core.IToggle;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.utils.geom.matrixToScaleX;\n\timport feathers.utils.geom.matrixToScaleY;\n\timport feathers.utils.math.roundUpToNearest;\n\timport feathers.utils.textures.calculateSnapshotTextureDimensions;\n\n\timport flash.display.BitmapData;\n\timport flash.display3D.Context3DProfile;\n\timport flash.filters.BitmapFilter;\n\timport flash.geom.Matrix;\n\timport flash.geom.Point;\n\timport flash.geom.Rectangle;\n\timport flash.text.AntiAliasType;\n\timport flash.text.FontType;\n\timport flash.text.GridFitType;\n\timport flash.text.StyleSheet;\n\timport flash.text.TextField;\n\timport flash.text.TextFieldAutoSize;\n\timport flash.text.TextFormat;\n\n\timport starling.core.Starling;\n\timport starling.display.Image;\n\timport starling.events.Event;\n\timport starling.rendering.Painter;\n\timport starling.text.TextFormat;\n\timport starling.textures.ConcreteTexture;\n\timport starling.textures.Texture;\n\timport starling.utils.Align;\n\timport starling.utils.MathUtil;\n\timport starling.utils.Pool;\n\timport starling.utils.SystemUtil;\n\n\t/**\n\t * Renders text with a native <code>flash.text.TextField</code> and draws\n\t * it to <code>BitmapData</code> before uploading it to a texture on the\n\t * GPU. Textures are managed internally by this component, and they will be\n\t * automatically disposed when the component is disposed.\n\t *\n\t * <p>For longer passages of text, this component will stitch together\n\t * multiple individual textures both horizontally and vertically, as a grid,\n\t * if required. This may require quite a lot of texture memory, possibly\n\t * exceeding the limits of some mobile devices, so use this component with\n\t * caution when displaying a lot of text.</p>\n\t *\n\t * <p>The following example shows how to use\n\t * <code>TextFieldTextRenderer</code> with a <code>Label</code>:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var label:Label = new Label();\n\t * label.text = \"I am the very model of a modern Major General\";\n\t * label.textRendererFactory = function():ITextRenderer\n\t * {\n\t *     return new TextFieldTextRenderer();\n\t * };\n\t * this.addChild( label );</listing>\n\t *\n\t * <strong>Embedding Fonts</strong>\n\t *\n\t * <p>This text renderer supports embedded TrueType or OpenType fonts.</p>\n\t *\n\t * <p>In the following example, a TrueType font is included with\n\t * <code>[Embed]</code> metadata:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * [Embed(source=\"path/to/font.ttf\",fontFamily=\"MyCustomFont\",fontWeight=\"normal\",fontStyle=\"normal\",mimeType=\"application/x-font\",embedAsCFF=\"false\")]\n\t * private static const MY_CUSTOM_FONT:Class;</listing>\n\t *\n\t * <p>The <code>source</code> field should point to the font file, relative\n\t * to the current <code>.as</code> file that contains the metadata.</p>\n\t *\n\t * <p>Set the <code>fontFamily</code> field to the string value that you\n\t * want to use when referencing this font in code. For example, you would\n\t * use this name when you create a <code>starling.text.TextFormat</code>\n\t * object. Replace \"MyCustomFont\" with an appropriate name for your font.</p>\n\t *\n\t * <p><strong>Tip:</strong> For best results, try not to set the exact same\n\t * name in the <code>fontFamily</code> field as the name of device font\n\t * installed on your system. Debugging embedded font issues can be\n\t * frustrating when you see the correct font on your development computer,\n\t * but it's a different font on other devices. If you use a font name that\n\t * doesn't exist on your development computer, you'll see when something is\n\t * wrong immediately, instead of discovering it later when you're testing\n\t * on other devices.</p>\n\t *\n\t * <p>If the font is bold, set the <code>fontWeight</code> field to \"bold\".\n\t * Otherwise, set it to \"normal\".</p>\n\t *\n\t * <p>If the font is italic, set the <code>fontStyle</code> field to\n\t * \"italic\". Otherwise, set it to \"normal\".</p>\n\t *\n\t * <p>Since the text renderer is based on <code>flash.text.TextField</code>,\n\t * you <strong>must</strong> set the <code>embedAsCFF</code> field to\n\t * \"false\".</p>\n\t *\n\t * @see ../../../../help/text-renderers.html Introduction to Feathers text renderers\n\t * @see ../../../../help/text-field-text-renderer.html How to use the Feathers TextFieldTextRenderer component\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html flash.text.TextField\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class TextFieldTextRenderer extends BaseTextRenderer implements ITextRenderer\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const HELPER_POINT:Point = new Point();\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const HELPER_MATRIX:Matrix = new Matrix();\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const HELPER_RECTANGLE:Rectangle = new Rectangle();\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all <code>TextFieldTextRenderer</code>\n\t\t * components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function TextFieldTextRenderer()\n\t\t{\n\t\t\tif(this._text === null)\n\t\t\t{\n\t\t\t\t//flash.text.TextField won't accept a null value\n\t\t\t\tthis._text = \"\";\n\t\t\t}\n\t\t\tsuper();\n\t\t\tthis.isQuickHitAreaEnabled = true;\n\t\t}\n\n\t\t/**\n\t\t * The TextField instance used to render the text before taking a\n\t\t * texture snapshot.\n\t\t */\n\t\tprotected var textField:TextField;\n\n\t\t/**\n\t\t * An image that displays a snapshot of the native <code>TextField</code>\n\t\t * in the Starling display list when the editor doesn't have focus.\n\t\t */\n\t\tprotected var textSnapshot:Image;\n\n\t\t/**\n\t\t * If multiple snapshots are needed due to texture size limits, the\n\t\t * snapshots appearing after the first are stored here.\n\t\t */\n\t\tprotected var textSnapshots:Vector.<Image>;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textSnapshotOffsetX:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textSnapshotOffsetY:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _previousActualWidth:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _previousActualHeight:Number = NaN;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _snapshotWidth:int = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _snapshotHeight:int = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _snapshotVisibleWidth:int = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _snapshotVisibleHeight:int = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _needsTextureUpdate:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _needsNewTexture:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _hasMeasured:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn TextFieldTextRenderer.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set text(value:String):void\n\t\t{\n\t\t\tif(value === null)\n\t\t\t{\n\t\t\t\t//flash.text.TextField won't accept a null value\n\t\t\t\tvalue = \"\";\n\t\t\t}\n\t\t\tsuper.text = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isHTML:Boolean = false;\n\n\t\t/**\n\t\t * Determines if the TextField should display the text as HTML or not.\n\t\t *\n\t\t * <p>In the following example, the text is displayed as HTML:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.isHTML = true;\n\t\t * textRenderer.text = \"&lt;span class='heading'&gt;hello&lt;/span&gt; world!\";</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#htmlText flash.text.TextField.htmlText\n\t\t * @see #text\n\t\t */\n\t\tpublic function get isHTML():Boolean\n\t\t{\n\t\t\treturn this._isHTML;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isHTML(value:Boolean):void\n\t\t{\n\t\t\tif(this._isHTML == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isHTML = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.core.ITextRenderer#numLines\n\t\t */\n\t\tpublic function get numLines():int\n\t\t{\n\t\t\tif(this.textField === null)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn this.textField.numLines;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentTextFormat:flash.text.TextFormat;\n\n\t\t/**\n\t\t * For debugging purposes, the current\n\t\t * <code>flash.text.TextFormat</code> used to render the text. Updated\n\t\t * during validation, and may be <code>null</code> before the first\n\t\t * validation.\n\t\t *\n\t\t * <p>Do not modify this value. It is meant for testing and debugging\n\t\t * only. Use the parent's <code>starling.text.TextFormat</code> font\n\t\t * styles APIs instead.</p>\n\t\t */\n\t\tpublic function get currentTextFormat():flash.text.TextFormat\n\t\t{\n\t\t\treturn this._currentTextFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fontStylesTextFormat:flash.text.TextFormat;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentVerticalAlign:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalAlignOffsetY:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textFormatForState:Object;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textFormat:flash.text.TextFormat;\n\n\t\t/**\n\t\t * Advanced font formatting used to draw the text, if\n\t\t * <code>fontStyles</code> and <code>starling.text.TextFormat</code>\n\t\t * cannot be used on the parent component because the full capabilities\n\t\t * of <code>flash.text.TextField</code> are required.\n\t\t *\n\t\t * <p>In the following example, the text format is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.textFormat = new TextFormat( \"Source Sans Pro\" );</listing>\n\t\t *\n\t\t * <p><strong>Warning:</strong> If this property is not\n\t\t * <code>null</code>, any <code>starling.text.TextFormat</code> font\n\t\t * styles that are passed in from the parent component may be ignored.\n\t\t * In other words, advanced font styling with\n\t\t * <code>flash.text.TextFormat</code> will always take precedence.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #setTextFormatForState()\n\t\t * @see #disabledTextFormat\n\t\t * @see #selectedTextFormat\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextFormat.html flash.text.TextFormat\n\t\t */\n\t\tpublic function get textFormat():flash.text.TextFormat\n\t\t{\n\t\t\treturn this._textFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set textFormat(value:flash.text.TextFormat):void\n\t\t{\n\t\t\tif(this._textFormat == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textFormat = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _disabledTextFormat:flash.text.TextFormat;\n\n\t\t/**\n\t\t * Advanced font formatting used to draw the text when the component is\n\t\t * disabled, if <code>disabledFontStyles</code> and\n\t\t * <code>starling.text.TextFormat</code> cannot be used on the parent\n\t\t * component because the full capabilities of\n\t\t * <code>flash.text.TextField</code> are required.\n\t\t *\n\t\t * <p>In the following example, the disabled text format is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.isEnabled = false;\n\t\t * textRenderer.disabledTextFormat = new TextFormat( \"Source Sans Pro\" );</listing>\n\t\t *\n\t\t * <p><strong>Warning:</strong> If this property is not\n\t\t * <code>null</code>, any <code>starling.text.TextFormat</code> font\n\t\t * styles that are passed in from the parent component may be ignored.\n\t\t * In other words, advanced font styling with\n\t\t * <code>flash.text.TextFormat</code> will always take precedence.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #textFormat\n\t\t * @see #selectedTextFormat\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextFormat.html flash.text.TextFormat\n\t\t */\n\t\tpublic function get disabledTextFormat():flash.text.TextFormat\n\t\t{\n\t\t\treturn this._disabledTextFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disabledTextFormat(value:flash.text.TextFormat):void\n\t\t{\n\t\t\tif(this._disabledTextFormat == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._disabledTextFormat = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectedTextFormat:flash.text.TextFormat;\n\n\t\t/**\n\t\t * Advanced font formatting used to draw the text when the\n\t\t * <code>stateContext</code> is selected, if\n\t\t * <code>selectedFontStyles</code> and\n\t\t * <code>starling.text.TextFormat</code> cannot be used on the parent\n\t\t * component because the full capabilities of\n\t\t * <code>flash.text.TextField</code> are required.\n\t\t *\n\t\t * The font and styles used to draw the text when the\n\t\t * <code>stateContext</code> implements the <code>IToggle</code>\n\t\t * interface, and it is selected.\n\t\t *\n\t\t * <p>In the following example, the selected text format is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.selectedTextFormat = new TextFormat( \"Source Sans Pro\" );</listing>\n\t\t *\n\t\t * <p><strong>Warning:</strong> If this property is not\n\t\t * <code>null</code>, any <code>starling.text.TextFormat</code> font\n\t\t * styles that are passed in from the parent component may be ignored.\n\t\t * In other words, advanced font styling with\n\t\t * <code>flash.text.TextFormat</code> will always take precedence.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #stateContext\n\t\t * @see feathers.core.IToggle\n\t\t * @see #textFormat\n\t\t * @see #disabledTextFormat\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextFormat.html flash.text.TextFormat\n\t\t */\n\t\tpublic function get selectedTextFormat():flash.text.TextFormat\n\t\t{\n\t\t\treturn this._selectedTextFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedTextFormat(value:flash.text.TextFormat):void\n\t\t{\n\t\t\tif(this._selectedTextFormat == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._selectedTextFormat = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _styleSheet:StyleSheet;\n\n\t\t/**\n\t\t * The <code>StyleSheet</code> object to pass to the TextField.\n\t\t *\n\t\t * <p>In the following example, a style sheet is applied:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var style:StyleSheet = new StyleSheet();\n\t\t * var heading:Object = new Object();\n\t\t * heading.fontWeight = \"bold\";\n\t\t * heading.color = \"#FF0000\";\n\t\t * \n\t\t * var body:Object = new Object();\n\t\t * body.fontStyle = \"italic\";\n\t\t * \n\t\t * style.setStyle(\".heading\", heading);\n\t\t * style.setStyle(\"body\", body);\n\t\t * \n\t\t * textRenderer.styleSheet = style;\n\t\t * textRenderer.isHTML = true;\n\t\t * textRenderer.text = \"&lt;body&gt;&lt;span class='heading'&gt;Hello&lt;/span&gt; World...&lt;/body&gt;\";</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#styleSheet Full description of flash.text.TextField.styleSheet in Adobe's Flash Platform API Reference\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/StyleSheet.html flash.text.StyleSheet\n\t\t * @see #isHTML\n\t\t */\n\t\tpublic function get styleSheet():StyleSheet\n\t\t{\n\t\t\treturn this._styleSheet;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set styleSheet(value:StyleSheet):void\n\t\t{\n\t\t\tif(this._styleSheet == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._styleSheet = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _embedFonts:Boolean = false;\n\n\t\t/**\n\t\t * If advanced <code>flash.text.TextFormat</code> styles are specified,\n\t\t * determines if the TextField should use an embedded font or not. If\n\t\t * the specified font is not embedded, the text may not be displayed at\n\t\t * all.\n\t\t *\n\t\t * <p>If the font styles are passed in from the parent component, the\n\t\t * text renderer will automatically detect if a font is embedded or not,\n\t\t * and the <code>embedFonts</code> property will be ignored if it is set\n\t\t * to <code>false</code>. Setting it to <code>true</code> will force the\n\t\t * <code>TextField</code> to always try to use embedded fonts.</p>\n\t\t *\n\t\t * <p>In the following example, the font is embedded:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.embedFonts = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#embedFonts Full description of flash.text.TextField.embedFonts in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get embedFonts():Boolean\n\t\t{\n\t\t\treturn this._embedFonts;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set embedFonts(value:Boolean):void\n\t\t{\n\t\t\tif(this._embedFonts == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._embedFonts = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get baseline():Number\n\t\t{\n\t\t\tif(!this.textField)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tvar gutterDimensionsOffset:Number = 0;\n\t\t\tif(this._useGutter || this._border)\n\t\t\t{\n\t\t\t\tgutterDimensionsOffset = 2;\n\t\t\t}\n\t\t\treturn gutterDimensionsOffset + this.textField.getLineMetrics(0).ascent;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _pixelSnapping:Boolean = true;\n\n\t\t/**\n\t\t * Determines if the text should be snapped to the nearest whole pixel\n\t\t * when rendered. When this is <code>false</code>, text may be displayed\n\t\t * on sub-pixels, which often results in blurred rendering due to\n\t\t * texture smoothing.\n\t\t *\n\t\t * <p>In the following example, the text is not snapped to pixels:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.pixelSnapping = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic function get pixelSnapping():Boolean\n\t\t{\n\t\t\treturn this._pixelSnapping;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set pixelSnapping(value:Boolean):void\n\t\t{\n\t\t\tif(this._pixelSnapping === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._pixelSnapping = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _antiAliasType:String = AntiAliasType.ADVANCED;\n\n\t\t/**\n\t\t * The type of anti-aliasing used for this text field, defined as\n\t\t * constants in the <code>flash.text.AntiAliasType</code> class. You can\n\t\t * control this setting only if the font is embedded (with the\n\t\t * <code>embedFonts</code> property set to true).\n\t\t *\n\t\t * <p>In the following example, the anti-alias type is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.antiAliasType = AntiAliasType.NORMAL;</listing>\n\t\t *\n\t\t * @default flash.text.AntiAliasType.ADVANCED\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#antiAliasType Full description of flash.text.TextField.antiAliasType in Adobe's Flash Platform API Reference\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/AntiAliasType.html flash.text.AntiAliasType\n\t\t */\n\t\tpublic function get antiAliasType():String\n\t\t{\n\t\t\treturn this._antiAliasType;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set antiAliasType(value:String):void\n\t\t{\n\t\t\tif(this._antiAliasType == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._antiAliasType = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _background:Boolean = false;\n\n\t\t/**\n\t\t * Specifies whether the text field has a background fill. Use the\n\t\t * <code>backgroundColor</code> property to set the background color of\n\t\t * a text field.\n\t\t *\n\t\t * <p>In the following example, the background is enabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.background = true;\n\t\t * textRenderer.backgroundColor = 0xff0000;</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#background Full description of flash.text.TextField.background in Adobe's Flash Platform API Reference\n\t\t * @see #backgroundColor\n\t\t */\n\t\tpublic function get background():Boolean\n\t\t{\n\t\t\treturn this._background;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set background(value:Boolean):void\n\t\t{\n\t\t\tif(this._background == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._background = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _backgroundColor:uint = 0xffffff;\n\n\t\t/**\n\t\t * The color of the text field background that is displayed if the\n\t\t * <code>background</code> property is set to <code>true</code>.\n\t\t *\n\t\t * <p>In the following example, the background color is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.background = true;\n\t\t * textRenderer.backgroundColor = 0xff000ff;</listing>\n\t\t *\n\t\t * @default 0xffffff\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#backgroundColor Full description of flash.text.TextField.backgroundColor in Adobe's Flash Platform API Reference\n\t\t * @see #background\n\t\t */\n\t\tpublic function get backgroundColor():uint\n\t\t{\n\t\t\treturn this._backgroundColor;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set backgroundColor(value:uint):void\n\t\t{\n\t\t\tif(this._backgroundColor == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._backgroundColor = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _border:Boolean = false;\n\n\t\t/**\n\t\t * Specifies whether the text field has a border. Use the\n\t\t * <code>borderColor</code> property to set the border color.\n\t\t *\n\t\t * <p>Note: If <code>border</code> is set to <code>true</code>, the\n\t\t * component will behave as if <code>useGutter</code> is also set to\n\t\t * <code>true</code> because the border will not render correctly\n\t\t * without the gutter.</p>\n\t\t *\n\t\t * <p>In the following example, the border is enabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.border = true;\n\t\t * textRenderer.borderColor = 0xff0000;</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#border Full description of flash.text.TextField.border in Adobe's Flash Platform API Reference\n\t\t * @see #borderColor\n\t\t */\n\t\tpublic function get border():Boolean\n\t\t{\n\t\t\treturn this._border;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set border(value:Boolean):void\n\t\t{\n\t\t\tif(this._border == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._border = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _borderColor:uint = 0x000000;\n\n\t\t/**\n\t\t * The color of the text field border that is displayed if the\n\t\t * <code>border</code> property is set to <code>true</code>.\n\t\t *\n\t\t * <p>In the following example, the border color is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.border = true;\n\t\t * textRenderer.borderColor = 0xff00ff;</listing>\n\t\t *\n\t\t * @default 0x000000\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#borderColor Full description of flash.text.TextField.borderColor in Adobe's Flash Platform API Reference\n\t\t * @see #border\n\t\t */\n\t\tpublic function get borderColor():uint\n\t\t{\n\t\t\treturn this._borderColor;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set borderColor(value:uint):void\n\t\t{\n\t\t\tif(this._borderColor == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._borderColor = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _condenseWhite:Boolean = false;\n\n\t\t/**\n\t\t * A boolean value that specifies whether extra white space (spaces,\n\t\t * line breaks, and so on) in a text field with HTML text is removed.\n\t\t *\n\t\t * <p>In the following example, whitespace is condensed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.condenseWhite = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#condenseWhite Full description of flash.text.TextField.condenseWhite in Adobe's Flash Platform API Reference\n\t\t * @see #isHTML\n\t\t */\n\t\tpublic function get condenseWhite():Boolean\n\t\t{\n\t\t\treturn this._condenseWhite;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set condenseWhite(value:Boolean):void\n\t\t{\n\t\t\tif(this._condenseWhite == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._condenseWhite = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _displayAsPassword:Boolean = false;\n\n\t\t/**\n\t\t * Specifies whether the text field is a password text field that hides\n\t\t * the input characters using asterisks instead of the actual\n\t\t * characters.\n\t\t *\n\t\t * <p>In the following example, the text is displayed as a password:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.displayAsPassword = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#displayAsPassword Full description of flash.text.TextField.displayAsPassword in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get displayAsPassword():Boolean\n\t\t{\n\t\t\treturn this._displayAsPassword;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set displayAsPassword(value:Boolean):void\n\t\t{\n\t\t\tif(this._displayAsPassword == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._displayAsPassword = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _gridFitType:String = GridFitType.PIXEL;\n\n\t\t/**\n\t\t * Determines whether Flash Player forces strong horizontal and vertical\n\t\t * lines to fit to a pixel or subpixel grid, or not at all using the\n\t\t * constants defined in the <code>flash.text.GridFitType</code> class.\n\t\t * This property applies only if the <code>antiAliasType</code> property\n\t\t * of the text field is set to <code>flash.text.AntiAliasType.ADVANCED</code>.\n\t\t *\n\t\t * <p>In the following example, the grid fit type is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.gridFitType = GridFitType.SUBPIXEL;</listing>\n\t\t *\n\t\t * @default flash.text.GridFitType.PIXEL\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#gridFitType Full description of flash.text.TextField.gridFitType in Adobe's Flash Platform API Reference\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/GridFitType.html flash.text.GridFitType\n\t\t * @see #antiAliasType\n\t\t */\n\t\tpublic function get gridFitType():String\n\t\t{\n\t\t\treturn this._gridFitType;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set gridFitType(value:String):void\n\t\t{\n\t\t\tif(this._gridFitType == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._gridFitType = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _sharpness:Number = 0;\n\n\t\t/**\n\t\t * The sharpness of the glyph edges in this text field. This property\n\t\t * applies only if the <code>antiAliasType</code> property of the text\n\t\t * field is set to <code>flash.text.AntiAliasType.ADVANCED</code>. The\n\t\t * range for <code>sharpness</code> is a number from <code>-400</code>\n\t\t * to <code>400</code>.\n\t\t *\n\t\t * <p>In the following example, the sharpness is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.sharpness = 200;</listing>\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#sharpness Full description of flash.text.TextField.sharpness in Adobe's Flash Platform API Reference\n\t\t * @see #antiAliasType\n\t\t */\n\t\tpublic function get sharpness():Number\n\t\t{\n\t\t\treturn this._sharpness;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set sharpness(value:Number):void\n\t\t{\n\t\t\tif(this._sharpness == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._sharpness = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _thickness:Number = 0;\n\n\t\t/**\n\t\t * The thickness of the glyph edges in this text field. This property\n\t\t * applies only if the <code>antiAliasType</code> property is set to\n\t\t * <code>flash.text.AntiAliasType.ADVANCED</code>. The range for\n\t\t * <code>thickness</code> is a number from <code>-200</code> to\n\t\t * <code>200</code>.\n\t\t *\n\t\t * <p>In the following example, the thickness is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.thickness = 100;</listing>\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#thickness Full description of flash.text.TextField.thickness in Adobe's Flash Platform API Reference\n\t\t * @see #antiAliasType\n\t\t */\n\t\tpublic function get thickness():Number\n\t\t{\n\t\t\treturn this._thickness;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set thickness(value:Number):void\n\t\t{\n\t\t\tif(this._thickness == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._thickness = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maxTextureDimensions:int = 2048;\n\n\t\t/**\n\t\t * The maximum size of individual textures that are managed by this text\n\t\t * renderer. Must be a power of 2. A larger value will create fewer\n\t\t * individual textures, but a smaller value may use less overall texture\n\t\t * memory by incrementing over smaller powers of two.\n\t\t *\n\t\t * <p>In the following example, the maximum size of the textures is\n\t\t * changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.maxTextureDimensions = 4096;</listing>\n\t\t *\n\t\t * @default 2048\n\t\t */\n\t\tpublic function get maxTextureDimensions():int\n\t\t{\n\t\t\treturn this._maxTextureDimensions;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maxTextureDimensions(value:int):void\n\t\t{\n\t\t\t//check if we can use rectangle textures or not\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tif(starling.profile === Context3DProfile.BASELINE_CONSTRAINED)\n\t\t\t{\n\t\t\t\tvalue = MathUtil.getNextPowerOfTwo(value);\n\t\t\t}\n\t\t\tif(this._maxTextureDimensions == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._maxTextureDimensions = value;\n\t\t\tthis._needsNewTexture = true;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _nativeFilters:Array;\n\n\t\t/**\n\t\t * Native filters to pass to the <code>flash.text.TextField</code>\n\t\t * before creating the texture snapshot.\n\t\t *\n\t\t * <p>In the following example, the native filters are changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * renderer.nativeFilters = [ new GlowFilter() ];</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/DisplayObject.html#filters Full description of flash.display.DisplayObject.filters in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get nativeFilters():Array\n\t\t{\n\t\t\treturn this._nativeFilters;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set nativeFilters(value:Array):void\n\t\t{\n\t\t\tif(this._nativeFilters == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._nativeFilters = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _useGutter:Boolean = false;\n\n\t\t/**\n\t\t * Determines if the 2-pixel gutter around the edges of the\n\t\t * <code>flash.text.TextField</code> will be used in measurement and\n\t\t * layout. To visually align with other text renderers and text editors,\n\t\t * it is often best to leave the gutter disabled.\n\t\t *\n\t\t * <p>Returns <code>true</code> if the <code>border</code> property is\n\t\t * <code>true</code>.</p>\n\t\t *\n\t\t * <p>In the following example, the gutter is enabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textEditor.useGutter = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic function get useGutter():Boolean\n\t\t{\n\t\t\treturn this._useGutter || this._border;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set useGutter(value:Boolean):void\n\t\t{\n\t\t\tif(this._useGutter == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._useGutter = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastGlobalScaleX:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastGlobalScaleY:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastContentScaleFactor:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _updateSnapshotOnScaleChange:Boolean = false;\n\n\t\t/**\n\t\t * Refreshes the texture snapshot every time that the text renderer is\n\t\t * scaled. Based on the scale in global coordinates, so scaling the\n\t\t * parent will require a new snapshot.\n\t\t *\n\t\t * <p>Warning: setting this property to true may result in reduced\n\t\t * performance because every change of the scale requires uploading a\n\t\t * new texture to the GPU. Use with caution. Consider setting this\n\t\t * property to false temporarily during animations that modify the\n\t\t * scale.</p>\n\t\t *\n\t\t * <p>In the following example, the snapshot will be updated when the\n\t\t * text renderer is scaled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.updateSnapshotOnScaleChange = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic function get updateSnapshotOnScaleChange():Boolean\n\t\t{\n\t\t\treturn this._updateSnapshotOnScaleChange;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set updateSnapshotOnScaleChange(value:Boolean):void\n\t\t{\n\t\t\tif(this._updateSnapshotOnScaleChange == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._updateSnapshotOnScaleChange = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _useSnapshotDelayWorkaround:Boolean = false;\n\n\t\t/**\n\t\t * Fixes an issue where <code>flash.text.TextField</code> renders\n\t\t * incorrectly when drawn to <code>BitmapData</code> by waiting one\n\t\t * frame.\n\t\t *\n\t\t * <p>Warning: enabling this workaround may cause slight flickering\n\t\t * after the <code>text</code> property is changed.</p>\n\t\t *\n\t\t * <p>In the following example, the workaround is enabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * textRenderer.useSnapshotDelayWorkaround = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic function get useSnapshotDelayWorkaround():Boolean\n\t\t{\n\t\t\treturn this._useSnapshotDelayWorkaround;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set useSnapshotDelayWorkaround(value:Boolean):void\n\t\t{\n\t\t\tif(this._useSnapshotDelayWorkaround == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._useSnapshotDelayWorkaround = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this.textSnapshot)\n\t\t\t{\n\t\t\t\tthis.textSnapshot.texture.dispose();\n\t\t\t\tthis.removeChild(this.textSnapshot, true);\n\t\t\t\tthis.textSnapshot = null;\n\t\t\t}\n\t\t\tif(this.textSnapshots)\n\t\t\t{\n\t\t\t\tvar snapshotCount:int = this.textSnapshots.length;\n\t\t\t\tfor(var i:int = 0; i < snapshotCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar snapshot:Image = this.textSnapshots[i];\n\t\t\t\t\tsnapshot.texture.dispose();\n\t\t\t\t\tthis.removeChild(snapshot, true);\n\t\t\t\t}\n\t\t\t\tthis.textSnapshots = null;\n\t\t\t}\n\t\t\t//this isn't necessary, but if a memory leak keeps the text renderer\n\t\t\t//from being garbage collected, freeing up the text field may help\n\t\t\t//ease major memory pressure from native filters\n\t\t\tthis.textField = null;\n\n\t\t\tthis._previousActualWidth = NaN;\n\t\t\tthis._previousActualHeight = NaN;\n\n\t\t\tthis._needsNewTexture = false;\n\t\t\tthis._snapshotWidth = 0;\n\t\t\tthis._snapshotHeight = 0;\n\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function render(painter:Painter):void\n\t\t{\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tif(this._updateSnapshotOnScaleChange)\n\t\t\t{\n\t\t\t\tthis.getTransformationMatrix(this.stage, HELPER_MATRIX);\n\t\t\t\tvar globalScaleX:Number = matrixToScaleX(HELPER_MATRIX);\n\t\t\t\tvar globalScaleY:Number = matrixToScaleY(HELPER_MATRIX);\n\t\t\t\tif(globalScaleX != this._lastGlobalScaleX ||\n\t\t\t\t\tglobalScaleY != this._lastGlobalScaleY ||\n\t\t\t\t\tstarling.contentScaleFactor != this._lastContentScaleFactor)\n\t\t\t\t{\n\t\t\t\t\t//the snapshot needs to be updated because the scale has\n\t\t\t\t\t//changed since the last snapshot was taken.\n\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\t\tthis.validate();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._needsTextureUpdate)\n\t\t\t{\n\t\t\t\tthis._needsTextureUpdate = false;\n\t\t\t\tif(this._text.length > 0)\n\t\t\t\t{\n\t\t\t\t\tif(this._useSnapshotDelayWorkaround)\n\t\t\t\t\t{\n\t\t\t\t\t\t//we need to wait a frame for the TextField to render\n\t\t\t\t\t\t//properly. sometimes two, and this is a known issue.\n\t\t\t\t\t\tthis.addEventListener(Event.ENTER_FRAME, enterFrameHandler);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.refreshSnapshot();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this.textSnapshot !== null)\n\t\t\t{\n\t\t\t\tvar scaleFactor:Number = starling.contentScaleFactor;\n\t\t\t\tif(!this._nativeFilters || this._nativeFilters.length == 0)\n\t\t\t\t{\n\t\t\t\t\tvar offsetX:Number = 0;\n\t\t\t\t\tvar offsetY:Number = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\toffsetX = this._textSnapshotOffsetX / scaleFactor;\n\t\t\t\t\toffsetY = this._textSnapshotOffsetY / scaleFactor;\n\t\t\t\t}\n\t\t\t\toffsetY += this._verticalAlignOffsetY * scaleFactor;\n\n\t\t\t\tvar snapshotIndex:int = -1;\n\t\t\t\tvar totalBitmapWidth:Number = this._snapshotWidth;\n\t\t\t\tvar totalBitmapHeight:Number = this._snapshotHeight;\n\t\t\t\tvar xPosition:Number = offsetX;\n\t\t\t\tvar yPosition:Number = offsetY;\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\tvar currentBitmapWidth:Number = totalBitmapWidth;\n\t\t\t\t\tif(currentBitmapWidth > this._maxTextureDimensions)\n\t\t\t\t\t{\n\t\t\t\t\t\tcurrentBitmapWidth = this._maxTextureDimensions;\n\t\t\t\t\t}\n\t\t\t\t\tdo\n\t\t\t\t\t{\n\t\t\t\t\t\tvar currentBitmapHeight:Number = totalBitmapHeight;\n\t\t\t\t\t\tif(currentBitmapHeight > this._maxTextureDimensions)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcurrentBitmapHeight = this._maxTextureDimensions;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(snapshotIndex < 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar snapshot:Image = this.textSnapshot;\n\t\t\t\t\t\t\tsnapshot.visible = this._text.length > 0 && this._snapshotWidth > 0 && this._snapshotHeight > 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsnapshot = this.textSnapshots[snapshotIndex];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsnapshot.pixelSnapping = this._pixelSnapping;\n\t\t\t\t\t\tsnapshot.x = xPosition / scaleFactor;\n\t\t\t\t\t\tsnapshot.y = yPosition / scaleFactor;\n\t\t\t\t\t\tsnapshotIndex++;\n\t\t\t\t\t\tyPosition += currentBitmapHeight;\n\t\t\t\t\t\ttotalBitmapHeight -= currentBitmapHeight;\n\t\t\t\t\t}\n\t\t\t\t\twhile(totalBitmapHeight > 0);\n\t\t\t\t\txPosition += currentBitmapWidth;\n\t\t\t\t\ttotalBitmapWidth -= currentBitmapWidth;\n\t\t\t\t\tyPosition = offsetY;\n\t\t\t\t\ttotalBitmapHeight = this._snapshotHeight;\n\t\t\t\t}\n\t\t\t\twhile(totalBitmapWidth > 0);\n\t\t\t}\n\t\t\tsuper.render(painter);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function measureText(result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight)\n\t\t\t{\n\t\t\t\tresult.x = this._explicitWidth;\n\t\t\t\tresult.y = this._explicitHeight;\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\t//if a parent component validates before we're added to the stage,\n\t\t\t//measureText() may be called before initialization, so we need to\n\t\t\t//force it.\n\t\t\tif(!this._isInitialized)\n\t\t\t{\n\t\t\t\tthis.initializeNow();\n\t\t\t}\n\n\t\t\tthis.commit();\n\n\t\t\tresult = this.measure(result);\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * Gets the advanced <code>flash.text.TextFormat</code> font formatting\n\t\t * passed in using <code>setTextFormatForState()</code> for the\n\t\t * specified state.\n\t\t *\n\t\t * <p>If an <code>flash.text.TextFormat</code> is not defined for a\n\t\t * specific state, returns <code>null</code>.</p>\n\t\t *\n\t\t * @see #setTextFormatForState()\n\t\t */\n\t\tpublic function getTextFormatForState(state:String):flash.text.TextFormat\n\t\t{\n\t\t\tif(this._textFormatForState === null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn flash.text.TextFormat(this._textFormatForState[state]);\n\t\t}\n\n\t\t/**\n\t\t * Sets the advanced <code>flash.text.TextFormat</code> font formatting\n\t\t * to be used by the text renderer when the <code>currentState</code>\n\t\t * property of the <code>stateContext</code> matches the specified state\n\t\t * value.\n\t\t *\n\t\t * <p>If a <code>flash.text.TextFormat</code> is not defined for a\n\t\t * specific state, the value of the <code>textFormat</code> property\n\t\t * will be used instead.</p>\n\t\t *\n\t\t * <p>If the <code>disabledTextFormat</code> property is not\n\t\t * <code>null</code> and the <code>isEnabled</code> property is\n\t\t * <code>false</code>, all other text formats will be ignored.</p>\n\t\t *\n\t\t * @see #stateContext\n\t\t * @see #textFormat\n\t\t */\n\t\tpublic function setTextFormatForState(state:String, textFormat:flash.text.TextFormat):void\n\t\t{\n\t\t\tif(textFormat)\n\t\t\t{\n\t\t\t\tif(!this._textFormatForState)\n\t\t\t\t{\n\t\t\t\t\tthis._textFormatForState = {};\n\t\t\t\t}\n\t\t\t\tthis._textFormatForState[state] = textFormat;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdelete this._textFormatForState[state];\n\t\t\t}\n\t\t\t//if the context's current state is the state that we're modifying,\n\t\t\t//we need to use the new value immediately.\n\t\t\tif(this._stateContext && this._stateContext.currentState === state)\n\t\t\t{\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_STATE);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tif(this.textField === null)\n\t\t\t{\n\t\t\t\tthis.textField = new TextField();\n\t\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\t\tvar scaleFactor:Number = starling.contentScaleFactor;\n\t\t\t\tthis.textField.scaleX = scaleFactor;\n\t\t\t\tthis.textField.scaleY = scaleFactor;\n\t\t\t\tthis.textField.mouseEnabled = this.textField.mouseWheelEnabled = false;\n\t\t\t\tthis.textField.selectable = false;\n\t\t\t\tthis.textField.multiline = true;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar sizeInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_SIZE);\n\n\t\t\tthis.commit();\n\n\t\t\tthis._hasMeasured = false;\n\t\t\tsizeInvalid = this.autoSizeIfNeeded() || sizeInvalid;\n\t\t\tthis._verticalAlignOffsetY = this.getVerticalAlignOffsetY();\n\n\t\t\tthis.layout(sizeInvalid);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function commit():void\n\t\t{\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\n\t\t\tif(stylesInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.refreshTextFormat();\n\t\t\t}\n\n\t\t\tif(stylesInvalid)\n\t\t\t{\n\t\t\t\tthis.textField.antiAliasType = this._antiAliasType;\n\t\t\t\tthis.textField.background = this._background;\n\t\t\t\tthis.textField.backgroundColor = this._backgroundColor;\n\t\t\t\tthis.textField.border = this._border;\n\t\t\t\tthis.textField.borderColor = this._borderColor;\n\t\t\t\tthis.textField.condenseWhite = this._condenseWhite;\n\t\t\t\tthis.textField.displayAsPassword = this._displayAsPassword;\n\t\t\t\tthis.textField.gridFitType = this._gridFitType;\n\t\t\t\tthis.textField.sharpness = this._sharpness;\n\t\t\t\tthis.textField.thickness = this._thickness;\n\t\t\t\tthis.textField.filters = this._nativeFilters;\n\t\t\t}\n\n\t\t\tif(dataInvalid || stylesInvalid || stateInvalid)\n\t\t\t{\n\t\t\t\tthis.textField.wordWrap = this._wordWrap;\n\t\t\t\tif(this._styleSheet)\n\t\t\t\t{\n\t\t\t\t\tthis.textField.embedFonts = this._embedFonts;\n\t\t\t\t\tthis.textField.styleSheet = this._styleSheet;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(!this._embedFonts &&\n\t\t\t\t\t\tthis._currentTextFormat === this._fontStylesTextFormat)\n\t\t\t\t\t{\n\t\t\t\t\t\t//when font styles are passed in from the parent component, we\n\t\t\t\t\t\t//automatically determine if the TextField should use embedded\n\t\t\t\t\t\t//fonts, unless embedFonts is explicitly true\n\t\t\t\t\t\tthis.textField.embedFonts = SystemUtil.isEmbeddedFont(\n\t\t\t\t\t\t\tthis._currentTextFormat.font, this._currentTextFormat.bold,\n\t\t\t\t\t\t\tthis._currentTextFormat.italic, FontType.EMBEDDED);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.textField.embedFonts = this._embedFonts;\n\t\t\t\t\t}\n\t\t\t\t\tthis.textField.styleSheet = null;\n\t\t\t\t\tthis.textField.defaultTextFormat = this._currentTextFormat;\n\t\t\t\t}\n\t\t\t\tif(this._isHTML)\n\t\t\t\t{\n\t\t\t\t\tthis.textField.htmlText = this._text;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.textField.text = this._text;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function measure(result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\n\t\t\tthis.textField.autoSize = TextFieldAutoSize.LEFT;\n\t\t\tthis.textField.wordWrap = false;\n\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar scaleFactor:Number = starling.contentScaleFactor;\n\t\t\tvar gutterDimensionsOffset:Number = 4;\n\t\t\tif(this._useGutter || this._border)\n\t\t\t{\n\t\t\t\tgutterDimensionsOffset = 0;\n\t\t\t}\n\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\t//yes, this value is never used. this is a workaround for a bug\n\t\t\t\t//in AIR for iOS where getting the value for textField.width the\n\t\t\t\t//first time results in an incorrect value, but if you query it\n\t\t\t\t//again, for some reason, it reports the correct width value.\n\t\t\t\tvar hackWorkaround:Number = this.textField.width;\n\t\t\t\tnewWidth = (this.textField.width / scaleFactor) - gutterDimensionsOffset;\n\t\t\t\tif(newWidth < this._explicitMinWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this._explicitMinWidth;\n\t\t\t\t}\n\t\t\t\telse if(newWidth > this._explicitMaxWidth)\n\t\t\t\t{\n\t\t\t\t\tnewWidth = this._explicitMaxWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//and this is a workaround for an issue where flash.text.TextField\n\t\t\t//will wrap the last word when you pass the value returned by the\n\t\t\t//width getter (when TextFieldAutoSize.LEFT is used) to the width\n\t\t\t//setter. In other words, the value technically isn't changing, but\n\t\t\t//TextField behaves differently.\n\t\t\tif(!needsWidth || ((this.textField.width / scaleFactor) - gutterDimensionsOffset) > newWidth)\n\t\t\t{\n\t\t\t\tthis.textField.width = newWidth + gutterDimensionsOffset;\n\t\t\t\tthis.textField.wordWrap = this._wordWrap;\n\t\t\t}\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tnewHeight = (this.textField.height / scaleFactor) - gutterDimensionsOffset;\n\t\t\t\t//from what I can gather, TextField measures in twips, like many\n\t\t\t\t//things in Flash. if the result of the calculation above is\n\t\t\t\t//just below the nearest twip (due to a rounding error or\n\t\t\t\t//whatever), some of the text may be cut off. as a workaround,\n\t\t\t\t//round up to nearest twip.\n\t\t\t\tnewHeight = roundUpToNearest(newHeight, 0.05);\n\t\t\t\tif(newHeight < this._explicitMinHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this._explicitMinHeight;\n\t\t\t\t}\n\t\t\t\telse if(newHeight > this._explicitMaxHeight)\n\t\t\t\t{\n\t\t\t\t\tnewHeight = this._explicitMaxHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.textField.autoSize = TextFieldAutoSize.NONE;\n\n\t\t\t//put the width and height back just in case we measured without\n\t\t\t//a full validation\n\t\t\tthis.textField.width = this.actualWidth + gutterDimensionsOffset;\n\t\t\tthis.textField.height = this.actualHeight + gutterDimensionsOffset;\n\n\t\t\tresult.x = newWidth;\n\t\t\tresult.y = newHeight;\n\n\t\t\tthis._hasMeasured = true;\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layout(sizeInvalid:Boolean):void\n\t\t{\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar dataInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_DATA);\n\t\t\tvar stateInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STATE);\n\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar scaleFactor:Number = starling.contentScaleFactor;\n\t\t\tvar gutterDimensionsOffset:Number = 4;\n\t\t\tif(this._useGutter || this._border)\n\t\t\t{\n\t\t\t\tgutterDimensionsOffset = 0;\n\t\t\t}\n\n\t\t\t//if measure() isn't called, we need to apply the same workaround\n\t\t\t//for the flash.text.TextField bug with wordWrap.\n\t\t\tif(!this._hasMeasured && this._wordWrap)\n\t\t\t{\n\t\t\t\tthis.textField.autoSize = TextFieldAutoSize.LEFT;\n\t\t\t\tthis.textField.wordWrap = false;\n\t\t\t\tif(((this.textField.width / scaleFactor) - gutterDimensionsOffset) > this.actualWidth)\n\t\t\t\t{\n\t\t\t\t\tthis.textField.wordWrap = true;\n\t\t\t\t}\n\t\t\t\tthis.textField.autoSize = TextFieldAutoSize.NONE;\n\t\t\t\tthis.textField.width = this.actualWidth + gutterDimensionsOffset;\n\t\t\t}\n\t\t\tif(sizeInvalid)\n\t\t\t{\n\t\t\t\tthis.textField.width = this.actualWidth + gutterDimensionsOffset;\n\t\t\t\tthis.textField.height = this.actualHeight + gutterDimensionsOffset;\n\t\t\t\tthis.calculateSnapshotDimensions();\n\t\t\t}\n\n\t\t\t//instead of checking sizeInvalid, which will often be triggered by\n\t\t\t//changing maxWidth or something for measurement, we check against\n\t\t\t//the previous actualWidth/Height used for the snapshot.\n\t\t\tif(stylesInvalid || dataInvalid || stateInvalid || this._needsNewTexture ||\n\t\t\t\tthis.actualWidth != this._previousActualWidth ||\n\t\t\t\tthis.actualHeight != this._previousActualHeight)\n\t\t\t{\n\t\t\t\tthis._previousActualWidth = this.actualWidth;\n\t\t\t\tthis._previousActualHeight = this.actualHeight;\n\t\t\t\t//we're going to update the texture in render() because\n\t\t\t\t//there's a chance that it will be updated more than once per\n\t\t\t\t//frame if we do it here.\n\t\t\t\tthis._needsTextureUpdate = true;\n\t\t\t\tthis.setRequiresRedraw();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * If the component's dimensions have not been set explicitly, it will\n\t\t * measure its content and determine an ideal size for itself. If the\n\t\t * <code>explicitWidth</code> or <code>explicitHeight</code> member\n\t\t * variables are set, those value will be used without additional\n\t\t * measurement. If one is set, but not the other, the dimension with the\n\t\t * explicit value will not be measured, but the other non-explicit\n\t\t * dimension will still need measurement.\n\t\t *\n\t\t * <p>Calls <code>saveMeasurements()</code> to set up the\n\t\t * <code>actualWidth</code> and <code>actualHeight</code> member\n\t\t * variables used for layout.</p>\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t */\n\t\tprotected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tvar needsMinWidth:Boolean = this._explicitMinWidth !== this._explicitMinWidth; //isNaN\n\t\t\tvar needsMinHeight:Boolean = this._explicitMinHeight !== this._explicitMinHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tthis.measure(HELPER_POINT);\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tnewWidth = HELPER_POINT.x;\n\t\t\t}\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tnewHeight = HELPER_POINT.y;\n\t\t\t}\n\t\t\tvar newMinWidth:Number = this._explicitMinWidth;\n\t\t\tif(needsMinWidth)\n\t\t\t{\n\t\t\t\tif(needsWidth)\n\t\t\t\t{\n\t\t\t\t\t//this allows wrapping or truncation\n\t\t\t\t\tnewMinWidth = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnewMinWidth = newWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar newMinHeight:Number = this._explicitMinHeight;\n\t\t\tif(needsMinHeight)\n\t\t\t{\n\t\t\t\tnewMinHeight = newHeight;\n\t\t\t}\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newMinWidth, newMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function measureNativeFilters(bitmapData:BitmapData, result:Rectangle = null):Rectangle\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Rectangle();\n\t\t\t}\n\t\t\tvar resultX:Number = 0;\n\t\t\tvar resultY:Number = 0;\n\t\t\tvar resultWidth:Number = 0;\n\t\t\tvar resultHeight:Number = 0;\n\t\t\tvar filterCount:int = this._nativeFilters.length;\n\t\t\tfor(var i:int = 0; i < filterCount; i++)\n\t\t\t{\n\t\t\t\tvar filter:BitmapFilter = this._nativeFilters[i];\n\t\t\t\tvar filterRect:Rectangle = bitmapData.generateFilterRect(bitmapData.rect, filter);\n\t\t\t\tvar filterX:Number = filterRect.x;\n\t\t\t\tvar filterY:Number = filterRect.y;\n\t\t\t\tvar filterWidth:Number = filterRect.width;\n\t\t\t\tvar filterHeight:Number = filterRect.height;\n\t\t\t\tif(resultX > filterX)\n\t\t\t\t{\n\t\t\t\t\tresultX = filterX;\n\t\t\t\t}\n\t\t\t\tif(resultY > filterY)\n\t\t\t\t{\n\t\t\t\t\tresultY = filterY;\n\t\t\t\t}\n\t\t\t\tif(resultWidth < filterWidth)\n\t\t\t\t{\n\t\t\t\t\tresultWidth = filterWidth;\n\t\t\t\t}\n\t\t\t\tif(resultHeight < filterHeight)\n\t\t\t\t{\n\t\t\t\t\tresultHeight = filterHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult.setTo(resultX, resultY, resultWidth, resultHeight);\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshTextFormat():void\n\t\t{\n\t\t\tvar textFormat:flash.text.TextFormat;\n\t\t\tif(this._stateContext !== null)\n\t\t\t{\n\t\t\t\tif(this._textFormatForState !== null)\n\t\t\t\t{\n\t\t\t\t\tvar currentState:String = this._stateContext.currentState;\n\t\t\t\t\tif(currentState in this._textFormatForState)\n\t\t\t\t\t{\n\t\t\t\t\t\ttextFormat = flash.text.TextFormat(this._textFormatForState[currentState]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(textFormat === null && this._disabledTextFormat !== null &&\n\t\t\t\t\tthis._stateContext is IFeathersControl && !IFeathersControl(this._stateContext).isEnabled)\n\t\t\t\t{\n\t\t\t\t\ttextFormat = this._disabledTextFormat;\n\t\t\t\t}\n\t\t\t\tif(textFormat === null && this._selectedTextFormat !== null &&\n\t\t\t\t\tthis._stateContext is IToggle && IToggle(this._stateContext).isSelected)\n\t\t\t\t{\n\t\t\t\t\ttextFormat = this._selectedTextFormat;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //no state context\n\t\t\t{\n\t\t\t\t//we can still check if the text renderer is disabled to see if\n\t\t\t\t//we should use disabledTextFormat\n\t\t\t\tif(!this._isEnabled && this._disabledTextFormat !== null)\n\t\t\t\t{\n\t\t\t\t\ttextFormat = this._disabledTextFormat;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(textFormat === null)\n\t\t\t{\n\t\t\t\ttextFormat = this._textFormat;\n\t\t\t}\n\t\t\t//flash.text.TextFormat is considered more advanced, so it gets\n\t\t\t//precedence over starling.text.TextFormat font styles\n\t\t\tif(textFormat === null)\n\t\t\t{\n\t\t\t\ttextFormat = this.getTextFormatFromFontStyles();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//if using flash.text.TextFormat, vertical align is always top\n\t\t\t\tthis._currentVerticalAlign = Align.TOP;\n\t\t\t}\n\t\t\tthis._currentTextFormat = textFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getTextFormatFromFontStyles():flash.text.TextFormat\n\t\t{\n\t\t\tif(this.isInvalid(INVALIDATION_FLAG_STYLES) ||\n\t\t\t\tthis.isInvalid(INVALIDATION_FLAG_STATE))\n\t\t\t{\n\t\t\t\tvar fontStylesFormat:starling.text.TextFormat;\n\t\t\t\tif(this._fontStyles !== null)\n\t\t\t\t{\n\t\t\t\t\tfontStylesFormat = this._fontStyles.getTextFormatForTarget(this);\n\t\t\t\t}\n\t\t\t\tif(fontStylesFormat !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._fontStylesTextFormat = fontStylesFormat.toNativeFormat(this._fontStylesTextFormat);\n\t\t\t\t\tthis._currentVerticalAlign = fontStylesFormat.verticalAlign;\n\t\t\t\t}\n\t\t\t\telse if(this._fontStylesTextFormat === null)\n\t\t\t\t{\n\t\t\t\t\t//fallback to a default so that something is displayed\n\t\t\t\t\tthis._fontStylesTextFormat = new flash.text.TextFormat();\n\t\t\t\t\tthis._currentVerticalAlign = Align.TOP;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this._fontStylesTextFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getVerticalAlignOffsetY():Number\n\t\t{\n\t\t\tvar textFieldTextHeight:Number = this.textField.textHeight;\n\t\t\tif(textFieldTextHeight > this.actualHeight)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tif(this._currentVerticalAlign === Align.BOTTOM)\n\t\t\t{\n\t\t\t\treturn this.actualHeight - textFieldTextHeight;\n\t\t\t}\n\t\t\telse if(this._currentVerticalAlign === Align.CENTER)\n\t\t\t{\n\t\t\t\treturn (this.actualHeight - textFieldTextHeight) / 2;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createTextureOnRestoreCallback(snapshot:Image):void\n\t\t{\n\t\t\tvar self:TextFieldTextRenderer = this;\n\t\t\tvar texture:Texture = snapshot.texture;\n\t\t\ttexture.root.onRestore = function():void\n\t\t\t{\n\t\t\t\tvar starling:Starling = self.stage !== null ? self.stage.starling : Starling.current;\n\t\t\t\tvar scaleFactor:Number = starling.contentScaleFactor;\n\t\t\t\tHELPER_MATRIX.identity();\n\t\t\t\tHELPER_MATRIX.scale(scaleFactor, scaleFactor);\n\t\t\t\tvar offsetY:Number = self.getVerticalAlignOffsetY();\n\t\t\t\tvar bitmapData:BitmapData = self.drawTextFieldRegionToBitmapData(\n\t\t\t\t\tsnapshot.x, snapshot.y - offsetY, texture.nativeWidth, texture.nativeHeight);\n\t\t\t\ttexture.root.uploadBitmapData(bitmapData);\n\t\t\t\tbitmapData.dispose();\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function drawTextFieldRegionToBitmapData(textFieldX:Number, textFieldY:Number,\n\t\t\tbitmapWidth:Number, bitmapHeight:Number, bitmapData:BitmapData = null):BitmapData\n\t\t{\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar scaleFactor:Number = starling.contentScaleFactor;\n\t\t\tvar clipWidth:Number = this._snapshotVisibleWidth - textFieldX;\n\t\t\tvar clipHeight:Number = this._snapshotVisibleHeight - textFieldY;\n\t\t\tif(!bitmapData || bitmapData.width != bitmapWidth || bitmapData.height != bitmapHeight)\n\t\t\t{\n\t\t\t\tif(bitmapData)\n\t\t\t\t{\n\t\t\t\t\tbitmapData.dispose();\n\t\t\t\t}\n\t\t\t\tbitmapData = new BitmapData(bitmapWidth, bitmapHeight, true, 0x00ff00ff);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//clear the bitmap data and reuse it\n\t\t\t\tbitmapData.fillRect(bitmapData.rect, 0x00ff00ff);\n\t\t\t}\n\t\t\tvar gutterPositionOffset:Number = 2 * scaleFactor;\n\t\t\tif(this._useGutter || this._border)\n\t\t\t{\n\t\t\t\tgutterPositionOffset = 0;\n\t\t\t}\n\t\t\tHELPER_MATRIX.tx = -(textFieldX + gutterPositionOffset) - this._textSnapshotOffsetX;\n\t\t\tHELPER_MATRIX.ty = -(textFieldY + gutterPositionOffset) - this._textSnapshotOffsetY;\n\t\t\tHELPER_RECTANGLE.setTo(0, 0, clipWidth, clipHeight);\n\t\t\tbitmapData.draw(this.textField, HELPER_MATRIX, null, null, HELPER_RECTANGLE);\n\t\t\treturn bitmapData;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function calculateSnapshotDimensions():void\n\t\t{\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar scaleFactor:Number = starling.contentScaleFactor;\n\t\t\tthis._lastContentScaleFactor = scaleFactor;\n\t\t\t//these are getting put into an int later, so we don't want it\n\t\t\t//to possibly round down and cut off part of the text.\n\t\t\tvar rectangleSnapshotWidth:Number = Math.ceil(this.textField.width);\n\t\t\tvar rectangleSnapshotHeight:Number = Math.ceil(this.textField.height);\n\t\t\tif(this._updateSnapshotOnScaleChange)\n\t\t\t{\n\t\t\t\tthis.getTransformationMatrix(this.stage, HELPER_MATRIX);\n\t\t\t\tthis._lastGlobalScaleX = matrixToScaleX(HELPER_MATRIX);\n\t\t\t\tthis._lastGlobalScaleY = matrixToScaleY(HELPER_MATRIX);\n\t\t\t\trectangleSnapshotWidth *= this._lastGlobalScaleX;\n\t\t\t\trectangleSnapshotHeight *= this._lastGlobalScaleY;\n\t\t\t}\n\t\t\tif(rectangleSnapshotWidth >= 1 && rectangleSnapshotHeight >= 1 &&\n\t\t\t\tthis._nativeFilters !== null && this._nativeFilters.length > 0)\n\t\t\t{\n\t\t\t\tHELPER_MATRIX.identity();\n\t\t\t\tHELPER_MATRIX.scale(scaleFactor, scaleFactor);\n\t\t\t\tvar bitmapData:BitmapData = new BitmapData(rectangleSnapshotWidth, rectangleSnapshotHeight, true, 0x00ff00ff);\n\t\t\t\tbitmapData.draw(this.textField, HELPER_MATRIX, null, null, HELPER_RECTANGLE);\n\t\t\t\tthis.measureNativeFilters(bitmapData, HELPER_RECTANGLE);\n\t\t\t\tbitmapData.dispose();\n\t\t\t\tbitmapData = null;\n\t\t\t\tthis._textSnapshotOffsetX = HELPER_RECTANGLE.x;\n\t\t\t\tthis._textSnapshotOffsetY = HELPER_RECTANGLE.y;\n\t\t\t\trectangleSnapshotWidth = HELPER_RECTANGLE.width;\n\t\t\t\trectangleSnapshotHeight = HELPER_RECTANGLE.height;\n\t\t\t}\n\t\t\tvar point:Point = Pool.getPoint();\n\t\t\tcalculateSnapshotTextureDimensions(rectangleSnapshotWidth,\n\t\t\t\trectangleSnapshotHeight, this._maxTextureDimensions,\n\t\t\t\tstarling.profile !== Context3DProfile.BASELINE_CONSTRAINED, point);\n\t\t\t//the full dimensions of the texture\n\t\t\tthis._snapshotWidth = point.x;\n\t\t\tthis._snapshotHeight = point.y;\n\t\t\t//the clipping dimensions of the texture, if it is next power-of-two\n\t\t\tthis._snapshotVisibleWidth = rectangleSnapshotWidth;\n\t\t\tthis._snapshotVisibleHeight = rectangleSnapshotHeight;\n\t\t\tPool.putPoint(point);\n\n\t\t\tvar textureRoot:ConcreteTexture = this.textSnapshot ? this.textSnapshot.texture.root : null;\n\t\t\tthis._needsNewTexture = this._needsNewTexture || this.textSnapshot === null ||\n\t\t\t\t(textureRoot !== null && (textureRoot.scale != scaleFactor ||\n\t\t\t\tthis._snapshotWidth != textureRoot.nativeWidth || this._snapshotHeight != textureRoot.nativeHeight));\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshSnapshot():void\n\t\t{\n\t\t\tif(this._snapshotWidth <= 0 || this._snapshotHeight <= 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\tvar scaleFactor:Number = starling.contentScaleFactor;\n\t\t\tif(this._updateSnapshotOnScaleChange)\n\t\t\t{\n\t\t\t\tthis.getTransformationMatrix(this.stage, HELPER_MATRIX);\n\t\t\t\tvar globalScaleX:Number = matrixToScaleX(HELPER_MATRIX);\n\t\t\t\tvar globalScaleY:Number = matrixToScaleY(HELPER_MATRIX);\n\t\t\t}\n\t\t\tHELPER_MATRIX.identity();\n\t\t\tHELPER_MATRIX.scale(scaleFactor, scaleFactor);\n\t\t\tif(this._updateSnapshotOnScaleChange)\n\t\t\t{\n\t\t\t\tHELPER_MATRIX.scale(globalScaleX, globalScaleY);\n\t\t\t}\n\t\t\tvar totalBitmapWidth:Number = this._snapshotWidth;\n\t\t\tvar totalBitmapHeight:Number = this._snapshotHeight;\n\t\t\tvar xPosition:Number = 0;\n\t\t\tvar yPosition:Number = 0;\n\t\t\tvar bitmapData:BitmapData;\n\t\t\tvar snapshotIndex:int = -1;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tvar currentBitmapWidth:Number = totalBitmapWidth;\n\t\t\t\tif(currentBitmapWidth > this._maxTextureDimensions)\n\t\t\t\t{\n\t\t\t\t\tcurrentBitmapWidth = this._maxTextureDimensions;\n\t\t\t\t}\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\tvar currentBitmapHeight:Number = totalBitmapHeight;\n\t\t\t\t\tif(currentBitmapHeight > this._maxTextureDimensions)\n\t\t\t\t\t{\n\t\t\t\t\t\tcurrentBitmapHeight = this._maxTextureDimensions;\n\t\t\t\t\t}\n\t\t\t\t\tbitmapData = this.drawTextFieldRegionToBitmapData(xPosition, yPosition,\n\t\t\t\t\t\tcurrentBitmapWidth, currentBitmapHeight, bitmapData);\n\t\t\t\t\tvar newTexture:Texture;\n\t\t\t\t\tif(!this.textSnapshot || this._needsNewTexture)\n\t\t\t\t\t{\n\t\t\t\t\t\t//skip Texture.fromBitmapData() because we don't want\n\t\t\t\t\t\t//it to create an onRestore function that will be\n\t\t\t\t\t\t//immediately discarded for garbage collection.\n\t\t\t\t\t\tnewTexture = Texture.empty(bitmapData.width / scaleFactor, bitmapData.height / scaleFactor,\n\t\t\t\t\t\t\ttrue, false, false, scaleFactor);\n\t\t\t\t\t\tnewTexture.root.uploadBitmapData(bitmapData);\n\t\t\t\t\t}\n\t\t\t\t\tvar snapshot:Image = null;\n\t\t\t\t\tif(snapshotIndex >= 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(!this.textSnapshots)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.textSnapshots = new <Image>[];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(this.textSnapshots.length > snapshotIndex)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsnapshot = this.textSnapshots[snapshotIndex];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tsnapshot = this.textSnapshot;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!snapshot)\n\t\t\t\t\t{\n\t\t\t\t\t\tsnapshot = new Image(newTexture);\n\t\t\t\t\t\tsnapshot.pixelSnapping = true;\n\t\t\t\t\t\tthis.addChild(snapshot);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._needsNewTexture)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsnapshot.texture.dispose();\n\t\t\t\t\t\t\tsnapshot.texture = newTexture;\n\t\t\t\t\t\t\tsnapshot.readjustSize();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//this is faster, if we haven't resized the bitmapdata\n\t\t\t\t\t\t\tvar existingTexture:Texture = snapshot.texture;\n\t\t\t\t\t\t\texistingTexture.root.uploadBitmapData(bitmapData);\n\t\t\t\t\t\t\t//however, the image won't be notified that its\n\t\t\t\t\t\t\t//texture has changed, so we need to do it manually\n\t\t\t\t\t\t\tthis.textSnapshot.setRequiresRedraw();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(newTexture)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.createTextureOnRestoreCallback(snapshot);\n\t\t\t\t\t}\n\t\t\t\t\tif(snapshotIndex >= 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.textSnapshots[snapshotIndex] = snapshot;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.textSnapshot = snapshot;\n\t\t\t\t\t}\n\t\t\t\t\tsnapshot.x = xPosition / scaleFactor;\n\t\t\t\t\tsnapshot.y = yPosition / scaleFactor;\n\t\t\t\t\tif(this._updateSnapshotOnScaleChange)\n\t\t\t\t\t{\n\t\t\t\t\t\tsnapshot.scaleX = 1 / globalScaleX;\n\t\t\t\t\t\tsnapshot.scaleY = 1 / globalScaleY;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tsnapshot.scale = 1;\n\t\t\t\t\t}\n\t\t\t\t\tsnapshotIndex++;\n\t\t\t\t\tyPosition += currentBitmapHeight;\n\t\t\t\t\ttotalBitmapHeight -= currentBitmapHeight;\n\t\t\t\t}\n\t\t\t\twhile(totalBitmapHeight > 0);\n\t\t\t\txPosition += currentBitmapWidth;\n\t\t\t\ttotalBitmapWidth -= currentBitmapWidth;\n\t\t\t\tyPosition = 0;\n\t\t\t\ttotalBitmapHeight = this._snapshotHeight;\n\t\t\t}\n\t\t\twhile(totalBitmapWidth > 0);\n\t\t\tbitmapData.dispose();\n\t\t\tif(this.textSnapshots)\n\t\t\t{\n\t\t\t\tvar snapshotCount:int = this.textSnapshots.length;\n\t\t\t\tfor(var i:int = snapshotIndex; i < snapshotCount; i++)\n\t\t\t\t{\n\t\t\t\t\tsnapshot = this.textSnapshots[i];\n\t\t\t\t\tsnapshot.texture.dispose();\n\t\t\t\t\tsnapshot.removeFromParent(true);\n\t\t\t\t}\n\t\t\t\tif(snapshotIndex == 0)\n\t\t\t\t{\n\t\t\t\t\tthis.textSnapshots = null;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.textSnapshots.length = snapshotIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._updateSnapshotOnScaleChange)\n\t\t\t{\n\t\t\t\tthis._lastGlobalScaleX = globalScaleX;\n\t\t\t\tthis._lastGlobalScaleY = globalScaleY;\n\t\t\t\tthis._lastContentScaleFactor = scaleFactor;\n\t\t\t}\n\t\t\tthis._needsNewTexture = false;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function enterFrameHandler(event:Event):void\n\t\t{\n\t\t\tthis.removeEventListener(Event.ENTER_FRAME, enterFrameHandler);\n\t\t\tthis.refreshSnapshot();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/BaseTextEditor.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\timport feathers.events.FeathersEventType;\n\timport feathers.text.FontStylesSet;\n\n\timport starling.events.Event;\n\n\t/**\n\t * A base class for text editors that implements some common properties.\n\t *\n\t * @productversion Feathers 3.1.0\n\t */\n\tpublic class BaseTextEditor extends FeathersControl implements IStateObserver\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function BaseTextEditor()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _text:String = \"\";\n\n\t\t/**\n\t\t * @copy feathers.core.ITextEditor#text\n\t\t */\n\t\tpublic function get text():String\n\t\t{\n\t\t\treturn this._text;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set text(value:String):void\n\t\t{\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\t//don't allow null or undefined\n\t\t\t\tvalue = \"\";\n\t\t\t}\n\t\t\tif(this._text == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._text = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _stateContext:IStateContext;\n\n\t\t/**\n\t\t * When the text editor observes a state context, the text editor may\n\t\t * change its font styles based on the current state of that context.\n\t\t * Typically, a relevant component will automatically assign itself as\n\t\t * the state context of a text editor, so this property is typically\n\t\t * meant for internal use only.\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #setFontStylesForState()\n\t\t */\n\t\tpublic function get stateContext():IStateContext\n\t\t{\n\t\t\treturn this._stateContext;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set stateContext(value:IStateContext):void\n\t\t{\n\t\t\tif(this._stateContext === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._stateContext)\n\t\t\t{\n\t\t\t\tthis._stateContext.removeEventListener(FeathersEventType.STATE_CHANGE, stateContext_stateChangeHandler);\n\t\t\t}\n\t\t\tthis._stateContext = value;\n\t\t\tif(this._stateContext)\n\t\t\t{\n\t\t\t\tthis._stateContext.addEventListener(FeathersEventType.STATE_CHANGE, stateContext_stateChangeHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STATE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fontStyles:FontStylesSet;\n\n\t\t/**\n\t\t * @copy feathers.core.ITextEditor#fontStyles\n\t\t */\n\t\tpublic function get fontStyles():FontStylesSet\n\t\t{\n\t\t\treturn this._fontStyles;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set fontStyles(value:FontStylesSet):void\n\t\t{\n\t\t\tif(this._fontStyles === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._fontStyles !== null)\n\t\t\t{\n\t\t\t\tthis._fontStyles.removeEventListener(Event.CHANGE, fontStylesSet_changeHandler);\n\t\t\t}\n\t\t\tthis._fontStyles = value;\n\t\t\tif(this._fontStyles !== null)\n\t\t\t{\n\t\t\t\tthis._fontStyles.addEventListener(Event.CHANGE, fontStylesSet_changeHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tthis.stateContext = null;\n\t\t\tthis.fontStyles = null;\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stateContext_stateChangeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STATE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function fontStylesSet_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/DefaultFocusManager.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\timport feathers.controls.supportClasses.LayoutViewPort;\n\timport feathers.core.IFocusContainer;\n\timport feathers.core.IFocusDisplayObject;\n\timport feathers.core.IFocusExtras;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.RelativePosition;\n\timport feathers.system.DeviceCapabilities;\n\timport feathers.utils.focus.isBetterFocusForRelativePosition;\n\n\timport flash.display.InteractiveObject;\n\timport flash.display.Stage;\n\timport flash.errors.IllegalOperationError;\n\timport flash.events.FocusEvent;\n\timport flash.events.IEventDispatcher;\n\timport flash.events.KeyboardEvent;\n\timport flash.events.TransformGestureEvent;\n\timport flash.geom.Rectangle;\n\timport flash.system.Capabilities;\n\timport flash.ui.KeyLocation;\n\timport flash.ui.Keyboard;\n\timport flash.utils.Dictionary;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.display.DisplayObjectContainer;\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.utils.Pool;\n\n\t/**\n\t * Dispatched when the value of the <code>focus</code> property changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t *\n\t * @see #focus\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * The default <code>IFocusManager</code> implementation. This focus\n\t * manager is designed to work on both desktop and mobile. Focus may be\n\t * controlled by <code>Keyboard.TAB</code> (including going\n\t * backwards when holding the shift key) or with the arrow keys on a d-pad\n\t * (such as those that appear on a smart TV remote control and some game\n\t * controllers).\n\t *\n\t * <p>To simulate <code>KeyLocation.D_PAD</code> in the AIR Debug\n\t * Launcher on desktop for debugging purposes, set\n\t * <code>DeviceCapabilities.simulateDPad</code> to <code>true</code>.</p>\n\t *\n\t * @see ../../../help/focus.html Keyboard focus management in Feathers\n\t * @see feathers.core.FocusManager\n\t *\n\t * @productversion Feathers 2.0.0\n\t */\n\tpublic class DefaultFocusManager extends EventDispatcher implements IFocusManager\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static var NATIVE_STAGE_TO_FOCUS_TARGET:Dictionary = new Dictionary(true);\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function DefaultFocusManager(root:DisplayObjectContainer)\n\t\t{\n\t\t\tif(!root.stage)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"Focus manager root must be added to the stage.\");\n\t\t\t}\n\t\t\tthis._root = root;\n\t\t\tthis._starling = root.stage.starling;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _starling:Starling;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _nativeFocusTarget:NativeFocusTarget;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _root:DisplayObjectContainer;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get root():DisplayObjectContainer\n\t\t{\n\t\t\treturn this._root;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isEnabled:Boolean = false;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic function get isEnabled():Boolean\n\t\t{\n\t\t\treturn this._isEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isEnabled(value:Boolean):void\n\t\t{\n\t\t\tif(this._isEnabled == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isEnabled = value;\n\t\t\tif(this._isEnabled)\n\t\t\t{\n\t\t\t\tthis._nativeFocusTarget = NATIVE_STAGE_TO_FOCUS_TARGET[this._starling.nativeStage] as NativeFocusTarget;\n\t\t\t\tif(!this._nativeFocusTarget)\n\t\t\t\t{\n\t\t\t\t\tthis._nativeFocusTarget = new NativeFocusTarget();\n\t\t\t\t\t//we must add it directly to the nativeStage because\n\t\t\t\t\t//otherwise, the skipUnchangedFrames property won't work\n\t\t\t\t\tthis._starling.nativeStage.addChild(_nativeFocusTarget);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._nativeFocusTarget.referenceCount++;\n\t\t\t\t}\n\t\t\t\t//since we weren't listening for objects being added while the\n\t\t\t\t//focus manager was disabled, we need to do it now in case there\n\t\t\t\t//are new ones.\n\t\t\t\tthis.setFocusManager(this._root);\n\t\t\t\tthis._root.addEventListener(Event.ADDED, topLevelContainer_addedHandler);\n\t\t\t\tthis._root.addEventListener(Event.REMOVED, topLevelContainer_removedHandler);\n\t\t\t\tthis._root.addEventListener(TouchEvent.TOUCH, topLevelContainer_touchHandler);\n\t\t\t\tthis._starling.nativeStage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, stage_keyFocusChangeHandler, false, 0, true);\n\t\t\t\tthis._starling.nativeStage.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, stage_mouseFocusChangeHandler, false, 0, true);\n\t\t\t\tthis._starling.nativeStage.addEventListener(KeyboardEvent.KEY_DOWN, stage_keyDownHandler, false, 0, true);\n\t\t\t\t//TransformGestureEvent.GESTURE_DIRECTIONAL_TAP requires\n\t\t\t\t//AIR 24, but we want to support older versions too\n\t\t\t\tthis._starling.nativeStage.addEventListener(\"gestureDirectionalTap\", stage_gestureDirectionalTapHandler, false, 0, true);\n\t\t\t\tif(this._savedFocus && !this._savedFocus.stage)\n\t\t\t\t{\n\t\t\t\t\tthis._savedFocus = null;\n\t\t\t\t}\n\t\t\t\tthis.focus = this._savedFocus;\n\t\t\t\tthis._savedFocus = null;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._nativeFocusTarget.referenceCount--;\n\t\t\t\tif(this._nativeFocusTarget.referenceCount <= 0)\n\t\t\t\t{\n\t\t\t\t\tthis._nativeFocusTarget.parent.removeChild(this._nativeFocusTarget);\n\t\t\t\t\tdelete NATIVE_STAGE_TO_FOCUS_TARGET[this._starling.nativeStage];\n\t\t\t\t}\n\t\t\t\tthis._nativeFocusTarget = null;\n\t\t\t\tthis._root.removeEventListener(Event.ADDED, topLevelContainer_addedHandler);\n\t\t\t\tthis._root.removeEventListener(Event.REMOVED, topLevelContainer_removedHandler);\n\t\t\t\tthis._root.removeEventListener(TouchEvent.TOUCH, topLevelContainer_touchHandler);\n\t\t\t\tthis._starling.nativeStage.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, stage_keyFocusChangeHandler);\n\t\t\t\tthis._starling.nativeStage.removeEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, stage_mouseFocusChangeHandler);\n\t\t\t\tthis._starling.nativeStage.removeEventListener(KeyboardEvent.KEY_DOWN, stage_keyDownHandler);\n\t\t\t\tthis._starling.nativeStage.removeEventListener(\"gestureDirectionalTap\", stage_gestureDirectionalTapHandler);\n\t\t\t\tvar focusToSave:IFocusDisplayObject = this.focus;\n\t\t\t\tthis.focus = null;\n\t\t\t\tthis._savedFocus = focusToSave;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _savedFocus:IFocusDisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _focus:IFocusDisplayObject;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get focus():IFocusDisplayObject\n\t\t{\n\t\t\treturn this._focus;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set focus(value:IFocusDisplayObject):void\n\t\t{\n\t\t\tif(this._focus === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar shouldHaveFocus:Boolean = false;\n\t\t\tvar oldFocus:IFeathersDisplayObject = this._focus;\n\t\t\tif(this._isEnabled && value !== null && value.isFocusEnabled && value.focusManager === this)\n\t\t\t{\n\t\t\t\tthis._focus = value;\n\t\t\t\tshouldHaveFocus = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._focus = null;\n\t\t\t}\n\t\t\tvar nativeStage:Stage = this._starling.nativeStage;\n\t\t\tif(oldFocus is INativeFocusOwner)\n\t\t\t{\n\t\t\t\tvar nativeFocus:Object = INativeFocusOwner(oldFocus).nativeFocus;\n\t\t\t\tif(nativeFocus === null && nativeStage !== null)\n\t\t\t\t{\n\t\t\t\t\tnativeFocus = nativeStage.focus;\n\t\t\t\t}\n\t\t\t\tif(nativeFocus is IEventDispatcher)\n\t\t\t\t{\n\t\t\t\t\t//this listener restores focus, if it is lost in a way that\n\t\t\t\t\t//is out of our control. since we may be manually removing\n\t\t\t\t\t//focus in a listener for FeathersEventType.FOCUS_OUT, we\n\t\t\t\t\t//don't want it to restore focus.\n\t\t\t\t\tIEventDispatcher(nativeFocus).removeEventListener(FocusEvent.FOCUS_OUT, nativeFocus_focusOutHandler);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(oldFocus !== null)\n\t\t\t{\n\t\t\t\t//this event should be dispatched after setting the new value of\n\t\t\t\t//_focus because we want to be able to access the value of the\n\t\t\t\t//focus property in the event listener.\n\t\t\t\toldFocus.dispatchEventWith(FeathersEventType.FOCUS_OUT);\n\t\t\t}\n\t\t\tif(shouldHaveFocus && this._focus !== value)\n\t\t\t{\n\t\t\t\t//this shouldn't happen, but if it does, let's not break the\n\t\t\t\t//current state even more by referencing an old focused object.\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._isEnabled)\n\t\t\t{\n\t\t\t\tif(this._focus !== null)\n\t\t\t\t{\n\t\t\t\t\tnativeFocus = null;\n\t\t\t\t\tif(this._focus is INativeFocusOwner)\n\t\t\t\t\t{\n\t\t\t\t\t\tnativeFocus = INativeFocusOwner(this._focus).nativeFocus;\n\t\t\t\t\t\tif(nativeFocus is InteractiveObject)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnativeStage.focus = InteractiveObject(nativeFocus);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(nativeFocus !== null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(this._focus is IAdvancedNativeFocusOwner)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar advancedFocus:IAdvancedNativeFocusOwner = IAdvancedNativeFocusOwner(this._focus);\n\t\t\t\t\t\t\t\tif(!advancedFocus.hasFocus)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//let the focused component handle giving focus to\n\t\t\t\t\t\t\t\t\t//its nativeFocus because it may have a custom API\n\t\t\t\t\t\t\t\t\tadvancedFocus.setFocus();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthrow new IllegalOperationError(\"If nativeFocus does not return an InteractiveObject, class must implement IAdvancedNativeFocusOwner interface\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//an INativeFocusOwner may return null for its\n\t\t\t\t\t//nativeFocus property, so we still need to double-check\n\t\t\t\t\t//that the native stage has something in focus. that's\n\t\t\t\t\t//why there isn't an else here\n\t\t\t\t\tif(nativeFocus === null)\n\t\t\t\t\t{\n\t\t\t\t\t\tnativeFocus = this._nativeFocusTarget;\n\t\t\t\t\t\tnativeStage.focus = this._nativeFocusTarget;\n\t\t\t\t\t}\n\t\t\t\t\tif(nativeFocus is IEventDispatcher)\n\t\t\t\t\t{\n\t\t\t\t\t\tIEventDispatcher(nativeFocus).addEventListener(FocusEvent.FOCUS_OUT, nativeFocus_focusOutHandler, false, 0, true);\n\t\t\t\t\t}\n\t\t\t\t\tthis._focus.dispatchEventWith(FeathersEventType.FOCUS_IN);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnativeStage.focus = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._savedFocus = value;\n\t\t\t}\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function setFocusManager(target:DisplayObject):void\n\t\t{\n\t\t\tif(target is IFocusDisplayObject)\n\t\t\t{\n\t\t\t\tvar targetWithFocus:IFocusDisplayObject = IFocusDisplayObject(target);\n\t\t\t\ttargetWithFocus.focusManager = this;\n\t\t\t}\n\t\t\tif((target is DisplayObjectContainer && !(target is IFocusDisplayObject)) ||\n\t\t\t\t(target is IFocusContainer && IFocusContainer(target).isChildFocusEnabled))\n\t\t\t{\n\t\t\t\tvar container:DisplayObjectContainer = DisplayObjectContainer(target);\n\t\t\t\tvar childCount:int = container.numChildren;\n\t\t\t\tfor(var i:int = 0; i < childCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar child:DisplayObject = container.getChildAt(i);\n\t\t\t\t\tthis.setFocusManager(child);\n\t\t\t\t}\n\t\t\t\tif(container is IFocusExtras)\n\t\t\t\t{\n\t\t\t\t\tvar containerWithExtras:IFocusExtras = IFocusExtras(container);\n\t\t\t\t\tvar extras:Vector.<DisplayObject> = containerWithExtras.focusExtrasBefore;\n\t\t\t\t\tif(extras)\n\t\t\t\t\t{\n\t\t\t\t\t\tchildCount = extras.length;\n\t\t\t\t\t\tfor(i = 0; i < childCount; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tchild = extras[i];\n\t\t\t\t\t\t\tthis.setFocusManager(child);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\textras = containerWithExtras.focusExtrasAfter;\n\t\t\t\t\tif(extras)\n\t\t\t\t\t{\n\t\t\t\t\t\tchildCount = extras.length;\n\t\t\t\t\t\tfor(i = 0; i < childCount; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tchild = extras[i];\n\t\t\t\t\t\t\tthis.setFocusManager(child);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function clearFocusManager(target:DisplayObject):void\n\t\t{\n\t\t\tif(target is IFocusDisplayObject)\n\t\t\t{\n\t\t\t\tvar targetWithFocus:IFocusDisplayObject = IFocusDisplayObject(target);\n\t\t\t\tif(targetWithFocus.focusManager == this)\n\t\t\t\t{\n\t\t\t\t\tif(this._focus == targetWithFocus)\n\t\t\t\t\t{\n\t\t\t\t\t\t//change to focus owner, which falls back to null\n\t\t\t\t\t\tthis.focus = targetWithFocus.focusOwner;\n\t\t\t\t\t}\n\t\t\t\t\ttargetWithFocus.focusManager = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(target is DisplayObjectContainer)\n\t\t\t{\n\t\t\t\tvar container:DisplayObjectContainer = DisplayObjectContainer(target);\n\t\t\t\tvar childCount:int = container.numChildren;\n\t\t\t\tfor(var i:int = 0; i < childCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar child:DisplayObject = container.getChildAt(i);\n\t\t\t\t\tthis.clearFocusManager(child);\n\t\t\t\t}\n\t\t\t\tif(container is IFocusExtras)\n\t\t\t\t{\n\t\t\t\t\tvar containerWithExtras:IFocusExtras = IFocusExtras(container);\n\t\t\t\t\tvar extras:Vector.<DisplayObject> = containerWithExtras.focusExtrasBefore;\n\t\t\t\t\tif(extras)\n\t\t\t\t\t{\n\t\t\t\t\t\tchildCount = extras.length;\n\t\t\t\t\t\tfor(i = 0; i < childCount; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tchild = extras[i];\n\t\t\t\t\t\t\tthis.clearFocusManager(child);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\textras = containerWithExtras.focusExtrasAfter;\n\t\t\t\t\tif(extras)\n\t\t\t\t\t{\n\t\t\t\t\t\tchildCount = extras.length;\n\t\t\t\t\t\tfor(i = 0; i < childCount; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tchild = extras[i];\n\t\t\t\t\t\t\tthis.clearFocusManager(child);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function findPreviousContainerFocus(container:DisplayObjectContainer, beforeChild:DisplayObject, fallbackToGlobal:Boolean):IFocusDisplayObject\n\t\t{\n\t\t\tif(container is LayoutViewPort)\n\t\t\t{\n\t\t\t\tcontainer = container.parent;\n\t\t\t}\n\t\t\tvar hasProcessedBeforeChild:Boolean = beforeChild == null;\n\t\t\tif(container is IFocusExtras)\n\t\t\t{\n\t\t\t\tvar focusWithExtras:IFocusExtras = IFocusExtras(container);\n\t\t\t\tvar extras:Vector.<DisplayObject> = focusWithExtras.focusExtrasAfter;\n\t\t\t\tif(extras)\n\t\t\t\t{\n\t\t\t\t\tvar skip:Boolean = false;\n\t\t\t\t\tif(beforeChild)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar startIndex:int = extras.indexOf(beforeChild) - 1;\n\t\t\t\t\t\thasProcessedBeforeChild = startIndex >= -1;\n\t\t\t\t\t\tskip = !hasProcessedBeforeChild;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tstartIndex = extras.length - 1;\n\t\t\t\t\t}\n\t\t\t\t\tif(!skip)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor(var i:int = startIndex; i >= 0; i--)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar child:DisplayObject = extras[i];\n\t\t\t\t\t\t\tvar foundChild:IFocusDisplayObject = this.findPreviousChildFocus(child);\n\t\t\t\t\t\t\tif(this.isValidFocus(foundChild))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn foundChild;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(beforeChild && !hasProcessedBeforeChild)\n\t\t\t{\n\t\t\t\tstartIndex = container.getChildIndex(beforeChild) - 1;\n\t\t\t\thasProcessedBeforeChild = startIndex >= -1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstartIndex = container.numChildren - 1;\n\t\t\t}\n\t\t\tfor(i = startIndex; i >= 0; i--)\n\t\t\t{\n\t\t\t\tchild = container.getChildAt(i);\n\t\t\t\tfoundChild = this.findPreviousChildFocus(child);\n\t\t\t\tif(this.isValidFocus(foundChild))\n\t\t\t\t{\n\t\t\t\t\treturn foundChild;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(container is IFocusExtras)\n\t\t\t{\n\t\t\t\textras = focusWithExtras.focusExtrasBefore;\n\t\t\t\tif(extras)\n\t\t\t\t{\n\t\t\t\t\tskip = false;\n\t\t\t\t\tif(beforeChild && !hasProcessedBeforeChild)\n\t\t\t\t\t{\n\t\t\t\t\t\tstartIndex = extras.indexOf(beforeChild) - 1;\n\t\t\t\t\t\thasProcessedBeforeChild = startIndex >= -1;\n\t\t\t\t\t\tskip = !hasProcessedBeforeChild;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tstartIndex = extras.length - 1;\n\t\t\t\t\t}\n\t\t\t\t\tif(!skip)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor(i = startIndex; i >= 0; i--)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tchild = extras[i];\n\t\t\t\t\t\t\tfoundChild = this.findPreviousChildFocus(child);\n\t\t\t\t\t\t\tif(this.isValidFocus(foundChild))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn foundChild;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(fallbackToGlobal && container != this._root)\n\t\t\t{\n\t\t\t\t//try the container itself before moving backwards\n\t\t\t\tif(container is IFocusDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar focusContainer:IFocusDisplayObject = IFocusDisplayObject(container);\n\t\t\t\t\tif(this.isValidFocus(focusContainer))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn focusContainer;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this.findPreviousContainerFocus(container.parent, container, true);\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function findNextContainerFocus(container:DisplayObjectContainer, afterChild:DisplayObject, fallbackToGlobal:Boolean):IFocusDisplayObject\n\t\t{\n\t\t\tif(container is LayoutViewPort)\n\t\t\t{\n\t\t\t\tcontainer = container.parent;\n\t\t\t}\n\t\t\tvar hasProcessedAfterChild:Boolean = afterChild == null;\n\t\t\tif(container is IFocusExtras)\n\t\t\t{\n\t\t\t\tvar focusWithExtras:IFocusExtras = IFocusExtras(container);\n\t\t\t\tvar extras:Vector.<DisplayObject> = focusWithExtras.focusExtrasBefore;\n\t\t\t\tif(extras)\n\t\t\t\t{\n\t\t\t\t\tvar skip:Boolean = false;\n\t\t\t\t\tif(afterChild)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar startIndex:int = extras.indexOf(afterChild) + 1;\n\t\t\t\t\t\thasProcessedAfterChild = startIndex > 0;\n\t\t\t\t\t\tskip = !hasProcessedAfterChild;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tstartIndex = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif(!skip)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar childCount:int = extras.length;\n\t\t\t\t\t\tfor(var i:int = startIndex; i < childCount; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar child:DisplayObject = extras[i];\n\t\t\t\t\t\t\tvar foundChild:IFocusDisplayObject = this.findNextChildFocus(child);\n\t\t\t\t\t\t\tif(this.isValidFocus(foundChild))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn foundChild;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(afterChild && !hasProcessedAfterChild)\n\t\t\t{\n\t\t\t\tstartIndex = container.getChildIndex(afterChild) + 1;\n\t\t\t\thasProcessedAfterChild = startIndex > 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstartIndex = 0;\n\t\t\t}\n\t\t\tchildCount = container.numChildren;\n\t\t\tfor(i = startIndex; i < childCount; i++)\n\t\t\t{\n\t\t\t\tchild = container.getChildAt(i);\n\t\t\t\tfoundChild = this.findNextChildFocus(child);\n\t\t\t\tif(this.isValidFocus(foundChild))\n\t\t\t\t{\n\t\t\t\t\treturn foundChild;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(container is IFocusExtras)\n\t\t\t{\n\t\t\t\textras = focusWithExtras.focusExtrasAfter;\n\t\t\t\tif(extras)\n\t\t\t\t{\n\t\t\t\t\tskip = false;\n\t\t\t\t\tif(afterChild && !hasProcessedAfterChild)\n\t\t\t\t\t{\n\t\t\t\t\t\tstartIndex = extras.indexOf(afterChild) + 1;\n\t\t\t\t\t\thasProcessedAfterChild = startIndex > 0;\n\t\t\t\t\t\tskip = !hasProcessedAfterChild;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tstartIndex = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif(!skip)\n\t\t\t\t\t{\n\t\t\t\t\t\tchildCount = extras.length;\n\t\t\t\t\t\tfor(i = startIndex; i < childCount; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tchild = extras[i];\n\t\t\t\t\t\t\tfoundChild = this.findNextChildFocus(child);\n\t\t\t\t\t\t\tif(this.isValidFocus(foundChild))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn foundChild;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(fallbackToGlobal && container != this._root)\n\t\t\t{\n\t\t\t\treturn this.findNextContainerFocus(container.parent, container, true);\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function findPreviousChildFocus(child:DisplayObject):IFocusDisplayObject\n\t\t{\n\t\t\tif((child is DisplayObjectContainer && !(child is IFocusDisplayObject)) ||\n\t\t\t\t(child is IFocusContainer && IFocusContainer(child).isChildFocusEnabled))\n\t\t\t{\n\t\t\t\tvar childContainer:DisplayObjectContainer = DisplayObjectContainer(child);\n\t\t\t\tvar foundChild:IFocusDisplayObject = this.findPreviousContainerFocus(childContainer, null, false);\n\t\t\t\tif(foundChild)\n\t\t\t\t{\n\t\t\t\t\treturn foundChild;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(child is IFocusDisplayObject)\n\t\t\t{\n\t\t\t\tvar childWithFocus:IFocusDisplayObject = IFocusDisplayObject(child);\n\t\t\t\tif(this.isValidFocus(childWithFocus))\n\t\t\t\t{\n\t\t\t\t\treturn childWithFocus;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function findNextChildFocus(child:DisplayObject):IFocusDisplayObject\n\t\t{\n\t\t\tif(child is IFocusDisplayObject)\n\t\t\t{\n\t\t\t\tvar childWithFocus:IFocusDisplayObject = IFocusDisplayObject(child);\n\t\t\t\tif(this.isValidFocus(childWithFocus))\n\t\t\t\t{\n\t\t\t\t\treturn childWithFocus;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif((child is DisplayObjectContainer && !(child is IFocusDisplayObject)) ||\n\t\t\t\t(child is IFocusContainer && IFocusContainer(child).isChildFocusEnabled))\n\t\t\t{\n\t\t\t\tvar childContainer:DisplayObjectContainer = DisplayObjectContainer(child);\n\t\t\t\tvar foundChild:IFocusDisplayObject = this.findNextContainerFocus(childContainer, null, false);\n\t\t\t\tif(foundChild)\n\t\t\t\t{\n\t\t\t\t\treturn foundChild;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function findFocusAtRelativePosition(container:DisplayObjectContainer, position:String):IFocusDisplayObject\n\t\t{\n\t\t\tvar focusableObjects:Vector.<IFocusDisplayObject> = new <IFocusDisplayObject>[];\n\t\t\tfindAllFocusableObjects(container, focusableObjects);\n\t\t\tif(this._focus === null)\n\t\t\t{\n\t\t\t\tif(focusableObjects.length > 0)\n\t\t\t\t{\n\t\t\t\t\treturn focusableObjects[0];\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tvar focusedRect:Rectangle = this._focus.getBounds(this._focus.stage, Pool.getRectangle());\n\t\t\tvar result:IFocusDisplayObject = null;\n\t\t\tvar count:int = focusableObjects.length;\n\t\t\tfor(var i:int = 0; i < count; i++)\n\t\t\t{\n\t\t\t\tvar focusableObject:IFocusDisplayObject = focusableObjects[i];\n\t\t\t\tif(focusableObject === this._focus)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(isBetterFocusForRelativePosition(focusableObject, result, focusedRect, position))\n\t\t\t\t{\n\t\t\t\t\tresult = focusableObject;\n\t\t\t\t}\n\t\t\t}\n\t\t\tPool.putRectangle(focusedRect);\n\t\t\tif(result === null)\n\t\t\t{\n\t\t\t\t//default to keeping the current focus\n\t\t\t\treturn this._focus;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function findAllFocusableObjects(child:DisplayObject, result:Vector.<IFocusDisplayObject>):void\n\t\t{\n\t\t\tif(child is IFocusDisplayObject)\n\t\t\t{\n\t\t\t\tvar focusableObject:IFocusDisplayObject = IFocusDisplayObject(child);\n\t\t\t\tif(isValidFocus(focusableObject))\n\t\t\t\t{\n\t\t\t\t\tresult[result.length] = focusableObject;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(child is IFocusExtras)\n\t\t\t{\n\t\t\t\tvar focusExtras:IFocusExtras = IFocusExtras(child);\n\t\t\t\tvar extras:Vector.<DisplayObject> = focusExtras.focusExtrasBefore;\n\t\t\t\tvar count:int = extras.length;\n\t\t\t\tfor(var i:int = 0; i < count; i++)\n\t\t\t\t{\n\t\t\t\t\tvar childOfChild:DisplayObject = extras[i];\n\t\t\t\t\tfindAllFocusableObjects(childOfChild, result);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(child is IFocusDisplayObject)\n\t\t\t{\n\t\t\t\tif(child is IFocusContainer && IFocusContainer(child).isChildFocusEnabled)\n\t\t\t\t{\n\t\t\t\t\tvar otherContainer:DisplayObjectContainer = DisplayObjectContainer(child);\n\t\t\t\t\tcount = otherContainer.numChildren;\n\t\t\t\t\tfor(i = 0; i < count; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tchildOfChild = otherContainer.getChildAt(i);\n\t\t\t\t\t\tfindAllFocusableObjects(childOfChild, result);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(child is DisplayObjectContainer)\n\t\t\t{\n\t\t\t\totherContainer = DisplayObjectContainer(child);\n\t\t\t\tcount = otherContainer.numChildren;\n\t\t\t\tfor(i = 0; i < count; i++)\n\t\t\t\t{\n\t\t\t\t\tchildOfChild = otherContainer.getChildAt(i);\n\t\t\t\t\tfindAllFocusableObjects(childOfChild, result);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(child is IFocusExtras)\n\t\t\t{\n\t\t\t\textras = focusExtras.focusExtrasAfter;\n\t\t\t\tcount = extras.length;\n\t\t\t\tfor(i = 0; i < count; i++)\n\t\t\t\t{\n\t\t\t\t\tchildOfChild = extras[i];\n\t\t\t\t\tfindAllFocusableObjects(childOfChild, result);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function isValidFocus(child:IFocusDisplayObject):Boolean\n\t\t{\n\t\t\tif(child === null || child.focusManager !== this)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(!child.isFocusEnabled)\n\t\t\t{\n\t\t\t\tif(child.focusOwner === null || !isValidFocus(child.focusOwner))\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar uiChild:IFeathersControl = child as IFeathersControl;\n\t\t\tif(uiChild !== null && !uiChild.isEnabled)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_mouseFocusChangeHandler(event:FocusEvent):void\n\t\t{\n\t\t\tif(event.relatedObject)\n\t\t\t{\n\t\t\t\t//we need to allow mouse focus to be passed to native display\n\t\t\t\t//objects. for instance, hyperlinks in TextField won't work\n\t\t\t\t//unless the TextField can be focused.\n\t\t\t\tthis.focus = null;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(event.keyLocation != KeyLocation.D_PAD && !DeviceCapabilities.simulateDPad)\n\t\t\t{\n\t\t\t\t//focus is controlled only with a d-pad and not the regular\n\t\t\t\t//keyboard arrow keys\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(event.keyCode != Keyboard.UP && event.keyCode != Keyboard.DOWN &&\n\t\t\t\tevent.keyCode != Keyboard.LEFT && event.keyCode != Keyboard.RIGHT)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(event.isDefaultPrevented())\n\t\t\t{\n\t\t\t\t//something else has already handled this keyboard event\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar newFocus:IFocusDisplayObject;\n\t\t\tvar currentFocus:IFocusDisplayObject = this._focus;\n\t\t\tif(currentFocus !== null && currentFocus.focusOwner !== null)\n\t\t\t{\n\t\t\t\tnewFocus = currentFocus.focusOwner;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar position:String = RelativePosition.RIGHT;\n\t\t\t\tswitch(event.keyCode)\n\t\t\t\t{\n\t\t\t\t\tcase Keyboard.UP:\n\t\t\t\t\t{\n\t\t\t\t\t\tposition = RelativePosition.TOP;\n\t\t\t\t\t\tif(currentFocus !== null && currentFocus.nextUpFocus !== null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewFocus = currentFocus.nextUpFocus;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase Keyboard.RIGHT:\n\t\t\t\t\t{\n\t\t\t\t\t\tposition = RelativePosition.RIGHT;\n\t\t\t\t\t\tif(currentFocus !== null && currentFocus.nextRightFocus !== null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewFocus = currentFocus.nextRightFocus;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase Keyboard.DOWN:\n\t\t\t\t\t{\n\t\t\t\t\t\tposition = RelativePosition.BOTTOM;\n\t\t\t\t\t\tif(currentFocus !== null && currentFocus.nextDownFocus !== null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewFocus = currentFocus.nextDownFocus;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase Keyboard.LEFT:\n\t\t\t\t\t{\n\t\t\t\t\t\tposition = RelativePosition.LEFT;\n\t\t\t\t\t\tif(currentFocus !== null && currentFocus.nextLeftFocus !== null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewFocus = currentFocus.nextLeftFocus;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(newFocus === null)\n\t\t\t\t{\n\t\t\t\t\tnewFocus = findFocusAtRelativePosition(this._root, position);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(newFocus !== this._focus)\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.focus = newFocus;\n\t\t\t}\n\t\t\tif(this._focus)\n\t\t\t{\n\t\t\t\tthis._focus.showFocus();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_gestureDirectionalTapHandler(event:TransformGestureEvent):void\n\t\t{\n\t\t\tif(event.isDefaultPrevented())\n\t\t\t{\n\t\t\t\t//something else has already handled this event\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar position:String = null;\n\t\t\tif(event.offsetY < 0)\n\t\t\t{\n\t\t\t\tposition = RelativePosition.TOP;\n\t\t\t}\n\t\t\telse if(event.offsetY > 0)\n\t\t\t{\n\t\t\t\tposition = RelativePosition.BOTTOM;\n\t\t\t}\n\t\t\telse if(event.offsetX > 0)\n\t\t\t{\n\t\t\t\tposition = RelativePosition.RIGHT;\n\t\t\t}\n\t\t\telse if(event.offsetX < 0)\n\t\t\t{\n\t\t\t\tposition = RelativePosition.LEFT;\n\t\t\t}\n\t\t\tif(position === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar newFocus:IFocusDisplayObject = findFocusAtRelativePosition(this._root, position);\n\t\t\tif(newFocus !== this._focus)\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.focus = newFocus;\n\t\t\t}\n\t\t\tif(this._focus)\n\t\t\t{\n\t\t\t\tthis._focus.showFocus();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_keyFocusChangeHandler(event:FocusEvent):void\n\t\t{\n\t\t\t//keyCode 0 is sent by IE, for some reason\n\t\t\tif(event.keyCode != Keyboard.TAB && event.keyCode != 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar newFocus:IFocusDisplayObject;\n\t\t\tvar currentFocus:IFocusDisplayObject = this._focus;\n\t\t\tif(currentFocus && currentFocus.focusOwner)\n\t\t\t{\n\t\t\t\tnewFocus = currentFocus.focusOwner;\n\t\t\t}\n\t\t\telse if(event.shiftKey)\n\t\t\t{\n\t\t\t\tif(currentFocus)\n\t\t\t\t{\n\t\t\t\t\tif(currentFocus.previousTabFocus)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewFocus = currentFocus.previousTabFocus;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewFocus = this.findPreviousContainerFocus(currentFocus.parent, DisplayObject(currentFocus), true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!newFocus)\n\t\t\t\t{\n\t\t\t\t\tnewFocus = this.findPreviousContainerFocus(this._root, null, false);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(currentFocus)\n\t\t\t\t{\n\t\t\t\t\tif(currentFocus.nextTabFocus)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewFocus = currentFocus.nextTabFocus;\n\t\t\t\t\t}\n\t\t\t\t\telse if(currentFocus is IFocusContainer && IFocusContainer(currentFocus).isChildFocusEnabled)\n\t\t\t\t\t{\n\t\t\t\t\t\tnewFocus = this.findNextContainerFocus(DisplayObjectContainer(currentFocus), null, true);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewFocus = this.findNextContainerFocus(currentFocus.parent, DisplayObject(currentFocus), true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!newFocus)\n\t\t\t\t{\n\t\t\t\t\tnewFocus = this.findNextContainerFocus(this._root, null, false);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(newFocus)\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t\tthis.focus = newFocus;\n\t\t\tif(this._focus)\n\t\t\t{\n\t\t\t\tthis._focus.showFocus();\n\t\t\t}\n\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function topLevelContainer_addedHandler(event:Event):void\n\t\t{\n\t\t\tthis.setFocusManager(DisplayObject(event.target));\n\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function topLevelContainer_removedHandler(event:Event):void\n\t\t{\n\t\t\tthis.clearFocusManager(DisplayObject(event.target));\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function topLevelContainer_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(Capabilities.os.indexOf(\"tvOS\") != -1)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar touch:Touch = event.getTouch(this._root, TouchPhase.BEGAN);\n\t\t\tif(!touch)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._focus !== null && this._focus.maintainTouchFocus)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar focusTarget:IFocusDisplayObject = null;\n\t\t\tvar target:DisplayObject = touch.target;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tif(target is IFocusDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar tempFocusTarget:IFocusDisplayObject = IFocusDisplayObject(target);\n\t\t\t\t\tif(this.isValidFocus(tempFocusTarget))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(!focusTarget || !(tempFocusTarget is IFocusContainer) || !(IFocusContainer(tempFocusTarget).isChildFocusEnabled))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfocusTarget = tempFocusTarget;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttarget = target.parent;\n\t\t\t}\n\t\t\twhile(target);\n\t\t\tif(this._focus !== null && focusTarget !== null)\n\t\t\t{\n\t\t\t\t//ignore touches on focusOwner because we consider the\n\t\t\t\t//focusOwner to indirectly have focus already\n\t\t\t\tvar focusOwner:IFocusDisplayObject = this._focus.focusOwner;\n\t\t\t\tif(focusOwner === focusTarget)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t//similarly, ignore touches on display objects that have a\n\t\t\t\t//focusOwner and that owner is the currently focused object\n\t\t\t\tvar result:DisplayObject = DisplayObject(focusTarget);\n\t\t\t\twhile(result != null)\n\t\t\t\t{\n\t\t\t\t\tvar focusResult:IFocusDisplayObject = result as IFocusDisplayObject;\n\t\t\t\t\tif(focusResult !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tfocusOwner = focusResult.focusOwner;\n\t\t\t\t\t\tif(focusOwner !== null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(focusOwner === this._focus)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//the current focus is the touch target's owner,\n\t\t\t\t\t\t\t\t//so we don't need to clear focus\n\t\t\t\t\t\t\t\tfocusTarget = focusOwner;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//if we've found a display object with a focus owner,\n\t\t\t\t\t\t\t//then we've gone far enough up the display list\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(focusResult.isFocusEnabled)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if focus in enabled, then we've gone far enough up\n\t\t\t\t\t\t\t//the display list\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tresult = result.parent;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.focus = focusTarget;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function nativeFocus_focusOutHandler(event:FocusEvent):void\n\t\t{\n\t\t\tvar nativeFocus:Object = event.currentTarget;\n\t\t\tvar nativeStage:Stage = this._starling.nativeStage;\n\t\t\tif(nativeStage.focus !== null && nativeStage.focus !== nativeFocus)\n\t\t\t{\n\t\t\t\t//we should stop listening for this event because something else\n\t\t\t\t//has focus now\n\t\t\t\tif(nativeFocus is IEventDispatcher)\n\t\t\t\t{\n\t\t\t\t\tIEventDispatcher(nativeFocus).removeEventListener(FocusEvent.FOCUS_OUT, nativeFocus_focusOutHandler);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(this._focus !== null)\n\t\t\t{\n\t\t\t\tif(this._focus is INativeFocusOwner &&\n\t\t\t\t\tINativeFocusOwner(this._focus).nativeFocus !== nativeFocus)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t//if there's still a feathers focus, but the native stage object has\n\t\t\t\t//lost focus for some reason, and there's no focus at all, force it\n\t\t\t\t//back into focus.\n\t\t\t\t//this can happen on app deactivate!\n\t\t\t\tif(nativeFocus is InteractiveObject)\n\t\t\t\t{\n\t\t\t\t\tnativeStage.focus = InteractiveObject(nativeFocus);\n\t\t\t\t}\n\t\t\t\telse //nativeFocus is IAdvancedNativeFocusOwner\n\t\t\t\t{\n\t\t\t\t\t//let the focused component handle giving focus to its\n\t\t\t\t\t//nativeFocus because it may have a custom API\n\t\t\t\t\tIAdvancedNativeFocusOwner(this._focus).setFocus();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nimport flash.display.Sprite;\n\nclass NativeFocusTarget extends Sprite\n{\n\tpublic function NativeFocusTarget()\n\t{\n\t\tthis.tabEnabled = true;\n\t\tthis.mouseEnabled = false;\n\t\tthis.mouseChildren = false;\n\t\tthis.alpha = 0;\n\t}\n\n\tpublic var referenceCount:int = 1;\n}"
  },
  {
    "path": "source/feathers/core/DefaultPopUpManager.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\timport feathers.events.FeathersEventType;\n\n\timport flash.utils.Dictionary;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.DisplayObjectContainer;\n\timport starling.display.Quad;\n\timport starling.display.Stage;\n\timport starling.events.Event;\n\timport starling.events.ResizeEvent;\n\n\t/**\n\t * The default <code>IPopUpManager</code> implementation.\n\t *\n\t * @see PopUpManager\n\t *\n\t * @productversion Feathers 1.3.0\n\t */\n\tpublic class DefaultPopUpManager implements IPopUpManager\n\t{\n\t\t/**\n\t\t * @copy PopUpManager#defaultOverlayFactory()\n\t\t */\n\t\tpublic static function defaultOverlayFactory():DisplayObject\n\t\t{\n\t\t\tvar quad:Quad = new Quad(100, 100, 0x000000);\n\t\t\tquad.alpha = 0;\n\t\t\treturn quad;\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function DefaultPopUpManager(root:DisplayObjectContainer = null)\n\t\t{\n\t\t\tthis.root = root;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _popUps:Vector.<DisplayObject> = new <DisplayObject>[];\n\n\t\t/**\n\t\t * @copy PopUpManager#popUpCount\n\t\t */\n\t\tpublic function get popUpCount():int\n\t\t{\n\t\t\treturn this._popUps.length;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _popUpToOverlay:Dictionary = new Dictionary(true);\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _popUpToFocusManager:Dictionary = new Dictionary(true);\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _centeredPopUps:Vector.<DisplayObject> = new <DisplayObject>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _overlayFactory:Function = defaultOverlayFactory;\n\n\t\t/**\n\t\t * @copy PopUpManager#overlayFactory\n\t\t */\n\t\tpublic function get overlayFactory():Function\n\t\t{\n\t\t\treturn this._overlayFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set overlayFactory(value:Function):void\n\t\t{\n\t\t\tthis._overlayFactory = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _ignoreRemoval:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _root:DisplayObjectContainer;\n\n\t\t/**\n\t\t * @copy PopUpManager#root\n\t\t */\n\t\tpublic function get root():DisplayObjectContainer\n\t\t{\n\t\t\treturn this._root;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set root(value:DisplayObjectContainer):void\n\t\t{\n\t\t\tif(this._root == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar popUpCount:int = this._popUps.length;\n\t\t\tvar oldIgnoreRemoval:Boolean = this._ignoreRemoval; //just in case\n\t\t\tthis._ignoreRemoval = true;\n\t\t\tfor(var i:int = 0; i < popUpCount; i++)\n\t\t\t{\n\t\t\t\tvar popUp:DisplayObject = this._popUps[i];\n\t\t\t\tvar overlay:DisplayObject = DisplayObject(_popUpToOverlay[popUp]);\n\t\t\t\tpopUp.removeFromParent(false);\n\t\t\t\tif(overlay)\n\t\t\t\t{\n\t\t\t\t\toverlay.removeFromParent(false);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._ignoreRemoval = oldIgnoreRemoval;\n\t\t\tthis._root = value;\n\t\t\tfor(i = 0; i < popUpCount; i++)\n\t\t\t{\n\t\t\t\tpopUp = this._popUps[i];\n\t\t\t\toverlay = DisplayObject(_popUpToOverlay[popUp]);\n\t\t\t\tif(overlay)\n\t\t\t\t{\n\t\t\t\t\tthis._root.addChild(overlay);\n\t\t\t\t}\n\t\t\t\tthis._root.addChild(popUp);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy PopUpManager#addPopUp()\n\t\t */\n\t\tpublic function addPopUp(popUp:DisplayObject, isModal:Boolean = true, isCentered:Boolean = true, customOverlayFactory:Function = null):DisplayObject\n\t\t{\n\t\t\tif(isModal)\n\t\t\t{\n\t\t\t\tif(customOverlayFactory == null)\n\t\t\t\t{\n\t\t\t\t\tcustomOverlayFactory = this._overlayFactory;\n\t\t\t\t}\n\t\t\t\tif(customOverlayFactory == null)\n\t\t\t\t{\n\t\t\t\t\tcustomOverlayFactory = defaultOverlayFactory;\n\t\t\t\t}\n\t\t\t\tvar overlay:DisplayObject = customOverlayFactory();\n\t\t\t\toverlay.width = this._root.stage.stageWidth;\n\t\t\t\toverlay.height = this._root.stage.stageHeight;\n\t\t\t\tthis._root.addChild(overlay);\n\t\t\t\tthis._popUpToOverlay[popUp] = overlay;\n\t\t\t}\n\n\t\t\tthis._popUps.push(popUp);\n\t\t\tthis._root.addChild(popUp);\n\t\t\t//this listener needs to be added after the pop-up is added to the\n\t\t\t//root because the pop-up may not have been removed from its old\n\t\t\t//parent yet, which will trigger the listener if it is added first.\n\t\t\tpopUp.addEventListener(Event.REMOVED_FROM_STAGE, popUp_removedFromStageHandler);\n\n\t\t\tif(this._popUps.length == 1)\n\t\t\t{\n\t\t\t\tthis._root.stage.addEventListener(ResizeEvent.RESIZE, stage_resizeHandler);\n\t\t\t}\n\n\t\t\tif(isModal && FocusManager.isEnabledForStage(this._root.stage) && popUp is DisplayObjectContainer)\n\t\t\t{\n\t\t\t\tthis._popUpToFocusManager[popUp] = FocusManager.pushFocusManager(DisplayObjectContainer(popUp));\n\t\t\t}\n\n\t\t\tif(isCentered)\n\t\t\t{\n\t\t\t\tif(popUp is IFeathersControl)\n\t\t\t\t{\n\t\t\t\t\tpopUp.addEventListener(FeathersEventType.RESIZE, popUp_resizeHandler);\n\t\t\t\t}\n\t\t\t\tthis._centeredPopUps.push(popUp);\n\t\t\t\tthis.centerPopUp(popUp);\n\t\t\t}\n\n\t\t\treturn popUp;\n\t\t}\n\n\t\t/**\n\t\t * @copy PopUpManager#removePopUp()\n\t\t */\n\t\tpublic function removePopUp(popUp:DisplayObject, dispose:Boolean = false):DisplayObject\n\t\t{\n\t\t\tvar index:int = this._popUps.indexOf(popUp);\n\t\t\tif(index < 0)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"Display object is not a pop-up.\");\n\t\t\t}\n\t\t\tpopUp.removeFromParent(dispose);\n\t\t\treturn popUp;\n\t\t}\n\n\t\t/**\n\t\t * @copy PopUpManager#removeAllPopUps()\n\t\t */\n\t\tpublic function removeAllPopUps(dispose:Boolean = false):void\n\t\t{\n\t\t\t//removing pop-ups may call event listeners that add new pop-ups,\n\t\t\t//and we don't want to remove the new ones or miss old ones, so\n\t\t\t//create a copy of the _popUps Vector to be safe.\n\t\t\tvar popUps:Vector.<DisplayObject> = this._popUps.slice();\n\t\t\tvar popUpCount:int = popUps.length;\n\t\t\tfor(var i:int = 0; i < popUpCount; i++)\n\t\t\t{\n\t\t\t\tvar popUp:DisplayObject = popUps[i];\n\t\t\t\t//we check if this is still a pop-up because it might have been\n\t\t\t\t//removed in an Event.REMOVED or Event.REMOVED_FROM_STAGE\n\t\t\t\t//listener for another pop-up earlier in the loop\n\t\t\t\tif(this.isPopUp(popUp))\n\t\t\t\t{\n\t\t\t\t\tthis.removePopUp(popUp, dispose);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy PopUpManager#isPopUp()\n\t\t */\n\t\tpublic function isPopUp(popUp:DisplayObject):Boolean\n\t\t{\n\t\t\treturn this._popUps.indexOf(popUp) >= 0;\n\t\t}\n\n\t\t/**\n\t\t * @copy PopUpManager#isTopLevelPopUp()\n\t\t */\n\t\tpublic function isTopLevelPopUp(popUp:DisplayObject):Boolean\n\t\t{\n\t\t\tvar lastIndex:int = this._popUps.length - 1;\n\t\t\tfor(var i:int = lastIndex; i >= 0; i--)\n\t\t\t{\n\t\t\t\tvar otherPopUp:DisplayObject = this._popUps[i];\n\t\t\t\tif(otherPopUp == popUp)\n\t\t\t\t{\n\t\t\t\t\t//we haven't encountered an overlay yet, so it is top-level\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tvar overlay:DisplayObject = this._popUpToOverlay[otherPopUp] as DisplayObject;\n\t\t\t\tif(overlay)\n\t\t\t\t{\n\t\t\t\t\t//this is the first overlay, and we haven't found the pop-up\n\t\t\t\t\t//yet, so it is not top-level\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//pop-up was not found at all, so obviously, not top-level\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * @copy PopUpManager#centerPopUp()\n\t\t */\n\t\tpublic function centerPopUp(popUp:DisplayObject):void\n\t\t{\n\t\t\tvar stage:Stage = this._root.stage;\n\t\t\tif(popUp is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(popUp).validate();\n\t\t\t}\n\t\t\tpopUp.x = popUp.pivotX + Math.round((stage.stageWidth - popUp.width) / 2);\n\t\t\tpopUp.y = popUp.pivotY + Math.round((stage.stageHeight - popUp.height) / 2);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function popUp_resizeHandler(event:Event):void\n\t\t{\n\t\t\tvar popUp:DisplayObject = DisplayObject(event.currentTarget);\n\t\t\tvar index:int = this._centeredPopUps.indexOf(popUp);\n\t\t\tif(index < 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.centerPopUp(popUp);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function popUp_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreRemoval)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar popUp:DisplayObject = DisplayObject(event.currentTarget);\n\t\t\tpopUp.removeEventListener(Event.REMOVED_FROM_STAGE, popUp_removedFromStageHandler);\n\t\t\tvar index:int = this._popUps.indexOf(popUp);\n\t\t\tthis._popUps.removeAt(index);\n\t\t\tvar overlay:DisplayObject = DisplayObject(this._popUpToOverlay[popUp]);\n\t\t\tif(overlay)\n\t\t\t{\n\t\t\t\toverlay.removeFromParent(true);\n\t\t\t\tdelete _popUpToOverlay[popUp];\n\t\t\t}\n\t\t\tvar focusManager:IFocusManager = this._popUpToFocusManager[popUp] as IFocusManager;\n\t\t\tif(focusManager)\n\t\t\t{\n\t\t\t\tdelete this._popUpToFocusManager[popUp];\n\t\t\t\tFocusManager.removeFocusManager(focusManager);\n\t\t\t}\n\t\t\tindex = this._centeredPopUps.indexOf(popUp);\n\t\t\tif(index >= 0)\n\t\t\t{\n\t\t\t\tif(popUp is IFeathersControl)\n\t\t\t\t{\n\t\t\t\t\tpopUp.removeEventListener(FeathersEventType.RESIZE, popUp_resizeHandler);\n\t\t\t\t}\n\t\t\t\tthis._centeredPopUps.removeAt(index);\n\t\t\t}\n\n\t\t\tif(_popUps.length == 0)\n\t\t\t{\n\t\t\t\tthis._root.stage.removeEventListener(ResizeEvent.RESIZE, stage_resizeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_resizeHandler(event:ResizeEvent):void\n\t\t{\n\t\t\tvar stage:Stage = this._root.stage;\n\t\t\tvar popUpCount:int = this._popUps.length;\n\t\t\tfor(var i:int = 0; i < popUpCount; i++)\n\t\t\t{\n\t\t\t\tvar popUp:DisplayObject = this._popUps[i];\n\t\t\t\tvar overlay:DisplayObject = DisplayObject(this._popUpToOverlay[popUp]);\n\t\t\t\tif(overlay)\n\t\t\t\t{\n\t\t\t\t\toverlay.width = stage.stageWidth;\n\t\t\t\t\toverlay.height = stage.stageHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tpopUpCount = this._centeredPopUps.length;\n\t\t\tfor(i = 0; i < popUpCount; i++)\n\t\t\t{\n\t\t\t\tpopUp = this._centeredPopUps[i];\n\t\t\t\tcenterPopUp(popUp);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/DefaultToolTipManager.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\timport feathers.controls.Label;\n\n\timport flash.utils.getTimer;\n\n\timport starling.animation.DelayedCall;\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.display.DisplayObjectContainer;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\t/**\n\t * The default <code>IToolTipManager</code> implementation.\n\t *\n\t * @see ../../../help/tool-tips.html Tool tips in Feathers\n\t * @see feathers.core.ToolTipManager\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class DefaultToolTipManager implements IToolTipManager\n\t{\n\t\t/**\n\t\t * The default factory that creates a tool tip. Creates a\n\t\t * <code>Label</code> with the style name\n\t\t * <code>Label.ALTERNATE_STYLE_NAME_TOOL_TIP</code>.\n\t\t *\n\t\t * @see #toolTipFactory\n\t\t * @see feathers.controls.Label\n\t\t * @see feathers.controls.Label#ALTERNATE_STYLE_NAME_TOOL_TIP\n\t\t */\n\t\tpublic static function defaultToolTipFactory():IToolTip\n\t\t{\n\t\t\tvar toolTip:Label = new Label();\n\t\t\ttoolTip.styleNameList.add(Label.ALTERNATE_STYLE_NAME_TOOL_TIP);\n\t\t\treturn toolTip;\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function DefaultToolTipManager(root:DisplayObjectContainer)\n\t\t{\n\t\t\tthis._root = root;\n\t\t\tthis._root.addEventListener(TouchEvent.TOUCH, root_touchHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _touchPointID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _delayedCall:DelayedCall;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _toolTipX:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _toolTipY:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _hideTime:int = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _root:DisplayObjectContainer;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _target:IFeathersControl;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _toolTip:IToolTip;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _toolTipFactory:Function;\n\n\t\t/**\n\t\t * A function that creates a tool tip.\n\t\t *\n\t\t * <p>This function is expected to have the following signature:</p>\n\t\t * <pre>function():IToolTip</pre>\n\t\t *\n\t\t * @see feathers.core.IToolTip\n\t\t */\n\t\tpublic function get toolTipFactory():Function\n\t\t{\n\t\t\treturn this._toolTipFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set toolTipFactory(value:Function):void\n\t\t{\n\t\t\tif(this._toolTipFactory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._toolTipFactory = value;\n\t\t\tif(this._toolTip)\n\t\t\t{\n\t\t\t\tthis._toolTip.removeFromParent(true);\n\t\t\t\tthis._toolTip = null;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _showDelay:Number = 0.5;\n\n\t\t/**\n\t\t * The delay, in seconds, before a tool tip may be displayed when the\n\t\t * mouse is idle over a component with a tool tip.\n\t\t *\n\t\t * @default 0.5\n\t\t */\n\t\tpublic function get showDelay():Number\n\t\t{\n\t\t\treturn this._showDelay;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set showDelay(value:Number):void\n\t\t{\n\t\t\tthis._showDelay = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _resetDelay:Number = 0.1;\n\n\t\t/**\n\t\t * The time, in seconds, after hiding a tool tip before the\n\t\t * <code>showDelay</code> is required to show a new tool tip for another\n\t\t * component. If the mouse moves over another component before this\n\t\t * threshold, the tool tip will be shown immediately. This allows\n\t\t * tooltips for adjacent components, such as those appearing in\n\t\t * toolbars, to be shown quickly.\n\t\t *\n\t\t * <p>To disable this behavior, set the <code>resetDelay</code> to\n\t\t * <code>0</code>.</p>\n\t\t *\n\t\t * @default 0.1\n\t\t */\n\t\tpublic function get resetDelay():Number\n\t\t{\n\t\t\treturn this._resetDelay;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set resetDelay(value:Number):void\n\t\t{\n\t\t\tthis._resetDelay = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _offsetX:Number = 0;\n\n\t\t/**\n\t\t * The offset, in pixels, of the tool tip position on the x axis.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get offsetX():Number\n\t\t{\n\t\t\treturn this._offsetX;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set offsetX(value:Number):void\n\t\t{\n\t\t\tthis._offsetX = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _offsetY:Number = 0;\n\n\t\t/**\n\t\t * The offset, in pixels, of the tool tip position on the y axis.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get offsetY():Number\n\t\t{\n\t\t\treturn this._offsetY;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set offsetY(value:Number):void\n\t\t{\n\t\t\tthis._offsetY = value;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.core.IToolTipManager#dispose()\n\t\t */\n\t\tpublic function dispose():void\n\t\t{\n\t\t\tthis._root.removeEventListener(TouchEvent.TOUCH, root_touchHandler);\n\t\t\tthis._root = null;\n\n\t\t\tif(Starling.juggler.contains(this._delayedCall))\n\t\t\t{\n\t\t\t\tStarling.juggler.remove(this._delayedCall);\n\t\t\t\tthis._delayedCall = null;\n\t\t\t}\n\n\t\t\tif(this._toolTip)\n\t\t\t{\n\t\t\t\tthis._toolTip.removeFromParent(true);\n\t\t\t\tthis._toolTip = null;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getTarget(touch:Touch):IFeathersControl\n\t\t{\n\t\t\tvar target:DisplayObject = touch.target;\n\t\t\twhile(target !== null)\n\t\t\t{\n\t\t\t\tif(target is IFeathersControl)\n\t\t\t\t{\n\t\t\t\t\tvar toolTipSource:IFeathersControl = IFeathersControl(target);\n\t\t\t\t\tif(toolTipSource.toolTip)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn toolTipSource;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttarget = target.parent;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function hoverDelayCallback():void\n\t\t{\n\t\t\tif(!this._toolTip)\n\t\t\t{\n\t\t\t\tvar factory:Function = this._toolTipFactory !== null ? this._toolTipFactory : defaultToolTipFactory;\n\t\t\t\tvar toolTip:IToolTip = IToolTip(factory());\n\t\t\t\ttoolTip.touchable = false;\n\t\t\t\tthis._toolTip = toolTip;\n\t\t\t}\n\t\t\tthis._toolTip.text = this._target.toolTip;\n\t\t\tthis._toolTip.validate();\n\t\t\tvar toolTipX:Number = this._toolTipX + this._offsetX;\n\t\t\tif(toolTipX < 0)\n\t\t\t{\n\t\t\t\ttoolTipX = 0;\n\t\t\t}\n\t\t\telse if((toolTipX + this._toolTip.width) > this._target.stage.stageWidth)\n\t\t\t{\n\t\t\t\ttoolTipX = this._target.stage.stageWidth - this._toolTip.width;\n\t\t\t}\n\t\t\tvar toolTipY:Number = this._toolTipY - this._toolTip.height + this._offsetY;\n\t\t\tif(toolTipY < 0)\n\t\t\t{\n\t\t\t\ttoolTipY = 0;\n\t\t\t}\n\t\t\telse if((toolTipY + this._toolTip.height) > this._target.stage.stageHeight)\n\t\t\t{\n\t\t\t\ttoolTipY = this._target.stage.stageHeight - this._toolTip.height;\n\t\t\t}\n\t\t\tthis._toolTip.x = toolTipX;\n\t\t\tthis._toolTip.y = toolTipY;\n\t\t\tPopUpManager.addPopUp(DisplayObject(this._toolTip), false, false);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function root_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(this._toolTip !== null && this._toolTip.parent !== null)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(DisplayObject(this._target), null, this._touchPointID);\n\t\t\t\tif(!touch || touch.phase !== TouchPhase.HOVER)\n\t\t\t\t{\n\t\t\t\t\t//to avoid excessive garbage collection, we reuse the\n\t\t\t\t\t//tooltip object\n\t\t\t\t\tPopUpManager.removePopUp(DisplayObject(this._toolTip), false);\n\t\t\t\t\tthis._touchPointID = -1;\n\t\t\t\t\tthis._target = null;\n\t\t\t\t\tthis._hideTime = getTimer();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._target !== null)\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(DisplayObject(this._target), null, this._touchPointID);\n\t\t\t\tif(!touch || touch.phase !== TouchPhase.HOVER)\n\t\t\t\t{\n\t\t\t\t\tStarling.juggler.remove(this._delayedCall);\n\t\t\t\t\tthis._touchPointID = -1;\n\t\t\t\t\tthis._target = null;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t//every time TouchPhase.HOVER is dispatched, the mouse has\n\t\t\t\t//moved. we need to reset the timer and update the position\n\t\t\t\t//where the tool tip will appear when the timer completes\n\t\t\t\tthis._toolTipX = touch.globalX;\n\t\t\t\tthis._toolTipY = touch.globalY;\n\t\t\t\tthis._delayedCall.reset(hoverDelayCallback, this._showDelay);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(this._root, TouchPhase.HOVER);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._target = this.getTarget(touch);\n\t\t\t\tif(!this._target)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._touchPointID = touch.id;\n\t\t\t\tthis._toolTipX = touch.globalX;\n\t\t\t\tthis._toolTipY = touch.globalY;\n\t\t\t\tvar timeSinceHide:Number = (getTimer() - this._hideTime) / 1000;\n\t\t\t\tif(timeSinceHide < this._resetDelay)\n\t\t\t\t{\n\t\t\t\t\tthis.hoverDelayCallback();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(this._delayedCall)\n\t\t\t\t{\n\t\t\t\t\t//to avoid excessive garbage collection, we reuse the\n\t\t\t\t\t//DelayedCall object.\n\t\t\t\t\tthis._delayedCall.reset(hoverDelayCallback, this._showDelay);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._delayedCall = new DelayedCall(hoverDelayCallback, this._showDelay);\n\t\t\t\t}\n\t\t\t\tStarling.juggler.add(this._delayedCall);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/FeathersControl.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\timport feathers.controls.text.BitmapFontTextRenderer;\n\timport feathers.controls.text.StageTextTextEditor;\n\timport feathers.events.FeathersEventType;\n\timport feathers.layout.ILayoutData;\n\timport feathers.layout.ILayoutDisplayObject;\n\timport feathers.motion.effectClasses.IEffectContext;\n\timport feathers.motion.effectClasses.IMoveEffectContext;\n\timport feathers.motion.effectClasses.IResizeEffectContext;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.utils.display.getDisplayObjectDepthFromStage;\n\n\timport flash.errors.IllegalOperationError;\n\timport flash.geom.Matrix;\n\timport flash.geom.Point;\n\timport flash.geom.Rectangle;\n\timport flash.utils.Dictionary;\n\timport flash.utils.getQualifiedClassName;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Sprite;\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\timport starling.utils.MatrixUtil;\n\timport starling.utils.Pool;\n\n\t/**\n\t * If this component supports focus, this optional skin will be\n\t * displayed above the component when <code>showFocus()</code> is\n\t * called. The focus indicator skin is not always displayed when the\n\t * component has focus. Typically, if the component receives focus from\n\t * a touch, the focus indicator is not displayed.\n\t *\n\t * <p>The <code>touchable</code> of this skin will always be set to\n\t * <code>false</code> so that it does not \"steal\" touches from the\n\t * component or its sub-components. This skin will not affect the\n\t * dimensions of the component or its hit area. It is simply a visual\n\t * indicator of focus.</p>\n\t *\n\t * <p>The implementation of this property is provided for convenience,\n\t * but it cannot be used unless a subclass implements the\n\t * <code>IFocusDisplayObject</code> interface.</p>\n\t *\n\t * <p>In the following example, the focus indicator skin is set:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * control.focusIndicatorSkin = new Image( texture );</listing>\n\t *\n\t * @default null\n\t *\n\t * @see #style:focusPaddingTop\n\t * @see #style:focusPaddingRight\n\t * @see #style:focusPaddingBottom\n\t * @see #style:focusPaddingLeft\n\t * @see #style:focusPadding\n\t */\n\t[Style(name=\"focusIndicatorSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * Quickly sets all focus padding properties to the same value. The\n\t * <code>focusPadding</code> getter always returns the value of\n\t * <code>focusPaddingTop</code>, but the other focus padding values may\n\t * be different.\n\t *\n\t * <p>The implementation of this property is provided for convenience,\n\t * but it cannot be used unless a subclass implements the\n\t * <code>IFocusDisplayObject</code> interface.</p>\n\t *\n\t * <p>The following example gives the button 2 pixels of focus padding\n\t * on all sides:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * control.focusPadding = 2;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:focusPaddingTop\n\t * @see #style:focusPaddingRight\n\t * @see #style:focusPaddingBottom\n\t * @see #style:focusPaddingLeft\n\t */\n\t[Style(name=\"focusPadding\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the object's top edge and the\n\t * top edge of the focus indicator skin. A negative value may be used\n\t * to expand the focus indicator skin outside the bounds of the object.\n\t *\n\t * <p>The implementation of this property is provided for convenience,\n\t * but it cannot be used unless a subclass implements the\n\t * <code>IFocusDisplayObject</code> interface.</p>\n\t *\n\t * <p>The following example gives the focus indicator skin -2 pixels of\n\t * padding on the top edge only:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * control.focusPaddingTop = -2;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:focusPadding\n\t */\n\t[Style(name=\"focusPaddingTop\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the object's right edge and the\n\t * right edge of the focus indicator skin. A negative value may be used\n\t * to expand the focus indicator skin outside the bounds of the object.\n\t *\n\t * <p>The implementation of this property is provided for convenience,\n\t * but it cannot be used unless a subclass implements the\n\t * <code>IFocusDisplayObject</code> interface.</p>\n\t *\n\t * <p>The following example gives the focus indicator skin -2 pixels of\n\t * padding on the right edge only:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * control.focusPaddingRight = -2;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:focusPadding\n\t */\n\t[Style(name=\"focusPaddingRight\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the object's bottom edge and the\n\t * bottom edge of the focus indicator skin. A negative value may be used\n\t * to expand the focus indicator skin outside the bounds of the object.\n\t *\n\t * <p>The implementation of this property is provided for convenience,\n\t * but it cannot be used unless a subclass implements the\n\t * <code>IFocusDisplayObject</code> interface.</p>\n\t *\n\t * <p>The following example gives the focus indicator skin -2 pixels of\n\t * padding on the bottom edge only:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * control.focusPaddingBottom = -2;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:focusPadding\n\t */\n\t[Style(name=\"focusPaddingBottom\",type=\"Number\")]\n\n\t/**\n\t * The minimum space, in pixels, between the object's left edge and the\n\t * left edge of the focus indicator skin. A negative value may be used\n\t * to expand the focus indicator skin outside the bounds of the object.\n\t *\n\t * <p>The implementation of this property is provided for convenience,\n\t * but it cannot be used unless a subclass implements the\n\t * <code>IFocusDisplayObject</code> interface.</p>\n\t *\n\t * <p>The following example gives the focus indicator skin -2 pixels of\n\t * padding on the right edge only:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * control.focusPaddingLeft = -2;</listing>\n\t *\n\t * @default 0\n\t *\n\t * @see #style:focusPadding\n\t */\n\t[Style(name=\"focusPaddingLeft\",type=\"Number\")]\n\n\t/**\n\t * Dispatched after <code>initialize()</code> has been called, but before\n\t * the first time that <code>draw()</code> has been called.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.INITIALIZE\n\t */\n\t[Event(name=\"initialize\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched after the component has validated for the first time. Both\n\t * <code>initialize()</code> and <code>draw()</code> will have been called,\n\t * and all children will have been created.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.CREATION_COMPLETE\n\t */\n\t[Event(name=\"creationComplete\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the width or height of the control changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.RESIZE\n\t */\n\t[Event(name=\"resize\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Base class for all UI controls. Implements invalidation and sets up some\n\t * basic template functions like <code>initialize()</code> and\n\t * <code>draw()</code>.\n\t *\n\t * <p>This is a base class for Feathers components that isn't meant to be\n\t * instantiated directly. It should only be subclassed. For a simple\n\t * component that will automatically size itself based on its children,\n\t * and with optional support for layouts, see <code>LayoutGroup</code>.</p>\n\t *\n\t * @see feathers.controls.LayoutGroup\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class FeathersControl extends Sprite implements IFeathersControl, ILayoutDisplayObject\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const HELPER_POINT:Point = new Point();\n\n\t\t/**\n\t\t * Flag to indicate that everything is invalid and should be redrawn.\n\t\t */\n\t\tpublic static const INVALIDATION_FLAG_ALL:String = \"all\";\n\n\t\t/**\n\t\t * Invalidation flag to indicate that the state has changed. Used by\n\t\t * <code>isEnabled</code>, but may be used for other control states too.\n\t\t *\n\t\t * @see #isEnabled\n\t\t */\n\t\tpublic static const INVALIDATION_FLAG_STATE:String = \"state\";\n\n\t\t/**\n\t\t * Invalidation flag to indicate that the dimensions of the UI control\n\t\t * have changed.\n\t\t */\n\t\tpublic static const INVALIDATION_FLAG_SIZE:String = \"size\";\n\n\t\t/**\n\t\t * Invalidation flag to indicate that the styles or visual appearance of\n\t\t * the UI control has changed.\n\t\t */\n\t\tpublic static const INVALIDATION_FLAG_STYLES:String = \"styles\";\n\n\t\t/**\n\t\t * Invalidation flag to indicate that the skin of the UI control has changed.\n\t\t */\n\t\tpublic static const INVALIDATION_FLAG_SKIN:String = \"skin\";\n\n\t\t/**\n\t\t * Invalidation flag to indicate that the layout of the UI control has\n\t\t * changed.\n\t\t */\n\t\tpublic static const INVALIDATION_FLAG_LAYOUT:String = \"layout\";\n\n\t\t/**\n\t\t * Invalidation flag to indicate that the primary data displayed by the\n\t\t * UI control has changed.\n\t\t */\n\t\tpublic static const INVALIDATION_FLAG_DATA:String = \"data\";\n\n\t\t/**\n\t\t * Invalidation flag to indicate that the scroll position of the UI\n\t\t * control has changed.\n\t\t */\n\t\tpublic static const INVALIDATION_FLAG_SCROLL:String = \"scroll\";\n\n\t\t/**\n\t\t * Invalidation flag to indicate that the selection of the UI control\n\t\t * has changed.\n\t\t */\n\t\tpublic static const INVALIDATION_FLAG_SELECTED:String = \"selected\";\n\n\t\t/**\n\t\t * Invalidation flag to indicate that the focus of the UI control has\n\t\t * changed.\n\t\t */\n\t\tpublic static const INVALIDATION_FLAG_FOCUS:String = \"focus\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_TEXT_RENDERER:String = \"textRenderer\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_TEXT_EDITOR:String = \"textEditor\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const ILLEGAL_WIDTH_ERROR:String = \"A component's width cannot be NaN.\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const ILLEGAL_HEIGHT_ERROR:String = \"A component's height cannot be NaN.\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const ABSTRACT_CLASS_ERROR:String = \"FeathersControl is an abstract class. For a lightweight Feathers wrapper, use feathers.controls.LayoutGroup.\";\n\n\t\t/**\n\t\t * A function used by all UI controls that support text renderers to\n\t\t * create an ITextRenderer instance. You may replace the default\n\t\t * function with your own, if you prefer not to use the\n\t\t * BitmapFontTextRenderer.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function():ITextRenderer</pre>\n\t\t *\n\t\t * @see ../../../help/text-renderers.html Introduction to Feathers text renderers\n\t\t * @see feathers.core.ITextRenderer\n\t\t */\n\t\tpublic static var defaultTextRendererFactory:Function = function():ITextRenderer\n\t\t{\n\t\t\treturn new BitmapFontTextRenderer();\n\t\t};\n\n\t\t/**\n\t\t * A function used by all UI controls that support text editor to\n\t\t * create an <code>ITextEditor</code> instance. You may replace the\n\t\t * default function with your own, if you prefer not to use the\n\t\t * <code>StageTextTextEditor</code>.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function():ITextEditor</pre>\n\t\t *\n\t\t * @see ../../../help/text-editors.html Introduction to Feathers text editors\n\t\t * @see feathers.core.ITextEditor\n\t\t */\n\t\tpublic static var defaultTextEditorFactory:Function = function():ITextEditor\n\t\t{\n\t\t\treturn new StageTextTextEditor();\n\t\t};\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function FeathersControl()\n\t\t{\n\t\t\tsuper();\n\t\t\tif(Object(this).constructor == FeathersControl)\n\t\t\t{\n\t\t\t\tthrow new Error(ABSTRACT_CLASS_ERROR);\n\t\t\t}\n\t\t\tthis.styleProvider = this.defaultStyleProvider;\n\t\t\tthis.addEventListener(Event.ADDED_TO_STAGE, feathersControl_addedToStageHandler);\n\t\t\tthis.addEventListener(Event.REMOVED_FROM_STAGE, feathersControl_removedFromStageHandler);\n\t\t\tif(this is IFocusDisplayObject)\n\t\t\t{\n\t\t\t\tthis.addEventListener(FeathersEventType.FOCUS_IN, focusInHandler);\n\t\t\t\tthis.addEventListener(FeathersEventType.FOCUS_OUT, focusOutHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _showEffectContext:IEffectContext = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _showEffect:Function = null;\n\n\t\t/**\n\t\t * An optional effect that is activated when the component is shown.\n\t\t * More specifically, this effect plays when the <code>visible</code>\n\t\t * property is set to <code>true</code>.\n\t\t *\n\t\t * <p>In the following example, a show effect fades the component's\n\t\t * <code>alpha</code> property from <code>0</code> to <code>1</code>:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * control.showEffect = Fade.createFadeBetweenEffect(0, 1);</listing>\n\t\t *\n\t\t * <p>A number of animated effects may be found in the\n\t\t * <a href=\"../motion/package-detail.html\">feathers.motion</a> package.\n\t\t * However, you are not limited to only these effects. It's possible\n\t\t * to create custom effects too.</p>\n\t\t *\n\t\t * <p>A custom effect function should have the following signature:</p>\n\t\t * <pre>function(target:DisplayObject):IEffectContext</pre>\n\t\t *\n\t\t * <p>The <code>IEffectContext</code> is used by the component to\n\t\t * control the effect, performing actions like playing the effect,\n\t\t * pausing it, or cancelling it.</p>\n\t\t *\n\t\t * <p>Custom animated effects that use\n\t\t * <code>starling.display.Tween</code> typically return a\n\t\t * <code>TweenEffectContext</code>. In the following example, we\n\t\t * recreate the <code>Fade.createFadeBetweenEffect()</code> used in the\n\t\t * previous example.</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * control.showEffect = function(target:DisplayObject):IEffectContext\n\t\t * {\n\t\t *     target.alpha = 0;\n\t\t *     var tween:Tween = new Tween(target, 0.5, Transitions.EASE_OUT);\n\t\t *     tween.fadeTo(1);\n\t\t *     return new TweenEffectContext(target, tween);\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #visible\n\t\t * @see #hideEffect\n\t\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t\t * @see feathers.motion.effectClasses.IEffectContext\n\t\t * @see feathers.motion.effectClasses.TweenEffectContext\n\t\t */\n\t\tpublic function get showEffect():Function\n\t\t{\n\t\t\treturn this._showEffect;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set showEffect(value:Function):void\n\t\t{\n\t\t\tthis._showEffect = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _hideEffectContext:IEffectContext = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _hideEffect:Function = null;\n\n\t\t/**\n\t\t * An optional effect that is activated when the component is hidden.\n\t\t * More specifically, this effect plays when the <code>visible</code>\n\t\t * property is set to <code>false</code>.\n\t\t *\n\t\t * <p>In the following example, a hide effect fades the component's\n\t\t * <code>alpha</code> property to <code>0</code>:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * control.hideEffect = Fade.createFadeOutEffect();</listing>\n\t\t *\n\t\t * <p>A number of animated effects may be found in the\n\t\t * <a href=\"../motion/package-detail.html\">feathers.motion</a> package.\n\t\t * However, you are not limited to only these effects. It's possible\n\t\t * to create custom effects too.</p>\n\t\t *\n\t\t * <p>A custom effect function should have the following signature:</p>\n\t\t * <pre>function(target:DisplayObject):IEffectContext</pre>\n\t\t *\n\t\t * <p>The <code>IEffectContext</code> is used by the component to\n\t\t * control the effect, performing actions like playing the effect,\n\t\t * pausing it, or cancelling it.</p>\n\t\t *\n\t\t * <p>Custom animated effects that use\n\t\t * <code>starling.display.Tween</code> typically return a\n\t\t * <code>TweenEffectContext</code>. In the following example, we\n\t\t * recreate the <code>Fade.createFadeOutEffect()</code> used in the\n\t\t * previous example.</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * control.hideEffect = function(target:DisplayObject):IEffectContext\n\t\t * {\n\t\t *     var tween:Tween = new Tween(target, 0.5, Transitions.EASE_OUT);\n\t\t *     tween.fadeTo(0);\n\t\t *     return new TweenEffectContext(target, tween);\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #visible\n\t\t * @see #showEffect\n\t\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t\t * @see feathers.motion.effectClasses.IEffectContext\n\t\t * @see feathers.motion.effectClasses.TweenEffectContext\n\t\t */\n\t\tpublic function get hideEffect():Function\n\t\t{\n\t\t\treturn this._hideEffect;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set hideEffect(value:Function):void\n\t\t{\n\t\t\tthis._hideEffect = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _pendingVisible:Boolean = true;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set visible(value:Boolean):void\n\t\t{\n\t\t\tif(value == this._pendingVisible)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._pendingVisible = value;\n\t\t\tif(this._suspendEffectsCount == 0 && this._hideEffectContext !== null)\n\t\t\t{\n\t\t\t\tthis._hideEffectContext.interrupt();\n\t\t\t\tthis._hideEffectContext = null;\n\t\t\t}\n\t\t\tif(this._suspendEffectsCount == 0 && this._showEffectContext !== null)\n\t\t\t{\n\t\t\t\tthis._showEffectContext.interrupt();\n\t\t\t\tthis._showEffectContext = null;\n\t\t\t}\n\t\t\tif(this._pendingVisible)\n\t\t\t{\n\t\t\t\tsuper.visible = this._pendingVisible;\n\t\t\t\tif(this.isCreated && this._suspendEffectsCount == 0 && this._showEffect !== null && this.stage !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._showEffectContext = IEffectContext(this._showEffect(this));\n\t\t\t\t\tthis._showEffectContext.addEventListener(Event.COMPLETE, showEffectContext_completeHandler);\n\t\t\t\t\tthis._showEffectContext.play();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(!this.isCreated || this._suspendEffectsCount > 0 || this._hideEffect === null || this.stage === null)\n\t\t\t\t{\n\t\t\t\t\tsuper.visible = this._pendingVisible;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._hideEffectContext = IEffectContext(this._hideEffect(this));\n\t\t\t\t\tthis._hideEffectContext.addEventListener(Event.COMPLETE, hideEffectContext_completeHandler);\n\t\t\t\t\tthis._hideEffectContext.play();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _focusInEffectContext:IEffectContext = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _focusInEffect:Function = null;\n\n\t\t/**\n\t\t * An optional effect that is activated when the component receives\n\t\t * focus.\n\t\t *\n\t\t * <p>The implementation of this property is provided for convenience,\n\t\t * but it cannot be used unless a subclass implements the\n\t\t * <code>IFocusDisplayObject</code> interface.</p>\n\t\t *\n\t\t * <p>A number of animated effects may be found in the\n\t\t * <a href=\"../motion/package-detail.html\">feathers.motion</a> package.\n\t\t * However, you are not limited to only these effects. It's possible\n\t\t * to create custom effects too.</p>\n\t\t *\n\t\t * <p>A custom effect function should have the following signature:</p>\n\t\t * <pre>function(target:DisplayObject):IEffectContext</pre>\n\t\t *\n\t\t * <p>The <code>IEffectContext</code> is used by the component to\n\t\t * control the effect, performing actions like playing the effect,\n\t\t * pausing it, or cancelling it.</p>\n\t\t *\n\t\t * <p>Custom animated effects that use\n\t\t * <code>starling.display.Tween</code> typically return a\n\t\t * <code>TweenEffectContext</code>.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #focusOutEffect\n\t\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t\t * @see feathers.motion.effectClasses.IEffectContext\n\t\t * @see feathers.motion.effectClasses.TweenEffectContext\n\t\t */\n\t\tpublic function get focusInEffect():Function\n\t\t{\n\t\t\treturn this._focusInEffect;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set focusInEffect(value:Function):void\n\t\t{\n\t\t\tthis._focusInEffect = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _focusOutEffectContext:IEffectContext = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _focusOutEffect:Function = null;\n\n\t\t/**\n\t\t * An optional effect that is activated when the component loses focus.\n\t\t *\n\t\t * <p>The implementation of this property is provided for convenience,\n\t\t * but it cannot be used unless a subclass implements the\n\t\t * <code>IFocusDisplayObject</code> interface.</p>\n\t\t *\n\t\t * <p>The implementation of this property is provided for convenience,\n\t\t * but it cannot be used unless a subclass implements the\n\t\t * <code>IFocusDisplayObject</code> interface.</p>\n\t\t *\n\t\t * <p>A number of animated effects may be found in the\n\t\t * <a href=\"../motion/package-detail.html\">feathers.motion</a> package.\n\t\t * However, you are not limited to only these effects. It's possible\n\t\t * to create custom effects too.</p>\n\t\t *\n\t\t * <p>A custom effect function should have the following signature:</p>\n\t\t * <pre>function(target:DisplayObject):IEffectContext</pre>\n\t\t *\n\t\t * <p>The <code>IEffectContext</code> is used by the component to\n\t\t * control the effect, performing actions like playing the effect,\n\t\t * pausing it, or cancelling it.</p>\n\t\t *\n\t\t * <p>Custom animated effects that use\n\t\t * <code>starling.display.Tween</code> typically return a\n\t\t * <code>TweenEffectContext</code>.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #focusInEffect\n\t\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t\t * @see feathers.motion.effectClasses.IEffectContext\n\t\t * @see feathers.motion.effectClasses.TweenEffectContext\n\t\t */\n\t\tpublic function get focusOutEffect():Function\n\t\t{\n\t\t\treturn this._focusOutEffect;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set focusOutEffect(value:Function):void\n\t\t{\n\t\t\tthis._focusOutEffect = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _addedEffectContext:IEffectContext = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _addedEffect:Function = null;\n\n\t\t/**\n\t\t * An optional effect that is activated when the component is added to\n\t\t * the stage. Typically used to animate the component's appearance when\n\t\t * it is first displayed.\n\t\t *\n\t\t * <p>In the following example, an added effect fades the component's\n\t\t * <code>alpha</code> property from <code>0</code> to <code>1</code>:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * control.addedEffect = Fade.createFadeBetweenEffect(0, 1);</listing>\n\t\t *\n\t\t * <p>A number of animated effects may be found in the\n\t\t * <a href=\"../motion/package-detail.html\">feathers.motion</a> package.\n\t\t * However, you are not limited to only these effects. It's possible\n\t\t * to create custom effects too.</p>\n\t\t *\n\t\t * <p>A custom effect function should have the following signature:</p>\n\t\t * <pre>function(target:DisplayObject):IEffectContext</pre>\n\t\t *\n\t\t * <p>The <code>IEffectContext</code> is used by the component to\n\t\t * control the effect, performing actions like playing the effect,\n\t\t * pausing it, or cancelling it.</p>\n\t\t *\n\t\t * <p>Custom animated effects that use\n\t\t * <code>starling.display.Tween</code> typically return a\n\t\t * <code>TweenEffectContext</code>. In the following example, we\n\t\t * recreate the <code>Fade.createFadeBetweenEffect()</code> used in the\n\t\t * previous example.</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * control.addedEffect = function(target:DisplayObject):IEffectContext\n\t\t * {\n\t\t *     target.alpha = 0;\n\t\t *     var tween:Tween = new Tween(target, 0.5, Transitions.EASE_OUT);\n\t\t *     tween.fadeTo(1);\n\t\t *     return new TweenEffectContext(target, tween);\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #removeFromParentWithEffect()\n\t\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t\t * @see feathers.motion.effectClasses.IEffectContext\n\t\t * @see feathers.motion.effectClasses.TweenEffectContext\n\t\t */\n\t\tpublic function get addedEffect():Function\n\t\t{\n\t\t\treturn this._addedEffect;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set addedEffect(value:Function):void\n\t\t{\n\t\t\tthis._addedEffect = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _removedEffectContext:IEffectContext = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _disposeAfterRemovedEffect:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _validationQueue:ValidationQueue;\n\n\t\t/**\n\t\t * The concatenated <code>styleNameList</code>, with values separated\n\t\t * by spaces. Style names are somewhat similar to classes in CSS\n\t\t * selectors. In Feathers, they are a non-unique identifier that can\n\t\t * differentiate multiple styles of the same type of UI control. A\n\t\t * single control may have many style names, and many controls can share\n\t\t * a single style name. A <a target=\"_top\" href=\"../../../help/themes.html\">theme</a>\n\t\t * or another skinning mechanism may use style names to provide a\n\t\t * variety of visual appearances for a single component class.\n\t\t *\n\t\t * <p>In general, the <code>styleName</code> property should not be set\n\t\t * directly on a Feathers component. You should add and remove style\n\t\t * names from the <code>styleNameList</code> property instead.</p>\n\t\t *\n\t\t * @default \"\"\n\t\t *\n\t\t * @see #styleNameList\n\t\t * @see ../../../help/themes.html Introduction the Feathers themes\n\t\t * @see ../../../help/custom-themes.html Creating custom Feathers themes\n\t\t */\n\t\tpublic function get styleName():String\n\t\t{\n\t\t\treturn this._styleNameList.value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set styleName(value:String):void\n\t\t{\n\t\t\tthis._styleNameList.value = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _styleNameList:TokenList = new TokenList();\n\n\t\t/**\n\t\t * Contains a list of all \"styles\" assigned to this control. Names are\n\t\t * like classes in CSS selectors. They are a non-unique identifier that\n\t\t * can differentiate multiple styles of the same type of UI control. A\n\t\t * single control may have many names, and many controls can share a\n\t\t * single name. A <a target=\"_top\" href=\"../../../help/themes.html\">theme</a>\n\t\t * or another skinning mechanism may use style names to provide a\n\t\t * variety of visual appearances for a single component class.\n\t\t *\n\t\t * <p>Names may be added, removed, or toggled on the\n\t\t * <code>styleNameList</code>. Names cannot contain spaces.</p>\n\t\t *\n\t\t * <p>In the following example, a name is added to the name list:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * control.styleNameList.add( \"custom-component-name\" );</listing>\n\t\t *\n\t\t * @see #styleName\n\t\t * @see ../../../help/themes.html Introduction to Feathers themes\n\t\t * @see ../../../help/custom-themes.html Creating custom Feathers themes\n\t\t */\n\t\tpublic function get styleNameList():TokenList\n\t\t{\n\t\t\treturn this._styleNameList;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _styleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * When a component initializes, a style provider may be used to set\n\t\t * properties that affect the component's visual appearance.\n\t\t *\n\t\t * <p>You can set or replace an existing style provider at any time\n\t\t * before a component initializes without immediately affecting the\n\t\t * component's visual appearance. After the component initializes, the\n\t\t * style provider may still be changed, but any properties that\n\t\t * were set by the previous style provider will not be reset to their\n\t\t * default values.</p>\n\t\t *\n\t\t * @see #styleName\n\t\t * @see #styleNameList\n\t\t * @see ../../../help/themes.html Introduction to Feathers themes\n\t\t */\n\t\tpublic function get styleProvider():IStyleProvider\n\t\t{\n\t\t\treturn this._styleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set styleProvider(value:IStyleProvider):void\n\t\t{\n\t\t\tif(this._styleProvider === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._applyingStyles)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Cannot change styleProvider while the current style provider is applying styles.\");\n\t\t\t}\n\t\t\tif(this._styleProvider !== null && this._styleProvider is EventDispatcher)\n\t\t\t{\n\t\t\t\tEventDispatcher(this._styleProvider).removeEventListener(Event.CHANGE, styleProvider_changeHandler);\n\t\t\t}\n\t\t\tthis._styleProvider = value;\n\t\t\tif(this._styleProvider !== null)\n\t\t\t{\n\t\t\t\tif(this.isInitialized)\n\t\t\t\t{\n\t\t\t\t\tthis._applyingStyles = true;\n\t\t\t\t\tthis._styleProvider.applyStyles(this);\n\t\t\t\t\tthis._applyingStyles = false;\n\t\t\t\t}\n\t\t\t\tif(this._styleProvider is EventDispatcher)\n\t\t\t\t{\n\t\t\t\t\tEventDispatcher(this._styleProvider).addEventListener(Event.CHANGE, styleProvider_changeHandler);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * When the <code>FeathersControl</code> constructor is called, the\n\t\t * <code>styleProvider</code> property is set to this value. May be\n\t\t * <code>null</code>.\n\t\t *\n\t\t * <p>Typically, a subclass of <code>FeathersControl</code> will\n\t\t * override this function to return its static <code>globalStyleProvider</code>\n\t\t * value. For instance, <code>feathers.controls.Button</code> overrides\n\t\t * this function, and its implementation looks like this:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * override protected function get defaultStyleProvider():IStyleProvider\n\t\t * {\n\t\t *     return Button.globalStyleProvider;\n\t\t * }</listing>\n\t\t *\n\t\t * @see #styleProvider\n\t\t */\n\t\tprotected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isQuickHitAreaEnabled:Boolean = false;\n\n\t\t/**\n\t\t * Similar to <code>mouseChildren</code> on the classic display list. If\n\t\t * <code>true</code>, children cannot dispatch touch events, but hit\n\t\t * tests will be much faster. Easier than overriding\n\t\t * <code>hitTest()</code>.\n\t\t *\n\t\t * <p>In the following example, the quick hit area is enabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * control.isQuickHitAreaEnabled = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic function get isQuickHitAreaEnabled():Boolean\n\t\t{\n\t\t\treturn this._isQuickHitAreaEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isQuickHitAreaEnabled(value:Boolean):void\n\t\t{\n\t\t\tthis._isQuickHitAreaEnabled = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _hitArea:Rectangle = new Rectangle();\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isInitializing:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isInitialized:Boolean = false;\n\n\t\t/**\n\t\t * Determines if the component has been initialized yet. The\n\t\t * <code>initialize()</code> function is called one time only, when the\n\t\t * Feathers UI control is added to the display list for the first time.\n\t\t *\n\t\t * <p>In the following example, we check if the component is initialized\n\t\t * or not, and we listen for an event if it isn't:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * if( !control.isInitialized )\n\t\t * {\n\t\t *     control.addEventListener( FeathersEventType.INITIALIZE, initializeHandler );\n\t\t * }</listing>\n\t\t *\n\t\t * @see #event:initialize\n\t\t * @see #isCreated\n\t\t */\n\t\tpublic function get isInitialized():Boolean\n\t\t{\n\t\t\treturn this._isInitialized;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _applyingStyles:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _restrictedStyles:Dictionary;\n\n\t\t/**\n\t\t * @private\n\t\t * A flag that indicates that everything is invalid. If true, no other\n\t\t * flags will need to be tracked.\n\t\t */\n\t\tprotected var _isAllInvalid:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _invalidationFlags:Object = {};\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _delayedInvalidationFlags:Object = {};\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isEnabled:Boolean = true;\n\n\t\t/**\n\t\t * Indicates whether the control is interactive or not.\n\t\t *\n\t\t * <p>In the following example, the control is disabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * control.isEnabled = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic function get isEnabled():Boolean\n\t\t{\n\t\t\treturn _isEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isEnabled(value:Boolean):void\n\t\t{\n\t\t\tif(this._isEnabled == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isEnabled = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STATE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitWidth:Number = NaN;\n\n\t\t/**\n\t\t * The width value explicitly set by passing a value to the\n\t\t * <code>width</code> setter or to the <code>setSize()</code> method.\n\t\t */\n\t\tpublic function get explicitWidth():Number\n\t\t{\n\t\t\treturn this._explicitWidth;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _resizeEffectContext:IEffectContext = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _resizeEffect:Function = null;\n\n\t\t/**\n\t\t * An optional effect that is activated when the component is resized\n\t\t * with new dimensions. More specifically, this effect plays when the\n\t\t * <code>width</code> or <code>height</code> property changes.\n\t\t *\n\t\t * <p>In the following example, a resize effect will animate the new\n\t\t * dimensions of the component when it resizes:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * control.resizeEffect = Resize.createResizeEffect();</listing>\n\t\t *\n\t\t * <p>A custom effect function should have the following signature:</p>\n\t\t * <pre>function(target:DisplayObject):IResizeEffectContext</pre>\n\t\t *\n\t\t * <p>The <code>IResizeEffectContext</code> is used by the component to\n\t\t * control the effect, performing actions like playing the effect,\n\t\t * pausing it, or cancelling it. Custom animated resize effects that use\n\t\t * <code>starling.display.Tween</code> typically return a\n\t\t * <code>TweenResizeEffectContext</code>.</p>\n\t\t *\n\t\t * @see feathers.motion.Resize\n\t\t * @see #width\n\t\t * @see #height\n\t\t * @see #setSize()\n\t\t */\n\t\tpublic function get resizeEffect():Function\n\t\t{\n\t\t\treturn this._resizeEffect;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set resizeEffect(value:Function):void\n\t\t{\n\t\t\tthis._resizeEffect = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _moveEffectContext:IEffectContext = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _moveEffect:Function = null;\n\n\t\t/**\n\t\t * An optional effect that is activated when the component is moved to\n\t\t * a new position. More specifically, this effect plays when the\n\t\t * <code>x</code> or <code>y</code> property changes.\n\t\t *\n\t\t * <p>In the following example, a move effect will animate the new\n\t\t * position of the component when it moves:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * control.moveEffect = Move.createMoveEffect();</listing>\n\t\t *\n\t\t * <p>A custom effect function should have the following signature:</p>\n\t\t * <pre>function(target:DisplayObject):IMoveEffectContext</pre>\n\t\t *\n\t\t * <p>The <code>IMoveEffectContext</code> is used by the component to\n\t\t * control the effect, performing actions like playing the effect,\n\t\t * pausing it, or cancelling it. Custom animated move effects that use\n\t\t * <code>starling.display.Tween</code> typically return a\n\t\t * <code>TweenMoveEffectContext</code>.</p>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.motion.Move\n\t\t * @see #x\n\t\t * @see #y\n\t\t * @see #move()\n\t\t */\n\t\tpublic function get moveEffect():Function\n\t\t{\n\t\t\treturn this._moveEffect;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set moveEffect(value:Function):void\n\t\t{\n\t\t\tthis._moveEffect = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set x(value:Number):void\n\t\t{\n\t\t\tvar newY:Number = this.y;\n\t\t\tif(this._suspendEffectsCount == 0 && this._moveEffectContext !== null)\n\t\t\t{\n\t\t\t\tif(this._moveEffectContext is IMoveEffectContext)\n\t\t\t\t{\n\t\t\t\t\tvar moveEffectContext:IMoveEffectContext = IMoveEffectContext(this._moveEffectContext);\n\t\t\t\t\tnewY = moveEffectContext.newY;\n\t\t\t\t}\n\t\t\t\tthis._moveEffectContext.interrupt();\n\t\t\t\tthis._moveEffectContext = null;\n\t\t\t}\n\t\t\tif(this.isCreated && this._suspendEffectsCount == 0 && this._moveEffect !== null)\n\t\t\t{\n\t\t\t\tthis._moveEffectContext = IEffectContext(this._moveEffect(this));\n\t\t\t\tthis._moveEffectContext.addEventListener(Event.COMPLETE, moveEffectContext_completeHandler);\n\t\t\t\tif(this._moveEffectContext is IMoveEffectContext)\n\t\t\t\t{\n\t\t\t\t\tmoveEffectContext = IMoveEffectContext(this._moveEffectContext);\n\t\t\t\t\tmoveEffectContext.oldX = this.x;\n\t\t\t\t\tmoveEffectContext.oldY = this.y;\n\t\t\t\t\tmoveEffectContext.newX = value;\n\t\t\t\t\tmoveEffectContext.newY = newY;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tsuper.x = value;\n\t\t\t\t}\n\t\t\t\tthis._moveEffectContext.play();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tsuper.x = value;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set y(value:Number):void\n\t\t{\n\t\t\tvar newX:Number = this.x;\n\t\t\tif(this._suspendEffectsCount == 0 && this._moveEffectContext !== null)\n\t\t\t{\n\t\t\t\tif(this._moveEffectContext is IMoveEffectContext)\n\t\t\t\t{\n\t\t\t\t\tvar moveEffectContext:IMoveEffectContext = IMoveEffectContext(this._moveEffectContext);\n\t\t\t\t\tnewX = moveEffectContext.newX;\n\t\t\t\t}\n\t\t\t\tthis._moveEffectContext.interrupt();\n\t\t\t\tthis._moveEffectContext = null;\n\t\t\t}\n\t\t\tif(this.isCreated && this._suspendEffectsCount == 0 && this._moveEffect !== null)\n\t\t\t{\n\t\t\t\tthis._moveEffectContext = IEffectContext(this._moveEffect(this));\n\t\t\t\tthis._moveEffectContext.addEventListener(Event.COMPLETE, moveEffectContext_completeHandler);\n\t\t\t\tif(this._moveEffectContext is IMoveEffectContext)\n\t\t\t\t{\n\t\t\t\t\tmoveEffectContext = IMoveEffectContext(this._moveEffectContext);\n\t\t\t\t\tmoveEffectContext.oldX = this.x;\n\t\t\t\t\tmoveEffectContext.oldY = this.y;\n\t\t\t\t\tmoveEffectContext.newX = newX;\n\t\t\t\t\tmoveEffectContext.newY = value;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tsuper.y = value;\n\t\t\t\t}\n\t\t\t\tthis._moveEffectContext.play();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tsuper.y = value;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * The final width value that should be used for layout. If the width\n\t\t * has been explicitly set, then that value is used. If not, the actual\n\t\t * width will be calculated automatically. Each component has different\n\t\t * automatic sizing behavior, but it's usually based on the component's\n\t\t * skin or content, including text or subcomponents.\n\t\t */\n\t\tprotected var actualWidth:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t * The <code>actualWidth</code> value that accounts for\n\t\t * <code>scaleX</code>. Not intended to be used for layout since layout\n\t\t * uses unscaled values. This is the value exposed externally through\n\t\t * the <code>width</code> getter.\n\t\t */\n\t\tprotected var scaledActualWidth:Number = 0;\n\n\t\t/**\n\t\t * The width of the component, in pixels. This could be a value that was\n\t\t * set explicitly, or the component will automatically resize if no\n\t\t * explicit width value is provided. Each component has a different\n\t\t * automatic sizing behavior, but it's usually based on the component's\n\t\t * skin or content, including text or subcomponents.\n\t\t *\n\t\t * <p><strong>Note:</strong> Values of the <code>width</code> and\n\t\t * <code>height</code> properties may not be accurate until after\n\t\t * validation. If you are seeing <code>width</code> or <code>height</code>\n\t\t * values of <code>0</code>, but you can see something on the screen and\n\t\t * know that the value should be larger, it may be because you asked for\n\t\t * the dimensions before the component had validated. Call\n\t\t * <code>validate()</code> to tell the component to immediately redraw\n\t\t * and calculate an accurate values for the dimensions.</p>\n\t\t *\n\t\t * <p>In the following example, the width is set to 120 pixels:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * control.width = 120;</listing>\n\t\t *\n\t\t * <p>In the following example, the width is cleared so that the\n\t\t * component can automatically measure its own width:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * control.width = NaN;</listing>\n\t\t *\n\t\t * @see feathers.core.FeathersControl#setSize()\n\t\t * @see feathers.core.FeathersControl#validate()\n\t\t */\n\t\toverride public function get width():Number\n\t\t{\n\t\t\treturn this.scaledActualWidth;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set width(value:Number):void\n\t\t{\n\t\t\tvar valueIsNaN:Boolean = value !== value; //isNaN\n\t\t\tif(valueIsNaN &&\n\t\t\t\tthis._explicitWidth !== this._explicitWidth) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this.scaleX != 1)\n\t\t\t{\n\t\t\t\tvalue /= this.scaleX;\n\t\t\t}\n\t\t\tif(this._explicitWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar hasSetExplicitWidth:Boolean = false;\n\t\t\tvar newHeight:Number = this.actualHeight;\n\t\t\tif(this._suspendEffectsCount == 0 && this._resizeEffectContext !== null)\n\t\t\t{\n\t\t\t\tif(this._resizeEffectContext is IResizeEffectContext)\n\t\t\t\t{\n\t\t\t\t\tvar resizeEffectContext:IResizeEffectContext = IResizeEffectContext(this._resizeEffectContext);\n\t\t\t\t\tnewHeight = resizeEffectContext.newHeight;\n\t\t\t\t}\n\t\t\t\tthis._resizeEffectContext.interrupt();\n\t\t\t\tthis._resizeEffectContext = null;\n\t\t\t}\n\t\t\tif(!valueIsNaN && this.isCreated && this._suspendEffectsCount == 0 && this._resizeEffect !== null)\n\t\t\t{\n\t\t\t\tthis._resizeEffectContext = IEffectContext(this._resizeEffect(this));\n\t\t\t\tthis._resizeEffectContext.addEventListener(Event.COMPLETE, resizeEffectContext_completeHandler);\n\t\t\t\tif(this._resizeEffectContext is IResizeEffectContext)\n\t\t\t\t{\n\t\t\t\t\tresizeEffectContext = IResizeEffectContext(this._resizeEffectContext);\n\t\t\t\t\tresizeEffectContext.oldWidth = this.actualWidth;\n\t\t\t\t\tresizeEffectContext.oldHeight = this.actualHeight;\n\t\t\t\t\tresizeEffectContext.newWidth = value;\n\t\t\t\t\tresizeEffectContext.newHeight = newHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._explicitWidth = value;\n\t\t\t\t\thasSetExplicitWidth = true;\n\t\t\t\t}\n\t\t\t\tthis._resizeEffectContext.play();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._explicitWidth = value;\n\t\t\t\thasSetExplicitWidth = true;\n\t\t\t}\n\t\t\tif(hasSetExplicitWidth)\n\t\t\t{\n\t\t\t\tif(valueIsNaN)\n\t\t\t\t{\n\t\t\t\t\tthis.actualWidth = this.scaledActualWidth = 0;\n\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar result:Boolean = this.saveMeasurements(value, this.actualHeight, this.actualMinWidth, this.actualMinHeight);\n\t\t\t\t\tif(result)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitHeight:Number = NaN;\n\n\t\t/**\n\t\t * The height value explicitly set by passing a value to the\n\t\t * <code>height</code> setter or by calling the <code>setSize()</code>\n\t\t * function.\n\t\t */\n\t\tpublic function get explicitHeight():Number\n\t\t{\n\t\t\treturn this._explicitHeight;\n\t\t}\n\n\t\t/**\n\t\t * The final height value that should be used for layout. If the height\n\t\t * has been explicitly set, then that value is used. If not, the actual\n\t\t * height will be calculated automatically. Each component has different\n\t\t * automatic sizing behavior, but it's usually based on the component's\n\t\t * skin or content, including text or subcomponents.\n\t\t */\n\t\tprotected var actualHeight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t * The <code>actualHeight</code> value that accounts for\n\t\t * <code>scaleY</code>. Not intended to be used for layout since layout\n\t\t * uses unscaled values. This is the value exposed externally through\n\t\t * the <code>height</code> getter.\n\t\t */\n\t\tprotected var scaledActualHeight:Number = 0;\n\n\t\t/**\n\t\t * The height of the component, in pixels. This could be a value that\n\t\t * was set explicitly, or the component will automatically resize if no\n\t\t * explicit height value is provided. Each component has a different\n\t\t * automatic sizing behavior, but it's usually based on the component's\n\t\t * skin or content, including text or subcomponents.\n\t\t *\n\t\t * <p><strong>Note:</strong> Values of the <code>width</code> and\n\t\t * <code>height</code> properties may not be accurate until after\n\t\t * validation. If you are seeing <code>width</code> or <code>height</code>\n\t\t * values of <code>0</code>, but you can see something on the screen and\n\t\t * know that the value should be larger, it may be because you asked for\n\t\t * the dimensions before the component had validated. Call\n\t\t * <code>validate()</code> to tell the component to immediately redraw\n\t\t * and calculate an accurate values for the dimensions.</p>\n\t\t *\n\t\t * <p>In the following example, the height is set to 120 pixels:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * control.height = 120;</listing>\n\t\t *\n\t\t * <p>In the following example, the height is cleared so that the\n\t\t * component can automatically measure its own height:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * control.height = NaN;</listing>\n\t\t *\n\t\t * @see feathers.core.FeathersControl#setSize()\n\t\t * @see feathers.core.FeathersControl#validate()\n\t\t */\n\t\toverride public function get height():Number\n\t\t{\n\t\t\treturn this.scaledActualHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set height(value:Number):void\n\t\t{\n\t\t\tvar valueIsNaN:Boolean = value !== value; //isNaN\n\t\t\tif(valueIsNaN &&\n\t\t\t\tthis._explicitHeight !== this._explicitHeight) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this.scaleY != 1)\n\t\t\t{\n\t\t\t\tvalue /= this.scaleY;\n\t\t\t}\n\t\t\tif(this._explicitHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar hasSetExplicitHeight:Boolean = false;\n\t\t\tvar newWidth:Number = this.actualWidth;\n\t\t\tif(this._suspendEffectsCount == 0 && this._resizeEffectContext !== null)\n\t\t\t{\n\t\t\t\tif(this._resizeEffectContext is IResizeEffectContext)\n\t\t\t\t{\n\t\t\t\t\tvar resizeEffectContext:IResizeEffectContext = IResizeEffectContext(this._resizeEffectContext);\n\t\t\t\t\tnewWidth = resizeEffectContext.newWidth;\n\t\t\t\t}\n\t\t\t\tthis._resizeEffectContext.interrupt();\n\t\t\t\tthis._resizeEffectContext = null;\n\t\t\t}\n\t\t\tif(!valueIsNaN && this.isCreated && this._suspendEffectsCount == 0 && this._resizeEffect !== null)\n\t\t\t{\n\t\t\t\tthis._resizeEffectContext = IEffectContext(this._resizeEffect(this));\n\t\t\t\tthis._resizeEffectContext.addEventListener(Event.COMPLETE, resizeEffectContext_completeHandler);\n\t\t\t\tif(this._resizeEffectContext is IResizeEffectContext)\n\t\t\t\t{\n\t\t\t\t\tresizeEffectContext = IResizeEffectContext(this._resizeEffectContext);\n\t\t\t\t\tresizeEffectContext.oldWidth = this.actualWidth;\n\t\t\t\t\tresizeEffectContext.oldHeight = this.actualHeight;\n\t\t\t\t\tresizeEffectContext.newWidth = newWidth;\n\t\t\t\t\tresizeEffectContext.newHeight = value;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._explicitHeight = value;\n\t\t\t\t\thasSetExplicitHeight = true;\n\t\t\t\t}\n\t\t\t\tthis._resizeEffectContext.play();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._explicitHeight = value;\n\t\t\t\thasSetExplicitHeight = true;\n\t\t\t}\n\t\t\tif(hasSetExplicitHeight)\n\t\t\t{\n\t\t\t\tif(valueIsNaN)\n\t\t\t\t{\n\t\t\t\t\tthis.actualHeight = this.scaledActualHeight = 0;\n\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar result:Boolean = this.saveMeasurements(this.actualWidth, value, this.actualMinWidth, this.actualMinHeight);\n\t\t\t\t\tif(result)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minTouchWidth:Number = 0;\n\n\t\t/**\n\t\t * If using <code>isQuickHitAreaEnabled</code>, and the hit area's\n\t\t * width is smaller than this value, it will be expanded.\n\t\t *\n\t\t * <p>In the following example, the minimum width of the hit area is\n\t\t * set to 120 pixels:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * control.minTouchWidth = 120;</listing>\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get minTouchWidth():Number\n\t\t{\n\t\t\treturn this._minTouchWidth;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minTouchWidth(value:Number):void\n\t\t{\n\t\t\tif(this._minTouchWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._minTouchWidth = value;\n\t\t\tthis.refreshHitAreaX();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minTouchHeight:Number = 0;\n\n\t\t/**\n\t\t * If using <code>isQuickHitAreaEnabled</code>, and the hit area's\n\t\t * height is smaller than this value, it will be expanded.\n\t\t *\n\t\t * <p>In the following example, the minimum height of the hit area is\n\t\t * set to 120 pixels:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * control.minTouchHeight = 120;</listing>\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get minTouchHeight():Number\n\t\t{\n\t\t\treturn this._minTouchHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minTouchHeight(value:Number):void\n\t\t{\n\t\t\tif(this._minTouchHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._minTouchHeight = value;\n\t\t\tthis.refreshHitAreaY();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitMinWidth:Number = NaN;\n\n\t\t/**\n\t\t * The minimum width value explicitly set by passing a value to the\n\t\t * <code>minWidth</code> setter.\n\t\t *\n\t\t * <p>If no value has been passed to the <code>minWidth</code> setter,\n\t\t * this property returns <code>NaN</code>.</p>\n\t\t */\n\t\tpublic function get explicitMinWidth():Number\n\t\t{\n\t\t\treturn this._explicitMinWidth;\n\t\t}\n\n\t\t/**\n\t\t * The final minimum width value that should be used for layout. If the\n\t\t * minimum width has been explicitly set, then that value is used. If\n\t\t * not, the actual minimum width will be calculated automatically. Each\n\t\t * component has different automatic sizing behavior, but it's usually\n\t\t * based on the component's skin or content, including text or\n\t\t * subcomponents.\n\t\t */\n\t\tprotected var actualMinWidth:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t * The <code>actualMinWidth</code> value that accounts for\n\t\t * <code>scaleX</code>. Not intended to be used for layout since layout\n\t\t * uses unscaled values. This is the value exposed externally through\n\t\t * the <code>minWidth</code> getter.\n\t\t */\n\t\tprotected var scaledActualMinWidth:Number = 0;\n\n\t\t/**\n\t\t * The minimum recommended width to be used for self-measurement and,\n\t\t * optionally, by any code that is resizing this component. This value\n\t\t * is not strictly enforced in all cases. An explicit width value that\n\t\t * is smaller than <code>minWidth</code> may be set and will not be\n\t\t * affected by the minimum.\n\t\t *\n\t\t * <p>In the following example, the minimum width of the control is\n\t\t * set to 120 pixels:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * control.minWidth = 120;</listing>\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get minWidth():Number\n\t\t{\n\t\t\treturn this.scaledActualMinWidth;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minWidth(value:Number):void\n\t\t{\n\t\t\tvar valueIsNaN:Boolean = value !== value; //isNaN\n\t\t\tif(valueIsNaN &&\n\t\t\t\tthis._explicitMinWidth !== this._explicitMinWidth) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this.scaleX != 1)\n\t\t\t{\n\t\t\t\tvalue /= this.scaleX;\n\t\t\t}\n\t\t\tif(this._explicitMinWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar oldValue:Number = this._explicitMinWidth;\n\t\t\tthis._explicitMinWidth = value;\n\t\t\tif(valueIsNaN)\n\t\t\t{\n\t\t\t\tthis.actualMinWidth = this.scaledActualMinWidth = 0;\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//saveMeasurements() might change actualWidth, so keep the old\n\t\t\t\t//value for the comparisons below\n\t\t\t\tvar actualWidth:Number = this.actualWidth;\n\t\t\t\tthis.saveMeasurements(actualWidth, this.actualHeight, value, this.actualMinHeight);\n\t\t\t\tif(this._explicitWidth !== this._explicitWidth && //isNaN\n\t\t\t\t\t(actualWidth < value || actualWidth == oldValue))\n\t\t\t\t{\n\t\t\t\t\t//only invalidate if this change might affect the width\n\t\t\t\t\t//because everything else was handled in saveMeasurements()\n\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitMinHeight:Number = NaN;\n\n\t\t/**\n\t\t * The minimum height value explicitly set by passing a value to the\n\t\t * <code>minHeight</code> setter.\n\t\t *\n\t\t * <p>If no value has been passed to the <code>minHeight</code> setter,\n\t\t * this property returns <code>NaN</code>.</p>\n\t\t */\n\t\tpublic function get explicitMinHeight():Number\n\t\t{\n\t\t\treturn this._explicitMinHeight;\n\t\t}\n\n\t\t/**\n\t\t * The final minimum height value that should be used for layout. If the\n\t\t * minimum height has been explicitly set, then that value is used. If\n\t\t * not, the actual minimum height will be calculated automatically. Each\n\t\t * component has different automatic sizing behavior, but it's usually\n\t\t * based on the component's skin or content, including text or\n\t\t * subcomponents.\n\t\t */\n\t\tprotected var actualMinHeight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t * The <code>actuaMinHeight</code> value that accounts for\n\t\t * <code>scaleY</code>. Not intended to be used for layout since layout\n\t\t * uses unscaled values. This is the value exposed externally through\n\t\t * the <code>minHeight</code> getter.\n\t\t */\n\t\tprotected var scaledActualMinHeight:Number = 0;\n\n\t\t/**\n\t\t * The minimum recommended height to be used for self-measurement and,\n\t\t * optionally, by any code that is resizing this component. This value\n\t\t * is not strictly enforced in all cases. An explicit height value that\n\t\t * is smaller than <code>minHeight</code> may be set and will not be\n\t\t * affected by the minimum.\n\t\t *\n\t\t * <p>In the following example, the minimum height of the control is\n\t\t * set to 120 pixels:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * control.minHeight = 120;</listing>\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get minHeight():Number\n\t\t{\n\t\t\treturn this.scaledActualMinHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minHeight(value:Number):void\n\t\t{\n\t\t\tvar valueIsNaN:Boolean = value !== value; //isNaN\n\t\t\tif(valueIsNaN &&\n\t\t\t\tthis._explicitMinHeight !== this._explicitMinHeight) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this.scaleY != 1)\n\t\t\t{\n\t\t\t\tvalue /= this.scaleY;\n\t\t\t}\n\t\t\tif(this._explicitMinHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar oldValue:Number = this._explicitMinHeight;\n\t\t\tthis._explicitMinHeight = value;\n\t\t\tif(valueIsNaN)\n\t\t\t{\n\t\t\t\tthis.actualMinHeight = this.scaledActualMinHeight = 0;\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//saveMeasurements() might change actualHeight, so keep the old\n\t\t\t\t//value for the comparisons below\n\t\t\t\tvar actualHeight:Number = this.actualHeight;\n\t\t\t\tthis.saveMeasurements(this.actualWidth, actualHeight, this.actualMinWidth, value);\n\t\t\t\tif(this._explicitHeight !== this._explicitHeight && //isNaN\n\t\t\t\t\t(actualHeight < value || actualHeight == oldValue))\n\t\t\t\t{\n\t\t\t\t\t//only invalidate if this change might affect the height\n\t\t\t\t\t//because everything else was handled in saveMeasurements()\n\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitMaxWidth:Number = Number.POSITIVE_INFINITY;\n\n\t\t/**\n\t\t * The maximum width value explicitly set by passing a value to the\n\t\t * <code>maxWidth</code> setter.\n\t\t *\n\t\t * <p>If no value has been passed to the <code>maxWidth</code> setter,\n\t\t * this property returns <code>NaN</code>.</p>\n\t\t */\n\t\tpublic function get explicitMaxWidth():Number\n\t\t{\n\t\t\treturn this._explicitMaxWidth;\n\t\t}\n\n\t\t/**\n\t\t * The maximum recommended width to be used for self-measurement and,\n\t\t * optionally, by any code that is resizing this component. This value\n\t\t * is not strictly enforced in all cases. An explicit width value that\n\t\t * is larger than <code>maxWidth</code> may be set and will not be\n\t\t * affected by the maximum.\n\t\t *\n\t\t * <p>In the following example, the maximum width of the control is\n\t\t * set to 120 pixels:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * control.maxWidth = 120;</listing>\n\t\t *\n\t\t * @default Number.POSITIVE_INFINITY\n\t\t */\n\t\tpublic function get maxWidth():Number\n\t\t{\n\t\t\treturn this._explicitMaxWidth;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maxWidth(value:Number):void\n\t\t{\n\t\t\tif(value < 0)\n\t\t\t{\n\t\t\t\tvalue = 0;\n\t\t\t}\n\t\t\tif(this._explicitMaxWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value) //isNaN\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"maxWidth cannot be NaN\");\n\t\t\t}\n\t\t\tvar oldValue:Number = this._explicitMaxWidth;\n\t\t\tthis._explicitMaxWidth = value;\n\t\t\tif(this._explicitWidth !== this._explicitWidth && //isNaN\n\t\t\t\t(this.actualWidth > value || this.actualWidth == oldValue))\n\t\t\t{\n\t\t\t\t//only invalidate if this change might affect the width\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitMaxHeight:Number = Number.POSITIVE_INFINITY;\n\n\t\t/**\n\t\t * The maximum height value explicitly set by passing a value to the\n\t\t * <code>maxHeight</code> setter.\n\t\t *\n\t\t * <p>If no value has been passed to the <code>maxHeight</code> setter,\n\t\t * this property returns <code>NaN</code>.</p>\n\t\t */\n\t\tpublic function get explicitMaxHeight():Number\n\t\t{\n\t\t\treturn this._explicitMaxHeight;\n\t\t}\n\n\t\t/**\n\t\t * The maximum recommended height to be used for self-measurement and,\n\t\t * optionally, by any code that is resizing this component. This value\n\t\t * is not strictly enforced in all cases. An explicit height value that\n\t\t * is larger than <code>maxHeight</code> may be set and will not be\n\t\t * affected by the maximum.\n\t\t *\n\t\t * <p>In the following example, the maximum width of the control is\n\t\t * set to 120 pixels:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * control.maxWidth = 120;</listing>\n\t\t *\n\t\t * @default Number.POSITIVE_INFINITY\n\t\t */\n\t\tpublic function get maxHeight():Number\n\t\t{\n\t\t\treturn this._explicitMaxHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maxHeight(value:Number):void\n\t\t{\n\t\t\tif(value < 0)\n\t\t\t{\n\t\t\t\tvalue = 0;\n\t\t\t}\n\t\t\tif(this._explicitMaxHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value) //isNaN\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"maxHeight cannot be NaN\");\n\t\t\t}\n\t\t\tvar oldValue:Number = this._explicitMaxHeight;\n\t\t\tthis._explicitMaxHeight = value;\n\t\t\tif(this._explicitHeight !== this._explicitHeight && //isNaN\n\t\t\t\t(this.actualHeight > value || this.actualHeight == oldValue))\n\t\t\t{\n\t\t\t\t//only invalidate if this change might affect the width\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set scaleX(value:Number):void\n\t\t{\n\t\t\tsuper.scaleX = value;\n\t\t\tthis.saveMeasurements(this.actualWidth, this.actualHeight, this.actualMinWidth, this.actualMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set scaleY(value:Number):void\n\t\t{\n\t\t\tsuper.scaleY = value;\n\t\t\tthis.saveMeasurements(this.actualWidth, this.actualHeight, this.actualMinWidth, this.actualMinHeight);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _includeInLayout:Boolean = true;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic function get includeInLayout():Boolean\n\t\t{\n\t\t\treturn this._includeInLayout;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set includeInLayout(value:Boolean):void\n\t\t{\n\t\t\tif(this._includeInLayout == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._includeInLayout = value;\n\t\t\tthis.dispatchEventWith(FeathersEventType.LAYOUT_DATA_CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _layoutData:ILayoutData;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get layoutData():ILayoutData\n\t\t{\n\t\t\treturn this._layoutData;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set layoutData(value:ILayoutData):void\n\t\t{\n\t\t\tif(this._layoutData == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._layoutData)\n\t\t\t{\n\t\t\t\tthis._layoutData.removeEventListener(Event.CHANGE, layoutData_changeHandler);\n\t\t\t}\n\t\t\tthis._layoutData = value;\n\t\t\tif(this._layoutData)\n\t\t\t{\n\t\t\t\tthis._layoutData.addEventListener(Event.CHANGE, layoutData_changeHandler);\n\t\t\t}\n\t\t\tthis.dispatchEventWith(FeathersEventType.LAYOUT_DATA_CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _toolTip:String;\n\n\t\t/**\n\t\t * Text to display in a tool tip to when hovering over this component,\n\t\t * if the <code>ToolTipManager</code> is enabled.\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see ../../../help/tool-tips.html Tool tips in Feathers\n\t\t * @see feathers.core.ToolTipManager\n\t\t */\n\t\tpublic function get toolTip():String\n\t\t{\n\t\t\treturn this._toolTip;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set toolTip(value:String):void\n\t\t{\n\t\t\tthis._toolTip = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _focusManager:IFocusManager;\n\n\t\t/**\n\t\t * <p>The implementation of this property is provided for convenience,\n\t\t * but it cannot be used unless a subclass implements the\n\t\t * <code>IFocusDisplayObject</code> interface.</p>\n\t\t *\n\t\t * @copy feathers.core.IFocusDisplayObject#focusManager\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.IFocusDisplayObject\n\t\t */\n\t\tpublic function get focusManager():IFocusManager\n\t\t{\n\t\t\treturn this._focusManager;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set focusManager(value:IFocusManager):void\n\t\t{\n\t\t\tif(!(this is IFocusDisplayObject))\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Cannot pass a focus manager to a component that does not implement feathers.core.IFocusDisplayObject\");\n\t\t\t}\n\t\t\tif(this._focusManager == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._focusManager = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _focusOwner:IFocusDisplayObject;\n\n\t\t/**\n\t\t * <p>The implementation of this property is provided for convenience,\n\t\t * but it cannot be used unless a subclass implements the\n\t\t * <code>IFocusDisplayObject</code> interface.</p>\n\t\t *\n\t\t * @copy feathers.core.IFocusDisplayObject#focusOwner\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.IFocusDisplayObject\n\t\t */\n\t\tpublic function get focusOwner():IFocusDisplayObject\n\t\t{\n\t\t\treturn this._focusOwner;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set focusOwner(value:IFocusDisplayObject):void\n\t\t{\n\t\t\tthis._focusOwner = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isFocusEnabled:Boolean = true;\n\n\t\t/**\n\t\t * <p>The implementation of this property is provided for convenience,\n\t\t * but it cannot be used unless a subclass implements the\n\t\t * <code>IFocusDisplayObject</code> interface.</p>\n\t\t *\n\t\t * @copy feathers.core.IFocusDisplayObject#isFocusEnabled\n\t\t *\n\t\t * @default true\n\t\t *\n\t\t * @see feathers.core.IFocusDisplayObject\n\t\t */\n\t\tpublic function get isFocusEnabled():Boolean\n\t\t{\n\t\t\treturn this._isEnabled && this._isFocusEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isFocusEnabled(value:Boolean):void\n\t\t{\n\t\t\tif(!(this is IFocusDisplayObject))\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Cannot enable focus on a component that does not implement feathers.core.IFocusDisplayObject\");\n\t\t\t}\n\t\t\tif(this._isFocusEnabled == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isFocusEnabled = value;\n\t\t}\n\n\t\t/**\n\t\t * <p>The implementation of this method is provided for convenience, but\n\t\t * it cannot be used unless a subclass implements the\n\t\t * <code>IFocusDisplayObject</code> interface.</p>\n\t\t *\n\t\t * @copy feathers.core.IFocusDisplayObject#isShowingFocus\n\t\t *\n\t\t * @see feathers.core.IFocusDisplayObject#showFocus()\n\t\t * @see feathers.core.IFocusDisplayObject#hideFocus()\n\t\t * @see feathers.core.IFocusDisplayObject\n\t\t */\n\t\tpublic function get isShowingFocus():Boolean\n\t\t{\n\t\t\treturn this._showFocus;\n\t\t}\n\n\t\t/**\n\t\t * <p>The implementation of this method is provided for convenience, but\n\t\t * it cannot be used unless a subclass implements the\n\t\t * <code>IFocusDisplayObject</code> interface.</p>\n\t\t *\n\t\t * @copy feathers.core.IFocusDisplayObject#maintainTouchFocus\n\t\t *\n\t\t * @see feathers.core.IFocusDisplayObject\n\t\t */\n\t\tpublic function get maintainTouchFocus():Boolean\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _nextTabFocus:IFocusDisplayObject = null;\n\n\t\t/**\n\t\t * <p>The implementation of this property is provided for convenience,\n\t\t * but it cannot be used unless a subclass implements the\n\t\t * <code>IFocusDisplayObject</code> interface.</p>\n\t\t *\n\t\t * @copy feathers.core.IFocusDisplayObject#nextTabFocus\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.IFocusDisplayObject\n\t\t */\n\t\tpublic function get nextTabFocus():IFocusDisplayObject\n\t\t{\n\t\t\treturn this._nextTabFocus;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set nextTabFocus(value:IFocusDisplayObject):void\n\t\t{\n\t\t\tif(!(this is IFocusDisplayObject))\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Cannot set nextTabFocus on a component that does not implement feathers.core.IFocusDisplayObject\");\n\t\t\t}\n\t\t\tthis._nextTabFocus = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _previousTabFocus:IFocusDisplayObject = null;\n\n\t\t/**\n\t\t * <p>The implementation of this property is provided for convenience,\n\t\t * but it cannot be used unless a subclass implements the\n\t\t * <code>IFocusDisplayObject</code> interface.</p>\n\t\t *\n\t\t * @copy feathers.core.IFocusDisplayObject#previousTabFocus\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.IFocusDisplayObject\n\t\t */\n\t\tpublic function get previousTabFocus():IFocusDisplayObject\n\t\t{\n\t\t\treturn this._previousTabFocus;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set previousTabFocus(value:IFocusDisplayObject):void\n\t\t{\n\t\t\tif(!(this is IFocusDisplayObject))\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Cannot set previousTabFocus on a component that does not implement feathers.core.IFocusDisplayObject\");\n\t\t\t}\n\t\t\tthis._previousTabFocus = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _nextUpFocus:IFocusDisplayObject = null;\n\n\t\t/**\n\t\t * <p>The implementation of this property is provided for convenience,\n\t\t * but it cannot be used unless a subclass implements the\n\t\t * <code>IFocusDisplayObject</code> interface.</p>\n\t\t *\n\t\t * @copy feathers.core.IFocusDisplayObject#nextUpFocus\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.IFocusDisplayObject\n\t\t *\n\t\t * @productversion Feathers 3.4.0\n\t\t */\n\t\tpublic function get nextUpFocus():IFocusDisplayObject\n\t\t{\n\t\t\treturn this._nextUpFocus;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set nextUpFocus(value:IFocusDisplayObject):void\n\t\t{\n\t\t\tif(!(this is IFocusDisplayObject))\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Cannot set nextUpFocus on a component that does not implement feathers.core.IFocusDisplayObject\");\n\t\t\t}\n\t\t\tthis._nextUpFocus = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _nextRightFocus:IFocusDisplayObject = null;\n\n\t\t/**\n\t\t * <p>The implementation of this property is provided for convenience,\n\t\t * but it cannot be used unless a subclass implements the\n\t\t * <code>IFocusDisplayObject</code> interface.</p>\n\t\t *\n\t\t * @copy feathers.core.IFocusDisplayObject#nextRightFocus\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.IFocusDisplayObject\n\t\t *\n\t\t * @productversion Feathers 3.4.0\n\t\t */\n\t\tpublic function get nextRightFocus():IFocusDisplayObject\n\t\t{\n\t\t\treturn this._nextRightFocus;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set nextRightFocus(value:IFocusDisplayObject):void\n\t\t{\n\t\t\tif(!(this is IFocusDisplayObject))\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Cannot set nextRightFocus on a component that does not implement feathers.core.IFocusDisplayObject\");\n\t\t\t}\n\t\t\tthis._nextRightFocus = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _nextDownFocus:IFocusDisplayObject = null;\n\n\t\t/**\n\t\t * <p>The implementation of this property is provided for convenience,\n\t\t * but it cannot be used unless a subclass implements the\n\t\t * <code>IFocusDisplayObject</code> interface.</p>\n\t\t *\n\t\t * @copy feathers.core.IFocusDisplayObject#nextDownFocus\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.IFocusDisplayObject\n\t\t *\n\t\t * @productversion Feathers 3.4.0\n\t\t */\n\t\tpublic function get nextDownFocus():IFocusDisplayObject\n\t\t{\n\t\t\treturn this._nextDownFocus;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set nextDownFocus(value:IFocusDisplayObject):void\n\t\t{\n\t\t\tif(!(this is IFocusDisplayObject))\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Cannot set nextDownFocus on a component that does not implement feathers.core.IFocusDisplayObject\");\n\t\t\t}\n\t\t\tthis._nextDownFocus = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _nextLeftFocus:IFocusDisplayObject = null;\n\n\t\t/**\n\t\t * <p>The implementation of this property is provided for convenience,\n\t\t * but it cannot be used unless a subclass implements the\n\t\t * <code>IFocusDisplayObject</code> interface.</p>\n\t\t *\n\t\t * @copy feathers.core.IFocusDisplayObject#nextLeftFocus\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.core.IFocusDisplayObject\n\t\t *\n\t\t * @productversion Feathers 3.4.0\n\t\t */\n\t\tpublic function get nextLeftFocus():IFocusDisplayObject\n\t\t{\n\t\t\treturn this._nextLeftFocus;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set nextLeftFocus(value:IFocusDisplayObject):void\n\t\t{\n\t\t\tif(!(this is IFocusDisplayObject))\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Cannot set nextLeftFocus on a component that does not implement feathers.core.IFocusDisplayObject\");\n\t\t\t}\n\t\t\tthis._nextLeftFocus = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _focusIndicatorSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get focusIndicatorSkin():DisplayObject\n\t\t{\n\t\t\treturn this._focusIndicatorSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set focusIndicatorSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(!(this is IFocusDisplayObject))\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Cannot set focus indicator skin on a component that does not implement feathers.core.IFocusDisplayObject\");\n\t\t\t}\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._focusIndicatorSkin === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._focusIndicatorSkin)\n\t\t\t{\n\t\t\t\tif(this._focusIndicatorSkin.parent == this)\n\t\t\t\t{\n\t\t\t\t\tthis._focusIndicatorSkin.removeFromParent(false);\n\t\t\t\t}\n\t\t\t\tif(this._focusIndicatorSkin is IStateObserver &&\n\t\t\t\t\tthis is IStateContext)\n\t\t\t\t{\n\t\t\t\t\tIStateObserver(this._focusIndicatorSkin).stateContext = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._focusIndicatorSkin = value;\n\t\t\tif(this._focusIndicatorSkin)\n\t\t\t{\n\t\t\t\tthis._focusIndicatorSkin.touchable = false;\n\t\t\t}\n\t\t\tif(this._focusIndicatorSkin is IStateObserver &&\n\t\t\t\tthis is IStateContext)\n\t\t\t{\n\t\t\t\tIStateObserver(this._focusIndicatorSkin).stateContext = IStateContext(this);\n\t\t\t}\n\t\t\tif(this._focusManager && this._focusManager.focus == this)\n\t\t\t{\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get focusPadding():Number\n\t\t{\n\t\t\treturn this._focusPaddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set focusPadding(value:Number):void\n\t\t{\n\t\t\tthis.focusPaddingTop = value;\n\t\t\tthis.focusPaddingRight = value;\n\t\t\tthis.focusPaddingBottom = value;\n\t\t\tthis.focusPaddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _focusPaddingTop:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get focusPaddingTop():Number\n\t\t{\n\t\t\treturn this._focusPaddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set focusPaddingTop(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._focusPaddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._focusPaddingTop = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_FOCUS);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _focusPaddingRight:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get focusPaddingRight():Number\n\t\t{\n\t\t\treturn this._focusPaddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set focusPaddingRight(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._focusPaddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._focusPaddingRight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_FOCUS);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _focusPaddingBottom:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get focusPaddingBottom():Number\n\t\t{\n\t\t\treturn this._focusPaddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set focusPaddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._focusPaddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._focusPaddingBottom = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_FOCUS);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _focusPaddingLeft:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get focusPaddingLeft():Number\n\t\t{\n\t\t\treturn this._focusPaddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set focusPaddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._focusPaddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._focusPaddingLeft = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_FOCUS);\n\t\t}\n\n\t\t/**\n\t\t * Indicates if effects have been suspended.\n\t\t *\n\t\t * @see #suspendEffects()\n\t\t * @see #resumeEffects()\n\t\t */\n\t\tpublic function get effectsSuspended():Boolean\n\t\t{\n\t\t\treturn this._suspendEffectsCount > 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _hasFocus:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _showFocus:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t * Flag to indicate that the control is currently validating.\n\t\t */\n\t\tprotected var _isValidating:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t * Flag to indicate that the control has validated at least once.\n\t\t */\n\t\tprotected var _hasValidated:Boolean = false;\n\n\t\t/**\n\t\t * Determines if the component has been initialized and validated for\n\t\t * the first time.\n\t\t *\n\t\t * <p>In the following example, we check if the component is created or\n\t\t * not, and we listen for an event if it isn't:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * if( !control.isCreated )\n\t\t * {\n\t\t *     control.addEventListener( FeathersEventType.CREATION_COMPLETE, creationCompleteHandler );\n\t\t * }</listing>\n\t\t *\n\t\t * @see #event:creationComplete\n\t\t * @see #isInitialized\n\t\t */\n\t\tpublic function get isCreated():Boolean\n\t\t{\n\t\t\treturn this._hasValidated;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _depth:int = -1;\n\n\t\t/**\n\t\t * @copy feathers.core.IValidating#depth\n\t\t */\n\t\tpublic function get depth():int\n\t\t{\n\t\t\treturn this._depth;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _suspendEffectsCount:int = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _ignoreNextStyleRestriction:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _invalidateCount:int = 0;\n\n\t\t/**\n\t\t * Feathers components use an optimized <code>getBounds()</code>\n\t\t * implementation that may sometimes behave differently than regular\n\t\t * Starling display objects. For instance, filters may need some special\n\t\t * customization. If a component's children appear outside of its\n\t\t * bounds (such as at negative dimensions), padding should be added to\n\t\t * the filter to account for these regions.\n\t\t */\n\t\toverride public function getBounds(targetSpace:DisplayObject, resultRect:Rectangle = null):Rectangle\n\t\t{\n\t\t\tif(!resultRect)\n\t\t\t{\n\t\t\t\tresultRect = new Rectangle();\n\t\t\t}\n\n\t\t\tvar minX:Number = Number.MAX_VALUE;\n\t\t\tvar maxX:Number = -Number.MAX_VALUE;\n\t\t\tvar minY:Number = Number.MAX_VALUE;\n\t\t\tvar maxY:Number = -Number.MAX_VALUE;\n\n\t\t\tif(targetSpace == this) //optimization\n\t\t\t{\n\t\t\t\tminX = 0;\n\t\t\t\tminY = 0;\n\t\t\t\tmaxX = this.actualWidth;\n\t\t\t\tmaxY = this.actualHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar matrix:Matrix = Pool.getMatrix();\n\t\t\t\tthis.getTransformationMatrix(targetSpace, matrix);\n\n\t\t\t\tMatrixUtil.transformCoords(matrix, 0, 0, HELPER_POINT);\n\t\t\t\tminX = minX < HELPER_POINT.x ? minX : HELPER_POINT.x;\n\t\t\t\tmaxX = maxX > HELPER_POINT.x ? maxX : HELPER_POINT.x;\n\t\t\t\tminY = minY < HELPER_POINT.y ? minY : HELPER_POINT.y;\n\t\t\t\tmaxY = maxY > HELPER_POINT.y ? maxY : HELPER_POINT.y;\n\n\t\t\t\tMatrixUtil.transformCoords(matrix, 0, this.actualHeight, HELPER_POINT);\n\t\t\t\tminX = minX < HELPER_POINT.x ? minX : HELPER_POINT.x;\n\t\t\t\tmaxX = maxX > HELPER_POINT.x ? maxX : HELPER_POINT.x;\n\t\t\t\tminY = minY < HELPER_POINT.y ? minY : HELPER_POINT.y;\n\t\t\t\tmaxY = maxY > HELPER_POINT.y ? maxY : HELPER_POINT.y;\n\n\t\t\t\tMatrixUtil.transformCoords(matrix, this.actualWidth, 0, HELPER_POINT);\n\t\t\t\tminX = minX < HELPER_POINT.x ? minX : HELPER_POINT.x;\n\t\t\t\tmaxX = maxX > HELPER_POINT.x ? maxX : HELPER_POINT.x;\n\t\t\t\tminY = minY < HELPER_POINT.y ? minY : HELPER_POINT.y;\n\t\t\t\tmaxY = maxY > HELPER_POINT.y ? maxY : HELPER_POINT.y;\n\n\t\t\t\tMatrixUtil.transformCoords(matrix, this.actualWidth, this.actualHeight, HELPER_POINT);\n\t\t\t\tminX = minX < HELPER_POINT.x ? minX : HELPER_POINT.x;\n\t\t\t\tmaxX = maxX > HELPER_POINT.x ? maxX : HELPER_POINT.x;\n\t\t\t\tminY = minY < HELPER_POINT.y ? minY : HELPER_POINT.y;\n\t\t\t\tmaxY = maxY > HELPER_POINT.y ? maxY : HELPER_POINT.y;\n\n\t\t\t\tPool.putMatrix(matrix);\n\t\t\t}\n\n\t\t\tresultRect.x = minX;\n\t\t\tresultRect.y = minY;\n\t\t\tresultRect.width = maxX - minX;\n\t\t\tresultRect.height = maxY - minY;\n\n\t\t\treturn resultRect;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function hitTest(localPoint:Point):DisplayObject\n\t\t{\n\t\t\tif(this._isQuickHitAreaEnabled)\n\t\t\t{\n\t\t\t\tif(!this.visible || !this.touchable)\n\t\t\t\t{\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tif(this.mask && !this.hitTestMask(localPoint))\n\t\t\t\t{\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn this._hitArea.containsPoint(localPoint) ? this : null;\n\t\t\t}\n\t\t\treturn super.hitTest(localPoint);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isDisposed:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\t//we don't dispose it if this is the parent because it'll\n\t\t\t//already get disposed in super.dispose()\n\t\t\tif(this._focusIndicatorSkin !== null && this._focusIndicatorSkin.parent !== this)\n\t\t\t{\n\t\t\t\tthis._focusIndicatorSkin.dispose();\n\t\t\t}\n\t\t\tthis._isDisposed = true;\n\t\t\tthis._validationQueue = null;\n\t\t\tthis.layoutData = null;\n\t\t\tthis._styleNameList.removeEventListeners();\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * Call this function to tell the UI control that a redraw is pending.\n\t\t * The redraw will happen immediately before Starling renders the UI\n\t\t * control to the screen. The validation system exists to ensure that\n\t\t * multiple properties can be set together without redrawing multiple\n\t\t * times in between each property change.\n\t\t *\n\t\t * <p>If you cannot wait until later for the validation to happen, you\n\t\t * can call <code>validate()</code> to redraw immediately. As an example,\n\t\t * you might want to validate immediately if you need to access the\n\t\t * correct <code>width</code> or <code>height</code> values of the UI\n\t\t * control, since these values are calculated during validation.</p>\n\t\t *\n\t\t * @see feathers.core.FeathersControl#validate()\n\t\t */\n\t\tpublic function invalidate(flag:String = INVALIDATION_FLAG_ALL):void\n\t\t{\n\t\t\tvar isAlreadyInvalid:Boolean = this.isInvalid();\n\t\t\tvar isAlreadyDelayedInvalid:Boolean = false;\n\t\t\tif(this._isValidating)\n\t\t\t{\n\t\t\t\tfor(var otherFlag:String in this._delayedInvalidationFlags)\n\t\t\t\t{\n\t\t\t\t\tisAlreadyDelayedInvalid = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!flag || flag == INVALIDATION_FLAG_ALL)\n\t\t\t{\n\t\t\t\tif(this._isValidating)\n\t\t\t\t{\n\t\t\t\t\tthis._delayedInvalidationFlags[INVALIDATION_FLAG_ALL] = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._isAllInvalid = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(this._isValidating)\n\t\t\t\t{\n\t\t\t\t\tthis._delayedInvalidationFlags[flag] = true;\n\t\t\t\t}\n\t\t\t\telse if(flag != INVALIDATION_FLAG_ALL && !this._invalidationFlags.hasOwnProperty(flag))\n\t\t\t\t{\n\t\t\t\t\tthis._invalidationFlags[flag] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._validationQueue === null || !this._isInitialized)\n\t\t\t{\n\t\t\t\t//we'll add this component to the queue later, after it has been\n\t\t\t\t//added to the stage.\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._isValidating)\n\t\t\t{\n\t\t\t\t//if we've already incremented this counter this time, we can\n\t\t\t\t//return. we're already in queue.\n\t\t\t\tif(isAlreadyDelayedInvalid)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._invalidateCount++;\n\t\t\t\t//if invalidate() is called during validation, we'll be added\n\t\t\t\t//back to the end of the queue. we'll keep trying this a certain\n\t\t\t\t//number of times, but at some point, it needs to be considered\n\t\t\t\t//an infinite loop or a serious bug because it affects\n\t\t\t\t//performance.\n\t\t\t\tif(this._invalidateCount >= 10)\n\t\t\t\t{\n\t\t\t\t\tthrow new Error(getQualifiedClassName(this) + \" returned to validation queue too many times during validation. This may be an infinite loop. Try to avoid doing anything that calls invalidate() during validation.\");\n\t\t\t\t}\n\t\t\t\tthis._validationQueue.addControl(this);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(isAlreadyInvalid)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._invalidateCount = 0;\n\t\t\tthis._validationQueue.addControl(this);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.core.IValidating#validate()\n\t\t *\n\t\t * @see #invalidate()\n\t\t */\n\t\tpublic function validate():void\n\t\t{\n\t\t\tif(this._isDisposed)\n\t\t\t{\n\t\t\t\t//disposed components have no reason to validate, but they may\n\t\t\t\t//have been left in the queue.\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!this._isInitialized)\n\t\t\t{\n\t\t\t\tif(this._isInitializing)\n\t\t\t\t{\n\t\t\t\t\tthrow new IllegalOperationError(\"A component cannot validate until after it has finished initializing.\");\n\t\t\t\t}\n\t\t\t\tthis.initializeNow();\n\t\t\t}\n\t\t\t//if we're not actually invalid, there's nothing to do here, so\n\t\t\t//simply return.\n\t\t\tif(!this.isInvalid())\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._isValidating)\n\t\t\t{\n\t\t\t\t//we were already validating, so there's nothing to do here.\n\t\t\t\t//the existing validation will continue.\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isValidating = true;\n\t\t\tthis.draw();\n\t\t\tfor(var flag:String in this._invalidationFlags)\n\t\t\t{\n\t\t\t\tdelete this._invalidationFlags[flag];\n\t\t\t}\n\t\t\tthis._isAllInvalid = false;\n\t\t\tfor(flag in this._delayedInvalidationFlags)\n\t\t\t{\n\t\t\t\tif(flag == INVALIDATION_FLAG_ALL)\n\t\t\t\t{\n\t\t\t\t\tthis._isAllInvalid = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._invalidationFlags[flag] = true;\n\t\t\t\t}\n\t\t\t\tdelete this._delayedInvalidationFlags[flag];\n\t\t\t}\n\t\t\tthis._isValidating = false;\n\t\t\tif(!this._hasValidated)\n\t\t\t{\n\t\t\t\tthis._hasValidated = true;\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.CREATION_COMPLETE);\n\n\t\t\t\tif(this._suspendEffectsCount == 0 && this.stage !== null && this._addedEffect !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._addedEffectContext = IEffectContext(this._addedEffect(this));\n\t\t\t\t\tthis._addedEffectContext.addEventListener(Event.COMPLETE, addedEffectContext_completeHandler);\n\t\t\t\t\tthis._addedEffectContext.play();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Indicates whether the control is pending validation or not. By\n\t\t * default, returns <code>true</code> if any invalidation flag has been\n\t\t * set. If you pass in a specific flag, returns <code>true</code> only\n\t\t * if that flag has been set (others may be set too, but it checks the\n\t\t * specific flag only. If all flags have been marked as invalid, always\n\t\t * returns <code>true</code>.\n\t\t */\n\t\tpublic function isInvalid(flag:String = null):Boolean\n\t\t{\n\t\t\tif(this._isAllInvalid)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif(!flag) //return true if any flag is set\n\t\t\t{\n\t\t\t\tfor(flag in this._invalidationFlags)\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn this._invalidationFlags[flag];\n\t\t}\n\n\t\t/**\n\t\t * Sets both the width and the height of the control in a single\n\t\t * function call.\n\t\t *\n\t\t * @see #width\n\t\t * @see #height\n\t\t */\n\t\tpublic function setSize(width:Number, height:Number):void\n\t\t{\n\t\t\tvar hasSetExplicitSize:Boolean = false;\n\t\t\tif(this._suspendEffectsCount == 0 && this._resizeEffectContext !== null)\n\t\t\t{\n\t\t\t\tthis._resizeEffectContext.interrupt();\n\t\t\t\tthis._resizeEffectContext = null;\n\t\t\t}\n\t\t\tvar widthIsNaN:Boolean = width !== width; //isNaN\n\t\t\tvar heightIsNaN:Boolean = height !== height; //isNaN\n\t\t\tif((!widthIsNaN || !heightIsNaN) && this.isCreated && this._suspendEffectsCount == 0 && this._resizeEffect !== null)\n\t\t\t{\n\t\t\t\tthis._resizeEffectContext = IEffectContext(this._resizeEffect(this));\n\t\t\t\tthis._resizeEffectContext.addEventListener(Event.COMPLETE, resizeEffectContext_completeHandler);\n\t\t\t\tif(this._resizeEffectContext is IResizeEffectContext)\n\t\t\t\t{\n\t\t\t\t\tvar resizeEffectContext:IResizeEffectContext = IResizeEffectContext(this._resizeEffectContext);\n\t\t\t\t\tresizeEffectContext.oldWidth = this.actualWidth;\n\t\t\t\t\tresizeEffectContext.oldHeight = this.actualHeight;\n\t\t\t\t\tif(widthIsNaN)\n\t\t\t\t\t{\n\t\t\t\t\t\tresizeEffectContext.newWidth = this.actualWidth;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tresizeEffectContext.newWidth = width;\n\t\t\t\t\t}\n\t\t\t\t\tif(heightIsNaN)\n\t\t\t\t\t{\n\t\t\t\t\t\tresizeEffectContext.newHeight = this.actualHeight;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tresizeEffectContext.newHeight = height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._explicitWidth = width;\n\t\t\t\t\tthis._explicitHeight = height;\n\t\t\t\t\thasSetExplicitSize = true;\n\t\t\t\t}\n\t\t\t\tthis._resizeEffectContext.play();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._explicitWidth = width;\n\t\t\t\tthis._explicitHeight = height;\n\t\t\t\thasSetExplicitSize = true;\n\t\t\t}\n\t\t\tif(hasSetExplicitSize)\n\t\t\t{\n\t\t\t\tif(widthIsNaN)\n\t\t\t\t{\n\t\t\t\t\tthis.actualWidth = this.scaledActualWidth = 0;\n\t\t\t\t}\n\t\t\t\tif(heightIsNaN)\n\t\t\t\t{\n\t\t\t\t\tthis.actualHeight = this.scaledActualHeight = 0;\n\t\t\t\t}\n\n\t\t\t\tif(widthIsNaN || heightIsNaN)\n\t\t\t\t{\n\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar result:Boolean = this.saveMeasurements(width, height, this.actualMinWidth, this.actualMinHeight);\n\t\t\t\t\tif(result)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Sets both the x and the y positions of the control in a single\n\t\t * function call.\n\t\t *\n\t\t * @see #x\n\t\t * @see #y\n\t\t */\n\t\tpublic function move(x:Number, y:Number):void\n\t\t{\n\t\t\tif(this._suspendEffectsCount == 0 && this._moveEffectContext !== null)\n\t\t\t{\n\t\t\t\tthis._moveEffectContext.interrupt();\n\t\t\t\tthis._moveEffectContext = null;\n\t\t\t}\n\t\t\tif(this.isCreated && this._suspendEffectsCount == 0 && this._moveEffect !== null)\n\t\t\t{\n\t\t\t\tthis._moveEffectContext = IEffectContext(this._moveEffect(this));\n\t\t\t\tthis._moveEffectContext.addEventListener(Event.COMPLETE, moveEffectContext_completeHandler);\n\t\t\t\tif(this._moveEffectContext is IMoveEffectContext)\n\t\t\t\t{\n\t\t\t\t\tvar moveEffectContext:IMoveEffectContext = IMoveEffectContext(this._moveEffectContext);\n\t\t\t\t\tmoveEffectContext.oldX = this.x;\n\t\t\t\t\tmoveEffectContext.oldY = this.y;\n\t\t\t\t\tmoveEffectContext.newX = x;\n\t\t\t\t\tmoveEffectContext.newY = y;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tsuper.x = x;\n\t\t\t\t\tsuper.y = y;\n\t\t\t\t}\n\t\t\t\tthis._moveEffectContext.play();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tsuper.x = x;\n\t\t\t\tsuper.y = y;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Plays an effect before removing the component from its parent.\n\t\t *\n\t\t * <p>In the following example, an effect fades the component's\n\t\t * <code>alpha</code> property to <code>0</code> before removing the\n\t\t * component from its parent:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * control.removeFromParentWithEffect(Fade.createFadeOutEffect(), true);</listing>\n\t\t *\n\t\t * <p>A number of animated effects may be found in the\n\t\t * <a href=\"../motion/package-detail.html\">feathers.motion</a> package.\n\t\t * However, you are not limited to only these effects. It's possible\n\t\t * to create custom effects too.</p>\n\t\t *\n\t\t * <p>A custom effect function should have the following signature:</p>\n\t\t * <pre>function(target:DisplayObject):IEffectContext</pre>\n\t\t *\n\t\t * <p>The <code>IEffectContext</code> is used by the component to\n\t\t * control the effect, performing actions like playing the effect,\n\t\t * pausing it, or cancelling it.</p>\n\t\t *\n\t\t * <p>Custom animated effects that use\n\t\t * <code>starling.display.Tween</code> typically return a\n\t\t * <code>TweenEffectContext</code>. In the following example, we\n\t\t * recreate the <code>Fade.createFadeOutEffect()</code> used in the\n\t\t * previous example.</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * function customEffect(target:DisplayObject):IEffectContext\n\t\t * {\n\t\t *     var tween:Tween = new Tween(target, 0.5, Transitions.EASE_OUT);\n\t\t *     tween.fadeTo(0);\n\t\t *     return new TweenEffectContext(target, tween);\n\t\t * }\n\t\t * control.removeFromParentWithEffect(customEffect, true);</listing>\n\t\t *\n\t\t * @see #addedEffect\n\t\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t\t * @see feathers.motion.effectClasses.IEffectContext\n\t\t * @see feathers.motion.effectClasses.TweenEffectContext\n\t\t */\n\t\tpublic function removeFromParentWithEffect(effect:Function, dispose:Boolean = false):void\n\t\t{\n\t\t\tif(this.isCreated && this._suspendEffectsCount == 0)\n\t\t\t{\n\t\t\t\tthis._disposeAfterRemovedEffect = dispose;\n\t\t\t\tthis._removedEffectContext = IEffectContext(effect(this));\n\t\t\t\tthis._removedEffectContext.addEventListener(Event.COMPLETE, removedEffectContext_completeHandler);\n\t\t\t\tthis._removedEffectContext.play();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.removeFromParent(dispose);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Resets the <code>styleProvider</code> property to its default value,\n\t\t * which is usually the global style provider for the component.\n\t\t *\n\t\t * @see #styleProvider\n\t\t * @see #defaultStyleProvider\n\t\t */\n\t\tpublic function resetStyleProvider():void\n\t\t{\n\t\t\tthis.styleProvider = this.defaultStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * Indicates that effects should not be activated temporarily. Call\n\t\t * <code>resumeEffects()</code> when effects should be allowed again.\n\t\t *\n\t\t * @see #resumeEffects()\n\t\t */\n\t\tpublic function suspendEffects():void\n\t\t{\n\t\t\tthis._suspendEffectsCount++;\n\t\t}\n\n\t\t/**\n\t\t * Indicates that effects should be re-activated after being suspended.\n\t\t *\n\t\t * @see #suspendEffects()\n\t\t */\n\t\tpublic function resumeEffects():void\n\t\t{\n\t\t\tthis._suspendEffectsCount--;\n\t\t}\n\n\t\t/**\n\t\t * <p>The implementation of this method is provided for convenience, but\n\t\t * it cannot be used unless a subclass implements the\n\t\t * <code>IFocusDisplayObject</code> interface.</p>\n\t\t *\n\t\t * @copy feathers.core.IFocusDisplayObject#showFocus()\n\t\t *\n\t\t * @see feathers.core.IFocusDisplayObject\n\t\t */\n\t\tpublic function showFocus():void\n\t\t{\n\t\t\tif(!this._hasFocus || !this._focusIndicatorSkin)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._showFocus = true;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_FOCUS);\n\t\t}\n\n\t\t/**\n\t\t * <p>The implementation of this method is provided for convenience, but\n\t\t * it cannot be used unless a subclass implements the\n\t\t * <code>IFocusDisplayObject</code> interface.</p>\n\t\t *\n\t\t * @copy feathers.core.IFocusDisplayObject#hideFocus()\n\t\t *\n\t\t * @see feathers.core.IFocusDisplayObject\n\t\t */\n\t\tpublic function hideFocus():void\n\t\t{\n\t\t\tif(!this._hasFocus || !this._focusIndicatorSkin)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._showFocus = false;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_FOCUS);\n\t\t}\n\n\t\t/**\n\t\t * If the component has not yet initialized, initializes immediately.\n\t\t * The <code>initialize()</code> function will be called, and the\n\t\t * <code>FeathersEventType.INITIALIZE</code> event will be dispatched.\n\t\t * Then, if the component has a style provider, it will be applied. The\n\t\t * component will not validate, though. To initialize and validate\n\t\t * immediately, call <code>validate()</code> instead.\n\t\t *\n\t\t * @see #isInitialized\n\t\t * @see #initialize()\n\t\t * @see #event:initialize FeathersEventType.INITIALIZE\n\t\t * @see #styleProvider\n\t\t * @see #validate()\n\t\t */\n\t\tpublic function initializeNow():void\n\t\t{\n\t\t\tif(this._isInitialized || this._isInitializing)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isInitializing = true;\n\t\t\tthis.initialize();\n\t\t\tthis.invalidate(); //invalidate everything\n\t\t\tthis._isInitializing = false;\n\t\t\tthis._isInitialized = true;\n\t\t\tthis.dispatchEventWith(FeathersEventType.INITIALIZE);\n\n\t\t\tif(this._styleProvider !== null)\n\t\t\t{\n\t\t\t\tthis._applyingStyles = true;\n\t\t\t\tthis._styleProvider.applyStyles(this);\n\t\t\t\tthis._applyingStyles = false;\n\t\t\t}\n\t\t\tthis._styleNameList.addEventListener(Event.CHANGE, styleNameList_changeHandler);\n\t\t}\n\n\t\t/**\n\t\t * Sets the width and height of the control, with the option of\n\t\t * invalidating or not. Intended to be used when the <code>width</code>\n\t\t * and <code>height</code> values have not been set explicitly, and the\n\t\t * UI control needs to measure itself and choose an \"ideal\" size.\n\t\t */\n\t\tprotected function setSizeInternal(width:Number, height:Number, canInvalidate:Boolean):Boolean\n\t\t{\n\t\t\tvar changed:Boolean = this.saveMeasurements(width, height, this.actualMinWidth, this.actualMinHeight);\n\t\t\tif(canInvalidate && changed)\n\t\t\t{\n\t\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t\t}\n\t\t\treturn changed;\n\t\t}\n\n\t\t/**\n\t\t * Saves the dimensions and minimum dimensions calculated for the\n\t\t * component. Returns true if the reported values have changed and\n\t\t * <code>Event.RESIZE</code> was dispatched.\n\t\t */\n\t\tprotected function saveMeasurements(width:Number, height:Number, minWidth:Number = 0, minHeight:Number = 0):Boolean\n\t\t{\n\t\t\tif(this._explicitMinWidth === this._explicitMinWidth) //!isNaN\n\t\t\t{\n\t\t\t\t//the min width has been set explicitly. it has precedence over\n\t\t\t\t//the measured min width\n\t\t\t\tminWidth = this._explicitMinWidth;\n\t\t\t}\n\t\t\telse if(minWidth > this._explicitMaxWidth)\n\t\t\t{\n\t\t\t\t//similarly, if the max width has been set explicitly, it can\n\t\t\t\t//affect the measured min width (but not explicit min width)\n\t\t\t\tminWidth = this._explicitMaxWidth;\n\t\t\t}\n\t\t\tif(this._explicitMinHeight === this._explicitMinHeight) //!isNaN\n\t\t\t{\n\t\t\t\t//the min height has been set explicitly. it has precedence over\n\t\t\t\t//the measured min height\n\t\t\t\tminHeight = this._explicitMinHeight;\n\t\t\t}\n\t\t\telse if(minHeight > this._explicitMaxHeight)\n\t\t\t{\n\t\t\t\t//similarly, if the max height has been set explicitly, it can\n\t\t\t\t//affect the measured min height (but not explicit min height)\n\t\t\t\tminHeight = this._explicitMaxHeight;\n\t\t\t}\n\t\t\tif(this._explicitWidth === this._explicitWidth) //!isNaN\n\t\t\t{\n\t\t\t\twidth = this._explicitWidth;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(width < minWidth)\n\t\t\t\t{\n\t\t\t\t\twidth = minWidth;\n\t\t\t\t}\n\t\t\t\telse if(width > this._explicitMaxWidth)\n\t\t\t\t{\n\t\t\t\t\twidth = this._explicitMaxWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._explicitHeight === this._explicitHeight) //!isNaN\n\t\t\t{\n\t\t\t\theight = this._explicitHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(height < minHeight)\n\t\t\t\t{\n\t\t\t\t\theight = minHeight;\n\t\t\t\t}\n\t\t\t\telse if(height > this._explicitMaxHeight)\n\t\t\t\t{\n\t\t\t\t\theight = this._explicitMaxHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(width !== width) //isNaN\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(ILLEGAL_WIDTH_ERROR);\n\t\t\t}\n\t\t\tif(height !== height) //isNaN\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(ILLEGAL_HEIGHT_ERROR);\n\t\t\t}\n\t\t\tvar scaleX:Number = this.scaleX;\n\t\t\tif(scaleX < 0)\n\t\t\t{\n\t\t\t\tscaleX = -scaleX;\n\t\t\t}\n\t\t\tvar scaleY:Number = this.scaleY;\n\t\t\tif(scaleY < 0)\n\t\t\t{\n\t\t\t\tscaleY = -scaleY;\n\t\t\t}\n\t\t\tvar resized:Boolean = false;\n\t\t\tif(this.actualWidth != width)\n\t\t\t{\n\t\t\t\tthis.actualWidth = width;\n\t\t\t\tthis.refreshHitAreaX();\n\t\t\t\tresized = true;\n\t\t\t}\n\t\t\tif(this.actualHeight != height)\n\t\t\t{\n\t\t\t\tthis.actualHeight = height;\n\t\t\t\tthis.refreshHitAreaY();\n\t\t\t\tresized = true;\n\t\t\t}\n\t\t\tif(this.actualMinWidth != minWidth)\n\t\t\t{\n\t\t\t\tthis.actualMinWidth = minWidth;\n\t\t\t\tresized = true;\n\t\t\t}\n\t\t\tif(this.actualMinHeight != minHeight)\n\t\t\t{\n\t\t\t\tthis.actualMinHeight = minHeight;\n\t\t\t\tresized = true;\n\t\t\t}\n\t\t\twidth = this.scaledActualWidth;\n\t\t\theight = this.scaledActualHeight;\n\t\t\tthis.scaledActualWidth = this.actualWidth * scaleX;\n\t\t\tthis.scaledActualHeight = this.actualHeight * scaleY;\n\t\t\tthis.scaledActualMinWidth = this.actualMinWidth * scaleX;\n\t\t\tthis.scaledActualMinHeight = this.actualMinHeight * scaleY;\n\t\t\tif(width != this.scaledActualWidth || height != this.scaledActualHeight)\n\t\t\t{\n\t\t\t\tresized = true;\n\t\t\t\tthis.dispatchEventWith(Event.RESIZE);\n\t\t\t}\n\t\t\treturn resized;\n\t\t}\n\n\t\t/**\n\t\t * Called the first time that the UI control is added to the stage, and\n\t\t * you should override this function to customize the initialization\n\t\t * process. Do things like create children and set up event listeners.\n\t\t * After this function is called, <code>FeathersEventType.INITIALIZE</code>\n\t\t * is dispatched.\n\t\t *\n\t\t * @see #event:initialize feathers.events.FeathersEventType.INITIALIZE\n\t\t */\n\t\tprotected function initialize():void\n\t\t{\n\n\t\t}\n\n\t\t/**\n\t\t * Override to customize layout and to adjust properties of children.\n\t\t * Called when the component validates, if any flags have been marked\n\t\t * to indicate that validation is pending.\n\t\t */\n\t\tprotected function draw():void\n\t\t{\n\n\t\t}\n\n\t\t/**\n\t\t * Sets an invalidation flag. This will not add the component to the\n\t\t * validation queue. It only sets the flag. A subclass might use\n\t\t * this function during <code>draw()</code> to manipulate the flags that\n\t\t * its superclass sees.\n\t\t */\n\t\tprotected function setInvalidationFlag(flag:String):void\n\t\t{\n\t\t\tif(this._invalidationFlags.hasOwnProperty(flag))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._invalidationFlags[flag] = true;\n\t\t}\n\n\t\t/**\n\t\t * Clears an invalidation flag. This will not remove the component from\n\t\t * the validation queue. It only clears the flag. A subclass might use\n\t\t * this function during <code>draw()</code> to manipulate the flags that\n\t\t * its superclass sees.\n\t\t */\n\t\tprotected function clearInvalidationFlag(flag:String):void\n\t\t{\n\t\t\tdelete this._invalidationFlags[flag];\n\t\t}\n\n\t\t/**\n\t\t * Used by setters for properties that are considered \"styles\" to\n\t\t * determine if the setter has been called directly on the component or\n\t\t * from a <em>style provider</em>. A style provider is typically\n\t\t * associated with a theme. When a style is set directly on the\n\t\t * component (outside of a style provider), then any attempts by the\n\t\t * style provider to set the style later will be ignored. This allows\n\t\t * developers to customize a component's styles directly without\n\t\t * worrying about conflicts from the style provider or theme.\n\t\t *\n\t\t * <p>If a style provider is currently applying styles to the component,\n\t\t * returns <code>true</code> if the style is restricted or false if it\n\t\t * may be set.</p>\n\t\t *\n\t\t * <p>If the style setter is called outside of a style provider, marks\n\t\t * the style as restricted and returns <code>false</code>.</p>\n\t\t *\n\t\t * <p>The <code>key</code> parameter should be a unique value for each\n\t\t * separate style. In most cases, <code>processStyleRestriction()</code>\n\t\t * will be called in the style property setter, so\n\t\t * <code>arguments.callee</code> is recommended. Alternatively, a unique\n\t\t * string value may be used instead.</p>\n\t\t *\n\t\t * <p>The following example shows how to use\n\t\t * <code>processStyleRestriction()</code> in a style property\n\t\t * setter:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * private var _customStyle:Object;\n\t\t * \n\t\t * public function get customStyle():Object\n\t\t * {\n\t\t *     return this._customStyle;\n\t\t * }\n\t\t * \n\t\t * public function set customStyle( value:Object ):void\n\t\t * {\n\t\t *     if( this.processStyleRestriction( arguments.callee ) )\n\t\t *     {\n\t\t *         // if a style is restricted, don't set it\n\t\t *         return;\n\t\t *     }\n\t\t * \n\t\t *     this._customStyle = value;\n\t\t * }</listing>\n\t\t *\n\t\t * @see #ignoreNextStyleRestriction()\n\t\t */\n\t\tprotected function processStyleRestriction(key:Object):Boolean\n\t\t{\n\t\t\tvar ignore:Boolean = this._ignoreNextStyleRestriction;\n\t\t\tthis._ignoreNextStyleRestriction = false;\n\t\t\t//in most cases, the style is not restricted, and we can set it\n\t\t\tif(this._applyingStyles)\n\t\t\t{\n\t\t\t\treturn this._restrictedStyles !== null &&\n\t\t\t\t\tkey in this._restrictedStyles;\n\t\t\t}\n\t\t\tif(ignore)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(this._restrictedStyles === null)\n\t\t\t{\n\t\t\t\t//only create the object if it is needed\n\t\t\t\tthis._restrictedStyles = new Dictionary();\n\t\t\t}\n\t\t\tthis._restrictedStyles[key] = true;\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * The next style that is set will not be restricted. This allows\n\t\t * components to set defaults by calling the setter while still allowing\n\t\t * the style property to be replaced by a theme in the future.\n\t\t *\n\t\t * @see #processStyleRestriction()\n\t\t */\n\t\tprotected function ignoreNextStyleRestriction():void\n\t\t{\n\t\t\tthis._ignoreNextStyleRestriction = true;\n\t\t}\n\n\t\t/**\n\t\t * Updates the focus indicator skin by showing or hiding it and\n\t\t * adjusting its position and dimensions. This function is not called\n\t\t * automatically. Components that support focus should call this\n\t\t * function at an appropriate point within the <code>draw()</code>\n\t\t * function. This function may be overridden if the default behavior is\n\t\t * not desired.\n\t\t */\n\t\tprotected function refreshFocusIndicator():void\n\t\t{\n\t\t\tif(this._focusIndicatorSkin)\n\t\t\t{\n\t\t\t\tif(this._hasFocus && this._showFocus)\n\t\t\t\t{\n\t\t\t\t\tif(this._focusIndicatorSkin.parent != this)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.addChild(this._focusIndicatorSkin);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.setChildIndex(this._focusIndicatorSkin, this.numChildren - 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(this._focusIndicatorSkin.parent)\n\t\t\t\t{\n\t\t\t\t\tthis._focusIndicatorSkin.removeFromParent(false);\n\t\t\t\t}\n\t\t\t\tthis._focusIndicatorSkin.x = this._focusPaddingLeft;\n\t\t\t\tthis._focusIndicatorSkin.y = this._focusPaddingTop;\n\t\t\t\tthis._focusIndicatorSkin.width = this.actualWidth - this._focusPaddingLeft - this._focusPaddingRight;\n\t\t\t\tthis._focusIndicatorSkin.height = this.actualHeight - this._focusPaddingTop - this._focusPaddingBottom;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshHitAreaX():void\n\t\t{\n\t\t\tif(this.actualWidth < this._minTouchWidth)\n\t\t\t{\n\t\t\t\tthis._hitArea.width = this._minTouchWidth;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._hitArea.width = this.actualWidth;\n\t\t\t}\n\t\t\tvar hitAreaX:Number = (this.actualWidth - this._hitArea.width) / 2;\n\t\t\tif(hitAreaX !== hitAreaX) //isNaN\n\t\t\t{\n\t\t\t\tthis._hitArea.x = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._hitArea.x = hitAreaX;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshHitAreaY():void\n\t\t{\n\t\t\tif(this.actualHeight < this._minTouchHeight)\n\t\t\t{\n\t\t\t\tthis._hitArea.height = this._minTouchHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._hitArea.height = this.actualHeight;\n\t\t\t}\n\t\t\tvar hitAreaY:Number = (this.actualHeight - this._hitArea.height) / 2;\n\t\t\tif(hitAreaY !== hitAreaY) //isNaN\n\t\t\t{\n\t\t\t\tthis._hitArea.y = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._hitArea.y = hitAreaY;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Default event handler for <code>FeathersEventType.FOCUS_IN</code>\n\t\t * that may be overridden in subclasses to perform additional actions\n\t\t * when the component receives focus.\n\t\t */\n\t\tprotected function focusInHandler(event:Event):void\n\t\t{\n\t\t\tthis._hasFocus = true;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_FOCUS);\n\n\t\t\tif(this._focusOutEffectContext !== null)\n\t\t\t{\n\t\t\t\tthis._focusOutEffectContext.interrupt();\n\t\t\t\tthis._focusOutEffectContext = null;\n\t\t\t}\n\n\t\t\tif(this._suspendEffectsCount == 0 && this._focusInEffect !== null)\n\t\t\t{\n\t\t\t\tthis._focusInEffectContext = IEffectContext(this._focusInEffect(this));\n\t\t\t\tthis._focusInEffectContext.addEventListener(Event.COMPLETE, focusInEffectContext_completeHandler);\n\t\t\t\tthis._focusInEffectContext.play();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Default event handler for <code>FeathersEventType.FOCUS_OUT</code>\n\t\t * that may be overridden in subclasses to perform additional actions\n\t\t * when the component loses focus.\n\t\t */\n\t\tprotected function focusOutHandler(event:Event):void\n\t\t{\n\t\t\tthis._hasFocus = false;\n\t\t\tthis._showFocus = false;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_FOCUS);\n\n\t\t\tif(this._focusInEffectContext !== null)\n\t\t\t{\n\t\t\t\tthis._focusInEffectContext.interrupt();\n\t\t\t\tthis._focusInEffectContext = null;\n\t\t\t}\n\n\t\t\tif(this._suspendEffectsCount == 0 && this._focusOutEffect !== null)\n\t\t\t{\n\t\t\t\tthis._focusOutEffectContext = IEffectContext(this._focusOutEffect(this));\n\t\t\t\tthis._focusOutEffectContext.addEventListener(Event.COMPLETE, focusOutEffectContext_completeHandler);\n\t\t\t\tthis._focusOutEffectContext.play();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * Initialize the control, if it hasn't been initialized yet. Then,\n\t\t * invalidate. If already initialized, check if invalid and put back\n\t\t * into queue.\n\t\t */\n\t\tprotected function feathersControl_addedToStageHandler(event:Event):void\n\t\t{\n\t\t\tif(this.stage === null)\n\t\t\t{\n\t\t\t\t//this could happen if removed from parent in another\n\t\t\t\t//Event.ADDED_TO_STAGE listener\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//initialize before setting the validation queue to avoid\n\t\t\t//getting added to the validation queue before initialization\n\t\t\t//completes.\n\t\t\tif(!this._isInitialized)\n\t\t\t{\n\t\t\t\tthis.initializeNow();\n\t\t\t}\n\t\t\tthis._depth = getDisplayObjectDepthFromStage(this);\n\t\t\tthis._validationQueue = ValidationQueue.forStarling(this.stage.starling);\n\t\t\tif(this.isInvalid())\n\t\t\t{\n\t\t\t\tthis._invalidateCount = 0;\n\t\t\t\t//add to validation queue, if required\n\t\t\t\tthis._validationQueue.addControl(this);\n\t\t\t}\n\n\t\t\t//if the removed effect is still active, stop it\n\t\t\tif(this._removedEffectContext !== null)\n\t\t\t{\n\t\t\t\tthis._removedEffectContext.interrupt();\n\t\t\t}\n\n\t\t\tif(this.isCreated && this._suspendEffectsCount == 0 && this._addedEffect !== null)\n\t\t\t{\n\t\t\t\tthis._addedEffectContext = IEffectContext(this._addedEffect(this));\n\t\t\t\tthis._addedEffectContext.addEventListener(Event.COMPLETE, addedEffectContext_completeHandler);\n\t\t\t\tthis._addedEffectContext.play();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function feathersControl_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tif(this._addedEffectContext !== null)\n\t\t\t{\n\t\t\t\tthis._addedEffectContext.interrupt();\n\t\t\t}\n\t\t\tthis._depth = -1;\n\t\t\tthis._validationQueue = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function addedEffectContext_completeHandler(event:Event):void\n\t\t{\n\t\t\tthis._addedEffectContext = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function removedEffectContext_completeHandler(event:Event, stopped:Boolean):void\n\t\t{\n\t\t\tthis._removedEffectContext = null;\n\t\t\tif(!stopped)\n\t\t\t{\n\t\t\t\tthis.removeFromParent(this._disposeAfterRemovedEffect);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function showEffectContext_completeHandler(event:Event):void\n\t\t{\n\t\t\tthis._showEffectContext.removeEventListener(Event.COMPLETE, showEffectContext_completeHandler);\n\t\t\tthis._showEffectContext = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function hideEffectContext_completeHandler(event:Event, stopped:Boolean):void\n\t\t{\n\t\t\tthis._hideEffectContext.removeEventListener(Event.COMPLETE, hideEffectContext_completeHandler);\n\t\t\tthis._hideEffectContext = null;\n\t\t\tif(!stopped)\n\t\t\t{\n\t\t\t\tthis.suspendEffects();\n\t\t\t\tsuper.visible = this._pendingVisible;\n\t\t\t\tthis.resumeEffects();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate function focusInEffectContext_completeHandler(event:Event):void\n\t\t{\n\t\t\tthis._focusInEffectContext.removeEventListener(Event.COMPLETE, focusInEffectContext_completeHandler);\n\t\t\tthis._focusInEffectContext = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate function focusOutEffectContext_completeHandler(event:Event):void\n\t\t{\n\t\t\tthis._focusOutEffectContext.removeEventListener(Event.COMPLETE, focusOutEffectContext_completeHandler);\n\t\t\tthis._focusOutEffectContext = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function moveEffectContext_completeHandler(event:Event):void\n\t\t{\n\t\t\tthis._moveEffectContext.removeEventListener(Event.COMPLETE, moveEffectContext_completeHandler);\n\t\t\tthis._moveEffectContext = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function resizeEffectContext_completeHandler(event:Event):void\n\t\t{\n\t\t\tthis._resizeEffectContext.removeEventListener(Event.COMPLETE, resizeEffectContext_completeHandler);\n\t\t\tthis._resizeEffectContext = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutData_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(FeathersEventType.LAYOUT_DATA_CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function styleNameList_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._styleProvider === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._applyingStyles)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Cannot change styleNameList while the style provider is applying styles.\");\n\t\t\t}\n\t\t\tthis._applyingStyles = true;\n\t\t\tthis._styleProvider.applyStyles(this);\n\t\t\tthis._applyingStyles = false;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function styleProvider_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(!this._isInitialized)\n\t\t\t{\n\t\t\t\t//safe to ignore changes until initialization\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._applyingStyles)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Cannot change style provider while it is applying styles.\");\n\t\t\t}\n\t\t\tthis._applyingStyles = true;\n\t\t\tthis._styleProvider.applyStyles(this);\n\t\t\tthis._applyingStyles = false;\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/core/FocusManager.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\timport flash.utils.Dictionary;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObjectContainer;\n\timport starling.display.Stage;\n\n\t/**\n\t * Manages touch and keyboard focus.\n\t *\n\t * @see ../../../help/focus.html Keyboard focus management in Feathers\n\t *\n\t * @productversion Feathers 1.1.0\n\t */\n\tpublic class FocusManager\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const FOCUS_MANAGER_NOT_ENABLED_ERROR:String = \"The specified action is not permitted when the focus manager is not enabled.\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const FOCUS_MANAGER_ROOT_MUST_BE_ON_STAGE_ERROR:String = \"A focus manager may not be added or removed for a display object that is not on stage.\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const STAGE_TO_STACK:Dictionary = new Dictionary(true);\n\n\t\t/**\n\t\t * Returns the active focus manager for the specified Starling stage.\n\t\t * May return <code>null</code> if focus management has not been enabled\n\t\t * for the specified stage.\n\t\t *\n\t\t * @see #isEnabledForStage()\n\t\t * @see #setEnabledForStage()\n\t\t */\n\t\tpublic static function getFocusManagerForStage(stage:Stage):IFocusManager\n\t\t{\n\t\t\tvar stack:Vector.<IFocusManager> = STAGE_TO_STACK[stage] as Vector.<IFocusManager>;\n\t\t\tif(stack === null || stack.length == 0)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn stack[stack.length - 1];\n\t\t}\n\n\t\t/**\n\t\t * The default factory that creates a focus manager.\n\t\t *\n\t\t * @see #focusManagerFactory\n\t\t * @see feathers.core.DefaultFocusManager\n\t\t */\n\t\tpublic static function defaultFocusManagerFactory(root:DisplayObjectContainer):IFocusManager\n\t\t{\n\t\t\treturn new DefaultFocusManager(root);\n\t\t}\n\n\t\t/**\n\t\t * A function that creates a focus manager.\n\t\t *\n\t\t * <p>This function is expected to have the following signature:</p>\n\t\t * <pre>function():IFocusManager</pre>\n\t\t *\n\t\t * <p>In the following example, the focus manager factory is modified:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * FocusManager.focusManagerFactory = function(root:DisplayObjectContainer):IPopUpManager\n\t\t * {\n\t\t *     return new CustomFocusManager(); //a custom class that implements IFocusManager\n\t\t * };</listing>\n\t\t *\n\t\t * @see feathers.core.IFocusManager\n\t\t */\n\t\tpublic static var focusManagerFactory:Function = defaultFocusManagerFactory;\n\n\t\t/**\n\t\t * Determines if the focus manager is enabled or disabled for the\n\t\t * specified Starling stage.\n\t\t *\n\t\t * @see #setEnabledForStage()\n\t\t * @see #getFocusManagerForStage()\n\t\t */\n\t\tpublic static function isEnabledForStage(stage:Stage):Boolean\n\t\t{\n\t\t\tvar stack:Vector.<IFocusManager> = STAGE_TO_STACK[stage];\n\t\t\treturn stack != null;\n\t\t}\n\n\t\t/**\n\t\t * Enables or disables focus management on the specified Starling stage.\n\t\t * For mobile apps, the focus manager should generally remain disabled.\n\t\t * For desktop apps, it is recommended to enable the focus manager to\n\t\t * support keyboard navigation.\n\t\t *\n\t\t * <p>In the following example, focus management is enabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * FocusManager.setEnabledForStage(stage, true);</listing>\n\t\t *\n\t\t * @see #isEnabledForStage()\n\t\t * @see #getFocusManagerForStage()\n\t\t */\n\t\tpublic static function setEnabledForStage(stage:Stage, isEnabled:Boolean):void\n\t\t{\n\t\t\tvar stack:Vector.<IFocusManager> = STAGE_TO_STACK[stage];\n\t\t\tif((isEnabled && stack) || (!isEnabled && !stack))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(isEnabled)\n\t\t\t{\n\t\t\t\tSTAGE_TO_STACK[stage] = new <IFocusManager>[];\n\t\t\t\tpushFocusManager(stage);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\twhile(stack.length > 0)\n\t\t\t\t{\n\t\t\t\t\tvar manager:IFocusManager = stack.pop();\n\t\t\t\t\tmanager.isEnabled = false;\n\t\t\t\t}\n\t\t\t\tdelete STAGE_TO_STACK[stage];\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Disables focus management on all stages where it has previously been\n\t\t * enabled.\n\t\t */\n\t\tpublic function disableAll():void\n\t\t{\n\t\t\tfor(var key:Object in STAGE_TO_STACK)\n\t\t\t{\n\t\t\t\tvar stage:Stage = Stage(key);\n\t\t\t\tvar stack:Vector.<IFocusManager> = STAGE_TO_STACK[stage];\n\t\t\t\twhile(stack.length > 0)\n\t\t\t\t{\n\t\t\t\t\tvar manager:IFocusManager = stack.pop();\n\t\t\t\t\tmanager.isEnabled = false;\n\t\t\t\t}\n\t\t\t\tdelete STAGE_TO_STACK[stage];\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * The object that currently has focus on <code>Starling.current.stage</code>.\n\t\t * May return <code>null</code> if no object has focus.\n\t\t *\n\t\t * <p>You can call <code>geFocusManagerForStage()</code> to access the\n\t\t * active <code>IFocusManager</code> instance for any <code>Stage</code>\n\t\t * instance that isn't equal to <code>Starling.current.stage</code>.</p>\n\t\t *\n\t\t * <p>In the following example, the focus is changed on the current stage:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * FocusManager.focus = someObject;</listing>\n\t\t *\n\t\t * @see #getFocusManagerForStage()\n\t\t */\n\t\tpublic static function get focus():IFocusDisplayObject\n\t\t{\n\t\t\tvar manager:IFocusManager = getFocusManagerForStage(Starling.current.stage);\n\t\t\tif(manager)\n\t\t\t{\n\t\t\t\treturn manager.focus;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic static function set focus(value:IFocusDisplayObject):void\n\t\t{\n\t\t\tvar manager:IFocusManager = getFocusManagerForStage(Starling.current.stage);\n\t\t\tif(!manager)\n\t\t\t{\n\t\t\t\tthrow new Error(FOCUS_MANAGER_NOT_ENABLED_ERROR);\n\t\t\t}\n\t\t\tmanager.focus = value;\n\t\t}\n\n\t\t/**\n\t\t * Adds a focus manager to the stack for the <code>root</code>\n\t\t * argument's stage, and gives it exclusive focus. If focus management\n\t\t * has not been enabled for the root's stage, then calling this function\n\t\t * will throw a runtime error.\n\t\t */\n\t\tpublic static function pushFocusManager(root:DisplayObjectContainer):IFocusManager\n\t\t{\n\t\t\tvar stage:Stage = root.stage;\n\t\t\tif(!stage)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(FOCUS_MANAGER_ROOT_MUST_BE_ON_STAGE_ERROR);\n\t\t\t}\n\t\t\tvar stack:Vector.<IFocusManager> = STAGE_TO_STACK[stage] as Vector.<IFocusManager>;\n\t\t\tif(!stack)\n\t\t\t{\n\t\t\t\tthrow new Error(FOCUS_MANAGER_NOT_ENABLED_ERROR);\n\t\t\t}\n\t\t\tvar manager:IFocusManager = FocusManager.focusManagerFactory(root);\n\t\t\tmanager.isEnabled = true;\n\t\t\tif(stack.length > 0)\n\t\t\t{\n\t\t\t\tvar oldManager:IFocusManager = stack[stack.length - 1];\n\t\t\t\toldManager.isEnabled = false;\n\t\t\t}\n\t\t\tstack.push(manager);\n\t\t\treturn manager;\n\t\t}\n\n\t\t/**\n\t\t * Removes the specified focus manager from the stack. If it was\n\t\t * the top-most focus manager, the next top-most focus manager is\n\t\t * enabled.\n\t\t */\n\t\tpublic static function removeFocusManager(manager:IFocusManager):void\n\t\t{\n\t\t\tvar stage:Stage = manager.root.stage;\n\t\t\tvar stack:Vector.<IFocusManager> = STAGE_TO_STACK[stage] as Vector.<IFocusManager>;\n\t\t\tif(!stack)\n\t\t\t{\n\t\t\t\tthrow new Error(FOCUS_MANAGER_NOT_ENABLED_ERROR);\n\t\t\t}\n\t\t\tvar index:int = stack.indexOf(manager);\n\t\t\tif(index < 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmanager.isEnabled = false;\n\t\t\tstack.removeAt(index);\n\t\t\t//if this is the top-level focus manager, enable the previous one\n\t\t\tif(index > 0 && index == stack.length)\n\t\t\t{\n\t\t\t\tmanager = stack[stack.length - 1];\n\t\t\t\tmanager.isEnabled = true;\n\t\t\t}\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/IAdvancedNativeFocusOwner.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\t/**\n\t * If a display object implements <code>INativeFocusOwner</code> and its\n\t * <code>nativeFocus</code> property does not return a\n\t * <code>flash.display.InteractiveObject</code> (or <code>null</code>), it\n\t * must implement this interface so that the focus manager can tell it when\n\t * to give focus to its native focus object.\n\t *\n\t * @see ../../../help/focus.html\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic interface IAdvancedNativeFocusOwner extends INativeFocusOwner\n\t{\n\t\t/**\n\t\t * Determines if <code>nativeFocus</code> currently has focus.\n\t\t */\n\t\tfunction get hasFocus():Boolean;\n\n\t\t/**\n\t\t * Called by the focus manager to set focus on <code>nativeFocus</code>.\n\t\t * May also be called manually.\n\t\t */\n\t\tfunction setFocus():void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/IFeathersControl.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\timport feathers.skins.IStyleProvider;\n\n\t/**\n\t * Dispatched after the control has been initialized, but before it has\n\t * drawn for the first time. Typically, the component's children will have\n\t * been created by this point.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.INITIALIZE\n\t */\n\t[Event(name=\"initialize\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched after the component has validated for the first time. Both\n\t * <code>initialize()</code> and <code>draw()</code> will have been called,\n\t * and all children will have been created.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.CREATION_COMPLETE\n\t */\n\t[Event(name=\"creationComplete\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the width or height of the control changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.RESIZE\n\t */\n\t[Event(name=\"resize\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Basic interface for Feathers UI controls. A Feathers control must also\n\t * be a Starling display object.\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic interface IFeathersControl extends IValidating, IMeasureDisplayObject\n\t{\n\t\t/**\n\t\t * @copy feathers.core.FeathersControl#isEnabled\n\t\t */\n\t\tfunction get isEnabled():Boolean;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set isEnabled(value:Boolean):void;\n\n\t\t/**\n\t\t * @copy feathers.core.FeathersControl#isInitialized\n\t\t */\n\t\tfunction get isInitialized():Boolean;\n\n\t\t/**\n\t\t * @copy feathers.core.FeathersControl#isCreated\n\t\t */\n\t\tfunction get isCreated():Boolean;\n\n\t\t/**\n\t\t * @copy feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tfunction get styleNameList():TokenList;\n\n\t\t/**\n\t\t * @copy feathers.core.FeathersControl#styleName\n\t\t */\n\t\tfunction get styleName():String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set styleName(value:String):void;\n\n\t\t/**\n\t\t * @copy feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tfunction get styleProvider():IStyleProvider;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set styleProvider(value:IStyleProvider):void;\n\n\t\t/**\n\t\t * @copy feathers.core.FeathersControl#toolTip\n\t\t */\n\t\tfunction get toolTip():String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set toolTip(value:String):void;\n\n\t\t/**\n\t\t * @copy feathers.core.FeathersControl#effectsSuspended\n\t\t */\n\t\tfunction get effectsSuspended():Boolean;\n\n\t\t/**\n\t\t * @copy feathers.core.FeathersControl#setSize()\n\t\t */\n\t\tfunction setSize(width:Number, height:Number):void;\n\n\t\t/**\n\t\t * @copy feathers.core.FeathersControl#move()\n\t\t */\n\t\tfunction move(x:Number, y:Number):void;\n\n\t\t/**\n\t\t * @copy feathers.core.FeathersControl#resetStyleProvider()\n\t\t */\n\t\tfunction resetStyleProvider():void;\n\n\t\t/**\n\t\t * @copy feathers.core.FeathersControl#initializeNow()\n\t\t */\n\t\tfunction initializeNow():void;\n\n\t\t/**\n\t\t * @copy feathers.core.FeathersControl#suspendEffects()\n\t\t */\n\t\tfunction suspendEffects():void;\n\n\t\t/**\n\t\t * @copy feathers.core.FeathersControl#resumeEffects()\n\t\t */\n\t\tfunction resumeEffects():void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/IFeathersDisplayObject.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\timport flash.geom.Matrix;\n\timport flash.geom.Point;\n\timport flash.geom.Rectangle;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.DisplayObjectContainer;\n\timport starling.display.Stage;\n\timport starling.filters.FragmentFilter;\n\timport starling.rendering.Painter;\n\n\t/**\n\t * Public properties and functions from <code>starling.display.DisplayObject</code>\n\t * in helpful interface form.\n\t *\n\t * <p>Never cast an object to this type. Cast to <code>DisplayObject</code>\n\t * instead. This interface exists only to support easier code hinting for\n\t * interfaces.</p>\n\t *\n\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html Full description of starling.display.DisplayObject in Gamua's Starling Framework API Reference\n\t *\n\t * @productversion Feathers 1.1.0\n\t */\n\tpublic interface IFeathersDisplayObject extends IFeathersEventDispatcher\n\t{\n\t\t/**\n\t\t * The x, or horizontal, position of the display object in the parent's\n\t\t * coordinate space.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#x Full description of starling.display.DisplayObject.x in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction get x():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set x(value:Number):void;\n\n\t\t/**\n\t\t * The y, or vertical, position of the display object in the parent's\n\t\t * coordinate space.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#y Full description of starling.display.DisplayObject.y in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction get y():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set y(value:Number):void;\n\n\t\t/**\n\t\t * The width of the display object in the parent's coordinate space.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#width Full description of starling.display.DisplayObject.width in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction get width():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set width(value:Number):void;\n\n\t\t/**\n\t\t * The height of the display object in the parent's coordinate space.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#height Full description of starling.display.DisplayObject.height in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction get height():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set height(value:Number):void;\n\n\t\t/**\n\t\t * The x coordinate of the display object's origin in its own coordinate\n\t\t * space.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#pivotX Full description of starling.display.DisplayObject.pivotX in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction get pivotX():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set pivotX(value:Number):void;\n\n\t\t/**\n\t\t * The y coordinate of the display object's origin in its own coordinate\n\t\t * space.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#pivotY Full description of starling.display.DisplayObject.pivotY in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction get pivotY():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set pivotY(value:Number):void;\n\n\t\t/**\n\t\t * This horizontal scale factor.\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#scaleX Full description of starling.display.DisplayObject.scaleX in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction get scaleX():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set scaleX(value:Number):void;\n\n\t\t/**\n\t\t * The vertical scale factor.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#scaleY Full description of starling.display.DisplayObject.scaleY in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction get scaleY():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set scaleY(value:Number):void;\n\n\t\t/**\n\t\t * The horizontal skew, in radians.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#skewX Full description of starling.display.DisplayObject.skewX in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction get skewX():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set skewX(value:Number):void;\n\n\t\t/**\n\t\t * The vertical skew, in radians.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#skewY Full description of starling.display.DisplayObject.skewY in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction get skewY():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set skewY(value:Number):void;\n\n\t\t/**\n\t\t * The blend mode used when rendering the display object.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#blendMode Full description of starling.display.DisplayObject.blendMode in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction get blendMode():String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set blendMode(value:String):void;\n\n\t\t/**\n\t\t * The name of the display object.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#name Full description of starling.display.DisplayObject.name in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction get name():String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set name(value:String):void;\n\n\t\t/**\n\t\t * Determines if the display object may be touched.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#touchable Full description of starling.display.DisplayObject.touchable in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction get touchable():Boolean;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set touchable(value:Boolean):void;\n\n\t\t/**\n\t\t * Determines the visibility of the display object.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#visible Full description of starling.display.DisplayObject.visible in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction get visible():Boolean;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set visible(value:Boolean):void;\n\n\t\t/**\n\t\t * The opacity of the display object.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#alpha Full description of starling.display.DisplayObject.alpha in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction get alpha():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set alpha(value:Number):void;\n\n\t\t/**\n\t\t * The rotation of the display object, in radians.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#rotation Full description of starling.display.DisplayObject.rotation in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction get rotation():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set rotation(value:Number):void;\n\n\t\t/**\n\t\t * The display object's mask.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#mask Full description of starling.display.DisplayObject.mask in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction get mask():DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set mask(value:DisplayObject):void;\n\n\t\t/**\n\t\t * The display object's parent, or <code>null</code> if it doesn't have\n\t\t * a parent.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#parent Full description of starling.display.DisplayObject.parent in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction get parent():DisplayObjectContainer;\n\n\t\t/**\n\t\t * The top-most object of the display tree that the display object is\n\t\t * connected to.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#base Full description of starling.display.DisplayObject.base in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction get base():DisplayObject;\n\n\t\t/**\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#root Full description of starling.display.DisplayObject.root in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction get root():DisplayObject;\n\n\t\t/**\n\t\t * The stage that the display object is connected to, or <code>null</code>\n\t\t * if it is not connected to a stage.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#stage Full description of starling.display.DisplayObject.stage in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction get stage():Stage;\n\n\t\t/**\n\t\t * The transformation matrix of the display object, relative to its\n\t\t * parent.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#transformationMatrix Full description of starling.display.DisplayObject.transformationMatrix in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction get transformationMatrix():Matrix;\n\n\t\t/**\n\t\t * Determines if the mouse cursor should turn into a hand when the mouse\n\t\t * is over the display object.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#useHandCursor Full description of starling.display.DisplayObject.useHandCursor in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction get useHandCursor():Boolean;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set useHandCursor(value:Boolean):void;\n\n\t\t/**\n\t\t * The bounds of the display object in its local coordinate space.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#bounds Full description of starling.display.DisplayObject.bounds in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction get bounds():Rectangle;\n\n\t\t/**\n\t\t * The filter used when rendering the display object.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#filter Full description of starling.display.DisplayObject.filter in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction get filter():FragmentFilter;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set filter(value:FragmentFilter):void;\n\n\t\t/**\n\t\t * Removes a display object from its parent.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#removeFromParent() Full description of starling.display.DisplayObject.removeFromParent() in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction removeFromParent(dispose:Boolean = false):void;\n\n\t\t/**\n\t\t * Determines if a point exists within the display object's bounds.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#hitTest() Full description of starling.display.DisplayObject.hitTest() in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction hitTest(localPoint:Point):DisplayObject;\n\n\t\t/**\n\t\t * Converts a point from the display object's coordinate space to the\n\t\t * stage's coordinate space.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#localToGlobal() Full description of starling.display.DisplayObject.localToGlobal() in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction localToGlobal(localPoint:Point, resultPoint:Point = null):Point;\n\n\t\t/**\n\t\t * Converts a point from the stage's coordinate space to the display\n\t\t * object's coordinate space.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#globalToLocal() Full description of starling.display.DisplayObject.globalToLocal() in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction globalToLocal(globalPoint:Point, resultPoint:Point = null):Point;\n\n\t\t/**\n\t\t * Calculates a transformation matrix to convert values from the display\n\t\t * object's coordinate space to a target coordinate space.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#getTransformationMatrix() Full description of starling.display.DisplayObject.getTransformationMatrix() in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction getTransformationMatrix(targetSpace:DisplayObject, resultMatrix:Matrix = null):Matrix;\n\n\t\t/**\n\t\t * Gets the display object's bounds in the target coordinate space.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#getBounds() Full description of starling.display.DisplayObject.getBounds() in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction getBounds(targetSpace:DisplayObject, resultRect:Rectangle = null):Rectangle;\n\n\t\t/**\n\t\t * Renders the display object.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#render() Full description of starling.display.DisplayObject.render() in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction render(painter:Painter):void;\n\n\t\t/**\n\t\t * Disposes the display object.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#dispose() Full description of starling.display.DisplayObject.dispose() in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction dispose():void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/IFeathersEventDispatcher.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\timport starling.events.Event;\n\n\t/**\n\t * Public properties and functions from <code>starling.events.EventDispatcher</code>\n\t * in helpful interface form.\n\t *\n\t * <p>Never cast an object to this type. Cast to <code>EventDispatcher</code>\n\t * instead. This interface exists only to support easier code hinting for\n\t * interfaces.</p>\n\t *\n\t * @see http://doc.starling-framework.org/core/starling/events/EventDispatcher.html starling.events.EventDispatcher\n\t *\n\t * @productversion Feathers 1.1.0\n\t */\n\tpublic interface IFeathersEventDispatcher\n\t{\n\t\t/**\n\t\t * Adds a listener for an event type.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/events/EventDispatcher.html#addEventListener() Full description of starling.events.EventDispatcher.addEventListener() in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction addEventListener(type:String, listener:Function):void;\n\n\t\t/**\n\t\t * Removes a listener for an event type.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/events/EventDispatcher.html#removeEventListener() Full description of starling.events.EventDispatcher.addEventListener() in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction removeEventListener(type:String, listener:Function):void;\n\n\t\t/**\n\t\t * Removes all listeners for an event type.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/events/EventDispatcher.html#removeEventListeners() Full description of starling.events.EventDispatcher.removeEventListeners() in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction removeEventListeners(type:String = null):void;\n\n\t\t/**\n\t\t * Dispatches an event to all listeners added for the specified event type.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/events/EventDispatcher.html#dispatchEvent() Full description of starling.events.EventDispatcher.dispatchEvent() in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction dispatchEvent(event:Event):void;\n\n\t\t/**\n\t\t * Dispatches an event from the pool with the specified to all listeners\n\t\t * for the specified event type.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/events/EventDispatcher.html#dispatchEventWith() Full description of starling.events.EventDispatcher.dispatchEventWith() in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction dispatchEventWith(type:String, bubbles:Boolean = false, data:Object = null):void;\n\n\t\t/**\n\t\t * Checks if a listener has been added for the specified event type.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/events/EventDispatcher.html#hasEventListener() Full description of starling.events.EventDispatcher.hasEventListener() in Gamua's Starling Framework API Reference\n\t\t */\n\t\tfunction hasEventListener(type:String, listener:Function = null):Boolean;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/IFocusContainer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\t/**\n\t * A component that can receive focus with children that can receive focus.\n\t *\n\t * @see ../../../help/focus.html Keyboard focus management in Feathers\n\t *\n\t * @productversion Feathers 2.1.0\n\t */\n\tpublic interface IFocusContainer extends IFocusDisplayObject\n\t{\n\t\t/**\n\t\t * Determines if this component's children can receive focus. This\n\t\t * property is completely independent from the <code>isFocusEnabled</code>\n\t\t * property. In other words, it's possible to disable focus on this\n\t\t * component while still allowing focus on its children (or the other\n\t\t * way around).\n\t\t *\n\t\t * <p>In the following example, the focus is disabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * object.isFocusEnabled = false;</listing>\n\t\t *\n\t\t * @see #isFocusEnabled\n\t\t */\n\t\tfunction get isChildFocusEnabled():Boolean;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set isChildFocusEnabled(value:Boolean):void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/IFocusDisplayObject.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\t/**\n\t * Dispatched when the display object receives focus.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.FOCUS_IN\n\t */\n\t[Event(name=\"focusIn\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the display object loses focus.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.FOCUS_OUT\n\t */\n\t[Event(name=\"focusOut\",type=\"starling.events.Event\")]\n\n\t/**\n\t * A component that can receive focus if a focus manager is enabled.\n\t *\n\t * @see ../../../help/focus.html Keyboard focus management in Feathers\n\t *\n\t * @productversion Feathers 1.1.0\n\t */\n\tpublic interface IFocusDisplayObject extends IFeathersDisplayObject\n\t{\n\t\t/**\n\t\t * The current focus manager for this component. May be\n\t\t * <code>null</code> if no focus manager is enabled.\n\t\t */\n\t\tfunction get focusManager():IFocusManager;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set focusManager(value:IFocusManager):void;\n\n\t\t/**\n\t\t * Determines if this component can receive focus.\n\t\t *\n\t\t * <p>In the following example, the focus is disabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * object.isFocusEnabled = false;</listing>\n\t\t */\n\t\tfunction get isFocusEnabled():Boolean;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set isFocusEnabled(value:Boolean):void;\n\n\t\t/**\n\t\t * The next object that will receive focus when the tab key is pressed\n\t\t * when a focus manager is enabled. If <code>null</code>, defaults to\n\t\t * the next child on the display list.\n\t\t *\n\t\t * <p>In the following example, the next tab focus is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * object.nextTabFocus = otherObject;</listing>\n\t\t */\n\t\tfunction get nextTabFocus():IFocusDisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set nextTabFocus(value:IFocusDisplayObject):void;\n\n\t\t/**\n\t\t * The previous object that will receive focus when the tab key is\n\t\t * pressed while holding shift when a focus manager is enabled. If\n\t\t * <code>null</code>, defaults to the previous child on the display\n\t\t * list.\n\t\t *\n\t\t * <p>In the following example, the previous tab focus is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * object.previousTabFocus = otherObject;</listing>\n\t\t */\n\t\tfunction get previousTabFocus():IFocusDisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set previousTabFocus(value:IFocusDisplayObject):void;\n\n\t\t/**\n\t\t * The next object that will receive focus when\n\t\t * <code>Keyboard.UP</code> is pressed at\n\t\t * <code>KeyLocation.D_PAD</code> and a focus manager is enabled. If\n\t\t * <code>null</code>, defaults to the best available child, as\n\t\t * determined by the focus manager.\n\t\t *\n\t\t * <p>In the following example, the next up focus is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * object.nextUpFocus = otherObject;</listing>\n\t\t *\n\t\t * <p>To simulate <code>KeyLocation.D_PAD</code> in the AIR Debug\n\t\t * Launcher on desktop for debugging purposes, set\n\t\t * <code>DeviceCapabilities.simulateDPad</code> to <code>true</code>.</p>\n\t\t *\n\t\t * @see feathers.system.DeviceCapabilities#simulateDPad\n\t\t *\n\t\t * @productversion Feathers 3.4.0\n\t\t */\n\t\tfunction get nextUpFocus():IFocusDisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set nextUpFocus(value:IFocusDisplayObject):void;\n\n\t\t/**\n\t\t * The next object that will receive focus when\n\t\t * <code>Keyboard.RIGHT</code> is pressed at\n\t\t * <code>KeyLocation.D_PAD</code> and a focus manager is enabled. If\n\t\t * <code>null</code>, defaults to the best available child, as\n\t\t * determined by the focus manager.\n\t\t *\n\t\t * <p>In the following example, the next right focus is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * object.nextRightFocus = otherObject;</listing>\n\t\t *\n\t\t * <p>To simulate <code>KeyLocation.D_PAD</code> in the AIR Debug\n\t\t * Launcher on desktop for debugging purposes, set\n\t\t * <code>DeviceCapabilities.simulateDPad</code> to <code>true</code>.</p>\n\t\t *\n\t\t * @see feathers.system.DeviceCapabilities#simulateDPad\n\t\t *\n\t\t * @productversion Feathers 3.4.0\n\t\t */\n\t\tfunction get nextRightFocus():IFocusDisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set nextRightFocus(value:IFocusDisplayObject):void;\n\n\t\t/**\n\t\t * The next object that will receive focus when\n\t\t * <code>Keyboard.DOWN</code> is pressed at\n\t\t * <code>KeyLocation.D_PAD</code> and a focus manager is enabled. If\n\t\t * <code>null</code>, defaults to the best available child, as\n\t\t * determined by the focus manager.\n\t\t *\n\t\t * <p>In the following example, the next down focus is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * object.nextDownFocus = otherObject;</listing>\n\t\t *\n\t\t * <p>To simulate <code>KeyLocation.D_PAD</code> in the AIR Debug\n\t\t * Launcher on desktop for debugging purposes, set\n\t\t * <code>DeviceCapabilities.simulateDPad</code> to <code>true</code>.</p>\n\t\t *\n\t\t * @see feathers.system.DeviceCapabilities#simulateDPad\n\t\t *\n\t\t * @productversion Feathers 3.4.0\n\t\t */\n\t\tfunction get nextDownFocus():IFocusDisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set nextDownFocus(value:IFocusDisplayObject):void;\n\n\t\t/**\n\t\t * The next object that will receive focus when\n\t\t * <code>Keyboard.LEFT</code> is pressed at\n\t\t * <code>KeyLocation.D_PAD</code> and a focus manager is enabled. If\n\t\t * <code>null</code>, defaults to the best available child, as\n\t\t * determined by the focus manager.\n\t\t *\n\t\t * <p>In the following example, the next left focus is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * object.nextLeftFocus = otherObject;</listing>\n\t\t *\n\t\t * <p>To simulate <code>KeyLocation.D_PAD</code> in the AIR Debug\n\t\t * Launcher on desktop for debugging purposes, set\n\t\t * <code>DeviceCapabilities.simulateDPad</code> to <code>true</code>.</p>\n\t\t *\n\t\t * @see feathers.system.DeviceCapabilities#simulateDPad\n\t\t *\n\t\t * @productversion Feathers 3.4.0\n\t\t */\n\t\tfunction get nextLeftFocus():IFocusDisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set nextLeftFocus(value:IFocusDisplayObject):void;\n\n\t\t/**\n\t\t * Used for associating focusable display objects that are not direct\n\t\t * children with an \"owner\" focusable display object, such as pop-ups.\n\t\t * A focus manager may use this property to influence the tab order.\n\t\t *\n\t\t * <p>In the following example, the focus owner is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * object.focusOwner = otherObject;</listing>\n\t\t */\n\t\tfunction get focusOwner():IFocusDisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set focusOwner(value:IFocusDisplayObject):void;\n\n\t\t/**\n\t\t * Indicates if the <code>showFocus()</code> method has been called on\n\t\t * the object when it has focus.\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * if(object.isShowingFocus)\n\t\t * {\n\t\t * \n\t\t * }</listing>\n\t\t *\n\t\t * @see #showFocus()\n\t\t * @see #hideFocus()\n\t\t */\n\t\tfunction get isShowingFocus():Boolean;\n\n\t\t/**\n\t\t * If <code>true</code>, the display object should remain in focus,\n\t\t * even if something else is touched. If <code>false</code>, touching\n\t\t * another object will pass focus normally.\n\t\t */\n\t\tfunction get maintainTouchFocus():Boolean;\n\n\t\t/**\n\t\t * If the object has focus, an additional visual indicator may\n\t\t * optionally be displayed to highlight the object. Calling this\n\t\t * function may have no effect. It's merely a suggestion to the object.\n\t\t *\n\t\t * <p><strong>Important:</strong> This function will not give focus to\n\t\t * the display object if it doesn't have focus. To give focus to the\n\t\t * display object, you should set the <code>focus</code> property on\n\t\t * the focus manager.</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * object.focusManager.focus = object;</listing>\n\t\t *\n\t\t * @see #hideFocus()\n\t\t * @see feathers.core.IFocusManager#focus\n\t\t */\n\t\tfunction showFocus():void;\n\n\t\t/**\n\t\t * If the visual indicator of focus has been displayed by\n\t\t * <code>showFocus()</code>, call this function to hide it.\n\t\t *\n\t\t * <p><strong>Important:</strong> This function will not clear focus\n\t\t * from the display object if it has focus. To clear focus from the\n\t\t * display object, you should set the <code>focus</code> property on\n\t\t * the focus manager to <code>null</code> or another display object.</p>\n\t\t *\n\t\t * @see #showFocus()\n\t\t * @see feathers.core.IFocusManager#focus\n\t\t */\n\t\tfunction hideFocus():void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/IFocusExtras.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * A container that may have extra children that aren't accessible from the\n\t * standard display list functions like <code>getChildAt()</code>, but those\n\t * \"extra\" children may still need to receive focus. An example of this\n\t * would be a container with \"chrome\", such as <code>feathers.controls.Panel</code>.\n\t *\n\t * @see ../../../help/focus.html Keyboard focus management in Feathers\n\t *\n\t * @productversion Feathers 1.2.0\n\t */\n\tpublic interface IFocusExtras\n\t{\n\t\t/**\n\t\t * Extra display objects that are not accessible through standard\n\t\t * display list functions like <code>getChildAt()</code>, but should\n\t\t * appear before those children in the focus order. Typically, this is\n\t\t * for containers that have chrome that is hidden from the normal\n\t\t * display list API.\n\t\t *\n\t\t * <p>May return <code>null</code> if there are no extra children.</p>\n\t\t */\n\t\tfunction get focusExtrasBefore():Vector.<DisplayObject>;\n\n\t\t/**\n\t\t * Extra display objects that are not accessible through standard\n\t\t * display list functions like <code>getChildAt()</code>, but should\n\t\t * appear after those children in the focus order. Typically, this is\n\t\t * for containers that have chrome that is hidden from the normal\n\t\t * display list API.\n\t\t *\n\t\t * <p>May return <code>null</code> if there are no extra children.</p>\n\t\t */\n\t\tfunction get focusExtrasAfter():Vector.<DisplayObject>;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/IFocusManager.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\timport feathers.core.IFeathersEventDispatcher;\n\n\timport starling.display.DisplayObjectContainer;\n\n\t/**\n\t * Dispatched when the value of the <code>focus</code> property changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t *\n\t * @see #focus\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Interface for focus management.\n\t *\n\t * @see ../../../help/focus.html Keyboard focus management in Feathers\n\t * @see feathers.core.FocusManager\n\t * @see feathers.core.IFocusDisplayObject\n\t *\n\t * @productversion Feathers 1.1.0\n\t */\n\tpublic interface IFocusManager extends IFeathersEventDispatcher\n\t{\n\t\t/**\n\t\t * Determines if this focus manager is enabled. A focus manager may be\n\t\t * disabled when another focus manager has control, such as when a\n\t\t * modal pop-up is displayed.\n\t\t */\n\t\tfunction get isEnabled():Boolean;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set isEnabled(value:Boolean):void;\n\n\t\t/**\n\t\t * The object that currently has focus. May return <code>null</code> if\n\t\t * no object has focus.\n\t\t *\n\t\t * <p>In the following example, the focus is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * focusManager.focus = someObject;</listing>\n\t\t */\n\t\tfunction get focus():IFocusDisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set focus(value:IFocusDisplayObject):void;\n\n\t\t/**\n\t\t * The top-level container of the focus manager. This isn't necessarily\n\t\t * the root of the display list.\n\t\t */\n\t\tfunction get root():DisplayObjectContainer;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/IGroupedToggle.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\t/**\n\t * A toggle associated with a specific group.\n\t *\n\t * @see ToggleGroup\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic interface IGroupedToggle extends IToggle\n\t{\n\t\t/**\n\t\t * When the toggle is added to a <code>ToggleGroup</code>, the group\n\t\t * will manage the entire group's selection when one of the toggles in\n\t\t * the group changes.\n\t\t *\n\t\t * <p>In the following example, a <code>Radio</code> is added to a <code>ToggleGroup</code>:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var group:ToggleGroup = new ToggleGroup();\n\t\t * group.addEventListener( Event.CHANGE, group_changeHandler );\n\t\t * \n\t\t * var radio:Radio = new Radio();\n\t\t * radio.toggleGroup = group;\n\t\t * this.addChild( radio );</listing>\n\t\t */\n\t\tfunction get toggleGroup():ToggleGroup;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set toggleGroup(value:ToggleGroup):void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/IIMETextEditor.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\t/**\n\t * @private\n\t * A text editor that is compatible with <code>TextEditorIMEClient</code>.\n\t *\n\t * @see feathers.utils.text.TextEditorIMEClient\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic interface IIMETextEditor extends ITextEditor\n\t{\n\t\t/**\n\t\t * The index where the selection is anchored. Will be equal to either\n\t\t * <code>selectionBeginIndex</code> or <code>selectionEndIndex</code>.\n\t\t *\n\t\t * @see #selectionActiveIndex\n\t\t */\n\t\tfunction get selectionAnchorIndex():int;\n\n\t\t/**\n\t\t * The index where the selection is active.\n\t\t *\n\t\t * @see #selectionAnchorIndex\n\t\t */\n\t\tfunction get selectionActiveIndex():int;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/IMeasureDisplayObject.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\t/**\n\t * A display object with extra measurement properties.\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic interface IMeasureDisplayObject extends IFeathersDisplayObject\n\t{\n\t\t/**\n\t\t * @copy feathers.core.FeathersControl#explicitWidth\n\t\t */\n\t\tfunction get explicitWidth():Number;\n\n\t\t/**\n\t\t * @copy feathers.core.FeathersControl#explicitMinWidth\n\t\t */\n\t\tfunction get explicitMinWidth():Number;\n\n\t\t/**\n\t\t * @copy feathers.core.FeathersControl#minWidth\n\t\t */\n\t\tfunction get minWidth():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set minWidth(value:Number):void;\n\n\t\t/**\n\t\t * @copy feathers.core.FeathersControl#explicitMaxWidth\n\t\t */\n\t\tfunction get explicitMaxWidth():Number;\n\n\t\t/**\n\t\t * @copy feathers.core.FeathersControl#maxWidth\n\t\t */\n\t\tfunction get maxWidth():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set maxWidth(value:Number):void;\n\n\t\t/**\n\t\t * @copy feathers.core.FeathersControl#explicitHeight\n\t\t */\n\t\tfunction get explicitHeight():Number;\n\n\t\t/**\n\t\t * @copy feathers.core.FeathersControl#explicitMinHeight\n\t\t */\n\t\tfunction get explicitMinHeight():Number;\n\n\t\t/**\n\t\t * @copy feathers.core.FeathersControl#minHeight\n\t\t */\n\t\tfunction get minHeight():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set minHeight(value:Number):void;\n\n\t\t/**\n\t\t * @copy feathers.core.FeathersControl#explicitMaxHeight\n\t\t */\n\t\tfunction get explicitMaxHeight():Number;\n\n\t\t/**\n\t\t * @copy feathers.core.FeathersControl#maxHeight\n\t\t */\n\t\tfunction get maxHeight():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set maxHeight(value:Number):void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/IMultilineTextEditor.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\t/**\n\t * Handles the editing of text, and supports multiline editing. This is not\n\t * a text editor intended for a <code>TextArea</code> component. Instead,\n\t * its a text editor intended for a <code>TextInput</code> component and it\n\t * is expected to provide its own scroll bars.\n\t *\n\t * @see feathers.controls.TextInput\n\t * @see ../../../help/text-editors Introduction to Feathers text editors\n\t *\n\t * @productversion Feathers 2.0.0\n\t */\n\tpublic interface IMultilineTextEditor extends ITextEditor\n\t{\n\t\t/**\n\t\t * Indicates whether the text editor can display more than one line of\n\t\t * text.\n\t\t */\n\t\tfunction get multiline():Boolean;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set multiline(value:Boolean):void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/INativeFocusOwner.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\t/**\n\t * If a Feathers component may receive focus, it may be associated with a\n\t * display object on the native stage. The focus manager will automatically\n\t * pass focus to the native focus.\n\t *\n\t * @see ../../../help/focus.html\n\t *\n\t * @productversion Feathers 2.2.0\n\t */\n\tpublic interface INativeFocusOwner extends IFocusDisplayObject\n\t{\n\t\t/**\n\t\t * An object external to Starling that must be given focus when this\n\t\t * Feathers component is given focus by a focus manager.\n\t\t *\n\t\t * <p>This property may return <code>null</code>. When it returns\n\t\t * <code>null</code>, the focus manager should treat this display object\n\t\t * like any other display object that may receive focus but doesn't\n\t\t * implement <code>INativeFocusOwner</code>.</p>\n\t\t *\n\t\t * <p>If this property doesn't return a\n\t\t * <code>flash.display.InteractiveObject</code>, the class must also\n\t\t * implement <code>IAdvancedNativeFocusOwner</code>.</p>\n\t\t *\n\t\t * @see feathers.core.IAdvancedNativeFocusOwner\n\t\t */\n\t\tfunction get nativeFocus():Object;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/IPopUpManager.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\timport starling.display.DisplayObject;\n\timport starling.display.DisplayObjectContainer;\n\n\t/**\n\t * Interface for pop-up management.\n\t *\n\t * @see feathers.core.PopUpManager\n\t *\n\t * @productversion Feathers 1.3.0\n\t */\n\tpublic interface IPopUpManager\n\t{\n\t\t/**\n\t\t * @copy PopUpManager#overlayFactory\n\t\t */\n\t\tfunction get overlayFactory():Function;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set overlayFactory(value:Function):void;\n\n\t\t/**\n\t\t * @copy PopUpManager#root\n\t\t */\n\t\tfunction get root():DisplayObjectContainer;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set root(value:DisplayObjectContainer):void;\n\n\t\t/**\n\t\t * @copy PopUpManager#popUpCount\n\t\t */\n\t\tfunction get popUpCount():int;\n\n\t\t/**\n\t\t * @copy PopUpManager#addPopUp()\n\t\t */\n\t\tfunction addPopUp(popUp:DisplayObject, isModal:Boolean = true, isCentered:Boolean = true, customOverlayFactory:Function = null):DisplayObject;\n\n\t\t/**\n\t\t * @copy PopUpManager#removePopUp()\n\t\t */\n\t\tfunction removePopUp(popUp:DisplayObject, dispose:Boolean = false):DisplayObject;\n\n\t\t/**\n\t\t * @copy PopUpManager#removeAllPopUps()\n\t\t */\n\t\tfunction removeAllPopUps(dispose:Boolean = false):void;\n\n\t\t/**\n\t\t * @copy PopUpManager#isPopUp()\n\t\t */\n\t\tfunction isPopUp(popUp:DisplayObject):Boolean;\n\n\t\t/**\n\t\t * @copy PopUpManager#isTopLevelPopUp()\n\t\t */\n\t\tfunction isTopLevelPopUp(popUp:DisplayObject):Boolean;\n\n\t\t/**\n\t\t * @copy PopUpManager#centerPopUp()\n\t\t */\n\t\tfunction centerPopUp(popUp:DisplayObject):void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/IStateContext.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\t/**\n\t * Dispatched when the display object's state changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.STATE_CHANGE\n\t */\n\t[Event(name=\"stateChange\",type=\"starling.events.Event\")]\n\n\t/**\n\t * An object with multiple states.\n\t *\n\t * @productversion Feathers 2.3.0\n\t */\n\tpublic interface IStateContext extends IFeathersEventDispatcher\n\t{\n\t\t/**\n\t\t * The object's current state.\n\t\t *\n\t\t * @see #event:stateChange feathers.events.FeathersEventType.STATE_CHANGE\n\t\t */\n\t\tfunction get currentState():String;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/IStateObserver.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\t/**\n\t * Watches an <code>IStateContext</code> for state changes.\n\t *\n\t * @see feathers.core.IStateContext\n\t *\n\t * @productversion Feathers 2.3.0\n\t */\n\tpublic interface IStateObserver\n\t{\n\t\t/**\n\t\t * The current state context that is being observed.\n\t\t */\n\t\tfunction get stateContext():IStateContext;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set stateContext(value:IStateContext):void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/ITextBaselineControl.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\t/**\n\t * A UI control with text that has a baseline.\n\t *\n\t * @productversion Feathers 2.0.0\n\t */\n\tpublic interface ITextBaselineControl extends IFeathersControl\n\t{\n\t\t/**\n\t\t * Returns the text baseline measurement, in pixels.\n\t\t */\n\t\tfunction get baseline():Number;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/ITextEditor.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\timport feathers.text.FontStylesSet;\n\n\timport flash.geom.Point;\n\n\t/**\n\t * Dispatched when the text property changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #text\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the user presses the Enter key while the editor has focus.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.ENTER\n\t */\n\t[Event(name=\"enter\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the text editor receives focus.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.FOCUS_IN\n\t */\n\t[Event(name=\"focusIn\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the text editor loses focus.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.FOCUS_OUT\n\t */\n\t[Event(name=\"focusOut\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the soft keyboard is activated. Not all text editors will\n\t * activate a soft keyboard.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.SOFT_KEYBOARD_ACTIVATE\n\t */\n\t[Event(name=\"softKeyboardActivate\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the soft keyboard is deactivated. Not all text editors\n\t * will activate a soft keyboard.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.SOFT_KEYBOARD_DEACTIVATE\n\t */\n\t[Event(name=\"softKeyboardDectivate\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Handles the editing of text.\n\t *\n\t * @see feathers.controls.TextInput\n\t * @see ../../../help/text-editors.html Introduction to Feathers text editors\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic interface ITextEditor extends IFeathersControl, ITextBaselineControl\n\t{\n\t\t/**\n\t\t * The text displayed by the editor.\n\t\t */\n\t\tfunction get text():String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set text(value:String):void;\n\n\t\t/**\n\t\t * Determines if the entered text will be masked so that it cannot be\n\t\t * seen, such as for a password input.\n\t\t */\n\t\tfunction get displayAsPassword():Boolean;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set displayAsPassword(value:Boolean):void;\n\n\t\t/**\n\t\t * The maximum number of characters that may be entered.\n\t\t */\n\t\tfunction get maxChars():int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set maxChars(value:int):void;\n\n\t\t/**\n\t\t * Limits the set of characters that may be entered.\n\t\t */\n\t\tfunction get restrict():String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set restrict(value:String):void;\n\n\t\t/**\n\t\t * Determines if the text is editable.\n\t\t *\n\t\t * @see #isSelectable\n\t\t */\n\t\tfunction get isEditable():Boolean;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set isEditable(value:Boolean):void;\n\n\t\t/**\n\t\t * If the <code>isEditable</code> property is set to <code>false</code>,\n\t\t * the <code>isSelectable</code> property determines if the text is\n\t\t * selectable. If the <code>isEditable</code> property is set to\n\t\t * <code>true</code>, the text will always be selectable.\n\t\t *\n\t\t * @see #isEditable\n\t\t */\n\t\tfunction get isSelectable():Boolean;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set isSelectable(value:Boolean):void;\n\n\t\t/**\n\t\t * Determines if the owner should call <code>setFocus()</code> on\n\t\t * <code>TouchPhase.ENDED</code> or on <code>TouchPhase.BEGAN</code>.\n\t\t * This is a hack because <code>StageText</code> doesn't like being\n\t\t * assigned focus on <code>TouchPhase.BEGAN</code>. In general, most\n\t\t * text editors should simply return <code>false</code>.\n\t\t *\n\t\t * @see #setFocus()\n\t\t */\n\t\tfunction get setTouchFocusOnEndedPhase():Boolean;\n\n\t\t/**\n\t\t * The index of the first character of the selection. If no text is\n\t\t * selected, then this is the value of the caret index. This value will\n\t\t * always be smaller than <code>selectionEndIndex</code>.\n\t\t *\n\t\t * @see #selectionEndIndex\n\t\t */\n\t\tfunction get selectionBeginIndex():int;\n\n\t\t/**\n\t\t * The index of the last character of the selection. If no text is\n\t\t * selected, then this is the value of the caret index. This value will\n\t\t * always be larger than <code>selectionBeginIndex</code>.\n\t\t *\n\t\t * @see #selectionBeginIndex\n\t\t */\n\t\tfunction get selectionEndIndex():int;\n\n\t\t/**\n\t\t * The internal font styles used to render the text that are passed down\n\t\t * from the parent component. Generally, most developers will set font\n\t\t * styles on the parent component.\n\t\t *\n\t\t * <p>Warning: The <code>fontStyles</code> property may be ignored if\n\t\t * more advanced styles defined by the text renderer implementation have\n\t\t * been set.</p>\n\t\t *\n\t\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t\t */\n\t\tfunction get fontStyles():FontStylesSet;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set fontStyles(value:FontStylesSet):void;\n\n\t\t/**\n\t\t * Gives focus to the text editor. Includes an optional position which\n\t\t * may be used by the text editor to determine the cursor position. The\n\t\t * position may be outside of the editors bounds.\n\t\t */\n\t\tfunction setFocus(position:Point = null):void;\n\n\t\t/**\n\t\t * Removes focus from the text editor.\n\t\t */\n\t\tfunction clearFocus():void;\n\n\t\t/**\n\t\t * Sets the range of selected characters. If both values are the same,\n\t\t * the text insertion position is changed and nothing is selected.\n\t\t */\n\t\tfunction selectRange(startIndex:int, endIndex:int):void;\n\n\t\t/**\n\t\t * Measures the text's bounds (without a full validation, if\n\t\t * possible).\n\t\t */\n\t\tfunction measureText(result:Point = null):Point;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/ITextRenderer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\timport feathers.text.FontStylesSet;\n\n\timport flash.geom.Point;\n\n\t/**\n\t * Interface that handles common capabilities of rendering text.\n\t *\n\t * @see ../../../help/text-renderers.html Introduction to Feathers text renderers\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic interface ITextRenderer extends IStateObserver, IFeathersControl, ITextBaselineControl\n\t{\n\t\t/**\n\t\t * The text to render.\n\t\t *\n\t\t * <p>If using the <code>Label</code> component, this property should\n\t\t * be set on the <code>Label</code>, and it will be passed down to the\n\t\t * text renderer.</p>\n\t\t */\n\t\tfunction get text():String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set text(value:String):void;\n\n\t\t/**\n\t\t * Determines if the text wraps to the next line when it reaches the\n\t\t * width (or max width) of the component.\n\t\t *\n\t\t * <p> This property is sometimes controlled by the parent component,\n\t\t * such as on a <code>Label</code> component. If using the\n\t\t * <code>Label</code> component, this property must be set on the\n\t\t * <code>Label</code>, and it will be passed down to the text renderer\n\t\t * automatically.</p>\n\t\t */\n\t\tfunction get wordWrap():Boolean;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set wordWrap(value:Boolean):void;\n\n\t\t/**\n\t\t * The number of text lines in the text renderer. The text renderer may\n\t\t * contain multiple text lines if the text contains line breaks or if\n\t\t * the <code>wordWrap</code> property is enabled.\n\t\t */\n\t\tfunction get numLines():int;\n\n\t\t/**\n\t\t * The internal font styles used to render the text that are passed down\n\t\t * from the parent component. Generally, most developers will set font\n\t\t * styles on the parent component.\n\t\t *\n\t\t * <p>Warning: The <code>fontStyles</code> property may be ignored if\n\t\t * more advanced styles defined by the text renderer implementation have\n\t\t * been set.</p>\n\t\t *\n\t\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t\t */\n\t\tfunction get fontStyles():FontStylesSet;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set fontStyles(value:FontStylesSet):void;\n\n\t\t/**\n\t\t * Measures the text's bounds (without a full validation, if\n\t\t * possible).\n\t\t */\n\t\tfunction measureText(result:Point = null):Point;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/IToggle.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\t/**\n\t * Dispatched when the selection changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #isSelected\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * An interface for something that may be selected.\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic interface IToggle extends IFeathersControl\n\t{\n\t\t/**\n\t\t * Indicates if the IToggle is selected or not.\n\t\t */\n\t\tfunction get isSelected():Boolean;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set isSelected(value:Boolean):void;\n\t}\n}"
  },
  {
    "path": "source/feathers/core/IToolTip.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\t/**\n\t * An interface for tool tips created by the tool tip manager.\n\t *\n\t * @see ../../../help/tool-tips.html Tool tips in Feathers\n\t * @see feathers.core.ToolTipManager\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic interface IToolTip extends IFeathersControl\n\t{\n\t\t/**\n\t\t * The text to display in the tool tip.\n\t\t */\n\t\tfunction get text():String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set text(value:String):void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/IToolTipManager.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\t/**\n\t * Interface for tool tip management.\n\t *\n\t * @see ../../../help/tool-tips.html Tool tips in Feathers\n\t * @see feathers.core.ToolTipManager\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic interface IToolTipManager\n\t{\n\t\t/**\n\t\t * Cleans up event listeners and display objects used by the tool tip\n\t\t * manager.\n\t\t */\n\t\tfunction dispose():void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/IValidating.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\t/**\n\t * A display object that supports validation. Display objects of this type\n\t * will delay updating after property changes until just before Starling\n\t * renders the display list to avoid running redundant code.\n\t *\n\t * @productversion Feathers 1.3.0\n\t */\n\tpublic interface IValidating extends IFeathersDisplayObject\n\t{\n\t\t/**\n\t\t * The component's depth in the display list, relative to the stage. If\n\t\t * the component isn't on the stage, its depth will be <code>-1</code>.\n\t\t *\n\t\t * <p>Used by the validation system to validate components from the\n\t\t * top down.</p>\n\t\t */\n\t\tfunction get depth():int;\n\n\t\t/**\n\t\t * Immediately validates the display object, if it is invalid. The\n\t\t * validation system exists to postpone updating a display object after\n\t\t * properties are changed until until the last possible moment the\n\t\t * display object is rendered. This allows multiple properties to be\n\t\t * changed at a time without requiring a full update every time.\n\t\t */\n\t\tfunction validate():void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/PopUpManager.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\timport flash.utils.Dictionary;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.display.DisplayObjectContainer;\n\n\t/**\n\t * Adds a display object as a pop-up above all content.\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class PopUpManager\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const _starlingToPopUpManager:Dictionary = new Dictionary(true);\n\n\t\t/**\n\t\t * The default factory that creates a pop-up manager.\n\t\t *\n\t\t * @see feathers.core.DefaultPopUpManager\n\t\t */\n\t\tpublic static function defaultPopUpManagerFactory():IPopUpManager\n\t\t{\n\t\t\treturn new DefaultPopUpManager();\n\t\t}\n\n\t\t/**\n\t\t * Returns the <code>IPopUpManager</code> associated with the specified\n\t\t * <code>Starling</code> instance. If a pop-up manager hasn't been\n\t\t * created yet, it will be created using <code>PopUpManager.popUpManagerFactory</code>.\n\t\t *\n\t\t * <p>In the following example, a pop-up is added:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * PopUpManager.forStarling( Starling.current ).addPopUp( popUp );</listing>\n\t\t *\n\t\t * @see #popUpManagerFactory\n\t\t */\n\t\tpublic static function forStarling(starling:Starling):IPopUpManager\n\t\t{\n\t\t\tif(!starling)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"PopUpManager not found. Starling cannot be null.\");\n\t\t\t}\n\t\t\tvar popUpManager:IPopUpManager = _starlingToPopUpManager[starling];\n\t\t\tif(!popUpManager)\n\t\t\t{\n\t\t\t\tvar factory:Function = PopUpManager.popUpManagerFactory;\n\t\t\t\tif(factory === null)\n\t\t\t\t{\n\t\t\t\t\tfactory = PopUpManager.defaultPopUpManagerFactory;\n\t\t\t\t}\n\t\t\t\tpopUpManager = factory();\n\t\t\t\t//this allows the factory to optionally set the root, but it\n\t\t\t\t//also enforces the root being on the correct stage.\n\t\t\t\tif(!popUpManager.root || !starling.stage.contains(popUpManager.root))\n\t\t\t\t{\n\t\t\t\t\tpopUpManager.root = Starling.current.stage;\n\t\t\t\t}\n\t\t\t\tPopUpManager._starlingToPopUpManager[starling] = popUpManager;\n\t\t\t}\n\t\t\treturn popUpManager;\n\t\t}\n\n\t\t/**\n\t\t * A function that creates a pop-up manager.\n\t\t *\n\t\t * <p>This function is expected to have the following signature:</p>\n\t\t * <pre>function():IPopUpManager</pre>\n\t\t *\n\t\t * <p>In the following example, the overlay factory is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * PopUpManager.popUpManagerFactory = function():IPopUpManager\n\t\t * {\n\t\t *     var popUpManager:DefaultPopUpManager = new DefaultPopUpManager();\n\t\t *     popUpManager.overlayFactory = function():DisplayObject\n\t\t *     {\n\t\t *         var overlay:Quad = new Quad( 100, 100, 0x000000 );\n\t\t *         overlay.alpha = 0.75;\n\t\t *         return overlay;\n\t\t *     };\n\t\t *     return popUpManager;\n\t\t * };</listing>\n\t\t *\n\t\t * @see feathers.core.IPopUpManager\n\t\t */\n\t\tpublic static var popUpManagerFactory:Function = defaultPopUpManagerFactory;\n\n\t\t/**\n\t\t * A function that returns a display object to use as an overlay for\n\t\t * modal pop-ups.\n\t\t *\n\t\t * <p>This function is expected to have the following signature:</p>\n\t\t * <pre>function():DisplayObject</pre>\n\t\t *\n\t\t * <p>In the following example, the overlay factory is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * PopUpManager.overlayFactory = function():DisplayObject\n\t\t * {\n\t\t *     var overlay:Quad = new Quad( 100, 100, 0x000000 );\n\t\t *     overlay.alpha = 0.75;\n\t\t *     return overlay;\n\t\t * };</listing>\n\t\t */\n\t\tpublic static function get overlayFactory():Function\n\t\t{\n\t\t\treturn PopUpManager.forStarling(Starling.current).overlayFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic static function set overlayFactory(value:Function):void\n\t\t{\n\t\t\tPopUpManager.forStarling(Starling.current).overlayFactory = value;\n\t\t}\n\n\t\t/**\n\t\t * The default factory that creates overlays for modal pop-ups. Creates\n\t\t * an invisible <code>Quad</code>.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/Quad.html starling.display.Quad\n\t\t */\n\t\tpublic static function defaultOverlayFactory():DisplayObject\n\t\t{\n\t\t\treturn DefaultPopUpManager.defaultOverlayFactory();\n\t\t}\n\n\t\t/**\n\t\t * The container where pop-ups are added. If not set manually, defaults\n\t\t * to the Starling stage.\n\t\t *\n\t\t * <p>In the following example, the next tab focus is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * PopUpManager.root = someSprite;</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic static function get root():DisplayObjectContainer\n\t\t{\n\t\t\treturn PopUpManager.forStarling(Starling.current).root;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic static function set root(value:DisplayObjectContainer):void\n\t\t{\n\t\t\tPopUpManager.forStarling(Starling.current).root = value;\n\t\t}\n\n\t\t/**\n\t\t * The current number of pop-ups.\n\t\t *\n\t\t * <p>In the following example, we check the number of pop-ups:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * if( PopUpManager.popUpCount > 0 )\n\t\t * {\n\t\t *     // do something\n\t\t * }</listing>\n\t\t */\n\t\tpublic static function get popUpCount():int\n\t\t{\n\t\t\treturn PopUpManager.forStarling(Starling.current).popUpCount;\n\t\t}\n\n\t\t/**\n\t\t * Adds a pop-up to the stage.\n\t\t *\n\t\t * <p>The pop-up may be modal, meaning that an overlay will be displayed\n\t\t * between the pop-up and everything under the pop-up manager, and the\n\t\t * overlay will block touches. The default overlay used for modal\n\t\t * pop-ups is created by <code>PopUpManager.overlayFactory</code>. A\n\t\t * custom overlay factory may be passed to <code>PopUpManager.addPopUp()</code>\n\t\t * to create an overlay that is different from the default one.</p>\n\t\t *\n\t\t * <p>A pop-up may be centered globally on the Starling stage. If the\n\t\t * stage or the pop-up resizes, the pop-up will be repositioned to\n\t\t * remain in the center. To position a pop-up in the center once,\n\t\t * specify a value of <code>false</code> when calling\n\t\t * <code>PopUpManager.addPopUp()</code> and call\n\t\t * <code>PopUpManager.centerPopUp()</code> manually.</p>\n\t\t *\n\t\t * <p>Note: The pop-up manager can only detect if Feathers components\n\t\t * have been resized in order to reposition them to remain centered.\n\t\t * Regular Starling display objects do not dispatch a proper resize\n\t\t * event that the pop-up manager can listen to.</p>\n\t\t */\n\t\tpublic static function addPopUp(popUp:DisplayObject, isModal:Boolean = true, isCentered:Boolean = true, customOverlayFactory:Function = null):DisplayObject\n\t\t{\n\t\t\treturn PopUpManager.forStarling(Starling.current).addPopUp(popUp, isModal, isCentered, customOverlayFactory);\n\t\t}\n\n\t\t/**\n\t\t * Removes a pop-up from the stage.\n\t\t */\n\t\tpublic static function removePopUp(popUp:DisplayObject, dispose:Boolean = false):DisplayObject\n\t\t{\n\t\t\treturn PopUpManager.forStarling(Starling.current).removePopUp(popUp, dispose);\n\t\t}\n\n\t\t/**\n\t\t * Removes all pop-ups from the stage.\n\t\t */\n\t\tpublic static function removeAllPopUps(dispose:Boolean = false):void\n\t\t{\n\t\t\tPopUpManager.forStarling(Starling.current).removeAllPopUps(dispose);\n\t\t}\n\n\t\t/**\n\t\t * Determines if a display object is a pop-up.\n\t\t *\n\t\t * <p>In the following example, we check if a display object is a pop-up:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * if( PopUpManager.isPopUp( displayObject ) )\n\t\t * {\n\t\t *     // do something\n\t\t * }</listing>\n\t\t */\n\t\tpublic static function isPopUp(popUp:DisplayObject):Boolean\n\t\t{\n\t\t\treturn PopUpManager.forStarling(Starling.current).isPopUp(popUp);\n\t\t}\n\n\t\t/**\n\t\t * Determines if a display object is above the highest modal overlay. If\n\t\t * there are no modals overlays, determines if a display object is a\n\t\t * pop-up.\n\t\t */\n\t\tpublic static function isTopLevelPopUp(popUp:DisplayObject):Boolean\n\t\t{\n\t\t\treturn PopUpManager.forStarling(Starling.current).isTopLevelPopUp(popUp);\n\t\t}\n\n\t\t/**\n\t\t * Centers a pop-up on the stage. Unlike the <code>isCentered</code>\n\t\t * argument passed to <code>PopUpManager.addPopUp()</code>, the pop-up\n\t\t * will only be positioned once. If the stage or the pop-up resizes,\n\t\t * <code>PopUpManager.centerPopUp()</code> will need to be called again\n\t\t * if it should remain centered.\n\t\t *\n\t\t * <p>In the following example, we center a pop-up:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * PopUpManager.centerPopUp( displayObject );</listing>\n\t\t */\n\t\tpublic static function centerPopUp(popUp:DisplayObject):void\n\t\t{\n\t\t\tPopUpManager.forStarling(Starling.current).centerPopUp(popUp);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/PropertyProxy.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\timport flash.utils.Proxy;\n\timport flash.utils.flash_proxy;\n\n\t/**\n\t * Detects when its own properties have changed and dispatches an event\n\t * to notify listeners.\n\t *\n\t * <p>Supports nested <code>PropertyProxy</code> instances using attribute\n\t * <code>&#64;</code> notation. Placing an <code>&#64;</code> before a property name\n\t * is like saying, \"If this nested <code>PropertyProxy</code> doesn't exist\n\t * yet, create one. If it does, use the existing one.\"</p>\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic final dynamic class PropertyProxy extends Proxy\n\t{\n\t\t/**\n\t\t * Creates a <code>PropertyProxy</code> from a regular old <code>Object</code>.\n\t\t */\n\t\tpublic static function fromObject(source:Object, onChangeCallback:Function = null):PropertyProxy\n\t\t{\n\t\t\tvar newValue:PropertyProxy = new PropertyProxy(onChangeCallback);\n\t\t\tfor(var propertyName:String in source)\n\t\t\t{\n\t\t\t\tnewValue[propertyName] = source[propertyName];\n\t\t\t}\n\t\t\treturn newValue;\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function PropertyProxy(onChangeCallback:Function = null)\n\t\t{\n\t\t\tif(onChangeCallback != null)\n\t\t\t{\n\t\t\t\tthis._onChangeCallbacks[this._onChangeCallbacks.length] = onChangeCallback;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _subProxyName:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _onChangeCallbacks:Vector.<Function> = new <Function>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _names:Array = [];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _storage:Object = {};\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride flash_proxy function hasProperty(name:*):Boolean\n\t\t{\n\t\t\treturn this._storage.hasOwnProperty(name);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride flash_proxy function getProperty(name:*):*\n\t\t{\n\t\t\tif(this.flash_proxy::isAttribute(name))\n\t\t\t{\n\t\t\t\tvar nameAsString:String = name is QName ? QName(name).localName : name.toString();\n\t\t\t\tif(!this._storage.hasOwnProperty(nameAsString))\n\t\t\t\t{\n\t\t\t\t\tvar subProxy:PropertyProxy = new PropertyProxy(subProxy_onChange);\n\t\t\t\t\tsubProxy._subProxyName = nameAsString;\n\t\t\t\t\tthis._storage[nameAsString] = subProxy;\n\t\t\t\t\tthis._names[this._names.length] = nameAsString;\n\t\t\t\t\tthis.fireOnChangeCallback(nameAsString);\n\t\t\t\t}\n\t\t\t\treturn this._storage[nameAsString];\n\t\t\t}\n\t\t\treturn this._storage[name];\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride flash_proxy function setProperty(name:*, value:*):void\n\t\t{\n\t\t\tvar nameAsString:String = name is QName ? QName(name).localName : name.toString();\n\t\t\tthis._storage[nameAsString] = value;\n\t\t\tif(this._names.indexOf(nameAsString) < 0)\n\t\t\t{\n\t\t\t\tthis._names[this._names.length] = nameAsString;\n\t\t\t}\n\t\t\tthis.fireOnChangeCallback(nameAsString);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride flash_proxy function deleteProperty(name:*):Boolean\n\t\t{\n\t\t\tvar nameAsString:String = name is QName ? QName(name).localName : name.toString();\n\t\t\tvar index:int = this._names.indexOf(nameAsString);\n\t\t\tif(index >= 0)\n\t\t\t{\n\t\t\t\tthis._names.removeAt(index);\n\t\t\t}\n\t\t\tvar result:Boolean = delete this._storage[nameAsString];\n\t\t\tif(result)\n\t\t\t{\n\t\t\t\tthis.fireOnChangeCallback(nameAsString);\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride flash_proxy function nextNameIndex(index:int):int\n\t\t{\n\t\t\tif(index < this._names.length)\n\t\t\t{\n\t\t\t\treturn index + 1;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride flash_proxy function nextName(index:int):String\n\t\t{\n\t\t\treturn this._names[index - 1];\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride flash_proxy function nextValue(index:int):*\n\t\t{\n\t\t\tvar name:* = this._names[index - 1];\n\t\t\treturn this._storage[name];\n\t\t}\n\n\t\t/**\n\t\t * Adds a callback to react to property changes.\n\t\t */\n\t\tpublic function addOnChangeCallback(callback:Function):void\n\t\t{\n\t\t\tthis._onChangeCallbacks[this._onChangeCallbacks.length] = callback;\n\t\t}\n\n\t\t/**\n\t\t * Removes a callback.\n\t\t */\n\t\tpublic function removeOnChangeCallback(callback:Function):void\n\t\t{\n\t\t\tvar index:int = this._onChangeCallbacks.indexOf(callback);\n\t\t\tif(index < 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(index == 0)\n\t\t\t{\n\t\t\t\tthis._onChangeCallbacks.shift();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar lastIndex:int = this._onChangeCallbacks.length - 1;\n\t\t\tif(index == lastIndex)\n\t\t\t{\n\t\t\t\tthis._onChangeCallbacks.pop();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._onChangeCallbacks.removeAt(index);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function toString():String\n\t\t{\n\t\t\tvar result:String = \"[object PropertyProxy\";\n\t\t\tfor(var propertyName:String in this)\n\t\t\t{\n\t\t\t\tresult += \" \" + propertyName;\n\t\t\t}\n\t\t\treturn result + \"]\";\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate function fireOnChangeCallback(forName:String):void\n\t\t{\n\t\t\tvar callbackCount:int = this._onChangeCallbacks.length;\n\t\t\tfor(var i:int = 0; i < callbackCount; i++)\n\t\t\t{\n\t\t\t\tvar callback:Function = this._onChangeCallbacks[i] as Function;\n\t\t\t\tcallback(this, forName);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate function subProxy_onChange(proxy:PropertyProxy, name:String):void\n\t\t{\n\t\t\tthis.fireOnChangeCallback(proxy._subProxyName);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/ToggleGroup.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\timport flash.errors.IllegalOperationError;\n\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\n\t/**\n\t * Dispatched when the selection changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Controls the selection of two or more IToggle instances where only one\n\t * may be selected at a time.\n\t *\n\t * @see IToggle\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class ToggleGroup extends EventDispatcher\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function ToggleGroup()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _items:Vector.<IToggle> = new Vector.<IToggle>;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _ignoreChanges:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isSelectionRequired:Boolean = true;\n\n\t\t/**\n\t\t * Determines if the user can deselect the currently selected item or\n\t\t * not. The selection may always be cleared programmatically by setting\n\t\t * the selected index to <code>-1</code> or the selected item to\n\t\t * <code>null</code>.\n\t\t *\n\t\t * <p>If <code>isSelectionRequired</code> is set to <code>true</code>\n\t\t * and the toggle group has items that were added previously, and there\n\t\t * is no currently selected item, the item at index <code>0</code> will\n\t\t * be selected automatically.</p>\n\t\t *\n\t\t * <p>In the following example, selection is not required:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * group.isSelectionRequired = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic function get isSelectionRequired():Boolean\n\t\t{\n\t\t\treturn this._isSelectionRequired;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isSelectionRequired(value:Boolean):void\n\t\t{\n\t\t\tif(this._isSelectionRequired == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isSelectionRequired = value;\n\t\t\tif(this._isSelectionRequired && this._selectedIndex < 0 && this._items.length > 0)\n\t\t\t{\n\t\t\t\tthis.selectedIndex = 0;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * The currently selected toggle.\n\t\t *\n\t\t * <p>In the following example, the selected item is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * group.selectedItem = radio;</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tpublic function get selectedItem():IToggle\n\t\t{\n\t\t\tif(this._selectedIndex < 0)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn this._items[this._selectedIndex];\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedItem(value:IToggle):void\n\t\t{\n\t\t\tthis.selectedIndex = this._items.indexOf(value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectedIndex:int = -1;\n\n\t\t/**\n\t\t * The index of the currently selected toggle.\n\t\t *\n\t\t * <p>In the following example, the selected index is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * group.selectedIndex = 2;</listing>\n\t\t *\n\t\t * @default -1\n\t\t */\n\t\tpublic function get selectedIndex():int\n\t\t{\n\t\t\treturn this._selectedIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedIndex(value:int):void\n\t\t{\n\t\t\tvar itemCount:int = this._items.length;\n\t\t\tif(value < -1 || value >= itemCount)\n\t\t\t{\n\t\t\t\tthrow new RangeError(\"Index \" + value + \" is out of range \" + itemCount + \" for ToggleGroup.\");\n\t\t\t}\n\t\t\tvar hasChanged:Boolean = this._selectedIndex != value;\n\t\t\tthis._selectedIndex = value;\n\n\t\t\t//refresh all the items\n\t\t\tvar oldIgnoreChanges:Boolean = this._ignoreChanges;\n\t\t\tthis._ignoreChanges = true;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:IToggle = this._items[i];\n\t\t\t\titem.isSelected = i == value;\n\t\t\t}\n\t\t\tthis._ignoreChanges = oldIgnoreChanges;\n\t\t\tif(hasChanged)\n\t\t\t{\n\t\t\t\t//only dispatch if there's been a change. we didn't return\n\t\t\t\t//early because this setter could be called if an item is\n\t\t\t\t//unselected. if selection is required, we need to reselect the\n\t\t\t\t//item (happens below in the item's onChange listener).\n\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * The number of items added to the group.\n\t\t */\n\t\tpublic function get numItems():int\n\t\t{\n\t\t\treturn this._items.length;\n\t\t}\n\n\t\t/**\n\t\t * Adds a toggle to the group. If it is the first item added to the\n\t\t * group, and <code>isSelectionRequired</code> is <code>true</code>, it\n\t\t * will be selected automatically.\n\t\t *\n\t\t * <p>In the following example, an item is added to the toggle group:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * group.addItem( radio );</listing>\n\t\t */\n\t\tpublic function addItem(item:IToggle):void\n\t\t{\n\t\t\tif(!item)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"IToggle passed to ToggleGroup addItem() must not be null.\");\n\t\t\t}\n\n\t\t\tvar index:int = this._items.indexOf(item);\n\t\t\tif(index >= 0)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Cannot add an item to a ToggleGroup more than once.\");\n\t\t\t}\n\t\t\tthis._items.push(item);\n\t\t\tif(this._selectedIndex < 0 && this._isSelectionRequired)\n\t\t\t{\n\t\t\t\tthis.selectedItem = item;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\titem.isSelected = false;\n\t\t\t}\n\t\t\titem.addEventListener(Event.CHANGE, item_changeHandler);\n\n\t\t\tif(item is IGroupedToggle)\n\t\t\t{\n\t\t\t\tIGroupedToggle(item).toggleGroup = this;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Removes a toggle from the group. If the item being removed is\n\t\t * selected and <code>isSelectionRequired</code> is <code>true</code>,\n\t\t * the final item will be selected. If <code>isSelectionRequired</code>\n\t\t * is <code>false</code> instead, no item will be selected.\n\t\t *\n\t\t * <p>In the following example, an item is removed from the toggle group:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * group.removeItem( radio );</listing>\n\t\t */\n\t\tpublic function removeItem(item:IToggle):void\n\t\t{\n\t\t\tvar index:int = this._items.indexOf(item);\n\t\t\tif(index < 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._items.removeAt(index);\n\t\t\titem.removeEventListener(Event.CHANGE, item_changeHandler);\n\t\t\tif(item is IGroupedToggle)\n\t\t\t{\n\t\t\t\tIGroupedToggle(item).toggleGroup = null;\n\t\t\t}\n\t\t\tif(this._selectedIndex > index)\n\t\t\t{\n\t\t\t\t//the same item is selected, but its index has changed.\n\t\t\t\tthis.selectedIndex -= 1;\n\t\t\t}\n\t\t\telse if(this._selectedIndex == index)\n\t\t\t{\n\t\t\t\tif(this._isSelectionRequired)\n\t\t\t\t{\n\t\t\t\t\tvar maxSelectedIndex:int = this._items.length - 1;\n\t\t\t\t\tif(this._selectedIndex > maxSelectedIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\t//we want to keep the same index, if possible, but if\n\t\t\t\t\t\t//we can't because it is too high, we should select the\n\t\t\t\t\t\t//next highest item.\n\t\t\t\t\t\tthis.selectedIndex = maxSelectedIndex;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//we need to manually dispatch the change event because\n\t\t\t\t\t\t//the selected index hasn't changed, but the selected\n\t\t\t\t\t\t//item has changed.\n\t\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//selection isn't required, and we just removed the selected\n\t\t\t\t\t//item, so no item should be selected.\n\t\t\t\t\tthis.selectedIndex = -1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Removes all toggles from the group. No item will be selected.\n\t\t *\n\t\t * <p>In the following example, all items are removed from the toggle group:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * group.removeAllItems();</listing>\n\t\t */\n\t\tpublic function removeAllItems():void\n\t\t{\n\t\t\tvar itemCount:int = this._items.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:IToggle = this._items.shift();\n\t\t\t\titem.removeEventListener(Event.CHANGE, item_changeHandler);\n\t\t\t\tif(item is IGroupedToggle)\n\t\t\t\t{\n\t\t\t\t\tIGroupedToggle(item).toggleGroup = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.selectedIndex = -1;\n\t\t}\n\n\t\t/**\n\t\t * Determines if the group includes the specified item.\n\t\t *\n\t\t * <p>In the following example, we check if an item is in the toggle group:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * if( group.hasItem( radio ) )\n\t\t * {\n\t\t *     // do something\n\t\t * }</listing>\n\t\t */\n\t\tpublic function hasItem(item:IToggle):Boolean\n\t\t{\n\t\t\tvar index:int = this._items.indexOf(item);\n\t\t\treturn index >= 0;\n\t\t}\n\n\t\t/**\n\t\t * Returns the item at the specified index. If the index is out of\n\t\t * range, a <code>RangeError</code> will be thrown.\n\t\t *\n\t\t * <p>In the following example, an item's at a specific index is returned:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var item:IToggle = group.getItemAt( 2 );</listing>\n\t\t *\n\t\t * @see #numItems\n\t\t */\n\t\tpublic function getItemAt(index:int):IToggle\n\t\t{\n\t\t\treturn this._items[index];\n\t\t}\n\n\t\t/**\n\t\t * Returns the index of the specified item. Result will be <code>-1</code>\n\t\t * if the item has not been added to the group.\n\t\t *\n\t\t * <p>In the following example, an item's index is calculated:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var index:int = group.getItemIndex( radio );</listing>\n\t\t */\n\t\tpublic function getItemIndex(item:IToggle):int\n\t\t{\n\t\t\treturn this._items.indexOf(item);\n\t\t}\n\n\t\t/**\n\t\t * Changes the index of a specified item. Throws an <code>ArgumentError</code>\n\t\t * if the specified item hasn't already been added to this group.\n\t\t *\n\t\t * <p>In the following example, an item's index is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * group.setItemIndex( radio, 2 );</listing>\n\t\t */\n\t\tpublic function setItemIndex(item:IToggle, index:int):void\n\t\t{\n\t\t\tvar oldIndex:int = this._items.indexOf(item);\n\t\t\tif(oldIndex < 0)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"Attempting to set index of an item that has not been added to this ToggleGroup.\");\n\t\t\t}\n\t\t\tif(oldIndex == index)\n\t\t\t{\n\t\t\t\t//no change needed\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._items.removeAt(oldIndex);\n\t\t\tthis._items.insertAt(index, item);\n\t\t\tif(this._selectedIndex >= 0)\n\t\t\t{\n\t\t\t\tif(this._selectedIndex == oldIndex)\n\t\t\t\t{\n\t\t\t\t\tthis.selectedIndex = index;\n\t\t\t\t}\n\t\t\t\telse if(oldIndex < this._selectedIndex && index > this._selectedIndex)\n\t\t\t\t{\n\t\t\t\t\tthis.selectedIndex--;\n\t\t\t\t}\n\t\t\t\telse if(oldIndex > this._selectedIndex && index < this._selectedIndex)\n\t\t\t\t{\n\t\t\t\t\tthis.selectedIndex++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function item_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreChanges)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar item:IToggle = IToggle(event.currentTarget);\n\t\t\tvar index:int = this._items.indexOf(item);\n\t\t\tif(item.isSelected || (this._isSelectionRequired && this._selectedIndex == index))\n\t\t\t{\n\t\t\t\t//don't let it deselect the item\n\t\t\t\tthis.selectedIndex = index;\n\t\t\t}\n\t\t\telse if(!item.isSelected)\n\t\t\t{\n\t\t\t\tthis.selectedIndex = -1;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/core/TokenList.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\n\t/**\n\t * Dispatched when a token is added, removed, or toggled or if all tokens\n\t * have been replaced by setting the <code>value</code> property.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * A list of space-delimited tokens. Obviously, since they are delimited by\n\t * spaces, tokens cannot contain spaces.\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class TokenList extends EventDispatcher\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function TokenList()\n\t\t{\n\t\t}\n\n\t\tprotected var _joinedNames:String = null;\n\n\t\t/**\n\t\t * @private\n\t\t * Storage for the tokens.\n\t\t */\n\t\tprotected var names:Vector.<String> = new <String>[];\n\n\t\t/**\n\t\t * The tokens formatted with space delimiters.\n\t\t *\n\t\t * @default \"\"\n\t\t */\n\t\tpublic function get value():String\n\t\t{\n\t\t\tif(this._joinedNames === null)\n\t\t\t{\n\t\t\t\tthis._joinedNames = names.join(\" \");\n\t\t\t}\n\t\t\treturn this._joinedNames;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set value(value:String):void\n\t\t{\n\t\t\tif(this.value == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._joinedNames = value;\n\t\t\tthis.names.length = 0;\n\t\t\tthis.names = Vector.<String>(value.split(\" \"));\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * The number of tokens in the list.\n\t\t */\n\t\tpublic function get length():int\n\t\t{\n\t\t\treturn this.names.length;\n\t\t}\n\n\t\t/**\n\t\t * Returns the token at the specified index, or null, if there is no\n\t\t * token at that index.\n\t\t */\n\t\tpublic function item(index:int):String\n\t\t{\n\t\t\tif(index < 0 || index >= this.names.length)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn this.names[index];\n\t\t}\n\n\t\t/**\n\t\t * Adds a token to the list. If the token already appears in the list,\n\t\t * it will not be added again.\n\t\t */\n\t\tpublic function add(name:String):void\n\t\t{\n\t\t\tvar index:int = this.names.indexOf(name);\n\t\t\tif(index >= 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._joinedNames !== null)\n\t\t\t{\n\t\t\t\tthis._joinedNames += \" \" + name;\n\t\t\t}\n\t\t\tthis.names[this.names.length] = name;\n\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * Removes a token from the list, if the token is in the list. If the\n\t\t * token doesn't appear in the list, this call does nothing.\n\t\t */\n\t\tpublic function remove(name:String):void\n\t\t{\n\t\t\tvar index:int = this.names.indexOf(name);\n\t\t\tthis.removeAt(index);\n\t\t}\n\n\t\t/**\n\t\t * The token is added to the list if it doesn't appear in the list, or\n\t\t * it is removed from the list if it is already in the list.\n\t\t */\n\t\tpublic function toggle(name:String):void\n\t\t{\n\t\t\tvar index:int = this.names.indexOf(name);\n\t\t\tif(index < 0)\n\t\t\t{\n\t\t\t\tif(this._joinedNames !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._joinedNames += \" \" + name;\n\t\t\t\t}\n\t\t\t\tthis.names[this.names.length] = name;\n\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.removeAt(index);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Determines if the specified token is in the list.\n\t\t */\n\t\tpublic function contains(name:String):Boolean\n\t\t{\n\t\t\treturn this.names.indexOf(name) >= 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function removeAt(index:int):void\n\t\t{\n\t\t\tif(index < 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._joinedNames = null;\n\t\t\tthis.names.removeAt(index);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/ToolTipManager.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\timport flash.utils.Dictionary;\n\n\timport starling.display.DisplayObjectContainer;\n\timport starling.display.Stage;\n\n\t/**\n\t * Manages tool tips. Should not be enabled on touch screens, since\n\t * TouchPhase.HOVER is not dispatched for touches.\n\t *\n\t * @see ../../../help/tool-tips.html Tool tips in Feathers\n\t * @see feathers.core.FeathersControl#toolTip\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class ToolTipManager\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const STAGE_TO_MANAGER:Dictionary = new Dictionary(true);\n\n\t\t/**\n\t\t * Returns the active tool tip manager for the specified Starling stage.\n\t\t * May return <code>null</code> if tool tip management has not been\n\t\t * enabled for the specified stage.\n\t\t *\n\t\t * @see #isEnabledForStage()\n\t\t * @see #setEnabledForStage()\n\t\t */\n\t\tpublic static function getToolTipManagerForStage(stage:Stage):IToolTipManager\n\t\t{\n\t\t\treturn IToolTipManager(STAGE_TO_MANAGER[stage]);\n\t\t}\n\n\t\t/**\n\t\t * The default factory that creates a tool tip manager.\n\t\t *\n\t\t * @see #toolTipManagerFactory\n\t\t * @see feathers.core.DefaultToolTipManager\n\t\t */\n\t\tpublic static function defaultToolTipManagerFactory(root:DisplayObjectContainer):IToolTipManager\n\t\t{\n\t\t\treturn new DefaultToolTipManager(root);\n\t\t}\n\n\t\t/**\n\t\t * A function that creates a tool tip manager.\n\t\t *\n\t\t * <p>This function is expected to have the following signature:</p>\n\t\t * <pre>function():IToolTipManager</pre>\n\t\t *\n\t\t * <p>In the following example, the tool tip manager factory is modified:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * ToolTipManager.toolTipManagerFactory = function(root:DisplayObjectContainer):IToolTipManager\n\t\t * {\n\t\t *     return new CustomToolTipManager(); //a custom class that implements IToolTipManager\n\t\t * };</listing>\n\t\t *\n\t\t * @see feathers.core.IToolTipManager\n\t\t */\n\t\tpublic static var toolTipManagerFactory:Function = defaultToolTipManagerFactory;\n\n\t\t/**\n\t\t * Determines if the tool tip manager is enabled or disabled for the\n\t\t * specified Starling stage.\n\t\t *\n\t\t * @see #setEnabledForStage()\n\t\t * @see #getToolTipManagerForStage()\n\t\t */\n\t\tpublic static function isEnabledForStage(stage:Stage):Boolean\n\t\t{\n\t\t\treturn IToolTipManager(STAGE_TO_MANAGER[stage]) !== null;\n\t\t}\n\n\t\t/**\n\t\t * Enables or disables toll tip management on the specified Starling\n\t\t * stage. For mobile apps, the tool tip manager should generally remain\n\t\t * disabled. For desktop apps, it is recommended to enable the tool tip\n\t\t * manager.\n\t\t *\n\t\t * <p>In the following example, tool tip management is enabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * ToolTipManager.setEnabledForStage(stage, true);</listing>\n\t\t *\n\t\t * @see #isEnabledForStage()\n\t\t * @see #getToolTipManagerForStage()\n\t\t */\n\t\tpublic static function setEnabledForStage(stage:Stage, isEnabled:Boolean):void\n\t\t{\n\t\t\tvar manager:IToolTipManager = IToolTipManager(STAGE_TO_MANAGER[stage]);\n\t\t\tif((isEnabled && manager) || (!isEnabled && !manager))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(isEnabled)\n\t\t\t{\n\t\t\t\tSTAGE_TO_MANAGER[stage] = toolTipManagerFactory(stage);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmanager.dispose();\n\t\t\t\tdelete STAGE_TO_MANAGER[stage];\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Disables tool tip management on all stages where it has previously\n\t\t * been enabled.\n\t\t */\n\t\tpublic function disableAll():void\n\t\t{\n\t\t\tfor(var key:Object in STAGE_TO_MANAGER)\n\t\t\t{\n\t\t\t\tvar stage:Stage = Stage(key);\n\t\t\t\tvar manager:IToolTipManager = IToolTipManager(STAGE_TO_MANAGER[stage]);\n\t\t\t\tmanager.dispose();\n\t\t\t\tdelete STAGE_TO_MANAGER[stage];\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/core/ValidationQueue.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.core\n{\n\timport flash.utils.Dictionary;\n\n\timport starling.animation.IAnimatable;\n\timport starling.core.Starling;\n\n\t[ExcludeClass]\n\t/**\n\t * @private\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic final class ValidationQueue implements IAnimatable\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const STARLING_TO_VALIDATION_QUEUE:Dictionary = new Dictionary(true);\n\n\t\t/**\n\t\t * Gets the validation queue for the specified Starling instance. If\n\t\t * a validation queue does not exist for the specified Starling\n\t\t * instance, a new one will be created.\n\t\t */\n\t\tpublic static function forStarling(starling:Starling):ValidationQueue\n\t\t{\n\t\t\tif(!starling)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tvar queue:ValidationQueue = STARLING_TO_VALIDATION_QUEUE[starling];\n\t\t\tif(!queue)\n\t\t\t{\n\t\t\t\tSTARLING_TO_VALIDATION_QUEUE[starling] = queue = new ValidationQueue(starling);\n\t\t\t}\n\t\t\treturn queue;\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function ValidationQueue(starling:Starling)\n\t\t{\n\t\t\tthis._starling = starling;\n\t\t}\n\n\t\tprivate var _starling:Starling;\n\n\t\tprivate var _isValidating:Boolean = false;\n\n\t\t/**\n\t\t * If true, the queue is currently validating.\n\t\t *\n\t\t * <p>In the following example, we check if the queue is currently validating:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * if( queue.isValidating )\n\t\t * {\n\t\t *     // do something\n\t\t * }</listing>\n\t\t */\n\t\tpublic function get isValidating():Boolean\n\t\t{\n\t\t\treturn this._isValidating;\n\t\t}\n\n\t\tprivate var _queue:Vector.<IValidating> = new <IValidating>[];\n\n\t\t/**\n\t\t * Disposes the validation queue.\n\t\t */\n\t\tpublic function dispose():void\n\t\t{\n\t\t\tif(this._starling)\n\t\t\t{\n\t\t\t\tthis._starling.juggler.remove(this);\n\t\t\t\tthis._starling = null;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Adds a validating component to the queue.\n\t\t */\n\t\tpublic function addControl(control:IValidating):void\n\t\t{\n\t\t\t//if the juggler was purged, we need to add the queue back in.\n\t\t\tif(!this._starling.juggler.contains(this))\n\t\t\t{\n\t\t\t\tthis._starling.juggler.add(this);\n\t\t\t}\n\t\t\tif(this._queue.indexOf(control) >= 0)\n\t\t\t{\n\t\t\t\t//already queued\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar queueLength:int = this._queue.length;\n\t\t\tif(this._isValidating)\n\t\t\t{\n\t\t\t\t//special case: we need to keep it sorted\n\t\t\t\tvar depth:int = control.depth;\n\n\t\t\t\t//we're traversing the queue backwards because it's\n\t\t\t\t//significantly more likely that we're going to push than that\n\t\t\t\t//we're going to splice, so there's no point to iterating over\n\t\t\t\t//the whole queue\n\t\t\t\tfor(var i:int = queueLength - 1; i >= 0; i--)\n\t\t\t\t{\n\t\t\t\t\tvar otherControl:IValidating = IValidating(this._queue[i]);\n\t\t\t\t\tvar otherDepth:int = otherControl.depth;\n\t\t\t\t\t//we can skip the overhead of calling queueSortFunction and\n\t\t\t\t\t//of looking up the value we've already stored in the depth\n\t\t\t\t\t//local variable.\n\t\t\t\t\tif(depth >= otherDepth)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//add one because we're going after the last item we checked\n\t\t\t\t//if we made it through all of them, i will be -1, and we want 0\n\t\t\t\ti++;\n\t\t\t\tthis._queue.insertAt(i, control);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//faster than push() because push() creates a temporary rest\n\t\t\t\t//Array that needs to be garbage collected\n\t\t\t\tthis._queue[queueLength] = control;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function advanceTime(time:Number):void\n\t\t{\n\t\t\tif(this._isValidating || !this._starling.contextValid)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar queueLength:int = this._queue.length;\n\t\t\tif(queueLength == 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isValidating = true;\n\t\t\tif(queueLength > 1)\n\t\t\t{\n\t\t\t\t//only sort if there's more than one item in the queue because\n\t\t\t\t//it will avoid allocating objects\n\t\t\t\tthis._queue = this._queue.sort(queueSortFunction);\n\t\t\t}\n\t\t\t//rechecking length every time because addControl() might have added\n\t\t\t//a new item during the last validation.\n\t\t\t//we could use an int and check the length again at the end of the\n\t\t\t//loop, but there is little difference in performance, even with\n\t\t\t//millions of items in queue.\n\t\t\twhile(this._queue.length > 0)\n\t\t\t{\n\t\t\t\tvar item:IValidating = this._queue.shift();\n\t\t\t\tif(item.depth < 0)\n\t\t\t\t{\n\t\t\t\t\t//skip items that are no longer on the display list\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\titem.validate();\n\t\t\t}\n\t\t\tthis._isValidating = false;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * This is a static constant to avoid a MethodClosure allocation on iOS\n\t\t */\n\t\tprotected static const queueSortFunction:Function = function(first:IValidating, second:IValidating):int\n\t\t{\n\t\t\tvar difference:int = second.depth - first.depth;\n\t\t\tif(difference > 0)\n\t\t\t{\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\telse if(difference < 0)\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn 0;\n\t\t};\n\t}\n}\n"
  },
  {
    "path": "source/feathers/data/ArrayChildrenHierarchicalCollectionDataDescriptor.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.data\n{\n\t/**\n\t * A hierarchical data descriptor where children are defined as arrays in a\n\t * property defined on each branch. The property name defaults to <code>\"children\"</code>,\n\t * but it may be customized.\n\t *\n\t * <p>The basic structure of the data source takes the following form. The\n\t * root must always be an Array.</p>\n\t * <pre>\n\t * [\n\t *     {\n\t *         text: \"Branch 1\",\n\t *         children:\n\t *         [\n\t *             { text: \"Child 1-1\" },\n\t *             { text: \"Child 1-2\" }\n\t *         ]\n\t *     },\n\t *     {\n\t *         text: \"Branch 2\",\n\t *         children:\n\t *         [\n\t *             { text: \"Child 2-1\" },\n\t *             { text: \"Child 2-2\" },\n\t *             { text: \"Child 2-3\" }\n\t *         ]\n\t *     }\n\t * ]</pre>\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class ArrayChildrenHierarchicalCollectionDataDescriptor implements IHierarchicalCollectionDataDescriptor\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function ArrayChildrenHierarchicalCollectionDataDescriptor()\n\t\t{\n\t\t}\n\n\t\t/**\n\t\t * The field used to access the Array of a branch's children.\n\t\t */\n\t\tpublic var childrenField:String = \"children\";\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getLength(data:Object, ...rest:Array):int\n\t\t{\n\t\t\tvar branch:Array = data as Array;\n\t\t\tvar indexCount:int = rest.length;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tvar index:int = rest[i] as int;\n\t\t\t\tbranch = branch[index][childrenField] as Array;\n\t\t\t}\n\n\t\t\treturn branch.length;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getLengthAtLocation(data:Object, location:Vector.<int> = null):int\n\t\t{\n\t\t\tvar branch:Array = data as Array;\n\t\t\tif(location !== null)\n\t\t\t{\n\t\t\t\tvar indexCount:int = location.length;\n\t\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar index:int = location[i];\n\t\t\t\t\tbranch = branch[index][childrenField] as Array;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn branch.length;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getItemAt(data:Object, index:int, ...rest:Array):Object\n\t\t{\n\t\t\trest.insertAt(0, index);\n\t\t\tvar branch:Array = data as Array;\n\t\t\tvar indexCount:int = rest.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tindex = rest[i] as int;\n\t\t\t\tbranch = branch[index][childrenField] as Array;\n\t\t\t}\n\t\t\tvar lastIndex:int = rest[indexCount] as int;\n\t\t\treturn branch[lastIndex];\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getItemAtLocation(data:Object, location:Vector.<int>):Object\n\t\t{\n\t\t\tif(location === null || location.length == 0)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tvar branch:Array = data as Array;\n\t\t\tvar indexCount:int = location.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tvar index:int = location[i];\n\t\t\t\tbranch = branch[index][childrenField] as Array;\n\t\t\t\tif(branch === null)\n\t\t\t\t{\n\t\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + location);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar lastIndex:int = location[indexCount];\n\t\t\treturn branch[lastIndex];\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function setItemAt(data:Object, item:Object, index:int, ...rest:Array):void\n\t\t{\n\t\t\trest.insertAt(0, index);\n\t\t\tvar branch:Array = data as Array;\n\t\t\tvar indexCount:int = rest.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tindex = rest[i] as int;\n\t\t\t\tbranch = branch[index][childrenField] as Array;\n\t\t\t}\n\t\t\tvar lastIndex:int = rest[indexCount] as int;\n\t\t\tbranch[lastIndex] = item;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function setItemAtLocation(data:Object, item:Object, location:Vector.<int>):void\n\t\t{\n\t\t\tif(location === null || location.length == 0)\n\t\t\t{\n\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + location);\n\t\t\t}\n\t\t\tvar branch:Array = data as Array;\n\t\t\tvar indexCount:int = location.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tvar index:int = location[i];\n\t\t\t\tbranch = branch[index][childrenField] as Array;\n\t\t\t\tif(branch === null)\n\t\t\t\t{\n\t\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + location);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar lastIndex:int = location[indexCount];\n\t\t\tbranch[lastIndex] = item;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function addItemAt(data:Object, item:Object, index:int, ...rest:Array):void\n\t\t{\n\t\t\trest.insertAt(0, index);\n\t\t\tvar branch:Array = data as Array;\n\t\t\tvar indexCount:int = rest.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tindex = rest[i] as int;\n\t\t\t\tbranch = branch[index][childrenField] as Array;\n\t\t\t}\n\t\t\tvar lastIndex:int = rest[indexCount] as int;\n\t\t\tbranch.insertAt(lastIndex, item);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function addItemAtLocation(data:Object, item:Object, location:Vector.<int>):void\n\t\t{\n\t\t\tif(location === null || location.length == 0)\n\t\t\t{\n\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + location);\n\t\t\t}\n\t\t\tvar branch:Array = data as Array;\n\t\t\tvar indexCount:int = location.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tvar index:int = location[i];\n\t\t\t\tbranch = branch[index][childrenField] as Array;\n\t\t\t\tif(branch === null)\n\t\t\t\t{\n\t\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + location);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar lastIndex:int = location[indexCount];\n\t\t\tbranch.insertAt(lastIndex, item);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function removeItemAt(data:Object, index:int, ...rest:Array):Object\n\t\t{\n\t\t\trest.insertAt(0, index);\n\t\t\tvar branch:Array = data as Array;\n\t\t\tvar indexCount:int = rest.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tindex = rest[i] as int;\n\t\t\t\tbranch = branch[index][childrenField] as Array;\n\t\t\t}\n\t\t\tvar lastIndex:int = rest[indexCount] as int;\n\t\t\treturn branch.removeAt(lastIndex);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function removeItemAtLocation(data:Object, location:Vector.<int>):Object\n\t\t{\n\t\t\tif(location === null || location.length == 0)\n\t\t\t{\n\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + location);\n\t\t\t}\n\t\t\tvar branch:Array = data as Array;\n\t\t\tvar indexCount:int = location.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tvar index:int = location[i];\n\t\t\t\tbranch = branch[index][childrenField] as Array;\n\t\t\t\tif(branch === null)\n\t\t\t\t{\n\t\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + location);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar lastIndex:int = location[indexCount];\n\t\t\treturn branch.removeAt(lastIndex);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function removeAll(data:Object):void\n\t\t{\n\t\t\tvar branch:Array = data as Array;\n\t\t\tbranch.length = 0;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getItemLocation(data:Object, item:Object, result:Vector.<int> = null, ...rest:Array):Vector.<int>\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new <int>[];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult.length = 0;\n\t\t\t}\n\t\t\tvar branch:Array = data as Array;\n\t\t\tvar restCount:int = rest.length;\n\t\t\tfor(var i:int = 0; i < restCount; i++)\n\t\t\t{\n\t\t\t\tvar index:int = rest[i] as int;\n\t\t\t\tresult[i] = index;\n\t\t\t\tbranch = branch[index][childrenField] as Array;\n\t\t\t}\n\n\t\t\tvar isFound:Boolean = this.findItemInBranch(branch, item, result);\n\t\t\tif(!isFound)\n\t\t\t{\n\t\t\t\tresult.length = 0;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function isBranch(node:Object):Boolean\n\t\t{\n\t\t\tif(node === null)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn node.hasOwnProperty(this.childrenField) && node[this.childrenField] is Array;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function findItemInBranch(branch:Array, item:Object, result:Vector.<int>):Boolean\n\t\t{\n\t\t\tvar index:int = branch.indexOf(item);\n\t\t\tif(index >= 0)\n\t\t\t{\n\t\t\t\tresult.push(index);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tvar branchLength:int = branch.length;\n\t\t\tfor(var i:int = 0; i < branchLength; i++)\n\t\t\t{\n\t\t\t\tvar branchItem:Object = branch[i];\n\t\t\t\tif(this.isBranch(branchItem))\n\t\t\t\t{\n\t\t\t\t\tresult.push(i);\n\t\t\t\t\tvar isFound:Boolean = this.findItemInBranch(branchItem[childrenField] as Array, item, result);\n\t\t\t\t\tif(isFound)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tresult.pop();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/data/ArrayCollection.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.data\n{\n\timport feathers.events.CollectionEventType;\n\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\n\t[Exclude(name=\"data\",kind=\"property\")]\n\n\t/**\n\t * Dispatched when the underlying data source changes and components will\n\t * need to redraw the data.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the collection has changed drastically, such as when\n\t * the underlying data source is replaced completely.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.RESET\n\t */\n\t[Event(name=\"reset\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is added to the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index of the item that has been\n\t * added. It is of type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.ADD_ITEM\n\t */\n\t[Event(name=\"addItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is removed from the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index of the item that has been\n\t * removed. It is of type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.REMOVE_ITEM\n\t */\n\t[Event(name=\"removeItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is replaced in the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index of the item that has been\n\t * replaced. It is of type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.REPLACE_ITEM\n\t */\n\t[Event(name=\"replaceItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>updateItemAt()</code> function is called on the\n\t * <code>ListCollection</code>.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index of the item that has been\n\t * updated. It is of type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #updateItemAt()\n\t *\n\t * @eventType feathers.events.CollectionEventType.UPDATE_ITEM\n\t */\n\t[Event(name=\"updateItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>updateAll()</code> function is called on the\n\t * <code>ListCollection</code>.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #updateAll()\n\t *\n\t * @eventType feathers.events.CollectionEventType.UPDATE_ALL\n\t */\n\t[Event(name=\"updateAll\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>filterFunction</code> property changes or the\n\t * <code>refresh()</code> function is called on the <code>IListCollection</code>.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #filterFunction\n\t * @see #refresh()\n\t *\n\t * @eventType feathers.events.CollectionEventType.FILTER_CHANGE\n\t */\n\t[Event(name=\"filterChange\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>sortCompareFunction</code> property changes or\n\t * the <code>refresh()</code> function is called on the <code>IListCollection</code>.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #sortCompareFunction\n\t * @see #refresh()\n\t *\n\t * @eventType feathers.events.CollectionEventType.SORT_CHANGE\n\t */\n\t[Event(name=\"sortChange\",type=\"starling.events.Event\")]\n\n\t/**\n\t *\n\t * Wraps an <code>Array</code> in the common <code>IListCollection</code>\n\t * API used by many Feathers UI controls, including <code>List</code> and\n\t * <code>TabBar</code>.\n\t *\n\t * @productversion Feathers 3.3.0\n\t */\n\tpublic class ArrayCollection extends EventDispatcher implements IListCollection\n\t{\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function ArrayCollection(data:Array = null)\n\t\t{\n\t\t\tif(data === null)\n\t\t\t{\n\t\t\t\tdata = [];\n\t\t\t}\n\t\t\tthis._arrayData = data;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _filterAndSortData:Array;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _arrayData:Array;\n\n\t\t/**\n\t\t * The <code>Array</code> data source for this collection.\n\t\t */\n\t\tpublic function get arrayData():Array\n\t\t{\n\t\t\treturn this._arrayData;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set arrayData(value:Array):void\n\t\t{\n\t\t\tif(this._arrayData === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._arrayData = value;\n\t\t\tthis.dispatchEventWith(CollectionEventType.RESET);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _pendingRefresh:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _filterFunction:Function = null;\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#filterFunction\n\t\t */\n\t\tpublic function get filterFunction():Function\n\t\t{\n\t\t\treturn this._filterFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set filterFunction(value:Function):void\n\t\t{\n\t\t\tif(this._filterFunction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._filterFunction = value;\n\t\t\tthis._pendingRefresh = true;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tthis.dispatchEventWith(CollectionEventType.FILTER_CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _sortCompareFunction:Function = null;\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#sortCompareFunction\n\t\t */\n\t\tpublic function get sortCompareFunction():Function\n\t\t{\n\t\t\treturn this._sortCompareFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set sortCompareFunction(value:Function):void\n\t\t{\n\t\t\tif(this._sortCompareFunction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._sortCompareFunction = value;\n\t\t\tthis._pendingRefresh = true;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tthis.dispatchEventWith(CollectionEventType.SORT_CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#length\n\t\t */\n\t\tpublic function get length():int\n\t\t{\n\t\t\tif(this._pendingRefresh)\n\t\t\t{\n\t\t\t\tthis.refreshFilterAndSort();\n\t\t\t}\n\t\t\tif(this._filterAndSortData !== null)\n\t\t\t{\n\t\t\t\treturn this._filterAndSortData.length;\n\t\t\t}\n\t\t\treturn this._arrayData.length;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#refresh()\n\t\t */\n\t\tpublic function refresh():void\n\t\t{\n\t\t\tif(this._filterFunction === null && this._sortCompareFunction === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._pendingRefresh = true;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tif(this._filterFunction !== null)\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(CollectionEventType.FILTER_CHANGE);\n\t\t\t}\n\t\t\tif(this._sortCompareFunction !== null)\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(CollectionEventType.SORT_CHANGE);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshFilterAndSort():void\n\t\t{\n\t\t\tthis._pendingRefresh = false;\n\t\t\tif(this._filterFunction !== null)\n\t\t\t{\n\t\t\t\tvar result:Array = this._filterAndSortData;\n\t\t\t\tif(result !== null)\n\t\t\t\t{\n\t\t\t\t\t//reuse the old array to avoid garbage collection\n\t\t\t\t\tresult.length = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tresult = [];\n\t\t\t\t}\n\t\t\t\tvar itemCount:int = this._arrayData.length;\n\t\t\t\tvar pushIndex:int = 0;\n\t\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar item:Object = this._arrayData[i];\n\t\t\t\t\tif(this._filterFunction(item))\n\t\t\t\t\t{\n\t\t\t\t\t\tresult[pushIndex] = item;\n\t\t\t\t\t\tpushIndex++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis._filterAndSortData = result;\n\t\t\t}\n\t\t\telse if(this._sortCompareFunction !== null) //no filter\n\t\t\t{\n\t\t\t\titemCount = this._arrayData.length;\n\t\t\t\tresult = this._filterAndSortData;\n\t\t\t\tif(result !== null)\n\t\t\t\t{\n\t\t\t\t\tresult.length = itemCount;\n\t\t\t\t\tfor(i = 0; i < itemCount; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tresult[i] = this._arrayData[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//simply make a copy!\n\t\t\t\t\tresult = this._arrayData.slice();\n\t\t\t\t}\n\t\t\t\tthis._filterAndSortData = result;\n\t\t\t}\n\t\t\telse //no filter or sort\n\t\t\t{\n\t\t\t\tthis._filterAndSortData = null;\n\t\t\t}\n\t\t\tif(this._sortCompareFunction !== null)\n\t\t\t{\n\t\t\t\tthis._filterAndSortData.sort(this._sortCompareFunction);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#updateItemAt()\n\t\t *\n\t\t * @see #updateAll()\n\t\t */\n\t\tpublic function updateItemAt(index:int):void\n\t\t{\n\t\t\tthis.dispatchEventWith(CollectionEventType.UPDATE_ITEM, false, index);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#updateAll()\n\t\t *\n\t\t * @see #updateItemAt()\n\t\t */\n\t\tpublic function updateAll():void\n\t\t{\n\t\t\tthis.dispatchEventWith(CollectionEventType.UPDATE_ALL);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#getItemAt()\n\t\t */\n\t\tpublic function getItemAt(index:int):Object\n\t\t{\n\t\t\tif(this._pendingRefresh)\n\t\t\t{\n\t\t\t\tthis.refreshFilterAndSort();\n\t\t\t}\n\t\t\tif(this._filterAndSortData !== null)\n\t\t\t{\n\t\t\t\treturn this._filterAndSortData[index];\n\t\t\t}\n\t\t\treturn this._arrayData[index];\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#getItemIndex()\n\t\t */\n\t\tpublic function getItemIndex(item:Object):int\n\t\t{\n\t\t\tif(this._pendingRefresh)\n\t\t\t{\n\t\t\t\tthis.refreshFilterAndSort();\n\t\t\t}\n\t\t\tif(this._filterAndSortData !== null)\n\t\t\t{\n\t\t\t\treturn this._filterAndSortData.indexOf(item);\n\t\t\t}\n\t\t\treturn this._arrayData.indexOf(item);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#addItemAt()\n\t\t */\n\t\tpublic function addItemAt(item:Object, index:int):void\n\t\t{\n\t\t\tif(this._pendingRefresh)\n\t\t\t{\n\t\t\t\tthis.refreshFilterAndSort();\n\t\t\t}\n\t\t\tif(this._filterAndSortData !== null)\n\t\t\t{\n\t\t\t\tif(index < this._filterAndSortData.length)\n\t\t\t\t{\n\t\t\t\t\t//find the item at the index in the filtered data, and use\n\t\t\t\t\t//its index from the unfiltered data\n\t\t\t\t\tvar oldItem:Object = this._filterAndSortData[index];\n\t\t\t\t\tvar unfilteredIndex:int = this._arrayData.indexOf(oldItem);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//if the item is added at the end of the filtered data\n\t\t\t\t\t//then add it at the end of the unfiltered data\n\t\t\t\t\tunfilteredIndex = this._arrayData.length;\n\t\t\t\t}\n\t\t\t\t//always add to the original data\n\t\t\t\tthis._arrayData.insertAt(unfilteredIndex, item);\n\t\t\t\t//but check if the item should be in the filtered data\n\t\t\t\tvar includeItem:Boolean = true;\n\t\t\t\tif(this._filterFunction !== null)\n\t\t\t\t{\n\t\t\t\t\tincludeItem = this._filterFunction(item);\n\t\t\t\t}\n\t\t\t\tif(includeItem)\n\t\t\t\t{\n\t\t\t\t\tvar sortedIndex:int = index;\n\t\t\t\t\tif(this._sortCompareFunction !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tsortedIndex = this.getSortedInsertionIndex(item);\n\t\t\t\t\t}\n\t\t\t\t\tthis._filterAndSortData.insertAt(sortedIndex, item);\n\t\t\t\t\t//don't dispatch these events if the item is filtered!\n\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\tthis.dispatchEventWith(CollectionEventType.ADD_ITEM, false, sortedIndex);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //no filter or sort\n\t\t\t{\n\t\t\t\tthis._arrayData.insertAt(index, item);\n\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\tthis.dispatchEventWith(CollectionEventType.ADD_ITEM, false, index);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#removeItemAt()\n\t\t */\n\t\tpublic function removeItemAt(index:int):Object\n\t\t{\n\t\t\tif(this._pendingRefresh)\n\t\t\t{\n\t\t\t\tthis.refreshFilterAndSort();\n\t\t\t}\n\t\t\tif(this._filterAndSortData !== null)\n\t\t\t{\n\t\t\t\tvar item:Object = this._filterAndSortData.removeAt(index);\n\t\t\t\tvar unfilteredIndex:int = this._arrayData.indexOf(item);\n\t\t\t\tthis._arrayData.removeAt(unfilteredIndex);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\titem = this._arrayData.removeAt(index);\n\t\t\t}\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tthis.dispatchEventWith(CollectionEventType.REMOVE_ITEM, false, index);\n\t\t\treturn item;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#removeItem()\n\t\t */\n\t\tpublic function removeItem(item:Object):void\n\t\t{\n\t\t\tvar index:int = this.getItemIndex(item);\n\t\t\tif(index >= 0)\n\t\t\t{\n\t\t\t\tthis.removeItemAt(index);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#removeAll()\n\t\t */\n\t\tpublic function removeAll():void\n\t\t{\n\t\t\tif(this._pendingRefresh)\n\t\t\t{\n\t\t\t\tthis.refreshFilterAndSort();\n\t\t\t}\n\t\t\tif(this.length == 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._filterAndSortData !== null)\n\t\t\t{\n\t\t\t\tthis._filterAndSortData.length = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._arrayData.length = 0;\n\t\t\t}\n\t\t\tthis.dispatchEventWith(CollectionEventType.REMOVE_ALL);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#setItemAt()\n\t\t */\n\t\tpublic function setItemAt(item:Object, index:int):void\n\t\t{\n\t\t\tif(this._pendingRefresh)\n\t\t\t{\n\t\t\t\tthis.refreshFilterAndSort();\n\t\t\t}\n\t\t\tif(this._filterAndSortData !== null)\n\t\t\t{\n\t\t\t\tvar oldItem:Object = this._filterAndSortData[index];\n\t\t\t\tvar unfilteredIndex:int = this._arrayData.indexOf(oldItem);\n\t\t\t\tthis._arrayData[unfilteredIndex] = item;\n\t\t\t\tif(this._filterFunction !== null)\n\t\t\t\t{\n\t\t\t\t\tvar includeItem:Boolean = this._filterFunction(item);\n\t\t\t\t\tif(includeItem)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._filterAndSortData[index] = item;\n\t\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\t\tthis.dispatchEventWith(CollectionEventType.REPLACE_ITEM, false, index);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//if the item is excluded, the item at this index is\n\t\t\t\t\t\t//removed instead of being replaced by the new item\n\t\t\t\t\t\tthis._filterAndSortData.removeAt(index);\n\t\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\t\tthis.dispatchEventWith(CollectionEventType.REMOVE_ITEM, false, index);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(this._sortCompareFunction !== null)\n\t\t\t\t{\n\t\t\t\t\t//remove the old item first!\n\t\t\t\t\tthis._filterAndSortData.removeAt(index);\n\t\t\t\t\t//then try to figure out where the new item goes when inserted\n\t\t\t\t\tvar sortedIndex:int = this.getSortedInsertionIndex(item);\n\t\t\t\t\tthis._filterAndSortData[sortedIndex] = item;\n\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\tthis.dispatchEventWith(CollectionEventType.REPLACE_ITEM, false, index);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //no filter or sort\n\t\t\t{\n\t\t\t\tthis._arrayData[index] = item;\n\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\tthis.dispatchEventWith(CollectionEventType.REPLACE_ITEM, false, index);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#addItem()\n\t\t */\n\t\tpublic function addItem(item:Object):void\n\t\t{\n\t\t\tthis.addItemAt(item, this.length);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#push()\n\t\t *\n\t\t * @see #addItem()\n\t\t */\n\t\tpublic function push(item:Object):void\n\t\t{\n\t\t\tthis.addItemAt(item, this.length);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#addAll()\n\t\t */\n\t\tpublic function addAll(collection:IListCollection):void\n\t\t{\n\t\t\tvar otherCollectionLength:int = collection.length;\n\t\t\tvar pushIndex:int = this._arrayData.length;\n\t\t\tfor(var i:int = 0; i < otherCollectionLength; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = collection.getItemAt(i);\n\t\t\t\tthis._arrayData[pushIndex] = item;\n\t\t\t\tpushIndex++;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#addAllAt()\n\t\t */\n\t\tpublic function addAllAt(collection:IListCollection, index:int):void\n\t\t{\n\t\t\tvar otherCollectionLength:int = collection.length;\n\t\t\tvar currentIndex:int = index;\n\t\t\tfor(var i:int = 0; i < otherCollectionLength; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = collection.getItemAt(i);\n\t\t\t\tthis._arrayData.insertAt(currentIndex, item);\n\t\t\t\tcurrentIndex++;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#reset()\n\t\t */\n\t\tpublic function reset(collection:IListCollection):void\n\t\t{\n\t\t\tthis._arrayData.length = 0;\n\t\t\tvar otherCollectionLength:int = collection.length;\n\t\t\tfor(var i:int = 0; i < otherCollectionLength; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = collection.getItemAt(i);\n\t\t\t\tthis._arrayData[i] = item;\n\t\t\t}\n\t\t\tthis.dispatchEventWith(CollectionEventType.RESET);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#pop()\n\t\t */\n\t\tpublic function pop():Object\n\t\t{\n\t\t\treturn this.removeItemAt(this.length - 1);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#unshift()\n\t\t */\n\t\tpublic function unshift(item:Object):void\n\t\t{\n\t\t\tthis.addItemAt(item, 0);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#shift()\n\t\t */\n\t\tpublic function shift():Object\n\t\t{\n\t\t\treturn this.removeItemAt(0);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#contains()\n\t\t */\n\t\tpublic function contains(item:Object):Boolean\n\t\t{\n\t\t\treturn this._arrayData.indexOf(item) != -1;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#dispose()\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#dispose() starling.display.DisplayObject.dispose()\n\t\t * @see http://doc.starling-framework.org/core/starling/textures/Texture.html#dispose() starling.textures.Texture.dispose()\n\t\t */\n\t\tpublic function dispose(disposeItem:Function):void\n\t\t{\n\t\t\t//if we're disposing the collection, filters don't matter anymore,\n\t\t\t//and we should ensure that all items are disposed.\n\t\t\tthis._filterFunction = null;\n\t\t\tthis.refreshFilterAndSort();\n\n\t\t\tvar itemCount:int = this._arrayData.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = this._arrayData[i];\n\t\t\t\tdisposeItem(item);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getSortedInsertionIndex(item:Object):int\n\t\t{\n\t\t\tvar itemCount:int = this._filterAndSortData.length;\n\t\t\tif(this._sortCompareFunction === null)\n\t\t\t{\n\t\t\t\treturn itemCount;\n\t\t\t}\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar otherItem:Object = this._filterAndSortData[i];\n\t\t\t\tvar result:int = this._sortCompareFunction(item, otherItem);\n\t\t\t\tif(result < 1)\n\t\t\t\t{\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn itemCount;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/data/ArrayHierarchicalCollection.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.data\n{\n\timport feathers.events.CollectionEventType;\n\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\n\t/**\n\t * Dispatched when the underlying data source changes and components will\n\t * need to redraw the data.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the collection has changed drastically, such as when\n\t * the underlying data source is replaced completely.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.RESET\n\t */\n\t[Event(name=\"reset\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is added to the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index path of the item that has\n\t * been added. It is of type <code>Array</code> and contains objects of\n\t * type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.ADD_ITEM\n\t */\n\t[Event(name=\"addItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is removed from the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index path of the item that has\n\t * been removed. It is of type <code>Array</code> and contains objects of\n\t * type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.REMOVE_ITEM\n\t */\n\t[Event(name=\"removeItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is replaced in the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index path of the item that has\n\t * been replaced. It is of type <code>Array</code> and contains objects of\n\t * type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.REPLACE_ITEM\n\t */\n\t[Event(name=\"replaceItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>updateItemAt()</code> function is called on the\n\t * hierarchical collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index path of the item that has\n\t * been updated. It is of type <code>Array</code> and contains objects of\n\t * type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #updateItemAt()\n\t *\n\t * @eventType feathers.events.CollectionEventType.UPDATE_ITEM\n\t */\n\t[Event(name=\"updateItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>updateAll()</code> function is called on the\n\t * hierarchical collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #updateAll()\n\t *\n\t * @eventType feathers.events.CollectionEventType.UPDATE_ALL\n\t */\n\t[Event(name=\"updateAll\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Wraps an <code>Array</code> data source with a common API for use with\n\t * UI controls that support hierarchical data.\n\t *\n\t * @productversion Feathers 3.3.0\n\t */\n\tpublic class ArrayHierarchicalCollection extends EventDispatcher implements IHierarchicalCollection\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function ArrayHierarchicalCollection(arrayData:Array = null)\n\t\t{\n\t\t\tif(arrayData === null)\n\t\t\t{\n\t\t\t\tarrayData = [];\n\t\t\t}\n\t\t\tthis._arrayData = arrayData;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _arrayData:Array = null;\n\n\t\t/**\n\t\t * The <code>Array</code> data source for this collection.\n\t\t */\n\t\tpublic function get arrayData():Array\n\t\t{\n\t\t\treturn this._arrayData;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set arrayData(value:Array):void\n\t\t{\n\t\t\tif(this._arrayData === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._arrayData = value;\n\t\t\tthis.dispatchEventWith(CollectionEventType.RESET);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _childrenField:String = \"children\";\n\n\t\t/**\n\t\t * The field of a branch object used to access its children. The\n\t\t * field's type must be <code>Array</code> to be treated as a branch.\n\t\t */\n\t\tpublic function get childrenField():String\n\t\t{\n\t\t\treturn this._childrenField;\n\t\t}\n\n\t\tpublic function set childrenField(value:String):void\n\t\t{\n\t\t\tthis._childrenField = value;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#isBranch()\n\t\t */\n\t\tpublic function isBranch(node:Object):Boolean\n\t\t{\n\t\t\tif(node === null)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn node.hasOwnProperty(this._childrenField) && node[this._childrenField] is Array;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#getLength()\n\t\t *\n\t\t * @see #getLengthAtLocation()\n\t\t *\n\t\t * @throws RangeError Branch not found at specified location\n\t\t */\n\t\tpublic function getLength(...rest:Array):int\n\t\t{\n\t\t\tvar branch:Array = this._arrayData;\n\t\t\tvar indexCount:int = rest.length;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tvar index:int = rest[i] as int;\n\t\t\t\tbranch = branch[index][this._childrenField] as Array;\n\t\t\t\tif(branch === null)\n\t\t\t\t{\n\t\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + rest);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn branch.length;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#getLengthAtLocation()\n\t\t *\n\t\t * @throws RangeError Branch not found at specified location\n\t\t */\n\t\tpublic function getLengthAtLocation(location:Vector.<int> = null):int\n\t\t{\n\t\t\tvar branch:Array = this._arrayData;\n\t\t\tif(location !== null)\n\t\t\t{\n\t\t\t\tvar indexCount:int = location.length;\n\t\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar index:int = location[i];\n\t\t\t\t\tbranch = branch[index][this._childrenField] as Array;\n\t\t\t\t\tif(branch === null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + location);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn branch.length;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#updateItemAt()\n\t\t *\n\t\t * @see #updateAll()\n\t\t */\n\t\tpublic function updateItemAt(index:int, ...rest:Array):void\n\t\t{\n\t\t\trest.insertAt(0, index);\n\t\t\tthis.dispatchEventWith(CollectionEventType.UPDATE_ITEM, false, rest);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#updateAll()\n\t\t *\n\t\t * @see #updateItemAt()\n\t\t */\n\t\tpublic function updateAll():void\n\t\t{\n\t\t\tthis.dispatchEventWith(CollectionEventType.UPDATE_ALL);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#getItemAt()\n\t\t *\n\t\t * @see #getItemAtLocation()\n\t\t */\n\t\tpublic function getItemAt(index:int, ...rest:Array):Object\n\t\t{\n\t\t\trest.insertAt(0, index);\n\t\t\tvar branch:Array = this._arrayData;\n\t\t\tvar indexCount:int = rest.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tindex = rest[i] as int;\n\t\t\t\tbranch = branch[index][this._childrenField] as Array;\n\t\t\t\tif(branch === null)\n\t\t\t\t{\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar lastIndex:int = rest[indexCount] as int;\n\t\t\treturn branch[lastIndex];\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#getItemAtLocation()\n\t\t */\n\t\tpublic function getItemAtLocation(location:Vector.<int>):Object\n\t\t{\n\t\t\tif(location === null || location.length == 0)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tvar branch:Array = this._arrayData;\n\t\t\tvar indexCount:int = location.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tvar index:int = location[i];\n\t\t\t\tbranch = branch[index][this._childrenField] as Array;\n\t\t\t\tif(branch === null)\n\t\t\t\t{\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tindex = location[indexCount];\n\t\t\treturn branch[index];\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#getItemLocation()\n\t\t */\n\t\tpublic function getItemLocation(item:Object, result:Vector.<int> = null):Vector.<int>\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new <int>[];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult.length = 0;\n\t\t\t}\n\t\t\tvar branch:Array = this._arrayData;\n\t\t\tthis.findItemInBranch(branch, item, result);\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#addItemAt()\n\t\t *\n\t\t * @see #addItemAtLocation()\n\t\t *\n\t\t * @throws RangeError Branch not found at specified location\n\t\t */\n\t\tpublic function addItemAt(item:Object, index:int, ...rest:Array):void\n\t\t{\n\t\t\trest.insertAt(0, index);\n\t\t\tvar branch:Array = this._arrayData;\n\t\t\tvar indexCount:int = rest.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tindex = rest[i] as int;\n\t\t\t\tbranch = branch[index][this._childrenField] as Array;\n\t\t\t\tif(branch === null)\n\t\t\t\t{\n\t\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + rest);\n\t\t\t\t}\n\t\t\t}\n\t\t\tindex = rest[indexCount] as int;\n\t\t\tbranch.insertAt(index, item);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tthis.dispatchEventWith(CollectionEventType.ADD_ITEM, false, rest);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#addItemAtLocation()\n\t\t *\n\t\t * @throws RangeError Branch not found at specified location\n\t\t */\n\t\tpublic function addItemAtLocation(item:Object, location:Vector.<int>):void\n\t\t{\n\t\t\tif(location === null || location.length == 0)\n\t\t\t{\n\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + location);\n\t\t\t}\n\t\t\tvar eventIndices:Array = [];\n\t\t\tvar branch:Array = this._arrayData;\n\t\t\tvar indexCount:int = location.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tvar index:int = location[i];\n\t\t\t\tbranch = branch[index][this._childrenField] as Array;\n\t\t\t\tif(branch === null)\n\t\t\t\t{\n\t\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + location);\n\t\t\t\t}\n\t\t\t\teventIndices[i] = index;\n\t\t\t}\n\t\t\tindex = location[indexCount];\n\t\t\teventIndices[indexCount] = index;\n\t\t\tbranch.insertAt(index, item);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tthis.dispatchEventWith(CollectionEventType.ADD_ITEM, false, eventIndices);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#removeItemAt()\n\t\t *\n\t\t * @see #removeItemAtLocation()\n\t\t *\n\t\t * @throws RangeError Branch not found at specified location\n\t\t */\n\t\tpublic function removeItemAt(index:int, ...rest:Array):Object\n\t\t{\n\t\t\trest.insertAt(0, index);\n\t\t\tvar branch:Array = this._arrayData;\n\t\t\tvar indexCount:int = rest.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tindex = rest[i] as int;\n\t\t\t\tbranch = branch[index][this._childrenField] as Array;\n\t\t\t\tif(branch === null)\n\t\t\t\t{\n\t\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + rest);\n\t\t\t\t}\n\t\t\t}\n\t\t\tindex = rest[indexCount] as int;\n\t\t\tvar item:Object = branch.removeAt(index);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tthis.dispatchEventWith(CollectionEventType.REMOVE_ITEM, false, rest);\n\t\t\treturn item;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#removeItemAtLocation()\n\t\t *\n\t\t * @throws RangeError Branch not found at specified location\n\t\t */\n\t\tpublic function removeItemAtLocation(location:Vector.<int>):Object\n\t\t{\n\t\t\tif(location === null || location.length == 0)\n\t\t\t{\n\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + location);\n\t\t\t}\n\t\t\tvar eventIndices:Array = [];\n\t\t\tvar branch:Array = this._arrayData;\n\t\t\tvar indexCount:int = location.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tvar index:int = location[i];\n\t\t\t\tbranch = branch[index][this._childrenField] as Array;\n\t\t\t\tif(branch === null)\n\t\t\t\t{\n\t\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + location);\n\t\t\t\t}\n\t\t\t\teventIndices[i] = index;\n\t\t\t}\n\t\t\tindex = location[indexCount];\n\t\t\teventIndices[indexCount] = index;\n\t\t\tvar item:Object = branch.removeAt(index);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tthis.dispatchEventWith(CollectionEventType.REMOVE_ITEM, false, eventIndices);\n\t\t\treturn item;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#removeItem()\n\t\t */\n\t\tpublic function removeItem(item:Object):void\n\t\t{\n\t\t\tvar location:Vector.<int> = this.getItemLocation(item);\n\t\t\tif(location !== null)\n\t\t\t{\n\t\t\t\tthis.removeItemAtLocation(location);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#removeAll()\n\t\t */\n\t\tpublic function removeAll():void\n\t\t{\n\t\t\tif(this.getLength() == 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._arrayData.length = 0;\n\t\t\tthis.dispatchEventWith(CollectionEventType.REMOVE_ALL);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#setItemAt()\n\t\t *\n\t\t * @see #setItemAtLocation()\n\t\t *\n\t\t * @throws RangeError Branch not found at specified location\n\t\t */\n\t\tpublic function setItemAt(item:Object, index:int, ...rest:Array):void\n\t\t{\n\t\t\trest.insertAt(0, index);\n\t\t\tvar branch:Array = this._arrayData;\n\t\t\tvar indexCount:int = rest.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tindex = rest[i] as int;\n\t\t\t\tbranch = branch[index][this._childrenField] as Array;\n\t\t\t\tif(branch === null)\n\t\t\t\t{\n\t\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + rest);\n\t\t\t\t}\n\t\t\t}\n\t\t\tindex = rest[indexCount] as int;\n\t\t\tbranch[index] = item;\n\t\t\tthis.dispatchEventWith(CollectionEventType.REPLACE_ITEM, false, rest);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#setItemAtLocation()\n\t\t *\n\t\t * @throws RangeError Branch not found at specified location\n\t\t */\n\t\tpublic function setItemAtLocation(item:Object, location:Vector.<int>):void\n\t\t{\n\t\t\tif(location === null || location.length == 0)\n\t\t\t{\n\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + location);\n\t\t\t}\n\t\t\tvar eventIndices:Array = [];\n\t\t\tvar branch:Array = this._arrayData;\n\t\t\tvar indexCount:int = location.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tvar index:int = location[i];\n\t\t\t\tbranch = branch[index][this._childrenField] as Array;\n\t\t\t\tif(branch === null)\n\t\t\t\t{\n\t\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + location);\n\t\t\t\t}\n\t\t\t\teventIndices[i] = index;\n\t\t\t}\n\t\t\tindex = location[indexCount];\n\t\t\teventIndices[indexCount] = index;\n\t\t\tbranch[index] = item;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tthis.dispatchEventWith(CollectionEventType.REPLACE_ITEM, false, eventIndices);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#dispose()\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#dispose() starling.display.DisplayObject.dispose()\n\t\t * @see http://doc.starling-framework.org/core/starling/textures/Texture.html#dispose() starling.textures.Texture.dispose()\n\t\t */\n\t\tpublic function dispose(disposeBranch:Function, disposeItem:Function):void\n\t\t{\n\t\t\tvar groupCount:int = this._arrayData.length;\n\t\t\tvar path:Array = [];\n\t\t\tfor(var i:int = 0; i < groupCount; i++)\n\t\t\t{\n\t\t\t\tvar group:Object = this._arrayData[i];\n\t\t\t\tpath[0] = i;\n\t\t\t\tthis.disposeGroupInternal(group, path, disposeBranch, disposeItem);\n\t\t\t\tpath.length = 0;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function disposeGroupInternal(group:Object, path:Array, disposeBranch:Function, disposeItem:Function):void\n\t\t{\n\t\t\tif(disposeBranch !== null)\n\t\t\t{\n\t\t\t\tdisposeBranch(group);\n\t\t\t}\n\n\t\t\tvar itemCount:int = this.getLength.apply(this, path);\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tpath[path.length] = i;\n\t\t\t\tvar item:Object = this.getItemAt.apply(this, path);\n\t\t\t\tif(this.isBranch(item))\n\t\t\t\t{\n\t\t\t\t\tthis.disposeGroupInternal(item, path, disposeBranch, disposeItem);\n\t\t\t\t}\n\t\t\t\telse if(disposeItem !== null)\n\t\t\t\t{\n\t\t\t\t\tdisposeItem(item);\n\t\t\t\t}\n\t\t\t\tpath.length--;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function findItemInBranch(branch:Array, item:Object, result:Vector.<int>):Boolean\n\t\t{\n\t\t\tvar insertIndex:int = result.length;\n\t\t\tvar branchLength:int = branch.length;\n\t\t\tfor(var i:int = 0; i < branchLength; i++)\n\t\t\t{\n\t\t\t\tvar branchItem:Object = branch[i];\n\t\t\t\tif(branchItem === item)\n\t\t\t\t{\n\t\t\t\t\tresult[insertIndex] = i;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif(this.isBranch(branchItem))\n\t\t\t\t{\n\t\t\t\t\tresult[insertIndex] = i;\n\t\t\t\t\tvar children:Array = branchItem[this._childrenField] as Array;\n\t\t\t\t\tvar isFound:Boolean = this.findItemInBranch(children, item, result);\n\t\t\t\t\tif(isFound)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tresult.pop();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/data/ArrayListCollectionDataDescriptor.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.data\n{\n\timport flash.errors.IllegalOperationError;\n\n\t/**\n\t * An <code>IListCollectionDataDescriptor</code> implementation for Arrays.\n\t *\n\t * @see ListCollection\n\t * @see IListCollectionDataDescriptor\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class ArrayListCollectionDataDescriptor implements IListCollectionDataDescriptor\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function ArrayListCollectionDataDescriptor()\n\t\t{\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getLength(data:Object):int\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\treturn (data as Array).length;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getItemAt(data:Object, index:int):Object\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\treturn (data as Array)[index];\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function setItemAt(data:Object, item:Object, index:int):void\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\t(data as Array)[index] = item;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function addItemAt(data:Object, item:Object, index:int):void\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\t(data as Array).insertAt(index, item);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function removeItemAt(data:Object, index:int):Object\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\treturn (data as Array).removeAt(index);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function removeAll(data:Object):void\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\t(data as Array).length = 0;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getItemIndex(data:Object, item:Object):int\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\treturn (data as Array).indexOf(item);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function checkForCorrectDataType(data:Object):void\n\t\t{\n\t\t\tif(!(data is Array))\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Expected Array. Received \" + Object(data).constructor + \" instead.\");\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/data/HierarchicalCollection.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.data\n{\n\timport feathers.events.CollectionEventType;\n\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\n\t/**\n\t * Dispatched when the underlying data source changes and components will\n\t * need to redraw the data.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the collection has changed drastically, such as when\n\t * the underlying data source is replaced completely.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.RESET\n\t */\n\t[Event(name=\"reset\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is added to the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index path of the item that has\n\t * been added. It is of type <code>Array</code> and contains objects of\n\t * type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.ADD_ITEM\n\t */\n\t[Event(name=\"addItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is removed from the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index path of the item that has\n\t * been removed. It is of type <code>Array</code> and contains objects of\n\t * type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.REMOVE_ITEM\n\t */\n\t[Event(name=\"removeItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is replaced in the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index path of the item that has\n\t * been replaced. It is of type <code>Array</code> and contains objects of\n\t * type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.REPLACE_ITEM\n\t */\n\t[Event(name=\"replaceItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>updateItemAt()</code> function is called on the\n\t * hierarchical collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index path of the item that has\n\t * been updated. It is of type <code>Array</code> and contains objects of\n\t * type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #updateItemAt()\n\t *\n\t * @eventType feathers.events.CollectionEventType.UPDATE_ITEM\n\t */\n\t[Event(name=\"updateItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>updateAll()</code> function is called on the\n\t * hierarchical collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #updateAll()\n\t *\n\t * @eventType feathers.events.CollectionEventType.UPDATE_ALL\n\t */\n\t[Event(name=\"updateAll\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Wraps a two-dimensional data source with a common API for use with UI\n\t * controls that support this type of data.\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class HierarchicalCollection extends EventDispatcher implements IHierarchicalCollection\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function HierarchicalCollection(data:Object = null)\n\t\t{\n\t\t\tif(!data)\n\t\t\t{\n\t\t\t\t//default to an array if no data is provided\n\t\t\t\tdata = [];\n\t\t\t}\n\t\t\tthis.data = data;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _data:Object;\n\n\t\t/**\n\t\t * The data source for this collection. May be any type of data, but a\n\t\t * <code>dataDescriptor</code> needs to be provided to translate from\n\t\t * the data source's APIs to something that can be understood by\n\t\t * hierarchical collection.\n\t\t */\n\t\tpublic function get data():Object\n\t\t{\n\t\t\treturn _data;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set data(value:Object):void\n\t\t{\n\t\t\tif(this._data == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._data = value;\n\t\t\tthis.dispatchEventWith(CollectionEventType.RESET);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _dataDescriptor:IHierarchicalCollectionDataDescriptor = new ArrayChildrenHierarchicalCollectionDataDescriptor();\n\n\t\t/**\n\t\t * Describes the underlying data source by translating APIs.\n\t\t */\n\t\tpublic function get dataDescriptor():IHierarchicalCollectionDataDescriptor\n\t\t{\n\t\t\treturn this._dataDescriptor;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set dataDescriptor(value:IHierarchicalCollectionDataDescriptor):void\n\t\t{\n\t\t\tif(this._dataDescriptor == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._dataDescriptor = value;\n\t\t\tthis.dispatchEventWith(CollectionEventType.RESET);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#isBranch()\n\t\t */\n\t\tpublic function isBranch(node:Object):Boolean\n\t\t{\n\t\t\treturn this._dataDescriptor.isBranch(node);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#getLength()\n\t\t *\n\t\t * @see #getLengthAtLocation()\n\t\t */\n\t\tpublic function getLength(...rest:Array):int\n\t\t{\n\t\t\trest.insertAt(0, this._data);\n\t\t\treturn this._dataDescriptor.getLength.apply(null, rest);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#getLengthAtLocation()\n\t\t */\n\t\tpublic function getLengthAtLocation(location:Vector.<int> = null):int\n\t\t{\n\t\t\treturn this._dataDescriptor.getLengthAtLocation(this._data, location);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#updateItemAt()\n\t\t *\n\t\t * @see #updateAll()\n\t\t */\n\t\tpublic function updateItemAt(index:int, ...rest:Array):void\n\t\t{\n\t\t\trest.insertAt(0, index);\n\t\t\tthis.dispatchEventWith(CollectionEventType.UPDATE_ITEM, false, rest);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#updateAll()\n\t\t *\n\t\t * @see #updateItemAt()\n\t\t */\n\t\tpublic function updateAll():void\n\t\t{\n\t\t\tthis.dispatchEventWith(CollectionEventType.UPDATE_ALL);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#getItemAt()\n\t\t *\n\t\t * @see #getItemAtLocation()\n\t\t */\n\t\tpublic function getItemAt(index:int, ...rest:Array):Object\n\t\t{\n\t\t\trest.insertAt(0, index);\n\t\t\trest.insertAt(0, this._data);\n\t\t\treturn this._dataDescriptor.getItemAt.apply(null, rest);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#getItemAtLocation()\n\t\t */\n\t\tpublic function getItemAtLocation(location:Vector.<int>):Object\n\t\t{\n\t\t\treturn this._dataDescriptor.getItemAtLocation(this._data, location);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#getItemLocation()\n\t\t */\n\t\tpublic function getItemLocation(item:Object, result:Vector.<int> = null):Vector.<int>\n\t\t{\n\t\t\treturn this._dataDescriptor.getItemLocation(this._data, item, result);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#addItemAt()\n\t\t *\n\t\t * @see #addItemAtLocation()\n\t\t */\n\t\tpublic function addItemAt(item:Object, index:int, ...rest:Array):void\n\t\t{\n\t\t\trest.insertAt(0, index);\n\t\t\trest.insertAt(0, item);\n\t\t\trest.insertAt(0, this._data);\n\t\t\tthis._dataDescriptor.addItemAt.apply(null, rest);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\trest.shift();\n\t\t\trest.shift();\n\t\t\tthis.dispatchEventWith(CollectionEventType.ADD_ITEM, false, rest);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#addItemAtLocation()\n\t\t *\n\t\t * @throws RangeError Branch not found at specified location\n\t\t */\n\t\tpublic function addItemAtLocation(item:Object, location:Vector.<int>):void\n\t\t{\n\t\t\tthis._dataDescriptor.addItemAtLocation(this._data, item, location);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tvar result:Array = [];\n\t\t\tvar locationCount:int = location.length;\n\t\t\tfor(var i:int = 0; i < locationCount; i++)\n\t\t\t{\n\t\t\t\tresult[i] = location[i];\n\t\t\t}\n\t\t\tthis.dispatchEventWith(CollectionEventType.ADD_ITEM, false, result);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#removeItemAt()\n\t\t *\n\t\t * @see #removeItemAtLocation()\n\t\t */\n\t\tpublic function removeItemAt(index:int, ...rest:Array):Object\n\t\t{\n\t\t\trest.insertAt(0, index);\n\t\t\trest.insertAt(0, this._data);\n\t\t\tvar item:Object = this._dataDescriptor.removeItemAt.apply(null, rest);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\trest.shift();\n\t\t\tthis.dispatchEventWith(CollectionEventType.REMOVE_ITEM, false, rest);\n\t\t\treturn item;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#removeItemAtLocation()\n\t\t *\n\t\t * @throws RangeError Branch not found at specified location\n\t\t */\n\t\tpublic function removeItemAtLocation(location:Vector.<int>):Object\n\t\t{\n\t\t\tvar item:Object = this._dataDescriptor.removeItemAtLocation(this._data, location);\n\t\t\tvar result:Array = [];\n\t\t\tvar locationCount:int = location.length;\n\t\t\tfor(var i:int = 0; i < locationCount; i++)\n\t\t\t{\n\t\t\t\tresult[i] = location[i];\n\t\t\t}\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tthis.dispatchEventWith(CollectionEventType.REMOVE_ITEM, false, result);\n\t\t\treturn item;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#removeItem()\n\t\t */\n\t\tpublic function removeItem(item:Object):void\n\t\t{\n\t\t\tvar location:Vector.<int> = this.getItemLocation(item);\n\t\t\tif(location !== null)\n\t\t\t{\n\t\t\t\tthis.removeItemAtLocation(location);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#removeAll()\n\t\t */\n\t\tpublic function removeAll():void\n\t\t{\n\t\t\tif(this.getLength() == 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._dataDescriptor.removeAll(this._data);\n\t\t\tthis.dispatchEventWith(CollectionEventType.REMOVE_ALL);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#setItemAt()\n\t\t *\n\t\t * @see #setItemAtLocation()\n\t\t */\n\t\tpublic function setItemAt(item:Object, index:int, ...rest:Array):void\n\t\t{\n\t\t\trest.insertAt(0, index);\n\t\t\trest.insertAt(0, item);\n\t\t\trest.insertAt(0, this._data);\n\t\t\tthis._dataDescriptor.setItemAt.apply(null, rest);\n\t\t\trest.shift();\n\t\t\trest.shift();\n\t\t\tthis.dispatchEventWith(CollectionEventType.REPLACE_ITEM, false, rest);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#setItemAtLocation()\n\t\t *\n\t\t * @throws RangeError Branch not found at specified location\n\t\t */\n\t\tpublic function setItemAtLocation(item:Object, location:Vector.<int>):void\n\t\t{\n\t\t\tthis._dataDescriptor.setItemAtLocation(data, item, location);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tvar result:Array = [];\n\t\t\tvar locationCount:int = location.length;\n\t\t\tfor(var i:int = 0; i < locationCount; i++)\n\t\t\t{\n\t\t\t\tresult[i] = location[i];\n\t\t\t}\n\t\t\tthis.dispatchEventWith(CollectionEventType.REPLACE_ITEM, false, result);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#dispose()\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#dispose() starling.display.DisplayObject.dispose()\n\t\t * @see http://doc.starling-framework.org/core/starling/textures/Texture.html#dispose() starling.textures.Texture.dispose()\n\t\t */\n\t\tpublic function dispose(disposeGroup:Function, disposeItem:Function):void\n\t\t{\n\t\t\tvar groupCount:int = this.getLength();\n\t\t\tvar path:Array = [];\n\t\t\tfor(var i:int = 0; i < groupCount; i++)\n\t\t\t{\n\t\t\t\tvar group:Object = this.getItemAt(i);\n\t\t\t\tpath[0] = i;\n\t\t\t\tthis.disposeGroupInternal(group, path, disposeGroup, disposeItem);\n\t\t\t\tpath.length = 0;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function disposeGroupInternal(group:Object, path:Array, disposeGroup:Function, disposeItem:Function):void\n\t\t{\n\t\t\tif(disposeGroup != null)\n\t\t\t{\n\t\t\t\tdisposeGroup(group);\n\t\t\t}\n\n\t\t\tvar itemCount:int = this.getLength.apply(this, path);\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tpath[path.length] = i;\n\t\t\t\tvar item:Object = this.getItemAt.apply(this, path);\n\t\t\t\tif(this.isBranch(item))\n\t\t\t\t{\n\t\t\t\t\tthis.disposeGroupInternal(item, path, disposeGroup, disposeItem);\n\t\t\t\t}\n\t\t\t\telse if(disposeItem != null)\n\t\t\t\t{\n\t\t\t\t\tdisposeItem(item);\n\t\t\t\t}\n\t\t\t\tpath.length--;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/data/IAutoCompleteSource.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.data\n{\n\timport feathers.core.IFeathersEventDispatcher;\n\n\t/**\n\t * Dispatched when the suggestions finish loading.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>A <code>ListCollection</code> containing\n\t *   the suggestions to display.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.COMPLETE\n\t */\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\t/**\n\t * A source of items to display in the pop-up list of an\n\t * <code>AutoComplete</code> component.\n\t *\n\t * @see feathers.controls.AutoComplete\n\t *\n\t * @productversion Feathers 2.1.0\n\t */\n\tpublic interface IAutoCompleteSource extends IFeathersEventDispatcher\n\t{\n\t\t/**\n\t\t * Loads suggestions based on the text entered into an\n\t\t * <code>AutoComplete</code> component.\n\t\t *\n\t\t * <p>If an existing <code>ListCollection</code> is passed in as the\n\t\t * result, all items will be removed before new items are added.</p>\n\t\t */\n\t\tfunction load(textToMatch:String, suggestionsResult:IListCollection = null):void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/data/IHierarchicalCollection.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.data\n{\n\timport feathers.core.IFeathersEventDispatcher;\n\n\t/**\n\t * Dispatched when the underlying data source changes and the ui will\n\t * need to redraw the data.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the collection has changed drastically, such as when\n\t * the underlying data source is replaced completely.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.RESET\n\t */\n\t[Event(name=\"reset\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is added to the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index path of the item that has\n\t * been added. It is of type <code>Array</code> and contains objects of\n\t * type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.ADD_ITEM\n\t */\n\t[Event(name=\"addItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is removed from the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index path of the item that has\n\t * been removed. It is of type <code>Array</code> and contains objects of\n\t * type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.REMOVE_ITEM\n\t */\n\t[Event(name=\"removeItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is replaced in the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index path of the item that has\n\t * been replaced. It is of type <code>Array</code> and contains objects of\n\t * type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.REPLACE_ITEM\n\t */\n\t[Event(name=\"replaceItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>updateItemAt()</code> function is called on the\n\t * hierarchical collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index path of the item that has\n\t * been updated. It is of type <code>Array</code> and contains objects of\n\t * type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #updateItemAt()\n\t *\n\t * @eventType feathers.events.CollectionEventType.UPDATE_ITEM\n\t */\n\t[Event(name=\"updateItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>updateAll()</code> function is called on the\n\t * hierarchical collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #updateAll()\n\t *\n\t * @eventType feathers.events.CollectionEventType.UPDATE_ALL\n\t */\n\t[Event(name=\"updateAll\",type=\"starling.events.Event\")]\n\n\t/**\n\t * An interface for hierarchical collections.\n\t *\n\t * @productversion 3.3.0\n\t */\n\tpublic interface IHierarchicalCollection extends IFeathersEventDispatcher\n\t{\n\t\t/**\n\t\t * Determines if a node from the data source is a branch.\n\t\t */\n\t\tfunction isBranch(node:Object):Boolean;\n\n\t\t/**\n\t\t * The number of items at the specified location in the collection.\n\t\t *\n\t\t * <p>Calling <code>getLengthOfBranch()</code> instead is recommended\n\t\t * because the <code>Vector.&lt;int&gt;</code> location may be reused to\n\t\t * avoid excessive garbage collection from temporary objects created by\n\t\t * <code>...rest</code> arguments.</p>\n\t\t */\n\t\tfunction getLength(...rest:Array):int;\n\n\t\t/**\n\t\t * The number of items at the specified location in the collection.\n\t\t */\n\t\tfunction getLengthAtLocation(location:Vector.<int> = null):int;\n\n\t\t/**\n\t\t * Call <code>updateItemAt()</code> to manually inform any component\n\t\t * rendering the hierarchical collection that the properties of a\n\t\t * single item in the collection have changed, and that any views\n\t\t * associated with the item should be updated. The collection will\n\t\t * dispatch the <code>CollectionEventType.UPDATE_ITEM</code> event.\n\t\t *\n\t\t * <p>Alternatively, the item can dispatch an event when one of its\n\t\t * properties has changed, and  a custom item renderer can listen for\n\t\t * that event and update itself automatically.</p>\n\t\t *\n\t\t * @see #updateAll()\n\t\t */\n\t\tfunction updateItemAt(index:int, ...rest:Array):void;\n\n\t\t/**\n\t\t * Call <code>updateAll()</code> to manually inform any component\n\t\t * rendering the hierarchical collection that the properties of all, or\n\t\t * many, of the collection's items have changed, and that any rendered\n\t\t * views should be updated. The collection will dispatch the\n\t\t * <code>CollectionEventType.UPDATE_ALL</code> event.\n\t\t *\n\t\t * <p>Alternatively, the item can dispatch an event when one of its\n\t\t * properties has changed, and  a custom item renderer can listen for\n\t\t * that event and update itself automatically.</p>\n\t\t *\n\t\t * @see #updateItemAt()\n\t\t */\n\t\tfunction updateAll():void;\n\n\t\t/**\n\t\t * Returns the item at the specified location in the collection.\n\t\t *\n\t\t * <p>Calling <code>getItemAtLocation()</code> instead is recommended\n\t\t * because the <code>Vector.&lt;int&gt;</code> location may be reused to\n\t\t * avoid excessive garbage collection from temporary objects created by\n\t\t * <code>...rest</code> arguments.</p>\n\t\t */\n\t\tfunction getItemAt(index:int, ...rest:Array):Object;\n\n\t\t/**\n\t\t * Returns the item at the specified location in the collection.\n\t\t */\n\t\tfunction getItemAtLocation(location:Vector.<int>):Object;\n\n\t\t/**\n\t\t * Determines which location the item appears at within the collection. If\n\t\t * the item isn't in the collection, returns an empty vector.\n\t\t */\n\t\tfunction getItemLocation(item:Object, result:Vector.<int> = null):Vector.<int>;\n\n\t\t/**\n\t\t * Adds an item to the collection, at the specified location.\n\t\t *\n\t\t * <p>Calling <code>addItemAtLocation()</code> instead is recommended\n\t\t * because the <code>Vector.&lt;int&gt;</code> location may be reused to\n\t\t * avoid excessive garbage collection from temporary objects created by\n\t\t * <code>...rest</code> arguments.</p>\n\t\t */\n\t\tfunction addItemAt(item:Object, index:int, ...rest:Array):void;\n\n\t\t/**\n\t\t * Adds an item to the collection, at the specified location.\n\t\t */\n\t\tfunction addItemAtLocation(item:Object, location:Vector.<int>):void;\n\n\t\t/**\n\t\t * Removes the item at the specified location from the collection and\n\t\t * returns it.\n\t\t *\n\t\t * <p>Calling <code>removeItemAtLocation()</code> instead is recommended\n\t\t * because the <code>Vector.&lt;int&gt;</code> location may be reused to\n\t\t * avoid excessive garbage collection from temporary objects created by\n\t\t * <code>...rest</code> arguments.</p>\n\t\t */\n\t\tfunction removeItemAt(index:int, ...rest:Array):Object;\n\n\t\t/**\n\t\t * Removes the item at the specified location from the collection and\n\t\t * returns it.\n\t\t */\n\t\tfunction removeItemAtLocation(location:Vector.<int>):Object;\n\n\t\t/**\n\t\t * Removes a specific item from the collection.\n\t\t */\n\t\tfunction removeItem(item:Object):void;\n\n\t\t/**\n\t\t * Removes all items from the collection.\n\t\t */\n\t\tfunction removeAll():void;\n\n\t\t/**\n\t\t * Replaces the item at the specified location with a new item.\n\t\t *\n\t\t * <p>Calling <code>setItemAtLocation()</code> instead is recommended\n\t\t * because the <code>Vector.&lt;int&gt;</code> location may be reused to\n\t\t * avoid excessive garbage collection from temporary objects created by\n\t\t * <code>...rest</code> arguments.</p>\n\t\t */\n\t\tfunction setItemAt(item:Object, index:int, ...rest:Array):void;\n\n\t\t/**\n\t\t * Replaces the item at the specified location with a new item.\n\t\t */\n\t\tfunction setItemAtLocation(item:Object, location:Vector.<int>):void;\n\n\t\t/**\n\t\t * Calls a function for each group in the collection and another\n\t\t * function for each item in a group, where each function handles any\n\t\t * properties that require disposal on these objects. For example,\n\t\t * display objects or textures may need to be disposed. You may pass in\n\t\t * a value of <code>null</code> for either function if you don't have\n\t\t * anything to dispose in one or the other.\n\t\t *\n\t\t * <p>The function to dispose a group is expected to have the following signature:</p>\n\t\t * <pre>function( group:Object ):void</pre>\n\t\t *\n\t\t * <p>The function to dispose an item is expected to have the following signature:</p>\n\t\t * <pre>function( item:Object ):void</pre>\n\t\t *\n\t\t * <p>In the following example, the items in the collection are disposed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * collection.dispose( function( group:Object ):void\n\t\t * {\n\t\t *     var content:DisplayObject = DisplayObject(group.content);\n\t\t *     content.dispose();\n\t\t * },\n\t\t * function( item:Object ):void\n\t\t * {\n\t\t *     var accessory:DisplayObject = DisplayObject(item.accessory);\n\t\t *     accessory.dispose();\n\t\t * },)</listing>\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#dispose() starling.display.DisplayObject.dispose()\n\t\t * @see http://doc.starling-framework.org/core/starling/textures/Texture.html#dispose() starling.textures.Texture.dispose()\n\t\t */\n\t\tfunction dispose(disposeGroup:Function, disposeItem:Function):void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/data/IHierarchicalCollectionDataDescriptor.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.data\n{\n\t/**\n\t * An adapter interface to support any kind of data source in\n\t * hierarchical collections.\n\t *\n\t * @see HierarchicalCollection\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic interface IHierarchicalCollectionDataDescriptor\n\t{\n\t\t/**\n\t\t * Determines if a node from the data source is a branch.\n\t\t */\n\t\tfunction isBranch(node:Object):Boolean;\n\n\t\t/**\n\t\t * The number of items at the specified location in the data source.\n\t\t *\n\t\t * <p>The rest arguments are the indices that make up the location. If\n\t\t * a location is omitted, the length returned will be for the root level\n\t\t * of the collection.</p>\n\t\t *\n\t\t * <p>Calling <code>getLengthOfBranch()</code> instead is recommended\n\t\t * because the <code>Vector.&lt;int&gt;</code> location may be reused to\n\t\t * avoid excessive garbage collection from temporary objects created by\n\t\t * <code>...rest</code> arguments.</p>\n\t\t */\n\t\tfunction getLength(data:Object, ...rest:Array):int;\n\n\t\t/**\n\t\t * The number of items at the specified location in the data source.\n\t\t */\n\t\tfunction getLengthAtLocation(data:Object, location:Vector.<int> = null):int;\n\n\t\t/**\n\t\t * Returns the item at the specified location in the data source.\n\t\t *\n\t\t * <p>The rest arguments are the indices that make up the location.</p>\n\t\t *\n\t\t * <p>Calling <code>getItemAtLocation()</code> instead is recommended\n\t\t * because the <code>Vector.&lt;int&gt;</code> location may be reused to\n\t\t * avoid excessive garbage collection from temporary objects created by\n\t\t * <code>...rest</code> arguments.</p>\n\t\t */\n\t\tfunction getItemAt(data:Object, index:int, ...rest:Array):Object;\n\n\t\t/**\n\t\t * Returns the item at the specified location in the data source.\n\t\t */\n\t\tfunction getItemAtLocation(data:Object, location:Vector.<int>):Object;\n\n\t\t/**\n\t\t * Replaces the item at the specified location with a new item.\n\t\t *\n\t\t * <p>The rest arguments are the indices that make up the location.</p>\n\t\t *\n\t\t * <p>Calling <code>setItemAtLocation()</code> instead is recommended\n\t\t * because the <code>Vector.&lt;int&gt;</code> location may be reused to\n\t\t * avoid excessive garbage collection from temporary objects created by\n\t\t * <code>...rest</code> arguments.</p>\n\t\t */\n\t\tfunction setItemAt(data:Object, item:Object, index:int, ...rest:Array):void;\n\n\t\t/**\n\t\t * Replaces the item at the specified location with a new item.\n\t\t *\n\t\t * <p>The rest arguments are the indices that make up the location.</p>\n\t\t */\n\t\tfunction setItemAtLocation(data:Object, item:Object, location:Vector.<int>):void;\n\n\t\t/**\n\t\t * Adds an item to the data source, at the specified location.\n\t\t *\n\t\t * <p>The rest arguments are the indices that make up the location.</p>\n\t\t *\n\t\t * <p>Calling <code>addItemAtLocation()</code> instead is recommended\n\t\t * because the <code>Vector.&lt;int&gt;</code> location may be reused to\n\t\t * avoid excessive garbage collection from temporary objects created by\n\t\t * <code>...rest</code> arguments.</p>\n\t\t */\n\t\tfunction addItemAt(data:Object, item:Object, index:int, ...rest:Array):void;\n\n\t\t/**\n\t\t * Adds an item to the data source, at the specified location.\n\t\t */\n\t\tfunction addItemAtLocation(data:Object, item:Object, location:Vector.<int>):void;\n\n\t\t/**\n\t\t * Removes the item at the specified location from the data source and\n\t\t * returns it.\n\t\t *\n\t\t * <p>The rest arguments are the indices that make up the location.</p>\n\t\t */\n\t\tfunction removeItemAt(data:Object, index:int, ...rest:Array):Object;\n\n\t\t/**\n\t\t * Removes the item at the specified location from the data source and\n\t\t * returns it.\n\t\t *\n\t\t * <p>The rest arguments are the indices that make up the location.</p>\n\t\t *\n\t\t * <p>Calling <code>removeItemAtLocation()</code> instead is recommended\n\t\t * because the <code>Vector.&lt;int&gt;</code> location may be reused to\n\t\t * avoid excessive garbage collection from temporary objects created by\n\t\t * <code>...rest</code> arguments.</p>\n\t\t */\n\t\tfunction removeItemAtLocation(data:Object, location:Vector.<int>):Object;\n\n\t\t/**\n\t\t * Removes all items from the data source.\n\t\t */\n\t\tfunction removeAll(data:Object):void;\n\n\t\t/**\n\t\t * Determines which location the item appears at within the data source.\n\t\t * If the item isn't in the data source, returns an empty <code>Vector.&lt;int&gt;</code>.\n\t\t *\n\t\t * <p>The <code>rest</code> arguments are optional indices to narrow\n\t\t * the search.</p>\n\t\t */\n\t\tfunction getItemLocation(data:Object, item:Object, result:Vector.<int> = null, ...rest:Array):Vector.<int>;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/data/IListCollection.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.data\n{\n\timport feathers.core.IFeathersEventDispatcher;\n\n\t/**\n\t * Dispatched when the underlying data source changes and components will\n\t * need to redraw the data.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the collection has changed drastically, such as when\n\t * the underlying data source is replaced completely.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.RESET\n\t */\n\t[Event(name=\"reset\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is added to the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index of the item that has been\n\t * added. It is of type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.ADD_ITEM\n\t */\n\t[Event(name=\"addItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is removed from the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index of the item that has been\n\t * removed. It is of type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.REMOVE_ITEM\n\t */\n\t[Event(name=\"removeItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is replaced in the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index of the item that has been\n\t * replaced. It is of type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.REPLACE_ITEM\n\t */\n\t[Event(name=\"replaceItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>updateItemAt()</code> function is called on the\n\t * <code>IListCollection</code>.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index of the item that has been\n\t * updated. It is of type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #updateItemAt()\n\t *\n\t * @eventType feathers.events.CollectionEventType.UPDATE_ITEM\n\t */\n\t[Event(name=\"updateItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>updateAll()</code> function is called on the\n\t * <code>IListCollection</code>.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #updateAll()\n\t *\n\t * @eventType feathers.events.CollectionEventType.UPDATE_ALL\n\t */\n\t[Event(name=\"updateAll\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>filterFunction</code> property changes or the\n\t * <code>refresh()</code> function is called on the <code>IListCollection</code>.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #filterFunction\n\t * @see #refresh()\n\t *\n\t * @eventType feathers.events.CollectionEventType.FILTER_CHANGE\n\t */\n\t[Event(name=\"filterChange\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>sortCompareFunction</code> property changes or\n\t * the <code>refresh()</code> function is called on the <code>IListCollection</code>.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #sortCompareFunction\n\t * @see #refresh()\n\t *\n\t * @eventType feathers.events.CollectionEventType.SORT_CHANGE\n\t */\n\t[Event(name=\"sortChange\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Interface for list collections.\n\t *\n\t * @productversion Feathers 3.3.0\n\t */\n\tpublic interface IListCollection extends IFeathersEventDispatcher\n\t{\n\t\t/**\n\t\t * The number of items in the collection.\n\t\t */\n\t\tfunction get length():int;\n\n\t\t/**\n\t\t * A function to determine if each item in the collection should be\n\t\t * included or excluded from visibility through APIs like\n\t\t * <code>length</code> and <code>getItemAt()</code>.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function( item:Object ):Boolean</pre>\n\t\t *\n\t\t * <p>In the following example, the filter function is based on the\n\t\t * text of a <code>TextInput</code> component:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var collection:IListCollection; //this would be created from a concrete implementation\n\t\t * \n\t\t * var list:List = new List();\n\t\t * list.dataProvider = collection;\n\t\t * this.addChild( list );\n\t\t * \n\t\t * var input:TextInput = new TextInput();\n\t\t * input.addEventListener( Event.CHANGE, function():void\n\t\t * {\n\t\t *    if( input.text.length == 0 )\n\t\t *    {\n\t\t *        collection.filterFunction = null;\n\t\t *        return;\n\t\t *    }\n\t\t *    collection.filterFunction = function( item:Object ):Boolean\n\t\t *    {\n\t\t *        var itemText:String = item.label.toLowerCase();\n\t\t *        var filterText:String = input.text.toLowerCase();\n\t\t *        return itemText.indexOf( filterText ) >= 0;\n\t\t *    };\n\t\t * } );\n\t\t * this.addChild( input );</listing>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tfunction get filterFunction():Function;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set filterFunction(value:Function):void;\n\n\t\t/**\n\t\t * A function to compare each item in the collection to determine the\n\t\t * order when sorted.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function( a:Object, b:Object ):int</pre>\n\t\t *\n\t\t * <p>The return value should be <code>-1</code> if the first item\n\t\t * should appear before the second item when the collection is sorted.\n\t\t * The return value should be <code>1</code> if the first item should\n\t\t * appear after the second item when the collection in sorted. Finally,\n\t\t * the return value should be <code>0</code> if both items have the\n\t\t * same sort order.</p>\n\t\t *\n\t\t * @default null\n\t\t */\n\t\tfunction get sortCompareFunction():Function;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set sortCompareFunction(value:Function):void;\n\n\t\t/**\n\t\t * Refreshes the collection using the <code>filterFunction</code>\n\t\t * or <code>sortCompareFunction</code> without passing in a new values\n\t\t * for these properties. Useful when either of these functions relies\n\t\t * on external variables that have changed.\n\t\t */\n\t\tfunction refresh():void;\n\n\t\t/**\n\t\t * Call <code>updateItemAt()</code> to manually inform any component\n\t\t * rendering the <code>IListCollection</code> that the properties of a\n\t\t * single item in the collection have changed, and that any views\n\t\t * associated with the item should be updated. The collection will\n\t\t * dispatch the <code>CollectionEventType.UPDATE_ITEM</code> event.\n\t\t *\n\t\t * <p>Alternatively, the item can dispatch an event when one of its\n\t\t * properties has changed, and a custom item renderer can listen for\n\t\t * that event and update itself automatically.</p>\n\t\t *\n\t\t * @see #updateAll()\n\t\t */\n\t\tfunction updateItemAt(index:int):void;\n\n\t\t/**\n\t\t * Call <code>updateAll()</code> to manually inform any component\n\t\t * rendering the <code>IListCollection</code> that the properties of all,\n\t\t * or many, of the collection's items have changed, and that any\n\t\t * rendered views should be updated. The collection will dispatch the\n\t\t * <code>CollectionEventType.UPDATE_ALL</code> event.\n\t\t *\n\t\t * <p>Alternatively, the item can dispatch an event when one of its\n\t\t * properties has changed, and a custom item renderer can listen for\n\t\t * that event and update itself automatically.</p>\n\t\t *\n\t\t * @see #updateItemAt()\n\t\t */\n\t\tfunction updateAll():void;\n\n\t\t/**\n\t\t * Returns the item at the specified index in the collection.\n\t\t */\n\t\tfunction getItemAt(index:int):Object;\n\n\t\t/**\n\t\t * Determines which index the item appears at within the collection. If\n\t\t * the item isn't in the collection, returns <code>-1</code>.\n\t\t *\n\t\t * <p>If the collection is filtered, <code>getItemIndex()</code> will\n\t\t * return <code>-1</code> for items that are excluded by the filter.</p>\n\t\t */\n\t\tfunction getItemIndex(item:Object):int;\n\n\t\t/**\n\t\t * Adds an item to the collection, at the specified index.\n\t\t *\n\t\t * <p>If the collection is filtered, the index is the position in the\n\t\t * filtered data, rather than position in the unfiltered data.</p>\n\t\t */\n\t\tfunction addItemAt(item:Object, index:int):void;\n\n\t\t/**\n\t\t * Removes the item at the specified index from the collection and\n\t\t * returns it.\n\t\t *\n\t\t * <p>If the collection is filtered, the index is the position in the\n\t\t * filtered data, rather than position in the unfiltered data.</p>\n\t\t */\n\t\tfunction removeItemAt(index:int):Object;\n\n\t\t/**\n\t\t * Removes a specific item from the collection.\n\t\t *\n\t\t * <p>If the collection is filtered, <code>removeItem()</code> will not\n\t\t * remove the item from the unfiltered data if it is not included in the\n\t\t * filtered data. If the item is not removed,\n\t\t * <code>CollectionEventType.REMOVE_ITEM</code> will not be dispatched.</p>\n\t\t */\n\t\tfunction removeItem(item:Object):void;\n\n\t\t/**\n\t\t * Removes all items from the collection.\n\t\t */\n\t\tfunction removeAll():void;\n\n\t\t/**\n\t\t * Replaces the item at the specified index with a new item.\n\t\t */\n\t\tfunction setItemAt(item:Object, index:int):void;\n\n\t\t/**\n\t\t * Adds an item to the end of the collection.\n\t\t *\n\t\t * <p>If the collection is filtered, <code>addItem()</code> may add\n\t\t * the item to the unfiltered data, but omit it from the filtered data.\n\t\t * If the item is omitted from the filtered data,\n\t\t * <code>CollectionEventType.ADD_ITEM</code> will not be dispatched.</p>\n\t\t */\n\t\tfunction addItem(item:Object):void;\n\n\t\t/**\n\t\t * Adds all items from another collection.\n\t\t */\n\t\tfunction addAll(collection:IListCollection):void;\n\n\t\t/**\n\t\t * Adds all items from another collection, placing the items at a\n\t\t * specific index in this collection.\n\t\t */\n\t\tfunction addAllAt(collection:IListCollection, index:int):void;\n\n\t\t/**\n\t\t * Replaces the collection's data with data from another collection.\n\t\t */\n\t\tfunction reset(collection:IListCollection):void;\n\n\t\t/**\n\t\t * A convenient alias for <code>addItem()</code>.\n\t\t *\n\t\t * @see #addItem()\n\t\t */\n\t\tfunction push(item:Object):void;\n\n\t\t/**\n\t\t * Removes the item from the end of the collection and returns it.\n\t\t */\n\t\tfunction pop():Object;\n\n\t\t/**\n\t\t * Adds an item to the beginning of the collection.\n\t\t */\n\t\tfunction unshift(item:Object):void;\n\n\t\t/**\n\t\t * Removes the first item in the collection and returns it.\n\t\t */\n\t\tfunction shift():Object;\n\n\t\t/**\n\t\t * Determines if the specified item is in the collection.\n\t\t *\n\t\t * <p>If the collection is filtered, <code>contains()</code> will return\n\t\t * <code>false</code> for items that are excluded by the filter.</p>\n\t\t */\n\t\tfunction contains(item:Object):Boolean;\n\n\t\t/**\n\t\t * Calls a function for each item in the collection that may be used\n\t\t * to dispose any properties on the item. For example, display objects\n\t\t * or textures may need to be disposed.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function( item:Object ):void</pre>\n\t\t *\n\t\t * <p>In the following example, the items in the collection are disposed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * collection.dispose( function( item:Object ):void\n\t\t * {\n\t\t *     var accessory:DisplayObject = DisplayObject(item.accessory);\n\t\t *     accessory.dispose();\n\t\t * }</listing>\n\t\t *\n\t\t * <p>If the collection has a <code>filterFunction</code>, it will be\n\t\t * removed, and it will not be restored.</p>\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#dispose() starling.display.DisplayObject.dispose()\n\t\t * @see http://doc.starling-framework.org/core/starling/textures/Texture.html#dispose() starling.textures.Texture.dispose()\n\t\t */\n\t\tfunction dispose(disposeItem:Function):void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/data/IListCollectionDataDescriptor.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.data\n{\n\t/**\n\t * An adapter interface to support any kind of data source in\n\t * <code>ListCollection</code>.\n\t *\n\t * @see ListCollection\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic interface IListCollectionDataDescriptor\n\t{\n\t\t/**\n\t\t * The number of items in the data source.\n\t\t */\n\t\tfunction getLength(data:Object):int;\n\n\t\t/**\n\t\t * Returns the item at the specified index in the data source.\n\t\t */\n\t\tfunction getItemAt(data:Object, index:int):Object;\n\n\t\t/**\n\t\t * Replaces the item at the specified index with a new item.\n\t\t */\n\t\tfunction setItemAt(data:Object, item:Object, index:int):void;\n\n\t\t/**\n\t\t * Adds an item to the data source, at the specified index.\n\t\t */\n\t\tfunction addItemAt(data:Object, item:Object, index:int):void;\n\n\t\t/**\n\t\t * Removes the item at the specified index from the data source and\n\t\t * returns it.\n\t\t */\n\t\tfunction removeItemAt(data:Object, index:int):Object;\n\n\t\t/**\n\t\t * Determines which index the item appears at within the data source. If\n\t\t * the item isn't in the data source, returns <code>-1</code>.\n\t\t */\n\t\tfunction getItemIndex(data:Object, item:Object):int;\n\n\t\t/**\n\t\t * Removes all items from the data source.\n\t\t */\n\t\tfunction removeAll(data:Object):void;\n\t}\n}"
  },
  {
    "path": "source/feathers/data/ListCollection.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.data\n{\n\timport feathers.events.CollectionEventType;\n\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\n\t/**\n\t * Dispatched when the underlying data source changes and components will\n\t * need to redraw the data.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the collection has changed drastically, such as when\n\t * the underlying data source is replaced completely.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.RESET\n\t */\n\t[Event(name=\"reset\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is added to the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index of the item that has been\n\t * added. It is of type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.ADD_ITEM\n\t */\n\t[Event(name=\"addItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is removed from the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index of the item that has been\n\t * removed. It is of type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.REMOVE_ITEM\n\t */\n\t[Event(name=\"removeItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is replaced in the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index of the item that has been\n\t * replaced. It is of type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.REPLACE_ITEM\n\t */\n\t[Event(name=\"replaceItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>updateItemAt()</code> function is called on the\n\t * <code>ListCollection</code>.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index of the item that has been\n\t * updated. It is of type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #updateItemAt()\n\t *\n\t * @eventType feathers.events.CollectionEventType.UPDATE_ITEM\n\t */\n\t[Event(name=\"updateItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>updateAll()</code> function is called on the\n\t * <code>ListCollection</code>.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #updateAll()\n\t *\n\t * @eventType feathers.events.CollectionEventType.UPDATE_ALL\n\t */\n\t[Event(name=\"updateAll\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>filterFunction</code> property changes or the\n\t * <code>refresh()</code> function is called on the <code>IListCollection</code>.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #filterFunction\n\t * @see #refresh()\n\t *\n\t * @eventType feathers.events.CollectionEventType.FILTER_CHANGE\n\t */\n\t[Event(name=\"filterChange\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>sortCompareFunction</code> property changes or\n\t * the <code>refresh()</code> function is called on the <code>IListCollection</code>.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #sortCompareFunction\n\t * @see #refresh()\n\t *\n\t * @eventType feathers.events.CollectionEventType.SORT_CHANGE\n\t */\n\t[Event(name=\"sortChange\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Wraps a data source with a common API for use with UI controls, like\n\t * lists, that support one dimensional collections of data. Supports custom\n\t * \"data descriptors\" so that unexpected data sources may be used. Supports\n\t * Arrays, Vectors, and XMLLists automatically.\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class ListCollection extends EventDispatcher implements IListCollection\n\t{\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function ListCollection(data:Object = null)\n\t\t{\n\t\t\tif(!data)\n\t\t\t{\n\t\t\t\t//default to an array if no data is provided\n\t\t\t\tdata = [];\n\t\t\t}\n\t\t\tthis.data = data;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _localDataDescriptor:ArrayListCollectionDataDescriptor;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _localData:Array;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _data:Object;\n\n\t\t/**\n\t\t * The data source for this collection. May be any type of data, but a\n\t\t * <code>dataDescriptor</code> needs to be provided to translate from\n\t\t * the data source's APIs to something that can be understood by\n\t\t * <code>ListCollection</code>.\n\t\t *\n\t\t * <p>Data sources of type Array, Vector, and XMLList are automatically\n\t\t * detected, and no <code>dataDescriptor</code> needs to be set if the\n\t\t * <code>ListCollection</code> uses one of these types.</p>\n\t\t */\n\t\tpublic function get data():Object\n\t\t{\n\t\t\treturn _data;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set data(value:Object):void\n\t\t{\n\t\t\tif(this._data == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._data = value;\n\t\t\t//we'll automatically detect an array, vector, or xmllist for convenience\n\t\t\tif(this._data is Array && !(this._dataDescriptor is ArrayListCollectionDataDescriptor))\n\t\t\t{\n\t\t\t\tthis._dataDescriptor = new ArrayListCollectionDataDescriptor();\n\t\t\t}\n\t\t\telse if(this._data is Vector.<Number> && !(this._dataDescriptor is VectorNumberListCollectionDataDescriptor))\n\t\t\t{\n\t\t\t\tthis._dataDescriptor = new VectorNumberListCollectionDataDescriptor();\n\t\t\t}\n\t\t\telse if(this._data is Vector.<int> && !(this._dataDescriptor is VectorIntListCollectionDataDescriptor))\n\t\t\t{\n\t\t\t\tthis._dataDescriptor = new VectorIntListCollectionDataDescriptor();\n\t\t\t}\n\t\t\telse if(this._data is Vector.<uint> && !(this._dataDescriptor is VectorUintListCollectionDataDescriptor))\n\t\t\t{\n\t\t\t\tthis._dataDescriptor = new VectorUintListCollectionDataDescriptor();\n\t\t\t}\n\t\t\telse if(this._data is Vector.<*> && !(this._dataDescriptor is VectorListCollectionDataDescriptor))\n\t\t\t{\n\t\t\t\tthis._dataDescriptor = new VectorListCollectionDataDescriptor();\n\t\t\t}\n\t\t\telse if(this._data is XMLList && !(this._dataDescriptor is XMLListListCollectionDataDescriptor))\n\t\t\t{\n\t\t\t\tthis._dataDescriptor = new XMLListListCollectionDataDescriptor();\n\t\t\t}\n\t\t\tif(this._data === null)\n\t\t\t{\n\t\t\t\tthis._dataDescriptor = null;\n\t\t\t}\n\t\t\tthis.dispatchEventWith(CollectionEventType.RESET);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _dataDescriptor:IListCollectionDataDescriptor;\n\n\t\t/**\n\t\t * Describes the underlying data source by translating APIs.\n\t\t *\n\t\t * @see IListCollectionDataDescriptor\n\t\t */\n\t\tpublic function get dataDescriptor():IListCollectionDataDescriptor\n\t\t{\n\t\t\treturn this._dataDescriptor;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set dataDescriptor(value:IListCollectionDataDescriptor):void\n\t\t{\n\t\t\tif(this._dataDescriptor == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._dataDescriptor = value;\n\t\t\tthis.dispatchEventWith(CollectionEventType.RESET);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _pendingRefresh:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _filterFunction:Function = null;\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#filterFunction\n\t\t */\n\t\tpublic function get filterFunction():Function\n\t\t{\n\t\t\treturn this._filterFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set filterFunction(value:Function):void\n\t\t{\n\t\t\tif(this._filterFunction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._filterFunction = value;\n\t\t\tthis._pendingRefresh = true;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tthis.dispatchEventWith(CollectionEventType.FILTER_CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _sortCompareFunction:Function = null;\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#sortCompareFunction\n\t\t */\n\t\tpublic function get sortCompareFunction():Function\n\t\t{\n\t\t\treturn this._sortCompareFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set sortCompareFunction(value:Function):void\n\t\t{\n\t\t\tif(this._sortCompareFunction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._sortCompareFunction = value;\n\t\t\tthis._pendingRefresh = true;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tthis.dispatchEventWith(CollectionEventType.SORT_CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#length\n\t\t */\n\t\tpublic function get length():int\n\t\t{\n\t\t\tif(!this._dataDescriptor)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tif(this._pendingRefresh)\n\t\t\t{\n\t\t\t\tthis.refreshFilterAndSort();\n\t\t\t}\n\t\t\tif(this._localData !== null)\n\t\t\t{\n\t\t\t\treturn this._localDataDescriptor.getLength(this._localData);\n\t\t\t}\n\t\t\treturn this._dataDescriptor.getLength(this._data);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#refresh()\n\t\t */\n\t\tpublic function refresh():void\n\t\t{\n\t\t\tif(this._filterFunction === null && this._sortCompareFunction === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._pendingRefresh = true;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tif(this._filterFunction !== null)\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(CollectionEventType.FILTER_CHANGE);\n\t\t\t}\n\t\t\tif(this._sortCompareFunction !== null)\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(CollectionEventType.SORT_CHANGE);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshFilterAndSort():void\n\t\t{\n\t\t\tthis._pendingRefresh = false;\n\t\t\tif(this._filterFunction !== null)\n\t\t\t{\n\t\t\t\tvar result:Array = this._localData;\n\t\t\t\tif(result !== null)\n\t\t\t\t{\n\t\t\t\t\t//reuse the old array to avoid garbage collection\n\t\t\t\t\tresult.length = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tresult = [];\n\t\t\t\t}\n\t\t\t\tvar count:int = this._dataDescriptor.getLength(this._data);\n\t\t\t\tvar pushIndex:int = 0;\n\t\t\t\tfor(var i:int = 0; i < count; i++)\n\t\t\t\t{\n\t\t\t\t\tvar item:Object = this._dataDescriptor.getItemAt(this._data, i);\n\t\t\t\t\tif(this._filterFunction(item))\n\t\t\t\t\t{\n\t\t\t\t\t\tresult[pushIndex] = item;\n\t\t\t\t\t\tpushIndex++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis._localData = result;\n\t\t\t\tthis._localDataDescriptor = new ArrayListCollectionDataDescriptor();\n\t\t\t}\n\t\t\telse if(this._sortCompareFunction !== null) //no filter\n\t\t\t{\n\t\t\t\tcount = this._dataDescriptor.getLength(this._data);\n\t\t\t\tif(this._localData === null)\n\t\t\t\t{\n\t\t\t\t\tthis._localData = new Array(count);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._localData.length = count;\n\t\t\t\t}\n\t\t\t\tfor(i = 0; i < count; i++)\n\t\t\t\t{\n\t\t\t\t\tthis._localData[i] = this._dataDescriptor.getItemAt(this._data, i);\n\t\t\t\t}\n\t\t\t\tthis._localDataDescriptor = new ArrayListCollectionDataDescriptor();\n\t\t\t}\n\t\t\telse //no filter or sort\n\t\t\t{\n\t\t\t\tthis._localData = null;\n\t\t\t\tthis._localDataDescriptor = null;\n\t\t\t}\n\t\t\tif(this._sortCompareFunction !== null)\n\t\t\t{\n\t\t\t\tthis._localData.sort(this._sortCompareFunction);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#updateItemAt()\n\t\t *\n\t\t * @see #updateAll()\n\t\t */\n\t\tpublic function updateItemAt(index:int):void\n\t\t{\n\t\t\tthis.dispatchEventWith(CollectionEventType.UPDATE_ITEM, false, index);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#updateAll()\n\t\t *\n\t\t * @see #updateItemAt()\n\t\t */\n\t\tpublic function updateAll():void\n\t\t{\n\t\t\tthis.dispatchEventWith(CollectionEventType.UPDATE_ALL);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#getItemAt()\n\t\t */\n\t\tpublic function getItemAt(index:int):Object\n\t\t{\n\t\t\tif(this._pendingRefresh)\n\t\t\t{\n\t\t\t\tthis.refreshFilterAndSort();\n\t\t\t}\n\t\t\tif(this._localData !== null)\n\t\t\t{\n\t\t\t\treturn this._localDataDescriptor.getItemAt(this._localData, index);\n\t\t\t}\n\t\t\treturn this._dataDescriptor.getItemAt(this._data, index);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#getItemIndex()\n\t\t */\n\t\tpublic function getItemIndex(item:Object):int\n\t\t{\n\t\t\tif(this._pendingRefresh)\n\t\t\t{\n\t\t\t\tthis.refreshFilterAndSort();\n\t\t\t}\n\t\t\tif(this._localData !== null)\n\t\t\t{\n\t\t\t\treturn this._localDataDescriptor.getItemIndex(this._localData, item);\n\t\t\t}\n\t\t\treturn this._dataDescriptor.getItemIndex(this._data, item);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#addItemAt()\n\t\t */\n\t\tpublic function addItemAt(item:Object, index:int):void\n\t\t{\n\t\t\tif(this._pendingRefresh)\n\t\t\t{\n\t\t\t\tthis.refreshFilterAndSort();\n\t\t\t}\n\t\t\tif(this._localData !== null)\n\t\t\t{\n\t\t\t\tif(index < this._localDataDescriptor.getLength(this._localData))\n\t\t\t\t{\n\t\t\t\t\t//find the item at the index in the filtered data, and use\n\t\t\t\t\t//its index from the unfiltered data\n\t\t\t\t\tvar oldItem:Object = this._localDataDescriptor.getItemAt(this._localData, index);\n\t\t\t\t\tvar unfilteredIndex:int = this._dataDescriptor.getItemIndex(this._data, oldItem);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//if the item is added at the end of the filtered data\n\t\t\t\t\t//then add it at the end of the unfiltered data\n\t\t\t\t\tunfilteredIndex = this._dataDescriptor.getLength(this._data);\n\t\t\t\t}\n\t\t\t\t//always add to the original data\n\t\t\t\tthis._dataDescriptor.addItemAt(this._data, item, unfilteredIndex);\n\t\t\t\t//but check if the item should be in the filtered data\n\t\t\t\tvar includeItem:Boolean = true;\n\t\t\t\tif(this._filterFunction !== null)\n\t\t\t\t{\n\t\t\t\t\tincludeItem = this._filterFunction(item);\n\t\t\t\t}\n\t\t\t\tif(includeItem)\n\t\t\t\t{\n\t\t\t\t\tvar sortedIndex:int = index;\n\t\t\t\t\tif(this._sortCompareFunction !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tsortedIndex = this.getSortedInsertionIndex(item);\n\t\t\t\t\t}\n\t\t\t\t\tthis._localDataDescriptor.addItemAt(this._localData, item, sortedIndex);\n\t\t\t\t\t//don't dispatch these events if the item is filtered!\n\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\tthis.dispatchEventWith(CollectionEventType.ADD_ITEM, false, sortedIndex);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //no filter or sort\n\t\t\t{\n\t\t\t\tthis._dataDescriptor.addItemAt(this._data, item, index);\n\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\tthis.dispatchEventWith(CollectionEventType.ADD_ITEM, false, index);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#removeItemAt()\n\t\t */\n\t\tpublic function removeItemAt(index:int):Object\n\t\t{\n\t\t\tif(this._pendingRefresh)\n\t\t\t{\n\t\t\t\tthis.refreshFilterAndSort();\n\t\t\t}\n\t\t\tif(this._localData !== null)\n\t\t\t{\n\t\t\t\tvar item:Object = this._localDataDescriptor.removeItemAt(this._localData, index);\n\t\t\t\tvar unfilteredIndex:int = this._dataDescriptor.getItemIndex(this._data, item);\n\t\t\t\tthis._dataDescriptor.removeItemAt(this._data, unfilteredIndex);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\titem = this._dataDescriptor.removeItemAt(this._data, index);\n\t\t\t}\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tthis.dispatchEventWith(CollectionEventType.REMOVE_ITEM, false, index);\n\t\t\treturn item;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#removeItem()\n\t\t */\n\t\tpublic function removeItem(item:Object):void\n\t\t{\n\t\t\tvar index:int = this.getItemIndex(item);\n\t\t\tif(index >= 0)\n\t\t\t{\n\t\t\t\tthis.removeItemAt(index);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#removeAll()\n\t\t */\n\t\tpublic function removeAll():void\n\t\t{\n\t\t\tif(this._pendingRefresh)\n\t\t\t{\n\t\t\t\tthis.refreshFilterAndSort();\n\t\t\t}\n\t\t\tif(this.length == 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._localData !== null)\n\t\t\t{\n\t\t\t\tthis._localDataDescriptor.removeAll(this._localData);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._dataDescriptor.removeAll(this._data);\n\t\t\t}\n\t\t\tthis.dispatchEventWith(CollectionEventType.REMOVE_ALL);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#setItemAt()\n\t\t */\n\t\tpublic function setItemAt(item:Object, index:int):void\n\t\t{\n\t\t\tif(this._pendingRefresh)\n\t\t\t{\n\t\t\t\tthis.refreshFilterAndSort();\n\t\t\t}\n\t\t\tif(this._localData !== null)\n\t\t\t{\n\t\t\t\tvar oldItem:Object = this._localDataDescriptor.getItemAt(this._localData, index);\n\t\t\t\tvar unfilteredIndex:int = this._dataDescriptor.getItemIndex(this._data, oldItem);\n\t\t\t\tthis._dataDescriptor.setItemAt(this._data, item, unfilteredIndex);\n\t\t\t\tif(this._filterFunction !== null)\n\t\t\t\t{\n\t\t\t\t\tvar includeItem:Boolean = this._filterFunction(item);\n\t\t\t\t\tif(includeItem)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._localDataDescriptor.setItemAt(this._localData, item, index);\n\t\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\t\tthis.dispatchEventWith(CollectionEventType.REPLACE_ITEM, false, index);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//if the item is excluded, the item at this index is\n\t\t\t\t\t\t//removed instead of being replaced by the new item\n\t\t\t\t\t\tthis._localDataDescriptor.removeItemAt(this._localData, index);\n\t\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\t\tthis.dispatchEventWith(CollectionEventType.REMOVE_ITEM, false, index);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(this._sortCompareFunction !== null)\n\t\t\t\t{\n\t\t\t\t\t//remove the old item first!\n\t\t\t\t\tthis._localDataDescriptor.removeItemAt(this._localData, index);\n\t\t\t\t\t//then try to figure out where the new item goes when inserted\n\t\t\t\t\tvar sortedIndex:int = this.getSortedInsertionIndex(item);\n\t\t\t\t\tthis._localDataDescriptor.setItemAt(this._localData, item, sortedIndex);\n\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\tthis.dispatchEventWith(CollectionEventType.REPLACE_ITEM, false, index);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //no filter or sort\n\t\t\t{\n\t\t\t\tthis._dataDescriptor.setItemAt(this._data, item, index);\n\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\tthis.dispatchEventWith(CollectionEventType.REPLACE_ITEM, false, index);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#addItem()\n\t\t */\n\t\tpublic function addItem(item:Object):void\n\t\t{\n\t\t\tthis.addItemAt(item, this.length);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#push()\n\t\t *\n\t\t * @see #addItem()\n\t\t */\n\t\tpublic function push(item:Object):void\n\t\t{\n\t\t\tthis.addItemAt(item, this.length);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#addAll()\n\t\t */\n\t\tpublic function addAll(collection:IListCollection):void\n\t\t{\n\t\t\tvar otherCollectionLength:int = collection.length;\n\t\t\tfor(var i:int = 0; i < otherCollectionLength; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = collection.getItemAt(i);\n\t\t\t\tthis.addItem(item);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#addAllAt()\n\t\t */\n\t\tpublic function addAllAt(collection:IListCollection, index:int):void\n\t\t{\n\t\t\tvar otherCollectionLength:int = collection.length;\n\t\t\tvar currentIndex:int = index;\n\t\t\tfor(var i:int = 0; i < otherCollectionLength; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = collection.getItemAt(i);\n\t\t\t\tthis.addItemAt(item, currentIndex);\n\t\t\t\tcurrentIndex++;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#reset()\n\t\t */\n\t\tpublic function reset(collection:IListCollection):void\n\t\t{\n\t\t\tthis._dataDescriptor.removeAll(this._data);\n\t\t\tvar otherCollectionLength:int = collection.length;\n\t\t\tfor(var i:int = 0; i < otherCollectionLength; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = collection.getItemAt(i);\n\t\t\t\tthis._dataDescriptor.addItemAt(this._data, item, i);\n\t\t\t}\n\t\t\tthis.dispatchEventWith(CollectionEventType.RESET);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#pop()\n\t\t */\n\t\tpublic function pop():Object\n\t\t{\n\t\t\treturn this.removeItemAt(this.length - 1);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#unshift()\n\t\t */\n\t\tpublic function unshift(item:Object):void\n\t\t{\n\t\t\tthis.addItemAt(item, 0);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#shift()\n\t\t */\n\t\tpublic function shift():Object\n\t\t{\n\t\t\treturn this.removeItemAt(0);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#contains()\n\t\t */\n\t\tpublic function contains(item:Object):Boolean\n\t\t{\n\t\t\treturn this.getItemIndex(item) >= 0;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#dispose()\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#dispose() starling.display.DisplayObject.dispose()\n\t\t * @see http://doc.starling-framework.org/core/starling/textures/Texture.html#dispose() starling.textures.Texture.dispose()\n\t\t */\n\t\tpublic function dispose(disposeItem:Function):void\n\t\t{\n\t\t\t//if we're disposing the collection, filters don't matter anymore,\n\t\t\t//and we should ensure that all items are disposed.\n\t\t\tthis._filterFunction = null;\n\t\t\tthis.refreshFilterAndSort();\n\n\t\t\tvar itemCount:int = this.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = this.getItemAt(i);\n\t\t\t\tdisposeItem(item);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getSortedInsertionIndex(item:Object):int\n\t\t{\n\t\t\tvar itemCount:int = this._localDataDescriptor.getLength(this._localData);\n\t\t\tif(this._sortCompareFunction === null)\n\t\t\t{\n\t\t\t\treturn itemCount;\n\t\t\t}\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar otherItem:Object = this._localDataDescriptor.getItemAt(this._localData, i);\n\t\t\t\tvar result:int = this._sortCompareFunction(item, otherItem);\n\t\t\t\tif(result < 1)\n\t\t\t\t{\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn itemCount;\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/data/LocalAutoCompleteSource.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.data\n{\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\n\t/**\n\t * Dispatched when the suggestions finish loading.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>A <code>ListCollection</code> containing\n\t *   the suggestions to display.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.COMPLETE\n\t */\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Creates a list of suggestions for an <code>AutoComplete</code> component\n\t * by searching through items in a <code>ListCollection</code>.\n\t *\n\t * @see feathers.controls.AutoComplete\n\t * @see feathers.data.ListCollection\n\t *\n\t * @productversion Feathers 2.1.0\n\t */\n\tpublic class LocalAutoCompleteSource extends EventDispatcher implements IAutoCompleteSource\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultCompareFunction(item:Object, textToMatch:String):Boolean\n\t\t{\n\t\t\treturn item.toString().toLowerCase().indexOf(textToMatch.toLowerCase()) >= 0;\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function LocalAutoCompleteSource(source:IListCollection = null)\n\t\t{\n\t\t\tthis._dataProvider = source;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _dataProvider:IListCollection;\n\n\t\t/**\n\t\t * A collection of items to be used as a source for auto-complete\n\t\t * results.\n\t\t */\n\t\tpublic function get dataProvider():IListCollection\n\t\t{\n\t\t\treturn this._dataProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set dataProvider(value:IListCollection):void\n\t\t{\n\t\t\tthis._dataProvider = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _compareFunction:Function = defaultCompareFunction;\n\n\t\t/**\n\t\t * A function used to compare items from the data provider with the\n\t\t * string passed to the <code>load()</code> function in order to\n\t\t * generate a list of suggestions. The function should return\n\t\t * <code>true</code> if the item should be included in the list of\n\t\t * suggestions.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function( item:Object, textToMatch:String ):Boolean</pre>\n\t\t */\n\t\tpublic function get compareFunction():Function\n\t\t{\n\t\t\treturn this._compareFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set compareFunction(value:Function):void\n\t\t{\n\t\t\tif(value === null)\n\t\t\t{\n\t\t\t\tvalue = defaultCompareFunction;\n\t\t\t}\n\t\t\tthis._compareFunction = value;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IAutoCompleteSource#load()\n\t\t */\n\t\tpublic function load(textToMatch:String, result:IListCollection = null):void\n\t\t{\n\t\t\tif(result)\n\t\t\t{\n\t\t\t\tresult.removeAll();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult = new ArrayCollection();\n\t\t\t}\n\t\t\tif(!this._dataProvider || textToMatch.length == 0)\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(Event.COMPLETE, false, result);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar compareFunction:Function = this._compareFunction;\n\t\t\tfor(var i:int = 0; i < this._dataProvider.length; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = this._dataProvider.getItemAt(i);\n\t\t\t\tif(compareFunction(item, textToMatch))\n\t\t\t\t{\n\t\t\t\t\tresult.addItem(item);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.dispatchEventWith(Event.COMPLETE, false, result);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/data/SortOrder.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.data\n{\n\t/**\n\t * Constants for sorting of items in a collection.\n\t *\n\t * <p>Note: Some constants may not be valid for certain properties. Please\n\t * see the description of the property in the API reference for full\n\t * details.</p>\n\t *\n\t * @productversion Feathers 3.4.0\n\t */\n\tpublic class SortOrder\n\t{\n\t\t/**\n\t\t * Indicates that items are sorted in ascending order.\n\t\t *\n\t\t * @productversion Feathers 3.4.0\n\t\t */\n\t\tpublic static const ASCENDING:String = \"ascending\";\n\n\t\t/**\n\t\t * Indicates that items are sorted in descending order.\n\t\t *\n\t\t * @productversion Feathers 3.4.0\n\t\t */\n\t\tpublic static const DESCENDING:String = \"descending\";\n\n\t\t/**\n\t\t * Indicates that items are not sorted.\n\t\t *\n\t\t * @productversion Feathers 3.4.0\n\t\t */\n\t\tpublic static const NONE:String = \"none\";\n\t}\n}"
  },
  {
    "path": "source/feathers/data/URLAutoCompleteSource.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.data\n{\n\timport flash.events.ErrorEvent;\n\timport flash.events.Event;\n\timport flash.events.IOErrorEvent;\n\timport flash.events.SecurityErrorEvent;\n\timport flash.net.URLLoader;\n\timport flash.net.URLLoaderDataFormat;\n\timport flash.net.URLRequest;\n\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\n\t/**\n\t * Dispatched when the suggestions finish loading.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>A <code>ListCollection</code> containing\n\t *   the suggestions to display.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.COMPLETE\n\t */\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Creates a list of suggestions for an <code>AutoComplete</code> component\n\t * by loading data from a URL.\n\t *\n\t * <p>Data may be filtered on the server or on the client. The\n\t * <code>urlRequestFunction</code> may be used to include the text from the\n\t * <code>AutoComplete</code> in the request sent to the server.\n\t * Alternatively, the <code>parseResultFunction</code> may filter the\n\t * result on the client.</p>\n\t *\n\t * <p>By default, the <code>URLAutoCompleteSource</code> will parse a JSON\n\t * string. However, a custom <code>parseResultFunction</code> may be\n\t * provided to parse other formats.</p>\n\t *\n\t * @see feathers.controls.AutoComplete\n\t *\n\t * @productversion Feathers 2.1.0\n\t */\n\tpublic class URLAutoCompleteSource extends EventDispatcher implements IAutoCompleteSource\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultParseResultFunction(result:String):Object\n\t\t{\n\t\t\treturn JSON.parse(result);\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function URLAutoCompleteSource(urlRequestFunction:Function, parseResultFunction:Function = null)\n\t\t{\n\t\t\tthis.urlRequestFunction = urlRequestFunction;\n\t\t\tthis.parseResultFunction = parseResultFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _cachedResult:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _urlRequestFunction:Function;\n\n\t\t/**\n\t\t * A function called by the auto-complete source that builds the\n\t\t * <code>flash.net.URLRequest</code> that is to be loaded.\n\t\t *\n\t\t * <p>The function is expected to have one of the following signatures:</p>\n\t\t * <pre>function( textToMatch:String ):URLRequest</pre>\n\t\t * <pre>function():URLRequest</pre>\n\t\t *\n\t\t * <p>The function may optionally accept one argument, the text\n\t\t * entered into the <code>AutoComplete</code> component. If available,\n\t\t * this argument should be included in the <code>URLRequest</code>, and\n\t\t * the server-side script should use it to return a pre-filtered result.\n\t\t * Alternatively, if the function accepts zero arguments, a static URL\n\t\t * will be called, and the <code>parseResultFunction</code> may be used\n\t\t * to filter the result on the client side instead.</p>\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLRequest.html Full description of flash.net.URLRequest in Adobe's Flash Platform API Reference\n\t\t * @see #parseResultFunction\n\t\t */\n\t\tpublic function get urlRequestFunction():Function\n\t\t{\n\t\t\treturn this._urlRequestFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set urlRequestFunction(value:Function):void\n\t\t{\n\t\t\tif(this._urlRequestFunction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._urlRequestFunction = value;\n\t\t\tthis._cachedResult = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _parseResultFunction:Function = defaultParseResultFunction;\n\n\t\t/**\n\t\t * A function that parses the result loaded from the URL. Any plain-text\n\t\t * data format may be accepted by providing a custom parse function. The\n\t\t * default function parses the result as JSON.\n\t\t *\n\t\t * <p>The function is expected to have one of the following signatures:</p>\n\t\t * <pre>function( loadedText:String ):Object</pre>\n\t\t * <pre>function( loadedText:String, textToMatch:String ):Object</pre>\n\t\t *\n\t\t * <p>The function may accept one or two arguments. The first argument\n\t\t * is always the plain-text result returned from the URL. Optionally,\n\t\t * the second argument is the text entered into the\n\t\t * <code>AutoComplete</code> component. It may be used to filter the\n\t\t * result on the client side. It is meant to be used when the\n\t\t * <code>urlRequestFunction</code> accepts zero arguments and does not\n\t\t * pass the text entered into the <code>AutoComplete</code> component\n\t\t * to the server.</p>\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/JSON.html#parse() Full description of JSON.parse() in Adobe's Flash Platform API Reference\n\t\t * @see #urlRequestFunction\n\t\t */\n\t\tpublic function get parseResultFunction():Function\n\t\t{\n\t\t\treturn this._parseResultFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set parseResultFunction(value:Function):void\n\t\t{\n\t\t\tif(value === null)\n\t\t\t{\n\t\t\t\tvalue = defaultParseResultFunction;\n\t\t\t}\n\t\t\tif(this._parseResultFunction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._parseResultFunction = value;\n\t\t\tthis._cachedResult = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _intermediateCollection:ListCollection = new ListCollection();\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _savedSuggestionsCollection:IListCollection;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _savedTextToMatch:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _urlLoader:URLLoader;\n\n\t\t/**\n\t\t * @copy feathers.data.IAutoCompleteSource#load()\n\t\t */\n\t\tpublic function load(textToMatch:String, suggestionsResult:IListCollection = null):void\n\t\t{\n\t\t\tif(!suggestionsResult)\n\t\t\t{\n\t\t\t\tsuggestionsResult = new ArrayCollection();\n\t\t\t}\n\t\t\tvar urlRequestFunction:Function = this._urlRequestFunction;\n\t\t\tvar request:URLRequest;\n\t\t\tif(urlRequestFunction.length == 1)\n\t\t\t{\n\t\t\t\trequest = URLRequest(urlRequestFunction(textToMatch));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(this._cachedResult !== null)\n\t\t\t\t{\n\t\t\t\t\tthis.parseData(this._cachedResult, textToMatch, suggestionsResult);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\trequest = URLRequest(urlRequestFunction());\n\t\t\t}\n\t\t\tthis._savedSuggestionsCollection = suggestionsResult;\n\t\t\tthis._savedTextToMatch = textToMatch;\n\t\t\tif(this._urlLoader)\n\t\t\t{\n\t\t\t\tthis._urlLoader.close();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._urlLoader = new URLLoader();\n\t\t\t\tthis._urlLoader.dataFormat = URLLoaderDataFormat.TEXT;\n\t\t\t\tthis._urlLoader.addEventListener(flash.events.Event.COMPLETE, urlLoader_completeHandler);\n\t\t\t\tthis._urlLoader.addEventListener(IOErrorEvent.IO_ERROR, urlLoader_errorHandler);\n\t\t\t\tthis._urlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, urlLoader_errorHandler);\n\t\t\t}\n\t\t\tthis._urlLoader.load(request);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function parseData(resultText:String, textToMatch:String, suggestions:IListCollection):void\n\t\t{\n\t\t\tvar parseResultFunction:Function = this._parseResultFunction;\n\t\t\tif(parseResultFunction.length == 2)\n\t\t\t{\n\t\t\t\t//this is kind of hacky, and maybe it would be better to modify\n\t\t\t\t//parseResultFunction to return an IListCollection\n\t\t\t\tthis._intermediateCollection.data = parseResultFunction(resultText, textToMatch);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._intermediateCollection.data = parseResultFunction(resultText);\n\t\t\t}\n\t\t\tsuggestions.reset(this._intermediateCollection);\n\t\t\tthis.dispatchEventWith(starling.events.Event.COMPLETE, false, suggestions);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function urlLoader_completeHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tvar suggestions:IListCollection = this._savedSuggestionsCollection;\n\t\t\tthis._savedSuggestionsCollection = null;\n\t\t\tvar textToMatch:String = this._savedTextToMatch;\n\t\t\tthis._savedTextToMatch = null;\n\n\t\t\tvar loadedData:String = this._urlLoader.data as String;\n\t\t\tif(this._urlRequestFunction.length == 0)\n\t\t\t{\n\t\t\t\tthis._cachedResult = loadedData;\n\t\t\t}\n\t\t\tif(loadedData)\n\t\t\t{\n\t\t\t\tthis.parseData(loadedData, textToMatch, suggestions);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tsuggestions.removeAll();\n\t\t\t\tthis.dispatchEventWith(starling.events.Event.COMPLETE, false, suggestions);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function urlLoader_errorHandler(event:ErrorEvent):void\n\t\t{\n\t\t\tvar result:IListCollection = this._savedSuggestionsCollection;\n\t\t\tresult.removeAll();\n\t\t\tthis._savedSuggestionsCollection = null;\n\t\t\tthis.dispatchEventWith(starling.events.Event.COMPLETE, false, result);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "source/feathers/data/VectorCollection.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.data\n{\n\timport feathers.events.CollectionEventType;\n\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\n\t[Exclude(name=\"data\",kind=\"property\")]\n\n\t/**\n\t * Dispatched when the underlying data source changes and components will\n\t * need to redraw the data.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the collection has changed drastically, such as when\n\t * the underlying data source is replaced completely.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.RESET\n\t */\n\t[Event(name=\"reset\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is added to the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index of the item that has been\n\t * added. It is of type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.ADD_ITEM\n\t */\n\t[Event(name=\"addItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is removed from the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index of the item that has been\n\t * removed. It is of type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.REMOVE_ITEM\n\t */\n\t[Event(name=\"removeItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is replaced in the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index of the item that has been\n\t * replaced. It is of type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.REPLACE_ITEM\n\t */\n\t[Event(name=\"replaceItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>updateItemAt()</code> function is called on the\n\t * <code>ListCollection</code>.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index of the item that has been\n\t * updated. It is of type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #updateItemAt()\n\t *\n\t * @eventType feathers.events.CollectionEventType.UPDATE_ITEM\n\t */\n\t[Event(name=\"updateItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>updateAll()</code> function is called on the\n\t * <code>ListCollection</code>.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #updateAll()\n\t *\n\t * @eventType feathers.events.CollectionEventType.UPDATE_ALL\n\t */\n\t[Event(name=\"updateAll\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>filterFunction</code> property changes or the\n\t * <code>refresh()</code> function is called on the <code>IListCollection</code>.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #filterFunction\n\t * @see #refresh()\n\t *\n\t * @eventType feathers.events.CollectionEventType.FILTER_CHANGE\n\t */\n\t[Event(name=\"filterChange\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>sortCompareFunction</code> property changes or\n\t * the <code>refresh()</code> function is called on the <code>IListCollection</code>.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #sortCompareFunction\n\t * @see #refresh()\n\t *\n\t * @eventType feathers.events.CollectionEventType.SORT_CHANGE\n\t */\n\t[Event(name=\"sortChange\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Wraps a <code>Vector</code> in the common <code>IListCollection</code>\n\t * API used by many Feathers UI controls, including <code>List</code> and\n\t * <code>TabBar</code>.\n\t *\n\t * @productversion Feathers 3.3.0\n\t */\n\tpublic class VectorCollection extends EventDispatcher implements IListCollection\n\t{\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function VectorCollection(data:Object = null)\n\t\t{\n\t\t\tif(data === null)\n\t\t\t{\n\t\t\t\tdata = new <*>[];\n\t\t\t}\n\t\t\telse if(!(data is Vector.<*>))\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"VectorCollection data must be of type Vector\");\n\t\t\t}\n\t\t\tthis._vectorData = data;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _filterAndSortData:Object;\n\n\t\t/**\n\t\t * @private\n\t\t * Due to bugs in the older ASC1 compiler, we cannot type this variable\n\t\t * as Vector.<*>. It will result in failures decoding abc bytecode.\n\t\t */\n\t\tprotected var _vectorData:Object;\n\n\t\t/**\n\t\t * The <code>Vector</code> data source for this collection.\n\t\t *\n\t\t * <p>Note: Ideally, this property would be typed as something other\n\t\t * than <code>Object</code>, but there is no type that will accept all\n\t\t * <code>Vector</code> objects without requiring a cast first.</p>\n\t\t */\n\t\tpublic function get vectorData():Object\n\t\t{\n\t\t\treturn this._vectorData;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set vectorData(value:Object):void\n\t\t{\n\t\t\tif(this._vectorData === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if(value !== null && !(value is Vector.<*>))\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"VectorCollection vectorData must be of type Vector\");\n\t\t\t}\n\t\t\tthis._vectorData = value as Vector.<*>;\n\t\t\tthis.dispatchEventWith(CollectionEventType.RESET);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _pendingRefresh:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _filterFunction:Function = null;\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#filterFunction\n\t\t */\n\t\tpublic function get filterFunction():Function\n\t\t{\n\t\t\treturn this._filterFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set filterFunction(value:Function):void\n\t\t{\n\t\t\tif(this._filterFunction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._filterFunction = value;\n\t\t\tthis._pendingRefresh = true;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tthis.dispatchEventWith(CollectionEventType.FILTER_CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _sortCompareFunction:Function = null;\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#sortCompareFunction\n\t\t */\n\t\tpublic function get sortCompareFunction():Function\n\t\t{\n\t\t\treturn this._sortCompareFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set sortCompareFunction(value:Function):void\n\t\t{\n\t\t\tif(this._sortCompareFunction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._sortCompareFunction = value;\n\t\t\tthis._pendingRefresh = true;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tthis.dispatchEventWith(CollectionEventType.SORT_CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#length\n\t\t */\n\t\tpublic function get length():int\n\t\t{\n\t\t\tif(this._pendingRefresh)\n\t\t\t{\n\t\t\t\tthis.refreshFilterAndSort();\n\t\t\t}\n\t\t\tif(this._filterAndSortData !== null)\n\t\t\t{\n\t\t\t\treturn (this._filterAndSortData as Vector.<*>).length;\n\t\t\t}\n\t\t\treturn (this._vectorData as Vector.<*>).length;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#refreshFilter()\n\t\t */\n\t\tpublic function refresh():void\n\t\t{\n\t\t\tif(this._filterFunction === null && this._sortCompareFunction === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._pendingRefresh = true;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tif(this._filterFunction !== null)\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(CollectionEventType.FILTER_CHANGE);\n\t\t\t}\n\t\t\tif(this._sortCompareFunction !== null)\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(CollectionEventType.SORT_CHANGE);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshFilterAndSort():void\n\t\t{\n\t\t\tthis._pendingRefresh = false;\n\t\t\tif(this._filterFunction !== null)\n\t\t\t{\n\t\t\t\tvar result:Vector.<*> = this._filterAndSortData as Vector.<*>;\n\t\t\t\tif(result !== null)\n\t\t\t\t{\n\t\t\t\t\t//reuse the old array to avoid garbage collection\n\t\t\t\t\tresult.length = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tresult = new <*>[];\n\t\t\t\t}\n\t\t\t\tvar vectorData:Vector.<*> = this._vectorData as Vector.<*>;\n\t\t\t\tvar itemCount:int = vectorData.length;\n\t\t\t\tvar pushIndex:int = 0;\n\t\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar item:Object = vectorData[i];\n\t\t\t\t\tif(this._filterFunction(item))\n\t\t\t\t\t{\n\t\t\t\t\t\tresult[pushIndex] = item;\n\t\t\t\t\t\tpushIndex++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis._filterAndSortData = result;\n\t\t\t}\n\t\t\telse if(this._sortCompareFunction !== null) //no filter\n\t\t\t{\n\t\t\t\titemCount = this._vectorData.length;\n\t\t\t\tresult = this._filterAndSortData as Vector.<*>;\n\t\t\t\tif(result !== null)\n\t\t\t\t{\n\t\t\t\t\tresult.length = itemCount;\n\t\t\t\t\tfor(i = 0; i < itemCount; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tresult[i] = this._vectorData[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//simply make a copy!\n\t\t\t\t\tresult = this._vectorData.slice();\n\t\t\t\t}\n\t\t\t\tthis._filterAndSortData = result;\n\t\t\t}\n\t\t\telse //no filter or sort\n\t\t\t{\n\t\t\t\tthis._filterAndSortData = null;\n\t\t\t}\n\t\t\tif(this._sortCompareFunction !== null)\n\t\t\t{\n\t\t\t\tthis._filterAndSortData.sort(this._sortCompareFunction);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#updateItemAt()\n\t\t *\n\t\t * @see #updateAll()\n\t\t */\n\t\tpublic function updateItemAt(index:int):void\n\t\t{\n\t\t\tthis.dispatchEventWith(CollectionEventType.UPDATE_ITEM, false, index);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#updateAll()\n\t\t *\n\t\t * @see #updateItemAt()\n\t\t */\n\t\tpublic function updateAll():void\n\t\t{\n\t\t\tthis.dispatchEventWith(CollectionEventType.UPDATE_ALL);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#getItemAt()\n\t\t */\n\t\tpublic function getItemAt(index:int):Object\n\t\t{\n\t\t\tif(this._pendingRefresh)\n\t\t\t{\n\t\t\t\tthis.refreshFilterAndSort();\n\t\t\t}\n\t\t\tif(this._filterAndSortData !== null)\n\t\t\t{\n\t\t\t\treturn this._filterAndSortData[index];\n\t\t\t}\n\t\t\treturn (this._vectorData as Vector.<*>)[index];\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#getItemIndex()\n\t\t */\n\t\tpublic function getItemIndex(item:Object):int\n\t\t{\n\t\t\tif(this._pendingRefresh)\n\t\t\t{\n\t\t\t\tthis.refreshFilterAndSort();\n\t\t\t}\n\t\t\tif(this._filterAndSortData !== null)\n\t\t\t{\n\t\t\t\treturn (this._filterAndSortData as Vector.<*>).indexOf(item);\n\t\t\t}\n\t\t\treturn (this._vectorData as Vector.<*>).indexOf(item);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#addItemAt()\n\t\t */\n\t\tpublic function addItemAt(item:Object, index:int):void\n\t\t{\n\t\t\tif(this._pendingRefresh)\n\t\t\t{\n\t\t\t\tthis.refreshFilterAndSort();\n\t\t\t}\n\t\t\tvar filteredData:Vector.<*> = this._filterAndSortData as Vector.<*>;\n\t\t\tvar vectorData:Vector.<*> = this._vectorData as Vector.<*>;\n\t\t\tif(this._filterAndSortData !== null)\n\t\t\t{\n\t\t\t\tif(index < filteredData.length)\n\t\t\t\t{\n\t\t\t\t\t//find the item at the index in the filtered data, and use\n\t\t\t\t\t//its index from the unfiltered data\n\t\t\t\t\tvar oldItem:Object = filteredData[index];\n\t\t\t\t\tvar unfilteredIndex:int = vectorData.indexOf(oldItem);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//if the item is added at the end of the filtered data\n\t\t\t\t\t//then add it at the end of the unfiltered data\n\t\t\t\t\tunfilteredIndex = vectorData.length;\n\t\t\t\t}\n\t\t\t\t//always add to the original data\n\t\t\t\tvectorData.insertAt(unfilteredIndex, item);\n\t\t\t\t//but check if the item should be in the filtered data\n\t\t\t\tvar includeItem:Boolean = true;\n\t\t\t\tif(this._filterFunction !== null)\n\t\t\t\t{\n\t\t\t\t\tincludeItem = this._filterFunction(item);\n\t\t\t\t}\n\t\t\t\tif(includeItem)\n\t\t\t\t{\n\t\t\t\t\tvar sortedIndex:int = index;\n\t\t\t\t\tif(this._sortCompareFunction !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tsortedIndex = this.getSortedInsertionIndex(item);\n\t\t\t\t\t}\n\t\t\t\t\tfilteredData.insertAt(sortedIndex, item);\n\t\t\t\t\t//don't dispatch these events if the item is filtered!\n\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\tthis.dispatchEventWith(CollectionEventType.ADD_ITEM, false, sortedIndex);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //no filter or sort\n\t\t\t{\n\t\t\t\tvectorData.insertAt(index, item);\n\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\tthis.dispatchEventWith(CollectionEventType.ADD_ITEM, false, index);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#removeItemAt()\n\t\t */\n\t\tpublic function removeItemAt(index:int):Object\n\t\t{\n\t\t\tif(this._pendingRefresh)\n\t\t\t{\n\t\t\t\tthis.refreshFilterAndSort();\n\t\t\t}\n\t\t\tvar filteredData:Vector.<*> = this._filterAndSortData as Vector.<*>;\n\t\t\tvar vectorData:Vector.<*> = this._vectorData as Vector.<*>;\n\t\t\tif(this._filterAndSortData !== null)\n\t\t\t{\n\t\t\t\tvar item:Object = filteredData.removeAt(index);\n\t\t\t\tvar unfilteredIndex:int = vectorData.indexOf(item);\n\t\t\t\tvectorData.removeAt(unfilteredIndex);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\titem = vectorData.removeAt(index);\n\t\t\t}\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tthis.dispatchEventWith(CollectionEventType.REMOVE_ITEM, false, index);\n\t\t\treturn item;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#removeItem()\n\t\t */\n\t\tpublic function removeItem(item:Object):void\n\t\t{\n\t\t\tvar index:int = this.getItemIndex(item);\n\t\t\tif(index >= 0)\n\t\t\t{\n\t\t\t\tthis.removeItemAt(index);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#removeAll()\n\t\t */\n\t\tpublic function removeAll():void\n\t\t{\n\t\t\tif(this._pendingRefresh)\n\t\t\t{\n\t\t\t\tthis.refreshFilterAndSort();\n\t\t\t}\n\t\t\tif(this.length == 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._filterAndSortData !== null)\n\t\t\t{\n\t\t\t\t(this._filterAndSortData as Vector.<*>).length = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t(this._vectorData as Vector.<*>).length = 0;\n\t\t\t}\n\t\t\tthis.dispatchEventWith(CollectionEventType.REMOVE_ALL);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#setItemAt()\n\t\t */\n\t\tpublic function setItemAt(item:Object, index:int):void\n\t\t{\n\t\t\tif(this._pendingRefresh)\n\t\t\t{\n\t\t\t\tthis.refreshFilterAndSort();\n\t\t\t}\n\t\t\tvar filteredData:Vector.<*> = this._filterAndSortData as Vector.<*>;\n\t\t\tvar vectorData:Vector.<*> = this._vectorData as Vector.<*>;\n\t\t\tif(this._filterAndSortData !== null)\n\t\t\t{\n\t\t\t\tvar oldItem:Object = filteredData[index];\n\t\t\t\tvar unfilteredIndex:int = vectorData.indexOf(oldItem);\n\t\t\t\tvectorData[unfilteredIndex] = item;\n\t\t\t\tif(this._filterFunction !== null)\n\t\t\t\t{\n\t\t\t\t\tvar includeItem:Boolean = this._filterFunction(item);\n\t\t\t\t\tif(includeItem)\n\t\t\t\t\t{\n\t\t\t\t\t\tfilteredData[index] = item;\n\t\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\t\tthis.dispatchEventWith(CollectionEventType.REPLACE_ITEM, false, index);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//if the item is excluded, the item at this index is\n\t\t\t\t\t\t//removed instead of being replaced by the new item\n\t\t\t\t\t\tfilteredData.removeAt(index);\n\t\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\t\tthis.dispatchEventWith(CollectionEventType.REMOVE_ITEM, false, index);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(this._sortCompareFunction !== null)\n\t\t\t\t{\n\t\t\t\t\t//remove the old item first!\n\t\t\t\t\tthis._filterAndSortData.removeAt(index);\n\t\t\t\t\t//then try to figure out where the new item goes when inserted\n\t\t\t\t\tvar sortedIndex:int = this.getSortedInsertionIndex(item);\n\t\t\t\t\tthis._filterAndSortData[sortedIndex] = item;\n\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\tthis.dispatchEventWith(CollectionEventType.REPLACE_ITEM, false, index);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //no filter or sort\n\t\t\t{\n\t\t\t\tvectorData[index] = item;\n\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\tthis.dispatchEventWith(CollectionEventType.REPLACE_ITEM, false, index);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#addItem()\n\t\t */\n\t\tpublic function addItem(item:Object):void\n\t\t{\n\t\t\tthis.addItemAt(item, this.length);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#push()\n\t\t *\n\t\t * @see #addItem()\n\t\t */\n\t\tpublic function push(item:Object):void\n\t\t{\n\t\t\tthis.addItemAt(item, this.length);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#addAll()\n\t\t */\n\t\tpublic function addAll(collection:IListCollection):void\n\t\t{\n\t\t\tvar otherCollectionLength:int = collection.length;\n\t\t\tvar vectorData:Vector.<*> = this._vectorData as Vector.<*>;\n\t\t\tvar pushIndex:int = vectorData.length;\n\t\t\tfor(var i:int = 0; i < otherCollectionLength; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = collection.getItemAt(i);\n\t\t\t\tvectorData[pushIndex] = item;\n\t\t\t\tpushIndex++;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#addAllAt()\n\t\t */\n\t\tpublic function addAllAt(collection:IListCollection, index:int):void\n\t\t{\n\t\t\tvar otherCollectionLength:int = collection.length;\n\t\t\tvar currentIndex:int = index;\n\t\t\tvar vectorData:Vector.<*> = this._vectorData as Vector.<*>;\n\t\t\tfor(var i:int = 0; i < otherCollectionLength; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = collection.getItemAt(i);\n\t\t\t\tvectorData.insertAt(currentIndex, item);\n\t\t\t\tcurrentIndex++;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#reset()\n\t\t */\n\t\tpublic function reset(collection:IListCollection):void\n\t\t{\n\t\t\tvar vectorData:Vector.<*> = this._vectorData as Vector.<*>;\n\t\t\tvectorData.length = 0;\n\t\t\tvar otherCollectionLength:int = collection.length;\n\t\t\tfor(var i:int = 0; i < otherCollectionLength; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = collection.getItemAt(i);\n\t\t\t\tvectorData[i] = item;\n\t\t\t}\n\t\t\tthis.dispatchEventWith(CollectionEventType.RESET);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#pop()\n\t\t */\n\t\tpublic function pop():Object\n\t\t{\n\t\t\treturn this.removeItemAt(this.length - 1);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#unshift()\n\t\t */\n\t\tpublic function unshift(item:Object):void\n\t\t{\n\t\t\tthis.addItemAt(item, 0);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#shift()\n\t\t */\n\t\tpublic function shift():Object\n\t\t{\n\t\t\treturn this.removeItemAt(0);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#contains()\n\t\t */\n\t\tpublic function contains(item:Object):Boolean\n\t\t{\n\t\t\treturn (this._vectorData as Vector.<*>).indexOf(item) != -1;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#dispose()\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#dispose() starling.display.DisplayObject.dispose()\n\t\t * @see http://doc.starling-framework.org/core/starling/textures/Texture.html#dispose() starling.textures.Texture.dispose()\n\t\t */\n\t\tpublic function dispose(disposeItem:Function):void\n\t\t{\n\t\t\t//if we're disposing the collection, filters don't matter anymore,\n\t\t\t//and we should ensure that all items are disposed.\n\t\t\tthis._filterFunction = null;\n\t\t\tthis.refreshFilterAndSort();\n\n\t\t\tvar vectorData:Vector.<*> = this._vectorData as Vector.<*>;\n\t\t\tvar itemCount:int = vectorData.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = vectorData[i];\n\t\t\t\tdisposeItem(item);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getSortedInsertionIndex(item:Object):int\n\t\t{\n\t\t\tvar itemCount:int = this._filterAndSortData.length;\n\t\t\tif(this._sortCompareFunction === null)\n\t\t\t{\n\t\t\t\treturn itemCount;\n\t\t\t}\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar otherItem:Object = this._filterAndSortData[i];\n\t\t\t\tvar result:int = this._sortCompareFunction(item, otherItem);\n\t\t\t\tif(result < 1)\n\t\t\t\t{\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn itemCount;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/data/VectorHierarchicalCollection.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.data\n{\n\timport feathers.events.CollectionEventType;\n\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\n\t/**\n\t * Dispatched when the underlying data source changes and components will\n\t * need to redraw the data.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the collection has changed drastically, such as when\n\t * the underlying data source is replaced completely.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.RESET\n\t */\n\t[Event(name=\"reset\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is added to the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index path of the item that has\n\t * been added. It is of type <code>Array</code> and contains objects of\n\t * type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.ADD_ITEM\n\t */\n\t[Event(name=\"addItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is removed from the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index path of the item that has\n\t * been removed. It is of type <code>Array</code> and contains objects of\n\t * type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.REMOVE_ITEM\n\t */\n\t[Event(name=\"removeItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is replaced in the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index path of the item that has\n\t * been replaced. It is of type <code>Array</code> and contains objects of\n\t * type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.REPLACE_ITEM\n\t */\n\t[Event(name=\"replaceItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>updateItemAt()</code> function is called on the\n\t * hierarchical collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index path of the item that has\n\t * been updated. It is of type <code>Array</code> and contains objects of\n\t * type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #updateItemAt()\n\t *\n\t * @eventType feathers.events.CollectionEventType.UPDATE_ITEM\n\t */\n\t[Event(name=\"updateItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>updateAll()</code> function is called on the\n\t * hierarchical collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #updateAll()\n\t *\n\t * @eventType feathers.events.CollectionEventType.UPDATE_ALL\n\t */\n\t[Event(name=\"updateAll\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Wraps a <code>Vector</code> data source with a common API for use with\n\t * UI controls that support hierarchical data.\n\t *\n\t * @productversion Feathers 3.3.0\n\t */\n\tpublic class VectorHierarchicalCollection extends EventDispatcher implements IHierarchicalCollection\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function VectorHierarchicalCollection(vectorData:Object = null)\n\t\t{\n\t\t\tif(vectorData === null)\n\t\t\t{\n\t\t\t\tvectorData = new <*>[];\n\t\t\t}\n\t\t\telse if(!(vectorData is Vector.<*>))\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"VectorHierarchicalCollection data must be of type Vector\");\n\t\t\t}\n\t\t\tthis._vectorData = vectorData as Vector.<*>;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * Due to bugs in the older ASC1 compiler, we cannot type this variable\n\t\t * as Vector.<*>. It will result in failures decoding abc bytecode.\n\t\t */\n\t\tprotected var _vectorData:Object = null;\n\n\t\t/**\n\t\t * The <code>Vector</code> data source for this collection.\n\t\t *\n\t\t * <p>Note: Ideally, this property would be typed as something other\n\t\t * than <code>Object</code>, but there is no type that will accept all\n\t\t * <code>Vector</code> objects without requiring a cast first.</p>\n\t\t */\n\t\tpublic function get vectorData():Object\n\t\t{\n\t\t\treturn this._vectorData;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set vectorData(value:Object):void\n\t\t{\n\t\t\tif(this._vectorData === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if(value !== null && !(value is Vector.<*>))\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"VectorHierarchicalCollection vectorData must be of type Vector\");\n\t\t\t}\n\t\t\tthis._vectorData = value as Vector.<*>;\n\t\t\tthis.dispatchEventWith(CollectionEventType.RESET);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _childrenField:String = \"children\";\n\n\t\t/**\n\t\t * The field of a branch object used to access its children. The\n\t\t * field's type must be <code>Vector</code> to be treated as a branch.\n\t\t */\n\t\tpublic function get childrenField():String\n\t\t{\n\t\t\treturn this._childrenField;\n\t\t}\n\n\t\tpublic function set childrenField(value:String):void\n\t\t{\n\t\t\tthis._childrenField = value;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#isBranch()\n\t\t */\n\t\tpublic function isBranch(node:Object):Boolean\n\t\t{\n\t\t\tif(node === null)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn node.hasOwnProperty(this._childrenField) && node[this._childrenField] is Vector.<*>;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#getLength()\n\t\t *\n\t\t * @see #getLengthAtLocation()\n\t\t *\n\t\t * @throws RangeError Branch not found at specified location\n\t\t */\n\t\tpublic function getLength(...rest:Array):int\n\t\t{\n\t\t\tvar branch:Vector.<*> = this._vectorData as Vector.<*>;\n\t\t\tvar indexCount:int = rest.length;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tvar index:int = rest[i] as int;\n\t\t\t\tbranch = branch[index][this._childrenField] as Vector.<*>;\n\t\t\t\tif(branch === null)\n\t\t\t\t{\n\t\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + rest);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn branch.length;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#getLengthAtLocation()\n\t\t *\n\t\t * @throws RangeError Branch not found at specified location\n\t\t */\n\t\tpublic function getLengthAtLocation(location:Vector.<int> = null):int\n\t\t{\n\t\t\tvar branch:Vector.<*> = this._vectorData as Vector.<*>;\n\t\t\tif(location !== null)\n\t\t\t{\n\t\t\t\tvar indexCount:int = location.length;\n\t\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar index:int = location[i];\n\t\t\t\t\tbranch = branch[index][this._childrenField] as Vector.<*>;\n\t\t\t\t\tif(branch === null)\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + location);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn branch.length;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#updateItemAt()\n\t\t *\n\t\t * @see #updateAll()\n\t\t */\n\t\tpublic function updateItemAt(index:int, ...rest:Array):void\n\t\t{\n\t\t\trest.insertAt(0, index);\n\t\t\tthis.dispatchEventWith(CollectionEventType.UPDATE_ITEM, false, rest);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#updateAll()\n\t\t *\n\t\t * @see #updateItemAt()\n\t\t */\n\t\tpublic function updateAll():void\n\t\t{\n\t\t\tthis.dispatchEventWith(CollectionEventType.UPDATE_ALL);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#getItemAt()\n\t\t *\n\t\t * @see #getItemAtLocation()\n\t\t */\n\t\tpublic function getItemAt(index:int, ...rest:Array):Object\n\t\t{\n\t\t\trest.insertAt(0, index);\n\t\t\tvar branch:Vector.<*> = this._vectorData as Vector.<*>;\n\t\t\tvar indexCount:int = rest.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tindex = rest[i] as int;\n\t\t\t\tbranch = branch[index][this._childrenField] as Vector.<*>;\n\t\t\t\tif(branch === null)\n\t\t\t\t{\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar lastIndex:int = rest[indexCount] as int;\n\t\t\treturn branch[lastIndex];\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#getItemAtLocation()\n\t\t */\n\t\tpublic function getItemAtLocation(location:Vector.<int>):Object\n\t\t{\n\t\t\tif(location === null || location.length == 0)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tvar branch:Vector.<*> = this._vectorData as Vector.<*>;\n\t\t\tvar indexCount:int = location.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tvar index:int = location[i];\n\t\t\t\tbranch = branch[index][this._childrenField] as Vector.<*>;\n\t\t\t\tif(branch === null)\n\t\t\t\t{\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tindex = location[indexCount];\n\t\t\treturn branch[index];\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#getItemLocation()\n\t\t */\n\t\tpublic function getItemLocation(item:Object, result:Vector.<int> = null):Vector.<int>\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new <int>[];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult.length = 0;\n\t\t\t}\n\t\t\tvar branch:Vector.<*> = this._vectorData as Vector.<*>;\n\t\t\tthis.findItemInBranch(branch, item, result);\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#addItemAt()\n\t\t *\n\t\t * @see #addItemAtLocation()\n\t\t *\n\t\t * @throws RangeError Branch not found at specified location\n\t\t */\n\t\tpublic function addItemAt(item:Object, index:int, ...rest:Array):void\n\t\t{\n\t\t\trest.insertAt(0, index);\n\t\t\tvar branch:Vector.<*> = this._vectorData as Vector.<*>;\n\t\t\tvar indexCount:int = rest.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tindex = rest[i] as int;\n\t\t\t\tbranch = branch[index][this._childrenField] as Vector.<*>;\n\t\t\t\tif(branch === null)\n\t\t\t\t{\n\t\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + rest);\n\t\t\t\t}\n\t\t\t}\n\t\t\tindex = rest[indexCount] as int;\n\t\t\tbranch.insertAt(index, item);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tthis.dispatchEventWith(CollectionEventType.ADD_ITEM, false, rest);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#addItemAtLocation()\n\t\t *\n\t\t * @throws RangeError Branch not found at specified location\n\t\t */\n\t\tpublic function addItemAtLocation(item:Object, location:Vector.<int>):void\n\t\t{\n\t\t\tif(location === null || location.length == 0)\n\t\t\t{\n\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + location);\n\t\t\t}\n\t\t\tvar eventIndices:Array = [];\n\t\t\tvar branch:Vector.<*> = this._vectorData as Vector.<*>;\n\t\t\tvar indexCount:int = location.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tvar index:int = location[i];\n\t\t\t\tbranch = branch[index][this._childrenField] as Vector.<*>;\n\t\t\t\tif(branch === null)\n\t\t\t\t{\n\t\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + location);\n\t\t\t\t}\n\t\t\t\teventIndices[i] = index;\n\t\t\t}\n\t\t\tindex = location[indexCount];\n\t\t\teventIndices[indexCount] = index;\n\t\t\tbranch.insertAt(index, item);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tthis.dispatchEventWith(CollectionEventType.ADD_ITEM, false, eventIndices);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#removeItemAt()\n\t\t *\n\t\t * @see #removeItemAtLocation()\n\t\t *\n\t\t * @throws RangeError Branch not found at specified location\n\t\t */\n\t\tpublic function removeItemAt(index:int, ...rest:Array):Object\n\t\t{\n\t\t\trest.insertAt(0, index);\n\t\t\tvar branch:Vector.<*> = this._vectorData as Vector.<*>;\n\t\t\tvar indexCount:int = rest.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tindex = rest[i] as int;\n\t\t\t\tbranch = branch[index][this._childrenField] as Vector.<*>;\n\t\t\t\tif(branch === null)\n\t\t\t\t{\n\t\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + rest);\n\t\t\t\t}\n\t\t\t}\n\t\t\tindex = rest[indexCount] as int;\n\t\t\tvar item:Object = branch.removeAt(index);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tthis.dispatchEventWith(CollectionEventType.REMOVE_ITEM, false, rest);\n\t\t\treturn item;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#removeItemAtLocation()\n\t\t *\n\t\t * @throws RangeError Branch not found at specified location\n\t\t */\n\t\tpublic function removeItemAtLocation(location:Vector.<int>):Object\n\t\t{\n\t\t\tif(location === null || location.length == 0)\n\t\t\t{\n\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + location);\n\t\t\t}\n\t\t\tvar eventIndices:Array = [];\n\t\t\tvar branch:Vector.<*> = this._vectorData as Vector.<*>;\n\t\t\tvar indexCount:int = location.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tvar index:int = location[i];\n\t\t\t\tbranch = branch[index][this._childrenField] as Vector.<*>;\n\t\t\t\tif(branch === null)\n\t\t\t\t{\n\t\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + location);\n\t\t\t\t}\n\t\t\t\teventIndices[i] = index;\n\t\t\t}\n\t\t\tindex = location[indexCount];\n\t\t\teventIndices[indexCount] = index;\n\t\t\tvar item:Object = branch.removeAt(index);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tthis.dispatchEventWith(CollectionEventType.REMOVE_ITEM, false, eventIndices);\n\t\t\treturn item;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#removeItem()\n\t\t */\n\t\tpublic function removeItem(item:Object):void\n\t\t{\n\t\t\tvar location:Vector.<int> = this.getItemLocation(item);\n\t\t\tif(location !== null)\n\t\t\t{\n\t\t\t\tthis.removeItemAtLocation(location);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#removeAll()\n\t\t */\n\t\tpublic function removeAll():void\n\t\t{\n\t\t\tif(this.getLength() == 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._vectorData.length = 0;\n\t\t\tthis.dispatchEventWith(CollectionEventType.REMOVE_ALL);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#setItemAt()\n\t\t *\n\t\t * @see #setItemAtLocation()\n\t\t *\n\t\t * @throws RangeError Branch not found at specified location\n\t\t */\n\t\tpublic function setItemAt(item:Object, index:int, ...rest:Array):void\n\t\t{\n\t\t\trest.insertAt(0, index);\n\t\t\tvar branch:Vector.<*> = this._vectorData as Vector.<*>;\n\t\t\tvar indexCount:int = rest.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tindex = rest[i] as int;\n\t\t\t\tbranch = branch[index][this._childrenField] as Vector.<*>;\n\t\t\t\tif(branch === null)\n\t\t\t\t{\n\t\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + rest);\n\t\t\t\t}\n\t\t\t}\n\t\t\tindex = rest[indexCount] as int;\n\t\t\tbranch[index] = item;\n\t\t\tthis.dispatchEventWith(CollectionEventType.REPLACE_ITEM, false, rest);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#setItemAtLocation()\n\t\t *\n\t\t * @throws RangeError Branch not found at specified location\n\t\t */\n\t\tpublic function setItemAtLocation(item:Object, location:Vector.<int>):void\n\t\t{\n\t\t\tif(location === null || location.length == 0)\n\t\t\t{\n\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + location);\n\t\t\t}\n\t\t\tvar eventIndices:Array = [];\n\t\t\tvar branch:Vector.<*> = this._vectorData as Vector.<*>;\n\t\t\tvar indexCount:int = location.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tvar index:int = location[i];\n\t\t\t\tbranch = branch[index][this._childrenField] as Vector.<*>;\n\t\t\t\tif(branch === null)\n\t\t\t\t{\n\t\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + location);\n\t\t\t\t}\n\t\t\t\teventIndices[i] = index;\n\t\t\t}\n\t\t\tindex = location[indexCount];\n\t\t\teventIndices[indexCount] = index;\n\t\t\tbranch[index] = item;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tthis.dispatchEventWith(CollectionEventType.REPLACE_ITEM, false, eventIndices);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#dispose()\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#dispose() starling.display.DisplayObject.dispose()\n\t\t * @see http://doc.starling-framework.org/core/starling/textures/Texture.html#dispose() starling.textures.Texture.dispose()\n\t\t */\n\t\tpublic function dispose(disposeBranch:Function, disposeItem:Function):void\n\t\t{\n\t\t\tvar groupCount:int = this._vectorData.length;\n\t\t\tvar path:Array = [];\n\t\t\tfor(var i:int = 0; i < groupCount; i++)\n\t\t\t{\n\t\t\t\tvar group:Object = this._vectorData[i];\n\t\t\t\tpath[0] = i;\n\t\t\t\tthis.disposeGroupInternal(group, path, disposeBranch, disposeItem);\n\t\t\t\tpath.length = 0;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function disposeGroupInternal(group:Object, path:Array, disposeBranch:Function, disposeItem:Function):void\n\t\t{\n\t\t\tif(disposeBranch !== null)\n\t\t\t{\n\t\t\t\tdisposeBranch(group);\n\t\t\t}\n\n\t\t\tvar itemCount:int = this.getLength.apply(this, path);\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tpath[path.length] = i;\n\t\t\t\tvar item:Object = this.getItemAt.apply(this, path);\n\t\t\t\tif(this.isBranch(item))\n\t\t\t\t{\n\t\t\t\t\tthis.disposeGroupInternal(item, path, disposeBranch, disposeItem);\n\t\t\t\t}\n\t\t\t\telse if(disposeItem !== null)\n\t\t\t\t{\n\t\t\t\t\tdisposeItem(item);\n\t\t\t\t}\n\t\t\t\tpath.length--;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function findItemInBranch(branch:Object, item:Object, result:Vector.<int>):Boolean\n\t\t{\n\t\t\tvar branchVector:Vector.<*> = branch as Vector.<*>;\n\t\t\tvar insertIndex:int = result.length;\n\t\t\tvar branchLength:int = branchVector.length;\n\t\t\tfor(var i:int = 0; i < branchLength; i++)\n\t\t\t{\n\t\t\t\tvar branchItem:Object = branchVector[i];\n\t\t\t\tif(branchItem === item)\n\t\t\t\t{\n\t\t\t\t\tresult[insertIndex] = i;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif(this.isBranch(branchItem))\n\t\t\t\t{\n\t\t\t\t\tresult[insertIndex] = i;\n\t\t\t\t\tvar children:Vector.<*> = branchItem[this._childrenField] as Vector.<*>;\n\t\t\t\t\tvar isFound:Boolean = this.findItemInBranch(children, item, result);\n\t\t\t\t\tif(isFound)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tresult.pop();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/data/VectorIntListCollectionDataDescriptor.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.data\n{\n\timport flash.errors.IllegalOperationError;\n\n\t/**\n\t * An <code>IListCollectionDataDescriptor</code> implementation for Vector.&lt;int&gt;.\n\t *\n\t * @see ListCollection\n\t * @see IListCollectionDataDescriptor\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class VectorIntListCollectionDataDescriptor implements IListCollectionDataDescriptor\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function VectorIntListCollectionDataDescriptor()\n\t\t{\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getLength(data:Object):int\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\treturn (data as Vector.<int>).length;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getItemAt(data:Object, index:int):Object\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\treturn (data as Vector.<int>)[index];\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function setItemAt(data:Object, item:Object, index:int):void\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\t(data as Vector.<int>)[index] = item as int;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function addItemAt(data:Object, item:Object, index:int):void\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\t(data as Vector.<int>).insertAt(index, item as int);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function removeItemAt(data:Object, index:int):Object\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\treturn (data as Vector.<int>).removeAt(index);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function removeAll(data:Object):void\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\t(data as Vector.<int>).length = 0;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getItemIndex(data:Object, item:Object):int\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\treturn (data as Vector.<int>).indexOf(item as int);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function checkForCorrectDataType(data:Object):void\n\t\t{\n\t\t\tif(!(data is Vector.<int>))\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Expected Vector.<int>. Received \" + Object(data).constructor + \" instead.\");\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/data/VectorListCollectionDataDescriptor.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.data\n{\n\timport flash.errors.IllegalOperationError;\n\n\t/**\n\t * An <code>IListCollectionDataDescriptor</code> implementation for Vectors.\n\t *\n\t * @see ListCollection\n\t * @see IListCollectionDataDescriptor\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class VectorListCollectionDataDescriptor implements IListCollectionDataDescriptor\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function VectorListCollectionDataDescriptor()\n\t\t{\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getLength(data:Object):int\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\treturn (data as Vector.<*>).length;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getItemAt(data:Object, index:int):Object\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\treturn (data as Vector.<*>)[index];\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function setItemAt(data:Object, item:Object, index:int):void\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\t(data as Vector.<*>)[index] = item;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function addItemAt(data:Object, item:Object, index:int):void\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\t(data as Vector.<*>).insertAt(index, item);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function removeItemAt(data:Object, index:int):Object\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\treturn (data as Vector.<*>).removeAt(index);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function removeAll(data:Object):void\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\t(data as Vector.<*>).length = 0;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getItemIndex(data:Object, item:Object):int\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\treturn (data as Vector.<*>).indexOf(item);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function checkForCorrectDataType(data:Object):void\n\t\t{\n\t\t\tif(!(data is Vector.<*>))\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Expected Vector. Received \" + Object(data).constructor + \" instead.\");\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/data/VectorNumberListCollectionDataDescriptor.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.data\n{\n\timport flash.errors.IllegalOperationError;\n\n\t/**\n\t * An <code>IListCollectionDataDescriptor</code> implementation for Vector.&lt;Number&gt;.\n\t *\n\t * @see ListCollection\n\t * @see IListCollectionDataDescriptor\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class VectorNumberListCollectionDataDescriptor implements IListCollectionDataDescriptor\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function VectorNumberListCollectionDataDescriptor()\n\t\t{\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getLength(data:Object):int\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\treturn (data as Vector.<Number>).length;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getItemAt(data:Object, index:int):Object\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\treturn (data as Vector.<Number>)[index];\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function setItemAt(data:Object, item:Object, index:int):void\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\t(data as Vector.<Number>)[index] = item as Number;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function addItemAt(data:Object, item:Object, index:int):void\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\t(data as Vector.<Number>).insertAt(index, item as Number);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function removeItemAt(data:Object, index:int):Object\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\treturn (data as Vector.<Number>).removeAt(index);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function removeAll(data:Object):void\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\t(data as Vector.<Number>).length = 0;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getItemIndex(data:Object, item:Object):int\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\treturn (data as Vector.<Number>).indexOf(item as Number);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function checkForCorrectDataType(data:Object):void\n\t\t{\n\t\t\tif(!(data is Vector.<Number>))\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Expected Vector.<Number>. Received \" + Object(data).constructor + \" instead.\");\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/data/VectorUintListCollectionDataDescriptor.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.data\n{\n\timport flash.errors.IllegalOperationError;\n\n\t/**\n\t * An <code>IListCollectionDataDescriptor</code> implementation for Vector.&lt;uint&gt;.\n\t *\n\t * @see ListCollection\n\t * @see IListCollectionDataDescriptor\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class VectorUintListCollectionDataDescriptor implements IListCollectionDataDescriptor\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function VectorUintListCollectionDataDescriptor()\n\t\t{\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getLength(data:Object):int\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\treturn (data as Vector.<uint>).length;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getItemAt(data:Object, index:int):Object\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\treturn (data as Vector.<uint>)[index];\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function setItemAt(data:Object, item:Object, index:int):void\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\t(data as Vector.<uint>)[index] = item as uint;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function addItemAt(data:Object, item:Object, index:int):void\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\t(data as Vector.<uint>).insertAt(index, item as uint);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function removeItemAt(data:Object, index:int):Object\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\treturn (data as Vector.<uint>).removeAt(index);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function removeAll(data:Object):void\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\t(data as Vector.<uint>).length = 0;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getItemIndex(data:Object, item:Object):int\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\treturn (data as Vector.<uint>).indexOf(item as uint);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function checkForCorrectDataType(data:Object):void\n\t\t{\n\t\t\tif(!(data is Vector.<uint>))\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Expected Vector.<uint>. Received \" + Object(data).constructor + \" instead.\");\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/data/XMLListCollection.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.data\n{\n\timport feathers.events.CollectionEventType;\n\timport feathers.utils.xml.xmlListInsertAt;\n\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\n\t[Exclude(name=\"data\",kind=\"property\")]\n\n\t/**\n\t * Dispatched when the underlying data source changes and components will\n\t * need to redraw the data.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the collection has changed drastically, such as when\n\t * the underlying data source is replaced completely.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.RESET\n\t */\n\t[Event(name=\"reset\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is added to the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index of the item that has been\n\t * added. It is of type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.ADD_ITEM\n\t */\n\t[Event(name=\"addItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is removed from the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index of the item that has been\n\t * removed. It is of type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.REMOVE_ITEM\n\t */\n\t[Event(name=\"removeItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is replaced in the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index of the item that has been\n\t * replaced. It is of type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.REPLACE_ITEM\n\t */\n\t[Event(name=\"replaceItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>updateItemAt()</code> function is called on the\n\t * <code>ListCollection</code>.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index of the item that has been\n\t * updated. It is of type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #updateItemAt()\n\t *\n\t * @eventType feathers.events.CollectionEventType.UPDATE_ITEM\n\t */\n\t[Event(name=\"updateItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>updateAll()</code> function is called on the\n\t * <code>ListCollection</code>.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #updateAll()\n\t *\n\t * @eventType feathers.events.CollectionEventType.UPDATE_ALL\n\t */\n\t[Event(name=\"updateAll\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>filterFunction</code> property changes or the\n\t * <code>refresh()</code> function is called on the <code>IListCollection</code>.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #filterFunction\n\t * @see #refresh()\n\t *\n\t * @eventType feathers.events.CollectionEventType.FILTER_CHANGE\n\t */\n\t[Event(name=\"filterChange\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>sortCompareFunction</code> property changes or\n\t * the <code>refresh()</code> function is called on the <code>IListCollection</code>.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #sortCompareFunction\n\t * @see #refresh()\n\t *\n\t * @eventType feathers.events.CollectionEventType.SORT_CHANGE\n\t */\n\t[Event(name=\"sortChange\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Wraps an <code>XMLList</code> in the common <code>IListCollection</code>\n\t * API used by many Feathers UI controls, including <code>List</code> and\n\t * <code>TabBar</code>.\n\t *\n\t * @productversion Feathers 3.3.0\n\t */\n\tpublic class XMLListCollection extends EventDispatcher implements IListCollection\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function XMLListCollection(data:XMLList = null)\n\t\t{\n\t\t\tif(xmlListData === null)\n\t\t\t{\n\t\t\t\txmlListData = new XMLList();\n\t\t\t}\n\t\t\tthis._xmlListData = data;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _filterAndSortData:Array;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _xmlListData:XMLList;\n\n\t\t/**\n\t\t * The <code>XMLList</code> data source for this collection.\n\t\t */\n\t\tpublic function get xmlListData():XMLList\n\t\t{\n\t\t\treturn this._xmlListData;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set xmlListData(value:XMLList):void\n\t\t{\n\t\t\tif(this._xmlListData === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._xmlListData = value;\n\t\t\tthis.dispatchEventWith(CollectionEventType.RESET);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _pendingRefresh:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _filterFunction:Function = null;\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#filterFunction\n\t\t */\n\t\tpublic function get filterFunction():Function\n\t\t{\n\t\t\treturn this._filterFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set filterFunction(value:Function):void\n\t\t{\n\t\t\tif(this._filterFunction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._filterFunction = value;\n\t\t\tthis._pendingRefresh = true;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tthis.dispatchEventWith(CollectionEventType.FILTER_CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _sortCompareFunction:Function = null;\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#sortCompareFunction\n\t\t */\n\t\tpublic function get sortCompareFunction():Function\n\t\t{\n\t\t\treturn this._sortCompareFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set sortCompareFunction(value:Function):void\n\t\t{\n\t\t\tif(this._sortCompareFunction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._sortCompareFunction = value;\n\t\t\tthis._pendingRefresh = true;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tthis.dispatchEventWith(CollectionEventType.SORT_CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#length\n\t\t */\n\t\tpublic function get length():int\n\t\t{\n\t\t\tif(this._pendingRefresh)\n\t\t\t{\n\t\t\t\tthis.refreshFilterAndSort();\n\t\t\t}\n\t\t\tif(this._filterAndSortData !== null)\n\t\t\t{\n\t\t\t\treturn this._filterAndSortData.length;\n\t\t\t}\n\t\t\treturn this._xmlListData.length();\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#refresh()\n\t\t */\n\t\tpublic function refresh():void\n\t\t{\n\t\t\tif(this._filterFunction === null && this._sortCompareFunction === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._pendingRefresh = true;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tif(this._filterFunction !== null)\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(CollectionEventType.FILTER_CHANGE);\n\t\t\t}\n\t\t\tif(this._sortCompareFunction !== null)\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(CollectionEventType.SORT_CHANGE);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshFilterAndSort():void\n\t\t{\n\t\t\tthis._pendingRefresh = false;\n\t\t\tif(this._filterFunction !== null)\n\t\t\t{\n\t\t\t\tvar result:Array = this._filterAndSortData;\n\t\t\t\tif(result !== null)\n\t\t\t\t{\n\t\t\t\t\t//reuse the old array to avoid garbage collection\n\t\t\t\t\tresult.length = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tresult = [];\n\t\t\t\t}\n\t\t\t\tvar itemCount:int = this._xmlListData.length();\n\t\t\t\tvar pushIndex:int = 0;\n\t\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar item:XML = this._xmlListData[i];\n\t\t\t\t\tif(this._filterFunction(item))\n\t\t\t\t\t{\n\t\t\t\t\t\tresult[pushIndex] = item;\n\t\t\t\t\t\tpushIndex++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis._filterAndSortData = result;\n\t\t\t}\n\t\t\telse if(this._sortCompareFunction !== null) //no filter\n\t\t\t{\n\t\t\t\titemCount = this._xmlListData.length();\n\t\t\t\tif(this._filterAndSortData === null)\n\t\t\t\t{\n\t\t\t\t\tthis._filterAndSortData = new Array(itemCount);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._filterAndSortData.length = itemCount;\n\t\t\t\t}\n\t\t\t\tfor(i = 0; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\tthis._filterAndSortData[i] = this._xmlListData[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //no filter or sort\n\t\t\t{\n\t\t\t\tthis._filterAndSortData = null;\n\t\t\t}\n\t\t\tif(this._sortCompareFunction !== null)\n\t\t\t{\n\t\t\t\tthis._filterAndSortData.sort(this._sortCompareFunction);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#updateItemAt()\n\t\t *\n\t\t * @see #updateAll()\n\t\t */\n\t\tpublic function updateItemAt(index:int):void\n\t\t{\n\t\t\tthis.dispatchEventWith(CollectionEventType.UPDATE_ITEM, false, index);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#updateAll()\n\t\t *\n\t\t * @see #updateItemAt()\n\t\t */\n\t\tpublic function updateAll():void\n\t\t{\n\t\t\tthis.dispatchEventWith(CollectionEventType.UPDATE_ALL);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#getItemAt()\n\t\t */\n\t\tpublic function getItemAt(index:int):Object\n\t\t{\n\t\t\tif(this._pendingRefresh)\n\t\t\t{\n\t\t\t\tthis.refreshFilterAndSort();\n\t\t\t}\n\t\t\tif(this._filterAndSortData !== null)\n\t\t\t{\n\t\t\t\treturn this._filterAndSortData[index];\n\t\t\t}\n\t\t\treturn this._xmlListData[index];\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#getItemIndex()\n\t\t */\n\t\tpublic function getItemIndex(item:Object):int\n\t\t{\n\t\t\tif(this._pendingRefresh)\n\t\t\t{\n\t\t\t\tthis.refreshFilterAndSort();\n\t\t\t}\n\t\t\tif(this._filterAndSortData !== null)\n\t\t\t{\n\t\t\t\treturn this._filterAndSortData.indexOf(item);\n\t\t\t}\n\t\t\treturn this.xmlListIndexOf(item);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#addItemAt()\n\t\t */\n\t\tpublic function addItemAt(item:Object, index:int):void\n\t\t{\n\t\t\tif(this._pendingRefresh)\n\t\t\t{\n\t\t\t\tthis.refreshFilterAndSort();\n\t\t\t}\n\t\t\tif(this._filterAndSortData !== null)\n\t\t\t{\n\t\t\t\tif(index < this._filterAndSortData.length)\n\t\t\t\t{\n\t\t\t\t\t//find the item at the index in the filtered data, and use\n\t\t\t\t\t//its index from the unfiltered data\n\t\t\t\t\tvar oldItem:Object = this._filterAndSortData[index];\n\t\t\t\t\tvar unfilteredIndex:int = this.xmlListIndexOf(oldItem);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//if the item is added at the end of the filtered data\n\t\t\t\t\t//then add it at the end of the unfiltered data\n\t\t\t\t\tunfilteredIndex = this._xmlListData.length();\n\t\t\t\t}\n\t\t\t\t//always add to the original data\n\t\t\t\tthis._xmlListData = xmlListInsertAt(this._xmlListData, unfilteredIndex, item as XML);\n\t\t\t\t//but check if the item should be in the filtered data\n\t\t\t\tvar includeItem:Boolean = true;\n\t\t\t\tif(this._filterFunction !== null)\n\t\t\t\t{\n\t\t\t\t\tincludeItem = this._filterFunction(item);\n\t\t\t\t}\n\t\t\t\tif(includeItem)\n\t\t\t\t{\n\t\t\t\t\tvar sortedIndex:int = index;\n\t\t\t\t\tif(this._sortCompareFunction !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tsortedIndex = this.getSortedInsertionIndex(item);\n\t\t\t\t\t}\n\t\t\t\t\tthis._filterAndSortData.insertAt(sortedIndex, item);\n\t\t\t\t\t//don't dispatch these events if the item is filtered!\n\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\tthis.dispatchEventWith(CollectionEventType.ADD_ITEM, false, sortedIndex);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //no filter or sort\n\t\t\t{\n\t\t\t\tthis._xmlListData = xmlListInsertAt(this._xmlListData, index, item as XML);\n\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\tthis.dispatchEventWith(CollectionEventType.ADD_ITEM, false, index);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#removeItemAt()\n\t\t */\n\t\tpublic function removeItemAt(index:int):Object\n\t\t{\n\t\t\tif(this._pendingRefresh)\n\t\t\t{\n\t\t\t\tthis.refreshFilterAndSort();\n\t\t\t}\n\t\t\tif(this._filterAndSortData !== null)\n\t\t\t{\n\t\t\t\tvar item:Object = this._filterAndSortData.removeAt(index);\n\t\t\t\tvar unfilteredIndex:int = this.xmlListIndexOf(item);\n\t\t\t\tdelete this._xmlListData[unfilteredIndex];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\titem = this._xmlListData[index];\n\t\t\t\tdelete this._xmlListData[index];\n\t\t\t}\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tthis.dispatchEventWith(CollectionEventType.REMOVE_ITEM, false, index);\n\t\t\treturn item;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#removeItem()\n\t\t */\n\t\tpublic function removeItem(item:Object):void\n\t\t{\n\t\t\tvar index:int = this.getItemIndex(item);\n\t\t\tif(index >= 0)\n\t\t\t{\n\t\t\t\tthis.removeItemAt(index);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#removeAll()\n\t\t */\n\t\tpublic function removeAll():void\n\t\t{\n\t\t\tif(this._pendingRefresh)\n\t\t\t{\n\t\t\t\tthis.refreshFilterAndSort();\n\t\t\t}\n\t\t\tif(this.length == 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._filterAndSortData !== null)\n\t\t\t{\n\t\t\t\tthis._filterAndSortData.length = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.xmlListDeleteAll();\n\t\t\t}\n\t\t\tthis.dispatchEventWith(CollectionEventType.REMOVE_ALL);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#setItemAt()\n\t\t */\n\t\tpublic function setItemAt(item:Object, index:int):void\n\t\t{\n\t\t\tif(this._pendingRefresh)\n\t\t\t{\n\t\t\t\tthis.refreshFilterAndSort();\n\t\t\t}\n\t\t\tif(this._filterAndSortData !== null)\n\t\t\t{\n\t\t\t\tvar oldItem:Object = this._filterAndSortData[index];\n\t\t\t\tvar unfilteredIndex:int = this.xmlListIndexOf(oldItem);\n\t\t\t\tthis._xmlListData[unfilteredIndex] = item;\n\t\t\t\tif(this._filterFunction !== null)\n\t\t\t\t{\n\t\t\t\t\tvar includeItem:Boolean = this._filterFunction(item);\n\t\t\t\t\tif(includeItem)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._filterAndSortData[index] = item;\n\t\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\t\tthis.dispatchEventWith(CollectionEventType.REPLACE_ITEM, false, index);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//if the item is excluded, the item at this index is\n\t\t\t\t\t\t//removed instead of being replaced by the new item\n\t\t\t\t\t\tthis._filterAndSortData.removeAt(index);\n\t\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\t\tthis.dispatchEventWith(CollectionEventType.REMOVE_ITEM, false, index);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(this._sortCompareFunction !== null)\n\t\t\t\t{\n\t\t\t\t\t//remove the old item first!\n\t\t\t\t\tthis._filterAndSortData.removeAt(index);\n\t\t\t\t\t//then try to figure out where the new item goes when inserted\n\t\t\t\t\tvar sortedIndex:int = this.getSortedInsertionIndex(item);\n\t\t\t\t\tthis._filterAndSortData[sortedIndex] = item;\n\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\tthis.dispatchEventWith(CollectionEventType.REPLACE_ITEM, false, index);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //no filter or sort\n\t\t\t{\n\t\t\t\tthis._xmlListData[index] = item;\n\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\tthis.dispatchEventWith(CollectionEventType.REPLACE_ITEM, false, index);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#addItem()\n\t\t */\n\t\tpublic function addItem(item:Object):void\n\t\t{\n\t\t\tthis.addItemAt(item, this.length);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#push()\n\t\t *\n\t\t * @see #addItem()\n\t\t */\n\t\tpublic function push(item:Object):void\n\t\t{\n\t\t\tthis.addItemAt(item, this.length);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#addAll()\n\t\t */\n\t\tpublic function addAll(collection:IListCollection):void\n\t\t{\n\t\t\tvar otherCollectionLength:int = collection.length;\n\t\t\tvar pushIndex:int = this._xmlListData.length();\n\t\t\tfor(var i:int = 0; i < otherCollectionLength; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = collection.getItemAt(i);\n\t\t\t\tthis._xmlListData[pushIndex] = item;\n\t\t\t\tpushIndex++;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#addAllAt()\n\t\t */\n\t\tpublic function addAllAt(collection:IListCollection, index:int):void\n\t\t{\n\t\t\tvar otherCollectionLength:int = collection.length;\n\t\t\tvar currentIndex:int = index;\n\t\t\tfor(var i:int = 0; i < otherCollectionLength; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = collection.getItemAt(i);\n\t\t\t\tthis._xmlListData = xmlListInsertAt(this._xmlListData, currentIndex, item as XML);\n\t\t\t\tcurrentIndex++;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#reset()\n\t\t */\n\t\tpublic function reset(collection:IListCollection):void\n\t\t{\n\t\t\tthis.xmlListDeleteAll();\n\t\t\tvar otherCollectionLength:int = collection.length;\n\t\t\tfor(var i:int = 0; i < otherCollectionLength; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = collection.getItemAt(i);\n\t\t\t\tthis._xmlListData[i] = item;\n\t\t\t}\n\t\t\tthis.dispatchEventWith(CollectionEventType.RESET);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#pop()\n\t\t */\n\t\tpublic function pop():Object\n\t\t{\n\t\t\treturn this.removeItemAt(this.length - 1);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#unshift()\n\t\t */\n\t\tpublic function unshift(item:Object):void\n\t\t{\n\t\t\tthis.addItemAt(item, 0);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#shift()\n\t\t */\n\t\tpublic function shift():Object\n\t\t{\n\t\t\treturn this.removeItemAt(0);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#contains()\n\t\t */\n\t\tpublic function contains(item:Object):Boolean\n\t\t{\n\t\t\treturn this.xmlListIndexOf(item) != -1;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IListCollection#dispose()\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#dispose() starling.display.DisplayObject.dispose()\n\t\t * @see http://doc.starling-framework.org/core/starling/textures/Texture.html#dispose() starling.textures.Texture.dispose()\n\t\t */\n\t\tpublic function dispose(disposeItem:Function):void\n\t\t{\n\t\t\t//if we're disposing the collection, filters don't matter anymore,\n\t\t\t//and we should ensure that all items are disposed.\n\t\t\tthis._filterFunction = null;\n\t\t\tthis.refreshFilterAndSort();\n\n\t\t\tvar itemCount:int = this._xmlListData.length();\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = this._xmlListData[i];\n\t\t\t\tdisposeItem(item);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function xmlListIndexOf(item:Object):int\n\t\t{\n\t\t\tvar listLength:int = this._xmlListData.length();\n\t\t\tfor(var i:int = 0; i < listLength; i++)\n\t\t\t{\n\t\t\t\tvar currentItem:XML = this._xmlListData[i];\n\t\t\t\tif(currentItem == item)\n\t\t\t\t{\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function xmlListDeleteAll():void\n\t\t{\n\t\t\tvar listLength:int = this._xmlListData.length();\n\t\t\tfor(var i:int = 0; i < listLength; i++)\n\t\t\t{\n\t\t\t\tdelete this._xmlListData[0];\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getSortedInsertionIndex(item:Object):int\n\t\t{\n\t\t\tvar itemCount:int = this._filterAndSortData.length;\n\t\t\tif(this._sortCompareFunction === null)\n\t\t\t{\n\t\t\t\treturn itemCount;\n\t\t\t}\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar otherItem:Object = this._filterAndSortData[i];\n\t\t\t\tvar result:int = this._sortCompareFunction(item, otherItem);\n\t\t\t\tif(result < 1)\n\t\t\t\t{\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn itemCount;\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/data/XMLListHierarchicalCollection.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.data\n{\n\timport feathers.events.CollectionEventType;\n\timport feathers.utils.xml.xmlListInsertAt;\n\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\n\t/**\n\t * Dispatched when the underlying data source changes and components will\n\t * need to redraw the data.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the collection has changed drastically, such as when\n\t * the underlying data source is replaced completely.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.RESET\n\t */\n\t[Event(name=\"reset\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is added to the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index path of the item that has\n\t * been added. It is of type <code>Array</code> and contains objects of\n\t * type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.ADD_ITEM\n\t */\n\t[Event(name=\"addItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is removed from the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index path of the item that has\n\t * been removed. It is of type <code>Array</code> and contains objects of\n\t * type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.REMOVE_ITEM\n\t */\n\t[Event(name=\"removeItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when an item is replaced in the collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index path of the item that has\n\t * been replaced. It is of type <code>Array</code> and contains objects of\n\t * type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.CollectionEventType.REPLACE_ITEM\n\t */\n\t[Event(name=\"replaceItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>updateItemAt()</code> function is called on the\n\t * hierarchical collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The index path of the item that has\n\t * been updated. It is of type <code>Array</code> and contains objects of\n\t * type <code>int</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #updateItemAt()\n\t *\n\t * @eventType feathers.events.CollectionEventType.UPDATE_ITEM\n\t */\n\t[Event(name=\"updateItem\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>updateAll()</code> function is called on the\n\t * hierarchical collection.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #updateAll()\n\t *\n\t * @eventType feathers.events.CollectionEventType.UPDATE_ALL\n\t */\n\t[Event(name=\"updateAll\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Wraps an XML data source with a common API for use with UI controls that\n\t * support hierarchical data.\n\t *\n\t * @productversion Feathers 3.3.0\n\t */\n\tpublic class XMLListHierarchicalCollection extends EventDispatcher implements IHierarchicalCollection\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function XMLListHierarchicalCollection(xmlListData:XMLList = null)\n\t\t{\n\t\t\tif(xmlListData === null)\n\t\t\t{\n\t\t\t\txmlListData = new XMLList();\n\t\t\t}\n\t\t\tthis._xmlListData = xmlListData;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _xmlListData:XMLList = null;\n\n\t\t/**\n\t\t * The <code>XMLList</code> data source for this collection.\n\t\t */\n\t\tpublic function get xmlListData():XMLList\n\t\t{\n\t\t\treturn this._xmlListData;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set xmlListData(value:XMLList):void\n\t\t{\n\t\t\tif(this._xmlListData === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._xmlListData = value;\n\t\t\tthis.dispatchEventWith(CollectionEventType.RESET);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#isBranch()\n\t\t */\n\t\tpublic function isBranch(node:Object):Boolean\n\t\t{\n\t\t\tvar xml:XML = node as XML;\n\t\t\tif(xml === null)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn xml.elements().length() > 0;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#getLength()\n\t\t *\n\t\t * @see #getLengthAtLocation()\n\t\t */\n\t\tpublic function getLength(...rest:Array):int\n\t\t{\n\t\t\tvar branch:XMLList = this._xmlListData;\n\t\t\tvar indexCount:int = rest.length;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tvar index:int = rest[i] as int;\n\t\t\t\tbranch = branch[index].elements();\n\t\t\t}\n\n\t\t\treturn branch.length();\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#getLengthAtLocation()\n\t\t */\n\t\tpublic function getLengthAtLocation(location:Vector.<int> = null):int\n\t\t{\n\t\t\tvar branch:XMLList = this._xmlListData;\n\t\t\tif(location !== null)\n\t\t\t{\n\t\t\t\tvar indexCount:int = location.length;\n\t\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar index:int = location[i];\n\t\t\t\t\tbranch = branch[index].elements();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn branch.length();\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#updateItemAt()\n\t\t *\n\t\t * @see #updateAll()\n\t\t */\n\t\tpublic function updateItemAt(index:int, ...rest:Array):void\n\t\t{\n\t\t\trest.insertAt(0, index);\n\t\t\tthis.dispatchEventWith(CollectionEventType.UPDATE_ITEM, false, rest);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#updateAll()\n\t\t *\n\t\t * @see #updateItemAt()\n\t\t */\n\t\tpublic function updateAll():void\n\t\t{\n\t\t\tthis.dispatchEventWith(CollectionEventType.UPDATE_ALL);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#getItemAt()\n\t\t *\n\t\t * @see #getItemAtLocation()\n\t\t */\n\t\tpublic function getItemAt(index:int, ...rest:Array):Object\n\t\t{\n\t\t\trest.insertAt(0, index);\n\t\t\tvar branch:XMLList = this._xmlListData;\n\t\t\tvar indexCount:int = rest.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tindex = rest[i] as int;\n\t\t\t\tbranch = branch[index].elements();\n\t\t\t}\n\t\t\tindex = rest[indexCount] as int;\n\t\t\treturn branch[index] as XML;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#getItemAtLocation()\n\t\t */\n\t\tpublic function getItemAtLocation(location:Vector.<int>):Object\n\t\t{\n\t\t\tif(location === null || location.length == 0)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tvar branch:XMLList = this._xmlListData;\n\t\t\tvar indexCount:int = location.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tvar index:int = location[i];\n\t\t\t\tbranch = branch[index].elements();\n\t\t\t}\n\t\t\tindex = location[indexCount];\n\t\t\treturn branch[index] as XML;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#getItemLocation()\n\t\t */\n\t\tpublic function getItemLocation(item:Object, result:Vector.<int> = null):Vector.<int>\n\t\t{\n\t\t\tif(result === null)\n\t\t\t{\n\t\t\t\tresult = new <int>[];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult.length = 0;\n\t\t\t}\n\t\t\tvar xmlItem:XML = item as XML;\n\t\t\tif(xmlItem === null)\n\t\t\t{\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tthis.findItemInBranch(this._xmlListData, xmlItem, result);\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#addItemAt()\n\t\t *\n\t\t * @see #addItemAtLocation()\n\t\t */\n\t\tpublic function addItemAt(item:Object, index:int, ...rest:Array):void\n\t\t{\n\t\t\trest.insertAt(0, index);\n\t\t\tvar parentOfBranch:XML = null;\n\t\t\tvar branch:XMLList = this._xmlListData;\n\t\t\tvar indexCount:int = rest.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tindex = rest[i] as int;\n\t\t\t\tparentOfBranch = branch[index] as XML;\n\t\t\t\tbranch = parentOfBranch.elements();\n\t\t\t}\n\t\t\tindex = rest[indexCount] as int;\n\t\t\tbranch = xmlListInsertAt(branch, index, item as XML);\n\t\t\tif(parentOfBranch === null)\n\t\t\t{\n\t\t\t\tthis._xmlListData = branch;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tparentOfBranch.setChildren(branch);\n\t\t\t}\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tthis.dispatchEventWith(CollectionEventType.ADD_ITEM, false, rest);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#addItemAtLocation()\n\t\t *\n\t\t * @throws RangeError Branch not found at specified location\n\t\t */\n\t\tpublic function addItemAtLocation(item:Object, location:Vector.<int>):void\n\t\t{\n\t\t\tif(location === null || location.length == 0)\n\t\t\t{\n\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + location);\n\t\t\t}\n\t\t\tvar eventIndices:Array = [];\n\t\t\tvar parentOfBranch:XML = null;\n\t\t\tvar branch:XMLList = this._xmlListData;\n\t\t\tvar indexCount:int = location.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tvar index:int = location[i];\n\t\t\t\tparentOfBranch = branch[index] as XML;\n\t\t\t\tbranch = parentOfBranch.elements();\n\t\t\t\teventIndices[i] = index;\n\t\t\t}\n\t\t\tindex = location[indexCount];\n\t\t\teventIndices[indexCount] = index;\n\t\t\tbranch = xmlListInsertAt(branch, index, item as XML);\n\t\t\tif(parentOfBranch === null)\n\t\t\t{\n\t\t\t\tthis._xmlListData = branch;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tparentOfBranch.setChildren(branch);\n\t\t\t}\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tthis.dispatchEventWith(CollectionEventType.ADD_ITEM, false, eventIndices);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#removeItemAt()\n\t\t *\n\t\t * @see #removeItemAtLocation()\n\t\t */\n\t\tpublic function removeItemAt(index:int, ...rest:Array):Object\n\t\t{\n\t\t\trest.insertAt(0, index);\n\t\t\tvar branch:XMLList = this._xmlListData;\n\t\t\tvar indexCount:int = rest.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tindex = rest[i] as int;\n\t\t\t\tbranch = branch[index].elements();\n\t\t\t}\n\t\t\tindex = rest[indexCount] as int;\n\t\t\tvar item:XML = branch[index] as XML;\n\t\t\tdelete branch[index];\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tthis.dispatchEventWith(CollectionEventType.REMOVE_ITEM, false, rest);\n\t\t\treturn item;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#removeItemAtLocation()\n\t\t *\n\t\t * @throws RangeError Branch not found at specified location\n\t\t */\n\t\tpublic function removeItemAtLocation(location:Vector.<int>):Object\n\t\t{\n\t\t\tif(location === null || location.length == 0)\n\t\t\t{\n\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + location);\n\t\t\t}\n\t\t\tvar eventIndices:Array = [];\n\t\t\tvar branch:XMLList = this._xmlListData;\n\t\t\tvar indexCount:int = location.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tvar index:int = location[i];\n\t\t\t\tbranch = branch[index].elements();\n\t\t\t\teventIndices[i] = index;\n\t\t\t}\n\t\t\tindex = location[indexCount];\n\t\t\teventIndices[indexCount] = index;\n\t\t\tvar item:XML = branch[index] as XML;\n\t\t\tdelete branch[index];\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tthis.dispatchEventWith(CollectionEventType.REMOVE_ITEM, false, eventIndices);\n\t\t\treturn item;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#removeItem()\n\t\t */\n\t\tpublic function removeItem(item:Object):void\n\t\t{\n\t\t\tvar location:Vector.<int> = this.getItemLocation(item);\n\t\t\tif(location !== null)\n\t\t\t{\n\t\t\t\tthis.removeItemAtLocation(location);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#removeAll()\n\t\t */\n\t\tpublic function removeAll():void\n\t\t{\n\t\t\tif(this.getLength() == 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._xmlListData = new XMLList();\n\t\t\tthis.dispatchEventWith(CollectionEventType.REMOVE_ALL);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#setItemAt()\n\t\t *\n\t\t * @see #setItemAtLocation()\n\t\t */\n\t\tpublic function setItemAt(item:Object, index:int, ...rest:Array):void\n\t\t{\n\t\t\trest.insertAt(0, index);\n\t\t\tvar branch:XMLList = this._xmlListData;\n\t\t\tvar indexCount:int = rest.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tindex = rest[i] as int;\n\t\t\t\tbranch = branch[index].elements();\n\t\t\t}\n\t\t\tindex = rest[indexCount] as int;\n\t\t\tbranch[index] = item;\n\t\t\tthis.dispatchEventWith(CollectionEventType.REPLACE_ITEM, false, rest);\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#setItemAtLocation()\n\t\t *\n\t\t * @throws RangeError Branch not found at specified location\n\t\t */\n\t\tpublic function setItemAtLocation(item:Object, location:Vector.<int>):void\n\t\t{\n\t\t\tif(location === null || location.length == 0)\n\t\t\t{\n\t\t\t\tthrow new RangeError(\"Branch not found at location: \" + location);\n\t\t\t}\n\t\t\tvar eventIndices:Array = [];\n\t\t\tvar branch:XMLList = this._xmlListData;\n\t\t\tvar indexCount:int = location.length - 1;\n\t\t\tfor(var i:int = 0; i < indexCount; i++)\n\t\t\t{\n\t\t\t\tvar index:int = location[i];\n\t\t\t\tbranch = branch[index].elements();\n\t\t\t\teventIndices[i] = index;\n\t\t\t}\n\t\t\tindex = location[indexCount];\n\t\t\teventIndices[indexCount] = index;\n\t\t\tbranch[index] = item;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\tthis.dispatchEventWith(CollectionEventType.REPLACE_ITEM, false, eventIndices);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.data.IHierarchicalCollection#dispose()\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/DisplayObject.html#dispose() starling.display.DisplayObject.dispose()\n\t\t * @see http://doc.starling-framework.org/core/starling/textures/Texture.html#dispose() starling.textures.Texture.dispose()\n\t\t */\n\t\tpublic function dispose(disposeGroup:Function, disposeItem:Function):void\n\t\t{\n\t\t\tvar groupCount:int = this.getLength();\n\t\t\tvar path:Array = [];\n\t\t\tfor(var i:int = 0; i < groupCount; i++)\n\t\t\t{\n\t\t\t\tvar group:Object = this.getItemAt(i);\n\t\t\t\tpath[0] = i;\n\t\t\t\tthis.disposeGroupInternal(group, path, disposeGroup, disposeItem);\n\t\t\t\tpath.length = 0;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function disposeGroupInternal(group:Object, path:Array, disposeGroup:Function, disposeItem:Function):void\n\t\t{\n\t\t\tif(disposeGroup != null)\n\t\t\t{\n\t\t\t\tdisposeGroup(group);\n\t\t\t}\n\n\t\t\tvar itemCount:int = this.getLength.apply(this, path);\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tpath[path.length] = i;\n\t\t\t\tvar item:Object = this.getItemAt.apply(this, path);\n\t\t\t\tif(this.isBranch(item))\n\t\t\t\t{\n\t\t\t\t\tthis.disposeGroupInternal(item, path, disposeGroup, disposeItem);\n\t\t\t\t}\n\t\t\t\telse if(disposeItem != null)\n\t\t\t\t{\n\t\t\t\t\tdisposeItem(item);\n\t\t\t\t}\n\t\t\t\tpath.length--;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function findItemInBranch(branch:XMLList, item:XML, result:Vector.<int>):Boolean\n\t\t{\n\t\t\tvar branchLength:int = branch.length();\n\t\t\tvar insertIndex:int = result.length;\n\t\t\tfor(var i:int = 0; i < branchLength; i++)\n\t\t\t{\n\t\t\t\tvar branchItem:XML = branch[i] as XML;\n\t\t\t\t//don't use strict equality here or it may not be possible to\n\t\t\t\t//find items that were added\n\t\t\t\tif(branchItem == item)\n\t\t\t\t{\n\t\t\t\t\tresult[insertIndex] = i;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif(this.isBranch(branchItem))\n\t\t\t\t{\n\t\t\t\t\tresult[insertIndex] = i;\n\t\t\t\t\tvar isFound:Boolean = this.findItemInBranch(branchItem.elements(), item, result);\n\t\t\t\t\tif(isFound)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tresult.pop();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/data/XMLListListCollectionDataDescriptor.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.data\n{\n\timport flash.errors.IllegalOperationError;\n\n\t/**\n\t * An <code>IListCollectionDataDescriptor</code> implementation for\n\t * XMLLists. Has some limitations due to certain things that cannot be done\n\t * to XMLLists.\n\t *\n\t * @see ListCollection\n\t * @see IListCollectionDataDescriptor\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class XMLListListCollectionDataDescriptor implements IListCollectionDataDescriptor\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function XMLListListCollectionDataDescriptor()\n\t\t{\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getLength(data:Object):int\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\treturn (data as XMLList).length();\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getItemAt(data:Object, index:int):Object\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\treturn data[index];\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function setItemAt(data:Object, item:Object, index:int):void\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\tdata[index] = XML(item);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function addItemAt(data:Object, item:Object, index:int):void\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\n\t\t\t//wow, this is weird. unless I have failed epicly, I can find no\n\t\t\t//other way to insert an element into an XMLList at a specific index.\n\t\t\tvar dataClone:XMLList = (data as XMLList).copy();\n\t\t\tdata[index] = item;\n\t\t\tvar listLength:int = dataClone.length();\n\t\t\tfor(var i:int = index; i < listLength; i++)\n\t\t\t{\n\t\t\t\tdata[i + 1] = dataClone[i];\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function removeItemAt(data:Object, index:int):Object\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\tvar item:XML = data[index];\n\t\t\tdelete data[index];\n\t\t\treturn item;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function removeAll(data:Object):void\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\tvar list:XMLList = data as XMLList;\n\t\t\tvar listLength:int = list.length();\n\t\t\tfor(var i:int = 0; i < listLength; i++)\n\t\t\t{\n\t\t\t\tdelete data[0];\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getItemIndex(data:Object, item:Object):int\n\t\t{\n\t\t\tthis.checkForCorrectDataType(data);\n\t\t\tvar list:XMLList = data as XMLList;\n\t\t\tvar listLength:int = list.length();\n\t\t\tfor(var i:int = 0; i < listLength; i++)\n\t\t\t{\n\t\t\t\tvar currentItem:XML = list[i];\n\t\t\t\tif(currentItem == item)\n\t\t\t\t{\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function checkForCorrectDataType(data:Object):void\n\t\t{\n\t\t\tif(!(data is XMLList))\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Expected XMLList. Received \" + Object(data).constructor + \" instead.\");\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/display/RenderDelegate.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.display\n{\n\timport flash.geom.Matrix;\n\timport flash.geom.Point;\n\timport flash.geom.Rectangle;\n\n\timport starling.display.DisplayObject;\n\timport starling.rendering.Painter;\n\timport starling.utils.MatrixUtil;\n\timport starling.utils.Pool;\n\n\t/**\n\t * Passes rendering to another display object, but provides its own separate\n\t * transformation.\n\t *\n\t * <p>Touching the delegate does not pass touches to the target. The\n\t * delegate is a separate display object. However, interacting with the\n\t * target may affect the rendering of the delegate.</p>\n\t *\n\t * @productversion Feathers 2.2.0\n\t */\n\tpublic class RenderDelegate extends DisplayObject\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const HELPER_POINT:Point = new Point();\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function RenderDelegate(target:DisplayObject)\n\t\t{\n\t\t\tthis.target = target;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _target:DisplayObject;\n\n\t\t/**\n\t\t * The displaying object being rendered.\n\t\t */\n\t\tpublic function get target():DisplayObject\n\t\t{\n\t\t\treturn this._target;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set target(value:DisplayObject):void\n\t\t{\n\t\t\tif(this._target === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._target = value;\n\t\t\tthis.setRequiresRedraw();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function getBounds(targetSpace:DisplayObject, resultRect:Rectangle = null):Rectangle\n\t\t{\n\t\t\tresultRect = this._target.getBounds(this._target, resultRect);\n\t\t\tvar matrix:Matrix = Pool.getMatrix();\n\t\t\tthis.getTransformationMatrix(targetSpace, matrix);\n\t\t\tvar minX:Number = Number.MAX_VALUE;\n\t\t\tvar maxX:Number = -Number.MAX_VALUE;\n\t\t\tvar minY:Number = Number.MAX_VALUE;\n\t\t\tvar maxY:Number = -Number.MAX_VALUE;\n\t\t\tfor(var i:int = 0; i < 4; i++)\n\t\t\t{\n\t\t\t\tMatrixUtil.transformCoords(matrix, i % 2 == 0 ? 0 : resultRect.width, i < 2 ? 0 : resultRect.height, HELPER_POINT);\n\t\t\t\tif(HELPER_POINT.x < minX)\n\t\t\t\t{\n\t\t\t\t\tminX = HELPER_POINT.x;\n\t\t\t\t}\n\t\t\t\tif(HELPER_POINT.x > maxX)\n\t\t\t\t{\n\t\t\t\t\tmaxX = HELPER_POINT.x;\n\t\t\t\t}\n\t\t\t\tif(HELPER_POINT.y < minY)\n\t\t\t\t{\n\t\t\t\t\tminY = HELPER_POINT.y;\n\t\t\t\t}\n\t\t\t\tif(HELPER_POINT.y > maxY)\n\t\t\t\t{\n\t\t\t\t\tmaxY = HELPER_POINT.y;\n\t\t\t\t}\n\t\t\t}\n\t\t\tPool.putMatrix(matrix);\n\t\t\tresultRect.setTo(minX, minY, maxX - minX, maxY - minY);\n\t\t\treturn resultRect;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function render(painter:Painter):void\n\t\t{\n\t\t\tvar oldCacheEnabled:Boolean = painter.cacheEnabled;\n\t\t\tpainter.cacheEnabled = false;\n\t\t\tthis._target.render(painter);\n\t\t\tpainter.cacheEnabled = oldCacheEnabled;\n\t\t\tpainter.excludeFromCache(this);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/dragDrop/DragData.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.dragDrop\n{\n\t/**\n\t * Stores data associated with a drag and drop operation.\n\t *\n\t * @see feathers.dragDrop.DragDropManager\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class DragData\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function DragData()\n\t\t{\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _data:Object = {};\n\n\t\t/**\n\t\t * Determines if the specified data format is available.\n\t\t */\n\t\tpublic function hasDataForFormat(format:String):Boolean\n\t\t{\n\t\t\treturn this._data.hasOwnProperty(format);\n\t\t}\n\n\t\t/**\n\t\t * Returns data for the specified format.\n\t\t */\n\t\tpublic function getDataForFormat(format:String):*\n\t\t{\n\t\t\tif(this._data.hasOwnProperty(format))\n\t\t\t{\n\t\t\t\treturn this._data[format];\n\t\t\t}\n\t\t\treturn undefined;\n\t\t}\n\n\t\t/**\n\t\t * Saves data for the specified format.\n\t\t */\n\t\tpublic function setDataForFormat(format:String, data:*):void\n\t\t{\n\t\t\tthis._data[format] = data;\n\t\t}\n\n\t\t/**\n\t\t * Removes all data for the specified format.\n\t\t */\n\t\tpublic function clearDataForFormat(format:String):*\n\t\t{\n\t\t\tvar data:* = undefined;\n\t\t\tif(this._data.hasOwnProperty(format))\n\t\t\t{\n\t\t\t\tdata = this._data[format];\n\t\t\t}\n\t\t\tdelete this._data[format];\n\t\t\treturn data;\n\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/dragDrop/DragDropManager.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.dragDrop\n{\n\timport feathers.core.PopUpManager;\n\timport feathers.events.DragDropEvent;\n\n\timport flash.errors.IllegalOperationError;\n\timport flash.events.KeyboardEvent;\n\timport flash.geom.Point;\n\timport flash.ui.Keyboard;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.display.Stage;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.utils.Pool;\n\n\t/**\n\t * Handles drag and drop operations based on Starling touch events.\n\t *\n\t * @see feathers.dragDrop.IDragSource\n\t * @see feathers.dragDrop.IDropTarget\n\t * @see feathers.dragDrop.DragData\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class DragDropManager\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static var _touchPointID:int = -1;\n\n\t\t/**\n\t\t * The ID of the touch that initiated the current drag. Returns <code>-1</code>\n\t\t * if there is not an active drag action. In multi-touch applications,\n\t\t * knowing the touch ID is useful if additional actions need to happen\n\t\t * using the same touch.\n\t\t */\n\t\tpublic static function get touchPointID():int\n\t\t{\n\t\t\treturn _touchPointID;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static var _dragSourceStage:Stage;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static var _dragSource:IDragSource;\n\n\t\t/**\n\t\t * The <code>IDragSource</code> that started the current drag.\n\t\t */\n\t\tpublic static function get dragSource():IDragSource\n\t\t{\n\t\t\treturn _dragSource;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static var _dragData:DragData;\n\n\t\t/**\n\t\t * Determines if the drag and drop manager is currently handling a drag.\n\t\t * Only one drag may be active at a time.\n\t\t */\n\t\tpublic static function get isDragging():Boolean\n\t\t{\n\t\t\treturn _dragData != null;\n\t\t}\n\n\t\t/**\n\t\t * The data associated with the current drag. Returns <code>null</code>\n\t\t * if there is not a current drag.\n\t\t */\n\t\tpublic static function get dragData():DragData\n\t\t{\n\t\t\treturn _dragData;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * The current target of the current drag.\n\t\t */\n\t\tprotected static var dropTarget:IDropTarget;\n\n\t\t/**\n\t\t * @private\n\t\t * Indicates if the current drag has been accepted by the dropTarget.\n\t\t */\n\t\tprotected static var isAccepted:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t * The avatar for the current drag data.\n\t\t */\n\t\tprotected static var avatar:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static var avatarOffsetX:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static var avatarOffsetY:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static var dropTargetLocalX:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static var dropTargetLocalY:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static var avatarOldTouchable:Boolean;\n\n\t\t/**\n\t\t * Starts a new drag. If another drag is currently active, it is\n\t\t * immediately cancelled. Includes an optional \"avatar\", a visual\n\t\t * representation of the data that is being dragged.\n\t\t */\n\t\tpublic static function startDrag(source:IDragSource, touch:Touch, data:DragData, dragAvatar:DisplayObject = null, dragAvatarOffsetX:Number = 0, dragAvatarOffsetY:Number = 0):void\n\t\t{\n\t\t\tif(isDragging)\n\t\t\t{\n\t\t\t\tcancelDrag();\n\t\t\t}\n\t\t\tif(!source)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"Drag source cannot be null.\");\n\t\t\t}\n\t\t\tif(!data)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"Drag data cannot be null.\");\n\t\t\t}\n\t\t\t_dragSource = source;\n\t\t\t_dragData = data;\n\t\t\t_touchPointID = touch.id;\n\t\t\tavatar = dragAvatar;\n\t\t\tavatarOffsetX = dragAvatarOffsetX;\n\t\t\tavatarOffsetY = dragAvatarOffsetY;\n\t\t\t_dragSourceStage = DisplayObject(source).stage;\n\t\t\tvar point:Point = Pool.getPoint();\n\t\t\ttouch.getLocation(_dragSourceStage, point);\n\t\t\tif(avatar)\n\t\t\t{\n\t\t\t\tavatarOldTouchable = avatar.touchable;\n\t\t\t\tavatar.touchable = false;\n\t\t\t\tavatar.x = point.x + avatarOffsetX;\n\t\t\t\tavatar.y = point.y + avatarOffsetY;\n\t\t\t\tPopUpManager.addPopUp(avatar, false, false);\n\t\t\t}\n\t\t\t_dragSourceStage.addEventListener(TouchEvent.TOUCH, stage_touchHandler);\n\t\t\tvar starling:Starling = _dragSourceStage.starling;\n\t\t\tstarling.nativeStage.addEventListener(KeyboardEvent.KEY_DOWN, nativeStage_keyDownHandler, false, 0, true);\n\t\t\t_dragSource.dispatchEvent(new DragDropEvent(DragDropEvent.DRAG_START, data, false, NaN, NaN, _dragSource));\n\n\t\t\tupdateDropTarget(point);\n\t\t\tPool.putPoint(point);\n\t\t}\n\n\t\t/**\n\t\t * Tells the drag and drop manager if the target will accept the current\n\t\t * drop. Meant to be called in a listener for the target's\n\t\t * <code>DragDropEvent.DRAG_ENTER</code> event.\n\t\t */\n\t\tpublic static function acceptDrag(target:IDropTarget):void\n\t\t{\n\t\t\tif(dropTarget != target)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"Drop target cannot accept a drag at this time. Acceptance may only happen after the DragDropEvent.DRAG_ENTER event is dispatched and before the DragDropEvent.DRAG_EXIT event is dispatched.\");\n\t\t\t}\n\t\t\tisAccepted = true;\n\t\t}\n\n\t\t/**\n\t\t * Immediately cancels the current drag.\n\t\t */\n\t\tpublic static function cancelDrag():void\n\t\t{\n\t\t\tif(!isDragging)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcompleteDrag(false);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function completeDrag(isDropped:Boolean):void\n\t\t{\n\t\t\tif(!isDragging)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Drag cannot be completed because none is currently active.\");\n\t\t\t}\n\t\t\tif(dropTarget)\n\t\t\t{\n\t\t\t\tdropTarget.dispatchEvent(new DragDropEvent(DragDropEvent.DRAG_EXIT, _dragData, false, dropTargetLocalX, dropTargetLocalY, _dragSource));\n\t\t\t\tdropTarget = null;\n\t\t\t}\n\t\t\tvar source:IDragSource = _dragSource;\n\t\t\tvar data:DragData = _dragData;\n\t\t\tcleanup();\n\t\t\tsource.dispatchEvent(new DragDropEvent(DragDropEvent.DRAG_COMPLETE, data, isDropped, NaN, NaN, source));\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function cleanup():void\n\t\t{\n\t\t\tif(avatar)\n\t\t\t{\n\t\t\t\t//may have been removed from parent already in the drop listener\n\t\t\t\tif(PopUpManager.isPopUp(avatar))\n\t\t\t\t{\n\t\t\t\t\tPopUpManager.removePopUp(avatar);\n\t\t\t\t}\n\t\t\t\tavatar.touchable = avatarOldTouchable;\n\t\t\t\tavatar = null;\n\t\t\t}\n\t\t\tvar starling:Starling = _dragSourceStage.starling;\n\t\t\t_dragSourceStage.removeEventListener(TouchEvent.TOUCH, stage_touchHandler);\n\t\t\tstarling.nativeStage.removeEventListener(KeyboardEvent.KEY_DOWN, nativeStage_keyDownHandler);\n\t\t\t_dragSource = null;\n\t\t\t_dragData = null;\n\t\t\t_dragSourceStage = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function updateDropTarget(location:Point):void\n\t\t{\n\t\t\tvar target:DisplayObject = _dragSourceStage.hitTest(location);\n\t\t\twhile(target && !(target is IDropTarget))\n\t\t\t{\n\t\t\t\ttarget = target.parent;\n\t\t\t}\n\t\t\tif(target)\n\t\t\t{\n\t\t\t\ttarget.globalToLocal(location, location);\n\t\t\t}\n\t\t\tif(target != dropTarget)\n\t\t\t{\n\t\t\t\tif(dropTarget)\n\t\t\t\t{\n\t\t\t\t\t//notice that we can reuse the previously saved location\n\t\t\t\t\tdropTarget.dispatchEvent(new DragDropEvent(DragDropEvent.DRAG_EXIT, _dragData, false, dropTargetLocalX, dropTargetLocalY, _dragSource));\n\t\t\t\t}\n\t\t\t\tdropTarget = IDropTarget(target);\n\t\t\t\tisAccepted = false;\n\t\t\t\tif(dropTarget)\n\t\t\t\t{\n\t\t\t\t\tdropTargetLocalX = location.x;\n\t\t\t\t\tdropTargetLocalY = location.y;\n\t\t\t\t\tdropTarget.dispatchEvent(new DragDropEvent(DragDropEvent.DRAG_ENTER, _dragData, false, dropTargetLocalX, dropTargetLocalY, _dragSource));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(dropTarget)\n\t\t\t{\n\t\t\t\tdropTargetLocalX = location.x;\n\t\t\t\tdropTargetLocalY = location.y;\n\t\t\t\tdropTarget.dispatchEvent(new DragDropEvent(DragDropEvent.DRAG_MOVE, _dragData, false, dropTargetLocalX, dropTargetLocalY, _dragSource));\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function nativeStage_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(event.keyCode == Keyboard.ESCAPE || event.keyCode == Keyboard.BACK)\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tcancelDrag();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function stage_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tvar stage:Stage = Stage(event.currentTarget);\n\t\t\tvar touch:Touch = event.getTouch(stage, null, _touchPointID);\n\t\t\tif(!touch)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(touch.phase == TouchPhase.MOVED)\n\t\t\t{\n\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\ttouch.getLocation(stage, point);\n\t\t\t\tif(avatar)\n\t\t\t\t{\n\t\t\t\t\tavatar.x = point.x + avatarOffsetX;\n\t\t\t\t\tavatar.y = point.y + avatarOffsetY;\n\t\t\t\t}\n\t\t\t\tupdateDropTarget(point);\n\t\t\t\tPool.putPoint(point);\n\t\t\t}\n\t\t\telse if(touch.phase == TouchPhase.ENDED)\n\t\t\t{\n\t\t\t\t_touchPointID = -1;\n\t\t\t\tvar isDropped:Boolean = false;\n\t\t\t\tif(dropTarget && isAccepted)\n\t\t\t\t{\n\t\t\t\t\tdropTarget.dispatchEvent(new DragDropEvent(DragDropEvent.DRAG_DROP, _dragData, true, dropTargetLocalX, dropTargetLocalY, _dragSource));\n\t\t\t\t\tisDropped = true;\n\t\t\t\t}\n\t\t\t\tdropTarget = null;\n\t\t\t\tcompleteDrag(isDropped);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/dragDrop/IDragSource.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.dragDrop\n{\n\timport starling.events.Event;\n\n\t/**\n\t * Dispatched when the drag and drop manager begins the drag.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>Same as the dragData property.</td></tr>\n\t * <tr><td><code>dragData</code></td><td>The <code>feathers.dragDrop.DragData</code>\n\t *   instance associated with this drag.</td></tr>\n\t * <tr><td><code>isDropped</code></td><td>false</td></tr>\n\t * <tr><td><code>localX</code></td><td>NaN</td></tr>\n\t * <tr><td><code>localY</code></td><td>NaN</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.DragDropEvent.DRAG_START\n\t */\n\t[Event(name=\"dragStart\",type=\"feathers.events.DragDropEvent\")]\n\n\t/**\n\t * Dispatched when the drop has been completed or when the drag has been\n\t * cancelled.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>Same as the dragData property.</td></tr>\n\t * <tr><td><code>dragData</code></td><td>The <code>feathers.dragDrop.DragData</code>\n\t *   instance associated with this drag.</td></tr>\n\t * <tr><td><code>isDropped</code></td><td>true, if the dragged object was dropped; false, if it was not.</td></tr>\n\t * <tr><td><code>localX</code></td><td>NaN</td></tr>\n\t * <tr><td><code>localY</code></td><td>NaN</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.DragDropEvent.DRAG_COMPLETE\n\t */\n\t[Event(name=\"dragComplete\",type=\"feathers.events.DragDropEvent\")]\n\n\t/**\n\t * An object that can initiate drag actions with the drag and drop manager.\n\t *\n\t * @see feathers.dragDrop.DragDropManager\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic interface IDragSource\n\t{\n\t\tfunction dispatchEvent(event:Event):void;\n\t\tfunction dispatchEventWith(type:String, bubbles:Boolean = false, data:Object = null):void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/dragDrop/IDropTarget.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.dragDrop\n{\n\timport starling.events.Event;\n\n\t/**\n\t * Dispatched when the touch enters the drop target's bounds. Call\n\t * <code>acceptDrag()</code> on the drag and drop manager to allow\n\t * the drag to the be dropped on the target.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>Same as the dragData property.</td></tr>\n\t * <tr><td><code>dragData</code></td><td>The <code>feathers.dragDrop.DragData</code>\n\t *   instance associated with this drag.</td></tr>\n\t * <tr><td><code>isDropped</code></td><td>false</td></tr>\n\t * <tr><td><code>localX</code></td><td>The x location, in pixels, of the\n\t * current action, in the local coordinate system of the <code>IDropTarget</code>.</td></tr>\n\t * <tr><td><code>localY</code></td><td>The y location, in pixels, of the\n\t * current action, in the local coordinate system of the <code>IDropTarget</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.DragDropEvent.DRAG_ENTER\n\t */\n\t[Event(name=\"dragEnter\",type=\"feathers.events.DragDropEvent\")]\n\n\t/**\n\t * Dispatched when the touch moves within the drop target's bounds.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>Same as the dragData property.</td></tr>\n\t * <tr><td><code>dragData</code></td><td>The <code>feathers.dragDrop.DragData</code>\n\t *   instance associated with this drag.</td></tr>\n\t * <tr><td><code>isDropped</code></td><td>false</td></tr>\n\t * <tr><td><code>localX</code></td><td>The x location, in pixels, of the\n\t * current action, in the local coordinate system of the <code>IDropTarget</code>.</td></tr>\n\t * <tr><td><code>localY</code></td><td>The y location, in pixels, of the\n\t * current action, in the local coordinate system of the <code>IDropTarget</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.DragDropEvent.DRAG_MOVE\n\t */\n\t[Event(name=\"dragMove\",type=\"feathers.events.DragDropEvent\")]\n\n\t/**\n\t * Dispatched when the touch exits the drop target's bounds or when\n\t * the drag is cancelled while the touch is within the drop target's\n\t * bounds. Will <em>not</em> be dispatched if the drop target hasn't\n\t * accepted the drag.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>Same as the dragData property.</td></tr>\n\t * <tr><td><code>dragData</code></td><td>The <code>feathers.dragDrop.DragData</code>\n\t *   instance associated with this drag.</td></tr>\n\t * <tr><td><code>isDropped</code></td><td>false</td></tr>\n\t * <tr><td><code>localX</code></td><td>The x location, in pixels, of the\n\t * current action, in the local coordinate system of the <code>IDropTarget</code>.</td></tr>\n\t * <tr><td><code>localY</code></td><td>The y location, in pixels, of the\n\t * current action, in the local coordinate system of the <code>IDropTarget</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.DragDropEvent.DRAG_EXIT\n\t */\n\t[Event(name=\"dragExit\",type=\"feathers.events.DragDropEvent\")]\n\n\t/**\n\t * Dispatched when an accepted drag is dropped on the target. Will\n\t * <em>not</em> be dispatched if the drop target hasn't accepted the\n\t * drag.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>Same as the dragData property.</td></tr>\n\t * <tr><td><code>dragData</code></td><td>The <code>feathers.dragDrop.DragData</code>\n\t *   instance associated with this drag.</td></tr>\n\t * <tr><td><code>isDropped</code></td><td>true</td></tr>\n\t * <tr><td><code>localX</code></td><td>The x location, in pixels, of the\n\t * current action, in the local coordinate system of the <code>IDropTarget</code>.</td></tr>\n\t * <tr><td><code>localY</code></td><td>The y location, in pixels, of the\n\t * current action, in the local coordinate system of the <code>IDropTarget</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.DragDropEvent.DRAG_DROP\n\t */\n\t[Event(name=\"dragDrop\",type=\"feathers.events.DragDropEvent\")]\n\n\t/**\n\t * A display object that can accept data dropped by the drag and drop\n\t * manager.\n\t *\n\t * @see feathers.dragDrop.DragDropManager\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic interface IDropTarget\n\t{\n\t\tfunction dispatchEvent(event:Event):void;\n\t\tfunction dispatchEventWith(type:String, bubbles:Boolean = false, data:Object = null):void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/events/CollectionEventType.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.events\n{\n\t/**\n\t * Event <code>type</code> constants for collections. This class is\n\t * not a subclass of <code>starling.events.Event</code> because these\n\t * constants are meant to be used with <code>dispatchEventWith()</code> and\n\t * take advantage of the Starling's event object pooling. The object passed\n\t * to an event listener will be of type <code>starling.events.Event</code>.\n\t *\n\t * <listing version=\"3.0\">\n\t * function listener( event:Event ):void\n\t * {\n\t *     trace( \"add item\" );\n\t * }\n\t * collection.addEventListener( CollectionEventType.ADD_ITEM, listener );</listing>\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class CollectionEventType\n\t{\n\t\t/**\n\t\t * Dispatched when the data provider's source is completely replaced.\n\t\t */\n\t\tpublic static const RESET:String = \"reset\";\n\n\t\t/**\n\t\t * Dispatched when a filter has been applied to or removed from the\n\t\t * collection. The underlying source remains the same, but zero or more\n\t\t * items may have been removed or added.\n\t\t */\n\t\tpublic static const FILTER_CHANGE:String = \"filterChange\";\n\n\t\t/**\n\t\t * Dispatched when a sort compare function has been applied to or\n\t\t * removed from the collection. The underlying source remains the same,\n\t\t * but the order may be modified.\n\t\t */\n\t\tpublic static const SORT_CHANGE:String = \"sortChange\";\n\n\t\t/**\n\t\t * Dispatched when an item is added to the collection.\n\t\t */\n\t\tpublic static const ADD_ITEM:String = \"addItem\";\n\n\t\t/**\n\t\t * Dispatched when an item is removed from the collection.\n\t\t */\n\t\tpublic static const REMOVE_ITEM:String = \"removeItem\";\n\n\t\t/**\n\t\t * Dispatched when an item is replaced in the collection with a\n\t\t * different item.\n\t\t */\n\t\tpublic static const REPLACE_ITEM:String = \"replaceItem\";\n\n\t\t/**\n\t\t * Dispatched when an item in the collection has changed.\n\t\t */\n\t\tpublic static const UPDATE_ITEM:String = \"updateItem\";\n\n\t\t/**\n\t\t * Dispatched when all existing items in the collection have changed\n\t\t * (but they have not been replaced by different items).\n\t\t */\n\t\tpublic static const UPDATE_ALL:String = \"updateAll\";\n\n\t\t/**\n\t\t * Dispatched when all items are removed from the collection.\n\t\t */\n\t\tpublic static const REMOVE_ALL:String = \"removeAll\";\n\t}\n}\n"
  },
  {
    "path": "source/feathers/events/DragDropEvent.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.events\n{\n\timport feathers.dragDrop.DragData;\n\timport feathers.dragDrop.IDragSource;\n\n\timport starling.events.Event;\n\n\t/**\n\t * Events used by the <code>DragDropManager</code>.\n\t *\n\t * @see feathers.dragDrop.DragDropManager\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class DragDropEvent extends Event\n\t{\n\t\t/**\n\t\t * Dispatched by the <code>IDragSource</code> when a drag starts.\n\t\t *\n\t\t * @see feathers.dragDrop.IDragSource\n\t\t */\n\t\tpublic static const DRAG_START:String = \"dragStart\";\n\n\t\t/**\n\t\t * Dispatched by the <code>IDragSource</code> when a drag completes.\n\t\t * This is always dispatched, even when there wasn't a successful drop.\n\t\t * See the <code>isDropped</code> property to determine if the drop\n\t\t * was successful.\n\t\t *\n\t\t * @see feathers.dragDrop.IDragSource\n\t\t */\n\t\tpublic static const DRAG_COMPLETE:String = \"dragComplete\";\n\n\t\t/**\n\t\t * Dispatched by a <code>IDropTarget</code> when a drag enters its\n\t\t * bounds.\n\t\t *\n\t\t * @see feathers.dragDrop.IDropTarget\n\t\t */\n\t\tpublic static const DRAG_ENTER:String = \"dragEnter\";\n\n\t\t/**\n\t\t * Dispatched by a <code>IDropTarget</code> when a drag moves to a new\n\t\t * location within its bounds.\n\t\t *\n\t\t * @see feathers.dragDrop.IDropTarget\n\t\t */\n\t\tpublic static const DRAG_MOVE:String = \"dragMove\";\n\n\t\t/**\n\t\t * Dispatched by a <code>IDropTarget</code> when a drag exits its\n\t\t * bounds.\n\t\t *\n\t\t * @see feathers.dragDrop.IDropTarget\n\t\t */\n\t\tpublic static const DRAG_EXIT:String = \"dragExit\";\n\n\t\t/**\n\t\t * Dispatched by a <code>IDropTarget</code> when a drop occurs.\n\t\t *\n\t\t * @see feathers.dragDrop.IDropTarget\n\t\t */\n\t\tpublic static const DRAG_DROP:String = \"dragDrop\";\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function DragDropEvent(type:String, dragData:DragData, isDropped:Boolean, localX:Number = NaN, localY:Number = NaN, dragSource:IDragSource = null)\n\t\t{\n\t\t\tsuper(type, false, dragData);\n\t\t\tthis.isDropped = isDropped;\n\t\t\tthis.localX = localX;\n\t\t\tthis.localY = localY;\n\t\t\tthis.dragSource = dragSource;\n\t\t}\n\n\t\t/**\n\t\t * The <code>DragData</code> associated with the current drag.\n\t\t */\n\t\tpublic function get dragData():DragData\n\t\t{\n\t\t\treturn DragData(this.data);\n\t\t}\n\n\t\t/**\n\t\t * Determines if there has been a drop.\n\t\t */\n\t\tpublic var isDropped:Boolean;\n\n\t\t/**\n\t\t * The x location, in pixels, of the current action, in the local\n\t\t * coordinate system of the <code>IDropTarget</code>.\n\t\t *\n\t\t * <p>Value will always be <code>NaN</code> for <code>DRAG_START</code>\n\t\t * and <code>DRAG_COMPLETE</code> events.</p>\n\t\t *\n\t\t * @see feathers.dragDrop.IDropTarget\n\t\t */\n\t\tpublic var localX:Number;\n\n\t\t/**\n\t\t * The y location, in pixels, of the current action, in the local\n\t\t * coordinate system of the <code>IDropTarget</code>.\n\t\t *\n\t\t * <p>Value will always be <code>NaN</code> for <code>DRAG_START</code>\n\t\t * and <code>DRAG_COMPLETE</code> events.</p>\n\t\t *\n\t\t * @see feathers.dragDrop.IDropTarget\n\t\t */\n\t\tpublic var localY:Number;\n\n\t\t/**\n\t\t * The source where the drag started.\n\t\t */\n\t\tpublic var dragSource:IDragSource;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/events/ExclusiveTouch.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.events\n{\n\timport flash.utils.Dictionary;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Stage;\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\t/**\n\t * Dispatched when a touch ID is claimed or a claim is removed. The\n\t * <code>data</code> property is the touch ID.\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Allows a component to claim exclusive access to a touch to avoid\n\t * dragging, scrolling, or other touch interaction conflicts. In particular,\n\t * if objects are nested, and they can be scrolled or dragged, it's better\n\t * for one to eventually gain exclusive control over the touch. Multiple\n\t * objects being controlled by the same touch often results in unexpected\n\t * behavior.\n\t *\n\t * <p>Due to the way that Starling's touch behavior is implemented, when\n\t * objects are nested, the inner object will always have precedence.\n\t * However, from a usability perspective, this is generally the expected\n\t * behavior, so this restriction isn't expected to cause any issues.</p>\n\t *\n\t * @productversion Feathers 1.2.0\n\t */\n\tpublic class ExclusiveTouch extends EventDispatcher\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const stageToObject:Dictionary = new Dictionary(true);\n\n\t\t/**\n\t\t * Retrieves the exclusive touch manager for the specified stage.\n\t\t */\n\t\tpublic static function forStage(stage:Stage):ExclusiveTouch\n\t\t{\n\t\t\tif(!stage)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"Stage cannot be null.\");\n\t\t\t}\n\t\t\tvar object:ExclusiveTouch = ExclusiveTouch(stageToObject[stage]);\n\t\t\tif(object)\n\t\t\t{\n\t\t\t\treturn object;\n\t\t\t}\n\t\t\tobject = new ExclusiveTouch(stage);\n\t\t\tstageToObject[stage] = object;\n\t\t\treturn object;\n\t\t}\n\n\t\t/**\n\t\t * Disposes the exclusive touch manager for the specified stage.\n\t\t */\n\t\tpublic static function disposeForStage(stage:Stage):void\n\t\t{\n\t\t\tdelete stageToObject[stage];\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t * @param stage\n\t\t */\n\t\tpublic function ExclusiveTouch(stage:Stage)\n\t\t{\n\t\t\tif(!stage)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"Stage cannot be null.\");\n\t\t\t}\n\t\t\tthis._stage = stage;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _stageListenerCount:int = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _stage:Stage;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _claims:Dictionary = new Dictionary();\n\n\t\t/**\n\t\t * Allows a display object to claim a touch by its ID. Returns\n\t\t * <code>true</code> if the touch is claimed. Returns <code>false</code>\n\t\t * if the touch was previously claimed by another display object.\n\t\t */\n\t\tpublic function claimTouch(touchID:int, target:DisplayObject):Boolean\n\t\t{\n\t\t\tif(!target)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"Target cannot be null.\");\n\t\t\t}\n\t\t\tif(target.stage != this._stage)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"Target cannot claim a touch on the selected stage because it appears on a different stage.\");\n\t\t\t}\n\t\t\tif(touchID < 0)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"Invalid touch. Touch ID must be >= 0.\");\n\t\t\t}\n\t\t\tvar existingTarget:DisplayObject = DisplayObject(this._claims[touchID]);\n\t\t\tif(existingTarget)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tthis._claims[touchID] = target;\n\t\t\tif(this._stageListenerCount == 0)\n\t\t\t{\n\t\t\t\tthis._stage.addEventListener(TouchEvent.TOUCH, stage_touchHandler);\n\t\t\t}\n\t\t\tthis._stageListenerCount++;\n\t\t\tthis.dispatchEventWith(Event.CHANGE, false, touchID);\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t * Removes a claim to the touch with the specified ID.\n\t\t */\n\t\tpublic function removeClaim(touchID:int):void\n\t\t{\n\t\t\tvar existingTarget:DisplayObject = DisplayObject(this._claims[touchID]);\n\t\t\tif(!existingTarget)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdelete this._claims[touchID];\n\t\t\tthis.dispatchEventWith(Event.CHANGE, false, touchID);\n\t\t}\n\n\t\t/**\n\t\t * Gets the display object that has claimed a touch with the specified\n\t\t * ID. If no touch claims the touch with the specified ID, returns\n\t\t * <code>null</code>.\n\t\t */\n\t\tpublic function getClaim(touchID:int):DisplayObject\n\t\t{\n\t\t\tif(touchID < 0)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"Invalid touch. Touch ID must be >= 0.\");\n\t\t\t}\n\t\t\treturn DisplayObject(this._claims[touchID]);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tfor(var key:Object in this._claims)\n\t\t\t{\n\t\t\t\tvar touchID:int = key as int;\n\t\t\t\tvar touch:Touch = event.getTouch(this._stage, TouchPhase.ENDED, touchID);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tdelete this._claims[key];\n\t\t\t\tthis._stageListenerCount--;\n\t\t\t}\n\t\t\tif(this._stageListenerCount == 0)\n\t\t\t{\n\t\t\t\tthis._stage.removeEventListener(TouchEvent.TOUCH, stage_touchHandler);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/events/FeathersEventType.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.events\n{\n\t/**\n\t * Event <code>type</code> constants for Feathers controls. This class is\n\t * not a subclass of <code>starling.events.Event</code> because these\n\t * constants are meant to be used with <code>dispatchEventWith()</code> and\n\t * take advantage of the Starling's event object pooling. The object passed\n\t * to an event listener will be of type <code>starling.events.Event</code>.\n\t *\n\t * <listing version=\"3.0\">\n\t * function listener( event:Event ):void\n\t * {\n\t *     trace( \"creation complete\" );\n\t * }\n\t * component.addEventListener( FeathersEventType.CREATION_COMPLETE, listener );</listing>\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class FeathersEventType\n\t{\n\t\t/**\n\t\t * The <code>FeathersEventType.INITIALIZE</code> event type is meant to\n\t\t * be used when an <code>IFeathersControl</code> has finished running\n\t\t * its <code>initialize()</code> function.\n\t\t */\n\t\tpublic static const INITIALIZE:String = \"initialize\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.CREATION_COMPLETE</code> event type is\n\t\t * meant to be used when an <code>IFeathersControl</code> has finished\n\t\t * validating for the first time. A well-designed component will have\n\t\t * created all of its children and it will be fully ready for user\n\t\t * interaction.\n\t\t */\n\t\tpublic static const CREATION_COMPLETE:String = \"creationComplete\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.RESIZE</code> event type is meant to\n\t\t * be used when an <code>IFeathersControl</code> has resized.\n\t\t */\n\t\tpublic static const RESIZE:String = \"resize\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.ENTER</code> event type is meant to\n\t\t * be used when the enter key has been pressed in an input control.\n\t\t */\n\t\tpublic static const ENTER:String = \"enter\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.CLEAR</code> event type is a generic\n\t\t * event type for when something is \"cleared\".\n\t\t */\n\t\tpublic static const CLEAR:String = \"clear\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.SCROLL_START</code> event type is used\n\t\t * when a control starts scrolling in either direction as a result of\n\t\t * either user interaction or animation.\n\t\t */\n\t\tpublic static const SCROLL_START:String = \"scrollStart\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.SCROLL_COMPLETE</code> event type is used\n\t\t * when a control finishes scrolling in either direction as a result of\n\t\t * either user interaction or animation.\n\t\t */\n\t\tpublic static const SCROLL_COMPLETE:String = \"scrollComplete\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.BEGIN_INTERACTION</code> event type is\n\t\t * used by many UI controls where a drag or other interaction happens\n\t\t * over time. An example is a <code>Slider</code> control where the\n\t\t * user touches the thumb to begin dragging.\n\t\t */\n\t\tpublic static const BEGIN_INTERACTION:String = \"beginInteraction\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.END_INTERACTION</code> event type is\n\t\t * used by many UI controls where a drag or other interaction happens\n\t\t * over time. An example is a <code>Slider</code> control where the\n\t\t * user stops touching the thumb after dragging.\n\t\t *\n\t\t * <p>Depending on the control, the result of the interaction may\n\t\t * continue after the interaction ends. For instance, a <code>Scroller</code>\n\t\t * may be \"thrown\", and the scrolling will continue animating after the\n\t\t * user has finished interacting with it.</p>\n\t\t */\n\t\tpublic static const END_INTERACTION:String = \"endInteraction\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.TRANSITION_START</code> event type is\n\t\t * used by the <code>ScreenNavigator</code> to indicate when a\n\t\t * transition between screens begins.\n\t\t *\n\t\t * @see feathers.controls.ScreenNavigator\n\t\t */\n\t\tpublic static const TRANSITION_START:String = \"transitionStart\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.TRANSITION_COMPLETE</code> event type is\n\t\t * used by the <code>ScreenNavigator</code> to indicate when a\n\t\t * transition between screens ends.\n\t\t *\n\t\t * @see feathers.controls.ScreenNavigator\n\t\t */\n\t\tpublic static const TRANSITION_COMPLETE:String = \"transitionComplete\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.TRANSITION_IN_START</code> event type is\n\t\t * used by the <code>ScreenNavigator</code> to indicate to a new screen\n\t\t * when it begins to transition in.\n\t\t *\n\t\t * @see feathers.controls.ScreenNavigator\n\t\t */\n\t\tpublic static const TRANSITION_IN_START:String = \"transitionInStart\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.TRANSITION_IN_COMPLETE</code> event type is\n\t\t * used by the <code>ScreenNavigator</code> to indicate to a new screen\n\t\t * when it has completed transitioning in.\n\t\t *\n\t\t * @see feathers.controls.ScreenNavigator\n\t\t */\n\t\tpublic static const TRANSITION_IN_COMPLETE:String = \"transitionInComplete\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.TRANSITION_OUT_START</code> event type is\n\t\t * used by the <code>ScreenNavigator</code> to indicate to an existing\n\t\t * screen when it begins to transition out.\n\t\t *\n\t\t * @see feathers.controls.ScreenNavigator\n\t\t */\n\t\tpublic static const TRANSITION_OUT_START:String = \"transitionOutStart\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.TRANSITION_OUT_COMPLETE</code> event type is\n\t\t * used by the <code>ScreenNavigator</code> to indicate to an existing\n\t\t * screen when it has completed transitioning out.\n\t\t *\n\t\t * @see feathers.controls.ScreenNavigator\n\t\t */\n\t\tpublic static const TRANSITION_OUT_COMPLETE:String = \"transitionOutComplete\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.TRANSITION_CANCEL</code> event type is\n\t\t * used by the <code>ScreenNavigator</code> to indicate when a\n\t\t * transition between screens is cancelled.\n\t\t *\n\t\t * @see feathers.controls.ScreenNavigator\n\t\t */\n\t\tpublic static const TRANSITION_CANCEL:String = \"transitionCancel\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.FOCUS_IN</code> event type is used by\n\t\t * Feathers components to indicate when they have received focus.\n\t\t */\n\t\tpublic static const FOCUS_IN:String = \"focusIn\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.FOCUS_OUT</code> event type is used by\n\t\t * Feathers components to indicate when they have lost focus.\n\t\t */\n\t\tpublic static const FOCUS_OUT:String = \"focusOut\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.RENDERER_ADD</code> event type is used by\n\t\t * Feathers components with item renderers to indicate when a new\n\t\t * renderer has been added. This event type is meant to be used with\n\t\t * virtualized layouts where only a limited set of renderers will be\n\t\t * created for a data provider that may include a larger number of items.\n\t\t */\n\t\tpublic static const RENDERER_ADD:String = \"rendererAdd\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.RENDERER_REMOVE</code> event type is used\n\t\t * by Feathers controls with item renderers to indicate when a renderer\n\t\t * is removed. This event type is meant to be used with virtualized\n\t\t * layouts where only a limited set of renderers will be created for\n\t\t * a data provider that may include a larger number items.\n\t\t */\n\t\tpublic static const RENDERER_REMOVE:String = \"rendererRemove\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.ERROR</code> event type is used by\n\t\t * Feathers controls when an error occurs that can be caught and\n\t\t * safely ignored.\n\t\t */\n\t\tpublic static const ERROR:String = \"error\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.LAYOUT_DATA_CHANGE</code> event type is\n\t\t * used by Feathers controls when their layout data has changed.\n\t\t */\n\t\tpublic static const LAYOUT_DATA_CHANGE:String = \"layoutDataChange\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.LONG_PRESS</code> event type is used by\n\t\t * the Feathers <code>Button</code> when it is pressed for a long time.\n\t\t *\n\t\t * @see feathers.controls.Button#event:longPress\n\t\t */\n\t\tpublic static const LONG_PRESS:String = \"longPress\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.SOFT_KEYBOARD_ACTIVATE</code> event type\n\t\t * is used by Feathers text editors when they activate a device's soft\n\t\t * keyboard.\n\t\t *\n\t\t * @see feathers.core.ITextEditor\n\t\t */\n\t\tpublic static const SOFT_KEYBOARD_ACTIVATE:String = \"softKeyboardActivate\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.SOFT_KEYBOARD_ACTIVATING</code> event type\n\t\t * is used by Feathers text editors when they are about to activate a device's soft\n\t\t * keyboard.\n\t\t *\n\t\t * @see feathers.core.ITextEditor\n\t\t */\n\t\tpublic static const SOFT_KEYBOARD_ACTIVATING:String = \"softKeyboardActivating\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.SOFT_KEYBOARD_DEACTIVATE</code> event type\n\t\t * is used by Feathers text editors when they deactivate a device's soft\n\t\t * keyboard.\n\t\t *\n\t\t * @see feathers.core.ITextEditor\n\t\t */\n\t\tpublic static const SOFT_KEYBOARD_DEACTIVATE:String = \"softKeyboardDeactivate\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.PROGRESS</code> event type is used by\n\t\t * Feathers classes with long-running tasks to indicate that progress\n\t\t * has been made, but the task is incomplete.\n\t\t */\n\t\tpublic static const PROGRESS:String = \"progress\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.LOCATION_CHANGE</code> event type is used\n\t\t * by the Feathers <code>WebView</code> component to indicate that its\n\t\t * location has changed.\n\t\t */\n\t\tpublic static const LOCATION_CHANGE:String = \"locationChange\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.LOCATION_CHANGING</code> event type is\n\t\t * used by the Feathers <code>WebView</code> component to indicate that\n\t\t * its location is about to change.\n\t\t */\n\t\tpublic static const LOCATION_CHANGING:String = \"locationChanging\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.STATE_CHANGE</code> event type is used by\n\t\t * Feathers classes that implement the <code>IStateContext</code>\n\t\t * interface.\n\t\t *\n\t\t * @see feathers.core.IStateContext\n\t\t */\n\t\tpublic static const STATE_CHANGE:String = \"stateChange\";\n\n\t\t/**\n\t\t * The <code>FeathersEventType.PULLING</code> event type is used by\n\t\t * Feathers scrolling containers to notify pull views of changes.\n\t\t */\n\t\tpublic static const PULLING:String = \"pulling\";\n\t}\n}\n"
  },
  {
    "path": "source/feathers/events/MediaPlayerEventType.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.events\n{\n\t/**\n\t * Event <code>type</code> constants for Feathers media player controls.\n\t * This class is not a subclass of <code>starling.events.Event</code>\n\t * because these constants are meant to be used with\n\t * <code>dispatchEventWith()</code> and take advantage of the Starling's\n\t * event object pooling. The object passed to an event listener will be of\n\t * type <code>starling.events.Event</code>.\n\t *\n\t * <listing version=\"3.0\">\n\t * function listener( event:Event ):void\n\t * {\n\t *     trace( mediaPlayer.currentTime );\n\t * }\n\t * mediaPlayer.addEventListener( MediaPlayerEventType.CURRENT_TIME_CHANGE, listener );</listing>\n\t *\n\t * @productversion Feathers 2.2.0\n\t */\n\tpublic class MediaPlayerEventType\n\t{\n\t\t/**\n\t\t * Dispatched when a media player changes to the full-screen display mode\n\t\t * or back to the normal display mode.\n\t\t */\n\t\tpublic static const DISPLAY_STATE_CHANGE:String = \"displayStageChange\";\n\n\t\t/**\n\t\t * Dispatched when a media player's playback state changes, such as when\n\t\t * it begins playing or is paused.\n\t\t */\n\t\tpublic static const PLAYBACK_STATE_CHANGE:String = \"playbackStageChange\";\n\n\t\t/**\n\t\t * Dispatched when a media player's total playhead time changes.\n\t\t */\n\t\tpublic static const TOTAL_TIME_CHANGE:String = \"totalTimeChange\";\n\n\t\t/**\n\t\t * Dispatched when a media player's current playhead time changes.\n\t\t */\n\t\tpublic static const CURRENT_TIME_CHANGE:String = \"currentTimeChange\";\n\n\t\t/**\n\t\t * Dispatched when the original, native width or height of a video\n\t\t * player's content is calculated.\n\t\t */\n\t\tpublic static const DIMENSIONS_CHANGE:String = \"dimensionsChange\";\n\n\t\t/**\n\t\t * Dispatched when a media player's sound transform is changed.\n\t\t */\n\t\tpublic static const SOUND_TRANSFORM_CHANGE:String = \"soundTransformChange\";\n\n\t\t/**\n\t\t * Dispatched when the media's metadata becomes available.\n\t\t */\n\t\tpublic static const METADATA_RECEIVED:String = \"metadataReceived\";\n\n\t\t/**\n\t\t * Dispatched when the media's cue point is reached.\n\t\t */\n\t\tpublic static const CUE_POINT:String = \"cuePoint\";\n\n\t\t/**\n\t\t * Dispatched when the media's XMP data is read.\n\t\t */\n\t\tpublic static const XMP_DATA:String = \"xmpData\";\n\n\t\t/**\n\t\t * Dispatched periodically when a media player's content is loading to\n\t\t * indicate the current progress.\n\t\t */\n\t\tpublic static const LOAD_PROGRESS:String = \"loadProgress\";\n\n\t\t/**\n\t\t * Dispatched when a media player's content is fully loaded and it\n\t\t * may be played to completion without buffering.\n\t\t */\n\t\tpublic static const LOAD_COMPLETE:String = \"loadComplete\";\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/AnchorLayout.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IMeasureDisplayObject;\n\timport feathers.core.IValidating;\n\n\timport flash.errors.IllegalOperationError;\n\timport flash.geom.Point;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.EventDispatcher;\n\timport starling.utils.Pool;\n\n\t/**\n\t * Dispatched when a property of the layout changes, indicating that a\n\t * redraw is probably needed.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Positions and sizes items by anchoring their edges (or center points)\n\t * to their parent container or to other items.\n\t *\n\t * @see ../../../help/anchor-layout.html How to use AnchorLayout with Feathers containers\n\t * @see AnchorLayoutData\n\t *\n\t * @productversion Feathers 1.1.0\n\t */\n\tpublic class AnchorLayout extends EventDispatcher implements ILayout\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const CIRCULAR_REFERENCE_ERROR:String = \"It is impossible to create this layout due to a circular reference in the AnchorLayoutData.\";\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function AnchorLayout()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _helperVector1:Vector.<DisplayObject> = new <DisplayObject>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _helperVector2:Vector.<DisplayObject> = new <DisplayObject>[];\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get requiresLayoutOnScroll():Boolean\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function layout(items:Vector.<DisplayObject>, viewPortBounds:ViewPortBounds = null, result:LayoutBoundsResult = null):LayoutBoundsResult\n\t\t{\n\t\t\tvar boundsX:Number = viewPortBounds ? viewPortBounds.x : 0;\n\t\t\tvar boundsY:Number = viewPortBounds ? viewPortBounds.y : 0;\n\t\t\tvar minWidth:Number = viewPortBounds ? viewPortBounds.minWidth : 0;\n\t\t\tvar minHeight:Number = viewPortBounds ? viewPortBounds.minHeight : 0;\n\t\t\tvar maxWidth:Number = viewPortBounds ? viewPortBounds.maxWidth : Number.POSITIVE_INFINITY;\n\t\t\tvar maxHeight:Number = viewPortBounds ? viewPortBounds.maxHeight : Number.POSITIVE_INFINITY;\n\t\t\tvar explicitWidth:Number = viewPortBounds ? viewPortBounds.explicitWidth : NaN;\n\t\t\tvar explicitHeight:Number = viewPortBounds ? viewPortBounds.explicitHeight : NaN;\n\n\t\t\tvar viewPortWidth:Number = explicitWidth;\n\t\t\tvar viewPortHeight:Number = explicitHeight;\n\n\t\t\tvar needsWidth:Boolean = explicitWidth !== explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = explicitHeight !== explicitHeight; //isNaN\n\t\t\tif(needsWidth || needsHeight)\n\t\t\t{\n\t\t\t\tthis.validateItems(items, explicitWidth, explicitHeight,\n\t\t\t\t\tmaxWidth, maxHeight, true);\n\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\tthis.measureViewPort(items, viewPortWidth, viewPortHeight, point);\n\t\t\t\tif(needsWidth)\n\t\t\t\t{\n\t\t\t\t\tviewPortWidth = point.x;\n\t\t\t\t\tif(viewPortWidth < minWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tviewPortWidth = minWidth;\n\t\t\t\t\t}\n\t\t\t\t\telse if(viewPortWidth > maxWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tviewPortWidth = maxWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(needsHeight)\n\t\t\t\t{\n\t\t\t\t\tviewPortHeight = point.y;\n\t\t\t\t\tif(viewPortHeight < minHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tviewPortHeight = minHeight;\n\t\t\t\t\t}\n\t\t\t\t\telse if(viewPortHeight > maxHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tviewPortHeight = maxHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tPool.putPoint(point);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.validateItems(items, explicitWidth, explicitHeight,\n\t\t\t\t\tmaxWidth, maxHeight, false);\n\t\t\t}\n\n\t\t\tthis.layoutWithBounds(items, boundsX, boundsY, viewPortWidth, viewPortHeight);\n\n\t\t\tpoint = Pool.getPoint();\n\t\t\tthis.measureContent(items, viewPortWidth, viewPortHeight, point);\n\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new LayoutBoundsResult();\n\t\t\t}\n\t\t\tresult.contentWidth = point.x;\n\t\t\tresult.contentHeight = point.y;\n\t\t\tresult.viewPortWidth = viewPortWidth;\n\t\t\tresult.viewPortHeight = viewPortHeight;\n\t\t\tPool.putPoint(point);\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function calculateNavigationDestination(items:Vector.<DisplayObject>, index:int, keyCode:uint, bounds:LayoutBoundsResult):int\n\t\t{\n\t\t\treturn index;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getNearestScrollPositionForIndex(index:int, scrollX:Number, scrollY:Number, items:Vector.<DisplayObject>, x:Number, y:Number, width:Number, height:Number, result:Point = null):Point\n\t\t{\n\t\t\treturn this.getScrollPositionForIndex(index, items, x, y, width, height, result);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getScrollPositionForIndex(index:int, items:Vector.<DisplayObject>, x:Number, y:Number, width:Number, height:Number, result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\t\t\tresult.x = 0;\n\t\t\tresult.y = 0;\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function measureViewPort(items:Vector.<DisplayObject>,\n\t\t\tviewPortWidth:Number, viewPortHeight:Number, result:Point):Point\n\t\t{\n\t\t\tthis._helperVector1.length = 0;\n\t\t\tthis._helperVector2.length = 0;\n\t\t\tresult.setTo(0, 0);\n\t\t\tvar mainVector:Vector.<DisplayObject> = items;\n\t\t\tvar otherVector:Vector.<DisplayObject> = this._helperVector1;\n\t\t\tthis.measureVector(items, otherVector, result);\n\t\t\tvar currentLength:Number = otherVector.length;\n\t\t\twhile(currentLength > 0)\n\t\t\t{\n\t\t\t\tif(otherVector == this._helperVector1)\n\t\t\t\t{\n\t\t\t\t\tmainVector = this._helperVector1;\n\t\t\t\t\totherVector = this._helperVector2;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tmainVector = this._helperVector2;\n\t\t\t\t\totherVector = this._helperVector1;\n\t\t\t\t}\n\t\t\t\tthis.measureVector(mainVector, otherVector, result);\n\t\t\t\tvar oldLength:Number = currentLength;\n\t\t\t\tcurrentLength = otherVector.length;\n\t\t\t\tif(oldLength == currentLength)\n\t\t\t\t{\n\t\t\t\t\tthis._helperVector1.length = 0;\n\t\t\t\t\tthis._helperVector2.length = 0;\n\t\t\t\t\tthrow new IllegalOperationError(CIRCULAR_REFERENCE_ERROR);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._helperVector1.length = 0;\n\t\t\tthis._helperVector2.length = 0;\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function measureVector(items:Vector.<DisplayObject>, unpositionedItems:Vector.<DisplayObject>, result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\n\t\t\tunpositionedItems.length = 0;\n\t\t\tvar itemCount:int = items.length;\n\t\t\tvar pushIndex:int = 0;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\tvar layoutData:AnchorLayoutData;\n\t\t\t\tif(item is ILayoutDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar layoutItem:ILayoutDisplayObject = ILayoutDisplayObject(item);\n\t\t\t\t\tif(!layoutItem.includeInLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tlayoutData = layoutItem.layoutData as AnchorLayoutData;\n\t\t\t\t}\n\t\t\t\tvar isReadyForLayout:Boolean = !layoutData || this.isReadyForLayout(layoutData, i, items, unpositionedItems);\n\t\t\t\tif(!isReadyForLayout)\n\t\t\t\t{\n\t\t\t\t\tunpositionedItems[pushIndex] = item;\n\t\t\t\t\tpushIndex++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tthis.measureItem(item, result);\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function measureItem(item:DisplayObject, result:Point):void\n\t\t{\n\t\t\tvar maxX:Number = result.x;\n\t\t\tvar maxY:Number = result.y;\n\t\t\tvar isAnchored:Boolean = false;\n\t\t\tif(item is ILayoutDisplayObject)\n\t\t\t{\n\t\t\t\tvar layoutItem:ILayoutDisplayObject = ILayoutDisplayObject(item);\n\t\t\t\tvar layoutData:AnchorLayoutData = layoutItem.layoutData as AnchorLayoutData;\n\t\t\t\tif(layoutData)\n\t\t\t\t{\n\t\t\t\t\tvar measurement:Number = this.measureItemHorizontally(layoutItem, layoutData);\n\t\t\t\t\tif(measurement > maxX)\n\t\t\t\t\t{\n\t\t\t\t\t\tmaxX = measurement;\n\t\t\t\t\t}\n\t\t\t\t\tmeasurement = this.measureItemVertically(layoutItem, layoutData);\n\t\t\t\t\tif(measurement > maxY)\n\t\t\t\t\t{\n\t\t\t\t\t\tmaxY = measurement;\n\t\t\t\t\t}\n\t\t\t\t\tisAnchored = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!isAnchored)\n\t\t\t{\n\t\t\t\tmeasurement = item.x - item.pivotX + item.width;\n\t\t\t\tif(measurement > maxX)\n\t\t\t\t{\n\t\t\t\t\tmaxX = measurement;\n\t\t\t\t}\n\t\t\t\tmeasurement = item.y - item.pivotY + item.height;\n\t\t\t\tif(measurement > maxY)\n\t\t\t\t{\n\t\t\t\t\tmaxY = measurement;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tresult.x = maxX;\n\t\t\tresult.y = maxY;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function measureItemHorizontally(item:ILayoutDisplayObject, layoutData:AnchorLayoutData):Number\n\t\t{\n\t\t\tvar itemWidth:Number = item.width;\n\t\t\tvar displayItem:DisplayObject = DisplayObject(item);\n\t\t\tvar left:Number = this.getLeftOffset(displayItem);\n\t\t\tvar right:Number = this.getRightOffset(displayItem);\n\t\t\treturn itemWidth + left + right;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function measureItemVertically(item:ILayoutDisplayObject, layoutData:AnchorLayoutData):Number\n\t\t{\n\t\t\tvar itemHeight:Number = item.height;\n\t\t\tif(layoutData && item is IFeathersControl)\n\t\t\t{\n\t\t\t\tvar percentHeight:Number = layoutData.percentHeight;\n\t\t\t\t//for some reason, if we don't call a function right here,\n\t\t\t\t//compiling with the flex 4.6 SDK will throw a VerifyError\n\t\t\t\t//for a stack overflow.\n\t\t\t\t//we could change the === check back to !isNaN() instead, but\n\t\t\t\t//isNaN() can allocate an object, so we should call a different\n\t\t\t\t//function without allocation.\n\t\t\t\tthis.doNothing();\n\t\t\t\tif(percentHeight === percentHeight) //!isNaN\n\t\t\t\t{\n\t\t\t\t\titemHeight = IFeathersControl(item).minHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar displayItem:DisplayObject = DisplayObject(item);\n\t\t\tvar top:Number = this.getTopOffset(displayItem);\n\t\t\tvar bottom:Number = this.getBottomOffset(displayItem);\n\t\t\treturn itemHeight + top + bottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * This function is here to work around a bug in the Flex 4.6 SDK\n\t\t * compiler. For explanation, see the places where it gets called.\n\t\t */\n\t\tprotected function doNothing():void {}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getTopOffset(item:DisplayObject):Number\n\t\t{\n\t\t\tif(item is ILayoutDisplayObject)\n\t\t\t{\n\t\t\t\tvar layoutItem:ILayoutDisplayObject = ILayoutDisplayObject(item);\n\t\t\t\tvar layoutData:AnchorLayoutData = layoutItem.layoutData as AnchorLayoutData;\n\t\t\t\tif(layoutData)\n\t\t\t\t{\n\t\t\t\t\tvar top:Number = layoutData.top;\n\t\t\t\t\tvar hasTopPosition:Boolean = top === top; //!isNaN\n\t\t\t\t\tvar bottom:Number = layoutData.bottom;\n\t\t\t\t\tvar hasBottomPosition:Boolean = bottom === bottom; //!isNaN\n\t\t\t\t\tvar verticalCenter:Number = layoutData.verticalCenter;\n\t\t\t\t\tvar hasVerticalCenterPosition:Boolean = verticalCenter === verticalCenter; //!isNaN\n\t\t\t\t\tif(hasTopPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar topAnchorDisplayObject:DisplayObject = layoutData.topAnchorDisplayObject;\n\t\t\t\t\t\tif(topAnchorDisplayObject)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttop += topAnchorDisplayObject.height + this.getTopOffset(topAnchorDisplayObject);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn top;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(!hasBottomPosition && !hasVerticalCenterPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\ttop = item.y;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\ttop = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif(hasBottomPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar bottomAnchorDisplayObject:DisplayObject = layoutData.bottomAnchorDisplayObject;\n\t\t\t\t\t\tif(bottomAnchorDisplayObject)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttop = Math.max(top, -bottomAnchorDisplayObject.height - bottom + this.getTopOffset(bottomAnchorDisplayObject));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(hasVerticalCenterPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar verticalCenterAnchorDisplayObject:DisplayObject = layoutData.verticalCenterAnchorDisplayObject;\n\t\t\t\t\t\tif(verticalCenterAnchorDisplayObject)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar verticalOffset:Number = verticalCenter - Math.round((item.height - verticalCenterAnchorDisplayObject.height) / 2);\n\t\t\t\t\t\t\ttop = Math.max(top, verticalOffset + this.getTopOffset(verticalCenterAnchorDisplayObject));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(verticalCenter > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn verticalCenter * 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn top;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn item.y;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getRightOffset(item:DisplayObject):Number\n\t\t{\n\t\t\tif(item is ILayoutDisplayObject)\n\t\t\t{\n\t\t\t\tvar layoutItem:ILayoutDisplayObject = ILayoutDisplayObject(item);\n\t\t\t\tvar layoutData:AnchorLayoutData = layoutItem.layoutData as AnchorLayoutData;\n\t\t\t\tif(layoutData)\n\t\t\t\t{\n\t\t\t\t\tvar right:Number = layoutData.right;\n\t\t\t\t\tvar hasRightPosition:Boolean = right === right; //!isNaN\n\t\t\t\t\tif(hasRightPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar rightAnchorDisplayObject:DisplayObject = layoutData.rightAnchorDisplayObject;\n\t\t\t\t\t\tif(rightAnchorDisplayObject)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tright += rightAnchorDisplayObject.width + this.getRightOffset(rightAnchorDisplayObject);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn right;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tright = 0;\n\t\t\t\t\t}\n\t\t\t\t\tvar left:Number = layoutData.left;\n\t\t\t\t\tvar hasLeftPosition:Boolean = left === left; //!isNaN\n\t\t\t\t\tif(hasLeftPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar leftAnchorDisplayObject:DisplayObject = layoutData.leftAnchorDisplayObject;\n\t\t\t\t\t\tif(leftAnchorDisplayObject)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tright = Math.max(right, -leftAnchorDisplayObject.width - left + this.getRightOffset(leftAnchorDisplayObject));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tvar horizontalCenter:Number = layoutData.horizontalCenter;\n\t\t\t\t\tvar hasHorizontalCenterPosition:Boolean = horizontalCenter === horizontalCenter; //!isNaN\n\t\t\t\t\tif(hasHorizontalCenterPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar horizontalCenterAnchorDisplayObject:DisplayObject = layoutData.horizontalCenterAnchorDisplayObject;\n\t\t\t\t\t\tif(horizontalCenterAnchorDisplayObject)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar horizontalOffset:Number = -horizontalCenter - Math.round((item.width - horizontalCenterAnchorDisplayObject.width) / 2);\n\t\t\t\t\t\t\tright = Math.max(right, horizontalOffset + this.getRightOffset(horizontalCenterAnchorDisplayObject));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(horizontalCenter < 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn -horizontalCenter * 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn right;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getBottomOffset(item:DisplayObject):Number\n\t\t{\n\t\t\tif(item is ILayoutDisplayObject)\n\t\t\t{\n\t\t\t\tvar layoutItem:ILayoutDisplayObject = ILayoutDisplayObject(item);\n\t\t\t\tvar layoutData:AnchorLayoutData = layoutItem.layoutData as AnchorLayoutData;\n\t\t\t\tif(layoutData)\n\t\t\t\t{\n\t\t\t\t\tvar bottom:Number = layoutData.bottom;\n\t\t\t\t\tvar hasBottomPosition:Boolean = bottom === bottom; //!isNaN\n\t\t\t\t\tif(hasBottomPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar bottomAnchorDisplayObject:DisplayObject = layoutData.bottomAnchorDisplayObject;\n\t\t\t\t\t\tif(bottomAnchorDisplayObject)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbottom += bottomAnchorDisplayObject.height + this.getBottomOffset(bottomAnchorDisplayObject);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn bottom;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tbottom = 0;\n\t\t\t\t\t}\n\t\t\t\t\tvar top:Number = layoutData.top;\n\t\t\t\t\tvar hasTopPosition:Boolean = top === top; //!isNaN\n\t\t\t\t\tif(hasTopPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar topAnchorDisplayObject:DisplayObject = layoutData.topAnchorDisplayObject;\n\t\t\t\t\t\tif(topAnchorDisplayObject)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbottom = Math.max(bottom, -topAnchorDisplayObject.height - top + this.getBottomOffset(topAnchorDisplayObject));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tvar verticalCenter:Number = layoutData.verticalCenter;\n\t\t\t\t\tvar hasVerticalCenterPosition:Boolean = verticalCenter === verticalCenter; //!isNaN\n\t\t\t\t\tif(hasVerticalCenterPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar verticalCenterAnchorDisplayObject:DisplayObject = layoutData.verticalCenterAnchorDisplayObject;\n\t\t\t\t\t\tif(verticalCenterAnchorDisplayObject)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar verticalOffset:Number = -verticalCenter - Math.round((item.height - verticalCenterAnchorDisplayObject.height) / 2);\n\t\t\t\t\t\t\tbottom = Math.max(bottom, verticalOffset + this.getBottomOffset(verticalCenterAnchorDisplayObject));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(verticalCenter < 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn -verticalCenter * 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn bottom;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getLeftOffset(item:DisplayObject):Number\n\t\t{\n\t\t\tif(item is ILayoutDisplayObject)\n\t\t\t{\n\t\t\t\tvar layoutItem:ILayoutDisplayObject = ILayoutDisplayObject(item);\n\t\t\t\tvar layoutData:AnchorLayoutData = layoutItem.layoutData as AnchorLayoutData;\n\t\t\t\tif(layoutData)\n\t\t\t\t{\n\t\t\t\t\tvar left:Number = layoutData.left;\n\t\t\t\t\tvar hasLeftPosition:Boolean = left === left; //!isNaN\n\t\t\t\t\tvar right:Number = layoutData.right;\n\t\t\t\t\tvar hasRightPosition:Boolean = right === right; //!isNaN;\n\t\t\t\t\tvar horizontalCenter:Number = layoutData.horizontalCenter;\n\t\t\t\t\tvar hasHorizontalCenterPosition:Boolean = horizontalCenter === horizontalCenter; //!isNaN\n\t\t\t\t\tif(hasLeftPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar leftAnchorDisplayObject:DisplayObject = layoutData.leftAnchorDisplayObject;\n\t\t\t\t\t\tif(leftAnchorDisplayObject)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tleft += leftAnchorDisplayObject.width + this.getLeftOffset(leftAnchorDisplayObject);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn left;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(!hasRightPosition && !hasHorizontalCenterPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tleft = item.x;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tleft = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif(hasRightPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar rightAnchorDisplayObject:DisplayObject = layoutData.rightAnchorDisplayObject;\n\t\t\t\t\t\tif(rightAnchorDisplayObject)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tleft = Math.max(left, -rightAnchorDisplayObject.width - right + this.getLeftOffset(rightAnchorDisplayObject));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(hasHorizontalCenterPosition)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar horizontalCenterAnchorDisplayObject:DisplayObject = layoutData.horizontalCenterAnchorDisplayObject;\n\t\t\t\t\t\tif(horizontalCenterAnchorDisplayObject)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar horizontalOffset:Number = horizontalCenter - Math.round((item.width - horizontalCenterAnchorDisplayObject.width) / 2);\n\t\t\t\t\t\t\tleft = Math.max(left, horizontalOffset + this.getLeftOffset(horizontalCenterAnchorDisplayObject));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(horizontalCenter > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn horizontalCenter * 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn left;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn item.x;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutWithBounds(items:Vector.<DisplayObject>, x:Number, y:Number, width:Number, height:Number):void\n\t\t{\n\t\t\tthis._helperVector1.length = 0;\n\t\t\tthis._helperVector2.length = 0;\n\t\t\tvar mainVector:Vector.<DisplayObject> = items;\n\t\t\tvar otherVector:Vector.<DisplayObject> = this._helperVector1;\n\t\t\tthis.layoutVector(items, otherVector, x, y, width, height);\n\t\t\tvar currentLength:Number = otherVector.length;\n\t\t\twhile(currentLength > 0)\n\t\t\t{\n\t\t\t\tif(otherVector == this._helperVector1)\n\t\t\t\t{\n\t\t\t\t\tmainVector = this._helperVector1;\n\t\t\t\t\totherVector = this._helperVector2;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tmainVector = this._helperVector2;\n\t\t\t\t\totherVector = this._helperVector1;\n\t\t\t\t}\n\t\t\t\tthis.layoutVector(mainVector, otherVector, x, y, width, height);\n\t\t\t\tvar oldLength:Number = currentLength;\n\t\t\t\tcurrentLength = otherVector.length;\n\t\t\t\tif(oldLength == currentLength)\n\t\t\t\t{\n\t\t\t\t\tthis._helperVector1.length = 0;\n\t\t\t\t\tthis._helperVector2.length = 0;\n\t\t\t\t\tthrow new IllegalOperationError(CIRCULAR_REFERENCE_ERROR);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._helperVector1.length = 0;\n\t\t\tthis._helperVector2.length = 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutVector(items:Vector.<DisplayObject>, unpositionedItems:Vector.<DisplayObject>, boundsX:Number, boundsY:Number, viewPortWidth:Number, viewPortHeight:Number):void\n\t\t{\n\t\t\tunpositionedItems.length = 0;\n\t\t\tvar itemCount:int = items.length;\n\t\t\tvar pushIndex:int = 0;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\tvar layoutItem:ILayoutDisplayObject = item as ILayoutDisplayObject;\n\t\t\t\tif(!layoutItem || !layoutItem.includeInLayout)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tvar layoutData:AnchorLayoutData = layoutItem.layoutData as AnchorLayoutData;\n\t\t\t\tif(!layoutData)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tvar isReadyForLayout:Boolean = this.isReadyForLayout(layoutData, i, items, unpositionedItems);\n\t\t\t\tif(!isReadyForLayout)\n\t\t\t\t{\n\t\t\t\t\tunpositionedItems[pushIndex] = item;\n\t\t\t\t\tpushIndex++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tthis.positionHorizontally(layoutItem, layoutData, boundsX, boundsY, viewPortWidth, viewPortHeight);\n\t\t\t\tthis.positionVertically(layoutItem, layoutData, boundsX, boundsY, viewPortWidth, viewPortHeight);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function positionHorizontally(item:ILayoutDisplayObject, layoutData:AnchorLayoutData, boundsX:Number, boundsY:Number, viewPortWidth:Number, viewPortHeight:Number):void\n\t\t{\n\t\t\tvar uiItem:IMeasureDisplayObject = item as IMeasureDisplayObject;\n\t\t\tvar percentWidth:Number = layoutData.percentWidth;\n\t\t\tif(percentWidth === percentWidth) //!isNaN\n\t\t\t{\n\t\t\t\tif(percentWidth < 0)\n\t\t\t\t{\n\t\t\t\t\tpercentWidth = 0;\n\t\t\t\t}\n\t\t\t\telse if(percentWidth > 100)\n\t\t\t\t{\n\t\t\t\t\tpercentWidth = 100;\n\t\t\t\t}\n\t\t\t\tvar itemWidth:Number = percentWidth * 0.01 * viewPortWidth;\n\t\t\t\tif(uiItem !== null)\n\t\t\t\t{\n\t\t\t\t\tvar minWidth:Number = uiItem.explicitMinWidth;\n\t\t\t\t\tvar maxWidth:Number = uiItem.explicitMaxWidth;\n\t\t\t\t\tif(itemWidth < minWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\titemWidth = minWidth;\n\t\t\t\t\t}\n\t\t\t\t\telse if(itemWidth > maxWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\titemWidth = maxWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(itemWidth > viewPortWidth)\n\t\t\t\t{\n\t\t\t\t\titemWidth = viewPortWidth;\n\t\t\t\t}\n\t\t\t\tif(uiItem.explicitMaxWidth === uiItem.explicitMaxWidth &&\n\t\t\t\t\tuiItem.explicitMaxWidth < itemWidth)\n\t\t\t\t{\n\t\t\t\t\titemWidth = uiItem.explicitMaxWidth;\n\t\t\t\t}\n\t\t\t\titem.width = itemWidth;\n\t\t\t}\n\t\t\tvar left:Number = layoutData.left;\n\t\t\tvar hasLeftPosition:Boolean = left === left; //!isNaN\n\t\t\tif(hasLeftPosition)\n\t\t\t{\n\t\t\t\tvar leftAnchorDisplayObject:DisplayObject = layoutData.leftAnchorDisplayObject;\n\t\t\t\tif(leftAnchorDisplayObject)\n\t\t\t\t{\n\t\t\t\t\titem.x = item.pivotX + leftAnchorDisplayObject.x - leftAnchorDisplayObject.pivotX + leftAnchorDisplayObject.width + left;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\titem.x = item.pivotX + boundsX + left;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar horizontalCenter:Number = layoutData.horizontalCenter;\n\t\t\tvar hasHorizontalCenterPosition:Boolean = horizontalCenter === horizontalCenter; //!isNaN\n\t\t\tvar right:Number = layoutData.right;\n\t\t\tvar hasRightPosition:Boolean = right === right; //!isNaN\n\t\t\tif(hasRightPosition)\n\t\t\t{\n\t\t\t\tvar rightAnchorDisplayObject:DisplayObject = layoutData.rightAnchorDisplayObject;\n\t\t\t\tif(hasLeftPosition)\n\t\t\t\t{\n\t\t\t\t\tvar leftRightWidth:Number = viewPortWidth;\n\t\t\t\t\tif(rightAnchorDisplayObject)\n\t\t\t\t\t{\n\t\t\t\t\t\tleftRightWidth = rightAnchorDisplayObject.x - rightAnchorDisplayObject.pivotX;\n\t\t\t\t\t}\n\t\t\t\t\tif(leftAnchorDisplayObject)\n\t\t\t\t\t{\n\t\t\t\t\t\tleftRightWidth -= (leftAnchorDisplayObject.x - leftAnchorDisplayObject.pivotX + leftAnchorDisplayObject.width);\n\t\t\t\t\t}\n\t\t\t\t\titemWidth = leftRightWidth - right - left;\n\t\t\t\t\tif(uiItem.explicitMaxWidth === uiItem.explicitMaxWidth && //!isNaN\n\t\t\t\t\t\tuiItem.explicitMaxWidth < itemWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\titemWidth = uiItem.explicitMaxWidth;\n\t\t\t\t\t}\n\t\t\t\t\titem.width = itemWidth;\n\t\t\t\t}\n\t\t\t\telse if(hasHorizontalCenterPosition)\n\t\t\t\t{\n\t\t\t\t\tvar horizontalCenterAnchorDisplayObject:DisplayObject = layoutData.horizontalCenterAnchorDisplayObject;\n\t\t\t\t\tvar xPositionOfCenter:Number;\n\t\t\t\t\tif(horizontalCenterAnchorDisplayObject)\n\t\t\t\t\t{\n\t\t\t\t\t\txPositionOfCenter = horizontalCenterAnchorDisplayObject.x - horizontalCenterAnchorDisplayObject.pivotX + Math.round(horizontalCenterAnchorDisplayObject.width / 2) + horizontalCenter;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\txPositionOfCenter = Math.round(viewPortWidth / 2) + horizontalCenter;\n\t\t\t\t\t}\n\t\t\t\t\tvar xPositionOfRight:Number;\n\t\t\t\t\tif(rightAnchorDisplayObject)\n\t\t\t\t\t{\n\t\t\t\t\t\txPositionOfRight = rightAnchorDisplayObject.x - rightAnchorDisplayObject.pivotX - right;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\txPositionOfRight = viewPortWidth - right;\n\t\t\t\t\t}\n\t\t\t\t\titemWidth = 2 * (xPositionOfRight - xPositionOfCenter);\n\t\t\t\t\tif(uiItem.explicitMaxWidth === uiItem.explicitMaxWidth && //!isNaN\n\t\t\t\t\t\tuiItem.explicitMaxWidth < itemWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\titemWidth = uiItem.explicitMaxWidth;\n\t\t\t\t\t}\n\t\t\t\t\titem.width = itemWidth;\n\t\t\t\t\titem.x = item.pivotX + viewPortWidth - right - item.width;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(rightAnchorDisplayObject)\n\t\t\t\t\t{\n\t\t\t\t\t\titem.x = item.pivotX + rightAnchorDisplayObject.x - rightAnchorDisplayObject.pivotX - item.width - right;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\titem.x = item.pivotX + boundsX + viewPortWidth - right - item.width;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(hasHorizontalCenterPosition)\n\t\t\t{\n\t\t\t\thorizontalCenterAnchorDisplayObject = layoutData.horizontalCenterAnchorDisplayObject;\n\t\t\t\tif(horizontalCenterAnchorDisplayObject)\n\t\t\t\t{\n\t\t\t\t\txPositionOfCenter = horizontalCenterAnchorDisplayObject.x - horizontalCenterAnchorDisplayObject.pivotX + Math.round(horizontalCenterAnchorDisplayObject.width / 2) + horizontalCenter;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\txPositionOfCenter = Math.round(viewPortWidth / 2) + horizontalCenter;\n\t\t\t\t}\n\n\t\t\t\tif(hasLeftPosition)\n\t\t\t\t{\n\t\t\t\t\titemWidth = 2 * (xPositionOfCenter - item.x + item.pivotX);\n\t\t\t\t\tif(uiItem.explicitMaxWidth === uiItem.explicitMaxWidth && //!isNaN\n\t\t\t\t\t\tuiItem.explicitMaxWidth < itemWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\titemWidth = uiItem.explicitMaxWidth;\n\t\t\t\t\t}\n\t\t\t\t\titem.width = itemWidth;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\titem.x = item.pivotX + xPositionOfCenter - Math.round(item.width / 2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function positionVertically(item:ILayoutDisplayObject, layoutData:AnchorLayoutData, boundsX:Number, boundsY:Number, viewPortWidth:Number, viewPortHeight:Number):void\n\t\t{\n\t\t\tvar uiItem:IMeasureDisplayObject = item as IMeasureDisplayObject;\n\t\t\tvar percentHeight:Number = layoutData.percentHeight;\n\t\t\tif(percentHeight === percentHeight) //!isNaN\n\t\t\t{\n\t\t\t\tif(percentHeight < 0)\n\t\t\t\t{\n\t\t\t\t\tpercentHeight = 0;\n\t\t\t\t}\n\t\t\t\telse if(percentHeight > 100)\n\t\t\t\t{\n\t\t\t\t\tpercentHeight = 100;\n\t\t\t\t}\n\t\t\t\tvar itemHeight:Number = percentHeight * 0.01 * viewPortHeight;\n\t\t\t\tif(uiItem !== null)\n\t\t\t\t{\n\t\t\t\t\tvar minHeight:Number = uiItem.explicitMinHeight;\n\t\t\t\t\tvar maxHeight:Number = uiItem.explicitMaxHeight;\n\t\t\t\t\tif(itemHeight < minHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\titemHeight = minHeight;\n\t\t\t\t\t}\n\t\t\t\t\telse if(itemHeight > maxHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\titemHeight = maxHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(itemHeight > viewPortHeight)\n\t\t\t\t{\n\t\t\t\t\titemHeight = viewPortHeight;\n\t\t\t\t}\n\t\t\t\tif(uiItem.explicitMaxHeight === uiItem.explicitMaxHeight && //!isNaN\n\t\t\t\t\tuiItem.explicitMaxHeight < itemHeight)\n\t\t\t\t{\n\t\t\t\t\titemHeight = uiItem.explicitMaxHeight;\n\t\t\t\t}\n\t\t\t\titem.height = itemHeight;\n\t\t\t}\n\t\t\tvar top:Number = layoutData.top;\n\t\t\tvar hasTopPosition:Boolean = top === top; //!isNaN\n\t\t\tif(hasTopPosition)\n\t\t\t{\n\t\t\t\tvar topAnchorDisplayObject:DisplayObject = layoutData.topAnchorDisplayObject;\n\t\t\t\tif(topAnchorDisplayObject)\n\t\t\t\t{\n\t\t\t\t\titem.y = item.pivotY + topAnchorDisplayObject.y - topAnchorDisplayObject.pivotY + topAnchorDisplayObject.height + top;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\titem.y = item.pivotY + boundsY + top;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar verticalCenter:Number = layoutData.verticalCenter;\n\t\t\tvar hasVerticalCenterPosition:Boolean = verticalCenter === verticalCenter; //!isNaN\n\t\t\tvar bottom:Number = layoutData.bottom;\n\t\t\tvar hasBottomPosition:Boolean = bottom === bottom; //!isNaN\n\t\t\tif(hasBottomPosition)\n\t\t\t{\n\t\t\t\tvar bottomAnchorDisplayObject:DisplayObject = layoutData.bottomAnchorDisplayObject;\n\t\t\t\tif(hasTopPosition)\n\t\t\t\t{\n\t\t\t\t\tvar topBottomHeight:Number = viewPortHeight;\n\t\t\t\t\tif(bottomAnchorDisplayObject)\n\t\t\t\t\t{\n\t\t\t\t\t\ttopBottomHeight = bottomAnchorDisplayObject.y - bottomAnchorDisplayObject.pivotY;\n\t\t\t\t\t}\n\t\t\t\t\tif(topAnchorDisplayObject)\n\t\t\t\t\t{\n\t\t\t\t\t\ttopBottomHeight -= (topAnchorDisplayObject.y - topAnchorDisplayObject.pivotY + topAnchorDisplayObject.height);\n\t\t\t\t\t}\n\t\t\t\t\titemHeight = topBottomHeight - bottom - top;\n\t\t\t\t\tif(uiItem.explicitMaxHeight === uiItem.explicitMaxHeight && //!isNaN\n\t\t\t\t\t\tuiItem.explicitMaxHeight < itemHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\titemHeight = uiItem.explicitMaxHeight;\n\t\t\t\t\t}\n\t\t\t\t\titem.height = itemHeight;\n\t\t\t\t}\n\t\t\t\telse if(hasVerticalCenterPosition)\n\t\t\t\t{\n\t\t\t\t\tvar verticalCenterAnchorDisplayObject:DisplayObject = layoutData.verticalCenterAnchorDisplayObject;\n\t\t\t\t\tvar yPositionOfCenter:Number;\n\t\t\t\t\tif(verticalCenterAnchorDisplayObject)\n\t\t\t\t\t{\n\t\t\t\t\t\tyPositionOfCenter = verticalCenterAnchorDisplayObject.y - verticalCenterAnchorDisplayObject.pivotY + Math.round(verticalCenterAnchorDisplayObject.height / 2) + verticalCenter;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tyPositionOfCenter = Math.round(viewPortHeight / 2) + verticalCenter;\n\t\t\t\t\t}\n\t\t\t\t\tvar yPositionOfBottom:Number;\n\t\t\t\t\tif(bottomAnchorDisplayObject)\n\t\t\t\t\t{\n\t\t\t\t\t\tyPositionOfBottom = bottomAnchorDisplayObject.y - bottomAnchorDisplayObject.pivotY - bottom;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tyPositionOfBottom = viewPortHeight - bottom;\n\t\t\t\t\t}\n\t\t\t\t\titemHeight = 2 * (yPositionOfBottom - yPositionOfCenter);\n\t\t\t\t\tif(uiItem.explicitMaxHeight === uiItem.explicitMaxHeight && //!isNaN\n\t\t\t\t\t\tuiItem.explicitMaxHeight < itemHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\titemHeight = uiItem.explicitMaxHeight;\n\t\t\t\t\t}\n\t\t\t\t\titem.height = itemHeight;\n\t\t\t\t\titem.y = item.pivotY + viewPortHeight - bottom - item.height;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(bottomAnchorDisplayObject)\n\t\t\t\t\t{\n\t\t\t\t\t\titem.y = item.pivotY + bottomAnchorDisplayObject.y - bottomAnchorDisplayObject.pivotY - item.height - bottom;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\titem.y = item.pivotY + boundsY + viewPortHeight - bottom - item.height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(hasVerticalCenterPosition)\n\t\t\t{\n\t\t\t\tverticalCenterAnchorDisplayObject = layoutData.verticalCenterAnchorDisplayObject;\n\t\t\t\tif(verticalCenterAnchorDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tyPositionOfCenter = verticalCenterAnchorDisplayObject.y - verticalCenterAnchorDisplayObject.pivotY + Math.round(verticalCenterAnchorDisplayObject.height / 2) + verticalCenter;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tyPositionOfCenter = Math.round(viewPortHeight / 2) + verticalCenter;\n\t\t\t\t}\n\n\t\t\t\tif(hasTopPosition)\n\t\t\t\t{\n\t\t\t\t\titemHeight = 2 * (yPositionOfCenter - item.y + item.pivotY);\n\t\t\t\t\tif(uiItem.explicitMaxHeight === uiItem.explicitMaxHeight && //!isNaN\n\t\t\t\t\t\tuiItem.explicitMaxHeight < itemHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\titemHeight = uiItem.explicitMaxHeight;\n\t\t\t\t\t}\n\t\t\t\t\titem.height = itemHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\titem.y = item.pivotY + yPositionOfCenter - Math.round(item.height / 2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function measureContent(items:Vector.<DisplayObject>, viewPortWidth:Number, viewPortHeight:Number, result:Point = null):Point\n\t\t{\n\t\t\tvar maxX:Number = viewPortWidth;\n\t\t\tvar maxY:Number = viewPortHeight;\n\t\t\tvar itemCount:int = items.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\tvar itemMaxX:Number = item.x - item.pivotX + item.width;\n\t\t\t\tvar itemMaxY:Number = item.y - item.pivotY + item.height;\n\t\t\t\tif(itemMaxX === itemMaxX && //!isNaN\n\t\t\t\t\titemMaxX > maxX)\n\t\t\t\t{\n\t\t\t\t\tmaxX = itemMaxX;\n\t\t\t\t}\n\t\t\t\tif(itemMaxY === itemMaxY && //!isNaN\n\t\t\t\t\titemMaxY > maxY)\n\t\t\t\t{\n\t\t\t\t\tmaxY = itemMaxY;\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult.x = maxX;\n\t\t\tresult.y = maxY;\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function isReadyForLayout(layoutData:AnchorLayoutData, index:int, items:Vector.<DisplayObject>, unpositionedItems:Vector.<DisplayObject>):Boolean\n\t\t{\n\t\t\tvar nextIndex:int = index + 1;\n\t\t\tvar leftAnchorDisplayObject:DisplayObject = layoutData.leftAnchorDisplayObject;\n\t\t\tif(leftAnchorDisplayObject && (items.indexOf(leftAnchorDisplayObject, nextIndex) >= nextIndex || unpositionedItems.indexOf(leftAnchorDisplayObject) >= 0))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar rightAnchorDisplayObject:DisplayObject = layoutData.rightAnchorDisplayObject;\n\t\t\tif(rightAnchorDisplayObject && (items.indexOf(rightAnchorDisplayObject, nextIndex) >= nextIndex || unpositionedItems.indexOf(rightAnchorDisplayObject) >= 0))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar topAnchorDisplayObject:DisplayObject = layoutData.topAnchorDisplayObject;\n\t\t\tif(topAnchorDisplayObject && (items.indexOf(topAnchorDisplayObject, nextIndex) >= nextIndex || unpositionedItems.indexOf(topAnchorDisplayObject) >= 0))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar bottomAnchorDisplayObject:DisplayObject = layoutData.bottomAnchorDisplayObject;\n\t\t\tif(bottomAnchorDisplayObject && (items.indexOf(bottomAnchorDisplayObject, nextIndex) >= nextIndex || unpositionedItems.indexOf(bottomAnchorDisplayObject) >= 0))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar horizontalCenterAnchorDisplayObject:DisplayObject = layoutData.horizontalCenterAnchorDisplayObject;\n\t\t\tif(horizontalCenterAnchorDisplayObject && (items.indexOf(horizontalCenterAnchorDisplayObject, nextIndex) >= nextIndex || unpositionedItems.indexOf(horizontalCenterAnchorDisplayObject) >= 0))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar verticalCenterAnchorDisplayObject:DisplayObject = layoutData.verticalCenterAnchorDisplayObject;\n\t\t\tif(verticalCenterAnchorDisplayObject && (items.indexOf(verticalCenterAnchorDisplayObject, nextIndex) >= nextIndex || unpositionedItems.indexOf(verticalCenterAnchorDisplayObject) >= 0))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function isReferenced(item:DisplayObject, items:Vector.<DisplayObject>):Boolean\n\t\t{\n\t\t\tvar itemCount:int = items.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar otherItem:ILayoutDisplayObject = items[i] as ILayoutDisplayObject;\n\t\t\t\tif(!otherItem || otherItem == item)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tvar layoutData:AnchorLayoutData = otherItem.layoutData as AnchorLayoutData;\n\t\t\t\tif(!layoutData)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(layoutData.leftAnchorDisplayObject == item || layoutData.horizontalCenterAnchorDisplayObject == item ||\n\t\t\t\t\tlayoutData.rightAnchorDisplayObject == item || layoutData.topAnchorDisplayObject == item ||\n\t\t\t\t\tlayoutData.verticalCenterAnchorDisplayObject == item || layoutData.bottomAnchorDisplayObject == item)\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function validateItems(items:Vector.<DisplayObject>,\n\t\t\texplicitWidth:Number, explicitHeight:Number,\n\t\t\tmaxWidth:Number, maxHeight:Number, force:Boolean):void\n\t\t{\n\t\t\tvar needsWidth:Boolean = explicitWidth !== explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = explicitHeight !== explicitHeight; //isNaN\n\t\t\tvar containerWidth:Number = explicitWidth;\n\t\t\tif(needsWidth && maxWidth < Number.POSITIVE_INFINITY)\n\t\t\t{\n\t\t\t\tcontainerWidth = maxWidth;\n\t\t\t}\n\t\t\tvar containerHeight:Number = explicitHeight;\n\t\t\tif(needsHeight && maxHeight < Number.POSITIVE_INFINITY)\n\t\t\t{\n\t\t\t\tcontainerHeight = maxHeight;\n\t\t\t}\n\t\t\tvar itemCount:int = items.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\tif(item is ILayoutDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar layoutItem:ILayoutDisplayObject = ILayoutDisplayObject(item);\n\t\t\t\t\tif(!layoutItem.includeInLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tvar layoutData:AnchorLayoutData = layoutItem.layoutData as AnchorLayoutData;\n\t\t\t\t\tif(layoutData !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar left:Number = layoutData.left;\n\t\t\t\t\t\tvar hasLeftPosition:Boolean = left === left; //!isNaN\n\t\t\t\t\t\tvar leftAnchor:DisplayObject = layoutData.leftAnchorDisplayObject;\n\t\t\t\t\t\tvar right:Number = layoutData.right;\n\t\t\t\t\t\tvar rightAnchor:DisplayObject = layoutData.rightAnchorDisplayObject;\n\t\t\t\t\t\tvar hasRightPosition:Boolean = right === right; //!isNaN\n\t\t\t\t\t\tvar percentWidth:Number = layoutData.percentWidth;\n\t\t\t\t\t\tvar hasPercentWidth:Boolean = percentWidth === percentWidth; //!isNaN\n\t\t\t\t\t\tvar measureItem:IMeasureDisplayObject = IMeasureDisplayObject(item);\n\t\t\t\t\t\tif(needsWidth)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(hasLeftPosition && leftAnchor === null &&\n\t\t\t\t\t\t\t\thasRightPosition && rightAnchor === null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmeasureItem.width = NaN;\n\t\t\t\t\t\t\t\tmeasureItem.maxWidth = maxWidth - left - right;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if(hasPercentWidth)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(percentWidth < 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tpercentWidth = 0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if(percentWidth > 100)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tpercentWidth = 100;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmeasureItem.width = NaN;\n\t\t\t\t\t\t\t\tmeasureItem.maxWidth = percentWidth * 0.01 * maxWidth;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//optimization: set the child width before\n\t\t\t\t\t\t\t//validation if the container width is explicit\n\t\t\t\t\t\t\t//or has a maximum\n\t\t\t\t\t\t\tif(hasLeftPosition && leftAnchor === null &&\n\t\t\t\t\t\t\t\thasRightPosition && rightAnchor === null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar itemWidth:Number = containerWidth - left - right;\n\t\t\t\t\t\t\t\tif(measureItem.explicitMaxWidth === measureItem.explicitMaxWidth && //!isNaN\n\t\t\t\t\t\t\t\t\tmeasureItem.explicitMaxWidth < itemWidth)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\titemWidth = measureItem.explicitMaxWidth;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\titem.width = itemWidth;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if(hasPercentWidth)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(percentWidth < 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tpercentWidth = 0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if(percentWidth > 100)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tpercentWidth = 100;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\titemWidth = percentWidth * 0.01 * containerWidth;\n\t\t\t\t\t\t\t\tif(measureItem.explicitMaxWidth === measureItem.explicitMaxWidth && //!isNaN\n\t\t\t\t\t\t\t\t\tmeasureItem.explicitMaxWidth < itemWidth)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\titemWidth = measureItem.explicitMaxWidth;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\titem.width = itemWidth;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar horizontalCenter:Number = layoutData.horizontalCenter;\n\t\t\t\t\t\tvar hasHorizontalCenterPosition:Boolean = horizontalCenter === horizontalCenter; //!isNaN\n\n\t\t\t\t\t\tvar top:Number = layoutData.top;\n\t\t\t\t\t\tvar hasTopPosition:Boolean = top === top; //!isNaN\n\t\t\t\t\t\tvar topAnchor:DisplayObject = layoutData.topAnchorDisplayObject;\n\t\t\t\t\t\tvar bottom:Number = layoutData.bottom;\n\t\t\t\t\t\tvar hasBottomPosition:Boolean = bottom === bottom; //!isNaN\n\t\t\t\t\t\tvar bottomAnchor:DisplayObject = layoutData.bottomAnchorDisplayObject;\n\t\t\t\t\t\tvar percentHeight:Number = layoutData.percentHeight;\n\t\t\t\t\t\tvar hasPercentHeight:Boolean = percentHeight === percentHeight; //!isNaN\n\t\t\t\t\t\tif(!needsHeight)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//optimization: set the child height before\n\t\t\t\t\t\t\t//validation if the container height is explicit\n\t\t\t\t\t\t\t//or has a maximum.\n\t\t\t\t\t\t\tif(hasTopPosition && topAnchor === null &&\n\t\t\t\t\t\t\t\thasBottomPosition && bottomAnchor === null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar itemHeight:Number = containerHeight - top - bottom;\n\t\t\t\t\t\t\t\tif(measureItem.explicitMaxHeight === measureItem.explicitMaxHeight && //!isNaN\n\t\t\t\t\t\t\t\t\tmeasureItem.explicitMaxHeight < itemHeight)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\titemHeight = measureItem.explicitMaxHeight;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\titem.height = itemHeight;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if(hasPercentHeight)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(percentHeight < 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tpercentHeight = 0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if(percentHeight > 100)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tpercentHeight = 100;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\titemHeight = percentHeight * 0.01 * containerHeight;\n\t\t\t\t\t\t\t\tif(measureItem.explicitMaxHeight === measureItem.explicitMaxHeight && //!isNaN\n\t\t\t\t\t\t\t\t\tmeasureItem.explicitMaxHeight < itemHeight)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\titemHeight = measureItem.explicitMaxHeight;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\titem.height = itemHeight;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar verticalCenter:Number = layoutData.verticalCenter;\n\t\t\t\t\t\tvar hasVerticalCenterPosition:Boolean = verticalCenter === verticalCenter; //!isNaN\n\n\t\t\t\t\t\tif((hasRightPosition && !hasLeftPosition && !hasHorizontalCenterPosition) ||\n\t\t\t\t\t\t\thasHorizontalCenterPosition)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(item is IValidating)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tIValidating(item).validate();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if((hasBottomPosition && !hasTopPosition && !hasVerticalCenterPosition) ||\n\t\t\t\t\t\t\thasVerticalCenterPosition)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(item is IValidating)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tIValidating(item).validate();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(force || this.isReferenced(item, items))\n\t\t\t\t{\n\t\t\t\t\tif(item is IValidating)\n\t\t\t\t\t{\n\t\t\t\t\t\tIValidating(item).validate();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/AnchorLayoutData.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\n\t/**\n\t * @inheritDoc\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Extra, optional data used by an <code>AnchorLayout</code> instance to\n\t * position and size a display object.\n\t *\n\t * @see AnchorLayout\n\t * @see ILayoutDisplayObject\n\t *\n\t * @productversion Feathers 1.1.0\n\t */\n\tpublic class AnchorLayoutData extends EventDispatcher implements ILayoutData\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function AnchorLayoutData(top:Number = NaN, right:Number = NaN,\n\t\t\tbottom:Number = NaN, left:Number = NaN, horizontalCenter:Number = NaN,\n\t\t\tverticalCenter:Number = NaN)\n\t\t{\n\t\t\tthis.top = top;\n\t\t\tthis.right = right;\n\t\t\tthis.bottom = bottom;\n\t\t\tthis.left = left;\n\t\t\tthis.horizontalCenter = horizontalCenter;\n\t\t\tthis.verticalCenter = verticalCenter;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _percentWidth:Number = NaN;\n\n\t\t/**\n\t\t * The width of the layout object, as a percentage of the container's\n\t\t * width.\n\t\t *\n\t\t * <p>A percentage may be specified in the range from <code>0</code>\n\t\t * to <code>100</code>. If the value is set to <code>NaN</code>, this\n\t\t * property is ignored.</p>\n\t\t *\n\t\t * @default NaN\n\t\t */\n\t\tpublic function get percentWidth():Number\n\t\t{\n\t\t\treturn this._percentWidth;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set percentWidth(value:Number):void\n\t\t{\n\t\t\tif(this._percentWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._percentWidth = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _percentHeight:Number = NaN;\n\n\t\t/**\n\t\t * The height of the layout object, as a percentage of the container's\n\t\t * height.\n\t\t *\n\t\t * <p>A percentage may be specified in the range from <code>0</code>\n\t\t * to <code>100</code>. If the value is set to <code>NaN</code>, this\n\t\t * property is ignored.</p>\n\t\t *\n\t\t * @default NaN\n\t\t */\n\t\tpublic function get percentHeight():Number\n\t\t{\n\t\t\treturn this._percentHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set percentHeight(value:Number):void\n\t\t{\n\t\t\tif(this._percentHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._percentHeight = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _topAnchorDisplayObject:DisplayObject;\n\n\t\t/**\n\t\t * The top edge of the layout object will be relative to this anchor.\n\t\t * If there is no anchor, the top edge of the parent container will be\n\t\t * the anchor.\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #top\n\t\t */\n\t\tpublic function get topAnchorDisplayObject():DisplayObject\n\t\t{\n\t\t\treturn this._topAnchorDisplayObject;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set topAnchorDisplayObject(value:DisplayObject):void\n\t\t{\n\t\t\tif(this._topAnchorDisplayObject == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._topAnchorDisplayObject = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _top:Number = NaN;\n\n\t\t/**\n\t\t * The position, in pixels, of the top edge relative to the top\n\t\t * anchor, or, if there is no top anchor, then the position is relative\n\t\t * to the top edge of the parent container. If this value is\n\t\t * <code>NaN</code>, the object's top edge will not be anchored.\n\t\t *\n\t\t * @default NaN\n\t\t *\n\t\t * @see #topAnchorDisplayObject\n\t\t */\n\t\tpublic function get top():Number\n\t\t{\n\t\t\treturn this._top;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set top(value:Number):void\n\t\t{\n\t\t\tif(this._top == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._top = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _rightAnchorDisplayObject:DisplayObject;\n\n\t\t/**\n\t\t * The right edge of the layout object will be relative to this anchor.\n\t\t * If there is no anchor, the right edge of the parent container will be\n\t\t * the anchor.\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #right\n\t\t */\n\t\tpublic function get rightAnchorDisplayObject():DisplayObject\n\t\t{\n\t\t\treturn this._rightAnchorDisplayObject;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set rightAnchorDisplayObject(value:DisplayObject):void\n\t\t{\n\t\t\tif(this._rightAnchorDisplayObject == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._rightAnchorDisplayObject = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _right:Number = NaN;\n\n\t\t/**\n\t\t * The position, in pixels, of the right edge relative to the right\n\t\t * anchor, or, if there is no right anchor, then the position is relative\n\t\t * to the right edge of the parent container. If this value is\n\t\t * <code>NaN</code>, the object's right edge will not be anchored.\n\t\t *\n\t\t * @default NaN\n\t\t *\n\t\t * @see #rightAnchorDisplayObject\n\t\t */\n\t\tpublic function get right():Number\n\t\t{\n\t\t\treturn this._right;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set right(value:Number):void\n\t\t{\n\t\t\tif(this._right == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._right = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _bottomAnchorDisplayObject:DisplayObject;\n\n\t\t/**\n\t\t * The bottom edge of the layout object will be relative to this anchor.\n\t\t * If there is no anchor, the bottom edge of the parent container will be\n\t\t * the anchor.\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #bottom\n\t\t */\n\t\tpublic function get bottomAnchorDisplayObject():DisplayObject\n\t\t{\n\t\t\treturn this._bottomAnchorDisplayObject;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set bottomAnchorDisplayObject(value:DisplayObject):void\n\t\t{\n\t\t\tif(this._bottomAnchorDisplayObject == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._bottomAnchorDisplayObject = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _bottom:Number = NaN;\n\n\t\t/**\n\t\t * The position, in pixels, of the bottom edge relative to the bottom\n\t\t * anchor, or, if there is no bottom anchor, then the position is relative\n\t\t * to the bottom edge of the parent container. If this value is\n\t\t * <code>NaN</code>, the object's bottom edge will not be anchored.\n\t\t *\n\t\t * @default NaN\n\t\t *\n\t\t * @see #bottomAnchorDisplayObject\n\t\t */\n\t\tpublic function get bottom():Number\n\t\t{\n\t\t\treturn this._bottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set bottom(value:Number):void\n\t\t{\n\t\t\tif(this._bottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._bottom = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _leftAnchorDisplayObject:DisplayObject;\n\n\t\t/**\n\t\t * The left edge of the layout object will be relative to this anchor.\n\t\t * If there is no anchor, the left edge of the parent container will be\n\t\t * the anchor.\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #left\n\t\t */\n\t\tpublic function get leftAnchorDisplayObject():DisplayObject\n\t\t{\n\t\t\treturn this._leftAnchorDisplayObject;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set leftAnchorDisplayObject(value:DisplayObject):void\n\t\t{\n\t\t\tif(this._leftAnchorDisplayObject == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._leftAnchorDisplayObject = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _left:Number = NaN;\n\n\t\t/**\n\t\t * The position, in pixels, of the left edge relative to the left\n\t\t * anchor, or, if there is no left anchor, then the position is relative\n\t\t * to the left edge of the parent container. If this value is\n\t\t * <code>NaN</code>, the object's left edge will not be anchored.\n\t\t *\n\t\t * @default NaN\n\t\t *\n\t\t * @see #leftAnchorDisplayObject\n\t\t */\n\t\tpublic function get left():Number\n\t\t{\n\t\t\treturn this._left;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set left(value:Number):void\n\t\t{\n\t\t\tif(this._left == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._left = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalCenterAnchorDisplayObject:DisplayObject;\n\n\t\t/**\n\t\t * The horizontal center of the layout object will be relative to this\n\t\t * anchor. If there is no anchor, the horizontal center of the parent\n\t\t * container will be the anchor.\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #horizontalCenter\n\t\t */\n\t\tpublic function get horizontalCenterAnchorDisplayObject():DisplayObject\n\t\t{\n\t\t\treturn this._horizontalCenterAnchorDisplayObject;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalCenterAnchorDisplayObject(value:DisplayObject):void\n\t\t{\n\t\t\tif(this._horizontalCenterAnchorDisplayObject == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalCenterAnchorDisplayObject = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalCenter:Number = NaN;\n\n\t\t/**\n\t\t * The position, in pixels, of the horizontal center relative to the\n\t\t * horizontal center anchor, or, if there is no horizontal center\n\t\t * anchor, then the position is relative to the horizontal center of the\n\t\t * parent container. If this value is <code>NaN</code>, the object's\n\t\t * horizontal center will not be anchored.\n\t\t *\n\t\t * @default NaN\n\t\t *\n\t\t * @see #horizontalCenterAnchorDisplayObject\n\t\t */\n\t\tpublic function get horizontalCenter():Number\n\t\t{\n\t\t\treturn this._horizontalCenter;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalCenter(value:Number):void\n\t\t{\n\t\t\tif(this._horizontalCenter == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalCenter = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalCenterAnchorDisplayObject:DisplayObject;\n\n\t\t/**\n\t\t * The vertical center of the layout object will be relative to this\n\t\t * anchor. If there is no anchor, the vertical center of the parent\n\t\t * container will be the anchor.\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #verticalCenter\n\t\t */\n\t\tpublic function get verticalCenterAnchorDisplayObject():DisplayObject\n\t\t{\n\t\t\treturn this._verticalCenterAnchorDisplayObject;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalCenterAnchorDisplayObject(value:DisplayObject):void\n\t\t{\n\t\t\tif(this._verticalCenterAnchorDisplayObject == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalCenterAnchorDisplayObject = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalCenter:Number = NaN;\n\n\t\t/**\n\t\t * The position, in pixels, of the vertical center relative to the\n\t\t * vertical center anchor, or, if there is no vertical center anchor,\n\t\t * then the position is relative to the vertical center of the parent\n\t\t * container. If this value is <code>NaN</code>, the object's vertical\n\t\t * center will not be anchored.\n\t\t *\n\t\t * @default NaN\n\t\t *\n\t\t * @see #verticalCenterAnchorDisplayObject\n\t\t */\n\t\tpublic function get verticalCenter():Number\n\t\t{\n\t\t\treturn this._verticalCenter;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalCenter(value:Number):void\n\t\t{\n\t\t\tif(this._verticalCenter == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalCenter = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/BaseLinearLayout.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\timport starling.display.DisplayObject;\n\timport starling.errors.AbstractClassError;\n\timport starling.events.Event;\n\n\t/**\n\t * Abstract base class for <code>HorizontalLayout</code> and <code>VerticalLayout</code>.\n\t *\n\t * @productversion Feathers 3.3.0\n\t *\n\t * @see feathers.layout.HorizontalLayout\n\t * @see feathers.layout.VerticalLayout\n\t */\n\tpublic class BaseLinearLayout extends BaseVariableVirtualLayout\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function BaseLinearLayout()\n\t\t{\n\t\t\tsuper();\n\t\t\tif(Object(this).constructor == BaseLinearLayout)\n\t\t\t{\n\t\t\t\tthrow new AbstractClassError();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _discoveredItemsCache:Vector.<DisplayObject> = new <DisplayObject>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _gap:Number = 0;\n\n\t\t/**\n\t\t * The space, in pixels, between items.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get gap():Number\n\t\t{\n\t\t\treturn this._gap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set gap(value:Number):void\n\t\t{\n\t\t\tif(this._gap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._gap = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _firstGap:Number = NaN;\n\n\t\t/**\n\t\t * The space, in pixels, between the first and second items. If the\n\t\t * value of <code>firstGap</code> is <code>NaN</code>, the value of the\n\t\t * <code>gap</code> property will be used instead.\n\t\t *\n\t\t * @default NaN\n\t\t */\n\t\tpublic function get firstGap():Number\n\t\t{\n\t\t\treturn this._firstGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set firstGap(value:Number):void\n\t\t{\n\t\t\tif(this._firstGap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._firstGap = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastGap:Number = NaN;\n\n\t\t/**\n\t\t * The space, in pixels, between the last and second to last items. If\n\t\t * the value of <code>lastGap</code> is <code>NaN</code>, the value of\n\t\t * the <code>gap</code> property will be used instead.\n\t\t *\n\t\t * @default NaN\n\t\t */\n\t\tpublic function get lastGap():Number\n\t\t{\n\t\t\treturn this._lastGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set lastGap(value:Number):void\n\t\t{\n\t\t\tif(this._lastGap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._lastGap = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * Quickly sets all padding properties to the same value. The\n\t\t * <code>padding</code> getter always returns the value of\n\t\t * <code>paddingTop</code>, but the other padding values may be\n\t\t * different.\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #paddingTop\n\t\t * @see #paddingRight\n\t\t * @see #paddingBottom\n\t\t * @see #paddingLeft\n\t\t */\n\t\tpublic function get padding():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set padding(value:Number):void\n\t\t{\n\t\t\tthis.paddingTop = value;\n\t\t\tthis.paddingRight = value;\n\t\t\tthis.paddingBottom = value;\n\t\t\tthis.paddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingTop:Number = 0;\n\n\t\t/**\n\t\t * The space, in pixels, that appears on top.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingTop():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingTop(value:Number):void\n\t\t{\n\t\t\tif(this._paddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingTop = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingRight:Number = 0;\n\n\t\t/**\n\t\t * The minimum space, in pixels, to the right of the items.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingRight():Number\n\t\t{\n\t\t\treturn this._paddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this._paddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingRight = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingBottom:Number = 0;\n\n\t\t/**\n\t\t * The space, in pixels, that appears on the bottom.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingBottom():Number\n\t\t{\n\t\t\treturn this._paddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this._paddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingBottom = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingLeft:Number = 0;\n\n\t\t/**\n\t\t * The minimum space, in pixels, to the left of the items.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this._paddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingLeft = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalAlign:String = VerticalAlign.TOP;\n\n\t\t/**\n\t\t * The alignment of the items vertically, on the x-axis.\n\t\t *\n\t\t * <p><strong>Note:</strong> The <code>VerticalAlign.JUSTIFY</code>\n\t\t * constant is not supported by <code>VerticalLayout</code>. It may be\n\t\t * used with <code>HorizontalLayout</code> only.</p>\n\t\t *\n\t\t * @default feathers.layout.VerticalAlign.TOP\n\t\t *\n\t\t * @see feathers.layout.VerticalAlign#TOP\n\t\t * @see feathers.layout.VerticalAlign#MIDDLE\n\t\t * @see feathers.layout.VerticalAlign#BOTTOM\n\t\t * @see feathers.layout.VerticalAlign#JUSTIFY\n\t\t */\n\t\tpublic function get verticalAlign():String\n\t\t{\n\t\t\treturn this._verticalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalAlign(value:String):void\n\t\t{\n\t\t\tif(this._verticalAlign == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalAlign = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalAlign:String = HorizontalAlign.LEFT;\n\n\t\t/**\n\t\t * The alignment of the items horizontally, on the x-axis.\n\t\t *\n\t\t * <p><strong>Note:</strong> The <code>HorizontalAlign.JUSTIFY</code>\n\t\t * constant is not supported by <code>HorizontalLayout</code>. It may be\n\t\t * used with <code>VerticalLayout</code> only.</p>\n\t\t *\n\t\t * @default feathers.layout.HorizontalAlign.LEFT\n\t\t *\n\t\t * @see feathers.layout.HorizontalAlign#LEFT\n\t\t * @see feathers.layout.HorizontalAlign#CENTER\n\t\t * @see feathers.layout.HorizontalAlign#RIGHT\n\t\t * @see feathers.layout.HorizontalAlign#JUSTIFY\n\t\t */\n\t\tpublic function get horizontalAlign():String\n\t\t{\n\t\t\treturn this._horizontalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalAlign(value:String):void\n\t\t{\n\t\t\tif(this._horizontalAlign == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalAlign = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _beforeVirtualizedItemCount:int = 0;\n\n\t\t/**\n\t\t * @copy feathers.layout.ITrimmedLayout#beforeVirtualizedItemCount\n\t\t */\n\t\tpublic function get beforeVirtualizedItemCount():int\n\t\t{\n\t\t\treturn this._beforeVirtualizedItemCount;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set beforeVirtualizedItemCount(value:int):void\n\t\t{\n\t\t\tif(this._beforeVirtualizedItemCount == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._beforeVirtualizedItemCount = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _afterVirtualizedItemCount:int = 0;\n\n\t\t/**\n\t\t * @copy feathers.layout.ITrimmedLayout#afterVirtualizedItemCount\n\t\t */\n\t\tpublic function get afterVirtualizedItemCount():int\n\t\t{\n\t\t\treturn this._afterVirtualizedItemCount;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set afterVirtualizedItemCount(value:int):void\n\t\t{\n\t\t\tif(this._afterVirtualizedItemCount == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._afterVirtualizedItemCount = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _resetTypicalItemDimensionsOnMeasure:Boolean = false;\n\n\t\t/**\n\t\t * If set to <code>true</code>, the width and height of the\n\t\t * <code>typicalItem</code> will be reset to <code>typicalItemWidth</code>\n\t\t * and <code>typicalItemHeight</code>, respectively, whenever the\n\t\t * typical item needs to be measured. The measured dimensions of the\n\t\t * typical item are used to fill in the blanks of a virtualized layout\n\t\t * for virtual items that don't have their own display objects to\n\t\t * measure yet.\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see #typicalItemWidth\n\t\t * @see #typicalItemHeight\n\t\t * @see #typicalItem\n\t\t */\n\t\tpublic function get resetTypicalItemDimensionsOnMeasure():Boolean\n\t\t{\n\t\t\treturn this._resetTypicalItemDimensionsOnMeasure;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set resetTypicalItemDimensionsOnMeasure(value:Boolean):void\n\t\t{\n\t\t\tif(this._resetTypicalItemDimensionsOnMeasure == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._resetTypicalItemDimensionsOnMeasure = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _typicalItemWidth:Number = NaN;\n\n\t\t/**\n\t\t * Used to reset the width, in pixels, of the <code>typicalItem</code>\n\t\t * for measurement. The measured dimensions of the typical item are used\n\t\t * to fill in the blanks of a virtualized layout for virtual items that\n\t\t * don't have their own display objects to measure yet.\n\t\t *\n\t\t * <p>This value is only used when <code>resetTypicalItemDimensionsOnMeasure</code>\n\t\t * is set to <code>true</code>. If <code>resetTypicalItemDimensionsOnMeasure</code>\n\t\t * is set to <code>false</code>, this value will be ignored and the\n\t\t * <code>typicalItem</code> dimensions will not be reset before\n\t\t * measurement.</p>\n\t\t *\n\t\t * <p>If <code>typicalItemWidth</code> is set to <code>NaN</code>, the\n\t\t * typical item will auto-size itself to its preferred width. If you\n\t\t * pass a valid <code>Number</code> value, the typical item's width will\n\t\t * be set to a fixed size. May be used in combination with\n\t\t * <code>typicalItemHeight</code>.</p>\n\t\t *\n\t\t * @default NaN\n\t\t *\n\t\t * @see #resetTypicalItemDimensionsOnMeasure\n\t\t * @see #typicalItemHeight\n\t\t * @see #typicalItem\n\t\t */\n\t\tpublic function get typicalItemWidth():Number\n\t\t{\n\t\t\treturn this._typicalItemWidth;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set typicalItemWidth(value:Number):void\n\t\t{\n\t\t\tif(this._typicalItemWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._typicalItemWidth = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _typicalItemHeight:Number = NaN;\n\n\t\t/**\n\t\t * Used to reset the height, in pixels, of the <code>typicalItem</code>\n\t\t * for measurement. The measured dimensions of the typical item are used\n\t\t * to fill in the blanks of a virtualized layout for virtual items that\n\t\t * don't have their own display objects to measure yet.\n\t\t *\n\t\t * <p>This value is only used when <code>resetTypicalItemDimensionsOnMeasure</code>\n\t\t * is set to <code>true</code>. If <code>resetTypicalItemDimensionsOnMeasure</code>\n\t\t * is set to <code>false</code>, this value will be ignored and the\n\t\t * <code>typicalItem</code> dimensions will not be reset before\n\t\t * measurement.</p>\n\t\t *\n\t\t * <p>If <code>typicalItemHeight</code> is set to <code>NaN</code>, the\n\t\t * typical item will auto-size itself to its preferred height. If you\n\t\t * pass a valid <code>Number</code> value, the typical item's height will\n\t\t * be set to a fixed size. May be used in combination with\n\t\t * <code>typicalItemWidth</code>.</p>\n\t\t *\n\t\t * @default NaN\n\t\t *\n\t\t * @see #resetTypicalItemDimensionsOnMeasure\n\t\t * @see #typicalItemWidth\n\t\t * @see #typicalItem\n\t\t */\n\t\tpublic function get typicalItemHeight():Number\n\t\t{\n\t\t\treturn this._typicalItemHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set typicalItemHeight(value:Number):void\n\t\t{\n\t\t\tif(this._typicalItemHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._typicalItemHeight = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/BaseTiledLayout.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\timport feathers.layout.Direction;\n\n\timport starling.display.DisplayObject;\n\timport starling.errors.AbstractClassError;\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\n\t/**\n\t * Dispatched when a property of the layout changes, indicating that a\n\t * redraw is probably needed.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Abstract base class for <code>TiledRowsLayout</code> and <code>TiledColumnsLayout</code>.\n\t *\n\t * @productversion Feathers 3.3.0\n\t *\n\t * @see feathers.layout.TiledRowsLayout\n\t * @see feathers.layout.TiledColumnsLayout\n\t */\n\tpublic class BaseTiledLayout extends EventDispatcher\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function BaseTiledLayout()\n\t\t{\n\t\t\tsuper();\n\t\t\tif(Object(this).constructor == BaseTiledLayout)\n\t\t\t{\n\t\t\t\tthrow new AbstractClassError();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _discoveredItemsCache:Vector.<DisplayObject> = new <DisplayObject>[];\n\n\t\t/**\n\t\t * Quickly sets both <code>horizontalGap</code> and <code>verticalGap</code>\n\t\t * to the same value. The <code>gap</code> getter always returns the\n\t\t * value of <code>horizontalGap</code>, but the value of\n\t\t * <code>verticalGap</code> may be different.\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #horizontalGap\n\t\t * @see #verticalGap\n\t\t */\n\t\tpublic function get gap():Number\n\t\t{\n\t\t\treturn this._horizontalGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set gap(value:Number):void\n\t\t{\n\t\t\tthis.horizontalGap = value;\n\t\t\tthis.verticalGap = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalGap:Number = 0;\n\n\t\t/**\n\t\t * The horizontal space, in pixels, between tiles.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get horizontalGap():Number\n\t\t{\n\t\t\treturn this._horizontalGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalGap(value:Number):void\n\t\t{\n\t\t\tif(this._horizontalGap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalGap = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalGap:Number = 0;\n\n\t\t/**\n\t\t * The vertical space, in pixels, between tiles.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get verticalGap():Number\n\t\t{\n\t\t\treturn this._verticalGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalGap(value:Number):void\n\t\t{\n\t\t\tif(this._verticalGap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalGap = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * Quickly sets all padding properties to the same value. The\n\t\t * <code>padding</code> getter always returns the value of\n\t\t * <code>paddingTop</code>, but the other padding values may be\n\t\t * different.\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #paddingTop\n\t\t * @see #paddingRight\n\t\t * @see #paddingBottom\n\t\t * @see #paddingLeft\n\t\t */\n\t\tpublic function get padding():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set padding(value:Number):void\n\t\t{\n\t\t\tthis.paddingTop = value;\n\t\t\tthis.paddingRight = value;\n\t\t\tthis.paddingBottom = value;\n\t\t\tthis.paddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingTop:Number = 0;\n\n\t\t/**\n\t\t * The space, in pixels, above of items.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingTop():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingTop(value:Number):void\n\t\t{\n\t\t\tif(this._paddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingTop = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingRight:Number = 0;\n\n\t\t/**\n\t\t * The space, in pixels, to the right of the items.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingRight():Number\n\t\t{\n\t\t\treturn this._paddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this._paddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingRight = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingBottom:Number = 0;\n\n\t\t/**\n\t\t * The space, in pixels, below the items.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingBottom():Number\n\t\t{\n\t\t\treturn this._paddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this._paddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingBottom = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingLeft:Number = 0;\n\n\t\t/**\n\t\t * The space, in pixels, to the left of the items.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this._paddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingLeft = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _requestedColumnCount:int = 0;\n\n\t\t/**\n\t\t * Requests that the layout uses a specific number of columns in a row,\n\t\t * if possible. Set to <code>0</code> to calculate the maximum of\n\t\t * columns that will fit in the available space.\n\t\t *\n\t\t * <p>If the view port's explicit or maximum width is not large enough\n\t\t * to fit the requested number of columns, it will use fewer. If the\n\t\t * view port doesn't have an explicit width and the maximum width is\n\t\t * equal to <code>Number.POSITIVE_INFINITY</code>, the width will be\n\t\t * calculated automatically to fit the exact number of requested\n\t\t * columns.</p>\n\t\t *\n\t\t * <p>If paging is enabled, this value will be used to calculate the\n\t\t * number of columns in a page. If paging isn't enabled, this value will\n\t\t * be used to calculate a minimum number of columns, even if there\n\t\t * aren't enough items to fill each column.</p>\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get requestedColumnCount():int\n\t\t{\n\t\t\treturn this._requestedColumnCount;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set requestedColumnCount(value:int):void\n\t\t{\n\t\t\tif(value < 0)\n\t\t\t{\n\t\t\t\tthrow RangeError(\"requestedColumnCount requires a value >= 0\");\n\t\t\t}\n\t\t\tif(this._requestedColumnCount == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._requestedColumnCount = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _requestedRowCount:int = 0;\n\n\t\t/**\n\t\t * Requests that the layout uses a specific number of rows, if possible.\n\t\t * If the view port's explicit or maximum height is not large enough to\n\t\t * fit the requested number of rows, it will use fewer. Set to <code>0</code>\n\t\t * to calculate the number of rows automatically based on width and\n\t\t * height.\n\t\t *\n\t\t * <p>If paging is enabled, this value will be used to calculate the\n\t\t * number of rows in a page. If paging isn't enabled, this value will\n\t\t * be used to calculate a minimum number of rows, even if there aren't\n\t\t * enough items to fill each row.</p>\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get requestedRowCount():int\n\t\t{\n\t\t\treturn this._requestedRowCount;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set requestedRowCount(value:int):void\n\t\t{\n\t\t\tif(value < 0)\n\t\t\t{\n\t\t\t\tthrow RangeError(\"requestedRowCount requires a value >= 0\");\n\t\t\t}\n\t\t\tif(this._requestedRowCount == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._requestedRowCount = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalAlign:String = VerticalAlign.TOP;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"top,middle,bottom\")]\n\t\t/**\n\t\t * If the total column height is less than the bounds, the items in the\n\t\t * column can be aligned vertically.\n\t\t *\n\t\t * <p><strong>Note:</strong> VerticalAlign.JUSTIFY is not supported.\n\t\t * The <code>distributeHeights</code> property may be used to fill the\n\t\t * available space when the content is not large enough.</p>\n\t\t *\n\t\t * @default feathers.layout.VerticalAlign.TOP\n\t\t *\n\t\t * @see feathers.layout.VerticalAlign#TOP\n\t\t * @see feathers.layout.VerticalAlign#MIDDLE\n\t\t * @see feathers.layout.VerticalAlign#BOTTOM\n\t\t * @see #distributeHeights\n\t\t */\n\t\tpublic function get verticalAlign():String\n\t\t{\n\t\t\treturn this._verticalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalAlign(value:String):void\n\t\t{\n\t\t\tif(this._verticalAlign == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalAlign = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalAlign:String = HorizontalAlign.CENTER;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"left,center,right\")]\n\t\t/**\n\t\t * If the total row width is less than the bounds, the items in the row\n\t\t * can be aligned horizontally.\n\t\t *\n\t\t * <p><strong>Note:</strong> HorizontalAlign.JUSTIFY is not supported.\n\t\t * The <code>distributeWidths</code> property may be used to fill the\n\t\t * available space when the content is not large enough.</p>\n\t\t *\n\t\t * @default feathers.layout.HorizontalAlign.CENTER\n\t\t *\n\t\t * @see feathers.layout.HorizontalAlign#LEFT\n\t\t * @see feathers.layout.HorizontalAlign#CENTER\n\t\t * @see feathers.layout.HorizontalAlign#RIGHT\n\t\t * @see #distributeWidths\n\t\t */\n\t\tpublic function get horizontalAlign():String\n\t\t{\n\t\t\treturn this._horizontalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalAlign(value:String):void\n\t\t{\n\t\t\tif(this._horizontalAlign == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalAlign = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _tileVerticalAlign:String = VerticalAlign.MIDDLE;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"top,middle,bottom,justify\")]\n\t\t/**\n\t\t * If an item's height is less than the tile bounds, the position of the\n\t\t * item can be aligned vertically.\n\t\t *\n\t\t * @default feathers.layout.VerticalAlign.MIDDLE\n\t\t *\n\t\t * @see feathers.layout.VerticalAlign#TOP\n\t\t * @see feathers.layout.VerticalAlign#MIDDLE\n\t\t * @see feathers.layout.VerticalAlign#BOTTOM\n\t\t * @see feathers.layout.VerticalAlign#JUSTIFY\n\t\t */\n\t\tpublic function get tileVerticalAlign():String\n\t\t{\n\t\t\treturn this._tileVerticalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set tileVerticalAlign(value:String):void\n\t\t{\n\t\t\tif(this._tileVerticalAlign == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._tileVerticalAlign = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _tileHorizontalAlign:String = HorizontalAlign.CENTER;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"left,center,right,justify\")]\n\t\t/**\n\t\t * If the item's width is less than the tile bounds, the position of the\n\t\t * item can be aligned horizontally.\n\t\t *\n\t\t * @default feathers.layout.HorizontalAlign.CENTER\n\t\t *\n\t\t * @see feathers.layout.HorizontalAlign#LEFT\n\t\t * @see feathers.layout.HorizontalAlign#CENTER\n\t\t * @see feathers.layout.HorizontalAlign#RIGHT\n\t\t * @see feathers.layout.HorizontalAlign#JUSTIFY\n\t\t */\n\t\tpublic function get tileHorizontalAlign():String\n\t\t{\n\t\t\treturn this._tileHorizontalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set tileHorizontalAlign(value:String):void\n\t\t{\n\t\t\tif(this._tileHorizontalAlign == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._tileHorizontalAlign = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paging:String = Direction.NONE;\n\n\t\t/**\n\t\t * Indicates if tiles are divided into pages vertically or\n\t\t * horizontally, or if paging is disabled.\n\t\t *\n\t\t * @default feathers.layout.Direction.NONE\n\t\t *\n\t\t * @see feathers.layout.Direction#NONE\n\t\t * @see feathers.layout.Direction#HORIZONTAL\n\t\t * @see feathers.layout.Direction#VERTICAL\n\t\t */\n\t\tpublic function get paging():String\n\t\t{\n\t\t\treturn this._paging;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paging(value:String):void\n\t\t{\n\t\t\tif(this._paging == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paging = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _distributeWidths:Boolean = false;\n\n\t\t/**\n\t\t * If the total width of the tiles in a row (minus padding and gap)\n\t\t * does not fill the entire row, the remaining space will be distributed\n\t\t * to each tile equally.\n\t\t *\n\t\t * <p>If the container using the layout might resize, setting\n\t\t * <code>requestedColumnCount</code> is recommended because the tiles\n\t\t * will resize too, and their dimensions may not be reset.</p>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see #requestedColumnCount\n\t\t */\n\t\tpublic function get distributeWidths():Boolean\n\t\t{\n\t\t\treturn this._distributeWidths;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set distributeWidths(value:Boolean):void\n\t\t{\n\t\t\tif(this._distributeWidths === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._distributeWidths = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _distributeHeights:Boolean = false;\n\n\t\t/**\n\t\t * If the total height of the tiles in a column (minus padding and gap)\n\t\t * does not fill the entire column, the remaining space will be\n\t\t * distributed to each tile equally.\n\t\t *\n\t\t * <p>If the container using the layout might resize, setting\n\t\t * <code>requestedRowCount</code> is recommended because the tiles\n\t\t * will resize too, and their dimensions may not be reset.</p>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see #requestedRowCount\n\t\t * @see #useSquareTiles\n\t\t */\n\t\tpublic function get distributeHeights():Boolean\n\t\t{\n\t\t\treturn this._distributeHeights;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set distributeHeights(value:Boolean):void\n\t\t{\n\t\t\tif(this._distributeHeights === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._distributeHeights = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _useSquareTiles:Boolean = true;\n\n\t\t/**\n\t\t * Determines if the tiles must be square or if their width and height\n\t\t * may have different values.\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic function get useSquareTiles():Boolean\n\t\t{\n\t\t\treturn this._useSquareTiles;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set useSquareTiles(value:Boolean):void\n\t\t{\n\t\t\tif(this._useSquareTiles == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._useSquareTiles = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _useVirtualLayout:Boolean = true;\n\n\t\t/**\n\t\t * @copy feathers.layout.IVirtualLayout#useVirtualLayout\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic function get useVirtualLayout():Boolean\n\t\t{\n\t\t\treturn this._useVirtualLayout;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set useVirtualLayout(value:Boolean):void\n\t\t{\n\t\t\tif(this._useVirtualLayout == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._useVirtualLayout = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _typicalItem:DisplayObject;\n\n\t\t/**\n\t\t * @copy feathers.layout.IVirtualLayout#typicalItem\n\t\t */\n\t\tpublic function get typicalItem():DisplayObject\n\t\t{\n\t\t\treturn this._typicalItem;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set typicalItem(value:DisplayObject):void\n\t\t{\n\t\t\tif(this._typicalItem == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._typicalItem = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _resetTypicalItemDimensionsOnMeasure:Boolean = false;\n\n\t\t/**\n\t\t * If set to <code>true</code>, the width and height of the\n\t\t * <code>typicalItem</code> will be reset to <code>typicalItemWidth</code>\n\t\t * and <code>typicalItemHeight</code>, respectively, whenever the\n\t\t * typical item needs to be measured. The measured dimensions of the\n\t\t * typical item are used to fill in the blanks of a virtualized layout\n\t\t * for virtual items that don't have their own display objects to\n\t\t * measure yet.\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see #typicalItemWidth\n\t\t * @see #typicalItemHeight\n\t\t * @see #typicalItem\n\t\t */\n\t\tpublic function get resetTypicalItemDimensionsOnMeasure():Boolean\n\t\t{\n\t\t\treturn this._resetTypicalItemDimensionsOnMeasure;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set resetTypicalItemDimensionsOnMeasure(value:Boolean):void\n\t\t{\n\t\t\tif(this._resetTypicalItemDimensionsOnMeasure == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._resetTypicalItemDimensionsOnMeasure = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _typicalItemWidth:Number = NaN;\n\n\t\t/**\n\t\t * Used to reset the width, in pixels, of the <code>typicalItem</code>\n\t\t * for measurement. The measured dimensions of the typical item are used\n\t\t * to fill in the blanks of a virtualized layout for virtual items that\n\t\t * don't have their own display objects to measure yet.\n\t\t *\n\t\t * <p>This value is only used when <code>resetTypicalItemDimensionsOnMeasure</code>\n\t\t * is set to <code>true</code>. If <code>resetTypicalItemDimensionsOnMeasure</code>\n\t\t * is set to <code>false</code>, this value will be ignored and the\n\t\t * <code>typicalItem</code> dimensions will not be reset before\n\t\t * measurement.</p>\n\t\t *\n\t\t * <p>If <code>typicalItemWidth</code> is set to <code>NaN</code>, the\n\t\t * typical item will auto-size itself to its preferred width. If you\n\t\t * pass a valid <code>Number</code> value, the typical item's width will\n\t\t * be set to a fixed size. May be used in combination with\n\t\t * <code>typicalItemHeight</code>.</p>\n\t\t *\n\t\t * @default NaN\n\t\t *\n\t\t * @see #resetTypicalItemDimensionsOnMeasure\n\t\t * @see #typicalItemHeight\n\t\t * @see #typicalItem\n\t\t */\n\t\tpublic function get typicalItemWidth():Number\n\t\t{\n\t\t\treturn this._typicalItemWidth;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set typicalItemWidth(value:Number):void\n\t\t{\n\t\t\tif(this._typicalItemWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._typicalItemWidth = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _typicalItemHeight:Number = NaN;\n\n\t\t/**\n\t\t * Used to reset the height, in pixels, of the <code>typicalItem</code>\n\t\t * for measurement. The measured dimensions of the typical item are used\n\t\t * to fill in the blanks of a virtualized layout for virtual items that\n\t\t * don't have their own display objects to measure yet.\n\t\t *\n\t\t * <p>This value is only used when <code>resetTypicalItemDimensionsOnMeasure</code>\n\t\t * is set to <code>true</code>. If <code>resetTypicalItemDimensionsOnMeasure</code>\n\t\t * is set to <code>false</code>, this value will be ignored and the\n\t\t * <code>typicalItem</code> dimensions will not be reset before\n\t\t * measurement.</p>\n\t\t *\n\t\t * <p>If <code>typicalItemHeight</code> is set to <code>NaN</code>, the\n\t\t * typical item will auto-size itself to its preferred height. If you\n\t\t * pass a valid <code>Number</code> value, the typical item's height will\n\t\t * be set to a fixed size. May be used in combination with\n\t\t * <code>typicalItemWidth</code>.</p>\n\t\t *\n\t\t * @default NaN\n\t\t *\n\t\t * @see #resetTypicalItemDimensionsOnMeasure\n\t\t * @see #typicalItemWidth\n\t\t * @see #typicalItem\n\t\t */\n\t\tpublic function get typicalItemHeight():Number\n\t\t{\n\t\t\treturn this._typicalItemHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set typicalItemHeight(value:Number):void\n\t\t{\n\t\t\tif(this._typicalItemHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._typicalItemHeight = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.layout.ILayout#requiresLayoutOnScroll\n\t\t */\n\t\tpublic function get requiresLayoutOnScroll():Boolean\n\t\t{\n\t\t\treturn this._useVirtualLayout;\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/layout/BaseVariableVirtualLayout.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\timport starling.display.DisplayObject;\n\timport starling.errors.AbstractClassError;\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\n\t/**\n\t * Dispatched when a property of the layout changes, indicating that a\n\t * redraw is probably needed.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the layout would like to adjust the container's scroll\n\t * position. Typically, this is used when the virtual dimensions of an item\n\t * differ from its real dimensions. This event allows the container to\n\t * adjust scrolling so that it appears smooth, without jarring jumps or\n\t * shifts when an item resizes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>A <code>flash.geom.Point</code> object\n\t *   representing how much the scroll position should be adjusted in both\n\t *   horizontal and vertical directions. Measured in pixels.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.SCROLL\n\t */\n\t[Event(name=\"scroll\",type=\"starling.events.Event\")]\n\n\tpublic class BaseVariableVirtualLayout extends EventDispatcher\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function BaseVariableVirtualLayout()\n\t\t{\n\t\t\tsuper();\n\t\t\tif(Object(this).constructor === BaseLinearLayout)\n\t\t\t{\n\t\t\t\tthrow new AbstractClassError();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _virtualCache:Array = [];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _useVirtualLayout:Boolean = true;\n\n\t\t/**\n\t\t * @copy feathers.layout.IVirtualLayout#useVirtualLayout\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic function get useVirtualLayout():Boolean\n\t\t{\n\t\t\treturn this._useVirtualLayout;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set useVirtualLayout(value:Boolean):void\n\t\t{\n\t\t\tif(this._useVirtualLayout == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._useVirtualLayout = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _typicalItem:DisplayObject;\n\n\t\t/**\n\t\t * @copy feathers.layout.IVirtualLayout#typicalItem\n\t\t *\n\t\t * @see #resetTypicalItemDimensionsOnMeasure\n\t\t * @see #typicalItemWidth\n\t\t * @see #typicalItemHeight\n\t\t */\n\t\tpublic function get typicalItem():DisplayObject\n\t\t{\n\t\t\treturn this._typicalItem;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set typicalItem(value:DisplayObject):void\n\t\t{\n\t\t\tif(this._typicalItem == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._typicalItem = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _hasVariableItemDimensions:Boolean = false;\n\n\t\t/**\n\t\t * When the layout is virtualized, and this value is true, the items\n\t\t * may have variable dimensions. If false, the items will all share\n\t\t * the same dimensions with the typical item.\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic function get hasVariableItemDimensions():Boolean\n\t\t{\n\t\t\treturn this._hasVariableItemDimensions;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set hasVariableItemDimensions(value:Boolean):void\n\t\t{\n\t\t\tif(this._hasVariableItemDimensions == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._hasVariableItemDimensions = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.layout.ILayout#requiresLayoutOnScroll\n\t\t */\n\t\tpublic function get requiresLayoutOnScroll():Boolean\n\t\t{\n\t\t\treturn this._useVirtualLayout;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.layout.IVariableVirtualLayout#resetVariableVirtualCache()\n\t\t */\n\t\tpublic function resetVariableVirtualCache():void\n\t\t{\n\t\t\tthis._virtualCache.length = 0;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.layout.IVariableVirtualLayout#resetVariableVirtualCacheAtIndex()\n\t\t */\n\t\tpublic function resetVariableVirtualCacheAtIndex(index:int, item:DisplayObject = null):void\n\t\t{\n\t\t\tdelete this._virtualCache[index];\n\t\t\tif(item)\n\t\t\t{\n\t\t\t\tthis._virtualCache[index] = item.height;\n\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.layout.IVariableVirtualLayout#addToVariableVirtualCacheAtIndex()\n\t\t */\n\t\tpublic function addToVariableVirtualCacheAtIndex(index:int, item:DisplayObject = null):void\n\t\t{\n\t\t\tvar heightValue:* = item ? item.height : undefined;\n\t\t\tthis._virtualCache.insertAt(index, heightValue);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.layout.IVariableVirtualLayout#removeFromVariableVirtualCacheAtIndex()\n\t\t */\n\t\tpublic function removeFromVariableVirtualCacheAtIndex(index:int):void\n\t\t{\n\t\t\tthis._virtualCache.removeAt(index);\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/layout/Direction.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\t/**\n\t * Constants that define a direction.\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class Direction\n\t{\n\t\t/**\n\t\t * The object will be oriented vertically.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const VERTICAL:String = \"vertical\";\n\n\t\t/**\n\t\t * The object will be oriented horizontally.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const HORIZONTAL:String = \"horizontal\";\n\n\t\t/**\n\t\t * The object will be oriented in no particular direction.\n\t\t *\n\t\t * @productversion Feathers 3.3.0\n\t\t */\n\t\tpublic static const NONE:String = \"none\";\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/FlowLayout.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\timport feathers.core.IValidating;\n\n\timport flash.errors.IllegalOperationError;\n\timport flash.geom.Point;\n\timport flash.ui.Keyboard;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t/**\n\t * Dispatched when a property of the layout changes, indicating that a\n\t * redraw is probably needed.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Positions items of different dimensions from left to right in multiple\n\t * rows. When the width of a row reaches the width of the container, a new\n\t * row will be started. Constrained to the suggested width, the flow layout\n\t * will change in height as the number of items increases or decreases.\n\t *\n\t * @see ../../../help/flow-layout.html How to use FlowLayout with Feathers containers\n\t *\n\t * @productversion Feathers 2.2.0\n\t */\n\tpublic class FlowLayout extends BaseVariableVirtualLayout implements IVariableVirtualLayout, IDragDropLayout\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function FlowLayout()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis._hasVariableItemDimensions = true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _rowItems:Vector.<DisplayObject> = new <DisplayObject>[];\n\n\t\t/**\n\t\t * Quickly sets both <code>horizontalGap</code> and <code>verticalGap</code>\n\t\t * to the same value. The <code>gap</code> getter always returns the\n\t\t * value of <code>horizontalGap</code>, but the value of\n\t\t * <code>verticalGap</code> may be different.\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #horizontalGap\n\t\t * @see #verticalGap\n\t\t */\n\t\tpublic function get gap():Number\n\t\t{\n\t\t\treturn this._horizontalGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set gap(value:Number):void\n\t\t{\n\t\t\tthis.horizontalGap = value;\n\t\t\tthis.verticalGap = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalGap:Number = 0;\n\n\t\t/**\n\t\t * The horizontal space, in pixels, between items.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get horizontalGap():Number\n\t\t{\n\t\t\treturn this._horizontalGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalGap(value:Number):void\n\t\t{\n\t\t\tif(this._horizontalGap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalGap = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalGap:Number = 0;\n\n\t\t/**\n\t\t * The vertical space, in pixels, between items.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get verticalGap():Number\n\t\t{\n\t\t\treturn this._verticalGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalGap(value:Number):void\n\t\t{\n\t\t\tif(this._verticalGap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalGap = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _firstHorizontalGap:Number = NaN;\n\n\t\t/**\n\t\t * The space, in pixels, between the first and second items. If the\n\t\t * value of <code>firstHorizontalGap</code> is <code>NaN</code>, the\n\t\t * value of the <code>horizontalGap</code> property will be used\n\t\t * instead.\n\t\t *\n\t\t * @default NaN\n\t\t *\n\t\t * @see #gap\n\t\t */\n\t\tpublic function get firstHorizontalGap():Number\n\t\t{\n\t\t\treturn this._firstHorizontalGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set firstHorizontalGap(value:Number):void\n\t\t{\n\t\t\tif(this._firstHorizontalGap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._firstHorizontalGap = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _lastHorizontalGap:Number = NaN;\n\n\t\t/**\n\t\t * The space, in pixels, between the last and second to last items. If\n\t\t * the value of <code>lastHorizontalGap</code> is <code>NaN</code>, the\n\t\t * value of the <code>horizontalGap</code> property will be used instead.\n\t\t *\n\t\t * @default NaN\n\t\t *\n\t\t * @see #gap\n\t\t */\n\t\tpublic function get lastHorizontalGap():Number\n\t\t{\n\t\t\treturn this._lastHorizontalGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set lastHorizontalGap(value:Number):void\n\t\t{\n\t\t\tif(this._lastHorizontalGap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._lastHorizontalGap = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * Quickly sets all padding properties to the same value. The\n\t\t * <code>padding</code> getter always returns the value of\n\t\t * <code>paddingTop</code>, but the other padding values may be\n\t\t * different.\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #paddingTop\n\t\t * @see #paddingRight\n\t\t * @see #paddingBottom\n\t\t * @see #paddingLeft\n\t\t */\n\t\tpublic function get padding():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set padding(value:Number):void\n\t\t{\n\t\t\tthis.paddingTop = value;\n\t\t\tthis.paddingRight = value;\n\t\t\tthis.paddingBottom = value;\n\t\t\tthis.paddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingTop:Number = 0;\n\n\t\t/**\n\t\t * The space, in pixels, above of items.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingTop():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingTop(value:Number):void\n\t\t{\n\t\t\tif(this._paddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingTop = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingRight:Number = 0;\n\n\t\t/**\n\t\t * The space, in pixels, to the right of the items.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingRight():Number\n\t\t{\n\t\t\treturn this._paddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this._paddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingRight = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingBottom:Number = 0;\n\n\t\t/**\n\t\t * The space, in pixels, below the items.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingBottom():Number\n\t\t{\n\t\t\treturn this._paddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this._paddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingBottom = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingLeft:Number = 0;\n\n\t\t/**\n\t\t * The space, in pixels, to the left of the items.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this._paddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingLeft = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalAlign:String = HorizontalAlign.LEFT;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"left,center,right\")]\n\t\t/**\n\t\t * If the total row width is less than the bounds, the items in the row\n\t\t * can be aligned horizontally.\n\t\t *\n\t\t * <p><strong>Note:</strong> The <code>HorizontalAlign.JUSTIFY</code>\n\t\t * constant is not supported.</p>\n\t\t *\n\t\t * @default feathers.layout.HorizontalAlign.LEFT\n\t\t *\n\t\t * @see feathers.layout.HorizontalAlign#LEFT\n\t\t * @see feathers.layout.HorizontalAlign#CENTER\n\t\t * @see feathers.layout.HorizontalAlign#RIGHT\n\t\t * @see #verticalAlign\n\t\t * @see #rowVerticalAlign\n\t\t */\n\t\tpublic function get horizontalAlign():String\n\t\t{\n\t\t\treturn this._horizontalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalAlign(value:String):void\n\t\t{\n\t\t\tif(this._horizontalAlign == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalAlign = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalAlign:String = VerticalAlign.TOP;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"top,middle,bottom\")]\n\t\t/**\n\t\t * If the total height of the content is less than the bounds, the\n\t\t * content may be aligned vertically.\n\t\t *\n\t\t * <p><strong>Note:</strong> The <code>VerticalAlign.JUSTIFY</code>\n\t\t * constant is not supported.</p>\n\t\t *\n\t\t * @default feathers.layout.VerticalAlign.TOP\n\t\t *\n\t\t * @see feathers.layout.VerticalAlign#TOP\n\t\t * @see feathers.layout.VerticalAlign#MIDDLE\n\t\t * @see feathers.layout.VerticalAlign#BOTTOM\n\t\t * @see #horizontalAlign\n\t\t * @see #rowVerticalAlign\n\t\t */\n\t\tpublic function get verticalAlign():String\n\t\t{\n\t\t\treturn this._verticalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalAlign(value:String):void\n\t\t{\n\t\t\tif(this._verticalAlign == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalAlign = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _rowVerticalAlign:String = VerticalAlign.TOP;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"top,middle,bottom\")]\n\t\t/**\n\t\t * If the height of an item is less than the height of a row, it can be\n\t\t * aligned vertically.\n\t\t *\n\t\t * @default feathers.layout.VerticalAlign.TOP\n\t\t *\n\t\t * @see feathers.layout.VerticalAlign#TOP\n\t\t * @see feathers.layout.VerticalAlign#MIDDLE\n\t\t * @see feathers.layout.VerticalAlign#BOTTOM\n\t\t * @see #horizontalAlign\n\t\t * @see #verticalAlign\n\t\t */\n\t\tpublic function get rowVerticalAlign():String\n\t\t{\n\t\t\treturn this._rowVerticalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set rowVerticalAlign(value:String):void\n\t\t{\n\t\t\tif(this._rowVerticalAlign == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._rowVerticalAlign = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _widthCache:Array = [];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _heightCache:Array = [];\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function layout(items:Vector.<DisplayObject>, viewPortBounds:ViewPortBounds = null, result:LayoutBoundsResult = null):LayoutBoundsResult\n\t\t{\n\t\t\t//this function is very long because it may be called every frame,\n\t\t\t//in some situations. testing revealed that splitting this function\n\t\t\t//into separate, smaller functions affected performance.\n\t\t\t//since the SWC compiler cannot inline functions, we can't use that\n\t\t\t//feature either.\n\n\t\t\t//since viewPortBounds can be null, we may need to provide some defaults\n\t\t\tvar boundsX:Number = viewPortBounds ? viewPortBounds.x : 0;\n\t\t\tvar boundsY:Number = viewPortBounds ? viewPortBounds.y : 0;\n\t\t\tvar minWidth:Number = viewPortBounds ? viewPortBounds.minWidth : 0;\n\t\t\tvar minHeight:Number = viewPortBounds ? viewPortBounds.minHeight : 0;\n\t\t\tvar maxWidth:Number = viewPortBounds ? viewPortBounds.maxWidth : Number.POSITIVE_INFINITY;\n\t\t\tvar maxHeight:Number = viewPortBounds ? viewPortBounds.maxHeight : Number.POSITIVE_INFINITY;\n\t\t\tvar explicitWidth:Number = viewPortBounds ? viewPortBounds.explicitWidth : NaN;\n\t\t\tvar explicitHeight:Number = viewPortBounds ? viewPortBounds.explicitHeight : NaN;\n\n\t\t\tvar needsWidth:Boolean = explicitWidth !== explicitWidth; //isNaN\n\t\t\t//let's figure out if we can show multiple rows\n\t\t\tvar supportsMultipleRows:Boolean = true;\n\t\t\tvar availableRowWidth:Number = explicitWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tavailableRowWidth = maxWidth;\n\t\t\t\tif(availableRowWidth == Number.POSITIVE_INFINITY)\n\t\t\t\t{\n\t\t\t\t\tsupportsMultipleRows = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\t//if the layout is virtualized, we'll need the dimensions of the\n\t\t\t\t//typical item so that we have fallback values when an item is null\n\t\t\t\tif(this._typicalItem is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this._typicalItem).validate();\n\t\t\t\t}\n\t\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\t\t\t}\n\n\t\t\tvar i:int = 0;\n\t\t\tvar itemCount:int = items.length;\n\t\t\tvar positionY:Number = boundsY + this._paddingTop;\n\t\t\tvar maxRowWidth:Number = 0;\n\t\t\tvar maxItemHeight:Number = 0;\n\t\t\tvar verticalGap:Number = this._verticalGap;\n\t\t\tvar hasFirstHorizontalGap:Boolean = this._firstHorizontalGap === this._firstHorizontalGap; //!isNaN\n\t\t\tvar hasLastHorizontalGap:Boolean = this._lastHorizontalGap === this._lastHorizontalGap; //!isNaN\n\t\t\tvar secondToLastIndex:int = itemCount - 2;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tif(i > 0)\n\t\t\t\t{\n\t\t\t\t\tpositionY += maxItemHeight + verticalGap;\n\t\t\t\t}\n\t\t\t\t//this section prepares some variables needed for the following loop\n\t\t\t\tmaxItemHeight = this._useVirtualLayout ? calculatedTypicalItemHeight : 0;\n\t\t\t\tvar positionX:Number = boundsX + this._paddingLeft;\n\t\t\t\t//we save the items in this row to align them later.\n\t\t\t\tthis._rowItems.length = 0;\n\t\t\t\tvar rowItemCount:int = 0;\n\n\t\t\t\t//if there are no items in the row (such as when there are no\n\t\t\t\t//items in the container!), then we don't want to subtract the\n\t\t\t\t//gap when calculating the row width, so default to 0.\n\t\t\t\tvar horizontalGap:Number = 0;\n\n\t\t\t\t//this first loop sets the x position of items, and it calculates\n\t\t\t\t//the total width of all items\n\t\t\t\tfor(; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\t\thorizontalGap = this._horizontalGap;\n\t\t\t\t\tif(hasFirstHorizontalGap && i == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\thorizontalGap = this._firstHorizontalGap;\n\t\t\t\t\t}\n\t\t\t\t\telse if(hasLastHorizontalGap && i > 0 && i == secondToLastIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\thorizontalGap = this._lastHorizontalGap;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(this._useVirtualLayout && this._hasVariableItemDimensions)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar cachedWidth:Number = this._widthCache[i];\n\t\t\t\t\t\tvar cachedHeight:Number = this._heightCache[i];\n\t\t\t\t\t}\n\t\t\t\t\tif(this._useVirtualLayout && !item)\n\t\t\t\t\t{\n\t\t\t\t\t\t//the item is null, and the layout is virtualized, so we\n\t\t\t\t\t\t//need to estimate the width of the item.\n\n\t\t\t\t\t\tif(this._hasVariableItemDimensions)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(cachedWidth !== cachedWidth) //isNaN\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar itemWidth:Number = calculatedTypicalItemWidth;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\titemWidth = cachedWidth;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(cachedHeight !== cachedHeight) //isNaN\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar itemHeight:Number = calculatedTypicalItemHeight;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\titemHeight = cachedHeight;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titemWidth = calculatedTypicalItemWidth;\n\t\t\t\t\t\t\titemHeight = calculatedTypicalItemHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//we get here if the item isn't null. it is never null if\n\t\t\t\t\t\t//the layout isn't virtualized.\n\t\t\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(item is IValidating)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tIValidating(item).validate();\n\t\t\t\t\t\t}\n\t\t\t\t\t\titemWidth = item.width;\n\t\t\t\t\t\titemHeight = item.height;\n\t\t\t\t\t\tif(this._useVirtualLayout)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(this._hasVariableItemDimensions)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(itemWidth != cachedWidth)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//update the cache if needed. this will notify\n\t\t\t\t\t\t\t\t\t//the container that the virtualized layout has\n\t\t\t\t\t\t\t\t\t//changed, and it the view port may need to be\n\t\t\t\t\t\t\t\t\t//re-measured.\n\t\t\t\t\t\t\t\t\tthis._widthCache[i] = itemWidth;\n\t\t\t\t\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(itemHeight != cachedHeight)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tthis._heightCache[i] = itemHeight;\n\t\t\t\t\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(calculatedTypicalItemWidth >= 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\titem.width = itemWidth = calculatedTypicalItemWidth;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(calculatedTypicalItemHeight >= 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\titem.height = itemHeight = calculatedTypicalItemHeight;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(supportsMultipleRows && rowItemCount > 0 && (positionX + itemWidth) > (availableRowWidth - this._paddingRight))\n\t\t\t\t\t{\n\t\t\t\t\t\t//we need to restore the previous gap because it will be\n\t\t\t\t\t\t//subtracted from the x position to get the row width.\n\t\t\t\t\t\tvar previousIndex:int = i - 1;\n\t\t\t\t\t\thorizontalGap = this._horizontalGap;\n\t\t\t\t\t\tif(hasFirstHorizontalGap && previousIndex == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thorizontalGap = this._firstHorizontalGap;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(hasLastHorizontalGap && previousIndex > 0 && previousIndex == secondToLastIndex)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thorizontalGap = this._lastHorizontalGap;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//we've reached the end of the row, so go to next\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif(item)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._rowItems[this._rowItems.length] = item;\n\t\t\t\t\t\titem.x = item.pivotX + positionX;\n\t\t\t\t\t}\n\t\t\t\t\tpositionX += itemWidth + horizontalGap;\n\t\t\t\t\t//we compare with > instead of Math.max() because the rest\n\t\t\t\t\t//arguments on Math.max() cause extra garbage collection and\n\t\t\t\t\t//hurt performance\n\t\t\t\t\tif(itemHeight > maxItemHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\t//we need to know the maximum height of the items in the\n\t\t\t\t\t\t//case where the height of the view port needs to be\n\t\t\t\t\t\t//calculated by the layout.\n\t\t\t\t\t\tmaxItemHeight = itemHeight;\n\t\t\t\t\t}\n\t\t\t\t\trowItemCount++;\n\t\t\t\t}\n\n\t\t\t\t//this is the total width of all items in the row\n\t\t\t\tvar totalRowWidth:Number = positionX - horizontalGap + this._paddingRight - boundsX;\n\t\t\t\tif(totalRowWidth > maxRowWidth)\n\t\t\t\t{\n\t\t\t\t\tmaxRowWidth = totalRowWidth;\n\t\t\t\t}\n\t\t\t\trowItemCount = this._rowItems.length;\n\n\t\t\t\tif(supportsMultipleRows)\n\t\t\t\t{\n\t\t\t\t\t//in this section, we handle horizontal alignment for the\n\t\t\t\t\t//current row. however, we may need to adjust it later if\n\t\t\t\t\t//the maxRowWidth is smaller than the availableRowWidth.\n\t\t\t\t\tvar horizontalAlignOffsetX:Number = 0;\n\t\t\t\t\tif(this._horizontalAlign === HorizontalAlign.RIGHT)\n\t\t\t\t\t{\n\t\t\t\t\t\thorizontalAlignOffsetX = availableRowWidth - totalRowWidth;\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._horizontalAlign === HorizontalAlign.CENTER)\n\t\t\t\t\t{\n\t\t\t\t\t\thorizontalAlignOffsetX = Math.round((availableRowWidth - totalRowWidth) / 2);\n\t\t\t\t\t}\n\t\t\t\t\tif(horizontalAlignOffsetX != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor(var j:int = 0; j < rowItemCount; j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem = this._rowItems[j];\n\t\t\t\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\titem.x += horizontalAlignOffsetX;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor(j = 0; j < rowItemCount; j++)\n\t\t\t\t{\n\t\t\t\t\titem = this._rowItems[j];\n\t\t\t\t\tvar layoutItem:ILayoutDisplayObject = item as ILayoutDisplayObject;\n\t\t\t\t\tif(layoutItem && !layoutItem.includeInLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t//handle all other vertical alignment values. the y position\n\t\t\t\t\t//of all items is set here.\n\t\t\t\t\tswitch(this._rowVerticalAlign)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase VerticalAlign.BOTTOM:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.y = item.pivotY + positionY + maxItemHeight - item.height;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase VerticalAlign.MIDDLE:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//round to the nearest pixel when dividing by 2 to\n\t\t\t\t\t\t\t//align in the middle\n\t\t\t\t\t\t\titem.y = item.pivotY + positionY + Math.round((maxItemHeight - item.height) / 2);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdefault: //top\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.y = item.pivotY + positionY;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile(i < itemCount);\n\t\t\t//we don't want to keep a reference to any of the items, so clear\n\t\t\t//this cache\n\t\t\tthis._rowItems.length = 0;\n\n\t\t\tif(supportsMultipleRows && (needsWidth || explicitWidth < maxRowWidth))\n\t\t\t{\n\t\t\t\t//if the maxRowWidth has changed since any row was aligned, the\n\t\t\t\t//items in those rows may need to be shifted a bit\n\t\t\t\tvar contentRowWidth:Number = maxRowWidth;\n\t\t\t\tif(contentRowWidth < minWidth)\n\t\t\t\t{\n\t\t\t\t\tcontentRowWidth = minWidth;\n\t\t\t\t}\n\t\t\t\telse if(contentRowWidth > maxWidth)\n\t\t\t\t{\n\t\t\t\t\tcontentRowWidth = maxWidth;\n\t\t\t\t}\n\t\t\t\thorizontalAlignOffsetX = 0;\n\t\t\t\tif(this._horizontalAlign === HorizontalAlign.RIGHT)\n\t\t\t\t{\n\t\t\t\t\thorizontalAlignOffsetX = availableRowWidth - contentRowWidth;\n\t\t\t\t}\n\t\t\t\telse if(this._horizontalAlign === HorizontalAlign.CENTER)\n\t\t\t\t{\n\t\t\t\t\thorizontalAlignOffsetX = Math.round((availableRowWidth - contentRowWidth) / 2);\n\t\t\t\t}\n\t\t\t\tif(horizontalAlignOffsetX != 0)\n\t\t\t\t{\n\t\t\t\t\tfor(i = 0; i < itemCount; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\titem = items[i];\n\t\t\t\t\t\tif(!item || (item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//previously, we used the maxWidth for alignment,\n\t\t\t\t\t\t//but the max row width may be smaller, so we need\n\t\t\t\t\t\t//to account for the difference\n\t\t\t\t\t\titem.x -= horizontalAlignOffsetX;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcontentRowWidth = maxRowWidth;\n\t\t\t}\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tavailableRowWidth = contentRowWidth;\n\t\t\t}\n\n\t\t\tvar totalHeight:Number = positionY + maxItemHeight + this._paddingBottom;\n\t\t\t//the available height is the height of the viewport. if the explicit\n\t\t\t//height is NaN, we need to calculate the viewport height ourselves\n\t\t\t//based on the total height of all items.\n\t\t\tvar availableHeight:Number = explicitHeight;\n\t\t\tif(availableHeight !== availableHeight) //isNaN\n\t\t\t{\n\t\t\t\tavailableHeight = totalHeight;\n\t\t\t\tif(availableHeight < minHeight)\n\t\t\t\t{\n\t\t\t\t\tavailableHeight = minHeight;\n\t\t\t\t}\n\t\t\t\telse if(availableHeight > maxHeight)\n\t\t\t\t{\n\t\t\t\t\tavailableHeight = maxHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(totalHeight < availableHeight &&\n\t\t\t\tthis._verticalAlign != VerticalAlign.TOP)\n\t\t\t{\n\t\t\t\tvar verticalAlignOffset:Number = availableHeight - totalHeight;\n\t\t\t\tif(this._verticalAlign === VerticalAlign.MIDDLE)\n\t\t\t\t{\n\t\t\t\t\tverticalAlignOffset /= 2;\n\t\t\t\t}\n\t\t\t\tfor(i = 0; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\titem = items[i];\n\t\t\t\t\tif(!item || (item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\titem.y += verticalAlignOffset;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//finally, we want to calculate the result so that the container\n\t\t\t//can use it to adjust its viewport and determine the minimum and\n\t\t\t//maximum scroll positions (if needed)\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new LayoutBoundsResult();\n\t\t\t}\n\t\t\tresult.contentX = 0;\n\t\t\tresult.contentWidth = maxRowWidth;\n\t\t\tresult.contentY = 0;\n\t\t\tresult.contentHeight = totalHeight;\n\t\t\tresult.viewPortWidth = availableRowWidth;\n\t\t\tresult.viewPortHeight = availableHeight;\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function measureViewPort(itemCount:int, viewPortBounds:ViewPortBounds = null, result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\t\t\tif(!this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"measureViewPort() may be called only if useVirtualLayout is true.\");\n\t\t\t}\n\t\t\t//this function is very long because it may be called every frame,\n\t\t\t//in some situations. testing revealed that splitting this function\n\t\t\t//into separate, smaller functions affected performance.\n\t\t\t//since the SWC compiler cannot inline functions, we can't use that\n\t\t\t//feature either.\n\n\t\t\t//since viewPortBounds can be null, we may need to provide some defaults\n\t\t\tvar boundsX:Number = viewPortBounds ? viewPortBounds.x : 0;\n\t\t\tvar boundsY:Number = viewPortBounds ? viewPortBounds.y : 0;\n\t\t\tvar minWidth:Number = viewPortBounds ? viewPortBounds.minWidth : 0;\n\t\t\tvar minHeight:Number = viewPortBounds ? viewPortBounds.minHeight : 0;\n\t\t\tvar maxWidth:Number = viewPortBounds ? viewPortBounds.maxWidth : Number.POSITIVE_INFINITY;\n\t\t\tvar maxHeight:Number = viewPortBounds ? viewPortBounds.maxHeight : Number.POSITIVE_INFINITY;\n\t\t\tvar explicitWidth:Number = viewPortBounds ? viewPortBounds.explicitWidth : NaN;\n\t\t\tvar explicitHeight:Number = viewPortBounds ? viewPortBounds.explicitHeight : NaN;\n\n\t\t\t//let's figure out if we can show multiple rows\n\t\t\tvar supportsMultipleRows:Boolean = true;\n\t\t\tvar availableRowWidth:Number = explicitWidth;\n\t\t\tif(availableRowWidth !== availableRowWidth) //isNaN\n\t\t\t{\n\t\t\t\tavailableRowWidth = maxWidth;\n\t\t\t\tif(availableRowWidth == Number.POSITIVE_INFINITY)\n\t\t\t\t{\n\t\t\t\t\tsupportsMultipleRows = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(this._typicalItem is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this._typicalItem).validate();\n\t\t\t}\n\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\n\t\t\tvar i:int = 0;\n\t\t\tvar positionY:Number = boundsY + this._paddingTop;\n\t\t\tvar maxRowWidth:Number = 0;\n\t\t\tvar maxItemHeight:Number = 0;\n\t\t\tvar verticalGap:Number = this._verticalGap;\n\t\t\tvar hasFirstHorizontalGap:Boolean = this._firstHorizontalGap === this._firstHorizontalGap; //!isNaN\n\t\t\tvar hasLastHorizontalGap:Boolean = this._lastHorizontalGap === this._lastHorizontalGap; //!isNaN\n\t\t\tvar secondToLastIndex:int = itemCount - 2;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tif(i > 0)\n\t\t\t\t{\n\t\t\t\t\tpositionY += maxItemHeight + verticalGap;\n\t\t\t\t}\n\t\t\t\t//this section prepares some variables needed for the following loop\n\t\t\t\tmaxItemHeight = this._useVirtualLayout ? calculatedTypicalItemHeight : 0;\n\t\t\t\tvar positionX:Number = boundsX + this._paddingLeft;\n\t\t\t\tvar rowItemCount:int = 0;\n\n\t\t\t\t//if there are no items in the row (such as when there are no\n\t\t\t\t//items in the container!), then we don't want to subtract the\n\t\t\t\t//gap when calculating the row width, so default to 0.\n\t\t\t\tvar horizontalGap:Number = 0;\n\n\t\t\t\t//this first loop sets the x position of items, and it calculates\n\t\t\t\t//the total width of all items\n\t\t\t\tfor(; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\thorizontalGap = this._horizontalGap;\n\t\t\t\t\tif(hasFirstHorizontalGap && i == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\thorizontalGap = this._firstHorizontalGap;\n\t\t\t\t\t}\n\t\t\t\t\telse if(hasLastHorizontalGap && i > 0 && i == secondToLastIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\thorizontalGap = this._lastHorizontalGap;\n\t\t\t\t\t}\n\t\t\t\t\tif(this._hasVariableItemDimensions)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar cachedWidth:Number = this._widthCache[i];\n\t\t\t\t\t\tvar cachedHeight:Number = this._heightCache[i];\n\t\t\t\t\t\tif(cachedWidth !== cachedWidth) //isNaN\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar itemWidth:Number = calculatedTypicalItemWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titemWidth = cachedWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(cachedHeight !== cachedHeight) //isNaN\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar itemHeight:Number = calculatedTypicalItemHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titemHeight = cachedHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\titemWidth = calculatedTypicalItemWidth;\n\t\t\t\t\t\titemHeight = calculatedTypicalItemHeight;\n\t\t\t\t\t}\n\t\t\t\t\tif(supportsMultipleRows && rowItemCount > 0 && (positionX + itemWidth) > (availableRowWidth - this._paddingRight))\n\t\t\t\t\t{\n\t\t\t\t\t\t//we've reached the end of the row, so go to next\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tpositionX += itemWidth + horizontalGap;\n\t\t\t\t\t//we compare with > instead of Math.max() because the rest\n\t\t\t\t\t//arguments on Math.max() cause extra garbage collection and\n\t\t\t\t\t//hurt performance\n\t\t\t\t\tif(itemHeight > maxItemHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\t//we need to know the maximum height of the items in the\n\t\t\t\t\t\t//case where the height of the view port needs to be\n\t\t\t\t\t\t//calculated by the layout.\n\t\t\t\t\t\tmaxItemHeight = itemHeight;\n\t\t\t\t\t}\n\t\t\t\t\trowItemCount++;\n\t\t\t\t}\n\n\t\t\t\t//this is the total width of all items in the row\n\t\t\t\tvar totalRowWidth:Number = positionX - horizontalGap + this._paddingRight - boundsX;\n\t\t\t\tif(totalRowWidth > maxRowWidth)\n\t\t\t\t{\n\t\t\t\t\tmaxRowWidth = totalRowWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile(i < itemCount);\n\n\t\t\tif(supportsMultipleRows)\n\t\t\t{\n\t\t\t\tif(explicitWidth !== explicitWidth) //isNaN\n\t\t\t\t{\n\t\t\t\t\tavailableRowWidth = maxRowWidth;\n\t\t\t\t\tif(availableRowWidth < minWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tavailableRowWidth = minWidth;\n\t\t\t\t\t}\n\t\t\t\t\telse if(availableRowWidth > maxWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tavailableRowWidth = maxWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tavailableRowWidth = maxRowWidth;\n\t\t\t}\n\n\t\t\tvar totalHeight:Number = positionY + maxItemHeight + this._paddingBottom;\n\t\t\t//the available height is the height of the viewport. if the explicit\n\t\t\t//height is NaN, we need to calculate the viewport height ourselves\n\t\t\t//based on the total height of all items.\n\t\t\tvar availableHeight:Number = explicitHeight;\n\t\t\tif(availableHeight !== availableHeight) //isNaN\n\t\t\t{\n\t\t\t\tavailableHeight = totalHeight;\n\t\t\t\tif(availableHeight < minHeight)\n\t\t\t\t{\n\t\t\t\t\tavailableHeight = minHeight;\n\t\t\t\t}\n\t\t\t\telse if(availableHeight > maxHeight)\n\t\t\t\t{\n\t\t\t\t\tavailableHeight = maxHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tresult.x = availableRowWidth;\n\t\t\tresult.y = availableHeight;\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getNearestScrollPositionForIndex(index:int, scrollX:Number, scrollY:Number, items:Vector.<DisplayObject>,\n\t\t\tx:Number, y:Number, width:Number, height:Number, result:Point = null):Point\n\t\t{\n\t\t\tresult = this.calculateMaxScrollYAndRowHeightOfIndex(index, items, x, y, width, height, result);\n\t\t\tvar maxScrollY:Number = result.x;\n\t\t\tvar rowHeight:Number = result.y;\n\n\t\t\tresult.x = 0;\n\n\t\t\tvar bottomPosition:Number = maxScrollY - (height - rowHeight);\n\t\t\tif(scrollY >= bottomPosition && scrollY <= maxScrollY)\n\t\t\t{\n\t\t\t\t//keep the current scroll position because the item is already\n\t\t\t\t//fully visible\n\t\t\t\tresult.y = scrollY;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar topDifference:Number = Math.abs(maxScrollY - scrollY);\n\t\t\t\tvar bottomDifference:Number = Math.abs(bottomPosition - scrollY);\n\t\t\t\tif(bottomDifference < topDifference)\n\t\t\t\t{\n\t\t\t\t\tresult.y = bottomPosition;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tresult.y = maxScrollY;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function calculateNavigationDestination(items:Vector.<DisplayObject>, index:int, keyCode:uint, bounds:LayoutBoundsResult):int\n\t\t{\n\t\t\tvar result:int = index;\n\t\t\tif(keyCode == Keyboard.HOME)\n\t\t\t{\n\t\t\t\tif(items.length > 0)\n\t\t\t\t{\n\t\t\t\t\tresult = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.END)\n\t\t\t{\n\t\t\t\tresult = items.length - 1;\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.UP)\n\t\t\t{\n\t\t\t\tresult--;\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.DOWN)\n\t\t\t{\n\t\t\t\tresult++;\n\t\t\t}\n\t\t\tif(result < 0)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tif(result >= items.length)\n\t\t\t{\n\t\t\t\treturn items.length - 1;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getScrollPositionForIndex(index:int, items:Vector.<DisplayObject>, x:Number, y:Number, width:Number, height:Number, result:Point = null):Point\n\t\t{\n\t\t\tresult = this.calculateMaxScrollYAndRowHeightOfIndex(index, items, x, y, width, height, result);\n\t\t\tvar maxScrollY:Number = result.x;\n\t\t\tvar rowHeight:Number = result.y;\n\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tif(this._hasVariableItemDimensions)\n\t\t\t\t{\n\t\t\t\t\tvar itemHeight:Number = this._heightCache[index];\n\t\t\t\t\tif(itemHeight !== itemHeight) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\titemHeight = this._typicalItem.height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\titemHeight = this._typicalItem.height;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\titemHeight = items[index].height;\n\t\t\t}\n\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\t\t\tresult.x = 0;\n\t\t\tresult.y = maxScrollY - Math.round((height - itemHeight) / 2);\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getDropIndex(x:Number, y:Number, items:Vector.<DisplayObject>,\n\t\t\tboundsX:Number, boundsY:Number, width:Number, height:Number):int\n\t\t{\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\t//if the layout is virtualized, we'll need the dimensions of the\n\t\t\t\t//typical item so that we have fallback values when an item is null\n\t\t\t\tif(this._typicalItem is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this._typicalItem).validate();\n\t\t\t\t}\n\t\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\t\t\t}\n\n\t\t\tvar horizontalGap:Number = this._horizontalGap;\n\t\t\tvar verticalGap:Number = this._verticalGap;\n\t\t\tvar maxItemHeight:Number = 0;\n\t\t\tvar positionY:Number = this._paddingTop;\n\t\t\tvar i:int = 0;\n\t\t\tvar itemCount:int = items.length;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tif(i > 0)\n\t\t\t\t{\n\t\t\t\t\tpositionY += maxItemHeight + verticalGap;\n\t\t\t\t}\n\t\t\t\t//this section prepares some variables needed for the following loop\n\t\t\t\tmaxItemHeight = this._useVirtualLayout ? calculatedTypicalItemHeight : 0;\n\t\t\t\tvar positionX:Number = this._paddingLeft;\n\t\t\t\tvar rowItemCount:int = 0;\n\t\t\t\tfor(; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar item:DisplayObject = items[i];\n\n\t\t\t\t\tif(this._useVirtualLayout && this._hasVariableItemDimensions)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar cachedWidth:Number = this._widthCache[i];\n\t\t\t\t\t\tvar cachedHeight:Number = this._heightCache[i];\n\t\t\t\t\t}\n\t\t\t\t\tif(this._useVirtualLayout && !item)\n\t\t\t\t\t{\n\t\t\t\t\t\t//the item is null, and the layout is virtualized, so we\n\t\t\t\t\t\t//need to estimate the width of the item.\n\n\t\t\t\t\t\tif(this._hasVariableItemDimensions)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(cachedWidth !== cachedWidth) //isNaN\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar itemWidth:Number = calculatedTypicalItemWidth;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\titemWidth = cachedWidth;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(cachedHeight !== cachedHeight) //isNaN\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar itemHeight:Number = calculatedTypicalItemHeight;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\titemHeight = cachedHeight;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titemWidth = calculatedTypicalItemWidth;\n\t\t\t\t\t\t\titemHeight = calculatedTypicalItemHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//we get here if the item isn't null. it is never null if\n\t\t\t\t\t\t//the layout isn't virtualized.\n\t\t\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(item is IValidating)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tIValidating(item).validate();\n\t\t\t\t\t\t}\n\t\t\t\t\t\titemWidth = item.width;\n\t\t\t\t\t\titemHeight = item.height;\n\t\t\t\t\t\tif(this._useVirtualLayout && this._hasVariableItemDimensions)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(this._hasVariableItemDimensions)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(itemWidth != cachedWidth)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tthis._widthCache[i] = itemWidth;\n\t\t\t\t\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(itemHeight != cachedHeight)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tthis._heightCache[i] = itemHeight;\n\t\t\t\t\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(calculatedTypicalItemWidth >= 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\titemWidth = calculatedTypicalItemWidth;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(calculatedTypicalItemHeight >= 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\titemHeight = calculatedTypicalItemHeight;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tvar endOfRow:Boolean = rowItemCount > 0 && (positionX + itemWidth) > (width - this._paddingRight);\n\t\t\t\t\tif((endOfRow || x < (positionX + (itemWidth / 2))) && y < (positionY + itemHeight + (gap / 2)))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn i;\n\t\t\t\t\t}\n\t\t\t\t\tif(endOfRow)\n\t\t\t\t\t{\n\t\t\t\t\t\t//we've reached the end of the row, so go to next\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t//we compare with > instead of Math.max() because the rest\n\t\t\t\t\t//arguments on Math.max() cause extra garbage collection and\n\t\t\t\t\t//hurt performance\n\t\t\t\t\tif(itemHeight > maxItemHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\t//we need to know the maximum height of the items in the\n\t\t\t\t\t\t//case where the height of the view port needs to be\n\t\t\t\t\t\t//calculated by the layout.\n\t\t\t\t\t\tmaxItemHeight = itemHeight;\n\t\t\t\t\t}\n\t\t\t\t\tpositionX += itemWidth + horizontalGap;\n\t\t\t\t\trowItemCount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile(i < itemCount);\n\t\t\treturn itemCount;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function positionDropIndicator(dropIndicator:DisplayObject, index:int,\n\t\t\tx:Number, y:Number, items:Vector.<DisplayObject>, width:Number, height:Number):void\n\t\t{\n\t\t\tif(dropIndicator is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(dropIndicator).validate();\n\t\t\t}\n\n\t\t\tvar horizontalGap:Number = this._horizontalGap;\n\t\t\tvar verticalGap:Number = this._verticalGap;\n\t\t\tvar maxItemHeight:Number = 0;\n\t\t\tvar positionY:Number = this._paddingTop;\n\t\t\tvar i:int = 0;\n\t\t\tvar itemCount:int = items.length;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tif(i > 0)\n\t\t\t\t{\n\t\t\t\t\tif(y < (positionY + itemHeight + (verticalGap / 2)))\n\t\t\t\t\t{\n\t\t\t\t\t\t//if the x/y position is closer to the previous row,\n\t\t\t\t\t\t//then display the drop indicator at the end of that row\n\t\t\t\t\t\tvar item:DisplayObject = items[i - 1];\n\t\t\t\t\t\tdropIndicator.x = item.x + item.width - dropIndicator.width / 2;\n\t\t\t\t\t\tdropIndicator.y = item.y;\n\t\t\t\t\t\tdropIndicator.height = item.height;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tpositionY += maxItemHeight + verticalGap;\n\t\t\t\t}\n\t\t\t\t//this section prepares some variables needed for the following loop\n\t\t\t\tmaxItemHeight = 0;\n\t\t\t\tvar positionX:Number = this._paddingLeft;\n\t\t\t\tvar rowItemCount:int = 0;\n\t\t\t\tfor(; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\titem = items[i];\n\t\t\t\t\tvar itemWidth:Number = item.width;\n\t\t\t\t\tvar itemHeight:Number = item.height;\n\t\t\t\t\tif(rowItemCount > 0 && (positionX + itemWidth) > (width - this._paddingRight))\n\t\t\t\t\t{\n\t\t\t\t\t\t//we've reached the end of the row, so go to next\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t//we compare with > instead of Math.max() because the rest\n\t\t\t\t\t//arguments on Math.max() cause extra garbage collection and\n\t\t\t\t\t//hurt performance\n\t\t\t\t\tif(itemHeight > maxItemHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\t//we need to know the maximum height of the items in the\n\t\t\t\t\t\t//case where the height of the view port needs to be\n\t\t\t\t\t\t//calculated by the layout.\n\t\t\t\t\t\tmaxItemHeight = itemHeight;\n\t\t\t\t\t}\n\t\t\t\t\tif(i == index)\n\t\t\t\t\t{\n\t\t\t\t\t\tdropIndicator.x = item.x - dropIndicator.width / 2;\n\t\t\t\t\t\tdropIndicator.y = item.y;\n\t\t\t\t\t\tdropIndicator.height = item.height;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tpositionX += itemWidth + horizontalGap;\n\t\t\t\t\trowItemCount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile(i < itemCount);\n\t\t\tvar lastItem:DisplayObject = items[itemCount - 1];\n\t\t\tdropIndicator.x = lastItem.x + lastItem.width - dropIndicator.width / 2;\n\t\t\tdropIndicator.y = lastItem.y;\n\t\t\tdropIndicator.height = lastItem.height;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\toverride public function resetVariableVirtualCache():void\n\t\t{\n\t\t\tthis._widthCache.length = 0;\n\t\t\tthis._heightCache.length = 0;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\toverride public function resetVariableVirtualCacheAtIndex(index:int, item:DisplayObject = null):void\n\t\t{\n\t\t\tdelete this._widthCache[index];\n\t\t\tdelete this._heightCache[index];\n\t\t\tif(item)\n\t\t\t{\n\t\t\t\tthis._widthCache[index] = item.width;\n\t\t\t\tthis._heightCache[index] = item.height;\n\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\toverride public function addToVariableVirtualCacheAtIndex(index:int, item:DisplayObject = null):void\n\t\t{\n\t\t\tvar widthValue:* = (item !== null) ? item.width : undefined;\n\t\t\tvar heightValue:* = (item !== null) ? item.height : undefined;\n\t\t\tthis._widthCache.insertAt(index, widthValue);\n\t\t\tthis._heightCache.insertAt(index, heightValue);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\toverride public function removeFromVariableVirtualCacheAtIndex(index:int):void\n\t\t{\n\t\t\tthis._widthCache.removeAt(index);\n\t\t\tthis._heightCache.removeAt(index);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getVisibleIndicesAtScrollPosition(scrollX:Number, scrollY:Number, width:Number, height:Number, itemCount:int, result:Vector.<int> = null):Vector.<int>\n\t\t{\n\t\t\tif(result)\n\t\t\t{\n\t\t\t\tresult.length = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult = new <int>[];\n\t\t\t}\n\t\t\tif(!this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"getVisibleIndicesAtScrollPosition() may be called only if useVirtualLayout is true.\");\n\t\t\t}\n\n\t\t\tif(this._typicalItem is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this._typicalItem).validate();\n\t\t\t}\n\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\n\t\t\tvar resultLastIndex:int = 0;\n\n\t\t\tvar i:int = 0;\n\t\t\tvar positionY:Number = this._paddingTop;\n\t\t\tvar maxItemHeight:Number = 0;\n\t\t\tvar verticalGap:Number = this._verticalGap;\n\t\t\tvar maxPositionY:Number = scrollY + height;\n\t\t\tvar hasFirstHorizontalGap:Boolean = this._firstHorizontalGap === this._firstHorizontalGap; //!isNaN\n\t\t\tvar hasLastHorizontalGap:Boolean = this._lastHorizontalGap === this._lastHorizontalGap; //!isNaN\n\t\t\tvar secondToLastIndex:int = itemCount - 2;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tif(i > 0)\n\t\t\t\t{\n\t\t\t\t\tpositionY += maxItemHeight + verticalGap;\n\t\t\t\t\tif(positionY >= maxPositionY)\n\t\t\t\t\t{\n\t\t\t\t\t\t//the following rows will not be visible, so we can stop\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//this section prepares some variables needed for the following loop\n\t\t\t\tmaxItemHeight = calculatedTypicalItemHeight;\n\t\t\t\tvar positionX:Number = this._paddingLeft;\n\t\t\t\tvar rowItemCount:int = 0;\n\n\t\t\t\t//this first loop sets the x position of items, and it calculates\n\t\t\t\t//the total width of all items\n\t\t\t\tfor(; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar horizontalGap:Number = this._horizontalGap;\n\t\t\t\t\tif(hasFirstHorizontalGap && i == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\thorizontalGap = this._firstHorizontalGap;\n\t\t\t\t\t}\n\t\t\t\t\telse if(hasLastHorizontalGap && i > 0 && i == secondToLastIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\thorizontalGap = this._lastHorizontalGap;\n\t\t\t\t\t}\n\t\t\t\t\tif(this._hasVariableItemDimensions)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar cachedWidth:Number = this._widthCache[i];\n\t\t\t\t\t\tvar cachedHeight:Number = this._heightCache[i];\n\t\t\t\t\t}\n\t\t\t\t\tif(this._hasVariableItemDimensions)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(cachedWidth !== cachedWidth) //isNaN\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar itemWidth:Number = calculatedTypicalItemWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titemWidth = cachedWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(cachedHeight !== cachedHeight) //isNaN\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar itemHeight:Number = calculatedTypicalItemHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titemHeight = cachedHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\titemWidth = calculatedTypicalItemWidth;\n\t\t\t\t\t\titemHeight = calculatedTypicalItemHeight;\n\t\t\t\t\t}\n\t\t\t\t\tif(rowItemCount > 0 && (positionX + itemWidth) > (width - this._paddingRight))\n\t\t\t\t\t{\n\t\t\t\t\t\t//we've reached the end of the row, so go to next\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif((positionY + itemHeight) > scrollY)\n\t\t\t\t\t{\n\t\t\t\t\t\tresult[resultLastIndex] = i;\n\t\t\t\t\t\tresultLastIndex++;\n\t\t\t\t\t}\n\t\t\t\t\tpositionX += itemWidth + horizontalGap;\n\t\t\t\t\t//we compare with > instead of Math.max() because the rest\n\t\t\t\t\t//arguments on Math.max() cause extra garbage collection and\n\t\t\t\t\t//hurt performance\n\t\t\t\t\tif(itemHeight > maxItemHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\t//we need to know the maximum height of the items in the\n\t\t\t\t\t\t//case where the height of the view port needs to be\n\t\t\t\t\t\t//calculated by the layout.\n\t\t\t\t\t\tmaxItemHeight = itemHeight;\n\t\t\t\t\t}\n\t\t\t\t\trowItemCount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile(i < itemCount);\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function calculateMaxScrollYAndRowHeightOfIndex(index:int, items:Vector.<DisplayObject>,\n\t\t\tx:Number, y:Number, width:Number, height:Number, result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\t//if the layout is virtualized, we'll need the dimensions of the\n\t\t\t\t//typical item so that we have fallback values when an item is null\n\t\t\t\tif(this._typicalItem is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this._typicalItem).validate();\n\t\t\t\t}\n\t\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\t\t\t}\n\n\t\t\tvar horizontalGap:Number = this._horizontalGap;\n\t\t\tvar verticalGap:Number = this._verticalGap;\n\t\t\tvar maxItemHeight:Number = 0;\n\t\t\tvar positionY:Number = y + this._paddingTop;\n\t\t\tvar i:int = 0;\n\t\t\tvar itemCount:int = items.length;\n\t\t\tvar isLastRow:Boolean = false;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tif(isLastRow)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(i > 0)\n\t\t\t\t{\n\t\t\t\t\tpositionY += maxItemHeight + verticalGap;\n\t\t\t\t}\n\t\t\t\t//this section prepares some variables needed for the following loop\n\t\t\t\tmaxItemHeight = this._useVirtualLayout ? calculatedTypicalItemHeight : 0;\n\t\t\t\tvar positionX:Number = x + this._paddingLeft;\n\t\t\t\tvar rowItemCount:int = 0;\n\t\t\t\tfor(; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar item:DisplayObject = items[i];\n\n\t\t\t\t\tif(this._useVirtualLayout && this._hasVariableItemDimensions)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar cachedWidth:Number = this._widthCache[i];\n\t\t\t\t\t\tvar cachedHeight:Number = this._heightCache[i];\n\t\t\t\t\t}\n\t\t\t\t\tif(this._useVirtualLayout && !item)\n\t\t\t\t\t{\n\t\t\t\t\t\t//the item is null, and the layout is virtualized, so we\n\t\t\t\t\t\t//need to estimate the width of the item.\n\n\t\t\t\t\t\tif(this._hasVariableItemDimensions)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(cachedWidth !== cachedWidth) //isNaN\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar itemWidth:Number = calculatedTypicalItemWidth;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\titemWidth = cachedWidth;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(cachedHeight !== cachedHeight) //isNaN\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar itemHeight:Number = calculatedTypicalItemHeight;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\titemHeight = cachedHeight;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titemWidth = calculatedTypicalItemWidth;\n\t\t\t\t\t\t\titemHeight = calculatedTypicalItemHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//we get here if the item isn't null. it is never null if\n\t\t\t\t\t\t//the layout isn't virtualized.\n\t\t\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(item is IValidating)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tIValidating(item).validate();\n\t\t\t\t\t\t}\n\t\t\t\t\t\titemWidth = item.width;\n\t\t\t\t\t\titemHeight = item.height;\n\t\t\t\t\t\tif(this._useVirtualLayout && this._hasVariableItemDimensions)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(this._hasVariableItemDimensions)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(itemWidth != cachedWidth)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tthis._widthCache[i] = itemWidth;\n\t\t\t\t\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(itemHeight != cachedHeight)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tthis._heightCache[i] = itemHeight;\n\t\t\t\t\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(calculatedTypicalItemWidth >= 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\titemWidth = calculatedTypicalItemWidth;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(calculatedTypicalItemHeight >= 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\titemHeight = calculatedTypicalItemHeight;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(rowItemCount > 0 && (positionX + itemWidth) > (width - this._paddingRight))\n\t\t\t\t\t{\n\t\t\t\t\t\t//we've reached the end of the row, so go to next\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t//we don't check this at the beginning of the loop because\n\t\t\t\t\t//it may break to start a new row and then redo this item\n\t\t\t\t\tif(i == index)\n\t\t\t\t\t{\n\t\t\t\t\t\tisLastRow = true;\n\t\t\t\t\t}\n\t\t\t\t\t//we compare with > instead of Math.max() because the rest\n\t\t\t\t\t//arguments on Math.max() cause extra garbage collection and\n\t\t\t\t\t//hurt performance\n\t\t\t\t\tif(itemHeight > maxItemHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\t//we need to know the maximum height of the items in the\n\t\t\t\t\t\t//case where the height of the view port needs to be\n\t\t\t\t\t\t//calculated by the layout.\n\t\t\t\t\t\tmaxItemHeight = itemHeight;\n\t\t\t\t\t}\n\t\t\t\t\tpositionX += itemWidth + horizontalGap;\n\t\t\t\t\trowItemCount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile(i < itemCount);\n\t\t\tresult.setTo(positionY, maxItemHeight);\n\t\t\treturn result;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/HorizontalAlign.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\t/**\n\t * Constants for horizontal alignment of items in a layout.\n\t *\n\t * <p>Note: Some constants may not be valid for certain properties. Please\n\t * see the description of the property in the API reference for full\n\t * details.</p>\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class HorizontalAlign\n\t{\n\t\t/**\n\t\t * The items in the layout will be horizontally aligned to the left of\n\t\t * the bounds.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const LEFT:String = \"left\";\n\n\t\t/**\n\t\t * The items in the layout will be horizontally aligned to the center of\n\t\t * the bounds.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const CENTER:String = \"center\";\n\n\t\t/**\n\t\t * The items in the layout will be horizontally aligned to the right of\n\t\t * the bounds.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const RIGHT:String = \"right\";\n\n\t\t/**\n\t\t * The items in the layout will fill the width of the bounds.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const JUSTIFY:String = \"justify\";\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/HorizontalLayout.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IMeasureDisplayObject;\n\timport feathers.core.IValidating;\n\n\timport flash.errors.IllegalOperationError;\n\timport flash.geom.Point;\n\timport flash.ui.Keyboard;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t/**\n\t * Positions items from left to right in a single row.\n\t *\n\t * @see ../../../help/horizontal-layout.html How to use HorizontalLayout with Feathers containers\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class HorizontalLayout extends BaseLinearLayout implements IVariableVirtualLayout, ITrimmedVirtualLayout, IDragDropLayout\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function HorizontalLayout()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t[Inspectable(type=\"String\",enumeration=\"left,center,right\")]\n\t\t/**\n\t\t * If the total item width is less than the bounds, the positions of\n\t\t * the items can be aligned horizontally, on the x-axis.\n\t\t *\n\t\t * <p><strong>Note:</strong> The <code>HorizontalAlign.JUSTIFY</code>\n\t\t * constant is not supported.</p>\n\t\t *\n\t\t * @default feathers.layout.HorizontalAlign.LEFT\n\t\t *\n\t\t * @see feathers.layout.HorizontalAlign#LEFT\n\t\t * @see feathers.layout.HorizontalAlign#CENTER\n\t\t * @see feathers.layout.HorizontalAlign#RIGHT\n\t\t */\n\t\toverride public function get horizontalAlign():String\n\t\t{\n\t\t\treturn this._horizontalAlign;\n\t\t}\n\n\t\t[Inspectable(type=\"String\",enumeration=\"top,middle,bottom,justify\")]\n\t\t/**\n\t\t * The alignment of the items vertically, on the y-axis.\n\t\t *\n\t\t * <p>If the <code>verticalAlign</code> property is set to\n\t\t * <code>feathers.layout.VerticalAlign.JUSTIFY</code>, the\n\t\t * <code>height</code>, <code>minHeight</code>, and\n\t\t * <code>maxHeight</code> properties of the items may be changed, and\n\t\t * their original values ignored by the layout. In this situation, if\n\t\t * the height needs to be constrained, the <code>height</code>,\n\t\t * <code>minHeight</code>, or <code>maxHeight</code> properties should\n\t\t * instead be set on the parent container that is using this layout.</p>\n\t\t *\n\t\t * @default feathers.layout.VerticalAlign.TOP\n\t\t *\n\t\t * @see feathers.layout.VerticalAlign#TOP\n\t\t * @see feathers.layout.VerticalAlign#MIDDLE\n\t\t * @see feathers.layout.VerticalAlign#BOTTOM\n\t\t * @see feathers.layout.VerticalAlign#JUSTIFY\n\t\t */\n\t\toverride public function get verticalAlign():String\n\t\t{\n\t\t\t//this is an override so that this class can have its own documentation.\n\t\t\treturn this._verticalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _distributeWidths:Boolean = false;\n\n\t\t/**\n\t\t * Distributes the width of the view port equally to each item. If the\n\t\t * view port width needs to be measured, the largest item's width will\n\t\t * be used for all items, subject to any specified minimum and maximum\n\t\t * width values.\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic function get distributeWidths():Boolean\n\t\t{\n\t\t\treturn this._distributeWidths;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set distributeWidths(value:Boolean):void\n\t\t{\n\t\t\tif(this._distributeWidths == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._distributeWidths = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _requestedColumnCount:int = 0;\n\n\t\t/**\n\t\t * Requests that the layout set the view port dimensions to display a\n\t\t * specific number of columns (plus gaps and padding), if possible. If\n\t\t * the explicit width of the view port is set, then this value will be\n\t\t * ignored. If the view port's minimum and/or maximum width are set,\n\t\t * the actual number of visible columns may be adjusted to meet those\n\t\t * requirements. Set this value to <code>0</code> to display as many\n\t\t * columns as possible.\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #maxColumnCount\n\t\t */\n\t\tpublic function get requestedColumnCount():int\n\t\t{\n\t\t\treturn this._requestedColumnCount;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set requestedColumnCount(value:int):void\n\t\t{\n\t\t\tif(value < 0)\n\t\t\t{\n\t\t\t\tthrow RangeError(\"requestedColumnCount requires a value >= 0\");\n\t\t\t}\n\t\t\tif(this._requestedColumnCount == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._requestedColumnCount = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maxColumnCount:int = 0;\n\n\t\t/**\n\t\t * The maximum number of columns to display. If the explicit width of\n\t\t * the view port is set or if the <code>requestedColumnCount</code> is\n\t\t * set, then this value will be ignored. If the view port's minimum\n\t\t * and/or maximum width are set, the actual number of visible columns\n\t\t * may be adjusted to meet those requirements. Set this value to\n\t\t * <code>0</code> to display as many columns as possible.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get maxColumnCount():int\n\t\t{\n\t\t\treturn this._maxColumnCount;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maxColumnCount(value:int):void\n\t\t{\n\t\t\tif(value < 0)\n\t\t\t{\n\t\t\t\tthrow RangeError(\"maxColumnCount requires a value >= 0\");\n\t\t\t}\n\t\t\tif(this._maxColumnCount == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._maxColumnCount = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _scrollPositionHorizontalAlign:String = HorizontalAlign.CENTER;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"left,center,right\")]\n\t\t/**\n\t\t * When the scroll position is calculated for an item, an attempt will\n\t\t * be made to align the item to this position.\n\t\t *\n\t\t * @default feathers.layout.HorizontalAlign.CENTER\n\t\t *\n\t\t * @see feathers.layout.HorizontalAlign#LEFT\n\t\t * @see feathers.layout.HorizontalAlign#CENTER\n\t\t * @see feathers.layout.HorizontalAlign#RIGHT\n\t\t */\n\t\tpublic function get scrollPositionHorizontalAlign():String\n\t\t{\n\t\t\treturn this._scrollPositionHorizontalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set scrollPositionHorizontalAlign(value:String):void\n\t\t{\n\t\t\tthis._scrollPositionHorizontalAlign = value;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function layout(items:Vector.<DisplayObject>, viewPortBounds:ViewPortBounds = null, result:LayoutBoundsResult = null):LayoutBoundsResult\n\t\t{\n\t\t\t//this function is very long because it may be called every frame,\n\t\t\t//in some situations. testing revealed that splitting this function\n\t\t\t//into separate, smaller functions affected performance.\n\t\t\t//since the SWC compiler cannot inline functions, we can't use that\n\t\t\t//feature either.\n\n\t\t\t//since viewPortBounds can be null, we may need to provide some defaults\n\t\t\tvar scrollX:Number = viewPortBounds ? viewPortBounds.scrollX : 0;\n\t\t\tvar scrollY:Number = viewPortBounds ? viewPortBounds.scrollY : 0;\n\t\t\tvar boundsX:Number = viewPortBounds ? viewPortBounds.x : 0;\n\t\t\tvar boundsY:Number = viewPortBounds ? viewPortBounds.y : 0;\n\t\t\tvar minWidth:Number = viewPortBounds ? viewPortBounds.minWidth : 0;\n\t\t\tvar minHeight:Number = viewPortBounds ? viewPortBounds.minHeight : 0;\n\t\t\tvar maxWidth:Number = viewPortBounds ? viewPortBounds.maxWidth : Number.POSITIVE_INFINITY;\n\t\t\tvar maxHeight:Number = viewPortBounds ? viewPortBounds.maxHeight : Number.POSITIVE_INFINITY;\n\t\t\tvar explicitWidth:Number = viewPortBounds ? viewPortBounds.explicitWidth : NaN;\n\t\t\tvar explicitHeight:Number = viewPortBounds ? viewPortBounds.explicitHeight : NaN;\n\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\t//if the layout is virtualized, we'll need the dimensions of the\n\t\t\t\t//typical item so that we have fallback values when an item is null\n\t\t\t\tthis.prepareTypicalItem(explicitHeight - this._paddingTop - this._paddingBottom);\n\t\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\t\t\t}\n\n\t\t\tvar needsExplicitWidth:Boolean = explicitWidth !== explicitWidth; //isNaN\n\t\t\tvar needsExplicitHeight:Boolean = explicitHeight !== explicitHeight; //isNaN\n\t\t\tvar distributedWidth:Number;\n\t\t\tif(!needsExplicitWidth && this._distributeWidths)\n\t\t\t{\n\t\t\t\t//we need to calculate this before validateItems() because it\n\t\t\t\t//needs to be passed in there.\n\t\t\t\tdistributedWidth = this.calculateDistributedWidth(items, explicitWidth, minWidth, maxWidth, false);\n\t\t\t\tif(this._useVirtualLayout)\n\t\t\t\t{\n\t\t\t\t\tcalculatedTypicalItemWidth = distributedWidth;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(!this._useVirtualLayout || this._hasVariableItemDimensions || this._distributeWidths ||\n\t\t\t\tthis._verticalAlign != VerticalAlign.JUSTIFY ||\n\t\t\t\tneedsExplicitHeight) //isNaN\n\t\t\t{\n\t\t\t\t//in some cases, we may need to validate all of the items so\n\t\t\t\t//that we can use their dimensions below.\n\t\t\t\tthis.validateItems(items, explicitHeight - this._paddingTop - this._paddingBottom,\n\t\t\t\t\tminHeight - this._paddingTop - this._paddingBottom,\n\t\t\t\t\tmaxHeight - this._paddingTop - this._paddingBottom,\n\t\t\t\t\texplicitWidth - this._paddingLeft - this._paddingRight,\n\t\t\t\t\tminWidth - this._paddingLeft - this._paddingRight,\n\t\t\t\t\tmaxWidth - this._paddingLeft - this._paddingRight, distributedWidth);\n\t\t\t}\n\n\t\t\tif(needsExplicitWidth && this._distributeWidths)\n\t\t\t{\n\t\t\t\t//if we didn't calculate this before, we need to do it now.\n\t\t\t\tdistributedWidth = this.calculateDistributedWidth(items, explicitWidth, minWidth, maxWidth, true);\n\t\t\t}\n\t\t\tvar hasDistributedWidth:Boolean = distributedWidth === distributedWidth; //!isNaN\n\n\t\t\tif(!this._useVirtualLayout)\n\t\t\t{\n\t\t\t\t//handle the percentWidth property from HorizontalLayoutData,\n\t\t\t\t//if available.\n\t\t\t\tthis.applyPercentWidths(items, explicitWidth, minWidth, maxWidth);\n\t\t\t}\n\n\t\t\t//this section prepares some variables needed for the following loop\n\t\t\tvar hasFirstGap:Boolean = this._firstGap === this._firstGap; //!isNaN\n\t\t\tvar hasLastGap:Boolean = this._lastGap === this._lastGap; //!isNaN\n\t\t\tvar maxItemHeight:Number = this._useVirtualLayout ? calculatedTypicalItemHeight : 0;\n\t\t\tvar positionX:Number = boundsX + this._paddingLeft;\n\t\t\tvar itemCount:int = items.length;\n\t\t\tvar totalItemCount:int = itemCount;\n\t\t\tvar requestedColumnAvailableWidth:Number = 0;\n\t\t\tvar maxColumnAvailableWidth:Number = Number.POSITIVE_INFINITY;\n\t\t\tif(this._useVirtualLayout && !this._hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\t//if the layout is virtualized, and the items all have the same\n\t\t\t\t//width, we can make our loops smaller by skipping some items\n\t\t\t\t//at the beginning and end. this improves performance.\n\t\t\t\ttotalItemCount += this._beforeVirtualizedItemCount + this._afterVirtualizedItemCount;\n\t\t\t\tpositionX += (this._beforeVirtualizedItemCount * (calculatedTypicalItemWidth + this._gap));\n\t\t\t\tif(hasFirstGap && this._beforeVirtualizedItemCount > 0)\n\t\t\t\t{\n\t\t\t\t\tpositionX = positionX - this._gap + this._firstGap;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar secondToLastIndex:int = totalItemCount - 2;\n\t\t\t//this cache is used to save non-null items in virtual layouts. by\n\t\t\t//using a smaller array, we can improve performance by spending less\n\t\t\t//time in the upcoming loops.\n\t\t\tthis._discoveredItemsCache.length = 0;\n\t\t\tvar discoveredItemsCacheLastIndex:int = 0;\n\n\t\t\t//if there are no items in layout, then we don't want to subtract\n\t\t\t//any gap when calculating the total width, so default to 0.\n\t\t\tvar gap:Number = 0;\n\n\t\t\t//this first loop sets the x position of items, and it calculates\n\t\t\t//the total width of all items\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tif(!this._useVirtualLayout)\n\t\t\t\t{\n\t\t\t\t\tif(this._maxColumnCount > 0 && this._maxColumnCount == i)\n\t\t\t\t\t{\n\t\t\t\t\t\tmaxColumnAvailableWidth = positionX;\n\t\t\t\t\t}\n\t\t\t\t\tif(this._requestedColumnCount > 0 && this._requestedColumnCount == i)\n\t\t\t\t\t{\n\t\t\t\t\t\trequestedColumnAvailableWidth = positionX;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\t//if we're trimming some items at the beginning, we need to\n\t\t\t\t//adjust i to account for the missing items in the array\n\t\t\t\tvar iNormalized:int = i + this._beforeVirtualizedItemCount;\n\n\t\t\t\t//pick the gap that will follow this item. the first and second\n\t\t\t\t//to last items may have different gaps.\n\t\t\t\tgap = this._gap;\n\t\t\t\tif(hasFirstGap && iNormalized == 0)\n\t\t\t\t{\n\t\t\t\t\tgap = this._firstGap;\n\t\t\t\t}\n\t\t\t\telse if(hasLastGap && iNormalized > 0 && iNormalized == secondToLastIndex)\n\t\t\t\t{\n\t\t\t\t\tgap = this._lastGap;\n\t\t\t\t}\n\n\t\t\t\tif(this._useVirtualLayout && this._hasVariableItemDimensions)\n\t\t\t\t{\n\t\t\t\t\tvar cachedWidth:Number = this._virtualCache[iNormalized];\n\t\t\t\t}\n\t\t\t\tif(this._useVirtualLayout && !item)\n\t\t\t\t{\n\t\t\t\t\t//the item is null, and the layout is virtualized, so we\n\t\t\t\t\t//need to estimate the width of the item.\n\n\t\t\t\t\tif(!this._hasVariableItemDimensions ||\n\t\t\t\t\t\tcachedWidth !== cachedWidth) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\t//if all items must have the same width, we will\n\t\t\t\t\t\t//use the width of the typical item (calculatedTypicalItemWidth).\n\n\t\t\t\t\t\t//if items may have different widths, we first check\n\t\t\t\t\t\t//the cache for a width value. if there isn't one, then\n\t\t\t\t\t\t//we'll use calculatedTypicalItemWidth as a fallback.\n\t\t\t\t\t\tpositionX += calculatedTypicalItemWidth + gap;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//if we have variable item widths, we should use a\n\t\t\t\t\t\t//cached width when there's one available. it will be\n\t\t\t\t\t\t//more accurate than the typical item's width.\n\t\t\t\t\t\tpositionX += cachedWidth + gap;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//we get here if the item isn't null. it is never null if\n\t\t\t\t\t//the layout isn't virtualized.\n\t\t\t\t\tvar layoutItem:ILayoutDisplayObject = item as ILayoutDisplayObject;\n\t\t\t\t\tif(layoutItem !== null && !layoutItem.includeInLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tvar pivotX:Number = item.pivotX;\n\t\t\t\t\tif(pivotX != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tpivotX *= item.scaleX;\n\t\t\t\t\t}\n\t\t\t\t\titem.x = pivotX + positionX;\n\t\t\t\t\tvar itemWidth:Number;\n\t\t\t\t\tif(hasDistributedWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\titem.width = itemWidth = distributedWidth;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\titemWidth = item.width;\n\t\t\t\t\t}\n\t\t\t\t\tvar itemHeight:Number = item.height;\n\t\t\t\t\tif(this._useVirtualLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._hasVariableItemDimensions)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(itemWidth != cachedWidth)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//update the cache if needed. this will notify\n\t\t\t\t\t\t\t\t//the container that the virtualized layout has\n\t\t\t\t\t\t\t\t//changed, and it the view port may need to be\n\t\t\t\t\t\t\t\t//re-measured.\n\t\t\t\t\t\t\t\tthis._virtualCache[iNormalized] = itemWidth;\n\n\t\t\t\t\t\t\t\t//attempt to adjust the scroll position so that\n\t\t\t\t\t\t\t\t//it looks like we're scrolling smoothly after\n\t\t\t\t\t\t\t\t//this item resizes.\n\t\t\t\t\t\t\t\tif(positionX < scrollX &&\n\t\t\t\t\t\t\t\t\tcachedWidth !== cachedWidth && //isNaN\n\t\t\t\t\t\t\t\t\titemWidth != calculatedTypicalItemWidth)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tthis.dispatchEventWith(Event.SCROLL, false, new Point(itemWidth - calculatedTypicalItemWidth, 0));\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(calculatedTypicalItemWidth >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if all items must have the same width, we will\n\t\t\t\t\t\t\t//use the width of the typical item (calculatedTypicalItemWidth).\n\t\t\t\t\t\t\titemWidth = calculatedTypicalItemWidth;\n\t\t\t\t\t\t\tif(item !== this._typicalItem || item.width != itemWidth)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//ensure that the typical item's width is not\n\t\t\t\t\t\t\t\t//set explicitly so that it can resize\n\t\t\t\t\t\t\t\titem.width = itemWidth;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpositionX += itemWidth + gap;\n\t\t\t\t\t//we compare with > instead of Math.max() because the rest\n\t\t\t\t\t//arguments on Math.max() cause extra garbage collection and\n\t\t\t\t\t//hurt performance\n\t\t\t\t\tif(itemHeight > maxItemHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\t//we need to know the maximum height of the items in the\n\t\t\t\t\t\t//case where the height of the view port needs to be\n\t\t\t\t\t\t//calculated by the layout.\n\t\t\t\t\t\tmaxItemHeight = itemHeight;\n\t\t\t\t\t}\n\t\t\t\t\tif(this._useVirtualLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._discoveredItemsCache[discoveredItemsCacheLastIndex] = item;\n\t\t\t\t\t\tdiscoveredItemsCacheLastIndex++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._useVirtualLayout && !this._hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\t//finish the final calculation of the x position so that it can\n\t\t\t\t//be used for the total width of all items\n\t\t\t\tpositionX += (this._afterVirtualizedItemCount * (calculatedTypicalItemWidth + this._gap));\n\t\t\t\tif(hasLastGap && this._afterVirtualizedItemCount > 0)\n\t\t\t\t{\n\t\t\t\t\tpositionX = positionX - this._gap + this._lastGap;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!this._useVirtualLayout && this._requestedColumnCount > itemCount)\n\t\t\t{\n\t\t\t\tif(itemCount > 0)\n\t\t\t\t{\n\t\t\t\t\trequestedColumnAvailableWidth = this._requestedColumnCount * positionX / itemCount;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\trequestedColumnAvailableWidth = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//this array will contain all items that are not null. see the\n\t\t\t//comment above where the discoveredItemsCache is initialized for\n\t\t\t//details about why this is important.\n\t\t\tvar discoveredItems:Vector.<DisplayObject> = this._useVirtualLayout ? this._discoveredItemsCache : items;\n\t\t\tvar discoveredItemCount:int = discoveredItems.length;\n\n\t\t\tvar totalHeight:Number = maxItemHeight + this._paddingTop + this._paddingBottom;\n\t\t\t//the available height is the height of the viewport. if the explicit\n\t\t\t//height is NaN, we need to calculate the viewport height ourselves\n\t\t\t//based on the total height of all items.\n\t\t\tvar availableHeight:Number = explicitHeight;\n\t\t\tif(availableHeight !== availableHeight) //isNaN\n\t\t\t{\n\t\t\t\tavailableHeight = totalHeight;\n\t\t\t\tif(availableHeight < minHeight)\n\t\t\t\t{\n\t\t\t\t\tavailableHeight = minHeight;\n\t\t\t\t}\n\t\t\t\telse if(availableHeight > maxHeight)\n\t\t\t\t{\n\t\t\t\t\tavailableHeight = maxHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//this is the total width of all items\n\t\t\tvar totalWidth:Number = positionX - gap + this._paddingRight - boundsX;\n\t\t\t//the available width is the width of the viewport. if the explicit\n\t\t\t//width is NaN, we need to calculate the viewport width ourselves\n\t\t\t//based on the total width of all items.\n\t\t\tvar availableWidth:Number = explicitWidth;\n\t\t\tif(availableWidth !== availableWidth) //isNaN\n\t\t\t{\n\t\t\t\tif(this._requestedColumnCount > 0)\n\t\t\t\t{\n\t\t\t\t\tif(this._useVirtualLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tavailableWidth = (calculatedTypicalItemWidth + this._gap) * this._requestedColumnCount - this._gap + this._paddingLeft + this._paddingRight;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tavailableWidth = requestedColumnAvailableWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tavailableWidth = totalWidth;\n\t\t\t\t\tif(this._maxColumnCount > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._useVirtualLayout)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmaxColumnAvailableWidth = (calculatedTypicalItemWidth + this._gap) * this._maxColumnCount - this._gap + this._paddingLeft + this._paddingRight;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(maxColumnAvailableWidth < availableWidth)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tavailableWidth = maxColumnAvailableWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(availableWidth < minWidth)\n\t\t\t\t{\n\t\t\t\t\tavailableWidth = minWidth;\n\t\t\t\t}\n\t\t\t\telse if(availableWidth > maxWidth)\n\t\t\t\t{\n\t\t\t\t\tavailableWidth = maxWidth;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//in this section, we handle horizontal alignment. items will be\n\t\t\t//aligned horizontally if the total width of all items is less than\n\t\t\t//the available width of the view port.\n\t\t\tif(totalWidth < availableWidth)\n\t\t\t{\n\t\t\t\tvar horizontalAlignOffsetX:Number = 0;\n\t\t\t\tif(this._horizontalAlign == HorizontalAlign.RIGHT)\n\t\t\t\t{\n\t\t\t\t\thorizontalAlignOffsetX = availableWidth - totalWidth;\n\t\t\t\t}\n\t\t\t\telse if(this._horizontalAlign == HorizontalAlign.CENTER)\n\t\t\t\t{\n\t\t\t\t\thorizontalAlignOffsetX = Math.round((availableWidth - totalWidth) / 2);\n\t\t\t\t}\n\t\t\t\tif(horizontalAlignOffsetX != 0)\n\t\t\t\t{\n\t\t\t\t\tfor(i = 0; i < discoveredItemCount; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\titem = discoveredItems[i];\n\t\t\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\titem.x += horizontalAlignOffsetX;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar availableHeightMinusPadding:Number = availableHeight - this._paddingTop - this._paddingBottom;\n\t\t\tfor(i = 0; i < discoveredItemCount; i++)\n\t\t\t{\n\t\t\t\titem = discoveredItems[i];\n\t\t\t\tlayoutItem = item as ILayoutDisplayObject;\n\t\t\t\tif(layoutItem !== null && !layoutItem.includeInLayout)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tvar pivotY:Number = item.pivotY;\n\t\t\t\tif(pivotY != 0)\n\t\t\t\t{\n\t\t\t\t\tpivotY *= item.scaleY;\n\t\t\t\t}\n\n\t\t\t\t//in this section, we handle vertical alignment and percent\n\t\t\t\t//height from HorizontalLayoutData\n\t\t\t\tif(this._verticalAlign == VerticalAlign.JUSTIFY)\n\t\t\t\t{\n\t\t\t\t\t//if we justify items vertically, we can skip percent height\n\t\t\t\t\titem.y = pivotY + boundsY + this._paddingTop;\n\t\t\t\t\titem.height = availableHeightMinusPadding;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(layoutItem !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar layoutData:HorizontalLayoutData = layoutItem.layoutData as HorizontalLayoutData;\n\t\t\t\t\t\tif(layoutData !== null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//in this section, we handle percentage width if\n\t\t\t\t\t\t\t//VerticalLayoutData is available.\n\t\t\t\t\t\t\tvar percentHeight:Number = layoutData.percentHeight;\n\t\t\t\t\t\t\tif(percentHeight === percentHeight) //!isNaN\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(percentHeight < 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tpercentHeight = 0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(percentHeight > 100)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tpercentHeight = 100;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\titemHeight = percentHeight * availableHeightMinusPadding / 100;\n\t\t\t\t\t\t\t\tif(item is IFeathersControl)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar feathersItem:IFeathersControl = IFeathersControl(item);\n\t\t\t\t\t\t\t\t\tvar itemMinHeight:Number = feathersItem.explicitMinHeight;\n\t\t\t\t\t\t\t\t\t//we try to respect the minWidth, but not\n\t\t\t\t\t\t\t\t\t//when it's larger than 100%\n\t\t\t\t\t\t\t\t\tif(itemMinHeight > availableHeightMinusPadding)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\titemMinHeight = availableHeightMinusPadding;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(itemHeight < itemMinHeight)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\titemHeight = itemMinHeight;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar itemMaxHeight:Number = feathersItem.explicitMaxHeight;\n\t\t\t\t\t\t\t\t\t\tif(itemHeight > itemMaxHeight)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\titemHeight = itemMaxHeight;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\titem.height = itemHeight;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//handle all other vertical alignment values (we handled\n\t\t\t\t\t//justify already). the y position of all items is set here.\n\t\t\t\t\tvar verticalAlignHeight:Number = availableHeight;\n\t\t\t\t\tif(totalHeight > verticalAlignHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tverticalAlignHeight = totalHeight;\n\t\t\t\t\t}\n\t\t\t\t\tswitch(this._verticalAlign)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase VerticalAlign.BOTTOM:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.y = pivotY + boundsY + verticalAlignHeight - this._paddingBottom - item.height;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase VerticalAlign.MIDDLE:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.y = pivotY + boundsY + this._paddingTop + Math.round((verticalAlignHeight - this._paddingTop - this._paddingBottom - item.height) / 2);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdefault: //top\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.y = pivotY + boundsY + this._paddingTop;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//we don't want to keep a reference to any of the items, so clear\n\t\t\t//this cache\n\t\t\tthis._discoveredItemsCache.length = 0;\n\n\t\t\t//finally, we want to calculate the result so that the container\n\t\t\t//can use it to adjust its viewport and determine the minimum and\n\t\t\t//maximum scroll positions (if needed)\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new LayoutBoundsResult();\n\t\t\t}\n\t\t\tresult.contentX = 0;\n\t\t\tresult.contentWidth = totalWidth;\n\t\t\tresult.contentY = 0;\n\t\t\tresult.contentHeight = this._verticalAlign == VerticalAlign.JUSTIFY ? availableHeight : totalHeight;\n\t\t\tresult.viewPortWidth = availableWidth;\n\t\t\tresult.viewPortHeight = availableHeight;\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function measureViewPort(itemCount:int, viewPortBounds:ViewPortBounds = null, result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\t\t\tif(!this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"measureViewPort() may be called only if useVirtualLayout is true.\");\n\t\t\t}\n\n\t\t\tvar explicitWidth:Number = viewPortBounds ? viewPortBounds.explicitWidth : NaN;\n\t\t\tvar explicitHeight:Number = viewPortBounds ? viewPortBounds.explicitHeight : NaN;\n\t\t\tvar needsWidth:Boolean = explicitWidth !== explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = explicitHeight !== explicitHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight)\n\t\t\t{\n\t\t\t\tresult.x = explicitWidth;\n\t\t\t\tresult.y = explicitHeight;\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tvar minWidth:Number = viewPortBounds ? viewPortBounds.minWidth : 0;\n\t\t\tvar minHeight:Number = viewPortBounds ? viewPortBounds.minHeight : 0;\n\t\t\tvar maxWidth:Number = viewPortBounds ? viewPortBounds.maxWidth : Number.POSITIVE_INFINITY;\n\t\t\tvar maxHeight:Number = viewPortBounds ? viewPortBounds.maxHeight : Number.POSITIVE_INFINITY;\n\n\t\t\tthis.prepareTypicalItem(explicitHeight - this._paddingTop - this._paddingBottom);\n\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\n\t\t\tvar hasFirstGap:Boolean = this._firstGap === this._firstGap; //!isNaN\n\t\t\tvar hasLastGap:Boolean = this._lastGap === this._lastGap; //!isNaN\n\t\t\tvar positionX:Number;\n\t\t\tif(this._distributeWidths)\n\t\t\t{\n\t\t\t\tpositionX = (calculatedTypicalItemWidth + this._gap) * itemCount;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpositionX = 0;\n\t\t\t\tvar maxItemHeight:Number = calculatedTypicalItemHeight;\n\t\t\t\tif(!this._hasVariableItemDimensions)\n\t\t\t\t{\n\t\t\t\t\tpositionX += ((calculatedTypicalItemWidth + this._gap) * itemCount);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar cachedWidth:Number = this._virtualCache[i];\n\t\t\t\t\t\tif(cachedWidth !== cachedWidth) //isNaN\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpositionX += calculatedTypicalItemWidth + this._gap;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpositionX += cachedWidth + this._gap;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tpositionX -= this._gap;\n\t\t\tif(hasFirstGap && itemCount > 1)\n\t\t\t{\n\t\t\t\tpositionX = positionX - this._gap + this._firstGap;\n\t\t\t}\n\t\t\tif(hasLastGap && itemCount > 2)\n\t\t\t{\n\t\t\t\tpositionX = positionX - this._gap + this._lastGap;\n\t\t\t}\n\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tif(this._requestedColumnCount > 0)\n\t\t\t\t{\n\t\t\t\t\tvar resultWidth:Number = (calculatedTypicalItemWidth + this._gap) * this._requestedColumnCount - this._gap + this._paddingLeft + this._paddingRight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tresultWidth = positionX + this._paddingLeft + this._paddingRight;\n\t\t\t\t\tif(this._maxColumnCount > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar maxColumnResultWidth:Number = (calculatedTypicalItemWidth + this._gap) * this._maxColumnCount - this._gap + this._paddingLeft + this._paddingRight;\n\t\t\t\t\t\tif(maxColumnResultWidth < resultWidth)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tresultWidth = maxColumnResultWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(resultWidth < minWidth)\n\t\t\t\t{\n\t\t\t\t\tresultWidth = minWidth;\n\t\t\t\t}\n\t\t\t\telse if(resultWidth > maxWidth)\n\t\t\t\t{\n\t\t\t\t\tresultWidth = maxWidth;\n\t\t\t\t}\n\t\t\t\tresult.x = resultWidth;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult.x = explicitWidth;\n\t\t\t}\n\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tvar resultHeight:Number = maxItemHeight + this._paddingTop + this._paddingBottom;\n\t\t\t\tif(resultHeight < minHeight)\n\t\t\t\t{\n\t\t\t\t\tresultHeight = minHeight;\n\t\t\t\t}\n\t\t\t\telse if(resultHeight > maxHeight)\n\t\t\t\t{\n\t\t\t\t\tresultHeight = maxHeight;\n\t\t\t\t}\n\t\t\t\tresult.y = resultHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult.y = explicitHeight;\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getVisibleIndicesAtScrollPosition(scrollX:Number, scrollY:Number, width:Number, height:Number, itemCount:int, result:Vector.<int> = null):Vector.<int>\n\t\t{\n\t\t\tif(result)\n\t\t\t{\n\t\t\t\tresult.length = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult = new <int>[];\n\t\t\t}\n\t\t\tif(!this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"getVisibleIndicesAtScrollPosition() may be called only if useVirtualLayout is true.\");\n\t\t\t}\n\n\t\t\tthis.prepareTypicalItem(height - this._paddingTop - this._paddingBottom);\n\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\n\t\t\tvar hasFirstGap:Boolean = this._firstGap === this._firstGap; //!isNaN\n\t\t\tvar hasLastGap:Boolean = this._lastGap === this._lastGap; //!isNaN\n\t\t\tvar resultLastIndex:int = 0;\n\t\t\t//we add one extra here because the first item renderer in view may\n\t\t\t//be partially obscured, which would reveal an extra item renderer.\n\t\t\tvar maxVisibleTypicalItemCount:int = Math.ceil(width / (calculatedTypicalItemWidth + this._gap)) + 1;\n\t\t\tif(!this._hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\t//this case can be optimized because we know that every item has\n\t\t\t\t//the same width\n\t\t\t\tvar totalItemWidth:Number = itemCount * (calculatedTypicalItemWidth + this._gap) - this._gap;\n\t\t\t\tif(hasFirstGap && itemCount > 1)\n\t\t\t\t{\n\t\t\t\t\ttotalItemWidth = totalItemWidth - this._gap + this._firstGap;\n\t\t\t\t}\n\t\t\t\tif(hasLastGap && itemCount > 2)\n\t\t\t\t{\n\t\t\t\t\ttotalItemWidth = totalItemWidth - this._gap + this._lastGap;\n\t\t\t\t}\n\t\t\t\tvar indexOffset:int = 0;\n\t\t\t\tif(totalItemWidth < width)\n\t\t\t\t{\n\t\t\t\t\tif(this._horizontalAlign == HorizontalAlign.RIGHT)\n\t\t\t\t\t{\n\t\t\t\t\t\tindexOffset = Math.ceil((width - totalItemWidth) / (calculatedTypicalItemWidth + this._gap));\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._horizontalAlign == HorizontalAlign.CENTER)\n\t\t\t\t\t{\n\t\t\t\t\t\tindexOffset = Math.ceil(((width - totalItemWidth) / (calculatedTypicalItemWidth + this._gap)) / 2);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar minimum:int = (scrollX - this._paddingLeft) / (calculatedTypicalItemWidth + this._gap);\n\t\t\t\tif(minimum < 0)\n\t\t\t\t{\n\t\t\t\t\tminimum = 0;\n\t\t\t\t}\n\t\t\t\tminimum -= indexOffset;\n\t\t\t\t//if we're scrolling beyond the final item, we should keep the\n\t\t\t\t//indices consistent so that items aren't destroyed and\n\t\t\t\t//recreated unnecessarily\n\t\t\t\tvar maximum:int = minimum + maxVisibleTypicalItemCount;\n\t\t\t\tif(maximum >= itemCount)\n\t\t\t\t{\n\t\t\t\t\tmaximum = itemCount - 1;\n\t\t\t\t}\n\t\t\t\tminimum = maximum - maxVisibleTypicalItemCount;\n\t\t\t\tif(minimum < 0)\n\t\t\t\t{\n\t\t\t\t\tminimum = 0;\n\t\t\t\t}\n\t\t\t\tfor(var i:int = minimum; i <= maximum; i++)\n\t\t\t\t{\n\t\t\t\t\tif(i >= 0 && i < itemCount)\n\t\t\t\t\t{\n\t\t\t\t\t\tresult[resultLastIndex] = i;\n\t\t\t\t\t}\n\t\t\t\t\telse if(i < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tresult[resultLastIndex] = itemCount + i;\n\t\t\t\t\t}\n\t\t\t\t\telse if(i >= itemCount)\n\t\t\t\t\t{\n\t\t\t\t\t\tresult[resultLastIndex] = i - itemCount;\n\t\t\t\t\t}\n\t\t\t\t\tresultLastIndex++;\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tvar secondToLastIndex:int = itemCount - 2;\n\t\t\tvar maxPositionX:Number = scrollX + width;\n\t\t\tvar positionX:Number = this._paddingLeft;\n\t\t\tfor(i = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar gap:Number = this._gap;\n\t\t\t\tif(hasFirstGap && i == 0)\n\t\t\t\t{\n\t\t\t\t\tgap = this._firstGap;\n\t\t\t\t}\n\t\t\t\telse if(hasLastGap && i > 0 && i == secondToLastIndex)\n\t\t\t\t{\n\t\t\t\t\tgap = this._lastGap;\n\t\t\t\t}\n\t\t\t\tvar cachedWidth:Number = this._virtualCache[i];\n\t\t\t\tif(cachedWidth !== cachedWidth) //isNaN\n\t\t\t\t{\n\t\t\t\t\tvar itemWidth:Number = calculatedTypicalItemWidth;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\titemWidth = cachedWidth;\n\t\t\t\t}\n\t\t\t\tvar oldPositionX:Number = positionX;\n\t\t\t\tpositionX += itemWidth + gap;\n\t\t\t\tif(positionX > scrollX && oldPositionX < maxPositionX)\n\t\t\t\t{\n\t\t\t\t\tresult[resultLastIndex] = i;\n\t\t\t\t\tresultLastIndex++;\n\t\t\t\t}\n\n\t\t\t\tif(positionX >= maxPositionX)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//similar to above, in order to avoid costly destruction and\n\t\t\t//creation of item renderers, we're going to fill in some extra\n\t\t\t//indices\n\t\t\tvar resultLength:int = result.length;\n\t\t\tvar visibleItemCountDifference:int = maxVisibleTypicalItemCount - resultLength;\n\t\t\tif(visibleItemCountDifference > 0 && resultLength > 0)\n\t\t\t{\n\t\t\t\t//add extra items before the first index\n\t\t\t\tvar firstExistingIndex:int = result[0];\n\t\t\t\tvar lastIndexToAdd:int = firstExistingIndex - visibleItemCountDifference;\n\t\t\t\tif(lastIndexToAdd < 0)\n\t\t\t\t{\n\t\t\t\t\tlastIndexToAdd = 0;\n\t\t\t\t}\n\t\t\t\tfor(i = firstExistingIndex - 1; i >= lastIndexToAdd; i--)\n\t\t\t\t{\n\t\t\t\t\tresult.insertAt(0, i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tresultLength = result.length;\n\t\t\tresultLastIndex = resultLength;\n\t\t\tvisibleItemCountDifference = maxVisibleTypicalItemCount - resultLength;\n\t\t\tif(visibleItemCountDifference > 0)\n\t\t\t{\n\t\t\t\t//add extra items after the last index\n\t\t\t\tvar startIndex:int = resultLength > 0 ? (result[resultLength - 1] + 1) : 0;\n\t\t\t\tvar endIndex:int = startIndex + visibleItemCountDifference;\n\t\t\t\tif(endIndex > itemCount)\n\t\t\t\t{\n\t\t\t\t\tendIndex = itemCount;\n\t\t\t\t}\n\t\t\t\tfor(i = startIndex; i < endIndex; i++)\n\t\t\t\t{\n\t\t\t\t\tresult[resultLastIndex] = i;\n\t\t\t\t\tresultLastIndex++;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getNearestScrollPositionForIndex(index:int, scrollX:Number, scrollY:Number, items:Vector.<DisplayObject>,\n\t\t\tx:Number, y:Number, width:Number, height:Number, result:Point = null):Point\n\t\t{\n\t\t\tvar maxScrollX:Number = this.calculateMaxScrollXOfIndex(index, items, x, y, width, height);\n\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tif(this._hasVariableItemDimensions)\n\t\t\t\t{\n\t\t\t\t\tvar itemWidth:Number = this._virtualCache[index];\n\t\t\t\t\tif(itemWidth !== itemWidth) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\titemWidth = this._typicalItem.width;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\titemWidth = this._typicalItem.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\titemWidth = items[index].width;\n\t\t\t}\n\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\n\t\t\tvar rightPosition:Number = maxScrollX - (width - itemWidth);\n\t\t\tif(scrollX >= rightPosition && scrollX <= maxScrollX)\n\t\t\t{\n\t\t\t\t//keep the current scroll position because the item is already\n\t\t\t\t//fully visible\n\t\t\t\tresult.x = scrollX;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar leftDifference:Number = Math.abs(maxScrollX - scrollX);\n\t\t\t\tvar rightDifference:Number = Math.abs(rightPosition - scrollX);\n\t\t\t\tif(rightDifference < leftDifference)\n\t\t\t\t{\n\t\t\t\t\tresult.x = rightPosition;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tresult.x = maxScrollX;\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult.y = 0;\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function calculateNavigationDestination(items:Vector.<DisplayObject>, index:int, keyCode:uint, bounds:LayoutBoundsResult):int\n\t\t{\n\t\t\tvar itemArrayCount:int = items.length;\n\t\t\tvar itemCount:int = itemArrayCount + this._beforeVirtualizedItemCount + this._afterVirtualizedItemCount;\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\t//if the layout is virtualized, we'll need the dimensions of the\n\t\t\t\t//typical item so that we have fallback values when an item is null\n\t\t\t\tthis.prepareTypicalItem(bounds.viewPortHeight - this._paddingTop - this._paddingBottom);\n\t\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\t}\n\n\t\t\tvar result:int = index;\n\t\t\tif(keyCode == Keyboard.HOME)\n\t\t\t{\n\t\t\t\tif(itemCount > 0)\n\t\t\t\t{\n\t\t\t\t\tresult = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.END)\n\t\t\t{\n\t\t\t\tresult = itemCount - 1;\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.PAGE_UP)\n\t\t\t{\n\t\t\t\tvar xPosition:Number = 0;\n\t\t\t\tvar indexOffset:int = 0;\n\t\t\t\tif(this._useVirtualLayout && this._hasVariableItemDimensions)\n\t\t\t\t{\n\t\t\t\t\tindexOffset = -this._beforeVirtualizedItemCount;\n\t\t\t\t}\n\t\t\t\tfor(var i:int = index; i >= 0; i--)\n\t\t\t\t{\n\t\t\t\t\tvar iNormalized:int = i + indexOffset;\n\t\t\t\t\tif(this._useVirtualLayout && this._hasVariableItemDimensions)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar cachedWidth:Number = this._virtualCache[i];\n\t\t\t\t\t}\n\t\t\t\t\tif(iNormalized < 0 || iNormalized >= itemArrayCount)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(cachedWidth === cachedWidth) //!isNaN\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\txPosition += cachedWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\txPosition += calculatedTypicalItemWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar item:DisplayObject = items[iNormalized];\n\t\t\t\t\t\tif(item === null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(cachedWidth === cachedWidth) //!isNaN\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\txPosition += cachedWidth;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\txPosition += calculatedTypicalItemWidth;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\txPosition += item.width;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(xPosition > bounds.viewPortWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\txPosition += this._gap;\n\t\t\t\t\tresult = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.PAGE_DOWN)\n\t\t\t{\n\t\t\t\txPosition = 0;\n\t\t\t\tindexOffset = 0;\n\t\t\t\tif(this._useVirtualLayout && this._hasVariableItemDimensions)\n\t\t\t\t{\n\t\t\t\t\tindexOffset = -this._beforeVirtualizedItemCount;\n\t\t\t\t}\n\t\t\t\tfor(i = index; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\tiNormalized = i + indexOffset;\n\t\t\t\t\tif(this._useVirtualLayout && this._hasVariableItemDimensions)\n\t\t\t\t\t{\n\t\t\t\t\t\tcachedWidth = this._virtualCache[i];\n\t\t\t\t\t}\n\t\t\t\t\tif(iNormalized < 0 || iNormalized >= itemArrayCount)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(cachedWidth === cachedWidth) //!isNaN\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\txPosition += cachedWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\txPosition += calculatedTypicalItemWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\titem = items[iNormalized];\n\t\t\t\t\t\tif(item === null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(cachedWidth === cachedWidth) //!isNaN\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\txPosition += cachedWidth;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\txPosition += calculatedTypicalItemWidth;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\txPosition += item.width;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(xPosition > bounds.viewPortWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\txPosition += this._gap;\n\t\t\t\t\tresult = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.LEFT)\n\t\t\t{\n\t\t\t\tresult--;\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.RIGHT)\n\t\t\t{\n\t\t\t\tresult++;\n\t\t\t}\n\t\t\tif(result < 0)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tif(result >= itemCount)\n\t\t\t{\n\t\t\t\treturn itemCount - 1;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getScrollPositionForIndex(index:int, items:Vector.<DisplayObject>, x:Number, y:Number, width:Number, height:Number, result:Point = null):Point\n\t\t{\n\t\t\tvar maxScrollX:Number = this.calculateMaxScrollXOfIndex(index, items, x, y, width, height);\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tif(this._hasVariableItemDimensions)\n\t\t\t\t{\n\t\t\t\t\tvar itemWidth:Number = this._virtualCache[index];\n\t\t\t\t\tif(itemWidth !== itemWidth) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\titemWidth = this._typicalItem.width;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\titemWidth = this._typicalItem.width;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\titemWidth = items[index].width;\n\t\t\t}\n\t\t\tif(this._scrollPositionHorizontalAlign == HorizontalAlign.CENTER)\n\t\t\t{\n\t\t\t\tmaxScrollX -= Math.round((width - itemWidth) / 2);\n\t\t\t}\n\t\t\telse if(this._scrollPositionHorizontalAlign == HorizontalAlign.RIGHT)\n\t\t\t{\n\t\t\t\tmaxScrollX -= (width - itemWidth);\n\t\t\t}\n\t\t\tresult.x = maxScrollX;\n\t\t\tresult.y = 0;\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function positionDropIndicator(dropIndicator:DisplayObject, index:int,\n\t\t\tx:Number, y:Number, items:Vector.<DisplayObject>, width:Number, height:Number):void\n\t\t{\n\t\t\tvar indexOffset:int = 0;\n\t\t\tvar itemCount:int = items.length;\n\t\t\tvar totalItemCount:int = itemCount;\n\t\t\tif(this._useVirtualLayout && !this._hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\t//if the layout is virtualized, and the items all have the same\n\t\t\t\t//height, we can make our loops smaller by skipping some items\n\t\t\t\t//at the beginning and end. this improves performance.\n\t\t\t\ttotalItemCount += this._beforeVirtualizedItemCount + this._afterVirtualizedItemCount;\n\t\t\t\tindexOffset = this._beforeVirtualizedItemCount;\n\t\t\t}\n\t\t\tvar indexMinusOffset:int = index - indexOffset;\n\n\t\t\tif(dropIndicator is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(dropIndicator).validate();\n\t\t\t}\n\n\t\t\tdropIndicator.y = this._paddingTop;\n\t\t\tvar xPosition:Number = 0;\n\t\t\tif(index < totalItemCount)\n\t\t\t{\n\t\t\t\tvar item:DisplayObject = items[indexMinusOffset];\n\t\t\t\txPosition = item.x - dropIndicator.width / 2;\n\t\t\t\tdropIndicator.y = item.y;\n\t\t\t\tdropIndicator.height = item.height;\n\t\t\t}\n\t\t\telse //after the last item\n\t\t\t{\n\t\t\t\titem = items[indexMinusOffset - 1];\n\t\t\t\txPosition = item.x + item.width - dropIndicator.width;\n\t\t\t\tdropIndicator.y = item.y;\n\t\t\t\tdropIndicator.height = item.height;\n\t\t\t}\n\t\t\tif(xPosition < 0)\n\t\t\t{\n\t\t\t\txPosition = 0;\n\t\t\t}\n\t\t\tdropIndicator.x = xPosition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function getDropIndex(x:Number, y:Number, items:Vector.<DisplayObject>,\n\t\t\tboundsX:Number, boundsY:Number, width:Number, height:Number):int\n\t\t{\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthis.prepareTypicalItem(height - this._paddingTop - this._paddingBottom);\n\t\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\t\t\t}\n\t\t\tvar hasFirstGap:Boolean = this._firstGap === this._firstGap; //!isNaN\n\t\t\tvar hasLastGap:Boolean = this._lastGap === this._lastGap; //!isNaN\n\t\t\tvar positionX:Number = boundsX + this._paddingLeft;\n\t\t\tvar lastWidth:Number = 0;\n\t\t\tvar gap:Number = this._gap;\n\t\t\tvar indexOffset:int = 0;\n\t\t\tvar itemCount:int = items.length;\n\t\t\tvar totalItemCount:int = itemCount;\n\t\t\tif(this._useVirtualLayout && !this._hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\ttotalItemCount += this._beforeVirtualizedItemCount + this._afterVirtualizedItemCount;\n\t\t\t\tindexOffset = this._beforeVirtualizedItemCount;\n\t\t\t}\n\t\t\tvar secondToLastIndex:int = totalItemCount - 2;\n\t\t\tfor(var i:int = 0; i <= totalItemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:DisplayObject = null;\n\t\t\t\tvar indexMinusOffset:int = i - indexOffset;\n\t\t\t\tif(indexMinusOffset >= 0 && indexMinusOffset < itemCount)\n\t\t\t\t{\n\t\t\t\t\titem = items[indexMinusOffset];\n\t\t\t\t}\n\t\t\t\tif(hasFirstGap && i == 0)\n\t\t\t\t{\n\t\t\t\t\tgap = this._firstGap;\n\t\t\t\t}\n\t\t\t\telse if(hasLastGap && i > 0 && i == secondToLastIndex)\n\t\t\t\t{\n\t\t\t\t\tgap = this._lastGap;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tgap = this._gap;\n\t\t\t\t}\n\t\t\t\tif(this._useVirtualLayout && this._hasVariableItemDimensions)\n\t\t\t\t{\n\t\t\t\t\tvar cachedWidth:Number = this._virtualCache[i];\n\t\t\t\t}\n\t\t\t\tif(this._useVirtualLayout && !item)\n\t\t\t\t{\n\t\t\t\t\tif(!this._hasVariableItemDimensions ||\n\t\t\t\t\t\tcachedWidth !== cachedWidth) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\tlastWidth = calculatedTypicalItemWidth;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tlastWidth = cachedWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//use the x position of the item to account for horizontal\n\t\t\t\t\t//alignment, in case the total width of the items is less\n\t\t\t\t\t//than the width of the container\n\t\t\t\t\tpositionX = item.x;\n\t\t\t\t\tvar itemWidth:Number = item.width;\n\t\t\t\t\tif(this._useVirtualLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._hasVariableItemDimensions)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(itemWidth != cachedWidth)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis._virtualCache[i] = itemWidth;\n\t\t\t\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(calculatedTypicalItemWidth >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titemWidth = calculatedTypicalItemWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlastWidth = itemWidth;\n\t\t\t\t}\n\t\t\t\tif(x < (positionX + (lastWidth / 2)))\n\t\t\t\t{\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t\tpositionX += lastWidth + gap;\n\t\t\t}\n\t\t\treturn totalItemCount;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function validateItems(items:Vector.<DisplayObject>,\n\t\t\texplicitHeight:Number, minHeight:Number, maxHeight:Number,\n\t\t\texplicitWidth:Number, minWidth:Number, maxWidth:Number, distributedWidth:Number):void\n\t\t{\n\t\t\tvar needsWidth:Boolean = explicitWidth !== explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = explicitHeight !== explicitHeight; //isNaN\n\t\t\tvar containerWidth:Number = explicitWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tcontainerWidth = minWidth;\n\t\t\t}\n\t\t\t//if the alignment is justified, then we want to set the height of\n\t\t\t//each item before validating because setting one dimension may\n\t\t\t//cause the other dimension to change, and that will invalidate the\n\t\t\t//layout if it happens after validation, causing more invalidation\n\t\t\tvar isJustified:Boolean = this._verticalAlign == VerticalAlign.JUSTIFY;\n\t\t\tvar itemCount:int = items.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\tif(!item || (item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(this._distributeWidths)\n\t\t\t\t{\n\t\t\t\t\titem.width = distributedWidth;\n\t\t\t\t}\n\t\t\t\tif(isJustified)\n\t\t\t\t{\n\t\t\t\t\t//the alignment is justified, but we don't yet have a width\n\t\t\t\t\t//to use, so we need to ensure that we accurately measure\n\t\t\t\t\t//the items instead of using an old justified height that\n\t\t\t\t\t//may be wrong now!\n\t\t\t\t\titem.height = explicitHeight;\n\t\t\t\t\tif(item is IFeathersControl)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar feathersItem:IFeathersControl = IFeathersControl(item);\n\t\t\t\t\t\tfeathersItem.minHeight = minHeight;\n\t\t\t\t\t\tfeathersItem.maxHeight = maxHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(item is ILayoutDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar layoutItem:ILayoutDisplayObject = ILayoutDisplayObject(item);\n\t\t\t\t\tvar layoutData:HorizontalLayoutData = layoutItem.layoutData as HorizontalLayoutData;\n\t\t\t\t\tif(layoutData !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar percentWidth:Number = layoutData.percentWidth;\n\t\t\t\t\t\tvar percentHeight:Number = layoutData.percentHeight;\n\t\t\t\t\t\tif(percentWidth === percentWidth) //!isNaN\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(percentWidth < 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tpercentWidth = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(percentWidth > 100)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tpercentWidth = 100;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar itemWidth:Number = containerWidth * percentWidth / 100;\n\t\t\t\t\t\t\tvar measureItem:IMeasureDisplayObject = IMeasureDisplayObject(item);\n\t\t\t\t\t\t\tvar itemExplicitMinWidth:Number = measureItem.explicitMinWidth;\n\t\t\t\t\t\t\tif(measureItem.explicitMinWidth === measureItem.explicitMinWidth && //!isNaN\n\t\t\t\t\t\t\t\titemWidth < itemExplicitMinWidth)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\titemWidth = itemExplicitMinWidth;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//validating this component may be expensive if we\n\t\t\t\t\t\t\t//don't limit the width! we want to ensure that a\n\t\t\t\t\t\t\t//component like a horizontal list with many item\n\t\t\t\t\t\t\t//renderers doesn't completely bypass layout\n\t\t\t\t\t\t\t//virtualization, so we limit the width to the\n\t\t\t\t\t\t\t//maximum possible value if it were the only item in\n\t\t\t\t\t\t\t//the layout.\n\t\t\t\t\t\t\t//this doesn't need to be perfectly accurate because\n\t\t\t\t\t\t\t//it's just a maximum\n\t\t\t\t\t\t\tmeasureItem.maxWidth = itemWidth;\n\t\t\t\t\t\t\t//we also need to clear the explicit width because,\n\t\t\t\t\t\t\t//for many components, it will affect the minWidth\n\t\t\t\t\t\t\t//which is used in the final calculation\n\t\t\t\t\t\t\titem.width = NaN;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(percentHeight === percentHeight) //!isNaN\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(percentHeight < 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tpercentHeight = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(percentHeight > 100)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tpercentHeight = 100;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar itemHeight:Number = explicitHeight * percentHeight / 100;\n\t\t\t\t\t\t\tmeasureItem = IMeasureDisplayObject(item);\n\t\t\t\t\t\t\t//we use the explicitMinHeight to make an accurate\n\t\t\t\t\t\t\t//measurement, and we'll use the component's\n\t\t\t\t\t\t\t//measured minHeight later, after we validate it.\n\t\t\t\t\t\t\tvar itemExplicitMinHeight:Number = measureItem.explicitMinHeight;\n\t\t\t\t\t\t\tif(measureItem.explicitMinHeight === measureItem.explicitMinHeight && //!isNaN\n\t\t\t\t\t\t\t\titemHeight < itemExplicitMinHeight)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\titemHeight = itemExplicitMinHeight;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(itemHeight > maxHeight)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\titemHeight = maxHeight;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//unlike above, where we set maxWidth, we can set\n\t\t\t\t\t\t\t//the height explicitly here\n\t\t\t\t\t\t\t//in fact, it's required because we need to make\n\t\t\t\t\t\t\t//an accurate measurement of the total view port\n\t\t\t\t\t\t\t//height\n\t\t\t\t\t\t\titem.height = itemHeight;\n\t\t\t\t\t\t\t//if itemWidth is NaN, we need to set a maximum\n\t\t\t\t\t\t\t//width instead. this is important for items where\n\t\t\t\t\t\t\t//the height becomes larger when their width becomes\n\t\t\t\t\t\t\t//smaller (such as word-wrapped text)\n\t\t\t\t\t\t\tif(measureItem.explicitHeight !== measureItem.explicitHeight && //isNaN\n\t\t\t\t\t\t\t\tmeasureItem.maxHeight > maxHeight)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmeasureItem.maxHeight = maxHeight;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(item is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(item).validate();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function prepareTypicalItem(justifyHeight:Number):void\n\t\t{\n\t\t\tif(!this._typicalItem)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._resetTypicalItemDimensionsOnMeasure)\n\t\t\t{\n\t\t\t\tthis._typicalItem.width = this._typicalItemWidth;\n\t\t\t}\n\t\t\tvar hasSetHeight:Boolean = false;\n\t\t\tif(this._verticalAlign == VerticalAlign.JUSTIFY &&\n\t\t\t\tjustifyHeight === justifyHeight) //!isNaN\n\t\t\t{\n\t\t\t\thasSetHeight = true;\n\t\t\t\tthis._typicalItem.height = justifyHeight;\n\t\t\t}\n\t\t\telse if(this._typicalItem is ILayoutDisplayObject)\n\t\t\t{\n\t\t\t\tvar layoutItem:ILayoutDisplayObject = ILayoutDisplayObject(this._typicalItem);\n\t\t\t\tvar layoutData:VerticalLayoutData = layoutItem.layoutData as VerticalLayoutData;\n\t\t\t\tif(layoutData !== null)\n\t\t\t\t{\n\t\t\t\t\tvar percentHeight:Number = layoutData.percentHeight;\n\t\t\t\t\tif(percentHeight === percentHeight) //!isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\tif(percentHeight < 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpercentHeight = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(percentHeight > 100)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpercentHeight = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\thasSetHeight = true;\n\t\t\t\t\t\tthis._typicalItem.height = justifyHeight * percentHeight / 100;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!hasSetHeight && this._resetTypicalItemDimensionsOnMeasure)\n\t\t\t{\n\t\t\t\tthis._typicalItem.height = this._typicalItemHeight;\n\t\t\t}\n\t\t\tif(this._typicalItem is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this._typicalItem).validate();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function calculateDistributedWidth(items:Vector.<DisplayObject>, explicitWidth:Number, minWidth:Number, maxWidth:Number, measureItems:Boolean):Number\n\t\t{\n\t\t\tvar needsWidth:Boolean = explicitWidth !== explicitWidth; //isNaN\n\t\t\tvar maxItemWidth:Number = 0;\n\t\t\tvar includedItemCount:int = 0;\n\t\t\tvar itemCount:int = items.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tincludedItemCount++;\n\t\t\t\tvar itemWidth:Number = item.width;\n\t\t\t\tif(itemWidth > maxItemWidth)\n\t\t\t\t{\n\t\t\t\t\tmaxItemWidth = itemWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(measureItems && needsWidth)\n\t\t\t{\n\t\t\t\texplicitWidth = maxItemWidth * includedItemCount + this._paddingLeft + this._paddingRight + this._gap * (includedItemCount - 1);\n\t\t\t\tvar needsRecalculation:Boolean = false;\n\t\t\t\tif(explicitWidth > maxWidth)\n\t\t\t\t{\n\t\t\t\t\texplicitWidth = maxWidth;\n\t\t\t\t\tneedsRecalculation = true;\n\t\t\t\t}\n\t\t\t\telse if(explicitWidth < minWidth)\n\t\t\t\t{\n\t\t\t\t\texplicitWidth = minWidth;\n\t\t\t\t\tneedsRecalculation = true;\n\t\t\t\t}\n\t\t\t\tif(!needsRecalculation)\n\t\t\t\t{\n\t\t\t\t\treturn maxItemWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar availableSpace:Number = explicitWidth;\n\t\t\tif(needsWidth && maxWidth < Number.POSITIVE_INFINITY)\n\t\t\t{\n\t\t\t\tavailableSpace = maxWidth;\n\t\t\t}\n\t\t\tavailableSpace = availableSpace - this._paddingLeft - this._paddingRight - this._gap * (includedItemCount - 1);\n\t\t\tif(includedItemCount > 1 && this._firstGap === this._firstGap) //!isNaN\n\t\t\t{\n\t\t\t\tavailableSpace += this._gap - this._firstGap;\n\t\t\t}\n\t\t\tif(includedItemCount > 2 && this._lastGap === this._lastGap) //!isNaN\n\t\t\t{\n\t\t\t\tavailableSpace += this._gap - this._lastGap;\n\t\t\t}\n\t\t\treturn availableSpace / includedItemCount;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function applyPercentWidths(items:Vector.<DisplayObject>, explicitWidth:Number, minWidth:Number, maxWidth:Number):void\n\t\t{\n\t\t\tvar remainingWidth:Number = explicitWidth;\n\t\t\tthis._discoveredItemsCache.length = 0;\n\t\t\tvar totalExplicitWidth:Number = 0;\n\t\t\tvar totalMinWidth:Number = 0;\n\t\t\tvar totalPercentWidth:Number = 0;\n\t\t\tvar itemCount:int = items.length;\n\t\t\tvar pushIndex:int = 0;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\tif(item is ILayoutDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar layoutItem:ILayoutDisplayObject = ILayoutDisplayObject(item);\n\t\t\t\t\tif(!layoutItem.includeInLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tvar layoutData:HorizontalLayoutData = layoutItem.layoutData as HorizontalLayoutData;\n\t\t\t\t\tif(layoutData)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar percentWidth:Number = layoutData.percentWidth;\n\t\t\t\t\t\tif(percentWidth === percentWidth) //!isNaN\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(percentWidth < 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tpercentWidth = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(layoutItem is IFeathersControl)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar feathersItem:IFeathersControl = IFeathersControl(layoutItem);\n\t\t\t\t\t\t\t\ttotalMinWidth += feathersItem.minWidth;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttotalPercentWidth += percentWidth;\n\t\t\t\t\t\t\ttotalExplicitWidth += this._gap;\n\t\t\t\t\t\t\tthis._discoveredItemsCache[pushIndex] = item;\n\t\t\t\t\t\t\tpushIndex++;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttotalExplicitWidth += item.width + this._gap;\n\t\t\t}\n\t\t\ttotalExplicitWidth -= this._gap;\n\t\t\tif(this._firstGap === this._firstGap && //!isNaN\n\t\t\t\titemCount > 1)\n\t\t\t{\n\t\t\t\ttotalExplicitWidth += (this._firstGap - this._gap);\n\t\t\t}\n\t\t\telse if(this._lastGap === this._lastGap //!isNaN\n\t\t\t\t&& itemCount > 2)\n\t\t\t{\n\t\t\t\ttotalExplicitWidth += (this._lastGap - this._gap);\n\t\t\t}\n\t\t\ttotalExplicitWidth += this._paddingLeft + this._paddingRight;\n\t\t\tif(totalPercentWidth < 100)\n\t\t\t{\n\t\t\t\ttotalPercentWidth = 100;\n\t\t\t}\n\t\t\tif(remainingWidth !== remainingWidth) //isNaN\n\t\t\t{\n\t\t\t\tremainingWidth = totalExplicitWidth + totalMinWidth;\n\t\t\t\tif(remainingWidth < minWidth)\n\t\t\t\t{\n\t\t\t\t\tremainingWidth = minWidth;\n\t\t\t\t}\n\t\t\t\telse if(remainingWidth > maxWidth)\n\t\t\t\t{\n\t\t\t\t\tremainingWidth = maxWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tremainingWidth -= totalExplicitWidth;\n\t\t\tif(remainingWidth < 0)\n\t\t\t{\n\t\t\t\tremainingWidth = 0;\n\t\t\t}\n\t\t\tdo\n\t\t\t{\n\t\t\t\tvar needsAnotherPass:Boolean = false;\n\t\t\t\tvar percentToPixels:Number = remainingWidth / totalPercentWidth;\n\t\t\t\tfor(i = 0; i < pushIndex; i++)\n\t\t\t\t{\n\t\t\t\t\tlayoutItem = ILayoutDisplayObject(this._discoveredItemsCache[i]);\n\t\t\t\t\tif(!layoutItem)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tlayoutData = HorizontalLayoutData(layoutItem.layoutData);\n\t\t\t\t\tpercentWidth = layoutData.percentWidth;\n\t\t\t\t\tif(percentWidth < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tpercentWidth = 0;\n\t\t\t\t\t}\n\t\t\t\t\tvar itemWidth:Number = percentToPixels * percentWidth;\n\t\t\t\t\tif(layoutItem is IFeathersControl)\n\t\t\t\t\t{\n\t\t\t\t\t\tfeathersItem = IFeathersControl(layoutItem);\n\t\t\t\t\t\tvar itemMinWidth:Number = feathersItem.explicitMinWidth;\n\t\t\t\t\t\tif(itemMinWidth > remainingWidth)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//we try to respect the item's minimum width, but if\n\t\t\t\t\t\t\t//it's larger than the remaining space, we need to\n\t\t\t\t\t\t\t//force it to fit\n\t\t\t\t\t\t\titemMinWidth = remainingWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(itemWidth < itemMinWidth)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titemWidth = itemMinWidth;\n\t\t\t\t\t\t\tremainingWidth -= itemWidth;\n\t\t\t\t\t\t\ttotalPercentWidth -= percentWidth;\n\t\t\t\t\t\t\tthis._discoveredItemsCache[i] = null;\n\t\t\t\t\t\t\tneedsAnotherPass = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//we don't check maxWidth here because it is used in\n\t\t\t\t\t\t//validateItems() for performance optimization, so it\n\t\t\t\t\t\t//isn't a real maximum\n\t\t\t\t\t}\n\t\t\t\t\tlayoutItem.width = itemWidth;\n\t\t\t\t\tif(layoutItem is IValidating)\n\t\t\t\t\t{\n\t\t\t\t\t\t//changing the width of the item may cause its height\n\t\t\t\t\t\t//to change, so we need to validate. the height is\n\t\t\t\t\t\t//needed for measurement.\n\t\t\t\t\t\tIValidating(layoutItem).validate();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile(needsAnotherPass);\n\t\t\tthis._discoveredItemsCache.length = 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function calculateMaxScrollXOfIndex(index:int, items:Vector.<DisplayObject>, x:Number, y:Number, width:Number, height:Number):Number\n\t\t{\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthis.prepareTypicalItem(height - this._paddingTop - this._paddingBottom);\n\t\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\t\t\t}\n\n\t\t\tvar hasFirstGap:Boolean = this._firstGap === this._firstGap; //!isNaN\n\t\t\tvar hasLastGap:Boolean = this._lastGap === this._lastGap; //!isNaN\n\t\t\tvar positionX:Number = x + this._paddingLeft;\n\t\t\tvar lastWidth:Number = 0;\n\t\t\tvar gap:Number = this._gap;\n\t\t\tvar startIndexOffset:int = 0;\n\t\t\tvar endIndexOffset:Number = 0;\n\t\t\tvar itemCount:int = items.length;\n\t\t\tvar totalItemCount:int = itemCount;\n\t\t\tif(this._useVirtualLayout && !this._hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\ttotalItemCount += this._beforeVirtualizedItemCount + this._afterVirtualizedItemCount;\n\t\t\t\tif(index < this._beforeVirtualizedItemCount)\n\t\t\t\t{\n\t\t\t\t\t//this makes it skip the loop below\n\t\t\t\t\tstartIndexOffset = index + 1;\n\t\t\t\t\tlastWidth = calculatedTypicalItemWidth;\n\t\t\t\t\tgap = this._gap;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tstartIndexOffset = this._beforeVirtualizedItemCount;\n\t\t\t\t\tendIndexOffset = index - items.length - this._beforeVirtualizedItemCount + 1;\n\t\t\t\t\tif(endIndexOffset < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tendIndexOffset = 0;\n\t\t\t\t\t}\n\t\t\t\t\tpositionX += (endIndexOffset * (calculatedTypicalItemWidth + this._gap));\n\t\t\t\t}\n\t\t\t\tpositionX += (startIndexOffset * (calculatedTypicalItemWidth + this._gap));\n\t\t\t}\n\t\t\tindex -= (startIndexOffset + endIndexOffset);\n\t\t\tvar secondToLastIndex:int = totalItemCount - 2;\n\t\t\tfor(var i:int = 0; i <= index; i++)\n\t\t\t{\n\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\tvar iNormalized:int = i + startIndexOffset;\n\t\t\t\tif(hasFirstGap && iNormalized == 0)\n\t\t\t\t{\n\t\t\t\t\tgap = this._firstGap;\n\t\t\t\t}\n\t\t\t\telse if(hasLastGap && iNormalized > 0 && iNormalized == secondToLastIndex)\n\t\t\t\t{\n\t\t\t\t\tgap = this._lastGap;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tgap = this._gap;\n\t\t\t\t}\n\t\t\t\tif(this._useVirtualLayout && this._hasVariableItemDimensions)\n\t\t\t\t{\n\t\t\t\t\tvar cachedWidth:Number = this._virtualCache[iNormalized];\n\t\t\t\t}\n\t\t\t\tif(this._useVirtualLayout && !item)\n\t\t\t\t{\n\t\t\t\t\tif(!this._hasVariableItemDimensions ||\n\t\t\t\t\t\tcachedWidth !== cachedWidth) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\tlastWidth = calculatedTypicalItemWidth;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tlastWidth = cachedWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar itemWidth:Number = item.width;\n\t\t\t\t\tif(this._useVirtualLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._hasVariableItemDimensions)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(itemWidth != cachedWidth)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis._virtualCache[iNormalized] = itemWidth;\n\t\t\t\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(calculatedTypicalItemWidth >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.width = itemWidth = calculatedTypicalItemWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlastWidth = itemWidth;\n\t\t\t\t}\n\t\t\t\tpositionX += lastWidth + gap;\n\t\t\t}\n\t\t\tpositionX -= (lastWidth + gap);\n\t\t\treturn positionX;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/HorizontalLayoutData.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\n\t/**\n\t * @inheritDoc\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Extra, optional data used by an <code>HorizontalLayout</code> instance to\n\t * position and size a display object.\n\t *\n\t * @see HorizontalLayout\n\t * @see ILayoutDisplayObject\n\t *\n\t * @productversion Feathers 1.3.0\n\t */\n\tpublic class HorizontalLayoutData extends EventDispatcher implements ILayoutData\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function HorizontalLayoutData(percentWidth:Number = NaN, percentHeight:Number = NaN)\n\t\t{\n\t\t\tthis._percentWidth = percentWidth;\n\t\t\tthis._percentHeight = percentHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _percentWidth:Number;\n\n\t\t/**\n\t\t * The width of the layout object, as a percentage of the container's\n\t\t * width. The container will calculate the sum of all of its children\n\t\t * with explicit pixel widths, and then the remaining space will be\n\t\t * distributed to children with percent widths.\n\t\t *\n\t\t * <p>A percentage may be specified in the range from <code>0</code>\n\t\t * to <code>100</code>. If the value is set to <code>NaN</code>, this\n\t\t * property is ignored. It will also be ignored when the\n\t\t * <code>useVirtualLayout</code> property of the\n\t\t * <code>HorizontalLayout</code> is set to <code>false</code>.</p>\n\t\t *\n\t\t * @default NaN\n\t\t */\n\t\tpublic function get percentWidth():Number\n\t\t{\n\t\t\treturn this._percentWidth;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set percentWidth(value:Number):void\n\t\t{\n\t\t\tif(this._percentWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._percentWidth = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _percentHeight:Number;\n\n\t\t/**\n\t\t * The height of the layout object, as a percentage of the container's\n\t\t * height.\n\t\t *\n\t\t * <p>A percentage may be specified in the range from <code>0</code>\n\t\t * to <code>100</code>. If the value is set to <code>NaN</code>, this\n\t\t * property is ignored.</p>\n\t\t *\n\t\t * <p>Performance tip: If all items in your layout will have 100%\n\t\t * height, it's better to set the <code>verticalAlign</code> property of\n\t\t * the <code>HorizontalLayout</code> to\n\t\t * <code>VerticalAlign.JUSTIFY</code>.</p>\n\t\t *\n\t\t * @default NaN\n\t\t *\n\t\t * @see feathers.layout.VerticalAlign.JUSTIFY\n\t\t */\n\t\tpublic function get percentHeight():Number\n\t\t{\n\t\t\treturn this._percentHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set percentHeight(value:Number):void\n\t\t{\n\t\t\tif(this._percentHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._percentHeight = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/HorizontalSpinnerLayout.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IValidating;\n\timport feathers.layout.HorizontalAlign;\n\n\timport flash.errors.IllegalOperationError;\n\timport flash.geom.Point;\n\timport flash.geom.Rectangle;\n\timport flash.ui.Keyboard;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\n\t/**\n\t * Dispatched when a property of the layout changes, indicating that a\n\t * redraw is probably needed.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * For use with the <code>SpinnerList</code> component, positions items from\n\t * left to right in a single row and repeats infinitely.\n\t *\n\t * @see ../../../help/horizontal-spinner-layout.html How to use HorizontalSpinnerLayout with the Feathers SpinnerList component\n\t *\n\t * @productversion Feathers 2.2.0\n\t */\n\tpublic class HorizontalSpinnerLayout extends EventDispatcher implements ISpinnerLayout, ITrimmedVirtualLayout\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function HorizontalSpinnerLayout()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _discoveredItemsCache:Vector.<DisplayObject> = new <DisplayObject>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _gap:Number = 0;\n\n\t\t/**\n\t\t * The space, in pixels, between items.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get gap():Number\n\t\t{\n\t\t\treturn this._gap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set gap(value:Number):void\n\t\t{\n\t\t\tif(this._gap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._gap = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * Quickly sets all padding properties to the same value. The\n\t\t * <code>padding</code> getter always returns the value of\n\t\t * <code>paddingTop</code>, but the other padding values may be\n\t\t * different.\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #paddingTop\n\t\t * @see #paddingBottom\n\t\t */\n\t\tpublic function get padding():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set padding(value:Number):void\n\t\t{\n\t\t\tthis.paddingTop = value;\n\t\t\tthis.paddingBottom = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingTop:Number = 0;\n\n\t\t/**\n\t\t * The minimum space, in pixels, above the items.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingTop():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingTop(value:Number):void\n\t\t{\n\t\t\tif(this._paddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingTop = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingRight:Number = 0;\n\n\t\t/**\n\t\t * The minimum space, in pixels, to the right of the items, if they\n\t\t * do not repeat. If items repeat, <code>paddingRight</code> will\n\t\t * only be used if <code>horizontalAlign</code> is set to\n\t\t * <code>HorizontalAlign.RIGHT</code>. In this case, the first item,\n\t\t * starting from the right, will be offset by the value of\n\t\t * <code>paddingRight</code>.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingRight():Number\n\t\t{\n\t\t\treturn this._paddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this._paddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingRight = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingBottom:Number = 0;\n\n\t\t/**\n\t\t * The minimum space, in pixels, below the items.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingBottom():Number\n\t\t{\n\t\t\treturn this._paddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this._paddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingBottom = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingLeft:Number = 0;\n\n\t\t/**\n\t\t * The minimum space, in pixels, to the right of the items, if they\n\t\t * do not repeat. If items repeat, <code>paddingLeft</code> will\n\t\t * only be used if <code>horizontalAlign</code> is set to\n\t\t * <code>HorizontalAlign.LEFT</code>. In this case, the first item,\n\t\t * starting from the left, will be offset by the value of\n\t\t * <code>paddingLeft</code>.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this._paddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingLeft = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalAlign:String = HorizontalAlign.CENTER;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"left,center,right\")]\n\t\t/**\n\t\t * The alignment of the items horizontally, on the x-axis.\n\t\t *\n\t\t * <p><strong>Note:</strong> The <code>HorizontalAlign.JUSTIFY</code>\n\t\t * constant is not supported.</p>\n\t\t *\n\t\t * @default feathers.layout.HorizontalAlign.CENTER\n\t\t *\n\t\t * @see feathers.layout.HorizontalAlign#LEFT\n\t\t * @see feathers.layout.HorizontalAlign#CENTER\n\t\t * @see feathers.layout.HorizontalAlign#RIGHT\n\t\t */\n\t\tpublic function get horizontalAlign():String\n\t\t{\n\t\t\treturn this._horizontalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalAlign(value:String):void\n\t\t{\n\t\t\tif(this._horizontalAlign == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalAlign = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalAlign:String = VerticalAlign.TOP;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"top,middle,bottom,justify\")]\n\t\t/**\n\t\t * The alignment of the items vertically, on the y-axis.\n\t\t *\n\t\t * @default feathers.layout.VerticalAlign.TOP\n\t\t *\n\t\t * @see feathers.layout.VerticalAlign#TOP\n\t\t * @see feathers.layout.VerticalAlign#MIDDLE\n\t\t * @see feathers.layout.VerticalAlign#BOTTOM\n\t\t * @see feathers.layout.VerticalAlign#JUSTIFY\n\t\t */\n\t\tpublic function get verticalAlign():String\n\t\t{\n\t\t\treturn this._verticalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalAlign(value:String):void\n\t\t{\n\t\t\tif(this._verticalAlign == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalAlign = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _useVirtualLayout:Boolean = true;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic function get useVirtualLayout():Boolean\n\t\t{\n\t\t\treturn this._useVirtualLayout;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set useVirtualLayout(value:Boolean):void\n\t\t{\n\t\t\tif(this._useVirtualLayout == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._useVirtualLayout = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _requestedColumnCount:int = 0;\n\n\t\t/**\n\t\t * Requests that the layout set the view port dimensions to display a\n\t\t * specific number of columns (plus gaps and padding), if possible. If\n\t\t * the explicit width of the view port is set, then this value will be\n\t\t * ignored. If the view port's minimum and/or maximum width are set,\n\t\t * the actual number of visible columns may be adjusted to meet those\n\t\t * requirements. Set this value to <code>0</code> to display as many\n\t\t * columns as possible.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get requestedColumnCount():int\n\t\t{\n\t\t\treturn this._requestedColumnCount;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set requestedColumnCount(value:int):void\n\t\t{\n\t\t\tif(value < 0)\n\t\t\t{\n\t\t\t\tthrow RangeError(\"requestedColumnCount requires a value >= 0\");\n\t\t\t}\n\t\t\tif(this._requestedColumnCount == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._requestedColumnCount = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _beforeVirtualizedItemCount:int = 0;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get beforeVirtualizedItemCount():int\n\t\t{\n\t\t\treturn this._beforeVirtualizedItemCount;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set beforeVirtualizedItemCount(value:int):void\n\t\t{\n\t\t\tif(this._beforeVirtualizedItemCount == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._beforeVirtualizedItemCount = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _afterVirtualizedItemCount:int = 0;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get afterVirtualizedItemCount():int\n\t\t{\n\t\t\treturn this._afterVirtualizedItemCount;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set afterVirtualizedItemCount(value:int):void\n\t\t{\n\t\t\tif(this._afterVirtualizedItemCount == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._afterVirtualizedItemCount = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _typicalItem:DisplayObject;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @see #resetTypicalItemDimensionsOnMeasure\n\t\t * @see #typicalItemWidth\n\t\t * @see #typicalItemHeight\n\t\t */\n\t\tpublic function get typicalItem():DisplayObject\n\t\t{\n\t\t\treturn this._typicalItem;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set typicalItem(value:DisplayObject):void\n\t\t{\n\t\t\tif(this._typicalItem == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._typicalItem = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _resetTypicalItemDimensionsOnMeasure:Boolean = false;\n\n\t\t/**\n\t\t * If set to <code>true</code>, the width and height of the\n\t\t * <code>typicalItem</code> will be reset to <code>typicalItemWidth</code>\n\t\t * and <code>typicalItemHeight</code>, respectively, whenever the\n\t\t * typical item needs to be measured. The measured dimensions of the\n\t\t * typical item are used to fill in the blanks of a virtualized layout\n\t\t * for virtual items that don't have their own display objects to\n\t\t * measure yet.\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see #typicalItemWidth\n\t\t * @see #typicalItemHeight\n\t\t * @see #typicalItem\n\t\t */\n\t\tpublic function get resetTypicalItemDimensionsOnMeasure():Boolean\n\t\t{\n\t\t\treturn this._resetTypicalItemDimensionsOnMeasure;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set resetTypicalItemDimensionsOnMeasure(value:Boolean):void\n\t\t{\n\t\t\tif(this._resetTypicalItemDimensionsOnMeasure == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._resetTypicalItemDimensionsOnMeasure = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _typicalItemWidth:Number = NaN;\n\n\t\t/**\n\t\t * Used to reset the width, in pixels, of the <code>typicalItem</code>\n\t\t * for measurement. The measured dimensions of the typical item are used\n\t\t * to fill in the blanks of a virtualized layout for virtual items that\n\t\t * don't have their own display objects to measure yet.\n\t\t *\n\t\t * <p>This value is only used when <code>resetTypicalItemDimensionsOnMeasure</code>\n\t\t * is set to <code>true</code>. If <code>resetTypicalItemDimensionsOnMeasure</code>\n\t\t * is set to <code>false</code>, this value will be ignored and the\n\t\t * <code>typicalItem</code> dimensions will not be reset before\n\t\t * measurement.</p>\n\t\t *\n\t\t * <p>If <code>typicalItemWidth</code> is set to <code>NaN</code>, the\n\t\t * typical item will auto-size itself to its preferred width. If you\n\t\t * pass a valid <code>Number</code> value, the typical item's width will\n\t\t * be set to a fixed size. May be used in combination with\n\t\t * <code>typicalItemHeight</code>.</p>\n\t\t *\n\t\t * @default NaN\n\t\t *\n\t\t * @see #resetTypicalItemDimensionsOnMeasure\n\t\t * @see #typicalItemHeight\n\t\t * @see #typicalItem\n\t\t */\n\t\tpublic function get typicalItemWidth():Number\n\t\t{\n\t\t\treturn this._typicalItemWidth;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set typicalItemWidth(value:Number):void\n\t\t{\n\t\t\tif(this._typicalItemWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._typicalItemWidth = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _typicalItemHeight:Number = NaN;\n\n\t\t/**\n\t\t * Used to reset the height, in pixels, of the <code>typicalItem</code>\n\t\t * for measurement. The measured dimensions of the typical item are used\n\t\t * to fill in the blanks of a virtualized layout for virtual items that\n\t\t * don't have their own display objects to measure yet.\n\t\t *\n\t\t * <p>This value is only used when <code>resetTypicalItemDimensionsOnMeasure</code>\n\t\t * is set to <code>true</code>. If <code>resetTypicalItemDimensionsOnMeasure</code>\n\t\t * is set to <code>false</code>, this value will be ignored and the\n\t\t * <code>typicalItem</code> dimensions will not be reset before\n\t\t * measurement.</p>\n\t\t *\n\t\t * <p>If <code>typicalItemHeight</code> is set to <code>NaN</code>, the\n\t\t * typical item will auto-size itself to its preferred height. If you\n\t\t * pass a valid <code>Number</code> value, the typical item's height will\n\t\t * be set to a fixed size. May be used in combination with\n\t\t * <code>typicalItemWidth</code>.</p>\n\t\t *\n\t\t * @default NaN\n\t\t *\n\t\t * @see #resetTypicalItemDimensionsOnMeasure\n\t\t * @see #typicalItemWidth\n\t\t * @see #typicalItem\n\t\t */\n\t\tpublic function get typicalItemHeight():Number\n\t\t{\n\t\t\treturn this._typicalItemHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set typicalItemHeight(value:Number):void\n\t\t{\n\t\t\tif(this._typicalItemHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._typicalItemHeight = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _repeatItems:Boolean = true;\n\n\t\t/**\n\t\t * If set to <code>true</code>, the layout will repeat the items\n\t\t * infinitely, if there are enough items to allow this behavior. If the\n\t\t * total width of the items is smaller than the width of the view port,\n\t\t * the items cannot repeat.\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic function get repeatItems():Boolean\n\t\t{\n\t\t\treturn this._repeatItems;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set repeatItems(value:Boolean):void\n\t\t{\n\t\t\tif(this._repeatItems == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._repeatItems = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.layout.ISpinnerLayout#snapInterval\n\t\t */\n\t\tpublic function get snapInterval():Number\n\t\t{\n\t\t\tif(this._typicalItem === null)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn this._typicalItem.width + this._gap;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get requiresLayoutOnScroll():Boolean\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectionBounds:Rectangle = new Rectangle();\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get selectionBounds():Rectangle\n\t\t{\n\t\t\treturn this._selectionBounds;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function layout(items:Vector.<DisplayObject>, viewPortBounds:ViewPortBounds = null, result:LayoutBoundsResult = null):LayoutBoundsResult\n\t\t{\n\t\t\t//this function is very long because it may be called every frame,\n\t\t\t//in some situations. testing revealed that splitting this function\n\t\t\t//into separate, smaller functions affected performance.\n\t\t\t//since the SWC compiler cannot inline functions, we can't use that\n\t\t\t//feature either.\n\n\t\t\t//since viewPortBounds can be null, we may need to provide some defaults\n\t\t\tvar scrollX:Number = viewPortBounds ? viewPortBounds.scrollX : 0;\n\t\t\tvar scrollY:Number = viewPortBounds ? viewPortBounds.scrollY : 0;\n\t\t\tvar boundsX:Number = viewPortBounds ? viewPortBounds.x : 0;\n\t\t\tvar boundsY:Number = viewPortBounds ? viewPortBounds.y : 0;\n\t\t\tvar minWidth:Number = viewPortBounds ? viewPortBounds.minWidth : 0;\n\t\t\tvar minHeight:Number = viewPortBounds ? viewPortBounds.minHeight : 0;\n\t\t\tvar maxWidth:Number = viewPortBounds ? viewPortBounds.maxWidth : Number.POSITIVE_INFINITY;\n\t\t\tvar maxHeight:Number = viewPortBounds ? viewPortBounds.maxHeight : Number.POSITIVE_INFINITY;\n\t\t\tvar explicitWidth:Number = viewPortBounds ? viewPortBounds.explicitWidth : NaN;\n\t\t\tvar explicitHeight:Number = viewPortBounds ? viewPortBounds.explicitHeight : NaN;\n\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\t//if the layout is virtualized, we'll need the dimensions of the\n\t\t\t\t//typical item so that we have fallback values when an item is null\n\t\t\t\tthis.prepareTypicalItem(explicitHeight - this._paddingTop - this._paddingBottom);\n\t\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\t\t\t}\n\n\t\t\tif(!this._useVirtualLayout || this._verticalAlign != VerticalAlign.JUSTIFY ||\n\t\t\t\texplicitHeight !== explicitHeight) //isNaN\n\t\t\t{\n\t\t\t\t//in some cases, we may need to validate all of the items so\n\t\t\t\t//that we can use their dimensions below.\n\t\t\t\tthis.validateItems(items, explicitWidth, explicitHeight - this._paddingTop - this._paddingBottom);\n\t\t\t}\n\n\t\t\t//this section prepares some variables needed for the following loop\n\t\t\tvar maxItemHeight:Number = this._useVirtualLayout ? calculatedTypicalItemHeight : 0;\n\t\t\tvar positionX:Number = boundsX;\n\t\t\tvar gap:Number = this._gap;\n\t\t\tvar itemCount:int = items.length;\n\t\t\tvar totalItemCount:int = itemCount;\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\t//if the layout is virtualized, and the items all have the same\n\t\t\t\t//width, we can make our loops smaller by skipping some items\n\t\t\t\t//at the beginning and end. this improves performance.\n\n\t\t\t\tif(this._beforeVirtualizedItemCount > 0)\n\t\t\t\t{\n\t\t\t\t\t//this value may be negative, which means that we're\n\t\t\t\t\t//repeating items. we don't want to include this value in\n\t\t\t\t\t//the total count, but we'll use it elsewhere.\n\t\t\t\t\ttotalItemCount += this._beforeVirtualizedItemCount;\n\t\t\t\t}\n\t\t\t\ttotalItemCount += this._afterVirtualizedItemCount;\n\t\t\t\tpositionX += (this._beforeVirtualizedItemCount * (calculatedTypicalItemWidth + gap));\n\t\t\t}\n\t\t\t//this cache is used to save non-null items in virtual layouts. by\n\t\t\t//using a smaller array, we can improve performance by spending less\n\t\t\t//time in the upcoming loops.\n\t\t\tthis._discoveredItemsCache.length = 0;\n\t\t\tvar discoveredItemsCacheLastIndex:int = 0;\n\n\t\t\t//this first loop sets the x position of items, and it calculates\n\t\t\t//the total width of all items\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\tif(item)\n\t\t\t\t{\n\t\t\t\t\t//we get here if the item isn't null. it is never null if\n\t\t\t\t\t//the layout isn't virtualized.\n\t\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\titem.x = item.pivotX + positionX;\n\t\t\t\t\titem.width = calculatedTypicalItemWidth;\n\t\t\t\t\tvar itemHeight:Number = item.height;\n\t\t\t\t\t//we compare with > instead of Math.max() because the rest\n\t\t\t\t\t//arguments on Math.max() cause extra garbage collection and\n\t\t\t\t\t//hurt performance\n\t\t\t\t\tif(itemHeight > maxItemHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\t//we need to know the maximum height of the items in the\n\t\t\t\t\t\t//case where the height of the view port needs to be\n\t\t\t\t\t\t//calculated by the layout.\n\t\t\t\t\t\tmaxItemHeight = itemHeight;\n\t\t\t\t\t}\n\t\t\t\t\tif(this._useVirtualLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._discoveredItemsCache[discoveredItemsCacheLastIndex] = item;\n\t\t\t\t\t\tdiscoveredItemsCacheLastIndex++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tpositionX += calculatedTypicalItemWidth + gap;\n\t\t\t}\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\t//finish the final calculation of the x position so that it can\n\t\t\t\t//be used for the total width of all items\n\t\t\t\tpositionX += (this._afterVirtualizedItemCount * (calculatedTypicalItemWidth + gap));\n\t\t\t}\n\n\t\t\t//this array will contain all items that are not null. see the\n\t\t\t//comment above where the discoveredItemsCache is initialized for\n\t\t\t//details about why this is important.\n\t\t\tvar discoveredItems:Vector.<DisplayObject> = this._useVirtualLayout ? this._discoveredItemsCache : items;\n\t\t\tvar discoveredItemCount:int = discoveredItems.length;\n\n\t\t\tvar totalHeight:Number = maxItemHeight + this._paddingTop + this._paddingBottom;\n\t\t\t//the available height is the height of the viewport. if the explicit\n\t\t\t//height is NaN, we need to calculate the viewport height ourselves\n\t\t\t//based on the total height of all items.\n\t\t\tvar availableHeight:Number = explicitHeight;\n\t\t\tif(availableHeight !== availableHeight) //isNaN\n\t\t\t{\n\t\t\t\tavailableHeight = totalHeight;\n\t\t\t\tif(availableHeight < minHeight)\n\t\t\t\t{\n\t\t\t\t\tavailableHeight = minHeight;\n\t\t\t\t}\n\t\t\t\telse if(availableHeight > maxHeight)\n\t\t\t\t{\n\t\t\t\t\tavailableHeight = maxHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//this is the total width of all items\n\t\t\tvar totalWidth:Number = positionX - gap - boundsX;\n\t\t\tif(this._useVirtualLayout && this._beforeVirtualizedItemCount < 0)\n\t\t\t{\n\t\t\t\ttotalWidth -= (this._beforeVirtualizedItemCount * (calculatedTypicalItemWidth + gap));\n\t\t\t}\n\t\t\t//the available width is the width of the viewport. if the explicit\n\t\t\t//width is NaN, we need to calculate the viewport width ourselves\n\t\t\t//based on the total width of all items.\n\t\t\tvar availableWidth:Number = explicitWidth;\n\t\t\tif(availableWidth !== availableWidth) //isNaN\n\t\t\t{\n\t\t\t\tif(this._requestedColumnCount > 0)\n\t\t\t\t{\n\t\t\t\t\tavailableWidth = this._requestedColumnCount * (calculatedTypicalItemWidth + gap) - gap;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tavailableWidth = totalWidth;\n\t\t\t\t}\n\t\t\t\tif(availableWidth < minWidth)\n\t\t\t\t{\n\t\t\t\t\tavailableWidth = minWidth;\n\t\t\t\t}\n\t\t\t\telse if(availableWidth > maxWidth)\n\t\t\t\t{\n\t\t\t\t\tavailableWidth = maxWidth;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//we add one extra here because the first item renderer in view may\n\t\t\t//be partially obscured, which would reveal an extra item renderer.\n\t\t\tvar maxVisibleTypicalItemCount:int = Math.ceil(availableWidth / (calculatedTypicalItemWidth + gap)) + 1;\n\t\t\tvar minTotalWidthForRepeat:Number = maxVisibleTypicalItemCount * (calculatedTypicalItemWidth + gap) - gap;\n\t\t\tvar canRepeatItems:Boolean = this._repeatItems && totalWidth >= minTotalWidthForRepeat;\n\t\t\tif(canRepeatItems)\n\t\t\t{\n\t\t\t\ttotalWidth += gap;\n\t\t\t}\n\n\t\t\t//in this section, we handle horizontal alignment\n\t\t\tvar horizontalAlignOffsetX:Number = this._paddingLeft;\n\t\t\tif(this._horizontalAlign === HorizontalAlign.RIGHT)\n\t\t\t{\n\t\t\t\thorizontalAlignOffsetX = availableWidth - this._paddingRight - calculatedTypicalItemWidth;\n\t\t\t}\n\t\t\telse if(this._horizontalAlign === HorizontalAlign.CENTER)\n\t\t\t{\n\t\t\t\thorizontalAlignOffsetX = this._paddingLeft + Math.round((availableWidth - this._paddingLeft - this._paddingRight - calculatedTypicalItemWidth) / 2);\n\t\t\t}\n\t\t\tif(!canRepeatItems)\n\t\t\t{\n\t\t\t\ttotalWidth += horizontalAlignOffsetX + (availableWidth - calculatedTypicalItemWidth - horizontalAlignOffsetX);\n\t\t\t}\n\t\t\tif(horizontalAlignOffsetX != 0)\n\t\t\t{\n\t\t\t\tfor(i = 0; i < discoveredItemCount; i++)\n\t\t\t\t{\n\t\t\t\t\titem = discoveredItems[i];\n\t\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\titem.x += horizontalAlignOffsetX;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor(i = 0; i < discoveredItemCount; i++)\n\t\t\t{\n\t\t\t\titem = discoveredItems[i];\n\t\t\t\tvar layoutItem:ILayoutDisplayObject = item as ILayoutDisplayObject;\n\t\t\t\tif(layoutItem && !layoutItem.includeInLayout)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t//if we're repeating items, then we may need to adjust the x\n\t\t\t\t//position of some items so that they appear inside the viewport\n\t\t\t\tif(canRepeatItems)\n\t\t\t\t{\n\t\t\t\t\tvar adjustedScrollX:Number = scrollX - horizontalAlignOffsetX;\n\t\t\t\t\tif(adjustedScrollX > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar multiplier:int = int((adjustedScrollX + availableWidth) / totalWidth);\n\t\t\t\t\t\tif(useVirtualLayout && this._beforeVirtualizedItemCount < 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmultiplier++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\titem.x += totalWidth * multiplier;\n\t\t\t\t\t\tif(item.x >= (scrollX + availableWidth))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.x -= totalWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(adjustedScrollX < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\titem.x += totalWidth * (int(adjustedScrollX / totalWidth) - 1);\n\t\t\t\t\t\tif((item.x + item.width) < scrollX)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.x += totalWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//in this section, we handle vertical alignment\n\t\t\t\tif(this._verticalAlign == VerticalAlign.JUSTIFY)\n\t\t\t\t{\n\t\t\t\t\t//if we justify items vertically, we can skip percent height\n\t\t\t\t\titem.y = item.pivotY + boundsY + this._paddingTop;\n\t\t\t\t\titem.height = availableHeight - this._paddingTop - this._paddingBottom;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//handle all other vertical alignment values (we handled\n\t\t\t\t\t//justify already). the y position of all items is set here.\n\t\t\t\t\tvar verticalAlignHeight:Number = availableHeight;\n\t\t\t\t\tif(totalHeight > verticalAlignHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tverticalAlignHeight = totalHeight;\n\t\t\t\t\t}\n\t\t\t\t\tswitch(this._verticalAlign)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase VerticalAlign.BOTTOM:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.y = item.pivotY + boundsY + verticalAlignHeight - this._paddingBottom - item.height;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase VerticalAlign.MIDDLE:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//round to the nearest pixel when dividing by 2 to\n\t\t\t\t\t\t\t//align in the middle\n\t\t\t\t\t\t\titem.y = item.pivotY + boundsY + this._paddingTop + Math.round((verticalAlignHeight - this._paddingTop - this._paddingBottom - item.height) / 2);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdefault: //top\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.y = item.pivotY + boundsY + this._paddingTop;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//we don't want to keep a reference to any of the items, so clear\n\t\t\t//this cache\n\t\t\tthis._discoveredItemsCache.length = 0;\n\n\t\t\t//calculate the bounds of the selection rectangle\n\t\t\tthis._selectionBounds.x = horizontalAlignOffsetX;\n\t\t\tthis._selectionBounds.y = 0;\n\t\t\tthis._selectionBounds.width = calculatedTypicalItemWidth;\n\t\t\tthis._selectionBounds.height = availableHeight;\n\n\t\t\t//finally, we want to calculate the result so that the container\n\t\t\t//can use it to adjust its viewport and determine the minimum and\n\t\t\t//maximum scroll positions (if needed)\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new LayoutBoundsResult();\n\t\t\t}\n\t\t\tif(canRepeatItems)\n\t\t\t{\n\t\t\t\tresult.contentX = Number.NEGATIVE_INFINITY;\n\t\t\t\tresult.contentWidth = Number.POSITIVE_INFINITY;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult.contentX = 0;\n\t\t\t\tresult.contentWidth = totalWidth;\n\t\t\t}\n\t\t\tresult.contentY = 0;\n\t\t\tresult.contentHeight = this._verticalAlign == VerticalAlign.JUSTIFY ? availableHeight : totalHeight;\n\t\t\tresult.viewPortWidth = availableWidth;\n\t\t\tresult.viewPortHeight = availableHeight;\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function measureViewPort(itemCount:int, viewPortBounds:ViewPortBounds = null, result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\t\t\tif(!this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"measureViewPort() may be called only if useVirtualLayout is true.\");\n\t\t\t}\n\n\t\t\tvar explicitWidth:Number = viewPortBounds ? viewPortBounds.explicitWidth : NaN;\n\t\t\tvar explicitHeight:Number = viewPortBounds ? viewPortBounds.explicitHeight : NaN;\n\t\t\tvar needsWidth:Boolean = explicitWidth !== explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = explicitHeight !== explicitHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight)\n\t\t\t{\n\t\t\t\tresult.x = explicitWidth;\n\t\t\t\tresult.y = explicitHeight;\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tvar minWidth:Number = viewPortBounds ? viewPortBounds.minWidth : 0;\n\t\t\tvar minHeight:Number = viewPortBounds ? viewPortBounds.minHeight : 0;\n\t\t\tvar maxWidth:Number = viewPortBounds ? viewPortBounds.maxWidth : Number.POSITIVE_INFINITY;\n\t\t\tvar maxHeight:Number = viewPortBounds ? viewPortBounds.maxHeight : Number.POSITIVE_INFINITY;\n\n\t\t\tthis.prepareTypicalItem(explicitHeight - this._paddingTop - this._paddingBottom);\n\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\n\t\t\tvar gap:Number = this._gap;\n\t\t\tvar positionX:Number = 0;\n\n\t\t\tvar maxItemHeight:Number = calculatedTypicalItemHeight;\n\t\t\tpositionX += ((calculatedTypicalItemWidth + gap) * itemCount);\n\t\t\tpositionX -= gap;\n\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tif(this._requestedColumnCount > 0)\n\t\t\t\t{\n\t\t\t\t\tvar resultWidth:Number = (calculatedTypicalItemWidth + gap) * this._requestedColumnCount - gap;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tresultWidth = positionX;\n\t\t\t\t}\n\t\t\t\tif(resultWidth < minWidth)\n\t\t\t\t{\n\t\t\t\t\tresultWidth = minWidth;\n\t\t\t\t}\n\t\t\t\telse if(resultWidth > maxWidth)\n\t\t\t\t{\n\t\t\t\t\tresultWidth = maxWidth;\n\t\t\t\t}\n\t\t\t\tresult.x = resultWidth;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult.x = explicitWidth;\n\t\t\t}\n\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tvar resultHeight:Number = maxItemHeight + this._paddingTop + this._paddingBottom;\n\t\t\t\tif(resultHeight < minHeight)\n\t\t\t\t{\n\t\t\t\t\tresultHeight = minHeight;\n\t\t\t\t}\n\t\t\t\telse if(resultHeight > maxHeight)\n\t\t\t\t{\n\t\t\t\t\tresultHeight = maxHeight;\n\t\t\t\t}\n\t\t\t\tresult.y = resultHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult.y = explicitHeight;\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getVisibleIndicesAtScrollPosition(scrollX:Number, scrollY:Number, width:Number, height:Number, itemCount:int, result:Vector.<int> = null):Vector.<int>\n\t\t{\n\t\t\tif(result)\n\t\t\t{\n\t\t\t\tresult.length = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult = new <int>[];\n\t\t\t}\n\t\t\tif(!this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"getVisibleIndicesAtScrollPosition() may be called only if useVirtualLayout is true.\");\n\t\t\t}\n\n\t\t\tthis.prepareTypicalItem(height - this._paddingTop - this._paddingBottom);\n\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\tvar gap:Number = this._gap;\n\n\t\t\tvar resultLastIndex:int = 0;\n\n\t\t\tvar totalItemWidth:Number = itemCount * (calculatedTypicalItemWidth + gap) - gap;\n\n\t\t\t//the actual code that figures out which items are visible assumes\n\t\t\t//that alignment is left. to make it work with other alignments, we\n\t\t\t//can simply adjust the scroll position!\n\t\t\tif(this._horizontalAlign === HorizontalAlign.CENTER)\n\t\t\t{\n\t\t\t\tscrollX -= (this._paddingLeft + Math.round((width - calculatedTypicalItemWidth) / 2));\n\t\t\t}\n\t\t\telse if(this._horizontalAlign === HorizontalAlign.RIGHT)\n\t\t\t{\n\t\t\t\tscrollX -= (width - calculatedTypicalItemWidth - this._paddingRight);\n\t\t\t}\n\t\t\telse //left\n\t\t\t{\n\t\t\t\tscrollX -= this._paddingLeft;\n\t\t\t}\n\n\t\t\t//we add one extra here because the first item renderer in view may\n\t\t\t//be partially obscured, which would reveal an extra item renderer.\n\t\t\tvar maxVisibleTypicalItemCount:int = Math.ceil(width / (calculatedTypicalItemWidth + gap)) + 1;\n\t\t\tvar minTotalWidthForRepeat:Number = maxVisibleTypicalItemCount * (calculatedTypicalItemWidth + gap) - gap;\n\t\t\tvar canRepeatItems:Boolean = this._repeatItems && totalItemWidth >= minTotalWidthForRepeat;\n\t\t\tif(canRepeatItems)\n\t\t\t{\n\t\t\t\t//if we're repeating, then there's an extra gap\n\t\t\t\ttotalItemWidth += gap;\n\t\t\t\tscrollX %= totalItemWidth;\n\t\t\t\tif(scrollX < 0)\n\t\t\t\t{\n\t\t\t\t\tscrollX += totalItemWidth;\n\t\t\t\t}\n\t\t\t\tvar minimum:int = scrollX / (calculatedTypicalItemWidth + gap);\n\t\t\t\tvar maximum:int = minimum + maxVisibleTypicalItemCount;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tminimum = scrollX / (calculatedTypicalItemWidth + gap);\n\t\t\t\tif(minimum < 0)\n\t\t\t\t{\n\t\t\t\t\tminimum = 0;\n\t\t\t\t}\n\t\t\t\t//if we're scrolling beyond the final item, we should keep the\n\t\t\t\t//indices consistent so that items aren't destroyed and\n\t\t\t\t//recreated unnecessarily\n\t\t\t\tmaximum = minimum + maxVisibleTypicalItemCount;\n\t\t\t\tif(maximum >= itemCount)\n\t\t\t\t{\n\t\t\t\t\tmaximum = itemCount - 1;\n\t\t\t\t}\n\t\t\t\tminimum = maximum - maxVisibleTypicalItemCount;\n\t\t\t\tif(minimum < 0)\n\t\t\t\t{\n\t\t\t\t\tminimum = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(var i:int = minimum; i <= maximum; i++)\n\t\t\t{\n\t\t\t\tif(!canRepeatItems || (i >= 0 && i < itemCount))\n\t\t\t\t{\n\t\t\t\t\tresult[resultLastIndex] = i;\n\t\t\t\t}\n\t\t\t\telse if(i < 0)\n\t\t\t\t{\n\t\t\t\t\tresult[resultLastIndex] = itemCount + i;\n\t\t\t\t}\n\t\t\t\telse if(i >= itemCount)\n\t\t\t\t{\n\t\t\t\t\tvar loopedI:int = i - itemCount;\n\t\t\t\t\tif(loopedI == minimum)\n\t\t\t\t\t{\n\t\t\t\t\t\t//we don't want to repeat items!\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tresult[resultLastIndex] = loopedI;\n\t\t\t\t}\n\t\t\t\tresultLastIndex++;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function calculateNavigationDestination(items:Vector.<DisplayObject>, index:int, keyCode:uint, bounds:LayoutBoundsResult):int\n\t\t{\n\t\t\tvar itemArrayCount:int = items.length;\n\t\t\tvar itemCount:int = itemArrayCount + this._afterVirtualizedItemCount;\n\t\t\tif(this._beforeVirtualizedItemCount > 0)\n\t\t\t{\n\t\t\t\titemCount += this._beforeVirtualizedItemCount;\n\t\t\t}\n\n\t\t\tvar result:int = index;\n\t\t\tif(keyCode == Keyboard.HOME)\n\t\t\t{\n\t\t\t\tif(itemCount > 0)\n\t\t\t\t{\n\t\t\t\t\tresult = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.END)\n\t\t\t{\n\t\t\t\tresult = itemCount - 1;\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.PAGE_UP)\n\t\t\t{\n\t\t\t\tvar xPosition:Number = 0;\n\t\t\t\tfor(var i:int = index; i >= 0; i--)\n\t\t\t\t{\n\t\t\t\t\txPosition += this.snapInterval;\n\t\t\t\t\tif(xPosition > bounds.viewPortWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\txPosition += this._gap;\n\t\t\t\t\tresult = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.PAGE_DOWN)\n\t\t\t{\n\t\t\t\txPosition = 0;\n\t\t\t\tfor(i = index; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\txPosition += this.snapInterval;\n\t\t\t\t\tif(xPosition > bounds.viewPortWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\txPosition += this._gap;\n\t\t\t\t\tresult = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.LEFT)\n\t\t\t{\n\t\t\t\tresult--;\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.RIGHT)\n\t\t\t{\n\t\t\t\tresult++;\n\t\t\t}\n\t\t\tvar canRepeatItems:Boolean = this._repeatItems && bounds.contentWidth == Number.POSITIVE_INFINITY;\n\t\t\tif(canRepeatItems)\n\t\t\t{\n\t\t\t\twhile(result < 0)\n\t\t\t\t{\n\t\t\t\t\tresult += itemCount;\n\t\t\t\t}\n\t\t\t\twhile(result >= itemCount)\n\t\t\t\t{\n\t\t\t\t\tresult -= itemCount;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(result < 0)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tif(result >= itemCount)\n\t\t\t{\n\t\t\t\treturn itemCount - 1;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getNearestScrollPositionForIndex(index:int, scrollX:Number, scrollY:Number, items:Vector.<DisplayObject>,\n\t\t\tx:Number, y:Number, width:Number, height:Number, result:Point = null):Point\n\t\t{\n\t\t\t//normally, this isn't acceptable, but because the selection is\n\t\t\t//based on the scroll position, it must work this way.\n\t\t\treturn this.getScrollPositionForIndex(index, items, x, y, width, height, result);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getScrollPositionForIndex(index:int, items:Vector.<DisplayObject>, x:Number, y:Number, width:Number, height:Number, result:Point = null):Point\n\t\t{\n\t\t\tthis.prepareTypicalItem(height - this._paddingTop - this._paddingBottom);\n\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\t\t\tresult.x = 0;\n\t\t\tresult.y = calculatedTypicalItemHeight * index;\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function validateItems(items:Vector.<DisplayObject>, distributedWidth:Number, justifyHeight:Number):void\n\t\t{\n\t\t\t//if the alignment is justified, then we want to set the height of\n\t\t\t//each item before validating because setting one dimension may\n\t\t\t//cause the other dimension to change, and that will invalidate the\n\t\t\t//layout if it happens after validation, causing more invalidation\n\t\t\tvar isJustified:Boolean = this._verticalAlign == VerticalAlign.JUSTIFY;\n\t\t\tvar mustSetJustifyHeight:Boolean = isJustified && justifyHeight === justifyHeight; //!isNaN\n\t\t\tvar itemCount:int = items.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\tif(!item || (item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(mustSetJustifyHeight)\n\t\t\t\t{\n\t\t\t\t\titem.height = justifyHeight;\n\t\t\t\t}\n\t\t\t\telse if(isJustified && item is IFeathersControl)\n\t\t\t\t{\n\t\t\t\t\t//the alignment is justified, but we don't yet have a height\n\t\t\t\t\t//to use, so we need to ensure that we accurately measure\n\t\t\t\t\t//the items instead of using an old justified height that\n\t\t\t\t\t//may be wrong now!\n\t\t\t\t\titem.height = NaN;\n\t\t\t\t}\n\t\t\t\tif(item is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(item).validate();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function prepareTypicalItem(justifyHeight:Number):void\n\t\t{\n\t\t\tif(!this._typicalItem)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._resetTypicalItemDimensionsOnMeasure)\n\t\t\t{\n\t\t\t\tthis._typicalItem.width = this._typicalItemWidth;\n\t\t\t}\n\t\t\tif(this._verticalAlign == VerticalAlign.JUSTIFY &&\n\t\t\t\tjustifyHeight === justifyHeight) //!isNaN\n\t\t\t{\n\t\t\t\tthis._typicalItem.height = justifyHeight;\n\t\t\t}\n\t\t\telse if(this._resetTypicalItemDimensionsOnMeasure)\n\t\t\t{\n\t\t\t\tthis._typicalItem.height = this._typicalItemHeight;\n\t\t\t}\n\t\t\tif(this._typicalItem is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this._typicalItem).validate();\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/IDragDropLayout.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * Methods for layouts that support drag and drop.\n\t */\n\tpublic interface IDragDropLayout extends ILayout\n\t{\n\t\t/**\n\t\t * Returns the index of the item if it were dropped at the specified\n\t\t * location.\n\t\t */\n\t\tfunction getDropIndex(x:Number, y:Number, items:Vector.<DisplayObject>,\n\t\t\tboundsX:Number, boundsY:Number, width:Number, height:Number):int;\n\n\t\t/**\n\t\t * Positions the drop indicator in the layout. Must be called after\n\t\t * <code>layout()</code>.\n\t\t */\n\t\tfunction positionDropIndicator(dropIndicator:DisplayObject, index:int,\n\t\t\tx:Number, y:Number, items:Vector.<DisplayObject>, width:Number, height:Number):void;\n\t}\n}"
  },
  {
    "path": "source/feathers/layout/IGroupedLayout.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\t/**\n\t * A layout where items are divided into separate groups, with headers for\n\t * each group.\n\t *\n\t * @see feathers.controls.GroupedList\n\t *\n\t * @productversion Feathers 2.3.0\n\t */\n\tpublic interface IGroupedLayout extends ILayout\n\t{\n\t\t/**\n\t\t * Used internally by a component with grouped data to indicate which\n\t\t * indices are headers for a group.\n\t\t */\n\t\tfunction get headerIndices():Vector.<int>;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set headerIndices(value:Vector.<int>):void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/ILayout.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\timport feathers.core.IFeathersEventDispatcher;\n\n\timport flash.geom.Point;\n\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * Dispatched when a property of the layout changes, indicating that a\n\t * redraw is probably needed.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Interface providing layout capabilities for containers.\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic interface ILayout extends IFeathersEventDispatcher\n\t{\n\t\t/**\n\t\t * Determines if the container calls <code>layout()</code> when the\n\t\t * scroll position changes. Useful for transforming items as the view\n\t\t * port scrolls. This value should be <code>true</code> for layouts that\n\t\t * implement the <code>IVirtualLayout</code> interface and the\n\t\t * <code>useVirtualLayout</code> property is set to <code>true</code>.\n\t\t * May also be used by layouts that toggle item visibility as the items\n\t\t * scroll into and out of the view port.\n\t\t */\n\t\tfunction get requiresLayoutOnScroll():Boolean;\n\n\t\t/**\n\t\t * Positions (and possibly resizes) the supplied items within the\n\t\t * optional bounds argument. If no bounds are specified, the layout\n\t\t * algorithm will assume that the bounds start a 0,0 and have unbounded\n\t\t * dimensions. Returns the actual bounds of the content, which may\n\t\t * be different than the specified bounds.\n\t\t *\n\t\t * <p>Note: The items are <strong>not</strong> absolutely\n\t\t * restricted to appear only within the bounds. The bounds can affect\n\t\t * positioning, but the algorithm may very well ignore them completely.</p>\n\t\t *\n\t\t * <p>If a layout implementation needs to access accurate <code>width</code>\n\t\t * and <code>height</code> values from items that are of type\n\t\t * <code>IFeathersControl</code>, it must call <code>validate()</code>\n\t\t * manually. For performance reasons, the container that is the parent\n\t\t * of the items will not call <code>validate()</code> before passing the\n\t\t * items to a layout implementation. Meeting this requirement may be as\n\t\t * simple as looping through the items at the beginning of\n\t\t * <code>layout()</code> and validating all items that are Feathers UI\n\t\t * controls:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * const itemCount:int = items.length;\n\t\t * for(var i:int = 0; i &lt; itemCount; i++)\n\t\t * {\n\t\t *     var item:IFeathersControl = items[i] as IFeathersControl;\n\t\t *     if(item)\n\t\t *     {\n\t\t *         item.validate();\n\t\t *     }\n\t\t * }</listing>\n\t\t *\n\t\t * @see feathers.core.FeathersControl#validate()\n\t\t */\n\t\tfunction layout(items:Vector.<DisplayObject>, viewPortBounds:ViewPortBounds = null, result:LayoutBoundsResult = null):LayoutBoundsResult;\n\n\t\t/**\n\t\t * Using the current index and a key press, calculates the new index.\n\t\t * This might be use to change a list's <code>selectedIndex</code> when\n\t\t * a key is pressed.\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/ui/Keyboard.html#UP flash.ui.Keyboard.UP\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/ui/Keyboard.html#DOWN flash.ui.Keyboard.DOWN\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/ui/Keyboard.html#LEFT flash.ui.Keyboard.LEFT\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/ui/Keyboard.html#RIGHT flash.ui.Keyboard.RIGHT\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/ui/Keyboard.html#HOME flash.ui.Keyboard.HOME\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/ui/Keyboard.html#END flash.ui.Keyboard.END\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/ui/Keyboard.html#PAGE_UP flash.ui.Keyboard.PAGE_UP\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/ui/Keyboard.html#PAGE_DOWN flash.ui.Keyboard.PAGE_DOWN\n\t\t */\n\t\tfunction calculateNavigationDestination(items:Vector.<DisplayObject>, index:int, keyCode:uint, bounds:LayoutBoundsResult):int;\n\n\t\t/**\n\t\t * Using the item dimensions, calculates a scroll position that will\n\t\t * ensure that the item at a given index will be visible within the\n\t\t * specified bounds.\n\t\t *\n\t\t * <p>Typically, this function is used to show the item in the most\n\t\t * prominent way, such as centering. To scroll a minimum distance\n\t\t * required to display the full bounds of the item in the view port,\n\t\t * use <code>getNearestScrollPositionForIndex()</code> instead.</p>\n\t\t *\n\t\t * <p>This function should always be called <em>after</em> the\n\t\t * <code>layout()</code> function. The width and height arguments are\n\t\t * the final bounds of the view port, which may be calculated in the\n\t\t * layout() function.</p>\n\t\t *\n\t\t * @see #getNearestScrollPositionForIndex()\n\t\t */\n\t\tfunction getScrollPositionForIndex(index:int, items:Vector.<DisplayObject>,\n\t\t\tx:Number, y:Number, width:Number, height:Number, result:Point = null):Point;\n\n\t\t/**\n\t\t * Calculates the scroll position nearest to the current scroll position\n\t\t * that will display the full bounds of the item within the view port.\n\t\t * If the item is already fully displayed in the view port, the current\n\t\t * scroll position will be returned unchanged.\n\t\t *\n\t\t * <p>While the item will be displayed in the view port without being\n\t\t * clipped in any way, it may not be placed in the most prominent\n\t\t * position possible. To give the item a more prominent location, use\n\t\t * <code>getScrollPositionForIndex()</code> instead.</p>\n\t\t *\n\t\t * <p>This function should always be called <em>after</em> the\n\t\t * <code>layout()</code> function. The width and height arguments are\n\t\t * the final bounds of the view port, which may be calculated in the\n\t\t * layout() function.</p>\n\t\t *\n\t\t * @see #getScrollPositionForIndex()\n\t\t */\n\t\tfunction getNearestScrollPositionForIndex(index:int, scrollX:Number, scrollY:Number,\n\t\t\titems:Vector.<DisplayObject>, x:Number, y:Number, width:Number, height:Number, result:Point = null):Point;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/ILayoutData.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\timport feathers.core.IFeathersEventDispatcher;\n\n\t/**\n\t * Dispatched when a property of the layout data changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Extra data used by layout algorithms.\n\t *\n\t * @productversion Feathers 1.1.0\n\t */\n\tpublic interface ILayoutData extends IFeathersEventDispatcher\n\t{\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/ILayoutDisplayObject.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\timport feathers.core.IFeathersDisplayObject;\n\n\t/**\n\t * Dispatched when a property of the display object's layout data changes.\n\t *\n\t * @eventType feathers.events.FeathersEventType.LAYOUT_DATA_CHANGE\n\t */\n\t[Event(name=\"layoutDataChange\",type=\"starling.events.Event\")]\n\n\t/**\n\t * A display object that may be associated with extra data for use with\n\t * advanced layouts.\n\t *\n\t * @productversion Feathers 1.1.0\n\t */\n\tpublic interface ILayoutDisplayObject extends IFeathersDisplayObject\n\t{\n\t\t/**\n\t\t * Extra parameters associated with this display object that will be\n\t\t * used by the layout algorithm.\n\t\t */\n\t\tfunction get layoutData():ILayoutData;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set layoutData(value:ILayoutData):void;\n\n\t\t/**\n\t\t * Determines if the ILayout should use this object or ignore it.\n\t\t *\n\t\t * <p>In the following example, the display object is excluded from\n\t\t * the layout:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * object.includeInLayout = false;</listing>\n\t\t */\n\t\tfunction get includeInLayout():Boolean;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set includeInLayout(value:Boolean):void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/ISpinnerLayout.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\timport flash.geom.Rectangle;\n\n\t/**\n\t * A layout for the <code>SpinnerList</code> component.\n\t *\n\t * @see feathers.controls.SpinnerList\n\t *\n\t * @productversion Feathers 2.1.0\n\t */\n\tpublic interface ISpinnerLayout extends ILayout\n\t{\n\t\t/**\n\t\t * The interval, in pixels, between snapping points.\n\t\t */\n\t\tfunction get snapInterval():Number;\n\n\t\t/**\n\t\t * A rectangle indicating the bounds of the selected item. Used by the\n\t\t * <code>SpinnerList</code> to position its selection overlay skin.\n\t\t */\n\t\tfunction get selectionBounds():Rectangle;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/ITrimmedVirtualLayout.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\t/**\n\t * Optimizes a virtual layout by skipping a specific number of items before\n\t * and after the set that is passed to <code>layout()</code>.\n\t *\n\t * @productversion Feathers 1.1.0\n\t */\n\tpublic interface ITrimmedVirtualLayout extends IVirtualLayout\n\t{\n\t\t/**\n\t\t * Used internally by a component, such as <code>List</code>, to set the\n\t\t * number of virtualized items that appear before the items passed to\n\t\t * <code>layout()</code>. Allows the array of items to be smaller than\n\t\t * the full size. Does not work if the layout has variable item\n\t\t * dimensions.\n\t\t *\n\t\t * <p>This property is meant to be set by the <code>List</code> or other\n\t\t * component that uses the virtual layout. If you're simply creating\n\t\t * a layout for a <code>List</code> or another component, do not use\n\t\t * this property. It is meant for developers creating custom components\n\t\t * only.</p>\n\t\t */\n\t\tfunction get beforeVirtualizedItemCount():int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set beforeVirtualizedItemCount(value:int):void;\n\n\t\t/**\n\t\t * Used internally by a component, such as <code>List</code>, to set the\n\t\t * number of virtualized items that appear after the items passed to\n\t\t * <code>layout()</code>. Allows the array of items to be smaller than\n\t\t * the full size. Does not work if the layout has variable item\n\t\t * dimensions.\n\t\t *\n\t\t * <p>This property is meant to be set by the <code>List</code> or other\n\t\t * component that uses the virtual layout. If you're simply creating\n\t\t * a layout for a <code>List</code> or another component, do not use\n\t\t * this property. It is meant for developers creating custom components\n\t\t * only.</p>\n\t\t */\n\t\tfunction get afterVirtualizedItemCount():int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set afterVirtualizedItemCount(value:int):void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/IVariableVirtualLayout.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * Dispatched when the layout would like to adjust the container's scroll\n\t * position. Typically, this is used when the virtual dimensions of an item\n\t * differ from its real dimensions. This event allows the container to\n\t * adjust scrolling so that it appears smooth, without jarring jumps or\n\t * shifts when an item resizes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>A <code>flash.geom.Point</code> object\n\t *   representing how much the scroll position should be adjusted in both\n\t *   horizontal and vertical directions. Measured in pixels.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.SCROLL\n\t */\n\t[Event(name=\"scroll\",type=\"starling.events.Event\")]\n\n\t/**\n\t * A virtual layout that supports variable item dimensions.\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic interface IVariableVirtualLayout extends IVirtualLayout\n\t{\n\t\t/**\n\t\t * When the layout is virtualized, and this value is true, the items may\n\t\t * have variable dimensions. If false, the items will all share the\n\t\t * same dimensions as the typical item. Performance is better for\n\t\t * layouts where all items have the same dimensions.\n\t\t */\n\t\tfunction get hasVariableItemDimensions():Boolean;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set hasVariableItemDimensions(value:Boolean):void;\n\n\t\t/**\n\t\t * Clears the cached dimensions for all virtualized indices.\n\t\t */\n\t\tfunction resetVariableVirtualCache():void;\n\n\t\t/**\n\t\t * Clears the cached dimensions for one specific virtualized index.\n\t\t */\n\t\tfunction resetVariableVirtualCacheAtIndex(index:int, item:DisplayObject = null):void;\n\n\t\t/**\n\t\t * Inserts an item in to the cache at the specified index, pushing the\n\t\t * old cached value at that index, and all following values, up one\n\t\t * index.\n\t\t */\n\t\tfunction addToVariableVirtualCacheAtIndex(index:int, item:DisplayObject = null):void;\n\n\t\t/**\n\t\t * Removes an item in to the cache at the specified index, moving the\n\t\t * values at following indexes down by one.\n\t\t */\n\t\tfunction removeFromVariableVirtualCacheAtIndex(index:int):void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/IVirtualLayout.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\timport flash.geom.Point;\n\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * A layout algorithm that supports virtualization of items so that only\n\t * the visible items need to be created. Useful in lists with dozens or\n\t * hundreds of items are needed, but only a small subset of the items are\n\t * visible at any given moment.\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic interface IVirtualLayout extends ILayout\n\t{\n\t\t/**\n\t\t * Determines if virtual layout should be used. Some components don't\n\t\t * support virtual layouts, and they will always change this property to\n\t\t * <code>false</code>. In those cases, the virtual layout options\n\t\t * will be ignored.\n\t\t */\n\t\tfunction get useVirtualLayout():Boolean;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set useVirtualLayout(value:Boolean):void;\n\n\t\t/**\n\t\t * Used internally by a component that supports layout virtualization,\n\t\t * such as <code>List</code>, to provide a display object with\n\t\t * dimensions that represent a \"typical\" item in the layout. These\n\t\t * dimensions will be used to fill in blanks for the layout when an\n\t\t * item is virtual and isn't actually on the display list. If you are\n\t\t * simply passing a layout to a component, setting this property will\n\t\t * have no effect. It is meant to be used by the component, and the\n\t\t * component will replace any value you pass to this property.\n\t\t */\n\t\tfunction get typicalItem():DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set typicalItem(value:DisplayObject):void;\n\n\t\t/**\n\t\t * Used internally by a component, such as <code>List</code>, to measure\n\t\t * the view port based on the typical item dimensions or cached\n\t\t * dimensions, if available.\n\t\t *\n\t\t * <p>This function is meant to be called by the <code>List</code> or\n\t\t * other component that uses the virtual layout. If you're simply\n\t\t * creating a layout for a <code>List</code> or another component, do\n\t\t * not call this function. It is meant for developers creating custom\n\t\t * components only.</p>\n\t\t *\n\t\t * @see #typicalItemWidth\n\t\t * @see #typicalItemHeight\n\t\t */\n\t\tfunction measureViewPort(itemCount:int, viewPortBounds:ViewPortBounds = null, result:Point = null):Point;\n\n\t\t/**\n\t\t * Used internally by a component, such as <code>List</code>, to\n\t\t * determines which indices are visible with the specified view port\n\t\t * bounds and scroll position. Indices that aren't returned are\n\t\t * typically not displayed and can be replaced virtually. Uses the\n\t\t * typical items dimensions, or cached dimensions, if available.\n\t\t *\n\t\t * <p>This function is meant to be called by the <code>List</code> or\n\t\t * other component that uses the virtual layout. If you're simply\n\t\t * creating a layout for a <code>List</code> or another component, do\n\t\t * not call this function. It is meant for developers creating custom\n\t\t * components only.</p>\n\t\t */\n\t\tfunction getVisibleIndicesAtScrollPosition(scrollX:Number, scrollY:Number, width:Number, height:Number, itemCount:int, result:Vector.<int> = null):Vector.<int>;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/LayoutBoundsResult.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\t/**\n\t * Calculated bounds for layout.\n\t *\n\t * @productversion Feathers 1.1.0\n\t */\n\tpublic class LayoutBoundsResult\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function LayoutBoundsResult()\n\t\t{\n\n\t\t}\n\n\t\t/**\n\t\t * The starting position of the view port's content on the x axis.\n\t\t * Usually, this value is <code>0</code>, but it may be negative.\n\t\t * negative.\n\t\t */\n\t\tpublic var contentX:Number = 0;\n\n\t\t/**\n\t\t * The starting position of the view port's content on the y axis.\n\t\t * Usually, this value is <code>0</code>, but it may be negative.\n\t\t */\n\t\tpublic var contentY:Number = 0;\n\n\t\t/**\n\t\t * The visible width of the view port. The view port's content may be\n\t\t * clipped.\n\t\t */\n\t\tpublic var viewPortWidth:Number;\n\n\t\t/**\n\t\t * The visible height of the view port. The view port's content may be\n\t\t * clipped.\n\t\t */\n\t\tpublic var viewPortHeight:Number;\n\n\t\t/**\n\t\t * The width of the content. May be larger or smaller than the view\n\t\t * port.\n\t\t */\n\t\tpublic var contentWidth:Number;\n\n\t\t/**\n\t\t * The height of the content. May be larger or smaller than the view\n\t\t * port.\n\t\t */\n\t\tpublic var contentHeight:Number;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/Orientation.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\t/**\n\t * Constants that define an orientation or set of orientations.\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class Orientation\n\t{\n\t\t/**\n\t\t * Landscape orientation where width is larger than height.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const LANDSCAPE:String = \"landscape\";\n\n\t\t/**\n\t\t * Portrait orientation where height is larger than width.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const PORTRAIT:String = \"portrait\";\n\n\t\t/**\n\t\t * No orientation.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const NONE:String = \"none\";\n\n\t\t/**\n\t\t * Both landscape and portrait orientation.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const BOTH:String = \"both\";\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/RelativeDepth.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\t/**\n\t * Constants for positioning an item at a depth relative to another item's\n\t * depth in a layout.\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class RelativeDepth\n\t{\n\t\t/**\n\t\t * The item will be positioned above another item.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const ABOVE:String = \"above\";\n\n\t\t/**\n\t\t * The item will be positioned below another item.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const BELOW:String = \"below\";\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/RelativePosition.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\t/**\n\t * Constants for positioning an item relative to another item in a layout.\n\t *\n\t * <p>Note: Some constants may not be valid for certain properties. Please\n\t * see the description of the property in the API reference for full\n\t * details.</p>\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class RelativePosition\n\t{\n\t\t/**\n\t\t * The item will be positioned above another item.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const TOP:String = \"top\";\n\n\t\t/**\n\t\t * The item will be positioned to the right of another item.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const RIGHT:String = \"right\";\n\n\t\t/**\n\t\t * The item will be positioned below another item.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const BOTTOM:String = \"bottom\";\n\n\t\t/**\n\t\t * The item will be positioned to the left of another item.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const LEFT:String = \"left\";\n\n\t\t/**\n\t\t * The item will be positioned manually with no relation to the position\n\t\t * of another item. Additional properties may be available to manually\n\t\t * set the x and y position of the item.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const MANUAL:String = \"manual\";\n\n\t\t/**\n\t\t * The item will be positioned to the left another item, and the\n\t\t * baselines will be aligned to match. If an item doesn't have a\n\t\t * baseline, then its bottom edge will be used as the baseline.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const LEFT_BASELINE:String = \"leftBaseline\";\n\n\t\t/**\n\t\t * The item will be positioned to the right of another item, and the\n\t\t * baselines will be aligned to match. If an item doesn't have a\n\t\t * baseline, then its bottom edge will be used as the baseline.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const RIGHT_BASELINE:String = \"rightBaseline\";\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/SlideShowLayout.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\timport feathers.core.IValidating;\n\timport feathers.layout.Direction;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\n\timport flash.errors.IllegalOperationError;\n\timport flash.geom.Point;\n\timport flash.ui.Keyboard;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\n\t/**\n\t * Dispatched when a property of the layout changes, indicating that a\n\t * redraw is probably needed.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Displays one item per page.\n\t *\n\t * @see ../../../help/slide-show-layout.html How to use SlideShowLayout with Feathers containers\n\t *\n\t * @productversion Feathers 3.3.0\n\t */\n\tpublic class SlideShowLayout extends EventDispatcher implements IVirtualLayout, ITrimmedVirtualLayout\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const FUZZY_PAGE_DETECTION:Number = 0.000001;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function SlideShowLayout()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _direction:String = Direction.HORIZONTAL;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"horizontal,vertical\")]\n\t\t/**\n\t\t * Determines if pages are positioned from left-to-right or from top-to-bottom.\n\t\t *\n\t\t * @default feathers.layout.Direction.HORIZONTAL\n\t\t *\n\t\t * @see feathers.layout.Direction#HORIZONTAL\n\t\t * @see feathers.layout.Direction#VERTICAL\n\t\t */\n\t\tpublic function get direction():String\n\t\t{\n\t\t\treturn this._direction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set direction(value:String):void\n\t\t{\n\t\t\tif(this._direction === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._direction = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * Quickly sets all padding properties to the same value. The\n\t\t * <code>padding</code> getter always returns the value of\n\t\t * <code>paddingTop</code>, but the other padding values may be\n\t\t * different.\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #paddingTop\n\t\t * @see #paddingRight\n\t\t * @see #paddingBottom\n\t\t * @see #paddingLeft\n\t\t */\n\t\tpublic function get padding():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set padding(value:Number):void\n\t\t{\n\t\t\tthis.paddingTop = value;\n\t\t\tthis.paddingRight = value;\n\t\t\tthis.paddingBottom = value;\n\t\t\tthis.paddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingTop:Number = 0;\n\n\t\t/**\n\t\t * The space, in pixels, that appears on top of each item.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingTop():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingTop(value:Number):void\n\t\t{\n\t\t\tif(this._paddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingTop = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingRight:Number = 0;\n\n\t\t/**\n\t\t * The minimum space, in pixels, to the right of each item.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingRight():Number\n\t\t{\n\t\t\treturn this._paddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this._paddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingRight = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingBottom:Number = 0;\n\n\t\t/**\n\t\t * The space, in pixels, that appears on the bottom of each item.\n\t\t * item.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingBottom():Number\n\t\t{\n\t\t\treturn this._paddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this._paddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingBottom = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingLeft:Number = 0;\n\n\t\t/**\n\t\t * The minimum space, in pixels, to the left of each item.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this._paddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingLeft = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalAlign:String = VerticalAlign.MIDDLE;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"top,middle,bottom,justify\")]\n\t\t/**\n\t\t * The alignment of each item vertically, on the y-axis.\n\t\t *\n\t\t * @default feathers.layout.VerticalAlign.MIDDLE\n\t\t *\n\t\t * @see feathers.layout.VerticalAlign#TOP\n\t\t * @see feathers.layout.VerticalAlign#MIDDLE\n\t\t * @see feathers.layout.VerticalAlign#BOTTOM\n\t\t * @see feathers.layout.VerticalAlign#JUSTIFY\n\t\t */\n\t\tpublic function get verticalAlign():String\n\t\t{\n\t\t\treturn this._verticalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalAlign(value:String):void\n\t\t{\n\t\t\tif(this._verticalAlign === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalAlign = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalAlign:String = HorizontalAlign.CENTER;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"left,center,right,justify\")]\n\t\t/**\n\t\t * The alignment of each item horizontally, on the x-axis.\n\t\t *\n\t\t * @default feathers.layout.HorizontalAlign.CENTER\n\t\t *\n\t\t * @see feathers.layout.HorizontalAlign#LEFT\n\t\t * @see feathers.layout.HorizontalAlign#CENTER\n\t\t * @see feathers.layout.HorizontalAlign#RIGHT\n\t\t * @see feathers.layout.HorizontalAlign#JUSTIFY\n\t\t */\n\t\tpublic function get horizontalAlign():String\n\t\t{\n\t\t\treturn this._horizontalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalAlign(value:String):void\n\t\t{\n\t\t\tif(this._horizontalAlign === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalAlign = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _useVirtualLayout:Boolean = true;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic function get useVirtualLayout():Boolean\n\t\t{\n\t\t\treturn this._useVirtualLayout;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set useVirtualLayout(value:Boolean):void\n\t\t{\n\t\t\tif(this._useVirtualLayout === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._useVirtualLayout = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _beforeVirtualizedItemCount:int = 0;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get beforeVirtualizedItemCount():int\n\t\t{\n\t\t\treturn this._beforeVirtualizedItemCount;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set beforeVirtualizedItemCount(value:int):void\n\t\t{\n\t\t\tif(this._beforeVirtualizedItemCount == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._beforeVirtualizedItemCount = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _afterVirtualizedItemCount:int = 0;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get afterVirtualizedItemCount():int\n\t\t{\n\t\t\treturn this._afterVirtualizedItemCount;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set afterVirtualizedItemCount(value:int):void\n\t\t{\n\t\t\tif(this._afterVirtualizedItemCount == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._afterVirtualizedItemCount = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _typicalItem:DisplayObject;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get typicalItem():DisplayObject\n\t\t{\n\t\t\treturn this._typicalItem;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set typicalItem(value:DisplayObject):void\n\t\t{\n\t\t\tif(this._typicalItem === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._typicalItem = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minimumItemCount:int = 1;\n\n\t\t/**\n\t\t * If the layout is virtualized, specifies the minimum total number of\n\t\t * items that will be created, even if some are not currently visible\n\t\t * in the view port.\n\t\t *\n\t\t * @default 1\n\t\t *\n\t\t * @see #useVirtualLayout\n\t\t */\n\t\tpublic function get minimumItemCount():int\n\t\t{\n\t\t\treturn this._minimumItemCount;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minimumItemCount(value:int):void\n\t\t{\n\t\t\tif(this._minimumItemCount == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._minimumItemCount = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get requiresLayoutOnScroll():Boolean\n\t\t{\n\t\t\treturn this._useVirtualLayout;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function layout(items:Vector.<DisplayObject>, viewPortBounds:ViewPortBounds = null, result:LayoutBoundsResult = null):LayoutBoundsResult\n\t\t{\n\t\t\t//since viewPortBounds can be null, we may need to provide some defaults\n\t\t\tvar scrollX:Number = viewPortBounds !== null ? viewPortBounds.scrollX : 0;\n\t\t\tvar scrollY:Number = viewPortBounds !== null ? viewPortBounds.scrollY : 0;\n\t\t\tvar boundsX:Number = viewPortBounds !== null ? viewPortBounds.x : 0;\n\t\t\tvar boundsY:Number = viewPortBounds !== null ? viewPortBounds.y : 0;\n\t\t\tvar minWidth:Number = viewPortBounds !== null ? viewPortBounds.minWidth : 0;\n\t\t\tvar minHeight:Number = viewPortBounds !== null ? viewPortBounds.minHeight : 0;\n\t\t\tvar maxWidth:Number = viewPortBounds !== null ? viewPortBounds.maxWidth : Number.POSITIVE_INFINITY;\n\t\t\tvar maxHeight:Number = viewPortBounds !== null ? viewPortBounds.maxHeight : Number.POSITIVE_INFINITY;\n\t\t\tvar explicitWidth:Number = viewPortBounds !== null ? viewPortBounds.explicitWidth : NaN;\n\t\t\tvar explicitHeight:Number = viewPortBounds !== null ? viewPortBounds.explicitHeight : NaN;\n\t\t\tvar itemCount:int = items.length;\n\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\t//if the layout is virtualized, we'll need the dimensions of the\n\t\t\t\t//typical item so that we have fallback values when an item is null\n\t\t\t\tthis.prepareTypicalItem(explicitWidth - this._paddingLeft - this._paddingRight,\n\t\t\t\t\texplicitHeight - this._paddingTop - this._paddingBottom);\n\t\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\t\t\t}\n\n\t\t\tvar needsExplicitWidth:Boolean = explicitWidth !== explicitWidth; //isNaN\n\t\t\tvar needsExplicitHeight:Boolean = explicitHeight !== explicitHeight; //isNaN\n\t\t\tvar viewPortWidth:Number = explicitWidth;\n\t\t\tif(needsExplicitWidth)\n\t\t\t{\n\t\t\t\tviewPortWidth = calculatedTypicalItemWidth;\n\t\t\t}\n\t\t\tvar viewPortHeight:Number = explicitHeight;\n\t\t\tif(needsExplicitHeight)\n\t\t\t{\n\t\t\t\tviewPortHeight = calculatedTypicalItemHeight;\n\t\t\t}\n\n\t\t\tif(!this._useVirtualLayout ||\n\t\t\t\tthis._horizontalAlign !== HorizontalAlign.JUSTIFY ||\n\t\t\t\tthis._verticalAlign !== VerticalAlign.JUSTIFY ||\n\t\t\t\tneedsExplicitWidth || needsExplicitHeight)\n\t\t\t{\n\t\t\t\t//in some cases, we may need to validate all of the items so\n\t\t\t\t//that we can use their dimensions below.\n\t\t\t\tthis.validateItems(items, explicitWidth - this._paddingLeft - this._paddingRight,\n\t\t\t\t\texplicitHeight - this._paddingTop - this._paddingBottom);\n\t\t\t}\n\n\t\t\t//if the layout isn't virtual and the view port dimensions aren't\n\t\t\t//explicit, we need to calculate them\n\t\t\tif(!this._useVirtualLayout && (needsExplicitWidth || needsExplicitHeight))\n\t\t\t{\n\t\t\t\tvar maxItemWidth:Number = this._useVirtualLayout ? calculatedTypicalItemWidth : 0;\n\t\t\t\tvar maxItemHeight:Number = this._useVirtualLayout ? calculatedTypicalItemHeight : 0;\n\t\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\t\tif(maxItemWidth < item.width)\n\t\t\t\t\t{\n\t\t\t\t\t\tmaxItemWidth = item.width;\n\t\t\t\t\t}\n\t\t\t\t\tif(maxItemHeight < item.height)\n\t\t\t\t\t{\n\t\t\t\t\t\tmaxItemHeight = item.height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(needsExplicitWidth)\n\t\t\t\t{\n\t\t\t\t\tviewPortWidth = maxItemWidth + this._paddingLeft + this._paddingRight;\n\t\t\t\t}\n\t\t\t\tif(needsExplicitHeight)\n\t\t\t\t{\n\t\t\t\t\tviewPortHeight = maxItemHeight + this._paddingTop + this._paddingBottom;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(needsExplicitWidth)\n\t\t\t{\n\t\t\t\tif(viewPortWidth < minWidth)\n\t\t\t\t{\n\t\t\t\t\tviewPortWidth = minWidth;\n\t\t\t\t}\n\t\t\t\telse if(viewPortWidth > maxWidth)\n\t\t\t\t{\n\t\t\t\t\tviewPortWidth = maxWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(needsExplicitHeight)\n\t\t\t{\n\t\t\t\tif(viewPortHeight < minHeight)\n\t\t\t\t{\n\t\t\t\t\tviewPortHeight = minHeight;\n\t\t\t\t}\n\t\t\t\telse if(viewPortHeight > maxHeight)\n\t\t\t\t{\n\t\t\t\t\tviewPortHeight = maxHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._direction === Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tvar startPosition:Number = boundsY;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstartPosition = boundsX;\n\t\t\t}\n\t\t\tvar position:Number = startPosition;\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\t//if the layout is virtualized, we can make our loops shorter\n\t\t\t\t//by skipping some items at the beginning and end. this\n\t\t\t\t//improves performance.\n\t\t\t\tif(this._direction === Direction.VERTICAL)\n\t\t\t\t{\n\t\t\t\t\tposition += (this._beforeVirtualizedItemCount * viewPortHeight);\n\t\t\t\t}\n\t\t\t\telse //horizontal\n\t\t\t\t{\n\t\t\t\t\tposition += (this._beforeVirtualizedItemCount * viewPortWidth);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar contentWidth:Number = viewPortWidth - this._paddingLeft - this._paddingRight;\n\t\t\tvar contentHeight:Number = viewPortHeight - this._paddingTop - this._paddingBottom;\n\t\t\tfor(i = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\titem = items[i];\n\t\t\t\tif(item !== null)\n\t\t\t\t{\n\t\t\t\t\t//we get here if the item isn't null. it is never null if\n\t\t\t\t\t//the layout isn't virtualized.\n\t\t\t\t\tvar layoutItem:ILayoutDisplayObject = item as ILayoutDisplayObject;\n\t\t\t\t\tif(layoutItem !== null && !layoutItem.includeInLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tvar xPosition:Number = this._direction === Direction.VERTICAL ? 0 : position;\n\t\t\t\t\tswitch(this._horizontalAlign)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase HorizontalAlign.JUSTIFY:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\txPosition += this._paddingLeft;\n\t\t\t\t\t\t\titem.width = contentWidth;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase HorizontalAlign.LEFT:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\txPosition += this._paddingLeft;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase HorizontalAlign.RIGHT:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\txPosition += contentWidth - item.width;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase HorizontalAlign.CENTER:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\txPosition += Math.round((contentWidth - item.width) / 2);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\titem.x = xPosition;\n\t\t\t\t\tvar yPosition:Number = this._direction === Direction.VERTICAL ? position : 0;\n\t\t\t\t\tswitch(this._verticalAlign)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase VerticalAlign.JUSTIFY:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tyPosition += this._paddingTop;\n\t\t\t\t\t\t\titem.height = contentHeight;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase VerticalAlign.TOP:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tyPosition += this._paddingTop;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase VerticalAlign.BOTTOM:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tyPosition += contentHeight - item.height;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase VerticalAlign.MIDDLE:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tyPosition += Math.round((contentHeight - item.height) / 2);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\titem.y = yPosition;\n\t\t\t\t}\n\t\t\t\tif(this._direction === Direction.VERTICAL)\n\t\t\t\t{\n\t\t\t\t\tposition += viewPortHeight;\n\t\t\t\t}\n\t\t\t\telse //horizontal\n\t\t\t\t{\n\t\t\t\t\tposition += viewPortWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(position === startPosition)\n\t\t\t{\n\t\t\t\t//require at least one page\n\t\t\t\tif(this._direction === Direction.VERTICAL)\n\t\t\t\t{\n\t\t\t\t\tposition += viewPortHeight;\n\t\t\t\t}\n\t\t\t\telse //horizontal\n\t\t\t\t{\n\t\t\t\t\tposition += viewPortWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tposition += (viewPortWidth * this._afterVirtualizedItemCount);\n\t\t\t}\n\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new LayoutBoundsResult();\n\t\t\t}\n\t\t\tresult.contentX = 0;\n\t\t\tresult.contentY = 0;\n\t\t\tif(this._direction === Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tresult.contentWidth = viewPortWidth;\n\t\t\t\tresult.contentHeight = position;\n\t\t\t}\n\t\t\telse //horizontal\n\t\t\t{\n\t\t\t\tresult.contentWidth = position;\n\t\t\t\tresult.contentHeight = viewPortHeight;\n\t\t\t}\n\t\t\tresult.viewPortWidth = viewPortWidth;\n\t\t\tresult.viewPortHeight = viewPortHeight;\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function measureViewPort(itemCount:int, viewPortBounds:ViewPortBounds = null, result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\t\t\tif(!this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"measureViewPort() may be called only if useVirtualLayout is true.\");\n\t\t\t}\n\n\t\t\tvar explicitWidth:Number = viewPortBounds ? viewPortBounds.explicitWidth : NaN;\n\t\t\tvar explicitHeight:Number = viewPortBounds ? viewPortBounds.explicitHeight : NaN;\n\t\t\tvar needsWidth:Boolean = explicitWidth !== explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = explicitHeight !== explicitHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight)\n\t\t\t{\n\t\t\t\tresult.x = explicitWidth;\n\t\t\t\tresult.y = explicitHeight;\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tvar minWidth:Number = viewPortBounds ? viewPortBounds.minWidth : 0;\n\t\t\tvar minHeight:Number = viewPortBounds ? viewPortBounds.minHeight : 0;\n\t\t\tvar maxWidth:Number = viewPortBounds ? viewPortBounds.maxWidth : Number.POSITIVE_INFINITY;\n\t\t\tvar maxHeight:Number = viewPortBounds ? viewPortBounds.maxHeight : Number.POSITIVE_INFINITY;\n\n\t\t\tthis.prepareTypicalItem(explicitWidth - this._paddingLeft - this._paddingRight,\n\t\t\t\texplicitHeight - this._paddingTop - this._paddingBottom);\n\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tvar resultWidth:Number = calculatedTypicalItemWidth + this._paddingLeft + this._paddingRight;\n\t\t\t\tif(resultWidth < minWidth)\n\t\t\t\t{\n\t\t\t\t\tresultWidth = minWidth;\n\t\t\t\t}\n\t\t\t\telse if(resultWidth > maxWidth)\n\t\t\t\t{\n\t\t\t\t\tresultWidth = maxWidth;\n\t\t\t\t}\n\t\t\t\tresult.x = resultWidth;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult.x = explicitWidth;\n\t\t\t}\n\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tvar resultHeight:Number = calculatedTypicalItemHeight + this._paddingTop + this._paddingBottom;\n\t\t\t\tif(resultHeight < minHeight)\n\t\t\t\t{\n\t\t\t\t\tresultHeight = minHeight;\n\t\t\t\t}\n\t\t\t\telse if(resultHeight > maxHeight)\n\t\t\t\t{\n\t\t\t\t\tresultHeight = maxHeight;\n\t\t\t\t}\n\t\t\t\tresult.y = resultHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult.y = explicitHeight;\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getVisibleIndicesAtScrollPosition(scrollX:Number, scrollY:Number, width:Number, height:Number, itemCount:int, result:Vector.<int> = null):Vector.<int>\n\t\t{\n\t\t\tif(result !== null)\n\t\t\t{\n\t\t\t\tresult.length = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult = new <int>[];\n\t\t\t}\n\t\t\tif(!this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"getVisibleIndicesAtScrollPosition() may be called only if useVirtualLayout is true.\");\n\t\t\t}\n\t\t\tif(this._direction === Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tvar baseIndex:int = scrollY / height;\n\t\t\t\tvar isBetweenPages:Boolean = ((scrollY / height) - baseIndex) > FUZZY_PAGE_DETECTION;\n\t\t\t}\n\t\t\telse //horizontal\n\t\t\t{\n\t\t\t\tbaseIndex = scrollX / width;\n\t\t\t\tisBetweenPages = ((scrollX / width) - baseIndex) > FUZZY_PAGE_DETECTION;\n\t\t\t}\n\t\t\tvar extraBeforeCount:int = int(this._minimumItemCount / 2);\n\t\t\tvar startIndex:int = baseIndex - extraBeforeCount;\n\t\t\tif(startIndex < 0)\n\t\t\t{\n\t\t\t\textraBeforeCount += startIndex;\n\t\t\t\tstartIndex = 0;\n\t\t\t}\n\t\t\tvar extraAfterCount:int = this._minimumItemCount - extraBeforeCount;\n\t\t\tif(!isBetweenPages || this._minimumItemCount > 2)\n\t\t\t{\n\t\t\t\textraAfterCount--;\n\t\t\t}\n\t\t\tvar endIndex:int = baseIndex + extraAfterCount;\n\t\t\tvar maxIndex:int = itemCount - 1;\n\t\t\tif(endIndex > maxIndex)\n\t\t\t{\n\t\t\t\tendIndex = maxIndex;\n\t\t\t}\n\t\t\tvar pushIndex:int = 0;\n\t\t\tfor(var i:int = startIndex; i <= endIndex; i++)\n\t\t\t{\n\t\t\t\tresult[pushIndex] = i;\n\t\t\t\tpushIndex++;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getNearestScrollPositionForIndex(index:int, scrollX:Number, scrollY:Number, items:Vector.<DisplayObject>,\n\t\t\tx:Number, y:Number, width:Number, height:Number, result:Point = null):Point\n\t\t{\n\t\t\treturn this.getScrollPositionForIndex(index, items, x, y, width, height, result);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function calculateNavigationDestination(items:Vector.<DisplayObject>, index:int, keyCode:uint, bounds:LayoutBoundsResult):int\n\t\t{\n\t\t\tvar itemArrayCount:int = items.length;\n\t\t\tvar itemCount:int = itemArrayCount + this._beforeVirtualizedItemCount + this._afterVirtualizedItemCount;\n\n\t\t\tvar result:int = index;\n\t\t\tif(keyCode == Keyboard.HOME)\n\t\t\t{\n\t\t\t\tif(itemCount > 0)\n\t\t\t\t{\n\t\t\t\t\tresult = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.END)\n\t\t\t{\n\t\t\t\tresult = itemCount - 1;\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.PAGE_UP ||\n\t\t\t\t(this._direction === Direction.VERTICAL && keyCode == Keyboard.UP) ||\n\t\t\t\t(this._direction === Direction.HORIZONTAL && keyCode == Keyboard.LEFT))\n\t\t\t{\n\t\t\t\tresult--;\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.PAGE_DOWN ||\n\t\t\t\t(this._direction === Direction.VERTICAL && keyCode == Keyboard.DOWN) ||\n\t\t\t\t(this._direction === Direction.HORIZONTAL && keyCode == Keyboard.RIGHT))\n\t\t\t{\n\t\t\t\tresult++;\n\t\t\t}\n\t\t\tif(result < 0)\n\t\t\t{\n\t\t\t\tresult = 0;\n\t\t\t}\n\t\t\tif(result >= itemCount)\n\t\t\t{\n\t\t\t\tresult = itemCount - 1;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getScrollPositionForIndex(index:int, items:Vector.<DisplayObject>, x:Number, y:Number, width:Number, height:Number, result:Point = null):Point\n\t\t{\n\t\t\tif(result === null)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\t\t\tif(this._direction === Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tresult.x = 0;\n\t\t\t\tresult.y = height * index;\n\t\t\t}\n\t\t\telse //horizontal\n\t\t\t{\n\t\t\t\tresult.x = width * index;\n\t\t\t\tresult.y = 0;\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function validateItems(items:Vector.<DisplayObject>,\n\t\t\texplicitWidth:Number, explicitHeight:Number):void\n\t\t{\n\t\t\t//if the alignment is justified, then we want to set the width of\n\t\t\t//each item before validating because setting one dimension may\n\t\t\t//cause the other dimension to change, and that will invalidate the\n\t\t\t//layout if it happens after validation, causing more invalidation\n\t\t\tvar itemCount:int = items.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\tif(!item || (item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(this._horizontalAlign === HorizontalAlign.JUSTIFY)\n\t\t\t\t{\n\t\t\t\t\t//the alignment is justified, but we don't yet have a width\n\t\t\t\t\t//to use, so we need to ensure that we accurately measure\n\t\t\t\t\t//the items instead of using an old justified width that may\n\t\t\t\t\t//be wrong now!\n\t\t\t\t\titem.width = explicitWidth;\n\t\t\t\t}\n\t\t\t\tif(this._verticalAlign === VerticalAlign.JUSTIFY)\n\t\t\t\t{\n\t\t\t\t\titem.height = explicitHeight;\n\t\t\t\t}\n\t\t\t\tif(item is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(item).validate();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function prepareTypicalItem(justifyWidth:Number, justifyHeight:Number):void\n\t\t{\n\t\t\tif(!this._typicalItem)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._horizontalAlign === HorizontalAlign.JUSTIFY &&\n\t\t\t\tjustifyWidth === justifyWidth) //!isNaN\n\t\t\t{\n\t\t\t\tthis._typicalItem.width = justifyWidth;\n\t\t\t}\n\t\t\tif(this._verticalAlign === VerticalAlign.JUSTIFY &&\n\t\t\t\tjustifyHeight === justifyHeight) //!isNaN\n\t\t\t{\n\t\t\t\tthis._typicalItem.height = justifyHeight;\n\t\t\t}\n\t\t\tif(this._typicalItem is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this._typicalItem).validate();\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/TiledColumnsLayout.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\timport feathers.core.IValidating;\n\timport feathers.layout.Direction;\n\n\timport flash.errors.IllegalOperationError;\n\timport flash.geom.Point;\n\timport flash.ui.Keyboard;\n\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * Positions items as tiles (equal width and height) from top to bottom\n\t * in multiple columns. Constrained to the suggested height, the tiled\n\t * columns layout will change in width as the number of items increases or\n\t * decreases.\n\t *\n\t * @see ../../../help/tiled-columns-layout.html How to use TiledColumnsLayout with Feathers containers\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class TiledColumnsLayout extends BaseTiledLayout implements IVirtualLayout, IDragDropLayout\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function TiledColumnsLayout()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * Requests that the layout uses a specific number of rows in a column,\n\t\t * if possible. Set to <code>0</code> to calculate the maximum of\n\t\t * rows that will fit in the available space.\n\t\t *\n\t\t * <p>If the view port's explicit or maximum height is not large enough\n\t\t * to fit the requested number of rows, it will use fewer. If the\n\t\t * view port doesn't have an explicit height and the maximum height is\n\t\t * equal to <code>Number.POSITIVE_INFINITY</code>, the height will be\n\t\t * calculated automatically to fit the exact number of requested\n\t\t * rows.</p>\n\t\t *\n\t\t * <p>If paging is enabled, this value will be used to calculate the\n\t\t * number of rows in a page. If paging isn't enabled, this value will\n\t\t * be used to calculate a minimum number of rows, even if there aren't\n\t\t * enough items to fill each row.</p>\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\toverride public function get requestedRowCount():int\n\t\t{\n\t\t\t//this is an override so that this class can have its own documentation.\n\t\t\treturn this._requestedRowCount;\n\t\t}\n\n\t\t/**\n\t\t * Requests that the layout uses a specific number of columns, if\n\t\t * possible. If the view port's explicit or maximum width is not large\n\t\t * enough to fit the requested number of columns, it will use fewer. Set\n\t\t * to <code>0</code> to calculate the number of columns automatically\n\t\t * based on width and height.\n\t\t *\n\t\t * <p>If paging is enabled, this value will be used to calculate the\n\t\t * number of columns in a page. If paging isn't enabled, this value will\n\t\t * be used to calculate a minimum number of columns, even if there\n\t\t * aren't enough items to fill each column.</p>\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\toverride public function get requestedColumnCount():int\n\t\t{\n\t\t\t//this is an override so that this class can have its own documentation.\n\t\t\treturn this._requestedColumnCount;\n\t\t}\n\n\t\t/**\n\t\t * If the total combined width of the columns is larger than the width\n\t\t * of the view port, the layout will be split into pages where each\n\t\t * page is filled with the maximum number of columns that may be\n\t\t * displayed without cutting off any items.\n\t\t *\n\t\t * @default feathers.layout.Direction.NONE\n\t\t *\n\t\t * @see feathers.layout.Direction#NONE\n\t\t * @see feathers.layout.Direction#HORIZONTAL\n\t\t * @see feathers.layout.Direction#VERTICAL\n\t\t */\n\t\toverride public function get paging():String\n\t\t{\n\t\t\t//this is an override so that this class can have its own documentation.\n\t\t\treturn this._paging;\n\t\t}\n\n\t\t/**\n\t\t * If the total width of the tiles in a row (minus padding and gap)\n\t\t * does not fill the entire row, the remaining space will be distributed\n\t\t * to each tile equally.\n\t\t *\n\t\t * <p>If the container using the layout might resize, setting\n\t\t * <code>requestedColumnCount</code> is recommended because the tiles\n\t\t * will resize too, and their dimensions may not be reset.</p>\n\t\t *\n\t\t * <p>Note: If the <code>distributeWidths</code> property is set to\n\t\t * <code>true</code>, the <code>useSquareTiles</code> property will be\n\t\t * automatically changed to <code>false</code>.</p>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see #requestedColumnCount\n\t\t * @see #useSquareTiles\n\t\t */\n\t\toverride public function get distributeWidths():Boolean\n\t\t{\n\t\t\t//this is an override so that this class can have its own documentation.\n\t\t\treturn this._distributeWidths;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set distributeWidths(value:Boolean):void\n\t\t{\n\t\t\tsuper.distributeWidths = value;\n\t\t\tif(value)\n\t\t\t{\n\t\t\t\tthis.useSquareTiles = false;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * If the total height of the tiles in a column (minus padding and gap)\n\t\t * does not fill the entire column, the remaining space will be\n\t\t * distributed to each tile equally.\n\t\t *\n\t\t * <p>If the container using the layout might resize, setting\n\t\t * <code>requestedRowCount</code> is recommended because the tiles\n\t\t * will resize too, and their dimensions may not be reset.</p>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see #requestedRowCount\n\t\t */\n\t\toverride public function get distributeHeights():Boolean\n\t\t{\n\t\t\treturn this._distributeHeights;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function layout(items:Vector.<DisplayObject>, viewPortBounds:ViewPortBounds = null, result:LayoutBoundsResult = null):LayoutBoundsResult\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new LayoutBoundsResult();\n\t\t\t}\n\t\t\tif(items.length == 0)\n\t\t\t{\n\t\t\t\tresult.contentX = 0;\n\t\t\t\tresult.contentY = 0;\n\t\t\t\tresult.contentWidth = this._paddingLeft + this._paddingRight;\n\t\t\t\tresult.contentHeight = this._paddingTop + this._paddingBottom;\n\t\t\t\tresult.viewPortWidth = result.contentWidth;\n\t\t\t\tresult.viewPortHeight = result.contentHeight;\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tvar scrollX:Number = viewPortBounds ? viewPortBounds.scrollX : 0;\n\t\t\tvar scrollY:Number = viewPortBounds ? viewPortBounds.scrollY : 0;\n\t\t\tvar boundsX:Number = viewPortBounds ? viewPortBounds.x : 0;\n\t\t\tvar boundsY:Number = viewPortBounds ? viewPortBounds.y : 0;\n\t\t\tvar minWidth:Number = viewPortBounds ? viewPortBounds.minWidth : 0;\n\t\t\tvar minHeight:Number = viewPortBounds ? viewPortBounds.minHeight : 0;\n\t\t\tvar maxWidth:Number = viewPortBounds ? viewPortBounds.maxWidth : Number.POSITIVE_INFINITY;\n\t\t\tvar maxHeight:Number = viewPortBounds ? viewPortBounds.maxHeight : Number.POSITIVE_INFINITY;\n\t\t\tvar explicitWidth:Number = viewPortBounds ? viewPortBounds.explicitWidth : NaN;\n\t\t\tvar explicitHeight:Number = viewPortBounds ? viewPortBounds.explicitHeight : NaN;\n\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthis.prepareTypicalItem();\n\t\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\t\t\t}\n\t\t\tthis.validateItems(items);\n\n\t\t\tthis._discoveredItemsCache.length = 0;\n\t\t\tvar itemCount:int = items.length;\n\t\t\tvar tileWidth:Number = this._useVirtualLayout ? calculatedTypicalItemWidth : 0;\n\t\t\tvar tileHeight:Number = this._useVirtualLayout ? calculatedTypicalItemHeight : 0;\n\t\t\t//a virtual layout assumes that all items are the same size as\n\t\t\t//the typical item, so we don't need to measure every item in\n\t\t\t//that case\n\t\t\tif(!this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\t\tif(!item)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tvar itemWidth:Number = item.width;\n\t\t\t\t\tvar itemHeight:Number = item.height;\n\t\t\t\t\tif(itemWidth > tileWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\ttileWidth = itemWidth;\n\t\t\t\t\t}\n\t\t\t\t\tif(itemHeight > tileHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\ttileHeight = itemHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(tileWidth < 0)\n\t\t\t{\n\t\t\t\ttileWidth = 0;\n\t\t\t}\n\t\t\tif(tileHeight < 0)\n\t\t\t{\n\t\t\t\ttileHeight = 0;\n\t\t\t}\n\t\t\tif(this._useSquareTiles)\n\t\t\t{\n\t\t\t\tif(tileWidth > tileHeight)\n\t\t\t\t{\n\t\t\t\t\ttileHeight = tileWidth;\n\t\t\t\t}\n\t\t\t\telse if(tileHeight > tileWidth)\n\t\t\t\t{\n\t\t\t\t\ttileWidth = tileHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar verticalTileCount:int = this.calculateVerticalTileCount(tileHeight,\n\t\t\t\texplicitHeight, maxHeight, this._paddingTop + this._paddingBottom,\n\t\t\t\tthis._verticalGap, this._requestedRowCount, itemCount);\n\t\t\tif(explicitHeight === explicitHeight) //!isNaN\n\t\t\t{\n\t\t\t\tvar availableHeight:Number = explicitHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tavailableHeight = this._paddingTop + this._paddingBottom + ((tileHeight + this._verticalGap) * verticalTileCount) - this._verticalGap;\n\t\t\t\tif(availableHeight < minHeight)\n\t\t\t\t{\n\t\t\t\t\tavailableHeight = minHeight;\n\t\t\t\t}\n\t\t\t\telse if(availableHeight > maxHeight)\n\t\t\t\t{\n\t\t\t\t\tavailableHeight = maxHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._distributeHeights)\n\t\t\t{\n\t\t\t\t//distribute remaining space\n\t\t\t\ttileHeight = (availableHeight - this._paddingTop - this._paddingBottom - (verticalTileCount * this._verticalGap) + this._verticalGap) / verticalTileCount;\n\t\t\t\tif(this._useSquareTiles)\n\t\t\t\t{\n\t\t\t\t\ttileWidth = tileHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar horizontalTileCount:int = this.calculateHorizontalTileCount(tileWidth,\n\t\t\t\texplicitWidth, maxWidth, this._paddingLeft + this._paddingRight,\n\t\t\t\tthis._horizontalGap, this._requestedColumnCount, itemCount,\n\t\t\t\tverticalTileCount, this._distributeWidths && !this._useSquareTiles);\n\t\t\tif(explicitWidth === explicitWidth) //!isNaN\n\t\t\t{\n\t\t\t\tvar availableWidth:Number = explicitWidth;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tavailableWidth = this._paddingLeft + this._paddingRight + ((tileWidth + this._horizontalGap) * horizontalTileCount) - this._horizontalGap;\n\t\t\t\tif(availableWidth < minWidth)\n\t\t\t\t{\n\t\t\t\t\tavailableWidth = minWidth;\n\t\t\t\t}\n\t\t\t\telse if(availableWidth > maxWidth)\n\t\t\t\t{\n\t\t\t\t\tavailableWidth = maxWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._distributeWidths && !this._useSquareTiles)\n\t\t\t{\n\t\t\t\t//distribute remaining space\n\t\t\t\ttileWidth = (availableWidth - this._paddingLeft - this._paddingRight - (horizontalTileCount * this._horizontalGap) + this._horizontalGap) / horizontalTileCount;\n\t\t\t}\n\n\t\t\tvar totalPageContentWidth:Number = horizontalTileCount * (tileWidth + this._horizontalGap) - this._horizontalGap + this._paddingLeft + this._paddingRight;\n\t\t\tvar totalPageContentHeight:Number = verticalTileCount * (tileHeight + this._verticalGap) - this._verticalGap + this._paddingTop + this._paddingBottom;\n\n\t\t\tvar startX:Number = boundsX + this._paddingLeft;\n\t\t\tvar startY:Number = boundsY + this._paddingTop;\n\n\t\t\tvar perPage:int = horizontalTileCount * verticalTileCount;\n\t\t\tvar pageIndex:int = 0;\n\t\t\tvar nextPageStartIndex:int = perPage;\n\t\t\tvar pageStartY:Number = startY;\n\t\t\tvar positionX:Number = startX;\n\t\t\tvar positionY:Number = startY;\n\t\t\tvar itemIndex:int = 0;\n\t\t\tvar discoveredItemsCachePushIndex:int = 0;\n\t\t\tfor(i = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\titem = items[i];\n\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(itemIndex != 0 && i % verticalTileCount == 0)\n\t\t\t\t{\n\t\t\t\t\tpositionX += tileWidth + this._horizontalGap;\n\t\t\t\t\tpositionY = pageStartY;\n\t\t\t\t}\n\t\t\t\tif(itemIndex == nextPageStartIndex)\n\t\t\t\t{\n\t\t\t\t\t//we're starting a new page, so handle alignment of the\n\t\t\t\t\t//items on the current page and update the positions\n\t\t\t\t\tif(this._paging !== Direction.NONE)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar discoveredItems:Vector.<DisplayObject> = this._useVirtualLayout ? this._discoveredItemsCache : items;\n\t\t\t\t\t\tvar discoveredItemsFirstIndex:int = this._useVirtualLayout ? 0 : (itemIndex - perPage);\n\t\t\t\t\t\tvar discoveredItemsLastIndex:int = this._useVirtualLayout ? (this._discoveredItemsCache.length - 1) : (itemIndex - 1);\n\t\t\t\t\t\tthis.applyHorizontalAlign(discoveredItems, discoveredItemsFirstIndex, discoveredItemsLastIndex, totalPageContentWidth, availableWidth);\n\t\t\t\t\t\tthis.applyVerticalAlign(discoveredItems, discoveredItemsFirstIndex, discoveredItemsLastIndex, totalPageContentHeight, availableHeight);\n\t\t\t\t\t\tthis._discoveredItemsCache.length = 0;\n\t\t\t\t\t\tdiscoveredItemsCachePushIndex = 0;\n\t\t\t\t\t}\n\t\t\t\t\tpageIndex++;\n\t\t\t\t\tnextPageStartIndex += perPage;\n\n\t\t\t\t\t//we can use availableWidth and availableHeight here without\n\t\t\t\t\t//checking if they're NaN because we will never reach a\n\t\t\t\t\t//new page without them already being calculated.\n\t\t\t\t\tif(this._paging === Direction.HORIZONTAL)\n\t\t\t\t\t{\n\t\t\t\t\t\tpositionX = startX + availableWidth * pageIndex;\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._paging === Direction.VERTICAL)\n\t\t\t\t\t{\n\t\t\t\t\t\tpositionX = startX;\n\t\t\t\t\t\tpositionY = pageStartY = startY + availableHeight * pageIndex;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(item)\n\t\t\t\t{\n\t\t\t\t\tswitch(this._tileHorizontalAlign)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase HorizontalAlign.JUSTIFY:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.x = item.pivotX + positionX;\n\t\t\t\t\t\t\titem.width = tileWidth;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase HorizontalAlign.LEFT:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.x = item.pivotX + positionX;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase HorizontalAlign.RIGHT:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.x = item.pivotX + positionX + tileWidth - item.width;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdefault: //center or unknown\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.x = item.pivotX + positionX + Math.round((tileWidth - item.width) / 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tswitch(this._tileVerticalAlign)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase VerticalAlign.JUSTIFY:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.y = item.pivotY + positionY;\n\t\t\t\t\t\t\titem.height = tileHeight;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase VerticalAlign.TOP:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.y = item.pivotY + positionY;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase VerticalAlign.BOTTOM:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.y = item.pivotY + positionY + tileHeight - item.height;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdefault: //middle or unknown\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.y = item.pivotY + positionY + Math.round((tileHeight - item.height) / 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(this._useVirtualLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._discoveredItemsCache[discoveredItemsCachePushIndex] = item;\n\t\t\t\t\t\tdiscoveredItemsCachePushIndex++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tpositionY += tileHeight + this._verticalGap;\n\t\t\t\titemIndex++;\n\t\t\t}\n\t\t\t//align the last page\n\t\t\tif(this._paging !== Direction.NONE)\n\t\t\t{\n\t\t\t\tdiscoveredItems = this._useVirtualLayout ? this._discoveredItemsCache : items;\n\t\t\t\tdiscoveredItemsFirstIndex = this._useVirtualLayout ? 0 : (nextPageStartIndex - perPage);\n\t\t\t\tdiscoveredItemsLastIndex = this._useVirtualLayout ? (this._discoveredItemsCache.length - 1) : (i - 1);\n\t\t\t\tthis.applyHorizontalAlign(discoveredItems, discoveredItemsFirstIndex, discoveredItemsLastIndex, totalPageContentWidth, availableWidth);\n\t\t\t\tthis.applyVerticalAlign(discoveredItems, discoveredItemsFirstIndex, discoveredItemsLastIndex, totalPageContentHeight, availableHeight);\n\t\t\t}\n\n\t\t\tif(this._paging === Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tvar totalWidth:Number = availableWidth;\n\t\t\t}\n\t\t\telse if(this._paging === Direction.HORIZONTAL)\n\t\t\t{\n\t\t\t\ttotalWidth = Math.ceil(itemCount / perPage) * availableWidth;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttotalWidth = positionX + tileWidth + this._paddingRight;\n\t\t\t\tif(totalWidth < totalPageContentWidth)\n\t\t\t\t{\n\t\t\t\t\ttotalWidth = totalPageContentWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._paging === Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tvar totalHeight:Number = Math.ceil(itemCount / perPage) * availableHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttotalHeight = totalPageContentHeight;\n\t\t\t}\n\n\t\t\tif(this._paging === Direction.NONE)\n\t\t\t{\n\t\t\t\tdiscoveredItems = this._useVirtualLayout ? this._discoveredItemsCache : items;\n\t\t\t\tdiscoveredItemsLastIndex = discoveredItems.length - 1;\n\t\t\t\tthis.applyHorizontalAlign(discoveredItems, 0, discoveredItemsLastIndex, totalWidth, availableWidth);\n\t\t\t\tthis.applyVerticalAlign(discoveredItems, 0, discoveredItemsLastIndex, totalHeight, availableHeight);\n\t\t\t}\n\t\t\tthis._discoveredItemsCache.length = 0;\n\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new LayoutBoundsResult();\n\t\t\t}\n\t\t\tresult.contentX = 0;\n\t\t\tresult.contentY = 0;\n\t\t\tresult.contentWidth = totalWidth;\n\t\t\tresult.contentHeight = totalHeight;\n\t\t\tresult.viewPortWidth = availableWidth;\n\t\t\tresult.viewPortHeight = availableHeight;\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function measureViewPort(itemCount:int, viewPortBounds:ViewPortBounds = null, result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\t\t\tif(!this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"measureViewPort() may be called only if useVirtualLayout is true.\");\n\t\t\t}\n\n\t\t\tvar explicitWidth:Number = viewPortBounds ? viewPortBounds.explicitWidth : NaN;\n\t\t\tvar explicitHeight:Number = viewPortBounds ? viewPortBounds.explicitHeight : NaN;\n\t\t\tvar needsWidth:Boolean = explicitWidth !== explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = explicitHeight !== explicitHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight)\n\t\t\t{\n\t\t\t\tresult.x = explicitWidth;\n\t\t\t\tresult.y = explicitHeight;\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tvar boundsX:Number = viewPortBounds ? viewPortBounds.x : 0;\n\t\t\tvar boundsY:Number = viewPortBounds ? viewPortBounds.y : 0;\n\t\t\tvar minWidth:Number = viewPortBounds ? viewPortBounds.minWidth : 0;\n\t\t\tvar minHeight:Number = viewPortBounds ? viewPortBounds.minHeight : 0;\n\t\t\tvar maxWidth:Number = viewPortBounds ? viewPortBounds.maxWidth : Number.POSITIVE_INFINITY;\n\t\t\tvar maxHeight:Number = viewPortBounds ? viewPortBounds.maxHeight : Number.POSITIVE_INFINITY;\n\n\t\t\tthis.prepareTypicalItem();\n\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\n\t\t\tvar tileWidth:Number = calculatedTypicalItemWidth;\n\t\t\tvar tileHeight:Number = calculatedTypicalItemHeight;\n\t\t\tif(tileWidth < 0)\n\t\t\t{\n\t\t\t\ttileWidth = 0;\n\t\t\t}\n\t\t\tif(tileHeight < 0)\n\t\t\t{\n\t\t\t\ttileHeight = 0;\n\t\t\t}\n\t\t\tif(this._useSquareTiles)\n\t\t\t{\n\t\t\t\tif(tileWidth > tileHeight)\n\t\t\t\t{\n\t\t\t\t\ttileHeight = tileWidth;\n\t\t\t\t}\n\t\t\t\telse if(tileHeight > tileWidth)\n\t\t\t\t{\n\t\t\t\t\ttileWidth = tileHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar verticalTileCount:int = this.calculateVerticalTileCount(tileHeight,\n\t\t\t\texplicitHeight, maxHeight, this._paddingTop + this._paddingBottom,\n\t\t\t\tthis._verticalGap, this._requestedRowCount, itemCount);\n\t\t\tvar horizontalTileCount:int = this.calculateHorizontalTileCount(tileWidth,\n\t\t\t\texplicitWidth, maxWidth, this._paddingLeft + this._paddingRight,\n\t\t\t\tthis._horizontalGap, this._requestedColumnCount, itemCount,\n\t\t\t\tverticalTileCount, this._distributeWidths && !this._useSquareTiles);\n\t\t\tif(explicitHeight === explicitHeight) //!isNaN\n\t\t\t{\n\t\t\t\tvar availableHeight:Number = explicitHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tavailableHeight = this._paddingTop + this._paddingBottom + ((tileHeight + this._verticalGap) * verticalTileCount) - this._verticalGap;\n\t\t\t\tif(availableHeight < minHeight)\n\t\t\t\t{\n\t\t\t\t\tavailableHeight = minHeight;\n\t\t\t\t}\n\t\t\t\telse if(availableHeight > maxHeight)\n\t\t\t\t{\n\t\t\t\t\tavailableHeight = maxHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(explicitWidth === explicitWidth) //!isNaN\n\t\t\t{\n\t\t\t\tvar availableWidth:Number = explicitWidth;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tavailableWidth = this._paddingLeft + this._paddingRight + ((tileWidth + this._horizontalGap) * horizontalTileCount) - this._horizontalGap;\n\t\t\t\tif(availableWidth < minWidth)\n\t\t\t\t{\n\t\t\t\t\tavailableWidth = minWidth;\n\t\t\t\t}\n\t\t\t\telse if(availableWidth > maxWidth)\n\t\t\t\t{\n\t\t\t\t\tavailableWidth = maxWidth;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar totalPageContentWidth:Number = horizontalTileCount * (tileWidth + this._horizontalGap) - this._horizontalGap + this._paddingLeft + this._paddingRight;\n\t\t\tvar totalPageContentHeight:Number = verticalTileCount * (tileHeight + this._verticalGap) - this._verticalGap + this._paddingTop + this._paddingBottom;\n\n\t\t\tvar startX:Number = boundsX + this._paddingLeft;\n\n\t\t\tvar perPage:int = horizontalTileCount * verticalTileCount;\n\t\t\tvar pageIndex:int = 0;\n\t\t\tvar nextPageStartIndex:int = perPage;\n\t\t\tvar positionX:Number = startX;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tif(i != 0 && i % verticalTileCount == 0)\n\t\t\t\t{\n\t\t\t\t\tpositionX += tileWidth + this._horizontalGap;\n\t\t\t\t}\n\t\t\t\tif(i == nextPageStartIndex)\n\t\t\t\t{\n\t\t\t\t\tpageIndex++;\n\t\t\t\t\tnextPageStartIndex += perPage;\n\n\t\t\t\t\t//we can use availableWidth and availableHeight here without\n\t\t\t\t\t//checking if they're NaN because we will never reach a\n\t\t\t\t\t//new page without them already being calculated.\n\t\t\t\t\tif(this._paging === Direction.HORIZONTAL)\n\t\t\t\t\t{\n\t\t\t\t\t\tpositionX = startX + availableWidth * pageIndex;\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._paging === Direction.VERTICAL)\n\t\t\t\t\t{\n\t\t\t\t\t\tpositionX = startX;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(this._paging === Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tvar totalWidth:Number = availableWidth;\n\t\t\t}\n\t\t\telse if(this._paging === Direction.HORIZONTAL)\n\t\t\t{\n\t\t\t\ttotalWidth = Math.ceil(itemCount / perPage) * availableWidth;\n\t\t\t}\n\t\t\telse //none\n\t\t\t{\n\t\t\t\ttotalWidth = positionX + tileWidth + this._paddingRight;\n\t\t\t\tif(totalWidth < totalPageContentWidth)\n\t\t\t\t{\n\t\t\t\t\ttotalWidth = totalPageContentWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._paging === Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tvar totalHeight:Number = Math.ceil(itemCount / perPage) * availableHeight;\n\t\t\t}\n\t\t\telse //horizontal or none\n\t\t\t{\n\t\t\t\ttotalHeight = totalPageContentHeight;\n\t\t\t}\n\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tvar resultX:Number = totalWidth;\n\t\t\t\tif(resultX < minWidth)\n\t\t\t\t{\n\t\t\t\t\tresultX = minWidth;\n\t\t\t\t}\n\t\t\t\telse if(resultX > maxWidth)\n\t\t\t\t{\n\t\t\t\t\tresultX = maxWidth;\n\t\t\t\t}\n\t\t\t\tresult.x = resultX;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult.x = explicitWidth;\n\t\t\t}\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tvar resultY:Number = totalHeight;\n\t\t\t\tif(resultY < minHeight)\n\t\t\t\t{\n\t\t\t\t\tresultY = minHeight;\n\t\t\t\t}\n\t\t\t\telse if(resultY > maxHeight)\n\t\t\t\t{\n\t\t\t\t\tresultY = maxHeight;\n\t\t\t\t}\n\t\t\t\tresult.y = resultY;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult.y = explicitHeight;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getVisibleIndicesAtScrollPosition(scrollX:Number, scrollY:Number, width:Number, height:Number, itemCount:int, result:Vector.<int> = null):Vector.<int>\n\t\t{\n\t\t\tif(result)\n\t\t\t{\n\t\t\t\tresult.length = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult = new <int>[];\n\t\t\t}\n\t\t\tif(!this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"getVisibleIndicesAtScrollPosition() may be called only if useVirtualLayout is true.\");\n\t\t\t}\n\n\t\t\tif(this._paging === Direction.HORIZONTAL)\n\t\t\t{\n\t\t\t\tthis.getVisibleIndicesAtScrollPositionWithHorizontalPaging(scrollX, scrollY, width, height, itemCount, result);\n\t\t\t}\n\t\t\telse if(this._paging === Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tthis.getVisibleIndicesAtScrollPositionWithVerticalPaging(scrollX, scrollY, width, height, itemCount, result);\n\t\t\t}\n\t\t\telse //none\n\t\t\t{\n\t\t\t\tthis.getVisibleIndicesAtScrollPositionWithoutPaging(scrollX, scrollY, width, height, itemCount, result);\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function calculateNavigationDestination(items:Vector.<DisplayObject>, index:int, keyCode:uint, bounds:LayoutBoundsResult):int\n\t\t{\n\t\t\tvar result:int = index;\n\t\t\tif(keyCode == Keyboard.HOME)\n\t\t\t{\n\t\t\t\tif(items.length > 0)\n\t\t\t\t{\n\t\t\t\t\tresult = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.END)\n\t\t\t{\n\t\t\t\tresult = items.length - 1;\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.UP)\n\t\t\t{\n\t\t\t\tresult--;\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.DOWN)\n\t\t\t{\n\t\t\t\tresult++;\n\t\t\t}\n\t\t\tif(result < 0)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tif(result >= items.length)\n\t\t\t{\n\t\t\t\treturn items.length - 1;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getNearestScrollPositionForIndex(index:int, scrollX:Number, scrollY:Number, items:Vector.<DisplayObject>,\n\t\t\tx:Number, y:Number, width:Number, height:Number, result:Point = null):Point\n\t\t{\n\t\t\treturn this.calculateScrollPositionForIndex(index, items, x, y, width, height, result, true, scrollX, scrollY);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getScrollPositionForIndex(index:int, items:Vector.<DisplayObject>,\n\t\t\tx:Number, y:Number, width:Number, height:Number, result:Point = null):Point\n\t\t{\n\t\t\treturn this.calculateScrollPositionForIndex(index, items, x, y, width, height, result, false);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getDropIndex(x:Number, y:Number, items:Vector.<DisplayObject>,\n\t\t\tboundsX:Number, boundsY:Number, width:Number, height:Number):int\n\t\t{\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthis.prepareTypicalItem();\n\t\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\t\t\t}\n\n\t\t\tvar itemCount:int = items.length;\n\t\t\tvar tileWidth:Number = this._useVirtualLayout ? calculatedTypicalItemWidth : 0;\n\t\t\tvar tileHeight:Number = this._useVirtualLayout ? calculatedTypicalItemHeight : 0;\n\t\t\t//a virtual layout assumes that all items are the same size as\n\t\t\t//the typical item, so we don't need to measure every item in\n\t\t\t//that case\n\t\t\tif(!this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\t\tif(!item)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tvar itemWidth:Number = item.width;\n\t\t\t\t\tvar itemHeight:Number = item.height;\n\t\t\t\t\tif(itemWidth > tileWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\ttileWidth = itemWidth;\n\t\t\t\t\t}\n\t\t\t\t\tif(itemHeight > tileHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\ttileHeight = itemHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(tileWidth < 0)\n\t\t\t{\n\t\t\t\ttileWidth = 0;\n\t\t\t}\n\t\t\tif(tileHeight < 0)\n\t\t\t{\n\t\t\t\ttileHeight = 0;\n\t\t\t}\n\t\t\tif(this._useSquareTiles)\n\t\t\t{\n\t\t\t\tif(tileWidth > tileHeight)\n\t\t\t\t{\n\t\t\t\t\ttileHeight = tileWidth;\n\t\t\t\t}\n\t\t\t\telse if(tileHeight > tileWidth)\n\t\t\t\t{\n\t\t\t\t\ttileWidth = tileHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar horizontalTileCount:int = (width - this._paddingLeft - this._paddingRight + this._horizontalGap) / (tileWidth + this._horizontalGap);\n\t\t\tif(horizontalTileCount < 1)\n\t\t\t{\n\t\t\t\thorizontalTileCount = 1;\n\t\t\t}\n\t\t\telse if(this._requestedColumnCount > 0 && horizontalTileCount > this._requestedColumnCount)\n\t\t\t{\n\t\t\t\thorizontalTileCount = this._requestedColumnCount;\n\t\t\t}\n\t\t\tvar verticalTileCount:int = (height - this._paddingTop - this._paddingBottom + this._verticalGap) / (tileHeight + this._verticalGap);\n\t\t\tif(verticalTileCount < 1)\n\t\t\t{\n\t\t\t\tverticalTileCount = 1;\n\t\t\t}\n\t\t\telse if(this._requestedRowCount > 0 && verticalTileCount > this._requestedRowCount)\n\t\t\t{\n\t\t\t\tverticalTileCount = this._requestedRowCount;\n\t\t\t}\n\t\t\tvar perPage:Number = horizontalTileCount * verticalTileCount;\n\t\t\tvar startY:Number = boundsY + this._paddingTop;\n\t\t\tvar actualVerticalTileCount:int = verticalTileCount;\n\t\t\tif(actualVerticalTileCount > itemCount)\n\t\t\t{\n\t\t\t\tactualVerticalTileCount = itemCount;\n\t\t\t}\n\t\t\tif(this._verticalAlign == VerticalAlign.BOTTOM)\n\t\t\t{\n\t\t\t\tstartY = boundsY + this._paddingTop + (height - this._paddingTop - this._paddingBottom) -\n\t\t\t\t\t((actualVerticalTileCount * (tileHeight + this._verticalGap)) - this._verticalGap);\n\t\t\t}\n\t\t\telse if(this._verticalAlign == VerticalAlign.MIDDLE)\n\t\t\t{\n\t\t\t\tstartY = boundsY + this._paddingTop + ((height - this._paddingTop - this._paddingBottom) -\n\t\t\t\t\t((actualVerticalTileCount * (tileHeight + this._verticalGap)) - this._verticalGap)) / 2;\n\t\t\t}\n\t\t\tvar startX:Number = boundsX + this._paddingLeft;\n\t\t\tif(this._paging != Direction.NONE || itemCount <= perPage)\n\t\t\t{\n\t\t\t\tvar actualHorizontalTileCount:int = horizontalTileCount;\n\t\t\t\tif(itemCount <= perPage)\n\t\t\t\t{\n\t\t\t\t\tactualHorizontalTileCount = Math.ceil(itemCount / actualVerticalTileCount);\n\t\t\t\t}\n\t\t\t\tif(this._horizontalAlign == HorizontalAlign.RIGHT)\n\t\t\t\t{\n\t\t\t\t\tstartX = boundsX + this._paddingLeft + (width - this._paddingLeft - this._paddingRight) -\n\t\t\t\t\t\t((actualHorizontalTileCount * (tileWidth + this._horizontalGap)) - this._horizontalGap);\n\t\t\t\t}\n\t\t\t\telse if(this._horizontalAlign == HorizontalAlign.CENTER)\n\t\t\t\t{\n\t\t\t\t\tstartX = boundsX + this._paddingLeft + ((width - this._paddingLeft - this._paddingRight) -\n\t\t\t\t\t\t((actualHorizontalTileCount * (tileWidth + this._horizontalGap)) - this._horizontalGap)) / 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar pageIndex:int = 0;\n\t\t\tvar columnIndex:int = 0;\n\t\t\tvar lastColumnIndex:int = int((itemCount - 1) / verticalTileCount);\n\t\t\tvar nextPageStartIndex:int = perPage;\n\t\t\tvar pageStartY:Number = startY;\n\t\t\tvar positionX:Number = startX;\n\t\t\tvar positionY:Number = startY;\n\t\t\tfor(i = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\titem = items[i];\n\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(i != 0 && i % verticalTileCount == 0)\n\t\t\t\t{\n\t\t\t\t\tif((y < (pageStartY + height)) && (x < (positionX + tileWidth + (this._horizontalGap / 2))))\n\t\t\t\t\t{\n\t\t\t\t\t\t//we're at the end of the previous column (but we also make\n\t\t\t\t\t\t//sure that we're not on the next page)\n\t\t\t\t\t\treturn i;\n\t\t\t\t\t}\n\t\t\t\t\tpositionY = pageStartY;\n\t\t\t\t\tpositionX += tileWidth + this._horizontalGap;\n\t\t\t\t}\n\t\t\t\tif(i == nextPageStartIndex)\n\t\t\t\t{\n\t\t\t\t\tpageIndex++;\n\t\t\t\t\tnextPageStartIndex += perPage;\n\n\t\t\t\t\t//we can use availableWidth and availableHeight here without\n\t\t\t\t\t//checking if they're NaN because we will never reach a\n\t\t\t\t\t//new page without them already being calculated.\n\t\t\t\t\tif(this._paging === Direction.HORIZONTAL)\n\t\t\t\t\t{\n\t\t\t\t\t\tpositionX = startX + width * pageIndex;\n\t\t\t\t\t\tpositionY = startY;\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._paging === Direction.VERTICAL)\n\t\t\t\t\t{\n\t\t\t\t\t\tpositionY = pageStartY = startY + height * pageIndex;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif((y < (positionY + (tileHeight / 2))) &&\n\t\t\t\t\t((x < (positionX + tileWidth + (this._horizontalGap / 2))) || (columnIndex == lastColumnIndex)))\n\t\t\t\t{\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t\tpositionY += tileHeight + this._verticalGap;\n\t\t\t}\n\t\t\treturn i;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function positionDropIndicator(dropIndicator:DisplayObject, index:int,\n\t\t\tx:Number, y:Number, items:Vector.<DisplayObject>, width:Number, height:Number):void\n\t\t{\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthis.prepareTypicalItem();\n\t\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\t\t\t}\n\n\t\t\tvar itemCount:int = items.length;\n\t\t\tvar tileWidth:Number = this._useVirtualLayout ? calculatedTypicalItemWidth : 0;\n\t\t\tvar tileHeight:Number = this._useVirtualLayout ? calculatedTypicalItemHeight : 0;\n\t\t\t//a virtual layout assumes that all items are the same size as\n\t\t\t//the typical item, so we don't need to measure every item in\n\t\t\t//that case\n\t\t\tif(!this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\t\tif(!item)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tvar itemWidth:Number = item.width;\n\t\t\t\t\tvar itemHeight:Number = item.height;\n\t\t\t\t\tif(itemWidth > tileWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\ttileWidth = itemWidth;\n\t\t\t\t\t}\n\t\t\t\t\tif(itemHeight > tileHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\ttileHeight = itemHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(tileWidth < 0)\n\t\t\t{\n\t\t\t\ttileWidth = 0;\n\t\t\t}\n\t\t\tif(tileHeight < 0)\n\t\t\t{\n\t\t\t\ttileHeight = 0;\n\t\t\t}\n\t\t\tif(this._useSquareTiles)\n\t\t\t{\n\t\t\t\tif(tileWidth > tileHeight)\n\t\t\t\t{\n\t\t\t\t\ttileHeight = tileWidth;\n\t\t\t\t}\n\t\t\t\telse if(tileHeight > tileWidth)\n\t\t\t\t{\n\t\t\t\t\ttileWidth = tileHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar horizontalTileCount:int = (width - this._paddingLeft - this._paddingRight + this._horizontalGap) / (tileWidth + this._horizontalGap);\n\t\t\tif(horizontalTileCount < 1)\n\t\t\t{\n\t\t\t\thorizontalTileCount = 1;\n\t\t\t}\n\t\t\telse if(this._requestedColumnCount > 0 && horizontalTileCount > this._requestedColumnCount)\n\t\t\t{\n\t\t\t\thorizontalTileCount = this._requestedColumnCount;\n\t\t\t}\n\t\t\tvar verticalTileCount:int = (height - this._paddingTop - this._paddingBottom + this._verticalGap) / (tileHeight + this._verticalGap);\n\t\t\tif(verticalTileCount < 1)\n\t\t\t{\n\t\t\t\tverticalTileCount = 1;\n\t\t\t}\n\t\t\telse if(this._requestedRowCount > 0 && verticalTileCount > this._requestedRowCount)\n\t\t\t{\n\t\t\t\tverticalTileCount = this._requestedRowCount;\n\t\t\t}\n\t\t\tvar perPage:Number = horizontalTileCount * verticalTileCount;\n\t\t\tvar startY:Number = this._paddingTop;\n\t\t\tvar actualVerticalTileCount:int = verticalTileCount;\n\t\t\tif(actualVerticalTileCount > itemCount)\n\t\t\t{\n\t\t\t\tactualVerticalTileCount = itemCount;\n\t\t\t}\n\t\t\tif(this._verticalAlign == VerticalAlign.BOTTOM)\n\t\t\t{\n\t\t\t\tstartY = this._paddingTop + (height - this._paddingTop - this._paddingBottom) -\n\t\t\t\t\t((actualVerticalTileCount * (tileHeight + this._verticalGap)) - this._verticalGap);\n\t\t\t}\n\t\t\telse if(this._verticalAlign == VerticalAlign.MIDDLE)\n\t\t\t{\n\t\t\t\tstartY = this._paddingTop + ((height - this._paddingTop - this._paddingBottom) -\n\t\t\t\t\t((actualVerticalTileCount * (tileHeight + this._verticalGap)) - this._verticalGap)) / 2;\n\t\t\t}\n\t\t\tvar startX:Number = this._paddingLeft;\n\t\t\tif(this._paging != Direction.NONE || itemCount <= perPage)\n\t\t\t{\n\t\t\t\tvar actualHorizontalTileCount:int = horizontalTileCount;\n\t\t\t\tif(itemCount <= perPage)\n\t\t\t\t{\n\t\t\t\t\tactualHorizontalTileCount = Math.ceil(itemCount / actualVerticalTileCount);\n\t\t\t\t}\n\t\t\t\tif(this._horizontalAlign == HorizontalAlign.RIGHT)\n\t\t\t\t{\n\t\t\t\t\tstartX = this._paddingLeft + (width - this._paddingLeft - this._paddingRight) -\n\t\t\t\t\t\t((actualHorizontalTileCount * (tileWidth + this._horizontalGap)) - this._horizontalGap);\n\t\t\t\t}\n\t\t\t\telse if(this._horizontalAlign == HorizontalAlign.CENTER)\n\t\t\t\t{\n\t\t\t\t\tstartX = this._paddingLeft + ((width - this._paddingLeft - this._paddingRight) -\n\t\t\t\t\t\t((actualHorizontalTileCount * (tileWidth + this._horizontalGap)) - this._horizontalGap)) / 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar pageIndex:int = 0;\n\t\t\tvar columnIndex:int = 0;\n\t\t\tvar lastColumnIndex:int = int((itemCount - 1) / verticalTileCount);\n\t\t\tvar nextPageStartIndex:int = perPage;\n\t\t\tvar pageStartY:Number = startY;\n\t\t\tvar positionX:Number = startX;\n\t\t\tvar positionY:Number = startY;\n\t\t\tvar columnItemCount:int = 0;\n\t\t\tfor(i = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\titem = items[i];\n\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(i != 0 && i % verticalTileCount == 0)\n\t\t\t\t{\n\t\t\t\t\t//start of a new column\n\t\t\t\t\tpositionX += tileWidth + this._horizontalGap;\n\t\t\t\t\tpositionY = pageStartY;\n\t\t\t\t\tcolumnItemCount = 0;\n\t\t\t\t\tcolumnIndex++;\n\t\t\t\t}\n\t\t\t\tif(i == nextPageStartIndex)\n\t\t\t\t{\n\t\t\t\t\t//start of a new page\n\t\t\t\t\tpageIndex++;\n\t\t\t\t\tnextPageStartIndex += perPage;\n\t\t\t\t\tif(this._paging === Direction.HORIZONTAL)\n\t\t\t\t\t{\n\t\t\t\t\t\tpositionX = startX + width * pageIndex;\n\t\t\t\t\t\tpositionY = startY;\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._paging === Direction.VERTICAL)\n\t\t\t\t\t{\n\t\t\t\t\t\tpositionX = startX;\n\t\t\t\t\t\tpositionY = pageStartY = startY + height * pageIndex;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif((y < (positionY + (tileHeight / 2))) &&\n\t\t\t\t\t((x < (positionX + tileWidth + (this._horizontalGap / 2))) || (columnIndex == lastColumnIndex)))\n\t\t\t\t{\n\t\t\t\t\tdropIndicator.x = positionX;\n\t\t\t\t\tdropIndicator.y = positionY - dropIndicator.height / 2;\n\t\t\t\t\tdropIndicator.width = tileWidth;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tpositionY += tileHeight + this._verticalGap;\n\n\t\t\t\tif(columnItemCount > 0 &&\n\t\t\t\t\t(y < (positionY + (tileHeight / 2))) &&\n\t\t\t\t\t(y < (pageStartY + height)) && //not on next page\n\t\t\t\t\t(positionY + tileHeight) > (height - this._paddingBottom) &&\n\t\t\t\t\t(x < (positionX + tileWidth + (this._horizontalGap / 2))))\n\t\t\t\t{\n\t\t\t\t\t//index on next row, but position drop indicator at the end\n\t\t\t\t\t//of the current row\n\t\t\t\t\tdropIndicator.x = positionX;\n\t\t\t\t\tdropIndicator.y = positionY - this._verticalGap - dropIndicator.height / 2;\n\t\t\t\t\tdropIndicator.width = tileWidth;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcolumnItemCount++;\n\t\t\t}\n\t\t\tdropIndicator.x = positionX;\n\t\t\tdropIndicator.y = positionY - dropIndicator.height / 2;\n\t\t\tdropIndicator.width = tileWidth;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function applyHorizontalAlign(items:Vector.<DisplayObject>, startIndex:int, endIndex:int, totalItemWidth:Number, availableWidth:Number):void\n\t\t{\n\t\t\tif(totalItemWidth >= availableWidth)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar horizontalAlignOffsetX:Number = 0;\n\t\t\tif(this._horizontalAlign === HorizontalAlign.RIGHT)\n\t\t\t{\n\t\t\t\thorizontalAlignOffsetX = availableWidth - totalItemWidth;\n\t\t\t}\n\t\t\telse if(this._horizontalAlign !== HorizontalAlign.LEFT)\n\t\t\t{\n\t\t\t\t//we're going to default to center if we encounter an\n\t\t\t\t//unknown value\n\t\t\t\thorizontalAlignOffsetX = Math.round((availableWidth - totalItemWidth) / 2);\n\t\t\t}\n\t\t\tif(horizontalAlignOffsetX != 0)\n\t\t\t{\n\t\t\t\tfor(var i:int = startIndex; i <= endIndex; i++)\n\t\t\t\t{\n\t\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\titem.x += horizontalAlignOffsetX;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function applyVerticalAlign(items:Vector.<DisplayObject>, startIndex:int, endIndex:int, totalItemHeight:Number, availableHeight:Number):void\n\t\t{\n\t\t\tif(totalItemHeight >= availableHeight)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar verticalAlignOffsetY:Number = 0;\n\t\t\tif(this._verticalAlign === VerticalAlign.BOTTOM)\n\t\t\t{\n\t\t\t\tverticalAlignOffsetY = availableHeight - totalItemHeight;\n\t\t\t}\n\t\t\telse if(this._verticalAlign === VerticalAlign.MIDDLE)\n\t\t\t{\n\t\t\t\tverticalAlignOffsetY = Math.round((availableHeight - totalItemHeight) / 2);\n\t\t\t}\n\t\t\tif(verticalAlignOffsetY != 0)\n\t\t\t{\n\t\t\t\tfor(var i:int = startIndex; i <= endIndex; i++)\n\t\t\t\t{\n\t\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\titem.y += verticalAlignOffsetY;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getVisibleIndicesAtScrollPositionWithHorizontalPaging(scrollX:Number, scrollY:Number, width:Number, height:Number, itemCount:int, result:Vector.<int>):void\n\t\t{\n\t\t\tthis.prepareTypicalItem();\n\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\n\t\t\tvar tileWidth:Number = calculatedTypicalItemWidth;\n\t\t\tvar tileHeight:Number = calculatedTypicalItemHeight;\n\t\t\tif(tileWidth < 0)\n\t\t\t{\n\t\t\t\ttileWidth = 0;\n\t\t\t}\n\t\t\tif(tileHeight < 0)\n\t\t\t{\n\t\t\t\ttileHeight = 0;\n\t\t\t}\n\t\t\tif(this._useSquareTiles)\n\t\t\t{\n\t\t\t\tif(tileWidth > tileHeight)\n\t\t\t\t{\n\t\t\t\t\ttileHeight = tileWidth;\n\t\t\t\t}\n\t\t\t\telse if(tileHeight > tileWidth)\n\t\t\t\t{\n\t\t\t\t\ttileWidth = tileHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar verticalTileCount:int = this.calculateVerticalTileCount(tileHeight,\n\t\t\t\theight, height, this._paddingTop + this._paddingBottom,\n\t\t\t\tthis._verticalGap, this._requestedRowCount, itemCount);\n\t\t\tif(this._distributeHeights)\n\t\t\t{\n\t\t\t\ttileHeight = (height - this._paddingTop - this._paddingBottom - (verticalTileCount * this._verticalGap) + this._verticalGap) / verticalTileCount;\n\t\t\t\tif(this._useSquareTiles)\n\t\t\t\t{\n\t\t\t\t\ttileWidth = tileHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar horizontalTileCount:int = this.calculateHorizontalTileCount(tileWidth,\n\t\t\t\twidth, width, this._paddingLeft + this._paddingRight,\n\t\t\t\tthis._horizontalGap, this._requestedColumnCount, itemCount,\n\t\t\t\tverticalTileCount, this._distributeWidths && !this._useSquareTiles);\n\t\t\tif(this._distributeWidths && !this._useSquareTiles)\n\t\t\t{\n\t\t\t\ttileWidth = (width - this._paddingLeft - this._paddingRight - (horizontalTileCount * this._horizontalGap) + this._horizontalGap) / horizontalTileCount;\n\t\t\t}\n\t\t\tvar perPage:int = horizontalTileCount * verticalTileCount;\n\t\t\tvar minimumItemCount:int = perPage + 2 * verticalTileCount;\n\t\t\tif(minimumItemCount > itemCount)\n\t\t\t{\n\t\t\t\tminimumItemCount = itemCount;\n\t\t\t}\n\n\t\t\tvar startPageIndex:int = Math.round(scrollX / width);\n\t\t\tvar minimum:int = startPageIndex * perPage;\n\t\t\tvar totalRowWidth:Number = horizontalTileCount * (tileWidth + this._horizontalGap) - this._horizontalGap;\n\t\t\tvar leftSideOffset:Number = 0;\n\t\t\tvar rightSideOffset:Number = 0;\n\t\t\tif(totalRowWidth < width)\n\t\t\t{\n\t\t\t\tif(this._horizontalAlign === HorizontalAlign.RIGHT)\n\t\t\t\t{\n\t\t\t\t\tleftSideOffset = width - this._paddingLeft - this._paddingRight - totalRowWidth;\n\t\t\t\t\trightSideOffset = 0;\n\t\t\t\t}\n\t\t\t\telse if(this._horizontalAlign === HorizontalAlign.CENTER)\n\t\t\t\t{\n\t\t\t\t\tleftSideOffset = rightSideOffset = Math.round((width - this._paddingLeft - this._paddingRight - totalRowWidth) / 2);\n\t\t\t\t}\n\t\t\t\telse //left\n\t\t\t\t{\n\t\t\t\t\tleftSideOffset = 0;\n\t\t\t\t\trightSideOffset = width - this._paddingLeft - this._paddingRight - totalRowWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar columnOffset:int = 0;\n\t\t\tvar pageStartPosition:Number = startPageIndex * width;\n\t\t\tvar partialPageSize:Number = scrollX - pageStartPosition;\n\t\t\tif(partialPageSize < 0)\n\t\t\t{\n\t\t\t\tpartialPageSize = -partialPageSize - this._paddingRight - rightSideOffset;\n\t\t\t\tif(partialPageSize < 0)\n\t\t\t\t{\n\t\t\t\t\tpartialPageSize = 0;\n\t\t\t\t}\n\t\t\t\tcolumnOffset = -Math.floor(partialPageSize / (tileWidth + this._horizontalGap)) - 1;\n\t\t\t\tminimum += columnOffset * verticalTileCount;\n\t\t\t}\n\t\t\telse if(partialPageSize > 0)\n\t\t\t{\n\t\t\t\tpartialPageSize = partialPageSize - this._paddingLeft - leftSideOffset;\n\t\t\t\tif(partialPageSize < 0)\n\t\t\t\t{\n\t\t\t\t\tpartialPageSize = 0;\n\t\t\t\t}\n\t\t\t\tcolumnOffset = Math.floor(partialPageSize / (tileWidth + this._horizontalGap));\n\t\t\t\tminimum += columnOffset * verticalTileCount;\n\t\t\t}\n\t\t\tif(minimum < 0)\n\t\t\t{\n\t\t\t\tminimum = 0;\n\t\t\t\tcolumnOffset = 0;\n\t\t\t}\n\n\t\t\tvar maximum:int = minimum + minimumItemCount;\n\t\t\tif(maximum > itemCount)\n\t\t\t{\n\t\t\t\tmaximum = itemCount;\n\t\t\t}\n\t\t\tminimum = maximum - minimumItemCount;\n\t\t\tvar resultPushIndex:int = result.length;\n\t\t\tfor(var i:int = minimum; i < maximum; i++)\n\t\t\t{\n\t\t\t\tresult[resultPushIndex] = i;\n\t\t\t\tresultPushIndex++;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getVisibleIndicesAtScrollPositionWithVerticalPaging(scrollX:Number, scrollY:Number, width:Number, height:Number, itemCount:int, result:Vector.<int>):void\n\t\t{\n\t\t\tthis.prepareTypicalItem();\n\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\n\t\t\tvar tileWidth:Number = calculatedTypicalItemWidth;\n\t\t\tvar tileHeight:Number = calculatedTypicalItemHeight;\n\t\t\tif(tileWidth < 0)\n\t\t\t{\n\t\t\t\ttileWidth = 0;\n\t\t\t}\n\t\t\tif(tileHeight < 0)\n\t\t\t{\n\t\t\t\ttileHeight = 0;\n\t\t\t}\n\t\t\tif(this._useSquareTiles)\n\t\t\t{\n\t\t\t\tif(tileWidth > tileHeight)\n\t\t\t\t{\n\t\t\t\t\ttileHeight = tileWidth;\n\t\t\t\t}\n\t\t\t\telse if(tileHeight > tileWidth)\n\t\t\t\t{\n\t\t\t\t\ttileWidth = tileHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar verticalTileCount:int = this.calculateVerticalTileCount(tileHeight,\n\t\t\t\theight, height, this._paddingTop + this._paddingBottom,\n\t\t\t\tthis._verticalGap, this._requestedRowCount, itemCount);\n\t\t\tif(this._distributeHeights)\n\t\t\t{\n\t\t\t\ttileHeight = (height - this._paddingTop - this._paddingBottom - (verticalTileCount * this._verticalGap) + this._verticalGap) / verticalTileCount;\n\t\t\t\tif(this._useSquareTiles)\n\t\t\t\t{\n\t\t\t\t\ttileWidth = tileHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar horizontalTileCount:int = this.calculateHorizontalTileCount(tileWidth,\n\t\t\t\twidth, width, this._paddingLeft + this._paddingRight,\n\t\t\t\tthis._horizontalGap, this._requestedColumnCount, itemCount,\n\t\t\t\tverticalTileCount, this._distributeWidths && !this._useSquareTiles);\n\t\t\tif(this._distributeWidths && !this._useSquareTiles)\n\t\t\t{\n\t\t\t\ttileWidth = (width - this._paddingLeft - this._paddingRight - (horizontalTileCount * this._horizontalGap) + this._horizontalGap) / horizontalTileCount;\n\t\t\t}\n\t\t\tvar perPage:int = horizontalTileCount * verticalTileCount;\n\t\t\tvar minimumItemCount:int = perPage + 2 * verticalTileCount;\n\t\t\tif(minimumItemCount > itemCount)\n\t\t\t{\n\t\t\t\tminimumItemCount = itemCount;\n\t\t\t}\n\n\t\t\tvar startPageIndex:int = Math.round(scrollY / height);\n\t\t\tvar minimum:int = startPageIndex * perPage;\n\t\t\tvar totalColumnHeight:Number = verticalTileCount * (tileHeight + this._verticalGap) - this._verticalGap;\n\t\t\tvar topSideOffset:Number = 0;\n\t\t\tvar bottomSideOffset:Number = 0;\n\t\t\tif(totalColumnHeight < height)\n\t\t\t{\n\t\t\t\tif(this._verticalAlign === VerticalAlign.BOTTOM)\n\t\t\t\t{\n\t\t\t\t\ttopSideOffset = height - this._paddingTop - this._paddingBottom - totalColumnHeight;\n\t\t\t\t\tbottomSideOffset = 0;\n\t\t\t\t}\n\t\t\t\telse if(this._horizontalAlign === VerticalAlign.MIDDLE)\n\t\t\t\t{\n\t\t\t\t\ttopSideOffset = bottomSideOffset = Math.round((height - this._paddingTop - this._paddingBottom - totalColumnHeight) / 2);\n\t\t\t\t}\n\t\t\t\telse //top\n\t\t\t\t{\n\t\t\t\t\ttopSideOffset = 0;\n\t\t\t\t\tbottomSideOffset = height - this._paddingTop - this._paddingBottom - totalColumnHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar rowOffset:int = 0;\n\t\t\tvar pageStartPosition:Number = startPageIndex * height;\n\t\t\tvar partialPageSize:Number = scrollY - pageStartPosition;\n\t\t\tif(partialPageSize < 0)\n\t\t\t{\n\t\t\t\tpartialPageSize = -partialPageSize - this._paddingBottom - bottomSideOffset;\n\t\t\t\tif(partialPageSize < 0)\n\t\t\t\t{\n\t\t\t\t\tpartialPageSize = 0;\n\t\t\t\t}\n\t\t\t\trowOffset = -Math.floor(partialPageSize / (tileHeight + this._verticalGap)) - 1;\n\t\t\t\tminimum += -perPage + verticalTileCount + rowOffset;\n\t\t\t}\n\t\t\telse if(partialPageSize > 0)\n\t\t\t{\n\t\t\t\tpartialPageSize = partialPageSize - this._paddingTop - topSideOffset;\n\t\t\t\tif(partialPageSize < 0)\n\t\t\t\t{\n\t\t\t\t\tpartialPageSize = 0;\n\t\t\t\t}\n\t\t\t\trowOffset = Math.floor(partialPageSize / (tileWidth + this._verticalGap));\n\t\t\t\tminimum += rowOffset;\n\t\t\t}\n\t\t\tif(minimum < 0)\n\t\t\t{\n\t\t\t\tminimum = 0;\n\t\t\t\trowOffset = 0;\n\t\t\t}\n\n\t\t\tif(minimum + minimumItemCount >= itemCount)\n\t\t\t{\n\t\t\t\t//an optimized path when we're on or near the last page\n\t\t\t\tminimum = itemCount - minimumItemCount;\n\t\t\t\tvar resultPushIndex:int = result.length;\n\t\t\t\tfor(var i:int = minimum; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\tresult[resultPushIndex] = i;\n\t\t\t\t\tresultPushIndex++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar columnIndex:int = 0;\n\t\t\t\tvar rowIndex:int = (verticalTileCount + rowOffset) % verticalTileCount;\n\t\t\t\tvar pageStart:int = int(minimum / perPage) * perPage;\n\t\t\t\ti = minimum;\n\t\t\t\tvar resultLength:int = 0;\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\tif(i < itemCount)\n\t\t\t\t\t{\n\t\t\t\t\t\tresult[resultLength] = i;\n\t\t\t\t\t\tresultLength++;\n\t\t\t\t\t}\n\t\t\t\t\tcolumnIndex++;\n\t\t\t\t\tif(columnIndex == horizontalTileCount)\n\t\t\t\t\t{\n\t\t\t\t\t\tcolumnIndex = 0;\n\t\t\t\t\t\trowIndex++;\n\t\t\t\t\t\tif(rowIndex == verticalTileCount)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trowIndex = 0;\n\t\t\t\t\t\t\tpageStart += perPage;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ti = pageStart + rowIndex - verticalTileCount;\n\t\t\t\t\t}\n\t\t\t\t\ti += verticalTileCount;\n\t\t\t\t}\n\t\t\t\twhile(resultLength < minimumItemCount && pageStart < itemCount);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getVisibleIndicesAtScrollPositionWithoutPaging(scrollX:Number, scrollY:Number, width:Number, height:Number, itemCount:int, result:Vector.<int>):void\n\t\t{\n\t\t\tthis.prepareTypicalItem();\n\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\n\t\t\tvar tileWidth:Number = calculatedTypicalItemWidth;\n\t\t\tvar tileHeight:Number = calculatedTypicalItemHeight;\n\t\t\tif(tileWidth < 0)\n\t\t\t{\n\t\t\t\ttileWidth = 0;\n\t\t\t}\n\t\t\tif(tileHeight < 0)\n\t\t\t{\n\t\t\t\ttileHeight = 0;\n\t\t\t}\n\t\t\tif(this._useSquareTiles)\n\t\t\t{\n\t\t\t\tif(tileWidth > tileHeight)\n\t\t\t\t{\n\t\t\t\t\ttileHeight = tileWidth;\n\t\t\t\t}\n\t\t\t\telse if(tileHeight > tileWidth)\n\t\t\t\t{\n\t\t\t\t\ttileWidth = tileHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar verticalTileCount:int = this.calculateVerticalTileCount(tileHeight,\n\t\t\t\theight, height, this._paddingTop + this._paddingBottom,\n\t\t\t\tthis._verticalGap, this._requestedRowCount, itemCount);\n\t\t\tif(this._distributeHeights)\n\t\t\t{\n\t\t\t\ttileHeight = (height - this._paddingTop - this._paddingBottom - (verticalTileCount * this._verticalGap) + this._verticalGap) / verticalTileCount;\n\t\t\t\tif(this._useSquareTiles)\n\t\t\t\t{\n\t\t\t\t\ttileWidth = tileHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._distributeWidths && !this._useSquareTiles)\n\t\t\t{\n\t\t\t\tvar horizontalTileCount:int = this.calculateHorizontalTileCount(tileWidth,\n\t\t\t\t\twidth, width, this._paddingLeft + this._paddingRight,\n\t\t\t\t\tthis._horizontalGap, this._requestedColumnCount, itemCount,\n\t\t\t\t\tverticalTileCount, this._distributeWidths && !this._useSquareTiles);\n\t\t\t\ttileWidth = (width - this._paddingLeft - this._paddingRight - (horizontalTileCount * this._horizontalGap) + this._horizontalGap) / horizontalTileCount;\n\t\t\t}\n\t\t\thorizontalTileCount = Math.ceil((width + this._horizontalGap) / (tileWidth + this._horizontalGap)) + 1;\n\t\t\tvar minimumItemCount:int = verticalTileCount * horizontalTileCount;\n\t\t\tif(minimumItemCount > itemCount)\n\t\t\t{\n\t\t\t\tminimumItemCount = itemCount;\n\t\t\t}\n\t\t\tvar columnIndexOffset:int = 0;\n\t\t\tvar totalColumnWidth:Number = Math.ceil(itemCount / verticalTileCount) * (tileWidth + this._horizontalGap) - this._horizontalGap;\n\t\t\tif(totalColumnWidth < width)\n\t\t\t{\n\t\t\t\tif(this._verticalAlign === VerticalAlign.BOTTOM)\n\t\t\t\t{\n\t\t\t\t\tcolumnIndexOffset = Math.ceil((width - totalColumnWidth) / (tileWidth + this._horizontalGap));\n\t\t\t\t}\n\t\t\t\telse if(this._verticalAlign === VerticalAlign.MIDDLE)\n\t\t\t\t{\n\t\t\t\t\tcolumnIndexOffset = Math.ceil((width - totalColumnWidth) / (tileWidth + this._horizontalGap) / 2);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar columnIndex:int = -columnIndexOffset + Math.floor((scrollX - this._paddingLeft + this._horizontalGap) / (tileWidth + this._horizontalGap));\n\t\t\tvar minimum:int = columnIndex * verticalTileCount;\n\t\t\tif(minimum < 0)\n\t\t\t{\n\t\t\t\tminimum = 0;\n\t\t\t}\n\t\t\tvar maximum:int = minimum + minimumItemCount;\n\t\t\tif(maximum > itemCount)\n\t\t\t{\n\t\t\t\tmaximum = itemCount;\n\t\t\t}\n\t\t\tminimum = maximum - minimumItemCount;\n\t\t\tvar resultPushIndex:int = result.length;\n\t\t\tfor(var i:int = minimum; i < maximum; i++)\n\t\t\t{\n\t\t\t\tresult[resultPushIndex] = i;\n\t\t\t\tresultPushIndex++;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function validateItems(items:Vector.<DisplayObject>):void\n\t\t{\n\t\t\tvar itemCount:int = items.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(item is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(item).validate();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function prepareTypicalItem():void\n\t\t{\n\t\t\tif(!this._typicalItem)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._resetTypicalItemDimensionsOnMeasure)\n\t\t\t{\n\t\t\t\tthis._typicalItem.width = this._typicalItemWidth;\n\t\t\t\tthis._typicalItem.height = this._typicalItemHeight;\n\t\t\t}\n\t\t\tif(this._typicalItem is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this._typicalItem).validate();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function calculateScrollPositionForIndex(index:int, items:Vector.<DisplayObject>, x:Number, y:Number,\n\t\t\twidth:Number, height:Number, result:Point = null, nearest:Boolean = false, scrollX:Number = 0, scrollY:Number = 0):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthis.prepareTypicalItem();\n\t\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\t\t\t}\n\n\t\t\tvar itemCount:int = items.length;\n\t\t\tvar tileWidth:Number = this._useVirtualLayout ? calculatedTypicalItemWidth : 0;\n\t\t\tvar tileHeight:Number = this._useVirtualLayout ? calculatedTypicalItemHeight : 0;\n\t\t\t//a virtual layout assumes that all items are the same size as\n\t\t\t//the typical item, so we don't need to measure every item in\n\t\t\t//that case\n\t\t\tif(!this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\t\tif(!item)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tvar itemWidth:Number = item.width;\n\t\t\t\t\tvar itemHeight:Number = item.height;\n\t\t\t\t\tif(itemWidth > tileWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\ttileWidth = itemWidth;\n\t\t\t\t\t}\n\t\t\t\t\tif(itemHeight > tileHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\ttileHeight = itemHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(tileWidth < 0)\n\t\t\t{\n\t\t\t\ttileWidth = 0;\n\t\t\t}\n\t\t\tif(tileHeight < 0)\n\t\t\t{\n\t\t\t\ttileHeight = 0;\n\t\t\t}\n\t\t\tif(this._useSquareTiles)\n\t\t\t{\n\t\t\t\tif(tileWidth > tileHeight)\n\t\t\t\t{\n\t\t\t\t\ttileHeight = tileWidth;\n\t\t\t\t}\n\t\t\t\telse if(tileHeight > tileWidth)\n\t\t\t\t{\n\t\t\t\t\ttileWidth = tileHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar verticalTileCount:int = (height - this._paddingTop - this._paddingBottom + this._verticalGap) / (tileHeight + this._verticalGap);\n\t\t\tif(verticalTileCount < 1)\n\t\t\t{\n\t\t\t\tverticalTileCount = 1;\n\t\t\t}\n\t\t\telse if(this._requestedRowCount > 0 && verticalTileCount > this._requestedRowCount)\n\t\t\t{\n\t\t\t\tverticalTileCount = this._requestedRowCount;\n\t\t\t}\n\t\t\tif(this._paging !== Direction.NONE)\n\t\t\t{\n\t\t\t\tvar horizontalTileCount:int = (width - this._paddingLeft - this._paddingRight + this._horizontalGap) / (tileWidth + this._horizontalGap);\n\t\t\t\tif(horizontalTileCount < 1)\n\t\t\t\t{\n\t\t\t\t\thorizontalTileCount = 1;\n\t\t\t\t}\n\t\t\t\tvar perPage:Number = horizontalTileCount * verticalTileCount;\n\t\t\t\tvar pageIndex:int = index / perPage;\n\t\t\t\tif(this._paging === Direction.HORIZONTAL)\n\t\t\t\t{\n\t\t\t\t\tresult.x = pageIndex * width;\n\t\t\t\t\tresult.y = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tresult.x = 0;\n\t\t\t\t\tresult.y = pageIndex * height;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar resultX:Number = this._paddingLeft + ((tileWidth + this._horizontalGap) * int(index / verticalTileCount));\n\t\t\t\tif(nearest)\n\t\t\t\t{\n\t\t\t\t\tvar rightPosition:Number = resultX - (width - tileWidth);\n\t\t\t\t\tif(scrollX >= rightPosition && scrollX <= resultX)\n\t\t\t\t\t{\n\t\t\t\t\t\t//keep the current scroll position because the item is already\n\t\t\t\t\t\t//fully visible\n\t\t\t\t\t\tresultX = scrollX;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar leftDifference:Number = Math.abs(resultX - scrollX);\n\t\t\t\t\t\tvar rightDifference:Number = Math.abs(rightPosition - scrollX);\n\t\t\t\t\t\tif(rightDifference < leftDifference)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tresultX = rightPosition;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tresultX -= Math.round((width - tileWidth) / 2);\n\t\t\t\t}\n\t\t\t\tresult.x = resultX;\n\t\t\t\tresult.y = 0;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function calculateHorizontalTileCount(tileWidth:Number,\n\t\t\texplicitWidth:Number, maxWidth:Number, paddingLeftAndRight:Number,\n\t\t\thorizontalGap:Number, requestedColumnCount:int, totalItemCount:int,\n\t\t\tverticalTileCount:int, distributeWidths:Boolean):int\n\t\t{\n\t\t\t//using the horizontal tile count, calculate how many rows would be\n\t\t\t//required for the total number of items if there were no restrictions.\n\t\t\tvar defaultHorizontalTileCount:int = Math.ceil(totalItemCount / verticalTileCount);\n\t\t\tif(distributeWidths)\n\t\t\t{\n\t\t\t\tif(requestedColumnCount > 0 && defaultHorizontalTileCount > requestedColumnCount)\n\t\t\t\t{\n\t\t\t\t\treturn requestedColumnCount;\n\t\t\t\t}\n\t\t\t\treturn defaultHorizontalTileCount;\n\t\t\t}\n\n\t\t\tvar tileCount:int;\n\t\t\tif(explicitWidth === explicitWidth) //!isNaN\n\t\t\t{\n\t\t\t\t//in this case, the exact width is known\n\t\t\t\ttileCount = (explicitWidth - paddingLeftAndRight + horizontalGap) / (tileWidth + horizontalGap);\n\t\t\t\tif(requestedColumnCount > 0 && tileCount > requestedColumnCount)\n\t\t\t\t{\n\t\t\t\t\treturn requestedColumnCount;\n\t\t\t\t}\n\t\t\t\tif(tileCount > defaultHorizontalTileCount)\n\t\t\t\t{\n\t\t\t\t\ttileCount = defaultHorizontalTileCount;\n\t\t\t\t}\n\t\t\t\tif(tileCount < 1)\n\t\t\t\t{\n\t\t\t\t\t//we must have at least one tile per row\n\t\t\t\t\ttileCount = 1;\n\t\t\t\t}\n\t\t\t\treturn tileCount;\n\t\t\t}\n\n\t\t\t//in this case, the width is not known, but it may have a maximum\n\t\t\tif(requestedColumnCount > 0)\n\t\t\t{\n\t\t\t\ttileCount = requestedColumnCount;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttileCount = defaultHorizontalTileCount;\n\t\t\t}\n\n\t\t\tvar maxTileCount:int = int.MAX_VALUE;\n\t\t\tif(maxWidth === maxWidth && //!isNaN\n\t\t\t\tmaxWidth < Number.POSITIVE_INFINITY)\n\t\t\t{\n\t\t\t\tmaxTileCount = (maxWidth - paddingLeftAndRight + horizontalGap) / (tileWidth + horizontalGap);\n\t\t\t\tif(maxTileCount < 1)\n\t\t\t\t{\n\t\t\t\t\t//we must have at least one tile per row\n\t\t\t\t\tmaxTileCount = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(tileCount > maxTileCount)\n\t\t\t{\n\t\t\t\ttileCount = maxTileCount;\n\t\t\t}\n\t\t\tif(tileCount < 1)\n\t\t\t{\n\t\t\t\t//we must have at least one tile per row\n\t\t\t\ttileCount = 1;\n\t\t\t}\n\t\t\treturn tileCount;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function calculateVerticalTileCount(tileHeight:Number,\n\t\t\texplicitHeight:Number, maxHeight:Number, paddingTopAndBottom:Number,\n\t\t\tverticalGap:Number, requestedRowCount:int, totalItemCount:int):int\n\t\t{\n\t\t\tif(requestedRowCount > 0 && this._distributeHeights)\n\t\t\t{\n\t\t\t\treturn requestedRowCount;\n\t\t\t}\n\t\t\tvar verticalTileCount:int;\n\t\t\tif(explicitHeight === explicitHeight) //!isNaN\n\t\t\t{\n\t\t\t\t//in this case, the exact height is known\n\t\t\t\tverticalTileCount = (explicitHeight - paddingTopAndBottom + verticalGap) / (tileHeight + verticalGap);\n\t\t\t\tif(requestedRowCount > 0 && verticalTileCount > requestedRowCount)\n\t\t\t\t{\n\t\t\t\t\treturn requestedRowCount;\n\t\t\t\t}\n\t\t\t\tif(verticalTileCount > totalItemCount)\n\t\t\t\t{\n\t\t\t\t\tverticalTileCount = totalItemCount;\n\t\t\t\t}\n\t\t\t\tif(verticalTileCount < 1)\n\t\t\t\t{\n\t\t\t\t\t//we must have at least one tile per row\n\t\t\t\t\tverticalTileCount = 1;\n\t\t\t\t}\n\t\t\t\treturn verticalTileCount;\n\t\t\t}\n\n\t\t\t//in this case, the height is not known, but it may have a maximum\n\t\t\tif(requestedRowCount > 0)\n\t\t\t{\n\t\t\t\tverticalTileCount = requestedRowCount;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tverticalTileCount = totalItemCount;\n\t\t\t}\n\n\t\t\tvar maxVerticalTileCount:int = int.MAX_VALUE;\n\t\t\tif(maxHeight === maxHeight && //!isNaN\n\t\t\t\tmaxHeight < Number.POSITIVE_INFINITY)\n\t\t\t{\n\t\t\t\tmaxVerticalTileCount = (maxHeight - paddingTopAndBottom + verticalGap) / (tileHeight + verticalGap);\n\t\t\t\tif(maxVerticalTileCount < 1)\n\t\t\t\t{\n\t\t\t\t\t//we must have at least one tile per row\n\t\t\t\t\tmaxVerticalTileCount = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(verticalTileCount > maxVerticalTileCount)\n\t\t\t{\n\t\t\t\tverticalTileCount = maxVerticalTileCount;\n\t\t\t}\n\t\t\tif(verticalTileCount < 1)\n\t\t\t{\n\t\t\t\t//we must have at least one tile per row\n\t\t\t\tverticalTileCount = 1;\n\t\t\t}\n\t\t\treturn verticalTileCount;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/TiledRowsLayout.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\timport feathers.core.IValidating;\n\n\timport flash.errors.IllegalOperationError;\n\timport flash.geom.Point;\n\timport flash.ui.Keyboard;\n\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * Positions items as tiles (equal width and height) from left to right\n\t * in multiple rows. Constrained to the suggested width, the tiled rows\n\t * layout will change in height as the number of items increases or\n\t * decreases.\n\t *\n\t * @see ../../../help/tiled-rows-layout.html How to use TiledRowsLayout with Feathers containers\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class TiledRowsLayout extends BaseTiledLayout implements IVirtualLayout, IDragDropLayout\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function TiledRowsLayout()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * Requests that the layout uses a specific number of columns in a row,\n\t\t * if possible. Set to <code>0</code> to calculate the maximum of\n\t\t * columns that will fit in the available space.\n\t\t *\n\t\t * <p>If the view port's explicit or maximum width is not large enough\n\t\t * to fit the requested number of columns, it will use fewer. If the\n\t\t * view port doesn't have an explicit width and the maximum width is\n\t\t * equal to <code>Number.POSITIVE_INFINITY</code>, the width will be\n\t\t * calculated automatically to fit the exact number of requested\n\t\t * columns.</p>\n\t\t *\n\t\t * <p>If paging is enabled, this value will be used to calculate the\n\t\t * number of columns in a page. If paging isn't enabled, this value will\n\t\t * be used to calculate a minimum number of columns, even if there\n\t\t * aren't enough items to fill each column.</p>\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\toverride public function get requestedColumnCount():int\n\t\t{\n\t\t\t//this is an override so that this class can have its own documentation.\n\t\t\treturn this._requestedColumnCount;\n\t\t}\n\n\t\t/**\n\t\t * Requests that the layout uses a specific number of rows, if possible.\n\t\t * If the view port's explicit or maximum height is not large enough to\n\t\t * fit the requested number of rows, it will use fewer. Set to <code>0</code>\n\t\t * to calculate the number of rows automatically based on width and\n\t\t * height.\n\t\t *\n\t\t * <p>If paging is enabled, this value will be used to calculate the\n\t\t * number of rows in a page. If paging isn't enabled, this value will\n\t\t * be used to calculate a minimum number of rows, even if there aren't\n\t\t * enough items to fill each row.</p>\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\toverride public function get requestedRowCount():int\n\t\t{\n\t\t\t//this is an override so that this class can have its own documentation.\n\t\t\treturn this._requestedRowCount;\n\t\t}\n\n\t\t/**\n\t\t * If the total combined height of the rows is larger than the height\n\t\t * of the view port, the layout will be split into pages where each\n\t\t * page is filled with the maximum number of rows that may be displayed\n\t\t * without cutting off any items.\n\t\t *\n\t\t * @default feathers.layout.Direction.NONE\n\t\t *\n\t\t * @see feathers.layout.Direction#NONE\n\t\t * @see feathers.layout.Direction#HORIZONTAL\n\t\t * @see feathers.layout.Direction#VERTICAL\n\t\t */\n\t\toverride public function get paging():String\n\t\t{\n\t\t\t//this is an override so that this class can have its own documentation.\n\t\t\treturn this._paging;\n\t\t}\n\n\t\t/**\n\t\t * If the total width of the tiles in a row (minus padding and gap)\n\t\t * does not fill the entire row, the remaining space will be distributed\n\t\t * to each tile equally.\n\t\t *\n\t\t * <p>If the container using the layout might resize, setting\n\t\t * <code>requestedColumnCount</code> is recommended because the tiles\n\t\t * will resize too, and their dimensions may not be reset.</p>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see #requestedColumnCount\n\t\t */\n\t\toverride public function get distributeWidths():Boolean\n\t\t{\n\t\t\treturn this._distributeWidths;\n\t\t}\n\n\t\t/**\n\t\t * If the total height of the tiles in a column (minus padding and gap)\n\t\t * does not fill the entire column, the remaining space will be\n\t\t * distributed to each tile equally.\n\t\t *\n\t\t * <p>If the container using the layout might resize, setting\n\t\t * <code>requestedRowCount</code> is recommended because the tiles\n\t\t * will resize too, and their dimensions may not be reset.</p>\n\t\t *\n\t\t * <p>Note: If the <code>distributeHeights</code> property is set to\n\t\t * <code>true</code>, the <code>useSquareTiles</code> property will be\n\t\t * automatically changed to <code>false</code>.</p>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see #requestedRowCount\n\t\t * @see #useSquareTiles\n\t\t */\n\t\toverride public function get distributeHeights():Boolean\n\t\t{\n\t\t\treturn this._distributeHeights;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set distributeHeights(value:Boolean):void\n\t\t{\n\t\t\tsuper.distributeHeights = value;\n\t\t\tif(value)\n\t\t\t{\n\t\t\t\tthis.useSquareTiles = false;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function layout(items:Vector.<DisplayObject>, viewPortBounds:ViewPortBounds = null, result:LayoutBoundsResult = null):LayoutBoundsResult\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new LayoutBoundsResult();\n\t\t\t}\n\t\t\tif(items.length == 0)\n\t\t\t{\n\t\t\t\tresult.contentX = 0;\n\t\t\t\tresult.contentY = 0;\n\t\t\t\tresult.contentWidth = this._paddingLeft + this._paddingRight;\n\t\t\t\tresult.contentHeight = this._paddingTop + this._paddingBottom;\n\t\t\t\tresult.viewPortWidth = result.contentWidth;\n\t\t\t\tresult.viewPortHeight = result.contentHeight;\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tvar scrollX:Number = viewPortBounds ? viewPortBounds.scrollX : 0;\n\t\t\tvar scrollY:Number = viewPortBounds ? viewPortBounds.scrollY : 0;\n\t\t\tvar boundsX:Number = viewPortBounds ? viewPortBounds.x : 0;\n\t\t\tvar boundsY:Number = viewPortBounds ? viewPortBounds.y : 0;\n\t\t\tvar minWidth:Number = viewPortBounds ? viewPortBounds.minWidth : 0;\n\t\t\tvar minHeight:Number = viewPortBounds ? viewPortBounds.minHeight : 0;\n\t\t\tvar maxWidth:Number = viewPortBounds ? viewPortBounds.maxWidth : Number.POSITIVE_INFINITY;\n\t\t\tvar maxHeight:Number = viewPortBounds ? viewPortBounds.maxHeight : Number.POSITIVE_INFINITY;\n\t\t\tvar explicitWidth:Number = viewPortBounds ? viewPortBounds.explicitWidth : NaN;\n\t\t\tvar explicitHeight:Number = viewPortBounds ? viewPortBounds.explicitHeight : NaN;\n\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthis.prepareTypicalItem();\n\t\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\t\t\t}\n\n\t\t\tthis.validateItems(items);\n\n\t\t\tthis._discoveredItemsCache.length = 0;\n\t\t\tvar itemCount:int = items.length;\n\t\t\tvar tileWidth:Number = 0;\n\t\t\tvar tileHeight:Number = 0;\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\t//a virtual layout assumes that all items are the same size as\n\t\t\t\t//the typical item, so we don't need to measure every item in\n\t\t\t\t//that case\n\t\t\t\ttileWidth = calculatedTypicalItemWidth;\n\t\t\t\ttileHeight = calculatedTypicalItemHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\t\tif(!item)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tvar itemWidth:Number = item.width;\n\t\t\t\t\tvar itemHeight:Number = item.height;\n\t\t\t\t\tif(itemWidth > tileWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\ttileWidth = itemWidth;\n\t\t\t\t\t}\n\t\t\t\t\tif(itemHeight > tileHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\ttileHeight = itemHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(tileWidth < 0)\n\t\t\t{\n\t\t\t\ttileWidth = 0;\n\t\t\t}\n\t\t\tif(tileHeight < 0)\n\t\t\t{\n\t\t\t\ttileHeight = 0;\n\t\t\t}\n\t\t\tif(this._useSquareTiles)\n\t\t\t{\n\t\t\t\tif(tileWidth > tileHeight)\n\t\t\t\t{\n\t\t\t\t\ttileHeight = tileWidth;\n\t\t\t\t}\n\t\t\t\telse if(tileHeight > tileWidth)\n\t\t\t\t{\n\t\t\t\t\ttileWidth = tileHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar horizontalTileCount:int = this.calculateHorizontalTileCount(tileWidth,\n\t\t\t\texplicitWidth, maxWidth, this._paddingLeft + this._paddingRight,\n\t\t\t\tthis._horizontalGap, this._requestedColumnCount, itemCount);\n\t\t\tif(explicitWidth === explicitWidth) //!isNaN\n\t\t\t{\n\t\t\t\tvar availableWidth:Number = explicitWidth;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tavailableWidth = this._paddingLeft + this._paddingRight + ((tileWidth + this._horizontalGap) * horizontalTileCount) - this._horizontalGap;\n\t\t\t\tif(availableWidth < minWidth)\n\t\t\t\t{\n\t\t\t\t\tavailableWidth = minWidth;\n\t\t\t\t}\n\t\t\t\telse if(availableWidth > maxWidth)\n\t\t\t\t{\n\t\t\t\t\tavailableWidth = maxWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._distributeWidths)\n\t\t\t{\n\t\t\t\t//distribute remaining space\n\t\t\t\ttileWidth = (availableWidth - this._paddingLeft - this._paddingRight - (horizontalTileCount * this._horizontalGap) + this._horizontalGap) / horizontalTileCount;\n\t\t\t\tif(this._useSquareTiles)\n\t\t\t\t{\n\t\t\t\t\ttileHeight = tileWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar verticalTileCount:int = this.calculateVerticalTileCount(tileHeight,\n\t\t\t\texplicitHeight, maxHeight, this._paddingTop + this._paddingBottom,\n\t\t\t\tthis._verticalGap, this._requestedRowCount, itemCount,\n\t\t\t\thorizontalTileCount, this._distributeHeights && !this._useSquareTiles);\n\t\t\tif(explicitHeight === explicitHeight) //!isNaN\n\t\t\t{\n\t\t\t\tvar availableHeight:Number = explicitHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tavailableHeight = this._paddingTop + this._paddingBottom + ((tileHeight + this._verticalGap) * verticalTileCount) - this._verticalGap;\n\t\t\t\tif(availableHeight < minHeight)\n\t\t\t\t{\n\t\t\t\t\tavailableHeight = minHeight;\n\t\t\t\t}\n\t\t\t\telse if(availableHeight > maxHeight)\n\t\t\t\t{\n\t\t\t\t\tavailableHeight = maxHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._distributeHeights && !this._useSquareTiles)\n\t\t\t{\n\t\t\t\t//distribute remaining space\n\t\t\t\ttileHeight = (availableHeight - this._paddingTop - this._paddingBottom - (verticalTileCount * this._verticalGap) + this._verticalGap) / verticalTileCount;\n\t\t\t}\n\n\t\t\tvar totalPageContentWidth:Number = horizontalTileCount * (tileWidth + this._horizontalGap) - this._horizontalGap + this._paddingLeft + this._paddingRight;\n\t\t\tvar totalPageContentHeight:Number = verticalTileCount * (tileHeight + this._verticalGap) - this._verticalGap + this._paddingTop + this._paddingBottom;\n\n\t\t\tvar startX:Number = boundsX + this._paddingLeft;\n\t\t\tvar startY:Number = boundsY + this._paddingTop;\n\n\t\t\tvar perPage:int = horizontalTileCount * verticalTileCount;\n\t\t\tvar pageIndex:int = 0;\n\t\t\tvar nextPageStartIndex:int = perPage;\n\t\t\tvar pageStartX:Number = startX;\n\t\t\tvar positionX:Number = startX;\n\t\t\tvar positionY:Number = startY;\n\t\t\tvar itemIndex:int = 0;\n\t\t\tvar discoveredItemsCachePushIndex:int = 0;\n\t\t\tfor(i = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\titem = items[i];\n\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(itemIndex != 0 && itemIndex % horizontalTileCount == 0)\n\t\t\t\t{\n\t\t\t\t\tpositionX = pageStartX;\n\t\t\t\t\tpositionY += tileHeight + this._verticalGap;\n\t\t\t\t}\n\t\t\t\tif(itemIndex == nextPageStartIndex)\n\t\t\t\t{\n\t\t\t\t\t//we're starting a new page, so handle alignment of the\n\t\t\t\t\t//items on the current page and update the positions\n\t\t\t\t\tif(this._paging !== Direction.NONE)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar discoveredItems:Vector.<DisplayObject> = this._useVirtualLayout ? this._discoveredItemsCache : items;\n\t\t\t\t\t\tvar discoveredItemsFirstIndex:int = this._useVirtualLayout ? 0 : (itemIndex - perPage);\n\t\t\t\t\t\tvar discoveredItemsLastIndex:int = this._useVirtualLayout ? (this._discoveredItemsCache.length - 1) : (itemIndex - 1);\n\t\t\t\t\t\tthis.applyHorizontalAlign(discoveredItems, discoveredItemsFirstIndex, discoveredItemsLastIndex, totalPageContentWidth, availableWidth);\n\t\t\t\t\t\tthis.applyVerticalAlign(discoveredItems, discoveredItemsFirstIndex, discoveredItemsLastIndex, totalPageContentHeight, availableHeight);\n\t\t\t\t\t\tthis._discoveredItemsCache.length = 0;\n\t\t\t\t\t\tdiscoveredItemsCachePushIndex = 0;\n\t\t\t\t\t}\n\t\t\t\t\tpageIndex++;\n\t\t\t\t\tnextPageStartIndex += perPage;\n\n\t\t\t\t\t//we can use availableWidth and availableHeight here without\n\t\t\t\t\t//checking if they're NaN because we will never reach a\n\t\t\t\t\t//new page without them already being calculated.\n\t\t\t\t\tif(this._paging === Direction.HORIZONTAL)\n\t\t\t\t\t{\n\t\t\t\t\t\tpositionX = pageStartX = startX + availableWidth * pageIndex;\n\t\t\t\t\t\tpositionY = startY;\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._paging === Direction.VERTICAL)\n\t\t\t\t\t{\n\t\t\t\t\t\tpositionY = startY + availableHeight * pageIndex;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(item)\n\t\t\t\t{\n\t\t\t\t\tswitch(this._tileHorizontalAlign)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase HorizontalAlign.JUSTIFY:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.x = item.pivotX + positionX;\n\t\t\t\t\t\t\titem.width = tileWidth;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase HorizontalAlign.LEFT:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.x = item.pivotX + positionX;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase HorizontalAlign.RIGHT:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.x = item.pivotX + positionX + tileWidth - item.width;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdefault: //center or unknown\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.x = item.pivotX + positionX + Math.round((tileWidth - item.width) / 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tswitch(this._tileVerticalAlign)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase VerticalAlign.JUSTIFY:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.y = item.pivotY + positionY;\n\t\t\t\t\t\t\titem.height = tileHeight;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase VerticalAlign.TOP:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.y = item.pivotY + positionY;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase VerticalAlign.BOTTOM:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.y = item.pivotY + positionY + tileHeight - item.height;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdefault: //middle or unknown\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.y = item.pivotY + positionY + Math.round((tileHeight - item.height) / 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(this._useVirtualLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._discoveredItemsCache[discoveredItemsCachePushIndex] = item;\n\t\t\t\t\t\tdiscoveredItemsCachePushIndex++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tpositionX += tileWidth + this._horizontalGap;\n\t\t\t\titemIndex++;\n\t\t\t}\n\t\t\t//align the last page\n\t\t\tif(this._paging !== Direction.NONE)\n\t\t\t{\n\t\t\t\tdiscoveredItems = this._useVirtualLayout ? this._discoveredItemsCache : items;\n\t\t\t\tdiscoveredItemsFirstIndex = this._useVirtualLayout ? 0 : (nextPageStartIndex - perPage);\n\t\t\t\tdiscoveredItemsLastIndex = this._useVirtualLayout ? (discoveredItems.length - 1) : (i - 1);\n\t\t\t\tthis.applyHorizontalAlign(discoveredItems, discoveredItemsFirstIndex, discoveredItemsLastIndex, totalPageContentWidth, availableWidth);\n\t\t\t\tthis.applyVerticalAlign(discoveredItems, discoveredItemsFirstIndex, discoveredItemsLastIndex, totalPageContentHeight, availableHeight);\n\t\t\t}\n\n\t\t\tif(this._paging === Direction.HORIZONTAL)\n\t\t\t{\n\t\t\t\tvar totalWidth:Number = Math.ceil(itemCount / perPage) * availableWidth;\n\t\t\t}\n\t\t\telse //vertical or none\n\t\t\t{\n\t\t\t\ttotalWidth = totalPageContentWidth;\n\t\t\t}\n\t\t\tif(this._paging === Direction.HORIZONTAL)\n\t\t\t{\n\t\t\t\tvar totalHeight:Number = availableHeight;\n\t\t\t}\n\t\t\telse if(this._paging === Direction.VERTICAL)\n\t\t\t{\n\t\t\t\ttotalHeight = Math.ceil(itemCount / perPage) * availableHeight;\n\t\t\t}\n\t\t\telse //none\n\t\t\t{\n\t\t\t\ttotalHeight = positionY + tileHeight + this._paddingBottom;\n\t\t\t\tif(totalHeight < totalPageContentHeight)\n\t\t\t\t{\n\t\t\t\t\ttotalHeight = totalPageContentHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(this._paging === Direction.NONE)\n\t\t\t{\n\t\t\t\tdiscoveredItems = this._useVirtualLayout ? this._discoveredItemsCache : items;\n\t\t\t\tdiscoveredItemsLastIndex = discoveredItems.length - 1;\n\t\t\t\tthis.applyHorizontalAlign(discoveredItems, 0, discoveredItemsLastIndex, totalWidth, availableWidth);\n\t\t\t\tthis.applyVerticalAlign(discoveredItems, 0, discoveredItemsLastIndex, totalHeight, availableHeight);\n\t\t\t}\n\t\t\tthis._discoveredItemsCache.length = 0;\n\n\t\t\tresult.contentX = 0;\n\t\t\tresult.contentY = 0;\n\t\t\tresult.contentWidth = totalWidth;\n\t\t\tresult.contentHeight = totalHeight;\n\t\t\tresult.viewPortWidth = availableWidth;\n\t\t\tresult.viewPortHeight = availableHeight;\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function measureViewPort(itemCount:int, viewPortBounds:ViewPortBounds = null, result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\t\t\tif(!this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"measureViewPort() may be called only if useVirtualLayout is true.\");\n\t\t\t}\n\n\t\t\tvar explicitWidth:Number = viewPortBounds ? viewPortBounds.explicitWidth : NaN;\n\t\t\tvar explicitHeight:Number = viewPortBounds ? viewPortBounds.explicitHeight : NaN;\n\t\t\tvar needsWidth:Boolean = explicitWidth !== explicitWidth; //isNaN;\n\t\t\tvar needsHeight:Boolean = explicitHeight !== explicitHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight)\n\t\t\t{\n\t\t\t\tresult.x = explicitWidth;\n\t\t\t\tresult.y = explicitHeight;\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tvar boundsX:Number = viewPortBounds ? viewPortBounds.x : 0;\n\t\t\tvar boundsY:Number = viewPortBounds ? viewPortBounds.y : 0;\n\t\t\tvar minWidth:Number = viewPortBounds ? viewPortBounds.minWidth : 0;\n\t\t\tvar minHeight:Number = viewPortBounds ? viewPortBounds.minHeight : 0;\n\t\t\tvar maxWidth:Number = viewPortBounds ? viewPortBounds.maxWidth : Number.POSITIVE_INFINITY;\n\t\t\tvar maxHeight:Number = viewPortBounds ? viewPortBounds.maxHeight : Number.POSITIVE_INFINITY;\n\n\t\t\tthis.prepareTypicalItem();\n\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\n\t\t\tvar tileWidth:Number = calculatedTypicalItemWidth;\n\t\t\tvar tileHeight:Number = calculatedTypicalItemHeight;\n\t\t\tif(tileWidth < 0)\n\t\t\t{\n\t\t\t\ttileWidth = 0;\n\t\t\t}\n\t\t\tif(tileHeight < 0)\n\t\t\t{\n\t\t\t\ttileHeight = 0;\n\t\t\t}\n\t\t\tif(this._useSquareTiles)\n\t\t\t{\n\t\t\t\tif(tileWidth > tileHeight)\n\t\t\t\t{\n\t\t\t\t\ttileHeight = tileWidth;\n\t\t\t\t}\n\t\t\t\telse if(tileHeight > tileWidth)\n\t\t\t\t{\n\t\t\t\t\ttileWidth = tileHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar horizontalTileCount:int = this.calculateHorizontalTileCount(tileWidth,\n\t\t\t\texplicitWidth, maxWidth, this._paddingLeft + this._paddingRight,\n\t\t\t\tthis._horizontalGap, this._requestedColumnCount, itemCount);\n\t\t\tvar verticalTileCount:int = this.calculateVerticalTileCount(tileHeight,\n\t\t\t\texplicitHeight, maxHeight, this._paddingTop + this._paddingBottom,\n\t\t\t\tthis._verticalGap, this._requestedRowCount, itemCount,\n\t\t\t\thorizontalTileCount, this._distributeHeights && !this._useSquareTiles);\n\t\t\tif(explicitWidth === explicitWidth) //!isNaN\n\t\t\t{\n\t\t\t\tvar availableWidth:Number = explicitWidth;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tavailableWidth = this._paddingLeft + this._paddingRight + ((tileWidth + this._horizontalGap) * horizontalTileCount) - this._horizontalGap;\n\t\t\t\tif(availableWidth < minWidth)\n\t\t\t\t{\n\t\t\t\t\tavailableWidth = minWidth;\n\t\t\t\t}\n\t\t\t\telse if(availableWidth > maxWidth)\n\t\t\t\t{\n\t\t\t\t\tavailableWidth = maxWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(explicitHeight === explicitHeight) //!isNaN\n\t\t\t{\n\t\t\t\tvar availableHeight:Number = explicitHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tavailableHeight = this._paddingTop + this._paddingBottom + ((tileHeight + this._verticalGap) * verticalTileCount) - this._verticalGap;\n\t\t\t\tif(availableHeight < minHeight)\n\t\t\t\t{\n\t\t\t\t\tavailableHeight = minHeight;\n\t\t\t\t}\n\t\t\t\telse if(availableHeight > maxHeight)\n\t\t\t\t{\n\t\t\t\t\tavailableHeight = maxHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar totalPageContentWidth:Number = horizontalTileCount * (tileWidth + this._horizontalGap) - this._horizontalGap + this._paddingLeft + this._paddingRight;\n\t\t\tvar totalPageContentHeight:Number = verticalTileCount * (tileHeight + this._verticalGap) - this._verticalGap + this._paddingTop + this._paddingBottom;\n\n\t\t\tvar startX:Number = boundsX + this._paddingLeft;\n\t\t\tvar startY:Number = boundsY + this._paddingTop;\n\n\t\t\tvar perPage:int = horizontalTileCount * verticalTileCount;\n\t\t\tvar pageIndex:int = 0;\n\t\t\tvar nextPageStartIndex:int = perPage;\n\t\t\tvar pageStartX:Number = startX;\n\t\t\tvar positionX:Number = startX;\n\t\t\tvar positionY:Number = startY;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tif(i != 0 && i % horizontalTileCount == 0)\n\t\t\t\t{\n\t\t\t\t\tpositionX = pageStartX;\n\t\t\t\t\tpositionY += tileHeight + this._verticalGap;\n\t\t\t\t}\n\t\t\t\tif(i == nextPageStartIndex)\n\t\t\t\t{\n\t\t\t\t\tpageIndex++;\n\t\t\t\t\tnextPageStartIndex += perPage;\n\n\t\t\t\t\t//we can use availableWidth and availableHeight here without\n\t\t\t\t\t//checking if they're NaN because we will never reach a\n\t\t\t\t\t//new page without them already being calculated.\n\t\t\t\t\tif(this._paging === Direction.HORIZONTAL)\n\t\t\t\t\t{\n\t\t\t\t\t\tpositionX = pageStartX = startX + availableWidth * pageIndex;\n\t\t\t\t\t\tpositionY = startY;\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._paging === Direction.VERTICAL)\n\t\t\t\t\t{\n\t\t\t\t\t\tpositionY = startY + availableHeight * pageIndex;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(this._paging === Direction.HORIZONTAL)\n\t\t\t{\n\t\t\t\tvar totalWidth:Number = Math.ceil(itemCount / perPage) * availableWidth;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttotalWidth = totalPageContentWidth;\n\t\t\t}\n\t\t\tif(this._paging === Direction.HORIZONTAL)\n\t\t\t{\n\t\t\t\tvar totalHeight:Number = availableHeight;\n\t\t\t}\n\t\t\telse if(this._paging === Direction.VERTICAL)\n\t\t\t{\n\t\t\t\ttotalHeight = Math.ceil(itemCount / perPage) * availableHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttotalHeight = positionY + tileHeight + this._paddingBottom;\n\t\t\t\tif(totalHeight < totalPageContentHeight)\n\t\t\t\t{\n\t\t\t\t\ttotalHeight = totalPageContentHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tvar resultX:Number = totalWidth;\n\t\t\t\tif(resultX < minWidth)\n\t\t\t\t{\n\t\t\t\t\tresultX = minWidth;\n\t\t\t\t}\n\t\t\t\telse if(resultX > maxWidth)\n\t\t\t\t{\n\t\t\t\t\tresultX = maxWidth;\n\t\t\t\t}\n\t\t\t\tresult.x = resultX;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult.x = explicitWidth;\n\t\t\t}\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tvar resultY:Number = totalHeight;\n\t\t\t\tif(resultY < minHeight)\n\t\t\t\t{\n\t\t\t\t\tresultY = minHeight;\n\t\t\t\t}\n\t\t\t\telse if(resultY > maxHeight)\n\t\t\t\t{\n\t\t\t\t\tresultY = maxHeight;\n\t\t\t\t}\n\t\t\t\tresult.y = resultY;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult.y = explicitHeight;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getVisibleIndicesAtScrollPosition(scrollX:Number, scrollY:Number, width:Number, height:Number, itemCount:int, result:Vector.<int> = null):Vector.<int>\n\t\t{\n\t\t\tif(result)\n\t\t\t{\n\t\t\t\tresult.length = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult = new <int>[];\n\t\t\t}\n\t\t\tif(!this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"getVisibleIndicesAtScrollPosition() may be called only if useVirtualLayout is true.\");\n\t\t\t}\n\n\t\t\tif(this._paging === Direction.HORIZONTAL)\n\t\t\t{\n\t\t\t\tthis.getVisibleIndicesAtScrollPositionWithHorizontalPaging(scrollX, scrollY, width, height, itemCount, result);\n\t\t\t}\n\t\t\telse if(this._paging === Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tthis.getVisibleIndicesAtScrollPositionWithVerticalPaging(scrollX, scrollY, width, height, itemCount, result);\n\t\t\t}\n\t\t\telse //none\n\t\t\t{\n\t\t\t\tthis.getVisibleIndicesAtScrollPositionWithoutPaging(scrollX, scrollY, width, height, itemCount, result);\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function calculateNavigationDestination(items:Vector.<DisplayObject>, index:int, keyCode:uint, bounds:LayoutBoundsResult):int\n\t\t{\n\t\t\tvar itemCount:int = items.length;\n\t\t\tif(keyCode == Keyboard.HOME)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.END)\n\t\t\t{\n\t\t\t\treturn itemCount - 1;\n\t\t\t}\n\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthis.prepareTypicalItem();\n\t\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\t\t\t}\n\n\t\t\tthis.validateItems(items);\n\n\t\t\tthis._discoveredItemsCache.length = 0;\n\t\t\tvar tileWidth:Number = 0;\n\t\t\tvar tileHeight:Number = 0;\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\t//a virtual layout assumes that all items are the same size as\n\t\t\t\t//the typical item, so we don't need to measure every item in\n\t\t\t\t//that case\n\t\t\t\ttileWidth = calculatedTypicalItemWidth;\n\t\t\t\ttileHeight = calculatedTypicalItemHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\t\tif(!item)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tvar itemWidth:Number = item.width;\n\t\t\t\t\tvar itemHeight:Number = item.height;\n\t\t\t\t\tif(itemWidth > tileWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\ttileWidth = itemWidth;\n\t\t\t\t\t}\n\t\t\t\t\tif(itemHeight > tileHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\ttileHeight = itemHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(tileWidth < 0)\n\t\t\t{\n\t\t\t\ttileWidth = 0;\n\t\t\t}\n\t\t\tif(tileHeight < 0)\n\t\t\t{\n\t\t\t\ttileHeight = 0;\n\t\t\t}\n\t\t\tif(this._useSquareTiles)\n\t\t\t{\n\t\t\t\tif(tileWidth > tileHeight)\n\t\t\t\t{\n\t\t\t\t\ttileHeight = tileWidth;\n\t\t\t\t}\n\t\t\t\telse if(tileHeight > tileWidth)\n\t\t\t\t{\n\t\t\t\t\ttileWidth = tileHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar availableWidth:Number = bounds.viewPortWidth;\n\t\t\tvar horizontalTileCount:int = this.calculateHorizontalTileCount(tileWidth,\n\t\t\t\tavailableWidth, Number.POSITIVE_INFINITY, this._paddingLeft + this._paddingRight,\n\t\t\t\tthis._horizontalGap, this._requestedColumnCount, itemCount);\n\t\t\tvar pageHorizontalTileCount:int = horizontalTileCount;\n\t\t\tvar pageVerticalTileCount:int = this.calculateVerticalTileCount(tileHeight,\n\t\t\t\tbounds.viewPortHeight, Number.POSITIVE_INFINITY, this._paddingTop + this._paddingBottom,\n\t\t\t\tthis._verticalGap, this._requestedRowCount, itemCount,\n\t\t\t\tpageHorizontalTileCount, this._distributeHeights && !this._useSquareTiles);\n\t\t\tvar verticalTileCount:int = Math.ceil(itemCount / horizontalTileCount);\n\t\t\tvar rowIndex:int = index / pageHorizontalTileCount;\n\t\t\tvar columnIndex:int = index % pageHorizontalTileCount;\n\t\t\tif(this._paging === Direction.HORIZONTAL)\n\t\t\t{\n\t\t\t\tverticalTileCount = pageVerticalTileCount;\n\t\t\t\tvar perPage:Number = pageHorizontalTileCount * pageVerticalTileCount;\n\t\t\t\tvar pageCount:int = Math.ceil(itemCount / perPage);\n\t\t\t\thorizontalTileCount *= pageCount;\n\t\t\t\twhile(rowIndex >= verticalTileCount)\n\t\t\t\t{\n\t\t\t\t\trowIndex -= verticalTileCount;\n\t\t\t\t\tcolumnIndex += pageHorizontalTileCount;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(keyCode == Keyboard.PAGE_UP)\n\t\t\t{\n\t\t\t\tif(this._paging === Direction.HORIZONTAL)\n\t\t\t\t{\n\t\t\t\t\tcolumnIndex -= pageHorizontalTileCount;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\trowIndex -= pageVerticalTileCount;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.PAGE_DOWN)\n\t\t\t{\n\t\t\t\tif(this._paging === Direction.HORIZONTAL)\n\t\t\t\t{\n\t\t\t\t\tcolumnIndex += pageHorizontalTileCount;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\trowIndex += pageVerticalTileCount;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.UP)\n\t\t\t{\n\t\t\t\trowIndex--;\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.DOWN)\n\t\t\t{\n\t\t\t\trowIndex++;\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.LEFT)\n\t\t\t{\n\t\t\t\tcolumnIndex--;\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.RIGHT)\n\t\t\t{\n\t\t\t\tcolumnIndex++;\n\t\t\t}\n\t\t\tif(rowIndex < 0)\n\t\t\t{\n\t\t\t\trowIndex = 0;\n\t\t\t}\n\t\t\telse if(rowIndex >= verticalTileCount)\n\t\t\t{\n\t\t\t\trowIndex = verticalTileCount - 1;\n\t\t\t}\n\t\t\tif(columnIndex < 0)\n\t\t\t{\n\t\t\t\tcolumnIndex = 0;\n\t\t\t}\n\t\t\telse if(columnIndex >= horizontalTileCount)\n\t\t\t{\n\t\t\t\tcolumnIndex = horizontalTileCount - 1;\n\t\t\t}\n\t\t\tif(this._paging === Direction.HORIZONTAL)\n\t\t\t{\n\t\t\t\twhile(columnIndex >= pageHorizontalTileCount)\n\t\t\t\t{\n\t\t\t\t\tcolumnIndex -= pageHorizontalTileCount;\n\t\t\t\t\trowIndex += verticalTileCount;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar result:int = rowIndex * pageHorizontalTileCount + columnIndex;\n\t\t\tif(result >= itemCount)\n\t\t\t{\n\t\t\t\t//nothing at this column on the next row\n\t\t\t\tresult = itemCount - 1;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getNearestScrollPositionForIndex(index:int, scrollX:Number, scrollY:Number, items:Vector.<DisplayObject>,\n\t\t\tx:Number, y:Number, width:Number, height:Number, result:Point = null):Point\n\t\t{\n\t\t\treturn this.calculateScrollPositionForIndex(index, items, x, y, width, height, result, true, scrollX, scrollY);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getScrollPositionForIndex(index:int, items:Vector.<DisplayObject>, x:Number, y:Number, width:Number, height:Number, result:Point = null):Point\n\t\t{\n\t\t\treturn this.calculateScrollPositionForIndex(index, items, x, y, width, height, result, false);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getDropIndex(x:Number, y:Number, items:Vector.<DisplayObject>,\n\t\t\tboundsX:Number, boundsY:Number, width:Number, height:Number):int\n\t\t{\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthis.prepareTypicalItem();\n\t\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\t\t\t}\n\n\t\t\tvar itemCount:int = items.length;\n\t\t\tvar tileWidth:Number = this._useVirtualLayout ? calculatedTypicalItemWidth : 0;\n\t\t\tvar tileHeight:Number = this._useVirtualLayout ? calculatedTypicalItemHeight : 0;\n\t\t\t//a virtual layout assumes that all items are the same size as\n\t\t\t//the typical item, so we don't need to measure every item in\n\t\t\t//that case\n\t\t\tif(!this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\t\tif(!item)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tvar itemWidth:Number = item.width;\n\t\t\t\t\tvar itemHeight:Number = item.height;\n\t\t\t\t\tif(itemWidth > tileWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\ttileWidth = itemWidth;\n\t\t\t\t\t}\n\t\t\t\t\tif(itemHeight > tileHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\ttileHeight = itemHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(tileWidth < 0)\n\t\t\t{\n\t\t\t\ttileWidth = 0;\n\t\t\t}\n\t\t\tif(tileHeight < 0)\n\t\t\t{\n\t\t\t\ttileHeight = 0;\n\t\t\t}\n\t\t\tif(this._useSquareTiles)\n\t\t\t{\n\t\t\t\tif(tileWidth > tileHeight)\n\t\t\t\t{\n\t\t\t\t\ttileHeight = tileWidth;\n\t\t\t\t}\n\t\t\t\telse if(tileHeight > tileWidth)\n\t\t\t\t{\n\t\t\t\t\ttileWidth = tileHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar horizontalTileCount:int = (width - this._paddingLeft - this._paddingRight + this._horizontalGap) / (tileWidth + this._horizontalGap);\n\t\t\tif(horizontalTileCount < 1)\n\t\t\t{\n\t\t\t\thorizontalTileCount = 1;\n\t\t\t}\n\t\t\telse if(this._requestedColumnCount > 0 && horizontalTileCount > this._requestedColumnCount)\n\t\t\t{\n\t\t\t\thorizontalTileCount = this._requestedColumnCount;\n\t\t\t}\n\t\t\tvar verticalTileCount:int = (height - this._paddingTop - this._paddingBottom + this._verticalGap) / (tileHeight + this._verticalGap);\n\t\t\tif(verticalTileCount < 1)\n\t\t\t{\n\t\t\t\tverticalTileCount = 1;\n\t\t\t}\n\t\t\telse if(this._requestedRowCount > 0 && verticalTileCount > this._requestedRowCount)\n\t\t\t{\n\t\t\t\tverticalTileCount = this._requestedRowCount;\n\t\t\t}\n\t\t\tvar perPage:Number = horizontalTileCount * verticalTileCount;\n\t\t\tvar startX:Number = boundsX + this._paddingLeft;\n\t\t\tvar actualHorizontalTileCount:int = horizontalTileCount;\n\t\t\tif(actualHorizontalTileCount > itemCount)\n\t\t\t{\n\t\t\t\tactualHorizontalTileCount = itemCount;\n\t\t\t}\n\t\t\tif(this._horizontalAlign == HorizontalAlign.RIGHT)\n\t\t\t{\n\t\t\t\tstartX = boundsX + this._paddingLeft + (width - this._paddingLeft - this._paddingRight) -\n\t\t\t\t\t((actualHorizontalTileCount * (tileWidth + this._horizontalGap)) - this._horizontalGap);\n\t\t\t}\n\t\t\telse if(this._horizontalAlign == HorizontalAlign.CENTER)\n\t\t\t{\n\t\t\t\tstartX = boundsX + this._paddingLeft + ((width - this._paddingLeft - this._paddingRight) -\n\t\t\t\t\t((actualHorizontalTileCount * (tileWidth + this._horizontalGap)) - this._horizontalGap)) / 2;\n\t\t\t}\n\t\t\tvar startY:Number = boundsY + this._paddingTop;\n\t\t\tif(this._paging != Direction.NONE || itemCount <= perPage)\n\t\t\t{\n\t\t\t\tvar actualVerticalTileCount:int = verticalTileCount;\n\t\t\t\tif(itemCount <= perPage)\n\t\t\t\t{\n\t\t\t\t\tactualVerticalTileCount = Math.ceil(itemCount / actualHorizontalTileCount);\n\t\t\t\t}\n\t\t\t\tif(this._verticalAlign == VerticalAlign.BOTTOM)\n\t\t\t\t{\n\t\t\t\t\tstartY = boundsY + this._paddingTop + (height - this._paddingTop - this._paddingBottom) -\n\t\t\t\t\t\t((actualVerticalTileCount * (tileHeight + this._verticalGap)) - this._verticalGap);\n\t\t\t\t}\n\t\t\t\telse if(this._verticalAlign == VerticalAlign.MIDDLE)\n\t\t\t\t{\n\t\t\t\t\tstartY = boundsY + this._paddingTop + ((height - this._paddingTop - this._paddingBottom) -\n\t\t\t\t\t\t((actualVerticalTileCount * (tileHeight + this._verticalGap)) - this._verticalGap)) / 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar pageIndex:int = 0;\n\t\t\tvar rowIndex:int = 0;\n\t\t\tvar lastRowIndex:int = int((itemCount - 1) / horizontalTileCount);\n\t\t\tvar nextPageStartIndex:int = perPage;\n\t\t\tvar pageStartX:Number = startX;\n\t\t\tvar positionX:Number = startX;\n\t\t\tvar positionY:Number = startY;\n\t\t\tfor(i = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\titem = items[i];\n\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(i != 0 && i % horizontalTileCount == 0)\n\t\t\t\t{\n\t\t\t\t\tif((x < (pageStartX + width)) &&\n\t\t\t\t\t\t(y < (positionY + tileHeight + (this._verticalGap / 2))))\n\t\t\t\t\t{\n\t\t\t\t\t\t//we're at the end of the previous row (but we also make\n\t\t\t\t\t\t//sure that we're not on the next page)\n\t\t\t\t\t\treturn i;\n\t\t\t\t\t}\n\t\t\t\t\tpositionX = pageStartX;\n\t\t\t\t\tpositionY += tileHeight + this._verticalGap;\n\t\t\t\t\trowIndex++;\n\t\t\t\t}\n\t\t\t\tif(i == nextPageStartIndex)\n\t\t\t\t{\n\t\t\t\t\tpageIndex++;\n\t\t\t\t\tnextPageStartIndex += perPage;\n\n\t\t\t\t\t//we can use availableWidth and availableHeight here without\n\t\t\t\t\t//checking if they're NaN because we will never reach a\n\t\t\t\t\t//new page without them already being calculated.\n\t\t\t\t\tif(this._paging === Direction.HORIZONTAL)\n\t\t\t\t\t{\n\t\t\t\t\t\tpositionX = pageStartX = startX + width * pageIndex;\n\t\t\t\t\t\tpositionY = startY;\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._paging === Direction.VERTICAL)\n\t\t\t\t\t{\n\t\t\t\t\t\tpositionY = startY + height * pageIndex;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif((x < (positionX + (tileWidth / 2))) &&\n\t\t\t\t\t((y < (positionY + tileHeight + (this._verticalGap / 2))) || (rowIndex == lastRowIndex)))\n\t\t\t\t{\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t\tpositionX += tileWidth + this._horizontalGap;\n\t\t\t}\n\t\t\treturn i;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function positionDropIndicator(dropIndicator:DisplayObject, index:int,\n\t\t\tx:Number, y:Number, items:Vector.<DisplayObject>, width:Number, height:Number):void\n\t\t{\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthis.prepareTypicalItem();\n\t\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\t\t\t}\n\n\t\t\tvar itemCount:int = items.length;\n\t\t\tvar tileWidth:Number = this._useVirtualLayout ? calculatedTypicalItemWidth : 0;\n\t\t\tvar tileHeight:Number = this._useVirtualLayout ? calculatedTypicalItemHeight : 0;\n\t\t\t//a virtual layout assumes that all items are the same size as\n\t\t\t//the typical item, so we don't need to measure every item in\n\t\t\t//that case\n\t\t\tif(!this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\t\tif(!item)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tvar itemWidth:Number = item.width;\n\t\t\t\t\tvar itemHeight:Number = item.height;\n\t\t\t\t\tif(itemWidth > tileWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\ttileWidth = itemWidth;\n\t\t\t\t\t}\n\t\t\t\t\tif(itemHeight > tileHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\ttileHeight = itemHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(tileWidth < 0)\n\t\t\t{\n\t\t\t\ttileWidth = 0;\n\t\t\t}\n\t\t\tif(tileHeight < 0)\n\t\t\t{\n\t\t\t\ttileHeight = 0;\n\t\t\t}\n\t\t\tif(this._useSquareTiles)\n\t\t\t{\n\t\t\t\tif(tileWidth > tileHeight)\n\t\t\t\t{\n\t\t\t\t\ttileHeight = tileWidth;\n\t\t\t\t}\n\t\t\t\telse if(tileHeight > tileWidth)\n\t\t\t\t{\n\t\t\t\t\ttileWidth = tileHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar horizontalTileCount:int = (width - this._paddingLeft - this._paddingRight + this._horizontalGap) / (tileWidth + this._horizontalGap);\n\t\t\tif(horizontalTileCount < 1)\n\t\t\t{\n\t\t\t\thorizontalTileCount = 1;\n\t\t\t}\n\t\t\telse if(this._requestedColumnCount > 0 && horizontalTileCount > this._requestedColumnCount)\n\t\t\t{\n\t\t\t\thorizontalTileCount = this._requestedColumnCount;\n\t\t\t}\n\t\t\tvar verticalTileCount:int = (height - this._paddingTop - this._paddingBottom + this._verticalGap) / (tileHeight + this._verticalGap);\n\t\t\tif(verticalTileCount < 1)\n\t\t\t{\n\t\t\t\tverticalTileCount = 1;\n\t\t\t}\n\t\t\telse if(this._requestedRowCount > 0 && verticalTileCount > this._requestedRowCount)\n\t\t\t{\n\t\t\t\tverticalTileCount = this._requestedRowCount;\n\t\t\t}\n\t\t\tvar perPage:Number = horizontalTileCount * verticalTileCount;\n\t\t\tvar startX:Number = this._paddingLeft;\n\t\t\tvar actualHorizontalTileCount:int = horizontalTileCount;\n\t\t\tif(actualHorizontalTileCount > itemCount)\n\t\t\t{\n\t\t\t\tactualHorizontalTileCount = itemCount;\n\t\t\t}\n\t\t\tif(this._horizontalAlign == HorizontalAlign.RIGHT)\n\t\t\t{\n\t\t\t\tstartX = this._paddingLeft + (width - this._paddingLeft - this._paddingRight) -\n\t\t\t\t\t((actualHorizontalTileCount * (tileWidth + this._horizontalGap)) - this._horizontalGap);\n\t\t\t}\n\t\t\telse if(this._horizontalAlign == HorizontalAlign.CENTER)\n\t\t\t{\n\t\t\t\tstartX = this._paddingLeft + ((width - this._paddingLeft - this._paddingRight) -\n\t\t\t\t\t((actualHorizontalTileCount * (tileWidth + this._horizontalGap)) - this._horizontalGap)) / 2;\n\t\t\t}\n\t\t\tvar startY:Number = this._paddingTop;\n\t\t\tif(this._paging != Direction.NONE || itemCount <= perPage)\n\t\t\t{\n\t\t\t\tvar actualVerticalTileCount:int = verticalTileCount;\n\t\t\t\tif(itemCount <= perPage)\n\t\t\t\t{\n\t\t\t\t\tactualVerticalTileCount = Math.ceil(itemCount / actualHorizontalTileCount);\n\t\t\t\t}\n\t\t\t\tif(this._verticalAlign == VerticalAlign.BOTTOM)\n\t\t\t\t{\n\t\t\t\t\tstartY = this._paddingTop + (height - this._paddingTop - this._paddingBottom) -\n\t\t\t\t\t\t((actualVerticalTileCount * (tileHeight + this._verticalGap)) - this._verticalGap);\n\t\t\t\t}\n\t\t\t\telse if(this._verticalAlign == VerticalAlign.MIDDLE)\n\t\t\t\t{\n\t\t\t\t\tstartY = this._paddingTop + ((height - this._paddingTop - this._paddingBottom) -\n\t\t\t\t\t\t((actualVerticalTileCount * (tileHeight + this._verticalGap)) - this._verticalGap)) / 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar pageIndex:int = 0;\n\t\t\tvar rowIndex:int = 0;\n\t\t\tvar lastRowIndex:int = int((itemCount - 1) / horizontalTileCount);\n\t\t\tvar nextPageStartIndex:int = perPage;\n\t\t\tvar pageStartX:Number = startX;\n\t\t\tvar positionX:Number = startX;\n\t\t\tvar positionY:Number = startY;\n\t\t\tvar rowItemCount:int = 0;\n\t\t\tfor(i = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\titem = items[i];\n\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(i != 0 && i % horizontalTileCount == 0)\n\t\t\t\t{\n\t\t\t\t\t//start of a new row\n\t\t\t\t\tpositionX = pageStartX;\n\t\t\t\t\tpositionY += tileHeight + this._verticalGap;\n\t\t\t\t\trowItemCount = 0;\n\t\t\t\t\trowIndex++;\n\t\t\t\t}\n\t\t\t\tif(i == nextPageStartIndex)\n\t\t\t\t{\n\t\t\t\t\t//start of a new page\n\t\t\t\t\tpageIndex++;\n\t\t\t\t\tnextPageStartIndex += perPage;\n\t\t\t\t\tif(this._paging === Direction.HORIZONTAL)\n\t\t\t\t\t{\n\t\t\t\t\t\tpositionX = pageStartX = startX + width * pageIndex;\n\t\t\t\t\t\tpositionY = startY;\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._paging === Direction.VERTICAL)\n\t\t\t\t\t{\n\t\t\t\t\t\tpositionY = startY + height * pageIndex;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif((x < (positionX + (tileWidth / 2))) &&\n\t\t\t\t\t((y < (positionY + tileHeight + (this._verticalGap / 2))) || (rowIndex == lastRowIndex)))\n\t\t\t\t{\n\t\t\t\t\tdropIndicator.x = positionX - dropIndicator.width / 2;\n\t\t\t\t\tdropIndicator.y = positionY;\n\t\t\t\t\tdropIndicator.height = tileHeight;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tpositionX += tileWidth + this._horizontalGap;\n\n\t\t\t\tif(rowItemCount > 0 &&\n\t\t\t\t\t(x < (positionX + (tileWidth / 2))) &&\n\t\t\t\t\t(x < (pageStartX + width)) && //not on next page\n\t\t\t\t\t(positionX + tileWidth) > (width - this._paddingRight) &&\n\t\t\t\t\t(y < (positionY + tileHeight + (this._verticalGap / 2))))\n\t\t\t\t{\n\t\t\t\t\t//index on next row, but position drop indicator at the end\n\t\t\t\t\t//of the current row\n\t\t\t\t\tdropIndicator.x = positionX - this._horizontalGap - dropIndicator.width / 2;\n\t\t\t\t\tdropIndicator.y = positionY;\n\t\t\t\t\tdropIndicator.height = tileHeight;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\trowItemCount++;\n\t\t\t}\n\t\t\tdropIndicator.x = positionX - dropIndicator.width / 2;\n\t\t\tdropIndicator.y = positionY;\n\t\t\tdropIndicator.height = tileHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function applyHorizontalAlign(items:Vector.<DisplayObject>, startIndex:int, endIndex:int, totalItemWidth:Number, availableWidth:Number):void\n\t\t{\n\t\t\tif(totalItemWidth >= availableWidth)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar horizontalAlignOffsetX:Number = 0;\n\t\t\tif(this._horizontalAlign === HorizontalAlign.RIGHT)\n\t\t\t{\n\t\t\t\thorizontalAlignOffsetX = availableWidth - totalItemWidth;\n\t\t\t}\n\t\t\telse if(this._horizontalAlign !== HorizontalAlign.LEFT)\n\t\t\t{\n\t\t\t\t//we're going to default to center if we encounter an\n\t\t\t\t//unknown value\n\t\t\t\thorizontalAlignOffsetX = Math.round((availableWidth - totalItemWidth) / 2);\n\t\t\t}\n\t\t\tif(horizontalAlignOffsetX != 0)\n\t\t\t{\n\t\t\t\tfor(var i:int = startIndex; i <= endIndex; i++)\n\t\t\t\t{\n\t\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\titem.x += horizontalAlignOffsetX;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function applyVerticalAlign(items:Vector.<DisplayObject>, startIndex:int, endIndex:int, totalItemHeight:Number, availableHeight:Number):void\n\t\t{\n\t\t\tif(totalItemHeight >= availableHeight)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar verticalAlignOffsetY:Number = 0;\n\t\t\tif(this._verticalAlign === VerticalAlign.BOTTOM)\n\t\t\t{\n\t\t\t\tverticalAlignOffsetY = availableHeight - totalItemHeight;\n\t\t\t}\n\t\t\telse if(this._verticalAlign === VerticalAlign.MIDDLE)\n\t\t\t{\n\t\t\t\tverticalAlignOffsetY = Math.round((availableHeight - totalItemHeight) / 2);\n\t\t\t}\n\t\t\tif(verticalAlignOffsetY != 0)\n\t\t\t{\n\t\t\t\tfor(var i:int = startIndex; i <= endIndex; i++)\n\t\t\t\t{\n\t\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\titem.y += verticalAlignOffsetY;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getVisibleIndicesAtScrollPositionWithHorizontalPaging(scrollX:Number, scrollY:Number, width:Number, height:Number, itemCount:int, result:Vector.<int>):void\n\t\t{\n\t\t\tthis.prepareTypicalItem();\n\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\n\t\t\tvar tileWidth:Number = calculatedTypicalItemWidth;\n\t\t\tvar tileHeight:Number = calculatedTypicalItemHeight;\n\t\t\tif(tileWidth < 0)\n\t\t\t{\n\t\t\t\ttileWidth = 0;\n\t\t\t}\n\t\t\tif(tileHeight < 0)\n\t\t\t{\n\t\t\t\ttileHeight = 0;\n\t\t\t}\n\t\t\tif(this._useSquareTiles)\n\t\t\t{\n\t\t\t\tif(tileWidth > tileHeight)\n\t\t\t\t{\n\t\t\t\t\ttileHeight = tileWidth;\n\t\t\t\t}\n\t\t\t\telse if(tileHeight > tileWidth)\n\t\t\t\t{\n\t\t\t\t\ttileWidth = tileHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar horizontalTileCount:int = this.calculateHorizontalTileCount(tileWidth,\n\t\t\t\twidth, width, this._paddingLeft + this._paddingRight,\n\t\t\t\tthis._horizontalGap, this._requestedColumnCount, itemCount);\n\t\t\tif(this._distributeWidths)\n\t\t\t{\n\t\t\t\ttileWidth = (width - this._paddingLeft - this._paddingRight - (horizontalTileCount * this._horizontalGap) + this._horizontalGap) / horizontalTileCount;\n\t\t\t\tif(this._useSquareTiles)\n\t\t\t\t{\n\t\t\t\t\ttileHeight = tileWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar verticalTileCount:int = this.calculateVerticalTileCount(tileHeight,\n\t\t\t\theight, height, this._paddingTop + this._paddingBottom,\n\t\t\t\tthis._verticalGap, this._requestedRowCount, itemCount,\n\t\t\t\thorizontalTileCount, this._distributeHeights && !this._useSquareTiles);\n\t\t\tif(this._distributeHeights && !this._useSquareTiles)\n\t\t\t{\n\t\t\t\ttileHeight = (height - this._paddingTop - this._paddingBottom - (verticalTileCount * this._verticalGap) + this._verticalGap) / verticalTileCount;\n\t\t\t}\n\t\t\tvar perPage:int = horizontalTileCount * verticalTileCount;\n\t\t\tvar minimumItemCount:int = perPage + 2 * verticalTileCount;\n\t\t\tif(minimumItemCount > itemCount)\n\t\t\t{\n\t\t\t\tminimumItemCount = itemCount;\n\t\t\t}\n\n\t\t\tvar startPageIndex:int = Math.round(scrollX / width);\n\t\t\tvar minimum:int = startPageIndex * perPage;\n\t\t\tvar totalRowWidth:Number = horizontalTileCount * (tileWidth + this._horizontalGap) - this._horizontalGap;\n\t\t\tvar leftSideOffset:Number = 0;\n\t\t\tvar rightSideOffset:Number = 0;\n\t\t\tif(totalRowWidth < width)\n\t\t\t{\n\t\t\t\tif(this._horizontalAlign === HorizontalAlign.RIGHT)\n\t\t\t\t{\n\t\t\t\t\tleftSideOffset = width - this._paddingLeft - this._paddingRight - totalRowWidth;\n\t\t\t\t\trightSideOffset = 0;\n\t\t\t\t}\n\t\t\t\telse if(this._horizontalAlign === HorizontalAlign.CENTER)\n\t\t\t\t{\n\t\t\t\t\tleftSideOffset = rightSideOffset = Math.round((width - this._paddingLeft - this._paddingRight - totalRowWidth) / 2);\n\t\t\t\t}\n\t\t\t\telse //left\n\t\t\t\t{\n\t\t\t\t\tleftSideOffset = 0;\n\t\t\t\t\trightSideOffset = width - this._paddingLeft - this._paddingRight - totalRowWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar columnOffset:int = 0;\n\t\t\tvar pageStartPosition:Number = startPageIndex * width;\n\t\t\tvar partialPageSize:Number = scrollX - pageStartPosition;\n\t\t\tif(partialPageSize < 0)\n\t\t\t{\n\t\t\t\tpartialPageSize = -partialPageSize - this._paddingRight - rightSideOffset;\n\t\t\t\tif(partialPageSize < 0)\n\t\t\t\t{\n\t\t\t\t\tpartialPageSize = 0;\n\t\t\t\t}\n\t\t\t\tcolumnOffset = -Math.floor(partialPageSize / (tileWidth + this._horizontalGap)) - 1;\n\t\t\t\tminimum += -perPage + horizontalTileCount + columnOffset;\n\t\t\t}\n\t\t\telse if(partialPageSize > 0)\n\t\t\t{\n\t\t\t\tpartialPageSize = partialPageSize - this._paddingLeft - leftSideOffset;\n\t\t\t\tif(partialPageSize < 0)\n\t\t\t\t{\n\t\t\t\t\tpartialPageSize = 0;\n\t\t\t\t}\n\t\t\t\tcolumnOffset = Math.floor(partialPageSize / (tileWidth + this._horizontalGap));\n\t\t\t\tminimum += columnOffset;\n\t\t\t}\n\t\t\tif(minimum < 0)\n\t\t\t{\n\t\t\t\tminimum = 0;\n\t\t\t\tcolumnOffset = 0;\n\t\t\t}\n\t\t\tif(minimum + minimumItemCount >= itemCount)\n\t\t\t{\n\t\t\t\tvar resultPushIndex:int = result.length;\n\t\t\t\t//an optimized path when we're on or near the last page\n\t\t\t\tminimum = itemCount - minimumItemCount;\n\t\t\t\tfor(var i:int = minimum; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\tresult[resultPushIndex] = i;\n\t\t\t\t\tresultPushIndex++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar rowIndex:int = 0;\n\t\t\t\tvar columnIndex:int = (horizontalTileCount + columnOffset) % horizontalTileCount;\n\t\t\t\tvar pageStart:int = int(minimum / perPage) * perPage;\n\t\t\t\ti = minimum;\n\t\t\t\tvar resultLength:int = 0;\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\tif(i < itemCount)\n\t\t\t\t\t{\n\t\t\t\t\t\tresult[resultLength] = i;\n\t\t\t\t\t\tresultLength++;\n\t\t\t\t\t}\n\t\t\t\t\trowIndex++;\n\t\t\t\t\tif(rowIndex == verticalTileCount)\n\t\t\t\t\t{\n\t\t\t\t\t\trowIndex = 0;\n\t\t\t\t\t\tcolumnIndex++;\n\t\t\t\t\t\tif(columnIndex == horizontalTileCount)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcolumnIndex = 0;\n\t\t\t\t\t\t\tpageStart += perPage;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ti = pageStart + columnIndex - horizontalTileCount;\n\t\t\t\t\t}\n\t\t\t\t\ti += horizontalTileCount;\n\t\t\t\t}\n\t\t\t\twhile(resultLength < minimumItemCount && pageStart < itemCount);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getVisibleIndicesAtScrollPositionWithVerticalPaging(scrollX:Number, scrollY:Number, width:Number, height:Number, itemCount:int, result:Vector.<int>):void\n\t\t{\n\t\t\tthis.prepareTypicalItem();\n\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\n\t\t\tvar tileWidth:Number = calculatedTypicalItemWidth;\n\t\t\tvar tileHeight:Number = calculatedTypicalItemHeight;\n\t\t\tif(tileWidth < 0)\n\t\t\t{\n\t\t\t\ttileWidth = 0;\n\t\t\t}\n\t\t\tif(tileHeight < 0)\n\t\t\t{\n\t\t\t\ttileHeight = 0;\n\t\t\t}\n\t\t\tif(this._useSquareTiles)\n\t\t\t{\n\t\t\t\tif(tileWidth > tileHeight)\n\t\t\t\t{\n\t\t\t\t\ttileHeight = tileWidth;\n\t\t\t\t}\n\t\t\t\telse if(tileHeight > tileWidth)\n\t\t\t\t{\n\t\t\t\t\ttileWidth = tileHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar horizontalTileCount:int = this.calculateHorizontalTileCount(tileWidth,\n\t\t\t\twidth, width, this._paddingLeft + this._paddingRight,\n\t\t\t\tthis._horizontalGap, this._requestedColumnCount, itemCount);\n\t\t\tif(this._distributeWidths)\n\t\t\t{\n\t\t\t\ttileWidth = (width - this._paddingLeft - this._paddingRight - (horizontalTileCount * this._horizontalGap) + this._horizontalGap) / horizontalTileCount;\n\t\t\t\tif(this._useSquareTiles)\n\t\t\t\t{\n\t\t\t\t\ttileHeight = tileWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar verticalTileCount:int = this.calculateVerticalTileCount(tileHeight,\n\t\t\t\theight, height, this._paddingTop + this._paddingBottom,\n\t\t\t\tthis._verticalGap, this._requestedRowCount, itemCount,\n\t\t\t\thorizontalTileCount, this._distributeHeights && !this._useSquareTiles);\n\t\t\tif(this._distributeHeights && !this._useSquareTiles)\n\t\t\t{\n\t\t\t\ttileHeight = (height - this._paddingTop - this._paddingBottom - (verticalTileCount * this._verticalGap) + this._verticalGap) / verticalTileCount;\n\t\t\t}\n\t\t\tvar perPage:int = horizontalTileCount * verticalTileCount;\n\t\t\tvar minimumItemCount:int = perPage + 2 * horizontalTileCount;\n\t\t\tif(minimumItemCount > itemCount)\n\t\t\t{\n\t\t\t\tminimumItemCount = itemCount;\n\t\t\t}\n\n\t\t\tvar startPageIndex:int = Math.round(scrollY / height);\n\t\t\tvar minimum:int = startPageIndex * perPage;\n\t\t\tvar totalColumnHeight:Number = verticalTileCount * (tileHeight + this._verticalGap) - this._verticalGap;\n\t\t\tvar topSideOffset:Number = 0;\n\t\t\tvar bottomSideOffset:Number = 0;\n\t\t\tif(totalColumnHeight < height)\n\t\t\t{\n\t\t\t\tif(this._verticalAlign === VerticalAlign.BOTTOM)\n\t\t\t\t{\n\t\t\t\t\ttopSideOffset = height - this._paddingTop - this._paddingBottom - totalColumnHeight;\n\t\t\t\t\tbottomSideOffset = 0;\n\t\t\t\t}\n\t\t\t\telse if(this._verticalAlign === VerticalAlign.MIDDLE)\n\t\t\t\t{\n\t\t\t\t\ttopSideOffset = bottomSideOffset = Math.round((height - this._paddingTop - this._paddingBottom - totalColumnHeight) / 2);\n\t\t\t\t}\n\t\t\t\telse //top\n\t\t\t\t{\n\t\t\t\t\ttopSideOffset = 0;\n\t\t\t\t\tbottomSideOffset = height - this._paddingTop - this._paddingBottom - totalColumnHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar rowOffset:int = 0;\n\t\t\tvar pageStartPosition:Number = startPageIndex * height;\n\t\t\tvar partialPageSize:Number = scrollY - pageStartPosition;\n\t\t\tif(partialPageSize < 0)\n\t\t\t{\n\t\t\t\tpartialPageSize = -partialPageSize - this._paddingBottom - bottomSideOffset;\n\t\t\t\tif(partialPageSize < 0)\n\t\t\t\t{\n\t\t\t\t\tpartialPageSize = 0;\n\t\t\t\t}\n\t\t\t\trowOffset = -Math.floor(partialPageSize / (tileHeight + this._verticalGap)) - 1;\n\t\t\t\tminimum += horizontalTileCount * rowOffset;\n\t\t\t}\n\t\t\telse if(partialPageSize > 0)\n\t\t\t{\n\t\t\t\tpartialPageSize = partialPageSize - this._paddingTop - topSideOffset;\n\t\t\t\tif(partialPageSize < 0)\n\t\t\t\t{\n\t\t\t\t\tpartialPageSize = 0;\n\t\t\t\t}\n\t\t\t\trowOffset = Math.floor(partialPageSize / (tileHeight + this._verticalGap));\n\t\t\t\tminimum += horizontalTileCount * rowOffset;\n\t\t\t}\n\t\t\tif(minimum < 0)\n\t\t\t{\n\t\t\t\tminimum = 0;\n\t\t\t\trowOffset = 0;\n\t\t\t}\n\n\t\t\tvar maximum:int = minimum + minimumItemCount;\n\t\t\tif(maximum > itemCount)\n\t\t\t{\n\t\t\t\tmaximum = itemCount;\n\t\t\t}\n\t\t\tminimum = maximum - minimumItemCount;\n\t\t\tvar resultPushIndex:int = result.length;\n\t\t\tfor(var i:int = minimum; i < maximum; i++)\n\t\t\t{\n\t\t\t\tresult[resultPushIndex] = i;\n\t\t\t\tresultPushIndex++;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function getVisibleIndicesAtScrollPositionWithoutPaging(scrollX:Number, scrollY:Number, width:Number, height:Number, itemCount:int, result:Vector.<int>):void\n\t\t{\n\t\t\tthis.prepareTypicalItem();\n\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\n\t\t\tvar tileWidth:Number = calculatedTypicalItemWidth;\n\t\t\tvar tileHeight:Number = calculatedTypicalItemHeight;\n\t\t\tif(tileWidth < 0)\n\t\t\t{\n\t\t\t\ttileWidth = 0;\n\t\t\t}\n\t\t\tif(tileHeight < 0)\n\t\t\t{\n\t\t\t\ttileHeight = 0;\n\t\t\t}\n\t\t\tif(this._useSquareTiles)\n\t\t\t{\n\t\t\t\tif(tileWidth > tileHeight)\n\t\t\t\t{\n\t\t\t\t\ttileHeight = tileWidth;\n\t\t\t\t}\n\t\t\t\telse if(tileHeight > tileWidth)\n\t\t\t\t{\n\t\t\t\t\ttileWidth = tileHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar horizontalTileCount:int = this.calculateHorizontalTileCount(tileWidth,\n\t\t\t\twidth, width, this._paddingLeft + this._paddingRight,\n\t\t\t\tthis._horizontalGap, this._requestedColumnCount, itemCount);\n\t\t\tif(this._distributeWidths)\n\t\t\t{\n\t\t\t\ttileWidth = (width - this._paddingLeft - this._paddingRight - (horizontalTileCount * this._horizontalGap) + this._horizontalGap) / horizontalTileCount;\n\t\t\t\tif(this._useSquareTiles)\n\t\t\t\t{\n\t\t\t\t\ttileHeight = tileWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._distributeHeights && !this._useSquareTiles)\n\t\t\t{\n\t\t\t\tvar verticalTileCount:int = this.calculateVerticalTileCount(tileHeight,\n\t\t\t\t\theight, height, this._paddingTop + this._paddingBottom,\n\t\t\t\t\tthis._verticalGap, this._requestedRowCount, itemCount,\n\t\t\t\t\thorizontalTileCount, this._distributeHeights && !this._useSquareTiles);\n\t\t\t\ttileHeight = (height - this._paddingTop - this._paddingBottom - (verticalTileCount * this._verticalGap) + this._verticalGap) / verticalTileCount;\n\t\t\t}\n\t\t\tverticalTileCount = Math.ceil((height + this._verticalGap) / (tileHeight + this._verticalGap)) + 1;\n\t\t\tvar minimumItemCount:int = verticalTileCount * horizontalTileCount;\n\t\t\tif(minimumItemCount > itemCount)\n\t\t\t{\n\t\t\t\tminimumItemCount = itemCount;\n\t\t\t}\n\t\t\tvar rowIndexOffset:int = 0;\n\t\t\tvar totalRowHeight:Number = Math.ceil(itemCount / horizontalTileCount) * (tileHeight + this._verticalGap) - this._verticalGap;\n\t\t\tif(totalRowHeight < height)\n\t\t\t{\n\t\t\t\tif(this._verticalAlign === VerticalAlign.BOTTOM)\n\t\t\t\t{\n\t\t\t\t\trowIndexOffset = Math.ceil((height - totalRowHeight) / (tileHeight + this._verticalGap));\n\t\t\t\t}\n\t\t\t\telse if(this._verticalAlign === VerticalAlign.MIDDLE)\n\t\t\t\t{\n\t\t\t\t\trowIndexOffset = Math.ceil((height - totalRowHeight) / (tileHeight + this._verticalGap) / 2);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar rowIndex:int = -rowIndexOffset + Math.floor((scrollY - this._paddingTop + this._verticalGap) / (tileHeight + this._verticalGap));\n\t\t\tvar minimum:int = rowIndex * horizontalTileCount;\n\t\t\tif(minimum < 0)\n\t\t\t{\n\t\t\t\tminimum = 0;\n\t\t\t}\n\t\t\tvar maximum:int = minimum + minimumItemCount;\n\t\t\tif(maximum > itemCount)\n\t\t\t{\n\t\t\t\tmaximum = itemCount;\n\t\t\t}\n\t\t\tminimum = maximum - minimumItemCount;\n\t\t\tvar resultPushIndex:int = result.length;\n\t\t\tfor(var i:int = minimum; i < maximum; i++)\n\t\t\t{\n\t\t\t\tresult[resultPushIndex] = i;\n\t\t\t\tresultPushIndex++;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function validateItems(items:Vector.<DisplayObject>):void\n\t\t{\n\t\t\tvar itemCount:int = items.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(item is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(item).validate();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function prepareTypicalItem():void\n\t\t{\n\t\t\tif(!this._typicalItem)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._resetTypicalItemDimensionsOnMeasure)\n\t\t\t{\n\t\t\t\tthis._typicalItem.width = this._typicalItemWidth;\n\t\t\t\tthis._typicalItem.height = this._typicalItemHeight;\n\t\t\t}\n\t\t\tif(this._typicalItem is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this._typicalItem).validate();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function calculateScrollPositionForIndex(index:int, items:Vector.<DisplayObject>,\n\t\t\tx:Number, y:Number, width:Number, height:Number, result:Point = null,\n\t\t\tnearest:Boolean = false, scrollX:Number = 0, scrollY:Number = 0):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthis.prepareTypicalItem();\n\t\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\t\t\t}\n\n\t\t\tvar itemCount:int = items.length;\n\t\t\tvar tileWidth:Number = this._useVirtualLayout ? calculatedTypicalItemWidth : 0;\n\t\t\tvar tileHeight:Number = this._useVirtualLayout ? calculatedTypicalItemHeight : 0;\n\t\t\t//a virtual layout assumes that all items are the same size as\n\t\t\t//the typical item, so we don't need to measure every item in\n\t\t\t//that case\n\t\t\tif(!this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\t\tif(!item)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tvar itemWidth:Number = item.width;\n\t\t\t\t\tvar itemHeight:Number = item.height;\n\t\t\t\t\tif(itemWidth > tileWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\ttileWidth = itemWidth;\n\t\t\t\t\t}\n\t\t\t\t\tif(itemHeight > tileHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\ttileHeight = itemHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(tileWidth < 0)\n\t\t\t{\n\t\t\t\ttileWidth = 0;\n\t\t\t}\n\t\t\tif(tileHeight < 0)\n\t\t\t{\n\t\t\t\ttileHeight = 0;\n\t\t\t}\n\t\t\tif(this._useSquareTiles)\n\t\t\t{\n\t\t\t\tif(tileWidth > tileHeight)\n\t\t\t\t{\n\t\t\t\t\ttileHeight = tileWidth;\n\t\t\t\t}\n\t\t\t\telse if(tileHeight > tileWidth)\n\t\t\t\t{\n\t\t\t\t\ttileWidth = tileHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar horizontalTileCount:int = (width - this._paddingLeft - this._paddingRight + this._horizontalGap) / (tileWidth + this._horizontalGap);\n\t\t\tif(horizontalTileCount < 1)\n\t\t\t{\n\t\t\t\thorizontalTileCount = 1;\n\t\t\t}\n\t\t\telse if(this._requestedColumnCount > 0 && horizontalTileCount > this._requestedColumnCount)\n\t\t\t{\n\t\t\t\thorizontalTileCount = this._requestedColumnCount;\n\t\t\t}\n\t\t\tif(this._paging !== Direction.NONE)\n\t\t\t{\n\t\t\t\tvar verticalTileCount:int = (height - this._paddingTop - this._paddingBottom + this._verticalGap) / (tileHeight + this._verticalGap);\n\t\t\t\tif(verticalTileCount < 1)\n\t\t\t\t{\n\t\t\t\t\tverticalTileCount = 1;\n\t\t\t\t}\n\t\t\t\tvar perPage:Number = horizontalTileCount * verticalTileCount;\n\t\t\t\tvar pageIndex:int = index / perPage;\n\t\t\t\tif(this._paging === Direction.HORIZONTAL)\n\t\t\t\t{\n\t\t\t\t\tresult.x = pageIndex * width;\n\t\t\t\t\tresult.y = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tresult.x = 0;\n\t\t\t\t\tresult.y = pageIndex * height;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar resultY:Number = this._paddingTop + ((tileHeight + this._verticalGap) * int(index / horizontalTileCount));\n\t\t\t\tif(nearest)\n\t\t\t\t{\n\t\t\t\t\tvar bottomPosition:Number = resultY - (height - tileHeight);\n\t\t\t\t\tif(scrollY >= bottomPosition && scrollY <= resultY)\n\t\t\t\t\t{\n\t\t\t\t\t\t//keep the current scroll position because the item is already\n\t\t\t\t\t\t//fully visible\n\t\t\t\t\t\tresultY = scrollY;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar topDifference:Number = Math.abs(resultY - scrollY);\n\t\t\t\t\t\tvar bottomDifference:Number = Math.abs(bottomPosition - scrollY);\n\t\t\t\t\t\tif(bottomDifference < topDifference)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tresultY = bottomPosition;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tresultY -= Math.round((height - tileHeight) / 2);\n\t\t\t\t}\n\t\t\t\tresult.x = 0;\n\t\t\t\tresult.y = resultY;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function calculateHorizontalTileCount(tileWidth:Number,\n\t\t\texplicitWidth:Number, maxWidth:Number, paddingLeftAndRight:Number,\n\t\t\thorizontalGap:Number, requestedColumnCount:int, totalItemCount:int):int\n\t\t{\n\t\t\tif(requestedColumnCount > 0 && this._distributeWidths)\n\t\t\t{\n\t\t\t\treturn requestedColumnCount;\n\t\t\t}\n\t\t\tvar tileCount:int;\n\t\t\tif(explicitWidth === explicitWidth) //!isNaN\n\t\t\t{\n\t\t\t\t//in this case, the exact width is known\n\t\t\t\ttileCount = (explicitWidth - paddingLeftAndRight + horizontalGap) / (tileWidth + horizontalGap);\n\t\t\t\tif(requestedColumnCount > 0 && tileCount > requestedColumnCount)\n\t\t\t\t{\n\t\t\t\t\treturn requestedColumnCount;\n\t\t\t\t}\n\t\t\t\tif(tileCount > totalItemCount)\n\t\t\t\t{\n\t\t\t\t\ttileCount = totalItemCount;\n\t\t\t\t}\n\t\t\t\tif(tileCount < 1)\n\t\t\t\t{\n\t\t\t\t\t//we must have at least one tile per row\n\t\t\t\t\ttileCount = 1;\n\t\t\t\t}\n\t\t\t\treturn tileCount;\n\t\t\t}\n\n\t\t\t//in this case, the width is not known, but it may have a maximum\n\t\t\tif(requestedColumnCount > 0)\n\t\t\t{\n\t\t\t\ttileCount = requestedColumnCount;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttileCount = totalItemCount;\n\t\t\t}\n\n\t\t\tvar maxTileCount:int = int.MAX_VALUE;\n\t\t\tif(maxWidth === maxWidth && //!isNaN\n\t\t\t\tmaxWidth < Number.POSITIVE_INFINITY)\n\t\t\t{\n\t\t\t\tmaxTileCount = (maxWidth - paddingLeftAndRight + horizontalGap) / (tileWidth + horizontalGap);\n\t\t\t\tif(maxTileCount < 1)\n\t\t\t\t{\n\t\t\t\t\t//we must have at least one tile per row\n\t\t\t\t\tmaxTileCount = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(tileCount > maxTileCount)\n\t\t\t{\n\t\t\t\ttileCount = maxTileCount;\n\t\t\t}\n\t\t\tif(tileCount < 1)\n\t\t\t{\n\t\t\t\t//we must have at least one tile per row\n\t\t\t\ttileCount = 1;\n\t\t\t}\n\t\t\treturn tileCount;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function calculateVerticalTileCount(tileHeight:Number,\n\t\t\texplicitHeight:Number, maxHeight:Number, paddingTopAndBottom:Number,\n\t\t\tverticalGap:Number, requestedRowCount:int, totalItemCount:int,\n\t\t\thorizontalTileCount:int, distributeHeights:Boolean):int\n\t\t{\n\t\t\t//using the horizontal tile count, calculate how many rows would be\n\t\t\t//required for the total number of items if there were no restrictions.\n\t\t\tvar defaultVerticalTileCount:int = Math.ceil(totalItemCount / horizontalTileCount);\n\t\t\tif(distributeHeights)\n\t\t\t{\n\t\t\t\tif(requestedRowCount > 0 && defaultVerticalTileCount > requestedRowCount)\n\t\t\t\t{\n\t\t\t\t\treturn requestedRowCount;\n\t\t\t\t}\n\t\t\t\treturn defaultVerticalTileCount;\n\t\t\t}\n\n\t\t\tvar verticalTileCount:int;\n\t\t\tif(explicitHeight === explicitHeight) //!isNaN\n\t\t\t{\n\t\t\t\t//in this case, the exact height is known\n\t\t\t\tverticalTileCount = (explicitHeight - paddingTopAndBottom + verticalGap) / (tileHeight + verticalGap);\n\t\t\t\tif(requestedRowCount > 0 && verticalTileCount > requestedRowCount)\n\t\t\t\t{\n\t\t\t\t\treturn requestedRowCount;\n\t\t\t\t}\n\t\t\t\tif(verticalTileCount > defaultVerticalTileCount)\n\t\t\t\t{\n\t\t\t\t\tverticalTileCount = defaultVerticalTileCount;\n\t\t\t\t}\n\t\t\t\tif(verticalTileCount < 1)\n\t\t\t\t{\n\t\t\t\t\t//we must have at least one tile per row\n\t\t\t\t\tverticalTileCount = 1;\n\t\t\t\t}\n\t\t\t\treturn verticalTileCount;\n\t\t\t}\n\n\t\t\t//in this case, the height is not known, but it may have a maximum\n\t\t\tif(requestedRowCount > 0)\n\t\t\t{\n\t\t\t\tverticalTileCount = requestedRowCount;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tverticalTileCount = defaultVerticalTileCount;\n\t\t\t}\n\n\t\t\tvar maxVerticalTileCount:int = int.MAX_VALUE;\n\t\t\tif(maxHeight === maxHeight && //!isNaN\n\t\t\t\tmaxHeight < Number.POSITIVE_INFINITY)\n\t\t\t{\n\t\t\t\tmaxVerticalTileCount = (maxHeight - paddingTopAndBottom + verticalGap) / (tileHeight + verticalGap);\n\t\t\t\tif(maxVerticalTileCount < 1)\n\t\t\t\t{\n\t\t\t\t\t//we must have at least one tile per row\n\t\t\t\t\tmaxVerticalTileCount = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(verticalTileCount > maxVerticalTileCount)\n\t\t\t{\n\t\t\t\tverticalTileCount = maxVerticalTileCount;\n\t\t\t}\n\t\t\tif(verticalTileCount < 1)\n\t\t\t{\n\t\t\t\t//we must have at least one tile per row\n\t\t\t\tverticalTileCount = 1;\n\t\t\t}\n\t\t\treturn verticalTileCount;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/VerticalAlign.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\t/**\n\t * Constants for vertical alignment of items in a layout.\n\t *\n\t * <p>Note: Some constants may not be valid for certain properties. Please\n\t * see the description of the property in the API reference for full\n\t * details.</p>\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class VerticalAlign\n\t{\n\t\t/**\n\t\t * The items in the layout will be vertically aligned to the top of the\n\t\t * bounds.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const TOP:String = \"top\";\n\n\t\t/**\n\t\t * The items in the layout will be vertically aligned to the middle of\n\t\t * the bounds.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const MIDDLE:String = \"middle\";\n\n\t\t/**\n\t\t * The items in the layout will be vertically aligned to the bottom of\n\t\t * the bounds.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const BOTTOM:String = \"bottom\";\n\n\t\t/**\n\t\t * The items in the layout will fill the height of the bounds.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const JUSTIFY:String = \"justify\";\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/VerticalLayout.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IMeasureDisplayObject;\n\timport feathers.core.IValidating;\n\n\timport flash.errors.IllegalOperationError;\n\timport flash.geom.Point;\n\timport flash.ui.Keyboard;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.DisplayObjectContainer;\n\timport starling.events.Event;\n\timport starling.utils.Pool;\n\n\t/**\n\t * Positions items from top to bottom in a single column.\n\t *\n\t * @see ../../../help/vertical-layout.html How to use VerticalLayout with Feathers containers\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class VerticalLayout extends BaseLinearLayout implements IVariableVirtualLayout, ITrimmedVirtualLayout, IGroupedLayout, IDragDropLayout\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function VerticalLayout()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t[Inspectable(type=\"String\",enumeration=\"left,center,right,justify\")]\n\t\t/**\n\t\t * The alignment of the items horizontally, on the x-axis.\n\t\t *\n\t\t * <p>If the <code>horizontalAlign</code> property is set to\n\t\t * <code>feathers.layout.HorizontalAlign.JUSTIFY</code>, the\n\t\t * <code>width</code>, <code>minWidth</code>, and <code>maxWidth</code>\n\t\t * properties of the items may be changed, and their original values\n\t\t * ignored by the layout. In this situation, if the width needs to be\n\t\t * constrained, the <code>width</code>, <code>minWidth</code>, or\n\t\t * <code>maxWidth</code> properties should instead be set on the parent\n\t\t * container using the layout.</p>\n\t\t *\n\t\t * @default feathers.layout.HorizontalAlign.LEFT\n\t\t *\n\t\t * @see feathers.layout.HorizontalAlign#LEFT\n\t\t * @see feathers.layout.HorizontalAlign#CENTER\n\t\t * @see feathers.layout.HorizontalAlign#RIGHT\n\t\t * @see feathers.layout.HorizontalAlign#JUSTIFY\n\t\t */\n\t\toverride public function get horizontalAlign():String\n\t\t{\n\t\t\t//this is an override so that this class can have its own documentation.\n\t\t\treturn this._horizontalAlign;\n\t\t}\n\n\t\t[Inspectable(type=\"String\",enumeration=\"top,middle,bottom\")]\n\t\t/**\n\t\t * If the total item height is less than the bounds, the positions of\n\t\t * the items can be aligned vertically, on the y-axis.\n\t\t *\n\t\t * <p><strong>Note:</strong> The <code>VerticalAlign.JUSTIFY</code>\n\t\t * constant is not supported.</p>\n\t\t *\n\t\t * @default feathers.layout.VerticalAlign.TOP\n\t\t *\n\t\t * @see feathers.layout.VerticalAlign#TOP\n\t\t * @see feathers.layout.VerticalAlign#MIDDLE\n\t\t * @see feathers.layout.VerticalAlign#BOTTOM\n\t\t */\n\t\toverride public function get verticalAlign():String\n\t\t{\n\t\t\t//this is an override so that this class can have its own documentation.\n\t\t\treturn this._verticalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _stickyHeader:Boolean = false;\n\n\t\t/**\n\t\t * If a non-null value for the <code>headerIndices</code> property is\n\t\t * provided (by a component like <code>GroupedList</code>), and the\n\t\t * <code>stickyHeader</code> property is set to <code>true</code>, a\n\t\t * header will stick to the top of the view port until the current group\n\t\t * completely scrolls out of the view port.\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic function get stickyHeader():Boolean\n\t\t{\n\t\t\treturn this._stickyHeader;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set stickyHeader(value:Boolean):void\n\t\t{\n\t\t\tif(this._stickyHeader == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._stickyHeader = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _headerIndices:Vector.<int>;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get headerIndices():Vector.<int>\n\t\t{\n\t\t\treturn this._headerIndices;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set headerIndices(value:Vector.<int>):void\n\t\t{\n\t\t\tif(this._headerIndices == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._headerIndices = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _distributeHeights:Boolean = false;\n\n\t\t/**\n\t\t * Distributes the height of the view port equally to each item. If the\n\t\t * view port height needs to be measured, the largest item's height will\n\t\t * be used for all items, subject to any specified minimum and maximum\n\t\t * height values.\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic function get distributeHeights():Boolean\n\t\t{\n\t\t\treturn this._distributeHeights;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set distributeHeights(value:Boolean):void\n\t\t{\n\t\t\tif(this._distributeHeights == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._distributeHeights = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _requestedRowCount:int = 0;\n\n\t\t/**\n\t\t * Requests that the layout set the view port dimensions to display a\n\t\t * specific number of rows (plus gaps and padding), if possible. If the\n\t\t * explicit height of the view port is set, then this value will be\n\t\t * ignored. If the view port's minimum and/or maximum height are set,\n\t\t * the actual number of visible rows may be adjusted to meet those\n\t\t * requirements. Set this value to <code>0</code> to display as many\n\t\t * rows as possible.\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #maxRowCount\n\t\t */\n\t\tpublic function get requestedRowCount():int\n\t\t{\n\t\t\treturn this._requestedRowCount;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set requestedRowCount(value:int):void\n\t\t{\n\t\t\tif(value < 0)\n\t\t\t{\n\t\t\t\tthrow RangeError(\"requestedRowCount requires a value >= 0\");\n\t\t\t}\n\t\t\tif(this._requestedRowCount == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._requestedRowCount = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maxRowCount:int = 0;\n\n\t\t/**\n\t\t * The maximum number of rows to display. If the explicit height of the\n\t\t * view port is set or if <code>requestedRowCount</code> is set, then\n\t\t * this value will be ignored. If the view port's minimum and/or maximum\n\t\t * height are set, the actual number of visible rows may be adjusted to\n\t\t * meet those requirements. Set this value to <code>0</code> to display\n\t\t * as many rows as possible.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get maxRowCount():int\n\t\t{\n\t\t\treturn this._maxRowCount;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maxRowCount(value:int):void\n\t\t{\n\t\t\tif(value < 0)\n\t\t\t{\n\t\t\t\tthrow RangeError(\"maxRowCount requires a value >= 0\");\n\t\t\t}\n\t\t\tif(this._maxRowCount == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._maxRowCount = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _scrollPositionVerticalAlign:String = VerticalAlign.MIDDLE;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"top,middle,bottom\")]\n\t\t/**\n\t\t * When the scroll position is calculated for an item, an attempt will\n\t\t * be made to align the item to this position.\n\t\t *\n\t\t * @default feathers.layout.VerticalAlign.MIDDLE\n\t\t *\n\t\t * @see feathers.layout.VerticalAlign#TOP\n\t\t * @see feathers.layout.VerticalAlign#MIDDLE\n\t\t * @see feathers.layout.VerticalAlign#BOTTOM\n\t\t */\n\t\tpublic function get scrollPositionVerticalAlign():String\n\t\t{\n\t\t\treturn this._scrollPositionVerticalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set scrollPositionVerticalAlign(value:String):void\n\t\t{\n\t\t\tthis._scrollPositionVerticalAlign = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _headerScrollPositionVerticalAlign:String = VerticalAlign.TOP;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"top,middle,bottom\")]\n\t\t/**\n\t\t * When the scroll position is calculated for a header (specified by a\n\t\t * <code>GroupedList</code> or another component with the\n\t\t * <code>headerIndicies</code> property, an attempt will be made to\n\t\t * align the header to this position.\n\t\t *\n\t\t * @default feathers.layout.VerticalAlign.TOP\n\t\t *\n\t\t * @see feathers.layout.VerticalAlign#TOP\n\t\t * @see feathers.layout.VerticalAlign#MIDDLE\n\t\t * @see feathers.layout.VerticalAlign#BOTTOM\n\t\t * @see #headerIndices\n\t\t * @see #scrollPositionVerticalAlign\n\t\t */\n\t\tpublic function get headerScrollPositionVerticalAlign():String\n\t\t{\n\t\t\treturn this._headerScrollPositionVerticalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set headerScrollPositionVerticalAlign(value:String):void\n\t\t{\n\t\t\tthis._headerScrollPositionVerticalAlign = value;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\toverride public function get requiresLayoutOnScroll():Boolean\n\t\t{\n\t\t\treturn this._useVirtualLayout ||\n\t\t\t\t(this._headerIndices && this._stickyHeader); //the header needs to stick!\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function layout(items:Vector.<DisplayObject>, viewPortBounds:ViewPortBounds = null, result:LayoutBoundsResult = null):LayoutBoundsResult\n\t\t{\n\t\t\t//this function is very long because it may be called every frame,\n\t\t\t//in some situations. testing revealed that splitting this function\n\t\t\t//into separate, smaller functions affected performance.\n\t\t\t//since the SWC compiler cannot inline functions, we can't use that\n\t\t\t//feature either.\n\n\t\t\t//since viewPortBounds can be null, we may need to provide some defaults\n\t\t\tvar scrollX:Number = viewPortBounds ? viewPortBounds.scrollX : 0;\n\t\t\tvar scrollY:Number = viewPortBounds ? viewPortBounds.scrollY : 0;\n\t\t\tvar boundsX:Number = viewPortBounds ? viewPortBounds.x : 0;\n\t\t\tvar boundsY:Number = viewPortBounds ? viewPortBounds.y : 0;\n\t\t\tvar minWidth:Number = viewPortBounds ? viewPortBounds.minWidth : 0;\n\t\t\tvar minHeight:Number = viewPortBounds ? viewPortBounds.minHeight : 0;\n\t\t\tvar maxWidth:Number = viewPortBounds ? viewPortBounds.maxWidth : Number.POSITIVE_INFINITY;\n\t\t\tvar maxHeight:Number = viewPortBounds ? viewPortBounds.maxHeight : Number.POSITIVE_INFINITY;\n\t\t\tvar explicitWidth:Number = viewPortBounds ? viewPortBounds.explicitWidth : NaN;\n\t\t\tvar explicitHeight:Number = viewPortBounds ? viewPortBounds.explicitHeight : NaN;\n\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\t//if the layout is virtualized, we'll need the dimensions of the\n\t\t\t\t//typical item so that we have fallback values when an item is null\n\t\t\t\tthis.prepareTypicalItem(explicitWidth - this._paddingLeft - this._paddingRight);\n\t\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\t\t\t}\n\n\t\t\tvar needsExplicitWidth:Boolean = explicitWidth !== explicitWidth; //isNaN\n\t\t\tvar needsExplicitHeight:Boolean = explicitHeight !== explicitHeight; //isNaN\n\t\t\tvar distributedHeight:Number;\n\t\t\tif(!needsExplicitHeight && this._distributeHeights)\n\t\t\t{\n\t\t\t\t//we need to calculate this before validateItems() because it\n\t\t\t\t//needs to be passed in there.\n\t\t\t\tdistributedHeight = this.calculateDistributedHeight(items, explicitHeight, minHeight, maxHeight, false);\n\t\t\t\tif(this._useVirtualLayout)\n\t\t\t\t{\n\t\t\t\t\tcalculatedTypicalItemHeight = distributedHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(!this._useVirtualLayout || this._hasVariableItemDimensions || this._distributeHeights ||\n\t\t\t\tthis._horizontalAlign != HorizontalAlign.JUSTIFY ||\n\t\t\t\tneedsExplicitWidth) //isNaN\n\t\t\t{\n\t\t\t\t//in some cases, we may need to validate all of the items so\n\t\t\t\t//that we can use their dimensions below.\n\t\t\t\tthis.validateItems(items, explicitWidth - this._paddingLeft - this._paddingRight,\n\t\t\t\t\tminWidth - this._paddingLeft - this._paddingRight,\n\t\t\t\t\tmaxWidth - this._paddingLeft - this._paddingRight,\n\t\t\t\t\texplicitHeight - this._paddingTop - this._paddingBottom,\n\t\t\t\t\tminHeight - this._paddingTop - this._paddingBottom,\n\t\t\t\t\tmaxHeight - this._paddingTop - this._paddingBottom, distributedHeight);\n\t\t\t}\n\n\t\t\tif(needsExplicitHeight && this._distributeHeights)\n\t\t\t{\n\t\t\t\t//if we didn't calculate this before, we need to do it now.\n\t\t\t\tdistributedHeight = this.calculateDistributedHeight(items, explicitHeight, minHeight, maxHeight, true);\n\t\t\t}\n\t\t\tvar hasDistributedHeight:Boolean = distributedHeight === distributedHeight; //!isNaN\n\n\t\t\tif(!this._useVirtualLayout)\n\t\t\t{\n\t\t\t\t//handle the percentHeight property from VerticalLayoutData,\n\t\t\t\t//if available.\n\t\t\t\tthis.applyPercentHeights(items, explicitHeight, minHeight, maxHeight);\n\t\t\t}\n\n\t\t\t//this section prepares some variables needed for the following loop\n\t\t\tvar hasFirstGap:Boolean = this._firstGap === this._firstGap; //!isNaN\n\t\t\tvar hasLastGap:Boolean = this._lastGap === this._lastGap; //!isNaN\n\t\t\tvar maxItemWidth:Number = this._useVirtualLayout ? calculatedTypicalItemWidth : 0;\n\t\t\tvar startPositionY:Number = boundsY + this._paddingTop;\n\t\t\tvar positionY:Number = startPositionY;\n\t\t\tvar indexOffset:int = 0;\n\t\t\tvar itemCount:int = items.length;\n\t\t\tvar totalItemCount:int = itemCount;\n\t\t\tvar requestedRowAvailableHeight:Number = 0;\n\t\t\tvar maxRowAvailableHeight:Number = Number.POSITIVE_INFINITY;\n\t\t\tif(this._useVirtualLayout && !this._hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\t//if the layout is virtualized, and the items all have the same\n\t\t\t\t//height, we can make our loops smaller by skipping some items\n\t\t\t\t//at the beginning and end. this improves performance.\n\t\t\t\ttotalItemCount += this._beforeVirtualizedItemCount + this._afterVirtualizedItemCount;\n\t\t\t\tindexOffset = this._beforeVirtualizedItemCount;\n\t\t\t\tpositionY += (this._beforeVirtualizedItemCount * (calculatedTypicalItemHeight + this._gap));\n\t\t\t\tif(hasFirstGap && this._beforeVirtualizedItemCount > 0)\n\t\t\t\t{\n\t\t\t\t\tpositionY = positionY - this._gap + this._firstGap;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar secondToLastIndex:int = totalItemCount - 2;\n\t\t\t//this cache is used to save non-null items in virtual layouts. by\n\t\t\t//using a smaller array, we can improve performance by spending less\n\t\t\t//time in the upcoming loops.\n\t\t\tthis._discoveredItemsCache.length = 0;\n\t\t\tvar discoveredItemsCacheLastIndex:int = 0;\n\n\t\t\t//if there are no items in layout, then we don't want to subtract\n\t\t\t//any gap when calculating the total height, so default to 0.\n\t\t\tvar gap:Number = 0;\n\n\t\t\tvar headerIndicesIndex:int = -1;\n\t\t\tvar nextHeaderIndex:int = -1;\n\t\t\tvar headerCount:int = 0;\n\t\t\tvar stickyHeaderMaxY:Number = Number.POSITIVE_INFINITY;\n\t\t\tif(this._headerIndices && this._stickyHeader)\n\t\t\t{\n\t\t\t\theaderCount = this._headerIndices.length;\n\t\t\t\tif(headerCount > 0)\n\t\t\t\t{\n\t\t\t\t\theaderIndicesIndex = 0;\n\t\t\t\t\tnextHeaderIndex = this._headerIndices[headerIndicesIndex];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//this first loop sets the y position of items, and it calculates\n\t\t\t//the total height of all items\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tif(!this._useVirtualLayout)\n\t\t\t\t{\n\t\t\t\t\tif(this._maxRowCount > 0 && this._maxRowCount == i)\n\t\t\t\t\t{\n\t\t\t\t\t\tmaxRowAvailableHeight = positionY;\n\t\t\t\t\t}\n\t\t\t\t\tif(this._requestedRowCount > 0 && this._requestedRowCount == i)\n\t\t\t\t\t{\n\t\t\t\t\t\trequestedRowAvailableHeight = positionY;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\t//if we're trimming some items at the beginning, we need to\n\t\t\t\t//adjust i to account for the missing items in the array\n\t\t\t\tvar iNormalized:int = i + indexOffset;\n\n\t\t\t\tif(nextHeaderIndex == iNormalized)\n\t\t\t\t{\n\t\t\t\t\t//if the sticky header is enabled, we need to find its index\n\t\t\t\t\t//we look for the first header that is visible at the top of\n\t\t\t\t\t//the view port. the previous one should be sticky.\n\t\t\t\t\tif(positionY < scrollY)\n\t\t\t\t\t{\n\t\t\t\t\t\theaderIndicesIndex++;\n\t\t\t\t\t\tif(headerIndicesIndex < headerCount)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnextHeaderIndex = this._headerIndices[headerIndicesIndex];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\theaderIndicesIndex--;\n\t\t\t\t\t\tif(headerIndicesIndex >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//this is the index of the \"sticky\" header, but we\n\t\t\t\t\t\t\t//need to save it for later.\n\t\t\t\t\t\t\tnextHeaderIndex = this._headerIndices[headerIndicesIndex];\n\t\t\t\t\t\t\tstickyHeaderMaxY = positionY;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//pick the gap that will follow this item. the first and second\n\t\t\t\t//to last items may have different gaps.\n\t\t\t\tgap = this._gap;\n\t\t\t\tif(hasFirstGap && iNormalized == 0)\n\t\t\t\t{\n\t\t\t\t\tgap = this._firstGap;\n\t\t\t\t}\n\t\t\t\telse if(hasLastGap && iNormalized > 0 && iNormalized == secondToLastIndex)\n\t\t\t\t{\n\t\t\t\t\tgap = this._lastGap;\n\t\t\t\t}\n\n\t\t\t\tif(this._useVirtualLayout && this._hasVariableItemDimensions)\n\t\t\t\t{\n\t\t\t\t\tvar cachedHeight:Number = this._virtualCache[iNormalized];\n\t\t\t\t}\n\t\t\t\tif(this._useVirtualLayout && !item)\n\t\t\t\t{\n\t\t\t\t\t//the item is null, and the layout is virtualized, so we\n\t\t\t\t\t//need to estimate the height of the item.\n\n\t\t\t\t\tif(!this._hasVariableItemDimensions ||\n\t\t\t\t\t\tcachedHeight !== cachedHeight) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\t//if all items must have the same height, we will\n\t\t\t\t\t\t//use the height of the typical item (calculatedTypicalItemHeight).\n\n\t\t\t\t\t\t//if items may have different heights, we first check\n\t\t\t\t\t\t//the cache for a height value. if there isn't one, then\n\t\t\t\t\t\t//we'll use calculatedTypicalItemHeight as a fallback.\n\t\t\t\t\t\tpositionY += calculatedTypicalItemHeight + gap;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//if we have variable item heights, we should use a\n\t\t\t\t\t\t//cached height when there's one available. it will be\n\t\t\t\t\t\t//more accurate than the typical item's height.\n\t\t\t\t\t\tpositionY += cachedHeight + gap;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//we get here if the item isn't null. it is never null if\n\t\t\t\t\t//the layout isn't virtualized.\n\t\t\t\t\tvar layoutItem:ILayoutDisplayObject = item as ILayoutDisplayObject;\n\t\t\t\t\tif(layoutItem !== null && !layoutItem.includeInLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tvar pivotY:Number = item.pivotY;\n\t\t\t\t\tif(pivotY != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tpivotY *= item.scaleY;\n\t\t\t\t\t}\n\t\t\t\t\titem.y = pivotY + positionY;\n\t\t\t\t\tvar itemWidth:Number = item.width;\n\t\t\t\t\tvar itemHeight:Number;\n\t\t\t\t\tif(hasDistributedHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\titem.height = itemHeight = distributedHeight;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\titemHeight = item.height;\n\t\t\t\t\t}\n\t\t\t\t\tif(this._useVirtualLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._hasVariableItemDimensions)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(itemHeight != cachedHeight)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//update the cache if needed. this will notify\n\t\t\t\t\t\t\t\t//the container that the virtualized layout has\n\t\t\t\t\t\t\t\t//changed, and it the view port may need to be\n\t\t\t\t\t\t\t\t//re-measured.\n\t\t\t\t\t\t\t\tthis._virtualCache[iNormalized] = itemHeight;\n\n\t\t\t\t\t\t\t\t//attempt to adjust the scroll position so that\n\t\t\t\t\t\t\t\t//it looks like we're scrolling smoothly after\n\t\t\t\t\t\t\t\t//this item resizes.\n\t\t\t\t\t\t\t\tif(positionY < scrollY &&\n\t\t\t\t\t\t\t\t\tcachedHeight !== cachedHeight && //isNaN\n\t\t\t\t\t\t\t\t\titemHeight != calculatedTypicalItemHeight)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tthis.dispatchEventWith(Event.SCROLL, false, new Point(0, itemHeight - calculatedTypicalItemHeight));\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(calculatedTypicalItemHeight >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if all items must have the same height, we will\n\t\t\t\t\t\t\t//use the height of the typical item (calculatedTypicalItemHeight).\n\t\t\t\t\t\t\titemHeight = calculatedTypicalItemHeight;\n\t\t\t\t\t\t\tif(item !== this._typicalItem || item.height != itemHeight)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//ensure that the typical item's height is not\n\t\t\t\t\t\t\t\t//set explicitly so that it can resize\n\t\t\t\t\t\t\t\titem.height = itemHeight;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpositionY += itemHeight + gap;\n\t\t\t\t\t//we compare with > instead of Math.max() because the rest\n\t\t\t\t\t//arguments on Math.max() cause extra garbage collection and\n\t\t\t\t\t//hurt performance\n\t\t\t\t\tif(itemWidth > maxItemWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\t//we need to know the maximum width of the items in the\n\t\t\t\t\t\t//case where the width of the view port needs to be\n\t\t\t\t\t\t//calculated by the layout.\n\t\t\t\t\t\tmaxItemWidth = itemWidth;\n\t\t\t\t\t}\n\t\t\t\t\tif(this._useVirtualLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._discoveredItemsCache[discoveredItemsCacheLastIndex] = item;\n\t\t\t\t\t\tdiscoveredItemsCacheLastIndex++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._useVirtualLayout && !this._hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\t//finish the final calculation of the y position so that it can\n\t\t\t\t//be used for the total height of all items\n\t\t\t\tpositionY += (this._afterVirtualizedItemCount * (calculatedTypicalItemHeight + this._gap));\n\t\t\t\tif(hasLastGap && this._afterVirtualizedItemCount > 0)\n\t\t\t\t{\n\t\t\t\t\tpositionY = positionY - this._gap + this._lastGap;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(nextHeaderIndex >= 0)\n\t\t\t{\n\t\t\t\t//position the \"sticky\" header at the top of the view port.\n\t\t\t\t//it should not cover the following header.\n\t\t\t\tvar header:DisplayObject = items[nextHeaderIndex];\n\t\t\t\tthis.positionStickyHeader(header, scrollY, stickyHeaderMaxY);\n\t\t\t}\n\t\t\tif(!this._useVirtualLayout && this._requestedRowCount > itemCount)\n\t\t\t{\n\t\t\t\tif(itemCount > 0)\n\t\t\t\t{\n\t\t\t\t\trequestedRowAvailableHeight = this._requestedRowCount * positionY / itemCount;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\trequestedRowAvailableHeight = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//this array will contain all items that are not null. see the\n\t\t\t//comment above where the discoveredItemsCache is initialized for\n\t\t\t//details about why this is important.\n\t\t\tvar discoveredItems:Vector.<DisplayObject> = this._useVirtualLayout ? this._discoveredItemsCache : items;\n\t\t\tvar discoveredItemCount:int = discoveredItems.length;\n\n\t\t\tvar totalWidth:Number = maxItemWidth + this._paddingLeft + this._paddingRight;\n\t\t\t//the available width is the width of the viewport. if the explicit\n\t\t\t//width is NaN, we need to calculate the viewport width ourselves\n\t\t\t//based on the total width of all items.\n\t\t\tvar availableWidth:Number = explicitWidth;\n\t\t\tif(availableWidth !== availableWidth) //isNaN\n\t\t\t{\n\t\t\t\tavailableWidth = totalWidth;\n\t\t\t\tif(availableWidth < minWidth)\n\t\t\t\t{\n\t\t\t\t\tavailableWidth = minWidth;\n\t\t\t\t}\n\t\t\t\telse if(availableWidth > maxWidth)\n\t\t\t\t{\n\t\t\t\t\tavailableWidth = maxWidth;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//this is the total height of all items\n\t\t\tvar totalHeight:Number = positionY - gap + this._paddingBottom - boundsY;\n\t\t\t//the available height is the height of the viewport. if the explicit\n\t\t\t//height is NaN, we need to calculate the viewport height ourselves\n\t\t\t//based on the total height of all items.\n\t\t\tvar availableHeight:Number = explicitHeight;\n\t\t\tif(availableHeight !== availableHeight) //isNaN\n\t\t\t{\n\t\t\t\tavailableHeight = totalHeight;\n\t\t\t\tif(this._requestedRowCount > 0)\n\t\t\t\t{\n\t\t\t\t\tif(this._useVirtualLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tavailableHeight = this._requestedRowCount * (calculatedTypicalItemHeight + this._gap) - this._gap + this._paddingTop + this._paddingBottom;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tavailableHeight = requestedRowAvailableHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tavailableHeight = totalHeight;\n\t\t\t\t\tif(this._maxRowCount > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._useVirtualLayout)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmaxRowAvailableHeight = this._maxRowCount * (calculatedTypicalItemHeight + this._gap) - this._gap + this._paddingTop + this._paddingBottom;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(maxRowAvailableHeight < availableHeight)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tavailableHeight = maxRowAvailableHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(availableHeight < minHeight)\n\t\t\t\t{\n\t\t\t\t\tavailableHeight = minHeight;\n\t\t\t\t}\n\t\t\t\telse if(availableHeight > maxHeight)\n\t\t\t\t{\n\t\t\t\t\tavailableHeight = maxHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//in this section, we handle vertical alignment. items will be\n\t\t\t//aligned vertically if the total height of all items is less than\n\t\t\t//the available height of the view port.\n\t\t\tif(totalHeight < availableHeight)\n\t\t\t{\n\t\t\t\tvar verticalAlignOffsetY:Number = 0;\n\t\t\t\tif(this._verticalAlign == VerticalAlign.BOTTOM)\n\t\t\t\t{\n\t\t\t\t\tverticalAlignOffsetY = availableHeight - totalHeight;\n\t\t\t\t}\n\t\t\t\telse if(this._verticalAlign == VerticalAlign.MIDDLE)\n\t\t\t\t{\n\t\t\t\t\tverticalAlignOffsetY = Math.round((availableHeight - totalHeight) / 2);\n\t\t\t\t}\n\t\t\t\tif(verticalAlignOffsetY != 0)\n\t\t\t\t{\n\t\t\t\t\tfor(i = 0; i < discoveredItemCount; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\titem = discoveredItems[i];\n\t\t\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\titem.y += verticalAlignOffsetY;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar availableWidthMinusPadding:Number = availableWidth - this._paddingLeft - this._paddingRight;\n\t\t\tfor(i = 0; i < discoveredItemCount; i++)\n\t\t\t{\n\t\t\t\titem = discoveredItems[i];\n\t\t\t\tlayoutItem = item as ILayoutDisplayObject;\n\t\t\t\tif(layoutItem !== null && !layoutItem.includeInLayout)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tvar pivotX:Number = item.pivotX;\n\t\t\t\tif(pivotX != 0)\n\t\t\t\t{\n\t\t\t\t\tpivotX *= item.scaleX;\n\t\t\t\t}\n\n\t\t\t\t//in this section, we handle horizontal alignment and percent\n\t\t\t\t//width from VerticalLayoutData\n\t\t\t\tif(this._horizontalAlign == HorizontalAlign.JUSTIFY)\n\t\t\t\t{\n\t\t\t\t\t//if we justify items horizontally, we can skip percent width\n\t\t\t\t\titem.x = pivotX + boundsX + this._paddingLeft;\n\t\t\t\t\titem.width = availableWidthMinusPadding;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(layoutItem !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar layoutData:VerticalLayoutData = layoutItem.layoutData as VerticalLayoutData;\n\t\t\t\t\t\tif(layoutData !== null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//in this section, we handle percentage width if\n\t\t\t\t\t\t\t//VerticalLayoutData is available.\n\t\t\t\t\t\t\tvar percentWidth:Number = layoutData.percentWidth;\n\t\t\t\t\t\t\tif(percentWidth === percentWidth) //!isNaN\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(percentWidth < 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tpercentWidth = 0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(percentWidth > 100)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tpercentWidth = 100;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\titemWidth = percentWidth * availableWidthMinusPadding / 100;\n\t\t\t\t\t\t\t\tif(item is IFeathersControl)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar feathersItem:IFeathersControl = IFeathersControl(item);\n\t\t\t\t\t\t\t\t\tvar itemMinWidth:Number = feathersItem.explicitMinWidth;\n\t\t\t\t\t\t\t\t\t//we try to respect the minWidth, but not\n\t\t\t\t\t\t\t\t\t//when it's larger than 100%\n\t\t\t\t\t\t\t\t\tif(itemMinWidth > availableWidthMinusPadding)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\titemMinWidth = availableWidthMinusPadding;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(itemWidth < itemMinWidth)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\titemWidth = itemMinWidth;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar itemMaxWidth:Number = feathersItem.explicitMaxWidth;\n\t\t\t\t\t\t\t\t\t\tif(itemWidth > itemMaxWidth)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\titemWidth = itemMaxWidth;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\titem.width = itemWidth;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//handle all other horizontal alignment values (we handled\n\t\t\t\t\t//justify already). the x position of all items is set.\n\t\t\t\t\tvar horizontalAlignWidth:Number = availableWidth;\n\t\t\t\t\tif(totalWidth > horizontalAlignWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\thorizontalAlignWidth = totalWidth;\n\t\t\t\t\t}\n\t\t\t\t\tswitch(this._horizontalAlign)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase HorizontalAlign.RIGHT:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.x = pivotX + boundsX + horizontalAlignWidth - this._paddingRight - item.width;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase HorizontalAlign.CENTER:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//round to the nearest pixel when dividing by 2 to\n\t\t\t\t\t\t\t//align in the center\n\t\t\t\t\t\t\titem.x = pivotX + boundsX + this._paddingLeft + Math.round((horizontalAlignWidth - this._paddingLeft - this._paddingRight - item.width) / 2);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdefault: //left\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.x = pivotX + boundsX + this._paddingLeft;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//we don't want to keep a reference to any of the items, so clear\n\t\t\t//this cache\n\t\t\tthis._discoveredItemsCache.length = 0;\n\n\t\t\t//finally, we want to calculate the result so that the container\n\t\t\t//can use it to adjust its viewport and determine the minimum and\n\t\t\t//maximum scroll positions (if needed)\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new LayoutBoundsResult();\n\t\t\t}\n\t\t\tresult.contentX = 0;\n\t\t\tresult.contentWidth = this._horizontalAlign == HorizontalAlign.JUSTIFY ? availableWidth : totalWidth;\n\t\t\tresult.contentY = 0;\n\t\t\tresult.contentHeight = totalHeight;\n\t\t\tresult.viewPortWidth = availableWidth;\n\t\t\tresult.viewPortHeight = availableHeight;\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function measureViewPort(itemCount:int, viewPortBounds:ViewPortBounds = null, result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\t\t\tif(!this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"measureViewPort() may be called only if useVirtualLayout is true.\");\n\t\t\t}\n\n\t\t\tvar explicitWidth:Number = viewPortBounds ? viewPortBounds.explicitWidth : NaN;\n\t\t\tvar explicitHeight:Number = viewPortBounds ? viewPortBounds.explicitHeight : NaN;\n\t\t\tvar needsWidth:Boolean = explicitWidth !== explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = explicitHeight !== explicitHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight)\n\t\t\t{\n\t\t\t\tresult.x = explicitWidth;\n\t\t\t\tresult.y = explicitHeight;\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tvar minWidth:Number = viewPortBounds ? viewPortBounds.minWidth : 0;\n\t\t\tvar minHeight:Number = viewPortBounds ? viewPortBounds.minHeight : 0;\n\t\t\tvar maxWidth:Number = viewPortBounds ? viewPortBounds.maxWidth : Number.POSITIVE_INFINITY;\n\t\t\tvar maxHeight:Number = viewPortBounds ? viewPortBounds.maxHeight : Number.POSITIVE_INFINITY;\n\n\t\t\tthis.prepareTypicalItem(explicitWidth - this._paddingLeft - this._paddingRight);\n\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\n\t\t\tvar hasFirstGap:Boolean = this._firstGap === this._firstGap; //!isNaN\n\t\t\tvar hasLastGap:Boolean = this._lastGap === this._lastGap; //!isNaN\n\t\t\tvar positionY:Number;\n\t\t\tif(this._distributeHeights)\n\t\t\t{\n\t\t\t\tpositionY = (calculatedTypicalItemHeight + this._gap) * itemCount;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpositionY = 0;\n\t\t\t\tvar maxItemWidth:Number = calculatedTypicalItemWidth;\n\t\t\t\tif(!this._hasVariableItemDimensions)\n\t\t\t\t{\n\t\t\t\t\tpositionY += ((calculatedTypicalItemHeight + this._gap) * itemCount);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar cachedHeight:Number = this._virtualCache[i];\n\t\t\t\t\t\tif(cachedHeight !== cachedHeight) //isNaN\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpositionY += calculatedTypicalItemHeight + this._gap;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpositionY += cachedHeight + this._gap;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tpositionY -= this._gap;\n\t\t\tif(hasFirstGap && itemCount > 1)\n\t\t\t{\n\t\t\t\tpositionY = positionY - this._gap + this._firstGap;\n\t\t\t}\n\t\t\tif(hasLastGap && itemCount > 2)\n\t\t\t{\n\t\t\t\tpositionY = positionY - this._gap + this._lastGap;\n\t\t\t}\n\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tvar resultWidth:Number = maxItemWidth + this._paddingLeft + this._paddingRight;\n\t\t\t\tif(resultWidth < minWidth)\n\t\t\t\t{\n\t\t\t\t\tresultWidth = minWidth;\n\t\t\t\t}\n\t\t\t\telse if(resultWidth > maxWidth)\n\t\t\t\t{\n\t\t\t\t\tresultWidth = maxWidth;\n\t\t\t\t}\n\t\t\t\tresult.x = resultWidth;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult.x = explicitWidth;\n\t\t\t}\n\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tif(this._requestedRowCount > 0)\n\t\t\t\t{\n\t\t\t\t\tvar resultHeight:Number = (calculatedTypicalItemHeight + this._gap) * this._requestedRowCount - this._gap;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tresultHeight = positionY;\n\t\t\t\t\tif(this._maxRowCount > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar maxRowResultHeight:Number = (calculatedTypicalItemHeight + this._gap) * this._maxRowCount - this._gap;\n\t\t\t\t\t\tif(maxRowResultHeight < resultHeight)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tresultHeight = maxRowResultHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tresultHeight += this._paddingTop + this._paddingBottom;\n\t\t\t\tif(resultHeight < minHeight)\n\t\t\t\t{\n\t\t\t\t\tresultHeight = minHeight;\n\t\t\t\t}\n\t\t\t\telse if(resultHeight > maxHeight)\n\t\t\t\t{\n\t\t\t\t\tresultHeight = maxHeight;\n\t\t\t\t}\n\t\t\t\tresult.y = resultHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult.y = explicitHeight;\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getVisibleIndicesAtScrollPosition(scrollX:Number, scrollY:Number, width:Number, height:Number, itemCount:int, result:Vector.<int> = null):Vector.<int>\n\t\t{\n\t\t\tif(result)\n\t\t\t{\n\t\t\t\tresult.length = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult = new <int>[];\n\t\t\t}\n\t\t\tif(!this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"getVisibleIndicesAtScrollPosition() may be called only if useVirtualLayout is true.\");\n\t\t\t}\n\n\t\t\tthis.prepareTypicalItem(width - this._paddingLeft - this._paddingRight);\n\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\n\t\t\tvar hasFirstGap:Boolean = this._firstGap === this._firstGap; //!isNaN\n\t\t\tvar hasLastGap:Boolean = this._lastGap === this._lastGap; //!isNaN\n\t\t\tvar resultLastIndex:int = 0;\n\t\t\t//we add one extra here because the first item renderer in view may\n\t\t\t//be partially obscured, which would reveal an extra item renderer.\n\t\t\tvar maxVisibleTypicalItemCount:int = Math.ceil(height / (calculatedTypicalItemHeight + this._gap)) + 1;\n\t\t\tif(!this._hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\t//this case can be optimized because we know that every item has\n\t\t\t\t//the same height\n\t\t\t\tvar totalItemHeight:Number = itemCount * (calculatedTypicalItemHeight + this._gap) - this._gap;\n\t\t\t\tif(hasFirstGap && itemCount > 1)\n\t\t\t\t{\n\t\t\t\t\ttotalItemHeight = totalItemHeight - this._gap + this._firstGap;\n\t\t\t\t}\n\t\t\t\tif(hasLastGap && itemCount > 2)\n\t\t\t\t{\n\t\t\t\t\ttotalItemHeight = totalItemHeight - this._gap + this._lastGap;\n\t\t\t\t}\n\t\t\t\tvar indexOffset:int = 0;\n\t\t\t\tif(totalItemHeight < height)\n\t\t\t\t{\n\t\t\t\t\tif(this._verticalAlign == VerticalAlign.BOTTOM)\n\t\t\t\t\t{\n\t\t\t\t\t\tindexOffset = Math.ceil((height - totalItemHeight) / (calculatedTypicalItemHeight + this._gap));\n\t\t\t\t\t}\n\t\t\t\t\telse if(this._verticalAlign == VerticalAlign.MIDDLE)\n\t\t\t\t\t{\n\t\t\t\t\t\tindexOffset = Math.ceil(((height - totalItemHeight) / (calculatedTypicalItemHeight + this._gap)) / 2);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar minimum:int = (scrollY - this._paddingTop) / (calculatedTypicalItemHeight + this._gap);\n\t\t\t\tif(minimum < 0)\n\t\t\t\t{\n\t\t\t\t\tminimum = 0;\n\t\t\t\t}\n\t\t\t\tminimum -= indexOffset;\n\t\t\t\t//if we're scrolling beyond the final item, we should keep the\n\t\t\t\t//indices consistent so that items aren't destroyed and\n\t\t\t\t//recreated unnecessarily\n\t\t\t\tvar maximum:int = minimum + maxVisibleTypicalItemCount;\n\t\t\t\tif(maximum >= itemCount)\n\t\t\t\t{\n\t\t\t\t\tmaximum = itemCount - 1;\n\t\t\t\t}\n\t\t\t\tminimum = maximum - maxVisibleTypicalItemCount;\n\t\t\t\tif(minimum < 0)\n\t\t\t\t{\n\t\t\t\t\tminimum = 0;\n\t\t\t\t}\n\t\t\t\tfor(var i:int = minimum; i <= maximum; i++)\n\t\t\t\t{\n\t\t\t\t\tif(i >= 0 && i < itemCount)\n\t\t\t\t\t{\n\t\t\t\t\t\tresult[resultLastIndex] = i;\n\t\t\t\t\t}\n\t\t\t\t\telse if(i < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tresult[resultLastIndex] = itemCount + i;\n\t\t\t\t\t}\n\t\t\t\t\telse if(i >= itemCount)\n\t\t\t\t\t{\n\t\t\t\t\t\tresult[resultLastIndex] = i - itemCount;\n\t\t\t\t\t}\n\t\t\t\t\tresultLastIndex++;\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tvar headerIndicesIndex:int = -1;\n\t\t\tvar nextHeaderIndex:int = -1;\n\t\t\tvar headerCount:int = 0;\n\t\t\tif(this._headerIndices && this._stickyHeader)\n\t\t\t{\n\t\t\t\theaderCount = this._headerIndices.length;\n\t\t\t\tif(headerCount > 0)\n\t\t\t\t{\n\t\t\t\t\theaderIndicesIndex = 0;\n\t\t\t\t\tnextHeaderIndex = this._headerIndices[headerIndicesIndex];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar secondToLastIndex:int = itemCount - 2;\n\t\t\tvar maxPositionY:Number = scrollY + height;\n\t\t\tvar startPositionY:Number = this._paddingTop;\n\t\t\tvar foundSticky:Boolean = false;\n\t\t\tvar positionY:Number = startPositionY;\n\t\t\tfor(i = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tif(nextHeaderIndex == i)\n\t\t\t\t{\n\t\t\t\t\tif(positionY < scrollY)\n\t\t\t\t\t{\n\t\t\t\t\t\theaderIndicesIndex++;\n\t\t\t\t\t\tif(headerIndicesIndex < headerCount)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnextHeaderIndex = this._headerIndices[headerIndicesIndex];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\theaderIndicesIndex--;\n\t\t\t\t\t\tif(headerIndicesIndex >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//this is the index of the \"sticky\" header\n\t\t\t\t\t\t\tnextHeaderIndex = this._headerIndices[headerIndicesIndex];\n\t\t\t\t\t\t\tfoundSticky = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar gap:Number = this._gap;\n\t\t\t\tif(hasFirstGap && i == 0)\n\t\t\t\t{\n\t\t\t\t\tgap = this._firstGap;\n\t\t\t\t}\n\t\t\t\telse if(hasLastGap && i > 0 && i == secondToLastIndex)\n\t\t\t\t{\n\t\t\t\t\tgap = this._lastGap;\n\t\t\t\t}\n\t\t\t\tvar cachedHeight:Number = this._virtualCache[i];\n\t\t\t\tif(cachedHeight !== cachedHeight) //isNaN\n\t\t\t\t{\n\t\t\t\t\tvar itemHeight:Number = calculatedTypicalItemHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\titemHeight = cachedHeight;\n\t\t\t\t}\n\t\t\t\tvar oldPositionY:Number = positionY;\n\t\t\t\tpositionY += itemHeight + gap;\n\t\t\t\tif(positionY > scrollY && oldPositionY < maxPositionY)\n\t\t\t\t{\n\t\t\t\t\tresult[resultLastIndex] = i;\n\t\t\t\t\tresultLastIndex++;\n\t\t\t\t}\n\n\t\t\t\tif(positionY >= maxPositionY)\n\t\t\t\t{\n\t\t\t\t\tif(!foundSticky)\n\t\t\t\t\t{\n\t\t\t\t\t\theaderIndicesIndex--;\n\t\t\t\t\t\tif(headerIndicesIndex >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//this is the index of the \"sticky\" header\n\t\t\t\t\t\t\tnextHeaderIndex = this._headerIndices[headerIndicesIndex];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(nextHeaderIndex >= 0 && result.indexOf(nextHeaderIndex) < 0)\n\t\t\t{\n\t\t\t\tvar addedStickyHeader:Boolean = false;\n\t\t\t\tfor(i = 0; i < resultLastIndex; i++)\n\t\t\t\t{\n\t\t\t\t\tif(nextHeaderIndex <= result[i])\n\t\t\t\t\t{\n\t\t\t\t\t\tresult.insertAt(i, nextHeaderIndex);\n\t\t\t\t\t\taddedStickyHeader = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!addedStickyHeader)\n\t\t\t\t{\n\t\t\t\t\tresult[resultLastIndex] = nextHeaderIndex;\n\t\t\t\t}\n\t\t\t\tresultLastIndex++;\n\t\t\t}\n\n\t\t\t//similar to above, in order to avoid costly destruction and\n\t\t\t//creation of item renderers, we're going to fill in some extra\n\t\t\t//indices\n\t\t\tvar resultLength:int = result.length;\n\t\t\tvar visibleItemCountDifference:int = maxVisibleTypicalItemCount - resultLength;\n\t\t\tif(visibleItemCountDifference > 0 && resultLength > 0)\n\t\t\t{\n\t\t\t\t//add extra items before the first index\n\t\t\t\tvar firstExistingIndex:int = result[0];\n\t\t\t\tvar lastIndexToAdd:int = firstExistingIndex - visibleItemCountDifference;\n\t\t\t\tif(lastIndexToAdd < 0)\n\t\t\t\t{\n\t\t\t\t\tlastIndexToAdd = 0;\n\t\t\t\t}\n\t\t\t\tfor(i = firstExistingIndex - 1; i >= lastIndexToAdd; i--)\n\t\t\t\t{\n\t\t\t\t\tif(i == nextHeaderIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tresult.insertAt(0, i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tresultLength = result.length;\n\t\t\tvisibleItemCountDifference = maxVisibleTypicalItemCount - resultLength;\n\t\t\tresultLastIndex = resultLength;\n\t\t\tif(visibleItemCountDifference > 0)\n\t\t\t{\n\t\t\t\t//add extra items after the last index\n\t\t\t\tvar startIndex:int = (resultLength > 0) ? (result[resultLength - 1] + 1) : 0;\n\t\t\t\tvar endIndex:int = startIndex + visibleItemCountDifference;\n\t\t\t\tif(endIndex > itemCount)\n\t\t\t\t{\n\t\t\t\t\tendIndex = itemCount;\n\t\t\t\t}\n\t\t\t\tfor(i = startIndex; i < endIndex; i++)\n\t\t\t\t{\n\t\t\t\t\tif(i == nextHeaderIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tresult[resultLastIndex] = i;\n\t\t\t\t\tresultLastIndex++;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getNearestScrollPositionForIndex(index:int, scrollX:Number, scrollY:Number, items:Vector.<DisplayObject>,\n\t\t\tx:Number, y:Number, width:Number, height:Number, result:Point = null):Point\n\t\t{\n\t\t\tvar point:Point = Pool.getPoint();\n\t\t\tthis.calculateScrollRangeOfIndex(index, items, x, y, width, height, point);\n\t\t\tvar minScrollY:Number = point.x;\n\t\t\tvar maxScrollY:Number = point.y;\n\t\t\tvar scrollRange:Number = maxScrollY - minScrollY;\n\t\t\tPool.putPoint(point);\n\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tif(this._hasVariableItemDimensions)\n\t\t\t\t{\n\t\t\t\t\tvar itemHeight:Number = this._virtualCache[index];\n\t\t\t\t\tif(itemHeight !== itemHeight) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\titemHeight = this._typicalItem.height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\titemHeight = this._typicalItem.height;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\titemHeight = items[index].height;\n\t\t\t}\n\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\t\t\tresult.x = 0;\n\n\t\t\tvar bottomPosition:Number = maxScrollY - (scrollRange - itemHeight);\n\t\t\tif(scrollY >= bottomPosition && scrollY <= maxScrollY)\n\t\t\t{\n\t\t\t\t//keep the current scroll position because the item is already\n\t\t\t\t//fully visible\n\t\t\t\tresult.y = scrollY;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar topDifference:Number = Math.abs(maxScrollY - scrollY);\n\t\t\t\tvar bottomDifference:Number = Math.abs(bottomPosition - scrollY);\n\t\t\t\tif(bottomDifference < topDifference)\n\t\t\t\t{\n\t\t\t\t\tresult.y = bottomPosition;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tresult.y = maxScrollY;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function calculateNavigationDestination(items:Vector.<DisplayObject>, index:int, keyCode:uint, bounds:LayoutBoundsResult):int\n\t\t{\n\t\t\tvar itemArrayCount:int = items.length;\n\t\t\tvar itemCount:int = itemArrayCount + this._beforeVirtualizedItemCount + this._afterVirtualizedItemCount;\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\t//if the layout is virtualized, we'll need the dimensions of the\n\t\t\t\t//typical item so that we have fallback values when an item is null\n\t\t\t\tthis.prepareTypicalItem(bounds.viewPortWidth - this._paddingLeft - this._paddingRight);\n\t\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\t\t\t}\n\n\t\t\tvar backwards:Boolean = false;\n\t\t\tvar result:int = index;\n\t\t\tif(keyCode == Keyboard.HOME)\n\t\t\t{\n\t\t\t\tbackwards = true;\n\t\t\t\tif(itemCount > 0)\n\t\t\t\t{\n\t\t\t\t\tresult = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.END)\n\t\t\t{\n\t\t\t\tresult = itemCount - 1;\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.PAGE_UP)\n\t\t\t{\n\t\t\t\tbackwards = true;\n\t\t\t\tvar indexOffset:int = 0;\n\t\t\t\tif(this._useVirtualLayout && this._hasVariableItemDimensions)\n\t\t\t\t{\n\t\t\t\t\tindexOffset = -this._beforeVirtualizedItemCount;\n\t\t\t\t}\n\t\t\t\tvar yPosition:Number = 0;\n\t\t\t\tfor(var i:int = index; i >= 0; i--)\n\t\t\t\t{\n\t\t\t\t\tvar iNormalized:int = i + indexOffset;\n\t\t\t\t\tif(this._useVirtualLayout && this._hasVariableItemDimensions)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar cachedHeight:Number = this._virtualCache[i];\n\t\t\t\t\t}\n\t\t\t\t\tif(iNormalized < 0 || iNormalized >= itemArrayCount)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(cachedHeight === cachedHeight) //!isNaN\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tyPosition += cachedHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tyPosition += calculatedTypicalItemHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvar item:DisplayObject = items[iNormalized];\n\t\t\t\t\t\tif(item === null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(cachedHeight === cachedHeight) //!isNaN\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tyPosition += cachedHeight;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tyPosition += calculatedTypicalItemHeight;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tyPosition += item.height;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(yPosition > bounds.viewPortHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tyPosition += this._gap;\n\t\t\t\t\tresult = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.PAGE_DOWN)\n\t\t\t{\n\t\t\t\tyPosition = 0;\n\t\t\t\tindexOffset = 0;\n\t\t\t\tif(this._useVirtualLayout && this._hasVariableItemDimensions)\n\t\t\t\t{\n\t\t\t\t\tindexOffset = -this._beforeVirtualizedItemCount;\n\t\t\t\t}\n\t\t\t\tfor(i = index; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\tiNormalized = i + indexOffset;\n\t\t\t\t\tif(this._useVirtualLayout && this._hasVariableItemDimensions)\n\t\t\t\t\t{\n\t\t\t\t\t\tcachedHeight = this._virtualCache[i];\n\t\t\t\t\t}\n\t\t\t\t\tif(iNormalized < 0 || iNormalized >= itemArrayCount)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(cachedHeight === cachedHeight) //!isNaN\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tyPosition += cachedHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tyPosition += calculatedTypicalItemHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\titem = items[iNormalized];\n\t\t\t\t\t\tif(item === null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(cachedHeight === cachedHeight) //!isNaN\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tyPosition += cachedHeight;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tyPosition += calculatedTypicalItemHeight;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tyPosition += item.height;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(yPosition > bounds.viewPortHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tyPosition += this._gap;\n\t\t\t\t\tresult = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.UP)\n\t\t\t{\n\t\t\t\tbackwards = true;\n\t\t\t\tresult--;\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.DOWN)\n\t\t\t{\n\t\t\t\tresult++;\n\t\t\t}\n\t\t\tif(result < 0)\n\t\t\t{\n\t\t\t\tresult = 0;\n\t\t\t}\n\t\t\tif(result >= itemCount)\n\t\t\t{\n\t\t\t\tresult = itemCount - 1;\n\t\t\t}\n\t\t\twhile(this._headerIndices !== null && this._headerIndices.indexOf(result) != -1)\n\t\t\t{\n\t\t\t\tif(backwards)\n\t\t\t\t{\n\t\t\t\t\tif(result == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tbackwards = false;\n\t\t\t\t\t\tresult++;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tresult--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tresult++;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getScrollPositionForIndex(index:int, items:Vector.<DisplayObject>, x:Number, y:Number, width:Number, height:Number, result:Point = null):Point\n\t\t{\n\t\t\tvar point:Point = Pool.getPoint();\n\t\t\tthis.calculateScrollRangeOfIndex(index, items, x, y, width, height, point);\n\t\t\tvar minScrollY:Number = point.x;\n\t\t\tvar maxScrollY:Number = point.y;\n\t\t\tvar scrollRange:Number = maxScrollY - minScrollY;\n\t\t\tPool.putPoint(point);\n\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tif(this._hasVariableItemDimensions)\n\t\t\t\t{\n\t\t\t\t\tvar itemHeight:Number = this._virtualCache[index];\n\t\t\t\t\tif(itemHeight !== itemHeight) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\titemHeight = this._typicalItem.height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\titemHeight = this._typicalItem.height;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\titemHeight = items[index].height;\n\t\t\t}\n\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\t\t\tresult.x = 0;\n\n\t\t\tvar verticalAlign:String = this._scrollPositionVerticalAlign;\n\t\t\tif(this._headerIndices !== null &&\n\t\t\t\tthis._headerIndices.indexOf(index) != -1)\n\t\t\t{\n\t\t\t\tverticalAlign = this._headerScrollPositionVerticalAlign;\n\t\t\t}\n\t\t\tif(verticalAlign === VerticalAlign.MIDDLE)\n\t\t\t{\n\t\t\t\tmaxScrollY -= Math.round((scrollRange - itemHeight) / 2);\n\t\t\t}\n\t\t\telse if(verticalAlign === VerticalAlign.BOTTOM)\n\t\t\t{\n\t\t\t\tmaxScrollY -= (scrollRange - itemHeight);\n\t\t\t}\n\t\t\tresult.y = maxScrollY;\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function positionDropIndicator(dropIndicator:DisplayObject, index:int,\n\t\t\tx:Number, y:Number, items:Vector.<DisplayObject>, width:Number, height:Number):void\n\t\t{\n\t\t\tvar indexOffset:int = 0;\n\t\t\tvar itemCount:int = items.length;\n\t\t\tvar totalItemCount:int = itemCount;\n\t\t\tif(this._useVirtualLayout && !this._hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\t//if the layout is virtualized, and the items all have the same\n\t\t\t\t//height, we can make our loops smaller by skipping some items\n\t\t\t\t//at the beginning and end. this improves performance.\n\t\t\t\ttotalItemCount += this._beforeVirtualizedItemCount + this._afterVirtualizedItemCount;\n\t\t\t\tindexOffset = this._beforeVirtualizedItemCount;\n\t\t\t}\n\t\t\tvar indexMinusOffset:int = index - indexOffset;\n\n\t\t\tif(dropIndicator is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(dropIndicator).validate();\n\t\t\t}\n\n\t\t\tvar yPosition:Number = 0;\n\t\t\tif(index < totalItemCount)\n\t\t\t{\n\t\t\t\tvar item:DisplayObject = items[indexMinusOffset];\n\t\t\t\tyPosition = item.y - dropIndicator.height / 2;\n\t\t\t\tdropIndicator.x = item.x;\n\t\t\t\tdropIndicator.width = item.width;\n\t\t\t}\n\t\t\telse //after the last item\n\t\t\t{\n\t\t\t\titem = items[indexMinusOffset - 1];\n\t\t\t\tyPosition = item.y + item.height - dropIndicator.height;\n\t\t\t\tdropIndicator.x = item.x;\n\t\t\t\tdropIndicator.width = item.width;\n\t\t\t}\n\t\t\tif(yPosition < 0)\n\t\t\t{\n\t\t\t\tyPosition = 0;\n\t\t\t}\n\t\t\tdropIndicator.y = yPosition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function getDropIndex(x:Number, y:Number, items:Vector.<DisplayObject>,\n\t\t\tboundsX:Number, boundsY:Number, width:Number, height:Number):int\n\t\t{\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthis.prepareTypicalItem(width - this._paddingLeft - this._paddingRight);\n\t\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\t\t\t}\n\t\t\tvar hasFirstGap:Boolean = this._firstGap === this._firstGap; //!isNaN\n\t\t\tvar hasLastGap:Boolean = this._lastGap === this._lastGap; //!isNaN\n\t\t\tvar positionY:Number = boundsY + this._paddingTop;\n\t\t\tvar lastHeight:Number = 0;\n\t\t\tvar gap:Number = this._gap;\n\t\t\tvar indexOffset:int = 0;\n\t\t\tvar itemCount:int = items.length;\n\t\t\tvar totalItemCount:int = itemCount;\n\t\t\tif(this._useVirtualLayout && !this._hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\ttotalItemCount += this._beforeVirtualizedItemCount + this._afterVirtualizedItemCount;\n\t\t\t\tindexOffset = this._beforeVirtualizedItemCount;\n\t\t\t}\n\t\t\tvar secondToLastIndex:int = totalItemCount - 2;\n\t\t\tfor(var i:int = 0; i <= totalItemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:DisplayObject = null;\n\t\t\t\tvar indexMinusOffset:int = i - indexOffset;\n\t\t\t\tif(indexMinusOffset >= 0 && indexMinusOffset < itemCount)\n\t\t\t\t{\n\t\t\t\t\titem = items[indexMinusOffset];\n\t\t\t\t}\n\t\t\t\tif(hasFirstGap && i == 0)\n\t\t\t\t{\n\t\t\t\t\tgap = this._firstGap;\n\t\t\t\t}\n\t\t\t\telse if(hasLastGap && i > 0 && i == secondToLastIndex)\n\t\t\t\t{\n\t\t\t\t\tgap = this._lastGap;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tgap = this._gap;\n\t\t\t\t}\n\t\t\t\tif(this._useVirtualLayout && this._hasVariableItemDimensions)\n\t\t\t\t{\n\t\t\t\t\tvar cachedHeight:Number = this._virtualCache[i];\n\t\t\t\t}\n\t\t\t\tif(this._useVirtualLayout && !item)\n\t\t\t\t{\n\t\t\t\t\tif(!this._hasVariableItemDimensions ||\n\t\t\t\t\t\tcachedHeight !== cachedHeight) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\tlastHeight = calculatedTypicalItemHeight;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tlastHeight = cachedHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//use the y position of the item to account for vertical\n\t\t\t\t\t//alignment, in case the total height of the items is less\n\t\t\t\t\t//than the height of the container\n\t\t\t\t\tpositionY = item.y;\n\t\t\t\t\tvar itemHeight:Number = item.height;\n\t\t\t\t\tif(this._useVirtualLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._hasVariableItemDimensions)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(itemHeight != cachedHeight)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis._virtualCache[i] = itemHeight;\n\t\t\t\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(calculatedTypicalItemHeight >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titemHeight = calculatedTypicalItemHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlastHeight = itemHeight;\n\t\t\t\t}\n\t\t\t\tif(y < (positionY + (lastHeight / 2)))\n\t\t\t\t{\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t\tpositionY += lastHeight + gap;\n\t\t\t}\n\t\t\treturn totalItemCount;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function validateItems(items:Vector.<DisplayObject>,\n\t\t\texplicitWidth:Number, minWidth:Number, maxWidth:Number,\n\t\t\texplicitHeight:Number, minHeight:Number, maxHeight:Number,\n\t\t\tdistributedHeight:Number):void\n\t\t{\n\t\t\tvar needsHeight:Boolean = explicitHeight !== explicitHeight; //isNaN\n\t\t\tvar containerHeight:Number = explicitHeight;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tcontainerHeight = minHeight;\n\t\t\t}\n\t\t\t//if the alignment is justified, then we want to set the width of\n\t\t\t//each item before validating because setting one dimension may\n\t\t\t//cause the other dimension to change, and that will invalidate the\n\t\t\t//layout if it happens after validation, causing more invalidation\n\t\t\tvar isJustified:Boolean = this._horizontalAlign == HorizontalAlign.JUSTIFY;\n\t\t\tvar itemCount:int = items.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\tif(!item || (item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(isJustified)\n\t\t\t\t{\n\t\t\t\t\t//the alignment is justified, but we don't yet have a width\n\t\t\t\t\t//to use, so we need to ensure that we accurately measure\n\t\t\t\t\t//the items instead of using an old justified width that may\n\t\t\t\t\t//be wrong now!\n\t\t\t\t\titem.width = explicitWidth;\n\t\t\t\t\tif(item is IFeathersControl)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar feathersItem:IFeathersControl = IFeathersControl(item);\n\t\t\t\t\t\tfeathersItem.minWidth = minWidth;\n\t\t\t\t\t\tfeathersItem.maxWidth = maxWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(item is ILayoutDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar layoutItem:ILayoutDisplayObject = ILayoutDisplayObject(item);\n\t\t\t\t\tvar layoutData:VerticalLayoutData = layoutItem.layoutData as VerticalLayoutData;\n\t\t\t\t\tif(layoutData !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar percentWidth:Number = layoutData.percentWidth;\n\t\t\t\t\t\tvar percentHeight:Number = layoutData.percentHeight;\n\t\t\t\t\t\tif(percentWidth === percentWidth) //!isNaN\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(percentWidth < 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tpercentWidth = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(percentWidth > 100)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tpercentWidth = 100;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar itemWidth:Number = explicitWidth * percentWidth / 100;\n\t\t\t\t\t\t\tvar measureItem:IMeasureDisplayObject = IMeasureDisplayObject(item);\n\t\t\t\t\t\t\t//we use the explicitMinWidth to make an accurate\n\t\t\t\t\t\t\t//measurement, and we'll use the component's\n\t\t\t\t\t\t\t//measured minWidth later, after we validate it.\n\t\t\t\t\t\t\tvar itemExplicitMinWidth:Number = measureItem.explicitMinWidth;\n\t\t\t\t\t\t\tif(measureItem.explicitMinWidth === measureItem.explicitMinWidth && //!isNaN\n\t\t\t\t\t\t\t\titemWidth < itemExplicitMinWidth)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\titemWidth = itemExplicitMinWidth;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(itemWidth > maxWidth)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\titemWidth = maxWidth;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//unlike below, where we set maxHeight, we can set\n\t\t\t\t\t\t\t//the width explicitly here\n\t\t\t\t\t\t\t//in fact, it's required because we need to make\n\t\t\t\t\t\t\t//an accurate measurement of the total view port\n\t\t\t\t\t\t\t//width\n\t\t\t\t\t\t\titem.width = itemWidth;\n\t\t\t\t\t\t\t//if itemWidth is NaN, we need to set a maximum\n\t\t\t\t\t\t\t//width instead. this is important for items where\n\t\t\t\t\t\t\t//the height becomes larger when their width becomes\n\t\t\t\t\t\t\t//smaller (such as word-wrapped text)\n\t\t\t\t\t\t\tif(measureItem.explicitWidth !== measureItem.explicitWidth && //isNaN\n\t\t\t\t\t\t\t\tmeasureItem.maxWidth > maxWidth)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmeasureItem.maxWidth = maxWidth;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(percentHeight === percentHeight) //!isNaN\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar itemHeight:Number = containerHeight * percentHeight / 100;\n\t\t\t\t\t\t\tmeasureItem = IMeasureDisplayObject(item);\n\t\t\t\t\t\t\t//we use the explicitMinHeight to make an accurate\n\t\t\t\t\t\t\t//measurement, and we'll use the component's\n\t\t\t\t\t\t\t//measured minHeight later, after we validate it.\n\t\t\t\t\t\t\tvar itemExplicitMinHeight:Number = measureItem.explicitMinHeight;\n\t\t\t\t\t\t\tif(measureItem.explicitMinHeight === measureItem.explicitMinHeight && //!isNaN\n\t\t\t\t\t\t\t\titemHeight < itemExplicitMinHeight)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\titemHeight = itemExplicitMinHeight;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//validating this component may be expensive if we\n\t\t\t\t\t\t\t//don't limit the height! we want to ensure that a\n\t\t\t\t\t\t\t//component like a vertical list with many item\n\t\t\t\t\t\t\t//renderers doesn't completely bypass layout\n\t\t\t\t\t\t\t//virtualization, so we limit the height to the\n\t\t\t\t\t\t\t//maximum possible value if it were the only item in\n\t\t\t\t\t\t\t//the layout.\n\t\t\t\t\t\t\t//this doesn't need to be perfectly accurate because\n\t\t\t\t\t\t\t//it's just a maximum\n\t\t\t\t\t\t\tmeasureItem.maxHeight = itemHeight;\n\t\t\t\t\t\t\t//we also need to clear the explicit height because,\n\t\t\t\t\t\t\t//for many components, it will affect the minHeight\n\t\t\t\t\t\t\t//which is used in the final calculation\n\t\t\t\t\t\t\titem.height = NaN;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this._distributeHeights)\n\t\t\t\t{\n\t\t\t\t\titem.height = distributedHeight;\n\t\t\t\t}\n\t\t\t\tif(item is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(item).validate();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function prepareTypicalItem(justifyWidth:Number):void\n\t\t{\n\t\t\tif(!this._typicalItem)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar hasSetWidth:Boolean = false;\n\t\t\tif(this._horizontalAlign == HorizontalAlign.JUSTIFY &&\n\t\t\t\tjustifyWidth === justifyWidth) //!isNaN\n\t\t\t{\n\t\t\t\thasSetWidth = true;\n\t\t\t\tthis._typicalItem.width = justifyWidth;\n\t\t\t}\n\t\t\telse if(this._typicalItem is ILayoutDisplayObject)\n\t\t\t{\n\t\t\t\tvar layoutItem:ILayoutDisplayObject = ILayoutDisplayObject(this._typicalItem);\n\t\t\t\tvar layoutData:VerticalLayoutData = layoutItem.layoutData as VerticalLayoutData;\n\t\t\t\tif(layoutData !== null)\n\t\t\t\t{\n\t\t\t\t\tvar percentWidth:Number = layoutData.percentWidth;\n\t\t\t\t\tif(percentWidth === percentWidth) //!isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\tif(percentWidth < 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpercentWidth = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(percentWidth > 100)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpercentWidth = 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\thasSetWidth = true;\n\t\t\t\t\t\tthis._typicalItem.width = justifyWidth * percentWidth / 100;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!hasSetWidth && this._resetTypicalItemDimensionsOnMeasure)\n\t\t\t{\n\t\t\t\tthis._typicalItem.width = this._typicalItemWidth;\n\t\t\t}\n\t\t\tif(this._resetTypicalItemDimensionsOnMeasure)\n\t\t\t{\n\t\t\t\tthis._typicalItem.height = this._typicalItemHeight;\n\t\t\t}\n\t\t\tif(this._typicalItem is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this._typicalItem).validate();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function calculateDistributedHeight(items:Vector.<DisplayObject>, explicitHeight:Number, minHeight:Number, maxHeight:Number, measureItems:Boolean):Number\n\t\t{\n\t\t\tvar needsHeight:Boolean = explicitHeight !== explicitHeight; //isNaN\n\t\t\tvar includedItemCount:int = 0;\n\t\t\tvar maxItemHeight:Number = 0;\n\t\t\tvar itemCount:int = items.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tincludedItemCount++;\n\t\t\t\tvar itemHeight:Number = item.height;\n\t\t\t\tif(itemHeight > maxItemHeight)\n\t\t\t\t{\n\t\t\t\t\tmaxItemHeight = itemHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(measureItems && needsHeight)\n\t\t\t{\n\t\t\t\texplicitHeight = maxItemHeight * includedItemCount + this._paddingTop + this._paddingBottom + this._gap * (includedItemCount - 1);\n\t\t\t\tvar needsRecalculation:Boolean = false;\n\t\t\t\tif(explicitHeight > maxHeight)\n\t\t\t\t{\n\t\t\t\t\texplicitHeight = maxHeight;\n\t\t\t\t\tneedsRecalculation = true;\n\t\t\t\t}\n\t\t\t\telse if(explicitHeight < minHeight)\n\t\t\t\t{\n\t\t\t\t\texplicitHeight = minHeight;\n\t\t\t\t\tneedsRecalculation = true;\n\t\t\t\t}\n\t\t\t\tif(!needsRecalculation)\n\t\t\t\t{\n\t\t\t\t\treturn maxItemHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar availableSpace:Number = explicitHeight;\n\t\t\tif(needsHeight && maxHeight < Number.POSITIVE_INFINITY)\n\t\t\t{\n\t\t\t\tavailableSpace = maxHeight;\n\t\t\t}\n\t\t\tavailableSpace = availableSpace - this._paddingTop - this._paddingBottom - this._gap * (includedItemCount - 1);\n\t\t\tif(includedItemCount > 1 && this._firstGap === this._firstGap) //!isNaN\n\t\t\t{\n\t\t\t\tavailableSpace += this._gap - this._firstGap;\n\t\t\t}\n\t\t\tif(includedItemCount > 2 && this._lastGap === this._lastGap) //!isNaN\n\t\t\t{\n\t\t\t\tavailableSpace += this._gap - this._lastGap;\n\t\t\t}\n\t\t\treturn availableSpace / includedItemCount;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function applyPercentHeights(items:Vector.<DisplayObject>, explicitHeight:Number, minHeight:Number, maxHeight:Number):void\n\t\t{\n\t\t\tvar remainingHeight:Number = explicitHeight;\n\t\t\tthis._discoveredItemsCache.length = 0;\n\t\t\tvar totalExplicitHeight:Number = 0;\n\t\t\tvar totalMinHeight:Number = 0;\n\t\t\tvar totalPercentHeight:Number = 0;\n\t\t\tvar itemCount:int = items.length;\n\t\t\tvar pushIndex:int = 0;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\tif(item is ILayoutDisplayObject)\n\t\t\t\t{\n\t\t\t\t\tvar layoutItem:ILayoutDisplayObject = ILayoutDisplayObject(item);\n\t\t\t\t\tif(!layoutItem.includeInLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tvar layoutData:VerticalLayoutData = layoutItem.layoutData as VerticalLayoutData;\n\t\t\t\t\tif(layoutData)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar percentHeight:Number = layoutData.percentHeight;\n\t\t\t\t\t\tif(percentHeight === percentHeight) //!isNaN\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(percentHeight < 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tpercentHeight = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(layoutItem is IFeathersControl)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar feathersItem:IFeathersControl = IFeathersControl(layoutItem);\n\t\t\t\t\t\t\t\ttotalMinHeight += feathersItem.minHeight;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttotalPercentHeight += percentHeight;\n\t\t\t\t\t\t\ttotalExplicitHeight += this._gap;\n\t\t\t\t\t\t\tthis._discoveredItemsCache[pushIndex] = item;\n\t\t\t\t\t\t\tpushIndex++;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttotalExplicitHeight += item.height + this._gap;\n\t\t\t}\n\t\t\ttotalExplicitHeight -= this._gap;\n\t\t\tif(this._firstGap === this._firstGap && itemCount > 1)\n\t\t\t{\n\t\t\t\ttotalExplicitHeight += (this._firstGap - this._gap);\n\t\t\t}\n\t\t\telse if(this._lastGap === this._lastGap && itemCount > 2)\n\t\t\t{\n\t\t\t\ttotalExplicitHeight += (this._lastGap - this._gap);\n\t\t\t}\n\t\t\ttotalExplicitHeight += this._paddingTop + this._paddingBottom;\n\t\t\tif(totalPercentHeight < 100)\n\t\t\t{\n\t\t\t\ttotalPercentHeight = 100;\n\t\t\t}\n\t\t\tif(remainingHeight !== remainingHeight) //isNaN\n\t\t\t{\n\t\t\t\tremainingHeight = totalExplicitHeight + totalMinHeight;\n\t\t\t\tif(remainingHeight < minHeight)\n\t\t\t\t{\n\t\t\t\t\tremainingHeight = minHeight;\n\t\t\t\t}\n\t\t\t\telse if(remainingHeight > maxHeight)\n\t\t\t\t{\n\t\t\t\t\tremainingHeight = maxHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\tremainingHeight -= totalExplicitHeight;\n\t\t\tif(remainingHeight < 0)\n\t\t\t{\n\t\t\t\tremainingHeight = 0;\n\t\t\t}\n\t\t\tdo\n\t\t\t{\n\t\t\t\tvar needsAnotherPass:Boolean = false;\n\t\t\t\tvar percentToPixels:Number = remainingHeight / totalPercentHeight;\n\t\t\t\tfor(i = 0; i < pushIndex; i++)\n\t\t\t\t{\n\t\t\t\t\tlayoutItem = ILayoutDisplayObject(this._discoveredItemsCache[i]);\n\t\t\t\t\tif(!layoutItem)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tlayoutData = VerticalLayoutData(layoutItem.layoutData);\n\t\t\t\t\tpercentHeight = layoutData.percentHeight;\n\t\t\t\t\tif(percentHeight < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tpercentHeight = 0;\n\t\t\t\t\t}\n\t\t\t\t\tvar itemHeight:Number = percentToPixels * percentHeight;\n\t\t\t\t\tif(layoutItem is IFeathersControl)\n\t\t\t\t\t{\n\t\t\t\t\t\tfeathersItem = IFeathersControl(layoutItem);\n\t\t\t\t\t\tvar itemMinHeight:Number = feathersItem.explicitMinHeight;\n\t\t\t\t\t\tif(itemMinHeight > remainingHeight)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//we try to respect the item's minimum height, but\n\t\t\t\t\t\t\t//if it's larger than the remaining space, we need\n\t\t\t\t\t\t\t//to force it to fit\n\t\t\t\t\t\t\titemMinHeight = remainingHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(itemHeight < itemMinHeight)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titemHeight = itemMinHeight;\n\t\t\t\t\t\t\tremainingHeight -= itemHeight;\n\t\t\t\t\t\t\ttotalPercentHeight -= percentHeight;\n\t\t\t\t\t\t\tthis._discoveredItemsCache[i] = null;\n\t\t\t\t\t\t\tneedsAnotherPass = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//we don't check maxHeight here because it is used in\n\t\t\t\t\t\t//validateItems() for performance optimization, so it\n\t\t\t\t\t\t//isn't a real maximum\n\t\t\t\t\t}\n\t\t\t\t\tlayoutItem.height = itemHeight;\n\t\t\t\t\tif(layoutItem is IValidating)\n\t\t\t\t\t{\n\t\t\t\t\t\t//changing the height of the item may cause its width\n\t\t\t\t\t\t//to change, so we need to validate. the width is needed\n\t\t\t\t\t\t//for measurement.\n\t\t\t\t\t\tIValidating(layoutItem).validate();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile(needsAnotherPass);\n\t\t\tthis._discoveredItemsCache.length = 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function calculateScrollRangeOfIndex(index:int, items:Vector.<DisplayObject>, x:Number, y:Number, width:Number, height:Number, result:Point):void\n\t\t{\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthis.prepareTypicalItem(width - this._paddingLeft - this._paddingRight);\n\t\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\t\t\t}\n\t\t\tvar headerIndicesIndex:int = -1;\n\t\t\tvar nextHeaderIndex:int = -1;\n\t\t\tvar headerCount:int = 0;\n\t\t\tvar lastHeaderHeight:Number = 0;\n\t\t\tif(this._headerIndices && this._stickyHeader)\n\t\t\t{\n\t\t\t\theaderCount = this._headerIndices.length;\n\t\t\t\tif(headerCount > 0)\n\t\t\t\t{\n\t\t\t\t\theaderIndicesIndex = 0;\n\t\t\t\t\tnextHeaderIndex = this._headerIndices[headerIndicesIndex];\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar hasFirstGap:Boolean = this._firstGap === this._firstGap; //!isNaN\n\t\t\tvar hasLastGap:Boolean = this._lastGap === this._lastGap; //!isNaN\n\t\t\tvar positionY:Number = y + this._paddingTop;\n\t\t\tvar lastHeight:Number = 0;\n\t\t\tvar gap:Number = this._gap;\n\t\t\tvar startIndexOffset:int = 0;\n\t\t\tvar endIndexOffset:Number = 0;\n\t\t\tvar itemCount:int = items.length;\n\t\t\tvar totalItemCount:int = itemCount;\n\t\t\tif(this._useVirtualLayout && !this._hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\ttotalItemCount += this._beforeVirtualizedItemCount + this._afterVirtualizedItemCount;\n\t\t\t\tif(index < this._beforeVirtualizedItemCount)\n\t\t\t\t{\n\t\t\t\t\t//this makes it skip the loop below\n\t\t\t\t\tstartIndexOffset = index + 1;\n\t\t\t\t\tlastHeight = calculatedTypicalItemHeight;\n\t\t\t\t\tgap = this._gap;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tstartIndexOffset = this._beforeVirtualizedItemCount;\n\t\t\t\t\tendIndexOffset = index - items.length - this._beforeVirtualizedItemCount + 1;\n\t\t\t\t\tif(endIndexOffset < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tendIndexOffset = 0;\n\t\t\t\t\t}\n\t\t\t\t\tpositionY += (endIndexOffset * (calculatedTypicalItemHeight + this._gap));\n\t\t\t\t}\n\t\t\t\tpositionY += (startIndexOffset * (calculatedTypicalItemHeight + this._gap));\n\t\t\t}\n\t\t\tindex -= (startIndexOffset + endIndexOffset);\n\t\t\tvar secondToLastIndex:int = totalItemCount - 2;\n\t\t\tfor(var i:int = 0; i <= index; i++)\n\t\t\t{\n\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\tvar iNormalized:int = i + startIndexOffset;\n\t\t\t\tif(hasFirstGap && iNormalized == 0)\n\t\t\t\t{\n\t\t\t\t\tgap = this._firstGap;\n\t\t\t\t}\n\t\t\t\telse if(hasLastGap && iNormalized > 0 && iNormalized == secondToLastIndex)\n\t\t\t\t{\n\t\t\t\t\tgap = this._lastGap;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tgap = this._gap;\n\t\t\t\t}\n\t\t\t\tif(this._useVirtualLayout && this._hasVariableItemDimensions)\n\t\t\t\t{\n\t\t\t\t\tvar cachedHeight:Number = this._virtualCache[iNormalized];\n\t\t\t\t}\n\t\t\t\tif(this._useVirtualLayout && !item)\n\t\t\t\t{\n\t\t\t\t\tif(!this._hasVariableItemDimensions ||\n\t\t\t\t\t\tcachedHeight !== cachedHeight) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\tlastHeight = calculatedTypicalItemHeight;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tlastHeight = cachedHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar itemHeight:Number = item.height;\n\t\t\t\t\tif(this._useVirtualLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._hasVariableItemDimensions)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(itemHeight != cachedHeight)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis._virtualCache[iNormalized] = itemHeight;\n\t\t\t\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(calculatedTypicalItemHeight >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.height = itemHeight = calculatedTypicalItemHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlastHeight = itemHeight;\n\t\t\t\t}\n\t\t\t\tpositionY += lastHeight + gap;\n\t\t\t\tif(nextHeaderIndex == iNormalized)\n\t\t\t\t{\n\t\t\t\t\tlastHeaderHeight = lastHeight;\n\t\t\t\t\t//if the sticky header is enabled, we need to find its index\n\t\t\t\t\t//we look for the first header that is visible at the top of\n\t\t\t\t\t//the view port. the previous one should be sticky.\n\t\t\t\t\theaderIndicesIndex++;\n\t\t\t\t\tif(headerIndicesIndex < headerCount)\n\t\t\t\t\t{\n\t\t\t\t\t\tnextHeaderIndex = this._headerIndices[headerIndicesIndex];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tpositionY -= (lastHeight + gap);\n\t\t\tresult.x = positionY - height;\n\t\t\tif(this._stickyHeader &&\n\t\t\t\tthis._headerIndices !== null &&\n\t\t\t\tthis._headerIndices.indexOf(index) == -1)\n\t\t\t{\n\t\t\t\t//if the headers are sticky, adjust the scroll range if we're\n\t\t\t\t//scrolling to an item because the sticky header should not hide\n\t\t\t\t//the item\n\t\t\t\t//unlike items, though, headers have a full scroll range\n\t\t\t\tpositionY -= lastHeaderHeight;\n\t\t\t}\n\t\t\tresult.y = positionY;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function positionStickyHeader(header:DisplayObject, scrollY:Number, maxY:Number):void\n\t\t{\n\t\t\tif(!header || header.y >= scrollY)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(header is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(header).validate();\n\t\t\t}\n\t\t\tmaxY -= header.height;\n\t\t\tif(maxY > scrollY)\n\t\t\t{\n\t\t\t\tmaxY = scrollY;\n\t\t\t}\n\t\t\theader.y = maxY;\n\t\t\t//ensure that the sticky header is always on top!\n\t\t\tvar headerParent:DisplayObjectContainer = header.parent;\n\t\t\tif(headerParent)\n\t\t\t{\n\t\t\t\theaderParent.setChildIndex(header, headerParent.numChildren - 1);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/VerticalLayoutData.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\n\t/**\n\t * @inheritDoc\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Extra, optional data used by an <code>VerticalLayout</code> instance to\n\t * position and size a display object.\n\t *\n\t * @see VerticalLayout\n\t * @see ILayoutDisplayObject\n\t *\n\t * @productversion Feathers 1.3.0\n\t */\n\tpublic class VerticalLayoutData extends EventDispatcher implements ILayoutData\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function VerticalLayoutData(percentWidth:Number = NaN, percentHeight:Number = NaN)\n\t\t{\n\t\t\tthis._percentWidth = percentWidth;\n\t\t\tthis._percentHeight = percentHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _percentWidth:Number;\n\n\t\t/**\n\t\t * The width of the layout object, as a percentage of the container's\n\t\t * width.\n\t\t *\n\t\t * <p>A percentage may be specified in the range from <code>0</code>\n\t\t * to <code>100</code>. If the value is set to <code>NaN</code>, this\n\t\t * property is ignored.</p>\n\t\t *\n\t\t * <p>Performance tip: If all items in your layout will have 100% width,\n\t\t * it's better to set the <code>horizontalAlign</code> property of the\n\t\t * <code>VerticalLayout</code> to\n\t\t * <code>HorizontalAlign.JUSTIFY</code>.</p>\n\t\t *\n\t\t * @default NaN\n\t\t *\n\t\t * @see feathers.layout.VerticalLayout#horizontalAlign\n\t\t */\n\t\tpublic function get percentWidth():Number\n\t\t{\n\t\t\treturn this._percentWidth;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set percentWidth(value:Number):void\n\t\t{\n\t\t\tif(this._percentWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._percentWidth = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _percentHeight:Number;\n\n\t\t/**\n\t\t * The height of the layout object, as a percentage of the container's\n\t\t * height. The container will calculate the sum of all of its children\n\t\t * with explicit pixel heights, and then the remaining space will be\n\t\t * distributed to children with percent heights.\n\t\t *\n\t\t * <p>A percentage may be specified in the range from <code>0</code>\n\t\t * to <code>100</code>. If the value is set to <code>NaN</code>, this\n\t\t * property is ignored. It will also be ignored when the\n\t\t * <code>useVirtualLayout</code> property of the\n\t\t * <code>VerticalLayout</code> is set to <code>false</code>.</p>\n\t\t *\n\t\t * @default NaN\n\t\t */\n\t\tpublic function get percentHeight():Number\n\t\t{\n\t\t\treturn this._percentHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set percentHeight(value:Number):void\n\t\t{\n\t\t\tif(this._percentHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._percentHeight = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/VerticalSpinnerLayout.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IValidating;\n\timport feathers.layout.VerticalAlign;\n\n\timport flash.errors.IllegalOperationError;\n\timport flash.geom.Point;\n\timport flash.geom.Rectangle;\n\timport flash.ui.Keyboard;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\n\t/**\n\t * Dispatched when a property of the layout changes, indicating that a\n\t * redraw is probably needed.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * For use with the <code>SpinnerList</code> component, positions items from\n\t * top to bottom in a single column and repeats infinitely.\n\t *\n\t * @see ../../../help/vertical-spinner-layout.html How to use VerticalSpinnerLayout with the Feathers SpinnerList component\n\t *\n\t * @productversion Feathers 2.1.0\n\t */\n\tpublic class VerticalSpinnerLayout extends EventDispatcher implements ISpinnerLayout, ITrimmedVirtualLayout\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function VerticalSpinnerLayout()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _discoveredItemsCache:Vector.<DisplayObject> = new <DisplayObject>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _gap:Number = 0;\n\n\t\t/**\n\t\t * The space, in pixels, between items.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get gap():Number\n\t\t{\n\t\t\treturn this._gap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set gap(value:Number):void\n\t\t{\n\t\t\tif(this._gap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._gap = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * Quickly sets all padding properties to the same value. The\n\t\t * <code>padding</code> getter always returns the value of\n\t\t * <code>paddingLeft</code>, but the other padding values may be\n\t\t * different.\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #paddingRight\n\t\t * @see #paddingLeft\n\t\t */\n\t\tpublic function get padding():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set padding(value:Number):void\n\t\t{\n\t\t\tthis.paddingRight = value;\n\t\t\tthis.paddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingTop:Number = 0;\n\n\t\t/**\n\t\t * The minimum space, in pixels, above the items, if they\n\t\t * do not repeat. If items repeat, <code>paddingTop</code> will\n\t\t * only be used if <code>verticalAlign</code> is set to\n\t\t * <code>VerticalAlign.TOP</code>. In this case, the first item,\n\t\t * starting from the top, will be offset by the value of\n\t\t * <code>paddingTop</code>.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingTop():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingTop(value:Number):void\n\t\t{\n\t\t\tif(this._paddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingTop = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingRight:Number = 0;\n\n\t\t/**\n\t\t * The minimum space, in pixels, to the right of the items.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingRight():Number\n\t\t{\n\t\t\treturn this._paddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this._paddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingRight = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingBottom:Number = 0;\n\n\t\t/**\n\t\t * The minimum space, in pixels, below the items, if they\n\t\t * do not repeat. If items repeat, <code>paddingBottom</code> will\n\t\t * only be used if <code>verticalAlign</code> is set to\n\t\t * <code>VerticalAlign.BOTTOM</code>. In this case, the first item,\n\t\t * starting from the bottom, will be offset by the value of\n\t\t * <code>paddingBottom</code>.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingBottom():Number\n\t\t{\n\t\t\treturn this._paddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this._paddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingBottom = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingLeft:Number = 0;\n\n\t\t/**\n\t\t * The minimum space, in pixels, to the left of the items.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this._paddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingLeft = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalAlign:String = HorizontalAlign.JUSTIFY;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"left,center,right,justify\")]\n\t\t/**\n\t\t * The alignment of the items horizontally, on the x-axis.\n\t\t *\n\t\t * @default feathers.layout.HorizontalAlign.JUSTIFY\n\t\t *\n\t\t * @see feathers.layout.HorizontalAlign#LEFT\n\t\t * @see feathers.layout.HorizontalAlign#CENTER\n\t\t * @see feathers.layout.HorizontalAlign#RIGHT\n\t\t * @see feathers.layout.HorizontalAlign#JUSTIFY\n\t\t */\n\t\tpublic function get horizontalAlign():String\n\t\t{\n\t\t\treturn this._horizontalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalAlign(value:String):void\n\t\t{\n\t\t\tif(this._horizontalAlign == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalAlign = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalAlign:String = VerticalAlign.MIDDLE;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"top,middle,bottom\")]\n\t\t/**\n\t\t * The alignment of the items vertically, on the y-axis.\n\t\t *\n\t\t * <p><strong>Note:</strong> The <code>VerticalAlign.JUSTIFY</code>\n\t\t * constant is not supported.</p>\n\t\t *\n\t\t * @default feathers.layout.VerticalAlign.MIDDLE\n\t\t *\n\t\t * @see feathers.layout.VerticalAlign#TOP\n\t\t * @see feathers.layout.VerticalAlign#MIDDLE\n\t\t * @see feathers.layout.VerticalAlign#BOTTOM\n\t\t */\n\t\tpublic function get verticalAlign():String\n\t\t{\n\t\t\treturn this._verticalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalAlign(value:String):void\n\t\t{\n\t\t\tif(this._verticalAlign == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalAlign = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _useVirtualLayout:Boolean = true;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic function get useVirtualLayout():Boolean\n\t\t{\n\t\t\treturn this._useVirtualLayout;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set useVirtualLayout(value:Boolean):void\n\t\t{\n\t\t\tif(this._useVirtualLayout == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._useVirtualLayout = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _requestedRowCount:int = 0;\n\n\t\t/**\n\t\t * Requests that the layout set the view port dimensions to display a\n\t\t * specific number of rows (plus gaps and padding), if possible. If the\n\t\t * explicit height of the view port is set, then this value will be\n\t\t * ignored. If the view port's minimum and/or maximum height are set,\n\t\t * the actual number of visible rows may be adjusted to meet those\n\t\t * requirements. Set this value to <code>0</code> to display as many\n\t\t * rows as possible.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get requestedRowCount():int\n\t\t{\n\t\t\treturn this._requestedRowCount;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set requestedRowCount(value:int):void\n\t\t{\n\t\t\tif(value < 0)\n\t\t\t{\n\t\t\t\tthrow RangeError(\"requestedRowCount requires a value >= 0\");\n\t\t\t}\n\t\t\tif(this._requestedRowCount == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._requestedRowCount = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _beforeVirtualizedItemCount:int = 0;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get beforeVirtualizedItemCount():int\n\t\t{\n\t\t\treturn this._beforeVirtualizedItemCount;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set beforeVirtualizedItemCount(value:int):void\n\t\t{\n\t\t\tif(this._beforeVirtualizedItemCount == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._beforeVirtualizedItemCount = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _afterVirtualizedItemCount:int = 0;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get afterVirtualizedItemCount():int\n\t\t{\n\t\t\treturn this._afterVirtualizedItemCount;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set afterVirtualizedItemCount(value:int):void\n\t\t{\n\t\t\tif(this._afterVirtualizedItemCount == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._afterVirtualizedItemCount = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _typicalItem:DisplayObject;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @see #resetTypicalItemDimensionsOnMeasure\n\t\t * @see #typicalItemWidth\n\t\t * @see #typicalItemHeight\n\t\t */\n\t\tpublic function get typicalItem():DisplayObject\n\t\t{\n\t\t\treturn this._typicalItem;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set typicalItem(value:DisplayObject):void\n\t\t{\n\t\t\tif(this._typicalItem == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._typicalItem = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _resetTypicalItemDimensionsOnMeasure:Boolean = false;\n\n\t\t/**\n\t\t * If set to <code>true</code>, the width and height of the\n\t\t * <code>typicalItem</code> will be reset to <code>typicalItemWidth</code>\n\t\t * and <code>typicalItemHeight</code>, respectively, whenever the\n\t\t * typical item needs to be measured. The measured dimensions of the\n\t\t * typical item are used to fill in the blanks of a virtualized layout\n\t\t * for virtual items that don't have their own display objects to\n\t\t * measure yet.\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see #typicalItemWidth\n\t\t * @see #typicalItemHeight\n\t\t * @see #typicalItem\n\t\t */\n\t\tpublic function get resetTypicalItemDimensionsOnMeasure():Boolean\n\t\t{\n\t\t\treturn this._resetTypicalItemDimensionsOnMeasure;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set resetTypicalItemDimensionsOnMeasure(value:Boolean):void\n\t\t{\n\t\t\tif(this._resetTypicalItemDimensionsOnMeasure == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._resetTypicalItemDimensionsOnMeasure = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _typicalItemWidth:Number = NaN;\n\n\t\t/**\n\t\t * Used to reset the width, in pixels, of the <code>typicalItem</code>\n\t\t * for measurement. The measured dimensions of the typical item are used\n\t\t * to fill in the blanks of a virtualized layout for virtual items that\n\t\t * don't have their own display objects to measure yet.\n\t\t *\n\t\t * <p>This value is only used when <code>resetTypicalItemDimensionsOnMeasure</code>\n\t\t * is set to <code>true</code>. If <code>resetTypicalItemDimensionsOnMeasure</code>\n\t\t * is set to <code>false</code>, this value will be ignored and the\n\t\t * <code>typicalItem</code> dimensions will not be reset before\n\t\t * measurement.</p>\n\t\t *\n\t\t * <p>If <code>typicalItemWidth</code> is set to <code>NaN</code>, the\n\t\t * typical item will auto-size itself to its preferred width. If you\n\t\t * pass a valid <code>Number</code> value, the typical item's width will\n\t\t * be set to a fixed size. May be used in combination with\n\t\t * <code>typicalItemHeight</code>.</p>\n\t\t *\n\t\t * @default NaN\n\t\t *\n\t\t * @see #resetTypicalItemDimensionsOnMeasure\n\t\t * @see #typicalItemHeight\n\t\t * @see #typicalItem\n\t\t */\n\t\tpublic function get typicalItemWidth():Number\n\t\t{\n\t\t\treturn this._typicalItemWidth;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set typicalItemWidth(value:Number):void\n\t\t{\n\t\t\tif(this._typicalItemWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._typicalItemWidth = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _typicalItemHeight:Number = NaN;\n\n\t\t/**\n\t\t * Used to reset the height, in pixels, of the <code>typicalItem</code>\n\t\t * for measurement. The measured dimensions of the typical item are used\n\t\t * to fill in the blanks of a virtualized layout for virtual items that\n\t\t * don't have their own display objects to measure yet.\n\t\t *\n\t\t * <p>This value is only used when <code>resetTypicalItemDimensionsOnMeasure</code>\n\t\t * is set to <code>true</code>. If <code>resetTypicalItemDimensionsOnMeasure</code>\n\t\t * is set to <code>false</code>, this value will be ignored and the\n\t\t * <code>typicalItem</code> dimensions will not be reset before\n\t\t * measurement.</p>\n\t\t *\n\t\t * <p>If <code>typicalItemHeight</code> is set to <code>NaN</code>, the\n\t\t * typical item will auto-size itself to its preferred height. If you\n\t\t * pass a valid <code>Number</code> value, the typical item's height will\n\t\t * be set to a fixed size. May be used in combination with\n\t\t * <code>typicalItemWidth</code>.</p>\n\t\t *\n\t\t * @default NaN\n\t\t *\n\t\t * @see #resetTypicalItemDimensionsOnMeasure\n\t\t * @see #typicalItemWidth\n\t\t * @see #typicalItem\n\t\t */\n\t\tpublic function get typicalItemHeight():Number\n\t\t{\n\t\t\treturn this._typicalItemHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set typicalItemHeight(value:Number):void\n\t\t{\n\t\t\tif(this._typicalItemHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._typicalItemHeight = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _repeatItems:Boolean = true;\n\n\t\t/**\n\t\t * If set to <code>true</code>, the layout will repeat the items\n\t\t * infinitely, if there are enough items to allow this behavior. If the\n\t\t * total height of the items is smaller than the height of the view\n\t\t * port, the items cannot repeat.\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic function get repeatItems():Boolean\n\t\t{\n\t\t\treturn this._repeatItems;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set repeatItems(value:Boolean):void\n\t\t{\n\t\t\tif(this._repeatItems == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._repeatItems = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.layout.ISpinnerLayout#snapInterval\n\t\t */\n\t\tpublic function get snapInterval():Number\n\t\t{\n\t\t\tif(this._typicalItem === null)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn this._typicalItem.height + this._gap;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get requiresLayoutOnScroll():Boolean\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectionBounds:Rectangle = new Rectangle();\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get selectionBounds():Rectangle\n\t\t{\n\t\t\treturn this._selectionBounds;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function layout(items:Vector.<DisplayObject>, viewPortBounds:ViewPortBounds = null, result:LayoutBoundsResult = null):LayoutBoundsResult\n\t\t{\n\t\t\t//this function is very long because it may be called every frame,\n\t\t\t//in some situations. testing revealed that splitting this function\n\t\t\t//into separate, smaller functions affected performance.\n\t\t\t//since the SWC compiler cannot inline functions, we can't use that\n\t\t\t//feature either.\n\n\t\t\t//since viewPortBounds can be null, we may need to provide some defaults\n\t\t\tvar scrollX:Number = viewPortBounds ? viewPortBounds.scrollX : 0;\n\t\t\tvar scrollY:Number = viewPortBounds ? viewPortBounds.scrollY : 0;\n\t\t\tvar boundsX:Number = viewPortBounds ? viewPortBounds.x : 0;\n\t\t\tvar boundsY:Number = viewPortBounds ? viewPortBounds.y : 0;\n\t\t\tvar minWidth:Number = viewPortBounds ? viewPortBounds.minWidth : 0;\n\t\t\tvar minHeight:Number = viewPortBounds ? viewPortBounds.minHeight : 0;\n\t\t\tvar maxWidth:Number = viewPortBounds ? viewPortBounds.maxWidth : Number.POSITIVE_INFINITY;\n\t\t\tvar maxHeight:Number = viewPortBounds ? viewPortBounds.maxHeight : Number.POSITIVE_INFINITY;\n\t\t\tvar explicitWidth:Number = viewPortBounds ? viewPortBounds.explicitWidth : NaN;\n\t\t\tvar explicitHeight:Number = viewPortBounds ? viewPortBounds.explicitHeight : NaN;\n\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\t//if the layout is virtualized, we'll need the dimensions of the\n\t\t\t\t//typical item so that we have fallback values when an item is null\n\t\t\t\tthis.prepareTypicalItem(explicitWidth - this._paddingLeft - this._paddingRight);\n\t\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\t\t\t}\n\n\t\t\tif(!this._useVirtualLayout || this._horizontalAlign != HorizontalAlign.JUSTIFY ||\n\t\t\t\texplicitWidth !== explicitWidth) //isNaN\n\t\t\t{\n\t\t\t\t//in some cases, we may need to validate all of the items so\n\t\t\t\t//that we can use their dimensions below.\n\t\t\t\tthis.validateItems(items, explicitWidth - this._paddingLeft - this._paddingRight, explicitHeight);\n\t\t\t}\n\n\t\t\t//this section prepares some variables needed for the following loop\n\t\t\tvar maxItemWidth:Number = this._useVirtualLayout ? calculatedTypicalItemWidth : 0;\n\t\t\tvar positionY:Number = boundsY;\n\t\t\tvar gap:Number = this._gap;\n\t\t\tvar itemCount:int = items.length;\n\t\t\tvar totalItemCount:int = itemCount;\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\t//if the layout is virtualized, and the items all have the same\n\t\t\t\t//height, we can make our loops smaller by skipping some items\n\t\t\t\t//at the beginning and end. this improves performance.\n\n\t\t\t\tif(this._beforeVirtualizedItemCount > 0)\n\t\t\t\t{\n\t\t\t\t\t//this value may be negative, which means that we're\n\t\t\t\t\t//repeating items. we don't want to include this value in\n\t\t\t\t\t//the total count, but we'll use it elsewhere.\n\t\t\t\t\ttotalItemCount += this._beforeVirtualizedItemCount;\n\t\t\t\t}\n\t\t\t\ttotalItemCount += this._afterVirtualizedItemCount;\n\t\t\t\tpositionY += (this._beforeVirtualizedItemCount * (calculatedTypicalItemHeight + gap));\n\t\t\t}\n\t\t\t//this cache is used to save non-null items in virtual layouts. by\n\t\t\t//using a smaller array, we can improve performance by spending less\n\t\t\t//time in the upcoming loops.\n\t\t\tthis._discoveredItemsCache.length = 0;\n\t\t\tvar discoveredItemsCacheLastIndex:int = 0;\n\n\t\t\t//this first loop sets the y position of items, and it calculates\n\t\t\t//the total height of all items\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\tif(item)\n\t\t\t\t{\n\t\t\t\t\t//we get here if the item isn't null. it is never null if\n\t\t\t\t\t//the layout isn't virtualized.\n\t\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\titem.y = item.pivotY + positionY;\n\t\t\t\t\titem.height = calculatedTypicalItemHeight;\n\t\t\t\t\tvar itemWidth:Number = item.width;\n\t\t\t\t\t//we compare with > instead of Math.max() because the rest\n\t\t\t\t\t//arguments on Math.max() cause extra garbage collection and\n\t\t\t\t\t//hurt performance\n\t\t\t\t\tif(itemWidth > maxItemWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\t//we need to know the maximum width of the items in the\n\t\t\t\t\t\t//case where the width of the view port needs to be\n\t\t\t\t\t\t//calculated by the layout.\n\t\t\t\t\t\tmaxItemWidth = itemWidth;\n\t\t\t\t\t}\n\t\t\t\t\tif(this._useVirtualLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._discoveredItemsCache[discoveredItemsCacheLastIndex] = item;\n\t\t\t\t\t\tdiscoveredItemsCacheLastIndex++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tpositionY += calculatedTypicalItemHeight + gap;\n\t\t\t}\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\t//finish the final calculation of the y position so that it can\n\t\t\t\t//be used for the total height of all items\n\t\t\t\tpositionY += (this._afterVirtualizedItemCount * (calculatedTypicalItemHeight + gap));\n\t\t\t}\n\n\t\t\t//this array will contain all items that are not null. see the\n\t\t\t//comment above where the discoveredItemsCache is initialized for\n\t\t\t//details about why this is important.\n\t\t\tvar discoveredItems:Vector.<DisplayObject> = this._useVirtualLayout ? this._discoveredItemsCache : items;\n\t\t\tvar discoveredItemCount:int = discoveredItems.length;\n\n\t\t\tvar totalWidth:Number = maxItemWidth + this._paddingLeft + this._paddingRight;\n\t\t\t//the available width is the width of the viewport. if the explicit\n\t\t\t//width is NaN, we need to calculate the viewport width ourselves\n\t\t\t//based on the total width of all items.\n\t\t\tvar availableWidth:Number = explicitWidth;\n\t\t\tif(availableWidth !== availableWidth) //isNaN\n\t\t\t{\n\t\t\t\tavailableWidth = totalWidth;\n\t\t\t\tif(availableWidth < minWidth)\n\t\t\t\t{\n\t\t\t\t\tavailableWidth = minWidth;\n\t\t\t\t}\n\t\t\t\telse if(availableWidth > maxWidth)\n\t\t\t\t{\n\t\t\t\t\tavailableWidth = maxWidth;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//this is the total height of all items\n\t\t\tvar totalHeight:Number = positionY - gap - boundsY;\n\t\t\tif(this._useVirtualLayout && this._beforeVirtualizedItemCount < 0)\n\t\t\t{\n\t\t\t\ttotalHeight -= (this._beforeVirtualizedItemCount * (calculatedTypicalItemHeight + gap));\n\t\t\t}\n\t\t\t//the available height is the height of the viewport. if the explicit\n\t\t\t//height is NaN, we need to calculate the viewport height ourselves\n\t\t\t//based on the total height of all items.\n\t\t\tvar availableHeight:Number = explicitHeight;\n\t\t\tif(availableHeight !== availableHeight) //isNaN\n\t\t\t{\n\t\t\t\tif(this._requestedRowCount > 0)\n\t\t\t\t{\n\t\t\t\t\tavailableHeight = this._requestedRowCount * (calculatedTypicalItemHeight + gap) - gap;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tavailableHeight = totalHeight;\n\t\t\t\t}\n\t\t\t\tif(availableHeight < minHeight)\n\t\t\t\t{\n\t\t\t\t\tavailableHeight = minHeight;\n\t\t\t\t}\n\t\t\t\telse if(availableHeight > maxHeight)\n\t\t\t\t{\n\t\t\t\t\tavailableHeight = maxHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//we add one extra here because the first item renderer in view may\n\t\t\t//be partially obscured, which would reveal an extra item renderer.\n\t\t\tvar maxVisibleTypicalItemCount:int = Math.ceil(availableHeight / (calculatedTypicalItemHeight + gap)) + 1;\n\t\t\tvar minTotalHeightForRepeat:Number = maxVisibleTypicalItemCount * (calculatedTypicalItemHeight + gap) - gap;\n\t\t\tvar canRepeatItems:Boolean = this._repeatItems && totalHeight >= minTotalHeightForRepeat;\n\t\t\tif(canRepeatItems)\n\t\t\t{\n\t\t\t\ttotalHeight += gap;\n\t\t\t}\n\n\t\t\t//in this section, we handle vertical alignment\n\t\t\tvar verticalAlignOffsetY:Number = this._paddingTop;\n\t\t\tif(this._verticalAlign === VerticalAlign.BOTTOM)\n\t\t\t{\n\t\t\t\tverticalAlignOffsetY = availableHeight - this._paddingBottom - calculatedTypicalItemHeight;\n\t\t\t}\n\t\t\telse if(this._verticalAlign === VerticalAlign.MIDDLE)\n\t\t\t{\n\t\t\t\tverticalAlignOffsetY = this._paddingTop + Math.round((availableHeight - this._paddingTop - this._paddingBottom - calculatedTypicalItemHeight) / 2);\n\t\t\t}\n\t\t\tif(!canRepeatItems)\n\t\t\t{\n\t\t\t\ttotalHeight += verticalAlignOffsetY + (availableHeight - calculatedTypicalItemHeight - verticalAlignOffsetY);\n\t\t\t}\n\t\t\tif(verticalAlignOffsetY != 0)\n\t\t\t{\n\t\t\t\tfor(i = 0; i < discoveredItemCount; i++)\n\t\t\t\t{\n\t\t\t\t\titem = discoveredItems[i];\n\t\t\t\t\tif(item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\titem.y += verticalAlignOffsetY;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor(i = 0; i < discoveredItemCount; i++)\n\t\t\t{\n\t\t\t\titem = discoveredItems[i];\n\t\t\t\tvar layoutItem:ILayoutDisplayObject = item as ILayoutDisplayObject;\n\t\t\t\tif(layoutItem && !layoutItem.includeInLayout)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t//if we're repeating items, then we may need to adjust the y\n\t\t\t\t//position of some items so that they appear inside the viewport\n\t\t\t\tif(canRepeatItems)\n\t\t\t\t{\n\t\t\t\t\tvar adjustedScrollY:Number = scrollY - verticalAlignOffsetY;\n\t\t\t\t\tif(adjustedScrollY > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar multiplier:int = int((adjustedScrollY + availableHeight) / totalHeight);\n\t\t\t\t\t\tif(useVirtualLayout && this._beforeVirtualizedItemCount < 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmultiplier++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\titem.y += totalHeight * multiplier;\n\t\t\t\t\t\tif(item.y >= (scrollY + availableHeight))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.y -= totalHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(adjustedScrollY < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\titem.y += totalHeight * (int(adjustedScrollY / totalHeight) - 1);\n\t\t\t\t\t\tif((item.y + item.height) < scrollY)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.y += totalHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//in this section, we handle horizontal alignment\n\t\t\t\tif(this._horizontalAlign == HorizontalAlign.JUSTIFY)\n\t\t\t\t{\n\t\t\t\t\t//if we justify items horizontally, we can skip percent width\n\t\t\t\t\titem.x = item.pivotX + boundsX + this._paddingLeft;\n\t\t\t\t\titem.width = availableWidth - this._paddingLeft - this._paddingRight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//handle all other horizontal alignment values (we handled\n\t\t\t\t\t//justify already). the x position of all items is set.\n\t\t\t\t\tvar horizontalAlignWidth:Number = availableWidth;\n\t\t\t\t\tif(totalWidth > horizontalAlignWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\thorizontalAlignWidth = totalWidth;\n\t\t\t\t\t}\n\t\t\t\t\tswitch(this._horizontalAlign)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase HorizontalAlign.RIGHT:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.x = item.pivotX + boundsX + horizontalAlignWidth - this._paddingRight - item.width;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase HorizontalAlign.CENTER:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//round to the nearest pixel when dividing by 2 to\n\t\t\t\t\t\t\t//align in the center\n\t\t\t\t\t\t\titem.x = item.pivotX + boundsX + this._paddingLeft + Math.round((horizontalAlignWidth - this._paddingLeft - this._paddingRight - item.width) / 2);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdefault: //left\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.x = item.pivotX + boundsX + this._paddingLeft;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//we don't want to keep a reference to any of the items, so clear\n\t\t\t//this cache\n\t\t\tthis._discoveredItemsCache.length = 0;\n\n\t\t\t//calculate the bounds of the selection rectangle\n\t\t\tthis._selectionBounds.x = 0;\n\t\t\tthis._selectionBounds.y = verticalAlignOffsetY;\n\t\t\tthis._selectionBounds.width = availableWidth;\n\t\t\tthis._selectionBounds.height = calculatedTypicalItemHeight;\n\n\t\t\t//finally, we want to calculate the result so that the container\n\t\t\t//can use it to adjust its viewport and determine the minimum and\n\t\t\t//maximum scroll positions (if needed)\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new LayoutBoundsResult();\n\t\t\t}\n\t\t\tresult.contentX = 0;\n\t\t\tresult.contentWidth = this._horizontalAlign == HorizontalAlign.JUSTIFY ? availableWidth : totalWidth;\n\t\t\tif(canRepeatItems)\n\t\t\t{\n\t\t\t\tresult.contentY = Number.NEGATIVE_INFINITY;\n\t\t\t\tresult.contentHeight = Number.POSITIVE_INFINITY;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult.contentY = 0;\n\t\t\t\tresult.contentHeight = totalHeight;\n\t\t\t}\n\t\t\tresult.viewPortWidth = availableWidth;\n\t\t\tresult.viewPortHeight = availableHeight;\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function measureViewPort(itemCount:int, viewPortBounds:ViewPortBounds = null, result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\t\t\tif(!this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"measureViewPort() may be called only if useVirtualLayout is true.\");\n\t\t\t}\n\n\t\t\tvar explicitWidth:Number = viewPortBounds ? viewPortBounds.explicitWidth : NaN;\n\t\t\tvar explicitHeight:Number = viewPortBounds ? viewPortBounds.explicitHeight : NaN;\n\t\t\tvar needsWidth:Boolean = explicitWidth !== explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = explicitHeight !== explicitHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight)\n\t\t\t{\n\t\t\t\tresult.x = explicitWidth;\n\t\t\t\tresult.y = explicitHeight;\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tvar minWidth:Number = viewPortBounds ? viewPortBounds.minWidth : 0;\n\t\t\tvar minHeight:Number = viewPortBounds ? viewPortBounds.minHeight : 0;\n\t\t\tvar maxWidth:Number = viewPortBounds ? viewPortBounds.maxWidth : Number.POSITIVE_INFINITY;\n\t\t\tvar maxHeight:Number = viewPortBounds ? viewPortBounds.maxHeight : Number.POSITIVE_INFINITY;\n\n\t\t\tthis.prepareTypicalItem(explicitWidth - this._paddingLeft - this._paddingRight);\n\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\n\t\t\tvar gap:Number = this._gap;\n\t\t\tvar positionY:Number = 0;\n\n\t\t\tvar maxItemWidth:Number = calculatedTypicalItemWidth;\n\t\t\tpositionY += ((calculatedTypicalItemHeight + gap) * itemCount);\n\t\t\tpositionY -= gap;\n\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tvar resultWidth:Number = maxItemWidth + this._paddingLeft + this._paddingRight;\n\t\t\t\tif(resultWidth < minWidth)\n\t\t\t\t{\n\t\t\t\t\tresultWidth = minWidth;\n\t\t\t\t}\n\t\t\t\telse if(resultWidth > maxWidth)\n\t\t\t\t{\n\t\t\t\t\tresultWidth = maxWidth;\n\t\t\t\t}\n\t\t\t\tresult.x = resultWidth;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult.x = explicitWidth;\n\t\t\t}\n\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tif(this._requestedRowCount > 0)\n\t\t\t\t{\n\t\t\t\t\tvar resultHeight:Number = (calculatedTypicalItemHeight + gap) * this._requestedRowCount - gap;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tresultHeight = positionY;\n\t\t\t\t}\n\t\t\t\tif(resultHeight < minHeight)\n\t\t\t\t{\n\t\t\t\t\tresultHeight = minHeight;\n\t\t\t\t}\n\t\t\t\telse if(resultHeight > maxHeight)\n\t\t\t\t{\n\t\t\t\t\tresultHeight = maxHeight;\n\t\t\t\t}\n\t\t\t\tresult.y = resultHeight;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult.y = explicitHeight;\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getVisibleIndicesAtScrollPosition(scrollX:Number, scrollY:Number, width:Number, height:Number, itemCount:int, result:Vector.<int> = null):Vector.<int>\n\t\t{\n\t\t\tif(result)\n\t\t\t{\n\t\t\t\tresult.length = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult = new <int>[];\n\t\t\t}\n\t\t\tif(!this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"getVisibleIndicesAtScrollPosition() may be called only if useVirtualLayout is true.\");\n\t\t\t}\n\n\t\t\tthis.prepareTypicalItem(width - this._paddingLeft - this._paddingRight);\n\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\t\t\tvar gap:Number = this._gap;\n\n\t\t\tvar resultLastIndex:int = 0;\n\n\t\t\tvar totalItemHeight:Number = itemCount * (calculatedTypicalItemHeight + gap) - gap;\n\n\t\t\t//the actual code that figures out which items are visible assumes\n\t\t\t//that alignment is top. to make it work with other alignments, we\n\t\t\t//can simply adjust the scroll position!\n\t\t\tif(this._verticalAlign === VerticalAlign.MIDDLE)\n\t\t\t{\n\t\t\t\tscrollY -= Math.round(this._paddingTop + (height - calculatedTypicalItemHeight) / 2);\n\t\t\t}\n\t\t\telse if(this._verticalAlign === VerticalAlign.BOTTOM)\n\t\t\t{\n\t\t\t\tscrollY -= (height - calculatedTypicalItemHeight - this._paddingBottom);\n\t\t\t}\n\t\t\telse //top\n\t\t\t{\n\t\t\t\tscrollY -= this._paddingTop;\n\t\t\t}\n\n\t\t\t//we add one extra here because the first item renderer in view may\n\t\t\t//be partially obscured, which would reveal an extra item renderer.\n\t\t\tvar maxVisibleTypicalItemCount:int = Math.ceil(height / (calculatedTypicalItemHeight + gap)) + 1;\n\t\t\tvar minTotalHeightForRepeat:Number = maxVisibleTypicalItemCount * (calculatedTypicalItemHeight + gap) - gap;\n\t\t\tvar canRepeatItems:Boolean = this._repeatItems && totalItemHeight >= minTotalHeightForRepeat;\n\t\t\tif(canRepeatItems)\n\t\t\t{\n\t\t\t\t//if we're repeating, then there's an extra gap\n\t\t\t\ttotalItemHeight += gap;\n\t\t\t\tscrollY %= totalItemHeight;\n\t\t\t\tif(scrollY < 0)\n\t\t\t\t{\n\t\t\t\t\tscrollY += totalItemHeight;\n\t\t\t\t}\n\t\t\t\tvar minimum:int = scrollY / (calculatedTypicalItemHeight + gap);\n\t\t\t\tvar maximum:int = minimum + maxVisibleTypicalItemCount;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tminimum = scrollY / (calculatedTypicalItemHeight + gap);\n\t\t\t\tif(minimum < 0)\n\t\t\t\t{\n\t\t\t\t\tminimum = 0;\n\t\t\t\t}\n\t\t\t\t//if we're scrolling beyond the final item, we should keep the\n\t\t\t\t//indices consistent so that items aren't destroyed and\n\t\t\t\t//recreated unnecessarily\n\t\t\t\tmaximum = minimum + maxVisibleTypicalItemCount;\n\t\t\t\tif(maximum >= itemCount)\n\t\t\t\t{\n\t\t\t\t\tmaximum = itemCount - 1;\n\t\t\t\t}\n\t\t\t\tminimum = maximum - maxVisibleTypicalItemCount;\n\t\t\t\tif(minimum < 0)\n\t\t\t\t{\n\t\t\t\t\tminimum = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(var i:int = minimum; i <= maximum; i++)\n\t\t\t{\n\t\t\t\tif(!canRepeatItems || (i >= 0 && i < itemCount))\n\t\t\t\t{\n\t\t\t\t\tresult[resultLastIndex] = i;\n\t\t\t\t}\n\t\t\t\telse if(i < 0)\n\t\t\t\t{\n\t\t\t\t\tresult[resultLastIndex] = itemCount + i;\n\t\t\t\t}\n\t\t\t\telse if(i >= itemCount)\n\t\t\t\t{\n\t\t\t\t\tvar loopedI:int = i - itemCount;\n\t\t\t\t\tif(loopedI == minimum)\n\t\t\t\t\t{\n\t\t\t\t\t\t//we don't want to repeat items!\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tresult[resultLastIndex] = loopedI;\n\t\t\t\t}\n\t\t\t\tresultLastIndex++;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function calculateNavigationDestination(items:Vector.<DisplayObject>, index:int, keyCode:uint, bounds:LayoutBoundsResult):int\n\t\t{\n\t\t\tvar itemArrayCount:int = items.length;\n\t\t\tvar itemCount:int = itemArrayCount + this._afterVirtualizedItemCount;\n\t\t\tif(this._beforeVirtualizedItemCount > 0)\n\t\t\t{\n\t\t\t\titemCount += this._beforeVirtualizedItemCount;\n\t\t\t}\n\t\t\tvar result:int = index;\n\t\t\tif(keyCode == Keyboard.HOME)\n\t\t\t{\n\t\t\t\tif(itemCount > 0)\n\t\t\t\t{\n\t\t\t\t\tresult = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.END)\n\t\t\t{\n\t\t\t\tresult = itemCount - 1;\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.PAGE_UP)\n\t\t\t{\n\t\t\t\tvar yPosition:Number = 0;\n\t\t\t\tfor(var i:int = index; i >= 0; i--)\n\t\t\t\t{\n\t\t\t\t\tyPosition += this.snapInterval;\n\t\t\t\t\tif(yPosition > bounds.viewPortHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tyPosition += this._gap;\n\t\t\t\t\tresult = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.PAGE_DOWN)\n\t\t\t{\n\t\t\t\tyPosition = 0;\n\t\t\t\tfor(i = index; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\tyPosition += this.snapInterval;\n\t\t\t\t\tif(yPosition > bounds.viewPortHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tyPosition += this._gap;\n\t\t\t\t\tresult = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.UP)\n\t\t\t{\n\t\t\t\tresult--;\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.DOWN)\n\t\t\t{\n\t\t\t\tresult++;\n\t\t\t}\n\t\t\tvar canRepeatItems:Boolean = this._repeatItems && bounds.contentHeight == Number.POSITIVE_INFINITY;\n\t\t\tif(canRepeatItems)\n\t\t\t{\n\t\t\t\twhile(result < 0)\n\t\t\t\t{\n\t\t\t\t\tresult += itemCount;\n\t\t\t\t}\n\t\t\t\twhile(result >= itemCount)\n\t\t\t\t{\n\t\t\t\t\tresult -= itemCount;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(result < 0)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tif(result >= itemCount)\n\t\t\t{\n\t\t\t\treturn itemCount - 1;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getNearestScrollPositionForIndex(index:int, scrollX:Number, scrollY:Number, items:Vector.<DisplayObject>,\n\t\t\tx:Number, y:Number, width:Number, height:Number, result:Point = null):Point\n\t\t{\n\t\t\t//normally, this isn't acceptable, but because the selection is\n\t\t\t//based on the scroll position, it must work this way.\n\t\t\treturn this.getScrollPositionForIndex(index, items, x, y, width, height, result);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getScrollPositionForIndex(index:int, items:Vector.<DisplayObject>, x:Number, y:Number, width:Number, height:Number, result:Point = null):Point\n\t\t{\n\t\t\tthis.prepareTypicalItem(width - this._paddingLeft - this._paddingRight);\n\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\t\t\tresult.x = 0;\n\t\t\tresult.y = calculatedTypicalItemHeight * index;\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function validateItems(items:Vector.<DisplayObject>, justifyWidth:Number, distributedHeight:Number):void\n\t\t{\n\t\t\t//if the alignment is justified, then we want to set the width of\n\t\t\t//each item before validating because setting one dimension may\n\t\t\t//cause the other dimension to change, and that will invalidate the\n\t\t\t//layout if it happens after validation, causing more invalidation\n\t\t\tvar isJustified:Boolean = this._horizontalAlign == HorizontalAlign.JUSTIFY;\n\t\t\tvar mustSetJustifyWidth:Boolean = isJustified && justifyWidth === justifyWidth; //!isNaN\n\t\t\tvar itemCount:int = items.length;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:DisplayObject = items[i];\n\t\t\t\tif(!item || (item is ILayoutDisplayObject && !ILayoutDisplayObject(item).includeInLayout))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(mustSetJustifyWidth)\n\t\t\t\t{\n\t\t\t\t\titem.width = justifyWidth;\n\t\t\t\t}\n\t\t\t\telse if(isJustified && item is IFeathersControl)\n\t\t\t\t{\n\t\t\t\t\t//the alignment is justified, but we don't yet have a width\n\t\t\t\t\t//to use, so we need to ensure that we accurately measure\n\t\t\t\t\t//the items instead of using an old justified width that may\n\t\t\t\t\t//be wrong now!\n\t\t\t\t\titem.width = NaN;\n\t\t\t\t}\n\t\t\t\tif(item is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(item).validate();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function prepareTypicalItem(justifyWidth:Number):void\n\t\t{\n\t\t\tif(!this._typicalItem)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._horizontalAlign == HorizontalAlign.JUSTIFY &&\n\t\t\t\tjustifyWidth === justifyWidth) //!isNaN\n\t\t\t{\n\t\t\t\tthis._typicalItem.width = justifyWidth;\n\t\t\t}\n\t\t\telse if(this._resetTypicalItemDimensionsOnMeasure)\n\t\t\t{\n\t\t\t\tthis._typicalItem.width = this._typicalItemWidth;\n\t\t\t}\n\t\t\tif(this._resetTypicalItemDimensionsOnMeasure)\n\t\t\t{\n\t\t\t\tthis._typicalItem.height = this._typicalItemHeight;\n\t\t\t}\n\t\t\tif(this._typicalItem is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this._typicalItem).validate();\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/ViewPortBounds.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\t/**\n\t * Used by layout algorithms for determining the bounds in which to position\n\t * and size items.\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class ViewPortBounds\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function ViewPortBounds()\n\t\t{\n\n\t\t}\n\n\t\t/**\n\t\t * The x position of the view port, in pixels.\n\t\t */\n\t\tpublic var x:Number = 0;\n\n\t\t/**\n\t\t * The y position of the view port, in pixels.\n\t\t */\n\t\tpublic var y:Number = 0;\n\n\t\t/**\n\t\t * The horizontal scroll position of the view port, in pixels.\n\t\t */\n\t\tpublic var scrollX:Number = 0;\n\n\t\t/**\n\t\t * The vertical scroll position of the view port, in pixels.\n\t\t */\n\t\tpublic var scrollY:Number = 0;\n\n\t\t/**\n\t\t * The explicit width of the view port, in pixels. If <code>NaN</code>,\n\t\t * there is no explicit width value.\n\t\t */\n\t\tpublic var explicitWidth:Number = NaN;\n\n\t\t/**\n\t\t * The explicit height of the view port, in pixels. If <code>NaN</code>,\n\t\t * there is no explicit height value.\n\t\t */\n\t\tpublic var explicitHeight:Number = NaN;\n\n\t\t/**\n\t\t * The minimum width of the view port, in pixels. Should be 0 or\n\t\t * a positive number less than infinity.\n\t\t */\n\t\tpublic var minWidth:Number = 0;\n\n\t\t/**\n\t\t * The minimum width of the view port, in pixels. Should be 0 or\n\t\t * a positive number less than infinity.\n\t\t */\n\t\tpublic var minHeight:Number = 0;\n\n\t\t/**\n\t\t * The maximum width of the view port, in pixels. Should be 0 or\n\t\t * a positive number, including infinity.\n\t\t */\n\t\tpublic var maxWidth:Number = Number.POSITIVE_INFINITY;\n\n\t\t/**\n\t\t * The maximum height of the view port, in pixels. Should be 0 or\n\t\t * a positive number, including infinity.\n\t\t */\n\t\tpublic var maxHeight:Number = Number.POSITIVE_INFINITY;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/layout/WaterfallLayout.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.layout\n{\n\timport feathers.core.IValidating;\n\n\timport flash.errors.IllegalOperationError;\n\timport flash.geom.Point;\n\timport flash.ui.Keyboard;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t/**\n\t * Dispatched when a property of the layout changes, indicating that a\n\t * redraw is probably needed.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * A layout with multiple columns of equal width where items may have\n\t * variable heights. Items are added to the layout in order, but they may be\n\t * added to any of the available columns. The layout selects the column\n\t * where the column's height plus the item's height will result in the\n\t * smallest possible total height.\n\t *\n\t * @see ../../../help/waterfall-layout.html How to use WaterfallLayout with Feathers containers\n\t *\n\t * @productversion Feathers 2.2.0\n\t */\n\tpublic class WaterfallLayout extends BaseVariableVirtualLayout implements IVariableVirtualLayout\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function WaterfallLayout()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis._hasVariableItemDimensions = true;\n\t\t}\n\n\t\t/**\n\t\t * Quickly sets both <code>horizontalGap</code> and <code>verticalGap</code>\n\t\t * to the same value. The <code>gap</code> getter always returns the\n\t\t * value of <code>horizontalGap</code>, but the value of\n\t\t * <code>verticalGap</code> may be different.\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #horizontalGap\n\t\t * @see #verticalGap\n\t\t */\n\t\tpublic function get gap():Number\n\t\t{\n\t\t\treturn this._horizontalGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set gap(value:Number):void\n\t\t{\n\t\t\tthis.horizontalGap = value;\n\t\t\tthis.verticalGap = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalGap:Number = 0;\n\n\t\t/**\n\t\t * The horizontal space, in pixels, between columns.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get horizontalGap():Number\n\t\t{\n\t\t\treturn this._horizontalGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalGap(value:Number):void\n\t\t{\n\t\t\tif(this._horizontalGap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalGap = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _verticalGap:Number = 0;\n\n\t\t/**\n\t\t * The vertical space, in pixels, between items in a column.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get verticalGap():Number\n\t\t{\n\t\t\treturn this._verticalGap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set verticalGap(value:Number):void\n\t\t{\n\t\t\tif(this._verticalGap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalGap = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * Quickly sets all padding properties to the same value. The\n\t\t * <code>padding</code> getter always returns the value of\n\t\t * <code>paddingTop</code>, but the other padding values may be\n\t\t * different.\n\t\t *\n\t\t * @default 0\n\t\t *\n\t\t * @see #paddingTop\n\t\t * @see #paddingRight\n\t\t * @see #paddingBottom\n\t\t * @see #paddingLeft\n\t\t */\n\t\tpublic function get padding():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set padding(value:Number):void\n\t\t{\n\t\t\tthis.paddingTop = value;\n\t\t\tthis.paddingRight = value;\n\t\t\tthis.paddingBottom = value;\n\t\t\tthis.paddingLeft = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingTop:Number = 0;\n\n\t\t/**\n\t\t * The space, in pixels, that appears on top, above the items.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingTop():Number\n\t\t{\n\t\t\treturn this._paddingTop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingTop(value:Number):void\n\t\t{\n\t\t\tif(this._paddingTop == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingTop = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingRight:Number = 0;\n\n\t\t/**\n\t\t * The minimum space, in pixels, to the right of the items.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingRight():Number\n\t\t{\n\t\t\treturn this._paddingRight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingRight(value:Number):void\n\t\t{\n\t\t\tif(this._paddingRight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingRight = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingBottom:Number = 0;\n\n\t\t/**\n\t\t * The space, in pixels, that appears on the bottom, below the items.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingBottom():Number\n\t\t{\n\t\t\treturn this._paddingBottom;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingBottom(value:Number):void\n\t\t{\n\t\t\tif(this._paddingBottom == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingBottom = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _paddingLeft:Number = 0;\n\n\t\t/**\n\t\t * The minimum space, in pixels, to the left of the items.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get paddingLeft():Number\n\t\t{\n\t\t\treturn this._paddingLeft;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set paddingLeft(value:Number):void\n\t\t{\n\t\t\tif(this._paddingLeft == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._paddingLeft = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _horizontalAlign:String = HorizontalAlign.CENTER;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"left,center,right\")]\n\t\t/**\n\t\t * The alignment of the items horizontally, on the x-axis.\n\t\t *\n\t\t * <p><strong>Note:</strong> The <code>HorizontalAlign.JUSTIFY</code>\n\t\t * constant is not supported.</p>\n\t\t *\n\t\t * @default feathers.layout.HorizontalAlign.CENTER\n\t\t *\n\t\t * @see feathers.layout.HorizontalAlign#LEFT\n\t\t * @see feathers.layout.HorizontalAlign#CENTER\n\t\t * @see feathers.layout.HorizontalAlign#RIGHT\n\t\t */\n\t\tpublic function get horizontalAlign():String\n\t\t{\n\t\t\treturn this._horizontalAlign;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set horizontalAlign(value:String):void\n\t\t{\n\t\t\tif(this._horizontalAlign == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalAlign = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _requestedColumnCount:int = 0;\n\n\t\t/**\n\t\t * Requests that the layout uses a specific number of columns, if\n\t\t * possible. Set to <code>0</code> to calculate the maximum of columns\n\t\t * that will fit in the available space.\n\t\t *\n\t\t * <p>If the view port's explicit or maximum width is not large enough\n\t\t * to fit the requested number of columns, it will use fewer. If the\n\t\t * view port doesn't have an explicit width and the maximum width is\n\t\t * equal to <code>Number.POSITIVE_INFINITY</code>, the width will be\n\t\t * calculated automatically to fit the exact number of requested\n\t\t * columns.</p>\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get requestedColumnCount():int\n\t\t{\n\t\t\treturn this._requestedColumnCount;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set requestedColumnCount(value:int):void\n\t\t{\n\t\t\tif(value < 0)\n\t\t\t{\n\t\t\t\tthrow RangeError(\"requestedColumnCount requires a value >= 0\");\n\t\t\t}\n\t\t\tif(this._requestedColumnCount == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._requestedColumnCount = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _heightCache:Array = [];\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function layout(items:Vector.<DisplayObject>, viewPortBounds:ViewPortBounds = null, result:LayoutBoundsResult = null):LayoutBoundsResult\n\t\t{\n\t\t\tvar boundsX:Number = viewPortBounds ? viewPortBounds.x : 0;\n\t\t\tvar boundsY:Number = viewPortBounds ? viewPortBounds.y : 0;\n\t\t\tvar minWidth:Number = viewPortBounds ? viewPortBounds.minWidth : 0;\n\t\t\tvar minHeight:Number = viewPortBounds ? viewPortBounds.minHeight : 0;\n\t\t\tvar maxWidth:Number = viewPortBounds ? viewPortBounds.maxWidth : Number.POSITIVE_INFINITY;\n\t\t\tvar maxHeight:Number = viewPortBounds ? viewPortBounds.maxHeight : Number.POSITIVE_INFINITY;\n\t\t\tvar explicitWidth:Number = viewPortBounds ? viewPortBounds.explicitWidth : NaN;\n\t\t\tvar explicitHeight:Number = viewPortBounds ? viewPortBounds.explicitHeight : NaN;\n\n\t\t\tvar needsWidth:Boolean = explicitWidth !== explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = explicitHeight !== explicitHeight; //isNaN\n\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\t//if the layout is virtualized, we'll need the dimensions of the\n\t\t\t\t//typical item so that we have fallback values when an item is null\n\t\t\t\tif(this._typicalItem is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this._typicalItem).validate();\n\t\t\t\t}\n\t\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\t\t\t}\n\n\t\t\tvar columnWidth:Number = 0;\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tcolumnWidth = calculatedTypicalItemWidth;\n\t\t\t}\n\t\t\telse if(items.length > 0)\n\t\t\t{\n\t\t\t\tvar item:DisplayObject = items[0];\n\t\t\t\tif(item is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(item).validate();\n\t\t\t\t}\n\t\t\t\tcolumnWidth = item.width;\n\t\t\t}\n\t\t\tvar availableWidth:Number = explicitWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tif(maxWidth < Number.POSITIVE_INFINITY)\n\t\t\t\t{\n\t\t\t\t\tavailableWidth = maxWidth;\n\t\t\t\t}\n\t\t\t\telse if(this._requestedColumnCount > 0)\n\t\t\t\t{\n\t\t\t\t\tavailableWidth = ((columnWidth + this._horizontalGap) * this._requestedColumnCount) - this._horizontalGap;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tavailableWidth = columnWidth;\n\t\t\t\t}\n\t\t\t\tavailableWidth += this._paddingLeft + this._paddingRight;\n\t\t\t\tif(availableWidth < minWidth)\n\t\t\t\t{\n\t\t\t\t\tavailableWidth = minWidth;\n\t\t\t\t}\n\t\t\t\telse if(availableWidth > maxWidth)\n\t\t\t\t{\n\t\t\t\t\tavailableWidth = maxWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar columnCount:int = int((availableWidth + this._horizontalGap - this._paddingLeft - this._paddingRight) / (columnWidth + this._horizontalGap));\n\t\t\tif(this._requestedColumnCount > 0 && columnCount > this._requestedColumnCount)\n\t\t\t{\n\t\t\t\tcolumnCount = this._requestedColumnCount;\n\t\t\t}\n\t\t\telse if(columnCount < 1)\n\t\t\t{\n\t\t\t\tcolumnCount = 1;\n\t\t\t}\n\t\t\tvar columnHeights:Vector.<Number> = new <Number>[];\n\t\t\tfor(var i:int = 0; i < columnCount; i++)\n\t\t\t{\n\t\t\t\tcolumnHeights[i] = this._paddingTop;\n\t\t\t}\n\t\t\tcolumnHeights.fixed = true;\n\n\t\t\tvar horizontalAlignOffset:Number = 0;\n\t\t\tif(this._horizontalAlign == HorizontalAlign.RIGHT)\n\t\t\t{\n\t\t\t\thorizontalAlignOffset = (availableWidth - this._paddingLeft - this._paddingRight) - ((columnCount * (columnWidth + this._horizontalGap)) - this._horizontalGap);\n\t\t\t}\n\t\t\telse if(this._horizontalAlign == HorizontalAlign.CENTER)\n\t\t\t{\n\t\t\t\thorizontalAlignOffset = Math.round(((availableWidth - this._paddingLeft - this._paddingRight) - ((columnCount * (columnWidth + this._horizontalGap)) - this._horizontalGap)) / 2);\n\t\t\t}\n\n\t\t\tvar itemCount:int = items.length;\n\t\t\tvar targetColumnIndex:int = 0;\n\t\t\tvar targetColumnHeight:Number = columnHeights[targetColumnIndex];\n\t\t\tfor(i = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\titem = items[i];\n\t\t\t\tif(this._useVirtualLayout && this._hasVariableItemDimensions)\n\t\t\t\t{\n\t\t\t\t\tvar cachedHeight:Number = this._heightCache[i];\n\t\t\t\t}\n\t\t\t\tif(this._useVirtualLayout && !item)\n\t\t\t\t{\n\t\t\t\t\tif(!this._hasVariableItemDimensions ||\n\t\t\t\t\t\tcachedHeight !== cachedHeight) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\t//if all items must have the same height, we will\n\t\t\t\t\t\t//use the height of the typical item (calculatedTypicalItemHeight).\n\n\t\t\t\t\t\t//if items may have different heights, we first check\n\t\t\t\t\t\t//the cache for a height value. if there isn't one, then\n\t\t\t\t\t\t//we'll use calculatedTypicalItemHeight as a fallback.\n\t\t\t\t\t\tvar itemHeight:Number = calculatedTypicalItemHeight;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\titemHeight = cachedHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(item is ILayoutDisplayObject)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar layoutItem:ILayoutDisplayObject = ILayoutDisplayObject(item);\n\t\t\t\t\t\tif(!layoutItem.includeInLayout)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(item is IValidating)\n\t\t\t\t\t{\n\t\t\t\t\t\tIValidating(item).validate();\n\t\t\t\t\t}\n\t\t\t\t\t//first, scale the items to fit into the column width\n\t\t\t\t\tvar scaleFactor:Number = columnWidth / item.width;\n\t\t\t\t\titem.width *= scaleFactor;\n\t\t\t\t\tif(item is IValidating)\n\t\t\t\t\t{\n\t\t\t\t\t\t//if we changed the width, we need to recalculate the\n\t\t\t\t\t\t//height.\n\t\t\t\t\t\tIValidating(item).validate();\n\t\t\t\t\t}\n\t\t\t\t\tif(this._useVirtualLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._hasVariableItemDimensions)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titemHeight = item.height;\n\t\t\t\t\t\t\tif(itemHeight != cachedHeight)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//update the cache if needed. this will notify\n\t\t\t\t\t\t\t\t//the container that the virtualized layout has\n\t\t\t\t\t\t\t\t//changed, and it the view port may need to be\n\t\t\t\t\t\t\t\t//re-measured.\n\t\t\t\t\t\t\t\tthis._heightCache[i] = itemHeight;\n\t\t\t\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.height = itemHeight = calculatedTypicalItemHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\titemHeight = item.height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttargetColumnHeight += itemHeight;\n\t\t\t\tfor(var j:int = 0; j < columnCount; j++)\n\t\t\t\t{\n\t\t\t\t\tif(j == targetColumnIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tvar columnHeight:Number = columnHeights[j] + itemHeight;\n\t\t\t\t\tif(columnHeight < targetColumnHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\ttargetColumnIndex = j;\n\t\t\t\t\t\ttargetColumnHeight = columnHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(item)\n\t\t\t\t{\n\t\t\t\t\titem.x = item.pivotX + boundsX + horizontalAlignOffset + this._paddingLeft + targetColumnIndex * (columnWidth + this._horizontalGap);\n\t\t\t\t\titem.y = item.pivotY + boundsY + targetColumnHeight - itemHeight;\n\t\t\t\t}\n\t\t\t\ttargetColumnHeight += this._verticalGap;\n\t\t\t\tcolumnHeights[targetColumnIndex] = targetColumnHeight;\n\t\t\t}\n\t\t\tvar totalHeight:Number = columnHeights[0];\n\t\t\tfor(i = 1; i < columnCount; i++)\n\t\t\t{\n\t\t\t\tcolumnHeight = columnHeights[i];\n\t\t\t\tif(columnHeight > totalHeight)\n\t\t\t\t{\n\t\t\t\t\ttotalHeight = columnHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttotalHeight -= this._verticalGap;\n\t\t\ttotalHeight += this._paddingBottom;\n\t\t\tif(totalHeight < 0)\n\t\t\t{\n\t\t\t\ttotalHeight = 0;\n\t\t\t}\n\n\t\t\tvar availableHeight:Number = explicitHeight;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tavailableHeight = totalHeight;\n\t\t\t\tif(availableHeight < minHeight)\n\t\t\t\t{\n\t\t\t\t\tavailableHeight = minHeight;\n\t\t\t\t}\n\t\t\t\telse if(availableHeight > maxHeight)\n\t\t\t\t{\n\t\t\t\t\tavailableHeight = maxHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//finally, we want to calculate the result so that the container\n\t\t\t//can use it to adjust its viewport and determine the minimum and\n\t\t\t//maximum scroll positions (if needed)\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new LayoutBoundsResult();\n\t\t\t}\n\t\t\tresult.contentX = 0;\n\t\t\tresult.contentWidth = availableWidth;\n\t\t\tresult.contentY = 0;\n\t\t\tresult.contentHeight = totalHeight;\n\t\t\tresult.viewPortWidth = availableWidth;\n\t\t\tresult.viewPortHeight = availableHeight;\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function measureViewPort(itemCount:int, viewPortBounds:ViewPortBounds = null, result:Point = null):Point\n\t\t{\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\t\t\tif(!this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"measureViewPort() may be called only if useVirtualLayout is true.\");\n\t\t\t}\n\n\t\t\tvar explicitWidth:Number = viewPortBounds ? viewPortBounds.explicitWidth : NaN;\n\t\t\tvar explicitHeight:Number = viewPortBounds ? viewPortBounds.explicitHeight : NaN;\n\n\t\t\tvar needsWidth:Boolean = explicitWidth !== explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = explicitHeight !== explicitHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight)\n\t\t\t{\n\t\t\t\tresult.x = explicitWidth;\n\t\t\t\tresult.y = explicitHeight;\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tvar minWidth:Number = viewPortBounds ? viewPortBounds.minWidth : 0;\n\t\t\tvar minHeight:Number = viewPortBounds ? viewPortBounds.minHeight : 0;\n\t\t\tvar maxWidth:Number = viewPortBounds ? viewPortBounds.maxWidth : Number.POSITIVE_INFINITY;\n\t\t\tvar maxHeight:Number = viewPortBounds ? viewPortBounds.maxHeight : Number.POSITIVE_INFINITY;\n\n\t\t\tif(this._typicalItem is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this._typicalItem).validate();\n\t\t\t}\n\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\n\t\t\tvar columnWidth:Number = calculatedTypicalItemWidth;\n\t\t\tvar availableWidth:Number = explicitWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tif(maxWidth < Number.POSITIVE_INFINITY)\n\t\t\t\t{\n\t\t\t\t\tavailableWidth = maxWidth;\n\t\t\t\t}\n\t\t\t\telse if(this._requestedColumnCount > 0)\n\t\t\t\t{\n\t\t\t\t\tavailableWidth = ((columnWidth + this._horizontalGap) * this._requestedColumnCount) - this._horizontalGap;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tavailableWidth = columnWidth;\n\t\t\t\t}\n\t\t\t\tavailableWidth += this._paddingLeft + this._paddingRight;\n\t\t\t\tif(availableWidth < minWidth)\n\t\t\t\t{\n\t\t\t\t\tavailableWidth = minWidth;\n\t\t\t\t}\n\t\t\t\telse if(availableWidth > maxWidth)\n\t\t\t\t{\n\t\t\t\t\tavailableWidth = maxWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar columnCount:int = int((availableWidth + this._horizontalGap - this._paddingLeft - this._paddingRight) / (columnWidth + this._horizontalGap));\n\t\t\tif(this._requestedColumnCount > 0 && columnCount > this._requestedColumnCount)\n\t\t\t{\n\t\t\t\tcolumnCount = this._requestedColumnCount;\n\t\t\t}\n\t\t\telse if(columnCount < 1)\n\t\t\t{\n\t\t\t\tcolumnCount = 1;\n\t\t\t}\n\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tresult.x = this._paddingLeft + this._paddingRight + (columnCount * (columnWidth + this._horizontalGap)) - this._horizontalGap;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult.x = explicitWidth;\n\t\t\t}\n\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tif(this._hasVariableItemDimensions)\n\t\t\t\t{\n\t\t\t\t\tvar columnHeights:Vector.<Number> = new <Number>[];\n\t\t\t\t\tfor(var i:int = 0; i < columnCount; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tcolumnHeights[i] = this._paddingTop;\n\t\t\t\t\t}\n\t\t\t\t\tcolumnHeights.fixed = true;\n\n\t\t\t\t\tvar targetColumnIndex:int = 0;\n\t\t\t\t\tvar targetColumnHeight:Number = columnHeights[targetColumnIndex];\n\t\t\t\t\tfor(i = 0; i < itemCount; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._hasVariableItemDimensions)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar itemHeight:Number = this._heightCache[i];\n\t\t\t\t\t\t\tif(itemHeight !== itemHeight) //isNaN\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\titemHeight = calculatedTypicalItemHeight;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titemHeight = calculatedTypicalItemHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttargetColumnHeight += itemHeight;\n\t\t\t\t\t\tfor(var j:int = 0; j < columnCount; j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(j == targetColumnIndex)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar columnHeight:Number = columnHeights[j] + itemHeight;\n\t\t\t\t\t\t\tif(columnHeight < targetColumnHeight)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttargetColumnIndex = j;\n\t\t\t\t\t\t\t\ttargetColumnHeight = columnHeight;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttargetColumnHeight += this._verticalGap;\n\t\t\t\t\t\tcolumnHeights[targetColumnIndex] = targetColumnHeight;\n\t\t\t\t\t}\n\t\t\t\t\tvar totalHeight:Number = columnHeights[0];\n\t\t\t\t\tfor(i = 1; i < columnCount; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tcolumnHeight = columnHeights[i];\n\t\t\t\t\t\tif(columnHeight > totalHeight)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttotalHeight = columnHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\ttotalHeight -= this._verticalGap;\n\t\t\t\t\ttotalHeight += this._paddingBottom;\n\t\t\t\t\tif(totalHeight < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\ttotalHeight = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif(totalHeight < minHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\ttotalHeight = minHeight;\n\t\t\t\t\t}\n\t\t\t\t\telse if(totalHeight > maxHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\ttotalHeight = maxHeight;\n\t\t\t\t\t}\n\t\t\t\t\tresult.y = totalHeight;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tresult.y = this._paddingTop + this._paddingBottom + (Math.ceil(itemCount / columnCount) * (calculatedTypicalItemHeight + this._verticalGap)) - this._verticalGap;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult.y = explicitHeight;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getVisibleIndicesAtScrollPosition(scrollX:Number, scrollY:Number, width:Number, height:Number, itemCount:int, result:Vector.<int> = null):Vector.<int>\n\t\t{\n\t\t\tif(result)\n\t\t\t{\n\t\t\t\tresult.length = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult = new <int>[];\n\t\t\t}\n\t\t\tif(!this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"getVisibleIndicesAtScrollPosition() may be called only if useVirtualLayout is true.\");\n\t\t\t}\n\n\t\t\tif(this._typicalItem is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this._typicalItem).validate();\n\t\t\t}\n\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\n\t\t\tvar columnWidth:Number = calculatedTypicalItemWidth;\n\t\t\tvar columnCount:int = int((width + this._horizontalGap - this._paddingLeft - this._paddingRight) / (columnWidth + this._horizontalGap));\n\t\t\tif(this._requestedColumnCount > 0 && columnCount > this._requestedColumnCount)\n\t\t\t{\n\t\t\t\tcolumnCount = this._requestedColumnCount;\n\t\t\t}\n\t\t\telse if(columnCount < 1)\n\t\t\t{\n\t\t\t\tcolumnCount = 1;\n\t\t\t}\n\t\t\tvar resultLastIndex:int = 0;\n\t\t\tif(this._hasVariableItemDimensions)\n\t\t\t{\n\t\t\t\tvar columnHeights:Vector.<Number> = new <Number>[];\n\t\t\t\tfor(var i:int = 0; i < columnCount; i++)\n\t\t\t\t{\n\t\t\t\t\tcolumnHeights[i] = this._paddingTop;\n\t\t\t\t}\n\t\t\t\tcolumnHeights.fixed = true;\n\n\t\t\t\tvar maxPositionY:Number = scrollY + height;\n\t\t\t\tvar targetColumnIndex:int = 0;\n\t\t\t\tvar targetColumnHeight:Number = columnHeights[targetColumnIndex];\n\t\t\t\tfor(i = 0; i < itemCount; i++)\n\t\t\t\t{\n\t\t\t\t\tif(this._hasVariableItemDimensions)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar itemHeight:Number = this._heightCache[i];\n\t\t\t\t\t\tif(itemHeight !== itemHeight) //isNaN\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titemHeight = calculatedTypicalItemHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\titemHeight = calculatedTypicalItemHeight;\n\t\t\t\t\t}\n\t\t\t\t\ttargetColumnHeight += itemHeight;\n\t\t\t\t\tfor(var j:int = 0; j < columnCount; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(j == targetColumnIndex)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar columnHeight:Number = columnHeights[j] + itemHeight;\n\t\t\t\t\t\tif(columnHeight < targetColumnHeight)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttargetColumnIndex = j;\n\t\t\t\t\t\t\ttargetColumnHeight = columnHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(targetColumnHeight > scrollY && (targetColumnHeight - itemHeight) < maxPositionY)\n\t\t\t\t\t{\n\t\t\t\t\t\tresult[resultLastIndex] = i;\n\t\t\t\t\t\tresultLastIndex++;\n\t\t\t\t\t}\n\t\t\t\t\ttargetColumnHeight += this._verticalGap;\n\t\t\t\t\tcolumnHeights[targetColumnIndex] = targetColumnHeight;\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\t//this case can be optimized because we know that every item has\n\t\t\t//the same height\n\n\t\t\t//we add one extra here because the first item renderer in view may\n\t\t\t//be partially obscured, which would reveal an extra item renderer.\n\t\t\tvar maxVisibleTypicalItemCount:int = Math.ceil(height / (calculatedTypicalItemHeight + this._verticalGap)) + 1;\n\t\t\t//we're calculating the minimum and maximum rows\n\t\t\tvar minimum:int = (scrollY - this._paddingTop) / (calculatedTypicalItemHeight + this._verticalGap);\n\t\t\tif(minimum < 0)\n\t\t\t{\n\t\t\t\tminimum = 0;\n\t\t\t}\n\t\t\t//if we're scrolling beyond the final item, we should keep the\n\t\t\t//indices consistent so that items aren't destroyed and\n\t\t\t//recreated unnecessarily\n\t\t\tvar maximum:int = minimum + maxVisibleTypicalItemCount;\n\t\t\tif(maximum >= itemCount)\n\t\t\t{\n\t\t\t\tmaximum = itemCount - 1;\n\t\t\t}\n\t\t\tminimum = maximum - maxVisibleTypicalItemCount;\n\t\t\tif(minimum < 0)\n\t\t\t{\n\t\t\t\tminimum = 0;\n\t\t\t}\n\t\t\tfor(i = minimum; i <= maximum; i++)\n\t\t\t{\n\t\t\t\tfor(j = 0; j < columnCount; j++)\n\t\t\t\t{\n\t\t\t\t\tvar index:int = (i * columnCount) + j;\n\t\t\t\t\tif(index >= 0 && i < itemCount)\n\t\t\t\t\t{\n\t\t\t\t\t\tresult[resultLastIndex] = index;\n\t\t\t\t\t}\n\t\t\t\t\telse if(index < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tresult[resultLastIndex] = itemCount + index;\n\t\t\t\t\t}\n\t\t\t\t\telse if(index >= itemCount)\n\t\t\t\t\t{\n\t\t\t\t\t\tresult[resultLastIndex] = index - itemCount;\n\t\t\t\t\t}\n\t\t\t\t\tresultLastIndex++;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getNearestScrollPositionForIndex(index:int, scrollX:Number, scrollY:Number, items:Vector.<DisplayObject>, x:Number, y:Number, width:Number, height:Number, result:Point = null):Point\n\t\t{\n\t\t\tvar maxScrollY:Number = this.calculateMaxScrollYOfIndex(index, items, x, y, width, height);\n\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tif(this._hasVariableItemDimensions)\n\t\t\t\t{\n\t\t\t\t\tvar itemHeight:Number = this._heightCache[index];\n\t\t\t\t\tif(itemHeight !== itemHeight) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\titemHeight = this._typicalItem.height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\titemHeight = this._typicalItem.height;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\titemHeight = items[index].height;\n\t\t\t}\n\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\t\t\tresult.x = 0;\n\n\t\t\tvar bottomPosition:Number = maxScrollY - (height - itemHeight);\n\t\t\tif(scrollY >= bottomPosition && scrollY <= maxScrollY)\n\t\t\t{\n\t\t\t\t//keep the current scroll position because the item is already\n\t\t\t\t//fully visible\n\t\t\t\tresult.y = scrollY;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar topDifference:Number = Math.abs(maxScrollY - scrollY);\n\t\t\t\tvar bottomDifference:Number = Math.abs(bottomPosition - scrollY);\n\t\t\t\tif(bottomDifference < topDifference)\n\t\t\t\t{\n\t\t\t\t\tresult.y = bottomPosition;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tresult.y = maxScrollY;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function calculateNavigationDestination(items:Vector.<DisplayObject>, index:int, keyCode:uint, bounds:LayoutBoundsResult):int\n\t\t{\n\t\t\tvar result:int = index;\n\t\t\tif(keyCode == Keyboard.HOME)\n\t\t\t{\n\t\t\t\tif(items.length > 0)\n\t\t\t\t{\n\t\t\t\t\tresult = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.END)\n\t\t\t{\n\t\t\t\tresult = items.length - 1;\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.UP)\n\t\t\t{\n\t\t\t\tresult--;\n\t\t\t}\n\t\t\telse if(keyCode == Keyboard.DOWN)\n\t\t\t{\n\t\t\t\tresult++;\n\t\t\t}\n\t\t\tif(result < 0)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tif(result >= items.length)\n\t\t\t{\n\t\t\t\treturn items.length - 1;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function getScrollPositionForIndex(index:int, items:Vector.<DisplayObject>, x:Number, y:Number, width:Number, height:Number, result:Point = null):Point\n\t\t{\n\t\t\tvar maxScrollY:Number = this.calculateMaxScrollYOfIndex(index, items, x, y, width, height);\n\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tif(this._hasVariableItemDimensions)\n\t\t\t\t{\n\t\t\t\t\tvar itemHeight:Number = this._heightCache[index];\n\t\t\t\t\tif(itemHeight !== itemHeight) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\titemHeight = this._typicalItem.height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\titemHeight = this._typicalItem.height;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\titemHeight = items[index].height;\n\t\t\t}\n\n\t\t\tif(!result)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\t\t\tresult.x = 0;\n\t\t\tresult.y = maxScrollY - Math.round((height - itemHeight) / 2);\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function calculateMaxScrollYOfIndex(index:int, items:Vector.<DisplayObject>, x:Number, y:Number, width:Number, height:Number):Number\n\t\t{\n\t\t\tif(items.length == 0)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\t//if the layout is virtualized, we'll need the dimensions of the\n\t\t\t\t//typical item so that we have fallback values when an item is null\n\t\t\t\tif(this._typicalItem is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(this._typicalItem).validate();\n\t\t\t\t}\n\t\t\t\tvar calculatedTypicalItemWidth:Number = this._typicalItem ? this._typicalItem.width : 0;\n\t\t\t\tvar calculatedTypicalItemHeight:Number = this._typicalItem ? this._typicalItem.height : 0;\n\t\t\t}\n\n\t\t\tvar columnWidth:Number = 0;\n\t\t\tif(this._useVirtualLayout)\n\t\t\t{\n\t\t\t\tcolumnWidth = calculatedTypicalItemWidth;\n\t\t\t}\n\t\t\telse if(items.length > 0)\n\t\t\t{\n\t\t\t\tvar item:DisplayObject = items[0];\n\t\t\t\tif(item is IValidating)\n\t\t\t\t{\n\t\t\t\t\tIValidating(item).validate();\n\t\t\t\t}\n\t\t\t\tcolumnWidth = item.width;\n\t\t\t}\n\n\t\t\tvar columnCount:int = int((width + this._horizontalGap - this._paddingLeft - this._paddingRight) / (columnWidth + this._horizontalGap));\n\t\t\tif(this._requestedColumnCount > 0 && columnCount > this._requestedColumnCount)\n\t\t\t{\n\t\t\t\tcolumnCount = this._requestedColumnCount;\n\t\t\t}\n\t\t\telse if(columnCount < 1)\n\t\t\t{\n\t\t\t\tcolumnCount = 1;\n\t\t\t}\n\t\t\tvar columnHeights:Vector.<Number> = new <Number>[];\n\t\t\tfor(var i:int = 0; i < columnCount; i++)\n\t\t\t{\n\t\t\t\tcolumnHeights[i] = this._paddingTop;\n\t\t\t}\n\t\t\tcolumnHeights.fixed = true;\n\n\t\t\tvar itemCount:int = items.length;\n\t\t\tvar targetColumnIndex:int = 0;\n\t\t\tvar targetColumnHeight:Number = columnHeights[targetColumnIndex];\n\t\t\tfor(i = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\titem = items[i];\n\t\t\t\tif(this._useVirtualLayout && this._hasVariableItemDimensions)\n\t\t\t\t{\n\t\t\t\t\tvar cachedHeight:Number = this._heightCache[i];\n\t\t\t\t}\n\t\t\t\tif(this._useVirtualLayout && !item)\n\t\t\t\t{\n\t\t\t\t\tif(!this._hasVariableItemDimensions ||\n\t\t\t\t\t\tcachedHeight !== cachedHeight) //isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\t//if all items must have the same height, we will\n\t\t\t\t\t\t//use the height of the typical item (calculatedTypicalItemHeight).\n\n\t\t\t\t\t\t//if items may have different heights, we first check\n\t\t\t\t\t\t//the cache for a height value. if there isn't one, then\n\t\t\t\t\t\t//we'll use calculatedTypicalItemHeight as a fallback.\n\t\t\t\t\t\tvar itemHeight:Number = calculatedTypicalItemHeight;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\titemHeight = cachedHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(item is ILayoutDisplayObject)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar layoutItem:ILayoutDisplayObject = ILayoutDisplayObject(item);\n\t\t\t\t\t\tif(!layoutItem.includeInLayout)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(item is IValidating)\n\t\t\t\t\t{\n\t\t\t\t\t\tIValidating(item).validate();\n\t\t\t\t\t}\n\t\t\t\t\t//first, scale the items to fit into the column width\n\t\t\t\t\tvar scaleFactor:Number = columnWidth / item.width;\n\t\t\t\t\titem.width *= scaleFactor;\n\t\t\t\t\tif(item is IValidating)\n\t\t\t\t\t{\n\t\t\t\t\t\tIValidating(item).validate();\n\t\t\t\t\t}\n\t\t\t\t\tif(this._useVirtualLayout)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._hasVariableItemDimensions)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titemHeight = item.height;\n\t\t\t\t\t\t\tif(itemHeight != cachedHeight)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis._heightCache[i] = itemHeight;\n\t\t\t\t\t\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem.height = itemHeight = calculatedTypicalItemHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\titemHeight = item.height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttargetColumnHeight += itemHeight;\n\t\t\t\tfor(var j:int = 0; j < columnCount; j++)\n\t\t\t\t{\n\t\t\t\t\tif(j == targetColumnIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tvar columnHeight:Number = columnHeights[j] + itemHeight;\n\t\t\t\t\tif(columnHeight < targetColumnHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\ttargetColumnIndex = j;\n\t\t\t\t\t\ttargetColumnHeight = columnHeight;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(i == index)\n\t\t\t\t{\n\t\t\t\t\treturn targetColumnHeight - itemHeight;\n\t\t\t\t}\n\t\t\t\ttargetColumnHeight += this._verticalGap;\n\t\t\t\tcolumnHeights[targetColumnIndex] = targetColumnHeight;\n\t\t\t}\n\t\t\tvar totalHeight:Number = columnHeights[0];\n\t\t\tfor(i = 1; i < columnCount; i++)\n\t\t\t{\n\t\t\t\tcolumnHeight = columnHeights[i];\n\t\t\t\tif(columnHeight > totalHeight)\n\t\t\t\t{\n\t\t\t\t\ttotalHeight = columnHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttotalHeight -= this._verticalGap;\n\t\t\ttotalHeight += this._paddingBottom;\n\t\t\t//subtracting the height gives us the maximum scroll position\n\t\t\ttotalHeight -= height;\n\t\t\tif(totalHeight < 0)\n\t\t\t{\n\t\t\t\ttotalHeight = 0;\n\t\t\t}\n\t\t\treturn totalHeight;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/media/BaseMediaPlayer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.media\n{\n\timport feathers.controls.LayoutGroup;\n\timport feathers.layout.AnchorLayout;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.DisplayObjectContainer;\n\timport starling.errors.AbstractClassError;\n\timport starling.events.Event;\n\n\t/**\n\t * An abstract superclass for media players that should implement the\n\t * <code>feathers.media.IMediaPlayer</code> interface.\n\t *\n\t * @productversion Feathers 2.2.0\n\t */\n\tpublic class BaseMediaPlayer extends LayoutGroup implements IMediaPlayer\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function BaseMediaPlayer()\n\t\t{\n\t\t\tsuper();\n\t\t\tif(Object(this).constructor === BaseMediaPlayer)\n\t\t\t{\n\t\t\t\tthrow new AbstractClassError();\n\t\t\t}\n\t\t\tthis.addEventListener(Event.ADDED, mediaPlayer_addedHandler);\n\t\t\tthis.addEventListener(Event.REMOVED, mediaPlayer_removedHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tif(this._layout === null)\n\t\t\t{\n\t\t\t\tthis.ignoreNextStyleRestriction();\n\t\t\t\tthis.layout = new AnchorLayout();\n\t\t\t}\n\t\t\tsuper.initialize();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function handleAddedChild(child:DisplayObject):void\n\t\t{\n\t\t\tif(child is IMediaPlayerControl)\n\t\t\t{\n\t\t\t\tIMediaPlayerControl(child).mediaPlayer = this;\n\t\t\t}\n\t\t\tif(child is DisplayObjectContainer)\n\t\t\t{\n\t\t\t\tvar container:DisplayObjectContainer = DisplayObjectContainer(child);\n\t\t\t\tvar childCount:int = container.numChildren;\n\t\t\t\tfor(var i:int = 0; i < childCount; i++)\n\t\t\t\t{\n\t\t\t\t\tchild = container.getChildAt(i);\n\t\t\t\t\tthis.handleAddedChild(child);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function handleRemovedChild(child:DisplayObject):void\n\t\t{\n\t\t\tif(child is IMediaPlayerControl)\n\t\t\t{\n\t\t\t\tIMediaPlayerControl(child).mediaPlayer = null;\n\t\t\t}\n\t\t\tif(child is DisplayObjectContainer)\n\t\t\t{\n\t\t\t\tvar container:DisplayObjectContainer = DisplayObjectContainer(child);\n\t\t\t\tvar childCount:int = container.numChildren;\n\t\t\t\tfor(var i:int = 0; i < childCount; i++)\n\t\t\t\t{\n\t\t\t\t\tchild = container.getChildAt(i);\n\t\t\t\t\tthis.handleRemovedChild(child);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function mediaPlayer_addedHandler(event:Event):void\n\t\t{\n\t\t\tvar addedChild:DisplayObject = DisplayObject(event.target);\n\t\t\tthis.handleAddedChild(addedChild);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function mediaPlayer_removedHandler(event:Event):void\n\t\t{\n\t\t\tvar removedChild:DisplayObject = DisplayObject(event.target);\n\t\t\tthis.handleRemovedChild(removedChild);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/media/BaseTimedMediaPlayer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.media\n{\n\timport feathers.events.MediaPlayerEventType;\n\n\timport starling.errors.AbstractClassError;\n\n\t/**\n\t * Dispatched when the media player's total playhead time changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #totalTime\n\t *\n\t * @eventType feathers.events.MediaPlayerEventType.TOTAL_TIME_CHANGE\n\t */\n\t[Event(name=\"totalTimeChange\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the media player's current playhead time changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #currentTime\n\t *\n\t * @eventType feathers.events.MediaPlayerEventType.CURRENT_TIME_CHANGE\n\t */\n\t[Event(name=\"currentTimeChange\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the media player's playback state changes, such as when\n\t * it begins playing or is paused.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #isPlaying\n\t *\n\t * @eventType feathers.events.MediaPlayerEventType.PLAYBACK_STATE_CHANGE\n\t */\n\t[Event(name=\"playbackStateChange\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the media completes playback because the current time has\n\t * reached the total time.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.COMPLETE\n\t */\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\t/**\n\t * An abstract superclass for media players that should implement the\n\t * <code>feathers.media.ITimedMediaPlayer</code> interface.\n\t *\n\t * @productversion Feathers 2.2.0\n\t */\n\tpublic class BaseTimedMediaPlayer extends BaseMediaPlayer implements ITimedMediaPlayer\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function BaseTimedMediaPlayer()\n\t\t{\n\t\t\tsuper();\n\t\t\tif(Object(this).constructor === BaseTimedMediaPlayer)\n\t\t\t{\n\t\t\t\tthrow new AbstractClassError();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isPlaying:Boolean = false;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @see #event:playbackStateChange feathers.events.MediaPlayerEventType.PLAYBACK_STATE_CHANGE\n\t\t */\n\t\tpublic function get isPlaying():Boolean\n\t\t{\n\t\t\treturn this._isPlaying;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentTime:Number = 0;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @see #event:currentTimeChange feathers.events.MediaPlayerEventType.CURRENT_TIME_CHANGE\n\t\t */\n\t\tpublic function get currentTime():Number\n\t\t{\n\t\t\treturn this._currentTime;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _totalTime:Number = 0;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @see #event:totalTimeChange feathers.events.MediaPlayerEventType.TOTAL_TIME_CHANGE\n\t\t */\n\t\tpublic function get totalTime():Number\n\t\t{\n\t\t\treturn this._totalTime;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @see #isPlaying\n\t\t * @see #play()\n\t\t * @see #pause()\n\t\t */\n\t\tpublic function togglePlayPause():void\n\t\t{\n\t\t\tif(this._isPlaying)\n\t\t\t{\n\t\t\t\tthis.pause();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.play();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @see #isPlaying\n\t\t * @see #pause()\n\t\t * @see #stop()\n\t\t */\n\t\tpublic function play():void\n\t\t{\n\t\t\tif(this._isPlaying)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.playMedia();\n\t\t\tthis._isPlaying = true;\n\t\t\tthis.dispatchEventWith(MediaPlayerEventType.PLAYBACK_STATE_CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @see #isPlaying\n\t\t * @see #play()\n\t\t */\n\t\tpublic function pause():void\n\t\t{\n\t\t\tif(!this._isPlaying)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.pauseMedia();\n\t\t\tthis._isPlaying = false;\n\t\t\tthis.dispatchEventWith(MediaPlayerEventType.PLAYBACK_STATE_CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @see #isPlaying\n\t\t * @see #play()\n\t\t * @see #pause()\n\t\t */\n\t\tpublic function stop():void\n\t\t{\n\t\t\tthis.pause();\n\t\t\tthis.seek(0);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function seek(seconds:Number):void\n\t\t{\n\t\t\tthis.seekMedia(seconds);\n\t\t\tthis.dispatchEventWith(MediaPlayerEventType.CURRENT_TIME_CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * Internal function that starts playing the media content. Subclasses\n\t\t * are expected override this function with a custom implementation for\n\t\t * their specific type of media content.\n\t\t */\n\t\tprotected function playMedia():void\n\t\t{\n\n\t\t}\n\n\t\t/**\n\t\t * Internal function that pauses the media content. Subclasses are\n\t\t * expected override this function with a custom implementation for\n\t\t * their specific type of media content.\n\t\t */\n\t\tprotected function pauseMedia():void\n\t\t{\n\n\t\t}\n\n\t\t/**\n\t\t * Internal function that seeks the media content to a specific playhead\n\t\t * time, in seconds. Subclasses are expected override this function with\n\t\t * a custom implementation for their specific type of media content.\n\t\t */\n\t\tprotected function seekMedia(seconds:Number):void\n\t\t{\n\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/media/FullScreenToggleButton.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.media\n{\n\timport feathers.controls.ToggleButton;\n\timport feathers.events.MediaPlayerEventType;\n\timport feathers.skins.IStyleProvider;\n\n\timport starling.events.Event;\n\n\t/**\n\t * A specialized toggle button that controls whether a media player is\n\t * displayed normally or in full-screen mode.\n\t *\n\t * @see ../../../help/video-player.html How to use the Feathers VideoPlayer component\n\t *\n\t * @productversion Feathers 2.2.0\n\t */\n\tpublic class FullScreenToggleButton extends ToggleButton implements IMediaPlayerControl\n\t{\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all\n\t\t * <code>FullScreenToggleButton</code> components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function FullScreenToggleButton()\n\t\t{\n\t\t\tsuper();\n\t\t\t//we don't actually want this to toggle automatically. instead,\n\t\t\t//we'll update isSelected based on events dispatched by the media\n\t\t\t//player\n\t\t\tthis.isToggle = false;\n\t\t\tthis.addEventListener(Event.TRIGGERED, fullScreenButton_triggeredHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn FullScreenToggleButton.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _mediaPlayer:VideoPlayer;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get mediaPlayer():IMediaPlayer\n\t\t{\n\t\t\treturn this._mediaPlayer;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set mediaPlayer(value:IMediaPlayer):void\n\t\t{\n\t\t\tif(this._mediaPlayer == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._mediaPlayer)\n\t\t\t{\n\t\t\t\tthis._mediaPlayer.removeEventListener(MediaPlayerEventType.DISPLAY_STATE_CHANGE, mediaPlayer_displayStageChangeHandler);\n\t\t\t}\n\t\t\tthis._mediaPlayer = value as VideoPlayer;\n\t\t\tif(this._mediaPlayer)\n\t\t\t{\n\t\t\t\tthis.isSelected = this._mediaPlayer.isFullScreen;\n\t\t\t\tthis._mediaPlayer.addEventListener(MediaPlayerEventType.DISPLAY_STATE_CHANGE, mediaPlayer_displayStageChangeHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function fullScreenButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis._mediaPlayer.toggleFullScreen();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function mediaPlayer_displayStageChangeHandler(event:Event):void\n\t\t{\n\t\t\tthis.isSelected = this._mediaPlayer.isFullScreen;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/media/IAudioPlayer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.media\n{\n\timport flash.media.SoundTransform;\n\n\t/**\n\t * Dispatched when the media player's sound transform changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #soundTransform\n\t *\n\t * @eventType feathers.events.MediaPlayerEventType.SOUND_TRANSFORM_CHANGE\n\t */\n\t[Event(name=\"soundTransformChange\",type=\"starling.events.Event\")]\n\n\t/**\n\t * An interface for media players that play audio content.\n\t *\n\t * @productversion Feathers 2.2.0\n\t */\n\tpublic interface IAudioPlayer extends ITimedMediaPlayer\n\t{\n\t\t/**\n\t\t * Controls properties of the currently playing audio, like volume and\n\t\t * panning.\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/SoundTransform.html flash.media.SoundTransform\n\t\t * @see #event:soundTransformChange feathers.events.MediaPlayerEventType.SOUND_TRANSFORM_CHANGE\n\t\t */\n\t\tfunction get soundTransform():SoundTransform;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set soundTransform(value:SoundTransform):void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/media/IMediaPlayer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.media\n{\n\timport feathers.core.IFeathersEventDispatcher;\n\n\t/**\n\t * A base interface for all types of media players.\n\t *\n\t * @productversion Feathers 2.2.0\n\t */\n\tpublic interface IMediaPlayer extends IFeathersEventDispatcher\n\t{\n\t}\n}\n"
  },
  {
    "path": "source/feathers/media/IMediaPlayerControl.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.media\n{\n\t/**\n\t * An interface for sub-components added to a media player.\n\t *\n\t * @see feathers.media.IMediaPlayer\n\t * @see feathers.media.IAudioPlayer\n\t * @see feathers.media.IVideoPlayer\n\t *\n\t * @productversion Feathers 2.2.0\n\t */\n\tpublic interface IMediaPlayerControl\n\t{\n\t\t/**\n\t\t * The media player that this component controls.\n\t\t */\n\t\tfunction get mediaPlayer():IMediaPlayer;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set mediaPlayer(value:IMediaPlayer):void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/media/IProgressiveMediaPlayer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.media\n{\n\t/**\n\t * Dispatched periodically when a media player's content is loading to\n\t * indicate the current progress. The <code>bytesLoaded</code> and\n\t * <code>bytesTotal</code> properties may be accessed to determine the\n\t * exact number of bytes loaded.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>A numeric value between <code>0</code>\n\t *   and <code>1</code> that indicates how much of the media has loaded so far.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #bytesLoaded\n\t * @see #bytesTotal\n\t *\n\t * @eventType feathers.events.MediaPlayerEventType.LOAD_PROGRESS\n\t */\n\t[Event(name=\"loadProgress\",type=\"starling.events.Event\")]\n\n\t/**\n\t * A media player that loads its content progressively.\n\t *\n\t * @productversion Feathers 2.3.0\n\t */\n\tpublic interface IProgressiveMediaPlayer extends IMediaPlayer\n\t{\n\t\t/**\n\t\t * The number of bytes loaded for the current media.\n\t\t *\n\t\t * @see #bytesTotal\n\t\t * @see #event:loadProgress feathers.events.MediaPlayerEventType.LOAD_PROGRESS\n\t\t */\n\t\tfunction get bytesLoaded():uint;\n\n\t\t/**\n\t\t * The total number of bytes to load for the current media.\n\t\t *\n\t\t * @see #bytesLoaded\n\t\t * @see #event:loadProgress feathers.events.MediaPlayerEventType.LOAD_PROGRESS\n\t\t */\n\t\tfunction get bytesTotal():uint;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/media/ITimedMediaPlayer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.media\n{\n\t/**\n\t * Dispatched when the media player's total playhead time changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #totalTime\n\t *\n\t * @eventType feathers.events.MediaPlayerEventType.TOTAL_TIME_CHANGE\n\t */\n\t[Event(name=\"totalTimeChange\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the media player's current playhead time changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #currentTime\n\t *\n\t * @eventType feathers.events.MediaPlayerEventType.CURRENT_TIME_CHANGE\n\t */\n\t[Event(name=\"currentTimeChange\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the media player's playback state changes, such as when\n\t * it begins playing or is paused.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #isPlaying\n\t *\n\t * @eventType feathers.events.MediaPlayerEventType.PLAYBACK_STATE_CHANGE\n\t */\n\t[Event(name=\"playbackStageChange\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the media has played to its end.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.COMPLETE\n\t */\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\t/**\n\t * An interface for media players that play timed content.\n\t *\n\t * @productversion Feathers 2.2.0\n\t */\n\tpublic interface ITimedMediaPlayer extends IMediaPlayer\n\t{\n\t\t/**\n\t\t * The current position of the playhead, in seconds.\n\t\t *\n\t\t * @see #event:currentTimeChange feathers.events.MediaPlayerEventType.CURRENT_TIME_CHANGE\n\t\t */\n\t\tfunction get currentTime():Number;\n\n\t\t/**\n\t\t * The maximum position of the playhead, in seconds.\n\t\t *\n\t\t * @see #event:totalTimeChange feathers.events.MediaPlayerEventType.TOTAL_TIME_CHANGE\n\t\t */\n\t\tfunction get totalTime():Number;\n\n\t\t/**\n\t\t * Determines if the media content is currently playing.\n\t\t *\n\t\t * @see #event:playbackStateChange feathers.events.MediaPlayerEventType.PLAYBACK_STATE_CHANGE\n\t\t */\n\t\tfunction get isPlaying():Boolean;\n\n\t\t/**\n\t\t * Toggles the media content between playing and paused states.\n\t\t *\n\t\t * @see #isPlaying\n\t\t * @see #play()\n\t\t * @see #pause()\n\t\t */\n\t\tfunction togglePlayPause():void;\n\n\t\t/**\n\t\t * Plays the media content.\n\t\t *\n\t\t * @see #isPlaying\n\t\t * @see #pause()\n\t\t * @see #stop()\n\t\t */\n\t\tfunction play():void;\n\n\t\t/**\n\t\t * Pauses the media content.\n\t\t *\n\t\t * @see #isPlaying\n\t\t * @see #play()\n\t\t */\n\t\tfunction pause():void;\n\n\t\t/**\n\t\t * Stops the media content and returns the playhead to the beginning.\n\t\t *\n\t\t * @see #isPlaying\n\t\t * @see #play()\n\t\t * @see #pause()\n\t\t */\n\t\tfunction stop():void;\n\n\t\t/**\n\t\t * Seeks the media content to a specific position, in seconds.\n\t\t */\n\t\tfunction seek(seconds:Number):void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/media/IVideoPlayer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.media\n{\n\t/**\n\t * Dispatched when the original, native width or height of the video content\n\t * is calculated.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #nativeWidth\n\t * @see #nativeHeight\n\t *\n\t * @eventType feathers.events.MediaPlayerEventType.DIMENSIONS_CHANGE\n\t */\n\t[Event(name=\"dimensionsChange\",type=\"starling.events.Event\")]\n\n\t/**\n\t * An interface media players that play video content.\n\t *\n\t * @productversion Feathers 2.2.0\n\t */\n\tpublic interface IVideoPlayer extends IAudioPlayer\n\t{\n\t\t/**\n\t\t * The original, native width of the loaded video.\n\t\t *\n\t\t * @see #event:dimensionsChange feathers.events.MediaPlayerEventType.DIMENSIONS_CHANGE\n\t\t */\n\t\tfunction get nativeWidth():Number;\n\n\t\t/**\n\t\t * The original, native height of the loaded video.\n\t\t *\n\t\t * @see #event:dimensionsChange feathers.events.MediaPlayerEventType.DIMENSIONS_CHANGE\n\t\t */\n\t\tfunction get nativeHeight():Number;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/media/MediaTimeMode.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.media\n{\n\t/**\n\t * Formats for media playback time.\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class MediaTimeMode\n\t{\n\t\t/**\n\t\t * The label displays only the current time of the media content.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const CURRENT_TIME:String = \"currentTime\";\n\n\t\t/**\n\t\t * The label displays only the total time of the media content.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const TOTAL_TIME:String = \"totalTime\";\n\n\t\t/**\n\t\t * The label displays only the remaining time of the media content. In\n\t\t * other words, the total time minus the current time.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const REMAINING_TIME:String = \"remainingTime\";\n\n\t\t/**\n\t\t * The label displays the current time of the media content, followed by\n\t\t * the total time of the media content.\n\t\t *\n\t\t * @productversion Feathers 3.0.0\n\t\t */\n\t\tpublic static const CURRENT_AND_TOTAL_TIMES:String = \"currentAndTotalTimes\";\n\t}\n}\n"
  },
  {
    "path": "source/feathers/media/MuteToggleButton.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.media\n{\n\timport feathers.controls.ToggleButton;\n\timport feathers.controls.popups.DropDownPopUpContentManager;\n\timport feathers.controls.popups.IPopUpContentManager;\n\timport feathers.core.PropertyProxy;\n\timport feathers.events.MediaPlayerEventType;\n\timport feathers.layout.Direction;\n\timport feathers.layout.RelativePosition;\n\timport feathers.skins.IStyleProvider;\n\n\timport flash.media.SoundTransform;\n\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\t/**\n\t * A manager that handles the details of how to display the pop-up\n\t * volume slider.\n\t *\n\t * <p>In the following example, a pop-up content manager is provided:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * button.popUpContentManager = new CalloutPopUpContentManager();</listing>\n\t *\n\t * @default null\n\t */\n\t[Style(name=\"popUpContentManager\",type=\"feathers.controls.popups.IPopUpContentManager\")]\n\n\t/**\n\t * Dispatched when the pop-up volume slider is opened.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.OPEN\n\t */\n\t[Event(name=\"open\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the pop-up volume slider is closed.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CLOSE\n\t */\n\t[Event(name=\"close\",type=\"starling.events.Event\")]\n\n\t/**\n\t * A specialized toggle button that controls whether a media player's volume\n\t * is muted or not.\n\t *\n\t * @see ../../../help/sound-player.html How to use the Feathers SoundPlayer component\n\t * @see ../../../help/video-player.html How to use the Feathers VideoPlayer component\n\t *\n\t * @productversion Feathers 2.2.0\n\t */\n\tpublic class MuteToggleButton extends ToggleButton implements IMediaPlayerControl\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const INVALIDATION_FLAG_VOLUME_SLIDER_FACTORY:String = \"volumeSliderFactory\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the\n\t\t * pop-up volume slider.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_VOLUME_SLIDER:String = \"feathers-volume-toggle-button-volume-slider\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all\n\t\t * <code>MuteToggleButton</code> components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultVolumeSliderFactory():VolumeSlider\n\t\t{\n\t\t\tvar slider:VolumeSlider = new VolumeSlider();\n\t\t\tslider.direction = Direction.VERTICAL;\n\t\t\treturn slider;\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function MuteToggleButton()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.addEventListener(Event.CHANGE, muteToggleButton_changeHandler);\n\t\t\tthis.addEventListener(TouchEvent.TOUCH, muteToggleButton_touchHandler);\n\t\t}\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the\n\t\t * pop-up volume slider. This variable is <code>protected</code> so that\n\t\t * sub-classes can customize the volume slider style name in their\n\t\t * constructors instead of using the default style name defined by\n\t\t * <code>DEFAULT_CHILD_STYLE_NAME_VOLUME_SLIDER</code>.\n\t\t *\n\t\t * <p>To customize the volume slider style name without subclassing, see\n\t\t * <code>customVolumeSliderStyleName</code>.</p>\n\t\t *\n\t\t * @see #style:customVolumeSliderStyleName\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tprotected var volumeSliderStyleName:String = DEFAULT_CHILD_STYLE_NAME_VOLUME_SLIDER;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var slider:VolumeSlider;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _oldVolume:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _ignoreChanges:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _touchPointID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _popUpTouchPointID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn MuteToggleButton.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _mediaPlayer:IAudioPlayer;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get mediaPlayer():IMediaPlayer\n\t\t{\n\t\t\treturn this._mediaPlayer;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set mediaPlayer(value:IMediaPlayer):void\n\t\t{\n\t\t\tif(this._mediaPlayer == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._mediaPlayer = value as IAudioPlayer;\n\t\t\tthis.refreshVolumeFromMediaPlayer();\n\t\t\tif(this._mediaPlayer)\n\t\t\t{\n\t\t\t\tthis._mediaPlayer.addEventListener(MediaPlayerEventType.SOUND_TRANSFORM_CHANGE, mediaPlayer_soundTransformChangeHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _popUpContentManager:IPopUpContentManager;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get popUpContentManager():IPopUpContentManager\n\t\t{\n\t\t\treturn this._popUpContentManager;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set popUpContentManager(value:IPopUpContentManager):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._popUpContentManager === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._popUpContentManager is EventDispatcher)\n\t\t\t{\n\t\t\t\tvar dispatcher:EventDispatcher = EventDispatcher(this._popUpContentManager);\n\t\t\t\tdispatcher.removeEventListener(Event.OPEN, popUpContentManager_openHandler);\n\t\t\t\tdispatcher.removeEventListener(Event.CLOSE, popUpContentManager_closeHandler);\n\t\t\t}\n\t\t\tthis._popUpContentManager = value;\n\t\t\tif(this._popUpContentManager is EventDispatcher)\n\t\t\t{\n\t\t\t\tdispatcher = EventDispatcher(this._popUpContentManager);\n\t\t\t\tdispatcher.addEventListener(Event.OPEN, popUpContentManager_openHandler);\n\t\t\t\tdispatcher.addEventListener(Event.CLOSE, popUpContentManager_closeHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _showVolumeSliderOnHover:Boolean = false;\n\n\t\t/**\n\t\t * Determines if a <code>VolumeSlider</code> component is displayed as a\n\t\t * pop-up when hovering over the toggle button. This property is\n\t\t * intended for use on desktop platforms only. On mobile platforms,\n\t\t * Starling does not dispatch events for hover, so the volume slider\n\t\t * will not be shown.\n\t\t *\n\t\t * <p>In the following example, showing the volume slider is enabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * button.showVolumeSliderOnHover = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @see feathers.media.VolumeSlider\n\t\t */\n\t\tpublic function get showVolumeSliderOnHover():Boolean\n\t\t{\n\t\t\treturn this._showVolumeSliderOnHover;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set showVolumeSliderOnHover(value:Boolean):void\n\t\t{\n\t\t\tif(this._showVolumeSliderOnHover == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._showVolumeSliderOnHover = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_VOLUME_SLIDER_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _volumeSliderFactory:Function;\n\n\t\t/**\n\t\t * A function used to generate the button's pop-up volume slider\n\t\t * sub-component. The volume slider must be an instance of\n\t\t * <code>VolumeSlider</code>. This factory can be used to change\n\t\t * properties on the volume slider when it is first created. For\n\t\t * instance, if you are skinning Feathers components without a theme,\n\t\t * you might use this factory to set skins and other styles on the\n\t\t * volume slider.\n\t\t *\n\t\t * <p>The function should have the following signature:</p>\n\t\t * <pre>function():VolumeSlider</pre>\n\t\t *\n\t\t * <p>In the following example, a custom volume slider factory is passed\n\t\t * to the button:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * button.volumeSliderFactory = function():VolumeSlider\n\t\t * {\n\t\t *     var popUpSlider:VolumeSlider = new VolumeSlider();\n\t\t *     popUpSlider.direction = Direction.VERTICAL;\n\t\t *     return popUpSlider;\n\t\t * };</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see feathers.media.VolumeSlider\n\t\t * @see #showVolumeSliderOnHover\n\t\t */\n\t\tpublic function get volumeSliderFactory():Function\n\t\t{\n\t\t\treturn this._volumeSliderFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set volumeSliderFactory(value:Function):void\n\t\t{\n\t\t\tif(this._volumeSliderFactory == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._volumeSliderFactory = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_VOLUME_SLIDER_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customVolumeSliderStyleName:String;\n\n\t\t/**\n\t\t * A style name to add to the button's volume slider sub-component.\n\t\t * Typically used by a theme to provide different styles to different\n\t\t * buttons.\n\t\t *\n\t\t * <p>In the following example, a custom volume slider style name is\n\t\t * passed to the button:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * button.customVolumeSliderStyleName = \"my-custom-volume-slider\";</listing>\n\t\t *\n\t\t * <p>In your theme, you can target this sub-component style name to provide\n\t\t * different styles than the default:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * getStyleProviderForClass( VolumeSlider ).setFunctionForStyleName( \"my-custom-volume-slider\", setCustomVolumeSliderStyles );</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #showVolumeSliderOnHover\n\t\t * @see #DEFAULT_CHILD_STYLE_NAME_VOLUME_SLIDER\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t * @see #volumeSliderFactory\n\t\t */\n\t\tpublic function get customVolumeSliderStyleName():String\n\t\t{\n\t\t\treturn this._customVolumeSliderStyleName;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customVolumeSliderStyleName(value:String):void\n\t\t{\n\t\t\tif(this._customVolumeSliderStyleName == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._customVolumeSliderStyleName = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_VOLUME_SLIDER_FACTORY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _volumeSliderProperties:PropertyProxy;\n\n\t\t/**\n\t\t * An object that stores properties for the button's pop-up volume\n\t\t * slider sub-component, and the properties will be passed down to the\n\t\t * volume slider when the button validates. For a list of available\n\t\t * properties, refer to <a href=\"VolumeSlider.html\"><code>feathers.media.VolumeSlider</code></a>.\n\t\t *\n\t\t * <p>If the subcomponent has its own subcomponents, their properties\n\t\t * can be set too, using attribute <code>&#64;</code> notation. For example,\n\t\t * to set the skin on the thumb which is in a <code>SimpleScrollBar</code>,\n\t\t * which is in a <code>List</code>, you can use the following syntax:</p>\n\t\t * <pre>list.verticalScrollBarProperties.&#64;thumbProperties.defaultSkin = new Image(texture);</pre>\n\t\t *\n\t\t * <p>Setting properties in a <code>volumeSliderFactory</code> function\n\t\t * instead of using <code>volumeSliderProperties</code> will result in\n\t\t * better performance.</p>\n\t\t *\n\t\t * <p>In the following example, the volume slider properties are passed\n\t\t * to the button:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * button.volumeSliderProperties.direction = Direction.VERTICAL;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #showVolumeSliderOnHover\n\t\t * @see #volumeSliderFactory\n\t\t * @see feathers.media.VolumeSlider\n\t\t */\n\t\tpublic function get volumeSliderProperties():Object\n\t\t{\n\t\t\tif(!this._volumeSliderProperties)\n\t\t\t{\n\t\t\t\tthis._volumeSliderProperties = new PropertyProxy(childProperties_onChange);\n\t\t\t}\n\t\t\treturn this._volumeSliderProperties;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set volumeSliderProperties(value:Object):void\n\t\t{\n\t\t\tif(this._volumeSliderProperties == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tvalue = new PropertyProxy();\n\t\t\t}\n\t\t\tif(!(value is PropertyProxy))\n\t\t\t{\n\t\t\t\tvar newValue:PropertyProxy = new PropertyProxy();\n\t\t\t\tfor(var propertyName:String in value)\n\t\t\t\t{\n\t\t\t\t\tnewValue[propertyName] = value[propertyName];\n\t\t\t\t}\n\t\t\t\tvalue = newValue;\n\t\t\t}\n\t\t\tif(this._volumeSliderProperties)\n\t\t\t{\n\t\t\t\tthis._volumeSliderProperties.removeOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis._volumeSliderProperties = PropertyProxy(value);\n\t\t\tif(this._volumeSliderProperties)\n\t\t\t{\n\t\t\t\tthis._volumeSliderProperties.addOnChangeCallback(childProperties_onChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isOpenPopUpPending:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isClosePopUpPending:Boolean = false;\n\n\t\t/**\n\t\t * Opens the pop-up volume slider, if it isn't already open.\n\t\t */\n\t\tpublic function openPopUp():void\n\t\t{\n\t\t\tthis._isClosePopUpPending = false;\n\t\t\tif(this._popUpContentManager.isOpen)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!this._isValidating && this.isInvalid())\n\t\t\t{\n\t\t\t\tthis._isOpenPopUpPending = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isOpenPopUpPending = false;\n\t\t\tthis._popUpContentManager.open(this.slider, this);\n\t\t\tthis.slider.validate();\n\t\t\tthis._popUpTouchPointID = -1;\n\t\t\tthis.slider.addEventListener(TouchEvent.TOUCH, volumeSlider_touchHandler);\n\t\t}\n\n\t\t/**\n\t\t * Closes the pop-up volume slider, if it is open.\n\t\t */\n\t\tpublic function closePopUp():void\n\t\t{\n\t\t\tthis._isOpenPopUpPending = false;\n\t\t\tif(!this._popUpContentManager.isOpen)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!this._isValidating && this.isInvalid())\n\t\t\t{\n\t\t\t\tthis._isClosePopUpPending = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isClosePopUpPending = false;\n\t\t\tthis.slider.validate();\n\t\t\t//don't clean up anything from openPopUp() in closePopUp(). The\n\t\t\t//pop-up may be closed by removing it from the PopUpManager, which\n\t\t\t//would result in closePopUp() never being called.\n\t\t\t//instead, clean up in the Event.REMOVED_FROM_STAGE listener.\n\t\t\tthis._popUpContentManager.close();\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this.slider)\n\t\t\t{\n\t\t\t\tthis.closePopUp();\n\t\t\t\tthis.slider.mediaPlayer = null;\n\t\t\t\tthis.slider.dispose();\n\t\t\t\tthis.slider = null;\n\t\t\t}\n\t\t\tif(this._popUpContentManager)\n\t\t\t{\n\t\t\t\tthis._popUpContentManager.dispose();\n\t\t\t\tthis._popUpContentManager = null;\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tif(this._popUpContentManager === null)\n\t\t\t{\n\t\t\t\tvar popUpContentManager:DropDownPopUpContentManager = new DropDownPopUpContentManager();\n\t\t\t\tpopUpContentManager.fitContentMinWidthToOrigin = false;\n\t\t\t\tpopUpContentManager.primaryDirection = RelativePosition.TOP;\n\t\t\t\tthis.ignoreNextStyleRestriction();\n\t\t\t\tthis.popUpContentManager = popUpContentManager;\n\t\t\t}\n\t\t\tsuper.initialize();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tvar stylesInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_STYLES);\n\t\t\tvar volumeSliderFactoryInvalid:Boolean = this.isInvalid(INVALIDATION_FLAG_VOLUME_SLIDER_FACTORY);\n\n\t\t\tif(volumeSliderFactoryInvalid)\n\t\t\t{\n\t\t\t\tthis.createVolumeSlider();\n\t\t\t}\n\n\t\t\tif(this.slider && (volumeSliderFactoryInvalid || stylesInvalid))\n\t\t\t{\n\t\t\t\tthis.refreshVolumeSliderProperties();\n\t\t\t}\n\n\t\t\tsuper.draw();\n\n\t\t\tthis.handlePendingActions();\n\t\t}\n\n\t\t/**\n\t\t * Creates and adds the volume slider sub-component and\n\t\t * removes the old instance, if one exists.\n\t\t *\n\t\t * <p>Meant for internal use, and subclasses may override this function\n\t\t * with a custom implementation.</p>\n\t\t *\n\t\t * @see #volumeSliderFactory\n\t\t * @see #style:customVolumeSliderStyleName\n\t\t */\n\t\tprotected function createVolumeSlider():void\n\t\t{\n\t\t\tif(this.slider)\n\t\t\t{\n\t\t\t\tthis.slider.removeFromParent(false);\n\t\t\t\t//disposing separately because the slider may not have a parent\n\t\t\t\tthis.slider.dispose();\n\t\t\t\tthis.slider = null;\n\t\t\t}\n\t\t\tif(!this._showVolumeSliderOnHover)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar factory:Function = this._volumeSliderFactory != null ? this._volumeSliderFactory : defaultVolumeSliderFactory;\n\t\t\tvar volumeSliderStyleName:String = this._customVolumeSliderStyleName != null ? this._customVolumeSliderStyleName : this.volumeSliderStyleName;\n\t\t\tthis.slider = VolumeSlider(factory());\n\t\t\tthis.slider.focusOwner = this;\n\t\t\tthis.slider.styleNameList.add(volumeSliderStyleName);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshVolumeSliderProperties():void\n\t\t{\n\t\t\tfor(var propertyName:String in this._volumeSliderProperties)\n\t\t\t{\n\t\t\t\tvar propertyValue:Object = this._volumeSliderProperties[propertyName];\n\t\t\t\tthis.slider[propertyName] = propertyValue;\n\t\t\t}\n\t\t\tthis.slider.mediaPlayer = this._mediaPlayer;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function handlePendingActions():void\n\t\t{\n\t\t\tif(this._isOpenPopUpPending)\n\t\t\t{\n\t\t\t\tthis.openPopUp();\n\t\t\t}\n\t\t\tif(this._isClosePopUpPending)\n\t\t\t{\n\t\t\t\tthis.closePopUp();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshVolumeFromMediaPlayer():void\n\t\t{\n\t\t\tvar oldIgnoreChanges:Boolean = this._ignoreChanges;\n\t\t\tthis._ignoreChanges = true;\n\t\t\tif(this._mediaPlayer)\n\t\t\t{\n\t\t\t\tthis.isSelected = this._mediaPlayer.soundTransform.volume == 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.isSelected = false;\n\t\t\t}\n\t\t\tthis._ignoreChanges = oldIgnoreChanges;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function mediaPlayer_soundTransformChangeHandler(event:Event):void\n\t\t{\n\t\t\tthis.refreshVolumeFromMediaPlayer();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function muteToggleButton_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreChanges || !this._mediaPlayer)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar soundTransform:SoundTransform = this._mediaPlayer.soundTransform;\n\t\t\tif(this._isSelected)\n\t\t\t{\n\t\t\t\tthis._oldVolume = soundTransform.volume;\n\t\t\t\tif(this._oldVolume == 0)\n\t\t\t\t{\n\t\t\t\t\tthis._oldVolume = 1;\n\t\t\t\t}\n\t\t\t\tsoundTransform.volume = 0;\n\t\t\t\tthis._mediaPlayer.soundTransform = soundTransform;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar newVolume:Number = this._oldVolume;\n\t\t\t\tif(newVolume !== newVolume) //isNaN\n\t\t\t\t{\n\t\t\t\t\t//volume was already zero, so we should fall back to some\n\t\t\t\t\t//default value\n\t\t\t\t\tnewVolume = 1;\n\t\t\t\t}\n\t\t\t\tsoundTransform.volume = newVolume;\n\t\t\t\tthis._mediaPlayer.soundTransform = soundTransform;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function muteToggleButton_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this.slider)\n\t\t\t{\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._touchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(this, null, this._touchPointID);\n\t\t\t\tif(touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t\ttouch = event.getTouch(this.slider);\n\t\t\t\tif(this._popUpTouchPointID < 0 && !touch)\n\t\t\t\t{\n\t\t\t\t\tthis.closePopUp();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(this, TouchPhase.HOVER);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._touchPointID = touch.id;\n\t\t\t\tthis.openPopUp();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function volumeSlider_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(this._popUpTouchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(this.slider, null, this._popUpTouchPointID);\n\t\t\t\tif(touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._popUpTouchPointID = -1;\n\t\t\t\ttouch = event.getTouch(this);\n\t\t\t\tif(this._touchPointID < 0 && !touch)\n\t\t\t\t{\n\t\t\t\t\tthis.closePopUp();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(this.slider, TouchPhase.HOVER);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._popUpTouchPointID = touch.id;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function popUpContentManager_openHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.OPEN);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function popUpContentManager_closeHandler(event:Event):void\n\t\t{\n\t\t\tthis.slider.removeEventListener(TouchEvent.TOUCH, volumeSlider_touchHandler);\n\t\t\tthis.dispatchEventWith(Event.CLOSE);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/media/PlayPauseToggleButton.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.media\n{\n\timport feathers.controls.ToggleButton;\n\timport feathers.events.MediaPlayerEventType;\n\timport feathers.skins.IStyleProvider;\n\n\timport starling.events.Event;\n\n\t/**\n\t * A specialized toggle button that controls whether a media player is\n\t * playing or paused.\n\t *\n\t * @see ../../../help/sound-player.html How to use the Feathers SoundPlayer component\n\t * @see ../../../help/video-player.html How to use the Feathers VideoPlayer component\n\t *\n\t * @productversion Feathers 2.2.0\n\t */\n\tpublic class PlayPauseToggleButton extends ToggleButton implements IMediaPlayerControl\n\t{\n\t\t/**\n\t\t * An alternate style name to use with\n\t\t * <code>PlayPauseToggleButton</code> to allow a theme to give it an\n\t\t * appearance of an overlay above video. If a theme does not provide a\n\t\t * style for an overlay play/pause button, the theme will automatically\n\t\t * fall back to using the default play/pause button style.\n\t\t *\n\t\t * <p>An alternate style name should always be added to a component's\n\t\t * <code>styleNameList</code> before the component is initialized. If\n\t\t * the style name is added later, it will be ignored.</p>\n\t\t *\n\t\t * <p>In the following example, the overlay play/pause style is applied\n\t\t * to a button:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var overlayButton:PlayPauseButton = new PlayPauseButton();\n\t\t * overlayButton.styleNameList.add( PlayPauseButton.ALTERNATE_STYLE_NAME_OVERLAY_PLAY_PAUSE_TOGGLE_BUTTON );\n\t\t * player.addChild( overlayButton );</listing>\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const ALTERNATE_STYLE_NAME_OVERLAY_PLAY_PAUSE_TOGGLE_BUTTON:String = \"feathers-overlay-play-pause-toggle-button\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all\n\t\t * <code>PlayPauseToggleButton</code> components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function PlayPauseToggleButton()\n\t\t{\n\t\t\tsuper();\n\t\t\t//we don't actually want this to toggle automatically. instead,\n\t\t\t//we'll update isSelected based on events dispatched by the media\n\t\t\t//player\n\t\t\tthis.isToggle = false;\n\t\t\tthis.addEventListener(Event.TRIGGERED, playPlayButton_triggeredHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn PlayPauseToggleButton.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _mediaPlayer:ITimedMediaPlayer;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get mediaPlayer():IMediaPlayer\n\t\t{\n\t\t\treturn this._mediaPlayer;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set mediaPlayer(value:IMediaPlayer):void\n\t\t{\n\t\t\tif(this._mediaPlayer == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._mediaPlayer)\n\t\t\t{\n\t\t\t\tthis._mediaPlayer.removeEventListener(MediaPlayerEventType.PLAYBACK_STATE_CHANGE, mediaPlayer_playbackStateChangeHandler);\n\t\t\t}\n\t\t\tthis._mediaPlayer = value as ITimedMediaPlayer;\n\t\t\tthis.refreshState();\n\t\t\tif(this._mediaPlayer)\n\t\t\t{\n\t\t\t\tthis._mediaPlayer.addEventListener(MediaPlayerEventType.PLAYBACK_STATE_CHANGE, mediaPlayer_playbackStateChangeHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _touchableWhenPlaying:Boolean = true;\n\n\t\t/**\n\t\t * Determines if the button may be touched when the media player is\n\t\t * playing its content. In other words, this button will only work when\n\t\t * the content is paused.\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic function get touchableWhenPlaying():Boolean\n\t\t{\n\t\t\treturn this._touchableWhenPlaying;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set touchableWhenPlaying(value:Boolean):void\n\t\t{\n\t\t\tif(this._touchableWhenPlaying == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._touchableWhenPlaying = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshState():void\n\t\t{\n\t\t\tif(!this._mediaPlayer)\n\t\t\t{\n\t\t\t\tthis.isSelected = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.isSelected = this._mediaPlayer.isPlaying;\n\t\t\tthis.touchable = !this._isSelected || this._touchableWhenPlaying;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function playPlayButton_triggeredHandler(event:Event):void\n\t\t{\n\t\t\tthis._mediaPlayer.togglePlayPause();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function mediaPlayer_playbackStateChangeHandler(event:Event):void\n\t\t{\n\t\t\tthis.refreshState();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/media/SeekSlider.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.media\n{\n\timport feathers.controls.Slider;\n\timport feathers.core.IValidating;\n\timport feathers.events.FeathersEventType;\n\timport feathers.events.MediaPlayerEventType;\n\timport feathers.layout.Direction;\n\timport feathers.skins.IStyleProvider;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t/**\n\t * An optional skin that acts similar to the fill skin of a progress bar\n\t * that displays the download progres of the media.\n\t *\n\t * <p>In the following example, the progress skin is customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var skin:Image = new Image( texture );\n\t * skin.scale9Grid = new Rectangle( 2, 3, 6, 1 );\n\t * slider.progressSkin = skin;</listing>\n\t *\n\t * @default null\n\t */\n\t[Style(name=\"progressSkin\",type=\"starling.display.DisplayObject\")]\n\n\t/**\n\t * A specialized slider that displays and controls the current position of\n\t * the playhead of a media player.\n\t *\n\t * @see ../../../help/sound-player.html How to use the Feathers SoundPlayer component\n\t * @see ../../../help/video-player.html How to use the Feathers VideoPlayer component\n\t *\n\t * @productversion Feathers 2.2.0\n\t */\n\tpublic class SeekSlider extends Slider implements IMediaPlayerControl\n\t{\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the\n\t\t * minimum track.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_MINIMUM_TRACK:String = \"feathers-seek-slider-minimum-track\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the\n\t\t * maximum track.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_MAXIMUM_TRACK:String = \"feathers-seek-slider-maximum-track\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the thumb.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_THUMB:String = \"feathers-seek-slider-thumb\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all\n\t\t * <code>SeekSlider</code> components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function SeekSlider()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.thumbStyleName = SeekSlider.DEFAULT_CHILD_STYLE_NAME_THUMB;\n\t\t\tthis.minimumTrackStyleName = SeekSlider.DEFAULT_CHILD_STYLE_NAME_MINIMUM_TRACK;\n\t\t\tthis.maximumTrackStyleName = SeekSlider.DEFAULT_CHILD_STYLE_NAME_MAXIMUM_TRACK;\n\t\t\tthis.addEventListener(Event.CHANGE, seekSlider_changeHandler);\n\t\t\tthis.addEventListener(FeathersEventType.END_INTERACTION, seekSlider_endInteractionHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn SeekSlider.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _mediaPlayer:ITimedMediaPlayer;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get mediaPlayer():IMediaPlayer\n\t\t{\n\t\t\treturn this._mediaPlayer;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set mediaPlayer(value:IMediaPlayer):void\n\t\t{\n\t\t\tif(this._mediaPlayer == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._mediaPlayer)\n\t\t\t{\n\t\t\t\tthis._mediaPlayer.removeEventListener(MediaPlayerEventType.LOAD_PROGRESS, mediaPlayer_loadProgressHandler);\n\t\t\t\tthis._mediaPlayer.removeEventListener(MediaPlayerEventType.CURRENT_TIME_CHANGE, mediaPlayer_currentTimeChangeHandler);\n\t\t\t\tthis._mediaPlayer.removeEventListener(MediaPlayerEventType.TOTAL_TIME_CHANGE, mediaPlayer_totalTimeChangeHandler);\n\t\t\t}\n\t\t\tthis._mediaPlayer = value as ITimedMediaPlayer;\n\t\t\tif(this._mediaPlayer)\n\t\t\t{\n\t\t\t\tthis._mediaPlayer.addEventListener(MediaPlayerEventType.CURRENT_TIME_CHANGE, mediaPlayer_currentTimeChangeHandler);\n\t\t\t\tthis._mediaPlayer.addEventListener(MediaPlayerEventType.TOTAL_TIME_CHANGE, mediaPlayer_totalTimeChangeHandler);\n\t\t\t\tif(this._mediaPlayer is IProgressiveMediaPlayer)\n\t\t\t\t{\n\t\t\t\t\tvar progressivePlayer:IProgressiveMediaPlayer = IProgressiveMediaPlayer(this._mediaPlayer);\n\t\t\t\t\tprogressivePlayer.addEventListener(MediaPlayerEventType.LOAD_PROGRESS, mediaPlayer_loadProgressHandler);\n\t\t\t\t\tif(progressivePlayer.bytesTotal > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._progress = progressivePlayer.bytesLoaded / progressivePlayer.bytesTotal;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._progress = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._progress = 0;\n\t\t\t\t}\n\t\t\t\tthis.minimum = 0;\n\t\t\t\tthis.maximum = this._mediaPlayer.totalTime;\n\t\t\t\tthis.value = this._mediaPlayer.currentTime;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.minimum = 0;\n\t\t\t\tthis.maximum = 0;\n\t\t\t\tthis.value = 0;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _progress:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _progressSkin:DisplayObject;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get progressSkin():DisplayObject\n\t\t{\n\t\t\treturn this._progressSkin;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set progressSkin(value:DisplayObject):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\tif(value !== null)\n\t\t\t\t{\n\t\t\t\t\tvalue.dispose();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._progressSkin == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._progressSkin)\n\t\t\t{\n\t\t\t\tthis.removeChild(this._progressSkin);\n\t\t\t}\n\t\t\tthis._progressSkin = value;\n\t\t\tif(this._progressSkin)\n\t\t\t{\n\t\t\t\tif(this._progressSkin.parent != this)\n\t\t\t\t{\n\t\t\t\t\tthis._progressSkin.visible = false;\n\t\t\t\t\tthis.addChild(this._progressSkin);\n\t\t\t\t}\n\t\t\t\tthis._progressSkin.touchable = false;\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function layoutChildren():void\n\t\t{\n\t\t\tsuper.layoutChildren();\n\t\t\tthis.layoutProgressSkin();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutProgressSkin():void\n\t\t{\n\t\t\tif(this._progressSkin === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this._minimum == this._maximum)\n\t\t\t{\n\t\t\t\tvar percentage:Number = 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpercentage = (this._value - this._minimum) / (this._maximum - this._minimum);\n\t\t\t\tif(percentage < 0)\n\t\t\t\t{\n\t\t\t\t\tpercentage = 0;\n\t\t\t\t}\n\t\t\t\telse if(percentage > 1)\n\t\t\t\t{\n\t\t\t\t\tpercentage = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._progress == 0 || this._progress <= percentage)\n\t\t\t{\n\t\t\t\tthis._progressSkin.visible = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._progressSkin.visible = true;\n\t\t\tif(this._progressSkin is IValidating)\n\t\t\t{\n\t\t\t\tIValidating(this._progressSkin).validate();\n\t\t\t}\n\n\t\t\tif(this._direction === Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tvar trackScrollableHeight:Number = this.actualHeight - this.thumb.height / 2 - this._minimumPadding - this._maximumPadding;\n\t\t\t\tthis._progressSkin.x = Math.round((this.actualWidth - this._progressSkin.width) / 2);\n\t\t\t\tvar progressHeight:Number = Math.round(trackScrollableHeight * this._progress);\n\t\t\t\tvar maxProgressHeight:Number = Math.round(this.thumb.y + this.thumb.height / 2);\n\t\t\t\tif(progressHeight < 0)\n\t\t\t\t{\n\t\t\t\t\tprogressHeight = 0;\n\t\t\t\t}\n\t\t\t\telse if(progressHeight > maxProgressHeight)\n\t\t\t\t{\n\t\t\t\t\tprogressHeight = maxProgressHeight;\n\t\t\t\t}\n\t\t\t\tthis._progressSkin.height = progressHeight;\n\t\t\t\tthis._progressSkin.y = maxProgressHeight - progressHeight;\n\t\t\t}\n\t\t\telse //horizontal\n\t\t\t{\n\t\t\t\tvar trackScrollableWidth:Number = this.actualWidth - this._minimumPadding - this._maximumPadding;\n\t\t\t\tthis._progressSkin.x = Math.round(this.thumb.x + this.thumb.width / 2);\n\t\t\t\tthis._progressSkin.y = Math.round((this.actualHeight - this._progressSkin.height) / 2);\n\t\t\t\tvar progressWidth:Number = Math.round((trackScrollableWidth * this._progress) - this._progressSkin.x);\n\t\t\t\tif(progressWidth < 0)\n\t\t\t\t{\n\t\t\t\t\tprogressWidth = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar maxProgressWidth:Number = Math.round(this.actualWidth - this._progressSkin.x);\n\t\t\t\t\tif(progressWidth > maxProgressWidth)\n\t\t\t\t\t{\n\t\t\t\t\t\tprogressWidth = maxProgressWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis._progressSkin.width = progressWidth;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function updateValueFromMediaPlayerCurrentTime():void\n\t\t{\n\t\t\tif(this.isDragging)\n\t\t\t{\n\t\t\t\t//if we're currently dragging, ignore changes by the player\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._value = this._mediaPlayer.currentTime;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function seekSlider_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(!this._mediaPlayer)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._mediaPlayer.seek(this._value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function seekSlider_endInteractionHandler(event:Event):void\n\t\t{\n\t\t\t//we may have ignored some changes from the media player while we\n\t\t\t//were dragging, so we should update the value if it's out of sync.\n\t\t\tthis.updateValueFromMediaPlayerCurrentTime();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function mediaPlayer_currentTimeChangeHandler(event:Event):void\n\t\t{\n\t\t\tthis.updateValueFromMediaPlayerCurrentTime();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function mediaPlayer_totalTimeChangeHandler(event:Event):void\n\t\t{\n\t\t\tthis.maximum = this._mediaPlayer.totalTime;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function mediaPlayer_loadProgressHandler(event:Event, progress:Number):void\n\t\t{\n\t\t\tif(this._progress == progress)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._progress = progress;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/media/SoundChannelPeakVisualizer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.media\n{\n\timport feathers.core.FeathersControl;\n\timport feathers.events.MediaPlayerEventType;\n\timport feathers.skins.IStyleProvider;\n\n\timport flash.media.SoundChannel;\n\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\n\t/**\n\t * The gap, in pixels, between the bars.\n\t *\n\t * <p>In the following example, the gap is set to 10 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * control.gap = 10;</listing>\n\t *\n\t * @default 0\n\t */\n\t[Style(name=\"gap\",type=\"Number\")]\n\n\t/**\n\t * A visualization of the left and right peaks of the\n\t * <code>flash.media.SoundChannel</code> from a <code>SoundPlayer</code>\n\t * component.\n\t *\n\t * @see ../../../help/sound-player.html How to use the Feathers SoundPlayer component\n\t *\n\t * @productversion Feathers 2.2.0\n\t */\n\tpublic class SoundChannelPeakVisualizer extends FeathersControl implements IMediaPlayerControl\n\t{\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all\n\t\t * <code>SoundChannelPeakVisualizer</code> components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function SoundChannelPeakVisualizer()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn SoundChannelPeakVisualizer.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var leftPeakBar:Quad;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var rightPeakBar:Quad;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _gap:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get gap():Number\n\t\t{\n\t\t\treturn this._gap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set gap(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._gap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._gap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _mediaPlayer:SoundPlayer;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get mediaPlayer():IMediaPlayer\n\t\t{\n\t\t\treturn this._mediaPlayer;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set mediaPlayer(value:IMediaPlayer):void\n\t\t{\n\t\t\tif(this._mediaPlayer == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._mediaPlayer)\n\t\t\t{\n\t\t\t\tthis._mediaPlayer.removeEventListener(MediaPlayerEventType.PLAYBACK_STATE_CHANGE, mediaPlayer_playbackStateChange);\n\t\t\t}\n\t\t\tthis._mediaPlayer = value as SoundPlayer;\n\t\t\tif(this._mediaPlayer)\n\t\t\t{\n\t\t\t\tthis.handlePlaybackStateChange();\n\t\t\t\tthis._mediaPlayer.addEventListener(MediaPlayerEventType.PLAYBACK_STATE_CHANGE, mediaPlayer_playbackStateChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tthis.mediaPlayer = null;\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tif(!this.leftPeakBar)\n\t\t\t{\n\t\t\t\tthis.leftPeakBar = new Quad(1, 1);\n\t\t\t\tthis.addChild(this.leftPeakBar);\n\t\t\t}\n\t\t\tif(!this.rightPeakBar)\n\t\t\t{\n\t\t\t\tthis.rightPeakBar = new Quad(1, 1);\n\t\t\t\tthis.addChild(this.rightPeakBar);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tthis.autoSizeIfNeeded();\n\n\t\t\tif(this._mediaPlayer && this._mediaPlayer.soundChannel)\n\t\t\t{\n\t\t\t\tvar soundChannel:SoundChannel = this._mediaPlayer.soundChannel;\n\t\t\t\tvar maxHeight:Number = this.actualHeight - 1;\n\t\t\t\tthis.leftPeakBar.height = 1 + maxHeight * soundChannel.leftPeak;\n\t\t\t\tthis.rightPeakBar.height = 1 + maxHeight * soundChannel.rightPeak;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.leftPeakBar.height = 1;\n\t\t\t\tthis.rightPeakBar.height = 1;\n\t\t\t}\n\t\t\tvar barWidth:Number = (this.actualWidth / 2) - this._gap;\n\t\t\tthis.leftPeakBar.y = this.actualHeight - this.leftPeakBar.height;\n\t\t\tthis.leftPeakBar.width = barWidth;\n\t\t\tthis.rightPeakBar.x = barWidth + this._gap;\n\t\t\tthis.rightPeakBar.y = this.actualHeight - this.rightPeakBar.height;\n\t\t\tthis.rightPeakBar.width = barWidth;\n\t\t\tsuper.draw();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tnewWidth = 4 + this._gap;\n\t\t\t}\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tnewHeight = 3;\n\t\t\t}\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newWidth, newHeight);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function handlePlaybackStateChange():void\n\t\t{\n\t\t\tif(this._mediaPlayer.isPlaying)\n\t\t\t{\n\t\t\t\tthis.addEventListener(Event.ENTER_FRAME, peakVisualizer_enterFrameHandler);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.removeEventListener(Event.ENTER_FRAME, peakVisualizer_enterFrameHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function mediaPlayer_playbackStateChange(event:Event):void\n\t\t{\n\t\t\tthis.handlePlaybackStateChange();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function peakVisualizer_enterFrameHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/media/SoundPlayer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.media\n{\n\timport feathers.events.MediaPlayerEventType;\n\timport feathers.skins.IStyleProvider;\n\n\timport flash.errors.IllegalOperationError;\n\timport flash.events.ErrorEvent;\n\timport flash.events.IOErrorEvent;\n\timport flash.events.ProgressEvent;\n\timport flash.media.Sound;\n\timport flash.media.SoundChannel;\n\timport flash.media.SoundLoaderContext;\n\timport flash.media.SoundTransform;\n\timport flash.net.URLRequest;\n\n\timport starling.events.Event;\n\n\t/**\n\t * Dispatched when the MP3 ID3 metadata becomes available on the\n\t * <code>Sound</code> instance.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The <code>flash.media.ID3Info</code>\n\t *   instance returned by the <code>id3</code> property of the\n\t *   <code>Sound</code> instance.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Sound.html#id3 flash.media.Sound.id3\n\t *\n\t * @eventType feathers.events.MediaPlayerEventType.METADATA_RECEIVED\n\t */\n\t[Event(name=\"metadataReceived\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched periodically when a media player's content is loading to\n\t * indicate the current progress. The <code>bytesLoaded</code> and\n\t * <code>bytesTotal</code> properties may be accessed to determine the\n\t * exact number of bytes loaded.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>A numeric value between <code>0</code>\n\t *   and <code>1</code> that indicates how much of the media has loaded so far.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #bytesLoaded\n\t * @see #bytesTotal\n\t *\n\t * @eventType feathers.events.MediaPlayerEventType.LOAD_PROGRESS\n\t */\n\t[Event(name=\"loadProgress\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when a media player's content is fully loaded and it\n\t * may be played to completion without buffering.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #isLoaded\n\t *\n\t * @eventType feathers.events.MediaPlayerEventType.LOAD_COMPLETE\n\t */\n\t[Event(name=\"loadComplete\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>flash.media.Sound</code> object dispatches\n\t * <code>flash.events.IOErrorEvent.IO_ERROR</code>.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The <code>flash.events.IOErrorEvent</code>\n\t *   dispatched by the <code>flash.media.Sound</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Sound.html#event:ioError flash.media.Sound: flash.events.IOErrorEvent.IO_ERROR\n\t *\n\t * @eventType starling.events.Event.IO_ERROR\n\t */\n\t[Event(name=\"ioError\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>flash.media.Sound</code> object dispatches\n\t * <code>flash.events.SecurityErrorEvent.SECURITY_ERROR</code>.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The <code>flash.events.SecurityErrorEvent</code>\n\t *   dispatched by the <code>flash.media.Sound</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Sound.html#event:securityError flash.media.Sound: flash.events.SecurityErrorEvent.SECURITY_ERROR\n\t *\n\t * @eventType starling.events.Event.SECURITY_ERROR\n\t */\n\t[Event(name=\"securityError\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the media player's sound transform changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #soundTransform\n\t *\n\t * @eventType feathers.events.MediaPlayerEventType.SOUND_TRANSFORM_CHANGE\n\t */\n\t[Event(name=\"soundTransformChange\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Controls playback of audio with a <code>flash.media.Sound</code> object.\n\t *\n\t * @see ../../../help/sound-player.html How to use the Feathers SoundPlayer component\n\t *\n\t * @productversion Feathers 2.2.0\n\t */\n\tpublic class SoundPlayer extends BaseTimedMediaPlayer implements IAudioPlayer, IProgressiveMediaPlayer\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const NO_SOUND_SOURCE_PLAY_ERROR:String = \"Cannot play media when soundSource property has not been set.\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all\n\t\t * <code>SoundPlayer</code> components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function SoundPlayer()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn SoundPlayer.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _sound:Sound;\n\n\t\t/**\n\t\t * The <code>flash.media.Sound</code> object that has loaded the\n\t\t * content specified by <code>soundSource</code>.\n\t\t *\n\t\t * @see #soundSource\n\t\t */\n\t\tpublic function get sound():Sound\n\t\t{\n\t\t\treturn this._sound;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _soundChannel:SoundChannel;\n\n\t\t/**\n\t\t * The currently playing <code>flash.media.SoundChannel</code>.\n\t\t */\n\t\tpublic function get soundChannel():SoundChannel\n\t\t{\n\t\t\treturn this._soundChannel;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _soundSource:Object;\n\n\t\t/**\n\t\t * A URL specified as a <code>String</code> representing a URL, a\n\t\t * <code>flash.net.URLRequest</code>, or a\n\t\t * <code>flash.media.Sound</code> object. In the case of a\n\t\t * <code>String</code> or a <code>URLRequest</code>, a new\n\t\t * <code>flash.media.Sound</code> object will be created internally and\n\t\t * the content will by loaded automatically.\n\t\t *\n\t\t * <p>In the following example, a sound file URL is passed in:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * soundPlayer.soundSource = \"http://example.com/sound.mp3\";</listing>\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLRequest.html flash.net.URLRequest\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Sound.html flash.media.Sound\n\t\t * @see #soundLoaderContext\n\t\t */\n\t\tpublic function get soundSource():Object\n\t\t{\n\t\t\treturn this._soundSource;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set soundSource(value:Object):void\n\t\t{\n\t\t\tif(this._soundSource === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._isPlaying)\n\t\t\t{\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\tthis._soundSource = value;\n\t\t\t//reset the current and total time if we were playing a different\n\t\t\t//sound previously\n\t\t\tif(this._currentTime != 0)\n\t\t\t{\n\t\t\t\tthis._currentTime = 0;\n\t\t\t\tthis.dispatchEventWith(MediaPlayerEventType.CURRENT_TIME_CHANGE);\n\t\t\t}\n\t\t\tif(this._totalTime != 0)\n\t\t\t{\n\t\t\t\tthis._totalTime = 0;\n\t\t\t\tthis.dispatchEventWith(MediaPlayerEventType.TOTAL_TIME_CHANGE);\n\t\t\t}\n\t\t\tif(this._sound)\n\t\t\t{\n\t\t\t\tthis.cleanupSound();\n\t\t\t}\n\t\t\tthis._isLoaded = false;\n\t\t\tif(this._soundSource is String)\n\t\t\t{\n\t\t\t\tthis.loadSourceFromURL(value as String);\n\t\t\t}\n\t\t\telse if(this._soundSource is URLRequest)\n\t\t\t{\n\t\t\t\tthis.loadSourceFromURLRequest(URLRequest(value));\n\t\t\t}\n\t\t\telse if(this._soundSource is Sound)\n\t\t\t{\n\t\t\t\tthis._sound = Sound(this._soundSource);\n\t\t\t\tvar newTotalTime:Number = this._sound.length / 1000;\n\t\t\t\tif(this._totalTime != newTotalTime)\n\t\t\t\t{\n\t\t\t\t\tthis._totalTime = newTotalTime;\n\t\t\t\t\tthis.dispatchEventWith(MediaPlayerEventType.TOTAL_TIME_CHANGE);\n\t\t\t\t}\n\t\t\t\tif(this._sound.isBuffering)\n\t\t\t\t{\n\t\t\t\t\tthis._sound.addEventListener(IOErrorEvent.IO_ERROR, sound_errorHandler);\n\t\t\t\t\tthis._sound.addEventListener(ProgressEvent.PROGRESS, sound_progressHandler);\n\t\t\t\t\tthis._sound.addEventListener(flash.events.Event.COMPLETE, sound_completeHandler);\n\t\t\t\t\tthis._sound.addEventListener(flash.events.Event.ID3, sound_id3Handler);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(this._soundSource === null)\n\t\t\t{\n\t\t\t\tthis._sound = null;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"Invalid source type for SoundPlayer. Expected a URL as a String, an URLRequest, a Sound object, or null.\");\n\t\t\t}\n\t\t\tif(this._autoPlay && this._sound)\n\t\t\t{\n\t\t\t\tthis.play();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isLoading:Boolean = false;\n\n\t\t/**\n\t\t * Indicates if the <code>flash.media.Sound</code> object is currently\n\t\t * loading its content.\n\t\t */\n\t\tpublic function get isLoading():Boolean\n\t\t{\n\t\t\treturn this._isLoading;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isLoaded:Boolean = false;\n\n\t\t/**\n\t\t * Indicates if the <code>flash.media.Sound</code> object has finished\n\t\t * loading its content.\n\t\t *\n\t\t * @see #event:loadProgress feathers.events.MediaPlayerEventType.LOAD_PROGRESS\n\t\t * @see #event:loadComplete feathers.events.MediaPlayerEventType.LOAD_COMPLETE\n\t\t */\n\t\tpublic function get isLoaded():Boolean\n\t\t{\n\t\t\treturn this._isLoaded;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.media.IProgressiveMediaPlayer#bytesLoaded\n\t\t *\n\t\t * @see #bytesTotal\n\t\t * @see #event:loadProgress feathers.events.MediaPlayerEventType.LOAD_PROGRESS\n\t\t */\n\t\tpublic function get bytesLoaded():uint\n\t\t{\n\t\t\tif(!this._sound)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn this._sound.bytesLoaded;\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.media.IProgressiveMediaPlayer#bytesTotal\n\t\t *\n\t\t * @see #bytesLoaded\n\t\t * @see #event:loadProgress feathers.events.MediaPlayerEventType.LOAD_PROGRESS\n\t\t */\n\t\tpublic function get bytesTotal():uint\n\t\t{\n\t\t\tif(!this._sound)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn this._sound.bytesTotal;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _soundTransform:SoundTransform;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * <p>In the following example, the audio is muted:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * soundPlayer.soundTransform = new SoundTransform(0);</listing>\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/SoundTransform.html flash.media.SoundTransform\n\t\t * @see #event:soundTransformChange feathers.events.MediaPlayerEventType.SOUND_TRANSFORM_CHANGE\n\t\t */\n\t\tpublic function get soundTransform():SoundTransform\n\t\t{\n\t\t\tif(!this._soundTransform)\n\t\t\t{\n\t\t\t\tthis._soundTransform = new SoundTransform();\n\t\t\t}\n\t\t\treturn this._soundTransform;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set soundTransform(value:SoundTransform):void\n\t\t{\n\t\t\tthis._soundTransform = value;\n\t\t\tif(this._soundChannel)\n\t\t\t{\n\t\t\t\tthis._soundChannel.soundTransform = this._soundTransform;\n\t\t\t}\n\t\t\tthis.dispatchEventWith(MediaPlayerEventType.SOUND_TRANSFORM_CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _autoPlay:Boolean = true;\n\n\t\t/**\n\t\t * Determines if the sound starts playing immediately when the\n\t\t * <code>soundSource</code> property is set.\n\t\t *\n\t\t * <p>In the following example, automatic playback is disabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * soundPlayer.autoPlay = false;</listing>\n\t\t *\n\t\t * @see #soundSource\n\t\t */\n\t\tpublic function get autoPlay():Boolean\n\t\t{\n\t\t\treturn this._autoPlay;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set autoPlay(value:Boolean):void\n\t\t{\n\t\t\tthis._autoPlay = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _loop:Boolean = false;\n\n\t\t/**\n\t\t * Determines if, upon reaching the end of the sound, the playhead\n\t\t * automatically returns to the start of the media and plays again.\n\t\t *\n\t\t * <p>If <code>loop</code> is <code>true</code>, the\n\t\t * <code>autoRewind</code> property will be ignored because looping will\n\t\t * always automatically rewind to the beginning.</p>\n\t\t *\n\t\t * <p>In the following example, looping is enabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * soundPlayer.loop = true;</listing>\n\t\t */\n\t\tpublic function get loop():Boolean\n\t\t{\n\t\t\treturn this._loop;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set loop(value:Boolean):void\n\t\t{\n\t\t\tthis._loop = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _soundLoaderContext:SoundLoaderContext = null;\n\n\t\t/**\n\t\t * If a custom <code>SoundLoaderContext</code> is provided, it will be\n\t\t * passed to the <code>load()</code> method of the\n\t\t * <code>flash.media.Sound</code> when loading a sound from a URL.\n\t\t *\n\t\t * <p>This property must be set before the <code>soundSource</code>\n\t\t * property.</p>\n\t\t *\n\t\t * <p>In the following example, a custom\n\t\t * <code>SoundLoaderContext</code> is used:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * soundPlayer.soundLoaderContext = new SoundLoaderContext(1000, true);</listing>\n\t\t *\n\t\t * @see #soundSource\n\t\t */\n\t\tpublic function get soundLoaderContext():SoundLoaderContext\n\t\t{\n\t\t\treturn this._soundLoaderContext;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set soundLoaderContext(value:SoundLoaderContext):void\n\t\t{\n\t\t\tthis._soundLoaderContext = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tthis.soundSource = null;\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function play():void\n\t\t{\n\t\t\tif(this._sound === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsuper.play();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function playMedia():void\n\t\t{\n\t\t\tif(!this._soundSource)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(NO_SOUND_SOURCE_PLAY_ERROR);\n\t\t\t}\n\t\t\tif(!this._sound.isBuffering && this._currentTime == this._totalTime)\n\t\t\t{\n\t\t\t\t//flash.events.Event.SOUND_COMPLETE may not be dispatched (or\n\t\t\t\t//maybe it is dispatched, but before the listener can be added)\n\t\t\t\t//if currentTime is equal to totalTime, so we need to do it\n\t\t\t\t//manually.\n\t\t\t\tthis.handleSoundComplete();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!this._soundTransform)\n\t\t\t{\n\t\t\t\tthis._soundTransform = new SoundTransform();\n\t\t\t}\n\t\t\tthis._soundChannel = this._sound.play(this._currentTime * 1000, 0, this._soundTransform);\n\t\t\tthis._soundChannel.addEventListener(flash.events.Event.SOUND_COMPLETE, soundChannel_soundCompleteHandler);\n\t\t\tthis.addEventListener(Event.ENTER_FRAME, soundPlayer_enterFrameHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function pauseMedia():void\n\t\t{\n\t\t\tif(!this._soundChannel)\n\t\t\t{\n\t\t\t\t//this could be null when seeking\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.removeEventListener(Event.ENTER_FRAME, soundPlayer_enterFrameHandler);\n\t\t\tthis._soundChannel.stop();\n\t\t\tthis._soundChannel.removeEventListener(flash.events.Event.SOUND_COMPLETE, soundChannel_soundCompleteHandler);\n\t\t\tthis._soundChannel = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function seekMedia(seconds:Number):void\n\t\t{\n\t\t\tthis.pauseMedia();\n\t\t\tthis._currentTime = seconds;\n\t\t\tif(this._isPlaying)\n\t\t\t{\n\t\t\t\tthis.playMedia();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function handleSoundComplete():void\n\t\t{\n\t\t\t//return to the beginning\n\t\t\tthis.stop();\n\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t\tif(this._loop)\n\t\t\t{\n\t\t\t\tthis.play();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function loadSourceFromURL(url:String):void\n\t\t{\n\t\t\tthis.loadSourceFromURLRequest(new URLRequest(url));\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function loadSourceFromURLRequest(request:URLRequest):void\n\t\t{\n\t\t\tthis._isLoading = true;\n\t\t\tif(this._sound)\n\t\t\t{\n\t\t\t\tthis.cleanupSound();\n\t\t\t}\n\t\t\tthis._sound = new Sound();\n\t\t\tthis._sound.addEventListener(IOErrorEvent.IO_ERROR, sound_errorHandler);\n\t\t\tthis._sound.addEventListener(ProgressEvent.PROGRESS, sound_progressHandler);\n\t\t\tthis._sound.addEventListener(flash.events.Event.COMPLETE, sound_completeHandler);\n\t\t\tthis._sound.addEventListener(flash.events.Event.ID3, sound_id3Handler);\n\t\t\tthis._sound.load(request, this._soundLoaderContext);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function cleanupSound():void\n\t\t{\n\t\t\tif(!this._sound)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._sound.removeEventListener(IOErrorEvent.IO_ERROR, sound_errorHandler);\n\t\t\tthis._sound.removeEventListener(ProgressEvent.PROGRESS, sound_progressHandler);\n\t\t\tthis._sound.removeEventListener(flash.events.Event.COMPLETE, sound_completeHandler);\n\t\t\tthis._sound.removeEventListener(flash.events.Event.ID3, sound_id3Handler);\n\t\t\tthis._sound = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function soundPlayer_enterFrameHandler(event:Event):void\n\t\t{\n\t\t\tthis._currentTime = this._soundChannel.position / 1000;\n\t\t\tthis.dispatchEventWith(MediaPlayerEventType.CURRENT_TIME_CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * This isn't when the sound finishes playing. It's when the sound has\n\t\t * finished loading.\n\t\t */\n\t\tprotected function sound_completeHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tthis._totalTime = this._sound.length / 1000;\n\t\t\tthis.dispatchEventWith(MediaPlayerEventType.TOTAL_TIME_CHANGE);\n\t\t\tthis._isLoading = false;\n\t\t\tthis._isLoaded = true;\n\t\t\tthis.dispatchEventWith(MediaPlayerEventType.LOAD_COMPLETE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function sound_id3Handler(event:flash.events.Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(MediaPlayerEventType.METADATA_RECEIVED, false, this._sound.id3);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function sound_progressHandler(event:ProgressEvent):void\n\t\t{\n\t\t\tvar oldTotalTime:Number = this._totalTime;\n\t\t\tthis._totalTime = this._sound.length / 1000;\n\t\t\tif(oldTotalTime != this._totalTime)\n\t\t\t{\n\t\t\t\tthis.dispatchEventWith(MediaPlayerEventType.TOTAL_TIME_CHANGE);\n\t\t\t}\n\t\t\tthis.dispatchEventWith(MediaPlayerEventType.LOAD_PROGRESS, false, event.bytesLoaded / event.bytesTotal);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function sound_errorHandler(event:ErrorEvent):void\n\t\t{\n\t\t\t//since it's just a string in both cases, we'll reuse event.type for\n\t\t\t//the Starling event.\n\t\t\tthis.dispatchEventWith(event.type, false, event);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function soundChannel_soundCompleteHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tthis.handleSoundComplete();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/media/SpectrumBarGraphVisualizer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.media\n{\n\timport feathers.core.FeathersControl;\n\timport feathers.events.MediaPlayerEventType;\n\timport feathers.skins.IStyleProvider;\n\n\timport flash.media.SoundMixer;\n\timport flash.utils.ByteArray;\n\n\timport starling.display.MeshBatch;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\n\t/**\n\t * The number of bars to display in the graph.\n\t *\n\t * <p>In the following example, 32 bars are displayed:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * graph.barCount = 32;</listing>\n\t *\n\t * @default 16\n\t */\n\t[Style(name=\"barCount\",type=\"Number\")]\n\n\t/**\n\t * The color of the bars in the graph.\n\t *\n\t * <p>In the following example, the bar color is customized:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * graph.color = 0xff0000;</listing>\n\t *\n\t * @default 0\n\t */\n\t[Style(name=\"color\",type=\"Number\")]\n\n\t/**\n\t * The gap, in pixels, between the bars in the graph.\n\t *\n\t * <p>In the following example, the gap is set to 10 pixels:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * graph.gap = 10;</listing>\n\t *\n\t * @default 0\n\t */\n\t[Style(name=\"gap\",type=\"Number\")]\n\n\t/**\n\t * A visualization of the audio spectrum of the runtime's currently playing\n\t * audio content.\n\t *\n\t * @see ../../../help/sound-player.html How to use the Feathers SoundPlayer component\n\t *\n\t * @productversion Feathers 2.2.0\n\t */\n\tpublic class SpectrumBarGraphVisualizer extends FeathersControl implements IMediaPlayerControl\n\t{\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all\n\t\t * <code>SpectrumBarGraphVisualizer</code> components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static var HELPER_QUAD:Quad = new Quad(1, 1);\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const MAX_BAR_COUNT:int = 256;\n\n\t\t/**\n\t\t * Constructor\n\t\t */\n\t\tpublic function SpectrumBarGraphVisualizer()\n\t\t{\n\t\t\tthis.isQuickHitAreaEnabled = true;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn SpectrumBarGraphVisualizer.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _bars:MeshBatch;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _bytes:ByteArray = new ByteArray();\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _barValues:Vector.<Number> = new <Number>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _barCount:int = 16;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get barCount():int\n\t\t{\n\t\t\treturn this._barCount;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set barCount(value:int):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value > MAX_BAR_COUNT)\n\t\t\t{\n\t\t\t\tvalue = MAX_BAR_COUNT;\n\t\t\t}\n\t\t\telse if(value < 1)\n\t\t\t{\n\t\t\t\tvalue = 1;\n\t\t\t}\n\t\t\tif(this._barCount == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._barCount = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _gap:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get gap():Number\n\t\t{\n\t\t\treturn this._gap;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set gap(value:Number):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._gap == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._gap = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _color:uint = 0x000000;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get color():uint\n\t\t{\n\t\t\treturn this._color;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set color(value:uint):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._color == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._color = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_STYLES);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _mediaPlayer:ITimedMediaPlayer;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get mediaPlayer():IMediaPlayer\n\t\t{\n\t\t\treturn this._mediaPlayer;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set mediaPlayer(value:IMediaPlayer):void\n\t\t{\n\t\t\tif(this._mediaPlayer == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._mediaPlayer)\n\t\t\t{\n\t\t\t\tthis._mediaPlayer.removeEventListener(MediaPlayerEventType.PLAYBACK_STATE_CHANGE, mediaPlayer_playbackStateChange);\n\t\t\t}\n\t\t\tthis._mediaPlayer = value as ITimedMediaPlayer;\n\t\t\tif(this._mediaPlayer)\n\t\t\t{\n\t\t\t\tthis.handlePlaybackStateChange();\n\t\t\t\tthis._mediaPlayer.addEventListener(MediaPlayerEventType.PLAYBACK_STATE_CHANGE, mediaPlayer_playbackStateChange);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tthis.mediaPlayer = null;\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tthis._bars = new MeshBatch();\n\t\t\tthis.addChild(this._bars);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tthis.autoSizeIfNeeded();\n\t\t\tthis.layoutBarGraph();\n\t\t\tsuper.draw();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function autoSizeIfNeeded():Boolean\n\t\t{\n\t\t\tvar needsWidth:Boolean = this._explicitWidth !== this._explicitWidth; //isNaN\n\t\t\tvar needsHeight:Boolean = this._explicitHeight !== this._explicitHeight; //isNaN\n\t\t\tif(!needsWidth && !needsHeight)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar newWidth:Number = this._explicitWidth;\n\t\t\tif(needsWidth)\n\t\t\t{\n\t\t\t\tnewWidth = this._barCount * (this._gap + 1) - this._gap;\n\t\t\t}\n\t\t\tvar newHeight:Number = this._explicitHeight;\n\t\t\tif(needsHeight)\n\t\t\t{\n\t\t\t\tnewHeight = 10;\n\t\t\t}\n\t\t\treturn this.saveMeasurements(newWidth, newHeight, newWidth, newHeight);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function layoutBarGraph():void\n\t\t{\n\t\t\tthis._bars.clear();\n\t\t\tif(!this._mediaPlayer.isPlaying)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar barCount:int = this._barCount;\n\t\t\tvar barWidth:Number = ((this.actualWidth + this._gap) / barCount) - this._gap;\n\t\t\tif(barWidth < 0 || this.actualHeight <= 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tSoundMixer.computeSpectrum(this._bytes, true, 0);\n\n\t\t\tthis._barValues.length = barCount;\n\t\t\tvar valuesPerBar:int = 256 / barCount;\n\t\t\t//read left values\n\t\t\tfor(var i:int = 0; i < barCount; i++)\n\t\t\t{\n\t\t\t\t//reset to zero first\n\t\t\t\tthis._barValues[i] = 0;\n\t\t\t\tfor(var j:int = 0; j < valuesPerBar; j++)\n\t\t\t\t{\n\t\t\t\t\tvar float:Number = this._bytes.readFloat();\n\t\t\t\t\tif(float > 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tfloat = 1;\n\t\t\t\t\t}\n\t\t\t\t\tthis._barValues[i] += float;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//read right values\n\t\t\tthis._bytes.position = 1024;\n\t\t\tfor(i = 0; i < barCount; i++)\n\t\t\t{\n\t\t\t\tfor(j = 0; j < valuesPerBar; j++)\n\t\t\t\t{\n\t\t\t\t\tfloat = this._bytes.readFloat();\n\t\t\t\t\tif(float > 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tfloat = 1;\n\t\t\t\t\t}\n\t\t\t\t\tthis._barValues[i] += float;\n\t\t\t\t}\n\t\t\t\t//calculate the average\n\t\t\t\tthis._barValues[i] /= (2 * valuesPerBar);\n\t\t\t}\n\n\t\t\tvar xPosition:Number = 0;\n\t\t\tvar maxHeight:Number = this.actualHeight - 1;\n\t\t\tHELPER_QUAD.color = this._color;\n\t\t\tfor(i = 0; i < barCount; i++)\n\t\t\t{\n\t\t\t\tHELPER_QUAD.x = xPosition;\n\t\t\t\tHELPER_QUAD.width = barWidth;\n\t\t\t\tHELPER_QUAD.height = Math.floor(maxHeight * this._barValues[i]);\n\t\t\t\tHELPER_QUAD.y = maxHeight - HELPER_QUAD.height;\n\t\t\t\tthis._bars.addMesh(HELPER_QUAD);\n\t\t\t\txPosition += barWidth + this._gap;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function handlePlaybackStateChange():void\n\t\t{\n\t\t\tif(this._mediaPlayer.isPlaying)\n\t\t\t{\n\t\t\t\tthis.addEventListener(Event.ENTER_FRAME, peakVisualizer_enterFrameHandler);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.removeEventListener(Event.ENTER_FRAME, peakVisualizer_enterFrameHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function mediaPlayer_playbackStateChange(event:Event):void\n\t\t{\n\t\t\tthis.handlePlaybackStateChange();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function peakVisualizer_enterFrameHandler(event:Event):void\n\t\t{\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/media/TimeLabel.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.media\n{\n\timport feathers.controls.Label;\n\timport feathers.events.MediaPlayerEventType;\n\timport feathers.skins.IStyleProvider;\n\n\timport flash.geom.Point;\n\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.utils.Pool;\n\n\t/**\n\t * When the value of <code>displayMode</code> is\n\t * <code>MediaTimeMode.CURRENT_AND_TOTAL_TIMES</code>, this text is\n\t * inserted between the two times to separate them.\n\t *\n\t * @default \" / \"\n\t *\n\t * @see feathers.media.MediaTimeMode#CURRENT_AND_TOTAL_TIMES\n\t */\n\t[Style(name=\"delimiter\",type=\"String\")]\n\n\t/**\n\t * Determines how the time is displayed by the label.\n\t *\n\t * @default feathers.media.MediaTimeMode.CURRENT_AND_TOTAL_TIMES\n\t *\n\t * @see feathers.media.MediaTimeMode#CURRENT_AND_TOTAL_TIMES\n\t * @see feathers.media.MediaTimeMode#CURRENT_TIME\n\t * @see feathers.media.MediaTimeMode#TOTAL_TIME\n\t * @see feathers.media.MediaTimeMode#REMAINING_TIME\n\t */\n\t[Style(name=\"displayMode\",type=\"String\")]\n\n\t/**\n\t * If the <code>displayMode</code> property is set to\n\t * <code>MediaTimeMode.CURRENT_TIME</code> or\n\t * <code>MediaTimeMode.REMAINING_TIME</code>, and this property\n\t * is set to <code>true</code>, the label will switch to displaying the\n\t * current time and the remaining time, if tapped or clicked. If the\n\t * <code>displayMode</code> property is not set to one of the specified\n\t * values, this property is ignored.\n\t *\n\t * @default false\n\t *\n\t * @see #style:displayMode\n\t */\n\t[Style(name=\"toggleDisplayMode\",type=\"Boolean\")]\n\n\t/**\n\t * A specialized label that can display the current playhead time, total\n\t * time, remaining time, or a combined current and total time for a media\n\t * player.\n\t *\n\t * @see ../../../help/sound-player.html How to use the Feathers SoundPlayer component\n\t * @see ../../../help/video-player.html How to use the Feathers VideoPlayer component\n\t *\n\t * @productversion Feathers 2.2.0\n\t */\n\tpublic class TimeLabel extends Label implements IMediaPlayerControl\n\t{\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all\n\t\t * <code>TimeLabel</code> components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function TimeLabel()\n\t\t{\n\t\t\tthis.addEventListener(TouchEvent.TOUCH, timeLabel_touchHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\tif(TimeLabel.globalStyleProvider)\n\t\t\t{\n\t\t\t\treturn TimeLabel.globalStyleProvider;\n\t\t\t}\n\t\t\treturn Label.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _mediaPlayer:ITimedMediaPlayer;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get mediaPlayer():IMediaPlayer\n\t\t{\n\t\t\treturn this._mediaPlayer;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set mediaPlayer(value:IMediaPlayer):void\n\t\t{\n\t\t\tif(this._mediaPlayer == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._mediaPlayer)\n\t\t\t{\n\t\t\t\tthis._mediaPlayer.removeEventListener(MediaPlayerEventType.CURRENT_TIME_CHANGE, mediaPlayer_currentTimeChangeHandler);\n\t\t\t\tthis._mediaPlayer.removeEventListener(MediaPlayerEventType.TOTAL_TIME_CHANGE, mediaPlayer_totalTimeChangeHandler);\n\t\t\t}\n\t\t\tthis._mediaPlayer = value as ITimedMediaPlayer;\n\t\t\tif(this._mediaPlayer)\n\t\t\t{\n\t\t\t\tthis._mediaPlayer.addEventListener(MediaPlayerEventType.CURRENT_TIME_CHANGE, mediaPlayer_currentTimeChangeHandler);\n\t\t\t\tthis._mediaPlayer.addEventListener(MediaPlayerEventType.TOTAL_TIME_CHANGE, mediaPlayer_totalTimeChangeHandler);\n\t\t\t}\n\t\t\tthis.updateText();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _delimiter:String = \" / \";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get delimiter():String\n\t\t{\n\t\t\treturn this._delimiter;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set delimiter(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._delimiter === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._delimiter = value;\n\t\t\tthis.updateText();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _displayMode:String = MediaTimeMode.CURRENT_AND_TOTAL_TIMES;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"currentAndTotalTimes,currentTime,totalTime,remainingTime\")]\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get displayMode():String\n\t\t{\n\t\t\treturn this._displayMode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set displayMode(value:String):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._displayMode === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._displayMode = value;\n\t\t\t//reset this value because it would be unexpected for the label\n\t\t\t//not to change when changing this property.\n\t\t\tthis._isToggled = false;\n\t\t\tthis.updateText();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isToggled:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var touchPointID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _toggleDisplayMode:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get toggleDisplayMode():Boolean\n\t\t{\n\t\t\treturn this._toggleDisplayMode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set toggleDisplayMode(value:Boolean):void\n\t\t{\n\t\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._toggleDisplayMode === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._toggleDisplayMode = value;\n\t\t\tthis._isToggled = false;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function updateText():void\n\t\t{\n\t\t\tvar currentTime:Number = this._mediaPlayer ? this._mediaPlayer.currentTime : 0;\n\t\t\tvar totalTime:Number = this._mediaPlayer ? this._mediaPlayer.totalTime : 0;\n\t\t\tvar displayMode:String = this._displayMode;\n\t\t\tif(this._isToggled)\n\t\t\t{\n\t\t\t\tif(displayMode === MediaTimeMode.CURRENT_TIME)\n\t\t\t\t{\n\t\t\t\t\tdisplayMode = MediaTimeMode.REMAINING_TIME;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tdisplayMode = MediaTimeMode.CURRENT_TIME;\n\t\t\t\t}\n\t\t\t}\n\t\t\tswitch(displayMode)\n\t\t\t{\n\t\t\t\tcase MediaTimeMode.CURRENT_TIME:\n\t\t\t\t{\n\t\t\t\t\tthis.text = this.secondsToTimeString(currentTime);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase MediaTimeMode.TOTAL_TIME:\n\t\t\t\t{\n\t\t\t\t\tthis.text = this.secondsToTimeString(totalTime);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase MediaTimeMode.REMAINING_TIME:\n\t\t\t\t{\n\t\t\t\t\tthis.text = this.secondsToTimeString(currentTime - totalTime);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t{\n\t\t\t\t\tthis.text = this.secondsToTimeString(currentTime) + this._delimiter + this.secondsToTimeString(totalTime);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function secondsToTimeString(seconds:Number):String\n\t\t{\n\t\t\tvar isNegative:Boolean = seconds < 0;\n\t\t\tif(isNegative)\n\t\t\t{\n\t\t\t\tseconds = -seconds;\n\t\t\t}\n\t\t\tvar hours:int = int(seconds / 3600);\n\t\t\tseconds = int(seconds - (hours * 3600));\n\t\t\tvar minutes:int = int(seconds / 60);\n\t\t\tseconds = int(seconds - (minutes * 60));\n\t\t\tvar time:String = minutes + \":\" + (seconds < 10 ? \"0\" : \"\") + seconds;\n\t\t\tif(hours > 0)\n\t\t\t{\n\t\t\t\tif(minutes < 10)\n\t\t\t\t{\n\t\t\t\t\ttime = \"0\" + time;\n\t\t\t\t}\n\t\t\t\ttime = hours + \":\" + time;\n\t\t\t}\n\t\t\tif(isNegative)\n\t\t\t{\n\t\t\t\ttime = \"-\" + time;\n\t\t\t}\n\t\t\treturn time;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function mediaPlayer_currentTimeChangeHandler(event:Event):void\n\t\t{\n\t\t\tthis.updateText();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function mediaPlayer_totalTimeChangeHandler(event:Event):void\n\t\t{\n\t\t\tthis.updateText();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function timeLabel_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled || !this._toggleDisplayMode ||\n\t\t\t\t!(this._displayMode === MediaTimeMode.CURRENT_TIME || this._displayMode === MediaTimeMode.CURRENT_TIME))\n\t\t\t{\n\t\t\t\tthis.touchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this.touchPointID >= 0)\n\t\t\t{\n\t\t\t\tvar touch:Touch = event.getTouch(this, null, this.touchPointID);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\t//this should never happen\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif(touch.phase === TouchPhase.ENDED)\n\t\t\t\t{\n\t\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\t\ttouch.getLocation(this.stage, point);\n\t\t\t\t\tvar isInBounds:Boolean = this.contains(this.stage.hitTest(point));\n\t\t\t\t\tPool.putPoint(point);\n\t\t\t\t\tif(isInBounds)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._isToggled = !this._isToggled;\n\t\t\t\t\t\tthis.updateText();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse //if we get here, we don't have a saved touch ID yet\n\t\t\t{\n\t\t\t\ttouch = event.getTouch(this, TouchPhase.BEGAN);\n\t\t\t\tif(touch)\n\t\t\t\t{\n\t\t\t\t\tthis.touchPointID = touch.id;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/media/VideoPlayer.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.media\n{\n\timport feathers.controls.AutoSizeMode;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.core.PopUpManager;\n\timport feathers.events.FeathersEventType;\n\timport feathers.events.MediaPlayerEventType;\n\timport feathers.skins.IStyleProvider;\n\n\timport flash.display.Stage;\n\timport flash.display.StageDisplayState;\n\timport flash.errors.IllegalOperationError;\n\timport flash.events.FullScreenEvent;\n\timport flash.events.IOErrorEvent;\n\timport flash.events.NetStatusEvent;\n\timport flash.media.SoundTransform;\n\timport flash.net.NetConnection;\n\timport flash.net.NetStream;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.rendering.Painter;\n\timport starling.textures.Texture;\n\n\t/**\n\t * Dispatched when the original native width or height of the video content\n\t * is calculated.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #nativeWidth\n\t * @see #nativeHeight\n\t *\n\t * @eventType feathers.events.MediaPlayerEventType.DIMENSIONS_CHANGE\n\t */\n\t[Event(name=\"dimensionsChange\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the media player changes to the full-screen display mode\n\t * or back to the normal display mode. The value of the\n\t * <code>isFullScreen</code> property indicates if the media player is\n\t * displayed in full screen mode or normally.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #isFullScreen\n\t * @see #toggleFullScreen()\n\t *\n\t * @eventType feathers.events.MediaPlayerEventType.DISPLAY_STATE_CHANGE\n\t */\n\t[Event(name=\"displayStateChange\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the media player's sound transform changes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #soundTransform\n\t *\n\t * @eventType feathers.events.MediaPlayerEventType.SOUND_TRANSFORM_CHANGE\n\t */\n\t[Event(name=\"soundTransformChange\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the video metadata becomes available with the\n\t * <code>onMetaData</code> callback from the <code>NetStream</code> instance.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The metadata object passed with the\n\t *   <code>onMetaData</code> callback from the <code>NetStream</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStream.html#event:onMetaData flash.net.NetStream onMetaData callback\n\t *\n\t * @eventType feathers.events.MediaPlayerEventType.METADATA_RECEIVED\n\t */\n\t[Event(name=\"metadataReceived\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when a cue point is reached with the <code>onCuePoint</code>\n\t * callback from the <code>NetStream</code> instance.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The cue point object passed with the\n\t *   <code>onCuePoint</code> callback from the <code>NetStream</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStream.html#event:onCuePoint flash.net.NetStream onCuePoint callback\n\t *\n\t * @eventType feathers.events.MediaPlayerEventType.CUE_POINT\n\t */\n\t[Event(name=\"metadataReceived\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the video texture is ready to be rendered. Indicates that\n\t * the <code>texture</code> property will return a\n\t * <code>starling.textures.Texture</code> that may be displayed in an\n\t * <code>ImageLoader</code> or another component.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #texture\n\t *\n\t * @eventType starling.events.Event.READY\n\t */\n\t[Event(name=\"ready\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the video texture is no longer valid. Indicates that\n\t * the <code>texture</code> property will return a <code>null</code> value,\n\t * and that that the previous texture has been disposed and should not be\n\t * rendered any more.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #texture\n\t *\n\t * @eventType feathers.events.FeathersEventType.CLEAR\n\t */\n\t[Event(name=\"clear\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched periodically when a media player's content is loading to\n\t * indicate the current progress. The <code>bytesLoaded</code> and\n\t * <code>bytesTotal</code> properties may be accessed to determine the\n\t * exact number of bytes loaded.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>A numeric value between <code>0</code>\n\t *   and <code>1</code> that indicates how much of the media has loaded so far.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #bytesLoaded\n\t * @see #bytesTotal\n\t *\n\t * @eventType feathers.events.MediaPlayerEventType.LOAD_PROGRESS\n\t */\n\t[Event(name=\"loadProgress\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>flash.net.NetStream</code> object dispatches\n\t * <code>flash.events.IOErrorEvent.IO_ERROR</code>.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The <code>flash.events.IOErrorEvent</code>\n\t *   dispatched by the <code>flash.net.NetStream</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStream.html#event:ioError flash.net.NetStream: flash.events.IOErrorEvent.IO_ERROR\n\t *\n\t * @eventType starling.events.Event.IO_ERROR\n\t */\n\t[Event(name=\"ioError\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the <code>flash.net.NetStream</code> object dispatches\n\t * <code>flash.events.NetStatusEvent.NET_STATUS</code> with certain error\n\t * codes.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The code from the event.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.ERROR\n\t */\n\t[Event(name=\"error\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Controls playback of video with a <code>flash.net.NetStream</code> object.\n\t *\n\t * @see ../../../help/video-player.html How to use the Feathers VideoPlayer component\n\t *\n\t * @productversion Feathers 2.2.0\n\t */\n\tpublic class VideoPlayer extends BaseTimedMediaPlayer implements IVideoPlayer, IProgressiveMediaPlayer\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const NET_STATUS_CODE_NETCONNECTION_CONNECT_SUCCESS:String = \"NetConnection.Connect.Success\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const NET_STATUS_CODE_NETSTREAM_PLAY_START:String = \"NetStream.Play.Start\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const NET_STATUS_CODE_NETSTREAM_PLAY_STOP:String = \"NetStream.Play.Stop\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const NET_STATUS_CODE_NETSTREAM_PLAY_STREAMNOTFOUND:String = \"NetStream.Play.StreamNotFound\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const NET_STATUS_CODE_NETSTREAM_PLAY_NOSUPPORTEDTRACKFOUND:String = \"NetStream.Play.NoSupportedTrackFound\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const NO_VIDEO_SOURCE_PLAY_ERROR:String = \"Cannot play media when videoSource property has not been set.\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const NO_VIDEO_SOURCE_PAUSE_ERROR:String = \"Cannot pause media when videoSource property has not been set.\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const NO_VIDEO_SOURCE_SEEK_ERROR:String = \"Cannot seek media when videoSource property has not been set.\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all\n\t\t * <code>VideoPlayer</code> components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultNetConnectionFactory():NetConnection\n\t\t{\n\t\t\tvar connection:NetConnection = new NetConnection();\n\t\t\tconnection.connect(null);\n\t\t\treturn connection;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultNetStreamFactory(netConnection:NetConnection):NetStream\n\t\t{\n\t\t\treturn new NetStream(netConnection);\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function VideoPlayer()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn VideoPlayer.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fullScreenContainer:LayoutGroup;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _ignoreDisplayListEvents:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _soundTransform:SoundTransform;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * <p>In the following example, the audio is muted:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * videoPlayer.soundTransform = new SoundTransform(0);</listing>\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/SoundTransform.html flash.media.SoundTransform\n\t\t * @see #event:soundTransformChange feathers.events.MediaPlayerEventType.SOUND_TRANSFORM_CHANGE\n\t\t */\n\t\tpublic function get soundTransform():SoundTransform\n\t\t{\n\t\t\tif(!this._soundTransform)\n\t\t\t{\n\t\t\t\tthis._soundTransform = new SoundTransform();\n\t\t\t}\n\t\t\treturn this._soundTransform;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set soundTransform(value:SoundTransform):void\n\t\t{\n\t\t\tthis._soundTransform = value;\n\t\t\tif(this._netStream)\n\t\t\t{\n\t\t\t\tthis._netStream.soundTransform = this._soundTransform;\n\t\t\t}\n\t\t\tthis.dispatchEventWith(MediaPlayerEventType.SOUND_TRANSFORM_CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isWaitingForTextureReady:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _texture:Texture;\n\n\t\t/**\n\t\t * The texture used to display the video. This texture is not\n\t\t * automatically rendered by the <code>VideoPlayer</code> component. A\n\t\t * component like an <code>ImageLoader</code> should be added as a child\n\t\t * of the <code>VideoPlayer</code> to display the texture when it is\n\t\t * ready.\n\t\t *\n\t\t * <p>The <code>texture</code> property will initially return\n\t\t * <code>null</code>. Listen for <code>Event.READY</code> to know when\n\t\t * a valid texture is available to render.</p>\n\t\t *\n\t\t * <p>In the following example, a listener is added for\n\t\t * <code>Event.READY</code>, and the texture is displayed by an\n\t\t * <code>ImageLoader</code> component:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * function videoPlayer_readyHandler( event:Event ):void\n\t\t * {\n\t\t *     var view:ImageLoader = new ImageLoader();\n\t\t *     view.source = videoPlayer.texture;\n\t\t *     videoPlayer.addChildAt(view, 0);\n\t\t * }\n\t\t * \n\t\t * videoPlayer.addEventListener( Event.READY, videoPlayer_readyHandler );</listing>\n\t\t *\n\t\t * @see #event:ready starling.events.Event.READY\n\t\t * @see feathers.controls.ImageLoader\n\t\t */\n\t\tpublic function get texture():Texture\n\t\t{\n\t\t\t//there can be runtime errors if the texture is rendered before it\n\t\t\t//is ready, so we must return null until we're sure it's safe\n\t\t\tif(this._isWaitingForTextureReady)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn this._texture;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @see #event:dimensionsChange feathers.events.MediaPlayerEventType.DIMENSIONS_CHANGE\n\t\t */\n\t\tpublic function get nativeWidth():Number\n\t\t{\n\t\t\tif(this._texture)\n\t\t\t{\n\t\t\t\treturn this._texture.nativeWidth;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t *\n\t\t * @see #event:dimensionsChange feathers.events.MediaPlayerEventType.DIMENSIONS_CHANGE\n\t\t */\n\t\tpublic function get nativeHeight():Number\n\t\t{\n\t\t\tif(this._texture)\n\t\t\t{\n\t\t\t\treturn this._texture.nativeHeight;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _netConnection:NetConnection;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _netStream:NetStream;\n\n\t\t/**\n\t\t * The <code>flash.net.NetStream</code> object used to play the video.\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStream.html flash.net.NetStream\n\t\t */\n\t\tpublic function get netStream():NetStream\n\t\t{\n\t\t\treturn this._netStream;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _hasPlayedToEnd:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _videoSource:String;\n\n\t\t/**\n\t\t * A string representing the video URL or any other accepted value that\n\t\t * may be passed to the <code>play()</code> function of a\n\t\t * <code>NetStream</code> object.\n\t\t *\n\t\t * <p>In the following example, a video file URL is passed in:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * videoPlayer.videoSource = \"http://example.com/video.m4v\";</listing>\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStream.html#play() Full description of flash.net.NetStream.play() in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get videoSource():String\n\t\t{\n\t\t\treturn this._videoSource;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set videoSource(value:String):void\n\t\t{\n\t\t\tif(this._videoSource === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._isPlaying)\n\t\t\t{\n\t\t\t\tthis.stop();\n\t\t\t}\n\t\t\tthis.disposeNetStream();\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tthis.disposeNetConnection();\n\t\t\t}\n\t\t\tif(this._texture !== null)\n\t\t\t{\n\t\t\t\tthis._texture.dispose();\n\t\t\t\tthis._texture = null;\n\t\t\t\tthis.dispatchEventWith(FeathersEventType.CLEAR);\n\t\t\t}\n\t\t\tthis._videoSource = value;\n\t\t\t//reset the current and total time if we were playing a different\n\t\t\t//video previously\n\t\t\tif(this._currentTime != 0)\n\t\t\t{\n\t\t\t\tthis._currentTime = 0;\n\t\t\t\tthis.dispatchEventWith(MediaPlayerEventType.CURRENT_TIME_CHANGE);\n\t\t\t}\n\t\t\tif(this._totalTime != 0)\n\t\t\t{\n\t\t\t\tthis._totalTime = 0;\n\t\t\t\tthis.dispatchEventWith(MediaPlayerEventType.TOTAL_TIME_CHANGE);\n\t\t\t}\n\t\t\t//same with the bytes loaded and total\n\t\t\tthis._bytesLoaded = 0;\n\t\t\tthis._bytesTotal = 0;\n\t\t\tif(this._autoPlay && this._videoSource)\n\t\t\t{\n\t\t\t\tthis.play();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _autoPlay:Boolean = true;\n\n\t\t/**\n\t\t * Determines if the video starts playing immediately when the\n\t\t * <code>videoSource</code> property is set.\n\t\t *\n\t\t * <p>In the following example, automatic playback is disabled:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * videoPlayer.autoPlay = false;</listing>\n\t\t *\n\t\t * @see #videoSource\n\t\t */\n\t\tpublic function get autoPlay():Boolean\n\t\t{\n\t\t\treturn this._autoPlay;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set autoPlay(value:Boolean):void\n\t\t{\n\t\t\tthis._autoPlay = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isFullScreen:Boolean = false;\n\n\t\t/**\n\t\t * Indicates if the video player is currently full screen or not. When\n\t\t * the player is full screen, it will be displayed as a modal pop-up\n\t\t * that fills the entire Starling stage. Depending on the value of\n\t\t * <code>fullScreenDisplayState</code>, it may also change the value of\n\t\t * the native stage's <code>displayState</code> property.\n\t\t *\n\t\t * @see #toggleFullScreen()\n\t\t * @see #event:displayStateChange feathers.events.MediaPlayerEventType.DISPLAY_STATE_CHANGE\n\t\t */\n\t\tpublic function get isFullScreen():Boolean\n\t\t{\n\t\t\treturn this._isFullScreen;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _normalDisplayState:String = StageDisplayState.NORMAL;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"fullScreenInteractive,fullScreen,normal\")]\n\t\t/**\n\t\t * When the video player is displayed normally (in other words, when it\n\t\t * isn't full-screen), determines the value of the native stage's\n\t\t * <code>displayState</code> property.\n\t\t *\n\t\t * <p>Using this property, it is possible to set the native stage's\n\t\t * <code>displayState</code> property to\n\t\t * <code>StageDisplayState.FULL_SCREEN_INTERACTIVE</code> or\n\t\t * <code>StageDisplayState.FULL_SCREEN</code> when the video player\n\t\t * is not in full screen mode. This might be useful for mobile apps that\n\t\t * should always display in full screen, while allowing a video player\n\t\t * to toggle between filling the entire stage and displaying at a\n\t\t * smaller size within its parent's layout.</p>\n\t\t *\n\t\t * <p>In the following example, the display state for normal mode\n\t\t * is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * videoPlayer.fullScreenDisplayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;</listing>\n\t\t *\n\t\t * @default StageDisplayState.NORMAL\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/StageDisplayState.html#FULL_SCREEN_INTERACTIVE StageDisplayState.FULL_SCREEN_INTERACTIVE\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/StageDisplayState.html#FULL_SCREEN StageDisplayState.FULL_SCREEN\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/StageDisplayState.html#NORMAL StageDisplayState.NORMAL\n\t\t * @see #fullScreenDisplayState\n\t\t */\n\t\tpublic function get normalDisplayState():String\n\t\t{\n\t\t\treturn this._normalDisplayState;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set normalDisplayState(value:String):void\n\t\t{\n\t\t\tif(this._normalDisplayState == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._normalDisplayState = value;\n\t\t\tif(!this._isFullScreen && this.stage)\n\t\t\t{\n\t\t\t\tvar starling:Starling = this.stage.starling;\n\t\t\t\tvar nativeStage:Stage = starling.nativeStage;\n\t\t\t\tnativeStage.displayState = this._normalDisplayState;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _fullScreenDisplayState:String = StageDisplayState.FULL_SCREEN_INTERACTIVE;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"fullScreenInteractive,fullScreen,normal\")]\n\t\t/**\n\t\t * When the video player is displayed full-screen, determines the value\n\t\t * of the native stage's <code>displayState</code> property.\n\t\t *\n\t\t * <p>Using this property, it is possible to set the native stage's\n\t\t * <code>displayState</code> property to\n\t\t * <code>StageDisplayState.NORMAL</code> when the video player is in\n\t\t * full screen mode. The video player will still be displayed as a modal\n\t\t * pop-up that fills the entire Starling stage, in this situation.</p>\n\t\t *\n\t\t * <p>In the following example, the display state for full-screen mode\n\t\t * is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * videoPlayer.fullScreenDisplayState = StageDisplayState.FULL_SCREEN;</listing>\n\t\t *\n\t\t * @default StageDisplayState.FULL_SCREEN_INTERACTIVE\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/StageDisplayState.html#FULL_SCREEN_INTERACTIVE StageDisplayState.FULL_SCREEN_INTERACTIVE\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/StageDisplayState.html#FULL_SCREEN StageDisplayState.FULL_SCREEN\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/StageDisplayState.html#NORMAL StageDisplayState.NORMAL\n\t\t * @see #normalDisplayState\n\t\t */\n\t\tpublic function get fullScreenDisplayState():String\n\t\t{\n\t\t\treturn this._fullScreenDisplayState;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set fullScreenDisplayState(value:String):void\n\t\t{\n\t\t\tif(this._fullScreenDisplayState == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._fullScreenDisplayState = value;\n\t\t\tif(this._isFullScreen && this.stage)\n\t\t\t{\n\t\t\t\tvar starling:Starling = this.stage.starling;\n\t\t\t\tvar nativeStage:Stage = starling.nativeStage;\n\t\t\t\tnativeStage.displayState = this._fullScreenDisplayState;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _hideRootWhenFullScreen:Boolean = true;\n\n\t\t/**\n\t\t * Determines if the Starling root display object is hidden when the\n\t\t * video player switches to full screen mode. By hiding the root display\n\t\t * object, rendering performance is optimized because Starling skips a\n\t\t * portion of the display list that is obscured by the video player.\n\t\t *\n\t\t * <p>In the following example, the root display object isn't hidden\n\t\t * when the video player is displayed in full screen:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * videoPlayer.hideRootWhenFullScreen = false;</listing>\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic function get hideRootWhenFullScreen():Boolean\n\t\t{\n\t\t\treturn this._hideRootWhenFullScreen;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set hideRootWhenFullScreen(value:Boolean):void\n\t\t{\n\t\t\tthis._hideRootWhenFullScreen = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _netConnectionFactory:Function = defaultNetConnectionFactory;\n\n\t\t/**\n\t\t * Creates the <code>flash.net.NetConnection</code> object used to play\n\t\t * the video, and calls the <code>connect()</code> method. By default, a\n\t\t * value of <code>null</code> is passed to the <code>connect()</code>\n\t\t * method. To pass different parameters, you may use a custom\n\t\t * <code>netConnectionFactory</code>.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function():NetConnection</pre>\n\t\t *\n\t\t * <p>In the following example, a custom factory for the\n\t\t * <code>NetConnection</code> is passed to the video player:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * videoPlayer.netConnectionFactory = function():NetConnection\n\t\t * {\n\t\t *     var connection:NetConnection = new NetConnection();\n\t\t *     connection.connect( command );\n\t\t *     return connection;\n\t\t * };</listing>\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetConnection.html flash.net.NetConnection\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetConnection.html#connect() flash.net.NetConnection.connect()\n\t\t */\n\t\tpublic function get netConnectionFactory():Function\n\t\t{\n\t\t\treturn this._netConnectionFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set netConnectionFactory(value:Function):void\n\t\t{\n\t\t\tif(this._netConnectionFactory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._netConnectionFactory = value;\n\t\t\tthis.stop();\n\t\t\tthis.disposeNetStream();\n\t\t\tthis.disposeNetConnection();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _netStreamFactory:Function = defaultNetStreamFactory;\n\n\t\t/**\n\t\t * Creates the <code>flash.net.NetStream</code> object used to play\n\t\t * the video.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function(netConnection:NetConnection):NetStream</pre>\n\t\t *\n\t\t * <p>In the following example, a custom factory for the\n\t\t * <code>NetStream</code> is passed to the video player:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * videoPlayer.netConnectionFactory = function(netConnection:NetConnection):NetStream\n\t\t * {\n\t\t *     var stream:NetStream = new NetStream(netConnection);\n\t\t *     //change properties here\n\t\t *     return stream;\n\t\t * };</listing>\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStream.html flash.net.NetStream\n\t\t */\n\t\tpublic function get netStreamFactory():Function\n\t\t{\n\t\t\treturn this._netStreamFactory;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set netStreamFactory(value:Function):void\n\t\t{\n\t\t\tif(this._netStreamFactory === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._netStreamFactory = value;\n\t\t\tthis.stop();\n\t\t\tthis.disposeNetStream();\n\t\t\tthis.disposeNetConnection();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _bytesLoaded:uint = 0;\n\n\t\t/**\n\t\t * @copy feathers.media.IProgressiveMediaPlayer#bytesLoaded\n\t\t *\n\t\t * @see #bytesTotal\n\t\t * @see #event:loadProgress feathers.events.MediaPlayerEventType.LOAD_PROGRESS\n\t\t */\n\t\tpublic function get bytesLoaded():uint\n\t\t{\n\t\t\treturn this._bytesLoaded;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _bytesTotal:uint = 0;\n\n\t\t/**\n\t\t * @copy feathers.media.IProgressiveMediaPlayer#bytesTotal\n\t\t *\n\t\t * @see #bytesLoaded\n\t\t * @see #event:loadProgress feathers.events.MediaPlayerEventType.LOAD_PROGRESS\n\t\t */\n\t\tpublic function get bytesTotal():uint\n\t\t{\n\t\t\treturn this._bytesTotal;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tthis.videoSource = null;\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function play():void\n\t\t{\n\t\t\tif(this._videoSource === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsuper.play();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function stop():void\n\t\t{\n\t\t\tif(this._videoSource === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsuper.stop();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function render(painter:Painter):void\n\t\t{\n\t\t\tif(this._isFullScreen)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsuper.render(painter);\n\t\t}\n\n\t\t/**\n\t\t * Goes to full screen or returns to normal display.\n\t\t *\n\t\t * <p> When the player is full screen, it will be displayed as a modal\n\t\t * pop-up that fills the entire Starling stage. Depending on the value\n\t\t * of <code>fullScreenDisplayState</code>, it may also change the value\n\t\t * of the native stage's <code>displayState</code> property.</p>\n\t\t *\n\t\t * <p>When the player is displaying normally (in other words, when it is\n\t\t * not full screen), it will be displayed in its parent's layout like\n\t\t * any other Feathers component.</p>\n\t\t *\n\t\t * @see #isFullScreen\n\t\t * @see #fullScreenDisplayState\n\t\t * @see #normalDisplayState\n\t\t * @see #event:displayStateChange feathers.events.MediaPlayerEventType.DISPLAY_STATE_CHANGE\n\t\t */\n\t\tpublic function toggleFullScreen():void\n\t\t{\n\t\t\tif(!this.stage)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Cannot enter full screen mode if the video player does not have access to the Starling stage.\");\n\t\t\t}\n\t\t\tvar starling:Starling = this.stage.starling;\n\t\t\tvar nativeStage:Stage = starling.nativeStage;\n\t\t\tvar oldIgnoreDisplayListEvents:Boolean = this._ignoreDisplayListEvents;\n\t\t\tthis._ignoreDisplayListEvents = true;\n\t\t\tif(this._isFullScreen)\n\t\t\t{\n\t\t\t\tthis.root.visible = true;\n\t\t\t\tPopUpManager.removePopUp(this._fullScreenContainer, false);\n\t\t\t\tvar childCount:int = this._fullScreenContainer.numChildren;\n\t\t\t\tfor(var i:int = 0; i < childCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar child:DisplayObject = this._fullScreenContainer.getChildAt(0);\n\t\t\t\t\tthis.addChild(child);\n\t\t\t\t}\n\t\t\t\tnativeStage.removeEventListener(FullScreenEvent.FULL_SCREEN, nativeStage_fullScreenHandler);\n\t\t\t\tnativeStage.displayState = this._normalDisplayState;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(this._hideRootWhenFullScreen)\n\t\t\t\t{\n\t\t\t\t\tthis.root.visible = false;\n\t\t\t\t}\n\t\t\t\tnativeStage.displayState = this._fullScreenDisplayState;\n\t\t\t\tif(!this._fullScreenContainer)\n\t\t\t\t{\n\t\t\t\t\tthis._fullScreenContainer = new LayoutGroup();\n\t\t\t\t\tthis._fullScreenContainer.autoSizeMode = AutoSizeMode.STAGE;\n\t\t\t\t}\n\t\t\t\tthis._fullScreenContainer.layout = this._layout;\n\t\t\t\tchildCount = this.numChildren;\n\t\t\t\tfor(i = 0; i < childCount; i++)\n\t\t\t\t{\n\t\t\t\t\tchild = this.getChildAt(0);\n\t\t\t\t\tthis._fullScreenContainer.addChild(child);\n\t\t\t\t}\n\t\t\t\tPopUpManager.addPopUp(this._fullScreenContainer, true, false);\n\t\t\t\tnativeStage.addEventListener(FullScreenEvent.FULL_SCREEN, nativeStage_fullScreenHandler, false, 0, true);\n\t\t\t}\n\t\t\tthis._ignoreDisplayListEvents = oldIgnoreDisplayListEvents;\n\t\t\tthis._isFullScreen = !this._isFullScreen;\n\t\t\tthis.dispatchEventWith(MediaPlayerEventType.DISPLAY_STATE_CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function playMedia():void\n\t\t{\n\t\t\tif(!this._videoSource)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(NO_VIDEO_SOURCE_PLAY_ERROR);\n\t\t\t}\n\t\t\tif(this._netConnection === null)\n\t\t\t{\n\t\t\t\tvar netConnectionFactory:Function = this._netConnectionFactory !== null ? this._netConnectionFactory : defaultNetConnectionFactory;\n\t\t\t\tthis._netConnection = NetConnection(netConnectionFactory());\n\t\t\t}\n\t\t\tif(this._netStream === null)\n\t\t\t{\n\t\t\t\tif(!this._netConnection.connected)\n\t\t\t\t{\n\t\t\t\t\t//wait for the NetConnection to connect before trying to\n\t\t\t\t\t//create the NetStream. we'll call playMedia later.\n\t\t\t\t\tthis._netConnection.addEventListener(NetStatusEvent.NET_STATUS, netConnection_netStatusHandler);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar netStreamFactory:Function = this._netStreamFactory !== null ? this._netStreamFactory : defaultNetStreamFactory;\n\t\t\t\tthis._netStream = NetStream(netStreamFactory(this._netConnection));\n\t\t\t\tthis._netStream.client = new VideoPlayerNetStreamClient(\n\t\t\t\t\tthis.netStream_onMetaData, this.netStream_onCuePoint,\n\t\t\t\t\tthis.netStream_onXMPData);\n\t\t\t\tthis._netStream.addEventListener(NetStatusEvent.NET_STATUS, netStream_netStatusHandler);\n\t\t\t\tthis._netStream.addEventListener(IOErrorEvent.IO_ERROR, netStream_ioErrorHandler);\n\t\t\t}\n\t\t\tif(this._soundTransform === null)\n\t\t\t{\n\t\t\t\tthis._soundTransform = new SoundTransform();\n\t\t\t}\n\t\t\tthis._netStream.soundTransform = this._soundTransform;\n\t\t\tvar onCompleteCallback:Function = videoTexture_onComplete;\n\t\t\tif(this._texture !== null)\n\t\t\t{\n\t\t\t\tif(this._hasPlayedToEnd)\n\t\t\t\t{\n\t\t\t\t\t//after playing the media until the end, if we restart from the\n\t\t\t\t\t//beginning, the audio plays, but we cannot see the video.\n\t\t\t\t\t//however, we can ask the NetStream to play the video source\n\t\t\t\t\t//again from the beginning, and the video displays. if we need\n\t\t\t\t\t//to restore the time, we can do it after the NetStream\n\t\t\t\t\t//dispatches NetStream.Play.Start\n\t\t\t\t\tthis._netStream.play(this._videoSource);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//this case happens if the video is paused and resumed without\n\t\t\t\t\t//reaching the end.\n\t\t\t\t\t//NetStream.Play.Start will not be dispatched after calling\n\t\t\t\t\t//resume(), so we need to manually add the ENTER_FRAME listener.\n\t\t\t\t\t//there's no need to seek. we're resuming from where the video\n\t\t\t\t\t//was paused.\n\t\t\t\t\tthis.addEventListener(Event.ENTER_FRAME, videoPlayer_enterFrameHandler);\n\t\t\t\t\tthis._netStream.resume();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//in the final case, the texture hasn't been created yet.\n\t\t\t\tthis._isWaitingForTextureReady = true;\n\t\t\t\tvar starling:Starling = this.stage !== null ? this.stage.starling : Starling.current;\n\t\t\t\tthis._texture = Texture.fromNetStream(this._netStream, starling.contentScaleFactor, onCompleteCallback);\n\t\t\t\tthis._texture.root.onRestore = videoTexture_onRestore;\n\t\t\t\t//don't call play() until after Texture.fromNetStream() because\n\t\t\t\t//the texture needs to be created first.\n\t\t\t\t//however, we need to call play() even though a video texture\n\t\t\t\t//isn't ready to be rendered yet.\n\t\t\t\tthis._netStream.play(this._videoSource);\n\t\t\t}\n\t\t\tthis._hasPlayedToEnd = false;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function pauseMedia():void\n\t\t{\n\t\t\tif(!this._videoSource)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(NO_VIDEO_SOURCE_PAUSE_ERROR);\n\t\t\t}\n\t\t\tthis.removeEventListener(Event.ENTER_FRAME, videoPlayer_enterFrameHandler);\n\t\t\tthis._netStream.pause();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function seekMedia(seconds:Number):void\n\t\t{\n\t\t\tif(!this._videoSource)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(NO_VIDEO_SOURCE_SEEK_ERROR);\n\t\t\t}\n\t\t\tthis._currentTime = seconds;\n\t\t\tif(this._hasPlayedToEnd)\n\t\t\t{\n\t\t\t\t//the video played until the end, which means that the current\n\t\t\t\t//texture cannot seek properly without reloading the media.\n\t\t\t\tthis.playMedia();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._netStream.seek(seconds);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function disposeNetConnection():void\n\t\t{\n\t\t\tif(this._netConnection === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._netConnection.removeEventListener(NetStatusEvent.NET_STATUS, netConnection_netStatusHandler);\n\t\t\tthis._netConnection.close();\n\t\t\tthis._netConnection = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function disposeNetStream():void\n\t\t{\n\t\t\tif(this._netStream === null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.removeEventListener(Event.ENTER_FRAME, videoPlayer_progress_enterFrameHandler);\n\n\t\t\tthis._netStream.removeEventListener(NetStatusEvent.NET_STATUS, netStream_netStatusHandler);\n\t\t\tthis._netStream.removeEventListener(IOErrorEvent.IO_ERROR, netStream_ioErrorHandler);\n\t\t\tthis._netStream.close();\n\t\t\tthis._netStream = null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function videoPlayer_enterFrameHandler(event:Event):void\n\t\t{\n\t\t\tthis.setRequiresRedraw();\n\t\t\tthis._currentTime = this._netStream.time;\n\t\t\tthis.dispatchEventWith(MediaPlayerEventType.CURRENT_TIME_CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function videoPlayer_progress_enterFrameHandler(event:Event):void\n\t\t{\n\t\t\tvar newBytesTotal:Number = this._netStream.bytesTotal;\n\t\t\tif(newBytesTotal > 0)\n\t\t\t{\n\t\t\t\tvar needsDispatch:Boolean = false;\n\t\t\t\tvar newBytesLoaded:Number = this._netStream.bytesLoaded;\n\t\t\t\tif(this._bytesTotal != newBytesTotal)\n\t\t\t\t{\n\t\t\t\t\tthis._bytesTotal = newBytesTotal;\n\t\t\t\t\tneedsDispatch = true;\n\t\t\t\t}\n\t\t\t\tif(this._bytesLoaded != newBytesLoaded)\n\t\t\t\t{\n\t\t\t\t\tthis._bytesLoaded = newBytesLoaded;\n\t\t\t\t\tneedsDispatch = true;\n\t\t\t\t}\n\t\t\t\tif(needsDispatch)\n\t\t\t\t{\n\t\t\t\t\tthis.dispatchEventWith(MediaPlayerEventType.LOAD_PROGRESS, false, newBytesLoaded / newBytesTotal);\n\t\t\t\t}\n\t\t\t\tif(newBytesLoaded == newBytesTotal)\n\t\t\t\t{\n\t\t\t\t\tthis.removeEventListener(Event.ENTER_FRAME, videoPlayer_progress_enterFrameHandler);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function videoTexture_onRestore():void\n\t\t{\n\t\t\tthis.pauseMedia();\n\t\t\tthis._isWaitingForTextureReady = true;\n\t\t\tthis._texture.root.attachNetStream(this._netStream, videoTexture_onComplete);\n\t\t\t//this will start playback from the beginning again, but we can seek\n\t\t\t//back to the current time once the video texture is ready.\n\t\t\tthis._netStream.play(this._videoSource);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function videoTexture_onComplete():void\n\t\t{\n\t\t\tthis._isWaitingForTextureReady = false;\n\t\t\t//the texture is ready to be displayed\n\t\t\tthis.dispatchEventWith(Event.READY);\n\t\t\t//in many cases, the layout will be affected by the new texture\n\t\t\t//dimensions, so invalidate immediately\n\t\t\tthis.invalidate(INVALIDATION_FLAG_LAYOUT);\n\t\t\tvar bytesTotal:Number = this._netStream.bytesTotal;\n\t\t\tif(this._bytesTotal == 0 && bytesTotal > 0)\n\t\t\t{\n\t\t\t\tthis._bytesLoaded = this._netStream.bytesLoaded;\n\t\t\t\tthis._bytesTotal = bytesTotal;\n\t\t\t\tthis.dispatchEventWith(MediaPlayerEventType.LOAD_PROGRESS, false, this._bytesLoaded / bytesTotal);\n\t\t\t\tif(this._bytesLoaded != this._bytesTotal)\n\t\t\t\t{\n\t\t\t\t\tthis.addEventListener(Event.ENTER_FRAME, videoPlayer_progress_enterFrameHandler);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function netConnection_netStatusHandler(event:NetStatusEvent):void\n\t\t{\n\t\t\tvar code:String = event.info.code;\n\t\t\tswitch(code)\n\t\t\t{\n\t\t\t\tcase NET_STATUS_CODE_NETCONNECTION_CONNECT_SUCCESS:\n\t\t\t\t{\n\t\t\t\t\tthis.playMedia();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function netStream_onMetaData(metadata:Object):void\n\t\t{\n\t\t\tthis.dispatchEventWith(MediaPlayerEventType.DIMENSIONS_CHANGE);\n\t\t\tthis._totalTime = metadata.duration;\n\t\t\tthis.dispatchEventWith(MediaPlayerEventType.TOTAL_TIME_CHANGE);\n\t\t\tthis.dispatchEventWith(MediaPlayerEventType.METADATA_RECEIVED, false, metadata);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function netStream_onCuePoint(cuePoint:Object):void\n\t\t{\n\t\t\tthis.dispatchEventWith(MediaPlayerEventType.CUE_POINT, false, cuePoint);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function netStream_onXMPData(xmpData:Object):void\n\t\t{\n\t\t\tthis.dispatchEventWith(MediaPlayerEventType.XMP_DATA, false, xmpData);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function netStream_ioErrorHandler(event:IOErrorEvent):void\n\t\t{\n\t\t\tthis.dispatchEventWith(event.type, false, event);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function netStream_netStatusHandler(event:NetStatusEvent):void\n\t\t{\n\t\t\tvar code:String = event.info.code;\n\t\t\tswitch(code)\n\t\t\t{\n\t\t\t\tcase NET_STATUS_CODE_NETSTREAM_PLAY_STREAMNOTFOUND:\n\t\t\t\t{\n\t\t\t\t\tthis.dispatchEventWith(FeathersEventType.ERROR, false, code);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase NET_STATUS_CODE_NETSTREAM_PLAY_NOSUPPORTEDTRACKFOUND:\n\t\t\t\t{\n\t\t\t\t\tthis.dispatchEventWith(FeathersEventType.ERROR, false, code);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase NET_STATUS_CODE_NETSTREAM_PLAY_START:\n\t\t\t\t{\n\t\t\t\t\tif(this._netStream.time != this._currentTime)\n\t\t\t\t\t{\n\t\t\t\t\t\t//if we're restoring from a lost context, or we've\n\t\t\t\t\t\t//restarted the video after it had reached the end, the\n\t\t\t\t\t\t//NetStream may have restarted from the beginning. in\n\t\t\t\t\t\t//that case, we can manually seek to the last known good\n\t\t\t\t\t\t//position.\n\t\t\t\t\t\tthis._netStream.seek(this._currentTime);\n\t\t\t\t\t}\n\t\t\t\t\tif(this._isPlaying)\n\t\t\t\t\t{\n\t\t\t\t\t\t//only add the listener if a video is playing. it may be\n\t\t\t\t\t\t//paused when restoring lost context, but we need to\n\t\t\t\t\t\t//temporarily start playing the NetStream in order to\n\t\t\t\t\t\t//restore the video texture.\n\t\t\t\t\t\tthis.addEventListener(Event.ENTER_FRAME, videoPlayer_enterFrameHandler);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//the only way to prepare the video texture is to start\n\t\t\t\t\t\t//playing the NetStream. the media player is not in a\n\t\t\t\t\t\t//playing state, though, so we should pause the\n\t\t\t\t\t\t//NetStream now.\n\t\t\t\t\t\tthis.pauseMedia();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase NET_STATUS_CODE_NETSTREAM_PLAY_STOP:\n\t\t\t\t{\n\t\t\t\t\tif(this._hasPlayedToEnd)\n\t\t\t\t\t{\n\t\t\t\t\t\t//we haven't cleared this flag yet after calling play()\n\t\t\t\t\t\t//on the NetStream. it is safe to ignore this case.\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t//any time that the NetStream stops, we want to remove the\n\t\t\t\t\t//Event.ENTER_FRAME listener. in most cases, we don't want\n\t\t\t\t\t//a listener being called every frame for no reason. on iOS,\n\t\t\t\t\t//context loss resets the NetStream time to 0, and we need\n\t\t\t\t\t//to keep the current time so that we can seek back.\n\t\t\t\t\tthis.removeEventListener(Event.ENTER_FRAME, videoPlayer_enterFrameHandler);\n\n\t\t\t\t\t//on iOS, when context is lost, the NetStream will stop\n\t\t\t\t\t//automatically, and the time property will be reset to 0.\n\t\t\t\t\t//on other platforms, the NetStream will continue playing on\n\t\t\t\t\t//context loss, and the time will be correct.\n\t\t\t\t\t//we need to check if the context is lost or not to decide\n\t\t\t\t\t//if we've reached the end of the video or not.\n\t\t\t\t\tif(Starling.context.driverInfo !== \"Disposed\")\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.stop();\n\n\t\t\t\t\t\t//set this flag after calling stop() because stopping\n\t\t\t\t\t\t//will seek to the beginning and may check for the flag.\n\t\t\t\t\t\tthis._hasPlayedToEnd = true;\n\t\t\t\t\t\tthis.dispatchEventWith(Event.COMPLETE);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function mediaPlayer_addedHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreDisplayListEvents)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsuper.mediaPlayer_addedHandler(event);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function mediaPlayer_removedHandler(event:Event):void\n\t\t{\n\t\t\tif(this._ignoreDisplayListEvents)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsuper.mediaPlayer_removedHandler(event);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function nativeStage_fullScreenHandler(event:FullScreenEvent):void\n\t\t{\n\t\t\tthis.toggleFullScreen();\n\t\t}\n\t}\n}\n\ndynamic class VideoPlayerNetStreamClient\n{\n\tpublic function VideoPlayerNetStreamClient(onMetaDataCallback:Function,\n\t\tonCuePointCallback:Function, onXMPDataCallback:Function)\n\t{\n\t\tthis.onMetaDataCallback = onMetaDataCallback;\n\t\tthis.onCuePointCallback = onCuePointCallback;\n\t\tthis.onXMPDataCallback = onXMPDataCallback;\n\t}\n\n\tpublic var onMetaDataCallback:Function;\n\n\tpublic var onCuePointCallback:Function;\n\n\tpublic function onMetaData(metadata:Object):void\n\t{\n\t\tthis.onMetaDataCallback(metadata);\n\t}\n\n\tpublic function onCuePoint(cuePoint:Object):void\n\t{\n\t\tthis.onCuePointCallback(cuePoint);\n\t}\n\n\tpublic function onXMPData(xmpData:Object):void\n\t{\n\t\tthis.onXMPDataCallback(xmpData);\n\t}\n}"
  },
  {
    "path": "source/feathers/media/VolumeSlider.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.media\n{\n\timport feathers.controls.Slider;\n\timport feathers.events.MediaPlayerEventType;\n\timport feathers.skins.IStyleProvider;\n\n\timport flash.media.SoundTransform;\n\n\timport starling.events.Event;\n\n\t/**\n\t * A specialized slider that controls the volume of a media player that\n\t * plays audio content.\n\t *\n\t * @see ../../../help/sound-player.html How to use the Feathers SoundPlayer component\n\t * @see ../../../help/video-player.html How to use the Feathers VideoPlayer component\n\t *\n\t * @productversion Feathers 2.2.0\n\t */\n\tpublic class VolumeSlider extends Slider implements IMediaPlayerControl\n\t{\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the\n\t\t * minimum track.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_MINIMUM_TRACK:String = \"feathers-volume-slider-minimum-track\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the\n\t\t * maximum track.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_MAXIMUM_TRACK:String = \"feathers-volume-slider-maximum-track\";\n\n\t\t/**\n\t\t * The default value added to the <code>styleNameList</code> of the thumb.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#styleNameList\n\t\t */\n\t\tpublic static const DEFAULT_CHILD_STYLE_NAME_THUMB:String = \"feathers-volume-slider-thumb\";\n\n\t\t/**\n\t\t * The default <code>IStyleProvider</code> for all\n\t\t * <code>VolumeSlider</code> components.\n\t\t *\n\t\t * @default null\n\t\t * @see feathers.core.FeathersControl#styleProvider\n\t\t */\n\t\tpublic static var globalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function VolumeSlider()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.thumbStyleName = VolumeSlider.DEFAULT_CHILD_STYLE_NAME_THUMB;\n\t\t\tthis.minimumTrackStyleName = VolumeSlider.DEFAULT_CHILD_STYLE_NAME_MINIMUM_TRACK;\n\t\t\tthis.maximumTrackStyleName = VolumeSlider.DEFAULT_CHILD_STYLE_NAME_MAXIMUM_TRACK;\n\t\t\tthis.minimum = 0;\n\t\t\tthis.maximum = 1;\n\t\t\tthis.addEventListener(Event.CHANGE, volumeSlider_changeHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function get defaultStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn VolumeSlider.globalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _ignoreChanges:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _mediaPlayer:IAudioPlayer;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get mediaPlayer():IMediaPlayer\n\t\t{\n\t\t\treturn this._mediaPlayer;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set mediaPlayer(value:IMediaPlayer):void\n\t\t{\n\t\t\tif(this._mediaPlayer == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._mediaPlayer = value as IAudioPlayer;\n\t\t\tthis.refreshVolumeFromMediaPlayer();\n\t\t\tif(this._mediaPlayer)\n\t\t\t{\n\t\t\t\tthis._mediaPlayer.addEventListener(MediaPlayerEventType.SOUND_TRANSFORM_CHANGE, mediaPlayer_soundTransformChangeHandler);\n\t\t\t}\n\t\t\tthis.invalidate(INVALIDATION_FLAG_DATA);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function refreshVolumeFromMediaPlayer():void\n\t\t{\n\t\t\tvar oldIgnoreChanges:Boolean = this._ignoreChanges;\n\t\t\tthis._ignoreChanges = true;\n\t\t\tif(this._mediaPlayer)\n\t\t\t{\n\t\t\t\tthis.value = this._mediaPlayer.soundTransform.volume;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.value = 0;\n\t\t\t}\n\t\t\tthis._ignoreChanges = oldIgnoreChanges;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function mediaPlayer_soundTransformChangeHandler(event:Event):void\n\t\t{\n\t\t\tthis.refreshVolumeFromMediaPlayer();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function volumeSlider_changeHandler(event:Event):void\n\t\t{\n\t\t\tif(!this._mediaPlayer || this._ignoreChanges)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar soundTransform:SoundTransform = this._mediaPlayer.soundTransform;\n\t\t\tsoundTransform.volume = this._value;\n\t\t\tthis._mediaPlayer.soundTransform = soundTransform;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/motion/ColorFade.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.motion\n{\n\timport feathers.motion.effectClasses.IEffectContext;\n\timport feathers.motion.effectClasses.TweenEffectContext;\n\n\timport starling.animation.Transitions;\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\n\t[Exclude(name=\"createBlackFadeToBlackTransition\",kind=\"method\")]\n\n\t/**\n\t * Creates animated transitions for screen navigators that fade a display\n\t * object to a solid color.\n\t *\n\t * @see ../../../help/transitions.html#colorfade Transitions for Feathers screen navigators: ColorFade\n\t *\n\t * @productversion Feathers 2.1.0\n\t */\n\tpublic class ColorFade\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const SCREEN_REQUIRED_ERROR:String = \"Cannot transition if both old screen and new screen are null.\";\n\n\t\t/**\n\t\t * @private\n\t\t * This was accidentally named wrong. It is included for temporary\n\t\t * backward compatibility.\n\t\t */\n\t\tpublic static function createBlackFadeToBlackTransition(duration:Number = 0.75, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn createBlackFadeTransition(duration, ease, tweenProperties);\n\t\t}\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that hides the\n\t\t * old screen as a solid black color fades in over it. Then, the solid\n\t\t * black color fades back out to show that the new screen has replaced\n\t\t * the old screen.\n\t\t *\n\t\t * @see ../../../help/transitions.html#colorfade Transitions for Feathers screen navigators: ColorFade\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createBlackFadeTransition(duration:Number = 0.75, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn createColorFadeTransition(0x000000, duration, ease, tweenProperties);\n\t\t}\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that hides the old screen as a solid\n\t\t * white color fades in over it. Then, the solid white color fades back\n\t\t * out to show that the new screen has replaced the old screen.\n\t\t *\n\t\t * @see ../../../help/transitions.html#colorfade Transitions for Feathers screen navigators: ColorFade\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createWhiteFadeTransition(duration:Number = 0.75, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn createColorFadeTransition(0xffffff, duration, ease, tweenProperties);\n\t\t}\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that hides the\n\t\t * old screen as a customizable solid color fades in over it. Then, the\n\t\t * solid color fades back out to show that the new screen has replaced\n\t\t * the old screen.\n\t\t *\n\t\t * @see ../../../help/transitions.html#colorfade Transitions for Feathers screen navigators: ColorFade\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createColorFadeTransition(color:uint, duration:Number = 0.75, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tif(newScreen)\n\t\t\t\t{\n\t\t\t\t\tnewScreen.alpha = 0;\n\t\t\t\t\tif(oldScreen) //oldScreen can be null, that's okay\n\t\t\t\t\t{\n\t\t\t\t\t\toldScreen.alpha = 1;\n\t\t\t\t\t}\n\t\t\t\t\tvar tween:ColorFadeTween = new ColorFadeTween(newScreen, oldScreen, color, duration, ease, onComplete, tweenProperties);\n\t\t\t\t}\n\t\t\t\telse //we only have the old screen\n\t\t\t\t{\n\t\t\t\t\toldScreen.alpha = 1;\n\t\t\t\t\ttween = new ColorFadeTween(oldScreen, null, color, duration, ease, onComplete, tweenProperties);\n\t\t\t\t}\n\t\t\t\tif(managed)\n\t\t\t\t{\n\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t}\n\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\t}\n}\n\nimport starling.animation.Tween;\nimport starling.core.Starling;\nimport starling.display.DisplayObject;\nimport starling.display.DisplayObjectContainer;\nimport starling.display.Quad;\n\nclass ColorFadeTween extends Tween\n{\n\tpublic function ColorFadeTween(target:DisplayObject, otherTarget:DisplayObject,\n\t\tcolor:uint, duration:Number, ease:Object, onCompleteCallback:Function,\n\t\ttweenProperties:Object)\n\t{\n\t\tsuper(target, duration, ease);\n\t\tif(target.alpha == 0)\n\t\t{\n\t\t\tthis.fadeTo(1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.fadeTo(0);\n\t\t}\n\t\tif(tweenProperties)\n\t\t{\n\t\t\tfor(var propertyName:String in tweenProperties)\n\t\t\t{\n\t\t\t\tthis[propertyName] = tweenProperties[propertyName];\n\t\t\t}\n\t\t}\n\t\tif(otherTarget)\n\t\t{\n\t\t\tthis._otherTarget = otherTarget;\n\t\t\ttarget.visible = false;\n\t\t}\n\t\tthis.onUpdate = this.updateOverlay;\n\t\tthis._onCompleteCallback = onCompleteCallback;\n\t\tthis.onComplete = this.cleanupTween;\n\n\t\tvar navigator:DisplayObjectContainer = target.parent;\n\t\tthis._overlay = new Quad(1, 1, color);\n\t\tthis._overlay.width = navigator.width;\n\t\tthis._overlay.height = navigator.height;\n\t\tthis._overlay.alpha = 0;\n\t\tthis._overlay.touchable = false;\n\t\tnavigator.addChild(this._overlay);\n\t}\n\n\tprivate var _otherTarget:DisplayObject;\n\tprivate var _overlay:Quad;\n\tprivate var _onCompleteCallback:Function;\n\n\tprivate function updateOverlay():void\n\t{\n\t\tvar progress:Number = this.progress;\n\t\tif(progress < 0.5)\n\t\t{\n\t\t\ttarget.visible = false;\n\t\t\tif(this._otherTarget)\n\t\t\t{\n\t\t\t\tthis._otherTarget.visible = true;\n\t\t\t}\n\t\t\tthis._overlay.alpha = progress * 2;\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttarget.visible = true;\n\t\t\tif(this._otherTarget)\n\t\t\t{\n\t\t\t\tthis._otherTarget.visible = false;\n\t\t\t}\n\t\t\tthis._overlay.alpha = (1 - progress) * 2;\n\t\t}\n\t}\n\n\tprivate function cleanupTween():void\n\t{\n\t\tthis._overlay.removeFromParent(true);\n\t\tthis.target.visible = true;\n\t\tif(this._otherTarget)\n\t\t{\n\t\t\tthis._otherTarget.visible = true;\n\t\t}\n\t\tif(this._onCompleteCallback !== null)\n\t\t{\n\t\t\tthis._onCompleteCallback();\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/motion/Cover.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.motion\n{\n\timport feathers.motion.effectClasses.IEffectContext;\n\timport feathers.motion.effectClasses.TweenEffectContext;\n\n\timport starling.animation.Transitions;\n\timport starling.animation.Tween;\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * Creates animated transitions for screen navigators that slide a new\n\t * display object into view by animating the <code>x</code> and\n\t * <code>y</code> properties, while covering an existing display object that\n\t * remains stationary below. The display object may slide up, right,\n\t * down, or left.\n\t *\n\t * @see ../../../help/transitions.html#cover Transitions for Feathers screen navigators: Cover\n\t *\n\t * @productversion Feathers 2.1.0\n\t */\n\tpublic class Cover\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const SCREEN_REQUIRED_ERROR:String = \"Cannot transition if both old screen and new screen are null.\";\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that slides the\n\t\t * new screen into view to the left, animating the <code>x</code>\n\t\t * property, to cover up the old screen, which remains stationary.\n\t\t *\n\t\t * @see ../../../help/transitions.html#cover Transitions for Feathers screen navigators: Cover\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createCoverLeftTransition(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tif(newScreen)\n\t\t\t\t{\n\t\t\t\t\tnewScreen.x = newScreen.width;\n\t\t\t\t\tnewScreen.y = 0;\n\t\t\t\t}\n\t\t\t\tif(oldScreen)\n\t\t\t\t{\n\t\t\t\t\toldScreen.x = 0;\n\t\t\t\t\toldScreen.y = 0;\n\t\t\t\t\tvar tween:CoverTween = new CoverTween(newScreen, oldScreen, -oldScreen.width, 0, duration, ease, managed ? null : onComplete, tweenProperties);\n\t\t\t\t\tif(managed)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t\t}\n\t\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\t//we only have the new screen\n\t\t\t\treturn slideInNewScreen(newScreen, duration, ease, tweenProperties, onComplete, managed);\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that slides the\n\t\t * new screen into view to the right, animating the <code>x</code>\n\t\t * property, to cover up the old screen, which remains stationary.\n\t\t *\n\t\t * @see ../../../help/transitions.html#cover Transitions for Feathers screen navigators: Cover\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createCoverRightTransition(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tif(newScreen)\n\t\t\t\t{\n\t\t\t\t\tnewScreen.x = -newScreen.width;\n\t\t\t\t\tnewScreen.y = 0;\n\t\t\t\t}\n\t\t\t\tif(oldScreen)\n\t\t\t\t{\n\t\t\t\t\toldScreen.x = 0;\n\t\t\t\t\toldScreen.y = 0;\n\t\t\t\t\tvar tween:CoverTween = new CoverTween(newScreen, oldScreen, oldScreen.width, 0, duration, ease, managed ? null : onComplete, tweenProperties);\n\t\t\t\t\tif(managed)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t\t}\n\t\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\t//we only have the new screen\n\t\t\t\treturn slideInNewScreen(newScreen, duration, ease, tweenProperties, onComplete, managed);\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that slides the\n\t\t * new screen up into view, animating the <code>y</code> property, to\n\t\t * cover up the old screen, which remains stationary.\n\t\t *\n\t\t * @see ../../../help/transitions.html#cover Transitions for Feathers screen navigators: Cover\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createCoverUpTransition(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tif(newScreen)\n\t\t\t\t{\n\t\t\t\t\tnewScreen.x = 0;\n\t\t\t\t\tnewScreen.y = newScreen.height;\n\t\t\t\t}\n\t\t\t\tif(oldScreen)\n\t\t\t\t{\n\t\t\t\t\toldScreen.x = 0;\n\t\t\t\t\toldScreen.y = 0;\n\t\t\t\t\tvar tween:CoverTween = new CoverTween(newScreen, oldScreen, 0, -oldScreen.height, duration, ease, managed ? null : onComplete, tweenProperties);\n\t\t\t\t\tif(managed)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t\t}\n\t\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\t//we only have the new screen\n\t\t\t\treturn slideInNewScreen(newScreen, duration, ease, tweenProperties, onComplete, managed);\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that slides the\n\t\t * new screen down into view, animating the <code>y</code> property, to\n\t\t * cover up the old screen, which remains stationary.\n\t\t *\n\t\t * @see ../../../help/transitions.html#cover Transitions for Feathers screen navigators: Cover\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createCoverDownTransition(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tif(newScreen)\n\t\t\t\t{\n\t\t\t\t\tnewScreen.x = 0;\n\t\t\t\t\tnewScreen.y = -newScreen.height;\n\t\t\t\t}\n\t\t\t\tif(oldScreen)\n\t\t\t\t{\n\t\t\t\t\toldScreen.x = 0;\n\t\t\t\t\toldScreen.y = 0;\n\t\t\t\t\tvar tween:CoverTween = new CoverTween(newScreen, oldScreen, 0, oldScreen.height, duration, ease, managed ? null : onComplete, tweenProperties);\n\t\t\t\t\tif(managed)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t\t}\n\t\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\t//we only have the new screen\n\t\t\t\treturn slideInNewScreen(newScreen, duration, ease, tweenProperties, onComplete, managed);\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static function slideInNewScreen(newScreen:DisplayObject,\n\t\t\tduration:Number, ease:Object, tweenProperties:Object, onComplete:Function, managed:Boolean):IEffectContext\n\t\t{\n\t\t\tvar tween:Tween = new Tween(newScreen, duration, ease);\n\t\t\tif(newScreen.x != 0)\n\t\t\t{\n\t\t\t\ttween.animate(\"x\", 0);\n\t\t\t}\n\t\t\tif(newScreen.y != 0)\n\t\t\t{\n\t\t\t\ttween.animate(\"y\", 0);\n\t\t\t}\n\t\t\tif(tweenProperties)\n\t\t\t{\n\t\t\t\tfor(var propertyName:String in tweenProperties)\n\t\t\t\t{\n\t\t\t\t\ttween[propertyName] = tweenProperties[propertyName];\n\t\t\t\t}\n\t\t\t}\n\t\t\ttween.onComplete = onComplete;\n\t\t\tif(managed)\n\t\t\t{\n\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t}\n\t\t\tStarling.juggler.add(tween);\n\t\t\treturn null;\n\t\t}\n\t}\n}\n\nimport feathers.display.RenderDelegate;\n\nimport starling.animation.Tween;\nimport starling.core.Starling;\nimport starling.display.DisplayObject;\nimport starling.display.Quad;\nimport starling.display.Sprite;\n\nclass CoverTween extends Tween\n{\n\tpublic function CoverTween(newScreen:DisplayObject, oldScreen:DisplayObject,\n\t\txOffset:Number, yOffset:Number, duration:Number, ease:Object, onCompleteCallback:Function,\n\t\ttweenProperties:Object)\n\t{\n\t\tvar mask:Quad = new Quad(1, 1, 0xff00ff);\n\t\t//the initial dimensions cannot be 0 or there's a runtime error,\n\t\t//and these values might be 0\n\t\tmask.width = oldScreen.width;\n\t\tmask.height = oldScreen.height;\n\t\tthis._temporaryParent = new Sprite();\n\t\tthis._temporaryParent.mask = mask;\n\t\toldScreen.parent.addChild(this._temporaryParent);\n\t\tvar delegate:RenderDelegate = new RenderDelegate(oldScreen);\n\t\tdelegate.alpha = oldScreen.alpha;\n\t\tdelegate.blendMode = oldScreen.blendMode;\n\t\tdelegate.rotation = oldScreen.rotation;\n\t\tdelegate.scaleX = oldScreen.scaleX;\n\t\tdelegate.scaleY = oldScreen.scaleY;\n\t\tthis._temporaryParent.addChild(delegate);\n\t\toldScreen.visible = false;\n\t\tthis._savedOldScreen = oldScreen;\n\n\t\tsuper(this._temporaryParent.mask, duration, ease);\n\n\t\tif(xOffset < 0)\n\t\t{\n\t\t\tthis.animate(\"width\", 0);\n\t\t}\n\t\telse if(xOffset > 0)\n\t\t{\n\t\t\tthis.animate(\"x\", xOffset);\n\t\t\tthis.animate(\"width\", 0);\n\t\t}\n\t\tif(yOffset < 0)\n\t\t{\n\t\t\tthis.animate(\"height\", 0);\n\t\t}\n\t\telse if(yOffset > 0)\n\t\t{\n\t\t\tthis.animate(\"y\", yOffset);\n\t\t\tthis.animate(\"height\", 0);\n\t\t}\n\t\tif(tweenProperties)\n\t\t{\n\t\t\tfor(var propertyName:String in tweenProperties)\n\t\t\t{\n\t\t\t\tthis[propertyName] = tweenProperties[propertyName];\n\t\t\t}\n\t\t}\n\t\tthis._onCompleteCallback = onCompleteCallback;\n\t\tif(newScreen)\n\t\t{\n\t\t\tthis._savedNewScreen = newScreen;\n\t\t\tthis._savedXOffset = xOffset;\n\t\t\tthis._savedYOffset = yOffset;\n\t\t\tthis.onUpdate = this.updateNewScreen;\n\t\t}\n\t\tthis.onComplete = this.cleanupTween;\n\t}\n\n\tprivate var _savedXOffset:Number;\n\tprivate var _savedYOffset:Number;\n\tprivate var _savedOldScreen:DisplayObject;\n\tprivate var _savedNewScreen:DisplayObject;\n\tprivate var _temporaryParent:Sprite;\n\tprivate var _onCompleteCallback:Function;\n\n\tprivate function updateNewScreen():void\n\t{\n\t\tvar mask:Quad = Quad(this.target);\n\t\tif(this._savedXOffset < 0)\n\t\t{\n\t\t\tthis._savedNewScreen.x = mask.width;\n\t\t}\n\t\telse if(this._savedXOffset > 0)\n\t\t{\n\t\t\tthis._savedNewScreen.x = -mask.width;\n\t\t}\n\t\tif(this._savedYOffset < 0)\n\t\t{\n\t\t\tthis._savedNewScreen.y = mask.height;\n\t\t}\n\t\telse if(this._savedYOffset > 0)\n\t\t{\n\t\t\tthis._savedNewScreen.y = -mask.height;\n\t\t}\n\t}\n\n\tprivate function cleanupTween():void\n\t{\n\t\tthis._temporaryParent.removeFromParent(true);\n\t\tthis._temporaryParent = null;\n\t\tthis._savedOldScreen.visible = true;\n\t\tthis._savedNewScreen = null;\n\t\tthis._savedOldScreen = null;\n\t\tif(this._onCompleteCallback !== null)\n\t\t{\n\t\t\tthis._onCompleteCallback();\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "source/feathers/motion/Cube.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.motion\n{\n\timport feathers.motion.effectClasses.IEffectContext;\n\timport feathers.motion.effectClasses.TweenEffectContext;\n\n\timport starling.animation.Transitions;\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * Creates animated transitions for screen navigators that position a\n\t * display object in 3D space as if it is on a side of a cube, and the cube\n\t * may rotate up or down around the x-axis, or it may rotate left or right\n\t * around the y-axis.\n\t *\n\t * <p>Warning: <code>Cube</code> and other transitions with 3D effects may\n\t * not be compatible with masks.</p>\n\t *\n\t * @see ../../../help/transitions.html#cube Transitions for Feathers screen navigators: Cube\n\t *\n\t * @productversion Feathers 2.1.0\n\t */\n\tpublic class Cube\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const SCREEN_REQUIRED_ERROR:String = \"Cannot transition if both old screen and new screen are null.\";\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that positions\n\t\t * the screens in 3D space as if they are on two adjacent sides of a\n\t\t * cube, and the cube rotates left around the y-axis.\n\t\t *\n\t\t * @see ../../../help/transitions.html#cube Transitions for Feathers screen navigators: Cube\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createCubeLeftTransition(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tvar tween:CubeTween = new CubeTween(newScreen, oldScreen, Math.PI / 2, 0, duration, ease, managed ? null : onComplete, tweenProperties);\n\t\t\t\tif(managed)\n\t\t\t\t{\n\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t}\n\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that positions\n\t\t * the screens in 3D space as if they are on two adjacent sides of a\n\t\t * cube, and the cube rotates right around the y-axis.\n\t\t *\n\t\t * @see ../../../help/transitions.html#cube Transitions for Feathers screen navigators: Cube\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createCubeRightTransition(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tvar tween:CubeTween = new CubeTween(newScreen, oldScreen, -Math.PI / 2, 0, duration, ease, managed ? null : onComplete, tweenProperties);\n\t\t\t\tif(managed)\n\t\t\t\t{\n\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t}\n\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that positions\n\t\t * the screens in 3D space as if they are on two adjacent sides of a\n\t\t * cube, and the cube rotates up around the x-axis.\n\t\t *\n\t\t * @see ../../../help/transitions.html#cube Transitions for Feathers screen navigators: Cube\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createCubeUpTransition(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tvar tween:CubeTween = new CubeTween(newScreen, oldScreen, 0, -Math.PI / 2, duration, ease, managed ? null : onComplete, tweenProperties);\n\t\t\t\tif(managed)\n\t\t\t\t{\n\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t}\n\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that positions\n\t\t * the screens in 3D space as if they are on two adjacent sides of a\n\t\t * cube, and the cube rotates down around the y-axis.\n\t\t *\n\t\t * @see ../../../help/transitions.html#cube Transitions for Feathers screen navigators: Cube\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createCubeDownTransition(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tvar tween:CubeTween = new CubeTween(newScreen, oldScreen, 0, Math.PI / 2, duration, ease, managed ? null : onComplete, tweenProperties);\n\t\t\t\tif(managed)\n\t\t\t\t{\n\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t}\n\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\t}\n}\n\nimport feathers.display.RenderDelegate;\n\nimport flash.display3D.Context3DTriangleFace;\n\nimport starling.animation.Tween;\nimport starling.core.Starling;\nimport starling.display.DisplayObject;\nimport starling.display.DisplayObjectContainer;\nimport starling.display.Sprite3D;\nimport starling.rendering.Painter;\n\nclass CubeTween extends Tween\n{\n\tpublic function CubeTween(newScreen:DisplayObject, oldScreen:DisplayObject,\n\t\trotationYOffset:Number, rotationXOffset:Number,\n\t\tduration:Number, ease:Object, onCompleteCallback:Function,\n\t\ttweenProperties:Object)\n\t{\n\t\tvar cube:CulledSprite3D = new CulledSprite3D();\n\t\tif(newScreen)\n\t\t{\n\t\t\tthis._navigator = newScreen.parent;\n\t\t\tthis._newScreenParent = new Sprite3D();\n\t\t\tif(rotationYOffset < 0)\n\t\t\t{\n\t\t\t\tthis._newScreenParent.z = this._navigator.width;\n\t\t\t\tthis._newScreenParent.rotationY = rotationYOffset + Math.PI;\n\t\t\t}\n\t\t\telse if(rotationYOffset > 0)\n\t\t\t{\n\t\t\t\tthis._newScreenParent.x = this._navigator.width;\n\t\t\t\tthis._newScreenParent.rotationY = -rotationYOffset;\n\t\t\t}\n\t\t\tif(rotationXOffset < 0)\n\t\t\t{\n\t\t\t\tthis._newScreenParent.y = this._navigator.height;\n\t\t\t\tthis._newScreenParent.rotationX = rotationXOffset + Math.PI;\n\t\t\t}\n\t\t\telse if(rotationXOffset > 0)\n\t\t\t{\n\t\t\t\tthis._newScreenParent.z = this._navigator.height;\n\t\t\t\tthis._newScreenParent.rotationX = -rotationXOffset;\n\t\t\t}\n\t\t\tvar delegate:RenderDelegate = new RenderDelegate(newScreen);\n\t\t\tdelegate.alpha = newScreen.alpha;\n\t\t\tdelegate.blendMode = newScreen.blendMode;\n\t\t\tdelegate.rotation = newScreen.rotation;\n\t\t\tdelegate.scaleX = newScreen.scaleX;\n\t\t\tdelegate.scaleY = newScreen.scaleY;\n\t\t\tthis._newScreenParent.addChild(delegate);\n\t\t\tnewScreen.visible = false;\n\t\t\tthis._savedNewScreen = newScreen;\n\t\t\tcube.addChild(this._newScreenParent);\n\t\t}\n\t\tif(oldScreen)\n\t\t{\n\t\t\tif(!this._navigator)\n\t\t\t{\n\t\t\t\tthis._navigator = oldScreen.parent;\n\t\t\t}\n\t\t\tdelegate = new RenderDelegate(oldScreen);\n\t\t\tdelegate.alpha = oldScreen.alpha;\n\t\t\tdelegate.blendMode = oldScreen.blendMode;\n\t\t\tdelegate.rotation = oldScreen.rotation;\n\t\t\tdelegate.scaleX = oldScreen.scaleX;\n\t\t\tdelegate.scaleY = oldScreen.scaleY;\n\t\t\tcube.addChildAt(delegate, 0);\n\t\t\toldScreen.visible = false;\n\t\t\tthis._savedOldScreen = oldScreen;\n\t\t}\n\t\tthis._navigator.addChild(cube);\n\n\t\tsuper(cube, duration, ease);\n\n\t\tif(rotationYOffset < 0)\n\t\t{\n\t\t\tthis.animate(\"x\", this._navigator.width);\n\t\t\tthis.animate(\"rotationY\", rotationYOffset);\n\t\t}\n\t\telse if(rotationYOffset > 0)\n\t\t{\n\t\t\tthis.animate(\"z\", this._navigator.width);\n\t\t\tthis.animate(\"rotationY\", rotationYOffset);\n\t\t}\n\t\tif(rotationXOffset < 0)\n\t\t{\n\t\t\tthis.animate(\"z\", this._navigator.height);\n\t\t\tthis.animate(\"rotationX\", rotationXOffset);\n\t\t}\n\t\telse if(rotationXOffset > 0)\n\t\t{\n\t\t\tthis.animate(\"y\", this._navigator.height);\n\t\t\tthis.animate(\"rotationX\", rotationXOffset);\n\t\t}\n\t\tif(tweenProperties)\n\t\t{\n\t\t\tfor(var propertyName:String in tweenProperties)\n\t\t\t{\n\t\t\t\tthis[propertyName] = tweenProperties[propertyName];\n\t\t\t}\n\t\t}\n\n\t\tthis._onCompleteCallback = onCompleteCallback;\n\t\tthis.onComplete = this.cleanupTween;\n\t}\n\n\tprivate var _navigator:DisplayObjectContainer;\n\tprivate var _newScreenParent:Sprite3D;\n\tprivate var _onCompleteCallback:Function;\n\tprivate var _savedNewScreen:DisplayObject;\n\tprivate var _savedOldScreen:DisplayObject;\n\n\tprivate function cleanupTween():void\n\t{\n\t\tvar cube:Sprite3D = Sprite3D(this.target);\n\t\tcube.removeFromParent(true);\n\t\tif(this._savedNewScreen)\n\t\t{\n\t\t\tthis._savedNewScreen.visible = true;\n\t\t\tthis._savedNewScreen = null;\n\t\t}\n\t\tif(this._savedOldScreen)\n\t\t{\n\t\t\tthis._savedOldScreen.visible = true;\n\t\t\tthis._savedOldScreen = null;\n\t\t}\n\t\tif(this._onCompleteCallback !== null)\n\t\t{\n\t\t\tthis._onCompleteCallback();\n\t\t}\n\t}\n}\n\nclass CulledSprite3D extends Sprite3D\n{\n\toverride public function render(painter:Painter):void\n\t{\n\t\t//this will be cleared later when the state is popped\n\t\tpainter.state.culling = Context3DTriangleFace.BACK;\n\t\tsuper.render(painter);\n\t}\n}"
  },
  {
    "path": "source/feathers/motion/EffectInterruptBehavior.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.motion\n{\n\t/**\n\t * Constants for determining how an effect behaves when it is interrupted.\n\t *\n\t * @see feathers.motion.effectClasses.IEffectContext#interrupt()\n\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t *\n\t * @productversion Feathers 3.5.0\n\t */\n\tpublic class EffectInterruptBehavior\n\t{\n\t\t/**\n\t\t * When the effect is interrupted, it stops at its current position.\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t */\n\t\tpublic static const STOP:String = \"stop\";\n\n\t\t/**\n\t\t * When the effect is interrupted, it immediately advances to the end.\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t */\n\t\tpublic static const END:String = \"end\";\n\t}\n}"
  },
  {
    "path": "source/feathers/motion/Fade.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.motion\n{\n\timport feathers.core.IFeathersControl;\n\timport feathers.motion.effectClasses.IEffectContext;\n\timport feathers.motion.effectClasses.TweenEffectContext;\n\n\timport starling.animation.Transitions;\n\timport starling.animation.Tween;\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.display.DisplayObjectContainer;\n\n\t/**\n\t * Creates effects for Feathers components and transitions for screen\n\t * navigators, that animate the <code>alpha</code> property of a display\n\t * object to make it fade in or out.\n\t *\n\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t * @see ../../../help/transitions.html#fade Transitions for Feathers screen navigators: Fade\n\t *\n\t * @productversion Feathers 2.1.0\n\t */\n\tpublic class Fade\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const SCREEN_REQUIRED_ERROR:String = \"Cannot transition if both old screen and new screen are null.\";\n\n\t\t/**\n\t\t * Creates an effect function that fades in the target component by\n\t\t * animating the <code>alpha</code> property from <code>0.0</code> to\n\t\t * <code>1.0</code>.\n\t\t *\n\t\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t\t * @see #createFadeOutEffect()\n\t\t * @see #createFadeBetweenEffect()\n\t\t */\n\t\tpublic static function createFadeInEffect(duration:Number = 0.25, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.END):Function\n\t\t{\n\t\t\treturn createFadeBetweenEffect(0.0, 1.0, duration, ease, interruptBehavior);\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function that fades out the target component by\n\t\t * animating the <code>alpha</code> property from <code>1.0</code> to\n\t\t * <code>0.0</code>.\n\t\t *\n\t\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t\t * @see #createFadeInEffect()\n\t\t * @see #createFadeBetweenEffect()\n\t\t */\n\t\tpublic static function createFadeOutEffect(duration:Number = 0.25, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.END):Function\n\t\t{\n\t\t\treturn createFadeBetweenEffect(1.0, 0.0, duration, ease, interruptBehavior);\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function that fades the target component by\n\t\t * animating the <code>alpha</code> property from its current value to a\n\t\t * new value.\n\t\t *\n\t\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t\t * @see #createFadeFromEffect()\n\t\t * @see #createFadeBetweenEffect()\n\t\t */\n\t\tpublic static function createFadeToEffect(endAlpha:Number, duration:Number = 0.25, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.END):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IEffectContext\n\t\t\t{\n\t\t\t\tvar tween:Tween = new Tween(target, duration, ease);\n\t\t\t\ttween.fadeTo(endAlpha);\n\t\t\t\tvar context:TweenEffectContext = new TweenEffectContext(target, tween);\n\t\t\t\tcontext.interruptBehavior = interruptBehavior;\n\t\t\t\treturn context;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function that fades the target component by\n\t\t * animating the <code>alpha</code> property from a start value to its\n\t\t * current value.\n\t\t *\n\t\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t\t * @see #createFadeToEffect()\n\t\t * @see #createFadeBetweenEffect()\n\t\t */\n\t\tpublic static function createFadeFromEffect(startAlpha:Number, duration:Number = 0.25, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.END):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IEffectContext\n\t\t\t{\n\t\t\t\tvar endAlpha:Number = target.alpha;\n\t\t\t\tif(target is IFeathersControl)\n\t\t\t\t{\n\t\t\t\t\tIFeathersControl(target).suspendEffects();\n\t\t\t\t}\n\t\t\t\ttarget.alpha = startAlpha;\n\t\t\t\tif(target is IFeathersControl)\n\t\t\t\t{\n\t\t\t\t\tIFeathersControl(target).resumeEffects();\n\t\t\t\t}\n\t\t\t\tvar tween:Tween = new Tween(target, duration, ease);\n\t\t\t\ttween.fadeTo(endAlpha);\n\t\t\t\tvar context:TweenEffectContext = new TweenEffectContext(target, tween);\n\t\t\t\tcontext.interruptBehavior = interruptBehavior;\n\t\t\t\treturn context;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function that fades the target component by\n\t\t * animating the <code>alpha</code> property between a start value and\n\t\t * an ending value.\n\t\t *\n\t\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t\t */\n\t\tpublic static function createFadeBetweenEffect(startAlpha:Number, endAlpha:Number, duration:Number = 0.25, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.END):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IEffectContext\n\t\t\t{\n\t\t\t\tif(target is IFeathersControl)\n\t\t\t\t{\n\t\t\t\t\tIFeathersControl(target).suspendEffects();\n\t\t\t\t}\n\t\t\t\ttarget.alpha = startAlpha;\n\t\t\t\tif(target is IFeathersControl)\n\t\t\t\t{\n\t\t\t\t\tIFeathersControl(target).resumeEffects();\n\t\t\t\t}\n\t\t\t\tvar tween:Tween = new Tween(target, duration, ease);\n\t\t\t\ttween.fadeTo(endAlpha);\n\t\t\t\tvar context:TweenEffectContext = new TweenEffectContext(target, tween);\n\t\t\t\tcontext.interruptBehavior = interruptBehavior;\n\t\t\t\treturn context;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that fades in\n\t\t * the new screen by animating the <code>alpha</code> property from\n\t\t * <code>0.0</code> to <code>1.0</code>, while the old screen remains\n\t\t * fully opaque at a lower depth.\n\t\t *\n\t\t * @see ../../../help/transitions.html#fade Transitions for Feathers screen navigators: Fade\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createFadeInTransition(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tif(newScreen)\n\t\t\t\t{\n\t\t\t\t\tnewScreen.alpha = 0;\n\t\t\t\t\t//make sure the new screen is on top\n\t\t\t\t\tvar parent:DisplayObjectContainer = newScreen.parent;\n\t\t\t\t\tparent.setChildIndex(newScreen, parent.numChildren - 1);\n\t\t\t\t\tif(oldScreen) //oldScreen can be null, that's okay\n\t\t\t\t\t{\n\t\t\t\t\t\toldScreen.alpha = 1;\n\t\t\t\t\t}\n\t\t\t\t\tvar tween:FadeTween = new FadeTween(newScreen, null, duration, ease, onComplete, tweenProperties);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//there's no new screen to fade in, but we still want some\n\t\t\t\t\t//kind of animation, so we'll just fade out the old screen\n\t\t\t\t\t//in order to have some animation, we're going to fade out\n\t\t\t\t\toldScreen.alpha = 1;\n\t\t\t\t\ttween = new FadeTween(oldScreen, null, duration, ease, onComplete, tweenProperties);\n\t\t\t\t}\n\t\t\t\tif(managed)\n\t\t\t\t{\n\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t}\n\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that fades out\n\t\t * the old screen by animating the <code>alpha</code> property from\n\t\t * <code>1.0</code> to <code>0.0</code>, while the new screen remains\n\t\t * fully opaque at a lower depth.\n\t\t *\n\t\t * @see ../../../help/transitions.html#fade Transitions for Feathers screen navigators: Fade\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createFadeOutTransition(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tif(oldScreen)\n\t\t\t\t{\n\t\t\t\t\t//make sure the old screen is on top\n\t\t\t\t\tvar parent:DisplayObjectContainer = oldScreen.parent;\n\t\t\t\t\tparent.setChildIndex(oldScreen, parent.numChildren - 1);\n\t\t\t\t\toldScreen.alpha = 1;\n\t\t\t\t\tif(newScreen) //newScreen can be null, that's okay\n\t\t\t\t\t{\n\t\t\t\t\t\tnewScreen.alpha = 1;\n\t\t\t\t\t}\n\t\t\t\t\tvar tween:FadeTween = new FadeTween(oldScreen, null, duration, ease, onComplete, tweenProperties);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//there's no old screen to fade out, but we still want some\n\t\t\t\t\t//kind of animation, so we'll just fade in the new screen\n\t\t\t\t\t//in order to have some animation, we're going to fade out\n\t\t\t\t\tnewScreen.alpha = 0;\n\t\t\t\t\ttween = new FadeTween(newScreen, null, duration, ease, onComplete, tweenProperties);\n\t\t\t\t}\n\t\t\t\tif(managed)\n\t\t\t\t{\n\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t}\n\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that crossfades\n\t\t * the screens. In other words, the old screen fades out, animating the\n\t\t * <code>alpha</code> property from <code>1.0</code> to\n\t\t * <code>0.0</code>. Simultaneously, the new screen fades in, animating\n\t\t * its <code>alpha</code> property from <code>0.0</code> to <code>1.0</code>.\n\t\t *\n\t\t * @see ../../../help/transitions.html#fade Transitions for Feathers screen navigators: Fade\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createCrossfadeTransition(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tif(newScreen)\n\t\t\t\t{\n\t\t\t\t\tnewScreen.alpha = 0;\n\t\t\t\t\tif(oldScreen) //oldScreen can be null, that's okay\n\t\t\t\t\t{\n\t\t\t\t\t\toldScreen.alpha = 1;\n\t\t\t\t\t}\n\t\t\t\t\tvar tween:FadeTween = new FadeTween(newScreen, oldScreen, duration, ease, onComplete, tweenProperties);\n\t\t\t\t}\n\t\t\t\telse //we only have the old screen\n\t\t\t\t{\n\t\t\t\t\toldScreen.alpha = 1;\n\t\t\t\t\ttween = new FadeTween(oldScreen, null, duration, ease, onComplete, tweenProperties);\n\t\t\t\t}\n\t\t\t\tif(managed)\n\t\t\t\t{\n\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t}\n\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\t}\n}\n\nimport starling.animation.Tween;\nimport starling.core.Starling;\nimport starling.display.DisplayObject;\n\nclass FadeTween extends Tween\n{\n\tpublic function FadeTween(target:DisplayObject, otherTarget:DisplayObject,\n\t\tduration:Number, ease:Object, onCompleteCallback:Function,\n\t\ttweenProperties:Object)\n\t{\n\t\tsuper(target, duration, ease);\n\t\tif(target.alpha == 0)\n\t\t{\n\t\t\tthis.fadeTo(1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.fadeTo(0);\n\t\t}\n\t\tif(tweenProperties)\n\t\t{\n\t\t\tfor(var propertyName:String in tweenProperties)\n\t\t\t{\n\t\t\t\tthis[propertyName] = tweenProperties[propertyName];\n\t\t\t}\n\t\t}\n\t\tif(otherTarget)\n\t\t{\n\t\t\tthis._otherTarget = otherTarget;\n\t\t\tthis.onUpdate = this.updateOtherTarget;\n\t\t}\n\t\tthis._onCompleteCallback = onCompleteCallback;\n\t\tthis.onComplete = this.cleanupTween;\n\t}\n\n\tprivate var _otherTarget:DisplayObject;\n\tprivate var _onCompleteCallback:Function;\n\n\tprivate function updateOtherTarget():void\n\t{\n\t\tvar newScreen:DisplayObject = DisplayObject(this.target);\n\t\tthis._otherTarget.alpha = 1 - newScreen.alpha;\n\t}\n\n\tprivate function cleanupTween():void\n\t{\n\t\tthis.target.alpha = 1;\n\t\tif(this._otherTarget)\n\t\t{\n\t\t\tthis._otherTarget.alpha = 1;\n\t\t}\n\t\tif(this._onCompleteCallback !== null)\n\t\t{\n\t\t\tthis._onCompleteCallback();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/motion/Flip.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.motion\n{\n\timport feathers.motion.effectClasses.IEffectContext;\n\timport feathers.motion.effectClasses.TweenEffectContext;\n\n\timport starling.animation.Transitions;\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * Creates animated transitions for screen navigators that position display\n\t * objects in 3D space is if they are printed on opposite sides of a\n\t * postcard. A display object may appear on the front or back side, and the\n\t * card rotates around its center to reveal the other side. The card may\n\t * rotate up or down around the x-axis, or they may rotate left or right\n\t * around the y-axis.\n\t *\n\t * <p>Warning: <code>Flip</code> and other transitions with 3D effects may\n\t * not be compatible with masks.</p>\n\t *\n\t * @see ../../../help/transitions.html#flip Transitions for Feathers screen navigators: Flip\n\t *\n\t * @productversion Feathers 2.1.0\n\t */\n\tpublic class Flip\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const SCREEN_REQUIRED_ERROR:String = \"Cannot transition if both old screen and new screen are null.\";\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that positions\n\t\t * the screens in 3D space is if they are printed on opposite sides of a\n\t\t * postcard, and the card rotates left, around its y-axis, to reveal the\n\t\t * new screen on the back side.\n\t\t *\n\t\t * @see ../../../help/transitions.html#flip Transitions for Feathers screen navigators: Flip\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createFlipLeftTransition(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tvar tween:FlipTween = new FlipTween(newScreen, oldScreen, Math.PI, 0, duration, ease, onComplete, tweenProperties);\n\t\t\t\tif(managed)\n\t\t\t\t{\n\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t}\n\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that positions\n\t\t * the screens in 3D space is if they are printed on opposite sides of a\n\t\t * postcard, and the card rotates right, around its y-axis, to reveal\n\t\t * the new screen on the back side.\n\t\t *\n\t\t * @see ../../../help/transitions.html#flip Transitions for Feathers screen navigators: Flip\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createFlipRightTransition(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tvar tween:FlipTween = new FlipTween(newScreen, oldScreen, -Math.PI, 0, duration, ease, onComplete, tweenProperties);\n\t\t\t\tif(managed)\n\t\t\t\t{\n\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t}\n\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that positions\n\t\t * the screens in 3D space is if they are printed on opposite sides of a\n\t\t * postcard, and the card rotates up, around its x-axis, to reveal the\n\t\t * new screen on the back side.\n\t\t *\n\t\t * @see ../../../help/transitions.html#flip Transitions for Feathers screen navigators: Flip\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createFlipUpTransition(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tvar tween:FlipTween = new FlipTween(newScreen, oldScreen, 0, -Math.PI, duration, ease, onComplete, tweenProperties);\n\t\t\t\tif(managed)\n\t\t\t\t{\n\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t}\n\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that positions\n\t\t * the screens in 3D space is if they are printed on opposite sides of a\n\t\t * postcard, and the card rotates down, around its x-axis, to reveal the\n\t\t * new screen on the back side.\n\t\t *\n\t\t * @see ../../../help/transitions.html#flip Transitions for Feathers screen navigators: Flip\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createFlipDownTransition(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tvar tween:FlipTween = new FlipTween(newScreen, oldScreen, 0, Math.PI, duration, ease, onComplete, tweenProperties);\n\t\t\t\tif(managed)\n\t\t\t\t{\n\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t}\n\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\t}\n}\n\nimport feathers.display.RenderDelegate;\n\nimport starling.animation.Tween;\nimport starling.core.Starling;\nimport starling.display.DisplayObject;\nimport starling.display.DisplayObjectContainer;\nimport starling.display.Sprite3D;\n\nclass FlipTween extends Tween\n{\n\tpublic function FlipTween(newScreen:DisplayObject, oldScreen:DisplayObject,\n\t\trotationYOffset:Number, rotationXOffset:Number,\n\t\tduration:Number, ease:Object, onCompleteCallback:Function,\n\t\ttweenProperties:Object)\n\t{\n\n\t\tif(newScreen)\n\t\t{\n\t\t\tthis._navigator = newScreen.parent;\n\t\t\tvar newScreenParent:Sprite3D = new Sprite3D();\n\t\t\tvar delegate:RenderDelegate = new RenderDelegate(newScreen);\n\t\t\tdelegate.alpha = newScreen.alpha;\n\t\t\tdelegate.blendMode = newScreen.blendMode;\n\t\t\tdelegate.rotation = newScreen.rotation;\n\t\t\tdelegate.scaleX = newScreen.scaleX;\n\t\t\tdelegate.scaleY = newScreen.scaleY;\n\t\t\tif(rotationYOffset != 0)\n\t\t\t{\n\t\t\t\tdelegate.x = -newScreen.width / 2;\n\t\t\t\tnewScreenParent.x = newScreen.width / 2;\n\t\t\t\tnewScreenParent.rotationY = -rotationYOffset;\n\t\t\t}\n\t\t\tif(rotationXOffset != 0)\n\t\t\t{\n\t\t\t\tdelegate.y = -newScreen.height / 2;\n\t\t\t\tnewScreenParent.y = newScreen.height / 2;\n\t\t\t\tnewScreenParent.rotationX = -rotationXOffset;\n\t\t\t}\n\t\t\tthis._navigator.addChild(newScreenParent);\n\t\t\tnewScreenParent.addChild(delegate);\n\t\t\tnewScreen.visible = false;\n\t\t\tthis._savedNewScreen = newScreen;\n\t\t\ttargetParent = newScreenParent;\n\t\t}\n\t\tif(oldScreen)\n\t\t{\n\t\t\tvar oldScreenParent:Sprite3D = new Sprite3D();\n\t\t\tdelegate = new RenderDelegate(oldScreen);\n\t\t\tdelegate.alpha = oldScreen.alpha;\n\t\t\tdelegate.blendMode = oldScreen.blendMode;\n\t\t\tdelegate.rotation = oldScreen.rotation;\n\t\t\tdelegate.scaleX = oldScreen.scaleX;\n\t\t\tdelegate.scaleY = oldScreen.scaleY;\n\t\t\tif(rotationYOffset != 0)\n\t\t\t{\n\t\t\t\tdelegate.x = -oldScreen.width / 2;\n\t\t\t\toldScreenParent.x = oldScreen.width / 2;\n\t\t\t}\n\t\t\tif(rotationXOffset != 0)\n\t\t\t{\n\t\t\t\tdelegate.y = -oldScreen.height / 2;\n\t\t\t\toldScreenParent.y = oldScreen.height / 2;\n\t\t\t}\n\t\t\toldScreenParent.rotationY = 0;\n\t\t\toldScreenParent.rotationX = 0;\n\t\t\tif(!targetParent)\n\t\t\t{\n\t\t\t\tthis._navigator = oldScreen.parent;\n\t\t\t\tduration = duration / 2;\n\t\t\t\ttargetParent = oldScreenParent;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tnewScreenParent.visible = false;\n\t\t\t\tthis._otherTarget = oldScreenParent;\n\t\t\t}\n\t\t\tthis._navigator.addChild(oldScreenParent);\n\t\t\toldScreenParent.addChild(delegate);\n\t\t\toldScreen.visible = false;\n\t\t\tthis._savedOldScreen = oldScreen;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tnewScreenParent.rotationY /= 2;\n\t\t\tnewScreenParent.rotationX /= 2;\n\t\t\tduration = duration / 2;\n\t\t}\n\n\t\tsuper(targetParent, duration, ease);\n\n\t\tvar targetParent:Sprite3D;\n\t\tif(newScreenParent)\n\t\t{\n\t\t\tif(rotationYOffset != 0)\n\t\t\t{\n\t\t\t\tthis.animate(\"rotationY\", 0);\n\t\t\t}\n\t\t\tif(rotationXOffset != 0)\n\t\t\t{\n\t\t\t\tthis.animate(\"rotationX\", 0);\n\t\t\t}\n\t\t}\n\t\telse //we only have the old screen\n\t\t{\n\t\t\tif(rotationYOffset != 0)\n\t\t\t{\n\t\t\t\tthis.animate(\"rotationY\", rotationYOffset / 2);\n\t\t\t}\n\t\t\tif(rotationXOffset != 0)\n\t\t\t{\n\t\t\t\tthis.animate(\"rotationX\", rotationXOffset / 2);\n\t\t\t}\n\t\t}\n\t\tthis._rotationYOffset = rotationYOffset;\n\t\tthis._rotationXOffset = rotationXOffset;\n\t\tif(tweenProperties)\n\t\t{\n\t\t\tfor(var propertyName:String in tweenProperties)\n\t\t\t{\n\t\t\t\tthis[propertyName] = tweenProperties[propertyName];\n\t\t\t}\n\t\t}\n\n\t\tif(this._otherTarget)\n\t\t{\n\t\t\tthis.onUpdate = this.updateOtherTarget;\n\t\t}\n\t\tthis._onCompleteCallback = onCompleteCallback;\n\t\tthis.onComplete = this.cleanupTween;\n\t}\n\n\tprivate var _navigator:DisplayObjectContainer;\n\tprivate var _otherTarget:Sprite3D;\n\tprivate var _onCompleteCallback:Function;\n\tprivate var _rotationYOffset:Number = 0;\n\tprivate var _rotationXOffset:Number = 0;\n\tprivate var _savedNewScreen:DisplayObject;\n\tprivate var _savedOldScreen:DisplayObject;\n\n\tprivate function updateOtherTarget():void\n\t{\n\t\tvar targetParent:Sprite3D = Sprite3D(this.target);\n\t\tif(this.progress >= 0.5 && this._otherTarget.visible)\n\t\t{\n\t\t\ttargetParent.visible = true;\n\t\t\tthis._otherTarget.visible = false;\n\t\t}\n\t\telse if(this.progress < 0.5 && !this._otherTarget.visible)\n\t\t{\n\t\t\ttargetParent.visible = false;\n\t\t\tthis._otherTarget.visible = true;\n\t\t}\n\t\tif(this._rotationYOffset < 0)\n\t\t{\n\t\t\tthis._otherTarget.rotationY = targetParent.rotationY + Math.PI;\n\t\t}\n\t\telse if(this._rotationYOffset > 0)\n\t\t{\n\t\t\tthis._otherTarget.rotationY = targetParent.rotationY - Math.PI;\n\t\t}\n\t\tif(this._rotationXOffset < 0)\n\t\t{\n\t\t\tthis._otherTarget.rotationX = targetParent.rotationX + Math.PI;\n\t\t}\n\t\telse if(this._rotationXOffset > 0)\n\t\t{\n\t\t\tthis._otherTarget.rotationX = targetParent.rotationX - Math.PI;\n\t\t}\n\t}\n\n\tprivate function cleanupTween():void\n\t{\n\t\tvar targetParent:Sprite3D = Sprite3D(this.target);\n\t\ttargetParent.removeFromParent(true);\n\t\tif(this._otherTarget)\n\t\t{\n\t\t\tthis._otherTarget.removeFromParent(true);\n\t\t}\n\t\tif(this._savedNewScreen)\n\t\t{\n\t\t\tthis._savedNewScreen.visible = true;\n\t\t\tthis._savedNewScreen = null;\n\t\t}\n\t\tif(this._savedOldScreen)\n\t\t{\n\t\t\tthis._savedOldScreen.visible = true;\n\t\t\tthis._savedOldScreen = null;\n\t\t}\n\t\tif(this._onCompleteCallback !== null)\n\t\t{\n\t\t\tthis._onCompleteCallback();\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/motion/Iris.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.motion\n{\n\timport feathers.motion.effectClasses.IEffectContext;\n\timport feathers.motion.effectClasses.TweenEffectContext;\n\n\timport flash.geom.Point;\n\n\timport starling.animation.Transitions;\n\timport starling.animation.Tween;\n\timport starling.core.Starling;\n\timport starling.display.Canvas;\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\timport starling.utils.Pool;\n\n\t/**\n\t * Creates effects for Feathers components and transitions for screen\n\t * navigators that show or hide a display object masked by a growing or\n\t * shrinking circle. In a transition, both display objects remain stationary\n\t * while a stencil mask is animated.\n\t *\n\t * <p>Note: This effect is not supported with display objects that have\n\t * transparent backgrounds due to limitations in stencil masks. Display\n\t * objects should be fully opaque.</p>\n\t *\n\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t * @see ../../../help/transitions.html#iris Transitions for Feathers screen navigators: Iris\n\t *\n\t * @productversion Feathers 2.2.0\n\t */\n\tpublic class Iris\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const IRIS_MASK_NAME:String = \"feathers-iris-effect-mask\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const SCREEN_REQUIRED_ERROR:String = \"Cannot transition if both old screen and new screen are null.\";\n\n\t\t/**\n\t\t * Creates an effect function for the target component that shows the\n\t\t * component by masking it with a growing circle in the center.\n\t\t *\n\t\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t */\n\t\tpublic static function createIrisOpenEffect(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.END):Function\n\t\t{\n\t\t\treturn createIrisOpenEffectAtRatio(0.5, 0.5, duration, ease, interruptBehavior);\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that shows the\n\t\t * component by masking it with a growing circle at a specific position\n\t\t * in the range from 0.0 to 1.0.\n\t\t *\n\t\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t */\n\t\tpublic static function createIrisOpenEffectAtRatio(ratioX:Number, ratioY:Number, duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.END):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IEffectContext\n\t\t\t{\n\t\t\t\tvar maskWidth:Number = target.width;\n\t\t\t\tvar maskHeight:Number = target.height;\n\t\t\t\tif(maskWidth < 0)\n\t\t\t\t{\n\t\t\t\t\tmaskWidth = 1;\n\t\t\t\t}\n\t\t\t\tif(maskHeight < 0)\n\t\t\t\t{\n\t\t\t\t\tmaskHeight = 1;\n\t\t\t\t}\n\t\t\t\treturn createIrisOpenEffectContextAtXY(target, maskWidth * ratioX, maskHeight * ratioY, duration, ease, interruptBehavior);\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that shows the\n\t\t * component by masking it with a growing circle at a specific position.\n\t\t *\n\t\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t */\n\t\tpublic static function createIrisOpenEffectAtXY(x:Number, y:Number, duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.END):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IEffectContext\n\t\t\t{\n\t\t\t\treturn createIrisOpenEffectContextAtXY(target, x, y, duration, ease, interruptBehavior);\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function createIrisOpenEffectContextAtXY(target:DisplayObject, originX:Number, originY:Number, duration:Number, ease:Object, interruptBehavior:String):IEffectContext\n\t\t{\n\t\t\tvar mask:Canvas = null;\n\t\t\tvar oldMask:DisplayObject = target.mask;\n\t\t\tif(oldMask is Canvas && oldMask.name === IRIS_MASK_NAME)\n\t\t\t{\n\t\t\t\tmask = Canvas(oldMask);\n\t\t\t}\n\t\t\tvar maskWidth:Number = target.width;\n\t\t\tvar maskHeight:Number = target.height;\n\t\t\tif(maskWidth < 0)\n\t\t\t{\n\t\t\t\tmaskWidth = 1;\n\t\t\t}\n\t\t\tif(maskHeight < 0)\n\t\t\t{\n\t\t\t\tmaskHeight = 1;\n\t\t\t}\n\t\t\tvar halfWidth:Number = maskWidth / 2;\n\t\t\tvar halfHeight:Number = maskHeight / 2;\n\t\t\tvar p1:Point = Pool.getPoint(halfWidth, halfHeight);\n\t\t\tvar p2:Point = Pool.getPoint(originX, originY);\n\t\t\tvar radiusFromCenter:Number = p1.length;\n\t\t\tif(p1.equals(p2))\n\t\t\t{\n\t\t\t\tvar radius:Number = radiusFromCenter;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar distanceFromCenterToOrigin:Number = Point.distance(p1, p2);\n\t\t\t\tradius = radiusFromCenter + distanceFromCenterToOrigin;\n\t\t\t}\n\t\t\tPool.putPoint(p1);\n\t\t\tPool.putPoint(p2);\n\t\t\tif(mask === null)\n\t\t\t{\n\t\t\t\tmask = new Canvas();\n\t\t\t\tmask.name = IRIS_MASK_NAME;\n\t\t\t\tmask.x = originX;\n\t\t\t\tmask.y = originY;\n\t\t\t\tmask.beginFill(0xff00ff);\n\t\t\t\tmask.drawCircle(0, 0, radius);\n\t\t\t\tmask.endFill();\n\t\t\t\tmask.scale = 0;\n\t\t\t\ttarget.mask = mask;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmask.clear();\n\t\t\t\tmask.beginFill(0xff00ff);\n\t\t\t\t//the radius may have changed\n\t\t\t\tmask.drawCircle(0, 0, radius);\n\t\t\t\tmask.endFill();\n\t\t\t}\n\t\t\tvar tween:Tween = new Tween(mask, duration, ease);\n\t\t\ttween.animate(\"scale\", 1);\n\t\t\tif(mask === oldMask)\n\t\t\t{\n\t\t\t\t//the x and y position may have changed\n\t\t\t\tif(mask.x != originX)\n\t\t\t\t{\n\t\t\t\t\ttween.animate(\"x\", originX);\n\t\t\t\t}\n\t\t\t\tif(mask.y != originY)\n\t\t\t\t{\n\t\t\t\t\ttween.animate(\"y\", originY);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar context:TweenEffectContext = new TweenEffectContext(target, tween);\n\t\t\tcontext.interruptBehavior = interruptBehavior;\n\t\t\tcontext.addEventListener(Event.COMPLETE, function(event:Event, stopped:Boolean):void\n\t\t\t{\n\t\t\t\tif(stopped)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tmask.removeFromParent(true);\n\t\t\t\tif(mask === oldMask)\n\t\t\t\t{\n\t\t\t\t\ttarget.mask = null;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttarget.mask = oldMask;\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn context;\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that hides the\n\t\t * component by masking it with a shrinking circle in the center.\n\t\t *\n\t\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t */\n\t\tpublic static function createIrisCloseEffect(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.END):Function\n\t\t{\n\t\t\treturn createIrisCloseEffectAtRatio(0.5, 0.5, duration, ease, interruptBehavior);\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that hides the\n\t\t * component by masking it with a shrinking circle at a specific position\n\t\t * in the range 0.0 to 1.0.\n\t\t *\n\t\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t */\n\t\tpublic static function createIrisCloseEffectAtRatio(ratioX:Number, ratioY:Number, duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.END):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IEffectContext\n\t\t\t{\n\t\t\t\tvar maskWidth:Number = target.width;\n\t\t\t\tvar maskHeight:Number = target.height;\n\t\t\t\tif(maskWidth < 0)\n\t\t\t\t{\n\t\t\t\t\tmaskWidth = 1;\n\t\t\t\t}\n\t\t\t\tif(maskHeight < 0)\n\t\t\t\t{\n\t\t\t\t\tmaskHeight = 1;\n\t\t\t\t}\n\t\t\t\treturn createIrisCloseEffectContextAtXY(target, maskWidth * ratioX, maskHeight * ratioY, duration, ease, interruptBehavior);\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that hides the\n\t\t * component by masking it with a shrinking circle at a specific position.\n\t\t *\n\t\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t */\n\t\tpublic static function createIrisCloseEffectAtXY(x:Number, y:Number, duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.END):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IEffectContext\n\t\t\t{\n\t\t\t\treturn createIrisCloseEffectContextAtXY(target, x, y, duration, ease, interruptBehavior);\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function createIrisCloseEffectContextAtXY(target:DisplayObject, originX:Number, originY:Number, duration:Number, ease:Object, interruptBehavior:String):IEffectContext\n\t\t{\n\t\t\tvar mask:Canvas = null;\n\t\t\tvar oldMask:DisplayObject = target.mask;\n\t\t\tif(oldMask is Canvas && oldMask.name === IRIS_MASK_NAME)\n\t\t\t{\n\t\t\t\tmask = Canvas(oldMask);\n\t\t\t}\n\t\t\tvar maskWidth:Number = target.width;\n\t\t\tvar maskHeight:Number = target.height;\n\t\t\tif(maskWidth < 0)\n\t\t\t{\n\t\t\t\tmaskWidth = 1;\n\t\t\t}\n\t\t\tif(maskHeight < 0)\n\t\t\t{\n\t\t\t\tmaskHeight = 1;\n\t\t\t}\n\t\t\tvar halfWidth:Number = maskWidth / 2;\n\t\t\tvar halfHeight:Number = maskHeight / 2;\n\t\t\tvar p1:Point = Pool.getPoint(halfWidth, halfHeight);\n\t\t\tvar p2:Point = Pool.getPoint(originX, originY);\n\t\t\tvar radiusFromCenter:Number = p1.length;\n\t\t\tif(p1.equals(p2))\n\t\t\t{\n\t\t\t\tvar radius:Number = radiusFromCenter;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar distanceFromCenterToOrigin:Number = Point.distance(p1, p2);\n\t\t\t\tradius = radiusFromCenter + distanceFromCenterToOrigin;\n\t\t\t}\n\t\t\tPool.putPoint(p1);\n\t\t\tPool.putPoint(p2);\n\t\t\tif(mask === null)\n\t\t\t{\n\t\t\t\tmask = new Canvas();\n\t\t\t\tmask.name = IRIS_MASK_NAME;\n\t\t\t\tmask.x = originX;\n\t\t\t\tmask.y = originY;\n\t\t\t\tmask.beginFill(0xff00ff);\n\t\t\t\tmask.drawCircle(0, 0, radius);\n\t\t\t\tmask.endFill();\n\t\t\t\ttarget.mask = mask;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmask.clear();\n\t\t\t\tmask.beginFill(0xff00ff);\n\t\t\t\t//the radius may have changed\n\t\t\t\tmask.drawCircle(0, 0, radius);\n\t\t\t\tmask.endFill();\n\t\t\t}\n\t\t\tvar tween:Tween = new Tween(mask, duration, ease);\n\t\t\ttween.animate(\"scale\", 0);\n\t\t\tif(mask === oldMask)\n\t\t\t{\n\t\t\t\t//the x and y position may have changed\n\t\t\t\tif(mask.x != originX)\n\t\t\t\t{\n\t\t\t\t\ttween.animate(\"x\", originX);\n\t\t\t\t}\n\t\t\t\tif(mask.y != originY)\n\t\t\t\t{\n\t\t\t\t\ttween.animate(\"y\", originY);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar context:TweenEffectContext = new TweenEffectContext(target, tween);\n\t\t\tcontext.interruptBehavior = interruptBehavior;\n\t\t\tcontext.addEventListener(Event.COMPLETE, function(event:Event, stopped:Boolean):void\n\t\t\t{\n\t\t\t\tif(stopped)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tmask.removeFromParent(true);\n\t\t\t\tif(mask === oldMask)\n\t\t\t\t{\n\t\t\t\t\ttarget.mask = null;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttarget.mask = oldMask;\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn context;\n\t\t}\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that shows a\n\t\t * screen by masking it with a growing circle in the center.\n\t\t *\n\t\t * @see ../../../help/transitions.html#iris Transitions for Feathers screen navigators: Iris\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createIrisOpenTransition(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tif(oldScreen)\n\t\t\t\t{\n\t\t\t\t\tvar originX:Number = oldScreen.width / 2;\n\t\t\t\t\tvar originY:Number = oldScreen.height / 2;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\toriginX = newScreen.width / 2;\n\t\t\t\t\toriginY = newScreen.height / 2;\n\t\t\t\t}\n\t\t\t\tvar tween:IrisTween = new IrisTween(newScreen, oldScreen, originX, originY, true, duration, ease, onComplete, tweenProperties);\n\t\t\t\tif(managed)\n\t\t\t\t{\n\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t}\n\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that shows a\n\t\t * screen by masking it with a growing circle at a specific position.\n\t\t *\n\t\t * @see ../../../help/transitions.html#iris Transitions for Feathers screen navigators: Iris\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createIrisOpenTransitionAt(x:Number, y:Number, duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tvar tween:IrisTween = new IrisTween(newScreen, oldScreen, x, y, true, duration, ease, onComplete, tweenProperties);\n\t\t\t\tif(managed)\n\t\t\t\t{\n\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t}\n\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that hides a\n\t\t * screen by masking it with a shrinking circle in the center.\n\t\t *\n\t\t * @see ../../../help/transitions.html#iris Transitions for Feathers screen navigators: Iris\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createIrisCloseTransition(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tif(oldScreen)\n\t\t\t\t{\n\t\t\t\t\tvar originX:Number = oldScreen.width / 2;\n\t\t\t\t\tvar originY:Number = oldScreen.height / 2;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\toriginX = newScreen.width / 2;\n\t\t\t\t\toriginY = newScreen.height / 2;\n\t\t\t\t}\n\t\t\t\tvar tween:IrisTween = new IrisTween(newScreen, oldScreen, originX, originY, false, duration, ease, onComplete, tweenProperties);\n\t\t\t\tif(managed)\n\t\t\t\t{\n\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t}\n\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that hides a\n\t\t * screen by masking it with a shrinking circle at a specific position.\n\t\t *\n\t\t * @see ../../../help/transitions.html#iris Transitions for Feathers screen navigators: Iris\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createIrisCloseTransitionAt(x:Number, y:Number, duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tvar tween:IrisTween = new IrisTween(newScreen, oldScreen, x, y, false, duration, ease, onComplete, tweenProperties);\n\t\t\t\tif(managed)\n\t\t\t\t{\n\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t}\n\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\t}\n}\n\nimport feathers.display.RenderDelegate;\n\nimport flash.geom.Point;\n\nimport starling.animation.Tween;\nimport starling.core.Starling;\nimport starling.display.Canvas;\nimport starling.display.DisplayObject;\nimport starling.events.Event;\n\nclass IrisTween extends Tween\n{\n\tpublic function IrisTween(newScreen:DisplayObject, oldScreen:DisplayObject,\n\t\toriginX:Number, originY:Number, openIris:Boolean, duration:Number, ease:Object,\n\t\tonCompleteCallback:Function, tweenProperties:Object)\n\t{\n\t\tif(newScreen)\n\t\t{\n\t\t\tvar width:Number = newScreen.width;\n\t\t\tvar height:Number = newScreen.height;\n\t\t}\n\t\telse\n\t\t{\n\t\t\twidth = oldScreen.width;\n\t\t\theight = oldScreen.height;\n\t\t}\n\t\tvar halfWidth:Number = width / 2;\n\t\tvar halfHeight:Number = height / 2;\n\t\tvar p1:Point = new Point(halfWidth, halfHeight);\n\t\tvar p2:Point = new Point(originX, originY);\n\t\tvar radiusFromCenter:Number = p1.length;\n\t\tif(p1.equals(p2))\n\t\t{\n\t\t\tvar radius:Number = radiusFromCenter;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar distanceFromCenterToOrigin:Number = Point.distance(p1, p2);\n\t\t\tradius = radiusFromCenter + distanceFromCenterToOrigin;\n\t\t}\n\t\tvar maskTarget:Canvas;\n\t\tif(newScreen && openIris)\n\t\t{\n\t\t\tthis._newScreenDelegate = new RenderDelegate(newScreen);\n\t\t\tthis._newScreenDelegate.alpha = newScreen.alpha;\n\t\t\tthis._newScreenDelegate.blendMode = newScreen.blendMode;\n\t\t\tthis._newScreenDelegate.rotation = newScreen.rotation;\n\t\t\tthis._newScreenDelegate.scaleX = newScreen.scaleX;\n\t\t\tthis._newScreenDelegate.scaleY = newScreen.scaleY;\n\t\t\tnewScreen.parent.addChild(this._newScreenDelegate);\n\t\t\tnewScreen.visible = false;\n\t\t\tthis._savedNewScreen = newScreen;\n\n\t\t\tvar mask:Canvas = new Canvas();\n\t\t\tmask.x = originX;\n\t\t\tmask.y = originY;\n\t\t\tmask.beginFill(0xff00ff);\n\t\t\tmask.drawCircle(0, 0, radius);\n\t\t\tmask.endFill();\n\t\t\tif(openIris)\n\t\t\t{\n\t\t\t\tmask.scaleX = 0;\n\t\t\t\tmask.scaleY = 0;\n\t\t\t}\n\t\t\tif(openIris)\n\t\t\t{\n\t\t\t\tthis._newScreenDelegate.mask = mask;\n\t\t\t}\n\t\t\tnewScreen.parent.addChild(mask);\n\t\t\tmaskTarget = mask;\n\t\t}\n\t\tif(oldScreen && !openIris)\n\t\t{\n\t\t\tthis._oldScreenDelegate = new RenderDelegate(oldScreen);\n\t\t\tthis._oldScreenDelegate.alpha = oldScreen.alpha;\n\t\t\tthis._oldScreenDelegate.blendMode = oldScreen.blendMode;\n\t\t\tthis._oldScreenDelegate.rotation = oldScreen.rotation;\n\t\t\tthis._oldScreenDelegate.scaleX = oldScreen.scaleX;\n\t\t\tthis._oldScreenDelegate.scaleY = oldScreen.scaleY;\n\t\t\toldScreen.parent.addChild(this._oldScreenDelegate);\n\t\t\toldScreen.visible = false;\n\t\t\tthis._savedOldScreen = oldScreen;\n\n\t\t\tmask = new Canvas();\n\t\t\tmask.x = originX;\n\t\t\tmask.y = originY;\n\t\t\tmask.beginFill(0xff00ff);\n\t\t\tmask.drawCircle(0, 0, radius);\n\t\t\tmask.endFill();\n\t\t\tif(!openIris)\n\t\t\t{\n\t\t\t\tthis._oldScreenDelegate.mask = mask;\n\t\t\t}\n\t\t\toldScreen.parent.addChild(mask);\n\t\t\tmaskTarget = mask;\n\t\t}\n\n\t\tsuper(maskTarget, duration, ease);\n\n\t\tif(openIris)\n\t\t{\n\t\t\tthis.animate(\"scaleX\", 1);\n\t\t\tthis.animate(\"scaleY\", 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.animate(\"scaleX\", 0);\n\t\t\tthis.animate(\"scaleY\", 0);\n\t\t}\n\n\t\tif(tweenProperties)\n\t\t{\n\t\t\tfor(var propertyName:String in tweenProperties)\n\t\t\t{\n\t\t\t\tthis[propertyName] = tweenProperties[propertyName];\n\t\t\t}\n\t\t}\n\t\tthis._savedWidth = width;\n\t\tthis._savedHeight = height;\n\t\tthis._onCompleteCallback = onCompleteCallback;\n\t\tthis.onComplete = this.cleanupTween;\n\t}\n\n\tprivate var _newScreenDelegate:RenderDelegate;\n\tprivate var _oldScreenDelegate:RenderDelegate;\n\tprivate var _savedOldScreen:DisplayObject;\n\tprivate var _savedNewScreen:DisplayObject;\n\tprivate var _onCompleteCallback:Function;\n\tprivate var _savedWidth:Number;\n\tprivate var _savedHeight:Number;\n\n\tprivate function cleanupTween():void\n\t{\n\t\tif(this._newScreenDelegate)\n\t\t{\n\t\t\tthis._newScreenDelegate.mask.removeFromParent(true);\n\t\t\tthis._newScreenDelegate.removeFromParent(true);\n\t\t\tthis._newScreenDelegate = null;\n\t\t}\n\t\tif(this._oldScreenDelegate)\n\t\t{\n\t\t\tthis._oldScreenDelegate.mask.removeFromParent(true);\n\t\t\tthis._oldScreenDelegate.removeFromParent(true);\n\t\t\tthis._oldScreenDelegate = null;\n\t\t}\n\t\tif(this._savedNewScreen)\n\t\t{\n\t\t\tthis._savedNewScreen.visible = true;\n\t\t\tthis._savedNewScreen = null;\n\t\t}\n\t\tif(this._savedOldScreen)\n\t\t{\n\t\t\tthis._savedOldScreen.visible = true;\n\t\t\tthis._savedOldScreen = null;\n\t\t}\n\t\tif(this._onCompleteCallback !== null)\n\t\t{\n\t\t\tthis._onCompleteCallback();\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "source/feathers/motion/Move.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.motion\n{\n\timport feathers.motion.effectClasses.IMoveEffectContext;\n\timport feathers.motion.effectClasses.TweenMoveEffectContext;\n\n\timport starling.animation.Transitions;\n\timport starling.animation.Tween;\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * An effect that animates a component's <code>x</code> and <code>y</code>\n\t * position.\n\t *\n\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t *\n\t * @productversion Feathers 3.5.0\n\t */\n\tpublic class Move\n\t{\n\t\t/**\n\t\t * Creates an effect function for the target component that animates\n\t\t * its x and y position when they are changed. Must be used with\n\t\t * the <code>moveEffect</code> property.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#moveEffect\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t */\n\t\tpublic static function createMoveEffect(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.STOP):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IMoveEffectContext\n\t\t\t{\n\t\t\t\tvar tween:Tween = new Tween(target, duration, ease);\n\t\t\t\tvar context:TweenMoveEffectContext = new TweenMoveEffectContext(target, tween);\n\t\t\t\tcontext.interruptBehavior = interruptBehavior;\n\t\t\t\treturn context;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that\n\t\t * animates its position from its current location to a new\n\t\t * location.\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t *\n\t\t * @see #createMoveXToEffect()\n\t\t * @see #createMoveYToEffect()\n\t\t */\n\t\tpublic static function createMoveToEffect(toX:Number, toY:Number, duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.END):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IMoveEffectContext\n\t\t\t{\n\t\t\t\tvar tween:Tween = new Tween(target, duration, ease);\n\t\t\t\tvar context:TweenMoveEffectContext = new TweenMoveEffectContext(target, tween);\n\t\t\t\tcontext.oldX = target.x;\n\t\t\t\tcontext.oldY = target.y;\n\t\t\t\tcontext.newX = toX;\n\t\t\t\tcontext.newY = toY;\n\t\t\t\tcontext.interruptBehavior = interruptBehavior;\n\t\t\t\treturn context;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that\n\t\t * animates its <strong>x</strong> position from its current location to\n\t\t * a new location.\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t */\n\t\tpublic static function createMoveXToEffect(toX:Number, duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.END):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IMoveEffectContext\n\t\t\t{\n\t\t\t\tvar tween:Tween = new Tween(target, duration, ease);\n\t\t\t\tvar context:TweenMoveEffectContext = new TweenMoveEffectContext(target, tween);\n\t\t\t\tcontext.oldX = target.x;\n\t\t\t\tcontext.oldY = target.y;\n\t\t\t\tcontext.newX = toX;\n\t\t\t\tcontext.newY = target.y;\n\t\t\t\tcontext.interruptBehavior = interruptBehavior;\n\t\t\t\treturn context;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that\n\t\t * animates its <strong>y</strong> position from its current location to\n\t\t * a new location.\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t */\n\t\tpublic static function createMoveYToEffect(toY:Number, duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.END):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IMoveEffectContext\n\t\t\t{\n\t\t\t\tvar tween:Tween = new Tween(target, duration, ease);\n\t\t\t\tvar context:TweenMoveEffectContext = new TweenMoveEffectContext(target, tween);\n\t\t\t\tcontext.oldX = target.x;\n\t\t\t\tcontext.oldY = target.y;\n\t\t\t\tcontext.newX = target.x;\n\t\t\t\tcontext.newY = toY;\n\t\t\t\tcontext.interruptBehavior = interruptBehavior;\n\t\t\t\treturn context;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that\n\t\t * animates its position from a specific location to its\n\t\t * current location.\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t *\n\t\t * @see #createMoveXFromEffect()\n\t\t * @see #createMoveYFromEffect()\n\t\t */\n\t\tpublic static function createMoveFromEffect(fromX:Number, fromY:Number, duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.END):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IMoveEffectContext\n\t\t\t{\n\t\t\t\tvar tween:Tween = new Tween(target, duration, ease);\n\t\t\t\tvar context:TweenMoveEffectContext = new TweenMoveEffectContext(target, tween);\n\t\t\t\tcontext.oldX = fromX;\n\t\t\t\tcontext.oldY = fromY;\n\t\t\t\tcontext.newX = target.x;\n\t\t\t\tcontext.newY = target.y;\n\t\t\t\tcontext.interruptBehavior = interruptBehavior;\n\t\t\t\treturn context;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that\n\t\t * animates its <strong>x</strong> position from a specific location to\n\t\t * its current location.\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t */\n\t\tpublic static function createMoveXFromEffect(fromX:Number, duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.END):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IMoveEffectContext\n\t\t\t{\n\t\t\t\tvar tween:Tween = new Tween(target, duration, ease);\n\t\t\t\tvar context:TweenMoveEffectContext = new TweenMoveEffectContext(target, tween);\n\t\t\t\tcontext.oldX = fromX;\n\t\t\t\tcontext.oldY = target.y;\n\t\t\t\tcontext.newX = target.x;\n\t\t\t\tcontext.newY = target.y;\n\t\t\t\tcontext.interruptBehavior = interruptBehavior;\n\t\t\t\treturn context;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that\n\t\t * animates its <strong>y</strong> position from a specific location to\n\t\t * its current location.\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t */\n\t\tpublic static function createMoveYFromEffect(fromY:Number, duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.END):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IMoveEffectContext\n\t\t\t{\n\t\t\t\tvar tween:Tween = new Tween(target, duration, ease);\n\t\t\t\tvar context:TweenMoveEffectContext = new TweenMoveEffectContext(target, tween);\n\t\t\t\tcontext.oldX = target.x;\n\t\t\t\tcontext.oldY = fromY;\n\t\t\t\tcontext.newX = target.x;\n\t\t\t\tcontext.newY = target.y;\n\t\t\t\tcontext.interruptBehavior = interruptBehavior;\n\t\t\t\treturn context;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that\n\t\t * animates its position from its current location to a new\n\t\t * location calculated by an offset.\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t *\n\t\t * @see #createMoveXByEffect()\n\t\t * @see #createMoveYByEffect()\n\t\t */\n\t\tpublic static function createMoveByEffect(xBy:Number, yBy:Number, duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.END):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IMoveEffectContext\n\t\t\t{\n\t\t\t\tvar tween:Tween = new Tween(target, duration, ease);\n\t\t\t\tvar context:TweenMoveEffectContext = new TweenMoveEffectContext(target, tween);\n\t\t\t\tcontext.oldX = target.x;\n\t\t\t\tcontext.oldY = target.y;\n\t\t\t\tcontext.newX = target.x + xBy;\n\t\t\t\tcontext.newY = target.y + yBy;\n\t\t\t\tcontext.interruptBehavior = interruptBehavior;\n\t\t\t\treturn context;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that\n\t\t * animates its <strong>x</strong> position from its current location to\n\t\t * a new location calculated by an offset.\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t */\n\t\tpublic static function createMoveXByEffect(xBy:Number, duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.END):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IMoveEffectContext\n\t\t\t{\n\t\t\t\tvar tween:Tween = new Tween(target, duration, ease);\n\t\t\t\tvar context:TweenMoveEffectContext = new TweenMoveEffectContext(target, tween);\n\t\t\t\tcontext.oldX = target.x;\n\t\t\t\tcontext.oldY = target.y;\n\t\t\t\tcontext.newX = target.x + xBy;\n\t\t\t\tcontext.newY = target.y;\n\t\t\t\tcontext.interruptBehavior = interruptBehavior;\n\t\t\t\treturn context;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that\n\t\t * animates its <strong>y</strong> position from its current location to\n\t\t * a new location calculated by an offset.\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t */\n\t\tpublic static function createMoveYByEffect(yBy:Number, duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.END):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IMoveEffectContext\n\t\t\t{\n\t\t\t\tvar tween:Tween = new Tween(target, duration, ease);\n\t\t\t\tvar context:TweenMoveEffectContext = new TweenMoveEffectContext(target, tween);\n\t\t\t\tcontext.oldX = target.x;\n\t\t\t\tcontext.oldY = target.y;\n\t\t\t\tcontext.newX = target.x;\n\t\t\t\tcontext.newY = target.y + yBy;\n\t\t\t\tcontext.interruptBehavior = interruptBehavior;\n\t\t\t\treturn context;\n\t\t\t};\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/motion/Parallel.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.motion\n{\n\timport feathers.motion.effectClasses.IEffectContext;\n\timport feathers.motion.effectClasses.ParallelEffectContext;\n\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * Combines multiple effects that play at the same time, in parallel.\n\t *\n\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t *\n\t * @productversion Feathers 3.5.0\n\t */\n\tpublic class Parallel\n\t{\n\t\t/**\n\t\t * Creates an effect function that combines multiple effect functions\n\t\t * that will play at the same time, in parallel.\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t */\n\t\tpublic static function createParallelEffect(effect1:Function, effect2:Function, ...rest:Array):Function\n\t\t{\n\t\t\t//the order doesn't matter, so just add them at the end\n\t\t\trest[rest.length] = effect1;\n\t\t\trest[rest.length] = effect2;\n\t\t\treturn function(target:DisplayObject):IEffectContext\n\t\t\t{\n\t\t\t\treturn new ParallelEffectContext(target, rest);\n\t\t\t};\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/motion/Resize.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.motion\n{\n\timport feathers.core.IFeathersControl;\n\timport feathers.motion.effectClasses.IEffectContext;\n\timport feathers.motion.effectClasses.IResizeEffectContext;\n\timport feathers.motion.effectClasses.TweenEffectContext;\n\timport feathers.motion.effectClasses.TweenResizeEffectContext;\n\n\timport starling.animation.Transitions;\n\timport starling.animation.Tween;\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * An effect that animates a component's <code>width</code> and\n\t * <code>height</code> dimensions.\n\t *\n\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t *\n\t * @productversion Feathers 3.5.0\n\t */\n\tpublic class Resize\n\t{\n\t\t/**\n\t\t * Creates an effect function for the target component that animates\n\t\t * its dimensions when they are changed. Must be used with the\n\t\t * <code>resizeEffect</code> property.\n\t\t *\n\t\t * @see feathers.core.FeathersControl#resizeEffect\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t */\n\t\tpublic static function createResizeEffect(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.STOP):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IResizeEffectContext\n\t\t\t{\n\t\t\t\tvar tween:Tween = new Tween(target, duration, ease);\n\t\t\t\tvar context:TweenResizeEffectContext = new TweenResizeEffectContext(target, tween);\n\t\t\t\tcontext.interruptBehavior = interruptBehavior;\n\t\t\t\treturn context;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that\n\t\t * animates its dimensions from their current values to new values.\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t *\n\t\t * @see #createResizeWidthToEffect()\n\t\t * @see #createResizeHeightToEffect()\n\t\t */\n\t\tpublic static function createResizeToEffect(toWidth:Number, toHeight:Number, duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.END):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IEffectContext\n\t\t\t{\n\t\t\t\tvar tween:Tween = new Tween(target, duration, ease);\n\t\t\t\ttween.animate(\"width\", toWidth);\n\t\t\t\ttween.animate(\"height\", toHeight);\n\t\t\t\tvar context:TweenEffectContext = new TweenEffectContext(target, tween);\n\t\t\t\tcontext.interruptBehavior = interruptBehavior;\n\t\t\t\treturn context;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that\n\t\t * animates its <strong>width</strong> from its current value to a new\n\t\t * value.\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t */\n\t\tpublic static function createResizeWidthToEffect(toWidth:Number, duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.END):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IEffectContext\n\t\t\t{\n\t\t\t\tvar tween:Tween = new Tween(target, duration, ease);\n\t\t\t\ttween.animate(\"width\", toWidth);\n\t\t\t\tvar context:TweenEffectContext = new TweenEffectContext(target, tween);\n\t\t\t\tcontext.interruptBehavior = interruptBehavior;\n\t\t\t\treturn context;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that\n\t\t * animates its <strong>height</strong> from its current value to a new\n\t\t * value.\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t */\n\t\tpublic static function createResizeHeightToEffect(toHeight:Number, duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.END):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IEffectContext\n\t\t\t{\n\t\t\t\tvar tween:Tween = new Tween(target, duration, ease);\n\t\t\t\ttween.animate(\"height\", toHeight);\n\t\t\t\tvar context:TweenEffectContext = new TweenEffectContext(target, tween);\n\t\t\t\tcontext.interruptBehavior = interruptBehavior;\n\t\t\t\treturn context;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that\n\t\t * animates its dimensions from specific values to its\n\t\t * current values.\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t *\n\t\t * @see #createResizeWidthFromEffect()\n\t\t * @see createResizeHeightFromEffect()\n\t\t */\n\t\tpublic static function createResizeFromEffect(fromWidth:Number, fromHeight:Number, duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.END):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IEffectContext\n\t\t\t{\n\t\t\t\tvar oldWidth:Number = target.width;\n\t\t\t\tvar oldHeight:Number = target.height;\n\t\t\t\tif(target is IFeathersControl)\n\t\t\t\t{\n\t\t\t\t\tvar oldExplicitWidth:Number = IFeathersControl(target).explicitWidth;\n\t\t\t\t\tvar oldExplicitHeight:Number = IFeathersControl(target).explicitHeight;\n\t\t\t\t\tif(oldExplicitWidth === oldExplicitWidth || //!isNaN\n\t\t\t\t\t\toldExplicitHeight === oldExplicitHeight) //!isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\ttween.onComplete = function():void\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//restore the original explicit height\n\t\t\t\t\t\t\ttarget.width = oldExplicitWidth;\n\t\t\t\t\t\t\ttarget.height = oldExplicitHeight;\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\tIFeathersControl(target).suspendEffects();\n\t\t\t\t}\n\t\t\t\ttarget.width = fromWidth;\n\t\t\t\ttarget.height = fromHeight;\n\t\t\t\tif(target is IFeathersControl)\n\t\t\t\t{\n\t\t\t\t\tIFeathersControl(target).resumeEffects();\n\t\t\t\t}\n\t\t\t\tvar tween:Tween = new Tween(target, duration, ease);\n\t\t\t\ttween.animate(\"width\", oldWidth);\n\t\t\t\ttween.animate(\"height\", oldHeight);\n\t\t\t\tvar context:TweenEffectContext = new TweenEffectContext(target, tween);\n\t\t\t\tcontext.interruptBehavior = interruptBehavior;\n\t\t\t\treturn context;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that\n\t\t * animates its <strong>width</strong> from a specific value to its\n\t\t * current value.\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t */\n\t\tpublic static function createResizeWidthFromEffect(fromWidth:Number, duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.END):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IEffectContext\n\t\t\t{\n\t\t\t\tvar oldWidth:Number = target.width;\n\t\t\t\tif(target is IFeathersControl)\n\t\t\t\t{\n\t\t\t\t\tvar oldExplicitWidth:Number = IFeathersControl(target).explicitWidth;\n\t\t\t\t\tif(oldExplicitWidth === oldExplicitWidth) //!isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\ttween.onComplete = function():void\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//restore the original explicit width\n\t\t\t\t\t\t\ttarget.width = oldExplicitWidth;\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\tIFeathersControl(target).suspendEffects();\n\t\t\t\t}\n\t\t\t\ttarget.width = fromWidth;\n\t\t\t\tif(target is IFeathersControl)\n\t\t\t\t{\n\t\t\t\t\tIFeathersControl(target).resumeEffects();\n\t\t\t\t}\n\t\t\t\tvar tween:Tween = new Tween(target, duration, ease);\n\t\t\t\ttween.animate(\"width\", oldWidth);\n\t\t\t\tvar context:TweenEffectContext = new TweenEffectContext(target, tween);\n\t\t\t\tcontext.interruptBehavior = interruptBehavior;\n\t\t\t\treturn context;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that\n\t\t * animates its <strong>height</strong> from a specific value to its\n\t\t * current value.\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t */\n\t\tpublic static function createResizeHeightFromEffect(fromHeight:Number, duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.END):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IEffectContext\n\t\t\t{\n\t\t\t\tvar oldHeight:Number = target.height;\n\t\t\t\tif(target is IFeathersControl)\n\t\t\t\t{\n\t\t\t\t\tvar oldExplicitHeight:Number = IFeathersControl(target).explicitHeight;\n\t\t\t\t\tif(oldExplicitHeight === oldExplicitHeight) //!isNaN\n\t\t\t\t\t{\n\t\t\t\t\t\ttween.onComplete = function():void\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//restore the original explicit height\n\t\t\t\t\t\t\ttarget.height = oldExplicitHeight;\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\tIFeathersControl(target).suspendEffects();\n\t\t\t\t}\n\t\t\t\ttarget.height = fromHeight;\n\t\t\t\tif(target is IFeathersControl)\n\t\t\t\t{\n\t\t\t\t\tIFeathersControl(target).resumeEffects();\n\t\t\t\t}\n\t\t\t\tvar tween:Tween = new Tween(target, duration, ease);\n\t\t\t\ttween.animate(\"height\", oldHeight);\n\t\t\t\tvar context:TweenEffectContext = new TweenEffectContext(target, tween);\n\t\t\t\tcontext.interruptBehavior = interruptBehavior;\n\t\t\t\treturn context;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that\n\t\t * animates its dimensions from its current values to new values\n\t\t * calculated by an offset.\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t *\n\t\t * @see #createResizeWidthByEffect()\n\t\t * @see #createResizeHeightByEffect()\n\t\t */\n\t\tpublic static function createResizeByEffect(widthBy:Number, heightBy:Number, duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.END):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IEffectContext\n\t\t\t{\n\t\t\t\tvar tween:Tween = new Tween(target, duration, ease);\n\t\t\t\ttween.animate(\"width\", target.width + widthBy);\n\t\t\t\ttween.animate(\"height\", target.height + heightBy);\n\t\t\t\tvar context:TweenEffectContext = new TweenEffectContext(target, tween);\n\t\t\t\tcontext.interruptBehavior = interruptBehavior;\n\t\t\t\treturn context;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that\n\t\t * animates its <strong>width</strong> from its current value to a new\n\t\t * value calculated by an offset.\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t */\n\t\tpublic static function createResizeWidthByEffect(widthBy:Number, duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.END):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IEffectContext\n\t\t\t{\n\t\t\t\tvar tween:Tween = new Tween(target, duration, ease);\n\t\t\t\ttween.animate(\"width\", target.width + widthBy);\n\t\t\t\tvar context:TweenEffectContext = new TweenEffectContext(target, tween);\n\t\t\t\tcontext.interruptBehavior = interruptBehavior;\n\t\t\t\treturn context;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that\n\t\t * animates its <strong>height</strong> from its current value to a new\n\t\t * value calculated by an offset.\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t */\n\t\tpublic static function createResizeHeightByEffect(heightBy:Number, duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, interruptBehavior:String = EffectInterruptBehavior.END):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IEffectContext\n\t\t\t{\n\t\t\t\tvar tween:Tween = new Tween(target, duration, ease);\n\t\t\t\ttween.animate(\"height\", target.height + heightBy);\n\t\t\t\tvar context:TweenEffectContext = new TweenEffectContext(target, tween);\n\t\t\t\tcontext.interruptBehavior = interruptBehavior;\n\t\t\t\treturn context;\n\t\t\t};\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/motion/Reveal.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.motion\n{\n\timport feathers.motion.effectClasses.IEffectContext;\n\timport feathers.motion.effectClasses.TweenEffectContext;\n\n\timport starling.animation.Transitions;\n\timport starling.animation.Tween;\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * Creates animated transitions for screen navigators that slide a display\n\t * object out of view, by animating the <code>x</code> or <code>y</code>\n\t * property, while revealing an existing display object that\n\t * remains stationary below. The display object may slide up, right,\n\t * down, or left.\n\t *\n\t * @see ../../../help/transitions.html#reveal Transitions for Feathers screen navigators: Reveal\n\t *\n\t * @productversion Feathers 2.1.0\n\t */\n\tpublic class Reveal\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const SCREEN_REQUIRED_ERROR:String = \"Cannot transition if both old screen and new screen are null.\";\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that slides the\n\t\t * old screen out of view to the left, animating the <code>x</code>\n\t\t * property, to reveal the new screen under it. The new screen remains\n\t\t * stationary.\n\t\t *\n\t\t * @see ../../../help/transitions.html#reveal Transitions for Feathers screen navigators: Reveal\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createRevealLeftTransition(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tif(oldScreen)\n\t\t\t\t{\n\t\t\t\t\toldScreen.x = 0;\n\t\t\t\t\toldScreen.y = 0;\n\t\t\t\t}\n\t\t\t\tif(newScreen)\n\t\t\t\t{\n\t\t\t\t\tnewScreen.x = 0;\n\t\t\t\t\tnewScreen.y = 0;\n\t\t\t\t\tvar tween:RevealTween = new RevealTween(oldScreen, newScreen, -newScreen.width, 0, duration, ease, onComplete, tweenProperties);\n\t\t\t\t\tif(managed)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t\t}\n\t\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\t//we only have the old screen\n\t\t\t\treturn slideOutOldScreen(oldScreen, -oldScreen.width, 0, duration, ease, tweenProperties, onComplete, managed);\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that slides the\n\t\t * old screen out of view to the right, animating the <code>x</code>\n\t\t * property, to reveal the new screen under it. The new screen remains\n\t\t * stationary.\n\t\t *\n\t\t * @see ../../../help/transitions.html#reveal Transitions for Feathers screen navigators: Reveal\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createRevealRightTransition(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tif(oldScreen)\n\t\t\t\t{\n\t\t\t\t\toldScreen.x = 0;\n\t\t\t\t\toldScreen.y = 0;\n\t\t\t\t}\n\t\t\t\tif(newScreen)\n\t\t\t\t{\n\t\t\t\t\tnewScreen.x = 0;\n\t\t\t\t\tnewScreen.y = 0;\n\t\t\t\t\tvar tween:RevealTween = new RevealTween(oldScreen, newScreen, newScreen.width, 0, duration, ease, onComplete, tweenProperties);\n\t\t\t\t\tif(managed)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t\t}\n\t\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\t//we only have the old screen\n\t\t\t\treturn slideOutOldScreen(oldScreen, oldScreen.width, 0, duration, ease, tweenProperties, onComplete, managed);\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that slides the\n\t\t * old screen up out of view, animating the <code>y</code> property, to\n\t\t * reveal the new screen under it. The new screen remains stationary.\n\t\t *\n\t\t * @see ../../../help/transitions.html#reveal Transitions for Feathers screen navigators: Reveal\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createRevealUpTransition(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tif(oldScreen)\n\t\t\t\t{\n\t\t\t\t\toldScreen.x = 0;\n\t\t\t\t\toldScreen.y = 0;\n\t\t\t\t}\n\t\t\t\tif(newScreen)\n\t\t\t\t{\n\t\t\t\t\tnewScreen.x = 0;\n\t\t\t\t\tnewScreen.y = 0;\n\t\t\t\t\tvar tween:RevealTween = new RevealTween(oldScreen, newScreen, 0, -newScreen.height, duration, ease, onComplete, tweenProperties);\n\t\t\t\t\tif(managed)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t\t}\n\t\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\t//we only have the old screen\n\t\t\t\treturn slideOutOldScreen(oldScreen, 0, -oldScreen.height, duration, ease, tweenProperties, onComplete, managed);\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that slides the\n\t\t * old screen down out of view, animating the <code>y</code> property,\n\t\t * to reveal the new screen under it. The new screen remains stationary.\n\t\t *\n\t\t * @see ../../../help/transitions.html#reveal Transitions for Feathers screen navigators: Reveal\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createRevealDownTransition(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tif(oldScreen)\n\t\t\t\t{\n\t\t\t\t\toldScreen.x = 0;\n\t\t\t\t\toldScreen.y = 0;\n\t\t\t\t}\n\t\t\t\tif(newScreen)\n\t\t\t\t{\n\t\t\t\t\tnewScreen.x = 0;\n\t\t\t\t\tnewScreen.y = 0;\n\t\t\t\t\tvar tween:RevealTween = new RevealTween(oldScreen, newScreen, 0, newScreen.height, duration, ease, onComplete, tweenProperties);\n\t\t\t\t\tif(managed)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t\t}\n\t\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\t//we only have the old screen\n\t\t\t\treturn slideOutOldScreen(oldScreen, 0, oldScreen.height, duration, ease, tweenProperties, onComplete, managed);\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static function slideOutOldScreen(oldScreen:DisplayObject,\n\t\t\txOffset:Number, yOffset:Number, duration:Number, ease:Object,\n\t\t\ttweenProperties:Object, onComplete:Function, managed:Boolean):IEffectContext\n\t\t{\n\t\t\tvar tween:Tween = new Tween(oldScreen, duration, ease);\n\t\t\tif(xOffset != 0)\n\t\t\t{\n\t\t\t\ttween.animate(\"x\", xOffset);\n\t\t\t}\n\t\t\tif(yOffset != 0)\n\t\t\t{\n\t\t\t\ttween.animate(\"y\", yOffset);\n\t\t\t}\n\t\t\tif(tweenProperties)\n\t\t\t{\n\t\t\t\tfor(var propertyName:String in tweenProperties)\n\t\t\t\t{\n\t\t\t\t\ttween[propertyName] = tweenProperties[propertyName];\n\t\t\t\t}\n\t\t\t}\n\t\t\ttween.onComplete = onComplete;\n\t\t\tif(managed)\n\t\t\t{\n\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t}\n\t\t\tStarling.juggler.add(tween);\n\t\t\treturn null;\n\t\t}\n\t}\n}\n\nimport feathers.display.RenderDelegate;\n\nimport starling.animation.Tween;\nimport starling.core.Starling;\nimport starling.display.DisplayObject;\nimport starling.display.Quad;\nimport starling.display.Sprite;\n\nclass RevealTween extends Tween\n{\n\tpublic function RevealTween(oldScreen:DisplayObject, newScreen:DisplayObject,\n\t\txOffset:Number, yOffset:Number, duration:Number, ease:Object, onCompleteCallback:Function,\n\t\ttweenProperties:Object)\n\t{\n\t\tvar mask:Quad = new Quad(1, 1, 0xff00ff);\n\t\t//the initial dimensions cannot be 0 or there's a runtime error\n\t\tmask.width = oldScreen.width;\n\t\tmask.height = oldScreen.height;\n\t\tmask.width = 0;\n\t\tmask.height = 0;\n\t\tif(xOffset == 0)\n\t\t{\n\t\t\tmask.width = newScreen.width;\n\t\t}\n\t\telse if(xOffset < 0)\n\t\t{\n\t\t\tmask.x = -xOffset;\n\t\t}\n\t\tif(yOffset == 0)\n\t\t{\n\t\t\tmask.height = newScreen.height;\n\t\t}\n\t\telse if(yOffset < 0)\n\t\t{\n\t\t\tmask.y = -yOffset;\n\t\t}\n\t\tthis._temporaryParent = new Sprite();\n\t\tthis._temporaryParent.mask = mask;\n\t\tnewScreen.parent.addChild(this._temporaryParent);\n\t\tvar delegate:RenderDelegate = new RenderDelegate(newScreen);\n\t\tdelegate.alpha = newScreen.alpha;\n\t\tdelegate.blendMode = newScreen.blendMode;\n\t\tdelegate.rotation = newScreen.rotation;\n\t\tdelegate.scaleX = newScreen.scaleX;\n\t\tdelegate.scaleY = newScreen.scaleY;\n\t\tthis._temporaryParent.addChild(delegate);\n\t\tnewScreen.visible = false;\n\t\tthis._savedNewScreen = newScreen;\n\n\t\tsuper(this._temporaryParent.mask, duration, ease);\n\n\t\tif(xOffset < 0)\n\t\t{\n\t\t\tthis.animate(\"x\", mask.x + xOffset);\n\t\t\tthis.animate(\"width\", -xOffset);\n\t\t}\n\t\telse if(xOffset > 0)\n\t\t{\n\t\t\tthis.animate(\"width\", xOffset);\n\t\t}\n\t\tif(yOffset < 0)\n\t\t{\n\t\t\tthis.animate(\"y\", mask.y + yOffset);\n\t\t\tthis.animate(\"height\", -yOffset);\n\t\t}\n\t\telse if(yOffset > 0)\n\t\t{\n\t\t\tthis.animate(\"height\", yOffset);\n\t\t}\n\n\t\tif(tweenProperties)\n\t\t{\n\t\t\tfor(var propertyName:String in tweenProperties)\n\t\t\t{\n\t\t\t\tthis[propertyName] = tweenProperties[propertyName];\n\t\t\t}\n\t\t}\n\t\tthis._onCompleteCallback = onCompleteCallback;\n\t\tif(oldScreen)\n\t\t{\n\t\t\tthis._savedOldScreen = oldScreen;\n\t\t\tthis._savedXOffset = xOffset;\n\t\t\tthis._savedYOffset = yOffset;\n\t\t\tthis.onUpdate = this.updateOldScreen;\n\t\t}\n\t\tthis.onComplete = this.cleanupTween;\n\t}\n\n\tprivate var _savedXOffset:Number;\n\tprivate var _savedYOffset:Number;\n\tprivate var _savedNewScreen:DisplayObject;\n\tprivate var _savedOldScreen:DisplayObject;\n\tprivate var _temporaryParent:Sprite;\n\tprivate var _onCompleteCallback:Function;\n\n\tprivate function updateOldScreen():void\n\t{\n\t\tvar mask:Quad = Quad(this.target);\n\t\tif(this._savedXOffset < 0)\n\t\t{\n\t\t\tthis._savedOldScreen.x = -mask.width;\n\t\t}\n\t\telse if(this._savedXOffset > 0)\n\t\t{\n\t\t\tthis._savedOldScreen.x = mask.width;\n\t\t}\n\t\tif(this._savedYOffset < 0)\n\t\t{\n\t\t\tthis._savedOldScreen.y = -mask.height;\n\t\t}\n\t\telse if(this._savedYOffset > 0)\n\t\t{\n\t\t\tthis._savedOldScreen.y = mask.height;\n\t\t}\n\t}\n\n\tprivate function cleanupTween():void\n\t{\n\t\tthis._temporaryParent.removeFromParent(true);\n\t\tthis._temporaryParent = null;\n\t\tthis._savedNewScreen.visible = true;\n\t\tthis._savedNewScreen = null;\n\t\tif(this._savedOldScreen)\n\t\t{\n\t\t\tthis._savedOldScreen.x = 0;\n\t\t\tthis._savedOldScreen.y = 0;\n\t\t\tthis._savedOldScreen = null;\n\t\t}\n\t\tif(this._onCompleteCallback !== null)\n\t\t{\n\t\t\tthis._onCompleteCallback();\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "source/feathers/motion/Sequence.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.motion\n{\n\timport feathers.motion.effectClasses.IEffectContext;\n\timport feathers.motion.effectClasses.SequenceEffectContext;\n\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * Combines multiple effects that play one after another in sequence.\n\t *\n\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t *\n\t * @productversion Feathers 3.5.0\n\t */\n\tpublic class Sequence\n\t{\n\t\t/**\n\t\t * Creates an effect function that combines multiple effect functions\n\t\t * that will play one after another, in sequence.\n\t\t *\n\t\t * @productversion Feathers 3.5.0\n\t\t */\n\t\tpublic static function createSequenceEffect(effect1:Function, effect2:Function, ...rest:Array):Function\n\t\t{\n\t\t\trest.unshift(effect2);\n\t\t\trest.unshift(effect1);\n\t\t\treturn function(target:DisplayObject):IEffectContext\n\t\t\t{\n\t\t\t\treturn new SequenceEffectContext(target, rest);\n\t\t\t};\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/motion/Slide.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.motion\n{\n\timport feathers.motion.effectClasses.IEffectContext;\n\timport feathers.motion.effectClasses.TweenEffectContext;\n\n\timport starling.animation.Transitions;\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * Creates animated transitions for screen navigators that slides two\n\t * display objects in the same direction (replacing one with the other) like\n\t * a classic slide carousel. Animates the <code>x</code> and <code>y</code>\n\t * properties of the display objects. The display objects may slide up,\n\t * right, down, or left.\n\t *\n\t * @see ../../../help/transitions.html#slide Transitions for Feathers screen navigators: Slide\n\t *\n\t * @productversion Feathers 2.1.0\n\t */\n\tpublic class Slide\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const SCREEN_REQUIRED_ERROR:String = \"Cannot transition if both old screen and new screen are null.\";\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that slides the\n\t\t * new screen to the left from off-stage, pushing the old screen in the\n\t\t * same direction.\n\t\t *\n\t\t * @see ../../../help/transitions.html#slide Transitions for Feathers screen navigators: Slide\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createSlideLeftTransition(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tif(newScreen)\n\t\t\t\t{\n\t\t\t\t\tif(oldScreen)\n\t\t\t\t\t{\n\t\t\t\t\t\toldScreen.x = 0;\n\t\t\t\t\t\toldScreen.y = 0;\n\t\t\t\t\t}\n\t\t\t\t\tnewScreen.x = newScreen.width;\n\t\t\t\t\tnewScreen.y = 0;\n\t\t\t\t\tvar tween:SlideTween = new SlideTween(newScreen, oldScreen, -newScreen.width, 0, duration, ease, onComplete, tweenProperties);\n\t\t\t\t}\n\t\t\t\telse //we only have the old screen\n\t\t\t\t{\n\t\t\t\t\toldScreen.x = 0;\n\t\t\t\t\toldScreen.y = 0;\n\t\t\t\t\ttween = new SlideTween(oldScreen, null, -oldScreen.width, 0, duration, ease, onComplete, tweenProperties);\n\t\t\t\t}\n\t\t\t\tif(managed)\n\t\t\t\t{\n\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t}\n\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that that slides\n\t\t * the new screen to the right from off-stage, pushing the old screen in\n\t\t * the same direction.\n\t\t *\n\t\t * @see ../../../help/transitions.html#slide Transitions for Feathers screen navigators: Slide\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createSlideRightTransition(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tif(newScreen)\n\t\t\t\t{\n\t\t\t\t\tif(oldScreen)\n\t\t\t\t\t{\n\t\t\t\t\t\toldScreen.x = 0;\n\t\t\t\t\t\toldScreen.y = 0;\n\t\t\t\t\t}\n\t\t\t\t\tnewScreen.x = -newScreen.width;\n\t\t\t\t\tnewScreen.y = 0;\n\t\t\t\t\tvar tween:SlideTween = new SlideTween(newScreen, oldScreen, newScreen.width, 0, duration, ease, onComplete, tweenProperties);\n\t\t\t\t}\n\t\t\t\telse //we only have the old screen\n\t\t\t\t{\n\t\t\t\t\toldScreen.x = 0;\n\t\t\t\t\toldScreen.y = 0;\n\t\t\t\t\ttween = new SlideTween(oldScreen, null, oldScreen.width, 0, duration, ease, onComplete, tweenProperties);\n\t\t\t\t}\n\t\t\t\tif(managed)\n\t\t\t\t{\n\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t}\n\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that that slides\n\t\t * the new screen up from off-stage, pushing the old screen in the same\n\t\t * direction.\n\t\t *\n\t\t * @see ../../../help/transitions.html#slide Transitions for Feathers screen navigators: Slide\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createSlideUpTransition(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tif(newScreen)\n\t\t\t\t{\n\t\t\t\t\tif(oldScreen)\n\t\t\t\t\t{\n\t\t\t\t\t\toldScreen.x = 0;\n\t\t\t\t\t\toldScreen.y = 0;\n\t\t\t\t\t}\n\t\t\t\t\tnewScreen.x = 0;\n\t\t\t\t\tnewScreen.y = newScreen.height;\n\t\t\t\t\tvar tween:SlideTween = new SlideTween(newScreen, oldScreen, 0, -newScreen.height, duration, ease, onComplete, tweenProperties);\n\t\t\t\t}\n\t\t\t\telse //we only have the old screen\n\t\t\t\t{\n\t\t\t\t\toldScreen.x = 0;\n\t\t\t\t\toldScreen.y = 0;\n\t\t\t\t\ttween = new SlideTween(oldScreen, null, 0, -oldScreen.height, duration, ease, onComplete, tweenProperties);\n\t\t\t\t}\n\t\t\t\tif(managed)\n\t\t\t\t{\n\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t}\n\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that that slides\n\t\t * the new screen down from off-stage, pushing the old screen in the\n\t\t * same direction.\n\t\t *\n\t\t * @see ../../../help/transitions.html#slide Transitions for Feathers screen navigators: Slide\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createSlideDownTransition(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tif(newScreen)\n\t\t\t\t{\n\t\t\t\t\tif(oldScreen)\n\t\t\t\t\t{\n\t\t\t\t\t\toldScreen.x = 0;\n\t\t\t\t\t\toldScreen.y = 0;\n\t\t\t\t\t}\n\t\t\t\t\tnewScreen.x = 0;\n\t\t\t\t\tnewScreen.y = -newScreen.height;\n\t\t\t\t\tvar tween:SlideTween = new SlideTween(newScreen, oldScreen, 0, newScreen.height, duration, ease, onComplete, tweenProperties);\n\t\t\t\t}\n\t\t\t\telse //we only have the old screen\n\t\t\t\t{\n\t\t\t\t\toldScreen.x = 0;\n\t\t\t\t\toldScreen.y = 0;\n\t\t\t\t\ttween = new SlideTween(oldScreen, null, 0, oldScreen.height, duration, ease, onComplete, tweenProperties);\n\t\t\t\t}\n\t\t\t\tif(managed)\n\t\t\t\t{\n\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t}\n\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\t}\n}\n\nimport starling.animation.Tween;\nimport starling.core.Starling;\nimport starling.display.DisplayObject;\n\nclass SlideTween extends Tween\n{\n\tpublic function SlideTween(target:DisplayObject, otherTarget:DisplayObject,\n\t\txOffset:Number, yOffset:Number, duration:Number, ease:Object,\n\t\tonCompleteCallback:Function, tweenProperties:Object)\n\t{\n\t\tsuper(target, duration, ease);\n\t\tif(xOffset != 0)\n\t\t{\n\t\t\tthis._xOffset = xOffset;\n\t\t\tthis.animate(\"x\", target.x + xOffset);\n\t\t}\n\t\tif(yOffset != 0)\n\t\t{\n\t\t\tthis._yOffset = yOffset;\n\t\t\tthis.animate(\"y\", target.y + yOffset);\n\t\t}\n\t\tif(tweenProperties)\n\t\t{\n\t\t\tfor(var propertyName:String in tweenProperties)\n\t\t\t{\n\t\t\t\tthis[propertyName] = tweenProperties[propertyName];\n\t\t\t}\n\t\t}\n\t\tthis._navigator = target.parent;\n\t\tif(otherTarget)\n\t\t{\n\t\t\tthis._otherTarget = otherTarget;\n\t\t\tthis.onUpdate = this.updateOtherTarget;\n\t\t}\n\t\tthis._onCompleteCallback = onCompleteCallback;\n\t\tthis.onComplete = this.cleanupTween;\n\t}\n\n\tprivate var _navigator:DisplayObject;\n\tprivate var _otherTarget:DisplayObject;\n\tprivate var _onCompleteCallback:Function;\n\tprivate var _xOffset:Number = 0;\n\tprivate var _yOffset:Number = 0;\n\n\tprivate function updateOtherTarget():void\n\t{\n\t\tvar newScreen:DisplayObject = DisplayObject(this.target);\n\t\tif(this._xOffset < 0)\n\t\t{\n\t\t\tthis._otherTarget.x = newScreen.x - this._navigator.width;\n\t\t}\n\t\telse if(this._xOffset > 0)\n\t\t{\n\t\t\tthis._otherTarget.x = newScreen.x + newScreen.width;\n\t\t}\n\t\tif(this._yOffset < 0)\n\t\t{\n\t\t\tthis._otherTarget.y = newScreen.y - this._navigator.height;\n\t\t}\n\t\telse if(this._yOffset > 0)\n\t\t{\n\t\t\tthis._otherTarget.y = newScreen.y + newScreen.height;\n\t\t}\n\t}\n\n\tprivate function cleanupTween():void\n\t{\n\t\tthis.target.x = 0;\n\t\tthis.target.y = 0;\n\t\tif(this._otherTarget)\n\t\t{\n\t\t\tthis._otherTarget.x = 0;\n\t\t\tthis._otherTarget.y = 0;\n\t\t}\n\t\tif(this._onCompleteCallback !== null)\n\t\t{\n\t\t\tthis._onCompleteCallback();\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/motion/Wipe.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.motion\n{\n\timport feathers.motion.effectClasses.IEffectContext;\n\timport feathers.motion.effectClasses.TweenEffectContext;\n\n\timport starling.animation.Transitions;\n\timport starling.animation.Tween;\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\n\t/**\n\t * Creates effects for Feathers components and transitions for screen\n\t * navigators that wipe a display object out of view, revealing another\n\t * display object under the first. Both display objects remain stationary\n\t * while the effect animates clipping rectangles. The clipping rectangles\n\t * may be animated up, right, down, or left.\n\t *\n\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t * @see ../../../help/transitions.html#wipe Transitions for Feathers screen navigators: Wipe\n\t *\n\t * @productversion Feathers 2.2.0\n\t */\n\tpublic class Wipe\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const SCREEN_REQUIRED_ERROR:String = \"Cannot transition if both old screen and new screen are null.\";\n\n\t\t/**\n\t\t * Creates an effect function for the target component that wipes the\n\t\t * target component into view from right to left, animating the\n\t\t * <code>width</code> and <code>x</code> properties of a temporary mask.\n\t\t *\n\t\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t\t */\n\t\tpublic static function createWipeInLeftEffect(duration:Number = 0.25, ease:Object = Transitions.EASE_OUT):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IEffectContext\n\t\t\t{\n\t\t\t\tvar oldMask:DisplayObject = target.mask;\n\t\t\t\tvar maskWidth:Number = target.width;\n\t\t\t\tvar maskHeight:Number = target.height;\n\t\t\t\tif(maskWidth < 0)\n\t\t\t\t{\n\t\t\t\t\tmaskWidth = 1;\n\t\t\t\t}\n\t\t\t\tif(maskHeight < 0)\n\t\t\t\t{\n\t\t\t\t\tmaskHeight = 1;\n\t\t\t\t}\n\t\t\t\tvar mask:Quad = new Quad(maskWidth, maskHeight, 0xff00ff);\n\t\t\t\tmask.width = 0;\n\t\t\t\tmask.x = maskWidth;\n\t\t\t\ttarget.mask = mask;\n\t\t\t\tvar tween:Tween = new Tween(mask, duration, ease);\n\t\t\t\ttween.animate(\"width\", maskWidth);\n\t\t\t\ttween.animate(\"x\", 0);\n\t\t\t\ttween.onComplete = function():void\n\t\t\t\t{\n\t\t\t\t\ttarget.mask = oldMask;\n\t\t\t\t\tmask.removeFromParent(true);\n\t\t\t\t};\n\t\t\t\treturn new TweenEffectContext(target, tween);\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that wipes the\n\t\t * target component into view from left to right, animating the\n\t\t * <code>width</code> property of a temporary mask.\n\t\t *\n\t\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t\t */\n\t\tpublic static function createWipeInRightEffect(duration:Number = 0.25, ease:Object = Transitions.EASE_OUT):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IEffectContext\n\t\t\t{\n\t\t\t\tvar oldMask:DisplayObject = target.mask;\n\t\t\t\tvar maskWidth:Number = target.width;\n\t\t\t\tvar maskHeight:Number = target.height;\n\t\t\t\tif(maskWidth < 0)\n\t\t\t\t{\n\t\t\t\t\tmaskWidth = 1;\n\t\t\t\t}\n\t\t\t\tif(maskHeight < 0)\n\t\t\t\t{\n\t\t\t\t\tmaskHeight = 1;\n\t\t\t\t}\n\t\t\t\tvar mask:Quad = new Quad(maskWidth, maskHeight, 0xff00ff);\n\t\t\t\tmask.width = 0;\n\t\t\t\ttarget.mask = mask;\n\t\t\t\tvar tween:Tween = new Tween(mask, duration, ease);\n\t\t\t\ttween.animate(\"width\", maskWidth);\n\t\t\t\ttween.onComplete = function():void\n\t\t\t\t{\n\t\t\t\t\ttarget.mask = oldMask;\n\t\t\t\t\tmask.dispose();\n\t\t\t\t};\n\t\t\t\treturn new TweenEffectContext(target, tween);\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that wipes the\n\t\t * target component into view from bottom to top, animating the\n\t\t * <code>height</code> and <code>y</code> properties of a temporary mask.\n\t\t *\n\t\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t\t */\n\t\tpublic static function createWipeInUpEffect(duration:Number = 0.25, ease:Object = Transitions.EASE_OUT):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IEffectContext\n\t\t\t{\n\t\t\t\tvar oldMask:DisplayObject = target.mask;\n\t\t\t\tvar maskWidth:Number = target.width;\n\t\t\t\tvar maskHeight:Number = target.height;\n\t\t\t\tif(maskWidth < 0)\n\t\t\t\t{\n\t\t\t\t\tmaskWidth = 1;\n\t\t\t\t}\n\t\t\t\tif(maskHeight < 0)\n\t\t\t\t{\n\t\t\t\t\tmaskHeight = 1;\n\t\t\t\t}\n\t\t\t\tvar mask:Quad = new Quad(maskWidth, maskHeight, 0xff00ff);\n\t\t\t\tmask.height = 0;\n\t\t\t\tmask.y = maskHeight;\n\t\t\t\ttarget.mask = mask;\n\t\t\t\tvar tween:Tween = new Tween(mask, duration, ease);\n\t\t\t\ttween.animate(\"height\", maskHeight);\n\t\t\t\ttween.animate(\"y\", 0);\n\t\t\t\ttween.onComplete = function():void\n\t\t\t\t{\n\t\t\t\t\ttarget.mask = oldMask;\n\t\t\t\t\tmask.dispose();\n\t\t\t\t};\n\t\t\t\treturn new TweenEffectContext(target, tween);\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that wipes the\n\t\t * target component into view from top to bottom, animating the\n\t\t * <code>height</code> property of a temporary mask.\n\t\t *\n\t\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t\t */\n\t\tpublic static function createWipeInDownEffect(duration:Number = 0.25, ease:Object = Transitions.EASE_OUT):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IEffectContext\n\t\t\t{\n\t\t\t\tvar oldMask:DisplayObject = target.mask;\n\t\t\t\tvar maskWidth:Number = target.width;\n\t\t\t\tvar maskHeight:Number = target.height;\n\t\t\t\tif(maskWidth < 0)\n\t\t\t\t{\n\t\t\t\t\tmaskWidth = 1;\n\t\t\t\t}\n\t\t\t\tif(maskHeight < 0)\n\t\t\t\t{\n\t\t\t\t\tmaskHeight = 1;\n\t\t\t\t}\n\t\t\t\tvar mask:Quad = new Quad(maskWidth, maskHeight, 0xff00ff);\n\t\t\t\tmask.height = 0;\n\t\t\t\ttarget.mask = mask;\n\t\t\t\tvar tween:Tween = new Tween(mask, duration, ease);\n\t\t\t\ttween.animate(\"height\", maskHeight);\n\t\t\t\ttween.onComplete = function():void\n\t\t\t\t{\n\t\t\t\t\ttarget.mask = oldMask;\n\t\t\t\t\tmask.removeFromParent(true);\n\t\t\t\t};\n\t\t\t\treturn new TweenEffectContext(target, tween);\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that wipes the\n\t\t * target component out of view from right to left, animating the\n\t\t * <code>width</code> property of a temporary mask.\n\t\t *\n\t\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t\t */\n\t\tpublic static function createWipeOutLeftEffect(duration:Number = 0.25, ease:Object = Transitions.EASE_OUT):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IEffectContext\n\t\t\t{\n\t\t\t\tvar oldMask:DisplayObject = target.mask;\n\t\t\t\tvar maskWidth:Number = target.width;\n\t\t\t\tvar maskHeight:Number = target.height;\n\t\t\t\tif(maskWidth < 0)\n\t\t\t\t{\n\t\t\t\t\tmaskWidth = 1;\n\t\t\t\t}\n\t\t\t\tif(maskHeight < 0)\n\t\t\t\t{\n\t\t\t\t\tmaskHeight = 1;\n\t\t\t\t}\n\t\t\t\tvar mask:Quad = new Quad(maskWidth, maskHeight, 0xff00ff);\n\t\t\t\ttarget.mask = mask;\n\t\t\t\tvar tween:Tween = new Tween(mask, duration, ease);\n\t\t\t\ttween.animate(\"width\", 0);\n\t\t\t\ttween.onComplete = function():void\n\t\t\t\t{\n\t\t\t\t\ttarget.mask = oldMask;\n\t\t\t\t\tmask.dispose();\n\t\t\t\t};\n\t\t\t\treturn new TweenEffectContext(target, tween);\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that wipes the\n\t\t * target component out of view from left to right, animating the\n\t\t * <code>width</code> and <code>x</code> properties of a temporary mask.\n\t\t *\n\t\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t\t */\n\t\tpublic static function createWipeOutRightEffect(duration:Number = 0.25, ease:Object = Transitions.EASE_OUT):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IEffectContext\n\t\t\t{\n\t\t\t\tvar oldMask:DisplayObject = target.mask;\n\t\t\t\tvar maskWidth:Number = target.width;\n\t\t\t\tvar maskHeight:Number = target.height;\n\t\t\t\tif(maskWidth < 0)\n\t\t\t\t{\n\t\t\t\t\tmaskWidth = 1;\n\t\t\t\t}\n\t\t\t\tif(maskHeight < 0)\n\t\t\t\t{\n\t\t\t\t\tmaskHeight = 1;\n\t\t\t\t}\n\t\t\t\tvar mask:Quad = new Quad(maskWidth, maskHeight, 0xff00ff);\n\t\t\t\ttarget.mask = mask;\n\t\t\t\tvar tween:Tween = new Tween(mask, duration, ease);\n\t\t\t\ttween.animate(\"width\", 0);\n\t\t\t\ttween.animate(\"x\", maskWidth);\n\t\t\t\ttween.onComplete = function():void\n\t\t\t\t{\n\t\t\t\t\ttarget.mask = oldMask;\n\t\t\t\t\tmask.removeFromParent(true);\n\t\t\t\t};\n\t\t\t\treturn new TweenEffectContext(target, tween);\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that wipes the\n\t\t * target component out of view from bottom to top, animating the\n\t\t * <code>height</code> property of a temporary mask.\n\t\t *\n\t\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t\t */\n\t\tpublic static function createWipeOutUpEffect(duration:Number = 0.25, ease:Object = Transitions.EASE_OUT):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IEffectContext\n\t\t\t{\n\t\t\t\tvar oldMask:DisplayObject = target.mask;\n\t\t\t\tvar maskWidth:Number = target.width;\n\t\t\t\tvar maskHeight:Number = target.height;\n\t\t\t\tif(maskWidth < 0)\n\t\t\t\t{\n\t\t\t\t\tmaskWidth = 1;\n\t\t\t\t}\n\t\t\t\tif(maskHeight < 0)\n\t\t\t\t{\n\t\t\t\t\tmaskHeight = 1;\n\t\t\t\t}\n\t\t\t\tvar mask:Quad = new Quad(maskWidth, maskHeight, 0xff00ff);\n\t\t\t\ttarget.mask = mask;\n\t\t\t\tvar tween:Tween = new Tween(mask, duration, ease);\n\t\t\t\ttween.animate(\"height\", 0);\n\t\t\t\ttween.onComplete = function():void\n\t\t\t\t{\n\t\t\t\t\ttarget.mask = oldMask;\n\t\t\t\t\tmask.dispose();\n\t\t\t\t};\n\t\t\t\treturn new TweenEffectContext(target, tween);\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates an effect function for the target component that wipes the\n\t\t * target component out of view from top to bottom, animating the\n\t\t * <code>height</code> and <code>y</code> properties of a temporary mask.\n\t\t *\n\t\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t\t */\n\t\tpublic static function createWipeOutDownEffect(duration:Number = 0.25, ease:Object = Transitions.EASE_OUT):Function\n\t\t{\n\t\t\treturn function(target:DisplayObject):IEffectContext\n\t\t\t{\n\t\t\t\tvar oldMask:DisplayObject = target.mask;\n\t\t\t\tvar maskWidth:Number = target.width;\n\t\t\t\tvar maskHeight:Number = target.height;\n\t\t\t\tif(maskWidth < 0)\n\t\t\t\t{\n\t\t\t\t\tmaskWidth = 1;\n\t\t\t\t}\n\t\t\t\tif(maskHeight < 0)\n\t\t\t\t{\n\t\t\t\t\tmaskHeight = 1;\n\t\t\t\t}\n\t\t\t\tvar mask:Quad = new Quad(maskWidth, maskHeight, 0xff00ff);\n\t\t\t\ttarget.mask = mask;\n\t\t\t\tvar tween:Tween = new Tween(mask, duration, ease);\n\t\t\t\ttween.animate(\"height\", 0);\n\t\t\t\ttween.animate(\"y\", maskHeight);\n\t\t\t\ttween.onComplete = function():void\n\t\t\t\t{\n\t\t\t\t\ttarget.mask = oldMask;\n\t\t\t\t\tmask.removeFromParent(true);\n\t\t\t\t};\n\t\t\t\treturn new TweenEffectContext(target, tween);\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that wipes the\n\t\t * old screen out of view to the left, animating the <code>width</code>\n\t\t * property of a <code>clipRect</code>, to reveal the new screen under\n\t\t * it. The new screen remains stationary.\n\t\t *\n\t\t * @see ../../../help/transitions.html#wipe Transitions for Feathers screen navigators: Wipe\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createWipeLeftTransition(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tvar xOffset:Number = oldScreen ? -oldScreen.width : -newScreen.width;\n\t\t\t\tvar tween:WipeTween = new WipeTween(newScreen, oldScreen, xOffset, 0, duration, ease, onComplete, tweenProperties);\n\t\t\t\tif(managed)\n\t\t\t\t{\n\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t}\n\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that wipes the\n\t\t * old screen out of view to the right, animating the <code>x</code>\n\t\t * and <code>width</code> properties of a <code>clipRect</code>, to\n\t\t * reveal the new screen under it. The new screen remains stationary.\n\t\t *\n\t\t * @see ../../../help/transitions.html#wipe Transitions for Feathers screen navigators: Wipe\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createWipeRightTransition(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tvar xOffset:Number = oldScreen ? oldScreen.width : newScreen.width;\n\t\t\t\tvar tween:WipeTween = new WipeTween(newScreen, oldScreen, xOffset, 0, duration, ease, onComplete, tweenProperties);\n\t\t\t\tif(managed)\n\t\t\t\t{\n\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t}\n\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that wipes the\n\t\t * old screen up, animating the <code>height</code> property of a\n\t\t * <code>clipRect</code>, to reveal the new screen under it. The new\n\t\t * screen remains stationary.\n\t\t *\n\t\t * @see ../../../help/transitions.html#wipe Transitions for Feathers screen navigators: Wipe\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createWipeUpTransition(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tvar yOffset:Number = oldScreen ? -oldScreen.height : -newScreen.height;\n\t\t\t\tvar tween:WipeTween = new WipeTween(newScreen, oldScreen, 0, yOffset, duration, ease, onComplete, tweenProperties);\n\t\t\t\tif(managed)\n\t\t\t\t{\n\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t}\n\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Creates a transition function for a screen navigator that wipes the\n\t\t * old screen down, animating the <code>y</code> and <code>height</code>\n\t\t * properties of a <code>clipRect</code>, to reveal the new screen under\n\t\t * it. The new screen remains stationary.\n\t\t *\n\t\t * @see ../../../help/transitions.html#wipe Transitions for Feathers screen navigators: Wipe\n\t\t * @see feathers.controls.StackScreenNavigator#pushTransition\n\t\t * @see feathers.controls.StackScreenNavigator#popTransition\n\t\t * @see feathers.controls.ScreenNavigator#transition\n\t\t */\n\t\tpublic static function createWipeDownTransition(duration:Number = 0.5, ease:Object = Transitions.EASE_OUT, tweenProperties:Object = null):Function\n\t\t{\n\t\t\treturn function(oldScreen:DisplayObject, newScreen:DisplayObject, onComplete:Function, managed:Boolean = false):IEffectContext\n\t\t\t{\n\t\t\t\tif(!oldScreen && !newScreen)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(SCREEN_REQUIRED_ERROR);\n\t\t\t\t}\n\t\t\t\tvar yOffset:Number = oldScreen ? oldScreen.height : newScreen.height;\n\t\t\t\tvar tween:WipeTween = new WipeTween(newScreen, oldScreen, 0, yOffset, duration, ease, onComplete, tweenProperties);\n\t\t\t\tif(managed)\n\t\t\t\t{\n\t\t\t\t\treturn new TweenEffectContext(null, tween);\n\t\t\t\t}\n\t\t\t\tStarling.juggler.add(tween);\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\t}\n}\n\nimport feathers.display.RenderDelegate;\n\nimport starling.animation.Tween;\nimport starling.core.Starling;\nimport starling.display.DisplayObject;\nimport starling.display.Quad;\n\nclass WipeTween extends Tween\n{\n\tpublic function WipeTween(newScreen:DisplayObject, oldScreen:DisplayObject,\n\t\txOffset:Number, yOffset:Number, duration:Number, ease:Object, onCompleteCallback:Function,\n\t\ttweenProperties:Object)\n\t{\n\t\tvar mask:Quad;\n\t\tif(newScreen)\n\t\t{\n\t\t\tmask = new Quad(1, 1, 0xff00ff);\n\t\t\t//the initial dimensions cannot be 0 or there's a runtime error,\n\t\t\tmask.width = 0;\n\t\t\tmask.height = 0;\n\t\t\tif(xOffset != 0)\n\t\t\t{\n\t\t\t\tif(xOffset < 0)\n\t\t\t\t{\n\t\t\t\t\tmask.x = newScreen.width;\n\t\t\t\t}\n\t\t\t\tmask.height = newScreen.height;\n\t\t\t}\n\t\t\tif(yOffset != 0)\n\t\t\t{\n\t\t\t\tif(yOffset < 0)\n\t\t\t\t{\n\t\t\t\t\tmask.y = newScreen.height;\n\t\t\t\t}\n\t\t\t\tmask.width = newScreen.width;\n\t\t\t}\n\t\t\tthis._newScreenDelegate = new RenderDelegate(newScreen);\n\t\t\tthis._newScreenDelegate.alpha = newScreen.alpha;\n\t\t\tthis._newScreenDelegate.blendMode = newScreen.blendMode;\n\t\t\tthis._newScreenDelegate.rotation = newScreen.rotation;\n\t\t\tthis._newScreenDelegate.scaleX = newScreen.scaleX;\n\t\t\tthis._newScreenDelegate.scaleY = newScreen.scaleY;\n\t\t\tthis._newScreenDelegate.mask = mask;\n\t\t\tthis._newScreenClipRect = mask;\n\t\t\tnewScreen.parent.addChild(this._newScreenDelegate);\n\t\t\tnewScreen.parent.addChild(mask);\n\t\t\tnewScreen.visible = false;\n\t\t\tthis._savedNewScreen = newScreen;\n\t\t}\n\t\tif(oldScreen)\n\t\t{\n\t\t\tmask = new Quad(1, 1, 0xff00ff);\n\t\t\t//the initial dimensions cannot be 0 or there's a runtime error,\n\t\t\t//and these values might be 0\n\t\t\tmask.width = oldScreen.width;\n\t\t\tmask.height = oldScreen.height;\n\t\t\tthis._oldScreenDelegate = new RenderDelegate(oldScreen);\n\t\t\tthis._oldScreenDelegate.alpha = oldScreen.alpha;\n\t\t\tthis._oldScreenDelegate.blendMode = oldScreen.blendMode;\n\t\t\tthis._oldScreenDelegate.rotation = oldScreen.rotation;\n\t\t\tthis._oldScreenDelegate.scaleX = oldScreen.scaleX;\n\t\t\tthis._oldScreenDelegate.scaleY = oldScreen.scaleY;\n\t\t\tthis._oldScreenDelegate.mask = mask;\n\t\t\toldScreen.parent.addChild(this._oldScreenDelegate);\n\t\t\toldScreen.parent.addChild(mask);\n\t\t\toldScreen.visible = false;\n\t\t\tthis._savedOldScreen = oldScreen;\n\t\t}\n\n\t\tsuper(mask, duration, ease);\n\n\t\tif(oldScreen)\n\t\t{\n\t\t\tif(xOffset < 0)\n\t\t\t{\n\t\t\t\tthis.animate(\"width\", oldScreen.width + xOffset);\n\t\t\t}\n\t\t\telse if(xOffset > 0)\n\t\t\t{\n\t\t\t\tthis.animate(\"x\", xOffset);\n\t\t\t\tthis.animate(\"width\", oldScreen.width - xOffset);\n\t\t\t}\n\t\t\tif(yOffset < 0)\n\t\t\t{\n\t\t\t\tthis.animate(\"height\", oldScreen.height + yOffset);\n\t\t\t}\n\t\t\telse if(yOffset > 0)\n\t\t\t{\n\t\t\t\tthis.animate(\"y\", yOffset);\n\t\t\t\tthis.animate(\"height\", oldScreen.height - yOffset);\n\t\t\t}\n\t\t\tif(this._newScreenDelegate)\n\t\t\t{\n\t\t\t\tthis.onUpdate = this.updateNewScreen;\n\t\t\t}\n\t\t}\n\t\telse //new screen only\n\t\t{\n\t\t\tif(xOffset < 0)\n\t\t\t{\n\t\t\t\tthis.animate(\"x\", newScreen.width + xOffset);\n\t\t\t\tthis.animate(\"width\", -xOffset);\n\t\t\t}\n\t\t\telse if(xOffset > 0)\n\t\t\t{\n\t\t\t\tthis.animate(\"width\", xOffset);\n\t\t\t}\n\t\t\tif(yOffset < 0)\n\t\t\t{\n\t\t\t\tthis.animate(\"y\", newScreen.height + yOffset);\n\t\t\t\tthis.animate(\"height\", -yOffset);\n\t\t\t}\n\t\t\telse if(yOffset > 0)\n\t\t\t{\n\t\t\t\tthis.animate(\"height\", yOffset);\n\t\t\t}\n\t\t}\n\t\tif(tweenProperties)\n\t\t{\n\t\t\tfor(var propertyName:String in tweenProperties)\n\t\t\t{\n\t\t\t\tthis[propertyName] = tweenProperties[propertyName];\n\t\t\t}\n\t\t}\n\t\tthis._savedXOffset = xOffset;\n\t\tthis._savedYOffset = yOffset;\n\t\tthis._onCompleteCallback = onCompleteCallback;\n\t\tthis.onComplete = this.cleanupTween;\n\t}\n\n\tprivate var _oldScreenDelegate:RenderDelegate;\n\tprivate var _newScreenDelegate:RenderDelegate;\n\tprivate var _newScreenClipRect:Quad;\n\tprivate var _savedOldScreen:DisplayObject;\n\tprivate var _savedNewScreen:DisplayObject;\n\tprivate var _savedXOffset:Number;\n\tprivate var _savedYOffset:Number;\n\tprivate var _onCompleteCallback:Function;\n\n\tprivate function updateNewScreen():void\n\t{\n\t\tvar oldScreenClipRect:Quad = Quad(this.target);\n\t\tif(this._savedXOffset < 0)\n\t\t{\n\t\t\tthis._newScreenClipRect.x = oldScreenClipRect.width;\n\t\t\tthis._newScreenClipRect.width = this._savedNewScreen.width - this._newScreenClipRect.x;\n\t\t}\n\t\telse if(this._savedXOffset > 0)\n\t\t{\n\t\t\tthis._newScreenClipRect.width = oldScreenClipRect.x;\n\t\t}\n\t\tif(this._savedYOffset < 0)\n\t\t{\n\t\t\tthis._newScreenClipRect.y = oldScreenClipRect.height;\n\t\t\tthis._newScreenClipRect.height = this._savedNewScreen.height - this._newScreenClipRect.y;\n\t\t}\n\t\telse if(this._savedYOffset > 0)\n\t\t{\n\t\t\tthis._newScreenClipRect.height = oldScreenClipRect.y;\n\t\t}\n\t}\n\n\tprivate function cleanupTween():void\n\t{\n\t\tif(this._oldScreenDelegate)\n\t\t{\n\t\t\tQuad(this.target).removeFromParent(true);\n\t\t\tthis._oldScreenDelegate.removeFromParent(true);\n\t\t\tthis._oldScreenDelegate = null;\n\t\t}\n\t\tif(this._newScreenDelegate)\n\t\t{\n\t\t\tthis._newScreenClipRect.removeFromParent(true);\n\t\t\tthis._newScreenClipRect = null;\n\t\t\tthis._newScreenDelegate.removeFromParent(true);\n\t\t\tthis._newScreenDelegate = null;\n\t\t}\n\t\tif(this._savedOldScreen)\n\t\t{\n\t\t\tthis._savedOldScreen.visible = true;\n\t\t\tthis._savedOldScreen = null;\n\t\t}\n\t\tif(this._savedNewScreen)\n\t\t{\n\t\t\tthis._savedNewScreen.visible = true;\n\t\t\tthis._savedNewScreen = null;\n\t\t}\n\t\tif(this._onCompleteCallback !== null)\n\t\t{\n\t\t\tthis._onCompleteCallback();\n\t\t}\n\t}\n\n}\n\n"
  },
  {
    "path": "source/feathers/motion/effectClasses/BaseEffectContext.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.motion.effectClasses\n{\n\timport starling.animation.Juggler;\n\timport starling.animation.Transitions;\n\timport starling.animation.Tween;\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.errors.AbstractClassError;\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\n\t/**\n\t * Dispatched when the effect completes or is interrupted. If the effect was\n\t * stopped instead of advancing to the end, the value of the event's\n\t * <code>data</code> property will be <code>true</code>.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>If the effect was stopped without\n\t *   reaching the end, this value will be <code>true</code>. Otherwise,\n\t *   <code>false</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.COMPLETE\n\t *\n\t * @see #toEnd()\n\t */\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\t/**\n\t * An abstract base class for <code>IEffectContext</code> implementations.\n\t *\n\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t */\n\tpublic class BaseEffectContext extends EventDispatcher implements IEffectContext\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate static const MAX_POSITION:Number = 0.99999;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function BaseEffectContext(target:DisplayObject, duration:Number, transition:Object = null)\n\t\t{\n\t\t\tsuper();\n\t\t\tif(Object(this).constructor === BaseEffectContext)\n\t\t\t{\n\t\t\t\tthrow new AbstractClassError();\n\t\t\t}\n\t\t\tthis._target = target;\n\t\t\tthis._duration = duration;\n\t\t\tif(transition === null)\n\t\t\t{\n\t\t\t\ttransition = Transitions.LINEAR;\n\t\t\t}\n\t\t\tthis._transition = transition;\n\t\t\tthis.prepareEffect();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _target:DisplayObject;\n\n\t\t/**\n\t\t * The target of the effect.\n\t\t */\n\t\tpublic function get target():DisplayObject\n\t\t{\n\t\t\treturn this._target;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _playTween:Tween = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _duration:Number;\n\n\t\t/**\n\t\t * The duration of the effect, in seconds.\n\t\t */\n\t\tpublic function get duration():Number\n\t\t{\n\t\t\treturn this._duration;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _transition:Object = null;\n\n\t\t/**\n\t\t * The transition, or easing function, used for the effect.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/animation/Transitions.html starling.animation.Transitions\n\t\t */\n\t\tpublic function get transition():Object\n\t\t{\n\t\t\treturn this._transition;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _position:Number = 0;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _playing:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _reversed:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _juggler:Juggler = null;\n\n\t\t/**\n\t\t * The <code>Juggler</code> used to update the effect when it is\n\t\t * playing. If <code>null</code>, uses <code>Starling.juggler</code>.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/animation/Juggler.html starling.animation.Juggler\n\t\t */\n\t\tpublic function get juggler():Juggler\n\t\t{\n\t\t\treturn this._juggler;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set juggler(value:Juggler):void\n\t\t{\n\t\t\tif(this._juggler === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar oldJuggler:Juggler = this._juggler;\n\t\t\tif(oldJuggler === null)\n\t\t\t{\n\t\t\t\toldJuggler = Starling.juggler;\n\t\t\t}\n\t\t\tthis._juggler = value;\n\t\t\tif(this._playing && this._juggler !== oldJuggler)\n\t\t\t{\n\t\t\t\toldJuggler.remove(this._playTween);\n\t\t\t\tif(this._juggler !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._juggler.add(this._playTween);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._playing = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Sets the position of the effect using a value between <code>0</code>\n\t\t * and <code>1</code>.\n\t\t *\n\t\t * @see #duration\n\t\t */\n\t\tpublic function get position():Number\n\t\t{\n\t\t\treturn this._position;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set position(value:Number):void\n\t\t{\n\t\t\t// there are some quirks with Starling tweens where we want to avoid\n\t\t\t// going all of the way to the end, unless the tween is currently\n\t\t\t// playing\n\t\t\tif(!this._playing && value > MAX_POSITION)\n\t\t\t{\n\t\t\t\tvalue = MAX_POSITION;\n\t\t\t}\n\t\t\tthis._position = value;\n\t\t\tthis.updateEffect();\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function play():void\n\t\t{\n\t\t\tif(this._playing && !this._reversed)\n\t\t\t{\n\t\t\t\t//already playing in the correct direction\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._playTween !== null)\n\t\t\t{\n\t\t\t\tthis._playTween.dispatchEventWith(Event.REMOVE_FROM_JUGGLER);\n\t\t\t\tthis._playTween = null;\n\t\t\t}\n\t\t\tthis._playing = true;\n\t\t\tthis._reversed = false;\n\n\t\t\tvar duration:Number = this._duration * (1 - this._position);\n\t\t\tthis._playTween = new Tween(this, duration, this._transition);\n\t\t\tthis._playTween.animate(\"position\", 1);\n\t\t\tthis._playTween.onComplete = this.playTween_onComplete;\n\n\t\t\tvar juggler:Juggler = this._juggler;\n\t\t\tif(juggler === null)\n\t\t\t{\n\t\t\t\tjuggler = Starling.juggler;\n\t\t\t}\n\t\t\tjuggler.add(this._playTween);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function playReverse():void\n\t\t{\n\t\t\tif(this._playing && this._reversed)\n\t\t\t{\n\t\t\t\t//already playing in the correct direction\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._playTween !== null)\n\t\t\t{\n\t\t\t\tthis._playTween.dispatchEventWith(Event.REMOVE_FROM_JUGGLER);\n\t\t\t\tthis._playTween = null;\n\t\t\t}\n\t\t\tthis._playing = true;\n\t\t\tthis._reversed = true;\n\n\t\t\tvar duration:Number = this._duration * this._position;\n\t\t\tthis._playTween = new Tween(this, duration, this._transition);\n\t\t\tthis._playTween.animate(\"position\", 0);\n\t\t\tthis._playTween.onComplete = this.playTween_onComplete;\n\n\t\t\tvar juggler:Juggler = this._juggler;\n\t\t\tif(juggler === null)\n\t\t\t{\n\t\t\t\tjuggler = Starling.juggler;\n\t\t\t}\n\t\t\tjuggler.add(this._playTween);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function pause():void\n\t\t{\n\t\t\tif(!this._playing)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._playTween !== null)\n\t\t\t{\n\t\t\t\tthis._playTween.dispatchEventWith(Event.REMOVE_FROM_JUGGLER);\n\t\t\t\tthis._playTween = null;\n\t\t\t}\n\t\t\tthis._playing = false;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function stop():void\n\t\t{\n\t\t\tthis.pause();\n\t\t\tthis.cleanupEffect();\n\t\t\tthis.dispatchEventWith(Event.COMPLETE, false, true);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function toEnd():void\n\t\t{\n\t\t\tif(this._playing)\n\t\t\t{\n\t\t\t\tthis._position = 1;\n\t\t\t\tthis._playTween.advanceTime(this._playTween.totalTime);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.position = 1;\n\t\t\tthis.cleanupEffect();\n\t\t\tthis.dispatchEventWith(Event.COMPLETE, false, false);\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function interrupt():void\n\t\t{\n\t\t\t//by default, go to the end. subclasses may override this method\n\t\t\t//to customize the behavior, if needed.\n\t\t\tthis.toEnd();\n\t\t}\n\n\t\t/**\n\t\t * Called when the effect is initialized. Subclasses may\n\t\t * override this method to customize the effect's behavior.\n\t\t */\n\t\tprotected function prepareEffect():void\n\t\t{\n\n\t\t}\n\n\t\t/**\n\t\t * Called when the effect's position is updated. Subclasses may\n\t\t * override this method to customize the effect's behavior.\n\t\t */\n\t\tprotected function updateEffect():void\n\t\t{\n\n\t\t}\n\n\t\t/**\n\t\t * Called when the effect completes or is interrupted. Subclasses may\n\t\t * override this method to customize the effect's behavior.\n\t\t */\n\t\tprotected function cleanupEffect():void\n\t\t{\n\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function playTween_onComplete():void\n\t\t{\n\t\t\tthis._playTween = null;\n\t\t\tthis._playing = false;\n\t\t\tthis.cleanupEffect();\n\t\t\tthis.dispatchEventWith(Event.COMPLETE, false, false);\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "source/feathers/motion/effectClasses/IEffectContext.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.motion.effectClasses\n{\n\timport feathers.core.IFeathersEventDispatcher;\n\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * Dispatched when the effect completes or is interrupted. If the effect was\n\t * stopped instead of advancing to the end, the value of the event's\n\t * <code>data</code> property will be <code>true</code>.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>If the effect was stopped without\n\t *   reaching the end, this value will be <code>true</code>. Otherwise,\n\t *   <code>false</code>.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.COMPLETE\n\t */\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Gives a component the ability to control an effect.\n\t *\n\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t *\n\t * @productversion Feathers 3.5.0\n\t */\n\tpublic interface IEffectContext extends IFeathersEventDispatcher\n\t{\n\t\t/**\n\t\t * The target of the effect.\n\t\t */\n\t\tfunction get target():DisplayObject;\n\n\t\t/**\n\t\t * The duration of the effect, in seconds.\n\t\t */\n\t\tfunction get duration():Number;\n\n\t\t/**\n\t\t * The position of the effect, from <code>0</code> to <code>1</code>.\n\t\t *\n\t\t * @see #duration\n\t\t */\n\t\tfunction get position():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set position(value:Number):void;\n\n\t\t/**\n\t\t * Starts playing the effect from its current position to the end.\n\t\t *\n\t\t * @see #pause()\n\t\t */\n\t\tfunction play():void;\n\n\t\t/**\n\t\t * Starts playing the effect from its current position back to the\n\t\t * beginning (completing at a position of <code>0</code>).\n\t\t */\n\t\tfunction playReverse():void;\n\n\t\t/**\n\t\t * Pauses an effect that is currently playing.\n\t\t */\n\t\tfunction pause():void;\n\n\t\t/**\n\t\t * Stops the effect at its current position and forces\n\t\t * <code>Event.COMPLETE</code> to dispatch. The <code>data</code>\n\t\t * property of the event will be <code>true</code>.\n\t\t *\n\t\t * @see #toEnd()\n\t\t * @see #event:complete starling.events.Event.COMPLETE\n\t\t */\n\t\tfunction stop():void;\n\n\t\t/**\n\t\t * Advances the effect to the end and forces\n\t\t * <code>Event.COMPLETE</code> to dispatch. The <code>data</code>\n\t\t * property of the event will be <code>false</code>.\n\t\t *\n\t\t * @see #stop()\n\t\t * @see #event:complete starling.events.Event.COMPLETE\n\t\t */\n\t\tfunction toEnd():void;\n\n\t\t/**\n\t\t * Interrupts the playing effect, but the effect context will be allowed\n\t\t * to determine on its own if it should call <code>stop()</code> or\n\t\t * <code>toEnd()</code>.\n\t\t *\n\t\t * @see #toEnd()\n\t\t * @see #stop()\n\t\t */\n\t\tfunction interrupt():void;\n\t}\n}"
  },
  {
    "path": "source/feathers/motion/effectClasses/IMoveEffectContext.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.motion.effectClasses\n{\n\t/**\n\t * Gives a component the ability to control a move effect.\n\t *\n\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t */\n\tpublic interface IMoveEffectContext extends IEffectContext\n\t{\n\t\t/**\n\t\t * The old x position of the target.\n\t\t */\n\t\tfunction get oldX():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set oldX(value:Number):void;\n\n\t\t/**\n\t\t * The old y position of the target.\n\t\t */\n\t\tfunction get oldY():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set oldY(value:Number):void;\n\n\t\t/**\n\t\t * The new x position of the target.\n\t\t */\n\t\tfunction get newX():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set newX(value:Number):void;\n\n\t\t/**\n\t\t * The new y position of the target.\n\t\t */\n\t\tfunction get newY():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set newY(value:Number):void;\n\t}\n}"
  },
  {
    "path": "source/feathers/motion/effectClasses/IResizeEffectContext.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.motion.effectClasses\n{\n\t/**\n\t * Gives a component the ability to control a resize effect.\n\t *\n\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t */\n\tpublic interface IResizeEffectContext extends IEffectContext\n\t{\n\t\t/**\n\t\t * The old width of the target.\n\t\t */\n\t\tfunction get oldWidth():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set oldWidth(value:Number):void;\n\n\t\t/**\n\t\t * The old height of the target.\n\t\t */\n\t\tfunction get oldHeight():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set oldHeight(value:Number):void;\n\n\t\t/**\n\t\t * The new width of the target.\n\t\t */\n\t\tfunction get newWidth():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set newWidth(value:Number):void;\n\n\t\t/**\n\t\t * The new height of the target.\n\t\t */\n\t\tfunction get newHeight():Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tfunction set newHeight(value:Number):void;\n\t}\n}"
  },
  {
    "path": "source/feathers/motion/effectClasses/ParallelEffectContext.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.motion.effectClasses\n{\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * An effect context for running multiple effects in parallel.\n\t *\n\t * @productversion Feathers 3.5.0\n\t *\n\t * @see feathers.motion.Parallel\n\t */\n\tpublic class ParallelEffectContext extends BaseEffectContext implements IEffectContext\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function ParallelEffectContext(target:DisplayObject, functions:Array)\n\t\t{\n\t\t\tvar duration:Number = 0;\n\t\t\tvar count:int = functions.length;\n\t\t\tfor(var i:int = 0; i < count; i++)\n\t\t\t{\n\t\t\t\tvar func:Function = functions[i] as Function;\n\t\t\t\tvar context:IEffectContext = IEffectContext(func(target));\n\t\t\t\tthis._contexts[i] = context;\n\t\t\t\tvar contextDuration:Number = context.duration;\n\t\t\t\tif(contextDuration > duration)\n\t\t\t\t{\n\t\t\t\t\tduration = contextDuration;\n\t\t\t\t}\n\t\t\t}\n\t\t\tsuper(target, duration);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _contexts:Vector.<IEffectContext> = new <IEffectContext>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function updateEffect():void\n\t\t{\n\t\t\tvar ratio:Number = this._position * this._duration;\n\t\t\tvar contextCount:int = this._contexts.length;\n\t\t\tfor(var i:int = 0; i < contextCount; i++)\n\t\t\t{\n\t\t\t\tvar context:IEffectContext = this._contexts[i] as IEffectContext;\n\t\t\t\tcontext.position = ratio / context.duration;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/motion/effectClasses/SequenceEffectContext.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.motion.effectClasses\n{\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * An effect context for running multiple effects one after another, in\n\t * sequence.\n\t *\n\t * @productversion Feathers 3.5.0\n\t *\n\t * @see feathers.motion.Sequence\n\t */\n\tpublic class SequenceEffectContext extends BaseEffectContext implements IEffectContext\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function SequenceEffectContext(target:DisplayObject, functions:Array)\n\t\t{\n\t\t\tvar duration:Number = 0;\n\t\t\tvar count:int = functions.length;\n\t\t\tfor(var i:int = 0; i < count; i++)\n\t\t\t{\n\t\t\t\tvar func:Function = functions[i] as Function;\n\t\t\t\tvar context:IEffectContext = IEffectContext(func(target));\n\t\t\t\tthis._contexts[i] = context;\n\t\t\t\tduration += context.duration;\n\t\t\t}\n\t\t\tsuper(target, duration);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _contexts:Vector.<IEffectContext> = new <IEffectContext>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function updateEffect():void\n\t\t{\n\t\t\tvar totalTime:Number = 0;\n\t\t\tvar currentTime:Number = this._position * this._duration;\n\t\t\tvar contextCount:int = this._contexts.length;\n\t\t\tfor(var i:int = 0; i < contextCount; i++)\n\t\t\t{\n\t\t\t\tvar context:IEffectContext = this._contexts[i] as IEffectContext;\n\t\t\t\tvar contextDuration:Number = context.duration;\n\t\t\t\tif(totalTime > currentTime)\n\t\t\t\t{\n\t\t\t\t\tcontext.position = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcontext.position = (currentTime - totalTime) / contextDuration;\n\t\t\t\t}\n\t\t\t\ttotalTime += contextDuration;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/motion/effectClasses/TweenEffectContext.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.motion.effectClasses\n{\n\timport feathers.core.IFeathersControl;\n\timport feathers.motion.EffectInterruptBehavior;\n\n\timport starling.animation.Transitions;\n\timport starling.animation.Tween;\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * An effect context for a <code>starling.animation.Tween</code>.\n\t *\n\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t * @see http://doc.starling-framework.org/core/starling/animation/Tween.html starling.animation.Tween\n\t *\n\t * @productversion Feathers 3.5.0\n\t */\n\tpublic class TweenEffectContext extends BaseEffectContext implements IEffectContext\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function TweenEffectContext(target:DisplayObject, tween:Tween, interruptBehavior:String = EffectInterruptBehavior.END)\n\t\t{\n\t\t\tthis._tween = tween;\n\t\t\tthis._interruptBehavior = interruptBehavior;\n\t\t\tvar linearTransitionFunc:Function = Transitions.getTransition(Transitions.LINEAR);\n\t\t\tvar transitionFunc:Function = this._tween.transitionFunc;\n\t\t\t//we want setting the position property to be linear, but when\n\t\t\t//play() or playReverse() is called, we'll use the saved transition\n\t\t\tthis._tween.transitionFunc = linearTransitionFunc;\n\n\t\t\t//we'll take over for onStart and onComplete because we don't them\n\t\t\t//being called by the Tween, since we're taking over control\n\t\t\tthis._onStart = this._tween.onStart;\n\t\t\tthis._onComplete = this._tween.onComplete;\n\t\t\tthis._tween.onStart = null;\n\t\t\tthis._tween.onComplete = null;\n\n\t\t\tif(target === null)\n\t\t\t{\n\t\t\t\ttarget = tween.target as DisplayObject;\n\t\t\t}\n\n\t\t\t//the delay does not affect the totalTime, so we need to add them\n\t\t\t//to calculate the full duration of the effect\n\t\t\tsuper(target, this._tween.totalTime + this._tween.delay, transitionFunc);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _tween:Tween = null;\n\n\t\t/**\n\t\t * The tween that is controlled by the effect.\n\t\t */\n\t\tpublic function get tween():Tween\n\t\t{\n\t\t\treturn this._tween;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _interruptBehavior:String = null;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"end,stop\")]\n\t\t/**\n\t\t * Indicates how the effect behaves when it is interrupted. Interrupted\n\t\t * effects can either advance directly to the end or stop at the current\n\t\t * position.\n\t\t *\n\t\t * @default feathers.motion.EffectInterruptBehavior.END\n\t\t *\n\t\t * @see feathers.motion.EffectInterruptBehavior#END\n\t\t * @see feathers.motion.EffectInterruptBehavior#STOP\n\t\t * @see #interrupt()\n\t\t */\n\t\tpublic function get interruptBehavior():String\n\t\t{\n\t\t\treturn this._interruptBehavior;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set interruptBehavior(value:String):void\n\t\t{\n\t\t\tthis._interruptBehavior = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _onStart:Function = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _onComplete:Function = null;\n\n\t\t/**\n\t\t * @private\n\t\t *\n\t\t * @see #interruptBehavior\n\t\t */\n\t\toverride public function interrupt():void\n\t\t{\n\t\t\tif(this._interruptBehavior === EffectInterruptBehavior.STOP)\n\t\t\t{\n\t\t\t\tthis.stop();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.toEnd();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function prepareEffect():void\n\t\t{\n\t\t\tif(this._onStart !== null)\n\t\t\t{\n\t\t\t\tthis._onStart.apply(null, this._tween.onStartArgs);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function updateEffect():void\n\t\t{\n\t\t\tif(this._target is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this._target).suspendEffects();\n\t\t\t}\n\t\t\tvar duration:Number = this._tween.totalTime + this._tween.delay;\n\t\t\tvar newCurrentTime:Number = (this._position * duration) - this._tween.delay;\n\t\t\tthis._tween.advanceTime(newCurrentTime - this._tween.currentTime);\n\t\t\tif(this._target is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this._target).resumeEffects();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function cleanupEffect():void\n\t\t{\n\t\t\tif(this._onComplete !== null)\n\t\t\t{\n\t\t\t\tthis._onComplete.apply(null, this._tween.onCompleteArgs);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/motion/effectClasses/TweenMoveEffectContext.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.motion.effectClasses\n{\n\timport feathers.core.IFeathersControl;\n\n\timport starling.animation.Tween;\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * A move effect context for a <code>starling.animation.Tween</code>.\n\t *\n\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t * @see http://doc.starling-framework.org/core/starling/animation/Tween.html starling.animation.Tween\n\t * @see feathers.core.FeathersControl#moveEffect\n\t *\n\t * @productversion Feathers 3.5.0\n\t */\n\tpublic class TweenMoveEffectContext extends TweenEffectContext implements IMoveEffectContext\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function TweenMoveEffectContext(target:DisplayObject, tween:Tween)\n\t\t{\n\t\t\tsuper(target, tween);\n\t\t\tthis._oldX = this._target.x;\n\t\t\tthis._oldY = this._target.y;\n\t\t\tthis._newX = this._target.x;\n\t\t\tthis._tween.animate(\"x\", this._newX);\n\t\t\tthis._newY = this._target.y;\n\t\t\tthis._tween.animate(\"y\", this._newY);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _oldX:Number;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get oldX():Number\n\t\t{\n\t\t\treturn this._oldX;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set oldX(value:Number):void\n\t\t{\n\t\t\tthis._oldX = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _oldY:Number;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get oldY():Number\n\t\t{\n\t\t\treturn this._oldY;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set oldY(value:Number):void\n\t\t{\n\t\t\tthis._oldY = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _newX:Number;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get newX():Number\n\t\t{\n\t\t\treturn this._newX;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set newX(value:Number):void\n\t\t{\n\t\t\tif(this._newX == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._newX = value;\n\t\t\tthis._tween.animate(\"x\", value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _newY:Number;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get newY():Number\n\t\t{\n\t\t\treturn this._newY;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set newY(value:Number):void\n\t\t{\n\t\t\tif(this._newY == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._newY = value;\n\t\t\tthis._tween.animate(\"y\", value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function play():void\n\t\t{\n\t\t\tif(this._target is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this._target).suspendEffects();\n\t\t\t}\n\t\t\tthis._target.x = this._oldX;\n\t\t\tthis._target.y = this._oldY;\n\t\t\tif(this._target is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this._target).resumeEffects();\n\t\t\t}\n\t\t\tsuper.play();\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/motion/effectClasses/TweenResizeEffectContext.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.motion.effectClasses\n{\n\timport feathers.core.IFeathersControl;\n\n\timport starling.animation.Tween;\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * A resize effect context for a <code>starling.animation.Tween</code>.\n\t *\n\t * @see ../../../help/effects.html Effects and animation for Feathers components\n\t * @see http://doc.starling-framework.org/core/starling/animation/Tween.html starling.animation.Tween\n\t * @see feathers.core.FeathersControl#resizeEffect\n\t *\n\t * @productversion Feathers 3.5.0\n\t */\n\tpublic class TweenResizeEffectContext extends TweenEffectContext implements IResizeEffectContext\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function TweenResizeEffectContext(target:DisplayObject, tween:Tween)\n\t\t{\n\t\t\tsuper(target, tween);\n\t\t\tthis._oldWidth = this._target.width;\n\t\t\tthis._oldHeight = this._target.height;\n\t\t\tthis._newWidth = this._target.width;\n\t\t\tthis._newHeight = this._target.height;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _oldWidth:Number;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get oldWidth():Number\n\t\t{\n\t\t\treturn this._oldWidth;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set oldWidth(value:Number):void\n\t\t{\n\t\t\tthis._oldWidth = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _oldHeight:Number;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get oldHeight():Number\n\t\t{\n\t\t\treturn this._oldHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set oldHeight(value:Number):void\n\t\t{\n\t\t\tthis._oldHeight = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _newWidth:Number;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get newWidth():Number\n\t\t{\n\t\t\treturn this._newWidth;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set newWidth(value:Number):void\n\t\t{\n\t\t\tif(this._newWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._newWidth = value;\n\t\t\tthis._tween.animate(\"width\", value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _newHeight:Number;\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function get newHeight():Number\n\t\t{\n\t\t\treturn this._newHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set newHeight(value:Number):void\n\t\t{\n\t\t\tif(this._newHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._newHeight = value;\n\t\t\tthis._tween.animate(\"height\", value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function play():void\n\t\t{\n\t\t\tif(this._target is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this._target).suspendEffects();\n\t\t\t}\n\t\t\tthis._target.width = this._oldWidth;\n\t\t\tthis._target.height = this._oldHeight;\n\t\t\tif(this._target is IFeathersControl)\n\t\t\t{\n\t\t\t\tIFeathersControl(this._target).resumeEffects();\n\t\t\t}\n\t\t\tsuper.play();\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/skins/AddOnFunctionStyleProvider.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.skins\n{\n\timport feathers.core.IFeathersControl;\n\n\t/**\n\t * Wraps an existing style provider to call an additional function before or\n\t * after the existing style provider applies its styles.\n\t *\n\t * <p>Starting with Feathers 3.1, \"style\" properties that are set outside a\n\t * style provider won't be replaced by the style provider, so\n\t * <code>AddOnFunctionStyleProvider</code> may only be useful in rare\n\t * cases.</p>\n\t *\n\t * <p>Expected usage is to replace a component's existing style provider:</p>\n\t * <listing version=\"3.0\">\n\t * var button:Button = new Button();\n\t * button.label = \"Click Me\";\n\t * function setExtraStyles( target:Button ):void\n\t * {\n\t *     target.defaultIcon = new Image( texture );\n\t *     // set other styles, if desired...\n\t * }\n\t * button.styleProvider = new AddOnFunctionStyleProvider( button.styleProvider, setExtraStyles );\n\t * this.addChild( button );</listing>\n\t *\n\t * @productversion Feathers 2.0.0\n\t */\n\tpublic class AddOnFunctionStyleProvider implements IStyleProvider\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function AddOnFunctionStyleProvider(originalStyleProvider:IStyleProvider = null, addOnFunction:Function = null)\n\t\t{\n\t\t\tthis._originalStyleProvider = originalStyleProvider;\n\t\t\tthis._addOnFunction = addOnFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _originalStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * The <code>addOnFunction</code> will be called after the original\n\t\t * style provider applies its styles.\n\t\t */\n\t\tpublic function get originalStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn this._originalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set originalStyleProvider(value:IStyleProvider):void\n\t\t{\n\t\t\tthis._originalStyleProvider = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _addOnFunction:Function;\n\n\t\t/**\n\t\t * A function to call after applying the original style provider's\n\t\t * styles.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function( item:IFeathersControl ):void</pre>\n\t\t */\n\t\tpublic function get addOnFunction():Function\n\t\t{\n\t\t\treturn this._addOnFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set addOnFunction(value:Function):void\n\t\t{\n\t\t\tthis._addOnFunction = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _callBeforeOriginalStyleProvider:Boolean = false;\n\n\t\t/**\n\t\t * Determines if the add on function should be called before the\n\t\t * original style provider is applied, or after.\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic function get callBeforeOriginalStyleProvider():Boolean\n\t\t{\n\t\t\treturn this._callBeforeOriginalStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set callBeforeOriginalStyleProvider(value:Boolean):void\n\t\t{\n\t\t\tthis._callBeforeOriginalStyleProvider = value;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function applyStyles(target:IFeathersControl):void\n\t\t{\n\t\t\tif(this._callBeforeOriginalStyleProvider && this._addOnFunction !== null)\n\t\t\t{\n\t\t\t\tthis._addOnFunction(target);\n\t\t\t}\n\t\t\tif(this._originalStyleProvider)\n\t\t\t{\n\t\t\t\tthis._originalStyleProvider.applyStyles(target);\n\t\t\t}\n\t\t\tif(!this._callBeforeOriginalStyleProvider && this._addOnFunction !== null)\n\t\t\t{\n\t\t\t\tthis._addOnFunction(target);\n\t\t\t}\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "source/feathers/skins/ConditionalStyleProvider.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.skins\n{\n\timport feathers.core.IFeathersControl;\n\n\t/**\n\t * A style provider that chooses between two different style providers.\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class ConditionalStyleProvider implements IStyleProvider\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function ConditionalStyleProvider(conditionalFunction:Function,\n\t\t\ttrueStyleProvider:IStyleProvider = null, falseStyleProvider:IStyleProvider = null)\n\t\t{\n\t\t\tthis._conditionalFunction = conditionalFunction;\n\t\t\tthis._trueStyleProvider = trueStyleProvider;\n\t\t\tthis._falseStyleProvider = falseStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _trueStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * A call to <code>applyStyles()</code> is passed to this style provider\n\t\t * when the <code>conditionalFunction</code> returns <code>true</code>.\n\t\t */\n\t\tpublic function get trueStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn this._trueStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set trueStyleProvider(value:IStyleProvider):void\n\t\t{\n\t\t\tthis._trueStyleProvider = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _falseStyleProvider:IStyleProvider;\n\n\t\t/**\n\t\t * A call to <code>applyStyles()</code> is passed to this style provider\n\t\t * when the <code>conditionalFunction</code> returns <code>false</code>.\n\t\t */\n\t\tpublic function get falseStyleProvider():IStyleProvider\n\t\t{\n\t\t\treturn this._falseStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set falseStyleProvider(value:IStyleProvider):void\n\t\t{\n\t\t\tthis._falseStyleProvider = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _conditionalFunction:Function;\n\n\t\t/**\n\t\t * When <code>applyStyles()</code> is called, the target is passed to\n\t\t * this function to determine which style provider should be called.\n\t\t *\n\t\t * <pre>function(target:IFeathersControl):Boolean</pre>\n\t\t */\n\t\tpublic function get conditionalFunction():Function\n\t\t{\n\t\t\treturn this._conditionalFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set conditionalFunction(value:Function):void\n\t\t{\n\t\t\tthis._conditionalFunction = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function applyStyles(target:IFeathersControl):void\n\t\t{\n\t\t\tvar result:Boolean = false;\n\t\t\tif(this._conditionalFunction !== null)\n\t\t\t{\n\t\t\t\tresult = this._conditionalFunction(target) as Boolean;\n\t\t\t}\n\t\t\tif(result === true)\n\t\t\t{\n\t\t\t\tif(this._trueStyleProvider !== null)\n\t\t\t\t{\n\t\t\t\t\tthis._trueStyleProvider.applyStyles(target);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(this._falseStyleProvider !== null)\n\t\t\t{\n\t\t\t\tthis._falseStyleProvider.applyStyles(target);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/skins/FunctionStyleProvider.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.skins\n{\n\timport feathers.core.IFeathersControl;\n\n\t/**\n\t * Sets styles on a Feathers UI component by passing the component to a\n\t * function when the style provider's <code>applyStyles()</code> is called.\n\t *\n\t * <p>In the following example, a <code>FunctionStyleProvider</code> is\n\t * created:</p>\n\t * <listing version=\"3.0\">\n\t * var button:Button = new Button();\n\t * button.label = \"Click Me\";\n\t * button.styleProvider = new FunctionStyleProvider( function( target:Button ):void\n\t * {\n\t *     target.defaultSkin = new Image( texture );\n\t *     // set other styles...\n\t * });\n\t * this.addChild( button );</listing>\n\t *\n\t * @see ../../../help/skinning.html Skinning Feathers components\n\t *\n\t * @productversion Feathers 2.0.0\n\t */\n\tpublic class FunctionStyleProvider implements IStyleProvider\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function FunctionStyleProvider(skinFunction:Function)\n\t\t{\n\t\t\tthis._styleFunction = skinFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _styleFunction:Function;\n\n\t\t/**\n\t\t * The target Feathers UI component is passed to this function when\n\t\t * <code>applyStyles()</code> is called.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function( item:IFeathersControl ):void</pre>\n\t\t */\n\t\tpublic function get styleFunction():Function\n\t\t{\n\t\t\treturn this._styleFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set styleFunction(value:Function):void\n\t\t{\n\t\t\tthis._styleFunction = value;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function applyStyles(target:IFeathersControl):void\n\t\t{\n\t\t\tif(this._styleFunction == null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._styleFunction(target);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/skins/IStyleProvider.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.skins\n{\n\timport feathers.core.IFeathersControl;\n\n\t/**\n\t * Sets skin and style properties on a Feathers UI component.\n\t *\n\t * @productversion Feathers 2.0.0\n\t */\n\tpublic interface IStyleProvider\n\t{\n\t\t/**\n\t\t * Applies styles to a specific Feathers UI component, unless that\n\t\t * component has been excluded.\n\t\t *\n\t\t * @see #exclude()\n\t\t */\n\t\tfunction applyStyles(target:IFeathersControl):void;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/skins/ImageSkin.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.skins\n{\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IMeasureDisplayObject;\n\timport feathers.core.IStateContext;\n\timport feathers.core.IStateObserver;\n\timport feathers.core.IToggle;\n\timport feathers.events.FeathersEventType;\n\n\timport flash.errors.IllegalOperationError;\n\timport flash.geom.Point;\n\timport flash.geom.Rectangle;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Image;\n\timport starling.events.Event;\n\timport starling.textures.Texture;\n\timport starling.utils.Pool;\n\n\t[Exclude(name=\"color\",kind=\"property\")]\n\n\t/**\n\t * A skin for Feathers components that displays a texture. Has the ability\n\t * to change its texture based on the current state of the Feathers\n\t * component that is being skinned.\n\t *\n\t * <listing version=\"3.0\">\n\t * var skin:ImageSkin = new ImageSkin( upTexture );\n\t * skin.setTextureForState( ButtonState.DOWN, downTexture );\n\t * skin.setTextureForState( ButtonState.HOVER, hoverTexture );\n\t * \n\t * var button:Button = new Button();\n\t * button.label = \"Click Me\";\n\t * button.defaultSkin = skin;\n\t * this.addChild( button );</listing>\n\t *\n\t * @see starling.display.Image\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class ImageSkin extends Image implements IMeasureDisplayObject, IStateObserver\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function ImageSkin(defaultTexture:Texture = null)\n\t\t{\n\t\t\tsuper(defaultTexture);\n\t\t\t//the super constructor sets the color property, so we need to wait\n\t\t\t//before restricting it\n\t\t\tthis._restrictColor = true;\n\t\t\tthis.defaultTexture = defaultTexture;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _restrictColor:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _defaultTexture:Texture;\n\n\t\t/**\n\t\t * The default texture that the skin will display. If the component\n\t\t * being skinned supports states, the texture for a specific state may\n\t\t * be specified using the <code>setTextureForState()</code> method. If\n\t\t * no texture has been specified for the current state, the default\n\t\t * texture will be used.\n\t\t *\n\t\t * <p>In the following example, the default texture is specified in the\n\t\t * constructor:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var skin:ImageSkin = new ImageSkin( texture );</listing>\n\t\t *\n\t\t * <p>In the following example, the default texture is specified by\n\t\t * setting the property:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var skin:ImageSkin = new ImageSkin();\n\t\t * skin.defaultTexture = texture;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #disabledTexture\n\t\t * @see #selectedTexture\n\t\t * @see #setTextureForState()\n\t\t * @see http://doc.starling-framework.org/current/starling/textures/Texture.html starling.textures.Texture\n\t\t */\n\t\tpublic function get defaultTexture():Texture\n\t\t{\n\t\t\treturn this._defaultTexture;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set defaultTexture(value:Texture):void\n\t\t{\n\t\t\tif(this._defaultTexture === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._defaultTexture = value;\n\t\t\tthis.updateTextureFromContext();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _disabledTexture:Texture;\n\n\t\t/**\n\t\t * The texture to display when the <code>stateContext</code> is\n\t\t * an <code>IFeathersControl</code> and its <code>isEnabled</code>\n\t\t * property is <code>false</code>. If a texture has been specified for\n\t\t * the context's current state with <code>setTextureForState()</code>,\n\t\t * it will take precedence over the <code>disabledTexture</code>.\n\t\t *\n\t\t * <p>In the following example, the disabled texture is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var skin:ImageSkin = new ImageSkin( upTexture );\n\t\t * skin.disabledTexture = disabledTexture;\n\t\t * \n\t\t * var button:Button = new Button();\n\t\t * button.defaultSkin = skin;\n\t\t * button.isEnabled = false;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #defaultTexture\n\t\t * @see #selectedTexture\n\t\t * @see #setTextureForState()\n\t\t * @see http://doc.starling-framework.org/current/starling/textures/Texture.html starling.textures.Texture\n\t\t */\n\t\tpublic function get disabledTexture():Texture\n\t\t{\n\t\t\treturn this._disabledTexture;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disabledTexture(value:Texture):void\n\t\t{\n\t\t\tif(this._disabledTexture === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._disabledTexture = value;\n\t\t\tthis.updateTextureFromContext();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectedTexture:Texture;\n\n\t\t/**\n\t\t * The texture to display when the <code>stateContext</code> is\n\t\t * an <code>IToggle</code> instance and its <code>isSelected</code>\n\t\t * property is <code>true</code>. If a texture has been specified for\n\t\t * the context's current state with <code>setTextureForState()</code>,\n\t\t * it will take precedence over the <code>selectedTexture</code>.\n\t\t *\n\t\t * <p>In the following example, the selected texture is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var skin:ImageSkin = new ImageSkin( upTexture );\n\t\t * skin.selectedTexture = selectedTexture;\n\t\t * \n\t\t * var toggleButton:ToggleButton = new ToggleButton();\n\t\t * toggleButton.defaultSkin = skin;\n\t\t * toggleButton.isSelected = true;</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #defaultTexture\n\t\t * @see #disabledTexture\n\t\t * @see #setTextureForState()\n\t\t * @see http://doc.starling-framework.org/current/starling/textures/Texture.html starling.textures.Texture\n\t\t */\n\t\tpublic function get selectedTexture():Texture\n\t\t{\n\t\t\treturn this._selectedTexture;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedTexture(value:Texture):void\n\t\t{\n\t\t\tif(this._selectedTexture === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._selectedTexture = value;\n\t\t\tthis.updateTextureFromContext();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set color(value:uint):void\n\t\t{\n\t\t\tif(this._restrictColor)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"To set the color of an ImageSkin, use defaultColor or setColorForState().\");\n\t\t\t}\n\t\t\tthis.$color = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * Subclasses may use this setter to change the color.\n\t\t */\n\t\tprotected function set $color(value:uint):void\n\t\t{\n\t\t\tsuper.color = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _defaultColor:uint = 0xffffff;\n\n\t\t/**\n\t\t * The default color to use to tint the skin. If the component\n\t\t * being skinned supports states, the color for a specific state may\n\t\t * be specified using the <code>setColorForState()</code> method. If\n\t\t * no color has been specified for the current state, the default\n\t\t * color will be used.\n\t\t *\n\t\t * <p>To set the color of an <code>ImageSkin</code>, the\n\t\t * <code>defaultColor</code> property should be preferred over the\n\t\t * <code>color</code> property defined on\n\t\t * <code>starling.display.Mesh</code>. The <code>ImageSkin</code>\n\t\t * will manage the <code>color</code> property internally.</p>\n\t\t *\n\t\t * <p>A value of <code>uint.MAX_VALUE</code> means that the\n\t\t * <code>color</code> property will not be changed when the context's\n\t\t * state changes.</p>\n\t\t *\n\t\t * <p>In the following example, the default color is specified:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var skin:ImageSkin = new ImageSkin();\n\t\t * skin.defaultColor = 0x9f0000;</listing>\n\t\t *\n\t\t * @default 0xffffff\n\t\t *\n\t\t * @see #disabledColor\n\t\t * @see #selectedColor\n\t\t * @see #setColorForState()\n\t\t */\n\t\tpublic function get defaultColor():uint\n\t\t{\n\t\t\treturn this._defaultColor;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set defaultColor(value:uint):void\n\t\t{\n\t\t\tif(this._defaultColor == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._defaultColor = value;\n\t\t\tthis.updateColorFromContext();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _disabledColor:uint = uint.MAX_VALUE;\n\n\t\t/**\n\t\t * The color to tint the skin when the <code>stateContext</code> is\n\t\t * an <code>IFeathersControl</code> and its <code>isEnabled</code>\n\t\t * property is <code>false</code>. If a color has been specified for\n\t\t * the context's current state with <code>setColorForState()</code>,\n\t\t * it will take precedence over the <code>disabledColor</code>.\n\t\t *\n\t\t * <p>A value of <code>uint.MAX_VALUE</code> means that the\n\t\t * <code>disabledColor</code> property cannot affect the tint when the\n\t\t * context's state changes.</p>\n\t\t *\n\t\t * <p>In the following example, the disabled color is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var skin:ImageSkin = new ImageSkin();\n\t\t * skin.defaultColor = 0xffffff;\n\t\t * skin.disabledColor = 0x999999;\n\t\t * \n\t\t * var button:Button = new Button();\n\t\t * button.defaultSkin = skin;\n\t\t * button.isEnabled = false;</listing>\n\t\t *\n\t\t * @default uint.MAX_VALUE\n\t\t *\n\t\t * @see #defaultColor\n\t\t * @see #selectedColor\n\t\t * @see #setColorForState()\n\t\t */\n\t\tpublic function get disabledColor():uint\n\t\t{\n\t\t\treturn this._disabledColor;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disabledColor(value:uint):void\n\t\t{\n\t\t\tif(this._disabledColor == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._disabledColor = value;\n\t\t\tthis.updateColorFromContext();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectedColor:uint = uint.MAX_VALUE;\n\n\t\t/**\n\t\t * The color to tint the skin when the <code>stateContext</code> is\n\t\t * an <code>IToggle</code> instance and its <code>isSelected</code>\n\t\t * property is <code>true</code>. If a color has been specified for\n\t\t * the context's current state with <code>setColorForState()</code>,\n\t\t * it will take precedence over the <code>selectedColor</code>.\n\t\t *\n\t\t * <p>In the following example, the selected color is changed:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * var skin:ImageSkin = new ImageSkin();\n\t\t * skin.defaultColor = 0xffffff;\n\t\t * skin.selectedColor = 0xffcc00;\n\t\t * \n\t\t * var toggleButton:ToggleButton = new ToggleButton();\n\t\t * toggleButton.defaultSkin = skin;\n\t\t * toggleButton.isSelected = true;</listing>\n\t\t *\n\t\t * @default uint.MAX_VALUE\n\t\t *\n\t\t * @see #defaultColor\n\t\t * @see #disabledColor\n\t\t * @see #setColorForState()\n\t\t */\n\t\tpublic function get selectedColor():uint\n\t\t{\n\t\t\treturn this._selectedColor;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedColor(value:uint):void\n\t\t{\n\t\t\tif(this._selectedColor == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._selectedColor = value;\n\t\t\tthis.updateColorFromContext();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _stateContext:IStateContext;\n\n\t\t/**\n\t\t * When the skin observes a state context, the skin may change its\n\t\t * <code>Texture</code> based on the current state of that context.\n\t\t * Typically, a relevant component will automatically assign itself as\n\t\t * the state context of its skin, so this property is considered to be\n\t\t * for internal use only.\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see #setTextureForState()\n\t\t */\n\t\tpublic function get stateContext():IStateContext\n\t\t{\n\t\t\treturn this._stateContext;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set stateContext(value:IStateContext):void\n\t\t{\n\t\t\tif(this._stateContext === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._stateContext)\n\t\t\t{\n\t\t\t\tthis._stateContext.removeEventListener(FeathersEventType.STATE_CHANGE, stateContext_stageChangeHandler);\n\t\t\t}\n\t\t\tthis._stateContext = value;\n\t\t\tif(this._stateContext)\n\t\t\t{\n\t\t\t\tthis._stateContext.addEventListener(FeathersEventType.STATE_CHANGE, stateContext_stageChangeHandler);\n\t\t\t}\n\t\t\tthis.updateTextureFromContext();\n\t\t\tthis.updateColorFromContext();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitWidth:Number = NaN;\n\n\t\t/**\n\t\t * The value passed to the <code>width</code> property setter. If the\n\t\t * <code>width</code> property has not be set, returns <code>NaN</code>.\n\t\t *\n\t\t * @see #width\n\t\t */\n\t\tpublic function get explicitWidth():Number\n\t\t{\n\t\t\treturn this._explicitWidth;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set width(value:Number):void\n\t\t{\n\t\t\tif(this._explicitWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value && this._explicitWidth !== this._explicitWidth) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._explicitWidth = value;\n\t\t\tif(value === value) //!isNaN\n\t\t\t{\n\t\t\t\tsuper.width = value;\n\t\t\t}\n\t\t\telse if(this.texture !== null)\n\t\t\t{\n\t\t\t\t//return to the original width of the texture\n\t\t\t\tthis.scaleX = 1;\n\t\t\t\tthis.readjustSize(this.texture.frameWidth);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.readjustSize();\n\t\t\t}\n\t\t\tthis.dispatchEventWith(Event.RESIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitHeight:Number = NaN;\n\n\t\t/**\n\t\t * The value passed to the <code>height</code> property setter. If the\n\t\t * <code>height</code> property has not be set, returns\n\t\t * <code>NaN</code>.\n\t\t *\n\t\t * @see #height\n\t\t */\n\t\tpublic function get explicitHeight():Number\n\t\t{\n\t\t\treturn this._explicitHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set height(value:Number):void\n\t\t{\n\t\t\tif(this._explicitHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value && this._explicitHeight !== this._explicitHeight) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._explicitHeight = value;\n\t\t\tif(value === value) //!isNaN\n\t\t\t{\n\t\t\t\tsuper.height = value;\n\t\t\t}\n\t\t\telse if(this.texture !== null)\n\t\t\t{\n\t\t\t\t//return to the original height of the texture\n\t\t\t\tthis.scaleY = 1;\n\t\t\t\tthis.readjustSize(-1, this.texture.frameHeight);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.readjustSize();\n\t\t\t}\n\t\t\tthis.dispatchEventWith(Event.RESIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitMinWidth:Number = NaN;\n\n\t\t/**\n\t\t * The value passed to the <code>minWidth</code> property setter. If the\n\t\t * <code>minWidth</code> property has not be set, returns\n\t\t * <code>NaN</code>.\n\t\t *\n\t\t * @see #minWidth\n\t\t */\n\t\tpublic function get explicitMinWidth():Number\n\t\t{\n\t\t\treturn this._explicitMinWidth;\n\t\t}\n\n\t\t/**\n\t\t * The minimum width of the component.\n\t\t */\n\t\tpublic function get minWidth():Number\n\t\t{\n\t\t\tif(this._explicitMinWidth === this._explicitMinWidth) //!isNaN\n\t\t\t{\n\t\t\t\treturn this._explicitMinWidth;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minWidth(value:Number):void\n\t\t{\n\t\t\tif(this._explicitMinWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value && this._explicitMinWidth !== this._explicitMinWidth) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._explicitMinWidth = value;\n\t\t\tthis.dispatchEventWith(Event.RESIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitMaxWidth:Number = Number.POSITIVE_INFINITY;\n\n\t\t/**\n\t\t * The value passed to the <code>maxWidth</code> property setter. If the\n\t\t * <code>maxWidth</code> property has not be set, returns\n\t\t * <code>NaN</code>.\n\t\t *\n\t\t * @see #maxWidth\n\t\t */\n\t\tpublic function get explicitMaxWidth():Number\n\t\t{\n\t\t\treturn this._explicitMaxWidth;\n\t\t}\n\n\t\t/**\n\t\t * The maximum width of the component.\n\t\t */\n\t\tpublic function get maxWidth():Number\n\t\t{\n\t\t\treturn this._explicitMaxWidth;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maxWidth(value:Number):void\n\t\t{\n\t\t\tif(this._explicitMaxWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value && this._explicitMaxWidth !== this._explicitMaxWidth) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._explicitMaxWidth = value;\n\t\t\tthis.dispatchEventWith(Event.RESIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitMinHeight:Number = NaN;\n\n\t\t/**\n\t\t * The value passed to the <code>minHeight</code> property setter. If\n\t\t * the <code>minHeight</code> property has not be set, returns\n\t\t * <code>NaN</code>.\n\t\t *\n\t\t * @see #minHeight\n\t\t */\n\t\tpublic function get explicitMinHeight():Number\n\t\t{\n\t\t\treturn this._explicitMinHeight;\n\t\t}\n\n\t\t/**\n\t\t * The minimum height of the component.\n\t\t */\n\t\tpublic function get minHeight():Number\n\t\t{\n\t\t\tif(this._explicitMinHeight === this._explicitMinHeight) //!isNaN\n\t\t\t{\n\t\t\t\treturn this._explicitMinHeight;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minHeight(value:Number):void\n\t\t{\n\t\t\tif(this._explicitMinHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value && this._explicitMinHeight !== this._explicitMinHeight) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._explicitMinHeight = value;\n\t\t\tthis.dispatchEventWith(Event.RESIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _explicitMaxHeight:Number = Number.POSITIVE_INFINITY;\n\n\t\t/**\n\t\t * The value passed to the <code>maxHeight</code> property setter. If\n\t\t * the <code>maxHeight</code> property has not be set, returns\n\t\t * <code>NaN</code>.\n\t\t *\n\t\t * @see #maxHeight\n\t\t */\n\t\tpublic function get explicitMaxHeight():Number\n\t\t{\n\t\t\treturn this._explicitMaxHeight;\n\t\t}\n\n\t\t/**\n\t\t * The maximum height of the component.\n\t\t */\n\t\tpublic function get maxHeight():Number\n\t\t{\n\t\t\treturn this._explicitMaxHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maxHeight(value:Number):void\n\t\t{\n\t\t\tif(this._explicitMaxHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value && this._explicitMaxHeight !== this._explicitMaxHeight) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._explicitMaxHeight = value;\n\t\t\tthis.dispatchEventWith(Event.RESIZE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minTouchWidth:Number = 0;\n\n\t\t/**\n\t\t * If the skin's width is smaller than this value, the hit area will be expanded.\n\t\t *\n\t\t * <p>In the following example, the minimum width of the hit area is\n\t\t * set to 120 pixels:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * skin.minTouchWidth = 120;</listing>\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get minTouchWidth():Number\n\t\t{\n\t\t\treturn this._minTouchWidth;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minTouchWidth(value:Number):void\n\t\t{\n\t\t\tthis._minTouchWidth = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _minTouchHeight:Number = 0;\n\n\t\t/**\n\t\t * If the skin's height is smaller than this value, the hit area will be expanded.\n\t\t *\n\t\t * <p>In the following example, the minimum height of the hit area is\n\t\t * set to 120 pixels:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * skin.minTouchHeight = 120;</listing>\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic function get minTouchHeight():Number\n\t\t{\n\t\t\treturn this._minTouchHeight;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set minTouchHeight(value:Number):void\n\t\t{\n\t\t\tthis._minTouchHeight = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _stateToTexture:Object = {};\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _stateToColor:Object = {};\n\n\t\t/**\n\t\t * Gets the texture to be used by the skin when the context's\n\t\t * <code>currentState</code> property matches the specified state value.\n\t\t *\n\t\t * <p>If a texture is not defined for a specific state, returns\n\t\t * <code>null</code>.</p>\n\t\t *\n\t\t * @see #setTextureForState()\n\t\t */\n\t\tpublic function getTextureForState(state:String):Texture\n\t\t{\n\t\t\treturn this._stateToTexture[state] as Texture;\n\t\t}\n\n\t\t/**\n\t\t * Sets the texture to be used by the skin when the context's\n\t\t * <code>currentState</code> property matches the specified state value.\n\t\t *\n\t\t * <p>If a texture is not defined for a specific state, the value of the\n\t\t * <code>defaultTexture</code> property will be used instead.</p>\n\t\t *\n\t\t * @see #defaultTexture\n\t\t * @see #getTextureForState()\n\t\t */\n\t\tpublic function setTextureForState(state:String, texture:Texture):void\n\t\t{\n\t\t\tif(texture !== null)\n\t\t\t{\n\t\t\t\tthis._stateToTexture[state] = texture;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdelete this._stateToTexture[state];\n\t\t\t}\n\t\t\tthis.updateTextureFromContext();\n\t\t}\n\n\t\t/**\n\t\t * Gets the color to be used by the skin when the context's\n\t\t * <code>currentState</code> property matches the specified state value.\n\t\t *\n\t\t * <p>If a color is not defined for a specific state, returns\n\t\t * <code>uint.MAX_VALUE</code>.</p>\n\t\t *\n\t\t * @see #setColorForState()\n\t\t */\n\t\tpublic function getColorForState(state:String):uint\n\t\t{\n\t\t\tif(state in this._stateToColor)\n\t\t\t{\n\t\t\t\treturn this._stateToColor[state] as uint;\n\t\t\t}\n\t\t\treturn uint.MAX_VALUE;\n\t\t}\n\n\t\t/**\n\t\t * Sets the color to be used by the skin when the context's\n\t\t * <code>currentState</code> property matches the specified state value.\n\t\t *\n\t\t * <p>If a color is not defined for a specific state, the value of the\n\t\t * <code>defaultTexture</code> property will be used instead.</p>\n\t\t *\n\t\t * <p>To clear a state's color, pass in <code>uint.MAX_VALUE</code>.</p>\n\t\t *\n\t\t * @see #defaultColor\n\t\t * @see #getColorForState()\n\t\t */\n\t\tpublic function setColorForState(state:String, color:uint):void\n\t\t{\n\t\t\tif(color != uint.MAX_VALUE)\n\t\t\t{\n\t\t\t\tthis._stateToColor[state] = color;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdelete this._stateToColor[state];\n\t\t\t}\n\t\t\tthis.updateColorFromContext();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function readjustSize(width:Number = -1, height:Number = -1):void\n\t\t{\n\t\t\tsuper.readjustSize(width, height);\n\t\t\tif(this._explicitWidth === this._explicitWidth) //!isNaN\n\t\t\t{\n\t\t\t\tsuper.width = this._explicitWidth;\n\t\t\t}\n\t\t\tif(this._explicitHeight === this._explicitHeight) //!isNaN\n\t\t\t{\n\t\t\t\tsuper.height = this._explicitHeight;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function hitTest(localPoint:Point):DisplayObject\n\t\t{\n\t\t\tif(this._minTouchWidth > 0 || this._minTouchHeight > 0)\n\t\t\t{\n\t\t\t\tif(!this.visible || !this.touchable)\n\t\t\t\t{\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tif(this.mask && !this.hitTestMask(localPoint))\n\t\t\t\t{\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tvar rect:Rectangle = Pool.getRectangle();\n\t\t\t\tthis.getBounds(this, rect);\n\t\t\t\tif(rect.width < this._minTouchWidth)\n\t\t\t\t{\n\t\t\t\t\tvar difference:Number = this._minTouchWidth - rect.width;\n\t\t\t\t\trect.width += difference;\n\t\t\t\t\trect.x -= difference / 2;\n\t\t\t\t}\n\t\t\t\tif(rect.height < this._minTouchHeight)\n\t\t\t\t{\n\t\t\t\t\tdifference = this._minTouchHeight - rect.height;\n\t\t\t\t\trect.height += difference;\n\t\t\t\t\trect.y -= difference / 2;\n\t\t\t\t}\n\t\t\t\tvar result:Boolean = rect.containsPoint(localPoint);\n\t\t\t\tPool.putRectangle(rect);\n\t\t\t\treturn result ? this : null;\n\t\t\t}\n\t\t\treturn super.hitTest(localPoint);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function updateTextureFromContext():void\n\t\t{\n\t\t\tvar texture:Texture = null;\n\t\t\tif(this._stateContext === null)\n\t\t\t{\n\t\t\t\ttexture = this._defaultTexture;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttexture = this._stateToTexture[this._stateContext.currentState] as Texture;\n\t\t\t\tif(texture === null &&\n\t\t\t\t\tthis._disabledTexture !== null &&\n\t\t\t\t\tthis._stateContext is IFeathersControl && !IFeathersControl(this._stateContext).isEnabled)\n\t\t\t\t{\n\t\t\t\t\ttexture = this._disabledTexture;\n\t\t\t\t}\n\t\t\t\tif(texture === null &&\n\t\t\t\t\tthis._selectedTexture !== null &&\n\t\t\t\t\tthis._stateContext is IToggle &&\n\t\t\t\t\tIToggle(this._stateContext).isSelected)\n\t\t\t\t{\n\t\t\t\t\ttexture = this._selectedTexture;\n\t\t\t\t}\n\t\t\t\tif(texture === null)\n\t\t\t\t{\n\t\t\t\t\ttexture = this._defaultTexture;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.texture = texture;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function updateColorFromContext():void\n\t\t{\n\t\t\tif(this._stateContext === null)\n\t\t\t{\n\t\t\t\tif(this._defaultColor != uint.MAX_VALUE)\n\t\t\t\t{\n\t\t\t\t\tthis.$color = this._defaultColor;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar color:uint = uint.MAX_VALUE;\n\t\t\tvar currentState:String = this._stateContext.currentState;\n\t\t\tif(currentState in this._stateToColor)\n\t\t\t{\n\t\t\t\tcolor = this._stateToColor[currentState] as uint;\n\t\t\t}\n\t\t\tif(color == uint.MAX_VALUE &&\n\t\t\t\tthis._disabledColor != uint.MAX_VALUE &&\n\t\t\t\tthis._stateContext is IFeathersControl && !IFeathersControl(this._stateContext).isEnabled)\n\t\t\t{\n\t\t\t\tcolor = this._disabledColor;\n\t\t\t}\n\t\t\tif(color == uint.MAX_VALUE &&\n\t\t\t\tthis._selectedColor != uint.MAX_VALUE &&\n\t\t\t\tthis._stateContext is IToggle &&\n\t\t\t\tIToggle(this._stateContext).isSelected)\n\t\t\t{\n\t\t\t\tcolor = this._selectedColor;\n\t\t\t}\n\t\t\tif(color == uint.MAX_VALUE)\n\t\t\t{\n\t\t\t\tcolor = this._defaultColor;\n\t\t\t}\n\t\t\tif(color != uint.MAX_VALUE)\n\t\t\t{\n\t\t\t\tthis.$color = color;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stateContext_stageChangeHandler(event:Event):void\n\t\t{\n\t\t\tthis.updateTextureFromContext();\n\t\t\tthis.updateColorFromContext();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/skins/StyleNameFunctionStyleProvider.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.skins\n{\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.TokenList;\n\n\t/**\n\t * Similar to <code>FunctionStyleProvider</code>, sets styles on a Feathers\n\t * UI component by passing it to a function, but also provides a way to\n\t * define alternate functions that may be called based on the contents of\n\t * the component's <code>styleNameList</code>.\n\t *\n\t * <p>Alternate functions may be registered with the style provider by\n\t * calling <code>setFunctionForStyleName()</code> and passing in a style\n\t * name and a function. For each style name in the component's\n\t * <code>styleNameList</code>, the style provider will search its registered\n\t * style names to see if a function should be called. If none of a\n\t * component's style names have been registered with the style provider (or\n\t * if the component has no style names), then the default style function\n\t * will be called.</p>\n\t *\n\t * <p>If a component's <code>styleNameList</code> contains multiple values,\n\t * each of those values is eligible to trigger a call to a function\n\t * registered with the style provider. In other words, adding multiple\n\t * values to a component's <code>styleNameList</code> may be used to call\n\t * multiple functions.</p>\n\t *\n\t * <p>In the following example, a <code>StyleNameFunctionStyleProvider</code> is\n\t * created with a default style function (passed to the constructor) and\n\t * an alternate style function:</p>\n\t * <listing version=\"3.0\">\n\t * var styleProvider:StyleNameFunctionStyleProvider = new StyleNameFunctionStyleProvider( function( target:Button ):void\n\t * {\n\t *     target.defaultSkin = new Image( defaultTexture );\n\t *     // set other styles...\n\t * });\n\t * styleProvider.setFunctionForStyleName( \"alternate-button\", function( target:Button ):void\n\t * {\n\t *     target.defaultSkin = new Image( alternateTexture );\n\t *     // set other styles...\n\t * });\n\t * \n\t * var button:Button = new Button();\n\t * button.label = \"Click Me\";\n\t * button.styleProvider = styleProvider;\n\t * this.addChild(button);\n\t * \n\t * var alternateButton:Button = new Button()\n\t * button.label = \"No, click me!\";\n\t * alternateButton.styleProvider = styleProvider;\n\t * alternateButton.styleNameList.add( \"alternate-button\" );\n\t * this.addChild( alternateButton );</listing>\n\t *\n\t * @see ../../../help/skinning.html Skinning Feathers components\n\t *\n\t * @productversion Feathers 2.0.0\n\t */\n\tpublic class StyleNameFunctionStyleProvider implements IStyleProvider\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function StyleNameFunctionStyleProvider(styleFunction:Function = null)\n\t\t{\n\t\t\tthis._defaultStyleFunction = styleFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _defaultStyleFunction:Function;\n\n\t\t/**\n\t\t * The target Feathers UI component is passed to this function when\n\t\t * <code>applyStyles()</code> is called and the component's\n\t\t * <code>styleNameList</code> doesn't contain any style names that are\n\t\t * set with <code>setFunctionForStyleName()</code>.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function( item:IFeathersControl ):void</pre>\n\t\t *\n\t\t * @see #setFunctionForStyleName()\n\t\t */\n\t\tpublic function get defaultStyleFunction():Function\n\t\t{\n\t\t\treturn this._defaultStyleFunction;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set defaultStyleFunction(value:Function):void\n\t\t{\n\t\t\tthis._defaultStyleFunction = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _styleNameMap:Object;\n\n\t\t/**\n\t\t * The target Feathers UI component is passed to this function when\n\t\t * <code>applyStyles()</code> is called and the component's\n\t\t * <code>styleNameList</code> contains the specified style name.\n\t\t *\n\t\t * <p>The function is expected to have the following signature:</p>\n\t\t * <pre>function( item:IFeathersControl ):void</pre>\n\t\t *\n\t\t * @see #defaultStyleFunction\n\t\t */\n\t\tpublic function setFunctionForStyleName(styleName:String, styleFunction:Function):void\n\t\t{\n\t\t\tif(!this._styleNameMap)\n\t\t\t{\n\t\t\t\tthis._styleNameMap = {};\n\t\t\t}\n\t\t\tthis._styleNameMap[styleName] = styleFunction;\n\t\t}\n\n\t\t/**\n\t\t * @inheritDoc\n\t\t */\n\t\tpublic function applyStyles(target:IFeathersControl):void\n\t\t{\n\t\t\tif(this._styleNameMap)\n\t\t\t{\n\t\t\t\tvar hasNameInitializers:Boolean = false;\n\t\t\t\tvar styleNameList:TokenList = target.styleNameList;\n\t\t\t\tvar styleNameCount:int = styleNameList.length;\n\t\t\t\tfor(var i:int = 0; i < styleNameCount; i++)\n\t\t\t\t{\n\t\t\t\t\tvar name:String = styleNameList.item(i);\n\t\t\t\t\tvar initializer:Function = this._styleNameMap[name] as Function;\n\t\t\t\t\tif(initializer != null)\n\t\t\t\t\t{\n\t\t\t\t\t\thasNameInitializers = true;\n\t\t\t\t\t\tinitializer(target);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(hasNameInitializers)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._defaultStyleFunction != null)\n\t\t\t{\n\t\t\t\tthis._defaultStyleFunction(target);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/skins/StyleProviderRegistry.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.skins\n{\n\timport flash.utils.Dictionary;\n\n\t/**\n\t * Used by themes to create and manage style providers for component classes.\n\t *\n\t * @productversion Feathers 2.0.0\n\t */\n\tpublic class StyleProviderRegistry\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const GLOBAL_STYLE_PROVIDER_PROPERTY_NAME:String = \"globalStyleProvider\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static function defaultStyleProviderFactory():IStyleProvider\n\t\t{\n\t\t\treturn new StyleNameFunctionStyleProvider();\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t *\n\t\t * <p>If style providers are to be registered globally, they will be\n\t\t * passed to the static <code>globalStyleProvider</code> property of the\n\t\t * specified class. If the class does not define a\n\t\t * <code>globalStyleProvider</code> property, an error will be thrown.</p>\n\t\t *\n\t\t * <p>The style provider factory function is expected to have the following\n\t\t * signature:</p>\n\t\t * <pre>function():IStyleProvider</pre>\n\t\t *\n\t\t * @param registerGlobally\t\t\tDetermines if the registry sets the static <code>globalStyleProvider</code> property.\n\t\t * @param styleProviderFactory\t\tAn optional function that creates a new style provider. If <code>null</code>, a <code>StyleNameFunctionStyleProvider</code> will be created.\n\t\t */\n\t\tpublic function StyleProviderRegistry(registerGlobally:Boolean = true, styleProviderFactory:Function = null)\n\t\t{\n\t\t\tthis._registerGlobally = registerGlobally;\n\t\t\tif(styleProviderFactory === null)\n\t\t\t{\n\t\t\t\tthis._styleProviderFactory = defaultStyleProviderFactory;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._styleProviderFactory = styleProviderFactory;\n\t\t\t}\n\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _registerGlobally:Boolean;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _styleProviderFactory:Function;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _classToStyleProvider:Dictionary = new Dictionary(true);\n\n\t\t/**\n\t\t * Disposes the theme.\n\t\t */\n\t\tpublic function dispose():void\n\t\t{\n\t\t\t//clear the global style providers, but only if they still match the\n\t\t\t//ones that the theme created. a developer could replace the global\n\t\t\t//style providers with different ones.\n\t\t\tfor(var untypedType:Object in this._classToStyleProvider)\n\t\t\t{\n\t\t\t\tvar type:Class = Class(untypedType);\n\t\t\t\tthis.clearStyleProvider(type);\n\t\t\t}\n\t\t\tthis._classToStyleProvider = null;\n\t\t}\n\n\t\t/**\n\t\t * Determines if an <code>IStyleProvider</code> for the specified\n\t\t * component class has been created.\n\t\t *\n\t\t * @param forClass\t\t\t\t\tThe class that may have a style provider.\n\t\t */\n\t\tpublic function hasStyleProvider(forClass:Class):Boolean\n\t\t{\n\t\t\tif(this._classToStyleProvider === null)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn forClass in this._classToStyleProvider;\n\t\t}\n\n\t\t/**\n\t\t * Returns all classes that have been registered with a style provider.\n\t\t */\n\t\tpublic function getRegisteredClasses(result:Vector.<Class> = null):Vector.<Class>\n\t\t{\n\t\t\tif(result !== null)\n\t\t\t{\n\t\t\t\tresult.length = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult = new <Class>[];\n\t\t\t}\n\t\t\tvar index:int = 0;\n\t\t\tfor(var forClass:Object in this._classToStyleProvider)\n\t\t\t{\n\t\t\t\tresult[index] = forClass as Class;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * Creates an <code>IStyleProvider</code> for the specified component\n\t\t * class, or if it was already created, returns the existing registered\n\t\t * style provider. If the registry is global, a newly created style\n\t\t * provider will be passed to the static <code>globalStyleProvider</code>\n\t\t * property of the specified class.\n\t\t *\n\t\t * @param forClass\t\t\t\t\tThe style provider is registered for this class.\n\t\t * @param styleProviderFactory\t\tA factory used to create the style provider.\n\t\t */\n\t\tpublic function getStyleProvider(forClass:Class):IStyleProvider\n\t\t{\n\t\t\tthis.validateComponentClass(forClass);\n\t\t\tvar styleProvider:IStyleProvider = IStyleProvider(this._classToStyleProvider[forClass]);\n\t\t\tif(!styleProvider)\n\t\t\t{\n\t\t\t\tstyleProvider = this._styleProviderFactory();\n\t\t\t\tthis._classToStyleProvider[forClass] = styleProvider;\n\t\t\t\tif(this._registerGlobally)\n\t\t\t\t{\n\t\t\t\t\tforClass[GLOBAL_STYLE_PROVIDER_PROPERTY_NAME] = styleProvider;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn styleProvider;\n\t\t}\n\n\t\t/**\n\t\t * Removes the style provider for the specified component class. If the\n\t\t * registry is global, and the static <code>globalStyleProvider</code>\n\t\t * property contains the same value, it will be set to <code>null</code>.\n\t\t * If it contains a different value, then it will be left unchanged to\n\t\t * avoid conflicts with other registries or code.\n\t\t *\n\t\t * @param forClass\t\tThe style provider is registered for this class.\n\t\t */\n\t\tpublic function clearStyleProvider(forClass:Class):IStyleProvider\n\t\t{\n\t\t\tthis.validateComponentClass(forClass);\n\t\t\tif(forClass in this._classToStyleProvider)\n\t\t\t{\n\t\t\t\tvar styleProvider:IStyleProvider = IStyleProvider(this._classToStyleProvider[forClass]);\n\t\t\t\tdelete this._classToStyleProvider[forClass];\n\t\t\t\tif(this._registerGlobally &&\n\t\t\t\t\tforClass[GLOBAL_STYLE_PROVIDER_PROPERTY_NAME] === styleProvider)\n\t\t\t\t{\n\t\t\t\t\t//something else may have changed the global style provider\n\t\t\t\t\t//after this registry set it, so we check if it's equal\n\t\t\t\t\t//before setting to null.\n\t\t\t\t\tforClass[GLOBAL_STYLE_PROVIDER_PROPERTY_NAME] = null;\n\t\t\t\t}\n\t\t\t\treturn styleProvider;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function validateComponentClass(type:Class):void\n\t\t{\n\t\t\tif(!this._registerGlobally || Object(type).hasOwnProperty(GLOBAL_STYLE_PROVIDER_PROPERTY_NAME))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthrow ArgumentError(\"Class \" + type + \" must have a \" + GLOBAL_STYLE_PROVIDER_PROPERTY_NAME + \" static property to support themes.\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/system/DeviceCapabilities.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.system\n{\n\timport flash.display.Stage;\n\timport flash.system.Capabilities;\n\n\timport starling.core.Starling;\n\n\t/**\n\t * Using values from the Stage and Capabilities classes, makes educated\n\t * guesses about the physical size of the device this code is running on.\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class DeviceCapabilities\n\t{\n\t\t/**\n\t\t * Indicates if the arrow and enter keys on a standard keyboard are\n\t\t * treated the same as a d-pad. If <code>true</code>, focus and other\n\t\t * behaviors may be controlled with a standard keyboard.\n\t\t *\n\t\t * <p>In the following example, the D-Pad is simulated:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * DeviceCapabilities.simulateDPad = true;</listing>\n\t\t *\n\t\t * @default false\n\t\t *\n\t\t * @productversion Feathers 3.4.0\n\t\t */\n\t\tpublic static var simulateDPad:Boolean = false;\n\n\t\t//early Android tablets were frequently 600x1024 170 DPI, which results\n\t\t//in a portrait width slightly larger than 3.5 inches\n\t\t/**\n\t\t * The minimum physical width, in inches, of the device when in\n\t\t * portrait orientation to be considered a tablet.\n\t\t *\n\t\t * <p>When calling <code>isTablet()</code>, a device must meet the\n\t\t * requirements of both the minimum portrait width and the minimum\n\t\t * landscape width.</p>\n\t\t *\n\t\t * @default 3.5\n\t\t *\n\t\t * @see #tabletScreenLandscapeWidthMinimumInches\n\t\t * @see #isTablet()\n\t\t */\n\t\tpublic static var tabletScreenPortraitWidthMinimumInches:Number = 3.5;\n\n\t\t/**\n\t\t * The minimum physical size, in inches, of the device's larger side to\n\t\t * be considered a tablet.\n\t\t *\n\t\t * <p>When calling <code>isTablet()</code>, a device must meet the\n\t\t * requirements of both the minimum portrait width and the minimum\n\t\t * landscape width.</p>\n\t\t *\n\t\t * @default 5\n\t\t *\n\t\t * @see #tabletScreenPortraitWidthMinimumInches\n\t\t * @see #isTablet()\n\t\t */\n\t\tpublic static var tabletScreenLandscapeWidthMinimumInches:Number = 5;\n\n\t\t//the iPhone X is 1125x2436 458 DPI, which results in a portrait width\n\t\t//of ~2.45 inches. This device should be treated as a small phone.\n\t\t//the Pixel XL is 1440x2560 534 DPI, which results in a portrait width\n\t\t//of ~2.69 inches. This device should be treated as a large phone.\n\t\t/**\n\t\t * The minimum physical width, in inches, of the device when in\n\t\t * portrait orientation to be considered a large phone (sometimes\n\t\t * called a phablet).\n\t\t *\n\t\t * <p>When calling <code>isLargePhone()</code>, a device must meet the\n\t\t * requirements of both the minimum portrait width and the minimum\n\t\t * landscape width.</p>\n\t\t *\n\t\t * @default 2.5\n\t\t *\n\t\t * @see #largePhoneScreenLandscapeWidthMinimumInches\n\t\t * @see #isLargePhone()\n\t\t */\n\t\tpublic static var largePhoneScreenPortraitWidthMinimumInches:Number = 2.5;\n\n\t\t/**\n\t\t * The minimum physical size, in inches, of the device's larger side to\n\t\t * be considered a large phone (sometimes called a phablet).\n\t\t *\n\t\t * <p>When calling <code>isLargePhone()</code>, a device must meet the\n\t\t * requirements of both the minimum portrait width and the minimum\n\t\t * landscape width.</p>\n\t\t *\n\t\t * @default 4.5\n\t\t *\n\t\t * @see #largePhoneScreenPortraitWidthMinimumInches\n\t\t * @see #isLargePhone()\n\t\t */\n\t\tpublic static var largePhoneScreenLandscapeWidthMinimumInches:Number = 4.5;\n\n\t\t/**\n\t\t * A custom width, in pixels, to use for calculations of the device's\n\t\t * physical screen size. Set to NaN to use the actual width.\n\t\t *\n\t\t * @default flash.display.Stage.fullScreenWidth\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Stage.html#fullScreenWidth Full description of flash.display.Stage.fullScreenWidth in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic static var screenPixelWidth:Number = NaN;\n\n\t\t/**\n\t\t * A custom height, in pixels, to use for calculations of the device's\n\t\t * physical screen size. Set to NaN to use the actual height.\n\t\t *\n\t\t * @default flash.display.Stage.fullScreenHeight\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Stage.html#fullScreenWidth Full description of flash.display.Stage.fullScreenWidth in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic static var screenPixelHeight:Number = NaN;\n\n\t\t/**\n\t\t * The screen density to be used by Feathers. Defaults to the value of\n\t\t * <code>flash.system.Capabilities.screenDPI</code>, but may be\n\t\t * overridden. For example, if one wishes to demo a mobile app in a\n\t\t * desktop browser, a custom screen density will override the real\n\t\t * density of the desktop screen.\n\t\t *\n\t\t * <p><strong>Warning:</strong> You should avoid changing this value on\n\t\t * a mobile device because it may result in unexpected side effects. In\n\t\t * addition to being used to scale components in the example themes, the\n\t\t * screen density is used by components such as <code>Scroller</code>\n\t\t * (and its subclasses like <code>List</code> and\n\t\t * <code>ScrollContainer</code>) to optimize the scrolling behavior.\n\t\t * Reporting a different screen density may cause some components to\n\t\t * appear poorly responsive (or overly sensitive) to touches.</p>\n\t\t *\n\t\t * @default flash.system.Capabilities.screenDPI\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/system/Capabilities.html#screenDPI Full description of flash.system.Capabilities.screenDPI in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic static var dpi:int = Capabilities.screenDPI;\n\n\t\t/**\n\t\t * Determines if this device is probably a tablet, based on the physical\n\t\t * width and height, in inches, calculated using the full-screen\n\t\t * dimensions and the screen density.\n\t\t *\n\t\t * @see #tabletScreenPortraitWidthMinimumInches\n\t\t * @see #tabletScreenLandscapeWidthMinimumInches\n\t\t * @see #isPhone()\n\t\t */\n\t\tpublic static function isTablet(stage:Stage = null):Boolean\n\t\t{\n\t\t\tvar portraitWidth:Number = screenInchesX(stage);\n\t\t\tvar landscapeWidth:Number = screenInchesY(stage);\n\t\t\tif(portraitWidth > landscapeWidth)\n\t\t\t{\n\t\t\t\t//make sure the longer side is used for landscape comparison\n\t\t\t\tvar temp:Number = landscapeWidth;\n\t\t\t\tlandscapeWidth = portraitWidth;\n\t\t\t\tportraitWidth = temp;\n\t\t\t}\n\t\t\treturn portraitWidth >= tabletScreenPortraitWidthMinimumInches &&\n\t\t\t\tlandscapeWidth >= tabletScreenLandscapeWidthMinimumInches;\n\t\t}\n\n\t\t/**\n\t\t * Determines if this device is probably a large phone (sometimes\n\t\t * called a phablet), based on the physical width and height, in\n\t\t * inches, calculated using the full-screen dimensions and the screen\n\t\t * density.\n\t\t *\n\t\t * @see #largePhoneScreenLandscapeWidthMinimumInches\n\t\t * @see #largePhoneScreenPortraitWidthMinimumInches\n\t\t * @see #isPhone()\n\t\t * @see #isTablet()\n\t\t */\n\t\tpublic static function isLargePhone(stage:Stage = null):Boolean\n\t\t{\n\t\t\tvar portraitWidth:Number = screenInchesX(stage);\n\t\t\tvar landscapeWidth:Number = screenInchesY(stage);\n\t\t\tif(portraitWidth > landscapeWidth)\n\t\t\t{\n\t\t\t\t//make sure the longer side is used for landscape comparison\n\t\t\t\tvar temp:Number = landscapeWidth;\n\t\t\t\tlandscapeWidth = portraitWidth;\n\t\t\t\tportraitWidth = temp;\n\t\t\t}\n\t\t\treturn portraitWidth >= largePhoneScreenPortraitWidthMinimumInches &&\n\t\t\t\tlandscapeWidth >= largePhoneScreenLandscapeWidthMinimumInches &&\n\t\t\t\t!isTablet(stage);\n\t\t}\n\n\t\t/**\n\t\t * Determines if this device is probably a phone, based on the physical\n\t\t * width and height, in inches, calculated using the full-screen\n\t\t * dimensions and the screen density.\n\t\t *\n\t\t * <p>Returns <code>true</code> if the device is smaller than the\n\t\t * minimum dimensions of a tablet. Larger phones (sometimes called\n\t\t * phablets) are classified as phones when calling\n\t\t * <code>isPhone()</code>. If <code>isPhone()</code> returns\n\t\t * <code>true</code>, use <code>isLargePhone()</code> to determine the\n\t\t * size of the phone, if necessary.</p>\n\t\t *\n\t\t * @see #isTablet()\n\t\t * @see #isLargePhone()\n\t\t */\n\t\tpublic static function isPhone(stage:Stage = null):Boolean\n\t\t{\n\t\t\treturn !isTablet(stage);\n\t\t}\n\n\t\t/**\n\t\t * The physical width of the device, in inches. Calculated using the\n\t\t * full-screen width and the screen density.\n\t\t *\n\t\t * @see #screenPixelWidth\n\t\t * @see #dpi\n\t\t */\n\t\tpublic static function screenInchesX(stage:Stage = null):Number\n\t\t{\n\t\t\tif(stage === null)\n\t\t\t{\n\t\t\t\tstage = Starling.current.nativeStage;\n\t\t\t}\n\t\t\tvar screenWidth:Number = screenPixelWidth;\n\t\t\tif(screenWidth !== screenWidth) //isNaN\n\t\t\t{\n\t\t\t\tscreenWidth = stage.fullScreenWidth;\n\t\t\t}\n\t\t\treturn screenWidth / dpi;\n\t\t}\n\n\t\t/**\n\t\t * The physical height of the device, in inches. Calculated using the\n\t\t * full-screen height and the screen density.\n\t\t *\n\t\t * @see #screenPixelHeight\n\t\t * @see #dpi\n\t\t */\n\t\tpublic static function screenInchesY(stage:Stage = null):Number\n\t\t{\n\t\t\tif(stage === null)\n\t\t\t{\n\t\t\t\tstage = Starling.current.nativeStage;\n\t\t\t}\n\t\t\tvar screenHeight:Number = screenPixelHeight;\n\t\t\tif(screenHeight !== screenHeight) //isNaN\n\t\t\t{\n\t\t\t\tscreenHeight = stage.fullScreenHeight;\n\t\t\t}\n\t\t\treturn screenHeight / dpi;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/text/BitmapFontTextFormat.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.text\n{\n\timport flash.text.TextFormatAlign;\n\n\timport starling.text.BitmapFont;\n\timport starling.text.TextField;\n\n\t/**\n\t * Customizes a bitmap font for use by a <code>BitmapFontTextRenderer</code>.\n\t *\n\t * @see feathers.controls.text.BitmapFontTextRenderer\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic class BitmapFontTextFormat\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function BitmapFontTextFormat(font:Object, size:Number = NaN, color:uint = 0xffffff, align:String = TextFormatAlign.LEFT, leading:Number = 0)\n\t\t{\n\t\t\tif(font is String)\n\t\t\t{\n\t\t\t\tfont = TextField.getBitmapFont(font as String);\n\t\t\t}\n\t\t\tif(!(font is BitmapFont))\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"BitmapFontTextFormat font must be a BitmapFont instance or a String representing the name of a registered bitmap font.\");\n\t\t\t}\n\t\t\tthis.font = BitmapFont(font);\n\t\t\tthis.size = size;\n\t\t\tthis.color = color;\n\t\t\tthis.align = align;\n\t\t\tthis.leading = leading;\n\t\t}\n\n\t\t/**\n\t\t * The name of the font.\n\t\t */\n\t\tpublic function get fontName():String\n\t\t{\n\t\t\treturn this.font ? this.font.name : null;\n\t\t}\n\n\t\t/**\n\t\t * The BitmapFont instance to use.\n\t\t */\n\t\tpublic var font:BitmapFont;\n\n\t\t/**\n\t\t * The color used to tint the bitmap font's texture when rendered.\n\t\t * Tinting works like the \"multiply\" blend mode. In other words, the\n\t\t * <code>color</code> property can only make the text render with a\n\t\t * darker color. With that in mind, if the characters in the original\n\t\t * texture are black, then you cannot change their color at all. To be\n\t\t * able to render the text using any color, the characters in the\n\t\t * original texture should be white.\n\t\t *\n\t\t * @default 0xffffff\n\t\t *\n\t\t * @see http://doc.starling-framework.org/core/starling/display/BlendMode.html#MULTIPLY starling.display.BlendMode.MULTIPLY\n\t\t */\n\t\tpublic var color:uint;\n\n\t\t/**\n\t\t * The size at which to display the bitmap font. Set to <code>NaN</code>\n\t\t * to use the default size in the BitmapFont instance.\n\t\t *\n\t\t * @default NaN\n\t\t */\n\t\tpublic var size:Number;\n\n\t\t/**\n\t\t * The number of extra pixels between characters. May be positive or\n\t\t * negative.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic var letterSpacing:Number = 0;\n\n\t\t[Inspectable(type=\"String\",enumeration=\"left,center,right\")]\n\t\t/**\n\t\t * Determines the alignment of the text, either left, center, or right.\n\t\t *\n\t\t * @default flash.text.TextFormatAlign.LEFT\n\t\t */\n\t\tpublic var align:String = TextFormatAlign.LEFT;\n\n\t\t/**\n\t\t * A number representing the amount of vertical space (called leading)\n\t\t * between lines. The total vertical distance between lines is this\n\t\t * value added to the BitmapFont instance's lineHeight property.\n\t\t *\n\t\t * @default 0\n\t\t */\n\t\tpublic var leading:Number;\n\n\t\t/**\n\t\t * Determines if the kerning values defined in the BitmapFont instance\n\t\t * will be used for layout.\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tpublic var isKerningEnabled:Boolean = true;\n\t}\n}"
  },
  {
    "path": "source/feathers/text/FontStylesSet.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.text\n{\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.IStateContext;\n\timport feathers.core.IStateObserver;\n\timport feathers.core.IToggle;\n\n\timport starling.events.Event;\n\timport starling.events.EventDispatcher;\n\timport starling.text.TextFormat;\n\n\t/**\n\t * Dispatched when a new <code>starling.text.TextFormat</code> is passed in\n\t * or when one of the existing <code>TextFormat</code> objects is modified.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>null</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType starling.events.Event.CHANGE\n\t */\n\t[Event(name=\"change\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Used internally by <code>ITextRenderer</code> implementations to pass\n\t * around sets of <code>TextFormat</code> objects for a component's\n\t * different states.\n\t *\n\t * <p>A custom component that uses one or more text renderers is expected to\n\t * provide user-facing APIs to set its font styles using\n\t * separate <code>TextFormat</code> instances. The combined set of these\n\t * formats should be stored in a <code>FontStylesSet</code> that can be\n\t * passed into the text renderer.</p>\n\t *\n\t * @see feathers.core.ITextRenderer\n\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t *\n\t * @productversion Feathers 3.1.0\n\t */\n\tpublic class FontStylesSet extends EventDispatcher\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function FontStylesSet()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * Stores formats for specific state. The key is the state constant,\n\t\t * and the value is a TextFormat.\n\t\t */\n\t\tprotected var _stateToFormat:Object = null;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _format:TextFormat;\n\n\t\t/**\n\t\t * The default font format used to display the text.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t\t */\n\t\tpublic function get format():TextFormat\n\t\t{\n\t\t\treturn this._format;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set format(value:TextFormat):void\n\t\t{\n\t\t\tif(this._format === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._format !== null)\n\t\t\t{\n\t\t\t\tthis._format.removeEventListener(Event.CHANGE, format_changeHandler);\n\t\t\t}\n\t\t\tthis._format = value;\n\t\t\tif(this._format !== null)\n\t\t\t{\n\t\t\t\tthis._format.addEventListener(Event.CHANGE, format_changeHandler);\n\t\t\t}\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _disabledFormat:TextFormat;\n\n\t\t/**\n\t\t * The font styles used to display the text when the component is\n\t\t * disabled. If <code>null</code>, the value of the <code>format</code>\n\t\t * property will typically be used.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t\t */\n\t\tpublic function get disabledFormat():TextFormat\n\t\t{\n\t\t\treturn this._disabledFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set disabledFormat(value:TextFormat):void\n\t\t{\n\t\t\tif(this._disabledFormat === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._disabledFormat !== null)\n\t\t\t{\n\t\t\t\tthis._disabledFormat.removeEventListener(Event.CHANGE, format_changeHandler);\n\t\t\t}\n\t\t\tthis._disabledFormat = value;\n\t\t\tif(this._disabledFormat !== null)\n\t\t\t{\n\t\t\t\tthis._disabledFormat.addEventListener(Event.CHANGE, format_changeHandler);\n\t\t\t}\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _selectedFormat:TextFormat;\n\n\t\t/**\n\t\t * The font styles used to display the text when the component is\n\t\t * selected. If <code>null</code>, the value of the <code>format</code>\n\t\t * property will typically be used.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t\t */\n\t\tpublic function get selectedFormat():TextFormat\n\t\t{\n\t\t\treturn this._selectedFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set selectedFormat(value:TextFormat):void\n\t\t{\n\t\t\tif(this._selectedFormat === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._selectedFormat !== null)\n\t\t\t{\n\t\t\t\tthis._selectedFormat.removeEventListener(Event.CHANGE, format_changeHandler);\n\t\t\t}\n\t\t\tthis._selectedFormat = value;\n\t\t\tif(this._selectedFormat !== null)\n\t\t\t{\n\t\t\t\tthis._selectedFormat.addEventListener(Event.CHANGE, format_changeHandler);\n\t\t\t}\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\n\t\t/**\n\t\t * Cleans up all TextFormat objects.\n\t\t */\n\t\tpublic function dispose():void\n\t\t{\n\t\t\tthis.format = null;\n\t\t\tthis.disabledFormat = null;\n\t\t\tthis.selectedFormat = null;\n\t\t\tfor(var state:String in this._stateToFormat)\n\t\t\t{\n\t\t\t\tthis.setFormatForState(state, null);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Returns the <code>TextFormat</code> for a specific state, or\n\t\t * <code>null</code> if the <code>TextFormat</code> has not been set\n\t\t * for that state.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t\t */\n\t\tpublic function getFormatForState(state:String):TextFormat\n\t\t{\n\t\t\tif(this._stateToFormat === null)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn TextFormat(this._stateToFormat[state]);\n\t\t}\n\n\t\t/**\n\t\t * Sets the <code>TextFormat</code> for a specific state.\n\t\t *\n\t\t * <p>Pass in <code>null</code> to clear the format for the state.</p>\n\t\t *\n\t\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t\t */\n\t\tpublic function setFormatForState(state:String, value:TextFormat):void\n\t\t{\n\t\t\tvar oldFormat:TextFormat = null;\n\t\t\tif(value !== null)\n\t\t\t{\n\t\t\t\tif(this._stateToFormat === null)\n\t\t\t\t{\n\t\t\t\t\tthis._stateToFormat = {};\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\toldFormat = TextFormat(this._stateToFormat[state]);\n\t\t\t\t}\n\t\t\t\tif(oldFormat !== null)\n\t\t\t\t{\n\t\t\t\t\toldFormat.removeEventListener(Event.CHANGE, format_changeHandler);\n\t\t\t\t}\n\t\t\t\tthis._stateToFormat[state] = value;\n\t\t\t\tvalue.addEventListener(Event.CHANGE, format_changeHandler);\n\t\t\t}\n\t\t\telse if(this._stateToFormat !== null)\n\t\t\t{\n\t\t\t\toldFormat = TextFormat(this._stateToFormat[state]);\n\t\t\t\tif(oldFormat !== null)\n\t\t\t\t{\n\t\t\t\t\toldFormat.removeEventListener(Event.CHANGE, format_changeHandler);\n\t\t\t\t\tdelete this._stateToFormat[state];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Chooses the appropriate <code>TextFormat</code> to use based on the\n\t\t * state of the text renderer passed in. If the text renderer has a\n\t\t * <code>stateContext</code>, the state of the <code>stateContext</code>\n\t\t * takes precedent.\n\t\t *\n\t\t * @see http://doc.starling-framework.org/current/starling/text/TextFormat.html starling.text.TextFormat\n\t\t */\n\t\tpublic function getTextFormatForTarget(target:IFeathersControl):TextFormat\n\t\t{\n\t\t\tvar textFormat:TextFormat;\n\t\t\tvar stateContext:IStateContext;\n\t\t\tif(target is IStateObserver)\n\t\t\t{\n\t\t\t\tstateContext = IStateObserver(target).stateContext;\n\t\t\t}\n\t\t\tif(stateContext !== null)\n\t\t\t{\n\t\t\t\t//first, look for a format defined for a specific state\n\t\t\t\tif(this._stateToFormat !== null)\n\t\t\t\t{\n\t\t\t\t\tvar currentState:String = stateContext.currentState;\n\t\t\t\t\tif(currentState in this._stateToFormat)\n\t\t\t\t\t{\n\t\t\t\t\t\ttextFormat = TextFormat(this._stateToFormat[currentState]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//the disabled format is a convenience that can cover multiple\n\t\t\t\t//disabled states\n\t\t\t\tif(textFormat === null && this._disabledFormat !== null &&\n\t\t\t\t\tstateContext is IFeathersControl && !IFeathersControl(stateContext).isEnabled)\n\t\t\t\t{\n\t\t\t\t\ttextFormat = this._disabledFormat;\n\t\t\t\t}\n\t\t\t\t//similar with the selected format that can cover multiple\n\t\t\t\t//selected states\n\t\t\t\tif(textFormat === null && this._selectedFormat !== null &&\n\t\t\t\t\tstateContext is IToggle && IToggle(stateContext).isSelected)\n\t\t\t\t{\n\t\t\t\t\ttextFormat = this._selectedFormat;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //no state context, so only text renderer can be used\n\t\t\t{\n\t\t\t\tif(this._disabledFormat !== null && !target.isEnabled)\n\t\t\t\t{\n\t\t\t\t\ttextFormat = this._disabledFormat;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(textFormat === null)\n\t\t\t{\n\t\t\t\t//finally, fall back to the default format, if needed\n\t\t\t\t//(it may still be null, though)\n\t\t\t\ttextFormat = this._format;\n\t\t\t}\n\t\t\treturn textFormat;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function format_changeHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/text/StageTextField.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.text\n{\n\timport flash.display.BitmapData;\n\timport flash.display.Stage;\n\timport flash.events.Event;\n\timport flash.events.EventDispatcher;\n\timport flash.events.FocusEvent;\n\timport flash.events.KeyboardEvent;\n\timport flash.geom.Rectangle;\n\timport flash.text.TextField;\n\timport flash.text.TextFieldType;\n\timport flash.text.TextFormat;\n\timport flash.text.TextFormatAlign;\n\timport flash.text.engine.FontPosture;\n\timport flash.text.engine.FontWeight;\n\n\t/**\n\t * A StageText replacement for Flash Player with matching properties, since\n\t * StageText is only available in AIR.\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic final class StageTextField extends EventDispatcher\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function StageTextField(initOptions:Object = null)\n\t\t{\n\t\t\tthis.initialize(initOptions);\n\t\t}\n\n\t\tprivate var _textField:TextField;\n\t\tprivate var _textFormat:TextFormat;\n\t\tprivate var _isComplete:Boolean = false;\n\n\t\tprivate var _autoCapitalize:String = \"none\";\n\n\t\tpublic function get autoCapitalize():String\n\t\t{\n\t\t\treturn this._autoCapitalize;\n\t\t}\n\n\t\tpublic function set autoCapitalize(value:String):void\n\t\t{\n\t\t\tthis._autoCapitalize = value;\n\t\t}\n\n\t\tprivate var _autoCorrect:Boolean = false;\n\n\t\tpublic function get autoCorrect():Boolean\n\t\t{\n\t\t\treturn this._autoCorrect;\n\t\t}\n\n\t\tpublic function set autoCorrect(value:Boolean):void\n\t\t{\n\t\t\tthis._autoCorrect = value;\n\t\t}\n\n\t\tprivate var _color:uint = 0x000000;\n\n\t\tpublic function get color():uint\n\t\t{\n\t\t\treturn this._textFormat.color as uint;\n\t\t}\n\n\t\tpublic function set color(value:uint):void\n\t\t{\n\t\t\tif(this._textFormat.color == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textFormat.color = value;\n\t\t\tthis._textField.defaultTextFormat = this._textFormat;\n\t\t\tthis._textField.setTextFormat(this._textFormat);\n\t\t}\n\n\t\tpublic function get displayAsPassword():Boolean\n\t\t{\n\t\t\treturn this._textField.displayAsPassword;\n\t\t}\n\n\t\tpublic function set displayAsPassword(value:Boolean):void\n\t\t{\n\t\t\tthis._textField.displayAsPassword = value;\n\t\t}\n\n\t\tpublic function get editable():Boolean\n\t\t{\n\t\t\treturn this._textField.type == TextFieldType.INPUT;\n\t\t}\n\n\t\tpublic function set editable(value:Boolean):void\n\t\t{\n\t\t\tthis._textField.type = value ? TextFieldType.INPUT : TextFieldType.DYNAMIC;\n\t\t}\n\n\t\tprivate var _fontFamily:String = null;\n\n\t\tpublic function get fontFamily():String\n\t\t{\n\t\t\treturn this._textFormat.font;\n\t\t}\n\n\t\tpublic function set fontFamily(value:String):void\n\t\t{\n\t\t\tif(this._textFormat.font == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textFormat.font = value;\n\t\t\tthis._textField.defaultTextFormat = this._textFormat;\n\t\t\tthis._textField.setTextFormat(this._textFormat);\n\t\t}\n\n\t\tpublic function get fontPosture():String\n\t\t{\n\t\t\treturn this._textFormat.italic ? FontPosture.ITALIC : FontPosture.NORMAL;\n\t\t}\n\n\t\tpublic function set fontPosture(value:String):void\n\t\t{\n\t\t\tif(this.fontPosture == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textFormat.italic = value == FontPosture.ITALIC;\n\t\t\tthis._textField.defaultTextFormat = this._textFormat;\n\t\t\tthis._textField.setTextFormat(this._textFormat);\n\t\t}\n\n\t\tpublic function get fontSize():int\n\t\t{\n\t\t\treturn this._textFormat.size as int;\n\t\t}\n\n\t\tpublic function set fontSize(value:int):void\n\t\t{\n\t\t\tif(this._textFormat.size == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textFormat.size = value;\n\t\t\tthis._textField.defaultTextFormat = this._textFormat;\n\t\t\tthis._textField.setTextFormat(this._textFormat);\n\t\t}\n\n\t\tpublic function get fontWeight():String\n\t\t{\n\t\t\treturn this._textFormat.bold ? FontWeight.BOLD : FontWeight.NORMAL;\n\t\t}\n\n\t\tpublic function set fontWeight(value:String):void\n\t\t{\n\t\t\tif(this.fontWeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textFormat.bold = value == FontWeight.BOLD;\n\t\t\tthis._textField.defaultTextFormat = this._textFormat;\n\t\t\tthis._textField.setTextFormat(this._textFormat);\n\t\t}\n\n\t\tprivate var _locale:String = \"en\";\n\n\t\tpublic function get locale():String\n\t\t{\n\t\t\treturn this._locale;\n\t\t}\n\n\t\tpublic function set locale(value:String):void\n\t\t{\n\t\t\tthis._locale = value;\n\t\t}\n\n\t\tpublic function get maxChars():int\n\t\t{\n\t\t\treturn this._textField.maxChars;\n\t\t}\n\n\t\tpublic function set maxChars(value:int):void\n\t\t{\n\t\t\tthis._textField.maxChars = value;\n\t\t}\n\n\t\tpublic function get multiline():Boolean\n\t\t{\n\t\t\treturn this._textField.multiline;\n\t\t}\n\n\t\tpublic function get restrict():String\n\t\t{\n\t\t\treturn this._textField.restrict;\n\t\t}\n\n\t\tpublic function set restrict(value:String):void\n\t\t{\n\t\t\tthis._textField.restrict = value;\n\t\t}\n\n\t\tprivate var _returnKeyLabel:String = \"default\";\n\n\t\tpublic function get returnKeyLabel():String\n\t\t{\n\t\t\treturn this._returnKeyLabel;\n\t\t}\n\n\t\tpublic function set returnKeyLabel(value:String):void\n\t\t{\n\t\t\tthis._returnKeyLabel = value;\n\t\t}\n\n\t\tpublic function get selectionActiveIndex():int\n\t\t{\n\t\t\treturn this._textField.selectionBeginIndex;\n\t\t}\n\n\t\tpublic function get selectionAnchorIndex():int\n\t\t{\n\t\t\treturn this._textField.selectionEndIndex;\n\t\t}\n\n\t\tprivate var _softKeyboardType:String = \"default\";\n\n\t\tpublic function get softKeyboardType():String\n\t\t{\n\t\t\treturn this._softKeyboardType;\n\t\t}\n\n\t\tpublic function set softKeyboardType(value:String):void\n\t\t{\n\t\t\tthis._softKeyboardType = value;\n\t\t}\n\n\t\tpublic function get stage():Stage\n\t\t{\n\t\t\treturn this._textField.stage;\n\t\t}\n\n\t\tpublic function set stage(value:Stage):void\n\t\t{\n\t\t\tif(this._textField.stage == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._textField.stage)\n\t\t\t{\n\t\t\t\tthis._textField.parent.removeChild(this._textField);\n\t\t\t}\n\t\t\tif(value)\n\t\t\t{\n\t\t\t\tvalue.addChild(this._textField);\n\t\t\t\tthis.dispatchCompleteIfPossible();\n\t\t\t}\n\t\t}\n\n\t\tpublic function get text():String\n\t\t{\n\t\t\treturn this._textField.text;\n\t\t}\n\n\t\tpublic function set text(value:String):void\n\t\t{\n\t\t\tthis._textField.text = value;\n\t\t}\n\n\t\tprivate var _textAlign:String = TextFormatAlign.START;\n\n\t\tpublic function get textAlign():String\n\t\t{\n\t\t\treturn this._textAlign;\n\t\t}\n\n\t\tpublic function set textAlign(value:String):void\n\t\t{\n\t\t\tif(this._textAlign == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textAlign = value;\n\t\t\tif(value == TextFormatAlign.START)\n\t\t\t{\n\t\t\t\tvalue = TextFormatAlign.LEFT;\n\t\t\t}\n\t\t\telse if(value == TextFormatAlign.END)\n\t\t\t{\n\t\t\t\tvalue = TextFormatAlign.RIGHT;\n\t\t\t}\n\t\t\tthis._textFormat.align = value;\n\t\t\tthis._textField.defaultTextFormat = this._textFormat;\n\t\t\tthis._textField.setTextFormat(this._textFormat);\n\t\t}\n\n\t\tprivate var _viewPort:Rectangle = new Rectangle();\n\n\t\tpublic function get viewPort():Rectangle\n\t\t{\n\t\t\treturn this._viewPort;\n\t\t}\n\n\t\tpublic function set viewPort(value:Rectangle):void\n\t\t{\n\t\t\tif(!value || value.width < 0 || value.height < 0)\n\t\t\t{\n\t\t\t\tthrow new RangeError(\"The Rectangle value is not valid.\");\n\t\t\t}\n\t\t\tthis._viewPort = value;\n\t\t\tthis._textField.x = this._viewPort.x;\n\t\t\tthis._textField.y = this._viewPort.y;\n\t\t\tthis._textField.width = this._viewPort.width;\n\t\t\tthis._textField.height = this._viewPort.height;\n\n\t\t\tthis.dispatchCompleteIfPossible();\n\t\t}\n\n\t\tpublic function get visible():Boolean\n\t\t{\n\t\t\treturn this._textField.visible;\n\t\t}\n\n\t\tpublic function set visible(value:Boolean):void\n\t\t{\n\t\t\tthis._textField.visible = value;\n\t\t}\n\n\t\tpublic function assignFocus():void\n\t\t{\n\t\t\tif(!this._textField.parent)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._textField.stage.focus = this._textField;\n\t\t}\n\n\t\tpublic function dispose():void\n\t\t{\n\t\t\tthis.stage = null;\n\t\t\tthis._textField = null;\n\t\t\tthis._textFormat = null;\n\t\t}\n\n\t\tpublic function drawViewPortToBitmapData(bitmap:BitmapData):void\n\t\t{\n\t\t\tif(!bitmap)\n\t\t\t{\n\t\t\t\tthrow new Error(\"The bitmap is null.\");\n\t\t\t}\n\t\t\tif(bitmap.width != this._viewPort.width || bitmap.height != this._viewPort.height)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"The bitmap's width or height is different from view port's width or height.\");\n\t\t\t}\n\t\t\tbitmap.draw(this._textField);\n\t\t}\n\n\t\tpublic function selectRange(anchorIndex:int, activeIndex:int):void\n\t\t{\n\t\t\tthis._textField.setSelection(anchorIndex, activeIndex);\n\t\t}\n\n\t\tprivate function dispatchCompleteIfPossible():void\n\t\t{\n\t\t\tif(!this._textField.stage || this._viewPort.isEmpty())\n\t\t\t{\n\t\t\t\tthis._isComplete = false;\n\t\t\t}\n\t\t\tif(this._textField.stage && !this._viewPort.isEmpty())\n\t\t\t{\n\t\t\t\tthis._isComplete = true;\n\t\t\t\tthis.dispatchEvent(new Event(Event.COMPLETE));\n\t\t\t}\n\t\t}\n\n\t\tprivate function initialize(initOptions:Object):void\n\t\t{\n\t\t\tthis._textField = new TextField();\n\t\t\tthis._textField.type = TextFieldType.INPUT;\n\t\t\tvar isMultiline:Boolean = initOptions && initOptions.hasOwnProperty(\"multiline\") && initOptions.multiline;\n\t\t\tthis._textField.multiline = isMultiline;\n\t\t\tthis._textField.wordWrap = isMultiline;\n\t\t\tthis._textField.addEventListener(Event.CHANGE, textField_eventHandler);\n\t\t\tthis._textField.addEventListener(FocusEvent.FOCUS_IN, textField_eventHandler);\n\t\t\tthis._textField.addEventListener(FocusEvent.FOCUS_OUT, textField_eventHandler);\n\t\t\tthis._textField.addEventListener(KeyboardEvent.KEY_DOWN, textField_eventHandler);\n\t\t\tthis._textField.addEventListener(KeyboardEvent.KEY_UP, textField_eventHandler);\n\t\t\tthis._textField.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, textField_keyFocusChangeHandler);\n\t\t\tthis._textFormat = new TextFormat(null, 11, 0x000000, false, false, false);\n\t\t\tthis._textField.defaultTextFormat = this._textFormat;\n\t\t}\n\n\t\tprivate function textField_eventHandler(event:Event):void\n\t\t{\n\t\t\tthis.dispatchEvent(event);\n\t\t}\n\n\t\tprivate function textField_keyFocusChangeHandler(event:FocusEvent):void\n\t\t{\n\t\t\t//StageText doesn't dispatch this event, so we shouldn't either\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopImmediatePropagation();\n\t\t\tevent.stopPropagation();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/themes/IAsyncTheme.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.themes\n{\n\timport feathers.core.IFeathersEventDispatcher;\n\n\timport starling.core.Starling;\n\n\t/**\n\t * Dispatched when the theme's assets are loaded, and the theme has\n\t * initialized. Feathers component cannot be skinned automatically by the\n\t * theme until this event is dispatched.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The <code>Starling</code> instance that\n\t *   is associated with the assets that have finished loading.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @see #isCompleteForStarling()\n\t *\n\t * @eventType starling.events.Event.COMPLETE\n\t */\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\t/**\n\t * A theme that uses an asynchronous loading mechanism (such as the Starling\n\t * <code>AssetManager</code>), during initialization to load textures and\n\t * other assets. This type of theme may not be ready to style components\n\t * immediately, and it will dispatch <code>Event.COMPLETE</code> once the\n\t * it has fully initialized. Attempting to create Feathers components before\n\t * the theme has dispatched <code>Event.COMPLETE</code> may result in no\n\t * skins or even runtime errors.\n\t *\n\t * @productversion Feathers 2.3.0\n\t */\n\tpublic interface IAsyncTheme extends IFeathersEventDispatcher\n\t{\n\t\t/**\n\t\t * Indicates if the assets have been loaded and the theme has been\n\t\t * initialized for a specific Starling instance.\n\t\t *\n\t\t * @see #event:complete starling.events.Event.COMPLETE\n\t\t */\n\t\tfunction isCompleteForStarling(starling:Starling):Boolean;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/themes/StyleNameFunctionTheme.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.themes\n{\n\timport feathers.core.IFeathersControl;\n\timport feathers.skins.ConditionalStyleProvider;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.skins.StyleNameFunctionStyleProvider;\n\timport feathers.skins.StyleProviderRegistry;\n\n\timport starling.core.Starling;\n\timport starling.events.EventDispatcher;\n\n\t/**\n\t * Base class for themes that pass a <code>StyleNameFunctionStyleProvider</code>\n\t * to each component class.\n\t *\n\t * @see feathers.skins.StyleNameFunctionStyleProvider\n\t * @see ../../../help/skinning.html Skinning Feathers components\n\t * @see ../../../help/custom-themes.html Creating custom Feathers themes\n\t *\n\t * @productversion Feathers 2.0.0\n\t */\n\tpublic class StyleNameFunctionTheme extends EventDispatcher\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const GLOBAL_STYLE_PROVIDER_PROPERTY_NAME:String = \"globalStyleProvider\";\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function StyleNameFunctionTheme()\n\t\t{\n\t\t\tif(this.starling === null)\n\t\t\t{\n\t\t\t\tthis.starling = Starling.current;\n\t\t\t}\n\t\t\tthis.createRegistry();\n\t\t\tthis._conditionalRegistry = new StyleProviderRegistry(true, createConditionalStyleProvider);\n\t\t}\n\n\t\t/**\n\t\t * The Starling instance associated with this theme.\n\t\t */\n\t\tprotected var starling:Starling;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _registry:StyleProviderRegistry;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _conditionalRegistry:StyleProviderRegistry;\n\n\t\t/**\n\t\t * Disposes the theme.\n\t\t */\n\t\tpublic function dispose():void\n\t\t{\n\t\t\tif(this._registry !== null)\n\t\t\t{\n\t\t\t\tthis._registry.dispose();\n\t\t\t\tthis._registry = null;\n\t\t\t}\n\t\t\tif(this._conditionalRegistry !== null)\n\t\t\t{\n\t\t\t\tthis.disposeConditionalRegistry();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Returns a <code>StyleNameFunctionStyleProvider</code> to be passed to\n\t\t * the specified class.\n\t\t */\n\t\tpublic function getStyleProviderForClass(type:Class):StyleNameFunctionStyleProvider\n\t\t{\n\t\t\tvar existingGlobalStyleProvider:IStyleProvider = IStyleProvider(type[GLOBAL_STYLE_PROVIDER_PROPERTY_NAME]);\n\t\t\tvar conditional:ConditionalStyleProvider = ConditionalStyleProvider(this._conditionalRegistry.getStyleProvider(type));\n\t\t\tif(conditional.trueStyleProvider === null)\n\t\t\t{\n\t\t\t\tvar styleProvider:StyleNameFunctionStyleProvider = StyleNameFunctionStyleProvider(this._registry.getStyleProvider(type));\n\t\t\t\tconditional.trueStyleProvider = styleProvider;\n\t\t\t\tconditional.falseStyleProvider = existingGlobalStyleProvider;\n\t\t\t}\n\t\t\treturn StyleNameFunctionStyleProvider(conditional.trueStyleProvider);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createRegistry():void\n\t\t{\n\t\t\tthis._registry = new StyleProviderRegistry(false);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function starlingConditional(target:IFeathersControl):Boolean\n\t\t{\n\t\t\tvar starling:Starling = target.stage !== null ? target.stage.starling : Starling.current;\n\t\t\treturn starling === this.starling;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createConditionalStyleProvider():ConditionalStyleProvider\n\t\t{\n\t\t\treturn new ConditionalStyleProvider(starlingConditional);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function disposeConditionalRegistry():void\n\t\t{\n\t\t\tvar classes:Vector.<Class> = this._conditionalRegistry.getRegisteredClasses();\n\t\t\tvar classCount:int = classes.length;\n\t\t\tfor(var i:int = 0; i < classCount; i++)\n\t\t\t{\n\t\t\t\tvar forClass:Class = classes[i];\n\t\t\t\tvar globalStyleProvider:IStyleProvider = IStyleProvider(forClass[GLOBAL_STYLE_PROVIDER_PROPERTY_NAME]);\n\t\t\t\tvar styleProviderInRegistry:ConditionalStyleProvider = ConditionalStyleProvider(this._conditionalRegistry.clearStyleProvider(forClass));\n\n\t\t\t\tvar currentStyleProvider:ConditionalStyleProvider = globalStyleProvider as ConditionalStyleProvider;\n\t\t\t\tvar previousStyleProvider:ConditionalStyleProvider = null;\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\tif(currentStyleProvider === null)\n\t\t\t\t\t{\n\t\t\t\t\t\t//worse case scenario is that we don't know how to\n\t\t\t\t\t\t//remove this style provider from the chain, so we leave\n\t\t\t\t\t\t//it in but always pass to the falseStyleProvider.\n\t\t\t\t\t\tstyleProviderInRegistry.conditionalFunction = null;\n\t\t\t\t\t\tstyleProviderInRegistry.trueStyleProvider = null;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tvar nextStyleProvider:IStyleProvider = currentStyleProvider.falseStyleProvider;\n\t\t\t\t\tif(currentStyleProvider === styleProviderInRegistry)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(previousStyleProvider !== null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpreviousStyleProvider.falseStyleProvider = nextStyleProvider;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse //currentStyleProvider === globalStyleProvider\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforClass[GLOBAL_STYLE_PROVIDER_PROPERTY_NAME] = nextStyleProvider;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tpreviousStyleProvider = currentStyleProvider;\n\t\t\t\t\tcurrentStyleProvider = nextStyleProvider as ConditionalStyleProvider;\n\t\t\t\t}\n\t\t\t\twhile(true);\n\t\t\t}\n\t\t\tthis._conditionalRegistry = null;\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/utils/ScreenDensityScaleFactorManager.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils\n{\n\timport feathers.system.DeviceCapabilities;\n\timport feathers.utils.display.ScreenDensityScaleCalculator;\n\timport feathers.utils.math.roundDownToNearest;\n\n\timport flash.display.Stage;\n\timport flash.events.Event;\n\timport flash.geom.Rectangle;\n\timport flash.system.Capabilities;\n\n\timport starling.core.Starling;\n\timport starling.utils.SystemUtil;\n\n\t/**\n\t * Automatically manages the Starling view port and stage dimensions to\n\t * create an appropriate <code>contentScaleFactor</code> value for the\n\t * current mobile device while filling the whole screen without letterboxing\n\t * (no black bars!). Additionally, if the mobile device changes orientation,\n\t * or if the desktop native window resizes,\n\t * <code>ScreenDensityScaleFactorManager</code> will automatically resize\n\t * Starling based on the new dimensions.\n\t *\n\t * <p>When using <code>ScreenDensityScaleFactorManager</code>, the Starling\n\t * stage dimensions will not be exactly the same on all devices. When\n\t * comparing two different phones, the stage dimensions will be similar, but\n\t * may not be perfectly equal. For example, the stage dimensions on an\n\t * Apple iPhone 5 in portrait orientation will be 320x568, but the stage\n\t * dimensions on a Google Nexus 5 will be 360x640. With this in mind, be\n\t * sure to use \"fluid\" layouts to account for the differences.</p>\n\t *\n\t * <p>It's also important to understand that tablets will have much larger\n\t * Starling stage dimensions than phones.\n\t * <code>ScreenDensityScaleFactorManager</code> is designed to behave more\n\t * like native apps where tablets often display extra navigation or data\n\t * that wouldn't be able to fit on a smaller phone screen. For example, on\n\t * an Apple iPad, the stage dimensions will be 768x1024. This is much larger\n\t * than the two phones we compared previously.</p>\n\t *\n\t * <p>The following example demonstrates how to instantiate\n\t * <code>ScreenDensityScaleFactorManager</code>:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * this._starling = new Starling( RootClass, this.stage, null, null, Context3DRenderMode.AUTO, Context3DProfile.BASELINE );\n\t * this._scaler = new ScreenDensityScaleFactorManager(this._starling);</listing>\n\t *\n\t * <strong>How <code>contentScaleFactor</code> is calculated</strong>\n\t *\n\t * <p>The device's screen density (sometimes referred to as DPI or PPI) is\n\t * used to calculate an appropriate <code>contentScaleFactor</code> value.\n\t * The calculation is inspired by native apps on Google's Android operating\n\t * system where \"density-independent pixels\" are used for layout. You might\n\t * consider this an advanced form of the techniques described in\n\t * <a href=\"http://wiki.starling-framework.org/manual/multi-resolution_development\">Starling Multi-Resolution Development</a>.</p>\n\t *\n\t * <p>The following chart shows how different screen densities map to\n\t * different <code>contentScaleFactor</code> values on both iOS and Android:</p>\n\t *\n\t * <table class=\"innertable\">\n\t * <tr><th>Android</th><th>iOS</th><th>Density</th><th>Scale Factor</th></tr>\n\t * <tr><td>ldpi</td><td></td><td>120</td><td>0.75</td></tr>\n\t * <tr><td>mdpi</td><td>non-Retina (&#64;1x)</td><td>160</td><td>1</td></tr>\n\t * <tr><td>hdpi</td><td></td><td>240</td><td>1.5</td></tr>\n\t * <tr><td>xhdpi</td><td>Retina (&#64;2x)</td><td>320</td><td>2</td></tr>\n\t * <tr><td>xxhdpi</td><td>Retina HD (&#64;3x)</td><td>480</td><td>3</td></tr>\n\t * <tr><td>xxxhdpi</td><td></td><td>640</td><td>4</td></tr>\n\t * </table>\n\t *\n\t * <p>The density values in the table above are approximate. The screen\n\t * density of an iPhone 5 is 326, so it uses the scale factor from the\n\t * \"xhdpi\" bucket because 326 is closer to 320 than it is to 480.</p>\n\t *\n\t * <p>Note: Special behavior has been implemented for iPads to give them\n\t * scale factors of <code>1</code> and <code>2</code>, just like native\n\t * apps. Using Android's rules for DPI buckets, non-Retina iPads would have\n\t * been \"ldpi\" devices (scale factor <code>0.75</code>) and Retina iPads\n\t * would have been \"hdpi\" devices (scale factor <code>1.5</code>). However,\n\t * because it makes more sense for Starling to use the same scale factor as\n\t * native apps on iPad, this class makes a special exception just for\n\t * them.</p>\n\t *\n\t * <strong>Loading Assets</strong>\n\t *\n\t * <p>After creating <code>ScreenDensityScaleFactorManager</code>, you can\n\t * use Starling's <code>contentScaleFactor</code> property to determine\n\t * which set of assets to load:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * if( Starling.current.contentScaleFactor > 1 )\n\t * {\n\t *     assetManager.scaleFactor = 2;\n\t *     var assets2x:File = File.applicationDirectory.resolvePath( \"assets/2x\" );\n\t *     assetManager.enqueue( assets2x );\n\t * }\n\t * else\n\t * {\n\t *     assetManager.scaleFactor = 1;\n\t *     var assets1x:File = File.applicationDirectory.resolvePath( \"assets/1x\" );\n\t *     assetManager.enqueue( assets1x );\n\t * }</listing>\n\t *\n\t * <p>Providing assets for every scale factor is optional because Starling\n\t * will automatically resize any textures that have been given a different\n\t * <code>scale</code> than the current <code>contentScaleFactor</code> when\n\t * they are rendered to the screen.</p>\n\t *\n\t * <p>For example, since \"ldpi\" devices with a low screen density typically\n\t * aren't manufactured anymore, it might not be worth spending time\n\t * designing a set of assets specifically for scale factor 0.75. Instead,\n\t * you can probably load the higher quality \"mdpi\" textures when a legacy\n\t * device is encountered where <code>ScreenDensityScaleFactorManager</code>\n\t * chooses a <code>contentScaleFactor</code> of 0.75. As long as the \"mdpi\"\n\t * textures are given a scale of 1 when they are created, Starling will know\n\t * how to automatically resize them on a device where the calculated\n\t * <code>contentScaleFactor</code> is lower than 1. Larger textures will\n\t * be automatically scaled down, and the app will look the same as it would\n\t * if you were using lower resolution textures. Your app will end up using a\n\t * bit more memory at runtime than strictly necessary on these devices, but\n\t * you won't need to include as many image files with your app, so its\n\t * download size will be smaller.</p>\n\t *\n\t * <p>Similarly, lower resolution textures can be scaled up on devices with\n\t * a higher <code>contentScaleFactor</code>. It is said that the human eye\n\t * starts to have difficulty perceiving every individual pixel when a\n\t * device's screen density is higher than 300 DPI. Depending on your app's\n\t * requirements, assets for scale factor 4 (and often, also scale factor 3)\n\t * may not be strictly necessary. You can often load assets for scale factor\n\t * 2 on these higher-density devices because the difference is so difficult\n\t * to see with the naked eye.</p>\n\t *\n\t * @see http://wiki.starling-framework.org/manual/multi-resolution_development Starling Multi-Resolution Development\n\t *\n\t * @productversion Feathers 2.2.0\n\t */\n\tpublic class ScreenDensityScaleFactorManager\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const IOS_TABLET_DENSITY_SCALE_FACTOR:Number = 1.23484848484848;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function ScreenDensityScaleFactorManager(starling:Starling)\n\t\t{\n\t\t\tthis._scaleSelector = new ScreenDensityScaleCalculator();\n\t\t\tthis._scaleSelector.addScaleForDensity(120, 0.75);\t//ldpi\n\t\t\tthis._scaleSelector.addScaleForDensity(160, 1);\t\t//mdpi\n\t\t\tthis._scaleSelector.addScaleForDensity(240, 1.5);\t//hdpi\n\t\t\tthis._scaleSelector.addScaleForDensity(320, 2);\t\t//xhdpi\n\t\t\tthis._scaleSelector.addScaleForDensity(480, 3);\t\t//xxhdpi\n\t\t\tthis._scaleSelector.addScaleForDensity(640, 4);\t\t//xxxhpi\n\n\t\t\tvar nativeStage:Stage = starling.nativeStage;\n\t\t\tthis._starling = starling;\n\t\t\tthis._calculatedScaleFactor = this.calculateScaleFactor();\n\t\t\tthis.updateStarlingStageDimensions();\n\t\t\t//this needs top priority because we don't want Starling's listener\n\t\t\t//to get this event first use have bad dimensions.\n\t\t\tnativeStage.addEventListener(Event.RESIZE, nativeStage_resizeHandler, false, int.MAX_VALUE, true);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _starling:Starling;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _calculatedScaleFactor:Number;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _scaleSelector:ScreenDensityScaleCalculator;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function calculateScaleFactor():Number\n\t\t{\n\t\t\t//if DeviceCapabilities.dpi has been customized, we assume that a\n\t\t\t//mobile device is being simulated. since Animate CC doesn't let you\n\t\t\t//customize Capabilities.screenDPI, and SystemUtil.isDesktop\n\t\t\t//incorrectly returns true when testing in Animate CC, this is a\n\t\t\t//hacky way to make it work for those who prefer to use Animate CC.\n\t\t\tif(SystemUtil.isDesktop && DeviceCapabilities.dpi == Capabilities.screenDPI)\n\t\t\t{\n\t\t\t\t//Starling will handle nativeStage.contentsScaleFactor\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tvar nativeStage:Stage = this._starling.nativeStage;\n\t\t\tvar screenDensity:Number = DeviceCapabilities.dpi;\n\t\t\tif(Capabilities.os.indexOf(\"tvOS\") != -1)\n\t\t\t{\n\t\t\t\t//tvOS devices report a lower DPI than Android TV devices\n\t\t\t\t//for the same resolution\n\t\t\t\tscreenDensity *= 2;\n\t\t\t}\n\t\t\telse if(Capabilities.version.indexOf(\"IOS\") != -1 &&\n\t\t\t\tDeviceCapabilities.isTablet(nativeStage))\n\t\t\t{\n\t\t\t\t//workaround because these rules derived from Android's behavior\n\t\t\t\t//would \"incorrectly\" give iPads a lower scale factor than iPhones\n\t\t\t\t//when both devices have the same scale factor natively.\n\t\t\t\tscreenDensity *= IOS_TABLET_DENSITY_SCALE_FACTOR;\n\t\t\t}\n\t\t\treturn this._scaleSelector.getScale(screenDensity);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function updateStarlingStageDimensions():void\n\t\t{\n\t\t\tvar nativeStage:Stage = this._starling.nativeStage;\n\t\t\tvar needsToBeDivisibleByTwo:Boolean = int(this._calculatedScaleFactor) != this._calculatedScaleFactor;\n\t\t\tvar starlingStageWidth:Number = int(nativeStage.stageWidth / this._calculatedScaleFactor);\n\t\t\tif(needsToBeDivisibleByTwo)\n\t\t\t{\n\t\t\t\tstarlingStageWidth = roundDownToNearest(starlingStageWidth, 2);\n\t\t\t}\n\t\t\tthis._starling.stage.stageWidth = starlingStageWidth;\n\t\t\tvar starlingStageHeight:Number = int(nativeStage.stageHeight / this._calculatedScaleFactor);\n\t\t\tif(needsToBeDivisibleByTwo)\n\t\t\t{\n\t\t\t\tstarlingStageHeight = roundDownToNearest(starlingStageHeight, 2);\n\t\t\t}\n\t\t\tthis._starling.stage.stageHeight = starlingStageHeight;\n\n\t\t\tvar viewPort:Rectangle = this._starling.viewPort;\n\t\t\tviewPort.width = starlingStageWidth * this._calculatedScaleFactor;\n\t\t\tviewPort.height = starlingStageHeight * this._calculatedScaleFactor;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tthis._starling.viewPort = viewPort;\n\t\t\t}\n\t\t\tcatch(error:Error) {}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function nativeStage_resizeHandler(event:Event):void\n\t\t{\n\t\t\tthis.updateStarlingStageDimensions();\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/utils/display/ScreenDensityScaleCalculator.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.display\n{\n\timport flash.errors.IllegalOperationError;\n\n\t/**\n\t * Selects a value for <code>contentScaleFactor</code> based on the screen\n\t * density (sometimes called DPI or PPI).\n\t *\n\t * @productversion Feathers 3.1.0\n\t */\n\tpublic class ScreenDensityScaleCalculator\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function ScreenDensityScaleCalculator()\n\t\t{\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _buckets:Vector.<ScreenDensityBucket> = new <ScreenDensityBucket>[];\n\n\t\t/**\n\t\t * Adds a new scale for the specified density.\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * selector.addScaleForDensity( 160, 1 );\n\t\t * selector.addScaleForDensity( 240, 1.5 );\n\t\t * selector.addScaleForDensity( 320, 2 );\n\t\t * selector.addScaleForDensity( 480, 3 );</listing>\n\t\t */\n\t\tpublic function addScaleForDensity(density:int, scale:Number):void\n\t\t{\n\t\t\tvar bucketCount:int = this._buckets.length;\n\t\t\tfor(var i:int = 0; i < bucketCount; i++)\n\t\t\t{\n\t\t\t\tvar bucket:ScreenDensityBucket = this._buckets[i];\n\t\t\t\tif(bucket.density > density)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(bucket.density == density)\n\t\t\t\t{\n\t\t\t\t\tthrow new ArgumentError(\"Screen density cannot be added more than once: \" + density);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._buckets.insertAt(i, new ScreenDensityBucket(density, scale));\n\t\t}\n\n\t\t/**\n\t\t * Removes a scale that was added with\n\t\t * <code>addScaleForDensity()</code>.\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * selector.addScaleForDensity( 320, 2 );\n\t\t * selector.removeScaleForDensity( 320 );</listing>\n\t\t */\n\t\tpublic function removeScaleForDensity(density:int):void\n\t\t{\n\t\t\tvar bucketCount:int = this._buckets.length;\n\t\t\tfor(var i:int = 0; i < bucketCount; i++)\n\t\t\t{\n\t\t\t\tvar bucket:ScreenDensityBucket = this._buckets[i];\n\t\t\t\tif(bucket.density == density)\n\t\t\t\t{\n\t\t\t\t\tthis._buckets.removeAt(i);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Returns the ideal <code>contentScaleFactor</code> value for the\n\t\t * specified density.\n\t\t */\n\t\tpublic function getScale(density:int):Number\n\t\t{\n\t\t\tif(this._buckets.length == 0)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Cannot choose scale because none have been added\");\n\t\t\t}\n\t\t\tvar bucket:ScreenDensityBucket = this._buckets[0];\n\t\t\tif(density <= bucket.density)\n\t\t\t{\n\t\t\t\treturn bucket.scale;\n\t\t\t}\n\t\t\tvar previousBucket:ScreenDensityBucket = bucket;\n\t\t\tvar bucketCount:int = this._buckets.length;\n\t\t\tfor(var i:int = 1; i < bucketCount; i++)\n\t\t\t{\n\t\t\t\tbucket = this._buckets[i];\n\t\t\t\tif(density > bucket.density)\n\t\t\t\t{\n\t\t\t\t\tpreviousBucket = bucket;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tvar midDPI:Number = (bucket.density + previousBucket.density) / 2;\n\t\t\t\tif(density < midDPI)\n\t\t\t\t{\n\t\t\t\t\treturn previousBucket.scale;\n\t\t\t\t}\n\t\t\t\treturn bucket.scale;\n\t\t\t}\n\t\t\treturn bucket.scale;\n\t\t}\n\t}\n}\n\nclass ScreenDensityBucket\n{\n\tpublic function ScreenDensityBucket(dpi:Number, scale:Number)\n\t{\n\t\tthis.density = dpi;\n\t\tthis.scale = scale;\n\t}\n\n\tpublic var density:Number;\n\tpublic var scale:Number;\n}"
  },
  {
    "path": "source/feathers/utils/display/calculateScaleRatioToFill.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.display\n{\n\t/**\n\t * Calculates a scale value to maintain aspect ratio and fill the required\n\t * bounds (with the possibility of cutting of the edges a bit).\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic function calculateScaleRatioToFill(originalWidth:Number, originalHeight:Number, targetWidth:Number, targetHeight:Number):Number\n\t{\n\t\tvar widthRatio:Number = targetWidth / originalWidth;\n\t\tvar heightRatio:Number = targetHeight / originalHeight;\n\t\tif(widthRatio > heightRatio)\n\t\t{\n\t\t\treturn widthRatio;\n\t\t}\n\t\treturn heightRatio;\n\t}\n}"
  },
  {
    "path": "source/feathers/utils/display/calculateScaleRatioToFit.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.display\n{\n\t/**\n\t * Calculates a scale value to maintain aspect ratio and fit inside the\n\t * required bounds (with the possibility of a bit of empty space on the\n\t * edges).\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic function calculateScaleRatioToFit(originalWidth:Number, originalHeight:Number, targetWidth:Number, targetHeight:Number):Number\n\t{\n\t\tvar widthRatio:Number = targetWidth / originalWidth;\n\t\tvar heightRatio:Number = targetHeight / originalHeight;\n\t\tif(widthRatio < heightRatio)\n\t\t{\n\t\t\treturn widthRatio;\n\t\t}\n\t\treturn heightRatio;\n\t}\n}"
  },
  {
    "path": "source/feathers/utils/display/getDisplayObjectDepthFromStage.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.display\n{\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * Calculates how many levels deep the target object is on the display list,\n\t * starting from the Starling stage. If the target object is the stage, the\n\t * depth will be <code>0</code>. A direct child of the stage will have a\n\t * depth of <code>1</code>, and it increases with each new level. If the\n\t * object does not have a reference to the stage, the depth will always be\n\t * <code>-1</code>, even if the object has a parent.\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic function getDisplayObjectDepthFromStage(target:DisplayObject):int\n\t{\n\t\tif(!target.stage)\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\t\tvar count:int = 0;\n\t\twhile(target.parent !== null)\n\t\t{\n\t\t\ttarget = target.parent;\n\t\t\tcount++;\n\t\t}\n\t\treturn count;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/utils/display/nativeToGlobal.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.display\n{\n\timport flash.geom.Point;\n\timport flash.geom.Rectangle;\n\n\timport starling.core.Starling;\n\n\t/**\n\t * Converts from native coordinates to Starling global coordinates.\n\t *\n\t * @productversion Feathers 3.5.0\n\t */\n\tpublic function nativeToGlobal(nativePosition:Point, starling:Starling = null, result:Point = null):Point\n\t{\n\t\tif(starling === null)\n\t\t{\n\t\t\tstarling = Starling.current;\n\t\t}\n\n\t\tvar nativeScaleFactor:Number = 1;\n\t\tif(starling.supportHighResolutions)\n\t\t{\n\t\t\tnativeScaleFactor = starling.nativeStage.contentsScaleFactor;\n\t\t}\n\t\tvar scaleFactor:Number = starling.contentScaleFactor / nativeScaleFactor;\n\n\t\tvar viewPort:Rectangle = starling.viewPort;\n\t\tvar resultX:Number = (nativePosition.x - viewPort.x) / scaleFactor;\n\t\tvar resultY:Number = (nativePosition.y - viewPort.y) / scaleFactor;\n\n\t\tif(result === null)\n\t\t{\n\t\t\tresult = new Point(resultX, resultY);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tresult.setTo(resultX, resultY);\n\t\t}\n\t\treturn result;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/utils/display/stageToStarling.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.display\n{\n\timport starling.core.Starling;\n\timport starling.display.Stage;\n\n\t/**\n\t * Finds the Starling instance that controls a particular\n\t * <code>starling.display.Stage</code>.\n\t *\n\t * @productversion Feathers 2.2.0\n\t */\n\tpublic function stageToStarling(stage:Stage):Starling\n\t{\n\t\tfor each(var starling:Starling in Starling.all)\n\t\t{\n\t\t\tif(starling.stage === stage)\n\t\t\t{\n\t\t\t\treturn starling;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/utils/focus/isBetterFocusForRelativePosition.as",
    "content": "/*\n * Copyright (C) 2007 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage feathers.utils.focus\n{\n\timport feathers.core.IFocusDisplayObject;\n\timport feathers.layout.RelativePosition;\n\n\timport flash.geom.Rectangle;\n\n\timport starling.utils.Pool;\n\n\t/**\n\t * Determines if <code>object1</code> is a better choice than\n\t * <code>object2</code> when changing focus to the specified position\n\t * relative to the current focus.\n\t *\n\t * <p>Note: it's acceptable pass in <code>null</code> for\n\t * <code>object2</code> to check if an item is at the relative position to\n\t * the focused rectangle.</p>\n\t *\n\t * @see feathers.layout.RelativePosition\n\t */\n\tpublic function isBetterFocusForRelativePosition(object1:IFocusDisplayObject, object2:IFocusDisplayObject, focusedRect:Rectangle, relativePosition:String):Boolean\n\t{\n\t\tvar rect:Rectangle = object1.getBounds(object1.stage, Pool.getRectangle());\n\n\t\tvar minPrimaryDistance1:Number = calculateMinPrimaryAxisDistanceForRelativePosition(focusedRect, rect, relativePosition);\n\t\tif(minPrimaryDistance1 == Number.POSITIVE_INFINITY)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tvar maxPrimaryDistance1:Number = calculateMaxPrimaryAxisDistanceForRelativePosition(focusedRect, rect, relativePosition);\n\t\tvar secondaryDistance1:Number = calculateSecondaryAxisDistanceForRelativePosition(focusedRect, rect, relativePosition);\n\t\tvar onSameAxis1:Boolean = itemsAreOnSameAxis(focusedRect, rect, relativePosition);\n\n\t\tif(object2 === null)\n\t\t{\n\t\t\tvar minPrimaryDistance2:Number = Number.POSITIVE_INFINITY;\n\t\t\tvar maxPrimaryDistance2:Number = Number.POSITIVE_INFINITY;\n\t\t\tvar secondaryDistance2:Number = Number.POSITIVE_INFINITY;\n\t\t\tvar onSameAxis2:Boolean = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tobject2.getBounds(object2.stage, rect);\n\t\t\tminPrimaryDistance2 = calculateMinPrimaryAxisDistanceForRelativePosition(focusedRect, rect, relativePosition);\n\t\t\tmaxPrimaryDistance2 = calculateMaxPrimaryAxisDistanceForRelativePosition(focusedRect, rect, relativePosition);\n\t\t\tsecondaryDistance2 = calculateSecondaryAxisDistanceForRelativePosition(focusedRect, rect, relativePosition);\n\t\t\tonSameAxis2 = itemsAreOnSameAxis(focusedRect, rect, relativePosition);\n\t\t}\n\n\t\tPool.putRectangle(rect);\n\n\t\tif(onSameAxis1 && onSameAxis2)\n\t\t{\n\t\t\t//if they're both on the same axis as the current focus,\n\t\t\t//choose the closer object (using minimum distances)\n\t\t\treturn minPrimaryDistance1 > 0 && minPrimaryDistance1 < minPrimaryDistance2;\n\t\t}\n\t\tvar isVertical:Boolean = relativePosition === RelativePosition.TOP || relativePosition === RelativePosition.BOTTOM;\n\t\tif(onSameAxis1)\n\t\t{\n\t\t\tif(isVertical)\n\t\t\t{\n\t\t\t\tif(minPrimaryDistance1 > 0 && minPrimaryDistance1 < maxPrimaryDistance2)\n\t\t\t\t{\n\t\t\t\t\t//as long as the min distance of 1 is closer than the\n\t\t\t\t\t//max distance of 2, it is a better focus\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t//however, we may prefer items that aren't on the same axis\n\t\t\t\t//to become focus, if they are close enough on the opposite\n\t\t\t\t//axis instead. only vertically, though.\n\t\t\t}\n\t\t\telse //horizontal\n\t\t\t{\n\t\t\t\t//since we read text horizontally before vertically, being\n\t\t\t\t//on the same axis horizontally always takes precedence.\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\telse if(onSameAxis2)\n\t\t{\n\t\t\t//see comments in previous condition above for details\n\t\t\tif(isVertical)\n\t\t\t{\n\t\t\t\tif(minPrimaryDistance2 > 0 && minPrimaryDistance2 < maxPrimaryDistance1)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse //horizontal\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t//neither is on the same axis as the current focus\n\t\t//(or one may be on the same axis vertically, but isn't closer than the other)\n\n\t\t//this is how android makes a best guess\n\t\tvar weightedDistance1:Number = 13 * minPrimaryDistance1 * minPrimaryDistance1 +\n\t\t\tsecondaryDistance1 * secondaryDistance1;\n\t\tvar weightedDistance2:Number = 13 * minPrimaryDistance2 * minPrimaryDistance2 +\n\t\t\tsecondaryDistance2 * secondaryDistance2;\n\t\treturn weightedDistance1 < weightedDistance2;\n\t}\n}\n\nimport feathers.layout.RelativePosition;\n\nimport flash.geom.Rectangle;\n\nfunction calculateSecondaryAxisDistanceForRelativePosition(globalRect1:Rectangle, globalRect2:Rectangle, position:String):Number\n{\n\tif(position === RelativePosition.TOP || position === RelativePosition.BOTTOM)\n\t{\n\t\treturn Math.abs((globalRect1.x + globalRect1.width / 2) - (globalRect2.x + globalRect2.width / 2));\n\t}\n\t//left or right\n\treturn Math.abs((globalRect1.y + globalRect1.height / 2) - (globalRect2.y + globalRect2.height / 2));\n}\n\nfunction calculateMaxPrimaryAxisDistanceForRelativePosition(globalRect1:Rectangle, globalRect2:Rectangle, position:String):Number\n{\n\tswitch(position)\n\t{\n\t\tcase RelativePosition.TOP:\n\t\t{\n\t\t\tif(globalRect1.bottom > globalRect2.bottom || globalRect1.y >= globalRect2.bottom)\n\t\t\t{\n\t\t\t\tvar result:Number = globalRect1.bottom - globalRect2.y;\n\t\t\t\tif(result > 0)\n\t\t\t\t{\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase RelativePosition.RIGHT:\n\t\t{\n\t\t\tif(globalRect1.x < globalRect2.x || globalRect1.right <= globalRect2.x)\n\t\t\t{\n\t\t\t\tresult = globalRect2.right - globalRect1.x;\n\t\t\t\tif(result > 0)\n\t\t\t\t{\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase RelativePosition.BOTTOM:\n\t\t{\n\t\t\tif(globalRect1.y < globalRect2.y || globalRect1.bottom <= globalRect2.y)\n\t\t\t{\n\t\t\t\tresult = globalRect2.bottom - globalRect1.y;\n\t\t\t\tif(result > 0)\n\t\t\t\t{\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase RelativePosition.LEFT:\n\t\t{\n\t\t\tif(globalRect1.right > globalRect2.right || globalRect1.x >= globalRect2.right)\n\t\t\t{\n\t\t\t\tresult = globalRect1.right - globalRect2.x;\n\t\t\t\tif(result > 0)\n\t\t\t\t{\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn Number.POSITIVE_INFINITY;\n}\n\nfunction calculateMinPrimaryAxisDistanceForRelativePosition(globalRect1:Rectangle, globalRect2:Rectangle, position:String):Number\n{\n\tswitch(position)\n\t{\n\t\tcase RelativePosition.TOP:\n\t\t{\n\t\t\tif(globalRect1.bottom > globalRect2.bottom || globalRect1.y >= globalRect2.bottom)\n\t\t\t{\n\t\t\t\tvar result:Number = globalRect1.bottom - globalRect2.bottom;\n\t\t\t\tif(result > 0)\n\t\t\t\t{\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase RelativePosition.RIGHT:\n\t\t{\n\t\t\tif(globalRect1.x < globalRect2.x || globalRect1.right <= globalRect2.x)\n\t\t\t{\n\t\t\t\tresult = globalRect2.x - globalRect1.x;\n\t\t\t\tif(result > 0)\n\t\t\t\t{\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase RelativePosition.BOTTOM:\n\t\t{\n\t\t\tif(globalRect1.y < globalRect2.y || globalRect1.bottom <= globalRect2.y)\n\t\t\t{\n\t\t\t\tresult = globalRect2.y - globalRect1.y;\n\t\t\t\tif(result > 0)\n\t\t\t\t{\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase RelativePosition.LEFT:\n\t\t{\n\t\t\tif(globalRect1.right > globalRect2.right || globalRect1.x >= globalRect2.right)\n\t\t\t{\n\t\t\t\tresult = globalRect1.right - globalRect2.right;\n\t\t\t\tif(result > 0)\n\t\t\t\t{\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn Number.POSITIVE_INFINITY;\n}\n\nfunction itemsAreOnSameAxis(globalRect1:Rectangle, globalRect2:Rectangle, position:String):Boolean\n{\n\tif(position === RelativePosition.TOP || position === RelativePosition.BOTTOM)\n\t{\n\t\treturn globalRect1.x <= globalRect2.right && globalRect2.x <= globalRect1.right;\n\t}\n\t//left or right\n\treturn globalRect1.y <= globalRect2.bottom && globalRect2.y <= globalRect1.bottom;\n}"
  },
  {
    "path": "source/feathers/utils/focus/isBetterFocusForRelativePosition_LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"{}\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright {yyyy} {name of copyright owner}\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License."
  },
  {
    "path": "source/feathers/utils/geom/matrixToRotation.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.geom\n{\n\timport flash.geom.Matrix;\n\n\t/**\n\t * Extracts the rotation value (in radians) from a <code>flash.geom.Matrix</code>\n\t *\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/geom/Matrix.html flash.geom.Matrix\n\t *\n\t * @productversion Feathers 1.2.0\n\t */\n\tpublic function matrixToRotation(matrix:Matrix):Number\n\t{\n\t\tvar c:Number = matrix.c;\n\t\tvar d:Number = matrix.d;\n\t\treturn -Math.atan(c / d);\n\t}\n}\n"
  },
  {
    "path": "source/feathers/utils/geom/matrixToScaleX.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.geom\n{\n\timport flash.geom.Matrix;\n\n\t/**\n\t * Extracts the x scale value from a <code>flash.geom.Matrix</code>\n\t *\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/geom/Matrix.html flash.geom.Matrix\n\t *\n\t * @productversion Feathers 1.2.0\n\t */\n\tpublic function matrixToScaleX(matrix:Matrix):Number\n\t{\n\t\tvar a:Number = matrix.a;\n\t\tvar b:Number = matrix.b;\n\t\treturn Math.sqrt(a * a + b * b);\n\t}\n}\n"
  },
  {
    "path": "source/feathers/utils/geom/matrixToScaleY.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.geom\n{\n\timport flash.geom.Matrix;\n\n\t/**\n\t * Extracts the y scale value from a <code>flash.geom.Matrix</code>\n\t *\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/geom/Matrix.html flash.geom.Matrix\n\t *\n\t * @productversion Feathers 1.2.0\n\t */\n\tpublic function matrixToScaleY(matrix:Matrix):Number\n\t{\n\t\tvar c:Number = matrix.c;\n\t\tvar d:Number = matrix.d;\n\t\treturn Math.sqrt(c * c + d * d);\n\t}\n}\n"
  },
  {
    "path": "source/feathers/utils/keyboard/KeyToEvent.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.keyboard\n{\n\timport feathers.core.DefaultFocusManager;\n\timport feathers.core.IFocusDisplayObject;\n\timport feathers.events.FeathersEventType;\n\timport feathers.system.DeviceCapabilities;\n\n\timport flash.ui.Keyboard;\n\n\timport starling.display.Stage;\n\timport starling.events.Event;\n\timport starling.events.KeyboardEvent;\n\n\t/**\n\t * Dispatches an event from the target when a key is pressed and released\n\t * and the target has focus. Conveniently handles all\n\t * <code>KeyboardEvent</code> listeners automatically.\n\t *\n\t * <p>In the following example, a custom item renderer will be triggered\n\t * when a key is pressed and released:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * public class CustomComponent extends FeathersControl implements IFocusDisplayObject\n\t * {\n\t *     public function CustomComponent()\n\t *     {\n\t *         super();\n\t *         this._keyToEvent = new KeyToEvent(this, Event.TRIGGERED);\n\t *         this._keyToEvent.keyCode = Keyboard.SPACE;\n\t *     }\n\t * \n\t *     private var _keyToEvent:KeyToEvent;\n\t * // ...</listing>\n\t *\n\t * @see feathers.utils.keyboard.KeyToTrigger\n\t * @see feathers.utils.keyboard.KeyToSelect\n\t *\n\t * @productversion Feathers 3.4.0\n\t */\n\tpublic class KeyToEvent\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function KeyToEvent(target:IFocusDisplayObject = null, keyCode:uint = Keyboard.SPACE, eventType:String = null)\n\t\t{\n\t\t\tthis.target = target;\n\t\t\tthis.keyCode = keyCode;\n\t\t\tthis.eventType = eventType;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _stage:Stage;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _target:IFocusDisplayObject;\n\n\t\t/**\n\t\t * The target component that should be selected when a key is pressed.\n\t\t */\n\t\tpublic function get target():IFocusDisplayObject\n\t\t{\n\t\t\treturn this._target;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set target(value:IFocusDisplayObject):void\n\t\t{\n\t\t\tif(this._target === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._stage !== null)\n\t\t\t{\n\t\t\t\t//if the target changes while the old target has focus, remove\n\t\t\t\t//the listeners to avoid possible errors\n\t\t\t\tthis._stage.removeEventListener(KeyboardEvent.KEY_DOWN, stage_keyDownHandler);\n\t\t\t\tthis._stage.removeEventListener(KeyboardEvent.KEY_UP, stage_keyUpHandler);\n\t\t\t\tthis._stage = null;\n\t\t\t}\n\t\t\tif(this._target !== null)\n\t\t\t{\n\t\t\t\tthis._target.removeEventListener(FeathersEventType.FOCUS_IN, target_focusInHandler);\n\t\t\t\tthis._target.removeEventListener(FeathersEventType.FOCUS_OUT, target_focusOutHandler);\n\t\t\t\tthis._target.removeEventListener(Event.REMOVED_FROM_STAGE, target_removedFromStageHandler);\n\t\t\t}\n\t\t\tthis._target = value;\n\t\t\tif(this._target !== null)\n\t\t\t{\n\t\t\t\tthis._target.addEventListener(FeathersEventType.FOCUS_IN, target_focusInHandler);\n\t\t\t\tthis._target.addEventListener(FeathersEventType.FOCUS_OUT, target_focusOutHandler);\n\t\t\t\tthis._target.addEventListener(Event.REMOVED_FROM_STAGE, target_removedFromStageHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _keyCode:uint = Keyboard.SPACE;\n\n\t\t/**\n\t\t * The key that will dispatch the event, when pressed.\n\t\t *\n\t\t * @default flash.ui.Keyboard.SPACE\n\t\t */\n\t\tpublic function get keyCode():uint\n\t\t{\n\t\t\treturn this._keyCode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set keyCode(value:uint):void\n\t\t{\n\t\t\tthis._keyCode = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _cancelKeyCode:uint = Keyboard.ESCAPE;\n\n\t\t/**\n\t\t * The key that will cancel the event if the key is down.\n\t\t *\n\t\t * @default flash.ui.Keyboard.ESCAPE\n\t\t */\n\t\tpublic function get cancelKeyCode():uint\n\t\t{\n\t\t\treturn this._cancelKeyCode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set cancelKeyCode(value:uint):void\n\t\t{\n\t\t\tthis._cancelKeyCode = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _keyLocation:uint = uint.MAX_VALUE;\n\n\t\t/**\n\t\t * The location of the key that will dispatch the event, when pressed.\n\t\t * If <code>uint.MAX_VALUE</code>, then any key location is allowed.\n\t\t *\n\t\t * @default uint.MAX_VALUE\n\t\t *\n\t\t * @see flash.ui.KeyLocation\n\t\t */\n\t\tpublic function get keyLocation():uint\n\t\t{\n\t\t\treturn this._keyLocation;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set keyLocation(value:uint):void\n\t\t{\n\t\t\tthis._keyLocation = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _eventType:String = null;\n\n\t\t/**\n\t\t * The event type that will be dispatched when pressed.\n\t\t */\n\t\tpublic function get eventType():String\n\t\t{\n\t\t\treturn this._eventType;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set eventType(value:String):void\n\t\t{\n\t\t\tthis._eventType = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isEnabled:Boolean = true;\n\n\t\t/**\n\t\t * May be set to <code>false</code> to disable event dispatching\n\t\t * temporarily until set back to <code>true</code>.\n\t\t */\n\t\tpublic function get isEnabled():Boolean\n\t\t{\n\t\t\treturn this._isEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isEnabled(value:Boolean):void\n\t\t{\n\t\t\tthis._isEnabled = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function target_focusInHandler(event:Event):void\n\t\t{\n\t\t\tvar focusManager:DefaultFocusManager = this._target.focusManager as DefaultFocusManager;\n\t\t\tthis._stage = this._target.stage;\n\t\t\tthis._stage.addEventListener(KeyboardEvent.KEY_DOWN, stage_keyDownHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function target_focusOutHandler(event:Event):void\n\t\t{\n\t\t\tif(this._stage !== null)\n\t\t\t{\n\t\t\t\tthis._stage.removeEventListener(KeyboardEvent.KEY_DOWN, stage_keyDownHandler);\n\t\t\t\tthis._stage.removeEventListener(KeyboardEvent.KEY_UP, stage_keyUpHandler);\n\t\t\t\tthis._stage = null;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function target_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tif(this._stage !== null)\n\t\t\t{\n\t\t\t\tthis._stage.removeEventListener(KeyboardEvent.KEY_DOWN, stage_keyDownHandler);\n\t\t\t\tthis._stage.removeEventListener(KeyboardEvent.KEY_UP, stage_keyUpHandler);\n\t\t\t\tthis._stage = null;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(event.currentTarget !== this._stage)\n\t\t\t{\n\t\t\t\t//Github issue #1762: the stage may have been set to null in a\n\t\t\t\t//previous KeyboardEvent.KEY_DOWN listener\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(event.keyCode == this._cancelKeyCode)\n\t\t\t{\n\t\t\t\tthis._stage.removeEventListener(KeyboardEvent.KEY_UP, stage_keyUpHandler);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(event.keyCode != this._keyCode)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._keyLocation != uint.MAX_VALUE &&\n\t\t\t\t!((event.keyLocation == this._keyLocation) || (this._keyLocation == 4 && DeviceCapabilities.simulateDPad)))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._stage.addEventListener(KeyboardEvent.KEY_UP, stage_keyUpHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_keyUpHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(event.keyCode != this._keyCode)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._keyLocation != uint.MAX_VALUE &&\n\t\t\t\t!((event.keyLocation == this._keyLocation) || (this._keyLocation == 4 && DeviceCapabilities.simulateDPad)))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar stage:Stage = Stage(event.currentTarget);\n\t\t\tstage.removeEventListener(KeyboardEvent.KEY_UP, stage_keyUpHandler);\n\t\t\tif(this._stage !== stage)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._target.dispatchEventWith(this._eventType);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/utils/keyboard/KeyToSelect.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.keyboard\n{\n\timport feathers.core.IFocusDisplayObject;\n\timport feathers.core.IToggle;\n\timport feathers.events.FeathersEventType;\n\timport feathers.system.DeviceCapabilities;\n\n\timport flash.ui.Keyboard;\n\n\timport starling.display.Stage;\n\timport starling.events.Event;\n\timport starling.events.KeyboardEvent;\n\n\t/**\n\t * Changes the <code>isSelected</code> property of the target when a key is\n\t * pressed and released while the target has focus. The target will\n\t * dispatch <code>Event.CHANGE</code>. Conveniently handles all\n\t * <code>KeyboardEvent</code> listeners automatically.\n\t *\n\t * <p>In the following example, a custom component will be selected when a\n\t * key is pressed and released:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * public class CustomComponent extends FeathersControl implements IFocusDisplayObject\n\t * {\n\t *     public function CustomComponent()\n\t *     {\n\t *         super();\n\t *         this._keyToSelect = new KeyToSelect(this);\n\t *         this._keyToSelect.keyCode = Keyboard.SPACE;\n\t *     }\n\t * \n\t *     private var _keyToSelect:KeyToSelect;\n\t * // ...</listing>\n\t *\n\t * <p>Note: When combined with a <code>KeyToTrigger</code> instance, the\n\t * <code>KeyToSelect</code> instance should be created second because\n\t * <code>Event.TRIGGERED</code> should be dispatched before\n\t * <code>Event.CHANGE</code>.</p>\n\t *\n\t * @see feathers.utils.keyboard.KeyToTrigger\n\t * @see feathers.utils.touch.TapToSelect\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class KeyToSelect\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function KeyToSelect(target:IToggle = null, keyCode:uint = Keyboard.SPACE)\n\t\t{\n\t\t\tthis.target = target;\n\t\t\tthis.keyCode = keyCode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _stage:Stage;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _target:IToggle;\n\n\t\t/**\n\t\t * The target component that should be selected when a key is pressed.\n\t\t */\n\t\tpublic function get target():IToggle\n\t\t{\n\t\t\treturn this._target;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set target(value:IToggle):void\n\t\t{\n\t\t\tif(this._target === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== null && !(value is IFocusDisplayObject))\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"Target of KeyToSelect must implement IFocusDisplayObject\");\n\t\t\t}\n\t\t\tif(this._stage !== null)\n\t\t\t{\n\t\t\t\t//if the target changes while the old target has focus, remove\n\t\t\t\t//the listeners to avoid possible errors\n\t\t\t\tthis._stage.removeEventListener(KeyboardEvent.KEY_DOWN, stage_keyDownHandler);\n\t\t\t\tthis._stage.removeEventListener(KeyboardEvent.KEY_UP, stage_keyUpHandler);\n\t\t\t\tthis._stage = null;\n\t\t\t}\n\t\t\tif(this._target !== null)\n\t\t\t{\n\t\t\t\tthis._target.removeEventListener(FeathersEventType.FOCUS_IN, target_focusInHandler);\n\t\t\t\tthis._target.removeEventListener(FeathersEventType.FOCUS_OUT, target_focusOutHandler);\n\t\t\t\tthis._target.removeEventListener(Event.REMOVED_FROM_STAGE, target_removedFromStageHandler);\n\t\t\t}\n\t\t\tthis._target = value;\n\t\t\tif(this._target !== null)\n\t\t\t{\n\t\t\t\tthis._target.addEventListener(FeathersEventType.FOCUS_IN, target_focusInHandler);\n\t\t\t\tthis._target.addEventListener(FeathersEventType.FOCUS_OUT, target_focusOutHandler);\n\t\t\t\tthis._target.addEventListener(Event.REMOVED_FROM_STAGE, target_removedFromStageHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _keyCode:uint = Keyboard.SPACE;\n\n\t\t/**\n\t\t * The key that will select the target, when pressed.\n\t\t *\n\t\t * @default flash.ui.Keyboard.SPACE\n\t\t */\n\t\tpublic function get keyCode():uint\n\t\t{\n\t\t\treturn this._keyCode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set keyCode(value:uint):void\n\t\t{\n\t\t\tthis._keyCode = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _cancelKeyCode:uint = Keyboard.ESCAPE;\n\n\t\t/**\n\t\t * The key that will cancel the selection if the key is down.\n\t\t *\n\t\t * @default flash.ui.Keyboard.ESCAPE\n\t\t */\n\t\tpublic function get cancelKeyCode():uint\n\t\t{\n\t\t\treturn this._cancelKeyCode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set cancelKeyCode(value:uint):void\n\t\t{\n\t\t\tthis._cancelKeyCode = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _keyToDeselect:Boolean = false;\n\n\t\t/**\n\t\t * May be set to <code>true</code> to allow the target to be deselected\n\t\t * when the key is pressed.\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic function get keyToDeselect():Boolean\n\t\t{\n\t\t\treturn this._keyToDeselect;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set keyToDeselect(value:Boolean):void\n\t\t{\n\t\t\tthis._keyToDeselect = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _keyLocation:uint = uint.MAX_VALUE;\n\n\t\t/**\n\t\t * The location of the key that will select the target, when pressed.\n\t\t * If <code>uint.MAX_VALUE</code>, then any key location is allowed.\n\t\t *\n\t\t * @default uint.MAX_VALUE\n\t\t *\n\t\t * @see flash.ui.KeyLocation\n\t\t */\n\t\tpublic function get keyLocation():uint\n\t\t{\n\t\t\treturn this._keyLocation;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set keyLocation(value:uint):void\n\t\t{\n\t\t\tthis._keyLocation = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isEnabled:Boolean = true;\n\n\t\t/**\n\t\t * May be set to <code>false</code> to disable selection temporarily\n\t\t * until set back to <code>true</code>.\n\t\t */\n\t\tpublic function get isEnabled():Boolean\n\t\t{\n\t\t\treturn this._isEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isEnabled(value:Boolean):void\n\t\t{\n\t\t\tthis._isEnabled = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function target_focusInHandler(event:Event):void\n\t\t{\n\t\t\tthis._stage = this._target.stage;\n\t\t\tthis._stage.addEventListener(KeyboardEvent.KEY_DOWN, stage_keyDownHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function target_focusOutHandler(event:Event):void\n\t\t{\n\t\t\tif(this._stage !== null)\n\t\t\t{\n\t\t\t\tthis._stage.removeEventListener(KeyboardEvent.KEY_DOWN, stage_keyDownHandler);\n\t\t\t\tthis._stage.removeEventListener(KeyboardEvent.KEY_UP, stage_keyUpHandler);\n\t\t\t\tthis._stage = null;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function target_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tif(this._stage !== null)\n\t\t\t{\n\t\t\t\tthis._stage.removeEventListener(KeyboardEvent.KEY_DOWN, stage_keyDownHandler);\n\t\t\t\tthis._stage.removeEventListener(KeyboardEvent.KEY_UP, stage_keyUpHandler);\n\t\t\t\tthis._stage = null;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(event.currentTarget !== this._stage)\n\t\t\t{\n\t\t\t\t//Github issue #1762: the stage may have been set to null in a\n\t\t\t\t//previous KeyboardEvent.KEY_DOWN listener\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(event.keyCode == this._cancelKeyCode)\n\t\t\t{\n\t\t\t\tthis._stage.removeEventListener(KeyboardEvent.KEY_UP, stage_keyUpHandler);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(event.keyCode != this._keyCode)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._keyLocation != uint.MAX_VALUE &&\n\t\t\t\t!((event.keyLocation == this._keyLocation) || (this._keyLocation == 4 && DeviceCapabilities.simulateDPad)))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._stage.addEventListener(KeyboardEvent.KEY_UP, stage_keyUpHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_keyUpHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(event.keyCode != this._keyCode)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._keyLocation != uint.MAX_VALUE &&\n\t\t\t\t!((event.keyLocation == this._keyLocation) || (this._keyLocation == 4 && DeviceCapabilities.simulateDPad)))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar stage:Stage = Stage(event.currentTarget);\n\t\t\tstage.removeEventListener(KeyboardEvent.KEY_UP, stage_keyUpHandler);\n\t\t\tif(this._stage !== stage)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._keyToDeselect)\n\t\t\t{\n\t\t\t\tthis._target.isSelected = !this._target.isSelected;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._target.isSelected = true;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/utils/keyboard/KeyToState.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.keyboard\n{\n\timport feathers.controls.ButtonState;\n\timport feathers.core.IFocusDisplayObject;\n\timport feathers.core.IStateContext;\n\timport feathers.events.FeathersEventType;\n\timport feathers.system.DeviceCapabilities;\n\n\timport flash.ui.Keyboard;\n\n\timport starling.display.Stage;\n\timport starling.events.Event;\n\timport starling.events.KeyboardEvent;\n\n\t/**\n\t * Changes a target's state when a key is pressed or released on the\n\t * keyboard. Conveniently handles all <code>KeyboardEvent</code> listeners\n\t * automatically.\n\t *\n\t * @see feathers.utils.touch.TouchToState\n\t *\n\t * @productversion Feathers 3.2.0\n\t */\n\tpublic class KeyToState\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function KeyToState(target:IFocusDisplayObject = null, callback:Function = null)\n\t\t{\n\t\t\tthis.target = target;\n\t\t\tthis.callback = callback;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _stage:Stage;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _hasFocus:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _target:IFocusDisplayObject;\n\n\t\t/**\n\t\t * The target component that should change state when a key is pressed\n\t\t * or released.\n\t\t */\n\t\tpublic function get target():IFocusDisplayObject\n\t\t{\n\t\t\treturn this._target;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set target(value:IFocusDisplayObject):void\n\t\t{\n\t\t\tif(this._target === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== null && !(value is IFocusDisplayObject))\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"Target of KeyToState must implement IFocusDisplayObject\");\n\t\t\t}\n\t\t\tif(this._stage !== null)\n\t\t\t{\n\t\t\t\t//if the target changes while the old target has focus, remove\n\t\t\t\t//the listeners to avoid possible errors\n\t\t\t\tthis._stage.removeEventListener(KeyboardEvent.KEY_DOWN, stage_keyDownHandler);\n\t\t\t\tthis._stage.removeEventListener(KeyboardEvent.KEY_UP, stage_keyUpHandler);\n\t\t\t\tthis._stage = null;\n\t\t\t}\n\t\t\tif(this._target !== null)\n\t\t\t{\n\t\t\t\tthis._target.removeEventListener(FeathersEventType.FOCUS_IN, target_focusInHandler);\n\t\t\t\tthis._target.removeEventListener(FeathersEventType.FOCUS_OUT, target_focusOutHandler);\n\t\t\t\tthis._target.removeEventListener(Event.REMOVED_FROM_STAGE, target_removedFromStageHandler);\n\t\t\t}\n\t\t\tthis._target = value;\n\t\t\tif(this._target !== null)\n\t\t\t{\n\t\t\t\tthis._currentState = this._upState;\n\t\t\t\tthis._target.addEventListener(FeathersEventType.FOCUS_IN, target_focusInHandler);\n\t\t\t\tthis._target.addEventListener(FeathersEventType.FOCUS_OUT, target_focusOutHandler);\n\t\t\t\tthis._target.addEventListener(Event.REMOVED_FROM_STAGE, target_removedFromStageHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _callback:Function;\n\n\t\t/**\n\t\t * The function to call when the state is changed.\n\t\t *\n\t\t * <p>The callback is expected to have the following signature:</p>\n\t\t * <pre>function(currentState:String):void</pre>\n\t\t */\n\t\tpublic function get callback():Function\n\t\t{\n\t\t\treturn this._callback;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set callback(value:Function):void\n\t\t{\n\t\t\tif(this._callback === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._callback = value;\n\t\t\tif(this._callback !== null)\n\t\t\t{\n\t\t\t\tthis._callback(this._currentState);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _keyCode:uint = Keyboard.SPACE;\n\n\t\t/**\n\t\t * The key that will change the state of the target, when pressed.\n\t\t *\n\t\t * @default flash.ui.Keyboard.SPACE\n\t\t */\n\t\tpublic function get keyCode():uint\n\t\t{\n\t\t\treturn this._keyCode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set keyCode(value:uint):void\n\t\t{\n\t\t\tthis._keyCode = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _cancelKeyCode:uint = Keyboard.ESCAPE;\n\n\t\t/**\n\t\t * The key that will cancel the state change if the key is down.\n\t\t *\n\t\t * @default flash.ui.Keyboard.ESCAPE\n\t\t */\n\t\tpublic function get cancelKeyCode():uint\n\t\t{\n\t\t\treturn this._cancelKeyCode;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set cancelKeyCode(value:uint):void\n\t\t{\n\t\t\tthis._cancelKeyCode = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _keyLocation:uint = uint.MAX_VALUE;\n\n\t\t/**\n\t\t * The location of the key that will change the state, when pressed.\n\t\t * If <code>uint.MAX_VALUE</code>, then any key location is allowed.\n\t\t *\n\t\t * @default uint.MAX_VALUE\n\t\t *\n\t\t * @see flash.ui.KeyLocation\n\t\t */\n\t\tpublic function get keyLocation():uint\n\t\t{\n\t\t\treturn this._keyLocation;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set keyLocation(value:uint):void\n\t\t{\n\t\t\tthis._keyLocation = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isEnabled:Boolean = true;\n\n\t\t/**\n\t\t * May be set to <code>false</code> to disable state changes temporarily\n\t\t * until set back to <code>true</code>.\n\t\t */\n\t\tpublic function get isEnabled():Boolean\n\t\t{\n\t\t\treturn this._isEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isEnabled(value:Boolean):void\n\t\t{\n\t\t\tthis._isEnabled = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentState:String = ButtonState.UP;\n\n\t\t/**\n\t\t * The current state of the utility. May be different than the state\n\t\t * of the target.\n\t\t */\n\t\tpublic function get currentState():String\n\t\t{\n\t\t\treturn this._currentState;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _upState:String = ButtonState.UP;\n\n\t\t/**\n\t\t * The value for the \"up\" state.\n\t\t *\n\t\t * @default feathers.controls.ButtonState.UP\n\t\t */\n\t\tpublic function get upState():String\n\t\t{\n\t\t\treturn this._upState;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set upState(value:String):void\n\t\t{\n\t\t\tthis._upState = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _downState:String = ButtonState.DOWN;\n\n\t\t/**\n\t\t * The value for the \"down\" state.\n\t\t *\n\t\t * @default feathers.controls.ButtonState.DOWN\n\t\t */\n\t\tpublic function get downState():String\n\t\t{\n\t\t\treturn this._downState;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set downState(value:String):void\n\t\t{\n\t\t\tthis._downState = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function changeState(value:String):void\n\t\t{\n\t\t\tvar oldState:String = this._currentState;\n\t\t\tif(this._target is IStateContext)\n\t\t\t{\n\t\t\t\toldState = IStateContext(this._target).currentState;\n\t\t\t}\n\t\t\tthis._currentState = value;\n\t\t\tif(oldState === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._callback !== null)\n\t\t\t{\n\t\t\t\tthis._callback(value);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function focusOut():void\n\t\t{\n\t\t\tthis._hasFocus = false;\n\t\t\tif(this._stage !== null)\n\t\t\t{\n\t\t\t\tthis._stage.removeEventListener(KeyboardEvent.KEY_DOWN, stage_keyDownHandler);\n\t\t\t\tthis._stage.removeEventListener(KeyboardEvent.KEY_UP, stage_keyUpHandler);\n\t\t\t\tthis._stage = null;\n\t\t\t}\n\t\t\tthis.changeState(this._upState);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function target_focusInHandler(event:Event):void\n\t\t{\n\t\t\tthis._hasFocus = true;\n\t\t\tthis._stage = this._target.stage;\n\t\t\tthis._stage.addEventListener(KeyboardEvent.KEY_DOWN, stage_keyDownHandler);\n\n\t\t\t//don't change the state on focus in because the state may be\n\t\t\t//managed by another utility\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function target_focusOutHandler(event:Event):void\n\t\t{\n\t\t\tthis.focusOut();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function target_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tthis.focusOut();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_keyDownHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(event.currentTarget !== this._stage)\n\t\t\t{\n\t\t\t\t//Github issue #1762: the stage may have been set to null in a\n\t\t\t\t//previous KeyboardEvent.KEY_DOWN listener\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(event.keyCode == this._cancelKeyCode)\n\t\t\t{\n\t\t\t\tthis._stage.removeEventListener(KeyboardEvent.KEY_UP, stage_keyUpHandler);\n\t\t\t\tthis.changeState(this._upState);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(event.keyCode != this._keyCode)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._keyLocation != uint.MAX_VALUE &&\n\t\t\t\t!((event.keyLocation == this._keyLocation) || (this._keyLocation == 4 && DeviceCapabilities.simulateDPad)))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._stage.addEventListener(KeyboardEvent.KEY_UP, stage_keyUpHandler);\n\t\t\tthis.changeState(this._downState);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stage_keyUpHandler(event:KeyboardEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(event.keyCode != this._keyCode)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._keyLocation != uint.MAX_VALUE &&\n\t\t\t\t!((event.keyLocation == this._keyLocation) || (this._keyLocation == 4 && DeviceCapabilities.simulateDPad)))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar stage:Stage = Stage(event.currentTarget);\n\t\t\tstage.removeEventListener(KeyboardEvent.KEY_UP, stage_keyUpHandler);\n\t\t\tif(this._stage !== stage)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.changeState(this._upState);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/utils/keyboard/KeyToTrigger.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.keyboard\n{\n\timport feathers.core.IFocusDisplayObject;\n\n\timport flash.ui.Keyboard;\n\n\timport starling.events.Event;\n\n\t/**\n\t * Dispatches <code>Event.TRIGGERED</code> from the target when a key is\n\t * pressed and released and the target has focus. Conveniently handles all\n\t * <code>KeyboardEvent</code> listeners automatically.\n\t *\n\t * <p>In the following example, a custom item renderer will be triggered\n\t * when a key is pressed and released:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * public class CustomComponent extends FeathersControl implements IFocusDisplayObject\n\t * {\n\t *     public function CustomComponent()\n\t *     {\n\t *         super();\n\t *         this._keyToTrigger = new KeyToTrigger(this);\n\t *         this._keyToTrigger.keyCode = Keyboard.ENTER;\n\t *     }\n\t * \n\t *     private var _keyToTrigger:KeyToTrigger;\n\t * // ...</listing>\n\t *\n\t * <p>Note: When combined with a <code>KeyToSelect</code> instance, the\n\t * <code>KeyToTrigger</code> instance should be created first because\n\t * <code>Event.TRIGGERED</code> should be dispatched before\n\t * <code>Event.CHANGE</code>.</p>\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/events/Event.html#TRIGGERED starling.events.Event.TRIGGERED\n\t * @see feathers.utils.keyboard.KeyToSelect\n\t * @see feathers.utils.touch.TapToTrigger\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class KeyToTrigger extends KeyToEvent\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function KeyToTrigger(target:IFocusDisplayObject = null, keyCode:uint = Keyboard.SPACE)\n\t\t{\n\t\t\tsuper(target, keyCode, Event.TRIGGERED);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/utils/math/clamp.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.math\n{\n\t/**\n\t * Forces a numeric value into a specified range.\n\t *\n\t * @param value\t\tThe value to force into the range.\n\t * @param minimum\tThe minimum bound of the range.\n\t * @param maximum\tThe maximum bound of the range.\n\t * @return\t\t\tA value within the specified range.\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic function clamp(value:Number, minimum:Number, maximum:Number):Number\n\t{\n\t\tif(minimum > maximum)\n\t\t{\n\t\t\tthrow new ArgumentError(\"minimum should be smaller than maximum.\");\n\t\t}\n\t\tif(value < minimum)\n\t\t{\n\t\t\tvalue = minimum;\n\t\t}\n\t\telse if(value > maximum)\n\t\t{\n\t\t\tvalue = maximum;\n\t\t}\n\t\treturn value;\n\t}\n}"
  },
  {
    "path": "source/feathers/utils/math/roundDownToNearest.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.math\n{\n\t/**\n\t * Rounds a Number <em>down</em> to the nearest multiple of an input. For example, by rounding\n\t * 16 down to the nearest 10, you will receive 10. Similar to the built-in function Math.floor().\n\t *\n\t * @param\tnumberToRound\t\tthe number to round down\n\t * @param\tnearest\t\t\t\tthe number whose mutiple must be found\n\t * @return\tthe rounded number\n\t *\n\t * @see Math#floor\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic function roundDownToNearest(number:Number, nearest:Number = 1):Number\n\t{\n\t\tif(nearest == 0)\n\t\t{\n\t\t\treturn number;\n\t\t}\n\t\treturn Math.floor(roundToPrecision(number / nearest, 10)) * nearest;\n\t}\n}"
  },
  {
    "path": "source/feathers/utils/math/roundToNearest.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.math\n{\n\t/**\n\t * Rounds a Number to the nearest multiple of an input. For example, by rounding\n\t * 16 to the nearest 10, you will receive 20. Similar to the built-in function Math.round().\n\t *\n\t * @param\tnumberToRound\t\tthe number to round\n\t * @param\tnearest\t\t\t\tthe number whose mutiple must be found\n\t * @return\tthe rounded number\n\t *\n\t * @see Math#round\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic function roundToNearest(number:Number, nearest:Number = 1):Number\n\t{\n\t\tif(nearest == 0)\n\t\t{\n\t\t\treturn number;\n\t\t}\n\t\tvar roundedNumber:Number = Math.round(roundToPrecision(number / nearest, 10)) * nearest;\n\t\treturn roundToPrecision(roundedNumber, 10);\n\t}\n}"
  },
  {
    "path": "source/feathers/utils/math/roundToPrecision.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.math\n{\n\t/**\n\t * Rounds a number to a certain level of precision. Useful for limiting the number of\n\t * decimal places on a fractional number.\n\t *\n\t * @param\t\tnumber\t\tthe input number to round.\n\t * @param\t\tprecision\tthe number of decimal digits to keep\n\t * @return\t\tthe rounded number, or the original input if no rounding is needed\n\t *\n\t * @see Math#round\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic function roundToPrecision(number:Number, precision:int = 0):Number\n\t{\n\t\tvar decimalPlaces:Number = Math.pow(10, precision);\n\t\treturn Math.round(decimalPlaces * number) / decimalPlaces;\n\t}\n}"
  },
  {
    "path": "source/feathers/utils/math/roundUpToNearest.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.math\n{\n\t/**\n\t * Rounds a Number <em>up</em> to the nearest multiple of an input. For example, by rounding\n\t * 16 up to the nearest 10, you will receive 20. Similar to the built-in function Math.ceil().\n\t *\n\t * @param\tnumberToRound\t\tthe number to round up\n\t * @param\tnearest\t\t\t\tthe number whose mutiple must be found\n\t * @return\tthe rounded number\n\t *\n\t * @see Math#ceil\n\t *\n\t * @productversion Feathers 1.0.0\n\t */\n\tpublic function roundUpToNearest(number:Number, nearest:Number = 1):Number\n\t{\n\t\tif(nearest == 0)\n\t\t{\n\t\t\treturn number;\n\t\t}\n\t\treturn Math.ceil(roundToPrecision(number / nearest, 10)) * nearest;\n\t}\n}"
  },
  {
    "path": "source/feathers/utils/skins/resetFluidChildDimensionsForMeasurement.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.skins\n{\n\timport feathers.core.IMeasureDisplayObject;\n\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * Updates the dimensions of a component's for measurement if the child\n\t * should fill the entire width and height of its parent.\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic function resetFluidChildDimensionsForMeasurement(child:DisplayObject,\n\t\tparentExplicitWidth:Number, parentExplicitHeight:Number,\n\t\tparentExplicitMinWidth:Number, parentExplicitMinHeight:Number,\n\t\tparentExplicitMaxWidth:Number, parentExplicitMaxHeight:Number,\n\t\tchildExplicitWidth:Number, childExplicitHeight:Number,\n\t\tchildExplicitMinWidth:Number, childExplicitMinHeight:Number,\n\t\tchildExplicitMaxWidth:Number, childExplicitMaxHeight:Number):void\n\t{\n\t\tif(child === null)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tvar needsWidth:Boolean = parentExplicitWidth !== parentExplicitWidth; //isNaN\n\t\tvar needsHeight:Boolean = parentExplicitHeight !== parentExplicitHeight; //isNaN\n\t\tif(needsWidth)\n\t\t{\n\t\t\tchild.width = childExplicitWidth;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tchild.width = parentExplicitWidth;\n\t\t}\n\t\tif(needsHeight)\n\t\t{\n\t\t\tchild.height = childExplicitHeight;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tchild.height = parentExplicitHeight;\n\t\t}\n\t\tvar measureChild:IMeasureDisplayObject = child as IMeasureDisplayObject;\n\t\tif(measureChild !== null)\n\t\t{\n\t\t\tvar childMinWidth:Number = parentExplicitMinWidth;\n\t\t\t//for some reason, if we do the !== check on a local variable right\n\t\t\t//here, compiling with the flex 4.6 SDK will throw a VerifyError\n\t\t\t//for a stack overflow.\n\t\t\t//we could change the !== check back to isNaN() instead, but\n\t\t\t//isNaN() can allocate an object that needs garbage collection.\n\t\t\tcompilerWorkaround = childMinWidth;\n\t\t\tif(childMinWidth !== childMinWidth || //isNaN\n\t\t\t\tchildExplicitMinWidth > childMinWidth)\n\t\t\t{\n\t\t\t\tchildMinWidth = childExplicitMinWidth;\n\t\t\t}\n\t\t\tmeasureChild.minWidth = childMinWidth;\n\t\t\tvar childMinHeight:Number = parentExplicitMinHeight;\n\t\t\tcompilerWorkaround = childMinHeight;\n\t\t\tif(childMinHeight !== childMinHeight || //isNaN\n\t\t\t\tchildExplicitMinHeight > childMinHeight)\n\t\t\t{\n\t\t\t\tchildMinHeight = childExplicitMinHeight;\n\t\t\t}\n\t\t\tmeasureChild.minHeight = childMinHeight;\n\n\t\t\tvar childMaxWidth:Number = parentExplicitMaxWidth;\n\t\t\tcompilerWorkaround = childMaxWidth;\n\t\t\tif(childMaxWidth !== childMaxWidth || //isNaN\n\t\t\t\tchildExplicitMaxWidth < childMaxWidth)\n\t\t\t{\n\t\t\t\tchildMaxWidth = childExplicitMaxWidth;\n\t\t\t}\n\t\t\tmeasureChild.maxWidth = childMaxWidth;\n\t\t\tvar childMaxHeight:Number = parentExplicitMaxHeight;\n\t\t\tcompilerWorkaround = childMaxHeight;\n\t\t\tif(childMaxHeight !== childMaxHeight || //isNaN\n\t\t\t\tchildExplicitMaxHeight < childMaxHeight)\n\t\t\t{\n\t\t\t\tchildMaxHeight = childExplicitMaxHeight;\n\t\t\t}\n\t\t\tmeasureChild.maxHeight = childMaxHeight;\n\t\t}\n\t}\n}\n\nvar compilerWorkaround:Object;"
  },
  {
    "path": "source/feathers/utils/text/TextEditorIMEClient.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.text\n{\n\timport feathers.core.IIMETextEditor;\n\n\timport flash.display.Sprite;\n\timport flash.events.IMEEvent;\n\timport flash.geom.Rectangle;\n\timport flash.text.ime.CompositionAttributeRange;\n\timport flash.text.ime.IIMEClient;\n\n\timport starling.core.Starling;\n\timport starling.display.Stage;\n\n\t/**\n\t * @private\n\t *\n\t * @productversion Feathers 3.0.0\n\t */\n\tpublic class TextEditorIMEClient extends Sprite implements IIMEClient\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function TextEditorIMEClient(textEditor:IIMETextEditor, startCallback:Function,\n\t\t\tupdateCallback:Function, confirmCallback:Function)\n\t\t{\n\t\t\tsuper();\n\t\t\tthis._textEditor = textEditor;\n\t\t\tthis._startCallback = startCallback;\n\t\t\tthis._updateCallback = updateCallback;\n\t\t\tthis._confirmCallback = confirmCallback;\n\t\t\tthis.addEventListener(IMEEvent.IME_START_COMPOSITION, imeStartCompositionHandler);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _textEditor:IIMETextEditor;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _startCallback:Function;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _updateCallback:Function;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _confirmCallback:Function;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _compositionStartIndex:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _compositionEndIndex:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get verticalTextLayout():Boolean\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get compositionStartIndex():int\n\t\t{\n\t\t\treturn this._compositionStartIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get compositionEndIndex():int\n\t\t{\n\t\t\treturn this._compositionEndIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get selectionAnchorIndex():int\n\t\t{\n\t\t\treturn this._textEditor.selectionAnchorIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function get selectionActiveIndex():int\n\t\t{\n\t\t\treturn this._textEditor.selectionActiveIndex;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function getTextBounds(startIndex:int, endIndex:int):Rectangle\n\t\t{\n\t\t\tvar stage:Stage = this._textEditor.stage;\n\t\t\tif(stage === null)\n\t\t\t{\n\t\t\t\treturn new Rectangle();\n\t\t\t}\n\t\t\tvar result:Rectangle = this._textEditor.getBounds(stage);\n\t\t\tvar starling:Starling = this._textEditor.stage !== null ? this._textEditor.stage.starling : Starling.current;\n\t\t\tvar nativeScaleFactor:Number = 1;\n\t\t\tif(starling.supportHighResolutions)\n\t\t\t{\n\t\t\t\tnativeScaleFactor = starling.nativeStage.contentsScaleFactor;\n\t\t\t}\n\t\t\tvar scaleFactor:Number = starling.contentScaleFactor / nativeScaleFactor;\n\t\t\tresult.x *= scaleFactor;\n\t\t\tresult.y *= scaleFactor;\n\t\t\tresult.width *= scaleFactor;\n\t\t\tresult.height *= scaleFactor;\n\t\t\tvar viewPort:Rectangle = starling.viewPort;\n\t\t\tresult.x += viewPort.x;\n\t\t\tresult.y += viewPort.y;\n\t\t\treturn result;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function confirmComposition(text:String = null, preserveSelection:Boolean = false):void\n\t\t{\n\t\t\tthis._confirmCallback(text, preserveSelection);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function updateComposition(text:String, attributes:Vector.<CompositionAttributeRange>, compositionStartIndex:int, compositionEndIndex:int):void\n\t\t{\n\t\t\tthis._compositionStartIndex = compositionStartIndex;\n\t\t\tthis._compositionEndIndex = compositionEndIndex;\n\t\t\tthis._updateCallback(text, attributes, compositionStartIndex, compositionEndIndex);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function selectRange(startIndex:int, endIndex:int):void\n\t\t{\n\t\t\tthis._textEditor.selectRange(startIndex, endIndex);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function getTextInRange(startIndex:int, endIndex:int):String\n\t\t{\n\t\t\treturn this._textEditor.text.substring(startIndex, endIndex);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function imeStartCompositionHandler(event:IMEEvent):void\n\t\t{\n\t\t\tevent.imeClient = this;\n\t\t\tthis._startCallback();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/utils/text/TextInputNavigation.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.text\n{\n\t/**\n\t * Functions for navigating text inputs with the keyboard.\n\t *\n\t * @productversion Feathers 2.0.0\n\t */\n\tpublic class TextInputNavigation\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const IS_WORD:RegExp = /\\w/;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const IS_WHITESPACE:RegExp = /\\s/;\n\n\t\t/**\n\t\t * Finds the start index of the word that starts before the selection.\n\t\t */\n\t\tpublic static function findPreviousWordStartIndex(text:String, selectionStartIndex:int):int\n\t\t{\n\t\t\tif(selectionStartIndex <= 0)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tvar nextCharIsWord:Boolean = IS_WORD.test(text.charAt(selectionStartIndex - 1));\n\t\t\tfor(var i:int = selectionStartIndex - 2; i >= 0; i--)\n\t\t\t{\n\t\t\t\tvar charIsWord:Boolean = IS_WORD.test(text.charAt(i));\n\t\t\t\tif(!charIsWord && nextCharIsWord)\n\t\t\t\t{\n\t\t\t\t\treturn i + 1;\n\t\t\t\t}\n\t\t\t\tnextCharIsWord = charIsWord;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * Finds the start index of the word that starts with the current\n\t\t * selection. If the current selection is in the whitespace between\n\t\t * words, returns the start index of the previous word.\n\t\t */\n\t\tpublic static function findCurrentWordStartIndex(text:String, selectionStartIndex:int):int\n\t\t{\n\t\t\tif(selectionStartIndex <= 0)\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tvar nextCharIsWord:Boolean = IS_WORD.test(text.charAt(selectionStartIndex + 1));\n\t\t\tfor(var i:int = selectionStartIndex; i >= 0; i--)\n\t\t\t{\n\t\t\t\tvar charIsWord:Boolean = IS_WORD.test(text.charAt(i));\n\t\t\t\tif(!charIsWord && i == selectionStartIndex)\n\t\t\t\t{\n\t\t\t\t\t//this is whitespace between words\n\t\t\t\t\treturn findPreviousWordStartIndex(text, selectionStartIndex);\n\t\t\t\t}\n\t\t\t\tif(!charIsWord && nextCharIsWord)\n\t\t\t\t{\n\t\t\t\t\treturn i + 1;\n\t\t\t\t}\n\t\t\t\tnextCharIsWord = charIsWord;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * Finds the end index of the word that starts with the current\n\t\t * selection. If the current selection is in the whitespace between\n\t\t * words, returns the end index of the next word.\n\t\t */\n\t\tpublic static function findCurrentWordEndIndex(text:String, selectionEndIndex:int):int\n\t\t{\n\t\t\tvar textLength:int = text.length;\n\t\t\tif(selectionEndIndex >= textLength - 1)\n\t\t\t{\n\t\t\t\treturn textLength;\n\t\t\t}\n\t\t\tfor(var i:int = selectionEndIndex; i < textLength; i++)\n\t\t\t{\n\t\t\t\tvar charIsWord:Boolean = IS_WORD.test(text.charAt(i));\n\t\t\t\tif(!charIsWord && i == selectionEndIndex)\n\t\t\t\t{\n\t\t\t\t\t//this is whitespace between words\n\t\t\t\t\tvar nextStart:int = findNextWordStartIndex(text, selectionEndIndex);\n\t\t\t\t\treturn findCurrentWordEndIndex(text, nextStart);\n\t\t\t\t}\n\t\t\t\tif(!charIsWord)\n\t\t\t\t{\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn textLength;\n\t\t}\n\n\t\t/**\n\t\t * Finds the start index of the next word that starts after the\n\t\t * selection.\n\t\t */\n\t\tpublic static function findNextWordStartIndex(text:String, selectionEndIndex:int):int\n\t\t{\n\t\t\tvar textLength:int = text.length;\n\t\t\tif(selectionEndIndex >= textLength - 1)\n\t\t\t{\n\t\t\t\treturn textLength;\n\t\t\t}\n\t\t\t//the first character is a special case. any non-whitespace is\n\t\t\t//considered part of the word.\n\t\t\tvar prevCharIsWord:Boolean = !IS_WHITESPACE.test(text.charAt(selectionEndIndex));\n\t\t\tfor(var i:int = selectionEndIndex + 1; i < textLength; i++)\n\t\t\t{\n\t\t\t\tvar charIsWord:Boolean = IS_WORD.test(text.charAt(i));\n\t\t\t\tif(charIsWord && !prevCharIsWord)\n\t\t\t\t{\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t\tprevCharIsWord = charIsWord;\n\t\t\t}\n\t\t\treturn textLength;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/utils/text/TextInputRestrict.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.text\n{\n\timport flash.utils.Dictionary;\n\n\t/**\n\t * Duplicates the functionality of the <code>restrict</code> property on\n\t * <code>flash.text.TextField</code>.\n\t *\n\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#restrict Full description of flash.text.TextField.restrict in Adobe's Flash Platform API Reference\n\t */\n\tpublic class TextInputRestrict\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const REQUIRES_ESCAPE:Dictionary = new Dictionary();\n\t\tREQUIRES_ESCAPE[/\\[/g] = \"\\\\[\";\n\t\tREQUIRES_ESCAPE[/\\]/g] = \"\\\\]\";\n\t\tREQUIRES_ESCAPE[/\\{/g] = \"\\\\{\";\n\t\tREQUIRES_ESCAPE[/\\}/g] = \"\\\\}\";\n\t\tREQUIRES_ESCAPE[/\\(/g] = \"\\\\(\";\n\t\tREQUIRES_ESCAPE[/\\)/g] = \"\\\\)\";\n\t\tREQUIRES_ESCAPE[/\\|/g] = \"\\\\|\";\n\t\tREQUIRES_ESCAPE[/\\//g] = \"\\\\/\";\n\t\tREQUIRES_ESCAPE[/\\./g] = \"\\\\.\";\n\t\tREQUIRES_ESCAPE[/\\+/g] = \"\\\\+\";\n\t\tREQUIRES_ESCAPE[/\\*/g] = \"\\\\*\";\n\t\tREQUIRES_ESCAPE[/\\?/g] = \"\\\\?\";\n\t\tREQUIRES_ESCAPE[/\\$/g] = \"\\\\$\";\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function TextInputRestrict(restrict:String = null)\n\t\t{\n\t\t\tthis.restrict = restrict;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _restrictStartsWithExclude:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _restricts:Vector.<RegExp>;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprivate var _restrict:String;\n\n\t\t/**\n\t\t * Indicates the set of characters that a user can input.\n\t\t *\n\t\t * <p>In the following example, the text is restricted to numbers:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * object.restrict = \"0-9\";</listing>\n\t\t *\n\t\t * @default null\n\t\t *\n\t\t * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#restrict Full description of flash.text.TextField.restrict in Adobe's Flash Platform API Reference\n\t\t */\n\t\tpublic function get restrict():String\n\t\t{\n\t\t\treturn this._restrict;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set restrict(value:String):void\n\t\t{\n\t\t\tif(this._restrict === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._restrict = value;\n\t\t\tif(value)\n\t\t\t{\n\t\t\t\tif(this._restricts)\n\t\t\t\t{\n\t\t\t\t\tthis._restricts.length = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._restricts = new <RegExp>[];\n\t\t\t\t}\n\t\t\t\tif(this._restrict === \"\")\n\t\t\t\t{\n\t\t\t\t\tthis._restricts.push(/^$/);\n\t\t\t\t}\n\t\t\t\telse if(this._restrict)\n\t\t\t\t{\n\t\t\t\t\tvar startIndex:int = 0;\n\t\t\t\t\tvar isExcluding:Boolean = value.indexOf(\"^\") == 0;\n\t\t\t\t\tthis._restrictStartsWithExclude = isExcluding;\n\t\t\t\t\tdo\n\t\t\t\t\t{\n\t\t\t\t\t\tvar nextStartIndex:int = value.indexOf(\"^\", startIndex + 1);\n\t\t\t\t\t\twhile(nextStartIndex != -1 && value.charAt(nextStartIndex - 1) === \"\\\\\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//this is an escaped caret, so skip it\n\t\t\t\t\t\t\tnextStartIndex = value.indexOf(\"^\", nextStartIndex + 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(nextStartIndex >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar partialRestrict:String = value.substr(startIndex, nextStartIndex - startIndex);\n\t\t\t\t\t\t\tthis._restricts.push(this.createRestrictRegExp(partialRestrict, isExcluding));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpartialRestrict = value.substr(startIndex);\n\t\t\t\t\t\t\tthis._restricts.push(this.createRestrictRegExp(partialRestrict, isExcluding));\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstartIndex = nextStartIndex;\n\t\t\t\t\t\tisExcluding = !isExcluding;\n\t\t\t\t\t}\n\t\t\t\t\twhile(true);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._restricts = null;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Accepts a character code and determines if it is allowed or not.\n\t\t */\n\t\tpublic function isCharacterAllowed(charCode:int):Boolean\n\t\t{\n\t\t\tif(!this._restricts)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tvar character:String = String.fromCharCode(charCode);\n\t\t\tvar isExcluding:Boolean = this._restrictStartsWithExclude;\n\t\t\tvar isIncluded:Boolean = isExcluding;\n\t\t\tvar restrictCount:int = this._restricts.length;\n\t\t\tfor(var i:int = 0; i < restrictCount; i++)\n\t\t\t{\n\t\t\t\tvar restrict:RegExp = this._restricts[i];\n\t\t\t\tif(isExcluding)\n\t\t\t\t{\n\t\t\t\t\tisIncluded = isIncluded && restrict.test(character);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tisIncluded = isIncluded || restrict.test(character);\n\t\t\t\t}\n\t\t\t\tisExcluding = !isExcluding;\n\t\t\t}\n\t\t\treturn isIncluded;\n\t\t}\n\n\t\t/**\n\t\t * Accepts a string of characters and filters out characters that are\n\t\t * not allowed.\n\t\t */\n\t\tpublic function filterText(value:String):String\n\t\t{\n\t\t\tif(!this._restricts)\n\t\t\t{\n\t\t\t\treturn value;\n\t\t\t}\n\t\t\tvar textLength:int = value.length;\n\t\t\tvar restrictCount:int = this._restricts.length;\n\t\t\tfor(var i:int = 0; i < textLength; i++)\n\t\t\t{\n\t\t\t\tvar character:String = value.charAt(i);\n\t\t\t\tvar isExcluding:Boolean = this._restrictStartsWithExclude;\n\t\t\t\tvar isIncluded:Boolean = isExcluding;\n\t\t\t\tfor(var j:int = 0; j < restrictCount; j++)\n\t\t\t\t{\n\t\t\t\t\tvar restrict:RegExp = this._restricts[j];\n\t\t\t\t\tif(isExcluding)\n\t\t\t\t\t{\n\t\t\t\t\t\tisIncluded = isIncluded && restrict.test(character);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tisIncluded = isIncluded || restrict.test(character);\n\t\t\t\t\t}\n\t\t\t\t\tisExcluding = !isExcluding;\n\t\t\t\t}\n\t\t\t\tif(!isIncluded)\n\t\t\t\t{\n\t\t\t\t\tvalue = value.substr(0, i) + value.substr(i + 1);\n\t\t\t\t\ti--;\n\t\t\t\t\ttextLength--;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function createRestrictRegExp(restrict:String, isExcluding:Boolean):RegExp\n\t\t{\n\t\t\tif(!isExcluding && restrict.indexOf(\"^\") == 0)\n\t\t\t{\n\t\t\t\t//unlike regular expressions, which always treat ^ as excluding,\n\t\t\t\t//restrict uses ^ to swap between excluding and including.\n\t\t\t\t//if we're including, we need to remove ^ for the regexp\n\t\t\t\trestrict = restrict.substr(1);\n\t\t\t}\n\t\t\t//we need to do backslash first. otherwise, we'll get duplicates.\n\t\t\t//however, skip backslashes that are escaping -, ^, and \\.\n\t\t\trestrict = restrict.replace(/\\\\(?=[^\\-\\^\\\\])/g, \"\\\\\\\\\");\n\t\t\tfor(var key:Object in REQUIRES_ESCAPE)\n\t\t\t{\n\t\t\t\tvar keyRegExp:RegExp = key as RegExp;\n\t\t\t\tvar value:String = REQUIRES_ESCAPE[keyRegExp] as String;\n\t\t\t\trestrict = restrict.replace(keyRegExp, value);\n\t\t\t}\n\t\t\treturn new RegExp(\"[\" + restrict + \"]\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/utils/textures/TextureCache.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.textures\n{\n\timport flash.errors.IllegalOperationError;\n\n\timport starling.textures.Texture;\n\n\t/**\n\t * Caches textures in memory. Each texture may be saved with its own key,\n\t * such as the URL where the original image file is located.\n\t *\n\t * <p><strong>Note:</strong> Most developers will only need to create a\n\t * <code>TextureCache</code>, pass it to multiple <code>ImageLoader</code>\n\t * components, and dispose the cache when finished. APIs to retain and\n\t * release textures are meant to be used by <code>ImageLoader</code>.</p>\n\t *\n\t * <p>A single <code>TextureCache</code> may be passed to multiple\n\t * <code>ImageLoader</code> components using the <code>textureCache</code>\n\t * property:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var cache:TextureCache = new TextureCache();\n\t * loader1.textureCache = cache;\n\t * loader2.textureCache = cache;</listing>\n\t *\n\t * <p>Don't forget to dispose the <code>TextureCache</code> when it is no\n\t * longer needed -- to avoid memory leaks:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * cache.dispose();</listing>\n\t *\n\t * <p>To use a TextureCache in a <code>List</code> or\n\t * <code>GroupedList</code> with the default item renderer, pass the cache\n\t * to the <code>ImageLoader</code> components using the\n\t * <code>iconLoaderFactory</code> or\n\t * <code>accessoryLoaderFactory</code>:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * var cache:TextureCache = new TextureCache();\n\t * list.itemRendererFactory = function():IListItemRenderer\n\t * {\n\t *     var itemRenderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\t *     itemRenderer.iconLoaderFactory = function():ImageLoader\n\t *     {\n\t *         var loader:ImageLoader = new ImageLoader();\n\t *         loader.textureCache = cache;\n\t *         return loader;\n\t *     };\n\t *     return itemRenderer;\n\t * };</listing>\n\t *\n\t * @see feathers.controls.ImageLoader#textureCache\n\t *\n\t * @productversion Feathers 2.3.0\n\t */\n\tpublic class TextureCache\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function TextureCache(maxUnretainedTextures:int = int.MAX_VALUE)\n\t\t{\n\t\t\tthis._maxUnretainedTextures = maxUnretainedTextures;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _unretainedKeys:Vector.<String> = new <String>[];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _unretainedTextures:Object = {};\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _retainedTextures:Object = {};\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _retainCounts:Object = {};\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _maxUnretainedTextures:int;\n\n\t\t/**\n\t\t * Limits the number of unretained textures that may be stored in\n\t\t * memory. The textures retained least recently will be disposed if\n\t\t * there are too many.\n\t\t */\n\t\tpublic function get maxUnretainedTextures():int\n\t\t{\n\t\t\treturn this._maxUnretainedTextures;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set maxUnretainedTextures(value:int):void\n\t\t{\n\t\t\tif(this._maxUnretainedTextures == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._maxUnretainedTextures = value;\n\t\t\tif(this._unretainedKeys.length > value)\n\t\t\t{\n\t\t\t\tthis.trimCache();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Disposes the texture cache, including all textures (even if they are\n\t\t * retained).\n\t\t */\n\t\tpublic function dispose():void\n\t\t{\n\t\t\tfor each(var texture:Texture in this._unretainedTextures)\n\t\t\t{\n\t\t\t\ttexture.dispose();\n\t\t\t}\n\t\t\tfor each(texture in this._retainedTextures)\n\t\t\t{\n\t\t\t\ttexture.dispose();\n\t\t\t}\n\t\t\tthis._retainedTextures = null;\n\t\t\tthis._unretainedTextures = null;\n\t\t\tthis._retainCounts = null;\n\t\t}\n\n\t\t/**\n\t\t * Saves a texture, and associates it with a specific key.\n\t\t *\n\t\t * @see #removeTexture()\n\t\t * @see #hasTexture()\n\t\t */\n\t\tpublic function addTexture(key:String, texture:Texture, retainTexture:Boolean = true):void\n\t\t{\n\t\t\tif(!this._retainedTextures)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Cannot add a texture after the cache has been disposed.\");\n\t\t\t}\n\t\t\tif(key in this._unretainedTextures || key in this._retainedTextures)\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"Key \\\"\" + key + \"\\\" already exists in the cache.\");\n\t\t\t}\n\t\t\tif(retainTexture)\n\t\t\t{\n\t\t\t\tthis._retainedTextures[key] = texture;\n\t\t\t\tthis._retainCounts[key] = 1 as int;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._unretainedTextures[key] = texture;\n\t\t\tthis._unretainedKeys[this._unretainedKeys.length] = key;\n\t\t\tif(this._unretainedKeys.length > this._maxUnretainedTextures)\n\t\t\t{\n\t\t\t\tthis.trimCache();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Removes a specific key from the cache, and optionally disposes the\n\t\t * texture associated with the key.\n\t\t *\n\t\t * @see #addTexture()\n\t\t */\n\t\tpublic function removeTexture(key:String, dispose:Boolean = false):void\n\t\t{\n\t\t\tif(!this._unretainedTextures)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar texture:Texture = this._unretainedTextures[key] as Texture;\n\t\t\tif(texture)\n\t\t\t{\n\t\t\t\tthis.removeUnretainedKey(key);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttexture = this._retainedTextures[key] as Texture;\n\t\t\t\tdelete this._retainedTextures[key];\n\t\t\t\tdelete this._retainCounts[key];\n\t\t\t}\n\t\t\tif(dispose && texture)\n\t\t\t{\n\t\t\t\ttexture.dispose();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Indicates if a texture is associated with the specified key.\n\t\t */\n\t\tpublic function hasTexture(key:String):Boolean\n\t\t{\n\t\t\tif(!this._retainedTextures)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn key in this._retainedTextures || key in this._unretainedTextures;\n\t\t}\n\n\t\t/**\n\t\t * Returns how many times the texture associated with the specified key\n\t\t * has currently been retained.\n\t\t */\n\t\tpublic function getRetainCount(key:String):int\n\t\t{\n\t\t\tif(this._retainCounts && (key in this._retainCounts))\n\t\t\t{\n\t\t\t\treturn this._retainCounts[key] as int;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t/**\n\t\t * Gets the texture associated with the specified key, and increments\n\t\t * the retain count for the texture. Always remember to call\n\t\t * <code>releaseTexture()</code> when finished with a retained texture.\n\t\t *\n\t\t * @see #releaseTexture()\n\t\t */\n\t\tpublic function retainTexture(key:String):Texture\n\t\t{\n\t\t\tif(!this._retainedTextures)\n\t\t\t{\n\t\t\t\tthrow new IllegalOperationError(\"Cannot retain a texture after the cache has been disposed.\");\n\t\t\t}\n\t\t\tif(key in this._retainedTextures)\n\t\t\t{\n\t\t\t\tvar count:int = this._retainCounts[key] as int;\n\t\t\t\tcount++;\n\t\t\t\tthis._retainCounts[key] = count;\n\t\t\t\treturn Texture(this._retainedTextures[key]);\n\t\t\t}\n\n\t\t\tif(!(key in this._unretainedTextures))\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"Texture with key \\\"\" + key + \"\\\" cannot be retained because it has not been added to the cache.\");\n\t\t\t}\n\t\t\tvar texture:Texture = Texture(this._unretainedTextures[key]);\n\t\t\tthis.removeUnretainedKey(key);\n\t\t\tthis._retainedTextures[key] = texture;\n\t\t\tthis._retainCounts[key] = 1 as int;\n\t\t\treturn texture;\n\t\t}\n\n\t\t/**\n\t\t * Releases a retained texture.\n\t\t *\n\t\t * @see #retainTexture()\n\t\t */\n\t\tpublic function releaseTexture(key:String):void\n\t\t{\n\t\t\tif(!this._retainedTextures || !(key in this._retainedTextures))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar count:int = this._retainCounts[key] as int;\n\t\t\tcount--;\n\t\t\tif(count == 0)\n\t\t\t{\n\t\t\t\t//get the existing texture\n\t\t\t\tvar texture:Texture = Texture(this._retainedTextures[key]);\n\n\t\t\t\t//remove from retained\n\t\t\t\tdelete this._retainCounts[key];\n\t\t\t\tdelete this._retainedTextures[key];\n\n\t\t\t\tthis._unretainedTextures[key] = texture;\n\t\t\t\tthis._unretainedKeys[this._unretainedKeys.length] = key;\n\t\t\t\tif(this._unretainedKeys.length > this._maxUnretainedTextures)\n\t\t\t\t{\n\t\t\t\t\tthis.trimCache();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis._retainCounts[key] = count;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function removeUnretainedKey(key:String):void\n\t\t{\n\t\t\tvar index:int = this._unretainedKeys.indexOf(key);\n\t\t\tif(index < 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._unretainedKeys.removeAt(index);\n\t\t\tdelete this._unretainedTextures[key];\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function trimCache():void\n\t\t{\n\t\t\tvar currentCount:int = this._unretainedKeys.length;\n\t\t\tvar maxCount:int = this._maxUnretainedTextures;\n\t\t\twhile(currentCount > maxCount)\n\t\t\t{\n\t\t\t\tvar key:String = this._unretainedKeys.shift();\n\t\t\t\tvar texture:Texture = Texture(this._unretainedTextures[key]);\n\t\t\t\ttexture.dispose();\n\t\t\t\tdelete this._unretainedTextures[key];\n\t\t\t\tcurrentCount--;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/utils/textures/calculateSnapshotTextureDimensions.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.textures\n{\n\timport flash.geom.Point;\n\n\timport starling.utils.MathUtil;\n\n\t/**\n\t * Calculates the dimensions of the texture needed to display an item with\n\t * the specified width and height, accepting a maximum where the snapshot\n\t * must be split into multiple textures. If Starling's profile is\n\t * <code>Context3DProfile.BASELINE_CONSTRAINED</code>, will calculate\n\t * power-of-two dimensions for the texture.\n\t *\n\t * @productversion Feathers 3.1.0\n\t */\n\tpublic function calculateSnapshotTextureDimensions(width:Number, height:Number, maximum:Number, supportsRectangleTexture:Boolean, result:Point = null):Point\n\t{\n\t\tvar snapshotWidth:Number = width;\n\t\tvar snapshotHeight:Number = height;\n\t\tif(!supportsRectangleTexture)\n\t\t{\n\t\t\tif(snapshotWidth > maximum)\n\t\t\t{\n\t\t\t\tsnapshotWidth = int(snapshotWidth / maximum) * maximum + MathUtil.getNextPowerOfTwo(snapshotWidth % maximum);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tsnapshotWidth = MathUtil.getNextPowerOfTwo(snapshotWidth);\n\t\t\t}\n\t\t}\n\t\telse if(snapshotWidth > maximum)\n\t\t{\n\t\t\tsnapshotWidth = int(snapshotWidth / maximum) * maximum + (snapshotWidth % maximum);\n\t\t}\n\t\tif(!supportsRectangleTexture)\n\t\t{\n\t\t\tif(snapshotHeight > maximum)\n\t\t\t{\n\t\t\t\tsnapshotHeight = int(snapshotHeight / maximum) * maximum + MathUtil.getNextPowerOfTwo(snapshotHeight % maximum);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tsnapshotHeight = MathUtil.getNextPowerOfTwo(snapshotHeight);\n\t\t\t}\n\t\t}\n\t\telse if(snapshotHeight > maximum)\n\t\t{\n\t\t\tsnapshotHeight = int(snapshotHeight / maximum) * maximum + (snapshotHeight % maximum);\n\t\t}\n\t\tif(result === null)\n\t\t{\n\t\t\tresult = new Point(snapshotWidth, snapshotHeight);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tresult.setTo(snapshotWidth, snapshotHeight);\n\t\t}\n\t\treturn result;\n\t}\n}\n"
  },
  {
    "path": "source/feathers/utils/touch/DelayedDownTouchToState.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.touch\n{\n\timport feathers.controls.ButtonState;\n\n\timport flash.events.TimerEvent;\n\timport flash.utils.Timer;\n\n\timport starling.display.DisplayObject;\n\n\t/**\n\t * Similar to <code>TouchToState</code>, but delays the \"down\" state by a\n\t * specified number of seconds. Useful for delayed state changes in\n\t * scrolling containers.\n\t *\n\t * @productversion Feathers 3.2.0\n\t */\n\tpublic class DelayedDownTouchToState extends TouchToState\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function DelayedDownTouchToState(target:DisplayObject = null, callback:Function = null)\n\t\t{\n\t\t\tsuper(target, callback);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function set target(value:DisplayObject):void\n\t\t{\n\t\t\tsuper.target = value;\n\t\t\tif(this._target === null && this._stateDelayTimer !== null)\n\t\t\t{\n\t\t\t\tif(this._stateDelayTimer.running)\n\t\t\t\t{\n\t\t\t\t\tthis._stateDelayTimer.stop();\n\t\t\t\t}\n\t\t\t\tthis._stateDelayTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, stateDelayTimer_timerCompleteHandler);\n\t\t\t\tthis._stateDelayTimer = null;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _delayedCurrentState:String;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _stateDelayTimer:Timer;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _delay:Number = 0.25;\n\n\t\t/**\n\t\t * The time, in seconds, to delay the state.\n\t\t *\n\t\t * @default 0.25\n\t\t */\n\t\tpublic function get delay():Number\n\t\t{\n\t\t\treturn this._delay;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set delay(value:Number):void\n\t\t{\n\t\t\tthis._delay = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function changeState(value:String):void\n\t\t{\n\t\t\tif(this._stateDelayTimer && this._stateDelayTimer.running)\n\t\t\t{\n\t\t\t\tthis._delayedCurrentState = value;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(value === ButtonState.DOWN)\n\t\t\t{\n\t\t\t\tif(this._currentState === value)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._delayedCurrentState = value;\n\t\t\t\tif(this._stateDelayTimer)\n\t\t\t\t{\n\t\t\t\t\tthis._stateDelayTimer.reset();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis._stateDelayTimer = new Timer(this._delay * 1000, 1);\n\t\t\t\t\tthis._stateDelayTimer.addEventListener(TimerEvent.TIMER_COMPLETE, stateDelayTimer_timerCompleteHandler);\n\t\t\t\t}\n\t\t\t\tthis._stateDelayTimer.start();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsuper.changeState(value);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function stateDelayTimer_timerCompleteHandler(event:TimerEvent):void\n\t\t{\n\t\t\tsuper.changeState(this._delayedCurrentState);\n\t\t\tthis._delayedCurrentState = null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/utils/touch/LongPress.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.touch\n{\n\timport feathers.events.FeathersEventType;\n\n\timport flash.geom.Point;\n\timport flash.utils.getTimer;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.DisplayObjectContainer;\n\timport starling.display.Stage;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.utils.Pool;\n\n\t/**\n\t * Dispatches <code>FeathersEventType.LONG_PRESS</code> from the target when\n\t * the target is long-pressed. Conveniently handles all\n\t * <code>TouchEvent</code> listeners automatically. Useful for custom item\n\t * renderers that should dispatch a long press event.\n\t *\n\t * <p>In the following example, a custom item renderer will dispatch\n\t * a long press event when tapped:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * public class CustomItemRenderer extends LayoutGroupListItemRenderer\n\t * {\n\t *     public function CustomItemRenderer()\n\t *     {\n\t *         super();\n\t *         this._longPress = new LongPress(this);\n\t *     }\n\t * \n\t *     private var _longPress:LongPress;\n\t * }</listing>\n\t *\n\t * <p>Note: When combined with <code>TapToSelect</code> or\n\t * <code>TapToTrigger</code>, the <code>LongPress</code> instance should be\n\t * created first because it needs a higher priority for the\n\t * <code>TouchEvent.TOUCH</code> event so that it can disable the other\n\t * events.</p>\n\t *\n\t * @see feathers.events.FeathersEventType.LONG_PRESS\n\t * @see feathers.utils.touch.TapToTrigger\n\t * @see feathers.utils.touch.TapToSelect\n\t *\n\t * @productversion Feathers 2.3.0\n\t */\n\tpublic class LongPress\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function LongPress(target:DisplayObject = null)\n\t\t{\n\t\t\tthis.target = target;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _target:DisplayObject;\n\n\t\t/**\n\t\t * The target component that should dispatch\n\t\t * <code>FeathersEventType.LONG_PRESS</code> when tapped.\n\t\t */\n\t\tpublic function get target():DisplayObject\n\t\t{\n\t\t\treturn this._target;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set target(value:DisplayObject):void\n\t\t{\n\t\t\tif(this._target == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._target)\n\t\t\t{\n\t\t\t\tthis._target.removeEventListener(TouchEvent.TOUCH, target_touchHandler);\n\t\t\t\tthis._target.removeEventListener(Event.ENTER_FRAME, target_enterFrameHandler);\n\t\t\t}\n\t\t\tthis._target = value;\n\t\t\tif(this._target)\n\t\t\t{\n\t\t\t\t//if we're changing targets, and a touch is active, we want to\n\t\t\t\t//clear it.\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t\tthis._target.addEventListener(TouchEvent.TOUCH, target_touchHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _longPressDuration:Number = 0.5;\n\n\t\t/**\n\t\t * The duration, in seconds, of a long press.\n\t\t *\n\t\t * <p>The following example changes the long press duration to one full second:</p>\n\t\t *\n\t\t * <listing version=\"3.0\">\n\t\t * longPress.longPressDuration = 1.0;</listing>\n\t\t *\n\t\t * @default 0.5\n\t\t */\n\t\tpublic function get longPressDuration():Number\n\t\t{\n\t\t\treturn this._longPressDuration;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set longPressDuration(value:Number):void\n\t\t{\n\t\t\tthis._longPressDuration = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _touchPointID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _touchLastGlobalPosition:Point = new Point();\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _touchBeginTime:int;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isEnabled:Boolean = true;\n\n\t\t/**\n\t\t * May be set to <code>false</code> to disable the triggered event\n\t\t * temporarily until set back to <code>true</code>.\n\t\t */\n\t\tpublic function get isEnabled():Boolean\n\t\t{\n\t\t\treturn this._isEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isEnabled(value:Boolean):void\n\t\t{\n\t\t\tif(this._isEnabled === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isEnabled = value;\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _tapToTrigger:TapToTrigger;\n\n\t\t/**\n\t\t * If the target can be triggered by tapping, the\n\t\t * <code>TapToTrigger</code> instance should be passed in so that it can\n\t\t * be temporarily disabled when a long press is detected.\n\t\t */\n\t\tpublic function get tapToTrigger():TapToTrigger\n\t\t{\n\t\t\treturn this._tapToTrigger;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set tapToTrigger(value:TapToTrigger):void\n\t\t{\n\t\t\tthis._tapToTrigger = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _tapToSelect:TapToSelect;\n\n\t\t/**\n\t\t * If the target can be selected by tapping, the\n\t\t * <code>TapToSelect</code> instance should be passed in so that it can\n\t\t * be temporarily disabled when a long press is detected.\n\t\t */\n\t\tpublic function get tapToSelect():TapToSelect\n\t\t{\n\t\t\treturn this._tapToSelect;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set tapToSelect(value:TapToSelect):void\n\t\t{\n\t\t\tthis._tapToSelect = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customHitTest:Function;\n\n\t\t/**\n\t\t * In addition to a normal call to <code>hitTest()</code>, a custom\n\t\t * function may impose additional rules that determine if the target\n\t\t * should be long pressed. Called on <code>TouchPhase.BEGAN</code>.\n\t\t *\n\t\t * <p>The function must have the following signature:</p>\n\t\t *\n\t\t * <pre>function(localPosition:Point):Boolean;</pre>\n\t\t *\n\t\t * <p>The function should return <code>true</code> if the target should\n\t\t * be long pressed, and <code>false</code> if it should not be\n\t\t * long pressed.</p>\n\t\t */\n\t\tpublic function get customHitTest():Function\n\t\t{\n\t\t\treturn this._customHitTest;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customHitTest(value:Function):void\n\t\t{\n\t\t\tthis._customHitTest = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function target_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this._touchPointID >= 0)\n\t\t\t{\n\t\t\t\t//a touch has begun, so we'll ignore all other touches.\n\t\t\t\tvar touch:Touch = event.getTouch(this._target, null, this._touchPointID);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\t//this should not happen.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif(touch.phase == TouchPhase.MOVED)\n\t\t\t\t{\n\t\t\t\t\tthis._touchLastGlobalPosition.x = touch.globalX;\n\t\t\t\t\tthis._touchLastGlobalPosition.y = touch.globalY;\n\t\t\t\t}\n\t\t\t\telse if(touch.phase == TouchPhase.ENDED)\n\t\t\t\t{\n\t\t\t\t\tthis._target.removeEventListener(Event.ENTER_FRAME, target_enterFrameHandler);\n\n\t\t\t\t\t//re-enable the other events\n\t\t\t\t\tif(this._tapToTrigger)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._tapToTrigger.isEnabled = true;\n\t\t\t\t\t}\n\t\t\t\t\tif(this._tapToSelect)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._tapToSelect.isEnabled = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t//the touch has ended, so now we can start watching for a\n\t\t\t\t\t//new one.\n\t\t\t\t\tthis._touchPointID = -1;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//we aren't tracking another touch, so let's look for a new one.\n\t\t\t\ttouch = event.getTouch(DisplayObject(this._target), TouchPhase.BEGAN);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\t//we only care about the began phase. ignore all other\n\t\t\t\t\t//phases when we don't have a saved touch ID.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(this._customHitTest !== null)\n\t\t\t\t{\n\t\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\t\ttouch.getLocation(DisplayObject(this._target), point);\n\t\t\t\t\tvar isInBounds:Boolean = this._customHitTest(point);\n\t\t\t\t\tPool.putPoint(point);\n\t\t\t\t\tif(!isInBounds)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//save the touch ID so that we can track this touch's phases.\n\t\t\t\tthis._touchPointID = touch.id;\n\n\t\t\t\t//save the position so that we can do a final hit test\n\t\t\t\tthis._touchLastGlobalPosition.x = touch.globalX;\n\t\t\t\tthis._touchLastGlobalPosition.y = touch.globalY;\n\n\t\t\t\tthis._touchBeginTime = getTimer();\n\t\t\t\tthis._target.addEventListener(Event.ENTER_FRAME, target_enterFrameHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function target_enterFrameHandler(event:Event):void\n\t\t{\n\t\t\tvar accumulatedTime:Number = (getTimer() - this._touchBeginTime) / 1000;\n\t\t\tif(accumulatedTime >= this._longPressDuration)\n\t\t\t{\n\t\t\t\tthis._target.removeEventListener(Event.ENTER_FRAME, target_enterFrameHandler);\n\n\t\t\t\tvar stage:Stage = this._target.stage;\n\t\t\t\tif(this._target is DisplayObjectContainer)\n\t\t\t\t{\n\t\t\t\t\tvar isInBounds:Boolean = DisplayObjectContainer(this._target).contains(stage.hitTest(this._touchLastGlobalPosition));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tisInBounds = this._target === stage.hitTest(this._touchLastGlobalPosition);\n\t\t\t\t}\n\t\t\t\tif(isInBounds)\n\t\t\t\t{\n\t\t\t\t\t//disable the other events\n\t\t\t\t\tif(this._tapToTrigger)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._tapToTrigger.isEnabled = false;\n\t\t\t\t\t}\n\t\t\t\t\tif(this._tapToSelect)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis._tapToSelect.isEnabled = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._target.dispatchEventWith(FeathersEventType.LONG_PRESS);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "source/feathers/utils/touch/TapToEvent.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.touch\n{\n\timport flash.geom.Point;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.DisplayObjectContainer;\n\timport starling.display.Stage;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.utils.Pool;\n\n\t/**\n\t * Dispatches an event from the target when the target is tapped/clicked.\n\t * Conveniently handles all <code>TouchEvent</code> listeners\n\t * automatically.\n\t *\n\t * <p>In the following example, a custom item renderer will be triggered\n\t * when tapped:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * public class CustomItemRenderer extends LayoutGroupListItemRenderer\n\t * {\n\t *     public function CustomItemRenderer()\n\t *     {\n\t *         super();\n\t *         this._tapToEvent = new TapToEvent(this, Event.TRIGGERED);\n\t *     }\n\t * \n\t *     private var _tapToEvent:TapToEvent;\n\t * }</listing>\n\t *\n\t * @see feathers.utils.touch.TapToTrigger\n\t * @see feathers.utils.touch.TapToSelect\n\t * @see feathers.utils.touch.LongPress\n\t *\n\t * @productversion Feathers 3.4.0\n\t */\n\tpublic class TapToEvent\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function TapToEvent(target:DisplayObject = null, eventType:String = null)\n\t\t{\n\t\t\tthis.target = target;\n\t\t\tthis.eventType = eventType;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _target:DisplayObject;\n\n\t\t/**\n\t\t * The target component that should dispatch the <code>eventType</code>\n\t\t * when tapped.\n\t\t */\n\t\tpublic function get target():DisplayObject\n\t\t{\n\t\t\treturn this._target;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set target(value:DisplayObject):void\n\t\t{\n\t\t\tif(this._target == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._target)\n\t\t\t{\n\t\t\t\tthis._target.removeEventListener(TouchEvent.TOUCH, target_touchHandler);\n\t\t\t}\n\t\t\tthis._target = value;\n\t\t\tif(this._target)\n\t\t\t{\n\t\t\t\t//if we're changing targets, and a touch is active, we want to\n\t\t\t\t//clear it.\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t\tthis._target.addEventListener(TouchEvent.TOUCH, target_touchHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _eventType:String = null;\n\n\t\t/**\n\t\t * The event type that will be dispatched when tapped.\n\t\t */\n\t\tpublic function get eventType():String\n\t\t{\n\t\t\treturn this._eventType;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set eventType(value:String):void\n\t\t{\n\t\t\tthis._eventType = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _touchPointID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isEnabled:Boolean = true;\n\n\t\t/**\n\t\t * May be set to <code>false</code> to disable the event dispatching\n\t\t * temporarily until set back to <code>true</code>.\n\t\t */\n\t\tpublic function get isEnabled():Boolean\n\t\t{\n\t\t\treturn this._isEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isEnabled(value:Boolean):void\n\t\t{\n\t\t\tif(this._isEnabled === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isEnabled = value;\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _tapCount:int = -1;\n\n\t\t/**\n\t\t * The number of times a component must be tapped before the event will\n\t\t * be dispatched. If the value of <code>tapCount</code> is <code>-1</code>,\n\t\t * the event will be dispatched for every tap.\n\t\t */\n\t\tpublic function get tapCount():int\n\t\t{\n\t\t\treturn this._tapCount;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set tapCount(value:int):void\n\t\t{\n\t\t\tthis._tapCount = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customHitTest:Function;\n\n\t\t/**\n\t\t * In addition to a normal call to <code>hitTest()</code>, a custom\n\t\t * function may impose additional rules that determine if the target\n\t\t * should be dispatch an event. Called on <code>TouchPhase.BEGAN</code>.\n\t\t *\n\t\t * <p>The function must have the following signature:</p>\n\t\t *\n\t\t * <pre>function(localPosition:Point):Boolean;</pre>\n\t\t *\n\t\t * <p>The function should return <code>true</code> if the target should\n\t\t * dispatch an event, and <code>false</code> if it should not dispatch.</p>\n\t\t */\n\t\tpublic function get customHitTest():Function\n\t\t{\n\t\t\treturn this._customHitTest;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customHitTest(value:Function):void\n\t\t{\n\t\t\tthis._customHitTest = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function target_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this._touchPointID >= 0)\n\t\t\t{\n\t\t\t\t//a touch has begun, so we'll ignore all other touches.\n\t\t\t\tvar touch:Touch = event.getTouch(this._target, null, this._touchPointID);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\t//this should not happen.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif(touch.phase == TouchPhase.ENDED)\n\t\t\t\t{\n\t\t\t\t\tvar stage:Stage = this._target.stage;\n\t\t\t\t\tif(stage !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\t\t\ttouch.getLocation(stage, point);\n\t\t\t\t\t\tif(this._target is DisplayObjectContainer)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar isInBounds:Boolean = DisplayObjectContainer(this._target).contains(stage.hitTest(point));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tisInBounds = this._target === stage.hitTest(point);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tPool.putPoint(point);\n\t\t\t\t\t\tif(isInBounds && (this._tapCount == -1 || this._tapCount == touch.tapCount))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._target.dispatchEventWith(this._eventType);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//the touch has ended, so now we can start watching for a\n\t\t\t\t\t//new one.\n\t\t\t\t\tthis._touchPointID = -1;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//we aren't tracking another touch, so let's look for a new one.\n\t\t\t\ttouch = event.getTouch(DisplayObject(this._target), TouchPhase.BEGAN);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\t//we only care about the began phase. ignore all other\n\t\t\t\t\t//phases when we don't have a saved touch ID.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(this._customHitTest !== null)\n\t\t\t\t{\n\t\t\t\t\tpoint = Pool.getPoint();\n\t\t\t\t\ttouch.getLocation(DisplayObject(this._target), point);\n\t\t\t\t\tisInBounds = this._customHitTest(point);\n\t\t\t\t\tPool.putPoint(point);\n\t\t\t\t\tif(!isInBounds)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//save the touch ID so that we can track this touch's phases.\n\t\t\t\tthis._touchPointID = touch.id;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/utils/touch/TapToSelect.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.touch\n{\n\timport feathers.core.IToggle;\n\n\timport flash.geom.Point;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.DisplayObjectContainer;\n\timport starling.display.Stage;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.utils.Pool;\n\n\t/**\n\t * Changes the <code>isSelected</code> property of the target when the\n\t * target is tapped (which will dispatch <code>Event.CHANGE</code>).\n\t * Conveniently handles all <code>TouchEvent</code> listeners automatically.\n\t * Useful for custom item renderers that should be selected when tapped.\n\t *\n\t * <p>In the following example, a custom item renderer will be selected when\n\t * tapped:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * public class CustomItemRenderer extends LayoutGroupListItemRenderer\n\t * {\n\t *     public function CustomItemRenderer()\n\t *     {\n\t *         super();\n\t *         this._tapToSelect = new TapToSelect(this);\n\t *     }\n\t * \n\t *     private var _tapToSelect:TapToSelect;\n\t * }</listing>\n\t *\n\t * <p>Note: When combined with a <code>TapToTrigger</code> instance, the\n\t * <code>TapToSelect</code> instance should be created second because\n\t * <code>Event.TRIGGERED</code> should be dispatched before\n\t * <code>Event.CHANGE</code>.</p>\n\t *\n\t * @see feathers.utils.touch.TapToTrigger\n\t * @see feathers.utils.touch.LongPress\n\t *\n\t * @productversion Feathers 2.3.0\n\t */\n\tpublic class TapToSelect\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function TapToSelect(target:IToggle = null)\n\t\t{\n\t\t\tthis.target = target;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _target:IToggle;\n\n\t\t/**\n\t\t * The target component that should be selected when tapped.\n\t\t */\n\t\tpublic function get target():IToggle\n\t\t{\n\t\t\treturn this._target;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set target(value:IToggle):void\n\t\t{\n\t\t\tif(this._target == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._target)\n\t\t\t{\n\t\t\t\tthis._target.removeEventListener(TouchEvent.TOUCH, target_touchHandler);\n\t\t\t}\n\t\t\tthis._target = value;\n\t\t\tif(this._target)\n\t\t\t{\n\t\t\t\t//if we're changing targets, and a touch is active, we want to\n\t\t\t\t//clear it.\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t\tthis._target.addEventListener(TouchEvent.TOUCH, target_touchHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _touchPointID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isEnabled:Boolean = true;\n\n\t\t/**\n\t\t * May be set to <code>false</code> to disable selection temporarily\n\t\t * until set back to <code>true</code>.\n\t\t */\n\t\tpublic function get isEnabled():Boolean\n\t\t{\n\t\t\treturn this._isEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isEnabled(value:Boolean):void\n\t\t{\n\t\t\tif(this._isEnabled === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isEnabled = value;\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _tapToDeselect:Boolean = false;\n\n\t\t/**\n\t\t * May be set to <code>true</code> to allow the target to be deselected\n\t\t * when tapped.\n\t\t */\n\t\tpublic function get tapToDeselect():Boolean\n\t\t{\n\t\t\treturn this._tapToDeselect;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set tapToDeselect(value:Boolean):void\n\t\t{\n\t\t\tthis._tapToDeselect = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customHitTest:Function;\n\n\t\t/**\n\t\t * In addition to a normal call to <code>hitTest()</code>, a custom\n\t\t * function may impose additional rules that determine if the target\n\t\t * should be selected. Called on <code>TouchPhase.BEGAN</code>.\n\t\t *\n\t\t * <p>The function must have the following signature:</p>\n\t\t *\n\t\t * <pre>function(localPosition:Point):Boolean;</pre>\n\t\t *\n\t\t * <p>The function should return <code>true</code> if the target should\n\t\t * be selected, and <code>false</code> if it should not be selected.</p>\n\t\t */\n\t\tpublic function get customHitTest():Function\n\t\t{\n\t\t\treturn this._customHitTest;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customHitTest(value:Function):void\n\t\t{\n\t\t\tthis._customHitTest = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function target_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this._touchPointID >= 0)\n\t\t\t{\n\t\t\t\t//a touch has begun, so we'll ignore all other touches.\n\t\t\t\tvar touch:Touch = event.getTouch(DisplayObject(this._target), null, this._touchPointID);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\t//this should not happen.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif(touch.phase == TouchPhase.ENDED)\n\t\t\t\t{\n\t\t\t\t\tvar stage:Stage = this._target.stage;\n\t\t\t\t\tif(stage !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\t\t\ttouch.getLocation(stage, point);\n\t\t\t\t\t\tif(this._target is DisplayObjectContainer)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar isInBounds:Boolean = DisplayObjectContainer(this._target).contains(stage.hitTest(point));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tisInBounds = this._target === stage.hitTest(point);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tPool.putPoint(point);\n\t\t\t\t\t\tif(isInBounds)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(this._tapToDeselect)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis._target.isSelected = !this._target.isSelected;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tthis._target.isSelected = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//the touch has ended, so now we can start watching for a\n\t\t\t\t\t//new one.\n\t\t\t\t\tthis._touchPointID = -1;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//we aren't tracking another touch, so let's look for a new one.\n\t\t\t\ttouch = event.getTouch(DisplayObject(this._target), TouchPhase.BEGAN);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\t//we only care about the began phase. ignore all other\n\t\t\t\t\t//phases when we don't have a saved touch ID.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(this._customHitTest !== null)\n\t\t\t\t{\n\t\t\t\t\tpoint = Pool.getPoint();\n\t\t\t\t\ttouch.getLocation(DisplayObject(this._target), point);\n\t\t\t\t\tisInBounds = this._customHitTest(point);\n\t\t\t\t\tPool.putPoint(point);\n\t\t\t\t\tif(!isInBounds)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//save the touch ID so that we can track this touch's phases.\n\t\t\t\tthis._touchPointID = touch.id;\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/utils/touch/TapToTrigger.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.touch\n{\n\timport starling.display.DisplayObject;\n\timport starling.events.Event;\n\n\t/**\n\t * Dispatches <code>Event.TRIGGERED</code> from the target when the target\n\t * is tapped. Conveniently handles all <code>TouchEvent</code> listeners\n\t * automatically. Useful for custom item renderers that should be triggered\n\t * when tapped.\n\t *\n\t * <p>In the following example, a custom item renderer will be triggered\n\t * when tapped:</p>\n\t *\n\t * <listing version=\"3.0\">\n\t * public class CustomItemRenderer extends LayoutGroupListItemRenderer\n\t * {\n\t *     public function CustomItemRenderer()\n\t *     {\n\t *         super();\n\t *         this._tapToTrigger = new TapToTrigger(this);\n\t *     }\n\t * \n\t *     private var _tapToTrigger:TapToTrigger;\n\t * }</listing>\n\t *\n\t * <p>Note: When combined with a <code>TapToSelect</code> instance, the\n\t * <code>TapToTrigger</code> instance should be created first because\n\t * <code>Event.TRIGGERED</code> should be dispatched before\n\t * <code>Event.CHANGE</code>.</p>\n\t *\n\t * @see http://doc.starling-framework.org/current/starling/events/Event.html#TRIGGERED starling.events.Event.TRIGGERED\n\t * @see feathers.utils.touch.TapToSelect\n\t * @see feathers.utils.touch.LongPress\n\t *\n\t * @productversion Feathers 2.3.0\n\t */\n\tpublic class TapToTrigger extends TapToEvent\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function TapToTrigger(target:DisplayObject = null)\n\t\t{\n\t\t\tsuper(target, Event.TRIGGERED);\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/utils/touch/TouchToState.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.touch\n{\n\timport feathers.controls.ButtonState;\n\timport feathers.core.IStateContext;\n\n\timport flash.geom.Point;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.DisplayObjectContainer;\n\timport starling.display.Stage;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.utils.Pool;\n\n\t/**\n\t * Changes a target's state based on the <code>TouchPhase</code> when the\n\t * target is touched. Conveniently handles all <code>TouchEvent</code> listeners\n\t * automatically. Useful for custom item renderers that should be change\n\t * state based on touch.\n\t *\n\t * @see feathers.utils.keyboard.KeyToState\n\t *\n\t * @productversion Feathers 3.2.0\n\t */\n\tpublic class TouchToState\n\t{\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function TouchToState(target:DisplayObject = null, callback:Function = null)\n\t\t{\n\t\t\tthis.target = target;\n\t\t\tthis.callback = callback;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _target:DisplayObject;\n\n\t\t/**\n\t\t * The target component that should change state based on touch phases.\n\t\t */\n\t\tpublic function get target():DisplayObject\n\t\t{\n\t\t\treturn this._target;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set target(value:DisplayObject):void\n\t\t{\n\t\t\tif(this._target == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._target !== null)\n\t\t\t{\n\t\t\t\tthis._target.removeEventListener(TouchEvent.TOUCH, target_touchHandler);\n\t\t\t\tthis._target.removeEventListener(Event.REMOVED_FROM_STAGE, target_removedFromStageHandler);\n\t\t\t}\n\t\t\tthis._target = value;\n\t\t\tif(this._target !== null)\n\t\t\t{\n\t\t\t\t//if we're changing targets, and a touch is active, we want to\n\t\t\t\t//clear it.\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t\t//then restore to the default state\n\t\t\t\tthis._currentState = this._upState;\n\t\t\t\tthis._target.addEventListener(TouchEvent.TOUCH, target_touchHandler);\n\t\t\t\tthis._target.addEventListener(Event.REMOVED_FROM_STAGE, target_removedFromStageHandler);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _callback:Function;\n\n\t\t/**\n\t\t * The function to call when the state is changed.\n\t\t *\n\t\t * <p>The callback is expected to have the following signature:</p>\n\t\t * <pre>function(currentState:String):void</pre>\n\t\t */\n\t\tpublic function get callback():Function\n\t\t{\n\t\t\treturn this._callback;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set callback(value:Function):void\n\t\t{\n\t\t\tif(this._callback === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._callback = value;\n\t\t\tif(this._callback !== null)\n\t\t\t{\n\t\t\t\tthis._callback(this._currentState);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _currentState:String = ButtonState.UP;\n\n\t\t/**\n\t\t * The current state of the utility. May be different than the state\n\t\t * of the target.\n\t\t */\n\t\tpublic function get currentState():String\n\t\t{\n\t\t\treturn this._currentState;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _upState:String = ButtonState.UP;\n\n\t\t/**\n\t\t * The value for the \"up\" state.\n\t\t *\n\t\t * @default feathers.controls.ButtonState.UP\n\t\t */\n\t\tpublic function get upState():String\n\t\t{\n\t\t\treturn this._upState;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set upState(value:String):void\n\t\t{\n\t\t\tthis._upState = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _downState:String = ButtonState.DOWN;\n\n\t\t/**\n\t\t * The value for the \"down\" state.\n\t\t *\n\t\t * @default feathers.controls.ButtonState.DOWN\n\t\t */\n\t\tpublic function get downState():String\n\t\t{\n\t\t\treturn this._downState;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set downState(value:String):void\n\t\t{\n\t\t\tthis._downState = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _hoverState:String = ButtonState.HOVER;\n\n\t\t/**\n\t\t * The value for the \"hover\" state.\n\t\t *\n\t\t * @default feathers.controls.ButtonState.HOVER\n\t\t */\n\t\tpublic function get hoverState():String\n\t\t{\n\t\t\treturn this._hoverState;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set hoverState(value:String):void\n\t\t{\n\t\t\tthis._hoverState = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _touchPointID:int = -1;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _isEnabled:Boolean = true;\n\n\t\t/**\n\t\t * May be set to <code>false</code> to disable the state changes\n\t\t * temporarily until set back to <code>true</code>.\n\t\t */\n\t\tpublic function get isEnabled():Boolean\n\t\t{\n\t\t\treturn this._isEnabled;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set isEnabled(value:Boolean):void\n\t\t{\n\t\t\tif(this._isEnabled === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isEnabled = value;\n\t\t\tif(!value)\n\t\t\t{\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _customHitTest:Function;\n\n\t\t/**\n\t\t * In addition to a normal call to <code>hitTest()</code>, a custom\n\t\t * function may impose additional rules that determine if the target\n\t\t * should change state. Called on <code>TouchPhase.BEGAN</code>.\n\t\t *\n\t\t * <p>The function must have the following signature:</p>\n\t\t *\n\t\t * <pre>function(localPosition:Point):Boolean;</pre>\n\t\t *\n\t\t * <p>The function should return <code>true</code> if the target should\n\t\t * be triggered, and <code>false</code> if it should not be\n\t\t * triggered.</p>\n\t\t */\n\t\tpublic function get customHitTest():Function\n\t\t{\n\t\t\treturn this._customHitTest;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set customHitTest(value:Function):void\n\t\t{\n\t\t\tthis._customHitTest = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _hoverBeforeBegan:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var _keepDownStateOnRollOut:Boolean = false;\n\n\t\t/**\n\t\t * If <code>true</code>, the button state will remain as\n\t\t * <code>downState</code> until <code>TouchPhase.ENDED</code>. If\n\t\t * <code>false</code>, and the touch leaves the bounds of the button\n\t\t * after <code>TouchPhase.BEGAN</code>, the button state will change to\n\t\t * <code>upState</code>.\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tpublic function get keepDownStateOnRollOut():Boolean\n\t\t{\n\t\t\treturn this._keepDownStateOnRollOut;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tpublic function set keepDownStateOnRollOut(value:Boolean):void\n\t\t{\n\t\t\tthis._keepDownStateOnRollOut = value;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function handleCustomHitTest(touch:Touch):Boolean\n\t\t{\n\t\t\tif(this._customHitTest === null)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tvar point:Point = Pool.getPoint();\n\t\t\ttouch.getLocation(DisplayObject(this._target), point);\n\t\t\tvar isInBounds:Boolean = this._customHitTest(point);\n\t\t\tPool.putPoint(point);\n\t\t\treturn isInBounds;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function changeState(value:String):void\n\t\t{\n\t\t\tvar oldState:String = this._currentState;\n\t\t\tif(this._target is IStateContext)\n\t\t\t{\n\t\t\t\toldState = IStateContext(this._target).currentState;\n\t\t\t}\n\t\t\tthis._currentState = value;\n\t\t\tif(oldState === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(this._callback !== null)\n\t\t\t{\n\t\t\t\tthis._callback(value);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function resetTouchState():void\n\t\t{\n\t\t\tthis._hoverBeforeBegan = false;\n\t\t\tthis._touchPointID = -1;\n\t\t\tthis.changeState(this._upState);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function target_removedFromStageHandler(event:Event):void\n\t\t{\n\t\t\tthis.resetTouchState();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function target_touchHandler(event:TouchEvent):void\n\t\t{\n\t\t\tif(!this._isEnabled)\n\t\t\t{\n\t\t\t\tthis._touchPointID = -1;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this._touchPointID >= 0)\n\t\t\t{\n\t\t\t\t//a touch has begun, so we'll ignore all other touches.\n\t\t\t\tvar touch:Touch = event.getTouch(this._target, null, this._touchPointID);\n\t\t\t\tif(!touch)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar stage:Stage = this._target.stage;\n\t\t\t\tif(stage !== null)\n\t\t\t\t{\n\t\t\t\t\tvar point:Point = Pool.getPoint();\n\t\t\t\t\ttouch.getLocation(stage, point);\n\t\t\t\t\tif(this._target is DisplayObjectContainer)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar isInBounds:Boolean = DisplayObjectContainer(this._target).contains(stage.hitTest(point));\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tisInBounds = this._target === stage.hitTest(point);\n\t\t\t\t\t}\n\t\t\t\t\tisInBounds &&= this.handleCustomHitTest(touch);\n\t\t\t\t\tPool.putPoint(point);\n\t\t\t\t\tif(touch.phase === TouchPhase.MOVED)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(this._keepDownStateOnRollOut)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//nothing to change!\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(isInBounds)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.changeState(this._downState);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.changeState(this._upState);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if(touch.phase === TouchPhase.ENDED)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(isInBounds && this._hoverBeforeBegan)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if the mouse is over the target on ended, return\n\t\t\t\t\t\t\t//to the hover state, but only if there was a hover\n\t\t\t\t\t\t\t//state before began.\n\t\t\t\t\t\t\t//this ensures that the hover state is not\n\t\t\t\t\t\t\t//unexpectedly entered on a touch screen.\n\t\t\t\t\t\t\tthis._touchPointID = -1;\n\t\t\t\t\t\t\tthis.changeState(this._hoverState);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.resetTouchState();\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//we aren't tracking another touch, so let's look for a new one.\n\t\t\t\ttouch = event.getTouch(this._target, TouchPhase.BEGAN);\n\t\t\t\tif(touch !== null && this.handleCustomHitTest(touch))\n\t\t\t\t{\n\t\t\t\t\tthis.changeState(this._downState);\n\t\t\t\t\tthis._touchPointID = touch.id;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttouch = event.getTouch(this._target, TouchPhase.HOVER);\n\t\t\t\tif(touch !== null && this.handleCustomHitTest(touch))\n\t\t\t\t{\n\t\t\t\t\tthis._hoverBeforeBegan = true;\n\t\t\t\t\tthis.changeState(this._hoverState);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t//end of hover\n\t\t\t\tthis.changeState(this._upState);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "source/feathers/utils/xml/xmlListInsertAt.as",
    "content": "/*\nFeathers\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nThis program is free software. You can redistribute and/or modify it in\naccordance with the terms of the accompanying license agreement.\n*/\npackage feathers.utils.xml\n{\n\t/**\n\t * Adds an XML value to an XMLList at a specific index.\n\t *\n\t * @productversion Feathers 3.3.0\n\t */\n\tpublic function xmlListInsertAt(xmlList:XMLList, index:int, xmlToInsert:XML):XMLList\n\t{\n\t\tvar listLength:int = xmlList.length();\n\t\t//we can't use insertChildAfter() or insertChildAfter() directly on\n\t\t//the XMLList, so we add it to an XML and insert there instead\n\t\tvar wrapper:XML = <wrapper/>;\n\t\twrapper.appendChild(xmlList);\n\t\tif(index == listLength)\n\t\t{\n\t\t\tvar lastItem:XML = xmlList[index - 1];\n\t\t\twrapper.insertChildAfter(lastItem, xmlToInsert);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar currentItem:XML = xmlList[index];\n\t\t\twrapper.insertChildBefore(currentItem, xmlToInsert);\n\t\t}\n\t\treturn wrapper.elements();\n\t}\n}"
  },
  {
    "path": "test/source/TestFeathers-app.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<application xmlns=\"http://ns.adobe.com/air/application/32.0\">\n\t<id>com.feathersui.TestFeathers</id>\n\t<filename>TestFeathers</filename>\n\t<name>TestFeathers</name>\n\t<versionNumber>1.0.0</versionNumber>\n\t<description>Test runner for Feathers UI controls for Starling</description>\n\t<copyright>2021 Bowler Hat LLC</copyright>\n\n\t<initialWindow>\n\t\t<content>TestFeathers.swf</content>\n\t\t<autoOrients>true</autoOrients>\n\t\t<fullScreen>false</fullScreen>\n\t\t<visible>true</visible>\n\t\t<renderMode>direct</renderMode>\n\t</initialWindow>\n\n\t<supportedLanguages>en</supportedLanguages>\n</application>"
  },
  {
    "path": "test/source/TestFeathers.as",
    "content": "package\n{\n\timport feathers.tests.AddOnFunctionStyleProviderTests;\n\timport feathers.tests.AlertMeasurementTests;\n\timport feathers.tests.AnchorLayoutTests;\n\timport feathers.tests.ArrayCollectionTests;\n\timport feathers.tests.ArrayHierarchicalCollectionTests;\n\timport feathers.tests.BasicButtonInternalStateTests;\n\timport feathers.tests.BasicButtonMeasurementTests;\n\timport feathers.tests.BasicButtonTests;\n\timport feathers.tests.BitmapFontTextEditorFocusTests;\n\timport feathers.tests.BitmapFontTextRendererTests;\n\timport feathers.tests.BottomDrawerPopUpContentManagerTests;\n\timport feathers.tests.ButtonFocusTests;\n\timport feathers.tests.ButtonGroupDataProviderEventsTests;\n\timport feathers.tests.ButtonGroupMeasurementTests;\n\timport feathers.tests.ButtonGroupTests;\n\timport feathers.tests.ButtonInternalStateTests;\n\timport feathers.tests.ButtonMeasurementTests;\n\timport feathers.tests.ButtonTests;\n\timport feathers.tests.CalloutMeasurementTests;\n\timport feathers.tests.CalloutPopUpContentManagerTests;\n\timport feathers.tests.CalloutTests;\n\timport feathers.tests.ComponentLifecycleTests;\n\timport feathers.tests.ConditionalStyleProviderTests;\n\timport feathers.tests.DateTimeSpinnerTests;\n\timport feathers.tests.DefaultGroupedListHeaderOrFooterRendererMeasurementTests;\n\timport feathers.tests.DefaultListItemRendererInternalStateTests;\n\timport feathers.tests.DefaultListItemRendererMeasurementTests;\n\timport feathers.tests.DrawersMeasurementTests;\n\timport feathers.tests.DrawersTests;\n\timport feathers.tests.DropDownPopUpContentManagerTests;\n\timport feathers.tests.FlowLayoutTests;\n\timport feathers.tests.FocusIndicatorTests;\n\timport feathers.tests.FocusManagerEnabledTests;\n\timport feathers.tests.FocusManagerTests;\n\timport feathers.tests.FontStylesSetTests;\n\timport feathers.tests.FunctionStyleProviderTests;\n\timport feathers.tests.GroupedListDataProviderTests;\n\timport feathers.tests.GroupedListFactoryIDFunctionTests;\n\timport feathers.tests.GroupedListFocusTests;\n\timport feathers.tests.GroupedListRendererAddRemoveTests;\n\timport feathers.tests.GroupedListTests;\n\timport feathers.tests.HeaderInternalStateTests;\n\timport feathers.tests.HeaderMeasurementTests;\n\timport feathers.tests.HeaderTests;\n\timport feathers.tests.HierarchicalCollectionTests;\n\timport feathers.tests.HorizontalLayoutTests;\n\timport feathers.tests.HorizontalSpinnerLayoutTests;\n\timport feathers.tests.ImageLoaderInternalStateTests;\n\timport feathers.tests.ImageLoaderTests;\n\timport feathers.tests.ImageSkinTests;\n\timport feathers.tests.InvalidateTests;\n\timport feathers.tests.KeyToSelectTests;\n\timport feathers.tests.KeyToTriggerTests;\n\timport feathers.tests.LabelMeasurementTests;\n\timport feathers.tests.LabelTests;\n\timport feathers.tests.LayoutGroupHorizontalLayoutTests;\n\timport feathers.tests.LayoutGroupInternalStateTests;\n\timport feathers.tests.LayoutGroupMeasurementTests;\n\timport feathers.tests.LayoutGroupTests;\n\timport feathers.tests.LayoutGroupValidationTests;\n\timport feathers.tests.LayoutGroupVerticalLayoutTests;\n\timport feathers.tests.ListCollectionFilterTests;\n\timport feathers.tests.ListCollectionWithArrayTests;\n\timport feathers.tests.ListFactoryIDFunctionTests;\n\timport feathers.tests.ListFocusTests;\n\timport feathers.tests.ListRendererAddRemoveTests;\n\timport feathers.tests.ListTests;\n\timport feathers.tests.LongPressTests;\n\timport feathers.tests.MinAndMaxDimensionsTests;\n\timport feathers.tests.NumericStepperMeasurementTests;\n\timport feathers.tests.PageIndicatorMeasurementTests;\n\timport feathers.tests.PanelMeasurementTests;\n\timport feathers.tests.PickerListMeasurementTests;\n\timport feathers.tests.PickerListTests;\n\timport feathers.tests.PopUpManagerFocusManagerTests;\n\timport feathers.tests.PopUpManagerTests;\n\timport feathers.tests.ProgressBarMeasurementTests;\n\timport feathers.tests.ProgressBarTests;\n\timport feathers.tests.RadioTests;\n\timport feathers.tests.RestrictedStyleTests;\n\timport feathers.tests.ScaleTests;\n\timport feathers.tests.ScreenNavigatorMeasurementTests;\n\timport feathers.tests.ScreenNavigatorTests;\n\timport feathers.tests.ScrollBarHorizontalMeasurementTests;\n\timport feathers.tests.ScrollBarHorizontalTests;\n\timport feathers.tests.ScrollBarVerticalMeasurementTests;\n\timport feathers.tests.ScrollContainerMeasurementTests;\n\timport feathers.tests.ScrollContainerTests;\n\timport feathers.tests.ScrollContainerValidationTests;\n\timport feathers.tests.ScrollerMeasurementTests;\n\timport feathers.tests.ScrollerTests;\n\timport feathers.tests.SimpleScrollBarHorizontalTests;\n\timport feathers.tests.SimpleScrollBarMeasurementTests;\n\timport feathers.tests.SlideShowLayoutTests;\n\timport feathers.tests.SliderHorizontalMeasurementTests;\n\timport feathers.tests.SliderHorizontalTests;\n\timport feathers.tests.SliderVerticalMeasurementTests;\n\timport feathers.tests.SpinnerListTests;\n\timport feathers.tests.StackScreenNavigatorMeasurementTests;\n\timport feathers.tests.StackScreenNavigatorTests;\n\timport feathers.tests.StageTextTextEditorFocusTests;\n\timport feathers.tests.StyleNameFunctionStyleProviderTests;\n\timport feathers.tests.StyleProviderRegistryTests;\n\timport feathers.tests.StyleTests;\n\timport feathers.tests.TabBarEmptyDataProviderTests;\n\timport feathers.tests.TabBarMeasurementTests;\n\timport feathers.tests.TabBarTests;\n\timport feathers.tests.TabNavigatorTests;\n\timport feathers.tests.TapToSelectTests;\n\timport feathers.tests.TapToTriggerTests;\n\timport feathers.tests.TextAreaFocusTests;\n\timport feathers.tests.TextAreaInternalStateTests;\n\timport feathers.tests.TextAreaTests;\n\timport feathers.tests.TextBlockTextEditorFocusTests;\n\timport feathers.tests.TextBlockTextRendererTests;\n\timport feathers.tests.TextFieldTextEditorFocusTests;\n\timport feathers.tests.TextFieldTextEditorTests;\n\timport feathers.tests.TextFieldTextRendererTests;\n\timport feathers.tests.TextInputFocusTests;\n\timport feathers.tests.TextInputInternalStateTests;\n\timport feathers.tests.TextInputMeasurementTests;\n\timport feathers.tests.TextInputRestrictTests;\n\timport feathers.tests.TextInputTests;\n\timport feathers.tests.TextureCacheTests;\n\timport feathers.tests.TiledColumnsLayoutTests;\n\timport feathers.tests.TiledRowsLayoutTests;\n\timport feathers.tests.TimeLabelTests;\n\timport feathers.tests.ToggleButtonFocusTests;\n\timport feathers.tests.ToggleButtonInternalStateTests;\n\timport feathers.tests.ToggleButtonTests;\n\timport feathers.tests.ToggleGroupTests;\n\timport feathers.tests.ToggleSwitchMeasurementTests;\n\timport feathers.tests.ToggleSwitchTests;\n\timport feathers.tests.TokenListTests;\n\timport feathers.tests.TouchToStateTests;\n\timport feathers.tests.TreeFocusTests;\n\timport feathers.tests.TreeTests;\n\timport feathers.tests.VectorCollectionTests;\n\timport feathers.tests.VectorHierarchicalCollectionTests;\n\timport feathers.tests.VerticalCenteredPopUpContentManagerTests;\n\timport feathers.tests.VerticalLayoutTests;\n\timport feathers.tests.VerticalSpinnerLayoutTests;\n\timport feathers.tests.XMLListCollectionTests;\n\timport feathers.tests.XMLListHierarchicalCollectionTests;\n\timport feathers.tests.XMLListInsertAtTests;\n\n\timport flash.display.Sprite;\n\timport flash.display.StageAlign;\n\timport flash.display.StageScaleMode;\n\timport flash.events.Event;\n\timport flash.system.Capabilities;\n\timport flash.system.fscommand;\n\timport flash.utils.getDefinitionByName;\n\n\timport org.flexunit.internals.TraceListener;\n\timport org.flexunit.listeners.CIListener;\n\timport org.flexunit.runner.FlexUnitCore;\n\n\timport starling.core.Starling;\n\timport starling.display.Sprite;\n\timport starling.events.Event;\n\n\t[SWF(width=\"960\",height=\"640\",frameRate=\"60\",backgroundColor=\"#4a4137\")]\n\tpublic class TestFeathers extends flash.display.Sprite\n\t{\n\t\tpublic static var starlingRoot:starling.display.Sprite;\n\n\t\tpublic function TestFeathers()\n\t\t{\n\t\t\tif(this.stage)\n\t\t\t{\n\t\t\t\tthis.stage.align = StageAlign.TOP_LEFT;\n\t\t\t\tthis.stage.scaleMode = StageScaleMode.NO_SCALE;\n\t\t\t}\n\n\t\t\tthis.loaderInfo.addEventListener(flash.events.Event.COMPLETE, loaderInfo_completeHandler);\n\t\t}\n\n\t\tprivate var _starling:Starling;\n\t\tprivate var _flexunit:FlexUnitCore;\n\n\t\tprivate function loaderInfo_completeHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tStarling.multitouchEnabled = true;\n\t\t\tthis._starling = new Starling(starling.display.Sprite, this.stage);\n\t\t\tthis._starling.addEventListener(starling.events.Event.ROOT_CREATED, starling_rootCreatedHandler);\n\t\t\tthis._starling.start();\n\t\t}\n\n\t\tprivate function starling_rootCreatedHandler(event:starling.events.Event):void\n\t\t{\n\t\t\tstarlingRoot = starling.display.Sprite(this._starling.root);\n\t\t\tthis._flexunit = new FlexUnitCore();\n\t\t\tthis._flexunit.addListener(new TraceListener());\n\t\t\tthis._flexunit.addListener(new CIListener());\n\t\t\tthis._flexunit.addEventListener(FlexUnitCore.TESTS_COMPLETE, flexunit_testsCompleteHandler);\n\t\t\tthis._flexunit.run(\n\t\t\t[\n\t\t\t\t//general component tests\n\t\t\t\tInvalidateTests,\n\t\t\t\tMinAndMaxDimensionsTests,\n\t\t\t\tComponentLifecycleTests,\n\t\t\t\tScaleTests,\n\t\t\t\tStyleTests,\n\t\t\t\tRestrictedStyleTests,\n\t\t\t\tFocusIndicatorTests,\n\n\t\t\t\t//individual component tests\n\t\t\t\tAlertMeasurementTests,\n\t\t\t\tBasicButtonTests,\n\t\t\t\tBasicButtonMeasurementTests,\n\t\t\t\tBasicButtonInternalStateTests,\n\t\t\t\tButtonTests,\n\t\t\t\tButtonInternalStateTests,\n\t\t\t\tButtonFocusTests,\n\t\t\t\tButtonMeasurementTests,\n\t\t\t\tButtonGroupTests,\n\t\t\t\tButtonGroupMeasurementTests,\n\t\t\t\tButtonGroupDataProviderEventsTests,\n\t\t\t\tCalloutTests,\n\t\t\t\tCalloutMeasurementTests,\n\t\t\t\tDateTimeSpinnerTests,\n\t\t\t\tDefaultGroupedListHeaderOrFooterRendererMeasurementTests,\n\t\t\t\tDefaultListItemRendererMeasurementTests,\n\t\t\t\tDefaultListItemRendererInternalStateTests,\n\t\t\t\tDrawersTests,\n\t\t\t\tDrawersMeasurementTests,\n\t\t\t\tGroupedListTests,\n\t\t\t\tGroupedListFocusTests,\n\t\t\t\tGroupedListDataProviderTests,\n\t\t\t\tGroupedListFactoryIDFunctionTests,\n\t\t\t\tGroupedListRendererAddRemoveTests,\n\t\t\t\tHeaderTests,\n\t\t\t\tHeaderMeasurementTests,\n\t\t\t\tHeaderInternalStateTests,\n\t\t\t\tImageLoaderTests,\n\t\t\t\tImageLoaderInternalStateTests,\n\t\t\t\tLabelTests,\n\t\t\t\tLabelMeasurementTests,\n\t\t\t\tLayoutGroupTests,\n\t\t\t\tLayoutGroupInternalStateTests,\n\t\t\t\tLayoutGroupMeasurementTests,\n\t\t\t\tLayoutGroupValidationTests,\n\t\t\t\tListTests,\n\t\t\t\tListFocusTests,\n\t\t\t\tListFactoryIDFunctionTests,\n\t\t\t\tListRendererAddRemoveTests,\n\t\t\t\tNumericStepperMeasurementTests,\n\t\t\t\tPageIndicatorMeasurementTests,\n\t\t\t\tPanelMeasurementTests,\n\t\t\t\tPickerListTests,\n\t\t\t\tPickerListMeasurementTests,\n\t\t\t\tProgressBarTests,\n\t\t\t\tProgressBarMeasurementTests,\n\t\t\t\tRadioTests,\n\t\t\t\tSimpleScrollBarHorizontalTests,\n\t\t\t\tSimpleScrollBarMeasurementTests,\n\t\t\t\tScreenNavigatorTests,\n\t\t\t\tScreenNavigatorMeasurementTests,\n\t\t\t\tScrollBarHorizontalTests,\n\t\t\t\tScrollBarHorizontalMeasurementTests,\n\t\t\t\tScrollBarVerticalMeasurementTests,\n\t\t\t\tScrollContainerTests,\n\t\t\t\tScrollContainerMeasurementTests,\n\t\t\t\tScrollContainerValidationTests,\n\t\t\t\tScrollerTests,\n\t\t\t\tScrollerMeasurementTests,\n\t\t\t\tSliderHorizontalTests,\n\t\t\t\tSliderHorizontalMeasurementTests,\n\t\t\t\tSliderVerticalMeasurementTests,\n\t\t\t\tSpinnerListTests,\n\t\t\t\tStackScreenNavigatorTests,\n\t\t\t\tStackScreenNavigatorMeasurementTests,\n\t\t\t\tTabBarTests,\n\t\t\t\tTabBarMeasurementTests,\n\t\t\t\tTabBarEmptyDataProviderTests,\n\t\t\t\tTabNavigatorTests,\n\t\t\t\tTextAreaTests,\n\t\t\t\tTextAreaInternalStateTests,\n\t\t\t\tTextInputTests,\n\t\t\t\tTextInputMeasurementTests,\n\t\t\t\tTextInputInternalStateTests,\n\t\t\t\tToggleButtonTests,\n\t\t\t\tToggleButtonInternalStateTests,\n\t\t\t\tToggleButtonFocusTests,\n\t\t\t\tToggleGroupTests,\n\t\t\t\tToggleSwitchTests,\n\t\t\t\tToggleSwitchMeasurementTests,\n\t\t\t\tTreeTests,\n\t\t\t\tTreeFocusTests,\n\n\t\t\t\t//media tests\n\t\t\t\tTimeLabelTests,\n\n\t\t\t\t//layout tests\n\t\t\t\tAnchorLayoutTests,\n\t\t\t\tFlowLayoutTests,\n\t\t\t\tLayoutGroupHorizontalLayoutTests,\n\t\t\t\tLayoutGroupVerticalLayoutTests,\n\t\t\t\tTiledRowsLayoutTests,\n\t\t\t\tTiledColumnsLayoutTests,\n\t\t\t\tHorizontalLayoutTests,\n\t\t\t\tVerticalLayoutTests,\n\t\t\t\tHorizontalSpinnerLayoutTests,\n\t\t\t\tVerticalSpinnerLayoutTests,\n\t\t\t\tSlideShowLayoutTests,\n\n\t\t\t\t//collections tests\n\t\t\t\tListCollectionWithArrayTests,\n\t\t\t\tListCollectionFilterTests,\n\t\t\t\tArrayCollectionTests,\n\t\t\t\tVectorCollectionTests,\n\t\t\t\tXMLListCollectionTests,\n\t\t\t\tHierarchicalCollectionTests,\n\t\t\t\tArrayHierarchicalCollectionTests,\n\t\t\t\tVectorHierarchicalCollectionTests,\n\t\t\t\tXMLListHierarchicalCollectionTests,\n\n\t\t\t\t//text renderers\n\t\t\t\tBitmapFontTextRendererTests,\n\t\t\t\tTextBlockTextRendererTests,\n\t\t\t\tTextFieldTextRendererTests,\n\n\t\t\t\t//text editors\n\t\t\t\tTextFieldTextEditorTests,\n\n\t\t\t\t//focus tests\n\t\t\t\tFocusManagerEnabledTests,\n\t\t\t\tFocusManagerTests,\n\t\t\t\tPopUpManagerFocusManagerTests,\n\t\t\t\tTextInputFocusTests,\n\t\t\t\tTextAreaFocusTests,\n\t\t\t\tStageTextTextEditorFocusTests,\n\t\t\t\tTextFieldTextEditorFocusTests,\n\t\t\t\tBitmapFontTextEditorFocusTests,\n\t\t\t\tTextBlockTextEditorFocusTests,\n\n\t\t\t\t//style providers and themes\n\t\t\t\tConditionalStyleProviderTests,\n\t\t\t\tFunctionStyleProviderTests,\n\t\t\t\tStyleNameFunctionStyleProviderTests,\n\t\t\t\tAddOnFunctionStyleProviderTests,\n\t\t\t\tStyleProviderRegistryTests,\n\n\t\t\t\t//misc\n\t\t\t\tPopUpManagerTests,\n\t\t\t\tTextureCacheTests,\n\t\t\t\tTapToTriggerTests,\n\t\t\t\tTapToSelectTests,\n\t\t\t\tLongPressTests,\n\t\t\t\tTouchToStateTests,\n\t\t\t\tKeyToSelectTests,\n\t\t\t\tKeyToTriggerTests,\n\t\t\t\tTokenListTests,\n\t\t\t\tImageSkinTests,\n\t\t\t\tDropDownPopUpContentManagerTests,\n\t\t\t\tBottomDrawerPopUpContentManagerTests,\n\t\t\t\tVerticalCenteredPopUpContentManagerTests,\n\t\t\t\tCalloutPopUpContentManagerTests,\n\t\t\t\tXMLListInsertAtTests,\n\t\t\t\tFontStylesSetTests,\n\t\t\t\tTextInputRestrictTests,\n\t\t\t]);\n\t\t}\n\n\t\tprivate function flexunit_testsCompleteHandler(event:flash.events.Event):void\n\t\t{\n\t\t\tif(Capabilities.playerType == \"Desktop\")\n\t\t\t{\n\t\t\t\tvar NativeApplication:Class = Class(getDefinitionByName(\"flash.desktop.NativeApplication\"));\n\t\t\t\tif(NativeApplication)\n\t\t\t\t{\n\t\t\t\t\tNativeApplication.nativeApplication.exit();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfscommand(\"quit\");\n\t\t\t}\n\t\t}\n\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/AddOnFunctionStyleProviderTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.BasicButton;\n\timport feathers.core.IFeathersControl;\n\timport feathers.skins.AddOnFunctionStyleProvider;\n\timport feathers.tests.supportClasses.CustomStyleProvider;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class AddOnFunctionStyleProviderTests\n\t{\n\t\tprivate var _target:BasicButton;\n\t\tprivate var _styleProvider:AddOnFunctionStyleProvider;\n\t\tprivate var _otherStyleProvider:CustomStyleProvider;\n\t\tprivate var _afterFunctionCalled:Boolean;\n\t\tprivate var _beforeFunctionCalled:Boolean;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._afterFunctionCalled = false;\n\t\t\tthis._beforeFunctionCalled = false;\n\n\t\t\tthis._otherStyleProvider = new CustomStyleProvider();\n\n\t\t\tthis._target = new BasicButton();\n\t\t\tthis._target.defaultSkin = new Quad(200, 200, 0xff00ff);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._target.removeFromParent(true);\n\t\t\tthis._target = null;\n\n\t\t\tthis._styleProvider = null;\n\t\t\tthis._otherStyleProvider = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\tprivate function afterFunction(target:IFeathersControl):void\n\t\t{\n\t\t\tthis._afterFunctionCalled = true;\n\t\t\tif(this._styleProvider.originalStyleProvider !== null)\n\t\t\t{\n\t\t\t\tAssert.assertTrue(\"AddOnFunctionStyleProvider did not call originalStyleProvider.applyStyles() before addon function.\", this._otherStyleProvider.appliedStyles);\n\t\t\t}\n\t\t}\n\n\t\tprivate function beforeFunction(target:IFeathersControl):void\n\t\t{\n\t\t\tthis._beforeFunctionCalled = true;\n\t\t\tif(this._styleProvider.originalStyleProvider !== null)\n\t\t\t{\n\t\t\t\tAssert.assertFalse(\"AddOnFunctionStyleProvider called originalStyleProvider.applyStyles() before addon function.\", this._otherStyleProvider.appliedStyles);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNullOriginalStyleProviderAndAfterFunction():void\n\t\t{\n\t\t\tthis._styleProvider = new AddOnFunctionStyleProvider(null, afterFunction);\n\t\t\tthis._styleProvider.callBeforeOriginalStyleProvider = false;\n\t\t\tthis._styleProvider.applyStyles(this._target);\n\t\t\tAssert.assertFalse(\"AddOnFunctionStyleProvider incorrectly called originalStyleProvider.applyStyles()\", this._otherStyleProvider.appliedStyles);\n\t\t\tAssert.assertTrue(\"AddOnFunctionStyleProvider did not call the after function after null originalStyleProvider\", this._afterFunctionCalled);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNullOriginalStyleProviderAndBeforeFunction():void\n\t\t{\n\t\t\tthis._styleProvider = new AddOnFunctionStyleProvider(null, beforeFunction);\n\t\t\tthis._styleProvider.callBeforeOriginalStyleProvider = true;\n\t\t\tthis._styleProvider.applyStyles(this._target);\n\t\t\tAssert.assertFalse(\"AddOnFunctionStyleProvider incorrectly called originalStyleProvider.applyStyles()\", this._otherStyleProvider.appliedStyles);\n\t\t\tAssert.assertTrue(\"AddOnFunctionStyleProvider did not call the before function after null originalStyleProvider\", this._beforeFunctionCalled);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testBeforeFunctionCalled():void\n\t\t{\n\t\t\tthis._styleProvider = new AddOnFunctionStyleProvider(this._otherStyleProvider, beforeFunction);\n\t\t\tthis._styleProvider.callBeforeOriginalStyleProvider = true;\n\t\t\tthis._styleProvider.applyStyles(this._target);\n\t\t\tAssert.assertTrue(\"AddOnFunctionStyleProvider must call originalStyleProvider.applyStyles()\", this._otherStyleProvider.appliedStyles);\n\t\t\tAssert.assertTrue(\"AddOnFunctionStyleProvider must call the function\", this._beforeFunctionCalled);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAfterFunctionCalled():void\n\t\t{\n\t\t\tthis._styleProvider = new AddOnFunctionStyleProvider(this._otherStyleProvider, afterFunction);\n\t\t\tthis._styleProvider.callBeforeOriginalStyleProvider = false;\n\t\t\tthis._styleProvider.applyStyles(this._target);\n\t\t\tAssert.assertTrue(\"AddOnFunctionStyleProvider must call originalStyleProvider.applyStyles()\", this._otherStyleProvider.appliedStyles);\n\t\t\tAssert.assertTrue(\"AddOnFunctionStyleProvider must call the after function\", this._afterFunctionCalled);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/AlertMeasurementTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Alert;\n\timport feathers.controls.Button;\n\timport feathers.controls.ButtonGroup;\n\timport feathers.controls.Header;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.text.BitmapFontTextRenderer;\n\timport feathers.data.ListCollection;\n\timport feathers.layout.Direction;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class AlertMeasurementTests\n\t{\n\t\tprivate static const BACKGROUND_WIDTH:Number = 200;\n\t\tprivate static const BACKGROUND_HEIGHT:Number = 250;\n\n\t\tprivate static const COMPLEX_BACKGROUND_WIDTH:Number = 340;\n\t\tprivate static const COMPLEX_BACKGROUND_HEIGHT:Number = 350;\n\t\tprivate static const COMPLEX_BACKGROUND_MIN_WIDTH:Number = 280;\n\t\tprivate static const COMPLEX_BACKGROUND_MIN_HEIGHT:Number = 290;\n\n\t\tprivate static const PADDING_TOP:Number = 50;\n\t\tprivate static const PADDING_RIGHT:Number = 54;\n\t\tprivate static const PADDING_BOTTOM:Number = 59;\n\t\tprivate static const PADDING_LEFT:Number = 60;\n\n\t\tprivate static const OUTER_PADDING_TOP:Number = 40;\n\t\tprivate static const OUTER_PADDING_RIGHT:Number = 64;\n\t\tprivate static const OUTER_PADDING_BOTTOM:Number = 69;\n\t\tprivate static const OUTER_PADDING_LEFT:Number = 50;\n\n\t\tprivate static const HEADER_WIDTH:Number = 150;\n\t\tprivate static const HEADER_HEIGHT:Number = 40;\n\n\t\tprivate static const LARGE_HEADER_WIDTH:Number = 550;\n\n\t\tprivate static const ICON_WIDTH:Number = 120;\n\t\tprivate static const ICON_HEIGHT:Number = 110;\n\n\t\tprivate static const BUTTON_WIDTH:Number = 160;\n\t\tprivate static const BUTTON_HEIGHT:Number = 30;\n\t\t\n\t\tprivate static const GAP:Number = 4;\n\n\t\tprivate var _alert:Alert;\n\t\tprivate var _textRenderer:BitmapFontTextRenderer;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._alert = new Alert();\n\t\t\tthis._alert.footerFactory = function():ButtonGroup\n\t\t\t{\n\t\t\t\tvar footer:ButtonGroup = new ButtonGroup();\n\t\t\t\tfooter.direction = Direction.HORIZONTAL;\n\t\t\t\tfooter.buttonFactory = function():Button\n\t\t\t\t{\n\t\t\t\t\tvar button:Button = new Button();\n\t\t\t\t\tbutton.defaultSkin = new Quad(BUTTON_WIDTH, BUTTON_HEIGHT, 0x00ff00);\n\t\t\t\t\treturn button;\n\t\t\t\t};\n\t\t\t\treturn footer;\n\t\t\t};\n\t\t\tTestFeathers.starlingRoot.addChild(this._alert);\n\t\t\t\n\t\t\tthis._textRenderer = new BitmapFontTextRenderer();\n\t\t\tTestFeathers.starlingRoot.addChild(this._textRenderer);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._alert.removeFromParent(true);\n\t\t\tthis._alert = null;\n\t\t\t\n\t\t\tthis._textRenderer.removeFromParent(true);\n\t\t\tthis._textRenderer = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\tprivate function addSimpleBackground():void\n\t\t{\n\t\t\tthis._alert.backgroundSkin = new Quad(BACKGROUND_WIDTH, BACKGROUND_HEIGHT, 0xff00ff);\n\t\t}\n\n\t\tprivate function addComplexBackground():void\n\t\t{\n\t\t\tvar backgroundSkin:LayoutGroup = new LayoutGroup();\n\t\t\tbackgroundSkin.width = COMPLEX_BACKGROUND_WIDTH;\n\t\t\tbackgroundSkin.height = COMPLEX_BACKGROUND_HEIGHT;\n\t\t\tbackgroundSkin.minWidth = COMPLEX_BACKGROUND_MIN_WIDTH;\n\t\t\tbackgroundSkin.minHeight = COMPLEX_BACKGROUND_MIN_HEIGHT;\n\t\t\tthis._alert.backgroundSkin = backgroundSkin;\n\t\t}\n\n\t\tprivate function addHeader():void\n\t\t{\n\t\t\tthis._alert.headerFactory = function():Header\n\t\t\t{\n\t\t\t\tvar header:Header = new Header();\n\t\t\t\theader.backgroundSkin = new Quad(HEADER_WIDTH, HEADER_HEIGHT, 0xff00ff);\n\t\t\t\treturn header;\n\t\t\t};\n\t\t}\n\n\t\tprivate function addWideHeader():void\n\t\t{\n\t\t\tthis._alert.headerFactory = function():Header\n\t\t\t{\n\t\t\t\tvar header:Header = new Header();\n\t\t\t\theader.backgroundSkin = new Quad(LARGE_HEADER_WIDTH, HEADER_HEIGHT, 0xff00ff);\n\t\t\t\treturn header;\n\t\t\t};\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithHeader():void\n\t\t{\n\t\t\tthis.addHeader();\n\t\t\tthis._alert.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Alert was not calculated correctly with a header.\",\n\t\t\t\tHEADER_WIDTH, this._alert.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Alert was not calculated correctly with a header.\",\n\t\t\t\tHEADER_HEIGHT, this._alert.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Alert was not calculated correctly with a header.\",\n\t\t\t\tHEADER_WIDTH, this._alert.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Alert was not calculated correctly with a header.\",\n\t\t\t\tHEADER_HEIGHT, this._alert.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithHeaderAndPadding():void\n\t\t{\n\t\t\tthis.addHeader();\n\t\t\tthis._alert.paddingTop = PADDING_TOP;\n\t\t\tthis._alert.paddingRight = PADDING_RIGHT;\n\t\t\tthis._alert.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._alert.paddingLeft = PADDING_LEFT;\n\t\t\tthis._alert.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Alert was not calculated correctly based on the header and left and right padding.\",\n\t\t\t\tHEADER_WIDTH, this._alert.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Alert was not calculated correctly based on the header and top and bottom padding.\",\n\t\t\t\tHEADER_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._alert.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Alert was not calculated correctly based on the header and left and right padding.\",\n\t\t\t\tHEADER_WIDTH, this._alert.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Alert was not calculated correctly based on the header and top and bottom padding.\",\n\t\t\t\tHEADER_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._alert.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithHeaderAndOuterPadding():void\n\t\t{\n\t\t\tthis.addWideHeader();\n\t\t\tthis._alert.outerPaddingTop = OUTER_PADDING_TOP;\n\t\t\tthis._alert.outerPaddingRight = OUTER_PADDING_RIGHT;\n\t\t\tthis._alert.outerPaddingBottom = OUTER_PADDING_BOTTOM;\n\t\t\tthis._alert.outerPaddingLeft = OUTER_PADDING_LEFT;\n\t\t\tthis._alert.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Alert was not calculated correctly based on the header and left and right outer padding.\",\n\t\t\t\tLARGE_HEADER_WIDTH + OUTER_PADDING_LEFT + OUTER_PADDING_RIGHT, this._alert.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Alert was not calculated correctly based on the header and top and bottom outer padding.\",\n\t\t\t\tHEADER_HEIGHT + OUTER_PADDING_TOP + OUTER_PADDING_BOTTOM, this._alert.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Alert was not calculated correctly based on the header and left and right outer padding.\",\n\t\t\t\tLARGE_HEADER_WIDTH + OUTER_PADDING_LEFT + OUTER_PADDING_RIGHT, this._alert.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Alert was not calculated correctly based on the header and top and bottom outer padding.\",\n\t\t\t\tHEADER_HEIGHT + OUTER_PADDING_TOP + OUTER_PADDING_BOTTOM, this._alert.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithHeaderAndSimpleBackgroundSkin():void\n\t\t{\n\t\t\tthis.addHeader();\n\t\t\tthis.addSimpleBackground();\n\t\t\tthis._alert.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Alert was not calculated correctly based on the background width larger than the header width.\",\n\t\t\t\tBACKGROUND_WIDTH, this._alert.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Alert was not calculated correctly based on the background height.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._alert.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Alert was not calculated correctly based on the background width larger than the header width.\",\n\t\t\t\tBACKGROUND_WIDTH, this._alert.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Alert was not calculated correctly based on the background height.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._alert.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithHeaderAndComplexBackground():void\n\t\t{\n\t\t\tthis.addHeader();\n\t\t\tthis.addComplexBackground();\n\t\t\tthis._alert.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Alert was not calculated correctly based on the complex background width.\",\n\t\t\t\tCOMPLEX_BACKGROUND_WIDTH, this._alert.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Alert was not calculated correctly based on the complex background height.\",\n\t\t\t\tCOMPLEX_BACKGROUND_HEIGHT, this._alert.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Alert was not calculated correctly based on the complex background minWidth.\",\n\t\t\t\tCOMPLEX_BACKGROUND_MIN_WIDTH, this._alert.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Alert was not calculated correctly based on the complex background minHeight.\",\n\t\t\t\tCOMPLEX_BACKGROUND_MIN_HEIGHT, this._alert.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithHeaderAndFooter():void\n\t\t{\n\t\t\tthis.addHeader();\n\t\t\tthis._alert.buttonsDataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._alert.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Alert was not calculated correctly with header and footer.\",\n\t\t\t\tBUTTON_WIDTH * 3, this._alert.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Alert was not calculated correctly with header and footer.\",\n\t\t\t\tHEADER_HEIGHT + BUTTON_HEIGHT, this._alert.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Alert was not calculated correctly with header and footer.\",\n\t\t\t\tBUTTON_WIDTH * 3, this._alert.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Alert was not calculated correctly with header and footer.\",\n\t\t\t\tHEADER_HEIGHT + BUTTON_HEIGHT, this._alert.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWidthWithHeaderAndSmallerFooter():void\n\t\t{\n\t\t\tthis.addWideHeader();\n\t\t\tthis._alert.buttonsDataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._alert.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Alert was not calculated correctly with header and footer.\",\n\t\t\t\tLARGE_HEADER_WIDTH, this._alert.width);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Alert was not calculated correctly with header and footer.\",\n\t\t\t\tLARGE_HEADER_WIDTH, this._alert.minWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithHeaderFooterAndPadding():void\n\t\t{\n\t\t\tthis.addHeader();\n\t\t\tthis._alert.buttonsDataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._alert.paddingTop = PADDING_TOP;\n\t\t\tthis._alert.paddingRight = PADDING_RIGHT;\n\t\t\tthis._alert.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._alert.paddingLeft = PADDING_LEFT;\n\t\t\tthis._alert.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Alert was not calculated correctly based on the header, footer, and left and right padding.\",\n\t\t\t\tBUTTON_WIDTH * 3, this._alert.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Alert was not calculated correctly based on the header, footer, and top and bottom padding.\",\n\t\t\t\tHEADER_HEIGHT + BUTTON_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._alert.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Alert was not calculated correctly based on the header, footer, and left and right padding.\",\n\t\t\t\tBUTTON_WIDTH * 3, this._alert.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Alert was not calculated correctly based on the header, footer, and top and bottom padding.\",\n\t\t\t\tHEADER_HEIGHT + BUTTON_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._alert.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithHeaderFooterAndLargerSimpleBackgroundSkin():void\n\t\t{\n\t\t\tthis.addHeader();\n\t\t\tthis._alert.buttonsDataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis.addSimpleBackground();\n\t\t\tthis._alert.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Alert was not calculated correctly based on the background width with a smaller header and footer.\",\n\t\t\t\tBACKGROUND_WIDTH, this._alert.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Alert was not calculated correctly based on the background width with a smaller header and footer.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._alert.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Alert was not calculated correctly based on the background height with a smaller header and footer.\",\n\t\t\t\tBACKGROUND_WIDTH, this._alert.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Alert was not calculated correctly based on the background width with a smaller header and footer.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._alert.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithHeaderFooterAndLargerComplexBackground():void\n\t\t{\n\t\t\tthis.addHeader();\n\t\t\tthis._alert.buttonsDataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis.addComplexBackground();\n\t\t\tthis._alert.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Alert was not calculated correctly based on the complex background width with a smaller header and footer.\",\n\t\t\t\tCOMPLEX_BACKGROUND_WIDTH, this._alert.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Alert was not calculated correctly based on the complex background height with a smaller header and footer.\",\n\t\t\t\tCOMPLEX_BACKGROUND_HEIGHT, this._alert.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Alert was not calculated correctly based on the complex background minWidth with a smaller header and footer.\",\n\t\t\t\tCOMPLEX_BACKGROUND_MIN_WIDTH, this._alert.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Alert was not calculated correctly based on the complex background minHeight with a smaller header and footer.\",\n\t\t\t\tCOMPLEX_BACKGROUND_MIN_HEIGHT, this._alert.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithHeaderAndShortMessage():void\n\t\t{\n\t\t\tvar message:String = \"Hello\";\n\t\t\tthis.addHeader();\n\t\t\tthis._alert.message = message;\n\t\t\tthis._alert.validate();\n\n\t\t\tthis._textRenderer.text = message;\n\t\t\tthis._textRenderer.validate();\n\t\t\t\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Alert was not calculated correctly with a header and short message.\",\n\t\t\t\tHEADER_WIDTH, this._alert.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Alert was not calculated correctly with a header and short message.\",\n\t\t\t\tHEADER_HEIGHT + this._textRenderer.height, this._alert.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Alert was not calculated correctly with a header and short message.\",\n\t\t\t\tHEADER_WIDTH, this._alert.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Alert was not calculated correctly with a header and short message.\",\n\t\t\t\tHEADER_HEIGHT + this._textRenderer.minHeight, this._alert.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithHeaderAndLongMessage():void\n\t\t{\n\t\t\tvar message:String = \"I am the very model of a modern major general\";\n\t\t\tthis.addHeader();\n\t\t\tthis._alert.message = message;\n\t\t\tthis._alert.validate();\n\n\t\t\tthis._textRenderer.text = message;\n\t\t\tthis._textRenderer.validate();\n\t\t\t\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Alert was not calculated correctly with a header and long message.\",\n\t\t\t\tthis._textRenderer.width, this._alert.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Alert was not calculated correctly with a header and long message.\",\n\t\t\t\tHEADER_HEIGHT + this._textRenderer.height, this._alert.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Alert was not calculated correctly with a header and long message.\",\n\t\t\t\tthis._textRenderer.minWidth, this._alert.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Alert was not calculated correctly with a header and long message.\",\n\t\t\t\tHEADER_HEIGHT + this._textRenderer.minHeight, this._alert.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithHeaderIconAndLongMessage():void\n\t\t{\n\t\t\tvar message:String = \"I am the very model of a modern major general\";\n\t\t\tthis.addHeader();\n\t\t\tthis._alert.message = message;\n\t\t\tthis._alert.icon = new Quad(ICON_WIDTH, ICON_HEIGHT);\n\t\t\tthis._alert.validate();\n\n\t\t\tthis._textRenderer.text = message;\n\t\t\tthis._textRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Alert was not calculated correctly with a header, icon, and long message.\",\n\t\t\t\tICON_WIDTH + this._textRenderer.width, this._alert.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Alert was not calculated correctly with a header, icon, and long message.\",\n\t\t\t\tHEADER_HEIGHT + ICON_HEIGHT, this._alert.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Alert was not calculated correctly with a header, icon, and long message.\",\n\t\t\t\tICON_WIDTH + this._textRenderer.width, this._alert.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Alert was not calculated correctly with a header, icon, and long message.\",\n\t\t\t\tHEADER_HEIGHT + ICON_HEIGHT, this._alert.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithHeaderIconGapAndLongMessage():void\n\t\t{\n\t\t\tvar message:String = \"I am the very model of a modern major general\";\n\t\t\tthis.addHeader();\n\t\t\tthis._alert.message = message;\n\t\t\tthis._alert.gap = GAP;\n\t\t\tthis._alert.icon = new Quad(ICON_WIDTH, ICON_HEIGHT);\n\t\t\tthis._alert.validate();\n\n\t\t\tthis._textRenderer.text = message;\n\t\t\tthis._textRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Alert was not calculated correctly with a header, icon, gap, and long message.\",\n\t\t\t\tICON_WIDTH + GAP + this._textRenderer.width, this._alert.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Alert was not calculated correctly with a header, icon, gap, and long message.\",\n\t\t\t\tHEADER_HEIGHT + ICON_HEIGHT, this._alert.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Alert was not calculated correctly with a header, icon, gap, and long message.\",\n\t\t\t\tICON_WIDTH + GAP + this._textRenderer.width, this._alert.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Alert was not calculated correctly with a header, icon, gap, and long message.\",\n\t\t\t\tHEADER_HEIGHT + ICON_HEIGHT, this._alert.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithHeaderMessageAndMeasureViewPortSetToFalse():void\n\t\t{\n\t\t\tvar message:String = \"I am the very model of a modern major general\";\n\t\t\tthis.addHeader();\n\t\t\tthis._alert.message = message;\n\t\t\tthis._alert.measureViewPort = false;\n\t\t\tthis._alert.validate();\n\n\t\t\tthis._textRenderer.text = message;\n\t\t\tthis._textRenderer.validate();\n\t\t\t\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Alert was not calculated correctly with a header.\",\n\t\t\t\tHEADER_WIDTH, this._alert.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Alert was not calculated correctly with a header.\",\n\t\t\t\tHEADER_HEIGHT, this._alert.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Alert was not calculated correctly with a header.\",\n\t\t\t\tHEADER_WIDTH, this._alert.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Alert was not calculated correctly with a header.\",\n\t\t\t\tHEADER_HEIGHT, this._alert.minHeight);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/AnchorLayoutTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Label;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.layout.AnchorLayout;\n\timport feathers.layout.AnchorLayoutData;\n\timport feathers.layout.LayoutBoundsResult;\n\timport feathers.layout.ViewPortBounds;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\n\tpublic class AnchorLayoutTests\n\t{\n\t\tprivate var _layout:AnchorLayout;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._layout = new AnchorLayout();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._layout = null;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentWidth():void\n\t\t{\n\t\t\tvar viewPortWidth:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar layoutData1:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tlayoutData1.percentWidth = 50;\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = viewPortWidth;\n\t\t\tbounds.explicitHeight = 640;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayoutData with percentWidth results in incorrect item width\", viewPortWidth / 2, item1.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentWidthGreaterThan100():void\n\t\t{\n\t\t\tvar viewPortWidth:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar layoutData1:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tlayoutData1.percentWidth = 150;\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = viewPortWidth;\n\t\t\tbounds.explicitHeight = 640;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayoutData with percentWidth > 100 does not clamp to 100\", viewPortWidth, item1.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentWidthLessThan0():void\n\t\t{\n\t\t\tvar viewPortWidth:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar layoutData1:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tlayoutData1.percentWidth = -50;\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = viewPortWidth;\n\t\t\tbounds.explicitHeight = 640;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayoutData with percentWidth < 0 does not clamp to 0\", 0, item1.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentHeight():void\n\t\t{\n\t\t\tvar viewPortHeight:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar layoutData1:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tlayoutData1.percentHeight = 50;\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 640;\n\t\t\tbounds.explicitHeight = viewPortHeight;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayoutData with percentHeight results in incorrect item height\", viewPortHeight / 2, item1.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentHeightGreaterThan100():void\n\t\t{\n\t\t\tvar viewPortHeight:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar layoutData1:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tlayoutData1.percentHeight = 150;\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 640;\n\t\t\tbounds.explicitHeight = viewPortHeight;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayoutData with percentHeight > 100 does not clamp to 100\", viewPortHeight, item1.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentHeightLessThan0():void\n\t\t{\n\t\t\tvar viewPortHeight:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar layoutData1:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tlayoutData1.percentHeight = -50;\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 640;\n\t\t\tbounds.explicitHeight = viewPortHeight;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayoutData with percentHeight < 0 does not clamp to 0\", 0, item1.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentWidthWithExplicitMinWidth():void\n\t\t{\n\t\t\tvar viewPortWidth:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.minWidth = 400;\n\t\t\tvar layoutData1:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tlayoutData1.percentWidth = 50;\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = viewPortWidth;\n\t\t\tbounds.explicitHeight = 640;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayoutData with percentWidth and larger item explicitMinWidth results in incorrect item width\",\n\t\t\t\t400, item1.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentHeightWithExplicitMinHeight():void\n\t\t{\n\t\t\tvar viewPortHeight:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.minHeight = 400;\n\t\t\tvar layoutData1:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tlayoutData1.percentHeight = 50;\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 640;\n\t\t\tbounds.explicitHeight = viewPortHeight;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayoutData with percentHeight and larger item explicitMinHeight results in incorrect item height\",\n\t\t\t\t400, item1.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentWidthWithExplicitMaxWidth():void\n\t\t{\n\t\t\tvar viewPortWidth:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.maxWidth = 250;\n\t\t\tvar layoutData1:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tlayoutData1.percentWidth = 50;\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = viewPortWidth;\n\t\t\tbounds.explicitHeight = 640;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayoutData with percentWidth and smaller item explicitMaxWidth results in incorrect item width\",\n\t\t\t\t250, item1.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentHeightWithExplicitMaxHeight():void\n\t\t{\n\t\t\tvar viewPortHeight:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.maxHeight = 250;\n\t\t\tvar layoutData1:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tlayoutData1.percentHeight = 50;\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 640;\n\t\t\tbounds.explicitHeight = viewPortHeight;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayoutData with percentHeight and larger item explicitMaxHeight results in incorrect item height\",\n\t\t\t\t250, item1.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentWidthWithWrappingLabelAndMaxWidth():void\n\t\t{\n\t\t\tvar viewPortMaxWidth:Number = 100;\n\t\t\tvar item1:Label = new Label();\n\t\t\titem1.text = \"I am the very model of a modern Major General\";\n\t\t\titem1.wordWrap = true;\n\t\t\titem1.validate();\n\t\t\tvar unwrappedHeight:Number = item1.height;\n\t\t\tvar layoutData1:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tlayoutData1.percentWidth = 100;\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.maxWidth = viewPortMaxWidth;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\t//since we're setting maxWidth, the width may actually be smaller\n\t\t\tAssert.assertTrue(\"AnchorLayoutData with percentWidth with a wrapping Label results in incorrect width\",\n\t\t\t\tviewPortMaxWidth >= item1.width);\n\t\t\t//we're only checking that it has more than one line\n\t\t\tAssert.assertTrue(\"AnchorLayoutData with percentWidth on a wrapping Label results in height that is too small\",\n\t\t\t\tunwrappedHeight < item1.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLeftAndRightWithExplicitMaxWidth():void\n\t\t{\n\t\t\tvar viewPortWidth:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.maxWidth = 250;\n\t\t\tvar layoutData1:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tlayoutData1.left = 10;\n\t\t\tlayoutData1.right = 10;\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = viewPortWidth;\n\t\t\tbounds.explicitHeight = 320;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayoutData with left and right and smaller item explicitMaxWidth results in incorrect item width\",\n\t\t\t\t250, item1.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTopAndBottomWithExplicitMaxHeight():void\n\t\t{\n\t\t\tvar viewPortHeight:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.maxHeight = 250;\n\t\t\tvar layoutData1:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tlayoutData1.top = 10;\n\t\t\tlayoutData1.bottom = 10;\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 320;\n\t\t\tbounds.explicitHeight = viewPortHeight;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayoutData with top and bottom and smaller item explicitMaxHeight results in incorrect item height\",\n\t\t\t\t250, item1.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLeftAndRightWithWrappingLabelAndMaxWidth():void\n\t\t{\n\t\t\tvar viewPortMaxWidth:Number = 100;\n\t\t\tvar left:Number = 10;\n\t\t\tvar right:Number = 15;\n\t\t\tvar item1:Label = new Label();\n\t\t\titem1.text = \"I am the very model of a modern Major General\";\n\t\t\titem1.wordWrap = true;\n\t\t\titem1.validate();\n\t\t\tvar unwrappedHeight:Number = item1.height;\n\t\t\tvar layoutData1:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tlayoutData1.left = left;\n\t\t\tlayoutData1.right = right;\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.maxWidth = viewPortMaxWidth;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\t//since we're setting maxWidth, the width may actually be smaller\n\t\t\tAssert.assertTrue(\"AnchorLayoutData with left and right on a wrapping Label results in incorrect width\",\n\t\t\t\tviewPortMaxWidth - left - right >= item1.width);\n\t\t\t//we're only checking that it has more than one line\n\t\t\tAssert.assertTrue(\"AnchorLayoutData with left and right on a wrapping Label results in height that is too small\",\n\t\t\t\tunwrappedHeight < item1.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChildWithCalculatedMinDimensionsAndPercentDimensions():void\n\t\t{\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar layoutData1:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tlayoutData1.percentWidth = 100;\n\t\t\tlayoutData1.percentHeight = 100;\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar child:Quad = new Quad(100, 150, 0xff00ff);\n\t\t\titem1.addChild(child);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayout without explicit view port width and child with percentWidth and calculated minWidth results in wrong view port width\",\n\t\t\t\t100, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayout without explicit view port height and child with percentHeight and calculated minHeight results in wrong view port height\",\n\t\t\t\t150, result.viewPortHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChildWithExplicitMinWidthAndPercentWidth():void\n\t\t{\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar layoutData1:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tlayoutData1.percentWidth = 100;\n\t\t\tlayoutData1.percentHeight = 100;\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar child:Quad = new Quad(100, 100, 0xff00ff);\n\t\t\titem1.minWidth = 200;\n\t\t\titem1.minHeight = 250;\n\t\t\titem1.addChild(child);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayout without explicit view port width and child with percentWidth and explicit minWidth results in wrong view port width\",\n\t\t\t\t200, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayout without explicit view port width and child with percentWidth and explicit minWidth results in wrong child width\",\n\t\t\t\t200, item1.width);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayout without explicit view port height and child with percentHeight and explicit minHeight results in wrong view port height\",\n\t\t\t\t250, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayout without explicit view port height and child with percentHeight and explicit minHeight results in wrong child height\",\n\t\t\t\t250, item1.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChildWithCalculatedMinWidthAndPercentWidthWithExplicitWidth():void\n\t\t{\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar layoutData1:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tlayoutData1.percentWidth = 100;\n\t\t\tlayoutData1.percentHeight = 100;\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar child:Quad = new Quad(100, 100, 0xff00ff);\n\t\t\titem1.addChild(child);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 50;\n\t\t\tbounds.explicitHeight = 75;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayout with explicit view port width and child with percentWidth and calculated minWidth results in wrong view port width\",\n\t\t\t\t50, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayout with explicit view port width and child with percentWidth and calculated minWidth results in wrong child width\",\n\t\t\t\t50, item1.width);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayout with explicit view port height and child with percentHeight and calculated minHeight results in wrong view port height\",\n\t\t\t\t75, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayout with explicit view port height and child with percentHeight and calculated minHeight results in wrong child height\",\n\t\t\t\t75, item1.height);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic function testChildWithCalculatedMinWidthAndPercentWidthWithViewPortMinWidth():void\n\t\t{\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar layoutData1:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tlayoutData1.percentWidth = 100;\n\t\t\tlayoutData1.percentHeight = 100;\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar child:Quad = new Quad(100, 150, 0xff00ff);\n\t\t\titem1.addChild(child);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.minWidth = 10;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayout with explicit view port minWidth and child with percentWidth and calculated minWidth results in wrong view port width\",\n\t\t\t\t100, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayout with explicit view port minWidth and child with percentWidth and calculated minWidth results in wrong child width\",\n\t\t\t\t100, item1.width);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayout with explicit view port minWidth and child with percentHeight and calculated minHeight results in wrong view port height\",\n\t\t\t\t150, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayout with explicit view port minWidth and child with percentHeight and calculated minHeight results in wrong child height\",\n\t\t\t\t150, item1.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChildWithCalculatedWidthAndSmallerCalculatedMinWidthAndPercentWidth():void\n\t\t{\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar layoutData1:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tlayoutData1.percentWidth = 100;\n\t\t\tlayoutData1.percentHeight = 100;\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar child:LayoutGroup = new LayoutGroup();\n\t\t\tchild.width = 100;\n\t\t\tchild.height = 150;\n\t\t\tchild.minWidth = 50;\n\t\t\tchild.minHeight = 50;\n\t\t\titem1.backgroundSkin = child;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayout without explicit view port width and child with percentWidth, calculated width, and calculated minWidth results in wrong view port width\",\n\t\t\t\t100, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayout without explicit view port width and child with percentWidth, calculated width, and calculated minWidth results in wrong child width\",\n\t\t\t\t100, item1.width);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayout without explicit view port height and child with percentHeight, calculated height, and calculated minHeight results in wrong view port height\",\n\t\t\t\t150, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"AnchorLayout without explicit view port height and child with percentHeight, calculated height, and calculated minHeight results in wrong child height\",\n\t\t\t\t150, item1.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLeftAndTop():void\n\t\t{\n\t\t\tvar left:Number = 10;\n\t\t\tvar top:Number = 15;\n\t\t\tvar width:Number = 100;\n\t\t\tvar height:Number = 150;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.backgroundSkin = new Quad(width, height, 0xff00ff);\n\t\t\titem1.validate();\n\t\t\tvar layoutData1:AnchorLayoutData = new AnchorLayoutData();\n\t\t\tlayoutData1.left = left;\n\t\t\tlayoutData1.top = top;\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertTrue(\"AnchorLayoutData with left and top results in incorrect view port width\",\n\t\t\t\twidth + left, result.viewPortWidth);\n\t\t\tAssert.assertTrue(\"AnchorLayoutData with left and top results in incorrect view port height\",\n\t\t\t\theight + top, result.viewPortHeight);\n\t\t\tAssert.assertTrue(\"AnchorLayoutData with left and top results in incorrect content width\",\n\t\t\t\twidth + left, result.contentWidth);\n\t\t\tAssert.assertTrue(\"AnchorLayoutData with left and top results in incorrect content height\",\n\t\t\t\theight + top, result.contentHeight);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ArrayCollectionTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.data.ArrayCollection;\n\timport feathers.data.ListCollection;\n\timport feathers.events.CollectionEventType;\n\n\timport org.flexunit.Assert;\n\n\timport starling.events.Event;\n\n\tpublic class ArrayCollectionTests\n\t{\n\t\tprivate var _collection:ArrayCollection;\n\t\tprivate var _a:Object;\n\t\tprivate var _b:Object;\n\t\tprivate var _c:Object;\n\t\tprivate var _d:Object;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._a = { label: \"One\", value: 0 };\n\t\t\tthis._b = { label: \"Two\", value: 2 };\n\t\t\tthis._c = { label: \"Three\", value: 3 };\n\t\t\tthis._d = { label: \"Four\", value: 1 };\n\t\t\tthis._collection = new ArrayCollection(\n\t\t\t[\n\t\t\t\tthis._a,\n\t\t\t\tthis._b,\n\t\t\t\tthis._c,\n\t\t\t\tthis._d,\n\t\t\t]);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._collection = null;\n\t\t}\n\n\t\tprivate function filterFunction(item:Object):Boolean\n\t\t{\n\t\t\tif(item === this._a || item === this._c)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tprivate function sortCompareFunction(a:Object, b:Object):int\n\t\t{\n\t\t\tvar valueA:Number = a.value as Number;\n\t\t\tvar valueB:Number = b.value as Number;\n\t\t\tif(valueA < valueB)\n\t\t\t{\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif(valueA > valueB)\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveAll():void\n\t\t{\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedAll:Boolean = false;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ALL, function(event:Event):void\n\t\t\t{\n\t\t\t\thasRemovedAll = true;\n\t\t\t});\n\t\t\tvar hasReset:Boolean = false;\n\t\t\tthis._collection.addEventListener(CollectionEventType.RESET, function(event:Event):void\n\t\t\t{\n\t\t\t\thasReset = true;\n\t\t\t});\n\t\t\tthis._collection.removeAll();\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\t//reset used to be dispatched, but REMOVE_ALL is better\n\t\t\tAssert.assertFalse(\"CollectionEventType.RESET was incorrectly dispatched\", hasReset);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REMOVE_ALL was not dispatched\", hasRemovedAll);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed to 0\",\n\t\t\t\t0, this._collection.length);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemAt():void\n\t\t{\n\t\t\tvar itemToRemove:Object = this._collection.getItemAt(1);\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.removeItemAt(expectedIndex);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed\",\n\t\t\t\toriginalLength - 1, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not removed\",\n\t\t\t\t-1, this._collection.getItemIndex(itemToRemove));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.REMOVE_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItem():void\n\t\t{\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar itemToRemove:Object = this._collection.getItemAt(expectedIndex);\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.removeItem(itemToRemove);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed\",\n\t\t\t\toriginalLength - 1, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not removed\",\n\t\t\t\t-1, this._collection.getItemIndex(itemToRemove));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.REMOVE_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testShift():void\n\t\t{\n\t\t\tvar itemToRemove:Object = this._collection.getItemAt(0);\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar expectedIndex:int = 0;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.shift();\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed\",\n\t\t\t\toriginalLength - 1, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not removed\",\n\t\t\t\t-1, this._collection.getItemIndex(itemToRemove));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.REMOVE_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPop():void\n\t\t{\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar itemToRemove:Object = this._collection.getItemAt(originalLength - 1);\n\t\t\tvar expectedIndex:int = originalLength - 1;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.pop();\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed\",\n\t\t\t\toriginalLength - 1, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not removed\",\n\t\t\t\t-1, this._collection.getItemIndex(itemToRemove));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.REMOVE_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItem():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar expectedIndex:int = originalLength;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.addItem(itemToAdd);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed\",\n\t\t\t\toriginalLength + 1, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not added at the correct index\",\n\t\t\t\texpectedIndex, this._collection.getItemIndex(itemToAdd));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.ADD_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemAt():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.addItemAt(itemToAdd, expectedIndex);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed\",\n\t\t\t\toriginalLength + 1, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not added at the correct index\",\n\t\t\t\texpectedIndex, this._collection.getItemIndex(itemToAdd));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.ADD_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testUnshift():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar expectedIndex:int = 0;\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.unshift(itemToAdd);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed\",\n\t\t\t\toriginalLength + 1, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not added at the correct index\",\n\t\t\t\texpectedIndex, this._collection.getItemIndex(itemToAdd));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.ADD_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPush():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar expectedIndex:int = originalLength;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.push(itemToAdd);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed\",\n\t\t\t\toriginalLength + 1, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not added at the correct index\",\n\t\t\t\texpectedIndex, this._collection.getItemIndex(itemToAdd));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.ADD_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemAt():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REPLACE_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.setItemAt(itemToAdd, expectedIndex);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REPLACE_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was incorrectly changed\",\n\t\t\t\toriginalLength, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not added at the correct index\",\n\t\t\t\texpectedIndex, this._collection.getItemIndex(itemToAdd));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.REPLACE_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testContainsWithItemInCollection():void\n\t\t{\n\t\t\tvar item:Object = this._collection.getItemAt(1);\n\t\t\tAssert.assertStrictlyEquals(\"contains() incorrectly returned false\",\n\t\t\t\ttrue, this._collection.contains(item));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testContainsWithItemNotInCollection():void\n\t\t{\n\t\t\tvar item:Object = {};\n\t\t\tAssert.assertStrictlyEquals(\"contains() incorrectly returned true\",\n\t\t\t\tfalse, this._collection.contains(item));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemIndexWithItemInCollection():void\n\t\t{\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar item:Object = this._collection.getItemAt(expectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"getItemIndex() returned the incorrect value\",\n\t\t\t\texpectedIndex, this._collection.getItemIndex(item));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemIndexWithItemNotInCollection():void\n\t\t{\n\t\t\tvar item:Object = {};\n\t\t\tAssert.assertStrictlyEquals(\"getItemIndex() returned the incorrect value\",\n\t\t\t\t-1, this._collection.getItemIndex(item));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDispose():void\n\t\t{\n\t\t\tvar itemCount:int = this._collection.length;\n\t\t\tvar disposedCount:int = 0;\n\t\t\tthis._collection.dispose(function(item:Object):void\n\t\t\t{\n\t\t\t\titem.isDisposed = true;\n\t\t\t\tdisposedCount++;\n\t\t\t});\n\t\t\tAssert.assertStrictlyEquals(\"Incorrect number of items disposed when calling dispose() on ArrayCollection\",\n\t\t\t\titemCount, disposedCount);\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = this._collection.getItemAt(i);\n\t\t\t\tAssert.assertTrue(\"Item was not included when calling dispose() on ArrayCollection\", item.isDisposed);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDisposeWithFilterFunction():void\n\t\t{\n\t\t\tvar itemCount:int = this._collection.length;\n\t\t\tthis._collection.filterFunction = function(item:Object):Boolean\n\t\t\t{\n\t\t\t\treturn item.label.charAt(0) === \"O\";\n\t\t\t};\n\t\t\tvar filteredCount:int = this._collection.length;\n\t\t\tAssert.assertFalse(\"Filtered collection length must change\", itemCount === filteredCount);\n\t\t\tvar disposedCount:int = 0;\n\t\t\tthis._collection.dispose(function(item:Object):void\n\t\t\t{\n\t\t\t\titem.isDisposed = true;\n\t\t\t\tdisposedCount++;\n\t\t\t});\n\t\t\tAssert.assertStrictlyEquals(\"Incorrect number of items disposed when calling dispose() on ArrayCollection\",\n\t\t\t\titemCount, disposedCount);\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = this._collection.getItemAt(i);\n\t\t\t\tAssert.assertTrue(\"Item was not included when calling dispose() on ArrayCollection\", item.isDisposed);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSortCompareFunction():void\n\t\t{\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: sortCompareFunction order is incorrect.\",\n\t\t\t\tthis._a, this._collection.getItemAt(0));\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: sortCompareFunction order is incorrect.\",\n\t\t\t\tthis._d, this._collection.getItemAt(1));\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: sortCompareFunction order is incorrect.\",\n\t\t\t\tthis._b, this._collection.getItemAt(2));\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: sortCompareFunction order is incorrect.\",\n\t\t\t\tthis._c, this._collection.getItemAt(3));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSortCompareFunctionAndFilterFunction():void\n\t\t{\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\tthis._collection.filterFunction = this.filterFunction;\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: sortCompareFunction and filterFunction length is incorrect.\",\n\t\t\t\t2, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: sortCompareFunction order is incorrect with filterFunction.\",\n\t\t\t\tthis._d, this._collection.getItemAt(0));\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: sortCompareFunction order is incorrect with filterFunction.\",\n\t\t\t\tthis._b, this._collection.getItemAt(1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetSortCompareFunctionToNull():void\n\t\t{\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\t//get an item so that we know the sorting was applied\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: sortCompareFunction order is incorrect.\",\n\t\t\t\tthis._c, this._collection.getItemAt(3));\n\n\t\t\tthis._collection.sortCompareFunction = null;\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: set sortCompareFunction to null order is incorrect.\",\n\t\t\t\tthis._a, this._collection.getItemAt(0));\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: set sortCompareFunction to null order is incorrect.\",\n\t\t\t\tthis._b, this._collection.getItemAt(1));\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: set sortCompareFunction to null order is incorrect.\",\n\t\t\t\tthis._c, this._collection.getItemAt(2));\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: set sortCompareFunction to null order is incorrect.\",\n\t\t\t\tthis._d, this._collection.getItemAt(3));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSortCompareFunctionWithAddItem():void\n\t\t{\n\t\t\tvar newItem:Object = { label: \"New Item\", value: 1.5 };\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\tthis._collection.addItem(newItem);\n\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: addItem() with sortCompareFunction does not add at correct sorted index.\",\n\t\t\t\tnewItem, this._collection.getItemAt(2));\n\n\t\t\tthis._collection.sortCompareFunction = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: addItem() with sortCompareFunction does not add at correct unsorted index.\",\n\t\t\t\tnewItem, this._collection.getItemAt(4));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSortCompareFunctionWithAddItemAt():void\n\t\t{\n\t\t\tvar newItem:Object = { label: \"New Item\", value: 1.5 };\n\t\t\tvar newIndex:int = 1;\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\tthis._collection.addItemAt(newItem, newIndex);\n\n\t\t\t//the index we passed in isn't necessarily the same while sorted\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: addItemAt() with sortCompareFunction does not add at correct sorted index.\",\n\t\t\t\tnewItem, this._collection.getItemAt(2));\n\n\t\t\tthis._collection.sortCompareFunction = null;\n\n\t\t\t//and it might not even be the same while unsorted!\n\t\t\t//that's because, in the unsorted data, it will be placed relative\n\t\t\t//to the item in the sorted data that was at the index passed to\n\t\t\t//addItemAt(). confusing, but it's consistent with setItemAt() and\n\t\t\t//filtered collections\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: addItemAt() with sortCompareFunction does not add at correct unsorted index.\",\n\t\t\t\tnewItem, this._collection.getItemAt(3));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSortCompareFunctionWithRemoveItemAt():void\n\t\t{\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\tthis._collection.removeItemAt(2);\n\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: removeItemAt() with sortCompareFunction removed incorrect item in sorted data.\",\n\t\t\t\tthis._a, this._collection.getItemAt(0));\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: removeItemAt() with sortCompareFunction removed incorrect item in sorted data.\",\n\t\t\t\tthis._d, this._collection.getItemAt(1));\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: removeItemAt() with sortCompareFunction removed incorrect item in sorted data.\",\n\t\t\t\tthis._c, this._collection.getItemAt(2));\n\n\t\t\tthis._collection.sortCompareFunction = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: removeItemAt() with sortCompareFunction removed incorrect item in unsorted data.\",\n\t\t\t\tthis._a, this._collection.getItemAt(0));\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: removeItemAt() with sortCompareFunction removed incorrect item in unsorted data.\",\n\t\t\t\tthis._c, this._collection.getItemAt(1));\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: removeItemAt() with sortCompareFunction removed incorrect item in unsorted data.\",\n\t\t\t\tthis._d, this._collection.getItemAt(2));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSortCompareFunctionWithRemoveItem():void\n\t\t{\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\tthis._collection.removeItem(this._b);\n\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: removeItem() with sortCompareFunction removed incorrect item in sorted data.\",\n\t\t\t\tthis._a, this._collection.getItemAt(0));\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: removeItem() with sortCompareFunction removed incorrect item in sorted data.\",\n\t\t\t\tthis._d, this._collection.getItemAt(1));\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: removeItem() with sortCompareFunction removed incorrect item in sorted data.\",\n\t\t\t\tthis._c, this._collection.getItemAt(2));\n\n\t\t\tthis._collection.sortCompareFunction = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: removeItem() with sortCompareFunction removed incorrect item in unsorted data.\",\n\t\t\t\tthis._a, this._collection.getItemAt(0));\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: removeItem() with sortCompareFunction removed incorrect item in unsorted data.\",\n\t\t\t\tthis._c, this._collection.getItemAt(1));\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: removeItem() with sortCompareFunction removed incorrect item in unsorted data.\",\n\t\t\t\tthis._d, this._collection.getItemAt(2));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSortCompareFunctionWithSetItemAt():void\n\t\t{\n\t\t\tvar newItem:Object = { label: \"New Item\", value: 1.5 };\n\t\t\tvar newIndex:int = 0;\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\tthis._collection.setItemAt(newItem, newIndex);\n\n\t\t\t//the index we passed in isn't necessarily the same while sorted\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: setItemAt() with sortCompareFunction does not add at correct sorted index.\",\n\t\t\t\tnewItem, this._collection.getItemAt(1));\n\t\t\tAssert.assertFalse(\"ArrayCollection: setItemAt() with sortCompareFunction does not replace correct item.\",\n\t\t\t\tthis._collection.contains(this._a));\n\n\t\t\tthis._collection.sortCompareFunction = null;\n\n\t\t\t//however, that index should be the same when the collection is unsorted\n\t\t\tAssert.assertStrictlyEquals(\"ArrayCollection: setItemAt() with sortCompareFunction does not add at correct unsorted index.\",\n\t\t\t\tnewItem, this._collection.getItemAt(newIndex));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ArrayHierarchicalCollectionTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.data.ArrayHierarchicalCollection;\n\timport feathers.events.CollectionEventType;\n\n\timport org.flexunit.Assert;\n\n\timport starling.events.Event;\n\n\tpublic class ArrayHierarchicalCollectionTests\n\t{\n\t\tprivate var _collection:ArrayHierarchicalCollection;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._collection = new ArrayHierarchicalCollection(\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\tlabel: \"1\",\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{label: \"1-A\"},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: \"1-B\",\n\t\t\t\t\t\t\tchildren:\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t{label: \"1-B-I\"},\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{label: \"1-C\"},\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: \"2\",\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{label: \"2-A\"},\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{ label: \"3\" },\n\t\t\t\t{\n\t\t\t\t\tlabel: \"4\",\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{label: \"4-A\"},\n\t\t\t\t\t\t{label: \"4-B\"},\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t]);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._collection = null;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetLength():void\n\t\t{\n\t\t\tvar length:int = this._collection.getLength();\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: getLengthAtLocation() returned incorrect length\",\n\t\t\t\t4, length);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetLengthNested():void\n\t\t{\n\t\t\tvar length:int = this._collection.getLength(3);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: getLengthAtLocation() returned incorrect length\",\n\t\t\t\t2, length);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetLengthAtLocationWithNull():void\n\t\t{\n\t\t\tvar length:int = this._collection.getLengthAtLocation();\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: getLengthAtLocation() returned incorrect length\",\n\t\t\t\t4, length);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemAt():void\n\t\t{\n\t\t\tvar item:Object = this._collection.getItemAt(1);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: getItemAt() returned incorrect item\",\n\t\t\t\tthis._collection.arrayData[1], item);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemAtNested():void\n\t\t{\n\t\t\tvar item:Object = this._collection.getItemAt(0, 1);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: getItemAt() returned incorrect item\",\n\t\t\t\tthis._collection.arrayData[0].children[1], item);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemAtLocation():void\n\t\t{\n\t\t\tvar indices:Vector.<int> = new <int>[1];\n\t\t\tvar item:Object = this._collection.getItemAtLocation(indices);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: getItemAtLocation() returned incorrect item\",\n\t\t\t\tthis._collection.arrayData[1], item);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemAtNestedLocation():void\n\t\t{\n\t\t\tvar indices:Vector.<int> = new <int>[0, 1];\n\t\t\tvar item:Object = this._collection.getItemAtLocation(indices);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: getItemAtLocation() returned incorrect item\",\n\t\t\t\tthis._collection.arrayData[0].children[1], item);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemAtNullLocation():void\n\t\t{\n\t\t\tvar item:Object = this._collection.getItemAtLocation(null);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: getItemAtLocation() returned incorrect item\",\n\t\t\t\tnull, item);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemAtEmptyLocation():void\n\t\t{\n\t\t\tvar indices:Vector.<int> = new <int>[];\n\t\t\tvar item:Object = this._collection.getItemAtLocation(indices);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: getItemAtLocation() returned incorrect item\",\n\t\t\t\tnull, item);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveAll():void\n\t\t{\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedAll:Boolean = false;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ALL, function(event:Event):void\n\t\t\t{\n\t\t\t\thasRemovedAll = true;\n\t\t\t});\n\t\t\tvar hasReset:Boolean = false;\n\t\t\tthis._collection.addEventListener(CollectionEventType.RESET, function(event:Event):void\n\t\t\t{\n\t\t\t\thasReset = true;\n\t\t\t});\n\t\t\tthis._collection.removeAll();\n\t\t\tAssert.assertTrue(\"ArrayHierarchicalCollection: Event.CHANGE was not dispatched after removeAll()\", hasChanged);\n\t\t\tAssert.assertFalse(\"ArrayHierarchicalCollection: CollectionEventType.RESET was incorrectly dispatched after removeAll()\", hasReset);\n\t\t\tAssert.assertTrue(\"ArrayHierarchicalCollection: CollectionEventType.REMOVE_ALL was not dispatched after removeAll()\", hasRemovedAll);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: the getLength() value was not changed to 0 after removeAll()\",\n\t\t\t\t0, this._collection.getLength());\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemAtLocation():void\n\t\t{\n\t\t\tvar indicesToRemove:Vector.<int> = new <int>[1];\n\t\t\tvar itemToRemove:Object = this._collection.getItemAtLocation(indicesToRemove);\n\t\t\tvar originalLength:int = this._collection.getLength();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.removeItemAtLocation(indicesToRemove);\n\t\t\tAssert.assertTrue(\"ArrayHierarchicalCollection: Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"ArrayHierarchicalCollection: CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The getLength() value was not changed\",\n\t\t\t\toriginalLength - 1, this._collection.getLength());\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The item was not removed\",\n\t\t\t\t0, this._collection.getItemLocation(itemToRemove).length);\n\t\t\tAssert.failNull(\"ArrayHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (length)\",\n\t\t\t\t1, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (value)\",\n\t\t\t\tindicesToRemove[0], indicesFromEvent[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemAtNestedLocation():void\n\t\t{\n\t\t\tvar indicesToRemove:Vector.<int> = new <int>[0, 1];\n\t\t\tvar itemToRemove:Object = this._collection.getItemAtLocation(indicesToRemove);\n\t\t\tvar originalParentLength:int = this._collection.getLength(indicesToRemove[0]);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.removeItemAtLocation(indicesToRemove);\n\t\t\tAssert.assertTrue(\"ArrayHierarchicalCollection: Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"ArrayHierarchicalCollection: CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The getLength() value was not changed\",\n\t\t\t\toriginalParentLength - 1, this._collection.getLength(indicesToRemove[0]));\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The item was not removed\",\n\t\t\t\t0, this._collection.getItemLocation(itemToRemove).length);\n\t\t\tAssert.failNull(\"ArrayHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (length)\",\n\t\t\t\t2, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (value)\",\n\t\t\t\tindicesToRemove[0], indicesFromEvent[0]);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (value)\",\n\t\t\t\tindicesToRemove[1], indicesFromEvent[1]);\n\t\t}\n\n\t\t[Test(expects=\"RangeError\")]\n\t\tpublic function testRemoveItemAtNullLocation():void\n\t\t{\n\t\t\tthis._collection.removeItemAtLocation(null);\n\t\t}\n\n\t\t[Test(expects=\"RangeError\")]\n\t\tpublic function testRemoveItemAtEmptyLocation():void\n\t\t{\n\t\t\tvar indices:Vector.<int> = new <int>[];\n\t\t\tthis._collection.removeItemAtLocation(indices);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemAt():void\n\t\t{\n\t\t\tvar itemToRemove:Object = this._collection.getItemAt(1);\n\t\t\tvar originalLength:int = this._collection.getLength();\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.removeItemAt(expectedIndex);\n\t\t\tAssert.assertTrue(\"ArrayHierarchicalCollection: Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"ArrayHierarchicalCollection: CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The getLength() value was not changed\",\n\t\t\t\toriginalLength - 1, this._collection.getLength());\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The item was not removed\",\n\t\t\t\t0, this._collection.getItemLocation(itemToRemove).length);\n\t\t\tAssert.failNull(\"ArrayHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (length)\",\n\t\t\t\t1, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (value)\",\n\t\t\t\t1, indicesFromEvent[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItem():void\n\t\t{\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar itemToRemove:Object = this._collection.getItemAt(expectedIndex);\n\t\t\tvar originalLength:int = this._collection.getLength();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.removeItem(itemToRemove);\n\t\t\tAssert.assertTrue(\"ArrayHierarchicalCollection: Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"ArrayHierarchicalCollection: CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The getLength() value was not changed\",\n\t\t\t\toriginalLength - 1, this._collection.getLength());\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The item was not removed\",\n\t\t\t\t0, this._collection.getItemLocation(itemToRemove).length);\n\t\t\tAssert.failNull(\"ArrayHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (length)\",\n\t\t\t\t1, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (value)\",\n\t\t\t\t1, indicesFromEvent[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemAtLocation():void\n\t\t{\n\t\t\tvar location:Vector.<int> = new <int>[1];\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar originalLength:int = this._collection.getLength();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.addItemAtLocation(itemToAdd, location);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The getLength() value was not changed\",\n\t\t\t\toriginalLength + 1, this._collection.getLength());\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The item was not added\",\n\t\t\t\t1, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The item was not added at the correct index\",\n\t\t\t\tlocation[0], this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.failNull(\"ArrayHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (length)\",\n\t\t\t\t1, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (value)\",\n\t\t\t\tlocation[0], indicesFromEvent[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemAtNestedLocation():void\n\t\t{\n\t\t\tvar location:Vector.<int> = new <int>[0, 1];\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar originalParentLength:int = this._collection.getLength(location[0]);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.addItemAtLocation(itemToAdd, location);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The getLength() value was not changed\",\n\t\t\t\toriginalParentLength + 1, this._collection.getLength(location[0]));\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The item was not added\",\n\t\t\t\t2, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The item was not added at the correct index\",\n\t\t\t\tlocation[0], this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The item was not added at the correct index\",\n\t\t\t\tlocation[1], this._collection.getItemLocation(itemToAdd)[1]);\n\t\t\tAssert.failNull(\"ArrayHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (length)\",\n\t\t\t\t2, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (value)\",\n\t\t\t\tlocation[0], indicesFromEvent[0]);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (value)\",\n\t\t\t\tlocation[1], indicesFromEvent[1]);\n\t\t}\n\n\t\t[Test(expects=\"RangeError\")]\n\t\tpublic function testAddItemAtNullLocation():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tthis._collection.addItemAtLocation(itemToAdd, null);\n\t\t}\n\n\t\t[Test(expects=\"RangeError\")]\n\t\tpublic function testAddItemAtEmptyLocation():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar indices:Vector.<int> = new <int>[];\n\t\t\tthis._collection.addItemAtLocation(itemToAdd, indices);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemAt():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar originalLength:int = this._collection.getLength();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.addItemAt(itemToAdd, expectedIndex);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The getLength() value was not changed\",\n\t\t\t\toriginalLength + 1, this._collection.getLength());\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The item was not added\",\n\t\t\t\t1, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The item was not added at the correct index\",\n\t\t\t\texpectedIndex, this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.failNull(\"ArrayHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (length)\",\n\t\t\t\t1, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (value)\",\n\t\t\t\t1, indicesFromEvent[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemAtNested():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar originalParentLength:int = this._collection.getLength(0);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.addItemAt(itemToAdd, 0, 1);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The getLength() value was not changed\",\n\t\t\t\toriginalParentLength + 1, this._collection.getLength(0));\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The item was not added\",\n\t\t\t\t2, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The item was not added at the correct index\",\n\t\t\t\t0, this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The item was not added at the correct index\",\n\t\t\t\t1, this._collection.getItemLocation(itemToAdd)[1]);\n\t\t\tAssert.failNull(\"ArrayHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (length)\",\n\t\t\t\t2, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (value)\",\n\t\t\t\t0, indicesFromEvent[0]);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (value)\",\n\t\t\t\t1, indicesFromEvent[1]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemAt():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar originalLength:int = this._collection.getLength();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasReplacedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REPLACE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasReplacedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.setItemAt(itemToAdd, expectedIndex);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REPLACE_ITEM was not dispatched\", hasReplacedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was incorrectly changed\",\n\t\t\t\toriginalLength, this._collection.getLength());\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The item was not replaced\",\n\t\t\t\t1, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The item was not replaced at the correct index\",\n\t\t\t\texpectedIndex, this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.failNull(\"ArrayHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (length)\",\n\t\t\t\t1, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (value)\",\n\t\t\t\t1, indicesFromEvent[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemAtNested():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar originalParentLength:int = this._collection.getLength(0);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasReplacedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REPLACE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasReplacedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.setItemAt(itemToAdd, 0, 1);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REPLACE_ITEM was not dispatched\", hasReplacedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was incorrectly changed\",\n\t\t\t\toriginalParentLength, this._collection.getLength(0));\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The item was not replaced\",\n\t\t\t\t2, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The item was not replaced at the correct index\",\n\t\t\t\t0, this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The item was not replaced at the correct index\",\n\t\t\t\t1, this._collection.getItemLocation(itemToAdd)[1]);\n\t\t\tAssert.failNull(\"ArrayHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (length)\",\n\t\t\t\t2, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (value)\",\n\t\t\t\t0, indicesFromEvent[0]);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (value)\",\n\t\t\t\t1, indicesFromEvent[1]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemAtLocation():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar location:Vector.<int> = new <int>[1];\n\t\t\tvar originalLength:int = this._collection.getLength();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasReplacedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REPLACE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasReplacedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.setItemAtLocation(itemToAdd, location);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REPLACE_ITEM was not dispatched\", hasReplacedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was incorrectly changed\",\n\t\t\t\toriginalLength, this._collection.getLength());\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The item was not replaced\",\n\t\t\t\t1, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The item was not replaced at the correct index\",\n\t\t\t\tlocation[0], this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.failNull(\"ArrayHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (length)\",\n\t\t\t\t1, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (value)\",\n\t\t\t\tlocation[0], indicesFromEvent[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemAtNestedLocation():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar location:Vector.<int> = new <int>[0, 1];\n\t\t\tvar originalParentLength:int = this._collection.getLength(location[0]);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasReplacedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REPLACE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasReplacedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.setItemAtLocation(itemToAdd, location);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REPLACE_ITEM was not dispatched\", hasReplacedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was incorrectly changed\",\n\t\t\t\toriginalParentLength, this._collection.getLength(location[0]));\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The item was not replaced\",\n\t\t\t\t2, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The item was not replaced at the correct index\",\n\t\t\t\tlocation[0], this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The item was not replaced at the correct index\",\n\t\t\t\tlocation[1], this._collection.getItemLocation(itemToAdd)[1]);\n\t\t\tAssert.failNull(\"ArrayHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (length)\",\n\t\t\t\t2, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (value)\",\n\t\t\t\tlocation[0], indicesFromEvent[0]);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (value)\",\n\t\t\t\tlocation[1], indicesFromEvent[1]);\n\t\t}\n\n\t\t[Test(expects=\"RangeError\")]\n\t\tpublic function testSetItemAtNullLocation():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tthis._collection.setItemAtLocation(itemToAdd, null);\n\t\t}\n\n\t\t[Test(expects=\"RangeError\")]\n\t\tpublic function testSetItemAtEmptyLocation():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar indices:Vector.<int> = new <int>[];\n\t\t\tthis._collection.setItemAtLocation(itemToAdd, indices);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemLocationWithItemInCollection():void\n\t\t{\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar item:Object = this._collection.getItemAt(expectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: getItemLocation() returned the incorrect location (length)\",\n\t\t\t\t1, this._collection.getItemLocation(item).length);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: getItemLocation() returned the incorrect location (value)\",\n\t\t\t\texpectedIndex, this._collection.getItemLocation(item)[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemLocationNestedWithItemInCollection():void\n\t\t{\n\t\t\tvar location:Vector.<int> = new <int>[0, 1];\n\t\t\tvar item:Object = this._collection.getItemAtLocation(location);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: getItemLocation() returned the incorrect location (length)\",\n\t\t\t\tlocation.length, this._collection.getItemLocation(item).length);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: getItemLocation() returned the incorrect location (value)\",\n\t\t\t\tlocation[0], this._collection.getItemLocation(item)[0]);\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: getItemLocation() returned the incorrect location (value)\",\n\t\t\t\tlocation[1], this._collection.getItemLocation(item)[1]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemLocationWithItemNotInCollection():void\n\t\t{\n\t\t\tvar item:Object = {};\n\t\t\tAssert.assertStrictlyEquals(\"ArrayHierarchicalCollection: getItemLocation() returned the incorrect location (length)\",\n\t\t\t\t0, this._collection.getItemLocation(item).length);\n\t\t}\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/BasicButtonInternalStateTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.ButtonState;\n\n\timport flash.geom.Point;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\tpublic class BasicButtonInternalStateTests\n\t{\n\t\tprivate var _button:ButtonWithInternalState;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._button = new ButtonWithInternalState();\n\t\t\tTestFeathers.starlingRoot.addChild(this._button);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._button.removeFromParent(true);\n\t\t\tthis._button = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetSkinForStateWithoutSetSkinForState():void\n\t\t{\n\t\t\tAssert.assertNull(\"BasicButton getSkinForState(ButtonState.UP) must be null when setSkinForState() is not called\", this._button.getSkinForState(ButtonState.UP));\n\t\t\tAssert.assertNull(\"BasicButton getSkinForState(ButtonState.HOVER) must be null when setSkinForState() is not called\", this._button.getSkinForState(ButtonState.HOVER));\n\t\t\tAssert.assertNull(\"BasicButton getSkinForState(ButtonState.DOWN) must be null when setSkinForState() is not called\", this._button.getSkinForState(ButtonState.DOWN));\n\t\t\tAssert.assertNull(\"BasicButton getSkinForState(ButtonState.DISABLED) must be null when setSkinForState() is not called\", this._button.getSkinForState(ButtonState.DISABLED));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetSkinForState():void\n\t\t{\n\t\t\tvar defaultSkin:Quad = new Quad(200, 200);\n\t\t\tthis._button.defaultSkin = defaultSkin;\n\n\t\t\tvar upSkin:Quad = new Quad(200, 200);\n\t\t\tthis._button.setSkinForState(ButtonState.UP, upSkin);\n\n\t\t\tvar hoverSkin:Quad = new Quad(200, 200);\n\t\t\tthis._button.setSkinForState(ButtonState.HOVER, hoverSkin);\n\n\t\t\tvar downSkin:Quad = new Quad(200, 200);\n\t\t\tthis._button.setSkinForState(ButtonState.DOWN, downSkin);\n\n\t\t\tvar disabledSkin:Quad = new Quad(200, 200);\n\t\t\tthis._button.setSkinForState(ButtonState.DISABLED, disabledSkin);\n\t\t\t\n\t\t\tAssert.assertStrictlyEquals(\"BasicButton getSkinForState(ButtonState.UP) does not match value passed to setSkinForState()\", upSkin, this._button.getSkinForState(ButtonState.UP));\n\t\t\tAssert.assertStrictlyEquals(\"BasicButton getSkinForState(ButtonState.HOVER) does not match value passed to setSkinForState()\", hoverSkin, this._button.getSkinForState(ButtonState.HOVER));\n\t\t\tAssert.assertStrictlyEquals(\"BasicButton getSkinForState(ButtonState.DOWN) does not match value passed to setSkinForState()\", downSkin, this._button.getSkinForState(ButtonState.DOWN));\n\t\t\tAssert.assertStrictlyEquals(\"BasicButton getSkinForState(ButtonState.DISABLED) does not match value passed to setSkinForState()\", disabledSkin, this._button.getSkinForState(ButtonState.DISABLED));\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic function testDefaultCurrentSkin():void\n\t\t{\n\t\t\tvar defaultSkin:Quad = new Quad(200, 200);\n\t\t\tthis._button.defaultSkin = defaultSkin;\n\t\t\t\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BasicButton state is not ButtonState.UP with no touch\", ButtonState.UP, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"BasicButton skin is not defaultSkin when currentState is ButtonState.UP and skin not provided for this state\", defaultSkin, this._button.currentSkinInternal);\n\n\t\t\tthis._button.isEnabled = false;\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BasicButton state is not ButtonState.DISABLED when isEnabled is false\", ButtonState.DISABLED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"BasicButton skin is not defaultSkin when currentState is ButtonState.DISABLED and skin not provided for this state\", defaultSkin, this._button.currentSkinInternal);\n\n\t\t\tthis._button.isEnabled = true;\n\t\t\t\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tAssert.assertStrictlyEquals(\"Touch target must be button\", this._button, target);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.HOVER;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BasicButton state is not ButtonState.HOVER on TouchPhase.HOVER\", ButtonState.HOVER, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"BasicButton skin is not defaultSkin when currentState is ButtonState.HOVER and skin not provided for this state\", defaultSkin, this._button.currentSkinInternal);\n\t\t\t\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BasicButton state is not ButtonState.DOWN on TouchPhase.BEGAN\", ButtonState.DOWN, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"BasicButton skin is not defaultSkin when currentState is ButtonState.DOWN and skin not provided for this state\", defaultSkin, this._button.currentSkinInternal);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentSkinWithSetSkinForState():void\n\t\t{\n\t\t\tvar defaultSkin:Quad = new Quad(200, 200);\n\t\t\tthis._button.defaultSkin = defaultSkin;\n\n\t\t\tvar upSkin:Quad = new Quad(200, 200);\n\t\t\tthis._button.setSkinForState(ButtonState.UP, upSkin);\n\n\t\t\tvar hoverSkin:Quad = new Quad(200, 200);\n\t\t\tthis._button.setSkinForState(ButtonState.HOVER, hoverSkin);\n\n\t\t\tvar downSkin:Quad = new Quad(200, 200);\n\t\t\tthis._button.setSkinForState(ButtonState.DOWN, downSkin);\n\n\t\t\tvar disabledSkin:Quad = new Quad(200, 200);\n\t\t\tthis._button.setSkinForState(ButtonState.DISABLED, disabledSkin);\n\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BasicButton state is not ButtonState.UP with no touch\", ButtonState.UP, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"BasicButton skin does not match skin set with setSkinForState() when currentState is ButtonState.UP\", upSkin, this._button.currentSkinInternal);\n\t\t\t\n\t\t\tthis._button.isEnabled = false;\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BasicButton state is not ButtonState.DISABLED when isEnabled is false\", ButtonState.DISABLED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"BasicButton skin does not match skin set with setSkinForState() when currentState is ButtonState.DISABLED\", disabledSkin, this._button.currentSkinInternal);\n\n\t\t\tthis._button.isEnabled = true;\n\t\t\t\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tAssert.assertStrictlyEquals(\"Touch target must be button\", this._button, target);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.HOVER;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BasicButton state is not ButtonState.HOVER on TouchPhase.HOVER\", ButtonState.HOVER, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"BasicButton skin does not match skin set with setSkinForState() when currentState is ButtonState.HOVER and skin not provided for this state\", hoverSkin, this._button.currentSkinInternal);\n\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BasicButton state is not ButtonState.DOWN on TouchPhase.BEGAN\", ButtonState.DOWN, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"BasicButton skin does not match skin set with setSkinForState() when currentState is ButtonState.DOWN and skin not provided for this state\", downSkin, this._button.currentSkinInternal);\n\t\t}\n\t}\n}\n\nimport feathers.controls.BasicButton;\n\nimport starling.display.DisplayObject;\n\nclass ButtonWithInternalState extends BasicButton\n{\n\tpublic function ButtonWithInternalState()\n\t{\n\t\tsuper();\n\t}\n\t\n\tpublic function get currentSkinInternal():DisplayObject\n\t{\n\t\treturn this.currentSkin;\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/BasicButtonMeasurementTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.BasicButton;\n\timport feathers.controls.LayoutGroup;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class BasicButtonMeasurementTests\n\t{\n\t\tprivate static const BACKGROUND_WIDTH:Number = 10;\n\t\tprivate static const BACKGROUND_HEIGHT:Number = 12;\n\t\tprivate static const COMPLEX_BACKGROUND_WIDTH:Number = 54;\n\t\tprivate static const COMPLEX_BACKGROUND_HEIGHT:Number = 55;\n\t\tprivate static const COMPLEX_BACKGROUND_MIN_WIDTH:Number = 38;\n\t\tprivate static const COMPLEX_BACKGROUND_MIN_HEIGHT:Number = 39;\n\n\t\tprivate var _button:BasicButton;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._button = new BasicButton();\n\t\t\tTestFeathers.starlingRoot.addChild(this._button);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._button.removeFromParent(true);\n\t\t\tthis._button = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\tprivate function addSimpleBackground():void\n\t\t{\n\t\t\tthis._button.defaultSkin = new Quad(BACKGROUND_WIDTH, BACKGROUND_HEIGHT, 0xff00ff);\n\t\t}\n\n\t\tprivate function addComplexBackground():void\n\t\t{\n\t\t\tvar backgroundSkin:LayoutGroup = new LayoutGroup();\n\t\t\tbackgroundSkin.width = COMPLEX_BACKGROUND_WIDTH;\n\t\t\tbackgroundSkin.height = COMPLEX_BACKGROUND_HEIGHT;\n\t\t\tbackgroundSkin.minWidth = COMPLEX_BACKGROUND_MIN_WIDTH;\n\t\t\tbackgroundSkin.minHeight = COMPLEX_BACKGROUND_MIN_HEIGHT;\n\t\t\tthis._button.defaultSkin = backgroundSkin;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithSimpleBackgroundSkin():void\n\t\t{\n\t\t\tthis.addSimpleBackground();\n\t\t\tthis._button.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the BasicButton was not calculated correctly based on the background width.\",\n\t\t\t\tBACKGROUND_WIDTH, this._button.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the BasicButton was not calculated correctly based on the background height.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._button.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the BasicButton was not calculated correctly based on the background width.\",\n\t\t\t\tBACKGROUND_WIDTH, this._button.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the BasicButton was not calculated correctly based on the background height.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._button.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithComplexBackground():void\n\t\t{\n\t\t\tthis.addComplexBackground();\n\t\t\tthis._button.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the BasicButton was not calculated correctly based on the complex background width.\",\n\t\t\t\tCOMPLEX_BACKGROUND_WIDTH, this._button.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the BasicButton was not calculated correctly based on the complex background height.\",\n\t\t\t\tCOMPLEX_BACKGROUND_HEIGHT, this._button.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the BasicButton was not calculated correctly based on the complex background minWidth.\",\n\t\t\t\tCOMPLEX_BACKGROUND_MIN_WIDTH, this._button.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the BasicButton was not calculated correctly based on the complex background minHeight.\",\n\t\t\t\tCOMPLEX_BACKGROUND_MIN_HEIGHT, this._button.minHeight);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/BasicButtonTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.BasicButton;\n\timport feathers.controls.ButtonState;\n\timport feathers.events.FeathersEventType;\n\timport feathers.tests.supportClasses.DisposeFlagQuad;\n\n\timport flash.geom.Point;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\tpublic class BasicButtonTests\n\t{\n\t\tprivate var _button:BasicButton;\n\t\tprivate var _blocker:Quad;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._button = new BasicButton();\n\t\t\tthis._button.defaultSkin = new Quad(200, 200, 0xff00ff);\n\t\t\tTestFeathers.starlingRoot.addChild(this._button);\n\t\t\tthis._button.validate();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._button.removeFromParent(true);\n\t\t\tthis._button = null;\n\n\t\t\tif(this._blocker)\n\t\t\t{\n\t\t\t\tthis._blocker.removeFromParent(true);\n\t\t\t\tthis._blocker = null;\n\t\t\t}\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTriggeredEvent():void\n\t\t{\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tthis._button.addEventListener(Event.TRIGGERED, function(event:Event):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t//this touch does not move at all, so it should result in triggering\n\t\t\t//the button.\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertTrue(\"Event.TRIGGERED was not dispatched\", hasTriggered);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemovedBeforeTriggered():void\n\t\t{\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tthis._button.addEventListener(Event.TRIGGERED, function(event:Event):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._button.removeFromParent(false)\n\t\t\tAssert.assertFalse(\"Event.TRIGGERED must not be dispatched after removed from stage\", hasTriggered);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTouchMoveOutsideBeforeTriggeredEvent():void\n\t\t{\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tthis._button.addEventListener(Event.TRIGGERED, function(event:Event):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.globalX = 1000; //move the touch way outside the bounds of the button\n\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertFalse(\"Event.TRIGGERED was incorrectly dispatched\", hasTriggered);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testOtherDisplayObjectBlockingTriggeredEvent():void\n\t\t{\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tthis._button.addEventListener(Event.TRIGGERED, function(event:Event):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tthis._blocker = new Quad(200, 200, 0xff0000);\n\t\t\tTestFeathers.starlingRoot.addChild(this._blocker);\n\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertFalse(\"Event.TRIGGERED was incorrectly dispatched\", hasTriggered);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testButtonDefaultsToButtonStateUp():void\n\t\t{\n\t\t\tAssert.assertStrictlyEquals(\"Button currentState does not default to ButtonState.UP\", ButtonState.UP, this._button.currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testButtonDefaultsToButtonStateDisabledWhenIsEnabledIsFalse():void\n\t\t{\n\t\t\tthis._button.isEnabled = false;\n\t\t\tAssert.assertStrictlyEquals(\"Button currentState does not default to ButtonState.DISABLED when isEnabled is false\", ButtonState.DISABLED, this._button.currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testButtonStateHoverOnTouchPhaseHover():void\n\t\t{\n\t\t\tvar hasDispatchedStateChange:Boolean = false;\n\t\t\tthis._button.addEventListener(FeathersEventType.STATE_CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\tvar button:BasicButton = BasicButton(event.currentTarget);\n\t\t\t\tif(button.currentState === ButtonState.HOVER)\n\t\t\t\t{\n\t\t\t\t\thasDispatchedStateChange = true;\n\t\t\t\t}\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.HOVER;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertStrictlyEquals(\"Button currentState was not changed to ButtonState.HOVER on TouchPhase.HOVER\",\n\t\t\t\tButtonState.HOVER, this._button.currentState);\n\t\t\tAssert.assertTrue(\"Button must dispatch FeathersEventType.STATE_CHANGE when state is changed to ButtonState.HOVER\",\n\t\t\t\thasDispatchedStateChange);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testButtonStateUpAfterHoverOut():void\n\t\t{\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.HOVER;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tvar hasDispatchedStateChange:Boolean = false;\n\t\t\tthis._button.addEventListener(FeathersEventType.STATE_CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\tvar button:BasicButton = BasicButton(event.currentTarget);\n\t\t\t\tif(button.currentState === ButtonState.UP)\n\t\t\t\t{\n\t\t\t\t\thasDispatchedStateChange = true;\n\t\t\t\t}\n\t\t\t});\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, new <Touch>[]));\n\t\t\tAssert.assertStrictlyEquals(\"Button currentState was not changed to ButtonState.UP when TouchPhase.HOVER ends\",\n\t\t\t\tButtonState.UP, this._button.currentState);\n\t\t\tAssert.assertTrue(\"Button must dispatch FeathersEventType.STATE_CHANGE when state is changed to ButtonState.UP\",\n\t\t\t\thasDispatchedStateChange);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testButtonStateDownOnTouchPhaseBegan():void\n\t\t{\n\t\t\tvar hasDispatchedStateChange:Boolean = false;\n\t\t\tthis._button.addEventListener(FeathersEventType.STATE_CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\tvar button:BasicButton = BasicButton(event.currentTarget);\n\t\t\t\tif(button.currentState === ButtonState.DOWN)\n\t\t\t\t{\n\t\t\t\t\thasDispatchedStateChange = true;\n\t\t\t\t}\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertStrictlyEquals(\"Button currentState was not changed to ButtonState.DOWN on TouchPhase.BEGAN\",\n\t\t\t\tButtonState.DOWN, this._button.currentState);\n\t\t\tAssert.assertTrue(\"Button must dispatch FeathersEventType.STATE_CHANGE when state is changed to ButtonState.DOWN\",\n\t\t\t\thasDispatchedStateChange);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testButtonStateUpOnRemovedFromStage():void\n\t\t{\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tvar hasDispatchedStateChange:Boolean = false;\n\t\t\tthis._button.addEventListener(FeathersEventType.STATE_CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\tvar button:BasicButton = BasicButton(event.currentTarget);\n\t\t\t\tif(button.currentState === ButtonState.UP)\n\t\t\t\t{\n\t\t\t\t\thasDispatchedStateChange = true;\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis._button.removeFromParent(false);\n\t\t\tAssert.assertStrictlyEquals(\"Button currentState was not changed to ButtonState.UP on removed from stage\",\n\t\t\t\tButtonState.UP, this._button.currentState);\n\t\t\tAssert.assertTrue(\"Button must dispatch FeathersEventType.STATE_CHANGE when state is changed to ButtonState.UP\",\n\t\t\t\thasDispatchedStateChange);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testButtonStateDisabledOnTouchWhenIsEnabledIsFalse():void\n\t\t{\n\t\t\tthis._button.isEnabled = false;\n\t\t\tvar hasDispatchedStateChange:Boolean = false;\n\t\t\tthis._button.addEventListener(FeathersEventType.STATE_CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedStateChange = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._button.removeFromParent(false);\n\t\t\tAssert.assertStrictlyEquals(\"Button currentState must not change from ButtonState.DISABLED when touch occurs and isEnabled is false\",\n\t\t\t\tButtonState.DISABLED, this._button.currentState);\n\t\t\tAssert.assertFalse(\"Button must not dispatch FeathersEventType.STATE_CHANGE when state is isEnabled and touch occurs\",\n\t\t\t\thasDispatchedStateChange);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testButtonStateUpOnTouchPhaseMoveOutside():void\n\t\t{\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tvar hasDispatchedStateChange:Boolean = false;\n\t\t\tthis._button.addEventListener(FeathersEventType.STATE_CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\tvar button:BasicButton = BasicButton(event.currentTarget);\n\t\t\t\tif(button.currentState === ButtonState.UP)\n\t\t\t\t{\n\t\t\t\t\thasDispatchedStateChange = true;\n\t\t\t\t}\n\t\t\t});\n\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\ttouch.globalX = 1000;\n\t\t\ttouch.globalY = position.y;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertStrictlyEquals(\"Button currentState was not changed to ButtonState.UP on TouchPhase.MOVED when position is outside button\",\n\t\t\t\tButtonState.UP, this._button.currentState);\n\t\t\tAssert.assertTrue(\"Button must dispatch FeathersEventType.STATE_CHANGE when state is changed to ButtonState.UP\",\n\t\t\t\thasDispatchedStateChange);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testButtonStateDownOnTouchPhaseMoveOutsideAndBackInside():void\n\t\t{\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\ttouch.globalX = 1000;\n\t\t\ttouch.globalY = position.y;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tvar hasDispatchedStateChange:Boolean = false;\n\t\t\tthis._button.addEventListener(FeathersEventType.STATE_CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\tvar button:BasicButton = BasicButton(event.currentTarget);\n\t\t\t\tif(button.currentState === ButtonState.DOWN)\n\t\t\t\t{\n\t\t\t\t\thasDispatchedStateChange = true;\n\t\t\t\t}\n\t\t\t});\n\t\t\ttouch.globalX = 10;\n\t\t\ttouch.globalY = position.y;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertStrictlyEquals(\"Button currentState was not changed to ButtonState.DOWN on TouchPhase.MOVED when position moves outside button then back inside\",\n\t\t\t\tButtonState.DOWN, this._button.currentState);\n\t\t\tAssert.assertTrue(\"Button must dispatch FeathersEventType.STATE_CHANGE when state is changed to ButtonState.DOWN\",\n\t\t\t\thasDispatchedStateChange);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testButtonStateUpOnTouchPhaseMoveOutsideAndKeepDownStateOnRollOutIsTrue():void\n\t\t{\n\t\t\tthis._button.keepDownStateOnRollOut = true;\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tvar hasDispatchedStateChange:Boolean = false;\n\t\t\tthis._button.addEventListener(FeathersEventType.STATE_CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedStateChange = true;\n\t\t\t});\n\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\ttouch.globalX = 1000;\n\t\t\ttouch.globalY = position.y;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertStrictlyEquals(\"Button currentState was incorrectly changed from ButtonState.DOWN on TouchPhase.MOVED when position is outside button and keepDownStateOnRollOut is true\",\n\t\t\t\tButtonState.DOWN, this._button.currentState);\n\t\t\tAssert.assertFalse(\"Button must not dispatch FeathersEventType.STATE_CHANGE when keepDownStateOnRollOut is true and state does not changed on roll out\",\n\t\t\t\thasDispatchedStateChange);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testButtonStateUpOnTouchPhaseEnded():void\n\t\t{\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tvar hasDispatchedStateChange:Boolean = false;\n\t\t\tthis._button.addEventListener(FeathersEventType.STATE_CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\tvar button:BasicButton = BasicButton(event.currentTarget);\n\t\t\t\tif(button.currentState === ButtonState.UP)\n\t\t\t\t{\n\t\t\t\t\thasDispatchedStateChange = true;\n\t\t\t\t}\n\t\t\t});\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertStrictlyEquals(\"Button currentState was not changed to ButtonState.UP on TouchPhase.ENDED\",\n\t\t\t\tButtonState.UP, this._button.currentState);\n\t\t\tAssert.assertTrue(\"Button must dispatch FeathersEventType.STATE_CHANGE when state is changed to ButtonState.UP\",\n\t\t\t\thasDispatchedStateChange);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSkinsDisposed():void\n\t\t{\n\t\t\tvar defaultSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.defaultSkin = defaultSkin;\n\t\t\tvar upSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.setSkinForState(ButtonState.UP, upSkin);\n\t\t\tvar downSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.setSkinForState(ButtonState.DOWN, downSkin);\n\t\t\tvar hoverSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.setSkinForState(ButtonState.HOVER, hoverSkin);\n\t\t\tvar disabledSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.setSkinForState(ButtonState.DISABLED, disabledSkin);\n\t\t\tthis._button.validate();\n\t\t\tthis._button.dispose();\n\t\t\tAssert.assertTrue(\"defaultSkin not disposed when Button disposed.\", defaultSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"upSkin not disposed when Button disposed.\", upSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"downSkin not disposed when Button disposed.\", downSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"hoverSkin not disposed when Button disposed.\", hoverSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"disabledSkin not disposed when Button disposed.\", disabledSkin.isDisposed);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSkinsRemovedWhenSetToNull():void\n\t\t{\n\t\t\tvar defaultSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.defaultSkin = defaultSkin;\n\t\t\tvar upSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.setSkinForState(ButtonState.UP, upSkin);\n\t\t\tvar downSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.setSkinForState(ButtonState.DOWN, downSkin);\n\t\t\tvar hoverSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.setSkinForState(ButtonState.HOVER, hoverSkin);\n\t\t\tvar disabledSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.setSkinForState(ButtonState.DISABLED, disabledSkin);\n\t\t\tthis._button.validate();\n\t\t\tthis._button.defaultSkin = null;\n\t\t\tthis._button.setSkinForState(ButtonState.UP, null);\n\t\t\tthis._button.setSkinForState(ButtonState.DOWN, null);\n\t\t\tthis._button.setSkinForState(ButtonState.HOVER, null);\n\t\t\tthis._button.setSkinForState(ButtonState.DISABLED, null);\n\t\t\t//should not need to validate here\n\t\t\tthis._button.dispose();\n\t\t\tAssert.assertFalse(\"Removed defaultSkin incorrectly disposed when Button disposed.\", defaultSkin.isDisposed);\n\t\t\tAssert.assertFalse(\"Removed upSkin incorrectly disposed when Button disposed.\", upSkin.isDisposed);\n\t\t\tAssert.assertFalse(\"Removed downSkin incorrectly disposed when Button disposed.\", downSkin.isDisposed);\n\t\t\tAssert.assertFalse(\"Removed hoverSkin incorrectly disposed when Button disposed.\", hoverSkin.isDisposed);\n\t\t\tAssert.assertFalse(\"Removed disabledSkin incorrectly disposed when Button disposed.\", disabledSkin.isDisposed);\n\t\t\tAssert.assertNull(\"defaultSkin parent must be null when removed from Button.\", defaultSkin.parent);\n\t\t\tAssert.assertNull(\"upSkin parent must be null when removed from Button.\", upSkin.parent);\n\t\t\tAssert.assertNull(\"downSkin parent must be null when removed from Button.\", downSkin.parent);\n\t\t\tAssert.assertNull(\"hoverSkin parent must be null when removed from Button.\", hoverSkin.parent);\n\t\t\tAssert.assertNull(\"disabledSkin parent must be null when removed from Button.\", disabledSkin.parent);\n\t\t\tdefaultSkin.dispose();\n\t\t\tupSkin.dispose();\n\t\t\tdownSkin.dispose();\n\t\t\thoverSkin.dispose();\n\t\t\tdisabledSkin.dispose();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/BitmapFontTextEditorFocusTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.TextInput;\n\timport feathers.controls.TextInputState;\n\timport feathers.controls.text.BitmapFontTextEditor;\n\timport feathers.core.FocusManager;\n\timport feathers.events.FeathersEventType;\n\n\timport flash.events.KeyboardEvent;\n\timport flash.events.TextEvent;\n\timport flash.geom.Point;\n\timport flash.ui.Keyboard;\n\n\timport org.flexunit.Assert;\n\timport org.flexunit.async.Async;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\tpublic class BitmapFontTextEditorFocusTests\n\t{\n\t\tprivate static const CURSOR_SKIN_NAME:String = \"test-cursor-skin\";\n\t\tprivate static const SELECTION_SKIN_NAME:String = \"test-selection-skin\";\n\n\t\tprivate var _textInput:TextInput;\n\t\tprivate var _textEditor:BitmapFontTextEditor;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, true);\n\n\t\t\tthis._textInput = new TextInput();\n\t\t\tthis._textInput.backgroundSkin = new Quad(200, 200);\n\t\t\tthis._textInput.textEditorFactory = textEditorFactory;\n\t\t\tTestFeathers.starlingRoot.addChild(this._textInput);\n\t\t\tthis._textInput.validate();\n\t\t}\n\n\t\tprivate function textEditorFactory():BitmapFontTextEditor\n\t\t{\n\t\t\tthis._textEditor = new BitmapFontTextEditor();\n\t\t\tvar cursorSkin:Quad = new Quad(1, 1, 0xff00ff);\n\t\t\tcursorSkin.name = CURSOR_SKIN_NAME;\n\t\t\tthis._textEditor.cursorSkin = cursorSkin;\n\t\t\tvar selectionSkin:Quad = new Quad(1, 1, 0xff00ff);\n\t\t\tselectionSkin.name = SELECTION_SKIN_NAME;\n\t\t\tthis._textEditor.selectionSkin = selectionSkin;\n\t\t\treturn this._textEditor;\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\t//one of the tests sets the parent's visible property to false, so\n\t\t\t//it needs to be reset.\n\t\t\tthis._textInput.parent.visible = true;\n\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, false);\n\t\t\tthis._textInput.removeFromParent(true);\n\t\t\tthis._textInput = null;\n\n\t\t\tthis._textEditor = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFocusInEventAfterSetFocus():void\n\t\t{\n\t\t\tvar hasDispatchedFocusIn:Boolean = false;\n\t\t\tthis._textInput.addEventListener(FeathersEventType.FOCUS_IN, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedFocusIn = true;\n\t\t\t});\n\t\t\tthis._textInput.setFocus();\n\t\t\tAssert.assertTrue(\"BitmapFontTextEditor: FeathersEventType.FOCUS_IN was not dispatched after calling setFocus() on TextInput\",\n\t\t\t\thasDispatchedFocusIn);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFocusInEventAfterTouch():void\n\t\t{\n\t\t\tvar hasDispatchedFocusIn:Boolean = false;\n\t\t\tthis._textInput.addEventListener(FeathersEventType.FOCUS_IN, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedFocusIn = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._textInput.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertTrue(\"BitmapFontTextEditor: FeathersEventType.FOCUS_IN was not dispatched after TouchEvent.TOUCH on TextInput\",\n\t\t\t\thasDispatchedFocusIn);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFocusOutEventAfterSetFocusThenClearFocus():void\n\t\t{\n\t\t\tvar hasDispatchedFocusOut:Boolean = false;\n\t\t\tthis._textInput.addEventListener(FeathersEventType.FOCUS_OUT, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedFocusOut = true;\n\t\t\t});\n\t\t\tthis._textInput.setFocus();\n\t\t\tthis._textInput.clearFocus();\n\t\t\tAssert.assertTrue(\"BitmapFontTextEditor: FeathersEventType.FOCUS_OUT was not dispatched after calling clearFocus() on TextInput\",\n\t\t\t\thasDispatchedFocusOut);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFocusOutEventAfterTouchInsideThenTouchOutside():void\n\t\t{\n\t\t\tvar hasDispatchedFocusOut:Boolean = false;\n\t\t\tthis._textInput.addEventListener(FeathersEventType.FOCUS_OUT, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedFocusOut = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._textInput.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.target = target.stage;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = 1000;\n\t\t\ttouch.globalY = 1000;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertTrue(\"BitmapFontTextEditor: FeathersEventType.FOCUS_OUT was not dispatched after TouchEvent.TOUCH inside TextInput followed by TouchEvent.TOUCH outside TextInput\",\n\t\t\t\thasDispatchedFocusOut);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFocusOutEventAfterSetFocusThenTouchOutside():void\n\t\t{\n\t\t\tvar hasDispatchedFocusOut:Boolean = false;\n\t\t\tthis._textInput.addEventListener(FeathersEventType.FOCUS_OUT, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedFocusOut = true;\n\t\t\t});\n\t\t\tthis._textInput.setFocus();\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._textInput.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = this._textInput.stage;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = 1000;\n\t\t\ttouch.globalY = 1000;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertTrue(\"BitmapFontTextEditor: FeathersEventType.FOCUS_OUT was not dispatched after calling setFocus() on TextInput followed by TouchEvent.TOUCH outside TextInput\",\n\t\t\t\thasDispatchedFocusOut);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFocusOutEventAfterTouchInsideThenClearFocus():void\n\t\t{\n\t\t\tvar hasDispatchedFocusOut:Boolean = false;\n\t\t\tthis._textInput.addEventListener(FeathersEventType.FOCUS_OUT, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedFocusOut = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._textInput.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._textInput.clearFocus();\n\t\t\tAssert.assertTrue(\"BitmapFontTextEditor: FeathersEventType.FOCUS_OUT was not dispatched after TouchEvent.TOUCH inside TextInput followed by calling clearFocus() on TextInput\",\n\t\t\t\thasDispatchedFocusOut);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testFocusOutEventAfterSetTextInputParentVisibleToFalse():void\n\t\t{\n\t\t\tvar hasDispatchedFocusOut:Boolean = false;\n\t\t\tthis._textInput.addEventListener(FeathersEventType.FOCUS_OUT, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedFocusOut = true;\n\t\t\t});\n\t\t\tthis._textInput.setFocus();\n\t\t\tthis._textInput.parent.visible = false;\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertTrue(\"FeathersEventType.FOCUS_OUT was not dispatched after setting TextInput parent's visible property to false when using BitmapFontTextEditor\", hasDispatchedFocusOut);\n\t\t\t}, 100);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectionChangeAfterSelectAllEvent():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\t//clear the automatic selection caused by giving it focus\n\t\t\tthis._textInput.selectRange(0, 0);\n\t\t\t//and validate the commit this change\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new flash.events.Event(flash.events.Event.SELECT_ALL, true));\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed after Ctrl/Cmd+A to select all\",\n\t\t\t\t0, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed after Ctrl/Cmd+A to select all\",\n\t\t\t\tthis._textInput.text.length, this._textInput.selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectionChangeAfterSelectAllEventAndKeyboardShiftLeft():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\t//clear the automatic selection caused by giving it focus\n\t\t\tthis._textInput.selectRange(0, 0);\n\t\t\t//and validate the commit this change\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new flash.events.Event(flash.events.Event.SELECT_ALL, true));\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.LEFT, 0, false, false, true));\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after Ctrl/Cmd+A to select all and pressing Keyboard.LEFT and shift key\",\n\t\t\t\t0, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after Ctrl/Cmd+A to select all and pressing Keyboard.LEFT and shift key\",\n\t\t\t\tthis._textInput.text.length - 1, this._textInput.selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectionChangeAfterSelectAllEventAndKeyboardLeft():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\t//clear the automatic selection caused by giving it focus\n\t\t\tthis._textInput.selectRange(0, 0);\n\t\t\t//and validate the commit this change\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new flash.events.Event(flash.events.Event.SELECT_ALL, true));\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.LEFT, 0, false, false, false));\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after Ctrl/Cmd+A to select all and pressing Keyboard.LEFT\",\n\t\t\t\t0, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after Ctrl/Cmd+A to select all and pressing Keyboard.LEFT\",\n\t\t\t\t0, this._textInput.selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectionChangeAfterSelectAllEventAndKeyboardRight():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\t//clear the automatic selection caused by giving it focus\n\t\t\tthis._textInput.selectRange(0, 0);\n\t\t\t//and validate the commit this change\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new flash.events.Event(flash.events.Event.SELECT_ALL, true));\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.RIGHT, 0, false, false, false));\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after Ctrl/Cmd+A to select all and pressing Keyboard.RIGHT\",\n\t\t\t\tthis._textInput.text.length, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after Ctrl/Cmd+A to select all and pressing Keyboard.RIGHT\",\n\t\t\t\tthis._textInput.text.length, this._textInput.selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectionChangeAfterSelectRange():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar rangeStart:int = 2;\n\t\t\tvar rangeEnd:int = 8;\n\t\t\tthis._textInput.selectRange(rangeStart, rangeEnd);\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after selectRange() and pressing Keyboard.LEFT\",\n\t\t\t\trangeStart, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after selectRange() and pressing Keyboard.LEFT\",\n\t\t\t\trangeEnd, this._textInput.selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectionChangeAfterSelectRangeAndKeyboardLeft():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar rangeStart:int = 2;\n\t\t\tvar rangeEnd:int = 8;\n\t\t\tthis._textInput.selectRange(rangeStart, rangeEnd);\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.LEFT, 0, false, false, false));\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after selectRange() and pressing Keyboard.LEFT\",\n\t\t\t\trangeStart, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after selectRange() and pressing Keyboard.LEFT\",\n\t\t\t\trangeStart, this._textInput.selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectionChangeAfterSelectRangeAndKeyboardRight():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar rangeStart:int = 2;\n\t\t\tvar rangeEnd:int = 8;\n\t\t\tthis._textInput.selectRange(rangeStart, rangeEnd);\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.RIGHT, 0, false, false, false));\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after selectRange() and pressing Keyboard.RIGHT\",\n\t\t\t\trangeEnd, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after selectRange() and pressing Keyboard.RIGHT\",\n\t\t\t\trangeEnd, this._textInput.selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectRangeAndKeyboardDelete():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar rangeStart:int = 2;\n\t\t\tvar rangeEnd:int = 8;\n\t\t\tthis._textInput.selectRange(rangeStart, rangeEnd);\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.DELETE, 0, false, false, false));\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after selectRange() and pressing Keyboard.DELETE\",\n\t\t\t\trangeStart, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after selectRange() and pressing Keyboard.DELETE\",\n\t\t\t\trangeStart, this._textInput.selectionEndIndex);\n\t\t\tAssert.assertStrictlyEquals(\"text not changed correctly after selectRange() and pressing Keyboard.DELETE\",\n\t\t\t\t\"Herld\", this._textInput.text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectRangeAndKeyboardBackspace():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar rangeStart:int = 2;\n\t\t\tvar rangeEnd:int = 8;\n\t\t\tthis._textInput.selectRange(rangeStart, rangeEnd);\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.BACKSPACE, 0, false, false, false));\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after selectRange() and pressing Keyboard.BACKSPACE\",\n\t\t\t\trangeStart, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after selectRange() and pressing Keyboard.BACKSPACE\",\n\t\t\t\trangeStart, this._textInput.selectionEndIndex);\n\t\t\tAssert.assertStrictlyEquals(\"text not changed correctly after selectRange() and pressing Keyboard.BACKSPACE\",\n\t\t\t\t\"Herld\", this._textInput.text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectRangeAndTyping():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar rangeStart:int = 2;\n\t\t\tvar rangeEnd:int = 8;\n\t\t\tvar textToType:String = \"test\";\n\t\t\tthis._textInput.selectRange(rangeStart, rangeEnd);\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new TextEvent(TextEvent.TEXT_INPUT, false, false, textToType));\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after selectRange() and typing some text\",\n\t\t\t\trangeStart + textToType.length, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after selectRange() and typing some text\",\n\t\t\t\trangeStart + textToType.length, this._textInput.selectionEndIndex);\n\t\t\tAssert.assertStrictlyEquals(\"text not changed correctly after selectRange() and typing some text\",\n\t\t\t\t\"He\" + textToType + \"rld\", this._textInput.text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetCursorAndKeyboardDelete():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar cursorIndex:int = 2;\n\t\t\tthis._textInput.selectRange(cursorIndex, cursorIndex);\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.DELETE, 0, false, false, false));\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex incorrectly changed after selectRange() and pressing Keyboard.DELETE\",\n\t\t\t\tcursorIndex, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex incorrectly changed after selectRange() and pressing Keyboard.DELETE\",\n\t\t\t\tcursorIndex, this._textInput.selectionEndIndex);\n\t\t\tAssert.assertStrictlyEquals(\"text not changed correctly after selectRange() and pressing Keyboard.DELETE\",\n\t\t\t\t\"Helo World\", this._textInput.text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetCursorAndKeyboardBackspace():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar cursorIndex:int = 2;\n\t\t\tthis._textInput.selectRange(cursorIndex, cursorIndex);\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.BACKSPACE, 0, false, false, false));\n\t\t\tcursorIndex--;\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after selectRange() and pressing Keyboard.BACKSPACE\",\n\t\t\t\tcursorIndex, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after selectRange() and pressing Keyboard.BACKSPACE\",\n\t\t\t\tcursorIndex, this._textInput.selectionEndIndex);\n\t\t\tAssert.assertStrictlyEquals(\"text not changed correctly after selectRange() and pressing Keyboard.BACKSPACE\",\n\t\t\t\t\"Hllo World\", this._textInput.text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetCursorAndKeyboardUp():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar cursorIndex:int = 2;\n\t\t\tthis._textInput.selectRange(cursorIndex, cursorIndex);\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.UP, 0, false, false, false));\n\t\t\tcursorIndex = 0;\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after selectRange() and pressing Keyboard.UP\",\n\t\t\t\tcursorIndex, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after selectRange() and pressing Keyboard.UP\",\n\t\t\t\tcursorIndex, this._textInput.selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetCursorAndKeyboardDown():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar cursorIndex:int = 2;\n\t\t\tthis._textInput.selectRange(cursorIndex, cursorIndex);\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.DOWN, 0, false, false, false));\n\t\t\tcursorIndex = this._textInput.text.length;\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after selectRange() and pressing Keyboard.DOWN\",\n\t\t\t\tcursorIndex, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after selectRange() and pressing Keyboard.DOWN\",\n\t\t\t\tcursorIndex, this._textInput.selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetCursorAndKeyboardLeft():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar cursorIndex:int = 2;\n\t\t\tthis._textInput.selectRange(cursorIndex, cursorIndex);\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.LEFT, 0, false, false, false));\n\t\t\tcursorIndex--;\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after selectRange() and pressing Keyboard.LEFT\",\n\t\t\t\tcursorIndex, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after selectRange() and pressing Keyboard.LEFT\",\n\t\t\t\tcursorIndex, this._textInput.selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetCursorAndKeyboardRight():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar cursorIndex:int = 2;\n\t\t\tthis._textInput.selectRange(cursorIndex, cursorIndex);\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.RIGHT, 0, false, false, false));\n\t\t\tcursorIndex++;\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after selectRange() and pressing Keyboard.RIGHT\",\n\t\t\t\tcursorIndex, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after selectRange() and pressing Keyboard.RIGHT\",\n\t\t\t\tcursorIndex, this._textInput.selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetCursorAndKeyboardShiftLeft():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar rangeStart:int = 2;\n\t\t\tvar rangeEnd:int = 2;\n\t\t\tthis._textInput.selectRange(rangeStart, rangeEnd);\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.LEFT, 0, false, false, true));\n\t\t\trangeStart--;\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after selectRange() and pressing Keyboard.LEFT and shift key\",\n\t\t\t\trangeStart, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after selectRange() and pressing Keyboard.LEFT and shift key\",\n\t\t\t\trangeEnd, this._textInput.selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetCursorAndKeyboardShiftRight():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar rangeStart:int = 2;\n\t\t\tvar rangeEnd:int = 2;\n\t\t\tthis._textInput.selectRange(rangeStart, rangeEnd);\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.RIGHT, 0, false, false, true));\n\t\t\trangeEnd++;\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after selectRange() and pressing Keyboard.RIGHT and shift key\",\n\t\t\t\trangeStart, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after selectRange() and pressing Keyboard.RIGHT and shift key\",\n\t\t\t\trangeEnd, this._textInput.selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetCursorAndTyping():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar cursorIndex:int = 2;\n\t\t\tvar textToType:String = \"test\";\n\t\t\tthis._textInput.selectRange(cursorIndex, cursorIndex);\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new TextEvent(TextEvent.TEXT_INPUT, false, false, textToType));\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after selectRange() and typing some text\",\n\t\t\t\tcursorIndex + textToType.length, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after selectRange() and typing some text\",\n\t\t\t\tcursorIndex + textToType.length, this._textInput.selectionEndIndex);\n\t\t\tAssert.assertStrictlyEquals(\"text not changed correctly after selectRange() and typing some text\",\n\t\t\t\t\"He\" + textToType + \"llo World\", this._textInput.text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetFocusWhenFocusEnabledFalse():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.isFocusEnabled = false;\n\t\t\tthis._textInput.validate();\n\t\t\tAssert.assertNotNull(\"BitmapFontTextEditor nativeFocus must not be null when isFocusEnabled is false\",\n\t\t\t\tthis._textInput.nativeFocus);\n\t\t\tAssert.assertTrue(\"BitmapFontTextEditor nativeFocus must not receive nativeStage focus when isFocusEnabled is false\",\n\t\t\t\tStarling.current.nativeStage.focus !== this._textInput.nativeFocus);\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertTrue(\"TextInput must not receive FocusManager focus when using BitmapFontTextEditor and isFocusEnabled is false\",\n\t\t\t\tthis._textInput.focusManager.focus !== this._textInput);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state must be TextInputState.ENABLED after attempt to receive FocusManager focus when using BitmapFontTextEditor and isFocusEnabled is false\",\n\t\t\t\tTextInputState.ENABLED, this._textInput.currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testReceiveFocusWhenEditableFalseAndSelectableFalse():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.isEditable = false;\n\t\t\tthis._textInput.isSelectable = false;\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tthis._textInput.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextEditor nativeFocus must receive nativeStage focus when isEditable is false and isSelectable is false\",\n\t\t\t\tStarling.current.nativeStage.focus, this._textInput.nativeFocus);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput must receive FocusManager focus when using BitmapFontTextEditor and isEditable is false and isSelectable is false\",\n\t\t\t\tthis._textInput.focusManager.focus, this._textInput);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state must be TextInputState.FOCUSED after receive FocusManager focus when using BitmapFontTextEditor and isEditable is false and isSelectable is false\",\n\t\t\t\tTextInputState.FOCUSED, this._textInput.currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetFocusWhenEditableTrueAndSelectableFalse():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.isEditable = true;\n\t\t\tthis._textInput.isSelectable = false;\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextEditor nativeFocus must receive nativeStage focus when isEditable is true and isSelectable is false\",\n\t\t\t\tStarling.current.nativeStage.focus, this._textInput.nativeFocus);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput must receive FocusManager focus when using BitmapFontTextEditor and isEditable is true and isSelectable is false\",\n\t\t\t\tthis._textInput.focusManager.focus, this._textInput);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state must be TextInputState.FOCUSED after receive FocusManager focus when using BitmapFontTextEditor and isEditable is true and isSelectable is false\",\n\t\t\t\tTextInputState.FOCUSED, this._textInput.currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetFocusWhenEditableFalseAndSelectableTrue():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.isEditable = false;\n\t\t\tthis._textInput.isSelectable = true;\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextEditor nativeFocus must receive nativeStage focus when isEditable is false and isSelectable is true\",\n\t\t\t\tStarling.current.nativeStage.focus, this._textInput.nativeFocus);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput must receive FocusManager focus when using BitmapFontTextEditor and isEditable is false and isSelectable is true\",\n\t\t\t\tthis._textInput.focusManager.focus, this._textInput);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state must be TextInputState.FOCUSED after receive FocusManager focus when using BitmapFontTextEditor and isEditable is false and isSelectable is true\",\n\t\t\t\tTextInputState.FOCUSED, this._textInput.currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCursorAndSelectionSkinsWithNoCharactersSelected():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.selectRange(1, 1);\n\t\t\t//validate to be sure that the range is passed down to the text editor\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertTrue(\"BitmapFontTextEditor cursorSkin must be visible when no characters selected\",\n\t\t\t\tthis._textEditor.getChildByName(CURSOR_SKIN_NAME).visible);\n\t\t\tAssert.assertFalse(\"BitmapFontTextEditor selectionSkin must not be visible when no characters selected\",\n\t\t\t\tthis._textEditor.getChildByName(SELECTION_SKIN_NAME).visible);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCursorAndSelectionSkinsWithMultipleCharactersSelected():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.selectRange(1, 3);\n\t\t\t//validate to be sure that the range is passed down to the text editor\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertFalse(\"BitmapFontTextEditor cursorSkin must not be visible when multiple characters selected\",\n\t\t\t\tthis._textEditor.getChildByName(CURSOR_SKIN_NAME).visible);\n\t\t\tAssert.assertTrue(\"BitmapFontTextEditor selectionSkin must be visible when multiple characters selected\",\n\t\t\t\tthis._textEditor.getChildByName(SELECTION_SKIN_NAME).visible);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCursorAndSelectionSkinsWithNoCharactersSelectedEditableFalseAndSelectableFalse():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.isEditable = false;\n\t\t\tthis._textInput.isSelectable = false;\n\t\t\tthis._textInput.selectRange(1, 1);\n\t\t\t//validate to be sure that the range is passed down to the text editor\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertFalse(\"BitmapFontTextEditor cursorSkin must not be visible when no characters selected, isEditable is false, and isSelectable is false\",\n\t\t\t\tthis._textEditor.getChildByName(CURSOR_SKIN_NAME).visible);\n\t\t\tAssert.assertFalse(\"BitmapFontTextEditor selectionSkin must not be visible when no characters selected, isEditable is false, and isSelectable is false\",\n\t\t\t\tthis._textEditor.getChildByName(SELECTION_SKIN_NAME).visible);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCursorAndSelectionSkinsWithMultipleCharactersSelectedEditableFalseAndSelectableFalse():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.isEditable = false;\n\t\t\tthis._textInput.isSelectable = false;\n\t\t\tthis._textInput.selectRange(1, 3);\n\t\t\t//validate to be sure that the range is passed down to the text editor\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertFalse(\"BitmapFontTextEditor cursorSkin must not be visible when multiple characters selected, isEditable is false, and isSelectable is false\",\n\t\t\t\tthis._textEditor.getChildByName(CURSOR_SKIN_NAME).visible);\n\t\t\tAssert.assertFalse(\"BitmapFontTextEditor selectionSkin must not be visible when multiple characters selected, isEditable is false, and isSelectable is false\",\n\t\t\t\tthis._textEditor.getChildByName(SELECTION_SKIN_NAME).visible);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCursorAndSelectionSkinsWithNoCharactersSelectedEditableTrueAndSelectableFalse():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.isEditable = true;\n\t\t\tthis._textInput.isSelectable = false;\n\t\t\tthis._textInput.selectRange(1, 1);\n\t\t\t//validate to be sure that the range is passed down to the text editor\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertTrue(\"BitmapFontTextEditor cursorSkin must be visible when no characters selected, isEditable is true, and isSelectable is false\",\n\t\t\t\tthis._textEditor.getChildByName(CURSOR_SKIN_NAME).visible);\n\t\t\tAssert.assertFalse(\"BitmapFontTextEditor selectionSkin must not be visible when no characters selected, isEditable is true, and isSelectable is false\",\n\t\t\t\tthis._textEditor.getChildByName(SELECTION_SKIN_NAME).visible);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCursorAndSelectionSkinsWithMultipleCharactersSelectedEditableTrueAndSelectableFalse():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.isEditable = true;\n\t\t\tthis._textInput.isSelectable = false;\n\t\t\tthis._textInput.selectRange(1, 3);\n\t\t\t//validate to be sure that the range is passed down to the text editor\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertFalse(\"BitmapFontTextEditor cursorSkin must not be visible when multiple characters selected, isEditable is true, and isSelectable is false\",\n\t\t\t\tthis._textEditor.getChildByName(CURSOR_SKIN_NAME).visible);\n\t\t\tAssert.assertTrue(\"BitmapFontTextEditor selectionSkin must be visible when multiple characters selected, isEditable is true, and isSelectable is false\",\n\t\t\t\tthis._textEditor.getChildByName(SELECTION_SKIN_NAME).visible);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCursorAndSelectionSkinsWithNoCharactersSelectedEditableFalseAndSelectableTrue():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.isEditable = false;\n\t\t\tthis._textInput.isSelectable = true;\n\t\t\tthis._textInput.selectRange(1, 1);\n\t\t\t//validate to be sure that the range is passed down to the text editor\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertFalse(\"BitmapFontTextEditor cursorSkin must not be visible when no characters selected, isEditable is false, and isSelectable is true\",\n\t\t\t\tthis._textEditor.getChildByName(CURSOR_SKIN_NAME).visible);\n\t\t\tAssert.assertFalse(\"BitmapFontTextEditor selectionSkin must not be visible when no characters selected, isEditable is false, and isSelectable is true\",\n\t\t\t\tthis._textEditor.getChildByName(SELECTION_SKIN_NAME).visible);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCursorAndSelectionSkinsWithMultipleCharactersSelectedEditableFalseAndSelectableTrue():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.isEditable = false;\n\t\t\tthis._textInput.isSelectable = true;\n\t\t\tthis._textInput.selectRange(1, 3);\n\t\t\t//validate to be sure that the range is passed down to the text editor\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertFalse(\"BitmapFontTextEditor cursorSkin must not be visible when multiple characters selected, isEditable is false, and isSelectable is true\",\n\t\t\t\tthis._textEditor.getChildByName(CURSOR_SKIN_NAME).visible);\n\t\t\tAssert.assertTrue(\"BitmapFontTextEditor selectionSkin must be visible when multiple characters selected, isEditable is false, and isSelectable is true\",\n\t\t\t\tthis._textEditor.getChildByName(SELECTION_SKIN_NAME).visible);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/BitmapFontTextRendererTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.text.BitmapFontTextRenderer;\n\timport feathers.tests.supportClasses.CustomStateContext;\n\timport feathers.text.BitmapFontTextFormat;\n\timport feathers.text.FontStylesSet;\n\n\timport org.flexunit.Assert;\n\n\timport starling.text.BitmapFont;\n\timport starling.text.TextField;\n\timport starling.text.TextFormat;\n\n\tpublic class BitmapFontTextRendererTests\n\t{\n\t\tprivate static const STATE_DISABLED:String = \"disabled\";\n\n\t\tprivate static const DEFAULT_FONT_NAME:String = \"DefaultFont\";\n\t\tprivate static const DEFAULT_FONT_SIZE:Number = 16;\n\t\tprivate static const DEFAULT_COLOR:uint = 0xff00ff;\n\t\tprivate static const DISABLED_FONT_NAME:String = \"DisabledFont\";\n\t\tprivate static const DISABLED_FONT_SIZE:Number = 15;\n\t\tprivate static const DISABLED_COLOR:uint = 0x999999;\n\t\tprivate static const SELECTED_FONT_NAME:String = \"SelectedFont\";\n\t\tprivate static const SELECTED_FONT_SIZE:Number = 17;\n\t\tprivate static const SELECTED_COLOR:uint = 0xff0000;\n\t\tprivate static const STATE_FONT_NAME:String = \"StateFont\";\n\t\tprivate static const STATE_FONT_SIZE:Number = 18;\n\t\tprivate static const STATE_COLOR:uint = 0xffffff;\n\n\t\tprivate var _textRenderer:BitmapFontTextRenderer;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tTextField.registerCompositor(new BitmapFont(), DEFAULT_FONT_NAME);\n\t\t\tTextField.registerCompositor(new BitmapFont(), DISABLED_FONT_NAME);\n\t\t\tTextField.registerCompositor(new BitmapFont(), SELECTED_FONT_NAME);\n\t\t\tTextField.registerCompositor(new BitmapFont(), STATE_FONT_NAME);\n\n\t\t\tthis._textRenderer = new BitmapFontTextRenderer();\n\t\t\tTestFeathers.starlingRoot.addChild(this._textRenderer);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._textRenderer.removeFromParent(true);\n\t\t\tthis._textRenderer = null;\n\n\t\t\tTextField.unregisterCompositor(DEFAULT_FONT_NAME);\n\t\t\tTextField.unregisterCompositor(DISABLED_FONT_NAME);\n\t\t\tTextField.unregisterCompositor(SELECTED_FONT_NAME);\n\t\t\tTextField.unregisterCompositor(STATE_FONT_NAME);\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMaxWidth0WithWordWrap():void\n\t\t{\n\t\t\tthis._textRenderer.text = \"Test\";\n\t\t\tthis._textRenderer.wordWrap = true;\n\t\t\tthis._textRenderer.maxWidth = 0;\n\t\t\tthis._textRenderer.validate();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testOneLineWithEmptyString():void\n\t\t{\n\t\t\tthis._textRenderer.text = \"\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer numLines must be 1 with empty string\", 1, this._textRenderer.numLines);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testOneLine():void\n\t\t{\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer numLines must be 1\", 1, this._textRenderer.numLines);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNumLinesWithLineBreak():void\n\t\t{\n\t\t\tthis._textRenderer.text = \"Hello\\nWorld\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer numLines must be 2 when line break is in text\", 2, this._textRenderer.numLines);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNumLinesWithCarriageReturn():void\n\t\t{\n\t\t\tthis._textRenderer.text = \"Hello\\rWorld\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer numLines must be 2 when carriage return is in text\", 2, this._textRenderer.numLines);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetTextFormatForStateWithoutSetTextFormatForState():void\n\t\t{\n\t\t\tAssert.assertNull(\"BitmapFontTextRenderer getTextFormatForState() must return null if BitmapFontTextFormat not provided with setTextFormatForState()\",\n\t\t\t\tthis._textRenderer.getTextFormatForState(STATE_DISABLED));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetTextFormatForStateAfterSetTextFormatForState():void\n\t\t{\n\t\t\tvar textFormat:BitmapFontTextFormat = new BitmapFontTextFormat(new BitmapFont());\n\t\t\tthis._textRenderer.setTextFormatForState(STATE_DISABLED, textFormat);\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer getTextFormatForState() must return value passed to setTextFormatForState() with same state\",\n\t\t\t\ttextFormat, this._textRenderer.getTextFormatForState(STATE_DISABLED));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithTextFormat():void\n\t\t{\n\t\t\tthis._textRenderer.textFormat = new BitmapFontTextFormat(new BitmapFont());\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat must be equal to textFormat when no other text formats are specified\",\n\t\t\t\tthis._textRenderer.textFormat, this._textRenderer.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithTextFormatAndDisabled():void\n\t\t{\n\t\t\tthis._textRenderer.textFormat = new BitmapFontTextFormat(new BitmapFont());\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.isEnabled = false;\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat must be equal to textFormat when isEnabled is false, but no other text formats are specified\",\n\t\t\t\tthis._textRenderer.textFormat, this._textRenderer.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithDisabledTextFormatAndDisabled():void\n\t\t{\n\t\t\tthis._textRenderer.textFormat = new BitmapFontTextFormat(new BitmapFont());\n\t\t\tthis._textRenderer.disabledTextFormat = new BitmapFontTextFormat(new BitmapFont());\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.isEnabled = false;\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat must be equal to disabledTextFormat when isEnabled is false and disabledTextFormat is not null\",\n\t\t\t\tthis._textRenderer.disabledTextFormat, this._textRenderer.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithTextFormatAndStateContextDisabled():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isEnabled = false;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tthis._textRenderer.textFormat = new BitmapFontTextFormat(new BitmapFont());\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat must be equal to textFormat when stateContext isEnabled is false, but no other text formats are specified\",\n\t\t\t\tthis._textRenderer.textFormat, this._textRenderer.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithDisabledTextFormatAndStateContextDisabled():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isEnabled = false;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tthis._textRenderer.textFormat = new BitmapFontTextFormat(new BitmapFont());\n\t\t\tthis._textRenderer.disabledTextFormat = new BitmapFontTextFormat(new BitmapFont());\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat must be equal to disabledTextFormat when isEnabled is false and disabledTextFormat is not null\",\n\t\t\t\tthis._textRenderer.disabledTextFormat, this._textRenderer.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithTextFormatAndStateContextSelected():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isSelected = true;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tthis._textRenderer.textFormat = new BitmapFontTextFormat(new BitmapFont());\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat must be equal to textFormat when stateContext isSelected is true, but no other text formats are specified\",\n\t\t\t\tthis._textRenderer.textFormat, this._textRenderer.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithSelectedTextFormatAndStateContextSelected():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isSelected = true;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tthis._textRenderer.textFormat = new BitmapFontTextFormat(new BitmapFont());\n\t\t\tthis._textRenderer.selectedTextFormat = new BitmapFontTextFormat(new BitmapFont());\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat must be equal to selectedTextFormat when isSelected is true and selectedTextFormat is not null\",\n\t\t\t\tthis._textRenderer.selectedTextFormat, this._textRenderer.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithSelectedAndDisabledTextFormatAndStateContextSelectedAndDisabled():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isSelected = true;\n\t\t\tstateContext.isEnabled = false;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tthis._textRenderer.textFormat = new BitmapFontTextFormat(new BitmapFont());\n\t\t\tthis._textRenderer.disabledTextFormat = new BitmapFontTextFormat(new BitmapFont());\n\t\t\tthis._textRenderer.selectedTextFormat = new BitmapFontTextFormat(new BitmapFont());\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\t//disabled should get priority over selected\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat must be equal to disabledTextFormat when isSelected is true and isEnabled is false and both selectedTextFormat and disabledTextFormat are not null\",\n\t\t\t\tthis._textRenderer.disabledTextFormat, this._textRenderer.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithOnlyTextFormatAndStateContextCurrentState():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.currentState = STATE_DISABLED;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tthis._textRenderer.textFormat = new BitmapFontTextFormat(new BitmapFont());\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat must be equal to textFormat when no other text formats are specified\",\n\t\t\t\tthis._textRenderer.textFormat, this._textRenderer.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithDisabledTextFormatAndStateTextFormatWithStateContextDisabledAndCurrentState():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isEnabled = false;\n\t\t\tstateContext.isSelected = true;\n\t\t\tstateContext.currentState = STATE_DISABLED;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tthis._textRenderer.textFormat = new BitmapFontTextFormat(new BitmapFont());\n\t\t\tthis._textRenderer.disabledTextFormat = new BitmapFontTextFormat(new BitmapFont());\n\t\t\tthis._textRenderer.selectedTextFormat = new BitmapFontTextFormat(new BitmapFont());\n\t\t\tvar disabledStateTextFormat:BitmapFontTextFormat = new BitmapFontTextFormat(new BitmapFont());\n\t\t\tthis._textRenderer.setTextFormatForState(STATE_DISABLED, disabledStateTextFormat);\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\t//exact states always get priority over default/disabled/selected\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat must be equal to BitmapFontTextFormat passed into setTextFormatForState() when isEnabled is false and disabledTextFormat are not null\",\n\t\t\t\tdisabledStateTextFormat, this._textRenderer.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFontStylesIgnoredIfAdvancedBitmapFontTextFormatExists():void\n\t\t{\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new TextFormat();\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.textFormat = new BitmapFontTextFormat(new BitmapFont());\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat must be equal to elementFormat and not a format from font styles\",\n\t\t\t\tthis._textRenderer.textFormat, this._textRenderer.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithFontStyles():void\n\t\t{\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.fontName must be equal to starling.text.TextFormat font\",\n\t\t\t\tTextField.getBitmapFont(DEFAULT_FONT_NAME), this._textRenderer.currentTextFormat.font);\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.size must be equal to starling.text.TextFormat size\",\n\t\t\t\tDEFAULT_FONT_SIZE, this._textRenderer.currentTextFormat.size);\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDEFAULT_COLOR, this._textRenderer.currentTextFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatFallBackToDefaultFontStylesWhenDisabled():void\n\t\t{\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.isEnabled = false;\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.fontName must be equal to starling.text.TextFormat font\",\n\t\t\t\tTextField.getBitmapFont(DEFAULT_FONT_NAME), this._textRenderer.currentTextFormat.font);\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.size must be equal to starling.text.TextFormat size\",\n\t\t\t\tDEFAULT_FONT_SIZE, this._textRenderer.currentTextFormat.size);\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDEFAULT_COLOR, this._textRenderer.currentTextFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatUseDisabledFontStylesWhenDisabled():void\n\t\t{\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tfontStyles.disabledFormat = new TextFormat(DISABLED_FONT_NAME, DISABLED_FONT_SIZE, DISABLED_COLOR);\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.isEnabled = false;\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.fontName must be equal to starling.text.TextFormat font\",\n\t\t\t\tTextField.getBitmapFont(DISABLED_FONT_NAME), this._textRenderer.currentTextFormat.font);\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.size must be equal to starling.text.TextFormat size\",\n\t\t\t\tDISABLED_FONT_SIZE, this._textRenderer.currentTextFormat.size);\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDISABLED_COLOR, this._textRenderer.currentTextFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatFallBackToDefaultFontStylesWithStateContextDisabled():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isEnabled = false;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.fontName must be equal to starling.text.TextFormat font\",\n\t\t\t\tTextField.getBitmapFont(DEFAULT_FONT_NAME), this._textRenderer.currentTextFormat.font);\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.size must be equal to starling.text.TextFormat size\",\n\t\t\t\tDEFAULT_FONT_SIZE, this._textRenderer.currentTextFormat.size);\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDEFAULT_COLOR, this._textRenderer.currentTextFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatUseDisabledFontStylesWithStateContextDisabled():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isEnabled = false;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tfontStyles.disabledFormat = new TextFormat(DISABLED_FONT_NAME, DISABLED_FONT_SIZE, DISABLED_COLOR);\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.fontName must be equal to starling.text.TextFormat font\",\n\t\t\t\tTextField.getBitmapFont(DISABLED_FONT_NAME), this._textRenderer.currentTextFormat.font);\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.size must be equal to starling.text.TextFormat size\",\n\t\t\t\tDISABLED_FONT_SIZE, this._textRenderer.currentTextFormat.size);\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDISABLED_COLOR, this._textRenderer.currentTextFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatFallBackToDefaultFontStylesWithStateContextSelected():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isSelected = true;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.fontName must be equal to starling.text.TextFormat font\",\n\t\t\t\tTextField.getBitmapFont(DEFAULT_FONT_NAME), this._textRenderer.currentTextFormat.font);\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.size must be equal to starling.text.TextFormat size\",\n\t\t\t\tDEFAULT_FONT_SIZE, this._textRenderer.currentTextFormat.size);\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDEFAULT_COLOR, this._textRenderer.currentTextFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatUseSelectedFontStylesWithStateContextSelected():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isSelected = true;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tfontStyles.selectedFormat = new TextFormat(SELECTED_FONT_NAME, SELECTED_FONT_SIZE, SELECTED_COLOR);\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.fontName must be equal to starling.text.TextFormat font\",\n\t\t\t\tTextField.getBitmapFont(SELECTED_FONT_NAME), this._textRenderer.currentTextFormat.font);\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.size must be equal to starling.text.TextFormat size\",\n\t\t\t\tSELECTED_FONT_SIZE, this._textRenderer.currentTextFormat.size);\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tSELECTED_COLOR, this._textRenderer.currentTextFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatUseDisabledFontStylesWithStateContextSelectedAndDisabled():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isSelected = true;\n\t\t\tstateContext.isEnabled = false;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tfontStyles.selectedFormat = new TextFormat(SELECTED_FONT_NAME, SELECTED_FONT_SIZE, SELECTED_COLOR);\n\t\t\tfontStyles.disabledFormat = new TextFormat(DISABLED_FONT_NAME, DISABLED_FONT_SIZE, DISABLED_COLOR);\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\t//disabled should get priority over selected\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.fontName must be equal to starling.text.TextFormat font\",\n\t\t\t\tTextField.getBitmapFont(DISABLED_FONT_NAME), this._textRenderer.currentTextFormat.font);\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.size must be equal to starling.text.TextFormat size\",\n\t\t\t\tDISABLED_FONT_SIZE, this._textRenderer.currentTextFormat.size);\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDISABLED_COLOR, this._textRenderer.currentTextFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatFallBackToDefaultFontStylesWithStateContextCurrentState():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.currentState = STATE_DISABLED;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.fontName must be equal to starling.text.TextFormat font\",\n\t\t\t\tTextField.getBitmapFont(DEFAULT_FONT_NAME), this._textRenderer.currentTextFormat.font);\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.size must be equal to starling.text.TextFormat size\",\n\t\t\t\tDEFAULT_FONT_SIZE, this._textRenderer.currentTextFormat.size);\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDEFAULT_COLOR, this._textRenderer.currentTextFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatUseStateFontStylesWithStateContextCurrentState():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.currentState = STATE_DISABLED;\n\t\t\tstateContext.isSelected = true;\n\t\t\tstateContext.isEnabled = false;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tfontStyles.selectedFormat = new TextFormat(SELECTED_FONT_NAME, SELECTED_FONT_SIZE, SELECTED_COLOR);\n\t\t\tfontStyles.disabledFormat = new TextFormat(DISABLED_FONT_NAME, DISABLED_FONT_SIZE, DISABLED_COLOR);\n\t\t\tfontStyles.setFormatForState(STATE_DISABLED, new TextFormat(STATE_FONT_NAME, STATE_FONT_SIZE, STATE_COLOR));\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\t//exact states always get priority over default/disabled/selected\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.fontName must be equal to starling.text.TextFormat font\",\n\t\t\t\tTextField.getBitmapFont(STATE_FONT_NAME), this._textRenderer.currentTextFormat.font);\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.size must be equal to starling.text.TextFormat size\",\n\t\t\t\tSTATE_FONT_SIZE, this._textRenderer.currentTextFormat.size);\n\t\t\tAssert.assertStrictlyEquals(\"BitmapFontTextRenderer currentTextFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tSTATE_COLOR, this._textRenderer.currentTextFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInvalidAfterChangePropertyOfFontStyles():void\n\t\t{\n\t\t\tvar format:TextFormat = new TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = format\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tformat.color = SELECTED_COLOR;\n\t\t\tAssert.assertTrue(\"BitmapFontTextRenderer: must be invalid after changing property of font styles.\",\n\t\t\t\tthis._textRenderer.isInvalid());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/BottomDrawerPopUpContentManagerTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.popups.BottomDrawerPopUpContentManager;\n\timport feathers.core.PopUpManager;\n\n\timport org.flexunit.Assert;\n\timport org.flexunit.async.Async;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.display.Sprite;\n\timport starling.events.Event;\n\n\tpublic class BottomDrawerPopUpContentManagerTests\n\t{\n\t\tprivate static const OVERLAY_NAME:String = \"BottomDrawerPopUpContentManagerOverlay\";\n\t\t\n\t\tprivate var _popUp:DisplayObject;\n\t\tprivate var _customRoot:Sprite;\n\t\tprivate var _source:Quad;\n\t\tprivate var _popUpContentManager:BottomDrawerPopUpContentManager;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._source = new Quad(200, 180, 0x00ff00);\n\t\t\tTestFeathers.starlingRoot.addChild(this._source);\n\n\t\t\tthis._customRoot = new Sprite();\n\t\t\tTestFeathers.starlingRoot.addChild(this._customRoot);\n\t\t\tPopUpManager.root = this._customRoot;\n\t\t\t\n\t\t\tthis._popUpContentManager = new BottomDrawerPopUpContentManager();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._source.removeFromParent(true);\n\t\t\tthis._source = null;\n\n\t\t\tthis._customRoot.removeFromParent(true);\n\t\t\tthis._customRoot = null;\n\n\t\t\tif(this._popUp)\n\t\t\t{\n\t\t\t\tthis._popUp.removeFromParent(true);\n\t\t\t\tthis._popUp = null;\n\t\t\t}\n\n\t\t\tPopUpManager.root = TestFeathers.starlingRoot.stage;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\t\t\n\t\tprivate function createSimplePopUp():DisplayObject\n\t\t{\n\t\t\tvar simplePopUp:Quad = new Quad(100, 150, 0xff00ff);\n\t\t\treturn simplePopUp;\n\t\t}\n\n\t\tprivate function createOverlay():DisplayObject\n\t\t{\n\t\t\tvar overlay:Quad = new Quad(1, 1, 0x000000);\n\t\t\toverlay.alpha = 0.5;\n\t\t\toverlay.name = OVERLAY_NAME;\n\t\t\treturn overlay;\n\t\t}\n\t\t\n\t\t[Test(async)]\n\t\tpublic function testOpen():void\n\t\t{\n\t\t\tthis._popUp = this.createSimplePopUp();\n\t\t\tvar openDispatched:Boolean = false;\n\t\t\tthis._popUpContentManager.addEventListener(Event.OPEN, function(event:Event):void\n\t\t\t{\n\t\t\t\topenDispatched = true;\n\t\t\t});\n\t\t\tthis._popUpContentManager.openOrCloseDuration = 0.2;\n\t\t\tthis._popUpContentManager.open(this._popUp, this._source);\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertNotNull(\"BottomDrawerPopUpContentManager content parent should not be null.\", _popUp.parent);\n\t\t\t\tAssert.assertTrue(\"BottomDrawerPopUpContentManager did not dispatch Event.OPEN.\", openDispatched);\n\t\t\t}, 400);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testClose():void\n\t\t{\n\t\t\tthis._popUp = this.createSimplePopUp();\n\t\t\tvar closeDispatched:Boolean = false;\n\t\t\tthis._popUpContentManager.addEventListener(Event.CLOSE, function(event:Event):void\n\t\t\t{\n\t\t\t\tcloseDispatched = true;\n\t\t\t});\n\t\t\tthis._popUpContentManager.openOrCloseDuration = 0.2;\n\t\t\tthis._popUpContentManager.open(this._popUp, this._source);\n\t\t\tthis._popUpContentManager.close();\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertNull(\"BottomDrawerPopUpContentManager content parent should be null.\", _popUp.parent);\n\t\t\t\tAssert.assertTrue(\"BottomDrawerPopUpContentManager did not dispatch Event.CLOSE.\", closeDispatched);\n\t\t\t}, 400);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testOverlayFactory():void\n\t\t{\n\t\t\tthis._popUp = this.createSimplePopUp();\n\t\t\tthis._popUpContentManager.overlayFactory = this.createOverlay;\n\t\t\tthis._popUpContentManager.open(this._popUp, this._source);\n\t\t\tvar overlay:DisplayObject = this._customRoot.getChildByName(OVERLAY_NAME);\n\t\t\tAssert.assertNotNull(\"DropDownPopUpContentManager overlayFactory result not found.\", overlay);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ButtonFocusTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Button;\n\timport feathers.core.FocusManager;\n\timport feathers.events.FeathersEventType;\n\n\timport flash.ui.Keyboard;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.ButtonState;\n\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.KeyboardEvent;\n\n\tpublic class ButtonFocusTests\n\t{\n\t\tprivate var _target:Button;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._target = new Button();\n\t\t\tthis._target.defaultSkin = new Quad(200, 200, 0xff00ff);\n\t\t\tTestFeathers.starlingRoot.addChild(this._target);\n\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, true);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._target.removeFromParent(true);\n\t\t\tthis._target = null;\n\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, false);\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t\tAssert.assertFalse(\"FocusManager not disabled on cleanup.\", FocusManager.isEnabledForStage(TestFeathers.starlingRoot.stage));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDownStateOnKeyDown():void\n\t\t{\n\t\t\tFocusManager.focus = this._target;\n\t\t\tvar hasChangedState:Boolean = false;\n\t\t\tthis._target.addEventListener(FeathersEventType.STATE_CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChangedState = true;\n\t\t\t});\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, 0, Keyboard.SPACE));\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, 0, Keyboard.SPACE));\n\t\t\tAssert.assertTrue(\"FeathersEventType.STATE_CHANGE was not dispatched\",\n\t\t\t\thasChangedState);\n\t\t\tAssert.assertTrue(\"Button currentState must be ButtonState.DOWN\",\n\t\t\t\tButtonState.DOWN, this._target.currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testUpStateOnKeyUp():void\n\t\t{\n\t\t\tFocusManager.focus = this._target;\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, 0, Keyboard.SPACE));\n\t\t\tvar hasChangedState:Boolean = false;\n\t\t\tthis._target.addEventListener(FeathersEventType.STATE_CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChangedState = true;\n\t\t\t});\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, 0, Keyboard.SPACE));\n\t\t\tAssert.assertTrue(\"FeathersEventType.STATE_CHANGE was not dispatched\",\n\t\t\t\thasChangedState);\n\t\t\tAssert.assertTrue(\"Button currentState must be ButtonState.UP\",\n\t\t\t\tButtonState.UP, this._target.currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testUpStateOnCancelKey():void\n\t\t{\n\t\t\tFocusManager.focus = this._target;\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, 0, Keyboard.SPACE));\n\t\t\tvar hasChangedState:Boolean = false;\n\t\t\tthis._target.addEventListener(FeathersEventType.STATE_CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChangedState = true;\n\t\t\t});\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, 0, Keyboard.ESCAPE));\n\t\t\tAssert.assertTrue(\"FeathersEventType.STATE_CHANGE was not dispatched\",\n\t\t\t\thasChangedState);\n\t\t\tAssert.assertTrue(\"Button currentState must be ButtonState.UP\",\n\t\t\t\tButtonState.UP, this._target.currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTriggeredEvent():void\n\t\t{\n\t\t\tFocusManager.focus = this._target;\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tthis._target.addEventListener(Event.TRIGGERED, function(event:Event):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t});\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, 0, Keyboard.SPACE));\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, 0, Keyboard.SPACE));\n\t\t\tAssert.assertTrue(\"Event.TRIGGERED was not dispatched\", hasTriggered);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDisabled():void\n\t\t{\n\t\t\tthis._target.isEnabled = false;\n\t\t\tthis._target.validate();\n\t\t\tFocusManager.focus = this._target;\n\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tthis._target.addEventListener(Event.TRIGGERED, function(event:Event):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t});\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, 0, Keyboard.SPACE));\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, 0, Keyboard.SPACE));\n\t\t\tAssert.assertFalse(\"Event.TRIGGERED was incorrectly dispatched when disabled\", hasTriggered);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCancelKeyBeforeTriggeredEvent():void\n\t\t{\n\t\t\tFocusManager.focus = this._target;\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tthis._target.addEventListener(Event.TRIGGERED, function(event:Event):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t});\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, 0, Keyboard.SPACE));\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, 0, Keyboard.ESCAPE));\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, 0, Keyboard.ESCAPE));\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, 0, Keyboard.SPACE));\n\t\t\tAssert.assertFalse(\"Event.TRIGGERED was incorrectly dispatched when touch moved out of bounds\", hasTriggered);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ButtonGroupDataProviderEventsTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.ButtonGroup;\n\timport feathers.controls.ToggleButton;\n\timport feathers.data.ListCollection;\n\timport feathers.layout.Direction;\n\n\timport flash.geom.Point;\n\n\timport org.flexunit.Assert;\n\timport org.flexunit.async.Async;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\tpublic class ButtonGroupDataProviderEventsTests\n\t{\n\t\tprivate var _group:ButtonGroup;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._group = new ButtonGroup();\n\t\t\tthis._group.direction = Direction.VERTICAL;\n\t\t\tTestFeathers.starlingRoot.addChild(this._group);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._group.removeFromParent(true);\n\t\t\tthis._group = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTriggeredEventInDataProvider():void\n\t\t{\n\t\t\tvar triggeredItem:Object;\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tfunction triggeredListener(event:Event, data:Object, item:Object):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t\ttriggeredItem = item;\n\t\t\t}\n\t\t\t\n\t\t\tthis._group.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{ label: \"One\" },\n\t\t\t\t{ label: \"Two\", triggered: triggeredListener },\n\t\t\t\t{ label: \"Three\" },\n\t\t\t]);\n\t\t\tthis._group.buttonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(200, 200);\n\t\t\t\treturn button;\n\t\t\t}\n\t\t\tthis._group.validate();\n\t\t\t\n\t\t\tvar position:Point = new Point(10, 210);\n\t\t\tvar target:DisplayObject = this._group.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t//this touch does not move at all, so it should result in triggering\n\t\t\t//the button.\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertTrue(\"Event.TRIGGERED was not dispatched to listener in data provider\", hasTriggered);\n\t\t\tAssert.assertStrictlyEquals(\"Event.TRIGGERED was not dispatched with correct item to listener in data provider\", this._group.dataProvider.getItemAt(1), triggeredItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChangeEventInDataProvider():void\n\t\t{\n\t\t\tvar changedItem:Object;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tfunction changeListener(event:Event, data:Object, item:Object):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t\tchangedItem = item;\n\t\t\t}\n\n\t\t\tthis._group.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{ label: \"One\" },\n\t\t\t\t{ label: \"Two\", change: changeListener },\n\t\t\t\t{ label: \"Three\" },\n\t\t\t]);\n\t\t\tthis._group.buttonFactory = function():ToggleButton\n\t\t\t{\n\t\t\t\tvar button:ToggleButton = new ToggleButton();\n\t\t\t\tbutton.defaultSkin = new Quad(200, 200);\n\t\t\t\treturn button;\n\t\t\t}\n\t\t\tthis._group.validate();\n\t\t\t\n\t\t\tvar position:Point = new Point(10, 210);\n\t\t\tvar target:DisplayObject = this._group.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t//this touch does not move at all, so it should result in triggering\n\t\t\t//the button.\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched to listener in data provider\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"Event.CHANGE was not dispatched with correct item to listener in data provider\", this._group.dataProvider.getItemAt(1), changedItem);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testLongPressEventInDataProvider():void\n\t\t{\n\t\t\tvar longPressItem:Object;\n\t\t\tvar hasLongPressed:Boolean = false;\n\t\t\tfunction longPressListener(event:Event, data:Object, item:Object):void\n\t\t\t{\n\t\t\t\thasLongPressed = true;\n\t\t\t\tlongPressItem = item;\n\t\t\t}\n\n\t\t\tthis._group.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{ label: \"One\" },\n\t\t\t\t{ label: \"Two\", isLongPressEnabled: true, longPress: longPressListener },\n\t\t\t\t{ label: \"Three\" },\n\t\t\t]);\n\t\t\tthis._group.buttonFactory = function():ToggleButton\n\t\t\t{\n\t\t\t\tvar button:ToggleButton = new ToggleButton();\n\t\t\t\tbutton.defaultSkin = new Quad(200, 200);\n\t\t\t\treturn button;\n\t\t\t}\n\t\t\tthis._group.validate();\n\n\t\t\tvar position:Point = new Point(10, 210);\n\t\t\tvar target:DisplayObject = this._group.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = 10;\n\t\t\ttouch.globalY = 210;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertTrue(\"FeathersEventType.LONG_PRESS was not dispatched to listener in data provider\", hasLongPressed);\n\t\t\t\tAssert.assertStrictlyEquals(\"Event.CHANGE was not dispatched with correct item to listener in data provider\", _group.dataProvider.getItemAt(1), longPressItem);\n\t\t\t}, 600);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ButtonGroupMeasurementTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.ButtonGroup;\n\timport feathers.data.ListCollection;\n\timport feathers.layout.Direction;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class ButtonGroupMeasurementTests\n\t{\n\t\tprivate static const PADDING_TOP:Number = 6;\n\t\tprivate static const PADDING_RIGHT:Number = 8;\n\t\tprivate static const PADDING_BOTTOM:Number = 2;\n\t\tprivate static const PADDING_LEFT:Number = 10;\n\t\tprivate static const GAP:Number = 5;\n\t\tprivate static const FIRST_GAP:Number = 7;\n\t\tprivate static const LAST_GAP:Number = 6;\n\t\tprivate static const BUTTON_WIDTH:Number = 200;\n\t\tprivate static const BUTTON_HEIGHT:Number = 100;\n\t\t\n\t\tprivate var _group:ButtonGroup;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._group = new ButtonGroup();\n\t\t\tthis._group.buttonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.hasLabelTextRenderer = false;\n\t\t\t\tbutton.defaultSkin = new Quad(BUTTON_WIDTH, BUTTON_HEIGHT, 0xff00ff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tTestFeathers.starlingRoot.addChild(this._group);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._group.removeFromParent(true);\n\t\t\tthis._group = null;\n\t\t\t\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testVerticalDimensionsWithNoItems():void\n\t\t{\n\t\t\tthis._group.direction = Direction.VERTICAL;\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup width not equal to 0 with empty data provider.\",\n\t\t\t\t0, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup height not equal to 0 with empty data provider.\",\n\t\t\t\t0, this._group.height);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minWidth not equal to 0 with empty data provider.\",\n\t\t\t\t0, this._group.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minHeight not equal to 0 with empty data provider.\",\n\t\t\t\t0, this._group.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testVerticalDimensionsWithPaddingGapAndNoItems():void\n\t\t{\n\t\t\tthis._group.direction = Direction.VERTICAL;\n\t\t\tthis._group.paddingTop = PADDING_TOP;\n\t\t\tthis._group.paddingRight = PADDING_RIGHT;\n\t\t\tthis._group.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._group.paddingLeft = PADDING_LEFT;\n\t\t\tthis._group.gap = GAP;\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup width not equal to sum of left and right padding with empty data provider.\", PADDING_LEFT + PADDING_RIGHT, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup height not equal to sum of top and bottom padding with empty data provider.\", PADDING_TOP + PADDING_BOTTOM, this._group.height);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minWidth not equal to sum of left and right padding with empty data provider.\", PADDING_LEFT + PADDING_RIGHT, this._group.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minHeight not equal to sum of top and bottom padding with empty data provider.\", PADDING_TOP + PADDING_BOTTOM, this._group.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testVerticalDimensionsWithOneChild():void\n\t\t{\n\t\t\tthis._group.direction = Direction.VERTICAL;\n\t\t\tthis._group.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup width not equal to one button width.\", BUTTON_WIDTH, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup height not equal to one button height.\", BUTTON_HEIGHT, this._group.height);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minWidth not equal to one button width.\", BUTTON_WIDTH, this._group.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minHeight not equal to one button height.\", BUTTON_HEIGHT, this._group.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testVerticalDimensionsWithPaddingGapAndOneChild():void\n\t\t{\n\t\t\tthis._group.direction = Direction.VERTICAL;\n\t\t\tthis._group.paddingTop = PADDING_TOP;\n\t\t\tthis._group.paddingRight = PADDING_RIGHT;\n\t\t\tthis._group.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._group.paddingLeft = PADDING_LEFT;\n\t\t\tthis._group.gap = GAP;\n\t\t\tthis._group.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup width not equal to sum of left and right padding and width of button.\", BUTTON_WIDTH + PADDING_LEFT + PADDING_RIGHT, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup height not equal to sum of top and bottom padding and height of button.\", BUTTON_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._group.height);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minWidth not equal to sum of left and right padding and width of button.\", BUTTON_WIDTH + PADDING_LEFT + PADDING_RIGHT, this._group.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minHeight not equal to sum of top and bottom padding and height of button.\", BUTTON_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._group.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testVerticalDimensionsWithTwoChildren():void\n\t\t{\n\t\t\tthis._group.direction = Direction.VERTICAL;\n\t\t\tthis._group.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup width not equal to max width of buttons.\", BUTTON_WIDTH, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup height not equal to sum of button heights.\", BUTTON_HEIGHT * 2, this._group.height);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minWidth not equal to max width of buttons.\", BUTTON_WIDTH, this._group.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minHeight not equal to sum of button heights.\", BUTTON_HEIGHT * 2, this._group.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testVerticalDimensionsWithPaddingGapAndTwoChildren():void\n\t\t{\n\t\t\tthis._group.direction = Direction.VERTICAL;\n\t\t\tthis._group.paddingTop = PADDING_TOP;\n\t\t\tthis._group.paddingRight = PADDING_RIGHT;\n\t\t\tthis._group.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._group.paddingLeft = PADDING_LEFT;\n\t\t\tthis._group.gap = GAP;\n\t\t\tthis._group.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup width not equal to sum of left and right padding and max width of buttons.\", BUTTON_WIDTH + PADDING_LEFT + PADDING_RIGHT, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup height not equal to sum of top and bottom padding, gap, and sum of button heights.\", BUTTON_HEIGHT * 2 + GAP + PADDING_TOP + PADDING_BOTTOM, this._group.height);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minWidth not equal to sum of left and right padding and max width of buttons.\", BUTTON_WIDTH + PADDING_LEFT + PADDING_RIGHT, this._group.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minHeight not equal to sum of top and bottom padding, gap, and sum of button heights.\", BUTTON_HEIGHT * 2 + GAP + PADDING_TOP + PADDING_BOTTOM, this._group.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testVerticalHeightWithFirstGapAndTwoChildren():void\n\t\t{\n\t\t\tthis._group.direction = Direction.VERTICAL;\n\t\t\tthis._group.gap = GAP;\n\t\t\tthis._group.firstGap = FIRST_GAP;\n\t\t\tthis._group.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup height not equal to first gap plus sum of button heights.\", BUTTON_HEIGHT * 2 + FIRST_GAP, this._group.height);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minHeight not equal to first gap plus sum of button heights.\", BUTTON_HEIGHT * 2 + FIRST_GAP, this._group.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testVerticalHeightWithLastGapAndTwoChildren():void\n\t\t{\n\t\t\tthis._group.direction = Direction.VERTICAL;\n\t\t\tthis._group.gap = GAP;\n\t\t\tthis._group.lastGap = LAST_GAP;\n\t\t\tthis._group.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup height not equal to gap plus sum of button heights when using last gap with two buttons.\", BUTTON_HEIGHT * 2 + GAP, this._group.height);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minHeight not equal to gap plus sum of button heights when using last gap with two buttons.\", BUTTON_HEIGHT * 2 + GAP, this._group.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testVerticalHeightWithFirstGapAndThreeChildren():void\n\t\t{\n\t\t\tthis._group.direction = Direction.VERTICAL;\n\t\t\tthis._group.gap = GAP;\n\t\t\tthis._group.firstGap = FIRST_GAP;\n\t\t\tthis._group.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup height not equal to sum of button heights, plus first gap, plus gap, with three buttons.\", BUTTON_HEIGHT * 3 + GAP + FIRST_GAP, this._group.height);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minHeight not equal to sum of button heights, plus first gap, plus gap, with three buttons.\", BUTTON_HEIGHT * 3 + GAP + FIRST_GAP, this._group.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testVerticalHeightWithLastGapAndThreeChildren():void\n\t\t{\n\t\t\tthis._group.direction = Direction.VERTICAL;\n\t\t\tthis._group.gap = GAP;\n\t\t\tthis._group.lastGap = LAST_GAP;\n\t\t\tthis._group.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup height not equal to sum of button heights, plus gap, plus last gap, with three buttons.\", BUTTON_HEIGHT * 3 + GAP + LAST_GAP, this._group.height);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minHeight not equal to sum of button heights, plus gap, plus last gap, with three buttons.\", BUTTON_HEIGHT * 3 + GAP + LAST_GAP, this._group.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testVerticalHeightWithFirstAndLastGapAndFourChildren():void\n\t\t{\n\t\t\tthis._group.direction = Direction.VERTICAL;\n\t\t\tthis._group.gap = GAP;\n\t\t\tthis._group.firstGap = FIRST_GAP;\n\t\t\tthis._group.lastGap = LAST_GAP;\n\t\t\tthis._group.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup height not equal to sum of button heights, plus first gap, plus gap, plus last gap, with four buttons.\", BUTTON_HEIGHT * 4 + FIRST_GAP + GAP + LAST_GAP, this._group.height);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minHeight not equal to sum of button heights, plus first gap, plus gap, plus last gap, with four buttons.\", BUTTON_HEIGHT * 4 + FIRST_GAP + GAP + LAST_GAP, this._group.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHorizontalDimensionsWithNoChildren():void\n\t\t{\n\t\t\tthis._group.direction = Direction.HORIZONTAL;\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup width not equal to 0 with no buttons.\", 0, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup height not equal to 0 with no buttons.\", 0, this._group.height);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minWidth not equal to 0 with no buttons.\", 0, this._group.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minHeight not equal to 0 with no buttons.\", 0, this._group.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHorizontalDimensionsWithPaddingGapAndNoChildren():void\n\t\t{\n\t\t\tthis._group.direction = Direction.HORIZONTAL;\n\t\t\tthis._group.paddingTop = PADDING_TOP;\n\t\t\tthis._group.paddingRight = PADDING_RIGHT;\n\t\t\tthis._group.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._group.paddingLeft = PADDING_LEFT;\n\t\t\tthis._group.gap = GAP;\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup width not equal to sum of left and right padding with no buttons.\", PADDING_LEFT + PADDING_RIGHT, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup height not equal to sum of top and bottom padding with no buttons.\", PADDING_TOP + PADDING_BOTTOM, this._group.height);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minWidth not equal to sum of left and right padding with no buttons.\", PADDING_LEFT + PADDING_RIGHT, this._group.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minHeight not equal to sum of top and bottom padding with no buttons.\", PADDING_TOP + PADDING_BOTTOM, this._group.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHorizontalDimensionsWithOneChild():void\n\t\t{\n\t\t\tthis._group.direction = Direction.HORIZONTAL;\n\t\t\tthis._group.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup width not equal to button width.\", BUTTON_WIDTH, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup height not equal to button height.\", BUTTON_HEIGHT, this._group.height);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minWidth not equal to button width.\", BUTTON_WIDTH, this._group.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minHeight not equal to button height.\", BUTTON_HEIGHT, this._group.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHorizontalDimensionsWithPaddingGapAndOneChild():void\n\t\t{\n\t\t\tthis._group.direction = Direction.HORIZONTAL;\n\t\t\tthis._group.paddingTop = PADDING_TOP;\n\t\t\tthis._group.paddingRight = PADDING_RIGHT;\n\t\t\tthis._group.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._group.paddingLeft = PADDING_LEFT;\n\t\t\tthis._group.gap = GAP;\n\t\t\tthis._group.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup width not equal to sum of left and right padding and width of button.\", BUTTON_WIDTH + PADDING_LEFT + PADDING_RIGHT, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup height not equal to sum of top and bottom padding and height of button.\", BUTTON_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._group.height);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minWidth not equal to sum of left and right padding and width of button.\", BUTTON_WIDTH + PADDING_LEFT + PADDING_RIGHT, this._group.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minHeight not equal to sum of top and bottom padding and height of button.\", BUTTON_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._group.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHorizontalDimensionsWithTwoChildren():void\n\t\t{\n\t\t\tthis._group.direction = Direction.HORIZONTAL;\n\t\t\tthis._group.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup width not equal to sum of button widths.\", BUTTON_WIDTH * 2, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup height not equal to max height of buttons.\", BUTTON_HEIGHT, this._group.height);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minWidth not equal to sum of button widths.\", BUTTON_WIDTH * 2, this._group.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minHeight not equal to max height of buttons.\", BUTTON_HEIGHT, this._group.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHorizontalDimensionsWithPaddingGapAndTwoChildren():void\n\t\t{\n\t\t\tthis._group.direction = Direction.HORIZONTAL;\n\t\t\tthis._group.paddingTop = PADDING_TOP;\n\t\t\tthis._group.paddingRight = PADDING_RIGHT;\n\t\t\tthis._group.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._group.paddingLeft = PADDING_LEFT;\n\t\t\tthis._group.gap = GAP;\n\t\t\tthis._group.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup width not equal to sum of left and right padding, gap, and sum of button widths.\", BUTTON_WIDTH * 2 + GAP + PADDING_LEFT + PADDING_RIGHT, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup height not equal to sum of top and bottom padding and max height of buttons.\", BUTTON_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._group.height);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minWidth not equal to sum of left and right padding, gap, and sum of button widths.\", BUTTON_WIDTH * 2 + GAP + PADDING_LEFT + PADDING_RIGHT, this._group.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minHeight not equal to sum of top and bottom padding and max height of buttons.\", BUTTON_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._group.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHorizontalWidthWithGapAndTwoChildren():void\n\t\t{\n\t\t\tthis._group.direction = Direction.HORIZONTAL;\n\t\t\tthis._group.gap = GAP;\n\t\t\tthis._group.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup width not equal to gap plus sum of button widths.\", BUTTON_WIDTH * 2 + GAP, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minWidth not equal to gap plus sum of button widths.\", BUTTON_WIDTH * 2 + GAP, this._group.minWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHorizontalWidthWithFirstGapAndTwoChildren():void\n\t\t{\n\t\t\tthis._group.direction = Direction.HORIZONTAL;\n\t\t\tthis._group.gap = GAP;\n\t\t\tthis._group.firstGap = FIRST_GAP;\n\t\t\tthis._group.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup width not equal to gap plus sum of button widths.\", BUTTON_WIDTH * 2 + FIRST_GAP, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minWidth not equal to gap plus sum of button widths.\", BUTTON_WIDTH * 2 + FIRST_GAP, this._group.minWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHorizontalWidthWithLastGapAndTwoChildren():void\n\t\t{\n\t\t\tthis._group.direction = Direction.HORIZONTAL;\n\t\t\tthis._group.gap = GAP;\n\t\t\tthis._group.lastGap = LAST_GAP;\n\t\t\tthis._group.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup width not equal to gap plus sum of button widths when using last gap with two buttons.\", BUTTON_WIDTH * 2 + GAP, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minWidth not equal to gap plus sum of button widths when using last gap with two buttons.\", BUTTON_WIDTH * 2 + GAP, this._group.minWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHorizontalWidthWithFirstGapAndThreeChildren():void\n\t\t{\n\t\t\tthis._group.direction = Direction.HORIZONTAL;\n\t\t\tthis._group.gap = GAP;\n\t\t\tthis._group.firstGap = FIRST_GAP;\n\t\t\tthis._group.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup width not equal to sum of button widths, plus first gap, plus gap, with three buttons.\", BUTTON_WIDTH * 3 + GAP + FIRST_GAP, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minWidth not equal to sum of button widths, plus first gap, plus gap, with three buttons.\", BUTTON_WIDTH * 3 + GAP + FIRST_GAP, this._group.minWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHorizontalWidthWithLastGapAndThreeChildren():void\n\t\t{\n\t\t\tthis._group.direction = Direction.HORIZONTAL;\n\t\t\tthis._group.gap = GAP;\n\t\t\tthis._group.lastGap = LAST_GAP;\n\t\t\tthis._group.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup width not equal to sum of button widths, plus gap, plus last gap, with three buttons.\", BUTTON_WIDTH * 3 + GAP + LAST_GAP, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minWidth not equal to sum of button widths, plus gap, plus last gap, with three buttons.\", BUTTON_WIDTH * 3 + GAP + LAST_GAP, this._group.minWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHorizontalWidthWithFirstAndLastGapAndFourChildren():void\n\t\t{\n\t\t\tthis._group.direction = Direction.HORIZONTAL;\n\t\t\tthis._group.gap = GAP;\n\t\t\tthis._group.firstGap = FIRST_GAP;\n\t\t\tthis._group.lastGap = LAST_GAP;\n\t\t\tthis._group.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup width not equal to sum of button widths, plus first gap, plus gap, plus last gap, with four buttons.\", BUTTON_WIDTH * 4 + FIRST_GAP + GAP + LAST_GAP, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup minWidth not equal to sum of button widths, plus first gap, plus gap, plus last gap, with four buttons.\", BUTTON_WIDTH * 4 + FIRST_GAP + GAP + LAST_GAP, this._group.minWidth);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ButtonGroupTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.ButtonGroup;\n\timport feathers.data.ListCollection;\n\timport feathers.layout.Direction;\n\n\timport flash.geom.Point;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\tpublic class ButtonGroupTests\n\t{\n\t\tprivate var _group:ButtonGroup;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._group = new ButtonGroup();\n\t\t\tthis._group.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{ label: \"One\", name: \"one\" },\n\t\t\t\t{ label: \"Two\", name: \"two\" },\n\t\t\t\t{ label: \"Three\", isEnabled: true, name: \"three\" },\n\t\t\t\t{ label: \"Four\", isEnabled: false, name: \"four\" },\n\t\t\t]);\n\t\t\tthis._group.buttonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(200, 200);\n\t\t\t\treturn button;\n\t\t\t}\n\t\t\tthis._group.direction = Direction.VERTICAL;\n\t\t\tTestFeathers.starlingRoot.addChild(this._group);\n\t\t\tthis._group.validate();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._group.removeFromParent(true);\n\t\t\tthis._group = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTriggeredEvent():void\n\t\t{\n\t\t\tvar triggeredItem:Object;\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tthis._group.addEventListener(Event.TRIGGERED, function(event:Event):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t\ttriggeredItem = event.data;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 210);\n\t\t\tvar target:DisplayObject = this._group.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t//this touch does not move at all, so it should result in triggering\n\t\t\t//the button.\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertTrue(\"Event.TRIGGERED was not dispatched\", hasTriggered);\n\t\t\tAssert.assertStrictlyEquals(\"Event.TRIGGERED was not dispatched with correct data\", this._group.dataProvider.getItemAt(1), triggeredItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDirectionSetToVerticalAndDistributeButtonSizesSetToTrueWithLargerHeight():void\n\t\t{\n\t\t\tthis._group.direction = Direction.VERTICAL;\n\t\t\tthis._group.distributeButtonSizes = true;\n\t\t\tthis._group.height = 1600;\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup button height not changed with vertical direction, larger explicit height, and distributeButtonSizes set to true\", 400, this._group.getChildByName(\"one\").height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDirectionSetToVerticalAndDistributeButtonSizesSetToTrueWithSmallerHeight():void\n\t\t{\n\t\t\tthis._group.direction = Direction.VERTICAL;\n\t\t\tthis._group.distributeButtonSizes = true;\n\t\t\tthis._group.height = 400;\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup button height not changed with vertical direction, smaller explicit height, and distributeButtonSizes set to true\", 100, this._group.getChildByName(\"one\").height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDirectionSetToVerticalAndDistributeButtonSizesSetToFalseWithLargerHeight():void\n\t\t{\n\t\t\tvar originalButtonHeight:Number = this._group.getChildByName(\"one\").height;\n\t\t\tthis._group.direction = Direction.VERTICAL;\n\t\t\tthis._group.distributeButtonSizes = false;\n\t\t\tthis._group.height = 1600;\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup button height not changed with vertical direction, larger explicit height, and distributeButtonSizes set to true\", originalButtonHeight, this._group.getChildByName(\"one\").height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDirectionSetToVerticalAndDistributeButtonSizesSetToFalseWithSmallerHeight():void\n\t\t{\n\t\t\tvar originalButtonHeight:Number = this._group.getChildByName(\"one\").height;\n\t\t\tthis._group.direction = Direction.VERTICAL;\n\t\t\tthis._group.distributeButtonSizes = false;\n\t\t\tthis._group.height = 300;\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup button height not changed with vertical direction, smaller explicit height, and distributeButtonSizes set to true\", originalButtonHeight, this._group.getChildByName(\"one\").height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDirectionSetToHorizontalAndDistributeButtonSizesSetToTrueWithLargerWidth():void\n\t\t{\n\t\t\tthis._group.direction = Direction.HORIZONTAL;\n\t\t\tthis._group.distributeButtonSizes = true;\n\t\t\tthis._group.width = 1600;\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup button width not changed with horizontal direction, larger explicit width, and distributeButtonSizes set to true\", 400, this._group.getChildByName(\"one\").width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDirectionSetToHorizontalAndDistributeButtonSizesSetToTrueWithSmallerWidth():void\n\t\t{\n\t\t\tthis._group.direction = Direction.HORIZONTAL;\n\t\t\tthis._group.distributeButtonSizes = true;\n\t\t\tthis._group.width = 400;\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup button width not changed with horizontal direction, smaller explicit width, and distributeButtonSizes set to true\", 100, this._group.getChildByName(\"one\").width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDirectionSetToHorizontalAndDistributeButtonSizesSetToFalseWithLargerWidth():void\n\t\t{\n\t\t\tvar originalButtonWidth:Number = this._group.getChildByName(\"one\").width;\n\t\t\tthis._group.direction = Direction.HORIZONTAL;\n\t\t\tthis._group.distributeButtonSizes = false;\n\t\t\tthis._group.width = 1600;\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup button width not changed with horizontal direction, larger explicit width, and distributeButtonSizes set to false\", originalButtonWidth, this._group.getChildByName(\"one\").width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testButtonWidthAfterDirectionSetToHorizontalAndDistributeButtonSizesSetToFalseWithSmallerWidth():void\n\t\t{\n\t\t\tvar button:DisplayObject = this._group.getChildByName(\"one\");\n\t\t\tvar originalButtonWidth:Number = button.width;\n\t\t\tvar originalButtonHeight:Number = button.height;\n\t\t\tthis._group.direction = Direction.HORIZONTAL;\n\t\t\tthis._group.distributeButtonSizes = false;\n\t\t\tthis._group.width = 300;\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup button width not changed with horizontal direction, smaller explicit width, and distributeButtonSizes set to false\", originalButtonWidth, this._group.getChildByName(\"one\").width);\n\t\t\tAssert.assertStrictlyEquals(\"ButtonGroup button not on new row with flow layout and small explicit width\", originalButtonHeight, this._group.getChildByName(\"two\").y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDisableAndReenable():void\n\t\t{\n\t\t\tthis._group.isEnabled = false;\n\t\t\tthis._group.validate();\n\t\t\tthis._group.isEnabled = true;\n\t\t\tthis._group.validate();\n\t\t\tvar button1:Button = Button(this._group.getChildByName(\"one\"));\n\t\t\tvar button3:Button = Button(this._group.getChildByName(\"three\"));\n\t\t\tvar button4:Button = Button(this._group.getChildByName(\"four\"));\n\t\t\tAssert.assertTrue(\"Button without isEnabled value in data provider is not enabled when ButtonGroup is disabled and then re-enabled\", button1.isEnabled);\n\t\t\tAssert.assertTrue(\"Button with isEnabled value set to true in data provider is not enabled when ButtonGroup is disabled and then re-enabled\", button3.isEnabled);\n\t\t\tAssert.assertFalse(\"Button with isEnabled value set to false in data provider is not disabled when ButtonGroup is disabled and then re-enabled\", button4.isEnabled);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDisable():void\n\t\t{\n\t\t\tthis._group.isEnabled = false;\n\t\t\tthis._group.validate();\n\t\t\tvar button1:Button = Button(this._group.getChildByName(\"one\"));\n\t\t\tvar button3:Button = Button(this._group.getChildByName(\"three\"));\n\t\t\tvar button4:Button = Button(this._group.getChildByName(\"four\"));\n\t\t\tAssert.assertFalse(\"Button without isEnabled value in data provider is incorrectly enabled when ButtonGroup is disabled\", button1.isEnabled);\n\t\t\tAssert.assertFalse(\"Button with isEnabled value set to true in data provider is incorrectly enabled when ButtonGroup is disabled\", button3.isEnabled);\n\t\t\tAssert.assertFalse(\"Button with isEnabled value set to false in data provider is incorrectly enabled when ButtonGroup is disabled\", button4.isEnabled);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ButtonInternalStateTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.ButtonState;\n\timport feathers.controls.text.BitmapFontTextRenderer;\n\timport feathers.text.BitmapFontTextFormat;\n\n\timport flash.geom.Point;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.text.BitmapFont;\n\n\tpublic class ButtonInternalStateTests\n\t{\n\t\tprivate var _button:ButtonWithInternalState;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._button = new ButtonWithInternalState();\n\t\t\tTestFeathers.starlingRoot.addChild(this._button);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._button.removeFromParent(true);\n\t\t\tthis._button = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetIconForStateWithoutSetIconForState():void\n\t\t{\n\t\t\tAssert.assertNull(\"Button getIconForState(ButtonState.UP) must be null when setIconForState() is not called\", this._button.getIconForState(ButtonState.UP));\n\t\t\tAssert.assertNull(\"Button getIconForState(ButtonState.HOVER) must be null when setIconForState() is not called\", this._button.getIconForState(ButtonState.HOVER));\n\t\t\tAssert.assertNull(\"Button getIconForState(ButtonState.DOWN) must be null when setIconForState() is not called\", this._button.getIconForState(ButtonState.DOWN));\n\t\t\tAssert.assertNull(\"Button getIconForState(ButtonState.DISABLED) must be null when setIconForState() is not called\", this._button.getIconForState(ButtonState.DISABLED));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetIconForState():void\n\t\t{\n\t\t\tvar defaultIcon:Quad = new Quad(200, 200);\n\t\t\tthis._button.defaultIcon = defaultIcon;\n\n\t\t\tvar upIcon:Quad = new Quad(200, 200);\n\t\t\tthis._button.setIconForState(ButtonState.UP, upIcon);\n\n\t\t\tvar hoverIcon:Quad = new Quad(200, 200);\n\t\t\tthis._button.setIconForState(ButtonState.HOVER, hoverIcon);\n\n\t\t\tvar downIcon:Quad = new Quad(200, 200);\n\t\t\tthis._button.setIconForState(ButtonState.DOWN, downIcon);\n\n\t\t\tvar disabledIcon:Quad = new Quad(200, 200);\n\t\t\tthis._button.setIconForState(ButtonState.DISABLED, disabledIcon);\n\n\t\t\tAssert.assertStrictlyEquals(\"Button getIconForState(ButtonState.UP) does not match value passed to setIconForState()\", upIcon, this._button.getIconForState(ButtonState.UP));\n\t\t\tAssert.assertStrictlyEquals(\"Button getIconForState(ButtonState.HOVER) does not match value passed to setIconForState()\", hoverIcon, this._button.getIconForState(ButtonState.HOVER));\n\t\t\tAssert.assertStrictlyEquals(\"Button getIconForState(ButtonState.DOWN) does not match value passed to setIconForState()\", downIcon, this._button.getIconForState(ButtonState.DOWN));\n\t\t\tAssert.assertStrictlyEquals(\"Button getIconForState(ButtonState.DISABLED) does not match value passed to setIconForState()\", disabledIcon, this._button.getIconForState(ButtonState.DISABLED));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDefaultCurrentIcon():void\n\t\t{\n\t\t\tvar defaultIcon:Quad = new Quad(200, 200);\n\t\t\tthis._button.defaultIcon = defaultIcon;\n\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Button state is not ButtonState.UP with no touch\", ButtonState.UP, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"Button icon is not defaultIcon when currentState is ButtonState.UP and icon not provided for this state\", defaultIcon, this._button.currentIconInternal);\n\n\t\t\tthis._button.isEnabled = false;\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Button state is not ButtonState.DISABLED when isEnabled is false\", ButtonState.DISABLED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"Button icon is not defaultIcon when currentState is ButtonState.DISABLED and icon not provided for this state\", defaultIcon, this._button.currentIconInternal);\n\n\t\t\tthis._button.isEnabled = true;\n\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tAssert.assertStrictlyEquals(\"Touch target must be button\", this._button, target);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.HOVER;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Button state is not ButtonState.HOVER on TouchPhase.HOVER\", ButtonState.HOVER, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"Button icon is not defaultIcon when currentState is ButtonState.HOVER and icon not provided for this state\", defaultIcon, this._button.currentIconInternal);\n\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Button state is not ButtonState.DOWN on TouchPhase.BEGAN\", ButtonState.DOWN, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"Button icon is not defaultIcon when currentState is ButtonState.DOWN and icon not provided for this state\", defaultIcon, this._button.currentIconInternal);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentIconWithSetIconForState():void\n\t\t{\n\t\t\tvar defaultIcon:Quad = new Quad(200, 200);\n\t\t\tthis._button.defaultIcon = defaultIcon;\n\n\t\t\tvar upIcon:Quad = new Quad(200, 200);\n\t\t\tthis._button.setIconForState(ButtonState.UP, upIcon);\n\n\t\t\tvar hoverIcon:Quad = new Quad(200, 200);\n\t\t\tthis._button.setIconForState(ButtonState.HOVER, hoverIcon);\n\n\t\t\tvar downIcon:Quad = new Quad(200, 200);\n\t\t\tthis._button.setIconForState(ButtonState.DOWN, downIcon);\n\n\t\t\tvar disabledIcon:Quad = new Quad(200, 200);\n\t\t\tthis._button.setIconForState(ButtonState.DISABLED, disabledIcon);\n\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Button state is not ButtonState.UP with no touch\", ButtonState.UP, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"Button icon does not match icon set with setIconForState() when currentState is ButtonState.UP\", upIcon, this._button.currentIconInternal);\n\n\t\t\tthis._button.isEnabled = false;\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Button state is not ButtonState.DISABLED when isEnabled is false\", ButtonState.DISABLED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"Button icon does not match icon set with setIconForState() when currentState is ButtonState.DISABLED\", disabledIcon, this._button.currentIconInternal);\n\n\t\t\tthis._button.isEnabled = true;\n\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tAssert.assertStrictlyEquals(\"Touch target must be button\", this._button, target);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.HOVER;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Button state is not ButtonState.HOVER on TouchPhase.HOVER\", ButtonState.HOVER, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"Button icon does not match icon set with setIconForState() when currentState is ButtonState.HOVER and icon not provided for this state\", hoverIcon, this._button.currentIconInternal);\n\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Button state is not ButtonState.DOWN on TouchPhase.BEGAN\", ButtonState.DOWN, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"Button icon does not match icon set with setIconForState() when currentState is ButtonState.DOWN and icon not provided for this state\", downIcon, this._button.currentIconInternal);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDefaultLabelProperties():void\n\t\t{\n\t\t\tthis._button.defaultSkin = new Quad(200, 200);\n\t\t\t\n\t\t\tvar defaultFontSize:Number = 10;\n\n\t\t\tthis._button.defaultLabelProperties.textFormat = new BitmapFontTextFormat(new BitmapFont(), defaultFontSize);\n\n\t\t\tthis._button.validate();\n\t\t\tvar textRenderer:BitmapFontTextRenderer = BitmapFontTextRenderer(this._button.labelTextRendererInternal);\n\n\t\t\tAssert.assertStrictlyEquals(\"Button state is not ButtonState.UP with no touch\", ButtonState.UP, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"Button label font size does not match format set with defaultLabelProperties\", defaultFontSize, textRenderer.textFormat.size);\n\n\t\t\tthis._button.isEnabled = false;\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Button state is not ButtonState.DISABLED when isEnabled is false\", ButtonState.DISABLED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"Button label font size does not match format set with defaultLabelProperties\", defaultFontSize, textRenderer.textFormat.size);\n\n\t\t\tthis._button.isEnabled = true;\n\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tAssert.assertStrictlyEquals(\"Touch target must be button\", this._button, target);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.HOVER;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Button state is not ButtonState.HOVER on TouchPhase.HOVER\", ButtonState.HOVER, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"Button label font size does not match format set with defaultLabelProperties\", defaultFontSize, textRenderer.textFormat.size);\n\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Button state is not ButtonState.DOWN on TouchPhase.BEGAN\", ButtonState.DOWN, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"Button label font size does not match format set with defaultLabelProperties\", defaultFontSize, textRenderer.textFormat.size);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetScaleForStateWithoutSetSkinForState():void\n\t\t{\n\t\t\tAssert.assertTrue(\"Button getScaleForState(ButtonState.UP) must be NaN when setScaleForState() is not called\",\n\t\t\t\tisNaN(this._button.getScaleForState(ButtonState.UP)));\n\t\t\tAssert.assertTrue(\"Button getScaleForState(ButtonState.HOVER) must be NaN when setScaleForState() is not called\",\n\t\t\t\tisNaN(this._button.getScaleForState(ButtonState.HOVER)));\n\t\t\tAssert.assertTrue(\"Button getScaleForState(ButtonState.DOWN) must be NaN when setScaleForState() is not called\",\n\t\t\t\tisNaN(this._button.getScaleForState(ButtonState.DOWN)));\n\t\t\tAssert.assertTrue(\"Button getScaleForState(ButtonState.DISABLED) must be NaN when setScaleForState() is not called\",\n\t\t\t\tisNaN(this._button.getScaleForState(ButtonState.DISABLED)));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetScaleForState():void\n\t\t{\n\t\t\tvar upScale:Number = 1.1;\n\t\t\tthis._button.setScaleForState(ButtonState.UP, upScale);\n\n\t\t\tvar hoverScale:Number = 1.2;\n\t\t\tthis._button.setScaleForState(ButtonState.HOVER, hoverScale);\n\n\t\t\tvar downScale:Number = 1.3;\n\t\t\tthis._button.setScaleForState(ButtonState.DOWN, downScale);\n\n\t\t\tvar disabledScale:Number = 1.4;\n\t\t\tthis._button.setScaleForState(ButtonState.DISABLED, disabledScale);\n\n\t\t\tAssert.assertStrictlyEquals(\"Button getScaleForState(ButtonState.UP) does not match value passed to setScaleForState()\", upScale, this._button.getScaleForState(ButtonState.UP));\n\t\t\tAssert.assertStrictlyEquals(\"Button getScaleForState(ButtonState.HOVER) does not match value passed to setScaleForState()\", hoverScale, this._button.getScaleForState(ButtonState.HOVER));\n\t\t\tAssert.assertStrictlyEquals(\"Button getScaleForState(ButtonState.DOWN) does not match value passed to setScaleForState()\", downScale, this._button.getScaleForState(ButtonState.DOWN));\n\t\t\tAssert.assertStrictlyEquals(\"Button getScaleForState(ButtonState.DISABLED) does not match value passed to setScaleForState()\", disabledScale, this._button.getScaleForState(ButtonState.DISABLED));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDefaultCurrentScale():void\n\t\t{\n\t\t\tthis._button.defaultSkin = new Quad(200, 200);\n\n\t\t\tthis._button.isEnabled = false;\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Button state is not ButtonState.DISABLED when isEnabled is false\",\n\t\t\t\tButtonState.DISABLED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"Button scale is not 1 when currentState is ButtonState.DISABLED and scale not provided for this state\",\n\t\t\t\t1, this._button.currentScaleInternal);\n\n\t\t\tthis._button.isEnabled = true;\n\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tAssert.assertStrictlyEquals(\"Touch target must be button\", this._button, target);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.HOVER;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Button state is not ButtonState.HOVER on TouchPhase.HOVER\",\n\t\t\t\tButtonState.HOVER, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"Button scale is not 1 when currentState is ButtonState.HOVER and scale not provided for this state\",\n\t\t\t\t1, this._button.currentScaleInternal);\n\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Button state is not ButtonState.DOWN on TouchPhase.BEGAN\",\n\t\t\t\tButtonState.DOWN, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"Button scale is not 1 when currentState is ButtonState.DOWN and scale not provided for this state\",\n\t\t\t\t1, this._button.currentScaleInternal);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentScaleWithSetScaleForState():void\n\t\t{\n\t\t\tthis._button.defaultSkin = new Quad(200, 200);\n\n\t\t\tvar upScale:Number = 1.1;\n\t\t\tthis._button.setScaleForState(ButtonState.UP, upScale);\n\n\t\t\tvar hoverScale:Number = 1.2;\n\t\t\tthis._button.setScaleForState(ButtonState.HOVER, hoverScale);\n\n\t\t\tvar downScale:Number = 1.3;\n\t\t\tthis._button.setScaleForState(ButtonState.DOWN, downScale);\n\n\t\t\tvar disabledScale:Number = 1.4;\n\t\t\tthis._button.setScaleForState(ButtonState.DISABLED, disabledScale);\n\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Button state is not ButtonState.UP with no touch\",\n\t\t\t\tButtonState.UP, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"Button scale does not match scale set with setScaleForState() when currentState is ButtonState.UP\",\n\t\t\t\tupScale, this._button.currentScaleInternal);\n\n\t\t\tthis._button.isEnabled = false;\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Button state is not ButtonState.DISABLED when isEnabled is false\",\n\t\t\t\tButtonState.DISABLED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"Button scale does not match scale set with setScaleForState() when currentState is ButtonState.DISABLED\",\n\t\t\t\tdisabledScale, this._button.currentScaleInternal);\n\n\t\t\tthis._button.isEnabled = true;\n\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tAssert.assertStrictlyEquals(\"Touch target must be button\", this._button, target);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.HOVER;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Button state is not ButtonState.HOVER on TouchPhase.HOVER\",\n\t\t\t\tButtonState.HOVER, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"Button scale does not match scale set with setScaleForState() when currentState is ButtonState.HOVER and scale not provided for this state\",\n\t\t\t\thoverScale, this._button.currentScaleInternal);\n\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Button state is not ButtonState.DOWN on TouchPhase.BEGAN\",\n\t\t\t\tButtonState.DOWN, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"Button scale does not match scale set with setScaleForState() when currentState is ButtonState.DOWN and scale not provided for this state\",\n\t\t\t\tdownScale, this._button.currentScaleInternal);\n\t\t}\n\t}\n}\n\nimport feathers.controls.Button;\nimport feathers.core.ITextRenderer;\n\nimport starling.display.DisplayObject;\n\nclass ButtonWithInternalState extends Button\n{\n\tpublic function ButtonWithInternalState()\n\t{\n\t\tsuper();\n\t}\n\n\tpublic function get labelTextRendererInternal():ITextRenderer\n\t{\n\t\treturn this.labelTextRenderer;\n\t}\n\n\tpublic function get currentIconInternal():DisplayObject\n\t{\n\t\treturn this.currentIcon;\n\t}\n\n\tpublic function get currentScaleInternal():Number\n\t{\n\t\treturn this.getScaleForCurrentState();\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/ButtonMeasurementTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.text.BitmapFontTextRenderer;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class ButtonMeasurementTests\n\t{\n\t\tprivate static const SMALL_BACKGROUND_WIDTH:Number = 10;\n\t\tprivate static const SMALL_BACKGROUND_HEIGHT:Number = 12;\n\t\tprivate static const LARGE_BACKGROUND_WIDTH:Number = 200;\n\t\tprivate static const LARGE_BACKGROUND_HEIGHT:Number = 210;\n\t\tprivate static const COMPLEX_BACKGROUND_WIDTH:Number = 54;\n\t\tprivate static const COMPLEX_BACKGROUND_HEIGHT:Number = 55;\n\t\tprivate static const COMPLEX_BACKGROUND_MIN_WIDTH:Number = 38;\n\t\tprivate static const COMPLEX_BACKGROUND_MIN_HEIGHT:Number = 39;\n\t\t\n\t\tprivate static const SMALL_ICON_WIDTH:Number = 13;\n\t\tprivate static const SMALL_ICON_HEIGHT:Number = 11;\n\t\tprivate static const LARGE_ICON_WIDTH:Number = 105;\n\t\tprivate static const LARGE_ICON_HEIGHT:Number = 115;\n\t\tprivate static const COMPLEX_ICON_WIDTH:Number = 23;\n\t\tprivate static const COMPLEX_ICON_HEIGHT:Number = 25;\n\t\tprivate static const COMPLEX_ICON_MIN_WIDTH:Number = 18;\n\t\tprivate static const COMPLEX_ICON_MIN_HEIGHT:Number = 19;\n\t\t\n\t\tprivate static const PADDING_TOP:Number = 50;\n\t\tprivate static const PADDING_RIGHT:Number = 54;\n\t\tprivate static const PADDING_BOTTOM:Number = 59;\n\t\tprivate static const PADDING_LEFT:Number = 60;\n\t\tprivate static const GAP:Number = 6;\n\t\t\n\t\tprivate var _button:Button;\n\t\t\n\t\tprivate var _textRenderer:BitmapFontTextRenderer;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._button = new Button();\n\t\t\tthis._button.labelFactory = function():BitmapFontTextRenderer\n\t\t\t{\n\t\t\t\treturn new BitmapFontTextRenderer();\n\t\t\t}\n\t\t\tTestFeathers.starlingRoot.addChild(this._button);\n\n\t\t\tthis._textRenderer = new BitmapFontTextRenderer();\n\t\t\tTestFeathers.starlingRoot.addChild(this._textRenderer);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._button.removeFromParent(true);\n\t\t\tthis._button = null;\n\t\t\t\n\t\t\tthis._textRenderer.removeFromParent(true);\n\t\t\tthis._textRenderer = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\t\t\n\t\tprivate function addSmallSimpleIcon():void\n\t\t{\n\t\t\tthis._button.defaultIcon = new Quad(SMALL_ICON_WIDTH, SMALL_ICON_HEIGHT, 0xff00ff);\n\t\t}\n\n\t\tprivate function addLargeSimpleIcon():void\n\t\t{\n\t\t\tthis._button.defaultIcon = new Quad(LARGE_ICON_WIDTH, LARGE_ICON_HEIGHT, 0xff00ff);\n\t\t}\n\n\t\tprivate function addComplexIcon():void\n\t\t{\n\t\t\tvar icon:LayoutGroup = new LayoutGroup();\n\t\t\ticon.width = COMPLEX_ICON_WIDTH;\n\t\t\ticon.height = COMPLEX_ICON_HEIGHT;\n\t\t\ticon.minWidth = COMPLEX_ICON_MIN_WIDTH;\n\t\t\ticon.minHeight = COMPLEX_ICON_MIN_HEIGHT;\n\t\t\tthis._button.defaultIcon = icon;\n\t\t}\n\n\t\tprivate function addSmallSimpleBackground():void\n\t\t{\n\t\t\tthis._button.defaultSkin = new Quad(SMALL_BACKGROUND_WIDTH, SMALL_BACKGROUND_HEIGHT, 0xff00ff);\n\t\t}\n\n\t\tprivate function addLargeSimpleBackground():void\n\t\t{\n\t\t\tthis._button.defaultSkin = new Quad(LARGE_BACKGROUND_WIDTH, LARGE_BACKGROUND_HEIGHT, 0xff00ff);\n\t\t}\n\n\t\tprivate function addComplexBackground():void\n\t\t{\n\t\t\tvar backgroundSkin:LayoutGroup = new LayoutGroup();\n\t\t\tbackgroundSkin.width = COMPLEX_BACKGROUND_WIDTH;\n\t\t\tbackgroundSkin.height = COMPLEX_BACKGROUND_HEIGHT;\n\t\t\tbackgroundSkin.minWidth = COMPLEX_BACKGROUND_MIN_WIDTH;\n\t\t\tbackgroundSkin.minHeight = COMPLEX_BACKGROUND_MIN_HEIGHT;\n\t\t\tthis._button.defaultSkin = backgroundSkin;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithPadding():void\n\t\t{\n\t\t\tthis._button.paddingTop = PADDING_TOP;\n\t\t\tthis._button.paddingRight = PADDING_RIGHT;\n\t\t\tthis._button.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._button.paddingLeft = PADDING_LEFT;\n\t\t\tthis._button.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Button was not calculated correctly based on the left and right padding.\",\n\t\t\t\tPADDING_LEFT + PADDING_RIGHT, this._button.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Button was not calculated correctly based on the top and bottom padding.\",\n\t\t\t\tPADDING_TOP + PADDING_BOTTOM, this._button.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Button was not calculated correctly based on the left and right padding.\",\n\t\t\t\tPADDING_LEFT + PADDING_RIGHT, this._button.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Button was not calculated correctly based on the top and bottom padding.\",\n\t\t\t\tPADDING_TOP + PADDING_BOTTOM, this._button.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithLabel():void\n\t\t{\n\t\t\tvar labelText:String = \"I am the very model of a modern major general\";\n\t\t\tthis._textRenderer.text = labelText;\n\t\t\tthis._textRenderer.validate();\n\n\t\t\tthis._button.label = labelText;\n\t\t\tthis._button.validate();\n\n\t\t\tAssert.assertTrue(\"The width of the Button was not greater than 0 when using a label.\",\n\t\t\t\tthis._button.width > 0);\n\t\t\tAssert.assertTrue(\"The height of the Button was not greater than 0 when using a label.\",\n\t\t\t\tthis._button.height > 0);\n\t\t\tAssert.assertTrue(\"The minWidth of the Button was not greater than 0 when using a label.\",\n\t\t\t\tthis._button.minWidth > 0);\n\t\t\tAssert.assertTrue(\"The minHeight of the Button was not greater than 0 when using a label.\",\n\t\t\t\tthis._button.minHeight > 0);\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Button was not calculated correctly based on the label.\",\n\t\t\t\tthis._textRenderer.width, this._button.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Button was not calculated correctly based on the label.\",\n\t\t\t\tthis._textRenderer.height, this._button.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Button was not calculated correctly based on the label.\",\n\t\t\t\tthis._textRenderer.width, this._button.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Button was not calculated correctly based on the label.\",\n\t\t\t\tthis._textRenderer.height, this._button.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithLabelAndPadding():void\n\t\t{\n\t\t\tvar labelText:String = \"I am the very model of a modern major general\";\n\t\t\tthis._textRenderer.text = labelText;\n\t\t\tthis._textRenderer.validate();\n\n\t\t\tthis._button.label = labelText;\n\t\t\tthis._button.paddingTop = PADDING_TOP;\n\t\t\tthis._button.paddingRight = PADDING_RIGHT;\n\t\t\tthis._button.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._button.paddingLeft = PADDING_LEFT;\n\t\t\tthis._button.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Button was not calculated correctly based on the label and left and right padding.\",\n\t\t\t\tthis._textRenderer.width + PADDING_LEFT + PADDING_RIGHT, this._button.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Button was not calculated correctly based on the label and top and bottom padding.\",\n\t\t\t\tthis._textRenderer.height + PADDING_TOP + PADDING_BOTTOM, this._button.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Button was not calculated correctly based on the label and left and right padding.\",\n\t\t\t\tthis._textRenderer.width + PADDING_LEFT + PADDING_RIGHT, this._button.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Button was not calculated correctly based on the label and top and bottom padding.\",\n\t\t\t\tthis._textRenderer.height + PADDING_TOP + PADDING_BOTTOM, this._button.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithLabelAndSimpleIcon():void\n\t\t{\n\t\t\tvar labelText:String = \"I am the very model of a modern major general\";\n\t\t\tthis._textRenderer.text = labelText;\n\t\t\tthis._textRenderer.validate();\n\n\t\t\tthis.addLargeSimpleIcon();\n\t\t\tthis._button.label = labelText;\n\t\t\tthis._button.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Button was not calculated correctly based on the label and icon.\",\n\t\t\t\tthis._textRenderer.width + LARGE_ICON_WIDTH, this._button.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Button was not calculated correctly based on the label and icon.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this._button.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Button was not calculated correctly based on the label and icon.\",\n\t\t\t\tthis._textRenderer.width + LARGE_ICON_WIDTH, this._button.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Button was not calculated correctly based on the label and icon.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this._button.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithLabelGapAndSimpleIcon():void\n\t\t{\n\t\t\tvar labelText:String = \"I am the very model of a modern major general\";\n\t\t\tthis._textRenderer.text = labelText;\n\t\t\tthis._textRenderer.validate();\n\n\t\t\tthis.addLargeSimpleIcon();\n\t\t\tthis._button.label = labelText;\n\t\t\tthis._button.gap = GAP;\n\t\t\tthis._button.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Button was not calculated correctly based on the label, gap, and icon.\",\n\t\t\t\tthis._textRenderer.width + GAP + LARGE_ICON_WIDTH, this._button.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Button was not calculated correctly based on the label, gap, and icon.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this._button.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Button was not calculated correctly based on the label, gap, and icon.\",\n\t\t\t\tthis._textRenderer.width + GAP + LARGE_ICON_WIDTH, this._button.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Button was not calculated correctly based on the label, and icon.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this._button.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithLabelGapPaddingAndSimpleIcon():void\n\t\t{\n\t\t\tvar labelText:String = \"I am the very model of a modern major general\";\n\t\t\tthis._textRenderer.text = labelText;\n\t\t\tthis._textRenderer.validate();\n\n\t\t\tthis.addLargeSimpleIcon();\n\t\t\tthis._button.label = labelText;\n\t\t\tthis._button.paddingTop = PADDING_TOP;\n\t\t\tthis._button.paddingRight = PADDING_RIGHT;\n\t\t\tthis._button.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._button.paddingLeft = PADDING_LEFT;\n\t\t\tthis._button.gap = GAP;\n\t\t\tthis._button.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Button was not calculated correctly based on the label, gap, left and right padding, and icon.\",\n\t\t\t\tthis._textRenderer.width + GAP + LARGE_ICON_WIDTH + PADDING_LEFT + PADDING_RIGHT, this._button.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Button was not calculated correctly based on the label, gap, top and bottom padding, and icon.\",\n\t\t\t\tLARGE_ICON_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._button.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Button was not calculated correctly based on the label, gap, left and right padding, and icon.\",\n\t\t\t\tthis._textRenderer.width + GAP + LARGE_ICON_WIDTH + PADDING_LEFT + PADDING_RIGHT, this._button.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Button was not calculated correctly based on the label, gap, top and bottom padding, and icon.\",\n\t\t\t\tLARGE_ICON_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._button.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithSimpleIcon():void\n\t\t{\n\t\t\tthis.addLargeSimpleIcon();\n\t\t\tthis._button.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Button was not calculated correctly based on the icon width.\",\n\t\t\t\tLARGE_ICON_WIDTH, this._button.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Button was not calculated correctly based on the icon height.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this._button.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Button was not calculated correctly based on the icon width.\",\n\t\t\t\tLARGE_ICON_WIDTH, this._button.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Button was not calculated correctly based on the icon height.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this._button.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithComplexIcon():void\n\t\t{\n\t\t\tthis.addComplexIcon();\n\t\t\tthis._button.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Button was not calculated correctly based on the complex icon width.\",\n\t\t\t\tCOMPLEX_ICON_WIDTH, this._button.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Button was not calculated correctly based on the complex icon height.\",\n\t\t\t\tCOMPLEX_ICON_HEIGHT, this._button.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Button was not calculated correctly based on the complex icon minWidth.\",\n\t\t\t\tCOMPLEX_ICON_MIN_WIDTH, this._button.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Button was not calculated correctly based on the complex icon minHeight.\",\n\t\t\t\tCOMPLEX_ICON_MIN_HEIGHT, this._button.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithSimpleBackgroundSkin():void\n\t\t{\n\t\t\tthis.addSmallSimpleBackground();\n\t\t\tthis._button.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Button was not calculated correctly based on the background width.\",\n\t\t\t\tSMALL_BACKGROUND_WIDTH, this._button.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Button was not calculated correctly based on the background height.\",\n\t\t\t\tSMALL_BACKGROUND_HEIGHT, this._button.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Button was not calculated correctly based on the background width.\",\n\t\t\t\tSMALL_BACKGROUND_WIDTH, this._button.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Button was not calculated correctly based on the background height.\",\n\t\t\t\tSMALL_BACKGROUND_HEIGHT, this._button.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithSmallSimpleBackgroundSkinAndLargeSimpleIcon():void\n\t\t{\n\t\t\tthis.addSmallSimpleBackground();\n\t\t\tthis.addLargeSimpleIcon();\n\t\t\tthis._button.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Button was not calculated correctly based on the icon width.\",\n\t\t\t\tLARGE_ICON_WIDTH, this._button.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Button was not calculated correctly based on the icon height.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this._button.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Button was not calculated correctly based on the icon width.\",\n\t\t\t\tLARGE_ICON_WIDTH, this._button.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Button was not calculated correctly based on the icon height.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this._button.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithLargeSimpleBackgroundSkinAndSmallSimpleIcon():void\n\t\t{\n\t\t\tthis.addLargeSimpleBackground();\n\t\t\tthis.addSmallSimpleIcon();\n\t\t\tthis._button.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Button was not calculated correctly based on the background width.\",\n\t\t\t\tLARGE_BACKGROUND_WIDTH, this._button.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Button was not calculated correctly based on the background height.\",\n\t\t\t\tLARGE_BACKGROUND_HEIGHT, this._button.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Button was not calculated correctly based on the background width.\",\n\t\t\t\tLARGE_BACKGROUND_WIDTH, this._button.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Button was not calculated correctly based on the background height.\",\n\t\t\t\tLARGE_BACKGROUND_HEIGHT, this._button.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithComplexBackground():void\n\t\t{\n\t\t\tthis.addComplexBackground();\n\t\t\tthis._button.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Button was not calculated correctly based on the complex background width.\",\n\t\t\t\tCOMPLEX_BACKGROUND_WIDTH, this._button.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Button was not calculated correctly based on the complex background height.\",\n\t\t\t\tCOMPLEX_BACKGROUND_HEIGHT, this._button.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Button was not calculated correctly based on the complex background minWidth.\",\n\t\t\t\tCOMPLEX_BACKGROUND_MIN_WIDTH, this._button.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Button was not calculated correctly based on the complex background minHeight.\",\n\t\t\t\tCOMPLEX_BACKGROUND_MIN_HEIGHT, this._button.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithLargeSimpleBackgroundPaddingAndGap():void\n\t\t{\n\t\t\tthis._button.paddingTop = PADDING_TOP;\n\t\t\tthis._button.paddingRight = PADDING_RIGHT;\n\t\t\tthis._button.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._button.paddingLeft = PADDING_LEFT;\n\t\t\tthis._button.gap = GAP;\n\t\t\tthis.addLargeSimpleBackground();\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Button was not calculated correctly with background skin, padding, and gap.\",\n\t\t\t\tLARGE_BACKGROUND_WIDTH, this._button.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Button was not calculated correctly with background skin, padding, and gap.\",\n\t\t\t\tLARGE_BACKGROUND_HEIGHT, this._button.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Button was not calculated correctly with background skin, padding, and gap.\",\n\t\t\t\tLARGE_BACKGROUND_WIDTH, this._button.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Button was not calculated correctly with background skin, padding, and gap.\",\n\t\t\t\tLARGE_BACKGROUND_HEIGHT, this._button.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChangeTextToResizeSkin():void\n\t\t{\n\t\t\tthis._button.label = \"I am the very model of a modern major general\";\n\t\t\tthis.addSmallSimpleBackground();\n\t\t\tthis._button.disabledSkin = new Quad(SMALL_BACKGROUND_WIDTH, SMALL_BACKGROUND_HEIGHT, 0xff00ff);\n\t\t\tthis._button.validate();\n\t\t\t//the text's dimensions were large enough to make button bigger than\n\t\t\t//the skin's dimensions\n\t\t\tthis._button.label = \"\";\n\t\t\t//switch to a different skin before validation\n\t\t\tthis._button.isEnabled = false;\n\t\t\tthis._button.validate();\n\t\t\t//now switch back to the original skin, and the dimensions could\n\t\t\t//be wrong if they weren't restored\n\t\t\tthis._button.isEnabled = true;\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Button was not calculated correctly after changing to a different skin and changing label dimensions.\",\n\t\t\t\tSMALL_BACKGROUND_WIDTH, this._button.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Button was not calculated correctly after changing to a different skin and changing label dimensions\",\n\t\t\t\tSMALL_BACKGROUND_HEIGHT, this._button.height);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ButtonTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.ButtonState;\n\timport feathers.events.FeathersEventType;\n\timport feathers.tests.supportClasses.DisposeFlagQuad;\n\n\timport flash.geom.Point;\n\n\timport org.flexunit.Assert;\n\timport org.flexunit.async.Async;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\tpublic class ButtonTests\n\t{\n\t\tprivate var _button:Button;\n\t\tprivate var _blocker:Quad;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._button = new Button();\n\t\t\tthis._button.label = \"Click Me\";\n\t\t\tthis._button.defaultSkin = new Quad(200, 200);\n\t\t\tTestFeathers.starlingRoot.addChild(this._button);\n\t\t\tthis._button.validate();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._button.removeFromParent(true);\n\t\t\tthis._button = null;\n\t\t\t\n\t\t\tif(this._blocker)\n\t\t\t{\n\t\t\t\tthis._blocker.removeFromParent(true);\n\t\t\t\tthis._blocker = null;\n\t\t\t}\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTriggeredEvent():void\n\t\t{\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tthis._button.addEventListener(Event.TRIGGERED, function(event:Event):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t//this touch does not move at all, so it should result in triggering\n\t\t\t//the button.\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertTrue(\"Event.TRIGGERED was not dispatched\", hasTriggered);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTouchMoveOutsideBeforeTriggeredEvent():void\n\t\t{\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tthis._button.addEventListener(Event.TRIGGERED, function(event:Event):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.globalX = 1000; //move the touch way outside the bounds of the button\n\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertFalse(\"Event.TRIGGERED was incorrectly dispatched\", hasTriggered);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testOtherDisplayObjectBlockingTriggeredEvent():void\n\t\t{\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tthis._button.addEventListener(Event.TRIGGERED, function(event:Event):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tthis._blocker = new Quad(200, 200, 0xff0000);\n\t\t\tTestFeathers.starlingRoot.addChild(this._blocker);\n\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertFalse(\"Event.TRIGGERED was incorrectly dispatched\", hasTriggered);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testLongPressEvent():void\n\t\t{\n\t\t\tvar hasLongPressed:Boolean = false;\n\t\t\tthis._button.isLongPressEnabled = true;\n\t\t\tthis._button.validate();\n\t\t\tthis._button.addEventListener(FeathersEventType.LONG_PRESS, function():void\n\t\t\t{\n\t\t\t\thasLongPressed = true;\n\t\t\t});\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = this._button;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = 10;\n\t\t\ttouch.globalY = 10;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\tthis._button.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertTrue(\"FeathersEventType.LONG_PRESS was not dispatched\", hasLongPressed);\n\t\t\t}, 600);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testTouchMoveOutsideBeforeLongPressEvent():void\n\t\t{\n\t\t\tvar hasLongPressed:Boolean = false;\n\t\t\tthis._button.addEventListener(FeathersEventType.LONG_PRESS, function():void\n\t\t\t{\n\t\t\t\thasLongPressed = true;\n\t\t\t});\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = this._button;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = 10;\n\t\t\ttouch.globalY = 10;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\tthis._button.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.globalX = 1000; //move the touch way outside the bounds of the button\n\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\tthis._button.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertFalse(\"FeathersEventType.LONG_PRESS was incorrectly dispatched after touch moved out of bounds\", hasLongPressed);\n\t\t\t}, 600);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testOtherDisplayObjectBlockingLongPressEvent():void\n\t\t{\n\t\t\tvar hasLongPressed:Boolean = false;\n\t\t\tthis._button.isLongPressEnabled = true;\n\t\t\tthis._button.validate();\n\t\t\tthis._button.addEventListener(FeathersEventType.LONG_PRESS, function():void\n\t\t\t{\n\t\t\t\thasLongPressed = true;\n\t\t\t});\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = this._button;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = 10;\n\t\t\ttouch.globalY = 10;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\tthis._button.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t\n\t\t\tthis._blocker = new Quad(200, 200, 0xff0000);\n\t\t\tTestFeathers.starlingRoot.addChild(this._blocker);\n\t\t\t\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertFalse(\"FeathersEventType.LONG_PRESS was incorrectly dispatched\", hasLongPressed);\n\t\t\t}, 600);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSkinsDisposed():void\n\t\t{\n\t\t\tvar defaultSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.defaultSkin = defaultSkin;\n\t\t\tvar upSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.upSkin = upSkin;\n\t\t\tvar downSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.downSkin = downSkin;\n\t\t\tvar hoverSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.hoverSkin = hoverSkin;\n\t\t\tvar disabledSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.disabledSkin = disabledSkin;\n\t\t\tthis._button.validate();\n\t\t\tthis._button.dispose();\n\t\t\tAssert.assertTrue(\"defaultSkin not disposed when Button disposed.\", defaultSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"upSkin not disposed when Button disposed.\", upSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"downSkin not disposed when Button disposed.\", downSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"hoverSkin not disposed when Button disposed.\", hoverSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"disabledSkin not disposed when Button disposed.\", disabledSkin.isDisposed);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testIconsDisposed():void\n\t\t{\n\t\t\tvar defaultIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.defaultIcon = defaultIcon;\n\t\t\tvar upIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.upIcon = upIcon;\n\t\t\tvar downIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.downSkin = downIcon;\n\t\t\tvar hoverIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.hoverIcon = hoverIcon;\n\t\t\tvar disabledIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.disabledIcon = disabledIcon;\n\t\t\tthis._button.validate();\n\t\t\tthis._button.dispose();\n\t\t\tAssert.assertTrue(\"defaultIcon not disposed when Button disposed.\", defaultIcon.isDisposed);\n\t\t\tAssert.assertTrue(\"upIcon not disposed when Button disposed.\", upIcon.isDisposed);\n\t\t\tAssert.assertTrue(\"downIcon not disposed when Button disposed.\", downIcon.isDisposed);\n\t\t\tAssert.assertTrue(\"hoverIcon not disposed when Button disposed.\", hoverIcon.isDisposed);\n\t\t\tAssert.assertTrue(\"disabledIcon not disposed when Button disposed.\", disabledIcon.isDisposed);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testIconsRemovedWhenSetToNull():void\n\t\t{\n\t\t\tvar defaultIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.defaultIcon = defaultIcon;\n\t\t\tvar upIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.setIconForState(ButtonState.UP, upIcon);\n\t\t\tvar downIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.setIconForState(ButtonState.DOWN, downIcon);\n\t\t\tvar hoverIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.setIconForState(ButtonState.HOVER, hoverIcon);\n\t\t\tvar disabledIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.setIconForState(ButtonState.DISABLED, disabledIcon);\n\t\t\tthis._button.validate();\n\t\t\tthis._button.defaultIcon = null;\n\t\t\tthis._button.setIconForState(ButtonState.UP, null);\n\t\t\tthis._button.setIconForState(ButtonState.DOWN, null);\n\t\t\tthis._button.setIconForState(ButtonState.HOVER, null);\n\t\t\tthis._button.setIconForState(ButtonState.DISABLED, null);\n\t\t\t//should not need to validate here\n\t\t\tthis._button.dispose();\n\t\t\tAssert.assertFalse(\"Removed defaultIcon incorrectly disposed when Button disposed.\", defaultIcon.isDisposed);\n\t\t\tAssert.assertFalse(\"Removed upIcon incorrectly disposed when Button disposed.\", upIcon.isDisposed);\n\t\t\tAssert.assertFalse(\"Removed downIcon incorrectly disposed when Button disposed.\", downIcon.isDisposed);\n\t\t\tAssert.assertFalse(\"Removed hoverIcon incorrectly disposed when Button disposed.\", hoverIcon.isDisposed);\n\t\t\tAssert.assertFalse(\"Removed disabledIcon incorrectly disposed when Button disposed.\", disabledIcon.isDisposed);\n\t\t\tAssert.assertNull(\"defaultIcon parent must be null when removed from Button.\", defaultIcon.parent);\n\t\t\tAssert.assertNull(\"upIcon parent must be null when removed from Button.\", upIcon.parent);\n\t\t\tAssert.assertNull(\"downIcon parent must be null when removed from Button.\", downIcon.parent);\n\t\t\tAssert.assertNull(\"hoverIcon parent must be null when removed from Button.\", hoverIcon.parent);\n\t\t\tAssert.assertNull(\"disabledIcon parent must be null when removed from Button.\", disabledIcon.parent);\n\t\t\tdefaultIcon.dispose();\n\t\t\tupIcon.dispose();\n\t\t\tdownIcon.dispose();\n\t\t\thoverIcon.dispose();\n\t\t\tdisabledIcon.dispose();\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/CalloutMeasurementTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Callout;\n\timport feathers.controls.Label;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.layout.RelativePosition;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\n\tpublic class CalloutMeasurementTests\n\t{\n\t\t//note: the background width is purposefully smaller than the item width\n\t\tprivate static const BACKGROUND_WIDTH:Number = 200;\n\t\t//note: the background height is purposefully larger than the item height\n\t\tprivate static const BACKGROUND_HEIGHT:Number = 250;\n\t\tprivate static const BACKGROUND_MIN_WIDTH:Number = 180;\n\t\tprivate static const BACKGROUND_MIN_HEIGHT:Number = 140;\n\n\t\t//note: the content width is purposefully larger than the background width\n\t\tprivate static const CONTENT_WIDTH:Number = 210;\n\t\t//note: the content height is purposefully smaller than the background height\n\t\tprivate static const CONTENT_HEIGHT:Number = 160;\n\t\tprivate static const SMALL_CONTENT_WIDTH:Number = 50;\n\t\tprivate static const SMALL_CONTENT_HEIGHT:Number = 60;\n\t\tprivate static const CONTENT_MIN_WIDTH:Number = 160;\n\t\tprivate static const CONTENT_MIN_HEIGHT:Number = 150;\n\t\t\n\t\tprivate static const TOP_ARROW_WIDTH:Number = 20;\n\t\tprivate static const TOP_ARROW_HEIGHT:Number = 8;\n\t\tprivate static const RIGHT_ARROW_WIDTH:Number = 14;\n\t\tprivate static const RIGHT_ARROW_HEIGHT:Number = 22;\n\t\tprivate static const BOTTOM_ARROW_WIDTH:Number = 19;\n\t\tprivate static const BOTTOM_ARROW_HEIGHT:Number = 12;\n\t\tprivate static const LEFT_ARROW_WIDTH:Number = 23;\n\t\tprivate static const LEFT_ARROW_HEIGHT:Number = 16;\n\n\t\tprivate static const ORIGIN_WIDTH:Number = 44;\n\t\tprivate static const ORIGIN_HEIGHT:Number = 42;\n\t\t\n\t\tprivate var _callout:Callout;\n\t\tprivate var _origin:DisplayObject;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._callout = new Callout();\n\t\t\tthis._callout.disposeContent = true;\n\t\t\tTestFeathers.starlingRoot.addChild(this._callout);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._callout.removeFromParent(true);\n\t\t\tthis._callout = null;\n\n\t\t\tif(this._origin)\n\t\t\t{\n\t\t\t\tthis._origin.removeFromParent(true);\n\t\t\t\tthis._origin = null;\n\t\t\t}\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\tprivate function addArrows():void\n\t\t{\n\t\t\tthis._callout.topArrowSkin = new Quad(TOP_ARROW_WIDTH, TOP_ARROW_HEIGHT);\n\t\t\tthis._callout.rightArrowSkin = new Quad(RIGHT_ARROW_WIDTH, RIGHT_ARROW_HEIGHT);\n\t\t\tthis._callout.bottomArrowSkin = new Quad(BOTTOM_ARROW_WIDTH, BOTTOM_ARROW_HEIGHT);\n\t\t\tthis._callout.leftArrowSkin = new Quad(LEFT_ARROW_WIDTH, LEFT_ARROW_HEIGHT);\n\t\t}\n\n\t\tprivate function addSimpleBackground():void\n\t\t{\n\t\t\tthis._callout.backgroundSkin = new Quad(BACKGROUND_WIDTH, BACKGROUND_HEIGHT);\n\t\t}\n\n\t\tprivate function addComplexBackground():void\n\t\t{\n\t\t\tvar backgroundSkin:LayoutGroup = new LayoutGroup();\n\t\t\tbackgroundSkin.setSize(BACKGROUND_WIDTH, BACKGROUND_HEIGHT);\n\t\t\tbackgroundSkin.minWidth = BACKGROUND_MIN_WIDTH;\n\t\t\tbackgroundSkin.minHeight = BACKGROUND_MIN_HEIGHT;\n\t\t\tthis._callout.backgroundSkin = backgroundSkin;\n\t\t}\n\t\t\n\t\tprivate function addSimpleContent():void\n\t\t{\n\t\t\tthis._callout.content = new Quad(CONTENT_WIDTH, CONTENT_HEIGHT);\n\t\t}\n\t\t\n\t\tprivate function addSmallAutoSizeContent():void\n\t\t{\n\t\t\tvar content:LayoutGroup = new LayoutGroup();\n\t\t\tcontent.backgroundSkin = new Quad(SMALL_CONTENT_WIDTH, SMALL_CONTENT_HEIGHT);\n\t\t\tthis._callout.content = content;\n\t\t}\n\n\t\tprivate function addComplexContent():void\n\t\t{\n\t\t\tvar content:LayoutGroup = new LayoutGroup();\n\t\t\tcontent.setSize(CONTENT_WIDTH, CONTENT_HEIGHT);\n\t\t\tcontent.minWidth = CONTENT_MIN_WIDTH;\n\t\t\tcontent.minHeight = CONTENT_MIN_HEIGHT;\n\t\t\tthis._callout.content = content;\n\t\t}\n\t\t\n\t\tprivate function addOrigin():void\n\t\t{\n\t\t\tthis._origin = new Quad(ORIGIN_WIDTH, ORIGIN_HEIGHT);\n\t\t\tTestFeathers.starlingRoot.addChild(this._origin);\n\t\t\tthis._callout.origin = this._origin;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeNoContentNoBackground():void\n\t\t{\n\t\t\tthis._callout.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Callout was not calculated correctly when empty.\",\n\t\t\t\t0, this._callout.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Callout was not calculated correctly when empty.\",\n\t\t\t\t0, this._callout.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Callout was not calculated correctly when empty.\",\n\t\t\t\t0, this._callout.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Callout was not calculated correctly when empty.\",\n\t\t\t\t0, this._callout.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithSimpleBackgroundAndNoContent():void\n\t\t{\n\t\t\tthis.addSimpleBackground();\n\t\t\tthis._callout.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Callout was not calculated correctly with background skin and no content.\",\n\t\t\t\tBACKGROUND_WIDTH, this._callout.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Callout was not calculated correctly with background skin and no content.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._callout.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Callout was not calculated correctly with background skin and no content.\",\n\t\t\t\tBACKGROUND_WIDTH, this._callout.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Callout was not calculated correctly with background skin and no content.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._callout.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithComplexBackgroundAndNoContent():void\n\t\t{\n\t\t\tthis.addComplexBackground();\n\t\t\tthis._callout.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Callout was not calculated correctly with complex background skin and no content.\",\n\t\t\t\tBACKGROUND_WIDTH, this._callout.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Callout was not calculated correctly with complex background skin and no content.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._callout.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Callout was not calculated correctly with complex background skin and no content.\",\n\t\t\t\tBACKGROUND_MIN_WIDTH, this._callout.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Callout was not calculated correctly with complex background skin and no content.\",\n\t\t\t\tBACKGROUND_MIN_HEIGHT, this._callout.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithSimpleContent():void\n\t\t{\n\t\t\tthis.addSimpleContent();\n\t\t\tthis._callout.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Callout was not calculated correctly.\",\n\t\t\t\tCONTENT_WIDTH, this._callout.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Callout was not calculated correctly.\",\n\t\t\t\tCONTENT_HEIGHT, this._callout.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Callout was not calculated correctly.\",\n\t\t\t\tCONTENT_WIDTH, this._callout.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Callout was not calculated correctly.\",\n\t\t\t\tCONTENT_HEIGHT, this._callout.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithComplexContent():void\n\t\t{\n\t\t\tthis.addComplexContent();\n\t\t\tthis._callout.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Callout was not calculated correctly.\",\n\t\t\t\tCONTENT_WIDTH, this._callout.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Callout was not calculated correctly.\",\n\t\t\t\tCONTENT_HEIGHT, this._callout.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Callout was not calculated correctly.\",\n\t\t\t\tCONTENT_MIN_WIDTH, this._callout.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Callout was not calculated correctly.\",\n\t\t\t\tCONTENT_MIN_HEIGHT, this._callout.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithSimpleContentAndBackground():void\n\t\t{\n\t\t\tthis.addSimpleBackground();\n\t\t\tthis.addSimpleContent();\n\t\t\tthis._callout.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Callout was not calculated correctly.\",\n\t\t\t\tCONTENT_WIDTH, this._callout.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Callout was not calculated correctly.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._callout.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Callout was not calculated correctly.\",\n\t\t\t\tCONTENT_WIDTH, this._callout.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Callout was not calculated correctly.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._callout.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithComplexContentAndBackground():void\n\t\t{\n\t\t\tthis.addComplexBackground();\n\t\t\tthis.addComplexContent();\n\t\t\tthis._callout.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Callout was not calculated correctly.\",\n\t\t\t\tCONTENT_WIDTH, this._callout.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Callout was not calculated correctly.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._callout.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Callout was not calculated correctly.\",\n\t\t\t\tBACKGROUND_MIN_WIDTH, this._callout.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Callout was not calculated correctly.\",\n\t\t\t\tCONTENT_MIN_HEIGHT, this._callout.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithTopArrow():void\n\t\t{\n\t\t\tthis.addSimpleBackground();\n\t\t\tthis.addArrows();\n\t\t\tthis._callout.arrowPosition = RelativePosition.TOP;\n\t\t\tthis._callout.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Callout was not calculated correctly.\",\n\t\t\t\tBACKGROUND_WIDTH, this._callout.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Callout was not calculated correctly.\",\n\t\t\t\tBACKGROUND_HEIGHT + TOP_ARROW_HEIGHT, this._callout.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Callout was not calculated correctly.\",\n\t\t\t\tBACKGROUND_WIDTH, this._callout.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Callout was not calculated correctly.\",\n\t\t\t\tBACKGROUND_HEIGHT + TOP_ARROW_HEIGHT, this._callout.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithRightArrow():void\n\t\t{\n\t\t\tthis.addSimpleBackground();\n\t\t\tthis.addArrows();\n\t\t\tthis._callout.arrowPosition = RelativePosition.RIGHT;\n\t\t\tthis._callout.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Callout was not calculated correctly.\",\n\t\t\t\tBACKGROUND_WIDTH + RIGHT_ARROW_WIDTH, this._callout.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Callout was not calculated correctly.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._callout.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Callout was not calculated correctly.\",\n\t\t\t\tBACKGROUND_WIDTH + RIGHT_ARROW_WIDTH, this._callout.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Callout was not calculated correctly.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._callout.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithBottomArrow():void\n\t\t{\n\t\t\tthis.addSimpleBackground();\n\t\t\tthis.addArrows();\n\t\t\tthis._callout.arrowPosition = RelativePosition.BOTTOM;\n\t\t\tthis._callout.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Callout was not calculated correctly.\",\n\t\t\t\tBACKGROUND_WIDTH, this._callout.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Callout was not calculated correctly.\",\n\t\t\t\tBACKGROUND_HEIGHT + BOTTOM_ARROW_HEIGHT, this._callout.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Callout was not calculated correctly.\",\n\t\t\t\tBACKGROUND_WIDTH, this._callout.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Callout was not calculated correctly.\",\n\t\t\t\tBACKGROUND_HEIGHT + BOTTOM_ARROW_HEIGHT, this._callout.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithLeftArrow():void\n\t\t{\n\t\t\tthis.addSimpleBackground();\n\t\t\tthis.addArrows();\n\t\t\tthis._callout.arrowPosition = RelativePosition.LEFT;\n\t\t\tthis._callout.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Callout was not calculated correctly.\",\n\t\t\t\tBACKGROUND_WIDTH + LEFT_ARROW_WIDTH, this._callout.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Callout was not calculated correctly.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._callout.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Callout was not calculated correctly.\",\n\t\t\t\tBACKGROUND_WIDTH + LEFT_ARROW_WIDTH, this._callout.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Callout was not calculated correctly.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._callout.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testWrappingLabel():void\n\t\t{\n\t\t\tvar label:Label = new Label();\n\t\t\tlabel.text = \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\";\n\t\t\tlabel.wordWrap = true;\n\n\t\t\tvar label2:Label = new Label();\n\t\t\tlabel2.text = \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\";\n\t\t\tlabel2.validate();\n\t\t\tlabel2.dispose();\n\n\t\t\tthis._callout.content = label;\n\t\t\tthis._callout.validate();\n\n\t\t\tAssert.assertTrue(\"Callout: when content is set to Label with wordWrap true, the numLines should be greater than 1\",\n\t\t\t\tlabel.numLines > 1);\n\t\t\tAssert.assertTrue(\"Callout: when content is set to Label with wordWrap true, the height should be greater than the height for 1 line\",\n\t\t\t\tlabel.height > label2.height);\n\t\t}\n\n\t\t[Test]\n\t\t/**\n\t\t * issue #1573\n\t\t */\n\t\tpublic function testMoveOriginAndBackgroundLargerThanContent():void\n\t\t{\n\t\t\tthis.addSimpleBackground();\n\t\t\tthis.addSmallAutoSizeContent();\n\t\t\tthis.addOrigin();\n\t\t\tthis._callout.supportedPositions = new <String>[RelativePosition.RIGHT];\n\t\t\tthis._callout.validate();\n\t\t\t//make sure that the position of the arrow does not change when\n\t\t\t//moving the origin, or this test won't be able to catch the bug\n\t\t\t//that it's trying to catch. the callout cannot invalidate!\n\t\t\tthis._origin.x += 50;\n\t\t\tthis._origin.stage.starling.nextFrame();\n\t\t\tAssert.assertFalse(\"Callout: must not be invalid.\",\n\t\t\t\tthis._callout.isInvalid());\n\t\t\tAssert.assertStrictlyEquals(\"Callout: content width must be changed if background width is larger\",\n\t\t\t\tBACKGROUND_WIDTH, this._callout.content.width);\n\t\t\tAssert.assertStrictlyEquals(\"Callout: content height must be changed if background height is larger\",\n\t\t\t\tBACKGROUND_HEIGHT, this._callout.content.height);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/CalloutPopUpContentManagerTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.popups.CalloutPopUpContentManager;\n\timport feathers.core.PopUpManager;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.display.Sprite;\n\timport starling.events.Event;\n\n\tpublic class CalloutPopUpContentManagerTests\n\t{\n\t\tprivate static const OVERLAY_NAME:String = \"CalloutPopUpContentManagerOverlay\";\n\t\t\n\t\tprivate var _popUp:DisplayObject;\n\t\tprivate var _customRoot:Sprite;\n\t\tprivate var _source:Quad;\n\t\tprivate var _popUpContentManager:CalloutPopUpContentManager;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._source = new Quad(200, 180, 0x00ff00);\n\t\t\tTestFeathers.starlingRoot.addChild(this._source);\n\n\t\t\tthis._customRoot = new Sprite();\n\t\t\tTestFeathers.starlingRoot.addChild(this._customRoot);\n\t\t\tPopUpManager.root = this._customRoot;\n\n\t\t\tthis._popUpContentManager = new CalloutPopUpContentManager();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._source.removeFromParent(true);\n\t\t\tthis._source = null;\n\t\t\t\n\t\t\tthis._customRoot.removeFromParent(true);\n\t\t\tthis._customRoot = null;\n\n\t\t\tif(this._popUp)\n\t\t\t{\n\t\t\t\tthis._popUp.removeFromParent(true);\n\t\t\t\tthis._popUp = null;\n\t\t\t}\n\t\t\t\n\t\t\tPopUpManager.root = TestFeathers.starlingRoot.stage;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\tprivate function createSimplePopUp():DisplayObject\n\t\t{\n\t\t\tvar simplePopUp:Quad = new Quad(100, 150, 0xff00ff);\n\t\t\treturn simplePopUp;\n\t\t}\n\n\t\tprivate function createOverlay():DisplayObject\n\t\t{\n\t\t\tvar overlay:Quad = new Quad(1, 1, 0x000000);\n\t\t\toverlay.alpha = 0.5;\n\t\t\toverlay.name = OVERLAY_NAME;\n\t\t\treturn overlay;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testOpen():void\n\t\t{\n\t\t\tthis._popUp = this.createSimplePopUp();\n\t\t\tvar openDispatched:Boolean = false;\n\t\t\tthis._popUpContentManager.addEventListener(Event.OPEN, function(event:Event):void\n\t\t\t{\n\t\t\t\topenDispatched = true;\n\t\t\t});\n\t\t\tthis._popUpContentManager.open(this._popUp, this._source);\n\t\t\tAssert.assertNotNull(\"CalloutPopUpContentManager content parent should not be null.\", this._popUp.parent);\n\t\t\tAssert.assertTrue(\"CalloutPopUpContentManager did not dispatch Event.OPEN.\", openDispatched);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testClose():void\n\t\t{\n\t\t\tthis._popUp = this.createSimplePopUp();\n\t\t\tvar closeDispatched:Boolean = false;\n\t\t\tthis._popUpContentManager.addEventListener(Event.CLOSE, function(event:Event):void\n\t\t\t{\n\t\t\t\tcloseDispatched = true;\n\t\t\t});\n\t\t\tthis._popUpContentManager.open(this._popUp, this._source);\n\t\t\tthis._popUpContentManager.close();\n\t\t\tAssert.assertNull(\"CalloutPopUpContentManager content parent should be null.\", this._popUp.parent);\n\t\t\tAssert.assertTrue(\"CalloutPopUpContentManager did not dispatch Event.CLOSE.\", closeDispatched);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testOverlayFactory():void\n\t\t{\n\t\t\tthis._popUp = this.createSimplePopUp();\n\t\t\tthis._popUpContentManager.isModal = true;\n\t\t\tthis._popUpContentManager.overlayFactory = this.createOverlay;\n\t\t\tthis._popUpContentManager.open(this._popUp, this._source);\n\t\t\tvar overlay:DisplayObject = this._customRoot.getChildByName(OVERLAY_NAME);\n\t\t\tAssert.assertNotNull(\"DropDownPopUpContentManager overlayFactory result not found.\", overlay);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "test/source/feathers/tests/CalloutTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Callout;\n\timport feathers.tests.supportClasses.DisposeFlagQuad;\n\n\timport flash.geom.Point;\n\n\timport org.flexunit.Assert;\n\timport org.flexunit.async.Async;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.display.Stage;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\tpublic class CalloutTests\n\t{\n\t\tprivate var _callout:Callout;\n\t\tprivate var _origin:Quad;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._origin = new Quad(100, 100, 0xff00ff);\n\t\t\tthis._origin.x = 100;\n\t\t\tthis._origin.y = 100;\n\t\t\tTestFeathers.starlingRoot.addChild(this._origin);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._callout.removeFromParent(true);\n\t\t\tif(this._callout.content)\n\t\t\t{\n\t\t\t\tthis._callout.content.dispose();\n\t\t\t}\n\t\t\tthis._callout = null;\n\t\t\t\n\t\t\tthis._origin.removeFromParent(true);\n\t\t\tthis._origin = null;\n\t\t\t\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling stage on cleanup.\", 1, TestFeathers.starlingRoot.stage.numChildren);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testCloseOnTouchBeganOutside():void\n\t\t{\n\t\t\tthis._callout = Callout.show(new Quad(100, 100, 0xffff00), this._origin);\n\t\t\tthis._callout.closeOnTouchBeganOutside = true;\n\t\t\tvar stage:Stage = this._callout.stage;\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tvar position:Point = new Point(stage.stageWidth - 1, stage.stageHeight - 1);\n\t\t\t\tvar target:DisplayObject = stage.hitTest(position);\n\t\t\t\tvar touch:Touch = new Touch(0);\n\t\t\t\ttouch.target = target;\n\t\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\t\ttouch.globalX = position.x;\n\t\t\t\ttouch.globalY = position.y;\n\t\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t\t\n\t\t\t\tAssert.assertNull(\"Callout not removed from parent on TouchPhase.BEGAN\", _callout.parent);\n\t\t\t}, 1);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testCloseOnTouchEndedOutside():void\n\t\t{\n\t\t\tthis._callout = Callout.show(new Quad(100, 100, 0xff00ff), this._origin);\n\t\t\t//this._callout.closeOnTouchBeganOutside = false;\n\t\t\tthis._callout.closeOnTouchEndedOutside = true;\n\t\t\tvar stage:Stage = this._callout.stage;\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tvar position:Point = new Point(stage.stageWidth - 1, stage.stageHeight - 1);\n\t\t\t\tvar target:DisplayObject = stage.hitTest(position);\n\t\t\t\tvar touch:Touch = new Touch(0);\n\t\t\t\ttouch.target = target;\n\t\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\t\ttouch.globalX = position.x;\n\t\t\t\ttouch.globalY = position.y;\n\t\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t\tAssert.assertNull(\"Callout not removed from parent on TouchPhase.ENDED\", _callout.parent);\n\t\t\t}, 1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDisposeContentSetToTrue():void\n\t\t{\n\t\t\tvar content:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._callout = Callout.show(content, this._origin);\n\t\t\tthis._callout.disposeContent = true;\n\t\t\tthis._callout.removeFromParent(true);\n\t\t\tAssert.assertTrue(\"Callout content not disposed when disposeContent is true\", content.isDisposed);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDisposeContentSetToFalse():void\n\t\t{\n\t\t\tvar content:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._callout = Callout.show(content, this._origin);\n\t\t\tthis._callout.disposeContent = false;\n\t\t\tthis._callout.removeFromParent(true);\n\t\t\tAssert.assertFalse(\"Callout content incorrectly disposed when disposeContent is false\", content.isDisposed);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testDisposeOnSelfCloseSetToTrue():void\n\t\t{\n\t\t\tvar content:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._callout = Callout.show(content, this._origin);\n\t\t\tthis._callout.disposeContent = true;\n\t\t\tthis._callout.disposeOnSelfClose = true;\n\t\t\tthis._callout.closeOnTouchBeganOutside = true;\n\t\t\tvar stage:Stage = this._callout.stage;\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tvar position:Point = new Point(stage.stageWidth - 1, stage.stageHeight - 1);\n\t\t\t\tvar target:DisplayObject = stage.hitTest(position);\n\t\t\t\tvar touch:Touch = new Touch(0);\n\t\t\t\ttouch.target = target;\n\t\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\t\ttouch.globalX = position.x;\n\t\t\t\ttouch.globalY = position.y;\n\t\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t\t\n\t\t\t\tAssert.assertTrue(\"Callout content not disposed when closed and disposeOnSelfClose is true\", content.isDisposed);\n\t\t\t}, 1);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testDisposeOnSelfCloseSetToFalse():void\n\t\t{\n\t\t\tvar content:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._callout = Callout.show(content, this._origin);\n\t\t\tthis._callout.disposeContent = true;\n\t\t\tthis._callout.disposeOnSelfClose = false;\n\t\t\tthis._callout.closeOnTouchBeganOutside = true;\n\t\t\tvar stage:Stage = this._callout.stage;\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tvar position:Point = new Point(stage.stageWidth - 1, stage.stageHeight - 1);\n\t\t\t\tvar target:DisplayObject = stage.hitTest(position);\n\t\t\t\tvar touch:Touch = new Touch(0);\n\t\t\t\ttouch.target = target;\n\t\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\t\ttouch.globalX = position.x;\n\t\t\t\ttouch.globalY = position.y;\n\t\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t\t\n\t\t\t\tAssert.assertFalse(\"Callout content not disposed when closed and disposeOnSelfClose is true\", content.isDisposed);\n\t\t\t}, 1);\n\t\t}\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/ComponentLifecycleTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.LayoutGroup;\n\timport feathers.events.FeathersEventType;\n\n\timport org.flexunit.Assert;\n\n\timport starling.events.Event;\n\n\tpublic class ComponentLifecycleTests\n\t{\n\t\tprivate var _control:LayoutGroup;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._control = new LayoutGroup();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._control.removeFromParent(true);\n\t\t\tthis._control = null;\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInitializeEventAfterAddedToStage():void\n\t\t{\n\t\t\tvar hasInitialized:Boolean = false;\n\t\t\tthis._control.addEventListener(FeathersEventType.INITIALIZE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasInitialized = true;\n\t\t\t});\n\t\t\tTestFeathers.starlingRoot.addChild(this._control);\n\t\t\tAssert.assertTrue(\"FeathersEventType.INITIALIZE was not dispatched after added to stage\", hasInitialized);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInitializeEventAfterValidateOffStage():void\n\t\t{\n\t\t\tvar hasInitialized:Boolean = false;\n\t\t\tthis._control.addEventListener(FeathersEventType.INITIALIZE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasInitialized = true;\n\t\t\t});\n\t\t\tthis._control.validate();\n\t\t\tAssert.assertTrue(\"FeathersEventType.INITIALIZE was not dispatched after validate()\", hasInitialized);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testIsInitializedProperty():void\n\t\t{\n\t\t\tAssert.assertFalse(\"isInitialized is not false before after added to stage\", this._control.isInitialized);\n\t\t\tTestFeathers.starlingRoot.addChild(this._control);\n\t\t\tAssert.assertTrue(\"isInitialized was not changed to true after added to stage\", this._control.isInitialized);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCreationCompleteEventAfterValidate():void\n\t\t{\n\t\t\tvar isCreated:Boolean = false;\n\t\t\tthis._control.addEventListener(FeathersEventType.CREATION_COMPLETE, function(event:Event):void\n\t\t\t{\n\t\t\t\tisCreated = true;\n\t\t\t});\n\t\t\tthis._control.validate();\n\t\t\tAssert.assertTrue(\"FeathersEventType.CREATION_COMPLETE was not dispatched after validate()\", isCreated);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testIsCreatedProperty():void\n\t\t{\n\t\t\tAssert.assertFalse(\"isCreated is not false before validate()\", this._control.isCreated);\n\t\t\tthis._control.validate();\n\t\t\tAssert.assertTrue(\"isCreated was not changed to true after validate()\", this._control.isCreated);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ConditionalStyleProviderTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.BasicButton;\n\timport feathers.core.IFeathersControl;\n\timport feathers.skins.ConditionalStyleProvider;\n\timport feathers.tests.supportClasses.CustomStyleProvider;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class ConditionalStyleProviderTests\n\t{\n\t\tprivate var _target:BasicButton;\n\t\tprivate var _styleProvider:ConditionalStyleProvider;\n\t\tprivate var _falseStyleProvider:CustomStyleProvider;\n\t\tprivate var _trueStyleProvider:CustomStyleProvider;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._target = new BasicButton();\n\t\t\tthis._target.defaultSkin = new Quad(200, 200, 0xff00ff);\n\n\t\t\tthis._falseStyleProvider = new CustomStyleProvider();\n\t\t\tthis._trueStyleProvider = new CustomStyleProvider();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._target.removeFromParent(true);\n\t\t\tthis._target = null;\n\n\t\t\tthis._styleProvider = null;\n\t\t\tthis._falseStyleProvider = null;\n\t\t\tthis._trueStyleProvider = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\tprivate function falseConditionalFunction(target:IFeathersControl):Boolean\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tprivate function trueConditionalFunction(target:IFeathersControl):Boolean\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoErrorWithNullConditionalFunction():void\n\t\t{\n\t\t\tthis._styleProvider = new ConditionalStyleProvider(null);\n\t\t\tthis._styleProvider.applyStyles(this._target);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoErrorWithNullStyleProviders():void\n\t\t{\n\t\t\tthis._styleProvider = new ConditionalStyleProvider(falseConditionalFunction);\n\t\t\tthis._styleProvider.applyStyles(this._target);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoErrorWithNullFalseStyleProvider():void\n\t\t{\n\t\t\tthis._styleProvider = new ConditionalStyleProvider(falseConditionalFunction,\n\t\t\t\tthis._trueStyleProvider, null);\n\t\t\tthis._styleProvider.applyStyles(this._target);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoErrorWithNullTrueStyleProvider():void\n\t\t{\n\t\t\tthis._styleProvider = new ConditionalStyleProvider(trueConditionalFunction,\n\t\t\t\tnull, this._falseStyleProvider);\n\t\t\tthis._styleProvider.applyStyles(this._target);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFalseStyleProvider():void\n\t\t{\n\t\t\tthis._styleProvider = new ConditionalStyleProvider(falseConditionalFunction,\n\t\t\t\tthis._trueStyleProvider, this._falseStyleProvider);\n\t\t\tthis._styleProvider.applyStyles(this._target);\n\t\t\tAssert.assertTrue(\"When ConditionalStyleProvider condition is false, falseStyleProvider.applyStyles() must be called.\",\n\t\t\t\tthis._falseStyleProvider.appliedStyles);\n\t\t\tAssert.assertFalse(\"When ConditionalStyleProvider condition is false, trueStyleProvider.applyStyles() must not be called.\",\n\t\t\t\tthis._trueStyleProvider.appliedStyles);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTrueStyleProvider():void\n\t\t{\n\t\t\tthis._styleProvider = new ConditionalStyleProvider(trueConditionalFunction,\n\t\t\t\tthis._trueStyleProvider, this._falseStyleProvider);\n\t\t\tthis._styleProvider.applyStyles(this._target);\n\t\t\tAssert.assertTrue(\"When ConditionalStyleProvider condition is true, trueStyleProvider.applyStyles() must be called.\",\n\t\t\t\tthis._trueStyleProvider.appliedStyles);\n\t\t\tAssert.assertFalse(\"When ConditionalStyleProvider condition is true, falseStyleProvider.applyStyles() must not be called.\",\n\t\t\t\tthis._falseStyleProvider.appliedStyles);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/DateTimeSpinnerTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.DateTimeMode;\n\timport feathers.controls.DateTimeSpinner;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.tests.supportClasses.DisposeFlagQuad;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class DateTimeSpinnerTests\n\t{\n\t\tprivate static const BACKGROUND_WIDTH:Number = 4000;\n\t\tprivate static const BACKGROUND_HEIGHT:Number = 4100;\n\n\t\tprivate static const PADDING_TOP:Number = 4000;\n\t\tprivate static const PADDING_RIGHT:Number = 1000;\n\t\tprivate static const PADDING_BOTTOM:Number = 3000;\n\t\tprivate static const PADDING_LEFT:Number = 900;\n\n\t\tprivate var _spinner:DateTimeSpinner;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._spinner = new DateTimeSpinner();\n\t\t\tthis._spinner.itemRendererFactory = function():DefaultListItemRenderer\n\t\t\t{\n\t\t\t\tvar itemRenderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\t\t\t\titemRenderer.defaultSkin = new Quad(200, 88, 0xffffff);\n\t\t\t\treturn itemRenderer;\n\t\t\t};\n\t\t\tTestFeathers.starlingRoot.addChild(this._spinner);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._spinner.removeFromParent(true);\n\t\t\tthis._spinner = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetValueProgramaticallyWithoutMinimumOrMaximumWithoutRuntimeError():void\n\t\t{\n\t\t\tthis._spinner.value = new Date();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetValueProgramaticallyNotEqual():void\n\t\t{\n\t\t\tvar value:Date = new Date();\n\t\t\tthis._spinner.value = value;\n\t\t\tAssert.assertFalse(\"Incorrectly uses same Date object when setting value property.\", value === this._spinner.value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetValueProgramaticallyWithMinimum():void\n\t\t{\n\t\t\tthis._spinner.minimum = new Date(2015, 6, 15);\n\t\t\tthis._spinner.value = new Date(2015, 6, 14);\n\t\t\tAssert.assertEquals(\"Setting value smaller than minimum not changed to minimum.\", this._spinner.minimum.valueOf(), this._spinner.value.valueOf());\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetValueProgramaticallyWithMaximum():void\n\t\t{\n\t\t\tthis._spinner.maximum = new Date(2015, 6, 15);\n\t\t\tthis._spinner.value = new Date(2015, 6, 16);\n\t\t\tAssert.assertEquals(\"Setting value larger than maximum not changed to maximum.\", this._spinner.maximum.valueOf(), this._spinner.value.valueOf());\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDateEditingModeAndSetMinimumToDateThenToNull():void\n\t\t{\n\t\t\t//this test catches a potential runtime error with the internal year\n\t\t\t//list not having a data descriptor\n\n\t\t\tthis._spinner.editingMode = DateTimeMode.DATE;\n\t\t\tvar value:Date = new Date(2016, 2, 24);\n\t\t\tthis._spinner.minimum = new Date(1960, 0, 1);\n\t\t\tthis._spinner.maximum = new Date(value.fullYear + 5, 0, 1);\n\t\t\tthis._spinner.value = value;\n\t\t\tthis._spinner.validate();\n\t\t\tthis._spinner.minimum = null;\n\t\t\tthis._spinner.validate();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTimeEditingModeAndChangeLocaleWithDifferentMeridiem():void\n\t\t{\n\t\t\t//this test catches some runtime errors with the internal meridiem\n\t\t\t//and hours lists not having data descriptors\n\n\t\t\tthis._spinner.editingMode = DateTimeMode.TIME;\n\t\t\tthis._spinner.locale = \"fr_FR\";\n\t\t\tthis._spinner.value = new Date(2016, 2, 24, 2);\n\t\t\tthis._spinner.validate();\n\t\t\tthis._spinner.locale = \"en_US\";\n\t\t\tthis._spinner.validate();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testBackgroundSkinMeasurement():void\n\t\t{\n\t\t\tvar backgroundSkin:Quad = new Quad(BACKGROUND_WIDTH, BACKGROUND_HEIGHT);\n\t\t\tthis._spinner.backgroundSkin = backgroundSkin;\n\t\t\tthis._spinner.validate();\n\t\t\tAssert.assertStrictlyEquals(\"DateTimeSpinner: backgroundSkin width not used for measurement.\",\n\t\t\t\tBACKGROUND_WIDTH, this._spinner.width);\n\t\t\tAssert.assertStrictlyEquals(\"DateTimeSpinner: backgroundSkin height not used for measurement.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._spinner.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPaddingMeasurement():void\n\t\t{\n\t\t\tthis._spinner.paddingTop = PADDING_TOP;\n\t\t\tthis._spinner.paddingRight = PADDING_RIGHT;\n\t\t\tthis._spinner.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._spinner.paddingLeft = PADDING_LEFT;\n\t\t\tthis._spinner.validate();\n\t\t\tAssert.assertTrue(\"DateTimeSpinner: padding left/right not used for width measurement.\",\n\t\t\t\t(PADDING_LEFT + PADDING_RIGHT) < this._spinner.width);\n\t\t\tAssert.assertTrue(\"DateTimeSpinner:  padding top/bottom not used for height measurement.\",\n\t\t\t\t(PADDING_TOP + PADDING_BOTTOM) < this._spinner.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSkinsDisposed():void\n\t\t{\n\t\t\tvar backgroundSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._spinner.backgroundSkin = backgroundSkin;\n\t\t\tvar backgroundDisabledSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._spinner.backgroundDisabledSkin = backgroundDisabledSkin;\n\t\t\tthis._spinner.validate();\n\t\t\tthis._spinner.dispose();\n\t\t\tAssert.assertTrue(\"backgroundSkin not disposed when LayoutGroup disposed.\", backgroundSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"backgroundDisabledSkin not disposed when LayoutGroup disposed.\", backgroundDisabledSkin.isDisposed);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/DefaultGroupedListHeaderOrFooterRendererMeasurementTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.GroupedList;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.renderers.DefaultGroupedListHeaderOrFooterRenderer;\n\timport feathers.controls.text.BitmapFontTextRenderer;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class DefaultGroupedListHeaderOrFooterRendererMeasurementTests\n\t{\n\t\tprivate static const SMALL_BACKGROUND_WIDTH:Number = 10;\n\t\tprivate static const SMALL_BACKGROUND_HEIGHT:Number = 12;\n\t\tprivate static const LARGE_BACKGROUND_WIDTH:Number = 100;\n\t\tprivate static const LARGE_BACKGROUND_HEIGHT:Number = 110;\n\t\tprivate static const COMPLEX_BACKGROUND_WIDTH:Number = 54;\n\t\tprivate static const COMPLEX_BACKGROUND_HEIGHT:Number = 55;\n\t\tprivate static const COMPLEX_BACKGROUND_MIN_WIDTH:Number = 38;\n\t\tprivate static const COMPLEX_BACKGROUND_MIN_HEIGHT:Number = 39;\n\n\t\tprivate static const SMALL_CONTENT_WIDTH:Number = 13;\n\t\tprivate static const SMALL_CONTENT_HEIGHT:Number = 11;\n\t\tprivate static const LARGE_CONTENT_WIDTH:Number = 105;\n\t\tprivate static const LARGE_CONTENT_HEIGHT:Number = 115;\n\t\tprivate static const COMPLEX_CONTENT_WIDTH:Number = 23;\n\t\tprivate static const COMPLEX_CONTENT_HEIGHT:Number = 25;\n\t\tprivate static const COMPLEX_CONTENT_MIN_WIDTH:Number = 18;\n\t\tprivate static const COMPLEX_CONTENT_MIN_HEIGHT:Number = 19;\n\n\t\tprivate static const PADDING_TOP:Number = 50;\n\t\tprivate static const PADDING_RIGHT:Number = 54;\n\t\tprivate static const PADDING_BOTTOM:Number = 59;\n\t\tprivate static const PADDING_LEFT:Number = 60;\n\n\t\tprivate var _headerOrFooterRenderer:DefaultGroupedListHeaderOrFooterRenderer;\n\t\tprivate var _textRenderer:BitmapFontTextRenderer;\n\t\tprivate var _list:GroupedList;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._list = new GroupedList();\n\n\t\t\tthis._headerOrFooterRenderer = new DefaultGroupedListHeaderOrFooterRenderer();\n\t\t\tthis._headerOrFooterRenderer.owner = this._list;\n\t\t\tthis._headerOrFooterRenderer.groupIndex = 0;\n\t\t\tthis._headerOrFooterRenderer.data = { label: null };\n\t\t\tthis._headerOrFooterRenderer.contentLabelFactory = function():BitmapFontTextRenderer\n\t\t\t{\n\t\t\t\treturn new BitmapFontTextRenderer();\n\t\t\t};\n\t\t\tTestFeathers.starlingRoot.addChild(this._headerOrFooterRenderer);\n\n\t\t\tthis._textRenderer = new BitmapFontTextRenderer();\n\t\t\tTestFeathers.starlingRoot.addChild(this._textRenderer);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._headerOrFooterRenderer.removeFromParent(true);\n\t\t\tthis._headerOrFooterRenderer = null;\n\n\t\t\tthis._list.dispose();\n\t\t\tthis._list = null;\n\n\t\t\tthis._textRenderer.removeFromParent(true);\n\t\t\tthis._textRenderer = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\t\t\n\t\tprivate function addSmallSimpleBackground():void\n\t\t{\n\t\t\tthis._headerOrFooterRenderer.backgroundSkin = new Quad(SMALL_BACKGROUND_WIDTH, SMALL_BACKGROUND_HEIGHT, 0xff00ff);\n\t\t}\n\n\t\tprivate function addLargeSimpleBackground():void\n\t\t{\n\t\t\tthis._headerOrFooterRenderer.backgroundSkin = new Quad(LARGE_BACKGROUND_WIDTH, LARGE_BACKGROUND_HEIGHT, 0xff00ff);\n\t\t}\n\n\t\tprivate function addComplexBackground():void\n\t\t{\n\t\t\tvar backgroundSkin:LayoutGroup = new LayoutGroup();\n\t\t\tbackgroundSkin.width = COMPLEX_BACKGROUND_WIDTH;\n\t\t\tbackgroundSkin.height = COMPLEX_BACKGROUND_HEIGHT;\n\t\t\tbackgroundSkin.minWidth = COMPLEX_BACKGROUND_MIN_WIDTH;\n\t\t\tbackgroundSkin.minHeight = COMPLEX_BACKGROUND_MIN_HEIGHT;\n\t\t\tthis._headerOrFooterRenderer.backgroundSkin = backgroundSkin;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithPadding():void\n\t\t{\n\t\t\tthis._headerOrFooterRenderer.paddingTop = PADDING_TOP;\n\t\t\tthis._headerOrFooterRenderer.paddingRight = PADDING_RIGHT;\n\t\t\tthis._headerOrFooterRenderer.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._headerOrFooterRenderer.paddingLeft = PADDING_LEFT;\n\t\t\tthis._headerOrFooterRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the left and right padding.\",\n\t\t\t\tPADDING_LEFT + PADDING_RIGHT, this._headerOrFooterRenderer.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the top and bottom padding.\",\n\t\t\t\tPADDING_TOP + PADDING_BOTTOM, this._headerOrFooterRenderer.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the left and right padding.\",\n\t\t\t\tPADDING_LEFT + PADDING_RIGHT, this._headerOrFooterRenderer.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the top and bottom padding.\",\n\t\t\t\tPADDING_TOP + PADDING_BOTTOM, this._headerOrFooterRenderer.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithLabel():void\n\t\t{\n\t\t\tvar labelText:String = \"I am the very model of a modern major general\";\n\t\t\tthis._textRenderer.text = labelText;\n\t\t\tthis._textRenderer.validate();\n\n\t\t\tthis._headerOrFooterRenderer.data = { label: labelText };\n\t\t\tthis._headerOrFooterRenderer.validate();\n\n\t\t\tAssert.assertTrue(\"The width of the DefaultGroupedListHeaderOrFooterRenderer was not greater than 0 when using a label.\",\n\t\t\t\tthis._headerOrFooterRenderer.width > 0);\n\t\t\tAssert.assertTrue(\"The height of the DefaultGroupedListHeaderOrFooterRenderer was not greater than 0 when using a label.\",\n\t\t\t\tthis._headerOrFooterRenderer.height > 0);\n\t\t\tAssert.assertTrue(\"The minWidth of the DefaultGroupedListHeaderOrFooterRenderer was not greater than 0 when using a label.\",\n\t\t\t\tthis._headerOrFooterRenderer.minWidth > 0);\n\t\t\tAssert.assertTrue(\"The minHeight of the DefaultGroupedListHeaderOrFooterRenderer was not greater than 0 when using a label.\",\n\t\t\t\tthis._headerOrFooterRenderer.minHeight > 0);\n\t\t\tAssert.assertStrictlyEquals(\"The width of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the label.\",\n\t\t\t\tthis._textRenderer.width, this._headerOrFooterRenderer.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the label.\",\n\t\t\t\tthis._textRenderer.height, this._headerOrFooterRenderer.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the label.\",\n\t\t\t\tthis._textRenderer.width, this._headerOrFooterRenderer.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the label.\",\n\t\t\t\tthis._textRenderer.height, this._headerOrFooterRenderer.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithLabelAndPadding():void\n\t\t{\n\t\t\tvar labelText:String = \"I am the very model of a modern major general\";\n\t\t\tthis._textRenderer.text = labelText;\n\t\t\tthis._textRenderer.validate();\n\n\t\t\tthis._headerOrFooterRenderer.data = { label: labelText };\n\t\t\tthis._headerOrFooterRenderer.paddingTop = PADDING_TOP;\n\t\t\tthis._headerOrFooterRenderer.paddingRight = PADDING_RIGHT;\n\t\t\tthis._headerOrFooterRenderer.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._headerOrFooterRenderer.paddingLeft = PADDING_LEFT;\n\t\t\tthis._headerOrFooterRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the label and left and right padding.\",\n\t\t\t\tthis._textRenderer.width + PADDING_LEFT + PADDING_RIGHT, this._headerOrFooterRenderer.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the label and top and bottom padding.\",\n\t\t\t\tthis._textRenderer.height + PADDING_TOP + PADDING_BOTTOM, this._headerOrFooterRenderer.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the label and left and right padding.\",\n\t\t\t\tthis._textRenderer.width + PADDING_LEFT + PADDING_RIGHT, this._headerOrFooterRenderer.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the label and top and bottom padding.\",\n\t\t\t\tthis._textRenderer.height + PADDING_TOP + PADDING_BOTTOM, this._headerOrFooterRenderer.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithSimpleContent():void\n\t\t{\n\t\t\tvar content:Quad = new Quad(SMALL_CONTENT_WIDTH, SMALL_CONTENT_HEIGHT, 0xff00ff);\n\t\t\tthis._headerOrFooterRenderer.data = { content: content };\n\t\t\tthis._headerOrFooterRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the content width.\",\n\t\t\t\tSMALL_CONTENT_WIDTH, this._headerOrFooterRenderer.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the content height.\",\n\t\t\t\tSMALL_CONTENT_HEIGHT, this._headerOrFooterRenderer.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the content width.\",\n\t\t\t\tSMALL_CONTENT_WIDTH, this._headerOrFooterRenderer.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the content height.\",\n\t\t\t\tSMALL_CONTENT_HEIGHT, this._headerOrFooterRenderer.minHeight);\n\n\t\t\tcontent.dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithSimpleContentAndPadding():void\n\t\t{\n\t\t\tvar content:Quad = new Quad(SMALL_CONTENT_WIDTH, SMALL_CONTENT_HEIGHT, 0xff00ff);\n\t\t\tthis._headerOrFooterRenderer.data = { content: content };\n\t\t\tthis._headerOrFooterRenderer.paddingTop = PADDING_TOP;\n\t\t\tthis._headerOrFooterRenderer.paddingRight = PADDING_RIGHT;\n\t\t\tthis._headerOrFooterRenderer.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._headerOrFooterRenderer.paddingLeft = PADDING_LEFT;\n\t\t\tthis._headerOrFooterRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the content width and left and right padding.\",\n\t\t\t\tSMALL_CONTENT_WIDTH + PADDING_LEFT + PADDING_RIGHT, this._headerOrFooterRenderer.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the content height and top and bottom padding.\",\n\t\t\t\tSMALL_CONTENT_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._headerOrFooterRenderer.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the content width and left and right padding.\",\n\t\t\t\tSMALL_CONTENT_WIDTH + PADDING_LEFT + PADDING_RIGHT, this._headerOrFooterRenderer.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the content height and top and bottom padding.\",\n\t\t\t\tSMALL_CONTENT_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._headerOrFooterRenderer.minHeight);\n\n\t\t\tcontent.dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithComplexContent():void\n\t\t{\n\t\t\tvar content:LayoutGroup = new LayoutGroup();\n\t\t\tcontent.setSize(COMPLEX_CONTENT_WIDTH, COMPLEX_CONTENT_HEIGHT);\n\t\t\tcontent.minWidth = COMPLEX_CONTENT_MIN_WIDTH;\n\t\t\tcontent.minHeight = COMPLEX_CONTENT_MIN_HEIGHT;\n\t\t\tthis._headerOrFooterRenderer.data = { content: content };\n\t\t\tthis._headerOrFooterRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the content width.\",\n\t\t\t\tCOMPLEX_CONTENT_WIDTH, this._headerOrFooterRenderer.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the content height.\",\n\t\t\t\tCOMPLEX_CONTENT_HEIGHT, this._headerOrFooterRenderer.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the content width.\",\n\t\t\t\tCOMPLEX_CONTENT_MIN_WIDTH, this._headerOrFooterRenderer.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the content height.\",\n\t\t\t\tCOMPLEX_CONTENT_MIN_HEIGHT, this._headerOrFooterRenderer.minHeight);\n\n\t\t\tcontent.dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithComplexContentAndPadding():void\n\t\t{\n\t\t\tvar content:LayoutGroup = new LayoutGroup();\n\t\t\tcontent.setSize(COMPLEX_CONTENT_WIDTH, COMPLEX_CONTENT_HEIGHT);\n\t\t\tcontent.minWidth = COMPLEX_CONTENT_MIN_WIDTH;\n\t\t\tcontent.minHeight = COMPLEX_CONTENT_MIN_HEIGHT;\n\t\t\tthis._headerOrFooterRenderer.data = { content: content };\n\t\t\tthis._headerOrFooterRenderer.paddingTop = PADDING_TOP;\n\t\t\tthis._headerOrFooterRenderer.paddingRight = PADDING_RIGHT;\n\t\t\tthis._headerOrFooterRenderer.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._headerOrFooterRenderer.paddingLeft = PADDING_LEFT;\n\t\t\tthis._headerOrFooterRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the content width and left and right padding.\",\n\t\t\t\tCOMPLEX_CONTENT_WIDTH + PADDING_LEFT + PADDING_RIGHT, this._headerOrFooterRenderer.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the content height and top and bottom padding.\",\n\t\t\t\tCOMPLEX_CONTENT_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._headerOrFooterRenderer.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the content width and left and right padding.\",\n\t\t\t\tCOMPLEX_CONTENT_MIN_WIDTH + PADDING_LEFT + PADDING_RIGHT, this._headerOrFooterRenderer.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the content height and top and bottom padding.\",\n\t\t\t\tCOMPLEX_CONTENT_MIN_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._headerOrFooterRenderer.minHeight);\n\n\t\t\tcontent.dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithSimpleBackgroundSkin():void\n\t\t{\n\t\t\tthis.addSmallSimpleBackground();\n\t\t\tthis._headerOrFooterRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the background width.\",\n\t\t\t\tSMALL_BACKGROUND_WIDTH, this._headerOrFooterRenderer.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the background height.\",\n\t\t\t\tSMALL_BACKGROUND_HEIGHT, this._headerOrFooterRenderer.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the background width.\",\n\t\t\t\tSMALL_BACKGROUND_WIDTH, this._headerOrFooterRenderer.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the background height.\",\n\t\t\t\tSMALL_BACKGROUND_HEIGHT, this._headerOrFooterRenderer.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithSmallSimpleBackgroundSkinAndLargeSimpleContent():void\n\t\t{\n\t\t\tthis.addSmallSimpleBackground();\n\t\t\tvar content:Quad = new Quad(LARGE_CONTENT_WIDTH, LARGE_CONTENT_HEIGHT, 0xff00ff);\n\t\t\tthis._headerOrFooterRenderer.data = { content: content };\n\t\t\tthis._headerOrFooterRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the content width.\",\n\t\t\t\tLARGE_CONTENT_WIDTH, this._headerOrFooterRenderer.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the content height.\",\n\t\t\t\tLARGE_CONTENT_HEIGHT, this._headerOrFooterRenderer.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the content width.\",\n\t\t\t\tLARGE_CONTENT_WIDTH, this._headerOrFooterRenderer.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the content height.\",\n\t\t\t\tLARGE_CONTENT_HEIGHT, this._headerOrFooterRenderer.minHeight);\n\n\t\t\tcontent.dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithLargeSimpleBackgroundSkinAndSmallSimpleContent():void\n\t\t{\n\t\t\tthis.addLargeSimpleBackground();\n\t\t\tvar content:Quad = new Quad(SMALL_CONTENT_WIDTH, SMALL_CONTENT_HEIGHT, 0xff00ff);\n\t\t\tthis._headerOrFooterRenderer.data = { content: content };\n\t\t\tthis._headerOrFooterRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the background width.\",\n\t\t\t\tLARGE_BACKGROUND_WIDTH, this._headerOrFooterRenderer.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the background height.\",\n\t\t\t\tLARGE_BACKGROUND_HEIGHT, this._headerOrFooterRenderer.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the background width.\",\n\t\t\t\tLARGE_BACKGROUND_WIDTH, this._headerOrFooterRenderer.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the background height.\",\n\t\t\t\tLARGE_BACKGROUND_HEIGHT, this._headerOrFooterRenderer.minHeight);\n\t\t\t\n\t\t\tcontent.dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithComplexBackground():void\n\t\t{\n\t\t\tthis.addComplexBackground();\n\t\t\tthis._headerOrFooterRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the complex background width.\",\n\t\t\t\tCOMPLEX_BACKGROUND_WIDTH, this._headerOrFooterRenderer.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the complex background height.\",\n\t\t\t\tCOMPLEX_BACKGROUND_HEIGHT, this._headerOrFooterRenderer.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the complex background minWidth.\",\n\t\t\t\tCOMPLEX_BACKGROUND_MIN_WIDTH, this._headerOrFooterRenderer.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the DefaultGroupedListHeaderOrFooterRenderer was not calculated correctly based on the complex background minHeight.\",\n\t\t\t\tCOMPLEX_BACKGROUND_MIN_HEIGHT, this._headerOrFooterRenderer.minHeight);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/DefaultListItemRendererInternalStateTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.ButtonState;\n\timport feathers.controls.ImageLoader;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.List;\n\n\timport flash.geom.Point;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport starling.textures.Texture;\n\n\tpublic class DefaultListItemRendererInternalStateTests\n\t{\n\t\tprivate var _itemRenderer:DefaultListItemRendererWithInternalState;\n\t\tprivate var _list:List;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._list = new List();\n\t\t\t\n\t\t\tthis._itemRenderer = new DefaultListItemRendererWithInternalState();\n\t\t\tthis._itemRenderer.owner = this._list;\n\t\t\tthis._itemRenderer.index = 0;\n\t\t\tthis._itemRenderer.data = {};\n\t\t\tthis._itemRenderer.useStateDelayTimer = false;\n\t\t\tTestFeathers.starlingRoot.addChild(this._itemRenderer);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._itemRenderer.removeFromParent(true);\n\t\t\tthis._itemRenderer = null;\n\t\t\t\n\t\t\tthis._list.dispose();\n\t\t\tthis._list = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetAccessoryForStateWithoutSetAccessoryForState():void\n\t\t{\n\t\t\tAssert.assertNull(\"DefaultListItemRenderer getAccessoryForState(ButtonState.UP) must be null when setAccessoryForState() is not called\", this._itemRenderer.getAccessoryForState(ButtonState.UP));\n\t\t\tAssert.assertNull(\"DefaultListItemRenderer getAccessoryForState(ButtonState.HOVER) must be null when setAccessoryForState() is not called\", this._itemRenderer.getAccessoryForState(ButtonState.HOVER));\n\t\t\tAssert.assertNull(\"DefaultListItemRenderer getAccessoryForState(ButtonState.DOWN) must be null when setAccessoryForState() is not called\", this._itemRenderer.getAccessoryForState(ButtonState.DOWN));\n\t\t\tAssert.assertNull(\"DefaultListItemRenderer getAccessoryForState(ButtonState.DISABLED) must be null when setAccessoryForState() is not called\", this._itemRenderer.getAccessoryForState(ButtonState.DISABLED));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetAccessoryForState():void\n\t\t{\n\t\t\tthis._itemRenderer.isQuickHitAreaEnabled = true;\n\t\t\tthis._itemRenderer.itemHasAccessory = false;\n\n\t\t\tvar defaultAccessory:Quad = new Quad(200, 200);\n\t\t\tthis._itemRenderer.defaultAccessory = defaultAccessory;\n\n\t\t\tvar upAccessory:Quad = new Quad(200, 200);\n\t\t\tthis._itemRenderer.setAccessoryForState(ButtonState.UP, upAccessory);\n\n\t\t\tvar hoverAccessory:Quad = new Quad(200, 200);\n\t\t\tthis._itemRenderer.setAccessoryForState(ButtonState.HOVER, hoverAccessory);\n\n\t\t\tvar downAccessory:Quad = new Quad(200, 200);\n\t\t\tthis._itemRenderer.setAccessoryForState(ButtonState.DOWN, downAccessory);\n\n\t\t\tvar disabledAccessory:Quad = new Quad(200, 200);\n\t\t\tthis._itemRenderer.setAccessoryForState(ButtonState.DISABLED, disabledAccessory);\n\n\t\t\tAssert.assertStrictlyEquals(\"Item Renderer getAccessoryForState(ButtonState.UP) does not match value passed to setAccessoryForState()\", upAccessory, this._itemRenderer.getAccessoryForState(ButtonState.UP));\n\t\t\tAssert.assertStrictlyEquals(\"Item Renderer getAccessoryForState(ButtonState.HOVER) does not match value passed to setAccessoryForState()\", hoverAccessory, this._itemRenderer.getAccessoryForState(ButtonState.HOVER));\n\t\t\tAssert.assertStrictlyEquals(\"Item Renderer getAccessoryForState(ButtonState.DOWN) does not match value passed to setAccessoryForState()\", downAccessory, this._itemRenderer.getAccessoryForState(ButtonState.DOWN));\n\t\t\tAssert.assertStrictlyEquals(\"Item Renderer getAccessoryForState(ButtonState.DISABLED) does not match value passed to setAccessoryForState()\", disabledAccessory, this._itemRenderer.getAccessoryForState(ButtonState.DISABLED));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDefaultCurrentAccessory():void\n\t\t{\n\t\t\tthis._itemRenderer.isQuickHitAreaEnabled = true;\n\t\t\tthis._itemRenderer.itemHasAccessory = false;\n\n\t\t\tvar defaultAccessory:Quad = new Quad(200, 200);\n\t\t\tthis._itemRenderer.defaultAccessory = defaultAccessory;\n\n\t\t\tthis._itemRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Item Renderer state is not ButtonState.UP with no touch\", ButtonState.UP, this._itemRenderer.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"Item Renderer accessory is not defaultAccessory when currentState is ButtonState.UP and accessory not provided for this state\", defaultAccessory, this._itemRenderer.currentAccessoryInternal);\n\t\t\t\n\t\t\tthis._itemRenderer.isEnabled = false;\n\t\t\tthis._itemRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Item Renderer state is not ButtonState.DISABLED when isEnabled is false\", ButtonState.DISABLED, this._itemRenderer.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"Item Renderer accessory is not defaultAccessory when currentState is ButtonState.DISABLED and accessory not provided for this state\", defaultAccessory, this._itemRenderer.currentAccessoryInternal);\n\n\t\t\tthis._itemRenderer.isEnabled = true;\n\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._itemRenderer.stage.hitTest(position);\n\t\t\tAssert.assertStrictlyEquals(\"Touch target must be item renderer\", this._itemRenderer, target);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.HOVER;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._itemRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Item Renderer state is not ButtonState.HOVER on TouchPhase.HOVER\", ButtonState.HOVER, this._itemRenderer.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"Item Renderer accessory is not defaultAccessory when currentState is ButtonState.HOVER and accessory not provided for this state\", defaultAccessory, this._itemRenderer.currentAccessoryInternal);\n\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._itemRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Item Renderer state is not ButtonState.DOWN on TouchPhase.BEGAN\", ButtonState.DOWN, this._itemRenderer.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"Item Renderer accessory is not defaultAccessory when currentState is ButtonState.DOWN and accessory not provided for this state\", defaultAccessory, this._itemRenderer.currentAccessoryInternal);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentAccessoryWithSetAccessoryForState():void\n\t\t{\n\t\t\tthis._itemRenderer.isQuickHitAreaEnabled = true;\n\t\t\tthis._itemRenderer.itemHasAccessory = false;\n\t\t\t\n\t\t\tvar defaultAccessory:Quad = new Quad(200, 200);\n\t\t\tthis._itemRenderer.defaultAccessory = defaultAccessory;\n\n\t\t\tvar upAccessory:Quad = new Quad(200, 200);\n\t\t\tthis._itemRenderer.setAccessoryForState(ButtonState.UP, upAccessory);\n\n\t\t\tvar hoverAccessory:Quad = new Quad(200, 200);\n\t\t\tthis._itemRenderer.setAccessoryForState(ButtonState.HOVER, hoverAccessory);\n\n\t\t\tvar downAccessory:Quad = new Quad(200, 200);\n\t\t\tthis._itemRenderer.setAccessoryForState(ButtonState.DOWN, downAccessory);\n\n\t\t\tvar disabledAccessory:Quad = new Quad(200, 200);\n\t\t\tthis._itemRenderer.setAccessoryForState(ButtonState.DISABLED, disabledAccessory);\n\n\t\t\tthis._itemRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Item Renderer state is not ButtonState.UP with no touch\", ButtonState.UP, this._itemRenderer.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"Item Renderer accessory does not match accessory set with setAccessoryForState() when currentState is ButtonState.UP\", upAccessory, this._itemRenderer.currentAccessoryInternal);\n\n\t\t\tthis._itemRenderer.isEnabled = false;\n\t\t\tthis._itemRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Item Renderer state is not ButtonState.DISABLED when isEnabled is false\", ButtonState.DISABLED, this._itemRenderer.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"Item Renderer accessory does not match accessory set with setAccessoryForState() when currentState is ButtonState.DISABLED\", disabledAccessory, this._itemRenderer.currentAccessoryInternal);\n\n\t\t\tthis._itemRenderer.isEnabled = true;\n\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._itemRenderer.stage.hitTest(position);\n\t\t\tAssert.assertStrictlyEquals(\"Touch target must be item renderer\", this._itemRenderer, target);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.HOVER;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._itemRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Item Renderer state is not ButtonState.HOVER on TouchPhase.HOVER\",\n\t\t\t\tButtonState.HOVER, this._itemRenderer.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"Item Renderer accessory does not match accessory set with setAccessoryForState() when currentState is ButtonState.HOVER and accessory not provided for this state\",\n\t\t\t\thoverAccessory, this._itemRenderer.currentAccessoryInternal);\n\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._itemRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Item Renderer state is not ButtonState.DOWN on TouchPhase.BEGAN\", ButtonState.DOWN, this._itemRenderer.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"Item Renderer accessory does not match accessory set with setAccessoryForState() when currentState is ButtonState.DOWN and accessory not provided for this state\", downAccessory, this._itemRenderer.currentAccessoryInternal);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTapToSelectIsEnabledWhenIsSelectableOnAccessoryTouchIsFalseWithAccessorySourceFunction():void\n\t\t{\n\t\t\tvar accessory:ImageLoader;\n\t\t\tvar texture:Texture;\n\t\t\tthis._itemRenderer.itemHasAccessory = true;\n\t\t\tthis._itemRenderer.accessoryLoaderFactory = function():ImageLoader\n\t\t\t{\n\t\t\t\taccessory = new ImageLoader();\n\t\t\t\treturn accessory;\n\t\t\t}\n\t\t\tthis._itemRenderer.accessorySourceFunction = function():Texture\n\t\t\t{\n\t\t\t\tif(texture)\n\t\t\t\t{\n\t\t\t\t\ttexture.dispose();\n\t\t\t\t}\n\t\t\t\ttexture = Texture.fromColor(200, 200, 0xff00ff);\n\t\t\t\treturn texture;\n\t\t\t}\n\t\t\tthis._itemRenderer.isSelectableOnAccessoryTouch = false;\n\t\t\tthis._itemRenderer.hasLabelTextRenderer = false;\n\t\t\tthis._itemRenderer.validate();\n\n\t\t\tvar position:Point = new Point(20, 20);\n\t\t\tvar target:DisplayObject = this._itemRenderer.stage.hitTest(position);\n\t\t\tAssert.assertStrictlyEquals(\"Touch target must be item renderer accessory\", accessory, target);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._itemRenderer.validate();\n\t\t\tAssert.assertTrue(\"Item Renderer TapToSelect is incorrectly disabled when isSelectableOnAccessoryTouch is false on TouchPhase.BEGAN\", this._itemRenderer.tapToSelectInternal.isEnabled);\n\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._itemRenderer.validate();\n\t\t\tAssert.assertTrue(\"Item Renderer TapToSelect is incorrectly disabled when isSelectableOnAccessoryTouch is false on TouchPhase.ENDED\", this._itemRenderer.tapToSelectInternal.isEnabled);\n\n\t\t\ttexture.dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTapToSelectIsEnabledWhenIsSelectableOnAccessoryTouchIsTrueWithAccessorySourceFunction():void\n\t\t{\n\t\t\tvar accessory:ImageLoader;\n\t\t\tvar texture:Texture;\n\t\t\tthis._itemRenderer.itemHasAccessory = true;\n\t\t\tthis._itemRenderer.accessoryLoaderFactory = function():ImageLoader\n\t\t\t{\n\t\t\t\taccessory = new ImageLoader();\n\t\t\t\treturn accessory;\n\t\t\t}\n\t\t\tthis._itemRenderer.accessorySourceFunction = function():Texture\n\t\t\t{\n\t\t\t\tif(texture)\n\t\t\t\t{\n\t\t\t\t\ttexture.dispose();\n\t\t\t\t}\n\t\t\t\ttexture = Texture.fromColor(200, 200, 0xff00ff);\n\t\t\t\treturn texture;\n\t\t\t}\n\t\t\tthis._itemRenderer.isSelectableOnAccessoryTouch = true;\n\t\t\tthis._itemRenderer.hasLabelTextRenderer = false;\n\t\t\tthis._itemRenderer.validate();\n\n\t\t\tvar position:Point = new Point(20, 20);\n\t\t\tvar target:DisplayObject = this._itemRenderer.stage.hitTest(position);\n\t\t\tAssert.assertStrictlyEquals(\"Touch target must be item renderer accessory\", accessory, target);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._itemRenderer.validate();\n\t\t\tAssert.assertTrue(\"Item Renderer TapToSelect is incorrectly disabled when isSelectableOnAccessoryTouch is true on TouchPhase.BEGAN\", this._itemRenderer.tapToSelectInternal.isEnabled);\n\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._itemRenderer.validate();\n\t\t\tAssert.assertTrue(\"Item Renderer TapToSelect is incorrectly disabled when isSelectableOnAccessoryTouch is true on TouchPhase.ENDED\", this._itemRenderer.tapToSelectInternal.isEnabled);\n\n\t\t\ttexture.dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTapToSelectIsEnabledWhenIsSelectableOnAccessoryTouchIsFalseWithDefaultAccessory():void\n\t\t{\n\t\t\tthis._itemRenderer.itemHasAccessory = false;\n\t\t\tvar defaultAccessory:LayoutGroup = new LayoutGroup();\n\t\t\tdefaultAccessory.backgroundSkin = new Quad(200, 200);\n\t\t\tthis._itemRenderer.defaultAccessory = defaultAccessory;\n\t\t\tthis._itemRenderer.isSelectableOnAccessoryTouch = false;\n\t\t\tthis._itemRenderer.hasLabelTextRenderer = false;\n\t\t\tthis._itemRenderer.validate();\n\n\t\t\tvar position:Point = new Point(20, 20);\n\t\t\tvar target:DisplayObject = this._itemRenderer.stage.hitTest(position);\n\t\t\tAssert.assertStrictlyEquals(\"Touch target must be item renderer accessory\", defaultAccessory, target);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._itemRenderer.validate();\n\t\t\tAssert.assertFalse(\"Item Renderer TapToSelect is incorrectly enabled when isSelectableOnAccessoryTouch is false on TouchPhase.BEGAN\", this._itemRenderer.tapToSelectInternal.isEnabled);\n\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._itemRenderer.validate();\n\t\t\tAssert.assertTrue(\"Item Renderer TapToSelect is incorrectly disabled when isSelectableOnAccessoryTouch is false on TouchPhase.ENDED\", this._itemRenderer.tapToSelectInternal.isEnabled);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTapToSelectIsEnabledWhenIsSelectableOnAccessoryTouchIsTrueWithDefaultAccessory():void\n\t\t{\n\t\t\tthis._itemRenderer.itemHasAccessory = false;\n\t\t\tvar defaultAccessory:LayoutGroup = new LayoutGroup();\n\t\t\tdefaultAccessory.backgroundSkin = new Quad(200, 200);\n\t\t\tthis._itemRenderer.defaultAccessory = defaultAccessory;\n\t\t\tthis._itemRenderer.isSelectableOnAccessoryTouch = true;\n\t\t\tthis._itemRenderer.hasLabelTextRenderer = false;\n\t\t\tthis._itemRenderer.validate();\n\n\t\t\tvar position:Point = new Point(20, 20);\n\t\t\tvar target:DisplayObject = this._itemRenderer.stage.hitTest(position);\n\t\t\tAssert.assertStrictlyEquals(\"Touch target must be item renderer accessory\", defaultAccessory, target);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._itemRenderer.validate();\n\t\t\tAssert.assertTrue(\"Item Renderer TapToSelect is incorrectly disabled when isSelectableOnAccessoryTouch is true on TouchPhase.BEGAN\", this._itemRenderer.tapToSelectInternal.isEnabled);\n\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._itemRenderer.validate();\n\t\t\tAssert.assertTrue(\"Item Renderer TapToSelect is incorrectly disabled when isSelectableOnAccessoryTouch is true on TouchPhase.ENDED\", this._itemRenderer.tapToSelectInternal.isEnabled);\n\t\t}\n\t}\n}\n\nimport feathers.controls.renderers.DefaultListItemRenderer;\nimport feathers.utils.touch.TapToSelect;\n\nimport starling.display.DisplayObject;\n\nclass DefaultListItemRendererWithInternalState extends DefaultListItemRenderer\n{\n\tpublic function DefaultListItemRendererWithInternalState()\n\t{\n\t\tsuper();\n\t}\n\n\tpublic function get tapToSelectInternal():TapToSelect\n\t{\n\t\treturn this.tapToSelect;\n\t}\n\n\tpublic function get currentAccessoryInternal():DisplayObject\n\t{\n\t\treturn this.currentAccessory;\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/DefaultListItemRendererMeasurementTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.List;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.text.BitmapFontTextRenderer;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class DefaultListItemRendererMeasurementTests\n\t{\n\t\tprivate static const SMALL_BACKGROUND_WIDTH:Number = 10;\n\t\tprivate static const SMALL_BACKGROUND_HEIGHT:Number = 12;\n\t\tprivate static const LARGE_BACKGROUND_WIDTH:Number = 100;\n\t\tprivate static const LARGE_BACKGROUND_HEIGHT:Number = 110;\n\t\tprivate static const COMPLEX_BACKGROUND_WIDTH:Number = 54;\n\t\tprivate static const COMPLEX_BACKGROUND_HEIGHT:Number = 55;\n\t\tprivate static const COMPLEX_BACKGROUND_MIN_WIDTH:Number = 38;\n\t\tprivate static const COMPLEX_BACKGROUND_MIN_HEIGHT:Number = 39;\n\n\t\tprivate static const SMALL_ICON_WIDTH:Number = 13;\n\t\tprivate static const SMALL_ICON_HEIGHT:Number = 11;\n\t\tprivate static const LARGE_ICON_WIDTH:Number = 105;\n\t\tprivate static const LARGE_ICON_HEIGHT:Number = 115;\n\t\tprivate static const COMPLEX_ICON_WIDTH:Number = 23;\n\t\tprivate static const COMPLEX_ICON_HEIGHT:Number = 25;\n\t\tprivate static const COMPLEX_ICON_MIN_WIDTH:Number = 18;\n\t\tprivate static const COMPLEX_ICON_MIN_HEIGHT:Number = 19;\n\n\t\tprivate static const SMALL_ACCESSORY_WIDTH:Number = 14;\n\t\tprivate static const SMALL_ACCESSORY_HEIGHT:Number = 12;\n\t\tprivate static const LARGE_ACCESSORY_WIDTH:Number = 106;\n\t\tprivate static const LARGE_ACCESSORY_HEIGHT:Number = 116;\n\t\tprivate static const COMPLEX_ACCESSORY_WIDTH:Number = 24;\n\t\tprivate static const COMPLEX_ACCESSORY_HEIGHT:Number = 26;\n\t\tprivate static const COMPLEX_ACCESSORY_MIN_WIDTH:Number = 19;\n\t\tprivate static const COMPLEX_ACCESSORY_MIN_HEIGHT:Number = 20;\n\n\t\tprivate static const PADDING_TOP:Number = 50;\n\t\tprivate static const PADDING_RIGHT:Number = 54;\n\t\tprivate static const PADDING_BOTTOM:Number = 59;\n\t\tprivate static const PADDING_LEFT:Number = 60;\n\t\tprivate static const GAP:Number = 6;\n\t\t\n\t\tprivate var _itemRenderer:DefaultListItemRenderer;\n\t\tprivate var _textRenderer:BitmapFontTextRenderer;\n\t\tprivate var _list:List;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._list = new List();\n\n\t\t\tthis._itemRenderer = new DefaultListItemRenderer();\n\t\t\tthis._itemRenderer.owner = this._list;\n\t\t\tthis._itemRenderer.index = 0;\n\t\t\tthis._itemRenderer.data = {};\n\t\t\tthis._itemRenderer.useStateDelayTimer = false;\n\t\t\tthis._itemRenderer.labelFactory = function():BitmapFontTextRenderer\n\t\t\t{\n\t\t\t\treturn new BitmapFontTextRenderer();\n\t\t\t};\n\t\t\tTestFeathers.starlingRoot.addChild(this._itemRenderer);\n\n\t\t\tthis._textRenderer = new BitmapFontTextRenderer();\n\t\t\tTestFeathers.starlingRoot.addChild(this._textRenderer);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._itemRenderer.removeFromParent(true);\n\t\t\tthis._itemRenderer = null;\n\n\t\t\tthis._list.dispose();\n\t\t\tthis._list = null;\n\n\t\t\tthis._textRenderer.removeFromParent(true);\n\t\t\tthis._textRenderer = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\tprivate function addSmallSimpleAccessory():void\n\t\t{\n\t\t\tthis._itemRenderer.itemHasAccessory = false;\n\t\t\tthis._itemRenderer.defaultAccessory = new Quad(SMALL_ACCESSORY_WIDTH, SMALL_ACCESSORY_HEIGHT, 0xff00ff);\n\t\t}\n\n\t\tprivate function addLargeSimpleAccessory():void\n\t\t{\n\t\t\tthis._itemRenderer.itemHasAccessory = false;\n\t\t\tthis._itemRenderer.defaultAccessory = new Quad(LARGE_ACCESSORY_WIDTH, LARGE_ACCESSORY_HEIGHT, 0xff00ff);\n\t\t}\n\n\t\tprivate function addComplexAccessory():void\n\t\t{\n\t\t\tthis._itemRenderer.itemHasAccessory = false;\n\t\t\tvar icon:LayoutGroup = new LayoutGroup();\n\t\t\ticon.width = COMPLEX_ACCESSORY_WIDTH;\n\t\t\ticon.height = COMPLEX_ACCESSORY_HEIGHT;\n\t\t\ticon.minWidth = COMPLEX_ACCESSORY_MIN_WIDTH;\n\t\t\ticon.minHeight = COMPLEX_ACCESSORY_MIN_HEIGHT;\n\t\t\tthis._itemRenderer.defaultAccessory = icon;\n\t\t}\n\n\t\tprivate function addComplexAutoSizingAccessory():void\n\t\t{\n\t\t\tthis._itemRenderer.itemHasAccessory = false;\n\t\t\tvar icon:LayoutGroup = new LayoutGroup();\n\t\t\ticon.backgroundSkin = new Quad(COMPLEX_ACCESSORY_WIDTH, COMPLEX_ACCESSORY_HEIGHT);\n\t\t\tthis._itemRenderer.defaultAccessory = icon;\n\t\t}\n\n\t\tprivate function addSmallSimpleIcon():void\n\t\t{\n\t\t\tthis._itemRenderer.itemHasIcon = false;\n\t\t\tthis._itemRenderer.defaultIcon = new Quad(SMALL_ICON_WIDTH, SMALL_ICON_HEIGHT, 0xff00ff);\n\t\t}\n\n\t\tprivate function addLargeSimpleIcon():void\n\t\t{\n\t\t\tthis._itemRenderer.itemHasIcon = false;\n\t\t\tthis._itemRenderer.defaultIcon = new Quad(LARGE_ICON_WIDTH, LARGE_ICON_HEIGHT, 0xff00ff);\n\t\t}\n\n\t\tprivate function addComplexIcon():void\n\t\t{\n\t\t\tthis._itemRenderer.itemHasIcon = false;\n\t\t\tvar icon:LayoutGroup = new LayoutGroup();\n\t\t\ticon.width = COMPLEX_ICON_WIDTH;\n\t\t\ticon.height = COMPLEX_ICON_HEIGHT;\n\t\t\ticon.minWidth = COMPLEX_ICON_MIN_WIDTH;\n\t\t\ticon.minHeight = COMPLEX_ICON_MIN_HEIGHT;\n\t\t\tthis._itemRenderer.defaultIcon = icon;\n\t\t}\n\n\t\tprivate function addComplexAutoSizingIcon():void\n\t\t{\n\t\t\tthis._itemRenderer.itemHasIcon = false;\n\t\t\tvar icon:LayoutGroup = new LayoutGroup();\n\t\t\ticon.backgroundSkin = new Quad(COMPLEX_ICON_WIDTH, COMPLEX_ICON_HEIGHT);\n\t\t\tthis._itemRenderer.defaultIcon = icon;\n\t\t}\n\n\t\tprivate function addSmallSimpleBackground():void\n\t\t{\n\t\t\tthis._itemRenderer.itemHasSkin = false;\n\t\t\tthis._itemRenderer.defaultSkin = new Quad(SMALL_BACKGROUND_WIDTH, SMALL_BACKGROUND_HEIGHT, 0xff00ff);\n\t\t}\n\n\t\tprivate function addLargeSimpleBackground():void\n\t\t{\n\t\t\tthis._itemRenderer.itemHasSkin = false;\n\t\t\tthis._itemRenderer.defaultSkin = new Quad(LARGE_BACKGROUND_WIDTH, LARGE_BACKGROUND_HEIGHT, 0xff00ff);\n\t\t}\n\n\t\tprivate function addComplexBackground():void\n\t\t{\n\t\t\tthis._itemRenderer.itemHasSkin = false;\n\t\t\tvar backgroundSkin:LayoutGroup = new LayoutGroup();\n\t\t\tbackgroundSkin.width = COMPLEX_BACKGROUND_WIDTH;\n\t\t\tbackgroundSkin.height = COMPLEX_BACKGROUND_HEIGHT;\n\t\t\tbackgroundSkin.minWidth = COMPLEX_BACKGROUND_MIN_WIDTH;\n\t\t\tbackgroundSkin.minHeight = COMPLEX_BACKGROUND_MIN_HEIGHT;\n\t\t\tthis._itemRenderer.defaultSkin = backgroundSkin;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithPadding():void\n\t\t{\n\t\t\tthis._itemRenderer.hasLabelTextRenderer = false;\n\t\t\tthis._itemRenderer.paddingTop = PADDING_TOP;\n\t\t\tthis._itemRenderer.paddingRight = PADDING_RIGHT;\n\t\t\tthis._itemRenderer.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._itemRenderer.paddingLeft = PADDING_LEFT;\n\t\t\tthis._itemRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the DefaultListItemRenderer was not calculated correctly based on the left and right padding.\",\n\t\t\t\tPADDING_LEFT + PADDING_RIGHT, this._itemRenderer.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the DefaultListItemRenderer was not calculated correctly based on the top and bottom padding.\",\n\t\t\t\tPADDING_TOP + PADDING_BOTTOM, this._itemRenderer.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the DefaultListItemRenderer was not calculated correctly based on the left and right padding.\",\n\t\t\t\tPADDING_LEFT + PADDING_RIGHT, this._itemRenderer.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the DefaultListItemRenderer was not calculated correctly based on the top and bottom padding.\",\n\t\t\t\tPADDING_TOP + PADDING_BOTTOM, this._itemRenderer.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithLabel():void\n\t\t{\n\t\t\tvar labelText:String = \"I am the very model of a modern major general\";\n\t\t\tthis._textRenderer.text = labelText;\n\t\t\tthis._textRenderer.validate();\n\n\t\t\tthis._itemRenderer.data = { label: labelText };\n\t\t\tthis._itemRenderer.validate();\n\n\t\t\tAssert.assertTrue(\"The width of the DefaultListItemRenderer was not greater than 0 when using a label.\",\n\t\t\t\tthis._itemRenderer.width > 0);\n\t\t\tAssert.assertTrue(\"The height of the DefaultListItemRenderer was not greater than 0 when using a label.\",\n\t\t\t\tthis._itemRenderer.height > 0);\n\t\t\tAssert.assertTrue(\"The minWidth of the DefaultListItemRenderer was not greater than 0 when using a label.\",\n\t\t\t\tthis._itemRenderer.minWidth > 0);\n\t\t\tAssert.assertTrue(\"The minHeight of the DefaultListItemRenderer was not greater than 0 when using a label.\",\n\t\t\t\tthis._itemRenderer.minHeight > 0);\n\t\t\tAssert.assertStrictlyEquals(\"The width of the DefaultListItemRenderer was not calculated correctly based on the label.\",\n\t\t\t\tthis._textRenderer.width, this._itemRenderer.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the DefaultListItemRenderer was not calculated correctly based on the label.\",\n\t\t\t\tthis._textRenderer.height, this._itemRenderer.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the DefaultListItemRenderer was not calculated correctly based on the label.\",\n\t\t\t\tthis._textRenderer.width, this._itemRenderer.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the DefaultListItemRenderer was not calculated correctly based on the label.\",\n\t\t\t\tthis._textRenderer.height, this._itemRenderer.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithLabelAndPadding():void\n\t\t{\n\t\t\tvar labelText:String = \"I am the very model of a modern major general\";\n\t\t\tthis._textRenderer.text = labelText;\n\t\t\tthis._textRenderer.validate();\n\n\t\t\tthis._itemRenderer.data = { label: labelText };\n\t\t\tthis._itemRenderer.paddingTop = PADDING_TOP;\n\t\t\tthis._itemRenderer.paddingRight = PADDING_RIGHT;\n\t\t\tthis._itemRenderer.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._itemRenderer.paddingLeft = PADDING_LEFT;\n\t\t\tthis._itemRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the DefaultListItemRenderer was not calculated correctly based on the label and left and right padding.\",\n\t\t\t\tthis._textRenderer.width + PADDING_LEFT + PADDING_RIGHT, this._itemRenderer.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the DefaultListItemRenderer was not calculated correctly based on the label and top and bottom padding.\",\n\t\t\t\tthis._textRenderer.height + PADDING_TOP + PADDING_BOTTOM, this._itemRenderer.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the DefaultListItemRenderer was not calculated correctly based on the label and left and right padding.\",\n\t\t\t\tthis._textRenderer.width + PADDING_LEFT + PADDING_RIGHT, this._itemRenderer.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the DefaultListItemRenderer was not calculated correctly based on the label and top and bottom padding.\",\n\t\t\t\tthis._textRenderer.height + PADDING_TOP + PADDING_BOTTOM, this._itemRenderer.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithLabelAndSimpleIcon():void\n\t\t{\n\t\t\tvar labelText:String = \"I am the very model of a modern major general\";\n\t\t\tthis._textRenderer.text = labelText;\n\t\t\tthis._textRenderer.validate();\n\n\t\t\tthis.addLargeSimpleIcon();\n\t\t\tthis._itemRenderer.data = { label: labelText };\n\t\t\tthis._itemRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the DefaultListItemRenderer was not calculated correctly based on the label and icon.\",\n\t\t\t\tthis._textRenderer.width + LARGE_ICON_WIDTH, this._itemRenderer.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the DefaultListItemRenderer was not calculated correctly based on the label and icon.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this._itemRenderer.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the DefaultListItemRenderer was not calculated correctly based on the label and icon.\",\n\t\t\t\tthis._textRenderer.width + LARGE_ICON_WIDTH, this._itemRenderer.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the DefaultListItemRenderer was not calculated correctly based on the label and icon.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this._itemRenderer.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithLabelGapAndSimpleIcon():void\n\t\t{\n\t\t\tvar labelText:String = \"I am the very model of a modern major general\";\n\t\t\tthis._textRenderer.text = labelText;\n\t\t\tthis._textRenderer.validate();\n\n\t\t\tthis.addLargeSimpleIcon();\n\t\t\tthis._itemRenderer.data = { label: labelText };\n\t\t\tthis._itemRenderer.gap = GAP;\n\t\t\tthis._itemRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the DefaultListItemRenderer was not calculated correctly based on the label, gap, and icon.\",\n\t\t\t\tthis._textRenderer.width + GAP + LARGE_ICON_WIDTH, this._itemRenderer.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the DefaultListItemRenderer was not calculated correctly based on the label, gap, and icon.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this._itemRenderer.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the DefaultListItemRenderer was not calculated correctly based on the label, gap, and icon.\",\n\t\t\t\tthis._textRenderer.width + GAP + LARGE_ICON_WIDTH, this._itemRenderer.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the DefaultListItemRenderer was not calculated correctly based on the label, and icon.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this._itemRenderer.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithLabelGapPaddingAndSimpleIcon():void\n\t\t{\n\t\t\tvar labelText:String = \"I am the very model of a modern major general\";\n\t\t\tthis._textRenderer.text = labelText;\n\t\t\tthis._textRenderer.validate();\n\n\t\t\tthis.addLargeSimpleIcon();\n\t\t\tthis._itemRenderer.data = { label: labelText };\n\t\t\tthis._itemRenderer.paddingTop = PADDING_TOP;\n\t\t\tthis._itemRenderer.paddingRight = PADDING_RIGHT;\n\t\t\tthis._itemRenderer.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._itemRenderer.paddingLeft = PADDING_LEFT;\n\t\t\tthis._itemRenderer.gap = GAP;\n\t\t\tthis._itemRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the DefaultListItemRenderer was not calculated correctly based on the label, gap, left and right padding, and icon.\",\n\t\t\t\tthis._textRenderer.width + GAP + LARGE_ICON_WIDTH + PADDING_LEFT + PADDING_RIGHT, this._itemRenderer.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the DefaultListItemRenderer was not calculated correctly based on the label, gap, top and bottom padding, and icon.\",\n\t\t\t\tLARGE_ICON_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._itemRenderer.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the DefaultListItemRenderer was not calculated correctly based on the label, gap, left and right padding, and icon.\",\n\t\t\t\tthis._textRenderer.width + GAP + LARGE_ICON_WIDTH + PADDING_LEFT + PADDING_RIGHT, this._itemRenderer.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the DefaultListItemRenderer was not calculated correctly based on the label, gap, top and bottom padding, and icon.\",\n\t\t\t\tLARGE_ICON_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._itemRenderer.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithSimpleIcon():void\n\t\t{\n\t\t\tthis.addLargeSimpleIcon();\n\t\t\tthis._itemRenderer.hasLabelTextRenderer = false;\n\t\t\tthis._itemRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the DefaultListItemRenderer was not calculated correctly based on the icon width.\",\n\t\t\t\tLARGE_ICON_WIDTH, this._itemRenderer.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the DefaultListItemRenderer was not calculated correctly based on the icon height.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this._itemRenderer.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the DefaultListItemRenderer was not calculated correctly based on the icon width.\",\n\t\t\t\tLARGE_ICON_WIDTH, this._itemRenderer.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the DefaultListItemRenderer was not calculated correctly based on the icon height.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this._itemRenderer.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithComplexIcon():void\n\t\t{\n\t\t\tthis.addComplexIcon();\n\t\t\tthis._itemRenderer.hasLabelTextRenderer = false;\n\t\t\tthis._itemRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the DefaultListItemRenderer was not calculated correctly based on the complex icon width.\",\n\t\t\t\tCOMPLEX_ICON_WIDTH, this._itemRenderer.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the DefaultListItemRenderer was not calculated correctly based on the complex icon height.\",\n\t\t\t\tCOMPLEX_ICON_HEIGHT, this._itemRenderer.height);\n\n\t\t\t//the item renderer never resizes the icon, so we ignore its minimum\n\t\t\t//dimensions\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the DefaultListItemRenderer was not calculated correctly based on the complex icon minWidth.\",\n\t\t\t\tCOMPLEX_ICON_WIDTH, this._itemRenderer.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the DefaultListItemRenderer was not calculated correctly based on the complex icon minHeight.\",\n\t\t\t\tCOMPLEX_ICON_HEIGHT, this._itemRenderer.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithComplexAutoSizingIcon():void\n\t\t{\n\t\t\tthis.addComplexAutoSizingIcon();\n\t\t\tthis._itemRenderer.hasLabelTextRenderer = false;\n\t\t\tthis._itemRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the DefaultListItemRenderer was not calculated correctly based on the complex icon width.\",\n\t\t\t\tCOMPLEX_ICON_WIDTH, this._itemRenderer.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the DefaultListItemRenderer was not calculated correctly based on the complex icon height.\",\n\t\t\t\tCOMPLEX_ICON_HEIGHT, this._itemRenderer.height);\n\t\t\t\n\t\t\t//the item renderer never resizes the icon, so we ignore its\n\t\t\t//minimum dimensions\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the DefaultListItemRenderer was not calculated correctly based on the complex icon minWidth.\",\n\t\t\t\tCOMPLEX_ICON_WIDTH, this._itemRenderer.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the DefaultListItemRenderer was not calculated correctly based on the complex icon minHeight.\",\n\t\t\t\tCOMPLEX_ICON_HEIGHT, this._itemRenderer.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithSimpleAccessory():void\n\t\t{\n\t\t\tthis.addLargeSimpleAccessory();\n\t\t\tthis._itemRenderer.hasLabelTextRenderer = false;\n\t\t\tthis._itemRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the DefaultListItemRenderer was not calculated correctly based on the accessory width.\",\n\t\t\t\tLARGE_ACCESSORY_WIDTH, this._itemRenderer.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the DefaultListItemRenderer was not calculated correctly based on the accessory height.\",\n\t\t\t\tLARGE_ACCESSORY_HEIGHT, this._itemRenderer.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the DefaultListItemRenderer was not calculated correctly based on the accessory width.\",\n\t\t\t\tLARGE_ACCESSORY_WIDTH, this._itemRenderer.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the DefaultListItemRenderer was not calculated correctly based on the accessory height.\",\n\t\t\t\tLARGE_ACCESSORY_HEIGHT, this._itemRenderer.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithComplexAccessory():void\n\t\t{\n\t\t\tthis.addComplexAccessory();\n\t\t\tthis._itemRenderer.hasLabelTextRenderer = false;\n\t\t\tthis._itemRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the DefaultListItemRenderer was not calculated correctly based on the complex accessory width.\",\n\t\t\t\tCOMPLEX_ACCESSORY_WIDTH, this._itemRenderer.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the DefaultListItemRenderer was not calculated correctly based on the complex accessory height.\",\n\t\t\t\tCOMPLEX_ACCESSORY_HEIGHT, this._itemRenderer.height);\n\t\t\t\n\t\t\t//the item renderer never resizes the accessory, so we ignore its\n\t\t\t//minimum dimensions\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the DefaultListItemRenderer was not calculated correctly based on the complex accessory minWidth.\",\n\t\t\t\tCOMPLEX_ACCESSORY_WIDTH, this._itemRenderer.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the DefaultListItemRenderer was not calculated correctly based on the complex accessory minHeight.\",\n\t\t\t\tCOMPLEX_ACCESSORY_HEIGHT, this._itemRenderer.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithComplexAutoSizingAccessory():void\n\t\t{\n\t\t\tthis.addComplexAutoSizingAccessory();\n\t\t\tthis._itemRenderer.hasLabelTextRenderer = false;\n\t\t\tthis._itemRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the DefaultListItemRenderer was not calculated correctly based on the complex accessory width.\",\n\t\t\t\tCOMPLEX_ACCESSORY_WIDTH, this._itemRenderer.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the DefaultListItemRenderer was not calculated correctly based on the complex accessory height.\",\n\t\t\t\tCOMPLEX_ACCESSORY_HEIGHT, this._itemRenderer.height);\n\t\t\t\n\t\t\t//the item renderer never resizes the accessory, so we ignore its\n\t\t\t//minimum dimensions\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the DefaultListItemRenderer was not calculated correctly based on the complex accessory minWidth.\",\n\t\t\t\tCOMPLEX_ACCESSORY_WIDTH, this._itemRenderer.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the DefaultListItemRenderer was not calculated correctly based on the complex accessory minHeight.\",\n\t\t\t\tCOMPLEX_ACCESSORY_HEIGHT, this._itemRenderer.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithSimpleBackgroundSkin():void\n\t\t{\n\t\t\tthis.addSmallSimpleBackground();\n\t\t\tthis._itemRenderer.hasLabelTextRenderer = false;\n\t\t\tthis._itemRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the DefaultListItemRenderer was not calculated correctly based on the background width.\",\n\t\t\t\tSMALL_BACKGROUND_WIDTH, this._itemRenderer.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the DefaultListItemRenderer was not calculated correctly based on the background height.\",\n\t\t\t\tSMALL_BACKGROUND_HEIGHT, this._itemRenderer.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the DefaultListItemRenderer was not calculated correctly based on the background width.\",\n\t\t\t\tSMALL_BACKGROUND_WIDTH, this._itemRenderer.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the DefaultListItemRenderer was not calculated correctly based on the background height.\",\n\t\t\t\tSMALL_BACKGROUND_HEIGHT, this._itemRenderer.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithSmallSimpleBackgroundSkinAndLargeSimpleIcon():void\n\t\t{\n\t\t\tthis.addSmallSimpleBackground();\n\t\t\tthis.addLargeSimpleIcon();\n\t\t\tthis._itemRenderer.hasLabelTextRenderer = false;\n\t\t\tthis._itemRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the DefaultListItemRenderer was not calculated correctly based on the icon width.\",\n\t\t\t\tLARGE_ICON_WIDTH, this._itemRenderer.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the DefaultListItemRenderer was not calculated correctly based on the icon height.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this._itemRenderer.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the DefaultListItemRenderer was not calculated correctly based on the icon width.\",\n\t\t\t\tLARGE_ICON_WIDTH, this._itemRenderer.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the DefaultListItemRenderer was not calculated correctly based on the icon height.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this._itemRenderer.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithLargeSimpleBackgroundSkinAndSmallSimpleIcon():void\n\t\t{\n\t\t\tthis.addLargeSimpleBackground();\n\t\t\tthis.addSmallSimpleIcon();\n\t\t\tthis._itemRenderer.hasLabelTextRenderer = false;\n\t\t\tthis._itemRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the DefaultListItemRenderer was not calculated correctly based on the background width.\",\n\t\t\t\tLARGE_BACKGROUND_WIDTH, this._itemRenderer.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the DefaultListItemRenderer was not calculated correctly based on the background height.\",\n\t\t\t\tLARGE_BACKGROUND_HEIGHT, this._itemRenderer.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the DefaultListItemRenderer was not calculated correctly based on the background width.\",\n\t\t\t\tLARGE_BACKGROUND_WIDTH, this._itemRenderer.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the DefaultListItemRenderer was not calculated correctly based on the background height.\",\n\t\t\t\tLARGE_BACKGROUND_HEIGHT, this._itemRenderer.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithComplexBackground():void\n\t\t{\n\t\t\tthis.addComplexBackground();\n\t\t\tthis._itemRenderer.hasLabelTextRenderer = false;\n\t\t\tthis._itemRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the DefaultListItemRenderer was not calculated correctly based on the complex background width.\",\n\t\t\t\tCOMPLEX_BACKGROUND_WIDTH, this._itemRenderer.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the DefaultListItemRenderer was not calculated correctly based on the complex background height.\",\n\t\t\t\tCOMPLEX_BACKGROUND_HEIGHT, this._itemRenderer.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the DefaultListItemRenderer was not calculated correctly based on the complex background minWidth.\",\n\t\t\t\tCOMPLEX_BACKGROUND_MIN_WIDTH, this._itemRenderer.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the DefaultListItemRenderer was not calculated correctly based on the complex background minHeight.\",\n\t\t\t\tCOMPLEX_BACKGROUND_MIN_HEIGHT, this._itemRenderer.minHeight);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/DrawersMeasurementTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.AutoSizeMode;\n\timport feathers.controls.Drawers;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.layout.Orientation;\n\n\timport org.flexunit.Assert;\n\n\tpublic class DrawersMeasurementTests\n\t{\n\t\tprivate static const CONTENT_WIDTH:Number = 300;\n\t\tprivate static const CONTENT_HEIGHT:Number = 250;\n\t\tprivate static const CONTENT_MIN_WIDTH:Number = 125;\n\t\tprivate static const CONTENT_MIN_HEIGHT:Number = 75;\n\t\t\n\t\tprivate static const LEFT_DRAWER_WIDTH:Number = 30;\n\t\tprivate static const LEFT_DRAWER_HEIGHT:Number = 325;\n\t\tprivate static const LEFT_DRAWER_MIN_WIDTH:Number = 12;\n\t\tprivate static const LEFT_DRAWER_MIN_HEIGHT:Number = 100;\n\n\t\tprivate static const RIGHT_DRAWER_WIDTH:Number = 11;\n\t\tprivate static const RIGHT_DRAWER_HEIGHT:Number = 316;\n\t\tprivate static const RIGHT_DRAWER_MIN_WIDTH:Number = 15;\n\t\tprivate static const RIGHT_DRAWER_MIN_HEIGHT:Number = 110;\n\n\t\tprivate static const TOP_DRAWER_WIDTH:Number = 350;\n\t\tprivate static const TOP_DRAWER_HEIGHT:Number = 23;\n\t\tprivate static const TOP_DRAWER_MIN_WIDTH:Number = 315;\n\t\tprivate static const TOP_DRAWER_MIN_HEIGHT:Number = 21;\n\n\t\tprivate static const BOTTOM_DRAWER_WIDTH:Number = 330;\n\t\tprivate static const BOTTOM_DRAWER_HEIGHT:Number = 37;\n\t\tprivate static const BOTTOM_DRAWER_MIN_WIDTH:Number = 325;\n\t\tprivate static const BOTTOM_DRAWER_MIN_HEIGHT:Number = 31;\n\n\t\tprivate var _drawers:Drawers;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._drawers = new Drawers();\n\t\t\tTestFeathers.starlingRoot.addChild(this._drawers);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._drawers.removeFromParent(true);\n\t\t\tthis._drawers = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\tprivate function addContent():void\n\t\t{\n\t\t\tvar content:LayoutGroup = new LayoutGroup();\n\t\t\tcontent.width = CONTENT_WIDTH;\n\t\t\tcontent.height = CONTENT_HEIGHT;\n\t\t\tcontent.minWidth = CONTENT_MIN_WIDTH;\n\t\t\tcontent.minHeight = CONTENT_MIN_HEIGHT;\n\t\t\tthis._drawers.content = content;\n\t\t}\n\n\t\tprivate function addLeftDrawer():void\n\t\t{\n\t\t\tvar leftDrawer:LayoutGroup = new LayoutGroup();\n\t\t\tleftDrawer.width = LEFT_DRAWER_WIDTH;\n\t\t\tleftDrawer.height = LEFT_DRAWER_HEIGHT;\n\t\t\tleftDrawer.minWidth = LEFT_DRAWER_MIN_WIDTH;\n\t\t\tleftDrawer.minHeight = LEFT_DRAWER_MIN_HEIGHT;\n\t\t\tthis._drawers.leftDrawer = leftDrawer;\n\t\t}\n\n\t\tprivate function addRightDrawer():void\n\t\t{\n\t\t\tvar rightDrawer:LayoutGroup = new LayoutGroup();\n\t\t\trightDrawer.width = RIGHT_DRAWER_WIDTH;\n\t\t\trightDrawer.height = RIGHT_DRAWER_HEIGHT;\n\t\t\trightDrawer.minWidth = RIGHT_DRAWER_MIN_WIDTH;\n\t\t\trightDrawer.minHeight = RIGHT_DRAWER_MIN_HEIGHT;\n\t\t\tthis._drawers.rightDrawer = rightDrawer;\n\t\t}\n\n\t\tprivate function addTopDrawer():void\n\t\t{\n\t\t\tvar topDrawer:LayoutGroup = new LayoutGroup();\n\t\t\ttopDrawer.width = TOP_DRAWER_WIDTH;\n\t\t\ttopDrawer.height = TOP_DRAWER_HEIGHT;\n\t\t\ttopDrawer.minWidth = TOP_DRAWER_MIN_WIDTH;\n\t\t\ttopDrawer.minHeight = TOP_DRAWER_MIN_HEIGHT;\n\t\t\tthis._drawers.topDrawer = topDrawer;\n\t\t}\n\n\t\tprivate function addBottomDrawer():void\n\t\t{\n\t\t\tvar bottomDrawer:LayoutGroup = new LayoutGroup();\n\t\t\tbottomDrawer.width = BOTTOM_DRAWER_WIDTH;\n\t\t\tbottomDrawer.height = BOTTOM_DRAWER_HEIGHT;\n\t\t\tbottomDrawer.minWidth = BOTTOM_DRAWER_MIN_WIDTH;\n\t\t\tbottomDrawer.minHeight = BOTTOM_DRAWER_MIN_HEIGHT;\n\t\t\tthis._drawers.bottomDrawer = bottomDrawer;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeStage():void\n\t\t{\n\t\t\tthis.addContent();\n\t\t\tthis._drawers.autoSizeMode = AutoSizeMode.STAGE;\n\t\t\tthis._drawers.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Drawers was not calculated correctly based on the stage width.\",\n\t\t\t\tthis._drawers.stage.stageWidth, this._drawers.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Drawers was not calculated correctly based on the stage height.\",\n\t\t\t\tthis._drawers.stage.stageHeight, this._drawers.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Drawers was not calculated correctly based on the stage width.\",\n\t\t\t\tthis._drawers.stage.stageWidth, this._drawers.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Drawers was not calculated correctly based on the stage height.\",\n\t\t\t\tthis._drawers.stage.stageHeight, this._drawers.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeContentWithoutContent():void\n\t\t{\n\t\t\tthis._drawers.autoSizeMode = AutoSizeMode.CONTENT;\n\t\t\tthis._drawers.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Drawers was not calculated correctly based on empty content.\",\n\t\t\t\t0, this._drawers.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Drawers was not calculated correctly based on empty content.\",\n\t\t\t\t0, this._drawers.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Drawers was not calculated correctly based on empty content.\",\n\t\t\t\t0, this._drawers.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Drawers was not calculated correctly based on empty content.\",\n\t\t\t\t0, this._drawers.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeContent():void\n\t\t{\n\t\t\tthis.addContent();\n\t\t\tthis._drawers.autoSizeMode = AutoSizeMode.CONTENT;\n\t\t\tthis._drawers.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Drawers was not calculated correctly based on the content width.\",\n\t\t\t\tCONTENT_WIDTH, this._drawers.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Drawers was not calculated correctly based on the content height.\",\n\t\t\t\tCONTENT_HEIGHT, this._drawers.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Drawers was not calculated correctly based on the content minWidth.\",\n\t\t\t\tCONTENT_MIN_WIDTH, this._drawers.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Drawers was not calculated correctly based on the content minHeight.\",\n\t\t\t\tCONTENT_MIN_HEIGHT, this._drawers.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeContentWithDrawersThatAreNotDocked():void\n\t\t{\n\t\t\tthis.addContent();\n\t\t\tthis.addTopDrawer();\n\t\t\tthis.addRightDrawer();\n\t\t\tthis.addBottomDrawer();\n\t\t\tthis.addLeftDrawer();\n\t\t\tthis._drawers.topDrawerDockMode = Orientation.NONE;\n\t\t\tthis._drawers.rightDrawerDockMode = Orientation.NONE;\n\t\t\tthis._drawers.bottomDrawerDockMode = Orientation.NONE;\n\t\t\tthis._drawers.leftDrawerDockMode = Orientation.NONE;\n\t\t\tthis._drawers.autoSizeMode = AutoSizeMode.CONTENT;\n\t\t\tthis._drawers.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Drawers was not calculated correctly based on the content width.\",\n\t\t\t\tCONTENT_WIDTH, this._drawers.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Drawers was not calculated correctly based on the content height.\",\n\t\t\t\tCONTENT_HEIGHT, this._drawers.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Drawers was not calculated correctly based on the content width.\",\n\t\t\t\tCONTENT_MIN_WIDTH, this._drawers.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Drawers was not calculated correctly based on the content height.\",\n\t\t\t\tCONTENT_MIN_HEIGHT, this._drawers.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeContentWithDockedLeftDrawer():void\n\t\t{\n\t\t\tthis.addContent();\n\t\t\tthis.addLeftDrawer();\n\t\t\tthis._drawers.leftDrawerDockMode = Orientation.BOTH;\n\t\t\tthis._drawers.autoSizeMode = AutoSizeMode.CONTENT;\n\t\t\tthis._drawers.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Drawers was not calculated correctly based on the content width plus docked left drawer width.\",\n\t\t\t\tCONTENT_WIDTH + LEFT_DRAWER_WIDTH, this._drawers.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Drawers was not calculated correctly based on the maximum of content height and docked left drawer height.\",\n\t\t\t\tLEFT_DRAWER_HEIGHT, this._drawers.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Drawers was not calculated correctly based on the content minWidth plus docked left drawer minWidth.\",\n\t\t\t\tCONTENT_MIN_WIDTH + LEFT_DRAWER_MIN_WIDTH, this._drawers.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Drawers was not calculated correctly based on the maximum of content minHeight and docked left drawer minHeight.\",\n\t\t\t\tLEFT_DRAWER_MIN_HEIGHT, this._drawers.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeContentWithDockedRightDrawer():void\n\t\t{\n\t\t\tthis.addContent();\n\t\t\tthis.addRightDrawer();\n\t\t\tthis._drawers.rightDrawerDockMode = Orientation.BOTH;\n\t\t\tthis._drawers.autoSizeMode = AutoSizeMode.CONTENT;\n\t\t\tthis._drawers.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Drawers was not calculated correctly based on the content width plus docked right drawer width.\",\n\t\t\t\tCONTENT_WIDTH + RIGHT_DRAWER_WIDTH, this._drawers.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Drawers was not calculated correctly based on the maximum of content height and docked right drawer height.\",\n\t\t\t\tRIGHT_DRAWER_HEIGHT, this._drawers.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Drawers was not calculated correctly based on the content minWidth plus docked right drawer minWidth.\",\n\t\t\t\tCONTENT_MIN_WIDTH + RIGHT_DRAWER_MIN_WIDTH, this._drawers.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Drawers was not calculated correctly based on the maximum of content minHeight and docked right drawer minHeight.\",\n\t\t\t\tRIGHT_DRAWER_MIN_HEIGHT, this._drawers.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeContentWithDockedTopDrawer():void\n\t\t{\n\t\t\tthis.addContent();\n\t\t\tthis.addTopDrawer();\n\t\t\tthis._drawers.topDrawerDockMode = Orientation.BOTH;\n\t\t\tthis._drawers.autoSizeMode = AutoSizeMode.CONTENT;\n\t\t\tthis._drawers.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Drawers was not calculated correctly based on the maximum of content width and docked top drawer width.\",\n\t\t\t\tTOP_DRAWER_WIDTH, this._drawers.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Drawers was not calculated correctly based on the content height plus docked top drawer height.\",\n\t\t\t\tCONTENT_HEIGHT + TOP_DRAWER_HEIGHT, this._drawers.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Drawers was not calculated correctly based on the maximum of content minWidth and docked top drawer minWidth.\",\n\t\t\t\tTOP_DRAWER_MIN_WIDTH, this._drawers.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Drawers was not calculated correctly based on the content minHeight plus docked top drawer minHeight.\",\n\t\t\t\tCONTENT_MIN_HEIGHT + TOP_DRAWER_MIN_HEIGHT, this._drawers.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeContentWithDockedBottomDrawer():void\n\t\t{\n\t\t\tthis.addContent();\n\t\t\tthis.addBottomDrawer();\n\t\t\tthis._drawers.bottomDrawerDockMode = Orientation.BOTH;\n\t\t\tthis._drawers.autoSizeMode = AutoSizeMode.CONTENT;\n\t\t\tthis._drawers.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Drawers was not calculated correctly based on the maximum of content width and docked bottom drawer width.\",\n\t\t\t\tBOTTOM_DRAWER_WIDTH, this._drawers.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Drawers was not calculated correctly based on the content height plus docked bottom drawer height.\",\n\t\t\t\tCONTENT_HEIGHT + BOTTOM_DRAWER_HEIGHT, this._drawers.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Drawers was not calculated correctly based on the maximum of content minWidth and docked bottom drawer minWidth.\",\n\t\t\t\tBOTTOM_DRAWER_MIN_WIDTH, this._drawers.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Drawers was not calculated correctly based on the content minHeight plus docked bottom drawer minHeight.\",\n\t\t\t\tCONTENT_MIN_HEIGHT + BOTTOM_DRAWER_MIN_HEIGHT, this._drawers.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeContentWithDockedTopAndBottomDrawer():void\n\t\t{\n\t\t\tthis.addContent();\n\t\t\tthis.addTopDrawer();\n\t\t\tthis.addBottomDrawer();\n\t\t\tthis._drawers.topDrawerDockMode = Orientation.BOTH;\n\t\t\tthis._drawers.bottomDrawerDockMode = Orientation.BOTH;\n\t\t\tthis._drawers.autoSizeMode = AutoSizeMode.CONTENT;\n\t\t\tthis._drawers.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Drawers was not calculated correctly based on the maximum of content width, docked top drawer width, and docked bottom drawer width.\",\n\t\t\t\tTOP_DRAWER_WIDTH, this._drawers.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Drawers was not calculated correctly based on the content height plus docked top drawer height plus docked bottom drawer height.\",\n\t\t\t\tCONTENT_HEIGHT + TOP_DRAWER_HEIGHT + BOTTOM_DRAWER_HEIGHT, this._drawers.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Drawers was not calculated correctly based on the maximum of content minWidth, docked top drawer minWidth, and docked bottom drawer minWidth.\",\n\t\t\t\tBOTTOM_DRAWER_MIN_WIDTH, this._drawers.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Drawers was not calculated correctly based on the content minHeight plus docked top drawer height plus docked bottom drawer minHeight.\",\n\t\t\t\tCONTENT_MIN_HEIGHT + TOP_DRAWER_MIN_HEIGHT +BOTTOM_DRAWER_MIN_HEIGHT, this._drawers.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeContentWithDockedLeftAndRightDrawer():void\n\t\t{\n\t\t\tthis.addContent();\n\t\t\tthis.addRightDrawer();\n\t\t\tthis.addLeftDrawer();\n\t\t\tthis._drawers.rightDrawerDockMode = Orientation.BOTH;\n\t\t\tthis._drawers.leftDrawerDockMode = Orientation.BOTH;\n\t\t\tthis._drawers.autoSizeMode = AutoSizeMode.CONTENT;\n\t\t\tthis._drawers.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Drawers was not calculated correctly based on the content width, plus docked left drawer width, plus docked right drawer width.\",\n\t\t\t\tCONTENT_WIDTH + LEFT_DRAWER_WIDTH + RIGHT_DRAWER_WIDTH, this._drawers.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Drawers was not calculated correctly based on the maximum of content height, docked left drawer height, and docked right drawer height.\",\n\t\t\t\tLEFT_DRAWER_HEIGHT, this._drawers.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Drawers was not calculated correctly based on the content minWidth, plus docked left drawer minWidth, plus docked right drawer minWidth.\",\n\t\t\t\tCONTENT_MIN_WIDTH + LEFT_DRAWER_MIN_WIDTH + RIGHT_DRAWER_MIN_WIDTH, this._drawers.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Drawers was not calculated correctly based on the maximum of content minHeight, docked left drawer height, and docked right drawer minHeight.\",\n\t\t\t\tRIGHT_DRAWER_MIN_HEIGHT, this._drawers.minHeight);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/DrawersTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Drawers;\n\timport feathers.controls.LayoutGroup;\n\n\timport org.flexunit.Assert;\n\timport org.flexunit.async.Async;\n\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\n\tpublic class DrawersTests\n\t{\n\t\tprivate static const OVERLAY_ALPHA:Number = 0.45;\n\t\t\n\t\tprivate var _drawers:Drawers;\n\t\tprivate var _overlay:Quad;\n\t\tprivate var _content:LayoutGroup;\n\t\tprivate var _drawer1:LayoutGroup;\n\t\tprivate var _drawer2:LayoutGroup;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._content = new LayoutGroup();\n\t\t\tthis._content.backgroundSkin = new Quad(200, 150, 0xff00ff);\n\t\t\t\n\t\t\tthis._overlay = new Quad(1, 1, 0x000000);\n\t\t\tthis._overlay.alpha = OVERLAY_ALPHA;\n\t\t\t\n\t\t\tthis._drawer1 = new LayoutGroup();\n\t\t\tthis._drawer1.backgroundSkin = new Quad(125, 100, 0xff0000);\n\n\t\t\tthis._drawer2 = new LayoutGroup();\n\t\t\tthis._drawer2.backgroundSkin = new Quad(90, 130, 0x00ff00);\n\t\t\t\n\t\t\tthis._drawers = new Drawers(this._content);\n\t\t\tthis._drawers.overlaySkin = this._overlay;\n\t\t\tTestFeathers.starlingRoot.addChild(this._drawers);\n\t\t\tthis._drawers.validate();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._drawers.removeFromParent(true);\n\t\t\tthis._drawers = null;\n\t\t\t\n\t\t\tthis._overlay = null;\n\t\t\tthis._content = null;\n\t\t\tthis._drawer1 = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTopDrawerOpen():void\n\t\t{\n\t\t\tthis._drawers.topDrawer = this._drawer1;\n\t\t\tthis._drawers.isTopDrawerOpen = true;\n\t\t\tthis._drawers.validate();\n\n\t\t\tAssert.assertNotNull(\"Drawers topDrawer.parent is incorrectly null when isTopDrawerOpen set to true\", this._drawer1.parent);\n\t\t\tAssert.assertTrue(\"Drawers topDrawer.visible is incorrectly false when isTopDrawerOpen set to true\", this._drawer1.visible);\n\t\t\tAssert.assertNotNull(\"Drawers overlaySkin.parent is incorrectly null when isTopDrawerOpen set to true\", this._overlay.parent);\n\t\t\tAssert.assertTrue(\"Drawers overlaySkin.visible is incorrectly false when isTopDrawerOpen set to true\", this._overlay.visible);\n\t\t\tAssert.assertStrictlyEquals(\"Drawers overlaySkin.alpha has incorrect value when isTopDrawerOpen set to true\",\n\t\t\t\tOVERLAY_ALPHA, this._overlay.alpha);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRightDrawerOpenShowsOverlay():void\n\t\t{\n\t\t\tthis._drawers.rightDrawer = this._drawer1;\n\t\t\tthis._drawers.isRightDrawerOpen = true;\n\t\t\tthis._drawers.validate();\n\n\t\t\tAssert.assertNotNull(\"Drawers rightDrawer.parent is incorrectly null when isRightDrawerOpen set to true\", this._drawer1.parent);\n\t\t\tAssert.assertTrue(\"Drawers rightDrawer.visible is incorrectly false when isRightDrawerOpen set to true\", this._drawer1.visible);\n\t\t\tAssert.assertNotNull(\"Drawers overlaySkin.parent is incorrectly null when isRightDrawerOpen set to true\", this._overlay.parent);\n\t\t\tAssert.assertTrue(\"Drawers overlaySkin.visible is incorrectly false when isRightDrawerOpen set to true\", this._overlay.visible);\n\t\t\tAssert.assertStrictlyEquals(\"Drawers overlaySkin.alpha has incorrect value when isRightDrawerOpen set to true\",\n\t\t\t\tOVERLAY_ALPHA, this._overlay.alpha);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testBottomDrawerOpen():void\n\t\t{\n\t\t\tthis._drawers.bottomDrawer = this._drawer1;\n\t\t\tthis._drawers.isBottomDrawerOpen = true;\n\t\t\tthis._drawers.validate();\n\n\t\t\tAssert.assertNotNull(\"Drawers bottomDrawer.parent is incorrectly null when isBottomDrawerOpen set to true\", this._drawer1.parent);\n\t\t\tAssert.assertTrue(\"Drawers bottomDrawer.visible is incorrectly false when isBottomDrawerOpen set to true\", this._drawer1.visible);\n\t\t\tAssert.assertNotNull(\"Drawers overlaySkin.parent is incorrectly null when isBottomDrawerOpen set to true\", this._overlay.parent);\n\t\t\tAssert.assertTrue(\"Drawers overlaySkin.visible is incorrectly false when isBottomDrawerOpen set to true\", this._overlay.visible);\n\t\t\tAssert.assertStrictlyEquals(\"Drawers overlaySkin.alpha has incorrect value when isBottomDrawerOpen set to true\",\n\t\t\t\tOVERLAY_ALPHA, this._overlay.alpha);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLeftDrawerOpen():void\n\t\t{\n\t\t\tthis._drawers.leftDrawer = this._drawer1;\n\t\t\tthis._drawers.isLeftDrawerOpen = true;\n\t\t\tthis._drawers.validate();\n\n\t\t\tAssert.assertNotNull(\"Drawers leftDrawer.parent is incorrectly null when isLeftDrawerOpen set to true\", this._drawer1.parent);\n\t\t\tAssert.assertTrue(\"Drawers leftDrawer.visible is incorrectly false when isLeftDrawerOpen set to true\", this._drawer1.visible);\n\t\t\tAssert.assertNotNull(\"Drawers overlaySkin.parent is incorrectly null when isLeftDrawerOpen set to true\", this._overlay.parent);\n\t\t\tAssert.assertTrue(\"Drawers overlaySkin.visible is incorrectly false when isLeftDrawerOpen set to true\", this._overlay.visible);\n\t\t\tAssert.assertStrictlyEquals(\"Drawers overlaySkin.alpha has incorrect value when isLeftDrawerOpen set to true\",\n\t\t\t\tOVERLAY_ALPHA, this._overlay.alpha);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetTopDrawerToNullWhileOpen():void\n\t\t{\n\t\t\tthis._drawers.topDrawer = this._drawer1;\n\t\t\tthis._drawers.isTopDrawerOpen = true;\n\t\t\tthis._drawers.validate();\n\t\t\tthis._drawers.topDrawer = null;\n\t\t\tthis._drawers.validate();\n\n\t\t\tAssert.assertNull(\"Drawers topDrawer.parent is incorrectly non-null when topDrawer is set to null\", this._drawer1.parent);\n\t\t\tAssert.assertFalse(\"Drawers overlaySkin.visible is incorrectly true when topDrawer set to null while open\", this._overlay.visible);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetRightDrawerToNullWhileOpen():void\n\t\t{\n\t\t\tthis._drawers.rightDrawer = this._drawer1;\n\t\t\tthis._drawers.isRightDrawerOpen = true;\n\t\t\tthis._drawers.validate();\n\t\t\tthis._drawers.rightDrawer = null;\n\t\t\tthis._drawers.validate();\n\n\t\t\tAssert.assertNull(\"Drawers rightDrawer.parent is incorrectly non-null when rightDrawer is set to null\", this._drawer1.parent);\n\t\t\tAssert.assertFalse(\"Drawers overlaySkin.visible is incorrectly true when rightDrawer set to null while open\", this._overlay.visible);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetBottomDrawerToNullWhileOpen():void\n\t\t{\n\t\t\tthis._drawers.bottomDrawer = this._drawer1;\n\t\t\tthis._drawers.isBottomDrawerOpen = true;\n\t\t\tthis._drawers.validate();\n\t\t\tthis._drawers.bottomDrawer = null;\n\t\t\tthis._drawers.validate();\n\n\t\t\tAssert.assertNull(\"Drawers bottomDrawer.parent is incorrectly non-null when bottomDrawer is set to null\", this._drawer1.parent);\n\t\t\tAssert.assertFalse(\"Drawers overlaySkin.visible is incorrectly true when bottomDrawer set to null while open\", this._overlay.visible);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetLeftDrawerToNullWhileOpen():void\n\t\t{\n\t\t\tthis._drawers.leftDrawer = this._drawer1;\n\t\t\tthis._drawers.isLeftDrawerOpen = true;\n\t\t\tthis._drawers.validate();\n\t\t\tthis._drawers.leftDrawer = null;\n\t\t\tthis._drawers.validate();\n\n\t\t\tAssert.assertNull(\"Drawers leftDrawer.parent is incorrectly non-null when leftDrawer is set to null\", this._drawer1.parent);\n\t\t\tAssert.assertFalse(\"Drawers overlaySkin.visible is incorrectly true when leftDrawer set to null while open\", this._overlay.visible);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testToggleTopDrawerOpen():void\n\t\t{\n\t\t\tvar hasDispatchedOpenEvent:Boolean = false;\n\t\t\tthis._drawers.topDrawer = this._drawer1;\n\t\t\tthis._drawers.addEventListener(Event.OPEN, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedOpenEvent = true;\n\t\t\t});\n\t\t\tthis._drawers.toggleTopDrawer(0.2);\n\t\t\tthis._drawers.validate();\n\t\t\tAssert.assertFalse(\"Drawers Event.OPEN was incorrectly dispatched before the animation completed\", hasDispatchedOpenEvent);\n\t\t\tvar drawers:Drawers = this._drawers;\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertTrue(\"Drawers Event.OPEN was not dispatched after toggleTopDrawer()\", hasDispatchedOpenEvent);\n\t\t\t\tAssert.assertTrue(\"Drawers isTopDrawerOpen is incorrectly false after toggleTopDrawer()\", drawers.isTopDrawerOpen);\n\t\t\t}, 300);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testToggleTopDrawerClose():void\n\t\t{\n\t\t\tvar hasDispatchedCloseEvent:Boolean = false;\n\t\t\tthis._drawers.topDrawer = this._drawer1;\n\t\t\tthis._drawers.addEventListener(Event.CLOSE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedCloseEvent = true;\n\t\t\t});\n\t\t\tthis._drawers.isTopDrawerOpen = true;\n\t\t\tthis._drawers.validate();\n\t\t\tthis._drawers.toggleTopDrawer(0.2);\n\t\t\tthis._drawers.validate();\n\t\t\tAssert.assertFalse(\"Drawers Event.CLOSE was incorrectly dispatched before the animation completed\", hasDispatchedCloseEvent);\n\t\t\tvar drawers:Drawers = this._drawers;\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertTrue(\"Drawers Event.CLOSE was not dispatched after toggleTopDrawer()\", hasDispatchedCloseEvent);\n\t\t\t\tAssert.assertFalse(\"Drawers isTopDrawerOpen is incorrectly true after toggleTopDrawer()\", drawers.isTopDrawerOpen);\n\t\t\t}, 300);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testToggleRightDrawerOpen():void\n\t\t{\n\t\t\tvar hasDispatchedOpenEvent:Boolean = false;\n\t\t\tthis._drawers.rightDrawer = this._drawer1;\n\t\t\tthis._drawers.addEventListener(Event.OPEN, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedOpenEvent = true;\n\t\t\t});\n\t\t\tthis._drawers.toggleRightDrawer(0.2);\n\t\t\tthis._drawers.validate();\n\t\t\tAssert.assertFalse(\"Drawers Event.OPEN was incorrectly dispatched before the animation completed\", hasDispatchedOpenEvent);\n\t\t\tvar drawers:Drawers = this._drawers;\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertTrue(\"Drawers Event.OPEN was not dispatched after toggleRightDrawer()\", hasDispatchedOpenEvent);\n\t\t\t\tAssert.assertTrue(\"Drawers isRightDrawerOpen is incorrectly false after toggleRightDrawer()\", drawers.isRightDrawerOpen);\n\t\t\t}, 300);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testToggleRightDrawerClose():void\n\t\t{\n\t\t\tvar hasDispatchedCloseEvent:Boolean = false;\n\t\t\tthis._drawers.rightDrawer = this._drawer1;\n\t\t\tthis._drawers.addEventListener(Event.CLOSE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedCloseEvent = true;\n\t\t\t});\n\t\t\tthis._drawers.isRightDrawerOpen = true;\n\t\t\tthis._drawers.validate();\n\t\t\tthis._drawers.toggleRightDrawer(0.2);\n\t\t\tthis._drawers.validate();\n\t\t\tAssert.assertFalse(\"Drawers Event.CLOSE was incorrectly dispatched before the animation completed\", hasDispatchedCloseEvent);\n\t\t\tvar drawers:Drawers = this._drawers;\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertTrue(\"Drawers Event.CLOSE was not dispatched after toggleRightDrawer()\", hasDispatchedCloseEvent);\n\t\t\t\tAssert.assertFalse(\"Drawers isRightDrawerOpen is incorrectly true after toggleRightDrawer()\", drawers.isRightDrawerOpen);\n\t\t\t}, 300);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testToggleBottomDrawerOpen():void\n\t\t{\n\t\t\tvar hasDispatchedOpenEvent:Boolean = false;\n\t\t\tthis._drawers.bottomDrawer = this._drawer1;\n\t\t\tthis._drawers.addEventListener(Event.OPEN, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedOpenEvent = true;\n\t\t\t});\n\t\t\tthis._drawers.toggleBottomDrawer(0.2);\n\t\t\tthis._drawers.validate();\n\t\t\tAssert.assertFalse(\"Drawers Event.OPEN was incorrectly dispatched before the animation completed\", hasDispatchedOpenEvent);\n\t\t\tvar drawers:Drawers = this._drawers;\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertTrue(\"Drawers Event.OPEN was not dispatched after toggleBottomDrawer()\", hasDispatchedOpenEvent);\n\t\t\t\tAssert.assertTrue(\"Drawers isBottomDrawerOpen is incorrectly false after toggleBottomDrawer()\", drawers.isBottomDrawerOpen);\n\t\t\t}, 300);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testToggleBottomDrawerClose():void\n\t\t{\n\t\t\tvar hasDispatchedCloseEvent:Boolean = false;\n\t\t\tthis._drawers.bottomDrawer = this._drawer1;\n\t\t\tthis._drawers.addEventListener(Event.CLOSE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedCloseEvent = true;\n\t\t\t});\n\t\t\tthis._drawers.isBottomDrawerOpen = true;\n\t\t\tthis._drawers.validate();\n\t\t\tthis._drawers.toggleBottomDrawer(0.2);\n\t\t\tthis._drawers.validate();\n\t\t\tAssert.assertFalse(\"Drawers Event.CLOSE was incorrectly dispatched before the animation completed\", hasDispatchedCloseEvent);\n\t\t\tvar drawers:Drawers = this._drawers;\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertTrue(\"Drawers Event.CLOSE was not dispatched after toggleBottomDrawer()\", hasDispatchedCloseEvent);\n\t\t\t\tAssert.assertFalse(\"Drawers isBottomDrawerOpen is incorrectly true after toggleBottomDrawer()\", drawers.isBottomDrawerOpen);\n\t\t\t}, 300);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testToggleLeftDrawerOpen():void\n\t\t{\n\t\t\tvar hasDispatchedOpenEvent:Boolean = false;\n\t\t\tthis._drawers.leftDrawer = this._drawer1;\n\t\t\tthis._drawers.addEventListener(Event.OPEN, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedOpenEvent = true;\n\t\t\t});\n\t\t\tthis._drawers.toggleLeftDrawer(0.2);\n\t\t\tthis._drawers.validate();\n\t\t\tAssert.assertFalse(\"Drawers Event.OPEN was incorrectly dispatched before the animation completed\", hasDispatchedOpenEvent);\n\t\t\tvar drawers:Drawers = this._drawers;\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertTrue(\"Drawers Event.OPEN was not dispatched after toggleLeftDrawer()\", hasDispatchedOpenEvent);\n\t\t\t\tAssert.assertTrue(\"Drawers isLeftDrawerOpen is incorrectly false after toggleLeftDrawer()\", drawers.isLeftDrawerOpen);\n\t\t\t}, 300);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testToggleLeftDrawerClose():void\n\t\t{\n\t\t\tvar hasDispatchedCloseEvent:Boolean = false;\n\t\t\tthis._drawers.leftDrawer = this._drawer1;\n\t\t\tthis._drawers.addEventListener(Event.CLOSE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedCloseEvent = true;\n\t\t\t});\n\t\t\tthis._drawers.isLeftDrawerOpen = true;\n\t\t\tthis._drawers.validate();\n\t\t\tthis._drawers.toggleLeftDrawer(0.2);\n\t\t\tthis._drawers.validate();\n\t\t\tAssert.assertFalse(\"Drawers Event.CLOSE was incorrectly dispatched before the animation completed\", hasDispatchedCloseEvent);\n\t\t\tvar drawers:Drawers = this._drawers;\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertTrue(\"Drawers Event.CLOSE was not dispatched after toggleLeftDrawer()\", hasDispatchedCloseEvent);\n\t\t\t\tAssert.assertFalse(\"Drawers isLeftDrawerOpen is incorrectly true after toggleLeftDrawer()\", drawers.isLeftDrawerOpen);\n\t\t\t}, 300);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testOpenTopDrawerClosesOtherDrawers():void\n\t\t{\n\t\t\tthis._drawers.leftDrawer = this._drawer1;\n\t\t\tthis._drawers.topDrawer = this._drawer2;\n\t\t\tthis._drawers.isLeftDrawerOpen = true;\n\t\t\tthis._drawers.validate();\n\t\t\tthis._drawers.isTopDrawerOpen = true;\n\t\t\tAssert.assertFalse(\"Drawers isLeftDrawerOpen should be false after isTopDrawerOpen is set to true\", this._drawers.isLeftDrawerOpen);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testOpenRightDrawerClosesOtherDrawers():void\n\t\t{\n\t\t\tthis._drawers.leftDrawer = this._drawer1;\n\t\t\tthis._drawers.rightDrawer = this._drawer2;\n\t\t\tthis._drawers.isLeftDrawerOpen = true;\n\t\t\tthis._drawers.validate();\n\t\t\tthis._drawers.isRightDrawerOpen = true;\n\t\t\tAssert.assertFalse(\"Drawers isLeftDrawerOpen should be false after isRightDrawerOpen is set to true\", this._drawers.isLeftDrawerOpen);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testOpenBottomDrawerClosesOtherDrawers():void\n\t\t{\n\t\t\tthis._drawers.leftDrawer = this._drawer1;\n\t\t\tthis._drawers.bottomDrawer = this._drawer2;\n\t\t\tthis._drawers.isLeftDrawerOpen = true;\n\t\t\tthis._drawers.validate();\n\t\t\tthis._drawers.isBottomDrawerOpen = true;\n\t\t\tAssert.assertFalse(\"Drawers isLeftDrawerOpen should be false after isBottomDrawerOpen is set to true\", this._drawers.isLeftDrawerOpen);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testOpenLeftDrawerClosesOtherDrawers():void\n\t\t{\n\t\t\tthis._drawers.leftDrawer = this._drawer1;\n\t\t\tthis._drawers.topDrawer = this._drawer2;\n\t\t\tthis._drawers.isTopDrawerOpen = true;\n\t\t\tthis._drawers.validate();\n\t\t\tthis._drawers.isLeftDrawerOpen = true;\n\t\t\tAssert.assertFalse(\"Drawers isTopDrawerOpen should be false after isLeftDrawerOpen is set to true\", this._drawers.isTopDrawerOpen);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testToggleTopDrawerClosesOtherDrawers():void\n\t\t{\n\t\t\tthis._drawers.leftDrawer = this._drawer1;\n\t\t\tthis._drawers.topDrawer = this._drawer2;\n\t\t\tthis._drawers.isLeftDrawerOpen = true;\n\t\t\tthis._drawers.validate();\n\t\t\tthis._drawers.toggleTopDrawer();\n\t\t\tAssert.assertFalse(\"Drawers isLeftDrawerOpen should be false after toggleTopDrawer() opens the drawer\", this._drawers.isLeftDrawerOpen);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testToggleRightDrawerClosesOtherDrawers():void\n\t\t{\n\t\t\tthis._drawers.leftDrawer = this._drawer1;\n\t\t\tthis._drawers.rightDrawer = this._drawer2;\n\t\t\tthis._drawers.isLeftDrawerOpen = true;\n\t\t\tthis._drawers.validate();\n\t\t\tthis._drawers.toggleRightDrawer();\n\t\t\tAssert.assertFalse(\"Drawers isLeftDrawerOpen should be false after toggleRightDrawer() opens the drawer\", this._drawers.isLeftDrawerOpen);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testToggleBottomDrawerClosesOtherDrawers():void\n\t\t{\n\t\t\tthis._drawers.leftDrawer = this._drawer1;\n\t\t\tthis._drawers.bottomDrawer = this._drawer2;\n\t\t\tthis._drawers.isLeftDrawerOpen = true;\n\t\t\tthis._drawers.validate();\n\t\t\tthis._drawers.toggleBottomDrawer();\n\t\t\tAssert.assertFalse(\"Drawers isLeftDrawerOpen should be false after toggleBottomDrawer() opens the drawer\", this._drawers.isLeftDrawerOpen);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testToggleLeftDrawerClosesOtherDrawers():void\n\t\t{\n\t\t\tthis._drawers.leftDrawer = this._drawer1;\n\t\t\tthis._drawers.topDrawer = this._drawer2;\n\t\t\tthis._drawers.isTopDrawerOpen = true;\n\t\t\tthis._drawers.validate();\n\t\t\tthis._drawers.toggleLeftDrawer();\n\t\t\tAssert.assertFalse(\"Drawers isTopDrawerOpen should be false after toggleLeftDrawer() opens the drawer\", this._drawers.isTopDrawerOpen);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/DropDownPopUpContentManagerTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.popups.DropDownPopUpContentManager;\n\timport feathers.core.PopUpManager;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.display.Sprite;\n\timport starling.events.Event;\n\n\tpublic class DropDownPopUpContentManagerTests\n\t{\n\t\tprivate static const OVERLAY_NAME:String = \"DropDownPopUpContentManagerOverlay\";\n\t\t\n\t\tprivate var _popUp:DisplayObject;\n\t\tprivate var _customRoot:Sprite;\n\t\tprivate var _source:Quad;\n\t\tprivate var _popUpContentManager:DropDownPopUpContentManager;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._source = new Quad(200, 180, 0x00ff00);\n\t\t\tTestFeathers.starlingRoot.addChild(this._source);\n\n\t\t\tthis._customRoot = new Sprite();\n\t\t\tTestFeathers.starlingRoot.addChild(this._customRoot);\n\t\t\tPopUpManager.root = this._customRoot;\n\n\t\t\tthis._popUpContentManager = new DropDownPopUpContentManager();\n\t\t\tthis._popUpContentManager.openCloseDuration = 0;\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._source.removeFromParent(true);\n\t\t\tthis._source = null;\n\n\t\t\tthis._customRoot.removeFromParent(true);\n\t\t\tthis._customRoot = null;\n\n\t\t\tif(this._popUp)\n\t\t\t{\n\t\t\t\tthis._popUp.removeFromParent(true);\n\t\t\t\tthis._popUp = null;\n\t\t\t}\n\n\t\t\tPopUpManager.root = TestFeathers.starlingRoot.stage;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\tprivate function createSimplePopUp():DisplayObject\n\t\t{\n\t\t\tvar simplePopUp:Quad = new Quad(100, 150, 0xff00ff);\n\t\t\treturn simplePopUp;\n\t\t}\n\n\t\tprivate function createOverlay():DisplayObject\n\t\t{\n\t\t\tvar overlay:Quad = new Quad(1, 1, 0x000000);\n\t\t\toverlay.alpha = 0.5;\n\t\t\toverlay.name = OVERLAY_NAME;\n\t\t\treturn overlay;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testOpen():void\n\t\t{\n\t\t\tthis._popUp = this.createSimplePopUp();\n\t\t\tvar openDispatched:Boolean = false;\n\t\t\tthis._popUpContentManager.addEventListener(Event.OPEN, function(event:Event):void\n\t\t\t{\n\t\t\t\topenDispatched = true;\n\t\t\t});\n\t\t\tthis._popUpContentManager.open(this._popUp, this._source);\n\t\t\tAssert.assertNotNull(\"DropDownPopUpContentManager content parent should not be null.\", this._popUp.parent);\n\t\t\tAssert.assertTrue(\"DropDownPopUpContentManager did not dispatch Event.OPEN.\", openDispatched);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testClose():void\n\t\t{\n\t\t\tthis._popUp = this.createSimplePopUp();\n\t\t\tvar closeDispatched:Boolean = false;\n\t\t\tthis._popUpContentManager.addEventListener(Event.CLOSE, function(event:Event):void\n\t\t\t{\n\t\t\t\tcloseDispatched = true;\n\t\t\t});\n\t\t\tthis._popUpContentManager.open(this._popUp, this._source);\n\t\t\tthis._popUpContentManager.close();\n\t\t\tAssert.assertNull(\"DropDownPopUpContentManager content parent should be null.\", this._popUp.parent);\n\t\t\tAssert.assertTrue(\"DropDownPopUpContentManager did not dispatch Event.CLOSE.\", closeDispatched);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testOverlayFactory():void\n\t\t{\n\t\t\tthis._popUp = this.createSimplePopUp();\n\t\t\tthis._popUpContentManager.isModal = true;\n\t\t\tthis._popUpContentManager.overlayFactory = this.createOverlay;\n\t\t\tthis._popUpContentManager.open(this._popUp, this._source);\n\t\t\tvar overlay:DisplayObject = this._customRoot.getChildByName(OVERLAY_NAME);\n\t\t\tAssert.assertNotNull(\"DropDownPopUpContentManager overlayFactory result not found.\", overlay);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/FlowLayoutTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.layout.FlowLayout;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.LayoutBoundsResult;\n\timport feathers.layout.ViewPortBounds;\n\n\timport flash.geom.Point;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\n\tpublic class FlowLayoutTests\n\t{\n\t\tprivate static const PADDING_TOP:Number = 6;\n\t\tprivate static const PADDING_RIGHT:Number = 8;\n\t\tprivate static const PADDING_BOTTOM:Number = 2;\n\t\tprivate static const PADDING_LEFT:Number = 10;\n\t\tprivate static const GAP:Number = 5;\n\t\tprivate static const CHILD1_WIDTH:Number = 200;\n\t\tprivate static const CHILD1_HEIGHT:Number = 100;\n\t\tprivate static const CHILD2_WIDTH:Number = 150;\n\t\tprivate static const CHILD2_HEIGHT:Number = 75;\n\t\t\n\t\tprivate var _layout:FlowLayout;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._layout = new FlowLayout();\n\t\t\tthis._layout.useVirtualLayout = false;\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._layout = null;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithNoItems():void\n\t\t{\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult viewPortWidth not equal to 0 with no items.\", 0, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult viewPortHeight not equal to 0 with no items.\", 0, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult contentWidth not equal to 0 with no items.\", 0, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult contentHeight not equal to 0 with no items.\", 0, result.contentHeight);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult contentX not equal to 0 with no items.\", 0, result.contentX);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult contentY not equal to 0 with no items.\", 0, result.contentY);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithNoItems():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(0, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout measureViewPort width not equal to 0 with no items.\", 0, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout measureViewPort height not equal to 0 with no items.\", 0, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithPaddingGapAndNoItems():void\n\t\t{\n\t\t\tthis._layout.paddingTop = PADDING_TOP;\n\t\t\tthis._layout.paddingRight = PADDING_RIGHT;\n\t\t\tthis._layout.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._layout.paddingLeft = PADDING_LEFT;\n\t\t\tthis._layout.gap = GAP;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult viewPortWidth not equal to sum of left and right padding with no items.\", PADDING_LEFT + PADDING_RIGHT, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult viewPortHeight not equal to sum of top and bottom padding with no items.\", PADDING_TOP + PADDING_BOTTOM, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult contentWidth not equal to sum of left and right padding with no items.\", PADDING_LEFT + PADDING_RIGHT, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult contentHeight not equal to sum of top and bottom padding with no items.\", PADDING_TOP + PADDING_BOTTOM, result.contentHeight);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult contentX not equal to 0 with padding and no items.\", 0, result.contentX);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult contentY not equal to 0 with padding and no items.\", 0, result.contentY);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithPaddingGapAndNoItems():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.paddingTop = PADDING_TOP;\n\t\t\tthis._layout.paddingRight = PADDING_RIGHT;\n\t\t\tthis._layout.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._layout.paddingLeft = PADDING_LEFT;\n\t\t\tthis._layout.gap = GAP;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(0, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout measureViewPort x not equal to sum of left and right padding with no items.\", PADDING_LEFT + PADDING_RIGHT, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout measureViewPort y not equal to sum of top and bottom padding with no items.\", PADDING_TOP + PADDING_BOTTOM, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithOneChild():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult viewPortWidth not equal to child width with one item.\", CHILD1_WIDTH, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult viewPortHeight not equal to child height with one item.\", CHILD1_HEIGHT, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult contentWidth not equal to child width with one item.\", CHILD1_WIDTH, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult contentHeight not equal to child height with one item.\", CHILD1_HEIGHT, result.contentHeight);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult contentX not equal to 0 with one item.\", 0, result.contentX);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult contentY not equal to 0 with one item.\", 0, result.contentY);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithOneChild():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout measureViewPort x not equal to child width with one item.\", CHILD1_WIDTH, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout measureViewPort y not equal to child height with and one item.\", CHILD1_HEIGHT, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithPaddingGapAndOneChild():void\n\t\t{\n\t\t\tthis._layout.paddingTop = PADDING_TOP;\n\t\t\tthis._layout.paddingRight = PADDING_RIGHT;\n\t\t\tthis._layout.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._layout.paddingLeft = PADDING_LEFT;\n\t\t\tthis._layout.gap = GAP;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult viewPortWidth not equal to sum of left and right padding and width of child.\", CHILD1_WIDTH + PADDING_LEFT + PADDING_RIGHT, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult viewPortHeight not equal to sum of top and bottom padding and height of child.\", CHILD1_HEIGHT + PADDING_TOP + PADDING_BOTTOM, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult contentWidth not equal to sum of left and right padding and width of child.\", CHILD1_WIDTH + PADDING_LEFT + PADDING_RIGHT, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult contentHeight not equal to sum of top and bottom padding and height of child.\", CHILD1_HEIGHT + PADDING_TOP + PADDING_BOTTOM, result.contentHeight);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult contentX not equal to 0 with one item and padding.\", 0, result.contentX);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult contentY not equal to 0 with one item and padding.\", 0, result.contentY);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithPaddingGapAndOneChild():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tthis._layout.paddingTop = PADDING_TOP;\n\t\t\tthis._layout.paddingRight = PADDING_RIGHT;\n\t\t\tthis._layout.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._layout.paddingLeft = PADDING_LEFT;\n\t\t\tthis._layout.gap = GAP;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout measureViewPort x not equal to sum of left and right padding and width of child.\", CHILD1_WIDTH + PADDING_LEFT + PADDING_RIGHT, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout measureViewPort y not equal to sum of top and bottom padding and height of child.\", CHILD1_HEIGHT + PADDING_TOP + PADDING_BOTTOM, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithTwoChildren():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar item2:Quad = new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tvar maxChildHeight:Number = Math.max(CHILD1_HEIGHT, CHILD2_HEIGHT);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult viewPortWidth not equal to sum of item widths.\", CHILD1_WIDTH + CHILD2_WIDTH, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult viewPortHeight not equal to max height of items.\", maxChildHeight, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult contentWidth not equal to sum of item widths.\", CHILD1_WIDTH + CHILD2_WIDTH, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult contentHeight not equal to max height of items.\", maxChildHeight, result.contentHeight);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult contentX not equal to 0 with padding and two items.\", 0, result.contentX);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult contentY not equal to 0 with padding and two items.\", 0, result.contentY);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithTwoChildren():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(2, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout measureViewPort x not equal to typical item width multiplied by the number of items.\", 2 * CHILD1_WIDTH, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout measureViewPort y not equal to height of typical item.\", CHILD1_HEIGHT, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithPaddingGapAndTwoChildren():void\n\t\t{\n\t\t\tthis._layout.paddingTop = PADDING_TOP;\n\t\t\tthis._layout.paddingRight = PADDING_RIGHT;\n\t\t\tthis._layout.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._layout.paddingLeft = PADDING_LEFT;\n\t\t\tthis._layout.gap = GAP;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar item2:Quad = new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tvar maxChildHeight:Number = Math.max(CHILD1_HEIGHT, CHILD2_HEIGHT);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult viewPortWidth not equal to sum of item widths plus left and right padding and gap.\", CHILD1_WIDTH + CHILD2_WIDTH + PADDING_LEFT + PADDING_RIGHT + GAP, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult viewPortHeight not equal to max height of items plus top and bottom padding.\", maxChildHeight + PADDING_TOP + PADDING_BOTTOM, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult contentWidth not equal to sum of item widths plus left and right padding and gap.\", CHILD1_WIDTH + CHILD2_WIDTH + PADDING_LEFT + PADDING_RIGHT + GAP, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult contentHeight not equal to max height of items plus top and bottom padding.\", maxChildHeight + PADDING_TOP + PADDING_BOTTOM, result.contentHeight);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult contentX not equal to 0 with two items plus padding and gap.\", 0, result.contentX);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutBoundsResult contentY not equal to 0 with two items plus padding and gap.\", 0, result.contentY);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithPaddingGapAndTwoChildren():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.paddingTop = PADDING_TOP;\n\t\t\tthis._layout.paddingRight = PADDING_RIGHT;\n\t\t\tthis._layout.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._layout.paddingLeft = PADDING_LEFT;\n\t\t\tthis._layout.gap = GAP;\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(2, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout measureViewPort x not equal to typical item width multiplied by item count plus left and right padding and gap.\", 2 * CHILD1_WIDTH + PADDING_LEFT + PADDING_RIGHT + GAP, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout measureViewPort y not equal to max height of items plus top and bottom padding.\", CHILD1_HEIGHT + PADDING_TOP + PADDING_BOTTOM, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithMaxWidthLargerThanItems():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar item2:Quad = new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.maxWidth = CHILD1_WIDTH + (CHILD2_WIDTH / 2);\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tvar maxChildWidth:Number = Math.max(CHILD1_WIDTH, CHILD2_WIDTH);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutResult viewPortWidth not equal to max child width when flow to second row.\", maxChildWidth, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutResult viewPortHeight not equal to sum of child heights when flow to second row.\", CHILD1_HEIGHT + CHILD2_HEIGHT, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutResult contentWidth not equal to max child width when flow to second row.\", maxChildWidth, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutResult contentHeight not equal to sum of child heights when flow to second row.\", CHILD1_HEIGHT + CHILD2_HEIGHT, result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithMaxWidthLargerThanItems():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.maxWidth = CHILD1_WIDTH + (CHILD2_WIDTH / 2);\n\t\t\tvar result:Point = this._layout.measureViewPort(2, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout measureViewPort x not equal to typical item width when flow to second row.\", CHILD1_WIDTH, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout measureViewPort y not equal to typical item height multiplied by item count when flow to second row.\", 2 * CHILD1_HEIGHT, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithMaxWidthSmallerThanItems():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar item2:Quad = new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.maxWidth = Math.min(CHILD1_WIDTH, CHILD2_WIDTH) / 2;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tvar maxChildWidth:Number = Math.max(CHILD1_WIDTH, CHILD2_WIDTH);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutResult viewPortWidth not equal to maxWidth with larger children.\", bounds.maxWidth, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutResult viewPortHeight not equal to sum of child heights when flow to second row.\", CHILD1_HEIGHT + CHILD2_HEIGHT, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutResult contentWidth not equal to maximum child width with larger children.\", maxChildWidth, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout layout LayoutResult contentHeight not equal to sum of child heights when flow to second row.\", CHILD1_HEIGHT + CHILD2_HEIGHT, result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithMaxWidthSmallerThanItems():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.maxWidth = Math.min(CHILD1_WIDTH, CHILD2_WIDTH) / 2;\n\t\t\tvar result:Point = this._layout.measureViewPort(2, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout measureViewPort x not equal to maxWidth with larger children.\", bounds.maxWidth, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout measureViewPort y not equal to typical item height multiplied by item count when flow to second row.\", 2 * CHILD1_HEIGHT, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCenterAlignmentWithExplicitWidthLargerThanSumOfItems():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar item2:Quad = new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 2 * CHILD1_WIDTH + CHILD2_WIDTH;\n\t\t\tthis._layout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tvar totalChildWidth:Number = CHILD1_WIDTH + CHILD2_WIDTH;\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout with HorizontalAlign.CENTER set first child.x incorrectly\", Math.round((bounds.explicitWidth - totalChildWidth) / 2), item1.x);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout with HorizontalAlign.CENTER set second child.x incorrectly\", Math.round((bounds.explicitWidth - totalChildWidth) / 2) + CHILD1_WIDTH, item2.x);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCenterAlignmentWithMaxWidthLargerThanItems():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar item2:Quad = new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.maxWidth = CHILD1_WIDTH + (CHILD2_WIDTH / 2);\n\t\t\tthis._layout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tvar maxChildWidth:Number = Math.max(CHILD1_WIDTH, CHILD2_WIDTH);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout with HorizontalAlign.CENTER set first child.x incorrectly\", Math.round((maxChildWidth - CHILD1_WIDTH) / 2), item1.x);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout with HorizontalAlign.CENTER set second child.x incorrectly\", Math.round((maxChildWidth - CHILD2_WIDTH) / 2), item2.x);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRightAlignmentWithMaxWidthLargerThanItems():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar item2:Quad = new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.maxWidth = CHILD1_WIDTH + (CHILD2_WIDTH / 2);\n\t\t\tthis._layout.horizontalAlign = HorizontalAlign.RIGHT;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tvar maxChildWidth:Number = Math.max(CHILD1_WIDTH, CHILD2_WIDTH);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout with HorizontalAlign.RIGHT set first child.x incorrectly\", maxChildWidth - CHILD1_WIDTH, item1.x);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout with HorizontalAlign.RIGHT set second child.x incorrectly\", maxChildWidth - CHILD2_WIDTH, item2.x);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRightAlignmentWithMinAndMaxWidthLargerThanItems():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar item2:Quad = new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.minWidth = CHILD1_WIDTH + (CHILD2_WIDTH / 4);\n\t\t\tbounds.maxWidth = CHILD1_WIDTH + (CHILD2_WIDTH / 2);\n\t\t\tthis._layout.horizontalAlign = HorizontalAlign.RIGHT;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tvar maxChildWidth:Number = Math.max(CHILD1_WIDTH, CHILD2_WIDTH);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout with HorizontalAlign.RIGHT set first child.x incorrectly\", bounds.minWidth - CHILD1_WIDTH, item1.x);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout with HorizontalAlign.RIGHT set second child.x incorrectly\", bounds.minWidth - CHILD2_WIDTH, item2.x);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRightAlignmentWithExplicitWidthInBetweenItemWidths():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar item2:Quad = new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar explicitWidth:Number = (CHILD1_WIDTH + CHILD2_WIDTH) / 2;\n\t\t\tbounds.explicitWidth = explicitWidth;\n\t\t\tthis._layout.horizontalAlign = HorizontalAlign.RIGHT;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout with HorizontalAlign.RIGHT and larger child than explicitWidth calculated contentWidth incorrectly\",\n\t\t\t\tCHILD1_WIDTH, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout with HorizontalAlign.RIGHT and larger child than explicitWidth calculated viewPortWidth incorrectly\",\n\t\t\t\texplicitWidth, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout with HorizontalAlign.RIGHT and larger child than explicitWidth calculated larger child x incorrectly\",\n\t\t\t\t0, item1.x);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout with HorizontalAlign.RIGHT and larger child than explicitWidth calculated smaller child x incorrectly\",\n\t\t\t\tCHILD1_WIDTH - item2.width, item2.x);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRightAlignmentWithExplicitWidthLargerThanSumOfItems():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar item2:Quad = new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 2 * CHILD1_WIDTH + CHILD2_WIDTH;\n\t\t\tthis._layout.horizontalAlign = HorizontalAlign.RIGHT;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tvar totalChildWidth:Number = CHILD1_WIDTH + CHILD2_WIDTH;\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout with HorizontalAlign.RIGHT set first child.x incorrectly\", bounds.explicitWidth - totalChildWidth, item1.x);\n\t\t\tAssert.assertStrictlyEquals(\"FlowLayout with HorizontalAlign.RIGHT set second child.x incorrectly\", bounds.explicitWidth - totalChildWidth + CHILD1_WIDTH, item2.x);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/FocusIndicatorTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.BasicButton;\n\timport feathers.controls.ButtonState;\n\timport feathers.events.FeathersEventType;\n\timport feathers.tests.supportClasses.DisposeFlagQuad;\n\n\timport flash.geom.Point;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\timport feathers.core.FeathersControl;\n\n\tpublic class FocusIndicatorTests\n\t{\n\t\tprivate var _control:CustomFocusControl;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._control = new CustomFocusControl();\n\t\t\tTestFeathers.starlingRoot.addChild(this._control);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._control.removeFromParent(true);\n\t\t\tthis._control = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSkinsDisposed():void\n\t\t{\n\t\t\tvar focusIndicatorSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._control.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tthis._control.validate();\n\t\t\tthis._control.dispose();\n\t\t\tAssert.assertTrue(\"focusIndicatorSkin not disposed when IFocusDisplayObject disposed.\", focusIndicatorSkin.isDisposed);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSkinsRemovedWhenSetToNull():void\n\t\t{\n\t\t\tvar focusIndicatorSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._control.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tthis._control.validate();\n\t\t\tthis._control.focusIndicatorSkin = null;\n\t\t\t//should not need to validate here\n\t\t\tthis._control.dispose();\n\t\t\tAssert.assertFalse(\"Removed focusIndicatorSkin incorrectly disposed when Button disposed.\", focusIndicatorSkin.isDisposed);\n\t\t\tfocusIndicatorSkin.dispose();\n\t\t}\n\t}\n}\n\nimport feathers.core.IFocusDisplayObject;\nimport feathers.core.FeathersControl;\n\nclass CustomFocusControl extends FeathersControl implements IFocusDisplayObject\n{\n\tpublic function CustomFocusControl()\n\t{\n\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/FocusManagerEnabledTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.core.FocusManager;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Stage;\n\n\tpublic class FocusManagerEnabledTests\n\t{\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, false);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testIsEnabledForStageWhenNotEnabled():void\n\t\t{\n\t\t\tvar stage:Stage = TestFeathers.starlingRoot.stage;\n\t\t\tAssert.assertFalse(\"FocusManager incorrectly enabled for stage\", FocusManager.isEnabledForStage(stage));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testIsEnabledForStageWhenEnabled():void\n\t\t{\n\t\t\tvar stage:Stage = TestFeathers.starlingRoot.stage;\n\t\t\tFocusManager.setEnabledForStage(stage, true);\n\t\t\tAssert.assertTrue(\"FocusManager incorrectly disabled for stage\", FocusManager.isEnabledForStage(stage));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNotNullWhenEnabled():void\n\t\t{\n\t\t\tvar stage:Stage = TestFeathers.starlingRoot.stage;\n\t\t\tFocusManager.setEnabledForStage(stage, true);\n\t\t\tAssert.assertNotNull(\"getFocusManagerForStage() incorrectly returns null when enabled\", FocusManager.getFocusManagerForStage(stage));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/FocusManagerTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Button;\n\timport feathers.core.FocusManager;\n\timport feathers.events.FeathersEventType;\n\n\timport flash.events.FocusEvent;\n\timport flash.ui.Keyboard;\n\n\timport org.flexunit.Assert;\n\n\timport starling.core.Starling;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\n\tpublic class FocusManagerTests\n\t{\n\t\tprivate var _button:Button;\n\t\tprivate var _button2:Button;\n\t\t\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, true);\n\t\t\t\n\t\t\tthis._button = new Button();\n\t\t\tthis._button.label = \"Click Me\";\n\t\t\tthis._button.defaultSkin = new Quad(200, 200);\n\t\t\tTestFeathers.starlingRoot.addChild(this._button);\n\n\t\t\tthis._button2 = new Button();\n\t\t\tthis._button2.label = \"Click Me Too\";\n\t\t\tthis._button2.defaultSkin = new Quad(200, 200);\n\t\t\tthis._button2.y = 210;\n\t\t\tTestFeathers.starlingRoot.addChild(this._button2);\n\t\t}\n\t\t\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._button.removeFromParent(true);\n\t\t\tthis._button = null;\n\t\t\tthis._button2.removeFromParent(true);\n\t\t\tthis._button2 = null;\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, false);\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInjectFocusManager():void\n\t\t{\n\t\t\tAssert.assertFalse(\"focusManager property incorrectly returns null\", this._button.focusManager === null);\n\t\t\tAssert.assertStrictlyEquals(\"focusManager property does not match getFocusManagerForStage()\", this._button.focusManager, FocusManager.getFocusManagerForStage(this._button.stage));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChangeFocus():void\n\t\t{\n\t\t\tthis._button.focusManager.focus = this._button;\n\t\t\tAssert.assertStrictlyEquals(\"Wrong value returned by focus property of FocusManager\", this._button.focusManager.focus, this._button);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDispatchFocusInEvent():void\n\t\t{\n\t\t\tvar hasDispatchedFocusIn:Boolean = false;\n\t\t\tthis._button.addEventListener(FeathersEventType.FOCUS_IN, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedFocusIn = true;\n\t\t\t});\n\t\t\tthis._button.focusManager.focus = this._button;\n\t\t\tAssert.assertTrue(\"FeathersEventType.FOCUS_IN was not dispatched after setting focus property of FocusManager\", hasDispatchedFocusIn);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDispatchFocusOutEvent():void\n\t\t{\n\t\t\tvar hasDispatchedFocusOut:Boolean = false;\n\t\t\tthis._button.addEventListener(FeathersEventType.FOCUS_OUT, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedFocusOut = true;\n\t\t\t});\n\t\t\tthis._button.focusManager.focus = this._button;\n\t\t\tthis._button.focusManager.focus = null;\n\t\t\tAssert.assertTrue(\"FeathersEventType.FOCUS_OUT was not dispatched after setting focus property of FocusManager\", hasDispatchedFocusOut);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFocusPropertyInFocusInEventListener():void\n\t\t{\n\t\t\tvar hasCorrectFocus:Boolean = false;\n\t\t\tthis._button.addEventListener(FeathersEventType.FOCUS_IN, function(event:Event):void\n\t\t\t{\n\t\t\t\tvar button:Button = Button(event.currentTarget);\n\t\t\t\thasCorrectFocus = button.focusManager.focus === button;\n\t\t\t});\n\t\t\tthis._button.focusManager.focus = this._button;\n\t\t\tAssert.assertTrue(\"The focus property of the FocusManager is not updated before calling listener for FeathersEventType.FOCUS_IN event\", hasCorrectFocus);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFocusPropertyInFocusOutEventListener():void\n\t\t{\n\t\t\tvar hasDifferentFocus:Boolean = false;\n\t\t\tthis._button.addEventListener(FeathersEventType.FOCUS_OUT, function(event:Event):void\n\t\t\t{\n\t\t\t\tvar button:Button = Button(event.currentTarget);\n\t\t\t\thasDifferentFocus = button.focusManager.focus !== button;\n\t\t\t});\n\t\t\tthis._button.focusManager.focus = this._button;\n\t\t\tthis._button.focusManager.focus = null;\n\t\t\tAssert.assertTrue(\"The focus property of the FocusManager is not updated before calling listener for FeathersEventType.FOCUS_OUT event\", hasDifferentFocus);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFocusChangeOnTabKey():void\n\t\t{\n\t\t\tthis._button.focusManager.focus = this._button;\n\t\t\tStarling.current.nativeStage.dispatchEvent(new FocusEvent(FocusEvent.KEY_FOCUS_CHANGE, true, false, null, false, Keyboard.TAB));\n\t\t\tAssert.assertStrictlyEquals(\"The FocusManager did not change focus when pressing Keyboard.TAB\", this._button.focusManager.focus, this._button2);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFocusChangeOnShiftPlusTabKey():void\n\t\t{\n\t\t\tthis._button.focusManager.focus = this._button2;\n\t\t\tStarling.current.nativeStage.dispatchEvent(new FocusEvent(FocusEvent.KEY_FOCUS_CHANGE, true, false, null, true, Keyboard.TAB));\n\t\t\tAssert.assertStrictlyEquals(\"The FocusManager did not change focus when pressing Keyboard.TAB\", this._button.focusManager.focus, this._button);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/FontStylesSetTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.text.FontStylesSet;\n\timport starling.text.TextFormat;\n\timport org.flexunit.Assert;\n\timport starling.events.Event;\n\n\tpublic class FontStylesSetTests\n\t{\n\t\tprivate static const SAMPLE_STATE:String = \"sample\";\n\t\tprivate static const UNDEFINED_STATE:String = \"noState\";\n\n\t\tprivate var _fontStyles:FontStylesSet;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._fontStyles = new FontStylesSet();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._fontStyles.dispose();\n\t\t\tthis._fontStyles = null;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetFormatForState():void\n\t\t{\n\t\t\tvar format:TextFormat = new TextFormat();\n\t\t\tthis._fontStyles.setFormatForState(SAMPLE_STATE, format);\n\t\t\tvar otherFormat:TextFormat = this._fontStyles.getFormatForState(SAMPLE_STATE);\n\t\t\tAssert.assertStrictlyEquals(\"FontStylesSet: getFormatForState() must return same value passed to setFormatForState().\",\n\t\t\t\tformat, otherFormat);\n\t\t\totherFormat = this._fontStyles.getFormatForState(UNDEFINED_STATE);\n\t\t\tAssert.assertStrictlyEquals(\"FontStylesSet: getFormatForState() must return null for state that is undefined.\",\n\t\t\t\tnull, otherFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFormatAddAndRemoveEvents():void\n\t\t{\n\t\t\tvar format:TextFormat = new TextFormat();\n\t\t\tthis._fontStyles.format = format;\n\t\t\tAssert.assertTrue(\"FontStylesSet: TextFormat add have Event.CHANGE listener.\",\n\t\t\t\tformat.hasEventListener(Event.CHANGE));\n\t\t\tthis._fontStyles.dispose();\n\t\t\tAssert.assertFalse(\"FontStylesSet: TextFormat must remove Event.CHANGE listener.\",\n\t\t\t\tformat.hasEventListener(Event.CHANGE));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFormatDispatchEvents():void\n\t\t{\n\t\t\tvar format:TextFormat = new TextFormat();\n\t\t\tthis._fontStyles.format = format;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._fontStyles.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tformat.bold = true;\n\t\t\tAssert.assertTrue(\"FontStylesSet: Must dispatch Event.CHANGE when TextFormat changes.\",\n\t\t\t\thasChanged);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDisabledFormatAddAndRemoveEvents():void\n\t\t{\n\t\t\tvar format:TextFormat = new TextFormat();\n\t\t\tthis._fontStyles.disabledFormat = format;\n\t\t\tAssert.assertTrue(\"FontStylesSet: TextFormat must add Event.CHANGE listener.\",\n\t\t\t\tformat.hasEventListener(Event.CHANGE));\n\t\t\tthis._fontStyles.dispose();\n\t\t\tAssert.assertFalse(\"FontStylesSet: TextFormat must remove Event.CHANGE listener.\",\n\t\t\t\tformat.hasEventListener(Event.CHANGE));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDisabledFormatDispatchEvents():void\n\t\t{\n\t\t\tvar format:TextFormat = new TextFormat();\n\t\t\tthis._fontStyles.disabledFormat = format;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._fontStyles.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tformat.bold = true;\n\t\t\tAssert.assertTrue(\"FontStylesSet: Must dispatch Event.CHANGE when TextFormat changes.\",\n\t\t\t\thasChanged);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectedFormatAddAndRemoveEvents():void\n\t\t{\n\t\t\tvar format:TextFormat = new TextFormat();\n\t\t\tthis._fontStyles.selectedFormat = format;\n\t\t\tAssert.assertTrue(\"FontStylesSet: TextFormat must add Event.CHANGE listener.\",\n\t\t\t\tformat.hasEventListener(Event.CHANGE));\n\t\t\tthis._fontStyles.dispose();\n\t\t\tAssert.assertFalse(\"FontStylesSet: TextFormat must remove Event.CHANGE listener.\",\n\t\t\t\tformat.hasEventListener(Event.CHANGE));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectedFormatDispatchEvents():void\n\t\t{\n\t\t\tvar format:TextFormat = new TextFormat();\n\t\t\tthis._fontStyles.selectedFormat = format;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._fontStyles.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tformat.bold = true;\n\t\t\tAssert.assertTrue(\"FontStylesSet: Must dispatch Event.CHANGE when TextFormat changes.\",\n\t\t\t\thasChanged);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetFormatForStateAddAndRemoveEvents():void\n\t\t{\n\t\t\tvar format:TextFormat = new TextFormat();\n\t\t\tthis._fontStyles.setFormatForState(SAMPLE_STATE, format);\n\t\t\tAssert.assertTrue(\"FontStylesSet: TextFormat must add Event.CHANGE listener.\",\n\t\t\t\tformat.hasEventListener(Event.CHANGE));\n\t\t\tthis._fontStyles.dispose();\n\t\t\tAssert.assertFalse(\"FontStylesSet: TextFormat must remove Event.CHANGE listener.\",\n\t\t\t\tformat.hasEventListener(Event.CHANGE));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetFormatForStateDispatchEvents():void\n\t\t{\n\t\t\tvar format:TextFormat = new TextFormat();\n\t\t\tthis._fontStyles.setFormatForState(SAMPLE_STATE, format);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._fontStyles.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tformat.bold = true;\n\t\t\tAssert.assertTrue(\"FontStylesSet: Must dispatch Event.CHANGE when TextFormat changes.\",\n\t\t\t\thasChanged);\n\t\t}\n\t}\t\n}"
  },
  {
    "path": "test/source/feathers/tests/FunctionStyleProviderTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.BasicButton;\n\timport feathers.core.IFeathersControl;\n\timport feathers.skins.FunctionStyleProvider;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class FunctionStyleProviderTests\n\t{\n\t\tprivate var _target:BasicButton;\n\t\tprivate var _styleProvider:FunctionStyleProvider;\n\t\tprivate var _functionCalled:Boolean;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._functionCalled = false;\n\n\t\t\tthis._target = new BasicButton();\n\t\t\tthis._target.defaultSkin = new Quad(200, 200, 0xff00ff);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._target.removeFromParent(true);\n\t\t\tthis._target = null;\n\n\t\t\tthis._styleProvider = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\t\t\n\t\tprivate function setStyles(target:IFeathersControl):void\n\t\t{\n\t\t\tthis._functionCalled = true;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoErrorWithNullFunction():void\n\t\t{\n\t\t\tthis._styleProvider = new FunctionStyleProvider(null);\n\t\t\tthis._styleProvider.applyStyles(this._target);\n\t\t\tAssert.assertFalse(\"FunctionStyleProvider incorrectly called the function\", this._functionCalled);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFunctionCalled():void\n\t\t{\n\t\t\tthis._styleProvider = new FunctionStyleProvider(setStyles);\n\t\t\tthis._styleProvider.applyStyles(this._target);\n\t\t\tAssert.assertTrue(\"FunctionStyleProvider must call the function\", this._functionCalled);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/GroupedListDataProviderTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.GroupedList;\n\timport feathers.controls.renderers.DefaultGroupedListHeaderOrFooterRenderer;\n\timport feathers.controls.renderers.DefaultGroupedListItemRenderer;\n\timport feathers.data.HierarchicalCollection;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class GroupedListDataProviderTests\n\t{\n\t\tprivate var _list:GroupedList;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._list = new GroupedList();\n\t\t\tthis._list.itemRendererFactory = function():DefaultGroupedListItemRenderer\n\t\t\t{\n\t\t\t\tvar itemRenderer:DefaultGroupedListItemRenderer = new DefaultGroupedListItemRenderer();\n\t\t\t\titemRenderer.defaultSkin = new Quad(200, 200);\n\t\t\t\treturn itemRenderer;\n\t\t\t};\n\t\t\tthis._list.headerRendererFactory = function():DefaultGroupedListHeaderOrFooterRenderer\n\t\t\t{\n\t\t\t\tvar headerRenderer:DefaultGroupedListHeaderOrFooterRenderer = new DefaultGroupedListHeaderOrFooterRenderer();\n\t\t\t\theaderRenderer.backgroundSkin = new Quad(200, 200);\n\t\t\t\treturn headerRenderer;\n\t\t\t};\n\t\t\tTestFeathers.starlingRoot.addChild(this._list);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._list.removeFromParent(true);\n\t\t\tthis._list = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testValidateWithNullDataProvider():void\n\t\t{\n\t\t\tthis._list.validate();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testValidateWithNullDataProviderAndTypicalItem():void\n\t\t{\n\t\t\tthis._list.typicalItem = { label: \"Typical Item\" };\n\t\t\tthis._list.validate();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoErrorOnDataProviderWithoutGroups():void\n\t\t{\n\t\t\tthis._list.dataProvider = new HierarchicalCollection([]);\n\t\t\tthis._list.validate();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoErrorOnDataProviderWithOneEmptyGroup():void\n\t\t{\n\t\t\tthis._list.dataProvider = new HierarchicalCollection(\n\t\t\t[\n\t\t\t\t{ children: [] }\n\t\t\t]);\n\t\t\tthis._list.validate();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoErrorOnDataProviderWithoutGroupsAndWithTypicalItem():void\n\t\t{\n\t\t\tthis._list.typicalItem = { label: \"Typical Item\" };\n\t\t\tthis._list.dataProvider = new HierarchicalCollection([]);\n\t\t\tthis._list.validate();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoErrorOnDataProviderWithOneEmptyGroupAndTypicalItem():void\n\t\t{\n\t\t\tthis._list.typicalItem = { label: \"Typical Item\" };\n\t\t\tthis._list.dataProvider = new HierarchicalCollection(\n\t\t\t[\n\t\t\t\t{ children: [] }\n\t\t\t]);\n\t\t\tthis._list.validate();\n\t\t}\n\n\t\t[Test(expects=\"TypeError\")]\n\t\tpublic function testErrorOnGroupWithNoChildrenField():void\n\t\t{\n\t\t\tthis._list.dataProvider = new HierarchicalCollection(\n\t\t\t[\n\t\t\t\t{}\n\t\t\t]);\n\t\t\tthis._list.validate();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/GroupedListFactoryIDFunctionTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.GroupedList;\n\timport feathers.controls.renderers.DefaultGroupedListItemRenderer;\n\timport feathers.controls.renderers.IGroupedListHeaderRenderer;\n\timport feathers.controls.renderers.IGroupedListItemRenderer;\n\timport feathers.core.IFeathersControl;\n\timport feathers.data.ArrayHierarchicalCollection;\n\timport feathers.events.FeathersEventType;\n\n\timport flash.utils.Dictionary;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\n\tpublic class GroupedListFactoryIDFunctionTests\n\t{\n\t\tprivate static const FACTORY_ONE:String = \"custom-factory1\";\n\t\tprivate static const CUSTOM_STYLE_NAME:String = \"custom-style-name\";\n\n\t\tprivate var _list:GroupedList;\n\n\t\tprivate var _itemRendererMap:Dictionary;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._itemRendererMap = new Dictionary(true);\n\n\t\t\tthis._list = new GroupedList();\n\t\t\tthis._list.dataProvider = new ArrayHierarchicalCollection(\n\t\t\t[\t\n\t\t\t\t{\n\t\t\t\t\theader: { label: \"Group A\" },\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{ label: \"One\", factory: 0 },\n\t\t\t\t\t\t{ label: \"Two\", factory: 0 },\n\t\t\t\t\t\t{ label: \"Three\", factory: 1 },\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\theader: { label: \"Group B\" },\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{ label: \"Four\", factory: 0 }\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\theader: { label: \"Group C\" },\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{ label: \"Five\", factory: 0 },\n\t\t\t\t\t\t{ label: \"Six\", factory: 0 }\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t]);\n\t\t\tthis._list.itemRendererFactory = function():DefaultGroupedListItemRenderer\n\t\t\t{\n\t\t\t\tvar itemRenderer:DefaultGroupedListItemRenderer = new DefaultGroupedListItemRenderer();\n\t\t\t\titemRenderer.defaultSkin = new Quad(200, 200);\n\t\t\t\treturn itemRenderer;\n\t\t\t};\n\t\t\tthis._list.setItemRendererFactoryWithID(FACTORY_ONE, function():DefaultGroupedListItemRenderer\n\t\t\t{\n\t\t\t\tvar itemRenderer:DefaultGroupedListItemRenderer = new DefaultGroupedListItemRenderer();\n\t\t\t\titemRenderer.styleNameList.add(CUSTOM_STYLE_NAME);\n\t\t\t\titemRenderer.defaultSkin = new Quad(200, 200);\n\t\t\t\treturn itemRenderer;\n\t\t\t});\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_ADD, list_rendererAddHandler);\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_REMOVE, list_rendererRemoveHandler);\n\t\t\tTestFeathers.starlingRoot.addChild(this._list);\n\t\t\tthis._list.validate();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._list.removeFromParent(true);\n\t\t\tthis._list = null;\n\n\t\t\tthis._itemRendererMap = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoFactoryIDFunction():void\n\t\t{\n\t\t\tAssert.assertNull(\"Item renderer factoryID should be null if factoryIDFunction is null.\", this.getItemRendererAt(0, 0).factoryID);\n\t\t\tAssert.assertNull(\"Item renderer factoryID should be null if factoryIDFunction is null.\", this.getItemRendererAt(0, 1).factoryID);\n\t\t\tAssert.assertNull(\"Item renderer factoryID should be null if factoryIDFunction is null.\", this.getItemRendererAt(0, 2).factoryID);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testOneArgumentFactoryIDFunction():void\n\t\t{\n\t\t\tthis._list.factoryIDFunction = oneArgumentFactoryIDFunction;\n\t\t\tthis._list.validate();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testThreeArgumentFactoryIDFunction():void\n\t\t{\n\t\t\tthis._list.factoryIDFunction = threeArgumentFactoryIDFunction;\n\t\t\tthis._list.validate();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFactoryIDFunction():void\n\t\t{\n\t\t\tthis._list.factoryIDFunction = factoryIDFunction;\n\t\t\tthis._list.validate();\n\t\t\tAssert.assertNull(\"Item renderer factoryID not set to result of factoryIDFunction.\", this.getItemRendererAt(0, 0).factoryID);\n\t\t\tAssert.assertNull(\"Item renderer factoryID not set to result of factoryIDFunction.\", this.getItemRendererAt(0, 1).factoryID);\n\t\t\tvar itemRenderer2:IGroupedListItemRenderer = this.getItemRendererAt(0, 2);\n\t\t\tAssert.assertStrictlyEquals(\"Item renderer factoryID not set to result of factoryIDFunction.\", FACTORY_ONE, itemRenderer2.factoryID);\n\t\t\tAssert.assertTrue(\"Incorrect factory called to create item renderer.\", itemRenderer2.styleNameList.contains(CUSTOM_STYLE_NAME));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemAtWithDifferentFactoryID():void\n\t\t{\n\t\t\tvar itemToSet:Object = { label: \"New\", factory: 1 };\n\t\t\tthis._list.factoryIDFunction = factoryIDFunction;\n\t\t\tthis._list.validate();\n\t\t\tthis._list.dataProvider.setItemAt(itemToSet, 0, 1);\n\t\t\tthis._list.validate();\n\t\t\tvar itemRenderer:IGroupedListItemRenderer = this.getItemRendererAt(0, 1);\n\t\t\tAssert.assertStrictlyEquals(\"Item renderer factoryID not changed to new result of factoryIDFunction after calling setItemAt().\", FACTORY_ONE, itemRenderer.factoryID);\n\t\t\tAssert.assertStrictlyEquals(\"Item renderer data not changed with new result of factoryIDFunction after calling setItemAt().\", itemToSet, itemRenderer.data);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetTypicalItemAtWithDifferentFactoryID():void\n\t\t{\n\t\t\tthis._list.typicalItem = this._list.dataProvider.getItemAt(0);\n\t\t\tvar itemToSet:Object = { label: \"Replacement Item\", factory: 1 };\n\t\t\tthis._list.factoryIDFunction = factoryIDFunction;\n\t\t\tthis._list.validate();\n\t\t\tthis._list.dataProvider.setItemAt(itemToSet, 0, 0);\n\t\t\tthis._list.validate();\n\t\t\tvar itemRenderer:IGroupedListItemRenderer = this.getItemRendererAt(0, 0);\n\t\t\tAssert.assertStrictlyEquals(\"Typical item renderer factoryID not changed to new result of factoryIDFunction after calling setItemAt().\", FACTORY_ONE, itemRenderer.factoryID);\n\t\t\tAssert.assertStrictlyEquals(\"Typical item renderer data not changed with new result of factoryIDFunction after calling setItemAt().\", itemToSet, itemRenderer.data);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemAtWithDifferentFactoryIDAndRemoveItemBefore():void\n\t\t{\n\t\t\tvar itemToSet:Object = { label: \"Replacement Item\", factory: 1 };\n\t\t\tthis._list.factoryIDFunction = factoryIDFunction;\n\t\t\tthis._list.validate();\n\t\t\tthis._list.dataProvider.setItemAt(itemToSet, 0, 1);\n\t\t\tthis._list.dataProvider.removeItemAt(0, 0);\n\t\t\tthis._list.validate();\n\t\t\tvar itemRenderer:IGroupedListItemRenderer = this.getItemRendererAt(0, 0);\n\t\t\tAssert.assertStrictlyEquals(\"Item renderer factoryID not changed to new result of factoryIDFunction after calling setItemAt() and removeItemAt() for previous item.\", FACTORY_ONE, itemRenderer.factoryID);\n\t\t\tAssert.assertStrictlyEquals(\"Item renderer data not changed with new result of factoryIDFunction after calling setItemAt() and removeItemAt() for previous item.\", itemToSet, itemRenderer.data);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemAtWithDifferentFactoryIDAndAddItemBefore():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"Added Item\", factory: 1 };\n\t\t\tvar itemToSet:Object = { label: \"Replacement Item\", factory: 1 };\n\t\t\tthis._list.factoryIDFunction = factoryIDFunction;\n\t\t\tthis._list.validate();\n\t\t\tthis._list.dataProvider.setItemAt(itemToSet, 0, 0);\n\t\t\tthis._list.dataProvider.addItemAt(itemToAdd, 0, 0);\n\t\t\tthis._list.validate();\n\t\t\tAssert.assertStrictlyEquals(\"factoryID of changed typical item not changed to result of factoryIDFunction.\", FACTORY_ONE, this.getItemRendererAt(0, 0).factoryID);\n\t\t\tvar itemRenderer1:IGroupedListItemRenderer = this.getItemRendererAt(0, 1);\n\t\t\tAssert.assertStrictlyEquals(\"Item renderer factoryID not changed to new result of factoryIDFunction after calling setItemAt() and addItemAt() for previous item.\", FACTORY_ONE, itemRenderer1.factoryID);\n\t\t\tAssert.assertStrictlyEquals(\"Item renderer data not changed with new result of factoryIDFunction after calling setItemAt() and addItemAt() for previous item.\", itemToSet, itemRenderer1.data);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNewTypicalItemWithDifferentFactoryAndRemoveTypicalItemAfterDispose():void\n\t\t{\n\t\t\tvar itemToSet:Object = { label: \"Replacement Item\", factory: 1 };\n\t\t\tthis._list.factoryIDFunction = factoryIDFunction;\n\t\t\tthis._list.validate();\n\t\t\tthis._list.dataProvider.setItemAt(itemToSet, 0, 1);\n\t\t\tthis._list.dataProvider.removeItemAt(0, 0);\n\t\t\tthis._list.validate();\n\n\t\t\tvar expectedItemRendererCount:int = 0;\n\t\t\tvar groupCount:int = this._list.dataProvider.getLength();\n\t\t\tfor(var i:int = 0; i < groupCount; i++)\n\t\t\t{\n\t\t\t\texpectedItemRendererCount += this._list.dataProvider.getLength(i);\n\t\t\t}\n\n\t\t\tvar headerRendererCount:int = 0;\n\t\t\tvar itemRendererCount:int = 0;\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_REMOVE, function(event:Event, renderer:IFeathersControl):void\n\t\t\t{\n\t\t\t\tif(renderer is IGroupedListHeaderRenderer)\n\t\t\t\t{\n\t\t\t\t\tvar headerRenderer:IGroupedListHeaderRenderer = IGroupedListHeaderRenderer(renderer);\n\t\t\t\t\tAssert.assertNotNull(\"Header renderer incorrectly has null owner during dispose().\", headerRenderer.owner);\n\t\t\t\t\tAssert.assertNotNull(\"Header renderer incorrectly has null data during dispose().\", headerRenderer.data);\n\t\t\t\t\tAssert.assertTrue(\"Header renderer incorrectly has negative group index during dispose().\", headerRenderer.groupIndex >= 0);\n\t\t\t\t\theaderRendererCount++;\n\t\t\t\t}\n\t\t\t\telse if(renderer is IGroupedListItemRenderer)\n\t\t\t\t{\n\t\t\t\t\tvar itemRenderer:IGroupedListItemRenderer = IGroupedListItemRenderer(renderer);\n\t\t\t\t\tAssert.assertNotNull(\"Item renderer incorrectly has null owner during dispose().\", itemRenderer.owner);\n\t\t\t\t\tAssert.assertNotNull(\"Item renderer incorrectly has null data during dispose().\", itemRenderer.data);\n\t\t\t\t\tAssert.assertTrue(\"Item renderer incorrectly has negative group index during dispose().\", itemRenderer.groupIndex >= 0);\n\t\t\t\t\tAssert.assertTrue(\"Item renderer incorrectly has negative item index during dispose().\", itemRenderer.itemIndex >= 0);\n\t\t\t\t\titemRendererCount++;\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis._list.dispose();\n\t\t\tAssert.assertStrictlyEquals(\"FeathersEventType.RENDERER_REMOVE not dispatched for all header renderers after dispose().\", groupCount, headerRendererCount);\n\t\t\tAssert.assertStrictlyEquals(\"FeathersEventType.RENDERER_REMOVE not dispatched for all item renderers after dispose().\", expectedItemRendererCount, itemRendererCount);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFirstItemRendererFactoryWithFactoryIDFunction():void\n\t\t{\n\t\t\tthis._list.firstItemRendererFactory = function():IGroupedListItemRenderer\n\t\t\t{\n\t\t\t\treturn new DefaultGroupedListItemRenderer();\n\t\t\t};\n\t\t\tthis._list.factoryIDFunction = factoryIDFunction;\n\t\t\tthis._list.validate();\n\n\t\t\tvar itemRenderer:IGroupedListItemRenderer = this.getItemRendererAt(0, 0);\n\t\t\tAssert.assertFalse(\"First item renderer factoryID incorrect when using factoryIDFunction and firstItemRendererFactory.\",\n\t\t\t\titemRenderer.factoryID === null);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLastItemRendererFactoryWithFactoryIDFunction():void\n\t\t{\n\t\t\tthis._list.lastItemRendererFactory = function():IGroupedListItemRenderer\n\t\t\t{\n\t\t\t\treturn new DefaultGroupedListItemRenderer();\n\t\t\t};\n\t\t\tthis._list.factoryIDFunction = factoryIDFunction;\n\t\t\tthis._list.validate();\n\n\t\t\t//this one should have the ID for the lastItemRendererFactory\n\t\t\tvar itemRenderer:IGroupedListItemRenderer = this.getItemRendererAt(2, 1);\n\t\t\tAssert.assertFalse(\"Last item renderer factoryID incorrect when using factoryIDFunction and lastItemRendererFactory (1).\",\n\t\t\t\titemRenderer.factoryID === null);\n\n\t\t\t//a non-null result from factoryIDFunction takes precedence, so\n\t\t\t//this one should not be from lastItemRendererFactory\n\t\t\titemRenderer = this.getItemRendererAt(0, 2);\n\t\t\tAssert.assertStrictlyEquals(\"Last item renderer factoryID incorrect when using factoryIDFunction and lastItemRendererFactory (2).\",\n\t\t\t\tFACTORY_ONE, itemRenderer.factoryID);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSingleItemRendererFactoryWithFactoryIDFunction():void\n\t\t{\n\t\t\tthis._list.singleItemRendererFactory = function():IGroupedListItemRenderer\n\t\t\t{\n\t\t\t\treturn new DefaultGroupedListItemRenderer();\n\t\t\t};\n\t\t\tthis._list.factoryIDFunction = factoryIDFunction;\n\t\t\tthis._list.validate();\n\n\t\t\tvar itemRenderer:IGroupedListItemRenderer = this.getItemRendererAt(1, 0);\n\t\t\tAssert.assertFalse(\"Single item renderer factoryID incorrect when using factoryIDFunction and singleItemRendererFactory.\",\n\t\t\t\titemRenderer.factoryID === null);\n\t\t}\n\n\t\tprivate function getItemRendererAt(groupIndex:int, itemIndex:int):IGroupedListItemRenderer\n\t\t{\n\t\t\tfor(var item:Object in this._itemRendererMap)\n\t\t\t{\n\t\t\t\tvar renderer:Object = this._itemRendererMap[item];\n\t\t\t\tif(renderer is IGroupedListItemRenderer)\n\t\t\t\t{\n\t\t\t\t\tvar itemRenderer:IGroupedListItemRenderer = IGroupedListItemRenderer(renderer);\n\t\t\t\t\tif(itemRenderer.groupIndex === groupIndex &&\n\t\t\t\t\t\t\titemRenderer.itemIndex === itemIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn itemRenderer;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tprivate function list_rendererAddHandler(event:Event, renderer:Object):void\n\t\t{\n\t\t\tif(renderer is IGroupedListItemRenderer)\n\t\t\t{\n\t\t\t\tvar itemRenderer:IGroupedListItemRenderer = IGroupedListItemRenderer(renderer);\n\t\t\t\tthis._itemRendererMap[itemRenderer.data] = itemRenderer;\n\t\t\t}\n\t\t}\n\n\t\tprivate function list_rendererRemoveHandler(event:Event, renderer:Object):void\n\t\t{\n\t\t\tif(renderer is IGroupedListItemRenderer)\n\t\t\t{\n\t\t\t\tvar itemRenderer:IGroupedListItemRenderer = IGroupedListItemRenderer(renderer);\n\t\t\t\tdelete this._itemRendererMap[itemRenderer.data];\n\t\t\t}\n\t\t}\n\n\t\tprivate function factoryIDFunction(item:Object):String\n\t\t{\n\t\t\tif(item.factory === 1)\n\t\t\t{\n\t\t\t\treturn FACTORY_ONE;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\tprivate function oneArgumentFactoryIDFunction(item:Object):String\n\t\t{\n\t\t\tAssert.assertNotNull(\"Item passed to factoryIDFunction should not be null.\", item);\n\t\t\treturn null;\n\t\t}\n\n\t\tprivate function threeArgumentFactoryIDFunction(item:Object, groupIndex:int, itemIndex:int):String\n\t\t{\n\t\t\tAssert.assertNotNull(\"Item passed to factoryIDFunction should not be null.\", item);\n\t\t\tAssert.assertTrue(\"Group index passed to factoryIDFunction is out of range.\", groupIndex >= 0 && groupIndex < this._list.dataProvider.getLength());\n\t\t\tAssert.assertTrue(\"Item index passed to factoryIDFunction is out of range.\", itemIndex >= 0 && itemIndex < this._list.dataProvider.getLength(groupIndex));\n\t\t\treturn null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/GroupedListFocusTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.GroupedList;\n\timport feathers.controls.renderers.DefaultGroupedListItemRenderer;\n\timport feathers.core.FocusManager;\n\timport feathers.data.HierarchicalCollection;\n\n\timport flash.events.KeyboardEvent;\n\timport flash.ui.KeyLocation;\n\timport flash.ui.Keyboard;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\n\tpublic class GroupedListFocusTests\n\t{\n\t\tprivate var _list:GroupedList;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._list = new GroupedList();\n\t\t\tthis._list.dataProvider = new HierarchicalCollection(\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\theader: { label: \"A\" },\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{label: \"One\"},\n\t\t\t\t\t\t{label: \"Two\"},\n\t\t\t\t\t\t{label: \"Three\"},\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\theader: { label: \"B\" },\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{label: \"Four\"},\n\t\t\t\t\t\t{label: \"Five\"},\n\t\t\t\t\t\t{label: \"Six\"},\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\theader: { label: \"C\" },\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{label: \"Seven\"},\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]);\n\t\t\tthis._list.itemRendererFactory = function():DefaultGroupedListItemRenderer\n\t\t\t{\n\t\t\t\tvar itemRenderer:DefaultGroupedListItemRenderer = new DefaultGroupedListItemRenderer();\n\t\t\t\titemRenderer.defaultSkin = new Quad(200, 200);\n\t\t\t\treturn itemRenderer;\n\t\t\t};\n\t\t\tTestFeathers.starlingRoot.addChild(this._list);\n\t\t\tthis._list.validate();\n\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, true);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._list.removeFromParent(true);\n\t\t\tthis._list = null;\n\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, false);\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t\tAssert.assertFalse(\"FocusManager not disabled on cleanup.\", FocusManager.isEnabledForStage(TestFeathers.starlingRoot.stage));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoTriggerWhenNoSelectedItem():void\n\t\t{\n\t\t\tFocusManager.focus = this._list;\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tvar triggeredItem:Object = null;\n\t\t\tthis._list.addEventListener(Event.TRIGGERED, function(event:Event, item:Object):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t\ttriggeredItem = item;\n\t\t\t});\n\t\t\tthis._list.stage.starling.nativeStage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 32, Keyboard.SPACE, KeyLocation.STANDARD, false, false, false));\n\t\t\tthis._list.stage.starling.nativeStage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, true, false, 32, Keyboard.SPACE, KeyLocation.STANDARD, false, false, false));\n\t\t\tAssert.assertFalse(\"Event.TRIGGERED incorrectly dispatched when no item is selected\",\n\t\t\t\thasTriggered);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTriggered():void\n\t\t{\n\t\t\tthis._list.setSelectedLocation(0, 1);\n\t\t\tFocusManager.focus = this._list;\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tvar triggeredItem:Object = null;\n\t\t\tthis._list.addEventListener(Event.TRIGGERED, function(event:Event, item:Object):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t\ttriggeredItem = item;\n\t\t\t});\n\t\t\tthis._list.stage.starling.nativeStage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 32, Keyboard.SPACE, KeyLocation.STANDARD, false, false, false));\n\t\t\tthis._list.stage.starling.nativeStage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, true, false, 32, Keyboard.SPACE, KeyLocation.STANDARD, false, false, false));\n\t\t\tAssert.assertTrue(\"Event.TRIGGERED must be dispatched on KeyboardEvent.KEY_DOWN with Keyboard.SPACE key code\",\n\t\t\t\thasTriggered);\n\t\t\tAssert.assertStrictlyEquals(\"Incorrect item passed to Event.TRIGGERED listener\",\n\t\t\t\tthis._list.dataProvider.getItemAt(0, 1), triggeredItem);\n\t\t}\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/GroupedListRendererAddRemoveTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.GroupedList;\n\timport feathers.controls.renderers.DefaultGroupedListHeaderOrFooterRenderer;\n\timport feathers.controls.renderers.DefaultGroupedListItemRenderer;\n\timport feathers.controls.renderers.IGroupedListHeaderRenderer;\n\timport feathers.controls.renderers.IGroupedListItemRenderer;\n\timport feathers.core.IFeathersControl;\n\timport feathers.data.HierarchicalCollection;\n\timport feathers.events.FeathersEventType;\n\n\timport flexunit.framework.Assert;\n\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\n\tpublic class GroupedListRendererAddRemoveTests\n\t{\n\t\tprivate var _list:GroupedList;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._list = new GroupedList();\n\t\t\tthis._list.dataProvider = new HierarchicalCollection(\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\theader: { label: \"A\" },\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{label: \"One\"},\n\t\t\t\t\t\t{label: \"Two\"},\n\t\t\t\t\t\t{label: \"Three\"},\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\theader: { label: \"B\" },\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{label: \"Four\"},\n\t\t\t\t\t\t{label: \"Five\"},\n\t\t\t\t\t\t{label: \"Six\"},\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]);\n\t\t\tthis._list.itemRendererFactory = function():DefaultGroupedListItemRenderer\n\t\t\t{\n\t\t\t\tvar itemRenderer:DefaultGroupedListItemRenderer = new DefaultGroupedListItemRenderer();\n\t\t\t\titemRenderer.defaultSkin = new Quad(200, 200);\n\t\t\t\treturn itemRenderer;\n\t\t\t};\n\t\t\tthis._list.headerRendererFactory = function():DefaultGroupedListHeaderOrFooterRenderer\n\t\t\t{\n\t\t\t\tvar headerRenderer:DefaultGroupedListHeaderOrFooterRenderer = new DefaultGroupedListHeaderOrFooterRenderer();\n\t\t\t\theaderRenderer.backgroundSkin = new Quad(200, 200);\n\t\t\t\treturn headerRenderer;\n\t\t\t};\n\t\t\tTestFeathers.starlingRoot.addChild(this._list);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._list.removeFromParent(true);\n\t\t\tthis._list = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRendererAddEventWithDataProvider():void\n\t\t{\n\t\t\tvar headerRendererCount:int = 0;\n\t\t\tvar itemRendererCount:int = 0;\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_ADD, function(event:Event, renderer:IFeathersControl):void\n\t\t\t{\n\t\t\t\tif(renderer is IGroupedListHeaderRenderer)\n\t\t\t\t{\n\t\t\t\t\theaderRendererCount++;\n\t\t\t\t}\n\t\t\t\telse if(renderer is IGroupedListItemRenderer)\n\t\t\t\t{\n\t\t\t\t\titemRendererCount++;\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis._list.validate();\n\t\t\t\n\t\t\tvar expectedItemRendererCount:int = 0;\n\t\t\tvar groupCount:int = this._list.dataProvider.getLength();\n\t\t\tfor(var i:int = 0; i < groupCount; i++)\n\t\t\t{\n\t\t\t\texpectedItemRendererCount += this._list.dataProvider.getLength(i);\n\t\t\t}\n\n\t\t\tAssert.assertStrictlyEquals(\"FeathersEventType.RENDERER_ADD not dispatched for all visible headers.\", groupCount, headerRendererCount);\n\t\t\tAssert.assertStrictlyEquals(\"FeathersEventType.RENDERER_ADD not dispatched for all visible headers.\", expectedItemRendererCount, itemRendererCount);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRendererAddEventAfterAddItem():void\n\t\t{\n\t\t\tvar groupIndex:int = 1;\n\t\t\tvar itemIndex:int = 1;\n\t\t\tthis._list.validate();\n\t\t\tvar addedRenderer:Boolean = false;\n\t\t\tvar addedGroupIndex:int = -1;\n\t\t\tvar addedItemIndex:int = -1;\n\t\t\tfunction rendererAddListener(event:Event, itemRenderer:IGroupedListItemRenderer):void\n\t\t\t{\n\t\t\t\taddedRenderer = true;\n\t\t\t\taddedGroupIndex = itemRenderer.groupIndex;\n\t\t\t\taddedItemIndex = itemRenderer.itemIndex;\n\t\t\t}\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_ADD, rendererAddListener);\n\t\t\tthis._list.dataProvider.addItemAt({label: \"New Item\"}, groupIndex, itemIndex);\n\t\t\tthis._list.validate();\n\t\t\tthis._list.removeEventListener(FeathersEventType.RENDERER_ADD, rendererAddListener);\n\t\t\tAssert.assertTrue(\"FeathersEventType.RENDERER_ADD not dispatched after addItemAt().\", addedRenderer);\n\t\t\tAssert.assertStrictlyEquals(\"FeathersEventType.RENDERER_ADD not dispatched with correct item renderer after addItemAt().\", groupIndex, addedGroupIndex);\n\t\t\tAssert.assertStrictlyEquals(\"FeathersEventType.RENDERER_ADD not dispatched with correct item renderer after addItemAt().\", itemIndex, addedItemIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRendererRemoveEventAfterRemoveItemAt():void\n\t\t{\n\t\t\tvar groupIndex:int = 1;\n\t\t\tvar itemIndex:int = 1;\n\t\t\tthis._list.validate();\n\t\t\tvar removedRenderer:Boolean = false;\n\t\t\tvar removedGroupIndex:int = -1;\n\t\t\tvar removedItemIndex:int = -1;\n\t\t\tfunction rendererRemoveListener(event:Event, itemRenderer:IGroupedListItemRenderer):void\n\t\t\t{\n\t\t\t\tremovedRenderer = true;\n\t\t\t\tremovedGroupIndex = itemRenderer.groupIndex;\n\t\t\t\tremovedItemIndex = itemRenderer.itemIndex;\n\t\t\t}\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_REMOVE, rendererRemoveListener);\n\t\t\tthis._list.dataProvider.removeItemAt(groupIndex, itemIndex);\n\t\t\tthis._list.validate();\n\t\t\tthis._list.removeEventListener(FeathersEventType.RENDERER_REMOVE, rendererRemoveListener);\n\t\t\tAssert.assertTrue(\"FeathersEventType.RENDERER_REMOVE not dispatched after removeItemAt().\", removedRenderer);\n\t\t\tAssert.assertStrictlyEquals(\"FeathersEventType.RENDERER_REMOVE not dispatched with correct item renderer after removeItemAt().\", groupIndex, removedGroupIndex);\n\t\t\tAssert.assertStrictlyEquals(\"FeathersEventType.RENDERER_REMOVE not dispatched with correct item renderer after removeItemAt().\", itemIndex, removedItemIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRendererAddAndRemoveEventsAfterSetItemAt():void\n\t\t{\n\t\t\tvar groupIndex:int = 1;\n\t\t\tvar itemIndex:int = 1;\n\t\t\tthis._list.validate();\n\t\t\tvar addedRenderer:Boolean = false;\n\t\t\tvar addedGroupIndex:int = -1;\n\t\t\tvar addedItemIndex:int = -1;\n\t\t\tfunction rendererAddListener(event:Event, itemRenderer:IGroupedListItemRenderer):void\n\t\t\t{\n\t\t\t\tAssert.assertTrue(\"FeathersEventType.RENDERER_REMOVE not dispatched before FeathersEventType.RENDERER_ADD when calling setItemAt().\", removedRenderer);\n\t\t\t\taddedRenderer = true;\n\t\t\t\taddedGroupIndex = itemRenderer.groupIndex;\n\t\t\t\taddedItemIndex = itemRenderer.itemIndex;\n\t\t\t}\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_ADD, rendererAddListener);\n\t\t\tvar removedRenderer:Boolean = false;\n\t\t\tvar removedGroupIndex:int = -1;\n\t\t\tvar removedItemIndex:int = -1;\n\t\t\tfunction rendererRemoveListener(event:Event, itemRenderer:IGroupedListItemRenderer):void\n\t\t\t{\n\t\t\t\tremovedRenderer = true;\n\t\t\t\tremovedGroupIndex = itemRenderer.groupIndex;\n\t\t\t\tremovedItemIndex = itemRenderer.itemIndex;\n\t\t\t}\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_REMOVE, rendererRemoveListener);\n\t\t\tthis._list.dataProvider.setItemAt({label: \"New Item\"}, groupIndex, itemIndex);\n\t\t\tthis._list.validate();\n\t\t\tthis._list.removeEventListener(FeathersEventType.RENDERER_ADD, rendererAddListener);\n\t\t\tthis._list.removeEventListener(FeathersEventType.RENDERER_REMOVE, rendererRemoveListener);\n\t\t\tAssert.assertTrue(\"FeathersEventType.RENDERER_REMOVE not dispatched after setItemAt().\", removedRenderer);\n\t\t\tAssert.assertStrictlyEquals(\"FeathersEventType.RENDERER_REMOVE not dispatched with correct item renderer after setItemAt().\", groupIndex, removedGroupIndex);\n\t\t\tAssert.assertStrictlyEquals(\"FeathersEventType.RENDERER_REMOVE not dispatched with correct item renderer after setItemAt().\", itemIndex, removedItemIndex);\n\t\t\tAssert.assertTrue(\"FeathersEventType.RENDERER_ADD not dispatched after setItemAt().\", addedRenderer);\n\t\t\tAssert.assertStrictlyEquals(\"FeathersEventType.RENDERER_ADD not dispatched with correct item renderer after setItemAt().\", groupIndex, addedGroupIndex);\n\t\t\tAssert.assertStrictlyEquals(\"FeathersEventType.RENDERER_ADD not dispatched with correct item renderer after setItemAt().\", itemIndex, addedItemIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRendererAddAndRemoveEventAfterChangeTypicalItemFromDefaultToCustom():void\n\t\t{\n\t\t\tthis._list.validate();\n\t\t\tthis._list.typicalItem = { label: \"Typical Item\" };\n\t\t\tvar addedRenderer:Boolean = false;\n\t\t\tfunction rendererAddListener(event:Event, itemRenderer:Object):void\n\t\t\t{\n\t\t\t\taddedRenderer = true;\n\t\t\t}\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_ADD, rendererAddListener);\n\t\t\tvar removedRenderer:Boolean = false;\n\t\t\tfunction rendererRemoveListener(event:Event, itemRenderer:Object):void\n\t\t\t{\n\t\t\t\tremovedRenderer = true;\n\t\t\t}\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_REMOVE, rendererRemoveListener);\n\t\t\tthis._list.validate();\n\t\t\tAssert.assertFalse(\"FeathersEventType.RENDERER_REMOVE incorrectly dispatched after change typicalItem from default to custom.\", removedRenderer);\n\t\t\tAssert.assertFalse(\"FeathersEventType.RENDERER_ADD incorrectly dispatched after change typicalItem from default to custom.\", addedRenderer);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRendererRemoveEventsAfterDispose():void\n\t\t{\n\t\t\tthis._list.validate();\n\n\t\t\tvar expectedItemRendererCount:int = 0;\n\t\t\tvar groupCount:int = this._list.dataProvider.getLength();\n\t\t\tfor(var i:int = 0; i < groupCount; i++)\n\t\t\t{\n\t\t\t\texpectedItemRendererCount += this._list.dataProvider.getLength(i);\n\t\t\t}\n\t\t\t\n\t\t\tvar headerRendererCount:int = 0;\n\t\t\tvar itemRendererCount:int = 0;\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_REMOVE, function(event:Event, renderer:IFeathersControl):void\n\t\t\t{\n\t\t\t\tif(renderer is IGroupedListHeaderRenderer)\n\t\t\t\t{\n\t\t\t\t\tvar headerRenderer:IGroupedListHeaderRenderer = IGroupedListHeaderRenderer(renderer);\n\t\t\t\t\tAssert.assertNotNull(\"Header renderer incorrectly has null owner during dispose().\", headerRenderer.owner);\n\t\t\t\t\tAssert.assertNotNull(\"Header renderer incorrectly has null data during dispose().\", headerRenderer.data);\n\t\t\t\t\tAssert.assertTrue(\"Header renderer incorrectly has negative group index during dispose().\", headerRenderer.groupIndex >= 0);\n\t\t\t\t\theaderRendererCount++;\n\t\t\t\t}\n\t\t\t\telse if(renderer is IGroupedListItemRenderer)\n\t\t\t\t{\n\t\t\t\t\tvar itemRenderer:IGroupedListItemRenderer = IGroupedListItemRenderer(renderer);\n\t\t\t\t\tAssert.assertNotNull(\"Item renderer incorrectly has null owner during dispose().\", itemRenderer.owner);\n\t\t\t\t\tAssert.assertNotNull(\"Item renderer incorrectly has null data during dispose().\", itemRenderer.data);\n\t\t\t\t\tAssert.assertTrue(\"Item renderer incorrectly has negative group index during dispose().\", itemRenderer.groupIndex >= 0);\n\t\t\t\t\tAssert.assertTrue(\"Item renderer incorrectly has negative item index during dispose().\", itemRenderer.itemIndex >= 0);\n\t\t\t\t\titemRendererCount++;\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis._list.dispose();\n\t\t\tAssert.assertStrictlyEquals(\"FeathersEventType.RENDERER_REMOVE not dispatched for all header renderers after dispose().\", groupCount, headerRendererCount);\n\t\t\tAssert.assertStrictlyEquals(\"FeathersEventType.RENDERER_REMOVE not dispatched for all item renderers after dispose().\", expectedItemRendererCount, itemRendererCount);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/GroupedListTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.GroupedList;\n\timport feathers.controls.renderers.DefaultGroupedListHeaderOrFooterRenderer;\n\timport feathers.controls.renderers.DefaultGroupedListItemRenderer;\n\timport feathers.controls.renderers.IGroupedListHeaderRenderer;\n\timport feathers.controls.renderers.IGroupedListItemRenderer;\n\timport feathers.data.ArrayHierarchicalCollection;\n\timport feathers.events.FeathersEventType;\n\timport feathers.tests.supportClasses.AssertViewPortBoundsLayout;\n\n\timport flash.geom.Point;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\tpublic class GroupedListTests\n\t{\n\t\tprivate var _list:GroupedList;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._list = new GroupedList();\n\t\t\tthis._list.dataProvider = new ArrayHierarchicalCollection(\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\theader: { label: \"A\" },\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{label: \"One\"},\n\t\t\t\t\t\t{label: \"Two\"},\n\t\t\t\t\t\t{label: \"Three\"},\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\theader: { label: \"B\" },\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{label: \"Four\"},\n\t\t\t\t\t\t{label: \"Five\"},\n\t\t\t\t\t\t{label: \"Six\"},\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\theader: { label: \"C\" },\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{label: \"Seven\"},\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]);\n\t\t\tthis._list.itemRendererFactory = function():DefaultGroupedListItemRenderer\n\t\t\t{\n\t\t\t\tvar itemRenderer:DefaultGroupedListItemRenderer = new DefaultGroupedListItemRenderer();\n\t\t\t\titemRenderer.defaultSkin = new Quad(200, 200);\n\t\t\t\treturn itemRenderer;\n\t\t\t};\n\t\t\tthis._list.headerRendererFactory = function():DefaultGroupedListHeaderOrFooterRenderer\n\t\t\t{\n\t\t\t\tvar headerRenderer:DefaultGroupedListHeaderOrFooterRenderer = new DefaultGroupedListHeaderOrFooterRenderer();\n\t\t\t\theaderRenderer.backgroundSkin = new Quad(200, 200);\n\t\t\t\treturn headerRenderer;\n\t\t\t};\n\t\t\tTestFeathers.starlingRoot.addChild(this._list);\n\t\t\tthis._list.validate();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._list.removeFromParent(true);\n\t\t\tthis._list = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNullDataProvider():void\n\t\t{\n\t\t\tthis._list.dataProvider = null;\n\t\t\tthis._list.validate();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNullDataProviderWithTypicalItem():void\n\t\t{\n\t\t\tthis._list.dataProvider = null;\n\t\t\tthis._list.typicalItem = { label: \"Typical Item\" };\n\t\t\tthis._list.validate();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testProgrammaticSelectionChange():void\n\t\t{\n\t\t\tvar beforeSelectedGroupIndex:int = this._list.selectedGroupIndex;\n\t\t\tvar beforeSelectedItemIndex:int = this._list.selectedItemIndex;\n\t\t\tvar beforeSelectedItem:Object = this._list.selectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.setSelectedLocation(0, 1);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertFalse(\"The selectedGroupIndex property was not changed\",\n\t\t\t\tbeforeSelectedGroupIndex === this._list.selectedGroupIndex);\n\t\t\tAssert.assertFalse(\"The selectedItemIndex property was not changed\",\n\t\t\t\tbeforeSelectedItemIndex === this._list.selectedItemIndex);\n\t\t\tAssert.assertFalse(\"The selectedItem property was not changed\",\n\t\t\t\tbeforeSelectedItem === this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInteractiveSelectionChange():void\n\t\t{\n\t\t\tvar beforeSelectedGroupIndex:int = this._list.selectedGroupIndex;\n\t\t\tvar beforeSelectedItemIndex:int = this._list.selectedItemIndex;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 410);\n\t\t\tvar target:DisplayObject = this._list.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t//this touch does not move at all, so it should result in triggering\n\t\t\t//the button.\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertFalse(\"The selectedGroupIndex property was not changed\",\n\t\t\t\tbeforeSelectedGroupIndex === this._list.selectedGroupIndex);\n\t\t\tAssert.assertFalse(\"The selectedItemIndex property was not changed\",\n\t\t\t\tbeforeSelectedItemIndex === this._list.selectedItemIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemBeforeSelectedItemIndex():void\n\t\t{\n\t\t\tthis._list.setSelectedLocation(1, 1);\n\t\t\tvar beforeSelectedGroupIndex:int = this._list.selectedGroupIndex;\n\t\t\tvar beforeSelectedItemIndex:int = this._list.selectedItemIndex;\n\t\t\tvar beforeSelectedItem:Object = this._list.selectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dataProvider.removeItemAt(1, 0);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedGroupIndex property was incorrectly changed\",\n\t\t\t\tbeforeSelectedGroupIndex, this._list.selectedGroupIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItemIndex property was not changed\",\n\t\t\t\tbeforeSelectedItemIndex - 1, this._list.selectedItemIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was incorrectly changed\",\n\t\t\t\tbeforeSelectedItem, this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemAfterSelectedItemIndex():void\n\t\t{\n\t\t\tthis._list.setSelectedLocation(1, 1);\n\t\t\tvar beforeSelectedGroupIndex:int = this._list.selectedGroupIndex;\n\t\t\tvar beforeSelectedItemIndex:int = this._list.selectedItemIndex;\n\t\t\tvar beforeSelectedItem:Object = this._list.selectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dataProvider.removeItemAt(1, 2);\n\t\t\tAssert.assertFalse(\"Event.CHANGE was incorrectly dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedGroupIndex property was incorrectly changed\",\n\t\t\t\tbeforeSelectedGroupIndex, this._list.selectedGroupIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItemIndex property was incorrectly changed\",\n\t\t\t\tbeforeSelectedItemIndex, this._list.selectedItemIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was incorrectly changed\",\n\t\t\t\tbeforeSelectedItem, this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveSelectedItemIndex():void\n\t\t{\n\t\t\tthis._list.setSelectedLocation(1, 1);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dataProvider.removeItemAt(1, 1);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was not changed to -1\",\n\t\t\t\t-1, this._list.selectedGroupIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was not changed to -1\",\n\t\t\t\t-1, this._list.selectedItemIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was not changed to null\",\n\t\t\t\tnull, this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testReplaceItemAtSelectedItemIndex():void\n\t\t{\n\t\t\tthis._list.setSelectedLocation(1, 1);\n\t\t\tvar beforeSelectedGroupIndex:int = this._list.selectedGroupIndex;\n\t\t\tvar beforeSelectedItemIndex:int = this._list.selectedItemIndex;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dataProvider.setItemAt({ label: \"New Item\" }, beforeSelectedGroupIndex, beforeSelectedItemIndex);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedGroupIndex property was not changed to -1\",\n\t\t\t\t-1, this._list.selectedGroupIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItemIndex property was not changed to -1\",\n\t\t\t\t-1, this._list.selectedItemIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was not changed to null\",\n\t\t\t\tnull, this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDeselectAllOnNullDataProvider():void\n\t\t{\n\t\t\tthis._list.setSelectedLocation(1, 1);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dataProvider = null;\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedGroupIndex property was not set to -1\",\n\t\t\t\t-1, this._list.selectedGroupIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItemIndex property was not set to -1\",\n\t\t\t\t-1, this._list.selectedItemIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was not set to null\",\n\t\t\t\tnull, this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDeselectAllOnDataProviderRemoveAll():void\n\t\t{\n\t\t\tthis._list.setSelectedLocation(1, 1);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dataProvider.removeAll();\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedGroupIndex property was not set to -1\",\n\t\t\t\t-1, this._list.selectedGroupIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItemIndex property was not set to -1\",\n\t\t\t\t-1, this._list.selectedItemIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was not set to null\",\n\t\t\t\tnull, this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemBeforeSelectedItemIndex():void\n\t\t{\n\t\t\tthis._list.setSelectedLocation(1, 1);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tvar beforeSelectedGroupIndex:int = this._list.selectedGroupIndex;\n\t\t\tvar beforeSelectedItemIndex:int = this._list.selectedItemIndex;\n\t\t\tvar beforeSelectedItem:Object = this._list.selectedItem;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dataProvider.addItemAt({label: \"New Item\"}, 1, 0);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedGroupIndex property was incorrectly changed\",\n\t\t\t\tbeforeSelectedGroupIndex, this._list.selectedGroupIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItemIndex property was not changed\",\n\t\t\t\tbeforeSelectedItemIndex + 1, this._list.selectedItemIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was incorrectly changed\",\n\t\t\t\tbeforeSelectedItem, this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddGroupBeforeSelectedGroupIndex():void\n\t\t{\n\t\t\tthis._list.setSelectedLocation(1, 1);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tvar beforeSelectedGroupIndex:int = this._list.selectedGroupIndex;\n\t\t\tvar beforeSelectedItemIndex:int = this._list.selectedItemIndex;\n\t\t\tvar beforeSelectedItem:Object = this._list.selectedItem;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dataProvider.addItemAt(\n\t\t\t{\n\t\t\t\theader: \"New Group\",\n\t\t\t\tchildren:\n\t\t\t\t[\n\t\t\t\t\t{ label: \"New Item 1\" },\n\t\t\t\t\t{ label: \"New Item 2\" },\n\t\t\t\t]\n\t\t\t}, 0);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertFalse(\"The selectedGroupIndex property was not changed\",\n\t\t\t\tbeforeSelectedGroupIndex === this._list.selectedGroupIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItemIndex property was incorrectly changed\",\n\t\t\t\tbeforeSelectedItemIndex, this._list.selectedItemIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was incorrectly changed\",\n\t\t\t\tbeforeSelectedItem, this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveGroupBeforeSelectedGroupIndex():void\n\t\t{\n\t\t\tthis._list.setSelectedLocation(1, 1);\n\t\t\tvar beforeSelectedGroupIndex:int = this._list.selectedGroupIndex;\n\t\t\tvar beforeSelectedItemIndex:int = this._list.selectedItemIndex;\n\t\t\tvar beforeSelectedItem:Object = this._list.selectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dataProvider.removeItemAt(0);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertFalse(\"The selectedGroupIndex property was not changed\",\n\t\t\t\tbeforeSelectedGroupIndex === this._list.selectedGroupIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItemIndex property was incorrectly changed\",\n\t\t\t\tbeforeSelectedItemIndex, this._list.selectedItemIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was incorrectly changed\",\n\t\t\t\tbeforeSelectedItem, this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveGroupAfterSelectedGroupIndex():void\n\t\t{\n\t\t\tthis._list.setSelectedLocation(1, 1);\n\t\t\tvar beforeSelectedGroupIndex:int = this._list.selectedGroupIndex;\n\t\t\tvar beforeSelectedItemIndex:int = this._list.selectedItemIndex;\n\t\t\tvar beforeSelectedItem:Object = this._list.selectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dataProvider.removeItemAt(2);\n\t\t\tAssert.assertFalse(\"Event.CHANGE was incorrectly dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedGroupIndex property was incorrectly changed\",\n\t\t\t\tbeforeSelectedGroupIndex, this._list.selectedGroupIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItemIndex property was incorrectly changed\",\n\t\t\t\tbeforeSelectedItemIndex, this._list.selectedItemIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was incorrectly changed\",\n\t\t\t\tbeforeSelectedItem, this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveGroupAtSelectedGroupIndex():void\n\t\t{\n\t\t\tthis._list.setSelectedLocation(1, 1);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dataProvider.removeItemAt(1);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was not changed to -1\",\n\t\t\t\t-1, this._list.selectedGroupIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was not changed to -1\",\n\t\t\t\t-1, this._list.selectedItemIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was not changed to null\",\n\t\t\t\tnull, this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testReplaceGroupAtSelectedGroupIndex():void\n\t\t{\n\t\t\tthis._list.setSelectedLocation(1, 1);\n\t\t\tvar beforeSelectedGroupIndex:int = this._list.selectedGroupIndex;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dataProvider.setItemAt(\n\t\t\t{\n\t\t\t\theader: \"New Group\",\n\t\t\t\tchildren:\n\t\t\t\t[\n\t\t\t\t\t{ label: \"New Item 1\" },\n\t\t\t\t\t{ label: \"New Item 2\" },\n\t\t\t\t]\n\t\t\t}, beforeSelectedGroupIndex);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedGroupIndex property was not changed to -1\",\n\t\t\t\t-1, this._list.selectedGroupIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItemIndex property was not changed to -1\",\n\t\t\t\t-1, this._list.selectedItemIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was not changed to null\",\n\t\t\t\tnull, this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDisposeWithoutChangeEvent():void\n\t\t{\n\t\t\tthis._list.setSelectedLocation(1, 1);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dispose();\n\t\t\tAssert.assertFalse(\"Event.CHANGE was incorrectly dispatched\", hasChanged);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFirstItemRendererFactoryWithMultipleItemsInGroup():void\n\t\t{\n\t\t\tvar firstItemName:String = \"first-item\";\n\t\t\tthis._list.firstItemRendererFactory = function():DefaultGroupedListItemRenderer\n\t\t\t{\n\t\t\t\tvar itemRenderer:DefaultGroupedListItemRenderer = _list.itemRendererFactory();\n\t\t\t\titemRenderer.name = firstItemName;\n\t\t\t\treturn itemRenderer;\n\t\t\t};\n\t\t\tvar usedFirstItemRendererFactory:Boolean = false;\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_ADD, function(event:Event):void\n\t\t\t{\n\t\t\t\tif(!(event.data is IGroupedListItemRenderer))\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar itemRenderer:IGroupedListItemRenderer = IGroupedListItemRenderer(event.data);\n\t\t\t\tif(itemRenderer.groupIndex == 1 && itemRenderer.itemIndex == 0 &&\n\t\t\t\t\titemRenderer.name === firstItemName)\n\t\t\t\t{\n\t\t\t\t\tusedFirstItemRendererFactory = true;\n\t\t\t\t}\n\t\t\t})\n\t\t\tthis._list.validate();\n\t\t\tAssert.assertTrue(\"firstItemRendererFactory not used when data provider has multiple items in group\", usedFirstItemRendererFactory);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCustomFirstItemRendererStyleNameWithMultipleItemsInGroup():void\n\t\t{\n\t\t\tvar firstStyleName:String = \"custom-first-item\";\n\t\t\tthis._list.customFirstItemRendererStyleName = firstStyleName;\n\t\t\tvar containsFirstItemRendererStyleName:Boolean = false;\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_ADD, function(event:Event):void\n\t\t\t{\n\t\t\t\tif(!(event.data is IGroupedListItemRenderer))\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar itemRenderer:IGroupedListItemRenderer = IGroupedListItemRenderer(event.data);\n\t\t\t\tif(itemRenderer.groupIndex == 1 && itemRenderer.itemIndex == 0 &&\n\t\t\t\t\titemRenderer.styleNameList.contains(firstStyleName))\n\t\t\t\t{\n\t\t\t\t\tcontainsFirstItemRendererStyleName = true;\n\t\t\t\t}\n\t\t\t})\n\t\t\tthis._list.validate();\n\t\t\tAssert.assertTrue(\"customFirstItemRendererStyleName not used when data provider has multiple items in group\", containsFirstItemRendererStyleName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLastItemRendererFactoryWithMultipleItemsInGroup():void\n\t\t{\n\t\t\tvar lastItemName:String = \"last-item\";\n\t\t\tthis._list.lastItemRendererFactory = function():DefaultGroupedListItemRenderer\n\t\t\t{\n\t\t\t\tvar itemRenderer:DefaultGroupedListItemRenderer = _list.itemRendererFactory();\n\t\t\t\titemRenderer.name = lastItemName;\n\t\t\t\treturn itemRenderer;\n\t\t\t};\n\t\t\tvar usedLastItemRendererFactory:Boolean = false;\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_ADD, function(event:Event):void\n\t\t\t{\n\t\t\t\tif(!(event.data is IGroupedListItemRenderer))\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar itemRenderer:IGroupedListItemRenderer = IGroupedListItemRenderer(event.data);\n\t\t\t\tif(itemRenderer.groupIndex === 1 && itemRenderer.itemIndex === 2 &&\n\t\t\t\t\titemRenderer.name === lastItemName)\n\t\t\t\t{\n\t\t\t\t\tusedLastItemRendererFactory = true;\n\t\t\t\t}\n\t\t\t})\n\t\t\tthis._list.validate();\n\t\t\tAssert.assertTrue(\"lastItemRendererFactory not used when data provider has multiple items in group\", usedLastItemRendererFactory);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCustomLastItemRendererStyleNameWithMultipleItemsInGroup():void\n\t\t{\n\t\t\tvar lastStyleName:String = \"custom-last-item\";\n\t\t\tthis._list.customLastItemRendererStyleName = lastStyleName;\n\t\t\tvar containsLastItemRendererStyleName:Boolean = false;\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_ADD, function(event:Event):void\n\t\t\t{\n\t\t\t\tif(!(event.data is IGroupedListItemRenderer))\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar itemRenderer:IGroupedListItemRenderer = IGroupedListItemRenderer(event.data);\n\t\t\t\tif(itemRenderer.groupIndex === 1 && itemRenderer.itemIndex === 2 &&\n\t\t\t\t\titemRenderer.styleNameList.contains(lastStyleName))\n\t\t\t\t{\n\t\t\t\t\tcontainsLastItemRendererStyleName = true;\n\t\t\t\t}\n\t\t\t})\n\t\t\tthis._list.validate();\n\t\t\tAssert.assertTrue(\"customLastItemRendererStyleName not used when data provider has multiple items in group\", containsLastItemRendererStyleName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFirstItemRendererFactoryWithOneItemAndCustomLastItemRendererFactory():void\n\t\t{\n\t\t\tvar firstItemName:String = \"first-item\";\n\t\t\tvar lastItemName:String = \"last-item\";\n\t\t\tthis._list.firstItemRendererFactory = function():DefaultGroupedListItemRenderer\n\t\t\t{\n\t\t\t\tvar itemRenderer:DefaultGroupedListItemRenderer = _list.itemRendererFactory();\n\t\t\t\titemRenderer.name = firstItemName;\n\t\t\t\treturn itemRenderer;\n\t\t\t};\n\t\t\tthis._list.lastItemRendererFactory = function():DefaultGroupedListItemRenderer\n\t\t\t{\n\t\t\t\tvar itemRenderer:DefaultGroupedListItemRenderer = _list.itemRendererFactory();\n\t\t\t\titemRenderer.name = lastItemName;\n\t\t\t\treturn itemRenderer;\n\t\t\t};\n\t\t\tvar usedFirstItemRendererFactory:Boolean = false;\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_ADD, function(event:Event):void\n\t\t\t{\n\t\t\t\tif(!(event.data is IGroupedListItemRenderer))\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar itemRenderer:IGroupedListItemRenderer = IGroupedListItemRenderer(event.data);\n\t\t\t\tif(itemRenderer.groupIndex == 2 && itemRenderer.itemIndex == 0 &&\n\t\t\t\t\titemRenderer.name === firstItemName)\n\t\t\t\t{\n\t\t\t\t\tusedFirstItemRendererFactory = true;\n\t\t\t\t}\n\t\t\t})\n\t\t\tthis._list.validate();\n\t\t\tAssert.assertTrue(\"firstItemRendererFactory not used when data provider has only one item in group and lastItemRendererFactory is defined\", usedFirstItemRendererFactory);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCustomFirstItemRendererStyleNameWithOneItemAndCustomLastItemRendererStyleName():void\n\t\t{\n\t\t\tvar firstStyleName:String = \"custom-first-item\";\n\t\t\tvar lastStyleName:String = \"custom-last-item\";\n\t\t\tthis._list.customFirstItemRendererStyleName = firstStyleName;\n\t\t\tthis._list.customLastItemRendererStyleName = lastStyleName;\n\t\t\tvar containsFirstItemRendererStyleName:Boolean = false;\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_ADD, function(event:Event):void\n\t\t\t{\n\t\t\t\tif(!(event.data is IGroupedListItemRenderer))\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar itemRenderer:IGroupedListItemRenderer = IGroupedListItemRenderer(event.data);\n\t\t\t\tif(itemRenderer.groupIndex == 2 && itemRenderer.itemIndex == 0 &&\n\t\t\t\t\titemRenderer.styleNameList.contains(firstStyleName))\n\t\t\t\t{\n\t\t\t\t\tcontainsFirstItemRendererStyleName = true;\n\t\t\t\t}\n\t\t\t})\n\t\t\tthis._list.validate();\n\t\t\tAssert.assertTrue(\"customFirstItemRendererStyleName not used when data provider has only one item in group and customLastItemRendererStyleName is defined\", containsFirstItemRendererStyleName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSingleItemRendererFactoryWithOneItemAndOtherFactories():void\n\t\t{\n\t\t\tvar firstItemName:String = \"first-item\";\n\t\t\tvar lastItemName:String = \"last-item\";\n\t\t\tvar singleItemName:String = \"single-item\";\n\t\t\tthis._list.firstItemRendererFactory = function():DefaultGroupedListItemRenderer\n\t\t\t{\n\t\t\t\tvar itemRenderer:DefaultGroupedListItemRenderer = _list.itemRendererFactory();\n\t\t\t\titemRenderer.name = firstItemName;\n\t\t\t\treturn itemRenderer;\n\t\t\t};\n\t\t\tthis._list.lastItemRendererFactory = function():DefaultGroupedListItemRenderer\n\t\t\t{\n\t\t\t\tvar itemRenderer:DefaultGroupedListItemRenderer = _list.itemRendererFactory();\n\t\t\t\titemRenderer.name = lastItemName;\n\t\t\t\treturn itemRenderer;\n\t\t\t};\n\t\t\tthis._list.singleItemRendererFactory = function():DefaultGroupedListItemRenderer\n\t\t\t{\n\t\t\t\tvar itemRenderer:DefaultGroupedListItemRenderer = _list.itemRendererFactory();\n\t\t\t\titemRenderer.name = singleItemName;\n\t\t\t\treturn itemRenderer;\n\t\t\t};\n\t\t\tvar usedSingleItemRendererFactory:Boolean = false;\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_ADD, function(event:Event):void\n\t\t\t{\n\t\t\t\tif(!(event.data is IGroupedListItemRenderer))\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar itemRenderer:IGroupedListItemRenderer = IGroupedListItemRenderer(event.data);\n\t\t\t\tif(itemRenderer.groupIndex == 2 && itemRenderer.itemIndex == 0 &&\n\t\t\t\t\titemRenderer.name === singleItemName)\n\t\t\t\t{\n\t\t\t\t\tusedSingleItemRendererFactory = true;\n\t\t\t\t}\n\t\t\t})\n\t\t\tthis._list.validate();\n\t\t\tAssert.assertTrue(\"singleItemRendererFactory not used when data provider has only one item in group and firstItemRendererFactory and lastItemRendererFactory are defined\", singleItemName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCustomSingleItemRendererStyleNameWithOneItemAndOtherStyleNames():void\n\t\t{\n\t\t\tvar firstStyleName:String = \"custom-first-item\";\n\t\t\tvar lastStyleName:String = \"custom-last-item\";\n\t\t\tvar singleStyleName:String = \"custom-single-item\";\n\t\t\tthis._list.customFirstItemRendererStyleName = firstStyleName;\n\t\t\tthis._list.customLastItemRendererStyleName = lastStyleName;\n\t\t\tthis._list.customSingleItemRendererStyleName = singleStyleName;\n\t\t\tvar containsSingleItemRendererStyleName:Boolean = false;\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_ADD, function(event:Event):void\n\t\t\t{\n\t\t\t\tif(!(event.data is IGroupedListItemRenderer))\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar itemRenderer:IGroupedListItemRenderer = IGroupedListItemRenderer(event.data);\n\t\t\t\tif(itemRenderer.groupIndex == 2 && itemRenderer.itemIndex == 0 &&\n\t\t\t\t\titemRenderer.styleNameList.contains(singleStyleName))\n\t\t\t\t{\n\t\t\t\t\tcontainsSingleItemRendererStyleName = true;\n\t\t\t\t}\n\t\t\t})\n\t\t\tthis._list.validate();\n\t\t\tAssert.assertTrue(\"containsSingleItemRendererStyleName not used when data provider has only one item in group and customFirstItemRendererStyleName or customLastItemRendererStyleName are defined\", containsSingleItemRendererStyleName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLastItemRendererFactoryWithOneItem():void\n\t\t{\n\t\t\tvar componentName:String = \"last-item\";\n\t\t\tthis._list.lastItemRendererFactory = function():DefaultGroupedListItemRenderer\n\t\t\t{\n\t\t\t\tvar itemRenderer:DefaultGroupedListItemRenderer = _list.itemRendererFactory();\n\t\t\t\titemRenderer.name = componentName;\n\t\t\t\treturn itemRenderer;\n\t\t\t};\n\t\t\tvar usedLastItemRendererFactory:Boolean = false;\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_ADD, function(event:Event):void\n\t\t\t{\n\t\t\t\tif(!(event.data is IGroupedListItemRenderer))\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar itemRenderer:IGroupedListItemRenderer = IGroupedListItemRenderer(event.data);\n\t\t\t\tif(itemRenderer.groupIndex == 2 && itemRenderer.itemIndex == 0 &&\n\t\t\t\t\titemRenderer.name === componentName)\n\t\t\t\t{\n\t\t\t\t\tusedLastItemRendererFactory = true;\n\t\t\t\t}\n\t\t\t})\n\t\t\tthis._list.validate();\n\t\t\tAssert.assertTrue(\"lastItemRendererFactory not used when data provider has only one item in group and neither firstItemRendererFactory or singleItemRendererFactory are defined\", usedLastItemRendererFactory);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCustomLastItemRendererStyleNameWithOneItem():void\n\t\t{\n\t\t\tvar styleName:String = \"custom-last-item\";\n\t\t\tthis._list.customLastItemRendererStyleName = styleName;\n\t\t\tvar containsLastItemRendererStyleName:Boolean = false;\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_ADD, function(event:Event):void\n\t\t\t{\n\t\t\t\tif(!(event.data is IGroupedListItemRenderer))\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar itemRenderer:IGroupedListItemRenderer = IGroupedListItemRenderer(event.data);\n\t\t\t\tif(itemRenderer.groupIndex == 2 && itemRenderer.itemIndex == 0 &&\n\t\t\t\t\titemRenderer.styleNameList.contains(styleName))\n\t\t\t\t{\n\t\t\t\t\tcontainsLastItemRendererStyleName = true;\n\t\t\t\t}\n\t\t\t})\n\t\t\tthis._list.validate();\n\t\t\tAssert.assertTrue(\"customLastItemRendererStyleName not used when data provider has only one item in group and neither customFirstItemRendererStyleName or customSingleItemRendererStyleName are defined\", containsLastItemRendererStyleName);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testItemToItemRenderer():void\n\t\t{\n\t\t\tthis._list.height = 220;\n\t\t\tthis._list.validate();\n\t\t\tvar item00:Object = this._list.dataProvider.getItemAt(0, 0);\n\t\t\tvar itemRenderer00:IGroupedListItemRenderer = this._list.itemToItemRenderer(item00);\n\t\t\tvar item01:Object = this._list.dataProvider.getItemAt(0, 1);\n\t\t\tvar itemRenderer01:IGroupedListItemRenderer = this._list.itemToItemRenderer(item01);\n\t\t\tvar item20:Object = this._list.dataProvider.getItemAt(2, 0);\n\t\t\tvar itemRenderer20:IGroupedListItemRenderer = this._list.itemToItemRenderer(item20);\n\t\t\tAssert.assertNotNull(\"itemToItemRenderer() incorrectly returned null for item at index 0,0 that should have an item renderer\", itemRenderer00);\n\t\t\tAssert.assertStrictlyEquals(\"Item renderer returned by itemToItemRenderer() has incorrect data\", item00, itemRenderer00.data);\n\t\t\tAssert.assertStrictlyEquals(\"Item renderer returned by itemToItemRenderer() has incorrect group index\", 0, itemRenderer00.groupIndex);\n\t\t\tAssert.assertStrictlyEquals(\"Item renderer returned by itemToItemRenderer() has incorrect item index\", 0, itemRenderer00.itemIndex);\n\t\t\tAssert.assertNotNull(\"itemToItemRenderer() incorrectly returned null for item at index 0,1 that should have an item renderer\", itemRenderer01);\n\t\t\tAssert.assertStrictlyEquals(\"Item renderer returned by itemToItemRenderer() has incorrect data\", item01, itemRenderer01.data);\n\t\t\tAssert.assertStrictlyEquals(\"Item renderer returned by itemToItemRenderer() has incorrect group index\", 0, itemRenderer01.groupIndex);\n\t\t\tAssert.assertStrictlyEquals(\"Item renderer returned by itemToItemRenderer() has incorrect item index\", 1, itemRenderer01.itemIndex);\n\t\t\tAssert.assertNull(\"itemToItemRenderer() incorrectly returned item renderer for item that should not have one\", itemRenderer20);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHeaderDataToHeaderRenderer():void\n\t\t{\n\t\t\tthis._list.height = 20;\n\t\t\tthis._list.validate();\n\t\t\tvar group0:Object = this._list.dataProvider.getItemAt(0);\n\t\t\tvar header0:Object = this._list.groupToHeaderData(group0);\n\t\t\tvar headerRenderer0:IGroupedListHeaderRenderer = this._list.headerDataToHeaderRenderer(header0);\n\t\t\tvar group1:Object = this._list.dataProvider.getItemAt(1);\n\t\t\tvar header1:Object = this._list.groupToHeaderData(group1);\n\t\t\tvar headerRenderer1:IGroupedListHeaderRenderer = this._list.headerDataToHeaderRenderer(header1);\n\t\t\tAssert.assertNotNull(\"headerDataToHeaderRenderer() incorrectly returned null for header at group index 0\", headerRenderer0);\n\t\t\tAssert.assertStrictlyEquals(\"Header renderer returned by headerDataToHeaderRenderer() has incorrect header data\", header0, headerRenderer0.data);\n\t\t\tAssert.assertStrictlyEquals(\"Header renderer returned by headerDataToHeaderRenderer() has incorrect group index\", 0, headerRenderer0.groupIndex);\n\t\t\tAssert.assertNull(\"headerDataToHeaderRenderer() incorrectly returned header renderer for header data that should not have one\", headerRenderer1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGroupToHeaderData():void\n\t\t{\n\t\t\tvar rawData:Array = ArrayHierarchicalCollection(this._list.dataProvider).arrayData;\n\t\t\tvar group0:Object = this._list.dataProvider.getItemAt(0);\n\t\t\tvar header0:Object = this._list.groupToHeaderData(group0);\n\t\t\tvar group1:Object = this._list.dataProvider.getItemAt(1);\n\t\t\tvar header1:Object = this._list.groupToHeaderData(group1);\n\t\t\tAssert.assertStrictlyEquals(\"groupToHeaderData() incorrectly returned wrong header data for index 0\", header0, rawData[0].header);\n\t\t\tAssert.assertStrictlyEquals(\"groupToHeaderData() incorrectly returned wrong header data for index 1\", header1, rawData[1].header);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoErrorOnRemoveItemWithFirstItemRendererFactory():void\n\t\t{\n\t\t\tthis._list.firstItemRendererFactory = function():DefaultGroupedListItemRenderer\n\t\t\t{\n\t\t\t\treturn _list.itemRendererFactory();\n\t\t\t};\n\t\t\tthis._list.validate();\n\t\t\tthis._list.dataProvider.removeItemAt(1, 0);\n\t\t\tthis._list.validate();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoErrorOnRemoveItemWithLastItemRendererFactory():void\n\t\t{\n\t\t\tthis._list.lastItemRendererFactory = function():DefaultGroupedListItemRenderer\n\t\t\t{\n\t\t\t\treturn _list.itemRendererFactory();\n\t\t\t};\n\t\t\tthis._list.validate();\n\t\t\tthis._list.dataProvider.removeItemAt(0, 2);\n\t\t\tthis._list.validate();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCustomFirstItemRendererStyleNameWithoutFirstItemRendererFactory():void\n\t\t{\n\t\t\tvar firstStyleName:String = \"custom-first-item\";\n\t\t\tthis._list.customFirstItemRendererStyleName = firstStyleName;\n\t\t\tvar usedDefaultItemRendererFactory:Boolean = false;\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_ADD, function(event:Event):void\n\t\t\t{\n\t\t\t\tif(!(event.data is IGroupedListItemRenderer))\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar itemRenderer:DefaultGroupedListItemRenderer = DefaultGroupedListItemRenderer(event.data);\n\t\t\t\tif(itemRenderer.groupIndex == 1 && itemRenderer.itemIndex == 0 &&\n\t\t\t\t\titemRenderer.styleNameList.contains(firstStyleName) &&\n\t\t\t\t\titemRenderer.defaultSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tusedDefaultItemRendererFactory = true;\n\t\t\t\t}\n\t\t\t})\n\t\t\tthis._list.validate();\n\t\t\tAssert.assertTrue(\"itemRendererFactory not used when customFirstItemRendererStyleName defined, but firstItemRendererFactory is null\", usedDefaultItemRendererFactory);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCustomLastItemRendererStyleNameWithoutLastItemRendererFactory():void\n\t\t{\n\t\t\tvar lastStyleName:String = \"custom-last-item\";\n\t\t\tthis._list.customLastItemRendererStyleName = lastStyleName;\n\t\t\tvar usedDefaultItemRendererFactory:Boolean = false;\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_ADD, function(event:Event):void\n\t\t\t{\n\t\t\t\tif(!(event.data is IGroupedListItemRenderer))\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar itemRenderer:DefaultGroupedListItemRenderer = DefaultGroupedListItemRenderer(event.data);\n\t\t\t\tif(itemRenderer.groupIndex === 1 && itemRenderer.itemIndex === 2 &&\n\t\t\t\t\titemRenderer.styleNameList.contains(lastStyleName) &&\n\t\t\t\t\titemRenderer.defaultSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tusedDefaultItemRendererFactory = true;\n\t\t\t\t}\n\t\t\t})\n\t\t\tthis._list.validate();\n\t\t\tAssert.assertTrue(\"itemRendererFactory not used when customLastItemRendererStyleName defined, but lastItemRendererFactory is null\", usedDefaultItemRendererFactory);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCustomSingleItemRendererStyleNameWithoutSingleItemRendererFactory():void\n\t\t{\n\t\t\tvar singleStyleName:String = \"custom-single-item\";\n\t\t\tthis._list.customSingleItemRendererStyleName = singleStyleName;\n\t\t\tvar usedDefaultItemRendererFactory:Boolean = false;\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_ADD, function(event:Event):void\n\t\t\t{\n\t\t\t\tif(!(event.data is IGroupedListItemRenderer))\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar itemRenderer:DefaultGroupedListItemRenderer = DefaultGroupedListItemRenderer(event.data);\n\t\t\t\tif(itemRenderer.groupIndex == 2 && itemRenderer.itemIndex == 0 &&\n\t\t\t\t\titemRenderer.styleNameList.contains(singleStyleName) &&\n\t\t\t\t\titemRenderer.defaultSkin !== null)\n\t\t\t\t{\n\t\t\t\t\tusedDefaultItemRendererFactory = true;\n\t\t\t\t}\n\t\t\t})\n\t\t\tthis._list.validate();\n\t\t\tAssert.assertTrue(\"itemRendererFactory not used when customSingleItemRendererStyleName defined, but singleItemRendererFactory is null\", usedDefaultItemRendererFactory);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testResizeOnUpdateItemAtWithLongerText():void\n\t\t{\n\t\t\tthis._list.dataProvider.getItemAt(0, 1).label = \"I am the very model of a modern major general. I've information vegetable, animal, and mineral.\";\n\t\t\tthis._list.dataProvider.updateItemAt(0, 1);\n\t\t\tvar hasResized:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.RESIZE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasResized = true;\n\t\t\t});\n\t\t\tthis._list.validate();\n\t\t\tAssert.assertTrue(\"GroupedList Event.RESIZE was not dispatched when item was updated with longer text and width was not explicit\", hasResized);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testViewPortBoundsValues():void\n\t\t{\n\t\t\tthis._list.layout = new AssertViewPortBoundsLayout();\n\t\t\tthis._list.validate();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testScrollToDisplayIndexAndSetDataProviderToNull():void\n\t\t{\n\t\t\tthis._list.scrollToDisplayIndex(1, 1, 2);\n\t\t\tthis._list.dataProvider = null;\n\t\t\tthis._list.validate();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testScrollToDisplayIndex():void\n\t\t{\n\t\t\tvar hasDispatchedScrollStart:Boolean = false;\n\t\t\tthis._list.addEventListener(FeathersEventType.SCROLL_START, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedScrollStart = true;\n\t\t\t});\n\t\t\tvar hasDispatchedScrollComplete:Boolean = false;\n\t\t\tthis._list.addEventListener(FeathersEventType.SCROLL_COMPLETE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedScrollComplete = true;\n\t\t\t});\n\t\t\tthis._list.height = 200;\n\t\t\tthis._list.scrollToDisplayIndex(1, 1);\n\t\t\tthis._list.validate();\n\t\t\tAssert.assertTrue(\"GroupedList: scrollToDisplayIndex() set incorrect verticalScrollPosition\", this._list.verticalScrollPosition > 0);\n\t\t\tAssert.assertTrue(\"GroupedList: scrollToDisplayIndex() with duration 0 did not dispatch FeathersEventType.SCROLL_START\",\n\t\t\t\thasDispatchedScrollStart);\n\t\t\tAssert.assertTrue(\"GroupedList: scrollToDisplayIndex() with duration 0 did not dispatch FeathersEventType.SCROLL_COMPLETE\",\n\t\t\t\thasDispatchedScrollComplete);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTriggeredByTap():void\n\t\t{\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tvar triggeredItem:Object = null;\n\t\t\tthis._list.addEventListener(Event.TRIGGERED, function(event:Event, item:Object):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t\ttriggeredItem = item;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 410);\n\t\t\tvar target:DisplayObject = this._list.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t//this touch does not move at all, so it should result in triggering\n\t\t\t//the button.\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertTrue(\"Event.TRIGGERED was not dispatched\", hasTriggered);\n\t\t\tAssert.assertStrictlyEquals(\"Incorrect item passed to Event.TRIGGERED listener\",\n\t\t\t\tthis._list.dataProvider.getItemAt(0, 1), triggeredItem);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/HeaderInternalStateTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Header;\n\timport feathers.controls.text.BitmapFontTextRenderer;\n\timport feathers.core.ITextRenderer;\n\timport feathers.layout.HorizontalAlign;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\n\tpublic class HeaderInternalStateTests\n\t{\n\t\tprivate static const LEFT_ITEM_WIDTH:Number = 12;\n\t\tprivate static const LEFT_ITEM_HEIGHT:Number = 16;\n\t\t\n\t\tprivate var _header:Header;\n\t\tprivate var _textRenderer:BitmapFontTextRenderer;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._header = new Header();\n\t\t\tthis._header.titleFactory = function():ITextRenderer\n\t\t\t{\n\t\t\t\tvar textRenderer:BitmapFontTextRenderer = new BitmapFontTextRenderer();\n\t\t\t\ttextRenderer.name = \"title\";\n\t\t\t\treturn textRenderer;\n\t\t\t};\n\t\t\tTestFeathers.starlingRoot.addChild(this._header);\n\n\t\t\tthis._textRenderer = new BitmapFontTextRenderer();\n\t\t\tTestFeathers.starlingRoot.addChild(this._textRenderer);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._header.removeFromParent(true);\n\t\t\tthis._header = null;\n\n\t\t\tthis._textRenderer.removeFromParent(true);\n\t\t\tthis._textRenderer = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testBackgroundSkinResizeWhenItemsChangeButDimensionsDoNot():void\n\t\t{\n\t\t\tvar quad:Quad = new Quad(LEFT_ITEM_WIDTH, LEFT_ITEM_HEIGHT, 0x00ff00);\n\t\t\tvar backgroundSkin:Quad = new Quad(1, 1, 0xff00ff);\n\t\t\tthis._header.backgroundSkin = backgroundSkin;\n\t\t\tthis._header.leftItems = new <DisplayObject>[quad];\n\t\t\tthis._header.validate();\n\t\t\tthis._header.leftItems = new <DisplayObject>[quad];\n\t\t\tthis._header.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The Header backgroundSkin width was not resized correctly when changing the items\",\n\t\t\t\tLEFT_ITEM_WIDTH, backgroundSkin.width);\n\t\t\tAssert.assertStrictlyEquals(\"The Header backgroundSkin height was not resized correctly when changing the items\",\n\t\t\t\tLEFT_ITEM_HEIGHT, backgroundSkin.height);\n\t\t\tquad.dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testBackgroundSkinResizeWhenExplicitDimensionsChange():void\n\t\t{\n\t\t\tvar backgroundSkin:Quad = new Quad(1, 1, 0xff00ff);\n\t\t\tthis._header.backgroundSkin = backgroundSkin;\n\t\t\tthis._header.validate();\n\t\t\tthis._header.setSize(LEFT_ITEM_WIDTH, LEFT_ITEM_HEIGHT);\n\t\t\tthis._header.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The Header backgroundSkin width was not resized correctly when setting dimensions explicitly\",\n\t\t\t\tLEFT_ITEM_WIDTH, backgroundSkin.width);\n\t\t\tAssert.assertStrictlyEquals(\"The Header backgroundSkin height was not resized correctly when setting dimensions explicitly\",\n\t\t\t\tLEFT_ITEM_HEIGHT, backgroundSkin.height);\n\n\t\t\tthis._header.width = NaN;\n\t\t\tthis._header.height = NaN;\n\t\t\tthis._header.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The Header backgroundSkin width was not resized correctly after reset dimensions to auto-size\",\n\t\t\t\t1, backgroundSkin.width);\n\t\t\tAssert.assertStrictlyEquals(\"The Header backgroundSkin height was not resized correctly when reset dimensions to auto-size\",\n\t\t\t\t1, backgroundSkin.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testBackgroundSkinResizeWhenTitleChanges():void\n\t\t{\n\t\t\tvar title:String = \"I am the very model of a modern major general\";\n\n\t\t\tthis._textRenderer.text = title;\n\t\t\tthis._textRenderer.validate();\n\t\t\t\n\t\t\tvar backgroundSkin:Quad = new Quad(1, 1, 0xff00ff);\n\t\t\tthis._header.backgroundSkin = backgroundSkin;\n\t\t\tthis._header.validate();\n\t\t\tthis._header.title = title;\n\t\t\tthis._header.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The Header backgroundSkin width was not resized correctly when changing to larger title\",\n\t\t\t\tthis._textRenderer.width, backgroundSkin.width);\n\t\t\tAssert.assertStrictlyEquals(\"The Header backgroundSkin height was not resized correctly when changing to larger title\",\n\t\t\t\tthis._textRenderer.height, backgroundSkin.height);\n\t\t\t\n\t\t\ttitle = \"I am the very model\";\n\t\t\tthis._textRenderer.text = title;\n\t\t\tthis._textRenderer.validate();\n\t\t\tthis._header.title = title;\n\t\t\tthis._header.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The Header backgroundSkin width was not resized correctly when changing to smaller title\",\n\t\t\t\tthis._textRenderer.width, backgroundSkin.width);\n\t\t\tAssert.assertStrictlyEquals(\"The Header backgroundSkin height was not resized correctly when changing to smaller title\",\n\t\t\t\tthis._textRenderer.height, backgroundSkin.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTitleHiddenWithTitleAlignCenterAndCenterItemsNotEmpty():void\n\t\t{\n\t\t\tvar centerItem:Quad = new Quad(10, 10, 0xff00ff);\n\t\t\tthis._header.title = \"Header\";\n\t\t\tthis._header.titleAlign = HorizontalAlign.CENTER;\n\t\t\tthis._header.centerItems = new <DisplayObject>[centerItem];\n\t\t\tthis._header.validate();\n\t\t\tAssert.assertFalse(\"Header title not hidden when titleAlign is HorizontalAlign.CENTER and centerItems is not empty.\",\n\t\t\t\tthis._header.getChildByName(\"title\").visible);\n\t\t\tcenterItem.dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTitleHiddenWithTitleAlignLeftAndLeftItemNotEmptyAndCenterItemsNotEmpty():void\n\t\t{\n\t\t\tvar leftItem:Quad = new Quad(10, 10, 0xff00ff);\n\t\t\tvar centerItem:Quad = new Quad(10, 10, 0xff00ff);\n\t\t\tthis._header.title = \"Header\";\n\t\t\tthis._header.titleAlign = HorizontalAlign.LEFT;\n\t\t\tthis._header.leftItems = new <DisplayObject>[leftItem];\n\t\t\tthis._header.centerItems = new <DisplayObject>[centerItem];\n\t\t\tthis._header.validate();\n\t\t\tAssert.assertFalse(\"Header title not hidden when titleAlign is HorizontalAlign.LEFT and both leftItems and centerItems are not empty.\",\n\t\t\t\tthis._header.getChildByName(\"title\").visible);\n\t\t\tleftItem.dispose();\n\t\t\tcenterItem.dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTitleHiddenWithTitleAlignRightAndRightItemsNotEmptyAndCenterItemsNotEmpty():void\n\t\t{\n\t\t\tvar rightItem:Quad = new Quad(10, 10, 0xff00ff);\n\t\t\tvar centerItem:Quad = new Quad(10, 10, 0xff00ff);\n\t\t\tthis._header.title = \"Header\";\n\t\t\tthis._header.titleAlign = HorizontalAlign.RIGHT;\n\t\t\tthis._header.rightItems = new <DisplayObject>[rightItem];\n\t\t\tthis._header.centerItems = new <DisplayObject>[centerItem];\n\t\t\tthis._header.validate();\n\t\t\tAssert.assertFalse(\"Header title not hidden when titleAlign is HorizontalAlign.RIGHT and both rightItems and centerItems are not empty.\",\n\t\t\t\tthis._header.getChildByName(\"title\").visible);\n\t\t\trightItem.dispose();\n\t\t\tcenterItem.dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTitleNotHiddenWithTitleAlignRightAndRightItemsNotEmptyButCenterItemsIsEmpty():void\n\t\t{\n\t\t\tvar rightItem:Quad = new Quad(10, 10, 0xff00ff);\n\t\t\tvar centerItem:Quad = new Quad(10, 10, 0xff00ff);\n\t\t\tthis._header.title = \"Header\";\n\t\t\tthis._header.titleAlign = HorizontalAlign.RIGHT;\n\t\t\tthis._header.rightItems = new <DisplayObject>[rightItem];\n\t\t\tthis._header.validate();\n\t\t\tAssert.assertTrue(\"Header title incorrectly hidden when titleAlign is HorizontalAlign.RIGHT and rightItems is not empty but centerItems is empty.\",\n\t\t\t\tthis._header.getChildByName(\"title\").visible);\n\t\t\trightItem.dispose();\n\t\t\tcenterItem.dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTitleNotHiddenWithTitleAlignLeftAndLeftItemsNotEmptyButCenterItemsIsEmpty():void\n\t\t{\n\t\t\tvar leftItem:Quad = new Quad(10, 10, 0xff00ff);\n\t\t\tvar centerItem:Quad = new Quad(10, 10, 0xff00ff);\n\t\t\tthis._header.title = \"Header\";\n\t\t\tthis._header.titleAlign = HorizontalAlign.LEFT;\n\t\t\tthis._header.leftItems = new <DisplayObject>[leftItem];\n\t\t\tthis._header.validate();\n\t\t\tAssert.assertTrue(\"Header title incorrectly hidden when titleAlign is HorizontalAlign.LEFT and leftItems is not empty but centerItems is empty.\",\n\t\t\t\tthis._header.getChildByName(\"title\").visible);\n\t\t\tleftItem.dispose();\n\t\t\tcenterItem.dispose();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/HeaderMeasurementTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Header;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.text.BitmapFontTextRenderer;\n\timport feathers.core.ITextRenderer;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\n\tpublic class HeaderMeasurementTests\n\t{\n\t\tprivate static const BACKGROUND_WIDTH:Number = 200;\n\t\tprivate static const BACKGROUND_HEIGHT:Number = 250;\n\n\t\tprivate static const COMPLEX_BACKGROUND_WIDTH:Number = 340;\n\t\tprivate static const COMPLEX_BACKGROUND_HEIGHT:Number = 350;\n\t\tprivate static const COMPLEX_BACKGROUND_MIN_WIDTH:Number = 280;\n\t\tprivate static const COMPLEX_BACKGROUND_MIN_HEIGHT:Number = 290;\n\n\t\tprivate static const PADDING_TOP:Number = 50;\n\t\tprivate static const PADDING_RIGHT:Number = 54;\n\t\tprivate static const PADDING_BOTTOM:Number = 59;\n\t\tprivate static const PADDING_LEFT:Number = 60;\n\t\t\n\t\tprivate static const GAP:Number = 5;\n\t\tprivate static const TITLE_GAP:Number = 7;\n\n\t\tprivate static const LEFT_ITEM_WIDTH:Number = 12;\n\t\tprivate static const LEFT_ITEM_HEIGHT:Number = 16;\n\n\t\tprivate static const RIGHT_ITEM_WIDTH:Number = 17;\n\t\tprivate static const RIGHT_ITEM_HEIGHT:Number = 31;\n\n\t\tprivate static const CENTER_ITEM_WIDTH:Number = 14;\n\t\tprivate static const CENTER_ITEM_HEIGHT:Number = 37;\n\n\t\tprivate var _header:Header;\n\t\tprivate var _textRenderer:BitmapFontTextRenderer;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._header = new Header();\n\t\t\tthis._header.titleFactory = function():ITextRenderer\n\t\t\t{\n\t\t\t\treturn new BitmapFontTextRenderer();\n\t\t\t};\n\t\t\tTestFeathers.starlingRoot.addChild(this._header);\n\t\t\t\n\t\t\tthis._textRenderer = new BitmapFontTextRenderer();\n\t\t\tTestFeathers.starlingRoot.addChild(this._textRenderer);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._header.removeFromParent(true);\n\t\t\tthis._header = null;\n\t\t\t\n\t\t\tthis._textRenderer.removeFromParent(true);\n\t\t\tthis._textRenderer = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\tprivate function addSimpleBackground():void\n\t\t{\n\t\t\tthis._header.backgroundSkin = new Quad(BACKGROUND_WIDTH, BACKGROUND_HEIGHT, 0xff00ff);\n\t\t}\n\n\t\tprivate function addComplexBackground():void\n\t\t{\n\t\t\tvar backgroundSkin:LayoutGroup = new LayoutGroup();\n\t\t\tbackgroundSkin.width = COMPLEX_BACKGROUND_WIDTH;\n\t\t\tbackgroundSkin.height = COMPLEX_BACKGROUND_HEIGHT;\n\t\t\tbackgroundSkin.minWidth = COMPLEX_BACKGROUND_MIN_WIDTH;\n\t\t\tbackgroundSkin.minHeight = COMPLEX_BACKGROUND_MIN_HEIGHT;\n\t\t\tthis._header.backgroundSkin = backgroundSkin;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeNoBackgroundAndNoItems():void\n\t\t{\n\t\t\tthis._header.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Header was not calculated correctly when empty.\",\n\t\t\t\t0, this._header.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Header was not calculated correctly when empty.\",\n\t\t\t\t0, this._header.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Header was not calculated correctly when empty.\",\n\t\t\t\t0, this._header.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Header was not calculated correctly when empty.\",\n\t\t\t\t0, this._header.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithSimpleBackgroundAndNoChildren():void\n\t\t{\n\t\t\tthis.addSimpleBackground();\n\t\t\tthis._header.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Header was not calculated correctly with background skin and no children.\",\n\t\t\t\tBACKGROUND_WIDTH, this._header.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Header was not calculated correctly with background skin and no children.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._header.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Header was not calculated correctly with background skin and no children.\",\n\t\t\t\tBACKGROUND_WIDTH, this._header.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Header was not calculated correctly with background skin and no children.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._header.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithComplexBackgroundAndNoChildren():void\n\t\t{\n\t\t\tthis.addComplexBackground();\n\t\t\tthis._header.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Header was not calculated correctly with complex background skin and no children.\",\n\t\t\t\tCOMPLEX_BACKGROUND_WIDTH, this._header.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Header was not calculated correctly with complex background skin and no children.\",\n\t\t\t\tCOMPLEX_BACKGROUND_HEIGHT, this._header.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Header was not calculated correctly with complex background skin and no children.\",\n\t\t\t\tCOMPLEX_BACKGROUND_MIN_WIDTH, this._header.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Header was not calculated correctly with complex background skin and no children.\",\n\t\t\t\tCOMPLEX_BACKGROUND_MIN_HEIGHT, this._header.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDimensionsWithPaddingGapTitleGapNoChildren():void\n\t\t{\n\t\t\tthis._header.paddingTop = PADDING_TOP;\n\t\t\tthis._header.paddingRight = PADDING_RIGHT;\n\t\t\tthis._header.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._header.paddingLeft = PADDING_LEFT;\n\t\t\tthis._header.gap = GAP;\n\t\t\tthis._header.titleGap = TITLE_GAP;\n\t\t\tthis._header.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Header was not calculated correctly with left and right padding.\",\n\t\t\t\tPADDING_LEFT + PADDING_RIGHT, this._header.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Header was not calculated correctly with top and bottom padding.\",\n\t\t\t\tPADDING_TOP + PADDING_BOTTOM, this._header.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Header was not calculated correctly with left and right padding.\",\n\t\t\t\tPADDING_LEFT + PADDING_RIGHT, this._header.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Header was not calculated correctly with top and bottom padding.\",\n\t\t\t\tPADDING_TOP + PADDING_BOTTOM, this._header.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithSimpleBackgroundPaddingAndGap():void\n\t\t{\n\t\t\tthis._header.paddingTop = PADDING_TOP;\n\t\t\tthis._header.paddingRight = PADDING_RIGHT;\n\t\t\tthis._header.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._header.paddingLeft = PADDING_LEFT;\n\t\t\tthis._header.gap = GAP;\n\t\t\tthis._header.titleGap = TITLE_GAP;\n\t\t\tthis.addSimpleBackground();\n\t\t\tthis._header.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Header was not calculated correctly with background skin, padding, and gap.\",\n\t\t\t\tBACKGROUND_WIDTH, this._header.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Header was not calculated correctly with background skin, padding, and gap.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._header.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Header was not calculated correctly with background skin, padding, and gap.\",\n\t\t\t\tBACKGROUND_WIDTH, this._header.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Header was not calculated correctly with background skin, padding, and gap.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._header.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDimensionsWithTitle():void\n\t\t{\n\t\t\tvar title:String = \"I am the very model of a modern major general\";\n\t\t\t\n\t\t\tthis._header.title = title;\n\t\t\tthis._header.validate();\n\n\t\t\tthis._textRenderer.text = title;\n\t\t\tthis._textRenderer.validate();\n\t\t\t\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Header was not calculated correctly with title.\",\n\t\t\t\tthis._textRenderer.width, this._header.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Header was not calculated correctly with title.\",\n\t\t\t\tthis._textRenderer.height, this._header.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Header was not calculated correctly with title.\",\n\t\t\t\tthis._textRenderer.minWidth, this._header.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Header was not calculated correctly with title.\",\n\t\t\t\tthis._textRenderer.minHeight, this._header.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDimensionsWithTitleAndSimpleBackground():void\n\t\t{\n\t\t\tvar title:String = \"I am the very model of a modern major general\";\n\n\t\t\tthis.addSimpleBackground();\n\t\t\tthis._header.title = title;\n\t\t\tthis._header.validate();\n\n\t\t\tthis._textRenderer.text = title;\n\t\t\tthis._textRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Header was not calculated correctly with title.\",\n\t\t\t\tthis._textRenderer.width, this._header.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Header was not calculated correctly with title.\", \n\t\t\t\tBACKGROUND_HEIGHT, this._header.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Header was not calculated correctly with title.\",\n\t\t\t\tthis._textRenderer.minWidth, this._header.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Header was not calculated correctly with title.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._header.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDimensionsWithTitlePaddingGapAndTitleGap():void\n\t\t{\n\t\t\tvar title:String = \"I am the very model of a modern major general\";\n\n\t\t\tthis._header.title = title;\n\t\t\tthis._header.paddingTop = PADDING_TOP;\n\t\t\tthis._header.paddingRight = PADDING_RIGHT;\n\t\t\tthis._header.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._header.paddingLeft = PADDING_LEFT;\n\t\t\tthis._header.gap = GAP;\n\t\t\tthis._header.titleGap = TITLE_GAP;\n\t\t\tthis._header.validate();\n\n\t\t\tthis._textRenderer.text = title;\n\t\t\tthis._textRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Header was not calculated correctly with title and left and right padding.\",\n\t\t\t\tthis._textRenderer.width + PADDING_LEFT + PADDING_RIGHT, this._header.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Header was not calculated correctly with title and top and bottom padding.\",\n\t\t\t\tthis._textRenderer.height + PADDING_TOP + PADDING_BOTTOM, this._header.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Header was not calculated correctly with title and left and right padding.\",\n\t\t\t\tthis._textRenderer.minWidth + PADDING_LEFT + PADDING_RIGHT, this._header.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Header was not calculated correctly with title and top and bottom padding.\",\n\t\t\t\tthis._textRenderer.minHeight + PADDING_TOP + PADDING_BOTTOM, this._header.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDimensionsWithTitleOneLeftItemPaddingGapAndTitleGap():void\n\t\t{\n\t\t\tvar title:String = \"I am the very model of a modern major general\";\n\n\t\t\tthis._header.title = title;\n\t\t\tthis._header.paddingTop = PADDING_TOP;\n\t\t\tthis._header.paddingRight = PADDING_RIGHT;\n\t\t\tthis._header.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._header.paddingLeft = PADDING_LEFT;\n\t\t\tthis._header.gap = GAP;\n\t\t\tthis._header.titleGap = TITLE_GAP;\n\t\t\tthis._header.leftItems = new <DisplayObject>[new Quad(LEFT_ITEM_WIDTH, LEFT_ITEM_HEIGHT, 0x0000ff)];\n\t\t\tthis._header.validate();\n\n\t\t\tthis._textRenderer.text = title;\n\t\t\tthis._textRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Header was not calculated correctly with title, one left item, and left and right padding, gap, and title gap.\",\n\t\t\t\tthis._textRenderer.width + LEFT_ITEM_WIDTH + TITLE_GAP + PADDING_LEFT + PADDING_RIGHT, this._header.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Header was not calculated correctly with title, one left item, and top and bottom padding.\",\n\t\t\t\tLEFT_ITEM_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._header.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Header was not calculated correctly with title, one left item, and left and right padding, gap, and title gap.\",\n\t\t\t\tthis._textRenderer.minWidth + LEFT_ITEM_WIDTH + TITLE_GAP + PADDING_LEFT + PADDING_RIGHT, this._header.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Header was not calculated correctly with title, one left item, and top and bottom padding.\",\n\t\t\t\tLEFT_ITEM_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._header.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDimensionsWithTitleOneRightItemGapAndTitleGap():void\n\t\t{\n\t\t\tvar title:String = \"I am the very model of a modern major general\";\n\n\t\t\tthis._header.title = title;\n\t\t\tthis._header.gap = GAP;\n\t\t\tthis._header.titleGap = TITLE_GAP;\n\t\t\tthis._header.rightItems = new <DisplayObject>[new Quad(RIGHT_ITEM_WIDTH, RIGHT_ITEM_HEIGHT, 0x0000ff)];\n\t\t\tthis._header.validate();\n\n\t\t\tthis._textRenderer.text = title;\n\t\t\tthis._textRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Header was not calculated correctly with title, one right item, gap, and title gap.\",\n\t\t\t\tthis._textRenderer.width + RIGHT_ITEM_WIDTH + TITLE_GAP, this._header.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Header was not calculated correctly with title and one right item.\",\n\t\t\t\tRIGHT_ITEM_HEIGHT, this._header.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Header was not calculated correctly with title, one right item, gap, and title gap.\",\n\t\t\t\tthis._textRenderer.minWidth + RIGHT_ITEM_WIDTH + TITLE_GAP, this._header.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Header was not calculated correctly with title and one right item.\",\n\t\t\t\tRIGHT_ITEM_HEIGHT, this._header.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDimensionsWithTitleTwoLeftItemsPaddingGapAndTitleGap():void\n\t\t{\n\t\t\tvar title:String = \"I am the very model of a modern major general\";\n\n\t\t\tthis._header.title = title;\n\t\t\tthis._header.paddingTop = PADDING_TOP;\n\t\t\tthis._header.paddingRight = PADDING_RIGHT;\n\t\t\tthis._header.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._header.paddingLeft = PADDING_LEFT;\n\t\t\tthis._header.gap = GAP;\n\t\t\tthis._header.titleGap = TITLE_GAP;\n\t\t\tthis._header.leftItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tnew Quad(LEFT_ITEM_WIDTH, LEFT_ITEM_HEIGHT, 0x0000ff),\n\t\t\t\tnew Quad(LEFT_ITEM_WIDTH, LEFT_ITEM_HEIGHT, 0x00ffff),\n\t\t\t];\n\t\t\tthis._header.validate();\n\n\t\t\tthis._textRenderer.text = title;\n\t\t\tthis._textRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Header was not calculated correctly with title, two left items, and left and right padding, gap, and title gap.\",\n\t\t\t\tthis._textRenderer.width + 2 * LEFT_ITEM_WIDTH + GAP + TITLE_GAP + PADDING_LEFT + PADDING_RIGHT, this._header.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Header was not calculated correctly with title, two left items, and top and bottom padding.\",\n\t\t\t\tLEFT_ITEM_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._header.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Header was not calculated correctly with title, two left items, and left and right padding, gap, and title gap.\",\n\t\t\t\tthis._textRenderer.minWidth + 2 * LEFT_ITEM_WIDTH + GAP + TITLE_GAP + PADDING_LEFT + PADDING_RIGHT, this._header.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Header was not calculated correctly with title, two left items, and top and bottom padding.\",\n\t\t\t\tLEFT_ITEM_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._header.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDimensionsWithTitleTwoLeftItemsOneRightItemPaddingGapAndTitleGap():void\n\t\t{\n\t\t\tvar title:String = \"I am the very model of a modern major general\";\n\n\t\t\tthis._header.title = title;\n\t\t\tthis._header.paddingTop = PADDING_TOP;\n\t\t\tthis._header.paddingRight = PADDING_RIGHT;\n\t\t\tthis._header.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._header.paddingLeft = PADDING_LEFT;\n\t\t\tthis._header.gap = GAP;\n\t\t\tthis._header.titleGap = TITLE_GAP;\n\t\t\tthis._header.leftItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tnew Quad(LEFT_ITEM_WIDTH, LEFT_ITEM_HEIGHT, 0x0000ff),\n\t\t\t\tnew Quad(LEFT_ITEM_WIDTH, LEFT_ITEM_HEIGHT, 0x00ffff),\n\t\t\t];\n\t\t\tthis._header.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tnew Quad(RIGHT_ITEM_WIDTH, RIGHT_ITEM_HEIGHT, 0x0000ff),\n\t\t\t];\n\t\t\tthis._header.validate();\n\n\t\t\tthis._textRenderer.text = title;\n\t\t\tthis._textRenderer.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Header was not calculated correctly with title, two left items, one right item, and left and right padding, gap, and title gap.\",\n\t\t\t\tthis._textRenderer.width + 2 * LEFT_ITEM_WIDTH + RIGHT_ITEM_WIDTH + GAP + 2 * TITLE_GAP + PADDING_LEFT + PADDING_RIGHT, this._header.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Header was not calculated correctly with title, two left items, one right item, and top and bottom padding.\",\n\t\t\t\tRIGHT_ITEM_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._header.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Header was not calculated correctly with title, two left items, one right item, and left and right padding, gap, and title gap.\",\n\t\t\t\tthis._textRenderer.minWidth + 2 * LEFT_ITEM_WIDTH + RIGHT_ITEM_WIDTH + GAP + 2 * TITLE_GAP + PADDING_LEFT + PADDING_RIGHT, this._header.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Header was not calculated correctly with title, two left items, one right item, and top and bottom padding.\",\n\t\t\t\tRIGHT_ITEM_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._header.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDimensionsWithTitleTwoLeftItemsOneRightItemThreeCenterItemsPaddingGapAndTitleGap():void\n\t\t{\n\t\t\tvar title:String = \"I am the very model of a modern major general\";\n\n\t\t\tthis._header.title = title;\n\t\t\tthis._header.paddingTop = PADDING_TOP;\n\t\t\tthis._header.paddingRight = PADDING_RIGHT;\n\t\t\tthis._header.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._header.paddingLeft = PADDING_LEFT;\n\t\t\tthis._header.gap = GAP;\n\t\t\tthis._header.titleGap = TITLE_GAP;\n\t\t\tthis._header.leftItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tnew Quad(LEFT_ITEM_WIDTH, LEFT_ITEM_HEIGHT, 0x0000ff),\n\t\t\t\tnew Quad(LEFT_ITEM_WIDTH, LEFT_ITEM_HEIGHT, 0x00ffff),\n\t\t\t];\n\t\t\tthis._header.rightItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tnew Quad(RIGHT_ITEM_WIDTH, RIGHT_ITEM_HEIGHT, 0x0000ff),\n\t\t\t];\n\t\t\tthis._header.centerItems = new <DisplayObject>\n\t\t\t[\n\t\t\t\tnew Quad(CENTER_ITEM_WIDTH, CENTER_ITEM_HEIGHT, 0x0000ff),\n\t\t\t\tnew Quad(CENTER_ITEM_WIDTH, CENTER_ITEM_HEIGHT, 0x0000ff),\n\t\t\t\tnew Quad(CENTER_ITEM_WIDTH, CENTER_ITEM_HEIGHT, 0x0000ff),\n\t\t\t];\n\t\t\tthis._header.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Header was not calculated correctly with title, two left items, one right item, three center items, and left and right padding, gap, and title gap.\",\n\t\t\t\t2 * LEFT_ITEM_WIDTH + RIGHT_ITEM_WIDTH + 3 * CENTER_ITEM_WIDTH + 5 * GAP + PADDING_LEFT + PADDING_RIGHT, this._header.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Header was not calculated correctly with title, two left items, one right item, three center items, and top and bottom padding.\",\n\t\t\t\tCENTER_ITEM_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._header.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Header was not calculated correctly with title, two left items, one right item, three center items, and left and right padding, gap, and title gap.\",\n\t\t\t\t2 * LEFT_ITEM_WIDTH + RIGHT_ITEM_WIDTH + 3 * CENTER_ITEM_WIDTH + 5 * GAP + PADDING_LEFT + PADDING_RIGHT, this._header.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Header was not calculated correctly with title, two left items, one right item, three center items, and top and bottom padding.\",\n\t\t\t\tCENTER_ITEM_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._header.minHeight);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/HeaderTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Header;\n\timport feathers.controls.Label;\n\timport feathers.tests.supportClasses.DisposeFlagQuad;\n\n\timport org.flexunit.Assert;\n\n\tpublic class HeaderTests\n\t{\n\t\tprotected var header:Header;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis.header = new Header();\n\t\t\tTestFeathers.starlingRoot.addChild(this.header);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis.header.removeFromParent(true);\n\t\t\tthis.header = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSkinsDisposed():void\n\t\t{\n\t\t\tvar backgroundSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis.header.backgroundSkin = backgroundSkin;\n\t\t\tvar backgroundDisabledSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis.header.backgroundDisabledSkin = backgroundDisabledSkin;\n\t\t\tthis.header.validate();\n\t\t\tthis.header.dispose();\n\t\t\tAssert.assertTrue(\"backgroundSkin not disposed when Header disposed.\", backgroundSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"backgroundDisabledSkin not disposed when Header disposed.\", backgroundDisabledSkin.isDisposed);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/HierarchicalCollectionTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.data.HierarchicalCollection;\n\timport feathers.events.CollectionEventType;\n\n\timport org.flexunit.Assert;\n\n\timport starling.events.Event;\n\n\tpublic class HierarchicalCollectionTests\n\t{\n\t\tprivate var _collection:HierarchicalCollection;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._collection = new HierarchicalCollection(\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\tlabel: \"1\",\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{label: \"1-A\"},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: \"1-B\",\n\t\t\t\t\t\t\tchildren:\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t{label: \"1-B-I\"},\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{label: \"1-C\"},\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: \"2\",\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{label: \"2-A\"},\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{ label: \"3\" },\n\t\t\t\t{\n\t\t\t\t\tlabel: \"4\",\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{label: \"4-A\"},\n\t\t\t\t\t\t{label: \"4-B\"},\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t]);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._collection = null;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetLength():void\n\t\t{\n\t\t\tvar length:int = this._collection.getLength();\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: getLengthAtLocation() returned incorrect length\",\n\t\t\t\t4, length);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetLengthNested():void\n\t\t{\n\t\t\tvar length:int = this._collection.getLength(3);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: getLengthAtLocation() returned incorrect length\",\n\t\t\t\t2, length);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetLengthAtLocationWithNull():void\n\t\t{\n\t\t\tvar length:int = this._collection.getLengthAtLocation();\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: getLengthAtLocation() returned incorrect length\",\n\t\t\t\t4, length);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemAt():void\n\t\t{\n\t\t\tvar item:Object = this._collection.getItemAt(1);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: getItemAt() returned incorrect item\",\n\t\t\t\tthis._collection.data[1], item);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemAtNested():void\n\t\t{\n\t\t\tvar item:Object = this._collection.getItemAt(0, 1);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: getItemAt() returned incorrect item\",\n\t\t\t\tthis._collection.data[0].children[1], item);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemAtLocation():void\n\t\t{\n\t\t\tvar indices:Vector.<int> = new <int>[1];\n\t\t\tvar item:Object = this._collection.getItemAtLocation(indices);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: getItemAtLocation() returned incorrect item\",\n\t\t\t\tthis._collection.data[1], item);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemAtNestedLocation():void\n\t\t{\n\t\t\tvar indices:Vector.<int> = new <int>[0, 1];\n\t\t\tvar item:Object = this._collection.getItemAtLocation(indices);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: getItemAtLocation() returned incorrect item\",\n\t\t\t\tthis._collection.data[0].children[1], item);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemAtNullLocation():void\n\t\t{\n\t\t\tvar item:Object = this._collection.getItemAtLocation(null);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: getItemAtLocation() returned incorrect item\",\n\t\t\t\tnull, item);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemAtEmptyLocation():void\n\t\t{\n\t\t\tvar indices:Vector.<int> = new <int>[];\n\t\t\tvar item:Object = this._collection.getItemAtLocation(indices);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: getItemAtLocation() returned incorrect item\",\n\t\t\t\tnull, item);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveAll():void\n\t\t{\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedAll:Boolean = false;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ALL, function(event:Event):void\n\t\t\t{\n\t\t\t\thasRemovedAll = true;\n\t\t\t});\n\t\t\tvar hasReset:Boolean = false;\n\t\t\tthis._collection.addEventListener(CollectionEventType.RESET, function(event:Event):void\n\t\t\t{\n\t\t\t\thasReset = true;\n\t\t\t});\n\t\t\tthis._collection.removeAll();\n\t\t\tAssert.assertTrue(\"HierarchicalCollection: Event.CHANGE was not dispatched after removeAll()\", hasChanged);\n\t\t\tAssert.assertFalse(\"HierarchicalCollection: CollectionEventType.RESET was incorrectly dispatched after removeAll()\", hasReset);\n\t\t\tAssert.assertTrue(\"HierarchicalCollection: CollectionEventType.REMOVE_ALL was not dispatched after removeAll()\", hasRemovedAll);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: the getLength() value was not changed to 0 after removeAll()\",\n\t\t\t\t0, this._collection.getLength());\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemAtLocation():void\n\t\t{\n\t\t\tvar indicesToRemove:Vector.<int> = new <int>[1];\n\t\t\tvar itemToRemove:Object = this._collection.getItemAtLocation(indicesToRemove);\n\t\t\tvar originalLength:int = this._collection.getLength();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.removeItemAtLocation(indicesToRemove);\n\t\t\tAssert.assertTrue(\"HierarchicalCollection: Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"HierarchicalCollection: CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The getLength() value was not changed\",\n\t\t\t\toriginalLength - 1, this._collection.getLength());\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The item was not removed\",\n\t\t\t\t0, this._collection.getItemLocation(itemToRemove).length);\n\t\t\tAssert.failNull(\"HierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (length)\",\n\t\t\t\t1, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (value)\",\n\t\t\t\tindicesToRemove[0], indicesFromEvent[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemAtNestedLocation():void\n\t\t{\n\t\t\tvar indicesToRemove:Vector.<int> = new <int>[0, 1];\n\t\t\tvar itemToRemove:Object = this._collection.getItemAtLocation(indicesToRemove);\n\t\t\tvar originalParentLength:int = this._collection.getLength(indicesToRemove[0]);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.removeItemAtLocation(indicesToRemove);\n\t\t\tAssert.assertTrue(\"HierarchicalCollection: Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"HierarchicalCollection: CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The getLength() value was not changed\",\n\t\t\t\toriginalParentLength - 1, this._collection.getLength(indicesToRemove[0]));\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The item was not removed\",\n\t\t\t\t0, this._collection.getItemLocation(itemToRemove).length);\n\t\t\tAssert.failNull(\"HierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (length)\",\n\t\t\t\t2, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (value)\",\n\t\t\t\tindicesToRemove[0], indicesFromEvent[0]);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (value)\",\n\t\t\t\tindicesToRemove[1], indicesFromEvent[1]);\n\t\t}\n\n\t\t[Test(expects=\"RangeError\")]\n\t\tpublic function testRemoveItemAtNullLocation():void\n\t\t{\n\t\t\tthis._collection.removeItemAtLocation(null);\n\t\t}\n\n\t\t[Test(expects=\"RangeError\")]\n\t\tpublic function testRemoveItemAtEmptyLocation():void\n\t\t{\n\t\t\tvar indices:Vector.<int> = new <int>[];\n\t\t\tthis._collection.removeItemAtLocation(indices);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemAt():void\n\t\t{\n\t\t\tvar itemToRemove:Object = this._collection.getItemAt(1);\n\t\t\tvar originalLength:int = this._collection.getLength();\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.removeItemAt(expectedIndex);\n\t\t\tAssert.assertTrue(\"HierarchicalCollection: Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"HierarchicalCollection: CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The getLength() value was not changed\",\n\t\t\t\toriginalLength - 1, this._collection.getLength());\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The item was not removed\",\n\t\t\t\t0, this._collection.getItemLocation(itemToRemove).length);\n\t\t\tAssert.failNull(\"HierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (length)\",\n\t\t\t\t1, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (value)\",\n\t\t\t\t1, indicesFromEvent[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItem():void\n\t\t{\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar itemToRemove:Object = this._collection.getItemAt(expectedIndex);\n\t\t\tvar originalLength:int = this._collection.getLength();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.removeItem(itemToRemove);\n\t\t\tAssert.assertTrue(\"HierarchicalCollection: Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"HierarchicalCollection: CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The getLength() value was not changed\",\n\t\t\t\toriginalLength - 1, this._collection.getLength());\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The item was not removed\",\n\t\t\t\t0, this._collection.getItemLocation(itemToRemove).length);\n\t\t\tAssert.failNull(\"HierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (length)\",\n\t\t\t\t1, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (value)\",\n\t\t\t\t1, indicesFromEvent[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemAtLocation():void\n\t\t{\n\t\t\tvar location:Vector.<int> = new <int>[1];\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar originalLength:int = this._collection.getLength();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.addItemAtLocation(itemToAdd, location);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The getLength() value was not changed\",\n\t\t\t\toriginalLength + 1, this._collection.getLength());\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The item was not added\",\n\t\t\t\t1, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The item was not added at the correct index\",\n\t\t\t\tlocation[0], this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.failNull(\"HierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (length)\",\n\t\t\t\t1, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (value)\",\n\t\t\t\tlocation[0], indicesFromEvent[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemAtNestedLocation():void\n\t\t{\n\t\t\tvar location:Vector.<int> = new <int>[0, 1];\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar originalParentLength:int = this._collection.getLength(location[0]);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.addItemAtLocation(itemToAdd, location);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The getLength() value was not changed\",\n\t\t\t\toriginalParentLength + 1, this._collection.getLength(location[0]));\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The item was not added\",\n\t\t\t\t2, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The item was not added at the correct index\",\n\t\t\t\tlocation[0], this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The item was not added at the correct index\",\n\t\t\t\tlocation[1], this._collection.getItemLocation(itemToAdd)[1]);\n\t\t\tAssert.failNull(\"HierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (length)\",\n\t\t\t\t2, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (value)\",\n\t\t\t\tlocation[0], indicesFromEvent[0]);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (value)\",\n\t\t\t\tlocation[1], indicesFromEvent[1]);\n\t\t}\n\n\t\t[Test(expects=\"RangeError\")]\n\t\tpublic function testAddItemAtNullLocation():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tthis._collection.addItemAtLocation(itemToAdd, null);\n\t\t}\n\n\t\t[Test(expects=\"RangeError\")]\n\t\tpublic function testAddItemAtEmptyLocation():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar indices:Vector.<int> = new <int>[];\n\t\t\tthis._collection.addItemAtLocation(itemToAdd, indices);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemAt():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar originalLength:int = this._collection.getLength();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.addItemAt(itemToAdd, expectedIndex);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The getLength() value was not changed\",\n\t\t\t\toriginalLength + 1, this._collection.getLength());\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The item was not added\",\n\t\t\t\t1, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The item was not added at the correct index\",\n\t\t\t\texpectedIndex, this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.failNull(\"HierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (length)\",\n\t\t\t\t1, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (value)\",\n\t\t\t\t1, indicesFromEvent[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemAtNested():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar originalParentLength:int = this._collection.getLength(0);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.addItemAt(itemToAdd, 0, 1);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The getLength() value was not changed\",\n\t\t\t\toriginalParentLength + 1, this._collection.getLength(0));\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The item was not added\",\n\t\t\t\t2, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The item was not added at the correct index\",\n\t\t\t\t0, this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The item was not added at the correct index\",\n\t\t\t\t1, this._collection.getItemLocation(itemToAdd)[1]);\n\t\t\tAssert.failNull(\"HierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (length)\",\n\t\t\t\t2, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (value)\",\n\t\t\t\t0, indicesFromEvent[0]);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (value)\",\n\t\t\t\t1, indicesFromEvent[1]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemAt():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar originalLength:int = this._collection.getLength();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasReplacedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REPLACE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasReplacedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.setItemAt(itemToAdd, expectedIndex);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REPLACE_ITEM was not dispatched\", hasReplacedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was incorrectly changed\",\n\t\t\t\toriginalLength, this._collection.getLength());\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The item was not replaced\",\n\t\t\t\t1, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The item was not replaced at the correct index\",\n\t\t\t\texpectedIndex, this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.failNull(\"HierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (length)\",\n\t\t\t\t1, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (value)\",\n\t\t\t\t1, indicesFromEvent[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemAtNested():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar originalParentLength:int = this._collection.getLength(0);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasReplacedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REPLACE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasReplacedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.setItemAt(itemToAdd, 0, 1);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REPLACE_ITEM was not dispatched\", hasReplacedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was incorrectly changed\",\n\t\t\t\toriginalParentLength, this._collection.getLength(0));\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The item was not replaced\",\n\t\t\t\t2, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The item was not replaced at the correct index\",\n\t\t\t\t0, this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The item was not replaced at the correct index\",\n\t\t\t\t1, this._collection.getItemLocation(itemToAdd)[1]);\n\t\t\tAssert.failNull(\"HierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (length)\",\n\t\t\t\t2, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (value)\",\n\t\t\t\t0, indicesFromEvent[0]);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (value)\",\n\t\t\t\t1, indicesFromEvent[1]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemAtLocation():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar location:Vector.<int> = new <int>[1];\n\t\t\tvar originalLength:int = this._collection.getLength();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasReplacedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REPLACE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasReplacedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.setItemAtLocation(itemToAdd, location);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REPLACE_ITEM was not dispatched\", hasReplacedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was incorrectly changed\",\n\t\t\t\toriginalLength, this._collection.getLength());\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The item was not replaced\",\n\t\t\t\t1, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The item was not replaced at the correct index\",\n\t\t\t\tlocation[0], this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.failNull(\"HierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (length)\",\n\t\t\t\t1, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (value)\",\n\t\t\t\tlocation[0], indicesFromEvent[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemAtNestedLocation():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar location:Vector.<int> = new <int>[0, 1];\n\t\t\tvar originalParentLength:int = this._collection.getLength(location[0]);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasReplacedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REPLACE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasReplacedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.setItemAtLocation(itemToAdd, location);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REPLACE_ITEM was not dispatched\", hasReplacedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was incorrectly changed\",\n\t\t\t\toriginalParentLength, this._collection.getLength(location[0]));\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The item was not replaced\",\n\t\t\t\t2, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The item was not replaced at the correct index\",\n\t\t\t\tlocation[0], this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The item was not replaced at the correct index\",\n\t\t\t\tlocation[1], this._collection.getItemLocation(itemToAdd)[1]);\n\t\t\tAssert.failNull(\"HierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (length)\",\n\t\t\t\t2, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (value)\",\n\t\t\t\tlocation[0], indicesFromEvent[0]);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (value)\",\n\t\t\t\tlocation[1], indicesFromEvent[1]);\n\t\t}\n\n\t\t[Test(expects=\"RangeError\")]\n\t\tpublic function testSetItemAtNullLocation():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tthis._collection.setItemAtLocation(itemToAdd, null);\n\t\t}\n\n\t\t[Test(expects=\"RangeError\")]\n\t\tpublic function testSetItemAtEmptyLocation():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar indices:Vector.<int> = new <int>[];\n\t\t\tthis._collection.setItemAtLocation(itemToAdd, indices);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemLocationWithItemInCollection():void\n\t\t{\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar item:Object = this._collection.getItemAt(expectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: getItemLocation() returned the incorrect location (length)\",\n\t\t\t\t1, this._collection.getItemLocation(item).length);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: getItemLocation() returned the incorrect location (value)\",\n\t\t\t\texpectedIndex, this._collection.getItemLocation(item)[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemLocationNestedWithItemInCollection():void\n\t\t{\n\t\t\tvar location:Vector.<int> = new <int>[0, 1];\n\t\t\tvar item:Object = this._collection.getItemAtLocation(location);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: getItemLocation() returned the incorrect location (length)\",\n\t\t\t\tlocation.length, this._collection.getItemLocation(item).length);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: getItemLocation() returned the incorrect location (value)\",\n\t\t\t\tlocation[0], this._collection.getItemLocation(item)[0]);\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: getItemLocation() returned the incorrect location (value)\",\n\t\t\t\tlocation[1], this._collection.getItemLocation(item)[1]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemLocationWithItemNotInCollection():void\n\t\t{\n\t\t\tvar item:Object = {};\n\t\t\tAssert.assertStrictlyEquals(\"HierarchicalCollection: getItemLocation() returned the incorrect location (length)\",\n\t\t\t\t0, this._collection.getItemLocation(item).length);\n\t\t}\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/HorizontalLayoutTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.LayoutGroup;\n\timport feathers.layout.HorizontalLayout;\n\timport feathers.layout.HorizontalLayoutData;\n\timport feathers.layout.LayoutBoundsResult;\n\timport feathers.layout.ViewPortBounds;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\n\tpublic class HorizontalLayoutTests\n\t{\n\t\tprivate var _layout:HorizontalLayout;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._layout = new HorizontalLayout();\n\t\t\tthis._layout.useVirtualLayout = false;\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._layout = null;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentWidthWithOneItem():void\n\t\t{\n\t\t\tvar viewPortWidth:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar layoutData1:HorizontalLayoutData = new HorizontalLayoutData(50);\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = viewPortWidth;\n\t\t\tbounds.explicitHeight = 640;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayoutData with percentWidth results in incorrect item width\", viewPortWidth / 2, item1.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentWidthGreaterThan100WithOneItem():void\n\t\t{\n\t\t\tvar viewPortWidth:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar layoutData1:HorizontalLayoutData = new HorizontalLayoutData(200);\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = viewPortWidth;\n\t\t\tbounds.explicitHeight = 640;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayoutData with percentWidth > 100 not clamped to 100\", viewPortWidth, item1.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentWidthLessThan0WithOneItem():void\n\t\t{\n\t\t\tvar viewPortWidth:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar layoutData1:HorizontalLayoutData = new HorizontalLayoutData(-50);\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = viewPortWidth;\n\t\t\tbounds.explicitHeight = 640;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayoutData with percentWidth < 0 not clamped to 0\", 0, item1.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentWidthWithTwoItems():void\n\t\t{\n\t\t\tvar viewPortWidth:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar item1Percent:Number = 50;\n\t\t\tvar layoutData1:HorizontalLayoutData = new HorizontalLayoutData(item1Percent);\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\tvar item2Percent:Number = 25;\n\t\t\tvar layoutData2:HorizontalLayoutData = new HorizontalLayoutData(item2Percent);\n\t\t\titem2.layoutData = layoutData2;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = viewPortWidth;\n\t\t\tbounds.explicitHeight = 640;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayoutData with percentWidth results in incorrect item width for first item (of 2)\", viewPortWidth / (100 / item1Percent), item1.width);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayoutData with percentWidth results in incorrect item width for second item (of 2)\", viewPortWidth / (100 / item2Percent), item2.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentWidthGreaterThan100WithTwoItems():void\n\t\t{\n\t\t\tvar viewPortWidth:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar item1Percent:Number = 100;\n\t\t\tvar layoutData1:HorizontalLayoutData = new HorizontalLayoutData(item1Percent);\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\tvar item2Percent:Number = 150;\n\t\t\tvar layoutData2:HorizontalLayoutData = new HorizontalLayoutData(item2Percent);\n\t\t\titem2.layoutData = layoutData2;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = viewPortWidth;\n\t\t\tbounds.explicitHeight = 640;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tvar totalPercent:Number = item1Percent + item2Percent;\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayoutData with percentWidth > 100 results in incorrect item width for first item (of 2)\", viewPortWidth / (totalPercent / item1Percent), item1.width);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayoutData with percentWidth > 100 results in incorrect item width for second item (of 2)\", viewPortWidth / (totalPercent / item2Percent), item2.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentHeight():void\n\t\t{\n\t\t\tvar viewPortHeight:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar layoutData1:HorizontalLayoutData = new HorizontalLayoutData(NaN, 50);\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 640;\n\t\t\tbounds.explicitHeight = viewPortHeight;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayoutData with percentHeight results in incorrect item height\", viewPortHeight / 2, item1.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentHeightGreaterThan100():void\n\t\t{\n\t\t\tvar viewPortHeight:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar layoutData1:HorizontalLayoutData = new HorizontalLayoutData(NaN, 150);\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 640;\n\t\t\tbounds.explicitHeight = viewPortHeight;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayoutData with percentHeight > 100 does not clamp to 100\", viewPortHeight, item1.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentHeightLessThan0():void\n\t\t{\n\t\t\tvar viewPortHeight:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar layoutData1:HorizontalLayoutData = new HorizontalLayoutData(NaN, -50);\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 640;\n\t\t\tbounds.explicitHeight = viewPortHeight;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayoutData with percentHeight < 0 does not clamp to 0\", 0, item1.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentWidthWithExplicitMinWidth():void\n\t\t{\n\t\t\tvar viewPortWidth:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.minWidth = 400;\n\t\t\tvar layoutData1:HorizontalLayoutData = new HorizontalLayoutData(50, NaN);\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = viewPortWidth;\n\t\t\tbounds.explicitHeight = 640;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayoutData with percentWidth and larger item explicitMinWidth results in incorrect item width\",\n\t\t\t\t400, item1.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentHeightWithExplicitMinHeight():void\n\t\t{\n\t\t\tvar viewPortHeight:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.minHeight = 400;\n\t\t\tvar layoutData1:HorizontalLayoutData = new HorizontalLayoutData(NaN, 50);\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 640;\n\t\t\tbounds.explicitHeight = viewPortHeight;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayoutData with percentHeight and larger item explicitMinHeight results in incorrect item height\",\n\t\t\t\t400, item1.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentHeightWithExplicitMaxHeight():void\n\t\t{\n\t\t\tvar viewPortHeight:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.maxHeight = 250;\n\t\t\tvar layoutData1:HorizontalLayoutData = new HorizontalLayoutData(NaN, 50);\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 640;\n\t\t\tbounds.explicitHeight = viewPortHeight;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayoutData with percentHeight and larger item explicitMaxHeight results in incorrect item height\",\n\t\t\t\t250, item1.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDistributeWidths():void\n\t\t{\n\t\t\tthis._layout.distributeWidths = true;\n\t\t\tvar viewPortWidth:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = viewPortWidth;\n\t\t\tbounds.explicitHeight = 640;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tvar itemWidth:Number = viewPortWidth / items.length;\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with distributeWidths results in wrong item width\",\n\t\t\t\titemWidth, item1.width);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with distributeWidths results in wrong item width\",\n\t\t\t\titemWidth, item2.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDistributeWidthsWithIncludeInLayoutFalse():void\n\t\t{\n\t\t\tthis._layout.distributeWidths = true;\n\t\t\tvar viewPortWidth:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\tvar item3:LayoutGroup = new LayoutGroup();\n\t\t\titem2.includeInLayout = false;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2, item3];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = viewPortWidth;\n\t\t\tbounds.explicitHeight = 640;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tvar itemWidth:Number = viewPortWidth / (items.length - 1);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with distributeWidths and an item with includeInLayout set to false results in wrong item width\",\n\t\t\t\titemWidth, item1.width);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with distributeWidths and an item with includeInLayout set to false results in wrong item width\",\n\t\t\t\t0, item2.width);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with distributeWidths and an item with includeInLayout set to false results in wrong item width\",\n\t\t\t\titemWidth, item3.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDistributeWidthsWithLargerItemWidths():void\n\t\t{\n\t\t\tthis._layout.distributeWidths = true;\n\t\t\tvar viewPortWidth:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.width = 720;\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\titem2.width = 820;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = viewPortWidth;\n\t\t\tbounds.explicitHeight = 640;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tvar itemWidth:Number = viewPortWidth / items.length;\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with distributeWidths and larger item width results in wrong item width\",\n\t\t\t\titemWidth, item1.width);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with distributeWidths and larger item width results in wrong item width\",\n\t\t\t\titemWidth, item2.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDistributeWidthsWithoutExplicitWidth():void\n\t\t{\n\t\t\tthis._layout.distributeWidths = true;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.width = 480;\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\titem2.width = 640;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tthis._layout.layout(items, new ViewPortBounds());\n\t\t\tvar largerWidth:Number = Math.max(item1.width, item2.width);\n\t\t\tvar itemWidth:Number = largerWidth * items.length;\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with distributeWidths and no explicit width results in wrong item width\",\n\t\t\t\titemWidth, item1.width);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with distributeWidths and no explicit width results in wrong item width\",\n\t\t\t\titemWidth, item2.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDistributeWidthsWithUseVirtualLayout():void\n\t\t{\n\t\t\tthis._layout.distributeWidths = true;\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tvar viewPortWidth:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = viewPortWidth;\n\t\t\tbounds.explicitHeight = 640;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tvar itemWidth:Number = viewPortWidth / items.length;\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with distributeWidths and useVirtualLayout results in wrong item width\",\n\t\t\t\titemWidth, item1.width);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with distributeWidths and useVirtualLayout results in wrong item width\",\n\t\t\t\titemWidth, item2.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSmallerMaxColumnCount():void\n\t\t{\n\t\t\tthis._layout.maxColumnCount = 2;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.setSize(100, 100);\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\titem2.setSize(100, 100);\n\t\t\tvar item3:LayoutGroup = new LayoutGroup();\n\t\t\titem3.setSize(100, 100);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2, item3];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with smaller maxColumnCount results in wrong view port width\",\n\t\t\t\t200, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with smaller maxColumnCount results in wrong content width\",\n\t\t\t\t300, result.contentWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSmallerMaxColumnCountAndUseVirtualLayout():void\n\t\t{\n\t\t\tthis._layout.maxColumnCount = 2;\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.setSize(100, 100);\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\titem2.setSize(100, 100);\n\t\t\tvar item3:LayoutGroup = new LayoutGroup();\n\t\t\titem3.setSize(100, 100);\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2, item3];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with smaller maxColumnCount and useVirtualLayout results in wrong view port width\",\n\t\t\t\t200, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with smaller maxColumnCount and useVirtualLayout results in wrong content width\",\n\t\t\t\t300, result.contentWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLargerMaxColumnCount():void\n\t\t{\n\t\t\tthis._layout.maxColumnCount = 4;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.setSize(100, 100);\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\titem2.setSize(100, 100);\n\t\t\tvar item3:LayoutGroup = new LayoutGroup();\n\t\t\titem3.setSize(100, 100);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2, item3];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with larger maxColumnCount results in wrong view port width\",\n\t\t\t\t300, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with larger maxColumnCount results in wrong content width\",\n\t\t\t\t300, result.contentWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLargerMaxColumnCountAndUseVirtualLayout():void\n\t\t{\n\t\t\tthis._layout.maxColumnCount = 4;\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.setSize(100, 100);\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\titem2.setSize(100, 100);\n\t\t\tvar item3:LayoutGroup = new LayoutGroup();\n\t\t\titem3.setSize(100, 100);\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2, item3];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with larger maxColumnCount and useVirtualLayout results in wrong view port width\",\n\t\t\t\t300, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with larger maxColumnCount and useVirtualLayout results in wrong content width\",\n\t\t\t\t300, result.contentWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRequestedColumnCountWithZeroItems():void\n\t\t{\n\t\t\tthis._layout.requestedColumnCount = 3;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with requestedColumnCount and zero items results in wrong view port width\",\n\t\t\t\t0, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with requestedColumnCount and zero items results in wrong content width\",\n\t\t\t\t0, result.contentWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSmallerRequestedColumnCount():void\n\t\t{\n\t\t\tthis._layout.requestedColumnCount = 2;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.setSize(100, 100);\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\titem2.setSize(100, 100);\n\t\t\tvar item3:LayoutGroup = new LayoutGroup();\n\t\t\titem3.setSize(100, 100);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2, item3];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with smaller requestedColumnCount results in wrong view port width\",\n\t\t\t\t200, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with smaller requestedColumnCount results in wrong content width\",\n\t\t\t\t300, result.contentWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSmallerRequestedColumnCountAndUseVirtualLayout():void\n\t\t{\n\t\t\tthis._layout.requestedColumnCount = 2;\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.setSize(100, 100);\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\titem2.setSize(100, 100);\n\t\t\tvar item3:LayoutGroup = new LayoutGroup();\n\t\t\titem3.setSize(100, 100);\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2, item3];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with smaller requestedColumnCount and useVirtualLayout results in wrong view port width\",\n\t\t\t\t200, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with smaller requestedColumnCount and useVirtualLayout results in wrong content width\",\n\t\t\t\t300, result.contentWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLargerRequestedColumnCount():void\n\t\t{\n\t\t\tthis._layout.requestedColumnCount = 4;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.setSize(100, 100);\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\titem2.setSize(100, 100);\n\t\t\tvar item3:LayoutGroup = new LayoutGroup();\n\t\t\titem3.setSize(100, 100);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2, item3];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with larger requestedColumnCount results in wrong view port width\",\n\t\t\t\t400, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with larger requestedColumnCount results in wrong content width\",\n\t\t\t\t300, result.contentWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLargerRequestedColumnCountAndUseVirtualLayout():void\n\t\t{\n\t\t\tthis._layout.requestedColumnCount = 4;\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.setSize(100, 100);\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\titem2.setSize(100, 100);\n\t\t\tvar item3:LayoutGroup = new LayoutGroup();\n\t\t\titem3.setSize(100, 100);\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2, item3];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with larger requestedColumnCount and useVirtualLayout results in wrong view port width\",\n\t\t\t\t400, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with larger requestedColumnCount and useVirtualLayout results in wrong content width\",\n\t\t\t\t300, result.contentWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChildWithCalculatedMinHeightAndPercentHeight():void\n\t\t{\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.layoutData = new HorizontalLayoutData(100, 100);\n\t\t\tvar child:Quad = new Quad(100, 100, 0xff00ff);\n\t\t\titem1.addChild(child);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout without explicit view port height and child with percentHeight and calculated minHeight results in wrong view port height\",\n\t\t\t\t100, result.viewPortHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChildWithExplicitMinHeightAndPercentHeight():void\n\t\t{\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.layoutData = new HorizontalLayoutData(100, 100);\n\t\t\tvar child:Quad = new Quad(100, 100, 0xff00ff);\n\t\t\titem1.minHeight = 200;\n\t\t\titem1.addChild(child);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout without explicit view port height and child with percentHeight and explicit minHeight results in wrong view port height\",\n\t\t\t\t200, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout without explicit view port height and child with percentHeight and explicit minHeight results in wrong child height\",\n\t\t\t\t200, item1.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChildWithCalculatedMinHeightAndPercentHeightWithExplicitHeight():void\n\t\t{\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.layoutData = new HorizontalLayoutData(100, 100);\n\t\t\tvar child:Quad = new Quad(100, 100, 0xff00ff);\n\t\t\titem1.addChild(child);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitHeight = 50;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with explicit view port height and child with percentHeight and calculated minHeight results in wrong view port height\",\n\t\t\t\t50, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with explicit view port height and child with percentHeight and calculated minHeight results in wrong child height\",\n\t\t\t\t50, item1.height);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic function testChildWithCalculatedMinHeightAndPercentHeightWithViewPortMinHeight():void\n\t\t{\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.layoutData = new HorizontalLayoutData(100, 100);\n\t\t\tvar child:Quad = new Quad(100, 100, 0xff00ff);\n\t\t\titem1.addChild(child);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.minHeight = 10;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with explicit view port minHeight and child with percentHeight and calculated minHeight results in wrong view port height\",\n\t\t\t\t100, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout with explicit view port minHeight and child with percentHeight and calculated minHeight results in wrong child height\",\n\t\t\t\t100, item1.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChildWithCalculatedHeightAndSmallerCalculatedMinHeightAndPercentHeight():void\n\t\t{\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.layoutData = new HorizontalLayoutData(100, 100);\n\t\t\tvar child:LayoutGroup = new LayoutGroup();\n\t\t\tchild.width = 100;\n\t\t\tchild.height = 100;\n\t\t\tchild.minWidth = 50;\n\t\t\tchild.minHeight = 50;\n\t\t\titem1.backgroundSkin = child;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout without explicit view port height and child with percentHeight, calculated height, and calculated minHeight results in wrong view port height\",\n\t\t\t\t100, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout without explicit view port height and child with percentHeight, calculated height, and calculated minHeight results in wrong child height\",\n\t\t\t\t100, item1.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTypicalItemExplicitWidthWithoutHasVariableItemDimensions():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.hasVariableItemDimensions = false;\n\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.backgroundSkin = new Quad(100, 200);\n\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\titem2.backgroundSkin = new Quad(150, 50);\n\n\t\t\tthis._layout.typicalItem = item1;\n\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertTrue(\"HorizontalLayout: typicalItem explicitWidth must be NaN when useVirtualLayout is true and hasVariableItemDimensions is false so that it can resize later\",\n\t\t\t\tisNaN(item1.explicitWidth));\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout: item explicitWidth must be equal to typicalItem width when useVirtualLayout is true and hasVariableItemDimensions is false\",\n\t\t\t\titem1.width, item2.explicitWidth);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/HorizontalSpinnerLayoutTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.layout.HorizontalSpinnerLayout;\n\timport feathers.layout.LayoutBoundsResult;\n\timport feathers.layout.ViewPortBounds;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\n\tpublic class HorizontalSpinnerLayoutTests\n\t{\n\t\tprivate var _layout:HorizontalSpinnerLayout;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._layout = new HorizontalSpinnerLayout();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._layout = null;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMinimumAndMaximumScrollPositionsWhenRepeatItemsIsTrue():void\n\t\t{\n\t\t\tthis._layout.repeatItems = true;\n\t\t\tvar item1:Quad = new Quad(200, 200);\n\t\t\tvar item2:Quad = new Quad(200, 200);\n\t\t\tvar item3:Quad = new Quad(200, 200);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2, item3];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 200;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalSpinnerLayout layout() LayoutBoundsResult contentX not equal to Number.NEGATIVE_INFINITY when repeatItems is true and the total item width is larger than the view port width\", Number.NEGATIVE_INFINITY, result.contentX);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalSpinnerLayout layout() LayoutBoundsResult contentWidth not equal to Number.POSITIVE_INFINITY when repeatItems is true and the total item width is larger than the view port width\", Number.POSITIVE_INFINITY, result.contentWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMinimumAndMaximumScrollPositionsWhenRepeatItemsIsFalse():void\n\t\t{\n\t\t\tvar itemSize:Number = 200;\n\t\t\tthis._layout.repeatItems = false;\n\t\t\tvar item1:Quad = new Quad(itemSize, itemSize);\n\t\t\tvar item2:Quad = new Quad(itemSize, itemSize);\n\t\t\tvar item3:Quad = new Quad(itemSize, itemSize);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2, item3];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 200;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalSpinnerLayout layout() LayoutBoundsResult contentX not equal to 0 when repeatItems is false and the total item width is larger than the view port width\", 0, result.contentX);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalSpinnerLayout layout() LayoutBoundsResult contentWidth not equal to total width of items minus view port width when repeatItems is false and the total item width is larger than the view port width\", items.length * itemSize, result.contentWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testVisibleIndicesWithOneItemVisibleAndRepeatingWithGap():void\n\t\t{\n\t\t\t//Github issue #1257\n\t\t\tvar itemSize:Number = 256;\n\t\t\tvar gap:Number = 64;\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.gap = gap;\n\t\t\tthis._layout.requestedColumnCount = 1;\n\t\t\tvar item1:Quad = new Quad(itemSize, itemSize);\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tvar result:Vector.<int> = this._layout.getVisibleIndicesAtScrollPosition((itemSize + gap) * 9.8, 0, 320, 320, 5);\n\t\t\tAssert.assertTrue(\"HorizontalSpinnerLayout getVisibleIndicesAtScrollPosition() does not contain and index that should be visible\", result.indexOf(4) >= 0)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ImageLoaderInternalStateTests.as",
    "content": "package feathers.tests\n{\n\timport org.flexunit.Assert;\n\timport org.flexunit.async.Async;\n\n\timport starling.events.Event;\n\n\tpublic class ImageLoaderInternalStateTests\n\t{\n\t\tprivate var _loader:ImageLoaderDisposeWatcher;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._loader = new ImageLoaderDisposeWatcher();\n\t\t\tTestFeathers.starlingRoot.addChild(this._loader);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._loader.removeFromParent(true);\n\t\t\tthis._loader = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testDisposeTextureAfterSetSourceToNull():void\n\t\t{\n\t\t\tvar loader:ImageLoaderDisposeWatcher = this._loader;\n\t\t\tloader.addEventListener(Event.COMPLETE, function():void\n\t\t\t{\n\t\t\t\tloader.source = null;\n\t\t\t});\n\t\t\tloader.source = \"fixtures/red100x100.png\";\n\t\t\tloader.validate();\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertTrue(\"Texture not disposed after setting ImageLoader source to null.\", loader.hasDisposedTexture);\n\t\t\t}, 200);\n\t\t}\n\n\t\t[Test(async,timeout=\"600\")]\n\t\tpublic function testKeepTextureAfterLoadNewImageWithSameDimensions():void\n\t\t{\n\t\t\tvar isSecondImageLoaded:Boolean = false;\n\t\t\tvar loader:ImageLoaderDisposeWatcher = this._loader;\n\t\t\tloader.asyncTextureUpload = false;\n\t\t\tloader.addEventListener(Event.COMPLETE, function():void\n\t\t\t{\n\t\t\t\tloader.removeEventListener(Event.COMPLETE, arguments.callee);\n\t\t\t\tloader.source = \"fixtures/blue100x100.png\";\n\t\t\t\tloader.validate();\n\t\t\t\tloader.addEventListener(Event.COMPLETE, function():void\n\t\t\t\t{\n\t\t\t\t\tisSecondImageLoaded = true;\n\t\t\t\t});\n\t\t\t});\n\t\t\tloader.source = \"fixtures/red100x100.png\";\n\t\t\tloader.validate();\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertTrue(\"Second image did not complete loading.\", isSecondImageLoaded);\n\t\t\t\tAssert.assertFalse(\"Texture incorrectly disposed after setting ImageLoader source to image with same dimensions.\", loader.hasDisposedTexture);\n\t\t\t}, 400);\n\t\t}\n\n\t\t[Test(async,timeout=\"600\")]\n\t\tpublic function testDisposeTextureAfterLoadNewImageWithDifferentDimensions():void\n\t\t{\n\t\t\tvar isSecondImageLoaded:Boolean = false;\n\t\t\tvar loader:ImageLoaderDisposeWatcher = this._loader;\n\t\t\tloader.addEventListener(Event.COMPLETE, function():void\n\t\t\t{\n\t\t\t\tloader.removeEventListener(Event.COMPLETE, arguments.callee);\n\t\t\t\tloader.source = \"fixtures/green200x200.png\";\n\t\t\t\tloader.validate();\n\t\t\t\tloader.addEventListener(Event.COMPLETE, function():void\n\t\t\t\t{\n\t\t\t\t\tisSecondImageLoaded = true;\n\t\t\t\t});\n\t\t\t});\n\t\t\tloader.source = \"fixtures/red100x100.png\";\n\t\t\tloader.validate();\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertTrue(\"Second image did not complete loading.\", isSecondImageLoaded);\n\t\t\t\tAssert.assertTrue(\"Texture not disposed after setting ImageLoader source to image with different dimensions.\", loader.hasDisposedTexture);\n\t\t\t}, 400);\n\t\t}\n\t}\n}\n\nimport feathers.controls.ImageLoader;\n\nclass ImageLoaderDisposeWatcher extends ImageLoader\n{\n\toverride protected function cleanupTexture():void\n\t{\n\t\tif(this._texture && this._isTextureOwner)\n\t\t{\n\t\t\tthis.hasDisposedTexture = true;\n\t\t}\n\t\tsuper.cleanupTexture();\n\t}\n\t\n\tpublic var hasDisposedTexture:Boolean = false;\n}"
  },
  {
    "path": "test/source/feathers/tests/ImageLoaderTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.ImageLoader;\n\timport feathers.utils.textures.TextureCache;\n\n\timport flash.geom.Rectangle;\n\n\timport org.flexunit.Assert;\n\timport org.flexunit.async.Async;\n\n\timport starling.events.Event;\n\timport starling.textures.Texture;\n\timport starling.utils.ScaleMode;\n\n\tpublic class ImageLoaderTests\n\t{\n\t\tprivate var _loader:ImageLoader;\n\t\tprivate var _texture:Texture;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._loader = new ImageLoader();\n\t\t\tTestFeathers.starlingRoot.addChild(this._loader);\n\t\t\tthis._loader.validate();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._loader.removeFromParent(true);\n\t\t\tthis._loader = null;\n\t\t\t\n\t\t\tif(this._texture !== null)\n\t\t\t{\n\t\t\t\tthis._texture.dispose();\n\t\t\t\tthis._texture = null;\n\t\t\t}\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testCompleteEvent():void\n\t\t{\n\t\t\tvar completeDispatched:Boolean = false;\n\t\t\tthis._loader.addEventListener(Event.COMPLETE, function():void\n\t\t\t{\n\t\t\t\tcompleteDispatched = true;\n\t\t\t});\n\t\t\tthis._loader.source = \"fixtures/red100x100.png\";\n\t\t\tthis._loader.validate();\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertTrue(\"Event.COMPLETE not dispatched by ImageLoader after loading valid URL.\", completeDispatched);\n\t\t\t}, 200);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testIOErrorEvent():void\n\t\t{\n\t\t\tvar ioErrorDispatched:Boolean = false;\n\t\t\tthis._loader.addEventListener(Event.IO_ERROR, function():void\n\t\t\t{\n\t\t\t\tioErrorDispatched = true;\n\t\t\t});\n\t\t\tthis._loader.source = \"fixtures/fake.png\";\n\t\t\tthis._loader.validate();\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertTrue(\"Event.IO_ERROR not dispatched by ImageLoader after loading invalid URL.\", ioErrorDispatched);\n\t\t\t}, 200);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testResize():void\n\t\t{\n\t\t\tvar resizeDispatched:Boolean = false;\n\t\t\tvar loader:ImageLoader = this._loader;\n\t\t\tloader.addEventListener(Event.RESIZE, function():void\n\t\t\t{\n\t\t\t\tresizeDispatched = true;\n\t\t\t});\n\t\t\tloader.source = \"fixtures/red100x100.png\";\n\t\t\tloader.validate();\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertTrue(\"Event.RESIZE not dispatched by ImageLoader after loading URL.\", resizeDispatched);\n\t\t\t\tAssert.assertStrictlyEquals(\"ImageLoader width property not changed after loading URL.\", 100, loader.width);\n\t\t\t\tAssert.assertStrictlyEquals(\"ImageLoader height property not changed after loading URL.\", 100, loader.height);\n\t\t\t\tAssert.assertStrictlyEquals(\"ImageLoader minWidth property not changed after loading URL.\", 100, loader.minWidth);\n\t\t\t\tAssert.assertStrictlyEquals(\"ImageLoader minHeight property not changed after loading URL.\", 100, loader.minHeight);\n\t\t\t}, 200);\n\t\t}\n\n\t\t[Test(async,timeout=\"600\")]\n\t\tpublic function testResizeWithNewSource():void\n\t\t{\n\t\t\tvar loader:ImageLoader = this._loader;\n\t\t\tloader.addEventListener(Event.COMPLETE, function():void\n\t\t\t{\n\t\t\t\tloader.removeEventListener(Event.COMPLETE, arguments.callee);\n\t\t\t\tloader.source = \"fixtures/green200x200.png\";\n\t\t\t\tloader.validate();\n\t\t\t});\n\t\t\tloader.source = \"fixtures/red100x100.png\";\n\t\t\tloader.validate();\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertStrictlyEquals(\"ImageLoader width property not changed after loading second URL.\", 200, loader.width);\n\t\t\t\tAssert.assertStrictlyEquals(\"ImageLoader height property not changed after loading second URL.\", 200, loader.height);\n\t\t\t\tAssert.assertStrictlyEquals(\"ImageLoader minWidth property not changed after loading second URL.\", 200, loader.minWidth);\n\t\t\t\tAssert.assertStrictlyEquals(\"ImageLoader minHeight property not changed after loading second URL.\", 200, loader.minHeight);\n\t\t\t}, 400);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testOriginalSourceDimensionsInCompleteEvent():void\n\t\t{\n\t\t\tvar completeDispatched:Boolean = false;\n\t\t\tvar loader:ImageLoader = this._loader;\n\t\t\tloader.addEventListener(Event.COMPLETE, function():void\n\t\t\t{\n\t\t\t\tAssert.assertStrictlyEquals(\"ImageLoader originalSourceWidth property not changed after loading URL.\", 100, loader.originalSourceWidth);\n\t\t\t\tAssert.assertStrictlyEquals(\"ImageLoader originalSourceHeight property not changed after loading URL.\", 100, loader.originalSourceHeight);\n\t\t\t\tcompleteDispatched = true;\n\t\t\t});\n\t\t\tloader.source = \"fixtures/red100x100.png\";\n\t\t\tloader.validate();\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertTrue(\"Event.COMPLETE not dispatched by ImageLoader after loading valid URL.\", completeDispatched);\n\t\t\t}, 200);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testScaleFactor():void\n\t\t{\n\t\t\tvar loader:ImageLoader = this._loader;\n\t\t\tloader.scaleFactor = 2;\n\t\t\tloader.source = \"fixtures/green200x200.png\";\n\t\t\tloader.validate();\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertStrictlyEquals(\"ImageLoader originalSourceWidth property not changed after loading URL.\", 200, loader.originalSourceWidth);\n\t\t\t\tAssert.assertStrictlyEquals(\"ImageLoader originalSourceHeight property not changed after loading URL.\", 200, loader.originalSourceHeight);\n\t\t\t\tAssert.assertStrictlyEquals(\"ImageLoader width property not changed after loading URL.\", 100, loader.width);\n\t\t\t\tAssert.assertStrictlyEquals(\"ImageLoader height property not changed after loading URL.\", 100, loader.height);\n\t\t\t\tAssert.assertStrictlyEquals(\"ImageLoader minWidth property not changed after loading URL.\", 100, loader.minWidth);\n\t\t\t\tAssert.assertStrictlyEquals(\"ImageLoader minHeight property not changed after loading URL.\", 100, loader.minHeight);\n\t\t\t}, 200);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testCacheRetainCountOnComplete():void\n\t\t{\n\t\t\tvar textureCache:TextureCache = new TextureCache(2);\n\t\t\tvar source:String = \"fixtures/green200x200.png\";\n\t\t\tvar loader:ImageLoader = this._loader;\n\t\t\tloader.source = source;\n\t\t\tloader.textureCache = textureCache;\n\t\t\tvar retainCount:int = 0;\n\t\t\tloader.addEventListener(Event.COMPLETE, function():void\n\t\t\t{\n\t\t\t\tretainCount = textureCache.getRetainCount(source);\n\t\t\t});\n\t\t\tloader.validate();\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\ttextureCache.dispose();\n\t\t\t\tAssert.assertStrictlyEquals(\"ImageLoader textureCache retain count incorrect after load complete.\", 1, retainCount);\n\t\t\t}, 200);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testReleaseTextureFromCacheAfterSetSourceToNull():void\n\t\t{\n\t\t\tvar textureCache:TextureCache = new TextureCache(2);\n\t\t\tvar source:String = \"fixtures/green200x200.png\";\n\t\t\tvar loader:ImageLoader = this._loader;\n\t\t\tloader.source = source;\n\t\t\tloader.textureCache = textureCache;\n\t\t\tloader.validate();\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tloader.source = null;\n\t\t\t\tvar retainCount:int = textureCache.getRetainCount(source);\n\t\t\t\ttextureCache.dispose();\n\t\t\t\tAssert.assertStrictlyEquals(\"ImageLoader textureCache retain count incorrect after set source to null.\", 0, retainCount);\n\t\t\t}, 200);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWidthScaleModeNone():void\n\t\t{\n\t\t\tvar textureSize:Number = 20;\n\t\t\tvar loaderHeight:Number = 200;\n\t\t\tthis._texture = Texture.fromColor(textureSize, textureSize);\n\t\t\tthis._loader.source = this._texture;\n\t\t\tthis._loader.height = loaderHeight;\n\t\t\tthis._loader.scaleMode = ScaleMode.NONE;\n\t\t\tthis._loader.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"ImageLoader calculates incorrect width when using ScaleMode.NONE and setting larger explicit height.\",\n\t\t\t\ttextureSize, this._loader.width);\n\t\t\tAssert.assertStrictlyEquals(\"ImageLoader calculates incorrect minWidth when using ScaleMode.NONE and setting larger explicit height.\",\n\t\t\t\ttextureSize, this._loader.minWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeHeightScaleModeNone():void\n\t\t{\n\t\t\tvar textureSize:Number = 20;\n\t\t\tvar loaderWidth:Number = 200;\n\t\t\tthis._texture = Texture.fromColor(textureSize, textureSize);\n\t\t\tthis._loader.source = this._texture;\n\t\t\tthis._loader.width = loaderWidth;\n\t\t\tthis._loader.scaleMode = ScaleMode.NONE;\n\t\t\tthis._loader.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"ImageLoader calculates incorrect height when using ScaleMode.NONE and setting larger explicit width.\",\n\t\t\t\ttextureSize, this._loader.height);\n\t\t\tAssert.assertStrictlyEquals(\"ImageLoader calculates incorrect minHeight when using ScaleMode.NONE and setting larger explicit width.\",\n\t\t\t\ttextureSize, this._loader.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWidthAfterSettingHeightLarger():void\n\t\t{\n\t\t\tvar textureWidth:Number = 20;\n\t\t\tvar textureHeight:Number = 15;\n\t\t\tvar expectedWidth:Number = 200;\n\t\t\tvar updatedHeight:Number = 150;\n\t\t\tthis._texture = Texture.fromColor(textureWidth, textureHeight);\n\t\t\tthis._loader.source = this._texture;\n\t\t\tthis._loader.height = updatedHeight;\n\t\t\tthis._loader.scaleMode = ScaleMode.SHOW_ALL;\n\t\t\tthis._loader.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"ImageLoader calculates incorrect width when setting explicit height larger than texture height.\",\n\t\t\t\texpectedWidth, this._loader.width);\n\t\t\tAssert.assertStrictlyEquals(\"ImageLoader calculates incorrect minWidth when setting explicit height larger than texture height.\",\n\t\t\t\texpectedWidth, this._loader.minWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeHeightAfterSettingWidthLarger():void\n\t\t{\n\t\t\tvar textureWidth:Number = 20;\n\t\t\tvar textureHeight:Number = 15;\n\t\t\tvar updatedWidth:Number = 200;\n\t\t\tvar expectedHeight:Number = 150;\n\t\t\tthis._texture = Texture.fromColor(textureWidth, textureHeight);\n\t\t\tthis._loader.source = this._texture;\n\t\t\tthis._loader.width = updatedWidth;\n\t\t\tthis._loader.scaleMode = ScaleMode.SHOW_ALL;\n\t\t\tthis._loader.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"ImageLoader calculates incorrect height when setting explicit width larger than texture width.\",\n\t\t\t\texpectedHeight, this._loader.height);\n\t\t\tAssert.assertStrictlyEquals(\"ImageLoader calculates incorrect minHeight when setting explicit width larger than texture width.\",\n\t\t\t\texpectedHeight, this._loader.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testIgnoreMaintainAspectRationWithScale9Grid():void\n\t\t{\n\t\t\tvar textureWidth:Number = 20;\n\t\t\tvar textureHeight:Number = 15;\n\t\t\tvar updatedWidth:Number = 200;\n\t\t\tthis._texture = Texture.fromColor(textureWidth, textureHeight);\n\t\t\tthis._loader.source = this._texture;\n\t\t\tthis._loader.scale9Grid = new Rectangle(2, 2, 18, 11);\n\t\t\tthis._loader.width = updatedWidth;\n\t\t\tthis._loader.scaleMode = ScaleMode.SHOW_ALL;\n\t\t\tthis._loader.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"ImageLoader calculates incorrect height when setting explicit width larger than texture width and using scale9Grid.\",\n\t\t\t\ttextureHeight, this._loader.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testExplicitMaxWidthWithLargerMinWidth():void\n\t\t{\n\t\t\tvar textureWidth:Number = 20;\n\t\t\tvar textureHeight:Number = 15;\n\t\t\tvar maxWidth:Number = 10;\n\t\t\tvar maxHeight:Number = 5;\n\t\t\tthis._texture = Texture.fromColor(textureWidth, textureHeight);\n\t\t\tthis._loader.source = this._texture;\n\t\t\tthis._loader.maxWidth = maxWidth;\n\t\t\tthis._loader.maxHeight = maxHeight;\n\t\t\tthis._loader.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"ImageLoader calculates incorrect width when setting explicit max width smaller than measured min width.\",\n\t\t\t\tmaxWidth, this._loader.width);\n\t\t\tAssert.assertStrictlyEquals(\"ImageLoader calculates incorrect height when setting explicit max height smaller than measured min height.\",\n\t\t\t\tmaxHeight, this._loader.height);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ImageSkinTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.skins.ImageSkin;\n\n\timport org.flexunit.Assert;\n\n\timport starling.textures.Texture;\n\n\tpublic class ImageSkinTests\n\t{\n\t\tprivate static const STATE_ONE:String = \"one\";\n\t\tprivate static const STATE_TWO:String = \"two\";\n\n\t\tprivate static const DEFAULT_COLOR:uint = 0xcccccc;\n\t\tprivate static const COLOR_ONE:uint = 0x999999;\n\t\tprivate static const COLOR_TWO:uint = 0x666666;\n\n\t\tprivate var _skin:ImageSkin;\n\t\tprivate var _context:StateContext;\n\n\t\tprivate var _texture1:Texture;\n\t\tprivate var _texture2:Texture;\n\t\tprivate var _texture3:Texture;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._context = new StateContext();\n\t\t\tthis._context.currentState = STATE_ONE;\n\t\t\tTestFeathers.starlingRoot.addChild(this._context);\n\n\t\t\tthis._skin = new ImageSkin(null);\n\t\t\tthis._context.addChild(this._skin);\n\t\t\tthis._skin.stateContext = this._context;\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._context.removeFromParent(true);\n\t\t\tthis._context = null;\n\t\t\tthis._skin = null;\n\n\t\t\tif(this._texture1 !== null)\n\t\t\t{\n\t\t\t\tthis._texture1.dispose();\n\t\t\t\tthis._texture1 = null;\n\t\t\t}\n\n\t\t\tif(this._texture2 !== null)\n\t\t\t{\n\t\t\t\tthis._texture2.dispose();\n\t\t\t\tthis._texture2 = null;\n\t\t\t}\n\n\t\t\tif(this._texture3 !== null)\n\t\t\t{\n\t\t\t\tthis._texture3.dispose();\n\t\t\t\tthis._texture3 = null;\n\t\t\t}\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetTextureForStateWithoutSetTextureForState():void\n\t\t{\n\t\t\tAssert.assertNull(\"ImageSkin getTextureForState(STATE_ONE) must be null when setTextureForState() is not called\", this._skin.getTextureForState(STATE_ONE));\n\t\t\tAssert.assertNull(\"ImageSkin getTextureForState(STATE_TWO) must be null when setTextureForState() is not called\", this._skin.getTextureForState(STATE_TWO));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDefaultTextureWithNoStateTextures():void\n\t\t{\n\t\t\tAssert.assertStrictlyEquals(\"ImageSkin texture must be null when defaultTexture and setTextureForState() are not used\", null, this._skin.texture);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetTextureForState():void\n\t\t{\n\t\t\tthis._texture1 = Texture.fromColor(10, 10, 0xff00ff);\n\t\t\tthis._skin.defaultTexture = this._texture1;\n\t\t\tthis._texture2 = Texture.fromColor(10, 10, 0xff0000);\n\t\t\tthis._skin.setTextureForState(STATE_ONE, this._texture2);\n\t\t\tthis._texture3 = Texture.fromColor(10, 10, 0x00ff00);\n\t\t\tthis._skin.setTextureForState(STATE_TWO, this._texture3);\n\n\t\t\tAssert.assertStrictlyEquals(\"ImageSkin getTextureForState(STATE_ONE) does not match value passed to setTextureForState()\", this._texture2, this._skin.getTextureForState(STATE_ONE));\n\t\t\tAssert.assertStrictlyEquals(\"ImageSkin getTextureForState(STATE_TWO) does not match value passed to setTextureForState()\", this._texture3, this._skin.getTextureForState(STATE_TWO));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDefaultTexture():void\n\t\t{\n\t\t\tthis._texture1 = Texture.fromColor(10, 10, 0xff00ff);\n\t\t\tthis._skin.defaultTexture = this._texture1;\n\n\t\t\tAssert.assertStrictlyEquals(\"ImageSkin texture is not defaultTexture when texture not provided for current state\", this._texture1, this._skin.texture);\n\n\t\t\tthis._context.isEnabled = false;\n\t\t\tAssert.assertStrictlyEquals(\"ImageSkin texture is not defaultTexture when disabled texture not provided\", this._texture1, this._skin.texture);\n\n\t\t\tthis._context.isEnabled = true;\n\n\t\t\tthis._context.currentState = STATE_ONE;\n\t\t\tAssert.assertStrictlyEquals(\"ImageSkin texture is not defaultTexture when texture not provided for specific state\", this._texture1, this._skin.texture);\n\n\t\t\tthis._context.currentState = STATE_TWO;\n\t\t\tAssert.assertStrictlyEquals(\"ImageSkin texture is not defaultTexture when texture not provided for specific state\", this._texture1, this._skin.texture);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextureWithSetTextureForState():void\n\t\t{\n\t\t\tthis._texture1 = Texture.fromColor(10, 10, 0xff00ff);\n\t\t\tthis._skin.defaultTexture = this._texture1;\n\t\t\tthis._texture2 = Texture.fromColor(10, 10, 0xff0000);\n\t\t\tthis._skin.setTextureForState(STATE_ONE, this._texture2);\n\t\t\tthis._texture3 = Texture.fromColor(10, 10, 0x00ff00);\n\t\t\tthis._skin.setTextureForState(STATE_TWO, this._texture3);\n\n\t\t\tthis._context.currentState = STATE_ONE;\n\t\t\tAssert.assertStrictlyEquals(\"ImageSkin texture is does not match texture passed to setTextureForState() for current state\", this._texture2, this._skin.texture);\n\n\t\t\tthis._context.currentState = STATE_TWO;\n\t\t\tAssert.assertStrictlyEquals(\"ImageSkin texture is does not match texture passed to setTextureForState() for current state\", this._texture3, this._skin.texture);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetColorForStateWithoutSetColorForState():void\n\t\t{\n\t\t\tAssert.assertStrictlyEquals(\"ImageSkin getColorForState(STATE_ONE) must be uint.MAX_VALUE when setColorForState() is not called\", uint.MAX_VALUE, this._skin.getColorForState(STATE_ONE));\n\t\t\tAssert.assertStrictlyEquals(\"ImageSkin getColorForState(STATE_TWO) must be uint.MAX_VALUE when setColorForState() is not called\", uint.MAX_VALUE, this._skin.getColorForState(STATE_TWO));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDefaultColorWithNoStateColors():void\n\t\t{\n\t\t\tAssert.assertStrictlyEquals(\"ImageSkin color must be 0xffffff when defaultColor and setColorForState() are not used\", 0xffffff, this._skin.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetColorForState():void\n\t\t{\n\t\t\tthis._skin.defaultColor = DEFAULT_COLOR;\n\t\t\tthis._skin.setColorForState(STATE_ONE, COLOR_ONE);\n\t\t\tthis._skin.setColorForState(STATE_TWO, COLOR_TWO);\n\n\t\t\tAssert.assertStrictlyEquals(\"ImageSkin getColorForState(STATE_ONE) does not match value passed to setColorForState()\", COLOR_ONE, this._skin.getColorForState(STATE_ONE));\n\t\t\tAssert.assertStrictlyEquals(\"ImageSkin getColorForState(STATE_TWO) does not match value passed to setColorForState()\", COLOR_TWO, this._skin.getColorForState(STATE_TWO));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDefaultColor():void\n\t\t{\n\t\t\tthis._skin.defaultColor = DEFAULT_COLOR;\n\n\t\t\tAssert.assertStrictlyEquals(\"ImageSkin color is not defaultColor when color not provided for current state\", DEFAULT_COLOR, this._skin.color);\n\n\t\t\tthis._context.isEnabled = false;\n\t\t\tAssert.assertStrictlyEquals(\"ImageSkin color is not defaultColor when disabled color not provided\", DEFAULT_COLOR, this._skin.color);\n\n\t\t\tthis._context.isEnabled = true;\n\n\t\t\tthis._context.currentState = STATE_ONE;\n\t\t\tAssert.assertStrictlyEquals(\"ImageSkin color is not defaultColor when color not provided for specific state\", DEFAULT_COLOR, this._skin.color);\n\n\t\t\tthis._context.currentState = STATE_TWO;\n\t\t\tAssert.assertStrictlyEquals(\"ImageSkin color is not defaultColor when color not provided for specific state\", DEFAULT_COLOR, this._skin.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentColorWithSetColorForState():void\n\t\t{\n\t\t\tthis._skin.defaultColor = DEFAULT_COLOR;\n\t\t\tthis._skin.setColorForState(STATE_ONE, COLOR_ONE);\n\t\t\tthis._skin.setColorForState(STATE_TWO, COLOR_TWO);\n\n\t\t\tthis._context.currentState = STATE_ONE;\n\t\t\tAssert.assertStrictlyEquals(\"ImageSkin color is does not match color passed to setColorForState() for current state\", COLOR_ONE, this._skin.color);\n\n\t\t\tthis._context.currentState = STATE_TWO;\n\t\t\tAssert.assertStrictlyEquals(\"ImageSkin color is does not match color passed to setColorForState() for current state\", COLOR_TWO, this._skin.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testClearExplicitDimensions():void\n\t\t{\n\t\t\tvar textureWidth:Number = 150;\n\t\t\tvar textureHeight:Number = 200;\n\t\t\tvar explicitWidth:Number = 250;\n\t\t\tvar explicitHeight:Number = 300;\n\t\t\tthis._texture1 = Texture.fromColor(textureWidth, textureHeight, 0xff00ff);\n\t\t\tthis._skin.defaultTexture = this._texture1;\n\t\t\tthis._skin.width = explicitWidth;\n\t\t\tthis._skin.height = explicitHeight;\n\n\t\t\tAssert.assertStrictlyEquals(\"ImageSkin width is does not match explicit width\",\n\t\t\t\texplicitWidth, this._skin.width);\n\t\t\tAssert.assertStrictlyEquals(\"ImageSkin width is does not match explicit height\",\n\t\t\t\texplicitHeight, this._skin.height);\n\n\t\t\tthis._skin.width = NaN;\n\t\t\tthis._skin.height = NaN;\n\n\t\t\tAssert.assertStrictlyEquals(\"ImageSkin width is does not match texture width\",\n\t\t\t\ttextureWidth, this._skin.width);\n\t\t\tAssert.assertStrictlyEquals(\"ImageSkin width is does not match texture height\",\n\t\t\t\ttextureHeight, this._skin.height);\n\t\t}\n\t}\n}\n\nimport feathers.core.FeathersControl;\nimport feathers.core.IStateContext;\nimport feathers.events.FeathersEventType;\n\nclass StateContext extends FeathersControl implements IStateContext\n{\n\tpublic function StateContext()\n\t{\n\t\tsuper();\n\t}\n\t\n\tprotected var _currentState:String;\n\t\n\tpublic function get currentState():String\n\t{\n\t\treturn this._currentState;\n\t}\n\n\tpublic function set currentState(value:String):void\n\t{\n\t\tif(this._currentState === value)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tthis._currentState = value;\n\t\tthis.dispatchEventWith(FeathersEventType.STATE_CHANGE);\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/InvalidateTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.LayoutGroup;\n\timport feathers.core.FeathersControl;\n\timport feathers.core.ValidationQueue;\n\n\timport org.flexunit.Assert;\n\n\tpublic class InvalidateTests\n\t{\n\t\tprivate var _control:LayoutGroup;\n\t\tprivate var _control2:InvalidationControl;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._control = new LayoutGroup();\n\t\t\tTestFeathers.starlingRoot.addChild(this._control);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._control.removeFromParent(true);\n\t\t\tthis._control = null;\n\n\t\t\tif(this._control2)\n\t\t\t{\n\t\t\t\tthis._control2.removeFromParent(true);\n\t\t\t\tthis._control2 = null;\n\t\t\t}\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testIsInvalidAfterInitialize():void\n\t\t{\n\t\t\tAssert.assertTrue(\"Control must be invalid after initialize\", this._control.isInvalid());\n\t\t\tAssert.assertTrue(\"Control must be invalid with flag after initialize\", this._control.isInvalid(FeathersControl.INVALIDATION_FLAG_DATA));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNotInvalidAfterValidate():void\n\t\t{\n\t\t\tthis._control.validate();\n\t\t\tAssert.assertFalse(\"Control must not be invalid after validate\", this._control.isInvalid());\n\t\t\tAssert.assertFalse(\"Control must not be invalid with flag after initialize\", this._control.isInvalid(FeathersControl.INVALIDATION_FLAG_DATA));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInvalidateWithNoFlags():void\n\t\t{\n\t\t\tthis._control.validate();\n\t\t\tthis._control.invalidate();\n\t\t\tAssert.assertTrue(\"Control must be invalid after invalidate()\", this._control.isInvalid());\n\t\t\tAssert.assertTrue(\"Control must be invalid with flag after invalidate()\", this._control.isInvalid(FeathersControl.INVALIDATION_FLAG_DATA));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInvalidateWithFlag():void\n\t\t{\n\t\t\tthis._control.validate();\n\t\t\tthis._control.invalidate(FeathersControl.INVALIDATION_FLAG_DATA);\n\t\t\tAssert.assertTrue(\"Control must be invalid after invalidate() with flag\", this._control.isInvalid());\n\t\t\tAssert.assertTrue(\"Control must be invalid with flag after invalidate() with same flag\", this._control.isInvalid(FeathersControl.INVALIDATION_FLAG_DATA));\n\t\t\tAssert.assertFalse(\"Control must not be invalid with flag after invalidate() with different flag\", this._control.isInvalid(FeathersControl.INVALIDATION_FLAG_STYLES));\n\t\t}\n\n\t\t[Test(expects=\"Error\")]\n\t\tpublic function testInfiniteInvalidateDuringValidation():void\n\t\t{\n\t\t\tthis._control2 = new InvalidationControl();\n\t\t\tTestFeathers.starlingRoot.addChild(this._control2);\n\t\t\t//run the full queue, forcing the control to repeatedly validate\n\t\t\t//which will throw an error\n\t\t\tValidationQueue.forStarling(TestFeathers.starlingRoot.stage.starling).advanceTime(0);\n\t\t}\n\t}\n}\n\nimport feathers.controls.LayoutGroup;\n\nclass InvalidationControl extends LayoutGroup\n{\n\tpublic function InvalidationControl()\n\t{\n\t\tsuper();\n\t}\n\n\toverride protected function draw():void\n\t{\n\t\tsuper.draw();\n\t\tthis.invalidate();\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/KeyToSelectTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.core.FocusManager;\n\timport feathers.tests.supportClasses.CustomToggle;\n\timport feathers.utils.keyboard.KeyToSelect;\n\n\timport flash.ui.Keyboard;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Stage;\n\timport starling.events.Event;\n\timport starling.events.KeyboardEvent;\n\n\tpublic class KeyToSelectTests\n\t{\n\t\tprivate var _target:CustomToggle;\n\t\tprivate var _keyToSelect:KeyToSelect;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._target = new CustomToggle();\n\t\t\tTestFeathers.starlingRoot.addChild(this._target);\n\t\t\tthis._target.validate();\n\t\t\t\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, true);\n\n\t\t\tthis._keyToSelect = new KeyToSelect(this._target);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._target.removeFromParent(true);\n\t\t\tthis._target = null;\n\n\t\t\tthis._keyToSelect = null;\n\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, false);\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t\tAssert.assertFalse(\"FocusManager not disabled on cleanup.\", FocusManager.isEnabledForStage(TestFeathers.starlingRoot.stage));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testIgnoreKeyAfterFocusOut():void\n\t\t{\n\t\t\tthis._target.isSelected = false;\n\t\t\tFocusManager.focus = this._target;\n\t\t\tFocusManager.focus = null;\n\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._target.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, 0, Keyboard.SPACE));\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, 0, Keyboard.SPACE));\n\t\t\tAssert.assertFalse(\"Event.CHANGE was incorrectly dispatched\", hasChanged);\n\t\t\tAssert.assertFalse(\"isSelected was incorrectly changed to true after key to select when not in focus\", this._target.isSelected);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChangeEvent():void\n\t\t{\n\t\t\tthis._target.isSelected = false;\n\t\t\tFocusManager.focus = this._target;\n\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._target.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, 0, Keyboard.SPACE));\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, 0, Keyboard.SPACE));\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"isSelected was not changed to true after key to select\", this._target.isSelected);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDisabled():void\n\t\t{\n\t\t\tthis._target.isSelected = false;\n\t\t\tthis._keyToSelect.isEnabled = false;\n\t\t\tFocusManager.focus = this._target;\n\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._target.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, 0, Keyboard.SPACE));\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, 0, Keyboard.SPACE));\n\t\t\tAssert.assertFalse(\"Event.CHANGE was incorrectly dispatched when disabled\", hasChanged);\n\t\t\tAssert.assertFalse(\"isSelected was incorrectly changed to true after key to select when disabled\", this._target.isSelected);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoErrorWhenDisabledAfterRemove():void\n\t\t{\n\t\t\tthis._target.removeFromParent(false);\n\t\t\tthis._keyToSelect.isEnabled = false;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCancelKeyBeforeChangeEvent():void\n\t\t{\n\t\t\tthis._target.isSelected = false;\n\t\t\tFocusManager.focus = this._target;\n\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._target.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, 0, Keyboard.SPACE));\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, 0, Keyboard.ESCAPE));\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, 0, Keyboard.ESCAPE));\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, 0, Keyboard.SPACE));\n\t\t\tAssert.assertFalse(\"Event.CHANGE was incorrectly dispatched after cancel key\", hasChanged);\n\t\t\tAssert.assertFalse(\"isSelected was incorrectly changed to true after cancel key\", this._target.isSelected);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDeselect():void\n\t\t{\n\t\t\tthis._keyToSelect.keyToDeselect = true;\n\t\t\tthis._target.isSelected = true;\n\t\t\tFocusManager.focus = this._target;\n\t\t\t\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, 0, Keyboard.SPACE));\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, 0, Keyboard.SPACE));\n\t\t\tAssert.assertFalse(\"isSelected was not changed to false when keyToDeselect set to true\", this._target.isSelected);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDisabledDeselect():void\n\t\t{\n\t\t\tthis._keyToSelect.keyToDeselect = false;\n\t\t\tthis._target.isSelected = true;\n\t\t\tFocusManager.focus = this._target;\n\t\t\t\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, 0, Keyboard.SPACE));\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, 0, Keyboard.SPACE));\n\t\t\tAssert.assertTrue(\"isSelected was incorrectly changed to false when keyToDeselect set to false\", this._target.isSelected);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemovedBeforeTriggeredEvent():void\n\t\t{\n\t\t\tthis._target.isSelected = false;\n\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._target.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\n\t\t\tvar stage:Stage = this._target.stage;\n\t\t\tstage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, 0, Keyboard.SPACE));\n\n\t\t\tthis._target.removeFromParent(false);\n\n\t\t\tstage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, 0, Keyboard.SPACE));\n\n\t\t\t//while it's good to check that Event.CHANGE isn't dispatched,\n\t\t\t//this test also ensures that no runtime errors are thrown after the\n\t\t\t//target is removed (its stage property is null, and that is used\n\t\t\t//by KeyToSelect)\n\n\t\t\tAssert.assertFalse(\"Event.CHANGE was incorrectly dispatched when target was removed\", hasChanged);\n\t\t\tAssert.assertFalse(\"isSelected was incorrectly changed to true when target was removed\", this._target.isSelected);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/KeyToTriggerTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.core.FocusManager;\n\timport feathers.tests.supportClasses.CustomToggle;\n\timport feathers.utils.keyboard.KeyToTrigger;\n\n\timport flash.ui.Keyboard;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Stage;\n\timport starling.events.Event;\n\timport starling.events.KeyboardEvent;\n\n\tpublic class KeyToTriggerTests\n\t{\n\t\tprivate var _target:CustomToggle;\n\t\tprivate var _keyToTrigger:KeyToTrigger;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._target = new CustomToggle();\n\t\t\tthis._target.setSize(200, 200);\n\t\t\tTestFeathers.starlingRoot.addChild(this._target);\n\n\t\t\tthis._keyToTrigger = new KeyToTrigger(this._target);\n\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, true);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._target.removeFromParent(true);\n\t\t\tthis._target = null;\n\n\t\t\tthis._keyToTrigger = null;\n\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, false);\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t\tAssert.assertFalse(\"FocusManager not disabled on cleanup.\", FocusManager.isEnabledForStage(TestFeathers.starlingRoot.stage));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTriggeredEvent():void\n\t\t{\n\t\t\tFocusManager.focus = this._target;\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tthis._target.addEventListener(Event.TRIGGERED, function(event:Event):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t});\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, 0, Keyboard.SPACE));\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, 0, Keyboard.SPACE));\n\t\t\tAssert.assertTrue(\"Event.TRIGGERED was not dispatched\", hasTriggered);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDisabled():void\n\t\t{\n\t\t\tthis._keyToTrigger.isEnabled = false;\n\t\t\tFocusManager.focus = this._target;\n\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tthis._target.addEventListener(Event.TRIGGERED, function(event:Event):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t});\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, 0, Keyboard.SPACE));\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, 0, Keyboard.SPACE));\n\t\t\tAssert.assertFalse(\"Event.TRIGGERED was incorrectly dispatched when disabled\", hasTriggered);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoErrorWhenDisabledAfterRemove():void\n\t\t{\n\t\t\tthis._target.removeFromParent(false);\n\t\t\tthis._keyToTrigger.isEnabled = false;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCancelKeyBeforeTriggeredEvent():void\n\t\t{\n\t\t\tFocusManager.focus = this._target;\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tthis._target.addEventListener(Event.TRIGGERED, function(event:Event):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t});\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, 0, Keyboard.SPACE));\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, 0, Keyboard.ESCAPE));\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, 0, Keyboard.ESCAPE));\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, 0, Keyboard.SPACE));\n\t\t\tAssert.assertFalse(\"Event.TRIGGERED was incorrectly dispatched when touch moved out of bounds\", hasTriggered);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemovedBeforeTriggeredEvent():void\n\t\t{\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tthis._target.addEventListener(Event.TRIGGERED, function(event:Event):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t});\n\n\t\t\tvar stage:Stage = this._target.stage;\n\t\t\tstage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, 0, Keyboard.SPACE));\n\n\t\t\tthis._target.removeFromParent(false);\n\n\t\t\tstage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, 0, Keyboard.SPACE));\n\n\t\t\t//while it's good to check that Event.TRIGGERED isn't dispatched,\n\t\t\t//this test also ensures that no runtime errors are thrown after the\n\t\t\t//target is removed (its stage property is null, and that may be\n\t\t\t//used by KeyToTrigger)\n\t\t\tAssert.assertFalse(\"Event.TRIGGERED was incorrectly dispatched when target was removed\", hasTriggered);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/LabelMeasurementTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Label;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.text.BitmapFontTextRenderer;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class LabelMeasurementTests\n\t{\n\t\tprivate static const SIMPLE_TEXT:String = \"Huge Mayo\";\n\t\t\n\t\tprivate static const BACKGROUND_WIDTH:Number = 200;\n\t\tprivate static const BACKGROUND_HEIGHT:Number = 250;\n\t\tprivate static const BACKGROUND_WIDTH2:Number = 125;\n\t\tprivate static const BACKGROUND_HEIGHT2:Number = 100;\n\t\tprivate static const BACKGROUND_WIDTH3:Number = 150;\n\t\tprivate static const BACKGROUND_HEIGHT3:Number = 175;\n\t\t\n\t\tprivate static const PADDING_TOP:Number = 4;\n\t\tprivate static const PADDING_RIGHT:Number = 10;\n\t\tprivate static const PADDING_BOTTOM:Number = 3;\n\t\tprivate static const PADDING_LEFT:Number = 16;\n\t\t\n\t\tprotected var textRenderer:BitmapFontTextRenderer;\n\t\tprotected var label:Label;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis.label = new Label();\n\t\t\tTestFeathers.starlingRoot.addChild(this.label);\n\n\t\t\tthis.textRenderer = new BitmapFontTextRenderer();\n\t\t\tTestFeathers.starlingRoot.addChild(this.textRenderer);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis.textRenderer.removeFromParent(true);\n\t\t\tthis.textRenderer = null;\n\n\t\t\tthis.label.removeFromParent(true);\n\t\t\tthis.label = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\tprotected function addSimpleBackgroundSkin():void\n\t\t{\n\t\t\tthis.label.backgroundSkin = new Quad(BACKGROUND_WIDTH, BACKGROUND_HEIGHT);\n\t\t}\n\n\t\tprotected function addComplexBackgroundSkin():void\n\t\t{\n\t\t\tvar backgroundSkin:LayoutGroup = new LayoutGroup();\n\t\t\tbackgroundSkin.minWidth = BACKGROUND_WIDTH2;\n\t\t\tbackgroundSkin.minHeight = BACKGROUND_HEIGHT2;\n\t\t\tbackgroundSkin.width = BACKGROUND_WIDTH3;\n\t\t\tbackgroundSkin.height = BACKGROUND_HEIGHT3;\n\t\t\tthis.label.backgroundSkin = backgroundSkin;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSize():void\n\t\t{\n\t\t\tthis.textRenderer.text = SIMPLE_TEXT;\n\t\t\tthis.textRenderer.validate();\n\t\t\t\n\t\t\tthis.label.text = SIMPLE_TEXT;\n\t\t\tthis.label.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"Label width not equal to text renderer width\", this.textRenderer.width, this.label.width);\n\t\t\tAssert.assertStrictlyEquals(\"Label height not equal to text renderer height\", this.textRenderer.height, this.label.height);\n\t\t\tAssert.assertStrictlyEquals(\"Label minWidth not equal to 0 when explicitWidth not set\", 0, this.label.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"Label minHeight not equal to text renderer height\", this.textRenderer.height, this.label.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithPadding():void\n\t\t{\n\t\t\tthis.textRenderer.text = SIMPLE_TEXT;\n\t\t\tthis.textRenderer.validate();\n\n\t\t\tthis.label.paddingTop = PADDING_TOP;\n\t\t\tthis.label.paddingRight = PADDING_RIGHT;\n\t\t\tthis.label.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis.label.paddingLeft = PADDING_LEFT;\n\t\t\tthis.label.text = SIMPLE_TEXT;\n\t\t\tthis.label.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"Label width not equal to text renderer width plus padding left and padding right\", this.textRenderer.width + PADDING_LEFT + PADDING_RIGHT, this.label.width);\n\t\t\tAssert.assertStrictlyEquals(\"Label height not equal to text renderer height plus padding top and padding bottom\", this.textRenderer.height + PADDING_TOP + PADDING_BOTTOM, this.label.height);\n\t\t\tAssert.assertStrictlyEquals(\"Label minWidth not equal padding left and padding right\", PADDING_LEFT + PADDING_RIGHT, this.label.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"Label minHeight not equal to text renderer height plus padding top and padding bottom\", this.textRenderer.height + PADDING_TOP + PADDING_BOTTOM, this.label.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithSimpleBackground():void\n\t\t{\n\t\t\tthis.addSimpleBackgroundSkin();\n\t\t\tthis.label.text = SIMPLE_TEXT;\n\t\t\tthis.label.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"Label width not equal to simple background width\", BACKGROUND_WIDTH, this.label.width);\n\t\t\tAssert.assertStrictlyEquals(\"Label height not equal to simple background height\", BACKGROUND_HEIGHT, this.label.height);\n\t\t\tAssert.assertStrictlyEquals(\"Label minWidth not equal to simple background width\", BACKGROUND_WIDTH, this.label.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"Label minHeight not equal to simple background height\", BACKGROUND_HEIGHT, this.label.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithSimpleBackgroundAndPadding():void\n\t\t{\n\t\t\tthis.textRenderer.text = SIMPLE_TEXT;\n\t\t\tthis.textRenderer.validate();\n\n\t\t\tthis.addSimpleBackgroundSkin();\n\t\t\tthis.label.paddingTop = PADDING_TOP;\n\t\t\tthis.label.paddingRight = PADDING_RIGHT;\n\t\t\tthis.label.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis.label.paddingLeft = PADDING_LEFT;\n\t\t\tthis.label.text = SIMPLE_TEXT;\n\t\t\tthis.label.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"Label width not equal to simple background width\", BACKGROUND_WIDTH, this.label.width);\n\t\t\tAssert.assertStrictlyEquals(\"Label height not equal to simple background height\", BACKGROUND_HEIGHT, this.label.height);\n\t\t\tAssert.assertStrictlyEquals(\"Label minWidth not equal to simple background width\", BACKGROUND_WIDTH, this.label.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"Label minHeight not equal to simple background height\", BACKGROUND_HEIGHT, this.label.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithComplexBackground():void\n\t\t{\n\t\t\tthis.addComplexBackgroundSkin();\n\t\t\tthis.label.text = SIMPLE_TEXT;\n\t\t\tthis.label.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"Label width not equal to simple background width\", BACKGROUND_WIDTH3, this.label.width);\n\t\t\tAssert.assertStrictlyEquals(\"Label height not equal to simple background height\", BACKGROUND_HEIGHT3, this.label.height);\n\t\t\tAssert.assertStrictlyEquals(\"Label minWidth not equal to simple background width\", BACKGROUND_WIDTH2, this.label.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"Label minHeight not equal to simple background height\", BACKGROUND_HEIGHT2, this.label.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChangeTextToResizeSkin():void\n\t\t{\n\t\t\tthis.label.text = \"I am the very model of a modern major general\";\n\t\t\tthis.label.backgroundSkin = new Quad(10, 10, 0xff00ff);\n\t\t\tthis.label.backgroundDisabledSkin = new Quad(10, 10, 0xff00ff);\n\t\t\tthis.label.validate();\n\t\t\t//the text's dimensions were large enough to make label bigger than\n\t\t\t//the skin's dimensions\n\t\t\tthis.label.text = \"\";\n\t\t\t//switch to a different skin before validation\n\t\t\tthis.label.isEnabled = false;\n\t\t\tthis.label.validate();\n\t\t\t//now switch back to the original skin, and the dimensions could\n\t\t\t//be wrong if they weren't restored\n\t\t\tthis.label.isEnabled = true;\n\t\t\tthis.label.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Label was not calculated correctly after changing to a different skin and changing text dimensions.\",\n\t\t\t\t10, this.label.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Label was not calculated correctly after changing to a different skin and changing text dimensions\",\n\t\t\t\t10, this.label.height);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/LabelTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Label;\n\timport feathers.tests.supportClasses.DisposeFlagQuad;\n\n\timport org.flexunit.Assert;\n\n\tpublic class LabelTests\n\t{\n\t\tprotected var label:Label;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis.label = new Label();\n\t\t\tTestFeathers.starlingRoot.addChild(this.label);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis.label.removeFromParent(true);\n\t\t\tthis.label = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSkinsDisposed():void\n\t\t{\n\t\t\tvar backgroundSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis.label.backgroundSkin = backgroundSkin;\n\t\t\tvar backgroundDisabledSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis.label.backgroundDisabledSkin = backgroundDisabledSkin;\n\t\t\tthis.label.validate();\n\t\t\tthis.label.dispose();\n\t\t\tAssert.assertTrue(\"backgroundSkin not disposed when Label disposed.\", backgroundSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"backgroundDisabledSkin not disposed when Label disposed.\", backgroundDisabledSkin.isDisposed);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/LayoutGroupHorizontalLayoutTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.LayoutGroup;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.HorizontalLayout;\n\timport feathers.layout.VerticalAlign;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class LayoutGroupHorizontalLayoutTests\n\t{\n\t\tprivate static const PADDING_TOP:Number = 6;\n\t\tprivate static const PADDING_RIGHT:Number = 8;\n\t\tprivate static const PADDING_BOTTOM:Number = 2;\n\t\tprivate static const PADDING_LEFT:Number = 10;\n\t\tprivate static const GAP:Number = 5;\n\t\tprivate static const FIRST_GAP:Number = 7;\n\t\tprivate static const LAST_GAP:Number = 6;\n\t\tprivate static const CHILD1_WIDTH:Number = 200;\n\t\tprivate static const CHILD1_HEIGHT:Number = 100;\n\t\tprivate static const CHILD2_WIDTH:Number = 150;\n\t\tprivate static const CHILD2_HEIGHT:Number = 75;\n\t\tprivate static const CHILD3_WIDTH:Number = 75;\n\t\tprivate static const CHILD3_HEIGHT:Number = 50;\n\t\tprivate static const CHILD4_WIDTH:Number = 10;\n\t\tprivate static const CHILD4_HEIGHT:Number = 20;\n\t\t\n\t\tprivate var _group:LayoutGroup;\n\t\tprivate var _layout:HorizontalLayout;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._group = new LayoutGroup();\n\t\t\tthis._layout = new HorizontalLayout();\n\t\t\tthis._group.layout = this._layout;\n\t\t\tTestFeathers.starlingRoot.addChild(this._group);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._group.removeFromParent(true);\n\t\t\tthis._group = null;\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDimensionsWithNoChildren():void\n\t\t{\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout width not equal to 0 with no children.\", 0, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout height not equal to 0 with no children.\", 0, this._group.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDimensionsWithPaddingGapAndNoChildren():void\n\t\t{\n\t\t\tthis._layout.paddingTop = PADDING_TOP;\n\t\t\tthis._layout.paddingRight = PADDING_RIGHT;\n\t\t\tthis._layout.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._layout.paddingLeft = PADDING_LEFT;\n\t\t\tthis._layout.gap = GAP;\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout width not equal to sum of left and right padding with no children.\", PADDING_LEFT + PADDING_RIGHT, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout height not equal to sum of top and bottom padding with no children.\", PADDING_TOP + PADDING_BOTTOM, this._group.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDimensionsWithOneChild():void\n\t\t{\n\t\t\tthis._group.addChild(new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff));\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout width not equal to child width.\", CHILD1_WIDTH, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout height not equal to child height.\", CHILD1_HEIGHT, this._group.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDimensionsWithPaddingGapAndOneChild():void\n\t\t{\n\t\t\tthis._layout.paddingTop = PADDING_TOP;\n\t\t\tthis._layout.paddingRight = PADDING_RIGHT;\n\t\t\tthis._layout.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._layout.paddingLeft = PADDING_LEFT;\n\t\t\tthis._layout.gap = GAP;\n\t\t\tthis._group.addChild(new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff));\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout width not equal to sum of left and right padding and width of child.\", CHILD1_WIDTH + PADDING_LEFT + PADDING_RIGHT, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout height not equal to sum of top and bottom padding and height of child.\", CHILD1_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._group.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDimensionsWithTwoChildren():void\n\t\t{\n\t\t\tthis._group.addChild(new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff));\n\t\t\tthis._group.addChild(new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff));\n\t\t\tthis._group.validate();\n\t\t\tvar maxChildHeight:Number = Math.max(CHILD1_HEIGHT, CHILD2_HEIGHT);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout width not equal to sum of child widths.\", CHILD1_WIDTH + CHILD2_WIDTH, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout height not equal to max height of children.\", maxChildHeight, this._group.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDimensionsWithPaddingGapAndTwoChildren():void\n\t\t{\n\t\t\tthis._layout.paddingTop = PADDING_TOP;\n\t\t\tthis._layout.paddingRight = PADDING_RIGHT;\n\t\t\tthis._layout.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._layout.paddingLeft = PADDING_LEFT;\n\t\t\tthis._layout.gap = GAP;\n\t\t\tthis._group.addChild(new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff));\n\t\t\tthis._group.addChild(new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff));\n\t\t\tthis._group.validate();\n\t\t\tvar maxChildHeight:Number = Math.max(CHILD1_HEIGHT, CHILD2_HEIGHT);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout width not equal to sum of left and right padding, gap, and sum of child widths.\", CHILD1_WIDTH + CHILD2_WIDTH + GAP + PADDING_LEFT + PADDING_RIGHT, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout height not equal to sum of top and bottom padding and max height of children.\", maxChildHeight + PADDING_TOP + PADDING_BOTTOM, this._group.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHeightWithMaxHeightLargerThanChild():void\n\t\t{\n\t\t\tthis._group.maxHeight = CHILD1_HEIGHT + 100;\n\t\t\tthis._group.addChild(new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff));\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout height not equal to child height when maxHeight is larger than child height.\", CHILD1_HEIGHT, this._group.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHeightWithMaxHeightSmallerThanChild():void\n\t\t{\n\t\t\tthis._group.maxHeight = CHILD1_HEIGHT / 2;\n\t\t\tthis._group.addChild(new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff));\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout height not equal to maxHeight when maxHeight is smaller than child height.\", this._group.maxHeight, this._group.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testWidthWithGapAndTwoChildren():void\n\t\t{\n\t\t\tthis._layout.gap = GAP;\n\t\t\tthis._group.addChild(new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff));\n\t\t\tthis._group.addChild(new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff));\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout width not equal to gap plus sum of child widths.\", CHILD1_WIDTH + CHILD2_WIDTH + GAP, this._group.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testWidthWithMaxWidthLargerThanChild():void\n\t\t{\n\t\t\tthis._group.maxWidth = CHILD1_WIDTH + 100;\n\t\t\tthis._group.addChild(new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff));\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout width not equal to child width when maxWidth is larger than child width.\", CHILD1_WIDTH, this._group.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testWidthWithMaxWidthSmallerThanChild():void\n\t\t{\n\t\t\tthis._group.maxWidth = CHILD1_WIDTH / 2;\n\t\t\tthis._group.addChild(new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff));\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout width not equal to maxWidth when maxWidth is smaller than child width.\", this._group.maxWidth, this._group.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testWidthWithFirstGapAndTwoChildren():void\n\t\t{\n\t\t\tthis._layout.gap = GAP;\n\t\t\tthis._layout.firstGap = FIRST_GAP;\n\t\t\tthis._group.addChild(new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff));\n\t\t\tthis._group.addChild(new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff));\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout width not equal to gap plus sum of child widths.\", CHILD1_WIDTH + CHILD2_WIDTH + FIRST_GAP, this._group.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testWidthWithLastGapAndTwoChildren():void\n\t\t{\n\t\t\tthis._layout.gap = GAP;\n\t\t\tthis._layout.lastGap = LAST_GAP;\n\t\t\tthis._group.addChild(new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff));\n\t\t\tthis._group.addChild(new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff));\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout width not equal to gap plus sum of child widths when using last gap with two children.\", CHILD1_WIDTH + CHILD2_WIDTH + GAP, this._group.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testWidthWithFirstGapAndThreeChildren():void\n\t\t{\n\t\t\tthis._layout.gap = GAP;\n\t\t\tthis._layout.firstGap = FIRST_GAP;\n\t\t\tthis._group.addChild(new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff));\n\t\t\tthis._group.addChild(new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff));\n\t\t\tthis._group.addChild(new Quad(CHILD3_WIDTH, CHILD3_HEIGHT, 0xff00ff));\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout width not equal to sum of child widths, plus first gap, plus gap, with three children.\", CHILD1_WIDTH + CHILD2_WIDTH + CHILD3_WIDTH + GAP + FIRST_GAP, this._group.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testWidthWithLastGapAndThreeChildren():void\n\t\t{\n\t\t\tthis._layout.gap = GAP;\n\t\t\tthis._layout.lastGap = LAST_GAP;\n\t\t\tthis._group.addChild(new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff));\n\t\t\tthis._group.addChild(new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff));\n\t\t\tthis._group.addChild(new Quad(CHILD3_WIDTH, CHILD3_HEIGHT, 0xff00ff));\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout width not equal to sum of child widths, plus gap, plus last gap, with three children.\", CHILD1_WIDTH + CHILD2_WIDTH + CHILD3_WIDTH + GAP + LAST_GAP, this._group.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testWidthWithFirstAndLastGapAndFourChildren():void\n\t\t{\n\t\t\tthis._layout.gap = GAP;\n\t\t\tthis._layout.firstGap = FIRST_GAP;\n\t\t\tthis._layout.lastGap = LAST_GAP;\n\t\t\tthis._group.addChild(new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff));\n\t\t\tthis._group.addChild(new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff));\n\t\t\tthis._group.addChild(new Quad(CHILD3_WIDTH, CHILD3_HEIGHT, 0xff00ff));\n\t\t\tthis._group.addChild(new Quad(CHILD4_WIDTH, CHILD4_HEIGHT, 0xff00ff));\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"HorizontalLayout width not equal to sum of child widths, plus first gap, plus gap, plus last gap, with four children.\", CHILD1_WIDTH + CHILD2_WIDTH + CHILD3_WIDTH + CHILD4_WIDTH + FIRST_GAP + GAP + LAST_GAP, this._group.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChildXWithHorizontalAlignCenterAndMaxWidthSmallerThanChild():void\n\t\t{\n\t\t\tthis._layout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tvar child:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._group.maxWidth = child.width / 2;\n\t\t\tthis._group.addChild(child);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Child x position incorrectly set to value less than zero with HorizontalAlign.CENTER\", 0, child.x);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChildYWithVerticalAlignMiddleAndMaxHeightSmallerThanChild():void\n\t\t{\n\t\t\tthis._layout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\tvar child:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._group.maxHeight = child.height / 2;\n\t\t\tthis._group.addChild(child);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Child y position incorrectly set to value less than zero with VerticalAlign.MIDDLE\", 0, child.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChildXIsIntegerWithHorizontalAlignCenter():void\n\t\t{\n\t\t\tthis._layout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tvar child:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._group.width = child.width + 111;\n\t\t\tthis._group.addChild(child);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Child x position incorrectly set to non-integer with HorizontalAlign.CENTER\", Math.round(child.x), child.x);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChildYIsIntegerWithVerticalAlignMiddle():void\n\t\t{\n\t\t\tthis._layout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\tvar child:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._group.height = child.height + 111;\n\t\t\tthis._group.addChild(child);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Child y position incorrectly set to non-integer with VerticalAlign.MIDDLE\", Math.round(child.y), child.y);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/LayoutGroupInternalStateTests.as",
    "content": "package feathers.tests\n{\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\n\tpublic class LayoutGroupInternalStateTests\n\t{\n\n\t\tprivate var _group:ExposedLayoutGroup;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._group = new ExposedLayoutGroup();\n\t\t\tTestFeathers.starlingRoot.addChild(this._group);\n\t\t\tthis._group.validate();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._group.removeFromParent(true);\n\t\t\tthis._group = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testItemsLengthAfterAdd():void\n\t\t{\n\t\t\tvar child:Quad = new Quad(100, 100, 0xff00ff);\n\t\t\tthis._group.addChild(child);\n\t\t\tAssert.assertStrictlyEquals(\"LayoutGroup items not properly updated after adding child.\", 1, this._group.internalItems.length);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testItemsLengthAfterRemove():void\n\t\t{\n\t\t\tvar child:Quad = new Quad(100, 100, 0xff00ff);\n\t\t\tthis._group.addChild(child);\n\t\t\tthis._group.removeChild(child);\n\t\t\tAssert.assertStrictlyEquals(\"LayoutGroup items not properly updated after removing child.\", 0, this._group.internalItems.length);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testItemsLengthAfterRemoveInRemovedFromStage():void\n\t\t{\n\t\t\tvar child1:Quad = new Quad(100, 100, 0xff00ff);\n\t\t\tthis._group.addChild(child1);\n\t\t\tvar child2:Quad = new Quad(100, 100, 0xffff00);\n\t\t\tthis._group.addChild(child2);\n\t\t\tchild2.addEventListener(Event.REMOVED_FROM_STAGE, function():void\n\t\t\t{\n\t\t\t\tchild1.removeFromParent(true);\n\t\t\t});\n\t\t\tchild2.removeFromParent(true);\n\t\t\tAssert.assertStrictlyEquals(\"LayoutGroup items not properly updated after removing child in Event.REMOVED_FROM_STAGE listener for other child.\", 0, this._group.internalItems.length);\n\t\t}\n\t}\n}\n\nimport feathers.controls.LayoutGroup;\n\nimport starling.display.DisplayObject;\n\nclass ExposedLayoutGroup extends LayoutGroup\n{\n\tpublic function get internalItems():Vector.<DisplayObject>\n\t{\n\t\treturn this.items;\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/LayoutGroupMeasurementTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.AutoSizeMode;\n\timport feathers.controls.LayoutGroup;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class LayoutGroupMeasurementTests\n\t{\n\t\t//note: the background width is purposefully smaller than the item width\n\t\tprivate static const BACKGROUND_WIDTH:Number = 200;\n\t\t//note: the background height is purposefully larger than the item height\n\t\tprivate static const BACKGROUND_HEIGHT:Number = 250;\n\t\tprivate static const BACKGROUND_MIN_WIDTH:Number = 180;\n\t\tprivate static const BACKGROUND_MIN_HEIGHT:Number = 190;\n\n\t\t//note: the item width is purposefully larger than the background width\n\t\tprivate static const ITEM_WIDTH:Number = 210;\n\t\t//note: the item height is purposefully smaller than the background height\n\t\tprivate static const ITEM_HEIGHT:Number = 160;\n\n\t\tprivate static const ITEM_WIDTH2:Number = 190;\n\t\tprivate static const ITEM_HEIGHT2:Number = 170;\n\n\t\tprivate static const ITEM_PIVOTX:Number = 105;\n\t\tprivate static const ITEM_PIVOTY:Number = 80;\n\n\t\tprivate var _group:LayoutGroup;\n\t\tprivate var _group2:LayoutGroup;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._group = new LayoutGroup();\n\t\t\tTestFeathers.starlingRoot.addChild(this._group);\n\t\t\tthis._group.validate();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._group.removeFromParent(true);\n\t\t\tthis._group = null;\n\t\t\t\n\t\t\tif(this._group2)\n\t\t\t{\n\t\t\t\tthis._group2.removeFromParent(true);\n\t\t\t\tthis._group2 = null;\n\t\t\t}\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\t\t\n\t\tprivate function addSimpleBackground():void\n\t\t{\n\t\t\tthis._group.backgroundSkin = new Quad(BACKGROUND_WIDTH, BACKGROUND_HEIGHT);\n\t\t}\n\n\t\tprivate function addComplexBackground():void\n\t\t{\n\t\t\tvar backgroundSkin:LayoutGroup = new LayoutGroup();\n\t\t\tbackgroundSkin.setSize(BACKGROUND_WIDTH, BACKGROUND_HEIGHT);\n\t\t\tbackgroundSkin.minWidth = BACKGROUND_MIN_WIDTH;\n\t\t\tbackgroundSkin.minHeight = BACKGROUND_MIN_HEIGHT;\n\t\t\tthis._group.backgroundSkin = backgroundSkin;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeNoChildrenNoBackgroundAndNoLayout():void\n\t\t{\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the layout group was not calculated correctly when empty.\",\n\t\t\t\t0, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the layout group was not calculated correctly when empty.\",\n\t\t\t\t0, this._group.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the layout group was not calculated correctly when empty.\",\n\t\t\t\t0, this._group.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the layout group was not calculated correctly when empty.\",\n\t\t\t\t0, this._group.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithSimpleBackgroundAndNoChildren():void\n\t\t{\n\t\t\tthis.addSimpleBackground();\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the layout group was not calculated correctly with background skin and no children.\",\n\t\t\t\tBACKGROUND_WIDTH, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the layout group was not calculated correctly with background skin and no children.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._group.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the layout group was not calculated correctly with background skin and no children.\",\n\t\t\t\tBACKGROUND_WIDTH, this._group.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the layout group was not calculated correctly with background skin and no children.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._group.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithComplexBackgroundAndNoChildren():void\n\t\t{\n\t\t\tthis.addComplexBackground();\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the layout group was not calculated correctly with complex background skin and no children.\",\n\t\t\t\tBACKGROUND_WIDTH, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the layout group was not calculated correctly with complex background skin and no children.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._group.height);\n\t\t\t\n\t\t\t//this is a little different than other components. the layout needs\n\t\t\t//to account for the full background dimensions, so the minimum\n\t\t\t//dimensions cannot be passed to the layout. to use minimum\n\t\t\t//dimensions with a LayoutGroup, they need to be set on the\n\t\t\t//LayoutGroup directly!\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the layout group was not calculated correctly with complex background skin and no children.\",\n\t\t\t\tBACKGROUND_WIDTH, this._group.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the layout group was not calculated correctly with complex background skin and no children.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._group.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeModeStage():void\n\t\t{\n\t\t\tthis._group.autoSizeMode = AutoSizeMode.STAGE;\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the layout group was not calculated correctly with autoSizeMode set to AutoSizeMode.STAGE.\",\n\t\t\t\tthis._group.stage.stageWidth, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the layout group was not calculated correctly with autoSizeMode set to AutoSizeMode.STAGE.\",\n\t\t\t\tthis._group.stage.stageHeight, this._group.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the layout group was not calculated correctly with autoSizeMode set to AutoSizeMode.STAGE.\",\n\t\t\t\tthis._group.stage.stageWidth, this._group.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the layout group was not calculated correctly with autoSizeMode set to AutoSizeMode.STAGE.\",\n\t\t\t\tthis._group.stage.stageHeight, this._group.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeModeStageWithoutParent():void\n\t\t{\n\t\t\tthis._group2 = new LayoutGroup();\n\t\t\tthis._group2.autoSizeMode = AutoSizeMode.STAGE;\n\t\t\tthis._group2.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the LayoutGroup was not calculated correctly with no parent and AutoSizeMode.STAGE.\",\n\t\t\t\t0, this._group2.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the LayoutGroup was not calculated correctly with no parent and AutoSizeMode.STAGE.\",\n\t\t\t\t0, this._group2.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the LayoutGroup was not calculated correctly with no parent and AutoSizeMode.STAGE.\",\n\t\t\t\t0, this._group2.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the LayoutGroup was not calculated correctly with no parent and AutoSizeMode.STAGE.\",\n\t\t\t\t0, this._group2.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeModeStageWithValidateBeforeAdd():void\n\t\t{\n\t\t\tthis._group2 = new LayoutGroup();\n\t\t\tthis._group2.autoSizeMode = AutoSizeMode.STAGE;\n\t\t\tthis._group2.validate();\n\t\t\tTestFeathers.starlingRoot.addChild(this._group2);\n\t\t\tthis._group2.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the LayoutGroup was not calculated correctly after addChild() when validated before with AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageWidth, this._group2.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the LayoutGroup was not calculated correctly after addChild() when validated before with AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageHeight, this._group2.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the LayoutGroup was not calculated correctly after addChild() when validated before with AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageWidth, this._group2.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the LayoutGroup was not calculated correctly after addChild() when validated before with AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageHeight, this._group2.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeModeStageWithChildBeyondStageEdges():void\n\t\t{\n\t\t\tthis._group.autoSizeMode = AutoSizeMode.STAGE;\n\t\t\tvar child:Quad = new Quad(ITEM_WIDTH, ITEM_HEIGHT);\n\t\t\tchild.x = this._group.stage.stageWidth + 100;\n\t\t\tchild.y = this._group.stage.stageHeight + 100;\n\t\t\tthis._group.addChild(child);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the layout group was not calculated correctly with autoSizeMode set to AutoSizeMode.STAGE.\",\n\t\t\t\tthis._group.stage.stageWidth, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the layout group was not calculated correctly with autoSizeMode set to AutoSizeMode.STAGE.\",\n\t\t\t\tthis._group.stage.stageHeight, this._group.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the layout group was not calculated correctly with autoSizeMode set to AutoSizeMode.STAGE.\",\n\t\t\t\tthis._group.stage.stageWidth, this._group.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the layout group was not calculated correctly with autoSizeMode set to AutoSizeMode.STAGE.\",\n\t\t\t\tthis._group.stage.stageHeight, this._group.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithChildAtOrigin():void\n\t\t{\n\t\t\tthis._group.addChild(new Quad(ITEM_WIDTH, ITEM_HEIGHT));\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the layout group was not calculated correctly.\",\n\t\t\t\tITEM_WIDTH, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the layout group was not calculated correctly.\",\n\t\t\t\tITEM_HEIGHT, this._group.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the layout group was not calculated correctly.\",\n\t\t\t\tITEM_WIDTH, this._group.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the layout group was not calculated correctly.\",\n\t\t\t\tITEM_HEIGHT, this._group.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithChild():void\n\t\t{\n\t\t\tvar child:Quad = new Quad(ITEM_WIDTH, ITEM_HEIGHT);\n\t\t\tchild.x = 120;\n\t\t\tchild.y = 130;\n\t\t\tthis._group.addChild(child);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the layout group was not calculated correctly.\",\n\t\t\t\tchild.x + ITEM_WIDTH, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the layout group was not calculated correctly.\",\n\t\t\t\tchild.y + ITEM_HEIGHT, this._group.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the layout group was not calculated correctly.\",\n\t\t\t\tchild.x + ITEM_WIDTH, this._group.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the layout group was not calculated correctly.\",\n\t\t\t\tchild.y + ITEM_HEIGHT, this._group.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithChildPositionedWithBoundsFullyInNegative():void\n\t\t{\n\t\t\tvar child:Quad = new Quad(ITEM_WIDTH, ITEM_HEIGHT);\n\t\t\tchild.x = -420;\n\t\t\tchild.y = -430;\n\t\t\tthis._group.addChild(child);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the layout group was not calculated correctly.\",\n\t\t\t\t0, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the layout group was not calculated correctly.\",\n\t\t\t\t0, this._group.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the layout group was not calculated correctly.\",\n\t\t\t\t0, this._group.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the layout group was not calculated correctly.\",\n\t\t\t\t0, this._group.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithChildPositionedWithBoundsInBothPositiveAndNegative():void\n\t\t{\n\t\t\tvar child:Quad = new Quad(ITEM_WIDTH, ITEM_HEIGHT);\n\t\t\tchild.x = -Math.round(ITEM_WIDTH / 4);\n\t\t\tchild.y = -Math.round(ITEM_HEIGHT / 3);\n\t\t\tthis._group.addChild(child);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the layout group was not calculated correctly.\",\n\t\t\t\tchild.x + ITEM_WIDTH, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the layout group was not calculated correctly.\",\n\t\t\t\tchild.y + ITEM_HEIGHT, this._group.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the layout group was not calculated correctly.\",\n\t\t\t\tchild.x + ITEM_WIDTH, this._group.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the layout group was not calculated correctly.\",\n\t\t\t\tchild.y + ITEM_HEIGHT, this._group.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithMultipleChildren():void\n\t\t{\n\t\t\tvar child1:Quad = new Quad(ITEM_WIDTH, ITEM_HEIGHT);\n\t\t\tchild1.x = 0;\n\t\t\tchild1.y = 130;\n\t\t\tthis._group.addChild(child1);\n\t\t\tvar child2:Quad = new Quad(ITEM_WIDTH2, ITEM_HEIGHT2);\n\t\t\tchild2.x = 120;\n\t\t\tchild2.y = 0;\n\t\t\tthis._group.addChild(child2);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the layout group was not calculated correctly.\",\n\t\t\t\tchild2.x + ITEM_WIDTH2, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the layout group was not calculated correctly.\",\n\t\t\t\tchild1.y + ITEM_HEIGHT, this._group.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the layout group was not calculated correctly.\",\n\t\t\t\tchild2.x + ITEM_WIDTH2, this._group.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the layout group was not calculated correctly.\",\n\t\t\t\tchild1.y + ITEM_HEIGHT, this._group.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeChildAndSimpleBackground():void\n\t\t{\n\t\t\tthis._group.addChild(new Quad(ITEM_WIDTH, ITEM_HEIGHT));\n\t\t\tthis.addSimpleBackground();\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the layout group was not calculated correctly.\",\n\t\t\t\tITEM_WIDTH, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the layout group was not calculated correctly.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._group.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the layout group was not calculated correctly.\",\n\t\t\t\tITEM_WIDTH, this._group.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the layout group was not calculated correctly.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._group.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeChildWithPivots():void\n\t\t{\n\t\t\tvar child:Quad = new Quad(ITEM_WIDTH, ITEM_HEIGHT);\n\t\t\tchild.pivotX = ITEM_PIVOTX;\n\t\t\tchild.pivotY = ITEM_PIVOTY;\n\t\t\tchild.x = 120;\n\t\t\tchild.y = 130;\n\t\t\tthis._group.addChild(child);\n\t\t\tthis._group.validate();\n\t\t\tvar groupWidth:Number = child.x - ITEM_PIVOTX + ITEM_WIDTH;\n\t\t\tvar groupHeight:Number = child.y - ITEM_PIVOTY + ITEM_HEIGHT;\n\t\t\tAssert.assertStrictlyEquals(\"The width of the layout group was not calculated correctly.\",\n\t\t\t\tgroupWidth, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the layout group was not calculated correctly.\",\n\t\t\t\tgroupHeight, this._group.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the layout group was not calculated correctly.\",\n\t\t\t\tgroupWidth, this._group.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the layout group was not calculated correctly.\",\n\t\t\t\tgroupHeight, this._group.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveChildToResizeSkin():void\n\t\t{\n\t\t\tvar child:Quad = new Quad(ITEM_WIDTH, ITEM_HEIGHT);\n\t\t\tthis._group.addChild(child);\n\t\t\tthis._group.backgroundSkin = new Quad(10, 10, 0xff00ff);\n\t\t\tthis._group.backgroundDisabledSkin = new Quad(10, 10, 0xff00ff);\n\t\t\tthis._group.validate();\n\t\t\t//the child's dimensions were large enough to make group bigger\n\t\t\t//than the skin's dimensions\n\t\t\tthis._group.removeChild(child);\n\t\t\t//switch to a different skin before validation\n\t\t\tthis._group.isEnabled = false;\n\t\t\tthis._group.validate();\n\t\t\t//now switch back to the original skin, and the dimensions could\n\t\t\t//be wrong if they weren't restored\n\t\t\tthis._group.isEnabled = true;\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the LayoutGroup was not calculated correctly after changing to a different skin and removing larger child.\",\n\t\t\t\t10, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the LayoutGroup was not calculated correctly after changing to a different skin and removing larger child.\",\n\t\t\t\t10, this._group.height);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/LayoutGroupTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.AutoSizeMode;\n\timport feathers.controls.Button;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.tests.supportClasses.AssertViewPortBoundsLayout;\n\timport feathers.tests.supportClasses.DisposeFlagQuad;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\n\tpublic class LayoutGroupTests\n\t{\n\t\t//note: the background width is purposefully smaller than the item width\n\t\tprivate static const BACKGROUND_WIDTH:Number = 200;\n\t\t//note: the background height is purposefully larger than the item height\n\t\tprivate static const BACKGROUND_HEIGHT:Number = 250;\n\t\t\n\t\tprivate static const LARGE_BACKGROUND_WIDTH:Number = 400;\n\t\tprivate static const LARGE_BACKGROUND_HEIGHT:Number = 400;\n\n\t\t//note: the item width is purposefully larger than the background width\n\t\tprivate static const ITEM_WIDTH:Number = 210;\n\t\t//note: the item height is purposefully smaller than the background height\n\t\tprivate static const ITEM_HEIGHT:Number = 160;\n\n\t\tprivate var _group:LayoutGroup;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._group = new LayoutGroup();\n\t\t\tTestFeathers.starlingRoot.addChild(this._group);\n\t\t\tthis._group.validate();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._group.removeFromParent(true);\n\t\t\tthis._group = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testResizeBackgroundWithSmallerMaxDimensions():void\n\t\t{\n\t\t\tthis._group.maxWidth = BACKGROUND_WIDTH / 3;\n\t\t\tthis._group.maxHeight = BACKGROUND_HEIGHT / 3;\n\t\t\tvar backgroundSkin:Quad = new Quad(BACKGROUND_WIDTH, BACKGROUND_HEIGHT);\n\t\t\tthis._group.backgroundSkin = backgroundSkin;\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The LayoutGroup with smaller maxWidth did not set the width of the background skin.\",\n\t\t\t\tthis._group.maxWidth, backgroundSkin.width);\n\t\t\tAssert.assertStrictlyEquals(\"The LayoutGroup with smaller maxHeight did not set the height of the background skin.\",\n\t\t\t\tthis._group.maxHeight, backgroundSkin.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testResizeBackgroundWithLargerMinDimensions():void\n\t\t{\n\t\t\tthis._group.minWidth = 3 * BACKGROUND_WIDTH;\n\t\t\tthis._group.minHeight = 3 * BACKGROUND_HEIGHT;\n\t\t\tvar backgroundSkin:Quad = new Quad(BACKGROUND_WIDTH, BACKGROUND_HEIGHT);\n\t\t\tthis._group.backgroundSkin = backgroundSkin;\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The LayoutGroup with larger minWidth did not set the width of the background skin.\",\n\t\t\t\tthis._group.minWidth, backgroundSkin.width);\n\t\t\tAssert.assertStrictlyEquals(\"The LayoutGroup with larger minHeight did not set the height of the background skin.\",\n\t\t\t\tthis._group.minHeight, backgroundSkin.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoErrorValidatingWithoutStage():void\n\t\t{\n\t\t\tvar group:LayoutGroup = new LayoutGroup();\n\t\t\tgroup.validate();\n\t\t\tgroup.dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDefaultAutoSizeMode():void\n\t\t{\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The default value of LayoutGroup autoSizeMode must be AutoSizeMode.CONTENT, if not root.\", AutoSizeMode.CONTENT, this._group.autoSizeMode);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChildPositionWithLargerBackground():void\n\t\t{\n\t\t\tvar child:Quad = new Quad(ITEM_WIDTH, ITEM_HEIGHT);\n\t\t\tthis._group.addChild(child);\n\t\t\tthis._group.backgroundSkin = new Quad(LARGE_BACKGROUND_WIDTH, LARGE_BACKGROUND_HEIGHT);\n\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\tlayout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tlayout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\tthis._group.layout = layout;\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertTrue(\"The layout group does not account for the background skin width when passing bounds to the layout.\",\n\t\t\t\tchild.x > 0);\n\t\t\tAssert.assertTrue(\"The layout group does not account for the background skin width when passing bounds to the layout.\",\n\t\t\t\tchild.y > 0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testResizeWhenAddingChild():void\n\t\t{\n\t\t\tvar originalWidth:Number = this._group.width;\n\t\t\tvar originalHeight:Number = this._group.height;\n\t\t\tvar hasResized:Boolean = false;\n\t\t\tthis._group.addEventListener(Event.RESIZE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasResized = true;\n\t\t\t});\n\t\t\tthis._group.addChild(new Quad(ITEM_WIDTH, ITEM_HEIGHT));\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertTrue(\"Event.RESIZE was not dispatched\", hasResized);\n\t\t\tAssert.assertFalse(\"The width of the layout group was not changed.\",\n\t\t\t\toriginalWidth === this._group.width);\n\t\t\tAssert.assertFalse(\"The height of the layout group was not changed.\",\n\t\t\t\toriginalHeight === this._group.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testResizeWhenRemovingChild():void\n\t\t{\n\t\t\tvar child:Quad = new Quad(ITEM_WIDTH, ITEM_HEIGHT);\n\t\t\tthis._group.addChild(child);\n\t\t\tthis._group.validate();\n\t\t\tvar originalWidth:Number = this._group.width;\n\t\t\tvar originalHeight:Number = this._group.height;\n\n\t\t\tvar hasResized:Boolean = false;\n\t\t\tthis._group.addEventListener(Event.RESIZE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasResized = true;\n\t\t\t});\n\t\t\tthis._group.removeChild(child);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertTrue(\"Event.RESIZE was not dispatched\", hasResized);\n\t\t\tAssert.assertFalse(\"The width of the layout group was not changed.\",\n\t\t\t\toriginalWidth === this._group.width);\n\t\t\tAssert.assertFalse(\"The height of the layout group was not changed.\",\n\t\t\t\toriginalHeight === this._group.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testResizeWhenResizingFeathersControlChild():void\n\t\t{\n\t\t\tvar child:Button = new Button();\n\t\t\tchild.defaultSkin = new Quad(ITEM_WIDTH, ITEM_HEIGHT);\n\t\t\tthis._group.addChild(child);\n\t\t\tthis._group.validate();\n\n\t\t\tvar originalWidth:Number = this._group.width;\n\t\t\tvar originalHeight:Number = this._group.height;\n\t\t\tvar hasResized:Boolean = false;\n\t\t\tthis._group.addEventListener(Event.RESIZE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasResized = true;\n\t\t\t});\n\t\t\tchild.width = ITEM_WIDTH * 2;\n\t\t\tchild.height = ITEM_HEIGHT * 2;\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertTrue(\"Event.RESIZE was not dispatched\", hasResized);\n\t\t\tAssert.assertFalse(\"The width of the layout group was not changed.\",\n\t\t\t\toriginalWidth === this._group.width);\n\t\t\tAssert.assertFalse(\"The height of the layout group was not changed.\",\n\t\t\t\toriginalHeight === this._group.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSkinsDisposed():void\n\t\t{\n\t\t\tvar backgroundSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._group.backgroundSkin = backgroundSkin;\n\t\t\tvar backgroundDisabledSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._group.backgroundDisabledSkin = backgroundDisabledSkin;\n\t\t\tthis._group.validate();\n\t\t\tthis._group.dispose();\n\t\t\tAssert.assertTrue(\"backgroundSkin not disposed when LayoutGroup disposed.\", backgroundSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"backgroundDisabledSkin not disposed when LayoutGroup disposed.\", backgroundDisabledSkin.isDisposed);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testViewPortBoundsValues():void\n\t\t{\n\t\t\tthis._group.layout = new AssertViewPortBoundsLayout();\n\t\t\tthis._group.validate();\n\t\t}\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/LayoutGroupValidationTests.as",
    "content": "package feathers.tests\n{\n\timport org.flexunit.Assert;\n\n\tpublic class LayoutGroupValidationTests\n\t{\n\t\tprivate var _group:CustomGroup;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._group = new CustomGroup();\n\t\t\tTestFeathers.starlingRoot.addChild(this._group);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._group.removeFromParent(true);\n\t\t\tthis._group = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testResizeChildBeforeLayout():void\n\t\t{\n\t\t\tthis._group.updateChildBeforeLayout = true;\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertFalse(\"LayoutGroup: must not be invalid if child resizes before layout is applied.\",\n\t\t\t\tthis._group.isInvalid());\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testResizeChildAfterLayout():void\n\t\t{\n\t\t\tthis._group.updateChildBeforeLayout = false;\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertTrue(\"LayoutGroup: must be invalid if child resizes after layout is applied.\",\n\t\t\t\tthis._group.isInvalid());\n\t\t}\n\t}\n}\n\nimport feathers.controls.LayoutGroup;\nimport feathers.controls.Button;\n\nclass CustomGroup extends LayoutGroup\n{\n\tprivate var _child:Button;\n\n\tpublic var updateChildBeforeLayout:Boolean = true;\n\n\toverride protected function initialize():void\n\t{\n\t\tsuper.initialize();\n\n\t\tthis._child = new Button();\n\t\tthis._child.label = \"Click Me\";\n\t\tthis.addChild(this._child);\n\t}\n\n\toverride protected function draw():void\n\t{\n\t\tif(this.updateChildBeforeLayout)\n\t\t{\n\t\t\tthis.updateChild();\n\t\t}\n\t\tsuper.draw();\n\t\tif(!this.updateChildBeforeLayout)\n\t\t{\n\t\t\tthis.updateChild();\n\t\t}\n\t}\n\n\tprivate function updateChild():void\n\t{\n\t\tthis._child.width = Math.random() * 100;\n\t\tthis._child.width = 150;\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/LayoutGroupVerticalLayoutTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.LayoutGroup;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.layout.ViewPortBounds;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\n\tpublic class LayoutGroupVerticalLayoutTests\n\t{\n\t\tprivate static const PADDING_TOP:Number = 6;\n\t\tprivate static const PADDING_RIGHT:Number = 8;\n\t\tprivate static const PADDING_BOTTOM:Number = 2;\n\t\tprivate static const PADDING_LEFT:Number = 10;\n\t\tprivate static const GAP:Number = 5;\n\t\tprivate static const FIRST_GAP:Number = 7;\n\t\tprivate static const LAST_GAP:Number = 6;\n\t\tprivate static const CHILD1_WIDTH:Number = 200;\n\t\tprivate static const CHILD1_HEIGHT:Number = 100;\n\t\tprivate static const CHILD2_WIDTH:Number = 150;\n\t\tprivate static const CHILD2_HEIGHT:Number = 75;\n\t\tprivate static const CHILD3_WIDTH:Number = 75;\n\t\tprivate static const CHILD3_HEIGHT:Number = 50;\n\t\tprivate static const CHILD4_WIDTH:Number = 10;\n\t\tprivate static const CHILD4_HEIGHT:Number = 20;\n\t\t\n\t\tprivate var _group:LayoutGroup;\n\t\tprivate var _layout:VerticalLayout;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._group = new LayoutGroup();\n\t\t\tthis._layout = new VerticalLayout();\n\t\t\tthis._group.layout = this._layout;\n\t\t\tTestFeathers.starlingRoot.addChild(this._group);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._group.removeFromParent(true);\n\t\t\tthis._group = null;\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDimensionsWithNoChildren():void\n\t\t{\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout width not equal to 0 with no children.\", 0, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout height not equal to 0 with no children.\", 0, this._group.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDimensionsWithPaddingGapAndNoChildren():void\n\t\t{\n\t\t\tthis._layout.paddingTop = PADDING_TOP;\n\t\t\tthis._layout.paddingRight = PADDING_RIGHT;\n\t\t\tthis._layout.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._layout.paddingLeft = PADDING_LEFT;\n\t\t\tthis._layout.gap = GAP;\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout width not equal to sum of left and right padding with no children.\", PADDING_LEFT + PADDING_RIGHT, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout height not equal to sum of top and bottom padding with no children.\", PADDING_TOP + PADDING_BOTTOM, this._group.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDimensionsWithOneChild():void\n\t\t{\n\t\t\tthis._group.addChild(new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff));\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout width not equal to child width.\", CHILD1_WIDTH, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout height not equal to child height.\", CHILD1_HEIGHT, this._group.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDimensionsWithPaddingGapAndOneChild():void\n\t\t{\n\t\t\tthis._layout.paddingTop = PADDING_TOP;\n\t\t\tthis._layout.paddingRight = PADDING_RIGHT;\n\t\t\tthis._layout.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._layout.paddingLeft = PADDING_LEFT;\n\t\t\tthis._layout.gap = GAP;\n\t\t\tthis._group.addChild(new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff));\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout width not equal to sum of left and right padding and width of child.\", CHILD1_WIDTH + PADDING_LEFT + PADDING_RIGHT, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout height not equal to sum of top and bottom padding and height of child.\", CHILD1_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._group.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDimensionsWithTwoChildren():void\n\t\t{\n\t\t\tthis._group.addChild(new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff));\n\t\t\tthis._group.addChild(new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff));\n\t\t\tthis._group.validate();\n\t\t\tvar maxChildWidth:Number = Math.max(CHILD1_WIDTH, CHILD2_WIDTH);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout width not equal to max width of children.\", maxChildWidth, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout height not equal to sum of child heights.\", CHILD1_HEIGHT + CHILD2_HEIGHT, this._group.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDimensionsWithPaddingGapAndTwoChildren():void\n\t\t{\n\t\t\tthis._layout.paddingTop = PADDING_TOP;\n\t\t\tthis._layout.paddingRight = PADDING_RIGHT;\n\t\t\tthis._layout.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._layout.paddingLeft = PADDING_LEFT;\n\t\t\tthis._layout.gap = GAP;\n\t\t\tthis._group.addChild(new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff));\n\t\t\tthis._group.addChild(new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff));\n\t\t\tthis._group.validate();\n\t\t\tvar maxChildWidth:Number = Math.max(CHILD1_WIDTH, CHILD2_WIDTH);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout width not equal to sum of left and right padding and max width of children.\", maxChildWidth + PADDING_LEFT + PADDING_RIGHT, this._group.width);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout height not equal to sum of top and bottom padding, gap, and sum of child heights.\", CHILD1_HEIGHT + CHILD2_HEIGHT + GAP + PADDING_TOP + PADDING_BOTTOM, this._group.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testWidthWithMaxWidthLargerThanChild():void\n\t\t{\n\t\t\tthis._group.maxWidth = CHILD1_WIDTH + 100;\n\t\t\tthis._group.addChild(new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff));\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout width not equal to child width when maxWidth is larger than child width.\", CHILD1_WIDTH, this._group.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testWidthWithMaxWidthSmallerThanChild():void\n\t\t{\n\t\t\tthis._group.maxWidth = CHILD1_WIDTH / 2;\n\t\t\tthis._group.addChild(new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff));\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout width not equal to maxWidth when maxWidth is smaller than child width.\", this._group.maxWidth, this._group.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHeightWithGapAndTwoChildren():void\n\t\t{\n\t\t\tthis._layout.gap = GAP;\n\t\t\tthis._group.addChild(new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff));\n\t\t\tthis._group.addChild(new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff));\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout height not equal to gap plus sum of child heights.\", CHILD1_HEIGHT + CHILD2_HEIGHT + GAP, this._group.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHeightWithMaxHeightLargerThanChild():void\n\t\t{\n\t\t\tthis._group.maxHeight = CHILD1_HEIGHT + 100;\n\t\t\tthis._group.addChild(new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff));\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout height not equal to child height when maxHeight is larger than child width.\", CHILD1_HEIGHT, this._group.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHeightWithMaxHeightSmallerThanChild():void\n\t\t{\n\t\t\tthis._group.maxHeight = CHILD1_HEIGHT / 2;\n\t\t\tthis._group.addChild(new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff));\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout height not equal to maxHeight when maxHeight is smaller than child height.\", this._group.maxHeight, this._group.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHeightWithFirstGapAndTwoChildren():void\n\t\t{\n\t\t\tthis._layout.gap = GAP;\n\t\t\tthis._layout.firstGap = FIRST_GAP;\n\t\t\tthis._group.addChild(new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff));\n\t\t\tthis._group.addChild(new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff));\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout height not equal to first gap plus sum of child heights.\", CHILD1_HEIGHT + CHILD2_HEIGHT + FIRST_GAP, this._group.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHeightWithLastGapAndTwoChildren():void\n\t\t{\n\t\t\tthis._layout.gap = GAP;\n\t\t\tthis._layout.lastGap = LAST_GAP;\n\t\t\tthis._group.addChild(new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff));\n\t\t\tthis._group.addChild(new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff));\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout height not equal to gap plus sum of child heights when using last gap with two children.\", CHILD1_HEIGHT + CHILD2_HEIGHT + GAP, this._group.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHeightWithFirstGapAndThreeChildren():void\n\t\t{\n\t\t\tthis._layout.gap = GAP;\n\t\t\tthis._layout.firstGap = FIRST_GAP;\n\t\t\tthis._group.addChild(new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff));\n\t\t\tthis._group.addChild(new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff));\n\t\t\tthis._group.addChild(new Quad(CHILD3_WIDTH, CHILD3_HEIGHT, 0xff00ff));\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout height not equal to sum of child heights, plus first gap, plus gap, with three children.\", CHILD1_HEIGHT + CHILD2_HEIGHT + CHILD3_HEIGHT + GAP + FIRST_GAP, this._group.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHeightWithLastGapAndThreeChildren():void\n\t\t{\n\t\t\tthis._layout.gap = GAP;\n\t\t\tthis._layout.lastGap = LAST_GAP;\n\t\t\tthis._group.addChild(new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff));\n\t\t\tthis._group.addChild(new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff));\n\t\t\tthis._group.addChild(new Quad(CHILD3_WIDTH, CHILD3_HEIGHT, 0xff00ff));\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout height not equal to sum of child heights, plus gap, plus last gap, with three children.\", CHILD1_HEIGHT + CHILD2_HEIGHT + CHILD3_HEIGHT + GAP + LAST_GAP, this._group.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHeightWithFirstAndLastGapAndFourChildren():void\n\t\t{\n\t\t\tthis._layout.gap = GAP;\n\t\t\tthis._layout.firstGap = FIRST_GAP;\n\t\t\tthis._layout.lastGap = LAST_GAP;\n\t\t\tthis._group.addChild(new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff));\n\t\t\tthis._group.addChild(new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff));\n\t\t\tthis._group.addChild(new Quad(CHILD3_WIDTH, CHILD3_HEIGHT, 0xff00ff));\n\t\t\tthis._group.addChild(new Quad(CHILD4_WIDTH, CHILD4_HEIGHT, 0xff00ff));\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout height not equal to sum of child heights, plus first gap, plus gap, plus last gap, with four children.\", CHILD1_HEIGHT + CHILD2_HEIGHT + CHILD3_HEIGHT + CHILD4_HEIGHT + FIRST_GAP + GAP + LAST_GAP, this._group.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChildXWithHorizontalAlignCenterAndMaxWidthSmallerThanChild():void\n\t\t{\n\t\t\tthis._layout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tvar child:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._group.maxWidth = child.width / 2;\n\t\t\tthis._group.addChild(child);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Child x position incorrectly set to value less than zero with HorizontalAlign.CENTER\", 0, child.x);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChildYWithVerticalAlignMiddleAndMaxHeightSmallerThanChild():void\n\t\t{\n\t\t\tthis._layout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\tvar child:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._group.maxHeight = child.height / 2;\n\t\t\tthis._group.addChild(child);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Child y position incorrectly set to value less than zero with VerticalAlign.MIDDLE\", 0, child.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChildXIsIntegerWithHorizontalAlignCenter():void\n\t\t{\n\t\t\tthis._layout.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tvar child:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._group.width = child.width + 111;\n\t\t\tthis._group.addChild(child);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Child x position incorrectly set to non-integer with HorizontalAlign.CENTER\", Math.round(child.x), child.x);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChildYIsIntegerWithVerticalAlignMiddle():void\n\t\t{\n\t\t\tthis._layout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\tvar child:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._group.height = child.height + 111;\n\t\t\tthis._group.addChild(child);\n\t\t\tthis._group.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Child y position incorrectly set to non-integer with VerticalAlign.MIDDLE\", Math.round(child.y), child.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoErrorNoChildrenStickyHeader():void\n\t\t{\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[];\n\t\t\tthis._layout.headerIndices = new <int>[];\n\t\t\tthis._layout.stickyHeader = true;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tthis._layout.layout(items, bounds);\n\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.measureViewPort(0, bounds);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ListCollectionFilterTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.data.ListCollection;\n\timport feathers.events.CollectionEventType;\n\n\timport org.flexunit.Assert;\n\n\timport starling.events.Event;\n\n\tpublic class ListCollectionFilterTests\n\t{\n\t\tprivate var _collection:ListCollection;\n\n\t\tprivate var _includedItem:Object;\n\t\tprivate var _excludedItem:Object;\n\t\tprivate var _addedIncludedItem:Object;\n\t\tprivate var _addedExcludedItem:Object;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._includedItem = { label: \"Included\" };\n\t\t\tthis._excludedItem = { label: \"Excluded\" };\n\t\t\tthis._addedIncludedItem = { label: \"Added and Included\" };\n\t\t\tthis._addedExcludedItem = { label: \"Added and Excluded\" };\n\t\t\tthis._collection = new ListCollection(\n\t\t\t[\n\t\t\t\tthis._includedItem,\n\t\t\t\tthis._excludedItem,\n\t\t\t]);\n\t\t\tthis._collection.filterFunction = this.filterFunction;\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._collection = null;\n\t\t}\n\n\t\tprivate function filterFunction(item:Object):Boolean\n\t\t{\n\t\t\tif(this._addedExcludedItem !== null && item === this._addedExcludedItem)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(this._addedIncludedItem !== null && item === this._addedIncludedItem)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif(this._excludedItem !== null && item === this._excludedItem)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(this._includedItem !== null && item === this._includedItem)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tthrow new Error(\"This should not happen\");\n\t\t}\n\n\t//-- length\n\n\t\t[Test]\n\t\tpublic function testLengthWithFilterFunction():void\n\t\t{\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection filterFunction must update length if items are excluded.\",\n\t\t\t\t1, this._collection.length);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLengthWithFilterFunctionAndSetFilterFunctionToNull():void\n\t\t{\n\t\t\t//ensure that the filter is processed once before setting to null\n\t\t\tthis._collection.getItemAt(0);\n\t\t\tthis._collection.filterFunction = null;\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection must update length if filterFunction is set to null.\",\n\t\t\t\t2, this._collection.length);\n\t\t}\n\n\t//-- contains()\n\n\t\t[Test]\n\t\tpublic function testContainsWithFilterFunction():void\n\t\t{\n\t\t\tAssert.assertTrue(\"ListCollection contains() must return true if filterFunction is set to function, and item is included.\",\n\t\t\t\tthis._collection.contains(this._includedItem));\n\t\t\tAssert.assertFalse(\"ListCollection contains() must return false if filterFunction is set to function, and item is excluded.\",\n\t\t\t\tthis._collection.contains(this._excludedItem));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testContainsWithFilterFunctionAndSetFilterFunctionToNull():void\n\t\t{\n\t\t\tthis._collection.filterFunction = null;\n\t\t\tAssert.assertTrue(\"ListCollection contains() must return true for included item if filterFunction is set to null.\",\n\t\t\t\tthis._collection.contains(this._includedItem));\n\t\t\tAssert.assertTrue(\"ListCollection contains() must return true for excluded item if filterFunction is set to null.\",\n\t\t\t\tthis._collection.contains(this._excludedItem));\n\t\t}\n\n\t//-- addItem\n\n\t\t[Test]\n\t\tpublic function testAddItemWithFilterFunctionIncludedItem():void\n\t\t{\n\t\t\tvar addItemDispatched:Boolean = false;\n\t\t\tvar addItemIndex:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\taddItemDispatched = true;\n\t\t\t\taddItemIndex = index;\n\t\t\t});\n\t\t\tthis._collection.addItem(this._addedIncludedItem);\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection filterFunction must increase length if item passed to addItem() is included.\",\n\t\t\t\t2, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection getItemAt() returns incorrect item with filterFunction after item passed to addItem() is included.\",\n\t\t\t\tthis._collection.getItemAt(1), this._addedIncludedItem);\n\t\t\tAssert.assertTrue(\"ListCollection contains() must return true with filterFunction if item passed to addItem() is included.\",\n\t\t\t\tthis._collection.contains(this._addedIncludedItem));\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection getItemIndex() must return correct index with filterFunction if item passed to addItem() is included.\",\n\t\t\t\t1, this._collection.getItemIndex(this._addedIncludedItem));\n\t\t\tAssert.assertTrue(\"ListCollection must dispatch CollectionEventType.ADD_ITEM with filterFunction if item passed to addItem() is included.\",\n\t\t\t\taddItemDispatched);\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection must include correct index with CollectionEventType.ADD_ITEM with filterFunction if item passed to addItem() is included.\",\n\t\t\t\t1, addItemIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemWithFilterFunctionExcludedItem():void\n\t\t{\n\t\t\tvar addItemDispatched:Boolean = false;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event):void\n\t\t\t{\n\t\t\t\taddItemDispatched = true;\n\t\t\t});\n\t\t\tthis._collection.addItem(this._addedExcludedItem);\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection filterFunction must not change length if item passed to addItem() is excluded.\",\n\t\t\t\t1, this._collection.length);\n\t\t\tAssert.assertFalse(\"ListCollection contains() must return false with filterFunction if item passed to addItem() is excluded.\",\n\t\t\t\tthis._collection.contains(this._addedExcludedItem));\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection getItemIndex() must return -1 with filterFunction if item passed to addItem() is excluded.\",\n\t\t\t\t-1, this._collection.getItemIndex(this._addedExcludedItem));\n\t\t\tAssert.assertFalse(\"ListCollection must not dispatch CollectionEventType.ADD_ITEM with filterFunction if item passed to addItem() is excluded.\",\n\t\t\t\taddItemDispatched);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemWithFilterFunctionExcludedItemAndSetFilterFunctionToNull():void\n\t\t{\n\t\t\tthis._collection.addItem(this._addedExcludedItem);\n\t\t\tthis._collection.filterFunction = null;\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection filterFunction must restore length after filterFunction is set to null.\",\n\t\t\t\t3, this._collection.length);\n\t\t\tAssert.assertTrue(\"ListCollection contains() must return true for excluded item after filterFunction is set to null.\",\n\t\t\t\tthis._collection.contains(this._addedExcludedItem));\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection getItemIndex() must return correct index for excluded item after filterFunction is set to null.\",\n\t\t\t\t2, this._collection.getItemIndex(this._addedExcludedItem));\n\t\t}\n\n\t//-- addItemAt\n\n\t\t[Test]\n\t\tpublic function testAddItemAtWithFilterFunctionIncludedItem():void\n\t\t{\n\t\t\tvar addItemDispatched:Boolean = false;\n\t\t\tvar addItemIndex:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\taddItemDispatched = true;\n\t\t\t\taddItemIndex = index;\n\t\t\t});\n\t\t\tthis._collection.addItemAt(this._addedIncludedItem, 0);\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection filterFunction must increase length if item passed to addItem() is included.\",\n\t\t\t\t2, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection getItemAt() returns incorrect item with filterFunction after item passed to addItem() is included.\",\n\t\t\t\tthis._collection.getItemAt(0), this._addedIncludedItem);\n\t\t\tAssert.assertTrue(\"ListCollection contains() must return true with filterFunction if item passed to addItem() is included.\",\n\t\t\t\tthis._collection.contains(this._addedIncludedItem));\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection getItemIndex() must return correct index with filterFunction if item passed to addItem() is included.\",\n\t\t\t\t0, this._collection.getItemIndex(this._addedIncludedItem));\n\t\t\tAssert.assertTrue(\"ListCollection must dispatch CollectionEventType.ADD_ITEM with filterFunction if item passed to addItem() is included.\",\n\t\t\t\taddItemDispatched);\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection must include correct index with CollectionEventType.ADD_ITEM with filterFunction if item passed to addItem() is included.\",\n\t\t\t\t0, addItemIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemAtWithFilterFunctionExcludedItem():void\n\t\t{\n\t\t\tvar addItemDispatched:Boolean = false;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event):void\n\t\t\t{\n\t\t\t\taddItemDispatched = true;\n\t\t\t});\n\t\t\tthis._collection.addItemAt(this._addedExcludedItem, 0);\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection filterFunction must not change length if item passed to addItem() is excluded.\",\n\t\t\t\t1, this._collection.length);\n\t\t\tAssert.assertFalse(\"ListCollection contains() must return false with filterFunction if item passed to addItem() is excluded.\",\n\t\t\t\tthis._collection.contains(this._addedExcludedItem));\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection getItemIndex() must return -1 with filterFunction if item passed to addItem() is excluded.\",\n\t\t\t\t-1, this._collection.getItemIndex(this._addedExcludedItem));\n\t\t\tAssert.assertFalse(\"ListCollection must not dispatch CollectionEventType.ADD_ITEM with filterFunction if item passed to addItem() is excluded.\",\n\t\t\t\taddItemDispatched);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemAtWithFilterFunctionExcludedItemAndSetFilterFunctionToNull():void\n\t\t{\n\t\t\tthis._collection.addItemAt(this._addedExcludedItem, 0);\n\t\t\tthis._collection.filterFunction = null;\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection filterFunction must restore length after filterFunction is set to null.\",\n\t\t\t\t3, this._collection.length);\n\t\t\tAssert.assertTrue(\"ListCollection contains() must return true for excluded item after filterFunction is set to null.\",\n\t\t\t\tthis._collection.contains(this._addedExcludedItem));\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection getItemIndex() must return correct index for excluded item after filterFunction is set to null.\",\n\t\t\t\t0, this._collection.getItemIndex(this._addedExcludedItem));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemAtWithFilterFunctionExcludedItemThenAddItemAtWithIncludedItemAndSetFilterFunctionToNull():void\n\t\t{\n\t\t\t//the included item is added to index 0 after the excluded item, but\n\t\t\t//because the collection is filtered, the included item is relative\n\t\t\t//to another included item, which isn't at index 0 in the unfiltered\n\t\t\t//collection.\n\t\t\tthis._collection.addItemAt(this._addedExcludedItem, 0);\n\t\t\tthis._collection.addItemAt(this._addedIncludedItem, 0);\n\t\t\tthis._collection.filterFunction = null;\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection getItemIndex() must return correct index for excluded item after filterFunction is set to null.\",\n\t\t\t\t0, this._collection.getItemIndex(this._addedExcludedItem));\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection getItemIndex() must return correct index for included item after filterFunction is set to null.\",\n\t\t\t\t1, this._collection.getItemIndex(this._addedIncludedItem));\n\t\t}\n\n\t//-- removeItem\n\n\t\t[Test]\n\t\tpublic function testRemoveItemWithFilterFunctionIncludedItem():void\n\t\t{\n\t\t\tvar removeItemDispatched:Boolean = false;\n\t\t\tvar removeItemIndex:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\tremoveItemDispatched = true;\n\t\t\t\tremoveItemIndex = index;\n\t\t\t});\n\t\t\tthis._collection.removeItem(this._includedItem);\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection filterFunction must decrease length if item passed to removeItem() is included.\",\n\t\t\t\t0, this._collection.length);\n\t\t\tAssert.assertFalse(\"ListCollection contains() must return false with filterFunction if item passed to removeItem() is included.\",\n\t\t\t\tthis._collection.contains(this._addedIncludedItem));\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection getItemIndex() must return -1 with filterFunction if item passed to removeItem() is included.\",\n\t\t\t\t-1, this._collection.getItemIndex(this._addedIncludedItem));\n\t\t\tAssert.assertTrue(\"ListCollection must dispatch CollectionEventType.REMOVE_ITEM with filterFunction if item passed to removeItem() is included.\",\n\t\t\t\tremoveItemDispatched);\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection must include correct index with CollectionEventType.REMOVE_ITEM with filterFunction if item passed to removeItem() is included.\",\n\t\t\t\t0, removeItemIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemWithFilterFunctionExcludedItem():void\n\t\t{\n\t\t\tvar removeItemDispatched:Boolean = false;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\tremoveItemDispatched = true;\n\t\t\t});\n\t\t\tthis._collection.removeItem(this._excludedItem);\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection filterFunction must not change length if item passed to removeItem() is excluded.\",\n\t\t\t\t1, this._collection.length);\n\t\t\tAssert.assertFalse(\"ListCollection must not dispatch CollectionEventType.REMOVE_ITEM with filterFunction if item passed to removeItem() is excluded.\",\n\t\t\t\tremoveItemDispatched);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemWithFilterFunctionIncludedItemAndSetFilterFunctionToNull():void\n\t\t{\n\t\t\tthis._collection.removeItem(this._includedItem);\n\t\t\tthis._collection.filterFunction = null;\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection filterFunction must restore length after filterFunction is set to null.\",\n\t\t\t\t1, this._collection.length);\n\t\t\tAssert.assertFalse(\"ListCollection contains() must return false for included item after filterFunction is set to null.\",\n\t\t\t\tthis._collection.contains(this._includedItem));\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection getItemIndex() must return -1 for included item that was removed after filterFunction is set to null.\",\n\t\t\t\t-1, this._collection.getItemIndex(this._includedItem));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemWithFilterFunctionExcludedItemAndSetFilterFunctionToNull():void\n\t\t{\n\t\t\tthis._collection.removeItem(this._excludedItem);\n\t\t\tthis._collection.filterFunction = null;\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection filterFunction must restore length after filterFunction is set to null.\",\n\t\t\t\t2, this._collection.length);\n\t\t\tAssert.assertTrue(\"ListCollection contains() must return true for excluded item after filterFunction is set to null.\",\n\t\t\t\tthis._collection.contains(this._excludedItem));\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection getItemIndex() must return correct index for excluded item after filterFunction is set to null.\",\n\t\t\t\t1, this._collection.getItemIndex(this._excludedItem));\n\t\t}\n\n\t//-- setItemAt\n\n\t\t[Test]\n\t\tpublic function testSetItemAtWithFilterFunctionIncludedItem():void\n\t\t{\n\t\t\tvar replaceItemDispatched:Boolean = false;\n\t\t\tvar replaceItemIndex:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REPLACE_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\treplaceItemDispatched = true;\n\t\t\t\treplaceItemIndex = index;\n\t\t\t});\n\t\t\tthis._collection.setItemAt(this._addedIncludedItem, 0);\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection filterFunction must maintain length if item passed to setItemAt() is included.\",\n\t\t\t\t1, this._collection.length);\n\t\t\tAssert.assertTrue(\"ListCollection contains() must return true with filterFunction if item passed to setItemAt() is included.\",\n\t\t\t\tthis._collection.contains(this._addedIncludedItem));\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection getItemIndex() must return correct index with filterFunction if item passed to setItemAt() is included.\",\n\t\t\t\t0, this._collection.getItemIndex(this._addedIncludedItem));\n\t\t\tAssert.assertTrue(\"ListCollection must dispatch CollectionEventType.REPLACE_ITEM with filterFunction if item passed to setItemAt() is included.\",\n\t\t\t\treplaceItemDispatched);\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection must include correct index with CollectionEventType.REPLACE_ITEM with filterFunction if item passed to setItemAt() is included.\",\n\t\t\t\t0, replaceItemIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemAtWithFilterFunctionExcludedItem():void\n\t\t{\n\t\t\tvar replaceItemDispatched:Boolean = false;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REPLACE_ITEM, function(event:Event):void\n\t\t\t{\n\t\t\t\treplaceItemDispatched = true;\n\t\t\t});\n\t\t\tvar removeItemDispatched:Boolean = false;\n\t\t\tvar removeItemIndex:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\tremoveItemDispatched = true;\n\t\t\t\tremoveItemIndex = index;\n\t\t\t});\n\t\t\tthis._collection.setItemAt(this._addedExcludedItem, 0);\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection filterFunction must reduce length if item passed to setItemAt() is excluded and old item was included.\",\n\t\t\t\t0, this._collection.length);\n\t\t\tAssert.assertFalse(\"ListCollection contains() must return true with filterFunction if item passed to setItemAt() is excluded.\",\n\t\t\t\tthis._collection.contains(this._addedExcludedItem));\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection getItemIndex() must return -1 with filterFunction if item passed to setItemAt() is excluded.\",\n\t\t\t\t-1, this._collection.getItemIndex(this._addedExcludedItem));\n\t\t\tAssert.assertFalse(\"ListCollection must not dispatch CollectionEventType.REPLACE_ITEM with filterFunction if item passed to setItemAt() is excluded.\",\n\t\t\t\treplaceItemDispatched);\n\t\t\tAssert.assertTrue(\"ListCollection must dispatch CollectionEventType.REMOVE_ITEM with filterFunction if item passed to setItemAt() is excluded.\",\n\t\t\t\tremoveItemDispatched);\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection must include correct index with CollectionEventType.REMOVE_ITEM with filterFunction if item passed to setItemAt() is excluded.\",\n\t\t\t\t0, removeItemIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemAtWithFilterFunctionIncludedItemAndSetFilterFunctionToNull():void\n\t\t{\n\t\t\tthis._collection.setItemAt(this._addedIncludedItem, 0);\n\t\t\tthis._collection.filterFunction = null;\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection filterFunction must maintain length if item passed to setItemAt() is included.\",\n\t\t\t\t2, this._collection.length);\n\t\t\tAssert.assertTrue(\"ListCollection contains() must return true with filterFunction if item passed to setItemAt() is included.\",\n\t\t\t\tthis._collection.contains(this._addedIncludedItem));\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection getItemIndex() must return correct index with filterFunction if item passed to setItemAt() is included.\",\n\t\t\t\t0, this._collection.getItemIndex(this._addedIncludedItem));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemAtWithFilterFunctionExcludedItemAndSetFilterFunctionToNull():void\n\t\t{\n\t\t\tthis._collection.setItemAt(this._addedExcludedItem, 0);\n\t\t\tthis._collection.filterFunction = null;\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection filterFunction must maintain length if item passed to setItemAt() is excluded after filterFunction is set to null.\",\n\t\t\t\t2, this._collection.length);\n\t\t\tAssert.assertTrue(\"ListCollection contains() must return true with filterFunction if item passed to setItemAt() is excluded after filterFunction is set to null.\",\n\t\t\t\tthis._collection.contains(this._addedExcludedItem));\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection getItemIndex() must return correct index with filterFunction if item passed to setItemAt() is excluded after filterFunction is set to null.\",\n\t\t\t\t0, this._collection.getItemIndex(this._addedExcludedItem));\n\t\t}\n\n\t//-- refresh()\n\n\t\t[Test]\n\t\tpublic function testRefresh():void\n\t\t{\n\t\t\tvar searchText:String = \"Included\";\n\t\t\tthis._collection.filterFunction = function(item:Object):Boolean\n\t\t\t{\n\t\t\t\treturn item.label.indexOf(searchText) >= 0;\n\t\t\t};\n\t\t\t//ensure that the filter is processed once before changing the text\n\t\t\tthis._collection.getItemAt(0);\n\t\t\t//change this variable, but the collection doesn't know about it yet\n\t\t\tsearchText = \"Excluded\";\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection incorrectly updated before calling refresh().\",\n\t\t\t\tthis._includedItem, this._collection.getItemAt(0));\n\t\t\tthis._collection.refresh();\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection failed to update after calling refresh().\",\n\t\t\t\tthis._excludedItem, this._collection.getItemAt(0));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRefreshFilterWithNoFilterFunction():void\n\t\t{\n\t\t\tthis._collection.filterFunction = null;\n\t\t\tthis._collection.refresh();\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection refresh() should not filter items if filterFunction is null.\",\n\t\t\t\t2, this._collection.length);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ListCollectionWithArrayTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.data.ListCollection;\n\timport feathers.events.CollectionEventType;\n\n\timport org.flexunit.Assert;\n\n\timport starling.events.Event;\n\n\tpublic class ListCollectionWithArrayTests\n\t{\n\t\tprivate var _collection:ListCollection;\n\t\tprivate var _a:Object;\n\t\tprivate var _b:Object;\n\t\tprivate var _c:Object;\n\t\tprivate var _d:Object;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._a = { label: \"One\", value: 0 };\n\t\t\tthis._b = { label: \"Two\", value: 2 };\n\t\t\tthis._c = { label: \"Three\", value: 3 };\n\t\t\tthis._d = { label: \"Four\", value: 1 };\n\t\t\tthis._collection = new ListCollection(\n\t\t\t[\n\t\t\t\tthis._a,\n\t\t\t\tthis._b,\n\t\t\t\tthis._c,\n\t\t\t\tthis._d,\n\t\t\t]);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._collection = null;\n\t\t}\n\n\t\tprivate function filterFunction(item:Object):Boolean\n\t\t{\n\t\t\tif(item === this._a || item === this._c)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tprivate function sortCompareFunction(a:Object, b:Object):int\n\t\t{\n\t\t\tvar valueA:Number = a.value as Number;\n\t\t\tvar valueB:Number = b.value as Number;\n\t\t\tif(valueA < valueB)\n\t\t\t{\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif(valueA > valueB)\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveAll():void\n\t\t{\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedAll:Boolean = false;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ALL, function(event:Event):void\n\t\t\t{\n\t\t\t\thasRemovedAll = true;\n\t\t\t});\n\t\t\tvar hasReset:Boolean = false;\n\t\t\tthis._collection.addEventListener(CollectionEventType.RESET, function(event:Event):void\n\t\t\t{\n\t\t\t\thasReset = true;\n\t\t\t});\n\t\t\tthis._collection.removeAll();\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\t//reset used to be dispatched, but REMOVE_ALL is better\n\t\t\tAssert.assertFalse(\"CollectionEventType.RESET was incorrectly dispatched\", hasReset);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REMOVE_ALL was not dispatched\", hasRemovedAll);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed to 0\",\n\t\t\t\t0, this._collection.length);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemAt():void\n\t\t{\n\t\t\tvar itemToRemove:Object = this._collection.getItemAt(1);\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.removeItemAt(expectedIndex);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed\",\n\t\t\t\toriginalLength - 1, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not removed\",\n\t\t\t\t-1, this._collection.getItemIndex(itemToRemove));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.REMOVE_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItem():void\n\t\t{\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar itemToRemove:Object = this._collection.getItemAt(expectedIndex);\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.removeItem(itemToRemove);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed\",\n\t\t\t\toriginalLength - 1, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not removed\",\n\t\t\t\t-1, this._collection.getItemIndex(itemToRemove));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.REMOVE_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItem():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar expectedIndex:int = originalLength;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.addItem(itemToAdd);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed\",\n\t\t\t\toriginalLength + 1, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not added at the correct index\",\n\t\t\t\texpectedIndex, this._collection.getItemIndex(itemToAdd));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.ADD_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemAt():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.addItemAt(itemToAdd, expectedIndex);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed\",\n\t\t\t\toriginalLength + 1, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not added at the correct index\",\n\t\t\t\texpectedIndex, this._collection.getItemIndex(itemToAdd));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.ADD_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemAt():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REPLACE_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.setItemAt(itemToAdd, expectedIndex);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REPLACE_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was incorrectly changed\",\n\t\t\t\toriginalLength, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not added at the correct index\",\n\t\t\t\texpectedIndex, this._collection.getItemIndex(itemToAdd));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.REPLACE_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testContainsWithItemInCollection():void\n\t\t{\n\t\t\tvar item:Object = this._collection.getItemAt(1);\n\t\t\tAssert.assertStrictlyEquals(\"contains() incorrectly returned false\",\n\t\t\t\ttrue, this._collection.contains(item));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testContainsWithItemNotInCollection():void\n\t\t{\n\t\t\tvar item:Object = {};\n\t\t\tAssert.assertStrictlyEquals(\"contains() incorrectly returned true\",\n\t\t\t\tfalse, this._collection.contains(item));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemIndexWithItemInCollection():void\n\t\t{\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar item:Object = this._collection.getItemAt(expectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"getItemIndex() returned the incorrect value\",\n\t\t\t\texpectedIndex, this._collection.getItemIndex(item));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemIndexWithItemNotInCollection():void\n\t\t{\n\t\t\tvar item:Object = {};\n\t\t\tAssert.assertStrictlyEquals(\"getItemIndex() returned the incorrect value\",\n\t\t\t\t-1, this._collection.getItemIndex(item));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDispose():void\n\t\t{\n\t\t\tvar itemCount:int = this._collection.length;\n\t\t\tvar disposedCount:int = 0;\n\t\t\tthis._collection.dispose(function(item:Object):void\n\t\t\t{\n\t\t\t\titem.isDisposed = true;\n\t\t\t\tdisposedCount++;\n\t\t\t});\n\t\t\tAssert.assertStrictlyEquals(\"Incorrect number of items disposed when calling dispose() on ListCollection\",\n\t\t\t\titemCount, disposedCount);\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = this._collection.getItemAt(i);\n\t\t\t\tAssert.assertTrue(\"Item was not included when calling dispose() on ListCollection\", item.isDisposed);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDisposeWithFilterFunction():void\n\t\t{\n\t\t\tvar itemCount:int = this._collection.length;\n\t\t\tthis._collection.filterFunction = function(item:Object):Boolean\n\t\t\t{\n\t\t\t\treturn item.label.charAt(0) === \"O\";\n\t\t\t};\n\t\t\tvar filteredCount:int = this._collection.length;\n\t\t\tAssert.assertFalse(\"Filtered collection length must change\", itemCount === filteredCount);\n\t\t\tvar disposedCount:int = 0;\n\t\t\tthis._collection.dispose(function(item:Object):void\n\t\t\t{\n\t\t\t\titem.isDisposed = true;\n\t\t\t\tdisposedCount++;\n\t\t\t});\n\t\t\tAssert.assertStrictlyEquals(\"Incorrect number of items disposed when calling dispose() on ListCollection\",\n\t\t\t\titemCount, disposedCount);\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = this._collection.getItemAt(i);\n\t\t\t\tAssert.assertTrue(\"Item was not included when calling dispose() on ListCollection\", item.isDisposed);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSortCompareFunction():void\n\t\t{\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: sortCompareFunction order is incorrect.\",\n\t\t\t\tthis._a, this._collection.getItemAt(0));\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: sortCompareFunction order is incorrect.\",\n\t\t\t\tthis._d, this._collection.getItemAt(1));\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: sortCompareFunction order is incorrect.\",\n\t\t\t\tthis._b, this._collection.getItemAt(2));\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: sortCompareFunction order is incorrect.\",\n\t\t\t\tthis._c, this._collection.getItemAt(3));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSortCompareFunctionAndFilterFunction():void\n\t\t{\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\tthis._collection.filterFunction = this.filterFunction;\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: sortCompareFunction and filterFunction length is incorrect.\",\n\t\t\t\t2, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: sortCompareFunction order is incorrect with filterFunction.\",\n\t\t\t\tthis._d, this._collection.getItemAt(0));\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: sortCompareFunction order is incorrect with filterFunction.\",\n\t\t\t\tthis._b, this._collection.getItemAt(1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetSortCompareFunctionToNull():void\n\t\t{\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\t//get an item so that we know the sorting was applied\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: sortCompareFunction order is incorrect.\",\n\t\t\t\tthis._c, this._collection.getItemAt(3));\n\n\t\t\tthis._collection.sortCompareFunction = null;\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: set sortCompareFunction to null order is incorrect.\",\n\t\t\t\tthis._a, this._collection.getItemAt(0));\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: set sortCompareFunction to null order is incorrect.\",\n\t\t\t\tthis._b, this._collection.getItemAt(1));\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: set sortCompareFunction to null order is incorrect.\",\n\t\t\t\tthis._c, this._collection.getItemAt(2));\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: set sortCompareFunction to null order is incorrect.\",\n\t\t\t\tthis._d, this._collection.getItemAt(3));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSortCompareFunctionWithAddItem():void\n\t\t{\n\t\t\tvar newItem:Object = { label: \"New Item\", value: 1.5 };\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\tthis._collection.addItem(newItem);\n\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: addItem() with sortCompareFunction does not add at correct sorted index.\",\n\t\t\t\tnewItem, this._collection.getItemAt(2));\n\n\t\t\tthis._collection.sortCompareFunction = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: addItem() with sortCompareFunction does not add at correct unsorted index.\",\n\t\t\t\tnewItem, this._collection.getItemAt(4));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSortCompareFunctionWithAddItemAt():void\n\t\t{\n\t\t\tvar newItem:Object = { label: \"New Item\", value: 1.5 };\n\t\t\tvar newIndex:int = 1;\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\tthis._collection.addItemAt(newItem, newIndex);\n\n\t\t\t//the index we passed in isn't necessarily the same while sorted\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: addItemAt() with sortCompareFunction does not add at correct sorted index.\",\n\t\t\t\tnewItem, this._collection.getItemAt(2));\n\n\t\t\tthis._collection.sortCompareFunction = null;\n\n\t\t\t//and it might not even be the same while unsorted!\n\t\t\t//that's because, in the unsorted data, it will be placed relative\n\t\t\t//to the item in the sorted data that was at the index passed to\n\t\t\t//addItemAt(). confusing, but it's consistent with setItemAt() and\n\t\t\t//filtered collections\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: addItemAt() with sortCompareFunction does not add at correct unsorted index.\",\n\t\t\t\tnewItem, this._collection.getItemAt(3));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSortCompareFunctionWithRemoveItemAt():void\n\t\t{\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\tthis._collection.removeItemAt(2);\n\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: removeItemAt() with sortCompareFunction removed incorrect item in sorted data.\",\n\t\t\t\tthis._a, this._collection.getItemAt(0));\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: removeItemAt() with sortCompareFunction removed incorrect item in sorted data.\",\n\t\t\t\tthis._d, this._collection.getItemAt(1));\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: removeItemAt() with sortCompareFunction removed incorrect item in sorted data.\",\n\t\t\t\tthis._c, this._collection.getItemAt(2));\n\n\t\t\tthis._collection.sortCompareFunction = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: removeItemAt() with sortCompareFunction removed incorrect item in unsorted data.\",\n\t\t\t\tthis._a, this._collection.getItemAt(0));\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: removeItemAt() with sortCompareFunction removed incorrect item in unsorted data.\",\n\t\t\t\tthis._c, this._collection.getItemAt(1));\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: removeItemAt() with sortCompareFunction removed incorrect item in unsorted data.\",\n\t\t\t\tthis._d, this._collection.getItemAt(2));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSortCompareFunctionWithRemoveItem():void\n\t\t{\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\tthis._collection.removeItem(this._b);\n\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: removeItem() with sortCompareFunction removed incorrect item in sorted data.\",\n\t\t\t\tthis._a, this._collection.getItemAt(0));\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: removeItem() with sortCompareFunction removed incorrect item in sorted data.\",\n\t\t\t\tthis._d, this._collection.getItemAt(1));\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: removeItem() with sortCompareFunction removed incorrect item in sorted data.\",\n\t\t\t\tthis._c, this._collection.getItemAt(2));\n\n\t\t\tthis._collection.sortCompareFunction = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: removeItem() with sortCompareFunction removed incorrect item in unsorted data.\",\n\t\t\t\tthis._a, this._collection.getItemAt(0));\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: removeItem() with sortCompareFunction removed incorrect item in unsorted data.\",\n\t\t\t\tthis._c, this._collection.getItemAt(1));\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: removeItem() with sortCompareFunction removed incorrect item in unsorted data.\",\n\t\t\t\tthis._d, this._collection.getItemAt(2));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSortCompareFunctionWithSetItemAt():void\n\t\t{\n\t\t\tvar newItem:Object = { label: \"New Item\", value: 1.5 };\n\t\t\tvar newIndex:int = 0;\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\tthis._collection.setItemAt(newItem, newIndex);\n\n\t\t\t//the index we passed in isn't necessarily the same while sorted\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: setItemAt() with sortCompareFunction does not add at correct sorted index.\",\n\t\t\t\tnewItem, this._collection.getItemAt(1));\n\t\t\tAssert.assertFalse(\"ListCollection: setItemAt() with sortCompareFunction does not replace correct item.\",\n\t\t\t\tthis._collection.contains(this._a));\n\n\t\t\tthis._collection.sortCompareFunction = null;\n\n\t\t\t//however, that index should be the same when the collection is unsorted\n\t\t\tAssert.assertStrictlyEquals(\"ListCollection: setItemAt() with sortCompareFunction does not add at correct unsorted index.\",\n\t\t\t\tnewItem, this._collection.getItemAt(newIndex));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ListFactoryIDFunctionTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.List;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.renderers.IListItemRenderer;\n\timport feathers.data.ListCollection;\n\timport feathers.events.FeathersEventType;\n\n\timport flash.utils.Dictionary;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\n\tpublic class ListFactoryIDFunctionTests\n\t{\n\t\tprivate static const FACTORY_ONE:String = \"custom-factory1\";\n\t\tprivate static const CUSTOM_STYLE_NAME:String = \"custom-style-name\";\n\t\t\n\t\tprivate var _list:List;\n\t\t\n\t\tprivate var _itemRendererMap:Dictionary;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._itemRendererMap = new Dictionary(true);\n\t\t\t\n\t\t\tthis._list = new List();\n\t\t\tthis._list.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{ label: \"One\", factory: 0 },\n\t\t\t\t{ label: \"Two\", factory: 0 },\n\t\t\t\t{ label: \"Three\", factory: 1 },\n\t\t\t]);\n\t\t\tthis._list.itemRendererFactory = function():DefaultListItemRenderer\n\t\t\t{\n\t\t\t\tvar itemRenderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\t\t\t\titemRenderer.defaultSkin = new Quad(200, 200);\n\t\t\t\treturn itemRenderer;\n\t\t\t};\n\t\t\tthis._list.setItemRendererFactoryWithID(FACTORY_ONE, function():DefaultListItemRenderer\n\t\t\t{\n\t\t\t\tvar itemRenderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\t\t\t\titemRenderer.styleNameList.add(CUSTOM_STYLE_NAME);\n\t\t\t\titemRenderer.defaultSkin = new Quad(200, 200);\n\t\t\t\treturn itemRenderer;\n\t\t\t});\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_ADD, list_rendererAddHandler);\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_REMOVE, list_rendererRemoveHandler);\n\t\t\tTestFeathers.starlingRoot.addChild(this._list);\n\t\t\tthis._list.validate();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._list.removeFromParent(true);\n\t\t\tthis._list = null;\n\t\t\t\n\t\t\tthis._itemRendererMap = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoFactoryIDFunction():void\n\t\t{\n\t\t\tAssert.assertNull(\"Item renderer factoryID should be null if factoryIDFunction is null.\", this.getItemRendererAt(0).factoryID);\n\t\t\tAssert.assertNull(\"Item renderer factoryID should be null if factoryIDFunction is null.\", this.getItemRendererAt(1).factoryID);\n\t\t\tAssert.assertNull(\"Item renderer factoryID should be null if factoryIDFunction is null.\", this.getItemRendererAt(2).factoryID);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testOneArgumentFactoryIDFunction():void\n\t\t{\n\t\t\tthis._list.factoryIDFunction = oneArgumentFactoryIDFunction;\n\t\t\tthis._list.validate();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTwoArgumentFactoryIDFunction():void\n\t\t{\n\t\t\tthis._list.factoryIDFunction = twoArgumentFactoryIDFunction;\n\t\t\tthis._list.validate();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFactoryIDFunction():void\n\t\t{\n\t\t\tthis._list.factoryIDFunction = factoryIDFunction;\n\t\t\tthis._list.validate();\n\t\t\tAssert.assertNull(\"Item renderer factoryID not set to result of factoryIDFunction.\", this.getItemRendererAt(0).factoryID);\n\t\t\tAssert.assertNull(\"Item renderer factoryID not set to result of factoryIDFunction.\", this.getItemRendererAt(1).factoryID);\n\t\t\tvar itemRenderer2:IListItemRenderer = this.getItemRendererAt(2);\n\t\t\tAssert.assertStrictlyEquals(\"Item renderer factoryID not set to result of factoryIDFunction.\", FACTORY_ONE, itemRenderer2.factoryID);\n\t\t\tAssert.assertTrue(\"Incorrect factory called to create item renderer.\", itemRenderer2.styleNameList.contains(CUSTOM_STYLE_NAME));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemAtWithDifferentFactoryID():void\n\t\t{\n\t\t\tvar itemToSet:Object = { label: \"New\", factory: 1 };\n\t\t\tthis._list.factoryIDFunction = factoryIDFunction;\n\t\t\tthis._list.validate();\n\t\t\tthis._list.dataProvider.setItemAt(itemToSet, 1);\n\t\t\tthis._list.validate();\n\t\t\tvar itemRenderer:IListItemRenderer = this.getItemRendererAt(1);\n\t\t\tAssert.assertStrictlyEquals(\"Item renderer factoryID not changed to new result of factoryIDFunction after calling setItemAt().\", FACTORY_ONE, itemRenderer.factoryID);\n\t\t\tAssert.assertStrictlyEquals(\"Item renderer data not changed with new result of factoryIDFunction after calling setItemAt().\", itemToSet, itemRenderer.data);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetTypicalItemAtWithDifferentFactoryID():void\n\t\t{\n\t\t\tvar index:int = 0;\n\t\t\tthis._list.typicalItem = this._list.dataProvider.getItemAt(index);\n\t\t\tvar itemToSet:Object = { label: \"Replacement Item\", factory: 1 };\n\t\t\tthis._list.factoryIDFunction = factoryIDFunction;\n\t\t\tthis._list.validate();\n\t\t\tthis._list.dataProvider.setItemAt(itemToSet, index);\n\t\t\tthis._list.validate();\n\t\t\tvar itemRenderer:IListItemRenderer = this.getItemRendererAt(index);\n\t\t\tAssert.assertStrictlyEquals(\"Typical item renderer factoryID not changed to new result of factoryIDFunction after calling setItemAt().\", FACTORY_ONE, itemRenderer.factoryID);\n\t\t\tAssert.assertStrictlyEquals(\"Typical item renderer data not changed with new result of factoryIDFunction after calling setItemAt().\", itemToSet, itemRenderer.data);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemAtWithDifferentFactoryIDAndRemoveItemBefore():void\n\t\t{\n\t\t\tvar itemToSet:Object = { label: \"Replacement Item\", factory: 1 };\n\t\t\tthis._list.factoryIDFunction = factoryIDFunction;\n\t\t\tthis._list.validate();\n\t\t\tthis._list.dataProvider.setItemAt(itemToSet, 1);\n\t\t\tthis._list.dataProvider.removeItemAt(0);\n\t\t\tthis._list.validate();\n\t\t\tvar itemRenderer:IListItemRenderer = this.getItemRendererAt(0);\n\t\t\tAssert.assertStrictlyEquals(\"Item renderer factoryID not changed to new result of factoryIDFunction after calling setItemAt() and removeItemAt() for previous item.\", FACTORY_ONE, itemRenderer.factoryID);\n\t\t\tAssert.assertStrictlyEquals(\"Item renderer data not changed with new result of factoryIDFunction after calling setItemAt() and removeItemAt() for previous item.\", itemToSet, itemRenderer.data);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemAtWithDifferentFactoryIDAndAddItemBefore():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"Added Item\", factory: 1 };\n\t\t\tvar itemToSet:Object = { label: \"Replacement Item\", factory: 1 };\n\t\t\tthis._list.factoryIDFunction = factoryIDFunction;\n\t\t\tthis._list.validate();\n\t\t\tthis._list.dataProvider.setItemAt(itemToSet, 0);\n\t\t\tthis._list.dataProvider.addItemAt(itemToAdd, 0);\n\t\t\tthis._list.validate();\n\t\t\tAssert.assertStrictlyEquals(\"factoryID of changed typical item not changed to result of factoryIDFunction.\", FACTORY_ONE, this.getItemRendererAt(0).factoryID);\n\t\t\tvar itemRenderer1:IListItemRenderer = this.getItemRendererAt(1);\n\t\t\tAssert.assertStrictlyEquals(\"Item renderer factoryID not changed to new result of factoryIDFunction after calling setItemAt() and addItemAt() for previous item.\", FACTORY_ONE, itemRenderer1.factoryID);\n\t\t\tAssert.assertStrictlyEquals(\"Item renderer data not changed with new result of factoryIDFunction after calling setItemAt() and addItemAt() for previous item.\", itemToSet, itemRenderer1.data);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNewTypicalItemWithDifferentFactoryAndRemoveTypicalItemAfterDispose():void\n\t\t{\n\t\t\tvar itemToSet:Object = { label: \"Replacement Item\", factory: 1 };\n\t\t\tthis._list.factoryIDFunction = factoryIDFunction;\n\t\t\tthis._list.validate();\n\t\t\tthis._list.dataProvider.setItemAt(itemToSet, 1);\n\t\t\tthis._list.dataProvider.removeItemAt(0);\n\t\t\tthis._list.validate();\n\t\t\tvar itemRendererCount:int = this._list.dataProvider.length;\n\t\t\tvar removedRendererCount:int = 0;\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_REMOVE, function(event:Event, itemRenderer:IListItemRenderer):void\n\t\t\t{\n\t\t\t\tremovedRendererCount++;\n\t\t\t\tAssert.assertNotNull(\"Item renderer incorrectly has null owner during dispose().\", itemRenderer.owner);\n\t\t\t\tAssert.assertNotNull(\"Item renderer incorrectly has null data during dispose().\", itemRenderer.data);\n\t\t\t\tAssert.assertTrue(\"Item renderer incorrectly has negative index during dispose().\", itemRenderer.index >= 0);\n\t\t\t});\n\t\t\tthis._list.dispose();\n\t\t\tAssert.assertStrictlyEquals(\"FeathersEventType.RENDERER_REMOVE not dispatched for all item renderers after dispose().\", itemRendererCount, removedRendererCount);\n\t\t}\n\t\t\n\t\tprivate function getItemRendererAt(index:int):IListItemRenderer\n\t\t{\n\t\t\tfor(var item:Object in this._itemRendererMap)\n\t\t\t{\n\t\t\t\tvar itemRenderer:IListItemRenderer = IListItemRenderer(this._itemRendererMap[item]);\n\t\t\t\tif(itemRenderer.index === index)\n\t\t\t\t{\n\t\t\t\t\treturn itemRenderer;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tprivate function list_rendererAddHandler(event:Event, itemRenderer:IListItemRenderer):void\n\t\t{\n\t\t\tthis._itemRendererMap[itemRenderer.data] = itemRenderer;\n\t\t}\n\n\t\tprivate function list_rendererRemoveHandler(event:Event, itemRenderer:IListItemRenderer):void\n\t\t{\n\t\t\tdelete this._itemRendererMap[itemRenderer.data];\n\t\t}\n\n\t\tprivate function factoryIDFunction(item:Object):String\n\t\t{\n\t\t\tif(item.factory === 1)\n\t\t\t{\n\t\t\t\treturn FACTORY_ONE;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tprivate function oneArgumentFactoryIDFunction(item:Object):String\n\t\t{\n\t\t\tAssert.assertNotNull(\"Item passed to factoryIDFunction should not be null.\", item);\n\t\t\treturn null;\n\t\t}\n\n\t\tprivate function twoArgumentFactoryIDFunction(item:Object, index:int):String\n\t\t{\n\t\t\tAssert.assertNotNull(\"Item passed to factoryIDFunction should not be null.\", item);\n\t\t\tAssert.assertTrue(\"Index passed to factoryIDFunction is out of range.\", index >= 0 && index < this._list.dataProvider.length);\n\t\t\treturn null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ListFocusTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.List;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.core.FocusManager;\n\timport feathers.data.ListCollection;\n\n\timport flash.events.KeyboardEvent;\n\timport flash.ui.Keyboard;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport flash.ui.KeyLocation;\n\n\tpublic class ListFocusTests\n\t{\n\t\tprivate var _list:List;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._list = new List();\n\t\t\tthis._list.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{ label: \"One\" },\n\t\t\t\t{ label: \"Two\" },\n\t\t\t\t{ label: \"Three\" },\n\t\t\t\t{ label: \"Four\" },\n\t\t\t]);\n\t\t\tthis._list.itemRendererFactory = function():DefaultListItemRenderer\n\t\t\t{\n\t\t\t\tvar itemRenderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\t\t\t\titemRenderer.defaultSkin = new Quad(200, 200);\n\t\t\t\treturn itemRenderer;\n\t\t\t};\n\t\t\tTestFeathers.starlingRoot.addChild(this._list);\n\t\t\tthis._list.validate();\n\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, true);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._list.removeFromParent(true);\n\t\t\tthis._list = null;\n\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, false);\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t\tAssert.assertFalse(\"FocusManager not disabled on cleanup.\", FocusManager.isEnabledForStage(TestFeathers.starlingRoot.stage));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoTriggerWhenNoSelectedItem():void\n\t\t{\n\t\t\tFocusManager.focus = this._list;\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tvar triggeredItem:Object = null;\n\t\t\tthis._list.addEventListener(Event.TRIGGERED, function(event:Event, item:Object):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t\ttriggeredItem = item;\n\t\t\t});\n\t\t\tthis._list.stage.starling.nativeStage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 32, Keyboard.SPACE, KeyLocation.STANDARD, false, false, false));\n\t\t\tthis._list.stage.starling.nativeStage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, true, false, 32, Keyboard.SPACE, KeyLocation.STANDARD, false, false, false));\n\t\t\tAssert.assertFalse(\"Event.TRIGGERED incorrectly dispatched when no item is selected\",\n\t\t\t\thasTriggered);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTriggered():void\n\t\t{\n\t\t\tthis._list.selectedIndex = 1;\n\t\t\tFocusManager.focus = this._list;\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tvar triggeredItem:Object = null;\n\t\t\tthis._list.addEventListener(Event.TRIGGERED, function(event:Event, item:Object):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t\ttriggeredItem = item;\n\t\t\t});\n\t\t\tthis._list.stage.starling.nativeStage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 32, Keyboard.SPACE, KeyLocation.STANDARD, false, false, false));\n\t\t\tthis._list.stage.starling.nativeStage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, true, false, 32, Keyboard.SPACE, KeyLocation.STANDARD, false, false, false));\n\t\t\tAssert.assertTrue(\"Event.TRIGGERED must be dispatched on KeyboardEvent.KEY_DOWN with Keyboard.SPACE key code\",\n\t\t\t\thasTriggered);\n\t\t\tAssert.assertStrictlyEquals(\"Incorrect item passed to Event.TRIGGERED listener\",\n\t\t\t\tthis._list.dataProvider.getItemAt(1), triggeredItem);\n\t\t}\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/ListRendererAddRemoveTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.List;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.renderers.IListItemRenderer;\n\timport feathers.data.ListCollection;\n\timport feathers.events.FeathersEventType;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\n\tpublic class ListRendererAddRemoveTests\n\t{\n\t\tprivate var _list:List;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._list = new List();\n\t\t\tthis._list.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{ label: \"One\" },\n\t\t\t\t{ label: \"Two\" },\n\t\t\t\t{ label: \"Three\" },\n\t\t\t]);\n\t\t\tthis._list.itemRendererFactory = function():DefaultListItemRenderer\n\t\t\t{\n\t\t\t\tvar itemRenderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\t\t\t\titemRenderer.defaultSkin = new Quad(200, 200);\n\t\t\t\treturn itemRenderer;\n\t\t\t};\n\t\t\tTestFeathers.starlingRoot.addChild(this._list);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._list.removeFromParent(true);\n\t\t\tthis._list = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRendererAddEventWithDataProvider():void\n\t\t{\n\t\t\tvar itemRendererCount:int = 0;\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_ADD, function(event:Event):void\n\t\t\t{\n\t\t\t\titemRendererCount++;\n\t\t\t});\n\t\t\tthis._list.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"FeathersEventType.RENDERER_ADD not dispatched for all visible items.\", this._list.dataProvider.length, itemRendererCount);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRendererAddEventAfterAddItem():void\n\t\t{\n\t\t\tthis._list.validate();\n\t\t\tvar addedRenderer:Boolean = false;\n\t\t\tvar addedItemIndex:int = -1;\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_ADD, function(event:Event, itemRenderer:IListItemRenderer):void\n\t\t\t{\n\t\t\t\taddedRenderer = true;\n\t\t\t\taddedItemIndex = itemRenderer.index;\n\t\t\t});\n\t\t\tthis._list.dataProvider.addItem({label: \"New Item\"});\n\t\t\tthis._list.validate();\n\t\t\tAssert.assertTrue(\"FeathersEventType.RENDERER_ADD not dispatched after addItem().\", addedRenderer);\n\t\t\tAssert.assertStrictlyEquals(\"FeathersEventType.RENDERER_ADD not dispatched with correct item renderer after addItem().\", this._list.dataProvider.length - 1, addedItemIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRendererRemoveEventAfterRemoveItemAt():void\n\t\t{\n\t\t\tvar index:int = 1;\n\t\t\tthis._list.validate();\n\t\t\tvar removedRenderer:Boolean = false;\n\t\t\tvar removedItemIndex:int = -1;\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_REMOVE, function(event:Event, itemRenderer:IListItemRenderer):void\n\t\t\t{\n\t\t\t\tremovedRenderer = true;\n\t\t\t\tremovedItemIndex = itemRenderer.index;\n\t\t\t});\n\t\t\tthis._list.dataProvider.removeItemAt(index);\n\t\t\tthis._list.validate();\n\t\t\tAssert.assertTrue(\"FeathersEventType.RENDERER_REMOVE not dispatched after removeItemAt().\", removedRenderer);\n\t\t\tAssert.assertStrictlyEquals(\"FeathersEventType.RENDERER_REMOVE not dispatched with correct item renderer after removeItemAt().\", index, removedItemIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRendererAddAndRemoveEventsAfterSetItemAt():void\n\t\t{\n\t\t\tvar index:int = 1;\n\t\t\tthis._list.validate();\n\t\t\tvar addedRenderer:Boolean = false;\n\t\t\tvar addedItemIndex:int = -1;\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_ADD, function(event:Event, itemRenderer:IListItemRenderer):void\n\t\t\t{\n\t\t\t\tAssert.assertTrue(\"FeathersEventType.RENDERER_REMOVE not dispatched before FeathersEventType.RENDERER_ADD when calling setItemAt().\", removedRenderer);\n\t\t\t\taddedRenderer = true;\n\t\t\t\taddedItemIndex = itemRenderer.index;\n\t\t\t});\n\t\t\tvar removedRenderer:Boolean = false;\n\t\t\tvar removedItemIndex:int = -1;\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_REMOVE, function(event:Event, itemRenderer:IListItemRenderer):void\n\t\t\t{\n\t\t\t\tremovedRenderer = true;\n\t\t\t\tremovedItemIndex = itemRenderer.index;\n\t\t\t});\n\t\t\tthis._list.dataProvider.setItemAt({label: \"New Item\"}, index);\n\t\t\tthis._list.validate();\n\t\t\tAssert.assertTrue(\"FeathersEventType.RENDERER_REMOVE not dispatched after setItemAt().\", removedRenderer);\n\t\t\tAssert.assertStrictlyEquals(\"FeathersEventType.RENDERER_REMOVE not dispatched with correct item renderer after setItemAt().\", index, removedItemIndex);\n\t\t\tAssert.assertTrue(\"FeathersEventType.RENDERER_ADD not dispatched after setItemAt().\", addedRenderer);\n\t\t\tAssert.assertStrictlyEquals(\"FeathersEventType.RENDERER_ADD not dispatched with correct item renderer after setItemAt().\", index, addedItemIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRendererAddAndRemoveEventAfterChangeTypicalItemFromDefaultToCustom():void\n\t\t{\n\t\t\tthis._list.validate();\n\t\t\tthis._list.typicalItem = { label: \"Typical Item\" };\n\t\t\tvar addedRenderer:Boolean = false;\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_ADD, function(event:Event, itemRenderer:IListItemRenderer):void\n\t\t\t{\n\t\t\t\taddedRenderer = true;\n\t\t\t});\n\t\t\tvar removedRenderer:Boolean = false;\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_REMOVE, function(event:Event, itemRenderer:IListItemRenderer):void\n\t\t\t{\n\t\t\t\tremovedRenderer = true;\n\t\t\t});\n\t\t\tthis._list.validate();\n\t\t\tAssert.assertFalse(\"FeathersEventType.RENDERER_REMOVE incorrectly dispatched after change typicalItem from default to custom.\", removedRenderer);\n\t\t\tAssert.assertFalse(\"FeathersEventType.RENDERER_ADD incorrectly dispatched after change typicalItem from default to custom.\", addedRenderer);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRendererRemoveEventsAfterDispose():void\n\t\t{\n\t\t\tthis._list.validate();\n\t\t\tvar itemRendererCount:int = this._list.dataProvider.length;\n\t\t\tvar removedRendererCount:int = 0;\n\t\t\tthis._list.addEventListener(FeathersEventType.RENDERER_REMOVE, function(event:Event, itemRenderer:IListItemRenderer):void\n\t\t\t{\n\t\t\t\tAssert.assertNotNull(\"Item renderer incorrectly has null owner during dispose().\", itemRenderer.owner);\n\t\t\t\tAssert.assertNotNull(\"Item renderer incorrectly has null data during dispose().\", itemRenderer.data);\n\t\t\t\tAssert.assertTrue(\"Item renderer incorrectly has negative index during dispose().\", itemRenderer.index >= 0);\n\t\t\t\tremovedRendererCount++;\n\t\t\t});\n\t\t\tthis._list.dispose();\n\t\t\tAssert.assertStrictlyEquals(\"FeathersEventType.RENDERER_REMOVE not dispatched for all item renderers after dispose().\", itemRendererCount, removedRendererCount);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ListTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.List;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.renderers.IListItemRenderer;\n\timport feathers.data.ListCollection;\n\timport feathers.events.FeathersEventType;\n\timport feathers.tests.supportClasses.AssertViewPortBoundsLayout;\n\n\timport flash.geom.Point;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\tpublic class ListTests\n\t{\n\t\tprivate var _list:List;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._list = new List();\n\t\t\tthis._list.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{ label: \"One\" },\n\t\t\t\t{ label: \"Two\" },\n\t\t\t\t{ label: \"Three\" },\n\t\t\t\t{ label: \"Four\" },\n\t\t\t]);\n\t\t\tthis._list.itemRendererFactory = function():DefaultListItemRenderer\n\t\t\t{\n\t\t\t\tvar itemRenderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\t\t\t\titemRenderer.defaultSkin = new Quad(200, 200);\n\t\t\t\treturn itemRenderer;\n\t\t\t};\n\t\t\tTestFeathers.starlingRoot.addChild(this._list);\n\t\t\tthis._list.validate();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._list.removeFromParent(true);\n\t\t\tthis._list = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNullDataProvider():void\n\t\t{\n\t\t\tthis._list.dataProvider = null;\n\t\t\tthis._list.validate();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNullDataProviderWithTypicalItem():void\n\t\t{\n\t\t\tthis._list.dataProvider = null;\n\t\t\tthis._list.typicalItem = { label: \"Typical Item\" };\n\t\t\tthis._list.validate();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testProgrammaticSelectionChange():void\n\t\t{\n\t\t\tvar beforeSelectedIndex:int = this._list.selectedIndex;\n\t\t\tvar beforeSelectedItem:Object = this._list.selectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.selectedIndex = 1;\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertFalse(\"The selectedIndex property was not changed\",\n\t\t\t\tbeforeSelectedIndex === this._list.selectedIndex);\n\t\t\tAssert.assertFalse(\"The selectedItem property was not changed\",\n\t\t\t\tbeforeSelectedItem === this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInteractiveSelectionChange():void\n\t\t{\n\t\t\tvar beforeSelectedIndex:int = this._list.selectedIndex;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 210);\n\t\t\tvar target:DisplayObject = this._list.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t//this touch does not move at all, so it should result in triggering\n\t\t\t//the button.\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertFalse(\"The selectedIndex property was not changed\",\n\t\t\t\tbeforeSelectedIndex === this._list.selectedIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemBeforeSelectedIndex():void\n\t\t{\n\t\t\tthis._list.selectedIndex = 1;\n\t\t\tvar beforeSelectedIndex:int = this._list.selectedIndex;\n\t\t\tvar beforeSelectedItem:Object = this._list.selectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dataProvider.removeItemAt(0);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was not changed\",\n\t\t\t\tbeforeSelectedIndex - 1, this._list.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was incorrectly changed\",\n\t\t\t\tbeforeSelectedItem, this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemAfterSelectedIndex():void\n\t\t{\n\t\t\tthis._list.selectedIndex = 1;\n\t\t\tvar beforeSelectedIndex:int = this._list.selectedIndex;\n\t\t\tvar beforeSelectedItem:Object = this._list.selectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dataProvider.removeItemAt(2);\n\t\t\tAssert.assertFalse(\"Event.CHANGE was incorrectly dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was incorrectly changed\",\n\t\t\t\tbeforeSelectedIndex, this._list.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was incorrectly changed\",\n\t\t\t\tbeforeSelectedItem, this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveSelectedIndex():void\n\t\t{\n\t\t\tthis._list.selectedIndex = 1;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dataProvider.removeItemAt(1);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was not changed to -1\",\n\t\t\t\t-1, this._list.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was not changed to null\",\n\t\t\t\tnull, this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testReplaceItemAtSelectedIndex():void\n\t\t{\n\t\t\tthis._list.selectedIndex = 1;\n\t\t\tvar beforeSelectedIndex:int = this._list.selectedIndex;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dataProvider.setItemAt({ label: \"New Item\" }, beforeSelectedIndex);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was not changed to -1\",\n\t\t\t\t-1, this._list.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was not changed to null\",\n\t\t\t\tnull, this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDeselectAllOnNullDataProvider():void\n\t\t{\n\t\t\tthis._list.selectedIndex = 1;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dataProvider = null;\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was not set to -1\",\n\t\t\t\t-1, this._list.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was not set to null\",\n\t\t\t\tnull, this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDeselectAllOnDataProviderRemoveAll():void\n\t\t{\n\t\t\tthis._list.selectedIndex = 1;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dataProvider.removeAll();\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was not set to -1\",\n\t\t\t\t-1, this._list.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was not set to null\",\n\t\t\t\tnull, this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemBeforeSelectedIndex():void\n\t\t{\n\t\t\tthis._list.selectedIndex = 1;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tvar beforeSelectedIndex:int = this._list.selectedIndex;\n\t\t\tvar beforeSelectedItem:Object = this._list.selectedItem;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dataProvider.addItemAt({label: \"New Item\"}, 0);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was not changed\",\n\t\t\t\tbeforeSelectedIndex + 1, this._list.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was incorrectly changed\",\n\t\t\t\tbeforeSelectedItem, this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFilterSelectedIndex():void\n\t\t{\n\t\t\tthis._list.selectedIndex = 1;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar selectedItem:Object = this._list.dataProvider.getItemAt(1);\n\t\t\tthis._list.dataProvider.filterFunction = function(item:Object):Boolean\n\t\t\t{\n\t\t\t\treturn item !== selectedItem;\n\t\t\t};\n\t\t\tAssert.assertTrue(\"Event.CHANGE must be dispatched when item is filtered\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was not changed to -1 when selected item is filtered\",\n\t\t\t\t-1, this._list.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was not changed to null when selected item is filtered\",\n\t\t\t\tnull, this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDisposeWithoutChangeEvent():void\n\t\t{\n\t\t\tthis._list.selectedIndex = 1;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dispose();\n\t\t\tAssert.assertFalse(\"Event.CHANGE was incorrectly dispatched\", hasChanged);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testItemToItemRenderer():void\n\t\t{\n\t\t\tthis._list.height = 20;\n\t\t\tthis._list.validate();\n\t\t\tvar item0:Object = this._list.dataProvider.getItemAt(0);\n\t\t\tvar itemRenderer0:IListItemRenderer = this._list.itemToItemRenderer(item0);\n\t\t\tvar item1:Object = this._list.dataProvider.getItemAt(1);\n\t\t\tvar itemRenderer1:IListItemRenderer = this._list.itemToItemRenderer(item1);\n\t\t\tvar item3:Object = this._list.dataProvider.getItemAt(3);\n\t\t\tvar itemRenderer3:IListItemRenderer = this._list.itemToItemRenderer(item3);\n\t\t\tAssert.assertNotNull(\"itemToItemRenderer() incorrectly returned null for item that should have an item renderer\", itemRenderer0);\n\t\t\tAssert.assertStrictlyEquals(\"Item renderer returned by itemToItemRenderer() has incorrect data\", item0, itemRenderer0.data);\n\t\t\tAssert.assertStrictlyEquals(\"Item renderer returned by itemToItemRenderer() has incorrect index\", 0, itemRenderer0.index);\n\t\t\tAssert.assertNotNull(\"itemToItemRenderer() incorrectly returned null for item that should have an item renderer\", itemRenderer1);\n\t\t\tAssert.assertStrictlyEquals(\"Item renderer returned by itemToItemRenderer() has incorrect data\", item1, itemRenderer1.data);\n\t\t\tAssert.assertStrictlyEquals(\"Item renderer returned by itemToItemRenderer() has incorrect index\", 1, itemRenderer1.index);\n\t\t\tAssert.assertNull(\"itemToItemRenderer() incorrectly returned item renderer for item that should not have one\", itemRenderer3);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testResizeOnUpdateItemAtWithLongerText():void\n\t\t{\n\t\t\tthis._list.dataProvider.getItemAt(1).label = \"I am the very model of a modern major general. I've information vegetable, animal, and mineral.\";\n\t\t\tthis._list.dataProvider.updateItemAt(1);\n\t\t\tvar hasResized:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.RESIZE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasResized = true;\n\t\t\t});\n\t\t\tthis._list.validate();\n\t\t\tAssert.assertTrue(\"List Event.RESIZE was not dispatched when item was updated with longer text and width was not explicit\", hasResized);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNewMaskDimensionsOnAddItemToDataProvider():void\n\t\t{\n\t\t\tvar mask:DisplayObject = this._list.viewPort.mask;\n\t\t\tvar oldMaskHeight:Number = mask.height;\n\t\t\tthis._list.dataProvider.addItem({ label: \"New Item\" });\n\t\t\tthis._list.validate();\n\t\t\tAssert.assertTrue(\"List with VerticalLayout must resize mask when item is added to data provider and height is not explicit\", mask.height > oldMaskHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testViewPortBoundsValues():void\n\t\t{\n\t\t\tthis._list.layout = new AssertViewPortBoundsLayout();\n\t\t\tthis._list.validate();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testScrollToDisplayIndexAndSetDataProviderToNull():void\n\t\t{\n\t\t\tthis._list.scrollToDisplayIndex(1, 2);\n\t\t\tthis._list.dataProvider = null;\n\t\t\tthis._list.validate();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testScrollToDisplayIndex():void\n\t\t{\n\t\t\tvar hasDispatchedScrollStart:Boolean = false;\n\t\t\tthis._list.addEventListener(FeathersEventType.SCROLL_START, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedScrollStart = true;\n\t\t\t});\n\t\t\tvar hasDispatchedScrollComplete:Boolean = false;\n\t\t\tthis._list.addEventListener(FeathersEventType.SCROLL_COMPLETE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedScrollComplete = true;\n\t\t\t});\n\t\t\tthis._list.height = 200;\n\t\t\tthis._list.scrollToDisplayIndex(1);\n\t\t\tthis._list.validate();\n\t\t\tAssert.assertTrue(\"List: scrollToDisplayIndex() set incorrect verticalScrollPosition\", this._list.verticalScrollPosition > 0);\n\t\t\tAssert.assertTrue(\"List: scrollToDisplayIndex() with duration 0 did not dispatch FeathersEventType.SCROLL_START\",\n\t\t\t\thasDispatchedScrollStart);\n\t\t\tAssert.assertTrue(\"List: scrollToDisplayIndex() with duration 0 did not dispatch FeathersEventType.SCROLL_COMPLETE\",\n\t\t\t\thasDispatchedScrollComplete);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTriggeredByTap():void\n\t\t{\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tvar triggeredItem:Object = null;\n\t\t\tthis._list.addEventListener(Event.TRIGGERED, function(event:Event, item:Object):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t\ttriggeredItem = item;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 210);\n\t\t\tvar target:DisplayObject = this._list.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t//this touch does not move at all, so it should result in triggering\n\t\t\t//the button.\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertTrue(\"Event.TRIGGERED was not dispatched\", hasTriggered);\n\t\t\tAssert.assertStrictlyEquals(\"Incorrect item passed to Event.TRIGGERED listener\",\n\t\t\t\tthis._list.dataProvider.getItemAt(1), triggeredItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectionChangeOnSortChange():void\n\t\t{\n\t\t\tthis._list.selectedIndex = this._list.dataProvider.length - 1;\n\t\t\tvar oldSelectedItem:Object = this._list.dataProvider.getItemAt(this._list.dataProvider.length - 1);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dataProvider.sortCompareFunction = function(a:Object, b:Object):int\n\t\t\t{\n\t\t\t\tvar aIndex:int = _list.dataProvider.getItemIndex(a);\n\t\t\t\tvar bIndex:int = _list.dataProvider.getItemIndex(b);\n\t\t\t\tif(aIndex < bIndex)\n\t\t\t\t{\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\telse if(aIndex > bIndex)\n\t\t\t\t{\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tthis._list.dataProvider.refresh();\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"Incorrect selectedIndex after sort change\",\n\t\t\t\t0, this._list.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"Incorrect selectedItem after sort change\",\n\t\t\t\toldSelectedItem, this._list.selectedItem);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/LongPressTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.events.FeathersEventType;\n\timport feathers.utils.touch.LongPress;\n\n\timport flash.geom.Point;\n\n\timport flexunit.framework.Assert;\n\n\timport org.flexunit.async.Async;\n\n\timport starling.display.Quad;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\tpublic class LongPressTests\n\t{\n\t\tprivate var _target:Quad;\n\t\tprivate var _blocker:Quad;\n\t\tprivate var _longPress:LongPress;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._target = new Quad(200, 200, 0xff00ff);\n\t\t\tTestFeathers.starlingRoot.addChild(this._target);\n\t\t\t\n\t\t\tthis._longPress = new LongPress(this._target);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._target.removeFromParent(true);\n\t\t\tthis._target = null;\n\t\t\t\n\t\t\tif(this._blocker)\n\t\t\t{\n\t\t\t\tthis._blocker.removeFromParent(true);\n\t\t\t\tthis._blocker = null;\n\t\t\t}\n\n\t\t\tthis._longPress = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testLongPressEvent():void\n\t\t{\n\t\t\tvar hasLongPressed:Boolean = false;\n\t\t\tthis._target.addEventListener(FeathersEventType.LONG_PRESS, function():void\n\t\t\t{\n\t\t\t\thasLongPressed = true;\n\t\t\t});\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = this._target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = 10;\n\t\t\ttouch.globalY = 10;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\tthis._target.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertTrue(\"FeathersEventType.LONG_PRESS was not dispatched\", hasLongPressed);\n\t\t\t}, 600);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testTouchMoveOutsideBeforeLongPressEvent():void\n\t\t{\n\t\t\tvar hasLongPressed:Boolean = false;\n\t\t\tthis._target.addEventListener(FeathersEventType.LONG_PRESS, function():void\n\t\t\t{\n\t\t\t\thasLongPressed = true;\n\t\t\t});\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = this._target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = 10;\n\t\t\ttouch.globalY = 10;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\tthis._target.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.globalX = 1000; //move the touch way outside the bounds of the button\n\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\tthis._target.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertFalse(\"FeathersEventType.LONG_PRESS was incorrectly dispatched after touch moved out of bounds\", hasLongPressed);\n\t\t\t}, 600);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testOtherDisplayObjectBlockingLongPressEvent():void\n\t\t{\n\t\t\tvar hasLongPressed:Boolean = false;\n\t\t\tthis._target.addEventListener(FeathersEventType.LONG_PRESS, function():void\n\t\t\t{\n\t\t\t\thasLongPressed = true;\n\t\t\t});\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = this._target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = 10;\n\t\t\ttouch.globalY = 10;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\tthis._target.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t\n\t\t\tthis._blocker = new Quad(200, 200, 0xff0000);\n\t\t\tTestFeathers.starlingRoot.addChild(this._blocker);\n\t\t\t\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertFalse(\"FeathersEventType.LONG_PRESS was incorrectly dispatched when another display object blocked the touch\", hasLongPressed);\n\t\t\t}, 600);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testRemovedBeforeLongPressEvent():void\n\t\t{\n\t\t\tvar hasLongPressed:Boolean = false;\n\t\t\tthis._target.addEventListener(FeathersEventType.LONG_PRESS, function():void\n\t\t\t{\n\t\t\t\thasLongPressed = true;\n\t\t\t});\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = this._target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = 10;\n\t\t\ttouch.globalY = 10;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\tthis._target.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tthis._target.removeFromParent(false);\n\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertFalse(\"FeathersEventType.LONG_PRESS was incorrectly dispatched when target was removed\", hasLongPressed);\n\t\t\t}, 600);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testDisabled():void\n\t\t{\n\t\t\tthis._longPress.isEnabled = false;\n\n\t\t\tvar hasLongPressed:Boolean = false;\n\t\t\tthis._target.addEventListener(FeathersEventType.LONG_PRESS, function():void\n\t\t\t{\n\t\t\t\thasLongPressed = true;\n\t\t\t});\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = this._target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = 10;\n\t\t\ttouch.globalY = 10;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\tthis._target.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertFalse(\"FeathersEventType.LONG_PRESS was incorrectly dispatched when disabled\", hasLongPressed);\n\t\t\t}, 600);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testCustomHitTestReturnTrue():void\n\t\t{\n\t\t\tthis._longPress.customHitTest = function customHitTest(localPosition:Point):Boolean\n\t\t\t{\n\t\t\t\treturn localPosition.x <= 100;\n\t\t\t};\n\t\t\tvar hasLongPressed:Boolean = false;\n\t\t\tthis._target.addEventListener(FeathersEventType.LONG_PRESS, function ():void\n\t\t\t{\n\t\t\t\thasLongPressed = true;\n\t\t\t});\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = this._target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = 10;\n\t\t\ttouch.globalY = 10;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\tAsync.delayCall(this, function ():void\n\t\t\t{\n\t\t\t\tAssert.assertFalse(\"FeathersEventType.LONG_PRESS was not dispatched when customHitTest returned true\", hasLongPressed);\n\t\t\t}, 600);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testCustomHitTestReturnFalse():void\n\t\t{\n\t\t\tthis._longPress.customHitTest = function customHitTest(localPosition:Point):Boolean\n\t\t\t{\n\t\t\t\treturn localPosition.x <= 100;\n\t\t\t};\n\t\t\tvar hasLongPressed:Boolean = false;\n\t\t\tthis._target.addEventListener(FeathersEventType.LONG_PRESS, function ():void\n\t\t\t{\n\t\t\t\thasLongPressed = true;\n\t\t\t});\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = this._target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = 150;\n\t\t\ttouch.globalY = 10;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\tAsync.delayCall(this, function ():void\n\t\t\t{\n\t\t\t\tAssert.assertFalse(\"FeathersEventType.LONG_PRESS was incorrect dispatched when customHitTest returned false\", hasLongPressed);\n\t\t\t}, 600);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/MinAndMaxDimensionsTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.LayoutGroup;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class MinAndMaxDimensionsTests\n\t{\n\t\tprivate static const MIN_SIZE:Number = 100;\n\t\tprivate static const EXPLICIT_SIZE_SMALLER_THAN_MIN_SIZE:Number = 50;\n\t\tprivate static const MAX_SIZE:Number = 100;\n\t\tprivate static const EXPLICIT_SIZE_LARGER_THAN_MAX_SIZE:Number = 150;\n\t\t\n\t\tprivate var _control:LayoutGroup;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._control = new LayoutGroup();\n\t\t\tTestFeathers.starlingRoot.addChild(this._control);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._control.removeFromParent(true);\n\t\t\tthis._control = null;\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMinWidth():void\n\t\t{\n\t\t\tthis._control.minWidth = MIN_SIZE;\n\t\t\tthis._control.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the component was not calculated correctly because it is smaller than the minWidth\", this._control.width, MIN_SIZE);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testExplicitWidthWithMinWidth():void\n\t\t{\n\t\t\tthis._control.minWidth = MIN_SIZE;\n\t\t\tthis._control.width = EXPLICIT_SIZE_SMALLER_THAN_MIN_SIZE;\n\t\t\tthis._control.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth was incorrectly used to calculate the component's width when the width was set explicitly\", this._control.width, EXPLICIT_SIZE_SMALLER_THAN_MIN_SIZE);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMinHeight():void\n\t\t{\n\t\t\tthis._control.minHeight = MIN_SIZE;\n\t\t\tthis._control.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The height of the component was not calculated correctly because it is smaller than the minHeight\", this._control.height, MIN_SIZE);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testExplicitHeightWithMinHeight():void\n\t\t{\n\t\t\tthis._control.minHeight = MIN_SIZE;\n\t\t\tthis._control.height = EXPLICIT_SIZE_SMALLER_THAN_MIN_SIZE;\n\t\t\tthis._control.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight was incorrectly used to calculate the component's height when the height was set explicitly\", this._control.height, EXPLICIT_SIZE_SMALLER_THAN_MIN_SIZE);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMaxWidth():void\n\t\t{\n\t\t\tthis._control.addChild(new Quad(EXPLICIT_SIZE_LARGER_THAN_MAX_SIZE, EXPLICIT_SIZE_LARGER_THAN_MAX_SIZE, 0xff00ff));\n\t\t\tthis._control.maxWidth = MAX_SIZE;\n\t\t\tthis._control.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the component was not calculated correctly because it is larger than the maxWidth\", this._control.width, MAX_SIZE);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testExplicitWidthWithMaxWidth():void\n\t\t{\n\t\t\tthis._control.maxWidth = MAX_SIZE;\n\t\t\tthis._control.width = EXPLICIT_SIZE_LARGER_THAN_MAX_SIZE;\n\t\t\tthis._control.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The maxWidth was incorrectly used to calculate the component's width when the width was set explicitly\", this._control.width, EXPLICIT_SIZE_LARGER_THAN_MAX_SIZE);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMaxHeight():void\n\t\t{\n\t\t\tthis._control.addChild(new Quad(EXPLICIT_SIZE_LARGER_THAN_MAX_SIZE, EXPLICIT_SIZE_LARGER_THAN_MAX_SIZE, 0xff00ff));\n\t\t\tthis._control.maxHeight = MAX_SIZE;\n\t\t\tthis._control.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The height was set explicitly, but the value after validation is different when using maxHeight\", this._control.height, MAX_SIZE);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testExplicitHeightWithMaxHeight():void\n\t\t{\n\t\t\tthis._control.maxHeight = MAX_SIZE;\n\t\t\tthis._control.height = EXPLICIT_SIZE_LARGER_THAN_MAX_SIZE;\n\t\t\tthis._control.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The maxHeight was incorrectly used to calculate the component's height when the height was set explicitly\", this._control.height, EXPLICIT_SIZE_LARGER_THAN_MAX_SIZE);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoInvalidationWhenSettingMinWidthWithExplicitWidth():void\n\t\t{\n\t\t\tthis._control.width = EXPLICIT_SIZE_SMALLER_THAN_MIN_SIZE;\n\t\t\tthis._control.validate();\n\t\t\tthis._control.minWidth = MIN_SIZE;\n\t\t\tAssert.assertFalse(\"The component incorrectly invalidated when setting minWidth, but component has explicitWidth\", this._control.isInvalid());\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoInvalidationWhenSettingMinHeightWithExplicitHeight():void\n\t\t{\n\t\t\tthis._control.height = EXPLICIT_SIZE_SMALLER_THAN_MIN_SIZE;\n\t\t\tthis._control.validate();\n\t\t\tthis._control.minHeight = MIN_SIZE;\n\t\t\tAssert.assertFalse(\"The component incorrectly invalidated when setting minHeight, but component has explicitHeight\", this._control.isInvalid());\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoInvalidationWhenSettingMinWidthWithLargerActualWidth():void\n\t\t{\n\t\t\tthis._control.addChild(new Quad(EXPLICIT_SIZE_LARGER_THAN_MAX_SIZE, EXPLICIT_SIZE_LARGER_THAN_MAX_SIZE, 0xff00ff));\n\t\t\tthis._control.validate();\n\t\t\tthis._control.minWidth = MIN_SIZE;\n\t\t\tAssert.assertFalse(\"The component incorrectly invalidated when setting minWidth, but component actualWidth is currently larger\", this._control.isInvalid());\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoInvalidationWhenSettingMinHeightWithLargerActualHeight():void\n\t\t{\n\t\t\tthis._control.addChild(new Quad(EXPLICIT_SIZE_LARGER_THAN_MAX_SIZE, EXPLICIT_SIZE_LARGER_THAN_MAX_SIZE, 0xff00ff));\n\t\t\tthis._control.validate();\n\t\t\tthis._control.minHeight = MIN_SIZE;\n\t\t\tAssert.assertFalse(\"The component incorrectly invalidated when setting minHeight, but component actualHeight is currently larger\", this._control.isInvalid());\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoInvalidationWhenSettingMinWidthEqualToActualWidth():void\n\t\t{\n\t\t\tthis._control.addChild(new Quad(MIN_SIZE, MIN_SIZE, 0xff00ff));\n\t\t\tthis._control.validate();\n\t\t\tthis._control.minWidth = MIN_SIZE;\n\t\t\tAssert.assertFalse(\"The component incorrectly invalidated when setting minWidth, but component actualWidth is equal\", this._control.isInvalid());\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoInvalidationWhenSettingMinHeightEqualToActualHeight():void\n\t\t{\n\t\t\tthis._control.addChild(new Quad(MIN_SIZE, MIN_SIZE, 0xff00ff));\n\t\t\tthis._control.validate();\n\t\t\tthis._control.minHeight = MIN_SIZE;\n\t\t\tAssert.assertFalse(\"The component incorrectly invalidated when setting minHeight, but component actualHeight is equal\", this._control.isInvalid());\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoInvalidationWhenSettingMaxWidthWithExplicitWidth():void\n\t\t{\n\t\t\tthis._control.width = EXPLICIT_SIZE_LARGER_THAN_MAX_SIZE;\n\t\t\tthis._control.validate();\n\t\t\tthis._control.maxWidth = MAX_SIZE;\n\t\t\tAssert.assertFalse(\"The component incorrectly invalidated when setting maxWidth, but component has explicitWidth\", this._control.isInvalid());\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoInvalidationWhenSettingMaxHeightWithExplicitHeight():void\n\t\t{\n\t\t\tthis._control.height = EXPLICIT_SIZE_LARGER_THAN_MAX_SIZE;\n\t\t\tthis._control.validate();\n\t\t\tthis._control.maxHeight = MAX_SIZE;\n\t\t\tAssert.assertFalse(\"The component incorrectly invalidated when setting maxHeight, but component has explicitHeight\", this._control.isInvalid());\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoInvalidationWhenSettingMaxWidthWithSmallerActualWidth():void\n\t\t{\n\t\t\tthis._control.addChild(new Quad(EXPLICIT_SIZE_SMALLER_THAN_MIN_SIZE, EXPLICIT_SIZE_SMALLER_THAN_MIN_SIZE, 0xff00ff));\n\t\t\tthis._control.validate();\n\t\t\tthis._control.maxWidth = MAX_SIZE;\n\t\t\tAssert.assertFalse(\"The component incorrectly invalidated when setting maxWidth, but component actualWidth is currently smaller\", this._control.isInvalid());\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoInvalidationWhenSettingMaxHeightWithSmallerActualHeight():void\n\t\t{\n\t\t\tthis._control.addChild(new Quad(EXPLICIT_SIZE_SMALLER_THAN_MIN_SIZE, EXPLICIT_SIZE_SMALLER_THAN_MIN_SIZE, 0xff00ff));\n\t\t\tthis._control.validate();\n\t\t\tthis._control.maxHeight = MAX_SIZE;\n\t\t\tAssert.assertFalse(\"The component incorrectly invalidated when setting maxHeight, but component actualHeight is currently smaller\", this._control.isInvalid());\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoInvalidationWhenSettingMaxWidthEqualToActualWidth():void\n\t\t{\n\t\t\tthis._control.addChild(new Quad(MAX_SIZE, MAX_SIZE, 0xff00ff));\n\t\t\tthis._control.validate();\n\t\t\tthis._control.maxWidth = MAX_SIZE;\n\t\t\tAssert.assertFalse(\"The component incorrectly invalidated when setting maxWidth, but component actualWidth is equal\", this._control.isInvalid());\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoInvalidationWhenSettingMaxHeightEqualToActualHeight():void\n\t\t{\n\t\t\tthis._control.addChild(new Quad(MAX_SIZE, MAX_SIZE, 0xff00ff));\n\t\t\tthis._control.validate();\n\t\t\tthis._control.maxHeight = MAX_SIZE;\n\t\t\tAssert.assertFalse(\"The component incorrectly invalidated when setting maxHeight, but component actualHeight is equal\", this._control.isInvalid());\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInvalidAfterSettingMinWidthLargerThanActualWidth():void\n\t\t{\n\t\t\tthis._control.backgroundSkin = new Quad(40, 50);\n\t\t\tthis._control.validate();\n\t\t\tthis._control.minWidth = 183;\n\t\t\tAssert.assertTrue(\"The component failed to set invalidate flag after setting minWidth larger than actualWidth\",\n\t\t\t\tthis._control.isInvalid());\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInvalidAfterSettingMinHeightLargerThanActualHeight():void\n\t\t{\n\t\t\tthis._control.backgroundSkin = new Quad(40, 50);\n\t\t\tthis._control.validate();\n\t\t\tthis._control.minHeight = 183;\n\t\t\tAssert.assertTrue(\"The component failed to set invalidate flag after setting minHeight larger than actualHeight\",\n\t\t\t\tthis._control.isInvalid());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/NumericStepperMeasurementTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.NumericStepper;\n\timport feathers.controls.StepperButtonLayoutMode;\n\timport feathers.controls.TextInput;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class NumericStepperMeasurementTests\n\t{\n\t\tprivate static const TEXT_INPUT_GAP:Number = 8;\n\t\tprivate static const BUTTON_GAP:Number = 3;\n\t\tprivate static const LARGER_SIZE:Number = 300;\n\t\tprivate static const LARGER_SIZE2:Number = 250;\n\t\tprivate static const SMALLER_SIZE:Number = 100;\n\t\tprivate static const SMALLER_SIZE2:Number = 90;\n\t\t\n\t\tprivate var _stepper:NumericStepper;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._stepper = new NumericStepper();\n\t\t\tTestFeathers.starlingRoot.addChild(this._stepper);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._stepper.removeFromParent(true);\n\t\t\tthis._stepper = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWidthWithButtonLayoutModeRightSideVertical():void\n\t\t{\n\t\t\tthis._stepper.buttonLayoutMode = StepperButtonLayoutMode.RIGHT_SIDE_VERTICAL;\n\t\t\tthis._stepper.textInputGap = TEXT_INPUT_GAP;\n\t\t\tthis._stepper.buttonGap = BUTTON_GAP;\n\t\t\tthis._stepper.textInputFactory = function():TextInput\n\t\t\t{\n\t\t\t\tvar input:TextInput = new TextInput();\n\t\t\t\tinput.backgroundSkin = new Quad(LARGER_SIZE, 1, 0xff00ff);\n\t\t\t\treturn input;\n\t\t\t};\n\t\t\tthis._stepper.incrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(SMALLER_SIZE, 1, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.decrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(SMALLER_SIZE2, 1, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the NumericStepper was not calculated correctly with buttonLayoutMode set to right side vertical.\",\n\t\t\t\tLARGER_SIZE + SMALLER_SIZE + TEXT_INPUT_GAP, this._stepper.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeHeightWithButtonLayoutModeRightSideVerticalAndLargerTextInput():void\n\t\t{\n\t\t\tthis._stepper.buttonLayoutMode = StepperButtonLayoutMode.RIGHT_SIDE_VERTICAL;\n\t\t\tthis._stepper.textInputGap = TEXT_INPUT_GAP;\n\t\t\tthis._stepper.buttonGap = BUTTON_GAP;\n\t\t\tthis._stepper.textInputFactory = function():TextInput\n\t\t\t{\n\t\t\t\tvar input:TextInput = new TextInput();\n\t\t\t\tinput.backgroundSkin = new Quad(1, LARGER_SIZE, 0xff00ff);\n\t\t\t\treturn input;\n\t\t\t};\n\t\t\tthis._stepper.incrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(1, SMALLER_SIZE, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.decrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(1, SMALLER_SIZE2, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The height of the NumericStepper was not calculated correctly with buttonLayoutMode set to right side vertical and a larger text input.\",\n\t\t\t\tLARGER_SIZE, this._stepper.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeHeightWithButtonLayoutModeRightSideVerticalAndSmallerTextInput():void\n\t\t{\n\t\t\tthis._stepper.buttonLayoutMode = StepperButtonLayoutMode.RIGHT_SIDE_VERTICAL;\n\t\t\tthis._stepper.textInputGap = TEXT_INPUT_GAP;\n\t\t\tthis._stepper.buttonGap = BUTTON_GAP;\n\t\t\tthis._stepper.textInputFactory = function():TextInput\n\t\t\t{\n\t\t\t\tvar input:TextInput = new TextInput();\n\t\t\t\tinput.backgroundSkin = new Quad(1, SMALLER_SIZE, 0xff00ff);\n\t\t\t\treturn input;\n\t\t\t};\n\t\t\tthis._stepper.incrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(1, LARGER_SIZE, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.decrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(1, SMALLER_SIZE2, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The height of the NumericStepper was not calculated correctly with buttonLayoutMode set to right side vertical and a smaller text input.\",\n\t\t\t\tLARGER_SIZE + SMALLER_SIZE2 + BUTTON_GAP, this._stepper.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeMinWidthWithButtonLayoutModeRightSideVertical():void\n\t\t{\n\t\t\tthis._stepper.buttonLayoutMode = StepperButtonLayoutMode.RIGHT_SIDE_VERTICAL;\n\t\t\tthis._stepper.textInputGap = TEXT_INPUT_GAP;\n\t\t\tthis._stepper.buttonGap = BUTTON_GAP;\n\t\t\tthis._stepper.textInputFactory = function():TextInput\n\t\t\t{\n\t\t\t\tvar input:TextInput = new TextInput();\n\t\t\t\tinput.backgroundSkin = new Quad(1, 1, 0xff00ff);\n\t\t\t\tinput.minWidth = LARGER_SIZE;\n\t\t\t\treturn input;\n\t\t\t};\n\t\t\tthis._stepper.incrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(1, 1, 0xffff00);\n\t\t\t\tbutton.minWidth = SMALLER_SIZE;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.decrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(1, 1, 0x00ffff);\n\t\t\t\tbutton.minWidth = SMALLER_SIZE2;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the NumericStepper was not calculated correctly with buttonLayoutMode set to right side vertical.\",\n\t\t\t\tLARGER_SIZE + SMALLER_SIZE + TEXT_INPUT_GAP, this._stepper.minWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeMinHeightWithButtonLayoutModeRightSideVerticalAndLargerTextInput():void\n\t\t{\n\t\t\tthis._stepper.buttonLayoutMode = StepperButtonLayoutMode.RIGHT_SIDE_VERTICAL;\n\t\t\tthis._stepper.textInputGap = TEXT_INPUT_GAP;\n\t\t\tthis._stepper.buttonGap = BUTTON_GAP;\n\t\t\tthis._stepper.textInputFactory = function():TextInput\n\t\t\t{\n\t\t\t\tvar input:TextInput = new TextInput();\n\t\t\t\tinput.backgroundSkin = new Quad(1, 1, 0xff00ff);\n\t\t\t\tinput.minHeight = LARGER_SIZE;\n\t\t\t\treturn input;\n\t\t\t};\n\t\t\tthis._stepper.incrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(1, 1, 0xffff00);\n\t\t\t\tbutton.minHeight = SMALLER_SIZE;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.decrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(1, 1, 0x00ffff);\n\t\t\t\tbutton.minHeight = SMALLER_SIZE2;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the NumericStepper was not calculated correctly with buttonLayoutMode set to right side vertical and a larger text input.\",\n\t\t\t\tLARGER_SIZE, this._stepper.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeMinHeightWithButtonLayoutModeRightSideVerticalAndSmallerTextInput():void\n\t\t{\n\t\t\tthis._stepper.buttonLayoutMode = StepperButtonLayoutMode.RIGHT_SIDE_VERTICAL;\n\t\t\tthis._stepper.textInputGap = TEXT_INPUT_GAP;\n\t\t\tthis._stepper.buttonGap = BUTTON_GAP;\n\t\t\tthis._stepper.textInputFactory = function():TextInput\n\t\t\t{\n\t\t\t\tvar input:TextInput = new TextInput();\n\t\t\t\tinput.backgroundSkin = new Quad(1, 1, 0xff00ff);\n\t\t\t\tinput.minHeight = SMALLER_SIZE;\n\t\t\t\treturn input;\n\t\t\t};\n\t\t\tthis._stepper.incrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(1, 1, 0xffff00);\n\t\t\t\tbutton.minHeight = LARGER_SIZE;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.decrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(1, 1, 0x00ffff);\n\t\t\t\tbutton.minHeight = SMALLER_SIZE2;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the NumericStepper was not calculated correctly with buttonLayoutMode set to right side vertical and a smaller text input.\",\n\t\t\t\tLARGER_SIZE + SMALLER_SIZE2 + BUTTON_GAP, this._stepper.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWidthWithButtonLayoutModeSplitVerticalAndLargerTextInput():void\n\t\t{\n\t\t\tthis._stepper.buttonLayoutMode = StepperButtonLayoutMode.SPLIT_VERTICAL;\n\t\t\tthis._stepper.textInputGap = TEXT_INPUT_GAP;\n\t\t\tthis._stepper.textInputFactory = function():TextInput\n\t\t\t{\n\t\t\t\tvar input:TextInput = new TextInput();\n\t\t\t\tinput.backgroundSkin = new Quad(LARGER_SIZE, 1, 0xff00ff);\n\t\t\t\treturn input;\n\t\t\t};\n\t\t\tthis._stepper.incrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(SMALLER_SIZE, 1, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.decrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(SMALLER_SIZE2, 1, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the NumericStepper was not calculated correctly with buttonLayoutMode set to split vertical and a larger text input.\",\n\t\t\t\tLARGER_SIZE, this._stepper.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWidthWithButtonLayoutModeSplitVerticalAndSmallerTextInput():void\n\t\t{\n\t\t\tthis._stepper.buttonLayoutMode = StepperButtonLayoutMode.SPLIT_VERTICAL;\n\t\t\tthis._stepper.textInputGap = TEXT_INPUT_GAP;\n\t\t\tthis._stepper.textInputFactory = function():TextInput\n\t\t\t{\n\t\t\t\tvar input:TextInput = new TextInput();\n\t\t\t\tinput.backgroundSkin = new Quad(SMALLER_SIZE, 1, 0xff00ff);\n\t\t\t\treturn input;\n\t\t\t};\n\t\t\tthis._stepper.incrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(LARGER_SIZE, 1, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.decrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(LARGER_SIZE2, 1, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the NumericStepper was not calculated correctly with buttonLayoutMode set to split vertical and a smaller text input.\",\n\t\t\t\tLARGER_SIZE, this._stepper.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeHeightWithButtonLayoutModeSplitVertical():void\n\t\t{\n\t\t\tthis._stepper.buttonLayoutMode = StepperButtonLayoutMode.SPLIT_VERTICAL;\n\t\t\tthis._stepper.textInputGap = TEXT_INPUT_GAP;\n\t\t\tthis._stepper.textInputFactory = function():TextInput\n\t\t\t{\n\t\t\t\tvar input:TextInput = new TextInput();\n\t\t\t\tinput.backgroundSkin = new Quad(1, LARGER_SIZE, 0xff00ff);\n\t\t\t\treturn input;\n\t\t\t};\n\t\t\tthis._stepper.incrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(1, SMALLER_SIZE, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.decrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(1, SMALLER_SIZE2, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The height of the NumericStepper was not calculated correctly with buttonLayoutMode set to split vertical.\",\n\t\t\t\tSMALLER_SIZE + SMALLER_SIZE2 + LARGER_SIZE + TEXT_INPUT_GAP * 2, this._stepper.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeMinWidthWithButtonLayoutModeSplitVerticalAndLargerTextInput():void\n\t\t{\n\t\t\tthis._stepper.buttonLayoutMode = StepperButtonLayoutMode.SPLIT_VERTICAL;\n\t\t\tthis._stepper.textInputGap = TEXT_INPUT_GAP;\n\t\t\tthis._stepper.textInputFactory = function():TextInput\n\t\t\t{\n\t\t\t\tvar input:TextInput = new TextInput();\n\t\t\t\tinput.backgroundSkin = new Quad(1, 1, 0xff00ff);\n\t\t\t\tinput.minWidth = LARGER_SIZE;\n\t\t\t\treturn input;\n\t\t\t};\n\t\t\tthis._stepper.incrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(1, 1, 0xffff00);\n\t\t\t\tbutton.minWidth = SMALLER_SIZE;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.decrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(1, 1, 0x00ffff);\n\t\t\t\tbutton.minWidth = SMALLER_SIZE2;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the NumericStepper was not calculated correctly with buttonLayoutMode set to split vertical and a larger text input.\",\n\t\t\t\tLARGER_SIZE, this._stepper.minWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeMinWidthWithButtonLayoutModeSplitVerticalAndSmallerTextInput():void\n\t\t{\n\t\t\tthis._stepper.buttonLayoutMode = StepperButtonLayoutMode.SPLIT_VERTICAL;\n\t\t\tthis._stepper.textInputGap = TEXT_INPUT_GAP;\n\t\t\tthis._stepper.textInputFactory = function():TextInput\n\t\t\t{\n\t\t\t\tvar input:TextInput = new TextInput();\n\t\t\t\tinput.backgroundSkin = new Quad(1, 1, 0xff00ff);\n\t\t\t\tinput.minWidth = SMALLER_SIZE;\n\t\t\t\treturn input;\n\t\t\t};\n\t\t\tthis._stepper.incrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(1, 1, 0xffff00);\n\t\t\t\tbutton.minWidth = LARGER_SIZE;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.decrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(1, 1, 0x00ffff);\n\t\t\t\tbutton.minWidth = LARGER_SIZE;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the NumericStepper was not calculated correctly with buttonLayoutMode set to split vertical and a smaller text input.\",\n\t\t\t\tLARGER_SIZE, this._stepper.minWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeMinHeightWithButtonLayoutModeSplitVertical():void\n\t\t{\n\t\t\tthis._stepper.buttonLayoutMode = StepperButtonLayoutMode.SPLIT_VERTICAL;\n\t\t\tthis._stepper.textInputGap = TEXT_INPUT_GAP;\n\t\t\tthis._stepper.textInputFactory = function():TextInput\n\t\t\t{\n\t\t\t\tvar input:TextInput = new TextInput();\n\t\t\t\tinput.backgroundSkin = new Quad(1, 1, 0xff00ff);\n\t\t\t\tinput.minHeight = LARGER_SIZE;\n\t\t\t\treturn input;\n\t\t\t};\n\t\t\tthis._stepper.incrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(1, 1, 0xffff00);\n\t\t\t\tbutton.minHeight = SMALLER_SIZE;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.decrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(1, 1, 0x00ffff);\n\t\t\t\tbutton.minHeight = SMALLER_SIZE2;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the NumericStepper was not calculated correctly with buttonLayoutMode set to split vertical.\",\n\t\t\t\tSMALLER_SIZE + SMALLER_SIZE2 + LARGER_SIZE + TEXT_INPUT_GAP * 2, this._stepper.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWidthWithButtonLayoutModeSplitHorizontal():void\n\t\t{\n\t\t\tthis._stepper.buttonLayoutMode = StepperButtonLayoutMode.SPLIT_HORIZONTAL;\n\t\t\tthis._stepper.textInputGap = TEXT_INPUT_GAP;\n\t\t\tthis._stepper.textInputFactory = function():TextInput\n\t\t\t{\n\t\t\t\tvar input:TextInput = new TextInput();\n\t\t\t\tinput.backgroundSkin = new Quad(LARGER_SIZE, 1, 0xff00ff);\n\t\t\t\treturn input;\n\t\t\t};\n\t\t\tthis._stepper.incrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(SMALLER_SIZE, 1, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.decrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(SMALLER_SIZE2, 1, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the NumericStepper was not calculated correctly with buttonLayoutMode set to split horizontal.\",\n\t\t\t\tSMALLER_SIZE + SMALLER_SIZE2 + LARGER_SIZE + TEXT_INPUT_GAP * 2, this._stepper.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeHeightWithButtonLayoutModeSplitHorizontalAndLargerTextInput():void\n\t\t{\n\t\t\tthis._stepper.buttonLayoutMode = StepperButtonLayoutMode.SPLIT_HORIZONTAL;\n\t\t\tthis._stepper.textInputGap = TEXT_INPUT_GAP;\n\t\t\tthis._stepper.textInputFactory = function():TextInput\n\t\t\t{\n\t\t\t\tvar input:TextInput = new TextInput();\n\t\t\t\tinput.backgroundSkin = new Quad(1, LARGER_SIZE, 0xff00ff);\n\t\t\t\treturn input;\n\t\t\t};\n\t\t\tthis._stepper.incrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(1, SMALLER_SIZE, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.decrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(1, SMALLER_SIZE2, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The height of the NumericStepper was not calculated correctly with buttonLayoutMode set to split horizontal and a larger text input.\",\n\t\t\t\tLARGER_SIZE, this._stepper.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeHeightWithButtonLayoutModeSplitHorizontalAndSmallerTextInput():void\n\t\t{\n\t\t\tthis._stepper.buttonLayoutMode = StepperButtonLayoutMode.SPLIT_HORIZONTAL;\n\t\t\tthis._stepper.textInputGap = TEXT_INPUT_GAP;\n\t\t\tthis._stepper.textInputFactory = function():TextInput\n\t\t\t{\n\t\t\t\tvar input:TextInput = new TextInput();\n\t\t\t\tinput.backgroundSkin = new Quad(1, SMALLER_SIZE, 0xff00ff);\n\t\t\t\tinput.minHeight = SMALLER_SIZE;\n\t\t\t\treturn input;\n\t\t\t};\n\t\t\tthis._stepper.incrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(1, LARGER_SIZE, 0xffff00);\n\t\t\t\tbutton.minHeight = LARGER_SIZE;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.decrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(1, LARGER_SIZE2, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The height of the NumericStepper was not calculated correctly with buttonLayoutMode set to split horizontal and a smaller text input.\",\n\t\t\t\tLARGER_SIZE, this._stepper.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeMinWidthWithButtonLayoutModeSplitHorizontal():void\n\t\t{\n\t\t\tthis._stepper.buttonLayoutMode = StepperButtonLayoutMode.SPLIT_HORIZONTAL;\n\t\t\tthis._stepper.textInputGap = TEXT_INPUT_GAP;\n\t\t\tthis._stepper.textInputFactory = function():TextInput\n\t\t\t{\n\t\t\t\tvar input:TextInput = new TextInput();\n\t\t\t\tinput.backgroundSkin = new Quad(1, 1, 0xff00ff);\n\t\t\t\tinput.minWidth = LARGER_SIZE;\n\t\t\t\treturn input;\n\t\t\t};\n\t\t\tthis._stepper.incrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(1, 1, 0xffff00);\n\t\t\t\tbutton.minWidth = SMALLER_SIZE;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.decrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(1, 1, 0x00ffff);\n\t\t\t\tbutton.minWidth = SMALLER_SIZE2;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the NumericStepper was not calculated correctly with buttonLayoutMode set to split horizontal.\",\n\t\t\t\tSMALLER_SIZE + SMALLER_SIZE2 + LARGER_SIZE + TEXT_INPUT_GAP * 2, this._stepper.minWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeMinHeightWithButtonLayoutModeSplitHorizontalAndLargerTextInput():void\n\t\t{\n\t\t\tthis._stepper.buttonLayoutMode = StepperButtonLayoutMode.SPLIT_HORIZONTAL;\n\t\t\tthis._stepper.textInputGap = TEXT_INPUT_GAP;\n\t\t\tthis._stepper.textInputFactory = function():TextInput\n\t\t\t{\n\t\t\t\tvar input:TextInput = new TextInput();\n\t\t\t\tinput.backgroundSkin = new Quad(1, 1, 0xff00ff);\n\t\t\t\tinput.minHeight = LARGER_SIZE;\n\t\t\t\treturn input;\n\t\t\t};\n\t\t\tthis._stepper.incrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(1, 1, 0xffff00);\n\t\t\t\tbutton.minHeight = SMALLER_SIZE;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.decrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(1, 1, 0x00ffff);\n\t\t\t\tbutton.minHeight = SMALLER_SIZE2;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the NumericStepper was not calculated correctly with buttonLayoutMode set to split horizontal and a larger text input.\",\n\t\t\t\tLARGER_SIZE, this._stepper.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeMinHeightWithButtonLayoutModeSplitHorizontalAndSmallerTextInput():void\n\t\t{\n\t\t\tthis._stepper.buttonLayoutMode = StepperButtonLayoutMode.SPLIT_HORIZONTAL;\n\t\t\tthis._stepper.textInputGap = TEXT_INPUT_GAP;\n\t\t\tthis._stepper.textInputFactory = function():TextInput\n\t\t\t{\n\t\t\t\tvar input:TextInput = new TextInput();\n\t\t\t\tinput.backgroundSkin = new Quad(1, 1, 0xff00ff);\n\t\t\t\tinput.minHeight = SMALLER_SIZE;\n\t\t\t\treturn input;\n\t\t\t};\n\t\t\tthis._stepper.incrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(1, 1, 0xffff00);\n\t\t\t\tbutton.minHeight = LARGER_SIZE;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.decrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.defaultSkin = new Quad(1, 1, 0x00ffff);\n\t\t\t\tbutton.minHeight = LARGER_SIZE2;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._stepper.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the NumericStepper was not calculated correctly with buttonLayoutMode set to split horizontal and a smaller text input.\",\n\t\t\t\tLARGER_SIZE, this._stepper.minHeight);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/PageIndicatorMeasurementTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.PageIndicator;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class PageIndicatorMeasurementTests\n\t{\n\t\tprivate static const SYMBOL_WIDTH:Number = 20;\n\t\tprivate static const SYMBOL_HEIGHT:Number = 16;\n\t\tprivate static const GAP:Number = 4;\n\n\t\tprivate static const PADDING_TOP:Number = 4;\n\t\tprivate static const PADDING_RIGHT:Number = 10;\n\t\tprivate static const PADDING_BOTTOM:Number = 3;\n\t\tprivate static const PADDING_LEFT:Number = 16;\n\t\t\n\t\tprivate var _pages:PageIndicator;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._pages = new PageIndicator();\n\t\t\tthis._pages.normalSymbolFactory = function():Quad\n\t\t\t{\n\t\t\t\treturn new Quad(SYMBOL_WIDTH, SYMBOL_HEIGHT, 0xff00ff);\n\t\t\t};\n\t\t\tthis._pages.selectedSymbolFactory = function():Quad\n\t\t\t{\n\t\t\t\treturn new Quad(SYMBOL_WIDTH, SYMBOL_HEIGHT, 0xff00ff);\n\t\t\t};\n\t\t\tTestFeathers.starlingRoot.addChild(this._pages);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._pages.removeFromParent(true);\n\t\t\tthis._pages = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSize():void\n\t\t{\n\t\t\tthis._pages.pageCount = 5;\n\t\t\tthis._pages.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the page indicator was not calculated correctly based on the width of the symbols.\",\n\t\t\t\tSYMBOL_WIDTH * this._pages.pageCount, this._pages.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the progress bar was not calculated correctly based on the height of the symbols.\",\n\t\t\t\tSYMBOL_HEIGHT, this._pages.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the progress bar was not calculated correctly based on the width of the symbols.\",\n\t\t\t\tSYMBOL_WIDTH * this._pages.pageCount, this._pages.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the progress bar was not calculated correctly based on the height of the symbols.\",\n\t\t\t\tSYMBOL_HEIGHT, this._pages.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithGap():void\n\t\t{\n\t\t\tthis._pages.pageCount = 5;\n\t\t\tthis._pages.gap = GAP;\n\t\t\tthis._pages.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the page indicator was not calculated correctly based on the width of the symbols and the gap.\",\n\t\t\t\t(SYMBOL_WIDTH + GAP) * this._pages.pageCount - GAP, this._pages.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the progress bar was not calculated correctly based on the height of the symbols.\",\n\t\t\t\tSYMBOL_HEIGHT, this._pages.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the progress bar was not calculated correctly based on the width of the symbols and the gap.\",\n\t\t\t\t(SYMBOL_WIDTH + GAP) * this._pages.pageCount - GAP, this._pages.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the progress bar was not calculated correctly based on the height of the symbols.\",\n\t\t\t\tSYMBOL_HEIGHT, this._pages.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithPadding():void\n\t\t{\n\t\t\tthis._pages.pageCount = 5;\n\t\t\tthis._pages.paddingTop = PADDING_TOP;\n\t\t\tthis._pages.paddingRight = PADDING_RIGHT;\n\t\t\tthis._pages.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._pages.paddingLeft = PADDING_LEFT;\n\t\t\tthis._pages.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the page indicator was not calculated correctly based on the width of the symbols plus padding left and padding right.\",\n\t\t\t\tSYMBOL_WIDTH * this._pages.pageCount + PADDING_LEFT + PADDING_RIGHT, this._pages.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the progress bar was not calculated correctly based on the height of the symbols plus padding top and padding bottom.\",\n\t\t\t\tSYMBOL_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._pages.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the progress bar was not calculated correctly based on the width of the symbols plus padding left and padding right.\",\n\t\t\t\tSYMBOL_WIDTH * this._pages.pageCount + PADDING_LEFT + PADDING_RIGHT, this._pages.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the progress bar was not calculated correctly based on the height of the symbols plus padding top and padding bottom.\",\n\t\t\t\tSYMBOL_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._pages.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithGapAndPadding():void\n\t\t{\n\t\t\tthis._pages.pageCount = 5;\n\t\t\tthis._pages.gap = GAP;\n\t\t\tthis._pages.paddingTop = PADDING_TOP;\n\t\t\tthis._pages.paddingRight = PADDING_RIGHT;\n\t\t\tthis._pages.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._pages.paddingLeft = PADDING_LEFT;\n\t\t\tthis._pages.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the page indicator was not calculated correctly based on the width of the symbols plus the gap plus padding left and padding right.\",\n\t\t\t\t(SYMBOL_WIDTH + GAP) * this._pages.pageCount - GAP + PADDING_LEFT + PADDING_RIGHT, this._pages.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the progress bar was not calculated correctly based on the height of the symbols plus padding top and padding bottom.\",\n\t\t\t\tSYMBOL_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._pages.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the progress bar was not calculated correctly based on the width of the symbols plus the gap plus padding left and padding right.\",\n\t\t\t\t(SYMBOL_WIDTH + GAP) * this._pages.pageCount - GAP + PADDING_LEFT + PADDING_RIGHT, this._pages.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the progress bar was not calculated correctly based on the height of the symbols plus padding top and padding bottom.\",\n\t\t\t\tSYMBOL_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._pages.minHeight);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/PanelMeasurementTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.Panel;\n\timport feathers.core.IFeathersControl;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class PanelMeasurementTests\n\t{\n\t\tprivate static const BACKGROUND_WIDTH:Number = 200;\n\t\tprivate static const BACKGROUND_HEIGHT:Number = 250;\n\n\t\tprivate static const COMPLEX_BACKGROUND_WIDTH:Number = 340;\n\t\tprivate static const COMPLEX_BACKGROUND_HEIGHT:Number = 350;\n\t\tprivate static const COMPLEX_BACKGROUND_MIN_WIDTH:Number = 280;\n\t\tprivate static const COMPLEX_BACKGROUND_MIN_HEIGHT:Number = 290;\n\n\t\tprivate static const PADDING_TOP:Number = 50;\n\t\tprivate static const PADDING_RIGHT:Number = 54;\n\t\tprivate static const PADDING_BOTTOM:Number = 59;\n\t\tprivate static const PADDING_LEFT:Number = 60;\n\n\t\tprivate static const OUTER_PADDING_TOP:Number = 40;\n\t\tprivate static const OUTER_PADDING_RIGHT:Number = 64;\n\t\tprivate static const OUTER_PADDING_BOTTOM:Number = 69;\n\t\tprivate static const OUTER_PADDING_LEFT:Number = 50;\n\t\t\n\t\tprivate static const HEADER_WIDTH:Number = 150;\n\t\tprivate static const HEADER_HEIGHT:Number = 40;\n\n\t\tprivate static const FOOTER_WIDTH:Number = 160;\n\t\tprivate static const FOOTER_HEIGHT:Number = 30;\n\n\t\tprivate static const SMALL_ITEM_WIDTH:Number = 120;\n\t\tprivate static const LARGE_ITEM_WIDTH:Number = 180;\n\t\tprivate static const ITEM_HEIGHT:Number = 60;\n\n\t\tprivate static const LARGE_HEADER_WIDTH:Number = 550;\n\n\t\tprivate var _panel:Panel;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._panel = new Panel();\n\t\t\tTestFeathers.starlingRoot.addChild(this._panel);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._panel.removeFromParent(true);\n\t\t\tthis._panel = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\tprivate function addSimpleBackground():void\n\t\t{\n\t\t\tthis._panel.backgroundSkin = new Quad(BACKGROUND_WIDTH, BACKGROUND_HEIGHT, 0xff00ff);\n\t\t}\n\n\t\tprivate function addComplexBackground():void\n\t\t{\n\t\t\tvar backgroundSkin:LayoutGroup = new LayoutGroup();\n\t\t\tbackgroundSkin.width = COMPLEX_BACKGROUND_WIDTH;\n\t\t\tbackgroundSkin.height = COMPLEX_BACKGROUND_HEIGHT;\n\t\t\tbackgroundSkin.minWidth = COMPLEX_BACKGROUND_MIN_WIDTH;\n\t\t\tbackgroundSkin.minHeight = COMPLEX_BACKGROUND_MIN_HEIGHT;\n\t\t\tthis._panel.backgroundSkin = backgroundSkin;\n\t\t}\n\n\t\tprivate function addHeader():void\n\t\t{\n\t\t\tthis._panel.headerFactory = function():IFeathersControl\n\t\t\t{\n\t\t\t\tvar header:LayoutGroup = new LayoutGroup();\n\t\t\t\theader.backgroundSkin = new Quad(HEADER_WIDTH, HEADER_HEIGHT, 0xff00ff);\n\t\t\t\treturn header;\n\t\t\t};\n\t\t}\n\n\t\tprivate function addWideHeader():void\n\t\t{\n\t\t\tthis._panel.headerFactory = function():IFeathersControl\n\t\t\t{\n\t\t\t\tvar header:LayoutGroup = new LayoutGroup();\n\t\t\t\theader.backgroundSkin = new Quad(LARGE_HEADER_WIDTH, HEADER_HEIGHT, 0xff00ff);\n\t\t\t\treturn header;\n\t\t\t};\n\t\t}\n\n\t\tprivate function addFooter():void\n\t\t{\n\t\t\tthis._panel.footerFactory = function():IFeathersControl\n\t\t\t{\n\t\t\t\tvar footer:LayoutGroup = new LayoutGroup();\n\t\t\t\tfooter.backgroundSkin = new Quad(FOOTER_WIDTH, FOOTER_HEIGHT, 0x00ff00);\n\t\t\t\treturn footer;\n\t\t\t};\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithHeader():void\n\t\t{\n\t\t\tthis.addHeader();\n\t\t\tthis._panel.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Panel was not calculated correctly with a header.\",\n\t\t\t\tHEADER_WIDTH, this._panel.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Panel was not calculated correctly with a header.\",\n\t\t\t\tHEADER_HEIGHT, this._panel.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Panel was not calculated correctly with a header.\",\n\t\t\t\tHEADER_WIDTH, this._panel.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Panel was not calculated correctly with a header.\",\n\t\t\t\tHEADER_HEIGHT, this._panel.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithHeaderAndPadding():void\n\t\t{\n\t\t\tthis.addHeader();\n\t\t\tthis._panel.paddingTop = PADDING_TOP;\n\t\t\tthis._panel.paddingRight = PADDING_RIGHT;\n\t\t\tthis._panel.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._panel.paddingLeft = PADDING_LEFT;\n\t\t\tthis._panel.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Panel was not calculated correctly based on the header and left and right padding.\",\n\t\t\t\tHEADER_WIDTH, this._panel.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Panel was not calculated correctly based on the header and top and bottom padding.\",\n\t\t\t\tHEADER_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._panel.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Panel was not calculated correctly based on the header and left and right padding.\",\n\t\t\t\tHEADER_WIDTH, this._panel.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Panel was not calculated correctly based on the header and top and bottom padding.\",\n\t\t\t\tHEADER_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._panel.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithHeaderAndOuterPadding():void\n\t\t{\n\t\t\tthis.addHeader();\n\t\t\tthis._panel.outerPaddingTop = OUTER_PADDING_TOP;\n\t\t\tthis._panel.outerPaddingRight = OUTER_PADDING_RIGHT;\n\t\t\tthis._panel.outerPaddingBottom = OUTER_PADDING_BOTTOM;\n\t\t\tthis._panel.outerPaddingLeft = OUTER_PADDING_LEFT;\n\t\t\tthis._panel.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Panel was not calculated correctly based on the header and left and right outer padding.\",\n\t\t\t\tHEADER_WIDTH + OUTER_PADDING_LEFT + OUTER_PADDING_RIGHT, this._panel.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Panel was not calculated correctly based on the header and top and bottom outer padding.\",\n\t\t\t\tHEADER_HEIGHT + OUTER_PADDING_TOP + OUTER_PADDING_BOTTOM, this._panel.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Panel was not calculated correctly based on the header and left and right outer padding.\",\n\t\t\t\tHEADER_WIDTH + OUTER_PADDING_LEFT + OUTER_PADDING_RIGHT, this._panel.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Panel was not calculated correctly based on the header and top and bottom outer padding.\",\n\t\t\t\tHEADER_HEIGHT + OUTER_PADDING_TOP + OUTER_PADDING_BOTTOM, this._panel.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithHeaderAndSimpleBackgroundSkin():void\n\t\t{\n\t\t\tthis.addHeader();\n\t\t\tthis.addSimpleBackground();\n\t\t\tthis._panel.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Panel was not calculated correctly based on the background width larger than the header width.\",\n\t\t\t\tBACKGROUND_WIDTH, this._panel.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Panel was not calculated correctly based on the background height.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._panel.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Panel was not calculated correctly based on the background width larger than the header width.\",\n\t\t\t\tBACKGROUND_WIDTH, this._panel.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Panel was not calculated correctly based on the background height.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._panel.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithHeaderAndComplexBackground():void\n\t\t{\n\t\t\tthis.addHeader();\n\t\t\tthis.addComplexBackground();\n\t\t\tthis._panel.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Panel was not calculated correctly based on the complex background width.\",\n\t\t\t\tCOMPLEX_BACKGROUND_WIDTH, this._panel.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Panel was not calculated correctly based on the complex background height.\",\n\t\t\t\tCOMPLEX_BACKGROUND_HEIGHT, this._panel.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Panel was not calculated correctly based on the complex background minWidth.\",\n\t\t\t\tCOMPLEX_BACKGROUND_MIN_WIDTH, this._panel.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Panel was not calculated correctly based on the complex background minHeight.\",\n\t\t\t\tCOMPLEX_BACKGROUND_MIN_HEIGHT, this._panel.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithHeaderAndFooter():void\n\t\t{\n\t\t\tthis.addHeader();\n\t\t\tthis.addFooter();\n\t\t\tthis._panel.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Panel was not calculated correctly with header and footer.\",\n\t\t\t\tFOOTER_WIDTH, this._panel.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Panel was not calculated correctly with header and footer.\",\n\t\t\t\tHEADER_HEIGHT + FOOTER_HEIGHT, this._panel.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Panel was not calculated correctly with header and footer.\",\n\t\t\t\tFOOTER_WIDTH, this._panel.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Panel was not calculated correctly with header and footer.\",\n\t\t\t\tHEADER_HEIGHT + FOOTER_HEIGHT, this._panel.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWidthWithHeaderAndSmallerFooter():void\n\t\t{\n\t\t\tthis.addWideHeader();\n\t\t\tthis.addFooter();\n\t\t\tthis._panel.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Panel was not calculated correctly with header and footer.\",\n\t\t\t\tLARGE_HEADER_WIDTH, this._panel.width);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Panel was not calculated correctly with header and footer.\",\n\t\t\t\tLARGE_HEADER_WIDTH, this._panel.minWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithHeaderFooterAndPadding():void\n\t\t{\n\t\t\tthis.addHeader();\n\t\t\tthis.addFooter();\n\t\t\tthis._panel.paddingTop = PADDING_TOP;\n\t\t\tthis._panel.paddingRight = PADDING_RIGHT;\n\t\t\tthis._panel.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._panel.paddingLeft = PADDING_LEFT;\n\t\t\tthis._panel.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Panel was not calculated correctly based on the header, footer, and left and right padding.\",\n\t\t\t\tFOOTER_WIDTH, this._panel.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Panel was not calculated correctly based on the header, footer, and top and bottom padding.\",\n\t\t\t\tHEADER_HEIGHT + FOOTER_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._panel.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Panel was not calculated correctly based on the header, footer, and left and right padding.\",\n\t\t\t\tFOOTER_WIDTH, this._panel.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Panel was not calculated correctly based on the header, footer, and top and bottom padding.\",\n\t\t\t\tHEADER_HEIGHT + FOOTER_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._panel.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithHeaderFooterAndLargerSimpleBackgroundSkin():void\n\t\t{\n\t\t\tthis.addHeader();\n\t\t\tthis.addFooter();\n\t\t\tthis.addSimpleBackground();\n\t\t\tthis._panel.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Panel was not calculated correctly based on the background width with a smaller header and footer.\",\n\t\t\t\tBACKGROUND_WIDTH, this._panel.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Panel was not calculated correctly based on the background width with a smaller header and footer.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._panel.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Panel was not calculated correctly based on the background height with a smaller header and footer.\",\n\t\t\t\tBACKGROUND_WIDTH, this._panel.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Panel was not calculated correctly based on the background width with a smaller header and footer.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._panel.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithHeaderFooterAndLargerComplexBackground():void\n\t\t{\n\t\t\tthis.addHeader();\n\t\t\tthis.addFooter();\n\t\t\tthis.addComplexBackground();\n\t\t\tthis._panel.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Panel was not calculated correctly based on the complex background width with a smaller header and footer.\",\n\t\t\t\tCOMPLEX_BACKGROUND_WIDTH, this._panel.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Panel was not calculated correctly based on the complex background height with a smaller header and footer.\",\n\t\t\t\tCOMPLEX_BACKGROUND_HEIGHT, this._panel.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Panel was not calculated correctly based on the complex background minWidth with a smaller header and footer.\",\n\t\t\t\tCOMPLEX_BACKGROUND_MIN_WIDTH, this._panel.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Panel was not calculated correctly based on the complex background minHeight with a smaller header and footer.\",\n\t\t\t\tCOMPLEX_BACKGROUND_MIN_HEIGHT, this._panel.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithHeaderAndNarrowChild():void\n\t\t{\n\t\t\tthis.addHeader();\n\t\t\tthis._panel.addChild(new Quad(SMALL_ITEM_WIDTH, ITEM_HEIGHT, 0xff00ff));\n\t\t\tthis._panel.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Panel was not calculated correctly with a header.\",\n\t\t\t\tHEADER_WIDTH, this._panel.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Panel was not calculated correctly with a header.\",\n\t\t\t\tHEADER_HEIGHT + ITEM_HEIGHT, this._panel.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Panel was not calculated correctly with a header.\",\n\t\t\t\tHEADER_WIDTH, this._panel.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Panel was not calculated correctly with a header.\",\n\t\t\t\tHEADER_HEIGHT + ITEM_HEIGHT, this._panel.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithHeaderAndWideChild():void\n\t\t{\n\t\t\tthis.addHeader();\n\t\t\tthis._panel.addChild(new Quad(LARGE_ITEM_WIDTH, ITEM_HEIGHT, 0xff00ff));\n\t\t\tthis._panel.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Panel was not calculated correctly with a header.\",\n\t\t\t\tLARGE_ITEM_WIDTH, this._panel.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Panel was not calculated correctly with a header.\",\n\t\t\t\tHEADER_HEIGHT + ITEM_HEIGHT, this._panel.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Panel was not calculated correctly with a header.\",\n\t\t\t\tLARGE_ITEM_WIDTH, this._panel.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Panel was not calculated correctly with a header.\",\n\t\t\t\tHEADER_HEIGHT + ITEM_HEIGHT, this._panel.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithHeaderChildAndMeasureViewPortSetToFalse():void\n\t\t{\n\t\t\tthis.addHeader();\n\t\t\tthis._panel.addChild(new Quad(SMALL_ITEM_WIDTH, ITEM_HEIGHT, 0xff00ff));\n\t\t\tthis._panel.measureViewPort = false;\n\t\t\tthis._panel.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Panel was not calculated correctly with a header.\",\n\t\t\t\tHEADER_WIDTH, this._panel.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Panel was not calculated correctly with a header.\",\n\t\t\t\tHEADER_HEIGHT, this._panel.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Panel was not calculated correctly with a header.\",\n\t\t\t\tHEADER_WIDTH, this._panel.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Panel was not calculated correctly with a header.\",\n\t\t\t\tHEADER_HEIGHT, this._panel.minHeight);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/PickerListMeasurementTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.PickerList;\n\timport feathers.controls.text.BitmapFontTextRenderer;\n\timport feathers.data.ListCollection;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class PickerListMeasurementTests\n\t{\n\t\tprivate static const SMALL_BACKGROUND_WIDTH:Number = 10;\n\t\tprivate static const SMALL_BACKGROUND_HEIGHT:Number = 12;\n\t\tprivate static const LARGE_BACKGROUND_WIDTH:Number = 100;\n\t\tprivate static const LARGE_BACKGROUND_HEIGHT:Number = 110;\n\t\tprivate static const COMPLEX_BACKGROUND_WIDTH:Number = 54;\n\t\tprivate static const COMPLEX_BACKGROUND_HEIGHT:Number = 55;\n\t\tprivate static const COMPLEX_BACKGROUND_MIN_WIDTH:Number = 38;\n\t\tprivate static const COMPLEX_BACKGROUND_MIN_HEIGHT:Number = 39;\n\n\t\tprivate static const MIN_WIDTH:Number = 60;\n\t\tprivate static const MIN_HEIGHT:Number = 62;\n\n\t\tprivate static const SMALL_ICON_WIDTH:Number = 13;\n\t\tprivate static const SMALL_ICON_HEIGHT:Number = 11;\n\t\tprivate static const LARGE_ICON_WIDTH:Number = 105;\n\t\tprivate static const LARGE_ICON_HEIGHT:Number = 115;\n\t\tprivate static const COMPLEX_ICON_WIDTH:Number = 23;\n\t\tprivate static const COMPLEX_ICON_HEIGHT:Number = 25;\n\t\tprivate static const COMPLEX_ICON_MIN_WIDTH:Number = 18;\n\t\tprivate static const COMPLEX_ICON_MIN_HEIGHT:Number = 19;\n\n\t\tprivate static const PADDING_TOP:Number = 50;\n\t\tprivate static const PADDING_RIGHT:Number = 54;\n\t\tprivate static const PADDING_BOTTOM:Number = 59;\n\t\tprivate static const PADDING_LEFT:Number = 60;\n\t\tprivate static const GAP:Number = 6;\n\t\t\n\t\tprivate var _list:PickerList;\n\t\tprivate var _textRenderer:BitmapFontTextRenderer;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._list = new PickerList();\n\t\t\tthis._list.buttonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.labelFactory = function():BitmapFontTextRenderer\n\t\t\t\t{\n\t\t\t\t\treturn new BitmapFontTextRenderer();\n\t\t\t\t}\n\t\t\t\treturn button;\n\t\t\t}\n\t\t\tTestFeathers.starlingRoot.addChild(this._list);\n\n\t\t\tthis._textRenderer = new BitmapFontTextRenderer();\n\t\t\tTestFeathers.starlingRoot.addChild(this._textRenderer);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._list.removeFromParent(true);\n\t\t\tthis._list = null;\n\n\t\t\tthis._textRenderer.removeFromParent(true);\n\t\t\tthis._textRenderer = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\tprivate function addSmallSimpleIcon():void\n\t\t{\n\t\t\tvar factory:Function = this._list.buttonFactory;\n\t\t\tthis._list.buttonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = Button(factory());\n\t\t\t\tbutton.defaultIcon = new Quad(SMALL_ICON_WIDTH, SMALL_ICON_HEIGHT, 0xff00ff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t}\n\n\t\tprivate function addLargeSimpleIcon():void\n\t\t{\n\t\t\tvar factory:Function = this._list.buttonFactory;\n\t\t\tthis._list.buttonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = Button(factory());\n\t\t\t\tbutton.defaultIcon = new Quad(LARGE_ICON_WIDTH, LARGE_ICON_HEIGHT, 0xff00ff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t}\n\n\t\tprivate function addComplexIcon():void\n\t\t{\n\t\t\tvar factory:Function = this._list.buttonFactory;\n\t\t\tthis._list.buttonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = Button(factory());\n\t\t\t\tvar icon:LayoutGroup = new LayoutGroup();\n\t\t\t\ticon.width = COMPLEX_ICON_WIDTH;\n\t\t\t\ticon.height = COMPLEX_ICON_HEIGHT;\n\t\t\t\ticon.minWidth = COMPLEX_ICON_MIN_WIDTH;\n\t\t\t\ticon.minHeight = COMPLEX_ICON_MIN_HEIGHT;\n\t\t\t\tbutton.defaultIcon = icon;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t}\n\n\t\tprivate function addSmallSimpleBackground():void\n\t\t{\n\t\t\tvar factory:Function = this._list.buttonFactory;\n\t\t\tthis._list.buttonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = Button(factory());\n\t\t\t\tbutton.defaultSkin = new Quad(SMALL_BACKGROUND_WIDTH, SMALL_BACKGROUND_HEIGHT, 0xff00ff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t}\n\n\t\tprivate function addLargeSimpleBackground():void\n\t\t{\n\t\t\tvar factory:Function = this._list.buttonFactory;\n\t\t\tthis._list.buttonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = Button(factory());\n\t\t\t\tbutton.defaultSkin = new Quad(LARGE_BACKGROUND_WIDTH, LARGE_BACKGROUND_HEIGHT, 0xff00ff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t}\n\n\t\tprivate function addComplexBackground():void\n\t\t{\n\t\t\tvar factory:Function = this._list.buttonFactory;\n\t\t\tthis._list.buttonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = Button(factory());\n\t\t\t\tvar backgroundSkin:LayoutGroup = new LayoutGroup();\n\t\t\t\tbackgroundSkin.width = COMPLEX_BACKGROUND_WIDTH;\n\t\t\t\tbackgroundSkin.height = COMPLEX_BACKGROUND_HEIGHT;\n\t\t\t\tbackgroundSkin.minWidth = COMPLEX_BACKGROUND_MIN_WIDTH;\n\t\t\t\tbackgroundSkin.minHeight = COMPLEX_BACKGROUND_MIN_HEIGHT;\n\t\t\t\tbutton.defaultSkin = backgroundSkin;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t}\n\n\t\tprivate function addPadding():void\n\t\t{\n\t\t\tvar factory:Function = this._list.buttonFactory;\n\t\t\tthis._list.buttonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = Button(factory());\n\t\t\t\tbutton.paddingTop = PADDING_TOP;\n\t\t\t\tbutton.paddingRight = PADDING_RIGHT;\n\t\t\t\tbutton.paddingBottom = PADDING_BOTTOM;\n\t\t\t\tbutton.paddingLeft = PADDING_LEFT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t}\n\n\t\tprivate function addGap():void\n\t\t{\n\t\t\tvar factory:Function = this._list.buttonFactory;\n\t\t\tthis._list.buttonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = Button(factory());\n\t\t\t\tbutton.gap = GAP;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithPadding():void\n\t\t{\n\t\t\tthis.addPadding();\n\t\t\tthis._list.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the PickerList was not calculated correctly based on the left and right padding.\",\n\t\t\t\tPADDING_LEFT + PADDING_RIGHT, this._list.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the PickerList was not calculated correctly based on the top and bottom padding.\",\n\t\t\t\tPADDING_TOP + PADDING_BOTTOM, this._list.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the PickerList was not calculated correctly based on the left and right padding.\",\n\t\t\t\tPADDING_LEFT + PADDING_RIGHT, this._list.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the PickerList was not calculated correctly based on the top and bottom padding.\",\n\t\t\t\tPADDING_TOP + PADDING_BOTTOM, this._list.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithLabel():void\n\t\t{\n\t\t\tvar labelText:String = \"I am the very model of a modern major general\";\n\t\t\tthis._textRenderer.text = labelText;\n\t\t\tthis._textRenderer.validate();\n\n\t\t\tthis._list.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{ label: labelText }\n\t\t\t]);\n\t\t\tthis._list.validate();\n\n\t\t\tAssert.assertTrue(\"The width of the PickerList was not greater than 0 when using a label.\",\n\t\t\t\tthis._list.width > 0);\n\t\t\tAssert.assertTrue(\"The height of the PickerList was not greater than 0 when using a label.\",\n\t\t\t\tthis._list.height > 0);\n\t\t\tAssert.assertTrue(\"The minWidth of the PickerList was not greater than 0 when using a label.\",\n\t\t\t\tthis._list.minWidth > 0);\n\t\t\tAssert.assertTrue(\"The minHeight of the PickerList was not greater than 0 when using a label.\",\n\t\t\t\tthis._list.minHeight > 0);\n\t\t\tAssert.assertStrictlyEquals(\"The width of the PickerList was not calculated correctly based on the label.\",\n\t\t\t\tthis._textRenderer.width, this._list.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the PickerList was not calculated correctly based on the label.\",\n\t\t\t\tthis._textRenderer.height, this._list.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the PickerList was not calculated correctly based on the label.\",\n\t\t\t\tthis._textRenderer.width, this._list.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the PickerList was not calculated correctly based on the label.\",\n\t\t\t\tthis._textRenderer.height, this._list.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithLabelAndPadding():void\n\t\t{\n\t\t\tvar labelText:String = \"I am the very model of a modern major general\";\n\t\t\tthis._textRenderer.text = labelText;\n\t\t\tthis._textRenderer.validate();\n\n\t\t\tthis.addPadding();\n\t\t\tthis._list.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{ label: labelText }\n\t\t\t]);\n\t\t\tthis._list.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the PickerList was not calculated correctly based on the label and left and right padding.\",\n\t\t\t\tthis._textRenderer.width + PADDING_LEFT + PADDING_RIGHT, this._list.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the PickerList was not calculated correctly based on the label and top and bottom padding.\",\n\t\t\t\tthis._textRenderer.height + PADDING_TOP + PADDING_BOTTOM, this._list.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the PickerList was not calculated correctly based on the label and left and right padding.\",\n\t\t\t\tthis._textRenderer.width + PADDING_LEFT + PADDING_RIGHT, this._list.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the PickerList was not calculated correctly based on the label and top and bottom padding.\",\n\t\t\t\tthis._textRenderer.height + PADDING_TOP + PADDING_BOTTOM, this._list.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithLabelAndSimpleIcon():void\n\t\t{\n\t\t\tvar labelText:String = \"I am the very model of a modern major general\";\n\t\t\tthis._textRenderer.text = labelText;\n\t\t\tthis._textRenderer.validate();\n\n\t\t\tthis.addLargeSimpleIcon();\n\t\t\tthis._list.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{ label: labelText }\n\t\t\t]);\n\t\t\tthis._list.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the PickerList was not calculated correctly based on the label and icon.\",\n\t\t\t\tthis._textRenderer.width + LARGE_ICON_WIDTH, this._list.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the PickerList was not calculated correctly based on the label and icon.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this._list.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the PickerList was not calculated correctly based on the label and icon.\",\n\t\t\t\tthis._textRenderer.width + LARGE_ICON_WIDTH, this._list.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the PickerList was not calculated correctly based on the label and icon.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this._list.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithLabelGapAndSimpleIcon():void\n\t\t{\n\t\t\tvar labelText:String = \"I am the very model of a modern major general\";\n\t\t\tthis._textRenderer.text = labelText;\n\t\t\tthis._textRenderer.validate();\n\n\t\t\tthis.addLargeSimpleIcon();\n\t\t\tthis.addGap();\n\t\t\tthis._list.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{ label: labelText }\n\t\t\t]);\n\t\t\tthis._list.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the PickerList was not calculated correctly based on the label, gap, and icon.\",\n\t\t\t\tthis._textRenderer.width + GAP + LARGE_ICON_WIDTH, this._list.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the PickerList was not calculated correctly based on the label, gap, and icon.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this._list.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the PickerList was not calculated correctly based on the label, gap, and icon.\",\n\t\t\t\tthis._textRenderer.width + GAP + LARGE_ICON_WIDTH, this._list.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the PickerList was not calculated correctly based on the label, and icon.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this._list.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithLabelGapPaddingAndSimpleIcon():void\n\t\t{\n\t\t\tvar labelText:String = \"I am the very model of a modern major general\";\n\t\t\tthis._textRenderer.text = labelText;\n\t\t\tthis._textRenderer.validate();\n\n\t\t\tthis.addLargeSimpleIcon();\n\t\t\tthis.addPadding();\n\t\t\tthis.addGap();\n\t\t\tthis._list.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{ label: labelText }\n\t\t\t]);\n\t\t\tthis._list.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the PickerList was not calculated correctly based on the label, gap, left and right padding, and icon.\",\n\t\t\t\tthis._textRenderer.width + GAP + LARGE_ICON_WIDTH + PADDING_LEFT + PADDING_RIGHT, this._list.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the PickerList was not calculated correctly based on the label, gap, top and bottom padding, and icon.\",\n\t\t\t\tLARGE_ICON_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._list.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the PickerList was not calculated correctly based on the label, gap, left and right padding, and icon.\",\n\t\t\t\tthis._textRenderer.width + GAP + LARGE_ICON_WIDTH + PADDING_LEFT + PADDING_RIGHT, this._list.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the PickerList was not calculated correctly based on the label, gap, top and bottom padding, and icon.\",\n\t\t\t\tLARGE_ICON_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._list.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithSimpleIcon():void\n\t\t{\n\t\t\tthis.addLargeSimpleIcon();\n\t\t\tthis._list.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the PickerList was not calculated correctly based on the icon width.\",\n\t\t\t\tLARGE_ICON_WIDTH, this._list.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the PickerList was not calculated correctly based on the icon height.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this._list.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the PickerList was not calculated correctly based on the icon width.\",\n\t\t\t\tLARGE_ICON_WIDTH, this._list.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the PickerList was not calculated correctly based on the icon height.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this._list.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithComplexIcon():void\n\t\t{\n\t\t\tthis.addComplexIcon();\n\t\t\tthis._list.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the PickerList was not calculated correctly based on the complex icon width.\",\n\t\t\t\tCOMPLEX_ICON_WIDTH, this._list.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the PickerList was not calculated correctly based on the complex icon height.\",\n\t\t\t\tCOMPLEX_ICON_HEIGHT, this._list.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the PickerList was not calculated correctly based on the complex icon minWidth.\",\n\t\t\t\tCOMPLEX_ICON_MIN_WIDTH, this._list.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the PickerList was not calculated correctly based on the complex icon minHeight.\",\n\t\t\t\tCOMPLEX_ICON_MIN_HEIGHT, this._list.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithSimpleBackgroundSkin():void\n\t\t{\n\t\t\tthis.addSmallSimpleBackground();\n\t\t\tthis._list.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the PickerList was not calculated correctly based on the background width.\",\n\t\t\t\tSMALL_BACKGROUND_WIDTH, this._list.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the PickerList was not calculated correctly based on the background height.\",\n\t\t\t\tSMALL_BACKGROUND_HEIGHT, this._list.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the PickerList was not calculated correctly based on the background width.\",\n\t\t\t\tSMALL_BACKGROUND_WIDTH, this._list.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the PickerList was not calculated correctly based on the background height.\",\n\t\t\t\tSMALL_BACKGROUND_HEIGHT, this._list.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithSmallSimpleBackgroundSkinAndLargeSimpleIcon():void\n\t\t{\n\t\t\tthis.addSmallSimpleBackground();\n\t\t\tthis.addLargeSimpleIcon();\n\t\t\tthis._list.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the PickerList was not calculated correctly based on the icon width.\",\n\t\t\t\tLARGE_ICON_WIDTH, this._list.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the PickerList was not calculated correctly based on the icon height.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this._list.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the PickerList was not calculated correctly based on the icon width.\",\n\t\t\t\tLARGE_ICON_WIDTH, this._list.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the PickerList was not calculated correctly based on the icon height.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this._list.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithLargeSimpleBackgroundSkinAndSmallSimpleIcon():void\n\t\t{\n\t\t\tthis.addLargeSimpleBackground();\n\t\t\tthis.addSmallSimpleIcon();\n\t\t\tthis._list.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the PickerList was not calculated correctly based on the background width.\",\n\t\t\t\tLARGE_BACKGROUND_WIDTH, this._list.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the PickerList was not calculated correctly based on the background height.\",\n\t\t\t\tLARGE_BACKGROUND_HEIGHT, this._list.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the PickerList was not calculated correctly based on the background width.\",\n\t\t\t\tLARGE_BACKGROUND_WIDTH, this._list.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the PickerList was not calculated correctly based on the background height.\",\n\t\t\t\tLARGE_BACKGROUND_HEIGHT, this._list.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithComplexBackground():void\n\t\t{\n\t\t\tthis.addComplexBackground();\n\t\t\tthis._list.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the PickerList was not calculated correctly based on the complex background width.\",\n\t\t\t\tCOMPLEX_BACKGROUND_WIDTH, this._list.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the PickerList was not calculated correctly based on the complex background height.\",\n\t\t\t\tCOMPLEX_BACKGROUND_HEIGHT, this._list.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the PickerList was not calculated correctly based on the complex background minWidth.\",\n\t\t\t\tCOMPLEX_BACKGROUND_MIN_WIDTH, this._list.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the PickerList was not calculated correctly based on the complex background minHeight.\",\n\t\t\t\tCOMPLEX_BACKGROUND_MIN_HEIGHT, this._list.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithComplexBackgroundAndMinDimensions():void\n\t\t{\n\t\t\tthis.addComplexBackground();\n\t\t\tthis._list.minWidth = MIN_WIDTH;\n\t\t\tthis._list.minHeight = MIN_HEIGHT;\n\t\t\tthis._list.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the PickerList was not calculated correctly based on the minWidth.\",\n\t\t\t\tMIN_WIDTH, this._list.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the PickerList was not calculated correctly based on the minHeight.\",\n\t\t\t\tMIN_HEIGHT, this._list.minHeight);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/PickerListTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.List;\n\timport feathers.controls.PickerList;\n\timport feathers.controls.popups.DropDownPopUpContentManager;\n\timport feathers.core.PopUpManager;\n\timport feathers.data.ListCollection;\n\n\timport flash.geom.Point;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\tpublic class PickerListTests\n\t{\n\t\tprivate static const BUTTON_NAME:String = \"button\";\n\t\tprivate static const LIST_NAME:String = \"list\";\n\n\t\tprivate var _list:PickerList;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._list = new PickerList();\n\t\t\tthis._list.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{ label: \"One\" },\n\t\t\t\t{ label: \"Two\" },\n\t\t\t\t{ label: \"Three\" },\n\t\t\t]);\n\t\t\tvar popUpContentManager:DropDownPopUpContentManager = new DropDownPopUpContentManager();\n\t\t\tpopUpContentManager.openCloseDuration = 0;\n\t\t\tthis._list.popUpContentManager = popUpContentManager;\n\t\t\tthis._list.buttonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar button:Button = new Button();\n\t\t\t\tbutton.name = BUTTON_NAME;\n\t\t\t\tbutton.defaultSkin = new Quad(200, 200);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._list.listFactory = function():List\n\t\t\t{\n\t\t\t\tvar list:List = new List();\n\t\t\t\tlist.name = LIST_NAME;\n\t\t\t\treturn list;\n\t\t\t};\n\t\t\tTestFeathers.starlingRoot.addChild(this._list);\n\t\t\tthis._list.validate();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._list.removeFromParent(true);\n\t\t\tthis._list = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testProgrammaticOpenAndCloseEvents():void\n\t\t{\n\t\t\tvar hasOpened:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.OPEN, function(event:Event):void\n\t\t\t{\n\t\t\t\thasOpened = true;\n\t\t\t});\n\t\t\tvar hasClosed:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CLOSE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasClosed = true;\n\t\t\t});\n\n\t\t\tthis._list.openList();\n\t\t\t//the picker list may require validation before opening or closing\n\t\t\tthis._list.validate();\n\n\t\t\tAssert.assertTrue(\"Event.OPEN was not dispatched\", hasOpened);\n\t\t\tAssert.assertNotNull(\"The pop-up list was not added to the PopUpManager\",\n\t\t\t\tPopUpManager.root.getChildByName(LIST_NAME));\n\n\t\t\tthis._list.closeList();\n\t\t\tthis._list.validate();\n\n\t\t\tAssert.assertTrue(\"Event.CLOSE was not dispatched\", hasClosed);\n\t\t\tAssert.assertNull(\"The list's parent property is not null\",\n\t\t\t\tPopUpManager.root.getChildByName(LIST_NAME));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCloseOnDispose():void\n\t\t{\n\t\t\tvar hasClosed:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CLOSE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasClosed = true;\n\t\t\t});\n\n\t\t\tthis._list.openList();\n\t\t\tthis._list.validate();\n\n\t\t\tthis._list.dispose();\n\n\t\t\tAssert.assertTrue(\"Event.CLOSE was not dispatched\", hasClosed);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInteractiveOpenEvent():void\n\t\t{\n\t\t\tvar hasOpened:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.OPEN, function(event:Event):void\n\t\t\t{\n\t\t\t\thasOpened = true;\n\t\t\t});\n\t\t\tvar hasClosed:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CLOSE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasClosed = true;\n\t\t\t});\n\n\t\t\tvar position:Point = new Point(100, 100);\n\t\t\tvar target:DisplayObject = this._list.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t//this touch does not move at all, so it should result in triggering\n\t\t\t//the button.\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\t//the picker list may require validation before opening or closing\n\t\t\tthis._list.validate();\n\n\t\t\tAssert.assertTrue(\"Event.OPEN was not dispatched\", hasOpened);\n\t\t\tAssert.assertNotNull(\"The pop-up list was not added to the PopUpManager\",\n\t\t\t\tPopUpManager.root.getChildByName(LIST_NAME));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetPopUpListDataProvider():void\n\t\t{\n\t\t\tthis._list.openList();\n\t\t\t//the picker list may require validation before opening or closing\n\t\t\tthis._list.validate();\n\n\t\t\tvar popUpList:List = PopUpManager.root.getChildByName(LIST_NAME) as List;\n\n\t\t\tAssert.assertStrictlyEquals(\"The pop-up list data provider was not set\",\n\t\t\t\tthis._list.dataProvider, popUpList.dataProvider);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testProgrammaticSelectionChange():void\n\t\t{\n\t\t\tvar beforeSelectedIndex:int = this._list.selectedIndex;\n\t\t\tvar beforeSelectedItem:Object = this._list.selectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.selectedIndex = 1;\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertFalse(\"The selectedIndex property was not changed\",\n\t\t\t\tbeforeSelectedIndex === this._list.selectedIndex);\n\t\t\tAssert.assertFalse(\"The selectedItem property was not changed\",\n\t\t\t\tbeforeSelectedItem === this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemBeforeSelectedIndex():void\n\t\t{\n\t\t\tthis._list.selectedIndex = 1;\n\t\t\tvar beforeSelectedIndex:int = this._list.selectedIndex;\n\t\t\tvar beforeSelectedItem:Object = this._list.selectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dataProvider.removeItemAt(0);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was not changed\",\n\t\t\t\tbeforeSelectedIndex - 1, this._list.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was incorrectly changed\",\n\t\t\t\tbeforeSelectedItem, this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemAfterSelectedIndex():void\n\t\t{\n\t\t\tthis._list.selectedIndex = 1;\n\t\t\tvar beforeSelectedIndex:int = this._list.selectedIndex;\n\t\t\tvar beforeSelectedItem:Object = this._list.selectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dataProvider.removeItemAt(2);\n\t\t\tAssert.assertFalse(\"Event.CHANGE was incorrectly dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was incorrectly changed\",\n\t\t\t\tbeforeSelectedIndex, this._list.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was incorrectly changed\",\n\t\t\t\tbeforeSelectedItem, this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveSelectedIndex():void\n\t\t{\n\t\t\tthis._list.selectedIndex = 1;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dataProvider.removeItemAt(1);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was not changed to -1\",\n\t\t\t\t-1, this._list.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was not changed to null\",\n\t\t\t\tnull, this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testReplaceItemAtSelectedIndex():void\n\t\t{\n\t\t\tthis._list.selectedIndex = 1;\n\t\t\tvar beforeSelectedIndex:int = this._list.selectedIndex;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dataProvider.setItemAt({ label: \"New Item\" }, beforeSelectedIndex);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was not changed to -1\",\n\t\t\t\t-1, this._list.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was not changed to null\",\n\t\t\t\tnull, this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDeselectAllOnNullDataProvider():void\n\t\t{\n\t\t\tthis._list.selectedIndex = 1;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dataProvider = null;\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was not set to -1\",\n\t\t\t\t-1, this._list.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was not set to null\",\n\t\t\t\tnull, this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDeselectAllOnDataProviderRemoveAll():void\n\t\t{\n\t\t\tthis._list.selectedIndex = 1;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dataProvider.removeAll();\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was not set to -1\",\n\t\t\t\t-1, this._list.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was not set to null\",\n\t\t\t\tnull, this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemBeforeSelectedIndex():void\n\t\t{\n\t\t\tthis._list.selectedIndex = 1;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tvar beforeSelectedIndex:int = this._list.selectedIndex;\n\t\t\tvar beforeSelectedItem:Object = this._list.selectedItem;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dataProvider.addItemAt({label: \"New Item\"}, 0);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was not changed\",\n\t\t\t\tbeforeSelectedIndex + 1, this._list.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was incorrectly changed\",\n\t\t\t\tbeforeSelectedItem, this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDisposeWithoutChangeEvent():void\n\t\t{\n\t\t\tthis._list.selectedIndex = 1;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._list.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._list.dispose();\n\t\t\tAssert.assertFalse(\"Event.CHANGE was incorrectly dispatched\", hasChanged);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testUpdateItemAt():void\n\t\t{\n\t\t\tvar newLabel:String = \"New Item\";\n\t\t\tthis._list.selectedIndex = 1;\n\t\t\tthis._list.validate();\n\t\t\tvar item:Object = this._list.dataProvider.getItemAt(1);\n\t\t\titem.label = newLabel;\n\t\t\tthis._list.dataProvider.updateItemAt(1);\n\t\t\tthis._list.validate();\n\t\t\tvar button:Button = Button(this._list.getChildByName(BUTTON_NAME)); \n\t\t\tAssert.assertStrictlyEquals(\"PickerList updateItemAt() on selectedItem did not update button label\", newLabel, button.label);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/PopUpManagerFocusManagerTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Button;\n\timport feathers.core.FocusManager;\n\timport feathers.core.PopUpManager;\n\n\timport flexunit.framework.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class PopUpManagerFocusManagerTests\n\t{\n\t\tprivate var _button1:Button;\n\t\tprivate var _button2:Button;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, true);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tif(this._button1)\n\t\t\t{\n\t\t\t\tthis._button1.removeFromParent(true);\n\t\t\t\tthis._button1 = null;\n\t\t\t}\n\t\t\tif(this._button2)\n\t\t\t{\n\t\t\t\tthis._button2.removeFromParent(true);\n\t\t\t\tthis._button2 = null;\n\t\t\t}\n\t\t\t\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, false);\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPopUpHasNonNullFocusManager():void\n\t\t{\n\t\t\tthis.createButton1();\n\t\t\tPopUpManager.addPopUp(this._button1, true);\n\n\t\t\tAssert.assertNotNull(\"Modal pop-up must have focus manager.\", this._button1.focusManager);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPopUpHasDifferentFocusManager():void\n\t\t{\n\t\t\tthis.createButton1();\n\t\t\tTestFeathers.starlingRoot.addChild(this._button1);\n\n\t\t\tthis.createButton2();\n\t\t\tPopUpManager.addPopUp(this._button2, true);\n\t\t\t\n\t\t\tAssert.assertFalse(\"Modal pop-up must have different focus manager.\", this._button1.focusManager === this._button2.focusManager);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHasFocusManagerOnChildAddedUnderPopUp():void\n\t\t{\n\t\t\tthis.createButton1();\n\t\t\tPopUpManager.addPopUp(this._button1, true);\n\t\t\t\n\t\t\tthis.createButton2();\n\t\t\tTestFeathers.starlingRoot.addChild(this._button2);\n\t\t\t\n\t\t\tthis._button1.removeFromParent(true);\n\t\t\tthis._button1 = null;\n\n\t\t\tAssert.assertNotNull(\"Component added under modal pop-up must have focus manager after removing pop-up.\", this._button2.focusManager);\n\t\t}\n\t\t\n\t\tprivate function createButton1():void\n\t\t{\n\t\t\tthis._button1 = new Button();\n\t\t\tthis._button1.label = \"Click Me\";\n\t\t\tthis._button1.defaultSkin = new Quad(200, 200);\n\t\t}\n\n\t\tprivate function createButton2():void\n\t\t{\n\t\t\tthis._button2 = new Button();\n\t\t\tthis._button2.label = \"Click Me Too\";\n\t\t\tthis._button2.defaultSkin = new Quad(200, 200);\n\t\t\tthis._button2.y = 210;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/PopUpManagerTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.AutoSizeMode;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.ScrollContainer;\n\timport feathers.core.IFeathersControl;\n\timport feathers.core.PopUpManager;\n\timport feathers.tests.supportClasses.DisposeFlagQuad;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.display.Sprite;\n\timport starling.events.Event;\n\n\tpublic class PopUpManagerTests\n\t{\n\t\tprivate static const OVERLAY_NAME:String = \"PopUpManagerOverlay\";\n\n\t\tprivate var _popUp1:Quad;\n\t\tprivate var _popUp2:Quad;\n\t\tprivate var _feathersPopUp:IFeathersControl;\n\t\tprivate var _customRoot:Sprite;\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tif(this._customRoot)\n\t\t\t{\n\t\t\t\tthis._customRoot.removeFromParent(true);\n\t\t\t\tthis._customRoot = null;\n\t\t\t}\n\t\t\tif(this._popUp1)\n\t\t\t{\n\t\t\t\tthis._popUp1.removeFromParent(true);\n\t\t\t\tthis._popUp1 = null;\n\t\t\t}\n\t\t\tif(this._popUp2)\n\t\t\t{\n\t\t\t\tthis._popUp2.removeFromParent(true);\n\t\t\t\tthis._popUp2 = null;\n\t\t\t}\n\t\t\tif(this._feathersPopUp)\n\t\t\t{\n\t\t\t\tthis._feathersPopUp.removeFromParent(true);\n\t\t\t\tthis._feathersPopUp = null;\n\t\t\t}\n\n\t\t\tPopUpManager.root = TestFeathers.starlingRoot.stage;\n\n\t\t\tPopUpManager.overlayFactory = PopUpManager.defaultOverlayFactory;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\tprivate function createOverlay():DisplayObject\n\t\t{\n\t\t\tvar overlay:Quad = new Quad(1, 1, 0xff00ff);\n\t\t\toverlay.alpha = 0.5;\n\t\t\toverlay.name = OVERLAY_NAME;\n\t\t\treturn overlay;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCustomRoot():void\n\t\t{\n\t\t\tthis._customRoot = new Sprite();\n\t\t\tTestFeathers.starlingRoot.addChild(this._customRoot);\n\t\t\tPopUpManager.root = this._customRoot;\n\t\t\tAssert.assertFalse(\"PopUpManager.root property incorrectly returns stage\", PopUpManager.root === TestFeathers.starlingRoot.stage);\n\n\t\t\tthis._popUp1 = new Quad(200, 200, 0xff00ff);\n\t\t\tPopUpManager.addPopUp(this._popUp1);\n\n\t\t\tAssert.assertStrictlyEquals(\"Pop-up added to wrong parent when a custom PopUpManager.root is set\", this._customRoot, this._popUp1.parent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testOverlayFactory():void\n\t\t{\n\t\t\tPopUpManager.overlayFactory = this.createOverlay;\n\n\t\t\tthis._popUp1 = new Quad(200, 200, 0xff00ff);\n\t\t\tPopUpManager.addPopUp(this._popUp1, true);\n\n\t\t\tvar overlay:DisplayObject = PopUpManager.root.getChildByName(OVERLAY_NAME);\n\t\t\tAssert.assertNotNull(\"PopUpManager.overlayFactory failed to create overlay\", overlay);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testIsPopUp():void\n\t\t{\n\t\t\tPopUpManager.overlayFactory = this.createOverlay;\n\n\t\t\tthis._popUp1 = new Quad(200, 200, 0xff00ff);\n\t\t\tPopUpManager.addPopUp(this._popUp1, true);\n\n\t\t\tthis._popUp2 = new Quad(200, 200, 0x00ff00);\n\t\t\tTestFeathers.starlingRoot.addChild(this._popUp2);\n\n\t\t\tAssert.assertTrue(\"PopUpManager.isPopUp() failed to identify a pop-up\", PopUpManager.isPopUp(this._popUp1));\n\t\t\tAssert.assertFalse(\"PopUpManager.isPopUp() incorrectly identified a display object that is not a pop-up\", PopUpManager.isPopUp(this._popUp2));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testIsTopLevelPopUpWithModal():void\n\t\t{\n\t\t\tthis._popUp1 = new Quad(200, 200, 0xff00ff);\n\t\t\tPopUpManager.addPopUp(this._popUp1, true);\n\n\t\t\tAssert.assertTrue(\"PopUpManager.isTopLevelPopUp() failed to identify a top-level pop-up\",\n\t\t\t\tPopUpManager.isTopLevelPopUp(this._popUp1));\n\n\t\t\tthis._popUp2 = new Quad(200, 200, 0x00ff00);\n\t\t\tPopUpManager.addPopUp(this._popUp2, true);\n\n\t\t\tAssert.assertTrue(\"PopUpManager.isTopLevelPopUp() failed to identify a top-level pop-up\",\n\t\t\t\tPopUpManager.isTopLevelPopUp(this._popUp2));\n\n\t\t\tAssert.assertFalse(\"PopUpManager.isTopLevelPopUp() incorrectly identified a top-level pop-up\",\n\t\t\t\tPopUpManager.isTopLevelPopUp(this._popUp1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testIsTopLevelPopUpWithoutModal():void\n\t\t{\n\t\t\tthis._popUp1 = new Quad(200, 200, 0xff00ff);\n\t\t\tPopUpManager.addPopUp(this._popUp1, false);\n\n\t\t\tAssert.assertTrue(\"PopUpManager.isTopLevelPopUp() failed to identify a top-level pop-up\",\n\t\t\t\tPopUpManager.isTopLevelPopUp(this._popUp1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testIsTopLevelPopUpWithoutModalAfterModal():void\n\t\t{\n\t\t\tthis._popUp1 = new Quad(200, 200, 0xff00ff);\n\t\t\tPopUpManager.addPopUp(this._popUp1, true);\n\n\t\t\tthis._popUp2 = new Quad(200, 200, 0x00ff00);\n\t\t\tPopUpManager.addPopUp(this._popUp2, false);\n\n\t\t\tAssert.assertTrue(\"PopUpManager.isTopLevelPopUp() failed to identify a top-level pop-up\",\n\t\t\t\tPopUpManager.isTopLevelPopUp(this._popUp1));\n\n\t\t\tAssert.assertTrue(\"PopUpManager.isTopLevelPopUp() failed to identify a top-level pop-up\",\n\t\t\t\tPopUpManager.isTopLevelPopUp(this._popUp2));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPopUpCount():void\n\t\t{\n\t\t\tAssert.assertStrictlyEquals(\"PopUpManager.popUpCount returned wrong value with no pop-ups\",\n\t\t\t\t0, PopUpManager.popUpCount);\n\n\t\t\tthis._popUp1 = new Quad(200, 200, 0xff00ff);\n\t\t\tPopUpManager.addPopUp(this._popUp1, true);\n\n\t\t\tAssert.assertStrictlyEquals(\"PopUpManager.popUpCount returned wrong value after adding first pop-up\",\n\t\t\t\t1, PopUpManager.popUpCount);\n\n\t\t\tthis._popUp2 = new Quad(200, 200, 0x00ff00);\n\t\t\tTestFeathers.starlingRoot.addChild(this._popUp2);\n\n\t\t\tAssert.assertStrictlyEquals(\"PopUpManager.popUpCount incorrectly identified a display object that is not a pop-up and returned wrong value\",\n\t\t\t\t1, PopUpManager.popUpCount);\n\n\t\t\tthis._feathersPopUp = new LayoutGroup();\n\t\t\tPopUpManager.addPopUp(DisplayObject(this._feathersPopUp));\n\n\t\t\tAssert.assertStrictlyEquals(\"PopUpManager.popUpCount returned wrong value after adding second pop-up\",\n\t\t\t\t2, PopUpManager.popUpCount);\n\n\t\t\tPopUpManager.removePopUp(this._popUp1);\n\n\t\t\tAssert.assertStrictlyEquals(\"PopUpManager.popUpCount returned wrong value after removing pop-up\",\n\t\t\t\t1, PopUpManager.popUpCount);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveAllPopUps():void\n\t\t{\n\t\t\tthis._popUp1 = new DisposeFlagQuad();\n\t\t\tPopUpManager.addPopUp(this._popUp1, true);\n\n\t\t\tthis._popUp2 = new DisposeFlagQuad();\n\t\t\tPopUpManager.addPopUp(this._popUp2, true);\n\n\t\t\tPopUpManager.removeAllPopUps(true);\n\n\t\t\tAssert.assertStrictlyEquals(\"PopUpManager.popUpCount incorrect after removeAllPopUps()\",\n\t\t\t\t0, PopUpManager.popUpCount);\n\n\t\t\tAssert.assertTrue(\"Pop up not disposed after removeAllPopUps(true)\",\n\t\t\t\tDisposeFlagQuad(this._popUp1).isDisposed);\n\t\t\tAssert.assertNull(\"Pop up parent not null after removeAllPopUps()\",\n\t\t\t\tthis._popUp1.parent);\n\n\t\t\tAssert.assertTrue(\"Pop up not disposed after removeAllPopUps(true)\",\n\t\t\t\tDisposeFlagQuad(this._popUp2).isDisposed);\n\t\t\tAssert.assertNull(\"Pop up parent not null after removeAllPopUps()\",\n\t\t\t\tthis._popUp2.parent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemovePopUpWithoutDispose():void\n\t\t{\n\t\t\tthis._popUp1 = new DisposeFlagQuad();\n\t\t\tPopUpManager.addPopUp(this._popUp1, true);\n\n\t\t\tPopUpManager.removePopUp(this._popUp1, false);\n\n\t\t\tAssert.assertFalse(\"Pop up not disposed after removePopUp(false)\",\n\t\t\t\tDisposeFlagQuad(this._popUp1).isDisposed);\n\t\t\tAssert.assertNull(\"Pop up parent not null after removePopUp(false)\",\n\t\t\t\tthis._popUp1.parent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemovePopUpWithDispose():void\n\t\t{\n\t\t\tthis._popUp1 = new DisposeFlagQuad();\n\t\t\tPopUpManager.addPopUp(this._popUp1, true);\n\n\t\t\tPopUpManager.removePopUp(this._popUp1, true);\n\n\t\t\tAssert.assertTrue(\"Pop up not disposed after removePopUp(true)\",\n\t\t\t\tDisposeFlagQuad(this._popUp1).isDisposed);\n\t\t\tAssert.assertNull(\"Pop up parent not null after removePopUp(true)\",\n\t\t\t\tthis._popUp1.parent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCenterPopUp():void\n\t\t{\n\t\t\tvar popUpWidth:Number = 200;\n\t\t\tvar popUpHeight:Number = 150;\n\t\t\tthis._popUp1 = new Quad(popUpWidth, popUpHeight, 0xff00ff);\n\t\t\tPopUpManager.addPopUp(this._popUp1, true, true);\n\n\t\t\tAssert.assertStrictlyEquals(\"PopUpManager failed to center pop-up horizontally\",\n\t\t\t\t(TestFeathers.starlingRoot.stage.stageWidth - popUpWidth) / 2, this._popUp1.x);\n\t\t\tAssert.assertStrictlyEquals(\"PopUpManager failed to center pop-up vertically\",\n\t\t\t\t(TestFeathers.starlingRoot.stage.stageHeight - popUpHeight) / 2, this._popUp1.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCenterPopUpWithPivots():void\n\t\t{\n\t\t\tvar popUpWidth:Number = 200;\n\t\t\tvar popUpHeight:Number = 150;\n\t\t\tthis._popUp1 = new Quad(popUpWidth, popUpHeight, 0xff00ff);\n\t\t\tthis._popUp1.pivotX = popUpWidth / 2;\n\t\t\tthis._popUp1.pivotY = popUpHeight / 2;\n\t\t\tPopUpManager.addPopUp(this._popUp1, true, true);\n\n\t\t\tAssert.assertStrictlyEquals(\"PopUpManager failed to center pop-up with pivot horizontally\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageWidth / 2, this._popUp1.x);\n\t\t\tAssert.assertStrictlyEquals(\"PopUpManager failed to center pop-up with pivot vertically\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageHeight / 2, this._popUp1.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutGroupAutoSizeModeStage():void\n\t\t{\n\t\t\tvar group:LayoutGroup = new LayoutGroup();\n\t\t\tthis._feathersPopUp = group;\n\t\t\tPopUpManager.addPopUp(group);\n\t\t\tAssert.assertStrictlyEquals(\"LayoutGroup added to PopUpManager should default to autoSizeMode === AutoSizeMode.CONTENT\", AutoSizeMode.CONTENT, group.autoSizeMode);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testScrollContainerAutoSizeModeStage():void\n\t\t{\n\t\t\tvar container:ScrollContainer = new ScrollContainer();\n\t\t\tthis._feathersPopUp = container;\n\t\t\tPopUpManager.addPopUp(container);\n\t\t\tAssert.assertStrictlyEquals(\"ScrollContainer added to PopUpManager should default to autoSizeMode === AutoSizeMode.CONTENT\", AutoSizeMode.CONTENT, container.autoSizeMode);\n\t\t}\n\n\t\t//Github issue #1685\n\t\t[Test]\n\t\tpublic function testRemovePopUpFromRemovedEventForOtherPopUp():void\n\t\t{\n\t\t\tthis._popUp1 = new DisposeFlagQuad();\n\t\t\tPopUpManager.addPopUp(this._popUp1);\n\t\t\tthis._popUp2 = new DisposeFlagQuad();\n\t\t\tPopUpManager.addPopUp(this._popUp2);\n\t\t\tthis._popUp1.addEventListener(Event.REMOVED, function():void\n\t\t\t{\n\t\t\t\t_popUp2.removeFromParent(true);\n\t\t\t});\n\t\t\tPopUpManager.removeAllPopUps();\n\t\t\tAssert.assertStrictlyEquals(\"PopUpManager: Failed to remove all pop ups.\",\n\t\t\t\t0, PopUpManager.popUpCount);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ProgressBarMeasurementTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.ProgressBar;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class ProgressBarMeasurementTests\n\t{\n\t\tprivate static const BACKGROUND_WIDTH:Number = 200;\n\t\tprivate static const BACKGROUND_HEIGHT:Number = 20;\n\t\tprivate static const FILL_WIDTH:Number = 18;\n\t\tprivate static const FILL_HEIGHT:Number = 14;\n\t\tprivate static const BACKGROUND_WIDTH2:Number = 125;\n\t\tprivate static const BACKGROUND_HEIGHT2:Number = 20;\n\t\tprivate static const BACKGROUND_WIDTH3:Number = 150;\n\t\tprivate static const BACKGROUND_HEIGHT3:Number = 30;\n\n\t\tprivate static const PADDING_TOP:Number = 4;\n\t\tprivate static const PADDING_RIGHT:Number = 100;\n\t\tprivate static const PADDING_BOTTOM:Number = 3;\n\t\tprivate static const PADDING_LEFT:Number = 90;\n\t\t\n\t\tprivate var _progress:ProgressBar;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._progress = new ProgressBar();\n\t\t\tthis._progress.minimum = 0;\n\t\t\tthis._progress.maximum = 10;\n\t\t\tthis._progress.value = 5;\n\t\t\tTestFeathers.starlingRoot.addChild(this._progress);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._progress.removeFromParent(true);\n\t\t\tthis._progress = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\t\t\n\t\tprotected function addSimpleBackgroundSkin():void\n\t\t{\n\t\t\tthis._progress.backgroundSkin = new Quad(BACKGROUND_WIDTH, BACKGROUND_HEIGHT);\n\t\t}\n\n\t\tprotected function addSimpleFillSkin():void\n\t\t{\n\t\t\tthis._progress.fillSkin = new Quad(FILL_WIDTH, FILL_HEIGHT);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSize():void\n\t\t{\n\t\t\tthis.addSimpleBackgroundSkin();\n\t\t\tthis.addSimpleFillSkin();\n\t\t\tthis._progress.validate();\n\t\t\t\n\t\t\tAssert.assertStrictlyEquals(\"The width of the progress bar was not calculated correctly based on the original background width.\",\n\t\t\tBACKGROUND_WIDTH, this._progress.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the progress bar was not calculated correctly based on the original background height.\",\n\t\t\tBACKGROUND_HEIGHT, this._progress.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the progress bar was not calculated correctly based on the original background width.\",\n\t\t\tBACKGROUND_WIDTH, this._progress.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the progress bar was not calculated correctly based on the original background height.\",\n\t\t\tBACKGROUND_HEIGHT, this._progress.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWhereFillAndPaddingIsLargerThanBackground():void\n\t\t{\n\t\t\tthis.addSimpleBackgroundSkin();\n\t\t\tthis.addSimpleFillSkin();\n\t\t\tthis._progress.paddingTop = PADDING_TOP;\n\t\t\tthis._progress.paddingRight = PADDING_RIGHT;\n\t\t\tthis._progress.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._progress.paddingLeft = PADDING_LEFT;\n\t\t\tthis._progress.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the progress bar was not calculated correctly based on the original fill width plus padding left and right.\",\n\t\t\tFILL_WIDTH + PADDING_LEFT + PADDING_RIGHT, this._progress.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the progress bar was not calculated correctly based on the original fill height plus padding top and bottom.\",\n\t\t\tFILL_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._progress.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the progress bar was not calculated correctly based on the original fill width plus padding left and right.\",\n\t\t\tFILL_WIDTH + PADDING_LEFT + PADDING_RIGHT, this._progress.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the progress bar was not calculated correctly based on the original fill height plus padding top and bottom.\",\n\t\t\tFILL_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._progress.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithFeathersControlWithMinDimensions():void\n\t\t{\n\t\t\tvar backgroundSkin:LayoutGroup = new LayoutGroup();\n\t\t\tbackgroundSkin.minWidth = BACKGROUND_WIDTH2;\n\t\t\tbackgroundSkin.minHeight = BACKGROUND_HEIGHT2;\n\t\t\tbackgroundSkin.width = BACKGROUND_WIDTH3;\n\t\t\tbackgroundSkin.height = BACKGROUND_HEIGHT3;\n\t\t\tthis._progress.backgroundSkin = backgroundSkin;\n\t\t\tthis.addSimpleFillSkin();\n\t\t\tthis._progress.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the progress bar was not calculated correctly based on an IFeathersControl background skin width.\",\n\t\t\tBACKGROUND_WIDTH3, this._progress.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the progress bar was not calculated correctly based on an IFeathersControl background skin height.\",\n\t\t\tBACKGROUND_HEIGHT3, this._progress.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the progress bar was not calculated correctly based on an IFeathersControl background skin minWidth.\",\n\t\t\tBACKGROUND_WIDTH2, this._progress.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the progress bar was not calculated correctly based on an IFeathersControl background skin minHeight.\",\n\t\t\tBACKGROUND_HEIGHT2, this._progress.minHeight);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ProgressBarTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.ProgressBar;\n\timport feathers.tests.supportClasses.DisposeFlagQuad;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class ProgressBarTests\n\t{\n\t\tprivate static const BACKGROUND_WIDTH:Number = 200;\n\t\tprivate static const BACKGROUND_HEIGHT:Number = 20;\n\t\tprivate static const FILL_WIDTH:Number = 18;\n\t\tprivate static const FILL_HEIGHT:Number = 14;\n\t\t\n\t\tprivate var _progress:ProgressBar;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._progress = new ProgressBar();\n\t\t\tthis._progress.minimum = 0;\n\t\t\tthis._progress.maximum = 10;\n\t\t\tthis._progress.value = 5;\n\t\t\tthis._progress.backgroundSkin = new Quad(BACKGROUND_WIDTH, BACKGROUND_HEIGHT);\n\t\t\tthis._progress.fillSkin = new Quad(FILL_WIDTH, FILL_HEIGHT);\n\t\t\tTestFeathers.starlingRoot.addChild(this._progress);\n\t\t\tthis._progress.validate();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._progress.removeFromParent(true);\n\t\t\tthis._progress = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetValueProgramaticallyWithMinimum():void\n\t\t{\n\t\t\tthis._progress.minimum = 5;\n\t\t\tthis._progress.maximum = 10;\n\t\t\tthis._progress.value = 2;\n\t\t\tAssert.assertEquals(\"Setting value smaller than minimum not changed to minimum.\", this._progress.minimum, this._progress.value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetValueProgramaticallyWithMaximum():void\n\t\t{\n\t\t\tthis._progress.minimum = 5;\n\t\t\tthis._progress.maximum = 10;\n\t\t\tthis._progress.value = 12;\n\t\t\tAssert.assertEquals(\"Setting value larger than maximum not changed to maximum.\", this._progress.maximum, this._progress.value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSkinsDisposed():void\n\t\t{\n\t\t\tvar backgroundSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._progress.backgroundSkin = backgroundSkin;\n\t\t\tvar backgroundDisabledSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._progress.backgroundDisabledSkin = backgroundDisabledSkin;\n\t\t\tvar fillSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._progress.fillSkin = fillSkin;\n\t\t\tvar fillDisabledSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._progress.fillDisabledSkin = fillDisabledSkin;\n\t\t\tthis._progress.validate();\n\t\t\tthis._progress.dispose();\n\t\t\tAssert.assertTrue(\"backgroundSkin not disposed when ProgressBar disposed.\", backgroundSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"backgroundDisabledSkin not disposed when ProgressBar disposed.\", backgroundDisabledSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"fillSkin not disposed when ProgressBar disposed.\", backgroundSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"fillDisabledSkin not disposed when ProgressBar disposed.\", backgroundDisabledSkin.isDisposed);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/RadioTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Radio;\n\timport feathers.core.ToggleGroup;\n\n\timport flexunit.framework.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class RadioTests\n\t{\n\t\tprivate var _radio:Radio;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._radio = new Radio();\n\t\t\tthis._radio.isSelected = true;\n\t\t\tthis._radio.label = \"Click Me\";\n\t\t\tthis._radio.defaultSkin = new Quad(200, 200);\n\t\t\tTestFeathers.starlingRoot.addChild(this._radio);\n\t\t\tthis._radio.validate();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._radio.removeFromParent(true);\n\t\t\tthis._radio = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDefaultToggleGroup():void\n\t\t{\n\t\t\tAssert.assertStrictlyEquals(\"toggleGroup property must be equal to Radio.defaultRadioGroup if not added to another group.\", Radio.defaultRadioGroup, this._radio.toggleGroup);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testToggleGroupPropertyAfterAddingExternally():void\n\t\t{\n\t\t\tvar group:ToggleGroup = new ToggleGroup();\n\t\t\tgroup.addItem(this._radio);\n\t\t\tAssert.assertStrictlyEquals(\"toggleGroup property must be equal to ToggleGroup after adding to that group.\", group, this._radio.toggleGroup);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testToggleGroupPropertyAfterRemovingExternally():void\n\t\t{\n\t\t\tvar group:ToggleGroup = new ToggleGroup();\n\t\t\tgroup.addItem(this._radio);\n\t\t\tgroup.removeItem(this._radio);\n\t\t\tAssert.assertStrictlyEquals(\"toggleGroup property must be equal to Radio.defaultRadioGroup after removing a ToggleButton from another ToggleGroup.\", Radio.defaultRadioGroup, this._radio.toggleGroup);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/RestrictedStyleTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.skins.FunctionStyleProvider;\n\n\timport org.flexunit.Assert;\n\n\tpublic class RestrictedStyleTests\n\t{\n\t\tprivate static const STYLE_PROVIDER_VALUE:Number = 2;\n\t\tprivate static const STYLE_PROVIDER_VALUE2:Number = 5;\n\t\tprivate static const CUSTOM_VALUE:Number = 3;\n\t\tprivate static const CUSTOM_VALUE2:Number = 4;\n\n\t\tprivate var _control:CustomControl;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._control = new CustomControl();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._control.dispose();\n\t\t\tthis._control = null;\n\t\t}\n\n\t\tprivate function setControlStyles(control:CustomControl):void\n\t\t{\n\t\t\tthis._control.style = STYLE_PROVIDER_VALUE;\n\t\t}\n\n\t\tprivate function setControlStyles2(control:CustomControl):void\n\t\t{\n\t\t\tthis._control.style = STYLE_PROVIDER_VALUE2;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testStyleProviderStyle():void\n\t\t{\n\t\t\tthis._control.styleProvider = new FunctionStyleProvider(setControlStyles);\n\t\t\tthis._control.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Unrestricted style incorrectly rejects value from style provider.\",\n\t\t\t\tSTYLE_PROVIDER_VALUE, this._control.style);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRestrictedStyle():void\n\t\t{\n\t\t\tthis._control.styleProvider = new FunctionStyleProvider(setControlStyles);\n\t\t\tthis._control.style = CUSTOM_VALUE;\n\t\t\tthis._control.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Custom value outside of style provider must restrict style.\",\n\t\t\t\tCUSTOM_VALUE, this._control.style);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testReplaceStyleProvider():void\n\t\t{\n\t\t\tthis._control.styleProvider = new FunctionStyleProvider(setControlStyles);\n\t\t\tthis._control.validate();\n\t\t\tthis._control.styleProvider = new FunctionStyleProvider(setControlStyles2);\n\t\t\tthis._control.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Unrestricted style incorrectly rejects value from new style provider.\",\n\t\t\t\tSTYLE_PROVIDER_VALUE2, this._control.style);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testReplaceRestrictedStyle():void\n\t\t{\n\t\t\tthis._control.styleProvider = new FunctionStyleProvider(setControlStyles);\n\t\t\tthis._control.style = CUSTOM_VALUE;\n\t\t\tthis._control.validate();\n\t\t\tthis._control.style = CUSTOM_VALUE2;\n\t\t\tthis._control.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Restricted style incorrectly rejects replacement value from outside style provider.\",\n\t\t\t\tCUSTOM_VALUE2, this._control.style);\n\t\t}\n\t}\n}\n\nimport feathers.core.FeathersControl;\n\nclass CustomControl extends FeathersControl\n{\n\tpublic function CustomControl()\n\t{\n\t\tsuper();\n\t}\n\n\tprivate var _style:Number = -1;\n\n\tpublic function get style():Number\n\t{\n\t\treturn this._style;\n\t}\n\n\tpublic function set style(value:Number):void\n\t{\n\t\tif(this.processStyleRestriction(arguments.callee))\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tthis._style = value;\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/ScaleTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.LayoutGroup;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class ScaleTests\n\t{\n\t\tprivate static const BASE_WIDTH:Number = 100;\n\t\tprivate static const BASE_HEIGHT:Number = 140;\n\n\t\tprivate static const LARGER_WIDTH:Number = 280;\n\t\tprivate static const LARGER_HEIGHT:Number = 300;\n\t\tprivate static const LARGER_MIN_WIDTH:Number = 270;\n\t\tprivate static const LARGER_MIN_HEIGHT:Number = 290;\n\t\t\n\t\tprivate static const LARGER_SCALEX:Number = 2;\n\t\tprivate static const SMALLER_SCALEY:Number = 0.25;\n\t\tprivate static const SMALLER_SCALE:Number = 0.5;\n\t\t\n\t\tprivate var _control:LayoutGroup;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._control = new LayoutGroup();\n\t\t\tthis._control.backgroundSkin = new Quad(BASE_WIDTH, BASE_HEIGHT, 0xff00ff);\n\t\t\tTestFeathers.starlingRoot.addChild(this._control);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._control.removeFromParent(true);\n\t\t\tthis._control = null;\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInitialDimensions():void\n\t\t{\n\t\t\tthis._control.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Component initial width incorrect.\", BASE_WIDTH, this._control.width);\n\t\t\tAssert.assertStrictlyEquals(\"Component initial height incorrect.\", BASE_HEIGHT, this._control.height);\n\t\t\tAssert.assertStrictlyEquals(\"Component initial minWidth incorrect.\", BASE_WIDTH, this._control.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"Component initial minHeight incorrect.\", BASE_HEIGHT, this._control.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetScaleXAndScaleY():void\n\t\t{\n\t\t\tthis._control.scaleX = LARGER_SCALEX;\n\t\t\tthis._control.scaleY = SMALLER_SCALEY;\n\t\t\tthis._control.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Component calculated width incorrect after setting scaleX.\", BASE_WIDTH * LARGER_SCALEX, this._control.width);\n\t\t\tAssert.assertStrictlyEquals(\"Component calculated height incorrect after setting scaleY.\", BASE_HEIGHT * SMALLER_SCALEY, this._control.height);\n\t\t\tAssert.assertStrictlyEquals(\"Component calculated minWidth incorrect after setting scaleX.\", BASE_WIDTH * LARGER_SCALEX, this._control.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"Component calculated minHeight incorrect after setting scaleY.\", BASE_HEIGHT * SMALLER_SCALEY, this._control.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetScale():void\n\t\t{\n\t\t\tthis._control.scale = SMALLER_SCALE;\n\t\t\tthis._control.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Component calculated width incorrect after setting scale.\", BASE_WIDTH * SMALLER_SCALE, this._control.width);\n\t\t\tAssert.assertStrictlyEquals(\"Component calculated height incorrect after setting scale.\", BASE_HEIGHT * SMALLER_SCALE, this._control.height);\n\t\t\tAssert.assertStrictlyEquals(\"Component calculated minWidth incorrect after setting scale.\", BASE_WIDTH * SMALLER_SCALE, this._control.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"Component calculated minHeight incorrect after setting scale.\", BASE_HEIGHT * SMALLER_SCALE, this._control.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetScaleXAndScaleYThenWidthAndHeight():void\n\t\t{\n\t\t\tthis._control.scaleX = LARGER_SCALEX;\n\t\t\tthis._control.scaleY = SMALLER_SCALEY;\n\t\t\tthis._control.width = LARGER_WIDTH;\n\t\t\tthis._control.height = LARGER_HEIGHT;\n\t\t\tthis._control.minWidth = LARGER_MIN_WIDTH;\n\t\t\tthis._control.minHeight = LARGER_MIN_HEIGHT;\n\t\t\tthis._control.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Component width incorrect after setting scaleX then width.\", LARGER_WIDTH, this._control.width);\n\t\t\tAssert.assertStrictlyEquals(\"Component height incorrect after setting scaleY then height.\", LARGER_HEIGHT, this._control.height);\n\t\t\tAssert.assertStrictlyEquals(\"Component minWidth incorrect after setting scaleX then minWidth.\", LARGER_MIN_WIDTH, this._control.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"Component minHeight incorrect after setting scaleY then minHeight.\", LARGER_MIN_HEIGHT, this._control.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetWidthAndHeightThenScaleXAndScaleY():void\n\t\t{\n\t\t\tthis._control.width = LARGER_WIDTH;\n\t\t\tthis._control.height = LARGER_HEIGHT;\n\t\t\tthis._control.minWidth = LARGER_MIN_WIDTH;\n\t\t\tthis._control.minHeight = LARGER_MIN_HEIGHT;\n\t\t\tthis._control.scaleX = LARGER_SCALEX;\n\t\t\tthis._control.scaleY = SMALLER_SCALEY;\n\t\t\tthis._control.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Component width incorrect after setting width then scaleX.\", LARGER_WIDTH * LARGER_SCALEX, this._control.width);\n\t\t\tAssert.assertStrictlyEquals(\"Component height incorrect after setting height then scaleY.\", LARGER_HEIGHT * SMALLER_SCALEY, this._control.height);\n\t\t\tAssert.assertStrictlyEquals(\"Component minWidth incorrect after setting minWidth then scaleX.\", LARGER_MIN_WIDTH * LARGER_SCALEX, this._control.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"Component minHeight incorrect after setting minHeight then scaleY.\", LARGER_MIN_HEIGHT * SMALLER_SCALEY, this._control.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetWidthAndHeightThenScaleXAndScaleYThenWidthAndHeightBackToOriginal():void\n\t\t{\n\t\t\tthis._control.width = LARGER_WIDTH;\n\t\t\tthis._control.height = LARGER_HEIGHT;\n\t\t\tthis._control.minWidth = LARGER_MIN_WIDTH;\n\t\t\tthis._control.minHeight = LARGER_MIN_HEIGHT;\n\t\t\tthis._control.scaleX = LARGER_SCALEX;\n\t\t\tthis._control.scaleY = SMALLER_SCALEY;\n\t\t\tthis._control.width = LARGER_WIDTH;\n\t\t\tthis._control.height = LARGER_HEIGHT;\n\t\t\tthis._control.minWidth = LARGER_MIN_WIDTH;\n\t\t\tthis._control.minHeight = LARGER_MIN_HEIGHT;\n\t\t\tthis._control.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Component width incorrect after setting width then scaleX then width back to original.\", LARGER_WIDTH, this._control.width);\n\t\t\tAssert.assertStrictlyEquals(\"Component height incorrect after setting height then scaleY then height back to original.\", LARGER_HEIGHT, this._control.height);\n\t\t\tAssert.assertStrictlyEquals(\"Component minWidth incorrect after setting minWidth then scaleX then minWidth back to original.\", LARGER_MIN_WIDTH, this._control.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"Component minHeight incorrect after setting minHeight then scaleY then minHeight back to original.\", LARGER_MIN_HEIGHT, this._control.minHeight);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ScreenNavigatorMeasurementTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.AutoSizeMode;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.ScreenNavigator;\n\timport feathers.controls.ScreenNavigatorItem;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class ScreenNavigatorMeasurementTests\n\t{\n\t\tprivate static const SCREEN_ID_ONE:String = \"one\";\n\t\tprivate static const SCREEN_ONE_WIDTH:Number = 100;\n\t\tprivate static const SCREEN_ONE_HEIGHT:Number = 150;\n\n\t\tprivate static const SCREEN_ID_TWO:String = \"two\";\n\t\tprivate static const SCREEN_TWO_WIDTH:Number = 200;\n\t\tprivate static const SCREEN_TWO_HEIGHT:Number = 180;\n\t\tprivate static const SCREEN_TWO_MIN_WIDTH:Number = 110;\n\t\tprivate static const SCREEN_TWO_MIN_HEIGHT:Number = 120;\n\n\t\tprivate var _navigator:ScreenNavigator;\n\t\tprivate var _navigator2:ScreenNavigator;\n\t\tprivate var _screenOne:Quad;\n\t\tprivate var _screenTwo:LayoutGroup;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._screenOne = new Quad(SCREEN_ONE_WIDTH, SCREEN_ONE_HEIGHT, 0xff0000);\n\n\t\t\tvar screenTwoBackground:Quad = new Quad(SCREEN_TWO_WIDTH, SCREEN_TWO_HEIGHT, 0x0000ff);\n\t\t\tthis._screenTwo = new LayoutGroup();\n\t\t\tthis._screenTwo.minWidth = SCREEN_TWO_MIN_WIDTH;\n\t\t\tthis._screenTwo.minHeight = SCREEN_TWO_MIN_HEIGHT;\n\t\t\tthis._screenTwo.backgroundSkin = screenTwoBackground;\n\n\t\t\tthis._navigator = new ScreenNavigator();\n\t\t\tthis._navigator.addScreen(SCREEN_ID_ONE, new ScreenNavigatorItem(this._screenOne));\n\t\t\tthis._navigator.addScreen(SCREEN_ID_TWO, new ScreenNavigatorItem(this._screenTwo));\n\t\t\tTestFeathers.starlingRoot.addChild(this._navigator);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._navigator.removeFromParent(true);\n\t\t\tthis._navigator = null;\n\n\t\t\tif(this._navigator2)\n\t\t\t{\n\t\t\t\tthis._navigator2.removeFromParent(true);\n\t\t\t\tthis._navigator2 = null;\n\t\t\t}\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeModeStage():void\n\t\t{\n\t\t\tthis._navigator.autoSizeMode = AutoSizeMode.STAGE;\n\t\t\tthis._navigator.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the ScreenNavigator was not calculated correctly when empty with AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageWidth, this._navigator.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the ScreenNavigator was not calculated correctly when empty with AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageHeight, this._navigator.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the ScreenNavigator was not calculated correctly when empty with AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageWidth, this._navigator.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the ScreenNavigator was not calculated correctly when empty with AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageHeight, this._navigator.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeModeStageWithoutParent():void\n\t\t{\n\t\t\tthis._navigator2 = new ScreenNavigator();\n\t\t\tthis._navigator2.autoSizeMode = AutoSizeMode.STAGE;\n\t\t\tthis._navigator2.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the ScreenNavigator was not calculated correctly with no parent and AutoSizeMode.STAGE.\",\n\t\t\t\t0, this._navigator2.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the ScreenNavigator was not calculated correctly with no parent and AutoSizeMode.STAGE.\",\n\t\t\t\t0, this._navigator2.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the ScreenNavigator was not calculated correctly with no parent and AutoSizeMode.STAGE.\",\n\t\t\t\t0, this._navigator2.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the ScreenNavigator was not calculated correctly with no parent and AutoSizeMode.STAGE.\",\n\t\t\t\t0, this._navigator2.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeModeStageWithValidateBeforeAdd():void\n\t\t{\n\t\t\tthis._navigator2 = new ScreenNavigator();\n\t\t\tthis._navigator2.autoSizeMode = AutoSizeMode.STAGE;\n\t\t\tthis._navigator2.validate();\n\t\t\tTestFeathers.starlingRoot.addChild(this._navigator2);\n\t\t\tthis._navigator2.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the ScreenNavigator was not calculated correctly after addChild() when validated before with AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageWidth, this._navigator2.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the ScreenNavigator was not calculated correctly after addChild() when validated before with AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageHeight, this._navigator2.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the ScreenNavigator was not calculated correctly after addChild() when validated before with AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageWidth, this._navigator2.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the ScreenNavigator was not calculated correctly after addChild() when validated before with AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageHeight, this._navigator2.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeModeContentWithNoActiveScreen():void\n\t\t{\n\t\t\tthis._navigator.autoSizeMode = AutoSizeMode.CONTENT;\n\t\t\tthis._navigator.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the ScreenNavigator was not calculated correctly when empty with AutoSizeMode.CONTENT.\",\n\t\t\t\t0, this._navigator.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the ScreenNavigator was not calculated correctly when empty with AutoSizeMode.CONTENT.\",\n\t\t\t\t0, this._navigator.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the ScreenNavigator was not calculated correctly when empty with AutoSizeMode.CONTENT.\",\n\t\t\t\t0, this._navigator.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the ScreenNavigator was not calculated correctly when empty with AutoSizeMode.CONTENT.\",\n\t\t\t\t0, this._navigator.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeModeStageWithSimpleScreen():void\n\t\t{\n\t\t\tthis._navigator.autoSizeMode = AutoSizeMode.STAGE;\n\t\t\tthis._navigator.showScreen(SCREEN_ID_ONE);\n\t\t\tthis._navigator.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the ScreenNavigator was not calculated correctly with simple screen and AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageWidth, this._navigator.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the ScreenNavigator was not calculated correctly with simple screen and AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageHeight, this._navigator.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the ScreenNavigator was not calculated correctly with simple screen and AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageWidth, this._navigator.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the ScreenNavigator was not calculated correctly with simple screen and AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageHeight, this._navigator.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeModeContentWithSimpleScreen():void\n\t\t{\n\t\t\tthis._navigator.autoSizeMode = AutoSizeMode.CONTENT;\n\t\t\tthis._navigator.showScreen(SCREEN_ID_ONE);\n\t\t\tthis._navigator.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the ScreenNavigator was not calculated correctly with simple screen and AutoSizeMode.CONTENT.\",\n\t\t\t\tSCREEN_ONE_WIDTH, this._navigator.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the ScreenNavigator was not calculated correctly with simple screen and AutoSizeMode.CONTENT.\",\n\t\t\t\tSCREEN_ONE_HEIGHT, this._navigator.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the ScreenNavigator was not calculated correctly with simple screen and AutoSizeMode.CONTENT.\",\n\t\t\t\tSCREEN_ONE_WIDTH, this._navigator.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the ScreenNavigator was not calculated correctly with simple screen and AutoSizeMode.CONTENT.\",\n\t\t\t\tSCREEN_ONE_HEIGHT, this._navigator.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeModeContentWithComplexScreen():void\n\t\t{\n\t\t\tthis._navigator.autoSizeMode = AutoSizeMode.CONTENT;\n\t\t\tthis._navigator.showScreen(SCREEN_ID_TWO);\n\t\t\tthis._navigator.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the ScreenNavigator was not calculated correctly with complex screen and AutoSizeMode.CONTENT.\",\n\t\t\t\tSCREEN_TWO_WIDTH, this._navigator.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the ScreenNavigator was not calculated correctly with complex screen and AutoSizeMode.CONTENT.\",\n\t\t\t\tSCREEN_TWO_HEIGHT, this._navigator.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the ScreenNavigator was not calculated correctly with complex screen and AutoSizeMode.CONTENT.\",\n\t\t\t\tSCREEN_TWO_MIN_WIDTH, this._navigator.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the ScreenNavigator was not calculated correctly with complex screen and AutoSizeMode.CONTENT.\",\n\t\t\t\tSCREEN_TWO_MIN_HEIGHT, this._navigator.minHeight);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ScreenNavigatorTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.ScreenNavigator;\n\timport feathers.controls.ScreenNavigatorItem;\n\timport feathers.events.FeathersEventType;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class ScreenNavigatorTests\n\t{\n\t\tprivate static const SCREEN_A_ID:String = \"a\";\n\t\tprivate static const SCREEN_B_ID:String = \"b\";\n\t\t\n\t\tprivate static const EVENT_SHOW_SCREEN_B:String = \"showScreenB\";\n\t\tprivate static const EVENT_CALL_FUNCTION:String = \"callFunction\";\n\t\t\n\t\tprivate var _navigator:ScreenNavigator;\n\t\t\n\t\tprivate var _functionWasCalled:Boolean = false;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._navigator = new ScreenNavigator();\n\t\t\tTestFeathers.starlingRoot.addChild(this._navigator);\n\t\t\tthis._navigator.validate();\n\t\t\t\n\t\t\tthis._functionWasCalled = false;\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._navigator.removeFromParent(true);\n\t\t\tthis._navigator = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHasScreenWhenNotAdded():void\n\t\t{\n\t\t\tAssert.assertFalse(\"hasScreen() incorrectly returned true for a screen that was not added\", this._navigator.hasScreen(SCREEN_A_ID));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHasScreen():void\n\t\t{\n\t\t\tthis.addScreenA();\n\t\t\tAssert.assertTrue(\"hasScreen() incorrectly returned false for a screen that was added\", this._navigator.hasScreen(SCREEN_A_ID));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testStateWithEmptyStack():void\n\t\t{\n\t\t\tAssert.assertNull(\"activeScreen returned incorrect value for empty ScreenNavigator\", this._navigator.activeScreen);\n\t\t\tAssert.assertNull(\"activeScreenID returned incorrect value for empty ScreenNavigator\", this._navigator.activeScreenID);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testShowScreen():void\n\t\t{\n\t\t\tthis.addScreenA();\n\t\t\tthis.addScreenB();\n\t\t\tthis._navigator.showScreen(SCREEN_A_ID);\n\t\t\tAssert.assertStrictlyEquals(\"activeScreen returned incorrect value after showScreen()\", this._navigator.getScreen(SCREEN_A_ID).screen, this._navigator.activeScreen);\n\t\t\tAssert.assertStrictlyEquals(\"activeScreenID returned incorrect value for after showScreen()\", SCREEN_A_ID, this._navigator.activeScreenID);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testShowAnotherScreen():void\n\t\t{\n\t\t\tthis.addScreenA();\n\t\t\tthis.addScreenB();\n\t\t\tthis._navigator.showScreen(SCREEN_A_ID);\n\t\t\tthis._navigator.showScreen(SCREEN_B_ID);\n\t\t\tAssert.assertStrictlyEquals(\"activeScreen returned incorrect value after two calls to showScreen()\", this._navigator.getScreen(SCREEN_B_ID).screen, this._navigator.activeScreen);\n\t\t\tAssert.assertStrictlyEquals(\"activeScreenID returned incorrect value after two calls to showScreen()\", SCREEN_B_ID, this._navigator.activeScreenID);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testClearScreen():void\n\t\t{\n\t\t\tthis.addScreenA();\n\t\t\tthis._navigator.showScreen(SCREEN_A_ID);\n\t\t\tthis._navigator.clearScreen();\n\t\t\tAssert.assertNull(\"activeScreen returned incorrect value for stack after clearScreen()\", this._navigator.activeScreen);\n\t\t\tAssert.assertNull(\"activeScreenID returned incorrect value for stack after clearScreen()\", this._navigator.activeScreenID);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testShowScreenWithEvent():void\n\t\t{\n\t\t\tthis.addScreenA();\n\t\t\tthis.addScreenB();\n\t\t\tthis._navigator.showScreen(SCREEN_A_ID);\n\t\t\tthis._navigator.activeScreen.dispatchEventWith(EVENT_SHOW_SCREEN_B);\n\t\t\tAssert.assertStrictlyEquals(\"activeScreen returned incorrect value after show screen with event\", this._navigator.getScreen(SCREEN_B_ID).screen, this._navigator.activeScreen);\n\t\t\tAssert.assertStrictlyEquals(\"activeScreenID returned incorrect value after show screen with event\", SCREEN_B_ID, this._navigator.activeScreenID);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCallFunctionWithEvent():void\n\t\t{\n\t\t\tthis.addScreenA();\n\t\t\tthis.addScreenB();\n\t\t\tthis._navigator.showScreen(SCREEN_A_ID);\n\t\t\tthis._navigator.activeScreen.dispatchEventWith(EVENT_CALL_FUNCTION);\n\t\t\tAssert.assertTrue(\"Function passed to setFunctionForEvent() was not called after dispatching the event.\", this._functionWasCalled);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveScreenOnTransitionCompleteEvent():void\n\t\t{\n\t\t\tthis.addScreenA();\n\t\t\tthis.addScreenB();\n\t\t\tthis._navigator.showScreen(SCREEN_A_ID);\n\t\t\tthis._navigator.addEventListener(FeathersEventType.TRANSITION_COMPLETE, removeScreenA);\n\t\t\tthis._navigator.clearScreen();\n\t\t\tAssert.assertFalse(this._navigator.hasScreen(SCREEN_A_ID));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveAllScreensOnTransitionCompleteEvent():void\n\t\t{\n\t\t\tthis.addScreenA();\n\t\t\tthis.addScreenB();\n\t\t\tthis._navigator.showScreen(SCREEN_A_ID);\n\t\t\tthis._navigator.addEventListener(FeathersEventType.TRANSITION_COMPLETE, removeAllScreens);\n\t\t\tthis._navigator.clearScreen();\n\t\t\tAssert.assertFalse(this._navigator.hasScreen(SCREEN_A_ID));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testScreenWithEventAndMethodWithSameName():void\n\t\t{\n\t\t\tvar item:ScreenNavigatorItem = new ScreenNavigatorItem(ScreenWithEventAndMethodWithSameName);\n\t\t\titem.setScreenIDForEvent(EVENT_SHOW_SCREEN_B, SCREEN_B_ID);\n\t\t\tthis._navigator.addScreen(SCREEN_A_ID, item);\n\t\t\tthis._navigator.showScreen(SCREEN_A_ID);\n\t\t}\n\n\t\tprivate function addScreenA():void\n\t\t{\n\t\t\tvar screen:Quad = new Quad(10, 10, 0xff00ff);\n\t\t\tvar item:ScreenNavigatorItem = new ScreenNavigatorItem(screen);\n\t\t\titem.setScreenIDForEvent(EVENT_SHOW_SCREEN_B, SCREEN_B_ID);\n\t\t\titem.setFunctionForEvent(EVENT_CALL_FUNCTION, eventFunction);\n\t\t\tthis._navigator.addScreen(SCREEN_A_ID, item);\n\t\t}\n\n\t\tprivate function addScreenB():void\n\t\t{\n\t\t\tvar screen:Quad = new Quad(10, 10, 0xffff00);\n\t\t\tvar item:ScreenNavigatorItem = new ScreenNavigatorItem(screen);\n\t\t\tthis._navigator.addScreen(SCREEN_B_ID, item);\n\t\t}\n\n\t\tprivate function eventFunction():void\n\t\t{\n\t\t\tthis._functionWasCalled = true;\n\t\t}\n\n\t\tprivate function removeScreenA():void\n\t\t{\n\t\t\tthis._navigator.removeScreen(SCREEN_A_ID);\n\t\t}\n\n\t\tprivate function removeAllScreens():void\n\t\t{\n\t\t\tthis._navigator.removeAllScreens();\n\t\t}\n\t}\n}\n\nimport starling.display.Quad;\n\nclass ScreenWithEventAndMethodWithSameName extends Quad\n{\n\tpublic function ScreenWithEventAndMethodWithSameName()\n\t{\n\t\tsuper(10, 10, 0xff00ff);\n\t}\n\t\n\tpublic function showScreenB():void {}\n}"
  },
  {
    "path": "test/source/feathers/tests/ScrollBarHorizontalMeasurementTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.BasicButton;\n\timport feathers.controls.ScrollBar;\n\timport feathers.controls.TrackLayoutMode;\n\timport feathers.layout.Direction;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class ScrollBarHorizontalMeasurementTests\n\t{\n\t\tprivate static const SINGLE_TRACK_WIDTH:Number = 200;\n\t\tprivate static const SINGLE_TRACK_HEIGHT:Number = 50;\n\t\tprivate static const SINGLE_TRACK_MIN_WIDTH:Number = 150;\n\t\tprivate static const SINGLE_TRACK_MIN_HEIGHT:Number = 30;\n\n\t\tprivate static const MINIMUM_TRACK_WIDTH:Number = 100;\n\t\tprivate static const MINIMUM_TRACK_HEIGHT:Number = 50;\n\t\tprivate static const MINIMUM_TRACK_MIN_WIDTH:Number = 80;\n\t\tprivate static const MINIMUM_TRACK_MIN_HEIGHT:Number = 20;\n\n\t\tprivate static const MAXIMUM_TRACK_WIDTH:Number = 110;\n\t\tprivate static const MAXIMUM_TRACK_HEIGHT:Number = 55;\n\t\tprivate static const MAXIMUM_TRACK_MIN_WIDTH:Number = 90;\n\t\tprivate static const MAXIMUM_TRACK_MIN_HEIGHT:Number = 25;\n\n\t\tprivate static const THUMB_WIDTH:Number = 30;\n\t\tprivate static const SMALL_THUMB_HEIGHT:Number = 40;\n\t\tprivate static const LARGE_THUMB_HEIGHT:Number = 60;\n\n\t\tprivate static const THUMB_MIN_WIDTH:Number = 18;\n\t\tprivate static const SMALL_THUMB_MIN_HEIGHT:Number = 20;\n\t\tprivate static const LARGE_THUMB_MIN_HEIGHT:Number = 40;\n\n\t\tprivate static const DECREMENT_BUTTON_WIDTH:Number = 28;\n\t\tprivate static const SMALL_DECREMENT_BUTTON_HEIGHT:Number = 38;\n\t\tprivate static const LARGE_DECREMENT_BUTTON_HEIGHT:Number = 62;\n\n\t\tprivate static const DECREMENT_BUTTON_MIN_WIDTH:Number = 20;\n\t\tprivate static const SMALL_DECREMENT_BUTTON_MIN_HEIGHT:Number = 18;\n\t\tprivate static const LARGE_DECREMENT_BUTTON_MIN_HEIGHT:Number = 50;\n\n\t\tprivate static const INCREMENT_BUTTON_WIDTH:Number = 26;\n\t\tprivate static const SMALL_INCREMENT_BUTTON_HEIGHT:Number = 36;\n\t\tprivate static const LARGE_INCREMENT_BUTTON_HEIGHT:Number = 64;\n\n\t\tprivate static const INCREMENT_BUTTON_MIN_WIDTH:Number = 24;\n\t\tprivate static const SMALL_INCREMENT_BUTTON_MIN_HEIGHT:Number = 14;\n\t\tprivate static const LARGE_INCREMENT_BUTTON_MIN_HEIGHT:Number = 62;\n\n\t\tprivate var _scrollBar:ScrollBar;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._scrollBar = new ScrollBar();\n\t\t\tthis._scrollBar.direction = Direction.HORIZONTAL;\n\t\t\tTestFeathers.starlingRoot.addChild(this._scrollBar);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._scrollBar.removeFromParent(true);\n\t\t\tthis._scrollBar = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithTrackLayoutModeSingle():void\n\t\t{\n\t\t\tthis._scrollBar.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, SMALL_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SINGLE_TRACK_WIDTH, SINGLE_TRACK_HEIGHT, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.decrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(DECREMENT_BUTTON_WIDTH, SMALL_DECREMENT_BUTTON_HEIGHT, 0x00ff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.incrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(INCREMENT_BUTTON_WIDTH, SMALL_INCREMENT_BUTTON_HEIGHT, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE.\",\n\t\t\t\tSINGLE_TRACK_WIDTH + DECREMENT_BUTTON_WIDTH + INCREMENT_BUTTON_WIDTH, this._scrollBar.width);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE.\",\n\t\t\t\tSINGLE_TRACK_WIDTH + DECREMENT_BUTTON_WIDTH + INCREMENT_BUTTON_WIDTH, this._scrollBar.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE.\",\n\t\t\t\tSINGLE_TRACK_HEIGHT, this._scrollBar.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE.\",\n\t\t\t\tSINGLE_TRACK_HEIGHT, this._scrollBar.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeHeightWithTrackLayoutModeSingleAndLargerThumb():void\n\t\t{\n\t\t\tthis._scrollBar.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, LARGE_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SINGLE_TRACK_WIDTH, SINGLE_TRACK_HEIGHT, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.decrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(DECREMENT_BUTTON_WIDTH, SMALL_DECREMENT_BUTTON_HEIGHT, 0x00ff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.incrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(INCREMENT_BUTTON_WIDTH, SMALL_INCREMENT_BUTTON_HEIGHT, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The height of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and larger thumb.\",\n\t\t\t\tLARGE_THUMB_HEIGHT, this._scrollBar.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and larger thumb.\",\n\t\t\t\tLARGE_THUMB_HEIGHT, this._scrollBar.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeHeightWithTrackLayoutModeSingleAndLargerDecrementButton():void\n\t\t{\n\t\t\tthis._scrollBar.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, SMALL_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SINGLE_TRACK_WIDTH, SINGLE_TRACK_HEIGHT, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.decrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(DECREMENT_BUTTON_WIDTH, LARGE_DECREMENT_BUTTON_HEIGHT, 0x00ff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.incrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(INCREMENT_BUTTON_WIDTH, SMALL_INCREMENT_BUTTON_HEIGHT, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The height of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and larger decrement button.\",\n\t\t\t\tLARGE_DECREMENT_BUTTON_HEIGHT, this._scrollBar.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and larger decrement button.\",\n\t\t\t\tLARGE_DECREMENT_BUTTON_HEIGHT, this._scrollBar.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeHeightWithTrackLayoutModeSingleAndLargerIncrementButton():void\n\t\t{\n\t\t\tthis._scrollBar.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, SMALL_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SINGLE_TRACK_WIDTH, SINGLE_TRACK_HEIGHT, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.decrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(DECREMENT_BUTTON_WIDTH, SMALL_DECREMENT_BUTTON_HEIGHT, 0x00ff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.incrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(INCREMENT_BUTTON_WIDTH, LARGE_INCREMENT_BUTTON_HEIGHT, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The height of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and larger increment button.\",\n\t\t\t\tLARGE_INCREMENT_BUTTON_HEIGHT, this._scrollBar.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and larger increment button.\",\n\t\t\t\tLARGE_INCREMENT_BUTTON_HEIGHT, this._scrollBar.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithTrackLayoutModeSingleAndMinDimensions():void\n\t\t{\n\t\t\tthis._scrollBar.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, SMALL_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\tthumb.minWidth = THUMB_MIN_WIDTH;\n\t\t\t\tthumb.minHeight = SMALL_THUMB_MIN_HEIGHT;\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SINGLE_TRACK_WIDTH, SINGLE_TRACK_HEIGHT, 0xffff00);\n\t\t\t\tbutton.minWidth = SINGLE_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = SINGLE_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.decrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(DECREMENT_BUTTON_WIDTH, SMALL_DECREMENT_BUTTON_HEIGHT, 0x00ff00);\n\t\t\t\tbutton.minWidth = DECREMENT_BUTTON_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = SMALL_DECREMENT_BUTTON_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.incrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(INCREMENT_BUTTON_WIDTH, SMALL_INCREMENT_BUTTON_HEIGHT, 0x00ffff);\n\t\t\t\tbutton.minWidth = INCREMENT_BUTTON_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = SMALL_INCREMENT_BUTTON_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and the track's minWidth is set.\",\n\t\t\t\tSINGLE_TRACK_MIN_WIDTH + DECREMENT_BUTTON_MIN_WIDTH + INCREMENT_BUTTON_MIN_WIDTH, this._scrollBar.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and the track's minHeight is set.\",\n\t\t\t\tSINGLE_TRACK_MIN_HEIGHT, this._scrollBar.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeMinHeightWithTrackLayoutModeSingleAndLargerThumb():void\n\t\t{\n\t\t\tthis._scrollBar.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, LARGE_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\tthumb.minWidth = THUMB_MIN_WIDTH;\n\t\t\t\tthumb.minHeight = LARGE_THUMB_MIN_HEIGHT;\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SINGLE_TRACK_WIDTH, SINGLE_TRACK_HEIGHT, 0xffff00);\n\t\t\t\tbutton.minWidth = SINGLE_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = SINGLE_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.decrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(DECREMENT_BUTTON_WIDTH, SMALL_DECREMENT_BUTTON_HEIGHT, 0x00ff00);\n\t\t\t\tbutton.minWidth = DECREMENT_BUTTON_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = SMALL_DECREMENT_BUTTON_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.incrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(INCREMENT_BUTTON_WIDTH, SMALL_INCREMENT_BUTTON_HEIGHT, 0x00ffff);\n\t\t\t\tbutton.minWidth = INCREMENT_BUTTON_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = SMALL_INCREMENT_BUTTON_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and larger thumb minHeight.\",\n\t\t\t\tLARGE_THUMB_MIN_HEIGHT, this._scrollBar.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeMinHeightWithTrackLayoutModeSingleAndLargerDecrementButton():void\n\t\t{\n\t\t\tthis._scrollBar.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, SMALL_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\tthumb.minWidth = THUMB_MIN_WIDTH;\n\t\t\t\tthumb.minHeight = LARGE_THUMB_MIN_HEIGHT;\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SINGLE_TRACK_WIDTH, SINGLE_TRACK_HEIGHT, 0xffff00);\n\t\t\t\tbutton.minWidth = SINGLE_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = SINGLE_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.decrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(DECREMENT_BUTTON_WIDTH, LARGE_DECREMENT_BUTTON_HEIGHT, 0x00ff00);\n\t\t\t\tbutton.minWidth = DECREMENT_BUTTON_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = LARGE_DECREMENT_BUTTON_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.incrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(INCREMENT_BUTTON_WIDTH, SMALL_INCREMENT_BUTTON_HEIGHT, 0x00ffff);\n\t\t\t\tbutton.minWidth = INCREMENT_BUTTON_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = SMALL_INCREMENT_BUTTON_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and larger decrement button minHeight.\",\n\t\t\t\tLARGE_DECREMENT_BUTTON_MIN_HEIGHT, this._scrollBar.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeMinHeightWithTrackLayoutModeSingleAndLargerIncrementButton():void\n\t\t{\n\t\t\tthis._scrollBar.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, SMALL_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\tthumb.minWidth = THUMB_MIN_WIDTH;\n\t\t\t\tthumb.minHeight = LARGE_THUMB_MIN_HEIGHT;\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SINGLE_TRACK_WIDTH, SINGLE_TRACK_HEIGHT, 0xffff00);\n\t\t\t\tbutton.minWidth = SINGLE_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = SINGLE_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.decrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(DECREMENT_BUTTON_WIDTH, SMALL_DECREMENT_BUTTON_HEIGHT, 0x00ff00);\n\t\t\t\tbutton.minWidth = DECREMENT_BUTTON_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = SMALL_DECREMENT_BUTTON_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.incrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(INCREMENT_BUTTON_WIDTH, LARGE_INCREMENT_BUTTON_HEIGHT, 0x00ffff);\n\t\t\t\tbutton.minWidth = INCREMENT_BUTTON_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = LARGE_INCREMENT_BUTTON_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and larger increment button minHeight.\",\n\t\t\t\tLARGE_INCREMENT_BUTTON_MIN_HEIGHT, this._scrollBar.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithTrackLayoutModeSplit():void\n\t\t{\n\t\t\tthis._scrollBar.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, SMALL_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MINIMUM_TRACK_WIDTH, MINIMUM_TRACK_HEIGHT, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.maximumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MAXIMUM_TRACK_WIDTH, MAXIMUM_TRACK_HEIGHT, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.decrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(DECREMENT_BUTTON_WIDTH, SMALL_DECREMENT_BUTTON_HEIGHT, 0x00ff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.incrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(INCREMENT_BUTTON_WIDTH, SMALL_INCREMENT_BUTTON_HEIGHT, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT.\",\n\t\t\t\tMINIMUM_TRACK_WIDTH + MAXIMUM_TRACK_WIDTH + DECREMENT_BUTTON_WIDTH + INCREMENT_BUTTON_WIDTH, this._scrollBar.width);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT.\",\n\t\t\t\tMINIMUM_TRACK_WIDTH + MAXIMUM_TRACK_WIDTH + DECREMENT_BUTTON_WIDTH + INCREMENT_BUTTON_WIDTH, this._scrollBar.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT.\",\n\t\t\t\tMAXIMUM_TRACK_HEIGHT, this._scrollBar.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT.\",\n\t\t\t\tMAXIMUM_TRACK_HEIGHT, this._scrollBar.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeHeightWithTrackLayoutModeSplitAndLargerThumb():void\n\t\t{\n\t\t\tthis._scrollBar.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, LARGE_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MINIMUM_TRACK_WIDTH, MINIMUM_TRACK_HEIGHT, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.maximumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MAXIMUM_TRACK_WIDTH, MAXIMUM_TRACK_HEIGHT, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.decrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(DECREMENT_BUTTON_WIDTH, SMALL_DECREMENT_BUTTON_HEIGHT, 0x00ff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.incrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(INCREMENT_BUTTON_WIDTH, SMALL_INCREMENT_BUTTON_HEIGHT, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The height of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT and larger thumb.\",\n\t\t\t\tLARGE_THUMB_HEIGHT, this._scrollBar.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT and larger thumb.\",\n\t\t\t\tLARGE_THUMB_HEIGHT, this._scrollBar.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeHeightWithTrackLayoutModeSplitAndLargerDecrementButton():void\n\t\t{\n\t\t\tthis._scrollBar.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, SMALL_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MINIMUM_TRACK_WIDTH, MINIMUM_TRACK_HEIGHT, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.maximumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MAXIMUM_TRACK_WIDTH, MAXIMUM_TRACK_HEIGHT, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.decrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(DECREMENT_BUTTON_WIDTH, LARGE_DECREMENT_BUTTON_HEIGHT, 0x00ff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.incrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(INCREMENT_BUTTON_WIDTH, SMALL_INCREMENT_BUTTON_HEIGHT, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The height of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT and larger decrement button.\",\n\t\t\t\tLARGE_DECREMENT_BUTTON_HEIGHT, this._scrollBar.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT and larger decrement button.\",\n\t\t\t\tLARGE_DECREMENT_BUTTON_HEIGHT, this._scrollBar.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeHeightWithTrackLayoutModeSplitAndLargerIncrementButton():void\n\t\t{\n\t\t\tthis._scrollBar.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, SMALL_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MINIMUM_TRACK_WIDTH, MINIMUM_TRACK_HEIGHT, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.maximumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MAXIMUM_TRACK_WIDTH, MAXIMUM_TRACK_HEIGHT, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.decrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(DECREMENT_BUTTON_WIDTH, SMALL_DECREMENT_BUTTON_HEIGHT, 0x00ff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.incrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(INCREMENT_BUTTON_WIDTH, LARGE_INCREMENT_BUTTON_HEIGHT, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The height of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT and larger increment button.\",\n\t\t\t\tLARGE_INCREMENT_BUTTON_HEIGHT, this._scrollBar.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT and larger increment button.\",\n\t\t\t\tLARGE_INCREMENT_BUTTON_HEIGHT, this._scrollBar.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithTrackLayoutModeSplitAndMinDimensions():void\n\t\t{\n\t\t\tthis._scrollBar.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, SMALL_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\tthumb.minWidth = THUMB_MIN_WIDTH;\n\t\t\t\tthumb.minHeight = SMALL_THUMB_MIN_HEIGHT;\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MINIMUM_TRACK_WIDTH, MINIMUM_TRACK_HEIGHT, 0xffff00);\n\t\t\t\tbutton.minWidth = MINIMUM_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = MINIMUM_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.maximumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MAXIMUM_TRACK_WIDTH, MAXIMUM_TRACK_HEIGHT, 0x00ffff);\n\t\t\t\tbutton.minWidth = MAXIMUM_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = MAXIMUM_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.decrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(DECREMENT_BUTTON_WIDTH, SMALL_DECREMENT_BUTTON_HEIGHT, 0x00ff00);\n\t\t\t\tbutton.minWidth = DECREMENT_BUTTON_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = SMALL_DECREMENT_BUTTON_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.incrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(INCREMENT_BUTTON_WIDTH, SMALL_INCREMENT_BUTTON_HEIGHT, 0x00ffff);\n\t\t\t\tbutton.minWidth = INCREMENT_BUTTON_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = SMALL_INCREMENT_BUTTON_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT when the track's minWidth is set.\",\n\t\t\t\tMINIMUM_TRACK_MIN_WIDTH + MAXIMUM_TRACK_MIN_WIDTH + DECREMENT_BUTTON_MIN_WIDTH + INCREMENT_BUTTON_MIN_WIDTH, this._scrollBar.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT when the track's minHeight is set.\",\n\t\t\t\tMAXIMUM_TRACK_MIN_HEIGHT, this._scrollBar.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeMinHeightWithTrackLayoutModeSplitAndLargerThumb():void\n\t\t{\n\t\t\tthis._scrollBar.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, LARGE_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\tthumb.minWidth = THUMB_MIN_WIDTH;\n\t\t\t\tthumb.minHeight = LARGE_THUMB_MIN_HEIGHT;\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MINIMUM_TRACK_WIDTH, MINIMUM_TRACK_HEIGHT, 0xffff00);\n\t\t\t\tbutton.minWidth = MINIMUM_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = MINIMUM_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.maximumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MAXIMUM_TRACK_WIDTH, MAXIMUM_TRACK_HEIGHT, 0x00ffff);\n\t\t\t\tbutton.minWidth = MAXIMUM_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = MAXIMUM_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.decrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(DECREMENT_BUTTON_WIDTH, SMALL_DECREMENT_BUTTON_HEIGHT, 0x00ff00);\n\t\t\t\tbutton.minWidth = DECREMENT_BUTTON_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = SMALL_DECREMENT_BUTTON_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.incrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(INCREMENT_BUTTON_WIDTH, SMALL_INCREMENT_BUTTON_HEIGHT, 0x00ffff);\n\t\t\t\tbutton.minWidth = INCREMENT_BUTTON_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = SMALL_INCREMENT_BUTTON_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT and larger thumb minHeight.\",\n\t\t\t\tLARGE_THUMB_MIN_HEIGHT, this._scrollBar.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeMinHeightWithTrackLayoutModeSplitAndLargerDecrementButton():void\n\t\t{\n\t\t\tthis._scrollBar.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, SMALL_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\tthumb.minWidth = THUMB_MIN_WIDTH;\n\t\t\t\tthumb.minHeight = SMALL_THUMB_MIN_HEIGHT;\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MINIMUM_TRACK_WIDTH, MINIMUM_TRACK_HEIGHT, 0xffff00);\n\t\t\t\tbutton.minWidth = MINIMUM_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = MINIMUM_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.maximumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MAXIMUM_TRACK_WIDTH, MAXIMUM_TRACK_HEIGHT, 0x00ffff);\n\t\t\t\tbutton.minWidth = MAXIMUM_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = MAXIMUM_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.decrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(DECREMENT_BUTTON_WIDTH, LARGE_DECREMENT_BUTTON_HEIGHT, 0x00ff00);\n\t\t\t\tbutton.minWidth = DECREMENT_BUTTON_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = LARGE_DECREMENT_BUTTON_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.incrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(INCREMENT_BUTTON_WIDTH, SMALL_INCREMENT_BUTTON_HEIGHT, 0x00ffff);\n\t\t\t\tbutton.minWidth = INCREMENT_BUTTON_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = SMALL_INCREMENT_BUTTON_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT and larger decrement button minHeight.\",\n\t\t\t\tLARGE_DECREMENT_BUTTON_MIN_HEIGHT, this._scrollBar.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeMinHeightWithTrackLayoutModeSplitAndLargerIncrementButton():void\n\t\t{\n\t\t\tthis._scrollBar.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, SMALL_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\tthumb.minWidth = THUMB_MIN_WIDTH;\n\t\t\t\tthumb.minHeight = SMALL_THUMB_MIN_HEIGHT;\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MINIMUM_TRACK_WIDTH, MINIMUM_TRACK_HEIGHT, 0xffff00);\n\t\t\t\tbutton.minWidth = MINIMUM_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = MINIMUM_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.maximumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MAXIMUM_TRACK_WIDTH, MAXIMUM_TRACK_HEIGHT, 0x00ffff);\n\t\t\t\tbutton.minWidth = MAXIMUM_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = MAXIMUM_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.decrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(DECREMENT_BUTTON_WIDTH, SMALL_DECREMENT_BUTTON_HEIGHT, 0x00ff00);\n\t\t\t\tbutton.minWidth = DECREMENT_BUTTON_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = SMALL_DECREMENT_BUTTON_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.incrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(INCREMENT_BUTTON_WIDTH, LARGE_INCREMENT_BUTTON_HEIGHT, 0x00ffff);\n\t\t\t\tbutton.minWidth = INCREMENT_BUTTON_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = LARGE_INCREMENT_BUTTON_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the horizontal ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT and larger increment button minHeight.\",\n\t\t\t\tLARGE_INCREMENT_BUTTON_MIN_HEIGHT, this._scrollBar.minHeight);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ScrollBarHorizontalTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.ScrollBar;\n\timport feathers.controls.TrackLayoutMode;\n\timport feathers.layout.Direction;\n\n\timport flash.geom.Point;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\tpublic class ScrollBarHorizontalTests\n\t{\n\t\tprivate static const DECREMENT_BUTTON_NAME:String = \"decrement-button\";\n\t\tprivate static const INCREMENT_BUTTON_NAME:String = \"increment-button\";\n\t\tprivate static const THUMB_NAME:String = \"thumb\";\n\t\tprivate static const TRACK_NAME:String = \"track\";\n\t\tprivate static const TRACK_WIDTH:Number = 200;\n\t\tprivate static const TRACK_HEIGHT:Number = 20;\n\t\tprivate static const THUMB_WIDTH:Number = 20;\n\t\tprivate static const THUMB_HEIGHT:Number = 20;\n\t\tprivate static const DECREMENT_BUTTON_WIDTH:Number = 30;\n\t\tprivate static const DECREMENT_BUTTON_HEIGHT:Number = 20;\n\t\tprivate static const INCREMENT_BUTTON_WIDTH:Number = 30;\n\t\tprivate static const INCREMENT_BUTTON_HEIGHT:Number = 20;\n\n\t\tprivate var _scrollBar:ScrollBar;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._scrollBar = new ScrollBar();\n\t\t\tthis._scrollBar.direction = Direction.HORIZONTAL;\n\t\t\tthis._scrollBar.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._scrollBar.decrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar decrementButton:Button = new Button();\n\t\t\t\tdecrementButton.name = DECREMENT_BUTTON_NAME;\n\t\t\t\tdecrementButton.defaultSkin = new Quad(DECREMENT_BUTTON_WIDTH, DECREMENT_BUTTON_HEIGHT);\n\t\t\t\treturn decrementButton;\n\t\t\t};\n\t\t\tthis._scrollBar.incrementButtonFactory = function():Button\n\t\t\t{\n\t\t\t\tvar incrementButton:Button = new Button();\n\t\t\t\tincrementButton.name = INCREMENT_BUTTON_NAME;\n\t\t\t\tincrementButton.defaultSkin = new Quad(INCREMENT_BUTTON_WIDTH, INCREMENT_BUTTON_HEIGHT);\n\t\t\t\treturn incrementButton;\n\t\t\t};\n\t\t\tthis._scrollBar.minimumTrackFactory = function():Button\n\t\t\t{\n\t\t\t\tvar track:Button = new Button();\n\t\t\t\ttrack.name = TRACK_NAME;\n\t\t\t\ttrack.defaultSkin = new Quad(TRACK_WIDTH, TRACK_HEIGHT);\n\t\t\t\treturn track;\n\t\t\t};\n\t\t\tthis._scrollBar.thumbFactory = function():Button\n\t\t\t{\n\t\t\t\tvar thumb:Button = new Button();\n\t\t\t\tthumb.name = THUMB_NAME;\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, THUMB_HEIGHT);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tTestFeathers.starlingRoot.addChild(this._scrollBar);\n\t\t\tthis._scrollBar.validate();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._scrollBar.removeFromParent(true);\n\t\t\tthis._scrollBar = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSingleTrackAutoSize():void\n\t\t{\n\t\t\tAssert.assertStrictlyEquals(\"The width of the scroll bar was not calculated correctly.\",\n\t\t\t\tTRACK_WIDTH + INCREMENT_BUTTON_WIDTH + DECREMENT_BUTTON_WIDTH, this._scrollBar.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the scroll bar was not calculated correctly.\",\n\t\t\t\tTRACK_HEIGHT, this._scrollBar.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetValueProgramaticallyWithMinimum():void\n\t\t{\n\t\t\tthis._scrollBar.minimum = 5;\n\t\t\tthis._scrollBar.maximum = 10;\n\t\t\tthis._scrollBar.value = 2;\n\t\t\tAssert.assertEquals(\"Setting value smaller than minimum not changed to minimum.\", this._scrollBar.minimum, this._scrollBar.value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetValueProgramaticallyWithMaximum():void\n\t\t{\n\t\t\tthis._scrollBar.minimum = 5;\n\t\t\tthis._scrollBar.maximum = 10;\n\t\t\tthis._scrollBar.value = 12;\n\t\t\tAssert.assertEquals(\"Setting value larger than maximum not changed to maximum.\", this._scrollBar.maximum, this._scrollBar.value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testProgrammaticSelectionChange():void\n\t\t{\n\t\t\tthis._scrollBar.minimum = 0;\n\t\t\tthis._scrollBar.maximum = 10;\n\t\t\tthis._scrollBar.step = 1;\n\t\t\tthis._scrollBar.page = 2;\n\t\t\tthis._scrollBar.value = 5;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._scrollBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._scrollBar.value = 6;\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInteractiveSelectionChangeWithDraggingThumb():void\n\t\t{\n\t\t\tvar beforeValue:Number = 5;\n\t\t\tthis._scrollBar.minimum = 0;\n\t\t\tthis._scrollBar.maximum = 10;\n\t\t\tthis._scrollBar.step = 1;\n\t\t\tthis._scrollBar.page = 2;\n\t\t\tthis._scrollBar.value = beforeValue;\n\t\t\t//validate to position the thumb correctly.\n\t\t\tthis._scrollBar.validate();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._scrollBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(DECREMENT_BUTTON_WIDTH + TRACK_WIDTH / 2, THUMB_HEIGHT / 2);\n\t\t\tvar target:DisplayObject = this._scrollBar.stage.hitTest(position);\n\n\t\t\tAssert.assertStrictlyEquals(\"The hit test did not return the scroll bar's thumb\",\n\t\t\t\tthis._scrollBar.getChildByName(THUMB_NAME).name, target.name);\n\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\ttouch.globalX = position.x + THUMB_WIDTH * 2;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"The value property was not changed to a greater value\",\n\t\t\t\tbeforeValue < this._scrollBar.value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInteractiveSelectionChangeWithDraggingThumbBeyondRightEdgeOfTrack():void\n\t\t{\n\t\t\tvar beforeValue:Number = 5;\n\t\t\tthis._scrollBar.minimum = 0;\n\t\t\tthis._scrollBar.maximum = 10;\n\t\t\tthis._scrollBar.step = 1;\n\t\t\tthis._scrollBar.page = 2;\n\t\t\tthis._scrollBar.value = beforeValue;\n\t\t\t//validate to position the thumb correctly.\n\t\t\tthis._scrollBar.validate();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._scrollBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(INCREMENT_BUTTON_WIDTH + TRACK_WIDTH / 2, THUMB_HEIGHT / 2);\n\t\t\tvar target:DisplayObject = this._scrollBar.stage.hitTest(position);\n\n\t\t\tAssert.assertStrictlyEquals(\"The hit test did not return the scroll bar's thumb\",\n\t\t\t\tthis._scrollBar.getChildByName(THUMB_NAME).name, target.name);\n\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\ttouch.globalX = position.x + TRACK_WIDTH + INCREMENT_BUTTON_WIDTH;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The value property was not equal to the maximum value\",\n\t\t\t\tthis._scrollBar.maximum, this._scrollBar.value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInteractiveSelectionChangeWithDraggingThumbBeyondLeftEdgeOfTrack():void\n\t\t{\n\t\t\tvar beforeValue:Number = 5;\n\t\t\tthis._scrollBar.minimum = 0;\n\t\t\tthis._scrollBar.maximum = 10;\n\t\t\tthis._scrollBar.step = 1;\n\t\t\tthis._scrollBar.page = 2;\n\t\t\tthis._scrollBar.value = beforeValue;\n\t\t\t//validate to position the thumb correctly.\n\t\t\tthis._scrollBar.validate();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._scrollBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(DECREMENT_BUTTON_WIDTH + TRACK_WIDTH / 2, THUMB_HEIGHT / 2);\n\t\t\tvar target:DisplayObject = this._scrollBar.stage.hitTest(position);\n\n\t\t\tAssert.assertStrictlyEquals(\"The hit test did not return the scroll bar's thumb\",\n\t\t\t\tthis._scrollBar.getChildByName(THUMB_NAME).name, target.name);\n\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\ttouch.globalX = position.x - TRACK_WIDTH - DECREMENT_BUTTON_WIDTH;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The value property was not equal to the minimum value\",\n\t\t\t\tthis._scrollBar.minimum, this._scrollBar.value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInteractiveSelectionChangeWithTouchToLeftOfThumb():void\n\t\t{\n\t\t\tvar beforeValue:Number = 5;\n\t\t\tvar page:Number = 2;\n\t\t\tthis._scrollBar.minimum = 0;\n\t\t\tthis._scrollBar.maximum = 10;\n\t\t\tthis._scrollBar.step = 1;\n\t\t\tthis._scrollBar.page = page;\n\t\t\tthis._scrollBar.value = beforeValue;\n\t\t\t//validate to position the thumb correctly.\n\t\t\tthis._scrollBar.validate();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._scrollBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar thumbWidth:Number = this._scrollBar.getChildByName(THUMB_NAME).width;\n\t\t\tvar position:Point = new Point(DECREMENT_BUTTON_WIDTH + (TRACK_WIDTH - thumbWidth) / 4, THUMB_HEIGHT / 2);\n\t\t\tvar target:DisplayObject = this._scrollBar.stage.hitTest(position);\n\n\t\t\tAssert.assertStrictlyEquals(\"The hit test did not return the scroll bar's track\",\n\t\t\t\tthis._scrollBar.getChildByName(TRACK_NAME).name, target.name);\n\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The value property was not less than the previous value minus the page\",\n\t\t\t\tbeforeValue - page, this._scrollBar.value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInteractiveSelectionChangeWithTouchToRightOfThumb():void\n\t\t{\n\t\t\tvar beforeValue:Number = 5;\n\t\t\tvar page:Number = 2;\n\t\t\tthis._scrollBar.minimum = 0;\n\t\t\tthis._scrollBar.maximum = 10;\n\t\t\tthis._scrollBar.step = 1;\n\t\t\tthis._scrollBar.page = page;\n\t\t\tthis._scrollBar.value = beforeValue;\n\t\t\t//validate to position the thumb correctly.\n\t\t\tthis._scrollBar.validate();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._scrollBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar thumbWidth:Number = this._scrollBar.getChildByName(THUMB_NAME).width;\n\t\t\tvar position:Point = new Point(DECREMENT_BUTTON_WIDTH + 3 * (TRACK_WIDTH - thumbWidth) / 4, THUMB_HEIGHT / 2);\n\t\t\tvar target:DisplayObject = this._scrollBar.stage.hitTest(position);\n\n\t\t\tAssert.assertStrictlyEquals(\"The hit test did not return the scroll bar's track\",\n\t\t\t\tthis._scrollBar.getChildByName(TRACK_NAME).name, target.name);\n\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The value property was not the previous value plus the page\",\n\t\t\t\tbeforeValue + page, this._scrollBar.value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInteractiveSelectionChangeByTappingDecrementButton():void\n\t\t{\n\t\t\tvar beforeValue:Number = 5;\n\t\t\tvar step:Number = 1;\n\t\t\tthis._scrollBar.minimum = 0;\n\t\t\tthis._scrollBar.maximum = 10;\n\t\t\tthis._scrollBar.step = step;\n\t\t\tthis._scrollBar.page = 2;\n\t\t\tthis._scrollBar.value = beforeValue;\n\t\t\t//validate to position the thumb correctly.\n\t\t\tthis._scrollBar.validate();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._scrollBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(DECREMENT_BUTTON_WIDTH / 2, THUMB_HEIGHT / 2);\n\t\t\tvar target:DisplayObject = this._scrollBar.stage.hitTest(position);\n\n\t\t\tAssert.assertStrictlyEquals(\"The hit test did not return the scroll bar's decrement button\",\n\t\t\t\tthis._scrollBar.getChildByName(DECREMENT_BUTTON_NAME).name, target.name);\n\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The value property was not equal to the previous value minus the step\",\n\t\t\t\tbeforeValue - step, this._scrollBar.value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInteractiveSelectionChangeByTappingIncrementButton():void\n\t\t{\n\t\t\tvar beforeValue:Number = 5;\n\t\t\tvar step:Number = 1;\n\t\t\tthis._scrollBar.minimum = 0;\n\t\t\tthis._scrollBar.maximum = 10;\n\t\t\tthis._scrollBar.step = step;\n\t\t\tthis._scrollBar.page = 2;\n\t\t\tthis._scrollBar.value = beforeValue;\n\t\t\t//validate to position the thumb correctly.\n\t\t\tthis._scrollBar.validate();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._scrollBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(this._scrollBar.width - INCREMENT_BUTTON_WIDTH / 2, THUMB_HEIGHT / 2);\n\t\t\tvar target:DisplayObject = this._scrollBar.stage.hitTest(position);\n\n\t\t\tAssert.assertStrictlyEquals(\"The hit test did not return the scroll bar's increment button\",\n\t\t\t\tthis._scrollBar.getChildByName(INCREMENT_BUTTON_NAME).name, target.name);\n\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The value property was not equal to the previous value plus the step\",\n\t\t\t\tbeforeValue + step, this._scrollBar.value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFallBackToStepWhenPageIsZero():void\n\t\t{\n\t\t\tvar beforeValue:Number = 5;\n\t\t\tvar step:Number = 1;\n\t\t\tthis._scrollBar.minimum = 0;\n\t\t\tthis._scrollBar.maximum = 10;\n\t\t\tthis._scrollBar.step = step;\n\t\t\tthis._scrollBar.page = 0;\n\t\t\tthis._scrollBar.value = beforeValue;\n\t\t\t//validate to position the thumb correctly.\n\t\t\tthis._scrollBar.validate();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._scrollBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar thumbWidth:Number = this._scrollBar.getChildByName(THUMB_NAME).width;\n\t\t\tvar position:Point = new Point(DECREMENT_BUTTON_WIDTH + (TRACK_WIDTH - thumbWidth) / 4, THUMB_HEIGHT / 2);\n\t\t\tvar target:DisplayObject = this._scrollBar.stage.hitTest(position);\n\n\t\t\tAssert.assertStrictlyEquals(\"The hit test did not return the scroll bar's track\",\n\t\t\t\tthis._scrollBar.getChildByName(TRACK_NAME).name, target.name);\n\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertStrictlyEquals(\"The value property was not equal to the the previous value minus the step value\",\n\t\t\t\tbeforeValue - step, this._scrollBar.value);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ScrollBarVerticalMeasurementTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.BasicButton;\n\timport feathers.controls.ScrollBar;\n\timport feathers.controls.TrackLayoutMode;\n\timport feathers.layout.Direction;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class ScrollBarVerticalMeasurementTests\n\t{\n\t\tprivate static const SINGLE_TRACK_WIDTH:Number = 50;\n\t\tprivate static const SINGLE_TRACK_HEIGHT:Number = 200;\n\t\tprivate static const SINGLE_TRACK_MIN_WIDTH:Number = 30;\n\t\tprivate static const SINGLE_TRACK_MIN_HEIGHT:Number = 150;\n\n\t\tprivate static const MINIMUM_TRACK_WIDTH:Number = 50;\n\t\tprivate static const MINIMUM_TRACK_HEIGHT:Number = 100;\n\t\tprivate static const MINIMUM_TRACK_MIN_WIDTH:Number = 20;\n\t\tprivate static const MINIMUM_TRACK_MIN_HEIGHT:Number = 80;\n\n\t\tprivate static const MAXIMUM_TRACK_WIDTH:Number = 55;\n\t\tprivate static const MAXIMUM_TRACK_HEIGHT:Number = 110;\n\t\tprivate static const MAXIMUM_TRACK_MIN_WIDTH:Number = 25;\n\t\tprivate static const MAXIMUM_TRACK_MIN_HEIGHT:Number = 90;\n\n\t\tprivate static const SMALL_THUMB_WIDTH:Number = 40;\n\t\tprivate static const LARGE_THUMB_WIDTH:Number = 60;\n\t\tprivate static const THUMB_HEIGHT:Number = 30;\n\n\t\tprivate static const SMALL_THUMB_MIN_WIDTH:Number = 20;\n\t\tprivate static const LARGE_THUMB_MIN_WIDTH:Number = 40;\n\t\tprivate static const THUMB_MIN_HEIGHT:Number = 18;\n\n\t\tprivate static const SMALL_DECREMENT_BUTTON_WIDTH:Number = 38;\n\t\tprivate static const LARGE_DECREMENT_BUTTON_WIDTH:Number = 62;\n\t\tprivate static const DECREMENT_BUTTON_HEIGHT:Number = 28;\n\n\t\tprivate static const SMALL_DECREMENT_BUTTON_MIN_WIDTH:Number = 18;\n\t\tprivate static const LARGE_DECREMENT_BUTTON_MIN_WIDTH:Number = 50;\n\t\tprivate static const DECREMENT_BUTTON_MIN_HEIGHT:Number = 20;\n\n\t\tprivate static const SMALL_INCREMENT_BUTTON_WIDTH:Number = 36;\n\t\tprivate static const LARGE_INCREMENT_BUTTON_WIDTH:Number = 64;\n\t\tprivate static const INCREMENT_BUTTON_HEIGHT:Number = 26;\n\n\t\tprivate static const SMALL_INCREMENT_BUTTON_MIN_WIDTH:Number = 14;\n\t\tprivate static const LARGE_INCREMENT_BUTTON_MIN_WIDTH:Number = 62;\n\t\tprivate static const INCREMENT_BUTTON_MIN_HEIGHT:Number = 24;\n\n\t\tprivate var _scrollBar:ScrollBar;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._scrollBar = new ScrollBar();\n\t\t\tthis._scrollBar.direction = Direction.VERTICAL;\n\t\t\tTestFeathers.starlingRoot.addChild(this._scrollBar);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._scrollBar.removeFromParent(true);\n\t\t\tthis._scrollBar = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithTrackLayoutModeSingle():void\n\t\t{\n\t\t\tthis._scrollBar.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(SMALL_THUMB_WIDTH, THUMB_HEIGHT, 0xff00ff);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SINGLE_TRACK_WIDTH, SINGLE_TRACK_HEIGHT, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.decrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SMALL_DECREMENT_BUTTON_WIDTH, DECREMENT_BUTTON_HEIGHT, 0x00ff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.incrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SMALL_INCREMENT_BUTTON_WIDTH, INCREMENT_BUTTON_HEIGHT, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the vertical ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE.\",\n\t\t\t\tSINGLE_TRACK_WIDTH, this._scrollBar.width);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the vertical ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE.\",\n\t\t\t\tSINGLE_TRACK_WIDTH, this._scrollBar.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the vertical ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE.\",\n\t\t\t\tSINGLE_TRACK_HEIGHT + DECREMENT_BUTTON_HEIGHT + INCREMENT_BUTTON_HEIGHT, this._scrollBar.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the vertical ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE.\",\n\t\t\t\tSINGLE_TRACK_HEIGHT + DECREMENT_BUTTON_HEIGHT + INCREMENT_BUTTON_HEIGHT, this._scrollBar.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWidthWithTrackLayoutModeSingleAndLargerThumb():void\n\t\t{\n\t\t\tthis._scrollBar.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(LARGE_THUMB_WIDTH, THUMB_HEIGHT, 0xff00ff);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SINGLE_TRACK_WIDTH, SINGLE_TRACK_HEIGHT, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.decrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SMALL_DECREMENT_BUTTON_WIDTH, DECREMENT_BUTTON_HEIGHT, 0x00ff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.incrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SMALL_INCREMENT_BUTTON_WIDTH, INCREMENT_BUTTON_HEIGHT, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the vertical ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and larger thumb.\",\n\t\t\t\tLARGE_THUMB_WIDTH, this._scrollBar.width);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the vertical ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and larger thumb.\",\n\t\t\t\tLARGE_THUMB_WIDTH, this._scrollBar.minWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWidthWithTrackLayoutModeSingleAndLargerDecrementButton():void\n\t\t{\n\t\t\tthis._scrollBar.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(SMALL_THUMB_WIDTH, THUMB_HEIGHT, 0xff00ff);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SINGLE_TRACK_WIDTH, SINGLE_TRACK_HEIGHT, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.decrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(LARGE_DECREMENT_BUTTON_WIDTH, DECREMENT_BUTTON_HEIGHT, 0x00ff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.incrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SMALL_INCREMENT_BUTTON_WIDTH, INCREMENT_BUTTON_HEIGHT, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the vertical ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and larger decrement button.\",\n\t\t\t\tLARGE_DECREMENT_BUTTON_WIDTH, this._scrollBar.width);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the vertical ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and larger decrement button.\",\n\t\t\t\tLARGE_DECREMENT_BUTTON_WIDTH, this._scrollBar.minWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWidthWithTrackLayoutModeSingleAndLargerIncrementButton():void\n\t\t{\n\t\t\tthis._scrollBar.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(SMALL_THUMB_WIDTH, THUMB_HEIGHT, 0xff00ff);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SINGLE_TRACK_WIDTH, SINGLE_TRACK_HEIGHT, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.decrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SMALL_DECREMENT_BUTTON_WIDTH, DECREMENT_BUTTON_HEIGHT, 0x00ff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.incrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(LARGE_INCREMENT_BUTTON_WIDTH, INCREMENT_BUTTON_HEIGHT, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the vertical ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and larger increment button.\",\n\t\t\t\tLARGE_INCREMENT_BUTTON_WIDTH, this._scrollBar.width);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the vertical ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and larger increment button.\",\n\t\t\t\tLARGE_INCREMENT_BUTTON_WIDTH, this._scrollBar.minWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithTrackLayoutModeSingleAndMinDimensions():void\n\t\t{\n\t\t\tthis._scrollBar.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(SMALL_THUMB_WIDTH, THUMB_HEIGHT, 0xff00ff);\n\t\t\t\tthumb.minWidth = SMALL_THUMB_MIN_WIDTH;\n\t\t\t\tthumb.minHeight = THUMB_MIN_HEIGHT;\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SINGLE_TRACK_WIDTH, SINGLE_TRACK_HEIGHT, 0xffff00);\n\t\t\t\tbutton.minWidth = SINGLE_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = SINGLE_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.decrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SMALL_DECREMENT_BUTTON_WIDTH, DECREMENT_BUTTON_HEIGHT, 0x00ff00);\n\t\t\t\tbutton.minWidth = SMALL_DECREMENT_BUTTON_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = DECREMENT_BUTTON_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.incrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SMALL_INCREMENT_BUTTON_WIDTH, INCREMENT_BUTTON_HEIGHT, 0x00ffff);\n\t\t\t\tbutton.minWidth = SMALL_INCREMENT_BUTTON_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = INCREMENT_BUTTON_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the vertical ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and the track's minWidth is set.\",\n\t\t\t\tSINGLE_TRACK_MIN_WIDTH, this._scrollBar.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the vertical ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and the track's minHeight is set.\",\n\t\t\t\tSINGLE_TRACK_MIN_HEIGHT + DECREMENT_BUTTON_MIN_HEIGHT + INCREMENT_BUTTON_MIN_HEIGHT, this._scrollBar.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeMinWidthWithTrackLayoutModeSingleAndLargerThumb():void\n\t\t{\n\t\t\tthis._scrollBar.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(SMALL_THUMB_WIDTH, THUMB_HEIGHT, 0xff00ff);\n\t\t\t\tthumb.minWidth = LARGE_THUMB_MIN_WIDTH;\n\t\t\t\tthumb.minHeight = THUMB_MIN_HEIGHT;\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SINGLE_TRACK_WIDTH, SINGLE_TRACK_HEIGHT, 0xffff00);\n\t\t\t\tbutton.minWidth = SINGLE_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = SINGLE_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.decrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SMALL_DECREMENT_BUTTON_WIDTH, DECREMENT_BUTTON_HEIGHT, 0x00ff00);\n\t\t\t\tbutton.minWidth = SMALL_DECREMENT_BUTTON_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = DECREMENT_BUTTON_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.incrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SMALL_INCREMENT_BUTTON_WIDTH, INCREMENT_BUTTON_HEIGHT, 0x00ffff);\n\t\t\t\tbutton.minWidth = SMALL_INCREMENT_BUTTON_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = INCREMENT_BUTTON_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the vertical ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and larger thumb minHeight.\",\n\t\t\t\tLARGE_THUMB_MIN_WIDTH, this._scrollBar.minWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeMinWidthWithTrackLayoutModeSingleAndLargerDecrementButton():void\n\t\t{\n\t\t\tthis._scrollBar.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(SMALL_THUMB_WIDTH, THUMB_HEIGHT, 0xff00ff);\n\t\t\t\tthumb.minWidth = SMALL_THUMB_MIN_WIDTH;\n\t\t\t\tthumb.minHeight = THUMB_MIN_HEIGHT;\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SINGLE_TRACK_WIDTH, SINGLE_TRACK_HEIGHT, 0xffff00);\n\t\t\t\tbutton.minWidth = SINGLE_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = SINGLE_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.decrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(LARGE_DECREMENT_BUTTON_WIDTH, DECREMENT_BUTTON_HEIGHT, 0x00ff00);\n\t\t\t\tbutton.minWidth = LARGE_DECREMENT_BUTTON_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = DECREMENT_BUTTON_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.incrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SMALL_INCREMENT_BUTTON_WIDTH, INCREMENT_BUTTON_HEIGHT, 0x00ffff);\n\t\t\t\tbutton.minWidth = SMALL_INCREMENT_BUTTON_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = INCREMENT_BUTTON_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the vertical ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and larger decrement button minHeight.\",\n\t\t\t\tLARGE_DECREMENT_BUTTON_MIN_WIDTH, this._scrollBar.minWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeMinWidthWithTrackLayoutModeSingleAndLargerIncrementButton():void\n\t\t{\n\t\t\tthis._scrollBar.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(SMALL_THUMB_WIDTH, THUMB_HEIGHT, 0xff00ff);\n\t\t\t\tthumb.minWidth = SMALL_THUMB_MIN_WIDTH;\n\t\t\t\tthumb.minHeight = THUMB_MIN_HEIGHT;\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SINGLE_TRACK_WIDTH, SINGLE_TRACK_HEIGHT, 0xffff00);\n\t\t\t\tbutton.minWidth = SINGLE_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = SINGLE_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.decrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SMALL_DECREMENT_BUTTON_WIDTH, DECREMENT_BUTTON_HEIGHT, 0x00ff00);\n\t\t\t\tbutton.minWidth = SMALL_DECREMENT_BUTTON_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = DECREMENT_BUTTON_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.incrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(LARGE_INCREMENT_BUTTON_WIDTH, INCREMENT_BUTTON_HEIGHT, 0x00ffff);\n\t\t\t\tbutton.minWidth = LARGE_INCREMENT_BUTTON_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = INCREMENT_BUTTON_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the vertical ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and larger increment button minHeight.\",\n\t\t\t\tLARGE_INCREMENT_BUTTON_MIN_WIDTH, this._scrollBar.minWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithTrackLayoutModeSplit():void\n\t\t{\n\t\t\tthis._scrollBar.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(SMALL_THUMB_WIDTH, THUMB_HEIGHT, 0xff00ff);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MINIMUM_TRACK_WIDTH, MINIMUM_TRACK_HEIGHT, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.maximumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MAXIMUM_TRACK_WIDTH, MAXIMUM_TRACK_HEIGHT, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.decrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SMALL_DECREMENT_BUTTON_WIDTH, DECREMENT_BUTTON_HEIGHT, 0x00ff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.incrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SMALL_INCREMENT_BUTTON_WIDTH, INCREMENT_BUTTON_HEIGHT, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the vertical ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT.\",\n\t\t\t\tMAXIMUM_TRACK_WIDTH, this._scrollBar.width);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the vertical ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT.\",\n\t\t\t\tMAXIMUM_TRACK_WIDTH, this._scrollBar.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the vertical ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT.\",\n\t\t\t\tMINIMUM_TRACK_HEIGHT + MAXIMUM_TRACK_HEIGHT + DECREMENT_BUTTON_HEIGHT + INCREMENT_BUTTON_HEIGHT, this._scrollBar.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the vertical ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT.\",\n\t\t\t\tMINIMUM_TRACK_HEIGHT + MAXIMUM_TRACK_HEIGHT + DECREMENT_BUTTON_HEIGHT + INCREMENT_BUTTON_HEIGHT, this._scrollBar.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWidthWithTrackLayoutModeSplitAndLargerThumb():void\n\t\t{\n\t\t\tthis._scrollBar.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(LARGE_THUMB_WIDTH, THUMB_HEIGHT, 0xff00ff);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MINIMUM_TRACK_WIDTH, MINIMUM_TRACK_HEIGHT, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.maximumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MAXIMUM_TRACK_WIDTH, MAXIMUM_TRACK_HEIGHT, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.decrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SMALL_DECREMENT_BUTTON_WIDTH, DECREMENT_BUTTON_HEIGHT, 0x00ff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.incrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SMALL_INCREMENT_BUTTON_WIDTH, INCREMENT_BUTTON_HEIGHT, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the vertical ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT and larger thumb.\",\n\t\t\t\tLARGE_THUMB_WIDTH, this._scrollBar.width);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the vertical ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT and larger thumb.\",\n\t\t\t\tLARGE_THUMB_WIDTH, this._scrollBar.minWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithTrackLayoutModeSplitAndMinDimensions():void\n\t\t{\n\t\t\tthis._scrollBar.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(SMALL_THUMB_WIDTH, THUMB_HEIGHT, 0xff00ff);\n\t\t\t\tthumb.minWidth = SMALL_THUMB_MIN_WIDTH;\n\t\t\t\tthumb.minHeight = THUMB_MIN_HEIGHT;\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MINIMUM_TRACK_WIDTH, MINIMUM_TRACK_HEIGHT, 0xffff00);\n\t\t\t\tbutton.minWidth = MINIMUM_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = MINIMUM_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.maximumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MAXIMUM_TRACK_WIDTH, MAXIMUM_TRACK_HEIGHT, 0x00ffff);\n\t\t\t\tbutton.minWidth = MAXIMUM_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = MAXIMUM_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.decrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SMALL_DECREMENT_BUTTON_WIDTH, DECREMENT_BUTTON_HEIGHT, 0x00ff00);\n\t\t\t\tbutton.minWidth = SMALL_DECREMENT_BUTTON_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = DECREMENT_BUTTON_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.incrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SMALL_INCREMENT_BUTTON_WIDTH, INCREMENT_BUTTON_HEIGHT, 0x00ffff);\n\t\t\t\tbutton.minWidth = SMALL_INCREMENT_BUTTON_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = INCREMENT_BUTTON_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the vertical ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT when the track's minWidth is set.\",\n\t\t\t\tMAXIMUM_TRACK_MIN_WIDTH, this._scrollBar.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the vertical ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT when the track's minHeight is set.\",\n\t\t\t\tMINIMUM_TRACK_MIN_HEIGHT + MAXIMUM_TRACK_MIN_HEIGHT + DECREMENT_BUTTON_MIN_HEIGHT + INCREMENT_BUTTON_MIN_HEIGHT, this._scrollBar.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeMinWidthtWithTrackLayoutModeSplitAndLargerThumb():void\n\t\t{\n\t\t\tthis._scrollBar.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(LARGE_THUMB_WIDTH, THUMB_HEIGHT, 0xff00ff);\n\t\t\t\tthumb.minWidth = LARGE_THUMB_MIN_WIDTH;\n\t\t\t\tthumb.minHeight = THUMB_MIN_HEIGHT;\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MINIMUM_TRACK_WIDTH, MINIMUM_TRACK_HEIGHT, 0xffff00);\n\t\t\t\tbutton.minWidth = MINIMUM_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = MINIMUM_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.maximumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MAXIMUM_TRACK_WIDTH, MAXIMUM_TRACK_HEIGHT, 0x00ffff);\n\t\t\t\tbutton.minWidth = MAXIMUM_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = MAXIMUM_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.decrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SMALL_DECREMENT_BUTTON_WIDTH, DECREMENT_BUTTON_HEIGHT, 0x00ff00);\n\t\t\t\tbutton.minWidth = SMALL_DECREMENT_BUTTON_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = DECREMENT_BUTTON_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.incrementButtonFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SMALL_INCREMENT_BUTTON_WIDTH, INCREMENT_BUTTON_HEIGHT, 0x00ffff);\n\t\t\t\tbutton.minWidth = SMALL_INCREMENT_BUTTON_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = INCREMENT_BUTTON_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the vertical ScrollBar was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT and larger thumb minHeight.\",\n\t\t\t\tLARGE_THUMB_MIN_WIDTH, this._scrollBar.minWidth);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ScrollContainerMeasurementTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.AutoSizeMode;\n\timport feathers.controls.ScrollContainer;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class ScrollContainerMeasurementTests\n\t{\n\t\t//note: the background width is purposefully smaller than the item width\n\t\tprivate static const BACKGROUND_WIDTH:Number = 200;\n\t\t//note: the background height is purposefully larger than the item height\n\t\tprivate static const BACKGROUND_HEIGHT:Number = 250;\n\n\t\t//note: the item width is purposefully larger than the background width\n\t\tprivate static const ITEM_WIDTH:Number = 210;\n\t\t//note: the item height is purposefully smaller than the background height\n\t\tprivate static const ITEM_HEIGHT:Number = 160;\n\n\t\tprivate static const ITEM_PIVOTX:Number = 105;\n\t\tprivate static const ITEM_PIVOTY:Number = 80;\n\n\t\tprivate var _container:ScrollContainer;\n\t\tprivate var _container2:ScrollContainer;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._container = new ScrollContainer();\n\t\t\tTestFeathers.starlingRoot.addChild(this._container);\n\t\t\tthis._container.validate();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._container.removeFromParent(true);\n\t\t\tthis._container = null;\n\t\t\t\n\t\t\tif(this._container2)\n\t\t\t{\n\t\t\t\tthis._container2.removeFromParent(true);\n\t\t\t\tthis._container2 = null;\n\t\t\t}\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithNoBackgroundAndNoChildren():void\n\t\t{\n\t\t\tthis._container.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the scroll container was not calculated correctly.\",\n\t\t\t\t0, this._container.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the scroll container was not calculated correctly.\",\n\t\t\t\t0, this._container.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the scroll container was not calculated correctly.\",\n\t\t\t\t0, this._container.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the scroll container was not calculated correctly.\",\n\t\t\t\t0, this._container.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithBackgroundAndNoChildren():void\n\t\t{\n\t\t\tthis._container.backgroundSkin = new Quad(BACKGROUND_WIDTH, BACKGROUND_HEIGHT);\n\t\t\tthis._container.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the scroll container was not calculated correctly.\",\n\t\t\t\tBACKGROUND_WIDTH, this._container.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the scroll container was not calculated correctly.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._container.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the scroll container was not calculated correctly.\",\n\t\t\t\tBACKGROUND_WIDTH, this._container.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the scroll container was not calculated correctly.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._container.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeModeStage():void\n\t\t{\n\t\t\tthis._container.autoSizeMode = AutoSizeMode.STAGE;\n\t\t\tthis._container.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the scroll container was not calculated correctly with autoSizeMode set to AutoSizeMode.STAGE.\",\n\t\t\t\tthis._container.stage.stageWidth, this._container.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the scroll container was not calculated correctly with autoSizeMode set to AutoSizeMode.STAGE.\",\n\t\t\t\tthis._container.stage.stageHeight, this._container.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the scroll container was not calculated correctly with autoSizeMode set to AutoSizeMode.STAGE.\",\n\t\t\t\tthis._container.stage.stageWidth, this._container.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the scroll container was not calculated correctly with autoSizeMode set to AutoSizeMode.STAGE.\",\n\t\t\t\tthis._container.stage.stageHeight, this._container.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeModeStageWithoutParent():void\n\t\t{\n\t\t\tthis._container2 = new ScrollContainer();\n\t\t\tthis._container2.autoSizeMode = AutoSizeMode.STAGE;\n\t\t\tthis._container2.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the ScrollContainer was not calculated correctly with no parent and AutoSizeMode.STAGE.\",\n\t\t\t\t0, this._container2.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the ScrollContainer was not calculated correctly with no parent and AutoSizeMode.STAGE.\",\n\t\t\t\t0, this._container2.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the ScrollContainer was not calculated correctly with no parent and AutoSizeMode.STAGE.\",\n\t\t\t\t0, this._container2.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the ScrollContainer was not calculated correctly with no parent and AutoSizeMode.STAGE.\",\n\t\t\t\t0, this._container2.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeModeStageWithValidateBeforeAdd():void\n\t\t{\n\t\t\tthis._container2 = new ScrollContainer();\n\t\t\tthis._container2.autoSizeMode = AutoSizeMode.STAGE;\n\t\t\tthis._container2.validate();\n\t\t\tTestFeathers.starlingRoot.addChild(this._container2);\n\t\t\tthis._container2.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the ScrollContainer was not calculated correctly after addChild() when validated before with AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageWidth, this._container2.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the ScrollContainer was not calculated correctly after addChild() when validated before with AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageHeight, this._container2.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the ScrollContainer was not calculated correctly after addChild() when validated before with AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageWidth, this._container2.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the ScrollContainer was not calculated correctly after addChild() when validated before with AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageHeight, this._container2.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithChildAtOrigin():void\n\t\t{\n\t\t\tthis._container.addChild(new Quad(ITEM_WIDTH, ITEM_HEIGHT));\n\t\t\tthis._container.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the scroll container was not calculated correctly.\",\n\t\t\t\tITEM_WIDTH, this._container.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the scroll container was not calculated correctly.\",\n\t\t\t\tITEM_HEIGHT, this._container.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the scroll container was not calculated correctly.\",\n\t\t\t\tITEM_WIDTH, this._container.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the scroll container was not calculated correctly.\",\n\t\t\t\tITEM_HEIGHT, this._container.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithChildAtOriginAndMeasureViewPortSetToFalse():void\n\t\t{\n\t\t\tthis._container.addChild(new Quad(ITEM_WIDTH, ITEM_HEIGHT));\n\t\t\tthis._container.measureViewPort = false;\n\t\t\tthis._container.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the scroll container was not calculated correctly.\",\n\t\t\t\t0, this._container.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the scroll container was not calculated correctly.\",\n\t\t\t\t0, this._container.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the scroll container was not calculated correctly.\",\n\t\t\t\t0, this._container.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the scroll container was not calculated correctly.\",\n\t\t\t\t0, this._container.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithChildAtPositiveXAndY():void\n\t\t{\n\t\t\tvar child:Quad = new Quad(ITEM_WIDTH, ITEM_HEIGHT);\n\t\t\tchild.x = 120;\n\t\t\tchild.y = 130;\n\t\t\tthis._container.addChild(child);\n\t\t\tthis._container.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the scroll container was not calculated correctly.\",\n\t\t\t\tchild.x + ITEM_WIDTH, this._container.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the scroll container was not calculated correctly.\",\n\t\t\t\tchild.y + ITEM_HEIGHT, this._container.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the scroll container was not calculated correctly.\",\n\t\t\t\tchild.x + ITEM_WIDTH, this._container.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the scroll container was not calculated correctly.\",\n\t\t\t\tchild.y + ITEM_HEIGHT, this._container.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithMultipleChildren():void\n\t\t{\n\t\t\tvar child1:Quad = new Quad(ITEM_WIDTH, ITEM_HEIGHT);\n\t\t\tchild1.x = 0;\n\t\t\tchild1.y = 130;\n\t\t\tthis._container.addChild(child1);\n\t\t\tvar child2:Quad = new Quad(ITEM_WIDTH, ITEM_HEIGHT);\n\t\t\tchild2.x = 120;\n\t\t\tchild2.y = 0;\n\t\t\tthis._container.addChild(child2);\n\t\t\tthis._container.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the scroll container was not calculated correctly.\",\n\t\t\t\tchild2.x + ITEM_WIDTH, this._container.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the scroll container was not calculated correctly.\",\n\t\t\t\tchild1.y + ITEM_HEIGHT, this._container.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the scroll container was not calculated correctly.\",\n\t\t\t\tchild2.x + ITEM_WIDTH, this._container.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the scroll container was not calculated correctly.\",\n\t\t\t\tchild1.y + ITEM_HEIGHT, this._container.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeChildAndBackground():void\n\t\t{\n\t\t\tthis._container.addChild(new Quad(ITEM_WIDTH, ITEM_HEIGHT));\n\t\t\tthis._container.backgroundSkin = new Quad(BACKGROUND_WIDTH, BACKGROUND_HEIGHT);\n\t\t\tthis._container.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the scroll container was not calculated correctly.\",\n\t\t\t\tITEM_WIDTH, this._container.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the scroll container was not calculated correctly.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._container.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the scroll container was not calculated correctly.\",\n\t\t\t\tITEM_WIDTH, this._container.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the scroll container was not calculated correctly.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._container.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeChildWithPivots():void\n\t\t{\n\t\t\tvar child:Quad = new Quad(ITEM_WIDTH, ITEM_HEIGHT);\n\t\t\tchild.pivotX = ITEM_PIVOTX;\n\t\t\tchild.pivotY = ITEM_PIVOTY;\n\t\t\tchild.x = 120;\n\t\t\tchild.y = 130;\n\t\t\tthis._container.addChild(child);\n\t\t\tthis._container.validate();\n\t\t\tvar containerWidth:Number = child.x - ITEM_PIVOTX + ITEM_WIDTH;\n\t\t\tvar containerHeight:Number = child.y - ITEM_PIVOTY + ITEM_HEIGHT;\n\t\t\tAssert.assertStrictlyEquals(\"The width of the scroll container was not calculated correctly.\",\n\t\t\t\tcontainerWidth, this._container.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the scroll container was not calculated correctly.\",\n\t\t\t\tcontainerHeight, this._container.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the scroll container was not calculated correctly.\",\n\t\t\t\tcontainerWidth, this._container.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the scroll container was not calculated correctly.\",\n\t\t\t\tcontainerHeight, this._container.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveChildToResizeSkin():void\n\t\t{\n\t\t\tvar child:Quad = new Quad(ITEM_WIDTH, ITEM_HEIGHT);\n\t\t\tthis._container.addChild(child);\n\t\t\tthis._container.backgroundSkin = new Quad(10, 10, 0xff00ff);\n\t\t\tthis._container.backgroundDisabledSkin = new Quad(10, 10, 0xff00ff);\n\t\t\tthis._container.validate();\n\t\t\t//the child's dimensions were large enough to make container bigger\n\t\t\t//than the skin's dimensions\n\t\t\tthis._container.removeChild(child);\n\t\t\t//switch to a different skin before validation\n\t\t\tthis._container.isEnabled = false;\n\t\t\tthis._container.validate();\n\t\t\t//now switch back to the original skin, and the dimensions could\n\t\t\t//be wrong if they weren't restored\n\t\t\tthis._container.isEnabled = true;\n\t\t\tthis._container.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the ScrollContainer was not calculated correctly after changing to a different skin and removing larger child.\",\n\t\t\t\t10, this._container.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the ScrollContainer was not calculated correctly after changing to a different skin and removing larger child.\",\n\t\t\t\t10, this._container.height);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ScrollContainerTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.AutoSizeMode;\n\timport feathers.controls.Button;\n\timport feathers.controls.ScrollContainer;\n\timport feathers.tests.supportClasses.AssertViewPortBoundsLayout;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\n\tpublic class ScrollContainerTests\n\t{\n\t\tprivate static const ITEM_WIDTH:Number = 210;\n\t\tprivate static const ITEM_HEIGHT:Number = 160;\n\n\t\tprivate var _container:ScrollContainer;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._container = new ScrollContainer();\n\t\t\tTestFeathers.starlingRoot.addChild(this._container);\n\t\t\tthis._container.validate();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._container.removeFromParent(true);\n\t\t\tthis._container = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDefaultAutoSizeMode():void\n\t\t{\n\t\t\tthis._container.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The default value of LayoutGroup autoSizeMode must be AutoSizeMode.CONTENT, if not root.\", AutoSizeMode.CONTENT, this._container.autoSizeMode);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoErrorValidatingWithoutStage():void\n\t\t{\n\t\t\tvar container:ScrollContainer = new ScrollContainer();\n\t\t\tcontainer.validate();\n\t\t\tcontainer.dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testResizeWhenAddingChild():void\n\t\t{\n\t\t\tvar originalWidth:Number = this._container.width;\n\t\t\tvar originalHeight:Number = this._container.height;\n\t\t\tvar hasResized:Boolean = false;\n\t\t\tthis._container.addEventListener(Event.RESIZE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasResized = true;\n\t\t\t});\n\t\t\tthis._container.addChild(new Quad(ITEM_WIDTH, ITEM_HEIGHT));\n\t\t\tthis._container.validate();\n\t\t\tAssert.assertTrue(\"Event.RESIZE was not dispatched\", hasResized);\n\t\t\tAssert.assertFalse(\"The width of the layout group was not changed.\",\n\t\t\t\toriginalWidth === this._container.width);\n\t\t\tAssert.assertFalse(\"The height of the layout group was not changed.\",\n\t\t\t\toriginalHeight === this._container.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testResizeWhenRemovingChild():void\n\t\t{\n\t\t\tvar child:Quad = new Quad(ITEM_WIDTH, ITEM_HEIGHT);\n\t\t\tthis._container.addChild(child);\n\t\t\tthis._container.validate();\n\t\t\tvar originalWidth:Number = this._container.width;\n\t\t\tvar originalHeight:Number = this._container.height;\n\n\t\t\tvar hasResized:Boolean = false;\n\t\t\tthis._container.addEventListener(Event.RESIZE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasResized = true;\n\t\t\t});\n\t\t\tthis._container.removeChild(child);\n\t\t\tthis._container.validate();\n\t\t\tAssert.assertTrue(\"Event.RESIZE was not dispatched\", hasResized);\n\t\t\tAssert.assertFalse(\"The width of the layout group was not changed.\",\n\t\t\t\toriginalWidth === this._container.width);\n\t\t\tAssert.assertFalse(\"The height of the layout group was not changed.\",\n\t\t\t\toriginalHeight === this._container.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testResizeWhenResizingFeathersControlChild():void\n\t\t{\n\t\t\tvar child:Button = new Button();\n\t\t\tchild.defaultSkin = new Quad(ITEM_WIDTH, ITEM_HEIGHT);\n\t\t\tthis._container.addChild(child);\n\t\t\tthis._container.validate();\n\n\t\t\tvar originalWidth:Number = this._container.width;\n\t\t\tvar originalHeight:Number = this._container.height;\n\t\t\tvar hasResized:Boolean = false;\n\t\t\tthis._container.addEventListener(Event.RESIZE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasResized = true;\n\t\t\t});\n\t\t\tchild.width = ITEM_WIDTH * 2;\n\t\t\tchild.height = ITEM_HEIGHT * 2;\n\t\t\tthis._container.validate();\n\t\t\tAssert.assertTrue(\"Event.RESIZE was not dispatched\", hasResized);\n\t\t\tAssert.assertFalse(\"The width of the layout group was not changed.\",\n\t\t\t\toriginalWidth === this._container.width);\n\t\t\tAssert.assertFalse(\"The height of the layout group was not changed.\",\n\t\t\t\toriginalHeight === this._container.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMaxScrollPositionWithOneChildAndSameDimensions():void\n\t\t{\n\t\t\tvar child:Quad = new Quad(ITEM_WIDTH, ITEM_HEIGHT);\n\t\t\tthis._container.addChild(child);\n\t\t\tthis._container.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The maxHorizontalScrollPosition of the scroll container was not calculated correctly.\",\n\t\t\t\t0, this._container.maxHorizontalScrollPosition);\n\t\t\tAssert.assertStrictlyEquals(\"The maxVerticalScrollPosition of the scroll container was not calculated correctly.\",\n\t\t\t\t0, this._container.maxVerticalScrollPosition);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMaxScrollPositionWithSmallerChild():void\n\t\t{\n\t\t\tvar child:Quad = new Quad(ITEM_WIDTH, ITEM_HEIGHT);\n\t\t\tthis._container.addChild(child);\n\t\t\tthis._container.setSize(ITEM_WIDTH * 3, ITEM_HEIGHT * 3);\n\t\t\tthis._container.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The maxHorizontalScrollPosition of the scroll container was not calculated correctly.\",\n\t\t\t\t0, this._container.maxHorizontalScrollPosition);\n\t\t\tAssert.assertStrictlyEquals(\"The maxVerticalScrollPosition of the scroll container was not calculated correctly.\",\n\t\t\t\t0, this._container.maxVerticalScrollPosition);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMaxScrollPositionWithLargerChild():void\n\t\t{\n\t\t\tvar child:Quad = new Quad(ITEM_WIDTH, ITEM_HEIGHT);\n\t\t\tthis._container.addChild(child);\n\t\t\tthis._container.setSize(ITEM_WIDTH - 10, ITEM_HEIGHT - 10);\n\t\t\tthis._container.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The maxHorizontalScrollPosition of the scroll container was not calculated correctly when scrolling is required.\",\n\t\t\t\tchild.width - this._container.width, this._container.maxHorizontalScrollPosition);\n\t\t\tAssert.assertStrictlyEquals(\"The maxVerticalScrollPosition of the scroll container was not calculated correctly when scrolling is required.\",\n\t\t\t\tchild.height - this._container.height, this._container.maxVerticalScrollPosition);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testViewPortBoundsValues():void\n\t\t{\n\t\t\tthis._container.layout = new AssertViewPortBoundsLayout();\n\t\t\tthis._container.validate();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ScrollContainerValidationTests.as",
    "content": "package feathers.tests\n{\n\timport org.flexunit.Assert;\n\n\tpublic class ScrollContainerValidationTests\n\t{\n\t\tprivate var _container:CustomContainer;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._container = new CustomContainer();\n\t\t\tTestFeathers.starlingRoot.addChild(this._container);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._container.removeFromParent(true);\n\t\t\tthis._container = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testResizeChildBeforeLayout():void\n\t\t{\n\t\t\tthis._container.updateChildBeforeLayout = true;\n\t\t\tthis._container.validate();\n\t\t\tAssert.assertFalse(\"ScrollContainer: must not be invalid if child resizes before layout is applied.\",\n\t\t\t\tthis._container.isInvalid());\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testResizeChildAfterLayout():void\n\t\t{\n\t\t\tthis._container.updateChildBeforeLayout = false;\n\t\t\tthis._container.validate();\n\t\t\tAssert.assertTrue(\"ScrollContainer: must be invalid if child resizes after layout is applied.\",\n\t\t\t\tthis._container.isInvalid());\n\t\t}\n\t}\n}\n\nimport feathers.controls.Button;\nimport feathers.controls.ScrollContainer;\n\nclass CustomContainer extends ScrollContainer\n{\n\tprivate var _child:Button;\n\n\tpublic var updateChildBeforeLayout:Boolean = true;\n\n\toverride protected function initialize():void\n\t{\n\t\tsuper.initialize();\n\n\t\tthis._child = new Button();\n\t\tthis._child.label = \"Click Me\";\n\t\tthis.addChild(this._child);\n\t}\n\n\toverride protected function draw():void\n\t{\n\t\tif(this.updateChildBeforeLayout)\n\t\t{\n\t\t\tthis.updateChild();\n\t\t}\n\t\tsuper.draw();\n\t\tif(!this.updateChildBeforeLayout)\n\t\t{\n\t\t\tthis.updateChild();\n\t\t}\n\t}\n\n\tprivate function updateChild():void\n\t{\n\t\tthis._child.width = Math.random() * 100;\n\t\tthis._child.width = 150;\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/ScrollerMeasurementTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.Scroller;\n\timport feathers.tests.supportClasses.ScrollerViewPort;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class ScrollerMeasurementTests\n\t{\n\t\tprivate static const BACKGROUND_WIDTH:Number = 200;\n\t\tprivate static const BACKGROUND_HEIGHT:Number = 250;\n\t\t\n\t\tprivate static const COMPLEX_BACKGROUND_WIDTH:Number = 540;\n\t\tprivate static const COMPLEX_BACKGROUND_HEIGHT:Number = 550;\n\t\tprivate static const COMPLEX_BACKGROUND_MIN_WIDTH:Number = 380;\n\t\tprivate static const COMPLEX_BACKGROUND_MIN_HEIGHT:Number = 390;\n\t\t\n\t\tprivate static const VIEW_PORT_WIDTH:Number = 230;\n\t\tprivate static const VIEW_PORT_HEIGHT:Number = 270;\n\t\tprivate static const VIEW_PORT_MIN_WIDTH:Number = 210;\n\t\tprivate static const VIEW_PORT_MIN_HEIGHT:Number = 260;\n\n\t\tprivate static const PADDING_TOP:Number = 50;\n\t\tprivate static const PADDING_RIGHT:Number = 54;\n\t\tprivate static const PADDING_BOTTOM:Number = 59;\n\t\tprivate static const PADDING_LEFT:Number = 60;\n\n\t\tprivate var _scroller:Scroller;\n\t\tprivate var _viewPort:ScrollerViewPort;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._viewPort = new ScrollerViewPort();\n\n\t\t\tthis._scroller = new Scroller();\n\t\t\tthis._scroller.viewPort = this._viewPort;\n\t\t\tTestFeathers.starlingRoot.addChild(this._scroller);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._scroller.removeFromParent(true);\n\t\t\tthis._scroller = null;\n\n\t\t\tthis._viewPort = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\tprivate function addSimpleBackground():void\n\t\t{\n\t\t\tthis._scroller.backgroundSkin = new Quad(BACKGROUND_WIDTH, BACKGROUND_HEIGHT, 0xff00ff);\n\t\t}\n\n\t\tprivate function addComplexBackground():void\n\t\t{\n\t\t\tvar backgroundSkin:LayoutGroup = new LayoutGroup();\n\t\t\tbackgroundSkin.width = COMPLEX_BACKGROUND_WIDTH;\n\t\t\tbackgroundSkin.height = COMPLEX_BACKGROUND_HEIGHT;\n\t\t\tbackgroundSkin.minWidth = COMPLEX_BACKGROUND_MIN_WIDTH;\n\t\t\tbackgroundSkin.minHeight = COMPLEX_BACKGROUND_MIN_HEIGHT;\n\t\t\tthis._scroller.backgroundSkin = backgroundSkin;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithNoBackgroundSkin():void\n\t\t{\n\t\t\tthis._scroller.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Scroller was not calculated correctly when empty.\",\n\t\t\t\t0, this._scroller.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Scroller was not calculated correctly when empty.\",\n\t\t\t\t0, this._scroller.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Scroller was not calculated correctly when empty.\",\n\t\t\t\t0, this._scroller.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Scroller was not calculated correctly when empty.\",\n\t\t\t\t0, this._scroller.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithPadding():void\n\t\t{\n\t\t\tthis._scroller.paddingTop = PADDING_TOP;\n\t\t\tthis._scroller.paddingRight = PADDING_RIGHT;\n\t\t\tthis._scroller.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._scroller.paddingLeft = PADDING_LEFT;\n\t\t\tthis._scroller.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Scroller was not calculated correctly based on the left and right padding.\",\n\t\t\t\tPADDING_LEFT + PADDING_RIGHT, this._scroller.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Scroller was not calculated correctly based on the top and bottom padding.\",\n\t\t\t\tPADDING_TOP + PADDING_BOTTOM, this._scroller.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Scroller was not calculated correctly based on the left and right padding.\",\n\t\t\t\tPADDING_LEFT + PADDING_RIGHT, this._scroller.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Scroller was not calculated correctly based on the top and bottom padding.\",\n\t\t\t\tPADDING_TOP + PADDING_BOTTOM, this._scroller.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithSimpleBackgroundSkin():void\n\t\t{\n\t\t\tthis.addSimpleBackground();\n\t\t\tthis._scroller.validate();\n\t\t\t\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Scroller was not calculated correctly based on the background width.\",\n\t\t\t\tBACKGROUND_WIDTH, this._scroller.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Scroller was not calculated correctly based on the background width.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._scroller.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Scroller was not calculated correctly based on the background height.\",\n\t\t\t\tBACKGROUND_WIDTH, this._scroller.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Scroller was not calculated correctly based on the background width.\",\n\t\t\t\tBACKGROUND_HEIGHT, this._scroller.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithComplexBackground():void\n\t\t{\n\t\t\tthis.addComplexBackground();\n\t\t\tthis._scroller.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Scroller was not calculated correctly based on the complex background width.\",\n\t\t\t\tCOMPLEX_BACKGROUND_WIDTH, this._scroller.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Scroller was not calculated correctly based on the complex background height.\",\n\t\t\t\tCOMPLEX_BACKGROUND_HEIGHT, this._scroller.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Scroller was not calculated correctly based on the complex background minWidth.\",\n\t\t\t\tCOMPLEX_BACKGROUND_MIN_WIDTH, this._scroller.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Scroller was not calculated correctly based on the complex background minHeight.\",\n\t\t\t\tCOMPLEX_BACKGROUND_MIN_HEIGHT, this._scroller.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithViewPort():void\n\t\t{\n\t\t\t//the explicit dimensions of the view port are saved when the\n\t\t\t//viewPort property is set, so let's be sure they get saved.\n\t\t\tthis._scroller.viewPort = null;\n\t\t\tthis._viewPort.width = VIEW_PORT_WIDTH;\n\t\t\tthis._viewPort.height = VIEW_PORT_HEIGHT;\n\t\t\tthis._viewPort.minWidth = VIEW_PORT_MIN_WIDTH;\n\t\t\tthis._viewPort.minHeight = VIEW_PORT_MIN_HEIGHT;\n\t\t\tthis._scroller.viewPort = this._viewPort;\n\t\t\tthis._scroller.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Scroller was not calculated correctly based on the view port width.\",\n\t\t\t\tVIEW_PORT_WIDTH, this._scroller.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Scroller was not calculated correctly based on the view port height.\",\n\t\t\t\tVIEW_PORT_HEIGHT, this._scroller.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Scroller was not calculated correctly based on the view port minWidth.\",\n\t\t\t\tVIEW_PORT_MIN_WIDTH, this._scroller.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Scroller was not calculated correctly based on the view port minHeight.\",\n\t\t\t\tVIEW_PORT_MIN_HEIGHT, this._scroller.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithViewPortWhenMeasureViewPortIsFalse():void\n\t\t{\n\t\t\tthis._scroller.measureViewPort = false;\n\t\t\t//the explicit dimensions of the view port are saved when the\n\t\t\t//viewPort property is set, so let's be sure they get saved.\n\t\t\tthis._scroller.viewPort = null;\n\t\t\tthis._viewPort.width = VIEW_PORT_WIDTH;\n\t\t\tthis._viewPort.height = VIEW_PORT_HEIGHT;\n\t\t\tthis._viewPort.height = VIEW_PORT_HEIGHT;\n\t\t\tthis._viewPort.minWidth = VIEW_PORT_MIN_WIDTH;\n\t\t\tthis._viewPort.minHeight = VIEW_PORT_MIN_HEIGHT;\n\t\t\tthis._scroller.viewPort = this._viewPort;\n\t\t\tthis._scroller.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the Scroller was not calculated correctly when measureViewPort is false.\",\n\t\t\t\t0, this._scroller.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the Scroller was not calculated correctly when measureViewPort is false.\",\n\t\t\t\t0, this._scroller.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the Scroller was not calculated correctly when measureViewPort is false.\",\n\t\t\t\t0, this._scroller.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the Scroller was not calculated correctly when measureViewPort is false.\",\n\t\t\t\t0, this._scroller.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMaxScrollPositionChangeWhenViewPortResizesOnScroll():void\n\t\t{\n\t\t\t//the explicit dimensions of the view port are saved when the\n\t\t\t//viewPort property is set, so let's be sure they get saved.\n\t\t\tthis._scroller.viewPort = null;\n\t\t\tthis._viewPort.width = VIEW_PORT_WIDTH;\n\t\t\tthis._viewPort.height = VIEW_PORT_HEIGHT;\n\t\t\tthis._viewPort.height = VIEW_PORT_HEIGHT;\n\t\t\tthis._viewPort.minWidth = VIEW_PORT_MIN_WIDTH;\n\t\t\tthis._viewPort.minHeight = VIEW_PORT_MIN_HEIGHT;\n\t\t\tthis._scroller.viewPort = this._viewPort;\n\t\t\tthis._scroller.validate();\n\t\t\tvar oldMaxHSP:Number = this._scroller.maxHorizontalScrollPosition;\n\t\t\tvar oldMaxVSP:Number = this._scroller.maxVerticalScrollPosition;\n\t\t\tthis._viewPort.resizeOnScroll = true;\n\t\t\tthis._scroller.verticalScrollPosition++;\n\t\t\tthis._scroller.validate();\n\n\t\t\tAssert.assertTrue(\"The maxHorizontalScrollPosition of the Scroller did not change correctly when view port width changed during scrolling.\",\n\t\t\t\toldMaxHSP !== this._scroller.maxHorizontalScrollPosition);\n\t\t\tAssert.assertTrue(\"The maxVerticalScrollPosition of the Scroller did not change correctly when view port height changed during scrolling.\",\n\t\t\t\toldMaxVSP !== this._scroller.maxVerticalScrollPosition);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ScrollerTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Scroller;\n\timport feathers.events.FeathersEventType;\n\timport feathers.tests.supportClasses.DisposeFlagQuad;\n\timport feathers.tests.supportClasses.ScrollerViewPort;\n\n\timport flash.geom.Point;\n\n\timport org.flexunit.Assert;\n\timport org.flexunit.async.Async;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\tpublic class ScrollerTests\n\t{\n\t\tprivate static const BACKGROUND_WIDTH:Number = 200;\n\t\tprivate static const BACKGROUND_HEIGHT:Number = 250;\n\t\t\n\t\tprivate static const LARGE_VIEW_PORT_WIDTH:Number = 1000;\n\t\tprivate static const LARGE_VIEW_PORT_HEIGHT:Number = 1100;\n\n\t\tprivate static const SMALL_VIEW_PORT_WIDTH:Number = 100;\n\t\tprivate static const SMALL_VIEW_PORT_HEIGHT:Number = 105;\n\n\t\tprivate static const NEGATIVE_CONTENT_X:Number = -10;\n\t\tprivate static const NEGATIVE_CONTENT_Y:Number = -12;\n\n\t\tprivate static const VERTICAL_DRAG_OFFSET:Number = 100;\n\t\tprivate static const HORIZONTAL_DRAG_OFFSET:Number = 90;\n\t\t\n\t\tprivate var _scroller:Scroller;\n\t\tprivate var _viewPort:ScrollerViewPort;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._viewPort = new ScrollerViewPort();\n\t\t\t\n\t\t\tthis._scroller = new Scroller();\n\t\t\tthis._scroller.viewPort = this._viewPort;\n\t\t\tTestFeathers.starlingRoot.addChild(this._scroller);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._scroller.removeFromParent(true);\n\t\t\tthis._scroller = null;\n\n\t\t\tthis._viewPort = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSkinsDisposed():void\n\t\t{\n\t\t\tvar backgroundSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._scroller.backgroundSkin = backgroundSkin;\n\t\t\tvar backgroundDisabledSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._scroller.backgroundDisabledSkin = backgroundDisabledSkin;\n\t\t\tthis._scroller.validate();\n\t\t\tthis._scroller.dispose();\n\t\t\tAssert.assertTrue(\"backgroundSkin not disposed when Scroller disposed.\", backgroundSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"backgroundDisabledSkin not disposed when Scroller disposed.\", backgroundDisabledSkin.isDisposed);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testResizeBackgroundWithSmallerMaxDimensions():void\n\t\t{\n\t\t\tthis._scroller.maxWidth = BACKGROUND_WIDTH / 3;\n\t\t\tthis._scroller.maxHeight = BACKGROUND_HEIGHT / 3;\n\t\t\tvar backgroundSkin:Quad = new Quad(BACKGROUND_WIDTH, BACKGROUND_HEIGHT);\n\t\t\tthis._scroller.backgroundSkin = backgroundSkin;\n\t\t\tthis._scroller.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The Scroller with smaller maxWidth did not set the width of the background skin.\",\n\t\t\t\tthis._scroller.maxWidth, backgroundSkin.width);\n\t\t\tAssert.assertStrictlyEquals(\"The Scroller with smaller maxHeight did not set the height of the background skin.\",\n\t\t\t\tthis._scroller.maxHeight, backgroundSkin.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testResizeBackgroundWithLargerMinDimensions():void\n\t\t{\n\t\t\tthis._scroller.minWidth = 3 * BACKGROUND_WIDTH;\n\t\t\tthis._scroller.minHeight = 3 * BACKGROUND_HEIGHT;\n\t\t\tvar backgroundSkin:Quad = new Quad(BACKGROUND_WIDTH, BACKGROUND_HEIGHT);\n\t\t\tthis._scroller.backgroundSkin = backgroundSkin;\n\t\t\tthis._scroller.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The Scroller with larger minWidth did not set the width of the background skin.\",\n\t\t\t\tthis._scroller.minWidth, backgroundSkin.width);\n\t\t\tAssert.assertStrictlyEquals(\"The Scroller with larger minHeight did not set the height of the background skin.\",\n\t\t\t\tthis._scroller.minHeight, backgroundSkin.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMaxVerticalScrollPositionWithLargerViewPortHeight():void\n\t\t{\n\t\t\tthis._scroller.width = BACKGROUND_WIDTH;\n\t\t\tthis._scroller.height = BACKGROUND_HEIGHT;\n\t\t\tthis._viewPort.height = LARGE_VIEW_PORT_HEIGHT;\n\t\t\tthis._scroller.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The maxVerticalScrollPosition of the scroller was not calculated correctly with a larger view port height.\",\n\t\t\t\tLARGE_VIEW_PORT_HEIGHT - BACKGROUND_HEIGHT, this._scroller.maxVerticalScrollPosition);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMaxHorizontalScrollPositionWithLargerViewPortWidth():void\n\t\t{\n\t\t\tthis._scroller.width = BACKGROUND_WIDTH;\n\t\t\tthis._scroller.height = BACKGROUND_HEIGHT;\n\t\t\tthis._viewPort.width = LARGE_VIEW_PORT_WIDTH;\n\t\t\tthis._scroller.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The maxHorizontalScrollPosition of the scroller was not calculated correctly with a larger view port width.\",\n\t\t\t\tLARGE_VIEW_PORT_WIDTH - BACKGROUND_WIDTH, this._scroller.maxHorizontalScrollPosition);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMaxVerticalScrollPositionWithSmallerViewPortHeight():void\n\t\t{\n\t\t\tthis._scroller.width = BACKGROUND_WIDTH;\n\t\t\tthis._scroller.height = BACKGROUND_HEIGHT;\n\t\t\tthis._viewPort.height = SMALL_VIEW_PORT_HEIGHT;\n\t\t\tthis._scroller.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The maxVerticalScrollPosition of the scroller was not calculated correctly with a smaller view port height.\",\n\t\t\t\t0, this._scroller.maxVerticalScrollPosition);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMaxHorizontalScrollPositionWithSmallerViewPortWidth():void\n\t\t{\n\t\t\tthis._scroller.width = BACKGROUND_WIDTH;\n\t\t\tthis._scroller.height = BACKGROUND_HEIGHT;\n\t\t\tthis._viewPort.width = SMALL_VIEW_PORT_WIDTH;\n\t\t\tthis._scroller.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The maxHorizontalScrollPosition of the scroller was not calculated correctly with a smaller view port width.\",\n\t\t\t\t0, this._scroller.maxHorizontalScrollPosition);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDefaultMinVerticalScrollPosition():void\n\t\t{\n\t\t\tthis._scroller.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The default minVerticalScrollPosition of the scroller was not calculated correctly.\",\n\t\t\t\t0, this._scroller.minVerticalScrollPosition);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDefaultMinHorizontalScrollPosition():void\n\t\t{\n\t\t\tthis._scroller.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The default minHorizontalScrollPosition of the scroller was not calculated correctly.\",\n\t\t\t\t0, this._scroller.minHorizontalScrollPosition);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMinVerticalScrollPositionWithNegativeContentY():void\n\t\t{\n\t\t\tthis._viewPort.contentY = NEGATIVE_CONTENT_Y;\n\t\t\tthis._scroller.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minVerticalScrollPosition of the scroller was not calculated correctly with contentY < 0.\",\n\t\t\t\tNEGATIVE_CONTENT_Y, this._scroller.minVerticalScrollPosition);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMinHorizontalScrollPositionWithNegativeContentX():void\n\t\t{\n\t\t\tthis._viewPort.contentX = NEGATIVE_CONTENT_X;\n\t\t\tthis._scroller.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minHorizontalScrollPosition of the scroller was not calculated correctly with contentX < 0.\",\n\t\t\t\tNEGATIVE_CONTENT_X, this._scroller.minHorizontalScrollPosition);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testDragVerticallyToScroll():void\n\t\t{\n\t\t\tthis._scroller.width = BACKGROUND_WIDTH;\n\t\t\tthis._scroller.height = BACKGROUND_HEIGHT;\n\t\t\tthis._viewPort.width = BACKGROUND_WIDTH;\n\t\t\tthis._viewPort.height = LARGE_VIEW_PORT_HEIGHT;\n\t\t\tthis._scroller.validate();\n\n\t\t\tvar hasDispatchedScrollStart:Boolean = false;\n\t\t\tthis._scroller.addEventListener(FeathersEventType.SCROLL_START, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedScrollStart = true;\n\t\t\t});\n\t\t\t\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._scroller.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tvar self:Object = this;\n\t\t\tvar scroller:Scroller = this._scroller;\n\t\t\tAsync.delayCall(self, function():void\n\t\t\t{\n\t\t\t\t//move the touch a bit to start scrolling\n\t\t\t\t//it won't have changed the scroll position yet, though\n\t\t\t\ttouch.globalY = -VERTICAL_DRAG_OFFSET;\n\t\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t\tAsync.delayCall(self, function():void\n\t\t\t\t{\n\t\t\t\t\tAssert.assertTrue(\"Scroller FeathersEventType.SCROLL_START was not dispatched when dragging\", hasDispatchedScrollStart);\n\t\t\t\t\tAssert.assertTrue(\"Scroller isScrolling was not set to true when dragging\", scroller.isScrolling);\n\n\t\t\t\t\t//move the touch a bit more to drag\n\t\t\t\t\ttouch.globalY = 2 * -VERTICAL_DRAG_OFFSET;\n\t\t\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t\t\n\t\t\t\t\tAsync.delayCall(self, function():void\n\t\t\t\t\t{\n\t\t\t\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t\t\t\t\n\t\t\t\t\t\tAssert.assertTrue(\"Scroller verticalScrollPosition must change when dragged vertically:\",\n\t\t\t\t\t\t\tscroller.verticalScrollPosition > 0);\n\t\t\t\t\t}, 25);\n\t\t\t\t}, 25);\n\t\t\t}, 25);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testDragHorizontallyToScroll():void\n\t\t{\n\t\t\tthis._scroller.width = BACKGROUND_WIDTH;\n\t\t\tthis._scroller.height = BACKGROUND_HEIGHT;\n\t\t\tthis._viewPort.width = LARGE_VIEW_PORT_WIDTH;\n\t\t\tthis._viewPort.height = BACKGROUND_HEIGHT;\n\t\t\tthis._scroller.validate();\n\n\t\t\tvar hasDispatchedScrollStart:Boolean = false;\n\t\t\tthis._scroller.addEventListener(FeathersEventType.SCROLL_START, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedScrollStart = true;\n\t\t\t});\n\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._scroller.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tvar self:Object = this;\n\t\t\tvar scroller:Scroller = this._scroller;\n\t\t\tAsync.delayCall(self, function():void\n\t\t\t{\n\t\t\t\t//move the touch a bit to start scrolling\n\t\t\t\t//it won't have changed the scroll position yet, though\n\t\t\t\ttouch.globalX = -HORIZONTAL_DRAG_OFFSET;\n\t\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t\tAsync.delayCall(self, function():void\n\t\t\t\t{\n\t\t\t\t\tAssert.assertTrue(\"Scroller FeathersEventType.SCROLL_START was not dispatched when dragging\", hasDispatchedScrollStart);\n\t\t\t\t\tAssert.assertTrue(\"Scroller isScrolling was not set to true when dragging\", scroller.isScrolling);\n\n\t\t\t\t\t//move the touch a bit more to drag\n\t\t\t\t\ttouch.globalX = 2 * -HORIZONTAL_DRAG_OFFSET;\n\t\t\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\t\t\tAsync.delayCall(self, function():void\n\t\t\t\t\t{\n\t\t\t\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\t\t\t\tAssert.assertTrue(\"Scroller horizontalScrollPosition must change when dragged horizontally:\",\n\t\t\t\t\t\t\tscroller.horizontalScrollPosition > 0);\n\t\t\t\t\t}, 25);\n\t\t\t\t}, 25);\n\t\t\t}, 25);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testDragVerticallyBeyondMaxWithElasticEdges():void\n\t\t{\n\t\t\tthis._scroller.hasElasticEdges = true;\n\t\t\tthis._scroller.width = BACKGROUND_WIDTH;\n\t\t\tthis._scroller.height = BACKGROUND_HEIGHT;\n\t\t\tthis._viewPort.width = BACKGROUND_WIDTH;\n\t\t\tthis._viewPort.height = LARGE_VIEW_PORT_HEIGHT;\n\t\t\tthis._scroller.validate();\n\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._scroller.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tvar self:Object = this;\n\t\t\tvar scroller:Scroller = this._scroller;\n\t\t\tAsync.delayCall(self, function():void\n\t\t\t{\n\t\t\t\t//move the touch a bit to start scrolling\n\t\t\t\t//it won't have changed the scroll position yet, though\n\t\t\t\ttouch.globalY = -VERTICAL_DRAG_OFFSET;\n\t\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\t\tAsync.delayCall(self, function():void\n\t\t\t\t{\n\t\t\t\t\t//move the touch well beyond the maximum edge\n\t\t\t\t\ttouch.globalY = 2 * -LARGE_VIEW_PORT_HEIGHT;\n\t\t\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\t\t\tAsync.delayCall(self, function():void\n\t\t\t\t\t{\n\t\t\t\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t\t\t\tAssert.assertTrue(\"Scroller: verticalScrollPosition must be able to be larger than maxVerticalScrollPosition when dragging with elastic edges\",\n\t\t\t\t\t\t\tscroller.verticalScrollPosition > scroller.maxVerticalScrollPosition);\n\t\t\t\t\t}, 25);\n\t\t\t\t}, 25);\n\t\t\t}, 25);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testDragVerticallyBeyondMaxWithoutElasticEdges():void\n\t\t{\n\t\t\tthis._scroller.hasElasticEdges = false;\n\t\t\tthis._scroller.width = BACKGROUND_WIDTH;\n\t\t\tthis._scroller.height = BACKGROUND_HEIGHT;\n\t\t\tthis._viewPort.width = BACKGROUND_WIDTH;\n\t\t\tthis._viewPort.height = LARGE_VIEW_PORT_HEIGHT;\n\t\t\tthis._scroller.validate();\n\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._scroller.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tvar self:Object = this;\n\t\t\tvar scroller:Scroller = this._scroller;\n\t\t\tAsync.delayCall(self, function():void\n\t\t\t{\n\t\t\t\t//move the touch a bit to start scrolling\n\t\t\t\t//it won't have changed the scroll position yet, though\n\t\t\t\ttouch.globalY = -VERTICAL_DRAG_OFFSET;\n\t\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\t\tAsync.delayCall(self, function():void\n\t\t\t\t{\n\t\t\t\t\t//move the touch well beyond the maximum edge\n\t\t\t\t\ttouch.globalY = 2 * -LARGE_VIEW_PORT_HEIGHT;\n\t\t\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\t\t\tAsync.delayCall(self, function():void\n\t\t\t\t\t{\n\t\t\t\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t\t\t\tAssert.assertStrictlyEquals(\"Scroller: verticalScrollPosition must be equal to maxVerticalScrollPosition when dragging without elastic edges\",\n\t\t\t\t\t\t\tscroller.maxVerticalScrollPosition, scroller.verticalScrollPosition);\n\t\t\t\t\t}, 25);\n\t\t\t\t}, 25);\n\t\t\t}, 25);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testDragVerticallyBeyondMinWithElasticEdges():void\n\t\t{\n\t\t\tthis._scroller.hasElasticEdges = true;\n\t\t\tthis._scroller.width = BACKGROUND_WIDTH;\n\t\t\tthis._scroller.height = BACKGROUND_HEIGHT;\n\t\t\tthis._viewPort.width = BACKGROUND_WIDTH;\n\t\t\tthis._viewPort.height = LARGE_VIEW_PORT_HEIGHT;\n\t\t\tthis._scroller.validate();\n\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._scroller.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tvar self:Object = this;\n\t\t\tvar scroller:Scroller = this._scroller;\n\t\t\tAsync.delayCall(self, function():void\n\t\t\t{\n\t\t\t\t//move the touch a bit to start scrolling\n\t\t\t\t//it won't have changed the scroll position yet, though\n\t\t\t\ttouch.globalY = VERTICAL_DRAG_OFFSET;\n\t\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\t\tAsync.delayCall(self, function():void\n\t\t\t\t{\n\t\t\t\t\t//move the touch well beyond the maximum edge\n\t\t\t\t\ttouch.globalY = 2 * LARGE_VIEW_PORT_HEIGHT;\n\t\t\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\t\t\tAsync.delayCall(self, function():void\n\t\t\t\t\t{\n\t\t\t\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t\t\t\tAssert.assertTrue(\"Scroller: verticalScrollPosition must be able to be smaller than minVerticalScrollPosition when dragging with elastic edges\",\n\t\t\t\t\t\t\tscroller.verticalScrollPosition < scroller.minVerticalScrollPosition);\n\t\t\t\t\t}, 25);\n\t\t\t\t}, 25);\n\t\t\t}, 25);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testDragVerticallyBeyondMinWithoutElasticEdges():void\n\t\t{\n\t\t\tthis._scroller.hasElasticEdges = false;\n\t\t\tthis._scroller.width = BACKGROUND_WIDTH;\n\t\t\tthis._scroller.height = BACKGROUND_HEIGHT;\n\t\t\tthis._viewPort.width = BACKGROUND_WIDTH;\n\t\t\tthis._viewPort.height = LARGE_VIEW_PORT_HEIGHT;\n\t\t\tthis._scroller.validate();\n\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._scroller.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tvar self:Object = this;\n\t\t\tvar scroller:Scroller = this._scroller;\n\t\t\tAsync.delayCall(self, function():void\n\t\t\t{\n\t\t\t\t//move the touch a bit to start scrolling\n\t\t\t\t//it won't have changed the scroll position yet, though\n\t\t\t\ttouch.globalY = VERTICAL_DRAG_OFFSET;\n\t\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\t\tAsync.delayCall(self, function():void\n\t\t\t\t{\n\t\t\t\t\t//move the touch well beyond the maximum edge\n\t\t\t\t\ttouch.globalY = 2 * LARGE_VIEW_PORT_HEIGHT;\n\t\t\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\t\t\tAsync.delayCall(self, function():void\n\t\t\t\t\t{\n\t\t\t\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t\t\t\tAssert.assertStrictlyEquals(\"Scroller: verticalScrollPosition must be equal to minVerticalScrollPosition when dragging without elastic edges\",\n\t\t\t\t\t\t\tscroller.minVerticalScrollPosition, scroller.verticalScrollPosition);\n\t\t\t\t\t}, 25);\n\t\t\t\t}, 25);\n\t\t\t}, 25);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testDragHorizontallyBeyondMaxWithElasticEdges():void\n\t\t{\n\t\t\tthis._scroller.hasElasticEdges = true;\n\t\t\tthis._scroller.width = BACKGROUND_WIDTH;\n\t\t\tthis._scroller.height = BACKGROUND_HEIGHT;\n\t\t\tthis._viewPort.width = LARGE_VIEW_PORT_WIDTH;\n\t\t\tthis._viewPort.height = BACKGROUND_HEIGHT;\n\t\t\tthis._scroller.validate();\n\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._scroller.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tvar self:Object = this;\n\t\t\tvar scroller:Scroller = this._scroller;\n\t\t\tAsync.delayCall(self, function():void\n\t\t\t{\n\t\t\t\t//move the touch a bit to start scrolling\n\t\t\t\t//it won't have changed the scroll position yet, though\n\t\t\t\ttouch.globalX = -HORIZONTAL_DRAG_OFFSET;\n\t\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\t\tAsync.delayCall(self, function():void\n\t\t\t\t{\n\t\t\t\t\t//move the touch well beyond the maximum edge\n\t\t\t\t\ttouch.globalX = 2 * -LARGE_VIEW_PORT_WIDTH;\n\t\t\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\t\t\tAsync.delayCall(self, function():void\n\t\t\t\t\t{\n\t\t\t\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t\t\t\tAssert.assertTrue(\"Scroller: horizontalScrollPosition must be able to be larger than maxHorizontalScrollPosition when dragging with elastic edges\",\n\t\t\t\t\t\t\tscroller.horizontalScrollPosition > scroller.maxHorizontalScrollPosition);\n\t\t\t\t\t}, 25);\n\t\t\t\t}, 25);\n\t\t\t}, 25);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testDragHorizontallyBeyondMaxWithoutElasticEdges():void\n\t\t{\n\t\t\tthis._scroller.hasElasticEdges = false;\n\t\t\tthis._scroller.width = BACKGROUND_WIDTH;\n\t\t\tthis._scroller.height = BACKGROUND_HEIGHT;\n\t\t\tthis._viewPort.width = LARGE_VIEW_PORT_WIDTH;\n\t\t\tthis._viewPort.height = BACKGROUND_HEIGHT;\n\t\t\tthis._scroller.validate();\n\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._scroller.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tvar self:Object = this;\n\t\t\tvar scroller:Scroller = this._scroller;\n\t\t\tAsync.delayCall(self, function():void\n\t\t\t{\n\t\t\t\t//move the touch a bit to start scrolling\n\t\t\t\t//it won't have changed the scroll position yet, though\n\t\t\t\ttouch.globalX = -HORIZONTAL_DRAG_OFFSET;\n\t\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\t\tAsync.delayCall(self, function():void\n\t\t\t\t{\n\t\t\t\t\t//move the touch well beyond the maximum edge\n\t\t\t\t\ttouch.globalX = 2 * -LARGE_VIEW_PORT_WIDTH;\n\t\t\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\t\t\tAsync.delayCall(self, function():void\n\t\t\t\t\t{\n\t\t\t\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t\t\t\tAssert.assertStrictlyEquals(\"Scroller: horizontalScrollPosition must be equal to maxHorizontalScrollPosition when dragging with elastic edges\",\n\t\t\t\t\t\t\tscroller.maxHorizontalScrollPosition, scroller.horizontalScrollPosition);\n\t\t\t\t\t}, 25);\n\t\t\t\t}, 25);\n\t\t\t}, 25);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testDragHorizontallyBeyondMinWithElasticEdges():void\n\t\t{\n\t\t\tthis._scroller.hasElasticEdges = true;\n\t\t\tthis._scroller.width = BACKGROUND_WIDTH;\n\t\t\tthis._scroller.height = BACKGROUND_HEIGHT;\n\t\t\tthis._viewPort.width = LARGE_VIEW_PORT_WIDTH;\n\t\t\tthis._viewPort.height = BACKGROUND_HEIGHT;\n\t\t\tthis._scroller.validate();\n\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._scroller.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tvar self:Object = this;\n\t\t\tvar scroller:Scroller = this._scroller;\n\t\t\tAsync.delayCall(self, function():void\n\t\t\t{\n\t\t\t\t//move the touch a bit to start scrolling\n\t\t\t\t//it won't have changed the scroll position yet, though\n\t\t\t\ttouch.globalX = HORIZONTAL_DRAG_OFFSET;\n\t\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\t\tAsync.delayCall(self, function():void\n\t\t\t\t{\n\t\t\t\t\t//move the touch well beyond the maximum edge\n\t\t\t\t\ttouch.globalX = 2 * LARGE_VIEW_PORT_WIDTH;\n\t\t\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\t\t\tAsync.delayCall(self, function():void\n\t\t\t\t\t{\n\t\t\t\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t\t\t\tAssert.assertTrue(\"Scroller: horizontalScrollPosition must be able to be smaller than minHorizontalScrollPosition when dragging with elastic edges\",\n\t\t\t\t\t\t\tscroller.horizontalScrollPosition < scroller.minHorizontalScrollPosition);\n\t\t\t\t\t}, 25);\n\t\t\t\t}, 25);\n\t\t\t}, 25);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testDragHorizontallyBeyondMinWithoutElasticEdges():void\n\t\t{\n\t\t\tthis._scroller.hasElasticEdges = false;\n\t\t\tthis._scroller.width = BACKGROUND_WIDTH;\n\t\t\tthis._scroller.height = BACKGROUND_HEIGHT;\n\t\t\tthis._viewPort.width = LARGE_VIEW_PORT_WIDTH;\n\t\t\tthis._viewPort.height = BACKGROUND_HEIGHT;\n\t\t\tthis._scroller.validate();\n\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._scroller.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tvar self:Object = this;\n\t\t\tvar scroller:Scroller = this._scroller;\n\t\t\tAsync.delayCall(self, function():void\n\t\t\t{\n\t\t\t\t//move the touch a bit to start scrolling\n\t\t\t\t//it won't have changed the scroll position yet, though\n\t\t\t\ttouch.globalX = HORIZONTAL_DRAG_OFFSET;\n\t\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\t\tAsync.delayCall(self, function():void\n\t\t\t\t{\n\t\t\t\t\t//move the touch well beyond the maximum edge\n\t\t\t\t\ttouch.globalX = 2 * LARGE_VIEW_PORT_WIDTH;\n\t\t\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\t\t\tAsync.delayCall(self, function():void\n\t\t\t\t\t{\n\t\t\t\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t\t\t\tAssert.assertStrictlyEquals(\"Scroller: horizontalScrollPosition must be equal to minHorizontalScrollPosition when dragging with elastic edges\",\n\t\t\t\t\t\t\tscroller.minHorizontalScrollPosition, scroller.horizontalScrollPosition);\n\t\t\t\t\t}, 25);\n\t\t\t\t}, 25);\n\t\t\t}, 25);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testScrollCompleteEventOnRemovedFromStage():void\n\t\t{\n\t\t\tthis._scroller.width = BACKGROUND_WIDTH;\n\t\t\tthis._scroller.height = BACKGROUND_HEIGHT;\n\t\t\tthis._viewPort.width = LARGE_VIEW_PORT_WIDTH;\n\t\t\tthis._viewPort.height = BACKGROUND_HEIGHT;\n\t\t\tthis._scroller.validate();\n\n\t\t\tvar hasDispatchedScrollComplete:Boolean = false;\n\t\t\tthis._scroller.addEventListener(FeathersEventType.SCROLL_COMPLETE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedScrollComplete = true;\n\t\t\t});\n\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._scroller.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tvar self:Object = this;\n\t\t\tvar scroller:Scroller = this._scroller;\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\ttouch.globalX = HORIZONTAL_DRAG_OFFSET; //move the touch a bit to drag\n\t\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\t\tAsync.delayCall(self, function():void\n\t\t\t\t{\n\t\t\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t\t\t\n\t\t\t\t\tscroller.removeFromParent();\n\n\t\t\t\t\tAssert.assertTrue(\"Scroller FeathersEventType.SCROLL_COMPLETE was not dispatched when removed from stage\", hasDispatchedScrollComplete);\n\t\t\t\t}, 25);\n\t\t\t}, 25);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNewMaskXPositionOnHorizontalScroll():void\n\t\t{\n\t\t\tthis._scroller.width = BACKGROUND_WIDTH;\n\t\t\tthis._scroller.height = BACKGROUND_HEIGHT;\n\t\t\tthis._viewPort.width = LARGE_VIEW_PORT_WIDTH;\n\t\t\tthis._scroller.validate();\n\t\t\tthis._scroller.horizontalScrollPosition = this._scroller.maxHorizontalScrollPosition / 2;\n\t\t\tthis._scroller.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The mask x position of the scroller's view port was not calculated correctly with horizontalScrollPosition > 0.\",\n\t\t\t\tthis._scroller.maxHorizontalScrollPosition / 2, this._viewPort.mask.x);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNewMaskYPositionOnVerticalScroll():void\n\t\t{\n\t\t\tthis._scroller.width = BACKGROUND_WIDTH;\n\t\t\tthis._scroller.height = BACKGROUND_HEIGHT;\n\t\t\tthis._viewPort.height = LARGE_VIEW_PORT_HEIGHT;\n\t\t\tthis._scroller.validate();\n\t\t\tthis._scroller.verticalScrollPosition = this._scroller.maxVerticalScrollPosition / 2;\n\t\t\tthis._scroller.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The mask y position of the scroller's view port was not calculated correctly with verticalScrollPosition > 0.\",\n\t\t\t\tthis._scroller.maxVerticalScrollPosition / 2, this._viewPort.mask.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoHideBackgroundWithoutScrolling():void\n\t\t{\n\t\t\tthis._scroller.backgroundSkin = new Quad(1, 1, 0xff00ff);\n\t\t\tthis._scroller.autoHideBackground = true;\n\t\t\tthis._scroller.validate();\n\t\t\tAssert.assertTrue(\"Background is incorrectly hidden.\", this._scroller.backgroundSkin.visible);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testScrollToPositionWithZeroDuration():void\n\t\t{\n\t\t\tvar hasDispatchedScrollStart:Boolean = false;\n\t\t\tthis._scroller.addEventListener(FeathersEventType.SCROLL_START, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedScrollStart = true;\n\t\t\t});\n\t\t\tvar hasDispatchedScrollComplete:Boolean = false;\n\t\t\tthis._scroller.addEventListener(FeathersEventType.SCROLL_COMPLETE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedScrollComplete = true;\n\t\t\t});\n\t\t\tthis._scroller.width = BACKGROUND_WIDTH;\n\t\t\tthis._scroller.height = BACKGROUND_HEIGHT;\n\t\t\tthis._viewPort.width = LARGE_VIEW_PORT_WIDTH;\n\t\t\tthis._viewPort.height = BACKGROUND_HEIGHT;\n\t\t\tthis._scroller.validate();\n\t\t\tvar targetPosition:Number = LARGE_VIEW_PORT_WIDTH - BACKGROUND_WIDTH;\n\t\t\tthis._scroller.scrollToPosition(targetPosition, 0, 0);\n\t\t\tthis._scroller.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Scroller: scrollToPosition() did not scroll to correct position\",\n\t\t\t\ttargetPosition, this._scroller.horizontalScrollPosition);\n\t\t\tAssert.assertTrue(\"Scroller: scrollToPosition() with duration 0 did not dispatch FeathersEventType.SCROLL_START\",\n\t\t\t\thasDispatchedScrollStart);\n\t\t\tAssert.assertTrue(\"Scroller: scrollToPosition() with duration 0 did not dispatch FeathersEventType.SCROLL_COMPLETE\",\n\t\t\t\thasDispatchedScrollComplete);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testScrollToPageIndexWithZeroDuration():void\n\t\t{\n\t\t\tvar hasDispatchedScrollStart:Boolean = false;\n\t\t\tthis._scroller.addEventListener(FeathersEventType.SCROLL_START, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedScrollStart = true;\n\t\t\t});\n\t\t\tvar hasDispatchedScrollComplete:Boolean = false;\n\t\t\tthis._scroller.addEventListener(FeathersEventType.SCROLL_COMPLETE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedScrollComplete = true;\n\t\t\t});\n\t\t\tthis._scroller.snapToPages = true;\n\t\t\tthis._scroller.width = BACKGROUND_WIDTH;\n\t\t\tthis._scroller.height = BACKGROUND_HEIGHT;\n\t\t\tthis._viewPort.width = LARGE_VIEW_PORT_WIDTH;\n\t\t\tthis._viewPort.height = BACKGROUND_HEIGHT;\n\t\t\tthis._scroller.validate();\n\t\t\tthis._scroller.scrollToPageIndex(2, 0, 0);\n\t\t\tthis._scroller.validate();\n\t\t\tAssert.assertStrictlyEquals(\"Scroller: scrollToPageIndex() did not scroll to correct page\",\n\t\t\t\t2, this._scroller.horizontalPageIndex);\n\t\t\tAssert.assertTrue(\"Scroller: scrollToPageIndex() with duration 0 did not dispatch FeathersEventType.SCROLL_START\",\n\t\t\t\thasDispatchedScrollStart);\n\t\t\tAssert.assertTrue(\"Scroller: scrollToPageIndex() with duration 0 did not dispatch FeathersEventType.SCROLL_COMPLETE\",\n\t\t\t\thasDispatchedScrollComplete);\n\t\t}\n\n\t\t[Test(async,timeout=\"1500\")]\n\t\tpublic function testStopScrollingOnThrow():void\n\t\t{\n\t\t\tthis._scroller.width = BACKGROUND_WIDTH;\n\t\t\tthis._scroller.height = BACKGROUND_HEIGHT;\n\t\t\tthis._viewPort.width = LARGE_VIEW_PORT_WIDTH;\n\t\t\tthis._viewPort.height = BACKGROUND_HEIGHT;\n\t\t\tthis._scroller.validate();\n\t\t\tthis._scroller.scrollToPosition(LARGE_VIEW_PORT_WIDTH - BACKGROUND_WIDTH, 0, 1.0);\n\t\t\tthis._scroller.validate();\n\t\t\tvar stopScrollPosition:Number = 0;\n\t\t\tvar scroller:Scroller = this._scroller;\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tstopScrollPosition = _scroller.horizontalScrollPosition;\n\t\t\t\tscroller.stopScrolling();\n\t\t\t}, 500);\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertStrictlyEquals(\"After scrollToPosition(), stopScrolling() did not stop scrolling before duration complete. Scroll position does not match.\",\n\t\t\t\t\tstopScrollPosition, scroller.horizontalScrollPosition);\n\t\t\t}, 1000);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testStopScrollingOnDrag():void\n\t\t{\n\t\t\tthis._scroller.width = BACKGROUND_WIDTH;\n\t\t\tthis._scroller.height = BACKGROUND_HEIGHT;\n\t\t\tthis._viewPort.width = LARGE_VIEW_PORT_WIDTH;\n\t\t\tthis._viewPort.height = BACKGROUND_HEIGHT;\n\t\t\tthis._scroller.validate();\n\n\t\t\tvar stopScrollPosition:Number = 0;\n\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._scroller.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tvar self:Object = this;\n\t\t\tvar scroller:Scroller = this._scroller;\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\ttouch.globalX = HORIZONTAL_DRAG_OFFSET; //move the touch a bit to drag\n\t\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t\tscroller.stopScrolling();\n\t\t\t\tstopScrollPosition = scroller.horizontalScrollPosition;\n\n\t\t\t\tAsync.delayCall(self, function():void\n\t\t\t\t{\n\t\t\t\t\ttouch.globalX = 2 * HORIZONTAL_DRAG_OFFSET; //drag more\n\t\t\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\t\t\tAssert.assertStrictlyEquals(\"After touch drag, stopScrolling() did not stop scrolling if dragged further. Scroll position does not match.\",\n\t\t\t\t\t\tstopScrollPosition, scroller.horizontalScrollPosition);\n\t\t\t\t}, 25);\n\t\t\t}, 25);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/SimpleScrollBarHorizontalTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.SimpleScrollBar;\n\timport feathers.layout.Direction;\n\n\timport flash.geom.Point;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\tpublic class SimpleScrollBarHorizontalTests\n\t{\n\t\tprivate static const THUMB_NAME:String = \"thumb\";\n\t\tprivate static const THUMB_WIDTH:Number = 20;\n\t\tprivate static const THUMB_HEIGHT:Number = 20;\n\t\tprivate static const SCROLL_BAR_WIDTH:Number = 200;\n\n\t\tprivate var _scrollBar:SimpleScrollBar;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._scrollBar = new SimpleScrollBar();\n\t\t\tthis._scrollBar.direction = Direction.HORIZONTAL;\n\t\t\tthis._scrollBar.thumbFactory = function():Button\n\t\t\t{\n\t\t\t\tvar thumb:Button = new Button();\n\t\t\t\tthumb.name = THUMB_NAME;\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, THUMB_HEIGHT);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.width = SCROLL_BAR_WIDTH;\n\t\t\tTestFeathers.starlingRoot.addChild(this._scrollBar);\n\t\t\tthis._scrollBar.validate();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._scrollBar.removeFromParent(true);\n\t\t\tthis._scrollBar = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSingleTrackAutoSize():void\n\t\t{\n\t\t\tAssert.assertStrictlyEquals(\"The height of the scroll bar was not calculated correctly.\",\n\t\t\t\tTHUMB_HEIGHT, this._scrollBar.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetValueProgramaticallyWithMinimum():void\n\t\t{\n\t\t\tthis._scrollBar.clampToRange = true;\n\t\t\tthis._scrollBar.minimum = 5;\n\t\t\tthis._scrollBar.maximum = 10;\n\t\t\tthis._scrollBar.value = 2;\n\t\t\tAssert.assertEquals(\"Setting value smaller than minimum not changed to minimum.\", this._scrollBar.minimum, this._scrollBar.value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetValueProgramaticallyWithMaximum():void\n\t\t{\n\t\t\tthis._scrollBar.clampToRange = true;\n\t\t\tthis._scrollBar.minimum = 5;\n\t\t\tthis._scrollBar.maximum = 10;\n\t\t\tthis._scrollBar.value = 12;\n\t\t\tAssert.assertEquals(\"Setting value larger than maximum not changed to maximum.\", this._scrollBar.maximum, this._scrollBar.value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testProgrammaticSelectionChange():void\n\t\t{\n\t\t\tthis._scrollBar.minimum = 0;\n\t\t\tthis._scrollBar.maximum = 10;\n\t\t\tthis._scrollBar.step = 1;\n\t\t\tthis._scrollBar.page = 2;\n\t\t\tthis._scrollBar.value = 5;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._scrollBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._scrollBar.value = 6;\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInteractiveSelectionChangeWithDraggingThumb():void\n\t\t{\n\t\t\tvar beforeValue:Number = 5;\n\t\t\tthis._scrollBar.minimum = 0;\n\t\t\tthis._scrollBar.maximum = 10;\n\t\t\tthis._scrollBar.step = 1;\n\t\t\tthis._scrollBar.page = 2;\n\t\t\tthis._scrollBar.value = beforeValue;\n\t\t\t//validate to position the thumb correctly.\n\t\t\tthis._scrollBar.validate();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._scrollBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(SCROLL_BAR_WIDTH / 2, THUMB_HEIGHT / 2);\n\t\t\tvar target:DisplayObject = this._scrollBar.stage.hitTest(position);\n\n\t\t\tAssert.assertStrictlyEquals(\"The hit test did not return the scroll bar's thumb\",\n\t\t\t\tthis._scrollBar.getChildByName(THUMB_NAME).name, target.name);\n\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\ttouch.globalX = position.x + THUMB_WIDTH * 2;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"The value property was not changed to a greater value\",\n\t\t\t\tbeforeValue < this._scrollBar.value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInteractiveSelectionChangeWithDraggingThumbBeyondRightEdgeOfTrack():void\n\t\t{\n\t\t\tvar beforeValue:Number = 5;\n\t\t\tthis._scrollBar.minimum = 0;\n\t\t\tthis._scrollBar.maximum = 10;\n\t\t\tthis._scrollBar.step = 1;\n\t\t\tthis._scrollBar.page = 2;\n\t\t\tthis._scrollBar.value = beforeValue;\n\t\t\t//validate to position the thumb correctly.\n\t\t\tthis._scrollBar.validate();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._scrollBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(SCROLL_BAR_WIDTH / 2, THUMB_HEIGHT / 2);\n\t\t\tvar target:DisplayObject = this._scrollBar.stage.hitTest(position);\n\n\t\t\tAssert.assertStrictlyEquals(\"The hit test did not return the scroll bar's thumb\",\n\t\t\t\tthis._scrollBar.getChildByName(THUMB_NAME).name, target.name);\n\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\ttouch.globalX = position.x + SCROLL_BAR_WIDTH;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The value property was not equal to the maximum value\",\n\t\t\t\tthis._scrollBar.maximum, this._scrollBar.value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInteractiveSelectionChangeWithDraggingThumbBeyondLeftEdgeOfTrack():void\n\t\t{\n\t\t\tvar beforeValue:Number = 5;\n\t\t\tthis._scrollBar.minimum = 0;\n\t\t\tthis._scrollBar.maximum = 10;\n\t\t\tthis._scrollBar.step = 1;\n\t\t\tthis._scrollBar.page = 2;\n\t\t\tthis._scrollBar.value = beforeValue;\n\t\t\t//validate to position the thumb correctly.\n\t\t\tthis._scrollBar.validate();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._scrollBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(SCROLL_BAR_WIDTH / 2, THUMB_HEIGHT / 2);\n\t\t\tvar target:DisplayObject = this._scrollBar.stage.hitTest(position);\n\n\t\t\tAssert.assertStrictlyEquals(\"The hit test did not return the scroll bar's thumb\",\n\t\t\t\tthis._scrollBar.getChildByName(THUMB_NAME).name, target.name);\n\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\ttouch.globalX = position.x - SCROLL_BAR_WIDTH;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The value property was not equal to the minimum value\",\n\t\t\t\tthis._scrollBar.minimum, this._scrollBar.value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInteractiveSelectionChangeWithTouchToLeftOfThumb():void\n\t\t{\n\t\t\tvar beforeValue:Number = 5;\n\t\t\tvar page:Number = 2;\n\t\t\tthis._scrollBar.minimum = 0;\n\t\t\tthis._scrollBar.maximum = 10;\n\t\t\tthis._scrollBar.step = 1;\n\t\t\tthis._scrollBar.page = page;\n\t\t\tthis._scrollBar.value = beforeValue;\n\t\t\t//validate to position the thumb correctly.\n\t\t\tthis._scrollBar.validate();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._scrollBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(SCROLL_BAR_WIDTH / 4, THUMB_HEIGHT / 2);\n\t\t\tvar target:DisplayObject = this._scrollBar.stage.hitTest(position);\n\t\t\t\n\t\t\tAssert.assertTrue(\"The hit test did not return a display object contained by the scroll bar\",\n\t\t\t\tthis._scrollBar.contains(target));\n\t\t\tAssert.assertFalse(\"The hit test incorrectly returned the scroll bar's thumb\",\n\t\t\t\tthis._scrollBar.getChildByName(THUMB_NAME).name === target.name);\n\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The value property was not equal to the previous value minus the page\",\n\t\t\t\tbeforeValue - page, this._scrollBar.value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInteractiveSelectionChangeWithTouchToRightOfThumb():void\n\t\t{\n\t\t\tvar beforeValue:Number = 5;\n\t\t\tvar page:Number = 2;\n\t\t\tthis._scrollBar.minimum = 0;\n\t\t\tthis._scrollBar.maximum = 10;\n\t\t\tthis._scrollBar.step = 1;\n\t\t\tthis._scrollBar.page = page;\n\t\t\tthis._scrollBar.value = beforeValue;\n\t\t\t//validate to position the thumb correctly.\n\t\t\tthis._scrollBar.validate();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._scrollBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(3 * SCROLL_BAR_WIDTH / 4, THUMB_HEIGHT / 2);\n\t\t\tvar target:DisplayObject = this._scrollBar.stage.hitTest(position);\n\n\t\t\tAssert.assertTrue(\"The hit test did not return a display object contained by the scroll bar\",\n\t\t\t\tthis._scrollBar.contains(target));\n\t\t\tAssert.assertFalse(\"The hit test incorrectly returned the scroll bar's thumb\",\n\t\t\t\tthis._scrollBar.getChildByName(THUMB_NAME).name === target.name);\n\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The value property was not equal to the previous value plus the page\",\n\t\t\t\tbeforeValue + page, this._scrollBar.value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFallBackToStepWhenPageIsZero():void\n\t\t{\n\t\t\tvar beforeValue:Number = 5;\n\t\t\tvar step:Number = 1;\n\t\t\tthis._scrollBar.minimum = 0;\n\t\t\tthis._scrollBar.maximum = 10;\n\t\t\tthis._scrollBar.step = step;\n\t\t\tthis._scrollBar.page = 0;\n\t\t\tthis._scrollBar.value = beforeValue;\n\t\t\t//validate to position the thumb correctly.\n\t\t\tthis._scrollBar.validate();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._scrollBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(SCROLL_BAR_WIDTH / 3, THUMB_HEIGHT / 2);\n\t\t\tvar target:DisplayObject = this._scrollBar.stage.hitTest(position);\n\n\t\t\tAssert.assertTrue(\"The hit test did not return a display object contained by the scroll bar\",\n\t\t\t\tthis._scrollBar.contains(target));\n\t\t\tAssert.assertFalse(\"The hit test incorrectly returned the scroll bar's thumb\",\n\t\t\t\tthis._scrollBar.getChildByName(THUMB_NAME).name === target.name);\n\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertStrictlyEquals(\"The value property was not equal to the the previous value minus the step value\",\n\t\t\t\tbeforeValue - step, this._scrollBar.value);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/SimpleScrollBarMeasurementTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.BasicButton;\n\timport feathers.controls.SimpleScrollBar;\n\timport feathers.layout.Direction;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class SimpleScrollBarMeasurementTests\n\t{\n\t\tprivate static const HORIZONTAL_THUMB_WIDTH:Number = 25;\n\t\tprivate static const HORIZONTAL_THUMB_HEIGHT:Number = 20;\n\t\tprivate static const HORIZONTAL_THUMB_MIN_WIDTH:Number = 16;\n\t\tprivate static const HORIZONTAL_THUMB_MIN_HEIGHT:Number = 14;\n\n\t\tprivate static const VERTICAL_THUMB_WIDTH:Number = 15;\n\t\tprivate static const VERTICAL_THUMB_HEIGHT:Number = 18;\n\t\tprivate static const VERTICAL_THUMB_MIN_WIDTH:Number = 10;\n\t\tprivate static const VERTICAL_THUMB_MIN_HEIGHT:Number = 12;\n\t\t\n\t\tprivate static const MINIMUM:Number = 0;\n\t\tprivate static const MAXIMUM:Number = 100;\n\t\tprivate static const STEP:Number = 1;\n\t\tprivate static const PAGE:Number = 10;\n\t\t\n\t\tprivate var _scrollBar:SimpleScrollBar;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._scrollBar = new SimpleScrollBar();\n\t\t\tTestFeathers.starlingRoot.addChild(this._scrollBar);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._scrollBar.removeFromParent(true);\n\t\t\tthis._scrollBar = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeHorizontal():void\n\t\t{\n\t\t\tthis._scrollBar.direction = Direction.HORIZONTAL;\n\t\t\tthis._scrollBar.minimum = MINIMUM;\n\t\t\tthis._scrollBar.maximum = MAXIMUM;\n\t\t\tthis._scrollBar.step = STEP;\n\t\t\tthis._scrollBar.page = PAGE;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(HORIZONTAL_THUMB_WIDTH, HORIZONTAL_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the horizontal SimpleScrollBar was not calculated correctly.\",\n\t\t\t\tHORIZONTAL_THUMB_WIDTH * (MAXIMUM - MINIMUM) / PAGE, this._scrollBar.width);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the horizontal SimpleScrollBar was not calculated correctly.\",\n\t\t\t\tHORIZONTAL_THUMB_WIDTH * (MAXIMUM - MINIMUM) / PAGE, this._scrollBar.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the horizontal SimpleScrollBar was not calculated correctly.\",\n\t\t\t\tHORIZONTAL_THUMB_HEIGHT, this._scrollBar.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the horizontal SimpleScrollBar was not calculated correctly.\",\n\t\t\t\tHORIZONTAL_THUMB_HEIGHT, this._scrollBar.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeVertical():void\n\t\t{\n\t\t\tthis._scrollBar.direction = Direction.VERTICAL;\n\t\t\tthis._scrollBar.minimum = MINIMUM;\n\t\t\tthis._scrollBar.maximum = MAXIMUM;\n\t\t\tthis._scrollBar.step = STEP;\n\t\t\tthis._scrollBar.page = PAGE;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(VERTICAL_THUMB_WIDTH, VERTICAL_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the vertical SimpleScrollBar was not calculated correctly.\",\n\t\t\t\tVERTICAL_THUMB_WIDTH, this._scrollBar.width);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the vertical SimpleScrollBar was not calculated correctly.\",\n\t\t\t\tVERTICAL_THUMB_WIDTH, this._scrollBar.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the horizontal SimpleScrollBar was not calculated correctly.\",\n\t\t\t\tVERTICAL_THUMB_HEIGHT * (MAXIMUM - MINIMUM) / PAGE, this._scrollBar.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the horizontal SimpleScrollBar was not calculated correctly.\",\n\t\t\t\tVERTICAL_THUMB_HEIGHT * (MAXIMUM - MINIMUM) / PAGE, this._scrollBar.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeHorizontalWithMinDimensions():void\n\t\t{\n\t\t\tthis._scrollBar.direction = Direction.HORIZONTAL;\n\t\t\tthis._scrollBar.minimum = MINIMUM;\n\t\t\tthis._scrollBar.maximum = MAXIMUM;\n\t\t\tthis._scrollBar.step = STEP;\n\t\t\tthis._scrollBar.page = PAGE;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(HORIZONTAL_THUMB_WIDTH, HORIZONTAL_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\tthumb.minWidth = HORIZONTAL_THUMB_MIN_WIDTH;\n\t\t\t\tthumb.minHeight = HORIZONTAL_THUMB_MIN_HEIGHT;\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the horizontal SimpleScrollBar was not calculated correctly when thumb has minWidth.\",\n\t\t\t\tHORIZONTAL_THUMB_MIN_WIDTH * (MAXIMUM - MINIMUM) / PAGE, this._scrollBar.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the horizontal SimpleScrollBar was not calculated correctly when thumb has minHeight.\",\n\t\t\t\tHORIZONTAL_THUMB_MIN_HEIGHT, this._scrollBar.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeVerticalWithMinDimensions():void\n\t\t{\n\t\t\tthis._scrollBar.direction = Direction.VERTICAL;\n\t\t\tthis._scrollBar.minimum = MINIMUM;\n\t\t\tthis._scrollBar.maximum = MAXIMUM;\n\t\t\tthis._scrollBar.step = STEP;\n\t\t\tthis._scrollBar.page = PAGE;\n\t\t\tthis._scrollBar.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(VERTICAL_THUMB_WIDTH, VERTICAL_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\tthumb.minWidth = VERTICAL_THUMB_MIN_WIDTH;\n\t\t\t\tthumb.minHeight = VERTICAL_THUMB_MIN_HEIGHT;\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._scrollBar.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the vertical SimpleScrollBar was not calculated correctly when thumb has minWidth.\",\n\t\t\t\tVERTICAL_THUMB_MIN_WIDTH, this._scrollBar.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the horizontal SimpleScrollBar was not calculated correctly when thumb has minHeight.\",\n\t\t\t\tVERTICAL_THUMB_MIN_HEIGHT * (MAXIMUM - MINIMUM) / PAGE, this._scrollBar.minHeight);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/SlideShowLayoutTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Label;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.layout.LayoutBoundsResult;\n\timport feathers.layout.SlideShowLayout;\n\timport feathers.layout.ViewPortBounds;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport flash.geom.Point;\n\timport feathers.layout.Direction;\n\n\tpublic class SlideShowLayoutTests\n\t{\n\t\tprivate static const PADDING_TOP:Number = 6;\n\t\tprivate static const PADDING_RIGHT:Number = 8;\n\t\tprivate static const PADDING_BOTTOM:Number = 2;\n\t\tprivate static const PADDING_LEFT:Number = 10;\n\t\tprivate static const CHILD1_WIDTH:Number = 200;\n\t\tprivate static const CHILD1_HEIGHT:Number = 100;\n\t\tprivate static const CHILD2_WIDTH:Number = 150;\n\t\tprivate static const CHILD2_HEIGHT:Number = 75;\n\t\tprivate static const CHILD3_WIDTH:Number = 75;\n\t\tprivate static const CHILD3_HEIGHT:Number = 50;\n\t\tprivate static const CHILD4_WIDTH:Number = 10;\n\t\tprivate static const CHILD4_HEIGHT:Number = 20;\n\n\t\tprivate var _layout:SlideShowLayout;\n\t\tprivate var _child1:DisplayObject;\n\t\tprivate var _child2:DisplayObject;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._layout = new SlideShowLayout();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._layout = null;\n\t\t\tif(this._child1 !== null)\n\t\t\t{\n\t\t\t\tthis._child1.dispose();\n\t\t\t\tthis._child1 = null;\n\t\t\t}\n\t\t\tif(this._child2 !== null)\n\t\t\t{\n\t\t\t\tthis._child2.dispose();\n\t\t\t\tthis._child2 = null;\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithNoItems():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = false;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(new <DisplayObject>[]);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: viewPortWidth not equal to 0 with no children.\",\n\t\t\t\t0, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: viewPortHeight not equal to 0 with no children.\",\n\t\t\t\t0, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: contentWidth not equal to 0 with no children.\",\n\t\t\t\t0, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: contentHeight not equal to 0 with no children.\",\n\t\t\t\t0, result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithNoItems():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(0, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: measureViewPort x not equal to 0 with no children.\",\n\t\t\t\t0, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: measureViewPort y not equal to 0 with no children.\",\n\t\t\t\t0, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithPaddingAndNoChildren():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = false;\n\t\t\tthis._layout.paddingTop = PADDING_TOP;\n\t\t\tthis._layout.paddingRight = PADDING_RIGHT;\n\t\t\tthis._layout.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._layout.paddingLeft = PADDING_LEFT;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(new <DisplayObject>[]);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: viewPortWidth not equal to sum of left and right padding with no children.\",\n\t\t\t\tPADDING_LEFT + PADDING_RIGHT, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: viewPortHeight not equal to sum of top and bottom padding with no children.\",\n\t\t\t\tPADDING_TOP + PADDING_BOTTOM, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: contentWidth not equal to sum of left and right padding with no children.\",\n\t\t\t\tPADDING_LEFT + PADDING_RIGHT, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: contentHeight not equal to sum of top and bottom padding with no children.\",\n\t\t\t\tPADDING_TOP + PADDING_BOTTOM, result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithPaddingAndNoChildren():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.paddingTop = PADDING_TOP;\n\t\t\tthis._layout.paddingRight = PADDING_RIGHT;\n\t\t\tthis._layout.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._layout.paddingLeft = PADDING_LEFT;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(0, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: measureViewPort x not equal to sum of left and right padding with no children.\",\n\t\t\t\tPADDING_LEFT + PADDING_RIGHT, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: measureViewPort y not equal to sum of top and bottom padding with no children.\",\n\t\t\t\tPADDING_TOP + PADDING_BOTTOM, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithOneChild():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = false;\n\t\t\tthis._child1 = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(new <DisplayObject>[this._child1]);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: viewPortWidth not equal to child width.\",\n\t\t\t\tCHILD1_WIDTH, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: viewPortHeight not equal to child height.\",\n\t\t\t\tCHILD1_HEIGHT, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: contentWidth not equal to child width.\",\n\t\t\t\tCHILD1_WIDTH, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: contentHeight not equal to child height.\",\n\t\t\t\tCHILD1_HEIGHT, result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithOneChild():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._child1 = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.typicalItem = this._child1;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: measureViewPort x not equal to child width.\",\n\t\t\t\tCHILD1_WIDTH, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: measureViewPort y not equal to child height.\",\n\t\t\t\tCHILD1_HEIGHT, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithPaddingAndOneChild():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = false;\n\t\t\tthis._layout.paddingTop = PADDING_TOP;\n\t\t\tthis._layout.paddingRight = PADDING_RIGHT;\n\t\t\tthis._layout.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._layout.paddingLeft = PADDING_LEFT;\n\t\t\tthis._child1 = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[this._child1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: viewPortWidth not equal to child width plus left and right padding.\",\n\t\t\t\tCHILD1_WIDTH + PADDING_LEFT + PADDING_RIGHT, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: viewPortHeight not equal to child height plus top and bottom padding.\",\n\t\t\t\tCHILD1_HEIGHT + PADDING_TOP + PADDING_BOTTOM, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: contentWidth not equal to child width plus left and right padding.\",\n\t\t\t\tCHILD1_WIDTH + PADDING_LEFT + PADDING_RIGHT, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: contentHeight not equal to child height plus top and bottom padding.\",\n\t\t\t\tCHILD1_HEIGHT + PADDING_TOP + PADDING_BOTTOM, result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithPaddingAndOneChild():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.paddingTop = PADDING_TOP;\n\t\t\tthis._layout.paddingRight = PADDING_RIGHT;\n\t\t\tthis._layout.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._layout.paddingLeft = PADDING_LEFT;\n\t\t\tthis._child1 = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.typicalItem = this._child1;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: measureViewPort x not equal to child width plus left and right padding.\",\n\t\t\t\tCHILD1_WIDTH + PADDING_LEFT + PADDING_RIGHT, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: measureViewPort y not equal to child height plus top and bottom padding.\",\n\t\t\t\tCHILD1_HEIGHT + PADDING_TOP + PADDING_BOTTOM, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithTwoChildrenPositionedHorizontally():void\n\t\t{\n\t\t\tthis._layout.direction = Direction.HORIZONTAL;\n\t\t\tthis._layout.useVirtualLayout = false;\n\t\t\tthis._child1 = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._child2 = new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[this._child1, this._child2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: viewPortWidth not equal to max child width.\",\n\t\t\t\tMath.max(CHILD1_WIDTH, CHILD2_WIDTH), result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: viewPortHeight not equal to max child height.\",\n\t\t\t\tMath.max(CHILD1_HEIGHT, CHILD2_HEIGHT), result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: contentWidth not equal to max child width multiplied by number of items.\",\n\t\t\t\t2 * Math.max(CHILD1_WIDTH, CHILD2_WIDTH), result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: contentHeight not equal to max child height.\",\n\t\t\t\tMath.max(CHILD1_HEIGHT, CHILD2_HEIGHT), result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithTwoChildrenPositionedVertically():void\n\t\t{\n\t\t\tthis._layout.direction = Direction.VERTICAL;\n\t\t\tthis._layout.useVirtualLayout = false;\n\t\t\tthis._child1 = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._child2 = new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[this._child1, this._child2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: viewPortWidth not equal to max child width.\",\n\t\t\t\tMath.max(CHILD1_WIDTH, CHILD2_WIDTH), result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: viewPortHeight not equal to max child height.\",\n\t\t\t\tMath.max(CHILD1_HEIGHT, CHILD2_HEIGHT), result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: contentWidth not equal to max child width.\",\n\t\t\t\tMath.max(CHILD1_WIDTH, CHILD2_WIDTH), result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: contentHeight not equal to max child height multiplied by number of items.\",\n\t\t\t\t2 * Math.max(CHILD1_HEIGHT, CHILD2_HEIGHT), result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithTwoChildrenPositionedHorizontally():void\n\t\t{\n\t\t\tthis._layout.direction = Direction.HORIZONTAL;\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._child1 = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.typicalItem = this._child1;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(2, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: viewPortWidth not equal to max child width.\",\n\t\t\t\tMath.max(CHILD1_WIDTH, CHILD2_WIDTH), result.x);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: viewPortHeight not equal to max child height.\",\n\t\t\t\tMath.max(CHILD1_HEIGHT, CHILD2_HEIGHT), result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithTwoChildrenPositionedVertically():void\n\t\t{\n\t\t\tthis._layout.direction = Direction.VERTICAL;\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._child1 = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.typicalItem = this._child1;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(2, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: measureViewPort x not equal to max child width.\",\n\t\t\t\tMath.max(CHILD1_WIDTH, CHILD2_WIDTH), result.x);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: measureViewPort y not equal to max child height.\",\n\t\t\t\tMath.max(CHILD1_HEIGHT, CHILD2_HEIGHT), result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithExplicitWidthSmallerThanChild():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = false;\n\t\t\tthis._child1 = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[this._child1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = CHILD1_WIDTH / 3;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: viewPortWidth not equal to explicitWidth when explicitWidth is smaller than item width.\",\n\t\t\t\tbounds.explicitWidth, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: contentWidth not equal to explicitWidth when explicitWidth is smaller than item width.\",\n\t\t\t\tbounds.explicitWidth, result.contentWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithExplicitWidthSmallerThanChild():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._child1 = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.typicalItem = this._child1;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = CHILD1_WIDTH / 3;\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: measureViewPort x not equal to explicitWidth when explicitWidth is smaller than item width.\",\n\t\t\t\tbounds.explicitWidth, result.x);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithExplicitWidthLargerThanChild():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = false;\n\t\t\tthis._child1 = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[this._child1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 3 * CHILD1_WIDTH;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: viewPortWidth not equal to explicitWidth when explicitWidth is larger than item width.\",\n\t\t\t\tbounds.explicitWidth, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: contentWidth not equal to explicitWidth when explicitWidth is larger than item width.\",\n\t\t\t\tbounds.explicitWidth, result.contentWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithExplicitWidthLargerThanChild():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._child1 = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.typicalItem = this._child1;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 3 * CHILD1_WIDTH;\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: measureViewPort x not equal to explicitWidth when explicitWidth is larger than item width.\",\n\t\t\t\tbounds.explicitWidth, result.x);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithMaxWidthSmallerThanChild():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = false;\n\t\t\tthis._child1 = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[this._child1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.maxWidth = CHILD1_WIDTH / 3;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: viewPortWidth not equal to maxWidth when maxWidth is smaller than item width.\",\n\t\t\t\tbounds.maxWidth, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: contentWidth not equal to maxWidth when maxWidth is smaller than item width.\",\n\t\t\t\tbounds.maxWidth, result.contentWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithMaxWidthSmallerThanChild():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._child1 = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.typicalItem = this._child1;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.maxWidth = CHILD1_WIDTH / 3;\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: measureViewPort x not equal to maxWidth when maxWidth is smaller than item width.\",\n\t\t\t\tbounds.maxWidth, result.x);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithMinWidthLargerThanChild():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = false;\n\t\t\tthis._child1 = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[this._child1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.minWidth = 3 * CHILD1_WIDTH;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: viewPortWidth not equal to minWidth when minWidth is larger than item width.\",\n\t\t\t\tbounds.minWidth, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: contentWidth not equal to minWidth when minWidth is larger than item width.\",\n\t\t\t\tbounds.minWidth, result.contentWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithMinWidthLargerThanChild():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._child1 = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.typicalItem = this._child1;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.minWidth = 3 * CHILD1_WIDTH;\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: measureViewPort x not equal to minWidth when minWidth is larger than item width.\",\n\t\t\t\tbounds.minWidth, result.x);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithMaxWidthLargerThanChild():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = false;\n\t\t\tthis._child1 = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[this._child1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\t//needs to be enough to require more than one tile\n\t\t\tbounds.maxWidth = 3 * CHILD1_WIDTH;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: viewPortWidth not equal to item width when maxWidth is larger than item width.\",\n\t\t\t\tCHILD1_WIDTH, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: contentWidth not equal to item width when maxWidth is larger than item width.\",\n\t\t\t\tCHILD1_WIDTH, result.contentWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithMaxWidthLargerThanChild():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._child1 = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.typicalItem = this._child1;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\t//needs to be enough to require more than one tile\n\t\t\tbounds.maxWidth = 3 * CHILD1_WIDTH;\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: measureViewPort x not equal to item width when maxWidth is larger than item width.\",\n\t\t\t\tCHILD1_WIDTH, result.x);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithExplicitHeightSmallerThanChild():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = false;\n\t\t\tthis._child1 = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[this._child1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitHeight = CHILD1_HEIGHT / 3;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: viewPortHeight not equal to explicitHeight when explicitHeight is smaller than item height.\",\n\t\t\t\tbounds.explicitHeight, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: contentHeight not equal to explicitHeight when explicitHeight is smaller than item height.\",\n\t\t\t\tbounds.explicitHeight, result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithExplicitHeightSmallerThanChild():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._child1 = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.typicalItem = this._child1;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitHeight = CHILD1_HEIGHT / 3;\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: measureViewPort y not equal to explicitHeight when explicitHeight is smaller than item height.\",\n\t\t\t\tbounds.explicitHeight, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithExplicitHeightLargerThanChild():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = false;\n\t\t\tthis._child1 = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[this._child1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitHeight = 3 * CHILD1_HEIGHT;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: viewPortHeight not equal to explicitHeight when explicitHeight is larger than item height.\",\n\t\t\t\tbounds.explicitHeight, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: contentHeight not equal to explicitHeight when explicitHeight is larger than item height.\",\n\t\t\t\tbounds.explicitHeight, result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithExplicitHeightLargerThanChild():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._child1 = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.typicalItem = this._child1;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitHeight = 3 * CHILD1_HEIGHT;\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: measureViewPort y not equal to explicitHeight when explicitHeight is larger than item height.\",\n\t\t\t\tbounds.explicitHeight, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithMaxHeightSmallerThanChild():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = false;\n\t\t\tthis._child1 = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[this._child1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.maxHeight = CHILD1_HEIGHT / 3;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: viewPortHeight not equal to maxHeight when maxHeight is smaller than item height.\",\n\t\t\t\tbounds.maxHeight, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: contentHeight not equal to maxHeight when maxHeight is smaller than item height.\",\n\t\t\t\tbounds.maxHeight, result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithMaxHeightSmallerThanChild():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._child1 = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.typicalItem = this._child1;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.maxHeight = CHILD1_HEIGHT / 3;\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: measureViewPort y not equal to maxHeight when maxHeight is smaller than item height.\",\n\t\t\t\tbounds.maxHeight, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithMinHeightLargerThanChild():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = false;\n\t\t\tthis._child1 = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[this._child1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.minHeight = 3 * CHILD1_HEIGHT;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: viewPortHeight not equal to minHeight when minHeight is larger than item height.\",\n\t\t\t\tbounds.minHeight, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: contentHeight not equal to minHeight when minHeight is larger than item height.\",\n\t\t\t\tbounds.minHeight, result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithMinHeightLargerThanChild():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._child1 = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.typicalItem = this._child1;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.minHeight = 3 * CHILD1_HEIGHT;\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: measureViewPort y not equal to minHeight when minHeight is larger than item height.\",\n\t\t\t\tbounds.minHeight, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithMaxHeightLargerThanChild():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = false;\n\t\t\tthis._child1 = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[this._child1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\t//needs to be enough to require more than one tile\n\t\t\tbounds.maxHeight = 3 * CHILD1_HEIGHT;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: viewPortHeight not equal to item height when maxHeight is larger than item height.\",\n\t\t\t\tCHILD1_HEIGHT, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: contentHeight not equal to item height when maxHeight is larger than item height.\",\n\t\t\t\tCHILD1_HEIGHT, result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithMaxHeightLargerThanChild():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._child1 = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.typicalItem = this._child1;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\t//needs to be enough to require more than one tile\n\t\t\tbounds.maxHeight = 3 * CHILD1_HEIGHT;\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"SlideShowLayout: measureViewPort y not equal to item height when maxHeight is larger than item height.\",\n\t\t\t\tCHILD1_HEIGHT, result.y);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/SliderHorizontalMeasurementTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.BasicButton;\n\timport feathers.controls.Slider;\n\timport feathers.controls.TrackLayoutMode;\n\timport feathers.layout.Direction;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class SliderHorizontalMeasurementTests\n\t{\n\t\tprivate static const SINGLE_TRACK_WIDTH:Number = 200;\n\t\tprivate static const SINGLE_TRACK_HEIGHT:Number = 50;\n\t\tprivate static const SINGLE_TRACK_MIN_WIDTH:Number = 150;\n\t\tprivate static const SINGLE_TRACK_MIN_HEIGHT:Number = 30;\n\n\t\tprivate static const MINIMUM_TRACK_WIDTH:Number = 100;\n\t\tprivate static const MINIMUM_TRACK_HEIGHT:Number = 50;\n\t\tprivate static const MINIMUM_TRACK_MIN_WIDTH:Number = 80;\n\t\tprivate static const MINIMUM_TRACK_MIN_HEIGHT:Number = 20;\n\n\t\tprivate static const MAXIMUM_TRACK_WIDTH:Number = 110;\n\t\tprivate static const MAXIMUM_TRACK_HEIGHT:Number = 55;\n\t\tprivate static const MAXIMUM_TRACK_MIN_WIDTH:Number = 90;\n\t\tprivate static const MAXIMUM_TRACK_MIN_HEIGHT:Number = 25;\n\n\t\tprivate static const THUMB_WIDTH:Number = 30;\n\t\tprivate static const SMALL_THUMB_HEIGHT:Number = 40;\n\t\tprivate static const LARGE_THUMB_HEIGHT:Number = 60;\n\n\t\tprivate static const THUMB_MIN_WIDTH:Number = 18;\n\t\tprivate static const SMALL_THUMB_MIN_HEIGHT:Number = 20;\n\t\tprivate static const LARGE_THUMB_MIN_HEIGHT:Number = 40;\n\n\t\tprivate var _slider:Slider;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._slider = new Slider();\n\t\t\tthis._slider.direction = Direction.HORIZONTAL;\n\t\t\tTestFeathers.starlingRoot.addChild(this._slider);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._slider.removeFromParent(true);\n\t\t\tthis._slider = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithTrackLayoutModeSingle():void\n\t\t{\n\t\t\tthis._slider.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._slider.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, SMALL_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._slider.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SINGLE_TRACK_WIDTH, SINGLE_TRACK_HEIGHT, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._slider.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the horizontal Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE.\",\n\t\t\t\tSINGLE_TRACK_WIDTH, this._slider.width);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the horizontal Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE.\",\n\t\t\t\tSINGLE_TRACK_WIDTH, this._slider.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the horizontal Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE.\",\n\t\t\t\tSINGLE_TRACK_HEIGHT, this._slider.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the horizontal Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE.\",\n\t\t\t\tSINGLE_TRACK_HEIGHT, this._slider.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeHeightWithTrackLayoutModeSingleAndLargerThumb():void\n\t\t{\n\t\t\tthis._slider.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._slider.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, LARGE_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._slider.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SINGLE_TRACK_WIDTH, SINGLE_TRACK_HEIGHT, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._slider.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The height of the horizontal Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and larger thumb.\",\n\t\t\t\tLARGE_THUMB_HEIGHT, this._slider.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the horizontal Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and larger thumb.\",\n\t\t\t\tLARGE_THUMB_HEIGHT, this._slider.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithTrackLayoutModeSingleAndMinDimensions():void\n\t\t{\n\t\t\tthis._slider.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._slider.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, SMALL_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\tthumb.minWidth = THUMB_MIN_WIDTH;\n\t\t\t\tthumb.minHeight = SMALL_THUMB_MIN_HEIGHT;\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._slider.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SINGLE_TRACK_WIDTH, SINGLE_TRACK_HEIGHT, 0xffff00);\n\t\t\t\tbutton.minWidth = SINGLE_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = SINGLE_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._slider.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the horizontal Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and the track's minWidth is set.\",\n\t\t\t\tSINGLE_TRACK_MIN_WIDTH, this._slider.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the horizontal Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and the track's minHeight is set.\",\n\t\t\t\tSINGLE_TRACK_MIN_HEIGHT, this._slider.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeMinHeightWithTrackLayoutModeSingleAndLargerThumb():void\n\t\t{\n\t\t\tthis._slider.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._slider.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, LARGE_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\tthumb.minWidth = THUMB_MIN_WIDTH;\n\t\t\t\tthumb.minHeight = LARGE_THUMB_MIN_HEIGHT;\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._slider.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SINGLE_TRACK_WIDTH, SINGLE_TRACK_HEIGHT, 0xffff00);\n\t\t\t\tbutton.minWidth = SINGLE_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = SINGLE_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._slider.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the horizontal Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and larger thumb minHeight.\",\n\t\t\t\tLARGE_THUMB_MIN_HEIGHT, this._slider.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithTrackLayoutModeSplit():void\n\t\t{\n\t\t\tthis._slider.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tthis._slider.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, SMALL_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._slider.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MINIMUM_TRACK_WIDTH, MINIMUM_TRACK_HEIGHT, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._slider.maximumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MAXIMUM_TRACK_WIDTH, MAXIMUM_TRACK_HEIGHT, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._slider.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the horizontal Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT.\",\n\t\t\t\tMAXIMUM_TRACK_WIDTH + THUMB_WIDTH / 2, this._slider.width);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the horizontal Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT.\",\n\t\t\t\tMAXIMUM_TRACK_WIDTH + THUMB_WIDTH / 2, this._slider.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the horizontal Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT.\",\n\t\t\t\tMAXIMUM_TRACK_HEIGHT, this._slider.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the horizontal Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT.\",\n\t\t\t\tMAXIMUM_TRACK_HEIGHT, this._slider.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeHeightWithTrackLayoutModeSplitAndLargerThumb():void\n\t\t{\n\t\t\tthis._slider.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tthis._slider.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, LARGE_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._slider.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MINIMUM_TRACK_WIDTH, MINIMUM_TRACK_HEIGHT, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._slider.maximumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MAXIMUM_TRACK_WIDTH, MAXIMUM_TRACK_HEIGHT, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._slider.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The height of the horizontal Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT and larger thumb.\",\n\t\t\t\tLARGE_THUMB_HEIGHT, this._slider.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the horizontal Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT and larger thumb.\",\n\t\t\t\tLARGE_THUMB_HEIGHT, this._slider.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithTrackLayoutModeSplitAndMinDimensions():void\n\t\t{\n\t\t\tthis._slider.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tthis._slider.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, SMALL_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\tthumb.minWidth = THUMB_MIN_WIDTH;\n\t\t\t\tthumb.minHeight = SMALL_THUMB_MIN_HEIGHT;\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._slider.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MINIMUM_TRACK_WIDTH, MINIMUM_TRACK_HEIGHT, 0xffff00);\n\t\t\t\tbutton.minWidth = MINIMUM_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = MINIMUM_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._slider.maximumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MAXIMUM_TRACK_WIDTH, MAXIMUM_TRACK_HEIGHT, 0x00ffff);\n\t\t\t\tbutton.minWidth = MAXIMUM_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = MAXIMUM_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._slider.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the horizontal Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT when the track's minWidth is set.\",\n\t\t\t\tMAXIMUM_TRACK_MIN_WIDTH + THUMB_MIN_WIDTH / 2, this._slider.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the horizontal Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT when the track's minHeight is set.\",\n\t\t\t\tMAXIMUM_TRACK_MIN_HEIGHT, this._slider.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeMinHeightWithTrackLayoutModeSplitAndLargerThumb():void\n\t\t{\n\t\t\tthis._slider.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tthis._slider.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, LARGE_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\tthumb.minWidth = THUMB_MIN_WIDTH;\n\t\t\t\tthumb.minHeight = LARGE_THUMB_MIN_HEIGHT;\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._slider.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MINIMUM_TRACK_WIDTH, MINIMUM_TRACK_HEIGHT, 0xffff00);\n\t\t\t\tbutton.minWidth = MINIMUM_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = MINIMUM_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._slider.maximumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MAXIMUM_TRACK_WIDTH, MAXIMUM_TRACK_HEIGHT, 0x00ffff);\n\t\t\t\tbutton.minWidth = MAXIMUM_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = MAXIMUM_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._slider.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the horizontal Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT and larger thumb minHeight.\",\n\t\t\t\tLARGE_THUMB_MIN_HEIGHT, this._slider.minHeight);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/SliderHorizontalTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.Slider;\n\timport feathers.controls.TrackInteractionMode;\n\timport feathers.controls.TrackLayoutMode;\n\timport feathers.layout.Direction;\n\n\timport flash.geom.Point;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\tpublic class SliderHorizontalTests\n\t{\n\t\tprivate static const THUMB_NAME:String = \"thumb\";\n\t\tprivate static const TRACK_NAME:String = \"track\";\n\t\tprivate static const TRACK_WIDTH:Number = 200;\n\t\tprivate static const TRACK_HEIGHT:Number = 20;\n\t\tprivate static const THUMB_WIDTH:Number = 20;\n\t\tprivate static const THUMB_HEIGHT:Number = 20;\n\n\t\tprivate var _slider:Slider;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._slider = new Slider();\n\t\t\tthis._slider.direction = Direction.HORIZONTAL;\n\t\t\tthis._slider.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._slider.minimumTrackFactory = function():Button\n\t\t\t{\n\t\t\t\tvar track:Button = new Button();\n\t\t\t\ttrack.name = TRACK_NAME;\n\t\t\t\ttrack.defaultSkin = new Quad(TRACK_WIDTH, TRACK_HEIGHT);\n\t\t\t\treturn track;\n\t\t\t};\n\t\t\tthis._slider.thumbFactory = function():Button\n\t\t\t{\n\t\t\t\tvar thumb:Button = new Button();\n\t\t\t\tthumb.name = THUMB_NAME;\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, THUMB_HEIGHT);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tTestFeathers.starlingRoot.addChild(this._slider);\n\t\t\tthis._slider.validate();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._slider.removeFromParent(true);\n\t\t\tthis._slider = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetValueProgramaticallyWithMinimum():void\n\t\t{\n\t\t\tthis._slider.minimum = 5;\n\t\t\tthis._slider.maximum = 10;\n\t\t\tthis._slider.value = 2;\n\t\t\tAssert.assertEquals(\"Setting value smaller than minimum not changed to minimum.\", this._slider.minimum, this._slider.value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetValueProgramaticallyWithMaximum():void\n\t\t{\n\t\t\tthis._slider.minimum = 5;\n\t\t\tthis._slider.maximum = 10;\n\t\t\tthis._slider.value = 12;\n\t\t\tAssert.assertEquals(\"Setting value larger than maximum not changed to maximum.\", this._slider.maximum, this._slider.value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testProgrammaticSelectionChange():void\n\t\t{\n\t\t\tthis._slider.minimum = 0;\n\t\t\tthis._slider.maximum = 10;\n\t\t\tthis._slider.value = 5;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._slider.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._slider.value = 6;\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInteractiveSelectionChangeWithDraggingThumb():void\n\t\t{\n\t\t\tvar beforeValue:Number = 5;\n\t\t\tthis._slider.minimum = 0;\n\t\t\tthis._slider.maximum = 10;\n\t\t\tthis._slider.value = beforeValue;\n\t\t\t//validate to position the thumb correctly.\n\t\t\tthis._slider.validate();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._slider.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(TRACK_WIDTH / 2, THUMB_HEIGHT / 2);\n\t\t\tvar target:DisplayObject = this._slider.stage.hitTest(position);\n\n\t\t\tAssert.assertStrictlyEquals(\"The hit test did not return the slider's thumb\",\n\t\t\t\tthis._slider.getChildByName(THUMB_NAME).name, target.name);\n\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\ttouch.globalX = position.x + THUMB_WIDTH * 2;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"The value property was not changed to a greater value\",\n\t\t\t\tbeforeValue < this._slider.value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInteractiveSelectionChangeWithDraggingThumbBeyondRightEdgeOfTrack():void\n\t\t{\n\t\t\tvar beforeValue:Number = 5;\n\t\t\tthis._slider.minimum = 0;\n\t\t\tthis._slider.maximum = 10;\n\t\t\tthis._slider.value = beforeValue;\n\t\t\t//validate to position the thumb correctly.\n\t\t\tthis._slider.validate();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._slider.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(TRACK_WIDTH / 2, THUMB_HEIGHT / 2);\n\t\t\tvar target:DisplayObject = this._slider.stage.hitTest(position);\n\n\t\t\tAssert.assertStrictlyEquals(\"The hit test did not return the slider's thumb\",\n\t\t\t\tthis._slider.getChildByName(THUMB_NAME).name, target.name);\n\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\ttouch.globalX = position.x + TRACK_WIDTH;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The value property was not equal to the maximum value\",\n\t\t\t\tthis._slider.maximum, this._slider.value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInteractiveSelectionChangeWithDraggingThumbBeyondLeftEdgeOfTrack():void\n\t\t{\n\t\t\tvar beforeValue:Number = 5;\n\t\t\tthis._slider.minimum = 0;\n\t\t\tthis._slider.maximum = 10;\n\t\t\tthis._slider.value = beforeValue;\n\t\t\t//validate to position the thumb correctly.\n\t\t\tthis._slider.validate();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._slider.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(TRACK_WIDTH / 2, THUMB_HEIGHT / 2);\n\t\t\tvar target:DisplayObject = this._slider.stage.hitTest(position);\n\n\t\t\tAssert.assertStrictlyEquals(\"The hit test did not return the slider's thumb\",\n\t\t\t\tthis._slider.getChildByName(THUMB_NAME).name, target.name);\n\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\ttouch.globalX = position.x - TRACK_WIDTH;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The value property was not equal to the minimum value\",\n\t\t\t\tthis._slider.minimum, this._slider.value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInteractiveSelectionChangeWithTouchToLeftOfThumb():void\n\t\t{\n\t\t\tvar beforeValue:Number = 5;\n\t\t\tthis._slider.minimum = 0;\n\t\t\tthis._slider.maximum = 10;\n\t\t\tthis._slider.value = beforeValue;\n\t\t\tthis._slider.trackInteractionMode = TrackInteractionMode.TO_VALUE;\n\t\t\t//validate to position the thumb correctly.\n\t\t\tthis._slider.validate();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._slider.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(TRACK_WIDTH / 3, THUMB_HEIGHT / 2);\n\t\t\tvar target:DisplayObject = this._slider.stage.hitTest(position);\n\n\t\t\tAssert.assertStrictlyEquals(\"The hit test did not return the slider's thumb\",\n\t\t\t\tthis._slider.getChildByName(THUMB_NAME).name, target.name);\n\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"The value property was not less than the previous value\",\n\t\t\t\tbeforeValue > this._slider.value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInteractiveSelectionChangeWithTouchToRightOfThumb():void\n\t\t{\n\t\t\tvar beforeValue:Number = 5;\n\t\t\tthis._slider.minimum = 0;\n\t\t\tthis._slider.maximum = 10;\n\t\t\tthis._slider.value = beforeValue;\n\t\t\tthis._slider.trackInteractionMode = TrackInteractionMode.TO_VALUE;\n\t\t\t//validate to position the thumb correctly.\n\t\t\tthis._slider.validate();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._slider.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(2 * TRACK_WIDTH / 3, THUMB_HEIGHT / 2);\n\t\t\tvar target:DisplayObject = this._slider.stage.hitTest(position);\n\n\t\t\tAssert.assertStrictlyEquals(\"The hit test did not return the slider's thumb\",\n\t\t\t\tthis._slider.getChildByName(THUMB_NAME).name, target.name);\n\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"The value property was not greater than the previous value\",\n\t\t\t\tbeforeValue < this._slider.value);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/SliderVerticalMeasurementTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.BasicButton;\n\timport feathers.controls.Slider;\n\timport feathers.controls.TrackLayoutMode;\n\timport feathers.layout.Direction;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class SliderVerticalMeasurementTests\n\t{\n\t\tprivate static const SINGLE_TRACK_WIDTH:Number = 50;\n\t\tprivate static const SINGLE_TRACK_HEIGHT:Number = 200;\n\t\tprivate static const SINGLE_TRACK_MIN_WIDTH:Number = 30;\n\t\tprivate static const SINGLE_TRACK_MIN_HEIGHT:Number = 150;\n\n\t\tprivate static const MINIMUM_TRACK_WIDTH:Number = 50;\n\t\tprivate static const MINIMUM_TRACK_HEIGHT:Number = 100;\n\t\tprivate static const MINIMUM_TRACK_MIN_WIDTH:Number = 20;\n\t\tprivate static const MINIMUM_TRACK_MIN_HEIGHT:Number = 80;\n\n\t\tprivate static const MAXIMUM_TRACK_WIDTH:Number = 55;\n\t\tprivate static const MAXIMUM_TRACK_HEIGHT:Number = 110;\n\t\tprivate static const MAXIMUM_TRACK_MIN_WIDTH:Number = 25;\n\t\tprivate static const MAXIMUM_TRACK_MIN_HEIGHT:Number = 90;\n\n\t\tprivate static const SMALL_THUMB_WIDTH:Number = 40;\n\t\tprivate static const LARGE_THUMB_WIDTH:Number = 60;\n\t\tprivate static const THUMB_HEIGHT:Number = 30;\n\n\t\tprivate static const SMALL_THUMB_MIN_WIDTH:Number = 20;\n\t\tprivate static const LARGE_THUMB_MIN_WIDTH:Number = 40;\n\t\tprivate static const THUMB_MIN_HEIGHT:Number = 18;\n\n\t\tprivate var _slider:Slider;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._slider = new Slider();\n\t\t\tthis._slider.direction = Direction.VERTICAL;\n\t\t\tTestFeathers.starlingRoot.addChild(this._slider);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._slider.removeFromParent(true);\n\t\t\tthis._slider = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithTrackLayoutModeSingle():void\n\t\t{\n\t\t\tthis._slider.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._slider.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(SMALL_THUMB_WIDTH, THUMB_HEIGHT, 0xff00ff);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._slider.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SINGLE_TRACK_WIDTH, SINGLE_TRACK_HEIGHT, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._slider.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the vertical Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE.\",\n\t\t\t\tSINGLE_TRACK_WIDTH, this._slider.width);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the vertical Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE.\",\n\t\t\t\tSINGLE_TRACK_WIDTH, this._slider.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the vertical Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE.\",\n\t\t\t\tSINGLE_TRACK_HEIGHT, this._slider.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the vertical Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE.\",\n\t\t\t\tSINGLE_TRACK_HEIGHT, this._slider.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWidthWithTrackLayoutModeSingleAndLargerThumb():void\n\t\t{\n\t\t\tthis._slider.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._slider.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(LARGE_THUMB_WIDTH, THUMB_HEIGHT, 0xff00ff);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._slider.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SINGLE_TRACK_WIDTH, SINGLE_TRACK_HEIGHT, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._slider.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the vertical Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and larger thumb.\",\n\t\t\t\tLARGE_THUMB_WIDTH, this._slider.width);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the vertical Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and larger thumb.\",\n\t\t\t\tLARGE_THUMB_WIDTH, this._slider.minWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithTrackLayoutModeSingleAndMinDimensions():void\n\t\t{\n\t\t\tthis._slider.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._slider.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(SMALL_THUMB_WIDTH, THUMB_HEIGHT, 0xff00ff);\n\t\t\t\tthumb.minWidth = SMALL_THUMB_MIN_WIDTH;\n\t\t\t\tthumb.minHeight = THUMB_MIN_HEIGHT;\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._slider.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SINGLE_TRACK_WIDTH, SINGLE_TRACK_HEIGHT, 0xffff00);\n\t\t\t\tbutton.minWidth = SINGLE_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = SINGLE_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._slider.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the vertical Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and the track's minWidth is set.\",\n\t\t\t\tSINGLE_TRACK_MIN_WIDTH, this._slider.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the vertical Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and the track's minHeight is set.\",\n\t\t\t\tSINGLE_TRACK_MIN_HEIGHT, this._slider.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeMinWidthWithTrackLayoutModeSingleAndLargerThumb():void\n\t\t{\n\t\t\tthis._slider.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._slider.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(SMALL_THUMB_WIDTH, THUMB_HEIGHT, 0xff00ff);\n\t\t\t\tthumb.minWidth = LARGE_THUMB_MIN_WIDTH;\n\t\t\t\tthumb.minHeight = THUMB_MIN_HEIGHT;\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._slider.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SINGLE_TRACK_WIDTH, SINGLE_TRACK_HEIGHT, 0xffff00);\n\t\t\t\tbutton.minWidth = SINGLE_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = SINGLE_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._slider.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the vertical Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and larger thumb minHeight.\",\n\t\t\t\tLARGE_THUMB_MIN_WIDTH, this._slider.minWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithTrackLayoutModeSplit():void\n\t\t{\n\t\t\tthis._slider.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tthis._slider.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(SMALL_THUMB_WIDTH, THUMB_HEIGHT, 0xff00ff);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._slider.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MINIMUM_TRACK_WIDTH, MINIMUM_TRACK_HEIGHT, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._slider.maximumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MAXIMUM_TRACK_WIDTH, MAXIMUM_TRACK_HEIGHT, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._slider.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the vertical Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT.\",\n\t\t\t\tMAXIMUM_TRACK_WIDTH, this._slider.width);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the vertical Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT.\",\n\t\t\t\tMAXIMUM_TRACK_WIDTH, this._slider.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the vertical Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT.\",\n\t\t\t\tMAXIMUM_TRACK_HEIGHT + THUMB_HEIGHT / 2, this._slider.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the vertical Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT.\",\n\t\t\t\tMAXIMUM_TRACK_HEIGHT + THUMB_HEIGHT / 2, this._slider.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWidthWithTrackLayoutModeSplitAndLargerThumb():void\n\t\t{\n\t\t\tthis._slider.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tthis._slider.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(LARGE_THUMB_WIDTH, THUMB_HEIGHT, 0xff00ff);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._slider.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MINIMUM_TRACK_WIDTH, MINIMUM_TRACK_HEIGHT, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._slider.maximumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MAXIMUM_TRACK_WIDTH, MAXIMUM_TRACK_HEIGHT, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._slider.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the vertical Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT and larger thumb.\",\n\t\t\t\tLARGE_THUMB_WIDTH, this._slider.width);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the vertical Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT and larger thumb.\",\n\t\t\t\tLARGE_THUMB_WIDTH, this._slider.minWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithTrackLayoutModeSplitAndMinDimensions():void\n\t\t{\n\t\t\tthis._slider.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tthis._slider.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(SMALL_THUMB_WIDTH, THUMB_HEIGHT, 0xff00ff);\n\t\t\t\tthumb.minWidth = SMALL_THUMB_MIN_WIDTH;\n\t\t\t\tthumb.minHeight = THUMB_MIN_HEIGHT;\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._slider.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MINIMUM_TRACK_WIDTH, MINIMUM_TRACK_HEIGHT, 0xffff00);\n\t\t\t\tbutton.minWidth = MINIMUM_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = MINIMUM_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._slider.maximumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MAXIMUM_TRACK_WIDTH, MAXIMUM_TRACK_HEIGHT, 0x00ffff);\n\t\t\t\tbutton.minWidth = MAXIMUM_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = MAXIMUM_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._slider.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the vertical Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT when the track's minWidth is set.\",\n\t\t\t\tMAXIMUM_TRACK_MIN_WIDTH, this._slider.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the vertical Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT when the track's minHeight is set.\",\n\t\t\t\tMAXIMUM_TRACK_MIN_HEIGHT + THUMB_MIN_HEIGHT / 2, this._slider.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeMinWidthtWithTrackLayoutModeSplitAndLargerThumb():void\n\t\t{\n\t\t\tthis._slider.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tthis._slider.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(LARGE_THUMB_WIDTH, THUMB_HEIGHT, 0xff00ff);\n\t\t\t\tthumb.minWidth = LARGE_THUMB_MIN_WIDTH;\n\t\t\t\tthumb.minHeight = THUMB_MIN_HEIGHT;\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._slider.minimumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MINIMUM_TRACK_WIDTH, MINIMUM_TRACK_HEIGHT, 0xffff00);\n\t\t\t\tbutton.minWidth = MINIMUM_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = MINIMUM_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._slider.maximumTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(MAXIMUM_TRACK_WIDTH, MAXIMUM_TRACK_HEIGHT, 0x00ffff);\n\t\t\t\tbutton.minWidth = MAXIMUM_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = MAXIMUM_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._slider.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the vertical Slider was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT and larger thumb minHeight.\",\n\t\t\t\tLARGE_THUMB_MIN_WIDTH, this._slider.minWidth);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/SpinnerListTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.SpinnerList;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.data.ListCollection;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class SpinnerListTests\n\t{\n\t\tprivate var _list:SpinnerList;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._list = new SpinnerList();\n\t\t\tthis._list.itemRendererFactory = function():DefaultListItemRenderer\n\t\t\t{\n\t\t\t\tvar itemRenderer:DefaultListItemRenderer = new DefaultListItemRenderer();\n\t\t\t\titemRenderer.defaultSkin = new Quad(200, 200);\n\t\t\t\treturn itemRenderer;\n\t\t\t};\n\t\t\tthis._list.selectionOverlaySkin = new Quad(200, 200);\n\t\t\tthis._list.height = 200;\n\t\t\tTestFeathers.starlingRoot.addChild(this._list);\n\t\t\tthis._list.validate();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._list.removeFromParent(true);\n\t\t\tthis._list = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\tprivate function setDataProvider():void\n\t\t{\n\t\t\tthis._list.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{ label: \"One\" },\n\t\t\t\t{ label: \"Two\" },\n\t\t\t\t{ label: \"Three\" },\n\t\t\t\t{ label: \"Four\" },\n\t\t\t\t{ label: \"Five\" },\n\t\t\t]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDefaultSelectionWithoutDataProvider():void\n\t\t{\n\t\t\tAssert.assertStrictlyEquals(\"SpinnerList selectedIndex must default to 0 when no data provider is available\", -1, this._list.selectedIndex);\n\t\t\tAssert.assertNull(\"SpinnerList selectedItem must default to null when no data provider is available\", this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDefaultSelectionWithDataProvider():void\n\t\t{\n\t\t\tthis.setDataProvider();\n\t\t\tAssert.assertStrictlyEquals(\"SpinnerList selectedIndex must default to 0 with a data provider\", 0, this._list.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"SpinnerList selectedItem must default to the item at index 0\", this._list.dataProvider.getItemAt(0), this._list.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetSelectedIndexToNegativeOneWithDataProvider():void\n\t\t{\n\t\t\tvar index:int = 2;\n\t\t\tthis.setDataProvider();\n\t\t\tthis._list.selectedIndex = index;\n\t\t\tthis._list.selectedIndex = -1;\n\t\t\tAssert.assertStrictlyEquals(\"SpinnerList selectedIndex cannot be changed to -1 with a non-empty data provider\", index, this._list.selectedIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetSelectedItemToNonItemWithDataProvider():void\n\t\t{\n\t\t\tvar index:int = 2;\n\t\t\tthis.setDataProvider();\n\t\t\tthis._list.selectedIndex = index;\n\t\t\tthis._list.selectedItem = {};\n\t\t\tAssert.assertStrictlyEquals(\"SpinnerList selectedItem cannot be changed to non-item with a non-empty data provider\", index, this._list.selectedIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetSelectedIndexChangesPageIndex():void\n\t\t{\n\t\t\tvar index:int = 2;\n\t\t\tthis.setDataProvider();\n\t\t\tthis._list.selectedIndex = index;\n\t\t\tthis._list.validate(); //uses scrollToDisplayIndex();\n\t\t\tAssert.assertStrictlyEquals(\"SpinnerList verticalPageIndex must change when selectedIndex changes\",\n\t\t\t\tindex, this._list.verticalPageIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemBeforeSelectedIndexChangesPageIndex():void\n\t\t{\n\t\t\tvar index:int = 2;\n\t\t\tthis.setDataProvider();\n\t\t\tthis._list.selectedIndex = index;\n\t\t\t//validating here probably shouldn't be required, but SpinnerList\n\t\t\t//doesn't know which direction it will scroll yet\n\t\t\tthis._list.validate();\n\t\t\tthis._list.dataProvider.removeItemAt(index - 1);\n\t\t\tthis._list.validate(); //uses scrollToDisplayIndex();\n\t\t\tAssert.assertStrictlyEquals(\"SpinnerList verticalPageIndex must change when removeItemAt() before selectedIndex\",\n\t\t\t\tindex - 1, this._list.verticalPageIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemAtSelectedIndexChangesPageIndex():void\n\t\t{\n\t\t\tvar index:int = 2;\n\t\t\tthis.setDataProvider();\n\t\t\tthis._list.selectedIndex = index;\n\t\t\t//validating here probably shouldn't be required, but SpinnerList\n\t\t\t//doesn't know which direction it will scroll yet\n\t\t\tthis._list.validate();\n\t\t\tthis._list.dataProvider.addItemAt({ label: \"New\" }, index);\n\t\t\tthis._list.validate(); //uses scrollToDisplayIndex();\n\t\t\tAssert.assertStrictlyEquals(\"SpinnerList verticalPageIndex must change when addItemAt() before selectedIndex\",\n\t\t\t\tindex + 1, this._list.verticalPageIndex);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/StackScreenNavigatorMeasurementTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.AutoSizeMode;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.StackScreenNavigator;\n\timport feathers.controls.StackScreenNavigatorItem;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class StackScreenNavigatorMeasurementTests\n\t{\n\t\tprivate static const SCREEN_ID_ONE:String = \"one\";\n\t\tprivate static const SCREEN_ONE_WIDTH:Number = 100;\n\t\tprivate static const SCREEN_ONE_HEIGHT:Number = 150;\n\t\t\n\t\tprivate static const SCREEN_ID_TWO:String = \"two\";\n\t\tprivate static const SCREEN_TWO_WIDTH:Number = 200;\n\t\tprivate static const SCREEN_TWO_HEIGHT:Number = 180;\n\t\tprivate static const SCREEN_TWO_MIN_WIDTH:Number = 110;\n\t\tprivate static const SCREEN_TWO_MIN_HEIGHT:Number = 120;\n\n\t\tprivate var _navigator:StackScreenNavigator;\n\t\tprivate var _screenOne:Quad;\n\t\tprivate var _screenTwo:LayoutGroup;\n\t\tprivate var _navigator2:StackScreenNavigator;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._screenOne = new Quad(SCREEN_ONE_WIDTH, SCREEN_ONE_HEIGHT, 0xff0000);\n\t\t\t\n\t\t\tvar screenTwoBackground:Quad = new Quad(SCREEN_TWO_WIDTH, SCREEN_TWO_HEIGHT, 0x0000ff);\n\t\t\tthis._screenTwo = new LayoutGroup();\n\t\t\tthis._screenTwo.minWidth = SCREEN_TWO_MIN_WIDTH;\n\t\t\tthis._screenTwo.minHeight = SCREEN_TWO_MIN_HEIGHT;\n\t\t\tthis._screenTwo.backgroundSkin = screenTwoBackground;\n\t\t\t\n\t\t\tthis._navigator = new StackScreenNavigator();\n\t\t\tthis._navigator.addScreen(SCREEN_ID_ONE, new StackScreenNavigatorItem(this._screenOne));\n\t\t\tthis._navigator.addScreen(SCREEN_ID_TWO, new StackScreenNavigatorItem(this._screenTwo));\n\t\t\tTestFeathers.starlingRoot.addChild(this._navigator);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._navigator.removeFromParent(true);\n\t\t\tthis._navigator = null;\n\n\t\t\tif(this._navigator2)\n\t\t\t{\n\t\t\t\tthis._navigator2.removeFromParent(true);\n\t\t\t\tthis._navigator2 = null;\n\t\t\t}\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeModeStage():void\n\t\t{\n\t\t\tthis._navigator.autoSizeMode = AutoSizeMode.STAGE;\n\t\t\tthis._navigator.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the StackScreenNavigator was not calculated correctly when empty with AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageWidth, this._navigator.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the StackScreenNavigator was not calculated correctly when empty with AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageHeight, this._navigator.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the StackScreenNavigator was not calculated correctly when empty with AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageWidth, this._navigator.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the StackScreenNavigator was not calculated correctly when empty with AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageHeight, this._navigator.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeModeStageWithoutParent():void\n\t\t{\n\t\t\tthis._navigator2 = new StackScreenNavigator();\n\t\t\tthis._navigator2.autoSizeMode = AutoSizeMode.STAGE;\n\t\t\tthis._navigator2.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the ScreenNavigator was not calculated correctly with no parent and AutoSizeMode.STAGE.\",\n\t\t\t\t0, this._navigator2.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the ScreenNavigator was not calculated correctly with no parent and AutoSizeMode.STAGE.\",\n\t\t\t\t0, this._navigator2.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the ScreenNavigator was not calculated correctly with no parent and AutoSizeMode.STAGE.\",\n\t\t\t\t0, this._navigator2.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the ScreenNavigator was not calculated correctly with no parent and AutoSizeMode.STAGE.\",\n\t\t\t\t0, this._navigator2.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeModeStageWithValidateBeforeAdd():void\n\t\t{\n\t\t\tthis._navigator2 = new StackScreenNavigator();\n\t\t\tthis._navigator2.autoSizeMode = AutoSizeMode.STAGE;\n\t\t\tthis._navigator2.validate();\n\t\t\tTestFeathers.starlingRoot.addChild(this._navigator2);\n\t\t\tthis._navigator2.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the ScreenNavigator was not calculated correctly after addChild() when validated before with AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageWidth, this._navigator2.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the ScreenNavigator was not calculated correctly after addChild() when validated before with AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageHeight, this._navigator2.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the ScreenNavigator was not calculated correctly after addChild() when validated before with AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageWidth, this._navigator2.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the ScreenNavigator was not calculated correctly after addChild() when validated before with AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageHeight, this._navigator2.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeModeContentWithNoActiveScreen():void\n\t\t{\n\t\t\tthis._navigator.autoSizeMode = AutoSizeMode.CONTENT;\n\t\t\tthis._navigator.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the StackScreenNavigator was not calculated correctly when empty with AutoSizeMode.CONTENT.\",\n\t\t\t\t0, this._navigator.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the StackScreenNavigator was not calculated correctly when empty with AutoSizeMode.CONTENT.\",\n\t\t\t\t0, this._navigator.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the StackScreenNavigator was not calculated correctly when empty with AutoSizeMode.CONTENT.\",\n\t\t\t\t0, this._navigator.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the StackScreenNavigator was not calculated correctly when empty with AutoSizeMode.CONTENT.\",\n\t\t\t\t0, this._navigator.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeModeStageWithSimpleScreen():void\n\t\t{\n\t\t\tthis._navigator.autoSizeMode = AutoSizeMode.STAGE;\n\t\t\tthis._navigator.rootScreenID = SCREEN_ID_ONE;\n\t\t\tthis._navigator.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the StackScreenNavigator was not calculated correctly with simple screen and AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageWidth, this._navigator.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the StackScreenNavigator was not calculated correctly with simple screen and AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageHeight, this._navigator.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the StackScreenNavigator was not calculated correctly with simple screen and AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageWidth, this._navigator.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the StackScreenNavigator was not calculated correctly with simple screen and AutoSizeMode.STAGE.\",\n\t\t\t\tTestFeathers.starlingRoot.stage.stageHeight, this._navigator.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeModeContentWithSimpleScreen():void\n\t\t{\n\t\t\tthis._navigator.autoSizeMode = AutoSizeMode.CONTENT;\n\t\t\tthis._navigator.rootScreenID = SCREEN_ID_ONE;\n\t\t\tthis._navigator.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the StackScreenNavigator was not calculated correctly with simple screen and AutoSizeMode.CONTENT.\",\n\t\t\t\tSCREEN_ONE_WIDTH, this._navigator.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the StackScreenNavigator was not calculated correctly with simple screen and AutoSizeMode.CONTENT.\",\n\t\t\t\tSCREEN_ONE_HEIGHT, this._navigator.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the StackScreenNavigator was not calculated correctly with simple screen and AutoSizeMode.CONTENT.\",\n\t\t\t\tSCREEN_ONE_WIDTH, this._navigator.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the StackScreenNavigator was not calculated correctly with simple screen and AutoSizeMode.CONTENT.\",\n\t\t\t\tSCREEN_ONE_HEIGHT, this._navigator.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeModeContentWithComplexScreen():void\n\t\t{\n\t\t\tthis._navigator.autoSizeMode = AutoSizeMode.CONTENT;\n\t\t\tthis._navigator.rootScreenID = SCREEN_ID_TWO;\n\t\t\tthis._navigator.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the StackScreenNavigator was not calculated correctly with complex screen and AutoSizeMode.CONTENT.\",\n\t\t\t\tSCREEN_TWO_WIDTH, this._navigator.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the StackScreenNavigator was not calculated correctly with complex screen and AutoSizeMode.CONTENT.\",\n\t\t\t\tSCREEN_TWO_HEIGHT, this._navigator.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the StackScreenNavigator was not calculated correctly with complex screen and AutoSizeMode.CONTENT.\",\n\t\t\t\tSCREEN_TWO_MIN_WIDTH, this._navigator.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the StackScreenNavigator was not calculated correctly with complex screen and AutoSizeMode.CONTENT.\",\n\t\t\t\tSCREEN_TWO_MIN_HEIGHT, this._navigator.minHeight);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/StackScreenNavigatorTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.StackScreenNavigator;\n\timport feathers.controls.StackScreenNavigatorItem;\n\timport feathers.events.FeathersEventType;\n\n\timport flexunit.framework.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport flash.geom.Point;\n\timport starling.events.Touch;\n\timport starling.events.TouchPhase;\n\timport starling.events.TouchEvent;\n\timport starling.events.Event;\n\timport feathers.motion.Slide;\n\timport org.flexunit.async.Async;\n\n\tpublic class StackScreenNavigatorTests\n\t{\n\t\tpublic static const SCREEN_A_ID:String = \"a\";\n\t\tpublic static const SCREEN_B_ID:String = \"b\";\n\t\tpublic static const SCREEN_C_ID:String = \"c\";\n\t\tpublic static const SCREEN_D_ID:String = \"d\";\n\t\tpublic static const SCREEN_E_ID:String = \"e\";\n\n\t\tprivate static const EVENT_PUSH_SCREEN_B:String = \"pushScreenB\";\n\t\tprivate static const EVENT_PUSH_SCREEN_C:String = \"pushScreenC\";\n\t\tprivate static const EVENT_REPLACE_WITH_SCREEN_C:String = \"replaceWithScreenC\";\n\t\tprivate static const EVENT_POP_SCREEN:String = \"popScreen\";\n\t\tprivate static const EVENT_POP_TO_ROOT_SCREEN:String = \"popToRootScreen\";\n\t\tprivate static const EVENT_CALL_FUNCTION:String = \"callFunction\";\n\n\t\tprivate static const NAVIGATOR_WIDTH:Number = 250;\n\t\tprivate static const NAVIGATOR_HEIGHT:Number = 200;\n\n\t\tprivate var _navigator:StackScreenNavigator;\n\t\tprivate var _functionWasCalled:Boolean = false;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._navigator = new StackScreenNavigator();\n\t\t\tthis._navigator.setSize(NAVIGATOR_WIDTH, NAVIGATOR_HEIGHT);\n\t\t\tTestFeathers.starlingRoot.addChild(this._navigator);\n\t\t\tthis._navigator.validate();\n\n\t\t\tthis._functionWasCalled = false;\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._navigator.removeFromParent(true);\n\t\t\tthis._navigator = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHasScreenWhenNotAdded():void\n\t\t{\n\t\t\tAssert.assertFalse(\"hasScreen() incorrectly returned true for a screen that was not added\", this._navigator.hasScreen(SCREEN_A_ID));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHasScreen():void\n\t\t{\n\t\t\tthis.addScreenA();\n\t\t\tAssert.assertTrue(\"hasScreen() incorrectly returned false for a screen that was added\", this._navigator.hasScreen(SCREEN_A_ID));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testStateWithEmptyStack():void\n\t\t{\n\t\t\tAssert.assertNull(\"activeScreen returned incorrect value for empty stack\", this._navigator.activeScreen);\n\t\t\tAssert.assertNull(\"activeScreenID returned incorrect value for empty stack\", this._navigator.activeScreenID);\n\t\t\tAssert.assertStrictlyEquals(\"stackCount returned incorrect value for empty stack\", 0, this._navigator.stackCount);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetRootScreenID():void\n\t\t{\n\t\t\tthis.addScreenA();\n\t\t\tthis._navigator.rootScreenID = SCREEN_A_ID;\n\t\t\tAssert.assertStrictlyEquals(\"activeScreen returned incorrect value for stack with only root screen\", this._navigator.getScreen(SCREEN_A_ID).screen, this._navigator.activeScreen);\n\t\t\tAssert.assertStrictlyEquals(\"activeScreenID returned incorrect value for stack with only root screen\", SCREEN_A_ID, this._navigator.activeScreenID);\n\t\t\tAssert.assertStrictlyEquals(\"stackCount returned incorrect value for stack with only root screen\", 1, this._navigator.stackCount);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPushScreen():void\n\t\t{\n\t\t\tthis.addScreenA();\n\t\t\tthis.addScreenB();\n\t\t\tthis._navigator.rootScreenID = SCREEN_A_ID;\n\t\t\tthis._navigator.pushScreen(SCREEN_B_ID);\n\t\t\tAssert.assertStrictlyEquals(\"activeScreen returned incorrect value for stack after pushScreen()\", this._navigator.getScreen(SCREEN_B_ID).screen, this._navigator.activeScreen);\n\t\t\tAssert.assertStrictlyEquals(\"activeScreenID returned incorrect value for stack after pushScreen()\", SCREEN_B_ID, this._navigator.activeScreenID);\n\t\t\tAssert.assertStrictlyEquals(\"stackCount returned incorrect value for stack after pushScreen()\", 2, this._navigator.stackCount);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testReplaceScreen():void\n\t\t{\n\t\t\tthis.addScreenA();\n\t\t\tthis.addScreenB();\n\t\t\tthis.addScreenC();\n\t\t\tthis._navigator.rootScreenID = SCREEN_A_ID;\n\t\t\tthis._navigator.pushScreen(SCREEN_B_ID);\n\t\t\tthis._navigator.replaceScreen(SCREEN_C_ID);\n\t\t\tAssert.assertStrictlyEquals(\"activeScreen returned incorrect value for stack after replaceScreen()\", this._navigator.getScreen(SCREEN_C_ID).screen, this._navigator.activeScreen);\n\t\t\tAssert.assertStrictlyEquals(\"activeScreenID returned incorrect value for stack after replaceScreen()\", SCREEN_C_ID, this._navigator.activeScreenID);\n\t\t\tAssert.assertStrictlyEquals(\"stackCount returned incorrect value for stack after replaceScreen()\", 2, this._navigator.stackCount);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPopScreen():void\n\t\t{\n\t\t\tthis.addScreenA();\n\t\t\tthis.addScreenB();\n\t\t\tthis._navigator.rootScreenID = SCREEN_A_ID;\n\t\t\tthis._navigator.pushScreen(SCREEN_B_ID);\n\t\t\tthis._navigator.popScreen();\n\t\t\tAssert.assertStrictlyEquals(\"activeScreen returned incorrect value for stack after popScreen()\", this._navigator.getScreen(SCREEN_A_ID).screen, this._navigator.activeScreen);\n\t\t\tAssert.assertStrictlyEquals(\"activeScreenID returned incorrect value for stack after popScreen()\", SCREEN_A_ID, this._navigator.activeScreenID);\n\t\t\tAssert.assertStrictlyEquals(\"stackCount returned incorrect value for stack after popScreen()\", 1, this._navigator.stackCount);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPopToRootScreen():void\n\t\t{\n\t\t\tthis.addScreenA();\n\t\t\tthis.addScreenB();\n\t\t\tthis.addScreenC();\n\t\t\tthis._navigator.rootScreenID = SCREEN_A_ID;\n\t\t\tthis._navigator.pushScreen(SCREEN_B_ID);\n\t\t\tthis._navigator.pushScreen(SCREEN_C_ID);\n\t\t\tthis._navigator.popToRootScreen();\n\t\t\tAssert.assertStrictlyEquals(\"activeScreen returned incorrect value for stack after popToRootScreen()\", this._navigator.getScreen(SCREEN_A_ID).screen, this._navigator.activeScreen);\n\t\t\tAssert.assertStrictlyEquals(\"activeScreenID returned incorrect value for stack after popToRootScreen()\", SCREEN_A_ID, this._navigator.activeScreenID);\n\t\t\tAssert.assertStrictlyEquals(\"stackCount returned incorrect value for stack after popToRootScreen()\", 1, this._navigator.stackCount);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPopToRootScreenOnRootScreen():void\n\t\t{\n\t\t\tthis.addScreenA();\n\t\t\tthis._navigator.rootScreenID = SCREEN_A_ID;\n\t\t\tthis._navigator.popToRootScreen();\n\t\t\tAssert.assertStrictlyEquals(\"activeScreen returned incorrect value for stack after popToRootScreen() when already on root screen\", this._navigator.getScreen(SCREEN_A_ID).screen, this._navigator.activeScreen);\n\t\t\tAssert.assertStrictlyEquals(\"activeScreenID returned incorrect value for stack after popToRootScreen() when already on root screen\", SCREEN_A_ID, this._navigator.activeScreenID);\n\t\t\tAssert.assertStrictlyEquals(\"stackCount returned incorrect value for stack after popToRootScreen() when already on root screen\", 1, this._navigator.stackCount);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPopAll():void\n\t\t{\n\t\t\tthis.addScreenA();\n\t\t\tthis.addScreenB();\n\t\t\tthis.addScreenC();\n\t\t\tthis._navigator.rootScreenID = SCREEN_A_ID;\n\t\t\tthis._navigator.pushScreen(SCREEN_B_ID);\n\t\t\tthis._navigator.pushScreen(SCREEN_C_ID);\n\t\t\tthis._navigator.popAll();\n\t\t\tAssert.assertNull(\"activeScreen returned incorrect value for stack after popAll()\", this._navigator.activeScreen);\n\t\t\tAssert.assertNull(\"activeScreenID returned incorrect value for stack after popAll()\", this._navigator.activeScreenID);\n\t\t\tAssert.assertStrictlyEquals(\"stackCount returned incorrect value for stack after popAll()\", 0, this._navigator.stackCount);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPopAllWithOnRootScreen():void\n\t\t{\n\t\t\tthis.addScreenA();\n\t\t\tthis._navigator.rootScreenID = SCREEN_A_ID;\n\t\t\tthis._navigator.popAll();\n\t\t\tAssert.assertNull(\"activeScreen returned incorrect value for stack after popAll() when on root screen\", this._navigator.activeScreen);\n\t\t\tAssert.assertNull(\"activeScreenID returned incorrect value for stack after popAll() when on root screen\", this._navigator.activeScreenID);\n\t\t\tAssert.assertStrictlyEquals(\"stackCount returned incorrect value for stack after popAll() when on root screen\", 0, this._navigator.stackCount);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPopAllWithNoRootScreen():void\n\t\t{\n\t\t\tthis._navigator.popAll();\n\t\t\tAssert.assertNull(\"activeScreen returned incorrect value for stack after popAll() with empty stack\", this._navigator.activeScreen);\n\t\t\tAssert.assertNull(\"activeScreenID returned incorrect value for stack after popAll() with empty stack\", this._navigator.activeScreenID);\n\t\t\tAssert.assertStrictlyEquals(\"stackCount returned incorrect value for stack after popAll() with empty stack\", 0, this._navigator.stackCount);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPushScreenWithEvent():void\n\t\t{\n\t\t\tthis.addScreenA();\n\t\t\tthis.addScreenB();\n\t\t\tthis._navigator.rootScreenID = SCREEN_A_ID;\n\t\t\tthis._navigator.activeScreen.dispatchEventWith(EVENT_PUSH_SCREEN_B);\n\t\t\tAssert.assertStrictlyEquals(\"activeScreen returned incorrect value for stack after push screen with event\", this._navigator.getScreen(SCREEN_B_ID).screen, this._navigator.activeScreen);\n\t\t\tAssert.assertStrictlyEquals(\"activeScreenID returned incorrect value for stack after push screen with event\", SCREEN_B_ID, this._navigator.activeScreenID);\n\t\t\tAssert.assertStrictlyEquals(\"stackCount returned incorrect value for stack with after push screen with event\", 2, this._navigator.stackCount);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testReplaceScreenWithEvent():void\n\t\t{\n\t\t\tthis.addScreenA();\n\t\t\tthis.addScreenB();\n\t\t\tthis.addScreenC();\n\t\t\tthis._navigator.rootScreenID = SCREEN_A_ID;\n\t\t\tthis._navigator.activeScreen.dispatchEventWith(EVENT_PUSH_SCREEN_B);\n\t\t\tthis._navigator.activeScreen.dispatchEventWith(EVENT_REPLACE_WITH_SCREEN_C);\n\t\t\tAssert.assertStrictlyEquals(\"activeScreen returned incorrect value for stack after replace screen with event\", this._navigator.getScreen(SCREEN_C_ID).screen, this._navigator.activeScreen);\n\t\t\tAssert.assertStrictlyEquals(\"activeScreenID returned incorrect value for stack after replace screen with event\", SCREEN_C_ID, this._navigator.activeScreenID);\n\t\t\tAssert.assertStrictlyEquals(\"stackCount returned incorrect value for stack after replace screen with event\", 2, this._navigator.stackCount);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPopScreenWithEvent():void\n\t\t{\n\t\t\tthis.addScreenA();\n\t\t\tthis.addScreenB();\n\t\t\tthis._navigator.rootScreenID = SCREEN_A_ID;\n\t\t\tthis._navigator.activeScreen.dispatchEventWith(EVENT_PUSH_SCREEN_B);\n\t\t\tthis._navigator.activeScreen.dispatchEventWith(EVENT_POP_SCREEN);\n\t\t\tAssert.assertStrictlyEquals(\"activeScreen returned incorrect value for stack after pop screen with event\", this._navigator.getScreen(SCREEN_A_ID).screen, this._navigator.activeScreen);\n\t\t\tAssert.assertStrictlyEquals(\"activeScreenID returned incorrect value for stack after pop screen with event\", SCREEN_A_ID, this._navigator.activeScreenID);\n\t\t\tAssert.assertStrictlyEquals(\"stackCount returned incorrect value for stack after pop screen with event\", 1, this._navigator.stackCount);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPopToRootScreenWithEvent():void\n\t\t{\n\t\t\tthis.addScreenA();\n\t\t\tthis.addScreenB();\n\t\t\tthis.addScreenC();\n\t\t\tthis._navigator.rootScreenID = SCREEN_A_ID;\n\t\t\tthis._navigator.activeScreen.dispatchEventWith(EVENT_PUSH_SCREEN_B);\n\t\t\tthis._navigator.activeScreen.dispatchEventWith(EVENT_PUSH_SCREEN_C);\n\t\t\tthis._navigator.activeScreen.dispatchEventWith(EVENT_POP_TO_ROOT_SCREEN);\n\t\t\tAssert.assertStrictlyEquals(\"activeScreen returned incorrect value for stack after pop to root with event\", this._navigator.getScreen(SCREEN_A_ID).screen, this._navigator.activeScreen);\n\t\t\tAssert.assertStrictlyEquals(\"activeScreenID returned incorrect value for stack after pop to root with event\", SCREEN_A_ID, this._navigator.activeScreenID);\n\t\t\tAssert.assertStrictlyEquals(\"stackCount returned incorrect value for stack after pop to root with event\", 1, this._navigator.stackCount);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testScreenWithEventAndMethodWithSameName():void\n\t\t{\n\t\t\tvar item:StackScreenNavigatorItem = new StackScreenNavigatorItem(ScreenWithEventAndMethodWithSameName);\n\t\t\titem.setScreenIDForPushEvent(EVENT_PUSH_SCREEN_B, SCREEN_B_ID);\n\t\t\titem.setScreenIDForReplaceEvent(EVENT_REPLACE_WITH_SCREEN_C, SCREEN_C_ID);\n\t\t\titem.addPopEvent(EVENT_POP_SCREEN);\n\t\t\titem.addPopToRootEvent(EVENT_POP_TO_ROOT_SCREEN);\n\t\t\tthis._navigator.addScreen(SCREEN_A_ID, item);\n\t\t\tthis._navigator.rootScreenID = SCREEN_A_ID;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPushSameScreenInstance():void\n\t\t{\n\t\t\tthis.addScreenA();\n\t\t\tthis._navigator.rootScreenID = SCREEN_A_ID;\n\t\t\tthis._navigator.pushScreen(SCREEN_A_ID);\n\t\t\t//ensures that this test isn't broken by changing addScreenA()\n\t\t\tAssert.assertTrue(\"StackScreenNavigatorTests expected StackScreenNavigatorItem screen to be display object\", this._navigator.getScreen(SCREEN_A_ID).screen is DisplayObject);\n\t\t\tAssert.assertNotNull(\"StackScreenNavigator activeScreen.parent must not be null after pushing multiple times\", this._navigator.activeScreen.parent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPushScreenOnInitialize():void\n\t\t{\n\t\t\tthis.addScreenD();\n\t\t\tthis.addScreenE();\n\t\t\tthis._navigator.rootScreenID = SCREEN_D_ID;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveScreenOnTransitionCompleteEvent():void\n\t\t{\n\t\t\tthis.addScreenA();\n\t\t\tthis.addScreenB();\n\t\t\tthis._navigator.pushScreen(SCREEN_A_ID);\n\t\t\tthis._navigator.addEventListener(FeathersEventType.TRANSITION_COMPLETE, removeScreenA);\n\t\t\tthis._navigator.rootScreenID = null;\n\t\t\tAssert.assertFalse(this._navigator.hasScreen(SCREEN_A_ID));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveAllScreensOnTransitionCompleteEvent():void\n\t\t{\n\t\t\tthis.addScreenA();\n\t\t\tthis.addScreenB();\n\t\t\tthis._navigator.pushScreen(SCREEN_A_ID);\n\t\t\tthis._navigator.addEventListener(FeathersEventType.TRANSITION_COMPLETE, removeAllScreens);\n\t\t\tthis._navigator.rootScreenID = null;\n\t\t\tAssert.assertFalse(this._navigator.hasScreen(SCREEN_A_ID));\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testSwipeToPopChange():void\n\t\t{\n\t\t\tthis.addScreenA();\n\t\t\tthis.addScreenB();\n\t\t\tthis._navigator.popTransition = Slide.createSlideRightTransition();\n\t\t\tthis._navigator.rootScreenID = SCREEN_A_ID;\n\t\t\tthis._navigator.pushScreen(SCREEN_B_ID);\n\t\t\tthis._navigator.isSwipeToPopEnabled = true;\n\t\t\tvar changedTo:String = null;\n\t\t\tthis._navigator.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\tchangedTo = _navigator.activeScreenID;\n\t\t\t});\n\n\t\t\tvar position:Point = new Point(1, 1);\n\t\t\tvar target:DisplayObject = this._navigator.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\ttouch.globalX = NAVIGATOR_WIDTH * 2 / 3;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertStrictlyEquals(\"StackScreenNavigator: activeScreenID incorrect after starting swipe to pop gesture\",\n\t\t\t\tSCREEN_A_ID, changedTo);\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertStrictlyEquals(\"StackScreenNavigator: activeScreenID incorrect after completing swipe to pop gesture\",\n\t\t\t\t\tSCREEN_B_ID, changedTo);\n\t\t\t}, 600);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testSwipeToPopCancelChange():void\n\t\t{\n\t\t\tthis.addScreenA();\n\t\t\tthis.addScreenB();\n\t\t\tthis._navigator.popTransition = Slide.createSlideRightTransition(0.5);\n\t\t\tthis._navigator.rootScreenID = SCREEN_A_ID;\n\t\t\tthis._navigator.pushScreen(SCREEN_B_ID);\n\t\t\tthis._navigator.isSwipeToPopEnabled = true;\n\t\t\tvar changedTo1:String = null;\n\t\t\tvar changedTo2:String = null;\n\t\t\tfunction onChange1(event:Event):void\n\t\t\t{\n\t\t\t\t_navigator.removeEventListener(Event.CHANGE, onChange1);\n\t\t\t\t_navigator.addEventListener(Event.CHANGE, onChange2);\n\t\t\t\tchangedTo1 = _navigator.activeScreenID;\n\t\t\t}\n\t\t\tfunction onChange2(event:Event):void\n\t\t\t{\n\t\t\t\tchangedTo2 = _navigator.activeScreenID;\n\t\t\t}\n\t\t\tthis._navigator.addEventListener(Event.CHANGE, onChange1);\n\n\t\t\tvar position:Point = new Point(1, 1);\n\t\t\tvar target:DisplayObject = this._navigator.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\ttouch.globalX = NAVIGATOR_WIDTH * 2 / 3;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertStrictlyEquals(\"StackScreenNavigator: activeScreenID incorrect after starting swipe to pop gesture\",\n\t\t\t\tSCREEN_A_ID, changedTo1);\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertStrictlyEquals(\"StackScreenNavigator: activeScreenID incorrect after cancelling swipe to pop gesture\",\n\t\t\t\t\tSCREEN_B_ID, changedTo2);\n\t\t\t}, 600);\n\t\t}\n\n\t\tprivate function addScreenA():void\n\t\t{\n\t\t\tvar screen:Quad = new Quad(10, 10, 0xff00ff);\n\t\t\tvar item:StackScreenNavigatorItem = new StackScreenNavigatorItem(screen);\n\t\t\titem.setScreenIDForPushEvent(EVENT_PUSH_SCREEN_B, SCREEN_B_ID);\n\t\t\titem.setFunctionForPushEvent(EVENT_CALL_FUNCTION, eventFunction);\n\t\t\tthis._navigator.addScreen(SCREEN_A_ID, item);\n\t\t}\n\n\t\tprivate function addScreenB():void\n\t\t{\n\t\t\tvar screen:Quad = new Quad(10, 10, 0xffff00);\n\t\t\tvar item:StackScreenNavigatorItem = new StackScreenNavigatorItem(screen);\n\t\t\titem.setScreenIDForPushEvent(EVENT_PUSH_SCREEN_C, SCREEN_C_ID);\n\t\t\titem.setScreenIDForReplaceEvent(EVENT_REPLACE_WITH_SCREEN_C, SCREEN_C_ID);\n\t\t\titem.addPopEvent(EVENT_POP_SCREEN);\n\t\t\tthis._navigator.addScreen(SCREEN_B_ID, item);\n\t\t}\n\n\t\tprivate function addScreenC():void\n\t\t{\n\t\t\tvar screen:Quad = new Quad(10, 10, 0x00ffff);\n\t\t\tvar item:StackScreenNavigatorItem = new StackScreenNavigatorItem(screen);\n\t\t\titem.addPopEvent(EVENT_POP_SCREEN);\n\t\t\titem.addPopToRootEvent(EVENT_POP_TO_ROOT_SCREEN);\n\t\t\tthis._navigator.addScreen(SCREEN_C_ID, item);\n\t\t}\n\n\t\tprivate function addScreenD():void\n\t\t{\n\t\t\tthis._navigator.addScreen(SCREEN_D_ID, new StackScreenNavigatorItem(ScreenPushOnInitialize));\n\t\t}\n\n\t\tprivate function addScreenE():void\n\t\t{\n\t\t\tthis._navigator.addScreen(SCREEN_E_ID, new StackScreenNavigatorItem(ScreenInitializeOnce));\n\t\t}\n\n\t\tprivate function removeScreenA():void\n\t\t{\n\t\t\tthis._navigator.removeScreen(SCREEN_A_ID);\n\t\t}\n\n\t\tprivate function removeAllScreens():void\n\t\t{\n\t\t\tthis._navigator.removeAllScreens();\n\t\t}\n\n\t\tprivate function eventFunction():void\n\t\t{\n\t\t\tthis._functionWasCalled = true;\n\t\t}\n\t}\n}\n\nimport feathers.controls.Screen;\nimport feathers.controls.StackScreenNavigator;\nimport feathers.tests.StackScreenNavigatorTests;\n\nimport flash.errors.IllegalOperationError;\n\nimport starling.display.Quad;\n\nclass ScreenWithEventAndMethodWithSameName extends Quad\n{\n\tpublic function ScreenWithEventAndMethodWithSameName()\n\t{\n\t\tsuper(10, 10, 0xff00ff);\n\t}\n\n\tpublic function pushScreenB():void {}\n\tpublic function replaceWithScreenC():void {}\n\tpublic function popScreen():void {}\n\tpublic function popToRootScreen():void {}\n}\n\nclass ScreenPushOnInitialize extends Screen\n{\n\toverride protected function initialize():void\n\t{\n\t\tsuper.initialize();\n\n\t\tStackScreenNavigator(this.owner).pushScreen(StackScreenNavigatorTests.SCREEN_E_ID);\n\t}\n}\n\nclass ScreenInitializeOnce extends Screen\n{\n\tprivate static var hasInitializedOnce:Boolean = false;\n\toverride protected function initialize():void\n\t{\n\t\tsuper.initialize();\n\n\t\tif(hasInitializedOnce)\n\t\t{\n\t\t\tthrow new IllegalOperationError(\"StackScreenNavigator did not clear next screen and is transitioning infinitely.\");\n\t\t}\n\t\thasInitializedOnce = true;\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/StageTextTextEditorFocusTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.TextInput;\n\timport feathers.controls.TextInputState;\n\timport feathers.controls.text.StageTextTextEditor;\n\timport feathers.core.FocusManager;\n\timport feathers.events.FeathersEventType;\n\n\timport flash.events.FocusEvent;\n\timport flash.ui.Keyboard;\n\n\timport org.flexunit.Assert;\n\timport org.flexunit.async.Async;\n\n\timport starling.core.Starling;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\n\tpublic class StageTextTextEditorFocusTests\n\t{\n\t\tprivate var _textInput:TextInput;\n\t\tprivate var _textInput2:TextInput;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, true);\n\n\t\t\tthis._textInput = new TextInput();\n\t\t\tthis._textInput.backgroundSkin = new Quad(200, 200);\n\t\t\tthis._textInput.textEditorFactory = textEditorFactory;\n\t\t\tTestFeathers.starlingRoot.addChild(this._textInput);\n\t\t\tthis._textInput.validate();\n\n\t\t\tthis._textInput2 = new TextInput();\n\t\t\tthis._textInput2.backgroundSkin = new Quad(200, 200);\n\t\t\tthis._textInput2.textEditorFactory = textEditorFactory;\n\t\t\tthis._textInput2.y = 210;\n\t\t\tTestFeathers.starlingRoot.addChild(this._textInput2);\n\t\t\tthis._textInput2.validate();\n\t\t}\n\n\t\tprivate function textEditorFactory():StageTextTextEditor\n\t\t{\n\t\t\tvar textEditor:StageTextTextEditor = new StageTextTextEditor();\n\t\t\treturn textEditor;\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\t//one of the tests sets the parent's visible property to false, so\n\t\t\t//it needs to be reset.\n\t\t\tthis._textInput.parent.visible = true;\n\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, false);\n\t\t\t\n\t\t\tthis._textInput.removeFromParent(true);\n\t\t\tthis._textInput = null;\n\n\t\t\tthis._textInput2.removeFromParent(true);\n\t\t\tthis._textInput2 = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChangeFocusOnTabKey():void\n\t\t{\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tStarling.current.nativeStage.dispatchEvent(new FocusEvent(FocusEvent.KEY_FOCUS_CHANGE, true, false, null, false, Keyboard.TAB));\n\t\t\tAssert.assertStrictlyEquals(\"The FocusManager did not change focus when pressing Keyboard.TAB\", this._textInput.focusManager.focus, this._textInput2);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testFocusOutEventAfterSetTextInputParentVisibleToFalse():void\n\t\t{\n\t\t\tvar hasDispatchedFocusOut:Boolean = false;\n\t\t\tthis._textInput.addEventListener(FeathersEventType.FOCUS_OUT, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedFocusOut = true;\n\t\t\t});\n\t\t\tthis._textInput.setFocus();\n\t\t\t_textInput.parent.visible = false;\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertTrue(\"FeathersEventType.FOCUS_OUT was not dispatched after setting TextInput parent's visible property to false when using StageTextTextEditor\", hasDispatchedFocusOut);\n\t\t\t}, 100);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetFocusWhenFocusEnabledFalse():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.isFocusEnabled = false;\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertTrue(\"TextInput must not receive FocusManager focus when using StageTextTextEditor and isFocusEnabled is false\",\n\t\t\t\tthis._textInput.focusManager.focus !== this._textInput);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state must be TextInputState.ENABLED after receive FocusManager focus when using StageTextTextEditor and isFocusEnabled is false\",\n\t\t\t\tTextInputState.ENABLED, this._textInput.currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetFocusWhenEditableFalseAndSelectableFalse():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.isEditable = false;\n\t\t\tthis._textInput.isSelectable = false;\n\t\t\tthis._textInput.validate();\n\t\t\tAssert.assertNull(\"StageTextTextEditor nativeFocus must be null when isEditable is false and isSelectable is false\",\n\t\t\t\tthis._textInput.nativeFocus);\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertStrictlyEquals(\"TextInput must receive FocusManager focus when using StageTextTextEditor and isEditable is false and isSelectable is false\",\n\t\t\t\tthis._textInput.focusManager.focus, this._textInput);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state must be TextInputState.FOCUSED after receive FocusManager focus when using TextFieldTextEditor and isEditable is false and isSelectable is false\",\n\t\t\t\tTextInputState.FOCUSED, this._textInput.currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetFocusWhenEditableTrueAndSelectableFalse():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.isEditable = true;\n\t\t\tthis._textInput.isSelectable = false;\n\t\t\tthis._textInput.validate();\n\t\t\tAssert.assertNotNull(\"StageTextTextEditor nativeFocus must not be null when isEditable is true and isSelectable is false\",\n\t\t\t\tthis._textInput.nativeFocus);\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertStrictlyEquals(\"TextInput must receive FocusManager focus when using StageTextTextEditor and isEditable is true and isSelectable is false\",\n\t\t\t\tthis._textInput.focusManager.focus, this._textInput);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state must be TextInputState.FOCUSED after receive FocusManager focus when using StageTextTextEditor and isEditable is true and isSelectable is false\",\n\t\t\t\tTextInputState.FOCUSED, this._textInput.currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetFocusWhenEditableFalseAndSelectableTrue():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.isEditable = false;\n\t\t\tthis._textInput.isSelectable = true;\n\t\t\tthis._textInput.validate();\n\t\t\tAssert.assertNull(\"StageTextTextEditor nativeFocus must be null when isEditable is false and isSelectable is true\",\n\t\t\t\tthis._textInput.nativeFocus);\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertStrictlyEquals(\"TextInput must receive FocusManager focus when using StageTextTextEditor and isEditable is false and isSelectable is true\",\n\t\t\t\tthis._textInput.focusManager.focus, this._textInput);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state must be TextInputState.FOCUSED after receive FocusManager focus when using StageTextTextEditor and isEditable is false and isSelectable is true\",\n\t\t\t\tTextInputState.FOCUSED, this._textInput.currentState);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/StyleNameFunctionStyleProviderTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.BasicButton;\n\timport feathers.core.IFeathersControl;\n\timport feathers.skins.StyleNameFunctionStyleProvider;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class StyleNameFunctionStyleProviderTests\n\t{\n\t\tprivate static const STYLE_NAME_ONE:String = \"one\";\n\t\tprivate static const STYLE_NAME_TWO:String = \"two\";\n\t\t\n\t\tprivate var _target:BasicButton;\n\t\tprivate var _styleProvider:StyleNameFunctionStyleProvider;\n\t\tprivate var _defaultCalled:Boolean;\n\t\tprivate var _oneCalled:Boolean;\n\t\tprivate var _twoCalled:Boolean;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._defaultCalled = false;\n\t\t\tthis._oneCalled = false;\n\t\t\tthis._twoCalled = false;\n\t\t\t\n\t\t\tthis._target = new BasicButton();\n\t\t\tthis._target.defaultSkin = new Quad(200, 200, 0xff00ff);\n\t\t\tTestFeathers.starlingRoot.addChild(this._target);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._target.removeFromParent(true);\n\t\t\tthis._target = null;\n\n\t\t\tthis._styleProvider = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\tprivate function defaultFunction(target:IFeathersControl):void\n\t\t{\n\t\t\tthis._defaultCalled = true;\n\t\t}\n\n\t\tprivate function oneFunction(target:IFeathersControl):void\n\t\t{\n\t\t\tthis._oneCalled = true;\n\t\t}\n\n\t\tprivate function twoFunction(target:IFeathersControl):void\n\t\t{\n\t\t\tthis._twoCalled = true;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoErrorWithNullDefaultFunction():void\n\t\t{\n\t\t\tthis._styleProvider = new StyleNameFunctionStyleProvider();\n\t\t\tthis._styleProvider.applyStyles(this._target);\n\t\t\tAssert.assertFalse(\"Default function must not be called when not used\", this._defaultCalled);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDefaultFunction():void\n\t\t{\n\t\t\tthis._styleProvider = new StyleNameFunctionStyleProvider(defaultFunction);\n\t\t\tthis._styleProvider.applyStyles(this._target);\n\t\t\tAssert.assertTrue(\"Default function must be called\", this._defaultCalled);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testOnlyDefaultFunctionCalledWhenOthersRegistered():void\n\t\t{\n\t\t\tthis._styleProvider = new StyleNameFunctionStyleProvider(defaultFunction);\n\t\t\tthis._styleProvider.setFunctionForStyleName(STYLE_NAME_ONE, oneFunction);\n\t\t\tthis._styleProvider.setFunctionForStyleName(STYLE_NAME_TWO, twoFunction);\n\t\t\tthis._styleProvider.applyStyles(this._target);\n\t\t\tAssert.assertTrue(\"Default function must be called\", this._defaultCalled);\n\t\t\tAssert.assertFalse(\"Style name function must not be called\", this._oneCalled);\n\t\t\tAssert.assertFalse(\"Style name function must not be called\", this._twoCalled);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDefaultNotCalledWhenStyleNameMatched():void\n\t\t{\n\t\t\tthis._styleProvider = new StyleNameFunctionStyleProvider(defaultFunction);\n\t\t\tthis._styleProvider.setFunctionForStyleName(STYLE_NAME_ONE, oneFunction);\n\t\t\tthis._styleProvider.setFunctionForStyleName(STYLE_NAME_TWO, twoFunction);\n\t\t\tthis._target.styleNameList.add(STYLE_NAME_ONE);\n\t\t\tthis._styleProvider.applyStyles(this._target);\n\t\t\tAssert.assertFalse(\"Default function must not be called\", this._defaultCalled);\n\t\t\tAssert.assertTrue(\"Style name function must be called\", this._oneCalled);\n\t\t\tAssert.assertFalse(\"Style name function must not be called\", this._twoCalled);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMultipleStyleNamesMatched():void\n\t\t{\n\t\t\tthis._styleProvider = new StyleNameFunctionStyleProvider(defaultFunction);\n\t\t\tthis._styleProvider.setFunctionForStyleName(STYLE_NAME_ONE, oneFunction);\n\t\t\tthis._styleProvider.setFunctionForStyleName(STYLE_NAME_TWO, twoFunction);\n\t\t\tthis._target.styleNameList.add(STYLE_NAME_ONE);\n\t\t\tthis._target.styleNameList.add(STYLE_NAME_TWO);\n\t\t\tthis._styleProvider.applyStyles(this._target);\n\t\t\tAssert.assertFalse(\"Default function must not be called\", this._defaultCalled);\n\t\t\tAssert.assertTrue(\"Style name function must be called\", this._oneCalled);\n\t\t\tAssert.assertTrue(\"Style name function must be called\", this._twoCalled);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/StyleProviderRegistryTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.BasicButton;\n\timport feathers.controls.Slider;\n\timport feathers.skins.IStyleProvider;\n\timport feathers.skins.StyleProviderRegistry;\n\timport feathers.tests.supportClasses.CustomStyleProvider;\n\n\timport org.flexunit.Assert;\n\n\tpublic class StyleProviderRegistryTests\n\t{\n\t\tprivate var _registry:StyleProviderRegistry;\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._registry.dispose();\n\t\t\tthis._registry = null;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHasStyleProvider():void\n\t\t{\n\t\t\tthis._registry = new StyleProviderRegistry(false);\n\t\t\tAssert.assertFalse(\"StyleProviderRegistry incorrectly returns true from hasStyleProvider() when class is not in registry.\",\n\t\t\t\tthis._registry.hasStyleProvider(BasicButton));\n\t\t\t\n\t\t\tvar styleProvider:IStyleProvider = this._registry.getStyleProvider(BasicButton);\n\t\t\tAssert.assertTrue(\"StyleProviderRegistry must return true from hasStyleProvider() when class is in registry.\",\n\t\t\t\tthis._registry.hasStyleProvider(BasicButton));\n\t\t\tAssert.assertFalse(\"StyleProviderRegistry must return false from hasStyleProvider() when class is not in registry.\",\n\t\t\t\tthis._registry.hasStyleProvider(Slider));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetStyleProvider():void\n\t\t{\n\t\t\tthis._registry = new StyleProviderRegistry(false);\n\t\t\tvar styleProvider:IStyleProvider = this._registry.getStyleProvider(BasicButton);\n\t\t\tAssert.assertNotNull(\"StyleProviderRegistry must return non-null value from getStyleProvider().\",\n\t\t\t\tstyleProvider);\n\t\t\tvar otherStyleProvider:IStyleProvider = this._registry.getStyleProvider(BasicButton);\n\t\t\tAssert.assertStrictlyEquals(\"StyleProviderRegistry must return same value from getStyleProvider() when called multiple times.\",\n\t\t\t\tstyleProvider, otherStyleProvider);\n\t\t\tvar thirdStyleProvider:IStyleProvider = this._registry.getStyleProvider(Slider);\n\t\t\tAssert.assertTrue(\"StyleProviderRegistry must return different value from getStyleProvider() when called with different classes.\",\n\t\t\t\tstyleProvider !== thirdStyleProvider);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testClearStyleProvider():void\n\t\t{\n\t\t\tthis._registry = new StyleProviderRegistry(false);\n\t\t\tvar styleProvider:IStyleProvider = this._registry.getStyleProvider(BasicButton);\n\t\t\tvar clearedStyleProvider:IStyleProvider = this._registry.clearStyleProvider(BasicButton);\n\t\t\tAssert.assertFalse(\"StyleProviderRegistry incorrectly returns true from hasStyleProvider() when class is cleared from registry.\",\n\t\t\t\tthis._registry.hasStyleProvider(BasicButton));\n\t\t\tAssert.assertStrictlyEquals(\"StyleProviderRegistry must return same value from clearStyleProvider() as getStyleProvider().\",\n\t\t\t\tstyleProvider, clearedStyleProvider);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDispose():void\n\t\t{\n\t\t\tthis._registry = new StyleProviderRegistry(false);\n\t\t\tvar styleProvider1:IStyleProvider = this._registry.getStyleProvider(BasicButton);\n\t\t\tvar styleProvider2:IStyleProvider = this._registry.getStyleProvider(Slider);\n\t\t\tthis._registry.dispose();\n\t\t\tAssert.assertFalse(\"StyleProviderRegistry incorrectly returns true from hasStyleProvider() after dispose() is called.\",\n\t\t\t\tthis._registry.hasStyleProvider(BasicButton));\n\t\t\tAssert.assertFalse(\"StyleProviderRegistry incorrectly returns true from hasStyleProvider() after dispose() is called.\",\n\t\t\t\tthis._registry.hasStyleProvider(Slider));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetStyleProviderGlobal():void\n\t\t{\n\t\t\tthis._registry = new StyleProviderRegistry(true);\n\t\t\tvar styleProvider:IStyleProvider = this._registry.getStyleProvider(BasicButton);\n\t\t\tAssert.assertNotNull(\"StyleProviderRegistry must register globalStyleProvider when calling getStyleProvider().\",\n\t\t\t\tBasicButton.globalStyleProvider);\n\t\t\tAssert.assertStrictlyEquals(\"StyleProviderRegistry must return same value from getStyleProvider() as it sets on globalStyleProvider.\",\n\t\t\t\tBasicButton.globalStyleProvider, styleProvider);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testClearStyleProviderGlobal():void\n\t\t{\n\t\t\tthis._registry = new StyleProviderRegistry(false);\n\t\t\tvar styleProvider:IStyleProvider = this._registry.getStyleProvider(BasicButton);\n\t\t\tthis._registry.clearStyleProvider(BasicButton);\n\t\t\tAssert.assertNull(\"StyleProviderRegistry failed to set globalStyleProvider to null after clearStyleProvider().\",\n\t\t\t\tBasicButton.globalStyleProvider);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDisposeGlobal():void\n\t\t{\n\t\t\tthis._registry = new StyleProviderRegistry(false);\n\t\t\tvar styleProvider:IStyleProvider = this._registry.getStyleProvider(BasicButton);\n\t\t\tthis._registry.dispose();\n\t\t\tAssert.assertNull(\"StyleProviderRegistry failed to set globalStyleProvider to null after dispose().\",\n\t\t\t\tBasicButton.globalStyleProvider);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testClearStyleProviderAfterChangeGlobal():void\n\t\t{\n\t\t\tthis._registry = new StyleProviderRegistry(false);\n\t\t\tvar styleProvider:IStyleProvider = this._registry.getStyleProvider(BasicButton);\n\t\t\tvar replacementStyleProvider:CustomStyleProvider = new CustomStyleProvider();\n\t\t\tBasicButton.globalStyleProvider = replacementStyleProvider;\n\t\t\tthis._registry.clearStyleProvider(BasicButton);\n\t\t\tAssert.assertStrictlyEquals(\"StyleProviderRegistry incorrectly set globalStyleProvider to null after clearStyleProvider() when global did not match.\",\n\t\t\t\treplacementStyleProvider, BasicButton.globalStyleProvider);\n\t\t\tBasicButton.globalStyleProvider = null;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/StyleTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.LayoutGroup;\n\n\timport org.flexunit.Assert;\n\n\timport starling.events.Event;\n\n\tpublic class StyleTests\n\t{\n\t\tprivate var _control:LayoutGroup;\n\t\tprivate var _styleProvider:FunctionStyleProviderWithEvents;\n\t\tprivate var _appliedStyles:Boolean = false;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._appliedStyles = false;\n\t\t\tthis._control = new LayoutGroup();\n\t\t\tthis._styleProvider = new FunctionStyleProviderWithEvents(setExtraStyles);\n\t\t}\n\n\t\tprivate function setExtraStyles(target:LayoutGroup):void\n\t\t{\n\t\t\tthis._appliedStyles = true;\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._control.removeFromParent(true);\n\t\t\tthis._control = null;\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetStyleProviderBeforeInitialize():void\n\t\t{\n\t\t\tthis._control.styleProvider = this._styleProvider;\n\t\t\tAssert.assertFalse(\"FeathersControl: must not apply styles before initialization\", this._appliedStyles);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetStyleProviderAfterInitialize():void\n\t\t{\n\t\t\tthis._control.validate();\n\t\t\tthis._appliedStyles = false;\n\t\t\tthis._control.styleProvider = this._styleProvider;\n\t\t\tAssert.assertTrue(\"FeathersControl: must apply styles after initialization\", this._appliedStyles);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddToStyleNameListBeforeInitialize():void\n\t\t{\n\t\t\tthis._control.styleProvider = this._styleProvider;\n\t\t\tthis._control.styleNameList.add(\"custom-style-name\");\n\t\t\tAssert.assertFalse(\"FeathersControl: when adding to style name list, must not apply styles before initialization\", this._appliedStyles);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddToStyleNameListAfterInitialize():void\n\t\t{\n\t\t\tthis._control.styleProvider = this._styleProvider;\n\t\t\tthis._control.validate();\n\t\t\tthis._appliedStyles = false;\n\t\t\tthis._control.styleNameList.add(\"custom-style-name\");\n\t\t\tAssert.assertTrue(\"FeathersControl: when adding to style name list, must apply styles after initialization\", this._appliedStyles);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testStyleProviderChangeEventBeforeInitialize():void\n\t\t{\n\t\t\tthis._control.styleProvider = this._styleProvider;\n\t\t\tthis._styleProvider.dispatchEventWith(Event.CHANGE);\n\t\t\tAssert.assertFalse(\"FeathersControl: when style provider dispatches Event.CHANGE, must not apply styles before initialization\", this._appliedStyles);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testStyleProviderChangeEventAfterInitialize():void\n\t\t{\n\t\t\tthis._control.styleProvider = this._styleProvider;\n\t\t\tthis._control.validate();\n\t\t\tthis._appliedStyles = false;\n\t\t\tthis._styleProvider.dispatchEventWith(Event.CHANGE);\n\t\t\tAssert.assertTrue(\"FeathersControl: when style provider dispatches Event.CHANGE, must apply styles after initialization\", this._appliedStyles);\n\t\t}\n\t}\n}\n\nimport feathers.core.IFeathersControl;\nimport feathers.skins.IStyleProvider;\n\nimport starling.events.EventDispatcher;\n\nclass FunctionStyleProviderWithEvents extends EventDispatcher implements IStyleProvider\n{\n\tpublic function FunctionStyleProviderWithEvents(fn:Function)\n\t{\n\t\tthis._fn = fn;\n\t}\n\n\tprivate var _fn:Function;\n\n\tpublic function applyStyles(target:IFeathersControl):void\n\t{\n\t\tthis._fn(target);\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/TabBarEmptyDataProviderTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.TabBar;\n\timport feathers.controls.ToggleButton;\n\timport feathers.data.ListCollection;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\n\tpublic class TabBarEmptyDataProviderTests\n\t{\n\t\tprivate var _tabBar:TabBar;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._tabBar = new TabBar();\n\t\t\tthis._tabBar.tabFactory = function():ToggleButton\n\t\t\t{\n\t\t\t\tvar tab:ToggleButton = new ToggleButton();\n\t\t\t\ttab.defaultSkin = new Quad(200, 200);\n\t\t\t\treturn tab;\n\t\t\t}\n\t\t\tTestFeathers.starlingRoot.addChild(this._tabBar);\n\t\t\tthis._tabBar.validate();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._tabBar.removeFromParent(true);\n\t\t\tthis._tabBar = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoSelection():void\n\t\t{\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was not equal to -1\",\n\t\t\t\t-1, this._tabBar.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was not equal to null\",\n\t\t\t\tnull, this._tabBar.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectFirstItemOnSetDataProvider():void\n\t\t{\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._tabBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar dataProvider:ListCollection = new ListCollection(\n\t\t\t[\n\t\t\t\t{ label: \"One\" },\n\t\t\t\t{ label: \"Two\" },\n\t\t\t\t{ label: \"Three\" },\n\t\t\t]);\n\t\t\tthis._tabBar.dataProvider = dataProvider;\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was not equal to 0\",\n\t\t\t\t0, this._tabBar.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was not equal to the first item\",\n\t\t\t\tdataProvider.getItemAt(0), this._tabBar.selectedItem);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/TabBarMeasurementTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.TabBar;\n\timport feathers.controls.ToggleButton;\n\timport feathers.data.ListCollection;\n\timport feathers.layout.Direction;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class TabBarMeasurementTests\n\t{\n\t\tprivate static const PADDING_TOP:Number = 6;\n\t\tprivate static const PADDING_RIGHT:Number = 8;\n\t\tprivate static const PADDING_BOTTOM:Number = 2;\n\t\tprivate static const PADDING_LEFT:Number = 10;\n\t\tprivate static const GAP:Number = 5;\n\t\tprivate static const FIRST_GAP:Number = 7;\n\t\tprivate static const LAST_GAP:Number = 6;\n\t\tprivate static const TAB_WIDTH:Number = 200;\n\t\tprivate static const TAB_HEIGHT:Number = 100;\n\t\t\n\t\tprivate var _tabs:TabBar;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._tabs = new TabBar();\n\t\t\tthis._tabs.tabFactory = function():ToggleButton\n\t\t\t{\n\t\t\t\tvar tab:ToggleButton = new ToggleButton();\n\t\t\t\ttab.hasLabelTextRenderer = false;\n\t\t\t\ttab.defaultSkin = new Quad(TAB_WIDTH, TAB_HEIGHT, 0xff00ff);\n\t\t\t\treturn tab;\n\t\t\t};\n\t\t\tTestFeathers.starlingRoot.addChild(this._tabs);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._tabs.removeFromParent(true);\n\t\t\tthis._tabs = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testVerticalDimensionsWithNoItems():void\n\t\t{\n\t\t\tthis._tabs.direction = Direction.VERTICAL;\n\t\t\tthis._tabs.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TabBar width not equal to 0 with empty data provider.\",\n\t\t\t\t0, this._tabs.width);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar height not equal to 0 with empty data provider.\",\n\t\t\t\t0, this._tabs.height);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minWidth not equal to 0 with empty data provider.\",\n\t\t\t\t0, this._tabs.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minHeight not equal to 0 with empty data provider.\",\n\t\t\t\t0, this._tabs.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testVerticalDimensionsWithPaddingGapAndNoItems():void\n\t\t{\n\t\t\tthis._tabs.direction = Direction.VERTICAL;\n\t\t\tthis._tabs.paddingTop = PADDING_TOP;\n\t\t\tthis._tabs.paddingRight = PADDING_RIGHT;\n\t\t\tthis._tabs.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._tabs.paddingLeft = PADDING_LEFT;\n\t\t\tthis._tabs.gap = GAP;\n\t\t\tthis._tabs.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TabBar width not equal to sum of left and right padding with empty data provider.\", PADDING_LEFT + PADDING_RIGHT, this._tabs.width);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar height not equal to sum of top and bottom padding with empty data provider.\", PADDING_TOP + PADDING_BOTTOM, this._tabs.height);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minWidth not equal to sum of left and right padding with empty data provider.\", PADDING_LEFT + PADDING_RIGHT, this._tabs.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minHeight not equal to sum of top and bottom padding with empty data provider.\", PADDING_TOP + PADDING_BOTTOM, this._tabs.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testVerticalDimensionsWithOneChild():void\n\t\t{\n\t\t\tthis._tabs.direction = Direction.VERTICAL;\n\t\t\tthis._tabs.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._tabs.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TabBar width not equal to one button width.\", TAB_WIDTH, this._tabs.width);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar height not equal to one button height.\", TAB_HEIGHT, this._tabs.height);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minWidth not equal to one button width.\", TAB_WIDTH, this._tabs.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minHeight not equal to one button height.\", TAB_HEIGHT, this._tabs.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testVerticalDimensionsWithPaddingGapAndOneChild():void\n\t\t{\n\t\t\tthis._tabs.direction = Direction.VERTICAL;\n\t\t\tthis._tabs.paddingTop = PADDING_TOP;\n\t\t\tthis._tabs.paddingRight = PADDING_RIGHT;\n\t\t\tthis._tabs.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._tabs.paddingLeft = PADDING_LEFT;\n\t\t\tthis._tabs.gap = GAP;\n\t\t\tthis._tabs.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._tabs.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TabBar width not equal to sum of left and right padding and width of tab.\", TAB_WIDTH + PADDING_LEFT + PADDING_RIGHT, this._tabs.width);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar height not equal to sum of top and bottom padding and height of tab.\", TAB_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._tabs.height);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minWidth not equal to sum of left and right padding and width of tab.\", TAB_WIDTH + PADDING_LEFT + PADDING_RIGHT, this._tabs.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minHeight not equal to sum of top and bottom padding and height of tab.\", TAB_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._tabs.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testVerticalDimensionsWithTwoChildren():void\n\t\t{\n\t\t\tthis._tabs.direction = Direction.VERTICAL;\n\t\t\tthis._tabs.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._tabs.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TabBar width not equal to max width of tabs.\", TAB_WIDTH, this._tabs.width);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar height not equal to sum of tab heights.\", TAB_HEIGHT * 2, this._tabs.height);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minWidth not equal to max width of tabs.\", TAB_WIDTH, this._tabs.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minHeight not equal to sum of tab heights.\", TAB_HEIGHT * 2, this._tabs.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testVerticalDimensionsWithPaddingGapAndTwoChildren():void\n\t\t{\n\t\t\tthis._tabs.direction = Direction.VERTICAL;\n\t\t\tthis._tabs.paddingTop = PADDING_TOP;\n\t\t\tthis._tabs.paddingRight = PADDING_RIGHT;\n\t\t\tthis._tabs.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._tabs.paddingLeft = PADDING_LEFT;\n\t\t\tthis._tabs.gap = GAP;\n\t\t\tthis._tabs.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._tabs.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TabBar width not equal to sum of left and right padding and max width of tabs.\", TAB_WIDTH + PADDING_LEFT + PADDING_RIGHT, this._tabs.width);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar height not equal to sum of top and bottom padding, gap, and sum of tab heights.\", TAB_HEIGHT * 2 + GAP + PADDING_TOP + PADDING_BOTTOM, this._tabs.height);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minWidth not equal to sum of left and right padding and max width of tabs.\", TAB_WIDTH + PADDING_LEFT + PADDING_RIGHT, this._tabs.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minHeight not equal to sum of top and bottom padding, gap, and sum of tab heights.\", TAB_HEIGHT * 2 + GAP + PADDING_TOP + PADDING_BOTTOM, this._tabs.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testVerticalHeightWithFirstGapAndTwoChildren():void\n\t\t{\n\t\t\tthis._tabs.direction = Direction.VERTICAL;\n\t\t\tthis._tabs.gap = GAP;\n\t\t\tthis._tabs.firstGap = FIRST_GAP;\n\t\t\tthis._tabs.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._tabs.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TabBar height not equal to first gap plus sum of tab heights.\", TAB_HEIGHT * 2 + FIRST_GAP, this._tabs.height);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minHeight not equal to first gap plus sum of tab heights.\", TAB_HEIGHT * 2 + FIRST_GAP, this._tabs.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testVerticalHeightWithLastGapAndTwoChildren():void\n\t\t{\n\t\t\tthis._tabs.direction = Direction.VERTICAL;\n\t\t\tthis._tabs.gap = GAP;\n\t\t\tthis._tabs.lastGap = LAST_GAP;\n\t\t\tthis._tabs.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._tabs.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TabBar height not equal to gap plus sum of tab heights when using last gap with two tabs.\", TAB_HEIGHT * 2 + GAP, this._tabs.height);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minHeight not equal to gap plus sum of tab heights when using last gap with two tabs.\", TAB_HEIGHT * 2 + GAP, this._tabs.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testVerticalHeightWithFirstGapAndThreeChildren():void\n\t\t{\n\t\t\tthis._tabs.direction = Direction.VERTICAL;\n\t\t\tthis._tabs.gap = GAP;\n\t\t\tthis._tabs.firstGap = FIRST_GAP;\n\t\t\tthis._tabs.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._tabs.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TabBar height not equal to sum of tab heights, plus first gap, plus gap, with three tabs.\", TAB_HEIGHT * 3 + GAP + FIRST_GAP, this._tabs.height);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minHeight not equal to sum of tab heights, plus first gap, plus gap, with three tabs.\", TAB_HEIGHT * 3 + GAP + FIRST_GAP, this._tabs.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testVerticalHeightWithLastGapAndThreeChildren():void\n\t\t{\n\t\t\tthis._tabs.direction = Direction.VERTICAL;\n\t\t\tthis._tabs.gap = GAP;\n\t\t\tthis._tabs.lastGap = LAST_GAP;\n\t\t\tthis._tabs.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._tabs.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TabBar height not equal to sum of tab heights, plus gap, plus last gap, with three tabs.\", TAB_HEIGHT * 3 + GAP + LAST_GAP, this._tabs.height);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minHeight not equal to sum of tab heights, plus gap, plus last gap, with three tabs.\", TAB_HEIGHT * 3 + GAP + LAST_GAP, this._tabs.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testVerticalHeightWithFirstAndLastGapAndFourChildren():void\n\t\t{\n\t\t\tthis._tabs.direction = Direction.VERTICAL;\n\t\t\tthis._tabs.gap = GAP;\n\t\t\tthis._tabs.firstGap = FIRST_GAP;\n\t\t\tthis._tabs.lastGap = LAST_GAP;\n\t\t\tthis._tabs.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._tabs.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TabBar height not equal to sum of tab heights, plus first gap, plus gap, plus last gap, with four tabs.\", TAB_HEIGHT * 4 + FIRST_GAP + GAP + LAST_GAP, this._tabs.height);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minHeight not equal to sum of tab heights, plus first gap, plus gap, plus last gap, with four tabs.\", TAB_HEIGHT * 4 + FIRST_GAP + GAP + LAST_GAP, this._tabs.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHorizontalDimensionsWithNoChildren():void\n\t\t{\n\t\t\tthis._tabs.direction = Direction.HORIZONTAL;\n\t\t\tthis._tabs.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TabBar width not equal to 0 with no tabs.\", 0, this._tabs.width);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar height not equal to 0 with no tabs.\", 0, this._tabs.height);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minWidth not equal to 0 with no tabs.\", 0, this._tabs.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minHeight not equal to 0 with no tabs.\", 0, this._tabs.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHorizontalDimensionsWithPaddingGapAndNoChildren():void\n\t\t{\n\t\t\tthis._tabs.direction = Direction.HORIZONTAL;\n\t\t\tthis._tabs.paddingTop = PADDING_TOP;\n\t\t\tthis._tabs.paddingRight = PADDING_RIGHT;\n\t\t\tthis._tabs.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._tabs.paddingLeft = PADDING_LEFT;\n\t\t\tthis._tabs.gap = GAP;\n\t\t\tthis._tabs.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TabBar width not equal to sum of left and right padding with no tabs.\", PADDING_LEFT + PADDING_RIGHT, this._tabs.width);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar height not equal to sum of top and bottom padding with no tabs.\", PADDING_TOP + PADDING_BOTTOM, this._tabs.height);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minWidth not equal to sum of left and right padding with no tabs.\", PADDING_LEFT + PADDING_RIGHT, this._tabs.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minHeight not equal to sum of top and bottom padding with no tabs.\", PADDING_TOP + PADDING_BOTTOM, this._tabs.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHorizontalDimensionsWithOneChild():void\n\t\t{\n\t\t\tthis._tabs.direction = Direction.HORIZONTAL;\n\t\t\tthis._tabs.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._tabs.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TabBar width not equal to tab width.\", TAB_WIDTH, this._tabs.width);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar height not equal to tab height.\", TAB_HEIGHT, this._tabs.height);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minWidth not equal to tab width.\", TAB_WIDTH, this._tabs.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minHeight not equal to tab height.\", TAB_HEIGHT, this._tabs.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHorizontalDimensionsWithPaddingGapAndOneChild():void\n\t\t{\n\t\t\tthis._tabs.direction = Direction.HORIZONTAL;\n\t\t\tthis._tabs.paddingTop = PADDING_TOP;\n\t\t\tthis._tabs.paddingRight = PADDING_RIGHT;\n\t\t\tthis._tabs.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._tabs.paddingLeft = PADDING_LEFT;\n\t\t\tthis._tabs.gap = GAP;\n\t\t\tthis._tabs.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._tabs.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TabBar width not equal to sum of left and right padding and width of tab.\", TAB_WIDTH + PADDING_LEFT + PADDING_RIGHT, this._tabs.width);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar height not equal to sum of top and bottom padding and height of tab.\", TAB_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._tabs.height);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minWidth not equal to sum of left and right padding and width of tab.\", TAB_WIDTH + PADDING_LEFT + PADDING_RIGHT, this._tabs.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minHeight not equal to sum of top and bottom padding and height of tab.\", TAB_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._tabs.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHorizontalDimensionsWithTwoChildren():void\n\t\t{\n\t\t\tthis._tabs.direction = Direction.HORIZONTAL;\n\t\t\tthis._tabs.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._tabs.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TabBar width not equal to sum of tab widths.\", TAB_WIDTH * 2, this._tabs.width);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar height not equal to max height of tabs.\", TAB_HEIGHT, this._tabs.height);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minWidth not equal to sum of tab widths.\", TAB_WIDTH * 2, this._tabs.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minHeight not equal to max height of tabs.\", TAB_HEIGHT, this._tabs.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHorizontalDimensionsWithPaddingGapAndTwoChildren():void\n\t\t{\n\t\t\tthis._tabs.direction = Direction.HORIZONTAL;\n\t\t\tthis._tabs.paddingTop = PADDING_TOP;\n\t\t\tthis._tabs.paddingRight = PADDING_RIGHT;\n\t\t\tthis._tabs.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._tabs.paddingLeft = PADDING_LEFT;\n\t\t\tthis._tabs.gap = GAP;\n\t\t\tthis._tabs.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._tabs.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TabBar width not equal to sum of left and right padding, gap, and sum of tab widths.\", TAB_WIDTH * 2 + GAP + PADDING_LEFT + PADDING_RIGHT, this._tabs.width);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar height not equal to sum of top and bottom padding and max height of tabs.\", TAB_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._tabs.height);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minWidth not equal to sum of left and right padding, gap, and sum of tab widths.\", TAB_WIDTH * 2 + GAP + PADDING_LEFT + PADDING_RIGHT, this._tabs.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minHeight not equal to sum of top and bottom padding and max height of tabs.\", TAB_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this._tabs.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHorizontalWidthWithGapAndTwoChildren():void\n\t\t{\n\t\t\tthis._tabs.direction = Direction.HORIZONTAL;\n\t\t\tthis._tabs.gap = GAP;\n\t\t\tthis._tabs.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._tabs.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TabBar width not equal to gap plus sum of tab widths.\", TAB_WIDTH * 2 + GAP, this._tabs.width);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minWidth not equal to gap plus sum of tab widths.\", TAB_WIDTH * 2 + GAP, this._tabs.minWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHorizontalWidthWithFirstGapAndTwoChildren():void\n\t\t{\n\t\t\tthis._tabs.direction = Direction.HORIZONTAL;\n\t\t\tthis._tabs.gap = GAP;\n\t\t\tthis._tabs.firstGap = FIRST_GAP;\n\t\t\tthis._tabs.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._tabs.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TabBar width not equal to gap plus sum of tab widths.\", TAB_WIDTH * 2 + FIRST_GAP, this._tabs.width);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minWidth not equal to gap plus sum of tab widths.\", TAB_WIDTH * 2 + FIRST_GAP, this._tabs.minWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHorizontalWidthWithLastGapAndTwoChildren():void\n\t\t{\n\t\t\tthis._tabs.direction = Direction.HORIZONTAL;\n\t\t\tthis._tabs.gap = GAP;\n\t\t\tthis._tabs.lastGap = LAST_GAP;\n\t\t\tthis._tabs.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._tabs.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TabBar width not equal to gap plus sum of tab widths when using last gap with two tabs.\", TAB_WIDTH * 2 + GAP, this._tabs.width);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minWidth not equal to gap plus sum of tab widths when using last gap with two tabs.\", TAB_WIDTH * 2 + GAP, this._tabs.minWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHorizontalWidthWithFirstGapAndThreeChildren():void\n\t\t{\n\t\t\tthis._tabs.direction = Direction.HORIZONTAL;\n\t\t\tthis._tabs.gap = GAP;\n\t\t\tthis._tabs.firstGap = FIRST_GAP;\n\t\t\tthis._tabs.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._tabs.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TabBar width not equal to sum of tab widths, plus first gap, plus gap, with three tabs.\", TAB_WIDTH * 3 + GAP + FIRST_GAP, this._tabs.width);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minWidth not equal to sum of tab widths, plus first gap, plus gap, with three tabs.\", TAB_WIDTH * 3 + GAP + FIRST_GAP, this._tabs.minWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHorizontalWidthWithLastGapAndThreeChildren():void\n\t\t{\n\t\t\tthis._tabs.direction = Direction.HORIZONTAL;\n\t\t\tthis._tabs.gap = GAP;\n\t\t\tthis._tabs.lastGap = LAST_GAP;\n\t\t\tthis._tabs.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._tabs.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TabBar width not equal to sum of tab widths, plus gap, plus last gap, with three tabs.\", TAB_WIDTH * 3 + GAP + LAST_GAP, this._tabs.width);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minWidth not equal to sum of tab widths, plus gap, plus last gap, with three tabs.\", TAB_WIDTH * 3 + GAP + LAST_GAP, this._tabs.minWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHorizontalWidthWithFirstAndLastGapAndFourChildren():void\n\t\t{\n\t\t\tthis._tabs.direction = Direction.HORIZONTAL;\n\t\t\tthis._tabs.gap = GAP;\n\t\t\tthis._tabs.firstGap = FIRST_GAP;\n\t\t\tthis._tabs.lastGap = LAST_GAP;\n\t\t\tthis._tabs.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t\t{},\n\t\t\t]);\n\t\t\tthis._tabs.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TabBar width not equal to sum of tab widths, plus first gap, plus gap, plus last gap, with four tabs.\", TAB_WIDTH * 4 + FIRST_GAP + GAP + LAST_GAP, this._tabs.width);\n\t\t\tAssert.assertStrictlyEquals(\"TabBar minWidth not equal to sum of tab widths, plus first gap, plus gap, plus last gap, with four tabs.\", TAB_WIDTH * 4 + FIRST_GAP + GAP + LAST_GAP, this._tabs.minWidth);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/TabBarTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.TabBar;\n\timport feathers.controls.ToggleButton;\n\timport feathers.data.ListCollection;\n\timport feathers.tests.supportClasses.DisposeFlagQuad;\n\n\timport flash.geom.Point;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\tpublic class TabBarTests\n\t{\n\t\tprivate var _tabBar:TabBar;\n\t\tprivate var _icon:DisposeFlagQuad;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._icon = new DisposeFlagQuad();\n\n\t\t\tthis._tabBar = new TabBar();\n\t\t\tthis._tabBar.dataProvider = new ListCollection(\n\t\t\t[\n\t\t\t\t{ label: \"One\", name: \"one\" },\n\t\t\t\t{ label: \"Two\" },\n\t\t\t\t{ label: \"Three\", isEnabled: true, name: \"three\", defaultIcon: this._icon },\n\t\t\t\t{ label: \"Four\", isEnabled: false, name: \"four\" },\n\t\t\t]);\n\t\t\tthis._tabBar.tabFactory = function():ToggleButton\n\t\t\t{\n\t\t\t\tvar tab:ToggleButton = new ToggleButton();\n\t\t\t\ttab.defaultSkin = new Quad(200, 200);\n\t\t\t\treturn tab;\n\t\t\t}\n\t\t\tTestFeathers.starlingRoot.addChild(this._tabBar);\n\t\t\tthis._tabBar.validate();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._tabBar.removeFromParent(true);\n\t\t\tthis._tabBar = null;\n\n\t\t\tthis._icon.removeFromParent(true);\n\t\t\tthis._icon = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testProgrammaticSelectedIndexChange():void\n\t\t{\n\t\t\tvar beforeSelectedIndex:int = this._tabBar.selectedIndex;\n\t\t\tvar beforeSelectedItem:Object = this._tabBar.selectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._tabBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._tabBar.selectedIndex = 1;\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertFalse(\"The selectedIndex property was not changed\",\n\t\t\t\tbeforeSelectedIndex === this._tabBar.selectedIndex);\n\t\t\tAssert.assertFalse(\"The selectedItem property was not changed\",\n\t\t\t\tbeforeSelectedItem === this._tabBar.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testProgrammaticSelectedItemChange():void\n\t\t{\n\t\t\tvar beforeSelectedIndex:int = this._tabBar.selectedIndex;\n\t\t\tvar beforeSelectedItem:Object = this._tabBar.selectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._tabBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._tabBar.selectedItem = this._tabBar.dataProvider.getItemAt(1);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertFalse(\"The selectedIndex property was not changed\",\n\t\t\t\tbeforeSelectedIndex === this._tabBar.selectedIndex);\n\t\t\tAssert.assertFalse(\"The selectedItem property was not changed\",\n\t\t\t\tbeforeSelectedItem === this._tabBar.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testProgrammaticSelectedIndexChangeWithAnimation():void\n\t\t{\n\t\t\tvar beforeSelectedIndex:int = this._tabBar.selectedIndex;\n\t\t\tvar beforeSelectedItem:Object = this._tabBar.selectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._tabBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._tabBar.setSelectedIndexWithAnimation(1);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertFalse(\"The selectedIndex property was not changed\",\n\t\t\t\tbeforeSelectedIndex === this._tabBar.selectedIndex);\n\t\t\tAssert.assertFalse(\"The selectedItem property was not changed\",\n\t\t\t\tbeforeSelectedItem === this._tabBar.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testProgrammaticSelectedItemChangeWithAnimation():void\n\t\t{\n\t\t\tvar beforeSelectedIndex:int = this._tabBar.selectedIndex;\n\t\t\tvar beforeSelectedItem:Object = this._tabBar.selectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._tabBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._tabBar.setSelectedItemWithAnimation(this._tabBar.dataProvider.getItemAt(1));\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertFalse(\"The selectedIndex property was not changed\",\n\t\t\t\tbeforeSelectedIndex === this._tabBar.selectedIndex);\n\t\t\tAssert.assertFalse(\"The selectedItem property was not changed\",\n\t\t\t\tbeforeSelectedItem === this._tabBar.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInteractiveSelectionChange():void\n\t\t{\n\t\t\tvar beforeSelectedIndex:int = this._tabBar.selectedIndex;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._tabBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(210, 10);\n\t\t\tvar target:DisplayObject = this._tabBar.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t//this touch does not move at all, so it should result in triggering\n\t\t\t//the button.\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertFalse(\"The selectedIndex property was not changed\",\n\t\t\t\tbeforeSelectedIndex === this._tabBar.selectedIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemBeforeSelectedIndex():void\n\t\t{\n\t\t\tthis._tabBar.selectedIndex = 1;\n\t\t\tvar beforeSelectedIndex:int = this._tabBar.selectedIndex;\n\t\t\tvar beforeSelectedItem:Object = this._tabBar.selectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._tabBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._tabBar.dataProvider.removeItemAt(0);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was not changed\",\n\t\t\t\tbeforeSelectedIndex - 1, this._tabBar.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was incorrectly changed\",\n\t\t\t\tbeforeSelectedItem, this._tabBar.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemAfterSelectedIndex():void\n\t\t{\n\t\t\tthis._tabBar.selectedIndex = 1;\n\t\t\tvar beforeSelectedIndex:int = this._tabBar.selectedIndex;\n\t\t\tvar beforeSelectedItem:Object = this._tabBar.selectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._tabBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._tabBar.dataProvider.removeItemAt(2);\n\t\t\tAssert.assertFalse(\"Event.CHANGE was incorrectly dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was incorrectly changed\",\n\t\t\t\tbeforeSelectedIndex, this._tabBar.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was incorrectly changed\",\n\t\t\t\tbeforeSelectedItem, this._tabBar.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveSelectedIndex():void\n\t\t{\n\t\t\tthis._tabBar.selectedIndex = 1;\n\t\t\tvar beforeSelectedIndex:int = this._tabBar.selectedIndex;\n\t\t\tvar beforeSelectedItem:Object = this._tabBar.selectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._tabBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._tabBar.dataProvider.removeItemAt(1);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was incorrectly changed\",\n\t\t\t\tbeforeSelectedIndex, this._tabBar.selectedIndex);\n\t\t\tAssert.assertFalse(\"The selectedItem property was not changed\",\n\t\t\t\tbeforeSelectedItem === this._tabBar.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testReplaceItemAtSelectedIndex():void\n\t\t{\n\t\t\tthis._tabBar.selectedIndex = 1;\n\t\t\tvar beforeSelectedIndex:int = this._tabBar.selectedIndex;\n\t\t\tvar beforeSelectedItem:Object = this._tabBar.selectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._tabBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._tabBar.dataProvider.setItemAt({ label: \"New Item\" }, beforeSelectedIndex);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was incorrectly changed\",\n\t\t\t\tbeforeSelectedIndex, this._tabBar.selectedIndex);\n\t\t\tAssert.assertFalse(\"The selectedItem property was not changed\",\n\t\t\t\tbeforeSelectedItem === this._tabBar.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDeselectAllOnNullDataProvider():void\n\t\t{\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._tabBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._tabBar.dataProvider = null;\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was not set to -1\",\n\t\t\t\t-1, this._tabBar.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was not set to null\",\n\t\t\t\tnull, this._tabBar.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDeselectAllOnDataProviderRemoveAll():void\n\t\t{\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._tabBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._tabBar.dataProvider.removeAll();\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was not set to -1\",\n\t\t\t\t-1, this._tabBar.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was not set to null\",\n\t\t\t\tnull, this._tabBar.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemBeforeSelectedIndex():void\n\t\t{\n\t\t\tthis._tabBar.selectedIndex = 1;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tvar beforeSelectedIndex:int = this._tabBar.selectedIndex;\n\t\t\tvar beforeSelectedItem:Object = this._tabBar.selectedItem;\n\t\t\tthis._tabBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._tabBar.dataProvider.addItemAt({label: \"New Item\"}, 0);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was not changed\",\n\t\t\t\tbeforeSelectedIndex + 1, this._tabBar.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was incorrectly changed\",\n\t\t\t\tbeforeSelectedItem, this._tabBar.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDisposeWithoutChangeEvent():void\n\t\t{\n\t\t\tthis._tabBar.selectedIndex = 1;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._tabBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._tabBar.dispose();\n\t\t\tAssert.assertFalse(\"Event.CHANGE was incorrectly dispatched\", hasChanged);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDisableAndReenable():void\n\t\t{\n\t\t\tthis._tabBar.isEnabled = false;\n\t\t\tthis._tabBar.validate();\n\t\t\tthis._tabBar.isEnabled = true;\n\t\t\tthis._tabBar.validate();\n\t\t\tvar tab1:ToggleButton = ToggleButton(this._tabBar.getChildByName(\"one\"));\n\t\t\tvar tab3:ToggleButton = ToggleButton(this._tabBar.getChildByName(\"three\"));\n\t\t\tvar tab4:ToggleButton = ToggleButton(this._tabBar.getChildByName(\"four\"));\n\t\t\tAssert.assertTrue(\"Tab without isEnabled value in data provider is not enabled when TabBar is disabled and then re-enabled\", tab1.isEnabled);\n\t\t\tAssert.assertTrue(\"Tab with isEnabled value set to true in data provider is not enabled when TabBar is disabled and then re-enabled\", tab3.isEnabled);\n\t\t\tAssert.assertFalse(\"Tab with isEnabled value set to false in data provider is not disabled when TabBar is disabled and then re-enabled\", tab4.isEnabled);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDisable():void\n\t\t{\n\t\t\tthis._tabBar.isEnabled = false;\n\t\t\tthis._tabBar.validate();\n\t\t\tvar tab1:ToggleButton = ToggleButton(this._tabBar.getChildByName(\"one\"));\n\t\t\tvar tab3:ToggleButton = ToggleButton(this._tabBar.getChildByName(\"three\"));\n\t\t\tvar tab4:ToggleButton = ToggleButton(this._tabBar.getChildByName(\"four\"));\n\t\t\tAssert.assertFalse(\"Tab without isEnabled value in data provider is incorrectly enabled when TabBar is disabled\", tab1.isEnabled);\n\t\t\tAssert.assertFalse(\"Tab with isEnabled value set to true in data provider is incorrectly enabled when TabBar is disabled\", tab3.isEnabled);\n\t\t\tAssert.assertFalse(\"Tab with isEnabled value set to false in data provider is incorrectly enabled when TabBar is disabled\", tab4.isEnabled);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testIconNotDisposed():void\n\t\t{\n\t\t\tthis._tabBar.validate();\n\t\t\tthis._tabBar.dispose();\n\t\t\tAssert.assertFalse(\"Tab icon incorrectly disposed.\", this._icon.isDisposed);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFilterAll():void\n\t\t{\n\t\t\tvar selectedIndex:int = 1;\n\t\t\tthis._tabBar.selectedIndex = selectedIndex;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._tabBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar selectedItem:Object = this._tabBar.dataProvider.getItemAt(selectedIndex);\n\t\t\tthis._tabBar.dataProvider.filterFunction = function(item:Object):Boolean\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t};\n\t\t\tAssert.assertTrue(\"Event.CHANGE must be dispatched when all items are filtered\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property must be -1 if all items are filtered\",\n\t\t\t\t-1, this._tabBar.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property must be null if all items are filtered\",\n\t\t\t\tnull, this._tabBar.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFilterSelectedIndex():void\n\t\t{\n\t\t\tvar selectedIndex:int = 1;\n\t\t\tvar newSelectedItem:Object = this._tabBar.dataProvider.getItemAt(selectedIndex + 1);\n\t\t\tthis._tabBar.selectedIndex = 1;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._tabBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar selectedItem:Object = this._tabBar.dataProvider.getItemAt(selectedIndex);\n\t\t\tthis._tabBar.dataProvider.filterFunction = function(item:Object):Boolean\n\t\t\t{\n\t\t\t\treturn item !== selectedItem;\n\t\t\t};\n\t\t\tAssert.assertTrue(\"Event.CHANGE must be dispatched when item is filtered\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property must not change when selected item is filtered\",\n\t\t\t\tselectedIndex, this._tabBar.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was not changed when selected item is filtered\",\n\t\t\t\tnewSelectedItem, this._tabBar.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFilterSelectedIndexGreaterThanNewLength():void\n\t\t{\n\t\t\tvar selectedIndex:int = 3;\n\t\t\tvar newSelectedItem:Object = this._tabBar.dataProvider.getItemAt(selectedIndex - 1);\n\t\t\tthis._tabBar.selectedIndex = selectedIndex;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._tabBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar selectedItem:Object = this._tabBar.dataProvider.getItemAt(selectedIndex);\n\t\t\tthis._tabBar.dataProvider.filterFunction = function(item:Object):Boolean\n\t\t\t{\n\t\t\t\treturn item !== selectedItem;\n\t\t\t};\n\t\t\tAssert.assertTrue(\"Event.CHANGE must be dispatched when item is filtered\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was not changed when selected item is filtered and index is >= length\",\n\t\t\t\tselectedIndex - 1, this._tabBar.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was not changed when selected item is filtered\",\n\t\t\t\tnewSelectedItem, this._tabBar.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectionChangeOnSortChange():void\n\t\t{\n\t\t\tthis._tabBar.selectedIndex = this._tabBar.dataProvider.length - 1;\n\t\t\tvar oldSelectedItem:Object = this._tabBar.dataProvider.getItemAt(this._tabBar.dataProvider.length - 1);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._tabBar.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._tabBar.dataProvider.sortCompareFunction = function(a:Object, b:Object):int\n\t\t\t{\n\t\t\t\tvar aIndex:int = _tabBar.dataProvider.getItemIndex(a);\n\t\t\t\tvar bIndex:int = _tabBar.dataProvider.getItemIndex(b);\n\t\t\t\tif(aIndex < bIndex)\n\t\t\t\t{\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\telse if(aIndex > bIndex)\n\t\t\t\t{\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tthis._tabBar.dataProvider.refresh();\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"Incorrect selectedIndex after sort change\",\n\t\t\t\t0, this._tabBar.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"Incorrect selectedItem after sort change\",\n\t\t\t\toldSelectedItem, this._tabBar.selectedItem);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/TabNavigatorTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.TabNavigator;\n\timport feathers.controls.TabNavigatorItem;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\n\tpublic class TabNavigatorTests\n\t{\n\t\tpublic static const SCREEN_A_ID:String = \"a\";\n\t\tpublic static const SCREEN_B_ID:String = \"b\";\n\t\tpublic static const SCREEN_A_LABEL:String = \"Screen A\";\n\t\tpublic static const SCREEN_B_LABEL:String = \"Screen B\";\n\n\t\tprivate var _navigator:TabNavigator;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._navigator = new TabNavigator();\n\t\t\tTestFeathers.starlingRoot.addChild(this._navigator);\n\t\t\tthis._navigator.validate();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._navigator.removeFromParent(true);\n\t\t\tthis._navigator = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\",\n\t\t\t\t0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\tprivate function addScreenA():void\n\t\t{\n\t\t\tvar screen:Quad = new Quad(10, 10, 0xff00ff);\n\t\t\tvar item:TabNavigatorItem = new TabNavigatorItem(screen, SCREEN_A_LABEL);\n\t\t\tthis._navigator.addScreen(SCREEN_A_ID, item);\n\t\t\tAssert.assertStrictlyEquals(\"screenDisplayObject does not return correct value\",\n\t\t\t\tscreen, item.screenDisplayObject);\n\t\t}\n\n\t\tprivate function addScreenB():void\n\t\t{\n\t\t\tvar screen:Quad = new Quad(10, 10, 0xffff00);\n\t\t\tvar item:TabNavigatorItem = new TabNavigatorItem(screen, SCREEN_B_LABEL);\n\t\t\tthis._navigator.addScreen(SCREEN_B_ID, item);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHasScreenWhenNotAdded():void\n\t\t{\n\t\t\tAssert.assertFalse(\"hasScreen() incorrectly returned true for a screen that was not added\",\n\t\t\t\tthis._navigator.hasScreen(SCREEN_A_ID));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHasScreen():void\n\t\t{\n\t\t\tthis.addScreenA();\n\t\t\tAssert.assertTrue(\"hasScreen() incorrectly returned false for a screen that was added\",\n\t\t\t\tthis._navigator.hasScreen(SCREEN_A_ID));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testStateWithNoTabs():void\n\t\t{\n\t\t\tAssert.assertNull(\"activeScreen returned incorrect value for no tabs\",\n\t\t\t\tthis._navigator.activeScreen);\n\t\t\tAssert.assertNull(\"activeScreenID returned incorrect value for no tabs\",\n\t\t\t\tthis._navigator.activeScreenID);\n\t\t\tAssert.assertStrictlyEquals(\"selectedIndex returned incorrect value for no tabs\",\n\t\t\t\t-1, this._navigator.selectedIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testStateWithOneTab():void\n\t\t{\n\t\t\tthis.addScreenA();\n\t\t\tAssert.assertStrictlyEquals(\"activeScreen returned incorrect value for first tab\",\n\t\t\t\tthis._navigator.getScreen(SCREEN_A_ID).screenDisplayObject, this._navigator.activeScreen);\n\t\t\tAssert.assertStrictlyEquals(\"activeScreenID returned incorrect value for first tab\",\n\t\t\t\tSCREEN_A_ID, this._navigator.activeScreenID);\n\t\t\tAssert.assertStrictlyEquals(\"selectedIndex returned incorrect value for first tab\",\n\t\t\t\t0, this._navigator.selectedIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetSelectedIndexToNegativeOne():void\n\t\t{\n\t\t\tthis.addScreenA();\n\t\t\tthis._navigator.selectedIndex = -1;\n\t\t\tAssert.assertNull(\"activeScreen returned incorrect value after selectedIndex = -1\",\n\t\t\t\tthis._navigator.activeScreen);\n\t\t\tAssert.assertNull(\"activeScreenID returned incorrect value after selectedIndex = -1\",\n\t\t\t\tthis._navigator.activeScreenID);\n\t\t\tAssert.assertStrictlyEquals(\"selectedIndex returned incorrect value after selectedIndex = -1\",\n\t\t\t\t-1, this._navigator.selectedIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChangeSelectedIndex():void\n\t\t{\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis.addScreenA();\n\t\t\tthis.addScreenB();\n\t\t\tvar newSelectedIndex:int = -1;\n\t\t\tvar newActiveScreen:DisplayObject;\n\t\t\tvar newActiveScreenID:String;\n\t\t\tthis._navigator.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\tvar navigator:TabNavigator = TabNavigator(event.currentTarget);\n\t\t\t\tnewSelectedIndex = navigator.selectedIndex;\n\t\t\t\tnewActiveScreen = navigator.activeScreen;\n\t\t\t\tnewActiveScreenID = navigator.activeScreenID;\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._navigator.selectedIndex = 1;\n\t\t\tAssert.assertStrictlyEquals(\"activeScreen returned incorrect value for second tab after set selectedIndex\",\n\t\t\t\tthis._navigator.getScreen(SCREEN_B_ID).screenDisplayObject, newActiveScreen);\n\t\t\tAssert.assertStrictlyEquals(\"activeScreenID returned incorrect value for second tab after set selectedIndex\",\n\t\t\t\tSCREEN_B_ID, newActiveScreenID);\n\t\t\tAssert.assertStrictlyEquals(\"selectedIndex returned incorrect value for second tab after set selectedIndex\",\n\t\t\t\t1, newSelectedIndex);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\",\n\t\t\t\thasChanged);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testShowScreen():void\n\t\t{\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis.addScreenA();\n\t\t\tthis.addScreenB();\n\t\t\tvar newSelectedIndex:int = -1;\n\t\t\tvar newActiveScreen:DisplayObject;\n\t\t\tvar newActiveScreenID:String;\n\t\t\tthis._navigator.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\tvar navigator:TabNavigator = TabNavigator(event.currentTarget);\n\t\t\t\tnewSelectedIndex = navigator.selectedIndex;\n\t\t\t\tnewActiveScreen = navigator.activeScreen;\n\t\t\t\tnewActiveScreenID = navigator.activeScreenID;\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._navigator.showScreen(SCREEN_B_ID);\n\t\t\tAssert.assertStrictlyEquals(\"activeScreen returned incorrect value for second tab after showScreen()\",\n\t\t\t\tthis._navigator.getScreen(SCREEN_B_ID).screenDisplayObject, newActiveScreen);\n\t\t\tAssert.assertStrictlyEquals(\"activeScreenID returned incorrect value for second tab after showScreen()\",\n\t\t\t\tSCREEN_B_ID, newActiveScreenID);\n\t\t\tAssert.assertStrictlyEquals(\"selectedIndex returned incorrect value for second tab after showScreen()\",\n\t\t\t\t1, newSelectedIndex);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\",\n\t\t\t\thasChanged);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/TapToSelectTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.tests.supportClasses.CustomToggle;\n\timport feathers.utils.touch.TapToSelect;\n\n\timport flash.geom.Point;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\tpublic class TapToSelectTests\n\t{\n\t\tprivate var _target:CustomToggle;\n\t\tprivate var _blocker:Quad;\n\t\tprivate var _tapToSelect:TapToSelect;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._target = new CustomToggle();\n\t\t\tTestFeathers.starlingRoot.addChild(this._target);\n\t\t\tthis._target.validate();\n\n\t\t\tthis._tapToSelect = new TapToSelect(this._target);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._target.removeFromParent(true);\n\t\t\tthis._target = null;\n\n\t\t\tif(this._blocker)\n\t\t\t{\n\t\t\t\tthis._blocker.removeFromParent(true);\n\t\t\t\tthis._blocker = null;\n\t\t\t}\n\n\t\t\tthis._tapToSelect = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChangeEvent():void\n\t\t{\n\t\t\tthis._target.isSelected = false;\n\t\t\t\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._target.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._target.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t//this touch does not move at all, so it should result in triggering\n\t\t\t//the button.\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"isSelected was not changed to true after tap\", this._target.isSelected);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDisabled():void\n\t\t{\n\t\t\tthis._target.isSelected = false;\n\t\t\tthis._tapToSelect.isEnabled = false;\n\t\t\t\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._target.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._target.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t//this touch does not move at all, so it should result in triggering\n\t\t\t//the button.\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertFalse(\"Event.CHANGE was incorrectly dispatched when disabled\", hasChanged);\n\t\t\tAssert.assertFalse(\"isSelected was incorrectly changed to true after tap when disabled\", this._target.isSelected);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTouchMoveOutsideBeforeChangeEvent():void\n\t\t{\n\t\t\tthis._target.isSelected = false;\n\t\t\t\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._target.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._target.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.globalX = 1000; //move the touch way outside the bounds of the button\n\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertFalse(\"Event.CHANGE was incorrectly dispatched after touch moved out of bounds\", hasChanged);\n\t\t\tAssert.assertFalse(\"isSelected was incorrectly changed to true after touch moved out of bounds\", this._target.isSelected);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testOtherDisplayObjectBlockingChangeEvent():void\n\t\t{\n\t\t\tthis._target.isSelected = false;\n\t\t\t\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._target.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._target.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tthis._blocker = new Quad(200, 200, 0xff0000);\n\t\t\tTestFeathers.starlingRoot.addChild(this._blocker);\n\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertFalse(\"Event.CHANGE was incorrectly dispatched when another display object blocked the touch\", hasChanged);\n\t\t\tAssert.assertFalse(\"isSelected was incorrectly changed to true when another display object blocked the touch\", this._target.isSelected);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDeselect():void\n\t\t{\n\t\t\tthis._tapToSelect.tapToDeselect = true;\n\t\t\tthis._target.isSelected = true;\n\t\t\t\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._target.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t//this touch does not move at all, so it should result in triggering\n\t\t\t//the button.\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertFalse(\"isSelected was not changed to false when tapToDeselect set to true\", this._target.isSelected);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDisabledDeselect():void\n\t\t{\n\t\t\tthis._tapToSelect.tapToDeselect = false;\n\t\t\tthis._target.isSelected = true;\n\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._target.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t//this touch does not move at all, so it should result in triggering\n\t\t\t//the button.\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertTrue(\"isSelected was incorrectly changed to false when tapToDeselect set to false\", this._target.isSelected);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemovedBeforeTriggeredEvent():void\n\t\t{\n\t\t\tthis._target.isSelected = false;\n\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._target.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._target.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tthis._target.removeFromParent(false);\n\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\t//while it's good to check that Event.CHANGE isn't dispatched,\n\t\t\t//this test also ensures that no runtime errors are thrown after the\n\t\t\t//target is removed (its stage property is null, and that is used\n\t\t\t//by TapToSelect)\n\n\t\t\tAssert.assertFalse(\"Event.CHANGE was incorrectly dispatched when target was removed\", hasChanged);\n\t\t\tAssert.assertFalse(\"isSelected was incorrectly changed to true when target was removed\", this._target.isSelected);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCustomHitTest():void\n\t\t{\n\t\t\tthis._tapToSelect.customHitTest = function customHitTest(localPosition:Point):Boolean\n\t\t\t{\n\t\t\t\treturn localPosition.x <= 100;\n\t\t\t};\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._target.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._target.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched when customHitTest returned true\", hasChanged);\n\n\t\t\thasChanged = false;\n\t\t\t//move the touch to an area where customHitTest() will return false\n\t\t\ttouch.globalX = 150;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertFalse(\"Event.CHANGE was incorrectly dispatched when customHitTest returned false\", hasChanged);\n\n\t\t\thasChanged = false;\n\t\t\t//move the touch way outside the bounds of the target\n\t\t\ttouch.globalX = 1000;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertFalse(\"Event.CHANGE was incorrectly dispatched when touch started out of bounds\", hasChanged);\n\t\t}\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/TapToTriggerTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.utils.touch.TapToTrigger;\n\n\timport flash.geom.Point;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\tpublic class TapToTriggerTests\n\t{\n\t\tprivate var _target:Quad;\n\t\tprivate var _blocker:Quad;\n\t\tprivate var _tapToTrigger:TapToTrigger;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._target = new Quad(200, 200, 0xff00ff);\n\t\t\tTestFeathers.starlingRoot.addChild(this._target);\n\n\t\t\tthis._tapToTrigger = new TapToTrigger(this._target);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._target.removeFromParent(true);\n\t\t\tthis._target = null;\n\n\t\t\tif(this._blocker)\n\t\t\t{\n\t\t\t\tthis._blocker.removeFromParent(true);\n\t\t\t\tthis._blocker = null;\n\t\t\t}\n\n\t\t\tthis._tapToTrigger = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTriggeredEvent():void\n\t\t{\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tthis._target.addEventListener(Event.TRIGGERED, function(event:Event):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._target.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t//this touch does not move at all, so it should result in triggering\n\t\t\t//the target.\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertTrue(\"Event.TRIGGERED was not dispatched\", hasTriggered);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDisabled():void\n\t\t{\n\t\t\tthis._tapToTrigger.isEnabled = false;\n\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tthis._target.addEventListener(Event.TRIGGERED, function(event:Event):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._target.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t//this touch does not move at all, so it should result in triggering\n\t\t\t//the target.\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertFalse(\"Event.TRIGGERED was incorrectly dispatched when disabled\", hasTriggered);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTouchMoveOutsideBeforeTriggeredEvent():void\n\t\t{\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tthis._target.addEventListener(Event.TRIGGERED, function(event:Event):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._target.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t//move the touch way outside the bounds of the target\n\t\t\ttouch.globalX = 1000;\n\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertFalse(\"Event.TRIGGERED was incorrectly dispatched when touch moved out of bounds\", hasTriggered);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testOtherDisplayObjectBlockingTriggeredEvent():void\n\t\t{\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tthis._target.addEventListener(Event.TRIGGERED, function(event:Event):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._target.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tthis._blocker = new Quad(200, 200, 0xff0000);\n\t\t\tTestFeathers.starlingRoot.addChild(this._blocker);\n\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertFalse(\"Event.TRIGGERED was incorrectly dispatched when another display object blocked the touch\", hasTriggered);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemovedBeforeTriggeredEvent():void\n\t\t{\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tthis._target.addEventListener(Event.TRIGGERED, function(event:Event):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._target.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tthis._target.removeFromParent(false);\n\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\t//while it's good to check that Event.TRIGGERED isn't dispatched,\n\t\t\t//this test also ensures that no runtime errors are thrown after the\n\t\t\t//target is removed (its stage property is null, and that is used\n\t\t\t//by TapToTrigger)\n\t\t\tAssert.assertFalse(\"Event.TRIGGERED was incorrectly dispatched when target was removed\", hasTriggered);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCustomHitTest():void\n\t\t{\n\t\t\tthis._tapToTrigger.customHitTest = function customHitTest(localPosition:Point):Boolean\n\t\t\t{\n\t\t\t\treturn localPosition.x <= 100;\n\t\t\t};\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tthis._target.addEventListener(Event.TRIGGERED, function(event:Event):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._target.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertTrue(\"Event.TRIGGERED was not dispatched when customHitTest returned true\", hasTriggered);\n\n\t\t\thasTriggered = false;\n\t\t\t//move the touch to an area where customHitTest() will return false\n\t\t\ttouch.globalX = 150;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertFalse(\"Event.TRIGGERED was incorrectly dispatched when customHitTest returned false\", hasTriggered);\n\n\t\t\thasTriggered = false;\n\t\t\t//move the touch way outside the bounds of the target\n\t\t\ttouch.globalX = 1000;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertFalse(\"Event.TRIGGERED was incorrectly dispatched when touch started out of bounds\", hasTriggered);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/TextAreaFocusTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.TextArea;\n\timport feathers.controls.text.TextFieldTextEditor;\n\timport feathers.controls.text.TextFieldTextEditorViewPort;\n\timport feathers.core.FocusManager;\n\timport feathers.events.FeathersEventType;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\tpublic class TextAreaFocusTests\n\t{\n\t\tprivate static const SAMPLE_TEXT:String = \"I am the very model of a modern major general\";\n\n\t\tprivate var _textArea:TextArea;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._textArea = new TextArea();\n\t\t\tthis._textArea.backgroundSkin = new Quad(200, 200);\n\t\t\tthis._textArea.textEditorFactory = textEditorFactory;\n\t\t\tTestFeathers.starlingRoot.addChild(this._textArea);\n\t\t\tthis._textArea.validate();\n\t\t}\n\n\t\tprivate function textEditorFactory():TextFieldTextEditor\n\t\t{\n\t\t\tvar textEditor:TextFieldTextEditorViewPort = new TextFieldTextEditorViewPort();\n\t\t\treturn textEditor;\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tFocusManager.setEnabledForStage(this._textArea.stage, false);\n\t\t\tthis._textArea.removeFromParent(true);\n\t\t\tthis._textArea = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFocusInEventAfterSetFocusFunctionWithoutFocusManager():void\n\t\t{\n\t\t\tvar hasDispatchedFocusIn:Boolean = false;\n\t\t\tthis._textArea.addEventListener(FeathersEventType.FOCUS_IN, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedFocusIn = true;\n\t\t\t});\n\t\t\tthis._textArea.setFocus();\n\t\t\tAssert.assertTrue(\"FeathersEventType.FOCUS_IN was not dispatched after calling setFocus()\", hasDispatchedFocusIn);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFocusOutEventAfterClearFocusFunctionWithoutFocusManager():void\n\t\t{\n\t\t\tvar hasDispatchedFocusOut:Boolean = false;\n\t\t\tthis._textArea.addEventListener(FeathersEventType.FOCUS_OUT, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedFocusOut = true;\n\t\t\t});\n\t\t\tthis._textArea.setFocus();\n\t\t\tthis._textArea.clearFocus();\n\t\t\tAssert.assertTrue(\"FeathersEventType.FOCUS_OUT was not dispatched after calling clearFocus()\", hasDispatchedFocusOut);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFocusInEventAfterSetFocusFunctionWithFocusManager():void\n\t\t{\n\t\t\tFocusManager.setEnabledForStage(this._textArea.stage, true);\n\t\t\tthis.testFocusInEventAfterSetFocusFunctionWithoutFocusManager();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFocusOutEventAfterClearFocusFunctionWithFocusManager():void\n\t\t{\n\t\t\tFocusManager.setEnabledForStage(this._textArea.stage, true);\n\t\t\tthis.testFocusOutEventAfterClearFocusFunctionWithoutFocusManager();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectionRangeInsideFocusInListenerAfterSetFocusFunctionWithoutFocusManager():void\n\t\t{\n\t\t\tthis._textArea.text = SAMPLE_TEXT;\n\t\t\tvar selectionBeginIndex:int = -1;\n\t\t\tvar selectionEndIndex:int = -1;\n\t\t\tthis._textArea.addEventListener(FeathersEventType.FOCUS_IN, function(event:Event):void\n\t\t\t{\n\t\t\t\tselectionBeginIndex = _textArea.selectionBeginIndex;\n\t\t\t\tselectionEndIndex = _textArea.selectionEndIndex;\n\t\t\t});\n\t\t\tthis._textArea.setFocus();\n\t\t\tAssert.assertStrictlyEquals(\"TextArea selectionBeginIndex incorrect after calling setFocus()\",\n\t\t\t\t0, selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"TextArea selectionBeginIndex incorrect after calling setFocus()\",\n\t\t\t\t0, selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectionRangeInsideFocusInListenerAfterSetFocusFunctionWithFocusManager():void\n\t\t{\n\t\t\tFocusManager.setEnabledForStage(this._textArea.stage, true);\n\t\t\tthis.testSelectionRangeInsideFocusInListenerAfterSetFocusFunctionWithoutFocusManager();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectionRangeAfterSetFocusThenSelectRangeFunctionWithoutFocusManager():void\n\t\t{\n\t\t\tthis._textArea.text = SAMPLE_TEXT;\n\t\t\tthis._textArea.setFocus();\n\t\t\tvar selectionBeginIndex:int = 1;\n\t\t\tvar selectionEndIndex:int = 3;\n\t\t\tthis._textArea.selectRange(selectionBeginIndex, selectionEndIndex);\n\t\t\tAssert.assertStrictlyEquals(\"TextArea selectionBeginIndex incorrect after calling setFocus() then selectRange()\",\n\t\t\t\tselectionBeginIndex, this._textArea.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"TextArea selectionBeginIndex incorrect after calling setFocus() then selectRange()\",\n\t\t\t\tselectionEndIndex, this._textArea.selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectionRangeAfterSetFocusThenSelectRangeFunctionWithFocusManager():void\n\t\t{\n\t\t\tFocusManager.setEnabledForStage(this._textArea.stage, true);\n\t\t\tthis.testSelectionRangeAfterSetFocusThenSelectRangeFunctionWithoutFocusManager();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectionRangeAfterTouchEventWithoutFocusManager():void\n\t\t{\n\t\t\tthis._textArea.text = SAMPLE_TEXT;\n\t\t\t//validate to make sure the text is passed down to the text editor\n\t\t\tthis._textArea.validate();\n\n\t\t\tvar selectionBeginIndex:int = -1;\n\t\t\tvar selectionEndIndex:int = -1;\n\t\t\tthis._textArea.addEventListener(FeathersEventType.FOCUS_IN, function(event:Event):void\n\t\t\t{\n\t\t\t\tselectionBeginIndex = _textArea.selectionBeginIndex;\n\t\t\t\tselectionEndIndex = _textArea.selectionEndIndex;\n\t\t\t});\n\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = this._textArea;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = 100;\n\t\t\ttouch.globalY = 5;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\tthis._textArea.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t//this touch does not move at all, so it should result in triggering\n\t\t\t//the button.\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\tthis._textArea.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\t//we don't care what the exact index is, but it should be clear that\n\t\t\t//the touch changed it to something\n\t\t\tAssert.assertTrue(\"TextArea selectionBeginIndex and selectionEndIndex incorrect after TouchEvent.TOUCH\",\n\t\t\t\tselectionBeginIndex > 0 && selectionEndIndex < SAMPLE_TEXT.length && selectionBeginIndex === selectionEndIndex)\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectionRangeAfterTouchEventWithFocusManager():void\n\t\t{\n\t\t\tFocusManager.setEnabledForStage(this._textArea.stage, true);\n\t\t\tthis.testSelectionRangeAfterTouchEventWithoutFocusManager();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/TextAreaInternalStateTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.TextInputState;\n\timport feathers.core.FocusManager;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class TextAreaInternalStateTests\n\t{\n\t\tprivate var _textArea:TextAreaWithInternalState;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, true);\n\n\t\t\tthis._textArea = new TextAreaWithInternalState();\n\t\t\tTestFeathers.starlingRoot.addChild(this._textArea);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._textArea.removeFromParent(true);\n\t\t\tthis._textArea = null;\n\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, false);\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetSkinForStateWithoutSetSkinForState():void\n\t\t{\n\t\t\tAssert.assertNull(\"TextInput getSkinForState(TextInputState.ENABLED) must be null when setSkinForState() is not called\", this._textArea.getSkinForState(TextInputState.FOCUSED));\n\t\t\tAssert.assertNull(\"TextInput getSkinForState(TextInputState.DISABLED) must be null when setSkinForState() is not called\", this._textArea.getSkinForState(TextInputState.DISABLED));\n\t\t\tAssert.assertNull(\"TextInput getSkinForState(TextInputState.FOCUSED) must be null when setSkinForState() is not called\", this._textArea.getSkinForState(TextInputState.FOCUSED));\n\t\t\tAssert.assertNull(\"TextInput getSkinForState(TextInputState.ERROR) must be null when setSkinForState() is not called\", this._textArea.getSkinForState(TextInputState.ERROR));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetSkinForState():void\n\t\t{\n\t\t\tvar backgroundSkin:Quad = new Quad(200, 200);\n\t\t\tthis._textArea.backgroundSkin = backgroundSkin;\n\n\t\t\tvar enabledSkin:Quad = new Quad(200, 200);\n\t\t\tthis._textArea.setSkinForState(TextInputState.ENABLED, enabledSkin);\n\n\t\t\tvar disabledSkin:Quad = new Quad(200, 200);\n\t\t\tthis._textArea.setSkinForState(TextInputState.DISABLED, disabledSkin);\n\n\t\t\tvar focusedSkin:Quad = new Quad(200, 200);\n\t\t\tthis._textArea.setSkinForState(TextInputState.FOCUSED, focusedSkin);\n\n\t\t\tvar errorSkin:Quad = new Quad(200, 200);\n\t\t\tthis._textArea.setSkinForState(TextInputState.ERROR, errorSkin);\n\n\t\t\tAssert.assertStrictlyEquals(\"TextInput getSkinForState(TextInputState.ENABLED) does not match value passed to setSkinForState()\", enabledSkin, this._textArea.getSkinForState(TextInputState.ENABLED));\n\t\t\tAssert.assertStrictlyEquals(\"TextInput getSkinForState(TextInputState.DISABLED) does not match value passed to setSkinForState()\", disabledSkin, this._textArea.getSkinForState(TextInputState.DISABLED));\n\t\t\tAssert.assertStrictlyEquals(\"TextInput getSkinForState(TextInputState.FOCUSED) does not match value passed to setSkinForState()\", focusedSkin, this._textArea.getSkinForState(TextInputState.FOCUSED));\n\t\t\tAssert.assertStrictlyEquals(\"TextInput getSkinForState(TextInputState.ERROR) does not match value passed to setSkinForState()\", errorSkin, this._textArea.getSkinForState(TextInputState.ERROR));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDefaultCurrentBackground():void\n\t\t{\n\t\t\tvar backgroundSkin:Quad = new Quad(200, 200);\n\t\t\tthis._textArea.backgroundSkin = backgroundSkin;\n\n\t\t\tthis._textArea.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state is not TextInputState.ENABLED by default\", TextInputState.ENABLED, this._textArea.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput background is not backgroundSkin when currentState is TextInputState.ENABLED and background not provided for this state\", backgroundSkin, this._textArea.currentBackgroundInternal);\n\n\t\t\tthis._textArea.errorString = \"Error\";\n\t\t\tthis._textArea.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state is not TextInputState.ERROR when errorString is not null\", TextInputState.ERROR, this._textArea.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput background is not backgroundSkin when currentState is TextInputState.ENABLED and background not provided for this state\", backgroundSkin, this._textArea.currentBackgroundInternal);\n\t\t\tthis._textArea.errorString = null;\n\n\t\t\tthis._textArea.isEnabled = false;\n\t\t\tthis._textArea.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state is not TextInputState.DISABLED when isEnabled is false\", TextInputState.DISABLED, this._textArea.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput background is not backgroundSkin when currentState is TextInputState.DISABLED and background not provided for this state\", backgroundSkin, this._textArea.currentBackgroundInternal);\n\n\t\t\tthis._textArea.isEnabled = true;\n\t\t\tFocusManager.focus = this._textArea;\n\t\t\tthis._textArea.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state is not TextInputState.FOCUSED when input is focused\", TextInputState.FOCUSED, this._textArea.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput background is not backgroundSkin when currentState is TextInputState.FOCUSED and background not provided for this state\", backgroundSkin, this._textArea.currentBackgroundInternal);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentSkinWithSetSkinForState():void\n\t\t{\n\t\t\tvar backgroundSkin:Quad = new Quad(200, 200);\n\t\t\tthis._textArea.backgroundSkin = backgroundSkin;\n\n\t\t\tvar backgroundEnabledSkin:Quad = new Quad(200, 200);\n\t\t\tthis._textArea.setSkinForState(TextInputState.ENABLED, backgroundEnabledSkin);\n\n\t\t\tvar backgroundDisabledSkin:Quad = new Quad(200, 200);\n\t\t\tthis._textArea.setSkinForState(TextInputState.DISABLED, backgroundDisabledSkin);\n\n\t\t\tvar backgroundFocusedSkin:Quad = new Quad(200, 200);\n\t\t\tthis._textArea.setSkinForState(TextInputState.FOCUSED, backgroundFocusedSkin);\n\n\t\t\tvar backgroundErrorSkin:Quad = new Quad(200, 200);\n\t\t\tthis._textArea.setSkinForState(TextInputState.ERROR, backgroundErrorSkin);\n\n\t\t\tthis._textArea.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state is not TextInputState.ENABLED by default\", TextInputState.ENABLED, this._textArea.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput background is not backgroundEnabledSkin when currentState is TextInputState.ENABLED\", backgroundEnabledSkin, this._textArea.currentBackgroundInternal);\n\n\t\t\tthis._textArea.errorString = \"Error\";\n\t\t\tthis._textArea.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state is not TextInputState.ERROR when errorString is not null\", TextInputState.ERROR, this._textArea.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput background is not backgroundEnabledSkin when currentState is TextInputState.ENABLED\", backgroundErrorSkin, this._textArea.currentBackgroundInternal);\n\t\t\tthis._textArea.errorString = null;\n\n\t\t\tthis._textArea.isEnabled = false;\n\t\t\tthis._textArea.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state is not TextInputState.DISABLED when isEnabled is false\", TextInputState.DISABLED, this._textArea.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput background is not backgroundDisabledSkin when currentState is TextInputState.DISABLED\", backgroundDisabledSkin, this._textArea.currentBackgroundInternal);\n\n\t\t\tthis._textArea.isEnabled = true;\n\t\t\tFocusManager.focus = this._textArea;\n\t\t\tthis._textArea.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state is not TextInputState.FOCUSED when input is focused\", TextInputState.FOCUSED, this._textArea.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput background is not backgroundFocusedSkin when currentState is TextInputState.FOCUSED\", backgroundFocusedSkin, this._textArea.currentBackgroundInternal);\n\t\t}\n\t}\n}\n\nimport feathers.controls.TextArea;\n\nimport starling.display.DisplayObject;\n\nclass TextAreaWithInternalState extends TextArea\n{\n\tpublic function TextAreaWithInternalState()\n\t{\n\t\tsuper();\n\t}\n\n\tpublic function get currentBackgroundInternal():DisplayObject\n\t{\n\t\treturn this.currentBackgroundSkin;\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/TextAreaTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.TextArea;\n\timport feathers.tests.supportClasses.DisposeFlagQuad;\n\n\timport org.flexunit.Assert;\n\n\tpublic class TextAreaTests\n\t{\n\t\tprivate var _input:TextArea;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._input = new TextArea();\n\t\t\tTestFeathers.starlingRoot.addChild(this._input);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._input.removeFromParent(true);\n\t\t\tthis._input = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSkinsDisposed():void\n\t\t{\n\t\t\tvar backgroundSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._input.backgroundSkin = backgroundSkin;\n\t\t\tvar backgroundDisabledSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._input.backgroundDisabledSkin = backgroundDisabledSkin;\n\t\t\tvar backgroundFocusedSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._input.backgroundFocusedSkin = backgroundFocusedSkin;\n\t\t\tvar backgroundErrorSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._input.backgroundErrorSkin = backgroundErrorSkin;\n\t\t\tthis._input.validate();\n\t\t\tthis._input.dispose();\n\t\t\tAssert.assertTrue(\"backgroundSkin not disposed when TextArea disposed.\", backgroundSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"backgroundDisabledSkin not disposed when TextArea disposed.\", backgroundDisabledSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"backgroundFocusedSkin not disposed when TextArea disposed.\", backgroundFocusedSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"backgroundErrorSkin not disposed when TextArea disposed.\", backgroundErrorSkin.isDisposed);\n\t\t}\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/TextBlockTextEditorFocusTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.TextInput;\n\timport feathers.controls.TextInputState;\n\timport feathers.controls.text.TextBlockTextEditor;\n\timport feathers.core.FocusManager;\n\timport feathers.events.FeathersEventType;\n\n\timport flash.events.Event;\n\timport flash.events.KeyboardEvent;\n\timport flash.events.TextEvent;\n\timport flash.geom.Point;\n\timport flash.ui.Keyboard;\n\n\timport org.flexunit.Assert;\n\timport org.flexunit.async.Async;\n\n\timport starling.core.Starling;\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\tpublic class TextBlockTextEditorFocusTests\n\t{\n\t\tprivate static const CURSOR_SKIN_NAME:String = \"test-cursor-skin\";\n\t\tprivate static const SELECTION_SKIN_NAME:String = \"test-selection-skin\";\n\t\t\n\t\tprivate var _textInput:TextInput;\n\t\tprivate var _textEditor:TextBlockTextEditor;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, true);\n\n\t\t\tthis._textInput = new TextInput();\n\t\t\tthis._textInput.backgroundSkin = new Quad(200, 200);\n\t\t\tthis._textInput.textEditorFactory = textEditorFactory;\n\t\t\tTestFeathers.starlingRoot.addChild(this._textInput);\n\t\t\tthis._textInput.validate();\n\t\t}\n\n\t\tprivate function textEditorFactory():TextBlockTextEditor\n\t\t{\n\t\t\tthis._textEditor = new TextBlockTextEditor();\n\t\t\tvar cursorSkin:Quad = new Quad(1, 1, 0xff00ff);\n\t\t\tcursorSkin.name = CURSOR_SKIN_NAME;\n\t\t\tthis._textEditor.cursorSkin = cursorSkin;\n\t\t\tvar selectionSkin:Quad = new Quad(1, 1, 0xff00ff);\n\t\t\tselectionSkin.name = SELECTION_SKIN_NAME;\n\t\t\tthis._textEditor.selectionSkin = selectionSkin;\n\t\t\treturn this._textEditor;\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\t//one of the tests sets the parent's visible property to false, so\n\t\t\t//it needs to be reset.\n\t\t\tthis._textInput.parent.visible = true;\n\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, false);\n\t\t\tthis._textInput.removeFromParent(true);\n\t\t\tthis._textInput = null;\n\n\t\t\tthis._textEditor = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFocusInEventAfterSetFocus():void\n\t\t{\n\t\t\tvar hasDispatchedFocusIn:Boolean = false;\n\t\t\tthis._textInput.addEventListener(FeathersEventType.FOCUS_IN, function(event:starling.events.Event):void\n\t\t\t{\n\t\t\t\thasDispatchedFocusIn = true;\n\t\t\t});\n\t\t\tthis._textInput.setFocus();\n\t\t\tAssert.assertTrue(\"BitmapFontTextEditor: FeathersEventType.FOCUS_IN was not dispatched after calling setFocus() on TextInput\",\n\t\t\t\thasDispatchedFocusIn);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFocusInEventAfterTouch():void\n\t\t{\n\t\t\tvar hasDispatchedFocusIn:Boolean = false;\n\t\t\tthis._textInput.addEventListener(FeathersEventType.FOCUS_IN, function(event:starling.events.Event):void\n\t\t\t{\n\t\t\t\thasDispatchedFocusIn = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._textInput.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertTrue(\"BitmapFontTextEditor: FeathersEventType.FOCUS_IN was not dispatched after TouchEvent.TOUCH on TextInput\",\n\t\t\t\thasDispatchedFocusIn);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFocusOutEventAfterSetFocusThenClearFocus():void\n\t\t{\n\t\t\tvar hasDispatchedFocusOut:Boolean = false;\n\t\t\tthis._textInput.addEventListener(FeathersEventType.FOCUS_OUT, function(event:starling.events.Event):void\n\t\t\t{\n\t\t\t\thasDispatchedFocusOut = true;\n\t\t\t});\n\t\t\tthis._textInput.setFocus();\n\t\t\tthis._textInput.clearFocus();\n\t\t\tAssert.assertTrue(\"BitmapFontTextEditor: FeathersEventType.FOCUS_OUT was not dispatched after calling clearFocus() on TextInput\",\n\t\t\t\thasDispatchedFocusOut);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFocusOutEventAfterTouchInsideThenTouchOutside():void\n\t\t{\n\t\t\tvar hasDispatchedFocusOut:Boolean = false;\n\t\t\tthis._textInput.addEventListener(FeathersEventType.FOCUS_OUT, function(event:starling.events.Event):void\n\t\t\t{\n\t\t\t\thasDispatchedFocusOut = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._textInput.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.target = target.stage;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = 1000;\n\t\t\ttouch.globalY = 1000;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertTrue(\"BitmapFontTextEditor: FeathersEventType.FOCUS_OUT was not dispatched after TouchEvent.TOUCH inside TextInput followed by TouchEvent.TOUCH outside TextInput\",\n\t\t\t\thasDispatchedFocusOut);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFocusOutEventAfterSetFocusThenTouchOutside():void\n\t\t{\n\t\t\tvar hasDispatchedFocusOut:Boolean = false;\n\t\t\tthis._textInput.addEventListener(FeathersEventType.FOCUS_OUT, function(event:starling.events.Event):void\n\t\t\t{\n\t\t\t\thasDispatchedFocusOut = true;\n\t\t\t});\n\t\t\tthis._textInput.setFocus();\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._textInput.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = this._textInput.stage;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = 1000;\n\t\t\ttouch.globalY = 1000;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertTrue(\"BitmapFontTextEditor: FeathersEventType.FOCUS_OUT was not dispatched after calling setFocus() on TextInput followed by TouchEvent.TOUCH outside TextInput\",\n\t\t\t\thasDispatchedFocusOut);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFocusOutEventAfterTouchInsideThenClearFocus():void\n\t\t{\n\t\t\tvar hasDispatchedFocusOut:Boolean = false;\n\t\t\tthis._textInput.addEventListener(FeathersEventType.FOCUS_OUT, function(event:starling.events.Event):void\n\t\t\t{\n\t\t\t\thasDispatchedFocusOut = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._textInput.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._textInput.clearFocus();\n\t\t\tAssert.assertTrue(\"BitmapFontTextEditor: FeathersEventType.FOCUS_OUT was not dispatched after TouchEvent.TOUCH inside TextInput followed by calling clearFocus() on TextInput\",\n\t\t\t\thasDispatchedFocusOut);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testFocusOutEventAfterSetTextInputParentVisibleToFalse():void\n\t\t{\n\t\t\tvar hasDispatchedFocusOut:Boolean = false;\n\t\t\tthis._textInput.addEventListener(FeathersEventType.FOCUS_OUT, function(event:starling.events.Event):void\n\t\t\t{\n\t\t\t\thasDispatchedFocusOut = true;\n\t\t\t});\n\t\t\tthis._textInput.setFocus();\n\t\t\tthis._textInput.parent.visible = false;\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertTrue(\"FeathersEventType.FOCUS_OUT was not dispatched after setting TextInput parent's visible property to false when using BitmapFontTextEditor\", hasDispatchedFocusOut);\n\t\t\t}, 100);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectionChangeAfterSelectAllEvent():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\t//clear the automatic selection caused by giving it focus\n\t\t\tthis._textInput.selectRange(0, 0);\n\t\t\t//and validate the commit this change\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new flash.events.Event(flash.events.Event.SELECT_ALL, true));\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed after Ctrl/Cmd+A to select all\",\n\t\t\t\t0, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed after Ctrl/Cmd+A to select all\",\n\t\t\t\tthis._textInput.text.length, this._textInput.selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectionChangeAfterSelectAllEventAndKeyboardShiftLeft():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\t//clear the automatic selection caused by giving it focus\n\t\t\tthis._textInput.selectRange(0, 0);\n\t\t\t//and validate the commit this change\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new flash.events.Event(flash.events.Event.SELECT_ALL, true));\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.LEFT, 0, false, false, true));\n\t\t\tthis._textInput.validate();\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after Ctrl/Cmd+A to select all and pressing Keyboard.LEFT and shift key\",\n\t\t\t\t0, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after Ctrl/Cmd+A to select all and pressing Keyboard.LEFT and shift key\",\n\t\t\t\tthis._textInput.text.length - 1, this._textInput.selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectionChangeAfterSelectAllEventAndKeyboardLeft():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\t//clear the automatic selection caused by giving it focus\n\t\t\tthis._textInput.selectRange(0, 0);\n\t\t\t//and validate the commit this change\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new flash.events.Event(flash.events.Event.SELECT_ALL, true));\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.LEFT, 0, false, false, false));\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after Ctrl/Cmd+A to select all and pressing Keyboard.LEFT\",\n\t\t\t\t0, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after Ctrl/Cmd+A to select all and pressing Keyboard.LEFT\",\n\t\t\t\t0, this._textInput.selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectionChangeAfterSelectAllEventAndKeyboardRight():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\t//clear the automatic selection caused by giving it focus\n\t\t\tthis._textInput.selectRange(0, 0);\n\t\t\t//and validate the commit this change\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new flash.events.Event(flash.events.Event.SELECT_ALL, true));\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.RIGHT, 0, false, false, false));\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after Ctrl/Cmd+A to select all and pressing Keyboard.RIGHT\",\n\t\t\t\tthis._textInput.text.length, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after Ctrl/Cmd+A to select all and pressing Keyboard.RIGHT\",\n\t\t\t\tthis._textInput.text.length, this._textInput.selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectionChangeAfterSelectRange():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar rangeStart:int = 2;\n\t\t\tvar rangeEnd:int = 8;\n\t\t\tthis._textInput.selectRange(rangeStart, rangeEnd);\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after selectRange() and pressing Keyboard.LEFT\",\n\t\t\t\trangeStart, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after selectRange() and pressing Keyboard.LEFT\",\n\t\t\t\trangeEnd, this._textInput.selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectionChangeAfterSelectRangeAndKeyboardLeft():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar rangeStart:int = 2;\n\t\t\tvar rangeEnd:int = 8;\n\t\t\tthis._textInput.selectRange(rangeStart, rangeEnd);\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.LEFT, 0, false, false, false));\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after selectRange() and pressing Keyboard.LEFT\",\n\t\t\t\trangeStart, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after selectRange() and pressing Keyboard.LEFT\",\n\t\t\t\trangeStart, this._textInput.selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectionChangeAfterSelectRangeAndKeyboardRight():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar rangeStart:int = 2;\n\t\t\tvar rangeEnd:int = 8;\n\t\t\tthis._textInput.selectRange(rangeStart, rangeEnd);\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.RIGHT, 0, false, false, false));\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after selectRange() and pressing Keyboard.RIGHT\",\n\t\t\t\trangeEnd, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after selectRange() and pressing Keyboard.RIGHT\",\n\t\t\t\trangeEnd, this._textInput.selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectRangeAndKeyboardDelete():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar rangeStart:int = 2;\n\t\t\tvar rangeEnd:int = 8;\n\t\t\tthis._textInput.selectRange(rangeStart, rangeEnd);\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.DELETE, 0, false, false, false));\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after selectRange() and pressing Keyboard.DELETE\",\n\t\t\t\trangeStart, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after selectRange() and pressing Keyboard.DELETE\",\n\t\t\t\trangeStart, this._textInput.selectionEndIndex);\n\t\t\tAssert.assertStrictlyEquals(\"text not changed correctly after selectRange() and pressing Keyboard.DELETE\",\n\t\t\t\t\"Herld\", this._textInput.text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectRangeAndKeyboardBackspace():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar rangeStart:int = 2;\n\t\t\tvar rangeEnd:int = 8;\n\t\t\tthis._textInput.selectRange(rangeStart, rangeEnd);\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.BACKSPACE, 0, false, false, false));\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after selectRange() and pressing Keyboard.BACKSPACE\",\n\t\t\t\trangeStart, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after selectRange() and pressing Keyboard.BACKSPACE\",\n\t\t\t\trangeStart, this._textInput.selectionEndIndex);\n\t\t\tAssert.assertStrictlyEquals(\"text not changed correctly after selectRange() and pressing Keyboard.BACKSPACE\",\n\t\t\t\t\"Herld\", this._textInput.text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectRangeAndTyping():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar rangeStart:int = 2;\n\t\t\tvar rangeEnd:int = 8;\n\t\t\tvar textToType:String = \"test\";\n\t\t\tthis._textInput.selectRange(rangeStart, rangeEnd);\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new TextEvent(TextEvent.TEXT_INPUT, false, false, textToType));\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after selectRange() and typing some text\",\n\t\t\t\trangeStart + textToType.length, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after selectRange() and typing some text\",\n\t\t\t\trangeStart + textToType.length, this._textInput.selectionEndIndex);\n\t\t\tAssert.assertStrictlyEquals(\"text not changed correctly after selectRange() and typing some text\",\n\t\t\t\t\"He\" + textToType + \"rld\", this._textInput.text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetCursorAndKeyboardDelete():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar cursorIndex:int = 2;\n\t\t\tthis._textInput.selectRange(cursorIndex, cursorIndex);\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.DELETE, 0, false, false, false));\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex incorrectly changed after selectRange() and pressing Keyboard.DELETE\",\n\t\t\t\tcursorIndex, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex incorrectly changed after selectRange() and pressing Keyboard.DELETE\",\n\t\t\t\tcursorIndex, this._textInput.selectionEndIndex);\n\t\t\tAssert.assertStrictlyEquals(\"text not changed correctly after selectRange() and pressing Keyboard.DELETE\",\n\t\t\t\t\"Helo World\", this._textInput.text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetCursorAndKeyboardBackspace():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar cursorIndex:int = 2;\n\t\t\tthis._textInput.selectRange(cursorIndex, cursorIndex);\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.BACKSPACE, 0, false, false, false));\n\t\t\tcursorIndex--;\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after selectRange() and pressing Keyboard.BACKSPACE\",\n\t\t\t\tcursorIndex, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after selectRange() and pressing Keyboard.BACKSPACE\",\n\t\t\t\tcursorIndex, this._textInput.selectionEndIndex);\n\t\t\tAssert.assertStrictlyEquals(\"text not changed correctly after selectRange() and pressing Keyboard.BACKSPACE\",\n\t\t\t\t\"Hllo World\", this._textInput.text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetCursorAndKeyboardUp():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar cursorIndex:int = 2;\n\t\t\tthis._textInput.selectRange(cursorIndex, cursorIndex);\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.UP, 0, false, false, false));\n\t\t\tcursorIndex = 0;\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after selectRange() and pressing Keyboard.UP\",\n\t\t\t\tcursorIndex, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after selectRange() and pressing Keyboard.UP\",\n\t\t\t\tcursorIndex, this._textInput.selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetCursorAndKeyboardDown():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar cursorIndex:int = 2;\n\t\t\tthis._textInput.selectRange(cursorIndex, cursorIndex);\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.DOWN, 0, false, false, false));\n\t\t\tcursorIndex = this._textInput.text.length;\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after selectRange() and pressing Keyboard.DOWN\",\n\t\t\t\tcursorIndex, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after selectRange() and pressing Keyboard.DOWN\",\n\t\t\t\tcursorIndex, this._textInput.selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetCursorAndKeyboardLeft():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar cursorIndex:int = 2;\n\t\t\tthis._textInput.selectRange(cursorIndex, cursorIndex);\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.LEFT, 0, false, false, false));\n\t\t\tcursorIndex--;\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after selectRange() and pressing Keyboard.LEFT\",\n\t\t\t\tcursorIndex, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after selectRange() and pressing Keyboard.LEFT\",\n\t\t\t\tcursorIndex, this._textInput.selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetCursorAndKeyboardRight():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar cursorIndex:int = 2;\n\t\t\tthis._textInput.selectRange(cursorIndex, cursorIndex);\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.RIGHT, 0, false, false, false));\n\t\t\tcursorIndex++;\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after selectRange() and pressing Keyboard.RIGHT\",\n\t\t\t\tcursorIndex, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after selectRange() and pressing Keyboard.RIGHT\",\n\t\t\t\tcursorIndex, this._textInput.selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetCursorAndKeyboardShiftLeft():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar rangeStart:int = 2;\n\t\t\tvar rangeEnd:int = 2;\n\t\t\tthis._textInput.selectRange(rangeStart, rangeEnd);\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.LEFT, 0, false, false, true));\n\t\t\trangeStart--;\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after selectRange() and pressing Keyboard.LEFT and shift key\",\n\t\t\t\trangeStart, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after selectRange() and pressing Keyboard.LEFT and shift key\",\n\t\t\t\trangeEnd, this._textInput.selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetCursorAndKeyboardShiftRight():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar rangeStart:int = 2;\n\t\t\tvar rangeEnd:int = 2;\n\t\t\tthis._textInput.selectRange(rangeStart, rangeEnd);\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 0, Keyboard.RIGHT, 0, false, false, true));\n\t\t\trangeEnd++;\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after selectRange() and pressing Keyboard.RIGHT and shift key\",\n\t\t\t\trangeStart, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after selectRange() and pressing Keyboard.RIGHT and shift key\",\n\t\t\t\trangeEnd, this._textInput.selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetCursorAndTyping():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tvar cursorIndex:int = 2;\n\t\t\tvar textToType:String = \"test\";\n\t\t\tthis._textInput.selectRange(cursorIndex, cursorIndex);\n\t\t\tthis._textInput.validate();\n\t\t\tStarling.current.nativeStage.focus.dispatchEvent(new TextEvent(TextEvent.TEXT_INPUT, false, false, textToType));\n\t\t\tAssert.assertStrictlyEquals(\"selectionBeginIndex not changed correctly after selectRange() and typing some text\",\n\t\t\t\tcursorIndex + textToType.length, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"selectionEndIndex not changed correctly after selectRange() and typing some text\",\n\t\t\t\tcursorIndex + textToType.length, this._textInput.selectionEndIndex);\n\t\t\tAssert.assertStrictlyEquals(\"text not changed correctly after selectRange() and typing some text\",\n\t\t\t\t\"He\" + textToType + \"llo World\", this._textInput.text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetFocusWhenFocusEnabledFalse():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.isFocusEnabled = false;\n\t\t\tthis._textInput.validate();\n\t\t\tAssert.assertNotNull(\"TextBlockTextEditor nativeFocus must not be null when isFocusEnabled is false\",\n\t\t\t\tthis._textInput.nativeFocus);\n\t\t\tAssert.assertTrue(\"TextBlockTextEditor nativeFocus must not receive nativeStage focus when isFocusEnabled is false\",\n\t\t\t\tStarling.current.nativeStage.focus !== this._textInput.nativeFocus);\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertTrue(\"TextInput must not receive FocusManager focus when using TextBlockTextEditor and isFocusEnabled is false\",\n\t\t\t\tthis._textInput.focusManager.focus !== this._textInput);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state must be TextInputState.ENABLED after attempt to receive FocusManager focus when using TextBlockTextEditor and isFocusEnabled is false\",\n\t\t\t\tTextInputState.ENABLED, this._textInput.currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testReceiveFocusWhenEditableFalseAndSelectableFalse():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.isEditable = false;\n\t\t\tthis._textInput.isSelectable = false;\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tthis._textInput.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextEditor nativeFocus must receive nativeStage focus when isEditable is false and isSelectable is false\",\n\t\t\t\tStarling.current.nativeStage.focus, this._textInput.nativeFocus);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput must receive FocusManager focus when using TextBlockTextEditor and isEditable is false and isSelectable is false\",\n\t\t\t\tthis._textInput.focusManager.focus, this._textInput);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state must be TextInputState.FOCUSED after receive FocusManager focus when using TextBlockTextEditor and isEditable is false and isSelectable is false\",\n\t\t\t\tTextInputState.FOCUSED, this._textInput.currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetFocusWhenEditableTrueAndSelectableFalse():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.isEditable = true;\n\t\t\tthis._textInput.isSelectable = false;\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextEditor nativeFocus must receive nativeStage focus when isEditable is true and isSelectable is false\",\n\t\t\t\tStarling.current.nativeStage.focus, this._textInput.nativeFocus);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput must receive FocusManager focus when using TextBlockTextEditor and isEditable is true and isSelectable is false\",\n\t\t\t\tthis._textInput.focusManager.focus, this._textInput);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state must be TextInputState.FOCUSED after receive FocusManager focus when using TextBlockTextEditor and isEditable is true and isSelectable is false\",\n\t\t\t\tTextInputState.FOCUSED, this._textInput.currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetFocusWhenEditableFalseAndSelectableTrue():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.isEditable = false;\n\t\t\tthis._textInput.isSelectable = true;\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextEditor nativeFocus must receive nativeStage focus when isEditable is false and isSelectable is true\",\n\t\t\t\tStarling.current.nativeStage.focus, this._textInput.nativeFocus);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput must receive FocusManager focus when using TextBlockTextEditor and isEditable is false and isSelectable is true\",\n\t\t\t\tthis._textInput.focusManager.focus, this._textInput);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state must be TextInputState.FOCUSED after receive FocusManager focus when using TextBlockTextEditor and isEditable is false and isSelectable is true\",\n\t\t\t\tTextInputState.FOCUSED, this._textInput.currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCursorAndSelectionSkinsWithNoCharactersSelected():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.selectRange(1, 1);\n\t\t\t//validate to be sure that the range is passed down to the text editor\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertTrue(\"TextBlockTextEditor cursorSkin must be visible when no characters selected\",\n\t\t\t\tthis._textEditor.getChildByName(CURSOR_SKIN_NAME).visible);\n\t\t\tAssert.assertFalse(\"TextBlockTextEditor selectionSkin must not be visible when no characters selected\",\n\t\t\t\tthis._textEditor.getChildByName(SELECTION_SKIN_NAME).visible);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCursorAndSelectionSkinsWithMultipleCharactersSelected():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.selectRange(1, 3);\n\t\t\t//validate to be sure that the range is passed down to the text editor\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertFalse(\"TextBlockTextEditor cursorSkin must not be visible when multiple characters selected\",\n\t\t\t\tthis._textEditor.getChildByName(CURSOR_SKIN_NAME).visible);\n\t\t\tAssert.assertTrue(\"TextBlockTextEditor selectionSkin must be visible when multiple characters selected\",\n\t\t\t\tthis._textEditor.getChildByName(SELECTION_SKIN_NAME).visible);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCursorAndSelectionSkinsWithNoCharactersSelectedEditableFalseAndSelectableFalse():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.isEditable = false;\n\t\t\tthis._textInput.isSelectable = false;\n\t\t\tthis._textInput.selectRange(1, 1);\n\t\t\t//validate to be sure that the range is passed down to the text editor\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertFalse(\"TextBlockTextEditor cursorSkin must not be visible when no characters selected, isEditable is false, and isSelectable is false\",\n\t\t\t\tthis._textEditor.getChildByName(CURSOR_SKIN_NAME).visible);\n\t\t\tAssert.assertFalse(\"TextBlockTextEditor selectionSkin must not be visible when no characters selected, isEditable is false, and isSelectable is false\",\n\t\t\t\tthis._textEditor.getChildByName(SELECTION_SKIN_NAME).visible);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCursorAndSelectionSkinsWithMultipleCharactersSelectedEditableFalseAndSelectableFalse():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.isEditable = false;\n\t\t\tthis._textInput.isSelectable = false;\n\t\t\tthis._textInput.selectRange(1, 3);\n\t\t\t//validate to be sure that the range is passed down to the text editor\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertFalse(\"TextBlockTextEditor cursorSkin must not be visible when multiple characters selected, isEditable is false, and isSelectable is false\",\n\t\t\t\tthis._textEditor.getChildByName(CURSOR_SKIN_NAME).visible);\n\t\t\tAssert.assertFalse(\"TextBlockTextEditor selectionSkin must not be visible when multiple characters selected, isEditable is false, and isSelectable is false\",\n\t\t\t\tthis._textEditor.getChildByName(SELECTION_SKIN_NAME).visible);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCursorAndSelectionSkinsWithNoCharactersSelectedEditableTrueAndSelectableFalse():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.isEditable = true;\n\t\t\tthis._textInput.isSelectable = false;\n\t\t\tthis._textInput.selectRange(1, 1);\n\t\t\t//validate to be sure that the range is passed down to the text editor\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertTrue(\"TextBlockTextEditor cursorSkin must be visible when no characters selected, isEditable is true, and isSelectable is false\",\n\t\t\t\tthis._textEditor.getChildByName(CURSOR_SKIN_NAME).visible);\n\t\t\tAssert.assertFalse(\"TextBlockTextEditor selectionSkin must not be visible when no characters selected, isEditable is true, and isSelectable is false\",\n\t\t\t\tthis._textEditor.getChildByName(SELECTION_SKIN_NAME).visible);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCursorAndSelectionSkinsWithMultipleCharactersSelectedEditableTrueAndSelectableFalse():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.isEditable = true;\n\t\t\tthis._textInput.isSelectable = false;\n\t\t\tthis._textInput.selectRange(1, 3);\n\t\t\t//validate to be sure that the range is passed down to the text editor\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertFalse(\"TextBlockTextEditor cursorSkin must not be visible when multiple characters selected, isEditable is true, and isSelectable is false\",\n\t\t\t\tthis._textEditor.getChildByName(CURSOR_SKIN_NAME).visible);\n\t\t\tAssert.assertTrue(\"TextBlockTextEditor selectionSkin must be visible when multiple characters selected, isEditable is true, and isSelectable is false\",\n\t\t\t\tthis._textEditor.getChildByName(SELECTION_SKIN_NAME).visible);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCursorAndSelectionSkinsWithNoCharactersSelectedEditableFalseAndSelectableTrue():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.isEditable = false;\n\t\t\tthis._textInput.isSelectable = true;\n\t\t\tthis._textInput.selectRange(1, 1);\n\t\t\t//validate to be sure that the range is passed down to the text editor\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertFalse(\"TextBlockTextEditor cursorSkin must not be visible when no characters selected, isEditable is false, and isSelectable is true\",\n\t\t\t\tthis._textEditor.getChildByName(CURSOR_SKIN_NAME).visible);\n\t\t\tAssert.assertFalse(\"TextBlockTextEditor selectionSkin must not be visible when no characters selected, isEditable is false, and isSelectable is true\",\n\t\t\t\tthis._textEditor.getChildByName(SELECTION_SKIN_NAME).visible);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCursorAndSelectionSkinsWithMultipleCharactersSelectedEditableFalseAndSelectableTrue():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.isEditable = false;\n\t\t\tthis._textInput.isSelectable = true;\n\t\t\tthis._textInput.selectRange(1, 3);\n\t\t\t//validate to be sure that the range is passed down to the text editor\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertFalse(\"TextBlockTextEditor cursorSkin must not be visible when multiple characters selected, isEditable is false, and isSelectable is true\",\n\t\t\t\tthis._textEditor.getChildByName(CURSOR_SKIN_NAME).visible);\n\t\t\tAssert.assertTrue(\"TextBlockTextEditor selectionSkin must be visible when multiple characters selected, isEditable is false, and isSelectable is true\",\n\t\t\t\tthis._textEditor.getChildByName(SELECTION_SKIN_NAME).visible);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/TextBlockTextRendererTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.text.TextBlockTextRenderer;\n\timport feathers.tests.supportClasses.CustomStateContext;\n\timport feathers.text.FontStylesSet;\n\n\timport flash.text.engine.ElementFormat;\n\timport flash.text.engine.FontDescription;\n\n\timport org.flexunit.Assert;\n\n\timport starling.text.TextFormat;\n\n\tpublic class TextBlockTextRendererTests\n\t{\n\t\tprivate static const STATE_DISABLED:String = \"disabled\";\n\n\t\tprivate static const DEFAULT_FONT_NAME:String = \"DefaultFont\";\n\t\tprivate static const DEFAULT_FONT_SIZE:Number = 16;\n\t\tprivate static const DEFAULT_COLOR:uint = 0xff00ff;\n\t\tprivate static const DISABLED_FONT_NAME:String = \"DisabledFont\";\n\t\tprivate static const DISABLED_FONT_SIZE:Number = 15;\n\t\tprivate static const DISABLED_COLOR:uint = 0x999999;\n\t\tprivate static const SELECTED_FONT_NAME:String = \"SelectedFont\";\n\t\tprivate static const SELECTED_FONT_SIZE:Number = 17;\n\t\tprivate static const SELECTED_COLOR:uint = 0xff0000;\n\t\tprivate static const STATE_FONT_NAME:String = \"StateFont\";\n\t\tprivate static const STATE_FONT_SIZE:Number = 18;\n\t\tprivate static const STATE_COLOR:uint = 0xffffff;\n\n\t\tprivate var _textRenderer:TextBlockTextRenderer;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._textRenderer = new TextBlockTextRenderer();\n\t\t\tTestFeathers.starlingRoot.addChild(this._textRenderer);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._textRenderer.removeFromParent(true);\n\t\t\tthis._textRenderer = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testOneLineWithEmptyString():void\n\t\t{\n\t\t\tthis._textRenderer.text = \"\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer numLines must be 1 with empty string\", 1, this._textRenderer.numLines);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testOneLine():void\n\t\t{\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer numLines must be 1\", 1, this._textRenderer.numLines);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNumLinesWithLineBreak():void\n\t\t{\n\t\t\tthis._textRenderer.text = \"Hello\\nWorld\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer numLines must be 2 when line break is in text\", 2, this._textRenderer.numLines);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNumLinesWithCarriageReturn():void\n\t\t{\n\t\t\tthis._textRenderer.text = \"Hello\\rWorld\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer numLines must be 2 when carriage return is in text\", 2, this._textRenderer.numLines);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testValidateWithoutTextThenSetText():void\n\t\t{\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.validate();\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.fontDescription.fontName must be equal to starling.text.TextFormat font\",\n\t\t\t\tDEFAULT_FONT_NAME, this._textRenderer.currentElementFormat.fontDescription.fontName);\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.fontSize must be equal to starling.text.TextFormat size\",\n\t\t\t\tDEFAULT_FONT_SIZE, this._textRenderer.currentElementFormat.fontSize);\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDEFAULT_COLOR, this._textRenderer.currentElementFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetElementFormatForStateWithoutSetElementFormatForState():void\n\t\t{\n\t\t\tAssert.assertNull(\"TextBlockTextRenderer getElementFormatForState() must return null if ElementFormat not provided with setElementFormatForState()\",\n\t\t\t\tthis._textRenderer.getElementFormatForState(STATE_DISABLED));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetElementFormatForStateAfterSetElementFormatForState():void\n\t\t{\n\t\t\tvar elementFormat:ElementFormat = new ElementFormat();\n\t\t\tthis._textRenderer.setElementFormatForState(STATE_DISABLED, elementFormat);\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer getElementFormatForState() must return value passed to setElementFormatForState() with same state\",\n\t\t\t\telementFormat, this._textRenderer.getElementFormatForState(STATE_DISABLED));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentElementFormatWithElementFormat():void\n\t\t{\n\t\t\tvar font:FontDescription = new FontDescription(\"_sans\");\n\t\t\tthis._textRenderer.elementFormat = new ElementFormat(font);\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat must be equal to elementFormat when no other element formats are specified\",\n\t\t\t\tthis._textRenderer.elementFormat, this._textRenderer.currentElementFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentElementFormatWithElementFormatAndDisabled():void\n\t\t{\n\t\t\tvar font:FontDescription = new FontDescription(\"_sans\");\n\t\t\tthis._textRenderer.elementFormat = new ElementFormat(font);\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.isEnabled = false;\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat must be equal to elementFormat when isEnabled is false, but no other element formats are specified\",\n\t\t\t\tthis._textRenderer.elementFormat, this._textRenderer.currentElementFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentElementFormatWithDisabledElementFormatAndDisabled():void\n\t\t{\n\t\t\tvar font:FontDescription = new FontDescription(\"_sans\");\n\t\t\tthis._textRenderer.elementFormat = new ElementFormat(font);\n\t\t\tthis._textRenderer.disabledElementFormat = new ElementFormat(font);\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.isEnabled = false;\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat must be equal to disabledElementFormat when isEnabled is false and disabledElementFormat is not null\",\n\t\t\t\tthis._textRenderer.disabledElementFormat, this._textRenderer.currentElementFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentElementFormatWithElementFormatAndStateContextDisabled():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isEnabled = false;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tvar font:FontDescription = new FontDescription(\"_sans\");\n\t\t\tthis._textRenderer.elementFormat = new ElementFormat(font);\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat must be equal to elementFormat when stateContext isEnabled is false, but no other element formats are specified\",\n\t\t\t\tthis._textRenderer.elementFormat, this._textRenderer.currentElementFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentElementFormatWithDisabledElementFormatAndStateContextDisabled():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isEnabled = false;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tvar font:FontDescription = new FontDescription(\"_sans\");\n\t\t\tthis._textRenderer.elementFormat = new ElementFormat(font);\n\t\t\tthis._textRenderer.disabledElementFormat = new ElementFormat(font);\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat must be equal to disabledElementFormat when isEnabled is false and disabledElementFormat is not null\",\n\t\t\t\tthis._textRenderer.disabledElementFormat, this._textRenderer.currentElementFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentElementFormatWithElementFormatAndStateContextSelected():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isSelected = true;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tvar font:FontDescription = new FontDescription(\"_sans\");\n\t\t\tthis._textRenderer.elementFormat = new ElementFormat(font);\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat must be equal to elementFormat when stateContext isSelected is true, but no other element formats are specified\",\n\t\t\t\tthis._textRenderer.elementFormat, this._textRenderer.currentElementFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentElementFormatWithSelectedElementFormatAndStateContextSelected():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isSelected = true;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tvar font:FontDescription = new FontDescription(\"_sans\");\n\t\t\tthis._textRenderer.elementFormat = new ElementFormat(font);\n\t\t\tthis._textRenderer.selectedElementFormat = new ElementFormat(font);\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat must be equal to selectedElementFormat when isSelected is true and selectedElementFormat is not null\",\n\t\t\t\tthis._textRenderer.selectedElementFormat, this._textRenderer.currentElementFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentElementFormatWithSelectedAndDisabledElementFormatAndStateContextSelectedAndDisabled():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isSelected = true;\n\t\t\tstateContext.isEnabled = false;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tvar font:FontDescription = new FontDescription(\"_sans\");\n\t\t\tthis._textRenderer.elementFormat = new ElementFormat(font);\n\t\t\tthis._textRenderer.disabledElementFormat = new ElementFormat(font);\n\t\t\tthis._textRenderer.selectedElementFormat = new ElementFormat(font);\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\t//disabled should get priority over selected\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat must be equal to disabledElementFormat when isSelected is true and isEnabled is false and both selectedElementFormat and disabledElementFormat are not null\",\n\t\t\t\tthis._textRenderer.disabledElementFormat, this._textRenderer.currentElementFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentElementFormatWithOnlyElementFormatAndStateContextCurrentState():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.currentState = STATE_DISABLED;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tvar font:FontDescription = new FontDescription(\"_sans\");\n\t\t\tthis._textRenderer.elementFormat = new ElementFormat(font);\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat must be equal to elementFormat when no other element formats are specified\",\n\t\t\t\tthis._textRenderer.elementFormat, this._textRenderer.currentElementFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentElementFormatWithDisabledElementFormatAndStateElementFormatWithStateContextDisabledAndCurrentState():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isEnabled = false;\n\t\t\tstateContext.isSelected = true;\n\t\t\tstateContext.currentState = STATE_DISABLED;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tvar font:FontDescription = new FontDescription(\"_sans\");\n\t\t\tthis._textRenderer.elementFormat = new ElementFormat(font);\n\t\t\tthis._textRenderer.disabledElementFormat = new ElementFormat(font);\n\t\t\tthis._textRenderer.selectedElementFormat = new ElementFormat(font);\n\t\t\tvar disabledStateElementFormat:ElementFormat = new ElementFormat(font);\n\t\t\tthis._textRenderer.setElementFormatForState(STATE_DISABLED, disabledStateElementFormat);\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\t//exact states always get priority over default/disabled/selected\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat must be equal to ElementFormat passed into setElementFormatForState() when isEnabled is false and disabledElementFormat are not null\",\n\t\t\t\tdisabledStateElementFormat, this._textRenderer.currentElementFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFontStylesIgnoredIfAdvancedElementFormatExists():void\n\t\t{\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new TextFormat();\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tvar font:FontDescription = new FontDescription(\"_sans\");\n\t\t\tthis._textRenderer.elementFormat = new ElementFormat(font);\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat must be equal to elementFormat and not a format from font styles\",\n\t\t\t\tthis._textRenderer.elementFormat, this._textRenderer.currentElementFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentElementFormatWithFontStyles():void\n\t\t{\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.fontDescription.fontName must be equal to starling.text.TextFormat font\",\n\t\t\t\tDEFAULT_FONT_NAME, this._textRenderer.currentElementFormat.fontDescription.fontName);\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.fontSize must be equal to starling.text.TextFormat size\",\n\t\t\t\tDEFAULT_FONT_SIZE, this._textRenderer.currentElementFormat.fontSize);\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDEFAULT_COLOR, this._textRenderer.currentElementFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentElementFormatFallBackToDefaultFontStylesWhenDisabled():void\n\t\t{\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.isEnabled = false;\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.fontDescription.fontName must be equal to starling.text.TextFormat font\",\n\t\t\t\tDEFAULT_FONT_NAME, this._textRenderer.currentElementFormat.fontDescription.fontName);\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.fontSize must be equal to starling.text.TextFormat size\",\n\t\t\t\tDEFAULT_FONT_SIZE, this._textRenderer.currentElementFormat.fontSize);\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDEFAULT_COLOR, this._textRenderer.currentElementFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentElementFormatUseDisabledFontStylesWhenDisabled():void\n\t\t{\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tfontStyles.disabledFormat = new TextFormat(DISABLED_FONT_NAME, DISABLED_FONT_SIZE, DISABLED_COLOR);\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.isEnabled = false;\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.fontDescription.fontName must be equal to starling.text.TextFormat font\",\n\t\t\t\tDISABLED_FONT_NAME, this._textRenderer.currentElementFormat.fontDescription.fontName);\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.fontSize must be equal to starling.text.TextFormat size\",\n\t\t\t\tDISABLED_FONT_SIZE, this._textRenderer.currentElementFormat.fontSize);\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDISABLED_COLOR, this._textRenderer.currentElementFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentElementFormatFallBackToDefaultFontStylesWithStateContextDisabled():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isEnabled = false;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.fontDescription.fontName must be equal to starling.text.TextFormat font\",\n\t\t\t\tDEFAULT_FONT_NAME, this._textRenderer.currentElementFormat.fontDescription.fontName);\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.fontSize must be equal to starling.text.TextFormat size\",\n\t\t\t\tDEFAULT_FONT_SIZE, this._textRenderer.currentElementFormat.fontSize);\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDEFAULT_COLOR, this._textRenderer.currentElementFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentElementFormatUseDisabledFontStylesWithStateContextDisabled():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isEnabled = false;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tfontStyles.disabledFormat = new TextFormat(DISABLED_FONT_NAME, DISABLED_FONT_SIZE, DISABLED_COLOR);\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.fontDescription.fontName must be equal to starling.text.TextFormat font\",\n\t\t\t\tDISABLED_FONT_NAME, this._textRenderer.currentElementFormat.fontDescription.fontName);\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.fontSize must be equal to starling.text.TextFormat size\",\n\t\t\t\tDISABLED_FONT_SIZE, this._textRenderer.currentElementFormat.fontSize);\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDISABLED_COLOR, this._textRenderer.currentElementFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentElementFormatFallBackToDefaultFontStylesWithStateContextSelected():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isSelected = true;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.fontDescription.fontName must be equal to starling.text.TextFormat font\",\n\t\t\t\tDEFAULT_FONT_NAME, this._textRenderer.currentElementFormat.fontDescription.fontName);\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.fontSize must be equal to starling.text.TextFormat size\",\n\t\t\t\tDEFAULT_FONT_SIZE, this._textRenderer.currentElementFormat.fontSize);\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDEFAULT_COLOR, this._textRenderer.currentElementFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentElementFormatUseSelectedFontStylesWithStateContextSelected():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isSelected = true;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tfontStyles.selectedFormat = new TextFormat(SELECTED_FONT_NAME, SELECTED_FONT_SIZE, SELECTED_COLOR);\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.fontDescription.fontName must be equal to starling.text.TextFormat font\",\n\t\t\t\tSELECTED_FONT_NAME, this._textRenderer.currentElementFormat.fontDescription.fontName);\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.fontSize must be equal to starling.text.TextFormat size\",\n\t\t\t\tSELECTED_FONT_SIZE, this._textRenderer.currentElementFormat.fontSize);\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tSELECTED_COLOR, this._textRenderer.currentElementFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentElementFormatUseDisabledFontStylesWithStateContextSelectedAndDisabled():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isSelected = true;\n\t\t\tstateContext.isEnabled = false;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tfontStyles.selectedFormat = new TextFormat(SELECTED_FONT_NAME, SELECTED_FONT_SIZE, SELECTED_COLOR);\n\t\t\tfontStyles.disabledFormat = new TextFormat(DISABLED_FONT_NAME, DISABLED_FONT_SIZE, DISABLED_COLOR);\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\t//disabled should get priority over selected\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.fontDescription.fontName must be equal to starling.text.TextFormat font\",\n\t\t\t\tDISABLED_FONT_NAME, this._textRenderer.currentElementFormat.fontDescription.fontName);\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.fontSize must be equal to starling.text.TextFormat size\",\n\t\t\t\tDISABLED_FONT_SIZE, this._textRenderer.currentElementFormat.fontSize);\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDISABLED_COLOR, this._textRenderer.currentElementFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentElementFormatFallBackToDefaultFontStylesWithStateContextCurrentState():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.currentState = STATE_DISABLED;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.fontDescription.fontName must be equal to starling.text.TextFormat font\",\n\t\t\t\tDEFAULT_FONT_NAME, this._textRenderer.currentElementFormat.fontDescription.fontName);\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.fontSize must be equal to starling.text.TextFormat size\",\n\t\t\t\tDEFAULT_FONT_SIZE, this._textRenderer.currentElementFormat.fontSize);\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDEFAULT_COLOR, this._textRenderer.currentElementFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentElementFormatUseStateFontStylesWithStateContextCurrentState():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.currentState = STATE_DISABLED;\n\t\t\tstateContext.isSelected = true;\n\t\t\tstateContext.isEnabled = false;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tfontStyles.selectedFormat = new TextFormat(SELECTED_FONT_NAME, SELECTED_FONT_SIZE, SELECTED_COLOR);\n\t\t\tfontStyles.disabledFormat = new TextFormat(DISABLED_FONT_NAME, DISABLED_FONT_SIZE, DISABLED_COLOR);\n\t\t\tfontStyles.setFormatForState(STATE_DISABLED, new TextFormat(STATE_FONT_NAME, STATE_FONT_SIZE, STATE_COLOR));\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\t//exact states always get priority over default/disabled/selected\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.fontDescription.fontName must be equal to starling.text.TextFormat font\",\n\t\t\t\tSTATE_FONT_NAME, this._textRenderer.currentElementFormat.fontDescription.fontName);\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.fontSize must be equal to starling.text.TextFormat size\",\n\t\t\t\tSTATE_FONT_SIZE, this._textRenderer.currentElementFormat.fontSize);\n\t\t\tAssert.assertStrictlyEquals(\"TextBlockTextRenderer currentElementFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tSTATE_COLOR, this._textRenderer.currentElementFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInvalidAfterChangePropertyOfFontStyles():void\n\t\t{\n\t\t\tvar format:TextFormat = new TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = format\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tformat.color = SELECTED_COLOR;\n\t\t\tAssert.assertTrue(\"TextBlockTextRenderer: must be invalid after changing property of font styles.\",\n\t\t\t\tthis._textRenderer.isInvalid());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/TextFieldTextEditorFocusTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.TextInput;\n\timport feathers.controls.TextInputState;\n\timport feathers.controls.text.TextFieldTextEditor;\n\timport feathers.core.FocusManager;\n\timport feathers.events.FeathersEventType;\n\n\timport flash.events.FocusEvent;\n\timport flash.ui.Keyboard;\n\n\timport org.flexunit.Assert;\n\timport org.flexunit.async.Async;\n\n\timport starling.core.Starling;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\n\tpublic class TextFieldTextEditorFocusTests\n\t{\n\t\tprivate var _textInput:TextInput;\n\t\tprivate var _textInput2:TextInput;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, true);\n\t\t\t\n\t\t\tthis._textInput = new TextInput();\n\t\t\tthis._textInput.backgroundSkin = new Quad(200, 200);\n\t\t\tthis._textInput.textEditorFactory = textEditorFactory;\n\t\t\tTestFeathers.starlingRoot.addChild(this._textInput);\n\t\t\tthis._textInput.validate();\n\n\t\t\tthis._textInput2 = new TextInput();\n\t\t\tthis._textInput2.backgroundSkin = new Quad(200, 200);\n\t\t\tthis._textInput2.textEditorFactory = textEditorFactory;\n\t\t\tthis._textInput2.y = 210;\n\t\t\tTestFeathers.starlingRoot.addChild(this._textInput2);\n\t\t\tthis._textInput2.validate();\n\t\t}\n\n\t\tprivate function textEditorFactory():TextFieldTextEditor\n\t\t{\n\t\t\tvar textEditor:TextFieldTextEditor = new TextFieldTextEditor();\n\t\t\treturn textEditor;\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\t//one of the tests sets the parent's visible property to false, so\n\t\t\t//it needs to be reset.\n\t\t\tthis._textInput.parent.visible = true;\n\t\t\t\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, false);\n\t\t\t\n\t\t\tthis._textInput.removeFromParent(true);\n\t\t\tthis._textInput = null;\n\n\t\t\tthis._textInput2.removeFromParent(true);\n\t\t\tthis._textInput2 = null;\n\t\t\t\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChangeFocusOnTabKey():void\n\t\t{\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tStarling.current.nativeStage.dispatchEvent(new FocusEvent(FocusEvent.KEY_FOCUS_CHANGE, true, false, null, false, Keyboard.TAB));\n\t\t\tAssert.assertStrictlyEquals(\"The FocusManager did not change focus when pressing Keyboard.TAB\", this._textInput.focusManager.focus, this._textInput2);\n\t\t}\n\n\t\t[Test(async)]\n\t\tpublic function testFocusOutEventAfterSetTextInputParentVisibleToFalse():void\n\t\t{\n\t\t\tvar hasDispatchedFocusOut:Boolean = false;\n\t\t\tthis._textInput.addEventListener(FeathersEventType.FOCUS_OUT, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedFocusOut = true;\n\t\t\t});\n\t\t\tthis._textInput.setFocus();\n\t\t\tthis._textInput.parent.visible = false;\n\t\t\tAsync.delayCall(this, function():void\n\t\t\t{\n\t\t\t\tAssert.assertTrue(\"FeathersEventType.FOCUS_OUT was not dispatched after setting TextInput parent's visible property to false when using TextFieldTextEditor\", hasDispatchedFocusOut);\n\t\t\t}, 100);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetFocusWhenFocusEnabledFalse():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.isFocusEnabled = false;\n\t\t\tthis._textInput.validate();\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertTrue(\"TextFieldTextEditor nativeFocus must not receive nativeStage focus when isFocusEnabled is false\",\n\t\t\t\tStarling.current.nativeStage.focus !== this._textInput.nativeFocus);\n\t\t\tAssert.assertTrue(\"TextInput must not receive FocusManager focus when using TextFieldTextEditor and isFocusEnabled is false\",\n\t\t\t\tthis._textInput.focusManager.focus !== this._textInput);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state must be TextInputState.ENABLED after receive FocusManager focus when using TextFieldTextEditor and isFocusEnabled is false\",\n\t\t\t\tTextInputState.ENABLED, this._textInput.currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetFocusWhenEditableFalseAndSelectableFalse():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.isEditable = false;\n\t\t\tthis._textInput.isSelectable = false;\n\t\t\tthis._textInput.validate();\n\t\t\tAssert.assertNotNull(\"TextFieldTextEditor nativeFocus must not be null when isEditable is false and isSelectable is false\",\n\t\t\t\tthis._textInput.nativeFocus);\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor nativeFocus must receive nativeStage focus when isEditable is false and isSelectable is false\",\n\t\t\t\tStarling.current.nativeStage.focus, this._textInput.nativeFocus);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput must receive FocusManager focus when using TextFieldTextEditor and isEditable is false and isSelectable is false\",\n\t\t\t\tthis._textInput.focusManager.focus, this._textInput);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state must be TextInputState.FOCUSED after receive FocusManager focus when using TextFieldTextEditor and isEditable is false and isSelectable is false\",\n\t\t\t\tTextInputState.FOCUSED, this._textInput.currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetFocusWhenEditableTrueAndSelectableFalse():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.isEditable = true;\n\t\t\tthis._textInput.isSelectable = false;\n\t\t\tthis._textInput.validate();\n\t\t\tAssert.assertNotNull(\"TextFieldTextEditor nativeFocus must not be null when isEditable is true and isSelectable is false\",\n\t\t\t\tthis._textInput.nativeFocus);\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor nativeFocus must receive nativeStage focus when isEditable is true and isSelectable is false\",\n\t\t\t\tStarling.current.nativeStage.focus, this._textInput.nativeFocus);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput must receive FocusManager focus when using TextFieldTextEditor and isEditable is true and isSelectable is false\",\n\t\t\t\tthis._textInput.focusManager.focus, this._textInput);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state must be TextInputState.FOCUSED after receive FocusManager focus when using TextFieldTextEditor and isEditable is true and isSelectable is false\",\n\t\t\t\tTextInputState.FOCUSED, this._textInput.currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetFocusWhenEditableFalseAndSelectableTrue():void\n\t\t{\n\t\t\tthis._textInput.text = \"Hello World\";\n\t\t\tthis._textInput.isEditable = false;\n\t\t\tthis._textInput.isSelectable = true;\n\t\t\tthis._textInput.validate();\n\t\t\tAssert.assertNotNull(\"TextFieldTextEditor nativeFocus must not be null when isEditable is false and isSelectable is true\",\n\t\t\t\tthis._textInput.nativeFocus);\n\t\t\tthis._textInput.focusManager.focus = this._textInput;\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor nativeFocus must have nativeStage focus\",\n\t\t\t\tStarling.current.nativeStage.focus, this._textInput.nativeFocus);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput must receive FocusManager focus when using TextFieldTextEditor and isEditable is false and isSelectable is true\",\n\t\t\t\tthis._textInput.focusManager.focus, this._textInput);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state must be TextInputState.FOCUSED after receive FocusManager focus when using TextFieldTextEditor and isEditable is false and isSelectable is true\",\n\t\t\t\tTextInputState.FOCUSED, this._textInput.currentState);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/TextFieldTextEditorTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.text.TextFieldTextEditor;\n\timport feathers.tests.supportClasses.CustomStateContext;\n\timport feathers.text.FontStylesSet;\n\n\timport flash.text.TextFormat;\n\n\timport org.flexunit.Assert;\n\n\timport starling.text.TextFormat;\n\n\tpublic class TextFieldTextEditorTests\n\t{\n\t\tprivate static const STATE_DISABLED:String = \"disabled\";\n\n\t\tprivate static const DEFAULT_FONT_NAME:String = \"DefaultFont\";\n\t\tprivate static const DEFAULT_FONT_SIZE:Number = 16;\n\t\tprivate static const DEFAULT_COLOR:uint = 0xff00ff;\n\t\tprivate static const DISABLED_FONT_NAME:String = \"DisabledFont\";\n\t\tprivate static const DISABLED_FONT_SIZE:Number = 15;\n\t\tprivate static const DISABLED_COLOR:uint = 0x999999;\n\t\tprivate static const STATE_FONT_NAME:String = \"StateFont\";\n\t\tprivate static const STATE_FONT_SIZE:Number = 18;\n\t\tprivate static const STATE_COLOR:uint = 0xffffff;\n\n\t\tprivate var _textEditor:TextFieldTextEditor;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._textEditor = new TextFieldTextEditor();\n\t\t\tTestFeathers.starlingRoot.addChild(this._textEditor);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._textEditor.removeFromParent(true);\n\t\t\tthis._textEditor = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetTextFormatForStateWithoutSetTextFormatForState():void\n\t\t{\n\t\t\tAssert.assertNull(\"TextFieldTextEditor getTextFormatForState() must return null if TextFormat not provided with setTextFormatForState()\",\n\t\t\t\tthis._textEditor.getTextFormatForState(STATE_DISABLED));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetTextFormatForStateAfterSetTextFormatForState():void\n\t\t{\n\t\t\tvar textFormat:flash.text.TextFormat = new flash.text.TextFormat();\n\t\t\tthis._textEditor.setTextFormatForState(STATE_DISABLED, textFormat);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor getTextFormatForState() must return value passed to setTextFormatForState() with same state\",\n\t\t\t\ttextFormat, this._textEditor.getTextFormatForState(STATE_DISABLED));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithTextFormat():void\n\t\t{\n\t\t\tthis._textEditor.textFormat = new flash.text.TextFormat();\n\t\t\tthis._textEditor.text = \"Hello World\";\n\t\t\tthis._textEditor.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat must be equal to textFormat when no other text formats are specified\",\n\t\t\t\tthis._textEditor.textFormat, this._textEditor.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithTextFormatAndDisabled():void\n\t\t{\n\t\t\tthis._textEditor.textFormat = new flash.text.TextFormat();\n\t\t\tthis._textEditor.text = \"Hello World\";\n\t\t\tthis._textEditor.isEnabled = false;\n\t\t\tthis._textEditor.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat must be equal to textFormat when isEnabled is false, but no other text formats are specified\",\n\t\t\t\tthis._textEditor.textFormat, this._textEditor.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithDisabledTextFormatAndDisabled():void\n\t\t{\n\t\t\tthis._textEditor.textFormat = new flash.text.TextFormat();\n\t\t\tthis._textEditor.disabledTextFormat = new flash.text.TextFormat();\n\t\t\tthis._textEditor.text = \"Hello World\";\n\t\t\tthis._textEditor.isEnabled = false;\n\t\t\tthis._textEditor.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat must be equal to disabledTextFormat when isEnabled is false and disabledTextFormat is not null\",\n\t\t\t\tthis._textEditor.disabledTextFormat, this._textEditor.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithTextFormatAndStateContextDisabled():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isEnabled = false;\n\t\t\tthis._textEditor.stateContext = stateContext;\n\t\t\tthis._textEditor.textFormat = new flash.text.TextFormat();\n\t\t\tthis._textEditor.text = \"Hello World\";\n\t\t\tthis._textEditor.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat must be equal to textFormat when stateContext isEnabled is false, but no other text formats are specified\",\n\t\t\t\tthis._textEditor.textFormat, this._textEditor.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithDisabledTextFormatAndStateContextDisabled():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isEnabled = false;\n\t\t\tthis._textEditor.stateContext = stateContext;\n\t\t\tthis._textEditor.textFormat = new flash.text.TextFormat();\n\t\t\tthis._textEditor.disabledTextFormat = new flash.text.TextFormat();\n\t\t\tthis._textEditor.text = \"Hello World\";\n\t\t\tthis._textEditor.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat must be equal to disabledTextFormat when isEnabled is false and disabledTextFormat is not null\",\n\t\t\t\tthis._textEditor.disabledTextFormat, this._textEditor.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithTextFormatAndStateContextSelected():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isSelected = true;\n\t\t\tthis._textEditor.stateContext = stateContext;\n\t\t\tthis._textEditor.textFormat = new flash.text.TextFormat();\n\t\t\tthis._textEditor.text = \"Hello World\";\n\t\t\tthis._textEditor.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat must be equal to textFormat when stateContext isSelected is true, but no other text formats are specified\",\n\t\t\t\tthis._textEditor.textFormat, this._textEditor.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithOnlyTextFormatAndStateContextCurrentState():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.currentState = STATE_DISABLED;\n\t\t\tthis._textEditor.stateContext = stateContext;\n\t\t\tthis._textEditor.textFormat = new flash.text.TextFormat();\n\t\t\tthis._textEditor.text = \"Hello World\";\n\t\t\tthis._textEditor.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat must be equal to textFormat when no other text formats are specified\",\n\t\t\t\tthis._textEditor.textFormat, this._textEditor.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithDisabledTextFormatAndStateTextFormatWithStateContextDisabledAndCurrentState():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isEnabled = false;\n\t\t\tstateContext.currentState = STATE_DISABLED;\n\t\t\tthis._textEditor.stateContext = stateContext;\n\t\t\tthis._textEditor.textFormat = new flash.text.TextFormat();\n\t\t\tthis._textEditor.disabledTextFormat = new flash.text.TextFormat();\n\t\t\tvar disabledStateTextFormat:flash.text.TextFormat = new flash.text.TextFormat();\n\t\t\tthis._textEditor.setTextFormatForState(STATE_DISABLED, disabledStateTextFormat);\n\t\t\tthis._textEditor.text = \"Hello World\";\n\t\t\tthis._textEditor.validate();\n\t\t\t//exact states always get priority over default/disabled\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat must be equal to flash.text.TextFormat passed into setTextFormatForState() when isEnabled is false and disabledTextFormat are not null\",\n\t\t\t\tdisabledStateTextFormat, this._textEditor.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFontStylesIgnoredIfAdvancedTextFormatExists():void\n\t\t{\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new starling.text.TextFormat();\n\t\t\tthis._textEditor.fontStyles = fontStyles;\n\t\t\tthis._textEditor.textFormat = new flash.text.TextFormat();\n\t\t\tthis._textEditor.text = \"Hello World\";\n\t\t\tthis._textEditor.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat must be equal to elementFormat and not a format from font styles\",\n\t\t\t\tthis._textEditor.textFormat, this._textEditor.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithFontStyles():void\n\t\t{\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new starling.text.TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tthis._textEditor.fontStyles = fontStyles;\n\t\t\tthis._textEditor.text = \"Hello World\";\n\t\t\tthis._textEditor.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat.font must be equal to starling.text.TextFormat font\",\n\t\t\t\tDEFAULT_FONT_NAME, this._textEditor.currentTextFormat.font);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat.size must be equal to starling.text.TextFormat size\",\n\t\t\t\tDEFAULT_FONT_SIZE, this._textEditor.currentTextFormat.size);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDEFAULT_COLOR, this._textEditor.currentTextFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatFallBackToDefaultFontStylesWhenDisabled():void\n\t\t{\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new starling.text.TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tthis._textEditor.fontStyles = fontStyles;\n\t\t\tthis._textEditor.text = \"Hello World\";\n\t\t\tthis._textEditor.isEnabled = false;\n\t\t\tthis._textEditor.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat.font must be equal to starling.text.TextFormat font\",\n\t\t\t\tDEFAULT_FONT_NAME, this._textEditor.currentTextFormat.font);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat.size must be equal to starling.text.TextFormat size\",\n\t\t\t\tDEFAULT_FONT_SIZE, this._textEditor.currentTextFormat.size);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDEFAULT_COLOR, this._textEditor.currentTextFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatUseDisabledFontStylesWhenDisabled():void\n\t\t{\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new starling.text.TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tfontStyles.disabledFormat = new starling.text.TextFormat(DISABLED_FONT_NAME, DISABLED_FONT_SIZE, DISABLED_COLOR);\n\t\t\tthis._textEditor.fontStyles = fontStyles;\n\t\t\tthis._textEditor.text = \"Hello World\";\n\t\t\tthis._textEditor.isEnabled = false;\n\t\t\tthis._textEditor.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat.font must be equal to starling.text.TextFormat font\",\n\t\t\t\tDISABLED_FONT_NAME, this._textEditor.currentTextFormat.font);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat.size must be equal to starling.text.TextFormat size\",\n\t\t\t\tDISABLED_FONT_SIZE, this._textEditor.currentTextFormat.size);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDISABLED_COLOR, this._textEditor.currentTextFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatFallBackToDefaultFontStylesWithStateContextDisabled():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isEnabled = false;\n\t\t\tthis._textEditor.stateContext = stateContext;\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new starling.text.TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tthis._textEditor.fontStyles = fontStyles;\n\t\t\tthis._textEditor.text = \"Hello World\";\n\t\t\tthis._textEditor.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat.font must be equal to starling.text.TextFormat font\",\n\t\t\t\tDEFAULT_FONT_NAME, this._textEditor.currentTextFormat.font);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat.size must be equal to starling.text.TextFormat size\",\n\t\t\t\tDEFAULT_FONT_SIZE, this._textEditor.currentTextFormat.size);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDEFAULT_COLOR, this._textEditor.currentTextFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatUseDisabledFontStylesWithStateContextDisabled():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isEnabled = false;\n\t\t\tthis._textEditor.stateContext = stateContext;\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new starling.text.TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tfontStyles.disabledFormat = new starling.text.TextFormat(DISABLED_FONT_NAME, DISABLED_FONT_SIZE, DISABLED_COLOR);\n\t\t\tthis._textEditor.fontStyles = fontStyles;\n\t\t\tthis._textEditor.text = \"Hello World\";\n\t\t\tthis._textEditor.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat.font must be equal to starling.text.TextFormat font\",\n\t\t\t\tDISABLED_FONT_NAME, this._textEditor.currentTextFormat.font);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat.size must be equal to starling.text.TextFormat size\",\n\t\t\t\tDISABLED_FONT_SIZE, this._textEditor.currentTextFormat.size);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDISABLED_COLOR, this._textEditor.currentTextFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatFallBackToDefaultFontStylesWithStateContextSelected():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isSelected = true;\n\t\t\tthis._textEditor.stateContext = stateContext;\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new starling.text.TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tthis._textEditor.fontStyles = fontStyles;\n\t\t\tthis._textEditor.text = \"Hello World\";\n\t\t\tthis._textEditor.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat.font must be equal to starling.text.TextFormat font\",\n\t\t\t\tDEFAULT_FONT_NAME, this._textEditor.currentTextFormat.font);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat.size must be equal to starling.text.TextFormat size\",\n\t\t\t\tDEFAULT_FONT_SIZE, this._textEditor.currentTextFormat.size);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDEFAULT_COLOR, this._textEditor.currentTextFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatFallBackToDefaultFontStylesWithStateContextCurrentState():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.currentState = STATE_DISABLED;\n\t\t\tthis._textEditor.stateContext = stateContext;\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new starling.text.TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tthis._textEditor.fontStyles = fontStyles;\n\t\t\tthis._textEditor.text = \"Hello World\";\n\t\t\tthis._textEditor.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat.font must be equal to starling.text.TextFormat font\",\n\t\t\t\tDEFAULT_FONT_NAME, this._textEditor.currentTextFormat.font);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat.size must be equal to starling.text.TextFormat size\",\n\t\t\t\tDEFAULT_FONT_SIZE, this._textEditor.currentTextFormat.size);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDEFAULT_COLOR, this._textEditor.currentTextFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatUseStateFontStylesWithStateContextCurrentState():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.currentState = STATE_DISABLED;\n\t\t\tstateContext.isSelected = true;\n\t\t\tstateContext.isEnabled = false;\n\t\t\tthis._textEditor.stateContext = stateContext;\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new starling.text.TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tfontStyles.disabledFormat = new starling.text.TextFormat(DISABLED_FONT_NAME, DISABLED_FONT_SIZE, DISABLED_COLOR);\n\t\t\tfontStyles.setFormatForState(STATE_DISABLED, new starling.text.TextFormat(STATE_FONT_NAME, STATE_FONT_SIZE, STATE_COLOR));\n\t\t\tthis._textEditor.fontStyles = fontStyles;\n\t\t\tthis._textEditor.text = \"Hello World\";\n\t\t\tthis._textEditor.validate();\n\t\t\t//exact states always get priority over default/disabled\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat.font must be equal to starling.text.TextFormat font\",\n\t\t\t\tSTATE_FONT_NAME, this._textEditor.currentTextFormat.font);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat.size must be equal to starling.text.TextFormat size\",\n\t\t\t\tSTATE_FONT_SIZE, this._textEditor.currentTextFormat.size);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextEditor currentTextFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tSTATE_COLOR, this._textEditor.currentTextFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInvalidAfterChangePropertyOfFontStyles():void\n\t\t{\n\t\t\tvar format:starling.text.TextFormat = new starling.text.TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = format\n\t\t\tthis._textEditor.fontStyles = fontStyles;\n\t\t\tthis._textEditor.text = \"Hello World\";\n\t\t\tthis._textEditor.validate();\n\t\t\tformat.color = DISABLED_COLOR;\n\t\t\tAssert.assertTrue(\"TextFieldTextEditor: must be invalid after changing property of font styles.\",\n\t\t\t\tthis._textEditor.isInvalid());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/TextFieldTextRendererTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.text.TextFieldTextRenderer;\n\timport feathers.tests.supportClasses.CustomStateContext;\n\timport feathers.text.FontStylesSet;\n\n\timport flash.text.TextFormat;\n\n\timport org.flexunit.Assert;\n\n\timport starling.text.TextFormat;\n\n\tpublic class TextFieldTextRendererTests\n\t{\n\t\tprivate static const STATE_DISABLED:String = \"disabled\";\n\n\t\tprivate static const DEFAULT_FONT_NAME:String = \"DefaultFont\";\n\t\tprivate static const DEFAULT_FONT_SIZE:Number = 16;\n\t\tprivate static const DEFAULT_COLOR:uint = 0xff00ff;\n\t\tprivate static const DISABLED_FONT_NAME:String = \"DisabledFont\";\n\t\tprivate static const DISABLED_FONT_SIZE:Number = 15;\n\t\tprivate static const DISABLED_COLOR:uint = 0x999999;\n\t\tprivate static const SELECTED_FONT_NAME:String = \"SelectedFont\";\n\t\tprivate static const SELECTED_FONT_SIZE:Number = 17;\n\t\tprivate static const SELECTED_COLOR:uint = 0xff0000;\n\t\tprivate static const STATE_FONT_NAME:String = \"StateFont\";\n\t\tprivate static const STATE_FONT_SIZE:Number = 18;\n\t\tprivate static const STATE_COLOR:uint = 0xffffff;\n\n\t\tprivate var _textRenderer:TextFieldTextRenderer;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._textRenderer = new TextFieldTextRenderer();\n\t\t\tTestFeathers.starlingRoot.addChild(this._textRenderer);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._textRenderer.removeFromParent(true);\n\t\t\tthis._textRenderer = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testOneLineWithEmptyString():void\n\t\t{\n\t\t\tthis._textRenderer.text = \"\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer numLines must be 1 with empty string\", 1, this._textRenderer.numLines);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testOneLine():void\n\t\t{\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer numLines must be 1\", 1, this._textRenderer.numLines);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNumLinesWithLineBreak():void\n\t\t{\n\t\t\tthis._textRenderer.text = \"Hello\\nWorld\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer numLines must be 2 when line break is in text\", 2, this._textRenderer.numLines);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNumLinesWithCarriageReturn():void\n\t\t{\n\t\t\tthis._textRenderer.text = \"Hello\\rWorld\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer numLines must be 2 when carriage return is in text\", 2, this._textRenderer.numLines);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetTextFormatForStateWithoutSetTextFormatForState():void\n\t\t{\n\t\t\tAssert.assertNull(\"TextFieldTextRenderer getTextFormatForState() must return null if TextFormat not provided with setTextFormatForState()\",\n\t\t\t\tthis._textRenderer.getTextFormatForState(STATE_DISABLED));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetTextFormatForStateAfterSetTextFormatForState():void\n\t\t{\n\t\t\tvar textFormat:flash.text.TextFormat = new flash.text.TextFormat();\n\t\t\tthis._textRenderer.setTextFormatForState(STATE_DISABLED, textFormat);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer getTextFormatForState() must return value passed to setTextFormatForState() with same state\",\n\t\t\t\ttextFormat, this._textRenderer.getTextFormatForState(STATE_DISABLED));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithTextFormat():void\n\t\t{\n\t\t\tthis._textRenderer.textFormat = new flash.text.TextFormat();\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat must be equal to textFormat when no other text formats are specified\",\n\t\t\t\tthis._textRenderer.textFormat, this._textRenderer.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithTextFormatAndDisabled():void\n\t\t{\n\t\t\tthis._textRenderer.textFormat = new flash.text.TextFormat();\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.isEnabled = false;\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat must be equal to textFormat when isEnabled is false, but no other text formats are specified\",\n\t\t\t\tthis._textRenderer.textFormat, this._textRenderer.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithDisabledTextFormatAndDisabled():void\n\t\t{\n\t\t\tthis._textRenderer.textFormat = new flash.text.TextFormat();\n\t\t\tthis._textRenderer.disabledTextFormat = new flash.text.TextFormat();\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.isEnabled = false;\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat must be equal to disabledTextFormat when isEnabled is false and disabledTextFormat is not null\",\n\t\t\t\tthis._textRenderer.disabledTextFormat, this._textRenderer.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithTextFormatAndStateContextDisabled():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isEnabled = false;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tthis._textRenderer.textFormat = new flash.text.TextFormat();\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat must be equal to textFormat when stateContext isEnabled is false, but no other text formats are specified\",\n\t\t\t\tthis._textRenderer.textFormat, this._textRenderer.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithDisabledTextFormatAndStateContextDisabled():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isEnabled = false;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tthis._textRenderer.textFormat = new flash.text.TextFormat();\n\t\t\tthis._textRenderer.disabledTextFormat = new flash.text.TextFormat();\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat must be equal to disabledTextFormat when isEnabled is false and disabledTextFormat is not null\",\n\t\t\t\tthis._textRenderer.disabledTextFormat, this._textRenderer.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithTextFormatAndStateContextSelected():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isSelected = true;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tthis._textRenderer.textFormat = new flash.text.TextFormat();\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat must be equal to textFormat when stateContext isSelected is true, but no other text formats are specified\",\n\t\t\t\tthis._textRenderer.textFormat, this._textRenderer.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithSelectedTextFormatAndStateContextSelected():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isSelected = true;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tthis._textRenderer.textFormat = new flash.text.TextFormat();\n\t\t\tthis._textRenderer.selectedTextFormat = new flash.text.TextFormat();\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat must be equal to selectedTextFormat when isSelected is true and selectedTextFormat is not null\",\n\t\t\t\tthis._textRenderer.selectedTextFormat, this._textRenderer.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithSelectedAndDisabledTextFormatAndStateContextSelectedAndDisabled():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isSelected = true;\n\t\t\tstateContext.isEnabled = false;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tthis._textRenderer.textFormat = new flash.text.TextFormat();\n\t\t\tthis._textRenderer.disabledTextFormat = new flash.text.TextFormat();\n\t\t\tthis._textRenderer.selectedTextFormat = new flash.text.TextFormat();\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\t//disabled should get priority over selected\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat must be equal to disabledTextFormat when isSelected is true and isEnabled is false and both selectedTextFormat and disabledTextFormat are not null\",\n\t\t\t\tthis._textRenderer.disabledTextFormat, this._textRenderer.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithOnlyTextFormatAndStateContextCurrentState():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.currentState = STATE_DISABLED;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tthis._textRenderer.textFormat = new flash.text.TextFormat();\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat must be equal to textFormat when no other text formats are specified\",\n\t\t\t\tthis._textRenderer.textFormat, this._textRenderer.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithDisabledTextFormatAndStateTextFormatWithStateContextDisabledAndCurrentState():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isEnabled = false;\n\t\t\tstateContext.currentState = STATE_DISABLED;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tthis._textRenderer.textFormat = new flash.text.TextFormat();\n\t\t\tthis._textRenderer.disabledTextFormat = new flash.text.TextFormat();\n\t\t\tvar disabledStateTextFormat:flash.text.TextFormat = new flash.text.TextFormat();\n\t\t\tthis._textRenderer.setTextFormatForState(STATE_DISABLED, disabledStateTextFormat);\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\t//exact states always get priority over default/disabled/selected\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat must be equal to flash.text.TextFormat passed into setTextFormatForState() when isEnabled is false and disabledTextFormat are not null\",\n\t\t\t\tdisabledStateTextFormat, this._textRenderer.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFontStylesIgnoredIfAdvancedTextFormatExists():void\n\t\t{\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new starling.text.TextFormat();\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.textFormat = new flash.text.TextFormat();\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat must be equal to elementFormat and not a format from font styles\",\n\t\t\t\tthis._textRenderer.textFormat, this._textRenderer.currentTextFormat);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatWithFontStyles():void\n\t\t{\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new starling.text.TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.font must be equal to starling.text.TextFormat font\",\n\t\t\t\tDEFAULT_FONT_NAME, this._textRenderer.currentTextFormat.font);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.size must be equal to starling.text.TextFormat size\",\n\t\t\t\tDEFAULT_FONT_SIZE, this._textRenderer.currentTextFormat.size);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDEFAULT_COLOR, this._textRenderer.currentTextFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatFallBackToDefaultFontStylesWhenDisabled():void\n\t\t{\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new starling.text.TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.isEnabled = false;\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.font must be equal to starling.text.TextFormat font\",\n\t\t\t\tDEFAULT_FONT_NAME, this._textRenderer.currentTextFormat.font);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.size must be equal to starling.text.TextFormat size\",\n\t\t\t\tDEFAULT_FONT_SIZE, this._textRenderer.currentTextFormat.size);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDEFAULT_COLOR, this._textRenderer.currentTextFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatUseDisabledFontStylesWhenDisabled():void\n\t\t{\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new starling.text.TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tfontStyles.disabledFormat = new starling.text.TextFormat(DISABLED_FONT_NAME, DISABLED_FONT_SIZE, DISABLED_COLOR);\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.isEnabled = false;\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.font must be equal to starling.text.TextFormat font\",\n\t\t\t\tDISABLED_FONT_NAME, this._textRenderer.currentTextFormat.font);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.size must be equal to starling.text.TextFormat size\",\n\t\t\t\tDISABLED_FONT_SIZE, this._textRenderer.currentTextFormat.size);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDISABLED_COLOR, this._textRenderer.currentTextFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatFallBackToDefaultFontStylesWithStateContextDisabled():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isEnabled = false;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new starling.text.TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.font must be equal to starling.text.TextFormat font\",\n\t\t\t\tDEFAULT_FONT_NAME, this._textRenderer.currentTextFormat.font);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.size must be equal to starling.text.TextFormat size\",\n\t\t\t\tDEFAULT_FONT_SIZE, this._textRenderer.currentTextFormat.size);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDEFAULT_COLOR, this._textRenderer.currentTextFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatUseDisabledFontStylesWithStateContextDisabled():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isEnabled = false;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new starling.text.TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tfontStyles.disabledFormat = new starling.text.TextFormat(DISABLED_FONT_NAME, DISABLED_FONT_SIZE, DISABLED_COLOR);\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.font must be equal to starling.text.TextFormat font\",\n\t\t\t\tDISABLED_FONT_NAME, this._textRenderer.currentTextFormat.font);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.size must be equal to starling.text.TextFormat size\",\n\t\t\t\tDISABLED_FONT_SIZE, this._textRenderer.currentTextFormat.size);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDISABLED_COLOR, this._textRenderer.currentTextFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatFallBackToDefaultFontStylesWithStateContextSelected():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isSelected = true;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new starling.text.TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.font must be equal to starling.text.TextFormat font\",\n\t\t\t\tDEFAULT_FONT_NAME, this._textRenderer.currentTextFormat.font);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.size must be equal to starling.text.TextFormat size\",\n\t\t\t\tDEFAULT_FONT_SIZE, this._textRenderer.currentTextFormat.size);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDEFAULT_COLOR, this._textRenderer.currentTextFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatUseSelectedFontStylesWithStateContextSelected():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isSelected = true;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new starling.text.TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tfontStyles.selectedFormat = new starling.text.TextFormat(SELECTED_FONT_NAME, SELECTED_FONT_SIZE, SELECTED_COLOR);\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.font must be equal to starling.text.TextFormat font\",\n\t\t\t\tSELECTED_FONT_NAME, this._textRenderer.currentTextFormat.font);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.size must be equal to starling.text.TextFormat size\",\n\t\t\t\tSELECTED_FONT_SIZE, this._textRenderer.currentTextFormat.size);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tSELECTED_COLOR, this._textRenderer.currentTextFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatUseDisabledFontStylesWithStateContextSelectedAndDisabled():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.isSelected = true;\n\t\t\tstateContext.isEnabled = false;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new starling.text.TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tfontStyles.selectedFormat = new starling.text.TextFormat(SELECTED_FONT_NAME, SELECTED_FONT_SIZE, SELECTED_COLOR);\n\t\t\tfontStyles.disabledFormat = new starling.text.TextFormat(DISABLED_FONT_NAME, DISABLED_FONT_SIZE, DISABLED_COLOR);\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\t//disabled should get priority over selected\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.font must be equal to starling.text.TextFormat font\",\n\t\t\t\tDISABLED_FONT_NAME, this._textRenderer.currentTextFormat.font);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.size must be equal to starling.text.TextFormat size\",\n\t\t\t\tDISABLED_FONT_SIZE, this._textRenderer.currentTextFormat.size);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDISABLED_COLOR, this._textRenderer.currentTextFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatFallBackToDefaultFontStylesWithStateContextCurrentState():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.currentState = STATE_DISABLED;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new starling.text.TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.font must be equal to starling.text.TextFormat font\",\n\t\t\t\tDEFAULT_FONT_NAME, this._textRenderer.currentTextFormat.font);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.size must be equal to starling.text.TextFormat size\",\n\t\t\t\tDEFAULT_FONT_SIZE, this._textRenderer.currentTextFormat.size);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tDEFAULT_COLOR, this._textRenderer.currentTextFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTextFormatUseStateFontStylesWithStateContextCurrentState():void\n\t\t{\n\t\t\tvar stateContext:CustomStateContext = new CustomStateContext();\n\t\t\tstateContext.currentState = STATE_DISABLED;\n\t\t\tstateContext.isSelected = true;\n\t\t\tstateContext.isEnabled = false;\n\t\t\tthis._textRenderer.stateContext = stateContext;\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = new starling.text.TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tfontStyles.selectedFormat = new starling.text.TextFormat(SELECTED_FONT_NAME, SELECTED_FONT_SIZE, SELECTED_COLOR);\n\t\t\tfontStyles.disabledFormat = new starling.text.TextFormat(DISABLED_FONT_NAME, DISABLED_FONT_SIZE, DISABLED_COLOR);\n\t\t\tfontStyles.setFormatForState(STATE_DISABLED, new starling.text.TextFormat(STATE_FONT_NAME, STATE_FONT_SIZE, STATE_COLOR));\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\t//exact states always get priority over default/disabled/selected\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.font must be equal to starling.text.TextFormat font\",\n\t\t\t\tSTATE_FONT_NAME, this._textRenderer.currentTextFormat.font);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.size must be equal to starling.text.TextFormat size\",\n\t\t\t\tSTATE_FONT_SIZE, this._textRenderer.currentTextFormat.size);\n\t\t\tAssert.assertStrictlyEquals(\"TextFieldTextRenderer currentTextFormat.color must be equal to starling.text.TextFormat color\",\n\t\t\t\tSTATE_COLOR, this._textRenderer.currentTextFormat.color);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInvalidAfterChangePropertyOfFontStyles():void\n\t\t{\n\t\t\tvar format:starling.text.TextFormat = new starling.text.TextFormat(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_COLOR);\n\t\t\tvar fontStyles:FontStylesSet = new FontStylesSet();\n\t\t\tfontStyles.format = format\n\t\t\tthis._textRenderer.fontStyles = fontStyles;\n\t\t\tthis._textRenderer.text = \"Hello World\";\n\t\t\tthis._textRenderer.validate();\n\t\t\tformat.color = SELECTED_COLOR;\n\t\t\tAssert.assertTrue(\"TextFieldTextRenderer: must be invalid after changing property of font styles.\",\n\t\t\t\tthis._textRenderer.isInvalid());\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/TextInputFocusTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.TextInput;\n\timport feathers.controls.text.TextFieldTextEditor;\n\timport feathers.core.FocusManager;\n\timport feathers.events.FeathersEventType;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\tpublic class TextInputFocusTests\n\t{\n\t\tprivate static const SAMPLE_TEXT:String = \"I am the very model of a modern major general\";\n\n\t\tprivate var _textInput:TextInput;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._textInput = new TextInput();\n\t\t\tthis._textInput.backgroundSkin = new Quad(200, 200);\n\t\t\tthis._textInput.textEditorFactory = textEditorFactory;\n\t\t\tTestFeathers.starlingRoot.addChild(this._textInput);\n\t\t\tthis._textInput.validate();\n\t\t}\n\n\t\tprivate function textEditorFactory():TextFieldTextEditor\n\t\t{\n\t\t\tvar textEditor:TextFieldTextEditor = new TextFieldTextEditor();\n\t\t\treturn textEditor;\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tTestFeathers.starlingRoot.visible = true;\n\t\t\tFocusManager.setEnabledForStage(this._textInput.stage, false);\n\t\t\tthis._textInput.removeFromParent(true);\n\t\t\tthis._textInput = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFocusInEventAfterSetFocusFunctionWithoutFocusManager():void\n\t\t{\n\t\t\tvar hasDispatchedFocusIn:Boolean = false;\n\t\t\tthis._textInput.addEventListener(FeathersEventType.FOCUS_IN, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedFocusIn = true;\n\t\t\t});\n\t\t\tthis._textInput.setFocus();\n\t\t\tAssert.assertTrue(\"FeathersEventType.FOCUS_IN was not dispatched after calling setFocus()\", hasDispatchedFocusIn);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFocusOutEventAfterClearFocusFunctionWithoutFocusManager():void\n\t\t{\n\t\t\tvar hasDispatchedFocusOut:Boolean = false;\n\t\t\tthis._textInput.addEventListener(FeathersEventType.FOCUS_OUT, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedFocusOut = true;\n\t\t\t});\n\t\t\tthis._textInput.setFocus();\n\t\t\tthis._textInput.clearFocus();\n\t\t\tAssert.assertTrue(\"FeathersEventType.FOCUS_OUT was not dispatched after calling clearFocus()\", hasDispatchedFocusOut);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFocusOutEventAfterSetVisibleToFalseWithoutFocusManager():void\n\t\t{\n\t\t\tvar hasDispatchedFocusOut:Boolean = false;\n\t\t\tthis._textInput.addEventListener(FeathersEventType.FOCUS_OUT, function(event:Event):void\n\t\t\t{\n\t\t\t\thasDispatchedFocusOut = true;\n\t\t\t});\n\t\t\tthis._textInput.setFocus();\n\t\t\tthis._textInput.visible = false;\n\t\t\tAssert.assertTrue(\"FeathersEventType.FOCUS_OUT was not dispatched after setting visible property to false\", hasDispatchedFocusOut);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFocusInEventAfterSetFocusFunctionWithFocusManager():void\n\t\t{\n\t\t\tFocusManager.setEnabledForStage(this._textInput.stage, true);\n\t\t\tthis.testFocusInEventAfterSetFocusFunctionWithoutFocusManager();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFocusOutEventAfterClearFocusFunctionWithFocusManager():void\n\t\t{\n\t\t\tFocusManager.setEnabledForStage(this._textInput.stage, true);\n\t\t\tthis.testFocusOutEventAfterClearFocusFunctionWithoutFocusManager();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testFocusOutEventAfterSetVisibleToFalseWithFocusManager():void\n\t\t{\n\t\t\tFocusManager.setEnabledForStage(this._textInput.stage, true);\n\t\t\tthis.testFocusOutEventAfterSetVisibleToFalseWithoutFocusManager();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectionRangeInsideFocusInListenerAfterSetFocusFunctionWithoutFocusManager():void\n\t\t{\n\t\t\tthis._textInput.text = SAMPLE_TEXT;\n\t\t\tvar selectionBeginIndex:int = -1;\n\t\t\tvar selectionEndIndex:int = -1;\n\t\t\tthis._textInput.addEventListener(FeathersEventType.FOCUS_IN, function(event:Event):void\n\t\t\t{\n\t\t\t\tselectionBeginIndex = _textInput.selectionBeginIndex;\n\t\t\t\tselectionEndIndex = _textInput.selectionEndIndex;\n\t\t\t});\n\t\t\tthis._textInput.setFocus();\n\t\t\tAssert.assertStrictlyEquals(\"TextInput selectionBeginIndex incorrect after calling setFocus()\",\n\t\t\t\t0, selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput selectionBeginIndex incorrect after calling setFocus()\",\n\t\t\t\tSAMPLE_TEXT.length, selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectionRangeInsideFocusInListenerAfterSetFocusFunctionWithFocusManager():void\n\t\t{\n\t\t\tFocusManager.setEnabledForStage(this._textInput.stage, true);\n\t\t\tthis.testSelectionRangeInsideFocusInListenerAfterSetFocusFunctionWithoutFocusManager();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectionRangeAfterSetFocusThenSelectRangeFunctionWithoutFocusManager():void\n\t\t{\n\t\t\tthis._textInput.text = SAMPLE_TEXT;\n\t\t\tthis._textInput.setFocus();\n\t\t\tvar selectionBeginIndex:int = 1;\n\t\t\tvar selectionEndIndex:int = 3;\n\t\t\tthis._textInput.selectRange(selectionBeginIndex, selectionEndIndex);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput selectionBeginIndex incorrect after calling setFocus() then selectRange()\",\n\t\t\t\tselectionBeginIndex, this._textInput.selectionBeginIndex);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput selectionBeginIndex incorrect after calling setFocus() then selectRange()\",\n\t\t\t\tselectionEndIndex, this._textInput.selectionEndIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectionRangeAfterSetFocusThenSelectRangeFunctionWithFocusManager():void\n\t\t{\n\t\t\tFocusManager.setEnabledForStage(this._textInput.stage, true);\n\t\t\tthis.testSelectionRangeAfterSetFocusThenSelectRangeFunctionWithoutFocusManager();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectionRangeAfterTouchEventWithoutFocusManager():void\n\t\t{\n\t\t\tthis._textInput.text = SAMPLE_TEXT;\n\t\t\t//validate to make sure the text is passed down to the text editor\n\t\t\tthis._textInput.validate();\n\n\t\t\tvar selectionBeginIndex:int = -1;\n\t\t\tvar selectionEndIndex:int = -1;\n\t\t\tthis._textInput.addEventListener(FeathersEventType.FOCUS_IN, function(event:Event):void\n\t\t\t{\n\t\t\t\tselectionBeginIndex = _textInput.selectionBeginIndex;\n\t\t\t\tselectionEndIndex = _textInput.selectionEndIndex;\n\t\t\t});\n\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = this._textInput;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = 100;\n\t\t\ttouch.globalY = 5;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\tthis._textInput.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t//this touch does not move at all, so it should result in triggering\n\t\t\t//the button.\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\tthis._textInput.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\t//we don't care what the exact index is, but it should be clear that\n\t\t\t//the touch changed it to something\n\t\t\tAssert.assertStrictlyEquals(\"TextInput selectionBeginIndex and selectionEndIndex don't match after TouchEvent.TOUCH\",\n\t\t\t\tselectionBeginIndex, selectionEndIndex);\n\t\t\tAssert.assertTrue(\"TextInput selectionBeginIndex and selectionEndIndex not greater than 0 after TouchEvent.TOUCH\",\n\t\t\t\tselectionBeginIndex > 0);\n\t\t\tAssert.assertTrue(\"TextInput selectionBeginIndex and selectionEndIndex not less than text length after TouchEvent.TOUCH\",\n\t\t\t\tselectionEndIndex < SAMPLE_TEXT.length);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSelectionRangeAfterTouchEventWithFocusManager():void\n\t\t{\n\t\t\tFocusManager.setEnabledForStage(this._textInput.stage, true);\n\t\t\tthis.testSelectionRangeAfterTouchEventWithoutFocusManager();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/TextInputInternalStateTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.TextInputState;\n\timport feathers.core.FocusManager;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class TextInputInternalStateTests\n\t{\n\t\tprivate var _input:TextInputWithInternalState;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, true);\n\t\t\t\n\t\t\tthis._input = new TextInputWithInternalState();\n\t\t\tTestFeathers.starlingRoot.addChild(this._input);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._input.removeFromParent(true);\n\t\t\tthis._input = null;\n\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, false);\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetSkinForStateWithoutSetSkinForState():void\n\t\t{\n\t\t\tAssert.assertNull(\"TextInput getSkinForState(TextInputState.ENABLED) must be null when setSkinForState() is not called\", this._input.getSkinForState(TextInputState.FOCUSED));\n\t\t\tAssert.assertNull(\"TextInput getSkinForState(TextInputState.DISABLED) must be null when setSkinForState() is not called\", this._input.getSkinForState(TextInputState.DISABLED));\n\t\t\tAssert.assertNull(\"TextInput getSkinForState(TextInputState.FOCUSED) must be null when setSkinForState() is not called\", this._input.getSkinForState(TextInputState.FOCUSED));\n\t\t\tAssert.assertNull(\"TextInput getSkinForState(TextInputState.ERROR) must be null when setSkinForState() is not called\", this._input.getSkinForState(TextInputState.ERROR));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetSkinForState():void\n\t\t{\n\t\t\tvar backgroundSkin:Quad = new Quad(200, 200);\n\t\t\tthis._input.backgroundSkin = backgroundSkin;\n\n\t\t\tvar enabledSkin:Quad = new Quad(200, 200);\n\t\t\tthis._input.setSkinForState(TextInputState.ENABLED, enabledSkin);\n\n\t\t\tvar disabledSkin:Quad = new Quad(200, 200);\n\t\t\tthis._input.setSkinForState(TextInputState.DISABLED, disabledSkin);\n\n\t\t\tvar focusedSkin:Quad = new Quad(200, 200);\n\t\t\tthis._input.setSkinForState(TextInputState.FOCUSED, focusedSkin);\n\n\t\t\tvar errorSkin:Quad = new Quad(200, 200);\n\t\t\tthis._input.setSkinForState(TextInputState.ERROR, errorSkin);\n\n\t\t\tAssert.assertStrictlyEquals(\"TextInput getSkinForState(TextInputState.ENABLED) does not match value passed to setSkinForState()\", enabledSkin, this._input.getSkinForState(TextInputState.ENABLED));\n\t\t\tAssert.assertStrictlyEquals(\"TextInput getSkinForState(TextInputState.DISABLED) does not match value passed to setSkinForState()\", disabledSkin, this._input.getSkinForState(TextInputState.DISABLED));\n\t\t\tAssert.assertStrictlyEquals(\"TextInput getSkinForState(TextInputState.FOCUSED) does not match value passed to setSkinForState()\", focusedSkin, this._input.getSkinForState(TextInputState.FOCUSED));\n\t\t\tAssert.assertStrictlyEquals(\"TextInput getSkinForState(TextInputState.ERROR) does not match value passed to setSkinForState()\", errorSkin, this._input.getSkinForState(TextInputState.ERROR));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDefaultCurrentBackground():void\n\t\t{\n\t\t\tvar backgroundSkin:Quad = new Quad(200, 200);\n\t\t\tthis._input.backgroundSkin = backgroundSkin;\n\n\t\t\tthis._input.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state is not TextInputState.ENABLED by default\", TextInputState.ENABLED, this._input.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput background is not backgroundSkin when currentState is TextInputState.ENABLED and background not provided for this state\", backgroundSkin, this._input.currentBackgroundInternal);\n\n\t\t\tthis._input.errorString = \"Error\";\n\t\t\tthis._input.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state is not TextInputState.ERROR when errorString is not null\", TextInputState.ERROR, this._input.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput background is not backgroundSkin when currentState is TextInputState.ENABLED and background not provided for this state\", backgroundSkin, this._input.currentBackgroundInternal);\n\t\t\tthis._input.errorString = null;\n\n\t\t\tthis._input.isEnabled = false;\n\t\t\tthis._input.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state is not TextInputState.DISABLED when isEnabled is false\", TextInputState.DISABLED, this._input.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput background is not backgroundSkin when currentState is TextInputState.DISABLED and background not provided for this state\", backgroundSkin, this._input.currentBackgroundInternal);\n\n\t\t\tthis._input.isEnabled = true;\n\t\t\tFocusManager.focus = this._input;\n\t\t\tthis._input.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state is not TextInputState.FOCUSED when input is focused\", TextInputState.FOCUSED, this._input.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput background is not backgroundSkin when currentState is TextInputState.FOCUSED and background not provided for this state\", backgroundSkin, this._input.currentBackgroundInternal);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentSkinWithSetSkinForState():void\n\t\t{\n\t\t\tvar backgroundSkin:Quad = new Quad(200, 200);\n\t\t\tthis._input.backgroundSkin = backgroundSkin;\n\n\t\t\tvar backgroundEnabledSkin:Quad = new Quad(200, 200);\n\t\t\tthis._input.setSkinForState(TextInputState.ENABLED, backgroundEnabledSkin);\n\n\t\t\tvar backgroundDisabledSkin:Quad = new Quad(200, 200);\n\t\t\tthis._input.setSkinForState(TextInputState.DISABLED, backgroundDisabledSkin);\n\n\t\t\tvar backgroundFocusedSkin:Quad = new Quad(200, 200);\n\t\t\tthis._input.setSkinForState(TextInputState.FOCUSED, backgroundFocusedSkin);\n\n\t\t\tvar backgroundErrorSkin:Quad = new Quad(200, 200);\n\t\t\tthis._input.setSkinForState(TextInputState.ERROR, backgroundErrorSkin);\n\n\t\t\tthis._input.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state is not TextInputState.ENABLED by default\", TextInputState.ENABLED, this._input.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput background is not backgroundEnabledSkin when currentState is TextInputState.ENABLED\", backgroundEnabledSkin, this._input.currentBackgroundInternal);\n\n\t\t\tthis._input.errorString = \"Error\";\n\t\t\tthis._input.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state is not TextInputState.ERROR when errorString is not null\", TextInputState.ERROR, this._input.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput background is not backgroundEnabledSkin when currentState is TextInputState.ENABLED\", backgroundErrorSkin, this._input.currentBackgroundInternal);\n\t\t\tthis._input.errorString = null;\n\n\t\t\tthis._input.isEnabled = false;\n\t\t\tthis._input.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state is not TextInputState.DISABLED when isEnabled is false\", TextInputState.DISABLED, this._input.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput background is not backgroundDisabledSkin when currentState is TextInputState.DISABLED\", backgroundDisabledSkin, this._input.currentBackgroundInternal);\n\n\t\t\tthis._input.isEnabled = true;\n\t\t\tFocusManager.focus = this._input;\n\t\t\tthis._input.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state is not TextInputState.FOCUSED when input is focused\", TextInputState.FOCUSED, this._input.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput background is not backgroundFocusedSkin when currentState is TextInputState.FOCUSED\", backgroundFocusedSkin, this._input.currentBackgroundInternal);\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic function testGetIconForStateWithoutSetIconForState():void\n\t\t{\n\t\t\tAssert.assertNull(\"TextInput getIconForState(TextInputState.ENABLED) must be null when setIconForState() is not called\", this._input.getIconForState(TextInputState.FOCUSED));\n\t\t\tAssert.assertNull(\"TextInput getIconForState(TextInputState.DISABLED) must be null when setIconForState() is not called\", this._input.getIconForState(TextInputState.DISABLED));\n\t\t\tAssert.assertNull(\"TextInput getIconForState(TextInputState.FOCUSED) must be null when setIconForState() is not called\", this._input.getIconForState(TextInputState.FOCUSED));\n\t\t\tAssert.assertNull(\"TextInput getIconForState(TextInputState.ERROR) must be null when setIconForState() is not called\", this._input.getIconForState(TextInputState.ERROR));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetIconForState():void\n\t\t{\n\t\t\tvar defaultIcon:Quad = new Quad(200, 200);\n\t\t\tthis._input.defaultIcon = defaultIcon;\n\n\t\t\tvar enabledIcon:Quad = new Quad(200, 200);\n\t\t\tthis._input.setIconForState(TextInputState.ENABLED, enabledIcon);\n\n\t\t\tvar disabledIcon:Quad = new Quad(200, 200);\n\t\t\tthis._input.setIconForState(TextInputState.DISABLED, disabledIcon);\n\n\t\t\tvar focusedIcon:Quad = new Quad(200, 200);\n\t\t\tthis._input.setIconForState(TextInputState.FOCUSED, focusedIcon);\n\n\t\t\tvar errorIcon:Quad = new Quad(200, 200);\n\t\t\tthis._input.setIconForState(TextInputState.ERROR, errorIcon);\n\n\t\t\tAssert.assertStrictlyEquals(\"TextInput getIconForState(TextInputState.ENABLED) does not match value passed to setIconForState()\", enabledIcon, this._input.getIconForState(TextInputState.ENABLED));\n\t\t\tAssert.assertStrictlyEquals(\"TextInput getIconForState(TextInputState.DISABLED) does not match value passed to setIconForState()\", disabledIcon, this._input.getIconForState(TextInputState.DISABLED));\n\t\t\tAssert.assertStrictlyEquals(\"TextInput getIconForState(TextInputState.FOCUSED) does not match value passed to setIconForState()\", focusedIcon, this._input.getIconForState(TextInputState.FOCUSED));\n\t\t\tAssert.assertStrictlyEquals(\"TextInput getIconForState(TextInputState.ERROR) does not match value passed to setIconForState()\", errorIcon, this._input.getIconForState(TextInputState.ERROR));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDefaultCurrentIcon():void\n\t\t{\n\t\t\tvar defaultIcon:Quad = new Quad(200, 200);\n\t\t\tthis._input.defaultIcon = defaultIcon;\n\n\t\t\tthis._input.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state is not TextInputState.ENABLED by default\", TextInputState.ENABLED, this._input.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput icon is not defaultIcon when currentState is TextInputState.ENABLED and icon not provided for this state\", defaultIcon, this._input.currentIconInternal);\n\n\t\t\tthis._input.errorString = \"Error\";\n\t\t\tthis._input.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state is not TextInputState.ERROR when errorString is not null\", TextInputState.ERROR, this._input.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput icon is not defaultIcon when currentState is TextInputState.ERROR and icon not provided for this state\", defaultIcon, this._input.currentIconInternal);\n\t\t\tthis._input.errorString = null;\n\n\t\t\tthis._input.isEnabled = false;\n\t\t\tthis._input.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state is not TextInputState.DISABLED when isEnabled is false\", TextInputState.DISABLED, this._input.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput icon is not defaultIcon when currentState is TextInputState.DISABLED and icon not provided for this state\", defaultIcon, this._input.currentIconInternal);\n\n\t\t\tthis._input.isEnabled = true;\n\t\t\tFocusManager.focus = this._input;\n\t\t\tthis._input.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state is not TextInputState.FOCUSED when input is focused\", TextInputState.FOCUSED, this._input.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput icon is not defaultIcon when currentState is TextInputState.FOCUSED and icon not provided for this state\", defaultIcon, this._input.currentIconInternal);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentIconWithSetIconForState():void\n\t\t{\n\t\t\tvar defaultIcon:Quad = new Quad(200, 200);\n\t\t\tthis._input.defaultIcon = defaultIcon;\n\n\t\t\tvar enabledIcon:Quad = new Quad(200, 200);\n\t\t\tthis._input.setIconForState(TextInputState.ENABLED, enabledIcon);\n\n\t\t\tvar disabledIcon:Quad = new Quad(200, 200);\n\t\t\tthis._input.setIconForState(TextInputState.DISABLED, disabledIcon);\n\n\t\t\tvar focusedIcon:Quad = new Quad(200, 200);\n\t\t\tthis._input.setIconForState(TextInputState.FOCUSED, focusedIcon);\n\n\t\t\tvar errorIcon:Quad = new Quad(200, 200);\n\t\t\tthis._input.setIconForState(TextInputState.ERROR, errorIcon);\n\n\t\t\tthis._input.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state is not TextInputState.ENABLED by default\", TextInputState.ENABLED, this._input.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput icon is not enabledIcon when currentState is TextInputState.ENABLED\", enabledIcon, this._input.currentIconInternal);\n\n\t\t\tthis._input.errorString = \"Error\";\n\t\t\tthis._input.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state is not TextInputState.ERROR when errorString is not null\", TextInputState.ERROR, this._input.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput icon is not errorIcon when currentState is TextInputState.ERROR\", errorIcon, this._input.currentIconInternal);\n\t\t\tthis._input.errorString = null;\n\n\t\t\tthis._input.isEnabled = false;\n\t\t\tthis._input.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state is not TextInputState.DISABLED when isEnabled is false\", TextInputState.DISABLED, this._input.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput icon is not disabledIcon when currentState is TextInputState.DISABLED\", disabledIcon, this._input.currentIconInternal);\n\n\t\t\tthis._input.isEnabled = true;\n\t\t\tFocusManager.focus = this._input;\n\t\t\tthis._input.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TextInput state is not TextInputState.FOCUSED when input is focused\", TextInputState.FOCUSED, this._input.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TextInput icon is not focusedIcon when currentState is TextInputState.FOCUSED\", focusedIcon, this._input.currentIconInternal);\n\t\t}\n\t}\n}\n\nimport feathers.controls.TextInput;\n\nimport starling.display.DisplayObject;\n\nclass TextInputWithInternalState extends TextInput\n{\n\tpublic function TextInputWithInternalState()\n\t{\n\t\tsuper();\n\t}\n\n\tpublic function get currentBackgroundInternal():DisplayObject\n\t{\n\t\treturn this.currentBackground;\n\t}\n\n\tpublic function get currentIconInternal():DisplayObject\n\t{\n\t\treturn this.currentIcon;\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/TextInputMeasurementTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.TextInput;\n\timport feathers.controls.text.BitmapFontTextRenderer;\n\timport feathers.core.ITextRenderer;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class TextInputMeasurementTests\n\t{\n\t\tprivate static const SMALL_BACKGROUND_WIDTH:Number = 10;\n\t\tprivate static const SMALL_BACKGROUND_HEIGHT:Number = 12;\n\t\tprivate static const LARGE_BACKGROUND_WIDTH:Number = 200;\n\t\tprivate static const LARGE_BACKGROUND_HEIGHT:Number = 210;\n\t\tprivate static const COMPLEX_BACKGROUND_WIDTH:Number = 54;\n\t\tprivate static const COMPLEX_BACKGROUND_HEIGHT:Number = 55;\n\t\tprivate static const COMPLEX_BACKGROUND_MIN_WIDTH:Number = 38;\n\t\tprivate static const COMPLEX_BACKGROUND_MIN_HEIGHT:Number = 39;\n\n\t\tprivate static const SMALL_ICON_WIDTH:Number = 13;\n\t\tprivate static const SMALL_ICON_HEIGHT:Number = 11;\n\t\tprivate static const LARGE_ICON_WIDTH:Number = 105;\n\t\tprivate static const LARGE_ICON_HEIGHT:Number = 115;\n\t\tprivate static const COMPLEX_ICON_WIDTH:Number = 23;\n\t\tprivate static const COMPLEX_ICON_HEIGHT:Number = 25;\n\t\tprivate static const COMPLEX_ICON_MIN_WIDTH:Number = 18;\n\t\tprivate static const COMPLEX_ICON_MIN_HEIGHT:Number = 19;\n\t\t\n\t\tprivate static const PADDING_TOP:Number = 50;\n\t\tprivate static const PADDING_RIGHT:Number = 54;\n\t\tprivate static const PADDING_BOTTOM:Number = 59;\n\t\tprivate static const PADDING_LEFT:Number = 60;\n\t\tprivate static const GAP:Number = 6;\n\n\t\tprivate var input:TextInput;\n\t\tprivate var textRenderer:BitmapFontTextRenderer;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis.input = new TextInput();\n\t\t\tthis.input.promptFactory = function():ITextRenderer\n\t\t\t{\n\t\t\t\treturn new BitmapFontTextRenderer();\n\t\t\t};\n\t\t\tTestFeathers.starlingRoot.addChild(this.input);\n\n\t\t\tthis.textRenderer = new BitmapFontTextRenderer();\n\t\t\tTestFeathers.starlingRoot.addChild(this.textRenderer);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis.textRenderer.removeFromParent(true);\n\t\t\tthis.textRenderer = null;\n\t\t\t\n\t\t\tthis.input.removeFromParent(true);\n\t\t\tthis.input = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\tprivate function addSmallSimpleBackground():void\n\t\t{\n\t\t\tthis.input.backgroundSkin = new Quad(SMALL_BACKGROUND_WIDTH, SMALL_BACKGROUND_HEIGHT, 0xff00ff);\n\t\t}\n\n\t\tprivate function addLargeSimpleBackground():void\n\t\t{\n\t\t\tthis.input.backgroundSkin = new Quad(LARGE_BACKGROUND_WIDTH, LARGE_BACKGROUND_HEIGHT, 0xff00ff);\n\t\t}\n\n\t\tprivate function addComplexBackground():void\n\t\t{\n\t\t\tvar backgroundSkin:LayoutGroup = new LayoutGroup();\n\t\t\tbackgroundSkin.width = COMPLEX_BACKGROUND_WIDTH;\n\t\t\tbackgroundSkin.height = COMPLEX_BACKGROUND_HEIGHT;\n\t\t\tbackgroundSkin.minWidth = COMPLEX_BACKGROUND_MIN_WIDTH;\n\t\t\tbackgroundSkin.minHeight = COMPLEX_BACKGROUND_MIN_HEIGHT;\n\t\t\tthis.input.backgroundSkin = backgroundSkin;\n\t\t}\n\t\t\n\t\tprivate function addSmallSimpleIcon():void\n\t\t{\n\t\t\tthis.input.defaultIcon = new Quad(SMALL_ICON_WIDTH, SMALL_ICON_HEIGHT, 0xff00ff);\n\t\t}\n\n\t\tprivate function addLargeSimpleIcon():void\n\t\t{\n\t\t\tthis.input.defaultIcon = new Quad(LARGE_ICON_WIDTH, LARGE_ICON_HEIGHT, 0xff00ff);\n\t\t}\n\n\t\tprivate function addComplexIcon():void\n\t\t{\n\t\t\tvar icon:LayoutGroup = new LayoutGroup();\n\t\t\ticon.width = COMPLEX_ICON_WIDTH;\n\t\t\ticon.height = COMPLEX_ICON_HEIGHT;\n\t\t\ticon.minWidth = COMPLEX_ICON_MIN_WIDTH;\n\t\t\ticon.minHeight = COMPLEX_ICON_MIN_HEIGHT;\n\t\t\tthis.input.defaultIcon = icon;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithPadding():void\n\t\t{\n\t\t\tthis.input.paddingTop = PADDING_TOP;\n\t\t\tthis.input.paddingRight = PADDING_RIGHT;\n\t\t\tthis.input.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis.input.paddingLeft = PADDING_LEFT;\n\t\t\tthis.input.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the TextInput was not calculated correctly based on the left and right padding.\",\n\t\t\t\tPADDING_LEFT + PADDING_RIGHT, this.input.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the TextInput was not calculated correctly based on the top and bottom padding.\",\n\t\t\t\tPADDING_TOP + PADDING_BOTTOM, this.input.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the TextInput was not calculated correctly based on the left and right padding.\",\n\t\t\t\tPADDING_LEFT + PADDING_RIGHT, this.input.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the TextInput was not calculated correctly based on the top and bottom padding.\",\n\t\t\t\tPADDING_TOP + PADDING_BOTTOM, this.input.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithPrompt():void\n\t\t{\n\t\t\tvar promptText:String = \"I am the very model of a modern major general\";\n\t\t\tthis.textRenderer.text = promptText;\n\t\t\tthis.textRenderer.validate();\n\t\t\t\n\t\t\tthis.input.prompt = promptText;\n\t\t\tthis.input.validate();\n\n\t\t\tAssert.assertTrue(\"The width of the TextInput was not greater than 0 when using a prompt.\",\n\t\t\t\tthis.input.width > 0);\n\t\t\tAssert.assertTrue(\"The height of the TextInput was not greater than 0 when using a prompt.\",\n\t\t\t\tthis.input.height > 0);\n\t\t\tAssert.assertTrue(\"The minWidth of the TextInput was not greater than 0 when using a prompt.\",\n\t\t\t\tthis.input.minWidth > 0);\n\t\t\tAssert.assertTrue(\"The minHeight of the TextInput was not greater than 0 when using a prompt.\",\n\t\t\t\tthis.input.minHeight > 0);\n\t\t\tAssert.assertStrictlyEquals(\"The width of the TextInput was not calculated correctly based on the prompt.\",\n\t\t\t\tthis.textRenderer.width, this.input.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the TextInput was not calculated correctly based on the prompt.\",\n\t\t\t\tthis.textRenderer.height, this.input.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the TextInput was not calculated correctly based on the prompt.\",\n\t\t\t\tthis.textRenderer.width, this.input.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the TextInput was not calculated correctly based on the prompt.\",\n\t\t\t\tthis.textRenderer.height, this.input.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithPromptAndPadding():void\n\t\t{\n\t\t\tvar promptText:String = \"I am the very model of a modern major general\";\n\t\t\tthis.textRenderer.text = promptText;\n\t\t\tthis.textRenderer.validate();\n\n\t\t\tthis.input.prompt = promptText;\n\t\t\tthis.input.paddingTop = PADDING_TOP;\n\t\t\tthis.input.paddingRight = PADDING_RIGHT;\n\t\t\tthis.input.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis.input.paddingLeft = PADDING_LEFT;\n\t\t\tthis.input.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the TextInput was not calculated correctly based on the prompt and left and right padding.\",\n\t\t\t\tthis.textRenderer.width + PADDING_LEFT + PADDING_RIGHT, this.input.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the TextInput was not calculated correctly based on the prompt and top and bottom padding.\",\n\t\t\t\tthis.textRenderer.height + PADDING_TOP + PADDING_BOTTOM, this.input.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the TextInput was not calculated correctly based on the prompt and left and right padding.\",\n\t\t\t\tthis.textRenderer.width + PADDING_LEFT + PADDING_RIGHT, this.input.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the TextInput was not calculated correctly based on the prompt and top and bottom padding.\",\n\t\t\t\tthis.textRenderer.height + PADDING_TOP + PADDING_BOTTOM, this.input.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithPromptAndSimpleIcon():void\n\t\t{\n\t\t\tvar promptText:String = \"I am the very model of a modern major general\";\n\t\t\tthis.textRenderer.text = promptText;\n\t\t\tthis.textRenderer.validate();\n\n\t\t\tthis.addLargeSimpleIcon();\n\t\t\tthis.input.prompt = promptText;\n\t\t\tthis.input.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the TextInput was not calculated correctly based on the prompt and icon.\",\n\t\t\t\tthis.textRenderer.width + LARGE_ICON_WIDTH, this.input.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the TextInput was not calculated correctly based on the prompt and icon.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this.input.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the TextInput was not calculated correctly based on the prompt and icon.\",\n\t\t\t\tthis.textRenderer.width + LARGE_ICON_WIDTH, this.input.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the TextInput was not calculated correctly based on the prompt and icon.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this.input.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithPromptGapAndSimpleIcon():void\n\t\t{\n\t\t\tvar promptText:String = \"I am the very model of a modern major general\";\n\t\t\tthis.textRenderer.text = promptText;\n\t\t\tthis.textRenderer.validate();\n\n\t\t\tthis.addLargeSimpleIcon();\n\t\t\tthis.input.prompt = promptText;\n\t\t\tthis.input.gap = GAP;\n\t\t\tthis.input.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the TextInput was not calculated correctly based on the prompt, gap, and icon.\",\n\t\t\t\tthis.textRenderer.width + GAP + LARGE_ICON_WIDTH, this.input.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the TextInput was not calculated correctly based on the prompt, gap, and icon.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this.input.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the TextInput was not calculated correctly based on the prompt, gap, and icon.\",\n\t\t\t\tthis.textRenderer.width + GAP + LARGE_ICON_WIDTH, this.input.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the TextInput was not calculated correctly based on the prompt, and icon.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this.input.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithPromptGapPaddingAndSimpleIcon():void\n\t\t{\n\t\t\tvar promptText:String = \"I am the very model of a modern major general\";\n\t\t\tthis.textRenderer.text = promptText;\n\t\t\tthis.textRenderer.validate();\n\n\t\t\tthis.addLargeSimpleIcon();\n\t\t\tthis.input.prompt = promptText;\n\t\t\tthis.input.paddingTop = PADDING_TOP;\n\t\t\tthis.input.paddingRight = PADDING_RIGHT;\n\t\t\tthis.input.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis.input.paddingLeft = PADDING_LEFT;\n\t\t\tthis.input.gap = GAP;\n\t\t\tthis.input.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the TextInput was not calculated correctly based on the prompt, gap, left and right padding, and icon.\",\n\t\t\t\tthis.textRenderer.width + GAP + LARGE_ICON_WIDTH + PADDING_LEFT + PADDING_RIGHT, this.input.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the TextInput was not calculated correctly based on the prompt, gap, top and bottom padding, and icon.\",\n\t\t\t\tLARGE_ICON_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this.input.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the TextInput was not calculated correctly based on the prompt, gap, left and right padding, and icon.\",\n\t\t\t\tthis.textRenderer.width + GAP + LARGE_ICON_WIDTH + PADDING_LEFT + PADDING_RIGHT, this.input.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the TextInput was not calculated correctly based on the prompt, gap, top and bottom padding, and icon.\",\n\t\t\t\tLARGE_ICON_HEIGHT + PADDING_TOP + PADDING_BOTTOM, this.input.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithSimpleBackgroundSkin():void\n\t\t{\n\t\t\tthis.addSmallSimpleBackground();\n\t\t\tthis.input.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the TextInput was not calculated correctly based on the background width.\",\n\t\t\t\tSMALL_BACKGROUND_WIDTH, this.input.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the TextInput was not calculated correctly based on the background height.\",\n\t\t\t\tSMALL_BACKGROUND_HEIGHT, this.input.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the TextInput was not calculated correctly based on the background width.\",\n\t\t\t\tSMALL_BACKGROUND_WIDTH, this.input.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the TextInput was not calculated correctly based on the background height.\",\n\t\t\t\tSMALL_BACKGROUND_HEIGHT, this.input.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithSmallSimpleBackgroundSkinAndLargeSimpleIcon():void\n\t\t{\n\t\t\tthis.addSmallSimpleBackground();\n\t\t\tthis.addLargeSimpleIcon();\n\t\t\tthis.input.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the TextInput was not calculated correctly based on the icon width.\",\n\t\t\t\tLARGE_ICON_WIDTH, this.input.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the TextInput was not calculated correctly based on the icon height.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this.input.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the TextInput was not calculated correctly based on the icon width.\",\n\t\t\t\tLARGE_ICON_WIDTH, this.input.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the TextInput was not calculated correctly based on the icon height.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this.input.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithLargeSimpleBackgroundSkinAndSmallSimpleIcon():void\n\t\t{\n\t\t\tthis.addLargeSimpleBackground();\n\t\t\tthis.addSmallSimpleIcon();\n\t\t\tthis.input.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the TextInput was not calculated correctly based on the background width.\",\n\t\t\t\tLARGE_BACKGROUND_WIDTH, this.input.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the TextInput was not calculated correctly based on the background height.\",\n\t\t\t\tLARGE_BACKGROUND_HEIGHT, this.input.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the TextInput was not calculated correctly based on the background width.\",\n\t\t\t\tLARGE_BACKGROUND_WIDTH, this.input.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the TextInput was not calculated correctly based on the background height.\",\n\t\t\t\tLARGE_BACKGROUND_HEIGHT, this.input.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithComplexBackground():void\n\t\t{\n\t\t\tthis.addComplexBackground();\n\t\t\tthis.input.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the TextInput was not calculated correctly based on the complex background width.\",\n\t\t\t\tCOMPLEX_BACKGROUND_WIDTH, this.input.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the TextInput was not calculated correctly based on the complex background height.\",\n\t\t\t\tCOMPLEX_BACKGROUND_HEIGHT, this.input.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the TextInput was not calculated correctly based on the complex background minWidth.\",\n\t\t\t\tCOMPLEX_BACKGROUND_MIN_WIDTH, this.input.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the TextInput was not calculated correctly based on the complex background minHeight.\",\n\t\t\t\tCOMPLEX_BACKGROUND_MIN_HEIGHT, this.input.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithSimpleIcon():void\n\t\t{\n\t\t\tthis.addLargeSimpleIcon();\n\t\t\tthis.input.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the TextInput was not calculated correctly based on the icon width.\",\n\t\t\t\tLARGE_ICON_WIDTH, this.input.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the TextInput was not calculated correctly based on the icon height.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this.input.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the TextInput was not calculated correctly based on the icon width.\",\n\t\t\t\tLARGE_ICON_WIDTH, this.input.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the TextInput was not calculated correctly based on the icon height.\",\n\t\t\t\tLARGE_ICON_HEIGHT, this.input.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithComplexIcon():void\n\t\t{\n\t\t\tthis.addComplexIcon();\n\t\t\tthis.input.validate();\n\n\t\t\tAssert.assertStrictlyEquals(\"The width of the TextInput was not calculated correctly based on the complex icon width.\",\n\t\t\t\tCOMPLEX_ICON_WIDTH, this.input.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the TextInput was not calculated correctly based on the complex icon height.\",\n\t\t\t\tCOMPLEX_ICON_HEIGHT, this.input.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the TextInput was not calculated correctly based on the complex icon minWidth.\",\n\t\t\t\tCOMPLEX_ICON_MIN_WIDTH, this.input.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the TextInput was not calculated correctly based on the complex icon minHeight.\",\n\t\t\t\tCOMPLEX_ICON_MIN_HEIGHT, this.input.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithSimpleBackgroundPaddingAndGap():void\n\t\t{\n\t\t\tthis.input.paddingTop = PADDING_TOP;\n\t\t\tthis.input.paddingRight = PADDING_RIGHT;\n\t\t\tthis.input.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis.input.paddingLeft = PADDING_LEFT;\n\t\t\tthis.input.gap = GAP;\n\t\t\tthis.addLargeSimpleBackground();\n\t\t\tthis.input.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the TextInput was not calculated correctly with background skin, padding, and gap.\",\n\t\t\t\tLARGE_BACKGROUND_WIDTH, this.input.width);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the TextInput was not calculated correctly with background skin, padding, and gap.\",\n\t\t\t\tLARGE_BACKGROUND_HEIGHT, this.input.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the TextInput was not calculated correctly with background skin, padding, and gap.\",\n\t\t\t\tLARGE_BACKGROUND_WIDTH, this.input.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the TextInput was not calculated correctly with background skin, padding, and gap.\",\n\t\t\t\tLARGE_BACKGROUND_HEIGHT, this.input.minHeight);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/TextInputRestrictTests.as",
    "content": "package feathers.tests\n{\n\timport org.flexunit.Assert;\n\timport feathers.utils.text.TextInputRestrict;\n\n\tpublic class TextInputRestrictTests\n\t{\n\t\t[Test]\n\t\tpublic function testIsCharacterAllowedWithNullRestrict():void\n\t\t{\n\t\t\tvar restrict:TextInputRestrict = new TextInputRestrict();\n\t\t\tAssert.assertTrue(\"TextInputRestrict: incorrectly excluded character with null restrict\",\n\t\t\t\trestrict.isCharacterAllowed(\"a\".charCodeAt(0)));\n\t\t\tAssert.assertTrue(\"TextInputRestrict: incorrectly excluded character with null restrict\",\n\t\t\t\trestrict.isCharacterAllowed(\"A\".charCodeAt(0)));\n\t\t\tAssert.assertTrue(\"TextInputRestrict: incorrectly excluded character with null restrict\",\n\t\t\t\trestrict.isCharacterAllowed(\"0\".charCodeAt(0)));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testIsCharacterAllowedWithSingleCharacter():void\n\t\t{\n\t\t\tvar restrict:TextInputRestrict = new TextInputRestrict(\"a\");\n\t\t\tAssert.assertTrue(\"TextInputRestrict: incorrectly excluded character that is the only one allowed\",\n\t\t\t\trestrict.isCharacterAllowed(\"a\".charCodeAt(0)));\n\t\t\tAssert.assertFalse(\"TextInputRestrict: incorrectly allowed character that is not allowed\",\n\t\t\t\trestrict.isCharacterAllowed(\"b\".charCodeAt(0)));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testIsCharacterAllowedWithExcludedSingleCharacter():void\n\t\t{\n\t\t\tvar restrict:TextInputRestrict = new TextInputRestrict(\"^a\");\n\t\t\tAssert.assertFalse(\"TextInputRestrict: incorrectly allowed character that is excluded\",\n\t\t\t\trestrict.isCharacterAllowed(\"a\".charCodeAt(0)));\n\t\t\tAssert.assertTrue(\"TextInputRestrict: incorrectly excluded character that is not excluded\",\n\t\t\t\trestrict.isCharacterAllowed(\"b\".charCodeAt(0)));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testIsCharacterAllowedWithRange():void\n\t\t{\n\t\t\tvar restrict:TextInputRestrict = new TextInputRestrict(\"a-z\");\n\t\t\tAssert.assertTrue(\"TextInputRestrict: incorrectly excluded character in range a-z\",\n\t\t\t\trestrict.isCharacterAllowed(\"a\".charCodeAt(0)));\n\t\t\tAssert.assertTrue(\"TextInputRestrict: incorrectly excluded character in range a-z\",\n\t\t\t\trestrict.isCharacterAllowed(\"k\".charCodeAt(0)));\n\t\t\tAssert.assertFalse(\"TextInputRestrict: incorrectly allowed character not in range a-z\",\n\t\t\t\trestrict.isCharacterAllowed(\"A\".charCodeAt(0)));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testIsCharacterAllowedWithExcludedRange():void\n\t\t{\n\t\t\tvar restrict:TextInputRestrict = new TextInputRestrict(\"^a-z\");\n\t\t\tAssert.assertFalse(\"TextInputRestrict: incorrectly allowed character in excluded range a-z\",\n\t\t\t\trestrict.isCharacterAllowed(\"a\".charCodeAt(0)));\n\t\t\tAssert.assertFalse(\"TextInputRestrict: incorrectly allowed character in excluded range a-z\",\n\t\t\t\trestrict.isCharacterAllowed(\"k\".charCodeAt(0)));\n\t\t\tAssert.assertTrue(\"TextInputRestrict: incorrectly excluded character not in excluded range a-z\",\n\t\t\t\trestrict.isCharacterAllowed(\"A\".charCodeAt(0)));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testIsCharacterAllowedWithMultipleRanges():void\n\t\t{\n\t\t\tvar restrict:TextInputRestrict = new TextInputRestrict(\"a-z0-9\");\n\t\t\tAssert.assertTrue(\"TextInputRestrict: incorrectly excluded character in range a-z\",\n\t\t\t\trestrict.isCharacterAllowed(\"a\".charCodeAt(0)));\n\t\t\tAssert.assertTrue(\"TextInputRestrict: incorrectly excluded character in range a-z\",\n\t\t\t\trestrict.isCharacterAllowed(\"k\".charCodeAt(0)));\n\t\t\tAssert.assertTrue(\"TextInputRestrict: incorrectly excluded character in range 0-9\",\n\t\t\t\trestrict.isCharacterAllowed(\"3\".charCodeAt(0)));\n\t\t\tAssert.assertTrue(\"TextInputRestrict: incorrectly excluded character in range 0-9\",\n\t\t\t\trestrict.isCharacterAllowed(\"9\".charCodeAt(0)));\n\t\t\tAssert.assertFalse(\"TextInputRestrict: incorrectly allowed character not in range\",\n\t\t\t\trestrict.isCharacterAllowed(\"Z\".charCodeAt(0)));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testIsCharacterAllowedWithMultipleRangesAndOneExcluded():void\n\t\t{\n\t\t\tvar restrict:TextInputRestrict = new TextInputRestrict(\"a-z^k-p\");\n\t\t\tAssert.assertTrue(\"TextInputRestrict: incorrectly excluded character in range a-z\",\n\t\t\t\trestrict.isCharacterAllowed(\"a\".charCodeAt(0)));\n\t\t\tAssert.assertTrue(\"TextInputRestrict: incorrectly excluded character in range a-z\",\n\t\t\t\trestrict.isCharacterAllowed(\"g\".charCodeAt(0)));\n\t\t\tAssert.assertFalse(\"TextInputRestrict: incorrectly allowed character in excluded range k-p\",\n\t\t\t\trestrict.isCharacterAllowed(\"k\".charCodeAt(0)));\n\t\t\tAssert.assertFalse(\"TextInputRestrict: incorrectly allowed character in excluded range k-p\",\n\t\t\t\trestrict.isCharacterAllowed(\"m\".charCodeAt(0)));\n\t\t\tAssert.assertFalse(\"TextInputRestrict: incorrectly allowed character not in range\",\n\t\t\t\trestrict.isCharacterAllowed(\"9\".charCodeAt(0)));\n\t\t\tAssert.assertFalse(\"TextInputRestrict: incorrectly allowed character not in range a-z\",\n\t\t\t\trestrict.isCharacterAllowed(\"Z\".charCodeAt(0)));\n\t\t}\n\n\t\t//issue #1605\n\t\t[Test]\n\t\tpublic function testIsCharacterAllowedWithRangeAndEscapedCharacters():void\n\t\t{\n\t\t\tvar restrict:TextInputRestrict = new TextInputRestrict(\"a-z\\\\-\\\\^\\\\\\\\\");\n\t\t\tAssert.assertTrue(\"TextInputRestrict: incorrectly excluded character in range a-z\",\n\t\t\t\trestrict.isCharacterAllowed(\"a\".charCodeAt(0)));\n\t\t\tAssert.assertTrue(\"TextInputRestrict: incorrectly excluded character in range a-z\",\n\t\t\t\trestrict.isCharacterAllowed(\"g\".charCodeAt(0)));\n\t\t\tAssert.assertTrue(\"TextInputRestrict: incorrectly excluded allowed escaped character\",\n\t\t\t\trestrict.isCharacterAllowed(\"-\".charCodeAt(0)));\n\t\t\tAssert.assertTrue(\"TextInputRestrict: incorrectly excluded allowed escaped character\",\n\t\t\t\trestrict.isCharacterAllowed(\"^\".charCodeAt(0)));\n\t\t\tAssert.assertTrue(\"TextInputRestrict: incorrectly excluded allowed escaped character\",\n\t\t\t\trestrict.isCharacterAllowed(\"\\\\\".charCodeAt(0)));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/TextInputTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.TextInput;\n\timport feathers.tests.supportClasses.DisposeFlagQuad;\n\n\timport org.flexunit.Assert;\n\n\tpublic class TextInputTests\n\t{\n\t\tprivate var _input:TextInput;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._input = new TextInput();\n\t\t\tTestFeathers.starlingRoot.addChild(this._input);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._input.removeFromParent(true);\n\t\t\tthis._input = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSkinsDisposed():void\n\t\t{\n\t\t\tvar backgroundSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._input.backgroundSkin = backgroundSkin;\n\t\t\tvar backgroundEnabledSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._input.backgroundEnabledSkin = backgroundEnabledSkin;\n\t\t\tvar backgroundDisabledSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._input.backgroundDisabledSkin = backgroundDisabledSkin;\n\t\t\tvar backgroundFocusedSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._input.backgroundFocusedSkin = backgroundFocusedSkin;\n\t\t\tthis._input.validate();\n\t\t\tthis._input.dispose();\n\t\t\tAssert.assertTrue(\"backgroundSkin not disposed when TextInput disposed.\", backgroundSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"backgroundEnabledSkin not disposed when TextInput disposed.\", backgroundEnabledSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"backgroundDisabledSkin not disposed when TextInput disposed.\", backgroundDisabledSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"backgroundFocusedSkin not disposed when TextInput disposed.\", backgroundFocusedSkin.isDisposed);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testIconsDisposed():void\n\t\t{\n\t\t\tvar defaultIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._input.defaultIcon = defaultIcon;\n\t\t\tvar enabledIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._input.enabledIcon = enabledIcon;\n\t\t\tvar focusedIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._input.focusedIcon = focusedIcon;\n\t\t\tvar disabledIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._input.disabledIcon = disabledIcon;\n\t\t\tthis._input.validate();\n\t\t\tthis._input.dispose();\n\t\t\tAssert.assertTrue(\"defaultIcon not disposed when TextInput disposed.\", defaultIcon.isDisposed);\n\t\t\tAssert.assertTrue(\"enabledIcon not disposed when TextInput disposed.\", enabledIcon.isDisposed);\n\t\t\tAssert.assertTrue(\"disabledIcon not disposed when TextInput disposed.\", disabledIcon.isDisposed);\n\t\t\tAssert.assertTrue(\"focusedIcon not disposed when TextInput disposed.\", focusedIcon.isDisposed);\n\t\t}\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/TextureCacheTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.utils.textures.TextureCache;\n\n\timport org.flexunit.Assert;\n\n\timport starling.textures.Texture;\n\n\tpublic class TextureCacheTests\n\t{\n\t\tprivate static const KEY_ONE:String = \"one\";\n\t\tprivate static const KEY_TWO:String = \"two\";\n\t\t\n\t\tprivate var _cache:TextureCache;\n\t\tprivate var _texture1:Texture;\n\t\tprivate var _texture2:Texture;\n\t\t\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._cache = new TextureCache();\n\t\t\t\n\t\t\tthis._texture1 = Texture.fromColor(10, 10, 0xffff00ff);\n\t\t\tthis._texture2 = Texture.fromColor(10, 10, 0xffffff00);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._cache.dispose();\n\t\t\tthis._cache = null;\n\t\t\tthis._texture1.dispose();\n\t\t\tthis._texture1 = null;\n\t\t\tthis._texture2.dispose();\n\t\t\tthis._texture2 = null;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRetainCountAfterAddWithRetain():void\n\t\t{\n\t\t\tthis._cache.addTexture(KEY_ONE, this._texture1, true);\n\t\t\tAssert.assertStrictlyEquals(\"The result of getRetainCount() on a TextureCache is incorrect after addTexture() with retain.\",\n\t\t\t\t1, this._cache.getRetainCount(KEY_ONE));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRetainCountAfterAddWithoutRetain():void\n\t\t{\n\t\t\tthis._cache.addTexture(KEY_ONE, this._texture1, false);\n\t\t\tAssert.assertStrictlyEquals(\"The result of getRetainCount() on a TextureCache is incorrect after addTexture() without retain.\",\n\t\t\t\t0, this._cache.getRetainCount(KEY_ONE));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRetainCountAfterTwoRetains():void\n\t\t{\n\t\t\tthis._cache.addTexture(KEY_ONE, this._texture1, true);\n\t\t\tthis._cache.retainTexture(KEY_ONE);\n\t\t\tAssert.assertStrictlyEquals(\"The result of getRetainCount() on a TextureCache is incorrect after retaining twice.\",\n\t\t\t\t2, this._cache.getRetainCount(KEY_ONE));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRetainCountAfterRelease():void\n\t\t{\n\t\t\tthis._cache.addTexture(KEY_ONE, this._texture1, true);\n\t\t\tthis._cache.releaseTexture(KEY_ONE);\n\t\t\tAssert.assertStrictlyEquals(\"The result of getRetainCount() on a TextureCache is incorrect after releasing.\",\n\t\t\t\t0, this._cache.getRetainCount(KEY_ONE));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRetainCountAfterRemove():void\n\t\t{\n\t\t\tthis._cache.addTexture(KEY_ONE, this._texture1, true);\n\t\t\tthis._cache.removeTexture(KEY_ONE);\n\t\t\tAssert.assertStrictlyEquals(\"The result of getRetainCount() on a TextureCache is incorrect after removing a texture.\",\n\t\t\t\t0, this._cache.getRetainCount(KEY_ONE));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRetainCountAfterDispose():void\n\t\t{\n\t\t\tthis._cache.addTexture(KEY_ONE, this._texture1, true);\n\t\t\tthis._cache.dispose();\n\t\t\tAssert.assertStrictlyEquals(\"The result of getRetainCount() on a TextureCache is incorrect after disposing the cache.\",\n\t\t\t\t0, this._cache.getRetainCount(KEY_ONE));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRetainCountAfterAddTwoTextures():void\n\t\t{\n\t\t\tthis._cache.addTexture(KEY_ONE, this._texture1, true);\n\t\t\tthis._cache.addTexture(KEY_TWO, this._texture2, true);\n\t\t\tthis._cache.retainTexture(KEY_ONE);\n\t\t\tthis._cache.retainTexture(KEY_ONE);\n\t\t\tthis._cache.retainTexture(KEY_TWO);\n\t\t\tAssert.assertStrictlyEquals(\"The result of getRetainCount() on a TextureCache is incorrect after adding two textures.\",\n\t\t\t\t3, this._cache.getRetainCount(KEY_ONE));\n\t\t\tAssert.assertStrictlyEquals(\"The result of getRetainCount() on a TextureCache is incorrect after adding two textures.\",\n\t\t\t\t2, this._cache.getRetainCount(KEY_TWO));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHasTextureAfterRetain():void\n\t\t{\n\t\t\tthis._cache.addTexture(KEY_ONE, this._texture1, true);\n\t\t\tAssert.assertTrue(\"The result of hasTexture() on a TextureCache is incorrect after retain.\",\n\t\t\t\tthis._cache.hasTexture(KEY_ONE));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHasTextureAfterRelease():void\n\t\t{\n\t\t\tthis._cache.addTexture(KEY_ONE, this._texture1, true);\n\t\t\tthis._cache.releaseTexture(KEY_ONE);\n\t\t\tAssert.assertTrue(\"The result of hasTexture() on a TextureCache is incorrect after releasing.\",\n\t\t\t\tthis._cache.hasTexture(KEY_ONE));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHasTextureAfterRemove():void\n\t\t{\n\t\t\tthis._cache.addTexture(KEY_ONE, this._texture1, true);\n\t\t\tthis._cache.removeTexture(KEY_ONE);\n\t\t\tAssert.assertFalse(\"The result of hasTexture() on a TextureCache is incorrect after removing a texture.\",\n\t\t\t\tthis._cache.hasTexture(KEY_ONE));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHasTextureAfterDispose():void\n\t\t{\n\t\t\tthis._cache.addTexture(KEY_ONE, this._texture1, true);\n\t\t\tthis._cache.dispose();\n\t\t\tAssert.assertFalse(\"The result of hasTexture() on a TextureCache is incorrect after disposing the cache.\",\n\t\t\t\tthis._cache.hasTexture(KEY_ONE));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHasTextureWithMaxUnretainedTexturesAfterAddWithoutRetain():void\n\t\t{\n\t\t\tthis._cache.maxUnretainedTextures = 1;\n\t\t\tthis._cache.addTexture(KEY_ONE, this._texture1, false);\n\t\t\tthis._cache.addTexture(KEY_TWO, this._texture2, false);\n\t\t\t//both are added unretained, but the maximum is 1, one will be\n\t\t\t//removed automatically. since KEY_ONE was put into an unretained\n\t\t\t//state first, it's the one that will be removed.\n\t\t\tAssert.assertFalse(\"The result of hasTexture() on a TextureCache is maxUnretainedTextures is incorrect after releasing\",\n\t\t\t\tthis._cache.hasTexture(KEY_ONE));\n\t\t\tAssert.assertTrue(\"The result of hasTexture() on a TextureCache with maxUnretainedTextures is incorrect after releasing.\",\n\t\t\t\tthis._cache.hasTexture(KEY_TWO));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHasTextureWithMaxUnretainedTexturesAfterRelease():void\n\t\t{\n\t\t\tthis._cache.maxUnretainedTextures = 1;\n\t\t\tthis._cache.addTexture(KEY_ONE, this._texture1, true);\n\t\t\tthis._cache.addTexture(KEY_TWO, this._texture2, true);\n\t\t\tthis._cache.releaseTexture(KEY_ONE);\n\t\t\tthis._cache.releaseTexture(KEY_TWO);\n\t\t\t//KEY_ONE was released first, so it will be the one that is removed\n\t\t\t//automatically, while KEY_TWO will remain cached.\n\t\t\tAssert.assertFalse(\"The result of hasTexture() on a TextureCache is maxUnretainedTextures is incorrect after releasing\",\n\t\t\t\tthis._cache.hasTexture(KEY_ONE));\n\t\t\tAssert.assertTrue(\"The result of hasTexture() on a TextureCache with maxUnretainedTextures is incorrect after releasing.\",\n\t\t\t\tthis._cache.hasTexture(KEY_TWO));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveTextureThatWasNotAdded():void\n\t\t{\n\t\t\t//no errors should be thrown\n\t\t\tthis._cache.removeTexture(KEY_ONE);\n\t\t}\n\n\t\t[Test(expects=\"flash.errors.IllegalOperationError\")]\n\t\tpublic function testAddTextureAfterDispose():void\n\t\t{\n\t\t\tthis._cache.dispose();\n\t\t\tthis._cache.addTexture(KEY_ONE, this._texture1, true);\n\t\t}\n\n\t\t[Test(expects=\"flash.errors.IllegalOperationError\")]\n\t\tpublic function testRetainTextureAfterDispose():void\n\t\t{\n\t\t\t//in the case where the cache is disposed before a display object\n\t\t\t//is disposed, it's better not to throw a strange runtime error.\n\t\t\tthis._cache.addTexture(KEY_ONE, this._texture1, true);\n\t\t\tthis._cache.dispose();\n\t\t\tthis._cache.retainTexture(KEY_ONE);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testReleaseTextureAfterDispose():void\n\t\t{\n\t\t\t//in the case where the cache is disposed before a display object\n\t\t\t//is disposed, it's better not to throw a strange runtime error.\n\t\t\tthis._cache.addTexture(KEY_ONE, this._texture1, true);\n\t\t\tthis._cache.dispose();\n\t\t\tthis._cache.releaseTexture(KEY_ONE);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveTextureAfterDispose():void\n\t\t{\n\t\t\tthis._cache.addTexture(KEY_ONE, this._texture1, true);\n\t\t\tthis._cache.dispose();\n\t\t\t//removal shouldn't throw any errors if the texture doesn't exist\n\t\t\tthis._cache.removeTexture(KEY_ONE);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/TiledColumnsLayoutTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.LayoutBoundsResult;\n\timport feathers.layout.TiledColumnsLayout;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.ViewPortBounds;\n\n\timport flash.geom.Point;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\n\tpublic class TiledColumnsLayoutTests\n\t{\n\t\tprivate static const PADDING_TOP:Number = 6;\n\t\tprivate static const PADDING_RIGHT:Number = 8;\n\t\tprivate static const PADDING_BOTTOM:Number = 2;\n\t\tprivate static const PADDING_LEFT:Number = 10;\n\t\tprivate static const GAP:Number = 5;\n\t\tprivate static const CHILD1_WIDTH:Number = 200;\n\t\tprivate static const CHILD1_HEIGHT:Number = 100;\n\t\tprivate static const CHILD2_WIDTH:Number = 150;\n\t\tprivate static const CHILD2_HEIGHT:Number = 75;\n\t\tprivate static const CHILD3_WIDTH:Number = 75;\n\t\tprivate static const CHILD3_HEIGHT:Number = 50;\n\n\t\tprivate var _layout:TiledColumnsLayout;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._layout = new TiledColumnsLayout();\n\t\t\tthis._layout.useVirtualLayout = false;\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._layout = null;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithNoItems():void\n\t\t{\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult viewPortWidth not equal to 0 with no items.\", 0, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult viewPortHeight not equal to 0 with no items.\", 0, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentWidth not equal to 0 with no items.\", 0, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentHeight not equal to 0 with no items.\", 0, result.contentHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentX not equal to 0 with no items.\", 0, result.contentX);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentY not equal to 0 with no items.\", 0, result.contentY);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithNoItems():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(0, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout measureViewPort width not equal to 0 with no items.\", 0, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout measureViewPort height not equal to 0 with no items.\", 0, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithPaddingGapAndNoItems():void\n\t\t{\n\t\t\tthis._layout.paddingTop = PADDING_TOP;\n\t\t\tthis._layout.paddingRight = PADDING_RIGHT;\n\t\t\tthis._layout.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._layout.paddingLeft = PADDING_LEFT;\n\t\t\tthis._layout.gap = GAP;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult viewPortWidth not equal to sum of left and right padding with no items.\", PADDING_LEFT + PADDING_RIGHT, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult viewPortHeight not equal to sum of top and bottom padding with no items.\", PADDING_TOP + PADDING_BOTTOM, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentWidth not equal to sum of left and right padding with no items.\", PADDING_LEFT + PADDING_RIGHT, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentHeight not equal to sum of top and bottom padding with no items.\", PADDING_TOP + PADDING_BOTTOM, result.contentHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentX not equal to 0 with padding and no items.\", 0, result.contentX);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentY not equal to 0 with padding and no items.\", 0, result.contentY);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithPaddingGapAndNoItems():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.paddingTop = PADDING_TOP;\n\t\t\tthis._layout.paddingRight = PADDING_RIGHT;\n\t\t\tthis._layout.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._layout.paddingLeft = PADDING_LEFT;\n\t\t\tthis._layout.gap = GAP;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(0, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout measureViewPort x not equal to sum of left and right padding with no items.\", PADDING_LEFT + PADDING_RIGHT, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout measureViewPort y not equal to sum of top and bottom padding with no items.\", PADDING_TOP + PADDING_BOTTOM, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithOneChildAndSquareTiles():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tvar tileSize:Number = Math.max(CHILD1_WIDTH, CHILD1_HEIGHT);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult viewPortWidth not equal to max child dimension with square tiles and one item.\", tileSize, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult viewPortHeight not equal to max child dimension with square tiles and one item.\", tileSize, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentWidth not equal to max child dimension with square tiles and one item.\", tileSize, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentHeight not equal to max child dimension with square tiles and one item.\", tileSize, result.contentHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentX not equal to 0 with one item and square tiles.\", 0, result.contentX);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentY not equal to 0 with one item and square tiles.\", 0, result.contentY);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithOneChildAndSquareTiles():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tvar tileSize:Number = Math.max(CHILD1_WIDTH, CHILD1_HEIGHT);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout measureViewPort x not equal to max child dimension with square tiles and one item.\", tileSize, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout measureViewPort y not equal to max child dimension with square tiles and one item.\", tileSize, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithOneChildAndNotSquareTiles():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult viewPortWidth not equal to child width with non-square tiles and one item.\", CHILD1_WIDTH, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult viewPortHeight not equal to child height with non-square tiles and one item.\", CHILD1_HEIGHT, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentWidth not equal to child width with non-square tiles and one item.\", CHILD1_WIDTH, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentHeight not equal to child height with non-square tiles and one item.\", CHILD1_HEIGHT, result.contentHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentX not equal to 0 with one item and non-square tiles.\", 0, result.contentX);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentY not equal to 0 with one item and non-square tiles.\", 0, result.contentY);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithOneChildAndNotSquareTiles():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout measureViewPort x not equal to child width with non-square tiles and one item.\", CHILD1_WIDTH, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout measureViewPort y not equal to child height with non-square tiles and one item.\", CHILD1_HEIGHT, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithPaddingGapAndOneChild():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.paddingTop = PADDING_TOP;\n\t\t\tthis._layout.paddingRight = PADDING_RIGHT;\n\t\t\tthis._layout.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._layout.paddingLeft = PADDING_LEFT;\n\t\t\tthis._layout.gap = GAP;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult viewPortWidth not equal to sum of left and right padding and width of child.\", CHILD1_WIDTH + PADDING_LEFT + PADDING_RIGHT, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult viewPortHeight not equal to sum of top and bottom padding and height of child.\", CHILD1_HEIGHT + PADDING_TOP + PADDING_BOTTOM, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentWidth not equal to sum of left and right padding and width of child.\", CHILD1_WIDTH + PADDING_LEFT + PADDING_RIGHT, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentHeight not equal to sum of top and bottom padding and height of child.\", CHILD1_HEIGHT + PADDING_TOP + PADDING_BOTTOM, result.contentHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentX not equal to 0 with one item and padding.\", 0, result.contentX);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentY not equal to 0 with one item and padding.\", 0, result.contentY);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithPaddingGapAndOneChild():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.paddingTop = PADDING_TOP;\n\t\t\tthis._layout.paddingRight = PADDING_RIGHT;\n\t\t\tthis._layout.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._layout.paddingLeft = PADDING_LEFT;\n\t\t\tthis._layout.gap = GAP;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout measureViewPort x not equal to sum of left and right padding and width of child.\", CHILD1_WIDTH + PADDING_LEFT + PADDING_RIGHT, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout measureViewPort y not equal to sum of top and bottom padding and height of child.\", CHILD1_HEIGHT + PADDING_TOP + PADDING_BOTTOM, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithTwoChildren():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar item2:Quad = new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tvar maxChildWidth:Number = Math.max(CHILD1_WIDTH, CHILD2_WIDTH);\n\t\t\tvar maxChildHeight:Number = Math.max(CHILD1_HEIGHT, CHILD2_HEIGHT);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult viewPortWidth not equal to max width of items.\", maxChildWidth, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult viewPortHeight not equal to sum of tile heights.\", 2 * maxChildHeight, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentWidth not equal to max width of items.\", maxChildWidth, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentHeight not equal to sum of tile heights.\", 2 * maxChildHeight, result.contentHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentX not equal to 0 with padding and two items.\", 0, result.contentX);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentY not equal to 0 with padding and two items.\", 0, result.contentY);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithTwoChildren():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(2, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout measureViewPort x not equal to width of typical item.\", CHILD1_WIDTH, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout measureViewPort y not equal to typical item height multiplied by the number of items.\", 2 * CHILD1_HEIGHT, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithPaddingGapAndTwoChildren():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.paddingTop = PADDING_TOP;\n\t\t\tthis._layout.paddingRight = PADDING_RIGHT;\n\t\t\tthis._layout.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._layout.paddingLeft = PADDING_LEFT;\n\t\t\tthis._layout.gap = GAP;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar item2:Quad = new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tvar maxChildWidth:Number = Math.max(CHILD1_WIDTH, CHILD2_WIDTH);\n\t\t\tvar maxChildHeight:Number = Math.max(CHILD1_HEIGHT, CHILD2_HEIGHT);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult viewPortWidth not equal to max width of items plus left and right padding.\", maxChildWidth + PADDING_LEFT + PADDING_RIGHT, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult viewPortHeight not equal to sum of tile heights plus top and bottom padding and gap.\", 2 * maxChildHeight + PADDING_TOP + PADDING_BOTTOM + GAP, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentWidth not equal to sum of max width of items plus left and right padding.\", maxChildWidth + PADDING_LEFT + PADDING_RIGHT, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentHeight not equal to sum of tile heights plus top and bottom padding and gap.\", 2 * maxChildHeight + PADDING_TOP + PADDING_BOTTOM + GAP, result.contentHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentX not equal to 0 with two items plus padding and gap.\", 0, result.contentX);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentY not equal to 0 with two items plus padding and gap.\", 0, result.contentY);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithPaddingGapAndTwoChildren():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.paddingTop = PADDING_TOP;\n\t\t\tthis._layout.paddingRight = PADDING_RIGHT;\n\t\t\tthis._layout.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._layout.paddingLeft = PADDING_LEFT;\n\t\t\tthis._layout.gap = GAP;\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(2, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout measureViewPort x not equal to max width of items plus left and right padding.\", CHILD1_WIDTH + PADDING_LEFT + PADDING_RIGHT, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout measureViewPort y not equal to sum of tile heights plus top and bottom padding and gap.\", 2 * CHILD1_HEIGHT + PADDING_TOP + PADDING_BOTTOM + GAP, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithRequestedRowCountLargerThanItemCount():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.requestedRowCount = 2;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult viewPortWidth not equal to max width of items with requestedRowCount larger than item count.\", CHILD1_WIDTH, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult viewPortHeight not equal to tile height multiplied by requestedRowCount larger than item count.\", 2 * CHILD1_HEIGHT, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentWidth not equal to max width of items with requestedRowCount larger than item count.\", CHILD1_WIDTH, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentHeight not equal to tile height multiplied by requestedRowCount larger than item count.\", 2 * CHILD1_HEIGHT, result.contentHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentX not equal to 0 with requestedRowCount larger than item count.\", 0, result.contentX);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentY not equal to 0 with requestedRowCount larger than item count.\", 0, result.contentY);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithRequestedRowCountLargerThanItemCount():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.requestedRowCount = 2;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout measureViewPort x not equal to max width of items with requestedRowCount larger than item count.\", CHILD1_WIDTH, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout measureViewPort y not equal to tile height multiplied by requestedRowCount larger than item count.\", 2 * CHILD1_HEIGHT, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithRequestedRowCountSmallerThanItemCount():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.requestedRowCount = 2;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar item2:Quad = new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff);\n\t\t\tvar item3:Quad = new Quad(CHILD3_WIDTH, CHILD3_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2, item3];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tvar maxChildWidth:Number = Math.max(CHILD1_WIDTH, CHILD2_WIDTH, CHILD3_WIDTH);\n\t\t\tvar maxChildHeight:Number = Math.max(CHILD1_HEIGHT, CHILD2_HEIGHT, CHILD3_HEIGHT);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult viewPortWidth not equal to max width of items multiplied by column count with requestedRowCount smaller than item count.\", 2 * maxChildWidth, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult viewPortHeight not equal to tile height multiplied by requestedRowCount smaller than item count.\", 2 * maxChildHeight, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentWidth not equal to max width of items multiplied by column count with requestedRowCount smaller than item count.\", 2 * maxChildWidth, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentHeight not equal to tile height multiplied by requestedRowCount smaller than item count.\", 2 * maxChildHeight, result.contentHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentX not equal to 0 with requestedRowCount smaller than item count.\", 0, result.contentX);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentY not equal to 0 with requestedRowCount smaller than item count.\", 0, result.contentY);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithRequestedRowCountSmallerThanItemCount():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.requestedRowCount = 2;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(3, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout measureViewPort x not equal to max width of items multiplied by column count with requestedRowCount smaller than item count.\", 2 * CHILD1_WIDTH, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout measureViewPort y not equal to tile height multiplied by requestedRowCount smaller than item count.\", 2 * CHILD1_HEIGHT, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithExplicitWidthSmallerThanChild():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = CHILD1_WIDTH / 3;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult viewPortWidth not equal to explicitWidth when explicitWidth is smaller than item width.\", bounds.explicitWidth, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentWidth not equal to item width when explicitWidth is smaller than item width.\", CHILD1_WIDTH, result.contentWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithExplicitWidthSmallerThanChild():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = CHILD1_WIDTH / 3;\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout measureViewPort x not equal to explicitWidth when explicitWidth is smaller than item width.\", bounds.explicitWidth, result.x);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithExplicitWidthLargerThanChild():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 3 * CHILD1_WIDTH;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult viewPortWidth not equal to explicitWidth when explicitWidth is larger than item width.\", bounds.explicitWidth, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentWidth not equal to item width when explicitWidth is larger than item width.\", CHILD1_WIDTH, result.contentWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithExplicitWidthLargerThanChild():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 3 * CHILD1_WIDTH;\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout measureViewPort x not equal to explicitWidth when explicitWidth is larger than item width.\", bounds.explicitWidth, result.x);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithMaxWidthSmallerThanChild():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.maxWidth = CHILD1_WIDTH / 3;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult viewPortWidth not equal to maxWidth when maxWidth is smaller than item width.\", bounds.maxWidth, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentWidth not equal to item width when maxWidth is smaller than item width.\", CHILD1_WIDTH, result.contentWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithMaxWidthSmallerThanChild():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.maxWidth = CHILD1_WIDTH / 3;\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout measureViewPort x not equal to maxWidth when maxWidth is smaller than item width.\", bounds.maxWidth, result.x);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithMinWidthLargerThanChild():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.minWidth = 3 * CHILD1_WIDTH;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult viewPortWidth not equal to minWidth when minWidth is larger than item width.\", bounds.minWidth, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentWidth not equal to item width when minWidth is smaller than item width.\", CHILD1_WIDTH, result.contentWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithMinWidthLargerThanChild():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.minWidth = 3 * CHILD1_WIDTH;\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout measureViewPort x not equal to minWidth when minWidth is larger than item width.\", bounds.minWidth, result.x);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithMaxWidthLargerThanChild():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\t//needs to be enough to require more than one tile\n\t\t\tbounds.maxWidth = 3 * CHILD1_WIDTH;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult viewPortWidth not equal to item width when maxWidth is larger than item width.\", CHILD1_WIDTH, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentWidth not equal to item width when maxWidth is larger than item width.\", CHILD1_WIDTH, result.contentWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithMaxWidthLargerThanChild():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\t//needs to be enough to require more than one tile\n\t\t\tbounds.maxWidth = 3 * CHILD1_WIDTH;\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout measureViewPort x not equal to item width when maxWidth is larger than item width.\", CHILD1_WIDTH, result.x);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithMaxHeightSmallerThanChild():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.maxHeight = CHILD1_HEIGHT / 3;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult viewPortHeight not equal to maxHeight when maxHeight is smaller than child height.\", bounds.maxHeight, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentHeight not equal to item height when maxHeight is smaller than child height.\", CHILD1_HEIGHT, result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithMaxHeightSmallerThanChild():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.maxHeight = CHILD1_HEIGHT / 3;\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout measureViewPort y not equal to maxHeight when maxHeight is smaller than child height.\", bounds.maxHeight, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithMaxHeightLargerThanChild():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\t//needs to be enough to require more than one tile\n\t\t\tbounds.maxHeight = 3 * CHILD1_HEIGHT;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult viewPortHeight not equal to child height when maxHeight is larger than child height.\", CHILD1_HEIGHT, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentHeight not equal to child height when maxHeight is larger than child height.\", CHILD1_HEIGHT, result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithMaxHeightLargerThanChild():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\t//needs to be enough to require more than one tile\n\t\t\tbounds.maxHeight = 3 * CHILD1_HEIGHT;\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout measureViewPort y not equal to child height when maxHeight is larger than child height.\", CHILD1_HEIGHT, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithMaxWidthLargerThanRequestedColumnCountLargerThanItemCount():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.requestedColumnCount = 2;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.maxWidth = 3 * CHILD1_WIDTH;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult viewPortWidth not correct when maxWidth larger than requestedColumnCount and requestedColumnCount larger than item count.\", 2 * CHILD1_WIDTH, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentWidth not correct when maxWidth larger than requestedColumnCount and requestedColumnCount larger than item count.\", 2 * CHILD1_WIDTH, result.contentWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithMaxWidthLargerThanRequestedColumnCountLargerThanItemCount():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.requestedColumnCount = 2;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.maxWidth = 3 * CHILD1_WIDTH;\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout measureViewPort x not correct when maxWidth larger than requestedColumnCount and requestedColumnCount larger than item count.\", 2 * CHILD1_WIDTH, result.x);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithMaxHeightLargerThanRequestedRowCountLargerThanItemCount():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.requestedRowCount = 2;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.maxHeight = 3 * CHILD1_HEIGHT;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult viewPortHeight not correct when maxHeight larger than requestedRowCount and requestedRowCount larger than item count.\", 2 * CHILD1_HEIGHT, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout layout LayoutBoundsResult contentHeight not correct when maxHeight larger than requestedRowCount and requestedRowCount larger than item count.\", 2 * CHILD1_HEIGHT, result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithMaxHeightLargerThanRequestedRowCountLargerThanItemCount():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.requestedRowCount = 2;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.maxHeight = 3 * CHILD1_HEIGHT;\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout measureViewPort y not correct when maxHeight larger than requestedRowCount and requestedRowCount larger than item count.\", 2 * CHILD1_HEIGHT, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testItemXWithExplicitWidthRequestedColumnCountAndHorizontalAlignRight():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.requestedColumnCount = 2;\n\t\t\tthis._layout.horizontalAlign = HorizontalAlign.RIGHT;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 3 * CHILD1_WIDTH;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout x position of first child not correct with explicit width larger than requestedColumnCount.\", CHILD1_WIDTH, item1.x);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testItemYWithExplicitHeightRequestedRowCountAndVerticalAlignBottom():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.requestedRowCount = 2;\n\t\t\tthis._layout.verticalAlign = VerticalAlign.BOTTOM;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitHeight = 3 * CHILD1_HEIGHT;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout y position of first child not correct with explicit height larger than requestedRowCount.\", CHILD1_HEIGHT, item1.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTileHeightWithDistributeHeights():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.distributeHeights = true;\n\t\t\tthis._layout.tileVerticalAlign = VerticalAlign.JUSTIFY;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitHeight = 3 * CHILD1_HEIGHT;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout height of tile not correct with distributeHeights.\",\n\t\t\t\t3 * CHILD1_HEIGHT, item1.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTileHeightWithDistributeHeightsAndRequestedRowCount():void\n\t\t{\n\t\t\tvar requestedRowCount:int = 3;\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.distributeHeights = true;\n\t\t\tthis._layout.requestedRowCount = requestedRowCount;\n\t\t\tthis._layout.tileVerticalAlign = VerticalAlign.JUSTIFY;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitHeight = 2 * CHILD1_HEIGHT;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout height of tile not correct with distributeHeights and requestedRowCount.\",\n\t\t\t\t2 * CHILD1_HEIGHT / requestedRowCount, item1.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testThreeTileHeightWithDistributeHeightsAndNoExplicitHeight():void\n\t\t{\n\t\t\t//distributeHeights should essentially do nothing in this case\n\t\t\t//because the view port height needs to be calculated\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.distributeHeights = true;\n\t\t\tthis._layout.tileVerticalAlign = VerticalAlign.JUSTIFY;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar item2:Quad = new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff);\n\t\t\tvar item3:Quad = new Quad(CHILD3_WIDTH, CHILD3_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2, item3];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tvar tileHeight:Number = Math.max(CHILD1_HEIGHT, CHILD2_HEIGHT, CHILD3_HEIGHT);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout height of first tile not correct with distributeHeights and no explicit height.\",\n\t\t\t\ttileHeight, item1.height);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout height of second tile not correct with distributeHeights and no explicit height.\",\n\t\t\t\ttileHeight, item2.height);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout height of third tile not correct with distributeHeights and no explicit height.\",\n\t\t\t\ttileHeight, item3.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTileWidthWithDistributeHeightsAndUseSquareTiles():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = true;\n\t\t\tthis._layout.distributeHeights = true;\n\t\t\tthis._layout.tileHorizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\tthis._layout.tileVerticalAlign = VerticalAlign.JUSTIFY;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitHeight = 3 * CHILD1_HEIGHT;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout width of tile not correct with distributeHeights and useSquareTiles.\",\n\t\t\t\t3 * CHILD1_HEIGHT, item1.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTwoTilesHeightWithDistributeHeights():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.distributeHeights = true;\n\t\t\tthis._layout.tileVerticalAlign = VerticalAlign.JUSTIFY;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar item2:Quad = new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitHeight = 3 * CHILD1_HEIGHT;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout height of first tile not correct with distributeHeights.\",\n\t\t\t\t3 * CHILD1_HEIGHT / 2, item1.height);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout height of second tile not correct with distributeHeights.\",\n\t\t\t\t3 * CHILD1_HEIGHT / 2, item2.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTwoTilesHeightWithDistributeHeightsAndRequestedRowCount():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.distributeHeights = true;\n\t\t\tthis._layout.requestedRowCount = 2;\n\t\t\tthis._layout.tileVerticalAlign = VerticalAlign.JUSTIFY;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar item2:Quad = new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitHeight = CHILD1_HEIGHT / 2;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout height of first tile not correct with distributeHeights and requestedRowCount.\",\n\t\t\t\tCHILD1_HEIGHT / 4, item1.height);\n\t\t\tAssert.assertStrictlyEquals(\"TiledColumnsLayout height of second tile not correct with distributeHeights and requestedRowCount.\",\n\t\t\t\tCHILD1_HEIGHT / 4, item2.height);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/TiledRowsLayoutTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.LayoutBoundsResult;\n\timport feathers.layout.TiledRowsLayout;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.ViewPortBounds;\n\n\timport flash.geom.Point;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\n\tpublic class TiledRowsLayoutTests\n\t{\n\t\tprivate static const PADDING_TOP:Number = 6;\n\t\tprivate static const PADDING_RIGHT:Number = 8;\n\t\tprivate static const PADDING_BOTTOM:Number = 2;\n\t\tprivate static const PADDING_LEFT:Number = 10;\n\t\tprivate static const GAP:Number = 5;\n\t\tprivate static const CHILD1_WIDTH:Number = 200;\n\t\tprivate static const CHILD1_HEIGHT:Number = 100;\n\t\tprivate static const CHILD2_WIDTH:Number = 150;\n\t\tprivate static const CHILD2_HEIGHT:Number = 75;\n\t\tprivate static const CHILD3_WIDTH:Number = 75;\n\t\tprivate static const CHILD3_HEIGHT:Number = 50;\n\t\t\n\t\tprivate var _layout:TiledRowsLayout;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._layout = new TiledRowsLayout();\n\t\t\tthis._layout.useVirtualLayout = false;\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._layout = null;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithNoItems():void\n\t\t{\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult viewPortWidth not equal to 0 with no items.\", 0, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult viewPortHeight not equal to 0 with no items.\", 0, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentWidth not equal to 0 with no items.\", 0, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentHeight not equal to 0 with no items.\", 0, result.contentHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentX not equal to 0 with no items.\", 0, result.contentX);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentY not equal to 0 with no items.\", 0, result.contentY);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithNoItems():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(0, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout measureViewPort width not equal to 0 with no items.\", 0, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout measureViewPort height not equal to 0 with no items.\", 0, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithPaddingGapAndNoItems():void\n\t\t{\n\t\t\tthis._layout.paddingTop = PADDING_TOP;\n\t\t\tthis._layout.paddingRight = PADDING_RIGHT;\n\t\t\tthis._layout.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._layout.paddingLeft = PADDING_LEFT;\n\t\t\tthis._layout.gap = GAP;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult viewPortWidth not equal to sum of left and right padding with no items.\", PADDING_LEFT + PADDING_RIGHT, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult viewPortHeight not equal to sum of top and bottom padding with no items.\", PADDING_TOP + PADDING_BOTTOM, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentWidth not equal to sum of left and right padding with no items.\", PADDING_LEFT + PADDING_RIGHT, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentHeight not equal to sum of top and bottom padding with no items.\", PADDING_TOP + PADDING_BOTTOM, result.contentHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentX not equal to 0 with padding and no items.\", 0, result.contentX);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentY not equal to 0 with padding and no items.\", 0, result.contentY);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithPaddingGapAndNoItems():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.paddingTop = PADDING_TOP;\n\t\t\tthis._layout.paddingRight = PADDING_RIGHT;\n\t\t\tthis._layout.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._layout.paddingLeft = PADDING_LEFT;\n\t\t\tthis._layout.gap = GAP;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(0, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout measureViewPort x not equal to sum of left and right padding with no items.\", PADDING_LEFT + PADDING_RIGHT, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout measureViewPort y not equal to sum of top and bottom padding with no items.\", PADDING_TOP + PADDING_BOTTOM, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithOneChildAndSquareTiles():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tvar tileSize:Number = Math.max(CHILD1_WIDTH, CHILD1_HEIGHT);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult viewPortWidth not equal to max child dimension with square tiles and one item.\", tileSize, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult viewPortHeight not equal to max child dimension with square tiles and one item.\", tileSize, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentWidth not equal to max child dimension with square tiles and one item.\", tileSize, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentHeight not equal to max child dimension with square tiles and one item.\", tileSize, result.contentHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentX not equal to 0 with one item and square tiles.\", 0, result.contentX);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentY not equal to 0 with one item and square tiles.\", 0, result.contentY);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithOneChildAndSquareTiles():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tvar tileSize:Number = Math.max(CHILD1_WIDTH, CHILD1_HEIGHT);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout measureViewPort x not equal to max child dimension with square tiles and one item.\", tileSize, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout measureViewPort y not equal to max child dimension with square tiles and one item.\", tileSize, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithOneChildAndNotSquareTiles():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult viewPortWidth not equal to child width with non-square tiles and one item.\", CHILD1_WIDTH, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult viewPortHeight not equal to child height with non-square tiles and one item.\", CHILD1_HEIGHT, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentWidth not equal to child width with non-square tiles and one item.\", CHILD1_WIDTH, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentHeight not equal to child height with non-square tiles and one item.\", CHILD1_HEIGHT, result.contentHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentX not equal to 0 with one item and non-square tiles.\", 0, result.contentX);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentY not equal to 0 with one item and non-square tiles.\", 0, result.contentY);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithOneChildAndNotSquareTiles():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout measureViewPort x not equal to child width with non-square tiles and one item.\", CHILD1_WIDTH, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout measureViewPort y not equal to child height with non-square tiles and one item.\", CHILD1_HEIGHT, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithPaddingGapAndOneChild():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.paddingTop = PADDING_TOP;\n\t\t\tthis._layout.paddingRight = PADDING_RIGHT;\n\t\t\tthis._layout.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._layout.paddingLeft = PADDING_LEFT;\n\t\t\tthis._layout.gap = GAP;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult viewPortWidth not equal to sum of left and right padding and width of child.\", CHILD1_WIDTH + PADDING_LEFT + PADDING_RIGHT, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult viewPortHeight not equal to sum of top and bottom padding and height of child.\", CHILD1_HEIGHT + PADDING_TOP + PADDING_BOTTOM, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentWidth not equal to sum of left and right padding and width of child.\", CHILD1_WIDTH + PADDING_LEFT + PADDING_RIGHT, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentHeight not equal to sum of top and bottom padding and height of child.\", CHILD1_HEIGHT + PADDING_TOP + PADDING_BOTTOM, result.contentHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentX not equal to 0 with one item and padding.\", 0, result.contentX);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentY not equal to 0 with one item and padding.\", 0, result.contentY);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithPaddingGapAndOneChild():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.paddingTop = PADDING_TOP;\n\t\t\tthis._layout.paddingRight = PADDING_RIGHT;\n\t\t\tthis._layout.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._layout.paddingLeft = PADDING_LEFT;\n\t\t\tthis._layout.gap = GAP;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout measureViewPort x not equal to sum of left and right padding and width of child.\", CHILD1_WIDTH + PADDING_LEFT + PADDING_RIGHT, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout measureViewPort y not equal to sum of top and bottom padding and height of child.\", CHILD1_HEIGHT + PADDING_TOP + PADDING_BOTTOM, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithTwoChildren():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar item2:Quad = new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tvar maxChildWidth:Number = Math.max(CHILD1_WIDTH, CHILD2_WIDTH);\n\t\t\tvar maxChildHeight:Number = Math.max(CHILD1_HEIGHT, CHILD2_HEIGHT);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult viewPortWidth not equal to sum of tile widths.\", 2 * maxChildWidth, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult viewPortHeight not equal to max height of items.\", maxChildHeight, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentWidth not equal to sum of tile widths.\", 2 * maxChildWidth, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentHeight not equal to max height of items.\", maxChildHeight, result.contentHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentX not equal to 0 with padding and two items.\", 0, result.contentX);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentY not equal to 0 with padding and two items.\", 0, result.contentY);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithTwoChildren():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(2, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout measureViewPort x not equal to typical item width multiplied by the number of items.\", 2 * CHILD1_WIDTH, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout measureViewPort y not equal to height of typical item.\", CHILD1_HEIGHT, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithPaddingGapAndTwoChildren():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.paddingTop = PADDING_TOP;\n\t\t\tthis._layout.paddingRight = PADDING_RIGHT;\n\t\t\tthis._layout.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._layout.paddingLeft = PADDING_LEFT;\n\t\t\tthis._layout.gap = GAP;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar item2:Quad = new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tvar maxChildWidth:Number = Math.max(CHILD1_WIDTH, CHILD2_WIDTH);\n\t\t\tvar maxChildHeight:Number = Math.max(CHILD1_HEIGHT, CHILD2_HEIGHT);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult viewPortWidth not equal to sum of tile widths plus left and right padding and gap.\", 2 * maxChildWidth + PADDING_LEFT + PADDING_RIGHT + GAP, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult viewPortHeight not equal to max height of items plus top and bottom padding.\", maxChildHeight + PADDING_TOP + PADDING_BOTTOM, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentWidth not equal to sum of tile widths plus left and right padding and gap.\", 2 * maxChildWidth + PADDING_LEFT + PADDING_RIGHT + GAP, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentHeight not equal to max height of items plus top and bottom padding.\", maxChildHeight + PADDING_TOP + PADDING_BOTTOM, result.contentHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentX not equal to 0 with two items plus padding and gap.\", 0, result.contentX);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentY not equal to 0 with two items plus padding and gap.\", 0, result.contentY);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithPaddingGapAndTwoChildren():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.paddingTop = PADDING_TOP;\n\t\t\tthis._layout.paddingRight = PADDING_RIGHT;\n\t\t\tthis._layout.paddingBottom = PADDING_BOTTOM;\n\t\t\tthis._layout.paddingLeft = PADDING_LEFT;\n\t\t\tthis._layout.gap = GAP;\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(2, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout measureViewPort x not equal to sum of tile widths plus left and right padding and gap.\", 2 * CHILD1_WIDTH + PADDING_LEFT + PADDING_RIGHT + GAP, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout measureViewPort y not equal to max height of items plus top and bottom padding.\", CHILD1_HEIGHT + PADDING_TOP + PADDING_BOTTOM, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithRequestedColumnCountLargerThanItemCount():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.requestedColumnCount = 2;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult viewPortWidth not equal to tile width multiplied by requestedColumnCount larger than item count.\", 2 * CHILD1_WIDTH, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult viewPortHeight not equal to max height of items with requestedColumnCount larger than item count.\", CHILD1_HEIGHT, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentWidth not equal to tile width multiplied by requestedColumnCount larger than item count.\", 2 * CHILD1_WIDTH, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentHeight not equal to max height of items with requestedColumnCount larger than item count.\", CHILD1_HEIGHT, result.contentHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentX not equal to 0 with requestedColumnCount larger than item count.\", 0, result.contentX);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentY not equal to 0 with requestedColumnCount larger than item count.\", 0, result.contentY);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithRequestedColumnCountLargerThanItemCount():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.requestedColumnCount = 2;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout measureViewPort x not equal to tile width multiplied by requestedColumnCount larger than item count.\", 2 * CHILD1_WIDTH, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout measureViewPort y not equal to max height of items with requestedColumnCount larger than item count.\", CHILD1_HEIGHT, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithRequestedColumnCountSmallerThanItemCount():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.requestedColumnCount = 2;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar item2:Quad = new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff);\n\t\t\tvar item3:Quad = new Quad(CHILD3_WIDTH, CHILD3_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2, item3];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tvar maxChildWidth:Number = Math.max(CHILD1_WIDTH, CHILD2_WIDTH, CHILD3_WIDTH);\n\t\t\tvar maxChildHeight:Number = Math.max(CHILD1_HEIGHT, CHILD2_HEIGHT, CHILD3_HEIGHT);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult viewPortWidth not equal to tile width multiplied by requestedColumnCount smaller than item count.\", 2 * maxChildWidth, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult viewPortHeight not equal to max height of items multiplied by row count with requestedColumnCount smaller than item count.\", 2 * maxChildHeight, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentWidth not equal to tile width multiplied by requestedColumnCount smaller than item count.\", 2 * maxChildWidth, result.contentWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentHeight not equal to max height of items  multiplied by row countwith requestedColumnCount smaller than item count.\", 2 * maxChildHeight, result.contentHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentX not equal to 0 with requestedRowCount smaller than item count.\", 0, result.contentX);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentY not equal to 0 with requestedRowCount smaller than item count.\", 0, result.contentY);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithRequestedColumnCountSmallerThanItemCount():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.requestedColumnCount = 2;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:Point = this._layout.measureViewPort(3, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout measureViewPort x not equal to tile width multiplied by requestedColumnCount smaller than item count.\", 2 * CHILD1_WIDTH, result.x);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout measureViewPort y not equal to max height of items with requestedColumnCount smaller than item count.\", 2 * CHILD1_HEIGHT, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithExplicitWidthSmallerThanChild():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = CHILD1_WIDTH / 3;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult viewPortWidth not equal to explicitWidth when explicitWidth is smaller than item width.\", bounds.explicitWidth, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentWidth not equal to item width when explicitWidth is smaller than item width.\", CHILD1_WIDTH, result.contentWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithExplicitWidthSmallerThanChild():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = CHILD1_WIDTH / 3;\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout measureViewPort x not equal to explicitWidth when explicitWidth is smaller than item width.\", bounds.explicitWidth, result.x);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithExplicitWidthLargerThanChild():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 3 * CHILD1_WIDTH;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult viewPortWidth not equal to explicitWidth when explicitWidth is larger than item width.\", bounds.explicitWidth, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentWidth not equal to item width when explicitWidth is larger than item width.\", CHILD1_WIDTH, result.contentWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithExplicitWidthLargerThanChild():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 3 * CHILD1_WIDTH;\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout measureViewPort x not equal to explicitWidth when explicitWidth is larger than item width.\", bounds.explicitWidth, result.x);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithMaxWidthSmallerThanChild():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.maxWidth = CHILD1_WIDTH / 3;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult viewPortWidth not equal to maxWidth when maxWidth is smaller than item width.\", bounds.maxWidth, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentWidth not equal to item width when maxWidth is smaller than item width.\", CHILD1_WIDTH, result.contentWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithMaxWidthSmallerThanChild():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.maxWidth = CHILD1_WIDTH / 3;\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout measureViewPort x not equal to maxWidth when maxWidth is smaller than item width.\", bounds.maxWidth, result.x);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithMinWidthLargerThanChild():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.minWidth = 3 * CHILD1_WIDTH;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult viewPortWidth not equal to minWidth when minWidth is larger than item width.\", bounds.minWidth, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentWidth not equal to item width when minWidth is larger than item width.\", CHILD1_WIDTH, result.contentWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithMinWidthLargerThanChild():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.minWidth = 3 * CHILD1_WIDTH;\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout measureViewPort x not equal to minWidth when minWidth is larger than item width.\", bounds.minWidth, result.x);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithMaxWidthLargerThanChild():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\t//needs to be enough to require more than one tile\n\t\t\tbounds.maxWidth = 3 * CHILD1_WIDTH;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult viewPortWidth not equal to item width when maxWidth is larger than item width.\", CHILD1_WIDTH, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentWidth not equal to item width when maxWidth is larger than item width.\", CHILD1_WIDTH, result.contentWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithMaxWidthLargerThanChild():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\t//needs to be enough to require more than one tile\n\t\t\tbounds.maxWidth = 3 * CHILD1_WIDTH;\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout measureViewPort x not equal to item width when maxWidth is larger than item width.\", CHILD1_WIDTH, result.x);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithMaxHeightSmallerThanChild():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.maxHeight = CHILD1_HEIGHT / 3;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult viewPortHeight not equal to maxHeight when maxHeight is smaller than child height.\", bounds.maxHeight, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentHeight not equal to item height when maxHeight is smaller than child height.\", CHILD1_HEIGHT, result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithMaxHeightSmallerThanChild():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.maxHeight = CHILD1_HEIGHT / 3;\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout measureViewPort y not equal to maxHeight when maxHeight is smaller than child height.\", bounds.maxHeight, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithMaxHeightLargerThanChild():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\t//needs to be enough to require more than one tile\n\t\t\tbounds.maxHeight = 3 * CHILD1_HEIGHT;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult viewPortHeight not equal to child height when maxHeight is larger than child height.\", CHILD1_HEIGHT, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentHeight not equal to child height when maxHeight is larger than child height.\", CHILD1_HEIGHT, result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithMaxHeightLargerThanChild():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\t//needs to be enough to require more than one tile\n\t\t\tbounds.maxHeight = 3 * CHILD1_HEIGHT;\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout measureViewPort y not equal to child height when maxHeight is larger than child height.\", CHILD1_HEIGHT, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithMaxWidthLargerThanRequestedColumnCountLargerThanItemCount():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.requestedColumnCount = 2;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.maxWidth = 3 * CHILD1_WIDTH;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult viewPortWidth not correct when maxWidth larger than requestedColumnCount and requestedColumnCount larger than item count.\", 2 * CHILD1_WIDTH, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentWidth not correct when maxWidth larger than requestedColumnCount and requestedColumnCount larger than item count.\", 2 * CHILD1_WIDTH, result.contentWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithMaxWidthLargerThanRequestedColumnCountLargerThanItemCount():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.requestedColumnCount = 2;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.maxWidth = 3 * CHILD1_WIDTH;\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout measureViewPort x not correct when maxWidth larger than requestedColumnCount and requestedColumnCount larger than item count.\", 2 * CHILD1_WIDTH, result.x);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLayoutResultWithMaxHeightLargerThanRequestedRowCountLargerThanItemCount():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.requestedRowCount = 2;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.maxHeight = 3 * CHILD1_HEIGHT;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult viewPortHeight not correct when maxHeight larger than requestedRowCount and requestedRowCount larger than item count.\", 2 * CHILD1_HEIGHT, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout layout LayoutBoundsResult contentHeight not correct when maxHeight larger than requestedRowCount and requestedRowCount larger than item count.\", 2 * CHILD1_HEIGHT, result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMeasureViewPortResultWithMaxHeightLargerThanRequestedRowCountLargerThanItemCount():void\n\t\t{\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.requestedRowCount = 2;\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.maxHeight = 3 * CHILD1_HEIGHT;\n\t\t\tvar result:Point = this._layout.measureViewPort(1, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout measureViewPort y not correct when maxHeight larger than requestedRowCount and requestedRowCount larger than item count.\", 2 * CHILD1_HEIGHT, result.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testItemXWithExplicitWidthRequestedColumnCountAndHorizontalAlignRight():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.requestedColumnCount = 2;\n\t\t\tthis._layout.horizontalAlign = HorizontalAlign.RIGHT;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 3 * CHILD1_WIDTH;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout x position of first child not correct with explicit width larger than requestedColumnCount.\", CHILD1_WIDTH, item1.x);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testItemYWithExplicitHeightRequestedRowCountAndVerticalAlignBottom():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.requestedRowCount = 2;\n\t\t\tthis._layout.verticalAlign = VerticalAlign.BOTTOM;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitHeight = 3 * CHILD1_HEIGHT;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout y position of first child not correct with explicit height larger than requestedRowCount.\", CHILD1_HEIGHT, item1.y);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTileWidthWithDistributeWidths():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.distributeWidths = true;\n\t\t\tthis._layout.tileHorizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 3 * CHILD1_WIDTH;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout width of tile not correct with distributeWidths.\",\n\t\t\t\t3 * CHILD1_WIDTH, item1.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTileWidthWithDistributeWidthsAndRequestedColumnCount():void\n\t\t{\n\t\t\tvar requestedColumnCount:int = 3;\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.distributeWidths = true;\n\t\t\tthis._layout.requestedColumnCount = requestedColumnCount;\n\t\t\tthis._layout.tileHorizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 2 * CHILD1_WIDTH;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout width of tile not correct with distributeWidths and requestedColumnCount.\",\n\t\t\t\t2 * CHILD1_WIDTH / requestedColumnCount, item1.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testThreeTileWidthWithDistributeWidthsAndNoExplicitWidth():void\n\t\t{\n\t\t\t//distributeWidths should essentially do nothing in this case\n\t\t\t//because the view port width needs to be calculated\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.distributeWidths = true;\n\t\t\tthis._layout.tileHorizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar item2:Quad = new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff);\n\t\t\tvar item3:Quad = new Quad(CHILD3_WIDTH, CHILD3_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2, item3];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tvar tileWidth:Number = Math.max(CHILD1_WIDTH, CHILD2_WIDTH, CHILD3_WIDTH);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout width of first tile not correct with distributeWidths and no explicit width.\",\n\t\t\t\ttileWidth, item1.width);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout width of second tile not correct with distributeWidths and no explicit width.\",\n\t\t\t\ttileWidth, item2.width);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout width of third tile not correct with distributeWidths and no explicit width.\",\n\t\t\t\ttileWidth, item3.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTileHeightWithDistributeWidthsAndUseSquareTiles():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = true;\n\t\t\tthis._layout.distributeWidths = true;\n\t\t\tthis._layout.tileHorizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\tthis._layout.tileVerticalAlign = VerticalAlign.JUSTIFY;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 3 * CHILD1_WIDTH;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout height of tile not correct with distributeWidths and useSquareTiles.\",\n\t\t\t\t3 * CHILD1_WIDTH, item1.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTwoTilesWidthWithDistributeWidths():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.distributeWidths = true;\n\t\t\tthis._layout.tileHorizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar item2:Quad = new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 3 * CHILD1_WIDTH;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout width of first tile not correct with distributeWidths.\",\n\t\t\t\t3 * CHILD1_WIDTH / 2, item1.width);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout width of second tile not correct with distributeWidths.\",\n\t\t\t\t3 * CHILD1_WIDTH / 2, item2.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTwoTilesWidthWithDistributeWidthsAndRequestedColumnCount():void\n\t\t{\n\t\t\tthis._layout.useSquareTiles = false;\n\t\t\tthis._layout.distributeWidths = true;\n\t\t\tthis._layout.requestedColumnCount = 2;\n\t\t\tthis._layout.tileHorizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\tvar item1:Quad = new Quad(CHILD1_WIDTH, CHILD1_HEIGHT, 0xff00ff);\n\t\t\tvar item2:Quad = new Quad(CHILD2_WIDTH, CHILD2_HEIGHT, 0xff00ff);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = CHILD1_WIDTH / 2;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout width of first tile not correct with distributeWidths and requestedColumnCount.\",\n\t\t\t\tCHILD1_WIDTH / 4, item1.width);\n\t\t\tAssert.assertStrictlyEquals(\"TiledRowsLayout width of second tile not correct with ddistributeWidths and requestedColumnCount.\",\n\t\t\t\tCHILD1_WIDTH / 4, item2.width);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/TimeLabelTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.media.MediaTimeMode;\n\timport feathers.media.TimeLabel;\n\timport feathers.tests.supportClasses.CustomMediaPlayer;\n\n\timport org.flexunit.Assert;\n\n\tpublic class TimeLabelTests\n\t{\n\t\tprivate static const CURRENT_TIME:int = 3737;\n\t\tprivate static const TOTAL_TIME:int = 5254;\n\t\t\n\t\tprivate var _label:TimeLabel;\n\t\tprivate var _mediaPlayer:CustomMediaPlayer;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._mediaPlayer = new CustomMediaPlayer(TOTAL_TIME);\n\t\t\t\n\t\t\tthis._label = new TimeLabel();\n\t\t\tthis._label.mediaPlayer = this._mediaPlayer;\n\t\t\tTestFeathers.starlingRoot.addChild(this._label);\n\t\t\tthis._label.validate();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._label.removeFromParent(true);\n\t\t\tthis._label = null;\n\t\t\t\n\t\t\tthis._mediaPlayer.removeEventListeners();\n\t\t\tthis._mediaPlayer = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\t/**\n\t\t * Issue #1325\n\t\t */\n\t\tpublic function testTotalTimeText():void\n\t\t{\n\t\t\tthis._label.displayMode = MediaTimeMode.TOTAL_TIME;\n\t\t\tthis._label.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TimeLabel total time not displayed correctly\", \"1:27:34\", this._label.text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTimeText():void\n\t\t{\n\t\t\tthis._label.displayMode = MediaTimeMode.CURRENT_TIME;\n\t\t\tthis._mediaPlayer.seek(CURRENT_TIME);\n\t\t\tthis._label.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TimeLabel total time not displayed correctly\", \"1:02:17\", this._label.text);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentTimeAndTotalTimeText():void\n\t\t{\n\t\t\tthis._label.displayMode = MediaTimeMode.CURRENT_AND_TOTAL_TIMES;\n\t\t\tthis._mediaPlayer.seek(CURRENT_TIME);\n\t\t\tthis._label.validate();\n\t\t\tAssert.assertStrictlyEquals(\"TimeLabel total time not displayed correctly\", \"1:02:17 / 1:27:34\", this._label.text);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ToggleButtonFocusTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.ToggleButton;\n\timport feathers.core.FocusManager;\n\n\timport flash.ui.Keyboard;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.KeyboardEvent;\n\n\tpublic class ToggleButtonFocusTests\n\t{\n\t\tprivate var _target:ToggleButton;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._target = new ToggleButton();\n\t\t\tthis._target.defaultSkin = new Quad(200, 200, 0xff00ff);\n\t\t\tTestFeathers.starlingRoot.addChild(this._target);\n\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, true);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._target.removeFromParent(true);\n\t\t\tthis._target = null;\n\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, false);\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t\tAssert.assertFalse(\"FocusManager not disabled on cleanup.\", FocusManager.isEnabledForStage(TestFeathers.starlingRoot.stage));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testIgnoreKeyAfterFocusOut():void\n\t\t{\n\t\t\tthis._target.isSelected = false;\n\t\t\tFocusManager.focus = this._target;\n\t\t\tFocusManager.focus = null;\n\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._target.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, 0, Keyboard.SPACE));\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, 0, Keyboard.SPACE));\n\t\t\tAssert.assertFalse(\"Event.CHANGE was incorrectly dispatched\", hasChanged);\n\t\t\tAssert.assertFalse(\"isSelected was incorrectly changed to true after key to select when not in focus\", this._target.isSelected);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChangeEvent():void\n\t\t{\n\t\t\tthis._target.isSelected = false;\n\t\t\tFocusManager.focus = this._target;\n\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._target.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, 0, Keyboard.SPACE));\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, 0, Keyboard.SPACE));\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"isSelected was not changed to true after key to select\", this._target.isSelected);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDisabled():void\n\t\t{\n\t\t\tthis._target.isSelected = false;\n\t\t\tthis._target.isEnabled = false;\n\t\t\tthis._target.validate();\n\t\t\tFocusManager.focus = this._target;\n\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._target.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, 0, Keyboard.SPACE));\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, 0, Keyboard.SPACE));\n\t\t\tAssert.assertFalse(\"Event.CHANGE was incorrectly dispatched when disabled\", hasChanged);\n\t\t\tAssert.assertFalse(\"isSelected was incorrectly changed to true after key to select when disabled\", this._target.isSelected);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCancelKeyBeforeChangeEvent():void\n\t\t{\n\t\t\tthis._target.isSelected = false;\n\t\t\tFocusManager.focus = this._target;\n\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._target.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, 0, Keyboard.SPACE));\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, 0, Keyboard.ESCAPE));\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, 0, Keyboard.ESCAPE));\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, 0, Keyboard.SPACE));\n\t\t\tAssert.assertFalse(\"Event.CHANGE was incorrectly dispatched after cancel key\", hasChanged);\n\t\t\tAssert.assertFalse(\"isSelected was incorrectly changed to true after cancel key\", this._target.isSelected);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDeselect():void\n\t\t{\n\t\t\tthis._target.isSelected = true;\n\t\t\tthis._target.validate();\n\t\t\tFocusManager.focus = this._target;\n\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, 0, Keyboard.SPACE));\n\t\t\tthis._target.stage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, 0, Keyboard.SPACE));\n\t\t\tAssert.assertFalse(\"isSelected was not changed to false when deselected with keyboard\", this._target.isSelected);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ToggleButtonInternalStateTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.ButtonState;\n\n\timport flash.geom.Point;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\tpublic class ToggleButtonInternalStateTests\n\t{\n\t\tprivate var _button:ToggleButtonWithInternalState;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._button = new ToggleButtonWithInternalState();\n\t\t\tTestFeathers.starlingRoot.addChild(this._button);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._button.removeFromParent(true);\n\t\t\tthis._button = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetSkinForStateWithoutSetSkinForState():void\n\t\t{\n\t\t\tAssert.assertNull(\"ToggleButton getSkinForState(ButtonState.UP) must be null when setSkinForState() is not called\", this._button.getSkinForState(ButtonState.UP));\n\t\t\tAssert.assertNull(\"ToggleButton getSkinForState(ButtonState.HOVER) must be null when setSkinForState() is not called\", this._button.getSkinForState(ButtonState.HOVER));\n\t\t\tAssert.assertNull(\"ToggleButton getSkinForState(ButtonState.DOWN) must be null when setSkinForState() is not called\", this._button.getSkinForState(ButtonState.DOWN));\n\t\t\tAssert.assertNull(\"ToggleButton getSkinForState(ButtonState.DISABLED) must be null when setSkinForState() is not called\", this._button.getSkinForState(ButtonState.DISABLED));\n\t\t\tAssert.assertNull(\"ToggleButton getSkinForState(ButtonState.UP_AND_SELECTED) must be null when setSkinForState() is not called\", this._button.getSkinForState(ButtonState.UP_AND_SELECTED));\n\t\t\tAssert.assertNull(\"ToggleButton getSkinForState(ButtonState.HOVER_AND_SELECTED) must be null when setSkinForState() is not called\", this._button.getSkinForState(ButtonState.HOVER_AND_SELECTED));\n\t\t\tAssert.assertNull(\"ToggleButton getSkinForState(ButtonState.DOWN_AND_SELECTED) must be null when setSkinForState() is not called\", this._button.getSkinForState(ButtonState.DOWN_AND_SELECTED));\n\t\t\tAssert.assertNull(\"ToggleButton getSkinForState(ButtonState.DISABLED_AND_SELECTED) must be null when setSkinForState() is not called\", this._button.getSkinForState(ButtonState.DISABLED_AND_SELECTED));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetSkinForState():void\n\t\t{\n\t\t\tvar defaultSkin:Quad = new Quad(200, 200);\n\t\t\tthis._button.defaultSkin = defaultSkin;\n\n\t\t\tvar upSkin:Quad = new Quad(200, 200);\n\t\t\tthis._button.setSkinForState(ButtonState.UP, upSkin);\n\n\t\t\tvar hoverSkin:Quad = new Quad(200, 200);\n\t\t\tthis._button.setSkinForState(ButtonState.HOVER, hoverSkin);\n\n\t\t\tvar downSkin:Quad = new Quad(200, 200);\n\t\t\tthis._button.setSkinForState(ButtonState.DOWN, downSkin);\n\n\t\t\tvar disabledSkin:Quad = new Quad(200, 200);\n\t\t\tthis._button.setSkinForState(ButtonState.DISABLED, disabledSkin);\n\n\t\t\tvar defaultSelectedSkin:Quad = new Quad(200, 200);\n\t\t\tthis._button.defaultSkin = defaultSelectedSkin;\n\n\t\t\tvar selectedUpSkin:Quad = new Quad(200, 200);\n\t\t\tthis._button.setSkinForState(ButtonState.UP_AND_SELECTED, selectedUpSkin);\n\n\t\t\tvar selectedHoverSkin:Quad = new Quad(200, 200);\n\t\t\tthis._button.setSkinForState(ButtonState.HOVER_AND_SELECTED, selectedHoverSkin);\n\n\t\t\tvar selectedDownSkin:Quad = new Quad(200, 200);\n\t\t\tthis._button.setSkinForState(ButtonState.DOWN_AND_SELECTED, selectedDownSkin);\n\n\t\t\tvar selectedDisabledSkin:Quad = new Quad(200, 200);\n\t\t\tthis._button.setSkinForState(ButtonState.DISABLED_AND_SELECTED, selectedDisabledSkin);\n\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton getSkinForState(ButtonState.UP) does not match value passed to setSkinForState()\", upSkin, this._button.getSkinForState(ButtonState.UP));\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton getSkinForState(ButtonState.HOVER) does not match value passed to setSkinForState()\", hoverSkin, this._button.getSkinForState(ButtonState.HOVER));\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton getSkinForState(ButtonState.DOWN) does not match value passed to setSkinForState()\", downSkin, this._button.getSkinForState(ButtonState.DOWN));\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton getSkinForState(ButtonState.DISABLED) does not match value passed to setSkinForState()\", disabledSkin, this._button.getSkinForState(ButtonState.DISABLED));\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton getSkinForState(ButtonState.UP_AND_SELECTED) does not match value passed to setSkinForState()\", selectedUpSkin, this._button.getSkinForState(ButtonState.UP_AND_SELECTED));\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton getSkinForState(ButtonState.HOVER_AND_SELECTED) does not match value passed to setSkinForState()\", selectedHoverSkin, this._button.getSkinForState(ButtonState.HOVER_AND_SELECTED));\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton getSkinForState(ButtonState.DOWN_AND_SELECTED) does not match value passed to setSkinForState()\", selectedDownSkin, this._button.getSkinForState(ButtonState.DOWN_AND_SELECTED));\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton getSkinForState(ButtonState.DISABLED_AND_SELECTED) does not match value passed to setSkinForState()\", selectedDisabledSkin, this._button.getSkinForState(ButtonState.DISABLED_AND_SELECTED));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDefaultCurrentSkin():void\n\t\t{\n\t\t\tthis._button.isSelected = true;\n\n\t\t\tvar defaultSelectedSkin:Quad = new Quad(200, 200);\n\t\t\tthis._button.defaultSelectedSkin = defaultSelectedSkin;\n\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton state is not ButtonState.UP_AND_SELECTED with no touch and isSelected is true\", ButtonState.UP_AND_SELECTED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton skin is not defaultSkin when currentState is ButtonState.UP_AND_SELECTED and skin not provided for this state\", defaultSelectedSkin, this._button.currentSkinInternal);\n\n\t\t\tthis._button.isEnabled = false;\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton state is not ButtonState.DISABLED_AND_SELECTED when isEnabled is false and isSelected is true\", ButtonState.DISABLED_AND_SELECTED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton skin is not defaultSkin when currentState is ButtonState.DISABLED_AND_SELECTED and skin not provided for this state\", defaultSelectedSkin, this._button.currentSkinInternal);\n\n\t\t\tthis._button.isEnabled = true;\n\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tAssert.assertStrictlyEquals(\"Touch target must be button\", this._button, target);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.HOVER;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton state is not ButtonState.HOVER_AND_SELECTED on TouchPhase.HOVER and isSelected is true\", ButtonState.HOVER_AND_SELECTED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton skin is not defaultSkin when currentState is ButtonState.HOVER and skin not provided for this state\", defaultSelectedSkin, this._button.currentSkinInternal);\n\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton state is not ButtonState.DOWN_AND_SELECTED on TouchPhase.BEGAN and isSelected is true\", ButtonState.DOWN_AND_SELECTED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton skin is not defaultSkin when currentState is ButtonState.DOWN and skin not provided for this state\", defaultSelectedSkin, this._button.currentSkinInternal);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentSkinWithSetSkinForState():void\n\t\t{\n\t\t\tthis._button.isSelected = true;\n\n\t\t\tvar defaultSelectedSkin:Quad = new Quad(200, 200);\n\t\t\tthis._button.defaultSkin = defaultSelectedSkin;\n\n\t\t\tvar selectedUpSkin:Quad = new Quad(200, 200);\n\t\t\tthis._button.setSkinForState(ButtonState.UP_AND_SELECTED, selectedUpSkin);\n\n\t\t\tvar selectedHoverSkin:Quad = new Quad(200, 200);\n\t\t\tthis._button.setSkinForState(ButtonState.HOVER_AND_SELECTED, selectedHoverSkin);\n\n\t\t\tvar selectedDownSkin:Quad = new Quad(200, 200);\n\t\t\tthis._button.setSkinForState(ButtonState.DOWN_AND_SELECTED, selectedDownSkin);\n\n\t\t\tvar selectedDisabledSkin:Quad = new Quad(200, 200);\n\t\t\tthis._button.setSkinForState(ButtonState.DISABLED_AND_SELECTED, selectedDisabledSkin);\n\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton state is not ButtonState.UP_AND_SELECTED with no touch and isSelected is true\", ButtonState.UP_AND_SELECTED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton skin does not match skin set with setSkinForState() when currentState is ButtonState.UP_AND_SELECTED\", selectedUpSkin, this._button.currentSkinInternal);\n\n\t\t\tthis._button.isEnabled = false;\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton state is not ButtonState.DISABLED_AND_SELECTED when isEnabled is false and isSelected is true\", ButtonState.DISABLED_AND_SELECTED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton skin does not match skin set with setSkinForState() when currentState is ButtonState.DISABLED_AND_SELECTED\", selectedDisabledSkin, this._button.currentSkinInternal);\n\n\t\t\tthis._button.isEnabled = true;\n\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tAssert.assertStrictlyEquals(\"Touch target must be button\", this._button, target);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.HOVER;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton state is not ButtonState.HOVER_AND_SELECTED on TouchPhase.HOVER and isSelected is true\", ButtonState.HOVER_AND_SELECTED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton skin does not match skin set with setSkinForState() when currentState is ButtonState.HOVER_AND_SELECTED and skin not provided for this state\", selectedHoverSkin, this._button.currentSkinInternal);\n\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton state is not ButtonState.DOWN_AND_SELECTED on TouchPhase.BEGAN and isSelected is true\", ButtonState.DOWN_AND_SELECTED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton skin does not match skin set with setSkinForState() when currentState is ButtonState.DOWN_AND_SELECTED and skin not provided for this state\", selectedDownSkin, this._button.currentSkinInternal);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetIconForStateWithoutSetIconForState():void\n\t\t{\n\t\t\tAssert.assertNull(\"ToggleButton getIconForState(ButtonState.UP) must be null when setIconForState() is not called\", this._button.getIconForState(ButtonState.UP));\n\t\t\tAssert.assertNull(\"ToggleButton getIconForState(ButtonState.HOVER) must be null when setIconForState() is not called\", this._button.getIconForState(ButtonState.HOVER));\n\t\t\tAssert.assertNull(\"ToggleButton getIconForState(ButtonState.DOWN) must be null when setIconForState() is not called\", this._button.getIconForState(ButtonState.DOWN));\n\t\t\tAssert.assertNull(\"ToggleButton getIconForState(ButtonState.DISABLED) must be null when setIconForState() is not called\", this._button.getIconForState(ButtonState.DISABLED));\n\t\t\tAssert.assertNull(\"ToggleButton getIconForState(ButtonState.UP_AND_SELECTED) must be null when setIconForState() is not called\", this._button.getIconForState(ButtonState.UP_AND_SELECTED));\n\t\t\tAssert.assertNull(\"ToggleButton getIconForState(ButtonState.HOVER_AND_SELECTED) must be null when setIconForState() is not called\", this._button.getIconForState(ButtonState.HOVER_AND_SELECTED));\n\t\t\tAssert.assertNull(\"ToggleButton getIconForState(ButtonState.DOWN_AND_SELECTED) must be null when setIconForState() is not called\", this._button.getIconForState(ButtonState.DOWN_AND_SELECTED));\n\t\t\tAssert.assertNull(\"ToggleButton getIconForState(ButtonState.DISABLED_AND_SELECTED) must be null when setIconForState() is not called\", this._button.getIconForState(ButtonState.DISABLED_AND_SELECTED));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetIconForState():void\n\t\t{\n\t\t\tvar defaultIcon:Quad = new Quad(200, 200);\n\t\t\tthis._button.defaultIcon = defaultIcon;\n\n\t\t\tvar upIcon:Quad = new Quad(200, 200);\n\t\t\tthis._button.setIconForState(ButtonState.UP, upIcon);\n\n\t\t\tvar hoverIcon:Quad = new Quad(200, 200);\n\t\t\tthis._button.setIconForState(ButtonState.HOVER, hoverIcon);\n\n\t\t\tvar downIcon:Quad = new Quad(200, 200);\n\t\t\tthis._button.setIconForState(ButtonState.DOWN, downIcon);\n\n\t\t\tvar disabledIcon:Quad = new Quad(200, 200);\n\t\t\tthis._button.setIconForState(ButtonState.DISABLED, disabledIcon);\n\n\t\t\tvar defaultSelectedIcon:Quad = new Quad(200, 200);\n\t\t\tthis._button.defaultSelectedIcon = defaultSelectedIcon;\n\n\t\t\tvar selectedUpIcon:Quad = new Quad(200, 200);\n\t\t\tthis._button.setIconForState(ButtonState.UP_AND_SELECTED, selectedUpIcon);\n\n\t\t\tvar selectedHoverIcon:Quad = new Quad(200, 200);\n\t\t\tthis._button.setIconForState(ButtonState.HOVER_AND_SELECTED, selectedHoverIcon);\n\n\t\t\tvar selectedDownIcon:Quad = new Quad(200, 200);\n\t\t\tthis._button.setIconForState(ButtonState.DOWN_AND_SELECTED, selectedDownIcon);\n\n\t\t\tvar selectedDisabledIcon:Quad = new Quad(200, 200);\n\t\t\tthis._button.setIconForState(ButtonState.DISABLED_AND_SELECTED, selectedDisabledIcon);\n\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton getIconForState(ButtonState.UP) does not match value passed to setIconForState()\", upIcon, this._button.getIconForState(ButtonState.UP));\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton getIconForState(ButtonState.HOVER) does not match value passed to setIconForState()\", hoverIcon, this._button.getIconForState(ButtonState.HOVER));\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton getIconForState(ButtonState.DOWN) does not match value passed to setIconForState()\", downIcon, this._button.getIconForState(ButtonState.DOWN));\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton getIconForState(ButtonState.DISABLED) does not match value passed to setIconForState()\", disabledIcon, this._button.getIconForState(ButtonState.DISABLED));\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton getIconForState(ButtonState.UP_AND_SELECTED) does not match value passed to setIconForState()\", selectedUpIcon, this._button.getIconForState(ButtonState.UP_AND_SELECTED));\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton getIconForState(ButtonState.HOVER_AND_SELECTED) does not match value passed to setIconForState()\", selectedHoverIcon, this._button.getIconForState(ButtonState.HOVER_AND_SELECTED));\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton getIconForState(ButtonState.DOWN_AND_SELECTED) does not match value passed to setIconForState()\", selectedDownIcon, this._button.getIconForState(ButtonState.DOWN_AND_SELECTED));\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton getIconForState(ButtonState.DISABLED_AND_SELECTED) does not match value passed to setIconForState()\", selectedDisabledIcon, this._button.getIconForState(ButtonState.DISABLED_AND_SELECTED));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDefaultCurrentIcon():void\n\t\t{\n\t\t\tthis._button.isSelected = true;\n\n\t\t\tvar defaultSelectedIcon:Quad = new Quad(200, 200);\n\t\t\tthis._button.defaultSelectedIcon = defaultSelectedIcon;\n\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton state is not ButtonState.UP_AND_SELECTED with no touch and isSelected is true\", ButtonState.UP_AND_SELECTED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton icon is not defaultSelectedIcon when currentState is ButtonState.UP_AND_SELECTED and icon not provided for this state\", defaultSelectedIcon, this._button.currentIconInternal);\n\n\t\t\tthis._button.isEnabled = false;\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton state is not ButtonState.DISABLED_AND_SELECTED when isEnabled is false and isSelected is true\", ButtonState.DISABLED_AND_SELECTED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton icon is not defaultSelectedIcon when currentState is ButtonState.DISABLED_AND_SELECTED and icon not provided for this state\", defaultSelectedIcon, this._button.currentIconInternal);\n\n\t\t\tthis._button.isEnabled = true;\n\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tAssert.assertStrictlyEquals(\"Touch target must be button\", this._button, target);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.HOVER;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton state is not ButtonState.HOVER_AND_SELECTED on TouchPhase.HOVER and isSelected is true\", ButtonState.HOVER_AND_SELECTED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton icon is not defaultSelectedIcon when currentState is ButtonState.HOVER and icon not provided for this state\", defaultSelectedIcon, this._button.currentIconInternal);\n\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton state is not ButtonState.DOWN_AND_SELECTED on TouchPhase.BEGAN and isSelected is true\", ButtonState.DOWN_AND_SELECTED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton icon is not defaultSelectedIcon when currentState is ButtonState.DOWN and icon not provided for this state\", defaultSelectedIcon, this._button.currentIconInternal);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentIconWithSetIconForState():void\n\t\t{\n\t\t\tthis._button.isSelected = true;\n\t\t\t\n\t\t\tvar defaultSelectedIcon:Quad = new Quad(200, 200);\n\t\t\tthis._button.defaultSelectedIcon = defaultSelectedIcon;\n\n\t\t\tvar selectedUpIcon:Quad = new Quad(200, 200);\n\t\t\tthis._button.setIconForState(ButtonState.UP_AND_SELECTED, selectedUpIcon);\n\n\t\t\tvar selectedHoverIcon:Quad = new Quad(200, 200);\n\t\t\tthis._button.setIconForState(ButtonState.HOVER_AND_SELECTED, selectedHoverIcon);\n\n\t\t\tvar selectedDownIcon:Quad = new Quad(200, 200);\n\t\t\tthis._button.setIconForState(ButtonState.DOWN_AND_SELECTED, selectedDownIcon);\n\n\t\t\tvar selectedDisabledIcon:Quad = new Quad(200, 200);\n\t\t\tthis._button.setIconForState(ButtonState.DISABLED_AND_SELECTED, selectedDisabledIcon);\n\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton state is not ButtonState.UP_AND_SELECTED with no touch and isSelected is true\", ButtonState.UP_AND_SELECTED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton icon does not match icon set with setIconForState() when currentState is ButtonState.UP_AND_SELECTED\", selectedUpIcon, this._button.currentIconInternal);\n\n\t\t\tthis._button.isEnabled = false;\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton state is not ButtonState.DISABLED_AND_SELECTED when isEnabled is false and isSelected is true\", ButtonState.DISABLED_AND_SELECTED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton icon does not match icon set with setIconForState() when currentState is ButtonState.DISABLED_AND_SELECTED\", selectedDisabledIcon, this._button.currentIconInternal);\n\n\t\t\tthis._button.isEnabled = true;\n\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tAssert.assertStrictlyEquals(\"Touch target must be button\", this._button, target);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.HOVER;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton state is not ButtonState.HOVER_AND_SELECTED on TouchPhase.HOVER and isSelected is true\", ButtonState.HOVER_AND_SELECTED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton icon does not match icon set with setIconForState() when currentState is ButtonState.HOVER_AND_SELECTED and icon not provided for this state\", selectedHoverIcon, this._button.currentIconInternal);\n\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton state is not ButtonState.DOWN_AND_SELECTED on TouchPhase.BEGAN and isSelected is true\", ButtonState.DOWN_AND_SELECTED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton icon does not match icon set with setIconForState() when currentState is ButtonState.DOWN_AND_SELECTED and icon not provided for this state\", selectedDownIcon, this._button.currentIconInternal);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetScaleForStateWithoutSetSkinForState():void\n\t\t{\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton scaleWhenSelected must be NaN by default\",\n\t\t\t\t1, this._button.scaleWhenSelected);\n\t\t\tAssert.assertTrue(\"ToggleButton getScaleForState(ButtonState.UP) must be NaN when setScaleForState() is not called\",\n\t\t\t\tisNaN(this._button.getScaleForState(ButtonState.UP)));\n\t\t\tAssert.assertTrue(\"ToggleButton getScaleForState(ButtonState.HOVER) must be NaN when setScaleForState() is not called\",\n\t\t\t\tisNaN(this._button.getScaleForState(ButtonState.HOVER)));\n\t\t\tAssert.assertTrue(\"ToggleButton getScaleForState(ButtonState.DOWN) must be NaN when setScaleForState() is not called\",\n\t\t\t\tisNaN(this._button.getScaleForState(ButtonState.DOWN)));\n\t\t\tAssert.assertTrue(\"ToggleButton getScaleForState(ButtonState.DISABLED) must be NaN when setScaleForState() is not called\",\n\t\t\t\tisNaN(this._button.getScaleForState(ButtonState.DISABLED)));\n\t\t\tAssert.assertTrue(\"ToggleButton getScaleForState(ButtonState.UP_AND_SELECTED) must be NaN when setScaleForState() is not called\",\n\t\t\t\tisNaN(this._button.getScaleForState(ButtonState.UP_AND_SELECTED)));\n\t\t\tAssert.assertTrue(\"ToggleButton getScaleForState(ButtonState.HOVER_AND_SELECTED) must be NaN when setScaleForState() is not called\",\n\t\t\t\tisNaN(this._button.getScaleForState(ButtonState.HOVER_AND_SELECTED)));\n\t\t\tAssert.assertTrue(\"ToggleButton getScaleForState(ButtonState.DOWN_AND_SELECTED) must be NaN when setScaleForState() is not called\",\n\t\t\t\tisNaN(this._button.getScaleForState(ButtonState.DOWN_AND_SELECTED)));\n\t\t\tAssert.assertTrue(\"ToggleButton getScaleForState(ButtonState.DISABLED_AND_SELECTED) must be NaN when setScaleForState() is not called\",\n\t\t\t\tisNaN(this._button.getScaleForState(ButtonState.DISABLED_AND_SELECTED)));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetScaleForState():void\n\t\t{\n\t\t\tvar upScale:Number = 1.1;\n\t\t\tthis._button.setScaleForState(ButtonState.UP, upScale);\n\n\t\t\tvar hoverScale:Number = 1.2;\n\t\t\tthis._button.setScaleForState(ButtonState.HOVER, hoverScale);\n\n\t\t\tvar downScale:Number = 1.3;\n\t\t\tthis._button.setScaleForState(ButtonState.DOWN, downScale);\n\n\t\t\tvar disabledScale:Number = 1.4;\n\t\t\tthis._button.setScaleForState(ButtonState.DISABLED, disabledScale);\n\n\t\t\tvar scaleWhenSelected:Number = 1.5;\n\t\t\tthis._button.scaleWhenSelected = scaleWhenSelected;\n\n\t\t\tvar selectedUpScale:Number = 1.6;\n\t\t\tthis._button.setScaleForState(ButtonState.UP_AND_SELECTED, selectedUpScale);\n\n\t\t\tvar selectedHoverScale:Number = 1.7;\n\t\t\tthis._button.setScaleForState(ButtonState.HOVER_AND_SELECTED, selectedHoverScale);\n\n\t\t\tvar selectedDownScale:Number = 1.8;\n\t\t\tthis._button.setScaleForState(ButtonState.DOWN_AND_SELECTED, selectedDownScale);\n\n\t\t\tvar selectedDisabledScale:Number = 1.9;\n\t\t\tthis._button.setScaleForState(ButtonState.DISABLED_AND_SELECTED, selectedDisabledScale);\n\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton getScaleForState(ButtonState.UP) does not match value passed to setScaleForState()\", upScale, this._button.getScaleForState(ButtonState.UP));\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton getScaleForState(ButtonState.HOVER) does not match value passed to setScaleForState()\", hoverScale, this._button.getScaleForState(ButtonState.HOVER));\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton getScaleForState(ButtonState.DOWN) does not match value passed to setScaleForState()\", downScale, this._button.getScaleForState(ButtonState.DOWN));\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton getScaleForState(ButtonState.DISABLED) does not match value passed to setScaleForState()\", disabledScale, this._button.getScaleForState(ButtonState.DISABLED));\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton getScaleForState(ButtonState.UP_AND_SELECTED) does not match value passed to setScaleForState()\", selectedUpScale, this._button.getScaleForState(ButtonState.UP_AND_SELECTED));\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton getScaleForState(ButtonState.HOVER_AND_SELECTED) does not match value passed to setScaleForState()\", selectedHoverScale, this._button.getScaleForState(ButtonState.HOVER_AND_SELECTED));\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton getScaleForState(ButtonState.DOWN_AND_SELECTED) does not match value passed to setScaleForState()\", selectedDownScale, this._button.getScaleForState(ButtonState.DOWN_AND_SELECTED));\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton getScaleForState(ButtonState.DISABLED_AND_SELECTED) does not match value passed to setScaleForState()\", selectedDisabledScale, this._button.getScaleForState(ButtonState.DISABLED_AND_SELECTED));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDefaultCurrentScale():void\n\t\t{\n\t\t\tthis._button.defaultSkin = new Quad(200, 200);\n\t\t\tthis._button.isSelected = true;\n\n\t\t\tvar scaleWhenSelected:Number = 1.5;\n\t\t\tthis._button.scaleWhenSelected = scaleWhenSelected;\n\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton state is not ButtonState.UP_AND_SELECTED with no touch and isSelected is true\", ButtonState.UP_AND_SELECTED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton scale is not scaleWhenSelected when currentState is ButtonState.UP_AND_SELECTED and scale not provided for this state\", scaleWhenSelected, this._button.currentScaleInternal);\n\n\t\t\tthis._button.isEnabled = false;\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton state is not ButtonState.DISABLED_AND_SELECTED when isEnabled is false and isSelected is true\", ButtonState.DISABLED_AND_SELECTED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton scale is not scaleWhenSelected when currentState is ButtonState.DISABLED_AND_SELECTED and scale not provided for this state\", scaleWhenSelected, this._button.currentScaleInternal);\n\n\t\t\tthis._button.isEnabled = true;\n\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tAssert.assertStrictlyEquals(\"Touch target must be button\", this._button, target);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.HOVER;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton state is not ButtonState.HOVER_AND_SELECTED on TouchPhase.HOVER and isSelected is true\", ButtonState.HOVER_AND_SELECTED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton scale is not scaleWhenSelected when currentState is ButtonState.HOVER and scale not provided for this state\", scaleWhenSelected, this._button.currentScaleInternal);\n\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton state is not ButtonState.DOWN_AND_SELECTED on TouchPhase.BEGAN and isSelected is true\", ButtonState.DOWN_AND_SELECTED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton scale is not scaleWhenSelected when currentState is ButtonState.DOWN and scale not provided for this state\", scaleWhenSelected, this._button.currentScaleInternal);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testCurrentScaleWithSetScaleForState():void\n\t\t{\n\t\t\tthis._button.defaultSkin = new Quad(200, 200);\n\t\t\tthis._button.isSelected = true;\n\t\t\t\n\t\t\tvar scaleWhenSelected:Number = 2.0;\n\t\t\tthis._button.scaleWhenSelected = scaleWhenSelected;\n\n\t\t\tvar selectedUpScale:Number = 1.1;\n\t\t\tthis._button.setScaleForState(ButtonState.UP_AND_SELECTED, selectedUpScale);\n\n\t\t\tvar selectedHoverScale:Number = 1.2;\n\t\t\tthis._button.setScaleForState(ButtonState.HOVER_AND_SELECTED, selectedHoverScale);\n\n\t\t\tvar selectedDownScale:Number = 1.3;\n\t\t\tthis._button.setScaleForState(ButtonState.DOWN_AND_SELECTED, selectedDownScale);\n\n\t\t\tvar selectedDisabledScale:Number = 1.4;\n\t\t\tthis._button.setScaleForState(ButtonState.DISABLED_AND_SELECTED, selectedDisabledScale);\n\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton state is not ButtonState.UP_AND_SELECTED with no touch and isSelected is true\", ButtonState.UP_AND_SELECTED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton scale does not match scale set with setScaleForState() when currentState is ButtonState.UP_AND_SELECTED\", selectedUpScale, this._button.currentScaleInternal);\n\n\t\t\tthis._button.isEnabled = false;\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton state is not ButtonState.DISABLED_AND_SELECTED when isEnabled is false and isSelected is true\", ButtonState.DISABLED_AND_SELECTED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton scale does not match scale set with setScaleForState() when currentState is ButtonState.DISABLED_AND_SELECTED\", selectedDisabledScale, this._button.currentScaleInternal);\n\n\t\t\tthis._button.isEnabled = true;\n\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tAssert.assertStrictlyEquals(\"Touch target must be button\", this._button, target);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.HOVER;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton state is not ButtonState.HOVER_AND_SELECTED on TouchPhase.HOVER and isSelected is true\", ButtonState.HOVER_AND_SELECTED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton scale does not match scale set with setScaleForState() when currentState is ButtonState.HOVER_AND_SELECTED and scale not provided for this state\", selectedHoverScale, this._button.currentScaleInternal);\n\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._button.validate();\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton state is not ButtonState.DOWN_AND_SELECTED on TouchPhase.BEGAN and isSelected is true\", ButtonState.DOWN_AND_SELECTED, this._button.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton scale does not match scale set with setScaleForState() when currentState is ButtonState.DOWN_AND_SELECTED and scale not provided for this state\", selectedDownScale, this._button.currentScaleInternal);\n\t\t}\n\t}\n}\n\nimport feathers.controls.ToggleButton;\nimport feathers.core.ITextRenderer;\n\nimport starling.display.DisplayObject;\n\nclass ToggleButtonWithInternalState extends ToggleButton\n{\n\tpublic function ToggleButtonWithInternalState()\n\t{\n\t\tsuper();\n\t}\n\n\tpublic function get labelTextRendererInternal():ITextRenderer\n\t{\n\t\treturn this.labelTextRenderer;\n\t}\n\n\tpublic function get currentSkinInternal():DisplayObject\n\t{\n\t\treturn this.currentSkin;\n\t}\n\n\tpublic function get currentIconInternal():DisplayObject\n\t{\n\t\treturn this.currentIcon;\n\t}\n\n\tpublic function get currentScaleInternal():Number\n\t{\n\t\treturn this.getScaleForCurrentState();\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/ToggleButtonTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.ButtonState;\n\timport feathers.controls.ToggleButton;\n\timport feathers.core.ToggleGroup;\n\timport feathers.tests.supportClasses.DisposeFlagQuad;\n\n\timport flash.geom.Point;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\tpublic class ToggleButtonTests\n\t{\n\t\tprivate var _button:ToggleButton;\n\t\tprivate var _blocker:Quad;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._button = new ToggleButton();\n\t\t\tthis._button.isSelected = true;\n\t\t\tthis._button.label = \"Click Me\";\n\t\t\tthis._button.defaultSkin = new Quad(200, 200);\n\t\t\tTestFeathers.starlingRoot.addChild(this._button);\n\t\t\tthis._button.validate();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._button.removeFromParent(true);\n\t\t\tthis._button = null;\n\n\t\t\tif(this._blocker)\n\t\t\t{\n\t\t\t\tthis._blocker.removeFromParent(true);\n\t\t\t\tthis._blocker = null;\n\t\t\t}\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testProgrammaticChangeEvent():void\n\t\t{\n\t\t\tvar beforeIsSelected:Boolean = this._button.isSelected;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._button.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._button.isSelected = !this._button.isSelected;\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertFalse(\"This isSelected property was not changed\", beforeIsSelected === this._button.isSelected);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInteractiveChangeEvent():void\n\t\t{\n\t\t\tvar beforeIsSelected:Boolean = this._button.isSelected;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._button.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t//this touch does not move at all, so it should result in triggering\n\t\t\t//the button.\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertFalse(\"This isSelected property was not changed\", beforeIsSelected === this._button.isSelected);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveBeforeInteractiveChangeEvent():void\n\t\t{\n\t\t\tvar beforeIsSelected:Boolean = this._button.isSelected;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._button.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tthis._button.removeFromParent(false);\n\t\t\tAssert.assertFalse(\"Event.CHANGE most not be dispatched after removed from stage\", hasChanged);\n\t\t\tAssert.assertTrue(\"This isSelected property must not be changed after removed from stage\", beforeIsSelected === this._button.isSelected);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetIsToggleToFalse():void\n\t\t{\n\t\t\tthis._button.isToggle = false;\n\t\t\tthis._button.validate();\n\t\t\tvar beforeIsSelected:Boolean = this._button.isSelected;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._button.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t//this touch does not move at all, so it should result in triggering\n\t\t\t//the button.\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertFalse(\"Event.CHANGE was incorrectly dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"This isSelected property was incorrectly changed\", beforeIsSelected === this._button.isSelected);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTouchMoveOutsideBeforeChangeEvent():void\n\t\t{\n\t\t\tvar beforeIsSelected:Boolean = this._button.isSelected;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._button.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.x;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.globalX = 1000; //move the touch way outside the bounds of the button\n\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertFalse(\"Event.CHANGE was incorrectly dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The isSelected property was incorrectly changed\",\n\t\t\t\tbeforeIsSelected, this._button.isSelected);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testOtherDisplayObjectBlockingChangeEvent():void\n\t\t{\n\t\t\tvar beforeIsSelected:Boolean = this._button.isSelected;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._button.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tthis._blocker = new Quad(200, 200, 0xff0000);\n\t\t\tTestFeathers.starlingRoot.addChild(this._blocker);\n\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertFalse(\"Event.CHANGE was incorrectly dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The isSelected property was incorrectly changed\",\n\t\t\t\tbeforeIsSelected, this._button.isSelected);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSkinsDisposed():void\n\t\t{\n\t\t\tvar defaultSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.defaultSkin = defaultSkin;\n\t\t\tvar upSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.upSkin = upSkin;\n\t\t\tvar downSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.downSkin = downSkin;\n\t\t\tvar hoverSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.hoverSkin = hoverSkin;\n\t\t\tvar disabledSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.disabledSkin = disabledSkin;\n\t\t\tvar defaultSelectedSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.defaultSelectedSkin = defaultSelectedSkin;\n\t\t\tvar selectedUpSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.selectedUpSkin = selectedUpSkin;\n\t\t\tvar selectedDownSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.selectedDownSkin = selectedDownSkin;\n\t\t\tvar selectedHoverSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.selectedHoverSkin = selectedHoverSkin;\n\t\t\tvar selectedDisabledSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.selectedDisabledSkin = selectedDisabledSkin;\n\t\t\tthis._button.validate();\n\t\t\tthis._button.dispose();\n\t\t\tAssert.assertTrue(\"defaultSkin not disposed when ToggleButton disposed.\", defaultSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"upSkin not disposed when ToggleButton disposed.\", upSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"downSkin not disposed when ToggleButton disposed.\", downSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"hoverSkin not disposed when ToggleButton disposed.\", hoverSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"disabledSkin not disposed when ToggleButton disposed.\", disabledSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"defaultSelectedSkin not disposed when ToggleButton disposed.\", defaultSelectedSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"selectedUpSkin not disposed when ToggleButton disposed.\", selectedUpSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"selectedDownSkin not disposed when ToggleButton disposed.\", selectedDownSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"selectedHoverSkin not disposed when ToggleButton disposed.\", selectedHoverSkin.isDisposed);\n\t\t\tAssert.assertTrue(\"selectedDisabledSkin not disposed when ToggleButton disposed.\", selectedDisabledSkin.isDisposed);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testIconsDisposed():void\n\t\t{\n\t\t\tvar defaultIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.defaultIcon = defaultIcon;\n\t\t\tvar upIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.upIcon = upIcon;\n\t\t\tvar downIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.downSkin = downIcon;\n\t\t\tvar hoverIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.hoverIcon = hoverIcon;\n\t\t\tvar disabledIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.disabledIcon = disabledIcon;\n\t\t\tvar defaultSelectedIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.defaultSelectedIcon = defaultSelectedIcon;\n\t\t\tvar selectedUpIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.selectedUpIcon = selectedUpIcon;\n\t\t\tvar selectedDownIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.selectedDownIcon = selectedDownIcon;\n\t\t\tvar selectedHoverIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.selectedHoverIcon = selectedHoverIcon;\n\t\t\tvar selectedDisabledIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.selectedDisabledIcon = selectedDisabledIcon;\n\t\t\tthis._button.validate();\n\t\t\tthis._button.dispose();\n\t\t\tAssert.assertTrue(\"defaultIcon not disposed when ToggleButton disposed.\", defaultIcon.isDisposed);\n\t\t\tAssert.assertTrue(\"upIcon not disposed when ToggleButton disposed.\", upIcon.isDisposed);\n\t\t\tAssert.assertTrue(\"downIcon not disposed when ToggleButton disposed.\", downIcon.isDisposed);\n\t\t\tAssert.assertTrue(\"hoverIcon not disposed when ToggleButton disposed.\", hoverIcon.isDisposed);\n\t\t\tAssert.assertTrue(\"disabledIcon not disposed when ToggleButton disposed.\", disabledIcon.isDisposed);\n\t\t\tAssert.assertTrue(\"defaultSelectedIcon not disposed when ToggleButton disposed.\", defaultSelectedIcon.isDisposed);\n\t\t\tAssert.assertTrue(\"selectedUpIcon not disposed when ToggleButton disposed.\", selectedUpIcon.isDisposed);\n\t\t\tAssert.assertTrue(\"selectedDownIcon not disposed when ToggleButton disposed.\", selectedDownIcon.isDisposed);\n\t\t\tAssert.assertTrue(\"selectedHoverIcon not disposed when ToggleButton disposed.\", selectedHoverIcon.isDisposed);\n\t\t\tAssert.assertTrue(\"selectedDisabledIcon not disposed when ToggleButton disposed.\", selectedDisabledIcon.isDisposed);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSkinsRemovedWhenSetToNull():void\n\t\t{\n\t\t\tvar defaultSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.defaultSkin = defaultSkin;\n\t\t\tvar upSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.setSkinForState(ButtonState.UP, upSkin);\n\t\t\tvar downSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.setSkinForState(ButtonState.DOWN, downSkin);\n\t\t\tvar hoverSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.setSkinForState(ButtonState.HOVER, hoverSkin);\n\t\t\tvar disabledSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.setSkinForState(ButtonState.DISABLED, disabledSkin);\n\t\t\tvar defaultSelectedSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.defaultSelectedSkin = defaultSelectedSkin;\n\t\t\tvar selectedUpSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.setSkinForState(ButtonState.UP_AND_SELECTED, selectedUpSkin);\n\t\t\tvar selectedDownSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.setSkinForState(ButtonState.DOWN_AND_SELECTED, selectedDownSkin);\n\t\t\tvar selectedHoverSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.setSkinForState(ButtonState.HOVER_AND_SELECTED, selectedHoverSkin);\n\t\t\tvar selectedDisabledSkin:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.setSkinForState(ButtonState.DISABLED_AND_SELECTED, selectedDisabledSkin);\n\t\t\tthis._button.validate();\n\t\t\tthis._button.defaultSkin = null;\n\t\t\tthis._button.setSkinForState(ButtonState.UP, null);\n\t\t\tthis._button.setSkinForState(ButtonState.DOWN, null);\n\t\t\tthis._button.setSkinForState(ButtonState.HOVER, null);\n\t\t\tthis._button.setSkinForState(ButtonState.DISABLED, null);\n\t\t\tthis._button.defaultSelectedSkin = null;\n\t\t\tthis._button.setSkinForState(ButtonState.UP_AND_SELECTED, null);\n\t\t\tthis._button.setSkinForState(ButtonState.DOWN_AND_SELECTED, null);\n\t\t\tthis._button.setSkinForState(ButtonState.HOVER_AND_SELECTED, null);\n\t\t\tthis._button.setSkinForState(ButtonState.DISABLED_AND_SELECTED, null);\n\t\t\t//should not need to validate here\n\t\t\tthis._button.dispose();\n\t\t\tAssert.assertFalse(\"Removed defaultSkin incorrectly disposed when ToggleButton disposed.\", defaultSkin.isDisposed);\n\t\t\tAssert.assertFalse(\"Removed upSkin incorrectly disposed when ToggleButton disposed.\", upSkin.isDisposed);\n\t\t\tAssert.assertFalse(\"Removed downSkin incorrectly disposed when ToggleButton disposed.\", downSkin.isDisposed);\n\t\t\tAssert.assertFalse(\"Removed hoverSkin incorrectly disposed when ToggleButton disposed.\", hoverSkin.isDisposed);\n\t\t\tAssert.assertFalse(\"Removed disabledSkin incorrectly disposed when ToggleButton disposed.\", disabledSkin.isDisposed);\n\t\t\tAssert.assertFalse(\"Removed defaultSelectedSkin incorrectly disposed when ToggleButton disposed.\", defaultSelectedSkin.isDisposed);\n\t\t\tAssert.assertFalse(\"Removed selectedUpSkin incorrectly disposed when ToggleButton disposed.\", selectedUpSkin.isDisposed);\n\t\t\tAssert.assertFalse(\"Removed selectedDownSkin incorrectly disposed when ToggleButton disposed.\", selectedDownSkin.isDisposed);\n\t\t\tAssert.assertFalse(\"Removed selectedHoverSkin incorrectly disposed when ToggleButton disposed.\", selectedHoverSkin.isDisposed);\n\t\t\tAssert.assertFalse(\"Removed selectedDisabledSkin incorrectly disposed when ToggleButton disposed.\", selectedDisabledSkin.isDisposed);\n\t\t\tAssert.assertNull(\"defaultSkin parent must be null when removed from ToggleButton.\", defaultSkin.parent);\n\t\t\tAssert.assertNull(\"upSkin parent must be null when removed from ToggleButton.\", upSkin.parent);\n\t\t\tAssert.assertNull(\"downSkin parent must be null when removed from ToggleButton.\", downSkin.parent);\n\t\t\tAssert.assertNull(\"hoverSkin parent must be null when removed from ToggleButton.\", hoverSkin.parent);\n\t\t\tAssert.assertNull(\"disabledSkin parent must be null when removed from ToggleButton.\", disabledSkin.parent);\n\t\t\tAssert.assertNull(\"defaultSelectedSkin parent must be null when removed from ToggleButton.\", defaultSelectedSkin.parent);\n\t\t\tAssert.assertNull(\"selectedUpSkin parent must be null when removed from ToggleButton.\", selectedUpSkin.parent);\n\t\t\tAssert.assertNull(\"selectedDownSkin parent must be null when removed from ToggleButton.\", selectedDownSkin.parent);\n\t\t\tAssert.assertNull(\"selectedHoverSkin parent must be null when removed from ToggleButton.\", selectedHoverSkin.parent);\n\t\t\tAssert.assertNull(\"selectedDisabledSkin parent must be null when removed from ToggleButton.\", selectedDisabledSkin.parent);\n\t\t\tdefaultSkin.dispose();\n\t\t\tupSkin.dispose();\n\t\t\tdownSkin.dispose();\n\t\t\thoverSkin.dispose();\n\t\t\tdisabledSkin.dispose();\n\t\t\tdefaultSelectedSkin.dispose();\n\t\t\tselectedUpSkin.dispose();\n\t\t\tselectedDownSkin.dispose();\n\t\t\tselectedHoverSkin.dispose();\n\t\t\tselectedDisabledSkin.dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testIconsRemovedWhenSetToNull():void\n\t\t{\n\t\t\tvar defaultIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.defaultIcon = defaultIcon;\n\t\t\tvar upIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.setIconForState(ButtonState.UP, upIcon);\n\t\t\tvar downIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.setIconForState(ButtonState.DOWN, downIcon);\n\t\t\tvar hoverIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.setIconForState(ButtonState.HOVER, hoverIcon);\n\t\t\tvar disabledIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.setIconForState(ButtonState.DISABLED, disabledIcon);\n\t\t\tvar defaultSelectedIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.defaultSelectedIcon = defaultSelectedIcon;\n\t\t\tvar selectedUpIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.setIconForState(ButtonState.UP_AND_SELECTED, selectedUpIcon);\n\t\t\tvar selectedDownIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.setIconForState(ButtonState.DOWN_AND_SELECTED, selectedDownIcon);\n\t\t\tvar selectedHoverIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.setIconForState(ButtonState.HOVER_AND_SELECTED, selectedHoverIcon);\n\t\t\tvar selectedDisabledIcon:DisposeFlagQuad = new DisposeFlagQuad();\n\t\t\tthis._button.setIconForState(ButtonState.DISABLED_AND_SELECTED, selectedDisabledIcon);\n\t\t\tthis._button.validate();\n\t\t\tthis._button.defaultIcon = null;\n\t\t\tthis._button.setIconForState(ButtonState.UP, null);\n\t\t\tthis._button.setIconForState(ButtonState.DOWN, null);\n\t\t\tthis._button.setIconForState(ButtonState.HOVER, null);\n\t\t\tthis._button.setIconForState(ButtonState.DISABLED, null);\n\t\t\tthis._button.defaultSelectedIcon = null;\n\t\t\tthis._button.setIconForState(ButtonState.UP_AND_SELECTED, null);\n\t\t\tthis._button.setIconForState(ButtonState.DOWN_AND_SELECTED, null);\n\t\t\tthis._button.setIconForState(ButtonState.HOVER_AND_SELECTED, null);\n\t\t\tthis._button.setIconForState(ButtonState.DISABLED_AND_SELECTED, null);\n\t\t\t//should not need to validate here\n\t\t\tthis._button.dispose();\n\t\t\tAssert.assertFalse(\"Removed defaultIcon incorrectly disposed when ToggleButton disposed.\", defaultIcon.isDisposed);\n\t\t\tAssert.assertFalse(\"Removed upIcon incorrectly disposed when ToggleButton disposed.\", upIcon.isDisposed);\n\t\t\tAssert.assertFalse(\"Removed downIcon incorrectly disposed when ToggleButton disposed.\", downIcon.isDisposed);\n\t\t\tAssert.assertFalse(\"Removed hoverIcon incorrectly disposed when ToggleButton disposed.\", hoverIcon.isDisposed);\n\t\t\tAssert.assertFalse(\"Removed disabledIcon incorrectly disposed when ToggleButton disposed.\", disabledIcon.isDisposed);\n\t\t\tAssert.assertFalse(\"Removed defaultSelectedIcon incorrectly disposed when ToggleButton disposed.\", defaultSelectedIcon.isDisposed);\n\t\t\tAssert.assertFalse(\"Removed selectedUpIcon incorrectly disposed when ToggleButton disposed.\", selectedUpIcon.isDisposed);\n\t\t\tAssert.assertFalse(\"Removed selectedDownIcon incorrectly disposed when ToggleButton disposed.\", selectedDownIcon.isDisposed);\n\t\t\tAssert.assertFalse(\"Removed selectedHoverIcon incorrectly disposed when ToggleButton disposed.\", selectedHoverIcon.isDisposed);\n\t\t\tAssert.assertFalse(\"Removed selectedDisabledIcon incorrectly disposed when ToggleButton disposed.\", selectedDisabledIcon.isDisposed);\n\t\t\tAssert.assertNull(\"defaultIcon parent must be null when removed from ToggleButton.\", defaultIcon.parent);\n\t\t\tAssert.assertNull(\"upIcon parent must be null when removed from ToggleButton.\", upIcon.parent);\n\t\t\tAssert.assertNull(\"downIcon parent must be null when removed from ToggleButton.\", downIcon.parent);\n\t\t\tAssert.assertNull(\"hoverIcon parent must be null when removed from ToggleButton.\", hoverIcon.parent);\n\t\t\tAssert.assertNull(\"disabledIcon parent must be null when removed from ToggleButton.\", disabledIcon.parent);\n\t\t\tAssert.assertNull(\"defaultSelectedIcon parent must be null when removed from ToggleButton.\", defaultSelectedIcon.parent);\n\t\t\tAssert.assertNull(\"selectedUpIcon parent must be null when removed from ToggleButton.\", selectedUpIcon.parent);\n\t\t\tAssert.assertNull(\"selectedDownIcon parent must be null when removed from ToggleButton.\", selectedDownIcon.parent);\n\t\t\tAssert.assertNull(\"selectedHoverIcon parent must be null when removed from ToggleButton.\", selectedHoverIcon.parent);\n\t\t\tAssert.assertNull(\"selectedDisabledIcon parent must be null when removed from ToggleButton.\", selectedDisabledIcon.parent);\n\t\t\tdefaultIcon.dispose();\n\t\t\tupIcon.dispose();\n\t\t\tdownIcon.dispose();\n\t\t\thoverIcon.dispose();\n\t\t\tdisabledIcon.dispose();\n\t\t\tdefaultSelectedIcon.dispose();\n\t\t\tselectedUpIcon.dispose();\n\t\t\tselectedDownIcon.dispose();\n\t\t\tselectedHoverIcon.dispose();\n\t\t\tselectedDisabledIcon.dispose();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testToggleGroupPropertyAfterAddingExternally():void\n\t\t{\n\t\t\tvar group:ToggleGroup = new ToggleGroup();\n\t\t\tgroup.addItem(this._button);\n\t\t\tAssert.assertNotNull(\"toggleGroup property must not be null after adding a ToggleButton to a ToggleGroup.\", this._button.toggleGroup);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testToggleGroupPropertyAfterRemovingExternally():void\n\t\t{\n\t\t\tvar group:ToggleGroup = new ToggleGroup();\n\t\t\tgroup.addItem(this._button);\n\t\t\tgroup.removeItem(this._button);\n\t\t\tAssert.assertNull(\"toggleGroup property must be null after removing a ToggleButton to a ToggleGroup.\", this._button.toggleGroup);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testButtonStateHoverOnTouchPhaseHover():void\n\t\t{\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.HOVER;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton currentState was not changed to ButtonState.HOVER_AND_SELECTED on TouchPhase.HOVER\", ButtonState.HOVER_AND_SELECTED, this._button.currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testButtonStateUpAfterHoverOut():void\n\t\t{\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.HOVER;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, new <Touch>[]));\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton currentState was not changed to ButtonState.UP_AND_SELECTED when TouchPhase.HOVER ends\", ButtonState.UP_AND_SELECTED, this._button.currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testButtonStateDownOnTouchPhaseBegan():void\n\t\t{\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton currentState was not changed to ButtonState.DOWN_AND_SELECTED on TouchPhase.BEGAN\", ButtonState.DOWN_AND_SELECTED, this._button.currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testButtonStateUpOnTouchPhaseMoveOutside():void\n\t\t{\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\ttouch.globalX = 1000;\n\t\t\ttouch.globalY = position.y;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton currentState was not changed to ButtonState.UP_AND_SELECTED on TouchPhase.MOVED when position is outside button\", ButtonState.UP_AND_SELECTED, this._button.currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testButtonStateDownOnTouchPhaseMoveOutsideAndBackInside():void\n\t\t{\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\ttouch.globalX = 1000;\n\t\t\ttouch.globalY = position.y;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.globalX = 10;\n\t\t\ttouch.globalY = position.y;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton currentState was not changed to ButtonState.DOWN_AND_SELECTED on TouchPhase.MOVED when position moves outside button then back inside\", ButtonState.DOWN_AND_SELECTED, this._button.currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testButtonStateUpOnTouchPhaseMoveOutsideAndKeepDownStateOnRollOutIsTrue():void\n\t\t{\n\t\t\tthis._button.keepDownStateOnRollOut = true;\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\ttouch.globalX = 1000;\n\t\t\ttouch.globalY = position.y;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton currentState was incorrectly changed from ButtonState.DOWN_AND_SELECTED on TouchPhase.MOVED when position is outside button and keepDownStateOnRollOut is true\", ButtonState.DOWN_AND_SELECTED, this._button.currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testButtonStateUpOnTouchPhaseEnded():void\n\t\t{\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._button.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton currentState was not changed to ButtonState.UP on TouchPhase.ENDED (which toggles isSelected)\", ButtonState.UP, this._button.currentState);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ToggleGroupTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.ToggleButton;\n\timport feathers.core.IToggle;\n\timport feathers.core.ToggleGroup;\n\n\timport org.flexunit.Assert;\n\n\timport starling.events.Event;\n\n\tpublic class ToggleGroupTests\n\t{\n\t\tprivate var _group:ToggleGroup;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._group = new ToggleGroup();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tvar itemCount:int = this._group.numItems;\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:ToggleButton = ToggleButton(this._group.getItemAt(i));\n\t\t\t\titem.dispose();\n\t\t\t}\n\t\t\tthis._group = null;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDefaultSelectedIndexIsNegativeOne():void\n\t\t{\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property is not equal to -1\",\n\t\t\t\t-1, this._group.selectedIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testUpdatesSelectedIndexWhenAddingFirstItem():void\n\t\t{\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._group.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._group.addItem(new ToggleButton());\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property is not equal to 0\",\n\t\t\t\t0, this._group.selectedIndex);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSettingSelectedIndexDispatchesChangeEvent():void\n\t\t{\n\t\t\tthis._group.addItem(new ToggleButton());\n\t\t\tthis._group.addItem(new ToggleButton());\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._group.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._group.selectedIndex = 1;\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSettingSelectedIndexToSameValueDispatchesNoEvent():void\n\t\t{\n\t\t\tthis._group.addItem(new ToggleButton());\n\t\t\tthis._group.addItem(new ToggleButton());\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._group.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._group.selectedIndex = 0;\n\t\t\tAssert.assertFalse(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChangingItemSelectionDispatchesChangeEvent():void\n\t\t{\n\t\t\tvar itemAtIndex1:ToggleButton = new ToggleButton();\n\t\t\tthis._group.addItem(new ToggleButton());\n\t\t\tthis._group.addItem(itemAtIndex1);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._group.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\titemAtIndex1.isSelected = true;\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemBeforeSelectedItem():void\n\t\t{\n\t\t\tvar itemAtIndex0:ToggleButton = new ToggleButton();\n\t\t\tthis._group.addItem(itemAtIndex0);\n\t\t\tthis._group.addItem(new ToggleButton());\n\t\t\tthis._group.addItem(new ToggleButton());\n\t\t\tthis._group.selectedIndex = 1;\n\t\t\tvar beforeSelectedIndex:int = this._group.selectedIndex;\n\t\t\tvar beforeSelectedItem:Object = this._group.selectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._group.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._group.removeItem(itemAtIndex0);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was not changed\",\n\t\t\t\tbeforeSelectedIndex - 1, this._group.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem was incorrectly changed\",\n\t\t\t\tbeforeSelectedItem, this._group.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveAfterSelectedIndex():void\n\t\t{\n\t\t\tvar itemAtIndex2:ToggleButton = new ToggleButton();\n\t\t\tthis._group.addItem(new ToggleButton());\n\t\t\tthis._group.addItem(new ToggleButton());\n\t\t\tthis._group.addItem(itemAtIndex2);\n\t\t\tthis._group.selectedIndex = 1;\n\t\t\tvar beforeSelectedIndex:int = this._group.selectedIndex;\n\t\t\tvar beforeSelectedItem:Object = this._group.selectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._group.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._group.removeItem(itemAtIndex2);\n\t\t\tAssert.assertFalse(\"Event.CHANGE was incorrectly dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was incorrectly changed\",\n\t\t\t\tbeforeSelectedIndex, this._group.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem was incorrectly changed\",\n\t\t\t\tbeforeSelectedItem, this._group.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveSelectedItem():void\n\t\t{\n\t\t\tvar itemAtIndex1:ToggleButton = new ToggleButton();\n\t\t\tthis._group.addItem(new ToggleButton());\n\t\t\tthis._group.addItem(itemAtIndex1);\n\t\t\tthis._group.addItem(new ToggleButton());\n\t\t\tthis._group.selectedIndex = 1;\n\t\t\tvar beforeSelectedIndex:int = this._group.selectedIndex;\n\t\t\tvar beforeSelectedItem:IToggle = this._group.selectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._group.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._group.removeItem(itemAtIndex1);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was incorrectly changed\",\n\t\t\t\tbeforeSelectedIndex, this._group.selectedIndex);\n\t\t\tAssert.assertFalse(\"The selectedItem was not changed\",\n\t\t\t\tbeforeSelectedItem === this._group.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDeselectAllOnRemoveAllItems():void\n\t\t{\n\t\t\tthis._group.addItem(new ToggleButton());\n\t\t\tthis._group.addItem(new ToggleButton());\n\t\t\tthis._group.addItem(new ToggleButton());\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._group.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._group.removeAllItems();\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedIndex property was not set to -1\",\n\t\t\t\t-1, this._group.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem property was not set to null\",\n\t\t\t\tnull, this._group.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetSelectedItemIndex():void\n\t\t{\n\t\t\tvar itemAtIndex1:ToggleButton = new ToggleButton();\n\t\t\tthis._group.addItem(new ToggleButton());\n\t\t\tthis._group.addItem(itemAtIndex1);\n\t\t\tthis._group.addItem(new ToggleButton());\n\t\t\tthis._group.selectedIndex = 1;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tvar beforeSelectedIndex:int = this._group.selectedIndex;\n\t\t\tvar beforeSelectedItem:IToggle = this._group.selectedItem;\n\t\t\tthis._group.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._group.setItemIndex(itemAtIndex1, 2);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertFalse(\"The selectedIndex property was not changed\",\n\t\t\t\tbeforeSelectedIndex === this._group.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem was incorrectly changed\",\n\t\t\t\tbeforeSelectedItem, this._group.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemIndexBeforeSelectedItem():void\n\t\t{\n\t\t\tvar itemAtIndex0:ToggleButton = new ToggleButton();\n\t\t\tthis._group.addItem(itemAtIndex0);\n\t\t\tthis._group.addItem(new ToggleButton());\n\t\t\tthis._group.addItem(new ToggleButton());\n\t\t\tthis._group.selectedIndex = 1;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tvar beforeSelectedIndex:int = this._group.selectedIndex;\n\t\t\tvar beforeSelectedItem:IToggle = this._group.selectedItem;\n\t\t\tthis._group.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._group.setItemIndex(itemAtIndex0, 2);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertFalse(\"The selectedIndex property was not changed\",\n\t\t\t\tbeforeSelectedIndex === this._group.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem was incorrectly changed\",\n\t\t\t\tbeforeSelectedItem, this._group.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemIndexAfterSelectedItem():void\n\t\t{\n\t\t\tvar itemAtIndex2:ToggleButton = new ToggleButton();\n\t\t\tthis._group.addItem(new ToggleButton());\n\t\t\tthis._group.addItem(new ToggleButton());\n\t\t\tthis._group.addItem(itemAtIndex2);\n\t\t\tthis._group.selectedIndex = 1;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tvar beforeSelectedIndex:int = this._group.selectedIndex;\n\t\t\tvar beforeSelectedItem:IToggle = this._group.selectedItem;\n\t\t\tthis._group.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._group.setItemIndex(itemAtIndex2, 0);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertFalse(\"The selectedIndex property was not changed\",\n\t\t\t\tbeforeSelectedIndex === this._group.selectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"The selectedItem was incorrectly changed\",\n\t\t\t\tbeforeSelectedItem, this._group.selectedItem);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHasItem():void\n\t\t{\n\t\t\tvar item:ToggleButton = new ToggleButton();\n\t\t\tAssert.assertFalse(\"hasItem() incorrectly returned true.\", this._group.hasItem(item));\n\t\t\tthis._group.addItem(item);\n\t\t\tAssert.assertTrue(\"hasItem() incorrectly returned false.\", this._group.hasItem(item));\n\t\t\tthis._group.removeItem(item);\n\t\t\tAssert.assertFalse(\"hasItem() incorrectly returned true.\", this._group.hasItem(item));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDefaultNumItems():void\n\t\t{\n\t\t\tAssert.assertStrictlyEquals(\"The numItems property is not equal to 0\",\n\t\t\t\t0, this._group.numItems);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNumItemsAfterAddItem():void\n\t\t{\n\t\t\tthis._group.addItem(new ToggleButton());\n\t\t\tAssert.assertStrictlyEquals(\"The numItems property is not equal to 1 after addItem()\",\n\t\t\t\t1, this._group.numItems);\n\t\t}\n\n\t\t[Test(expects=\"RangeError\")]\n\t\tpublic function testGetItemAtWhenEmpty():void\n\t\t{\n\t\t\tthis._group.getItemAt(0);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemAt():void\n\t\t{\n\t\t\tvar item:ToggleButton = new ToggleButton();\n\t\t\tthis._group.addItem(item);\n\t\t\tAssert.assertStrictlyEquals(\"ToggleButton getItemAt() returns wrong item\",\n\t\t\t\titem, this._group.getItemAt(0));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ToggleSwitchMeasurementTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.BasicButton;\n\timport feathers.controls.ToggleSwitch;\n\timport feathers.controls.TrackLayoutMode;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\n\tpublic class ToggleSwitchMeasurementTests\n\t{\n\t\tprivate static const SINGLE_TRACK_WIDTH:Number = 200;\n\t\tprivate static const SINGLE_TRACK_HEIGHT:Number = 50;\n\t\tprivate static const SINGLE_TRACK_MIN_WIDTH:Number = 150;\n\t\tprivate static const SINGLE_TRACK_MIN_HEIGHT:Number = 30;\n\n\t\tprivate static const ON_TRACK_WIDTH:Number = 100;\n\t\tprivate static const ON_TRACK_HEIGHT:Number = 50;\n\t\tprivate static const ON_TRACK_MIN_WIDTH:Number = 80;\n\t\tprivate static const ON_TRACK_MIN_HEIGHT:Number = 20;\n\n\t\tprivate static const OFF_TRACK_WIDTH:Number = 110;\n\t\tprivate static const OFF_TRACK_HEIGHT:Number = 55;\n\t\tprivate static const OFF_TRACK_MIN_WIDTH:Number = 90;\n\t\tprivate static const OFF_TRACK_MIN_HEIGHT:Number = 25;\n\n\t\tprivate static const THUMB_WIDTH:Number = 30;\n\t\tprivate static const SMALL_THUMB_HEIGHT:Number = 40;\n\t\tprivate static const LARGE_THUMB_HEIGHT:Number = 60;\n\n\t\tprivate static const THUMB_MIN_WIDTH:Number = 18;\n\t\tprivate static const SMALL_THUMB_MIN_HEIGHT:Number = 20;\n\t\tprivate static const LARGE_THUMB_MIN_HEIGHT:Number = 40;\n\t\t\n\t\tprivate var _toggle:ToggleSwitch;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._toggle = new ToggleSwitch();\n\t\t\tTestFeathers.starlingRoot.addChild(this._toggle);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._toggle.removeFromParent(true);\n\t\t\tthis._toggle = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithTrackLayoutModeSingle():void\n\t\t{\n\t\t\tthis._toggle.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._toggle.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, SMALL_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._toggle.onTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SINGLE_TRACK_WIDTH, SINGLE_TRACK_HEIGHT, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._toggle.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the ToggleSwitch was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE.\",\n\t\t\t\tSINGLE_TRACK_WIDTH, this._toggle.width);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the ToggleSwitch was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE.\",\n\t\t\t\tSINGLE_TRACK_WIDTH, this._toggle.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the ToggleSwitch was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE.\",\n\t\t\t\tSINGLE_TRACK_HEIGHT, this._toggle.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the ToggleSwitch was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE.\",\n\t\t\t\tSINGLE_TRACK_HEIGHT, this._toggle.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeHeightWithTrackLayoutModeSingleAndLargerThumb():void\n\t\t{\n\t\t\tthis._toggle.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._toggle.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, LARGE_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._toggle.onTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SINGLE_TRACK_WIDTH, SINGLE_TRACK_HEIGHT, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._toggle.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The height of the ToggleSwitch was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and larger thumb.\",\n\t\t\t\tLARGE_THUMB_HEIGHT, this._toggle.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the ToggleSwitch was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and larger thumb.\",\n\t\t\t\tLARGE_THUMB_HEIGHT, this._toggle.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithTrackLayoutModeSingleAndMinDimensions():void\n\t\t{\n\t\t\tthis._toggle.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._toggle.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, SMALL_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\tthumb.minWidth = THUMB_MIN_WIDTH;\n\t\t\t\tthumb.minHeight = SMALL_THUMB_MIN_HEIGHT;\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._toggle.onTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SINGLE_TRACK_WIDTH, SINGLE_TRACK_HEIGHT, 0xffff00);\n\t\t\t\tbutton.minWidth = SINGLE_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = SINGLE_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._toggle.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the ToggleSwitch was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE when the track's minWidth is set.\",\n\t\t\t\tSINGLE_TRACK_MIN_WIDTH, this._toggle.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the ToggleSwitch was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE when the track's minHeight is set.\",\n\t\t\t\tSINGLE_TRACK_MIN_HEIGHT, this._toggle.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeMinHeightWithTrackLayoutModeSingleAndLargerThumb():void\n\t\t{\n\t\t\tthis._toggle.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._toggle.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, LARGE_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\tthumb.minWidth = THUMB_MIN_WIDTH;\n\t\t\t\tthumb.minHeight = LARGE_THUMB_MIN_HEIGHT;\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._toggle.onTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(SINGLE_TRACK_WIDTH, SINGLE_TRACK_HEIGHT, 0xffff00);\n\t\t\t\tbutton.minWidth = SINGLE_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = SINGLE_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._toggle.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the ToggleSwitch was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SINGLE and larger thumb minHeight.\",\n\t\t\t\tLARGE_THUMB_MIN_HEIGHT, this._toggle.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithTrackLayoutModeSplit():void\n\t\t{\n\t\t\tthis._toggle.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tthis._toggle.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, SMALL_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._toggle.onTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(ON_TRACK_WIDTH, ON_TRACK_HEIGHT, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._toggle.offTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(OFF_TRACK_WIDTH, OFF_TRACK_HEIGHT, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._toggle.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The width of the ToggleSwitch was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT.\",\n\t\t\t\tOFF_TRACK_WIDTH + THUMB_WIDTH / 2, this._toggle.width);\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the ToggleSwitch was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT.\",\n\t\t\t\tOFF_TRACK_WIDTH + THUMB_WIDTH / 2, this._toggle.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The height of the ToggleSwitch was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT.\",\n\t\t\t\tOFF_TRACK_HEIGHT, this._toggle.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the ToggleSwitch was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT.\",\n\t\t\t\tOFF_TRACK_HEIGHT, this._toggle.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeHeightWithTrackLayoutModeSplitAndLargerThumb():void\n\t\t{\n\t\t\tthis._toggle.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tthis._toggle.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, LARGE_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._toggle.onTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(ON_TRACK_WIDTH, ON_TRACK_HEIGHT, 0xffff00);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._toggle.offTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(OFF_TRACK_WIDTH, OFF_TRACK_HEIGHT, 0x00ffff);\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._toggle.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The height of the ToggleSwitch was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT and larger thumb.\",\n\t\t\t\tLARGE_THUMB_HEIGHT, this._toggle.height);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the ToggleSwitch was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT and larger thumb.\",\n\t\t\t\tLARGE_THUMB_HEIGHT, this._toggle.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeWithTrackLayoutModeSplitAndMinDimensions():void\n\t\t{\n\t\t\tthis._toggle.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tthis._toggle.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, SMALL_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\tthumb.minWidth = THUMB_MIN_WIDTH;\n\t\t\t\tthumb.minHeight = SMALL_THUMB_MIN_HEIGHT;\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._toggle.onTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(ON_TRACK_WIDTH, ON_TRACK_HEIGHT, 0xffff00);\n\t\t\t\tbutton.minWidth = ON_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = ON_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._toggle.offTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(OFF_TRACK_WIDTH, OFF_TRACK_HEIGHT, 0x00ffff);\n\t\t\t\tbutton.minWidth = OFF_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = OFF_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._toggle.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minWidth of the ToggleSwitch was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT when the track's minWidth is set.\",\n\t\t\t\tOFF_TRACK_MIN_WIDTH + THUMB_MIN_WIDTH / 2, this._toggle.minWidth);\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the ToggleSwitch was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT when the track's minHeight is set.\",\n\t\t\t\tOFF_TRACK_MIN_HEIGHT, this._toggle.minHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAutoSizeMinHeightWithTrackLayoutModeSplitAndLargerThumb():void\n\t\t{\n\t\t\tthis._toggle.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tthis._toggle.thumbFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar thumb:BasicButton = new BasicButton();\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, LARGE_THUMB_HEIGHT, 0xff00ff);\n\t\t\t\tthumb.minWidth = THUMB_MIN_WIDTH;\n\t\t\t\tthumb.minHeight = LARGE_THUMB_MIN_HEIGHT;\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tthis._toggle.onTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(ON_TRACK_WIDTH, ON_TRACK_HEIGHT, 0xffff00);\n\t\t\t\tbutton.minWidth = ON_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = ON_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._toggle.offTrackFactory = function():BasicButton\n\t\t\t{\n\t\t\t\tvar button:BasicButton = new BasicButton();\n\t\t\t\tbutton.defaultSkin = new Quad(OFF_TRACK_WIDTH, OFF_TRACK_HEIGHT, 0x00ffff);\n\t\t\t\tbutton.minWidth = OFF_TRACK_MIN_WIDTH;\n\t\t\t\tbutton.minHeight = OFF_TRACK_MIN_HEIGHT;\n\t\t\t\treturn button;\n\t\t\t};\n\t\t\tthis._toggle.validate();\n\t\t\tAssert.assertStrictlyEquals(\"The minHeight of the ToggleSwitch was not calculated correctly with trackLayoutMode set to TrackLayoutMode.SPLIT and larger thumb minHeight.\",\n\t\t\t\tLARGE_THUMB_MIN_HEIGHT, this._toggle.minHeight);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/ToggleSwitchTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Button;\n\timport feathers.controls.ToggleState;\n\timport feathers.controls.ToggleSwitch;\n\timport feathers.controls.TrackLayoutMode;\n\n\timport flash.geom.Point;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\tpublic class ToggleSwitchTests\n\t{\n\t\tprivate static const THUMB_NAME:String = \"thumb\";\n\t\tprivate static const TRACK_NAME:String = \"track\";\n\t\tprivate static const TRACK_WIDTH:Number = 50;\n\t\tprivate static const TRACK_HEIGHT:Number = 20;\n\t\tprivate static const THUMB_WIDTH:Number = 20;\n\t\tprivate static const THUMB_HEIGHT:Number = 20;\n\n\t\tprivate var _toggle:ToggleSwitch;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._toggle = new ToggleSwitch();\n\t\t\tthis._toggle.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tthis._toggle.onTrackFactory = function():Button\n\t\t\t{\n\t\t\t\tvar track:Button = new Button();\n\t\t\t\ttrack.name = TRACK_NAME;\n\t\t\t\ttrack.defaultSkin = new Quad(TRACK_WIDTH, TRACK_HEIGHT);\n\t\t\t\treturn track;\n\t\t\t};\n\t\t\tthis._toggle.thumbFactory = function():Button\n\t\t\t{\n\t\t\t\tvar thumb:Button = new Button();\n\t\t\t\tthumb.name = THUMB_NAME;\n\t\t\t\tthumb.defaultSkin = new Quad(THUMB_WIDTH, THUMB_HEIGHT, 0xff0000);\n\t\t\t\treturn thumb;\n\t\t\t};\n\t\t\tTestFeathers.starlingRoot.addChild(this._toggle);\n\t\t\tthis._toggle.validate();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._toggle.removeFromParent(true);\n\t\t\tthis._toggle = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testProgrammaticSelectionChange():void\n\t\t{\n\t\t\tthis._toggle.isSelected = false;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._toggle.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._toggle.isSelected = true;\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInteractiveSelectionChangeWithDraggingThumb():void\n\t\t{\n\t\t\tvar oldSelected:Boolean = false;\n\t\t\tthis._toggle.isSelected = oldSelected;\n\t\t\t//validate to position the thumb correctly.\n\t\t\tthis._toggle.validate();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._toggle.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(THUMB_WIDTH / 2, THUMB_HEIGHT / 2);\n\t\t\tvar target:DisplayObject = this._toggle.stage.hitTest(position);\n\n\t\t\tAssert.assertStrictlyEquals(\"The hit test did not return the toggle switch's thumb\",\n\t\t\t\tthis._toggle.getChildByName(THUMB_NAME).name, target.name);\n\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\ttouch.globalX = TRACK_WIDTH - THUMB_WIDTH / 2;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertFalse(\"The isSelected property was not changed\",\n\t\t\t\toldSelected === this._toggle.isSelected);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInteractiveSelectionChangeWithTapThumb():void\n\t\t{\n\t\t\tvar oldSelected:Boolean = false;\n\t\t\tthis._toggle.isSelected = oldSelected;\n\t\t\t//validate to position the thumb correctly.\n\t\t\tthis._toggle.validate();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._toggle.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(THUMB_WIDTH / 2, THUMB_HEIGHT / 2);\n\t\t\tvar target:DisplayObject = this._toggle.stage.hitTest(position);\n\n\t\t\tAssert.assertStrictlyEquals(\"The hit test did not return the toggle switch's thumb\",\n\t\t\t\tthis._toggle.getChildByName(THUMB_NAME).name, target.name);\n\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertFalse(\"The isSelected property was not changed\",\n\t\t\t\toldSelected === this._toggle.isSelected);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInteractiveSelectionChangeWithTapTrack():void\n\t\t{\n\t\t\tvar oldSelected:Boolean = false;\n\t\t\tthis._toggle.isSelected = oldSelected;\n\t\t\t//validate to position the thumb correctly.\n\t\t\tthis._toggle.validate();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._toggle.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(TRACK_WIDTH - THUMB_WIDTH / 2, THUMB_HEIGHT / 2);\n\t\t\tvar target:DisplayObject = this._toggle.stage.hitTest(position);\n\n\t\t\t//we don't care what is hit as long as its not the thumb\n\t\t\tAssert.assertTrue(\"The hit test did not return a display object contained by the toggle switch\",\n\t\t\t\tthis._toggle.contains(target));\n\t\t\tAssert.assertFalse(\"The hit test incorrectly returned the toggle switch's thumb\",\n\t\t\t\tthis._toggle.getChildByName(THUMB_NAME).name === target.name);\n\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertFalse(\"The isSelected property was not changed\",\n\t\t\t\toldSelected === this._toggle.isSelected);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testToggleSwitchDefaultsToToggleStateNotSelected():void\n\t\t{\n\t\t\tAssert.assertStrictlyEquals(\"ToggleSwitch currentState does not default to ToggleState.NOT_SELECTED\", ToggleState.NOT_SELECTED, this._toggle.currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testToggleSwitchDefaultsToToggleStateDisabledWhenIsEnabledIsFalse():void\n\t\t{\n\t\t\tthis._toggle.isEnabled = false;\n\t\t\tAssert.assertStrictlyEquals(\"ToggleSwitch currentState does not default to ToggleState.DISABLED when isEnabled is false\", ToggleState.DISABLED, this._toggle.currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testToggleSwitchDefaultsToToggleStateSelectedWhenIsSelectedIsTrue():void\n\t\t{\n\t\t\tthis._toggle.isSelected = true;\n\t\t\tAssert.assertStrictlyEquals(\"ToggleSwitch currentState does not default to ToggleState.DISABLED when isSelected is true\", ToggleState.SELECTED, this._toggle.currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testToggleSwitchDefaultsToToggleStateSelectedAndDisabledWhenIsEnabledIsFalseAndIsSelectedIsTrue():void\n\t\t{\n\t\t\tthis._toggle.isEnabled = false;\n\t\t\tthis._toggle.isSelected = true;\n\t\t\tAssert.assertStrictlyEquals(\"ToggleSwitch currentState does not default to ToggleState.SELECTED_AND_DISABLED when isEnabled is false and  isSelected is true\", ToggleState.SELECTED_AND_DISABLED, this._toggle.currentState);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/TokenListTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.core.TokenList;\n\n\timport org.flexunit.Assert;\n\n\tpublic class TokenListTests\n\t{\n\t\tprivate static const TOKEN1:String = \"token1\";\n\t\tprivate static const TOKEN2:String = \"token-two\";\n\t\tprivate static const FAKE_TOKEN:String = \"fake-token\";\n\t\tprivate static const EMPTY_STRING:String = \"\";\n\t\tprivate static const DELIMITER:String = \" \";\n\t\t\n\t\tprivate var _tokenList:TokenList;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._tokenList = new TokenList();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._tokenList = null;\n\t\t}\n\t\t\n\t\t[Test]\n\t\tpublic function testEmptyValue():void\n\t\t{\n\t\t\tAssert.assertStrictlyEquals(\"Empty TokenList value is not empty string with no tokens\", EMPTY_STRING, this._tokenList.value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testEmptyLength():void\n\t\t{\n\t\t\tAssert.assertStrictlyEquals(\"Empty TokenList length is not 0 with no tokens\", 0, this._tokenList.length);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testContainsWithoutAdding():void\n\t\t{\n\t\t\tAssert.assertFalse(\"TokenList contains() incorrectly returns true for a token that was not added\", this._tokenList.contains(FAKE_TOKEN));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testContainsAfterAdding():void\n\t\t{\n\t\t\tthis._tokenList.add(TOKEN1);\n\t\t\tAssert.assertTrue(\"TokenList contains() incorrectly returns false for a token that was added\", this._tokenList.contains(TOKEN1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testContainsAfterToggle():void\n\t\t{\n\t\t\tthis._tokenList.toggle(TOKEN1);\n\t\t\tAssert.assertTrue(\"TokenList contains() incorrectly returns false for a token that was toggled\", this._tokenList.contains(TOKEN1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testContainsAfterToggleTwice():void\n\t\t{\n\t\t\tthis._tokenList.toggle(TOKEN1);\n\t\t\tthis._tokenList.toggle(TOKEN1);\n\t\t\tAssert.assertFalse(\"TokenList contains() incorrectly returns true for a token that was toggled twice\", this._tokenList.contains(TOKEN1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testValueAfterAdding():void\n\t\t{\n\t\t\tthis._tokenList.add(TOKEN1);\n\t\t\tAssert.assertStrictlyEquals(\"TokenList value incorrect after adding one token\", TOKEN1, this._tokenList.value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLengthAfterAdding():void\n\t\t{\n\t\t\tthis._tokenList.add(TOKEN1);\n\t\t\tAssert.assertStrictlyEquals(\"TokenList value incorrect after adding one token\", 1, this._tokenList.length);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testItemAfterAdding():void\n\t\t{\n\t\t\tthis._tokenList.add(TOKEN1);\n\t\t\tAssert.assertStrictlyEquals(\"TokenList value incorrect after adding one token\", TOKEN1, this._tokenList.item(0));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testContainsAfterAddingAndRemoving():void\n\t\t{\n\t\t\tthis._tokenList.add(TOKEN1);\n\t\t\tthis._tokenList.remove(TOKEN1);\n\t\t\tAssert.assertFalse(\"TokenList contains() incorrectly returns true for a token that was added, then removed\", this._tokenList.contains(TOKEN1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testValueAfterAddingAndRemoving():void\n\t\t{\n\t\t\tthis._tokenList.add(TOKEN1);\n\t\t\tthis._tokenList.remove(TOKEN1);\n\t\t\tAssert.assertStrictlyEquals(\"TokenList value incorrect after removing a token\", EMPTY_STRING, this._tokenList.value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testValueAfterAddingTwoTokens():void\n\t\t{\n\t\t\tthis._tokenList.add(TOKEN1);\n\t\t\tthis._tokenList.add(TOKEN2);\n\t\t\tAssert.assertStrictlyEquals(\"TokenList value incorrect after adding two tokens\", TOKEN1 + DELIMITER + TOKEN2, this._tokenList.value);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testItemAfterAddingTwoTokens():void\n\t\t{\n\t\t\tthis._tokenList.add(TOKEN1);\n\t\t\tthis._tokenList.add(TOKEN2);\n\t\t\tAssert.assertStrictlyEquals(\"TokenList item(0) incorrect after adding two tokens\", TOKEN1, this._tokenList.item(0));\n\t\t\tAssert.assertStrictlyEquals(\"TokenList item(1) incorrect after adding two tokens\", TOKEN2, this._tokenList.item(1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLengthAfterAddingTwoTokens():void\n\t\t{\n\t\t\tthis._tokenList.add(TOKEN1);\n\t\t\tthis._tokenList.add(TOKEN2);\n\t\t\tAssert.assertStrictlyEquals(\"TokenList length incorrect after adding two tokens\", 2, this._tokenList.length);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testContainsAfterSettingValueWithOneToken():void\n\t\t{\n\t\t\tthis._tokenList.value = TOKEN1;\n\t\t\tAssert.assertTrue(\"TokenList contains() incorrectly returns false for a token that was set with value property\", this._tokenList.contains(TOKEN1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testContainsAfterSettingValueWithTwoTokens():void\n\t\t{\n\t\t\tthis._tokenList.value = TOKEN1 + DELIMITER + TOKEN2;\n\t\t\tAssert.assertTrue(\"TokenList contains() incorrectly returns false for the first token that was set with value property\", this._tokenList.contains(TOKEN1));\n\t\t\tAssert.assertTrue(\"TokenList contains() incorrectly returns false for the second token that was set with value property\", this._tokenList.contains(TOKEN2));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/TouchToStateTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.ButtonState;\n\timport feathers.utils.touch.TouchToState;\n\n\timport flash.geom.Point;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\n\timport starling.display.Quad;\n\timport starling.events.Touch;\n\timport starling.events.TouchEvent;\n\timport starling.events.TouchPhase;\n\n\tpublic class TouchToStateTests\n\t{\n\t\tprivate var _target:Quad;\n\t\tprivate var _blocker:Quad;\n\t\tprivate var _touchToState:TouchToState;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._target = new Quad(200, 200, 0xff00ff);\n\t\t\tTestFeathers.starlingRoot.addChild(this._target);\n\n\t\t\tthis._touchToState = new TouchToState(this._target);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._target.removeFromParent(true);\n\t\t\tthis._target = null;\n\n\t\t\tif(this._blocker)\n\t\t\t{\n\t\t\t\tthis._blocker.removeFromParent(true);\n\t\t\t\tthis._blocker = null;\n\t\t\t}\n\n\t\t\tthis._touchToState = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDownState():void\n\t\t{\n\t\t\tvar hasCalledCallback:Boolean = false;\n\t\t\tvar currentState:String = ButtonState.UP;\n\t\t\tthis._touchToState.callback = function(value:String):void\n\t\t\t{\n\t\t\t\tif(currentState === value)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\thasCalledCallback = true;\n\t\t\t\tcurrentState = value;\n\t\t\t};\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._target.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertTrue(\"TouchToState callback was not called on TouchPhase.BEGAN\",\n\t\t\t\thasCalledCallback);\n\t\t\tAssert.assertStrictlyEquals(\"TouchToState did not change state to ButtonState.DOWN on TouchPhase.BEGAN\",\n\t\t\t\tButtonState.DOWN, this._touchToState.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TouchToState did not pass the correct state to callback TouchPhase.BEGAN\",\n\t\t\t\tButtonState.DOWN, currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHoverState():void\n\t\t{\n\t\t\tvar hasCalledCallback:Boolean = false;\n\t\t\tvar currentState:String = ButtonState.UP;\n\t\t\tthis._touchToState.callback = function(value:String):void\n\t\t\t{\n\t\t\t\tif(currentState === value)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\thasCalledCallback = true;\n\t\t\t\tcurrentState = value;\n\t\t\t};\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._target.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.HOVER;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertTrue(\"TouchToState callback was not called on TouchPhase.HOVER\",\n\t\t\t\thasCalledCallback);\n\t\t\tAssert.assertStrictlyEquals(\"TouchToState did not change state to ButtonState.HOVER on TouchPhase.HOVER\",\n\t\t\t\tButtonState.HOVER, this._touchToState.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TouchToState did not pass the correct state to callback on TouchPhase.HOVER\",\n\t\t\t\tButtonState.HOVER, currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testUpStateAfterHoverEnd():void\n\t\t{\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._target.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.HOVER;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tvar hasCalledCallback:Boolean = false;\n\t\t\tvar currentState:String = ButtonState.HOVER;\n\t\t\tthis._touchToState.callback = function(value:String):void\n\t\t\t{\n\t\t\t\tif(currentState === value)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\thasCalledCallback = true;\n\t\t\t\tcurrentState = value;\n\t\t\t};\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, new <Touch>[]));\n\n\t\t\tAssert.assertTrue(\"TouchToState callback was not called on no touches\",\n\t\t\t\thasCalledCallback);\n\t\t\tAssert.assertStrictlyEquals(\"TouchToState did not change state to ButtonState.UP on no touches\",\n\t\t\t\tButtonState.UP, this._touchToState.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TouchToState did not pass the correct state to callback on TouchPhase.HOVER end\",\n\t\t\t\tButtonState.UP, currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testUpStateOnTouchEndedIfNoHoverBeforeBegan():void\n\t\t{\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._target.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.HOVER;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tvar hasCalledCallback:Boolean = false;\n\t\t\tvar currentState:String = ButtonState.DOWN;\n\t\t\tthis._touchToState.callback = function(value:String):void\n\t\t\t{\n\t\t\t\tif(currentState === value)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\thasCalledCallback = true;\n\t\t\t\tcurrentState = value;\n\t\t\t};\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertTrue(\"TouchToState callback was not called on TouchPhase.ENDED\",\n\t\t\t\thasCalledCallback);\n\t\t\tAssert.assertStrictlyEquals(\"TouchToState did not change state to ButtonState.UP on TouchPhase.ENDED\",\n\t\t\t\tButtonState.UP, this._touchToState.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TouchToState did not pass the correct state to callback on TouchPhase.ENDED\",\n\t\t\t\tButtonState.UP, currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testUpStateOnRemovedFromStage():void\n\t\t{\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._target.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tvar hasCalledCallback:Boolean = false;\n\t\t\tvar currentState:String = ButtonState.DOWN;\n\t\t\tthis._touchToState.callback = function(value:String):void\n\t\t\t{\n\t\t\t\tif(currentState === value)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\thasCalledCallback = true;\n\t\t\t\tcurrentState = value;\n\t\t\t};\n\t\t\tthis._target.removeFromParent(false);\n\n\t\t\tAssert.assertTrue(\"TouchToState callback was not called on removed from stage\",\n\t\t\t\thasCalledCallback);\n\t\t\tAssert.assertStrictlyEquals(\"TouchToState did not change state to ButtonState.UP on removed from stage\",\n\t\t\t\tButtonState.UP, this._touchToState.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TouchToState did not pass the correct state to callback on removed from stage\",\n\t\t\t\tButtonState.UP, currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testUpStateOnTouchPhaseMoveOutside():void\n\t\t{\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._target.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tvar hasCalledCallback:Boolean = false;\n\t\t\tvar currentState:String = ButtonState.DOWN;\n\t\t\tthis._touchToState.callback = function(value:String):void\n\t\t\t{\n\t\t\t\tif(currentState === value)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\thasCalledCallback = true;\n\t\t\t\tcurrentState = value;\n\t\t\t};\n\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\ttouch.globalX = 1000;\n\t\t\ttouch.globalY = position.y;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertTrue(\"TouchToState callback was not called on TouchPhase.MOVED outside\",\n\t\t\t\thasCalledCallback);\n\t\t\tAssert.assertStrictlyEquals(\"TouchToState did not change state to ButtonState.UP on TouchPhase.MOVED outside\",\n\t\t\t\tButtonState.UP, this._touchToState.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TouchToState did not pass the correct state to callback on TouchPhase.MOVED outside\",\n\t\t\t\tButtonState.UP, currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testUpStateOnTouchPhaseMoveOutsideAndBackIn():void\n\t\t{\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._target.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\ttouch.globalX = 1000;\n\t\t\ttouch.globalY = position.y;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tvar hasCalledCallback:Boolean = false;\n\t\t\tvar currentState:String = ButtonState.UP;\n\t\t\tthis._touchToState.callback = function(value:String):void\n\t\t\t{\n\t\t\t\tif(currentState === value)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\thasCalledCallback = true;\n\t\t\t\tcurrentState = value;\n\t\t\t};\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertTrue(\"TouchToState callback was not called on TouchPhase.MOVED outside and back in\",\n\t\t\t\thasCalledCallback);\n\t\t\tAssert.assertStrictlyEquals(\"TouchToState did not change state to ButtonState.DOWN on TouchPhase.MOVED outside and back in\",\n\t\t\t\tButtonState.DOWN, this._touchToState.currentState);\n\t\t\tAssert.assertStrictlyEquals(\"TouchToState did not pass the correct state to callback on TouchPhase.MOVED outside and back in\",\n\t\t\t\tButtonState.DOWN, currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDownStateOnTouchPhaseMoveOutsideAndKeepDownStateOnRollOut():void\n\t\t{\n\t\t\tthis._touchToState.keepDownStateOnRollOut = true;\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._target.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tvar hasCalledCallback:Boolean = false;\n\t\t\tvar currentState:String = ButtonState.DOWN;\n\t\t\tthis._touchToState.callback = function(value:String):void\n\t\t\t{\n\t\t\t\tif(currentState === value)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\thasCalledCallback = true;\n\t\t\t\tcurrentState = value;\n\t\t\t};\n\t\t\ttouch.phase = TouchPhase.MOVED;\n\t\t\ttouch.globalX = 1000;\n\t\t\ttouch.globalY = position.y;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertFalse(\"TouchToState callback must not be called on TouchPhase.MOVED outside when keepDownStateOnRollOut is true\",\n\t\t\t\thasCalledCallback);\n\t\t\tAssert.assertStrictlyEquals(\"TouchToState must not change state on TouchPhase.MOVED outside when keepDownStateOnRollOut is true\",\n\t\t\t\tButtonState.DOWN, this._touchToState.currentState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testHoverStateOnTouchEndedIfHoverBeforeBegan():void\n\t\t{\n\t\t\tvar position:Point = new Point(10, 10);\n\t\t\tvar target:DisplayObject = this._target.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.HOVER;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tvar currentState:String = ButtonState.DOWN;\n\t\t\tthis._touchToState.callback = function(value:String):void\n\t\t\t{\n\t\t\t\tif(currentState === value)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcurrentState = value;\n\t\t\t};\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\n\t\t\tAssert.assertStrictlyEquals(\"TouchToState must change state to ButtonState.HOVER on TouchPhase.ENDED if TouchPhase.HOVER is dispatched before TouchPhase.BEGAN\",\n\t\t\t\tButtonState.HOVER, this._touchToState.currentState);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/TreeFocusTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Tree;\n\timport feathers.controls.renderers.DefaultTreeItemRenderer;\n\timport feathers.core.FocusManager;\n\timport feathers.data.HierarchicalCollection;\n\n\timport flash.events.KeyboardEvent;\n\timport flash.ui.KeyLocation;\n\timport flash.ui.Keyboard;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\n\tpublic class TreeFocusTests\n\t{\n\t\tprivate var _list:Tree;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._list = new Tree();\n\t\t\tthis._list.dataProvider = new HierarchicalCollection(\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\tlabel: \"A\",\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: \"One\",\n\t\t\t\t\t\t\tchildren:\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t{label: \"I\"},\n\t\t\t\t\t\t\t\t{label: \"II\"},\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{label: \"Two\"},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: \"Three\",\n\t\t\t\t\t\t\tchildren:\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t{label: \"III\"},\n\t\t\t\t\t\t\t\t{label: \"IV\"},\n\t\t\t\t\t\t\t\t{label: \"V\"},\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: \"B\"\n\t\t\t\t},\n\t\t\t]);\n\t\t\tthis._list.itemRendererFactory = function():DefaultTreeItemRenderer\n\t\t\t{\n\t\t\t\tvar itemRenderer:DefaultTreeItemRenderer = new DefaultTreeItemRenderer();\n\t\t\t\titemRenderer.defaultSkin = new Quad(200, 200);\n\t\t\t\treturn itemRenderer;\n\t\t\t};\n\t\t\tTestFeathers.starlingRoot.addChild(this._list);\n\t\t\tthis._list.validate();\n\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, true);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._list.removeFromParent(true);\n\t\t\tthis._list = null;\n\n\t\t\tFocusManager.setEnabledForStage(TestFeathers.starlingRoot.stage, false);\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t\tAssert.assertFalse(\"FocusManager not disabled on cleanup.\", FocusManager.isEnabledForStage(TestFeathers.starlingRoot.stage));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoTriggerWhenNoSelectedItem():void\n\t\t{\n\t\t\tFocusManager.focus = this._list;\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tvar triggeredItem:Object = null;\n\t\t\tthis._list.addEventListener(Event.TRIGGERED, function(event:Event, item:Object):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t\ttriggeredItem = item;\n\t\t\t});\n\t\t\tthis._list.stage.starling.nativeStage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 32, Keyboard.SPACE, KeyLocation.STANDARD, false, false, false));\n\t\t\tthis._list.stage.starling.nativeStage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, true, false, 32, Keyboard.SPACE, KeyLocation.STANDARD, false, false, false));\n\t\t\tAssert.assertFalse(\"Event.TRIGGERED incorrectly dispatched when no item is selected\",\n\t\t\t\thasTriggered);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTriggered():void\n\t\t{\n\t\t\tthis._list.selectedLocation = new <int>[0, 2, 1];\n\t\t\tFocusManager.focus = this._list;\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tvar triggeredItem:Object = null;\n\t\t\tthis._list.addEventListener(Event.TRIGGERED, function(event:Event, item:Object):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t\ttriggeredItem = item;\n\t\t\t});\n\t\t\tthis._list.stage.starling.nativeStage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, 32, Keyboard.SPACE, KeyLocation.STANDARD, false, false, false));\n\t\t\tthis._list.stage.starling.nativeStage.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, true, false, 32, Keyboard.SPACE, KeyLocation.STANDARD, false, false, false));\n\t\t\tAssert.assertTrue(\"Event.TRIGGERED must be dispatched on KeyboardEvent.KEY_DOWN with Keyboard.SPACE key code\",\n\t\t\t\thasTriggered);\n\t\t\tAssert.assertStrictlyEquals(\"Incorrect item passed to Event.TRIGGERED listener\",\n\t\t\t\tthis._list.dataProvider.getItemAt(0, 2, 1), triggeredItem);\n\t\t}\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/TreeTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Tree;\n\timport feathers.controls.renderers.DefaultTreeItemRenderer;\n\timport starling.display.Quad;\n\timport feathers.data.ArrayHierarchicalCollection;\n\timport org.flexunit.Assert;\n\timport starling.events.Event;\n\timport flash.geom.Point;\n\timport starling.display.DisplayObject;\n\timport starling.events.Touch;\n\timport starling.events.TouchPhase;\n\timport starling.events.TouchEvent;\n\timport feathers.tests.supportClasses.AssertViewPortBoundsLayout;\n\n\tpublic class TreeTests\n\t{\n\t\tprivate var _tree:Tree;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._tree = new Tree();\n\t\t\tthis._tree.dataProvider = new ArrayHierarchicalCollection(\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\tlabel: \"A\",\n\t\t\t\t\tchildren:\n\t\t\t\t\t[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: \"One\",\n\t\t\t\t\t\t\tchildren:\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t{label: \"I\"},\n\t\t\t\t\t\t\t\t{label: \"II\"},\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{label: \"Two\"},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: \"Three\",\n\t\t\t\t\t\t\tchildren:\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t{label: \"III\"},\n\t\t\t\t\t\t\t\t{label: \"IV\"},\n\t\t\t\t\t\t\t\t{label: \"V\"},\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: \"B\"\n\t\t\t\t},\n\t\t\t]);\n\t\t\tthis._tree.itemRendererFactory = function():DefaultTreeItemRenderer\n\t\t\t{\n\t\t\t\tvar itemRenderer:DefaultTreeItemRenderer = new DefaultTreeItemRenderer();\n\t\t\t\titemRenderer.defaultSkin = new Quad(200, 200);\n\t\t\t\treturn itemRenderer;\n\t\t\t};\n\t\t\tTestFeathers.starlingRoot.addChild(this._tree);\n\t\t\tthis._tree.validate();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._tree.removeFromParent(true);\n\t\t\tthis._tree = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNullDataProvider():void\n\t\t{\n\t\t\tthis._tree.dataProvider = null;\n\t\t\tthis._tree.validate();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNullDataProviderWithTypicalItem():void\n\t\t{\n\t\t\tthis._tree.dataProvider = null;\n\t\t\tthis._tree.typicalItem = { label: \"Typical Item\" };\n\t\t\tthis._tree.validate();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testProgrammaticSelectedItemChange():void\n\t\t{\n\t\t\tvar beforeSelectedLocation:Vector.<int> = this._tree.selectedLocation;\n\t\t\tvar beforeSelectedItem:Object = this._tree.selectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._tree.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._tree.selectedItem = this._tree.dataProvider.getItemAt(0);\n\t\t\tAssert.assertTrue(\"Tree: Event.CHANGE was not dispatched on set selectedItem\", hasChanged);\n\t\t\tAssert.assertFalse(\"Tree: the selectedItem property was not changed\",\n\t\t\t\tbeforeSelectedItem === this._tree.selectedItem);\n\t\t\tAssert.assertStrictlyEquals(\"Tree: the selectedLocation property was not changed\",\n\t\t\t\t1, this._tree.selectedLocation.length);\n\t\t\tAssert.assertStrictlyEquals(\"Tree: the selectedLocation property was not changed\",\n\t\t\t\t0, this._tree.selectedLocation[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testProgrammaticSelectedLocationChange():void\n\t\t{\n\t\t\tvar beforeSelectedLocation:Vector.<int> = this._tree.selectedLocation;\n\t\t\tvar beforeSelectedItem:Object = this._tree.selectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._tree.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._tree.selectedLocation = new <int>[0];\n\t\t\tAssert.assertTrue(\"Tree: Event.CHANGE was not dispatched on set selectedItem\", hasChanged);\n\t\t\tAssert.assertFalse(\"Tree: the selectedItem property was not changed\",\n\t\t\t\tbeforeSelectedItem === this._tree.selectedItem);\n\t\t\tAssert.assertStrictlyEquals(\"Tree: the selectedLocation property was not changed\",\n\t\t\t\t1, this._tree.selectedLocation.length);\n\t\t\tAssert.assertStrictlyEquals(\"Tree: the selectedLocation property was not changed\",\n\t\t\t\t0, this._tree.selectedLocation[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInteractiveSelectionChange():void\n\t\t{\n\t\t\tvar beforeSelectedItem:Object = this._tree.selectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._tree.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 210);\n\t\t\tvar target:DisplayObject = this._tree.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t//this touch does not move at all, so it should result in triggering\n\t\t\t//the button.\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertTrue(\"Tree: Event.CHANGE was not dispatched on touch to change selection\", hasChanged);\n\t\t\tAssert.assertFalse(\"Tree: the selectedItem property was not changed\",\n\t\t\t\tbeforeSelectedItem === this._tree.selectedItem);\n\t\t\tAssert.assertStrictlyEquals(\"Tree: the selectedLocation property was not changed\",\n\t\t\t\t1, this._tree.selectedLocation.length);\n\t\t\tAssert.assertStrictlyEquals(\"Tree: the selectedLocation property was not changed\",\n\t\t\t\t1, this._tree.selectedLocation[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemAfterSelectedItem():void\n\t\t{\n\t\t\tvar beforeSelectedItem:Object = this._tree.dataProvider.getItemAt(1);\n\t\t\tthis._tree.selectedItem = beforeSelectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._tree.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._tree.dataProvider.removeItemAt(2);\n\t\t\tAssert.assertFalse(\"Tree: Event.CHANGE was incorrectly dispatched\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"Tree: the selectedItem property was incorrectly changed\",\n\t\t\t\tbeforeSelectedItem, this._tree.selectedItem);\n\t\t\tAssert.assertStrictlyEquals(\"Tree: the selectedLocation property was incorrectly changed\",\n\t\t\t\t1, this._tree.selectedLocation.length);\n\t\t\tAssert.assertStrictlyEquals(\"Tree: the selectedLocation property was incorrectly changed\",\n\t\t\t\t1, this._tree.selectedLocation[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveSelectedItem():void\n\t\t{\n\t\t\tvar beforeSelectedItem:Object = this._tree.dataProvider.getItemAt(1);\n\t\t\tthis._tree.selectedItem = beforeSelectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._tree.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._tree.dataProvider.removeItemAt(1);\n\t\t\tAssert.assertTrue(\"Tree: Event.CHANGE was not dispatched on remove selected item\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"Tree: the selectedItem property was not changed to null\",\n\t\t\t\tnull, this._tree.selectedItem);\n\t\t\tAssert.assertStrictlyEquals(\"Tree: the selectedLocation property was not changed to an empty vector\",\n\t\t\t\t0, this._tree.selectedLocation.length);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testReplaceSelectedItem():void\n\t\t{\n\t\t\tvar beforeSelectedItem:Object = this._tree.dataProvider.getItemAt(1);\n\t\t\tthis._tree.selectedItem = beforeSelectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._tree.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._tree.dataProvider.setItemAt({ label: \"New Item\" }, 1);\n\t\t\tAssert.assertTrue(\"Tree: Event.CHANGE was not dispatched on replace selected item\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"Tree: the selectedItem property was not changed to null\",\n\t\t\t\tnull, this._tree.selectedItem);\n\t\t\tAssert.assertStrictlyEquals(\"Tree: the selectedLocation property was not changed to an empty vector\",\n\t\t\t\t0, this._tree.selectedLocation.length);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDeselectAllOnNullDataProvider():void\n\t\t{\n\t\t\tvar beforeSelectedItem:Object = this._tree.dataProvider.getItemAt(1);\n\t\t\tthis._tree.selectedItem = beforeSelectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._tree.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._tree.dataProvider = null;\n\t\t\tAssert.assertTrue(\"Tree: Event.CHANGE was not dispatched on set dataProvider to null\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"Tree: the selectedItem property was not set to null\",\n\t\t\t\tnull, this._tree.selectedItem);\n\t\t\tAssert.assertStrictlyEquals(\"Tree: the selectedLocation property was not changed to an empty vector\",\n\t\t\t\t0, this._tree.selectedLocation.length);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDeselectAllOnDataProviderRemoveAll():void\n\t\t{\n\t\t\tvar beforeSelectedItem:Object = this._tree.dataProvider.getItemAt(1);\n\t\t\tthis._tree.selectedItem = beforeSelectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._tree.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._tree.dataProvider.removeAll();\n\t\t\tAssert.assertTrue(\"Tree: Event.CHANGE was not dispatched on dataProvider.removeAll()\", hasChanged);\n\t\t\tAssert.assertStrictlyEquals(\"Tree: the selectedItem property was not set to null\",\n\t\t\t\tnull, this._tree.selectedItem);\n\t\t\tAssert.assertStrictlyEquals(\"Tree: the selectedLocation property was not changed to an empty vector\",\n\t\t\t\t0, this._tree.selectedLocation.length);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDisposeWithoutChangeEvent():void\n\t\t{\n\t\t\tvar beforeSelectedItem:Object = this._tree.dataProvider.getItemAt(1);\n\t\t\tthis._tree.selectedItem = beforeSelectedItem;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._tree.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tthis._tree.dispose();\n\t\t\tAssert.assertFalse(\"Tree: Event.CHANGE was incorrectly dispatched on dispose()\", hasChanged);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testViewPortBoundsValues():void\n\t\t{\n\t\t\tthis._tree.layout = new AssertViewPortBoundsLayout();\n\t\t\tthis._tree.validate();\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTriggeredByTap():void\n\t\t{\n\t\t\tvar hasTriggered:Boolean = false;\n\t\t\tvar triggeredItem:Object = null;\n\t\t\tthis._tree.addEventListener(Event.TRIGGERED, function(event:Event, item:Object):void\n\t\t\t{\n\t\t\t\thasTriggered = true;\n\t\t\t\ttriggeredItem = item;\n\t\t\t});\n\t\t\tvar position:Point = new Point(10, 210);\n\t\t\tvar target:DisplayObject = this._tree.stage.hitTest(position);\n\t\t\tvar touch:Touch = new Touch(0);\n\t\t\ttouch.target = target;\n\t\t\ttouch.phase = TouchPhase.BEGAN;\n\t\t\ttouch.globalX = position.x;\n\t\t\ttouch.globalY = position.y;\n\t\t\tvar touches:Vector.<Touch> = new <Touch>[touch];\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\t//this touch does not move at all, so it should result in triggering\n\t\t\t//the button.\n\t\t\ttouch.phase = TouchPhase.ENDED;\n\t\t\ttarget.dispatchEvent(new TouchEvent(TouchEvent.TOUCH, touches));\n\t\t\tAssert.assertTrue(\"Event.TRIGGERED was not dispatched\", hasTriggered);\n\t\t\tAssert.assertStrictlyEquals(\"Incorrect item passed to Event.TRIGGERED listener\",\n\t\t\t\tthis._tree.dataProvider.getItemAt(1), triggeredItem);\n\t\t}\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/VectorCollectionTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.data.VectorCollection;\n\timport feathers.events.CollectionEventType;\n\n\timport org.flexunit.Assert;\n\n\timport starling.events.Event;\n\n\tpublic class VectorCollectionTests\n\t{\n\t\tprivate var _collection:VectorCollection;\n\t\tprivate var _a:Object;\n\t\tprivate var _b:Object;\n\t\tprivate var _c:Object;\n\t\tprivate var _d:Object;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._a = { label: \"One\", value: 0 };\n\t\t\tthis._b = { label: \"Two\", value: 2 };\n\t\t\tthis._c = { label: \"Three\", value: 3 };\n\t\t\tthis._d = { label: \"Four\", value: 1 };\n\t\t\tthis._collection = new VectorCollection(new <Object>\n\t\t\t[\n\t\t\t\tthis._a,\n\t\t\t\tthis._b,\n\t\t\t\tthis._c,\n\t\t\t\tthis._d,\n\t\t\t]);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._collection = null;\n\t\t}\n\n\t\tprivate function filterFunction(item:Object):Boolean\n\t\t{\n\t\t\tif(item === this._a || item === this._c)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tprivate function sortCompareFunction(a:Object, b:Object):int\n\t\t{\n\t\t\tvar valueA:Number = a.value as Number;\n\t\t\tvar valueB:Number = b.value as Number;\n\t\t\tif(valueA < valueB)\n\t\t\t{\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif(valueA > valueB)\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveAll():void\n\t\t{\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedAll:Boolean = false;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ALL, function(event:Event):void\n\t\t\t{\n\t\t\t\thasRemovedAll = true;\n\t\t\t});\n\t\t\tvar hasReset:Boolean = false;\n\t\t\tthis._collection.addEventListener(CollectionEventType.RESET, function(event:Event):void\n\t\t\t{\n\t\t\t\thasReset = true;\n\t\t\t});\n\t\t\tthis._collection.removeAll();\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\t//reset used to be dispatched, but REMOVE_ALL is better\n\t\t\tAssert.assertFalse(\"CollectionEventType.RESET was incorrectly dispatched\", hasReset);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REMOVE_ALL was not dispatched\", hasRemovedAll);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed to 0\",\n\t\t\t\t0, this._collection.length);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemAt():void\n\t\t{\n\t\t\tvar itemToRemove:Object = this._collection.getItemAt(1);\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.removeItemAt(expectedIndex);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed\",\n\t\t\t\toriginalLength - 1, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not removed\",\n\t\t\t\t-1, this._collection.getItemIndex(itemToRemove));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.REMOVE_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItem():void\n\t\t{\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar itemToRemove:Object = this._collection.getItemAt(expectedIndex);\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.removeItem(itemToRemove);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed\",\n\t\t\t\toriginalLength - 1, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not removed\",\n\t\t\t\t-1, this._collection.getItemIndex(itemToRemove));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.REMOVE_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testShift():void\n\t\t{\n\t\t\tvar itemToRemove:Object = this._collection.getItemAt(0);\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar expectedIndex:int = 0;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.shift();\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed\",\n\t\t\t\toriginalLength - 1, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not removed\",\n\t\t\t\t-1, this._collection.getItemIndex(itemToRemove));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.REMOVE_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPop():void\n\t\t{\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar itemToRemove:Object = this._collection.getItemAt(originalLength - 1);\n\t\t\tvar expectedIndex:int = originalLength - 1;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.pop();\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed\",\n\t\t\t\toriginalLength - 1, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not removed\",\n\t\t\t\t-1, this._collection.getItemIndex(itemToRemove));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.REMOVE_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItem():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar expectedIndex:int = originalLength;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.addItem(itemToAdd);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed\",\n\t\t\t\toriginalLength + 1, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not added at the correct index\",\n\t\t\t\texpectedIndex, this._collection.getItemIndex(itemToAdd));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.ADD_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemAt():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.addItemAt(itemToAdd, expectedIndex);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed\",\n\t\t\t\toriginalLength + 1, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not added at the correct index\",\n\t\t\t\texpectedIndex, this._collection.getItemIndex(itemToAdd));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.ADD_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testUnshift():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar expectedIndex:int = 0;\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.unshift(itemToAdd);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed\",\n\t\t\t\toriginalLength + 1, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not added at the correct index\",\n\t\t\t\texpectedIndex, this._collection.getItemIndex(itemToAdd));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.ADD_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPush():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar expectedIndex:int = originalLength;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.push(itemToAdd);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed\",\n\t\t\t\toriginalLength + 1, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not added at the correct index\",\n\t\t\t\texpectedIndex, this._collection.getItemIndex(itemToAdd));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.ADD_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemAt():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REPLACE_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.setItemAt(itemToAdd, expectedIndex);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REPLACE_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was incorrectly changed\",\n\t\t\t\toriginalLength, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not added at the correct index\",\n\t\t\t\texpectedIndex, this._collection.getItemIndex(itemToAdd));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.REPLACE_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testContainsWithItemInCollection():void\n\t\t{\n\t\t\tvar item:Object = this._collection.getItemAt(1);\n\t\t\tAssert.assertStrictlyEquals(\"contains() incorrectly returned false\",\n\t\t\t\ttrue, this._collection.contains(item));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testContainsWithItemNotInCollection():void\n\t\t{\n\t\t\tvar item:Object = {};\n\t\t\tAssert.assertStrictlyEquals(\"contains() incorrectly returned true\",\n\t\t\t\tfalse, this._collection.contains(item));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemIndexWithItemInCollection():void\n\t\t{\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar item:Object = this._collection.getItemAt(expectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"getItemIndex() returned the incorrect value\",\n\t\t\t\texpectedIndex, this._collection.getItemIndex(item));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemIndexWithItemNotInCollection():void\n\t\t{\n\t\t\tvar item:Object = {};\n\t\t\tAssert.assertStrictlyEquals(\"getItemIndex() returned the incorrect value\",\n\t\t\t\t-1, this._collection.getItemIndex(item));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDispose():void\n\t\t{\n\t\t\tvar itemCount:int = this._collection.length;\n\t\t\tvar disposedCount:int = 0;\n\t\t\tthis._collection.dispose(function(item:Object):void\n\t\t\t{\n\t\t\t\titem.isDisposed = true;\n\t\t\t\tdisposedCount++;\n\t\t\t});\n\t\t\tAssert.assertStrictlyEquals(\"Incorrect number of items disposed when calling dispose() on VectorCollection\",\n\t\t\t\titemCount, disposedCount);\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = this._collection.getItemAt(i);\n\t\t\t\tAssert.assertTrue(\"Item was not included when calling dispose() on VectorCollection\", item.isDisposed);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDisposeWithFilterFunction():void\n\t\t{\n\t\t\tvar itemCount:int = this._collection.length;\n\t\t\tthis._collection.filterFunction = function(item:Object):Boolean\n\t\t\t{\n\t\t\t\treturn item.label.charAt(0) === \"O\";\n\t\t\t};\n\t\t\tvar filteredCount:int = this._collection.length;\n\t\t\tAssert.assertFalse(\"Filtered collection length must change\", itemCount === filteredCount);\n\t\t\tvar disposedCount:int = 0;\n\t\t\tthis._collection.dispose(function(item:Object):void\n\t\t\t{\n\t\t\t\titem.isDisposed = true;\n\t\t\t\tdisposedCount++;\n\t\t\t});\n\t\t\tAssert.assertStrictlyEquals(\"Incorrect number of items disposed when calling dispose() on VectorCollection\",\n\t\t\t\titemCount, disposedCount);\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = this._collection.getItemAt(i);\n\t\t\t\tAssert.assertTrue(\"Item was not included when calling dispose() on VectorCollection\", item.isDisposed);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSortCompareFunction():void\n\t\t{\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: sortCompareFunction order is incorrect.\",\n\t\t\t\tthis._a, this._collection.getItemAt(0));\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: sortCompareFunction order is incorrect.\",\n\t\t\t\tthis._d, this._collection.getItemAt(1));\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: sortCompareFunction order is incorrect.\",\n\t\t\t\tthis._b, this._collection.getItemAt(2));\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: sortCompareFunction order is incorrect.\",\n\t\t\t\tthis._c, this._collection.getItemAt(3));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSortCompareFunctionAndFilterFunction():void\n\t\t{\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\tthis._collection.filterFunction = this.filterFunction;\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: sortCompareFunction and filterFunction length is incorrect.\",\n\t\t\t\t2, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: sortCompareFunction order is incorrect with filterFunction.\",\n\t\t\t\tthis._d, this._collection.getItemAt(0));\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: sortCompareFunction order is incorrect with filterFunction.\",\n\t\t\t\tthis._b, this._collection.getItemAt(1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetSortCompareFunctionToNull():void\n\t\t{\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\t//get an item so that we know the sorting was applied\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: sortCompareFunction order is incorrect.\",\n\t\t\t\tthis._c, this._collection.getItemAt(3));\n\n\t\t\tthis._collection.sortCompareFunction = null;\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: set sortCompareFunction to null order is incorrect.\",\n\t\t\t\tthis._a, this._collection.getItemAt(0));\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: set sortCompareFunction to null order is incorrect.\",\n\t\t\t\tthis._b, this._collection.getItemAt(1));\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: set sortCompareFunction to null order is incorrect.\",\n\t\t\t\tthis._c, this._collection.getItemAt(2));\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: set sortCompareFunction to null order is incorrect.\",\n\t\t\t\tthis._d, this._collection.getItemAt(3));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSortCompareFunctionWithAddItem():void\n\t\t{\n\t\t\tvar newItem:Object = { label: \"New Item\", value: 1.5 };\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\tthis._collection.addItem(newItem);\n\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: addItem() with sortCompareFunction does not add at correct sorted index.\",\n\t\t\t\tnewItem, this._collection.getItemAt(2));\n\n\t\t\tthis._collection.sortCompareFunction = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: addItem() with sortCompareFunction does not add at correct unsorted index.\",\n\t\t\t\tnewItem, this._collection.getItemAt(4));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSortCompareFunctionWithAddItemAt():void\n\t\t{\n\t\t\tvar newItem:Object = { label: \"New Item\", value: 1.5 };\n\t\t\tvar newIndex:int = 1;\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\tthis._collection.addItemAt(newItem, newIndex);\n\n\t\t\t//the index we passed in isn't necessarily the same while sorted\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: addItemAt() with sortCompareFunction does not add at correct sorted index.\",\n\t\t\t\tnewItem, this._collection.getItemAt(2));\n\n\t\t\tthis._collection.sortCompareFunction = null;\n\n\t\t\t//and it might not even be the same while unsorted!\n\t\t\t//that's because, in the unsorted data, it will be placed relative\n\t\t\t//to the item in the sorted data that was at the index passed to\n\t\t\t//addItemAt(). confusing, but it's consistent with setItemAt() and\n\t\t\t//filtered collections\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: addItemAt() with sortCompareFunction does not add at correct unsorted index.\",\n\t\t\t\tnewItem, this._collection.getItemAt(3));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSortCompareFunctionWithRemoveItemAt():void\n\t\t{\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\tthis._collection.removeItemAt(2);\n\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: removeItemAt() with sortCompareFunction removed incorrect item in sorted data.\",\n\t\t\t\tthis._a, this._collection.getItemAt(0));\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: removeItemAt() with sortCompareFunction removed incorrect item in sorted data.\",\n\t\t\t\tthis._d, this._collection.getItemAt(1));\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: removeItemAt() with sortCompareFunction removed incorrect item in sorted data.\",\n\t\t\t\tthis._c, this._collection.getItemAt(2));\n\n\t\t\tthis._collection.sortCompareFunction = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: removeItemAt() with sortCompareFunction removed incorrect item in unsorted data.\",\n\t\t\t\tthis._a, this._collection.getItemAt(0));\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: removeItemAt() with sortCompareFunction removed incorrect item in unsorted data.\",\n\t\t\t\tthis._c, this._collection.getItemAt(1));\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: removeItemAt() with sortCompareFunction removed incorrect item in unsorted data.\",\n\t\t\t\tthis._d, this._collection.getItemAt(2));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSortCompareFunctionWithRemoveItem():void\n\t\t{\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\tthis._collection.removeItem(this._b);\n\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: removeItem() with sortCompareFunction removed incorrect item in sorted data.\",\n\t\t\t\tthis._a, this._collection.getItemAt(0));\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: removeItem() with sortCompareFunction removed incorrect item in sorted data.\",\n\t\t\t\tthis._d, this._collection.getItemAt(1));\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: removeItem() with sortCompareFunction removed incorrect item in sorted data.\",\n\t\t\t\tthis._c, this._collection.getItemAt(2));\n\n\t\t\tthis._collection.sortCompareFunction = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: removeItem() with sortCompareFunction removed incorrect item in unsorted data.\",\n\t\t\t\tthis._a, this._collection.getItemAt(0));\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: removeItem() with sortCompareFunction removed incorrect item in unsorted data.\",\n\t\t\t\tthis._c, this._collection.getItemAt(1));\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: removeItem() with sortCompareFunction removed incorrect item in unsorted data.\",\n\t\t\t\tthis._d, this._collection.getItemAt(2));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSortCompareFunctionWithSetItemAt():void\n\t\t{\n\t\t\tvar newItem:Object = { label: \"New Item\", value: 1.5 };\n\t\t\tvar newIndex:int = 0;\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\tthis._collection.setItemAt(newItem, newIndex);\n\n\t\t\t//the index we passed in isn't necessarily the same while sorted\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: setItemAt() with sortCompareFunction does not add at correct sorted index.\",\n\t\t\t\tnewItem, this._collection.getItemAt(1));\n\t\t\tAssert.assertFalse(\"VectorCollection: setItemAt() with sortCompareFunction does not replace correct item.\",\n\t\t\t\tthis._collection.contains(this._a));\n\n\t\t\tthis._collection.sortCompareFunction = null;\n\n\t\t\t//however, that index should be the same when the collection is unsorted\n\t\t\tAssert.assertStrictlyEquals(\"VectorCollection: setItemAt() with sortCompareFunction does not add at correct unsorted index.\",\n\t\t\t\tnewItem, this._collection.getItemAt(newIndex));\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "test/source/feathers/tests/VectorHierarchicalCollectionTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.data.VectorHierarchicalCollection;\n\timport feathers.events.CollectionEventType;\n\n\timport org.flexunit.Assert;\n\n\timport starling.events.Event;\n\n\tpublic class VectorHierarchicalCollectionTests\n\t{\n\t\tprivate var _collection:VectorHierarchicalCollection;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._collection = new VectorHierarchicalCollection(new <Object>\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\tlabel: \"1\",\n\t\t\t\t\tchildren: new <Object>\n\t\t\t\t\t[\n\t\t\t\t\t\t{label: \"1-A\"},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: \"1-B\",\n\t\t\t\t\t\t\tchildren: new <Object>\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t{label: \"1-B-I\"},\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{label: \"1-C\"},\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: \"2\",\n\t\t\t\t\tchildren: new <Object>\n\t\t\t\t\t[\n\t\t\t\t\t\t{label: \"2-A\"},\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{ label: \"3\" },\n\t\t\t\t{\n\t\t\t\t\tlabel: \"4\",\n\t\t\t\t\tchildren: new <Object>\n\t\t\t\t\t[\n\t\t\t\t\t\t{label: \"4-A\"},\n\t\t\t\t\t\t{label: \"4-B\"},\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t]);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._collection = null;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetLength():void\n\t\t{\n\t\t\tvar length:int = this._collection.getLength();\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: getLengthAtLocation() returned incorrect length\",\n\t\t\t\t4, length);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetLengthNested():void\n\t\t{\n\t\t\tvar length:int = this._collection.getLength(3);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: getLengthAtLocation() returned incorrect length\",\n\t\t\t\t2, length);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetLengthAtLocationWithNull():void\n\t\t{\n\t\t\tvar length:int = this._collection.getLengthAtLocation();\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: getLengthAtLocation() returned incorrect length\",\n\t\t\t\t4, length);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemAt():void\n\t\t{\n\t\t\tvar item:Object = this._collection.getItemAt(1);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: getItemAt() returned incorrect item\",\n\t\t\t\tthis._collection.vectorData[1], item);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemAtNested():void\n\t\t{\n\t\t\tvar item:Object = this._collection.getItemAt(0, 1);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: getItemAt() returned incorrect item\",\n\t\t\t\tthis._collection.vectorData[0].children[1], item);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemAtLocation():void\n\t\t{\n\t\t\tvar indices:Vector.<int> = new <int>[1];\n\t\t\tvar item:Object = this._collection.getItemAtLocation(indices);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: getItemAtLocation() returned incorrect item\",\n\t\t\t\tthis._collection.vectorData[1], item);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemAtNestedLocation():void\n\t\t{\n\t\t\tvar indices:Vector.<int> = new <int>[0, 1];\n\t\t\tvar item:Object = this._collection.getItemAtLocation(indices);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: getItemAtLocation() returned incorrect item\",\n\t\t\t\tthis._collection.vectorData[0].children[1], item);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemAtNullLocation():void\n\t\t{\n\t\t\tvar item:Object = this._collection.getItemAtLocation(null);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: getItemAtLocation() returned incorrect item\",\n\t\t\t\tnull, item);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemAtEmptyLocation():void\n\t\t{\n\t\t\tvar indices:Vector.<int> = new <int>[];\n\t\t\tvar item:Object = this._collection.getItemAtLocation(indices);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: getItemAtLocation() returned incorrect item\",\n\t\t\t\tnull, item);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveAll():void\n\t\t{\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedAll:Boolean = false;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ALL, function(event:Event):void\n\t\t\t{\n\t\t\t\thasRemovedAll = true;\n\t\t\t});\n\t\t\tvar hasReset:Boolean = false;\n\t\t\tthis._collection.addEventListener(CollectionEventType.RESET, function(event:Event):void\n\t\t\t{\n\t\t\t\thasReset = true;\n\t\t\t});\n\t\t\tthis._collection.removeAll();\n\t\t\tAssert.assertTrue(\"VectorHierarchicalCollection: Event.CHANGE was not dispatched after removeAll()\", hasChanged);\n\t\t\tAssert.assertFalse(\"VectorHierarchicalCollection: CollectionEventType.RESET was incorrectly dispatched after removeAll()\", hasReset);\n\t\t\tAssert.assertTrue(\"VectorHierarchicalCollection: CollectionEventType.REMOVE_ALL was not dispatched after removeAll()\", hasRemovedAll);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: the getLength() value was not changed to 0 after removeAll()\",\n\t\t\t\t0, this._collection.getLength());\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemAtLocation():void\n\t\t{\n\t\t\tvar indicesToRemove:Vector.<int> = new <int>[1];\n\t\t\tvar itemToRemove:Object = this._collection.getItemAtLocation(indicesToRemove);\n\t\t\tvar originalLength:int = this._collection.getLength();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.removeItemAtLocation(indicesToRemove);\n\t\t\tAssert.assertTrue(\"VectorHierarchicalCollection: Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"VectorHierarchicalCollection: CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The getLength() value was not changed\",\n\t\t\t\toriginalLength - 1, this._collection.getLength());\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The item was not removed\",\n\t\t\t\t0, this._collection.getItemLocation(itemToRemove).length);\n\t\t\tAssert.failNull(\"VectorHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (length)\",\n\t\t\t\t1, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (value)\",\n\t\t\t\tindicesToRemove[0], indicesFromEvent[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemAtNestedLocation():void\n\t\t{\n\t\t\tvar indicesToRemove:Vector.<int> = new <int>[0, 1];\n\t\t\tvar itemToRemove:Object = this._collection.getItemAtLocation(indicesToRemove);\n\t\t\tvar originalParentLength:int = this._collection.getLength(indicesToRemove[0]);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.removeItemAtLocation(indicesToRemove);\n\t\t\tAssert.assertTrue(\"VectorHierarchicalCollection: Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"VectorHierarchicalCollection: CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The getLength() value was not changed\",\n\t\t\t\toriginalParentLength - 1, this._collection.getLength(indicesToRemove[0]));\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The item was not removed\",\n\t\t\t\t0, this._collection.getItemLocation(itemToRemove).length);\n\t\t\tAssert.failNull(\"VectorHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (length)\",\n\t\t\t\t2, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (value)\",\n\t\t\t\tindicesToRemove[0], indicesFromEvent[0]);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (value)\",\n\t\t\t\tindicesToRemove[1], indicesFromEvent[1]);\n\t\t}\n\n\t\t[Test(expects=\"RangeError\")]\n\t\tpublic function testRemoveItemAtNullLocation():void\n\t\t{\n\t\t\tthis._collection.removeItemAtLocation(null);\n\t\t}\n\n\t\t[Test(expects=\"RangeError\")]\n\t\tpublic function testRemoveItemAtEmptyLocation():void\n\t\t{\n\t\t\tvar indices:Vector.<int> = new <int>[];\n\t\t\tthis._collection.removeItemAtLocation(indices);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemAt():void\n\t\t{\n\t\t\tvar itemToRemove:Object = this._collection.getItemAt(1);\n\t\t\tvar originalLength:int = this._collection.getLength();\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.removeItemAt(expectedIndex);\n\t\t\tAssert.assertTrue(\"VectorHierarchicalCollection: Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"VectorHierarchicalCollection: CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The getLength() value was not changed\",\n\t\t\t\toriginalLength - 1, this._collection.getLength());\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The item was not removed\",\n\t\t\t\t0, this._collection.getItemLocation(itemToRemove).length);\n\t\t\tAssert.failNull(\"VectorHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (length)\",\n\t\t\t\t1, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (value)\",\n\t\t\t\t1, indicesFromEvent[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItem():void\n\t\t{\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar itemToRemove:Object = this._collection.getItemAt(expectedIndex);\n\t\t\tvar originalLength:int = this._collection.getLength();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.removeItem(itemToRemove);\n\t\t\tAssert.assertTrue(\"VectorHierarchicalCollection: Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"VectorHierarchicalCollection: CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The getLength() value was not changed\",\n\t\t\t\toriginalLength - 1, this._collection.getLength());\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The item was not removed\",\n\t\t\t\t0, this._collection.getItemLocation(itemToRemove).length);\n\t\t\tAssert.failNull(\"VectorHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (length)\",\n\t\t\t\t1, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (value)\",\n\t\t\t\t1, indicesFromEvent[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemAtLocation():void\n\t\t{\n\t\t\tvar location:Vector.<int> = new <int>[1];\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar originalLength:int = this._collection.getLength();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.addItemAtLocation(itemToAdd, location);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The getLength() value was not changed\",\n\t\t\t\toriginalLength + 1, this._collection.getLength());\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The item was not added\",\n\t\t\t\t1, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The item was not added at the correct index\",\n\t\t\t\tlocation[0], this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.failNull(\"VectorHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (length)\",\n\t\t\t\t1, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (value)\",\n\t\t\t\tlocation[0], indicesFromEvent[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemAtNestedLocation():void\n\t\t{\n\t\t\tvar location:Vector.<int> = new <int>[0, 1];\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar originalParentLength:int = this._collection.getLength(location[0]);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.addItemAtLocation(itemToAdd, location);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The getLength() value was not changed\",\n\t\t\t\toriginalParentLength + 1, this._collection.getLength(location[0]));\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The item was not added\",\n\t\t\t\t2, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The item was not added at the correct index\",\n\t\t\t\tlocation[0], this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The item was not added at the correct index\",\n\t\t\t\tlocation[1], this._collection.getItemLocation(itemToAdd)[1]);\n\t\t\tAssert.failNull(\"VectorHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (length)\",\n\t\t\t\t2, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (value)\",\n\t\t\t\tlocation[0], indicesFromEvent[0]);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (value)\",\n\t\t\t\tlocation[1], indicesFromEvent[1]);\n\t\t}\n\n\t\t[Test(expects=\"RangeError\")]\n\t\tpublic function testAddItemAtNullLocation():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tthis._collection.addItemAtLocation(itemToAdd, null);\n\t\t}\n\n\t\t[Test(expects=\"RangeError\")]\n\t\tpublic function testAddItemAtEmptyLocation():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar indices:Vector.<int> = new <int>[];\n\t\t\tthis._collection.addItemAtLocation(itemToAdd, indices);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemAt():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar originalLength:int = this._collection.getLength();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.addItemAt(itemToAdd, expectedIndex);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The getLength() value was not changed\",\n\t\t\t\toriginalLength + 1, this._collection.getLength());\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The item was not added\",\n\t\t\t\t1, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The item was not added at the correct index\",\n\t\t\t\texpectedIndex, this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.failNull(\"VectorHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (length)\",\n\t\t\t\t1, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (value)\",\n\t\t\t\t1, indicesFromEvent[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemAtNested():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar originalParentLength:int = this._collection.getLength(0);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.addItemAt(itemToAdd, 0, 1);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The getLength() value was not changed\",\n\t\t\t\toriginalParentLength + 1, this._collection.getLength(0));\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The item was not added\",\n\t\t\t\t2, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The item was not added at the correct index\",\n\t\t\t\t0, this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The item was not added at the correct index\",\n\t\t\t\t1, this._collection.getItemLocation(itemToAdd)[1]);\n\t\t\tAssert.failNull(\"VectorHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (length)\",\n\t\t\t\t2, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (value)\",\n\t\t\t\t0, indicesFromEvent[0]);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (value)\",\n\t\t\t\t1, indicesFromEvent[1]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemAt():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar originalLength:int = this._collection.getLength();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasReplacedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REPLACE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasReplacedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.setItemAt(itemToAdd, expectedIndex);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REPLACE_ITEM was not dispatched\", hasReplacedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was incorrectly changed\",\n\t\t\t\toriginalLength, this._collection.getLength());\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The item was not replaced\",\n\t\t\t\t1, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The item was not replaced at the correct index\",\n\t\t\t\texpectedIndex, this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.failNull(\"VectorHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (length)\",\n\t\t\t\t1, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (value)\",\n\t\t\t\t1, indicesFromEvent[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemAtNested():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar originalParentLength:int = this._collection.getLength(0);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasReplacedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REPLACE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasReplacedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.setItemAt(itemToAdd, 0, 1);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REPLACE_ITEM was not dispatched\", hasReplacedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was incorrectly changed\",\n\t\t\t\toriginalParentLength, this._collection.getLength(0));\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The item was not replaced\",\n\t\t\t\t2, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The item was not replaced at the correct index\",\n\t\t\t\t0, this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The item was not replaced at the correct index\",\n\t\t\t\t1, this._collection.getItemLocation(itemToAdd)[1]);\n\t\t\tAssert.failNull(\"VectorHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (length)\",\n\t\t\t\t2, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (value)\",\n\t\t\t\t0, indicesFromEvent[0]);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (value)\",\n\t\t\t\t1, indicesFromEvent[1]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemAtLocation():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar location:Vector.<int> = new <int>[1];\n\t\t\tvar originalLength:int = this._collection.getLength();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasReplacedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REPLACE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasReplacedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.setItemAtLocation(itemToAdd, location);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REPLACE_ITEM was not dispatched\", hasReplacedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was incorrectly changed\",\n\t\t\t\toriginalLength, this._collection.getLength());\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The item was not replaced\",\n\t\t\t\t1, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The item was not replaced at the correct index\",\n\t\t\t\tlocation[0], this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.failNull(\"VectorHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (length)\",\n\t\t\t\t1, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (value)\",\n\t\t\t\tlocation[0], indicesFromEvent[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemAtNestedLocation():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar location:Vector.<int> = new <int>[0, 1];\n\t\t\tvar originalParentLength:int = this._collection.getLength(location[0]);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasReplacedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REPLACE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasReplacedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.setItemAtLocation(itemToAdd, location);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REPLACE_ITEM was not dispatched\", hasReplacedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was incorrectly changed\",\n\t\t\t\toriginalParentLength, this._collection.getLength(location[0]));\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The item was not replaced\",\n\t\t\t\t2, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The item was not replaced at the correct index\",\n\t\t\t\tlocation[0], this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The item was not replaced at the correct index\",\n\t\t\t\tlocation[1], this._collection.getItemLocation(itemToAdd)[1]);\n\t\t\tAssert.failNull(\"VectorHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (length)\",\n\t\t\t\t2, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (value)\",\n\t\t\t\tlocation[0], indicesFromEvent[0]);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (value)\",\n\t\t\t\tlocation[1], indicesFromEvent[1]);\n\t\t}\n\n\t\t[Test(expects=\"RangeError\")]\n\t\tpublic function testSetItemAtNullLocation():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tthis._collection.setItemAtLocation(itemToAdd, null);\n\t\t}\n\n\t\t[Test(expects=\"RangeError\")]\n\t\tpublic function testSetItemAtEmptyLocation():void\n\t\t{\n\t\t\tvar itemToAdd:Object = { label: \"New Item\" };\n\t\t\tvar indices:Vector.<int> = new <int>[];\n\t\t\tthis._collection.setItemAtLocation(itemToAdd, indices);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemLocationWithItemInCollection():void\n\t\t{\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar item:Object = this._collection.getItemAt(expectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: getItemLocation() returned the incorrect location (length)\",\n\t\t\t\t1, this._collection.getItemLocation(item).length);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: getItemLocation() returned the incorrect location (value)\",\n\t\t\t\texpectedIndex, this._collection.getItemLocation(item)[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemLocationNestedWithItemInCollection():void\n\t\t{\n\t\t\tvar location:Vector.<int> = new <int>[0, 1];\n\t\t\tvar item:Object = this._collection.getItemAtLocation(location);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: getItemLocation() returned the incorrect location (length)\",\n\t\t\t\tlocation.length, this._collection.getItemLocation(item).length);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: getItemLocation() returned the incorrect location (value)\",\n\t\t\t\tlocation[0], this._collection.getItemLocation(item)[0]);\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: getItemLocation() returned the incorrect location (value)\",\n\t\t\t\tlocation[1], this._collection.getItemLocation(item)[1]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemLocationWithItemNotInCollection():void\n\t\t{\n\t\t\tvar item:Object = {};\n\t\t\tAssert.assertStrictlyEquals(\"VectorHierarchicalCollection: getItemLocation() returned the incorrect location (length)\",\n\t\t\t\t0, this._collection.getItemLocation(item).length);\n\t\t}\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/VerticalCenteredPopUpContentManagerTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.popups.VerticalCenteredPopUpContentManager;\n\timport feathers.core.PopUpManager;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\timport starling.display.Sprite;\n\timport starling.events.Event;\n\n\tpublic class VerticalCenteredPopUpContentManagerTests\n\t{\n\t\tprivate static const OVERLAY_NAME:String = \"VerticalCenteredPopUpContentManagerOverlay\";\n\t\t\n\t\tprivate var _popUp:DisplayObject;\n\t\tprivate var _customRoot:Sprite;\n\t\tprivate var _source:Quad;\n\t\tprivate var _popUpContentManager:VerticalCenteredPopUpContentManager;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._source = new Quad(200, 180, 0x00ff00);\n\t\t\tTestFeathers.starlingRoot.addChild(this._source);\n\n\t\t\tthis._customRoot = new Sprite();\n\t\t\tTestFeathers.starlingRoot.addChild(this._customRoot);\n\t\t\tPopUpManager.root = this._customRoot;\n\n\t\t\tthis._popUpContentManager = new VerticalCenteredPopUpContentManager();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._source.removeFromParent(true);\n\t\t\tthis._source = null;\n\n\t\t\tthis._customRoot.removeFromParent(true);\n\t\t\tthis._customRoot = null;\n\n\t\t\tif(this._popUp)\n\t\t\t{\n\t\t\t\tthis._popUp.removeFromParent(true);\n\t\t\t\tthis._popUp = null;\n\t\t\t}\n\t\t\t\n\t\t\tPopUpManager.root = TestFeathers.starlingRoot.stage;\n\n\t\t\tAssert.assertStrictlyEquals(\"Child not removed from Starling root on cleanup.\", 0, TestFeathers.starlingRoot.numChildren);\n\t\t}\n\n\t\tprivate function createSimplePopUp():DisplayObject\n\t\t{\n\t\t\tvar simplePopUp:Quad = new Quad(100, 150, 0xff00ff);\n\t\t\treturn simplePopUp;\n\t\t}\n\n\t\tprivate function createOverlay():DisplayObject\n\t\t{\n\t\t\tvar overlay:Quad = new Quad(1, 1, 0x000000);\n\t\t\toverlay.alpha = 0.5;\n\t\t\toverlay.name = OVERLAY_NAME;\n\t\t\treturn overlay;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testOpen():void\n\t\t{\n\t\t\tthis._popUp = this.createSimplePopUp();\n\t\t\tvar openDispatched:Boolean = false;\n\t\t\tthis._popUpContentManager.addEventListener(Event.OPEN, function(event:Event):void\n\t\t\t{\n\t\t\t\topenDispatched = true;\n\t\t\t});\n\t\t\tthis._popUpContentManager.open(this._popUp, this._source);\n\t\t\tAssert.assertNotNull(\"VerticalCenteredPopUpContentManager content parent should not be null.\", this._popUp.parent);\n\t\t\tAssert.assertTrue(\"VerticalCenteredPopUpContentManager did not dispatch Event.OPEN.\", openDispatched);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testClose():void\n\t\t{\n\t\t\tthis._popUp = this.createSimplePopUp();\n\t\t\tvar closeDispatched:Boolean = false;\n\t\t\tthis._popUpContentManager.addEventListener(Event.CLOSE, function(event:Event):void\n\t\t\t{\n\t\t\t\tcloseDispatched = true;\n\t\t\t});\n\t\t\tthis._popUpContentManager.open(this._popUp, this._source);\n\t\t\tthis._popUpContentManager.close();\n\t\t\tAssert.assertNull(\"VerticalCenteredPopUpContentManager content parent should be null.\", this._popUp.parent);\n\t\t\tAssert.assertTrue(\"VerticalCenteredPopUpContentManager did not dispatch Event.CLOSE.\", closeDispatched);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testOverlayFactory():void\n\t\t{\n\t\t\tthis._popUp = this.createSimplePopUp();\n\t\t\tthis._popUpContentManager.overlayFactory = this.createOverlay;\n\t\t\tthis._popUpContentManager.open(this._popUp, this._source);\n\t\t\tvar overlay:DisplayObject = this._customRoot.getChildByName(OVERLAY_NAME);\n\t\t\tAssert.assertNotNull(\"DropDownPopUpContentManager overlayFactory result not found.\", overlay);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/VerticalLayoutTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.controls.Label;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.layout.LayoutBoundsResult;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.layout.VerticalLayoutData;\n\timport feathers.layout.ViewPortBounds;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\n\tpublic class VerticalLayoutTests\n\t{\n\t\tprivate var _layout:VerticalLayout;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._layout = new VerticalLayout();\n\t\t\tthis._layout.useVirtualLayout = false;\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._layout = null;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoRuntimeErrorOnScrollBeyondStickyHeaderInLayout():void\n\t\t{\n\t\t\tthis._layout.headerIndices = new <int>[0];\n\t\t\tthis._layout.stickyHeader = true;\n\t\t\tvar item1:Quad = new Quad(200, 200);\n\t\t\tvar item2:Quad = new Quad(200, 200);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 640;\n\t\t\tbounds.explicitHeight = 640;\n\t\t\tbounds.scrollY = 100;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testNoRuntimeErrorOnScrollBeyondStickyHeaderInGetVisibleIndicesAtScrollPosition():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.headerIndices = new <int>[0];\n\t\t\tthis._layout.stickyHeader = true;\n\t\t\tthis._layout.hasVariableItemDimensions = true;\n\t\t\tvar item1:Quad = new Quad(200, 200);\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tthis._layout.getVisibleIndicesAtScrollPosition(0, 210, 640, 640, 2);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testVisibleIndicesOnScrollBeyondStickyHeader():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.headerIndices = new <int>[0, 20];\n\t\t\tthis._layout.stickyHeader = true;\n\t\t\tthis._layout.hasVariableItemDimensions = true;\n\t\t\tvar item1:Quad = new Quad(200, 200);\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tvar result:Vector.<int> = this._layout.getVisibleIndicesAtScrollPosition(0, 810, 640, 640, 30);\n\t\t\tAssert.assertTrue(\"getVisibleIndicesAtScrollPosition() does not return correct sticky header\", result.indexOf(0) == 0);\n\t\t\tAssert.assertTrue(\"getVisibleIndicesAtScrollPosition() returns incorrect sticky header\", result.indexOf(20) == -1);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentHeightWithOneItem():void\n\t\t{\n\t\t\tvar viewPortHeight:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar layoutData1:VerticalLayoutData = new VerticalLayoutData(NaN, 50);\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 640;\n\t\t\tbounds.explicitHeight = viewPortHeight;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayoutData with percentHeight results in incorrect item height\", viewPortHeight / 2, item1.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentHeightGreaterThan100WithOneItem():void\n\t\t{\n\t\t\tvar viewPortHeight:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar layoutData1:VerticalLayoutData = new VerticalLayoutData(NaN, 200);\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 640;\n\t\t\tbounds.explicitHeight = viewPortHeight;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayoutData with percentHeight > 100 not clamped to 100\", viewPortHeight, item1.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentHeightLessThan0WithOneItem():void\n\t\t{\n\t\t\tvar viewPortHeight:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar layoutData1:VerticalLayoutData = new VerticalLayoutData(NaN, -50);\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 640;\n\t\t\tbounds.explicitHeight = viewPortHeight;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayoutData with percentHeight < 0 not clamped to 0\", 0, item1.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentHeightWithTwoItems():void\n\t\t{\n\t\t\tvar viewPortHeight:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar item1Percent:Number = 50;\n\t\t\tvar layoutData1:VerticalLayoutData = new VerticalLayoutData(NaN, item1Percent);\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\tvar item2Percent:Number = 25;\n\t\t\tvar layoutData2:VerticalLayoutData = new VerticalLayoutData(NaN, item2Percent);\n\t\t\titem2.layoutData = layoutData2;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 640;\n\t\t\tbounds.explicitHeight = viewPortHeight;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayoutData with percentHeight results in incorrect item height for first item (of 2)\", viewPortHeight / (100 / item1Percent), item1.height);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayoutData with percentHeight results in incorrect item height for second item (of 2)\", viewPortHeight / (100 / item2Percent), item2.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentHeightGreaterThan100WithTwoItems():void\n\t\t{\n\t\t\tvar viewPortHeight:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar item1Percent:Number = 100;\n\t\t\tvar layoutData1:VerticalLayoutData = new VerticalLayoutData(NaN, item1Percent);\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\tvar item2Percent:Number = 150;\n\t\t\tvar layoutData2:VerticalLayoutData = new VerticalLayoutData(NaN, item2Percent);\n\t\t\titem2.layoutData = layoutData2;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 640;\n\t\t\tbounds.explicitHeight = viewPortHeight;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tvar totalPercent:Number = item1Percent + item2Percent;\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayoutData with percentHeight > 100 results in incorrect item height for first item (of 2)\", viewPortHeight / (totalPercent / item1Percent), item1.height);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayoutData with percentHeight > 100 results in incorrect item height for second item (of 2)\", viewPortHeight / (totalPercent / item2Percent), item2.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentWidth():void\n\t\t{\n\t\t\tvar viewPortWidth:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar layoutData1:VerticalLayoutData = new VerticalLayoutData(50);\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = viewPortWidth;\n\t\t\tbounds.explicitHeight = 640;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayoutData with percentWidth results in incorrect item width\", viewPortWidth / 2, item1.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentWidthGreaterThan100():void\n\t\t{\n\t\t\tvar viewPortWidth:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar layoutData1:VerticalLayoutData = new VerticalLayoutData(150);\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = viewPortWidth;\n\t\t\tbounds.explicitHeight = 640;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayoutData with percentWidth > 100 does not clamp to 100\", viewPortWidth, item1.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentWidthLessThan0():void\n\t\t{\n\t\t\tvar viewPortWidth:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar layoutData1:VerticalLayoutData = new VerticalLayoutData(-50);\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = viewPortWidth;\n\t\t\tbounds.explicitHeight = 640;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayoutData with percentWidth < 0 does not clamp to 0\", 0, item1.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentWidthWithWrappingLabelAndMaxWidth():void\n\t\t{\n\t\t\tvar viewPortMaxWidth:Number = 100;\n\t\t\tvar item1:Label = new Label();\n\t\t\titem1.text = \"I am the very model of a modern Major General\";\n\t\t\titem1.wordWrap = true;\n\t\t\titem1.validate();\n\t\t\tvar unwrappedWidth:Number = item1.width;\n\t\t\tvar unwrappedHeight:Number = item1.height;\n\t\t\tvar layoutData1:VerticalLayoutData = new VerticalLayoutData();\n\t\t\tlayoutData1.percentWidth = 100;\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.maxWidth = viewPortMaxWidth;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\t//since we're setting maxWidth, the width may actually be smaller\n\t\t\tAssert.assertTrue(\"VerticalLayoutData with percentWidth with a wrapping Label results in incorrect width\",\n\t\t\t\tviewPortMaxWidth >= item1.width);\n\t\t\t//we're only checking that it has more than one line\n\t\t\tAssert.assertTrue(\"VerticalLayoutData with percentWidth on a wrapping Label results in height that is too small\",\n\t\t\t\tunwrappedHeight < item1.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentWidthWithExplicitMinWidth():void\n\t\t{\n\t\t\tvar viewPortWidth:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.minWidth = 400;\n\t\t\tvar layoutData1:VerticalLayoutData = new VerticalLayoutData(50, NaN);\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = viewPortWidth;\n\t\t\tbounds.explicitHeight = 640;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayoutData with percentWidth and larger item explicitMinWidth results in incorrect item width\",\n\t\t\t\t400, item1.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentHeightWithExplicitMinHeight():void\n\t\t{\n\t\t\tvar viewPortHeight:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.minHeight = 400;\n\t\t\tvar layoutData1:VerticalLayoutData = new VerticalLayoutData(NaN, 50);\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 640;\n\t\t\tbounds.explicitHeight = viewPortHeight;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayoutData with percentHeight and larger item explicitMinHeight results in incorrect item height\",\n\t\t\t\t400, item1.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPercentWidthWithExplicitMaxWidth():void\n\t\t{\n\t\t\tvar viewPortWidth:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.maxWidth = 250;\n\t\t\tvar layoutData1:VerticalLayoutData = new VerticalLayoutData(50, NaN);\n\t\t\titem1.layoutData = layoutData1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = viewPortWidth;\n\t\t\tbounds.explicitHeight = 640;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayoutData with percentWidth and smaller item explicitMaxWidth results in incorrect item width\",\n\t\t\t\t250, item1.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDistributeHeights():void\n\t\t{\n\t\t\tthis._layout.distributeHeights = true;\n\t\t\tvar viewPortHeight:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 640;\n\t\t\tbounds.explicitHeight = viewPortHeight;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tvar itemHeight:Number = viewPortHeight / items.length;\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with distributeHeights results in wrong item height\",\n\t\t\t\titemHeight, item1.height);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with distributeHeights results in wrong item height\",\n\t\t\t\titemHeight, item2.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDistributeHeightsWithIncludeInLayoutFalse():void\n\t\t{\n\t\t\tthis._layout.distributeHeights = true;\n\t\t\tvar viewPortHeight:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\titem2.includeInLayout = false;\n\t\t\tvar item3:LayoutGroup = new LayoutGroup();\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2, item3];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 640;\n\t\t\tbounds.explicitHeight = viewPortHeight;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tvar itemHeight:Number = viewPortHeight / (items.length - 1);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with distributeHeights and an item with includeInLayout set to false results in wrong item height\",\n\t\t\t\titemHeight, item1.height);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with distributeHeights and an item with includeInLayout set to false results in wrong item height\",\n\t\t\t\t0, item2.height);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with distributeHeights and an item with includeInLayout set to false results in wrong item height\",\n\t\t\t\titemHeight, item3.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDistributeHeightsWithLargerItemHeights():void\n\t\t{\n\t\t\tthis._layout.distributeHeights = true;\n\t\t\tvar viewPortHeight:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.height = 720;\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\titem2.height = 800;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 640;\n\t\t\tbounds.explicitHeight = viewPortHeight;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tvar itemHeight:Number = viewPortHeight / items.length;\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with distributeHeights with larger item heights results in wrong item height\",\n\t\t\t\titemHeight, item1.height);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with distributeHeights with larger item heights results in wrong item height\",\n\t\t\t\titemHeight, item2.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDistributeHeightsWithoutExplicitHeight():void\n\t\t{\n\t\t\tthis._layout.distributeHeights = true;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.height = 480;\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\titem2.height = 640;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tthis._layout.layout(items, new ViewPortBounds());\n\t\t\tvar largerHeight:Number = Math.max(item1.height, item2.height);\n\t\t\tvar itemHeight:Number = largerHeight * items.length;\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with distributeHeights and no explicit height results in wrong item height\",\n\t\t\t\titemHeight, item1.height);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with distributeHeights and no explicit height results in wrong item height\",\n\t\t\t\titemHeight, item2.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDistributeHeightsWithUseVirtualLayout():void\n\t\t{\n\t\t\tthis._layout.distributeHeights = true;\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tvar viewPortHeight:Number = 640;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 640;\n\t\t\tbounds.explicitHeight = viewPortHeight;\n\t\t\tthis._layout.layout(items, bounds);\n\t\t\tvar itemHeight:Number = viewPortHeight / items.length;\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with distributeHeights and useVirtualLayout results in wrong item height\",\n\t\t\t\titemHeight, item1.height);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with distributeHeights and useVirtualLayout results in wrong item height\",\n\t\t\t\titemHeight, item2.height);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSmallerMaxRowCount():void\n\t\t{\n\t\t\tthis._layout.maxRowCount = 2;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.setSize(100, 100);\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\titem2.setSize(100, 100);\n\t\t\tvar item3:LayoutGroup = new LayoutGroup();\n\t\t\titem3.setSize(100, 100);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2, item3];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with smaller maxRowCount results in wrong view port height\",\n\t\t\t\t200, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with smaller maxRowCount results in wrong content height\",\n\t\t\t\t300, result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSmallerMaxRowCountAndUseVirtualLayout():void\n\t\t{\n\t\t\tthis._layout.maxRowCount = 2;\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.setSize(100, 100);\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\titem2.setSize(100, 100);\n\t\t\tvar item3:LayoutGroup = new LayoutGroup();\n\t\t\titem3.setSize(100, 100);\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2, item3];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with smaller maxRowCount and useVirtualLayout results in wrong view port height\",\n\t\t\t\t200, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with smaller maxRowCount and useVirtualLayout results in wrong content height\",\n\t\t\t\t300, result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLargerMaxRowCount():void\n\t\t{\n\t\t\tthis._layout.maxRowCount = 4;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.setSize(100, 100);\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\titem2.setSize(100, 100);\n\t\t\tvar item3:LayoutGroup = new LayoutGroup();\n\t\t\titem3.setSize(100, 100);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2, item3];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with larger maxRowCount results in wrong view port height\",\n\t\t\t\t300, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with larger maxRowCount results in wrong content height\",\n\t\t\t\t300, result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLargerMaxRowCountAndUseVirtualLayout():void\n\t\t{\n\t\t\tthis._layout.maxRowCount = 4;\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.setSize(100, 100);\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\titem2.setSize(100, 100);\n\t\t\tvar item3:LayoutGroup = new LayoutGroup();\n\t\t\titem3.setSize(100, 100);\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2, item3];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with larger maxRowCount and useVirtualLayout results in wrong view port height\",\n\t\t\t\t300, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with larger maxRowCount and useVirtualLayout results in wrong content height\",\n\t\t\t\t300, result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRequestedRowCountWithZeroItems():void\n\t\t{\n\t\t\tthis._layout.requestedRowCount = 3;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with requestedRowCount and zero items results in wrong view port height\",\n\t\t\t\t0, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with requestedRowCount and zero items results in wrong content height\",\n\t\t\t\t0, result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSmallerRequestedRowCount():void\n\t\t{\n\t\t\tthis._layout.requestedRowCount = 2;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.setSize(100, 100);\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\titem2.setSize(100, 100);\n\t\t\tvar item3:LayoutGroup = new LayoutGroup();\n\t\t\titem3.setSize(100, 100);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2, item3];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with smaller requestedRowCount results in wrong view port height\",\n\t\t\t\t200, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with smaller requestedRowCount results in wrong content height\",\n\t\t\t\t300, result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSmallerRequestedRowCountAndUseVirtualLayout():void\n\t\t{\n\t\t\tthis._layout.requestedRowCount = 2;\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.setSize(100, 100);\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\titem2.setSize(100, 100);\n\t\t\tvar item3:LayoutGroup = new LayoutGroup();\n\t\t\titem3.setSize(100, 100);\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2, item3];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with smaller requestedRowCount and useVirtualLayout results in wrong view port height\",\n\t\t\t\t200, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with smaller requestedRowCount and useVirtualLayout results in wrong content height\",\n\t\t\t\t300, result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLargerRequestedRowCount():void\n\t\t{\n\t\t\tthis._layout.requestedRowCount = 4;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.setSize(100, 100);\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\titem2.setSize(100, 100);\n\t\t\tvar item3:LayoutGroup = new LayoutGroup();\n\t\t\titem3.setSize(100, 100);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2, item3];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with larger requestedRowCount results in wrong view port height\",\n\t\t\t\t400, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with larger requestedRowCount results in wrong content height\",\n\t\t\t\t300, result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testLargerRequestedRowCountAndUseVirtualLayout():void\n\t\t{\n\t\t\tthis._layout.requestedRowCount = 4;\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.setSize(100, 100);\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\titem2.setSize(100, 100);\n\t\t\tvar item3:LayoutGroup = new LayoutGroup();\n\t\t\titem3.setSize(100, 100);\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2, item3];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with larger requestedRowCount and useVirtualLayout results in wrong view port height\",\n\t\t\t\t400, result.viewPortHeight);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with larger requestedRowCount and useVirtualLayout results in wrong content height\",\n\t\t\t\t300, result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChildWithCalculatedMinWidthAndPercentWidth():void\n\t\t{\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.layoutData = new VerticalLayoutData(100, 100);\n\t\t\tvar child:Quad = new Quad(100, 100, 0xff00ff);\n\t\t\titem1.addChild(child);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout without explicit view port width and child with percentWidth and calculated minWidth results in wrong view port width\",\n\t\t\t\t100, result.viewPortWidth);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChildWithExplicitMinWidthAndPercentWidth():void\n\t\t{\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.layoutData = new VerticalLayoutData(100, 100);\n\t\t\tvar child:Quad = new Quad(100, 100, 0xff00ff);\n\t\t\titem1.minWidth = 200;\n\t\t\titem1.addChild(child);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout without explicit view port width and child with percentWidth and explicit minWidth results in wrong view port width\",\n\t\t\t\t200, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout without explicit view port width and child with percentWidth and explicit minWidth results in wrong child width\",\n\t\t\t\t200, item1.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChildWithCalculatedMinWidthAndPercentWidthWithExplicitWidth():void\n\t\t{\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.layoutData = new VerticalLayoutData(100, 100);\n\t\t\tvar child:Quad = new Quad(100, 100, 0xff00ff);\n\t\t\titem1.addChild(child);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitWidth = 50;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with explicit view port width and child with percentWidth and calculated minWidth results in wrong view port width\",\n\t\t\t\t50, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with explicit view port width and child with percentWidth and calculated minWidth results in wrong child width\",\n\t\t\t\t50, item1.width);\n\t\t}\n\n\n\t\t[Test]\n\t\tpublic function testChildWithCalculatedMinWidthAndPercentWidthWithViewPortMinWidth():void\n\t\t{\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.layoutData = new VerticalLayoutData(100, 100);\n\t\t\tvar child:Quad = new Quad(100, 100, 0xff00ff);\n\t\t\titem1.addChild(child);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.minWidth = 10;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with explicit view port minWidth and child with percentWidth and calculated minWidth results in wrong view port width\",\n\t\t\t\t100, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout with explicit view port minWidth and child with percentWidth and calculated minWidth results in wrong child width\",\n\t\t\t\t100, item1.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testChildWithCalculatedWidthAndSmallerCalculatedMinWidthAndPercentWidth():void\n\t\t{\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.layoutData = new VerticalLayoutData(100, 100);\n\t\t\tvar child:LayoutGroup = new LayoutGroup();\n\t\t\tchild.width = 100;\n\t\t\tchild.height = 100;\n\t\t\tchild.minWidth = 50;\n\t\t\tchild.minHeight = 50;\n\t\t\titem1.backgroundSkin = child;\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout without explicit view port width and child with percentWidth, calculated width, and calculated minWidth results in wrong view port width\",\n\t\t\t\t100, result.viewPortWidth);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout without explicit view port width and child with percentWidth, calculated width, and calculated minWidth results in wrong child width\",\n\t\t\t\t100, item1.width);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testTypicalItemExplicitHeightWithoutHasVariableItemDimensions():void\n\t\t{\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.hasVariableItemDimensions = false;\n\n\t\t\tvar item1:LayoutGroup = new LayoutGroup();\n\t\t\titem1.backgroundSkin = new Quad(100, 200);\n\n\t\t\tvar item2:LayoutGroup = new LayoutGroup();\n\t\t\titem2.backgroundSkin = new Quad(150, 50);\n\n\t\t\tthis._layout.typicalItem = item1;\n\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertTrue(\"VerticalLayout: typicalItem explicitHeight must be NaN when useVirtualLayout is true and hasVariableItemDimensions is false so that it can resize later\",\n\t\t\t\tisNaN(item1.explicitHeight));\n\t\t\tAssert.assertStrictlyEquals(\"VerticalLayout: item explicitHeight must be equal to typicalItem height when useVirtualLayout is true and hasVariableItemDimensions is false\",\n\t\t\t\titem1.height, item2.explicitHeight);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/VerticalSpinnerLayoutTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.layout.LayoutBoundsResult;\n\timport feathers.layout.VerticalSpinnerLayout;\n\timport feathers.layout.ViewPortBounds;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Quad;\n\n\tpublic class VerticalSpinnerLayoutTests\n\t{\n\t\tprivate var _layout:VerticalSpinnerLayout;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._layout = new VerticalSpinnerLayout();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._layout = null;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMinimumAndMaximumScrollPositionsWhenRepeatItemsIsTrue():void\n\t\t{\n\t\t\tthis._layout.repeatItems = true;\n\t\t\tvar item1:Quad = new Quad(200, 200);\n\t\t\tvar item2:Quad = new Quad(200, 200);\n\t\t\tvar item3:Quad = new Quad(200, 200);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2, item3];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitHeight = 200;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalSpinnerLayout layout() LayoutBoundsResult contentY not equal to Number.NEGATIVE_INFINITY when repeatItems is true and the total item height is larger than the view port height\", Number.NEGATIVE_INFINITY, result.contentY);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalSpinnerLayout layout() LayoutBoundsResult contentHeight not equal to Number.POSITIVE_INFINITY when repeatItems is true and the total item height is larger than the view port height\", Number.POSITIVE_INFINITY, result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testMinimumAndMaximumScrollPositionsWhenRepeatItemsIsFalse():void\n\t\t{\n\t\t\tvar itemSize:Number = 200;\n\t\t\tthis._layout.repeatItems = false;\n\t\t\tvar item1:Quad = new Quad(itemSize, itemSize);\n\t\t\tvar item2:Quad = new Quad(itemSize, itemSize);\n\t\t\tvar item3:Quad = new Quad(itemSize, itemSize);\n\t\t\tvar items:Vector.<DisplayObject> = new <DisplayObject>[item1, item2, item3];\n\t\t\tvar bounds:ViewPortBounds = new ViewPortBounds();\n\t\t\tbounds.explicitHeight = 200;\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tvar result:LayoutBoundsResult = this._layout.layout(items, bounds);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalSpinnerLayout layout() LayoutBoundsResult contentY not equal to 0 when repeatItems is false and the total item height is larger than the view port height\", 0, result.contentY);\n\t\t\tAssert.assertStrictlyEquals(\"VerticalSpinnerLayout layout() LayoutBoundsResult contentHeight not equal to total height of items minus view port height when repeatItems is false and the total item height is larger than the view port height\", items.length * itemSize, result.contentHeight);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testVisibleIndicesWithOneItemVisibleAndRepeatingWithGap():void\n\t\t{\n\t\t\t//Github issue #1257\n\t\t\tvar itemSize:Number = 256;\n\t\t\tvar gap:Number = 64;\n\t\t\tthis._layout.useVirtualLayout = true;\n\t\t\tthis._layout.gap = gap;\n\t\t\tthis._layout.requestedRowCount = 1;\n\t\t\tvar item1:Quad = new Quad(itemSize, itemSize);\n\t\t\tthis._layout.typicalItem = item1;\n\t\t\tvar result:Vector.<int> = this._layout.getVisibleIndicesAtScrollPosition(0, (itemSize + gap) * 9.8, 320, 320, 5);\n\t\t\tAssert.assertTrue(\"VerticalSpinnerLayout getVisibleIndicesAtScrollPosition() does not contain and index that should be visible\", result.indexOf(4) >= 0)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/XMLListCollectionTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.data.XMLListCollection;\n\timport feathers.data.ListCollection;\n\timport feathers.events.CollectionEventType;\n\n\timport org.flexunit.Assert;\n\n\timport starling.events.Event;\n\n\tpublic class XMLListCollectionTests\n\t{\n\t\tprivate var _collection:XMLListCollection;\n\t\tprivate var _a:XML;\n\t\tprivate var _b:XML;\n\t\tprivate var _c:XML;\n\t\tprivate var _d:XML;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._a = <item label=\"One\" value=\"0\"/>;\n\t\t\tthis._b = <item label=\"Two\" value=\"2\"/>;\n\t\t\tthis._c = <item label=\"Three\" value=\"3\"/>;\n\t\t\tthis._d = <item label=\"Four\" value=\"1\"/>;\n\t\t\tvar xml:XML = <items/>;\n\t\t\txml.appendChild(this._a);\n\t\t\txml.appendChild(this._b);\n\t\t\txml.appendChild(this._c);\n\t\t\txml.appendChild(this._d);\n\t\t\tthis._collection = new XMLListCollection(xml.elements());\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._collection = null;\n\t\t}\n\n\t\tprivate function filterFunction(item:Object):Boolean\n\t\t{\n\t\t\tif(item === this._a || item === this._c)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tprivate function sortCompareFunction(a:Object, b:Object):int\n\t\t{\n\t\t\tvar valueA:Number = parseFloat(a.@value.toString());\n\t\t\tvar valueB:Number = parseFloat(b.@value.toString());\n\t\t\tif(valueA < valueB)\n\t\t\t{\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif(valueA > valueB)\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveAll():void\n\t\t{\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedAll:Boolean = false;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ALL, function(event:Event):void\n\t\t\t{\n\t\t\t\thasRemovedAll = true;\n\t\t\t});\n\t\t\tvar hasReset:Boolean = false;\n\t\t\tthis._collection.addEventListener(CollectionEventType.RESET, function(event:Event):void\n\t\t\t{\n\t\t\t\thasReset = true;\n\t\t\t});\n\t\t\tthis._collection.removeAll();\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\t//reset used to be dispatched, but REMOVE_ALL is better\n\t\t\tAssert.assertFalse(\"CollectionEventType.RESET was incorrectly dispatched\", hasReset);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REMOVE_ALL was not dispatched\", hasRemovedAll);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed to 0\",\n\t\t\t\t0, this._collection.length);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemAt():void\n\t\t{\n\t\t\tvar itemToRemove:Object = this._collection.getItemAt(1);\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.removeItemAt(expectedIndex);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed\",\n\t\t\t\toriginalLength - 1, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not removed\",\n\t\t\t\t-1, this._collection.getItemIndex(itemToRemove));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.REMOVE_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItem():void\n\t\t{\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar itemToRemove:Object = this._collection.getItemAt(expectedIndex);\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.removeItem(itemToRemove);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed\",\n\t\t\t\toriginalLength - 1, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not removed\",\n\t\t\t\t-1, this._collection.getItemIndex(itemToRemove));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.REMOVE_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testShift():void\n\t\t{\n\t\t\tvar itemToRemove:Object = this._collection.getItemAt(0);\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar expectedIndex:int = 0;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.shift();\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed\",\n\t\t\t\toriginalLength - 1, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not removed\",\n\t\t\t\t-1, this._collection.getItemIndex(itemToRemove));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.REMOVE_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPop():void\n\t\t{\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar itemToRemove:Object = this._collection.getItemAt(originalLength - 1);\n\t\t\tvar expectedIndex:int = originalLength - 1;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.pop();\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed\",\n\t\t\t\toriginalLength - 1, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not removed\",\n\t\t\t\t-1, this._collection.getItemIndex(itemToRemove));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.REMOVE_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItem():void\n\t\t{\n\t\t\tvar itemToAdd:XML = <item label=\"New Item\"/>;\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar expectedIndex:int = originalLength;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.addItem(itemToAdd);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed\",\n\t\t\t\toriginalLength + 1, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not added at the correct index\",\n\t\t\t\texpectedIndex, this._collection.getItemIndex(itemToAdd));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.ADD_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemAt():void\n\t\t{\n\t\t\tvar itemToAdd:XML = <item label=\"New Item\"/>;\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.addItemAt(itemToAdd, expectedIndex);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed\",\n\t\t\t\toriginalLength + 1, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not added at the correct index\",\n\t\t\t\texpectedIndex, this._collection.getItemIndex(itemToAdd));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.ADD_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testUnshift():void\n\t\t{\n\t\t\tvar itemToAdd:XML = <item label=\"New Item\"/>;\n\t\t\tvar expectedIndex:int = 0;\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.unshift(itemToAdd);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed\",\n\t\t\t\toriginalLength + 1, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not added at the correct index\",\n\t\t\t\texpectedIndex, this._collection.getItemIndex(itemToAdd));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.ADD_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testPush():void\n\t\t{\n\t\t\tvar itemToAdd:XML = <item label=\"New Item\"/>;\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar expectedIndex:int = originalLength;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.push(itemToAdd);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was not changed\",\n\t\t\t\toriginalLength + 1, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not added at the correct index\",\n\t\t\t\texpectedIndex, this._collection.getItemIndex(itemToAdd));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.ADD_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemAt():void\n\t\t{\n\t\t\tvar itemToAdd:XML = <item label=\"New Item\"/>;\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar originalLength:int = this._collection.length;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indexFromEvent:int = -1;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REPLACE_ITEM, function(event:Event, index:int):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindexFromEvent = index;\n\t\t\t});\n\t\t\tthis._collection.setItemAt(itemToAdd, expectedIndex);\n\t\t\tAssert.assertTrue(\"Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"CollectionEventType.REPLACE_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"The length property was incorrectly changed\",\n\t\t\t\toriginalLength, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"The item was not added at the correct index\",\n\t\t\t\texpectedIndex, this._collection.getItemIndex(itemToAdd));\n\t\t\tAssert.assertStrictlyEquals(\"The CollectionEventType.REPLACE_ITEM event data was not the correct index\",\n\t\t\t\texpectedIndex, indexFromEvent);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testContainsWithItemInCollection():void\n\t\t{\n\t\t\tvar item:Object = this._collection.getItemAt(1);\n\t\t\tAssert.assertStrictlyEquals(\"contains() incorrectly returned false\",\n\t\t\t\ttrue, this._collection.contains(item));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testContainsWithItemNotInCollection():void\n\t\t{\n\t\t\tvar item:Object = {};\n\t\t\tAssert.assertStrictlyEquals(\"contains() incorrectly returned true\",\n\t\t\t\tfalse, this._collection.contains(item));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemIndexWithItemInCollection():void\n\t\t{\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar item:Object = this._collection.getItemAt(expectedIndex);\n\t\t\tAssert.assertStrictlyEquals(\"getItemIndex() returned the incorrect value\",\n\t\t\t\texpectedIndex, this._collection.getItemIndex(item));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemIndexWithItemNotInCollection():void\n\t\t{\n\t\t\tvar item:Object = {};\n\t\t\tAssert.assertStrictlyEquals(\"getItemIndex() returned the incorrect value\",\n\t\t\t\t-1, this._collection.getItemIndex(item));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDispose():void\n\t\t{\n\t\t\tvar itemCount:int = this._collection.length;\n\t\t\tvar disposedCount:int = 0;\n\t\t\tthis._collection.dispose(function(item:Object):void\n\t\t\t{\n\t\t\t\titem.isDisposed = true;\n\t\t\t\tdisposedCount++;\n\t\t\t});\n\t\t\tAssert.assertStrictlyEquals(\"Incorrect number of items disposed when calling dispose() on XMLListCollection\",\n\t\t\t\titemCount, disposedCount);\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = this._collection.getItemAt(i);\n\t\t\t\tAssert.assertTrue(\"Item was not included when calling dispose() on XMLListCollection\", item.isDisposed);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testDisposeWithFilterFunction():void\n\t\t{\n\t\t\tvar itemCount:int = this._collection.length;\n\t\t\tthis._collection.filterFunction = function(item:Object):Boolean\n\t\t\t{\n\t\t\t\treturn item.@label.toString().charAt(0) === \"O\";\n\t\t\t};\n\t\t\tvar filteredCount:int = this._collection.length;\n\t\t\tAssert.assertFalse(\"Filtered collection length must change\", itemCount === filteredCount);\n\t\t\tvar disposedCount:int = 0;\n\t\t\tthis._collection.dispose(function(item:Object):void\n\t\t\t{\n\t\t\t\titem.isDisposed = true;\n\t\t\t\tdisposedCount++;\n\t\t\t});\n\t\t\tAssert.assertStrictlyEquals(\"Incorrect number of items disposed when calling dispose() on XMLListCollection\",\n\t\t\t\titemCount, disposedCount);\n\t\t\tfor(var i:int = 0; i < itemCount; i++)\n\t\t\t{\n\t\t\t\tvar item:Object = this._collection.getItemAt(i);\n\t\t\t\tAssert.assertTrue(\"Item was not included when calling dispose() on XMLListCollection\", item.isDisposed);\n\t\t\t}\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSortCompareFunction():void\n\t\t{\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: sortCompareFunction order is incorrect.\",\n\t\t\t\tthis._a, this._collection.getItemAt(0));\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: sortCompareFunction order is incorrect.\",\n\t\t\t\tthis._d, this._collection.getItemAt(1));\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: sortCompareFunction order is incorrect.\",\n\t\t\t\tthis._b, this._collection.getItemAt(2));\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: sortCompareFunction order is incorrect.\",\n\t\t\t\tthis._c, this._collection.getItemAt(3));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSortCompareFunctionAndFilterFunction():void\n\t\t{\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\tthis._collection.filterFunction = this.filterFunction;\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: sortCompareFunction and filterFunction length is incorrect.\",\n\t\t\t\t2, this._collection.length);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: sortCompareFunction order is incorrect with filterFunction.\",\n\t\t\t\tthis._d, this._collection.getItemAt(0));\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: sortCompareFunction order is incorrect with filterFunction.\",\n\t\t\t\tthis._b, this._collection.getItemAt(1));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetSortCompareFunctionToNull():void\n\t\t{\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\t//get an item so that we know the sorting was applied\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: sortCompareFunction order is incorrect.\",\n\t\t\t\tthis._c, this._collection.getItemAt(3));\n\n\t\t\tthis._collection.sortCompareFunction = null;\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: set sortCompareFunction to null order is incorrect.\",\n\t\t\t\tthis._a, this._collection.getItemAt(0));\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: set sortCompareFunction to null order is incorrect.\",\n\t\t\t\tthis._b, this._collection.getItemAt(1));\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: set sortCompareFunction to null order is incorrect.\",\n\t\t\t\tthis._c, this._collection.getItemAt(2));\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: set sortCompareFunction to null order is incorrect.\",\n\t\t\t\tthis._d, this._collection.getItemAt(3));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSortCompareFunctionWithAddItem():void\n\t\t{\n\t\t\tvar newItem:XML = <item label=\"New Item\" value=\"1.5\" />;\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\tthis._collection.addItem(newItem);\n\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: addItem() with sortCompareFunction does not add at correct sorted index.\",\n\t\t\t\tnewItem, this._collection.getItemAt(2));\n\n\t\t\tthis._collection.sortCompareFunction = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: addItem() with sortCompareFunction does not add at correct unsorted index.\",\n\t\t\t\tnewItem, this._collection.getItemAt(4));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSortCompareFunctionWithAddItemAt():void\n\t\t{\n\t\t\tvar newItem:XML = <item label=\"New Item\" value=\"1.5\" />;\n\t\t\tvar newIndex:int = 1;\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\tthis._collection.addItemAt(newItem, newIndex);\n\n\t\t\t//the index we passed in isn't necessarily the same while sorted\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: addItemAt() with sortCompareFunction does not add at correct sorted index.\",\n\t\t\t\tnewItem, this._collection.getItemAt(2));\n\n\t\t\tthis._collection.sortCompareFunction = null;\n\n\t\t\t//and it might not even be the same while unsorted!\n\t\t\t//that's because, in the unsorted data, it will be placed relative\n\t\t\t//to the item in the sorted data that was at the index passed to\n\t\t\t//addItemAt(). confusing, but it's consistent with setItemAt() and\n\t\t\t//filtered collections\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: addItemAt() with sortCompareFunction does not add at correct unsorted index.\",\n\t\t\t\tnewItem, this._collection.getItemAt(3));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSortCompareFunctionWithRemoveItemAt():void\n\t\t{\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\tthis._collection.removeItemAt(2);\n\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: removeItemAt() with sortCompareFunction removed incorrect item in sorted data.\",\n\t\t\t\tthis._a, this._collection.getItemAt(0));\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: removeItemAt() with sortCompareFunction removed incorrect item in sorted data.\",\n\t\t\t\tthis._d, this._collection.getItemAt(1));\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: removeItemAt() with sortCompareFunction removed incorrect item in sorted data.\",\n\t\t\t\tthis._c, this._collection.getItemAt(2));\n\n\t\t\tthis._collection.sortCompareFunction = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: removeItemAt() with sortCompareFunction removed incorrect item in unsorted data.\",\n\t\t\t\tthis._a, this._collection.getItemAt(0));\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: removeItemAt() with sortCompareFunction removed incorrect item in unsorted data.\",\n\t\t\t\tthis._c, this._collection.getItemAt(1));\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: removeItemAt() with sortCompareFunction removed incorrect item in unsorted data.\",\n\t\t\t\tthis._d, this._collection.getItemAt(2));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSortCompareFunctionWithRemoveItem():void\n\t\t{\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\tthis._collection.removeItem(this._b);\n\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: removeItem() with sortCompareFunction removed incorrect item in sorted data.\",\n\t\t\t\tthis._a, this._collection.getItemAt(0));\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: removeItem() with sortCompareFunction removed incorrect item in sorted data.\",\n\t\t\t\tthis._d, this._collection.getItemAt(1));\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: removeItem() with sortCompareFunction removed incorrect item in sorted data.\",\n\t\t\t\tthis._c, this._collection.getItemAt(2));\n\n\t\t\tthis._collection.sortCompareFunction = null;\n\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: removeItem() with sortCompareFunction removed incorrect item in unsorted data.\",\n\t\t\t\tthis._a, this._collection.getItemAt(0));\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: removeItem() with sortCompareFunction removed incorrect item in unsorted data.\",\n\t\t\t\tthis._c, this._collection.getItemAt(1));\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: removeItem() with sortCompareFunction removed incorrect item in unsorted data.\",\n\t\t\t\tthis._d, this._collection.getItemAt(2));\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSortCompareFunctionWithSetItemAt():void\n\t\t{\n\t\t\tvar newItem:XML = <item label=\"New Item\" value=\"1.5\" />;\n\t\t\tvar newIndex:int = 0;\n\t\t\tthis._collection.sortCompareFunction = this.sortCompareFunction;\n\t\t\tthis._collection.setItemAt(newItem, newIndex);\n\n\t\t\t//the index we passed in isn't necessarily the same while sorted\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: setItemAt() with sortCompareFunction does not add at correct sorted index.\",\n\t\t\t\tnewItem, this._collection.getItemAt(1));\n\t\t\tAssert.assertFalse(\"XMLListCollection: setItemAt() with sortCompareFunction does not replace correct item.\",\n\t\t\t\tthis._collection.contains(this._a));\n\n\t\t\tthis._collection.sortCompareFunction = null;\n\n\t\t\t//however, that index should be the same when the collection is unsorted\n\t\t\tAssert.assertStrictlyEquals(\"XMLListCollection: setItemAt() with sortCompareFunction does not add at correct unsorted index.\",\n\t\t\t\tnewItem, this._collection.getItemAt(newIndex));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/XMLListHierarchicalCollectionTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.data.XMLListHierarchicalCollection;\n\timport feathers.events.CollectionEventType;\n\n\timport org.flexunit.Assert;\n\n\timport starling.events.Event;\n\n\tpublic class XMLListHierarchicalCollectionTests\n\t{\n\t\tprivate var _collection:XMLListHierarchicalCollection;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tvar data:XML = <items>\n\t\t\t\t<item label=\"1\">\n\t\t\t\t\t<item label=\"1-A\"/>\n\t\t\t\t\t<item label=\"1-B\">\n\t\t\t\t\t\t<item label=\"1-B-I\"/>\n\t\t\t\t\t</item>\n\t\t\t\t\t<item label=\"1-C\"/>\n\t\t\t\t</item>\n\t\t\t\t<item label=\"2\">\n\t\t\t\t\t<item label=\"2-A\"/>\n\t\t\t\t</item>\n\t\t\t\t<item label=\"3\"/>\n\t\t\t\t<item label=\"4\">\n\t\t\t\t\t<item label=\"4-A\"/>\n\t\t\t\t\t<item label=\"4-B\"/>\n\t\t\t\t</item>\n\t\t\t</items>;\n\t\t\tthis._collection = new XMLListHierarchicalCollection(data.item);\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._collection = null;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetLength():void\n\t\t{\n\t\t\tvar length:int = this._collection.getLength();\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: getLengthAtLocation() returned incorrect length\",\n\t\t\t\t4, length);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetLengthNested():void\n\t\t{\n\t\t\tvar length:int = this._collection.getLength(3);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: getLengthAtLocation() returned incorrect length\",\n\t\t\t\t2, length);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetLengthAtLocationWithNull():void\n\t\t{\n\t\t\tvar length:int = this._collection.getLengthAtLocation();\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: getLengthAtLocation() returned incorrect length\",\n\t\t\t\t4, length);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemAt():void\n\t\t{\n\t\t\tvar item:XML = this._collection.getItemAt(1) as XML;\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: getItemAt() returned incorrect item\",\n\t\t\t\tthis._collection.xmlListData[1], item);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemAtNested():void\n\t\t{\n\t\t\tvar item:XML = this._collection.getItemAt(0, 1) as XML;\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: getItemAt() returned incorrect item\",\n\t\t\t\tthis._collection.xmlListData[0].elements()[1], item);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemAtLocation():void\n\t\t{\n\t\t\tvar indices:Vector.<int> = new <int>[1];\n\t\t\tvar item:XML = this._collection.getItemAtLocation(indices) as XML;\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: getItemAtLocation() returned incorrect item\",\n\t\t\t\tthis._collection.xmlListData[1], item);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemAtNestedLocation():void\n\t\t{\n\t\t\tvar indices:Vector.<int> = new <int>[0, 1];\n\t\t\tvar item:XML = this._collection.getItemAtLocation(indices) as XML;\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: getItemAtLocation() returned incorrect item\",\n\t\t\t\tthis._collection.xmlListData[0].elements()[1], item);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemAtNullLocation():void\n\t\t{\n\t\t\tvar item:Object = this._collection.getItemAtLocation(null);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: getItemAtLocation() returned incorrect item\",\n\t\t\t\tnull, item);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemAtEmptyLocation():void\n\t\t{\n\t\t\tvar indices:Vector.<int> = new <int>[];\n\t\t\tvar item:Object = this._collection.getItemAtLocation(indices);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: getItemAtLocation() returned incorrect item\",\n\t\t\t\tnull, item);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveAll():void\n\t\t{\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedAll:Boolean = false;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ALL, function(event:Event):void\n\t\t\t{\n\t\t\t\thasRemovedAll = true;\n\t\t\t});\n\t\t\tvar hasReset:Boolean = false;\n\t\t\tthis._collection.addEventListener(CollectionEventType.RESET, function(event:Event):void\n\t\t\t{\n\t\t\t\thasReset = true;\n\t\t\t});\n\t\t\tthis._collection.removeAll();\n\t\t\tAssert.assertTrue(\"XMLListHierarchicalCollection: Event.CHANGE was not dispatched after removeAll()\", hasChanged);\n\t\t\tAssert.assertFalse(\"XMLListHierarchicalCollection: CollectionEventType.RESET was incorrectly dispatched after removeAll()\", hasReset);\n\t\t\tAssert.assertTrue(\"XMLListHierarchicalCollection: CollectionEventType.REMOVE_ALL was not dispatched after removeAll()\", hasRemovedAll);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: the getLength() value was not changed to 0 after removeAll()\",\n\t\t\t\t0, this._collection.getLength());\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemAtLocation():void\n\t\t{\n\t\t\tvar indicesToRemove:Vector.<int> = new <int>[1];\n\t\t\tvar itemToRemove:XML = this._collection.getItemAtLocation(indicesToRemove) as XML;\n\t\t\tvar originalLength:int = this._collection.getLength();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.removeItemAtLocation(indicesToRemove);\n\t\t\tAssert.assertTrue(\"XMLListHierarchicalCollection: Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"XMLListHierarchicalCollection: CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The getLength() value was not changed\",\n\t\t\t\toriginalLength - 1, this._collection.getLength());\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The item was not removed\",\n\t\t\t\t0, this._collection.getItemLocation(itemToRemove).length);\n\t\t\tAssert.failNull(\"XMLListHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (length)\",\n\t\t\t\t1, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (value)\",\n\t\t\t\tindicesToRemove[0], indicesFromEvent[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemAtNestedLocation():void\n\t\t{\n\t\t\tvar indicesToRemove:Vector.<int> = new <int>[0, 1];\n\t\t\tvar itemToRemove:XML = this._collection.getItemAtLocation(indicesToRemove) as XML;\n\t\t\tvar originalParentLength:int = this._collection.getLength(indicesToRemove[0]);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.removeItemAtLocation(indicesToRemove);\n\t\t\tAssert.assertTrue(\"XMLListHierarchicalCollection: Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"XMLListHierarchicalCollection: CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The getLength() value was not changed\",\n\t\t\t\toriginalParentLength - 1, this._collection.getLength(indicesToRemove[0]));\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The item was not removed\",\n\t\t\t\t0, this._collection.getItemLocation(itemToRemove).length);\n\t\t\tAssert.failNull(\"XMLListHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (length)\",\n\t\t\t\t2, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (value)\",\n\t\t\t\tindicesToRemove[0], indicesFromEvent[0]);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (value)\",\n\t\t\t\tindicesToRemove[1], indicesFromEvent[1]);\n\t\t}\n\n\t\t[Test(expects=\"RangeError\")]\n\t\tpublic function testRemoveItemAtNullLocation():void\n\t\t{\n\t\t\tthis._collection.removeItemAtLocation(null);\n\t\t}\n\n\t\t[Test(expects=\"RangeError\")]\n\t\tpublic function testRemoveItemAtEmptyLocation():void\n\t\t{\n\t\t\tvar indices:Vector.<int> = new <int>[];\n\t\t\tthis._collection.removeItemAtLocation(indices);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItemAt():void\n\t\t{\n\t\t\tvar itemToRemove:XML = this._collection.getItemAt(1) as XML;\n\t\t\tvar originalLength:int = this._collection.getLength();\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.removeItemAt(expectedIndex);\n\t\t\tAssert.assertTrue(\"XMLListHierarchicalCollection: Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"XMLListHierarchicalCollection: CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The getLength() value was not changed\",\n\t\t\t\toriginalLength - 1, this._collection.getLength());\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The item was not removed\",\n\t\t\t\t0, this._collection.getItemLocation(itemToRemove).length);\n\t\t\tAssert.failNull(\"XMLListHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (length)\",\n\t\t\t\t1, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (value)\",\n\t\t\t\t1, indicesFromEvent[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testRemoveItem():void\n\t\t{\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar itemToRemove:XML = this._collection.getItemAt(expectedIndex) as XML;\n\t\t\tvar originalLength:int = this._collection.getLength();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasRemovedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REMOVE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasRemovedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.removeItem(itemToRemove);\n\t\t\tAssert.assertTrue(\"XMLListHierarchicalCollection: Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"XMLListHierarchicalCollection: CollectionEventType.REMOVE_ITEM was not dispatched\", hasRemovedItem);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The getLength() value was not changed\",\n\t\t\t\toriginalLength - 1, this._collection.getLength());\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The item was not removed\",\n\t\t\t\t0, this._collection.getItemLocation(itemToRemove).length);\n\t\t\tAssert.failNull(\"XMLListHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (length)\",\n\t\t\t\t1, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The CollectionEventType.REMOVE_ITEM event data was not the correct location (value)\",\n\t\t\t\t1, indicesFromEvent[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemAtLocation():void\n\t\t{\n\t\t\tvar location:Vector.<int> = new <int>[1];\n\t\t\tvar itemToAdd:XML = <item label=\"New Item\"/>;\n\t\t\tvar originalLength:int = this._collection.getLength();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.addItemAtLocation(itemToAdd, location);\n\t\t\tAssert.assertTrue(\"XMLListHierarchicalCollection: Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"XMLListHierarchicalCollection: CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The getLength() value was not changed\",\n\t\t\t\toriginalLength + 1, this._collection.getLength());\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The item was not added\",\n\t\t\t\t1, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The item was not added at the correct index\",\n\t\t\t\tlocation[0], this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.failNull(\"XMLListHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (length)\",\n\t\t\t\t1, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (value)\",\n\t\t\t\tlocation[0], indicesFromEvent[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemAtNestedLocation():void\n\t\t{\n\t\t\tvar location:Vector.<int> = new <int>[0, 1];\n\t\t\tvar itemToAdd:XML = <item label=\"New Item\"/>;\n\t\t\tvar originalParentLength:int = this._collection.getLength(location[0]);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.addItemAtLocation(itemToAdd, location);\n\t\t\tAssert.assertTrue(\"XMLListHierarchicalCollection: Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"XMLListHierarchicalCollection: CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The getLength() value was not changed\",\n\t\t\t\toriginalParentLength + 1, this._collection.getLength(location[0]));\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The item was not added\",\n\t\t\t\t2, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The item was not added at the correct index\",\n\t\t\t\tlocation[0], this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The item was not added at the correct index\",\n\t\t\t\tlocation[1], this._collection.getItemLocation(itemToAdd)[1]);\n\t\t\tAssert.failNull(\"XMLListHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (length)\",\n\t\t\t\t2, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (value)\",\n\t\t\t\tlocation[0], indicesFromEvent[0]);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (value)\",\n\t\t\t\tlocation[1], indicesFromEvent[1]);\n\t\t}\n\n\t\t[Test(expects=\"RangeError\")]\n\t\tpublic function testAddItemAtNullLocation():void\n\t\t{\n\t\t\tvar itemToAdd:XML = <item label=\"New Item\"/>;\n\t\t\tthis._collection.addItemAtLocation(itemToAdd, null);\n\t\t}\n\n\t\t[Test(expects=\"RangeError\")]\n\t\tpublic function testAddItemAtEmptyLocation():void\n\t\t{\n\t\t\tvar itemToAdd:XML = <item label=\"New Item\"/>;\n\t\t\tvar indices:Vector.<int> = new <int>[];\n\t\t\tthis._collection.addItemAtLocation(itemToAdd, indices);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemAt():void\n\t\t{\n\t\t\tvar itemToAdd:XML = <item label=\"New Item\"/>;\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar originalLength:int = this._collection.getLength();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.addItemAt(itemToAdd, expectedIndex);\n\t\t\tAssert.assertTrue(\"XMLListHierarchicalCollection: Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"XMLListHierarchicalCollection: CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The getLength() value was not changed\",\n\t\t\t\toriginalLength + 1, this._collection.getLength());\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The item was not added\",\n\t\t\t\t1, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The item was not added at the correct index\",\n\t\t\t\texpectedIndex, this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.failNull(\"XMLListHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (length)\",\n\t\t\t\t1, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (value)\",\n\t\t\t\t1, indicesFromEvent[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testAddItemAtNested():void\n\t\t{\n\t\t\tvar itemToAdd:XML = <item label=\"New Item\"/>;\n\t\t\tvar originalParentLength:int = this._collection.getLength(0);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasAddedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.ADD_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasAddedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.addItemAt(itemToAdd, 0, 1);\n\t\t\tAssert.assertTrue(\"XMLListHierarchicalCollection: Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"XMLListHierarchicalCollection: CollectionEventType.ADD_ITEM was not dispatched\", hasAddedItem);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The getLength() value was not changed\",\n\t\t\t\toriginalParentLength + 1, this._collection.getLength(0));\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The item was not added\",\n\t\t\t\t2, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The item was not added at the correct index\",\n\t\t\t\t0, this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The item was not added at the correct index\",\n\t\t\t\t1, this._collection.getItemLocation(itemToAdd)[1]);\n\t\t\tAssert.failNull(\"XMLListHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (length)\",\n\t\t\t\t2, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (value)\",\n\t\t\t\t0, indicesFromEvent[0]);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The CollectionEventType.ADD_ITEM event data was not the correct location (value)\",\n\t\t\t\t1, indicesFromEvent[1]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemAt():void\n\t\t{\n\t\t\tvar itemToAdd:XML = <item label=\"New Item\"/>;\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar originalLength:int = this._collection.getLength();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasReplacedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REPLACE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasReplacedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.setItemAt(itemToAdd, expectedIndex);\n\t\t\tAssert.assertTrue(\"XMLListHierarchicalCollection: Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"XMLListHierarchicalCollection: CollectionEventType.REPLACE_ITEM was not dispatched\", hasReplacedItem);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The length property was incorrectly changed\",\n\t\t\t\toriginalLength, this._collection.getLength());\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The item was not replaced\",\n\t\t\t\t1, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The item was not replaced at the correct index\",\n\t\t\t\texpectedIndex, this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.failNull(\"XMLListHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (length)\",\n\t\t\t\t1, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (value)\",\n\t\t\t\t1, indicesFromEvent[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemAtNested():void\n\t\t{\n\t\t\tvar itemToAdd:XML = <item label=\"New Item\"/>;\n\t\t\tvar originalParentLength:int = this._collection.getLength(0);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasReplacedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REPLACE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasReplacedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.setItemAt(itemToAdd, 0, 1);\n\t\t\tAssert.assertTrue(\"XMLListHierarchicalCollection: Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"XMLListHierarchicalCollection: CollectionEventType.REPLACE_ITEM was not dispatched\", hasReplacedItem);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The length property was incorrectly changed\",\n\t\t\t\toriginalParentLength, this._collection.getLength(0));\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The item was not replaced\",\n\t\t\t\t2, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The item was not replaced at the correct index\",\n\t\t\t\t0, this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The item was not replaced at the correct index\",\n\t\t\t\t1, this._collection.getItemLocation(itemToAdd)[1]);\n\t\t\tAssert.failNull(\"XMLListHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (length)\",\n\t\t\t\t2, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (value)\",\n\t\t\t\t0, indicesFromEvent[0]);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (value)\",\n\t\t\t\t1, indicesFromEvent[1]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemAtLocation():void\n\t\t{\n\t\t\tvar itemToAdd:XML = <item label=\"New Item\"/>;\n\t\t\tvar location:Vector.<int> = new <int>[1];\n\t\t\tvar originalLength:int = this._collection.getLength();\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasReplacedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REPLACE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasReplacedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.setItemAtLocation(itemToAdd, location);\n\t\t\tAssert.assertTrue(\"XMLListHierarchicalCollection: Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"XMLListHierarchicalCollection: CollectionEventType.REPLACE_ITEM was not dispatched\", hasReplacedItem);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The length property was incorrectly changed\",\n\t\t\t\toriginalLength, this._collection.getLength());\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The item was not replaced\",\n\t\t\t\t1, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The item was not replaced at the correct index\",\n\t\t\t\tlocation[0], this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.failNull(\"XMLListHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (length)\",\n\t\t\t\t1, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (value)\",\n\t\t\t\tlocation[0], indicesFromEvent[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testSetItemAtNestedLocation():void\n\t\t{\n\t\t\tvar itemToAdd:XML = <item label=\"New Item\"/>;\n\t\t\tvar location:Vector.<int> = new <int>[0, 1];\n\t\t\tvar originalParentLength:int = this._collection.getLength(location[0]);\n\t\t\tvar hasChanged:Boolean = false;\n\t\t\tthis._collection.addEventListener(Event.CHANGE, function(event:Event):void\n\t\t\t{\n\t\t\t\thasChanged = true;\n\t\t\t});\n\t\t\tvar hasReplacedItem:Boolean = false;\n\t\t\tvar indicesFromEvent:Array = null;\n\t\t\tthis._collection.addEventListener(CollectionEventType.REPLACE_ITEM, function(event:Event, indices:Array):void\n\t\t\t{\n\t\t\t\thasReplacedItem = true;\n\t\t\t\tindicesFromEvent = indices;\n\t\t\t});\n\t\t\tthis._collection.setItemAtLocation(itemToAdd, location);\n\t\t\tAssert.assertTrue(\"XMLListHierarchicalCollection: Event.CHANGE was not dispatched\", hasChanged);\n\t\t\tAssert.assertTrue(\"XMLListHierarchicalCollection: CollectionEventType.REPLACE_ITEM was not dispatched\", hasReplacedItem);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The length property was incorrectly changed\",\n\t\t\t\toriginalParentLength, this._collection.getLength(location[0]));\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The item was not replaced\",\n\t\t\t\t2, this._collection.getItemLocation(itemToAdd).length);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The item was not replaced at the correct index\",\n\t\t\t\tlocation[0], this._collection.getItemLocation(itemToAdd)[0]);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The item was not replaced at the correct index\",\n\t\t\t\tlocation[1], this._collection.getItemLocation(itemToAdd)[1]);\n\t\t\tAssert.failNull(\"XMLListHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (null)\",\n\t\t\t\tindicesFromEvent);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (length)\",\n\t\t\t\t2, indicesFromEvent.length);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (value)\",\n\t\t\t\tlocation[0], indicesFromEvent[0]);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: The CollectionEventType.REPLACE_ITEM event data was not the correct location (value)\",\n\t\t\t\tlocation[1], indicesFromEvent[1]);\n\t\t}\n\n\t\t[Test(expects=\"RangeError\")]\n\t\tpublic function testSetItemAtNullLocation():void\n\t\t{\n\t\t\tvar itemToAdd:XML = <item label=\"New Item\"/>;\n\t\t\tthis._collection.setItemAtLocation(itemToAdd, null);\n\t\t}\n\n\t\t[Test(expects=\"RangeError\")]\n\t\tpublic function testSetItemAtEmptyLocation():void\n\t\t{\n\t\t\tvar itemToAdd:XML = <item label=\"New Item\"/>;\n\t\t\tvar indices:Vector.<int> = new <int>[];\n\t\t\tthis._collection.setItemAtLocation(itemToAdd, indices);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemLocationWithItemInCollection():void\n\t\t{\n\t\t\tvar expectedIndex:int = 1;\n\t\t\tvar item:XML = this._collection.getItemAt(expectedIndex) as XML;\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: getItemLocation() returned the incorrect location (length)\",\n\t\t\t\t1, this._collection.getItemLocation(item).length);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: getItemLocation() returned the incorrect location (value)\",\n\t\t\t\texpectedIndex, this._collection.getItemLocation(item)[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemLocationNestedWithItemInCollection():void\n\t\t{\n\t\t\tvar location:Vector.<int> = new <int>[0, 1];\n\t\t\tvar item:XML = this._collection.getItemAtLocation(location) as XML;\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: getItemLocation() returned the incorrect location (length)\",\n\t\t\t\tlocation.length, this._collection.getItemLocation(item).length);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: getItemLocation() returned the incorrect location (value)\",\n\t\t\t\tlocation[0], this._collection.getItemLocation(item)[0]);\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: getItemLocation() returned the incorrect location (value)\",\n\t\t\t\tlocation[1], this._collection.getItemLocation(item)[1]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testGetItemLocationWithItemNotInCollection():void\n\t\t{\n\t\t\tvar item:XML = <notincollection/>;\n\t\t\tAssert.assertStrictlyEquals(\"XMLListHierarchicalCollection: getItemLocation() returned the incorrect location (length)\",\n\t\t\t\t0, this._collection.getItemLocation(item).length);\n\t\t}\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/XMLListInsertAtTests.as",
    "content": "package feathers.tests\n{\n\timport feathers.utils.xml.xmlListInsertAt;\n\n\timport org.flexunit.Assert;\n\n\tpublic class XMLListInsertAtTests\n\t{\n\t\tprivate var _xmlList:XMLList;\n\n\t\t[Before]\n\t\tpublic function prepare():void\n\t\t{\n\t\t\tthis._xmlList = <items>\n\t\t\t\t<item label=\"One\"/>\n\t\t\t\t<item label=\"Two\"/>\n\t\t\t\t<item label=\"Three\"/>\n\t\t\t</items>.elements();\n\t\t}\n\n\t\t[After]\n\t\tpublic function cleanup():void\n\t\t{\n\t\t\tthis._xmlList = null;\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInsertAt0():void\n\t\t{\n\t\t\tvar itemToInsert:XML = <item label=\"New Item\"/>;\n\t\t\tthis._xmlList = xmlListInsertAt(this._xmlList, 0, itemToInsert);\n\t\t\tAssert.assertStrictlyEquals(\"xmlListInsertAt: length() after insert did not increase\",\n\t\t\t\t4, this._xmlList.length());\n\t\t\tAssert.assertStrictlyEquals(\"xmlListInsertAt: returned item is not correct after insert at index 0\",\n\t\t\t\titemToInsert, this._xmlList[0]);\n\t\t}\n\n\t\t[Test]\n\t\tpublic function testInsertAtLength():void\n\t\t{\n\t\t\tvar index:int = this._xmlList.length();\n\t\t\tvar itemToInsert:XML = <item label=\"New Item\"/>;\n\t\t\tthis._xmlList = xmlListInsertAt(this._xmlList, index, itemToInsert);\n\t\t\tAssert.assertStrictlyEquals(\"xmlListInsertAt: length() after insert did not increase\",\n\t\t\t\t4, this._xmlList.length());\n\t\t\tAssert.assertStrictlyEquals(\"xmlListInsertAt: returned item is not correct after insert at index === length()\",\n\t\t\t\titemToInsert, this._xmlList[index]);\n\t\t}\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/supportClasses/AssertViewPortBoundsLayout.as",
    "content": "package feathers.tests.supportClasses\n{\n\timport feathers.layout.ILayout;\n\timport feathers.layout.LayoutBoundsResult;\n\timport feathers.layout.ViewPortBounds;\n\n\timport flash.geom.Point;\n\n\timport org.flexunit.Assert;\n\n\timport starling.display.DisplayObject;\n\timport starling.events.EventDispatcher;\n\n\tpublic class AssertViewPortBoundsLayout extends EventDispatcher implements ILayout\n\t{\n\t\tpublic function AssertViewPortBoundsLayout()\n\t\t{\n\t\t}\n\n\t\tpublic function get requiresLayoutOnScroll():Boolean\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic function layout(items:Vector.<DisplayObject>, viewPortBounds:ViewPortBounds = null, result:LayoutBoundsResult = null):LayoutBoundsResult\n\t\t{\n\t\t\tif(result === null)\n\t\t\t{\n\t\t\t\tresult = new LayoutBoundsResult();\n\t\t\t}\n\t\t\tif(viewPortBounds !== null)\n\t\t\t{\n\t\t\t\tAssert.assertFalse(\"ViewPortBounds minWidth must not be NaN\", isNaN(viewPortBounds.minWidth));\n\t\t\t\tAssert.assertFalse(\"ViewPortBounds minHeight must not be NaN\", isNaN(viewPortBounds.minHeight));\n\t\t\t\tAssert.assertFalse(\"ViewPortBounds maxWidth must not be NaN\", isNaN(viewPortBounds.maxWidth));\n\t\t\t\tAssert.assertFalse(\"ViewPortBounds maxHeight must not be NaN\", isNaN(viewPortBounds.maxHeight));\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic function getScrollPositionForIndex(index:int, items:Vector.<DisplayObject>,\n\t\t\tx:Number, y:Number, width:Number, height:Number, result:Point = null):Point\n\t\t{\n\t\t\tif(result === null)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic function getNearestScrollPositionForIndex(index:int, scrollX:Number, scrollY:Number,\n\t\t\titems:Vector.<DisplayObject>, x:Number, y:Number, width:Number, height:Number, result:Point = null):Point\n\t\t{\n\t\t\tif(result === null)\n\t\t\t{\n\t\t\t\tresult = new Point();\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic function calculateNavigationDestination(items:Vector.<DisplayObject>, index:int, keyCode:uint, bounds:LayoutBoundsResult):int\n\t\t{\n\t\t\treturn index;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/supportClasses/CustomMediaPlayer.as",
    "content": "package feathers.tests.supportClasses\n{\n\timport feathers.events.MediaPlayerEventType;\n\timport feathers.media.ITimedMediaPlayer;\n\n\timport starling.events.EventDispatcher;\n\n\tpublic class CustomMediaPlayer extends EventDispatcher implements ITimedMediaPlayer\n\t{\n\t\tpublic function CustomMediaPlayer(totalTime:Number)\n\t\t{\n\t\t\tthis._totalTime = totalTime;\n\t\t}\n\t\t\n\t\tprotected var _currentTime:Number = 0;\n\t\t\n\t\tpublic function get currentTime():Number\n\t\t{\n\t\t\treturn this._currentTime;\n\t\t}\n\n\t\tprotected var _totalTime:Number = 0;\n\n\t\tpublic function get totalTime():Number\n\t\t{\n\t\t\treturn this._totalTime;\n\t\t}\n\n\t\tprotected var _isPlaying:Boolean = false;\n\n\t\tpublic function get isPlaying():Boolean\n\t\t{\n\t\t\treturn this._isPlaying;\n\t\t}\n\n\t\tpublic function togglePlayPause():void\n\t\t{\n\t\t\tif(this._isPlaying)\n\t\t\t{\n\t\t\t\tthis.pause();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.play();\n\t\t\t}\n\t\t}\n\n\t\tpublic function play():void\n\t\t{\n\t\t\tif(this._isPlaying)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isPlaying = true;\n\t\t\tthis.dispatchEventWith(MediaPlayerEventType.PLAYBACK_STATE_CHANGE);\n\t\t}\n\n\t\tpublic function pause():void\n\t\t{\n\t\t\tif(!this._isPlaying)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isPlaying = false;\n\t\t\tthis.dispatchEventWith(MediaPlayerEventType.PLAYBACK_STATE_CHANGE);\n\t\t}\n\n\t\tpublic function stop():void\n\t\t{\n\t\t\tthis.pause();\n\t\t\tthis.seek(0);\n\t\t}\n\n\t\tpublic function seek(seconds:Number):void\n\t\t{\n\t\t\tthis._currentTime = seconds;\n\t\t\tthis.dispatchEventWith(MediaPlayerEventType.CURRENT_TIME_CHANGE);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/supportClasses/CustomStateContext.as",
    "content": "package feathers.tests.supportClasses\n{\n\timport feathers.core.IStateContext;\n\timport feathers.events.FeathersEventType;\n\n\tpublic class CustomStateContext extends CustomToggle implements IStateContext\n\t{\n\t\tpublic function CustomStateContext()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprotected var _currentState:String = null;\n\n\t\tpublic function get currentState():String\n\t\t{\n\t\t\treturn this._currentState;\n\t\t}\n\n\t\tpublic function set currentState(value:String):void\n\t\t{\n\t\t\tif(this._currentState === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._currentState = value;\n\t\t\tthis.dispatchEventWith(FeathersEventType.STATE_CHANGE);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/supportClasses/CustomStyleProvider.as",
    "content": "package feathers.tests.supportClasses\n{\n\timport feathers.core.IFeathersControl;\n\timport feathers.skins.IStyleProvider;\n\n\tpublic class CustomStyleProvider implements IStyleProvider\n\t{\n\t\tpublic function CustomStyleProvider()\n\t\t{\n\t\t}\n\n\t\tprivate var _appliedStyles:Boolean = false;\n\n\t\tpublic function get appliedStyles():Boolean\n\t\t{\n\t\t\treturn this._appliedStyles;\n\t\t}\n\n\t\tpublic function applyStyles(target:IFeathersControl):void\n\t\t{\n\t\t\tthis._appliedStyles = true;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/supportClasses/CustomToggle.as",
    "content": "package feathers.tests.supportClasses\n{\n\timport feathers.controls.LayoutGroup;\n\timport feathers.core.IFocusDisplayObject;\n\timport feathers.core.IToggle;\n\n\timport starling.display.Quad;\n\timport starling.events.Event;\n\n\tpublic class CustomToggle extends LayoutGroup implements IToggle, IFocusDisplayObject\n\t{\n\t\tpublic function CustomToggle()\n\t\t{\n\t\t\tthis.backgroundSkin = new Quad(200, 200, 0xff00ff);\n\t\t}\n\t\t\n\t\tprotected var _isSelected:Boolean = false;\n\t\t\n\t\tpublic function get isSelected():Boolean\n\t\t{\n\t\t\treturn this._isSelected;\n\t\t}\n\t\t\n\t\tpublic function set isSelected(value:Boolean):void\n\t\t{\n\t\t\tif(this._isSelected === value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._isSelected = value;\n\t\t\tthis.dispatchEventWith(Event.CHANGE);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "test/source/feathers/tests/supportClasses/DisposeFlagQuad.as",
    "content": "package feathers.tests.supportClasses\n{\n\timport starling.display.Quad;\n\n\tpublic class DisposeFlagQuad extends Quad\n\t{\n\t\tpublic function DisposeFlagQuad()\n\t\t{\n\t\t\tsuper(1, 1, 0xff00ff);\n\t\t}\n\n\t\tpublic var isDisposed:Boolean = false;\n\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tsuper.dispose();\n\t\t\tthis.isDisposed = true;\n\t\t}\n\t}\n}"
  },
  {
    "path": "test/source/feathers/tests/supportClasses/ScrollerViewPort.as",
    "content": "package feathers.tests.supportClasses\n{\n\timport feathers.controls.supportClasses.IViewPort;\n\timport feathers.core.FeathersControl;\n\n\tpublic class ScrollerViewPort extends FeathersControl implements IViewPort\n\t{\n\t\tpublic function ScrollerViewPort()\n\t\t{\n\t\t}\n\n\t\tprivate var _actualMinVisibleWidth:Number = 0;\n\n\t\tprivate var _explicitMinVisibleWidth:Number;\n\n\t\tpublic function get minVisibleWidth():Number\n\t\t{\n\t\t\tif(this._explicitMinWidth === this._explicitMinWidth) //!isNaN\n\t\t\t{\n\t\t\t\treturn this._explicitMinWidth;\n\t\t\t}\n\t\t\tif(this._explicitMinVisibleWidth !== this._explicitMinVisibleWidth) //isNaN\n\t\t\t{\n\t\t\t\treturn this._actualMinVisibleWidth;\n\t\t\t}\n\t\t\treturn this._explicitMinVisibleWidth;\n\t\t}\n\n\t\tpublic function set minVisibleWidth(value:Number):void\n\t\t{\n\t\t\tif(this._explicitMinVisibleWidth == value ||\n\t\t\t\t(value !== value && this._explicitMinVisibleWidth !== this._explicitMinVisibleWidth)) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._explicitMinVisibleWidth = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\tprivate var _maxVisibleWidth:Number = Number.POSITIVE_INFINITY;\n\n\t\tpublic function get maxVisibleWidth():Number\n\t\t{\n\t\t\treturn this._maxVisibleWidth;\n\t\t}\n\n\t\tpublic function set maxVisibleWidth(value:Number):void\n\t\t{\n\t\t\tif(this._maxVisibleWidth == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value) //isNaN\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"maxVisibleWidth cannot be NaN\");\n\t\t\t}\n\t\t\tthis._maxVisibleWidth = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\tprivate var _actualVisibleWidth:Number = 0;\n\n\t\tprivate var _explicitVisibleWidth:Number = NaN;\n\n\t\tpublic function get visibleWidth():Number\n\t\t{\n\t\t\tif(this._explicitVisibleWidth !== this._explicitVisibleWidth) //isNaN\n\t\t\t{\n\t\t\t\treturn this._actualVisibleWidth;\n\t\t\t}\n\t\t\treturn this._explicitVisibleWidth;\n\t\t}\n\n\t\tpublic function set visibleWidth(value:Number):void\n\t\t{\n\t\t\tif(this._explicitVisibleWidth == value ||\n\t\t\t(value !== value && this._explicitVisibleWidth !== this._explicitVisibleWidth)) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._explicitVisibleWidth = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\tprivate var _actualMinVisibleHeight:Number = 0;\n\n\t\tprivate var _explicitMinVisibleHeight:Number;\n\n\t\tpublic function get minVisibleHeight():Number\n\t\t{\n\t\t\tif(this._explicitMinHeight === this._explicitMinHeight) //!isNaN\n\t\t\t{\n\t\t\t\treturn this._explicitMinHeight;\n\t\t\t}\n\t\t\tif(this._explicitMinVisibleHeight !== this._explicitMinVisibleHeight) //isNaN\n\t\t\t{\n\t\t\t\treturn this._actualMinVisibleHeight;\n\t\t\t}\n\t\t\treturn this._explicitMinVisibleHeight;\n\t\t}\n\n\t\tpublic function set minVisibleHeight(value:Number):void\n\t\t{\n\t\t\tif(this._explicitMinVisibleHeight == value ||\n\t\t\t\t(value !== value && this._explicitMinVisibleHeight !== this._explicitMinVisibleHeight)) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._explicitMinVisibleHeight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\tprivate var _maxVisibleHeight:Number = Number.POSITIVE_INFINITY;\n\n\t\tpublic function get maxVisibleHeight():Number\n\t\t{\n\t\t\treturn this._maxVisibleHeight;\n\t\t}\n\n\t\tpublic function set maxVisibleHeight(value:Number):void\n\t\t{\n\t\t\tif(this._maxVisibleHeight == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(value !== value) //isNaN\n\t\t\t{\n\t\t\t\tthrow new ArgumentError(\"maxVisibleHeight cannot be NaN\");\n\t\t\t}\n\t\t\tthis._maxVisibleHeight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\tprivate var _actualVisibleHeight:Number = 0;\n\n\t\tprivate var _explicitVisibleHeight:Number = NaN;\n\n\t\tpublic function get visibleHeight():Number\n\t\t{\n\t\t\tif(this._explicitVisibleHeight !== this._explicitVisibleHeight) //isNaN\n\t\t\t{\n\t\t\t\treturn this._actualVisibleHeight;\n\t\t\t}\n\t\t\treturn this._explicitVisibleHeight;\n\t\t}\n\n\t\tpublic function set visibleHeight(value:Number):void\n\t\t{\n\t\t\tif(this._explicitVisibleHeight == value ||\n\t\t\t\t(value !== value && this._explicitVisibleHeight !== this._explicitVisibleHeight)) //isNaN\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._explicitVisibleHeight = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SIZE);\n\t\t}\n\n\t\tprivate var _contentX:Number = 0;\n\n\t\tpublic function get contentX():Number\n\t\t{\n\t\t\treturn this._contentX;\n\t\t}\n\n\t\tpublic function set contentX(value:Number):void\n\t\t{\n\t\t\tthis._contentX = value;\n\t\t}\n\n\t\tprivate var _contentY:Number = 0;\n\n\t\tpublic function get contentY():Number\n\t\t{\n\t\t\treturn this._contentY;\n\t\t}\n\n\t\tpublic function set contentY(value:Number):void\n\t\t{\n\t\t\tthis._contentY = value;\n\t\t}\n\t\t\n\t\tprivate var _horizontalScrollStep:Number = 1;\n\n\t\tpublic function get horizontalScrollStep():Number\n\t\t{\n\t\t\treturn this._horizontalScrollStep;\n\t\t}\n\n\t\tpublic function set horizontalScrollStep(value:Number):void\n\t\t{\n\t\t\tthis._horizontalScrollStep = value;\n\t\t}\n\n\t\tprivate var _verticalScrollStep:Number = 1;\n\n\t\tpublic function get verticalScrollStep():Number\n\t\t{\n\t\t\treturn this._verticalScrollStep;\n\t\t}\n\n\t\tpublic function set verticalScrollStep(value:Number):void\n\t\t{\n\t\t\tthis._verticalScrollStep = value;\n\t\t}\n\n\t\tprivate var _horizontalScrollPosition:Number = 0;\n\n\t\tpublic function get horizontalScrollPosition():Number\n\t\t{\n\t\t\treturn this._horizontalScrollPosition;\n\t\t}\n\n\t\tpublic function set horizontalScrollPosition(value:Number):void\n\t\t{\n\t\t\tif(this._horizontalScrollPosition == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._horizontalScrollPosition = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t}\n\n\t\tprivate var _verticalScrollPosition:Number = 0;\n\n\t\tpublic function get verticalScrollPosition():Number\n\t\t{\n\t\t\treturn this._verticalScrollPosition;\n\t\t}\n\n\t\tpublic function set verticalScrollPosition(value:Number):void\n\t\t{\n\t\t\tif(this._verticalScrollPosition == value)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._verticalScrollPosition = value;\n\t\t\tthis.invalidate(INVALIDATION_FLAG_SCROLL);\n\t\t}\n\n\t\toverride public function set width(value:Number):void\n\t\t{\n\t\t\tsuper.width = value;\n\t\t\tthis._actualVisibleWidth = value;\n\t\t}\n\n\t\toverride public function set height(value:Number):void\n\t\t{\n\t\t\tsuper.height = value;\n\t\t\tthis._actualVisibleHeight = value;\n\t\t}\n\n\t\tprivate var _requiresMeasurementOnScroll:Boolean = false;\n\n\t\tpublic function get requiresMeasurementOnScroll():Boolean\n\t\t{\n\t\t\treturn this._requiresMeasurementOnScroll;\n\t\t}\n\n\t\tpublic function set requiresMeasurementOnScroll(value:Boolean):void\n\t\t{\n\t\t\tthis._requiresMeasurementOnScroll = value;\n\t\t}\n\n\t\tprivate var _resizeOnScroll:Boolean = false;\n\n\t\tpublic function get resizeOnScroll():Boolean\n\t\t{\n\t\t\treturn this._resizeOnScroll;\n\t\t}\n\n\t\tpublic function set resizeOnScroll(value:Boolean):void\n\t\t{\n\t\t\tthis._resizeOnScroll = value;\n\t\t}\n\t\t\n\t\toverride protected function draw():void\n\t\t{\n\t\t\tif(this._resizeOnScroll && this.isInvalid(INVALIDATION_FLAG_SCROLL))\n\t\t\t{\n\t\t\t\tsuper.width = this.width + 1;\n\t\t\t\tsuper.height = this.height + 1;\n\t\t\t}\n\t\t\tsuper.draw();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "themes/AeonDesktopTheme/README.md",
    "content": "# Aeon Desktop Theme for Feathers\n\nThis [Feathers](http://feathersui.com/) theme for desktop is based on the theme used by the Flash Professional and the Flex MX component sets.\n\n## Original Artwork\n\nThis theme's texture atlas was exported from Adobe Animate CC. To modify colors and other properties, or to add new skins to the texture atlas, [download the source FLA file](http://feathersui.com/help/theme-sources.html) from the Feathers website.\n\n## Credits\n\nThe Aeon theme is originally designed by Adobe Systems Incorporated. Contains modifications by [Josh Tynjala](https://joshblog.net/)."
  },
  {
    "path": "themes/AeonDesktopTheme/assets/images/aeon_desktop.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<TextureAtlas imagePath=\"aeon_desktop.png\">\n\t<!-- Created with Adobe Animate version 16.5.1.104 -->\n\t<!-- http://www.adobe.com/products/animate.html -->\n\t<SubTexture name=\"alert-background-skin0000\" x=\"348\" y=\"306\" width=\"22\" height=\"22\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"back-button-disabled-icon0000\" x=\"444\" y=\"296\" width=\"9\" height=\"15\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"back-button-up-icon0000\" x=\"372\" y=\"306\" width=\"9\" height=\"15\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-disabled-skin0000\" x=\"282\" y=\"172\" width=\"22\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-down-skin0000\" x=\"2\" y=\"180\" width=\"22\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-hover-skin0000\" x=\"26\" y=\"180\" width=\"22\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-up-skin0000\" x=\"50\" y=\"180\" width=\"22\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"call-to-action-button-hover-skin0000\" x=\"74\" y=\"180\" width=\"22\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"call-to-action-button-up-skin0000\" x=\"98\" y=\"180\" width=\"22\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"callout-background-skin0000\" x=\"90\" y=\"286\" width=\"26\" height=\"26\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"callout-bottom-arrow-skin0000\" x=\"436\" y=\"194\" width=\"24\" height=\"26\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"callout-left-arrow-skin0000\" x=\"486\" y=\"294\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"callout-right-arrow-skin0000\" x=\"418\" y=\"296\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"callout-top-arrow-skin0000\" x=\"386\" y=\"298\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"check-disabled-icon0000\" x=\"126\" y=\"226\" width=\"28\" height=\"28\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"check-down-icon0000\" x=\"156\" y=\"226\" width=\"28\" height=\"28\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"check-hover-icon0000\" x=\"186\" y=\"226\" width=\"28\" height=\"28\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"check-selected-disabled-icon0000\" x=\"216\" y=\"226\" width=\"28\" height=\"28\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"check-selected-down-icon0000\" x=\"436\" y=\"236\" width=\"28\" height=\"28\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"check-selected-hover-icon0000\" x=\"466\" y=\"236\" width=\"28\" height=\"28\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"check-selected-up-icon0000\" x=\"400\" y=\"240\" width=\"28\" height=\"28\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"check-up-icon0000\" x=\"296\" y=\"246\" width=\"28\" height=\"28\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-button-down-skin0000\" x=\"122\" y=\"180\" width=\"22\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-button-hover-skin0000\" x=\"146\" y=\"180\" width=\"22\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-button-up-skin0000\" x=\"170\" y=\"180\" width=\"22\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-callout-background-skin0000\" x=\"118\" y=\"286\" width=\"26\" height=\"26\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-callout-bottom-arrow-skin0000\" x=\"360\" y=\"278\" width=\"24\" height=\"26\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-callout-left-arrow-skin0000\" x=\"270\" y=\"304\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-callout-right-arrow-skin0000\" x=\"296\" y=\"304\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-callout-top-arrow-skin0000\" x=\"322\" y=\"306\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-column-drop-indicator-skin0000\" x=\"306\" y=\"172\" width=\"6\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-column-resize-skin0000\" x=\"506\" y=\"122\" width=\"2\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-header-background-skin0000\" x=\"278\" y=\"108\" width=\"6\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-header-divider-skin0000\" x=\"450\" y=\"222\" width=\"10\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-header-sort-ascending-icon0000\" x=\"154\" y=\"314\" width=\"14\" height=\"9\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-header-sort-descending-icon0000\" x=\"254\" y=\"308\" width=\"14\" height=\"9\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-vertical-divider-skin0000\" x=\"506\" y=\"122\" width=\"2\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"drill-down-icon0000\" x=\"230\" y=\"286\" width=\"9\" height=\"15\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"focus-indicator-skin0000\" x=\"62\" y=\"286\" width=\"26\" height=\"26\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"forward-button-disabled-icon0000\" x=\"418\" y=\"270\" width=\"9\" height=\"15\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"forward-button-up-icon0000\" x=\"230\" y=\"286\" width=\"9\" height=\"15\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"full-screen-toggle-button-enter-up-icon0000\" x=\"460\" y=\"294\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"full-screen-toggle-button-exit-up-icon0000\" x=\"30\" y=\"288\" width=\"25\" height=\"25\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"grouped-list-header-background-skin0000\" x=\"490\" y=\"36\" width=\"8\" height=\"60\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"header-background-skin0000\" x=\"500\" y=\"2\" width=\"8\" height=\"62\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-scroll-bar-decrement-button-icon0000\" x=\"444\" y=\"313\" width=\"9\" height=\"14\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-scroll-bar-increment-button-icon0000\" x=\"143\" y=\"314\" width=\"9\" height=\"14\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-scroll-bar-step-button-disabled-skin0000\" x=\"370\" y=\"216\" width=\"28\" height=\"30\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-scroll-bar-step-button-down-skin0000\" x=\"266\" y=\"218\" width=\"28\" height=\"30\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-scroll-bar-step-button-hover-skin0000\" x=\"2\" y=\"226\" width=\"28\" height=\"30\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-scroll-bar-step-button-up-skin0000\" x=\"32\" y=\"226\" width=\"28\" height=\"30\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-scroll-bar-thumb-down-skin0000\" x=\"288\" y=\"2\" width=\"104\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-scroll-bar-thumb-hover-skin0000\" x=\"394\" y=\"2\" width=\"104\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-scroll-bar-thumb-icon0000\" x=\"496\" y=\"250\" width=\"14\" height=\"10\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-scroll-bar-thumb-up-skin0000\" x=\"288\" y=\"36\" width=\"104\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-scroll-bar-track-skin0000\" x=\"500\" y=\"66\" width=\"8\" height=\"30\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-slider-thumb-disabled-skin0000\" x=\"146\" y=\"286\" width=\"26\" height=\"26\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-slider-thumb-down-skin0000\" x=\"174\" y=\"286\" width=\"26\" height=\"26\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-slider-thumb-hover-skin0000\" x=\"202\" y=\"286\" width=\"26\" height=\"26\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-slider-thumb-up-skin0000\" x=\"2\" y=\"288\" width=\"26\" height=\"26\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-slider-track-disabled-skin0000\" x=\"492\" y=\"284\" width=\"14\" height=\"8\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-slider-track-enabled-skin0000\" x=\"170\" y=\"314\" width=\"14\" height=\"8\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-volume-slider-maximum-track-skin0000\" x=\"316\" y=\"142\" width=\"100\" height=\"26\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-volume-slider-minimum-track-skin0000\" x=\"150\" y=\"126\" width=\"100\" height=\"26\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"inset-border-background-skin0000\" x=\"490\" y=\"122\" width=\"14\" height=\"14\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"item-renderer-hover-skin0000\" x=\"266\" y=\"196\" width=\"12\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"item-renderer-selected-up-skin0000\" x=\"436\" y=\"222\" width=\"12\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"item-renderer-up-skin0000\" x=\"496\" y=\"236\" width=\"12\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"mute-toggle-button-loud-up-icon0000\" x=\"460\" y=\"266\" width=\"30\" height=\"26\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"mute-toggle-button-muted-up-icon0000\" x=\"386\" y=\"270\" width=\"30\" height=\"26\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"numeric-stepper-decrement-button-disabled-skin0000\" x=\"350\" y=\"104\" width=\"42\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"numeric-stepper-decrement-button-down-skin0000\" x=\"462\" y=\"138\" width=\"42\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"numeric-stepper-decrement-button-hover-skin0000\" x=\"418\" y=\"142\" width=\"42\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"numeric-stepper-decrement-button-up-skin0000\" x=\"150\" y=\"154\" width=\"42\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"numeric-stepper-increment-button-disabled-skin0000\" x=\"194\" y=\"154\" width=\"42\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"numeric-stepper-increment-button-down-skin0000\" x=\"238\" y=\"154\" width=\"42\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"numeric-stepper-increment-button-hover-skin0000\" x=\"462\" y=\"164\" width=\"42\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"numeric-stepper-increment-button-up-skin0000\" x=\"418\" y=\"168\" width=\"42\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"overlay-play-pause-toggle-button-play-up-icon0000\" x=\"2\" y=\"2\" width=\"146\" height=\"176\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"page-indicator-normal-symbol0000\" x=\"246\" y=\"226\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"page-indicator-selected-symbol0000\" x=\"276\" y=\"250\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"panel-background-skin0000\" x=\"230\" y=\"308\" width=\"22\" height=\"22\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"picker-list-disabled-icon0000\" x=\"326\" y=\"246\" width=\"28\" height=\"28\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"picker-list-down-icon0000\" x=\"356\" y=\"248\" width=\"28\" height=\"28\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"picker-list-hover-icon0000\" x=\"246\" y=\"250\" width=\"28\" height=\"28\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"picker-list-up-icon0000\" x=\"62\" y=\"256\" width=\"28\" height=\"28\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"play-pause-toggle-button-pause-up-icon0000\" x=\"490\" y=\"98\" width=\"20\" height=\"22\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"play-pause-toggle-button-play-up-icon0000\" x=\"103\" y=\"314\" width=\"20\" height=\"22\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"pop-up-volume-slider-maximum-track-skin0000\" x=\"150\" y=\"2\" width=\"50\" height=\"122\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"pop-up-volume-slider-minimum-track-skin0000\" x=\"202\" y=\"2\" width=\"50\" height=\"122\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"progress-bar-fill-skin0000\" x=\"386\" y=\"248\" width=\"12\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"quiet-button-hover-skin0000\" x=\"194\" y=\"180\" width=\"22\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"radio-disabled-icon0000\" x=\"92\" y=\"256\" width=\"28\" height=\"28\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"radio-down-icon0000\" x=\"122\" y=\"256\" width=\"28\" height=\"28\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"radio-hover-icon0000\" x=\"152\" y=\"256\" width=\"28\" height=\"28\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"radio-selected-disabled-icon0000\" x=\"182\" y=\"256\" width=\"28\" height=\"28\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"radio-selected-down-icon0000\" x=\"212\" y=\"256\" width=\"28\" height=\"28\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"radio-selected-hover-icon0000\" x=\"2\" y=\"258\" width=\"28\" height=\"28\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"radio-selected-up-icon0000\" x=\"32\" y=\"258\" width=\"28\" height=\"28\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"radio-up-icon0000\" x=\"430\" y=\"266\" width=\"28\" height=\"28\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"search-disabled-icon0000\" x=\"57\" y=\"314\" width=\"21\" height=\"21\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"search-icon0000\" x=\"80\" y=\"314\" width=\"21\" height=\"21\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"seek-slider-maximum-track-skin0000\" x=\"30\" y=\"315\" width=\"11\" height=\"8\" pivotX=\"1\" pivotY=\"0\"/>\n\t<SubTexture name=\"seek-slider-minimum-track-skin0000\" x=\"43\" y=\"315\" width=\"11\" height=\"8\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"seek-slider-progress-skin0000\" x=\"2\" y=\"316\" width=\"10\" height=\"8\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"simple-border-background-skin0000\" x=\"266\" y=\"180\" width=\"14\" height=\"14\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tab-disabled-skin0000\" x=\"218\" y=\"180\" width=\"22\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tab-down-skin0000\" x=\"340\" y=\"170\" width=\"22\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tab-hover-skin0000\" x=\"364\" y=\"170\" width=\"22\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tab-selected-disabled-skin0000\" x=\"388\" y=\"170\" width=\"22\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tab-selected-up-skin0000\" x=\"462\" y=\"190\" width=\"22\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tab-up-skin0000\" x=\"242\" y=\"180\" width=\"22\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"text-input-background-disabled-skin0000\" x=\"210\" y=\"314\" width=\"10\" height=\"10\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"text-input-background-enabled-skin0000\" x=\"186\" y=\"314\" width=\"10\" height=\"10\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"text-input-background-error-skin0000\" x=\"198\" y=\"314\" width=\"10\" height=\"10\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"toggle-button-selected-disabled-skin0000\" x=\"254\" y=\"108\" width=\"22\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"toggle-button-selected-down-skin0000\" x=\"316\" y=\"170\" width=\"22\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"toggle-button-selected-hover-skin0000\" x=\"486\" y=\"190\" width=\"22\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"toggle-button-selected-up-skin0000\" x=\"412\" y=\"194\" width=\"22\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tool-tip-background-skin0000\" x=\"90\" y=\"286\" width=\"26\" height=\"26\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tree-branch-closed-icon0000\" x=\"316\" y=\"70\" width=\"32\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tree-branch-open-icon0000\" x=\"350\" y=\"70\" width=\"32\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tree-disclosure-closed-icon0000\" x=\"492\" y=\"266\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tree-disclosure-open-icon0000\" x=\"125\" y=\"314\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tree-leaf-icon0000\" x=\"316\" y=\"104\" width=\"32\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-scroll-bar-decrement-button-icon0000\" x=\"154\" y=\"314\" width=\"14\" height=\"9\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-scroll-bar-increment-button-icon0000\" x=\"254\" y=\"308\" width=\"14\" height=\"9\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-scroll-bar-step-button-disabled-skin0000\" x=\"62\" y=\"226\" width=\"30\" height=\"28\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-scroll-bar-step-button-down-skin0000\" x=\"94\" y=\"226\" width=\"30\" height=\"28\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-scroll-bar-step-button-hover-skin0000\" x=\"306\" y=\"216\" width=\"30\" height=\"28\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-scroll-bar-step-button-up-skin0000\" x=\"338\" y=\"216\" width=\"30\" height=\"28\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-scroll-bar-thumb-down-skin0000\" x=\"394\" y=\"36\" width=\"32\" height=\"104\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-scroll-bar-thumb-hover-skin0000\" x=\"428\" y=\"36\" width=\"32\" height=\"104\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-scroll-bar-thumb-icon0000\" x=\"400\" y=\"216\" width=\"10\" height=\"14\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-scroll-bar-thumb-up-skin0000\" x=\"254\" y=\"2\" width=\"32\" height=\"104\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-scroll-bar-track-skin0000\" x=\"350\" y=\"130\" width=\"31\" height=\"8\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-slider-thumb-disabled-skin0000\" x=\"332\" y=\"278\" width=\"26\" height=\"26\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-slider-thumb-down-skin0000\" x=\"242\" y=\"280\" width=\"26\" height=\"26\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-slider-thumb-hover-skin0000\" x=\"304\" y=\"276\" width=\"26\" height=\"26\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-slider-thumb-up-skin0000\" x=\"276\" y=\"276\" width=\"26\" height=\"26\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-slider-track-disabled-skin0000\" x=\"384\" y=\"70\" width=\"8\" height=\"14\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-slider-track-enabled-skin0000\" x=\"384\" y=\"86\" width=\"8\" height=\"14\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-volume-slider-maximum-track-skin0000\" x=\"462\" y=\"36\" width=\"26\" height=\"100\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-volume-slider-minimum-track-skin0000\" x=\"288\" y=\"70\" width=\"26\" height=\"100\" pivotX=\"0\" pivotY=\"0\"/>\n</TextureAtlas>\n"
  },
  {
    "path": "themes/AeonDesktopTheme/package-src.json",
    "content": "{\n\t\"id\": \"feathersui_AeonDesktopTheme-source\",\n\t\"name\": \"Feathers UI Aeon Desktop Theme\",\n\t\"url\": \"https://feathersui.com/as3-starling/\",\n\t\"docUrl\": \"https://feathersui/api-reference/\",\n\t\"description\": \"Aeon desktop theme for Feathers UI (Starling version)\",\n\t\"type\": \"src\",\n\t\"version\": \"4.2.0\",\n\t\"sourceUrl\": \"https://github.com/feathersui/feathersui-starling/releases/download/v4.2.0/feathersui_AeonDesktopTheme-source_4.2.0.airpackage\",\n\t\"publishedAt\": \"2021-11-19T00:00:00.000Z\",\n\t\"dependencies\": [\n\t\t\"starling-source:2.x.x\",\n\t\t\"feathersui-source:4.2.x\"\n\t],\n\t\"parameters\": [],\n\t\"tags\": [\"theme\", \"feathers\", \"starling\"],\n\t\"status\": \"release\",\n\t\"license\": {\n\t  \"type\": \"Simplified BSD\",\n\t  \"url\": \"https://github.com/feathersui/feathersui-starling/blob/v4.2.0/LICENSE.md\",\n\t  \"public\": true\n\t}\n  }\n  "
  },
  {
    "path": "themes/AeonDesktopTheme/package-swc.json",
    "content": "{\n\t\"id\": \"feathersui_AeonDesktopTheme\",\n\t\"name\": \"Feathers UI Aeon Desktop Theme\",\n\t\"url\": \"https://feathersui.com/as3-starling/\",\n\t\"docUrl\": \"https://feathersui/api-reference/\",\n\t\"description\": \"Aeon desktop theme for Feathers UI (Starling version)\",\n\t\"type\": \"swc\",\n\t\"version\": \"4.2.0\",\n\t\"sourceUrl\": \"https://github.com/feathersui/feathersui-starling/releases/download/v4.2.0/feathersui_AeonDesktopTheme_4.2.0.airpackage\",\n\t\"publishedAt\": \"2021-11-19T00:00:00.000Z\",\n\t\"dependencies\": [\n\t\t\"starling:2.x.x\",\n\t\t\"feathersui:4.2.x\"\n\t],\n\t\"parameters\": [],\n\t\"tags\": [\"theme\", \"feathers\", \"starling\"],\n\t\"status\": \"release\",\n\t\"license\": {\n\t  \"type\": \"Simplified BSD\",\n\t  \"url\": \"https://github.com/feathersui/feathersui-starling/blob/v4.2.0/LICENSE.md\",\n\t  \"public\": true\n\t}\n  }\n  "
  },
  {
    "path": "themes/AeonDesktopTheme/source/feathers/themes/AeonDesktopTheme.as",
    "content": "/*\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n*/\npackage feathers.themes\n{\n\timport flash.display.Bitmap;\n\timport flash.display.BitmapData;\n\n\timport starling.textures.Texture;\n\timport starling.textures.TextureAtlas;\n\n\t/**\n\t * The \"Aeon\" theme for desktop Feathers apps.\n\t *\n\t * <p>This version of the theme embeds its assets. To load assets at\n\t * runtime, see <code>AeonDesktopThemeWithAssetManager</code> instead.</p>\n\t *\n\t * @see http://feathersui.com/help/theme-assets.html\n\t */\n\tpublic class AeonDesktopTheme extends BaseAeonDesktopTheme\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\t[Embed(source=\"/../assets/images/aeon_desktop.png\")]\n\t\tprotected static const ATLAS_BITMAP:Class;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\t[Embed(source=\"/../assets/images/aeon_desktop.xml\",mimeType=\"application/octet-stream\")]\n\t\tprotected static const ATLAS_XML:Class;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const ATLAS_SCALE_FACTOR:int = 2;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function AeonDesktopTheme()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.initialize();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tthis.initializeTextureAtlas();\n\t\t\tsuper.initialize();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function initializeTextureAtlas():void\n\t\t{\n\t\t\tvar atlasBitmapData:BitmapData = Bitmap(new ATLAS_BITMAP()).bitmapData;\n\t\t\tvar atlasTexture:Texture = Texture.fromBitmapData(atlasBitmapData, false, false, ATLAS_SCALE_FACTOR);\n\t\t\tatlasTexture.root.onRestore = this.atlasTexture_onRestore;\n\t\t\tatlasBitmapData.dispose();\n\t\t\tthis.atlas = new TextureAtlas(atlasTexture, XML(new ATLAS_XML()));\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function atlasTexture_onRestore():void\n\t\t{\n\t\t\tvar atlasBitmapData:BitmapData = Bitmap(new ATLAS_BITMAP()).bitmapData;\n\t\t\tthis.atlas.texture.root.uploadBitmapData(atlasBitmapData);\n\t\t\tatlasBitmapData.dispose();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "themes/AeonDesktopTheme/source/feathers/themes/AeonDesktopThemeWithAssetManager.as",
    "content": "/*\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n*/\npackage feathers.themes\n{\n\timport feathers.events.FeathersEventType;\n\n\timport starling.assets.AssetManager;\n\timport starling.core.Starling;\n\timport starling.events.Event;\n\n\t/**\n\t * @copy feathers.themes.IAsyncTheme#event:complete\n\t *\n\t * @eventType starling.events.Event.COMPLETE\n\t */\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the theme's assets fail to load due to an error.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The error string.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.ERROR\n\t */\n\t[Event(name=\"error\",type=\"starling.events.Event\")]\n\n\t/**\n\t * The \"Aeon\" theme for desktop Feathers apps.\n\t *\n\t * <p>This version of the theme requires loading assets at runtime. To use\n\t * embedded assets, see <code>AeonDesktopTheme</code> instead.</p>\n\t *\n\t * <p>To use this theme, the following files must be included when packaging\n\t * your app:</p>\n\t * <ul>\n\t *     <li>images/aeon_desktop.png</li>\n\t *     <li>images/aeon_desktop.xml</li>\n\t * </ul>\n\t *\n\t * @see http://feathersui.com/help/theme-assets.html\n\t */\n\tpublic class AeonDesktopThemeWithAssetManager extends BaseAeonDesktopTheme implements IAsyncTheme\n\t{\n\t\t/**\n\t\t * @private\n\t\t * The name of the texture atlas in the asset manager.\n\t\t */\n\t\tprotected static const ATLAS_NAME:String = \"aeon_desktop\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const ATLAS_SCALE_FACTOR:int = 2;\n\n\t\t/**\n\t\t * Constructor.\n\t\t * @param assetsBasePath The root folder of the assets.\n\t\t * @param assetManager An optional pre-created AssetManager. The scaleFactor property must be equal to Starling.contentScaleFactor. To load assets with a different scale factor, use multiple AssetManager instances.\n\t\t */\n\t\tpublic function AeonDesktopThemeWithAssetManager(assetsBasePath:String = \"./\", assetManager:AssetManager = null)\n\t\t{\n\t\t\tthis.loadAssets(assetsBasePath, assetManager);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var assetManager:AssetManager;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var isComplete:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t * The paths to each of the assets, relative to the base path.\n\t\t */\n\t\tprotected var assetPaths:Vector.<String> = new <String>\n\t\t[\n\t\t\t\"images/\" + ATLAS_NAME + \".xml\",\n\t\t\t\"images/\" + ATLAS_NAME + \".png\"\n\t\t];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tsuper.dispose();\n\t\t\tif(this.assetManager)\n\t\t\t{\n\t\t\t\tthis.assetManager.removeTextureAtlas(ATLAS_NAME);\n\t\t\t\tthis.assetManager = null;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.themes.IAsyncTheme#isCompleteForStarling()\n\t\t */\n\t\tpublic function isCompleteForStarling(starling:Starling):Boolean\n\t\t{\n\t\t\treturn this.isComplete;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tthis.initializeTextureAtlas();\n\t\t\tsuper.initialize();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function initializeTextureAtlas():void\n\t\t{\n\t\t\tthis.atlas = this.assetManager.getTextureAtlas(ATLAS_NAME);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function loadAssets(assetsBasePath:String, assetManager:AssetManager):void\n\t\t{\n\t\t\tvar oldScaleFactor:Number = -1;\n\t\t\tif(assetManager)\n\t\t\t{\n\t\t\t\toldScaleFactor = assetManager.textureOptions.scale;\n\t\t\t\tassetManager.textureOptions.scale = ATLAS_SCALE_FACTOR;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tassetManager = new AssetManager(ATLAS_SCALE_FACTOR);\n\t\t\t}\n\t\t\tthis.assetManager = assetManager;\n\t\t\t//add a trailing slash, if needed\n\t\t\tif(assetsBasePath.lastIndexOf(\"/\") != assetsBasePath.length - 1)\n\t\t\t{\n\t\t\t\tassetsBasePath += \"/\";\n\t\t\t}\n\t\t\tvar assetCount:int = this.assetPaths.length;\n\t\t\tfor(var i:int = 0; i < assetCount; i++)\n\t\t\t{\n\t\t\t\tvar asset:String = this.assetPaths[i];\n\t\t\t\tthis.assetManager.enqueue(assetsBasePath + asset);\n\t\t\t}\n\t\t\tif(oldScaleFactor != -1)\n\t\t\t{\n\t\t\t\t//restore the old scale factor, just in case\n\t\t\t\tthis.assetManager.textureOptions.scale = oldScaleFactor;\n\t\t\t}\n\t\t\tthis.assetManager.loadQueue(assetManager_onComplete, assetManager_onError);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function assetManager_onComplete():void\n\t\t{\n\t\t\tthis.initialize();\n\t\t\tthis.isComplete = true;\n\t\t\tthis.dispatchEventWith(Event.COMPLETE, false, Starling.current);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function assetManager_onError(error:String):void\n\t\t{\n\t\t\tthis.dispatchEventWith(FeathersEventType.ERROR, false, error);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "themes/AeonDesktopTheme/source/feathers/themes/BaseAeonDesktopTheme.as",
    "content": "/*\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n*/\npackage feathers.themes\n{\n\timport feathers.controls.Alert;\n\timport feathers.controls.AutoComplete;\n\timport feathers.controls.AutoSizeMode;\n\timport feathers.controls.Button;\n\timport feathers.controls.ButtonGroup;\n\timport feathers.controls.ButtonState;\n\timport feathers.controls.Callout;\n\timport feathers.controls.Check;\n\timport feathers.controls.DataGrid;\n\timport feathers.controls.DateTimeSpinner;\n\timport feathers.controls.Drawers;\n\timport feathers.controls.GroupedList;\n\timport feathers.controls.Header;\n\timport feathers.controls.IScrollBar;\n\timport feathers.controls.ImageLoader;\n\timport feathers.controls.Label;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.List;\n\timport feathers.controls.NumericStepper;\n\timport feathers.controls.PageIndicator;\n\timport feathers.controls.PageIndicatorInteractionMode;\n\timport feathers.controls.Panel;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.PickerList;\n\timport feathers.controls.ProgressBar;\n\timport feathers.controls.Radio;\n\timport feathers.controls.ScrollBar;\n\timport feathers.controls.ScrollBarDisplayMode;\n\timport feathers.controls.ScrollContainer;\n\timport feathers.controls.ScrollInteractionMode;\n\timport feathers.controls.ScrollPolicy;\n\timport feathers.controls.ScrollScreen;\n\timport feathers.controls.ScrollText;\n\timport feathers.controls.Scroller;\n\timport feathers.controls.SimpleScrollBar;\n\timport feathers.controls.Slider;\n\timport feathers.controls.SpinnerList;\n\timport feathers.controls.StepperButtonLayoutMode;\n\timport feathers.controls.TabBar;\n\timport feathers.controls.TextArea;\n\timport feathers.controls.TextCallout;\n\timport feathers.controls.TextInput;\n\timport feathers.controls.TextInputState;\n\timport feathers.controls.Toast;\n\timport feathers.controls.ToggleButton;\n\timport feathers.controls.ToggleSwitch;\n\timport feathers.controls.TrackLayoutMode;\n\timport feathers.controls.Tree;\n\timport feathers.controls.popups.DropDownPopUpContentManager;\n\timport feathers.controls.renderers.BaseDefaultItemRenderer;\n\timport feathers.controls.renderers.DefaultDataGridCellRenderer;\n\timport feathers.controls.renderers.DefaultDataGridHeaderRenderer;\n\timport feathers.controls.renderers.DefaultGroupedListHeaderOrFooterRenderer;\n\timport feathers.controls.renderers.DefaultGroupedListItemRenderer;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.renderers.DefaultTreeItemRenderer;\n\timport feathers.controls.text.TextFieldTextEditor;\n\timport feathers.controls.text.TextFieldTextEditorViewPort;\n\timport feathers.controls.text.TextFieldTextRenderer;\n\timport feathers.core.FeathersControl;\n\timport feathers.core.FocusManager;\n\timport feathers.core.ITextEditor;\n\timport feathers.core.ITextRenderer;\n\timport feathers.core.PopUpManager;\n\timport feathers.core.ToolTipManager;\n\timport feathers.layout.Direction;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.HorizontalLayout;\n\timport feathers.layout.RelativePosition;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.media.FullScreenToggleButton;\n\timport feathers.media.MuteToggleButton;\n\timport feathers.media.PlayPauseToggleButton;\n\timport feathers.media.SeekSlider;\n\timport feathers.media.VolumeSlider;\n\timport feathers.skins.ImageSkin;\n\timport feathers.themes.BaseAeonDesktopTheme;\n\n\timport flash.geom.Rectangle;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.DisplayObjectContainer;\n\timport starling.display.Image;\n\timport starling.display.Quad;\n\timport starling.display.Stage;\n\timport starling.text.TextFormat;\n\timport starling.textures.Texture;\n\timport starling.textures.TextureAtlas;\n\n\t/**\n\t * The base class for the \"Aeon\" theme for desktop Feathers apps. Handles\n\t * everything except asset loading, which is left to subclasses.\n\t *\n\t * @see AeonDesktopTheme\n\t * @see AeonDesktopThemeWithAssetManager\n\t */\n\tpublic class BaseAeonDesktopTheme extends StyleNameFunctionTheme\n\t{\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the increment button of a horizontal ScrollBar.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_INCREMENT_BUTTON:String = \"aeon-horizontal-scroll-bar-increment-button\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the decrement button of a horizontal ScrollBar.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_DECREMENT_BUTTON:String = \"aeon-horizontal-scroll-bar-decrement-button\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the thumb of a horizontal ScrollBar.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_THUMB:String = \"aeon-horizontal-scroll-bar-thumb\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the minimum track of a horizontal ScrollBar.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_MINIMUM_TRACK:String = \"aeon-horizontal-scroll-bar-minimum-track\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the increment button of a vertical ScrollBar.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_INCREMENT_BUTTON:String = \"aeon-vertical-scroll-bar-increment-button\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the decrement button of a vertical ScrollBar.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_DECREMENT_BUTTON:String = \"aeon-vertical-scroll-bar-decrement-button\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the thumb of a vertical ScrollBar.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_THUMB:String = \"aeon-vertical-scroll-bar-thumb\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the minimum track of a vertical ScrollBar.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_MINIMUM_TRACK:String = \"aeon-vertical-scroll-bar-minimum-track\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the thumb of a horizontal SimpleScrollBar.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_HORIZONTAL_SIMPLE_SCROLL_BAR_THUMB:String = \"aeon-horizontal-simple-scroll-bar-thumb\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the thumb of a vertical SimpleScrollBar.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_VERTICAL_SIMPLE_SCROLL_BAR_THUMB:String = \"aeon-vertical-simple-scroll-bar-thumb\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the thumb of a horizontal Slider.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_HORIZONTAL_SLIDER_THUMB:String = \"aeon-horizontal-slider-thumb\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the minimum track of a horizontal Slider.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_HORIZONTAL_SLIDER_MINIMUM_TRACK:String = \"aeon-horizontal-slider-minimum-track\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the thumb of a vertical Slider.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_VERTICAL_SLIDER_THUMB:String = \"aeon-vertical-slider-thumb\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the minimum track of a vertical Slider.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_VERTICAL_SLIDER_MINIMUM_TRACK:String = \"aeon-vertical-slider-minimum-track\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the minimum track of a vertical VolumeSlider.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_VERTICAL_VOLUME_SLIDER_MINIMUM_TRACK:String = \"aeon-vertical-volume-slider-minimum-track\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the maximum track of a vertical VolumeSlider.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_VERTICAL_VOLUME_SLIDER_MAXIMUM_TRACK:String = \"aeon-vertical-volume-slider-maximum-track\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the minimum track of a horizontal VolumeSlider.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_HORIZONTAL_VOLUME_SLIDER_MINIMUM_TRACK:String = \"aeon-horizontal-volume-slider-minimum-track\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the maximum track of a horizontal VolumeSlider.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_HORIZONTAL_VOLUME_SLIDER_MAXIMUM_TRACK:String = \"aeon-horizontal-volume-slider-maximum-track\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the minimum track of a pop-up VolumeSlider.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_POP_UP_VOLUME_SLIDER_MINIMUM_TRACK:String = \"aeon-pop-up-volume-slider-minimum-track\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the maximum track of a pop-up VolumeSlider.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_POP_UP_VOLUME_SLIDER_MAXIMUM_TRACK:String = \"aeon-pop-up-volume-slider-maximum-track\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the item renderer of a SpinnerList in a DateTimeSpinner.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_DATE_TIME_SPINNER_LIST_ITEM_RENDERER:String = \"aeon-date-time-spinner-list-item-renderer\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the action buttons of a toast.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_TOAST_ACTIONS_BUTTON:String = \"metal-works-mobile-toast-actions-button\";\n\n\t\t/**\n\t\t * The name of the font used by controls in this theme. This font is not\n\t\t * embedded. It is the default sans-serif system font.\n\t\t */\n\t\tpublic static const FONT_NAME:String = \"_sans\";\n\n\t\tprotected static const FOCUS_INDICATOR_SCALE_9_GRID:Rectangle = new Rectangle(5, 5, 2, 2);\n\t\tprotected static const TOOL_TIP_SCALE_9_GRID:Rectangle = new Rectangle(5, 5, 1, 1);\n\t\tprotected static const CALLOUT_SCALE_9_GRID:Rectangle = new Rectangle(5, 5, 1, 1);\n\t\tprotected static const BUTTON_SCALE_9_GRID:Rectangle = new Rectangle(5, 5, 1, 12);\n\t\tprotected static const TAB_SCALE_9_GRID:Rectangle = new Rectangle(5, 5, 1, 15);\n\t\tprotected static const STEPPER_INCREMENT_BUTTON_SCALE_9_GRID:Rectangle = new Rectangle(1, 9, 15, 1);\n\t\tprotected static const STEPPER_DECREMENT_BUTTON_SCALE_9_GRID:Rectangle = new Rectangle(1, 1, 15, 1);\n\t\tprotected static const HORIZONTAL_SLIDER_TRACK_SCALE_9_GRID:Rectangle = new Rectangle(3, 0, 1, 4);\n\t\tprotected static const VERTICAL_SLIDER_TRACK_SCALE_9_GRID:Rectangle = new Rectangle(0, 3, 4, 1);\n\t\tprotected static const TEXT_INPUT_SCALE_9_GRID:Rectangle = new Rectangle(2, 2, 1, 1);\n\t\tprotected static const VERTICAL_SCROLL_BAR_THUMB_SCALE_9_GRID:Rectangle = new Rectangle(2, 5, 6, 42);\n\t\tprotected static const VERTICAL_SCROLL_BAR_TRACK_SCALE_9_GRID:Rectangle = new Rectangle(2, 1, 11, 2);\n\t\tprotected static const VERTICAL_SCROLL_BAR_STEP_BUTTON_SCALE_9_GRID:Rectangle = new Rectangle(2, 2, 11, 10);\n\t\tprotected static const HORIZONTAL_SCROLL_BAR_THUMB_SCALE_9_GRID:Rectangle = new Rectangle(5, 2, 42, 6);\n\t\tprotected static const HORIZONTAL_SCROLL_BAR_TRACK_SCALE_9_GRID:Rectangle = new Rectangle(1, 2, 2, 11);\n\t\tprotected static const HORIZONTAL_SCROLL_BAR_STEP_BUTTON_SCALE_9_GRID:Rectangle = new Rectangle(2, 2, 10, 11);\n\t\tprotected static const SIMPLE_BORDER_SCALE_9_GRID:Rectangle = new Rectangle(2, 2, 2, 2);\n\t\tprotected static const PANEL_BORDER_SCALE_9_GRID:Rectangle = new Rectangle(5, 5, 1, 1);\n\t\tprotected static const HEADER_SCALE_9_GRID:Rectangle = new Rectangle(1, 1, 2, 28);\n\t\tprotected static const SEEK_SLIDER_MINIMUM_TRACK_SCALE_9_GRID:Rectangle = new Rectangle(3, 0, 1, 4);\n\t\tprotected static const SEEK_SLIDER_MAXIMUM_TRACK_SCALE_9_GRID:Rectangle = new Rectangle(1, 0, 1, 4);\n\t\tprotected static const DATA_GRID_VERTICAL_DIVIDER_SCALE_9_GRID:Rectangle = new Rectangle(0, 2, 1, 2);\n\t\tprotected static const DATA_GRID_HEADER_DIVIDER_SCALE_9_GRID:Rectangle = new Rectangle(0, 2, 5, 2);\n\t\tprotected static const DATA_GRID_COLUMN_DROP_INDICATOR_SCALE_9_GRID:Rectangle = new Rectangle(0, 2, 3, 2);\n\t\t\n\t\tprotected static const ITEM_RENDERER_SKIN_TEXTURE_REGION:Rectangle = new Rectangle(1, 1, 4, 4);\n\t\tprotected static const PROGRESS_BAR_FILL_TEXTURE_REGION:Rectangle = new Rectangle(1, 1, 4, 4);\n\n\t\tprotected static const BACKGROUND_COLOR:uint = 0x869CA7;\n\t\tprotected static const MODAL_OVERLAY_COLOR:uint = 0xDDDDDD;\n\t\tprotected static const MODAL_OVERLAY_ALPHA:Number = 0.5;\n\t\tprotected static const PRIMARY_TEXT_COLOR:uint = 0x0B333C;\n\t\tprotected static const DISABLED_TEXT_COLOR:uint = 0x5B6770;\n\t\tprotected static const INVERTED_TEXT_COLOR:uint = 0xffffff;\n\t\tprotected static const ACTIVE_TEXT_COLOR:uint = 0x009dff;\n\t\tprotected static const VIDEO_OVERLAY_COLOR:uint = 0xc9e0eE;\n\t\tprotected static const VIDEO_OVERLAY_ALPHA:Number = 0.25;\n\n\t\t/**\n\t\t * The default global text renderer factory for this theme creates a\n\t\t * TextFieldTextRenderer.\n\t\t */\n\t\tprotected static function textRendererFactory():ITextRenderer\n\t\t{\n\t\t\treturn new TextFieldTextRenderer();\n\t\t}\n\n\t\t/**\n\t\t * The default global text editor factory for this theme creates a\n\t\t * TextFieldTextEditor.\n\t\t */\n\t\tprotected static function textEditorFactory():ITextEditor\n\t\t{\n\t\t\treturn new TextFieldTextEditor();\n\t\t}\n\n\t\t/**\n\t\t * This theme's scroll bar type is ScrollBar.\n\t\t */\n\t\tprotected static function scrollBarFactory():IScrollBar\n\t\t{\n\t\t\treturn new ScrollBar();\n\t\t}\n\n\t\tprotected static function popUpOverlayFactory():DisplayObject\n\t\t{\n\t\t\tvar quad:Quad = new Quad(100, 100, MODAL_OVERLAY_COLOR);\n\t\t\tquad.alpha = MODAL_OVERLAY_ALPHA;\n\t\t\treturn quad;\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function BaseAeonDesktopTheme()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * A smaller font size for details.\n\t\t */\n\t\tprotected var smallFontSize:int = 10;\n\n\t\t/**\n\t\t * A normal font size.\n\t\t */\n\t\tprotected var regularFontSize:int = 11;\n\n\t\t/**\n\t\t * A larger font size for headers.\n\t\t */\n\t\tprotected var largeFontSize:int = 13;\n\n\t\t/**\n\t\t * The size, in pixels, of major regions in the grid. Used for sizing\n\t\t * containers and larger UI controls.\n\t\t */\n\t\tprotected var gridSize:int = 30;\n\n\t\t/**\n\t\t * The size, in pixels, of minor regions in the grid. Used for larger\n\t\t * padding and gaps.\n\t\t */\n\t\tprotected var gutterSize:int = 10;\n\n\t\t/**\n\t\t * The size, in pixels, of smaller padding and gaps within the major\n\t\t * regions in the grid.\n\t\t */\n\t\tprotected var smallGutterSize:int = 6;\n\n\t\t/**\n\t\t * The size, in pixels, of very smaller padding and gaps.\n\t\t */\n\t\tprotected var extraSmallGutterSize:int = 2;\n\n\t\t/**\n\t\t * The minimum width, in pixels, of some types of buttons.\n\t\t */\n\t\tprotected var buttonMinWidth:int = 40;\n\n\t\t/**\n\t\t * The width, in pixels, of UI controls that span across multiple grid regions.\n\t\t */\n\t\tprotected var wideControlSize:int = 152;\n\n\t\t/**\n\t\t * The width, in pixels, of very large UI controls.\n\t\t */\n\t\tprotected var extraWideControlSize:int = 210;\n\n\t\t/**\n\t\t * The size, in pixels, of a typical UI control.\n\t\t */\n\t\tprotected var controlSize:int = 22;\n\n\t\t/**\n\t\t * The size, in pixels, of smaller UI controls.\n\t\t */\n\t\tprotected var smallControlSize:int = 12;\n\n\t\t/**\n\t\t * The size, in pixels, of a border around any control.\n\t\t */\n\t\tprotected var borderSize:int = 1;\n\n\t\tprotected var calloutBackgroundMinSize:int = 5;\n\t\tprotected var calloutArrowOverlapGap:int = -1;\n\t\tprotected var progressBarFillMinSize:int = 7;\n\t\tprotected var popUpSize:int = 354;\n\t\tprotected var popUpVolumeSliderPaddingSize:int = 6;\n\t\tprotected var bottomDropShadowSize:int = 3;\n\t\tprotected var leftAndRightDropShadowSize:int = 1;\n\n\t\t/**\n\t\t * The texture atlas that contains skins for this theme. This base class\n\t\t * does not initialize this member variable. Subclasses are expected to\n\t\t * load the assets somehow and set the <code>atlas</code> member\n\t\t * variable before calling <code>initialize()</code>.\n\t\t */\n\t\tprotected var atlas:TextureAtlas;\n\n\t\t/**\n\t\t * Font styles for most UI controls and text.\n\t\t */\n\t\tprotected var defaultFontStyles:TextFormat;\n\n\t\t/**\n\t\t * Font styles for most disabled UI controls and text.\n\t\t */\n\t\tprotected var disabledFontStyles:TextFormat;\n\n\t\t/**\n\t\t * Font styles for larger text.\n\t\t */\n\t\tprotected var headingFontStyles:TextFormat;\n\n\t\t/**\n\t\t * Font styles for larger, disabled text.\n\t\t */\n\t\tprotected var headingDisabledFontStyles:TextFormat;\n\n\t\t/**\n\t\t * Font styles for smaller text.\n\t\t */\n\t\tprotected var detailFontStyles:TextFormat;\n\n\t\t/**\n\t\t * Font styles for smaller, disabled text.\n\t\t */\n\t\tprotected var detailDisabledFontStyles:TextFormat;\n\n\t\t/**\n\t\t * Font styles for text on dark backgrounds.\n\t\t */\n\t\tprotected var invertedFontStyles:TextFormat;\n\n\t\t/**\n\t\t * Font styles for toast actions.\n\t\t */\n\t\tprotected var toastActionFontStyles:TextFormat;\n\n\t\t/**\n\t\t * Font styles for active toast actions.\n\t\t */\n\t\tprotected var toastActionActiveFontStyles:TextFormat;\n\n\t\tprotected var focusIndicatorSkinTexture:Texture;\n\t\tprotected var toolTipBackgroundSkinTexture:Texture;\n\t\tprotected var calloutBackgroundSkinTexture:Texture;\n\t\tprotected var calloutTopArrowSkinTexture:Texture;\n\t\tprotected var calloutRightArrowSkinTexture:Texture;\n\t\tprotected var calloutBottomArrowSkinTexture:Texture;\n\t\tprotected var calloutLeftArrowSkinTexture:Texture;\n\t\tprotected var dangerCalloutBackgroundSkinTexture:Texture;\n\t\tprotected var dangerCalloutTopArrowSkinTexture:Texture;\n\t\tprotected var dangerCalloutRightArrowSkinTexture:Texture;\n\t\tprotected var dangerCalloutBottomArrowSkinTexture:Texture;\n\t\tprotected var dangerCalloutLeftArrowSkinTexture:Texture;\n\n\t\tprotected var buttonUpSkinTexture:Texture;\n\t\tprotected var buttonHoverSkinTexture:Texture;\n\t\tprotected var buttonDownSkinTexture:Texture;\n\t\tprotected var buttonDisabledSkinTexture:Texture;\n\t\tprotected var toggleButtonSelectedUpSkinTexture:Texture;\n\t\tprotected var toggleButtonSelectedHoverSkinTexture:Texture;\n\t\tprotected var toggleButtonSelectedDownSkinTexture:Texture;\n\t\tprotected var toggleButtonSelectedDisabledSkinTexture:Texture;\n\t\tprotected var quietButtonHoverSkinTexture:Texture;\n\t\tprotected var callToActionButtonUpSkinTexture:Texture;\n\t\tprotected var callToActionButtonHoverSkinTexture:Texture;\n\t\tprotected var dangerButtonUpSkinTexture:Texture;\n\t\tprotected var dangerButtonHoverSkinTexture:Texture;\n\t\tprotected var dangerButtonDownSkinTexture:Texture;\n\t\tprotected var backButtonUpIconTexture:Texture;\n\t\tprotected var backButtonDisabledIconTexture:Texture;\n\t\tprotected var forwardButtonUpIconTexture:Texture;\n\t\tprotected var forwardButtonDisabledIconTexture:Texture;\n\n\t\tprotected var tabUpSkinTexture:Texture;\n\t\tprotected var tabHoverSkinTexture:Texture;\n\t\tprotected var tabDownSkinTexture:Texture;\n\t\tprotected var tabDisabledSkinTexture:Texture;\n\t\tprotected var tabSelectedUpSkinTexture:Texture;\n\t\tprotected var tabSelectedDisabledSkinTexture:Texture;\n\n\t\tprotected var stepperIncrementButtonUpSkinTexture:Texture;\n\t\tprotected var stepperIncrementButtonHoverSkinTexture:Texture;\n\t\tprotected var stepperIncrementButtonDownSkinTexture:Texture;\n\t\tprotected var stepperIncrementButtonDisabledSkinTexture:Texture;\n\n\t\tprotected var stepperDecrementButtonUpSkinTexture:Texture;\n\t\tprotected var stepperDecrementButtonHoverSkinTexture:Texture;\n\t\tprotected var stepperDecrementButtonDownSkinTexture:Texture;\n\t\tprotected var stepperDecrementButtonDisabledSkinTexture:Texture;\n\n\t\tprotected var hSliderThumbUpSkinTexture:Texture;\n\t\tprotected var hSliderThumbHoverSkinTexture:Texture;\n\t\tprotected var hSliderThumbDownSkinTexture:Texture;\n\t\tprotected var hSliderThumbDisabledSkinTexture:Texture;\n\t\tprotected var hSliderTrackEnabledSkinTexture:Texture;\n\n\t\tprotected var vSliderThumbUpSkinTexture:Texture;\n\t\tprotected var vSliderThumbHoverSkinTexture:Texture;\n\t\tprotected var vSliderThumbDownSkinTexture:Texture;\n\t\tprotected var vSliderThumbDisabledSkinTexture:Texture;\n\t\tprotected var vSliderTrackEnabledSkinTexture:Texture;\n\n\t\tprotected var itemRendererUpSkinTexture:Texture;\n\t\tprotected var itemRendererHoverSkinTexture:Texture;\n\t\tprotected var itemRendererSelectedUpSkinTexture:Texture;\n\n\t\tprotected var dataGridVerticalDividerSkinTexture:Texture;\n\t\tprotected var dataGridHeaderBackgroundSkinTexture:Texture;\n\t\tprotected var dataGridHeaderDividerSkinTexture:Texture;\n\t\tprotected var dataGridHeaderSortAscendingIconTexture:Texture;\n\t\tprotected var dataGridHeaderSortDescendingIconTexture:Texture;\n\t\tprotected var dataGridColumnDropIndicatorSkinTexture:Texture;\n\t\tprotected var dataGridColumnResizeSkinTexture:Texture;\n\n\t\tprotected var headerBackgroundSkinTexture:Texture;\n\t\tprotected var groupedListHeaderBackgroundSkinTexture:Texture;\n\n\t\tprotected var checkUpIconTexture:Texture;\n\t\tprotected var checkHoverIconTexture:Texture;\n\t\tprotected var checkDownIconTexture:Texture;\n\t\tprotected var checkDisabledIconTexture:Texture;\n\t\tprotected var checkSelectedUpIconTexture:Texture;\n\t\tprotected var checkSelectedHoverIconTexture:Texture;\n\t\tprotected var checkSelectedDownIconTexture:Texture;\n\t\tprotected var checkSelectedDisabledIconTexture:Texture;\n\n\t\tprotected var radioUpIconTexture:Texture;\n\t\tprotected var radioHoverIconTexture:Texture;\n\t\tprotected var radioDownIconTexture:Texture;\n\t\tprotected var radioDisabledIconTexture:Texture;\n\t\tprotected var radioSelectedUpIconTexture:Texture;\n\t\tprotected var radioSelectedHoverIconTexture:Texture;\n\t\tprotected var radioSelectedDownIconTexture:Texture;\n\t\tprotected var radioSelectedDisabledIconTexture:Texture;\n\n\t\tprotected var pageIndicatorNormalSkinTexture:Texture;\n\t\tprotected var pageIndicatorSelectedSkinTexture:Texture;\n\n\t\tprotected var pickerListUpIconTexture:Texture;\n\t\tprotected var pickerListHoverIconTexture:Texture;\n\t\tprotected var pickerListDownIconTexture:Texture;\n\t\tprotected var pickerListDisabledIconTexture:Texture;\n\n\t\tprotected var textInputBackgroundEnabledSkinTexture:Texture;\n\t\tprotected var textInputBackgroundDisabledSkinTexture:Texture;\n\t\tprotected var textInputBackgroundErrorSkinTexture:Texture;\n\t\tprotected var textInputSearchIconTexture:Texture;\n\t\tprotected var textInputSearchIconDisabledTexture:Texture;\n\n\t\tprotected var vScrollBarThumbUpSkinTexture:Texture;\n\t\tprotected var vScrollBarThumbHoverSkinTexture:Texture;\n\t\tprotected var vScrollBarThumbDownSkinTexture:Texture;\n\t\tprotected var vScrollBarTrackSkinTexture:Texture;\n\t\tprotected var vScrollBarThumbIconTexture:Texture;\n\t\tprotected var vScrollBarStepButtonUpSkinTexture:Texture;\n\t\tprotected var vScrollBarStepButtonHoverSkinTexture:Texture;\n\t\tprotected var vScrollBarStepButtonDownSkinTexture:Texture;\n\t\tprotected var vScrollBarStepButtonDisabledSkinTexture:Texture;\n\t\tprotected var vScrollBarDecrementButtonIconTexture:Texture;\n\t\tprotected var vScrollBarIncrementButtonIconTexture:Texture;\n\n\t\tprotected var hScrollBarThumbUpSkinTexture:Texture;\n\t\tprotected var hScrollBarThumbHoverSkinTexture:Texture;\n\t\tprotected var hScrollBarThumbDownSkinTexture:Texture;\n\t\tprotected var hScrollBarTrackSkinTexture:Texture;\n\t\tprotected var hScrollBarThumbIconTexture:Texture;\n\t\tprotected var hScrollBarStepButtonUpSkinTexture:Texture;\n\t\tprotected var hScrollBarStepButtonHoverSkinTexture:Texture;\n\t\tprotected var hScrollBarStepButtonDownSkinTexture:Texture;\n\t\tprotected var hScrollBarStepButtonDisabledSkinTexture:Texture;\n\t\tprotected var hScrollBarDecrementButtonIconTexture:Texture;\n\t\tprotected var hScrollBarIncrementButtonIconTexture:Texture;\n\n\t\tprotected var simpleBorderBackgroundSkinTexture:Texture;\n\t\tprotected var insetBorderBackgroundSkinTexture:Texture;\n\t\tprotected var panelBorderBackgroundSkinTexture:Texture;\n\t\tprotected var alertBorderBackgroundSkinTexture:Texture;\n\n\t\tprotected var progressBarFillSkinTexture:Texture;\n\t\t\n\t\tprotected var listDrillDownAccessoryTexture:Texture;\n\n\t\tprotected var treeBranchOpenIconTexture:Texture;\n\t\tprotected var treeBranchClosedIconTexture:Texture;\n\t\tprotected var treeLeafIconTexture:Texture;\n\t\tprotected var treeDisclosureOpenIconTexture:Texture;\n\t\tprotected var treeDisclosureClosedIconTexture:Texture;\n\n\t\t//media textures\n\t\tprotected var playPauseButtonPlayUpIconTexture:Texture;\n\t\tprotected var playPauseButtonPauseUpIconTexture:Texture;\n\t\tprotected var overlayPlayPauseButtonPlayUpIconTexture:Texture;\n\t\tprotected var fullScreenToggleButtonEnterUpIconTexture:Texture;\n\t\tprotected var fullScreenToggleButtonExitUpIconTexture:Texture;\n\t\tprotected var muteToggleButtonLoudUpIconTexture:Texture;\n\t\tprotected var muteToggleButtonMutedUpIconTexture:Texture;\n\t\tprotected var horizontalVolumeSliderMinimumTrackSkinTexture:Texture;\n\t\tprotected var horizontalVolumeSliderMaximumTrackSkinTexture:Texture;\n\t\tprotected var verticalVolumeSliderMinimumTrackSkinTexture:Texture;\n\t\tprotected var verticalVolumeSliderMaximumTrackSkinTexture:Texture;\n\t\tprotected var popUpVolumeSliderMinimumTrackSkinTexture:Texture;\n\t\tprotected var popUpVolumeSliderMaximumTrackSkinTexture:Texture;\n\t\tprotected var seekSliderMinimumTrackSkinTexture:Texture;\n\t\tprotected var seekSliderMaximumTrackSkinTexture:Texture;\n\t\tprotected var seekSliderProgressSkinTexture:Texture;\n\n\t\t/**\n\t\t * Disposes the texture atlas before calling super.dispose()\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this.atlas)\n\t\t\t{\n\t\t\t\t//if anything is keeping a reference to the texture, we don't\n\t\t\t\t//want it to keep a reference to the theme too.\n\t\t\t\tthis.atlas.texture.root.onRestore = null;\n\t\t\t\t\n\t\t\t\tthis.atlas.dispose();\n\t\t\t\tthis.atlas = null;\n\t\t\t}\n\n\t\t\tvar stage:Stage = this.starling.stage;\n\t\t\tFocusManager.setEnabledForStage(stage, false);\n\t\t\tToolTipManager.setEnabledForStage(stage, false);\n\n\t\t\t//don't forget to call super.dispose()!\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * Initializes the theme. Expected to be called by subclasses after the\n\t\t * assets have been loaded and the skin texture atlas has been created.\n\t\t */\n\t\tprotected function initialize():void\n\t\t{\n\t\t\tthis.initializeFonts();\n\t\t\tthis.initializeTextures();\n\t\t\tthis.initializeGlobals();\n\t\t\tthis.initializeStage();\n\t\t\tthis.initializeStyleProviders();\n\t\t}\n\n\t\t/**\n\t\t * Sets the stage background color.\n\t\t */\n\t\tprotected function initializeStage():void\n\t\t{\n\t\t\tthis.starling.stage.color = BACKGROUND_COLOR;\n\t\t\tthis.starling.nativeStage.color = BACKGROUND_COLOR;\n\t\t}\n\n\t\t/**\n\t\t * Initializes global variables (not including global style providers).\n\t\t */\n\t\tprotected function initializeGlobals():void\n\t\t{\n\t\t\tvar stage:Stage = this.starling.stage;\n\t\t\tFocusManager.setEnabledForStage(stage, true);\n\t\t\tToolTipManager.setEnabledForStage(stage, true);\n\n\t\t\tFeathersControl.defaultTextRendererFactory = textRendererFactory;\n\t\t\tFeathersControl.defaultTextEditorFactory = textEditorFactory;\n\n\t\t\tPopUpManager.overlayFactory = popUpOverlayFactory;\n\t\t\tCallout.stagePadding = this.smallGutterSize;\n\t\t\tToast.containerFactory = toastContainerFactory;\n\t\t}\n\n\t\t/**\n\t\t * Initializes font sizes and formats.\n\t\t */\n\t\tprotected function initializeFonts():void\n\t\t{\n\t\t\tthis.defaultFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, PRIMARY_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.disabledFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, DISABLED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.headingFontStyles = new TextFormat(FONT_NAME, this.largeFontSize, PRIMARY_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.headingDisabledFontStyles = new TextFormat(FONT_NAME, this.largeFontSize, DISABLED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.detailFontStyles = new TextFormat(FONT_NAME, this.smallFontSize, PRIMARY_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.detailDisabledFontStyles = new TextFormat(FONT_NAME, this.smallFontSize, DISABLED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.invertedFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, INVERTED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.toastActionFontStyles = new TextFormat(FONT_NAME, this.smallFontSize, PRIMARY_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.toastActionFontStyles.bold = true;\n\t\t\tthis.toastActionActiveFontStyles = new TextFormat(FONT_NAME, this.smallFontSize, ACTIVE_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.toastActionActiveFontStyles.bold = true;\n\t\t}\n\n\t\t/**\n\t\t * Initializes the textures by extracting them from the atlas and\n\t\t * setting up any scaling grids that are needed.\n\t\t */\n\t\tprotected function initializeTextures():void\n\t\t{\n\t\t\tthis.focusIndicatorSkinTexture = this.atlas.getTexture(\"focus-indicator-skin0000\");\n\t\t\tthis.toolTipBackgroundSkinTexture = this.atlas.getTexture(\"tool-tip-background-skin0000\");\n\t\t\tthis.calloutBackgroundSkinTexture = this.atlas.getTexture(\"callout-background-skin0000\");\n\t\t\tthis.calloutTopArrowSkinTexture = this.atlas.getTexture(\"callout-top-arrow-skin0000\");\n\t\t\tthis.calloutRightArrowSkinTexture = this.atlas.getTexture(\"callout-right-arrow-skin0000\");\n\t\t\tthis.calloutBottomArrowSkinTexture = this.atlas.getTexture(\"callout-bottom-arrow-skin0000\");\n\t\t\tthis.calloutLeftArrowSkinTexture = this.atlas.getTexture(\"callout-left-arrow-skin0000\");\n\t\t\tthis.dangerCalloutBackgroundSkinTexture = this.atlas.getTexture(\"danger-callout-background-skin0000\");\n\t\t\tthis.dangerCalloutTopArrowSkinTexture = this.atlas.getTexture(\"danger-callout-top-arrow-skin0000\");\n\t\t\tthis.dangerCalloutRightArrowSkinTexture = this.atlas.getTexture(\"danger-callout-right-arrow-skin0000\");\n\t\t\tthis.dangerCalloutBottomArrowSkinTexture = this.atlas.getTexture(\"danger-callout-bottom-arrow-skin0000\");\n\t\t\tthis.dangerCalloutLeftArrowSkinTexture = this.atlas.getTexture(\"danger-callout-left-arrow-skin0000\");\n\n\t\t\tthis.buttonUpSkinTexture = this.atlas.getTexture(\"button-up-skin0000\");\n\t\t\tthis.buttonHoverSkinTexture = this.atlas.getTexture(\"button-hover-skin0000\");\n\t\t\tthis.buttonDownSkinTexture = this.atlas.getTexture(\"button-down-skin0000\");\n\t\t\tthis.buttonDisabledSkinTexture = this.atlas.getTexture(\"button-disabled-skin0000\");\n\t\t\tthis.toggleButtonSelectedUpSkinTexture = this.atlas.getTexture(\"toggle-button-selected-up-skin0000\");\n\t\t\tthis.toggleButtonSelectedHoverSkinTexture = this.atlas.getTexture(\"toggle-button-selected-hover-skin0000\");\n\t\t\tthis.toggleButtonSelectedDownSkinTexture = this.atlas.getTexture(\"toggle-button-selected-down-skin0000\");\n\t\t\tthis.toggleButtonSelectedDisabledSkinTexture = this.atlas.getTexture(\"toggle-button-selected-disabled-skin0000\");\n\t\t\tthis.quietButtonHoverSkinTexture = this.atlas.getTexture(\"quiet-button-hover-skin0000\");\n\t\t\tthis.callToActionButtonUpSkinTexture = this.atlas.getTexture(\"call-to-action-button-up-skin0000\");\n\t\t\tthis.callToActionButtonHoverSkinTexture = this.atlas.getTexture(\"call-to-action-button-hover-skin0000\");\n\t\t\tthis.dangerButtonUpSkinTexture = this.atlas.getTexture(\"danger-button-up-skin0000\");\n\t\t\tthis.dangerButtonHoverSkinTexture = this.atlas.getTexture(\"danger-button-hover-skin0000\");\n\t\t\tthis.dangerButtonDownSkinTexture = this.atlas.getTexture(\"danger-button-down-skin0000\");\n\t\t\tthis.backButtonUpIconTexture = this.atlas.getTexture(\"back-button-up-icon0000\");\n\t\t\tthis.backButtonDisabledIconTexture = this.atlas.getTexture(\"back-button-disabled-icon0000\");\n\t\t\tthis.forwardButtonUpIconTexture = this.atlas.getTexture(\"forward-button-up-icon0000\");\n\t\t\tthis.forwardButtonDisabledIconTexture = this.atlas.getTexture(\"forward-button-disabled-icon0000\");\n\n\t\t\tthis.tabUpSkinTexture = this.atlas.getTexture(\"tab-up-skin0000\");\n\t\t\tthis.tabHoverSkinTexture = this.atlas.getTexture(\"tab-hover-skin0000\");\n\t\t\tthis.tabDownSkinTexture = this.atlas.getTexture(\"tab-down-skin0000\");\n\t\t\tthis.tabDisabledSkinTexture = this.atlas.getTexture(\"tab-disabled-skin0000\");\n\t\t\tthis.tabSelectedUpSkinTexture = this.atlas.getTexture(\"tab-selected-up-skin0000\");\n\t\t\tthis.tabSelectedDisabledSkinTexture = this.atlas.getTexture(\"tab-selected-disabled-skin0000\");\n\n\t\t\tthis.stepperIncrementButtonUpSkinTexture = this.atlas.getTexture(\"numeric-stepper-increment-button-up-skin0000\");\n\t\t\tthis.stepperIncrementButtonHoverSkinTexture = this.atlas.getTexture(\"numeric-stepper-increment-button-hover-skin0000\");\n\t\t\tthis.stepperIncrementButtonDownSkinTexture = this.atlas.getTexture(\"numeric-stepper-increment-button-down-skin0000\");\n\t\t\tthis.stepperIncrementButtonDisabledSkinTexture = this.atlas.getTexture(\"numeric-stepper-increment-button-disabled-skin0000\");\n\n\t\t\tthis.stepperDecrementButtonUpSkinTexture = this.atlas.getTexture(\"numeric-stepper-decrement-button-up-skin0000\");\n\t\t\tthis.stepperDecrementButtonHoverSkinTexture = this.atlas.getTexture(\"numeric-stepper-decrement-button-hover-skin0000\");\n\t\t\tthis.stepperDecrementButtonDownSkinTexture = this.atlas.getTexture(\"numeric-stepper-decrement-button-down-skin0000\");\n\t\t\tthis.stepperDecrementButtonDisabledSkinTexture = this.atlas.getTexture(\"numeric-stepper-decrement-button-disabled-skin0000\");\n\n\t\t\tthis.hSliderThumbUpSkinTexture = this.atlas.getTexture(\"horizontal-slider-thumb-up-skin0000\");\n\t\t\tthis.hSliderThumbHoverSkinTexture = this.atlas.getTexture(\"horizontal-slider-thumb-hover-skin0000\");\n\t\t\tthis.hSliderThumbDownSkinTexture = this.atlas.getTexture(\"horizontal-slider-thumb-down-skin0000\");\n\t\t\tthis.hSliderThumbDisabledSkinTexture = this.atlas.getTexture(\"horizontal-slider-thumb-disabled-skin0000\");\n\t\t\tthis.hSliderTrackEnabledSkinTexture = this.atlas.getTexture(\"horizontal-slider-track-enabled-skin0000\");\n\n\t\t\tthis.vSliderThumbUpSkinTexture = this.atlas.getTexture(\"vertical-slider-thumb-up-skin0000\");\n\t\t\tthis.vSliderThumbHoverSkinTexture = this.atlas.getTexture(\"vertical-slider-thumb-hover-skin0000\");\n\t\t\tthis.vSliderThumbDownSkinTexture = this.atlas.getTexture(\"vertical-slider-thumb-down-skin0000\");\n\t\t\tthis.vSliderThumbDisabledSkinTexture = this.atlas.getTexture(\"vertical-slider-thumb-disabled-skin0000\");\n\t\t\tthis.vSliderTrackEnabledSkinTexture = this.atlas.getTexture(\"vertical-slider-track-enabled-skin0000\");\n\n\t\t\tthis.itemRendererUpSkinTexture = Texture.fromTexture(this.atlas.getTexture(\"item-renderer-up-skin0000\"), ITEM_RENDERER_SKIN_TEXTURE_REGION);\n\t\t\tthis.itemRendererHoverSkinTexture = Texture.fromTexture(this.atlas.getTexture(\"item-renderer-hover-skin0000\"), ITEM_RENDERER_SKIN_TEXTURE_REGION);\n\t\t\tthis.itemRendererSelectedUpSkinTexture = Texture.fromTexture(this.atlas.getTexture(\"item-renderer-selected-up-skin0000\"), ITEM_RENDERER_SKIN_TEXTURE_REGION);\n\n\t\t\tthis.headerBackgroundSkinTexture = this.atlas.getTexture(\"header-background-skin0000\");\n\t\t\tthis.groupedListHeaderBackgroundSkinTexture = this.atlas.getTexture(\"grouped-list-header-background-skin0000\");\n\n\t\t\tthis.checkUpIconTexture = this.atlas.getTexture(\"check-up-icon0000\");\n\t\t\tthis.checkHoverIconTexture = this.atlas.getTexture(\"check-hover-icon0000\");\n\t\t\tthis.checkDownIconTexture = this.atlas.getTexture(\"check-down-icon0000\");\n\t\t\tthis.checkDisabledIconTexture = this.atlas.getTexture(\"check-disabled-icon0000\");\n\t\t\tthis.checkSelectedUpIconTexture = this.atlas.getTexture(\"check-selected-up-icon0000\");\n\t\t\tthis.checkSelectedHoverIconTexture = this.atlas.getTexture(\"check-selected-hover-icon0000\");\n\t\t\tthis.checkSelectedDownIconTexture = this.atlas.getTexture(\"check-selected-down-icon0000\");\n\t\t\tthis.checkSelectedDisabledIconTexture = this.atlas.getTexture(\"check-selected-disabled-icon0000\");\n\n\t\t\tthis.radioUpIconTexture = this.atlas.getTexture(\"radio-up-icon0000\");\n\t\t\tthis.radioHoverIconTexture = this.atlas.getTexture(\"radio-hover-icon0000\");\n\t\t\tthis.radioDownIconTexture = this.atlas.getTexture(\"radio-down-icon0000\");\n\t\t\tthis.radioDisabledIconTexture = this.atlas.getTexture(\"radio-disabled-icon0000\");\n\t\t\tthis.radioSelectedUpIconTexture = this.atlas.getTexture(\"radio-selected-up-icon0000\");\n\t\t\tthis.radioSelectedHoverIconTexture = this.atlas.getTexture(\"radio-selected-hover-icon0000\");\n\t\t\tthis.radioSelectedDownIconTexture = this.atlas.getTexture(\"radio-selected-down-icon0000\");\n\t\t\tthis.radioSelectedDisabledIconTexture = this.atlas.getTexture(\"radio-selected-disabled-icon0000\");\n\n\t\t\tthis.pageIndicatorNormalSkinTexture = this.atlas.getTexture(\"page-indicator-normal-symbol0000\");\n\t\t\tthis.pageIndicatorSelectedSkinTexture = this.atlas.getTexture(\"page-indicator-selected-symbol0000\");\n\n\t\t\tthis.pickerListUpIconTexture = this.atlas.getTexture(\"picker-list-up-icon0000\");\n\t\t\tthis.pickerListHoverIconTexture = this.atlas.getTexture(\"picker-list-hover-icon0000\");\n\t\t\tthis.pickerListDownIconTexture = this.atlas.getTexture(\"picker-list-down-icon0000\");\n\t\t\tthis.pickerListDisabledIconTexture = this.atlas.getTexture(\"picker-list-disabled-icon0000\");\n\n\t\t\tthis.textInputBackgroundEnabledSkinTexture = this.atlas.getTexture(\"text-input-background-enabled-skin0000\");\n\t\t\tthis.textInputBackgroundDisabledSkinTexture = this.atlas.getTexture(\"text-input-background-disabled-skin0000\");\n\t\t\tthis.textInputBackgroundErrorSkinTexture = this.atlas.getTexture(\"text-input-background-error-skin0000\");\n\t\t\tthis.textInputSearchIconTexture = this.atlas.getTexture(\"search-icon0000\");\n\t\t\tthis.textInputSearchIconDisabledTexture = this.atlas.getTexture(\"search-icon-disabled0000\");\n\n\t\t\tthis.vScrollBarThumbUpSkinTexture = this.atlas.getTexture(\"vertical-scroll-bar-thumb-up-skin0000\");\n\t\t\tthis.vScrollBarThumbHoverSkinTexture = this.atlas.getTexture(\"vertical-scroll-bar-thumb-hover-skin0000\");\n\t\t\tthis.vScrollBarThumbDownSkinTexture = this.atlas.getTexture(\"vertical-scroll-bar-thumb-down-skin0000\");\n\t\t\tthis.vScrollBarTrackSkinTexture = this.atlas.getTexture(\"vertical-scroll-bar-track-skin0000\");\n\t\t\tthis.vScrollBarThumbIconTexture = this.atlas.getTexture(\"vertical-scroll-bar-thumb-icon0000\");\n\t\t\tthis.vScrollBarStepButtonUpSkinTexture = this.atlas.getTexture(\"vertical-scroll-bar-step-button-up-skin0000\");\n\t\t\tthis.vScrollBarStepButtonHoverSkinTexture = this.atlas.getTexture(\"vertical-scroll-bar-step-button-hover-skin0000\");\n\t\t\tthis.vScrollBarStepButtonDownSkinTexture = this.atlas.getTexture(\"vertical-scroll-bar-step-button-down-skin0000\");\n\t\t\tthis.vScrollBarStepButtonDisabledSkinTexture = this.atlas.getTexture(\"vertical-scroll-bar-step-button-disabled-skin0000\");\n\t\t\tthis.vScrollBarDecrementButtonIconTexture = this.atlas.getTexture(\"vertical-scroll-bar-decrement-button-icon0000\");\n\t\t\tthis.vScrollBarIncrementButtonIconTexture = this.atlas.getTexture(\"vertical-scroll-bar-increment-button-icon0000\");\n\n\t\t\tthis.hScrollBarThumbUpSkinTexture = this.atlas.getTexture(\"horizontal-scroll-bar-thumb-up-skin0000\");\n\t\t\tthis.hScrollBarThumbHoverSkinTexture = this.atlas.getTexture(\"horizontal-scroll-bar-thumb-hover-skin0000\");\n\t\t\tthis.hScrollBarThumbDownSkinTexture = this.atlas.getTexture(\"horizontal-scroll-bar-thumb-down-skin0000\");\n\t\t\tthis.hScrollBarTrackSkinTexture = this.atlas.getTexture(\"horizontal-scroll-bar-track-skin0000\");\n\t\t\tthis.hScrollBarThumbIconTexture = this.atlas.getTexture(\"horizontal-scroll-bar-thumb-icon0000\");\n\t\t\tthis.hScrollBarStepButtonUpSkinTexture = this.atlas.getTexture(\"horizontal-scroll-bar-step-button-up-skin0000\");\n\t\t\tthis.hScrollBarStepButtonHoverSkinTexture = this.atlas.getTexture(\"horizontal-scroll-bar-step-button-hover-skin0000\");\n\t\t\tthis.hScrollBarStepButtonDownSkinTexture = this.atlas.getTexture(\"horizontal-scroll-bar-step-button-down-skin0000\");\n\t\t\tthis.hScrollBarStepButtonDisabledSkinTexture = this.atlas.getTexture(\"horizontal-scroll-bar-step-button-disabled-skin0000\");\n\t\t\tthis.hScrollBarDecrementButtonIconTexture = this.atlas.getTexture(\"horizontal-scroll-bar-decrement-button-icon0000\");\n\t\t\tthis.hScrollBarIncrementButtonIconTexture = this.atlas.getTexture(\"horizontal-scroll-bar-increment-button-icon0000\");\n\n\t\t\tthis.simpleBorderBackgroundSkinTexture = this.atlas.getTexture(\"simple-border-background-skin0000\");\n\t\t\tthis.insetBorderBackgroundSkinTexture = this.atlas.getTexture(\"inset-border-background-skin0000\");\n\t\t\tthis.panelBorderBackgroundSkinTexture = this.atlas.getTexture(\"panel-background-skin0000\");\n\t\t\tthis.alertBorderBackgroundSkinTexture = this.atlas.getTexture(\"alert-background-skin0000\");\n\n\t\t\tthis.progressBarFillSkinTexture = Texture.fromTexture(this.atlas.getTexture(\"progress-bar-fill-skin0000\"), PROGRESS_BAR_FILL_TEXTURE_REGION);\n\n\t\t\tthis.playPauseButtonPlayUpIconTexture = this.atlas.getTexture(\"play-pause-toggle-button-play-up-icon0000\");\n\t\t\tthis.playPauseButtonPauseUpIconTexture = this.atlas.getTexture(\"play-pause-toggle-button-pause-up-icon0000\");\n\t\t\tthis.overlayPlayPauseButtonPlayUpIconTexture = this.atlas.getTexture(\"overlay-play-pause-toggle-button-play-up-icon0000\");\n\t\t\tthis.fullScreenToggleButtonEnterUpIconTexture = this.atlas.getTexture(\"full-screen-toggle-button-enter-up-icon0000\");\n\t\t\tthis.fullScreenToggleButtonExitUpIconTexture = this.atlas.getTexture(\"full-screen-toggle-button-exit-up-icon0000\");\n\t\t\tthis.muteToggleButtonMutedUpIconTexture = this.atlas.getTexture(\"mute-toggle-button-muted-up-icon0000\");\n\t\t\tthis.muteToggleButtonLoudUpIconTexture = this.atlas.getTexture(\"mute-toggle-button-loud-up-icon0000\");\n\t\t\tthis.horizontalVolumeSliderMinimumTrackSkinTexture = this.atlas.getTexture(\"horizontal-volume-slider-minimum-track-skin0000\");\n\t\t\tthis.horizontalVolumeSliderMaximumTrackSkinTexture = this.atlas.getTexture(\"horizontal-volume-slider-maximum-track-skin0000\");\n\t\t\tthis.verticalVolumeSliderMinimumTrackSkinTexture = this.atlas.getTexture(\"vertical-volume-slider-minimum-track-skin0000\");\n\t\t\tthis.verticalVolumeSliderMaximumTrackSkinTexture = this.atlas.getTexture(\"vertical-volume-slider-maximum-track-skin0000\");\n\t\t\tthis.popUpVolumeSliderMinimumTrackSkinTexture = this.atlas.getTexture(\"pop-up-volume-slider-minimum-track-skin0000\");\n\t\t\tthis.popUpVolumeSliderMaximumTrackSkinTexture = this.atlas.getTexture(\"pop-up-volume-slider-maximum-track-skin0000\");\n\t\t\tthis.seekSliderMinimumTrackSkinTexture = this.atlas.getTexture(\"seek-slider-minimum-track-skin0000\");\n\t\t\tthis.seekSliderMaximumTrackSkinTexture = this.atlas.getTexture(\"seek-slider-maximum-track-skin0000\");\n\t\t\tthis.seekSliderProgressSkinTexture = this.atlas.getTexture(\"seek-slider-progress-skin0000\");\n\n\t\t\tthis.listDrillDownAccessoryTexture = this.atlas.getTexture(\"drill-down-icon0000\");\n\n\t\t\tthis.treeBranchOpenIconTexture = this.atlas.getTexture(\"tree-branch-open-icon0000\");\n\t\t\tthis.treeBranchClosedIconTexture = this.atlas.getTexture(\"tree-branch-closed-icon0000\");\n\t\t\tthis.treeLeafIconTexture = this.atlas.getTexture(\"tree-leaf-icon0000\");\n\t\t\tthis.treeDisclosureOpenIconTexture = this.atlas.getTexture(\"tree-disclosure-open-icon0000\");\n\t\t\tthis.treeDisclosureClosedIconTexture = this.atlas.getTexture(\"tree-disclosure-closed-icon0000\");\n\n\t\t\tthis.dataGridVerticalDividerSkinTexture = this.atlas.getTexture(\"data-grid-vertical-divider-skin0000\");\n\t\t\tthis.dataGridColumnDropIndicatorSkinTexture = this.atlas.getTexture(\"data-grid-column-drop-indicator-skin0000\");\n\t\t\tthis.dataGridColumnResizeSkinTexture = this.atlas.getTexture(\"data-grid-column-resize-skin0000\");\n\t\t\tthis.dataGridHeaderBackgroundSkinTexture = this.atlas.getTexture(\"data-grid-header-background-skin0000\");\n\t\t\tthis.dataGridHeaderDividerSkinTexture = this.atlas.getTexture(\"data-grid-header-divider-skin0000\");\n\t\t\tthis.dataGridHeaderSortAscendingIconTexture = this.atlas.getTexture(\"data-grid-header-sort-ascending-icon0000\");\n\t\t\tthis.dataGridHeaderSortDescendingIconTexture = this.atlas.getTexture(\"data-grid-header-sort-descending-icon0000\");\n\t\t}\n\n\t\t/**\n\t\t * Sets global style providers for all components.\n\t\t */\n\t\tprotected function initializeStyleProviders():void\n\t\t{\n\t\t\t//alert\n\t\t\tthis.getStyleProviderForClass(Alert).defaultStyleFunction = this.setAlertStyles;\n\t\t\tthis.getStyleProviderForClass(Header).setFunctionForStyleName(Alert.DEFAULT_CHILD_STYLE_NAME_HEADER, this.setPanelHeaderStyles);\n\t\t\tthis.getStyleProviderForClass(ButtonGroup).setFunctionForStyleName(Alert.DEFAULT_CHILD_STYLE_NAME_BUTTON_GROUP, this.setAlertButtonGroupStyles);\n\n\t\t\t//autocomplete\n\t\t\tthis.getStyleProviderForClass(AutoComplete).defaultStyleFunction = this.setTextInputStyles;\n\t\t\tthis.getStyleProviderForClass(List).setFunctionForStyleName(AutoComplete.DEFAULT_CHILD_STYLE_NAME_LIST, this.setDropDownListStyles);\n\n\t\t\t//button\n\t\t\tthis.getStyleProviderForClass(Button).defaultStyleFunction = this.setButtonStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_QUIET_BUTTON, this.setQuietButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_CALL_TO_ACTION_BUTTON, this.setCallToActionButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_DANGER_BUTTON, this.setDangerButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON, this.setBackButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_FORWARD_BUTTON, this.setForwardButtonStyles);\n\n\t\t\t//button group\n\t\t\tthis.getStyleProviderForClass(ButtonGroup).defaultStyleFunction = this.setButtonGroupStyles;\n\n\t\t\t//callout\n\t\t\tthis.getStyleProviderForClass(Callout).defaultStyleFunction = this.setCalloutStyles;\n\n\t\t\t//check\n\t\t\tthis.getStyleProviderForClass(Check).defaultStyleFunction = this.setCheckStyles;\n\n\t\t\t//data grid\n\t\t\tthis.getStyleProviderForClass(DataGrid).defaultStyleFunction = this.setDataGridStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultDataGridHeaderRenderer).defaultStyleFunction = this.setDataGridHeaderRendererStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultDataGridCellRenderer).defaultStyleFunction = this.setDataGridCellRendererStyles;\n\n\t\t\t//date time spinner\n\t\t\tthis.getStyleProviderForClass(DateTimeSpinner).defaultStyleFunction = this.setDateTimeSpinnerStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).setFunctionForStyleName(THEME_STYLE_NAME_DATE_TIME_SPINNER_LIST_ITEM_RENDERER, this.setDateTimeSpinnerListItemRendererStyles);\n\n\t\t\t//drawers\n\t\t\tthis.getStyleProviderForClass(Drawers).defaultStyleFunction = this.setDrawersStyles;\n\n\t\t\t//grouped list (see also: item renderers)\n\t\t\tthis.getStyleProviderForClass(GroupedList).defaultStyleFunction = this.setGroupedListStyles;\n\t\t\tthis.getStyleProviderForClass(GroupedList).setFunctionForStyleName(GroupedList.ALTERNATE_STYLE_NAME_INSET_GROUPED_LIST, this.setInsetGroupedListStyles);\n\n\t\t\t//header\n\t\t\tthis.getStyleProviderForClass(Header).defaultStyleFunction = this.setHeaderStyles;\n\n\t\t\t//item renderers for lists\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).defaultStyleFunction = this.setItemRendererStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).setFunctionForStyleName(DefaultListItemRenderer.ALTERNATE_STYLE_NAME_DRILL_DOWN, this.setDrillDownItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).setFunctionForStyleName(DefaultListItemRenderer.ALTERNATE_STYLE_NAME_CHECK, this.setCheckItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListItemRenderer).defaultStyleFunction = this.setItemRendererStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListItemRenderer).setFunctionForStyleName(DefaultGroupedListItemRenderer.ALTERNATE_STYLE_NAME_DRILL_DOWN, this.setDrillDownItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListItemRenderer).setFunctionForStyleName(DefaultGroupedListItemRenderer.ALTERNATE_STYLE_NAME_CHECK, this.setCheckItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListItemRenderer).setFunctionForStyleName(GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_ITEM_RENDERER, this.setInsetGroupedListItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultTreeItemRenderer).defaultStyleFunction = this.setTreeItemRendererStyles;\n\n\t\t\t//header and footer renderers for grouped list\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListHeaderOrFooterRenderer).defaultStyleFunction = this.setGroupedListHeaderOrFooterRendererStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListHeaderOrFooterRenderer).setFunctionForStyleName(GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_HEADER_RENDERER, this.setInsetGroupedListHeaderRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListHeaderOrFooterRenderer).setFunctionForStyleName(GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_FOOTER_RENDERER, this.setInsetGroupedListFooterRendererStyles);\n\n\t\t\t//label\n\t\t\tthis.getStyleProviderForClass(Label).defaultStyleFunction = this.setLabelStyles;\n\t\t\tthis.getStyleProviderForClass(Label).setFunctionForStyleName(Label.ALTERNATE_STYLE_NAME_HEADING, this.setHeadingLabelStyles);\n\t\t\tthis.getStyleProviderForClass(Label).setFunctionForStyleName(Label.ALTERNATE_STYLE_NAME_DETAIL, this.setDetailLabelStyles);\n\t\t\tthis.getStyleProviderForClass(Label).setFunctionForStyleName(Label.ALTERNATE_STYLE_NAME_TOOL_TIP, this.setToolTipLabelStyles);\n\n\t\t\t//layout group\n\t\t\tthis.getStyleProviderForClass(LayoutGroup).setFunctionForStyleName(LayoutGroup.ALTERNATE_STYLE_NAME_TOOLBAR, this.setToolbarLayoutGroupStyles);\n\n\t\t\t//list (see also: item renderers)\n\t\t\tthis.getStyleProviderForClass(List).defaultStyleFunction = this.setListStyles;\n\n\t\t\t//numeric stepper\n\t\t\tthis.getStyleProviderForClass(NumericStepper).defaultStyleFunction = this.setNumericStepperStyles;\n\t\t\tthis.getStyleProviderForClass(TextInput).setFunctionForStyleName(NumericStepper.DEFAULT_CHILD_STYLE_NAME_TEXT_INPUT, this.setNumericStepperTextInputStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(NumericStepper.DEFAULT_CHILD_STYLE_NAME_INCREMENT_BUTTON, this.setNumericStepperIncrementButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(NumericStepper.DEFAULT_CHILD_STYLE_NAME_DECREMENT_BUTTON, this.setNumericStepperDecrementButtonStyles);\n\n\t\t\t//panel\n\t\t\tthis.getStyleProviderForClass(Panel).defaultStyleFunction = this.setPanelStyles;\n\t\t\tthis.getStyleProviderForClass(Header).setFunctionForStyleName(Panel.DEFAULT_CHILD_STYLE_NAME_HEADER, this.setPanelHeaderStyles);\n\n\t\t\t//panel screen\n\t\t\tthis.getStyleProviderForClass(PanelScreen).defaultStyleFunction = this.setPanelScreenStyles;\n\n\t\t\t//page indicator\n\t\t\tthis.getStyleProviderForClass(PageIndicator).defaultStyleFunction = this.setPageIndicatorStyles;\n\n\t\t\t//picker list (see also: item renderers)\n\t\t\tthis.getStyleProviderForClass(PickerList).defaultStyleFunction = this.setPickerListStyles;\n\t\t\tthis.getStyleProviderForClass(List).setFunctionForStyleName(PickerList.DEFAULT_CHILD_STYLE_NAME_LIST, this.setDropDownListStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(PickerList.DEFAULT_CHILD_STYLE_NAME_BUTTON, this.setPickerListButtonStyles);\n\t\t\tthis.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(PickerList.DEFAULT_CHILD_STYLE_NAME_BUTTON, this.setPickerListButtonStyles);\n\n\t\t\t//progress bar\n\t\t\tthis.getStyleProviderForClass(ProgressBar).defaultStyleFunction = this.setProgressBarStyles;\n\n\t\t\t//radio\n\t\t\tthis.getStyleProviderForClass(Radio).defaultStyleFunction = this.setRadioStyles;\n\n\t\t\t//scroll bar\n\t\t\tthis.getStyleProviderForClass(ScrollBar).setFunctionForStyleName(Scroller.DEFAULT_CHILD_STYLE_NAME_HORIZONTAL_SCROLL_BAR, this.setHorizontalScrollBarStyles);\n\t\t\tthis.getStyleProviderForClass(ScrollBar).setFunctionForStyleName(Scroller.DEFAULT_CHILD_STYLE_NAME_VERTICAL_SCROLL_BAR, this.setVerticalScrollBarStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_INCREMENT_BUTTON, this.setHorizontalScrollBarIncrementButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_DECREMENT_BUTTON, this.setHorizontalScrollBarDecrementButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_THUMB, this.setHorizontalScrollBarThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_MINIMUM_TRACK, this.setHorizontalScrollBarMinimumTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_INCREMENT_BUTTON, this.setVerticalScrollBarIncrementButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_DECREMENT_BUTTON, this.setVerticalScrollBarDecrementButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_THUMB, this.setVerticalScrollBarThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_MINIMUM_TRACK, this.setVerticalScrollBarMinimumTrackStyles);\n\n\t\t\t//scroll container\n\t\t\tthis.getStyleProviderForClass(ScrollContainer).defaultStyleFunction = this.setScrollContainerStyles;\n\t\t\tthis.getStyleProviderForClass(ScrollContainer).setFunctionForStyleName(ScrollContainer.ALTERNATE_STYLE_NAME_TOOLBAR, this.setToolbarScrollContainerStyles);\n\n\t\t\t//scroll screen\n\t\t\tthis.getStyleProviderForClass(ScrollScreen).defaultStyleFunction = this.setScrollScreenStyles;\n\n\t\t\t//scroll text\n\t\t\tthis.getStyleProviderForClass(ScrollText).defaultStyleFunction = this.setScrollTextStyles;\n\n\t\t\t//simple scroll bar\n\t\t\tthis.getStyleProviderForClass(SimpleScrollBar).setFunctionForStyleName(Scroller.DEFAULT_CHILD_STYLE_NAME_HORIZONTAL_SCROLL_BAR, this.setHorizontalSimpleScrollBarStyles);\n\t\t\tthis.getStyleProviderForClass(SimpleScrollBar).setFunctionForStyleName(Scroller.DEFAULT_CHILD_STYLE_NAME_VERTICAL_SCROLL_BAR, this.setVerticalSimpleScrollBarStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_HORIZONTAL_SIMPLE_SCROLL_BAR_THUMB, this.setHorizontalSimpleScrollBarThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_VERTICAL_SIMPLE_SCROLL_BAR_THUMB, this.setVerticalSimpleScrollBarThumbStyles);\n\n\t\t\t//slider\n\t\t\tthis.getStyleProviderForClass(Slider).defaultStyleFunction = this.setSliderStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_HORIZONTAL_SLIDER_THUMB, this.setHorizontalSliderThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_HORIZONTAL_SLIDER_MINIMUM_TRACK, this.setHorizontalSliderMinimumTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_VERTICAL_SLIDER_THUMB, this.setVerticalSliderThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_VERTICAL_SLIDER_MINIMUM_TRACK, this.setVerticalSliderMinimumTrackStyles);\n\t\t\t\n\t\t\t//spinner list\n\t\t\tthis.getStyleProviderForClass(SpinnerList).defaultStyleFunction = this.setSpinnerListStyles;\n\n\t\t\t//tab bar\n\t\t\tthis.getStyleProviderForClass(TabBar).defaultStyleFunction = this.setTabBarStyles;\n\t\t\tthis.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(TabBar.DEFAULT_CHILD_STYLE_NAME_TAB, this.setTabStyles);\n\n\t\t\t//text area\n\t\t\tthis.getStyleProviderForClass(TextArea).defaultStyleFunction = this.setTextAreaStyles;\n\t\t\tthis.getStyleProviderForClass(TextCallout).setFunctionForStyleName(TextArea.DEFAULT_CHILD_STYLE_NAME_ERROR_CALLOUT, this.setTextAreaErrorCalloutStyles);\n\n\t\t\t//text callout\n\t\t\tthis.getStyleProviderForClass(TextCallout).defaultStyleFunction = this.setTextCalloutStyles;\n\n\t\t\t//text input\n\t\t\tthis.getStyleProviderForClass(TextInput).defaultStyleFunction = this.setTextInputStyles;\n\t\t\tthis.getStyleProviderForClass(TextInput).setFunctionForStyleName(TextInput.ALTERNATE_STYLE_NAME_SEARCH_TEXT_INPUT, this.setSearchTextInputStyles);\n\t\t\tthis.getStyleProviderForClass(TextCallout).setFunctionForStyleName(TextInput.DEFAULT_CHILD_STYLE_NAME_ERROR_CALLOUT, this.setTextInputErrorCalloutStyles);\n\n\t\t\t//toast\n\t\t\tthis.getStyleProviderForClass(Toast).defaultStyleFunction = this.setToastStyles;\n\t\t\tthis.getStyleProviderForClass(ButtonGroup).setFunctionForStyleName(Toast.DEFAULT_CHILD_STYLE_NAME_ACTIONS, this.setToastActionsStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_TOAST_ACTIONS_BUTTON, this.setToastActionsButtonStyles);\n\t\t\t\n\t\t\t//toggle button\n\t\t\tthis.getStyleProviderForClass(ToggleButton).defaultStyleFunction = this.setButtonStyles;\n\t\t\tthis.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_QUIET_BUTTON, this.setQuietButtonStyles);\n\n\t\t\t//toggle switch\n\t\t\tthis.getStyleProviderForClass(ToggleSwitch).defaultStyleFunction = this.setToggleSwitchStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_ON_TRACK, this.setToggleSwitchOnTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setToggleSwitchThumbStyles);\n\t\t\tthis.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setToggleSwitchThumbStyles);\n\n\t\t\t//tree\n\t\t\tthis.getStyleProviderForClass(Tree).defaultStyleFunction = this.setTreeStyles;\n\n\t\t\t//media controls\n\t\t\t\n\t\t\t//play/pause toggle button\n\t\t\tthis.getStyleProviderForClass(PlayPauseToggleButton).defaultStyleFunction = this.setPlayPauseToggleButtonStyles;\n\t\t\tthis.getStyleProviderForClass(PlayPauseToggleButton).setFunctionForStyleName(PlayPauseToggleButton.ALTERNATE_STYLE_NAME_OVERLAY_PLAY_PAUSE_TOGGLE_BUTTON, this.setOverlayPlayPauseToggleButtonStyles);\n\n\t\t\t//full screen toggle button\n\t\t\tthis.getStyleProviderForClass(FullScreenToggleButton).defaultStyleFunction = this.setFullScreenToggleButtonStyles;\n\n\t\t\t//mute toggle button\n\t\t\tthis.getStyleProviderForClass(MuteToggleButton).defaultStyleFunction = this.setMuteToggleButtonStyles;\n\t\t\tthis.getStyleProviderForClass(VolumeSlider).setFunctionForStyleName(MuteToggleButton.DEFAULT_CHILD_STYLE_NAME_VOLUME_SLIDER, this.setPopUpVolumeSliderStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_POP_UP_VOLUME_SLIDER_MINIMUM_TRACK, this.setPopUpVolumeSliderMinimumTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_POP_UP_VOLUME_SLIDER_MAXIMUM_TRACK, this.setPopUpVolumeSliderMaximumTrackStyles);\n\n\t\t\t//seek slider\n\t\t\tthis.getStyleProviderForClass(SeekSlider).defaultStyleFunction = this.setSeekSliderStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(SeekSlider.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setHorizontalSliderThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(SeekSlider.DEFAULT_CHILD_STYLE_NAME_MINIMUM_TRACK, this.setSeekSliderMinimumTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(SeekSlider.DEFAULT_CHILD_STYLE_NAME_MAXIMUM_TRACK, this.setSeekSliderMaximumTrackStyles);\n\n\t\t\t//volume slider\n\t\t\tthis.getStyleProviderForClass(VolumeSlider).defaultStyleFunction = this.setVolumeSliderStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(VolumeSlider.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setVolumeSliderThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_HORIZONTAL_VOLUME_SLIDER_MINIMUM_TRACK, this.setHorizontalVolumeSliderMinimumTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_HORIZONTAL_VOLUME_SLIDER_MAXIMUM_TRACK, this.setHorizontalVolumeSliderMaximumTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_VERTICAL_VOLUME_SLIDER_MINIMUM_TRACK, this.setVerticalVolumeSliderMinimumTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_VERTICAL_VOLUME_SLIDER_MAXIMUM_TRACK, this.setVerticalVolumeSliderMaximumTrackStyles);\n\t\t}\n\n\t\tprotected function pageIndicatorNormalSymbolFactory():Image\n\t\t{\n\t\t\treturn new Image(this.pageIndicatorNormalSkinTexture);\n\t\t}\n\n\t\tprotected function pageIndicatorSelectedSymbolFactory():Image\n\t\t{\n\t\t\treturn new Image(this.pageIndicatorSelectedSkinTexture);\n\t\t}\n\n\t\tprotected function dataGridHeaderDividerFactory():DisplayObject\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.dataGridHeaderDividerSkinTexture);\n\t\t\tskin.scale9Grid = DATA_GRID_HEADER_DIVIDER_SCALE_9_GRID;\n\t\t\treturn skin;\n\t\t}\n\n\t\tprotected function dataGridVerticalDividerFactory():DisplayObject\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.dataGridVerticalDividerSkinTexture);\n\t\t\tskin.scale9Grid = DATA_GRID_VERTICAL_DIVIDER_SCALE_9_GRID;\n\t\t\treturn skin;\n\t\t}\n\n\t\tprotected function toastContainerFactory():DisplayObjectContainer\n\t\t{\n\t\t\tvar container:LayoutGroup = new LayoutGroup();\n\t\t\tcontainer.autoSizeMode = AutoSizeMode.STAGE;\n\n\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\tlayout.verticalAlign = VerticalAlign.BOTTOM;\n\t\t\tlayout.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tlayout.padding = this.gutterSize;\n\t\t\tlayout.gap = this.gutterSize;\n\t\t\tcontainer.layout = layout;\n\n\t\t\treturn container;\n\t\t}\n\n\t//-------------------------\n\t// Shared\n\t//-------------------------\n\n\t\tprotected function setScrollerStyles(scroller:Scroller):void\n\t\t{\n\t\t\tscroller.clipContent = true;\n\t\t\tscroller.horizontalScrollBarFactory = scrollBarFactory;\n\t\t\tscroller.verticalScrollBarFactory = scrollBarFactory;\n\t\t\tscroller.interactionMode = ScrollInteractionMode.MOUSE;\n\t\t\tscroller.scrollBarDisplayMode = ScrollBarDisplayMode.FIXED;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tscroller.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tscroller.focusPadding = 0;\n\t\t}\n\n\t\tprotected function setDropDownListStyles(list:List):void\n\t\t{\n\t\t\tthis.setListStyles(list);\n\n\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\tlayout.useVirtualLayout = true;\n\t\t\tlayout.padding = 0;\n\t\t\tlayout.gap = 0;\n\t\t\tlayout.horizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\tlayout.verticalAlign = VerticalAlign.TOP;\n\t\t\tlayout.resetTypicalItemDimensionsOnMeasure = true;\n\t\t\tlayout.maxRowCount = 5;\n\t\t\tlist.layout = layout;\n\t\t}\n\n\t//-------------------------\n\t// Alert\n\t//-------------------------\n\n\t\tprotected function setAlertStyles(alert:Alert):void\n\t\t{\n\t\t\tthis.setScrollerStyles(alert);\n\n\t\t\tvar backgroundSkin:Image = new Image(this.alertBorderBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = PANEL_BORDER_SCALE_9_GRID;\n\t\t\talert.backgroundSkin = backgroundSkin;\n\n\t\t\talert.fontStyles = this.defaultFontStyles.clone();\n\t\t\talert.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\talert.outerPadding = this.borderSize;\n\n\t\t\talert.paddingTop = this.smallGutterSize;\n\t\t\talert.paddingBottom = this.smallGutterSize;\n\t\t\talert.paddingRight = this.gutterSize;\n\t\t\talert.paddingLeft = this.gutterSize;\n\t\t\talert.gap = this.gutterSize;\n\n\t\t\talert.maxWidth = this.popUpSize;\n\t\t\talert.maxHeight = this.popUpSize;\n\t\t}\n\n\t\tprotected function setAlertButtonGroupStyles(group:ButtonGroup):void\n\t\t{\n\t\t\tgroup.direction = Direction.HORIZONTAL;\n\t\t\tgroup.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tgroup.verticalAlign = VerticalAlign.JUSTIFY;\n\t\t\tgroup.distributeButtonSizes = false;\n\t\t\tgroup.gap = this.smallGutterSize;\n\t\t\tgroup.padding = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// Button\n\t//-------------------------\n\n\t\tprotected function setBaseButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tbutton.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tbutton.focusPadding = -1;\n\n\t\t\tbutton.paddingTop = this.extraSmallGutterSize;\n\t\t\tbutton.paddingBottom = this.extraSmallGutterSize;\n\t\t\tbutton.paddingLeft = this.smallGutterSize;\n\t\t\tbutton.paddingRight = this.smallGutterSize;\n\t\t\tbutton.gap = this.smallGutterSize;\n\t\t\tbutton.minGap = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.HOVER, this.buttonHoverSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);\n\t\t\tif(button is ToggleButton)\n\t\t\t{\n\t\t\t\t//for convenience, this function can style both a regular button\n\t\t\t\t//and a toggle button\n\t\t\t\tskin.selectedTexture = this.toggleButtonSelectedUpSkinTexture;\n\t\t\t\tskin.setTextureForState(ButtonState.HOVER_AND_SELECTED, this.toggleButtonSelectedHoverSkinTexture);\n\t\t\t\tskin.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.toggleButtonSelectedDownSkinTexture);\n\t\t\t\tskin.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.toggleButtonSelectedDisabledSkinTexture);\n\t\t\t}\n\t\t\tskin.scale9Grid = BUTTON_SCALE_9_GRID;\n\t\t\tskin.width = this.buttonMinWidth;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.buttonMinWidth;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.fontStyles = this.defaultFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\t\t}\n\n\t\tprotected function setQuietButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar defaultSkin:Quad = new Quad(this.controlSize, this.controlSize, 0xff00ff);\n\t\t\tdefaultSkin.alpha = 0;\n\t\t\tbutton.defaultSkin = defaultSkin;\n\n\t\t\tvar otherSkin:ImageSkin = new ImageSkin(null);\n\t\t\totherSkin.setTextureForState(ButtonState.HOVER, this.quietButtonHoverSkinTexture);\n\t\t\totherSkin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\tbutton.setSkinForState(ButtonState.HOVER, otherSkin);\n\t\t\tbutton.setSkinForState(ButtonState.DOWN, otherSkin);\n\t\t\tif(button is ToggleButton)\n\t\t\t{\n\t\t\t\t//for convenience, this function can style both a regular button\n\t\t\t\t//and a toggle button\n\t\t\t\totherSkin.selectedTexture = this.toggleButtonSelectedUpSkinTexture;\n\t\t\t\totherSkin.setTextureForState(ButtonState.HOVER_AND_SELECTED, this.toggleButtonSelectedHoverSkinTexture);\n\t\t\t\totherSkin.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.toggleButtonSelectedDownSkinTexture);\n\t\t\t\totherSkin.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.toggleButtonSelectedDisabledSkinTexture);\n\t\t\t\tToggleButton(button).defaultSelectedSkin = otherSkin;\n\t\t\t}\n\t\t\totherSkin.scale9Grid = BUTTON_SCALE_9_GRID;\n\t\t\totherSkin.width = this.controlSize;\n\t\t\totherSkin.height = this.controlSize;\n\t\t\totherSkin.minWidth = this.controlSize;\n\t\t\totherSkin.minHeight = this.controlSize;\n\n\t\t\tbutton.fontStyles = this.defaultFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\t\t}\n\n\t\tprotected function setCallToActionButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.callToActionButtonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.HOVER, this.callToActionButtonHoverSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\tskin.scale9Grid = BUTTON_SCALE_9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.fontStyles = this.defaultFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\t\t}\n\n\t\tprotected function setDangerButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.dangerButtonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.HOVER, this.dangerButtonHoverSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.dangerButtonDownSkinTexture);\n\t\t\tskin.scale9Grid = BUTTON_SCALE_9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.fontStyles = this.defaultFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\t\t}\n\n\t\tprotected function setBackButtonStyles(button:Button):void\n\t\t{\n\t\t\tthis.setButtonStyles(button);\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.backButtonUpIconTexture);\n\t\t\ticon.disabledTexture = this.backButtonDisabledIconTexture;\n\t\t\tbutton.defaultIcon = icon;\n\n\t\t\tbutton.iconPosition = RelativePosition.LEFT_BASELINE;\n\t\t}\n\n\t\tprotected function setForwardButtonStyles(button:Button):void\n\t\t{\n\t\t\tthis.setButtonStyles(button);\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.forwardButtonUpIconTexture);\n\t\t\ticon.disabledTexture = this.forwardButtonDisabledIconTexture;\n\t\t\tbutton.defaultIcon = icon;\n\n\t\t\tbutton.iconPosition = RelativePosition.RIGHT_BASELINE;\n\t\t}\n\n\t//-------------------------\n\t// ButtonGroup\n\t//-------------------------\n\n\t\tprotected function setButtonGroupStyles(group:ButtonGroup):void\n\t\t{\n\t\t\tgroup.gap = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// Callout\n\t//-------------------------\n\n\t\tprotected function setCalloutStyles(callout:Callout):void\n\t\t{\n\t\t\tvar backgroundSkin:Image = new Image(this.calloutBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = CALLOUT_SCALE_9_GRID;\n\t\t\tcallout.backgroundSkin = backgroundSkin;\n\n\t\t\tvar topArrowSkin:Image = new Image(this.calloutTopArrowSkinTexture);\n\t\t\tcallout.topArrowSkin = topArrowSkin;\n\t\t\tcallout.topArrowGap = this.calloutArrowOverlapGap;\n\t\t\tvar rightArrowSkin:Image = new Image(this.calloutRightArrowSkinTexture);\n\t\t\tcallout.rightArrowSkin = rightArrowSkin;\n\t\t\tcallout.rightArrowGap = this.calloutArrowOverlapGap - this.leftAndRightDropShadowSize;\n\t\t\tvar bottomArrowSkin:Image = new Image(this.calloutBottomArrowSkinTexture);\n\t\t\tcallout.bottomArrowSkin = bottomArrowSkin;\n\t\t\tcallout.bottomArrowGap = this.calloutArrowOverlapGap - this.bottomDropShadowSize;\n\t\t\tvar leftArrowSkin:Image = new Image(this.calloutLeftArrowSkinTexture);\n\t\t\tcallout.leftArrowSkin = leftArrowSkin;\n\t\t\tcallout.leftArrowGap = this.calloutArrowOverlapGap - this.leftAndRightDropShadowSize;\n\n\t\t\tcallout.paddingTop = this.smallGutterSize;\n\t\t\tcallout.paddingBottom = this.smallGutterSize + this.bottomDropShadowSize;\n\t\t\tcallout.paddingRight = this.gutterSize + this.leftAndRightDropShadowSize;\n\t\t\tcallout.paddingLeft = this.gutterSize + this.leftAndRightDropShadowSize;\n\t\t}\n\n\t\tprotected function setDangerCalloutStyles(callout:Callout):void\n\t\t{\n\t\t\tvar backgroundSkin:Image = new Image(this.dangerCalloutBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = CALLOUT_SCALE_9_GRID;\n\t\t\tcallout.backgroundSkin = backgroundSkin;\n\n\t\t\tvar topArrowSkin:Image = new Image(this.dangerCalloutTopArrowSkinTexture);\n\t\t\tcallout.topArrowSkin = topArrowSkin;\n\t\t\tcallout.topArrowGap = this.calloutArrowOverlapGap;\n\t\t\tvar rightArrowSkin:Image = new Image(this.dangerCalloutRightArrowSkinTexture);\n\t\t\tcallout.rightArrowSkin = rightArrowSkin;\n\t\t\tcallout.rightArrowGap = this.calloutArrowOverlapGap - this.leftAndRightDropShadowSize;\n\t\t\tvar bottomArrowSkin:Image = new Image(this.dangerCalloutBottomArrowSkinTexture);\n\t\t\tcallout.bottomArrowSkin = bottomArrowSkin;\n\t\t\tcallout.bottomArrowGap = this.calloutArrowOverlapGap - this.bottomDropShadowSize;\n\t\t\tvar leftArrowSkin:Image = new Image(this.dangerCalloutLeftArrowSkinTexture);\n\t\t\tcallout.leftArrowSkin = leftArrowSkin;\n\t\t\tcallout.leftArrowGap = this.calloutArrowOverlapGap - this.leftAndRightDropShadowSize;\n\n\t\t\tcallout.paddingTop = this.smallGutterSize;\n\t\t\tcallout.paddingBottom = this.smallGutterSize + this.bottomDropShadowSize;\n\t\t\tcallout.paddingRight = this.gutterSize + this.leftAndRightDropShadowSize;\n\t\t\tcallout.paddingLeft = this.gutterSize + this.leftAndRightDropShadowSize;\n\t\t}\n\n\t//-------------------------\n\t// Check\n\t//-------------------------\n\n\t\tprotected function setCheckStyles(check:Check):void\n\t\t{\n\t\t\tvar skin:Quad = new Quad(this.controlSize, this.controlSize);\n\t\t\tskin.alpha = 0;\n\t\t\tcheck.defaultSkin = skin;\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.checkUpIconTexture);\n\t\t\ticon.selectedTexture = this.checkSelectedUpIconTexture;\n\t\t\ticon.setTextureForState(ButtonState.HOVER, this.checkHoverIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DOWN, this.checkDownIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DISABLED, this.checkDisabledIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.HOVER_AND_SELECTED, this.checkSelectedHoverIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.checkSelectedDownIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.checkSelectedDisabledIconTexture);\n\t\t\tcheck.defaultIcon = icon;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tcheck.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tcheck.focusPadding = -2;\n\n\t\t\tcheck.fontStyles = this.defaultFontStyles.clone();\n\t\t\tcheck.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tcheck.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tcheck.verticalAlign = VerticalAlign.MIDDLE;\n\n\t\t\tcheck.gap = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// List\n\t//-------------------------\n\n\t\tprotected function setDataGridStyles(grid:DataGrid):void\n\t\t{\n\t\t\tthis.setScrollerStyles(grid);\n\n\t\t\tgrid.verticalScrollPolicy = ScrollPolicy.AUTO;\n\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.simpleBorderBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = SIMPLE_BORDER_SCALE_9_GRID;\n\t\t\tbackgroundSkin.width = this.controlSize;\n\t\t\tbackgroundSkin.height = this.controlSize;\n\t\t\tgrid.backgroundSkin = backgroundSkin;\n\n\t\t\tvar headerBackgroundSkin:ImageSkin = new ImageSkin(this.dataGridHeaderBackgroundSkinTexture);\n\t\t\theaderBackgroundSkin.width = this.controlSize;\n\t\t\theaderBackgroundSkin.height = this.controlSize;\n\t\t\tgrid.headerBackgroundSkin = headerBackgroundSkin;\n\n\t\t\tvar columnResizeSkin:ImageSkin = new ImageSkin(this.dataGridColumnResizeSkinTexture);\n\t\t\tcolumnResizeSkin.scale9Grid = DATA_GRID_VERTICAL_DIVIDER_SCALE_9_GRID;\n\t\t\tgrid.columnResizeSkin = columnResizeSkin;\n\n\t\t\tvar columnDropIndicatorSkin:ImageSkin = new ImageSkin(this.dataGridColumnDropIndicatorSkinTexture);\n\t\t\tcolumnDropIndicatorSkin.scale9Grid = DATA_GRID_COLUMN_DROP_INDICATOR_SCALE_9_GRID;\n\t\t\tgrid.columnDropIndicatorSkin = columnDropIndicatorSkin;\n\t\t\tgrid.extendedColumnDropIndicator = true;\n\n\t\t\tvar columnDragOverlaySkin:Quad = new Quad(1, 1, MODAL_OVERLAY_COLOR);\n\t\t\tcolumnDragOverlaySkin.alpha = MODAL_OVERLAY_ALPHA;\n\t\t\tgrid.columnDragOverlaySkin = columnDragOverlaySkin;\n\n\t\t\tgrid.verticalDividerFactory = this.dataGridVerticalDividerFactory;\n\t\t\tgrid.headerDividerFactory = this.dataGridHeaderDividerFactory;\n\n\t\t\tgrid.padding = this.borderSize;\n\t\t}\n\n\t\tprotected function setDataGridHeaderRendererStyles(headerRenderer:DefaultDataGridHeaderRenderer):void\n\t\t{\n\t\t\theaderRenderer.sortAscendingIcon = new ImageSkin(this.dataGridHeaderSortAscendingIconTexture);\n\t\t\theaderRenderer.sortDescendingIcon = new ImageSkin(this.dataGridHeaderSortDescendingIconTexture);\n\n\t\t\theaderRenderer.fontStyles = this.defaultFontStyles.clone();\n\t\t\theaderRenderer.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\theaderRenderer.paddingTop = this.extraSmallGutterSize;\n\t\t\theaderRenderer.paddingBottom = this.extraSmallGutterSize;\n\t\t\theaderRenderer.paddingLeft = this.smallGutterSize;\n\t\t\theaderRenderer.paddingRight = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setDataGridCellRendererStyles(cellRenderer:DefaultDataGridCellRenderer):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.itemRendererUpSkinTexture);\n\t\t\tskin.selectedTexture = this.itemRendererSelectedUpSkinTexture;\n\t\t\tskin.setTextureForState(ButtonState.HOVER, this.itemRendererHoverSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.itemRendererSelectedUpSkinTexture);\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tcellRenderer.defaultSkin = skin;\n\n\t\t\tcellRenderer.fontStyles = this.defaultFontStyles.clone();\n\t\t\tcellRenderer.disabledFontStyles = this.disabledFontStyles.clone();\n\t\t\tcellRenderer.iconLabelFontStyles = this.defaultFontStyles.clone();\n\t\t\tcellRenderer.iconLabelDisabledFontStyles = this.disabledFontStyles.clone();\n\t\t\tcellRenderer.accessoryLabelFontStyles = this.defaultFontStyles.clone();\n\t\t\tcellRenderer.accessoryLabelDisabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tcellRenderer.horizontalAlign = HorizontalAlign.LEFT;\n\n\t\t\tcellRenderer.iconPosition = RelativePosition.LEFT;\n\t\t\tcellRenderer.accessoryPosition = RelativePosition.RIGHT;\n\n\t\t\tcellRenderer.paddingTop = this.extraSmallGutterSize;\n\t\t\tcellRenderer.paddingBottom = this.extraSmallGutterSize;\n\t\t\tcellRenderer.paddingRight = this.smallGutterSize;\n\t\t\tcellRenderer.paddingLeft = this.smallGutterSize;\n\t\t\tcellRenderer.gap = this.extraSmallGutterSize;\n\t\t\tcellRenderer.minGap = this.extraSmallGutterSize;\n\t\t\tcellRenderer.accessoryGap = Number.POSITIVE_INFINITY;\n\t\t\tcellRenderer.minAccessoryGap = this.smallGutterSize;\n\n\t\t\tcellRenderer.useStateDelayTimer = false;\n\t\t}\n\n\t//-------------------------\n\t// DateTimeSpinner\n\t//-------------------------\n\n\t\tprotected function setDateTimeSpinnerStyles(spinner:DateTimeSpinner):void\n\t\t{\n\t\t\tspinner.customItemRendererStyleName = THEME_STYLE_NAME_DATE_TIME_SPINNER_LIST_ITEM_RENDERER;\n\t\t}\n\n\t\tprotected function setDateTimeSpinnerListItemRendererStyles(itemRenderer:DefaultListItemRenderer):void\n\t\t{\n\t\t\tthis.setItemRendererStyles(itemRenderer);\n\t\t\titemRenderer.accessoryPosition = RelativePosition.LEFT;\n\t\t\titemRenderer.accessoryGap = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// Drawers\n\t//-------------------------\n\n\t\tprotected function setDrawersStyles(drawers:Drawers):void\n\t\t{\n\t\t\tvar overlaySkin:Quad = new Quad(10, 10, MODAL_OVERLAY_COLOR);\n\t\t\toverlaySkin.alpha = MODAL_OVERLAY_ALPHA;\n\t\t\tdrawers.overlaySkin = overlaySkin;\n\t\t}\n\n\t//-------------------------\n\t// GroupedList\n\t//-------------------------\n\n\t\tprotected function setGroupedListStyles(list:GroupedList):void\n\t\t{\n\t\t\tthis.setScrollerStyles(list);\n\n\t\t\tlist.verticalScrollPolicy = ScrollPolicy.AUTO;\n\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.simpleBorderBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = SIMPLE_BORDER_SCALE_9_GRID;\n\t\t\tlist.backgroundSkin = backgroundSkin;\n\n\t\t\tlist.padding = this.borderSize;\n\t\t}\n\n\t\t//see List section for item renderer styles\n\n\t\tprotected function setGroupedListHeaderOrFooterRendererStyles(renderer:DefaultGroupedListHeaderOrFooterRenderer):void\n\t\t{\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.groupedListHeaderBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = HEADER_SCALE_9_GRID;\n\t\t\tbackgroundSkin.height = this.controlSize;\n\t\t\tbackgroundSkin.minWidth = this.controlSize;\n\t\t\tbackgroundSkin.minHeight = this.controlSize;\n\t\t\trenderer.backgroundSkin = backgroundSkin;\n\n\t\t\trenderer.fontStyles = this.defaultFontStyles.clone();\n\t\t\trenderer.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\trenderer.paddingTop = this.extraSmallGutterSize;\n\t\t\trenderer.paddingBottom = this.extraSmallGutterSize;\n\t\t\trenderer.paddingRight = this.smallGutterSize;\n\t\t\trenderer.paddingLeft = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setInsetGroupedListStyles(list:GroupedList):void\n\t\t{\n\t\t\tthis.setScrollerStyles(list);\n\n\t\t\tlist.verticalScrollPolicy = ScrollPolicy.AUTO;\n\n\t\t\tvar backgroundSkin:Image = new Image(this.insetBorderBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = SIMPLE_BORDER_SCALE_9_GRID;\n\t\t\tlist.backgroundSkin = backgroundSkin;\n\n\t\t\tlist.padding = this.borderSize;\n\n\t\t\tlist.customItemRendererStyleName = GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_ITEM_RENDERER;\n\t\t\tlist.customHeaderRendererStyleName = GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_HEADER_RENDERER;\n\t\t\tlist.customFooterRendererStyleName = GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_FOOTER_RENDERER;\n\n\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\tlayout.useVirtualLayout = true;\n\t\t\tlayout.paddingTop = this.gutterSize;\n\t\t\tlayout.paddingBottom = this.gutterSize;\n\t\t\tlayout.gap = 0;\n\t\t\tlayout.horizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\tlayout.verticalAlign = VerticalAlign.TOP;\n\t\t\tlist.layout = layout;\n\t\t}\n\n\t\tprotected function setInsetGroupedListItemRendererStyles(itemRenderer:BaseDefaultItemRenderer):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.itemRendererUpSkinTexture);\n\t\t\tskin.selectedTexture = this.itemRendererSelectedUpSkinTexture;\n\t\t\tskin.setTextureForState(ButtonState.HOVER, this.itemRendererHoverSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.itemRendererSelectedUpSkinTexture);\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\titemRenderer.defaultSkin = skin;\n\n\t\t\titemRenderer.fontStyles = this.defaultFontStyles.clone();\n\t\t\titemRenderer.disabledFontStyles = this.disabledFontStyles.clone();\n\t\t\titemRenderer.iconLabelFontStyles = this.defaultFontStyles.clone();\n\t\t\titemRenderer.iconLabelDisabledFontStyles = this.disabledFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelFontStyles = this.defaultFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelDisabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\titemRenderer.horizontalAlign = HorizontalAlign.LEFT;\n\n\t\t\titemRenderer.iconPosition = RelativePosition.LEFT;\n\t\t\titemRenderer.accessoryPosition = RelativePosition.RIGHT;\n\n\t\t\titemRenderer.paddingTop = this.extraSmallGutterSize;\n\t\t\titemRenderer.paddingBottom = this.extraSmallGutterSize;\n\t\t\titemRenderer.paddingRight = this.gutterSize;\n\t\t\titemRenderer.paddingLeft = this.gutterSize;\n\t\t\titemRenderer.gap = this.extraSmallGutterSize;\n\t\t\titemRenderer.minGap = this.extraSmallGutterSize;\n\t\t\titemRenderer.accessoryGap = Number.POSITIVE_INFINITY;\n\t\t\titemRenderer.minAccessoryGap = this.smallGutterSize;\n\n\t\t\titemRenderer.useStateDelayTimer = false;\n\t\t}\n\n\t\tprotected function setInsetGroupedListHeaderRendererStyles(headerRenderer:DefaultGroupedListHeaderOrFooterRenderer):void\n\t\t{\n\t\t\tvar skin:Quad = new Quad(this.controlSize, this.controlSize);\n\t\t\tskin.alpha = 0;\n\t\t\theaderRenderer.backgroundSkin = skin;\n\n\t\t\theaderRenderer.fontStyles = this.defaultFontStyles.clone();\n\t\t\theaderRenderer.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\theaderRenderer.paddingTop = this.gutterSize;\n\t\t\theaderRenderer.paddingBottom = this.smallGutterSize;\n\t\t\theaderRenderer.paddingRight = this.gutterSize;\n\t\t\theaderRenderer.paddingLeft = this.gutterSize;\n\t\t}\n\n\t\tprotected function setInsetGroupedListFooterRendererStyles(footerRenderer:DefaultGroupedListHeaderOrFooterRenderer):void\n\t\t{\n\t\t\tvar skin:Quad = new Quad(this.controlSize, this.controlSize);\n\t\t\tskin.alpha = 0;\n\t\t\tfooterRenderer.backgroundSkin = skin;\n\n\t\t\tfooterRenderer.fontStyles = this.defaultFontStyles.clone();\n\t\t\tfooterRenderer.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tfooterRenderer.paddingTop = this.smallGutterSize;\n\t\t\tfooterRenderer.paddingBottom = this.smallGutterSize;\n\t\t\tfooterRenderer.paddingRight = this.gutterSize;\n\t\t\tfooterRenderer.paddingLeft = this.gutterSize;\n\t\t}\n\n\t//-------------------------\n\t// Header\n\t//-------------------------\n\n\t\tprotected function setHeaderStyles(header:Header):void\n\t\t{\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.headerBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = HEADER_SCALE_9_GRID;\n\t\t\tbackgroundSkin.minWidth = this.gridSize;\n\t\t\tbackgroundSkin.minHeight = this.gridSize;\n\t\t\theader.backgroundSkin = backgroundSkin;\n\n\t\t\theader.fontStyles = this.defaultFontStyles.clone();\n\t\t\theader.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\theader.paddingTop = this.extraSmallGutterSize;\n\t\t\theader.paddingBottom = this.extraSmallGutterSize + this.borderSize;\n\t\t\theader.paddingLeft = this.smallGutterSize;\n\t\t\theader.paddingRight = this.smallGutterSize;\n\n\t\t\theader.gap = this.extraSmallGutterSize;\n\t\t\theader.titleGap = this.gutterSize;\n\t\t}\n\n\t//-------------------------\n\t// Label\n\t//-------------------------\n\n\t\tprotected function setLabelStyles(label:Label):void\n\t\t{\n\t\t\tlabel.fontStyles = this.defaultFontStyles.clone();\n\t\t\tlabel.disabledFontStyles = this.disabledFontStyles.clone();\n\t\t}\n\n\t\tprotected function setHeadingLabelStyles(label:Label):void\n\t\t{\n\t\t\tlabel.fontStyles = this.headingFontStyles.clone();\n\t\t\tlabel.disabledFontStyles = this.headingDisabledFontStyles.clone();\n\t\t}\n\n\t\tprotected function setDetailLabelStyles(label:Label):void\n\t\t{\n\t\t\tlabel.fontStyles = this.detailFontStyles.clone();\n\t\t\tlabel.disabledFontStyles = this.detailDisabledFontStyles.clone();\n\t\t}\n\n\t\tprotected function setToolTipLabelStyles(label:Label):void\n\t\t{\n\t\t\tvar backgroundSkin:Image = new Image(this.toolTipBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = TOOL_TIP_SCALE_9_GRID;\n\t\t\tlabel.backgroundSkin = backgroundSkin;\n\n\t\t\tlabel.fontStyles = this.defaultFontStyles.clone();\n\t\t\tlabel.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tlabel.paddingTop = this.extraSmallGutterSize;\n\t\t\tlabel.paddingRight = this.smallGutterSize + this.leftAndRightDropShadowSize;\n\t\t\tlabel.paddingBottom = this.extraSmallGutterSize + this.bottomDropShadowSize;\n\t\t\tlabel.paddingLeft = this.smallGutterSize + this.leftAndRightDropShadowSize;\n\t\t}\n\n\t//-------------------------\n\t// LayoutGroup\n\t//-------------------------\n\n\t\tprotected function setToolbarLayoutGroupStyles(group:LayoutGroup):void\n\t\t{\n\t\t\tif(!group.layout)\n\t\t\t{\n\t\t\t\tvar layout:HorizontalLayout = new HorizontalLayout();\n\t\t\t\tlayout.paddingTop = this.extraSmallGutterSize;\n\t\t\t\tlayout.paddingBottom = this.extraSmallGutterSize;\n\t\t\t\tlayout.paddingRight = this.smallGutterSize;\n\t\t\t\tlayout.paddingLeft = this.smallGutterSize;\n\t\t\t\tlayout.gap = this.smallGutterSize;\n\t\t\t\tlayout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\t\tgroup.layout = layout;\n\t\t\t}\n\n\t\t\tgroup.minHeight = this.gridSize;\n\n\t\t\tvar backgroundSkin:Image = new Image(this.headerBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = HEADER_SCALE_9_GRID;\n\t\t\tgroup.backgroundSkin = backgroundSkin;\n\t\t}\n\n\t//-------------------------\n\t// List\n\t//-------------------------\n\n\t\tprotected function setListStyles(list:List):void\n\t\t{\n\t\t\tthis.setScrollerStyles(list);\n\n\t\t\tlist.verticalScrollPolicy = ScrollPolicy.AUTO;\n\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.simpleBorderBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = SIMPLE_BORDER_SCALE_9_GRID;\n\t\t\tbackgroundSkin.width = this.controlSize;\n\t\t\tbackgroundSkin.height = this.controlSize;\n\t\t\tlist.backgroundSkin = backgroundSkin;\n\n\t\t\tvar dropIndicatorSkin:Quad = new Quad(this.borderSize, this.borderSize, PRIMARY_TEXT_COLOR);\n\t\t\tlist.dropIndicatorSkin = dropIndicatorSkin;\n\n\t\t\tlist.padding = this.borderSize;\n\t\t}\n\n\t\tprotected function setItemRendererStyles(itemRenderer:BaseDefaultItemRenderer):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.itemRendererUpSkinTexture);\n\t\t\tskin.selectedTexture = this.itemRendererSelectedUpSkinTexture;\n\t\t\tskin.setTextureForState(ButtonState.HOVER, this.itemRendererHoverSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.itemRendererSelectedUpSkinTexture);\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\titemRenderer.defaultSkin = skin;\n\n\t\t\titemRenderer.fontStyles = this.defaultFontStyles.clone();\n\t\t\titemRenderer.disabledFontStyles = this.disabledFontStyles.clone();\n\t\t\titemRenderer.iconLabelFontStyles = this.defaultFontStyles.clone();\n\t\t\titemRenderer.iconLabelDisabledFontStyles = this.disabledFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelFontStyles = this.defaultFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelDisabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\titemRenderer.horizontalAlign = HorizontalAlign.LEFT;\n\n\t\t\titemRenderer.iconPosition = RelativePosition.LEFT;\n\t\t\titemRenderer.accessoryPosition = RelativePosition.RIGHT;\n\n\t\t\titemRenderer.paddingTop = this.extraSmallGutterSize;\n\t\t\titemRenderer.paddingBottom = this.extraSmallGutterSize;\n\t\t\titemRenderer.paddingRight = this.smallGutterSize;\n\t\t\titemRenderer.paddingLeft = this.smallGutterSize;\n\t\t\titemRenderer.gap = this.extraSmallGutterSize;\n\t\t\titemRenderer.minGap = this.extraSmallGutterSize;\n\t\t\titemRenderer.accessoryGap = Number.POSITIVE_INFINITY;\n\t\t\titemRenderer.minAccessoryGap = this.smallGutterSize;\n\n\t\t\titemRenderer.useStateDelayTimer = false;\n\t\t}\n\n\t\tprotected function setDrillDownItemRendererStyles(itemRenderer:BaseDefaultItemRenderer):void\n\t\t{\n\t\t\tthis.setItemRendererStyles(itemRenderer);\n\n\t\t\titemRenderer.itemHasAccessory = false;\n\t\t\tvar defaultAccessory:ImageLoader = new ImageLoader();\n\t\t\tdefaultAccessory.source = this.listDrillDownAccessoryTexture;\n\t\t\titemRenderer.defaultAccessory = defaultAccessory;\n\t\t}\n\n\t\tprotected function setCheckItemRendererStyles(itemRenderer:BaseDefaultItemRenderer):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.itemRendererUpSkinTexture)\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\titemRenderer.defaultSkin = skin;\n\n\t\t\titemRenderer.itemHasIcon = false;\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.checkUpIconTexture);\n\t\t\ticon.selectedTexture = this.checkSelectedUpIconTexture;\n\t\t\ticon.setTextureForState(ButtonState.HOVER, this.checkHoverIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DOWN, this.checkDownIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DISABLED, this.checkDisabledIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.HOVER_AND_SELECTED, this.checkSelectedHoverIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.checkSelectedDownIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.checkSelectedDisabledIconTexture);\n\t\t\titemRenderer.defaultIcon = icon;\n\n\t\t\titemRenderer.fontStyles = this.defaultFontStyles.clone();\n\t\t\titemRenderer.disabledFontStyles = this.disabledFontStyles.clone();\n\t\t\titemRenderer.iconLabelFontStyles = this.defaultFontStyles.clone();\n\t\t\titemRenderer.iconLabelDisabledFontStyles = this.disabledFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelFontStyles = this.defaultFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelDisabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\titemRenderer.horizontalAlign = HorizontalAlign.LEFT;\n\n\t\t\titemRenderer.iconPosition = RelativePosition.LEFT;\n\t\t\titemRenderer.accessoryPosition = RelativePosition.RIGHT;\n\n\t\t\titemRenderer.paddingTop = this.extraSmallGutterSize;\n\t\t\titemRenderer.paddingBottom = this.extraSmallGutterSize;\n\t\t\titemRenderer.paddingRight = this.smallGutterSize;\n\t\t\titemRenderer.paddingLeft = this.smallGutterSize;\n\t\t\titemRenderer.gap = this.smallGutterSize;\n\t\t\titemRenderer.minGap = this.smallGutterSize;\n\t\t\titemRenderer.accessoryGap = Number.POSITIVE_INFINITY;\n\t\t\titemRenderer.minAccessoryGap = this.smallGutterSize;\n\n\t\t\titemRenderer.useStateDelayTimer = false;\n\t\t}\n\n\t//-------------------------\n\t// NumericStepper\n\t//-------------------------\n\n\t\tprotected function setNumericStepperStyles(stepper:NumericStepper):void\n\t\t{\n\t\t\tstepper.buttonLayoutMode = StepperButtonLayoutMode.RIGHT_SIDE_VERTICAL;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tstepper.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tstepper.focusPadding = -1;\n\t\t}\n\n\t\tprotected function setNumericStepperIncrementButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.stepperIncrementButtonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.HOVER, this.stepperIncrementButtonHoverSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.stepperIncrementButtonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.stepperIncrementButtonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = STEPPER_INCREMENT_BUTTON_SCALE_9_GRID;\n\t\t\tbutton.defaultSkin = skin;\n\t\t\tbutton.keepDownStateOnRollOut = true;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setNumericStepperDecrementButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.stepperDecrementButtonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.HOVER, this.stepperDecrementButtonHoverSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.stepperDecrementButtonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.stepperDecrementButtonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = STEPPER_DECREMENT_BUTTON_SCALE_9_GRID;\n\t\t\tbutton.defaultSkin = skin;\n\t\t\tbutton.keepDownStateOnRollOut = true;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setNumericStepperTextInputStyles(input:TextInput):void\n\t\t{\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.textInputBackgroundEnabledSkinTexture);\n\t\t\tbackgroundSkin.disabledTexture = this.textInputBackgroundDisabledSkinTexture;\n\t\t\tbackgroundSkin.scale9Grid = TEXT_INPUT_SCALE_9_GRID;\n\t\t\tbackgroundSkin.width = this.controlSize;\n\t\t\tbackgroundSkin.height = this.controlSize;\n\t\t\tbackgroundSkin.minWidth = this.controlSize;\n\t\t\tbackgroundSkin.minHeight = this.controlSize;\n\t\t\tinput.backgroundSkin = backgroundSkin;\n\n\t\t\tinput.fontStyles = this.defaultFontStyles.clone();\n\t\t\tinput.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tinput.gap = this.extraSmallGutterSize;\n\t\t\tinput.paddingTop = this.extraSmallGutterSize;\n\t\t\tinput.paddingBottom = this.extraSmallGutterSize;\n\t\t\tinput.paddingRight = this.smallGutterSize;\n\t\t\tinput.paddingLeft = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// PanelScreen\n\t//-------------------------\n\n\t\tprotected function setPanelScreenStyles(screen:PanelScreen):void\n\t\t{\n\t\t\tthis.setScrollerStyles(screen);\n\t\t}\n\n\t//-------------------------\n\t// PageIndicator\n\t//-------------------------\n\n\t\tprotected function setPageIndicatorStyles(pageIndicator:PageIndicator):void\n\t\t{\n\t\t\tpageIndicator.interactionMode = PageIndicatorInteractionMode.PRECISE;\n\n\t\t\tpageIndicator.normalSymbolFactory = this.pageIndicatorNormalSymbolFactory;\n\t\t\tpageIndicator.selectedSymbolFactory = this.pageIndicatorSelectedSymbolFactory;\n\n\t\t\tpageIndicator.gap = this.gutterSize;\n\t\t\tpageIndicator.padding = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// Panel\n\t//-------------------------\n\n\t\tprotected function setPanelStyles(panel:Panel):void\n\t\t{\n\t\t\tthis.setScrollerStyles(panel);\n\n\t\t\tvar backgroundSkin:Image = new Image(this.panelBorderBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = PANEL_BORDER_SCALE_9_GRID;\n\t\t\tpanel.backgroundSkin = backgroundSkin;\n\n\t\t\tpanel.paddingTop = 0;\n\t\t\tpanel.paddingRight = this.gutterSize;\n\t\t\tpanel.paddingBottom = this.gutterSize;\n\t\t\tpanel.paddingLeft = this.gutterSize;\n\t\t}\n\n\t\tprotected function setPanelHeaderStyles(header:Header):void\n\t\t{\n\t\t\theader.fontStyles = this.defaultFontStyles.clone();\n\t\t\theader.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\theader.minHeight = this.gridSize;\n\n\t\t\theader.paddingTop = this.extraSmallGutterSize;\n\t\t\theader.paddingBottom = this.extraSmallGutterSize;\n\t\t\theader.paddingLeft = this.gutterSize;\n\t\t\theader.paddingRight = this.gutterSize;\n\t\t\theader.gap = this.extraSmallGutterSize;\n\t\t\theader.titleGap = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// PickerList\n\t//-------------------------\n\n\t\tprotected function setPickerListStyles(list:PickerList):void\n\t\t{\n\t\t\tlist.popUpContentManager = new DropDownPopUpContentManager();\n\t\t}\n\n\t\tprotected function setPickerListButtonStyles(button:Button):void\n\t\t{\n\t\t\tthis.setButtonStyles(button);\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.pickerListUpIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.HOVER, this.pickerListHoverIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DOWN, this.pickerListDownIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DISABLED, this.pickerListDisabledIconTexture);\n\t\t\tbutton.defaultIcon = icon;\n\n\t\t\tbutton.gap = Number.POSITIVE_INFINITY; //fill as completely as possible\n\t\t\tbutton.minGap = this.smallGutterSize;\n\t\t\tbutton.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tbutton.iconPosition = RelativePosition.RIGHT;\n\t\t\tbutton.paddingRight = this.smallGutterSize;\n\t\t}\n\n\t\t//for the PickerList's pop-up list, see setDropDownListStyles()\n\n\t//-------------------------\n\t// ProgressBar\n\t//-------------------------\n\n\t\tprotected function setProgressBarStyles(progress:ProgressBar):void\n\t\t{\n\t\t\tvar backgroundSkin:Image = new Image(this.simpleBorderBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = SIMPLE_BORDER_SCALE_9_GRID;\n\t\t\tif(progress.direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tbackgroundSkin.height = this.wideControlSize;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbackgroundSkin.width = this.wideControlSize;\n\t\t\t}\n\t\t\tprogress.backgroundSkin = backgroundSkin;\n\n\t\t\tvar fillSkin:Image = new Image(this.progressBarFillSkinTexture);\n\t\t\tif(progress.direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tfillSkin.height = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfillSkin.width = 0;\n\t\t\t}\n\t\t\tprogress.fillSkin = fillSkin;\n\n\t\t\tprogress.padding = this.borderSize;\n\t\t}\n\n\t//-------------------------\n\t// Radio\n\t//-------------------------\n\n\t\tprotected function setRadioStyles(radio:Radio):void\n\t\t{\n\t\t\tvar skin:Quad = new Quad(this.controlSize, this.controlSize);\n\t\t\tskin.alpha = 0;\n\t\t\tradio.defaultSkin = skin;\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.radioUpIconTexture);\n\t\t\ticon.selectedTexture = this.radioSelectedUpIconTexture;\n\t\t\ticon.setTextureForState(ButtonState.HOVER, this.radioHoverIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DOWN, this.radioDownIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DISABLED, this.radioDisabledIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.HOVER_AND_SELECTED, this.radioSelectedHoverIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.radioSelectedDownIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.radioSelectedDisabledIconTexture);\n\t\t\tradio.defaultIcon = icon;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tradio.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tradio.focusPadding = -2;\n\n\t\t\tradio.fontStyles = this.defaultFontStyles.clone();\n\t\t\tradio.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tradio.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tradio.verticalAlign = VerticalAlign.MIDDLE;\n\n\t\t\tradio.gap = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// ScrollBar\n\t//-------------------------\n\n\t\tprotected function setHorizontalScrollBarStyles(scrollBar:ScrollBar):void\n\t\t{\n\t\t\tscrollBar.trackLayoutMode = TrackLayoutMode.SINGLE;\n\n\t\t\tscrollBar.customIncrementButtonStyleName = THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_INCREMENT_BUTTON;\n\t\t\tscrollBar.customDecrementButtonStyleName = THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_DECREMENT_BUTTON;\n\t\t\tscrollBar.customThumbStyleName = THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_THUMB;\n\t\t\tscrollBar.customMinimumTrackStyleName = THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_MINIMUM_TRACK;\n\t\t}\n\n\t\tprotected function setVerticalScrollBarStyles(scrollBar:ScrollBar):void\n\t\t{\n\t\t\tscrollBar.trackLayoutMode = TrackLayoutMode.SINGLE;\n\n\t\t\tscrollBar.customIncrementButtonStyleName = THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_INCREMENT_BUTTON;\n\t\t\tscrollBar.customDecrementButtonStyleName = THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_DECREMENT_BUTTON;\n\t\t\tscrollBar.customThumbStyleName = THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_THUMB;\n\t\t\tscrollBar.customMinimumTrackStyleName = THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_MINIMUM_TRACK;\n\t\t}\n\n\t\tprotected function setHorizontalScrollBarIncrementButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.hScrollBarStepButtonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.HOVER, this.hScrollBarStepButtonHoverSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.hScrollBarStepButtonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.hScrollBarStepButtonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = HORIZONTAL_SCROLL_BAR_STEP_BUTTON_SCALE_9_GRID;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.defaultIcon = new Image(this.hScrollBarIncrementButtonIconTexture);\n\n\t\t\tvar incrementButtonDisabledIcon:Quad = new Quad(1, 1, 0xff00ff);\n\t\t\tincrementButtonDisabledIcon.alpha = 0;\n\t\t\tbutton.disabledIcon = incrementButtonDisabledIcon;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setHorizontalScrollBarDecrementButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(hScrollBarStepButtonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.HOVER, this.hScrollBarStepButtonHoverSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.hScrollBarStepButtonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.hScrollBarStepButtonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = HORIZONTAL_SCROLL_BAR_STEP_BUTTON_SCALE_9_GRID;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.defaultIcon = new Image(this.hScrollBarDecrementButtonIconTexture);\n\n\t\t\tvar decrementButtonDisabledIcon:Quad = new Quad(1, 1, 0xff00ff);\n\t\t\tdecrementButtonDisabledIcon.alpha = 0;\n\t\t\tbutton.disabledIcon = decrementButtonDisabledIcon;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setHorizontalScrollBarThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.hScrollBarThumbUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.HOVER, this.hScrollBarThumbHoverSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.hScrollBarThumbDownSkinTexture);\n\t\t\tskin.scale9Grid = HORIZONTAL_SCROLL_BAR_THUMB_SCALE_9_GRID;\n\t\t\tskin.minWidth = this.smallControlSize;\n\t\t\tthumb.defaultSkin = skin;\n\n\t\t\tthumb.defaultIcon = new Image(this.hScrollBarThumbIconTexture);\n\t\t\tthumb.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\tthumb.paddingBottom = this.extraSmallGutterSize;\n\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setHorizontalScrollBarMinimumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar defaultSkin:Image = new Image(this.hScrollBarTrackSkinTexture);\n\t\t\tdefaultSkin.scale9Grid = HORIZONTAL_SCROLL_BAR_TRACK_SCALE_9_GRID;\n\t\t\ttrack.defaultSkin = defaultSkin;\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVerticalScrollBarIncrementButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.vScrollBarStepButtonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.HOVER, this.vScrollBarStepButtonHoverSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.vScrollBarStepButtonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.vScrollBarStepButtonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = VERTICAL_SCROLL_BAR_STEP_BUTTON_SCALE_9_GRID;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.defaultIcon = new Image(this.vScrollBarIncrementButtonIconTexture);\n\n\t\t\tvar incrementButtonDisabledIcon:Quad = new Quad(1, 1, 0xff00ff);\n\t\t\tincrementButtonDisabledIcon.alpha = 0;\n\t\t\tbutton.disabledIcon = incrementButtonDisabledIcon;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVerticalScrollBarDecrementButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.vScrollBarStepButtonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.HOVER, this.vScrollBarStepButtonHoverSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.vScrollBarStepButtonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.vScrollBarStepButtonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = VERTICAL_SCROLL_BAR_STEP_BUTTON_SCALE_9_GRID;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.defaultIcon = new Image(this.vScrollBarDecrementButtonIconTexture);\n\n\t\t\tvar decrementButtonDisabledIcon:Quad = new Quad(1, 1, 0xff00ff);\n\t\t\tdecrementButtonDisabledIcon.alpha = 0;\n\t\t\tbutton.disabledIcon = decrementButtonDisabledIcon;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVerticalScrollBarThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.vScrollBarThumbUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.HOVER, this.vScrollBarThumbHoverSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.vScrollBarThumbDownSkinTexture);\n\t\t\tskin.scale9Grid = VERTICAL_SCROLL_BAR_THUMB_SCALE_9_GRID;\n\t\t\tskin.minHeight = this.smallControlSize;\n\t\t\tthumb.defaultSkin = skin;\n\n\t\t\tthumb.defaultIcon = new Image(this.vScrollBarThumbIconTexture);\n\t\t\tthumb.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tthumb.paddingRight = this.extraSmallGutterSize;\n\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVerticalScrollBarMinimumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar defaultSkin:Image = new Image(this.vScrollBarTrackSkinTexture);\n\t\t\tdefaultSkin.scale9Grid = VERTICAL_SCROLL_BAR_TRACK_SCALE_9_GRID;\n\t\t\ttrack.defaultSkin = defaultSkin;\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t//-------------------------\n\t// ScrollContainer\n\t//-------------------------\n\n\t\tprotected function setScrollContainerStyles(container:ScrollContainer):void\n\t\t{\n\t\t\tthis.setScrollerStyles(container);\n\t\t}\n\n\t\tprotected function setToolbarScrollContainerStyles(container:ScrollContainer):void\n\t\t{\n\t\t\tthis.setScrollerStyles(container);\n\n\t\t\tif(!container.layout)\n\t\t\t{\n\t\t\t\tvar layout:HorizontalLayout = new HorizontalLayout();\n\t\t\t\tlayout.paddingTop = this.extraSmallGutterSize;\n\t\t\t\tlayout.paddingBottom = this.extraSmallGutterSize;\n\t\t\t\tlayout.paddingRight = this.smallGutterSize;\n\t\t\t\tlayout.paddingLeft = this.smallGutterSize;\n\t\t\t\tlayout.gap = this.extraSmallGutterSize;\n\t\t\t\tlayout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\t\tcontainer.layout = layout;\n\t\t\t}\n\n\t\t\tvar backgroundSkin:Image = new Image(this.headerBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = HEADER_SCALE_9_GRID;\n\t\t\tcontainer.backgroundSkin = backgroundSkin;\n\n\t\t\tcontainer.minHeight = this.gridSize;\n\t\t}\n\n\t//-------------------------\n\t// ScrollScreen\n\t//-------------------------\n\n\t\tprotected function setScrollScreenStyles(screen:ScrollScreen):void\n\t\t{\n\t\t\tthis.setScrollerStyles(screen);\n\t\t}\n\n\t//-------------------------\n\t// ScrollText\n\t//-------------------------\n\n\t\tprotected function setScrollTextStyles(text:ScrollText):void\n\t\t{\n\t\t\tthis.setScrollerStyles(text);\n\n\t\t\ttext.fontStyles = this.defaultFontStyles.clone();\n\t\t\ttext.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\ttext.padding = this.gutterSize;\n\t\t}\n\n\t//-------------------------\n\t// SimpleScrollBar\n\t//-------------------------\n\n\t\tprotected function setHorizontalSimpleScrollBarStyles(scrollBar:SimpleScrollBar):void\n\t\t{\n\t\t\tscrollBar.customThumbStyleName = THEME_STYLE_NAME_HORIZONTAL_SIMPLE_SCROLL_BAR_THUMB;\n\t\t}\n\n\t\tprotected function setVerticalSimpleScrollBarStyles(scrollBar:SimpleScrollBar):void\n\t\t{\n\t\t\tscrollBar.customThumbStyleName = THEME_STYLE_NAME_VERTICAL_SIMPLE_SCROLL_BAR_THUMB;\n\t\t}\n\n\t\tprotected function setHorizontalSimpleScrollBarThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.hScrollBarThumbUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.HOVER, this.hScrollBarThumbHoverSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.hScrollBarThumbDownSkinTexture);\n\t\t\tskin.scale9Grid = HORIZONTAL_SCROLL_BAR_THUMB_SCALE_9_GRID;\n\t\t\tthumb.defaultSkin = skin;\n\n\t\t\tthumb.defaultIcon = new Image(this.hScrollBarThumbIconTexture);\n\t\t\tthumb.verticalAlign = VerticalAlign.TOP;\n\t\t\tthumb.paddingTop = this.smallGutterSize;\n\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVerticalSimpleScrollBarThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.vScrollBarThumbUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.HOVER, this.vScrollBarThumbHoverSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.vScrollBarThumbDownSkinTexture);\n\t\t\tskin.scale9Grid = VERTICAL_SCROLL_BAR_THUMB_SCALE_9_GRID;\n\t\t\tthumb.defaultSkin = skin;\n\n\t\t\tthumb.defaultIcon = new Image(this.vScrollBarThumbIconTexture);\n\t\t\tthumb.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tthumb.paddingLeft = this.smallGutterSize;\n\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t//-------------------------\n\t// Slider\n\t//-------------------------\n\n\t\tprotected function setSliderStyles(slider:Slider):void\n\t\t{\n\t\t\tslider.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tslider.minimumPadding = slider.maximumPadding = -vSliderThumbUpSkinTexture.height / 2;\n\n\t\t\tif(slider.direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tslider.customThumbStyleName = THEME_STYLE_NAME_VERTICAL_SLIDER_THUMB;\n\t\t\t\tslider.customMinimumTrackStyleName = THEME_STYLE_NAME_VERTICAL_SLIDER_MINIMUM_TRACK;\n\n\t\t\t\tslider.focusPaddingLeft = slider.focusPaddingRight = -2;\n\t\t\t\tslider.focusPaddingTop = slider.focusPaddingBottom = -2 + slider.minimumPadding;\n\t\t\t}\n\t\t\telse //horizontal\n\t\t\t{\n\t\t\t\tslider.customThumbStyleName = THEME_STYLE_NAME_HORIZONTAL_SLIDER_THUMB;\n\t\t\t\tslider.customMinimumTrackStyleName = THEME_STYLE_NAME_HORIZONTAL_SLIDER_MINIMUM_TRACK;\n\n\t\t\t\tslider.focusPaddingTop = slider.focusPaddingBottom = -2;\n\t\t\t\tslider.focusPaddingLeft = slider.focusPaddingRight = -2 + slider.minimumPadding;\n\t\t\t}\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tslider.focusIndicatorSkin = focusIndicatorSkin;\n\t\t}\n\n\t\tprotected function setHorizontalSliderThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.hSliderThumbUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.HOVER, this.hSliderThumbHoverSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.hSliderThumbDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.hSliderThumbDisabledSkinTexture);\n\t\t\tthumb.defaultSkin = skin;\n\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setHorizontalSliderMinimumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar defaultSkin:Image = new Image(this.hSliderTrackEnabledSkinTexture);\n\t\t\tdefaultSkin.scale9Grid = HORIZONTAL_SLIDER_TRACK_SCALE_9_GRID;\n\t\t\tdefaultSkin.width = this.wideControlSize;\n\t\t\ttrack.defaultSkin = defaultSkin;\n\n\t\t\ttrack.minTouchHeight = this.controlSize;\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVerticalSliderThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.vSliderThumbUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.HOVER, this.vSliderThumbHoverSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.vSliderThumbDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.vSliderThumbDisabledSkinTexture);\n\t\t\tthumb.defaultSkin = skin;\n\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVerticalSliderMinimumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar defaultSkin:Image = new Image(this.vSliderTrackEnabledSkinTexture);\n\t\t\tdefaultSkin.scale9Grid = VERTICAL_SLIDER_TRACK_SCALE_9_GRID;\n\t\t\tdefaultSkin.height = this.wideControlSize;\n\t\t\ttrack.defaultSkin = defaultSkin;\n\n\t\t\ttrack.minTouchWidth = this.controlSize;\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t//-------------------------\n\t// SpinnerList\n\t//-------------------------\n\n\t\tprotected function setSpinnerListStyles(list:SpinnerList):void\n\t\t{\n\t\t\tthis.setListStyles(list);\n\t\t}\n\n\t//-------------------------\n\t// TabBar\n\t//-------------------------\n\n\t\tprotected function setTabBarStyles(tabBar:TabBar):void\n\t\t{\n\t\t\ttabBar.distributeTabSizes = false;\n\t\t\ttabBar.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\ttabBar.verticalAlign = VerticalAlign.JUSTIFY;\n\t\t}\n\n\t\tprotected function setTabStyles(tab:ToggleButton):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.tabUpSkinTexture);\n\t\t\tskin.selectedTexture = this.tabSelectedUpSkinTexture;\n\t\t\tskin.setTextureForState(ButtonState.HOVER, this.tabHoverSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.tabDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.tabDisabledSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.tabSelectedDisabledSkinTexture);\n\t\t\tskin.scale9Grid = TAB_SCALE_9_GRID;\n\t\t\tskin.minWidth = this.buttonMinWidth;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\ttab.defaultSkin = skin;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\ttab.focusIndicatorSkin = focusIndicatorSkin;\n\n\t\t\ttab.fontStyles = this.defaultFontStyles.clone();\n\t\t\ttab.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\ttab.paddingTop = this.extraSmallGutterSize;\n\t\t\ttab.paddingBottom = this.extraSmallGutterSize;\n\t\t\ttab.paddingLeft = this.smallGutterSize;\n\t\t\ttab.paddingRight = this.smallGutterSize;\n\t\t\ttab.gap = this.extraSmallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// TextArea\n\t//-------------------------\n\n\t\tprotected function setTextAreaStyles(textArea:TextArea):void\n\t\t{\n\t\t\tthis.setScrollerStyles(textArea);\n\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.textInputBackgroundEnabledSkinTexture);\n\t\t\tskin.disabledTexture = this.textInputBackgroundDisabledSkinTexture;\n\t\t\tskin.setTextureForState(TextInputState.ERROR, this.textInputBackgroundErrorSkinTexture);\n\t\t\tskin.scale9Grid = TEXT_INPUT_SCALE_9_GRID;\n\t\t\tskin.width = this.wideControlSize * 2;\n\t\t\tskin.height = this.wideControlSize;\n\t\t\ttextArea.backgroundSkin = skin;\n\n\t\t\ttextArea.fontStyles = this.defaultFontStyles.clone();\n\t\t\ttextArea.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\ttextArea.promptFontStyles = this.defaultFontStyles.clone();\n\t\t\ttextArea.promptDisabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\ttextArea.focusPadding = -2;\n\t\t\ttextArea.padding = this.borderSize;\n\t\t\t\n\t\t\ttextArea.innerPaddingTop = this.extraSmallGutterSize;\n\t\t\ttextArea.innerPaddingRight = this.smallGutterSize;\n\t\t\ttextArea.innerPaddingBottom = this.extraSmallGutterSize;\n\t\t\ttextArea.innerPaddingLeft = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setTextAreaErrorCalloutStyles(callout:TextCallout):void\n\t\t{\n\t\t\tthis.setDangerTextCalloutStyles(callout);\n\t\t\tcallout.verticalAlign = VerticalAlign.TOP;\n\t\t\tcallout.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tcallout.supportedPositions = new <String>[RelativePosition.RIGHT,\n\t\t\t\tRelativePosition.TOP, RelativePosition.BOTTOM, RelativePosition.LEFT];\n\t\t}\n\n\t//-------------------------\n\t// TextCallout\n\t//-------------------------\n\n\t\tprotected function setTextCalloutStyles(callout:TextCallout):void\n\t\t{\n\t\t\tthis.setCalloutStyles(callout);\n\n\t\t\tcallout.fontStyles = this.defaultFontStyles.clone();\n\t\t\tcallout.disabledFontStyles = this.disabledFontStyles.clone();\n\t\t}\n\n\t\tprotected function setDangerTextCalloutStyles(callout:TextCallout):void\n\t\t{\n\t\t\tthis.setDangerCalloutStyles(callout);\n\n\t\t\tcallout.fontStyles = this.invertedFontStyles.clone();\n\t\t\tcallout.disabledFontStyles = this.disabledFontStyles.clone();\n\t\t}\n\n\t//-------------------------\n\t// TextInput\n\t//-------------------------\n\n\t\tprotected function setBaseTextInputStyles(input:TextInput):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.textInputBackgroundEnabledSkinTexture);\n\t\t\tskin.disabledTexture = this.textInputBackgroundDisabledSkinTexture;\n\t\t\tskin.setTextureForState(TextInputState.ERROR, this.textInputBackgroundErrorSkinTexture);\n\t\t\tskin.scale9Grid = TEXT_INPUT_SCALE_9_GRID;\n\t\t\tskin.width = this.wideControlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.wideControlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tinput.backgroundSkin = skin;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tinput.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tinput.focusPadding = -2;\n\n\t\t\tinput.gap = this.extraSmallGutterSize;\n\t\t\tinput.paddingTop = this.extraSmallGutterSize;\n\t\t\tinput.paddingBottom = this.extraSmallGutterSize;\n\t\t\tinput.paddingRight = this.smallGutterSize;\n\t\t\tinput.paddingLeft = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setTextInputStyles(input:TextInput):void\n\t\t{\n\t\t\tthis.setBaseTextInputStyles(input);\n\n\t\t\tinput.fontStyles = this.defaultFontStyles.clone();\n\t\t\tinput.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tinput.promptFontStyles = this.defaultFontStyles.clone();\n\t\t\tinput.promptDisabledFontStyles = this.disabledFontStyles.clone();\n\t\t}\n\n\t\tprotected function setSearchTextInputStyles(input:TextInput):void\n\t\t{\n\t\t\tthis.setBaseTextInputStyles(input);\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.textInputSearchIconTexture);\n\t\t\ticon.disabledTexture = this.textInputSearchIconDisabledTexture;\n\t\t\tinput.defaultIcon = icon;\n\n\t\t\tinput.fontStyles = this.defaultFontStyles.clone();\n\t\t\tinput.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tinput.promptFontStyles = this.defaultFontStyles.clone();\n\t\t\tinput.promptDisabledFontStyles = this.disabledFontStyles.clone();\n\t\t}\n\n\t\tprotected function setTextInputErrorCalloutStyles(callout:TextCallout):void\n\t\t{\n\t\t\tthis.setDangerTextCalloutStyles(callout);\n\n\t\t\tcallout.verticalAlign = VerticalAlign.TOP;\n\t\t\tcallout.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tcallout.supportedPositions = new <String>[RelativePosition.RIGHT,\n\t\t\t\tRelativePosition.TOP, RelativePosition.BOTTOM, RelativePosition.LEFT];\n\t\t}\n\n\t//-------------------------\n\t// Toast\n\t//-------------------------\n\n\t\tprotected function setToastStyles(toast:Toast):void\n\t\t{\n\t\t\tvar backgroundSkin:Image = new Image(this.toolTipBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = TOOL_TIP_SCALE_9_GRID;\n\t\t\ttoast.backgroundSkin = backgroundSkin;\n\n\t\t\ttoast.fontStyles = this.defaultFontStyles.clone();\n\t\t\ttoast.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\ttoast.width = this.extraWideControlSize;\n\t\t\ttoast.paddingTop = this.gutterSize;\n\t\t\ttoast.paddingRight = this.gutterSize;\n\t\t\ttoast.paddingBottom = this.gutterSize;\n\t\t\ttoast.paddingLeft = this.gutterSize;\n\t\t\ttoast.gap = Number.POSITIVE_INFINITY;\n\t\t\ttoast.minGap = this.smallGutterSize;\n\t\t\ttoast.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\ttoast.verticalAlign = VerticalAlign.MIDDLE;\n\t\t}\n\n\t\tprotected function setToastActionsStyles(group:ButtonGroup):void\n\t\t{\n\t\t\tgroup.direction = Direction.HORIZONTAL;\n\t\t\tgroup.gap = this.smallGutterSize;\n\t\t\tgroup.customButtonStyleName = THEME_STYLE_NAME_TOAST_ACTIONS_BUTTON;\n\t\t}\n\n\t\tprotected function setToastActionsButtonStyles(button:Button):void\n\t\t{\n\t\t\tbutton.fontStyles = this.toastActionFontStyles.clone();\n\t\t\tbutton.setFontStylesForState(ButtonState.DOWN, this.toastActionActiveFontStyles);\n\t\t}\n\n\t//-------------------------\n\t// ToggleSwitch\n\t//-------------------------\n\n\t\tprotected function setToggleSwitchStyles(toggle:ToggleSwitch):void\n\t\t{\n\t\t\ttoggle.onLabelFontStyles = this.defaultFontStyles.clone();\n\t\t\ttoggle.onLabelDisabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\ttoggle.offLabelFontStyles = this.defaultFontStyles.clone();\n\t\t\ttoggle.offLabelDisabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\ttoggle.trackLayoutMode = TrackLayoutMode.SINGLE;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\ttoggle.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\ttoggle.focusPadding = -1;\n\t\t}\n\n\t\tprotected function setToggleSwitchOnTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar defaultSkin:Image = new Image(this.toggleButtonSelectedUpSkinTexture);\n\t\t\tdefaultSkin.scale9Grid = BUTTON_SCALE_9_GRID;\n\t\t\tdefaultSkin.width = 2 * this.controlSize + this.smallControlSize;\n\t\t\ttrack.defaultSkin = defaultSkin;\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setToggleSwitchThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tthis.setButtonStyles(thumb);\n\t\t\t\n\t\t\tthumb.width = this.controlSize;\n\t\t\tthumb.height = this.controlSize;\n\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t//-------------------------\n\t// Tree\n\t//-------------------------\n\n\t\tprotected function setTreeStyles(tree:Tree):void\n\t\t{\n\t\t\tthis.setScrollerStyles(tree);\n\n\t\t\ttree.verticalScrollPolicy = ScrollPolicy.AUTO;\n\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.simpleBorderBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = SIMPLE_BORDER_SCALE_9_GRID;\n\t\t\tbackgroundSkin.width = this.controlSize;\n\t\t\tbackgroundSkin.height = this.controlSize;\n\t\t\ttree.backgroundSkin = backgroundSkin;\n\n\t\t\ttree.padding = this.borderSize;\n\t\t}\n\n\t\tprotected function setTreeItemRendererStyles(itemRenderer:DefaultTreeItemRenderer):void\n\t\t{\n\t\t\tthis.setItemRendererStyles(itemRenderer);\n\n\t\t\titemRenderer.indentation = this.gutterSize;\n\n\t\t\titemRenderer.disclosureOpenIcon = new ImageSkin(this.treeDisclosureOpenIconTexture);\n\t\t\titemRenderer.disclosureClosedIcon = new ImageSkin(this.treeDisclosureClosedIconTexture);\n\t\t\titemRenderer.branchIcon = new ImageSkin(this.treeBranchClosedIconTexture);\n\t\t\titemRenderer.branchOpenIcon = new ImageSkin(this.treeBranchOpenIconTexture);\n\t\t\titemRenderer.leafIcon = new ImageSkin(this.treeLeafIconTexture);\n\t\t}\n\n\t//-------------------------\n\t// PlayPauseToggleButton\n\t//-------------------------\n\n\t\tprotected function setPlayPauseToggleButtonStyles(button:PlayPauseToggleButton):void\n\t\t{\n\t\t\tvar defaultSkin:Quad = new Quad(this.controlSize, this.controlSize, 0xff00ff);\n\t\t\tdefaultSkin.alpha = 0;\n\t\t\tbutton.defaultSkin = defaultSkin;\n\n\t\t\tvar otherSkin:ImageSkin = new ImageSkin(null);\n\t\t\totherSkin.setTextureForState(ButtonState.HOVER, this.quietButtonHoverSkinTexture);\n\t\t\totherSkin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\totherSkin.setTextureForState(ButtonState.HOVER_AND_SELECTED, this.toggleButtonSelectedHoverSkinTexture);\n\t\t\totherSkin.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.toggleButtonSelectedDownSkinTexture);\n\t\t\totherSkin.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.toggleButtonSelectedDisabledSkinTexture);\n\t\t\totherSkin.width = this.controlSize;\n\t\t\totherSkin.height = this.controlSize;\n\t\t\totherSkin.minWidth = this.controlSize;\n\t\t\totherSkin.minHeight = this.controlSize;\n\t\t\tbutton.setSkinForState(ButtonState.HOVER, otherSkin);\n\t\t\tbutton.setSkinForState(ButtonState.DOWN, otherSkin);\n\t\t\tbutton.setSkinForState(ButtonState.HOVER_AND_SELECTED, otherSkin);\n\t\t\tbutton.setSkinForState(ButtonState.DOWN_AND_SELECTED, otherSkin);\n\t\t\tbutton.setSkinForState(ButtonState.DISABLED_AND_SELECTED, otherSkin);\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tbutton.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tbutton.focusPadding = -1;\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.playPauseButtonPlayUpIconTexture);\n\t\t\ticon.selectedTexture = this.playPauseButtonPauseUpIconTexture;\n\t\t\tbutton.defaultIcon = icon;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\n\t\t\tbutton.paddingTop = this.extraSmallGutterSize;\n\t\t\tbutton.paddingRight = this.smallGutterSize;\n\t\t\tbutton.paddingBottom = this.extraSmallGutterSize;\n\t\t\tbutton.paddingLeft = this.smallGutterSize;\n\t\t\tbutton.gap = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setOverlayPlayPauseToggleButtonStyles(button:PlayPauseToggleButton):void\n\t\t{\n\t\t\tvar icon:ImageSkin = new ImageSkin(null);\n\t\t\ticon.setTextureForState(ButtonState.UP, this.overlayPlayPauseButtonPlayUpIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.HOVER, this.overlayPlayPauseButtonPlayUpIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DOWN, this.overlayPlayPauseButtonPlayUpIconTexture);\n\t\t\tbutton.defaultIcon = icon;\n\n\t\t\tbutton.isFocusEnabled = false;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\n\t\t\tvar overlaySkin:Quad = new Quad(1, 1, VIDEO_OVERLAY_COLOR);\n\t\t\toverlaySkin.alpha = VIDEO_OVERLAY_ALPHA;\n\t\t\tbutton.upSkin = overlaySkin;\n\t\t\tbutton.hoverSkin = overlaySkin;\n\t\t}\n\n\t//-------------------------\n\t// FullScreenToggleButton\n\t//-------------------------\n\n\t\tprotected function setFullScreenToggleButtonStyles(button:FullScreenToggleButton):void\n\t\t{\n\t\t\tvar defaultSkin:Quad = new Quad(this.controlSize, this.controlSize, 0xff00ff);\n\t\t\tdefaultSkin.alpha = 0;\n\t\t\tbutton.defaultSkin = defaultSkin;\n\n\t\t\tvar otherSkin:ImageSkin = new ImageSkin(null);\n\t\t\totherSkin.setTextureForState(ButtonState.HOVER, this.quietButtonHoverSkinTexture);\n\t\t\totherSkin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\totherSkin.setTextureForState(ButtonState.HOVER_AND_SELECTED, this.toggleButtonSelectedHoverSkinTexture);\n\t\t\totherSkin.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.toggleButtonSelectedDownSkinTexture);\n\t\t\totherSkin.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.toggleButtonSelectedDisabledSkinTexture);\n\t\t\totherSkin.width = this.controlSize;\n\t\t\totherSkin.height = this.controlSize;\n\t\t\totherSkin.minWidth = this.controlSize;\n\t\t\totherSkin.minHeight = this.controlSize;\n\t\t\tbutton.setSkinForState(ButtonState.HOVER, otherSkin);\n\t\t\tbutton.setSkinForState(ButtonState.DOWN, otherSkin);\n\t\t\tbutton.setSkinForState(ButtonState.HOVER_AND_SELECTED, otherSkin);\n\t\t\tbutton.setSkinForState(ButtonState.DOWN_AND_SELECTED, otherSkin);\n\t\t\tbutton.setSkinForState(ButtonState.DISABLED_AND_SELECTED, otherSkin);\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tbutton.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tbutton.focusPadding = -1;\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.fullScreenToggleButtonEnterUpIconTexture);\n\t\t\ticon.selectedTexture = this.fullScreenToggleButtonExitUpIconTexture;\n\t\t\tbutton.defaultIcon = icon;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\n\t\t\tbutton.paddingTop = this.extraSmallGutterSize;\n\t\t\tbutton.paddingRight = this.smallGutterSize;\n\t\t\tbutton.paddingBottom = this.extraSmallGutterSize;\n\t\t\tbutton.paddingLeft = this.smallGutterSize;\n\t\t\tbutton.gap = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// VolumeSlider\n\t//-------------------------\n\n\t\tprotected function setVolumeSliderStyles(slider:VolumeSlider):void\n\t\t{\n\t\t\tslider.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tslider.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tslider.focusPadding = -1;\n\t\t\tslider.showThumb = false;\n\t\t\tif(slider.direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tslider.customMinimumTrackStyleName = THEME_STYLE_NAME_VERTICAL_VOLUME_SLIDER_MINIMUM_TRACK;\n\t\t\t\tslider.customMaximumTrackStyleName = THEME_STYLE_NAME_VERTICAL_VOLUME_SLIDER_MAXIMUM_TRACK;\n\t\t\t\tslider.width = this.verticalVolumeSliderMinimumTrackSkinTexture.width;\n\t\t\t\tslider.height = this.verticalVolumeSliderMinimumTrackSkinTexture.height;\n\t\t\t}\n\t\t\telse //horizontal\n\t\t\t{\n\t\t\t\tslider.customMinimumTrackStyleName = THEME_STYLE_NAME_HORIZONTAL_VOLUME_SLIDER_MINIMUM_TRACK;\n\t\t\t\tslider.customMaximumTrackStyleName = THEME_STYLE_NAME_HORIZONTAL_VOLUME_SLIDER_MAXIMUM_TRACK;\n\t\t\t\tslider.width = this.horizontalVolumeSliderMinimumTrackSkinTexture.width;\n\t\t\t\tslider.height = this.horizontalVolumeSliderMinimumTrackSkinTexture.height;\n\t\t\t}\n\t\t}\n\n\t\tprotected function setVolumeSliderThumbStyles(button:Button):void\n\t\t{\n\t\t\tvar thumbSize:Number = 6;\n\t\t\tbutton.defaultSkin = new Quad(thumbSize, thumbSize);\n\t\t\tbutton.defaultSkin.width = 0;\n\t\t\tbutton.defaultSkin.height = 0;\n\t\t\tbutton.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setHorizontalVolumeSliderMinimumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar defaultSkin:ImageLoader = new ImageLoader();\n\t\t\tdefaultSkin.scaleContent = false;\n\t\t\tdefaultSkin.source = this.horizontalVolumeSliderMinimumTrackSkinTexture;\n\t\t\ttrack.defaultSkin = defaultSkin;\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setHorizontalVolumeSliderMaximumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar defaultSkin:ImageLoader = new ImageLoader();\n\t\t\tdefaultSkin.scaleContent = false;\n\t\t\tdefaultSkin.horizontalAlign = HorizontalAlign.RIGHT;\n\t\t\tdefaultSkin.source = this.horizontalVolumeSliderMaximumTrackSkinTexture;\n\t\t\ttrack.defaultSkin = defaultSkin;\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVerticalVolumeSliderMinimumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar defaultSkin:ImageLoader = new ImageLoader();\n\t\t\tdefaultSkin.scaleContent = false;\n\t\t\tdefaultSkin.verticalAlign = VerticalAlign.BOTTOM;\n\t\t\tdefaultSkin.source = this.verticalVolumeSliderMinimumTrackSkinTexture;\n\t\t\ttrack.defaultSkin = defaultSkin;\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVerticalVolumeSliderMaximumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar defaultSkin:ImageLoader = new ImageLoader();\n\t\t\tdefaultSkin.scaleContent = false;\n\t\t\tdefaultSkin.source = this.verticalVolumeSliderMaximumTrackSkinTexture;\n\t\t\ttrack.defaultSkin = defaultSkin;\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t//-------------------------\n\t// MuteToggleButton\n\t//-------------------------\n\n\t\tprotected function setMuteToggleButtonStyles(button:MuteToggleButton):void\n\t\t{\n\t\t\tvar defaultSkin:Quad = new Quad(this.controlSize, this.controlSize, 0xff00ff);\n\t\t\tdefaultSkin.alpha = 0;\n\t\t\tbutton.defaultSkin = defaultSkin;\n\t\t\t\n\t\t\tvar otherSkin:ImageSkin = new ImageSkin(null);\n\t\t\totherSkin.setTextureForState(ButtonState.HOVER, this.quietButtonHoverSkinTexture);\n\t\t\totherSkin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\totherSkin.setTextureForState(ButtonState.HOVER_AND_SELECTED, this.toggleButtonSelectedHoverSkinTexture);\n\t\t\totherSkin.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.toggleButtonSelectedDownSkinTexture);\n\t\t\totherSkin.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.toggleButtonSelectedDisabledSkinTexture);\n\t\t\totherSkin.width = this.controlSize;\n\t\t\totherSkin.height = this.controlSize;\n\t\t\totherSkin.minWidth = this.controlSize;\n\t\t\totherSkin.minHeight = this.controlSize;\n\t\t\tbutton.setSkinForState(ButtonState.HOVER, otherSkin);\n\t\t\tbutton.setSkinForState(ButtonState.DOWN, otherSkin);\n\t\t\tbutton.setSkinForState(ButtonState.HOVER_AND_SELECTED, otherSkin);\n\t\t\tbutton.setSkinForState(ButtonState.DOWN_AND_SELECTED, otherSkin);\n\t\t\tbutton.setSkinForState(ButtonState.DISABLED_AND_SELECTED, otherSkin);\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tbutton.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tbutton.focusPadding = -1;\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.muteToggleButtonLoudUpIconTexture);\n\t\t\ticon.selectedTexture = this.muteToggleButtonMutedUpIconTexture;\n\t\t\tbutton.defaultIcon = icon;\n\n\t\t\tbutton.showVolumeSliderOnHover = true;\n\t\t\tbutton.hasLabelTextRenderer = false;\n\n\t\t\tbutton.paddingTop = this.extraSmallGutterSize;\n\t\t\tbutton.paddingRight = this.smallGutterSize;\n\t\t\tbutton.paddingBottom = this.extraSmallGutterSize;\n\t\t\tbutton.paddingLeft = this.smallGutterSize;\n\t\t\tbutton.gap = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setPopUpVolumeSliderStyles(slider:VolumeSlider):void\n\t\t{\n\t\t\tslider.direction = Direction.VERTICAL;\n\t\t\tslider.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tslider.showThumb = false;\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tslider.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tslider.focusPadding = 4;\n\t\t\tslider.width = this.popUpVolumeSliderMinimumTrackSkinTexture.width;\n\t\t\tslider.height = this.popUpVolumeSliderMinimumTrackSkinTexture.height;\n\t\t\tslider.minimumPadding = this.popUpVolumeSliderPaddingSize;\n\t\t\tslider.maximumPadding = this.popUpVolumeSliderPaddingSize;\n\t\t\tslider.customMinimumTrackStyleName = THEME_STYLE_NAME_POP_UP_VOLUME_SLIDER_MINIMUM_TRACK;\n\t\t\tslider.customMaximumTrackStyleName = THEME_STYLE_NAME_POP_UP_VOLUME_SLIDER_MAXIMUM_TRACK;\n\t\t}\n\n\t\tprotected function setPopUpVolumeSliderMinimumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar defaultSkin:ImageLoader = new ImageLoader();\n\t\t\tdefaultSkin.scaleContent = false;\n\t\t\tdefaultSkin.verticalAlign = VerticalAlign.BOTTOM;\n\t\t\tdefaultSkin.source = this.popUpVolumeSliderMinimumTrackSkinTexture;\n\t\t\ttrack.defaultSkin = defaultSkin;\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setPopUpVolumeSliderMaximumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar defaultSkin:ImageLoader = new ImageLoader();\n\t\t\tdefaultSkin.scaleContent = false;\n\t\t\tdefaultSkin.source = this.popUpVolumeSliderMaximumTrackSkinTexture;\n\t\t\ttrack.defaultSkin = defaultSkin;\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t//-------------------------\n\t// SeekSlider\n\t//-------------------------\n\n\t\tprotected function setSeekSliderStyles(slider:SeekSlider):void\n\t\t{\n\t\t\tslider.direction = Direction.HORIZONTAL;\n\t\t\tslider.trackLayoutMode = TrackLayoutMode.SPLIT;\n\n\t\t\tslider.minimumPadding = slider.maximumPadding = -this.vSliderThumbUpSkinTexture.height / 2;\n\n\t\t\tslider.focusPaddingTop = slider.focusPaddingBottom = -2;\n\t\t\tslider.focusPaddingLeft = slider.focusPaddingRight = -2 + slider.minimumPadding;\n\n\t\t\tvar progressSkin:Image = new Image(this.seekSliderProgressSkinTexture);\n\t\t\tprogressSkin.scale9Grid = SEEK_SLIDER_MAXIMUM_TRACK_SCALE_9_GRID;\n\t\t\tprogressSkin.width = this.smallControlSize;\n\t\t\tslider.progressSkin = progressSkin;\n\t\t}\n\n\t\tprotected function setSeekSliderMinimumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar defaultSkin:ImageSkin = new ImageSkin(this.seekSliderMinimumTrackSkinTexture);\n\t\t\tdefaultSkin.scale9Grid = SEEK_SLIDER_MINIMUM_TRACK_SCALE_9_GRID;\n\t\t\tdefaultSkin.width = this.wideControlSize;\n\t\t\tdefaultSkin.minWidth = this.wideControlSize;\n\t\t\ttrack.defaultSkin = defaultSkin;\n\n\t\t\ttrack.minTouchHeight = this.controlSize;\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setSeekSliderMaximumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar defaultSkin:ImageSkin = new ImageSkin(this.seekSliderMaximumTrackSkinTexture);\n\t\t\tdefaultSkin.scale9Grid = SEEK_SLIDER_MAXIMUM_TRACK_SCALE_9_GRID;\n\t\t\tdefaultSkin.width = this.wideControlSize;\n\t\t\tdefaultSkin.minWidth = this.wideControlSize;\n\t\t\ttrack.defaultSkin = defaultSkin;\n\n\t\t\ttrack.minTouchHeight = this.controlSize;\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "themes/Export Theme PNGs.jsfl",
    "content": "var folder = fl.browseForFolderURL(\"Select a folder to export theme assets\");\n\nvar libraryItems = fl.getDocumentDOM().library.items;\nvar libraryItemsCount = libraryItems.length;\n\nvar otherDocument = fl.createDocument(\"timeline\");\n\nfor(var i = 0; i < libraryItemsCount; i++)\n{\n\tvar item = libraryItems[i];\n\tif(item.itemType !== \"movie clip\")\n\t{\n\t\tcontinue;\n\t}\n\tif(item.name.indexOf(\"Export/\") !== 0)\n\t{\n\t\tcontinue;\n\t}\n\tfl.copyLibraryItem(document.pathURI, item.name);\n\totherDocument.clipPaste(true);\n\tvar selectedItem = otherDocument.selection[0];\n\tvar itemName = item.name.substr(\"Export/\".length);\n\tvar exportPath = folder + \"/\" + itemName + \"0000.png\";\n\totherDocument.exportInstanceToPNGSequence(exportPath);\n\totherDocument.deleteSelection();\n}\notherDocument.close(false);"
  },
  {
    "path": "themes/MetalWorksDesktopTheme/README.md",
    "content": "# Metal Works Desktop Theme for Feathers\n\nThis [Feathers](http://feathersui.com/) theme for desktop combines an industrial aesthetic with bold orange highlights.\n\n## Original Artwork\n\nThis theme's texture atlas was exported from Adobe Animate CC. To modify colors and other properties, or to add new skins to the texture atlas, [download the source FLA file](http://feathersui.com/help/theme-sources.html) from the Feathers website.\n\n## Credits\n\nCreated exclusively for Feathers by [Josh Tynjala](https://joshblog.net/). Uses the open source font [Source Sans Pro](https://github.com/adobe/Source-Sans-Pro) created by Adobe Systems Incorporated."
  },
  {
    "path": "themes/MetalWorksDesktopTheme/assets/images/metalworks_desktop.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<TextureAtlas imagePath=\"metalworks_desktop.png\">\n\t<!-- Created with Adobe Animate version 18.0.1.115 -->\n\t<!-- http://www.adobe.com/products/animate.html -->\n\t<SubTexture name=\"back-button-disabled-skin0000\" x=\"49\" y=\"312\" width=\"37\" height=\"45\" pivotX=\"0.1\" pivotY=\"0\"/>\n\t<SubTexture name=\"back-button-down-skin0000\" x=\"472\" y=\"308\" width=\"37\" height=\"45\" pivotX=\"0.1\" pivotY=\"0\"/>\n\t<SubTexture name=\"back-button-up-skin0000\" x=\"472\" y=\"262\" width=\"37\" height=\"45\" pivotX=\"0.1\" pivotY=\"0\"/>\n\t<SubTexture name=\"background-danger-popup-skin0000\" x=\"226\" y=\"420\" width=\"13\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"background-danger-skin0000\" x=\"260\" y=\"433\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"background-disabled-skin0000\" x=\"226\" y=\"433\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"background-focused-skin0000\" x=\"391\" y=\"432\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"background-popup-skin0000\" x=\"430\" y=\"432\" width=\"13\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"background-skin0000\" x=\"243\" y=\"433\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-disabled-skin0000\" x=\"271\" y=\"388\" width=\"14\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-down-skin0000\" x=\"241\" y=\"388\" width=\"14\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-up-skin0000\" x=\"256\" y=\"388\" width=\"14\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"call-to-action-button-down-skin0000\" x=\"286\" y=\"388\" width=\"14\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"call-to-action-button-up-skin0000\" x=\"26\" y=\"381\" width=\"14\" height=\"45\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"callout-arrow-bottom-skin0000\" x=\"87\" y=\"333\" width=\"40\" height=\"26\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"callout-arrow-left-skin0000\" x=\"140\" y=\"312\" width=\"26\" height=\"40\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"callout-arrow-right-skin0000\" x=\"485\" y=\"1\" width=\"26\" height=\"41\" pivotX=\"0.05\" pivotY=\"0\"/>\n\t<SubTexture name=\"callout-arrow-top-skin0000\" x=\"167\" y=\"351\" width=\"40\" height=\"26\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"check-disabled-icon0000\" x=\"316\" y=\"355\" width=\"32\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"check-down-icon0000\" x=\"208\" y=\"362\" width=\"32\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"check-selected-disabled-icon0000\" x=\"75\" y=\"360\" width=\"32\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"check-selected-down-icon0000\" x=\"42\" y=\"358\" width=\"32\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"check-selected-up-icon0000\" x=\"382\" y=\"355\" width=\"32\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"check-up-icon0000\" x=\"349\" y=\"355\" width=\"32\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-button-down-skin0000\" x=\"301\" y=\"388\" width=\"14\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-button-up-skin0000\" x=\"415\" y=\"387\" width=\"14\" height=\"45\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-callout-arrow-bottom-skin0000\" x=\"451\" y=\"354\" width=\"40\" height=\"26\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-callout-arrow-left-skin0000\" x=\"424\" y=\"346\" width=\"26\" height=\"40\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-callout-arrow-right-skin0000\" x=\"229\" y=\"267\" width=\"26\" height=\"41\" pivotX=\"0.05\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-callout-arrow-top-skin0000\" x=\"1\" y=\"354\" width=\"40\" height=\"26\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-column-drop-indicator-skin0000\" x=\"505\" y=\"104\" width=\"6\" height=\"10\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-column-resize-skin0000\" x=\"505\" y=\"43\" width=\"6\" height=\"60\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-header-divider-skin0000\" x=\"250\" y=\"309\" width=\"10\" height=\"10\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-header-sort-ascending-icon0000\" x=\"277\" y=\"433\" width=\"17\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-header-sort-descending-icon0000\" x=\"295\" y=\"433\" width=\"17\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-vertical-divider-skin0000\" x=\"502\" y=\"43\" width=\"2\" height=\"10\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"focus-indicator-skin0000\" x=\"391\" y=\"388\" width=\"22\" height=\"22\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"forward-button-disabled-skin0000\" x=\"469\" y=\"216\" width=\"37\" height=\"45\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"forward-button-down-skin0000\" x=\"469\" y=\"170\" width=\"37\" height=\"45\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"forward-button-up-skin0000\" x=\"469\" y=\"124\" width=\"37\" height=\"45\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"full-screen-toggle-button-enter-down-icon0000\" x=\"424\" y=\"169\" width=\"44\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"full-screen-toggle-button-enter-up-icon0000\" x=\"424\" y=\"124\" width=\"44\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"full-screen-toggle-button-exit-down-icon0000\" x=\"424\" y=\"214\" width=\"44\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"full-screen-toggle-button-exit-up-icon0000\" x=\"424\" y=\"259\" width=\"44\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"header-background-skin0000\" x=\"1\" y=\"1\" width=\"260\" height=\"132\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"header-popup-background-skin0000\" x=\"1\" y=\"134\" width=\"260\" height=\"132\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-scroll-bar-decrement-button-disabled-icon0000\" x=\"505\" y=\"115\" width=\"6\" height=\"8\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-scroll-bar-decrement-button-disabled-skin0000\" x=\"341\" y=\"388\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-scroll-bar-decrement-button-down-skin0000\" x=\"316\" y=\"388\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-scroll-bar-decrement-button-icon0000\" x=\"250\" y=\"329\" width=\"6\" height=\"8\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-scroll-bar-decrement-button-up-skin0000\" x=\"366\" y=\"388\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-scroll-bar-increment-button-disabled-icon0000\" x=\"250\" y=\"320\" width=\"6\" height=\"8\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-scroll-bar-increment-button-disabled-skin0000\" x=\"205\" y=\"395\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-scroll-bar-increment-button-down-skin0000\" x=\"66\" y=\"393\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-scroll-bar-increment-button-icon0000\" x=\"128\" y=\"333\" width=\"6\" height=\"8\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-scroll-bar-increment-button-up-skin0000\" x=\"41\" y=\"391\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-simple-scroll-bar-thumb-skin0000\" x=\"87\" y=\"312\" width=\"52\" height=\"20\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"item-renderer-drill-down-accessory-icon0000\" x=\"167\" y=\"330\" width=\"12\" height=\"17\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"item-renderer-drill-down-accessory-selected-icon0000\" x=\"167\" y=\"312\" width=\"12\" height=\"17\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"item-renderer-hover-skin0000\" x=\"460\" y=\"346\" width=\"6\" height=\"6\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"item-renderer-selected-up-skin0000\" x=\"501\" y=\"354\" width=\"6\" height=\"48\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"item-renderer-up-skin0000\" x=\"208\" y=\"351\" width=\"6\" height=\"6\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"list-background-skin0000\" x=\"108\" y=\"360\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"mute-toggle-button-loud-down-icon0000\" x=\"424\" y=\"304\" width=\"47\" height=\"41\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"mute-toggle-button-loud-up-icon0000\" x=\"1\" y=\"312\" width=\"47\" height=\"41\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"mute-toggle-button-muted-down-icon0000\" x=\"181\" y=\"267\" width=\"47\" height=\"41\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"mute-toggle-button-muted-up-icon0000\" x=\"181\" y=\"309\" width=\"47\" height=\"41\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"overlay-play-pause-toggle-button-play-down-icon0000\" x=\"262\" y=\"1\" width=\"161\" height=\"176\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"overlay-play-pause-toggle-button-play-up-icon0000\" x=\"262\" y=\"178\" width=\"161\" height=\"176\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"page-indicator-disabled-symbol0000\" x=\"445\" y=\"422\" width=\"20\" height=\"20\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"page-indicator-selected-disabled-symbol0000\" x=\"1\" y=\"422\" width=\"20\" height=\"20\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"page-indicator-selected-symbol0000\" x=\"466\" y=\"422\" width=\"20\" height=\"20\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"page-indicator-symbol0000\" x=\"205\" y=\"420\" width=\"20\" height=\"20\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"picker-list-disabled-icon0000\" x=\"91\" y=\"393\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"picker-list-icon0000\" x=\"91\" y=\"410\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"picker-list-selected-icon0000\" x=\"485\" y=\"43\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"play-pause-toggle-button-pause-down-icon0000\" x=\"46\" y=\"267\" width=\"44\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"play-pause-toggle-button-pause-up-icon0000\" x=\"91\" y=\"267\" width=\"44\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"play-pause-toggle-button-play-down-icon0000\" x=\"1\" y=\"267\" width=\"44\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"play-pause-toggle-button-play-up-icon0000\" x=\"136\" y=\"267\" width=\"44\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"pop-up-volume-slider-track-skin0000\" x=\"424\" y=\"1\" width=\"60\" height=\"60\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"quiet-button-hover-skin0000\" x=\"430\" y=\"387\" width=\"14\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"radio-selected-disabled-icon0000\" x=\"250\" y=\"355\" width=\"32\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"radio-selected-down-icon0000\" x=\"128\" y=\"353\" width=\"32\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"radio-selected-up-icon0000\" x=\"283\" y=\"355\" width=\"32\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"search-disabled-icon0000\" x=\"487\" y=\"422\" width=\"20\" height=\"20\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"search-icon0000\" x=\"391\" y=\"411\" width=\"20\" height=\"20\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"seek-slider-progress-skin0000\" x=\"108\" y=\"427\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tab-disabled-skin0000\" x=\"1\" y=\"381\" width=\"24\" height=\"40\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tab-down-skin0000\" x=\"451\" y=\"381\" width=\"24\" height=\"40\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tab-selected-disabled-skin0000\" x=\"108\" y=\"386\" width=\"24\" height=\"40\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tab-selected-up-skin0000\" x=\"161\" y=\"378\" width=\"24\" height=\"41\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tab-up-skin0000\" x=\"476\" y=\"381\" width=\"24\" height=\"40\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"toggle-button-selected-disabled-skin0000\" x=\"133\" y=\"386\" width=\"18\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"toggle-button-selected-up-skin0000\" x=\"186\" y=\"378\" width=\"18\" height=\"45\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tree-disclosure-closed-icon0000\" x=\"22\" y=\"427\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tree-disclosure-closed-selected-icon0000\" x=\"91\" y=\"427\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tree-disclosure-open-icon0000\" x=\"125\" y=\"431\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tree-disclosure-open-selected-icon0000\" x=\"177\" y=\"424\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-scroll-bar-decrement-button-disabled-icon0000\" x=\"250\" y=\"345\" width=\"8\" height=\"6\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-scroll-bar-decrement-button-disabled-skin0000\" x=\"316\" y=\"413\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-scroll-bar-decrement-button-down-skin0000\" x=\"341\" y=\"413\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-scroll-bar-decrement-button-icon0000\" x=\"128\" y=\"342\" width=\"8\" height=\"6\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-scroll-bar-decrement-button-up-skin0000\" x=\"366\" y=\"413\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-scroll-bar-increment-button-disabled-icon0000\" x=\"250\" y=\"338\" width=\"8\" height=\"6\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-scroll-bar-increment-button-disabled-skin0000\" x=\"66\" y=\"418\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-scroll-bar-increment-button-down-skin0000\" x=\"152\" y=\"420\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-scroll-bar-increment-button-icon0000\" x=\"451\" y=\"346\" width=\"8\" height=\"6\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-scroll-bar-increment-button-up-skin0000\" x=\"41\" y=\"416\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-simple-scroll-bar-thumb-skin0000\" x=\"229\" y=\"309\" width=\"20\" height=\"52\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"volume-slider-maximum-track-skin0000\" x=\"424\" y=\"93\" width=\"80\" height=\"30\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"volume-slider-minimum-track-skin0000\" x=\"424\" y=\"62\" width=\"80\" height=\"30\" pivotX=\"0\" pivotY=\"0\"/>\n</TextureAtlas>\n"
  },
  {
    "path": "themes/MetalWorksDesktopTheme/package-src.json",
    "content": "{\n\t\"id\": \"feathersui_MetalWorksDesktopTheme-source\",\n\t\"name\": \"Feathers UI Metal Works Desktop Theme\",\n\t\"url\": \"https://feathersui.com/as3-starling/\",\n\t\"docUrl\": \"https://feathersui/api-reference/\",\n\t\"description\": \"Metal Works desktop theme for Feathers UI (Starling version)\",\n\t\"type\": \"src\",\n\t\"version\": \"4.2.0\",\n\t\"sourceUrl\": \"https://github.com/feathersui/feathersui-starling/releases/download/v4.2.0/feathersui_MetalWorksDesktopTheme-source_4.2.0.airpackage\",\n\t\"publishedAt\": \"2021-11-19T00:00:00.000Z\",\n\t\"dependencies\": [\n\t\t\"starling-source:2.x.x\",\n\t\t\"feathersui-source:4.2.x\"\n\t],\n\t\"parameters\": [],\n\t\"tags\": [\"theme\", \"feathers\", \"starling\"],\n\t\"status\": \"release\",\n\t\"license\": {\n\t  \"type\": \"Simplified BSD\",\n\t  \"url\": \"https://github.com/feathersui/feathersui-starling/blob/v4.2.0/LICENSE.md\",\n\t  \"public\": true\n\t}\n  }\n  "
  },
  {
    "path": "themes/MetalWorksDesktopTheme/package-swc.json",
    "content": "{\n\t\"id\": \"feathersui_MetalWorksDesktopTheme\",\n\t\"name\": \"Feathers UI Metal Works Desktop Theme\",\n\t\"url\": \"https://feathersui.com/as3-starling/\",\n\t\"docUrl\": \"https://feathersui/api-reference/\",\n\t\"description\": \"Metal Works desktop theme for Feathers UI (Starling version)\",\n\t\"type\": \"swc\",\n\t\"version\": \"4.2.0\",\n\t\"sourceUrl\": \"https://github.com/feathersui/feathersui-starling/releases/download/v4.2.0/feathersui_MetalWorksDesktopTheme_4.2.0.airpackage\",\n\t\"publishedAt\": \"2021-11-19T00:00:00.000Z\",\n\t\"dependencies\": [\n\t\t\"starling:2.x.x\",\n\t\t\"feathersui:4.2.x\"\n\t],\n\t\"parameters\": [],\n\t\"tags\": [\"theme\", \"feathers\", \"starling\"],\n\t\"status\": \"release\",\n\t\"license\": {\n\t  \"type\": \"Simplified BSD\",\n\t  \"url\": \"https://github.com/feathersui/feathersui-starling/blob/v4.2.0/LICENSE.md\",\n\t  \"public\": true\n\t}\n  }\n  "
  },
  {
    "path": "themes/MetalWorksDesktopTheme/source/feathers/themes/BaseMetalWorksDesktopTheme.as",
    "content": "/*\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n*/\npackage feathers.themes\n{\n\timport feathers.controls.Alert;\n\timport feathers.controls.AutoComplete;\n\timport feathers.controls.AutoSizeMode;\n\timport feathers.controls.Button;\n\timport feathers.controls.ButtonGroup;\n\timport feathers.controls.ButtonState;\n\timport feathers.controls.Callout;\n\timport feathers.controls.Check;\n\timport feathers.controls.DataGrid;\n\timport feathers.controls.DateTimeSpinner;\n\timport feathers.controls.Drawers;\n\timport feathers.controls.GroupedList;\n\timport feathers.controls.Header;\n\timport feathers.controls.ImageLoader;\n\timport feathers.controls.Label;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.List;\n\timport feathers.controls.NumericStepper;\n\timport feathers.controls.PageIndicator;\n\timport feathers.controls.PageIndicatorInteractionMode;\n\timport feathers.controls.Panel;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.PickerList;\n\timport feathers.controls.ProgressBar;\n\timport feathers.controls.Radio;\n\timport feathers.controls.ScrollBar;\n\timport feathers.controls.ScrollBarDisplayMode;\n\timport feathers.controls.ScrollContainer;\n\timport feathers.controls.ScrollInteractionMode;\n\timport feathers.controls.ScrollPolicy;\n\timport feathers.controls.ScrollScreen;\n\timport feathers.controls.ScrollText;\n\timport feathers.controls.Scroller;\n\timport feathers.controls.SimpleScrollBar;\n\timport feathers.controls.Slider;\n\timport feathers.controls.SpinnerList;\n\timport feathers.controls.StepperButtonLayoutMode;\n\timport feathers.controls.TabBar;\n\timport feathers.controls.TextArea;\n\timport feathers.controls.TextCallout;\n\timport feathers.controls.TextInput;\n\timport feathers.controls.TextInputState;\n\timport feathers.controls.Toast;\n\timport feathers.controls.ToggleButton;\n\timport feathers.controls.ToggleSwitch;\n\timport feathers.controls.TrackLayoutMode;\n\timport feathers.controls.Tree;\n\timport feathers.controls.popups.DropDownPopUpContentManager;\n\timport feathers.controls.renderers.BaseDefaultItemRenderer;\n\timport feathers.controls.renderers.DefaultDataGridCellRenderer;\n\timport feathers.controls.renderers.DefaultDataGridHeaderRenderer;\n\timport feathers.controls.renderers.DefaultGroupedListHeaderOrFooterRenderer;\n\timport feathers.controls.renderers.DefaultGroupedListItemRenderer;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.renderers.DefaultTreeItemRenderer;\n\timport feathers.controls.text.TextBlockTextEditor;\n\timport feathers.controls.text.TextBlockTextRenderer;\n\timport feathers.controls.text.TextFieldTextEditorViewPort;\n\timport feathers.core.FeathersControl;\n\timport feathers.core.FocusManager;\n\timport feathers.core.PopUpManager;\n\timport feathers.core.ToolTipManager;\n\timport feathers.layout.Direction;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.HorizontalLayout;\n\timport feathers.layout.RelativePosition;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.media.FullScreenToggleButton;\n\timport feathers.media.MuteToggleButton;\n\timport feathers.media.PlayPauseToggleButton;\n\timport feathers.media.SeekSlider;\n\timport feathers.media.VideoPlayer;\n\timport feathers.media.VolumeSlider;\n\timport feathers.skins.ImageSkin;\n\n\timport flash.geom.Rectangle;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.DisplayObjectContainer;\n\timport starling.display.Image;\n\timport starling.display.Quad;\n\timport starling.display.Stage;\n\timport starling.text.TextFormat;\n\timport starling.textures.Texture;\n\timport starling.textures.TextureAtlas;\n\n\t/**\n\t * The base class for the \"Metal Works\" theme for desktop Feathers apps.\n\t * Handles everything except asset loading, which is left to subclasses.\n\t *\n\t * @see MetalWorksDesktopTheme\n\t * @see MetalWorksDesktopThemeWithAssetManager\n\t */\n\tpublic class BaseMetalWorksDesktopTheme extends StyleNameFunctionTheme\n\t{\n\t\t[Embed(source=\"/../assets/fonts/SourceSansPro-Regular.ttf\",fontFamily=\"SourceSansPro\",fontWeight=\"normal\",mimeType=\"application/x-font\",embedAsCFF=\"true\")]\n\t\tprotected static const SOURCE_SANS_PRO_REGULAR:Class;\n\n\t\t[Embed(source=\"/../assets/fonts/SourceSansPro-Semibold.ttf\",fontFamily=\"SourceSansPro\",fontWeight=\"bold\",mimeType=\"application/x-font\",embedAsCFF=\"true\")]\n\t\tprotected static const SOURCE_SANS_PRO_SEMIBOLD:Class;\n\n\t\t/**\n\t\t * The name of the embedded font used by controls in this theme. Comes\n\t\t * in normal and bold weights.\n\t\t */\n\t\tpublic static const FONT_NAME:String = \"SourceSansPro\";\n\n\t\t/**\n\t\t * The stack of fonts to use for controls that don't use embedded fonts.\n\t\t */\n\t\tpublic static const FONT_NAME_STACK:String = \"Source Sans Pro,Helvetica,_sans\";\n\n\t\tprotected static const PRIMARY_BACKGROUND_COLOR:uint = 0x4a4137;\n\t\tprotected static const LIGHT_TEXT_COLOR:uint = 0xe5e5e5;\n\t\tprotected static const DARK_TEXT_COLOR:uint = 0x1a1816;\n\t\tprotected static const SELECTED_TEXT_COLOR:uint = 0xff9900;\n\t\tprotected static const LIGHT_DISABLED_TEXT_COLOR:uint = 0x8a8a8a;\n\t\tprotected static const DARK_DISABLED_TEXT_COLOR:uint = 0x383430;\n\t\tprotected static const GROUPED_LIST_HEADER_BACKGROUND_COLOR:uint = 0x292523;\n\t\tprotected static const GROUPED_LIST_FOOTER_BACKGROUND_COLOR:uint = 0x292523;\n\t\tprotected static const SCROLL_BAR_TRACK_COLOR:uint = 0x1a1816;\n\t\tprotected static const SCROLL_BAR_TRACK_DOWN_COLOR:uint = 0xff7700;\n\t\tprotected static const TEXT_SELECTION_BACKGROUND_COLOR:uint = 0x574f46;\n\t\tprotected static const MODAL_OVERLAY_COLOR:uint = 0x29241e;\n\t\tprotected static const MODAL_OVERLAY_ALPHA:Number = 0.8;\n\t\tprotected static const DRAWER_OVERLAY_COLOR:uint = 0x29241e;\n\t\tprotected static const DRAWER_OVERLAY_ALPHA:Number = 0.4;\n\t\tprotected static const VIDEO_OVERLAY_COLOR:uint = 0x1a1816;\n\t\tprotected static const VIDEO_OVERLAY_ALPHA:Number = 0.2;\n\t\tprotected static const DATA_GRID_COLUMN_OVERLAY_COLOR:uint = 0x383430;\n\t\tprotected static const DATA_GRID_COLUMN_OVERLAY_ALPHA:Number = 0.4;\n\n\t\tprotected static const DEFAULT_SCALE9_GRID:Rectangle = new Rectangle(3, 3, 1, 1);\n\t\tprotected static const SIMPLE_SCALE9_GRID:Rectangle = new Rectangle(2, 2, 1, 1);\n\t\tprotected static const BUTTON_SCALE9_GRID:Rectangle = new Rectangle(3, 3, 1, 16);\n\t\tprotected static const TOGGLE_BUTTON_SCALE9_GRID:Rectangle = new Rectangle(4, 4, 1, 14);\n\t\tprotected static const SCROLL_BAR_STEP_BUTTON_SCALE9_GRID:Rectangle = new Rectangle(3, 3, 6, 6);\n\t\tprotected static const VOLUME_SLIDER_TRACK_SCALE9_GRID:Rectangle = new Rectangle(12, 12, 1, 1);\n\t\tprotected static const BACK_BUTTON_SCALE9_GRID:Rectangle = new Rectangle(13, 0, 1, 22);\n\t\tprotected static const FORWARD_BUTTON_SCALE9_GRID:Rectangle = new Rectangle(3, 0, 1, 22);\n\t\tprotected static const FOCUS_INDICATOR_SCALE_9_GRID:Rectangle = new Rectangle(5, 5, 1, 1);\n\t\tprotected static const TAB_SCALE9_GRID:Rectangle = new Rectangle(7, 7, 1, 11);\n\t\tprotected static const HORIZONTAL_SCROLL_BAR_THUMB_SCALE_9_GRID:Rectangle = new Rectangle(5, 0, 14, 10);\n\t\tprotected static const VERTICAL_SCROLL_BAR_THUMB_SCALE_9_GRID:Rectangle = new Rectangle(0, 5, 10, 14);\n\t\tprotected static const DATA_GRID_HEADER_DIVIDER_SCALE_9_GRID:Rectangle = new Rectangle(0, 1, 2, 4);\n\t\tprotected static const DATA_GRID_VERTICAL_DIVIDER_SCALE_9_GRID:Rectangle = new Rectangle(0, 1, 1, 4);\n\t\tprotected static const DATA_GRID_COLUMN_RESIZE_SCALE_9_GRID:Rectangle = new Rectangle(0, 1, 3, 28);\n\t\tprotected static const DATA_GRID_COLUMN_DROP_INDICATOR_SCALE_9_GRID:Rectangle = new Rectangle(0, 1, 3, 3);\n\t\t\n\t\tprotected static const ITEM_RENDERER_SKIN_TEXTURE_REGION:Rectangle = new Rectangle(1, 1, 1, 1);\n\t\tprotected static const ITEM_RENDERER_SELECTED_SKIN_TEXTURE_REGION:Rectangle = new Rectangle(1, 1, 1, 22);\n\t\tprotected static const HEADER_SKIN_TEXTURE_REGION:Rectangle = new Rectangle(1, 1, 128, 64);\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the increment button of a horizontal ScrollBar.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_INCREMENT_BUTTON:String = \"metalworks-desktop-horizontal-scroll-bar-increment-button\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the decrement button of a horizontal ScrollBar.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_DECREMENT_BUTTON:String = \"metalworks-desktop-horizontal-scroll-bar-decrement-button\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the thumb of a horizontal ScrollBar.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_THUMB:String = \"metalworks-desktop-horizontal-scroll-bar-thumb\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the minimum track of a horizontal ScrollBar.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_MINIMUM_TRACK:String = \"metalworks-desktop-horizontal-scroll-bar-minimum-track\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the maximum track of a horizontal ScrollBar.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_MAXIMUM_TRACK:String = \"metalworks-desktop-horizontal-scroll-bar-maximum-track\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the increment button of a vertical ScrollBar.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_INCREMENT_BUTTON:String = \"metalworks-desktop-vertical-scroll-bar-increment-button\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the decrement button of a vertical ScrollBar.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_DECREMENT_BUTTON:String = \"metalworks-desktop-vertical-scroll-bar-decrement-button\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the thumb of a vertical ScrollBar.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_THUMB:String = \"metalworks-desktop-vertical-scroll-bar-thumb\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the minimum track of a vertical ScrollBar.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_MINIMUM_TRACK:String = \"metalworks-desktop-vertical-scroll-bar-minimum-track\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the maximum track of a vertical ScrollBar.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_MAXIMUM_TRACK:String = \"metalworks-desktop-vertical-scroll-bar-maximum-track\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the thumb of a horizontal SimpleScrollBar.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_HORIZONTAL_SIMPLE_SCROLL_BAR_THUMB:String = \"metalworks-desktop-horizontal-simple-scroll-bar-thumb\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the thumb of a vertical SimpleScrollBar.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_VERTICAL_SIMPLE_SCROLL_BAR_THUMB:String = \"metalworks-desktop-vertical-simple-scroll-bar-thumb\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the minimum track of a horizontal slider.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_HORIZONTAL_SLIDER_MINIMUM_TRACK:String = \"metalworks-desktop-horizontal-slider-minimum-track\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the maximum track of a horizontal slider.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_HORIZONTAL_SLIDER_MAXIMUM_TRACK:String = \"metalworks-desktop-horizontal-slider-maximum-track\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the minimum track of a vertical slider.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_VERTICAL_SLIDER_MINIMUM_TRACK:String = \"metalworks-desktop-vertical-slider-minimum-track\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the maximum track of a vertical slider.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_VERTICAL_SLIDER_MAXIMUM_TRACK:String = \"metalworks-desktop-vertical-slider-maximum-track\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_POP_UP_VOLUME_SLIDER_THUMB:String = \"metalworks-desktop-pop-up-volume-slider-thumb\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_POP_UP_VOLUME_SLIDER_MINIMUM_TRACK:String = \"metalworks-desktop-pop-up-volume-slider-minimum-track\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_DATE_TIME_SPINNER_LIST_ITEM_RENDERER:String = \"metalworks-desktop-date-time-spinner-list-item-renderer\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_ALERT_BUTTON_GROUP_BUTTON:String = \"metalworks-desktop-alert-button-group-button\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the action buttons of a toast.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_TOAST_ACTIONS_BUTTON:String = \"metal-works-mobile-toast-actions-button\";\n\n\t\t/**\n\t\t * The default global text renderer factory for this theme creates a\n\t\t * TextBlockTextRenderer.\n\t\t */\n\t\tprotected static function textRendererFactory():TextBlockTextRenderer\n\t\t{\n\t\t\treturn new TextBlockTextRenderer();\n\t\t}\n\n\t\t/**\n\t\t * The default global text editor factory for this theme creates a\n\t\t * TextBlockTextEditor.\n\t\t */\n\t\tprotected static function textEditorFactory():TextBlockTextEditor\n\t\t{\n\t\t\treturn new TextBlockTextEditor();\n\t\t}\n\n\t\t/**\n\t\t * This theme's scroll bar type is ScrollBar.\n\t\t */\n\t\tprotected static function scrollBarFactory():ScrollBar\n\t\t{\n\t\t\treturn new ScrollBar();\n\t\t}\n\n\t\tprotected static function popUpOverlayFactory():DisplayObject\n\t\t{\n\t\t\tvar quad:Quad = new Quad(100, 100, MODAL_OVERLAY_COLOR);\n\t\t\tquad.alpha = MODAL_OVERLAY_ALPHA;\n\t\t\treturn quad;\n\t\t}\n\n\t\tprotected static function pickerListButtonFactory():ToggleButton\n\t\t{\n\t\t\treturn new ToggleButton();\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function BaseMetalWorksDesktopTheme()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * A smaller font size for details.\n\t\t */\n\t\tprotected var smallFontSize:int = 11;\n\n\t\t/**\n\t\t * A normal font size.\n\t\t */\n\t\tprotected var regularFontSize:int = 14;\n\n\t\t/**\n\t\t * A larger font size for headers.\n\t\t */\n\t\tprotected var largeFontSize:int = 18;\n\n\t\t/**\n\t\t * The size, in pixels, of major regions in the grid. Used for sizing\n\t\t * containers and larger UI controls.\n\t\t */\n\t\tprotected var gridSize:int = 32;\n\n\t\t/**\n\t\t * The size, in pixels, of minor regions in the grid. Used for larger\n\t\t * padding and gaps.\n\t\t */\n\t\tprotected var gutterSize:int = 8;\n\n\t\t/**\n\t\t * The size, in pixels, of smaller padding and gaps within the major\n\t\t * regions in the grid.\n\t\t */\n\t\tprotected var smallGutterSize:int = 4;\n\n\t\t/**\n\t\t * The size, in pixels, of very smaller padding and gaps.\n\t\t */\n\t\tprotected var extraSmallGutterSize:int = 2;\n\n\t\t/**\n\t\t * The minimum width, in pixels, of some types of buttons.\n\t\t */\n\t\tprotected var buttonMinWidth:int = 68;\n\n\t\t/**\n\t\t * The width, in pixels, of UI controls that span across multiple grid regions.\n\t\t */\n\t\tprotected var wideControlSize:int = 144;\n\n\t\t/**\n\t\t * The width, in pixels, of very large UI controls.\n\t\t */\n\t\tprotected var extraWideControlSize:int = 210;\n\n\t\t/**\n\t\t * The size, in pixels, of a typical UI control.\n\t\t */\n\t\tprotected var controlSize:int = 26;\n\n\t\t/**\n\t\t * The size, in pixels, of smaller UI controls.\n\t\t */\n\t\tprotected var smallControlSize:int = 12;\n\n\t\t/**\n\t\t * The size, in pixels, of a border around any control.\n\t\t */\n\t\tprotected var borderSize:int = 1;\n\n\t\t/**\n\t\t * The size, in pixels, of the focus indicator skin's padding.\n\t\t */\n\t\tprotected var focusPaddingSize:int = -2;\n\n\t\tprotected var calloutArrowOverlapGap:int = -2;\n\t\tprotected var calloutBackgroundMinSize:int = 5;\n\t\tprotected var progressBarFillMinSize:int = 7;\n\t\tprotected var scrollBarGutterSize:int = 4;\n\t\tprotected var popUpSize:int = 336;\n\t\tprotected var popUpVolumeSliderPaddingSize:int = 10;\n\n\t\t/**\n\t\t * The font styles for standard-sized, light text.\n\t\t */\n\t\tprotected var lightFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for standard-sized, dark text.\n\t\t */\n\t\tprotected var darkFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for standard-sized, selected text.\n\t\t */\n\t\tprotected var selectedFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for standard-sized, light, disabled text.\n\t\t */\n\t\tprotected var lightDisabledFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for light UI text.\n\t\t */\n\t\tprotected var lightUIFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for dark UI text.\n\t\t */\n\t\tprotected var darkUIFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for selected UI text.\n\t\t */\n\t\tprotected var selectedUIFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for light disabled UI text.\n\t\t */\n\t\tprotected var lightDisabledUIFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for light, centered UI text.\n\t\t */\n\t\tprotected var lightCenteredUIFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for light, centered, disabled UI text.\n\t\t */\n\t\tprotected var lightCenteredDisabledUIFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for small, light text.\n\t\t */\n\t\tprotected var smallLightFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for small, light, disabled text.\n\t\t */\n\t\tprotected var smallLightDisabledFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for large, light text.\n\t\t */\n\t\tprotected var largeLightFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for large, dark text.\n\t\t */\n\t\tprotected var largeDarkFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for large, light, disabled text.\n\t\t */\n\t\tprotected var largeLightDisabledFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for dark, disabled UI text.\n\t\t */\n\t\tprotected var darkDisabledUIFontStyles:TextFormat;\n\n\t\t/**\n\t\t * ScrollText uses TextField instead of FTE, so it has a separate TextFormat.\n\t\t */\n\t\tprotected var lightScrollTextFontStyles:TextFormat;\n\n\t\t/**\n\t\t * ScrollText uses TextField instead of FTE, so it has a separate disabled TextFormat.\n\t\t */\n\t\tprotected var lightDisabledScrollTextFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The texture atlas that contains skins for this theme. This base class\n\t\t * does not initialize this member variable. Subclasses are expected to\n\t\t * load the assets somehow and set the <code>atlas</code> member\n\t\t * variable before calling <code>initialize()</code>.\n\t\t */\n\t\tprotected var atlas:TextureAtlas;\n\n\t\tprotected var focusIndicatorSkinTexture:Texture;\n\t\tprotected var headerBackgroundSkinTexture:Texture;\n\t\tprotected var headerPopupBackgroundSkinTexture:Texture;\n\t\tprotected var backgroundSkinTexture:Texture;\n\t\tprotected var backgroundDisabledSkinTexture:Texture;\n\t\tprotected var backgroundFocusedSkinTexture:Texture;\n\t\tprotected var backgroundDangerSkinTexture:Texture;\n\t\tprotected var listBackgroundSkinTexture:Texture;\n\t\tprotected var buttonUpSkinTexture:Texture;\n\t\tprotected var buttonDownSkinTexture:Texture;\n\t\tprotected var buttonDisabledSkinTexture:Texture;\n\t\tprotected var toggleButtonSelectedUpSkinTexture:Texture;\n\t\tprotected var toggleButtonSelectedDisabledSkinTexture:Texture;\n\t\tprotected var buttonQuietHoverSkinTexture:Texture;\n\t\tprotected var buttonCallToActionUpSkinTexture:Texture;\n\t\tprotected var buttonCallToActionDownSkinTexture:Texture;\n\t\tprotected var buttonDangerUpSkinTexture:Texture;\n\t\tprotected var buttonDangerDownSkinTexture:Texture;\n\t\tprotected var buttonBackUpSkinTexture:Texture;\n\t\tprotected var buttonBackDownSkinTexture:Texture;\n\t\tprotected var buttonBackDisabledSkinTexture:Texture;\n\t\tprotected var buttonForwardUpSkinTexture:Texture;\n\t\tprotected var buttonForwardDownSkinTexture:Texture;\n\t\tprotected var buttonForwardDisabledSkinTexture:Texture;\n\t\tprotected var pickerListButtonIconTexture:Texture;\n\t\tprotected var pickerListButtonIconSelectedTexture:Texture;\n\t\tprotected var pickerListButtonIconDisabledTexture:Texture;\n\t\tprotected var tabUpSkinTexture:Texture;\n\t\tprotected var tabDownSkinTexture:Texture;\n\t\tprotected var tabDisabledSkinTexture:Texture;\n\t\tprotected var tabSelectedSkinTexture:Texture;\n\t\tprotected var tabSelectedDisabledSkinTexture:Texture;\n\t\tprotected var radioUpIconTexture:Texture;\n\t\tprotected var radioDownIconTexture:Texture;\n\t\tprotected var radioDisabledIconTexture:Texture;\n\t\tprotected var radioSelectedUpIconTexture:Texture;\n\t\tprotected var radioSelectedDownIconTexture:Texture;\n\t\tprotected var radioSelectedDisabledIconTexture:Texture;\n\t\tprotected var checkUpIconTexture:Texture;\n\t\tprotected var checkDownIconTexture:Texture;\n\t\tprotected var checkDisabledIconTexture:Texture;\n\t\tprotected var checkSelectedUpIconTexture:Texture;\n\t\tprotected var checkSelectedDownIconTexture:Texture;\n\t\tprotected var checkSelectedDisabledIconTexture:Texture;\n\t\tprotected var pageIndicatorNormalSkinTexture:Texture;\n\t\tprotected var pageIndicatorSelectedSkinTexture:Texture;\n\t\tprotected var itemRendererUpSkinTexture:Texture;\n\t\tprotected var itemRendererHoverSkinTexture:Texture;\n\t\tprotected var itemRendererSelectedUpSkinTexture:Texture;\n\t\tprotected var backgroundPopUpSkinTexture:Texture;\n\t\tprotected var backgroundDangerPopUpSkinTexture:Texture;\n\t\tprotected var calloutTopArrowSkinTexture:Texture;\n\t\tprotected var calloutRightArrowSkinTexture:Texture;\n\t\tprotected var calloutBottomArrowSkinTexture:Texture;\n\t\tprotected var calloutLeftArrowSkinTexture:Texture;\n\t\tprotected var dangerCalloutTopArrowSkinTexture:Texture;\n\t\tprotected var dangerCalloutRightArrowSkinTexture:Texture;\n\t\tprotected var dangerCalloutBottomArrowSkinTexture:Texture;\n\t\tprotected var dangerCalloutLeftArrowSkinTexture:Texture;\n\t\tprotected var horizontalSimpleScrollBarThumbSkinTexture:Texture;\n\t\tprotected var horizontalScrollBarDecrementButtonIconTexture:Texture;\n\t\tprotected var horizontalScrollBarDecrementButtonDisabledIconTexture:Texture;\n\t\tprotected var horizontalScrollBarDecrementButtonUpSkinTexture:Texture;\n\t\tprotected var horizontalScrollBarDecrementButtonDownSkinTexture:Texture;\n\t\tprotected var horizontalScrollBarDecrementButtonDisabledSkinTexture:Texture;\n\t\tprotected var horizontalScrollBarIncrementButtonIconTexture:Texture;\n\t\tprotected var horizontalScrollBarIncrementButtonDisabledIconTexture:Texture;\n\t\tprotected var horizontalScrollBarIncrementButtonUpSkinTexture:Texture;\n\t\tprotected var horizontalScrollBarIncrementButtonDownSkinTexture:Texture;\n\t\tprotected var horizontalScrollBarIncrementButtonDisabledSkinTexture:Texture;\n\t\tprotected var verticalSimpleScrollBarThumbSkinTexture:Texture;\n\t\tprotected var verticalScrollBarDecrementButtonIconTexture:Texture;\n\t\tprotected var verticalScrollBarDecrementButtonDisabledIconTexture:Texture;\n\t\tprotected var verticalScrollBarDecrementButtonUpSkinTexture:Texture;\n\t\tprotected var verticalScrollBarDecrementButtonDownSkinTexture:Texture;\n\t\tprotected var verticalScrollBarDecrementButtonDisabledSkinTexture:Texture;\n\t\tprotected var verticalScrollBarIncrementButtonIconTexture:Texture;\n\t\tprotected var verticalScrollBarIncrementButtonDisabledIconTexture:Texture;\n\t\tprotected var verticalScrollBarIncrementButtonUpSkinTexture:Texture;\n\t\tprotected var verticalScrollBarIncrementButtonDownSkinTexture:Texture;\n\t\tprotected var verticalScrollBarIncrementButtonDisabledSkinTexture:Texture;\n\t\tprotected var searchIconTexture:Texture;\n\t\tprotected var searchIconDisabledTexture:Texture;\n\t\tprotected var listDrillDownAccessoryTexture:Texture;\n\t\tprotected var listDrillDownAccessorySelectedTexture:Texture;\n\t\tprotected var treeDisclosureOpenIconTexture:Texture;\n\t\tprotected var treeDisclosureOpenSelectedIconTexture:Texture;\n\t\tprotected var treeDisclosureClosedIconTexture:Texture;\n\t\tprotected var treeDisclosureClosedSelectedIconTexture:Texture;\n\t\tprotected var dataGridHeaderSortAscendingIconTexture:Texture;\n\t\tprotected var dataGridHeaderSortDescendingIconTexture:Texture;\n\t\tprotected var dataGridHeaderDividerSkinTexture:Texture;\n\t\tprotected var dataGridVerticalDividerSkinTexture:Texture;\n\t\tprotected var dataGridColumnResizeSkinTexture:Texture;\n\t\tprotected var dataGridColumnDropIndicatorSkinTexture:Texture;\n\n\t\t//media textures\n\t\tprotected var playPauseButtonPlayUpIconTexture:Texture;\n\t\tprotected var playPauseButtonPlayDownIconTexture:Texture;\n\t\tprotected var playPauseButtonPauseUpIconTexture:Texture;\n\t\tprotected var playPauseButtonPauseDownIconTexture:Texture;\n\t\tprotected var overlayPlayPauseButtonPlayUpIconTexture:Texture;\n\t\tprotected var overlayPlayPauseButtonPlayDownIconTexture:Texture;\n\t\tprotected var fullScreenToggleButtonEnterUpIconTexture:Texture;\n\t\tprotected var fullScreenToggleButtonEnterDownIconTexture:Texture;\n\t\tprotected var fullScreenToggleButtonExitUpIconTexture:Texture;\n\t\tprotected var fullScreenToggleButtonExitDownIconTexture:Texture;\n\t\tprotected var muteToggleButtonLoudUpIconTexture:Texture;\n\t\tprotected var muteToggleButtonLoudDownIconTexture:Texture;\n\t\tprotected var muteToggleButtonMutedUpIconTexture:Texture;\n\t\tprotected var muteToggleButtonMutedDownIconTexture:Texture;\n\t\tprotected var volumeSliderMinimumTrackSkinTexture:Texture;\n\t\tprotected var volumeSliderMaximumTrackSkinTexture:Texture;\n\t\tprotected var popUpVolumeSliderTrackSkinTexture:Texture;\n\t\tprotected var seekSliderProgressSkinTexture:Texture;\n\n\t\t/**\n\t\t * Disposes the texture atlas before calling super.dispose()\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this.atlas)\n\t\t\t{\n\t\t\t\t//if anything is keeping a reference to the texture, we don't\n\t\t\t\t//want it to keep a reference to the theme too.\n\t\t\t\tthis.atlas.texture.root.onRestore = null;\n\t\t\t\t\n\t\t\t\tthis.atlas.dispose();\n\t\t\t\tthis.atlas = null;\n\t\t\t}\n\n\t\t\tvar stage:Stage = this.starling.stage;\n\t\t\tFocusManager.setEnabledForStage(stage, false);\n\t\t\tToolTipManager.setEnabledForStage(stage, false);\n\n\t\t\t//don't forget to call super.dispose()!\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * Initializes the theme. Expected to be called by subclasses after the\n\t\t * assets have been loaded and the skin texture atlas has been created.\n\t\t */\n\t\tprotected function initialize():void\n\t\t{\n\t\t\tthis.initializeFonts();\n\t\t\tthis.initializeTextures();\n\t\t\tthis.initializeGlobals();\n\t\t\tthis.initializeStage();\n\t\t\tthis.initializeStyleProviders();\n\t\t}\n\n\t\t/**\n\t\t * Sets the stage background color.\n\t\t */\n\t\tprotected function initializeStage():void\n\t\t{\n\t\t\tthis.starling.stage.color = PRIMARY_BACKGROUND_COLOR;\n\t\t\tthis.starling.nativeStage.color = PRIMARY_BACKGROUND_COLOR;\n\t\t}\n\n\t\t/**\n\t\t * Initializes global variables (not including global style providers).\n\t\t */\n\t\tprotected function initializeGlobals():void\n\t\t{\n\t\t\tFeathersControl.defaultTextRendererFactory = textRendererFactory;\n\t\t\tFeathersControl.defaultTextEditorFactory = textEditorFactory;\n\n\t\t\tPopUpManager.overlayFactory = popUpOverlayFactory;\n\t\t\tCallout.stagePadding = this.smallGutterSize;\n\t\t\tToast.containerFactory = toastContainerFactory;\n\n\t\t\tvar stage:Stage = this.starling.stage;\n\t\t\tFocusManager.setEnabledForStage(stage, true);\n\t\t\tToolTipManager.setEnabledForStage(stage, true);\n\t\t}\n\n\t\t/**\n\t\t * Initializes font sizes and formats.\n\t\t */\n\t\tprotected function initializeFonts():void\n\t\t{\n\t\t\tthis.lightFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, LIGHT_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.darkFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, DARK_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.selectedFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, SELECTED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.lightDisabledFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, LIGHT_DISABLED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\n\t\t\tthis.smallLightFontStyles = new TextFormat(FONT_NAME, this.smallFontSize, LIGHT_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.smallLightDisabledFontStyles = new TextFormat(FONT_NAME, this.smallFontSize, LIGHT_DISABLED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\n\t\t\tthis.largeLightFontStyles = new TextFormat(FONT_NAME, this.largeFontSize, LIGHT_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.largeDarkFontStyles = new TextFormat(FONT_NAME, this.largeFontSize, DARK_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.largeLightDisabledFontStyles = new TextFormat(FONT_NAME, this.largeFontSize, LIGHT_DISABLED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\n\t\t\tthis.lightUIFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, LIGHT_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.lightUIFontStyles.bold = true;\n\t\t\tthis.darkUIFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, DARK_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.darkUIFontStyles.bold = true;\n\t\t\tthis.selectedUIFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, SELECTED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.selectedUIFontStyles.bold = true;\n\t\t\tthis.lightDisabledUIFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, LIGHT_DISABLED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.lightDisabledUIFontStyles.bold = true;\n\t\t\tthis.darkDisabledUIFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, DARK_DISABLED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.darkDisabledUIFontStyles.bold = true;\n\t\t\tthis.lightCenteredUIFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, LIGHT_TEXT_COLOR, HorizontalAlign.CENTER, VerticalAlign.TOP);\n\t\t\tthis.lightCenteredUIFontStyles.bold = true;\n\t\t\tthis.lightCenteredDisabledUIFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, LIGHT_DISABLED_TEXT_COLOR, HorizontalAlign.CENTER, VerticalAlign.TOP);\n\t\t\tthis.lightCenteredDisabledUIFontStyles.bold = true;\n\n\t\t\tthis.lightScrollTextFontStyles = new TextFormat(FONT_NAME_STACK, this.regularFontSize, LIGHT_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.lightDisabledScrollTextFontStyles = new TextFormat(FONT_NAME_STACK, this.regularFontSize, LIGHT_DISABLED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t}\n\n\t\t/**\n\t\t * Initializes the textures by extracting them from the atlas and\n\t\t * setting up any scaling grids that are needed.\n\t\t */\n\t\tprotected function initializeTextures():void\n\t\t{\n\t\t\tvar checkUpIconTexture:Texture = this.atlas.getTexture(\"check-up-icon0000\");\n\t\t\tvar checkDownIconTexture:Texture = this.atlas.getTexture(\"check-down-icon0000\");\n\t\t\tvar checkDisabledIconTexture:Texture = this.atlas.getTexture(\"check-disabled-icon0000\");\n\n\t\t\tthis.focusIndicatorSkinTexture = this.atlas.getTexture(\"focus-indicator-skin0000\");\n\n\t\t\tthis.backgroundSkinTexture = this.atlas.getTexture(\"background-skin0000\");\n\t\t\tthis.backgroundDisabledSkinTexture = this.atlas.getTexture(\"background-disabled-skin0000\");\n\t\t\tthis.backgroundFocusedSkinTexture = this.atlas.getTexture(\"background-focused-skin0000\");\n\t\t\tthis.backgroundDangerSkinTexture = this.atlas.getTexture(\"background-danger-skin0000\");\n\t\t\tthis.backgroundPopUpSkinTexture = this.atlas.getTexture(\"background-popup-skin0000\");\n\t\t\tthis.backgroundDangerPopUpSkinTexture = this.atlas.getTexture(\"background-danger-popup-skin0000\");\n\t\t\tthis.listBackgroundSkinTexture = this.atlas.getTexture(\"list-background-skin0000\");\n\n\t\t\tthis.buttonUpSkinTexture = this.atlas.getTexture(\"button-up-skin0000\");\n\t\t\tthis.buttonDownSkinTexture = this.atlas.getTexture(\"button-down-skin0000\");\n\t\t\tthis.buttonDisabledSkinTexture = this.atlas.getTexture(\"button-disabled-skin0000\");\n\t\t\tthis.toggleButtonSelectedUpSkinTexture = this.atlas.getTexture(\"toggle-button-selected-up-skin0000\");\n\t\t\tthis.toggleButtonSelectedDisabledSkinTexture = this.atlas.getTexture(\"toggle-button-selected-disabled-skin0000\");\n\t\t\tthis.buttonQuietHoverSkinTexture = this.atlas.getTexture(\"quiet-button-hover-skin0000\");\n\t\t\tthis.buttonCallToActionUpSkinTexture = this.atlas.getTexture(\"call-to-action-button-up-skin0000\");\n\t\t\tthis.buttonCallToActionDownSkinTexture = this.atlas.getTexture(\"call-to-action-button-down-skin0000\");\n\t\t\tthis.buttonDangerUpSkinTexture = this.atlas.getTexture(\"danger-button-up-skin0000\");\n\t\t\tthis.buttonDangerDownSkinTexture = this.atlas.getTexture(\"danger-button-down-skin0000\");\n\t\t\tthis.buttonBackUpSkinTexture = this.atlas.getTexture(\"back-button-up-skin0000\");\n\t\t\tthis.buttonBackDownSkinTexture = this.atlas.getTexture(\"back-button-down-skin0000\");\n\t\t\tthis.buttonBackDisabledSkinTexture = this.atlas.getTexture(\"back-button-disabled-skin0000\");\n\t\t\tthis.buttonForwardUpSkinTexture = this.atlas.getTexture(\"forward-button-up-skin0000\");\n\t\t\tthis.buttonForwardDownSkinTexture = this.atlas.getTexture(\"forward-button-down-skin0000\");\n\t\t\tthis.buttonForwardDisabledSkinTexture = this.atlas.getTexture(\"forward-button-disabled-skin0000\");\n\n\t\t\tthis.tabUpSkinTexture = this.atlas.getTexture(\"tab-up-skin0000\");\n\t\t\tthis.tabDownSkinTexture = this.atlas.getTexture(\"tab-down-skin0000\");\n\t\t\tthis.tabDisabledSkinTexture = this.atlas.getTexture(\"tab-disabled-skin0000\");\n\t\t\tthis.tabSelectedSkinTexture = this.atlas.getTexture(\"tab-selected-up-skin0000\");\n\t\t\tthis.tabSelectedDisabledSkinTexture = this.atlas.getTexture(\"tab-selected-disabled-skin0000\");\n\n\t\t\tthis.pickerListButtonIconTexture = this.atlas.getTexture(\"picker-list-icon0000\");\n\t\t\tthis.pickerListButtonIconSelectedTexture = this.atlas.getTexture(\"picker-list-selected-icon0000\");\n\t\t\tthis.pickerListButtonIconDisabledTexture = this.atlas.getTexture(\"picker-list-disabled-icon0000\");\n\n\t\t\tthis.radioUpIconTexture = checkUpIconTexture;\n\t\t\tthis.radioDownIconTexture = checkDownIconTexture;\n\t\t\tthis.radioDisabledIconTexture = checkDisabledIconTexture;\n\t\t\tthis.radioSelectedUpIconTexture = this.atlas.getTexture(\"radio-selected-up-icon0000\");\n\t\t\tthis.radioSelectedDownIconTexture = this.atlas.getTexture(\"radio-selected-down-icon0000\");\n\t\t\tthis.radioSelectedDisabledIconTexture = this.atlas.getTexture(\"radio-selected-disabled-icon0000\");\n\n\t\t\tthis.checkUpIconTexture = checkUpIconTexture;\n\t\t\tthis.checkDownIconTexture = checkDownIconTexture;\n\t\t\tthis.checkDisabledIconTexture = checkDisabledIconTexture;\n\t\t\tthis.checkSelectedUpIconTexture = this.atlas.getTexture(\"check-selected-up-icon0000\");\n\t\t\tthis.checkSelectedDownIconTexture = this.atlas.getTexture(\"check-selected-down-icon0000\");\n\t\t\tthis.checkSelectedDisabledIconTexture = this.atlas.getTexture(\"check-selected-disabled-icon0000\");\n\n\t\t\tthis.pageIndicatorSelectedSkinTexture = this.atlas.getTexture(\"page-indicator-selected-symbol0000\");\n\t\t\tthis.pageIndicatorNormalSkinTexture = this.atlas.getTexture(\"page-indicator-symbol0000\");\n\n\t\t\tthis.searchIconTexture = this.atlas.getTexture(\"search-icon0000\");\n\t\t\tthis.searchIconDisabledTexture = this.atlas.getTexture(\"search-disabled-icon0000\");\n\n\t\t\tthis.itemRendererUpSkinTexture = Texture.fromTexture(this.atlas.getTexture(\"item-renderer-up-skin0000\"), ITEM_RENDERER_SKIN_TEXTURE_REGION);\n\t\t\tthis.itemRendererHoverSkinTexture = Texture.fromTexture(this.atlas.getTexture(\"item-renderer-hover-skin0000\"), ITEM_RENDERER_SKIN_TEXTURE_REGION);\n\t\t\tthis.itemRendererSelectedUpSkinTexture = Texture.fromTexture(this.atlas.getTexture(\"item-renderer-selected-up-skin0000\"), ITEM_RENDERER_SELECTED_SKIN_TEXTURE_REGION);\n\n\t\t\tthis.headerBackgroundSkinTexture = this.atlas.getTexture(\"header-background-skin0000\");\n\t\t\tthis.headerPopupBackgroundSkinTexture = this.atlas.getTexture(\"header-popup-background-skin0000\");\n\t\t\tthis.headerBackgroundSkinTexture = Texture.fromTexture(headerBackgroundSkinTexture, HEADER_SKIN_TEXTURE_REGION);\n\t\t\tthis.headerPopupBackgroundSkinTexture = Texture.fromTexture(headerPopupBackgroundSkinTexture, HEADER_SKIN_TEXTURE_REGION);\n\n\t\t\tthis.calloutTopArrowSkinTexture = this.atlas.getTexture(\"callout-arrow-top-skin0000\");\n\t\t\tthis.calloutRightArrowSkinTexture = this.atlas.getTexture(\"callout-arrow-right-skin0000\");\n\t\t\tthis.calloutBottomArrowSkinTexture = this.atlas.getTexture(\"callout-arrow-bottom-skin0000\");\n\t\t\tthis.calloutLeftArrowSkinTexture = this.atlas.getTexture(\"callout-arrow-left-skin0000\");\n\t\t\tthis.dangerCalloutTopArrowSkinTexture = this.atlas.getTexture(\"danger-callout-arrow-top-skin0000\");\n\t\t\tthis.dangerCalloutRightArrowSkinTexture = this.atlas.getTexture(\"danger-callout-arrow-right-skin0000\");\n\t\t\tthis.dangerCalloutBottomArrowSkinTexture = this.atlas.getTexture(\"danger-callout-arrow-bottom-skin0000\");\n\t\t\tthis.dangerCalloutLeftArrowSkinTexture = this.atlas.getTexture(\"danger-callout-arrow-left-skin0000\");\n\n\t\t\tthis.horizontalSimpleScrollBarThumbSkinTexture = this.atlas.getTexture(\"horizontal-simple-scroll-bar-thumb-skin0000\");\n\t\t\tthis.horizontalScrollBarDecrementButtonIconTexture = this.atlas.getTexture(\"horizontal-scroll-bar-decrement-button-icon0000\");\n\t\t\tthis.horizontalScrollBarDecrementButtonDisabledIconTexture = this.atlas.getTexture(\"horizontal-scroll-bar-decrement-button-disabled-icon0000\");\n\t\t\tthis.horizontalScrollBarDecrementButtonUpSkinTexture = this.atlas.getTexture(\"horizontal-scroll-bar-decrement-button-up-skin0000\");\n\t\t\tthis.horizontalScrollBarDecrementButtonDownSkinTexture = this.atlas.getTexture(\"horizontal-scroll-bar-decrement-button-down-skin0000\");\n\t\t\tthis.horizontalScrollBarDecrementButtonDisabledSkinTexture = this.atlas.getTexture(\"horizontal-scroll-bar-decrement-button-disabled-skin0000\");\n\t\t\tthis.horizontalScrollBarIncrementButtonIconTexture = this.atlas.getTexture(\"horizontal-scroll-bar-increment-button-icon0000\");\n\t\t\tthis.horizontalScrollBarIncrementButtonDisabledIconTexture = this.atlas.getTexture(\"horizontal-scroll-bar-increment-button-disabled-icon0000\");\n\t\t\tthis.horizontalScrollBarIncrementButtonUpSkinTexture = this.atlas.getTexture(\"horizontal-scroll-bar-increment-button-up-skin0000\");\n\t\t\tthis.horizontalScrollBarIncrementButtonDownSkinTexture = this.atlas.getTexture(\"horizontal-scroll-bar-increment-button-down-skin0000\");\n\t\t\tthis.horizontalScrollBarIncrementButtonDisabledSkinTexture = this.atlas.getTexture(\"horizontal-scroll-bar-increment-button-disabled-skin0000\");\n\n\t\t\tthis.verticalSimpleScrollBarThumbSkinTexture = this.atlas.getTexture(\"vertical-simple-scroll-bar-thumb-skin0000\");\n\t\t\tthis.verticalScrollBarDecrementButtonIconTexture = this.atlas.getTexture(\"vertical-scroll-bar-decrement-button-icon0000\");\n\t\t\tthis.verticalScrollBarDecrementButtonDisabledIconTexture = this.atlas.getTexture(\"vertical-scroll-bar-decrement-button-disabled-icon0000\");\n\t\t\tthis.verticalScrollBarDecrementButtonUpSkinTexture = this.atlas.getTexture(\"vertical-scroll-bar-decrement-button-up-skin0000\");\n\t\t\tthis.verticalScrollBarDecrementButtonDownSkinTexture = this.atlas.getTexture(\"vertical-scroll-bar-decrement-button-down-skin0000\");\n\t\t\tthis.verticalScrollBarDecrementButtonDisabledSkinTexture = this.atlas.getTexture(\"vertical-scroll-bar-decrement-button-disabled-skin0000\");\n\t\t\tthis.verticalScrollBarIncrementButtonIconTexture = this.atlas.getTexture(\"vertical-scroll-bar-increment-button-icon0000\");\n\t\t\tthis.verticalScrollBarIncrementButtonDisabledIconTexture = this.atlas.getTexture(\"vertical-scroll-bar-increment-button-disabled-icon0000\");\n\t\t\tthis.verticalScrollBarIncrementButtonUpSkinTexture = this.atlas.getTexture(\"vertical-scroll-bar-increment-button-up-skin0000\");\n\t\t\tthis.verticalScrollBarIncrementButtonDownSkinTexture = this.atlas.getTexture(\"vertical-scroll-bar-increment-button-down-skin0000\");\n\t\t\tthis.verticalScrollBarIncrementButtonDisabledSkinTexture = this.atlas.getTexture(\"vertical-scroll-bar-increment-button-disabled-skin0000\");\n\n\t\t\tthis.listDrillDownAccessoryTexture = this.atlas.getTexture(\"item-renderer-drill-down-accessory-icon0000\");\n\t\t\tthis.listDrillDownAccessorySelectedTexture = this.atlas.getTexture(\"item-renderer-drill-down-accessory-selected-icon0000\");\n\n\t\t\tthis.treeDisclosureOpenIconTexture = this.atlas.getTexture(\"tree-disclosure-open-icon0000\");\n\t\t\tthis.treeDisclosureOpenSelectedIconTexture = this.atlas.getTexture(\"tree-disclosure-open-selected-icon0000\");\n\t\t\tthis.treeDisclosureClosedIconTexture = this.atlas.getTexture(\"tree-disclosure-closed-icon0000\");\n\t\t\tthis.treeDisclosureClosedSelectedIconTexture = this.atlas.getTexture(\"tree-disclosure-closed-selected-icon0000\");\n\n\t\t\tthis.dataGridHeaderSortAscendingIconTexture = this.atlas.getTexture(\"data-grid-header-sort-ascending-icon0000\");\n\t\t\tthis.dataGridHeaderSortDescendingIconTexture = this.atlas.getTexture(\"data-grid-header-sort-descending-icon0000\");\n\t\t\tthis.dataGridHeaderDividerSkinTexture = this.atlas.getTexture(\"data-grid-header-divider-skin0000\");\n\t\t\tthis.dataGridVerticalDividerSkinTexture = this.atlas.getTexture(\"data-grid-vertical-divider-skin0000\");\n\t\t\tthis.dataGridColumnResizeSkinTexture = this.atlas.getTexture(\"data-grid-column-resize-skin0000\");\n\t\t\tthis.dataGridColumnDropIndicatorSkinTexture = this.atlas.getTexture(\"data-grid-column-drop-indicator-skin0000\");\n\n\t\t\tthis.playPauseButtonPlayUpIconTexture = this.atlas.getTexture(\"play-pause-toggle-button-play-up-icon0000\");\n\t\t\tthis.playPauseButtonPlayDownIconTexture = this.atlas.getTexture(\"play-pause-toggle-button-play-down-icon0000\");\n\t\t\tthis.playPauseButtonPauseUpIconTexture = this.atlas.getTexture(\"play-pause-toggle-button-pause-up-icon0000\");\n\t\t\tthis.playPauseButtonPauseDownIconTexture = this.atlas.getTexture(\"play-pause-toggle-button-pause-down-icon0000\");\n\t\t\tthis.overlayPlayPauseButtonPlayUpIconTexture = this.atlas.getTexture(\"overlay-play-pause-toggle-button-play-up-icon0000\");\n\t\t\tthis.overlayPlayPauseButtonPlayDownIconTexture = this.atlas.getTexture(\"overlay-play-pause-toggle-button-play-down-icon0000\");\n\t\t\tthis.fullScreenToggleButtonEnterUpIconTexture = this.atlas.getTexture(\"full-screen-toggle-button-enter-up-icon0000\");\n\t\t\tthis.fullScreenToggleButtonEnterDownIconTexture = this.atlas.getTexture(\"full-screen-toggle-button-enter-down-icon0000\");\n\t\t\tthis.fullScreenToggleButtonExitUpIconTexture = this.atlas.getTexture(\"full-screen-toggle-button-exit-up-icon0000\");\n\t\t\tthis.fullScreenToggleButtonExitDownIconTexture = this.atlas.getTexture(\"full-screen-toggle-button-exit-down-icon0000\");\n\t\t\tthis.muteToggleButtonMutedUpIconTexture = this.atlas.getTexture(\"mute-toggle-button-muted-up-icon0000\");\n\t\t\tthis.muteToggleButtonMutedDownIconTexture = this.atlas.getTexture(\"mute-toggle-button-muted-down-icon0000\");\n\t\t\tthis.muteToggleButtonLoudUpIconTexture = this.atlas.getTexture(\"mute-toggle-button-loud-up-icon0000\");\n\t\t\tthis.muteToggleButtonLoudDownIconTexture = this.atlas.getTexture(\"mute-toggle-button-loud-down-icon0000\");\n\t\t\tthis.popUpVolumeSliderTrackSkinTexture = this.atlas.getTexture(\"pop-up-volume-slider-track-skin0000\");\n\t\t\tthis.volumeSliderMinimumTrackSkinTexture = this.atlas.getTexture(\"volume-slider-minimum-track-skin0000\");\n\t\t\tthis.volumeSliderMaximumTrackSkinTexture = this.atlas.getTexture(\"volume-slider-maximum-track-skin0000\");\n\t\t\tthis.seekSliderProgressSkinTexture = this.atlas.getTexture(\"seek-slider-progress-skin0000\");\n\t\t}\n\n\t\t/**\n\t\t * Sets global style providers for all components.\n\t\t */\n\t\tprotected function initializeStyleProviders():void\n\t\t{\n\t\t\t//alert\n\t\t\tthis.getStyleProviderForClass(Alert).defaultStyleFunction = this.setAlertStyles;\n\t\t\tthis.getStyleProviderForClass(Header).setFunctionForStyleName(Alert.DEFAULT_CHILD_STYLE_NAME_HEADER, this.setPopupHeaderStyles);\n\t\t\tthis.getStyleProviderForClass(ButtonGroup).setFunctionForStyleName(Alert.DEFAULT_CHILD_STYLE_NAME_BUTTON_GROUP, this.setAlertButtonGroupStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_ALERT_BUTTON_GROUP_BUTTON, this.setAlertButtonGroupButtonStyles);\n\n\t\t\t//autocomplete\n\t\t\tthis.getStyleProviderForClass(AutoComplete).defaultStyleFunction = this.setTextInputStyles;\n\t\t\tthis.getStyleProviderForClass(List).setFunctionForStyleName(AutoComplete.DEFAULT_CHILD_STYLE_NAME_LIST, this.setDropDownListStyles);\n\n\t\t\t//button\n\t\t\tthis.getStyleProviderForClass(Button).defaultStyleFunction = this.setButtonStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_CALL_TO_ACTION_BUTTON, this.setCallToActionButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_QUIET_BUTTON, this.setQuietButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_DANGER_BUTTON, this.setDangerButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON, this.setBackButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_FORWARD_BUTTON, this.setForwardButtonStyles);\n\n\t\t\t//button group\n\t\t\tthis.getStyleProviderForClass(ButtonGroup).defaultStyleFunction = this.setButtonGroupStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(ButtonGroup.DEFAULT_CHILD_STYLE_NAME_BUTTON, this.setButtonGroupButtonStyles);\n\n\t\t\t//callout\n\t\t\tthis.getStyleProviderForClass(Callout).defaultStyleFunction = this.setCalloutStyles;\n\n\t\t\t//check\n\t\t\tthis.getStyleProviderForClass(Check).defaultStyleFunction = this.setCheckStyles;\n\n\t\t\t//data grid (see also: item renderers)\n\t\t\tthis.getStyleProviderForClass(DataGrid).defaultStyleFunction = this.setDataGridStyles;\n\n\t\t\t//date time spinner\n\t\t\tthis.getStyleProviderForClass(DateTimeSpinner).defaultStyleFunction = this.setDateTimeSpinnerStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).setFunctionForStyleName(THEME_STYLE_NAME_DATE_TIME_SPINNER_LIST_ITEM_RENDERER, this.setDateTimeSpinnerListItemRendererStyles);\n\n\t\t\t//drawers\n\t\t\tthis.getStyleProviderForClass(Drawers).defaultStyleFunction = this.setDrawersStyles;\n\n\t\t\t//grouped list (see also: item renderers)\n\t\t\tthis.getStyleProviderForClass(GroupedList).defaultStyleFunction = this.setGroupedListStyles;\n\n\t\t\t//header\n\t\t\tthis.getStyleProviderForClass(Header).defaultStyleFunction = this.setHeaderStyles;\n\n\t\t\t//header and footer renderers for grouped list\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListHeaderOrFooterRenderer).defaultStyleFunction = this.setGroupedListHeaderRendererStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListHeaderOrFooterRenderer).setFunctionForStyleName(GroupedList.DEFAULT_CHILD_STYLE_NAME_FOOTER_RENDERER, this.setGroupedListFooterRendererStyles);\n\n\t\t\t//header renderers for data grid\n\t\t\tthis.getStyleProviderForClass(DefaultDataGridHeaderRenderer).defaultStyleFunction = this.setDataGridHeaderRendererStyles;\n\n\t\t\t//item renderers for lists\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListItemRenderer).defaultStyleFunction = this.setItemRendererStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListItemRenderer).setFunctionForStyleName(DefaultGroupedListItemRenderer.ALTERNATE_STYLE_NAME_DRILL_DOWN, this.setDrillDownItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListItemRenderer).setFunctionForStyleName(DefaultGroupedListItemRenderer.ALTERNATE_STYLE_NAME_CHECK, this.setCheckItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).defaultStyleFunction = this.setItemRendererStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).setFunctionForStyleName(DefaultListItemRenderer.ALTERNATE_STYLE_NAME_DRILL_DOWN, this.setDrillDownItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).setFunctionForStyleName(DefaultListItemRenderer.ALTERNATE_STYLE_NAME_CHECK, this.setCheckItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultDataGridCellRenderer).defaultStyleFunction = this.setDataGridCellRendererStyles;\n\n\t\t\t//labels\n\t\t\tthis.getStyleProviderForClass(Label).defaultStyleFunction = this.setLabelStyles;\n\t\t\tthis.getStyleProviderForClass(Label).setFunctionForStyleName(Label.ALTERNATE_STYLE_NAME_HEADING, this.setHeadingLabelStyles);\n\t\t\tthis.getStyleProviderForClass(Label).setFunctionForStyleName(Label.ALTERNATE_STYLE_NAME_DETAIL, this.setDetailLabelStyles);\n\t\t\tthis.getStyleProviderForClass(Label).setFunctionForStyleName(Label.ALTERNATE_STYLE_NAME_TOOL_TIP, this.setToolTipLabelStyles);\n\n\t\t\t//layout group\n\t\t\tthis.getStyleProviderForClass(LayoutGroup).setFunctionForStyleName(LayoutGroup.ALTERNATE_STYLE_NAME_TOOLBAR, this.setToolbarLayoutGroupStyles);\n\n\t\t\t//list (see also: item renderers)\n\t\t\tthis.getStyleProviderForClass(List).defaultStyleFunction = this.setListStyles;\n\n\t\t\t//numeric stepper\n\t\t\tthis.getStyleProviderForClass(NumericStepper).defaultStyleFunction = this.setNumericStepperStyles;\n\t\t\tthis.getStyleProviderForClass(TextInput).setFunctionForStyleName(NumericStepper.DEFAULT_CHILD_STYLE_NAME_TEXT_INPUT, this.setNumericStepperTextInputStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(NumericStepper.DEFAULT_CHILD_STYLE_NAME_DECREMENT_BUTTON, this.setNumericStepperDecrementButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(NumericStepper.DEFAULT_CHILD_STYLE_NAME_INCREMENT_BUTTON, this.setNumericStepperIncrementButtonStyles);\n\n\t\t\t//page indicator\n\t\t\tthis.getStyleProviderForClass(PageIndicator).defaultStyleFunction = this.setPageIndicatorStyles;\n\n\t\t\t//panel\n\t\t\tthis.getStyleProviderForClass(Panel).defaultStyleFunction = this.setPanelStyles;\n\t\t\tthis.getStyleProviderForClass(Header).setFunctionForStyleName(Panel.DEFAULT_CHILD_STYLE_NAME_HEADER, this.setPopupHeaderStyles);\n\n\t\t\t//panel screen\n\t\t\tthis.getStyleProviderForClass(PanelScreen).defaultStyleFunction = this.setPanelScreenStyles;\n\t\t\tthis.getStyleProviderForClass(Header).setFunctionForStyleName(PanelScreen.DEFAULT_CHILD_STYLE_NAME_HEADER, this.setPanelScreenHeaderStyles);\n\n\t\t\t//picker list (see also: list and item renderers)\n\t\t\tthis.getStyleProviderForClass(PickerList).defaultStyleFunction = this.setPickerListStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(PickerList.DEFAULT_CHILD_STYLE_NAME_BUTTON, this.setPickerListButtonStyles);\n\t\t\tthis.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(PickerList.DEFAULT_CHILD_STYLE_NAME_BUTTON, this.setPickerListButtonStyles);\n\t\t\tthis.getStyleProviderForClass(List).setFunctionForStyleName(PickerList.DEFAULT_CHILD_STYLE_NAME_LIST, this.setDropDownListStyles);\n\n\t\t\t//progress bar\n\t\t\tthis.getStyleProviderForClass(ProgressBar).defaultStyleFunction = this.setProgressBarStyles;\n\n\t\t\t//radio\n\t\t\tthis.getStyleProviderForClass(Radio).defaultStyleFunction = this.setRadioStyles;\n\n\t\t\t//scroll bar\n\t\t\tthis.getStyleProviderForClass(ScrollBar).setFunctionForStyleName(Scroller.DEFAULT_CHILD_STYLE_NAME_HORIZONTAL_SCROLL_BAR, this.setHorizontalScrollBarStyles);\n\t\t\tthis.getStyleProviderForClass(ScrollBar).setFunctionForStyleName(Scroller.DEFAULT_CHILD_STYLE_NAME_VERTICAL_SCROLL_BAR, this.setVerticalScrollBarStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_INCREMENT_BUTTON, this.setHorizontalScrollBarIncrementButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_DECREMENT_BUTTON, this.setHorizontalScrollBarDecrementButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_THUMB, this.setHorizontalScrollBarThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_MINIMUM_TRACK, this.setHorizontalScrollBarMinimumTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_MAXIMUM_TRACK, this.setHorizontalScrollBarMaximumTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_INCREMENT_BUTTON, this.setVerticalScrollBarIncrementButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_DECREMENT_BUTTON, this.setVerticalScrollBarDecrementButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_THUMB, this.setVerticalScrollBarThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_MINIMUM_TRACK, this.setVerticalScrollBarMinimumTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_MAXIMUM_TRACK, this.setVerticalScrollBarMaximumTrackStyles);\n\n\t\t\t//scroll container\n\t\t\tthis.getStyleProviderForClass(ScrollContainer).defaultStyleFunction = this.setScrollContainerStyles;\n\t\t\tthis.getStyleProviderForClass(ScrollContainer).setFunctionForStyleName(ScrollContainer.ALTERNATE_STYLE_NAME_TOOLBAR, this.setToolbarScrollContainerStyles);\n\n\t\t\t//scroll screen\n\t\t\tthis.getStyleProviderForClass(ScrollScreen).defaultStyleFunction = this.setScrollScreenStyles;\n\n\t\t\t//scroll text\n\t\t\tthis.getStyleProviderForClass(ScrollText).defaultStyleFunction = this.setScrollTextStyles;\n\n\t\t\t//simple scroll bar\n\t\t\tthis.getStyleProviderForClass(SimpleScrollBar).defaultStyleFunction = this.setSimpleScrollBarStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_HORIZONTAL_SIMPLE_SCROLL_BAR_THUMB, this.setHorizontalSimpleScrollBarThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_VERTICAL_SIMPLE_SCROLL_BAR_THUMB, this.setVerticalSimpleScrollBarThumbStyles);\n\n\t\t\t//slider\n\t\t\tthis.getStyleProviderForClass(Slider).defaultStyleFunction = this.setSliderStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Slider.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setSliderThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_HORIZONTAL_SLIDER_MINIMUM_TRACK, this.setHorizontalSliderMinimumTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_HORIZONTAL_SLIDER_MAXIMUM_TRACK, this.setHorizontalSliderMaximumTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_VERTICAL_SLIDER_MINIMUM_TRACK, this.setVerticalSliderMinimumTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_VERTICAL_SLIDER_MAXIMUM_TRACK, this.setVerticalSliderMaximumTrackStyles);\n\t\t\t\n\t\t\t//spinner list\n\t\t\tthis.getStyleProviderForClass(SpinnerList).defaultStyleFunction = this.setSpinnerListStyles;\n\n\t\t\t//tab bar\n\t\t\tthis.getStyleProviderForClass(TabBar).defaultStyleFunction = this.setTabBarStyles;\n\t\t\tthis.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(TabBar.DEFAULT_CHILD_STYLE_NAME_TAB, this.setTabStyles);\n\n\t\t\t//text input\n\t\t\tthis.getStyleProviderForClass(TextInput).defaultStyleFunction = this.setTextInputStyles;\n\t\t\tthis.getStyleProviderForClass(TextInput).setFunctionForStyleName(TextInput.ALTERNATE_STYLE_NAME_SEARCH_TEXT_INPUT, this.setSearchTextInputStyles);\n\t\t\tthis.getStyleProviderForClass(TextBlockTextEditor).setFunctionForStyleName(TextInput.DEFAULT_CHILD_STYLE_NAME_TEXT_EDITOR, this.setTextInputTextEditorStyles);\n\t\t\tthis.getStyleProviderForClass(TextCallout).setFunctionForStyleName(TextInput.DEFAULT_CHILD_STYLE_NAME_ERROR_CALLOUT, this.setTextInputErrorCalloutStyles);\n\n\t\t\t//text area\n\t\t\tthis.getStyleProviderForClass(TextArea).defaultStyleFunction = this.setTextAreaStyles;\n\t\t\tthis.getStyleProviderForClass(TextCallout).setFunctionForStyleName(TextArea.DEFAULT_CHILD_STYLE_NAME_ERROR_CALLOUT, this.setTextAreaErrorCalloutStyles);\n\n\t\t\t//text callout\n\t\t\tthis.getStyleProviderForClass(TextCallout).defaultStyleFunction = this.setTextCalloutStyles;\n\n\t\t\t//toast\n\t\t\tthis.getStyleProviderForClass(Toast).defaultStyleFunction = this.setToastStyles;\n\t\t\tthis.getStyleProviderForClass(ButtonGroup).setFunctionForStyleName(Toast.DEFAULT_CHILD_STYLE_NAME_ACTIONS, this.setToastActionsStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_TOAST_ACTIONS_BUTTON, this.setToastActionsButtonStyles);\n\n\t\t\t//toggle button\n\t\t\tthis.getStyleProviderForClass(ToggleButton).defaultStyleFunction = this.setButtonStyles;\n\t\t\tthis.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_QUIET_BUTTON, this.setQuietButtonStyles);\n\n\t\t\t//toggle switch\n\t\t\tthis.getStyleProviderForClass(ToggleSwitch).defaultStyleFunction = this.setToggleSwitchStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setToggleSwitchThumbStyles);\n\t\t\tthis.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setToggleSwitchThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_ON_TRACK, this.setToggleSwitchTrackStyles);\n\t\t\t//we don't need a style function for the off track in this theme\n\t\t\t//the toggle switch layout uses a single track\n\n\t\t\t//tree\n\t\t\tthis.getStyleProviderForClass(Tree).defaultStyleFunction = this.setTreeStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultTreeItemRenderer).defaultStyleFunction = this.setTreeItemRendererStyles;\n\n\t\t\t//media controls\n\t\t\tthis.getStyleProviderForClass(VideoPlayer).defaultStyleFunction = this.setVideoPlayerStyles;\n\n\t\t\t//play/pause toggle button\n\t\t\tthis.getStyleProviderForClass(PlayPauseToggleButton).defaultStyleFunction = this.setPlayPauseToggleButtonStyles;\n\t\t\tthis.getStyleProviderForClass(PlayPauseToggleButton).setFunctionForStyleName(PlayPauseToggleButton.ALTERNATE_STYLE_NAME_OVERLAY_PLAY_PAUSE_TOGGLE_BUTTON, this.setOverlayPlayPauseToggleButtonStyles);\n\n\t\t\t//full screen toggle button\n\t\t\tthis.getStyleProviderForClass(FullScreenToggleButton).defaultStyleFunction = this.setFullScreenToggleButtonStyles;\n\n\t\t\t//mute toggle button\n\t\t\tthis.getStyleProviderForClass(MuteToggleButton).defaultStyleFunction = this.setMuteToggleButtonStyles;\n\t\t\tthis.getStyleProviderForClass(VolumeSlider).setFunctionForStyleName(MuteToggleButton.DEFAULT_CHILD_STYLE_NAME_VOLUME_SLIDER, this.setPopUpVolumeSliderStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_POP_UP_VOLUME_SLIDER_THUMB, this.setSliderThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_POP_UP_VOLUME_SLIDER_MINIMUM_TRACK, this.setPopUpVolumeSliderTrackStyles);\n\n\t\t\t//seek slider\n\t\t\tthis.getStyleProviderForClass(SeekSlider).defaultStyleFunction = this.setSeekSliderStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(SeekSlider.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setSeekSliderThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(SeekSlider.DEFAULT_CHILD_STYLE_NAME_MINIMUM_TRACK, this.setSeekSliderMinimumTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(SeekSlider.DEFAULT_CHILD_STYLE_NAME_MAXIMUM_TRACK, this.setSeekSliderMaximumTrackStyles);\n\n\t\t\t//volume slider\n\t\t\tthis.getStyleProviderForClass(VolumeSlider).defaultStyleFunction = this.setVolumeSliderStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(VolumeSlider.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setVolumeSliderThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(VolumeSlider.DEFAULT_CHILD_STYLE_NAME_MINIMUM_TRACK, this.setVolumeSliderMinimumTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(VolumeSlider.DEFAULT_CHILD_STYLE_NAME_MAXIMUM_TRACK, this.setVolumeSliderMaximumTrackStyles);\n\t\t}\n\n\t\tprotected function pageIndicatorNormalSymbolFactory():DisplayObject\n\t\t{\n\t\t\tvar symbol:ImageLoader = new ImageLoader();\n\t\t\tsymbol.source = this.pageIndicatorNormalSkinTexture;\n\t\t\treturn symbol;\n\t\t}\n\n\t\tprotected function pageIndicatorSelectedSymbolFactory():DisplayObject\n\t\t{\n\t\t\tvar symbol:ImageLoader = new ImageLoader();\n\t\t\tsymbol.source = this.pageIndicatorSelectedSkinTexture;\n\t\t\treturn symbol;\n\t\t}\n\n\t\tprotected function dataGridHeaderDividerFactory():DisplayObject\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.dataGridHeaderDividerSkinTexture);\n\t\t\tskin.scale9Grid = DATA_GRID_HEADER_DIVIDER_SCALE_9_GRID;\n\t\t\treturn skin;\n\t\t}\n\n\t\tprotected function dataGridVerticalDividerFactory():DisplayObject\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.dataGridVerticalDividerSkinTexture);\n\t\t\tskin.scale9Grid = DATA_GRID_VERTICAL_DIVIDER_SCALE_9_GRID;\n\t\t\treturn skin;\n\t\t}\n\n\t\tprotected function toastContainerFactory():DisplayObjectContainer\n\t\t{\n\t\t\tvar container:LayoutGroup = new LayoutGroup();\n\t\t\tcontainer.autoSizeMode = AutoSizeMode.STAGE;\n\n\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\tlayout.verticalAlign = VerticalAlign.BOTTOM;\n\t\t\tlayout.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tlayout.padding = this.gutterSize;\n\t\t\tlayout.gap = this.gutterSize;\n\t\t\tcontainer.layout = layout;\n\n\t\t\treturn container;\n\t\t}\n\n\t//-------------------------\n\t// Shared\n\t//-------------------------\n\n\t\tprotected function setScrollerStyles(scroller:Scroller):void\n\t\t{\n\t\t\tscroller.horizontalScrollBarFactory = scrollBarFactory;\n\t\t\tscroller.verticalScrollBarFactory = scrollBarFactory;\n\t\t\tscroller.scrollBarDisplayMode = ScrollBarDisplayMode.FIXED;\n\t\t\tscroller.interactionMode = ScrollInteractionMode.MOUSE;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tscroller.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tscroller.focusPadding = 0;\n\t\t}\n\n\t\tprotected function setDropDownListStyles(list:List):void\n\t\t{\n\t\t\tthis.setListStyles(list);\n\n\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\tlayout.useVirtualLayout = true;\n\t\t\tlayout.padding = 0;\n\t\t\tlayout.gap = 0;\n\t\t\tlayout.horizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\tlayout.verticalAlign = VerticalAlign.TOP;\n\t\t\tlayout.resetTypicalItemDimensionsOnMeasure = true;\n\t\t\tlayout.maxRowCount = 5;\n\t\t\tlist.layout = layout;\n\t\t}\n\n\t//-------------------------\n\t// Alert\n\t//-------------------------\n\n\t\tprotected function setAlertStyles(alert:Alert):void\n\t\t{\n\t\t\tthis.setScrollerStyles(alert);\n\n\t\t\tvar backgroundSkin:Image = new Image(this.backgroundPopUpSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = SIMPLE_SCALE9_GRID;\n\t\t\talert.backgroundSkin = backgroundSkin;\n\n\t\t\talert.fontStyles = this.lightFontStyles.clone();\n\t\t\talert.disabledFontStyles = this.lightDisabledFontStyles.clone();\n\n\t\t\talert.paddingTop = this.gutterSize;\n\t\t\talert.paddingRight = this.gutterSize;\n\t\t\talert.paddingBottom = this.smallGutterSize;\n\t\t\talert.paddingLeft = this.gutterSize;\n\t\t\talert.outerPadding = this.borderSize;\n\t\t\talert.gap = this.smallGutterSize;\n\t\t\talert.maxWidth = this.popUpSize;\n\t\t\talert.maxHeight = this.popUpSize;\n\t\t}\n\n\t\t//see Panel section for Header styles\n\n\t\tprotected function setAlertButtonGroupStyles(group:ButtonGroup):void\n\t\t{\n\t\t\tgroup.customButtonStyleName = THEME_STYLE_NAME_ALERT_BUTTON_GROUP_BUTTON;\n\t\t\tgroup.direction = Direction.HORIZONTAL;\n\t\t\tgroup.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tgroup.verticalAlign = VerticalAlign.JUSTIFY;\n\t\t\tgroup.distributeButtonSizes = false;\n\t\t\tgroup.gap = this.smallGutterSize;\n\t\t\tgroup.padding = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setAlertButtonGroupButtonStyles(button:Button):void\n\t\t{\n\t\t\tthis.setButtonStyles(button);\n\t\t}\n\n\t//-------------------------\n\t// Button\n\t//-------------------------\n\n\t\tprotected function setBaseButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tbutton.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tbutton.focusPadding = this.focusPaddingSize;\n\n\t\t\tbutton.paddingTop = this.smallGutterSize;\n\t\t\tbutton.paddingBottom = this.smallGutterSize;\n\t\t\tbutton.paddingLeft = this.gutterSize;\n\t\t\tbutton.paddingRight = this.gutterSize;\n\t\t\tbutton.gap = this.smallGutterSize;\n\t\t\tbutton.minGap = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.buttonMinWidth;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\t\t\tif(button is ToggleButton)\n\t\t\t{\n\t\t\t\t//for convenience, this function can style both a regular button\n\t\t\t\t//and a toggle button\n\t\t\t\tvar selectedSkin:ImageSkin = new ImageSkin(this.toggleButtonSelectedUpSkinTexture);\n\t\t\t\tskin.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.toggleButtonSelectedDisabledSkinTexture);\n\t\t\t\tselectedSkin.scale9Grid = TOGGLE_BUTTON_SCALE9_GRID;\n\t\t\t\tselectedSkin.width = this.controlSize;\n\t\t\t\tselectedSkin.height = this.controlSize;\n\t\t\t\tToggleButton(button).defaultSelectedSkin = selectedSkin;\n\t\t\t}\n\n\t\t\tbutton.fontStyles = this.darkUIFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.darkDisabledUIFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\t\t}\n\n\t\tprotected function setCallToActionButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonCallToActionUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonCallToActionDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.buttonMinWidth;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.fontStyles = this.darkUIFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.darkDisabledUIFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\t\t}\n\n\t\tprotected function setQuietButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar defaultSkin:Quad = new Quad(this.controlSize, this.controlSize, 0xff00ff);\n\t\t\tdefaultSkin.alpha = 0;\n\t\t\tbutton.defaultSkin = defaultSkin;\n\n\t\t\tvar otherSkin:ImageSkin = new ImageSkin(null);\n\t\t\totherSkin.setTextureForState(ButtonState.HOVER, this.buttonQuietHoverSkinTexture);\n\t\t\totherSkin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\tbutton.hoverSkin = otherSkin;\n\t\t\tbutton.downSkin = otherSkin;\n\t\t\tif(button is ToggleButton)\n\t\t\t{\n\t\t\t\t//for convenience, this function can style both a regular button\n\t\t\t\t//and a toggle button\n\t\t\t\tvar toggleButton:ToggleButton = ToggleButton(button);\n\t\t\t\totherSkin.selectedTexture = this.toggleButtonSelectedUpSkinTexture;\n\t\t\t\totherSkin.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.toggleButtonSelectedDisabledSkinTexture);\n\t\t\t\ttoggleButton.defaultSelectedSkin = otherSkin;\n\t\t\t\ttoggleButton.setSkinForState(ButtonState.DISABLED_AND_SELECTED, otherSkin);\n\t\t\t}\n\t\t\totherSkin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\totherSkin.width = this.controlSize;\n\t\t\totherSkin.height = this.controlSize;\n\t\t\totherSkin.minWidth = this.controlSize;\n\t\t\totherSkin.minHeight = this.controlSize;\n\n\t\t\tbutton.fontStyles = this.lightUIFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.lightDisabledUIFontStyles.clone();\n\t\t\tbutton.setFontStylesForState(ButtonState.DOWN, this.darkUIFontStyles.clone());\n\t\t\tbutton.setFontStylesForState(ButtonState.DISABLED, this.lightDisabledUIFontStyles.clone());\n\t\t\tif(button is ToggleButton)\n\t\t\t{\n\t\t\t\ttoggleButton.selectedFontStyles = this.darkUIFontStyles.clone();\n\t\t\t\ttoggleButton.setFontStylesForState(ButtonState.DISABLED_AND_SELECTED, this.darkDisabledUIFontStyles.clone());\n\t\t\t}\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tbutton.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tbutton.focusPadding = this.focusPaddingSize;\n\n\t\t\tbutton.paddingTop = this.smallGutterSize;\n\t\t\tbutton.paddingBottom = this.smallGutterSize;\n\t\t\tbutton.paddingLeft = this.gutterSize;\n\t\t\tbutton.paddingRight = this.gutterSize;\n\t\t\tbutton.gap = this.smallGutterSize;\n\t\t\tbutton.minGap = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setDangerButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonDangerUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDangerDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.buttonMinWidth;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.buttonMinWidth;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.fontStyles = this.darkUIFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.darkDisabledUIFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\t\t}\n\n\t\tprotected function setBackButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonBackUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonBackDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonBackDisabledSkinTexture);\n\t\t\tskin.scale9Grid = BACK_BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.fontStyles = this.darkUIFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.darkDisabledUIFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\n\t\t\tbutton.paddingLeft = 2 * this.gutterSize;\n\t\t}\n\n\t\tprotected function setForwardButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonForwardUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonForwardDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonForwardDisabledSkinTexture);\n\t\t\tskin.scale9Grid = FORWARD_BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.fontStyles = this.darkUIFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.darkDisabledUIFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\n\t\t\tbutton.paddingRight = 2 * this.gutterSize;\n\t\t}\n\n\t//-------------------------\n\t// ButtonGroup\n\t//-------------------------\n\n\t\tprotected function setButtonGroupStyles(group:ButtonGroup):void\n\t\t{\n\t\t\tgroup.gap = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setButtonGroupButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.wideControlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.wideControlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\t\t\tif(button is ToggleButton)\n\t\t\t{\n\t\t\t\t//for convenience, this function can style both a regular button\n\t\t\t\t//and a toggle button\n\t\t\t\tvar selectedSkin:ImageSkin = new ImageSkin(this.toggleButtonSelectedUpSkinTexture);\n\t\t\t\tskin.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.toggleButtonSelectedDisabledSkinTexture);\n\t\t\t\tselectedSkin.scale9Grid = TOGGLE_BUTTON_SCALE9_GRID;\n\t\t\t\tselectedSkin.width = this.controlSize;\n\t\t\t\tselectedSkin.height = this.controlSize;\n\t\t\t\tToggleButton(button).defaultSelectedSkin = selectedSkin;\n\t\t\t}\n\n\t\t\tbutton.fontStyles = this.darkUIFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.darkDisabledUIFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\t\t}\n\n\t//-------------------------\n\t// Callout\n\t//-------------------------\n\n\t\tprotected function setCalloutStyles(callout:Callout):void\n\t\t{\n\t\t\tvar backgroundSkin:Image = new Image(this.backgroundPopUpSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = SIMPLE_SCALE9_GRID;\n\t\t\tbackgroundSkin.width = this.calloutBackgroundMinSize;\n\t\t\tbackgroundSkin.height = this.calloutBackgroundMinSize;\n\t\t\tcallout.backgroundSkin = backgroundSkin;\n\n\t\t\tvar topArrowSkin:Image = new Image(this.calloutTopArrowSkinTexture);\n\t\t\tcallout.topArrowSkin = topArrowSkin;\n\t\t\tcallout.topArrowGap = this.calloutArrowOverlapGap;\n\n\t\t\tvar rightArrowSkin:Image = new Image(this.calloutRightArrowSkinTexture);\n\t\t\tcallout.rightArrowSkin = rightArrowSkin;\n\t\t\tcallout.rightArrowGap = this.calloutArrowOverlapGap;\n\n\t\t\tvar bottomArrowSkin:Image = new Image(this.calloutBottomArrowSkinTexture);\n\t\t\tcallout.bottomArrowSkin = bottomArrowSkin;\n\t\t\tcallout.bottomArrowGap = this.calloutArrowOverlapGap;\n\n\t\t\tvar leftArrowSkin:Image = new Image(this.calloutLeftArrowSkinTexture);\n\t\t\tcallout.leftArrowSkin = leftArrowSkin;\n\t\t\tcallout.leftArrowGap = this.calloutArrowOverlapGap;\n\n\t\t\tcallout.padding = this.gutterSize;\n\t\t}\n\n\t\tprotected function setDangerCalloutStyles(callout:Callout):void\n\t\t{\n\t\t\tvar backgroundSkin:Image = new Image(this.backgroundDangerPopUpSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = SIMPLE_SCALE9_GRID;\n\t\t\tbackgroundSkin.width = this.calloutBackgroundMinSize;\n\t\t\tbackgroundSkin.height = this.calloutBackgroundMinSize;\n\t\t\tcallout.backgroundSkin = backgroundSkin;\n\n\t\t\tvar topArrowSkin:Image = new Image(this.dangerCalloutTopArrowSkinTexture);\n\t\t\tcallout.topArrowSkin = topArrowSkin;\n\t\t\tcallout.topArrowGap = this.calloutArrowOverlapGap;\n\n\t\t\tvar rightArrowSkin:Image = new Image(this.dangerCalloutRightArrowSkinTexture);\n\t\t\tcallout.rightArrowSkin = rightArrowSkin;\n\t\t\tcallout.rightArrowGap = this.calloutArrowOverlapGap;\n\n\t\t\tvar bottomArrowSkin:Image = new Image(this.dangerCalloutBottomArrowSkinTexture);\n\t\t\tcallout.bottomArrowSkin = bottomArrowSkin;\n\t\t\tcallout.bottomArrowGap = this.calloutArrowOverlapGap;\n\n\t\t\tvar leftArrowSkin:Image = new Image(this.dangerCalloutLeftArrowSkinTexture);\n\t\t\tcallout.leftArrowSkin = leftArrowSkin;\n\t\t\tcallout.leftArrowGap = this.calloutArrowOverlapGap;\n\n\t\t\tcallout.padding = this.gutterSize;\n\t\t}\n\n\t//-------------------------\n\t// Check\n\t//-------------------------\n\n\t\tprotected function setCheckStyles(check:Check):void\n\t\t{\n\t\t\tvar skin:Quad = new Quad(this.controlSize, this.controlSize);\n\t\t\tskin.alpha = 0;\n\t\t\tcheck.defaultSkin = skin;\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.checkUpIconTexture);\n\t\t\ticon.selectedTexture = this.checkSelectedUpIconTexture;\n\t\t\ticon.setTextureForState(ButtonState.DOWN, this.checkDownIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DISABLED, this.checkDisabledIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.checkSelectedDownIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.checkSelectedDisabledIconTexture);\n\t\t\tcheck.defaultIcon = icon;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tcheck.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tcheck.focusPaddingLeft = this.focusPaddingSize;\n\t\t\tcheck.focusPaddingRight = this.focusPaddingSize;\n\n\t\t\tcheck.fontStyles = this.lightUIFontStyles.clone();\n\t\t\tcheck.disabledFontStyles = this.lightDisabledUIFontStyles.clone();\n\n\t\t\tcheck.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tcheck.gap = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// DataGrid\n\t//-------------------------\n\n\t\tprotected function setDataGridStyles(grid:DataGrid):void\n\t\t{\n\t\t\tthis.setScrollerStyles(grid);\n\n\t\t\tgrid.padding = this.borderSize;\n\n\t\t\tvar backgroundSkin:Image = new Image(this.listBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = DEFAULT_SCALE9_GRID;\n\t\t\tbackgroundSkin.width = this.controlSize;\n\t\t\tbackgroundSkin.height = this.controlSize;\n\t\t\tgrid.backgroundSkin = backgroundSkin;\n\n\t\t\tvar backgroundDisabledSkin:Image = new Image(this.backgroundDisabledSkinTexture);\n\t\t\tbackgroundDisabledSkin.scale9Grid = DEFAULT_SCALE9_GRID;\n\t\t\tbackgroundDisabledSkin.width = this.controlSize;\n\t\t\tbackgroundDisabledSkin.height = this.controlSize;\n\t\t\tgrid.backgroundDisabledSkin = backgroundDisabledSkin;\n\n\t\t\tgrid.headerBackgroundSkin = new Quad(this.controlSize, this.controlSize, GROUPED_LIST_HEADER_BACKGROUND_COLOR);\n\n\t\t\tvar columnResizeSkin:ImageSkin = new ImageSkin(this.dataGridColumnResizeSkinTexture);\n\t\t\tcolumnResizeSkin.scale9Grid = DATA_GRID_COLUMN_RESIZE_SCALE_9_GRID;\n\t\t\tgrid.columnResizeSkin = columnResizeSkin;\n\n\t\t\tvar columnDragOverlaySkin:Quad = new Quad(1, 1, DATA_GRID_COLUMN_OVERLAY_COLOR);\n\t\t\tcolumnDragOverlaySkin.alpha = DATA_GRID_COLUMN_OVERLAY_ALPHA;\n\t\t\tgrid.columnDragOverlaySkin = columnDragOverlaySkin;\n\n\t\t\tvar columnDropIndicatorSkin:ImageSkin = new ImageSkin(this.dataGridColumnDropIndicatorSkinTexture);\n\t\t\tcolumnDropIndicatorSkin.scale9Grid = DATA_GRID_COLUMN_DROP_INDICATOR_SCALE_9_GRID;\n\t\t\tgrid.columnDropIndicatorSkin = columnDropIndicatorSkin;\n\t\t\tgrid.extendedColumnDropIndicator = true;\n\n\t\t\tgrid.headerDividerFactory = this.dataGridHeaderDividerFactory;\n\t\t\tgrid.verticalDividerFactory = this.dataGridVerticalDividerFactory;\n\n\t\t\tgrid.verticalScrollPolicy = ScrollPolicy.AUTO;\n\t\t}\n\n\t\tprotected function setDataGridCellRendererStyles(cellRenderer:DefaultDataGridCellRenderer):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.itemRendererUpSkinTexture);\n\t\t\tskin.selectedTexture = this.itemRendererSelectedUpSkinTexture;\n\t\t\tskin.setTextureForState(ButtonState.HOVER, this.itemRendererHoverSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.itemRendererSelectedUpSkinTexture);\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tcellRenderer.defaultSkin = skin;\n\n\t\t\tcellRenderer.fontStyles = this.lightFontStyles.clone();\n\t\t\tcellRenderer.disabledFontStyles = this.lightDisabledFontStyles.clone();\n\t\t\tcellRenderer.selectedFontStyles = this.darkFontStyles.clone();\n\t\t\tcellRenderer.setFontStylesForState(ButtonState.DOWN, this.darkFontStyles.clone());\n\t\t\tcellRenderer.setFontStylesForState(ButtonState.HOVER, this.darkFontStyles.clone());\n\n\t\t\tcellRenderer.iconLabelFontStyles = this.lightFontStyles.clone();\n\t\t\tcellRenderer.iconLabelDisabledFontStyles = this.lightDisabledFontStyles.clone();\n\t\t\tcellRenderer.iconLabelSelectedFontStyles = this.darkFontStyles.clone();\n\t\t\tcellRenderer.setIconLabelFontStylesForState(ButtonState.DOWN, this.darkFontStyles.clone());\n\t\t\tcellRenderer.setIconLabelFontStylesForState(ButtonState.HOVER, this.darkFontStyles.clone());\n\n\t\t\tcellRenderer.accessoryLabelFontStyles = this.lightFontStyles.clone();\n\t\t\tcellRenderer.accessoryLabelDisabledFontStyles = this.lightDisabledFontStyles.clone();\n\t\t\tcellRenderer.accessoryLabelSelectedFontStyles = this.darkFontStyles.clone();\n\t\t\tcellRenderer.setAccessoryLabelFontStylesForState(ButtonState.DOWN, this.darkFontStyles.clone());\n\t\t\tcellRenderer.setAccessoryLabelFontStylesForState(ButtonState.HOVER, this.darkFontStyles.clone());\n\n\t\t\tcellRenderer.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tcellRenderer.paddingTop = this.smallGutterSize;\n\t\t\tcellRenderer.paddingBottom = this.smallGutterSize;\n\t\t\tcellRenderer.paddingLeft = this.gutterSize;\n\t\t\tcellRenderer.paddingRight = this.gutterSize;\n\t\t\tcellRenderer.gap = this.smallGutterSize;\n\t\t\tcellRenderer.minGap = this.smallGutterSize;\n\t\t\tcellRenderer.iconPosition = RelativePosition.LEFT;\n\t\t\tcellRenderer.accessoryGap = Number.POSITIVE_INFINITY;\n\t\t\tcellRenderer.minAccessoryGap = this.smallGutterSize;\n\t\t\tcellRenderer.accessoryPosition = RelativePosition.RIGHT;\n\n\t\t\tcellRenderer.useStateDelayTimer = false;\n\t\t}\n\n\t\tprotected function setDataGridHeaderRendererStyles(headerRenderer:DefaultDataGridHeaderRenderer):void\n\t\t{\n\t\t\theaderRenderer.backgroundSkin = new Quad(this.controlSize, this.controlSize, GROUPED_LIST_HEADER_BACKGROUND_COLOR);\n\n\t\t\theaderRenderer.sortAscendingIcon = new ImageSkin(this.dataGridHeaderSortAscendingIconTexture);\n\t\t\theaderRenderer.sortDescendingIcon = new ImageSkin(this.dataGridHeaderSortDescendingIconTexture);\n\n\t\t\theaderRenderer.fontStyles = this.lightUIFontStyles.clone();\n\t\t\theaderRenderer.disabledFontStyles = this.lightDisabledUIFontStyles.clone();\n\n\t\t\theaderRenderer.horizontalAlign = HorizontalAlign.LEFT;\n\n\t\t\theaderRenderer.paddingTop = this.smallGutterSize;\n\t\t\theaderRenderer.paddingBottom = this.smallGutterSize;\n\t\t\theaderRenderer.paddingLeft = this.gutterSize;\n\t\t\theaderRenderer.paddingRight = this.gutterSize;\n\t\t}\n\n\t//-------------------------\n\t// DateTimeSpinner\n\t//-------------------------\n\n\t\tprotected function setDateTimeSpinnerStyles(spinner:DateTimeSpinner):void\n\t\t{\n\t\t\tspinner.customItemRendererStyleName = THEME_STYLE_NAME_DATE_TIME_SPINNER_LIST_ITEM_RENDERER;\n\t\t}\n\n\t\tprotected function setDateTimeSpinnerListItemRendererStyles(itemRenderer:DefaultListItemRenderer):void\n\t\t{\n\t\t\tthis.setItemRendererStyles(itemRenderer);\n\n\t\t\titemRenderer.accessoryPosition = RelativePosition.LEFT;\n\t\t\titemRenderer.accessoryGap = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// Drawers\n\t//-------------------------\n\n\t\tprotected function setDrawersStyles(drawers:Drawers):void\n\t\t{\n\t\t\tvar overlaySkin:Quad = new Quad(1, 1, DRAWER_OVERLAY_COLOR);\n\t\t\toverlaySkin.alpha = DRAWER_OVERLAY_ALPHA;\n\t\t\tdrawers.overlaySkin = overlaySkin;\n\t\t}\n\n\t//-------------------------\n\t// GroupedList\n\t//-------------------------\n\n\t\tprotected function setGroupedListStyles(list:GroupedList):void\n\t\t{\n\t\t\tthis.setScrollerStyles(list);\n\n\t\t\tlist.padding = this.borderSize;\n\n\t\t\tvar backgroundSkin:Image = new Image(this.listBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = DEFAULT_SCALE9_GRID;\n\t\t\tlist.backgroundSkin = backgroundSkin;\n\n\t\t\tvar backgroundDisabledSkin:Image = new Image(this.backgroundDisabledSkinTexture);\n\t\t\tbackgroundDisabledSkin.scale9Grid = DEFAULT_SCALE9_GRID;\n\t\t\tlist.backgroundDisabledSkin = backgroundDisabledSkin;\n\n\t\t\tlist.verticalScrollPolicy = ScrollPolicy.AUTO;\n\t\t}\n\n\t\t//see List section for item renderer styles\n\n\t\tprotected function setGroupedListHeaderRendererStyles(headerRenderer:DefaultGroupedListHeaderOrFooterRenderer):void\n\t\t{\n\t\t\theaderRenderer.backgroundSkin = new Quad(this.controlSize, this.controlSize, GROUPED_LIST_HEADER_BACKGROUND_COLOR);\n\n\t\t\theaderRenderer.fontStyles = this.lightUIFontStyles.clone();\n\t\t\theaderRenderer.disabledFontStyles = this.lightDisabledUIFontStyles.clone();\n\n\t\t\theaderRenderer.horizontalAlign = HorizontalAlign.LEFT;\n\n\t\t\theaderRenderer.paddingTop = this.smallGutterSize;\n\t\t\theaderRenderer.paddingBottom = this.smallGutterSize;\n\t\t\theaderRenderer.paddingLeft = this.gutterSize;\n\t\t\theaderRenderer.paddingRight = this.gutterSize;\n\t\t}\n\n\t\tprotected function setGroupedListFooterRendererStyles(footerRenderer:DefaultGroupedListHeaderOrFooterRenderer):void\n\t\t{\n\t\t\tfooterRenderer.backgroundSkin = new Quad(this.controlSize, this.controlSize, GROUPED_LIST_FOOTER_BACKGROUND_COLOR);\n\n\t\t\tfooterRenderer.fontStyles = this.lightFontStyles.clone();\n\t\t\tfooterRenderer.disabledFontStyles = this.lightDisabledFontStyles.clone();\n\n\t\t\tfooterRenderer.horizontalAlign = HorizontalAlign.CENTER;\n\n\t\t\tfooterRenderer.paddingTop = this.smallGutterSize;\n\t\t\tfooterRenderer.paddingBottom = this.smallGutterSize;\n\t\t\tfooterRenderer.paddingLeft = this.gutterSize;\n\t\t\tfooterRenderer.paddingRight = this.gutterSize;\n\t\t}\n\n\t//-------------------------\n\t// Header\n\t//-------------------------\n\n\t\tprotected function setHeaderStyles(header:Header):void\n\t\t{\n\t\t\theader.paddingTop = this.smallGutterSize;\n\t\t\theader.paddingBottom = this.smallGutterSize;\n\t\t\theader.paddingRight = this.gutterSize;\n\t\t\theader.paddingLeft = this.gutterSize;\n\t\t\theader.gap = this.smallGutterSize;\n\t\t\theader.titleGap = this.smallGutterSize;\n\n\t\t\theader.fontStyles = this.lightFontStyles.clone();\n\t\t\theader.disabledFontStyles = this.lightDisabledFontStyles.clone();\n\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.headerBackgroundSkinTexture);\n\t\t\tbackgroundSkin.tileGrid = new Rectangle();\n\t\t\tbackgroundSkin.width = this.controlSize;\n\t\t\tbackgroundSkin.height = this.controlSize;\n\t\t\tbackgroundSkin.minWidth = this.gridSize;\n\t\t\tbackgroundSkin.minHeight = this.gridSize;\n\t\t\theader.backgroundSkin = backgroundSkin;\n\t\t}\n\n\t//-------------------------\n\t// Label\n\t//-------------------------\n\n\t\tprotected function setLabelStyles(label:Label):void\n\t\t{\n\t\t\tlabel.fontStyles = this.lightFontStyles.clone();\n\t\t\tlabel.disabledFontStyles = this.lightDisabledFontStyles.clone();\n\t\t}\n\n\t\tprotected function setHeadingLabelStyles(label:Label):void\n\t\t{\n\t\t\tlabel.fontStyles = this.largeLightFontStyles.clone();\n\t\t\tlabel.disabledFontStyles = this.largeLightDisabledFontStyles.clone();\n\t\t}\n\n\t\tprotected function setDetailLabelStyles(label:Label):void\n\t\t{\n\t\t\tlabel.fontStyles = this.smallLightFontStyles.clone();\n\t\t\tlabel.disabledFontStyles = this.smallLightDisabledFontStyles.clone();\n\t\t}\n\n\t\tprotected function setToolTipLabelStyles(label:Label):void\n\t\t{\n\t\t\tvar backgroundSkin:Image = new Image(this.backgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = DEFAULT_SCALE9_GRID;\n\t\t\tlabel.backgroundSkin = backgroundSkin;\n\n\t\t\tlabel.fontStyles = this.lightFontStyles.clone();\n\t\t\tlabel.disabledFontStyles = this.lightDisabledFontStyles.clone();\n\n\t\t\tlabel.padding = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// LayoutGroup\n\t//-------------------------\n\n\t\tprotected function setToolbarLayoutGroupStyles(group:LayoutGroup):void\n\t\t{\n\t\t\tif(!group.layout)\n\t\t\t{\n\t\t\t\tvar layout:HorizontalLayout = new HorizontalLayout();\n\t\t\t\tlayout.padding = this.gutterSize;\n\t\t\t\tlayout.gap = this.smallGutterSize;\n\t\t\t\tlayout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\t\tgroup.layout = layout;\n\t\t\t}\n\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.headerBackgroundSkinTexture);\n\t\t\tbackgroundSkin.tileGrid = new Rectangle();\n\t\t\tbackgroundSkin.width = this.gridSize;\n\t\t\tbackgroundSkin.height = this.gridSize;\n\t\t\tbackgroundSkin.minWidth = this.gridSize;\n\t\t\tbackgroundSkin.minHeight = this.gridSize;\n\t\t\tgroup.backgroundSkin = backgroundSkin;\n\t\t}\n\n\t//-------------------------\n\t// List\n\t//-------------------------\n\n\t\tprotected function setListStyles(list:List):void\n\t\t{\n\t\t\tthis.setScrollerStyles(list);\n\n\t\t\tlist.padding = this.borderSize;\n\n\t\t\tvar backgroundSkin:Image = new Image(this.listBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = DEFAULT_SCALE9_GRID;\n\t\t\tbackgroundSkin.width = this.controlSize;\n\t\t\tbackgroundSkin.height = this.controlSize;\n\t\t\tlist.backgroundSkin = backgroundSkin;\n\n\t\t\tvar backgroundDisabledSkin:Image = new Image(this.backgroundDisabledSkinTexture);\n\t\t\tbackgroundDisabledSkin.scale9Grid = DEFAULT_SCALE9_GRID;\n\t\t\tbackgroundDisabledSkin.width = this.controlSize;\n\t\t\tbackgroundDisabledSkin.height = this.controlSize;\n\t\t\tlist.backgroundDisabledSkin = backgroundDisabledSkin;\n\n\t\t\tvar dropIndicatorSkin:Quad = new Quad(this.borderSize, this.borderSize, LIGHT_TEXT_COLOR);\n\t\t\tlist.dropIndicatorSkin = dropIndicatorSkin;\n\n\t\t\tlist.verticalScrollPolicy = ScrollPolicy.AUTO;\n\t\t}\n\n\t\tprotected function setItemRendererStyles(itemRenderer:BaseDefaultItemRenderer):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.itemRendererUpSkinTexture);\n\t\t\tskin.selectedTexture = this.itemRendererSelectedUpSkinTexture;\n\t\t\tskin.setTextureForState(ButtonState.HOVER, this.itemRendererHoverSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.itemRendererSelectedUpSkinTexture);\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\titemRenderer.defaultSkin = skin;\n\n\t\t\titemRenderer.fontStyles = this.lightFontStyles.clone();\n\t\t\titemRenderer.disabledFontStyles = this.lightDisabledFontStyles.clone();\n\t\t\titemRenderer.selectedFontStyles = this.darkFontStyles.clone();\n\t\t\titemRenderer.setFontStylesForState(ButtonState.DOWN, this.darkFontStyles.clone());\n\t\t\titemRenderer.setFontStylesForState(ButtonState.HOVER, this.darkFontStyles.clone());\n\n\t\t\titemRenderer.iconLabelFontStyles = this.lightFontStyles.clone();\n\t\t\titemRenderer.iconLabelDisabledFontStyles = this.lightDisabledFontStyles.clone();\n\t\t\titemRenderer.iconLabelSelectedFontStyles = this.darkFontStyles.clone();\n\t\t\titemRenderer.setIconLabelFontStylesForState(ButtonState.DOWN, this.darkFontStyles.clone());\n\t\t\titemRenderer.setIconLabelFontStylesForState(ButtonState.HOVER, this.darkFontStyles.clone());\n\n\t\t\titemRenderer.accessoryLabelFontStyles = this.lightFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelDisabledFontStyles = this.lightDisabledFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelSelectedFontStyles = this.darkFontStyles.clone();\n\t\t\titemRenderer.setAccessoryLabelFontStylesForState(ButtonState.DOWN, this.darkFontStyles.clone());\n\t\t\titemRenderer.setAccessoryLabelFontStylesForState(ButtonState.HOVER, this.darkFontStyles.clone());\n\n\t\t\titemRenderer.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\titemRenderer.paddingTop = this.smallGutterSize;\n\t\t\titemRenderer.paddingBottom = this.smallGutterSize;\n\t\t\titemRenderer.paddingLeft = this.gutterSize;\n\t\t\titemRenderer.paddingRight = this.gutterSize;\n\t\t\titemRenderer.gap = this.smallGutterSize;\n\t\t\titemRenderer.minGap = this.smallGutterSize;\n\t\t\titemRenderer.iconPosition = RelativePosition.LEFT;\n\t\t\titemRenderer.accessoryGap = Number.POSITIVE_INFINITY;\n\t\t\titemRenderer.minAccessoryGap = this.smallGutterSize;\n\t\t\titemRenderer.accessoryPosition = RelativePosition.RIGHT;\n\n\t\t\titemRenderer.useStateDelayTimer = false;\n\t\t}\n\n\t\tprotected function setDrillDownItemRendererStyles(itemRenderer:BaseDefaultItemRenderer):void\n\t\t{\n\t\t\tthis.setItemRendererStyles(itemRenderer);\n\n\t\t\titemRenderer.itemHasAccessory = false;\n\n\t\t\tvar defaultAccessory:ImageSkin = new ImageSkin(this.listDrillDownAccessoryTexture);\n\t\t\tdefaultAccessory.selectedTexture = this.listDrillDownAccessorySelectedTexture;\n\t\t\tdefaultAccessory.setTextureForState(ButtonState.HOVER, this.listDrillDownAccessorySelectedTexture);\n\t\t\tdefaultAccessory.setTextureForState(ButtonState.DOWN, this.listDrillDownAccessorySelectedTexture);\n\t\t\titemRenderer.defaultAccessory = defaultAccessory;\n\t\t}\n\n\t\tprotected function setCheckItemRendererStyles(itemRenderer:BaseDefaultItemRenderer):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.itemRendererUpSkinTexture);\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\titemRenderer.defaultSkin = skin;\n\n\t\t\titemRenderer.itemHasIcon = false;\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.checkUpIconTexture);\n\t\t\ticon.selectedTexture = this.checkSelectedUpIconTexture;\n\t\t\ticon.setTextureForState(ButtonState.DOWN, this.checkDownIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.checkSelectedDownIconTexture);\n\t\t\titemRenderer.defaultIcon = icon;\n\n\t\t\titemRenderer.fontStyles = this.lightFontStyles.clone();\n\t\t\titemRenderer.disabledFontStyles = this.lightDisabledFontStyles.clone();\n\t\t\titemRenderer.iconLabelFontStyles = this.lightFontStyles.clone();\n\t\t\titemRenderer.iconLabelDisabledFontStyles = this.lightDisabledFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelFontStyles = this.lightFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelDisabledFontStyles = this.lightDisabledFontStyles.clone();\n\n\t\t\titemRenderer.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\titemRenderer.paddingTop = this.smallGutterSize;\n\t\t\titemRenderer.paddingBottom = this.smallGutterSize;\n\t\t\titemRenderer.paddingLeft = this.gutterSize;\n\t\t\titemRenderer.paddingRight = this.gutterSize;\n\t\t\titemRenderer.gap = this.smallGutterSize;\n\t\t\titemRenderer.minGap = this.smallGutterSize;\n\t\t\titemRenderer.iconPosition = RelativePosition.LEFT;\n\t\t\titemRenderer.accessoryGap = Number.POSITIVE_INFINITY;\n\t\t\titemRenderer.minAccessoryGap = this.smallGutterSize;\n\t\t\titemRenderer.accessoryPosition = RelativePosition.RIGHT;\n\n\t\t\titemRenderer.useStateDelayTimer = false;\n\t\t}\n\n\t//-------------------------\n\t// NumericStepper\n\t//-------------------------\n\n\t\tprotected function setNumericStepperStyles(stepper:NumericStepper):void\n\t\t{\n\t\t\tstepper.buttonLayoutMode = StepperButtonLayoutMode.RIGHT_SIDE_VERTICAL;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tstepper.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tstepper.focusPadding = this.focusPaddingSize;\n\t\t}\n\n\t\tprotected function setNumericStepperTextInputStyles(input:TextInput):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.backgroundSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.DISABLED, this.backgroundDisabledSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.FOCUSED, this.backgroundFocusedSkinTexture);\n\t\t\tskin.scale9Grid = DEFAULT_SCALE9_GRID;\n\t\t\tskin.width = this.gridSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.gridSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tinput.backgroundSkin = skin;\n\n\t\t\tinput.fontStyles = this.lightCenteredUIFontStyles.clone();\n\t\t\tinput.disabledFontStyles = this.lightCenteredDisabledUIFontStyles.clone();\n\n\t\t\tinput.gap = this.smallGutterSize;\n\t\t\tinput.paddingTop = this.smallGutterSize;\n\t\t\tinput.paddingBottom = this.smallGutterSize;\n\t\t\tinput.paddingLeft = this.gutterSize;\n\t\t\tinput.paddingRight = this.gutterSize;\n\t\t}\n\n\t\tprotected function setNumericStepperDecrementButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.verticalScrollBarIncrementButtonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.verticalScrollBarIncrementButtonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.verticalScrollBarIncrementButtonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = SCROLL_BAR_STEP_BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.smallControlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.defaultIcon = new Image(this.verticalScrollBarIncrementButtonIconTexture);\n\t\t\tbutton.disabledIcon = new Image(this.verticalScrollBarIncrementButtonDisabledIconTexture);\n\n\t\t\tvar incrementButtonDisabledIcon:Quad = new Quad(1, 1, 0xff00ff);\n\t\t\tincrementButtonDisabledIcon.alpha = 0;\n\t\t\tbutton.disabledIcon = incrementButtonDisabledIcon;\n\n\t\t\tbutton.keepDownStateOnRollOut = true;\n\t\t\tbutton.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setNumericStepperIncrementButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.verticalScrollBarDecrementButtonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.verticalScrollBarDecrementButtonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.verticalScrollBarDecrementButtonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = SCROLL_BAR_STEP_BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.smallControlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.defaultIcon = new Image(this.verticalScrollBarDecrementButtonIconTexture);\n\t\t\tbutton.disabledIcon = new Image(this.verticalScrollBarDecrementButtonDisabledIconTexture);\n\n\t\t\tvar incrementButtonDisabledIcon:Quad = new Quad(1, 1, 0xff00ff);\n\t\t\tincrementButtonDisabledIcon.alpha = 0;\n\t\t\tbutton.disabledIcon = incrementButtonDisabledIcon;\n\n\t\t\tbutton.keepDownStateOnRollOut = true;\n\t\t\tbutton.hasLabelTextRenderer = false;\n\t\t}\n\n\t//-------------------------\n\t// PageIndicator\n\t//-------------------------\n\n\t\tprotected function setPageIndicatorStyles(pageIndicator:PageIndicator):void\n\t\t{\n\t\t\tpageIndicator.interactionMode = PageIndicatorInteractionMode.PRECISE;\n\n\t\t\tpageIndicator.normalSymbolFactory = this.pageIndicatorNormalSymbolFactory;\n\t\t\tpageIndicator.selectedSymbolFactory = this.pageIndicatorSelectedSymbolFactory;\n\n\t\t\tpageIndicator.gap = this.gutterSize;\n\t\t\tpageIndicator.padding = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// Panel\n\t//-------------------------\n\n\t\tprotected function setPanelStyles(panel:Panel):void\n\t\t{\n\t\t\tthis.setScrollerStyles(panel);\n\n\t\t\tvar backgroundSkin:Image = new Image(this.backgroundPopUpSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = SIMPLE_SCALE9_GRID;\n\t\t\tpanel.backgroundSkin = backgroundSkin;\n\n\t\t\tpanel.padding = this.gutterSize;\n\t\t\tpanel.outerPadding = this.borderSize;\n\t\t}\n\n\t\tprotected function setPopupHeaderStyles(header:Header):void\n\t\t{\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.headerPopupBackgroundSkinTexture);\n\t\t\tbackgroundSkin.tileGrid = new Rectangle();\n\t\t\tbackgroundSkin.width = this.controlSize;\n\t\t\tbackgroundSkin.height = this.controlSize;\n\t\t\tbackgroundSkin.minWidth = this.gridSize;\n\t\t\tbackgroundSkin.minHeight = this.gridSize;\n\t\t\theader.backgroundSkin = backgroundSkin;\n\n\t\t\theader.fontStyles = this.lightFontStyles.clone();\n\t\t\theader.disabledFontStyles = this.lightDisabledFontStyles.clone();\n\n\t\t\theader.paddingTop = this.smallGutterSize;\n\t\t\theader.paddingBottom = this.smallGutterSize;\n\t\t\theader.paddingRight = this.gutterSize;\n\t\t\theader.paddingLeft = this.gutterSize;\n\t\t\theader.gap = this.smallGutterSize;\n\t\t\theader.titleGap = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// PanelScreen\n\t//-------------------------\n\n\t\tprotected function setPanelScreenStyles(screen:PanelScreen):void\n\t\t{\n\t\t\tthis.setScrollerStyles(screen);\n\t\t}\n\n\t\tprotected function setPanelScreenHeaderStyles(header:Header):void\n\t\t{\n\t\t\tthis.setHeaderStyles(header);\n\t\t\theader.useExtraPaddingForOSStatusBar = true;\n\t\t}\n\n\t//-------------------------\n\t// PickerList\n\t//-------------------------\n\n\t\tprotected function setPickerListStyles(list:PickerList):void\n\t\t{\n\t\t\tlist.popUpContentManager = new DropDownPopUpContentManager();\n\t\t\tlist.toggleButtonOnOpenAndClose = true;\n\t\t\tlist.buttonFactory = pickerListButtonFactory;\n\t\t}\n\n\t\tprotected function setPickerListButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.buttonMinWidth;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.buttonMinWidth;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.pickerListButtonIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DISABLED, this.pickerListButtonIconDisabledTexture);\n\t\t\tif(button is ToggleButton)\n\t\t\t{\n\t\t\t\t//for convenience, this function can style both a regular button\n\t\t\t\t//and a toggle button\n\t\t\t\ticon.selectedTexture = this.pickerListButtonIconSelectedTexture;\n\t\t\t\ticon.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.pickerListButtonIconDisabledTexture);\n\t\t\t}\n\t\t\tbutton.defaultIcon = icon;\n\n\t\t\tbutton.fontStyles = this.darkUIFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.darkDisabledUIFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\n\t\t\tbutton.gap = Number.POSITIVE_INFINITY; //fill as completely as possible\n\t\t\tbutton.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tbutton.iconPosition = RelativePosition.RIGHT;\n\t\t}\n\n\t\t//for the PickerList's pop-up list, see setDropDownListStyles()\n\n\t//-------------------------\n\t// ProgressBar\n\t//-------------------------\n\n\t\tprotected function setProgressBarStyles(progress:ProgressBar):void\n\t\t{\n\t\t\tvar backgroundSkin:Image = new Image(this.backgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = DEFAULT_SCALE9_GRID;\n\t\t\tif(progress.direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tbackgroundSkin.width = this.smallControlSize;\n\t\t\t\tbackgroundSkin.height = this.wideControlSize;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbackgroundSkin.width = this.wideControlSize;\n\t\t\t\tbackgroundSkin.height = this.smallControlSize;\n\t\t\t}\n\t\t\tprogress.backgroundSkin = backgroundSkin;\n\n\t\t\tvar backgroundDisabledSkin:Image = new Image(this.backgroundDisabledSkinTexture);\n\t\t\tbackgroundDisabledSkin.scale9Grid = DEFAULT_SCALE9_GRID;\n\t\t\tif(progress.direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tbackgroundDisabledSkin.width = this.smallControlSize;\n\t\t\t\tbackgroundDisabledSkin.height = this.wideControlSize;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbackgroundDisabledSkin.width = this.wideControlSize;\n\t\t\t\tbackgroundDisabledSkin.height = this.smallControlSize;\n\t\t\t}\n\t\t\tprogress.backgroundDisabledSkin = backgroundDisabledSkin;\n\n\t\t\tvar fillSkin:Image = new Image(this.buttonUpSkinTexture);\n\t\t\tfillSkin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tif(progress.direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tfillSkin.width = this.smallControlSize;\n\t\t\t\tfillSkin.height = this.progressBarFillMinSize;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfillSkin.width = this.progressBarFillMinSize;\n\t\t\t\tfillSkin.height = this.smallControlSize;\n\t\t\t}\n\t\t\tprogress.fillSkin = fillSkin;\n\n\t\t\tvar fillDisabledSkin:Image = new Image(this.buttonDisabledSkinTexture);\n\t\t\tfillDisabledSkin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tif(progress.direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tfillDisabledSkin.width = this.smallControlSize;\n\t\t\t\tfillDisabledSkin.height = this.progressBarFillMinSize;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfillDisabledSkin.width = this.progressBarFillMinSize;\n\t\t\t\tfillDisabledSkin.height = this.smallControlSize;\n\t\t\t}\n\t\t\tprogress.fillDisabledSkin = fillDisabledSkin;\n\t\t}\n\n\t//-------------------------\n\t// Radio\n\t//-------------------------\n\n\t\tprotected function setRadioStyles(radio:Radio):void\n\t\t{\n\t\t\tvar skin:Quad = new Quad(this.controlSize, this.controlSize);\n\t\t\tskin.alpha = 0;\n\t\t\tradio.defaultSkin = skin;\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.radioUpIconTexture);\n\t\t\ticon.selectedTexture = this.radioSelectedUpIconTexture;\n\t\t\ticon.setTextureForState(ButtonState.DOWN, this.radioDownIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DISABLED, this.radioDisabledIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.radioSelectedDownIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.radioSelectedDisabledIconTexture);\n\t\t\tradio.defaultIcon = icon;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tradio.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tradio.focusPaddingLeft = this.focusPaddingSize;\n\t\t\tradio.focusPaddingRight = this.focusPaddingSize;\n\n\t\t\tradio.fontStyles = this.lightUIFontStyles.clone();\n\t\t\tradio.disabledFontStyles = this.lightDisabledUIFontStyles.clone();\n\n\t\t\tradio.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tradio.gap = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// ScrollBar\n\t//-------------------------\n\n\t\tprotected function setHorizontalScrollBarStyles(scrollBar:ScrollBar):void\n\t\t{\n\t\t\tscrollBar.direction = Direction.HORIZONTAL;\n\t\t\tscrollBar.trackLayoutMode = TrackLayoutMode.SINGLE;\n\n\t\t\tscrollBar.customIncrementButtonStyleName = THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_INCREMENT_BUTTON;\n\t\t\tscrollBar.customDecrementButtonStyleName = THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_DECREMENT_BUTTON;\n\t\t\tscrollBar.customThumbStyleName = THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_THUMB;\n\t\t\tscrollBar.customMinimumTrackStyleName = THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_MINIMUM_TRACK;\n\t\t}\n\n\t\tprotected function setVerticalScrollBarStyles(scrollBar:ScrollBar):void\n\t\t{\n\t\t\tscrollBar.direction = Direction.VERTICAL;\n\t\t\tscrollBar.trackLayoutMode = TrackLayoutMode.SPLIT;\n\n\t\t\tscrollBar.customIncrementButtonStyleName = THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_INCREMENT_BUTTON;\n\t\t\tscrollBar.customDecrementButtonStyleName = THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_DECREMENT_BUTTON;\n\t\t\tscrollBar.customThumbStyleName = THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_THUMB;\n\t\t\tscrollBar.customMinimumTrackStyleName = THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_MINIMUM_TRACK;\n\t\t\tscrollBar.customMaximumTrackStyleName = THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_MAXIMUM_TRACK;\n\t\t}\n\n\t\tprotected function setHorizontalScrollBarIncrementButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.horizontalScrollBarIncrementButtonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.horizontalScrollBarIncrementButtonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.horizontalScrollBarIncrementButtonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = SCROLL_BAR_STEP_BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.smallControlSize;\n\t\t\tskin.height = this.smallControlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.defaultIcon = new Image(this.horizontalScrollBarIncrementButtonIconTexture);\n\t\t\tbutton.disabledIcon = new Image(this.horizontalScrollBarIncrementButtonDisabledIconTexture);\n\n\t\t\tvar incrementButtonDisabledIcon:Quad = new Quad(1, 1, 0xff00ff);\n\t\t\tincrementButtonDisabledIcon.alpha = 0;\n\t\t\tbutton.disabledIcon = incrementButtonDisabledIcon;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setHorizontalScrollBarDecrementButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.horizontalScrollBarDecrementButtonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.horizontalScrollBarDecrementButtonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.horizontalScrollBarDecrementButtonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = SCROLL_BAR_STEP_BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.smallControlSize;\n\t\t\tskin.height = this.smallControlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.defaultIcon = new Image(this.horizontalScrollBarDecrementButtonIconTexture);\n\t\t\tbutton.disabledIcon = new Image(this.horizontalScrollBarDecrementButtonDisabledIconTexture);\n\n\t\t\tvar decrementButtonDisabledIcon:Quad = new Quad(1, 1, 0xff00ff);\n\t\t\tdecrementButtonDisabledIcon.alpha = 0;\n\t\t\tbutton.disabledIcon = decrementButtonDisabledIcon;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setHorizontalScrollBarThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.smallControlSize;\n\t\t\tskin.height = this.smallControlSize;\n\t\t\tskin.minHeight = this.smallControlSize;\n\t\t\tthumb.defaultSkin = skin;\n\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setHorizontalScrollBarMinimumTrackStyles(track:Button):void\n\t\t{\n\t\t\ttrack.defaultSkin = new Quad(this.smallControlSize, this.smallControlSize, SCROLL_BAR_TRACK_COLOR);\n\t\t\ttrack.downSkin = new Quad(this.smallControlSize, this.smallControlSize, SCROLL_BAR_TRACK_DOWN_COLOR);\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setHorizontalScrollBarMaximumTrackStyles(track:Button):void\n\t\t{\n\t\t\ttrack.defaultSkin = new Quad(this.smallControlSize, this.smallControlSize, SCROLL_BAR_TRACK_COLOR);\n\t\t\ttrack.downSkin = new Quad(this.smallControlSize, this.smallControlSize, SCROLL_BAR_TRACK_DOWN_COLOR);\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVerticalScrollBarIncrementButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.verticalScrollBarIncrementButtonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.verticalScrollBarIncrementButtonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.verticalScrollBarIncrementButtonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = SCROLL_BAR_STEP_BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.smallControlSize;\n\t\t\tskin.height = this.smallControlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.defaultIcon = new Image(this.verticalScrollBarIncrementButtonIconTexture);\n\t\t\tbutton.disabledIcon = new Image(this.verticalScrollBarIncrementButtonDisabledIconTexture);\n\n\t\t\tvar incrementButtonDisabledIcon:Quad = new Quad(1, 1, 0xff00ff);\n\t\t\tincrementButtonDisabledIcon.alpha = 0;\n\t\t\tbutton.disabledIcon = incrementButtonDisabledIcon;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVerticalScrollBarDecrementButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.verticalScrollBarDecrementButtonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.verticalScrollBarDecrementButtonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.verticalScrollBarDecrementButtonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = SCROLL_BAR_STEP_BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.smallControlSize;\n\t\t\tskin.height = this.smallControlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.defaultIcon = new Image(this.verticalScrollBarDecrementButtonIconTexture);\n\t\t\tbutton.disabledIcon = new Image(this.verticalScrollBarDecrementButtonDisabledIconTexture);\n\n\t\t\tvar decrementButtonDisabledIcon:Quad = new Quad(1, 1, 0xff00ff);\n\t\t\tdecrementButtonDisabledIcon.alpha = 0;\n\t\t\tbutton.disabledIcon = decrementButtonDisabledIcon;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVerticalScrollBarThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.smallControlSize;\n\t\t\tskin.height = this.smallControlSize;\n\t\t\tskin.minHeight = this.smallControlSize;\n\t\t\tthumb.defaultSkin = skin;\n\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVerticalScrollBarMinimumTrackStyles(track:Button):void\n\t\t{\n\t\t\ttrack.defaultSkin = new Quad(this.smallControlSize, this.smallControlSize, SCROLL_BAR_TRACK_COLOR);\n\t\t\ttrack.downSkin = new Quad(this.smallControlSize, this.smallControlSize, SCROLL_BAR_TRACK_DOWN_COLOR);\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVerticalScrollBarMaximumTrackStyles(track:Button):void\n\t\t{\n\t\t\ttrack.defaultSkin = new Quad(this.smallControlSize, this.smallControlSize, SCROLL_BAR_TRACK_COLOR);\n\t\t\ttrack.downSkin = new Quad(this.smallControlSize, this.smallControlSize, SCROLL_BAR_TRACK_DOWN_COLOR);\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t//-------------------------\n\t// ScrollContainer\n\t//-------------------------\n\n\t\tprotected function setScrollContainerStyles(container:ScrollContainer):void\n\t\t{\n\t\t\tthis.setScrollerStyles(container);\n\t\t}\n\n\t\tprotected function setToolbarScrollContainerStyles(container:ScrollContainer):void\n\t\t{\n\t\t\tthis.setScrollerStyles(container);\n\t\t\tif(!container.layout)\n\t\t\t{\n\t\t\t\tvar layout:HorizontalLayout = new HorizontalLayout();\n\t\t\t\tlayout.padding = this.gutterSize;\n\t\t\t\tlayout.gap = this.smallGutterSize;\n\t\t\t\tcontainer.layout = layout;\n\t\t\t}\n\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.headerBackgroundSkinTexture);\n\t\t\tbackgroundSkin.tileGrid = new Rectangle();\n\t\t\tbackgroundSkin.width = this.gridSize;\n\t\t\tbackgroundSkin.height = this.gridSize;\n\t\t\tbackgroundSkin.minWidth = this.gridSize;\n\t\t\tbackgroundSkin.minHeight = this.gridSize;\n\t\t\tcontainer.backgroundSkin = backgroundSkin;\n\t\t}\n\n\t//-------------------------\n\t// ScrollScreen\n\t//-------------------------\n\n\t\tprotected function setScrollScreenStyles(screen:ScrollScreen):void\n\t\t{\n\t\t\tthis.setScrollerStyles(screen);\n\t\t}\n\n\t//-------------------------\n\t// ScrollText\n\t//-------------------------\n\n\t\tprotected function setScrollTextStyles(text:ScrollText):void\n\t\t{\n\t\t\tthis.setScrollerStyles(text);\n\n\t\t\ttext.fontStyles = this.lightScrollTextFontStyles.clone();\n\t\t\ttext.disabledFontStyles = this.lightDisabledScrollTextFontStyles.clone();\n\n\t\t\ttext.padding = this.gutterSize;\n\t\t}\n\n\t//-------------------------\n\t// SimpleScrollBar\n\t//-------------------------\n\n\t\tprotected function setSimpleScrollBarStyles(scrollBar:SimpleScrollBar):void\n\t\t{\n\t\t\tif(scrollBar.direction == Direction.HORIZONTAL)\n\t\t\t{\n\t\t\t\tscrollBar.paddingRight = this.scrollBarGutterSize;\n\t\t\t\tscrollBar.paddingBottom = this.scrollBarGutterSize;\n\t\t\t\tscrollBar.paddingLeft = this.scrollBarGutterSize;\n\t\t\t\tscrollBar.customThumbStyleName = THEME_STYLE_NAME_HORIZONTAL_SIMPLE_SCROLL_BAR_THUMB;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tscrollBar.paddingTop = this.scrollBarGutterSize;\n\t\t\t\tscrollBar.paddingRight = this.scrollBarGutterSize;\n\t\t\t\tscrollBar.paddingBottom = this.scrollBarGutterSize;\n\t\t\t\tscrollBar.customThumbStyleName = THEME_STYLE_NAME_VERTICAL_SIMPLE_SCROLL_BAR_THUMB;\n\t\t\t}\n\t\t}\n\n\t\tprotected function setHorizontalSimpleScrollBarThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar defaultSkin:Image = new Image(this.horizontalSimpleScrollBarThumbSkinTexture);\n\t\t\tdefaultSkin.width = this.smallControlSize;\n\t\t\tdefaultSkin.scale9Grid = HORIZONTAL_SCROLL_BAR_THUMB_SCALE_9_GRID;\n\t\t\tthumb.defaultSkin = defaultSkin;\n\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVerticalSimpleScrollBarThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar defaultSkin:Image = new Image(this.verticalSimpleScrollBarThumbSkinTexture);\n\t\t\tdefaultSkin.height = this.smallControlSize;\n\t\t\tdefaultSkin.scale9Grid = VERTICAL_SCROLL_BAR_THUMB_SCALE_9_GRID;\n\t\t\tthumb.defaultSkin = defaultSkin;\n\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t//-------------------------\n\t// Slider\n\t//-------------------------\n\n\t\tprotected function setSliderStyles(slider:Slider):void\n\t\t{\n\t\t\tslider.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tif(slider.direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tslider.customMinimumTrackStyleName = THEME_STYLE_NAME_VERTICAL_SLIDER_MINIMUM_TRACK;\n\t\t\t\tslider.customMaximumTrackStyleName = THEME_STYLE_NAME_VERTICAL_SLIDER_MAXIMUM_TRACK;\n\t\t\t}\n\t\t\telse //horizontal\n\t\t\t{\n\t\t\t\tslider.customMinimumTrackStyleName = THEME_STYLE_NAME_HORIZONTAL_SLIDER_MINIMUM_TRACK;\n\t\t\t\tslider.customMaximumTrackStyleName = THEME_STYLE_NAME_HORIZONTAL_SLIDER_MAXIMUM_TRACK;\n\t\t\t}\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tslider.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tslider.focusPadding = this.focusPaddingSize;\n\t\t}\n\n\t\tprotected function setSliderThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.smallControlSize;\n\t\t\tskin.height = this.smallControlSize;\n\t\t\tskin.minWidth = this.smallControlSize;\n\t\t\tskin.minHeight = this.smallControlSize;\n\t\t\tthumb.defaultSkin = skin;\n\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setHorizontalSliderMinimumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.backgroundSkinTexture);\n\t\t\tskin.disabledTexture = this.backgroundDisabledSkinTexture;\n\t\t\tskin.scale9Grid = DEFAULT_SCALE9_GRID;\n\t\t\tskin.width = this.wideControlSize;\n\t\t\tskin.height = this.smallControlSize;\n\t\t\tskin.minWidth = this.wideControlSize;\n\t\t\tskin.minHeight = this.smallControlSize;\n\t\t\ttrack.defaultSkin = skin;\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setHorizontalSliderMaximumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.backgroundSkinTexture);\n\t\t\tskin.disabledTexture = this.backgroundDisabledSkinTexture;\n\t\t\tskin.scale9Grid = DEFAULT_SCALE9_GRID;\n\t\t\tskin.width = this.wideControlSize;\n\t\t\tskin.height = this.smallControlSize;\n\t\t\tskin.minWidth = this.wideControlSize;\n\t\t\tskin.minHeight = this.smallControlSize;\n\t\t\ttrack.defaultSkin = skin;\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVerticalSliderMinimumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.backgroundSkinTexture);\n\t\t\tskin.disabledTexture = this.backgroundDisabledSkinTexture;\n\t\t\tskin.scale9Grid = DEFAULT_SCALE9_GRID;\n\t\t\tskin.width = this.smallControlSize;\n\t\t\tskin.height = this.wideControlSize;\n\t\t\tskin.minWidth = this.smallControlSize;\n\t\t\tskin.minHeight = this.wideControlSize;\n\t\t\ttrack.defaultSkin = skin;\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVerticalSliderMaximumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.backgroundSkinTexture);\n\t\t\tskin.disabledTexture = this.backgroundDisabledSkinTexture;\n\t\t\tskin.scale9Grid = DEFAULT_SCALE9_GRID;\n\t\t\tskin.width = this.smallControlSize;\n\t\t\tskin.height = this.wideControlSize;\n\t\t\tskin.minWidth = this.smallControlSize;\n\t\t\tskin.minHeight = this.wideControlSize;\n\t\t\ttrack.defaultSkin = skin;\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t//-------------------------\n\t// SpinnerList\n\t//-------------------------\n\n\t\tprotected function setSpinnerListStyles(list:SpinnerList):void\n\t\t{\n\t\t\tthis.setListStyles(list);\n\t\t}\n\n\t//-------------------------\n\t// TabBar\n\t//-------------------------\n\n\t\tprotected function setTabBarStyles(tabBar:TabBar):void\n\t\t{\n\t\t\ttabBar.distributeTabSizes = false;\n\t\t\ttabBar.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\ttabBar.verticalAlign = VerticalAlign.JUSTIFY;\n\t\t}\n\n\t\tprotected function setTabStyles(tab:ToggleButton):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.tabUpSkinTexture);\n\t\t\tskin.selectedTexture = this.tabSelectedSkinTexture;\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.tabDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.tabDisabledSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.tabSelectedDisabledSkinTexture);\n\t\t\tskin.scale9Grid = TAB_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\ttab.defaultSkin = skin;\n\n\t\t\ttab.fontStyles = this.lightUIFontStyles.clone();\n\t\t\ttab.selectedFontStyles = this.darkUIFontStyles.clone();\n\t\t\ttab.setFontStylesForState(ButtonState.DOWN, this.darkUIFontStyles.clone());\n\t\t\ttab.setFontStylesForState(ButtonState.DISABLED, this.lightDisabledUIFontStyles.clone());\n\t\t\ttab.setFontStylesForState(ButtonState.DISABLED_AND_SELECTED, this.darkDisabledUIFontStyles.clone());\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\ttab.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\ttab.focusPadding = this.focusPaddingSize;\n\n\t\t\ttab.paddingTop = this.smallGutterSize;\n\t\t\ttab.paddingBottom = this.smallGutterSize;\n\t\t\ttab.paddingLeft = this.gutterSize;\n\t\t\ttab.paddingRight = this.gutterSize;\n\t\t\ttab.gap = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// TextArea\n\t//-------------------------\n\n\t\tprotected function setTextAreaStyles(textArea:TextArea):void\n\t\t{\n\t\t\tthis.setScrollerStyles(textArea);\n\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.backgroundSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.DISABLED, this.backgroundDisabledSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.FOCUSED, this.backgroundFocusedSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.ERROR, this.backgroundDangerSkinTexture);\n\t\t\tskin.scale9Grid = DEFAULT_SCALE9_GRID;\n\t\t\tskin.width = this.wideControlSize * 2;\n\t\t\tskin.height = this.wideControlSize;\n\t\t\ttextArea.backgroundSkin = skin;\n\n\t\t\ttextArea.fontStyles = this.lightScrollTextFontStyles.clone();\n\t\t\ttextArea.disabledFontStyles = this.lightDisabledScrollTextFontStyles.clone();\n\n\t\t\ttextArea.promptFontStyles = this.lightFontStyles.clone();\n\t\t\ttextArea.promptDisabledFontStyles = this.lightDisabledFontStyles.clone();\n\n\t\t\ttextArea.padding = this.borderSize;\n\t\t\ttextArea.innerPadding = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setTextAreaErrorCalloutStyles(callout:TextCallout):void\n\t\t{\n\t\t\tthis.setDangerCalloutStyles(callout);\n\n\t\t\tcallout.fontStyles = this.lightFontStyles.clone();\n\t\t\tcallout.disabledFontStyles = this.lightDisabledFontStyles.clone();\n\n\t\t\tcallout.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tcallout.verticalAlign = VerticalAlign.TOP;\n\t\t}\n\n\t//-------------------------\n\t// TextCallout\n\t//-------------------------\n\n\t\tprotected function setTextCalloutStyles(callout:TextCallout):void\n\t\t{\n\t\t\tthis.setCalloutStyles(callout);\n\n\t\t\tcallout.fontStyles = this.lightFontStyles.clone();\n\t\t\tcallout.disabledFontStyles = this.lightDisabledFontStyles.clone();\n\t\t}\n\n\t//-------------------------\n\t// TextInput\n\t//-------------------------\n\n\t\tprotected function setBaseTextInputStyles(input:TextInput):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.backgroundSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.DISABLED, this.backgroundDisabledSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.FOCUSED, this.backgroundFocusedSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.ERROR, this.backgroundDangerSkinTexture);\n\t\t\tskin.scale9Grid = DEFAULT_SCALE9_GRID;\n\t\t\tskin.width = this.wideControlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tinput.backgroundSkin = skin;\n\n\t\t\tinput.fontStyles = this.lightFontStyles.clone();\n\t\t\tinput.disabledFontStyles = this.lightDisabledFontStyles.clone();\n\n\t\t\tinput.promptFontStyles = this.lightFontStyles.clone();\n\t\t\tinput.promptDisabledFontStyles = this.lightDisabledFontStyles.clone();\n\n\t\t\tinput.gap = this.smallGutterSize;\n\t\t\tinput.paddingTop = this.smallGutterSize;\n\t\t\tinput.paddingBottom = this.smallGutterSize;\n\t\t\tinput.paddingLeft = this.gutterSize;\n\t\t\tinput.paddingRight = this.gutterSize;\n\t\t}\n\n\t\tprotected function setTextInputStyles(input:TextInput):void\n\t\t{\n\t\t\tthis.setBaseTextInputStyles(input);\n\t\t}\n\n\t\tprotected function setTextInputTextEditorStyles(textEditor:TextBlockTextEditor):void\n\t\t{\n\t\t\ttextEditor.cursorSkin = new Quad(1, 1, LIGHT_TEXT_COLOR);\n\t\t\ttextEditor.selectionSkin = new Quad(1, 1, TEXT_SELECTION_BACKGROUND_COLOR);\n\t\t}\n\n\t\tprotected function setTextInputErrorCalloutStyles(callout:TextCallout):void\n\t\t{\n\t\t\tthis.setDangerCalloutStyles(callout);\n\n\t\t\tcallout.fontStyles = this.lightFontStyles.clone();\n\t\t\tcallout.disabledFontStyles = this.lightDisabledFontStyles.clone();\n\n\t\t\tcallout.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tcallout.verticalAlign = VerticalAlign.TOP;\n\t\t}\n\n\t\tprotected function setSearchTextInputStyles(input:TextInput):void\n\t\t{\n\t\t\tthis.setBaseTextInputStyles(input);\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.searchIconTexture);\n\t\t\ticon.disabledTexture = this.searchIconDisabledTexture;\n\t\t\tinput.defaultIcon = icon;\n\t\t}\n\n\t//-------------------------\n\t// Toast\n\t//-------------------------\n\n\t\tprotected function setToastStyles(toast:Toast):void\n\t\t{\n\t\t\tvar backgroundSkin:Image = new Image(this.backgroundPopUpSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = SIMPLE_SCALE9_GRID;\n\t\t\ttoast.backgroundSkin = backgroundSkin;\n\n\t\t\ttoast.fontStyles = this.lightFontStyles.clone();\n\n\t\t\ttoast.width = this.extraWideControlSize;\n\t\t\ttoast.paddingTop = this.gutterSize;\n\t\t\ttoast.paddingRight = this.gutterSize;\n\t\t\ttoast.paddingBottom = this.gutterSize;\n\t\t\ttoast.paddingLeft = this.gutterSize;\n\t\t\ttoast.gap = Number.POSITIVE_INFINITY;\n\t\t\ttoast.minGap = this.smallGutterSize;\n\t\t\ttoast.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\ttoast.verticalAlign = VerticalAlign.MIDDLE;\n\t\t}\n\n\t\tprotected function setToastActionsStyles(group:ButtonGroup):void\n\t\t{\n\t\t\tgroup.direction = Direction.HORIZONTAL;\n\t\t\tgroup.gap = this.smallGutterSize;\n\t\t\tgroup.customButtonStyleName = THEME_STYLE_NAME_TOAST_ACTIONS_BUTTON;\n\t\t}\n\n\t\tprotected function setToastActionsButtonStyles(button:Button):void\n\t\t{\n\t\t\tbutton.fontStyles = this.selectedUIFontStyles.clone();\n\t\t\tbutton.setFontStylesForState(ButtonState.DOWN, this.lightUIFontStyles);\n\t\t}\n\n\t//-------------------------\n\t// ToggleSwitch\n\t//-------------------------\n\n\t\tprotected function setToggleSwitchStyles(toggle:ToggleSwitch):void\n\t\t{\n\t\t\ttoggle.trackLayoutMode = TrackLayoutMode.SINGLE;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\ttoggle.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\ttoggle.focusPadding = this.focusPaddingSize;\n\n\t\t\ttoggle.offLabelFontStyles = this.lightUIFontStyles.clone();\n\t\t\ttoggle.offLabelDisabledFontStyles = this.lightDisabledUIFontStyles.clone();\n\n\t\t\ttoggle.onLabelFontStyles = this.selectedUIFontStyles.clone();\n\t\t\ttoggle.onLabelDisabledFontStyles = this.lightDisabledUIFontStyles.clone();\n\t\t}\n\n\t\tprotected function setToggleSwitchThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tthumb.defaultSkin = skin;\n\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setToggleSwitchTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.backgroundSkinTexture);\n\t\t\tskin.disabledTexture = this.backgroundDisabledSkinTexture;\n\t\t\tskin.scale9Grid = DEFAULT_SCALE9_GRID;\n\t\t\tskin.width = Math.round(this.controlSize * 2.5);\n\t\t\tskin.height = this.controlSize;\n\t\t\ttrack.defaultSkin = skin;\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t//-------------------------\n\t// Tree\n\t//-------------------------\n\n\t\tprotected function setTreeStyles(tree:Tree):void\n\t\t{\n\t\t\tthis.setScrollerStyles(tree);\n\n\t\t\ttree.padding = this.borderSize;\n\n\t\t\tvar backgroundSkin:Image = new Image(this.listBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = DEFAULT_SCALE9_GRID;\n\t\t\tbackgroundSkin.width = this.controlSize;\n\t\t\tbackgroundSkin.height = this.controlSize;\n\t\t\ttree.backgroundSkin = backgroundSkin;\n\n\t\t\tvar backgroundDisabledSkin:Image = new Image(this.backgroundDisabledSkinTexture);\n\t\t\tbackgroundDisabledSkin.scale9Grid = DEFAULT_SCALE9_GRID;\n\t\t\tbackgroundDisabledSkin.width = this.controlSize;\n\t\t\tbackgroundDisabledSkin.height = this.controlSize;\n\t\t\ttree.backgroundDisabledSkin = backgroundDisabledSkin;\n\n\t\t\ttree.verticalScrollPolicy = ScrollPolicy.AUTO;\n\t\t}\n\n\t\tprotected function setTreeItemRendererStyles(itemRenderer:DefaultTreeItemRenderer):void\n\t\t{\n\t\t\tthis.setItemRendererStyles(itemRenderer);\n\n\t\t\titemRenderer.indentation = this.treeDisclosureOpenIconTexture.width;\n\n\t\t\tvar disclosureOpenIcon:ImageSkin = new ImageSkin(this.treeDisclosureOpenIconTexture);\n\t\t\tdisclosureOpenIcon.selectedTexture = this.treeDisclosureOpenSelectedIconTexture;\n\t\t\titemRenderer.disclosureOpenIcon = disclosureOpenIcon;\n\n\t\t\tvar disclosureClosedIcon:ImageSkin = new ImageSkin(this.treeDisclosureClosedIconTexture);\n\t\t\tdisclosureClosedIcon.selectedTexture = this.treeDisclosureClosedSelectedIconTexture;\n\t\t\titemRenderer.disclosureClosedIcon = disclosureClosedIcon;\n\t\t}\n\n\t//-------------------------\n\t// VideoPlayer\n\t//-------------------------\n\n\t\tprotected function setVideoPlayerStyles(player:VideoPlayer):void\n\t\t{\n\t\t\tplayer.backgroundSkin = new Quad(1, 1, 0x000000);\n\t\t}\n\n\t//-------------------------\n\t// PlayPauseToggleButton\n\t//-------------------------\n\n\t\tprotected function setPlayPauseToggleButtonStyles(button:PlayPauseToggleButton):void\n\t\t{\n\t\t\tvar skin:Quad = new Quad(this.controlSize, this.controlSize);\n\t\t\tskin.alpha = 0;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.playPauseButtonPlayUpIconTexture);\n\t\t\ticon.selectedTexture = this.playPauseButtonPauseUpIconTexture;\n\t\t\ticon.setTextureForState(ButtonState.DOWN, this.playPauseButtonPlayDownIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.playPauseButtonPauseDownIconTexture);\n\t\t\tbutton.defaultIcon = icon;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setOverlayPlayPauseToggleButtonStyles(button:PlayPauseToggleButton):void\n\t\t{\n\t\t\tvar icon:ImageSkin = new ImageSkin(null);\n\t\t\ticon.setTextureForState(ButtonState.UP, this.overlayPlayPauseButtonPlayUpIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.HOVER, this.overlayPlayPauseButtonPlayUpIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DOWN, this.overlayPlayPauseButtonPlayDownIconTexture);\n\t\t\tbutton.setIconForState(ButtonState.UP, icon);\n\t\t\tbutton.setIconForState(ButtonState.HOVER, icon);\n\t\t\tbutton.setIconForState(ButtonState.DOWN, icon);\n\n\t\t\tvar defaultIcon:Quad = new Quad(1, 1, 0xff00ff);\n\t\t\tdefaultIcon.alpha = 0;\n\t\t\tbutton.defaultIcon = defaultIcon;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\n\t\t\tvar overlaySkin:Quad = new Quad(1, 1, VIDEO_OVERLAY_COLOR);\n\t\t\toverlaySkin.alpha = VIDEO_OVERLAY_ALPHA;\n\t\t\tbutton.upSkin = overlaySkin;\n\t\t\tbutton.hoverSkin = overlaySkin;\n\t\t}\n\n\t//-------------------------\n\t// FullScreenToggleButton\n\t//-------------------------\n\n\t\tprotected function setFullScreenToggleButtonStyles(button:FullScreenToggleButton):void\n\t\t{\n\t\t\tvar skin:Quad = new Quad(this.controlSize, this.controlSize);\n\t\t\tskin.alpha = 0;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.fullScreenToggleButtonEnterUpIconTexture);\n\t\t\ticon.selectedTexture = this.fullScreenToggleButtonExitUpIconTexture;\n\t\t\ticon.setTextureForState(ButtonState.DOWN, this.fullScreenToggleButtonEnterDownIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.fullScreenToggleButtonExitDownIconTexture);\n\t\t\tbutton.defaultIcon = icon;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\t\t}\n\n\t//-------------------------\n\t// VolumeSlider\n\t//-------------------------\n\n\t\tprotected function setVolumeSliderStyles(slider:VolumeSlider):void\n\t\t{\n\t\t\tslider.direction = Direction.HORIZONTAL;\n\t\t\tslider.trackLayoutMode = TrackLayoutMode.SPLIT;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tslider.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tslider.focusPadding = this.focusPaddingSize;\n\n\t\t\tslider.showThumb = false;\n\t\t}\n\n\t\tprotected function setVolumeSliderThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar thumbSize:Number = 6;\n\t\t\tvar defaultSkin:Quad = new Quad(thumbSize, thumbSize);\n\t\t\tdefaultSkin.width = 0;\n\t\t\tdefaultSkin.height = 0;\n\t\t\tthumb.defaultSkin = defaultSkin;\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVolumeSliderMinimumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar defaultSkin:ImageLoader = new ImageLoader();\n\t\t\tdefaultSkin.scaleContent = false;\n\t\t\tdefaultSkin.source = this.volumeSliderMinimumTrackSkinTexture;\n\t\t\ttrack.defaultSkin = defaultSkin;\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVolumeSliderMaximumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar defaultSkin:ImageLoader = new ImageLoader();\n\t\t\tdefaultSkin.scaleContent = false;\n\t\t\tdefaultSkin.horizontalAlign = HorizontalAlign.RIGHT;\n\t\t\tdefaultSkin.source = this.volumeSliderMaximumTrackSkinTexture;\n\t\t\ttrack.defaultSkin = defaultSkin;\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t//-------------------------\n\t// MuteToggleButton\n\t//-------------------------\n\n\t\tprotected function setMuteToggleButtonStyles(button:MuteToggleButton):void\n\t\t{\n\t\t\tvar skin:Quad = new Quad(this.controlSize, this.controlSize);\n\t\t\tskin.alpha = 0;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.muteToggleButtonLoudUpIconTexture);\n\t\t\ticon.selectedTexture = this.muteToggleButtonMutedUpIconTexture;\n\t\t\ticon.setTextureForState(ButtonState.DOWN, this.muteToggleButtonLoudDownIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.muteToggleButtonMutedDownIconTexture);\n\t\t\tbutton.defaultIcon = icon;\n\n\t\t\tbutton.showVolumeSliderOnHover = true;\n\t\t\tbutton.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setPopUpVolumeSliderStyles(slider:VolumeSlider):void\n\t\t{\n\t\t\tslider.direction = Direction.VERTICAL;\n\t\t\tslider.trackLayoutMode = TrackLayoutMode.SINGLE;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tslider.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tslider.focusPadding = this.focusPaddingSize;\n\n\t\t\tslider.minimumPadding = this.popUpVolumeSliderPaddingSize;\n\t\t\tslider.maximumPadding = this.popUpVolumeSliderPaddingSize;\n\t\t\tslider.customThumbStyleName = THEME_STYLE_NAME_POP_UP_VOLUME_SLIDER_THUMB;\n\t\t\tslider.customMinimumTrackStyleName = THEME_STYLE_NAME_POP_UP_VOLUME_SLIDER_MINIMUM_TRACK;\n\t\t}\n\n\t\tprotected function setPopUpVolumeSliderTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.popUpVolumeSliderTrackSkinTexture);\n\t\t\tskin.scale9Grid = VOLUME_SLIDER_TRACK_SCALE9_GRID;\n\t\t\tskin.width = this.gridSize;\n\t\t\tskin.height = this.wideControlSize;\n\t\t\ttrack.defaultSkin = skin;\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t//-------------------------\n\t// SeekSlider\n\t//-------------------------\n\n\t\tprotected function setSeekSliderStyles(slider:SeekSlider):void\n\t\t{\n\t\t\tslider.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tslider.showThumb = false;\n\t\t\tvar progressSkin:Image = new Image(this.seekSliderProgressSkinTexture);\n\t\t\tprogressSkin.scale9Grid = DEFAULT_SCALE9_GRID;\n\t\t\tprogressSkin.width = this.smallControlSize;\n\t\t\tprogressSkin.height = this.smallControlSize;\n\t\t\tslider.progressSkin = progressSkin;\n\t\t}\n\n\t\tprotected function setSeekSliderThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar thumbSize:Number = 6;\n\t\t\tvar defaultSkin:Quad = new Quad(thumbSize, thumbSize);\n\t\t\tdefaultSkin.width = 0;\n\t\t\tdefaultSkin.height = 0;\n\t\t\tthumb.defaultSkin = defaultSkin;\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setSeekSliderMinimumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar defaultSkin:ImageSkin = new ImageSkin(this.buttonUpSkinTexture);\n\t\t\tdefaultSkin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tdefaultSkin.width = this.wideControlSize;\n\t\t\tdefaultSkin.height = this.smallControlSize;\n\t\t\tdefaultSkin.minWidth = this.wideControlSize;\n\t\t\tdefaultSkin.minHeight = this.smallControlSize;\n\t\t\ttrack.defaultSkin = defaultSkin;\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setSeekSliderMaximumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar defaultSkin:ImageSkin = new ImageSkin(this.backgroundSkinTexture);\n\t\t\tdefaultSkin.scale9Grid = DEFAULT_SCALE9_GRID;\n\t\t\tdefaultSkin.width = this.wideControlSize;\n\t\t\tdefaultSkin.height = this.smallControlSize;\n\t\t\tdefaultSkin.minWidth = this.wideControlSize;\n\t\t\tdefaultSkin.minHeight = this.smallControlSize;\n\t\t\ttrack.defaultSkin = defaultSkin;\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "themes/MetalWorksDesktopTheme/source/feathers/themes/MetalWorksDesktopTheme.as",
    "content": "/*\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n*/\npackage feathers.themes\n{\n\timport flash.display.Bitmap;\n\timport flash.display.BitmapData;\n\n\timport starling.textures.Texture;\n\timport starling.textures.TextureAtlas;\n\n\t/**\n\t * The \"Metal Works\" theme for desktop Feathers apps.\n\t *\n\t * <p>This version of the theme embeds its assets. To load assets at\n\t * runtime, see <code>MetalWorksDesktopThemeWithAssetManager</code> instead.</p>\n\t *\n\t * @see http://feathersui.com/help/theme-assets.html\n\t */\n\tpublic class MetalWorksDesktopTheme extends BaseMetalWorksDesktopTheme\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\t[Embed(source=\"/../assets/images/metalworks_desktop.xml\",mimeType=\"application/octet-stream\")]\n\t\tprotected static const ATLAS_XML:Class;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\t[Embed(source=\"/../assets/images/metalworks_desktop.png\")]\n\t\tprotected static const ATLAS_BITMAP:Class;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const ATLAS_SCALE_FACTOR:int = 2;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function MetalWorksDesktopTheme()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.initialize();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tthis.initializeTextureAtlas();\n\t\t\tsuper.initialize();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function initializeTextureAtlas():void\n\t\t{\n\t\t\tvar atlasBitmapData:BitmapData = Bitmap(new ATLAS_BITMAP()).bitmapData;\n\t\t\tvar atlasTexture:Texture = Texture.fromBitmapData(atlasBitmapData, false, false, ATLAS_SCALE_FACTOR);\n\t\t\tatlasTexture.root.onRestore = this.atlasTexture_onRestore;\n\t\t\tatlasBitmapData.dispose();\n\t\t\tthis.atlas = new TextureAtlas(atlasTexture, XML(new ATLAS_XML()));\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function atlasTexture_onRestore():void\n\t\t{\n\t\t\tvar atlasBitmapData:BitmapData = Bitmap(new ATLAS_BITMAP()).bitmapData;\n\t\t\tthis.atlas.texture.root.uploadBitmapData(atlasBitmapData);\n\t\t\tatlasBitmapData.dispose();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "themes/MetalWorksDesktopTheme/source/feathers/themes/MetalWorksDesktopThemeWithAssetManager.as",
    "content": "/*\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n*/\npackage feathers.themes\n{\n\timport feathers.events.FeathersEventType;\n\n\timport starling.assets.AssetManager;\n\timport starling.core.Starling;\n\timport starling.events.Event;\n\n\t/**\n\t * @copy feathers.themes.IAsyncTheme#event:complete\n\t *\n\t * @eventType starling.events.Event.COMPLETE\n\t */\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the theme's assets fail to load due to an error.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The error string.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.ERROR\n\t */\n\t[Event(name=\"error\",type=\"starling.events.Event\")]\n\n\t/**\n\t * The \"Metal Works\" theme for desktop Feathers apps.\n\t *\n\t * <p>This version of the theme requires loading assets at runtime. To use\n\t * embedded assets, see <code>MetalWorksDesktopTheme</code> instead.</p>\n\t *\n\t * <p>To use this theme, the following files must be included when packaging\n\t * your app:</p>\n\t * <ul>\n\t *     <li>images/metalworks_desktop.png</li>\n\t *     <li>images/metalworks_desktop.xml</li>\n\t * </ul>\n\t *\n\t * @see http://feathersui.com/help/theme-assets.html\n\t */\n\tpublic class MetalWorksDesktopThemeWithAssetManager extends BaseMetalWorksDesktopTheme implements IAsyncTheme\n\t{\n\t\t/**\n\t\t * @private\n\t\t * The name of the texture atlas in the asset manager.\n\t\t */\n\t\tprotected static const ATLAS_NAME:String = \"metalworks_desktop\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const ATLAS_SCALE_FACTOR:int = 2;\n\n\t\t/**\n\t\t * Constructor.\n\t\t * @param assetsBasePath The root folder of the assets.\n\t\t * @param assetManager An optional pre-created AssetManager. The scaleFactor property must be equal to Starling.contentScaleFactor. To load assets with a different scale factor, use multiple AssetManager instances.\n\t\t */\n\t\tpublic function MetalWorksDesktopThemeWithAssetManager(assetsBasePath:String = \"./\", assetManager:AssetManager = null)\n\t\t{\n\t\t\tthis.loadAssets(assetsBasePath, assetManager);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * The paths to each of the assets, relative to the base path.\n\t\t */\n\t\tprotected var assetPaths:Vector.<String> = new <String>\n\t\t[\n\t\t\t\"images/\" + ATLAS_NAME + \".xml\",\n\t\t\t\"images/\" + ATLAS_NAME + \".png\"\n\t\t];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var assetManager:AssetManager;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var isComplete:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tsuper.dispose();\n\t\t\tif(this.assetManager)\n\t\t\t{\n\t\t\t\tthis.assetManager.removeTextureAtlas(ATLAS_NAME);\n\t\t\t\tthis.assetManager = null;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.themes.IAsyncTheme#isCompleteForStarling()\n\t\t */\n\t\tpublic function isCompleteForStarling(starling:Starling):Boolean\n\t\t{\n\t\t\treturn this.isComplete;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tthis.initializeTextureAtlas();\n\t\t\tsuper.initialize();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function initializeTextureAtlas():void\n\t\t{\n\t\t\tthis.atlas = this.assetManager.getTextureAtlas(ATLAS_NAME);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function loadAssets(assetsBasePath:String, assetManager:AssetManager):void\n\t\t{\n\t\t\tvar oldScaleFactor:Number = -1;\n\t\t\tif(assetManager)\n\t\t\t{\n\t\t\t\toldScaleFactor = assetManager.textureOptions.scale;\n\t\t\t\tassetManager.textureOptions.scale = ATLAS_SCALE_FACTOR;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tassetManager = new AssetManager(ATLAS_SCALE_FACTOR);\n\t\t\t}\n\t\t\tthis.assetManager = assetManager;\n\t\t\t//add a trailing slash, if needed\n\t\t\tif(assetsBasePath.lastIndexOf(\"/\") != assetsBasePath.length - 1)\n\t\t\t{\n\t\t\t\tassetsBasePath += \"/\";\n\t\t\t}\n\t\t\tvar assetPaths:Vector.<String> = this.assetPaths;\n\t\t\tvar assetCount:int = assetPaths.length;\n\t\t\tfor(var i:int = 0; i < assetCount; i++)\n\t\t\t{\n\t\t\t\tvar asset:String = assetPaths[i];\n\t\t\t\tthis.assetManager.enqueue(assetsBasePath + asset);\n\t\t\t}\n\t\t\tif(oldScaleFactor != -1)\n\t\t\t{\n\t\t\t\t//restore the old scale factor, just in case\n\t\t\t\tthis.assetManager.textureOptions.scale = oldScaleFactor;\n\t\t\t}\n\t\t\tthis.assetManager.loadQueue(assetManager_onComplete, assetManager_onError);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function assetManager_onComplete():void\n\t\t{\n\t\t\tthis.initialize();\n\t\t\tthis.isComplete = true;\n\t\t\tthis.dispatchEventWith(Event.COMPLETE, false, Starling.current);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function assetManager_onError(error:String):void\n\t\t{\n\t\t\tthis.dispatchEventWith(FeathersEventType.ERROR, false, error);\n\t\t}\n\t}\n}\n\n"
  },
  {
    "path": "themes/MetalWorksMobileTheme/README.md",
    "content": "# Metal Works Mobile Theme for Feathers\n\nThis [Feathers](http://feathersui.com/) theme for mobile devices combines an industrial aesthetic with bold orange highlights.\n\n## Original Artwork\n\nThis theme's texture atlas was exported from Adobe Animate CC. To modify colors and other properties, or to add new skins to the texture atlas, [download the source FLA file](http://feathersui.com/help/theme-sources.html) from the Feathers website.\n\n## Credits\n\nCreated exclusively for Feathers by [Josh Tynjala](https://joshblog.net/). Uses the open source font [Source Sans Pro](https://github.com/adobe/Source-Sans-Pro) created by Adobe Systems Incorporated.\n\n## Preview\n\nThe Metal Works Mobile Theme is used in the [Feathers Components Explorer](http://feathersui.com/examples/components-explorer/) example."
  },
  {
    "path": "themes/MetalWorksMobileTheme/assets/images/metalworks_mobile.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<TextureAtlas imagePath=\"metalworks_mobile.png\">\n\t<!-- Created with Adobe Animate version 18.0.2.126 -->\n\t<!-- http://www.adobe.com/products/animate.html -->\n\t<SubTexture name=\"back-button-disabled-skin0000\" x=\"395\" y=\"178\" width=\"37\" height=\"56\" pivotX=\"0.1\" pivotY=\"0\"/>\n\t<SubTexture name=\"back-button-down-skin0000\" x=\"163\" y=\"356\" width=\"37\" height=\"56\" pivotX=\"0.1\" pivotY=\"0\"/>\n\t<SubTexture name=\"back-button-up-skin0000\" x=\"424\" y=\"121\" width=\"37\" height=\"56\" pivotX=\"0.1\" pivotY=\"0\"/>\n\t<SubTexture name=\"background-danger-border-skin0000\" x=\"471\" y=\"212\" width=\"10\" height=\"10\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"background-dark-border-skin0000\" x=\"69\" y=\"475\" width=\"10\" height=\"10\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"background-disabled-skin0000\" x=\"130\" y=\"489\" width=\"18\" height=\"18\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"background-focused-skin0000\" x=\"149\" y=\"489\" width=\"18\" height=\"18\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"background-inset-danger-skin0000\" x=\"459\" y=\"473\" width=\"18\" height=\"18\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"background-inset-disabled-skin0000\" x=\"407\" y=\"466\" width=\"18\" height=\"18\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"background-inset-skin0000\" x=\"111\" y=\"489\" width=\"18\" height=\"18\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"background-light-border-skin0000\" x=\"374\" y=\"356\" width=\"10\" height=\"10\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"background-skin0000\" x=\"92\" y=\"489\" width=\"18\" height=\"18\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-disabled-skin0000\" x=\"270\" y=\"455\" width=\"18\" height=\"56\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-down-skin0000\" x=\"289\" y=\"455\" width=\"18\" height=\"56\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-up-skin0000\" x=\"251\" y=\"455\" width=\"18\" height=\"56\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"call-to-action-button-down-skin0000\" x=\"232\" y=\"455\" width=\"18\" height=\"56\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"call-to-action-button-up-skin0000\" x=\"308\" y=\"455\" width=\"18\" height=\"56\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"callout-arrow-bottom-skin0000\" x=\"163\" y=\"413\" width=\"40\" height=\"26\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"callout-arrow-left-skin0000\" x=\"485\" y=\"296\" width=\"26\" height=\"40\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"callout-arrow-right-skin0000\" x=\"485\" y=\"254\" width=\"26\" height=\"41\" pivotX=\"0.05\" pivotY=\"0\"/>\n\t<SubTexture name=\"callout-arrow-top-skin0000\" x=\"273\" y=\"401\" width=\"40\" height=\"26\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"check-disabled-icon0000\" x=\"35\" y=\"475\" width=\"33\" height=\"33\" pivotX=\"-0.05\" pivotY=\"-0.05\"/>\n\t<SubTexture name=\"check-down-icon0000\" x=\"204\" y=\"413\" width=\"32\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"check-selected-disabled-icon0000\" x=\"1\" y=\"475\" width=\"33\" height=\"33\" pivotX=\"-0.05\" pivotY=\"-0.05\"/>\n\t<SubTexture name=\"check-selected-down-icon0000\" x=\"374\" y=\"409\" width=\"32\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"check-selected-up-icon0000\" x=\"422\" y=\"367\" width=\"33\" height=\"33\" pivotX=\"-0.05\" pivotY=\"-0.05\"/>\n\t<SubTexture name=\"check-up-icon0000\" x=\"471\" y=\"178\" width=\"33\" height=\"33\" pivotX=\"-0.05\" pivotY=\"-0.05\"/>\n\t<SubTexture name=\"danger-button-down-skin0000\" x=\"490\" y=\"337\" width=\"18\" height=\"56\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-button-up-skin0000\" x=\"355\" y=\"401\" width=\"18\" height=\"57\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-callout-arrow-bottom-skin0000\" x=\"314\" y=\"401\" width=\"40\" height=\"26\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-callout-arrow-left-skin0000\" x=\"172\" y=\"440\" width=\"26\" height=\"40\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-callout-arrow-right-skin0000\" x=\"485\" y=\"212\" width=\"26\" height=\"41\" pivotX=\"0.05\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-callout-arrow-top-skin0000\" x=\"273\" y=\"428\" width=\"40\" height=\"26\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-column-drop-indicator-skin0000\" x=\"491\" y=\"436\" width=\"6\" height=\"60\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-column-resize-skin0000\" x=\"491\" y=\"436\" width=\"6\" height=\"60\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-header-divider-skin0000\" x=\"482\" y=\"280\" width=\"2\" height=\"10\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-header-sort-ascending-icon0000\" x=\"456\" y=\"492\" width=\"17\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-header-sort-descending-icon0000\" x=\"438\" y=\"490\" width=\"17\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-vertical-divider-skin0000\" x=\"404\" y=\"473\" width=\"2\" height=\"10\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"drag-handle-icon0000\" x=\"374\" y=\"442\" width=\"32\" height=\"30\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"first-inset-item-renderer-selected-up-skin0000\" x=\"475\" y=\"1\" width=\"30\" height=\"88\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"first-inset-item-renderer-up-skin0000\" x=\"364\" y=\"178\" width=\"30\" height=\"88\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"focus-indicator-skin0000\" x=\"69\" y=\"489\" width=\"22\" height=\"22\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"forward-button-disabled-skin0000\" x=\"201\" y=\"356\" width=\"37\" height=\"56\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"forward-button-down-skin0000\" x=\"433\" y=\"178\" width=\"37\" height=\"56\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"forward-button-up-skin0000\" x=\"462\" y=\"121\" width=\"37\" height=\"56\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"full-screen-toggle-button-enter-down-icon0000\" x=\"284\" y=\"356\" width=\"44\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"full-screen-toggle-button-enter-up-icon0000\" x=\"239\" y=\"356\" width=\"44\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"full-screen-toggle-button-exit-down-icon0000\" x=\"329\" y=\"356\" width=\"44\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"full-screen-toggle-button-exit-up-icon0000\" x=\"395\" y=\"235\" width=\"44\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"grouped-list-header-background-skin0000\" x=\"498\" y=\"436\" width=\"10\" height=\"10\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"header-background-skin0000\" x=\"1\" y=\"1\" width=\"260\" height=\"132\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"header-popup-background-skin0000\" x=\"1\" y=\"134\" width=\"260\" height=\"132\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-scroll-bar-decrement-button-disabled-icon0000\" x=\"505\" y=\"188\" width=\"6\" height=\"8\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-scroll-bar-decrement-button-icon0000\" x=\"505\" y=\"197\" width=\"6\" height=\"8\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-scroll-bar-increment-button-disabled-icon0000\" x=\"505\" y=\"179\" width=\"6\" height=\"8\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-scroll-bar-increment-button-icon0000\" x=\"404\" y=\"502\" width=\"6\" height=\"8\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-simple-scroll-bar-thumb-skin0000\" x=\"168\" y=\"498\" width=\"24\" height=\"10\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"inset-item-renderer-selected-up-skin0000\" x=\"426\" y=\"401\" width=\"10\" height=\"88\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"inset-item-renderer-up-skin0000\" x=\"437\" y=\"401\" width=\"10\" height=\"88\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"item-renderer-drill-down-accessory-icon0000\" x=\"346\" y=\"459\" width=\"17\" height=\"25\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"item-renderer-drill-down-accessory-selected-icon0000\" x=\"352\" y=\"485\" width=\"17\" height=\"25\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"item-renderer-selected-up-skin0000\" x=\"505\" y=\"90\" width=\"6\" height=\"88\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"item-renderer-up-skin0000\" x=\"484\" y=\"398\" width=\"6\" height=\"88\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"last-inset-item-renderer-selected-up-skin0000\" x=\"265\" y=\"267\" width=\"30\" height=\"88\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"last-inset-item-renderer-up-skin0000\" x=\"296\" y=\"267\" width=\"30\" height=\"88\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"list-background-skin0000\" x=\"404\" y=\"485\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"mute-toggle-button-loud-down-icon0000\" x=\"434\" y=\"280\" width=\"47\" height=\"41\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"mute-toggle-button-loud-up-icon0000\" x=\"389\" y=\"325\" width=\"47\" height=\"41\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"mute-toggle-button-muted-down-icon0000\" x=\"437\" y=\"322\" width=\"47\" height=\"41\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"mute-toggle-button-muted-up-icon0000\" x=\"374\" y=\"367\" width=\"47\" height=\"41\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"overlay-play-pause-toggle-button-play-down-icon0000\" x=\"1\" y=\"267\" width=\"161\" height=\"176\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"overlay-play-pause-toggle-button-play-up-icon0000\" x=\"262\" y=\"1\" width=\"161\" height=\"176\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"page-indicator-disabled-symbol0000\" x=\"254\" y=\"435\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"page-indicator-selected-disabled-symbol0000\" x=\"172\" y=\"481\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"page-indicator-selected-symbol0000\" x=\"370\" y=\"490\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"page-indicator-symbol0000\" x=\"370\" y=\"473\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"picker-list-button-disabled-icon0000\" x=\"387\" y=\"473\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"picker-list-button-icon0000\" x=\"387\" y=\"490\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"picker-list-button-selected-icon0000\" x=\"237\" y=\"435\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"picker-list-item-renderer-selected-icon0000\" x=\"199\" y=\"479\" width=\"32\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"play-pause-toggle-button-pause-down-icon0000\" x=\"82\" y=\"444\" width=\"44\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"play-pause-toggle-button-pause-up-icon0000\" x=\"389\" y=\"280\" width=\"44\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"play-pause-toggle-button-play-down-icon0000\" x=\"127\" y=\"444\" width=\"44\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"play-pause-toggle-button-play-up-icon0000\" x=\"440\" y=\"235\" width=\"44\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"radio-selected-disabled-icon0000\" x=\"239\" y=\"401\" width=\"33\" height=\"33\" pivotX=\"-0.05\" pivotY=\"-0.05\"/>\n\t<SubTexture name=\"radio-selected-down-icon0000\" x=\"199\" y=\"446\" width=\"32\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"radio-selected-up-icon0000\" x=\"456\" y=\"364\" width=\"33\" height=\"33\" pivotX=\"-0.05\" pivotY=\"-0.05\"/>\n\t<SubTexture name=\"search-disabled-icon0000\" x=\"491\" y=\"394\" width=\"20\" height=\"20\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"search-icon0000\" x=\"491\" y=\"415\" width=\"20\" height=\"20\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"seek-slider-progress-skin0000\" x=\"421\" y=\"490\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"single-inset-item-renderer-selected-up-skin0000\" x=\"327\" y=\"267\" width=\"30\" height=\"88\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"single-inset-item-renderer-up-skin0000\" x=\"358\" y=\"267\" width=\"30\" height=\"88\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"spinner-list-selection-overlay-skin0000\" x=\"448\" y=\"401\" width=\"10\" height=\"88\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tab-disabled-skin0000\" x=\"262\" y=\"178\" width=\"50\" height=\"88\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tab-down-skin0000\" x=\"163\" y=\"267\" width=\"50\" height=\"88\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tab-selected-disabled-skin0000\" x=\"424\" y=\"1\" width=\"50\" height=\"88\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tab-selected-up-skin0000\" x=\"214\" y=\"267\" width=\"50\" height=\"88\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tab-up-skin0000\" x=\"313\" y=\"178\" width=\"50\" height=\"88\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"toggle-button-selected-disabled-skin0000\" x=\"327\" y=\"428\" width=\"18\" height=\"56\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"toggle-button-selected-up-skin0000\" x=\"407\" y=\"409\" width=\"18\" height=\"56\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tree-disclosure-closed-icon0000\" x=\"459\" y=\"398\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tree-disclosure-closed-selected-icon0000\" x=\"459\" y=\"423\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tree-disclosure-open-icon0000\" x=\"327\" y=\"485\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tree-disclosure-open-selected-icon0000\" x=\"459\" y=\"448\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-scroll-bar-decrement-button-disabled-icon0000\" x=\"346\" y=\"449\" width=\"8\" height=\"6\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-scroll-bar-decrement-button-icon0000\" x=\"346\" y=\"428\" width=\"8\" height=\"6\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-scroll-bar-increment-button-disabled-icon0000\" x=\"346\" y=\"435\" width=\"8\" height=\"6\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-scroll-bar-increment-button-icon0000\" x=\"346\" y=\"442\" width=\"8\" height=\"6\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-simple-scroll-bar-thumb-skin0000\" x=\"314\" y=\"428\" width=\"10\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"volume-slider-maximum-track-skin0000\" x=\"1\" y=\"444\" width=\"80\" height=\"30\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"volume-slider-minimum-track-skin0000\" x=\"424\" y=\"90\" width=\"80\" height=\"30\" pivotX=\"0\" pivotY=\"0\"/>\n</TextureAtlas>\n"
  },
  {
    "path": "themes/MetalWorksMobileTheme/package-src.json",
    "content": "{\n\t\"id\": \"feathersui_MetalWorksMobileTheme-source\",\n\t\"name\": \"Feathers UI Metal Works Mobile Theme\",\n\t\"url\": \"https://feathersui.com/as3-starling/\",\n\t\"docUrl\": \"https://feathersui/api-reference/\",\n\t\"description\": \"Metal Works mobile theme for Feathers UI (Starling version)\",\n\t\"type\": \"src\",\n\t\"version\": \"4.2.0\",\n\t\"sourceUrl\": \"https://github.com/feathersui/feathersui-starling/releases/download/v4.2.0/feathersui_MetalWorksMobileTheme-source_4.2.0.airpackage\",\n\t\"publishedAt\": \"2021-11-19T00:00:00.000Z\",\n\t\"dependencies\": [\n\t\t\"starling-source:2.x.x\",\n\t\t\"feathersui-source:4.2.x\"\n\t],\n\t\"parameters\": [],\n\t\"tags\": [\"theme\", \"feathers\", \"starling\"],\n\t\"status\": \"release\",\n\t\"license\": {\n\t  \"type\": \"Simplified BSD\",\n\t  \"url\": \"https://github.com/feathersui/feathersui-starling/blob/v4.2.0/LICENSE.md\",\n\t  \"public\": true\n\t}\n  }\n  "
  },
  {
    "path": "themes/MetalWorksMobileTheme/package-swc.json",
    "content": "{\n\t\"id\": \"feathersui_MetalWorksMobileTheme\",\n\t\"name\": \"Feathers UI Metal Works Mobile Theme\",\n\t\"url\": \"https://feathersui.com/as3-starling/\",\n\t\"docUrl\": \"https://feathersui/api-reference/\",\n\t\"description\": \"Metal Works mobile theme for Feathers UI (Starling version)\",\n\t\"type\": \"swc\",\n\t\"version\": \"4.2.0\",\n\t\"sourceUrl\": \"https://github.com/feathersui/feathersui-starling/releases/download/v4.2.0/feathersui_MetalWorksMobileTheme_4.2.0.airpackage\",\n\t\"publishedAt\": \"2021-11-19T00:00:00.000Z\",\n\t\"dependencies\": [\n\t\t\"starling:2.x.x\",\n\t\t\"feathersui:4.2.x\"\n\t],\n\t\"parameters\": [],\n\t\"tags\": [\"theme\", \"feathers\", \"starling\"],\n\t\"status\": \"release\",\n\t\"license\": {\n\t  \"type\": \"Simplified BSD\",\n\t  \"url\": \"https://github.com/feathersui/feathersui-starling/blob/v4.2.0/LICENSE.md\",\n\t  \"public\": true\n\t}\n  }\n  "
  },
  {
    "path": "themes/MetalWorksMobileTheme/source/feathers/themes/BaseMetalWorksMobileTheme.as",
    "content": "/*\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n*/\npackage feathers.themes\n{\n\timport feathers.controls.Alert;\n\timport feathers.controls.AutoComplete;\n\timport feathers.controls.Button;\n\timport feathers.controls.ButtonGroup;\n\timport feathers.controls.ButtonState;\n\timport feathers.controls.Callout;\n\timport feathers.controls.Check;\n\timport feathers.controls.DateTimeSpinner;\n\timport feathers.controls.Drawers;\n\timport feathers.controls.GroupedList;\n\timport feathers.controls.Header;\n\timport feathers.controls.ImageLoader;\n\timport feathers.controls.ItemRendererLayoutOrder;\n\timport feathers.controls.Label;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.List;\n\timport feathers.controls.NumericStepper;\n\timport feathers.controls.PageIndicator;\n\timport feathers.controls.Panel;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.PickerList;\n\timport feathers.controls.ProgressBar;\n\timport feathers.controls.Radio;\n\timport feathers.controls.ScrollContainer;\n\timport feathers.controls.ScrollScreen;\n\timport feathers.controls.ScrollText;\n\timport feathers.controls.Scroller;\n\timport feathers.controls.SimpleScrollBar;\n\timport feathers.controls.Slider;\n\timport feathers.controls.SpinnerList;\n\timport feathers.controls.StepperButtonLayoutMode;\n\timport feathers.controls.TabBar;\n\timport feathers.controls.TextArea;\n\timport feathers.controls.TextCallout;\n\timport feathers.controls.TextInput;\n\timport feathers.controls.TextInputState;\n\timport feathers.controls.ToggleButton;\n\timport feathers.controls.ToggleSwitch;\n\timport feathers.controls.TrackLayoutMode;\n\timport feathers.controls.Tree;\n\timport feathers.controls.popups.BottomDrawerPopUpContentManager;\n\timport feathers.controls.popups.CalloutPopUpContentManager;\n\timport feathers.controls.renderers.BaseDefaultItemRenderer;\n\timport feathers.controls.renderers.DefaultGroupedListHeaderOrFooterRenderer;\n\timport feathers.controls.renderers.DefaultGroupedListItemRenderer;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.renderers.DefaultTreeItemRenderer;\n\timport feathers.controls.text.ITextEditorViewPort;\n\timport feathers.controls.text.StageTextTextEditor;\n\timport feathers.controls.text.TextBlockTextEditor;\n\timport feathers.controls.text.TextBlockTextRenderer;\n\timport feathers.controls.text.TextFieldTextEditorViewPort;\n\timport feathers.core.FeathersControl;\n\timport feathers.core.ITextEditor;\n\timport feathers.core.ITextRenderer;\n\timport feathers.core.PopUpManager;\n\timport feathers.layout.Direction;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.HorizontalLayout;\n\timport feathers.layout.RelativePosition;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.media.FullScreenToggleButton;\n\timport feathers.media.MuteToggleButton;\n\timport feathers.media.PlayPauseToggleButton;\n\timport feathers.media.SeekSlider;\n\timport feathers.media.VolumeSlider;\n\timport feathers.skins.ImageSkin;\n\timport feathers.system.DeviceCapabilities;\n\n\timport flash.geom.Rectangle;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.Image;\n\timport starling.display.Quad;\n\timport starling.text.TextFormat;\n\timport starling.textures.Texture;\n\timport starling.textures.TextureAtlas;\n\timport feathers.core.FocusManager;\n\timport starling.display.Stage;\n\timport feathers.controls.DataGrid;\n\timport feathers.controls.renderers.DefaultDataGridHeaderRenderer;\n\timport feathers.controls.renderers.DefaultDataGridCellRenderer;\n\timport feathers.controls.Toast;\n\timport feathers.controls.AutoSizeMode;\n\timport starling.display.DisplayObjectContainer;\n\n\t/**\n\t * The base class for the \"Metal Works\" theme for mobile Feathers apps.\n\t * Handles everything except asset loading, which is left to subclasses.\n\t *\n\t * @see MetalWorksMobileTheme\n\t * @see MetalWorksMobileThemeWithAssetManager\n\t */\n\tpublic class BaseMetalWorksMobileTheme extends StyleNameFunctionTheme\n\t{\n\t\t[Embed(source=\"/../assets/fonts/SourceSansPro-Regular.ttf\",fontFamily=\"SourceSansPro\",fontWeight=\"normal\",mimeType=\"application/x-font\",embedAsCFF=\"true\")]\n\t\tprotected static const SOURCE_SANS_PRO_REGULAR:Class;\n\n\t\t[Embed(source=\"/../assets/fonts/SourceSansPro-Semibold.ttf\",fontFamily=\"SourceSansPro\",fontWeight=\"bold\",mimeType=\"application/x-font\",embedAsCFF=\"true\")]\n\t\tprotected static const SOURCE_SANS_PRO_SEMIBOLD:Class;\n\n\t\t/**\n\t\t * The name of the embedded font used by controls in this theme. Comes\n\t\t * in normal and bold weights.\n\t\t */\n\t\tpublic static const FONT_NAME:String = \"SourceSansPro\";\n\n\t\t/**\n\t\t * The stack of fonts to use for controls that don't use embedded fonts.\n\t\t */\n\t\tpublic static const FONT_NAME_STACK:String = \"Source Sans Pro,Helvetica,_sans\";\n\n\t\tprotected static const PRIMARY_BACKGROUND_COLOR:uint = 0x4a4137;\n\t\tprotected static const LIGHT_TEXT_COLOR:uint = 0xe5e5e5;\n\t\tprotected static const DARK_TEXT_COLOR:uint = 0x1a1816;\n\t\tprotected static const SELECTED_TEXT_COLOR:uint = 0xff9900;\n\t\tprotected static const LIGHT_DISABLED_TEXT_COLOR:uint = 0x8a8a8a;\n\t\tprotected static const DARK_DISABLED_TEXT_COLOR:uint = 0x383430;\n\t\tprotected static const LIST_BACKGROUND_COLOR:uint = 0x383430;\n\t\tprotected static const GROUPED_LIST_HEADER_BACKGROUND_COLOR:uint = 0x2e2a26;\n\t\tprotected static const GROUPED_LIST_FOOTER_BACKGROUND_COLOR:uint = 0x2e2a26;\n\t\tprotected static const MODAL_OVERLAY_COLOR:uint = 0x29241e;\n\t\tprotected static const MODAL_OVERLAY_ALPHA:Number = 0.8;\n\t\tprotected static const DRAWER_OVERLAY_COLOR:uint = 0x29241e;\n\t\tprotected static const DRAWER_OVERLAY_ALPHA:Number = 0.4;\n\t\tprotected static const VIDEO_OVERLAY_COLOR:uint = 0x1a1816;\n\t\tprotected static const VIDEO_OVERLAY_ALPHA:Number = 0.2;\n\t\tprotected static const DATA_GRID_COLUMN_OVERLAY_COLOR:uint = 0x383430;\n\t\tprotected static const DATA_GRID_COLUMN_OVERLAY_ALPHA:Number = 0.4;\n\n\t\tprotected static const DEFAULT_BACKGROUND_SCALE9_GRID:Rectangle = new Rectangle(4, 4, 1, 1);\n\t\tprotected static const BUTTON_SCALE9_GRID:Rectangle = new Rectangle(4, 4, 1, 20);\n\t\tprotected static const SMALL_BACKGROUND_SCALE9_GRID:Rectangle = new Rectangle(2, 2, 1, 1);\n\t\tprotected static const BACK_BUTTON_SCALE9_GRID:Rectangle = new Rectangle(13, 0, 1, 28);\n\t\tprotected static const FORWARD_BUTTON_SCALE9_GRID:Rectangle = new Rectangle(3, 0, 1, 28);\n\t\tprotected static const ITEM_RENDERER_SCALE9_GRID:Rectangle = new Rectangle(1, 1, 1, 42);\n\t\tprotected static const INSET_ITEM_RENDERER_MIDDLE_SCALE9_GRID:Rectangle = new Rectangle(2, 2, 1, 40);\n\t\tprotected static const INSET_ITEM_RENDERER_FIRST_SCALE9_GRID:Rectangle = new Rectangle(7, 7, 1, 35);\n\t\tprotected static const INSET_ITEM_RENDERER_LAST_SCALE9_GRID:Rectangle = new Rectangle(7, 2, 1, 35);\n\t\tprotected static const INSET_ITEM_RENDERER_SINGLE_SCALE9_GRID:Rectangle = new Rectangle(7, 7, 1, 30);\n\t\tprotected static const TAB_SCALE9_GRID:Rectangle = new Rectangle(11, 11, 1, 22);\n\t\tprotected static const SPINNER_LIST_SELECTION_OVERLAY_SCALE9_GRID:Rectangle = new Rectangle(2, 6, 1, 32);\n\t\tprotected static const HORIZONTAL_SCROLL_BAR_THUMB_SCALE9_GRID:Rectangle = new Rectangle(4, 0, 4, 5);\n\t\tprotected static const VERTICAL_SCROLL_BAR_THUMB_SCALE9_GRID:Rectangle = new Rectangle(0, 4, 5, 4);\n\t\tprotected static const FOCUS_INDICATOR_SCALE_9_GRID:Rectangle = new Rectangle(5, 5, 1, 1);\n\t\tprotected static const DATA_GRID_HEADER_DIVIDER_SCALE_9_GRID:Rectangle = new Rectangle(0, 1, 2, 4);\n\t\tprotected static const DATA_GRID_VERTICAL_DIVIDER_SCALE_9_GRID:Rectangle = new Rectangle(0, 1, 1, 4);\n\t\tprotected static const DATA_GRID_COLUMN_RESIZE_SCALE_9_GRID:Rectangle = new Rectangle(0, 1, 3, 28);\n\t\tprotected static const DATA_GRID_COLUMN_DROP_INDICATOR_SCALE_9_GRID:Rectangle = new Rectangle(0, 1, 3, 28);\n\n\t\tprotected static const HEADER_SKIN_TEXTURE_REGION:Rectangle = new Rectangle(1, 1, 128, 64);\n\t\tprotected static const TAB_SKIN_TEXTURE_REGION:Rectangle = new Rectangle(1, 0, 22, 44);\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for item renderers in a SpinnerList.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_SPINNER_LIST_ITEM_RENDERER:String = \"metal-works-mobile-spinner-list-item-renderer\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for item renderers in a PickerList.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_TABLET_PICKER_LIST_ITEM_RENDERER:String = \"metal-works-mobile-tablet-picker-list-item-renderer\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for buttons in an Alert's button group.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_ALERT_BUTTON_GROUP_BUTTON:String = \"metal-works-mobile-alert-button-group-button\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the thumb of a horizontal SimpleScrollBar.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_HORIZONTAL_SIMPLE_SCROLL_BAR_THUMB:String = \"metal-works-mobile-horizontal-simple-scroll-bar-thumb\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the thumb of a vertical SimpleScrollBar.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_VERTICAL_SIMPLE_SCROLL_BAR_THUMB:String = \"metal-works-mobile-vertical-simple-scroll-bar-thumb\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the minimum track of a horizontal slider.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_HORIZONTAL_SLIDER_MINIMUM_TRACK:String = \"metal-works-mobile-horizontal-slider-minimum-track\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the maximum track of a horizontal slider.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_HORIZONTAL_SLIDER_MAXIMUM_TRACK:String = \"metal-works-mobile-horizontal-slider-maximum-track\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the minimum track of a vertical slider.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_VERTICAL_SLIDER_MINIMUM_TRACK:String = \"metal-works-mobile-vertical-slider-minimum-track\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the maximum track of a vertical slider.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_VERTICAL_SLIDER_MAXIMUM_TRACK:String = \"metal-works-mobile-vertical-slider-maximum-track\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the item renderer of the DateTimeSpinner's SpinnerLists.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_DATE_TIME_SPINNER_LIST_ITEM_RENDERER:String = \"metal-works-mobile-date-time-spinner-list-item-renderer\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the action buttons of a toast.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_TOAST_ACTIONS_BUTTON:String = \"metal-works-mobile-toast-actions-button\";\n\n\t\t/**\n\t\t * The default global text renderer factory for this theme creates a\n\t\t * TextBlockTextRenderer.\n\t\t */\n\t\tprotected static function textRendererFactory():ITextRenderer\n\t\t{\n\t\t\treturn new TextBlockTextRenderer();\n\t\t}\n\n\t\t/**\n\t\t * The default global text editor factory for this theme creates a\n\t\t * StageTextTextEditor.\n\t\t */\n\t\tprotected static function textEditorFactory():ITextEditor\n\t\t{\n\t\t\treturn new StageTextTextEditor();\n\t\t}\n\n\t\t/**\n\t\t * The text editor factory for a TextArea creates a\n\t\t * TextFieldTextEditorViewPort.\n\t\t */\n\t\tprotected static function textAreaTextEditorFactory():ITextEditorViewPort\n\t\t{\n\t\t\treturn new TextFieldTextEditorViewPort();\n\t\t}\n\n\t\t/**\n\t\t * The text editor factory for a NumericStepper creates a\n\t\t * TextBlockTextEditor.\n\t\t */\n\t\tprotected static function stepperTextEditorFactory():TextBlockTextEditor\n\t\t{\n\t\t\t//we're only using this text editor in the NumericStepper because\n\t\t\t//isEditable is false on the TextInput. this text editor is not\n\t\t\t//suitable for mobile use if the TextInput needs to be editable\n\t\t\t//because it can't use the soft keyboard or other mobile-friendly UI\n\t\t\treturn new TextBlockTextEditor();\n\t\t}\n\n\t\t/**\n\t\t * The pop-up factory for a PickerList creates a SpinnerList.\n\t\t */\n\t\tprotected static function pickerListSpinnerListFactory():SpinnerList\n\t\t{\n\t\t\treturn new SpinnerList();\n\t\t}\n\n\t\t/**\n\t\t * This theme's scroll bar type is SimpleScrollBar.\n\t\t */\n\t\tprotected static function scrollBarFactory():SimpleScrollBar\n\t\t{\n\t\t\treturn new SimpleScrollBar();\n\t\t}\n\n\t\tprotected static function popUpOverlayFactory():DisplayObject\n\t\t{\n\t\t\tvar quad:Quad = new Quad(100, 100, MODAL_OVERLAY_COLOR);\n\t\t\tquad.alpha = MODAL_OVERLAY_ALPHA;\n\t\t\treturn quad;\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function BaseMetalWorksMobileTheme()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * A smaller font size for details.\n\t\t */\n\t\tprotected var smallFontSize:int = 10;\n\n\t\t/**\n\t\t * A normal font size.\n\t\t */\n\t\tprotected var regularFontSize:int = 12;\n\n\t\t/**\n\t\t * A larger font size for headers.\n\t\t */\n\t\tprotected var largeFontSize:int = 14;\n\n\t\t/**\n\t\t * An extra large font size.\n\t\t */\n\t\tprotected var extraLargeFontSize:int = 18;\n\n\t\t/**\n\t\t * The size, in pixels, of major regions in the grid. Used for sizing\n\t\t * containers and larger UI controls.\n\t\t */\n\t\tprotected var gridSize:int = 44;\n\n\t\t/**\n\t\t * The size, in pixels, of minor regions in the grid. Used for larger\n\t\t * padding and gaps.\n\t\t */\n\t\tprotected var gutterSize:int = 12;\n\n\t\t/**\n\t\t * The size, in pixels, of smaller padding and gaps within the major\n\t\t * regions in the grid.\n\t\t */\n\t\tprotected var smallGutterSize:int = 8;\n\n\t\t/**\n\t\t * The size, in pixels, of smaller padding and gaps within controls.\n\t\t */\n\t\tprotected var smallControlGutterSize:int = 6;\n\n\t\t/**\n\t\t * The width, in pixels, of UI controls that span across multiple grid regions.\n\t\t */\n\t\tprotected var wideControlSize:int = 156;\n\n\t\t/**\n\t\t * The size, in pixels, of a typical UI control.\n\t\t */\n\t\tprotected var controlSize:int = 28;\n\n\t\t/**\n\t\t * The size, in pixels, of smaller UI controls.\n\t\t */\n\t\tprotected var smallControlSize:int = 12;\n\n\t\t/**\n\t\t * The size, in pixels, of borders;\n\t\t */\n\t\tprotected var borderSize:int = 1;\n\n\t\tprotected var popUpFillSize:int = 276;\n\t\tprotected var calloutBackgroundMinSize:int = 12;\n\t\tprotected var calloutArrowOverlapGap:int = -2;\n\t\tprotected var scrollBarGutterSize:int = 2;\n\t\tprotected var focusPaddingSize:int = -1;\n\t\tprotected var tabFocusPaddingSize:int = 4;\n\n\t\t/**\n\t\t * The font styles for standard-sized, light text.\n\t\t */\n\t\tprotected var lightFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for standard-sized, dark text.\n\t\t */\n\t\tprotected var darkFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for standard-sized, selected text.\n\t\t */\n\t\tprotected var selectedFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for standard-sized, light, disabled text.\n\t\t */\n\t\tprotected var lightDisabledFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for small, light text.\n\t\t */\n\t\tprotected var smallLightFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for small, light, disabled text.\n\t\t */\n\t\tprotected var smallLightDisabledFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for large, light text.\n\t\t */\n\t\tprotected var largeLightFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for large, dark text.\n\t\t */\n\t\tprotected var largeDarkFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for large, light, disabled text.\n\t\t */\n\t\tprotected var largeLightDisabledFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for light UI text.\n\t\t */\n\t\tprotected var lightUIFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for dark UI text.\n\t\t */\n\t\tprotected var darkUIFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for selected UI text.\n\t\t */\n\t\tprotected var selectedUIFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for light, centered UI text.\n\t\t */\n\t\tprotected var lightCenteredUIFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for light, centered, disabled UI text.\n\t\t */\n\t\tprotected var lightCenteredDisabledUIFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for light disabled UI text.\n\t\t */\n\t\tprotected var lightDisabledUIFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for dark, disabled UI text.\n\t\t */\n\t\tprotected var darkDisabledUIFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for large, light UI text.\n\t\t */\n\t\tprotected var largeLightUIFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for large, dark UI text.\n\t\t */\n\t\tprotected var largeDarkUIFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for large, selected UI text.\n\t\t */\n\t\tprotected var largeSelectedUIFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for large, light, disabled UI text.\n\t\t */\n\t\tprotected var largeLightUIDisabledFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for large, dark, disabled UI text.\n\t\t */\n\t\tprotected var largeDarkUIDisabledFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for extra-large, light UI text.\n\t\t */\n\t\tprotected var xlargeLightUIFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for extra-large, light, disabled UI text.\n\t\t */\n\t\tprotected var xlargeLightUIDisabledFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for standard-sized, light text for a text input.\n\t\t */\n\t\tprotected var lightInputFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The font styles for standard-sized, light, disabled text for a text input.\n\t\t */\n\t\tprotected var lightDisabledInputFontStyles:TextFormat;\n\n\t\t/**\n\t\t * ScrollText uses TextField instead of FTE, so it has a separate TextFormat.\n\t\t */\n\t\tprotected var lightScrollTextFontStyles:TextFormat;\n\n\t\t/**\n\t\t * ScrollText uses TextField instead of FTE, so it has a separate disabled TextFormat.\n\t\t */\n\t\tprotected var lightDisabledScrollTextFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The texture atlas that contains skins for this theme. This base class\n\t\t * does not initialize this member variable. Subclasses are expected to\n\t\t * load the assets somehow and set the <code>atlas</code> member\n\t\t * variable before calling <code>initialize()</code>.\n\t\t */\n\t\tprotected var atlas:TextureAtlas;\n\n\t\tprotected var focusIndicatorSkinTexture:Texture;\n\t\tprotected var headerBackgroundSkinTexture:Texture;\n\t\tprotected var popUpHeaderBackgroundSkinTexture:Texture;\n\t\tprotected var backgroundSkinTexture:Texture;\n\t\tprotected var backgroundDisabledSkinTexture:Texture;\n\t\tprotected var backgroundInsetSkinTexture:Texture;\n\t\tprotected var backgroundInsetDisabledSkinTexture:Texture;\n\t\tprotected var backgroundInsetFocusedSkinTexture:Texture;\n\t\tprotected var backgroundInsetDangerSkinTexture:Texture;\n\t\tprotected var backgroundLightBorderSkinTexture:Texture;\n\t\tprotected var backgroundDarkBorderSkinTexture:Texture;\n\t\tprotected var backgroundDangerBorderSkinTexture:Texture;\n\t\tprotected var buttonUpSkinTexture:Texture;\n\t\tprotected var buttonDownSkinTexture:Texture;\n\t\tprotected var buttonDisabledSkinTexture:Texture;\n\t\tprotected var buttonSelectedUpSkinTexture:Texture;\n\t\tprotected var buttonSelectedDisabledSkinTexture:Texture;\n\t\tprotected var buttonCallToActionUpSkinTexture:Texture;\n\t\tprotected var buttonCallToActionDownSkinTexture:Texture;\n\t\tprotected var buttonDangerUpSkinTexture:Texture;\n\t\tprotected var buttonDangerDownSkinTexture:Texture;\n\t\tprotected var buttonBackUpSkinTexture:Texture;\n\t\tprotected var buttonBackDownSkinTexture:Texture;\n\t\tprotected var buttonBackDisabledSkinTexture:Texture;\n\t\tprotected var buttonForwardUpSkinTexture:Texture;\n\t\tprotected var buttonForwardDownSkinTexture:Texture;\n\t\tprotected var buttonForwardDisabledSkinTexture:Texture;\n\t\tprotected var pickerListButtonIconTexture:Texture;\n\t\tprotected var pickerListButtonSelectedIconTexture:Texture;\n\t\tprotected var pickerListButtonIconDisabledTexture:Texture;\n\t\tprotected var tabUpSkinTexture:Texture;\n\t\tprotected var tabDownSkinTexture:Texture;\n\t\tprotected var tabDisabledSkinTexture:Texture;\n\t\tprotected var tabSelectedUpSkinTexture:Texture;\n\t\tprotected var tabSelectedDisabledSkinTexture:Texture;\n\t\tprotected var pickerListItemSelectedIconTexture:Texture;\n\t\tprotected var spinnerListSelectionOverlaySkinTexture:Texture;\n\t\tprotected var radioUpIconTexture:Texture;\n\t\tprotected var radioDownIconTexture:Texture;\n\t\tprotected var radioDisabledIconTexture:Texture;\n\t\tprotected var radioSelectedUpIconTexture:Texture;\n\t\tprotected var radioSelectedDownIconTexture:Texture;\n\t\tprotected var radioSelectedDisabledIconTexture:Texture;\n\t\tprotected var checkUpIconTexture:Texture;\n\t\tprotected var checkDownIconTexture:Texture;\n\t\tprotected var checkDisabledIconTexture:Texture;\n\t\tprotected var checkSelectedUpIconTexture:Texture;\n\t\tprotected var checkSelectedDownIconTexture:Texture;\n\t\tprotected var checkSelectedDisabledIconTexture:Texture;\n\t\tprotected var pageIndicatorNormalSkinTexture:Texture;\n\t\tprotected var pageIndicatorSelectedSkinTexture:Texture;\n\t\tprotected var itemRendererUpSkinTexture:Texture;\n\t\tprotected var itemRendererSelectedSkinTexture:Texture;\n\t\tprotected var insetItemRendererUpSkinTexture:Texture;\n\t\tprotected var insetItemRendererSelectedSkinTexture:Texture;\n\t\tprotected var insetItemRendererFirstUpSkinTexture:Texture;\n\t\tprotected var insetItemRendererFirstSelectedSkinTexture:Texture;\n\t\tprotected var insetItemRendererLastUpSkinTexture:Texture;\n\t\tprotected var insetItemRendererLastSelectedSkinTexture:Texture;\n\t\tprotected var insetItemRendererSingleUpSkinTexture:Texture;\n\t\tprotected var insetItemRendererSingleSelectedSkinTexture:Texture;\n\t\tprotected var calloutTopArrowSkinTexture:Texture;\n\t\tprotected var calloutRightArrowSkinTexture:Texture;\n\t\tprotected var calloutBottomArrowSkinTexture:Texture;\n\t\tprotected var calloutLeftArrowSkinTexture:Texture;\n\t\tprotected var dangerCalloutTopArrowSkinTexture:Texture;\n\t\tprotected var dangerCalloutRightArrowSkinTexture:Texture;\n\t\tprotected var dangerCalloutBottomArrowSkinTexture:Texture;\n\t\tprotected var dangerCalloutLeftArrowSkinTexture:Texture;\n\t\tprotected var verticalScrollBarThumbSkinTexture:Texture;\n\t\tprotected var horizontalScrollBarThumbSkinTexture:Texture;\n\t\tprotected var searchIconTexture:Texture;\n\t\tprotected var searchIconDisabledTexture:Texture;\n\t\tprotected var listDrillDownAccessoryTexture:Texture;\n\t\tprotected var listDrillDownAccessorySelectedTexture:Texture;\n\t\tprotected var treeDisclosureOpenIconTexture:Texture;\n\t\tprotected var treeDisclosureOpenSelectedIconTexture:Texture;\n\t\tprotected var treeDisclosureClosedIconTexture:Texture;\n\t\tprotected var treeDisclosureClosedSelectedIconTexture:Texture;\n\t\tprotected var dataGridHeaderSortAscendingIconTexture:Texture;\n\t\tprotected var dataGridHeaderSortDescendingIconTexture:Texture;\n\t\tprotected var dataGridHeaderDividerSkinTexture:Texture;\n\t\tprotected var dataGridVerticalDividerSkinTexture:Texture;\n\t\tprotected var dataGridColumnResizeSkinTexture:Texture;\n\t\tprotected var dataGridColumnDropIndicatorSkinTexture:Texture;\n\t\tprotected var dragHandleIcon:Texture;\n\t\t\n\t\t//media textures\n\t\tprotected var playPauseButtonPlayUpIconTexture:Texture;\n\t\tprotected var playPauseButtonPlayDownIconTexture:Texture;\n\t\tprotected var playPauseButtonPauseUpIconTexture:Texture;\n\t\tprotected var playPauseButtonPauseDownIconTexture:Texture;\n\t\tprotected var overlayPlayPauseButtonPlayUpIconTexture:Texture;\n\t\tprotected var overlayPlayPauseButtonPlayDownIconTexture:Texture;\n\t\tprotected var fullScreenToggleButtonEnterUpIconTexture:Texture;\n\t\tprotected var fullScreenToggleButtonEnterDownIconTexture:Texture;\n\t\tprotected var fullScreenToggleButtonExitUpIconTexture:Texture;\n\t\tprotected var fullScreenToggleButtonExitDownIconTexture:Texture;\n\t\tprotected var muteToggleButtonLoudUpIconTexture:Texture;\n\t\tprotected var muteToggleButtonLoudDownIconTexture:Texture;\n\t\tprotected var muteToggleButtonMutedUpIconTexture:Texture;\n\t\tprotected var muteToggleButtonMutedDownIconTexture:Texture;\n\t\tprotected var volumeSliderMinimumTrackSkinTexture:Texture;\n\t\tprotected var volumeSliderMaximumTrackSkinTexture:Texture;\n\t\tprotected var seekSliderProgressSkinTexture:Texture;\n\n\t\t/**\n\t\t * Disposes the atlas before calling super.dispose()\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this.atlas)\n\t\t\t{\n\t\t\t\t//if anything is keeping a reference to the texture, we don't\n\t\t\t\t//want it to keep a reference to the theme too.\n\t\t\t\tthis.atlas.texture.root.onRestore = null;\n\t\t\t\t\n\t\t\t\tthis.atlas.dispose();\n\t\t\t\tthis.atlas = null;\n\t\t\t}\n\n\t\t\t//don't forget to call super.dispose()!\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * Initializes the theme. Expected to be called by subclasses after the\n\t\t * assets have been loaded and the skin texture atlas has been created.\n\t\t */\n\t\tprotected function initialize():void\n\t\t{\n\t\t\tthis.initializeFonts();\n\t\t\tthis.initializeTextures();\n\t\t\tthis.initializeGlobals();\n\t\t\tthis.initializeStage();\n\t\t\tthis.initializeStyleProviders();\n\t\t}\n\n\t\t/**\n\t\t * Sets the stage background color.\n\t\t */\n\t\tprotected function initializeStage():void\n\t\t{\n\t\t\tthis.starling.stage.color = PRIMARY_BACKGROUND_COLOR;\n\t\t\tthis.starling.nativeStage.color = PRIMARY_BACKGROUND_COLOR;\n\t\t}\n\n\t\t/**\n\t\t * Initializes global variables (not including global style providers).\n\t\t */\n\t\tprotected function initializeGlobals():void\n\t\t{\n\t\t\tFeathersControl.defaultTextRendererFactory = textRendererFactory;\n\t\t\tFeathersControl.defaultTextEditorFactory = textEditorFactory;\n\n\t\t\tPopUpManager.overlayFactory = popUpOverlayFactory;\n\t\t\tCallout.stagePadding = this.smallGutterSize;\n\t\t\tToast.containerFactory = toastContainerFactory;\n\n\t\t\tvar stage:Stage = this.starling.stage;\n\t\t\tFocusManager.setEnabledForStage(stage, true);\n\t\t}\n\n\t\t/**\n\t\t * Initializes font sizes and formats.\n\t\t */\n\t\tprotected function initializeFonts():void\n\t\t{\n\t\t\tthis.lightFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, LIGHT_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.darkFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, DARK_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.lightDisabledFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, LIGHT_DISABLED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.selectedFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, SELECTED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\n\t\t\tthis.smallLightFontStyles = new TextFormat(FONT_NAME, this.smallFontSize, LIGHT_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.smallLightDisabledFontStyles = new TextFormat(FONT_NAME, this.smallFontSize, LIGHT_DISABLED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\n\t\t\tthis.largeLightFontStyles = new TextFormat(FONT_NAME, this.largeFontSize, LIGHT_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.largeDarkFontStyles = new TextFormat(FONT_NAME, this.largeFontSize, DARK_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.largeLightDisabledFontStyles = new TextFormat(FONT_NAME, this.largeFontSize, LIGHT_DISABLED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\n\t\t\tthis.lightUIFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, LIGHT_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.lightUIFontStyles.bold = true;\n\t\t\tthis.darkUIFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, DARK_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.darkUIFontStyles.bold = true;\n\t\t\tthis.selectedUIFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, SELECTED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.selectedUIFontStyles.bold = true;\n\t\t\tthis.lightDisabledUIFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, LIGHT_DISABLED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.lightDisabledUIFontStyles.bold = true;\n\t\t\tthis.darkDisabledUIFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, DARK_DISABLED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.darkDisabledUIFontStyles.bold = true;\n\t\t\tthis.lightCenteredUIFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, LIGHT_TEXT_COLOR, HorizontalAlign.CENTER, VerticalAlign.TOP);\n\t\t\tthis.lightCenteredUIFontStyles.bold = true;\n\t\t\tthis.lightCenteredDisabledUIFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, LIGHT_TEXT_COLOR, HorizontalAlign.CENTER, VerticalAlign.TOP);\n\t\t\tthis.lightCenteredDisabledUIFontStyles.bold = true;\n\n\t\t\tthis.largeLightUIFontStyles = new TextFormat(FONT_NAME, this.largeFontSize, LIGHT_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.largeLightUIFontStyles.bold = true;\n\t\t\tthis.largeDarkUIFontStyles = new TextFormat(FONT_NAME, this.largeFontSize, DARK_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.largeDarkUIFontStyles.bold = true;\n\t\t\tthis.largeSelectedUIFontStyles = new TextFormat(FONT_NAME, this.largeFontSize, SELECTED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.largeSelectedUIFontStyles.bold = true;\n\t\t\tthis.largeLightUIDisabledFontStyles = new TextFormat(FONT_NAME, this.largeFontSize, LIGHT_DISABLED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.largeLightUIDisabledFontStyles.bold = true;\n\t\t\tthis.largeDarkUIDisabledFontStyles = new TextFormat(FONT_NAME, this.largeFontSize, DARK_DISABLED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.largeDarkUIDisabledFontStyles.bold = true;\n\n\t\t\tthis.xlargeLightUIFontStyles = new TextFormat(FONT_NAME, this.extraLargeFontSize, LIGHT_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.xlargeLightUIFontStyles.bold = true;\n\t\t\tthis.xlargeLightUIDisabledFontStyles = new TextFormat(FONT_NAME, this.extraLargeFontSize, LIGHT_DISABLED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.xlargeLightUIDisabledFontStyles.bold = true;\n\n\t\t\tthis.lightInputFontStyles = new TextFormat(FONT_NAME_STACK, this.regularFontSize, LIGHT_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.lightDisabledInputFontStyles = new TextFormat(FONT_NAME_STACK, this.regularFontSize, LIGHT_DISABLED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\n\t\t\tthis.lightScrollTextFontStyles = new TextFormat(FONT_NAME_STACK, this.regularFontSize, LIGHT_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.lightDisabledScrollTextFontStyles = new TextFormat(FONT_NAME_STACK, this.regularFontSize, LIGHT_DISABLED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t}\n\n\t\t/**\n\t\t * Initializes the textures by extracting them from the atlas and\n\t\t * setting up any scaling grids that are needed.\n\t\t */\n\t\tprotected function initializeTextures():void\n\t\t{\n\t\t\tthis.focusIndicatorSkinTexture = this.atlas.getTexture(\"focus-indicator-skin0000\");\n\n\t\t\tthis.backgroundSkinTexture = this.atlas.getTexture(\"background-skin0000\");\n\t\t\tthis.backgroundDisabledSkinTexture = this.atlas.getTexture(\"background-disabled-skin0000\");\n\t\t\tthis.backgroundInsetSkinTexture = this.atlas.getTexture(\"background-inset-skin0000\");\n\t\t\tthis.backgroundInsetDisabledSkinTexture = this.atlas.getTexture(\"background-inset-disabled-skin0000\");\n\t\t\tthis.backgroundInsetFocusedSkinTexture = this.atlas.getTexture(\"background-focused-skin0000\");\n\t\t\tthis.backgroundInsetDangerSkinTexture = this.atlas.getTexture(\"background-inset-danger-skin0000\");\n\t\t\tthis.backgroundLightBorderSkinTexture = this.atlas.getTexture(\"background-light-border-skin0000\");\n\t\t\tthis.backgroundDarkBorderSkinTexture = this.atlas.getTexture(\"background-dark-border-skin0000\");\n\t\t\tthis.backgroundDangerBorderSkinTexture = this.atlas.getTexture(\"background-danger-border-skin0000\");\n\n\t\t\tthis.buttonUpSkinTexture = this.atlas.getTexture(\"button-up-skin0000\");\n\t\t\tthis.buttonDownSkinTexture = this.atlas.getTexture(\"button-down-skin0000\");\n\t\t\tthis.buttonDisabledSkinTexture = this.atlas.getTexture(\"button-disabled-skin0000\");\n\t\t\tthis.buttonSelectedUpSkinTexture = this.atlas.getTexture(\"toggle-button-selected-up-skin0000\");\n\t\t\tthis.buttonSelectedDisabledSkinTexture = this.atlas.getTexture(\"toggle-button-selected-disabled-skin0000\");\n\t\t\tthis.buttonCallToActionUpSkinTexture = this.atlas.getTexture(\"call-to-action-button-up-skin0000\");\n\t\t\tthis.buttonCallToActionDownSkinTexture = this.atlas.getTexture(\"call-to-action-button-down-skin0000\");\n\t\t\tthis.buttonDangerUpSkinTexture = this.atlas.getTexture(\"danger-button-up-skin0000\");\n\t\t\tthis.buttonDangerDownSkinTexture = this.atlas.getTexture(\"danger-button-down-skin0000\");\n\t\t\tthis.buttonBackUpSkinTexture = this.atlas.getTexture(\"back-button-up-skin0000\");\n\t\t\tthis.buttonBackDownSkinTexture = this.atlas.getTexture(\"back-button-down-skin0000\");\n\t\t\tthis.buttonBackDisabledSkinTexture = this.atlas.getTexture(\"back-button-disabled-skin0000\");\n\t\t\tthis.buttonForwardUpSkinTexture = this.atlas.getTexture(\"forward-button-up-skin0000\");\n\t\t\tthis.buttonForwardDownSkinTexture = this.atlas.getTexture(\"forward-button-down-skin0000\");\n\t\t\tthis.buttonForwardDisabledSkinTexture = this.atlas.getTexture(\"forward-button-disabled-skin0000\");\n\n\t\t\tthis.tabUpSkinTexture = Texture.fromTexture(this.atlas.getTexture(\"tab-up-skin0000\"), TAB_SKIN_TEXTURE_REGION);\n\t\t\tthis.tabDownSkinTexture = Texture.fromTexture(this.atlas.getTexture(\"tab-down-skin0000\"), TAB_SKIN_TEXTURE_REGION);\n\t\t\tthis.tabDisabledSkinTexture = Texture.fromTexture(this.atlas.getTexture(\"tab-disabled-skin0000\"), TAB_SKIN_TEXTURE_REGION);\n\t\t\tthis.tabSelectedUpSkinTexture = Texture.fromTexture(this.atlas.getTexture(\"tab-selected-up-skin0000\"), TAB_SKIN_TEXTURE_REGION);\n\t\t\tthis.tabSelectedDisabledSkinTexture = Texture.fromTexture(this.atlas.getTexture(\"tab-selected-disabled-skin0000\"), TAB_SKIN_TEXTURE_REGION);\n\n\t\t\tthis.pickerListButtonIconTexture = this.atlas.getTexture(\"picker-list-button-icon0000\");\n\t\t\tthis.pickerListButtonSelectedIconTexture = this.atlas.getTexture(\"picker-list-button-selected-icon0000\");\n\t\t\tthis.pickerListButtonIconDisabledTexture = this.atlas.getTexture(\"picker-list-button-disabled-icon0000\");\n\t\t\tthis.pickerListItemSelectedIconTexture = this.atlas.getTexture(\"picker-list-item-renderer-selected-icon0000\");\n\n\t\t\tthis.spinnerListSelectionOverlaySkinTexture = this.atlas.getTexture(\"spinner-list-selection-overlay-skin0000\");\n\n\t\t\tthis.checkUpIconTexture = this.atlas.getTexture(\"check-up-icon0000\");\n\t\t\tthis.checkDownIconTexture = this.atlas.getTexture(\"check-down-icon0000\");\n\t\t\tthis.checkDisabledIconTexture = this.atlas.getTexture(\"check-disabled-icon0000\");\n\t\t\tthis.checkSelectedUpIconTexture = this.atlas.getTexture(\"check-selected-up-icon0000\");\n\t\t\tthis.checkSelectedDownIconTexture = this.atlas.getTexture(\"check-selected-down-icon0000\");\n\t\t\tthis.checkSelectedDisabledIconTexture = this.atlas.getTexture(\"check-selected-disabled-icon0000\");\n\n\t\t\tthis.radioUpIconTexture = this.checkUpIconTexture;\n\t\t\tthis.radioDownIconTexture = this.checkDownIconTexture;\n\t\t\tthis.radioDisabledIconTexture = this.checkDisabledIconTexture;\n\t\t\tthis.radioSelectedUpIconTexture = this.atlas.getTexture(\"radio-selected-up-icon0000\");\n\t\t\tthis.radioSelectedDownIconTexture = this.atlas.getTexture(\"radio-selected-down-icon0000\");\n\t\t\tthis.radioSelectedDisabledIconTexture = this.atlas.getTexture(\"radio-selected-disabled-icon0000\");\n\n\t\t\tthis.pageIndicatorSelectedSkinTexture = this.atlas.getTexture(\"page-indicator-selected-symbol0000\");\n\t\t\tthis.pageIndicatorNormalSkinTexture = this.atlas.getTexture(\"page-indicator-symbol0000\");\n\n\t\t\tthis.searchIconTexture = this.atlas.getTexture(\"search-icon0000\");\n\t\t\tthis.searchIconDisabledTexture = this.atlas.getTexture(\"search-disabled-icon0000\");\n\n\t\t\tthis.itemRendererUpSkinTexture = this.atlas.getTexture(\"item-renderer-up-skin0000\");\n\t\t\tthis.itemRendererSelectedSkinTexture = this.atlas.getTexture(\"item-renderer-selected-up-skin0000\");\n\t\t\tthis.insetItemRendererUpSkinTexture = this.atlas.getTexture(\"inset-item-renderer-up-skin0000\");\n\t\t\tthis.insetItemRendererSelectedSkinTexture = this.atlas.getTexture(\"inset-item-renderer-selected-up-skin0000\");\n\t\t\tthis.insetItemRendererFirstUpSkinTexture = this.atlas.getTexture(\"first-inset-item-renderer-up-skin0000\");\n\t\t\tthis.insetItemRendererFirstSelectedSkinTexture = this.atlas.getTexture(\"first-inset-item-renderer-selected-up-skin0000\");\n\t\t\tthis.insetItemRendererLastUpSkinTexture = this.atlas.getTexture(\"last-inset-item-renderer-up-skin0000\");\n\t\t\tthis.insetItemRendererLastSelectedSkinTexture = this.atlas.getTexture(\"last-inset-item-renderer-selected-up-skin0000\");\n\t\t\tthis.insetItemRendererSingleUpSkinTexture = this.atlas.getTexture(\"single-inset-item-renderer-up-skin0000\");\n\t\t\tthis.insetItemRendererSingleSelectedSkinTexture = this.atlas.getTexture(\"single-inset-item-renderer-selected-up-skin0000\");\n\n\t\t\tthis.dragHandleIcon = this.atlas.getTexture(\"drag-handle-icon0000\");\n\n\t\t\tvar headerBackgroundSkinTexture:Texture = this.atlas.getTexture(\"header-background-skin0000\");\n\t\t\tvar popUpHeaderBackgroundSkinTexture:Texture = this.atlas.getTexture(\"header-popup-background-skin0000\");\n\t\t\tthis.headerBackgroundSkinTexture = Texture.fromTexture(headerBackgroundSkinTexture, HEADER_SKIN_TEXTURE_REGION);\n\t\t\tthis.popUpHeaderBackgroundSkinTexture = Texture.fromTexture(popUpHeaderBackgroundSkinTexture, HEADER_SKIN_TEXTURE_REGION);\n\n\t\t\tthis.calloutTopArrowSkinTexture = this.atlas.getTexture(\"callout-arrow-top-skin0000\");\n\t\t\tthis.calloutRightArrowSkinTexture = this.atlas.getTexture(\"callout-arrow-right-skin0000\");\n\t\t\tthis.calloutBottomArrowSkinTexture = this.atlas.getTexture(\"callout-arrow-bottom-skin0000\");\n\t\t\tthis.calloutLeftArrowSkinTexture = this.atlas.getTexture(\"callout-arrow-left-skin0000\");\n\t\t\tthis.dangerCalloutTopArrowSkinTexture = this.atlas.getTexture(\"danger-callout-arrow-top-skin0000\");\n\t\t\tthis.dangerCalloutRightArrowSkinTexture = this.atlas.getTexture(\"danger-callout-arrow-right-skin0000\");\n\t\t\tthis.dangerCalloutBottomArrowSkinTexture = this.atlas.getTexture(\"danger-callout-arrow-bottom-skin0000\");\n\t\t\tthis.dangerCalloutLeftArrowSkinTexture = this.atlas.getTexture(\"danger-callout-arrow-left-skin0000\");\n\n\t\t\tthis.horizontalScrollBarThumbSkinTexture = this.atlas.getTexture(\"horizontal-simple-scroll-bar-thumb-skin0000\");\n\t\t\tthis.verticalScrollBarThumbSkinTexture = this.atlas.getTexture(\"vertical-simple-scroll-bar-thumb-skin0000\");\n\n\t\t\tthis.listDrillDownAccessoryTexture = this.atlas.getTexture(\"item-renderer-drill-down-accessory-icon0000\");\n\t\t\tthis.listDrillDownAccessorySelectedTexture = this.atlas.getTexture(\"item-renderer-drill-down-accessory-selected-icon0000\");\n\n\t\t\tthis.treeDisclosureOpenIconTexture = this.atlas.getTexture(\"tree-disclosure-open-icon0000\");\n\t\t\tthis.treeDisclosureOpenSelectedIconTexture = this.atlas.getTexture(\"tree-disclosure-open-selected-icon0000\");\n\t\t\tthis.treeDisclosureClosedIconTexture = this.atlas.getTexture(\"tree-disclosure-closed-icon0000\");\n\t\t\tthis.treeDisclosureClosedSelectedIconTexture = this.atlas.getTexture(\"tree-disclosure-closed-selected-icon0000\");\n\n\t\t\tthis.dataGridHeaderSortAscendingIconTexture = this.atlas.getTexture(\"data-grid-header-sort-ascending-icon0000\");\n\t\t\tthis.dataGridHeaderSortDescendingIconTexture = this.atlas.getTexture(\"data-grid-header-sort-descending-icon0000\");\n\t\t\tthis.dataGridHeaderDividerSkinTexture = this.atlas.getTexture(\"data-grid-header-divider-skin0000\");\n\t\t\tthis.dataGridVerticalDividerSkinTexture = this.atlas.getTexture(\"data-grid-vertical-divider-skin0000\");\n\t\t\tthis.dataGridColumnResizeSkinTexture = this.atlas.getTexture(\"data-grid-column-resize-skin0000\");\n\t\t\tthis.dataGridColumnDropIndicatorSkinTexture = this.atlas.getTexture(\"data-grid-column-drop-indicator-skin0000\");\n\t\t\t\n\t\t\tthis.playPauseButtonPlayUpIconTexture = this.atlas.getTexture(\"play-pause-toggle-button-play-up-icon0000\");\n\t\t\tthis.playPauseButtonPlayDownIconTexture = this.atlas.getTexture(\"play-pause-toggle-button-play-down-icon0000\");\n\t\t\tthis.playPauseButtonPauseUpIconTexture = this.atlas.getTexture(\"play-pause-toggle-button-pause-up-icon0000\");\n\t\t\tthis.playPauseButtonPauseDownIconTexture = this.atlas.getTexture(\"play-pause-toggle-button-pause-down-icon0000\");\n\t\t\tthis.overlayPlayPauseButtonPlayUpIconTexture = this.atlas.getTexture(\"overlay-play-pause-toggle-button-play-up-icon0000\");\n\t\t\tthis.overlayPlayPauseButtonPlayDownIconTexture = this.atlas.getTexture(\"overlay-play-pause-toggle-button-play-down-icon0000\");\n\t\t\tthis.fullScreenToggleButtonEnterUpIconTexture = this.atlas.getTexture(\"full-screen-toggle-button-enter-up-icon0000\");\n\t\t\tthis.fullScreenToggleButtonEnterDownIconTexture = this.atlas.getTexture(\"full-screen-toggle-button-enter-down-icon0000\");\n\t\t\tthis.fullScreenToggleButtonExitUpIconTexture = this.atlas.getTexture(\"full-screen-toggle-button-exit-up-icon0000\");\n\t\t\tthis.fullScreenToggleButtonExitDownIconTexture = this.atlas.getTexture(\"full-screen-toggle-button-exit-down-icon0000\");\n\t\t\tthis.muteToggleButtonMutedUpIconTexture = this.atlas.getTexture(\"mute-toggle-button-muted-up-icon0000\");\n\t\t\tthis.muteToggleButtonMutedDownIconTexture = this.atlas.getTexture(\"mute-toggle-button-muted-down-icon0000\");\n\t\t\tthis.muteToggleButtonLoudUpIconTexture = this.atlas.getTexture(\"mute-toggle-button-loud-up-icon0000\");\n\t\t\tthis.muteToggleButtonLoudDownIconTexture = this.atlas.getTexture(\"mute-toggle-button-loud-down-icon0000\");\n\t\t\tthis.volumeSliderMinimumTrackSkinTexture = this.atlas.getTexture(\"volume-slider-minimum-track-skin0000\");\n\t\t\tthis.volumeSliderMaximumTrackSkinTexture = this.atlas.getTexture(\"volume-slider-maximum-track-skin0000\");\n\t\t\tthis.seekSliderProgressSkinTexture = this.atlas.getTexture(\"seek-slider-progress-skin0000\");\n\t\t}\n\n\t\t/**\n\t\t * Sets global style providers for all components.\n\t\t */\n\t\tprotected function initializeStyleProviders():void\n\t\t{\n\t\t\t//alert\n\t\t\tthis.getStyleProviderForClass(Alert).defaultStyleFunction = this.setAlertStyles;\n\t\t\tthis.getStyleProviderForClass(ButtonGroup).setFunctionForStyleName(Alert.DEFAULT_CHILD_STYLE_NAME_BUTTON_GROUP, this.setAlertButtonGroupStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_ALERT_BUTTON_GROUP_BUTTON, this.setAlertButtonGroupButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Header).setFunctionForStyleName(Alert.DEFAULT_CHILD_STYLE_NAME_HEADER, this.setPopUpHeaderStyles);\n\n\t\t\t//auto-complete\n\t\t\tthis.getStyleProviderForClass(AutoComplete).defaultStyleFunction = this.setTextInputStyles;\n\t\t\tthis.getStyleProviderForClass(List).setFunctionForStyleName(AutoComplete.DEFAULT_CHILD_STYLE_NAME_LIST, this.setDropDownListStyles);\n\n\t\t\t//button\n\t\t\tthis.getStyleProviderForClass(Button).defaultStyleFunction = this.setButtonStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_CALL_TO_ACTION_BUTTON, this.setCallToActionButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_QUIET_BUTTON, this.setQuietButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_DANGER_BUTTON, this.setDangerButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON, this.setBackButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_FORWARD_BUTTON, this.setForwardButtonStyles);\n\n\t\t\t//button group\n\t\t\tthis.getStyleProviderForClass(ButtonGroup).defaultStyleFunction = this.setButtonGroupStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(ButtonGroup.DEFAULT_CHILD_STYLE_NAME_BUTTON, this.setButtonGroupButtonStyles);\n\t\t\tthis.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(ButtonGroup.DEFAULT_CHILD_STYLE_NAME_BUTTON, this.setButtonGroupButtonStyles);\n\n\t\t\t//callout\n\t\t\tthis.getStyleProviderForClass(Callout).defaultStyleFunction = this.setCalloutStyles;\n\n\t\t\t//check\n\t\t\tthis.getStyleProviderForClass(Check).defaultStyleFunction = this.setCheckStyles;\n\n\t\t\t//data grid\n\t\t\tthis.getStyleProviderForClass(DataGrid).defaultStyleFunction = this.setDataGridStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultDataGridCellRenderer).defaultStyleFunction = this.setDataGridCellRendererStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultDataGridHeaderRenderer).defaultStyleFunction = this.setDataGridHeaderStyles;\n\n\t\t\t//date time spinner\n\t\t\tthis.getStyleProviderForClass(DateTimeSpinner).defaultStyleFunction = this.setDateTimeSpinnerStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).setFunctionForStyleName(THEME_STYLE_NAME_DATE_TIME_SPINNER_LIST_ITEM_RENDERER, this.setDateTimeSpinnerListItemRendererStyles);\n\n\t\t\t//drawers\n\t\t\tthis.getStyleProviderForClass(Drawers).defaultStyleFunction = this.setDrawersStyles;\n\n\t\t\t//grouped list\n\t\t\tthis.getStyleProviderForClass(GroupedList).defaultStyleFunction = this.setGroupedListStyles;\n\t\t\tthis.getStyleProviderForClass(GroupedList).setFunctionForStyleName(GroupedList.ALTERNATE_STYLE_NAME_INSET_GROUPED_LIST, this.setInsetGroupedListStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListItemRenderer).defaultStyleFunction = this.setItemRendererStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListItemRenderer).setFunctionForStyleName(GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_ITEM_RENDERER, this.setInsetGroupedListMiddleItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListItemRenderer).setFunctionForStyleName(GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_FIRST_ITEM_RENDERER, this.setInsetGroupedListFirstItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListItemRenderer).setFunctionForStyleName(GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_LAST_ITEM_RENDERER, this.setInsetGroupedListLastItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListItemRenderer).setFunctionForStyleName(GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_SINGLE_ITEM_RENDERER, this.setInsetGroupedListSingleItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListItemRenderer).setFunctionForStyleName(DefaultGroupedListItemRenderer.ALTERNATE_STYLE_NAME_DRILL_DOWN, this.setDrillDownItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListItemRenderer).setFunctionForStyleName(DefaultGroupedListItemRenderer.ALTERNATE_STYLE_NAME_CHECK, this.setCheckItemRendererStyles);\n\n\t\t\t//header\n\t\t\tthis.getStyleProviderForClass(Header).defaultStyleFunction = this.setHeaderStyles;\n\n\t\t\t//header and footer renderers for grouped list\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListHeaderOrFooterRenderer).defaultStyleFunction = this.setGroupedListHeaderRendererStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListHeaderOrFooterRenderer).setFunctionForStyleName(GroupedList.DEFAULT_CHILD_STYLE_NAME_FOOTER_RENDERER, this.setGroupedListFooterRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListHeaderOrFooterRenderer).setFunctionForStyleName(GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_HEADER_RENDERER, this.setInsetGroupedListHeaderRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListHeaderOrFooterRenderer).setFunctionForStyleName(GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_FOOTER_RENDERER, this.setInsetGroupedListFooterRendererStyles);\n\n\t\t\t//labels\n\t\t\tthis.getStyleProviderForClass(Label).defaultStyleFunction = this.setLabelStyles;\n\t\t\tthis.getStyleProviderForClass(Label).setFunctionForStyleName(Label.ALTERNATE_STYLE_NAME_HEADING, this.setHeadingLabelStyles);\n\t\t\tthis.getStyleProviderForClass(Label).setFunctionForStyleName(Label.ALTERNATE_STYLE_NAME_DETAIL, this.setDetailLabelStyles);\n\n\t\t\t//layout group\n\t\t\tthis.getStyleProviderForClass(LayoutGroup).setFunctionForStyleName(LayoutGroup.ALTERNATE_STYLE_NAME_TOOLBAR, setToolbarLayoutGroupStyles);\n\n\t\t\t//list\n\t\t\tthis.getStyleProviderForClass(List).defaultStyleFunction = this.setListStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).defaultStyleFunction = this.setListItemRendererStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).setFunctionForStyleName(DefaultListItemRenderer.ALTERNATE_STYLE_NAME_DRILL_DOWN, this.setDrillDownItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).setFunctionForStyleName(DefaultListItemRenderer.ALTERNATE_STYLE_NAME_CHECK, this.setCheckItemRendererStyles);\n\n\t\t\t//numeric stepper\n\t\t\tthis.getStyleProviderForClass(NumericStepper).defaultStyleFunction = this.setNumericStepperStyles;\n\t\t\tthis.getStyleProviderForClass(TextInput).setFunctionForStyleName(NumericStepper.DEFAULT_CHILD_STYLE_NAME_TEXT_INPUT, this.setNumericStepperTextInputStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(NumericStepper.DEFAULT_CHILD_STYLE_NAME_DECREMENT_BUTTON, this.setNumericStepperButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(NumericStepper.DEFAULT_CHILD_STYLE_NAME_INCREMENT_BUTTON, this.setNumericStepperButtonStyles);\n\n\t\t\t//page indicator\n\t\t\tthis.getStyleProviderForClass(PageIndicator).defaultStyleFunction = this.setPageIndicatorStyles;\n\n\t\t\t//panel\n\t\t\tthis.getStyleProviderForClass(Panel).defaultStyleFunction = this.setPanelStyles;\n\t\t\tthis.getStyleProviderForClass(Header).setFunctionForStyleName(Panel.DEFAULT_CHILD_STYLE_NAME_HEADER, this.setPopUpHeaderStyles);\n\n\t\t\t//panel screen\n\t\t\tthis.getStyleProviderForClass(PanelScreen).defaultStyleFunction = this.setPanelScreenStyles;\n\t\t\tthis.getStyleProviderForClass(Header).setFunctionForStyleName(PanelScreen.DEFAULT_CHILD_STYLE_NAME_HEADER, this.setPanelScreenHeaderStyles);\n\n\t\t\t//picker list (see also: list and item renderers)\n\t\t\tthis.getStyleProviderForClass(PickerList).defaultStyleFunction = this.setPickerListStyles;\n\t\t\tthis.getStyleProviderForClass(List).setFunctionForStyleName(PickerList.DEFAULT_CHILD_STYLE_NAME_LIST, this.setPickerListPopUpListStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(PickerList.DEFAULT_CHILD_STYLE_NAME_BUTTON, this.setPickerListButtonStyles);\n\t\t\tthis.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(PickerList.DEFAULT_CHILD_STYLE_NAME_BUTTON, this.setPickerListButtonStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).setFunctionForStyleName(THEME_STYLE_NAME_TABLET_PICKER_LIST_ITEM_RENDERER, this.setPickerListItemRendererStyles);\n\n\t\t\t//progress bar\n\t\t\tthis.getStyleProviderForClass(ProgressBar).defaultStyleFunction = this.setProgressBarStyles;\n\n\t\t\t//radio\n\t\t\tthis.getStyleProviderForClass(Radio).defaultStyleFunction = this.setRadioStyles;\n\n\t\t\t//scroll container\n\t\t\tthis.getStyleProviderForClass(ScrollContainer).defaultStyleFunction = this.setScrollContainerStyles;\n\t\t\tthis.getStyleProviderForClass(ScrollContainer).setFunctionForStyleName(ScrollContainer.ALTERNATE_STYLE_NAME_TOOLBAR, this.setToolbarScrollContainerStyles);\n\n\t\t\t//scroll screen\n\t\t\tthis.getStyleProviderForClass(ScrollScreen).defaultStyleFunction = this.setScrollScreenStyles;\n\n\t\t\t//scroll text\n\t\t\tthis.getStyleProviderForClass(ScrollText).defaultStyleFunction = this.setScrollTextStyles;\n\n\t\t\t//simple scroll bar\n\t\t\tthis.getStyleProviderForClass(SimpleScrollBar).defaultStyleFunction = this.setSimpleScrollBarStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_HORIZONTAL_SIMPLE_SCROLL_BAR_THUMB, this.setHorizontalSimpleScrollBarThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_VERTICAL_SIMPLE_SCROLL_BAR_THUMB, this.setVerticalSimpleScrollBarThumbStyles);\n\n\t\t\t//slider\n\t\t\tthis.getStyleProviderForClass(Slider).defaultStyleFunction = this.setSliderStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Slider.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setSimpleButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_HORIZONTAL_SLIDER_MINIMUM_TRACK, this.setHorizontalSliderMinimumTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_HORIZONTAL_SLIDER_MAXIMUM_TRACK, this.setHorizontalSliderMaximumTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_VERTICAL_SLIDER_MINIMUM_TRACK, this.setVerticalSliderMinimumTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_VERTICAL_SLIDER_MAXIMUM_TRACK, this.setVerticalSliderMaximumTrackStyles);\n\n\t\t\t//spinner list\n\t\t\tthis.getStyleProviderForClass(SpinnerList).defaultStyleFunction = this.setSpinnerListStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).setFunctionForStyleName(THEME_STYLE_NAME_SPINNER_LIST_ITEM_RENDERER, this.setSpinnerListItemRendererStyles);\n\n\t\t\t//tab bar\n\t\t\tthis.getStyleProviderForClass(TabBar).defaultStyleFunction = this.setTabBarStyles;\n\t\t\tthis.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(TabBar.DEFAULT_CHILD_STYLE_NAME_TAB, this.setTabStyles);\n\n\t\t\t//text input\n\t\t\tthis.getStyleProviderForClass(TextInput).defaultStyleFunction = this.setTextInputStyles;\n\t\t\tthis.getStyleProviderForClass(TextInput).setFunctionForStyleName(TextInput.ALTERNATE_STYLE_NAME_SEARCH_TEXT_INPUT, this.setSearchTextInputStyles);\n\t\t\tthis.getStyleProviderForClass(TextCallout).setFunctionForStyleName(TextInput.DEFAULT_CHILD_STYLE_NAME_ERROR_CALLOUT, this.setTextInputErrorCalloutStyles);\n\n\t\t\t//text area\n\t\t\tthis.getStyleProviderForClass(TextArea).defaultStyleFunction = this.setTextAreaStyles;\n\t\t\tthis.getStyleProviderForClass(TextCallout).setFunctionForStyleName(TextArea.DEFAULT_CHILD_STYLE_NAME_ERROR_CALLOUT, this.setTextAreaErrorCalloutStyles);\n\n\t\t\t//text callout\n\t\t\tthis.getStyleProviderForClass(TextCallout).defaultStyleFunction = this.setTextCalloutStyles;\n\n\t\t\t//toast\n\t\t\tthis.getStyleProviderForClass(Toast).defaultStyleFunction = this.setToastStyles;\n\t\t\tthis.getStyleProviderForClass(ButtonGroup).setFunctionForStyleName(Toast.DEFAULT_CHILD_STYLE_NAME_ACTIONS, this.setToastActionsStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_TOAST_ACTIONS_BUTTON, this.setToastActionsButtonStyles);\n\n\t\t\t//toggle button\n\t\t\tthis.getStyleProviderForClass(ToggleButton).defaultStyleFunction = this.setButtonStyles;\n\t\t\tthis.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_QUIET_BUTTON, this.setQuietButtonStyles);\n\n\t\t\t//toggle switch\n\t\t\tthis.getStyleProviderForClass(ToggleSwitch).defaultStyleFunction = this.setToggleSwitchStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setSimpleButtonStyles);\n\t\t\tthis.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setSimpleButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_ON_TRACK, this.setToggleSwitchTrackStyles);\n\t\t\t//we don't need a style function for the off track in this theme\n\t\t\t//the toggle switch layout uses a single track\n\n\t\t\t//tree\n\t\t\tthis.getStyleProviderForClass(Tree).defaultStyleFunction = this.setTreeStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultTreeItemRenderer).defaultStyleFunction = this.setTreeItemRendererStyles;\n\n\t\t\t//media controls\n\n\t\t\t//play/pause toggle button\n\t\t\tthis.getStyleProviderForClass(PlayPauseToggleButton).defaultStyleFunction = this.setPlayPauseToggleButtonStyles;\n\t\t\tthis.getStyleProviderForClass(PlayPauseToggleButton).setFunctionForStyleName(PlayPauseToggleButton.ALTERNATE_STYLE_NAME_OVERLAY_PLAY_PAUSE_TOGGLE_BUTTON, this.setOverlayPlayPauseToggleButtonStyles);\n\n\t\t\t//full screen toggle button\n\t\t\tthis.getStyleProviderForClass(FullScreenToggleButton).defaultStyleFunction = this.setFullScreenToggleButtonStyles;\n\n\t\t\t//mute toggle button\n\t\t\tthis.getStyleProviderForClass(MuteToggleButton).defaultStyleFunction = this.setMuteToggleButtonStyles;\n\n\t\t\t//seek slider\n\t\t\tthis.getStyleProviderForClass(SeekSlider).defaultStyleFunction = this.setSeekSliderStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(SeekSlider.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setSeekSliderThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(SeekSlider.DEFAULT_CHILD_STYLE_NAME_MINIMUM_TRACK, this.setSeekSliderMinimumTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(SeekSlider.DEFAULT_CHILD_STYLE_NAME_MAXIMUM_TRACK, this.setSeekSliderMaximumTrackStyles);\n\n\t\t\t//volume slider\n\t\t\tthis.getStyleProviderForClass(VolumeSlider).defaultStyleFunction = this.setVolumeSliderStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(VolumeSlider.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setVolumeSliderThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(VolumeSlider.DEFAULT_CHILD_STYLE_NAME_MINIMUM_TRACK, this.setVolumeSliderMinimumTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(VolumeSlider.DEFAULT_CHILD_STYLE_NAME_MAXIMUM_TRACK, this.setVolumeSliderMaximumTrackStyles);\n\t\t}\n\n\t\tprotected function pageIndicatorNormalSymbolFactory():DisplayObject\n\t\t{\n\t\t\tvar symbol:ImageLoader = new ImageLoader();\n\t\t\tsymbol.source = this.pageIndicatorNormalSkinTexture;\n\t\t\treturn symbol;\n\t\t}\n\n\t\tprotected function pageIndicatorSelectedSymbolFactory():DisplayObject\n\t\t{\n\t\t\tvar symbol:ImageLoader = new ImageLoader();\n\t\t\tsymbol.source = this.pageIndicatorSelectedSkinTexture;\n\t\t\treturn symbol;\n\t\t}\n\n\t\tprotected function dataGridHeaderDividerFactory():DisplayObject\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.dataGridHeaderDividerSkinTexture);\n\t\t\tskin.scale9Grid = DATA_GRID_HEADER_DIVIDER_SCALE_9_GRID;\n\t\t\tskin.minTouchWidth = this.controlSize;\n\t\t\treturn skin;\n\t\t}\n\n\t\tprotected function dataGridVerticalDividerFactory():DisplayObject\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.dataGridVerticalDividerSkinTexture);\n\t\t\tskin.scale9Grid = DATA_GRID_VERTICAL_DIVIDER_SCALE_9_GRID;\n\t\t\treturn skin;\n\t\t}\n\n\t\tprotected function toastContainerFactory():DisplayObjectContainer\n\t\t{\n\t\t\tvar container:LayoutGroup = new LayoutGroup();\n\t\t\tcontainer.autoSizeMode = AutoSizeMode.STAGE;\n\n\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\tlayout.verticalAlign = VerticalAlign.BOTTOM;\n\t\t\tif(DeviceCapabilities.isPhone())\n\t\t\t{\n\t\t\t\tlayout.horizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\t\tlayout.padding = this.smallGutterSize;\n\t\t\t\tlayout.gap = this.smallGutterSize;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlayout.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\t\tlayout.padding = this.gutterSize;\n\t\t\t\tlayout.gap = this.gutterSize;\n\t\t\t}\n\t\t\tcontainer.layout = layout;\n\t\t\treturn container;\n\t\t}\n\n\t//-------------------------\n\t// Shared\n\t//-------------------------\n\n\t\tprotected function setScrollerStyles(scroller:Scroller):void\n\t\t{\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tscroller.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tscroller.focusPadding = 0;\n\n\t\t\tscroller.horizontalScrollBarFactory = scrollBarFactory;\n\t\t\tscroller.verticalScrollBarFactory = scrollBarFactory;\n\t\t}\n\n\t\tprotected function setSimpleButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\n\t\t\tbutton.minTouchWidth = this.gridSize;\n\t\t\tbutton.minTouchHeight = this.gridSize;\n\t\t}\n\n\t\tprotected function setDropDownListStyles(list:List):void\n\t\t{\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.itemRendererUpSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = ITEM_RENDERER_SCALE9_GRID;\n\t\t\tbackgroundSkin.width = this.gridSize;\n\t\t\tbackgroundSkin.height = this.gridSize;\n\t\t\tbackgroundSkin.minWidth = this.gridSize;\n\t\t\tbackgroundSkin.minHeight = this.gridSize;\n\t\t\tlist.backgroundSkin = backgroundSkin;\n\n\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\tlayout.horizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\tlayout.maxRowCount = 4;\n\t\t\tlist.layout = layout;\n\t\t}\n\n\t//-------------------------\n\t// Alert\n\t//-------------------------\n\n\t\tprotected function setAlertStyles(alert:Alert):void\n\t\t{\n\t\t\tthis.setScrollerStyles(alert);\n\n\t\t\tvar backgroundSkin:Image = new Image(this.backgroundLightBorderSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = SMALL_BACKGROUND_SCALE9_GRID;\n\t\t\talert.backgroundSkin = backgroundSkin;\n\n\t\t\talert.fontStyles = this.lightFontStyles.clone();\n\n\t\t\talert.paddingTop = this.gutterSize;\n\t\t\talert.paddingRight = this.gutterSize;\n\t\t\talert.paddingBottom = this.smallGutterSize;\n\t\t\talert.paddingLeft = this.gutterSize;\n\t\t\talert.outerPadding = this.borderSize;\n\t\t\talert.gap = this.smallGutterSize;\n\t\t\talert.maxWidth = this.popUpFillSize;\n\t\t\talert.maxHeight = this.popUpFillSize;\n\t\t}\n\n\t\t//see Panel section for Header styles\n\n\t\tprotected function setAlertButtonGroupStyles(group:ButtonGroup):void\n\t\t{\n\t\t\tgroup.direction = Direction.HORIZONTAL;\n\t\t\tgroup.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tgroup.verticalAlign = VerticalAlign.JUSTIFY;\n\t\t\tgroup.distributeButtonSizes = false;\n\t\t\tgroup.gap = this.smallGutterSize;\n\t\t\tgroup.padding = this.smallGutterSize;\n\t\t\tgroup.customButtonStyleName = THEME_STYLE_NAME_ALERT_BUTTON_GROUP_BUTTON;\n\t\t}\n\n\t\tprotected function setAlertButtonGroupButtonStyles(button:Button):void\n\t\t{\n\t\t\tthis.setButtonStyles(button);\n\n\t\t\tvar skin:ImageSkin = ImageSkin(button.defaultSkin);\n\t\t\tskin.minWidth = 2 * this.controlSize;\n\t\t}\n\n\t//-------------------------\n\t// Button\n\t//-------------------------\n\n\t\tprotected function setBaseButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tbutton.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tbutton.focusPadding = this.focusPaddingSize;\n\n\t\t\tbutton.paddingTop = this.smallControlGutterSize;\n\t\t\tbutton.paddingBottom = this.smallControlGutterSize;\n\t\t\tbutton.paddingLeft = this.gutterSize;\n\t\t\tbutton.paddingRight = this.gutterSize;\n\t\t\tbutton.gap = this.smallControlGutterSize;\n\t\t\tbutton.minGap = this.smallControlGutterSize;\n\t\t\tbutton.minTouchWidth = this.gridSize;\n\t\t\tbutton.minTouchHeight = this.gridSize;\n\t\t}\n\n\t\tprotected function setButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);\n\t\t\tif(button is ToggleButton)\n\t\t\t{\n\t\t\t\t//for convenience, this function can style both a regular button\n\t\t\t\t//and a toggle button\n\t\t\t\tskin.selectedTexture = this.buttonSelectedUpSkinTexture;\n\t\t\t\tskin.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.buttonSelectedDisabledSkinTexture);\n\t\t\t}\n\t\t\tskin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tbutton.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tbutton.focusPadding = this.focusPaddingSize;\n\n\t\t\tbutton.fontStyles = this.darkUIFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.darkDisabledUIFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\t\t}\n\n\t\tprotected function setCallToActionButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonCallToActionUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonCallToActionDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.fontStyles = this.darkUIFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.darkDisabledUIFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\t\t}\n\n\t\tprotected function setQuietButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar defaultSkin:Quad = new Quad(this.controlSize, this.controlSize, 0xff00ff);\n\t\t\tdefaultSkin.alpha = 0;\n\t\t\tbutton.defaultSkin = defaultSkin;\n\n\t\t\tvar otherSkin:ImageSkin = new ImageSkin(null);\n\t\t\totherSkin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\totherSkin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);\n\t\t\tbutton.downSkin = otherSkin;\n\t\t\tbutton.disabledSkin = otherSkin;\n\t\t\tif(button is ToggleButton)\n\t\t\t{\n\t\t\t\t//for convenience, this function can style both a regular button\n\t\t\t\t//and a toggle button\n\t\t\t\tvar toggleButton:ToggleButton = ToggleButton(button);\n\t\t\t\totherSkin.selectedTexture = this.buttonSelectedUpSkinTexture;\n\t\t\t\ttoggleButton.defaultSelectedSkin = otherSkin;\n\t\t\t}\n\t\t\totherSkin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\totherSkin.width = this.controlSize;\n\t\t\totherSkin.height = this.controlSize;\n\t\t\totherSkin.minWidth = this.controlSize;\n\t\t\totherSkin.minHeight = this.controlSize;\n\n\t\t\tbutton.fontStyles = this.lightUIFontStyles.clone();\n\t\t\tbutton.setFontStylesForState(ButtonState.DOWN, this.darkUIFontStyles.clone());\n\t\t\tbutton.setFontStylesForState(ButtonState.DISABLED, this.lightDisabledUIFontStyles.clone());\n\t\t\tif(button is ToggleButton)\n\t\t\t{\n\t\t\t\t//for convenience, this function can style both a regular button\n\t\t\t\t//and a toggle button\n\t\t\t\ttoggleButton.selectedFontStyles = this.darkUIFontStyles.clone();\n\t\t\t\ttoggleButton.setFontStylesForState(ButtonState.DISABLED_AND_SELECTED, this.darkDisabledUIFontStyles.clone());\n\t\t\t}\n\n\t\t\tbutton.paddingTop = this.smallControlGutterSize;\n\t\t\tbutton.paddingBottom = this.smallControlGutterSize;\n\t\t\tbutton.paddingLeft = this.smallGutterSize;\n\t\t\tbutton.paddingRight = this.smallGutterSize;\n\t\t\tbutton.gap = this.smallControlGutterSize;\n\t\t\tbutton.minGap = this.smallControlGutterSize;\n\t\t\tbutton.minTouchWidth = this.gridSize;\n\t\t\tbutton.minTouchHeight = this.gridSize;\n\t\t\t\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tbutton.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tbutton.focusPadding = this.focusPaddingSize;\n\t\t}\n\n\t\tprotected function setDangerButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonDangerUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDangerDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.fontStyles = this.darkUIFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.darkDisabledUIFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\t\t}\n\n\t\tprotected function setBackButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonBackUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonBackDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonBackDisabledSkinTexture);\n\t\t\tskin.scale9Grid = BACK_BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.fontStyles = this.darkUIFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.darkDisabledUIFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\n\t\t\tbutton.paddingLeft = this.gutterSize + this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setForwardButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonForwardUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonForwardDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonForwardDisabledSkinTexture);\n\t\t\tskin.scale9Grid = FORWARD_BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.fontStyles = this.darkUIFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.darkDisabledUIFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\n\t\t\tbutton.paddingRight = this.gutterSize + this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// ButtonGroup\n\t//-------------------------\n\n\t\tprotected function setButtonGroupStyles(group:ButtonGroup):void\n\t\t{\n\t\t\tgroup.gap = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setButtonGroupButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);\n\t\t\tif(button is ToggleButton)\n\t\t\t{\n\t\t\t\t//for convenience, this function can style both a regular button\n\t\t\t\t//and a toggle button\n\t\t\t\tskin.selectedTexture = this.buttonSelectedUpSkinTexture;\n\t\t\t\tskin.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.buttonSelectedDisabledSkinTexture);\n\t\t\t}\n\t\t\tskin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.popUpFillSize;\n\t\t\tskin.height = this.gridSize;\n\t\t\tskin.minWidth = this.gridSize;\n\t\t\tskin.minHeight = this.gridSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tbutton.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tbutton.focusPadding = this.focusPaddingSize;\n\n\t\t\tbutton.fontStyles = this.largeDarkUIFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.largeDarkUIDisabledFontStyles.clone();\n\n\t\t\tbutton.paddingTop = this.smallGutterSize;\n\t\t\tbutton.paddingBottom = this.smallGutterSize;\n\t\t\tbutton.paddingLeft = this.gutterSize;\n\t\t\tbutton.paddingRight = this.gutterSize;\n\t\t\tbutton.gap = this.smallGutterSize;\n\t\t\tbutton.minGap = this.smallGutterSize;\n\t\t\tbutton.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tbutton.minTouchWidth = this.gridSize;\n\t\t\tbutton.minTouchHeight = this.gridSize;\n\t\t}\n\n\t//-------------------------\n\t// Callout\n\t//-------------------------\n\n\t\tprotected function setCalloutStyles(callout:Callout):void\n\t\t{\n\t\t\tvar backgroundSkin:Image = new Image(this.backgroundLightBorderSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = SMALL_BACKGROUND_SCALE9_GRID;\n\t\t\tbackgroundSkin.width = this.calloutBackgroundMinSize;\n\t\t\tbackgroundSkin.height = this.calloutBackgroundMinSize;\n\t\t\tcallout.backgroundSkin = backgroundSkin;\n\n\t\t\tvar topArrowSkin:Image = new Image(this.calloutTopArrowSkinTexture);\n\t\t\tcallout.topArrowSkin = topArrowSkin;\n\t\t\tcallout.topArrowGap = this.calloutArrowOverlapGap;\n\n\t\t\tvar rightArrowSkin:Image = new Image(this.calloutRightArrowSkinTexture);\n\t\t\tcallout.rightArrowSkin = rightArrowSkin;\n\t\t\tcallout.rightArrowGap = this.calloutArrowOverlapGap;\n\n\t\t\tvar bottomArrowSkin:Image = new Image(this.calloutBottomArrowSkinTexture);\n\t\t\tcallout.bottomArrowSkin = bottomArrowSkin;\n\t\t\tcallout.bottomArrowGap = this.calloutArrowOverlapGap;\n\n\t\t\tvar leftArrowSkin:Image = new Image(this.calloutLeftArrowSkinTexture);\n\t\t\tcallout.leftArrowSkin = leftArrowSkin;\n\t\t\tcallout.leftArrowGap = this.calloutArrowOverlapGap;\n\n\t\t\tcallout.padding = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setDangerCalloutStyles(callout:Callout):void\n\t\t{\n\t\t\tvar backgroundSkin:Image = new Image(this.backgroundDangerBorderSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = SMALL_BACKGROUND_SCALE9_GRID;\n\t\t\tbackgroundSkin.width = this.calloutBackgroundMinSize;\n\t\t\tbackgroundSkin.height = this.calloutBackgroundMinSize;\n\t\t\tcallout.backgroundSkin = backgroundSkin;\n\n\t\t\tvar topArrowSkin:Image = new Image(this.dangerCalloutTopArrowSkinTexture);\n\t\t\tcallout.topArrowSkin = topArrowSkin;\n\t\t\tcallout.topArrowGap = this.calloutArrowOverlapGap;\n\n\t\t\tvar rightArrowSkin:Image = new Image(this.dangerCalloutRightArrowSkinTexture);\n\t\t\tcallout.rightArrowSkin = rightArrowSkin;\n\t\t\tcallout.rightArrowGap = this.calloutArrowOverlapGap;\n\n\t\t\tvar bottomArrowSkin:Image = new Image(this.dangerCalloutBottomArrowSkinTexture);\n\t\t\tcallout.bottomArrowSkin = bottomArrowSkin;\n\t\t\tcallout.bottomArrowGap = this.calloutArrowOverlapGap;\n\n\t\t\tvar leftArrowSkin:Image = new Image(this.dangerCalloutLeftArrowSkinTexture);\n\t\t\tcallout.leftArrowSkin = leftArrowSkin;\n\t\t\tcallout.leftArrowGap = this.calloutArrowOverlapGap;\n\n\t\t\tcallout.padding = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// Check\n\t//-------------------------\n\n\t\tprotected function setCheckStyles(check:Check):void\n\t\t{\n\t\t\tvar skin:Quad = new Quad(this.controlSize, this.controlSize);\n\t\t\tskin.alpha = 0;\n\t\t\tcheck.defaultSkin = skin;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tcheck.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tcheck.focusPadding = this.focusPaddingSize;\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.checkUpIconTexture);\n\t\t\ticon.selectedTexture = this.checkSelectedUpIconTexture;\n\t\t\ticon.setTextureForState(ButtonState.DOWN, this.checkDownIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DISABLED, this.checkDisabledIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.checkSelectedDownIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.checkSelectedDisabledIconTexture);\n\t\t\tcheck.defaultIcon = icon;\n\n\t\t\tcheck.fontStyles = this.lightUIFontStyles.clone();\n\t\t\tcheck.disabledFontStyles = this.lightDisabledUIFontStyles.clone();\n\n\t\t\tcheck.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tcheck.gap = this.smallControlGutterSize;\n\t\t\tcheck.minGap = this.smallControlGutterSize;\n\t\t\tcheck.minTouchWidth = this.gridSize;\n\t\t\tcheck.minTouchHeight = this.gridSize;\n\t\t}\n\n\t//-------------------------\n\t// DataGrid\n\t//-------------------------\n\n\t\tprotected function setDataGridStyles(grid:DataGrid):void\n\t\t{\n\t\t\tthis.setScrollerStyles(grid);\n\t\t\tvar backgroundSkin:Quad = new Quad(this.gridSize, this.gridSize, LIST_BACKGROUND_COLOR);\n\t\t\tgrid.backgroundSkin = backgroundSkin;\n\n\t\t\tvar columnResizeSkin:ImageSkin = new ImageSkin(this.dataGridColumnResizeSkinTexture);\n\t\t\tcolumnResizeSkin.scale9Grid = DATA_GRID_COLUMN_RESIZE_SCALE_9_GRID;\n\t\t\tgrid.columnResizeSkin = columnResizeSkin;\n\n\t\t\tvar columnDropIndicatorSkin:ImageSkin = new ImageSkin(this.dataGridColumnDropIndicatorSkinTexture);\n\t\t\tcolumnDropIndicatorSkin.scale9Grid = DATA_GRID_COLUMN_DROP_INDICATOR_SCALE_9_GRID;\n\t\t\tgrid.columnDropIndicatorSkin = columnDropIndicatorSkin;\n\t\t\tgrid.extendedColumnDropIndicator = true;\n\n\t\t\tvar columnDragOverlaySkin:Quad = new Quad(1, 1, DATA_GRID_COLUMN_OVERLAY_COLOR);\n\t\t\tcolumnDragOverlaySkin.alpha = DATA_GRID_COLUMN_OVERLAY_ALPHA;\n\t\t\tgrid.columnDragOverlaySkin = columnDragOverlaySkin;\n\n\t\t\tgrid.headerDividerFactory = this.dataGridHeaderDividerFactory;\n\t\t\tgrid.verticalDividerFactory = this.dataGridVerticalDividerFactory;\n\t\t}\n\n\t\tprotected function setDataGridHeaderStyles(headerRenderer:DefaultDataGridHeaderRenderer):void\n\t\t{\n\t\t\theaderRenderer.backgroundSkin = new Quad(1, 1, GROUPED_LIST_HEADER_BACKGROUND_COLOR);\n\n\t\t\theaderRenderer.sortAscendingIcon = new ImageSkin(this.dataGridHeaderSortAscendingIconTexture);\n\t\t\theaderRenderer.sortDescendingIcon = new ImageSkin(this.dataGridHeaderSortDescendingIconTexture);\n\n\t\t\theaderRenderer.fontStyles = this.lightUIFontStyles;\n\t\t\theaderRenderer.disabledFontStyles = this.lightDisabledUIFontStyles;\n\t\t\theaderRenderer.padding = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setDataGridCellRendererStyles(cellRenderer:DefaultDataGridCellRenderer):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.itemRendererUpSkinTexture);\n\t\t\tskin.selectedTexture = this.itemRendererSelectedSkinTexture;\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.itemRendererSelectedSkinTexture);\n\t\t\tskin.scale9Grid = ITEM_RENDERER_SCALE9_GRID;\n\t\t\tskin.width = this.gridSize;\n\t\t\tskin.height = this.gridSize;\n\t\t\tskin.minWidth = this.gridSize;\n\t\t\tskin.minHeight = this.gridSize;\n\t\t\tcellRenderer.defaultSkin = skin;\n\n\t\t\tcellRenderer.fontStyles = this.largeLightFontStyles.clone();\n\t\t\tcellRenderer.disabledFontStyles = this.largeLightDisabledFontStyles.clone();\n\t\t\tcellRenderer.selectedFontStyles = this.largeDarkFontStyles.clone();\n\t\t\tcellRenderer.setFontStylesForState(ButtonState.DOWN, this.largeDarkFontStyles.clone());\n\n\t\t\tcellRenderer.iconLabelFontStyles = this.lightFontStyles.clone();\n\t\t\tcellRenderer.iconLabelDisabledFontStyles = this.lightDisabledFontStyles.clone();\n\t\t\tcellRenderer.iconLabelSelectedFontStyles = this.darkFontStyles.clone();\n\t\t\tcellRenderer.setIconLabelFontStylesForState(ButtonState.DOWN, this.darkFontStyles.clone());\n\n\t\t\tcellRenderer.accessoryLabelFontStyles = this.lightFontStyles.clone();\n\t\t\tcellRenderer.accessoryLabelDisabledFontStyles = this.lightDisabledFontStyles.clone();\n\t\t\tcellRenderer.accessoryLabelSelectedFontStyles = this.darkFontStyles.clone();\n\t\t\tcellRenderer.setAccessoryLabelFontStylesForState(ButtonState.DOWN, this.darkFontStyles.clone());\n\n\t\t\tcellRenderer.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tcellRenderer.paddingTop = this.smallGutterSize;\n\t\t\tcellRenderer.paddingBottom = this.smallGutterSize;\n\t\t\tcellRenderer.paddingLeft = this.gutterSize;\n\t\t\tcellRenderer.paddingRight = this.gutterSize;\n\t\t\tcellRenderer.gap = this.gutterSize;\n\t\t\tcellRenderer.minGap = this.gutterSize;\n\t\t\tcellRenderer.iconPosition = RelativePosition.LEFT;\n\t\t\tcellRenderer.accessoryGap = Number.POSITIVE_INFINITY;\n\t\t\tcellRenderer.minAccessoryGap = this.gutterSize;\n\t\t\tcellRenderer.accessoryPosition = RelativePosition.RIGHT;\n\t\t\tcellRenderer.minTouchWidth = this.gridSize;\n\t\t\tcellRenderer.minTouchHeight = this.gridSize;\n\t\t}\n\n\t//-------------------------\n\t// DateTimeSpinner\n\t//-------------------------\n\n\t\tprotected function setDateTimeSpinnerStyles(spinner:DateTimeSpinner):void\n\t\t{\n\t\t\tspinner.customItemRendererStyleName = THEME_STYLE_NAME_DATE_TIME_SPINNER_LIST_ITEM_RENDERER;\n\t\t}\n\n\t\tprotected function setDateTimeSpinnerListItemRendererStyles(itemRenderer:DefaultListItemRenderer):void\n\t\t{\n\t\t\tthis.setSpinnerListItemRendererStyles(itemRenderer);\n\n\t\t\titemRenderer.accessoryPosition = RelativePosition.LEFT;\n\t\t\titemRenderer.gap = this.smallGutterSize;\n\t\t\titemRenderer.minGap = this.smallGutterSize;\n\t\t\titemRenderer.accessoryGap = this.smallGutterSize;\n\t\t\titemRenderer.minAccessoryGap = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// Drawers\n\t//-------------------------\n\n\t\tprotected function setDrawersStyles(drawers:Drawers):void\n\t\t{\n\t\t\tvar overlaySkin:Quad = new Quad(10, 10, DRAWER_OVERLAY_COLOR);\n\t\t\toverlaySkin.alpha = DRAWER_OVERLAY_ALPHA;\n\t\t\tdrawers.overlaySkin = overlaySkin;\n\n\t\t\tvar topDrawerDivider:Quad = new Quad(this.borderSize, this.borderSize, DRAWER_OVERLAY_COLOR);\n\t\t\tdrawers.topDrawerDivider = topDrawerDivider;\n\n\t\t\tvar rightDrawerDivider:Quad = new Quad(this.borderSize, this.borderSize, DRAWER_OVERLAY_COLOR);\n\t\t\tdrawers.rightDrawerDivider = rightDrawerDivider;\n\n\t\t\tvar bottomDrawerDivider:Quad = new Quad(this.borderSize, this.borderSize, DRAWER_OVERLAY_COLOR);\n\t\t\tdrawers.bottomDrawerDivider = bottomDrawerDivider;\n\n\t\t\tvar leftDrawerDivider:Quad = new Quad(this.borderSize, this.borderSize, DRAWER_OVERLAY_COLOR);\n\t\t\tdrawers.leftDrawerDivider = leftDrawerDivider;\n\t\t}\n\n\t//-------------------------\n\t// GroupedList\n\t//-------------------------\n\n\t\tprotected function setGroupedListStyles(list:GroupedList):void\n\t\t{\n\t\t\tthis.setScrollerStyles(list);\n\t\t\tvar backgroundSkin:Quad = new Quad(this.gridSize, this.gridSize, LIST_BACKGROUND_COLOR);\n\t\t\tlist.backgroundSkin = backgroundSkin;\n\t\t}\n\n\t\t//see List section for item renderer styles\n\n\t\tprotected function setGroupedListHeaderRendererStyles(renderer:DefaultGroupedListHeaderOrFooterRenderer):void\n\t\t{\n\t\t\trenderer.backgroundSkin = new Quad(1, 1, GROUPED_LIST_HEADER_BACKGROUND_COLOR);\n\n\t\t\trenderer.fontStyles = this.lightUIFontStyles.clone();\n\t\t\trenderer.disabledFontStyles = this.lightDisabledUIFontStyles.clone();\n\n\t\t\trenderer.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\trenderer.paddingTop = this.smallGutterSize;\n\t\t\trenderer.paddingBottom = this.smallGutterSize;\n\t\t\trenderer.paddingLeft = this.smallGutterSize + this.gutterSize;\n\t\t\trenderer.paddingRight = this.gutterSize;\n\t\t}\n\n\t\tprotected function setGroupedListFooterRendererStyles(renderer:DefaultGroupedListHeaderOrFooterRenderer):void\n\t\t{\n\t\t\trenderer.backgroundSkin = new Quad(1, 1, GROUPED_LIST_FOOTER_BACKGROUND_COLOR);\n\n\t\t\trenderer.fontStyles = this.lightFontStyles.clone();\n\t\t\trenderer.disabledFontStyles = this.lightDisabledFontStyles.clone();\n\n\t\t\trenderer.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\trenderer.paddingTop = renderer.paddingBottom = this.smallGutterSize;\n\t\t\trenderer.paddingLeft = this.smallGutterSize + this.gutterSize;\n\t\t\trenderer.paddingRight = this.gutterSize;\n\t\t}\n\n\t\tprotected function setInsetGroupedListStyles(list:GroupedList):void\n\t\t{\n\t\t\tlist.customItemRendererStyleName = GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_ITEM_RENDERER;\n\t\t\tlist.customFirstItemRendererStyleName = GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_FIRST_ITEM_RENDERER;\n\t\t\tlist.customLastItemRendererStyleName = GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_LAST_ITEM_RENDERER;\n\t\t\tlist.customSingleItemRendererStyleName = GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_SINGLE_ITEM_RENDERER;\n\t\t\tlist.customHeaderRendererStyleName = GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_HEADER_RENDERER;\n\t\t\tlist.customFooterRendererStyleName = GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_FOOTER_RENDERER;\n\n\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\tlayout.useVirtualLayout = true;\n\t\t\tlayout.padding = this.smallGutterSize;\n\t\t\tlayout.gap = 0;\n\t\t\tlayout.horizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\tlayout.verticalAlign = VerticalAlign.TOP;\n\t\t\tlist.layout = layout;\n\t\t}\n\n\t\tprotected function setInsetGroupedListItemRendererStyles(itemRenderer:DefaultGroupedListItemRenderer, defaultSkinTexture:Texture, selectedAndDownSkinTexture:Texture, scale9Grid:Rectangle):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(defaultSkinTexture);\n\t\t\tskin.selectedTexture = selectedAndDownSkinTexture;\n\t\t\tskin.setTextureForState(ButtonState.DOWN, selectedAndDownSkinTexture);\n\t\t\tskin.scale9Grid = scale9Grid;\n\t\t\tskin.width = this.gridSize;\n\t\t\tskin.height = this.gridSize;\n\t\t\tskin.minWidth = this.gridSize;\n\t\t\tskin.minHeight = this.gridSize;\n\t\t\titemRenderer.defaultSkin = skin;\n\n\t\t\titemRenderer.fontStyles = this.largeLightFontStyles.clone();\n\t\t\titemRenderer.disabledFontStyles = this.largeLightDisabledFontStyles.clone();\n\t\t\titemRenderer.selectedFontStyles = this.largeDarkFontStyles.clone();\n\t\t\titemRenderer.setFontStylesForState(ButtonState.DOWN, this.largeDarkFontStyles.clone());\n\n\t\t\titemRenderer.iconLabelFontStyles = this.lightFontStyles.clone();\n\t\t\titemRenderer.iconLabelDisabledFontStyles = this.lightDisabledFontStyles.clone();\n\t\t\titemRenderer.iconLabelSelectedFontStyles = this.darkFontStyles.clone();\n\t\t\titemRenderer.setIconLabelFontStylesForState(ButtonState.DOWN, this.darkFontStyles.clone());\n\n\t\t\titemRenderer.accessoryLabelFontStyles = this.lightFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelDisabledFontStyles = this.lightDisabledFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelSelectedFontStyles = this.darkFontStyles.clone();\n\t\t\titemRenderer.setAccessoryLabelFontStylesForState(ButtonState.DOWN, this.darkFontStyles.clone());\n\n\t\t\titemRenderer.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\titemRenderer.paddingTop = this.smallGutterSize;\n\t\t\titemRenderer.paddingBottom = this.smallGutterSize;\n\t\t\titemRenderer.paddingLeft = this.gutterSize + this.smallGutterSize;\n\t\t\titemRenderer.paddingRight = this.gutterSize;\n\t\t\titemRenderer.gap = this.gutterSize;\n\t\t\titemRenderer.minGap = this.gutterSize;\n\t\t\titemRenderer.iconPosition = RelativePosition.LEFT;\n\t\t\titemRenderer.accessoryGap = Number.POSITIVE_INFINITY;\n\t\t\titemRenderer.minAccessoryGap = this.gutterSize;\n\t\t\titemRenderer.accessoryPosition = RelativePosition.RIGHT;\n\t\t\titemRenderer.minTouchWidth = this.gridSize;\n\t\t\titemRenderer.minTouchHeight = this.gridSize;\n\t\t}\n\n\t\tprotected function setInsetGroupedListMiddleItemRendererStyles(renderer:DefaultGroupedListItemRenderer):void\n\t\t{\n\t\t\tthis.setInsetGroupedListItemRendererStyles(renderer, this.insetItemRendererUpSkinTexture, this.insetItemRendererSelectedSkinTexture, INSET_ITEM_RENDERER_MIDDLE_SCALE9_GRID);\n\t\t}\n\n\t\tprotected function setInsetGroupedListFirstItemRendererStyles(renderer:DefaultGroupedListItemRenderer):void\n\t\t{\n\t\t\tthis.setInsetGroupedListItemRendererStyles(renderer, this.insetItemRendererFirstUpSkinTexture, this.insetItemRendererFirstSelectedSkinTexture, INSET_ITEM_RENDERER_FIRST_SCALE9_GRID);\n\t\t}\n\n\t\tprotected function setInsetGroupedListLastItemRendererStyles(renderer:DefaultGroupedListItemRenderer):void\n\t\t{\n\t\t\tthis.setInsetGroupedListItemRendererStyles(renderer, this.insetItemRendererLastUpSkinTexture, this.insetItemRendererLastSelectedSkinTexture, INSET_ITEM_RENDERER_LAST_SCALE9_GRID);\n\t\t}\n\n\t\tprotected function setInsetGroupedListSingleItemRendererStyles(renderer:DefaultGroupedListItemRenderer):void\n\t\t{\n\t\t\tthis.setInsetGroupedListItemRendererStyles(renderer, this.insetItemRendererSingleUpSkinTexture, this.insetItemRendererSingleSelectedSkinTexture, INSET_ITEM_RENDERER_SINGLE_SCALE9_GRID);\n\t\t}\n\n\t\tprotected function setInsetGroupedListHeaderRendererStyles(headerRenderer:DefaultGroupedListHeaderOrFooterRenderer):void\n\t\t{\n\t\t\tvar defaultSkin:Quad = new Quad(this.controlSize, this.controlSize, 0xff00ff);\n\t\t\tdefaultSkin.alpha = 0;\n\t\t\theaderRenderer.backgroundSkin = defaultSkin;\n\n\t\t\theaderRenderer.fontStyles = this.lightUIFontStyles.clone();\n\t\t\theaderRenderer.disabledFontStyles = this.lightDisabledUIFontStyles.clone();\n\n\t\t\theaderRenderer.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\theaderRenderer.paddingTop = this.smallGutterSize;\n\t\t\theaderRenderer.paddingBottom = this.smallGutterSize;\n\t\t\theaderRenderer.paddingLeft = this.gutterSize + this.smallGutterSize;\n\t\t\theaderRenderer.paddingRight = this.gutterSize;\n\t\t}\n\n\t\tprotected function setInsetGroupedListFooterRendererStyles(footerRenderer:DefaultGroupedListHeaderOrFooterRenderer):void\n\t\t{\n\t\t\tvar defaultSkin:Quad = new Quad(this.controlSize, this.controlSize, 0xff00ff);\n\t\t\tdefaultSkin.alpha = 0;\n\t\t\tfooterRenderer.backgroundSkin = defaultSkin;\n\n\t\t\tfooterRenderer.fontStyles = this.lightFontStyles.clone();\n\t\t\tfooterRenderer.disabledFontStyles = this.lightDisabledFontStyles.clone();\n\n\t\t\tfooterRenderer.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tfooterRenderer.paddingTop = this.smallGutterSize;\n\t\t\tfooterRenderer.paddingBottom = this.smallGutterSize;\n\t\t\tfooterRenderer.paddingLeft = this.gutterSize + this.smallGutterSize;\n\t\t\tfooterRenderer.paddingRight = this.gutterSize;\n\t\t}\n\n\t//-------------------------\n\t// Header\n\t//-------------------------\n\n\t\tprotected function setHeaderStyles(header:Header):void\n\t\t{\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.headerBackgroundSkinTexture);\n\t\t\tbackgroundSkin.tileGrid = new Rectangle();\n\t\t\tbackgroundSkin.width = this.gridSize;\n\t\t\tbackgroundSkin.height = this.gridSize;\n\t\t\tbackgroundSkin.minWidth = this.gridSize;\n\t\t\tbackgroundSkin.minHeight = this.gridSize;\n\t\t\theader.backgroundSkin = backgroundSkin;\n\n\t\t\theader.fontStyles = this.xlargeLightUIFontStyles.clone();\n\t\t\theader.disabledFontStyles = this.xlargeLightUIDisabledFontStyles.clone();\n\n\t\t\theader.padding = this.smallGutterSize;\n\t\t\theader.gap = this.smallGutterSize;\n\t\t\theader.titleGap = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// Label\n\t//-------------------------\n\n\t\tprotected function setLabelStyles(label:Label):void\n\t\t{\n\t\t\tlabel.fontStyles = this.lightFontStyles.clone();\n\t\t\tlabel.disabledFontStyles = this.lightDisabledFontStyles.clone();\n\t\t}\n\n\t\tprotected function setHeadingLabelStyles(label:Label):void\n\t\t{\n\t\t\tlabel.fontStyles = this.largeLightFontStyles.clone();\n\t\t\tlabel.disabledFontStyles = this.largeLightDisabledFontStyles.clone();\n\t\t}\n\n\t\tprotected function setDetailLabelStyles(label:Label):void\n\t\t{\n\t\t\tlabel.fontStyles = this.smallLightFontStyles.clone();\n\t\t\tlabel.disabledFontStyles = this.smallLightDisabledFontStyles.clone();\n\t\t}\n\n\t//-------------------------\n\t// LayoutGroup\n\t//-------------------------\n\n\t\tprotected function setToolbarLayoutGroupStyles(group:LayoutGroup):void\n\t\t{\n\t\t\tif(!group.layout)\n\t\t\t{\n\t\t\t\tvar layout:HorizontalLayout = new HorizontalLayout();\n\t\t\t\tlayout.padding = this.smallGutterSize;\n\t\t\t\tlayout.gap = this.smallGutterSize;\n\t\t\t\tlayout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\t\tgroup.layout = layout;\n\t\t\t}\n\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.headerBackgroundSkinTexture);\n\t\t\tbackgroundSkin.tileGrid = new Rectangle();\n\t\t\tbackgroundSkin.width = this.gridSize;\n\t\t\tbackgroundSkin.height = this.gridSize;\n\t\t\tbackgroundSkin.minWidth = this.gridSize;\n\t\t\tbackgroundSkin.minHeight = this.gridSize;\n\t\t\tgroup.backgroundSkin = backgroundSkin;\n\t\t}\n\n\t//-------------------------\n\t// List\n\t//-------------------------\n\n\t\tprotected function setListStyles(list:List):void\n\t\t{\n\t\t\tthis.setScrollerStyles(list);\n\n\t\t\tvar backgroundSkin:Quad = new Quad(this.gridSize, this.gridSize, LIST_BACKGROUND_COLOR);\n\t\t\tlist.backgroundSkin = backgroundSkin;\n\n\t\t\tvar dropIndicatorSkin:Quad = new Quad(this.borderSize, this.borderSize, LIGHT_TEXT_COLOR);\n\t\t\tlist.dropIndicatorSkin = dropIndicatorSkin;\n\t\t}\n\n\t\tprotected function setListItemRendererStyles(itemRenderer:DefaultListItemRenderer):void\n\t\t{\n\t\t\tthis.setItemRendererStyles(itemRenderer);\n\n\t\t\tvar dragIcon:ImageSkin = new ImageSkin(this.dragHandleIcon);\n\t\t\tdragIcon.minTouchWidth = this.gridSize;\n\t\t\tdragIcon.minTouchHeight = this.gridSize;\n\t\t\titemRenderer.dragIcon = dragIcon;\n\t\t}\n\n\t\tprotected function setItemRendererStyles(itemRenderer:BaseDefaultItemRenderer):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.itemRendererUpSkinTexture);\n\t\t\tskin.selectedTexture = this.itemRendererSelectedSkinTexture;\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.itemRendererSelectedSkinTexture);\n\t\t\tskin.scale9Grid = ITEM_RENDERER_SCALE9_GRID;\n\t\t\tskin.width = this.gridSize;\n\t\t\tskin.height = this.gridSize;\n\t\t\tskin.minWidth = this.gridSize;\n\t\t\tskin.minHeight = this.gridSize;\n\t\t\titemRenderer.defaultSkin = skin;\n\n\t\t\titemRenderer.fontStyles = this.largeLightFontStyles.clone();\n\t\t\titemRenderer.disabledFontStyles = this.largeLightDisabledFontStyles.clone();\n\t\t\titemRenderer.selectedFontStyles = this.largeDarkFontStyles.clone();\n\t\t\titemRenderer.setFontStylesForState(ButtonState.DOWN, this.largeDarkFontStyles.clone());\n\n\t\t\titemRenderer.iconLabelFontStyles = this.lightFontStyles.clone();\n\t\t\titemRenderer.iconLabelDisabledFontStyles = this.lightDisabledFontStyles.clone();\n\t\t\titemRenderer.iconLabelSelectedFontStyles = this.darkFontStyles.clone();\n\t\t\titemRenderer.setIconLabelFontStylesForState(ButtonState.DOWN, this.darkFontStyles.clone());\n\n\t\t\titemRenderer.accessoryLabelFontStyles = this.lightFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelDisabledFontStyles = this.lightDisabledFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelSelectedFontStyles = this.darkFontStyles.clone();\n\t\t\titemRenderer.setAccessoryLabelFontStylesForState(ButtonState.DOWN, this.darkFontStyles.clone());\n\n\t\t\titemRenderer.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\titemRenderer.paddingTop = this.smallGutterSize;\n\t\t\titemRenderer.paddingBottom = this.smallGutterSize;\n\t\t\titemRenderer.paddingLeft = this.gutterSize;\n\t\t\titemRenderer.paddingRight = this.gutterSize;\n\t\t\titemRenderer.gap = this.gutterSize;\n\t\t\titemRenderer.minGap = this.gutterSize;\n\t\t\titemRenderer.iconPosition = RelativePosition.LEFT;\n\t\t\titemRenderer.accessoryGap = Number.POSITIVE_INFINITY;\n\t\t\titemRenderer.minAccessoryGap = this.gutterSize;\n\t\t\titemRenderer.accessoryPosition = RelativePosition.RIGHT;\n\t\t\titemRenderer.minTouchWidth = this.gridSize;\n\t\t\titemRenderer.minTouchHeight = this.gridSize;\n\t\t}\n\n\t\tprotected function setDrillDownItemRendererStyles(itemRenderer:DefaultListItemRenderer):void\n\t\t{\n\t\t\tthis.setItemRendererStyles(itemRenderer);\n\n\t\t\titemRenderer.itemHasAccessory = false;\n\n\t\t\tvar accessorySkin:ImageSkin = new ImageSkin(this.listDrillDownAccessoryTexture);\n\t\t\taccessorySkin.selectedTexture = this.listDrillDownAccessorySelectedTexture;\n\t\t\taccessorySkin.setTextureForState(ButtonState.DOWN, this.listDrillDownAccessorySelectedTexture);\n\t\t\titemRenderer.defaultAccessory = accessorySkin;\n\t\t}\n\n\t\tprotected function setCheckItemRendererStyles(itemRenderer:BaseDefaultItemRenderer):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.itemRendererUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.itemRendererSelectedSkinTexture);\n\t\t\tskin.scale9Grid = ITEM_RENDERER_SCALE9_GRID;\n\t\t\tskin.width = this.gridSize;\n\t\t\tskin.height = this.gridSize;\n\t\t\tskin.minWidth = this.gridSize;\n\t\t\tskin.minHeight = this.gridSize;\n\t\t\titemRenderer.defaultSkin = skin;\n\n\t\t\tvar defaultSelectedIcon:ImageLoader = new ImageLoader();\n\t\t\tdefaultSelectedIcon.source = this.pickerListItemSelectedIconTexture;\n\t\t\titemRenderer.defaultSelectedIcon = defaultSelectedIcon;\n\t\t\tdefaultSelectedIcon.validate();\n\n\t\t\tvar defaultIcon:Quad = new Quad(defaultSelectedIcon.width, defaultSelectedIcon.height, 0xff00ff);\n\t\t\tdefaultIcon.alpha = 0;\n\t\t\titemRenderer.defaultIcon = defaultIcon;\n\n\t\t\titemRenderer.fontStyles = this.largeLightFontStyles.clone();\n\t\t\titemRenderer.disabledFontStyles = this.largeLightDisabledFontStyles.clone();\n\t\t\titemRenderer.setFontStylesForState(ButtonState.DOWN, this.largeDarkFontStyles.clone());\n\n\t\t\titemRenderer.iconLabelFontStyles = this.lightFontStyles.clone();\n\t\t\titemRenderer.iconLabelDisabledFontStyles = this.lightDisabledFontStyles.clone();\n\t\t\titemRenderer.setIconLabelFontStylesForState(ButtonState.DOWN, this.darkFontStyles.clone());\n\n\t\t\titemRenderer.accessoryLabelFontStyles = this.lightFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelDisabledFontStyles = this.lightDisabledFontStyles.clone();\n\t\t\titemRenderer.setAccessoryLabelFontStylesForState(ButtonState.DOWN, this.darkFontStyles.clone());\n\n\t\t\titemRenderer.itemHasIcon = false;\n\t\t\titemRenderer.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\titemRenderer.paddingTop = this.smallGutterSize;\n\t\t\titemRenderer.paddingBottom = this.smallGutterSize;\n\t\t\titemRenderer.paddingLeft = this.gutterSize;\n\t\t\titemRenderer.paddingRight = this.gutterSize;\n\t\t\titemRenderer.gap = Number.POSITIVE_INFINITY;\n\t\t\titemRenderer.minGap = this.gutterSize;\n\t\t\titemRenderer.iconPosition = RelativePosition.RIGHT;\n\t\t\titemRenderer.accessoryGap = this.smallGutterSize;\n\t\t\titemRenderer.minAccessoryGap = this.smallGutterSize;\n\t\t\titemRenderer.accessoryPosition = RelativePosition.BOTTOM;\n\t\t\titemRenderer.layoutOrder = ItemRendererLayoutOrder.LABEL_ACCESSORY_ICON;\n\t\t\titemRenderer.minTouchWidth = this.gridSize;\n\t\t\titemRenderer.minTouchHeight = this.gridSize;\n\t\t}\n\n\t//-------------------------\n\t// NumericStepper\n\t//-------------------------\n\n\t\tprotected function setNumericStepperStyles(stepper:NumericStepper):void\n\t\t{\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tstepper.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tstepper.focusPadding = this.focusPaddingSize;\n\n\t\t\tstepper.useLeftAndRightKeys = true;\n\n\t\t\tstepper.buttonLayoutMode = StepperButtonLayoutMode.SPLIT_HORIZONTAL;\n\t\t\tstepper.incrementButtonLabel = \"+\";\n\t\t\tstepper.decrementButtonLabel = \"-\";\n\t\t}\n\n\t\tprotected function setNumericStepperTextInputStyles(input:TextInput):void\n\t\t{\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.backgroundSkinTexture);\n\t\t\tbackgroundSkin.setTextureForState(TextInputState.DISABLED, this.backgroundDisabledSkinTexture);\n\t\t\tbackgroundSkin.setTextureForState(TextInputState.FOCUSED, this.backgroundInsetFocusedSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = DEFAULT_BACKGROUND_SCALE9_GRID;\n\t\t\tbackgroundSkin.width = this.controlSize;\n\t\t\tbackgroundSkin.height = this.controlSize;\n\t\t\tbackgroundSkin.minWidth = this.controlSize;\n\t\t\tbackgroundSkin.minHeight = this.controlSize;\n\t\t\tinput.backgroundSkin = backgroundSkin;\n\n\t\t\tinput.textEditorFactory = stepperTextEditorFactory;\n\t\t\tinput.fontStyles = this.lightCenteredUIFontStyles.clone();\n\t\t\tinput.disabledFontStyles = this.lightCenteredDisabledUIFontStyles.clone();\n\n\t\t\tinput.minTouchWidth = this.gridSize;\n\t\t\tinput.minTouchHeight = this.gridSize;\n\t\t\tinput.gap = this.smallControlGutterSize;\n\t\t\tinput.paddingTop = this.smallControlGutterSize;\n\t\t\tinput.paddingRight = this.smallGutterSize;\n\t\t\tinput.paddingBottom = this.smallControlGutterSize;\n\t\t\tinput.paddingLeft = this.smallGutterSize;\n\t\t\tinput.isEditable = false;\n\t\t\tinput.isSelectable = false;\n\t\t}\n\n\t\tprotected function setNumericStepperButtonStyles(button:Button):void\n\t\t{\n\t\t\tthis.setButtonStyles(button);\n\t\t\tbutton.keepDownStateOnRollOut = true;\n\t\t}\n\n\t//-------------------------\n\t// PageIndicator\n\t//-------------------------\n\n\t\tprotected function setPageIndicatorStyles(pageIndicator:PageIndicator):void\n\t\t{\n\t\t\tpageIndicator.normalSymbolFactory = this.pageIndicatorNormalSymbolFactory;\n\t\t\tpageIndicator.selectedSymbolFactory = this.pageIndicatorSelectedSymbolFactory;\n\t\t\tpageIndicator.gap = this.smallGutterSize;\n\t\t\tpageIndicator.padding = this.smallGutterSize;\n\t\t\tpageIndicator.minTouchWidth = this.smallControlSize * 2;\n\t\t\tpageIndicator.minTouchHeight = this.smallControlSize * 2;\n\t\t}\n\n\t//-------------------------\n\t// Panel\n\t//-------------------------\n\n\t\tprotected function setPanelStyles(panel:Panel):void\n\t\t{\n\t\t\tthis.setScrollerStyles(panel);\n\n\t\t\tvar backgroundSkin:Image = new Image(this.backgroundLightBorderSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = SMALL_BACKGROUND_SCALE9_GRID;\n\t\t\tpanel.backgroundSkin = backgroundSkin;\n\t\t\tpanel.padding = this.smallGutterSize;\n\t\t\tpanel.outerPadding = this.borderSize;\n\t\t}\n\n\t\tprotected function setPopUpHeaderStyles(header:Header):void\n\t\t{\n\t\t\theader.padding = this.smallGutterSize;\n\t\t\theader.gap = this.smallGutterSize;\n\t\t\theader.titleGap = this.smallGutterSize;\n\n\t\t\theader.fontStyles = this.xlargeLightUIFontStyles.clone();\n\t\t\theader.disabledFontStyles = this.xlargeLightUIDisabledFontStyles.clone();\n\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.popUpHeaderBackgroundSkinTexture);\n\t\t\tbackgroundSkin.tileGrid = new Rectangle();\n\t\t\tbackgroundSkin.width = this.gridSize;\n\t\t\tbackgroundSkin.height = this.gridSize;\n\t\t\tbackgroundSkin.minWidth = this.gridSize;\n\t\t\tbackgroundSkin.minHeight = this.gridSize;\n\t\t\theader.backgroundSkin = backgroundSkin;\n\t\t}\n\n\t//-------------------------\n\t// PanelScreen\n\t//-------------------------\n\n\t\tprotected function setPanelScreenStyles(screen:PanelScreen):void\n\t\t{\n\t\t\tthis.setScrollerStyles(screen);\n\t\t}\n\n\t\tprotected function setPanelScreenHeaderStyles(header:Header):void\n\t\t{\n\t\t\tthis.setHeaderStyles(header);\n\t\t\theader.useExtraPaddingForOSStatusBar = true;\n\t\t}\n\n\t//-------------------------\n\t// PickerList\n\t//-------------------------\n\n\t\tprotected function setPickerListStyles(list:PickerList):void\n\t\t{\n\t\t\tif(DeviceCapabilities.isPhone(this.starling.nativeStage))\n\t\t\t{\n\t\t\t\tlist.listFactory = pickerListSpinnerListFactory;\n\t\t\t\tlist.popUpContentManager = new BottomDrawerPopUpContentManager();\n\t\t\t}\n\t\t\telse //tablet or desktop\n\t\t\t{\n\t\t\t\tlist.popUpContentManager = new CalloutPopUpContentManager();\n\t\t\t\tlist.customItemRendererStyleName = THEME_STYLE_NAME_TABLET_PICKER_LIST_ITEM_RENDERER;\n\t\t\t}\n\t\t}\n\n\t\tprotected function setPickerListPopUpListStyles(list:List):void\n\t\t{\n\t\t\tthis.setDropDownListStyles(list);\n\t\t}\n\n\t\tprotected function setPickerListItemRendererStyles(itemRenderer:BaseDefaultItemRenderer):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.itemRendererUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.itemRendererSelectedSkinTexture);\n\t\t\tskin.scale9Grid = ITEM_RENDERER_SCALE9_GRID;\n\t\t\tskin.width = this.popUpFillSize;\n\t\t\tskin.height = this.gridSize;\n\t\t\tskin.minWidth = this.popUpFillSize;\n\t\t\tskin.minHeight = this.gridSize;\n\t\t\titemRenderer.defaultSkin = skin;\n\n\t\t\tvar defaultSelectedIcon:ImageLoader = new ImageLoader();\n\t\t\tdefaultSelectedIcon.source = this.pickerListItemSelectedIconTexture;\n\t\t\titemRenderer.defaultSelectedIcon = defaultSelectedIcon;\n\t\t\tdefaultSelectedIcon.validate();\n\n\t\t\tvar defaultIcon:Quad = new Quad(defaultSelectedIcon.width, defaultSelectedIcon.height, 0xff00ff);\n\t\t\tdefaultIcon.alpha = 0;\n\t\t\titemRenderer.defaultIcon = defaultIcon;\n\n\t\t\titemRenderer.fontStyles = this.largeLightFontStyles.clone();\n\t\t\titemRenderer.disabledFontStyles = this.largeLightDisabledFontStyles.clone();\n\t\t\titemRenderer.setFontStylesForState(ButtonState.DOWN, this.largeDarkFontStyles.clone());\n\n\t\t\titemRenderer.iconLabelFontStyles = this.lightFontStyles.clone();\n\t\t\titemRenderer.iconLabelDisabledFontStyles = this.lightDisabledFontStyles.clone();\n\t\t\titemRenderer.setIconLabelFontStylesForState(ButtonState.DOWN, this.darkFontStyles.clone());\n\n\t\t\titemRenderer.accessoryLabelFontStyles = this.lightFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelDisabledFontStyles = this.lightDisabledFontStyles.clone();\n\t\t\titemRenderer.setAccessoryLabelFontStylesForState(ButtonState.DOWN, this.darkFontStyles.clone());\n\n\t\t\titemRenderer.itemHasIcon = false;\n\t\t\titemRenderer.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\titemRenderer.paddingTop = this.smallGutterSize;\n\t\t\titemRenderer.paddingBottom = this.smallGutterSize;\n\t\t\titemRenderer.paddingLeft = this.gutterSize;\n\t\t\titemRenderer.paddingRight = this.gutterSize;\n\t\t\titemRenderer.gap = Number.POSITIVE_INFINITY;\n\t\t\titemRenderer.minGap = this.gutterSize;\n\t\t\titemRenderer.iconPosition = RelativePosition.RIGHT;\n\t\t\titemRenderer.accessoryGap = this.smallGutterSize;\n\t\t\titemRenderer.minAccessoryGap = this.smallGutterSize;\n\t\t\titemRenderer.accessoryPosition = RelativePosition.BOTTOM;\n\t\t\titemRenderer.layoutOrder = ItemRendererLayoutOrder.LABEL_ACCESSORY_ICON;\n\t\t\titemRenderer.minTouchWidth = this.gridSize;\n\t\t\titemRenderer.minTouchHeight = this.gridSize;\n\t\t}\n\n\t\tprotected function setPickerListButtonStyles(button:Button):void\n\t\t{\n\t\t\tthis.setButtonStyles(button);\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.pickerListButtonIconTexture);\n\t\t\ticon.selectedTexture = this.pickerListButtonSelectedIconTexture;\n\t\t\ticon.setTextureForState(ButtonState.DISABLED, this.pickerListButtonIconDisabledTexture);\n\t\t\tbutton.defaultIcon = icon;\n\n\t\t\tbutton.gap = Number.POSITIVE_INFINITY;\n\t\t\tbutton.minGap = this.gutterSize;\n\t\t\tbutton.iconPosition = RelativePosition.RIGHT;\n\t\t}\n\n\t//-------------------------\n\t// ProgressBar\n\t//-------------------------\n\n\t\tprotected function setProgressBarStyles(progress:ProgressBar):void\n\t\t{\n\t\t\tvar backgroundSkin:Image = new Image(this.backgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = DEFAULT_BACKGROUND_SCALE9_GRID;\n\t\t\tif(progress.direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tbackgroundSkin.width = this.smallControlSize;\n\t\t\t\tbackgroundSkin.height = this.wideControlSize;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbackgroundSkin.width = this.wideControlSize;\n\t\t\t\tbackgroundSkin.height = this.smallControlSize;\n\t\t\t}\n\t\t\tprogress.backgroundSkin = backgroundSkin;\n\n\t\t\tvar backgroundDisabledSkin:Image = new Image(this.backgroundDisabledSkinTexture);\n\t\t\tbackgroundDisabledSkin.scale9Grid = DEFAULT_BACKGROUND_SCALE9_GRID;\n\t\t\tif(progress.direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tbackgroundDisabledSkin.width = this.smallControlSize;\n\t\t\t\tbackgroundDisabledSkin.height = this.wideControlSize;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbackgroundDisabledSkin.width = this.wideControlSize;\n\t\t\t\tbackgroundDisabledSkin.height = this.smallControlSize;\n\t\t\t}\n\t\t\tprogress.backgroundDisabledSkin = backgroundDisabledSkin;\n\n\t\t\tvar fillSkin:Image = new Image(this.buttonUpSkinTexture);\n\t\t\tfillSkin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tfillSkin.width = this.smallControlSize;\n\t\t\tfillSkin.height = this.smallControlSize;\n\t\t\tprogress.fillSkin = fillSkin;\n\n\t\t\tvar fillDisabledSkin:Image = new Image(this.buttonDisabledSkinTexture);\n\t\t\tfillDisabledSkin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tfillDisabledSkin.width = this.smallControlSize;\n\t\t\tfillDisabledSkin.height = this.smallControlSize;\n\t\t\tprogress.fillDisabledSkin = fillDisabledSkin;\n\t\t}\n\n\t//-------------------------\n\t// Radio\n\t//-------------------------\n\n\t\tprotected function setRadioStyles(radio:Radio):void\n\t\t{\n\t\t\tvar skin:Quad = new Quad(this.controlSize, this.controlSize);\n\t\t\tskin.alpha = 0;\n\t\t\tradio.defaultSkin = skin;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tradio.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tradio.focusPadding = this.focusPaddingSize;\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.radioUpIconTexture);\n\t\t\ticon.selectedTexture = this.radioSelectedUpIconTexture;\n\t\t\ticon.setTextureForState(ButtonState.DOWN, this.radioDownIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DISABLED, this.radioDisabledIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.radioSelectedDownIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.radioSelectedDisabledIconTexture);\n\t\t\tradio.defaultIcon = icon;\n\n\t\t\tradio.fontStyles = this.lightUIFontStyles.clone();\n\t\t\tradio.disabledFontStyles = this.lightDisabledUIFontStyles.clone();\n\n\t\t\tradio.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tradio.gap = this.smallControlGutterSize;\n\t\t\tradio.minGap = this.smallControlGutterSize;\n\t\t\tradio.minTouchWidth = this.gridSize;\n\t\t\tradio.minTouchHeight = this.gridSize;\n\t\t}\n\n\t//-------------------------\n\t// ScrollContainer\n\t//-------------------------\n\n\t\tprotected function setScrollContainerStyles(container:ScrollContainer):void\n\t\t{\n\t\t\tthis.setScrollerStyles(container);\n\t\t}\n\n\t\tprotected function setToolbarScrollContainerStyles(container:ScrollContainer):void\n\t\t{\n\t\t\tthis.setScrollerStyles(container);\n\t\t\tif(!container.layout)\n\t\t\t{\n\t\t\t\tvar layout:HorizontalLayout = new HorizontalLayout();\n\t\t\t\tlayout.padding = this.smallGutterSize;\n\t\t\t\tlayout.gap = this.smallGutterSize;\n\t\t\t\tlayout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\t\tcontainer.layout = layout;\n\t\t\t}\n\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.headerBackgroundSkinTexture);\n\t\t\tbackgroundSkin.tileGrid = new Rectangle();\n\t\t\tbackgroundSkin.width = this.gridSize;\n\t\t\tbackgroundSkin.height = this.gridSize;\n\t\t\tbackgroundSkin.minWidth = this.gridSize;\n\t\t\tbackgroundSkin.minHeight = this.gridSize;\n\t\t\tcontainer.backgroundSkin = backgroundSkin;\n\t\t}\n\n\t//-------------------------\n\t// ScrollScreen\n\t//-------------------------\n\n\t\tprotected function setScrollScreenStyles(screen:ScrollScreen):void\n\t\t{\n\t\t\tthis.setScrollerStyles(screen);\n\t\t}\n\n\t//-------------------------\n\t// ScrollText\n\t//-------------------------\n\n\t\tprotected function setScrollTextStyles(text:ScrollText):void\n\t\t{\n\t\t\tthis.setScrollerStyles(text);\n\n\t\t\ttext.fontStyles = this.lightScrollTextFontStyles.clone();\n\t\t\ttext.disabledFontStyles = this.lightDisabledScrollTextFontStyles.clone();\n\n\t\t\ttext.padding = this.gutterSize;\n\t\t\ttext.paddingRight = this.gutterSize + this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// SimpleScrollBar\n\t//-------------------------\n\n\t\tprotected function setSimpleScrollBarStyles(scrollBar:SimpleScrollBar):void\n\t\t{\n\t\t\tif(scrollBar.direction == Direction.HORIZONTAL)\n\t\t\t{\n\t\t\t\tscrollBar.paddingRight = this.scrollBarGutterSize;\n\t\t\t\tscrollBar.paddingBottom = this.scrollBarGutterSize;\n\t\t\t\tscrollBar.paddingLeft = this.scrollBarGutterSize;\n\t\t\t\tscrollBar.customThumbStyleName = THEME_STYLE_NAME_HORIZONTAL_SIMPLE_SCROLL_BAR_THUMB;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tscrollBar.paddingTop = this.scrollBarGutterSize;\n\t\t\t\tscrollBar.paddingRight = this.scrollBarGutterSize;\n\t\t\t\tscrollBar.paddingBottom = this.scrollBarGutterSize;\n\t\t\t\tscrollBar.customThumbStyleName = THEME_STYLE_NAME_VERTICAL_SIMPLE_SCROLL_BAR_THUMB;\n\t\t\t}\n\t\t}\n\n\t\tprotected function setHorizontalSimpleScrollBarThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar defaultSkin:Image = new Image(this.horizontalScrollBarThumbSkinTexture);\n\t\t\tdefaultSkin.scale9Grid = HORIZONTAL_SCROLL_BAR_THUMB_SCALE9_GRID;\n\t\t\tdefaultSkin.width = this.gutterSize;\n\t\t\tthumb.defaultSkin = defaultSkin;\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVerticalSimpleScrollBarThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar defaultSkin:Image = new Image(this.verticalScrollBarThumbSkinTexture);\n\t\t\tdefaultSkin.scale9Grid = VERTICAL_SCROLL_BAR_THUMB_SCALE9_GRID;\n\t\t\tdefaultSkin.height = this.gutterSize;\n\t\t\tthumb.defaultSkin = defaultSkin;\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t//-------------------------\n\t// Slider\n\t//-------------------------\n\n\t\tprotected function setSliderStyles(slider:Slider):void\n\t\t{\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tslider.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tslider.focusPadding = this.focusPaddingSize;\n\n\t\t\tslider.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tif(slider.direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tslider.customMinimumTrackStyleName = THEME_STYLE_NAME_VERTICAL_SLIDER_MINIMUM_TRACK;\n\t\t\t\tslider.customMaximumTrackStyleName = THEME_STYLE_NAME_VERTICAL_SLIDER_MAXIMUM_TRACK;\n\t\t\t}\n\t\t\telse //horizontal\n\t\t\t{\n\t\t\t\tslider.customMinimumTrackStyleName = THEME_STYLE_NAME_HORIZONTAL_SLIDER_MINIMUM_TRACK;\n\t\t\t\tslider.customMaximumTrackStyleName = THEME_STYLE_NAME_HORIZONTAL_SLIDER_MAXIMUM_TRACK;\n\t\t\t}\n\t\t}\n\n\t\tprotected function setHorizontalSliderMinimumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.backgroundSkinTexture);\n\t\t\tskin.disabledTexture = this.backgroundDisabledSkinTexture;\n\t\t\tskin.scale9Grid = DEFAULT_BACKGROUND_SCALE9_GRID;\n\t\t\tskin.width = this.wideControlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.wideControlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\ttrack.defaultSkin = skin;\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setHorizontalSliderMaximumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.backgroundSkinTexture);\n\t\t\tskin.disabledTexture = this.backgroundDisabledSkinTexture;\n\t\t\tskin.scale9Grid = DEFAULT_BACKGROUND_SCALE9_GRID;\n\t\t\tskin.width = this.wideControlSize;\n\t\t\tskin.minWidth = this.wideControlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\ttrack.defaultSkin = skin;\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVerticalSliderMinimumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.backgroundSkinTexture);\n\t\t\tskin.disabledTexture = this.backgroundDisabledSkinTexture;\n\t\t\tskin.scale9Grid = DEFAULT_BACKGROUND_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.wideControlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.wideControlSize;\n\t\t\ttrack.defaultSkin = skin;\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVerticalSliderMaximumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.backgroundSkinTexture);\n\t\t\tskin.disabledTexture = this.backgroundDisabledSkinTexture;\n\t\t\tskin.scale9Grid = DEFAULT_BACKGROUND_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.wideControlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.wideControlSize;\n\t\t\ttrack.defaultSkin = skin;\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t//-------------------------\n\t// SpinnerList\n\t//-------------------------\n\n\t\tprotected function setSpinnerListStyles(list:SpinnerList):void\n\t\t{\n\t\t\tthis.setScrollerStyles(list);\n\t\t\t\n\t\t\tvar backgroundSkin:Image = new Image(this.backgroundDarkBorderSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = SMALL_BACKGROUND_SCALE9_GRID;\n\t\t\tlist.backgroundSkin = backgroundSkin;\n\t\t\t\n\t\t\tvar selectionOverlaySkin:Image = new Image(this.spinnerListSelectionOverlaySkinTexture);\n\t\t\tselectionOverlaySkin.scale9Grid = SPINNER_LIST_SELECTION_OVERLAY_SCALE9_GRID;\n\t\t\tlist.selectionOverlaySkin = selectionOverlaySkin;\n\t\t\t\n\t\t\tlist.customItemRendererStyleName = THEME_STYLE_NAME_SPINNER_LIST_ITEM_RENDERER;\n\n\t\t\tlist.paddingTop = this.borderSize;\n\t\t\tlist.paddingBottom = this.borderSize;\n\t\t}\n\n\t\tprotected function setSpinnerListItemRendererStyles(itemRenderer:DefaultListItemRenderer):void\n\t\t{\n\t\t\tvar defaultSkin:Quad = new Quad(this.gridSize, this.gridSize, 0xff00ff);\n\t\t\tdefaultSkin.alpha = 0;\n\t\t\titemRenderer.defaultSkin = defaultSkin;\n\n\t\t\titemRenderer.fontStyles = this.largeLightFontStyles.clone();\n\t\t\titemRenderer.disabledFontStyles = this.largeLightDisabledFontStyles.clone();\n\n\t\t\titemRenderer.iconLabelFontStyles = this.lightFontStyles.clone();\n\t\t\titemRenderer.iconLabelDisabledFontStyles = this.lightDisabledFontStyles.clone();\n\n\t\t\titemRenderer.accessoryLabelFontStyles = this.lightFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelDisabledFontStyles = this.lightDisabledFontStyles.clone();\n\n\t\t\titemRenderer.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\titemRenderer.paddingTop = this.smallGutterSize;\n\t\t\titemRenderer.paddingBottom = this.smallGutterSize;\n\t\t\titemRenderer.paddingLeft = this.gutterSize;\n\t\t\titemRenderer.paddingRight = this.gutterSize;\n\t\t\titemRenderer.gap = this.gutterSize;\n\t\t\titemRenderer.minGap = this.gutterSize;\n\t\t\titemRenderer.iconPosition = RelativePosition.LEFT;\n\t\t\titemRenderer.accessoryGap = Number.POSITIVE_INFINITY;\n\t\t\titemRenderer.minAccessoryGap = this.gutterSize;\n\t\t\titemRenderer.accessoryPosition = RelativePosition.RIGHT;\n\t\t\titemRenderer.minTouchWidth = this.gridSize;\n\t\t\titemRenderer.minTouchHeight = this.gridSize;\n\t\t}\n\n\t//-------------------------\n\t// TabBar\n\t//-------------------------\n\n\t\tprotected function setTabBarStyles(tabBar:TabBar):void\n\t\t{\n\t\t\ttabBar.distributeTabSizes = true;\n\t\t}\n\n\t\tprotected function setTabStyles(tab:ToggleButton):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.tabUpSkinTexture);\n\t\t\tskin.selectedTexture = this.tabSelectedUpSkinTexture;\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.tabDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.tabDisabledSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.tabSelectedDisabledSkinTexture);\n\t\t\tskin.scale9Grid = TAB_SCALE9_GRID;\n\t\t\tskin.width = this.gridSize;\n\t\t\tskin.height = this.gridSize;\n\t\t\tskin.minWidth = this.gridSize;\n\t\t\tskin.minHeight = this.gridSize;\n\t\t\ttab.defaultSkin = skin;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\ttab.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\ttab.focusPadding = this.tabFocusPaddingSize;\n\n\t\t\ttab.fontStyles = this.lightUIFontStyles.clone();\n\t\t\ttab.disabledFontStyles = this.lightDisabledUIFontStyles.clone();\n\t\t\ttab.selectedFontStyles = this.darkUIFontStyles.clone();\n\n\t\t\ttab.paddingTop = this.smallGutterSize;\n\t\t\ttab.paddingBottom = this.smallGutterSize;\n\t\t\ttab.paddingLeft = this.gutterSize;\n\t\t\ttab.paddingRight = this.gutterSize;\n\t\t\ttab.gap = this.smallGutterSize;\n\t\t\ttab.minGap = this.smallGutterSize;\n\t\t\ttab.minTouchWidth = this.gridSize;\n\t\t\ttab.minTouchHeight = this.gridSize;\n\t\t}\n\n\t//-------------------------\n\t// TextArea\n\t//-------------------------\n\n\t\tprotected function setTextAreaStyles(textArea:TextArea):void\n\t\t{\n\t\t\tthis.setScrollerStyles(textArea);\n\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.backgroundInsetSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.DISABLED, this.backgroundDisabledSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.FOCUSED, this.backgroundInsetFocusedSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.ERROR, this.backgroundInsetDangerSkinTexture);\n\t\t\tskin.scale9Grid = DEFAULT_BACKGROUND_SCALE9_GRID;\n\t\t\tskin.width = this.wideControlSize;\n\t\t\tskin.height = this.wideControlSize;\n\t\t\ttextArea.backgroundSkin = skin;\n\n\t\t\ttextArea.fontStyles = this.lightInputFontStyles.clone();\n\t\t\ttextArea.disabledFontStyles = this.lightDisabledInputFontStyles.clone();\n\n\t\t\ttextArea.promptFontStyles = this.lightFontStyles.clone();\n\t\t\ttextArea.promptDisabledFontStyles = this.lightDisabledFontStyles.clone();\n\n\t\t\ttextArea.textEditorFactory = textAreaTextEditorFactory;\n\t\t\t\n\t\t\ttextArea.innerPadding = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setTextAreaErrorCalloutStyles(callout:TextCallout):void\n\t\t{\n\t\t\tthis.setDangerCalloutStyles(callout);\n\n\t\t\tcallout.fontStyles = this.lightFontStyles.clone();\n\t\t\tcallout.disabledFontStyles = this.lightDisabledFontStyles.clone();\n\n\t\t\tcallout.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tcallout.verticalAlign = VerticalAlign.TOP;\n\t\t}\n\n\t//-------------------------\n\t// TextCallout\n\t//-------------------------\n\n\t\tprotected function setTextCalloutStyles(callout:TextCallout):void\n\t\t{\n\t\t\tthis.setCalloutStyles(callout);\n\n\t\t\tcallout.fontStyles = this.lightFontStyles.clone();\n\t\t\tcallout.disabledFontStyles = this.lightDisabledFontStyles.clone();\n\t\t}\n\n\t//-------------------------\n\t// Toast\n\t//-------------------------\n\n\t\tprotected function setToastStyles(toast:Toast):void\n\t\t{\n\t\t\tvar backgroundSkin:Image = new Image(this.backgroundLightBorderSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = SMALL_BACKGROUND_SCALE9_GRID;\n\t\t\ttoast.backgroundSkin = backgroundSkin;\n\n\t\t\ttoast.fontStyles = this.lightFontStyles.clone();\n\n\t\t\ttoast.width = this.popUpFillSize;\n\t\t\ttoast.paddingTop = this.gutterSize;\n\t\t\ttoast.paddingRight = this.gutterSize;\n\t\t\ttoast.paddingBottom = this.gutterSize;\n\t\t\ttoast.paddingLeft = this.gutterSize;\n\t\t\ttoast.gap = Number.POSITIVE_INFINITY;\n\t\t\ttoast.minGap = this.smallGutterSize;\n\t\t\ttoast.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\ttoast.verticalAlign = VerticalAlign.MIDDLE;\n\t\t}\n\n\t\tprotected function setToastActionsStyles(group:ButtonGroup):void\n\t\t{\n\t\t\tgroup.direction = Direction.HORIZONTAL;\n\t\t\tgroup.gap = this.smallGutterSize;\n\t\t\tgroup.customButtonStyleName = THEME_STYLE_NAME_TOAST_ACTIONS_BUTTON;\n\t\t}\n\n\t\tprotected function setToastActionsButtonStyles(button:Button):void\n\t\t{\n\t\t\tbutton.fontStyles = this.selectedUIFontStyles.clone();\n\t\t\tbutton.setFontStylesForState(ButtonState.DOWN, this.lightUIFontStyles);\n\t\t}\n\n\t//-------------------------\n\t// TextInput\n\t//-------------------------\n\n\t\tprotected function setBaseTextInputStyles(input:TextInput):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.backgroundInsetSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.DISABLED, this.backgroundInsetDisabledSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.FOCUSED, this.backgroundInsetFocusedSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.ERROR, this.backgroundInsetDangerSkinTexture);\n\t\t\tskin.scale9Grid = DEFAULT_BACKGROUND_SCALE9_GRID;\n\t\t\tskin.width = this.wideControlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tinput.backgroundSkin = skin;\n\n\t\t\tinput.fontStyles = this.lightInputFontStyles.clone();\n\t\t\tinput.disabledFontStyles = this.lightDisabledInputFontStyles.clone();\n\n\t\t\tinput.promptFontStyles = this.lightFontStyles.clone();\n\t\t\tinput.promptDisabledFontStyles = this.lightDisabledFontStyles.clone();\n\n\t\t\tinput.minTouchWidth = this.gridSize;\n\t\t\tinput.minTouchHeight = this.gridSize;\n\t\t\tinput.gap = this.smallControlGutterSize;\n\t\t\tinput.paddingTop = this.smallControlGutterSize;\n\t\t\tinput.paddingRight = this.smallGutterSize;\n\t\t\tinput.paddingBottom = this.smallControlGutterSize;\n\t\t\tinput.paddingLeft = this.smallGutterSize;\n\t\t\tinput.verticalAlign = VerticalAlign.MIDDLE;\n\t\t}\n\n\t\tprotected function setTextInputStyles(input:TextInput):void\n\t\t{\n\t\t\tthis.setBaseTextInputStyles(input);\n\t\t}\n\n\t\tprotected function setTextInputErrorCalloutStyles(callout:TextCallout):void\n\t\t{\n\t\t\tthis.setDangerCalloutStyles(callout);\n\n\t\t\tcallout.fontStyles = this.lightFontStyles.clone();\n\t\t\tcallout.disabledFontStyles = this.lightDisabledFontStyles.clone();\n\n\t\t\tcallout.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tcallout.verticalAlign = VerticalAlign.TOP;\n\t\t}\n\n\t\tprotected function setSearchTextInputStyles(input:TextInput):void\n\t\t{\n\t\t\tthis.setBaseTextInputStyles(input);\n\n\t\t\tinput.fontStyles = this.lightInputFontStyles.clone();\n\t\t\tinput.disabledFontStyles = this.lightDisabledInputFontStyles.clone();\n\n\t\t\tinput.promptFontStyles = this.lightFontStyles.clone();\n\t\t\tinput.promptDisabledFontStyles = this.lightDisabledFontStyles.clone();\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.searchIconTexture);\n\t\t\ticon.setTextureForState(TextInputState.DISABLED, this.searchIconDisabledTexture);\n\t\t\tinput.defaultIcon = icon;\n\t\t}\n\n\t//-------------------------\n\t// ToggleSwitch\n\t//-------------------------\n\n\t\tprotected function setToggleSwitchStyles(toggle:ToggleSwitch):void\n\t\t{\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\ttoggle.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\ttoggle.focusPadding = this.focusPaddingSize;\n\n\t\t\ttoggle.trackLayoutMode = TrackLayoutMode.SINGLE;\n\n\t\t\ttoggle.offLabelFontStyles = this.lightUIFontStyles.clone();\n\t\t\ttoggle.offLabelDisabledFontStyles = this.lightDisabledUIFontStyles.clone();\n\t\t\ttoggle.onLabelFontStyles = this.selectedUIFontStyles.clone();\n\t\t\ttoggle.onLabelDisabledFontStyles = this.lightDisabledUIFontStyles.clone();\n\t\t}\n\n\t\t//see Shared section for thumb styles\n\n\t\tprotected function setToggleSwitchTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.backgroundSkinTexture);\n\t\t\tskin.disabledTexture = this.backgroundDisabledSkinTexture;\n\t\t\tskin.scale9Grid = DEFAULT_BACKGROUND_SCALE9_GRID;\n\t\t\tskin.width = Math.round(this.controlSize * 2.5);\n\t\t\tskin.height = this.controlSize;\n\t\t\ttrack.defaultSkin = skin;\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t//-------------------------\n\t// Tree\n\t//-------------------------\n\n\t\tprotected function setTreeStyles(tree:Tree):void\n\t\t{\n\t\t\tthis.setScrollerStyles(tree);\n\t\t\tvar backgroundSkin:Quad = new Quad(this.gridSize, this.gridSize, LIST_BACKGROUND_COLOR);\n\t\t\ttree.backgroundSkin = backgroundSkin;\n\t\t}\n\n\t\tprotected function setTreeItemRendererStyles(itemRenderer:DefaultTreeItemRenderer):void\n\t\t{\n\t\t\tthis.setItemRendererStyles(itemRenderer);\n\n\t\t\titemRenderer.indentation = this.treeDisclosureOpenIconTexture.width;\n\n\t\t\tvar disclosureOpenIcon:ImageSkin = new ImageSkin(this.treeDisclosureOpenIconTexture);\n\t\t\tdisclosureOpenIcon.selectedTexture = this.treeDisclosureOpenSelectedIconTexture;\n\t\t\t//make sure the hit area is large enough for touch screens\n\t\t\tdisclosureOpenIcon.minTouchWidth = this.gridSize;\n\t\t\tdisclosureOpenIcon.minTouchHeight = this.gridSize;\n\t\t\titemRenderer.disclosureOpenIcon = disclosureOpenIcon;\n\n\t\t\tvar disclosureClosedIcon:ImageSkin = new ImageSkin(this.treeDisclosureClosedIconTexture);\n\t\t\tdisclosureClosedIcon.selectedTexture = this.treeDisclosureClosedSelectedIconTexture;\n\t\t\tdisclosureClosedIcon.minTouchWidth = this.gridSize;\n\t\t\tdisclosureClosedIcon.minTouchHeight = this.gridSize;\n\t\t\titemRenderer.disclosureClosedIcon = disclosureClosedIcon;\n\t\t}\n\n\t//-------------------------\n\t// PlayPauseToggleButton\n\t//-------------------------\n\n\t\tprotected function setPlayPauseToggleButtonStyles(button:PlayPauseToggleButton):void\n\t\t{\n\t\t\tvar skin:Quad = new Quad(this.controlSize, this.controlSize);\n\t\t\tskin.alpha = 0;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.playPauseButtonPlayUpIconTexture);\n\t\t\ticon.selectedTexture = this.playPauseButtonPauseUpIconTexture;\n\t\t\ticon.setTextureForState(ButtonState.DOWN, this.playPauseButtonPlayDownIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.playPauseButtonPauseDownIconTexture);\n\t\t\tbutton.defaultIcon = icon;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\n\t\t\tbutton.minTouchWidth = this.gridSize;\n\t\t\tbutton.minTouchHeight = this.gridSize;\n\t\t}\n\n\t\tprotected function setOverlayPlayPauseToggleButtonStyles(button:PlayPauseToggleButton):void\n\t\t{\n\t\t\tvar icon:ImageSkin = new ImageSkin(null);\n\t\t\ticon.setTextureForState(ButtonState.UP, this.overlayPlayPauseButtonPlayUpIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.HOVER, this.overlayPlayPauseButtonPlayUpIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DOWN, this.overlayPlayPauseButtonPlayDownIconTexture);\n\t\t\tbutton.defaultIcon = icon;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\n\t\t\tvar overlaySkin:Quad = new Quad(1, 1, VIDEO_OVERLAY_COLOR);\n\t\t\toverlaySkin.alpha = VIDEO_OVERLAY_ALPHA;\n\t\t\tbutton.upSkin = overlaySkin;\n\t\t\tbutton.hoverSkin = overlaySkin;\n\t\t}\n\n\t//-------------------------\n\t// FullScreenToggleButton\n\t//-------------------------\n\n\t\tprotected function setFullScreenToggleButtonStyles(button:FullScreenToggleButton):void\n\t\t{\n\t\t\tvar skin:Quad = new Quad(this.controlSize, this.controlSize);\n\t\t\tskin.alpha = 0;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.fullScreenToggleButtonEnterUpIconTexture);\n\t\t\ticon.selectedTexture = this.fullScreenToggleButtonExitUpIconTexture;\n\t\t\ticon.setTextureForState(ButtonState.DOWN, this.fullScreenToggleButtonEnterDownIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.fullScreenToggleButtonExitDownIconTexture);\n\t\t\tbutton.defaultIcon = icon;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\n\t\t\tbutton.minTouchWidth = this.gridSize;\n\t\t\tbutton.minTouchHeight = this.gridSize;\n\t\t}\n\n\t//-------------------------\n\t// MuteToggleButton\n\t//-------------------------\n\n\t\tprotected function setMuteToggleButtonStyles(button:MuteToggleButton):void\n\t\t{\n\t\t\tvar skin:Quad = new Quad(this.controlSize, this.controlSize);\n\t\t\tskin.alpha = 0;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.muteToggleButtonLoudUpIconTexture);\n\t\t\ticon.selectedTexture = this.muteToggleButtonMutedUpIconTexture;\n\t\t\ticon.setTextureForState(ButtonState.DOWN, this.muteToggleButtonLoudDownIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.muteToggleButtonMutedDownIconTexture);\n\t\t\tbutton.defaultIcon = icon;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\t\t\tbutton.showVolumeSliderOnHover = false;\n\n\t\t\tbutton.minTouchWidth = this.gridSize;\n\t\t\tbutton.minTouchHeight = this.gridSize;\n\t\t}\n\n\t//-------------------------\n\t// SeekSlider\n\t//-------------------------\n\n\t\tprotected function setSeekSliderStyles(slider:SeekSlider):void\n\t\t{\n\t\t\tslider.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tslider.showThumb = false;\n\t\t\tvar progressSkin:Image = new Image(this.seekSliderProgressSkinTexture);\n\t\t\tprogressSkin.scale9Grid = DEFAULT_BACKGROUND_SCALE9_GRID;\n\t\t\tprogressSkin.width = this.smallControlSize;\n\t\t\tprogressSkin.height = this.smallControlSize;\n\t\t\tslider.progressSkin = progressSkin;\n\t\t}\n\n\t\tprotected function setSeekSliderThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar thumbSize:Number = 6;\n\t\t\tthumb.defaultSkin = new Quad(thumbSize, thumbSize);\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t\tthumb.minTouchWidth = this.gridSize;\n\t\t\tthumb.minTouchHeight = this.gridSize;\n\t\t}\n\n\t\tprotected function setSeekSliderMinimumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar defaultSkin:ImageSkin = new ImageSkin(this.buttonUpSkinTexture);\n\t\t\tdefaultSkin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tdefaultSkin.width = this.wideControlSize;\n\t\t\tdefaultSkin.height = this.smallControlSize;\n\t\t\tdefaultSkin.minWidth = this.wideControlSize;\n\t\t\tdefaultSkin.minHeight = this.smallControlSize;\n\t\t\ttrack.defaultSkin = defaultSkin;\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t\ttrack.minTouchHeight = this.gridSize;\n\t\t}\n\n\t\tprotected function setSeekSliderMaximumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar defaultSkin:ImageSkin = new ImageSkin(this.backgroundSkinTexture);\n\t\t\tdefaultSkin.scale9Grid = DEFAULT_BACKGROUND_SCALE9_GRID;\n\t\t\tdefaultSkin.width = this.wideControlSize;\n\t\t\tdefaultSkin.height = this.smallControlSize;\n\t\t\tdefaultSkin.minHeight = this.smallControlSize;\n\t\t\ttrack.defaultSkin = defaultSkin;\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t\ttrack.minTouchHeight = this.gridSize;\n\t\t}\n\n\t//-------------------------\n\t// VolumeSlider\n\t//-------------------------\n\n\t\tprotected function setVolumeSliderStyles(slider:VolumeSlider):void\n\t\t{\n\t\t\tslider.direction = Direction.HORIZONTAL;\n\t\t\tslider.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tslider.showThumb = false;\n\t\t}\n\n\t\tprotected function setVolumeSliderThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar thumbSize:Number = 6;\n\t\t\tvar defaultSkin:Quad = new Quad(thumbSize, thumbSize);\n\t\t\tdefaultSkin.width = 0;\n\t\t\tdefaultSkin.height = 0;\n\t\t\tthumb.defaultSkin = defaultSkin;\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVolumeSliderMinimumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar defaultSkin:ImageLoader = new ImageLoader();\n\t\t\tdefaultSkin.scaleContent = false;\n\t\t\tdefaultSkin.source = this.volumeSliderMinimumTrackSkinTexture;\n\t\t\ttrack.defaultSkin = defaultSkin;\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t\ttrack.minTouchHeight = this.gridSize;\n\t\t}\n\n\t\tprotected function setVolumeSliderMaximumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar defaultSkin:ImageLoader = new ImageLoader();\n\t\t\tdefaultSkin.scaleContent = false;\n\t\t\tdefaultSkin.horizontalAlign = HorizontalAlign.RIGHT;\n\t\t\tdefaultSkin.source = this.volumeSliderMaximumTrackSkinTexture;\n\t\t\ttrack.defaultSkin = defaultSkin;\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t\ttrack.minTouchHeight = this.gridSize;\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "themes/MetalWorksMobileTheme/source/feathers/themes/MetalWorksMobileTheme.as",
    "content": "/*\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n*/\npackage feathers.themes\n{\n\timport flash.display.Bitmap;\n\timport flash.display.BitmapData;\n\n\timport starling.textures.Texture;\n\timport starling.textures.TextureAtlas;\n\n\t/**\n\t * The \"Metal Works\" theme for mobile Feathers apps.\n\t *\n\t * <p>This version of the theme embeds its assets. To load assets at\n\t * runtime, see <code>MetalWorksMobileThemeWithAssetManager</code> instead.</p>\n\t *\n\t * @see http://feathersui.com/help/theme-assets.html\n\t */\n\tpublic class MetalWorksMobileTheme extends BaseMetalWorksMobileTheme\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\t[Embed(source=\"/../assets/images/metalworks_mobile.xml\",mimeType=\"application/octet-stream\")]\n\t\tprotected static const ATLAS_XML:Class;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\t[Embed(source=\"/../assets/images/metalworks_mobile.png\")]\n\t\tprotected static const ATLAS_BITMAP:Class;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function MetalWorksMobileTheme()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.initialize();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tthis.initializeTextureAtlas();\n\t\t\tsuper.initialize();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function initializeTextureAtlas():void\n\t\t{\n\t\t\tvar atlasBitmapData:BitmapData = Bitmap(new ATLAS_BITMAP()).bitmapData;\n\t\t\tvar atlasTexture:Texture = Texture.fromBitmapData(atlasBitmapData, false, false, 2);\n\t\t\tatlasTexture.root.onRestore = this.atlasTexture_onRestore;\n\t\t\tatlasBitmapData.dispose();\n\t\t\tthis.atlas = new TextureAtlas(atlasTexture, XML(new ATLAS_XML()));\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function atlasTexture_onRestore():void\n\t\t{\n\t\t\tvar atlasBitmapData:BitmapData = Bitmap(new ATLAS_BITMAP()).bitmapData;\n\t\t\tthis.atlas.texture.root.uploadBitmapData(atlasBitmapData);\n\t\t\tatlasBitmapData.dispose();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "themes/MetalWorksMobileTheme/source/feathers/themes/MetalWorksMobileThemeWithAssetManager.as",
    "content": "/*\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n*/\npackage feathers.themes\n{\n\timport feathers.events.FeathersEventType;\n\n\timport starling.assets.AssetManager;\n\timport starling.core.Starling;\n\timport starling.events.Event;\n\n\t/**\n\t * @copy feathers.themes.IAsyncTheme#event:complete\n\t *\n\t * @eventType starling.events.Event.COMPLETE\n\t */\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the theme's assets fail to load due to an error.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The error string.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.ERROR\n\t */\n\t[Event(name=\"error\",type=\"starling.events.Event\")]\n\n\t/**\n\t * The \"Metal Works\" theme for mobile Feathers apps.\n\t *\n\t * <p>This version of the theme requires loading assets at runtime. To use\n\t * embedded assets, see <code>MetalWorksMobileTheme</code> instead.</p>\n\t *\n\t * <p>To use this theme, the following files must be included when packaging\n\t * your app:</p>\n\t * <ul>\n\t *     <li>images/metalworks_mobile.png</li>\n\t *     <li>images/metalworks_mobile.xml</li>\n\t * </ul>\n\t *\n\t * @see http://feathersui.com/help/theme-assets.html\n\t */\n\tpublic class MetalWorksMobileThemeWithAssetManager extends BaseMetalWorksMobileTheme implements IAsyncTheme\n\t{\n\t\t/**\n\t\t * @private\n\t\t * The name of the texture atlas in the asset manager.\n\t\t */\n\t\tprotected static const ATLAS_NAME:String = \"metalworks_mobile\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const ATLAS_SCALE_FACTOR:int = 2;\n\n\t\t/**\n\t\t * Constructor.\n\t\t * @param assetsBasePath The root folder of the assets.\n\t\t * @param assetManager An optional pre-created AssetManager. The scaleFactor property must be equal to Starling.contentScaleFactor. To load assets with a different scale factor, use multiple AssetManager instances.\n\t\t */\n\t\tpublic function MetalWorksMobileThemeWithAssetManager(assetsBasePath:String = \"./\", assetManager:AssetManager = null)\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.loadAssets(assetsBasePath, assetManager);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * The paths to each of the assets, relative to the base path.\n\t\t */\n\t\tprotected var assetPaths:Vector.<String> = new <String>\n\t\t[\n\t\t\t\"images/\" + ATLAS_NAME + \".xml\",\n\t\t\t\"images/\" + ATLAS_NAME + \".png\"\n\t\t];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var assetManager:AssetManager;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var isComplete:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tsuper.dispose();\n\t\t\tif(this.assetManager)\n\t\t\t{\n\t\t\t\tthis.assetManager.removeTextureAtlas(ATLAS_NAME);\n\t\t\t\tthis.assetManager = null;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.themes.IAsyncTheme#isCompleteForStarling()\n\t\t */\n\t\tpublic function isCompleteForStarling(starling:Starling):Boolean\n\t\t{\n\t\t\treturn this.isComplete;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tthis.initializeTextureAtlas();\n\t\t\tsuper.initialize();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function initializeTextureAtlas():void\n\t\t{\n\t\t\tthis.atlas = this.assetManager.getTextureAtlas(ATLAS_NAME);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function loadAssets(assetsBasePath:String, assetManager:AssetManager):void\n\t\t{\n\t\t\tvar oldScaleFactor:Number = -1;\n\t\t\tif(assetManager)\n\t\t\t{\n\t\t\t\toldScaleFactor = assetManager.textureOptions.scale;\n\t\t\t\tassetManager.textureOptions.scale = ATLAS_SCALE_FACTOR;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tassetManager = new AssetManager(ATLAS_SCALE_FACTOR);\n\t\t\t}\n\t\t\tthis.assetManager = assetManager;\n\t\t\t//add a trailing slash, if needed\n\t\t\tif(assetsBasePath.lastIndexOf(\"/\") != assetsBasePath.length - 1)\n\t\t\t{\n\t\t\t\tassetsBasePath += \"/\";\n\t\t\t}\n\t\t\tvar assetPaths:Vector.<String> = this.assetPaths;\n\t\t\tvar assetCount:int = assetPaths.length;\n\t\t\tfor(var i:int = 0; i < assetCount; i++)\n\t\t\t{\n\t\t\t\tvar asset:String = assetPaths[i];\n\t\t\t\tthis.assetManager.enqueue(assetsBasePath + asset);\n\t\t\t}\n\t\t\tif(oldScaleFactor != -1)\n\t\t\t{\n\t\t\t\t//restore the old scale factor, just in case\n\t\t\t\tthis.assetManager.textureOptions.scale = oldScaleFactor;\n\t\t\t}\n\t\t\tthis.assetManager.loadQueue(assetManager_onComplete, assetManager_onError);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function assetManager_onComplete():void\n\t\t{\n\t\t\tthis.initialize();\n\t\t\tthis.isComplete = true;\n\t\t\tthis.dispatchEventWith(Event.COMPLETE, false, Starling.current);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function assetManager_onError(error:String):void\n\t\t{\n\t\t\tthis.dispatchEventWith(FeathersEventType.ERROR, false, error);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "themes/MinimalDesktopTheme/README.md",
    "content": "# Minimal Desktop Theme for Feathers\n\nThis [Feathers](http://feathersui.com/) theme for desktop combines simple gray colors with a retro pixel aesthetic.\n\n## Original Artwork\n\nThis theme's texture atlas was exported from Adobe Animate CC. To modify colors and other properties, or to add new skins to the texture atlas, [download the source FLA file](http://feathersui.com/help/theme-sources.html) from the Feathers website.\n\n## Credits\n\nThis theme is based on the appearance of [MinimalComps](https://github.com/minimalcomps/minimalcomps), a great set of Flash user interface components created by [Keith Peters](https://bit-101.com/). With permission, the theme was ported to Feathers by [Josh Tynjala](https://joshblog.net/). This theme uses the free Ronda Seven font, designed by [Yusuke Kamiyamane](http://p.yusukekamiyamane.com/)."
  },
  {
    "path": "themes/MinimalDesktopTheme/assets/fonts/pf_ronda_seven_desktop.fnt",
    "content": "<?xml version=\"1.0\"?>\n<font>\n  <info face=\"PF Ronda Seven\" size=\"-16\" bold=\"0\" italic=\"0\" charset=\"\" unicode=\"1\" stretchH=\"100\" smooth=\"0\" aa=\"1\" padding=\"0,0,0,0\" spacing=\"2,2\" outline=\"0\"/>\n  <common lineHeight=\"26\" base=\"22\" scaleW=\"512\" scaleH=\"512\" pages=\"1\" packed=\"0\" alphaChnl=\"0\" redChnl=\"4\" greenChnl=\"4\" blueChnl=\"4\"/>\n  <pages>\n    <page id=\"0\" file=\"pf-ronda-seven-font.png\" />\n  </pages>\n  <chars count=\"95\">\n    <char id=\"32\" x=\"432\" y=\"16\" width=\"2\" height=\"2\" xoffset=\"0\" yoffset=\"24\" xadvance=\"6\" page=\"0\" chnl=\"15\"/>\n    <char id=\"33\" x=\"170\" y=\"16\" width=\"2\" height=\"14\" xoffset=\"2\" yoffset=\"8\" xadvance=\"6\" page=\"0\" chnl=\"15\"/>\n    <char id=\"34\" x=\"390\" y=\"16\" width=\"6\" height=\"4\" xoffset=\"0\" yoffset=\"8\" xadvance=\"8\" page=\"0\" chnl=\"15\"/>\n    <char id=\"35\" x=\"0\" y=\"20\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"36\" x=\"30\" y=\"0\" width=\"10\" height=\"18\" xoffset=\"0\" yoffset=\"6\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"37\" x=\"138\" y=\"0\" width=\"14\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"16\" page=\"0\" chnl=\"15\"/>\n    <char id=\"38\" x=\"12\" y=\"20\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"39\" x=\"412\" y=\"16\" width=\"2\" height=\"4\" xoffset=\"0\" yoffset=\"8\" xadvance=\"4\" page=\"0\" chnl=\"15\"/>\n    <char id=\"40\" x=\"54\" y=\"0\" width=\"6\" height=\"18\" xoffset=\"0\" yoffset=\"6\" xadvance=\"8\" page=\"0\" chnl=\"15\"/>\n    <char id=\"41\" x=\"70\" y=\"0\" width=\"6\" height=\"18\" xoffset=\"0\" yoffset=\"6\" xadvance=\"8\" page=\"0\" chnl=\"15\"/>\n    <char id=\"42\" x=\"218\" y=\"16\" width=\"10\" height=\"10\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"43\" x=\"230\" y=\"16\" width=\"10\" height=\"10\" xoffset=\"0\" yoffset=\"10\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"44\" x=\"374\" y=\"16\" width=\"4\" height=\"6\" xoffset=\"0\" yoffset=\"20\" xadvance=\"6\" page=\"0\" chnl=\"15\"/>\n    <char id=\"45\" x=\"416\" y=\"16\" width=\"6\" height=\"2\" xoffset=\"0\" yoffset=\"16\" xadvance=\"8\" page=\"0\" chnl=\"15\"/>\n    <char id=\"46\" x=\"436\" y=\"16\" width=\"2\" height=\"2\" xoffset=\"2\" yoffset=\"20\" xadvance=\"6\" page=\"0\" chnl=\"15\"/>\n    <char id=\"47\" x=\"42\" y=\"0\" width=\"10\" height=\"18\" xoffset=\"0\" yoffset=\"6\" xadvance=\"10\" page=\"0\" chnl=\"15\"/>\n    <char id=\"48\" x=\"218\" y=\"0\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"49\" x=\"164\" y=\"16\" width=\"4\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"6\" page=\"0\" chnl=\"15\"/>\n    <char id=\"50\" x=\"230\" y=\"0\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"51\" x=\"242\" y=\"0\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"52\" x=\"254\" y=\"0\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"53\" x=\"266\" y=\"0\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"54\" x=\"36\" y=\"20\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"55\" x=\"290\" y=\"0\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"56\" x=\"302\" y=\"0\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"57\" x=\"314\" y=\"0\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"58\" x=\"362\" y=\"16\" width=\"2\" height=\"10\" xoffset=\"2\" yoffset=\"12\" xadvance=\"6\" page=\"0\" chnl=\"15\"/>\n    <char id=\"59\" x=\"506\" y=\"0\" width=\"4\" height=\"14\" xoffset=\"0\" yoffset=\"12\" xadvance=\"6\" page=\"0\" chnl=\"15\"/>\n    <char id=\"60\" x=\"330\" y=\"16\" width=\"6\" height=\"10\" xoffset=\"0\" yoffset=\"10\" xadvance=\"8\" page=\"0\" chnl=\"15\"/>\n    <char id=\"61\" x=\"366\" y=\"16\" width=\"6\" height=\"6\" xoffset=\"0\" yoffset=\"12\" xadvance=\"8\" page=\"0\" chnl=\"15\"/>\n    <char id=\"62\" x=\"322\" y=\"16\" width=\"6\" height=\"10\" xoffset=\"0\" yoffset=\"10\" xadvance=\"8\" page=\"0\" chnl=\"15\"/>\n    <char id=\"63\" x=\"362\" y=\"0\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"64\" x=\"0\" y=\"0\" width=\"16\" height=\"18\" xoffset=\"0\" yoffset=\"6\" xadvance=\"18\" page=\"0\" chnl=\"15\"/>\n    <char id=\"65\" x=\"374\" y=\"0\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"66\" x=\"386\" y=\"0\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"67\" x=\"398\" y=\"0\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"68\" x=\"410\" y=\"0\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"69\" x=\"422\" y=\"0\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"70\" x=\"434\" y=\"0\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"71\" x=\"446\" y=\"0\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"72\" x=\"458\" y=\"0\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"73\" x=\"174\" y=\"16\" width=\"2\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"4\" page=\"0\" chnl=\"15\"/>\n    <char id=\"74\" x=\"138\" y=\"16\" width=\"8\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"10\" page=\"0\" chnl=\"15\"/>\n    <char id=\"75\" x=\"470\" y=\"0\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"76\" x=\"58\" y=\"20\" width=\"8\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"10\" page=\"0\" chnl=\"15\"/>\n    <char id=\"77\" x=\"154\" y=\"0\" width=\"14\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"16\" page=\"0\" chnl=\"15\"/>\n    <char id=\"78\" x=\"170\" y=\"0\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"79\" x=\"182\" y=\"0\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"80\" x=\"350\" y=\"0\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"81\" x=\"106\" y=\"0\" width=\"10\" height=\"16\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"82\" x=\"338\" y=\"0\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"83\" x=\"326\" y=\"0\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"84\" x=\"278\" y=\"0\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"85\" x=\"206\" y=\"0\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"86\" x=\"194\" y=\"0\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"87\" x=\"122\" y=\"0\" width=\"14\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"16\" page=\"0\" chnl=\"15\"/>\n    <char id=\"88\" x=\"24\" y=\"20\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"89\" x=\"494\" y=\"0\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"90\" x=\"482\" y=\"0\" width=\"10\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"91\" x=\"62\" y=\"0\" width=\"6\" height=\"18\" xoffset=\"0\" yoffset=\"6\" xadvance=\"8\" page=\"0\" chnl=\"15\"/>\n    <char id=\"92\" x=\"18\" y=\"0\" width=\"10\" height=\"18\" xoffset=\"0\" yoffset=\"6\" xadvance=\"12\" page=\"0\" chnl=\"15\"/>\n    <char id=\"93\" x=\"78\" y=\"0\" width=\"6\" height=\"18\" xoffset=\"0\" yoffset=\"6\" xadvance=\"8\" page=\"0\" chnl=\"15\"/>\n    <char id=\"94\" x=\"398\" y=\"16\" width=\"6\" height=\"4\" xoffset=\"0\" yoffset=\"8\" xadvance=\"8\" page=\"0\" chnl=\"15\"/>\n    <char id=\"95\" x=\"424\" y=\"16\" width=\"6\" height=\"2\" xoffset=\"0\" yoffset=\"20\" xadvance=\"8\" page=\"0\" chnl=\"15\"/>\n    <char id=\"96\" x=\"406\" y=\"16\" width=\"4\" height=\"4\" xoffset=\"0\" yoffset=\"2\" xadvance=\"6\" page=\"0\" chnl=\"15\"/>\n    <char id=\"97\" x=\"282\" y=\"16\" width=\"8\" height=\"10\" xoffset=\"0\" yoffset=\"12\" xadvance=\"10\" page=\"0\" chnl=\"15\"/>\n    <char id=\"98\" x=\"48\" y=\"20\" width=\"8\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"10\" page=\"0\" chnl=\"15\"/>\n    <char id=\"99\" x=\"302\" y=\"16\" width=\"8\" height=\"10\" xoffset=\"0\" yoffset=\"12\" xadvance=\"10\" page=\"0\" chnl=\"15\"/>\n    <char id=\"100\" x=\"98\" y=\"20\" width=\"8\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"10\" page=\"0\" chnl=\"15\"/>\n    <char id=\"101\" x=\"312\" y=\"16\" width=\"8\" height=\"10\" xoffset=\"0\" yoffset=\"12\" xadvance=\"10\" page=\"0\" chnl=\"15\"/>\n    <char id=\"102\" x=\"148\" y=\"16\" width=\"6\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"6\" page=\"0\" chnl=\"15\"/>\n    <char id=\"103\" x=\"68\" y=\"20\" width=\"8\" height=\"14\" xoffset=\"0\" yoffset=\"12\" xadvance=\"10\" page=\"0\" chnl=\"15\"/>\n    <char id=\"104\" x=\"78\" y=\"20\" width=\"8\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"10\" page=\"0\" chnl=\"15\"/>\n    <char id=\"105\" x=\"178\" y=\"16\" width=\"2\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"4\" page=\"0\" chnl=\"15\"/>\n    <char id=\"106\" x=\"118\" y=\"0\" width=\"2\" height=\"16\" xoffset=\"0\" yoffset=\"8\" xadvance=\"4\" page=\"0\" chnl=\"15\"/>\n    <char id=\"107\" x=\"88\" y=\"20\" width=\"8\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"10\" page=\"0\" chnl=\"15\"/>\n    <char id=\"108\" x=\"182\" y=\"16\" width=\"2\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"4\" page=\"0\" chnl=\"15\"/>\n    <char id=\"109\" x=\"202\" y=\"16\" width=\"14\" height=\"10\" xoffset=\"0\" yoffset=\"12\" xadvance=\"16\" page=\"0\" chnl=\"15\"/>\n    <char id=\"110\" x=\"242\" y=\"16\" width=\"8\" height=\"10\" xoffset=\"0\" yoffset=\"12\" xadvance=\"10\" page=\"0\" chnl=\"15\"/>\n    <char id=\"111\" x=\"252\" y=\"16\" width=\"8\" height=\"10\" xoffset=\"0\" yoffset=\"12\" xadvance=\"10\" page=\"0\" chnl=\"15\"/>\n    <char id=\"112\" x=\"108\" y=\"18\" width=\"8\" height=\"14\" xoffset=\"0\" yoffset=\"12\" xadvance=\"10\" page=\"0\" chnl=\"15\"/>\n    <char id=\"113\" x=\"118\" y=\"18\" width=\"8\" height=\"14\" xoffset=\"0\" yoffset=\"12\" xadvance=\"10\" page=\"0\" chnl=\"15\"/>\n    <char id=\"114\" x=\"338\" y=\"16\" width=\"6\" height=\"10\" xoffset=\"0\" yoffset=\"12\" xadvance=\"8\" page=\"0\" chnl=\"15\"/>\n    <char id=\"115\" x=\"346\" y=\"16\" width=\"6\" height=\"10\" xoffset=\"0\" yoffset=\"12\" xadvance=\"8\" page=\"0\" chnl=\"15\"/>\n    <char id=\"116\" x=\"156\" y=\"16\" width=\"6\" height=\"14\" xoffset=\"0\" yoffset=\"8\" xadvance=\"8\" page=\"0\" chnl=\"15\"/>\n    <char id=\"117\" x=\"262\" y=\"16\" width=\"8\" height=\"10\" xoffset=\"0\" yoffset=\"12\" xadvance=\"10\" page=\"0\" chnl=\"15\"/>\n    <char id=\"118\" x=\"272\" y=\"16\" width=\"8\" height=\"10\" xoffset=\"0\" yoffset=\"12\" xadvance=\"10\" page=\"0\" chnl=\"15\"/>\n    <char id=\"119\" x=\"186\" y=\"16\" width=\"14\" height=\"10\" xoffset=\"0\" yoffset=\"12\" xadvance=\"16\" page=\"0\" chnl=\"15\"/>\n    <char id=\"120\" x=\"292\" y=\"16\" width=\"8\" height=\"10\" xoffset=\"0\" yoffset=\"12\" xadvance=\"10\" page=\"0\" chnl=\"15\"/>\n    <char id=\"121\" x=\"128\" y=\"16\" width=\"8\" height=\"14\" xoffset=\"0\" yoffset=\"12\" xadvance=\"10\" page=\"0\" chnl=\"15\"/>\n    <char id=\"122\" x=\"354\" y=\"16\" width=\"6\" height=\"10\" xoffset=\"0\" yoffset=\"12\" xadvance=\"8\" page=\"0\" chnl=\"15\"/>\n    <char id=\"123\" x=\"94\" y=\"0\" width=\"6\" height=\"18\" xoffset=\"0\" yoffset=\"6\" xadvance=\"8\" page=\"0\" chnl=\"15\"/>\n    <char id=\"124\" x=\"102\" y=\"0\" width=\"2\" height=\"18\" xoffset=\"0\" yoffset=\"6\" xadvance=\"4\" page=\"0\" chnl=\"15\"/>\n    <char id=\"125\" x=\"86\" y=\"0\" width=\"6\" height=\"18\" xoffset=\"0\" yoffset=\"6\" xadvance=\"8\" page=\"0\" chnl=\"15\"/>\n    <char id=\"126\" x=\"380\" y=\"16\" width=\"8\" height=\"4\" xoffset=\"0\" yoffset=\"8\" xadvance=\"10\" page=\"0\" chnl=\"15\"/>\n  </chars>\n  <kernings count=\"66\">\n    <kerning first=\"70\" second=\"100\" amount=\"-2\"/>\n    <kerning first=\"70\" second=\"97\" amount=\"-2\"/>\n    <kerning first=\"70\" second=\"111\" amount=\"-2\"/>\n    <kerning first=\"70\" second=\"112\" amount=\"-2\"/>\n    <kerning first=\"70\" second=\"113\" amount=\"-2\"/>\n    <kerning first=\"70\" second=\"114\" amount=\"-2\"/>\n    <kerning first=\"70\" second=\"115\" amount=\"-2\"/>\n    <kerning first=\"70\" second=\"116\" amount=\"-2\"/>\n    <kerning first=\"70\" second=\"117\" amount=\"-2\"/>\n    <kerning first=\"70\" second=\"109\" amount=\"-2\"/>\n    <kerning first=\"70\" second=\"110\" amount=\"-2\"/>\n    <kerning first=\"70\" second=\"101\" amount=\"-2\"/>\n    <kerning first=\"70\" second=\"121\" amount=\"-2\"/>\n    <kerning first=\"70\" second=\"118\" amount=\"-2\"/>\n    <kerning first=\"70\" second=\"99\" amount=\"-2\"/>\n    <kerning first=\"70\" second=\"103\" amount=\"-2\"/>\n    <kerning first=\"70\" second=\"119\" amount=\"-2\"/>\n    <kerning first=\"70\" second=\"120\" amount=\"-2\"/>\n    <kerning first=\"70\" second=\"122\" amount=\"-2\"/>\n    <kerning first=\"70\" second=\"74\" amount=\"-2\"/>\n    <kerning first=\"76\" second=\"84\" amount=\"-2\"/>\n    <kerning first=\"76\" second=\"86\" amount=\"-2\"/>\n    <kerning first=\"76\" second=\"89\" amount=\"-2\"/>\n    <kerning first=\"80\" second=\"74\" amount=\"-2\"/>\n    <kerning first=\"84\" second=\"100\" amount=\"-2\"/>\n    <kerning first=\"84\" second=\"97\" amount=\"-2\"/>\n    <kerning first=\"84\" second=\"111\" amount=\"-2\"/>\n    <kerning first=\"84\" second=\"112\" amount=\"-2\"/>\n    <kerning first=\"84\" second=\"113\" amount=\"-2\"/>\n    <kerning first=\"84\" second=\"114\" amount=\"-2\"/>\n    <kerning first=\"84\" second=\"115\" amount=\"-2\"/>\n    <kerning first=\"84\" second=\"116\" amount=\"-2\"/>\n    <kerning first=\"84\" second=\"117\" amount=\"-2\"/>\n    <kerning first=\"84\" second=\"109\" amount=\"-2\"/>\n    <kerning first=\"84\" second=\"110\" amount=\"-2\"/>\n    <kerning first=\"84\" second=\"101\" amount=\"-2\"/>\n    <kerning first=\"84\" second=\"121\" amount=\"-2\"/>\n    <kerning first=\"84\" second=\"118\" amount=\"-2\"/>\n    <kerning first=\"84\" second=\"99\" amount=\"-2\"/>\n    <kerning first=\"84\" second=\"103\" amount=\"-2\"/>\n    <kerning first=\"84\" second=\"119\" amount=\"-2\"/>\n    <kerning first=\"84\" second=\"120\" amount=\"-2\"/>\n    <kerning first=\"84\" second=\"122\" amount=\"-2\"/>\n    <kerning first=\"84\" second=\"74\" amount=\"-2\"/>\n    <kerning first=\"86\" second=\"74\" amount=\"-2\"/>\n    <kerning first=\"47\" second=\"47\" amount=\"-4\"/>\n    <kerning first=\"89\" second=\"100\" amount=\"-2\"/>\n    <kerning first=\"89\" second=\"97\" amount=\"-2\"/>\n    <kerning first=\"89\" second=\"111\" amount=\"-2\"/>\n    <kerning first=\"89\" second=\"112\" amount=\"-2\"/>\n    <kerning first=\"89\" second=\"113\" amount=\"-2\"/>\n    <kerning first=\"89\" second=\"114\" amount=\"-2\"/>\n    <kerning first=\"89\" second=\"115\" amount=\"-2\"/>\n    <kerning first=\"89\" second=\"116\" amount=\"-2\"/>\n    <kerning first=\"89\" second=\"117\" amount=\"-2\"/>\n    <kerning first=\"89\" second=\"109\" amount=\"-2\"/>\n    <kerning first=\"89\" second=\"110\" amount=\"-2\"/>\n    <kerning first=\"89\" second=\"101\" amount=\"-2\"/>\n    <kerning first=\"89\" second=\"121\" amount=\"-2\"/>\n    <kerning first=\"89\" second=\"118\" amount=\"-2\"/>\n    <kerning first=\"89\" second=\"99\" amount=\"-2\"/>\n    <kerning first=\"89\" second=\"103\" amount=\"-2\"/>\n    <kerning first=\"89\" second=\"119\" amount=\"-2\"/>\n    <kerning first=\"89\" second=\"120\" amount=\"-2\"/>\n    <kerning first=\"89\" second=\"122\" amount=\"-2\"/>\n    <kerning first=\"89\" second=\"74\" amount=\"-2\"/>\n  </kernings>\n</font>\n"
  },
  {
    "path": "themes/MinimalDesktopTheme/assets/images/minimal_desktop.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<TextureAtlas imagePath=\"minimal_desktop.png\">\n\t<!-- Created with Adobe Animate version 16.5.1.104 -->\n\t<!-- http://www.adobe.com/products/animate.html -->\n\t<SubTexture name=\"back-button-disabled-skin0000\" x=\"822\" y=\"56\" width=\"28\" height=\"40\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"back-button-down-skin0000\" x=\"888\" y=\"64\" width=\"28\" height=\"40\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"back-button-up-skin0000\" x=\"2\" y=\"68\" width=\"28\" height=\"40\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-disabled-skin0000\" x=\"918\" y=\"64\" width=\"12\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-down-skin0000\" x=\"496\" y=\"88\" width=\"12\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-up-skin0000\" x=\"366\" y=\"92\" width=\"12\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"call-to-action-button-up-skin0000\" x=\"478\" y=\"92\" width=\"12\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"callout-bottom-arrow-skin0000\" x=\"914\" y=\"2\" width=\"52\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"callout-left-arrow-skin0000\" x=\"860\" y=\"36\" width=\"26\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"callout-right-arrow-skin0000\" x=\"792\" y=\"2\" width=\"32\" height=\"52\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"callout-top-arrow-skin0000\" x=\"888\" y=\"36\" width=\"44\" height=\"26\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"check-disabled-icon0000\" x=\"196\" y=\"68\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"check-selected-disabled-icon0000\" x=\"248\" y=\"68\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"check-selected-up-icon0000\" x=\"300\" y=\"68\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"check-up-icon0000\" x=\"274\" y=\"68\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-button-down-skin0000\" x=\"1008\" y=\"68\" width=\"12\" height=\"12\" pivotX=\"0\" pivotY=\"-0.05\"/>\n\t<SubTexture name=\"danger-button-up-skin0000\" x=\"464\" y=\"92\" width=\"12\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-callout-bottom-arrow-skin0000\" x=\"860\" y=\"2\" width=\"52\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-callout-left-arrow-skin0000\" x=\"934\" y=\"36\" width=\"26\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-callout-right-arrow-skin0000\" x=\"826\" y=\"2\" width=\"32\" height=\"52\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-callout-top-arrow-skin0000\" x=\"962\" y=\"54\" width=\"44\" height=\"26\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-pop-up-background-skin0000\" x=\"744\" y=\"74\" width=\"22\" height=\"22\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-column-drop-indicator-skin0000\" x=\"1018\" y=\"28\" width=\"2\" height=\"10\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-column-resize-skin0000\" x=\"962\" y=\"36\" width=\"2\" height=\"10\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-header-divider-skin0000\" x=\"187\" y=\"94\" width=\"6\" height=\"10\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-header-renderer-skin0000\" x=\"195\" y=\"94\" width=\"6\" height=\"6\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-header-sort-ascending-icon0000\" x=\"163\" y=\"94\" width=\"10\" height=\"6\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-header-sort-descending-icon0000\" x=\"175\" y=\"94\" width=\"10\" height=\"6\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"face-disabled-skin0000\" x=\"436\" y=\"92\" width=\"12\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"face-up-skin0000\" x=\"450\" y=\"92\" width=\"12\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"focus-indicator-skin0000\" x=\"1008\" y=\"54\" width=\"12\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"forward-button-disabled-skin0000\" x=\"792\" y=\"56\" width=\"28\" height=\"40\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"forward-button-down-skin0000\" x=\"32\" y=\"68\" width=\"28\" height=\"40\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"forward-button-up-skin0000\" x=\"62\" y=\"68\" width=\"28\" height=\"40\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"full-screen-toggle-button-enter-up-icon0000\" x=\"92\" y=\"68\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"full-screen-toggle-button-exit-up-icon0000\" x=\"118\" y=\"68\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"header-background-skin0000\" x=\"106\" y=\"94\" width=\"12\" height=\"10\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"header-renderer-skin0000\" x=\"227\" y=\"94\" width=\"6\" height=\"6\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"horizontal-scroll-bar-decrement-button-icon0000\" x=\"144\" y=\"94\" width=\"7\" height=\"11\" pivotX=\"-0.05\" pivotY=\"-0.05\"/>\n\t<SubTexture name=\"horizontal-scroll-bar-increment-button-icon0000\" x=\"852\" y=\"68\" width=\"6\" height=\"10\" pivotX=\"0\" pivotY=\"0.05\"/>\n\t<SubTexture name=\"inset-background-danger-skin0000\" x=\"422\" y=\"92\" width=\"12\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"inset-background-disabled-skin0000\" x=\"998\" y=\"82\" width=\"12\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"inset-background-enabled-skin0000\" x=\"496\" y=\"88\" width=\"12\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"inset-background-focused-skin0000\" x=\"352\" y=\"92\" width=\"12\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"item-renderer-hover-skin0000\" x=\"203\" y=\"94\" width=\"6\" height=\"6\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"item-renderer-selected-skin0000\" x=\"211\" y=\"94\" width=\"6\" height=\"6\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"item-renderer-up-skin0000\" x=\"219\" y=\"94\" width=\"6\" height=\"6\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"list-accessory-drill-down-icon0000\" x=\"852\" y=\"56\" width=\"6\" height=\"10\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"list-background-skin0000\" x=\"380\" y=\"92\" width=\"12\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"list-inset-background-skin0000\" x=\"394\" y=\"92\" width=\"12\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"mute-toggle-button-loud-up-icon0000\" x=\"170\" y=\"68\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"mute-toggle-button-muted-up-icon0000\" x=\"326\" y=\"68\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"overlay-play-pause-toggle-button-play-down-icon0000\" x=\"516\" y=\"2\" width=\"100\" height=\"120\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"overlay-play-pause-toggle-button-play-up-icon0000\" x=\"618\" y=\"2\" width=\"100\" height=\"120\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"page-indicator-selected-symbol0000\" x=\"852\" y=\"82\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"page-indicator-symbol0000\" x=\"870\" y=\"82\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"panel-background-skin0000\" x=\"408\" y=\"92\" width=\"12\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"panel-header-background-skin0000\" x=\"92\" y=\"94\" width=\"12\" height=\"10\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"pf-ronda-seven-font\" x=\"2\" y=\"2\" width=\"512\" height=\"64\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"picker-list-disabled-icon0000\" x=\"1012\" y=\"82\" width=\"10\" height=\"10\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"picker-list-icon0000\" x=\"120\" y=\"94\" width=\"10\" height=\"10\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"picker-list-selected-icon0000\" x=\"132\" y=\"94\" width=\"10\" height=\"10\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"play-pause-toggle-button-pause-up-icon0000\" x=\"222\" y=\"68\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"play-pause-toggle-button-play-up-icon0000\" x=\"144\" y=\"68\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"pop-up-background-skin0000\" x=\"352\" y=\"68\" width=\"22\" height=\"22\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"pop-up-volume-slider-track-skin0000\" x=\"720\" y=\"2\" width=\"70\" height=\"70\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"radio-disabled-icon0000\" x=\"424\" y=\"68\" width=\"22\" height=\"22\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"radio-selected-disabled-icon0000\" x=\"448\" y=\"68\" width=\"22\" height=\"22\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"radio-selected-up-icon0000\" x=\"472\" y=\"68\" width=\"22\" height=\"22\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"radio-up-icon0000\" x=\"720\" y=\"74\" width=\"22\" height=\"22\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"search-disabled-icon0000\" x=\"496\" y=\"68\" width=\"18\" height=\"18\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"search-enabled-icon0000\" x=\"768\" y=\"74\" width=\"18\" height=\"18\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"seek-slider-progress-skin0000\" x=\"1018\" y=\"2\" width=\"4\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"simple-scroll-bar-thumb-skin0000\" x=\"153\" y=\"94\" width=\"8\" height=\"8\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tab-disabled-skin0000\" x=\"918\" y=\"82\" width=\"18\" height=\"14\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tab-selected-disabled-skin0000\" x=\"938\" y=\"82\" width=\"18\" height=\"14\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tab-selected-up-skin0000\" x=\"958\" y=\"82\" width=\"18\" height=\"14\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tab-up-skin0000\" x=\"978\" y=\"82\" width=\"18\" height=\"14\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tree-disclosure-closed-icon0000\" x=\"376\" y=\"68\" width=\"22\" height=\"22\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tree-disclosure-open-icon0000\" x=\"400\" y=\"68\" width=\"22\" height=\"22\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-scroll-bar-decrement-button-icon0000\" x=\"163\" y=\"94\" width=\"10\" height=\"6\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-scroll-bar-increment-button-icon0000\" x=\"175\" y=\"94\" width=\"10\" height=\"6\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"volume-slider-maximum-track-skin0000\" x=\"968\" y=\"2\" width=\"48\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"volume-slider-minimum-track-skin0000\" x=\"968\" y=\"28\" width=\"48\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n</TextureAtlas>\n"
  },
  {
    "path": "themes/MinimalDesktopTheme/package-src.json",
    "content": "{\n\t\"id\": \"feathersui_MinimalDesktopTheme-source\",\n\t\"name\": \"Feathers UI Minimal Desktop Theme\",\n\t\"url\": \"https://feathersui.com/as3-starling/\",\n\t\"docUrl\": \"https://feathersui/api-reference/\",\n\t\"description\": \"Minimal desktop theme for Feathers UI (Starling version)\",\n\t\"type\": \"src\",\n\t\"version\": \"4.2.0\",\n\t\"sourceUrl\": \"https://github.com/feathersui/feathersui-starling/releases/download/v4.2.0/feathersui_MinimalDesktopTheme-source_4.2.0.airpackage\",\n\t\"publishedAt\": \"2021-11-19T00:00:00.000Z\",\n\t\"dependencies\": [\n\t\t\"starling-source:2.x.x\",\n\t\t\"feathersui-source:4.2.x\"\n\t],\n\t\"parameters\": [],\n\t\"tags\": [\"theme\", \"feathers\", \"starling\"],\n\t\"status\": \"release\",\n\t\"license\": {\n\t  \"type\": \"Simplified BSD\",\n\t  \"url\": \"https://github.com/feathersui/feathersui-starling/blob/v4.2.0/LICENSE.md\",\n\t  \"public\": true\n\t}\n  }\n  "
  },
  {
    "path": "themes/MinimalDesktopTheme/package-swc.json",
    "content": "{\n\t\"id\": \"feathersui_MinimalDesktopTheme\",\n\t\"name\": \"Feathers UI Minimal Desktop Theme\",\n\t\"url\": \"https://feathersui.com/as3-starling/\",\n\t\"docUrl\": \"https://feathersui/api-reference/\",\n\t\"description\": \"Minimal desktop theme for Feathers UI (Starling version)\",\n\t\"type\": \"swc\",\n\t\"version\": \"4.2.0\",\n\t\"sourceUrl\": \"https://github.com/feathersui/feathersui-starling/releases/download/v4.2.0/feathersui_MinimalDesktopTheme_4.2.0.airpackage\",\n\t\"publishedAt\": \"2021-11-19T00:00:00.000Z\",\n\t\"dependencies\": [\n\t\t\"starling:2.x.x\",\n\t\t\"feathersui:4.2.x\"\n\t],\n\t\"parameters\": [],\n\t\"tags\": [\"theme\", \"feathers\", \"starling\"],\n\t\"status\": \"release\",\n\t\"license\": {\n\t  \"type\": \"Simplified BSD\",\n\t  \"url\": \"https://github.com/feathersui/feathersui-starling/blob/v4.2.0/LICENSE.md\",\n\t  \"public\": true\n\t}\n  }\n  "
  },
  {
    "path": "themes/MinimalDesktopTheme/source/feathers/themes/BaseMinimalDesktopTheme.as",
    "content": "/*\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n*/\npackage feathers.themes\n{\n\timport feathers.controls.Alert;\n\timport feathers.controls.AutoComplete;\n\timport feathers.controls.AutoSizeMode;\n\timport feathers.controls.Button;\n\timport feathers.controls.ButtonGroup;\n\timport feathers.controls.ButtonState;\n\timport feathers.controls.Callout;\n\timport feathers.controls.Check;\n\timport feathers.controls.DataGrid;\n\timport feathers.controls.DateTimeSpinner;\n\timport feathers.controls.Drawers;\n\timport feathers.controls.GroupedList;\n\timport feathers.controls.Header;\n\timport feathers.controls.IScrollBar;\n\timport feathers.controls.ImageLoader;\n\timport feathers.controls.Label;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.List;\n\timport feathers.controls.NumericStepper;\n\timport feathers.controls.PageIndicator;\n\timport feathers.controls.PageIndicatorInteractionMode;\n\timport feathers.controls.Panel;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.PickerList;\n\timport feathers.controls.ProgressBar;\n\timport feathers.controls.Radio;\n\timport feathers.controls.ScrollBar;\n\timport feathers.controls.ScrollBarDisplayMode;\n\timport feathers.controls.ScrollContainer;\n\timport feathers.controls.ScrollInteractionMode;\n\timport feathers.controls.ScrollPolicy;\n\timport feathers.controls.ScrollScreen;\n\timport feathers.controls.ScrollText;\n\timport feathers.controls.Scroller;\n\timport feathers.controls.SimpleScrollBar;\n\timport feathers.controls.Slider;\n\timport feathers.controls.SpinnerList;\n\timport feathers.controls.StepperButtonLayoutMode;\n\timport feathers.controls.TabBar;\n\timport feathers.controls.TextArea;\n\timport feathers.controls.TextCallout;\n\timport feathers.controls.TextInput;\n\timport feathers.controls.TextInputState;\n\timport feathers.controls.Toast;\n\timport feathers.controls.ToggleButton;\n\timport feathers.controls.ToggleSwitch;\n\timport feathers.controls.TrackLayoutMode;\n\timport feathers.controls.Tree;\n\timport feathers.controls.popups.DropDownPopUpContentManager;\n\timport feathers.controls.renderers.BaseDefaultItemRenderer;\n\timport feathers.controls.renderers.DefaultDataGridCellRenderer;\n\timport feathers.controls.renderers.DefaultDataGridHeaderRenderer;\n\timport feathers.controls.renderers.DefaultGroupedListHeaderOrFooterRenderer;\n\timport feathers.controls.renderers.DefaultGroupedListItemRenderer;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.renderers.DefaultTreeItemRenderer;\n\timport feathers.controls.text.BitmapFontTextEditor;\n\timport feathers.controls.text.BitmapFontTextRenderer;\n\timport feathers.controls.text.TextFieldTextEditorViewPort;\n\timport feathers.core.FeathersControl;\n\timport feathers.core.FocusManager;\n\timport feathers.core.PopUpManager;\n\timport feathers.core.ToolTipManager;\n\timport feathers.layout.Direction;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.HorizontalLayout;\n\timport feathers.layout.RelativePosition;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.media.FullScreenToggleButton;\n\timport feathers.media.MuteToggleButton;\n\timport feathers.media.PlayPauseToggleButton;\n\timport feathers.media.SeekSlider;\n\timport feathers.media.VideoPlayer;\n\timport feathers.media.VolumeSlider;\n\timport feathers.skins.ImageSkin;\n\n\timport flash.geom.Rectangle;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.DisplayObjectContainer;\n\timport starling.display.Image;\n\timport starling.display.Quad;\n\timport starling.display.Stage;\n\timport starling.text.TextField;\n\timport starling.text.TextFormat;\n\timport starling.textures.Texture;\n\timport starling.textures.TextureAtlas;\n\timport starling.textures.TextureSmoothing;\n\n\t/**\n\t * The base class for the \"Minimal\" theme for desktop Feathers apps. Handles\n\t * everything except asset loading, which is left to subclasses.\n\t *\n\t * @see MinimalDesktopTheme\n\t * @see MinimalDesktopThemeWithAssetManager\n\t */\n\tpublic class BaseMinimalDesktopTheme extends StyleNameFunctionTheme\n\t{\n\t\t/**\n\t\t * The name of the embedded bitmap font used by controls in this theme.\n\t\t */\n\t\tpublic static const FONT_NAME:String = \"PF Ronda Seven\";\n\n\t\t/**\n\t\t * The stack of fonts to use for controls that don't use embedded fonts.\n\t\t */\n\t\tpublic static const FONT_NAME_STACK:String = \"PF Ronda Seven,Roboto,Helvetica,Arial,_sans\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the minimum track of a horizontal slider.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_HORIZONTAL_SLIDER_MINIMUM_TRACK:String = \"minimal-desktop-horizontal-slider-minimum-track\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the minimum track of a vertical slider.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_VERTICAL_SLIDER_MINIMUM_TRACK:String = \"minimal-desktop-vertical-slider-minimum-track\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the decrement button of a horizontal scroll bar.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_DECREMENT_BUTTON:String = \"minimal-desktop-horizontal-scroll-bar-decrement-button\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the increment button of a horizontal scroll bar.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_INCREMENT_BUTTON:String = \"minimal-desktop-horizontal-scroll-bar-increment-button\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the decrement button of a horizontal scroll bar.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_DECREMENT_BUTTON:String = \"minimal-desktop-vertical-scroll-bar-decrement-button\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the increment button of a vertical scroll bar.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_INCREMENT_BUTTON:String = \"minimal-desktop-vertical-scroll-bar-increment-button\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_POP_UP_VOLUME_SLIDER_THUMB:String = \"minimal-desktop-pop-up-volume-slider-thumb\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_POP_UP_VOLUME_SLIDER_MINIMUM_TRACK:String = \"minimal-desktop-pop-up-volume-slider-minimum-track\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_NUMERIC_STEPPER_TEXT_INPUT_TEXT_EDITOR:String = \"minimal-desktop-numeric-stepper-text-input-text-editor\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_DATE_TIME_SPINNER_LIST_ITEM_RENDERER:String = \"minimal-desktop-date-time-spinner-list-item-renderer\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the text renderer of a tool tip Label.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_TOOL_TIP_LABEL_TEXT_RENDERER:String = \"minimal-desktop-tool-tip-label-text-renderer\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_ALERT_BUTTON_GROUP_BUTTON:String = \"minimal-desktop-alert-button-group-button\";\n\t\t\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for a button in a Toast.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_TOAST_ACTIONS_BUTTON:String = \"minimal-mobile-toast-actions-button\";\n\n\t\tprotected static const FONT_TEXTURE_NAME:String = \"pf-ronda-seven-font\";\n\n\t\tprotected static const ATLAS_SCALE_FACTOR:Number = 2;\n\n\t\tprotected static const SOLID_COLOR_TEXTURE_REGION:Rectangle = new Rectangle(1, 1, 1, 1);\n\n\t\tprotected static const DEFAULT_SCALE_9_GRID:Rectangle = new Rectangle(3, 3, 1, 1);\n\t\tprotected static const SCROLLBAR_THUMB_SCALE_9_GRID:Rectangle = new Rectangle(1, 1, 2, 2);\n\t\tprotected static const TAB_SCALE_9_GRID:Rectangle = new Rectangle(4, 4, 1, 1);\n\t\tprotected static const HEADER_SCALE_9_GRID:Rectangle = new Rectangle(0, 2, 3, 1);\n\t\tprotected static const VOLUME_SLIDER_TRACK_SCALE9_GRID:Rectangle = new Rectangle(18, 13, 1, 1);\n\t\tprotected static const SEEK_SLIDER_PROGRESS_SKIN_SCALE9_GRID:Rectangle = new Rectangle(0, 2, 2, 10);\n\t\tprotected static const BACK_BUTTON_SCALE_9_GRID:Rectangle = new Rectangle(11, 0, 1, 20);\n\t\tprotected static const FORWARD_BUTTON_SCALE_9_GRID:Rectangle = new Rectangle(1, 0, 1, 20);\n\t\tprotected static const DATA_GRID_COLUMN_RESIZE_SKIN_SCALE_9_GRID:Rectangle = new Rectangle(0, 1, 1, 3);\n\t\tprotected static const DATA_GRID_HEADER_DIVIDER_SCALE_9_GRID:Rectangle = new Rectangle(0, 1, 3, 3);\n\t\tprotected static const DATA_GRID_HEADER_RENDERER_SCALE_9_GRID:Rectangle = new Rectangle(1, 1, 1, 1);\n\t\tprotected static const DATA_GRID_COLUMN_DROP_INDICATOR_SCALE_9_GRID:Rectangle = new Rectangle(0, 1, 1, 3);\n\n\t\tprotected static const BACKGROUND_COLOR:uint = 0xf3f3f3;\n\t\tprotected static const PRIMARY_TEXT_COLOR:uint = 0x666666;\n\t\tprotected static const DISABLED_TEXT_COLOR:uint = 0x999999;\n\t\tprotected static const DANGER_TEXT_COLOR:uint = 0x990000;\n\t\tprotected static const MODAL_OVERLAY_COLOR:uint = 0xcccccc;\n\t\tprotected static const MODAL_OVERLAY_ALPHA:Number = 0.4;\n\t\tprotected static const VIDEO_OVERLAY_COLOR:uint = 0xcccccc;\n\t\tprotected static const VIDEO_OVERLAY_ALPHA:Number = 0.2;\n\t\tprotected static const DATA_GRID_COLUMN_OVERLAY_COLOR:uint = 0xeeeeee;\n\t\tprotected static const DATA_GRID_COLUMN_OVERLAY_ALPHA:Number = 0.6;\n\n\t\t/**\n\t\t * The default global text renderer factory for this theme creates a\n\t\t * BitmapFontTextRenderer.\n\t\t */\n\t\tprotected static function textRendererFactory():BitmapFontTextRenderer\n\t\t{\n\t\t\tvar renderer:BitmapFontTextRenderer = new BitmapFontTextRenderer();\n\t\t\t//since it's a pixel font, we don't want to smooth it.\n\t\t\trenderer.textureSmoothing = TextureSmoothing.NONE;\n\t\t\treturn renderer;\n\t\t}\n\n\t\t/**\n\t\t * The default global text editor factory for this theme creates a\n\t\t * BitmapFontTextEditor.\n\t\t */\n\t\tprotected static function textEditorFactory():BitmapFontTextEditor\n\t\t{\n\t\t\treturn new BitmapFontTextEditor();\n\t\t}\n\n\t\t/**\n\t\t * This theme's scroll bar type is ScrollBar.\n\t\t */\n\t\tprotected static function scrollBarFactory():IScrollBar\n\t\t{\n\t\t\treturn new ScrollBar();\n\t\t}\n\n\t\tprotected static function popUpOverlayFactory():DisplayObject\n\t\t{\n\t\t\tvar quad:Quad = new Quad(100, 100, MODAL_OVERLAY_COLOR);\n\t\t\tquad.alpha = MODAL_OVERLAY_ALPHA;\n\t\t\treturn quad;\n\t\t}\n\t\t\n\t\tprotected static function pickerListButtonFactory():ToggleButton\n\t\t{\n\t\t\treturn new ToggleButton();\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function BaseMinimalDesktopTheme()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * A normal font size. Since it's a pixel font, we want a multiple of\n\t\t * the original size, which, in this case, is 8.\n\t\t */\n\t\tprotected var fontSize:int = 8;\n\n\t\t/**\n\t\t * A larger font size for headers.\n\t\t */\n\t\tprotected var largeFontSize:int = 16;\n\n\t\t/**\n\t\t * The size, in pixels, of major regions in the grid. Used for sizing\n\t\t * containers and larger UI controls.\n\t\t */\n\t\tprotected var gridSize:int = 30;\n\n\t\t/**\n\t\t * The size, in pixels, of minor regions in the grid. Used for larger\n\t\t * padding and gaps.\n\t\t */\n\t\tprotected var gutterSize:int = 8;\n\n\t\t/**\n\t\t * The size, in pixels, of smaller padding and gaps within the major\n\t\t * regions in the grid.\n\t\t */\n\t\tprotected var smallGutterSize:int = 4;\n\n\t\t/**\n\t\t * The size, in pixels, of very smaller padding and gaps.\n\t\t */\n\t\tprotected var extraSmallGutterSize:int = 2;\n\n\t\t/**\n\t\t * The width, in pixels, of UI controls that span across multiple grid regions.\n\t\t */\n\t\tprotected var wideControlSize:int = 98;\n\n\t\t/**\n\t\t * The width, in pixels, of very large UI controls.\n\t\t */\n\t\tprotected var extraWideControlSize:int = 210;\n\n\t\t/**\n\t\t * The minimum width, in pixels, of some types of buttons.\n\t\t */\n\t\tprotected var buttonMinWidth:int = 64;\n\n\t\t/**\n\t\t * The size, in pixels, of a typical UI control.\n\t\t */\n\t\tprotected var controlSize:int = 20;\n\n\t\t/**\n\t\t * The size, in pixels, of smaller UI controls.\n\t\t */\n\t\tprotected var smallControlSize:int = 12;\n\n\t\t/**\n\t\t * The size, in pixels, of a border around any control.\n\t\t */\n\t\tprotected var borderSize:int = 1;\n\n\t\t/**\n\t\t * The size, in pixels, of a drop shadow on a control's bottom right.\n\t\t */\n\t\tprotected var dropShadowSize:int = 4;\n\n\t\tprotected var calloutBackgroundMinSize:int = 5;\n\t\tprotected var calloutTopLeftArrowOverlapGapSize:int = -2;\n\t\tprotected var calloutBottomRightArrowOverlapGapSize:int = -6;\n\t\tprotected var progressBarFillMinSize:int = 7;\n\t\tprotected var popUpSize:int = 336;\n\t\tprotected var dropDownGapSize:int = -1;\n\t\tprotected var focusPaddingSize:int = -2;\n\t\tprotected var popUpVolumeSliderPaddingTopLeft:int = 9;\n\t\tprotected var popUpVolumeSliderPaddingBottomRight:int = 13;\n\n\t\t/**\n\t\t * The texture atlas that contains skins for this theme. This base class\n\t\t * does not initialize this member variable. Subclasses are expected to\n\t\t * load the assets somehow and set the <code>atlas</code> member\n\t\t * variable before calling <code>initialize()</code>.\n\t\t */\n\t\tprotected var atlas:TextureAtlas;\n\n\t\tprotected var focusIndicatorSkinTexture:Texture;\n\n\t\tprotected var buttonUpSkinTexture:Texture;\n\t\tprotected var buttonDownSkinTexture:Texture;\n\t\tprotected var buttonDisabledSkinTexture:Texture;\n\t\tprotected var buttonSelectedSkinTexture:Texture;\n\t\tprotected var buttonSelectedDisabledSkinTexture:Texture;\n\t\tprotected var buttonCallToActionUpSkinTexture:Texture;\n\t\tprotected var buttonDangerUpSkinTexture:Texture;\n\t\tprotected var buttonDangerDownSkinTexture:Texture;\n\t\tprotected var buttonBackUpSkinTexture:Texture;\n\t\tprotected var buttonBackDownSkinTexture:Texture;\n\t\tprotected var buttonBackDisabledSkinTexture:Texture;\n\t\tprotected var buttonForwardUpSkinTexture:Texture;\n\t\tprotected var buttonForwardDownSkinTexture:Texture;\n\t\tprotected var buttonForwardDisabledSkinTexture:Texture;\n\n\t\tprotected var tabSkinTexture:Texture;\n\t\tprotected var tabDisabledSkinTexture:Texture;\n\t\tprotected var tabSelectedSkinTexture:Texture;\n\t\tprotected var tabSelectedDisabledSkinTexture:Texture;\n\n\t\tprotected var thumbSkinTexture:Texture;\n\t\tprotected var thumbDisabledSkinTexture:Texture;\n\n\t\tprotected var simpleScrollBarThumbSkinTexture:Texture;\n\n\t\tprotected var insetBackgroundSkinTexture:Texture;\n\t\tprotected var insetBackgroundDisabledSkinTexture:Texture;\n\t\tprotected var insetBackgroundFocusedSkinTexture:Texture;\n\t\tprotected var insetBackgroundDangerSkinTexture:Texture;\n\n\t\tprotected var pickerListButtonIconUpTexture:Texture;\n\t\tprotected var pickerListButtonIconSelectedTexture:Texture;\n\t\tprotected var pickerListButtonIconDisabledTexture:Texture;\n\t\tprotected var searchIconTexture:Texture;\n\t\tprotected var searchIconDisabledTexture:Texture;\n\t\tprotected var verticalScrollBarDecrementButtonIconTexture:Texture;\n\t\tprotected var verticalScrollBarIncrementButtonIconTexture:Texture;\n\t\tprotected var horizontalScrollBarIncrementButtonIconTexture:Texture;\n\t\tprotected var horizontalScrollBarDecrementButtonIconTexture:Texture;\n\n\t\tprotected var headerSkinTexture:Texture;\n\t\tprotected var panelHeaderSkinTexture:Texture;\n\n\t\tprotected var panelBackgroundSkinTexture:Texture;\n\t\tprotected var popUpBackgroundSkinTexture:Texture;\n\t\tprotected var dangerPopUpBackgroundSkinTexture:Texture;\n\t\t\n\t\tprotected var calloutTopArrowSkinTexture:Texture;\n\t\tprotected var calloutBottomArrowSkinTexture:Texture;\n\t\tprotected var calloutLeftArrowSkinTexture:Texture;\n\t\tprotected var calloutRightArrowSkinTexture:Texture;\n\t\tprotected var dangerCalloutTopArrowSkinTexture:Texture;\n\t\tprotected var dangerCalloutBottomArrowSkinTexture:Texture;\n\t\tprotected var dangerCalloutLeftArrowSkinTexture:Texture;\n\t\tprotected var dangerCalloutRightArrowSkinTexture:Texture;\n\n\t\tprotected var checkIconTexture:Texture;\n\t\tprotected var checkDisabledIconTexture:Texture;\n\t\tprotected var checkSelectedIconTexture:Texture;\n\t\tprotected var checkSelectedDisabledIconTexture:Texture;\n\n\t\tprotected var radioIconTexture:Texture;\n\t\tprotected var radioDisabledIconTexture:Texture;\n\t\tprotected var radioSelectedIconTexture:Texture;\n\t\tprotected var radioSelectedDisabledIconTexture:Texture;\n\n\t\tprotected var pageIndicatorSymbolTexture:Texture;\n\t\tprotected var pageIndicatorSelectedSymbolTexture:Texture;\n\n\t\tprotected var listBackgroundSkinTexture:Texture;\n\t\tprotected var listInsetBackgroundSkinTexture:Texture;\n\t\t\n\t\tprotected var itemRendererUpSkinTexture:Texture;\n\t\tprotected var itemRendererHoverSkinTexture:Texture;\n\t\tprotected var itemRendererSelectedSkinTexture:Texture;\n\t\tprotected var headerRendererSkinTexture:Texture;\n\t\t\n\t\tprotected var listDrillDownAccessoryTexture:Texture;\n\n\t\tprotected var treeDisclosureOpenIconTexture:Texture;\n\t\tprotected var treeDisclosureClosedIconTexture:Texture;\n\n\t\tprotected var dataGridHeaderRendererSkinTexture:Texture;\n\t\tprotected var dataGridColumnResizeSkinTexture:Texture;\n\t\tprotected var dataGridHeaderDividerSkinTexture:Texture;\n\t\tprotected var dataGridColumnDropIndicatorSkinTexture:Texture;\n\t\tprotected var dataGridHeaderSortAscendingIconTexture:Texture;\n\t\tprotected var dataGridHeaderSortDescendingIconTexture:Texture;\n\n\t\t//media textures\n\t\tprotected var playPauseButtonPlayUpIconTexture:Texture;\n\t\tprotected var playPauseButtonPauseUpIconTexture:Texture;\n\t\tprotected var overlayPlayPauseButtonPlayUpIconTexture:Texture;\n\t\tprotected var overlayPlayPauseButtonPlayDownIconTexture:Texture;\n\t\tprotected var fullScreenToggleButtonEnterUpIconTexture:Texture;\n\t\tprotected var fullScreenToggleButtonExitUpIconTexture:Texture;\n\t\tprotected var muteToggleButtonLoudUpIconTexture:Texture;\n\t\tprotected var muteToggleButtonMutedUpIconTexture:Texture;\n\t\tprotected var volumeSliderMinimumTrackSkinTexture:Texture;\n\t\tprotected var volumeSliderMaximumTrackSkinTexture:Texture;\n\t\tprotected var popUpVolumeSliderTrackSkinTexture:Texture;\n\t\tprotected var seekSliderProgressSkinTexture:Texture;\n\n\t\tprotected var primaryFontStyles:TextFormat;\n\t\tprotected var disabledFontStyles:TextFormat;\n\t\tprotected var headingFontStyles:TextFormat;\n\t\tprotected var headingDisabledFontStyles:TextFormat;\n\t\tprotected var centeredFontStyles:TextFormat;\n\t\tprotected var centeredDisabledFontStyles:TextFormat;\n\t\tprotected var dangerFontStyles:TextFormat;\n\t\tprotected var scrollTextFontStyles:TextFormat;\n\t\tprotected var scrollTextDisabledFontStyles:TextFormat;\n\n\t\t/**\n\t\t * Disposes the texture atlas and bitmap font before calling\n\t\t * super.dispose().\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this.atlas)\n\t\t\t{\n\t\t\t\t//if anything is keeping a reference to the texture, we don't\n\t\t\t\t//want it to keep a reference to the theme too.\n\t\t\t\tthis.atlas.texture.root.onRestore = null;\n\t\t\t\t\n\t\t\t\tthis.atlas.dispose();\n\t\t\t\tthis.atlas = null;\n\t\t\t}\n\t\t\tTextField.unregisterCompositor(FONT_NAME);\n\n\t\t\tvar stage:Stage = this.starling.stage;\n\t\t\tFocusManager.setEnabledForStage(stage, false);\n\t\t\tToolTipManager.setEnabledForStage(stage, false);\n\n\t\t\t//don't forget to call super.dispose()!\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * Initializes the theme. Expected to be called by subclasses after the\n\t\t * assets have been loaded and the skin texture atlas has been created.\n\t\t */\n\t\tprotected function initialize():void\n\t\t{\n\t\t\tthis.initializeFonts();\n\t\t\tthis.initializeTextures();\n\t\t\tthis.initializeGlobals();\n\t\t\tthis.initializeStage();\n\t\t\tthis.initializeStyleProviders();\n\t\t}\n\n\t\t/**\n\t\t * Sets the stage background color.\n\t\t */\n\t\tprotected function initializeStage():void\n\t\t{\n\t\t\tthis.starling.stage.color = BACKGROUND_COLOR;\n\t\t\tthis.starling.nativeStage.color = BACKGROUND_COLOR;\n\t\t}\n\n\t\t/**\n\t\t * Initializes global variables (not including global style providers).\n\t\t */\n\t\tprotected function initializeGlobals():void\n\t\t{\n\t\t\tvar stage:Stage = this.starling.stage;\n\t\t\tFocusManager.setEnabledForStage(stage, true);\n\t\t\tToolTipManager.setEnabledForStage(stage, true);\n\n\t\t\tPopUpManager.overlayFactory = popUpOverlayFactory;\n\t\t\tCallout.stagePadding = this.smallGutterSize;\n\t\t\tToast.containerFactory = toastContainerFactory;\n\n\t\t\tFeathersControl.defaultTextRendererFactory = textRendererFactory;\n\t\t\tFeathersControl.defaultTextEditorFactory = textEditorFactory;\n\t\t}\n\n\t\t/**\n\t\t * Initializes the textures by extracting them from the atlas and\n\t\t * setting up any scaling grids that are needed.\n\t\t */\n\t\tprotected function initializeTextures():void\n\t\t{\n\t\t\tthis.focusIndicatorSkinTexture = this.atlas.getTexture(\"focus-indicator-skin0000\");\n\n\t\t\tthis.buttonUpSkinTexture = this.atlas.getTexture(\"button-up-skin0000\");\n\t\t\tthis.buttonDownSkinTexture = this.atlas.getTexture(\"button-down-skin0000\");\n\t\t\tthis.buttonDisabledSkinTexture = this.atlas.getTexture(\"button-disabled-skin0000\");\n\t\t\tthis.buttonSelectedSkinTexture = this.atlas.getTexture(\"inset-background-enabled-skin0000\");\n\t\t\tthis.buttonSelectedDisabledSkinTexture = this.atlas.getTexture(\"inset-background-disabled-skin0000\");\n\t\t\tthis.buttonCallToActionUpSkinTexture = this.atlas.getTexture(\"call-to-action-button-up-skin0000\");\n\t\t\tthis.buttonDangerUpSkinTexture = this.atlas.getTexture(\"danger-button-up-skin0000\");\n\t\t\tthis.buttonDangerDownSkinTexture = this.atlas.getTexture(\"danger-button-down-skin0000\");\n\t\t\tthis.buttonBackUpSkinTexture = this.atlas.getTexture(\"back-button-up-skin0000\");\n\t\t\tthis.buttonBackDownSkinTexture = this.atlas.getTexture(\"back-button-down-skin0000\");\n\t\t\tthis.buttonBackDisabledSkinTexture = this.atlas.getTexture(\"back-button-disabled-skin0000\");\n\t\t\tthis.buttonForwardUpSkinTexture = this.atlas.getTexture(\"forward-button-up-skin0000\");\n\t\t\tthis.buttonForwardDownSkinTexture = this.atlas.getTexture(\"forward-button-down-skin0000\");\n\t\t\tthis.buttonForwardDisabledSkinTexture = this.atlas.getTexture(\"forward-button-disabled-skin0000\");\n\n\t\t\tthis.tabSkinTexture = this.atlas.getTexture(\"tab-up-skin0000\");\n\t\t\tthis.tabDisabledSkinTexture = this.atlas.getTexture(\"tab-disabled-skin0000\");\n\t\t\tthis.tabSelectedSkinTexture = this.atlas.getTexture(\"tab-selected-up-skin0000\");\n\t\t\tthis.tabSelectedDisabledSkinTexture = this.atlas.getTexture(\"tab-selected-disabled-skin0000\");\n\n\t\t\tthis.thumbSkinTexture = this.atlas.getTexture(\"face-up-skin0000\");\n\t\t\tthis.thumbDisabledSkinTexture = this.atlas.getTexture(\"face-disabled-skin0000\");\n\n\t\t\tthis.simpleScrollBarThumbSkinTexture = this.atlas.getTexture(\"simple-scroll-bar-thumb-skin0000\");\n\n\t\t\tthis.listBackgroundSkinTexture = this.atlas.getTexture(\"list-background-skin0000\");\n\t\t\tthis.listInsetBackgroundSkinTexture = this.atlas.getTexture(\"list-inset-background-skin0000\");\n\t\t\t\n\t\t\tthis.itemRendererUpSkinTexture = Texture.fromTexture(this.atlas.getTexture(\"item-renderer-up-skin0000\"), SOLID_COLOR_TEXTURE_REGION);\n\t\t\tthis.itemRendererHoverSkinTexture = Texture.fromTexture(this.atlas.getTexture(\"item-renderer-hover-skin0000\"), SOLID_COLOR_TEXTURE_REGION);\n\t\t\tthis.itemRendererSelectedSkinTexture = Texture.fromTexture(this.atlas.getTexture(\"item-renderer-selected-skin0000\"), SOLID_COLOR_TEXTURE_REGION);\n\t\t\tthis.headerRendererSkinTexture = Texture.fromTexture(this.atlas.getTexture(\"header-renderer-skin0000\"), SOLID_COLOR_TEXTURE_REGION);\n\n\t\t\tthis.insetBackgroundSkinTexture = this.atlas.getTexture(\"inset-background-enabled-skin0000\");\n\t\t\tthis.insetBackgroundDisabledSkinTexture = this.atlas.getTexture(\"inset-background-disabled-skin0000\");\n\t\t\tthis.insetBackgroundFocusedSkinTexture = this.atlas.getTexture(\"inset-background-focused-skin0000\");\n\t\t\tthis.insetBackgroundDangerSkinTexture = this.atlas.getTexture(\"inset-background-danger-skin0000\");\n\n\t\t\tthis.pickerListButtonIconUpTexture = this.atlas.getTexture(\"picker-list-icon0000\");\n\t\t\tthis.pickerListButtonIconSelectedTexture = this.atlas.getTexture(\"picker-list-selected-icon0000\");\n\t\t\tthis.pickerListButtonIconDisabledTexture = this.atlas.getTexture(\"picker-list-disabled-icon0000\");\n\t\t\tthis.searchIconTexture = this.atlas.getTexture(\"search-enabled-icon0000\");\n\t\t\tthis.searchIconDisabledTexture = this.atlas.getTexture(\"search-disabled-icon0000\");\n\t\t\tthis.verticalScrollBarDecrementButtonIconTexture = this.atlas.getTexture(\"vertical-scroll-bar-decrement-button-icon0000\");\n\t\t\tthis.verticalScrollBarIncrementButtonIconTexture = this.atlas.getTexture(\"vertical-scroll-bar-increment-button-icon0000\");\n\t\t\tthis.horizontalScrollBarDecrementButtonIconTexture = this.atlas.getTexture(\"horizontal-scroll-bar-decrement-button-icon0000\");\n\t\t\tthis.horizontalScrollBarIncrementButtonIconTexture = this.atlas.getTexture(\"horizontal-scroll-bar-increment-button-icon0000\");\n\n\t\t\tthis.headerSkinTexture = this.atlas.getTexture(\"header-background-skin0000\");\n\t\t\tthis.panelHeaderSkinTexture = this.atlas.getTexture(\"panel-header-background-skin0000\");\n\n\t\t\tthis.popUpBackgroundSkinTexture = this.atlas.getTexture(\"pop-up-background-skin0000\");\n\t\t\tthis.dangerPopUpBackgroundSkinTexture = this.atlas.getTexture(\"danger-pop-up-background-skin0000\");\n\t\t\tthis.panelBackgroundSkinTexture = this.atlas.getTexture(\"panel-background-skin0000\");\n\t\t\tthis.calloutTopArrowSkinTexture = this.atlas.getTexture(\"callout-top-arrow-skin0000\");\n\t\t\tthis.calloutBottomArrowSkinTexture = this.atlas.getTexture(\"callout-bottom-arrow-skin0000\");\n\t\t\tthis.calloutLeftArrowSkinTexture = this.atlas.getTexture(\"callout-left-arrow-skin0000\");\n\t\t\tthis.calloutRightArrowSkinTexture = this.atlas.getTexture(\"callout-right-arrow-skin0000\");\n\t\t\tthis.dangerCalloutTopArrowSkinTexture = this.atlas.getTexture(\"danger-callout-top-arrow-skin0000\");\n\t\t\tthis.dangerCalloutBottomArrowSkinTexture = this.atlas.getTexture(\"danger-callout-bottom-arrow-skin0000\");\n\t\t\tthis.dangerCalloutLeftArrowSkinTexture = this.atlas.getTexture(\"danger-callout-left-arrow-skin0000\");\n\t\t\tthis.dangerCalloutRightArrowSkinTexture = this.atlas.getTexture(\"danger-callout-right-arrow-skin0000\");\n\n\t\t\tthis.checkIconTexture = this.atlas.getTexture(\"check-up-icon0000\");\n\t\t\tthis.checkDisabledIconTexture = this.atlas.getTexture(\"check-disabled-icon0000\");\n\t\t\tthis.checkSelectedIconTexture = this.atlas.getTexture(\"check-selected-up-icon0000\");\n\t\t\tthis.checkSelectedDisabledIconTexture = this.atlas.getTexture(\"check-selected-disabled-icon0000\");\n\n\t\t\tthis.radioIconTexture = this.atlas.getTexture(\"radio-up-icon0000\");\n\t\t\tthis.radioDisabledIconTexture = this.atlas.getTexture(\"radio-disabled-icon0000\");\n\t\t\tthis.radioSelectedIconTexture = this.atlas.getTexture(\"radio-selected-up-icon0000\");\n\t\t\tthis.radioSelectedDisabledIconTexture = this.atlas.getTexture(\"radio-selected-disabled-icon0000\");\n\n\t\t\tthis.pageIndicatorSymbolTexture = this.atlas.getTexture(\"page-indicator-symbol0000\");\n\t\t\tthis.pageIndicatorSelectedSymbolTexture = this.atlas.getTexture(\"page-indicator-selected-symbol0000\");\n\n\t\t\tthis.playPauseButtonPlayUpIconTexture = this.atlas.getTexture(\"play-pause-toggle-button-play-up-icon0000\");\n\t\t\tthis.playPauseButtonPauseUpIconTexture = this.atlas.getTexture(\"play-pause-toggle-button-pause-up-icon0000\");\n\t\t\tthis.overlayPlayPauseButtonPlayUpIconTexture = this.atlas.getTexture(\"overlay-play-pause-toggle-button-play-up-icon0000\");\n\t\t\tthis.overlayPlayPauseButtonPlayDownIconTexture = this.atlas.getTexture(\"overlay-play-pause-toggle-button-play-down-icon0000\");\n\t\t\tthis.fullScreenToggleButtonEnterUpIconTexture = this.atlas.getTexture(\"full-screen-toggle-button-enter-up-icon0000\");\n\t\t\tthis.fullScreenToggleButtonExitUpIconTexture = this.atlas.getTexture(\"full-screen-toggle-button-exit-up-icon0000\");\n\t\t\tthis.muteToggleButtonMutedUpIconTexture = this.atlas.getTexture(\"mute-toggle-button-muted-up-icon0000\");\n\t\t\tthis.muteToggleButtonLoudUpIconTexture = this.atlas.getTexture(\"mute-toggle-button-loud-up-icon0000\");\n\t\t\tthis.volumeSliderMinimumTrackSkinTexture = this.atlas.getTexture(\"volume-slider-minimum-track-skin0000\");\n\t\t\tthis.volumeSliderMaximumTrackSkinTexture = this.atlas.getTexture(\"volume-slider-maximum-track-skin0000\");\n\t\t\tthis.popUpVolumeSliderTrackSkinTexture = this.atlas.getTexture(\"pop-up-volume-slider-track-skin0000\");\n\t\t\tthis.seekSliderProgressSkinTexture = this.atlas.getTexture(\"seek-slider-progress-skin0000\");\n\n\t\t\tthis.listDrillDownAccessoryTexture = this.atlas.getTexture(\"list-accessory-drill-down-icon0000\");\n\n\t\t\tthis.treeDisclosureOpenIconTexture = this.atlas.getTexture(\"tree-disclosure-open-icon0000\");\n\t\t\tthis.treeDisclosureClosedIconTexture = this.atlas.getTexture(\"tree-disclosure-closed-icon0000\");\n\n\t\t\tthis.dataGridColumnResizeSkinTexture = this.atlas.getTexture(\"data-grid-column-resize-skin0000\");\n\t\t\tthis.dataGridHeaderDividerSkinTexture = this.atlas.getTexture(\"data-grid-header-divider-skin0000\");\n\t\t\tthis.dataGridHeaderRendererSkinTexture = this.atlas.getTexture(\"data-grid-header-renderer-skin0000\");\n\t\t\tthis.dataGridColumnDropIndicatorSkinTexture = this.atlas.getTexture(\"data-grid-column-drop-indicator-skin0000\");\n\t\t\tthis.dataGridHeaderSortAscendingIconTexture = this.atlas.getTexture(\"data-grid-header-sort-ascending-icon0000\");\n\t\t\tthis.dataGridHeaderSortDescendingIconTexture = this.atlas.getTexture(\"data-grid-header-sort-descending-icon0000\");\n\t\t}\n\n\t\t/**\n\t\t * Initializes font sizes and formats.\n\t\t */\n\t\tprotected function initializeFonts():void\n\t\t{\n\t\t\tthis.primaryFontStyles = new TextFormat(FONT_NAME, this.fontSize, PRIMARY_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.disabledFontStyles = new TextFormat(FONT_NAME, this.fontSize, DISABLED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.headingFontStyles = new TextFormat(FONT_NAME, this.largeFontSize, PRIMARY_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.headingDisabledFontStyles = new TextFormat(FONT_NAME, this.largeFontSize, DISABLED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.centeredFontStyles = new TextFormat(FONT_NAME, this.fontSize, PRIMARY_TEXT_COLOR, HorizontalAlign.CENTER, VerticalAlign.TOP);\n\t\t\tthis.centeredDisabledFontStyles = new TextFormat(FONT_NAME, this.fontSize, DISABLED_TEXT_COLOR, HorizontalAlign.CENTER, VerticalAlign.TOP);\n\t\t\tthis.dangerFontStyles = new TextFormat(FONT_NAME, this.fontSize, DANGER_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.scrollTextFontStyles = new TextFormat(FONT_NAME_STACK, this.fontSize, PRIMARY_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.scrollTextDisabledFontStyles = new TextFormat(FONT_NAME_STACK, this.fontSize, DISABLED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t}\n\n\t\t/**\n\t\t * Sets global style providers for all components.\n\t\t */\n\t\tprotected function initializeStyleProviders():void\n\t\t{\n\t\t\t//alert\n\t\t\tthis.getStyleProviderForClass(Alert).defaultStyleFunction = this.setAlertStyles;\n\t\t\tthis.getStyleProviderForClass(Header).setFunctionForStyleName(Alert.DEFAULT_CHILD_STYLE_NAME_HEADER, this.setPanelHeaderStyles);\n\t\t\tthis.getStyleProviderForClass(ButtonGroup).setFunctionForStyleName(Alert.DEFAULT_CHILD_STYLE_NAME_BUTTON_GROUP, this.setAlertButtonGroupStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_ALERT_BUTTON_GROUP_BUTTON, this.setAlertButtonGroupButtonStyles);\n\n\t\t\t//autocomplete\n\t\t\tthis.getStyleProviderForClass(AutoComplete).defaultStyleFunction = this.setTextInputStyles;\n\t\t\tthis.getStyleProviderForClass(List).setFunctionForStyleName(AutoComplete.DEFAULT_CHILD_STYLE_NAME_LIST, this.setDropDownListStyles);\n\n\t\t\t//button\n\t\t\tthis.getStyleProviderForClass(Button).defaultStyleFunction = this.setButtonStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_CALL_TO_ACTION_BUTTON, this.setCallToActionButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_QUIET_BUTTON, this.setQuietButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_DANGER_BUTTON, this.setDangerButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON, this.setBackButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_FORWARD_BUTTON, this.setForwardButtonStyles);\n\n\t\t\t//button group\n\t\t\tthis.getStyleProviderForClass(ButtonGroup).defaultStyleFunction = this.setButtonGroupStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(ButtonGroup.DEFAULT_CHILD_STYLE_NAME_BUTTON, this.setButtonGroupButtonStyles);\n\t\t\tthis.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(ButtonGroup.DEFAULT_CHILD_STYLE_NAME_BUTTON, this.setButtonGroupButtonStyles);\n\n\t\t\t//callout\n\t\t\tthis.getStyleProviderForClass(Callout).defaultStyleFunction = this.setCalloutStyles;\n\n\t\t\t//check\n\t\t\tthis.getStyleProviderForClass(Check).defaultStyleFunction = this.setCheckStyles;\n\n\t\t\t//data grid\n\t\t\tthis.getStyleProviderForClass(DataGrid).defaultStyleFunction = this.setDataGridStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultDataGridHeaderRenderer).defaultStyleFunction = this.setDataGridHeaderRendererStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultDataGridCellRenderer).defaultStyleFunction = this.setItemRendererStyles;\n\n\t\t\t//date time spinner\n\t\t\tthis.getStyleProviderForClass(DateTimeSpinner).defaultStyleFunction = this.setDateTimeSpinnerStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).setFunctionForStyleName(THEME_STYLE_NAME_DATE_TIME_SPINNER_LIST_ITEM_RENDERER, this.setDateTimeSpinnerListItemRendererStyles);\n\n\t\t\t//drawers\n\t\t\tthis.getStyleProviderForClass(Drawers).defaultStyleFunction = this.setDrawersStyles;\n\n\t\t\t//grouped list (see also: item renderers)\n\t\t\tthis.getStyleProviderForClass(GroupedList).defaultStyleFunction = this.setGroupedListStyles;\n\t\t\tthis.getStyleProviderForClass(GroupedList).setFunctionForStyleName(GroupedList.ALTERNATE_STYLE_NAME_INSET_GROUPED_LIST, this.setInsetGroupedListStyles);\n\n\t\t\t//header\n\t\t\tthis.getStyleProviderForClass(Header).defaultStyleFunction = this.setHeaderStyles;\n\n\t\t\t//item renderers for lists\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).defaultStyleFunction = this.setItemRendererStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).setFunctionForStyleName(DefaultListItemRenderer.ALTERNATE_STYLE_NAME_DRILL_DOWN, this.setDrillDownItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).setFunctionForStyleName(DefaultListItemRenderer.ALTERNATE_STYLE_NAME_CHECK, this.setCheckItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListItemRenderer).defaultStyleFunction = this.setItemRendererStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListItemRenderer).setFunctionForStyleName(DefaultGroupedListItemRenderer.ALTERNATE_STYLE_NAME_DRILL_DOWN, this.setDrillDownItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListItemRenderer).setFunctionForStyleName(DefaultGroupedListItemRenderer.ALTERNATE_STYLE_NAME_CHECK, this.setCheckItemRendererStyles);\n\n\t\t\t//header and footer renderers for grouped list\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListHeaderOrFooterRenderer).defaultStyleFunction = this.setGroupedListHeaderOrFooterRendererStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListHeaderOrFooterRenderer).setFunctionForStyleName(GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_HEADER_RENDERER, this.setInsetGroupedListHeaderOrFooterRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListHeaderOrFooterRenderer).setFunctionForStyleName(GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_FOOTER_RENDERER, this.setInsetGroupedListHeaderOrFooterRendererStyles);\n\n\t\t\t//label\n\t\t\tthis.getStyleProviderForClass(Label).defaultStyleFunction = this.setLabelStyles;\n\t\t\tthis.getStyleProviderForClass(Label).setFunctionForStyleName(Label.ALTERNATE_STYLE_NAME_HEADING, this.setHeadingLabelStyles);\n\t\t\t//no detail label because the font size would be too small\n\t\t\tthis.getStyleProviderForClass(Label).setFunctionForStyleName(Label.ALTERNATE_STYLE_NAME_TOOL_TIP, this.setToolTipLabelStyles);\n\n\t\t\t//layout group\n\t\t\tthis.getStyleProviderForClass(LayoutGroup).setFunctionForStyleName(LayoutGroup.ALTERNATE_STYLE_NAME_TOOLBAR, this.setToolbarLayoutGroupStyles);\n\n\t\t\t//list (see also: item renderers)\n\t\t\tthis.getStyleProviderForClass(List).defaultStyleFunction = this.setListStyles;\n\n\t\t\t//numeric stepper\n\t\t\tthis.getStyleProviderForClass(NumericStepper).defaultStyleFunction = this.setNumericStepperStyles;\n\t\t\tthis.getStyleProviderForClass(TextInput).setFunctionForStyleName(NumericStepper.DEFAULT_CHILD_STYLE_NAME_TEXT_INPUT, this.setNumericStepperTextInputStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(NumericStepper.DEFAULT_CHILD_STYLE_NAME_DECREMENT_BUTTON, this.setNumericStepperButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(NumericStepper.DEFAULT_CHILD_STYLE_NAME_INCREMENT_BUTTON, this.setNumericStepperButtonStyles);\n\t\t\tthis.getStyleProviderForClass(BitmapFontTextEditor).setFunctionForStyleName(THEME_STYLE_NAME_NUMERIC_STEPPER_TEXT_INPUT_TEXT_EDITOR, this.setNumericStepperTextInputTextEditorStyles);\n\n\t\t\t//page indicator\n\t\t\tthis.getStyleProviderForClass(PageIndicator).defaultStyleFunction = this.setPageIndicatorStyles;\n\n\t\t\t//panel\n\t\t\tthis.getStyleProviderForClass(Panel).defaultStyleFunction = this.setPanelStyles;\n\t\t\tthis.getStyleProviderForClass(Header).setFunctionForStyleName(Panel.DEFAULT_CHILD_STYLE_NAME_HEADER, this.setPanelHeaderStyles);\n\n\t\t\t//panel screen\n\t\t\tthis.getStyleProviderForClass(PanelScreen).defaultStyleFunction = this.setPanelScreenStyles;\n\n\t\t\t//picker list (see also: item renderers)\n\t\t\tthis.getStyleProviderForClass(PickerList).defaultStyleFunction = this.setPickerListStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(PickerList.DEFAULT_CHILD_STYLE_NAME_BUTTON, this.setPickerListButtonStyles);\n\t\t\tthis.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(PickerList.DEFAULT_CHILD_STYLE_NAME_BUTTON, this.setPickerListButtonStyles);\n\t\t\tthis.getStyleProviderForClass(List).setFunctionForStyleName(PickerList.DEFAULT_CHILD_STYLE_NAME_LIST, this.setDropDownListStyles);\n\n\t\t\t//progress bar\n\t\t\tthis.getStyleProviderForClass(ProgressBar).defaultStyleFunction = this.setProgressBarStyles;\n\n\t\t\t//radio\n\t\t\tthis.getStyleProviderForClass(Radio).defaultStyleFunction = this.setRadioStyles;\n\n\t\t\t//scroll bar\n\t\t\tthis.getStyleProviderForClass(ScrollBar).setFunctionForStyleName(Scroller.DEFAULT_CHILD_STYLE_NAME_HORIZONTAL_SCROLL_BAR, this.setHorizontalScrollBarStyles);\n\t\t\tthis.getStyleProviderForClass(ScrollBar).setFunctionForStyleName(Scroller.DEFAULT_CHILD_STYLE_NAME_VERTICAL_SCROLL_BAR, this.setVerticalScrollBarStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(ScrollBar.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setScrollBarThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(ScrollBar.DEFAULT_CHILD_STYLE_NAME_MINIMUM_TRACK, this.setScrollBarMinimumTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_DECREMENT_BUTTON, this.setHorizontalScrollBarDecrementButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_INCREMENT_BUTTON, this.setHorizontalScrollBarIncrementButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_DECREMENT_BUTTON, this.setVerticalScrollBarDecrementButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_INCREMENT_BUTTON, this.setVerticalScrollBarIncrementButtonStyles);\n\n\t\t\t//scroll container\n\t\t\tthis.getStyleProviderForClass(ScrollContainer).defaultStyleFunction = this.setScrollContainerStyles;\n\t\t\tthis.getStyleProviderForClass(ScrollContainer).setFunctionForStyleName(ScrollContainer.ALTERNATE_STYLE_NAME_TOOLBAR, this.setToolbarScrollContainerStyles);\n\n\t\t\t//scroll screen\n\t\t\tthis.getStyleProviderForClass(ScrollScreen).defaultStyleFunction = this.setScrollScreenStyles;\n\n\t\t\t//scroll text\n\t\t\tthis.getStyleProviderForClass(ScrollText).defaultStyleFunction = this.setScrollTextStyles;\n\n\t\t\t//simple scroll bar\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(SimpleScrollBar.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setSimpleScrollBarThumbStyles);\n\n\t\t\t//slider\n\t\t\tthis.getStyleProviderForClass(Slider).defaultStyleFunction = this.setSliderStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Slider.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setSliderThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_HORIZONTAL_SLIDER_MINIMUM_TRACK, this.setHorizontalSliderMinimumTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_VERTICAL_SLIDER_MINIMUM_TRACK, this.setVerticalSliderMinimumTrackStyles);\n\n\t\t\t//spinner list\n\t\t\tthis.getStyleProviderForClass(SpinnerList).defaultStyleFunction = this.setSpinnerListStyles;\n\t\t\t\n\t\t\t//tab bar\n\t\t\tthis.getStyleProviderForClass(TabBar).defaultStyleFunction = this.setTabBarStyles;\n\t\t\tthis.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(TabBar.DEFAULT_CHILD_STYLE_NAME_TAB, this.setTabStyles);\n\n\t\t\t//text input\n\t\t\tthis.getStyleProviderForClass(TextInput).defaultStyleFunction = this.setTextInputStyles;\n\t\t\tthis.getStyleProviderForClass(TextInput).setFunctionForStyleName(TextInput.ALTERNATE_STYLE_NAME_SEARCH_TEXT_INPUT, this.setSearchTextInputStyles);\n\t\t\tthis.getStyleProviderForClass(BitmapFontTextEditor).setFunctionForStyleName(TextInput.DEFAULT_CHILD_STYLE_NAME_TEXT_EDITOR, this.setTextInputTextEditorStyles);\n\t\t\tthis.getStyleProviderForClass(TextCallout).setFunctionForStyleName(TextInput.DEFAULT_CHILD_STYLE_NAME_ERROR_CALLOUT, this.setTextInputErrorCalloutStyles);\n\n\t\t\t//text area\n\t\t\tthis.getStyleProviderForClass(TextArea).defaultStyleFunction = this.setTextAreaStyles;\n\t\t\tthis.getStyleProviderForClass(TextCallout).setFunctionForStyleName(TextArea.DEFAULT_CHILD_STYLE_NAME_ERROR_CALLOUT, this.setTextAreaErrorCalloutStyles);\n\n\t\t\t//text callout\n\t\t\tthis.getStyleProviderForClass(TextCallout).defaultStyleFunction = this.setTextCalloutStyles;\n\n\t\t\t//toast\n\t\t\tthis.getStyleProviderForClass(Toast).defaultStyleFunction = this.setToastStyles;\n\t\t\tthis.getStyleProviderForClass(ButtonGroup).setFunctionForStyleName(Toast.DEFAULT_CHILD_STYLE_NAME_ACTIONS, this.setToastActionsStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_TOAST_ACTIONS_BUTTON, this.setToastActionsButtonStyles);\n\n\t\t\t//toggle button\n\t\t\tthis.getStyleProviderForClass(ToggleButton).defaultStyleFunction = this.setButtonStyles;\n\t\t\tthis.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_QUIET_BUTTON, this.setQuietButtonStyles);\n\n\t\t\t//toggle switch\n\t\t\tthis.getStyleProviderForClass(ToggleSwitch).defaultStyleFunction = this.setToggleSwitchStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setToggleSwitchThumbStyles);\n\t\t\tthis.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setToggleSwitchThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_ON_TRACK, this.setToggleSwitchOnTrackStyles);\n\t\t\t\n\t\t\t//tree\n\t\t\tthis.getStyleProviderForClass(Tree).defaultStyleFunction = this.setTreeStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultTreeItemRenderer).defaultStyleFunction = this.setTreeItemRendererStyles;\n\n\t\t\t//media controls\n\t\t\tthis.getStyleProviderForClass(VideoPlayer).defaultStyleFunction = this.setVideoPlayerStyles;\n\n\t\t\t//play/pause toggle button\n\t\t\tthis.getStyleProviderForClass(PlayPauseToggleButton).defaultStyleFunction = this.setPlayPauseToggleButtonStyles;\n\t\t\tthis.getStyleProviderForClass(PlayPauseToggleButton).setFunctionForStyleName(PlayPauseToggleButton.ALTERNATE_STYLE_NAME_OVERLAY_PLAY_PAUSE_TOGGLE_BUTTON, this.setOverlayPlayPauseToggleButtonStyles);\n\n\t\t\t//full screen toggle button\n\t\t\tthis.getStyleProviderForClass(FullScreenToggleButton).defaultStyleFunction = this.setFullScreenToggleButtonStyles;\n\n\t\t\t//mute toggle button\n\t\t\tthis.getStyleProviderForClass(MuteToggleButton).defaultStyleFunction = this.setMuteToggleButtonStyles;\n\t\t\tthis.getStyleProviderForClass(VolumeSlider).setFunctionForStyleName(MuteToggleButton.DEFAULT_CHILD_STYLE_NAME_VOLUME_SLIDER, this.setPopUpVolumeSliderStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_POP_UP_VOLUME_SLIDER_THUMB, this.setSliderThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_POP_UP_VOLUME_SLIDER_MINIMUM_TRACK, this.setPopUpVolumeSliderTrackStyles);\n\n\t\t\t//seek slider\n\t\t\tthis.getStyleProviderForClass(SeekSlider).defaultStyleFunction = this.setSeekSliderStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(SeekSlider.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setSliderThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(SeekSlider.DEFAULT_CHILD_STYLE_NAME_MINIMUM_TRACK, this.setHorizontalSliderMinimumTrackStyles);\n\n\t\t\t//volume slider\n\t\t\tthis.getStyleProviderForClass(VolumeSlider).defaultStyleFunction = this.setVolumeSliderStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(VolumeSlider.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setVolumeSliderThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(VolumeSlider.DEFAULT_CHILD_STYLE_NAME_MINIMUM_TRACK, this.setVolumeSliderMinimumTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(VolumeSlider.DEFAULT_CHILD_STYLE_NAME_MAXIMUM_TRACK, this.setVolumeSliderMaximumTrackStyles);\n\t\t}\n\n\t\tprotected function pageIndicatorNormalSymbolFactory():DisplayObject\n\t\t{\n\t\t\treturn new Image(this.pageIndicatorSymbolTexture);\n\t\t}\n\n\t\tprotected function pageIndicatorSelectedSymbolFactory():DisplayObject\n\t\t{\n\t\t\treturn new Image(this.pageIndicatorSelectedSymbolTexture);\n\t\t}\n\n\t\tprotected function dataGridHeaderDividerFactory():DisplayObject\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.dataGridHeaderDividerSkinTexture);\n\t\t\tskin.scale9Grid = DATA_GRID_HEADER_DIVIDER_SCALE_9_GRID;\n\t\t\treturn skin;\n\t\t}\n\n\t\tprotected function toastContainerFactory():DisplayObjectContainer\n\t\t{\n\t\t\tvar container:LayoutGroup = new LayoutGroup();\n\t\t\tcontainer.autoSizeMode = AutoSizeMode.STAGE;\n\n\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\tlayout.verticalAlign = VerticalAlign.BOTTOM;\n\t\t\tlayout.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tlayout.padding = this.gutterSize;\n\t\t\tlayout.gap = this.gutterSize;\n\t\t\tcontainer.layout = layout;\n\n\t\t\treturn container;\n\t\t}\n\n\t//-------------------------\n\t// Shared\n\t//-------------------------\n\n\t\tprotected function setScrollerStyles(scroller:Scroller):void\n\t\t{\n\t\t\tscroller.interactionMode = ScrollInteractionMode.MOUSE;\n\t\t\tscroller.scrollBarDisplayMode = ScrollBarDisplayMode.FIXED;\n\t\t\tscroller.horizontalScrollBarFactory = scrollBarFactory;\n\t\t\tscroller.verticalScrollBarFactory = scrollBarFactory;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tscroller.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tscroller.focusPadding = 0;\n\t\t}\n\n\t\tprotected function setDropDownListStyles(list:List):void\n\t\t{\n\t\t\tthis.setListStyles(list);\n\n\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\tlayout.useVirtualLayout = true;\n\t\t\tlayout.padding = 0;\n\t\t\tlayout.gap = 0;\n\t\t\tlayout.horizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\tlayout.verticalAlign = VerticalAlign.TOP;\n\t\t\tlayout.resetTypicalItemDimensionsOnMeasure = true;\n\t\t\tlayout.maxRowCount = 5;\n\t\t\tlist.layout = layout;\n\t\t}\n\n\t//-------------------------\n\t// Alert\n\t//-------------------------\n\n\t\tprotected function setAlertStyles(alert:Alert):void\n\t\t{\n\t\t\tthis.setScrollerStyles(alert);\n\n\t\t\tvar backgroundSkin:Image = new Image(this.popUpBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tbackgroundSkin.width = this.controlSize;\n\t\t\tbackgroundSkin.height = this.controlSize;\n\t\t\talert.backgroundSkin = backgroundSkin;\n\n\t\t\talert.fontStyles = this.primaryFontStyles.clone();\n\t\t\talert.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\talert.paddingTop = this.gutterSize;\n\t\t\talert.paddingRight = this.gutterSize;\n\t\t\talert.paddingBottom = this.smallGutterSize;\n\t\t\talert.paddingLeft = this.gutterSize;\n\t\t\talert.outerPadding = this.borderSize;\n\t\t\talert.outerPaddingBottom = this.borderSize + this.dropShadowSize;\n\t\t\talert.outerPaddingRight = this.borderSize + this.dropShadowSize;\n\t\t\talert.gap = this.smallGutterSize;\n\t\t\talert.maxWidth = this.popUpSize;\n\t\t\talert.maxHeight = this.popUpSize;\n\t\t}\n\n\t\tprotected function setAlertButtonGroupStyles(group:ButtonGroup):void\n\t\t{\n\t\t\tgroup.customButtonStyleName = THEME_STYLE_NAME_ALERT_BUTTON_GROUP_BUTTON;\n\t\t\tgroup.direction = Direction.HORIZONTAL;\n\t\t\tgroup.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tgroup.verticalAlign = VerticalAlign.JUSTIFY;\n\t\t\tgroup.distributeButtonSizes = false;\n\t\t\tgroup.gap = this.smallGutterSize;\n\t\t\tgroup.padding = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setAlertButtonGroupButtonStyles(button:Button):void\n\t\t{\n\t\t\tthis.setButtonStyles(button);\n\t\t}\n\n\t//-------------------------\n\t// Button\n\t//-------------------------\n\n\t\tprotected function setBaseButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tbutton.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tbutton.focusPadding = this.focusPaddingSize;\n\n\t\t\tbutton.paddingTop = this.smallGutterSize;\n\t\t\tbutton.paddingBottom = this.smallGutterSize;\n\t\t\tbutton.paddingLeft = this.gutterSize;\n\t\t\tbutton.paddingRight = this.gutterSize;\n\t\t\tbutton.gap = this.smallGutterSize;\n\t\t\tbutton.minGap = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);\n\t\t\tif(button is ToggleButton)\n\t\t\t{\n\t\t\t\t//for convenience, this function can style both a regular button\n\t\t\t\t//and a toggle button\n\t\t\t\tskin.selectedTexture = this.buttonSelectedSkinTexture;\n\t\t\t\tskin.setTextureForState(ButtonState.DOWN_AND_SELECTED,  this.buttonDownSkinTexture);\n\t\t\t\tskin.setTextureForState(ButtonState.DISABLED_AND_SELECTED,  this.buttonSelectedDisabledSkinTexture);\n\t\t\t}\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.buttonMinWidth;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.fontStyles = this.primaryFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\t\t}\n\n\t\tprotected function setCallToActionButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonCallToActionUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.width = this.buttonMinWidth;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.buttonMinWidth;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.fontStyles = this.primaryFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\t\t}\n\n\t\tprotected function setQuietButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar defaultSkin:Quad = new Quad(this.controlSize, this.controlSize, 0xff00ff);\n\t\t\tdefaultSkin.alpha = 0;\n\t\t\tbutton.defaultSkin = defaultSkin;\n\n\t\t\tvar otherSkin:ImageSkin = new ImageSkin(null);\n\t\t\totherSkin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\tif(button is ToggleButton)\n\t\t\t{\n\t\t\t\t//for convenience, this function can style both a regular button\n\t\t\t\t//and a toggle button\n\t\t\t\totherSkin.selectedTexture = this.buttonSelectedSkinTexture;\n\t\t\t\totherSkin.setTextureForState(ButtonState.DOWN_AND_SELECTED,  this.buttonDownSkinTexture);\n\t\t\t\totherSkin.setTextureForState(ButtonState.DISABLED_AND_SELECTED,  this.buttonSelectedDisabledSkinTexture);\n\t\t\t\tToggleButton(button).defaultSelectedSkin = otherSkin;\n\t\t\t\tbutton.setSkinForState(ButtonState.DOWN_AND_SELECTED, otherSkin);\n\t\t\t\tbutton.setSkinForState(ButtonState.DISABLED_AND_SELECTED, otherSkin);\n\t\t\t}\n\t\t\tbutton.setSkinForState(ButtonState.DOWN, otherSkin);\n\t\t\totherSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\totherSkin.width = this.controlSize;\n\t\t\totherSkin.height = this.controlSize;\n\t\t\totherSkin.minWidth = this.controlSize;\n\t\t\totherSkin.minHeight = this.controlSize;\n\n\t\t\tbutton.fontStyles = this.primaryFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\t\t}\n\n\t\tprotected function setDangerButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonDangerUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDangerDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.width = this.buttonMinWidth;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.buttonMinWidth;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.fontStyles = this.dangerFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\t\t}\n\n\t\tprotected function setBackButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonBackUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonBackDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonBackDisabledSkinTexture);\n\t\t\tskin.scale9Grid = BACK_BUTTON_SCALE_9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tskin.textureSmoothing = TextureSmoothing.NONE;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.fontStyles = this.primaryFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\n\t\t\tbutton.paddingLeft = 2 * this.gutterSize;\n\t\t}\n\n\t\tprotected function setForwardButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonForwardUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonForwardDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonForwardDisabledSkinTexture);\n\t\t\tskin.scale9Grid = FORWARD_BUTTON_SCALE_9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tskin.textureSmoothing = TextureSmoothing.NONE;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.fontStyles = this.primaryFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\n\t\t\tbutton.paddingRight = 2 * this.gutterSize;\n\t\t}\n\n\t//-------------------------\n\t// ButtonGroup\n\t//-------------------------\n\n\t\tprotected function setButtonGroupStyles(group:ButtonGroup):void\n\t\t{\n\t\t\tgroup.gap = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setButtonGroupButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);\n\t\t\tif(button is ToggleButton)\n\t\t\t{\n\t\t\t\t//for convenience, this function can style both a regular button\n\t\t\t\t//and a toggle button\n\t\t\t\tskin.selectedTexture = this.buttonSelectedSkinTexture;\n\t\t\t\tskin.setTextureForState(ButtonState.DOWN_AND_SELECTED,  this.buttonDownSkinTexture);\n\t\t\t\tskin.setTextureForState(ButtonState.DISABLED_AND_SELECTED,  this.buttonSelectedDisabledSkinTexture);\n\t\t\t}\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.width = this.wideControlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.wideControlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tbutton.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tbutton.focusPadding = this.focusPaddingSize;\n\n\t\t\tbutton.fontStyles = this.primaryFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tbutton.paddingTop = this.smallGutterSize;\n\t\t\tbutton.paddingBottom = this.smallGutterSize;\n\t\t\tbutton.paddingLeft = this.gutterSize;\n\t\t\tbutton.paddingRight = this.gutterSize;\n\t\t\tbutton.gap = this.smallGutterSize;\n\t\t\tbutton.minGap = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// Callout\n\t//-------------------------\n\n\t\tprotected function setCalloutStyles(callout:Callout):void\n\t\t{\n\t\t\tcallout.padding = this.gutterSize;\n\t\t\tcallout.paddingRight = this.gutterSize + this.dropShadowSize;\n\t\t\tcallout.paddingBottom = this.gutterSize + this.dropShadowSize;\n\n\t\t\tvar backgroundSkin:Image = new Image(this.popUpBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tbackgroundSkin.width = this.calloutBackgroundMinSize;\n\t\t\tbackgroundSkin.height = this.calloutBackgroundMinSize;\n\t\t\tcallout.backgroundSkin = backgroundSkin;\n\n\t\t\tvar topArrowSkin:Image = new Image(this.calloutTopArrowSkinTexture);\n\t\t\tcallout.topArrowSkin = topArrowSkin;\n\t\t\tcallout.topArrowGap = this.calloutTopLeftArrowOverlapGapSize;\n\n\t\t\tvar bottomArrowSkin:Image = new Image(this.calloutBottomArrowSkinTexture);\n\t\t\tcallout.bottomArrowSkin = bottomArrowSkin;\n\t\t\tcallout.bottomArrowGap = this.calloutBottomRightArrowOverlapGapSize;\n\n\t\t\tvar leftArrowSkin:Image = new Image(this.calloutLeftArrowSkinTexture);\n\t\t\tcallout.leftArrowSkin = leftArrowSkin;\n\t\t\tcallout.leftArrowGap = this.calloutTopLeftArrowOverlapGapSize;\n\n\t\t\tvar rightArrowSkin:Image = new Image(this.calloutRightArrowSkinTexture);\n\t\t\tcallout.rightArrowSkin = rightArrowSkin;\n\t\t\tcallout.rightArrowGap = this.calloutBottomRightArrowOverlapGapSize;\n\t\t}\n\n\t\tprotected function setDangerCalloutStyles(callout:Callout):void\n\t\t{\n\t\t\tcallout.padding = this.gutterSize;\n\t\t\tcallout.paddingRight = this.gutterSize + this.dropShadowSize;\n\t\t\tcallout.paddingBottom = this.gutterSize + this.dropShadowSize;\n\n\t\t\tvar backgroundSkin:Image = new Image(this.dangerPopUpBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tbackgroundSkin.width = this.calloutBackgroundMinSize;\n\t\t\tbackgroundSkin.height = this.calloutBackgroundMinSize;\n\t\t\tcallout.backgroundSkin = backgroundSkin;\n\n\t\t\tvar topArrowSkin:Image = new Image(this.dangerCalloutTopArrowSkinTexture);\n\t\t\tcallout.topArrowSkin = topArrowSkin;\n\t\t\tcallout.topArrowGap = this.calloutTopLeftArrowOverlapGapSize;\n\n\t\t\tvar bottomArrowSkin:Image = new Image(this.dangerCalloutBottomArrowSkinTexture);\n\t\t\tcallout.bottomArrowSkin = bottomArrowSkin;\n\t\t\tcallout.bottomArrowGap = this.calloutBottomRightArrowOverlapGapSize;\n\n\t\t\tvar leftArrowSkin:Image = new Image(this.dangerCalloutLeftArrowSkinTexture);\n\t\t\tcallout.leftArrowSkin = leftArrowSkin;\n\t\t\tcallout.leftArrowGap = this.calloutTopLeftArrowOverlapGapSize;\n\n\t\t\tvar rightArrowSkin:Image = new Image(this.dangerCalloutRightArrowSkinTexture);\n\t\t\tcallout.rightArrowSkin = rightArrowSkin;\n\t\t\tcallout.rightArrowGap = this.calloutBottomRightArrowOverlapGapSize;\n\t\t}\n\n\t//-------------------------\n\t// Check\n\t//-------------------------\n\n\t\tprotected function setCheckStyles(check:Check):void\n\t\t{\n\t\t\tvar skin:Quad = new Quad(this.controlSize, this.controlSize);\n\t\t\tskin.alpha = 0;\n\t\t\tcheck.defaultSkin = skin;\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.checkIconTexture);\n\t\t\ticon.selectedTexture = this.checkSelectedIconTexture;\n\t\t\ticon.setTextureForState(ButtonState.DISABLED, this.checkDisabledIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DISABLED_AND_SELECTED,  this.checkSelectedDisabledIconTexture);\n\t\t\ticon.textureSmoothing = TextureSmoothing.NONE;\n\t\t\tcheck.defaultIcon = icon;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tcheck.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tcheck.focusPaddingLeft = this.focusPaddingSize;\n\t\t\tcheck.focusPaddingRight = this.focusPaddingSize;\n\n\t\t\tcheck.fontStyles = this.primaryFontStyles.clone();\n\t\t\tcheck.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tcheck.gap = this.smallGutterSize;\n\t\t\tcheck.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tcheck.verticalAlign = VerticalAlign.MIDDLE;\n\t\t}\n\n\t//-------------------------\n\t// DataGrid\n\t//-------------------------\n\n\t\tprotected function setDataGridStyles(grid:DataGrid):void\n\t\t{\n\t\t\tthis.setScrollerStyles(grid);\n\n\t\t\tgrid.verticalScrollPolicy = ScrollPolicy.AUTO;\n\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.listBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tbackgroundSkin.width = this.controlSize;\n\t\t\tbackgroundSkin.height = this.controlSize;\n\t\t\tgrid.backgroundSkin = backgroundSkin;\n\n\t\t\tvar backgroundDisabledSkin:ImageSkin = new ImageSkin(this.buttonDisabledSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tbackgroundDisabledSkin.width = this.controlSize;\n\t\t\tbackgroundDisabledSkin.height = this.controlSize;\n\t\t\tgrid.backgroundDisabledSkin = backgroundDisabledSkin;\n\n\t\t\tvar columnDragOverlaySkin:Quad = new Quad(1, 1, DATA_GRID_COLUMN_OVERLAY_COLOR);\n\t\t\tcolumnDragOverlaySkin.alpha = DATA_GRID_COLUMN_OVERLAY_ALPHA;\n\t\t\tgrid.columnDragOverlaySkin = columnDragOverlaySkin;\n\n\t\t\tvar columnResizeSkin:ImageSkin = new ImageSkin(this.dataGridColumnResizeSkinTexture);\n\t\t\tcolumnResizeSkin.scale9Grid = DATA_GRID_COLUMN_RESIZE_SKIN_SCALE_9_GRID;\n\t\t\tgrid.columnResizeSkin = columnResizeSkin;\n\n\t\t\tvar columnDropIndicatorSkin:ImageSkin = new ImageSkin(this.dataGridColumnDropIndicatorSkinTexture);\n\t\t\tcolumnDropIndicatorSkin.scale9Grid = DATA_GRID_COLUMN_DROP_INDICATOR_SCALE_9_GRID;\n\t\t\tgrid.columnDropIndicatorSkin = columnDropIndicatorSkin;\n\n\t\t\tgrid.headerDividerFactory = this.dataGridHeaderDividerFactory;\n\n\t\t\tgrid.padding = this.borderSize;\n\t\t\tgrid.paddingRight = 0;\n\t\t}\n\n\t\tprotected function setDataGridHeaderRendererStyles(headerRenderer:DefaultDataGridHeaderRenderer):void\n\t\t{\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.dataGridHeaderRendererSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = DATA_GRID_HEADER_RENDERER_SCALE_9_GRID;\n\t\t\tbackgroundSkin.width = this.controlSize;\n\t\t\tbackgroundSkin.height = this.controlSize;\n\t\t\tbackgroundSkin.minWidth = this.controlSize;\n\t\t\tbackgroundSkin.minHeight = this.controlSize;\n\t\t\theaderRenderer.backgroundSkin = backgroundSkin;\n\n\t\t\theaderRenderer.sortAscendingIcon = new ImageSkin(this.dataGridHeaderSortAscendingIconTexture);\n\t\t\theaderRenderer.sortDescendingIcon = new ImageSkin(this.dataGridHeaderSortDescendingIconTexture);\n\n\t\t\theaderRenderer.fontStyles = this.primaryFontStyles.clone();\n\t\t\theaderRenderer.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\theaderRenderer.paddingTop = this.smallGutterSize;\n\t\t\theaderRenderer.paddingBottom = this.smallGutterSize;\n\t\t\theaderRenderer.paddingLeft = this.gutterSize;\n\t\t\theaderRenderer.paddingRight = this.gutterSize;\n\t\t}\n\n\t//-------------------------\n\t// DateTimeSpinner\n\t//-------------------------\n\n\t\tprotected function setDateTimeSpinnerStyles(spinner:DateTimeSpinner):void\n\t\t{\n\t\t\tspinner.customItemRendererStyleName = THEME_STYLE_NAME_DATE_TIME_SPINNER_LIST_ITEM_RENDERER;\n\t\t}\n\n\t\tprotected function setDateTimeSpinnerListItemRendererStyles(itemRenderer:DefaultListItemRenderer):void\n\t\t{\n\t\t\tthis.setItemRendererStyles(itemRenderer);\n\t\t\titemRenderer.accessoryPosition = RelativePosition.LEFT;\n\t\t\titemRenderer.accessoryGap = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// Drawers\n\t//-------------------------\n\n\t\tprotected function setDrawersStyles(drawers:Drawers):void\n\t\t{\n\t\t\tvar overlaySkin:Quad = new Quad(10, 10, MODAL_OVERLAY_COLOR);\n\t\t\toverlaySkin.alpha = MODAL_OVERLAY_ALPHA;\n\t\t\tdrawers.overlaySkin = overlaySkin;\n\t\t}\n\n\t//-------------------------\n\t// GroupedList\n\t//-------------------------\n\n\t\tprotected function setGroupedListStyles(list:GroupedList):void\n\t\t{\n\t\t\tthis.setScrollerStyles(list);\n\n\t\t\tlist.verticalScrollPolicy = ScrollPolicy.AUTO;\n\n\t\t\tvar backgroundSkin:Image = new Image(this.listBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tbackgroundSkin.width = this.gridSize;\n\t\t\tbackgroundSkin.height = this.gridSize;\n\t\t\tlist.backgroundSkin = backgroundSkin;\n\n\t\t\tvar backgroundDisabledSkin:Image = new Image(this.buttonDisabledSkinTexture);\n\t\t\tbackgroundDisabledSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tbackgroundDisabledSkin.width = this.gridSize;\n\t\t\tbackgroundDisabledSkin.height = this.gridSize;\n\t\t\tlist.backgroundDisabledSkin = backgroundDisabledSkin;\n\n\t\t\tlist.padding = this.borderSize;\n\t\t}\n\n\t\t//see List section for item renderer styles\n\n\t\tprotected function setGroupedListHeaderOrFooterRendererStyles(renderer:DefaultGroupedListHeaderOrFooterRenderer):void\n\t\t{\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.headerRendererSkinTexture);\n\t\t\tbackgroundSkin.width = this.controlSize;\n\t\t\tbackgroundSkin.height = this.controlSize;\n\t\t\tbackgroundSkin.minWidth = this.controlSize;\n\t\t\tbackgroundSkin.minHeight = this.controlSize;\n\t\t\trenderer.backgroundSkin = backgroundSkin;\n\n\t\t\trenderer.fontStyles = this.primaryFontStyles.clone();\n\t\t\trenderer.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\trenderer.paddingTop = this.smallGutterSize;\n\t\t\trenderer.paddingBottom = this.smallGutterSize;\n\t\t\trenderer.paddingLeft = this.gutterSize;\n\t\t\trenderer.paddingRight = this.gutterSize;\n\t\t}\n\n\t\tprotected function setInsetGroupedListStyles(list:GroupedList):void\n\t\t{\n\t\t\tthis.setScrollerStyles(list);\n\n\t\t\tvar backgroundSkin:Image = new Image(this.listInsetBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tbackgroundSkin.width = this.gridSize;\n\t\t\tbackgroundSkin.height = this.gridSize;\n\t\t\tlist.backgroundSkin = backgroundSkin;\n\n\t\t\tvar backgroundDisabledSkin:Image = new Image(this.buttonDisabledSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tbackgroundDisabledSkin.width = this.gridSize;\n\t\t\tbackgroundDisabledSkin.height = this.gridSize;\n\t\t\tlist.backgroundDisabledSkin = backgroundDisabledSkin;\n\n\t\t\tlist.verticalScrollPolicy = ScrollPolicy.AUTO;\n\n\t\t\tlist.customHeaderRendererStyleName = GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_HEADER_RENDERER;\n\t\t\tlist.customFooterRendererStyleName = GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_FOOTER_RENDERER;\n\n\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\tlayout.useVirtualLayout = true;\n\t\t\tlayout.padding = this.gutterSize;\n\t\t\tlayout.paddingTop = 0;\n\t\t\tlayout.gap = 0;\n\t\t\tlayout.horizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\tlayout.verticalAlign = VerticalAlign.TOP;\n\t\t\tlist.layout = layout;\n\t\t}\n\n\t\tprotected function setInsetGroupedListHeaderOrFooterRendererStyles(renderer:DefaultGroupedListHeaderOrFooterRenderer):void\n\t\t{\n\t\t\tvar skin:Quad = new Quad(this.controlSize, this.controlSize);\n\t\t\tskin.alpha = 0;\n\t\t\trenderer.backgroundSkin = skin;\n\n\t\t\trenderer.fontStyles = this.primaryFontStyles.clone();\n\t\t\trenderer.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\trenderer.paddingTop = this.smallGutterSize;\n\t\t\trenderer.paddingBottom = this.smallGutterSize;\n\t\t\trenderer.paddingLeft = this.gutterSize;\n\t\t\trenderer.paddingRight = this.gutterSize;\n\t\t}\n\n\t//-------------------------\n\t// Header\n\t//-------------------------\n\n\t\tprotected function setHeaderStyles(header:Header):void\n\t\t{\n\t\t\theader.paddingTop = this.smallGutterSize;\n\t\t\theader.paddingBottom = this.smallGutterSize;\n\t\t\theader.paddingRight = this.gutterSize;\n\t\t\theader.paddingLeft = this.gutterSize;\n\t\t\theader.gap = this.smallGutterSize;\n\t\t\theader.titleGap = this.smallGutterSize;\n\n\t\t\theader.fontStyles = this.primaryFontStyles.clone();\n\t\t\theader.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.headerSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = HEADER_SCALE_9_GRID;\n\t\t\tbackgroundSkin.width = this.gridSize;\n\t\t\tbackgroundSkin.height = this.gridSize;\n\t\t\tbackgroundSkin.minWidth = this.gridSize;\n\t\t\tbackgroundSkin.minHeight = this.gridSize;\n\t\t\theader.backgroundSkin = backgroundSkin;\n\t\t}\n\n\t//-------------------------\n\t// Label\n\t//-------------------------\n\n\t\tprotected function setLabelStyles(label:Label):void\n\t\t{\n\t\t\tlabel.fontStyles = this.primaryFontStyles.clone();\n\t\t\tlabel.disabledFontStyles = this.disabledFontStyles.clone();\n\t\t}\n\n\t\tprotected function setHeadingLabelStyles(label:Label):void\n\t\t{\n\t\t\tlabel.fontStyles = this.headingFontStyles.clone();\n\t\t\tlabel.disabledFontStyles = this.headingDisabledFontStyles.clone();\n\t\t}\n\n\t\tprotected function setToolTipLabelStyles(label:Label):void\n\t\t{\n\t\t\tvar backgroundSkin:Image = new Image(this.popUpBackgroundSkinTexture)\n\t\t\tbackgroundSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tlabel.backgroundSkin = backgroundSkin;\n\n\t\t\tlabel.fontStyles = this.primaryFontStyles.clone();\n\t\t\tlabel.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tlabel.padding = this.smallGutterSize;\n\t\t\tlabel.paddingBottom = this.smallGutterSize + this.dropShadowSize;\n\t\t\tlabel.paddingRight = this.smallGutterSize + this.dropShadowSize;\n\t\t}\n\n\t//-------------------------\n\t// LayoutGroup\n\t//-------------------------\n\n\t\tprotected function setToolbarLayoutGroupStyles(group:LayoutGroup):void\n\t\t{\n\t\t\tif(!group.layout)\n\t\t\t{\n\t\t\t\tvar layout:HorizontalLayout = new HorizontalLayout();\n\t\t\t\tlayout.padding = this.gutterSize;\n\t\t\t\tlayout.gap = this.smallGutterSize;\n\t\t\t\tlayout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\t\tgroup.layout = layout;\n\t\t\t}\n\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.headerSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = HEADER_SCALE_9_GRID;\n\t\t\tbackgroundSkin.width = this.gridSize;\n\t\t\tbackgroundSkin.height = this.gridSize;\n\t\t\tbackgroundSkin.minWidth = this.gridSize;\n\t\t\tbackgroundSkin.minHeight = this.gridSize;\n\t\t\tgroup.backgroundSkin = backgroundSkin;\n\t\t}\n\n\t//-------------------------\n\t// List\n\t//-------------------------\n\n\t\tprotected function setListStyles(list:List):void\n\t\t{\n\t\t\tthis.setScrollerStyles(list);\n\n\t\t\tlist.verticalScrollPolicy = ScrollPolicy.AUTO;\n\n\t\t\tvar backgroundSkin:Image = new Image(this.listBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tbackgroundSkin.width = this.controlSize;\n\t\t\tbackgroundSkin.height = this.controlSize;\n\t\t\tlist.backgroundSkin = backgroundSkin;\n\n\t\t\tvar backgroundDisabledSkin:Image = new Image(this.buttonDisabledSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tbackgroundDisabledSkin.width = this.controlSize;\n\t\t\tbackgroundDisabledSkin.height = this.controlSize;\n\t\t\tlist.backgroundDisabledSkin = backgroundDisabledSkin;\n\n\t\t\tvar dropIndicatorSkin:Quad = new Quad(this.borderSize, this.borderSize, PRIMARY_TEXT_COLOR);\n\t\t\tlist.dropIndicatorSkin = dropIndicatorSkin;\n\n\t\t\tlist.padding = this.borderSize;\n\t\t\tlist.paddingRight = 0;\n\t\t}\n\n\t\tprotected function setItemRendererStyles(itemRenderer:BaseDefaultItemRenderer):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.itemRendererUpSkinTexture);\n\t\t\tskin.selectedTexture = this.itemRendererSelectedSkinTexture;\n\t\t\tskin.setTextureForState(ButtonState.HOVER, this.itemRendererHoverSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.itemRendererSelectedSkinTexture);\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\titemRenderer.defaultSkin = skin;\n\n\t\t\titemRenderer.fontStyles = this.primaryFontStyles.clone();\n\t\t\titemRenderer.disabledFontStyles = this.disabledFontStyles.clone();\n\t\t\titemRenderer.iconLabelFontStyles = this.primaryFontStyles.clone();\n\t\t\titemRenderer.iconLabelDisabledFontStyles = this.disabledFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelFontStyles = this.primaryFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelDisabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\titemRenderer.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\titemRenderer.paddingTop = this.smallGutterSize;\n\t\t\titemRenderer.paddingBottom = this.smallGutterSize;\n\t\t\titemRenderer.paddingLeft = this.gutterSize;\n\t\t\titemRenderer.paddingRight = this.gutterSize;\n\t\t\titemRenderer.gap = this.smallGutterSize;\n\t\t\titemRenderer.minGap = this.smallGutterSize;\n\t\t\titemRenderer.iconPosition = RelativePosition.LEFT;\n\t\t\titemRenderer.accessoryGap = Number.POSITIVE_INFINITY;\n\t\t\titemRenderer.minAccessoryGap = this.smallGutterSize;\n\t\t\titemRenderer.accessoryPosition = RelativePosition.RIGHT;\n\n\t\t\titemRenderer.useStateDelayTimer = false;\n\t\t}\n\n\t\tprotected function setDrillDownItemRendererStyles(itemRenderer:BaseDefaultItemRenderer):void\n\t\t{\n\t\t\tthis.setItemRendererStyles(itemRenderer);\n\n\t\t\titemRenderer.itemHasAccessory = false;\n\t\t\tvar defaultAccessory:ImageLoader = new ImageLoader();\n\t\t\tdefaultAccessory.source = this.listDrillDownAccessoryTexture;\n\t\t\titemRenderer.defaultAccessory = defaultAccessory;\n\t\t}\n\n\t\tprotected function setCheckItemRendererStyles(itemRenderer:BaseDefaultItemRenderer):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.itemRendererUpSkinTexture);\n\t\t\tskin.selectedTexture = this.itemRendererSelectedSkinTexture;\n\t\t\tskin.setTextureForState(ButtonState.HOVER, this.itemRendererHoverSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.itemRendererSelectedSkinTexture);\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\titemRenderer.defaultSkin = skin;\n\n\t\t\titemRenderer.itemHasIcon = false;\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.checkIconTexture);\n\t\t\ticon.selectedTexture = this.checkSelectedIconTexture;\n\t\t\titemRenderer.defaultIcon = icon;\n\n\t\t\titemRenderer.fontStyles = this.primaryFontStyles.clone();\n\t\t\titemRenderer.disabledFontStyles = this.disabledFontStyles.clone();\n\t\t\titemRenderer.iconLabelFontStyles = this.primaryFontStyles.clone();\n\t\t\titemRenderer.iconLabelDisabledFontStyles = this.disabledFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelFontStyles = this.primaryFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelDisabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\titemRenderer.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\titemRenderer.paddingTop = this.smallGutterSize;\n\t\t\titemRenderer.paddingBottom = this.smallGutterSize;\n\t\t\titemRenderer.paddingLeft = this.gutterSize;\n\t\t\titemRenderer.paddingRight = this.gutterSize;\n\t\t\titemRenderer.gap = this.smallGutterSize;\n\t\t\titemRenderer.minGap = this.smallGutterSize;\n\t\t\titemRenderer.iconPosition = RelativePosition.LEFT;\n\t\t\titemRenderer.accessoryGap = Number.POSITIVE_INFINITY;\n\t\t\titemRenderer.minAccessoryGap = this.smallGutterSize;\n\t\t\titemRenderer.accessoryPosition = RelativePosition.RIGHT;\n\n\t\t\titemRenderer.useStateDelayTimer = false;\n\t\t}\n\n\t//-------------------------\n\t// NumericStepper\n\t//-------------------------\n\n\t\tprotected function setNumericStepperStyles(stepper:NumericStepper):void\n\t\t{\n\t\t\tstepper.buttonLayoutMode = StepperButtonLayoutMode.SPLIT_HORIZONTAL;\n\t\t\tstepper.incrementButtonLabel = \"+\";\n\t\t\tstepper.decrementButtonLabel = \"-\";\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tstepper.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tstepper.focusPadding = this.focusPaddingSize;\n\t\t}\n\n\t\tprotected function setNumericStepperButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\t\t\tbutton.keepDownStateOnRollOut = true;\n\t\t\tthis.setBaseButtonStyles(button);\n\t\t}\n\n\t\tprotected function setNumericStepperTextInputStyles(input:TextInput):void\n\t\t{\n\t\t\tinput.gap = this.smallGutterSize;\n\t\t\tinput.paddingTop = this.smallGutterSize;\n\t\t\tinput.paddingBottom = this.smallGutterSize;\n\t\t\tinput.paddingLeft = this.gutterSize;\n\t\t\tinput.paddingRight = this.gutterSize;\n\n\t\t\tinput.fontStyles = this.centeredFontStyles.clone();\n\t\t\tinput.disabledFontStyles = this.centeredDisabledFontStyles.clone();\n\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.insetBackgroundSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.DISABLED, this.insetBackgroundDisabledSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.FOCUSED, this.insetBackgroundFocusedSkinTexture);\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.width = this.gridSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.gridSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tinput.backgroundSkin = skin;\n\t\t}\n\n\t\tprotected function setNumericStepperTextInputTextEditorStyles(textEditor:BitmapFontTextEditor):void\n\t\t{\n\t\t\ttextEditor.cursorSkin = new Quad(1, 1, PRIMARY_TEXT_COLOR);\n\t\t\ttextEditor.selectionSkin = new Quad(1, 1, BACKGROUND_COLOR);\n\t\t}\n\n\t//-------------------------\n\t// PageIndicator\n\t//-------------------------\n\n\t\tprotected function setPageIndicatorStyles(pageIndicator:PageIndicator):void\n\t\t{\n\t\t\tpageIndicator.interactionMode = PageIndicatorInteractionMode.PRECISE;\n\n\t\t\tpageIndicator.normalSymbolFactory = this.pageIndicatorNormalSymbolFactory;\n\t\t\tpageIndicator.selectedSymbolFactory = this.pageIndicatorSelectedSymbolFactory;\n\n\t\t\tpageIndicator.gap = this.gutterSize;\n\t\t\tpageIndicator.padding = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// Panel\n\t//-------------------------\n\n\t\tprotected function setPanelStyles(panel:Panel):void\n\t\t{\n\t\t\tthis.setScrollerStyles(panel);\n\n\t\t\tvar backgroundSkin:Image = new Image(this.panelBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tbackgroundSkin.width = this.controlSize;\n\t\t\tbackgroundSkin.height = this.controlSize;\n\t\t\tpanel.backgroundSkin = backgroundSkin;\n\n\t\t\tpanel.padding = this.gutterSize;\n\t\t}\n\n\t\tprotected function setPanelHeaderStyles(header:Header):void\n\t\t{\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.panelHeaderSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = HEADER_SCALE_9_GRID;\n\t\t\tbackgroundSkin.width = this.gridSize;\n\t\t\tbackgroundSkin.height = this.gridSize;\n\t\t\tbackgroundSkin.minWidth = this.gridSize;\n\t\t\tbackgroundSkin.minHeight = this.gridSize;\n\t\t\theader.backgroundSkin = backgroundSkin;\n\n\t\t\theader.fontStyles = this.primaryFontStyles.clone();\n\t\t\theader.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\theader.paddingTop = this.smallGutterSize;\n\t\t\theader.paddingBottom = this.smallGutterSize;\n\t\t\theader.paddingRight = this.gutterSize;\n\t\t\theader.paddingLeft = this.gutterSize;\n\t\t\theader.gap = this.smallGutterSize;\n\t\t\theader.titleGap = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// PanelScreen\n\t//-------------------------\n\n\t\tprotected function setPanelScreenStyles(screen:PanelScreen):void\n\t\t{\n\t\t\tthis.setScrollerStyles(screen);\n\t\t}\n\n\t//-------------------------\n\t// PickerList\n\t//-------------------------\n\n\t\tprotected function setPickerListStyles(list:PickerList):void\n\t\t{\n\t\t\tlist.toggleButtonOnOpenAndClose = true;\n\t\t\tvar popUpContentManager:DropDownPopUpContentManager = new DropDownPopUpContentManager();\n\t\t\tpopUpContentManager.gap = this.dropDownGapSize;\n\t\t\tlist.popUpContentManager = popUpContentManager;\n\t\t\tlist.buttonFactory = pickerListButtonFactory;\n\t\t}\n\n\t\tprotected function setPickerListButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN_AND_SELECTED,  this.buttonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.buttonMinWidth;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.pickerListButtonIconUpTexture);\n\t\t\ticon.disabledTexture = this.pickerListButtonIconDisabledTexture;\n\t\t\tif(button is ToggleButton)\n\t\t\t{\n\t\t\t\t//for convenience, this function can style both a regular button\n\t\t\t\t//and a toggle button\n\t\t\t\ticon.selectedTexture = this.pickerListButtonIconSelectedTexture;\n\t\t\t}\n\t\t\tbutton.defaultIcon = icon;\n\n\t\t\tbutton.fontStyles = this.primaryFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\n\t\t\tbutton.gap = Number.POSITIVE_INFINITY; //fill as completely as possible\n\t\t\tbutton.minGap = this.gutterSize;\n\t\t\tbutton.iconPosition = RelativePosition.RIGHT;\n\t\t\tbutton.horizontalAlign =  HorizontalAlign.LEFT;\n\t\t}\n\n\t\t//for the PickerList's pop-up list, see setDropDownListStyles()\n\n\t//-------------------------\n\t// ProgressBar\n\t//-------------------------\n\n\t\tprotected function setProgressBarStyles(progress:ProgressBar):void\n\t\t{\n\t\t\tvar backgroundSkin:Image = new Image(this.insetBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tif(progress.direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tbackgroundSkin.width = this.smallControlSize;\n\t\t\t\tbackgroundSkin.height = this.wideControlSize;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbackgroundSkin.width = this.wideControlSize;\n\t\t\t\tbackgroundSkin.height = this.smallControlSize;\n\t\t\t}\n\t\t\tprogress.backgroundSkin = backgroundSkin;\n\n\t\t\tvar backgroundDisabledSkin:Image = new Image(this.insetBackgroundDisabledSkinTexture);\n\t\t\tbackgroundDisabledSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tif(progress.direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tbackgroundDisabledSkin.width = this.smallControlSize;\n\t\t\t\tbackgroundDisabledSkin.height = this.wideControlSize;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbackgroundDisabledSkin.width = this.wideControlSize;\n\t\t\t\tbackgroundDisabledSkin.height = this.smallControlSize;\n\t\t\t}\n\t\t\tprogress.backgroundDisabledSkin = backgroundDisabledSkin;\n\n\t\t\tvar fillSkin:Image = new Image(this.buttonUpSkinTexture);\n\t\t\tfillSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tif(progress.direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tfillSkin.width = this.smallControlSize;\n\t\t\t\tfillSkin.height = this.progressBarFillMinSize;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfillSkin.width = this.progressBarFillMinSize;\n\t\t\t\tfillSkin.height = this.smallControlSize;\n\t\t\t}\n\t\t\tprogress.fillSkin = fillSkin;\n\n\t\t\tvar fillDisabledSkin:Image = new Image(this.buttonDisabledSkinTexture);\n\t\t\tfillDisabledSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tif(progress.direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tfillDisabledSkin.width = this.smallControlSize;\n\t\t\t\tfillDisabledSkin.height = this.progressBarFillMinSize;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfillDisabledSkin.width = this.progressBarFillMinSize;\n\t\t\t\tfillDisabledSkin.height = this.smallControlSize;\n\t\t\t}\n\t\t\tprogress.fillDisabledSkin = fillDisabledSkin;\n\t\t}\n\n\t//-------------------------\n\t// Radio\n\t//-------------------------\n\n\t\tprotected function setRadioStyles(radio:Radio):void\n\t\t{\n\t\t\tvar skin:Quad = new Quad(this.controlSize, this.controlSize);\n\t\t\tskin.alpha = 0;\n\t\t\tradio.defaultSkin = skin;\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.radioIconTexture);\n\t\t\ticon.selectedTexture = this.radioSelectedIconTexture;\n\t\t\ticon.setTextureForState(ButtonState.DISABLED, this.radioDisabledIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DISABLED_AND_SELECTED,  this.radioSelectedDisabledIconTexture);\n\t\t\tradio.defaultIcon = icon;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tradio.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tradio.focusPadding = this.focusPaddingSize;\n\n\t\t\tradio.fontStyles = this.primaryFontStyles.clone();\n\t\t\tradio.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tradio.gap = this.smallGutterSize;\n\t\t\tradio.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tradio.verticalAlign = VerticalAlign.MIDDLE;\n\t\t}\n\n\t//-------------------------\n\t// ScrollBar\n\t//-------------------------\n\n\t\tprotected function setHorizontalScrollBarStyles(scrollBar:ScrollBar):void\n\t\t{\n\t\t\tscrollBar.trackLayoutMode = TrackLayoutMode.SINGLE;\n\n\t\t\tscrollBar.customIncrementButtonStyleName = THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_INCREMENT_BUTTON;\n\t\t\tscrollBar.customDecrementButtonStyleName = THEME_STYLE_NAME_HORIZONTAL_SCROLL_BAR_DECREMENT_BUTTON;\n\t\t}\n\n\t\tprotected function setVerticalScrollBarStyles(scrollBar:ScrollBar):void\n\t\t{\n\t\t\tscrollBar.trackLayoutMode = TrackLayoutMode.SINGLE;\n\n\t\t\tscrollBar.customIncrementButtonStyleName = THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_INCREMENT_BUTTON;\n\t\t\tscrollBar.customDecrementButtonStyleName = THEME_STYLE_NAME_VERTICAL_SCROLL_BAR_DECREMENT_BUTTON;\n\t\t}\n\n\t\tprotected function setScrollBarThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.thumbSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.thumbDisabledSkinTexture);\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.minWidth = this.smallControlSize;\n\t\t\tskin.minHeight = this.smallControlSize;\n\t\t\tthumb.defaultSkin = skin;\n\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setScrollBarMinimumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.insetBackgroundSkinTexture);\n\t\t\tskin.disabledTexture = this.insetBackgroundDisabledSkinTexture;\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.width = this.smallControlSize;\n\t\t\tskin.height = this.smallControlSize;\n\t\t\ttrack.defaultSkin = skin;\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setBaseScrollBarButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.width = this.smallControlSize;\n\t\t\tskin.height = this.smallControlSize;\n\t\t\tskin.minWidth = this.smallControlSize;\n\t\t\tskin.minHeight = this.smallControlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tbutton.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\tbutton.padding = 0;\n\t\t\tbutton.gap = 0;\n\t\t\tbutton.minGap = 0;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setHorizontalScrollBarDecrementButtonStyles(button:Button):void\n\t\t{\n\t\t\tthis.setBaseScrollBarButtonStyles(button);\n\n\t\t\tvar defaultIcon:Image = new Image(this.horizontalScrollBarDecrementButtonIconTexture);\n\t\t\tbutton.defaultIcon = defaultIcon;\n\n\t\t\tvar disabledIcon:Quad = new Quad(this.horizontalScrollBarDecrementButtonIconTexture.frameWidth,\n\t\t\t\tthis.horizontalScrollBarDecrementButtonIconTexture.frameHeight);\n\t\t\tbutton.disabledIcon = disabledIcon;\n\t\t}\n\n\t\tprotected function setHorizontalScrollBarIncrementButtonStyles(button:Button):void\n\t\t{\n\t\t\tthis.setBaseScrollBarButtonStyles(button);\n\n\t\t\tvar defaultIcon:Image = new Image(this.horizontalScrollBarIncrementButtonIconTexture);\n\t\t\tbutton.defaultIcon = defaultIcon;\n\n\t\t\tvar disabledIcon:Quad = new Quad(this.horizontalScrollBarIncrementButtonIconTexture.frameWidth,\n\t\t\t\tthis.horizontalScrollBarIncrementButtonIconTexture.frameHeight);\n\t\t\tbutton.disabledIcon = disabledIcon;\n\t\t}\n\n\t\tprotected function setVerticalScrollBarDecrementButtonStyles(button:Button):void\n\t\t{\n\t\t\tthis.setBaseScrollBarButtonStyles(button);\n\n\t\t\tvar defaultIcon:Image = new Image(this.verticalScrollBarDecrementButtonIconTexture);\n\t\t\tbutton.defaultIcon = defaultIcon;\n\n\t\t\tvar disabledIcon:Quad = new Quad(this.verticalScrollBarDecrementButtonIconTexture.frameWidth,\n\t\t\t\tthis.verticalScrollBarDecrementButtonIconTexture.frameHeight);\n\t\t\tbutton.disabledIcon = disabledIcon;\n\t\t}\n\n\t\tprotected function setVerticalScrollBarIncrementButtonStyles(button:Button):void\n\t\t{\n\t\t\tthis.setBaseScrollBarButtonStyles(button);\n\n\t\t\tvar defaultIcon:Image = new Image(this.verticalScrollBarIncrementButtonIconTexture);\n\t\t\tbutton.defaultIcon = defaultIcon;\n\n\t\t\tvar disabledIcon:Quad = new Quad(this.verticalScrollBarIncrementButtonIconTexture.frameWidth,\n\t\t\t\tthis.verticalScrollBarIncrementButtonIconTexture.frameHeight);\n\t\t\tbutton.disabledIcon = disabledIcon;\n\t\t}\n\n\t//-------------------------\n\t// ScrollContainer\n\t//-------------------------\n\n\t\tprotected function setScrollContainerStyles(container:ScrollContainer):void\n\t\t{\n\t\t\tthis.setScrollerStyles(container);\n\t\t}\n\n\t\tprotected function setToolbarScrollContainerStyles(container:ScrollContainer):void\n\t\t{\n\t\t\tthis.setScrollerStyles(container);\n\n\t\t\tif(!container.layout)\n\t\t\t{\n\t\t\t\tvar layout:HorizontalLayout = new HorizontalLayout();\n\t\t\t\tlayout.padding = this.gutterSize;\n\t\t\t\tlayout.gap = this.smallGutterSize;\n\t\t\t\tlayout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\t\tcontainer.layout = layout;\n\t\t\t}\n\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.headerSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = HEADER_SCALE_9_GRID;\n\t\t\tbackgroundSkin.width = this.gridSize;\n\t\t\tbackgroundSkin.height = this.gridSize;\n\t\t\tbackgroundSkin.minWidth = this.gridSize;\n\t\t\tbackgroundSkin.minHeight = this.gridSize;\n\t\t\tcontainer.backgroundSkin = backgroundSkin;\n\t\t}\n\n\t//-------------------------\n\t// ScrollScreen\n\t//-------------------------\n\n\t\tprotected function setScrollScreenStyles(screen:ScrollScreen):void\n\t\t{\n\t\t\tthis.setScrollerStyles(screen);\n\t\t}\n\n\t//-------------------------\n\t// ScrollText\n\t//-------------------------\n\n\t\tprotected function setScrollTextStyles(text:ScrollText):void\n\t\t{\n\t\t\tthis.setScrollerStyles(text);\n\n\t\t\ttext.fontStyles = this.scrollTextFontStyles.clone();\n\t\t\ttext.disabledFontStyles = this.scrollTextDisabledFontStyles.clone();\n\n\t\t\ttext.padding = this.gutterSize;\n\t\t}\n\n\t//-------------------------\n\t// SimpleScrollBar\n\t//-------------------------\n\n\t\tprotected function setSimpleScrollBarThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar defaultSkin:Image = new Image(this.simpleScrollBarThumbSkinTexture);\n\t\t\tdefaultSkin.scale9Grid = SCROLLBAR_THUMB_SCALE_9_GRID;\n\t\t\tdefaultSkin.width = this.smallControlSize;\n\t\t\tdefaultSkin.height = this.smallControlSize;\n\t\t\tthumb.defaultSkin = defaultSkin;\n\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t//-------------------------\n\t// Slider\n\t//-------------------------\n\n\t\tprotected function setSliderStyles(slider:Slider):void\n\t\t{\n\t\t\tslider.trackLayoutMode = TrackLayoutMode.SINGLE;\n\n\t\t\tif(slider.direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tslider.customMinimumTrackStyleName = THEME_STYLE_NAME_VERTICAL_SLIDER_MINIMUM_TRACK;\n\t\t\t}\n\t\t\telse //horizontal\n\t\t\t{\n\t\t\t\tslider.customMinimumTrackStyleName = THEME_STYLE_NAME_HORIZONTAL_SLIDER_MINIMUM_TRACK;\n\t\t\t}\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tslider.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tslider.focusPadding = this.focusPaddingSize;\n\t\t}\n\n\t\tprotected function setHorizontalSliderMinimumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.insetBackgroundSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.insetBackgroundDisabledSkinTexture);\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.width = this.wideControlSize;\n\t\t\tskin.height = this.smallControlSize;\n\t\t\tskin.minWidth = this.wideControlSize;\n\t\t\tskin.minHeight = this.smallControlSize;\n\t\t\ttrack.defaultSkin = skin;\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVerticalSliderMinimumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.insetBackgroundSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.insetBackgroundDisabledSkinTexture);\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.width = this.smallControlSize;\n\t\t\tskin.height = this.wideControlSize;\n\t\t\tskin.minWidth = this.smallControlSize;\n\t\t\tskin.minHeight = this.wideControlSize;\n\t\t\ttrack.defaultSkin = skin;\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setSliderThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.thumbSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.thumbDisabledSkinTexture);\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.width = this.smallControlSize;\n\t\t\tskin.height = this.smallControlSize;\n\t\t\tthumb.defaultSkin = skin;\n\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t//-------------------------\n\t// SpinnerList\n\t//-------------------------\n\n\t\tprotected function setSpinnerListStyles(list:SpinnerList):void\n\t\t{\n\t\t\tthis.setListStyles(list);\n\t\t}\n\n\t//-------------------------\n\t// TabBar\n\t//-------------------------\n\n\t\tprotected function setTabBarStyles(tabBar:TabBar):void\n\t\t{\n\t\t\ttabBar.distributeTabSizes = false;\n\t\t\ttabBar.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\ttabBar.verticalAlign = VerticalAlign.JUSTIFY;\n\t\t}\n\n\t\tprotected function setTabStyles(tab:ToggleButton):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.tabSkinTexture);\n\t\t\tskin.selectedTexture = this.tabSelectedSkinTexture;\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.tabDisabledSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED_AND_SELECTED,  this.tabSelectedDisabledSkinTexture);\n\t\t\tskin.scale9Grid = TAB_SCALE_9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\ttab.defaultSkin = skin;\n\n\t\t\ttab.fontStyles = this.primaryFontStyles.clone();\n\t\t\ttab.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\ttab.iconPosition = RelativePosition.LEFT;\n\n\t\t\ttab.paddingTop = this.smallGutterSize;\n\t\t\ttab.paddingBottom = this.smallGutterSize;\n\t\t\ttab.paddingLeft = this.gutterSize;\n\t\t\ttab.paddingRight = this.gutterSize;\n\t\t\ttab.gap = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// TextArea\n\t//-------------------------\n\n\t\tprotected function setTextAreaStyles(textArea:TextArea):void\n\t\t{\n\t\t\tthis.setScrollerStyles(textArea);\n\n\t\t\ttextArea.padding = this.borderSize;\n\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.insetBackgroundSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.DISABLED, this.insetBackgroundDisabledSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.FOCUSED, this.insetBackgroundFocusedSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.ERROR, this.insetBackgroundDangerSkinTexture);\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.width = this.wideControlSize * 2;\n\t\t\tskin.height = this.wideControlSize;\n\t\t\ttextArea.backgroundSkin = skin;\n\n\t\t\ttextArea.fontStyles = this.scrollTextFontStyles.clone();\n\t\t\ttextArea.disabledFontStyles = this.scrollTextDisabledFontStyles.clone();\n\n\t\t\ttextArea.promptFontStyles = this.primaryFontStyles.clone();\n\t\t\ttextArea.promptDisabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\ttextArea.focusPadding = this.focusPaddingSize;\n\t\t\t\n\t\t\ttextArea.innerPaddingTop = this.extraSmallGutterSize;\n\t\t\ttextArea.innerPaddingRight = this.smallGutterSize;\n\t\t\ttextArea.innerPaddingBottom = this.extraSmallGutterSize;\n\t\t\ttextArea.innerPaddingLeft = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setTextAreaErrorCalloutStyles(callout:TextCallout):void\n\t\t{\n\t\t\tthis.setDangerTextCalloutStyles(callout);\n\t\t\tcallout.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tcallout.verticalAlign = VerticalAlign.TOP;\n\t\t}\n\n\t//-------------------------\n\t// TextCallout\n\t//-------------------------\n\n\t\tprotected function setTextCalloutStyles(callout:TextCallout):void\n\t\t{\n\t\t\tthis.setCalloutStyles(callout);\n\n\t\t\tcallout.fontStyles = this.primaryFontStyles.clone();\n\t\t\tcallout.disabledFontStyles = this.disabledFontStyles.clone();\n\t\t}\n\n\t\tprotected function setDangerTextCalloutStyles(callout:TextCallout):void\n\t\t{\n\t\t\tthis.setDangerCalloutStyles(callout);\n\n\t\t\tcallout.fontStyles = this.dangerFontStyles.clone();\n\t\t\tcallout.disabledFontStyles = this.disabledFontStyles.clone();\n\t\t}\n\n\t//-------------------------\n\t// TextInput\n\t//-------------------------\n\n\t\tprotected function setBaseTextInputStyles(input:TextInput):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.insetBackgroundSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.DISABLED, this.insetBackgroundDisabledSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.FOCUSED, this.insetBackgroundFocusedSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.ERROR, this.insetBackgroundDangerSkinTexture);\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.width = this.wideControlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.wideControlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tinput.backgroundSkin = skin;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tinput.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tinput.focusPadding = this.focusPaddingSize;\n\n\t\t\tinput.fontStyles = this.primaryFontStyles.clone();\n\t\t\tinput.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tinput.promptFontStyles = this.primaryFontStyles.clone();\n\t\t\tinput.promptDisabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tinput.gap = this.smallGutterSize;\n\t\t\tinput.paddingTop = this.smallGutterSize;\n\t\t\tinput.paddingBottom = this.smallGutterSize;\n\t\t\tinput.paddingLeft = this.gutterSize;\n\t\t\tinput.paddingRight = this.gutterSize;\n\t\t}\n\n\t\tprotected function setTextInputStyles(input:TextInput):void\n\t\t{\n\t\t\tthis.setBaseTextInputStyles(input);\n\t\t}\n\n\t\tprotected function setSearchTextInputStyles(input:TextInput):void\n\t\t{\n\t\t\tthis.setBaseTextInputStyles(input);\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.searchIconTexture);\n\t\t\ticon.disabledTexture = this.searchIconDisabledTexture;\n\t\t\tinput.defaultIcon = icon;\n\t\t}\n\n\t\tprotected function setTextInputTextEditorStyles(textEditor:BitmapFontTextEditor):void\n\t\t{\n\t\t\ttextEditor.cursorSkin = new Quad(1, 1, PRIMARY_TEXT_COLOR);\n\t\t\ttextEditor.selectionSkin = new Quad(1, 1, BACKGROUND_COLOR);\n\t\t}\n\n\t\tprotected function setTextInputErrorCalloutStyles(callout:TextCallout):void\n\t\t{\n\t\t\tthis.setDangerTextCalloutStyles(callout);\n\t\t\tcallout.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tcallout.verticalAlign = VerticalAlign.TOP;\n\t\t}\n\n\t//-------------------------\n\t// Toast\n\t//-------------------------\n\n\t\tprotected function setToastStyles(toast:Toast):void\n\t\t{\n\t\t\tvar backgroundSkin:Quad = new Quad(1, 1, MODAL_OVERLAY_COLOR);\n\t\t\ttoast.backgroundSkin = backgroundSkin;\n\n\t\t\ttoast.fontStyles = this.primaryFontStyles.clone();\n\t\t\ttoast.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\ttoast.width = this.extraWideControlSize;\n\t\t\ttoast.paddingTop = this.smallGutterSize;\n\t\t\ttoast.paddingRight = this.gutterSize;\n\t\t\ttoast.paddingBottom = this.smallGutterSize;\n\t\t\ttoast.paddingLeft = this.gutterSize;\n\t\t\ttoast.gap = Number.POSITIVE_INFINITY;\n\t\t\ttoast.minGap = this.smallGutterSize;\n\t\t\ttoast.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\ttoast.verticalAlign = VerticalAlign.MIDDLE;\n\t\t}\n\n\t\tprotected function setToastActionsStyles(group:ButtonGroup):void\n\t\t{\n\t\t\tgroup.direction = Direction.HORIZONTAL;\n\t\t\tgroup.gap = this.smallGutterSize;\n\t\t\tgroup.customButtonStyleName = THEME_STYLE_NAME_TOAST_ACTIONS_BUTTON;\n\t\t}\n\n\t\tprotected function setToastActionsButtonStyles(button:Button):void\n\t\t{\n\t\t\tbutton.fontStyles = this.primaryFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.primaryFontStyles.clone();\n\t\t}\n\n\t//-------------------------\n\t// ToggleSwitch\n\t//-------------------------\n\n\t\tprotected function setToggleSwitchStyles(toggleSwitch:ToggleSwitch):void\n\t\t{\n\t\t\ttoggleSwitch.trackLayoutMode = TrackLayoutMode.SINGLE;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\ttoggleSwitch.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\ttoggleSwitch.focusPadding = this.focusPaddingSize;\n\n\t\t\ttoggleSwitch.offLabelFontStyles = this.primaryFontStyles.clone();\n\t\t\ttoggleSwitch.offLabelDisabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\ttoggleSwitch.onLabelFontStyles = this.primaryFontStyles.clone();\n\t\t\ttoggleSwitch.onLabelDisabledFontStyles = this.disabledFontStyles.clone();\n\t\t}\n\n\t\tprotected function setToggleSwitchOnTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.insetBackgroundSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.insetBackgroundDisabledSkinTexture);\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.width = Math.round(this.controlSize * 2.5);\n\t\t\tskin.height = this.controlSize;\n\t\t\ttrack.defaultSkin = skin;\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setToggleSwitchThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.thumbSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.thumbDisabledSkinTexture);\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tthumb.defaultSkin = skin;\n\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t//-------------------------\n\t// Tree\n\t//-------------------------\n\n\t\tprotected function setTreeStyles(tree:Tree):void\n\t\t{\n\t\t\tthis.setScrollerStyles(tree);\n\n\t\t\ttree.verticalScrollPolicy = ScrollPolicy.AUTO;\n\n\t\t\tvar backgroundSkin:Image = new Image(this.listBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tbackgroundSkin.width = this.controlSize;\n\t\t\tbackgroundSkin.height = this.controlSize;\n\t\t\ttree.backgroundSkin = backgroundSkin;\n\n\t\t\tvar backgroundDisabledSkin:Image = new Image(this.buttonDisabledSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tbackgroundDisabledSkin.width = this.controlSize;\n\t\t\tbackgroundDisabledSkin.height = this.controlSize;\n\t\t\ttree.backgroundDisabledSkin = backgroundDisabledSkin;\n\n\t\t\ttree.padding = this.borderSize;\n\t\t\ttree.paddingRight = 0;\n\t\t}\n\n\t\tprotected function setTreeItemRendererStyles(itemRenderer:DefaultTreeItemRenderer):void\n\t\t{\n\t\t\tthis.setItemRendererStyles(itemRenderer);\n\n\t\t\titemRenderer.indentation = this.treeDisclosureOpenIconTexture.width;\n\t\t\titemRenderer.disclosureGap = this.gutterSize;\n\n\t\t\tvar disclosureOpenIcon:ImageSkin = new ImageSkin(this.treeDisclosureOpenIconTexture);\n\t\t\tdisclosureOpenIcon.textureSmoothing = TextureSmoothing.NONE;\n\t\t\tdisclosureOpenIcon.pixelSnapping = true;\n\t\t\titemRenderer.disclosureOpenIcon = disclosureOpenIcon;\n\n\t\t\tvar disclosureClosedIcon:ImageSkin = new ImageSkin(this.treeDisclosureClosedIconTexture);\n\t\t\tdisclosureClosedIcon.textureSmoothing = TextureSmoothing.NONE;\n\t\t\tdisclosureClosedIcon.pixelSnapping = true;\n\t\t\titemRenderer.disclosureClosedIcon = disclosureClosedIcon;\n\t\t}\n\n\t//-------------------------\n\t// VideoPlayer\n\t//-------------------------\n\n\t\tprotected function setVideoPlayerStyles(player:VideoPlayer):void\n\t\t{\n\t\t\tplayer.backgroundSkin = new Quad(1, 1, 0x000000);\n\t\t}\n\n\t//-------------------------\n\t// PlayPauseToggleButton\n\t//-------------------------\n\n\t\tprotected function setPlayPauseToggleButtonStyles(button:PlayPauseToggleButton):void\n\t\t{\n\t\t\tvar defaultSkin:Quad = new Quad(this.controlSize, this.controlSize, 0xff00ff);\n\t\t\tdefaultSkin.alpha = 0;\n\t\t\tbutton.defaultSkin = defaultSkin;\n\n\t\t\tvar otherSkin:ImageSkin = new ImageSkin(null);\n\t\t\totherSkin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\totherSkin.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.buttonDownSkinTexture);\n\t\t\totherSkin.width = this.controlSize;\n\t\t\totherSkin.height = this.controlSize;\n\t\t\totherSkin.minWidth = this.controlSize;\n\t\t\totherSkin.minHeight = this.controlSize;\n\t\t\tbutton.setSkinForState(ButtonState.DOWN, otherSkin);\n\t\t\tbutton.setSkinForState(ButtonState.DOWN_AND_SELECTED, otherSkin);\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.playPauseButtonPlayUpIconTexture);\n\t\t\ticon.selectedTexture = this.playPauseButtonPauseUpIconTexture;\n\t\t\ticon.textureSmoothing = TextureSmoothing.NONE;\n\t\t\tbutton.defaultIcon = icon;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tbutton.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tbutton.focusPadding = this.focusPaddingSize;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\n\t\t\tbutton.padding = this.smallGutterSize;\n\t\t\tbutton.gap = this.smallGutterSize;\n\t\t\tbutton.minGap = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setOverlayPlayPauseToggleButtonStyles(button:PlayPauseToggleButton):void\n\t\t{\n\t\t\tvar icon:ImageSkin = new ImageSkin(null);\n\t\t\ticon.setTextureForState(ButtonState.UP, this.overlayPlayPauseButtonPlayUpIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.HOVER, this.overlayPlayPauseButtonPlayUpIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DOWN, this.overlayPlayPauseButtonPlayDownIconTexture);\n\t\t\tbutton.defaultIcon = icon;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\n\t\t\tvar skin:Quad = new Quad(this.overlayPlayPauseButtonPlayUpIconTexture.width,\n\t\t\t\tthis.overlayPlayPauseButtonPlayUpIconTexture.height);\n\t\t\tskin.alpha = 0;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tvar overlaySkin:Quad = new Quad(1, 1, VIDEO_OVERLAY_COLOR);\n\t\t\toverlaySkin.alpha = VIDEO_OVERLAY_ALPHA;\n\t\t\tbutton.upSkin = overlaySkin;\n\t\t\tbutton.hoverSkin = overlaySkin;\n\t\t}\n\n\t//-------------------------\n\t// FullScreenToggleButton\n\t//-------------------------\n\n\t\tprotected function setFullScreenToggleButtonStyles(button:FullScreenToggleButton):void\n\t\t{\n\t\t\tvar defaultSkin:Quad = new Quad(this.controlSize, this.controlSize, 0xff00ff);\n\t\t\tdefaultSkin.alpha = 0;\n\t\t\tbutton.defaultSkin = defaultSkin;\n\n\t\t\tvar otherSkin:ImageSkin = new ImageSkin(null);\n\t\t\totherSkin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\totherSkin.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.buttonDownSkinTexture);\n\t\t\totherSkin.width = this.controlSize;\n\t\t\totherSkin.height = this.controlSize;\n\t\t\totherSkin.minWidth = this.controlSize;\n\t\t\totherSkin.minHeight = this.controlSize;\n\t\t\tbutton.setSkinForState(ButtonState.DOWN, otherSkin);\n\t\t\tbutton.setSkinForState(ButtonState.DOWN_AND_SELECTED, otherSkin);\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.fullScreenToggleButtonEnterUpIconTexture);\n\t\t\ticon.selectedTexture = this.fullScreenToggleButtonExitUpIconTexture;\n\t\t\tbutton.defaultIcon = icon;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tbutton.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tbutton.focusPadding = this.focusPaddingSize;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\n\t\t\tbutton.padding = this.smallGutterSize;\n\t\t\tbutton.gap = this.smallGutterSize;\n\t\t\tbutton.minGap = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// MuteToggleButton\n\t//-------------------------\n\n\t\tprotected function setMuteToggleButtonStyles(button:MuteToggleButton):void\n\t\t{\n\t\t\tvar defaultSkin:Quad = new Quad(this.controlSize, this.controlSize, 0xff00ff);\n\t\t\tdefaultSkin.alpha = 0;\n\t\t\tbutton.defaultSkin = defaultSkin;\n\n\t\t\tvar otherSkin:ImageSkin = new ImageSkin(null);\n\t\t\totherSkin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\totherSkin.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.buttonDownSkinTexture);\n\t\t\totherSkin.width = this.controlSize;\n\t\t\totherSkin.height = this.controlSize;\n\t\t\totherSkin.minWidth = this.controlSize;\n\t\t\totherSkin.minHeight = this.controlSize;\n\t\t\tbutton.setSkinForState(ButtonState.DOWN, otherSkin);\n\t\t\tbutton.setSkinForState(ButtonState.DOWN_AND_SELECTED, otherSkin);\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.muteToggleButtonLoudUpIconTexture);\n\t\t\ticon.selectedTexture = this.muteToggleButtonMutedUpIconTexture;\n\t\t\ticon.textureSmoothing = TextureSmoothing.NONE;\n\t\t\tbutton.defaultIcon = icon;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tbutton.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tbutton.focusPadding = this.focusPaddingSize;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\t\t\tbutton.showVolumeSliderOnHover = true;\n\n\t\t\tbutton.padding = this.smallGutterSize;\n\t\t\tbutton.gap = this.smallGutterSize;\n\t\t\tbutton.minGap = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setPopUpVolumeSliderStyles(slider:VolumeSlider):void\n\t\t{\n\t\t\tslider.direction = Direction.VERTICAL;\n\t\t\tslider.trackLayoutMode = TrackLayoutMode.SINGLE;\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tslider.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tslider.focusPadding = this.focusPaddingSize;\n\t\t\tslider.maximumPadding = this.popUpVolumeSliderPaddingTopLeft;\n\t\t\tslider.minimumPadding = this.popUpVolumeSliderPaddingBottomRight;\n\t\t\tslider.thumbOffset = -Math.round(this.dropShadowSize / 2);\n\t\t\tslider.customThumbStyleName = THEME_STYLE_NAME_POP_UP_VOLUME_SLIDER_THUMB;\n\t\t\tslider.customMinimumTrackStyleName = THEME_STYLE_NAME_POP_UP_VOLUME_SLIDER_MINIMUM_TRACK;\n\t\t\tslider.width = this.smallControlSize + this.popUpVolumeSliderPaddingTopLeft + this.popUpVolumeSliderPaddingBottomRight;\n\t\t\tslider.height = this.wideControlSize + this.popUpVolumeSliderPaddingTopLeft + this.popUpVolumeSliderPaddingBottomRight;\n\t\t}\n\n\t\tprotected function setPopUpVolumeSliderTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar skin:Image = new Image(this.popUpVolumeSliderTrackSkinTexture);\n\t\t\tskin.scale9Grid = VOLUME_SLIDER_TRACK_SCALE9_GRID;\n\t\t\ttrack.defaultSkin = skin;\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t//-------------------------\n\t// SeekSlider\n\t//-------------------------\n\n\t\tprotected function setSeekSliderStyles(slider:SeekSlider):void\n\t\t{\n\t\t\tthis.setSliderStyles(slider);\n\n\t\t\tvar progressSkin:Image = new Image(this.seekSliderProgressSkinTexture);\n\t\t\tprogressSkin.scale9Grid = SEEK_SLIDER_PROGRESS_SKIN_SCALE9_GRID;\n\t\t\tslider.progressSkin = progressSkin;\n\t\t}\n\n\t//-------------------------\n\t// VolumeSlider\n\t//-------------------------\n\n\t\tprotected function setVolumeSliderStyles(slider:VolumeSlider):void\n\t\t{\n\t\t\tslider.direction = Direction.HORIZONTAL;\n\t\t\tslider.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tslider.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tslider.focusPadding = this.focusPaddingSize;\n\t\t\tslider.showThumb = false;\n\t\t}\n\n\t\tprotected function setVolumeSliderThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar thumbSize:Number = 6;\n\t\t\tvar defaultSkin:Quad = new Quad(thumbSize, thumbSize);\n\t\t\tdefaultSkin.width = 0;\n\t\t\tdefaultSkin.height = 0;\n\t\t\tthumb.defaultSkin = defaultSkin;\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVolumeSliderMinimumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar defaultSkin:ImageLoader = new ImageLoader();\n\t\t\tdefaultSkin.scaleContent = false;\n\t\t\tdefaultSkin.source = this.volumeSliderMinimumTrackSkinTexture;\n\t\t\ttrack.defaultSkin = defaultSkin;\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVolumeSliderMaximumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar defaultSkin:ImageLoader = new ImageLoader();\n\t\t\tdefaultSkin.scaleContent = false;\n\t\t\tdefaultSkin.horizontalAlign = HorizontalAlign.RIGHT;\n\t\t\tdefaultSkin.source = this.volumeSliderMaximumTrackSkinTexture;\n\t\t\ttrack.defaultSkin = defaultSkin;\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "themes/MinimalDesktopTheme/source/feathers/themes/MinimalDesktopTheme.as",
    "content": "/*\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n*/\npackage feathers.themes\n{\n\timport flash.display.Bitmap;\n\timport flash.display.BitmapData;\n\n\timport starling.text.BitmapFont;\n\timport starling.text.TextField;\n\timport starling.textures.Texture;\n\timport starling.textures.TextureAtlas;\n\n\t/**\n\t * The \"Minimal\" theme for desktop Feathers apps.\n\t *\n\t * <p>This version of the theme embeds its assets. To load assets at\n\t * runtime, see <code>MinimalDesktopThemeWithAssetManager</code> instead.</p>\n\t *\n\t * @see http://feathersui.com/help/theme-assets.html\n\t */\n\tpublic class MinimalDesktopTheme extends BaseMinimalDesktopTheme\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\t[Embed(source=\"/../assets/images/minimal_desktop.xml\",mimeType=\"application/octet-stream\")]\n\t\tprotected static const ATLAS_XML:Class;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\t[Embed(source=\"/../assets/images/minimal_desktop.png\")]\n\t\tprotected static const ATLAS_BITMAP:Class;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\t[Embed(source=\"/../assets/fonts/pf_ronda_seven_desktop.fnt\",mimeType=\"application/octet-stream\")]\n\t\tprotected static const FONT_XML:Class;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function MinimalDesktopTheme()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.initialize();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tthis.initializeTextureAtlas();\n\t\t\tthis.initializeBitmapFont();\n\t\t\tsuper.initialize();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function initializeTextureAtlas():void\n\t\t{\n\t\t\tvar atlasBitmapData:BitmapData = Bitmap(new ATLAS_BITMAP()).bitmapData;\n\t\t\tvar atlasTexture:Texture = Texture.fromBitmapData(atlasBitmapData, false, false, ATLAS_SCALE_FACTOR);\n\t\t\tatlasTexture.root.onRestore = this.atlasTexture_onRestore;\n\t\t\tatlasBitmapData.dispose();\n\t\t\tthis.atlas = new TextureAtlas(atlasTexture, XML(new ATLAS_XML()));\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function initializeBitmapFont():void\n\t\t{\n\t\t\tvar bitmapFont:BitmapFont = new BitmapFont(this.atlas.getTexture(FONT_TEXTURE_NAME), XML(new FONT_XML()));\n\t\t\tTextField.registerCompositor(bitmapFont, FONT_NAME);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function atlasTexture_onRestore():void\n\t\t{\n\t\t\tvar atlasBitmapData:BitmapData = Bitmap(new ATLAS_BITMAP()).bitmapData;\n\t\t\tthis.atlas.texture.root.uploadBitmapData(atlasBitmapData);\n\t\t\tatlasBitmapData.dispose();\n\t\t}\n\t}\n}"
  },
  {
    "path": "themes/MinimalDesktopTheme/source/feathers/themes/MinimalDesktopThemeWithAssetManager.as",
    "content": "/*\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n*/\npackage feathers.themes\n{\n\timport feathers.events.FeathersEventType;\n\n\timport starling.assets.AssetManager;\n\timport starling.core.Starling;\n\timport starling.events.Event;\n\timport starling.text.BitmapFont;\n\timport starling.text.TextField;\n\n\t/**\n\t * @copy feathers.themes.IAsyncTheme#event:complete\n\t *\n\t * @eventType starling.events.Event.COMPLETE\n\t */\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the theme's assets fail to load due to an error.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The error string.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.ERROR\n\t */\n\t[Event(name=\"error\",type=\"starling.events.Event\")]\n\n\t/**\n\t * The \"Minimal\" theme for desktop Feathers apps.\n\t *\n\t * <p>This version of the theme requires loading assets at runtime. To use\n\t * embedded assets, see <code>MinimalDesktopTheme</code> instead.</p>\n\t *\n\t * <p>To use this theme, the following files must be included when packaging\n\t * your app:</p>\n\t * <ul>\n\t *     <li>images/minimal_desktop.png</li>\n\t *     <li>images/minimal_desktop.xml</li>\n\t *     <li>fonts/pf_ronda_seven.fnt</li>\n\t * </ul>\n\t *\n\t * @see http://feathersui.com/help/theme-assets.html\n\t */\n\tpublic class MinimalDesktopThemeWithAssetManager extends BaseMinimalDesktopTheme implements IAsyncTheme\n\t{\n\t\t/**\n\t\t * @private\n\t\t * The name of the texture atlas in the asset manager.\n\t\t */\n\t\tprotected static const ATLAS_NAME:String = \"minimal_desktop\";\n\n\t\t/**\n\t\t * Constructor.\n\t\t * @param assetsBasePath The root folder of the assets.\n\t\t * @param assetManager An optional pre-created AssetManager. The scaleFactor property must be equal to Starling.contentScaleFactor. To load assets with a different scale factor, use multiple AssetManager instances.\n\t\t */\n\t\tpublic function MinimalDesktopThemeWithAssetManager(assetsBasePath:String = \"./\", assetManager:AssetManager = null)\n\t\t{\n\t\t\tthis.loadAssets(assetsBasePath, assetManager);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * The paths to each of the assets, relative to the base path.\n\t\t */\n\t\tprotected var assetPaths:Vector.<String> = new <String>\n\t\t[\n\t\t\t\"images/\" + ATLAS_NAME + \".xml\",\n\t\t\t\"images/\" + ATLAS_NAME + \".png\",\n\t\t\t\"fonts/pf_ronda_seven_desktop.fnt\"\n\t\t];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var assetManager:AssetManager;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var isComplete:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tsuper.dispose();\n\t\t\tif(this.assetManager)\n\t\t\t{\n\t\t\t\tthis.assetManager.removeTextureAtlas(ATLAS_NAME);\n\t\t\t\tthis.assetManager = null;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.themes.IAsyncTheme#isCompleteForStarling()\n\t\t */\n\t\tpublic function isCompleteForStarling(starling:Starling):Boolean\n\t\t{\n\t\t\treturn this.isComplete;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tthis.initializeTextureAtlas();\n\t\t\tthis.initializeBitmapFont();\n\t\t\tsuper.initialize();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function initializeTextureAtlas():void\n\t\t{\n\t\t\tthis.atlas = this.assetManager.getTextureAtlas(ATLAS_NAME);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function initializeBitmapFont():void\n\t\t{\n\t\t\tvar font:BitmapFont = TextField.getBitmapFont(FONT_TEXTURE_NAME);\n\t\t\tTextField.registerCompositor(font, FONT_NAME);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function loadAssets(assetsBasePath:String, assetManager:AssetManager):void\n\t\t{\n\t\t\tvar oldScaleFactor:Number = -1;\n\t\t\tif(assetManager)\n\t\t\t{\n\t\t\t\toldScaleFactor = assetManager.textureOptions.scale;\n\t\t\t\tassetManager.textureOptions.scale = ATLAS_SCALE_FACTOR;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tassetManager = new AssetManager(ATLAS_SCALE_FACTOR);\n\t\t\t}\n\t\t\tthis.assetManager = assetManager;\n\t\t\t//add a trailing slash, if needed\n\t\t\tif(assetsBasePath.lastIndexOf(\"/\") != assetsBasePath.length - 1)\n\t\t\t{\n\t\t\t\tassetsBasePath += \"/\";\n\t\t\t}\n\t\t\tvar assetPaths:Vector.<String> = this.assetPaths;\n\t\t\tvar assetCount:int = assetPaths.length;\n\t\t\tfor(var i:int = 0; i < assetCount; i++)\n\t\t\t{\n\t\t\t\tvar asset:String = assetPaths[i];\n\t\t\t\tthis.assetManager.enqueue(assetsBasePath + asset);\n\t\t\t}\n\t\t\tif(oldScaleFactor != -1)\n\t\t\t{\n\t\t\t\t//restore the old scale factor, just in case\n\t\t\t\tthis.assetManager.textureOptions.scale = oldScaleFactor;\n\t\t\t}\n\t\t\tthis.assetManager.loadQueue(assetManager_onComplete, assetManager_onError);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function assetManager_onComplete():void\n\t\t{\n\t\t\tthis.initialize();\n\t\t\tthis.isComplete = true;\n\t\t\tthis.dispatchEventWith(Event.COMPLETE, false, Starling.current);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function assetManager_onError(error:String):void\n\t\t{\n\t\t\tthis.dispatchEventWith(FeathersEventType.ERROR, false, error);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "themes/MinimalMobileTheme/README.md",
    "content": "# Minimal Mobile Theme for Feathers\n\nThis [Feathers](http://feathersui.com/) theme for mobile devices combines simple gray colors with a retro pixel aesthetic.\n\n## Original Artwork\n\nThis theme's texture atlas was exported from Adobe Animate CC. To modify colors and other properties, or to add new skins to the texture atlas, [download the source FLA file](http://feathersui.com/help/theme-sources.html) from the Feathers website.\n\n## Credits\n\nThis theme is based on the appearance of [MinimalComps](https://github.com/minimalcomps/minimalcomps/), a great set of Flash user interface components created by [Keith Peters](https://bit-101.com/). With permission, the theme was ported to Feathers by [Josh Tynjala](https://joshblog.net/). This theme uses the free Ronda Seven font, designed by [Yusuke Kamiyamane](http://p.yusukekamiyamane.com/)."
  },
  {
    "path": "themes/MinimalMobileTheme/assets/fonts/pf_ronda_seven.fnt",
    "content": "<?xml version=\"1.0\"?>\n<font>\n  <info face=\"PF Ronda Seven\" size=\"-8\" bold=\"0\" italic=\"0\" charset=\"\" unicode=\"1\" stretchH=\"100\" smooth=\"0\" aa=\"1\" padding=\"0,0,0,0\" spacing=\"1,1\" outline=\"0\"/>\n  <common lineHeight=\"13\" base=\"11\" scaleW=\"256\" scaleH=\"256\" pages=\"1\" packed=\"0\" alphaChnl=\"0\" redChnl=\"4\" greenChnl=\"4\" blueChnl=\"4\"/>\n  <pages>\n    <page id=\"0\" file=\"pf_ronda_seven_0.png\" />\n  </pages>\n  <chars count=\"95\">\n    <char id=\"32\" x=\"216\" y=\"8\" width=\"1\" height=\"1\" xoffset=\"0\" yoffset=\"12\" xadvance=\"3\" page=\"0\" chnl=\"15\" />\n    <char id=\"33\" x=\"85\" y=\"8\" width=\"1\" height=\"7\" xoffset=\"1\" yoffset=\"4\" xadvance=\"3\" page=\"0\" chnl=\"15\" />\n    <char id=\"34\" x=\"195\" y=\"8\" width=\"3\" height=\"2\" xoffset=\"0\" yoffset=\"4\" xadvance=\"4\" page=\"0\" chnl=\"15\" />\n    <char id=\"35\" x=\"0\" y=\"10\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"36\" x=\"15\" y=\"0\" width=\"5\" height=\"9\" xoffset=\"0\" yoffset=\"3\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"37\" x=\"69\" y=\"0\" width=\"7\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"8\" page=\"0\" chnl=\"15\" />\n    <char id=\"38\" x=\"6\" y=\"10\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"39\" x=\"206\" y=\"8\" width=\"1\" height=\"2\" xoffset=\"0\" yoffset=\"4\" xadvance=\"2\" page=\"0\" chnl=\"15\" />\n    <char id=\"40\" x=\"27\" y=\"0\" width=\"3\" height=\"9\" xoffset=\"0\" yoffset=\"3\" xadvance=\"4\" page=\"0\" chnl=\"15\" />\n    <char id=\"41\" x=\"35\" y=\"0\" width=\"3\" height=\"9\" xoffset=\"0\" yoffset=\"3\" xadvance=\"4\" page=\"0\" chnl=\"15\" />\n    <char id=\"42\" x=\"109\" y=\"8\" width=\"5\" height=\"5\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"43\" x=\"115\" y=\"8\" width=\"5\" height=\"5\" xoffset=\"0\" yoffset=\"5\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"44\" x=\"187\" y=\"8\" width=\"2\" height=\"3\" xoffset=\"0\" yoffset=\"10\" xadvance=\"3\" page=\"0\" chnl=\"15\" />\n    <char id=\"45\" x=\"208\" y=\"8\" width=\"3\" height=\"1\" xoffset=\"0\" yoffset=\"8\" xadvance=\"4\" page=\"0\" chnl=\"15\" />\n    <char id=\"46\" x=\"218\" y=\"8\" width=\"1\" height=\"1\" xoffset=\"1\" yoffset=\"10\" xadvance=\"3\" page=\"0\" chnl=\"15\" />\n    <char id=\"47\" x=\"21\" y=\"0\" width=\"5\" height=\"9\" xoffset=\"0\" yoffset=\"3\" xadvance=\"5\" page=\"0\" chnl=\"15\" />\n    <char id=\"48\" x=\"109\" y=\"0\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"49\" x=\"82\" y=\"8\" width=\"2\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"3\" page=\"0\" chnl=\"15\" />\n    <char id=\"50\" x=\"115\" y=\"0\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"51\" x=\"121\" y=\"0\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"52\" x=\"127\" y=\"0\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"53\" x=\"133\" y=\"0\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"54\" x=\"18\" y=\"10\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"55\" x=\"145\" y=\"0\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"56\" x=\"151\" y=\"0\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"57\" x=\"157\" y=\"0\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"58\" x=\"181\" y=\"8\" width=\"1\" height=\"5\" xoffset=\"1\" yoffset=\"6\" xadvance=\"3\" page=\"0\" chnl=\"15\" />\n    <char id=\"59\" x=\"253\" y=\"0\" width=\"2\" height=\"7\" xoffset=\"0\" yoffset=\"6\" xadvance=\"3\" page=\"0\" chnl=\"15\" />\n    <char id=\"60\" x=\"165\" y=\"8\" width=\"3\" height=\"5\" xoffset=\"0\" yoffset=\"5\" xadvance=\"4\" page=\"0\" chnl=\"15\" />\n    <char id=\"61\" x=\"183\" y=\"8\" width=\"3\" height=\"3\" xoffset=\"0\" yoffset=\"6\" xadvance=\"4\" page=\"0\" chnl=\"15\" />\n    <char id=\"62\" x=\"161\" y=\"8\" width=\"3\" height=\"5\" xoffset=\"0\" yoffset=\"5\" xadvance=\"4\" page=\"0\" chnl=\"15\" />\n    <char id=\"63\" x=\"181\" y=\"0\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"64\" x=\"0\" y=\"0\" width=\"8\" height=\"9\" xoffset=\"0\" yoffset=\"3\" xadvance=\"9\" page=\"0\" chnl=\"15\" />\n    <char id=\"65\" x=\"187\" y=\"0\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"66\" x=\"193\" y=\"0\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"67\" x=\"199\" y=\"0\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"68\" x=\"205\" y=\"0\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"69\" x=\"211\" y=\"0\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"70\" x=\"217\" y=\"0\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"71\" x=\"223\" y=\"0\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"72\" x=\"229\" y=\"0\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"73\" x=\"87\" y=\"8\" width=\"1\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"2\" page=\"0\" chnl=\"15\" />\n    <char id=\"74\" x=\"69\" y=\"8\" width=\"4\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"5\" page=\"0\" chnl=\"15\" />\n    <char id=\"75\" x=\"235\" y=\"0\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"76\" x=\"29\" y=\"10\" width=\"4\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"5\" page=\"0\" chnl=\"15\" />\n    <char id=\"77\" x=\"77\" y=\"0\" width=\"7\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"8\" page=\"0\" chnl=\"15\" />\n    <char id=\"78\" x=\"85\" y=\"0\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"79\" x=\"91\" y=\"0\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"80\" x=\"175\" y=\"0\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"81\" x=\"53\" y=\"0\" width=\"5\" height=\"8\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"82\" x=\"169\" y=\"0\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"83\" x=\"163\" y=\"0\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"84\" x=\"139\" y=\"0\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"85\" x=\"103\" y=\"0\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"86\" x=\"97\" y=\"0\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"87\" x=\"61\" y=\"0\" width=\"7\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"8\" page=\"0\" chnl=\"15\" />\n    <char id=\"88\" x=\"12\" y=\"10\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"89\" x=\"247\" y=\"0\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"90\" x=\"241\" y=\"0\" width=\"5\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"91\" x=\"31\" y=\"0\" width=\"3\" height=\"9\" xoffset=\"0\" yoffset=\"3\" xadvance=\"4\" page=\"0\" chnl=\"15\" />\n    <char id=\"92\" x=\"9\" y=\"0\" width=\"5\" height=\"9\" xoffset=\"0\" yoffset=\"3\" xadvance=\"6\" page=\"0\" chnl=\"15\" />\n    <char id=\"93\" x=\"39\" y=\"0\" width=\"3\" height=\"9\" xoffset=\"0\" yoffset=\"3\" xadvance=\"4\" page=\"0\" chnl=\"15\" />\n    <char id=\"94\" x=\"199\" y=\"8\" width=\"3\" height=\"2\" xoffset=\"0\" yoffset=\"4\" xadvance=\"4\" page=\"0\" chnl=\"15\" />\n    <char id=\"95\" x=\"212\" y=\"8\" width=\"3\" height=\"1\" xoffset=\"0\" yoffset=\"10\" xadvance=\"4\" page=\"0\" chnl=\"15\" />\n    <char id=\"96\" x=\"203\" y=\"8\" width=\"2\" height=\"2\" xoffset=\"0\" yoffset=\"1\" xadvance=\"3\" page=\"0\" chnl=\"15\" />\n    <char id=\"97\" x=\"141\" y=\"8\" width=\"4\" height=\"5\" xoffset=\"0\" yoffset=\"6\" xadvance=\"5\" page=\"0\" chnl=\"15\" />\n    <char id=\"98\" x=\"24\" y=\"10\" width=\"4\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"5\" page=\"0\" chnl=\"15\" />\n    <char id=\"99\" x=\"151\" y=\"8\" width=\"4\" height=\"5\" xoffset=\"0\" yoffset=\"6\" xadvance=\"5\" page=\"0\" chnl=\"15\" />\n    <char id=\"100\" x=\"49\" y=\"10\" width=\"4\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"5\" page=\"0\" chnl=\"15\" />\n    <char id=\"101\" x=\"156\" y=\"8\" width=\"4\" height=\"5\" xoffset=\"0\" yoffset=\"6\" xadvance=\"5\" page=\"0\" chnl=\"15\" />\n    <char id=\"102\" x=\"74\" y=\"8\" width=\"3\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"3\" page=\"0\" chnl=\"15\" />\n    <char id=\"103\" x=\"34\" y=\"10\" width=\"4\" height=\"7\" xoffset=\"0\" yoffset=\"6\" xadvance=\"5\" page=\"0\" chnl=\"15\" />\n    <char id=\"104\" x=\"39\" y=\"10\" width=\"4\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"5\" page=\"0\" chnl=\"15\" />\n    <char id=\"105\" x=\"89\" y=\"8\" width=\"1\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"2\" page=\"0\" chnl=\"15\" />\n    <char id=\"106\" x=\"59\" y=\"0\" width=\"1\" height=\"8\" xoffset=\"0\" yoffset=\"4\" xadvance=\"2\" page=\"0\" chnl=\"15\" />\n    <char id=\"107\" x=\"44\" y=\"10\" width=\"4\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"5\" page=\"0\" chnl=\"15\" />\n    <char id=\"108\" x=\"91\" y=\"8\" width=\"1\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"2\" page=\"0\" chnl=\"15\" />\n    <char id=\"109\" x=\"101\" y=\"8\" width=\"7\" height=\"5\" xoffset=\"0\" yoffset=\"6\" xadvance=\"8\" page=\"0\" chnl=\"15\" />\n    <char id=\"110\" x=\"121\" y=\"8\" width=\"4\" height=\"5\" xoffset=\"0\" yoffset=\"6\" xadvance=\"5\" page=\"0\" chnl=\"15\" />\n    <char id=\"111\" x=\"126\" y=\"8\" width=\"4\" height=\"5\" xoffset=\"0\" yoffset=\"6\" xadvance=\"5\" page=\"0\" chnl=\"15\" />\n    <char id=\"112\" x=\"54\" y=\"9\" width=\"4\" height=\"7\" xoffset=\"0\" yoffset=\"6\" xadvance=\"5\" page=\"0\" chnl=\"15\" />\n    <char id=\"113\" x=\"59\" y=\"9\" width=\"4\" height=\"7\" xoffset=\"0\" yoffset=\"6\" xadvance=\"5\" page=\"0\" chnl=\"15\" />\n    <char id=\"114\" x=\"169\" y=\"8\" width=\"3\" height=\"5\" xoffset=\"0\" yoffset=\"6\" xadvance=\"4\" page=\"0\" chnl=\"15\" />\n    <char id=\"115\" x=\"173\" y=\"8\" width=\"3\" height=\"5\" xoffset=\"0\" yoffset=\"6\" xadvance=\"4\" page=\"0\" chnl=\"15\" />\n    <char id=\"116\" x=\"78\" y=\"8\" width=\"3\" height=\"7\" xoffset=\"0\" yoffset=\"4\" xadvance=\"4\" page=\"0\" chnl=\"15\" />\n    <char id=\"117\" x=\"131\" y=\"8\" width=\"4\" height=\"5\" xoffset=\"0\" yoffset=\"6\" xadvance=\"5\" page=\"0\" chnl=\"15\" />\n    <char id=\"118\" x=\"136\" y=\"8\" width=\"4\" height=\"5\" xoffset=\"0\" yoffset=\"6\" xadvance=\"5\" page=\"0\" chnl=\"15\" />\n    <char id=\"119\" x=\"93\" y=\"8\" width=\"7\" height=\"5\" xoffset=\"0\" yoffset=\"6\" xadvance=\"8\" page=\"0\" chnl=\"15\" />\n    <char id=\"120\" x=\"146\" y=\"8\" width=\"4\" height=\"5\" xoffset=\"0\" yoffset=\"6\" xadvance=\"5\" page=\"0\" chnl=\"15\" />\n    <char id=\"121\" x=\"64\" y=\"8\" width=\"4\" height=\"7\" xoffset=\"0\" yoffset=\"6\" xadvance=\"5\" page=\"0\" chnl=\"15\" />\n    <char id=\"122\" x=\"177\" y=\"8\" width=\"3\" height=\"5\" xoffset=\"0\" yoffset=\"6\" xadvance=\"4\" page=\"0\" chnl=\"15\" />\n    <char id=\"123\" x=\"47\" y=\"0\" width=\"3\" height=\"9\" xoffset=\"0\" yoffset=\"3\" xadvance=\"4\" page=\"0\" chnl=\"15\" />\n    <char id=\"124\" x=\"51\" y=\"0\" width=\"1\" height=\"9\" xoffset=\"0\" yoffset=\"3\" xadvance=\"2\" page=\"0\" chnl=\"15\" />\n    <char id=\"125\" x=\"43\" y=\"0\" width=\"3\" height=\"9\" xoffset=\"0\" yoffset=\"3\" xadvance=\"4\" page=\"0\" chnl=\"15\" />\n    <char id=\"126\" x=\"190\" y=\"8\" width=\"4\" height=\"2\" xoffset=\"0\" yoffset=\"4\" xadvance=\"5\" page=\"0\" chnl=\"15\" />\n  </chars>\n  <kernings count=\"66\">\n    <kerning first=\"70\" second=\"100\" amount=\"-1\" />\n    <kerning first=\"70\" second=\"97\" amount=\"-1\" />\n    <kerning first=\"70\" second=\"111\" amount=\"-1\" />\n    <kerning first=\"70\" second=\"112\" amount=\"-1\" />\n    <kerning first=\"70\" second=\"113\" amount=\"-1\" />\n    <kerning first=\"70\" second=\"114\" amount=\"-1\" />\n    <kerning first=\"70\" second=\"115\" amount=\"-1\" />\n    <kerning first=\"70\" second=\"116\" amount=\"-1\" />\n    <kerning first=\"70\" second=\"117\" amount=\"-1\" />\n    <kerning first=\"70\" second=\"109\" amount=\"-1\" />\n    <kerning first=\"70\" second=\"110\" amount=\"-1\" />\n    <kerning first=\"70\" second=\"101\" amount=\"-1\" />\n    <kerning first=\"70\" second=\"121\" amount=\"-1\" />\n    <kerning first=\"70\" second=\"118\" amount=\"-1\" />\n    <kerning first=\"70\" second=\"99\" amount=\"-1\" />\n    <kerning first=\"70\" second=\"103\" amount=\"-1\" />\n    <kerning first=\"70\" second=\"119\" amount=\"-1\" />\n    <kerning first=\"70\" second=\"120\" amount=\"-1\" />\n    <kerning first=\"70\" second=\"122\" amount=\"-1\" />\n    <kerning first=\"70\" second=\"74\" amount=\"-1\" />\n    <kerning first=\"76\" second=\"84\" amount=\"-1\" />\n    <kerning first=\"76\" second=\"86\" amount=\"-1\" />\n    <kerning first=\"76\" second=\"89\" amount=\"-1\" />\n    <kerning first=\"80\" second=\"74\" amount=\"-1\" />\n    <kerning first=\"84\" second=\"100\" amount=\"-1\" />\n    <kerning first=\"84\" second=\"97\" amount=\"-1\" />\n    <kerning first=\"84\" second=\"111\" amount=\"-1\" />\n    <kerning first=\"84\" second=\"112\" amount=\"-1\" />\n    <kerning first=\"84\" second=\"113\" amount=\"-1\" />\n    <kerning first=\"84\" second=\"114\" amount=\"-1\" />\n    <kerning first=\"84\" second=\"115\" amount=\"-1\" />\n    <kerning first=\"84\" second=\"116\" amount=\"-1\" />\n    <kerning first=\"84\" second=\"117\" amount=\"-1\" />\n    <kerning first=\"84\" second=\"109\" amount=\"-1\" />\n    <kerning first=\"84\" second=\"110\" amount=\"-1\" />\n    <kerning first=\"84\" second=\"101\" amount=\"-1\" />\n    <kerning first=\"84\" second=\"121\" amount=\"-1\" />\n    <kerning first=\"84\" second=\"118\" amount=\"-1\" />\n    <kerning first=\"84\" second=\"99\" amount=\"-1\" />\n    <kerning first=\"84\" second=\"103\" amount=\"-1\" />\n    <kerning first=\"84\" second=\"119\" amount=\"-1\" />\n    <kerning first=\"84\" second=\"120\" amount=\"-1\" />\n    <kerning first=\"84\" second=\"122\" amount=\"-1\" />\n    <kerning first=\"84\" second=\"74\" amount=\"-1\" />\n    <kerning first=\"86\" second=\"74\" amount=\"-1\" />\n    <kerning first=\"47\" second=\"47\" amount=\"-2\" />\n    <kerning first=\"89\" second=\"100\" amount=\"-1\" />\n    <kerning first=\"89\" second=\"97\" amount=\"-1\" />\n    <kerning first=\"89\" second=\"111\" amount=\"-1\" />\n    <kerning first=\"89\" second=\"112\" amount=\"-1\" />\n    <kerning first=\"89\" second=\"113\" amount=\"-1\" />\n    <kerning first=\"89\" second=\"114\" amount=\"-1\" />\n    <kerning first=\"89\" second=\"115\" amount=\"-1\" />\n    <kerning first=\"89\" second=\"116\" amount=\"-1\" />\n    <kerning first=\"89\" second=\"117\" amount=\"-1\" />\n    <kerning first=\"89\" second=\"109\" amount=\"-1\" />\n    <kerning first=\"89\" second=\"110\" amount=\"-1\" />\n    <kerning first=\"89\" second=\"101\" amount=\"-1\" />\n    <kerning first=\"89\" second=\"121\" amount=\"-1\" />\n    <kerning first=\"89\" second=\"118\" amount=\"-1\" />\n    <kerning first=\"89\" second=\"99\" amount=\"-1\" />\n    <kerning first=\"89\" second=\"103\" amount=\"-1\" />\n    <kerning first=\"89\" second=\"119\" amount=\"-1\" />\n    <kerning first=\"89\" second=\"120\" amount=\"-1\" />\n    <kerning first=\"89\" second=\"122\" amount=\"-1\" />\n    <kerning first=\"89\" second=\"74\" amount=\"-1\" />\n  </kernings>\n</font>\n"
  },
  {
    "path": "themes/MinimalMobileTheme/assets/images/minimal_mobile.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<TextureAtlas imagePath=\"minimal_mobile.png\">\n\t<!-- Created with Adobe Animate version 19.0.0.326 -->\n\t<!-- http://www.adobe.com/products/animate.html -->\n\t<SubTexture name=\"back-button-disabled-skin0000\" x=\"285\" y=\"34\" width=\"40\" height=\"56\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"back-button-down-skin0000\" x=\"367\" y=\"34\" width=\"40\" height=\"56\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"back-button-up-skin0000\" x=\"326\" y=\"34\" width=\"40\" height=\"56\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-disabled-skin0000\" x=\"146\" y=\"184\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-down-skin0000\" x=\"163\" y=\"184\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"-0.05\"/>\n\t<SubTexture name=\"button-up-skin0000\" x=\"409\" y=\"185\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"call-to-action-button-up-skin0000\" x=\"129\" y=\"184\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"callout-bottom-arrow-skin0000\" x=\"203\" y=\"91\" width=\"54\" height=\"36\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"callout-left-arrow-skin0000\" x=\"482\" y=\"104\" width=\"28\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"callout-right-arrow-skin0000\" x=\"408\" y=\"80\" width=\"36\" height=\"54\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"callout-top-arrow-skin0000\" x=\"260\" y=\"128\" width=\"44\" height=\"28\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"check-disabled-icon0000\" x=\"149\" y=\"122\" width=\"36\" height=\"36\" pivotX=\"0\" pivotY=\"-0.05\"/>\n\t<SubTexture name=\"check-item-renderer-selected-icon0000\" x=\"309\" y=\"146\" width=\"36\" height=\"29\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"check-selected-disabled-icon0000\" x=\"112\" y=\"122\" width=\"36\" height=\"36\" pivotX=\"0\" pivotY=\"-0.05\"/>\n\t<SubTexture name=\"check-selected-up-icon0000\" x=\"223\" y=\"128\" width=\"36\" height=\"36\" pivotX=\"0\" pivotY=\"-0.05\"/>\n\t<SubTexture name=\"check-up-icon0000\" x=\"186\" y=\"128\" width=\"36\" height=\"36\" pivotX=\"0\" pivotY=\"-0.05\"/>\n\t<SubTexture name=\"danger-button-down-skin0000\" x=\"443\" y=\"185\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"-0.05\"/>\n\t<SubTexture name=\"danger-button-up-skin0000\" x=\"426\" y=\"185\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-callout-bottom-arrow-skin0000\" x=\"258\" y=\"91\" width=\"54\" height=\"36\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-callout-left-arrow-skin0000\" x=\"395\" y=\"135\" width=\"28\" height=\"44\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-callout-right-arrow-skin0000\" x=\"313\" y=\"91\" width=\"36\" height=\"54\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-callout-top-arrow-skin0000\" x=\"350\" y=\"136\" width=\"44\" height=\"28\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"danger-pop-up-background-skin0000\" x=\"31\" y=\"159\" width=\"29\" height=\"29\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-cell-renderer-down-skin0000\" x=\"445\" y=\"80\" width=\"6\" height=\"14\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-cell-renderer-selected-up-skin0000\" x=\"395\" y=\"91\" width=\"6\" height=\"14\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-column-drop-indicator-skin0000\" x=\"507\" y=\"92\" width=\"4\" height=\"10\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-column-resize-skin0000\" x=\"402\" y=\"91\" width=\"4\" height=\"10\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-header-divider-skin0000\" x=\"508\" y=\"16\" width=\"2\" height=\"10\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-header-renderer-skin0000\" x=\"453\" y=\"49\" width=\"6\" height=\"6\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-header-sort-ascending-icon0000\" x=\"230\" y=\"188\" width=\"18\" height=\"10\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-header-sort-descending-icon0000\" x=\"343\" y=\"188\" width=\"18\" height=\"10\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"drag-handle-icon0000\" x=\"473\" y=\"149\" width=\"32\" height=\"30\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"face-disabled-skin0000\" x=\"95\" y=\"184\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"face-up-skin0000\" x=\"112\" y=\"184\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"focus-indicator-skin0000\" x=\"369\" y=\"165\" width=\"22\" height=\"22\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"forward-button-disabled-skin0000\" x=\"460\" y=\"1\" width=\"40\" height=\"56\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"forward-button-down-skin0000\" x=\"203\" y=\"34\" width=\"40\" height=\"56\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"forward-button-up-skin0000\" x=\"244\" y=\"34\" width=\"40\" height=\"56\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"full-screen-toggle-button-enter-up-icon0000\" x=\"161\" y=\"159\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"full-screen-toggle-button-exit-up-icon0000\" x=\"186\" y=\"165\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"header-background-skin0000\" x=\"501\" y=\"41\" width=\"6\" height=\"14\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"inset-background-danger-skin0000\" x=\"270\" y=\"182\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"inset-background-disabled-skin0000\" x=\"61\" y=\"184\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"inset-background-enabled-skin0000\" x=\"78\" y=\"184\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"inset-background-focused-skin0000\" x=\"479\" y=\"180\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"item-renderer-down-skin0000\" x=\"498\" y=\"75\" width=\"12\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"item-renderer-selected-up-skin0000\" x=\"498\" y=\"58\" width=\"12\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"item-renderer-up-skin0000\" x=\"506\" y=\"1\" width=\"4\" height=\"14\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"list-accessory-drill-down-icon0000\" x=\"211\" y=\"165\" width=\"18\" height=\"27\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"mute-toggle-button-loud-up-icon0000\" x=\"136\" y=\"159\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"mute-toggle-button-muted-up-icon0000\" x=\"111\" y=\"159\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"overlay-play-pause-toggle-button-play-down-icon0000\" x=\"1\" y=\"1\" width=\"100\" height=\"120\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"overlay-play-pause-toggle-button-play-up-icon0000\" x=\"102\" y=\"1\" width=\"100\" height=\"120\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"page-indicator-selected-symbol0000\" x=\"253\" y=\"182\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"page-indicator-symbol0000\" x=\"287\" y=\"182\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"panel-background-skin0000\" x=\"462\" y=\"180\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"panel-header-background-skin0000\" x=\"501\" y=\"26\" width=\"6\" height=\"14\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"pf_ronda_seven_0\" x=\"203\" y=\"1\" width=\"256\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"picker-list-disabled-icon0000\" x=\"309\" y=\"176\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"picker-list-icon0000\" x=\"326\" y=\"176\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"picker-list-selected-icon0000\" x=\"392\" y=\"180\" width=\"16\" height=\"16\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"play-pause-toggle-button-pause-up-icon0000\" x=\"86\" y=\"159\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"play-pause-toggle-button-play-up-icon0000\" x=\"61\" y=\"159\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"pop-up-background-skin0000\" x=\"1\" y=\"159\" width=\"29\" height=\"29\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"radio-disabled-icon0000\" x=\"38\" y=\"122\" width=\"36\" height=\"36\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"radio-selected-disabled-icon0000\" x=\"445\" y=\"104\" width=\"36\" height=\"36\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"radio-selected-up-icon0000\" x=\"1\" y=\"122\" width=\"36\" height=\"36\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"radio-up-icon0000\" x=\"75\" y=\"122\" width=\"36\" height=\"36\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"search-disabled-icon0000\" x=\"424\" y=\"166\" width=\"18\" height=\"18\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"search-enabled-icon0000\" x=\"443\" y=\"166\" width=\"18\" height=\"18\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"seek-slider-progress-skin0000\" x=\"501\" y=\"1\" width=\"4\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"simple-scroll-bar-thumb-skin0000\" x=\"498\" y=\"92\" width=\"8\" height=\"8\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"spinner-list-selection-overlay-skin0000\" x=\"453\" y=\"34\" width=\"6\" height=\"14\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tab-down-skin0000\" x=\"350\" y=\"91\" width=\"44\" height=\"44\" pivotX=\"0\" pivotY=\"0.05\"/>\n\t<SubTexture name=\"tab-selected-disabled-skin0000\" x=\"408\" y=\"34\" width=\"44\" height=\"45\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tab-selected-up-skin0000\" x=\"453\" y=\"58\" width=\"44\" height=\"45\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tree-disclosure-closed-icon0000\" x=\"230\" y=\"165\" width=\"22\" height=\"22\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tree-disclosure-open-icon0000\" x=\"346\" y=\"165\" width=\"22\" height=\"22\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-scroll-bar-decrement-button-icon0000\" x=\"395\" y=\"106\" width=\"10\" height=\"6\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"vertical-scroll-bar-increment-button-icon0000\" x=\"395\" y=\"113\" width=\"10\" height=\"6\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"volume-slider-maximum-track-skin0000\" x=\"424\" y=\"141\" width=\"48\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"volume-slider-minimum-track-skin0000\" x=\"260\" y=\"157\" width=\"48\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n</TextureAtlas>\n"
  },
  {
    "path": "themes/MinimalMobileTheme/package-src.json",
    "content": "{\n\t\"id\": \"feathersui_MinimalMobileTheme-source\",\n\t\"name\": \"Feathers UI Minimal Mobile Theme\",\n\t\"url\": \"https://feathersui.com/as3-starling/\",\n\t\"docUrl\": \"https://feathersui/api-reference/\",\n\t\"description\": \"Minimal mobile theme for Feathers UI (Starling version)\",\n\t\"type\": \"src\",\n\t\"version\": \"4.2.0\",\n\t\"sourceUrl\": \"https://github.com/feathersui/feathersui-starling/releases/download/v4.2.0/feathersui_MinimalMobileTheme-source_4.2.0.airpackage\",\n\t\"publishedAt\": \"2021-11-19T00:00:00.000Z\",\n\t\"dependencies\": [\n\t\t\"starling-source:2.x.x\",\n\t\t\"feathersui-source:4.2.x\"\n\t],\n\t\"parameters\": [],\n\t\"tags\": [\"theme\", \"feathers\", \"starling\"],\n\t\"status\": \"release\",\n\t\"license\": {\n\t  \"type\": \"Simplified BSD\",\n\t  \"url\": \"https://github.com/feathersui/feathersui-starling/blob/v4.2.0/LICENSE.md\",\n\t  \"public\": true\n\t}\n  }\n  "
  },
  {
    "path": "themes/MinimalMobileTheme/package-swc.json",
    "content": "{\n\t\"id\": \"feathersui_MinimalMobileTheme\",\n\t\"name\": \"Feathers UI Minimal Mobile Theme\",\n\t\"url\": \"https://feathersui.com/as3-starling/\",\n\t\"docUrl\": \"https://feathersui/api-reference/\",\n\t\"description\": \"Minimal mobile theme for Feathers UI (Starling version)\",\n\t\"type\": \"swc\",\n\t\"version\": \"4.2.0\",\n\t\"sourceUrl\": \"https://github.com/feathersui/feathersui-starling/releases/download/v4.2.0/feathersui_MinimalMobileTheme_4.2.0.airpackage\",\n\t\"publishedAt\": \"2021-11-19T00:00:00.000Z\",\n\t\"dependencies\": [\n\t\t\"starling:2.x.x\",\n\t\t\"feathersui:4.2.x\"\n\t],\n\t\"parameters\": [],\n\t\"tags\": [\"theme\", \"feathers\", \"starling\"],\n\t\"status\": \"release\",\n\t\"license\": {\n\t  \"type\": \"Simplified BSD\",\n\t  \"url\": \"https://github.com/feathersui/feathersui-starling/blob/v4.2.0/LICENSE.md\",\n\t  \"public\": true\n\t}\n  }\n  "
  },
  {
    "path": "themes/MinimalMobileTheme/source/feathers/themes/BaseMinimalMobileTheme.as",
    "content": "/*\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n*/\npackage feathers.themes\n{\n\timport feathers.controls.Alert;\n\timport feathers.controls.AutoComplete;\n\timport feathers.controls.AutoSizeMode;\n\timport feathers.controls.Button;\n\timport feathers.controls.ButtonGroup;\n\timport feathers.controls.ButtonState;\n\timport feathers.controls.Callout;\n\timport feathers.controls.Check;\n\timport feathers.controls.DataGrid;\n\timport feathers.controls.DateTimeSpinner;\n\timport feathers.controls.Drawers;\n\timport feathers.controls.GroupedList;\n\timport feathers.controls.Header;\n\timport feathers.controls.ImageLoader;\n\timport feathers.controls.ItemRendererLayoutOrder;\n\timport feathers.controls.Label;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.List;\n\timport feathers.controls.NumericStepper;\n\timport feathers.controls.PageIndicator;\n\timport feathers.controls.Panel;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.PickerList;\n\timport feathers.controls.ProgressBar;\n\timport feathers.controls.Radio;\n\timport feathers.controls.ScrollContainer;\n\timport feathers.controls.ScrollScreen;\n\timport feathers.controls.ScrollText;\n\timport feathers.controls.Scroller;\n\timport feathers.controls.SimpleScrollBar;\n\timport feathers.controls.Slider;\n\timport feathers.controls.SpinnerList;\n\timport feathers.controls.StepperButtonLayoutMode;\n\timport feathers.controls.TabBar;\n\timport feathers.controls.TextArea;\n\timport feathers.controls.TextCallout;\n\timport feathers.controls.TextInput;\n\timport feathers.controls.TextInputState;\n\timport feathers.controls.Toast;\n\timport feathers.controls.ToggleButton;\n\timport feathers.controls.ToggleSwitch;\n\timport feathers.controls.TrackLayoutMode;\n\timport feathers.controls.Tree;\n\timport feathers.controls.popups.BottomDrawerPopUpContentManager;\n\timport feathers.controls.popups.CalloutPopUpContentManager;\n\timport feathers.controls.renderers.BaseDefaultItemRenderer;\n\timport feathers.controls.renderers.DefaultDataGridCellRenderer;\n\timport feathers.controls.renderers.DefaultDataGridHeaderRenderer;\n\timport feathers.controls.renderers.DefaultGroupedListHeaderOrFooterRenderer;\n\timport feathers.controls.renderers.DefaultGroupedListItemRenderer;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.renderers.DefaultTreeItemRenderer;\n\timport feathers.controls.text.BitmapFontTextEditor;\n\timport feathers.controls.text.BitmapFontTextRenderer;\n\timport feathers.controls.text.ITextEditorViewPort;\n\timport feathers.controls.text.StageTextTextEditor;\n\timport feathers.controls.text.TextFieldTextEditorViewPort;\n\timport feathers.core.FeathersControl;\n\timport feathers.core.FocusManager;\n\timport feathers.core.ITextEditor;\n\timport feathers.core.ITextRenderer;\n\timport feathers.core.PopUpManager;\n\timport feathers.layout.Direction;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.HorizontalLayout;\n\timport feathers.layout.RelativePosition;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.media.FullScreenToggleButton;\n\timport feathers.media.MuteToggleButton;\n\timport feathers.media.PlayPauseToggleButton;\n\timport feathers.media.SeekSlider;\n\timport feathers.media.VideoPlayer;\n\timport feathers.media.VolumeSlider;\n\timport feathers.skins.ImageSkin;\n\timport feathers.system.DeviceCapabilities;\n\n\timport flash.geom.Rectangle;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.DisplayObjectContainer;\n\timport starling.display.Image;\n\timport starling.display.Quad;\n\timport starling.display.Stage;\n\timport starling.text.TextField;\n\timport starling.text.TextFormat;\n\timport starling.textures.Texture;\n\timport starling.textures.TextureAtlas;\n\timport starling.textures.TextureSmoothing;\n\n\t/**\n\t * The base class for the \"Minimal\" theme for mobile Feathers apps. Handles\n\t * everything except asset loading, which is left to subclasses.\n\t *\n\t * @see MinimalMobileTheme\n\t * @see MinimalMobileThemeWithAssetManager\n\t */\n\tpublic class BaseMinimalMobileTheme extends StyleNameFunctionTheme\n\t{\n\t\t/**\n\t\t * The name of the embedded bitmap font used by controls in this theme.\n\t\t */\n\t\tpublic static const FONT_NAME:String = \"PF Ronda Seven\";\n\n\t\t/**\n\t\t * The stack of fonts to use for controls that don't use embedded fonts.\n\t\t */\n\t\tpublic static const FONT_NAME_STACK:String = \"PF Ronda Seven,Roboto,Helvetica,Arial,_sans\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for item renderers in a SpinnerList.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_SPINNER_LIST_ITEM_RENDERER:String = \"minimal-mobile-spinner-list-item-renderer\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the minimum track of a horizontal slider.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_HORIZONTAL_SLIDER_MINIMUM_TRACK:String = \"minimal-mobile-horizontal-slider-minimum-track\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the minimum track of a vertical slider.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_VERTICAL_SLIDER_MINIMUM_TRACK:String = \"minimal-mobile-vertical-slider-minimum-track\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for the item renderer of the\n\t\t * SpinnerList in a DateTimeSpinner.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_DATE_TIME_SPINNER_LIST_ITEM_RENDERER:String = \"minimal-mobile-date-time-spinner-list-item-renderer\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for item renderers in a PickerList.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_TABLET_PICKER_LIST_ITEM_RENDERER:String = \"minimal-mobile-tablet-picker-list-item-renderer\";\n\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for a button in an Alert's button group.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_ALERT_BUTTON_GROUP_BUTTON:String = \"minimal-mobile-alert-button-group-button\";\n\t\t\n\t\t/**\n\t\t * @private\n\t\t * The theme's custom style name for a button in a Toast.\n\t\t */\n\t\tprotected static const THEME_STYLE_NAME_TOAST_ACTIONS_BUTTON:String = \"minimal-mobile-toast-actions-button\";\n\n\t\tprotected static const FONT_TEXTURE_NAME:String = \"pf_ronda_seven_0\";\n\n\t\tprotected static const DEFAULT_SCALE_9_GRID:Rectangle = new Rectangle(4, 4, 1, 1);\n\t\tprotected static const SCROLLBAR_THUMB_SCALE_9_GRID:Rectangle = new Rectangle(1, 1, 2, 2);\n\t\tprotected static const ITEM_RENDERER_SCALE_9_GRID:Rectangle = new Rectangle(1, 3, 1, 1);\n\t\tprotected static const TAB_SCALE_9_GRID:Rectangle = new Rectangle(11, 11, 1, 1);\n\t\tprotected static const HEADER_SCALE_9_GRID:Rectangle = new Rectangle(1, 3, 1, 1);\n\t\tprotected static const SPINNER_LIST_SELECTION_OVERLAY_SCALE9_GRID:Rectangle = new Rectangle(1, 3, 1, 1);\n\t\tprotected static const SEEK_SLIDER_PROGRESS_SKIN_SCALE9_GRID:Rectangle = new Rectangle(0, 2, 2, 10);\n\t\tprotected static const BACK_BUTTON_SCALE9_GRID:Rectangle = new Rectangle(16, 0, 1, 28);\n\t\tprotected static const FORWARD_BUTTON_SCALE9_GRID:Rectangle = new Rectangle(3, 0, 1, 28);\n\t\tprotected static const FOCUS_INDICATOR_SCALE_9_GRID:Rectangle = new Rectangle(5, 5, 1, 1);\n\t\tprotected static const DATA_GRID_HEADER_DIVIDER_SCALE_9_GRID:Rectangle = new Rectangle(0, 1, 4, 3);\n\t\tprotected static const DATA_GRID_HEADER_RENDERER_SCALE_9_GRID:Rectangle = new Rectangle(1, 1, 1, 1);\n\t\tprotected static const DATA_GRID_COLUMN_RESIZE_SKIN_SCALE_9_GRID:Rectangle = new Rectangle(0, 1, 2, 3);\n\t\tprotected static const DATA_GRID_COLUMN_DROP_INDICATOR_SCALE_9_GRID:Rectangle = new Rectangle(0, 1, 2, 3);\n\n\t\tprotected static const BACKGROUND_COLOR:uint = 0xf3f3f3;\n\t\tprotected static const LIST_BACKGROUND_COLOR:uint = 0xf8f8f8;\n\t\tprotected static const LIST_HEADER_BACKGROUND_COLOR:uint = 0xeeeeee;\n\t\tprotected static const DRAWERS_DIVIDER_COLOR:uint = 0xebebeb;\n\t\tprotected static const PRIMARY_TEXT_COLOR:uint = 0x666666;\n\t\tprotected static const DISABLED_TEXT_COLOR:uint = 0x999999;\n\t\tprotected static const DANGER_TEXT_COLOR:uint = 0x990000;\n\t\tprotected static const MODAL_OVERLAY_COLOR:uint = 0xcccccc;\n\t\tprotected static const MODAL_OVERLAY_ALPHA:Number = 0.4;\n\t\tprotected static const VIDEO_OVERLAY_COLOR:uint = 0xcccccc;\n\t\tprotected static const VIDEO_OVERLAY_ALPHA:Number = 0.2;\n\t\tprotected static const DATA_GRID_COLUMN_OVERLAY_COLOR:uint = 0xeeeeee;\n\t\tprotected static const DATA_GRID_COLUMN_OVERLAY_ALPHA:Number = 0.6;\n\n\t\t/**\n\t\t * The default global text renderer factory for this theme creates a\n\t\t * BitmapFontTextRenderer.\n\t\t */\n\t\tprotected static function textRendererFactory():ITextRenderer\n\t\t{\n\t\t\tvar renderer:BitmapFontTextRenderer = new BitmapFontTextRenderer();\n\t\t\t//since it's a pixel font, we don't want to smooth it.\n\t\t\trenderer.textureSmoothing = TextureSmoothing.NONE;\n\t\t\treturn renderer;\n\t\t}\n\n\t\t/**\n\t\t * The default global text editor factory for this theme creates a\n\t\t * StageTextTextEditor.\n\t\t */\n\t\tprotected static function textEditorFactory():ITextEditor\n\t\t{\n\t\t\treturn new StageTextTextEditor();\n\t\t}\n\n\t\t/**\n\t\t * The text editor factory for a TextArea creates a\n\t\t * TextFieldTextEditorViewPort.\n\t\t */\n\t\tprotected static function textAreaTextEditorFactory():ITextEditorViewPort\n\t\t{\n\t\t\treturn new TextFieldTextEditorViewPort();\n\t\t}\n\n\t\t/**\n\t\t * The text editor factory for a NumericStepper creates a\n\t\t * BitmapFontTextEditor.\n\t\t */\n\t\tprotected static function numericStepperTextEditorFactory():BitmapFontTextEditor\n\t\t{\n\t\t\t//we're only using this text editor in the NumericStepper because\n\t\t\t//isEditable is false on the TextInput. this text editor is not\n\t\t\t//suitable for mobile use if the TextInput needs to be editable\n\t\t\t//because it can't use the soft keyboard or other mobile-friendly UI\n\t\t\tvar editor:BitmapFontTextEditor = new BitmapFontTextEditor();\n\t\t\t//since it's a pixel font, we don't want to smooth it.\n\t\t\teditor.textureSmoothing = TextureSmoothing.NONE;\n\t\t\treturn editor;\n\t\t}\n\n\t\tprotected static function pickerListButtonFactory():ToggleButton\n\t\t{\n\t\t\treturn new ToggleButton();\n\t\t}\n\t\t\n\t\tprotected static function pickerListSpinnerListFactory():SpinnerList\n\t\t{\n\t\t\treturn new SpinnerList();\n\t\t}\n\n\t\tprotected static function popUpOverlayFactory():DisplayObject\n\t\t{\n\t\t\tvar quad:Quad = new Quad(100, 100, MODAL_OVERLAY_COLOR);\n\t\t\tquad.alpha = MODAL_OVERLAY_ALPHA;\n\t\t\treturn quad;\n\t\t}\n\n\t\t/**\n\t\t * This theme's scroll bar type is SimpleScrollBar.\n\t\t */\n\t\tprotected static function scrollBarFactory():SimpleScrollBar\n\t\t{\n\t\t\treturn new SimpleScrollBar();\n\t\t}\n\n\t\t/**\n\t\t * Constructor.\n\t\t *\n\t\t * @param scaleToDPI Determines if the theme's skins will be scaled based on the screen density and content scale factor.\n\t\t */\n\t\tpublic function BaseMinimalMobileTheme()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\t/**\n\t\t * A normal font size.\n\t\t */\n\t\tprotected var fontSize:int = 12;\n\n\t\t/**\n\t\t * A larger font size for headers.\n\t\t */\n\t\tprotected var largeFontSize:int = 16;\n\n\t\t/**\n\t\t * A smaller font size for details.\n\t\t */\n\t\tprotected var smallFontSize:int = 8;\n\n\t\t/**\n\t\t * The texture atlas that contains skins for this theme. This base class\n\t\t * does not initialize this member variable. Subclasses are expected to\n\t\t * load the assets somehow and set the <code>atlas</code> member\n\t\t * variable before calling <code>initialize()</code>.\n\t\t */\n\t\tprotected var atlas:TextureAtlas;\n\n\t\tprotected var focusIndicatorSkinTexture:Texture;\n\n\t\tprotected var buttonUpSkinTexture:Texture;\n\t\tprotected var buttonDownSkinTexture:Texture;\n\t\tprotected var buttonDisabledSkinTexture:Texture;\n\t\tprotected var buttonSelectedSkinTexture:Texture;\n\t\tprotected var buttonSelectedDisabledSkinTexture:Texture;\n\t\tprotected var buttonCallToActionUpSkinTexture:Texture;\n\t\tprotected var buttonDangerUpSkinTexture:Texture;\n\t\tprotected var buttonDangerDownSkinTexture:Texture;\n\t\tprotected var buttonBackUpSkinTexture:Texture;\n\t\tprotected var buttonBackDownSkinTexture:Texture;\n\t\tprotected var buttonBackDisabledSkinTexture:Texture;\n\t\tprotected var buttonForwardUpSkinTexture:Texture;\n\t\tprotected var buttonForwardDownSkinTexture:Texture;\n\t\tprotected var buttonForwardDisabledSkinTexture:Texture;\n\n\t\tprotected var tabDownSkinTexture:Texture;\n\t\tprotected var tabSelectedSkinTexture:Texture;\n\t\tprotected var tabSelectedDisabledSkinTexture:Texture;\n\n\t\tprotected var thumbSkinTexture:Texture;\n\t\tprotected var thumbDisabledSkinTexture:Texture;\n\n\t\tprotected var scrollBarThumbSkinTexture:Texture;\n\n\t\tprotected var insetBackgroundSkinTexture:Texture;\n\t\tprotected var insetBackgroundDisabledSkinTexture:Texture;\n\t\tprotected var insetBackgroundFocusedSkinTexture:Texture;\n\t\tprotected var insetBackgroundDangerSkinTexture:Texture;\n\n\t\tprotected var pickerListButtonIconUpTexture:Texture;\n\t\tprotected var pickerListButtonIconSelectedTexture:Texture;\n\t\tprotected var pickerListButtonIconDisabledTexture:Texture;\n\t\tprotected var searchIconTexture:Texture;\n\t\tprotected var searchIconDisabledTexture:Texture;\n\n\t\tprotected var itemRendererUpSkinTexture:Texture;\n\t\tprotected var itemRendererDownSkinTexture:Texture;\n\t\tprotected var itemRendererSelectedUpSkinTexture:Texture;\n\t\tprotected var checkItemRendererSelectedIconTexture:Texture;\n\t\tprotected var spinnerListSelectionOverlaySkinTexture:Texture;\n\t\tprotected var dragHandleIcon:Texture;\n\n\t\tprotected var headerSkinTexture:Texture;\n\t\tprotected var panelHeaderSkinTexture:Texture;\n\n\t\tprotected var panelBackgroundSkinTexture:Texture;\n\t\tprotected var popUpBackgroundSkinTexture:Texture;\n\t\tprotected var dangerPopUpBackgroundSkinTexture:Texture;\n\t\tprotected var calloutTopArrowSkinTexture:Texture;\n\t\tprotected var calloutBottomArrowSkinTexture:Texture;\n\t\tprotected var calloutLeftArrowSkinTexture:Texture;\n\t\tprotected var calloutRightArrowSkinTexture:Texture;\n\t\tprotected var dangerCalloutTopArrowSkinTexture:Texture;\n\t\tprotected var dangerCalloutBottomArrowSkinTexture:Texture;\n\t\tprotected var dangerCalloutLeftArrowSkinTexture:Texture;\n\t\tprotected var dangerCalloutRightArrowSkinTexture:Texture;\n\n\t\tprotected var checkIconTexture:Texture;\n\t\tprotected var checkDisabledIconTexture:Texture;\n\t\tprotected var checkSelectedIconTexture:Texture;\n\t\tprotected var checkSelectedDisabledIconTexture:Texture;\n\n\t\tprotected var radioIconTexture:Texture;\n\t\tprotected var radioDisabledIconTexture:Texture;\n\t\tprotected var radioSelectedIconTexture:Texture;\n\t\tprotected var radioSelectedDisabledIconTexture:Texture;\n\n\t\tprotected var pageIndicatorNormalSkinTexture:Texture;\n\t\tprotected var pageIndicatorSelectedSkinTexture:Texture;\n\n\t\t//media textures\n\t\tprotected var playPauseButtonPlayUpIconTexture:Texture;\n\t\tprotected var playPauseButtonPauseUpIconTexture:Texture;\n\t\tprotected var overlayPlayPauseButtonPlayUpIconTexture:Texture;\n\t\tprotected var fullScreenToggleButtonEnterUpIconTexture:Texture;\n\t\tprotected var fullScreenToggleButtonExitUpIconTexture:Texture;\n\t\tprotected var muteToggleButtonLoudUpIconTexture:Texture;\n\t\tprotected var muteToggleButtonMutedUpIconTexture:Texture;\n\t\tprotected var seekSliderProgressSkinTexture:Texture;\n\t\tprotected var volumeSliderMinimumTrackSkinTexture:Texture;\n\t\tprotected var volumeSliderMaximumTrackSkinTexture:Texture;\n\t\t\n\t\tprotected var listDrillDownAccessoryTexture:Texture;\n\n\t\tprotected var treeDisclosureOpenIconTexture:Texture;\n\t\tprotected var treeDisclosureClosedIconTexture:Texture;\n\n\t\tprotected var dataGridHeaderRendererSkinTexture:Texture;\n\t\tprotected var dataGridHeaderDividerSkinTexture:Texture;\n\t\tprotected var dataGridColumnResizeSkinTexture:Texture;\n\t\tprotected var dataGridColumnDropIndicatorSkinTexture:Texture;\n\t\tprotected var dataGridHeaderSortDescendingIconTexture:Texture;\n\t\tprotected var dataGridHeaderSortAscendingIconTexture:Texture;\n\t\tprotected var dataGridCellRendererDownSkinTexture:Texture;\n\t\tprotected var dataGridCellRendererSelectedUpSkinTexture:Texture;\n\n\t\t/**\n\t\t * The size, in pixels, of major regions in the grid. Used for sizing\n\t\t * containers and larger UI controls.\n\t\t */\n\t\tprotected var gridSize:int = 44;\n\n\t\t/**\n\t\t * The size, in pixels, of minor regions in the grid. Used for larger\n\t\t * padding and gaps.\n\t\t */\n\t\tprotected var gutterSize:int = 11;\n\n\t\t/**\n\t\t * The size, in pixels, of smaller padding and gaps within the major\n\t\t * regions in the grid.\n\t\t */\n\t\tprotected var smallGutterSize:int = 6;\n\n\t\t/**\n\t\t * The width, in pixels, of UI controls that span across multiple grid regions.\n\t\t */\n\t\tprotected var wideControlSize:int = 154;\n\n\t\t/**\n\t\t * The width, in pixels, of very large UI controls.\n\t\t */\n\t\tprotected var extraWideControlSize:int = 308;\n\n\t\t/**\n\t\t * The size, in pixels, of a typical UI control.\n\t\t */\n\t\tprotected var controlSize:int = 30;\n\n\t\t/**\n\t\t * The size, in pixels, of smaller UI controls.\n\t\t */\n\t\tprotected var smallControlSize:int = 16;\n\n\t\t/**\n\t\t * The size, in pixels, of a UI control's border.\n\t\t */\n\t\tprotected var borderSize:int = 2;\n\n\t\tprotected var simpleScrollBarThumbSize:int = 4;\n\t\tprotected var calloutBackgroundMinSize:int = 6;\n\t\tprotected var calloutBottomRightArrowOverlapGapSize:Number = -10.5;\n\t\tprotected var calloutTopLeftArrowOverlapGapSize:int = -4;\n\t\tprotected var popUpFillSize:int = 276;\n\t\tprotected var dropShadowSize:int = 6;\n\t\tprotected var focusPaddingSize:int = -4;\n\t\tprotected var tabFocusPaddingSize:int = 4;\n\n\t\tprotected var primaryFontStyles:TextFormat;\n\t\tprotected var disabledFontStyles:TextFormat;\n\t\tprotected var centeredFontStyles:TextFormat;\n\t\tprotected var centeredDisabledFontStyles:TextFormat;\n\t\tprotected var headingFontStyles:TextFormat;\n\t\tprotected var headingDisabledFontStyles:TextFormat;\n\t\tprotected var detailFontStyles:TextFormat;\n\t\tprotected var detailDisabledFontStyles:TextFormat;\n\t\tprotected var dangerFontStyles:TextFormat;\n\t\tprotected var scrollTextFontStyles:TextFormat;\n\t\tprotected var scrollTextDisabledFontStyles:TextFormat;\n\n\t\t/**\n\t\t * Disposes the texture atlas and bitmap font before calling\n\t\t * super.dispose().\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this.atlas)\n\t\t\t{\n\t\t\t\t//if anything is keeping a reference to the texture, we don't\n\t\t\t\t//want it to keep a reference to the theme too.\n\t\t\t\tthis.atlas.texture.root.onRestore = null;\n\n\t\t\t\tthis.atlas.dispose();\n\t\t\t\tthis.atlas = null;\n\t\t\t}\n\t\t\tTextField.unregisterCompositor(FONT_NAME);\n\n\t\t\t//don't forget to call super.dispose()!\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * Initializes the theme. Expected to be called by subclasses after the\n\t\t * assets have been loaded and the skin texture atlas has been created.\n\t\t */\n\t\tprotected function initialize():void\n\t\t{\n\t\t\tthis.initializeTextures();\n\t\t\tthis.initializeFonts();\n\t\t\tthis.initializeGlobals();\n\t\t\tthis.initializeStage();\n\t\t\tthis.initializeStyleProviders();\n\t\t}\n\n\t\t/**\n\t\t * Sets the stage background color.\n\t\t */\n\t\tprotected function initializeStage():void\n\t\t{\n\t\t\tthis.starling.stage.color = BACKGROUND_COLOR;\n\t\t\tthis.starling.nativeStage.color = BACKGROUND_COLOR;\n\t\t}\n\n\t\t/**\n\t\t * Initializes global variables (not including global style providers).\n\t\t */\n\t\tprotected function initializeGlobals():void\n\t\t{\n\t\t\tPopUpManager.overlayFactory = popUpOverlayFactory;\n\t\t\tCallout.stagePadding = this.smallGutterSize;\n\t\t\tToast.containerFactory = toastContainerFactory;\n\n\t\t\tFeathersControl.defaultTextRendererFactory = textRendererFactory;\n\t\t\tFeathersControl.defaultTextEditorFactory = textEditorFactory;\n\n\t\t\tvar stage:Stage = this.starling.stage;\n\t\t\tFocusManager.setEnabledForStage(stage, true);\n\t\t}\n\n\t\t/**\n\t\t * Initializes the textures by extracting them from the atlas and\n\t\t * setting up any scaling grids that are needed.\n\t\t */\n\t\tprotected function initializeTextures():void\n\t\t{\n\t\t\tthis.focusIndicatorSkinTexture = this.atlas.getTexture(\"focus-indicator-skin0000\");\n\n\t\t\tthis.buttonUpSkinTexture = this.atlas.getTexture(\"button-up-skin0000\");\n\t\t\tthis.buttonDownSkinTexture = this.atlas.getTexture(\"button-down-skin0000\");\n\t\t\tthis.buttonDisabledSkinTexture = this.atlas.getTexture(\"button-disabled-skin0000\");\n\t\t\tthis.buttonSelectedSkinTexture = this.atlas.getTexture(\"inset-background-enabled-skin0000\");\n\t\t\tthis.buttonSelectedDisabledSkinTexture = this.atlas.getTexture(\"inset-background-disabled-skin0000\");\n\t\t\tthis.buttonCallToActionUpSkinTexture = this.atlas.getTexture(\"call-to-action-button-up-skin0000\");\n\t\t\tthis.buttonDangerUpSkinTexture = this.atlas.getTexture(\"danger-button-up-skin0000\");\n\t\t\tthis.buttonDangerDownSkinTexture = this.atlas.getTexture(\"danger-button-down-skin0000\");\n\t\t\tthis.buttonBackUpSkinTexture = this.atlas.getTexture(\"back-button-up-skin0000\");\n\t\t\tthis.buttonBackDownSkinTexture = this.atlas.getTexture(\"back-button-down-skin0000\");\n\t\t\tthis.buttonBackDisabledSkinTexture = this.atlas.getTexture(\"back-button-disabled-skin0000\");\n\t\t\tthis.buttonForwardUpSkinTexture = this.atlas.getTexture(\"forward-button-up-skin0000\");\n\t\t\tthis.buttonForwardDownSkinTexture = this.atlas.getTexture(\"forward-button-down-skin0000\");\n\t\t\tthis.buttonForwardDisabledSkinTexture = this.atlas.getTexture(\"forward-button-disabled-skin0000\");\n\n\t\t\tthis.tabDownSkinTexture = this.atlas.getTexture(\"tab-down-skin0000\");\n\t\t\tthis.tabSelectedSkinTexture = this.atlas.getTexture(\"tab-selected-up-skin0000\");\n\t\t\tthis.tabSelectedDisabledSkinTexture = this.atlas.getTexture(\"tab-selected-disabled-skin0000\");\n\n\t\t\tthis.thumbSkinTexture = this.atlas.getTexture(\"face-up-skin0000\");\n\t\t\tthis.thumbDisabledSkinTexture = this.atlas.getTexture(\"face-disabled-skin0000\");\n\n\t\t\tthis.scrollBarThumbSkinTexture = this.atlas.getTexture(\"simple-scroll-bar-thumb-skin0000\");\n\n\t\t\tthis.insetBackgroundSkinTexture = this.atlas.getTexture(\"inset-background-enabled-skin0000\");\n\t\t\tthis.insetBackgroundDisabledSkinTexture = this.atlas.getTexture(\"inset-background-disabled-skin0000\");\n\t\t\tthis.insetBackgroundFocusedSkinTexture = this.atlas.getTexture(\"inset-background-focused-skin0000\");\n\t\t\tthis.insetBackgroundDangerSkinTexture = this.atlas.getTexture(\"inset-background-danger-skin0000\");\n\n\t\t\tthis.pickerListButtonIconUpTexture = this.atlas.getTexture(\"picker-list-icon0000\");\n\t\t\tthis.pickerListButtonIconSelectedTexture = this.atlas.getTexture(\"picker-list-selected-icon0000\");\n\t\t\tthis.pickerListButtonIconDisabledTexture = this.atlas.getTexture(\"picker-list-disabled-icon0000\");\n\t\t\tthis.searchIconTexture = this.atlas.getTexture(\"search-enabled-icon0000\");\n\t\t\tthis.searchIconDisabledTexture = this.atlas.getTexture(\"search-disabled-icon0000\");\n\n\t\t\tthis.itemRendererUpSkinTexture = this.atlas.getTexture(\"item-renderer-up-skin0000\");\n\t\t\tthis.itemRendererDownSkinTexture = this.atlas.getTexture(\"item-renderer-down-skin0000\");\n\t\t\tthis.itemRendererSelectedUpSkinTexture = this.atlas.getTexture(\"item-renderer-selected-up-skin0000\");\n\t\t\tthis.checkItemRendererSelectedIconTexture = this.atlas.getTexture(\"check-item-renderer-selected-icon0000\");\n\n\t\t\tthis.spinnerListSelectionOverlaySkinTexture = this.atlas.getTexture(\"spinner-list-selection-overlay-skin0000\");\n\n\t\t\tthis.dragHandleIcon = this.atlas.getTexture(\"drag-handle-icon0000\");\n\n\t\t\tthis.headerSkinTexture = this.atlas.getTexture(\"header-background-skin0000\");\n\t\t\tthis.panelHeaderSkinTexture = this.atlas.getTexture(\"panel-header-background-skin0000\");\n\n\t\t\tthis.panelBackgroundSkinTexture = this.atlas.getTexture(\"panel-background-skin0000\");\n\t\t\tthis.popUpBackgroundSkinTexture = this.atlas.getTexture(\"pop-up-background-skin0000\");\n\t\t\tthis.dangerPopUpBackgroundSkinTexture = this.atlas.getTexture(\"danger-pop-up-background-skin0000\");\n\t\t\tthis.calloutTopArrowSkinTexture = this.atlas.getTexture(\"callout-top-arrow-skin0000\");\n\t\t\tthis.calloutBottomArrowSkinTexture = this.atlas.getTexture(\"callout-bottom-arrow-skin0000\");\n\t\t\tthis.calloutLeftArrowSkinTexture = this.atlas.getTexture(\"callout-left-arrow-skin0000\");\n\t\t\tthis.calloutRightArrowSkinTexture = this.atlas.getTexture(\"callout-right-arrow-skin0000\");\n\t\t\tthis.dangerCalloutTopArrowSkinTexture = this.atlas.getTexture(\"danger-callout-top-arrow-skin0000\");\n\t\t\tthis.dangerCalloutBottomArrowSkinTexture = this.atlas.getTexture(\"danger-callout-bottom-arrow-skin0000\");\n\t\t\tthis.dangerCalloutLeftArrowSkinTexture = this.atlas.getTexture(\"danger-callout-left-arrow-skin0000\");\n\t\t\tthis.dangerCalloutRightArrowSkinTexture = this.atlas.getTexture(\"danger-callout-right-arrow-skin0000\");\n\n\t\t\tthis.checkIconTexture = this.atlas.getTexture(\"check-up-icon0000\");\n\t\t\tthis.checkDisabledIconTexture = this.atlas.getTexture(\"check-disabled-icon0000\");\n\t\t\tthis.checkSelectedIconTexture = this.atlas.getTexture(\"check-selected-up-icon0000\");\n\t\t\tthis.checkSelectedDisabledIconTexture = this.atlas.getTexture(\"check-selected-disabled-icon0000\");\n\n\t\t\tthis.radioIconTexture = this.atlas.getTexture(\"radio-up-icon0000\");\n\t\t\tthis.radioDisabledIconTexture = this.atlas.getTexture(\"radio-disabled-icon0000\");\n\t\t\tthis.radioSelectedIconTexture = this.atlas.getTexture(\"radio-selected-up-icon0000\");\n\t\t\tthis.radioSelectedDisabledIconTexture = this.atlas.getTexture(\"radio-selected-disabled-icon0000\");\n\n\t\t\tthis.pageIndicatorNormalSkinTexture = this.atlas.getTexture(\"page-indicator-symbol0000\");\n\t\t\tthis.pageIndicatorSelectedSkinTexture = this.atlas.getTexture(\"page-indicator-selected-symbol0000\");\n\n\t\t\tthis.playPauseButtonPlayUpIconTexture = this.atlas.getTexture(\"play-pause-toggle-button-play-up-icon0000\");\n\t\t\tthis.playPauseButtonPauseUpIconTexture = this.atlas.getTexture(\"play-pause-toggle-button-pause-up-icon0000\");\n\t\t\tthis.overlayPlayPauseButtonPlayUpIconTexture = this.atlas.getTexture(\"overlay-play-pause-toggle-button-play-up-icon0000\");\n\t\t\tthis.fullScreenToggleButtonEnterUpIconTexture = this.atlas.getTexture(\"full-screen-toggle-button-enter-up-icon0000\");\n\t\t\tthis.fullScreenToggleButtonExitUpIconTexture = this.atlas.getTexture(\"full-screen-toggle-button-exit-up-icon0000\");\n\t\t\tthis.muteToggleButtonMutedUpIconTexture = this.atlas.getTexture(\"mute-toggle-button-muted-up-icon0000\");\n\t\t\tthis.muteToggleButtonLoudUpIconTexture = this.atlas.getTexture(\"mute-toggle-button-loud-up-icon0000\");\n\t\t\tthis.volumeSliderMinimumTrackSkinTexture = this.atlas.getTexture(\"volume-slider-minimum-track-skin0000\");\n\t\t\tthis.volumeSliderMaximumTrackSkinTexture = this.atlas.getTexture(\"volume-slider-maximum-track-skin0000\");\n\t\t\tthis.seekSliderProgressSkinTexture = this.atlas.getTexture(\"seek-slider-progress-skin0000\");\n\n\t\t\tthis.listDrillDownAccessoryTexture = this.atlas.getTexture(\"list-accessory-drill-down-icon0000\");\n\n\t\t\tthis.treeDisclosureOpenIconTexture = this.atlas.getTexture(\"tree-disclosure-open-icon0000\");\n\t\t\tthis.treeDisclosureClosedIconTexture = this.atlas.getTexture(\"tree-disclosure-closed-icon0000\");\n\n\t\t\tthis.dataGridHeaderRendererSkinTexture = this.atlas.getTexture(\"data-grid-header-renderer-skin0000\");\n\t\t\tthis.dataGridHeaderDividerSkinTexture = this.atlas.getTexture(\"data-grid-header-divider-skin0000\");\n\t\t\tthis.dataGridColumnResizeSkinTexture = this.atlas.getTexture(\"data-grid-column-resize-skin0000\");\n\t\t\tthis.dataGridColumnDropIndicatorSkinTexture = this.atlas.getTexture(\"data-grid-column-drop-indicator-skin0000\");\n\t\t\tthis.dataGridHeaderSortDescendingIconTexture = this.atlas.getTexture(\"data-grid-header-sort-descending-icon0000\");\n\t\t\tthis.dataGridHeaderSortAscendingIconTexture = this.atlas.getTexture(\"data-grid-header-sort-ascending-icon0000\");\n\t\t\tthis.dataGridCellRendererDownSkinTexture = this.atlas.getTexture(\"data-grid-cell-renderer-down-skin0000\");\n\t\t\tthis.dataGridCellRendererSelectedUpSkinTexture = this.atlas.getTexture(\"data-grid-cell-renderer-selected-up-skin0000\");\n\t\t}\n\n\t\t/**\n\t\t * Initializes font sizes and formats.\n\t\t */\n\t\tprotected function initializeFonts():void\n\t\t{\n\t\t\tthis.primaryFontStyles = new TextFormat(FONT_NAME, this.fontSize, PRIMARY_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.disabledFontStyles = new TextFormat(FONT_NAME, this.fontSize, DISABLED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.centeredFontStyles = new TextFormat(FONT_NAME, this.fontSize, PRIMARY_TEXT_COLOR, HorizontalAlign.CENTER, VerticalAlign.TOP);\n\t\t\tthis.centeredDisabledFontStyles = new TextFormat(FONT_NAME, this.fontSize, DISABLED_TEXT_COLOR, HorizontalAlign.CENTER, VerticalAlign.TOP);\n\t\t\tthis.headingFontStyles = new TextFormat(FONT_NAME, this.largeFontSize, PRIMARY_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.headingDisabledFontStyles = new TextFormat(FONT_NAME, this.largeFontSize, DISABLED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.detailFontStyles = new TextFormat(FONT_NAME, this.smallFontSize, PRIMARY_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.detailDisabledFontStyles = new TextFormat(FONT_NAME, this.smallFontSize, DISABLED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.dangerFontStyles = new TextFormat(FONT_NAME, this.fontSize, DANGER_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.scrollTextFontStyles = new TextFormat(FONT_NAME_STACK, this.fontSize, PRIMARY_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.scrollTextDisabledFontStyles = new TextFormat(FONT_NAME_STACK, this.fontSize, DISABLED_TEXT_COLOR, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t}\n\n\t\t/**\n\t\t * Sets global style providers for all components.\n\t\t */\n\t\tprotected function initializeStyleProviders():void\n\t\t{\n\t\t\t//alert\n\t\t\tthis.getStyleProviderForClass(Alert).defaultStyleFunction = this.setAlertStyles;\n\t\t\tthis.getStyleProviderForClass(Header).setFunctionForStyleName(Alert.DEFAULT_CHILD_STYLE_NAME_HEADER, this.setPanelHeaderStyles);\n\t\t\tthis.getStyleProviderForClass(ButtonGroup).setFunctionForStyleName(Alert.DEFAULT_CHILD_STYLE_NAME_BUTTON_GROUP, this.setAlertButtonGroupStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_ALERT_BUTTON_GROUP_BUTTON, this.setAlertButtonGroupButtonStyles);\n\n\t\t\t//auto-complete\n\t\t\tthis.getStyleProviderForClass(AutoComplete).defaultStyleFunction = this.setTextInputStyles;\n\t\t\tthis.getStyleProviderForClass(List).setFunctionForStyleName(AutoComplete.DEFAULT_CHILD_STYLE_NAME_LIST, this.setDropDownListStyles);\n\n\t\t\t//button\n\t\t\tthis.getStyleProviderForClass(Button).defaultStyleFunction = this.setButtonStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_CALL_TO_ACTION_BUTTON, this.setCallToActionButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_QUIET_BUTTON, this.setQuietButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_DANGER_BUTTON, this.setDangerButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON, this.setBackButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_FORWARD_BUTTON, this.setForwardButtonStyles);\n\n\t\t\t//button group\n\t\t\tthis.getStyleProviderForClass(ButtonGroup).defaultStyleFunction = this.setButtonGroupStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(ButtonGroup.DEFAULT_CHILD_STYLE_NAME_BUTTON, this.setButtonGroupButtonStyles);\n\t\t\tthis.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(ButtonGroup.DEFAULT_CHILD_STYLE_NAME_BUTTON, this.setButtonGroupButtonStyles);\n\n\t\t\t//callout\n\t\t\tthis.getStyleProviderForClass(Callout).defaultStyleFunction = this.setCalloutStyles;\n\n\t\t\t//check\n\t\t\tthis.getStyleProviderForClass(Check).defaultStyleFunction = this.setCheckStyles;\n\n\t\t\t//data grid\n\t\t\tthis.getStyleProviderForClass(DataGrid).defaultStyleFunction = this.setDataGridStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultDataGridHeaderRenderer).defaultStyleFunction = this.setDataGridHeaderRendererStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultDataGridCellRenderer).defaultStyleFunction = this.setDataGridCellRendererStyles;\n\n\t\t\t//date time spinner\n\t\t\tthis.getStyleProviderForClass(DateTimeSpinner).defaultStyleFunction = this.setDateTimeSpinnerStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).setFunctionForStyleName(THEME_STYLE_NAME_DATE_TIME_SPINNER_LIST_ITEM_RENDERER, this.setDateTimeSpinnerListItemRendererStyles);\n\n\t\t\t//drawers\n\t\t\tthis.getStyleProviderForClass(Drawers).defaultStyleFunction = this.setDrawersStyles;\n\n\t\t\t//grouped list (see also: item renderers)\n\t\t\tthis.getStyleProviderForClass(GroupedList).defaultStyleFunction = this.setGroupedListStyles;\n\t\t\tthis.getStyleProviderForClass(GroupedList).setFunctionForStyleName(GroupedList.ALTERNATE_STYLE_NAME_INSET_GROUPED_LIST, this.setInsetGroupedListStyles);\n\n\t\t\t//header\n\t\t\tthis.getStyleProviderForClass(Header).defaultStyleFunction = this.setHeaderStyles;\n\n\t\t\t//item renderers for lists\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).defaultStyleFunction = this.setListItemRendererStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).setFunctionForStyleName(DefaultListItemRenderer.ALTERNATE_STYLE_NAME_DRILL_DOWN, this.setDrillDownItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).setFunctionForStyleName(DefaultListItemRenderer.ALTERNATE_STYLE_NAME_CHECK, this.setCheckItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).setFunctionForStyleName(THEME_STYLE_NAME_SPINNER_LIST_ITEM_RENDERER, this.setSpinnerListItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListItemRenderer).defaultStyleFunction = this.setItemRendererStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListItemRenderer).setFunctionForStyleName(DefaultGroupedListItemRenderer.ALTERNATE_STYLE_NAME_DRILL_DOWN, this.setDrillDownItemRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListItemRenderer).setFunctionForStyleName(DefaultGroupedListItemRenderer.ALTERNATE_STYLE_NAME_CHECK, this.setCheckItemRendererStyles);\n\n\t\t\t//header and footer renderers for grouped list\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListHeaderOrFooterRenderer).defaultStyleFunction = this.setGroupedListHeaderOrFooterRendererStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListHeaderOrFooterRenderer).setFunctionForStyleName(GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_HEADER_RENDERER, this.setInsetGroupedListHeaderOrFooterRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListHeaderOrFooterRenderer).setFunctionForStyleName(GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_FOOTER_RENDERER, this.setInsetGroupedListHeaderOrFooterRendererStyles);\n\n\t\t\t//label\n\t\t\tthis.getStyleProviderForClass(Label).defaultStyleFunction = this.setLabelStyles;\n\t\t\tthis.getStyleProviderForClass(Label).setFunctionForStyleName(Label.ALTERNATE_STYLE_NAME_HEADING, this.setHeadingLabelStyles);\n\t\t\tthis.getStyleProviderForClass(Label).setFunctionForStyleName(Label.ALTERNATE_STYLE_NAME_DETAIL, this.setDetailLabelStyles);\n\n\t\t\t//layout group\n\t\t\tthis.getStyleProviderForClass(LayoutGroup).setFunctionForStyleName(LayoutGroup.ALTERNATE_STYLE_NAME_TOOLBAR, this.setToolbarLayoutGroupStyles);\n\n\t\t\t//list (see also: item renderers)\n\t\t\tthis.getStyleProviderForClass(List).defaultStyleFunction = this.setListStyles;\n\n\t\t\t//numeric stepper\n\t\t\tthis.getStyleProviderForClass(NumericStepper).defaultStyleFunction = this.setNumericStepperStyles;\n\t\t\tthis.getStyleProviderForClass(TextInput).setFunctionForStyleName(NumericStepper.DEFAULT_CHILD_STYLE_NAME_TEXT_INPUT, this.setNumericStepperTextInputStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(NumericStepper.DEFAULT_CHILD_STYLE_NAME_DECREMENT_BUTTON, this.setNumericStepperButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(NumericStepper.DEFAULT_CHILD_STYLE_NAME_INCREMENT_BUTTON, this.setNumericStepperButtonStyles);\n\n\t\t\t//page indicator\n\t\t\tthis.getStyleProviderForClass(PageIndicator).defaultStyleFunction = this.setPageIndicatorStyles;\n\n\t\t\t//panel\n\t\t\tthis.getStyleProviderForClass(Panel).defaultStyleFunction = this.setPanelStyles;\n\t\t\tthis.getStyleProviderForClass(Header).setFunctionForStyleName(Panel.DEFAULT_CHILD_STYLE_NAME_HEADER, this.setPanelHeaderStyles);\n\n\t\t\t//panel screen\n\t\t\tthis.getStyleProviderForClass(PanelScreen).defaultStyleFunction = this.setPanelScreenStyles;\n\t\t\tthis.getStyleProviderForClass(Header).setFunctionForStyleName(PanelScreen.DEFAULT_CHILD_STYLE_NAME_HEADER, this.setPanelScreenHeaderStyles);\n\n\t\t\t//picker list (see also: item renderers)\n\t\t\tthis.getStyleProviderForClass(PickerList).defaultStyleFunction = this.setPickerListStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(PickerList.DEFAULT_CHILD_STYLE_NAME_BUTTON, this.setPickerListButtonStyles);\n\t\t\tthis.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(PickerList.DEFAULT_CHILD_STYLE_NAME_BUTTON, this.setPickerListButtonStyles);\n\t\t\tthis.getStyleProviderForClass(List).setFunctionForStyleName(PickerList.DEFAULT_CHILD_STYLE_NAME_LIST, this.setPickerListPopUpListStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).setFunctionForStyleName(THEME_STYLE_NAME_TABLET_PICKER_LIST_ITEM_RENDERER, this.setTabletPickerListItemRendererStyles);\n\t\t\t\n\t\t\t//progress bar\n\t\t\tthis.getStyleProviderForClass(ProgressBar).defaultStyleFunction = this.setProgressBarStyles;\n\n\t\t\t//radio\n\t\t\tthis.getStyleProviderForClass(Radio).defaultStyleFunction = this.setRadioStyles;\n\n\t\t\t//scroll container\n\t\t\tthis.getStyleProviderForClass(ScrollContainer).defaultStyleFunction = this.setScrollContainerStyles;\n\t\t\tthis.getStyleProviderForClass(ScrollContainer).setFunctionForStyleName(ScrollContainer.ALTERNATE_STYLE_NAME_TOOLBAR, this.setToolbarScrollContainerStyles);\n\n\t\t\t//scroll screen\n\t\t\tthis.getStyleProviderForClass(ScrollScreen).defaultStyleFunction = this.setScrollScreenStyles;\n\n\t\t\t//scroll text\n\t\t\tthis.getStyleProviderForClass(ScrollText).defaultStyleFunction = this.setScrollTextStyles;\n\n\t\t\t//simple scroll bar\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(SimpleScrollBar.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setSimpleScrollBarThumbStyles);\n\n\t\t\t//slider\n\t\t\tthis.getStyleProviderForClass(Slider).defaultStyleFunction = this.setSliderStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Slider.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setSliderThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_HORIZONTAL_SLIDER_MINIMUM_TRACK, this.setHorizontalSliderMinimumTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_VERTICAL_SLIDER_MINIMUM_TRACK, this.setVerticalSliderMinimumTrackStyles);\n\n\t\t\t//spinner list\n\t\t\tthis.getStyleProviderForClass(SpinnerList).defaultStyleFunction = this.setSpinnerListStyles;\n\n\t\t\t//tab bar\n\t\t\tthis.getStyleProviderForClass(TabBar).defaultStyleFunction = this.setTabBarStyles;\n\t\t\tthis.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(TabBar.DEFAULT_CHILD_STYLE_NAME_TAB, this.setTabStyles);\n\n\t\t\t//text input\n\t\t\tthis.getStyleProviderForClass(TextInput).defaultStyleFunction = this.setTextInputStyles;\n\t\t\tthis.getStyleProviderForClass(TextInput).setFunctionForStyleName(TextInput.ALTERNATE_STYLE_NAME_SEARCH_TEXT_INPUT, this.setSearchTextInputStyles);\n\t\t\tthis.getStyleProviderForClass(TextCallout).setFunctionForStyleName(TextInput.DEFAULT_CHILD_STYLE_NAME_ERROR_CALLOUT, this.setTextInputErrorCalloutStyles);\n\n\t\t\t//text area\n\t\t\tthis.getStyleProviderForClass(TextArea).defaultStyleFunction = this.setTextAreaStyles;\n\t\t\tthis.getStyleProviderForClass(TextCallout).setFunctionForStyleName(TextArea.DEFAULT_CHILD_STYLE_NAME_ERROR_CALLOUT, this.setTextAreaErrorCalloutStyles);\n\n\t\t\t//text callout\n\t\t\tthis.getStyleProviderForClass(TextCallout).defaultStyleFunction = this.setTextCalloutStyles;\n\n\t\t\t//toast\n\t\t\tthis.getStyleProviderForClass(Toast).defaultStyleFunction = this.setToastStyles;\n\t\t\tthis.getStyleProviderForClass(ButtonGroup).setFunctionForStyleName(Toast.DEFAULT_CHILD_STYLE_NAME_ACTIONS, this.setToastActionsStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_TOAST_ACTIONS_BUTTON, this.setToastActionsButtonStyles);\n\n\t\t\t//toggle button\n\t\t\tthis.getStyleProviderForClass(ToggleButton).defaultStyleFunction = this.setButtonStyles;\n\t\t\tthis.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_QUIET_BUTTON, this.setQuietButtonStyles);\n\n\t\t\t//toggle switch\n\t\t\tthis.getStyleProviderForClass(ToggleSwitch).defaultStyleFunction = this.setToggleSwitchStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setToggleSwitchThumbStyles);\n\t\t\tthis.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setToggleSwitchThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_ON_TRACK, this.setToggleSwitchOnTrackStyles);\n\n\t\t\t//tree\n\t\t\tthis.getStyleProviderForClass(Tree).defaultStyleFunction = this.setTreeStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultTreeItemRenderer).defaultStyleFunction = this.setTreeItemRendererStyles;\n\n\t\t\t//media controls\n\t\t\tthis.getStyleProviderForClass(VideoPlayer).defaultStyleFunction = this.setVideoPlayerStyles;\n\n\t\t\t//play/pause toggle button\n\t\t\tthis.getStyleProviderForClass(PlayPauseToggleButton).defaultStyleFunction = this.setPlayPauseToggleButtonStyles;\n\t\t\tthis.getStyleProviderForClass(PlayPauseToggleButton).setFunctionForStyleName(PlayPauseToggleButton.ALTERNATE_STYLE_NAME_OVERLAY_PLAY_PAUSE_TOGGLE_BUTTON, this.setOverlayPlayPauseToggleButtonStyles);\n\n\t\t\t//full screen toggle button\n\t\t\tthis.getStyleProviderForClass(FullScreenToggleButton).defaultStyleFunction = this.setFullScreenToggleButtonStyles;\n\n\t\t\t//mute toggle button\n\t\t\tthis.getStyleProviderForClass(MuteToggleButton).defaultStyleFunction = this.setMuteToggleButtonStyles;\n\n\t\t\t//seek slider\n\t\t\tthis.getStyleProviderForClass(SeekSlider).defaultStyleFunction = this.setSeekSliderStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(SeekSlider.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setSliderThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(SeekSlider.DEFAULT_CHILD_STYLE_NAME_MINIMUM_TRACK, this.setHorizontalSliderMinimumTrackStyles);\n\n\t\t\t//volume slider\n\t\t\tthis.getStyleProviderForClass(VolumeSlider).defaultStyleFunction = this.setVolumeSliderStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(VolumeSlider.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setVolumeSliderThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(VolumeSlider.DEFAULT_CHILD_STYLE_NAME_MINIMUM_TRACK, this.setVolumeSliderMinimumTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(VolumeSlider.DEFAULT_CHILD_STYLE_NAME_MAXIMUM_TRACK, this.setVolumeSliderMaximumTrackStyles);\n\n\t\t}\n\n\t\tprotected function pageIndicatorNormalSymbolFactory():DisplayObject\n\t\t{\n\t\t\treturn new Image(this.pageIndicatorNormalSkinTexture);\n\t\t}\n\n\t\tprotected function pageIndicatorSelectedSymbolFactory():DisplayObject\n\t\t{\n\t\t\treturn new Image(this.pageIndicatorSelectedSkinTexture);\n\t\t}\n\n\t\tprotected function dataGridHeaderDividerFactory():DisplayObject\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.dataGridHeaderDividerSkinTexture);\n\t\t\tskin.scale9Grid = DATA_GRID_HEADER_DIVIDER_SCALE_9_GRID;\n\t\t\tskin.minTouchWidth = this.controlSize;\n\t\t\treturn skin;\n\t\t}\n\n\t\tprotected function toastContainerFactory():DisplayObjectContainer\n\t\t{\n\t\t\tvar container:LayoutGroup = new LayoutGroup();\n\t\t\tcontainer.autoSizeMode = AutoSizeMode.STAGE;\n\n\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\tlayout.verticalAlign = VerticalAlign.BOTTOM;\n\t\t\tif(DeviceCapabilities.isPhone())\n\t\t\t{\n\t\t\t\tlayout.horizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlayout.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\t\tlayout.padding = this.gutterSize;\n\t\t\t\tlayout.gap = this.gutterSize;\n\t\t\t}\n\t\t\tcontainer.layout = layout;\n\t\t\treturn container;\n\t\t}\n\n\t//-------------------------\n\t// Shared\n\t//-------------------------\n\n\t\tprotected function setNoStyles(target:DisplayObject):void\n\t\t{\n\t\t\t//if this is assigned as a style function, chances are the target\n\t\t\t//will be a subcomponent of something. the style function for this\n\t\t\t//component's parent is probably handing the styling for the target\n\t\t}\n\n\t\tprotected function setScrollerStyles(scroller:Scroller):void\n\t\t{\n\t\t\tscroller.horizontalScrollBarFactory = scrollBarFactory;\n\t\t\tscroller.verticalScrollBarFactory = scrollBarFactory;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tscroller.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tscroller.focusPadding = 0;\n\t\t}\n\n\t\tprotected function setDropDownListStyles(list:List):void\n\t\t{\n\t\t\tvar backgroundSkin:Quad = new Quad(this.gridSize, this.gridSize, LIST_BACKGROUND_COLOR);\n\t\t\tlist.backgroundSkin = backgroundSkin;\n\n\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\tlayout.horizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\tlayout.maxRowCount = 4;\n\t\t\tlist.layout = layout;\n\t\t}\n\n\t//-------------------------\n\t// Alert\n\t//-------------------------\n\n\t\tprotected function setAlertStyles(alert:Alert):void\n\t\t{\n\t\t\tthis.setScrollerStyles(alert);\n\n\t\t\tvar backgroundSkin:Image = new Image(this.popUpBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tbackgroundSkin.width = this.controlSize;\n\t\t\tbackgroundSkin.height = this.controlSize;\n\t\t\talert.backgroundSkin = backgroundSkin;\n\n\t\t\talert.fontStyles = this.primaryFontStyles.clone();\n\t\t\talert.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\talert.paddingTop = this.gutterSize;\n\t\t\talert.paddingRight = this.gutterSize;\n\t\t\talert.paddingBottom = this.smallGutterSize;\n\t\t\talert.paddingLeft = this.gutterSize;\n\t\t\talert.outerPadding = this.borderSize;\n\t\t\talert.outerPaddingBottom = this.borderSize + this.dropShadowSize;\n\t\t\talert.outerPaddingRight = this.borderSize + this.dropShadowSize;\n\t\t\talert.gap = this.smallGutterSize;\n\t\t\talert.maxWidth = this.popUpFillSize;\n\t\t\talert.maxHeight = this.popUpFillSize;\n\t\t}\n\n\t\tprotected function setAlertButtonGroupStyles(group:ButtonGroup):void\n\t\t{\n\t\t\tgroup.customButtonStyleName = THEME_STYLE_NAME_ALERT_BUTTON_GROUP_BUTTON;\n\t\t\tgroup.direction = Direction.VERTICAL;\n\t\t\tgroup.horizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\tgroup.verticalAlign = VerticalAlign.JUSTIFY;\n\t\t\tgroup.gap = this.smallGutterSize;\n\t\t\tgroup.padding = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setAlertButtonGroupButtonStyles(button:Button):void\n\t\t{\n\t\t\tthis.setButtonGroupButtonStyles(button);\n\t\t}\n\n\t//-------------------------\n\t// Button\n\t//-------------------------\n\n\t\tprotected function setBaseButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tbutton.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tbutton.focusPadding = this.focusPaddingSize;\n\n\t\t\tbutton.paddingTop = this.smallGutterSize;\n\t\t\tbutton.paddingBottom = this.smallGutterSize;\n\t\t\tbutton.paddingLeft = this.gutterSize;\n\t\t\tbutton.paddingRight = this.gutterSize;\n\t\t\tbutton.gap = this.smallGutterSize;\n\t\t\tbutton.minGap = this.smallGutterSize;\n\t\t\tbutton.minTouchWidth = this.gridSize;\n\t\t\tbutton.minTouchHeight = this.gridSize;\n\t\t}\n\n\t\tprotected function setButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);\n\t\t\tif(button is ToggleButton)\n\t\t\t{\n\t\t\t\t//for convenience, this function can style both a regular button\n\t\t\t\t//and a toggle button\n\t\t\t\tskin.selectedTexture = this.buttonSelectedSkinTexture;\n\t\t\t\tskin.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.buttonDownSkinTexture);\n\t\t\t\tskin.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.buttonSelectedDisabledSkinTexture);\n\t\t\t}\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.smallControlSize;\n\t\t\tskin.minHeight = this.smallControlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.fontStyles = this.primaryFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\t\t}\n\n\t\tprotected function setCallToActionButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonCallToActionUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.smallControlSize;\n\t\t\tskin.minHeight = this.smallControlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.fontStyles = this.primaryFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\t\t}\n\n\t\tprotected function setQuietButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar defaultSkin:Quad = new Quad(this.controlSize, this.controlSize, 0xff00ff);\n\t\t\tdefaultSkin.alpha = 0;\n\t\t\tbutton.defaultSkin = defaultSkin;\n\n\t\t\tvar otherSkin:ImageSkin = new ImageSkin(null);\n\t\t\totherSkin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\tif(button is ToggleButton)\n\t\t\t{\n\t\t\t\t//for convenience, this function can style both a regular button\n\t\t\t\t//and a toggle button\n\t\t\t\totherSkin.selectedTexture = this.buttonSelectedSkinTexture;\n\t\t\t\totherSkin.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.buttonDownSkinTexture);\n\t\t\t\totherSkin.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.buttonSelectedDisabledSkinTexture);\n\t\t\t\tToggleButton(button).defaultSelectedSkin = otherSkin;\n\t\t\t\tbutton.setSkinForState(ButtonState.DOWN_AND_SELECTED, otherSkin);\n\t\t\t\tbutton.setSkinForState(ButtonState.DISABLED_AND_SELECTED, otherSkin);\n\t\t\t}\n\t\t\tbutton.setSkinForState(ButtonState.DOWN, otherSkin);\n\t\t\totherSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\totherSkin.width = this.controlSize;\n\t\t\totherSkin.height = this.controlSize;\n\t\t\totherSkin.minWidth = this.controlSize;\n\t\t\totherSkin.minHeight = this.controlSize;\n\n\t\t\tbutton.fontStyles = this.primaryFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\t\t}\n\n\t\tprotected function setDangerButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonDangerUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDangerDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.fontStyles = this.dangerFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\t\t}\n\n\t\tprotected function setBackButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonBackUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonBackDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonBackDisabledSkinTexture);\n\t\t\tskin.scale9Grid = BACK_BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.fontStyles = this.primaryFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\n\t\t\tbutton.height = this.controlSize;\n\t\t\tbutton.paddingLeft = 2 * this.gutterSize;\n\t\t}\n\n\t\tprotected function setForwardButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonForwardUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonForwardDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonForwardDisabledSkinTexture);\n\t\t\tskin.scale9Grid = FORWARD_BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.fontStyles = this.primaryFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\n\t\t\tbutton.height = this.controlSize;\n\t\t\tbutton.paddingRight = 2 * this.gutterSize;\n\t\t}\n\n\t//-------------------------\n\t// ButtonGroup\n\t//-------------------------\n\n\t\tprotected function setButtonGroupStyles(group:ButtonGroup):void\n\t\t{\n\t\t\tgroup.gap = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setButtonGroupButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);\n\t\t\tif(button is ToggleButton)\n\t\t\t{\n\t\t\t\t//for convenience, this function can style both a regular button\n\t\t\t\t//and a toggle button\n\t\t\t\tskin.selectedTexture = this.buttonSelectedSkinTexture;\n\t\t\t\tskin.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.buttonDownSkinTexture);\n\t\t\t\tskin.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.buttonSelectedDisabledSkinTexture);\n\t\t\t}\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.width = this.popUpFillSize;\n\t\t\tskin.height = this.gridSize;\n\t\t\tskin.minWidth = this.popUpFillSize;\n\t\t\tbutton.minHeight = this.gridSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tbutton.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tbutton.focusPadding = this.focusPaddingSize;\n\n\t\t\tbutton.fontStyles = this.primaryFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tbutton.paddingTop = this.smallGutterSize;\n\t\t\tbutton.paddingBottom = this.smallGutterSize;\n\t\t\tbutton.paddingLeft = this.gutterSize;\n\t\t\tbutton.paddingRight = this.gutterSize;\n\t\t\tbutton.gap = this.smallGutterSize;\n\t\t\tbutton.minGap = this.smallGutterSize;\n\t\t\tbutton.minTouchWidth = this.gridSize;\n\t\t\tbutton.minTouchHeight = this.gridSize;\n\t\t}\n\n\t//-------------------------\n\t// Callout\n\t//-------------------------\n\n\t\tprotected function setCalloutStyles(callout:Callout):void\n\t\t{\n\t\t\tcallout.padding = this.smallGutterSize;\n\t\t\tcallout.paddingRight = this.gutterSize + this.dropShadowSize;\n\t\t\tcallout.paddingBottom = this.gutterSize + this.dropShadowSize;\n\n\t\t\tvar backgroundSkin:Image = new Image(this.popUpBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tbackgroundSkin.width = this.calloutBackgroundMinSize;\n\t\t\tbackgroundSkin.height = this.calloutBackgroundMinSize;\n\t\t\tcallout.backgroundSkin = backgroundSkin;\n\n\t\t\tvar topArrowSkin:Image = new Image(this.calloutTopArrowSkinTexture);\n\t\t\tcallout.topArrowSkin = topArrowSkin;\n\t\t\tcallout.topArrowGap = this.calloutTopLeftArrowOverlapGapSize;\n\n\t\t\tvar bottomArrowSkin:Image = new Image(this.calloutBottomArrowSkinTexture);\n\t\t\tcallout.bottomArrowSkin = bottomArrowSkin;\n\t\t\tcallout.bottomArrowGap = this.calloutBottomRightArrowOverlapGapSize;\n\n\t\t\tvar leftArrowSkin:Image = new Image(this.calloutLeftArrowSkinTexture);\n\t\t\tcallout.leftArrowSkin = leftArrowSkin;\n\t\t\tcallout.leftArrowGap = this.calloutTopLeftArrowOverlapGapSize;\n\n\t\t\tvar rightArrowSkin:Image = new Image(this.calloutRightArrowSkinTexture);\n\t\t\tcallout.rightArrowSkin = rightArrowSkin;\n\t\t\tcallout.rightArrowGap = this.calloutBottomRightArrowOverlapGapSize;\n\t\t}\n\n\t\tprotected function setDangerCalloutStyles(callout:Callout):void\n\t\t{\n\t\t\tcallout.padding = this.smallGutterSize;\n\t\t\tcallout.paddingRight = this.gutterSize + this.dropShadowSize;\n\t\t\tcallout.paddingBottom = this.gutterSize + this.dropShadowSize;\n\n\t\t\tvar backgroundSkin:Image = new Image(this.dangerPopUpBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tbackgroundSkin.width = this.calloutBackgroundMinSize;\n\t\t\tbackgroundSkin.height = this.calloutBackgroundMinSize;\n\t\t\tcallout.backgroundSkin = backgroundSkin;\n\n\t\t\tvar topArrowSkin:Image = new Image(this.dangerCalloutTopArrowSkinTexture);\n\t\t\tcallout.topArrowSkin = topArrowSkin;\n\t\t\tcallout.topArrowGap = this.calloutTopLeftArrowOverlapGapSize;\n\n\t\t\tvar bottomArrowSkin:Image = new Image(this.dangerCalloutBottomArrowSkinTexture);\n\t\t\tcallout.bottomArrowSkin = bottomArrowSkin;\n\t\t\tcallout.bottomArrowGap = this.calloutBottomRightArrowOverlapGapSize;\n\n\t\t\tvar leftArrowSkin:Image = new Image(this.dangerCalloutLeftArrowSkinTexture);\n\t\t\tcallout.leftArrowSkin = leftArrowSkin;\n\t\t\tcallout.leftArrowGap = this.calloutTopLeftArrowOverlapGapSize;\n\n\t\t\tvar rightArrowSkin:Image = new Image(this.dangerCalloutRightArrowSkinTexture);\n\t\t\tcallout.rightArrowSkin = rightArrowSkin;\n\t\t\tcallout.rightArrowGap = this.calloutBottomRightArrowOverlapGapSize;\n\t\t}\n\n\t//-------------------------\n\t// Check\n\t//-------------------------\n\n\t\tprotected function setCheckStyles(check:Check):void\n\t\t{\n\t\t\tvar skin:Quad = new Quad(this.controlSize, this.controlSize);\n\t\t\tskin.alpha = 0;\n\t\t\tcheck.defaultSkin = skin;\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.checkIconTexture);\n\t\t\ticon.selectedTexture = this.checkSelectedIconTexture;\n\t\t\ticon.setTextureForState(ButtonState.DISABLED, this.checkDisabledIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.checkSelectedDisabledIconTexture);\n\t\t\tcheck.defaultIcon = icon;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tcheck.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tcheck.focusPaddingLeft = this.focusPaddingSize;\n\t\t\tcheck.focusPaddingRight = this.focusPaddingSize;\n\n\t\t\tcheck.fontStyles = this.primaryFontStyles.clone();\n\t\t\tcheck.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tcheck.gap = this.smallGutterSize;\n\t\t\tcheck.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tcheck.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\tcheck.minTouchWidth = this.gridSize;\n\t\t\tcheck.minTouchHeight = this.gridSize;\n\t\t}\n\n\t//-------------------------\n\t// DataGrid\n\t//-------------------------\n\n\t\tprotected function setDataGridStyles(grid:DataGrid):void\n\t\t{\n\t\t\tthis.setScrollerStyles(grid);\n\n\t\t\tgrid.backgroundSkin = new Quad(this.gridSize, this.gridSize, LIST_BACKGROUND_COLOR);\n\n\t\t\tvar columnDragOverlaySkin:Quad = new Quad(1, 1, DATA_GRID_COLUMN_OVERLAY_COLOR);\n\t\t\tcolumnDragOverlaySkin.alpha = DATA_GRID_COLUMN_OVERLAY_ALPHA;\n\t\t\tgrid.columnDragOverlaySkin = columnDragOverlaySkin;\n\n\t\t\tvar columnResizeSkin:ImageSkin = new ImageSkin(this.dataGridColumnResizeSkinTexture);\n\t\t\tcolumnResizeSkin.scale9Grid = DATA_GRID_COLUMN_RESIZE_SKIN_SCALE_9_GRID;\n\t\t\tgrid.columnResizeSkin = columnResizeSkin;\n\n\t\t\tvar columnDropIndicatorSkin:ImageSkin = new ImageSkin(this.dataGridColumnDropIndicatorSkinTexture);\n\t\t\tcolumnDropIndicatorSkin.scale9Grid = DATA_GRID_COLUMN_DROP_INDICATOR_SCALE_9_GRID;\n\t\t\tgrid.columnDropIndicatorSkin = columnDropIndicatorSkin;\n\n\t\t\tgrid.headerDividerFactory = this.dataGridHeaderDividerFactory;\n\t\t}\n\n\t\tprotected function setDataGridHeaderRendererStyles(headerRenderer:DefaultDataGridHeaderRenderer):void\n\t\t{\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.dataGridHeaderRendererSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = DATA_GRID_HEADER_RENDERER_SCALE_9_GRID;\n\t\t\tbackgroundSkin.width = this.controlSize;\n\t\t\tbackgroundSkin.height = this.controlSize;\n\t\t\tbackgroundSkin.minWidth = this.controlSize;\n\t\t\tbackgroundSkin.minHeight = this.controlSize;\n\t\t\theaderRenderer.backgroundSkin = backgroundSkin;\n\n\t\t\theaderRenderer.sortAscendingIcon = new ImageSkin(this.dataGridHeaderSortAscendingIconTexture);\n\t\t\theaderRenderer.sortDescendingIcon = new ImageSkin(this.dataGridHeaderSortDescendingIconTexture);\n\n\t\t\theaderRenderer.fontStyles = this.primaryFontStyles.clone();\n\t\t\theaderRenderer.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\theaderRenderer.paddingTop = this.smallGutterSize;\n\t\t\theaderRenderer.paddingBottom = this.smallGutterSize;\n\t\t\theaderRenderer.paddingLeft = this.gutterSize;\n\t\t\theaderRenderer.paddingRight = this.gutterSize;\n\t\t\t//headerRenderer.gap = this.gutterSize;\n\t\t\t//headerRenderer.minGap = this.gutterSize;\n\t\t}\n\n\t\tprotected function setDataGridCellRendererStyles(cellRenderer:DefaultDataGridCellRenderer):void\n\t\t{\n\t\t\tvar defaultSkin:ImageSkin = new ImageSkin(this.itemRendererUpSkinTexture);\n\t\t\tdefaultSkin.setTextureForState(ButtonState.DOWN, this.dataGridCellRendererDownSkinTexture);\n\t\t\tdefaultSkin.selectedTexture = this.dataGridCellRendererSelectedUpSkinTexture;\n\t\t\tdefaultSkin.scale9Grid = ITEM_RENDERER_SCALE_9_GRID;\n\t\t\tdefaultSkin.width = this.gridSize;\n\t\t\tdefaultSkin.height = this.gridSize;\n\t\t\tdefaultSkin.minWidth = this.gridSize;\n\t\t\tdefaultSkin.minHeight = this.gridSize;\n\t\t\tcellRenderer.defaultSkin = defaultSkin;\n\n\t\t\tcellRenderer.fontStyles = this.primaryFontStyles.clone();\n\t\t\tcellRenderer.disabledFontStyles = this.disabledFontStyles.clone();\n\t\t\tcellRenderer.iconLabelFontStyles = this.primaryFontStyles.clone();\n\t\t\tcellRenderer.iconLabelDisabledFontStyles = this.disabledFontStyles.clone();\n\t\t\tcellRenderer.accessoryLabelFontStyles = this.primaryFontStyles.clone();\n\t\t\tcellRenderer.accessoryLabelDisabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tcellRenderer.paddingTop = this.smallGutterSize;\n\t\t\tcellRenderer.paddingBottom = this.smallGutterSize;\n\t\t\tcellRenderer.paddingLeft = this.gutterSize;\n\t\t\tcellRenderer.paddingRight = this.gutterSize;\n\t\t\tcellRenderer.gap = this.gutterSize;\n\t\t\tcellRenderer.minGap = this.gutterSize;\n\t\t\tcellRenderer.accessoryGap = Number.POSITIVE_INFINITY;\n\t\t\tcellRenderer.minAccessoryGap = this.gutterSize;\n\t\t\tcellRenderer.minTouchWidth = this.gridSize;\n\t\t\tcellRenderer.minTouchHeight = this.gridSize;\n\t\t\tcellRenderer.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tcellRenderer.iconPosition = RelativePosition.LEFT;\n\t\t\tcellRenderer.accessoryPosition = RelativePosition.RIGHT;\n\t\t}\n\n\t//-------------------------\n\t// DateTimeSpinner\n\t//-------------------------\n\n\t\tprotected function setDateTimeSpinnerStyles(spinner:DateTimeSpinner):void\n\t\t{\n\t\t\tspinner.customItemRendererStyleName = THEME_STYLE_NAME_DATE_TIME_SPINNER_LIST_ITEM_RENDERER;\n\t\t}\n\n\t\tprotected function setDateTimeSpinnerListItemRendererStyles(itemRenderer:DefaultListItemRenderer):void\n\t\t{\n\t\t\tthis.setSpinnerListItemRendererStyles(itemRenderer);\n\n\t\t\titemRenderer.accessoryPosition = RelativePosition.LEFT;\n\t\t\titemRenderer.gap = this.gutterSize;\n\t\t\titemRenderer.minGap = this.gutterSize;\n\t\t\titemRenderer.accessoryGap = this.gutterSize;\n\t\t\titemRenderer.minAccessoryGap = this.gutterSize;\n\t\t}\n\n\t//-------------------------\n\t// Drawers\n\t//-------------------------\n\n\t\tprotected function setDrawersStyles(drawers:Drawers):void\n\t\t{\n\t\t\tvar overlaySkin:Quad = new Quad(10, 10, MODAL_OVERLAY_COLOR);\n\t\t\toverlaySkin.alpha = MODAL_OVERLAY_ALPHA;\n\t\t\tdrawers.overlaySkin = overlaySkin;\n\n\t\t\tvar topDrawerDivider:Quad = new Quad(this.borderSize, this.borderSize, DRAWERS_DIVIDER_COLOR);\n\t\t\tdrawers.topDrawerDivider = topDrawerDivider;\n\n\t\t\tvar rightDrawerDivider:Quad = new Quad(this.borderSize, this.borderSize, DRAWERS_DIVIDER_COLOR);\n\t\t\tdrawers.rightDrawerDivider = rightDrawerDivider;\n\n\t\t\tvar bottomDrawerDivider:Quad = new Quad(this.borderSize, this.borderSize, DRAWERS_DIVIDER_COLOR);\n\t\t\tdrawers.bottomDrawerDivider = bottomDrawerDivider;\n\n\t\t\tvar leftDrawerDivider:Quad = new Quad(this.borderSize, this.borderSize, DRAWERS_DIVIDER_COLOR);\n\t\t\tdrawers.leftDrawerDivider = leftDrawerDivider;\n\t\t}\n\n\t//-------------------------\n\t// GroupedList\n\t//-------------------------\n\n\t\tprotected function setGroupedListStyles(list:GroupedList):void\n\t\t{\n\t\t\tthis.setScrollerStyles(list);\n\n\t\t\tvar backgroundSkin:Quad = new Quad(this.gridSize, this.gridSize, LIST_BACKGROUND_COLOR);\n\t\t\tlist.backgroundSkin = backgroundSkin;\n\t\t}\n\n\t\t//see List section for item renderer styles\n\n\t\tprotected function setGroupedListHeaderOrFooterRendererStyles(renderer:DefaultGroupedListHeaderOrFooterRenderer):void\n\t\t{\n\t\t\trenderer.backgroundSkin = new Quad(1, 1, LIST_HEADER_BACKGROUND_COLOR);\n\n\t\t\trenderer.fontStyles = this.primaryFontStyles.clone();\n\t\t\trenderer.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\trenderer.paddingTop = this.smallGutterSize;\n\t\t\trenderer.paddingBottom = this.smallGutterSize;\n\t\t\trenderer.paddingLeft = this.gutterSize;\n\t\t\trenderer.paddingRight = this.gutterSize;\n\t\t}\n\n\t\tprotected function setInsetGroupedListStyles(list:GroupedList):void\n\t\t{\n\t\t\tthis.setScrollerStyles(list);\n\n\t\t\tlist.customHeaderRendererStyleName = GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_HEADER_RENDERER;\n\t\t\tlist.customFooterRendererStyleName = GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_FOOTER_RENDERER;\n\n\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\tlayout.useVirtualLayout = true;\n\t\t\tlayout.padding = this.gutterSize;\n\t\t\tlayout.paddingTop = 0;\n\t\t\tlayout.gap = 0;\n\t\t\tlayout.horizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\tlayout.verticalAlign = VerticalAlign.TOP;\n\t\t\tlist.layout = layout;\n\t\t}\n\n\t\tprotected function setInsetGroupedListHeaderOrFooterRendererStyles(renderer:DefaultGroupedListHeaderOrFooterRenderer):void\n\t\t{\n\t\t\tvar skin:Quad = new Quad(this.controlSize, this.controlSize);\n\t\t\tskin.alpha = 0;\n\t\t\trenderer.backgroundSkin = skin;\n\n\t\t\trenderer.fontStyles = this.primaryFontStyles.clone();\n\t\t\trenderer.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\trenderer.paddingTop = this.smallGutterSize;\n\t\t\trenderer.paddingBottom = this.smallGutterSize;\n\t\t\trenderer.paddingLeft = this.gutterSize;\n\t\t\trenderer.paddingRight = this.gutterSize;\n\t\t}\n\n\t//-------------------------\n\t// Header\n\t//-------------------------\n\n\t\tprotected function setHeaderStyles(header:Header):void\n\t\t{\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.headerSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = HEADER_SCALE_9_GRID;\n\t\t\tbackgroundSkin.width = this.gridSize;\n\t\t\tbackgroundSkin.height = this.gridSize;\n\t\t\tbackgroundSkin.minWidth = this.gridSize;\n\t\t\tbackgroundSkin.minHeight = this.gridSize;\n\t\t\theader.backgroundSkin = backgroundSkin;\n\n\t\t\theader.fontStyles = this.primaryFontStyles.clone();\n\t\t\theader.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\theader.padding = this.smallGutterSize;\n\t\t\theader.gap = this.smallGutterSize;\n\t\t\theader.titleGap = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// Label\n\t//-------------------------\n\n\t\tprotected function setLabelStyles(label:Label):void\n\t\t{\n\t\t\tlabel.fontStyles = this.primaryFontStyles.clone();\n\t\t\tlabel.disabledFontStyles = this.disabledFontStyles.clone();\n\t\t}\n\n\t\tprotected function setHeadingLabelStyles(label:Label):void\n\t\t{\n\t\t\tlabel.fontStyles = this.headingFontStyles.clone();\n\t\t\tlabel.disabledFontStyles = this.headingDisabledFontStyles.clone();\n\t\t}\n\n\t\tprotected function setDetailLabelStyles(label:Label):void\n\t\t{\n\t\t\tlabel.fontStyles = this.detailFontStyles.clone();\n\t\t\tlabel.disabledFontStyles = this.detailDisabledFontStyles.clone();\n\t\t}\n\n\t//-------------------------\n\t// LayoutGroup\n\t//-------------------------\n\n\t\tprotected function setToolbarLayoutGroupStyles(group:LayoutGroup):void\n\t\t{\n\t\t\tif(!group.layout)\n\t\t\t{\n\t\t\t\tvar layout:HorizontalLayout = new HorizontalLayout();\n\t\t\t\tlayout.padding = this.smallGutterSize;\n\t\t\t\tlayout.gap = this.smallGutterSize;\n\t\t\t\tlayout.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\t\tgroup.layout = layout;\n\t\t\t}\n\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.headerSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = HEADER_SCALE_9_GRID;\n\t\t\tbackgroundSkin.width = this.gridSize;\n\t\t\tbackgroundSkin.height = this.gridSize;\n\t\t\tbackgroundSkin.minWidth = this.gridSize;\n\t\t\tbackgroundSkin.minHeight = this.gridSize;\n\t\t\tgroup.backgroundSkin = backgroundSkin;\n\t\t}\n\n\t//-------------------------\n\t// List\n\t//-------------------------\n\n\t\tprotected function setListStyles(list:List):void\n\t\t{\n\t\t\tthis.setScrollerStyles(list);\n\n\t\t\tlist.backgroundSkin = new Quad(this.gridSize, this.gridSize, LIST_BACKGROUND_COLOR);\n\n\t\t\tvar dropIndicatorSkin:Quad = new Quad(this.borderSize, this.borderSize, PRIMARY_TEXT_COLOR);\n\t\t\tlist.dropIndicatorSkin = dropIndicatorSkin;\n\t\t}\n\n\t\tprotected function setListItemRendererStyles(itemRenderer:DefaultListItemRenderer):void\n\t\t{\n\t\t\tthis.setItemRendererStyles(itemRenderer);\n\n\t\t\tvar dragIcon:ImageSkin = new ImageSkin(this.dragHandleIcon);\n\t\t\tdragIcon.minTouchWidth = this.gridSize;\n\t\t\tdragIcon.minTouchHeight = this.gridSize;\n\t\t\titemRenderer.dragIcon = dragIcon;\n\t\t}\n\n\t\tprotected function setItemRendererStyles(itemRenderer:BaseDefaultItemRenderer):void\n\t\t{\n\t\t\tvar defaultSkin:ImageSkin = new ImageSkin(this.itemRendererUpSkinTexture);\n\t\t\tdefaultSkin.scale9Grid = ITEM_RENDERER_SCALE_9_GRID;\n\t\t\tdefaultSkin.width = this.gridSize;\n\t\t\tdefaultSkin.height = this.gridSize;\n\t\t\tdefaultSkin.minWidth = this.gridSize;\n\t\t\tdefaultSkin.minHeight = this.gridSize;\n\t\t\titemRenderer.defaultSkin = defaultSkin;\n\n\t\t\t//different scale9Grid, so needs a separate skin\n\t\t\tvar otherSkin:ImageSkin = new ImageSkin(this.itemRendererDownSkinTexture);\n\t\t\totherSkin.selectedTexture = this.itemRendererSelectedUpSkinTexture;\n\t\t\totherSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\totherSkin.width = this.gridSize;\n\t\t\totherSkin.height = this.gridSize;\n\t\t\totherSkin.minWidth = this.gridSize;\n\t\t\totherSkin.minHeight = this.gridSize;\n\t\t\titemRenderer.defaultSelectedSkin = otherSkin;\n\t\t\titemRenderer.setSkinForState(ButtonState.DOWN, otherSkin);\n\n\t\t\titemRenderer.fontStyles = this.primaryFontStyles.clone();\n\t\t\titemRenderer.disabledFontStyles = this.disabledFontStyles.clone();\n\t\t\titemRenderer.iconLabelFontStyles = this.primaryFontStyles.clone();\n\t\t\titemRenderer.iconLabelDisabledFontStyles = this.disabledFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelFontStyles = this.primaryFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelDisabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\titemRenderer.paddingTop = this.smallGutterSize;\n\t\t\titemRenderer.paddingBottom = this.smallGutterSize;\n\t\t\titemRenderer.paddingLeft = this.gutterSize;\n\t\t\titemRenderer.paddingRight = this.gutterSize;\n\t\t\titemRenderer.gap = this.gutterSize;\n\t\t\titemRenderer.minGap = this.gutterSize;\n\t\t\titemRenderer.accessoryGap = Number.POSITIVE_INFINITY;\n\t\t\titemRenderer.minAccessoryGap = this.gutterSize;\n\t\t\titemRenderer.minTouchWidth = this.gridSize;\n\t\t\titemRenderer.minTouchHeight = this.gridSize;\n\t\t\titemRenderer.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\titemRenderer.iconPosition = RelativePosition.LEFT;\n\t\t\titemRenderer.accessoryPosition = RelativePosition.RIGHT;\n\t\t}\n\n\t\tprotected function setDrillDownItemRendererStyles(itemRenderer:BaseDefaultItemRenderer):void\n\t\t{\n\t\t\tthis.setItemRendererStyles(itemRenderer);\n\n\t\t\titemRenderer.itemHasAccessory = false;\n\t\t\tvar defaultAccessory:ImageLoader = new ImageLoader();\n\t\t\tdefaultAccessory.source = this.listDrillDownAccessoryTexture;\n\t\t\titemRenderer.defaultAccessory = defaultAccessory;\n\t\t}\n\n\t\tprotected function setCheckItemRendererStyles(itemRenderer:BaseDefaultItemRenderer):void\n\t\t{\n\t\t\tvar defaultSkin:ImageSkin = new ImageSkin(this.itemRendererUpSkinTexture);\n\t\t\tdefaultSkin.scale9Grid = ITEM_RENDERER_SCALE_9_GRID;\n\t\t\tdefaultSkin.width = this.gridSize;\n\t\t\tdefaultSkin.height = this.gridSize;\n\t\t\tdefaultSkin.minWidth = this.gridSize;\n\t\t\tdefaultSkin.minHeight = this.gridSize;\n\t\t\titemRenderer.defaultSkin = defaultSkin;\n\n\t\t\t//different scale9Grid, so needs a separate skin\n\t\t\tvar otherSkin:ImageSkin = new ImageSkin(this.itemRendererDownSkinTexture);\n\t\t\totherSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\totherSkin.width = this.gridSize;\n\t\t\totherSkin.height = this.gridSize;\n\t\t\totherSkin.minWidth = this.gridSize;\n\t\t\totherSkin.minHeight = this.gridSize;\n\t\t\titemRenderer.setSkinForState(ButtonState.DOWN, otherSkin);\n\n\t\t\tvar defaultSelectedIcon:ImageLoader = new ImageLoader();\n\t\t\tdefaultSelectedIcon.source = this.checkItemRendererSelectedIconTexture;\n\t\t\titemRenderer.defaultSelectedIcon = defaultSelectedIcon;\n\n\t\t\tvar frame:Rectangle = this.checkItemRendererSelectedIconTexture.frame;\n\t\t\tif(frame)\n\t\t\t{\n\t\t\t\tvar iconWidth:Number = frame.width;\n\t\t\t\tvar iconHeight:Number = frame.height;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ticonWidth = this.checkItemRendererSelectedIconTexture.width;\n\t\t\t\ticonHeight = this.checkItemRendererSelectedIconTexture.height;\n\t\t\t}\n\t\t\tvar defaultIcon:Quad = new Quad(iconWidth, iconHeight, 0xff00ff);\n\t\t\tdefaultIcon.alpha = 0;\n\t\t\titemRenderer.defaultIcon = defaultIcon;\n\n\t\t\titemRenderer.fontStyles = this.primaryFontStyles.clone();\n\t\t\titemRenderer.disabledFontStyles = this.disabledFontStyles.clone();\n\t\t\titemRenderer.iconLabelFontStyles = this.primaryFontStyles.clone();\n\t\t\titemRenderer.iconLabelDisabledFontStyles = this.disabledFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelFontStyles = this.primaryFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelDisabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\titemRenderer.itemHasIcon = false;\n\n\t\t\titemRenderer.paddingTop = this.smallGutterSize;\n\t\t\titemRenderer.paddingBottom = this.smallGutterSize;\n\t\t\titemRenderer.paddingLeft = this.gutterSize;\n\t\t\titemRenderer.paddingRight = this.gutterSize;\n\t\t\titemRenderer.gap = Number.POSITIVE_INFINITY;\n\t\t\titemRenderer.minGap = this.gutterSize;\n\t\t\titemRenderer.iconPosition = RelativePosition.RIGHT;\n\t\t\titemRenderer.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\titemRenderer.accessoryGap = this.smallGutterSize;\n\t\t\titemRenderer.minAccessoryGap = this.smallGutterSize;\n\t\t\titemRenderer.accessoryPosition = RelativePosition.BOTTOM;\n\t\t\titemRenderer.layoutOrder = ItemRendererLayoutOrder.LABEL_ACCESSORY_ICON;\n\t\t\titemRenderer.minTouchWidth = this.gridSize;\n\t\t\titemRenderer.minTouchHeight = this.gridSize;\n\t\t}\n\n\t//-------------------------\n\t// NumericStepper\n\t//-------------------------\n\n\t\tprotected function setNumericStepperStyles(stepper:NumericStepper):void\n\t\t{\n\t\t\tstepper.buttonLayoutMode = StepperButtonLayoutMode.SPLIT_HORIZONTAL;\n\t\t\tstepper.incrementButtonLabel = \"+\";\n\t\t\tstepper.decrementButtonLabel = \"-\";\n\n\t\t\tstepper.useLeftAndRightKeys = true;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tstepper.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tstepper.focusPadding = this.focusPaddingSize;\n\t\t}\n\n\t\tprotected function setNumericStepperTextInputStyles(input:TextInput):void\n\t\t{\n\t\t\tinput.minTouchWidth = this.gridSize;\n\t\t\tinput.minTouchHeight = this.gridSize;\n\t\t\tinput.gap = this.smallGutterSize;\n\t\t\tinput.padding = this.smallGutterSize;\n\t\t\tinput.isEditable = false;\n\t\t\tinput.isSelectable = false;\n\t\t\tinput.textEditorFactory = numericStepperTextEditorFactory;\n\n\t\t\tinput.fontStyles = this.centeredFontStyles.clone();\n\t\t\tinput.disabledFontStyles = this.centeredDisabledFontStyles.clone();\n\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.insetBackgroundSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.DISABLED, this.insetBackgroundDisabledSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.FOCUSED, this.insetBackgroundFocusedSkinTexture);\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.width = this.gridSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tinput.backgroundSkin = skin;\n\t\t}\n\n\t\tprotected function setNumericStepperButtonStyles(button:Button):void\n\t\t{\n\t\t\tthis.setButtonStyles(button);\n\t\t\tbutton.keepDownStateOnRollOut = true;\n\t\t}\n\n\t//-------------------------\n\t// PageIndicator\n\t//-------------------------\n\n\t\tprotected function setPageIndicatorStyles(pageIndicator:PageIndicator):void\n\t\t{\n\t\t\tpageIndicator.normalSymbolFactory = this.pageIndicatorNormalSymbolFactory;\n\t\t\tpageIndicator.selectedSymbolFactory = this.pageIndicatorSelectedSymbolFactory;\n\t\t\tpageIndicator.gap = this.smallGutterSize;\n\t\t\tpageIndicator.padding = this.smallGutterSize;\n\t\t\tpageIndicator.minTouchWidth = this.smallControlSize * 2;\n\t\t\tpageIndicator.minTouchHeight = this.smallControlSize * 2;\n\t\t}\n\n\t//-------------------------\n\t// Panel\n\t//-------------------------\n\n\t\tprotected function setPanelStyles(panel:Panel):void\n\t\t{\n\t\t\tthis.setScrollerStyles(panel);\n\n\t\t\tvar backgroundSkin:Image = new Image(this.panelBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tbackgroundSkin.width = this.smallControlSize;\n\t\t\tbackgroundSkin.height = this.smallControlSize;\n\t\t\tpanel.backgroundSkin = backgroundSkin;\n\n\t\t\tpanel.outerPadding = this.borderSize;\n\t\t\tpanel.padding = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setPanelHeaderStyles(header:Header):void\n\t\t{\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.panelHeaderSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = HEADER_SCALE_9_GRID;\n\t\t\tbackgroundSkin.width = this.gridSize;\n\t\t\tbackgroundSkin.height = this.gridSize;\n\t\t\tbackgroundSkin.minWidth = this.gridSize;\n\t\t\tbackgroundSkin.minHeight = this.gridSize;\n\t\t\theader.backgroundSkin = backgroundSkin;\n\n\t\t\theader.fontStyles = this.primaryFontStyles.clone();\n\t\t\theader.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\theader.padding = this.smallGutterSize;\n\t\t\theader.gap = this.smallGutterSize;\n\t\t\theader.titleGap = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// PanelScreen\n\t//-------------------------\n\n\t\tprotected function setPanelScreenStyles(screen:PanelScreen):void\n\t\t{\n\t\t\tthis.setScrollerStyles(screen);\n\t\t}\n\n\t\tprotected function setPanelScreenHeaderStyles(header:Header):void\n\t\t{\n\t\t\tthis.setHeaderStyles(header);\n\t\t\theader.useExtraPaddingForOSStatusBar = true;\n\t\t}\n\n\t//-------------------------\n\t// PickerList\n\t//-------------------------\n\n\t\tprotected function setPickerListStyles(list:PickerList):void\n\t\t{\n\t\t\tlist.toggleButtonOnOpenAndClose = true;\n\t\t\tlist.buttonFactory = pickerListButtonFactory;\n\t\t\tif(DeviceCapabilities.isPhone(this.starling.nativeStage))\n\t\t\t{\n\t\t\t\tlist.listFactory = pickerListSpinnerListFactory;\n\t\t\t\tlist.popUpContentManager = new BottomDrawerPopUpContentManager();\n\t\t\t}\n\t\t\telse //tablet or desktop\n\t\t\t{\n\t\t\t\tlist.popUpContentManager = new CalloutPopUpContentManager();\n\t\t\t\tlist.customItemRendererStyleName = THEME_STYLE_NAME_TABLET_PICKER_LIST_ITEM_RENDERER;\n\t\t\t}\n\t\t}\n\n\t\tprotected function setPickerListPopUpListStyles(list:List):void\n\t\t{\n\t\t\tthis.setDropDownListStyles(list);\n\t\t}\n\n\t\tprotected function setTabletPickerListItemRendererStyles(itemRenderer:BaseDefaultItemRenderer):void\n\t\t{\n\t\t\tvar defaultSkin:ImageSkin = new ImageSkin(this.itemRendererUpSkinTexture);\n\t\t\tdefaultSkin.scale9Grid = ITEM_RENDERER_SCALE_9_GRID;\n\t\t\tdefaultSkin.width = this.popUpFillSize;\n\t\t\tdefaultSkin.height = this.gridSize;\n\t\t\tdefaultSkin.minWidth = this.popUpFillSize;\n\t\t\tdefaultSkin.minHeight = this.gridSize;\n\t\t\titemRenderer.defaultSkin = defaultSkin;\n\n\t\t\t//different scale9Grid, so needs a separate skin\n\t\t\tvar otherSkin:ImageSkin = new ImageSkin(this.itemRendererDownSkinTexture);\n\t\t\totherSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\totherSkin.width = this.popUpFillSize;\n\t\t\totherSkin.height = this.gridSize;\n\t\t\totherSkin.minWidth = this.popUpFillSize;\n\t\t\totherSkin.minHeight = this.gridSize;\n\t\t\titemRenderer.setSkinForState(ButtonState.DOWN, otherSkin);\n\n\t\t\tvar defaultSelectedIcon:ImageLoader = new ImageLoader();\n\t\t\tdefaultSelectedIcon.source = this.checkItemRendererSelectedIconTexture;\n\t\t\titemRenderer.defaultSelectedIcon = defaultSelectedIcon;\n\n\t\t\tvar frame:Rectangle = this.checkItemRendererSelectedIconTexture.frame;\n\t\t\tif(frame)\n\t\t\t{\n\t\t\t\tvar iconWidth:Number = frame.width;\n\t\t\t\tvar iconHeight:Number = frame.height;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ticonWidth = this.checkItemRendererSelectedIconTexture.width;\n\t\t\t\ticonHeight = this.checkItemRendererSelectedIconTexture.height;\n\t\t\t}\n\t\t\tvar defaultIcon:Quad = new Quad(iconWidth, iconHeight, 0xff00ff);\n\t\t\tdefaultIcon.alpha = 0;\n\t\t\titemRenderer.defaultIcon = defaultIcon;\n\n\t\t\titemRenderer.fontStyles = this.primaryFontStyles.clone();\n\t\t\titemRenderer.disabledFontStyles = this.disabledFontStyles.clone();\n\t\t\titemRenderer.iconLabelFontStyles = this.primaryFontStyles.clone();\n\t\t\titemRenderer.iconLabelDisabledFontStyles = this.disabledFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelFontStyles = this.primaryFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelDisabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\titemRenderer.itemHasIcon = false;\n\n\t\t\titemRenderer.paddingTop = this.smallGutterSize;\n\t\t\titemRenderer.paddingBottom = this.smallGutterSize;\n\t\t\titemRenderer.paddingLeft = this.gutterSize;\n\t\t\titemRenderer.paddingRight = this.gutterSize;\n\t\t\titemRenderer.gap = Number.POSITIVE_INFINITY;\n\t\t\titemRenderer.minGap = this.gutterSize;\n\t\t\titemRenderer.iconPosition = RelativePosition.RIGHT;\n\t\t\titemRenderer.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\titemRenderer.accessoryGap = this.smallGutterSize;\n\t\t\titemRenderer.minAccessoryGap = this.smallGutterSize;\n\t\t\titemRenderer.accessoryPosition = RelativePosition.BOTTOM;\n\t\t\titemRenderer.layoutOrder = ItemRendererLayoutOrder.LABEL_ACCESSORY_ICON;\n\t\t\titemRenderer.minTouchWidth = this.gridSize;\n\t\t\titemRenderer.minTouchHeight = this.gridSize;\n\t\t}\n\n\t\tprotected function setPickerListButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonUpSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledSkinTexture);\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.pickerListButtonIconUpTexture);\n\t\t\ticon.disabledTexture = this.pickerListButtonIconDisabledTexture;\n\t\t\tif(button is ToggleButton)\n\t\t\t{\n\t\t\t\t//for convenience, this function can style both a regular button\n\t\t\t\t//and a toggle button\n\t\t\t\ticon.selectedTexture = this.pickerListButtonIconSelectedTexture;\n\t\t\t}\n\t\t\tbutton.defaultIcon = icon;\n\n\t\t\tbutton.fontStyles = this.primaryFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\n\t\t\tbutton.gap = Number.POSITIVE_INFINITY; //fill as completely as possible\n\t\t\tbutton.minGap = this.gutterSize;\n\t\t\tbutton.iconPosition = RelativePosition.RIGHT;\n\t\t\tbutton.horizontalAlign = HorizontalAlign.LEFT;\n\t\t}\n\n\t//-------------------------\n\t// ProgressBar\n\t//-------------------------\n\n\t\tprotected function setProgressBarStyles(progress:ProgressBar):void\n\t\t{\n\t\t\tvar backgroundSkin:Image = new Image(this.insetBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tif(progress.direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tbackgroundSkin.width = this.smallControlSize;\n\t\t\t\tbackgroundSkin.height = this.wideControlSize;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbackgroundSkin.width = this.wideControlSize;\n\t\t\t\tbackgroundSkin.height = this.smallControlSize;\n\t\t\t}\n\t\t\tprogress.backgroundSkin = backgroundSkin;\n\n\t\t\tvar backgroundDisabledSkin:Image = new Image(this.insetBackgroundDisabledSkinTexture);\n\t\t\tbackgroundDisabledSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tif(progress.direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tbackgroundDisabledSkin.width = this.smallControlSize;\n\t\t\t\tbackgroundDisabledSkin.height = this.wideControlSize;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbackgroundDisabledSkin.width = this.wideControlSize;\n\t\t\t\tbackgroundDisabledSkin.height = this.smallControlSize;\n\t\t\t}\n\t\t\tprogress.backgroundDisabledSkin = backgroundDisabledSkin;\n\n\t\t\tvar fillSkin:Image = new Image(this.buttonUpSkinTexture);\n\t\t\tfillSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tif(progress.direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tfillSkin.width = this.smallGutterSize;\n\t\t\t\tfillSkin.height = this.borderSize;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfillSkin.width = this.borderSize;\n\t\t\t\tfillSkin.height = this.smallGutterSize;\n\t\t\t}\n\t\t\tprogress.fillSkin = fillSkin;\n\n\t\t\tvar fillDisabledSkin:Image = new Image(this.buttonDisabledSkinTexture);\n\t\t\tfillDisabledSkin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tif(progress.direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tfillDisabledSkin.width = this.smallGutterSize;\n\t\t\t\tfillDisabledSkin.height = this.borderSize;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfillDisabledSkin.width = this.borderSize;\n\t\t\t\tfillDisabledSkin.height = this.smallGutterSize;\n\t\t\t}\n\t\t\tprogress.fillDisabledSkin = fillDisabledSkin;\n\t\t}\n\n\t//-------------------------\n\t// Radio\n\t//-------------------------\n\n\t\tprotected function setRadioStyles(radio:Radio):void\n\t\t{\n\t\t\tvar skin:Quad = new Quad(this.controlSize, this.controlSize);\n\t\t\tskin.alpha = 0;\n\t\t\tradio.defaultSkin = skin;\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.radioIconTexture);\n\t\t\ticon.selectedTexture = this.radioSelectedIconTexture;\n\t\t\ticon.setTextureForState(ButtonState.DISABLED, this.radioDisabledIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.radioSelectedDisabledIconTexture);\n\t\t\tradio.defaultIcon = icon;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tradio.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tradio.focusPadding = this.focusPaddingSize;\n\n\t\t\tradio.fontStyles = this.primaryFontStyles.clone();\n\t\t\tradio.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tradio.gap = this.smallGutterSize;\n\t\t\tradio.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tradio.verticalAlign = VerticalAlign.MIDDLE;\n\t\t\tradio.minTouchWidth = this.gridSize;\n\t\t\tradio.minTouchHeight = this.gridSize;\n\t\t}\n\n\t//-------------------------\n\t// ScrollContainer\n\t//-------------------------\n\n\t\tprotected function setScrollContainerStyles(container:ScrollContainer):void\n\t\t{\n\t\t\tthis.setScrollerStyles(container);\n\t\t}\n\n\t\tprotected function setToolbarScrollContainerStyles(container:ScrollContainer):void\n\t\t{\n\t\t\tthis.setScrollerStyles(container);\n\n\t\t\tif(!container.layout)\n\t\t\t{\n\t\t\t\tvar layout:HorizontalLayout = new HorizontalLayout();\n\t\t\t\tlayout.padding = this.smallGutterSize;\n\t\t\t\tlayout.gap = this.smallGutterSize;\n\t\t\t\tcontainer.layout = layout;\n\t\t\t}\n\n\t\t\tvar backgroundSkin:ImageSkin = new ImageSkin(this.headerSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = HEADER_SCALE_9_GRID;\n\t\t\tbackgroundSkin.width = this.gridSize;\n\t\t\tbackgroundSkin.height = this.gridSize;\n\t\t\tbackgroundSkin.minWidth = this.gridSize;\n\t\t\tbackgroundSkin.minHeight = this.gridSize;\n\t\t\tcontainer.backgroundSkin = backgroundSkin;\n\t\t}\n\n\t//-------------------------\n\t// ScrollScreen\n\t//-------------------------\n\n\t\tprotected function setScrollScreenStyles(screen:ScrollScreen):void\n\t\t{\n\t\t\tthis.setScrollerStyles(screen);\n\t\t}\n\n\t//-------------------------\n\t// ScrollText\n\t//-------------------------\n\n\t\tprotected function setScrollTextStyles(text:ScrollText):void\n\t\t{\n\t\t\tthis.setScrollerStyles(text);\n\n\t\t\ttext.fontStyles = this.scrollTextFontStyles.clone();\n\t\t\ttext.disabledFontStyles = this.scrollTextDisabledFontStyles.clone();\n\n\t\t\ttext.padding = this.gutterSize;\n\t\t\ttext.paddingRight = this.gutterSize + this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// SimpleScrollBar\n\t//-------------------------\n\n\t\tprotected function setSimpleScrollBarThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar defaultSkin:Image = new Image(this.scrollBarThumbSkinTexture);\n\t\t\tdefaultSkin.scale9Grid = SCROLLBAR_THUMB_SCALE_9_GRID;\n\t\t\tdefaultSkin.width = this.simpleScrollBarThumbSize;\n\t\t\tdefaultSkin.height = this.simpleScrollBarThumbSize;\n\t\t\tthumb.defaultSkin = defaultSkin;\n\n\t\t\tthumb.minTouchWidth = this.smallControlSize;\n\t\t\tthumb.minTouchHeight = this.smallControlSize;\n\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t//-------------------------\n\t// Slider\n\t//-------------------------\n\n\t\tprotected function setSliderStyles(slider:Slider):void\n\t\t{\n\t\t\tslider.trackLayoutMode = TrackLayoutMode.SINGLE;\n\n\t\t\tif(slider.direction == Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tslider.customMinimumTrackStyleName = THEME_STYLE_NAME_VERTICAL_SLIDER_MINIMUM_TRACK;\n\t\t\t}\n\t\t\telse //horizontal\n\t\t\t{\n\t\t\t\tslider.customMinimumTrackStyleName = THEME_STYLE_NAME_HORIZONTAL_SLIDER_MINIMUM_TRACK;\n\t\t\t}\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tslider.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tslider.focusPadding = this.focusPaddingSize;\n\t\t}\n\n\t\tprotected function setHorizontalSliderMinimumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.insetBackgroundSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.insetBackgroundDisabledSkinTexture);\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.width = this.wideControlSize;\n\t\t\tskin.height = this.smallControlSize;\n\t\t\tskin.minHeight = this.smallControlSize;\n\t\t\ttrack.defaultSkin = skin;\n\n\t\t\ttrack.minTouchHeight = this.gridSize;\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVerticalSliderMinimumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.insetBackgroundSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.insetBackgroundDisabledSkinTexture);\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.width = this.smallControlSize;\n\t\t\tskin.height = this.wideControlSize;\n\t\t\tskin.minWidth = this.smallControlSize;\n\t\t\ttrack.defaultSkin = skin;\n\n\t\t\ttrack.minTouchWidth = this.gridSize;\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setSliderThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.thumbSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.thumbDisabledSkinTexture);\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.width = this.smallControlSize;\n\t\t\tskin.height = this.smallControlSize;\n\t\t\tthumb.defaultSkin = skin;\n\n\t\t\tthumb.minTouchWidth = this.gridSize;\n\t\t\tthumb.minTouchHeight = this.gridSize;\n\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t//-------------------------\n\t// SpinnerList\n\t//-------------------------\n\n\t\tprotected function setSpinnerListStyles(list:SpinnerList):void\n\t\t{\n\t\t\tthis.setListStyles(list);\n\t\t\tlist.customItemRendererStyleName = THEME_STYLE_NAME_SPINNER_LIST_ITEM_RENDERER;\n\n\t\t\tvar selectionOverlaySkin:Image = new Image(this.spinnerListSelectionOverlaySkinTexture);\n\t\t\tselectionOverlaySkin.scale9Grid = SPINNER_LIST_SELECTION_OVERLAY_SCALE9_GRID;\n\t\t\tlist.selectionOverlaySkin = selectionOverlaySkin;\n\t\t}\n\n\t\tprotected function setSpinnerListItemRendererStyles(itemRenderer:BaseDefaultItemRenderer):void\n\t\t{\n\t\t\tvar skin:Quad = new Quad(this.gridSize, this.gridSize);\n\t\t\tskin.alpha = 0;\n\t\t\titemRenderer.defaultSkin = skin;\n\n\t\t\t//if it's not selected, we don't want it to be highlighted, so we're\n\t\t\t//borrowing the less prominent disabled color\n\t\t\titemRenderer.fontStyles = this.disabledFontStyles.clone();\n\t\t\titemRenderer.selectedFontStyles = this.primaryFontStyles.clone();\n\t\t\titemRenderer.disabledFontStyles = this.disabledFontStyles.clone();\n\t\t\titemRenderer.iconLabelFontStyles = this.disabledFontStyles.clone();\n\t\t\titemRenderer.iconLabelSelectedFontStyles = this.primaryFontStyles.clone();\n\t\t\titemRenderer.iconLabelDisabledFontStyles = this.disabledFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelFontStyles = this.disabledFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelSelectedFontStyles = this.primaryFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelDisabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\titemRenderer.paddingTop = this.smallGutterSize;\n\t\t\titemRenderer.paddingBottom = this.smallGutterSize;\n\t\t\titemRenderer.paddingLeft = this.gutterSize;\n\t\t\titemRenderer.paddingRight = this.gutterSize;\n\t\t\titemRenderer.gap = Number.POSITIVE_INFINITY;\n\t\t\titemRenderer.minGap = this.gutterSize;\n\t\t\titemRenderer.iconPosition = RelativePosition.RIGHT;\n\t\t\titemRenderer.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\titemRenderer.accessoryGap = Number.POSITIVE_INFINITY;\n\t\t\titemRenderer.minAccessoryGap = this.gutterSize;\n\t\t\titemRenderer.accessoryPosition = RelativePosition.RIGHT;\n\t\t\titemRenderer.minTouchWidth = this.gridSize;\n\t\t\titemRenderer.minTouchHeight = this.gridSize;\n\t\t\titemRenderer.isQuickHitAreaEnabled = true;\n\t\t}\n\n\t//-------------------------\n\t// TabBar\n\t//-------------------------\n\n\t\tprotected function setTabBarStyles(tabBar:TabBar):void\n\t\t{\n\t\t\ttabBar.distributeTabSizes = true;\n\t\t}\n\n\t\tprotected function setTabStyles(tab:ToggleButton):void\n\t\t{\n\t\t\tvar defaultSkin:ImageSkin = new ImageSkin(this.headerSkinTexture);\n\t\t\tdefaultSkin.scale9Grid = HEADER_SCALE_9_GRID;\n\t\t\tdefaultSkin.width = this.gridSize;\n\t\t\tdefaultSkin.height = this.gridSize;\n\t\t\tdefaultSkin.minWidth = this.gridSize;\n\t\t\tdefaultSkin.minHeight = this.gridSize;\n\t\t\ttab.defaultSkin = defaultSkin;\n\n\t\t\tvar otherSkin:ImageSkin = new ImageSkin(this.tabSelectedSkinTexture);\n\t\t\totherSkin.setTextureForState(ButtonState.DOWN, this.tabDownSkinTexture);\n\t\t\totherSkin.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.tabSelectedDisabledSkinTexture);\n\t\t\totherSkin.scale9Grid = TAB_SCALE_9_GRID;\n\t\t\totherSkin.width = this.gridSize;\n\t\t\totherSkin.height = this.gridSize;\n\t\t\totherSkin.minWidth = this.gridSize;\n\t\t\totherSkin.minHeight = this.gridSize;\n\t\t\ttab.defaultSelectedSkin = otherSkin;\n\t\t\ttab.setSkinForState(ButtonState.DOWN, otherSkin);\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\ttab.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\ttab.focusPadding = this.tabFocusPaddingSize;\n\n\t\t\ttab.fontStyles = this.primaryFontStyles.clone();\n\t\t\ttab.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\ttab.iconPosition = RelativePosition.TOP;\n\t\t\ttab.padding = this.gutterSize;\n\t\t\ttab.gap = this.smallGutterSize;\n\t\t\ttab.minGap = this.smallGutterSize;\n\t\t\ttab.minTouchWidth = this.gridSize;\n\t\t\ttab.minTouchHeight = this.gridSize;\n\t\t}\n\n\t//-------------------------\n\t// TextArea\n\t//-------------------------\n\n\t\tprotected function setTextAreaStyles(textArea:TextArea):void\n\t\t{\n\t\t\tthis.setScrollerStyles(textArea);\n\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.insetBackgroundSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.DISABLED, this.insetBackgroundDisabledSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.FOCUSED, this.insetBackgroundFocusedSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.ERROR, this.insetBackgroundDangerSkinTexture);\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.width = this.wideControlSize;\n\t\t\tskin.height = this.wideControlSize;\n\t\t\ttextArea.backgroundSkin = skin;\n\n\t\t\ttextArea.fontStyles = this.scrollTextFontStyles.clone();\n\t\t\ttextArea.disabledFontStyles = this.scrollTextDisabledFontStyles.clone();\n\n\t\t\ttextArea.promptFontStyles = this.primaryFontStyles.clone();\n\t\t\ttextArea.promptDisabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\ttextArea.textEditorFactory = textAreaTextEditorFactory;\n\t\t\t\n\t\t\ttextArea.innerPadding = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setTextAreaErrorCalloutStyles(callout:TextCallout):void\n\t\t{\n\t\t\tthis.setDangerTextCalloutStyles(callout);\n\t\t\tcallout.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tcallout.verticalAlign = VerticalAlign.TOP;\n\t\t}\n\n\t//-------------------------\n\t// TextCallout\n\t//-------------------------\n\n\t\tprotected function setTextCalloutStyles(callout:TextCallout):void\n\t\t{\n\t\t\tthis.setCalloutStyles(callout);\n\n\t\t\tcallout.fontStyles = this.primaryFontStyles.clone();\n\t\t\tcallout.disabledFontStyles = this.disabledFontStyles.clone();\n\t\t}\n\n\t\tprotected function setDangerTextCalloutStyles(callout:TextCallout):void\n\t\t{\n\t\t\tthis.setDangerCalloutStyles(callout);\n\n\t\t\tcallout.fontStyles = this.dangerFontStyles.clone();\n\t\t\tcallout.disabledFontStyles = this.disabledFontStyles.clone();\n\t\t}\n\n\t//-------------------------\n\t// TextInput\n\t//-------------------------\n\n\t\tprotected function setBaseTextInputStyles(input:TextInput):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.insetBackgroundSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.DISABLED, this.insetBackgroundDisabledSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.FOCUSED, this.insetBackgroundFocusedSkinTexture);\n\t\t\tskin.setTextureForState(TextInputState.ERROR, this.insetBackgroundDangerSkinTexture);\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.width = this.wideControlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.wideControlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tinput.backgroundSkin = skin;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tinput.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tinput.focusPadding = this.focusPaddingSize;\n\n\t\t\tinput.minTouchWidth = this.gridSize;\n\t\t\tinput.minTouchHeight = this.gridSize;\n\t\t\tinput.gap = this.smallGutterSize;\n\t\t\tinput.padding = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setTextInputStyles(input:TextInput):void\n\t\t{\n\t\t\tthis.setBaseTextInputStyles(input);\n\n\t\t\tinput.fontStyles = this.scrollTextFontStyles.clone();\n\t\t\tinput.disabledFontStyles = this.scrollTextDisabledFontStyles.clone();\n\n\t\t\tinput.promptFontStyles = this.primaryFontStyles.clone();\n\t\t\tinput.promptDisabledFontStyles = this.disabledFontStyles.clone();\n\t\t}\n\n\t\tprotected function setSearchTextInputStyles(input:TextInput):void\n\t\t{\n\t\t\tthis.setBaseTextInputStyles(input);\n\n\t\t\tinput.fontStyles = this.scrollTextFontStyles.clone();\n\t\t\tinput.disabledFontStyles = this.scrollTextDisabledFontStyles.clone();\n\n\t\t\tinput.promptFontStyles = this.primaryFontStyles.clone();\n\t\t\tinput.promptDisabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.searchIconTexture);\n\t\t\ticon.disabledTexture = this.searchIconDisabledTexture;\n\t\t\tinput.defaultIcon = icon;\n\t\t}\n\n\t\tprotected function setTextInputErrorCalloutStyles(callout:TextCallout):void\n\t\t{\n\t\t\tthis.setDangerTextCalloutStyles(callout);\n\n\t\t\tcallout.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tcallout.verticalAlign = VerticalAlign.TOP;\n\t\t}\n\n\t//-------------------------\n\t// Toast\n\t//-------------------------\n\n\t\tprotected function setToastStyles(toast:Toast):void\n\t\t{\n\t\t\tvar backgroundSkin:Quad = new Quad(1, 1, MODAL_OVERLAY_COLOR);\n\t\t\ttoast.backgroundSkin = backgroundSkin;\n\n\t\t\ttoast.fontStyles = this.primaryFontStyles.clone();\n\t\t\ttoast.disabledFontStyles = this.disabledFontStyles.clone();\n\n\t\t\ttoast.width = this.extraWideControlSize;\n\t\t\ttoast.paddingTop = this.smallGutterSize;\n\t\t\ttoast.paddingRight = this.gutterSize;\n\t\t\ttoast.paddingBottom = this.smallGutterSize;\n\t\t\ttoast.paddingLeft = this.gutterSize;\n\t\t\ttoast.gap = Number.POSITIVE_INFINITY;\n\t\t\ttoast.minGap = this.smallGutterSize;\n\t\t\ttoast.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\ttoast.verticalAlign = VerticalAlign.MIDDLE;\n\t\t}\n\n\t\tprotected function setToastActionsStyles(group:ButtonGroup):void\n\t\t{\n\t\t\tgroup.direction = Direction.HORIZONTAL;\n\t\t\tgroup.gap = this.smallGutterSize;\n\t\t\tgroup.customButtonStyleName = THEME_STYLE_NAME_TOAST_ACTIONS_BUTTON;\n\t\t}\n\n\t\tprotected function setToastActionsButtonStyles(button:Button):void\n\t\t{\n\t\t\tbutton.fontStyles = this.primaryFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.primaryFontStyles.clone();\n\t\t}\n\n\t//-------------------------\n\t// ToggleSwitch\n\t//-------------------------\n\n\t\tprotected function setToggleSwitchStyles(toggleSwitch:ToggleSwitch):void\n\t\t{\n\t\t\ttoggleSwitch.trackLayoutMode = TrackLayoutMode.SINGLE;\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\ttoggleSwitch.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\ttoggleSwitch.focusPadding = this.focusPaddingSize;\n\n\t\t\ttoggleSwitch.onLabelFontStyles = this.primaryFontStyles.clone();\n\t\t\ttoggleSwitch.onLabelDisabledFontStyles = this.disabledFontStyles.clone();\n\t\t\ttoggleSwitch.offLabelFontStyles = this.primaryFontStyles.clone();\n\t\t\ttoggleSwitch.offLabelDisabledFontStyles = this.disabledFontStyles.clone();\n\t\t}\n\n\t\tprotected function setToggleSwitchOnTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.insetBackgroundSkinTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.insetBackgroundDisabledSkinTexture);\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.width = Math.round(this.controlSize * 2.5);\n\t\t\tskin.height = this.controlSize;\n\t\t\ttrack.defaultSkin = skin;\n\t\t\ttrack.minTouchWidth = this.gridSize;\n\t\t\ttrack.minTouchHeight = this.gridSize;\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setToggleSwitchThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.thumbSkinTexture);\n\t\t\tskin.disabledTexture = this.thumbDisabledSkinTexture;\n\t\t\tskin.scale9Grid = DEFAULT_SCALE_9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tthumb.defaultSkin = skin;\n\t\t\t\n\t\t\tthumb.minTouchWidth = this.gridSize;\n\t\t\tthumb.minTouchHeight = this.gridSize;\n\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t//-------------------------\n\t// Tree\n\t//-------------------------\n\n\t\tprotected function setTreeStyles(tree:Tree):void\n\t\t{\n\t\t\tthis.setScrollerStyles(tree);\n\n\t\t\ttree.backgroundSkin = new Quad(this.gridSize, this.gridSize, LIST_BACKGROUND_COLOR);\n\t\t}\n\n\t\tprotected function setTreeItemRendererStyles(itemRenderer:DefaultTreeItemRenderer):void\n\t\t{\n\t\t\tthis.setItemRendererStyles(itemRenderer);\n\n\t\t\titemRenderer.indentation = this.treeDisclosureOpenIconTexture.width;\n\n\t\t\tvar disclosureOpenIcon:ImageSkin = new ImageSkin(this.treeDisclosureOpenIconTexture);\n\t\t\tdisclosureOpenIcon.textureSmoothing = TextureSmoothing.NONE;\n\t\t\tdisclosureOpenIcon.pixelSnapping = true;\n\t\t\t//make sure the hit area is large enough for touch screens\n\t\t\tdisclosureOpenIcon.minTouchWidth = this.gridSize;\n\t\t\tdisclosureOpenIcon.minTouchHeight = this.gridSize;\n\t\t\titemRenderer.disclosureOpenIcon = disclosureOpenIcon;\n\n\t\t\tvar disclosureClosedIcon:ImageSkin = new ImageSkin(this.treeDisclosureClosedIconTexture);\n\t\t\tdisclosureClosedIcon.textureSmoothing = TextureSmoothing.NONE;\n\t\t\tdisclosureClosedIcon.pixelSnapping = true;\n\t\t\tdisclosureClosedIcon.minTouchWidth = this.gridSize;\n\t\t\tdisclosureClosedIcon.minTouchHeight = this.gridSize;\n\t\t\titemRenderer.disclosureClosedIcon = disclosureClosedIcon;\n\t\t}\n\n\t//-------------------------\n\t// VideoPlayer\n\t//-------------------------\n\n\t\tprotected function setVideoPlayerStyles(player:VideoPlayer):void\n\t\t{\n\t\t\tplayer.backgroundSkin = new Quad(1, 1, 0x000000);\n\t\t}\n\n\t//-------------------------\n\t// PlayPauseToggleButton\n\t//-------------------------\n\n\t\tprotected function setPlayPauseToggleButtonStyles(button:PlayPauseToggleButton):void\n\t\t{\n\t\t\tvar defaultSkin:Quad = new Quad(this.controlSize, this.controlSize, 0xff00ff);\n\t\t\tdefaultSkin.alpha = 0;\n\t\t\tbutton.defaultSkin = defaultSkin;\n\n\t\t\tvar otherSkin:ImageSkin = new ImageSkin(null);\n\t\t\totherSkin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\totherSkin.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.buttonDownSkinTexture);\n\t\t\totherSkin.width = this.controlSize;\n\t\t\totherSkin.height = this.controlSize;\n\t\t\totherSkin.minWidth = this.controlSize;\n\t\t\totherSkin.minHeight = this.controlSize;\n\t\t\tbutton.setSkinForState(ButtonState.DOWN, otherSkin);\n\t\t\tbutton.setSkinForState(ButtonState.DOWN_AND_SELECTED, otherSkin);\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tbutton.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tbutton.focusPadding = this.focusPaddingSize;\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.playPauseButtonPlayUpIconTexture);\n\t\t\ticon.selectedTexture = this.playPauseButtonPauseUpIconTexture;\n\t\t\ticon.textureSmoothing = TextureSmoothing.NONE;\n\t\t\tbutton.defaultIcon = icon;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\n\t\t\tbutton.padding = this.smallGutterSize;\n\t\t\tbutton.gap = this.smallGutterSize;\n\t\t\tbutton.minGap = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setOverlayPlayPauseToggleButtonStyles(button:PlayPauseToggleButton):void\n\t\t{\n\t\t\tvar icon:ImageSkin = new ImageSkin(null);\n\t\t\ticon.setTextureForState(ButtonState.UP, this.overlayPlayPauseButtonPlayUpIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.HOVER, this.overlayPlayPauseButtonPlayUpIconTexture);\n\t\t\tbutton.defaultIcon = icon;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\n\t\t\tvar skin:Quad = new Quad(this.overlayPlayPauseButtonPlayUpIconTexture.width,\n\t\t\t\tthis.overlayPlayPauseButtonPlayUpIconTexture.height);\n\t\t\tskin.alpha = 0;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tvar overlaySkin:Quad = new Quad(1, 1, VIDEO_OVERLAY_COLOR);\n\t\t\toverlaySkin.alpha = VIDEO_OVERLAY_ALPHA;\n\t\t\tbutton.upSkin = overlaySkin;\n\t\t\tbutton.hoverSkin = overlaySkin;\n\t\t}\n\n\t//-------------------------\n\t// FullScreenToggleButton\n\t//-------------------------\n\n\t\tprotected function setFullScreenToggleButtonStyles(button:FullScreenToggleButton):void\n\t\t{\n\t\t\tvar defaultSkin:Quad = new Quad(this.controlSize, this.controlSize, 0xff00ff);\n\t\t\tdefaultSkin.alpha = 0;\n\t\t\tbutton.defaultSkin = defaultSkin;\n\n\t\t\tvar otherSkin:ImageSkin = new ImageSkin(null);\n\t\t\totherSkin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\totherSkin.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.buttonDownSkinTexture);\n\t\t\totherSkin.width = this.controlSize;\n\t\t\totherSkin.height = this.controlSize;\n\t\t\totherSkin.minWidth = this.controlSize;\n\t\t\totherSkin.minHeight = this.controlSize;\n\t\t\tbutton.setSkinForState(ButtonState.DOWN, otherSkin);\n\t\t\tbutton.setSkinForState(ButtonState.DOWN_AND_SELECTED, otherSkin);\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tbutton.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tbutton.focusPadding = this.focusPaddingSize;\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.fullScreenToggleButtonEnterUpIconTexture);\n\t\t\ticon.selectedTexture = this.fullScreenToggleButtonExitUpIconTexture;\n\t\t\ticon.textureSmoothing = TextureSmoothing.NONE;\n\t\t\tbutton.defaultIcon = icon;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\n\t\t\tbutton.padding = this.smallGutterSize;\n\t\t\tbutton.gap = this.smallGutterSize;\n\t\t\tbutton.minGap = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// MuteToggleButton\n\t//-------------------------\n\n\t\tprotected function setMuteToggleButtonStyles(button:MuteToggleButton):void\n\t\t{\n\t\t\tvar defaultSkin:Quad = new Quad(this.controlSize, this.controlSize, 0xff00ff);\n\t\t\tdefaultSkin.alpha = 0;\n\t\t\tbutton.defaultSkin = defaultSkin;\n\n\t\t\tvar otherSkin:ImageSkin = new ImageSkin(null);\n\t\t\totherSkin.setTextureForState(ButtonState.DOWN, this.buttonDownSkinTexture);\n\t\t\totherSkin.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.buttonDownSkinTexture);\n\t\t\totherSkin.width = this.controlSize;\n\t\t\totherSkin.height = this.controlSize;\n\t\t\totherSkin.minWidth = this.controlSize;\n\t\t\totherSkin.minHeight = this.controlSize;\n\t\t\tbutton.setSkinForState(ButtonState.DOWN, otherSkin);\n\t\t\tbutton.setSkinForState(ButtonState.DOWN_AND_SELECTED, otherSkin);\n\n\t\t\tvar focusIndicatorSkin:Image = new Image(this.focusIndicatorSkinTexture);\n\t\t\tfocusIndicatorSkin.scale9Grid = FOCUS_INDICATOR_SCALE_9_GRID;\n\t\t\tbutton.focusIndicatorSkin = focusIndicatorSkin;\n\t\t\tbutton.focusPadding = this.focusPaddingSize;\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.muteToggleButtonLoudUpIconTexture);\n\t\t\ticon.selectedTexture = this.muteToggleButtonMutedUpIconTexture;\n\t\t\ticon.textureSmoothing = TextureSmoothing.NONE;\n\t\t\tbutton.defaultIcon = icon;\n\n\t\t\tbutton.hasLabelTextRenderer = false;\n\t\t\tbutton.showVolumeSliderOnHover = false;\n\n\t\t\tbutton.padding = this.smallGutterSize;\n\t\t\tbutton.gap = this.smallGutterSize;\n\t\t\tbutton.minGap = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// SeekSlider\n\t//-------------------------\n\n\t\tprotected function setSeekSliderStyles(slider:SeekSlider):void\n\t\t{\n\t\t\tslider.direction = Direction.HORIZONTAL;\n\t\t\tslider.trackLayoutMode = TrackLayoutMode.SINGLE;\n\n\t\t\tvar progressSkin:Image = new Image(this.seekSliderProgressSkinTexture);\n\t\t\tprogressSkin.scale9Grid = SEEK_SLIDER_PROGRESS_SKIN_SCALE9_GRID;\n\t\t\tslider.progressSkin = progressSkin;\n\t\t}\n\n\t//-------------------------\n\t// VolumeSlider\n\t//-------------------------\n\n\t\tprotected function setVolumeSliderStyles(slider:VolumeSlider):void\n\t\t{\n\t\t\tslider.direction = Direction.HORIZONTAL;\n\t\t\tslider.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tslider.showThumb = false;\n\t\t}\n\n\t\tprotected function setVolumeSliderThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar thumbSize:Number = 6;\n\t\t\tthumb.defaultSkin = new Quad(thumbSize, thumbSize);\n\t\t\tthumb.defaultSkin.width = 0;\n\t\t\tthumb.defaultSkin.height = 0;\n\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVolumeSliderMinimumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar defaultSkin:ImageLoader = new ImageLoader();\n\t\t\tdefaultSkin.scaleContent = false;\n\t\t\tdefaultSkin.source = this.volumeSliderMinimumTrackSkinTexture;\n\t\t\ttrack.defaultSkin = defaultSkin;\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\n\t\t\ttrack.minTouchHeight = this.gridSize;\n\t\t}\n\n\t\tprotected function setVolumeSliderMaximumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar defaultSkin:ImageLoader = new ImageLoader();\n\t\t\tdefaultSkin.scaleContent = false;\n\t\t\tdefaultSkin.horizontalAlign = HorizontalAlign.RIGHT;\n\t\t\tdefaultSkin.source = this.volumeSliderMaximumTrackSkinTexture;\n\t\t\ttrack.defaultSkin = defaultSkin;\n\n\t\t\ttrack.hasLabelTextRenderer = false;\n\n\t\t\ttrack.minTouchHeight = this.gridSize;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "themes/MinimalMobileTheme/source/feathers/themes/MinimalMobileTheme.as",
    "content": "/*\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n*/\npackage feathers.themes\n{\n\timport flash.display.Bitmap;\n\timport flash.display.BitmapData;\n\n\timport starling.text.BitmapFont;\n\timport starling.text.TextField;\n\timport starling.textures.Texture;\n\timport starling.textures.TextureAtlas;\n\n\t/**\n\t * The \"Minimal\" theme for mobile Feathers apps.\n\t *\n\t * <p>This version of the theme embeds its assets. To load assets at\n\t * runtime, see <code>MinimalMobileThemeWithAssetManager</code> instead.</p>\n\t *\n\t * @see http://feathersui.com/help/theme-assets.html\n\t */\n\tpublic class MinimalMobileTheme extends BaseMinimalMobileTheme\n\t{\n\t\t/**\n\t\t * @private\n\t\t */\n\t\t[Embed(source=\"/../assets/images/minimal_mobile.xml\",mimeType=\"application/octet-stream\")]\n\t\tprotected static const ATLAS_XML:Class;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\t[Embed(source=\"/../assets/images/minimal_mobile.png\")]\n\t\tprotected static const ATLAS_BITMAP:Class;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\t[Embed(source=\"/../assets/fonts/pf_ronda_seven.fnt\",mimeType=\"application/octet-stream\")]\n\t\tprotected static const FONT_XML:Class;\n\n\t\t/**\n\t\t * Constructor.\n\t\t */\n\t\tpublic function MinimalMobileTheme()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.initialize();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tthis.initializeTextureAtlas();\n\t\t\tthis.initializeBitmapFont();\n\t\t\tsuper.initialize();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function initializeTextureAtlas():void\n\t\t{\n\t\t\tvar atlasBitmapData:BitmapData = Bitmap(new ATLAS_BITMAP()).bitmapData;\n\t\t\tvar atlasTexture:Texture = Texture.fromBitmapData(atlasBitmapData, false, false, 2);\n\t\t\tatlasTexture.root.onRestore = this.atlasTexture_onRestore;\n\t\t\tatlasBitmapData.dispose();\n\t\t\tthis.atlas = new TextureAtlas(atlasTexture, XML(new ATLAS_XML()));\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function initializeBitmapFont():void\n\t\t{\n\t\t\tvar bitmapFont:BitmapFont = new BitmapFont(this.atlas.getTexture(FONT_TEXTURE_NAME), XML(new FONT_XML()));\n\t\t\tTextField.registerCompositor(bitmapFont, FONT_NAME);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function atlasTexture_onRestore():void\n\t\t{\n\t\t\tvar atlasBitmapData:BitmapData = Bitmap(new ATLAS_BITMAP()).bitmapData;\n\t\t\tthis.atlas.texture.root.uploadBitmapData(atlasBitmapData);\n\t\t\tatlasBitmapData.dispose();\n\t\t}\n\t}\n}"
  },
  {
    "path": "themes/MinimalMobileTheme/source/feathers/themes/MinimalMobileThemeWithAssetManager.as",
    "content": "/*\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved.\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n*/\npackage feathers.themes\n{\n\timport feathers.events.FeathersEventType;\n\n\timport starling.assets.AssetManager;\n\timport starling.core.Starling;\n\timport starling.events.Event;\n\timport starling.text.BitmapFont;\n\timport starling.text.TextField;\n\n\t/**\n\t * @copy feathers.themes.IAsyncTheme#event:complete\n\t *\n\t * @eventType starling.events.Event.COMPLETE\n\t */\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the theme's assets fail to load due to an error.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The error string.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.ERROR\n\t */\n\t[Event(name=\"error\",type=\"starling.events.Event\")]\n\n\t/**\n\t * The \"Minimal\" theme for mobile Feathers apps.\n\t *\n\t * <p>This version of the theme requires loading assets at runtime. To use\n\t * embedded assets, see <code>MinimalMobileTheme</code> instead.</p>\n\t *\n\t * <p>To use this theme, the following files must be included when packaging\n\t * your app:</p>\n\t * <ul>\n\t *     <li>images/minimal_mobile.png</li>\n\t *     <li>images/minimal_mobile.xml</li>\n\t *     <li>fonts/pf_ronda_seven.fnt</li>\n\t * </ul>\n\t *\n\t * @see http://feathersui.com/help/theme-assets.html\n\t */\n\tpublic class MinimalMobileThemeWithAssetManager extends BaseMinimalMobileTheme implements IAsyncTheme\n\t{\n\t\t/**\n\t\t * @private\n\t\t * The name of the texture atlas in the asset manager.\n\t\t */\n\t\tprotected static const ATLAS_NAME:String = \"minimal_mobile\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const ATLAS_SCALE_FACTOR:int = 2;\n\n\t\t/**\n\t\t * Constructor.\n\t\t * @param assetsBasePath The root folder of the assets.\n\t\t * @param assetManager An optional pre-created AssetManager. The scaleFactor property must be equal to Starling.contentScaleFactor. To load assets with a different scale factor, use multiple AssetManager instances.\n\t\t */\n\t\tpublic function MinimalMobileThemeWithAssetManager(assetsBasePath:String = \"./\", assetManager:AssetManager = null)\n\t\t{\n\t\t\tthis.loadAssets(assetsBasePath, assetManager);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * The paths to each of the assets, relative to the base path.\n\t\t */\n\t\tprotected var assetPaths:Vector.<String> = new <String>\n\t\t[\n\t\t\t\"images/\" + ATLAS_NAME + \".xml\",\n\t\t\t\"images/\" + ATLAS_NAME + \".png\",\n\t\t\t\"fonts/pf_ronda_seven.fnt\"\n\t\t];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var assetManager:AssetManager;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var isComplete:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tsuper.dispose();\n\t\t\tif(this.assetManager)\n\t\t\t{\n\t\t\t\tthis.assetManager.removeTextureAtlas(ATLAS_NAME);\n\t\t\t\tthis.assetManager = null;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.themes.IAsyncTheme#isCompleteForStarling()\n\t\t */\n\t\tpublic function isCompleteForStarling(starling:Starling):Boolean\n\t\t{\n\t\t\treturn this.isComplete;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tthis.initializeTextureAtlas();\n\t\t\tthis.initializeBitmapFont();\n\t\t\tsuper.initialize();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function initializeTextureAtlas():void\n\t\t{\n\t\t\tthis.atlas = this.assetManager.getTextureAtlas(ATLAS_NAME);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function initializeBitmapFont():void\n\t\t{\n\t\t\tvar font:BitmapFont = TextField.getBitmapFont(FONT_TEXTURE_NAME);\n\t\t\t//for convenience, let's also register it using this name\n\t\t\tTextField.registerCompositor(font, FONT_NAME);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function loadAssets(assetsBasePath:String, assetManager:AssetManager):void\n\t\t{\n\t\t\tvar oldScaleFactor:Number = -1;\n\t\t\tif(assetManager)\n\t\t\t{\n\t\t\t\toldScaleFactor = assetManager.textureOptions.scale;\n\t\t\t\tassetManager.textureOptions.scale = ATLAS_SCALE_FACTOR;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tassetManager = new AssetManager(ATLAS_SCALE_FACTOR);\n\t\t\t}\n\t\t\tthis.assetManager = assetManager;\n\t\t\t//add a trailing slash, if needed\n\t\t\tif(assetsBasePath.lastIndexOf(\"/\") != assetsBasePath.length - 1)\n\t\t\t{\n\t\t\t\tassetsBasePath += \"/\";\n\t\t\t}\n\t\t\tvar assetPaths:Vector.<String> = this.assetPaths;\n\t\t\tvar assetCount:int = assetPaths.length;\n\t\t\tfor(var i:int = 0; i < assetCount; i++)\n\t\t\t{\n\t\t\t\tvar asset:String = assetPaths[i];\n\t\t\t\tthis.assetManager.enqueue(assetsBasePath + asset);\n\t\t\t}\n\t\t\tif(oldScaleFactor != -1)\n\t\t\t{\n\t\t\t\t//restore the old scale factor, just in case\n\t\t\t\tthis.assetManager.textureOptions.scale = oldScaleFactor;\n\t\t\t}\n\t\t\tthis.assetManager.loadQueue(assetManager_onComplete, assetManager_onError);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function assetManager_onComplete():void\n\t\t{\n\t\t\tthis.initialize();\n\t\t\tthis.isComplete = true;\n\t\t\tthis.dispatchEventWith(Event.COMPLETE, false, Starling.current);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function assetManager_onError(error:String):void\n\t\t{\n\t\t\tthis.dispatchEventWith(FeathersEventType.ERROR, false, error);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "themes/TopcoatLightMobileTheme/README.md",
    "content": "# Topcoat Light Mobile Theme for Feathers\n\n[Feathers](http://feathersui.com/) theme for mobile devices inspired by [Topcoat UI](http://topcoat.io/).\n\n## Original Artwork\n\nThis theme's texture atlas was exported from Adobe Animate CC. To modify colors and other properties, or to add new skins to the texture atlas, [download the source FLA file](http://feathersui.com/help/theme-sources.html) from the Feathers website.\n\n## Credits\n\nCreated exclusively for Feathers by [Marcel Piestansky](http://marpies.com/). Uses the open source font [Source Sans Pro](https://github.com/adobe/Source-Sans-Pro) created by Adobe Systems Incorporated."
  },
  {
    "path": "themes/TopcoatLightMobileTheme/assets/images/topcoat_light_mobile.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<TextureAtlas imagePath=\"topcoat_light_mobile.png\">\n\t<!-- Created with Adobe Animate version 19.0.0.326 -->\n\t<!-- http://www.adobe.com/products/animate.html -->\n\t<SubTexture name=\"background-popup-skin0000\" x=\"311\" y=\"367\" width=\"54\" height=\"58\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-back-disabled-skin0000\" x=\"203\" y=\"1\" width=\"80\" height=\"100\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-back-down-skin0000\" x=\"122\" y=\"102\" width=\"80\" height=\"100\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-back-up-skin0000\" x=\"122\" y=\"203\" width=\"80\" height=\"100\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-call-to-action-disabled-skin0000\" x=\"366\" y=\"367\" width=\"30\" height=\"100\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-call-to-action-down-skin0000\" x=\"422\" y=\"203\" width=\"30\" height=\"100\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-call-to-action-up-skin0000\" x=\"407\" y=\"1\" width=\"30\" height=\"100\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-danger-disabled-skin0000\" x=\"391\" y=\"243\" width=\"30\" height=\"100\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-danger-down-skin0000\" x=\"407\" y=\"102\" width=\"30\" height=\"100\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-danger-up-skin0000\" x=\"397\" y=\"344\" width=\"30\" height=\"100\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-disabled-skin0000\" x=\"239\" y=\"459\" width=\"32\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-down-skin0000\" x=\"272\" y=\"459\" width=\"32\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-forward-disabled-skin0000\" x=\"122\" y=\"1\" width=\"80\" height=\"100\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-forward-down-skin0000\" x=\"203\" y=\"102\" width=\"80\" height=\"100\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-forward-up-skin0000\" x=\"203\" y=\"203\" width=\"80\" height=\"100\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"button-up-skin0000\" x=\"305\" y=\"459\" width=\"32\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"callout-arrow-bottom-skin0000\" x=\"128\" y=\"304\" width=\"79\" height=\"46\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"callout-arrow-left-skin0000\" x=\"1\" y=\"353\" width=\"44\" height=\"85\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"callout-arrow-right-skin0000\" x=\"83\" y=\"304\" width=\"44\" height=\"85\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"callout-arrow-top-skin0000\" x=\"1\" y=\"304\" width=\"81\" height=\"48\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"check-disabled-icon0000\" x=\"284\" y=\"1\" width=\"60\" height=\"60\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"check-down-icon0000\" x=\"284\" y=\"62\" width=\"60\" height=\"60\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"check-selected-disabled-icon0000\" x=\"284\" y=\"123\" width=\"60\" height=\"60\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"check-selected-down-icon0000\" x=\"208\" y=\"304\" width=\"60\" height=\"60\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"check-selected-up-icon0000\" x=\"128\" y=\"351\" width=\"60\" height=\"60\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"check-up-icon0000\" x=\"269\" y=\"304\" width=\"60\" height=\"60\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-column-drop-indicator-skin0000\" x=\"172\" y=\"469\" width=\"6\" height=\"6\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-column-resize-skin0000\" x=\"172\" y=\"469\" width=\"6\" height=\"6\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-header-divider-skin0000\" x=\"172\" y=\"460\" width=\"6\" height=\"8\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-header-skin0000\" x=\"98\" y=\"390\" width=\"10\" height=\"20\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-header-sort-ascending-icon0000\" x=\"309\" y=\"287\" width=\"20\" height=\"14\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"data-grid-header-sort-descending-icon0000\" x=\"77\" y=\"390\" width=\"20\" height=\"14\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"drag-handle-icon0000\" x=\"1\" y=\"481\" width=\"32\" height=\"30\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"focus-indicator-skin0000\" x=\"422\" y=\"304\" width=\"33\" height=\"33\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"grouped-list-footer-skin0000\" x=\"109\" y=\"390\" width=\"10\" height=\"20\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"grouped-list-header-skin0000\" x=\"98\" y=\"390\" width=\"10\" height=\"20\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"header-background-skin0000\" x=\"46\" y=\"353\" width=\"30\" height=\"122\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"list-first-item-up-skin0000\" x=\"453\" y=\"233\" width=\"10\" height=\"22\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"list-item-down-skin0000\" x=\"453\" y=\"256\" width=\"10\" height=\"22\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"list-item-selected-skin0000\" x=\"464\" y=\"233\" width=\"10\" height=\"22\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"list-item-up-skin0000\" x=\"456\" y=\"279\" width=\"10\" height=\"22\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"page-indicator-normal-skin0000\" x=\"284\" y=\"245\" width=\"41\" height=\"41\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"page-indicator-selected-skin0000\" x=\"1\" y=\"439\" width=\"41\" height=\"41\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"picker-list-button-disabled-icon0000\" x=\"179\" y=\"483\" width=\"23\" height=\"13\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"picker-list-button-icon0000\" x=\"341\" y=\"451\" width=\"23\" height=\"13\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"pop-up-drawer-background-skin0000\" x=\"407\" y=\"228\" width=\"11\" height=\"14\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"progress-bar-horizontal-background-disabled-skin0000\" x=\"138\" y=\"412\" width=\"33\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"progress-bar-horizontal-background-skin0000\" x=\"428\" y=\"338\" width=\"33\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"progress-bar-horizontal-fill-disabled-skin0000\" x=\"428\" y=\"404\" width=\"33\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"progress-bar-horizontal-fill-skin0000\" x=\"428\" y=\"371\" width=\"33\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"progress-bar-vertical-background-disabled-skin0000\" x=\"397\" y=\"445\" width=\"32\" height=\"33\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"progress-bar-vertical-background-skin0000\" x=\"430\" y=\"437\" width=\"32\" height=\"33\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"progress-bar-vertical-fill-disabled-skin0000\" x=\"430\" y=\"471\" width=\"32\" height=\"33\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"progress-bar-vertical-fill-skin0000\" x=\"172\" y=\"426\" width=\"32\" height=\"33\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"radio-disabled-icon0000\" x=\"330\" y=\"245\" width=\"60\" height=\"60\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"radio-down-icon0000\" x=\"330\" y=\"306\" width=\"60\" height=\"60\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"radio-selected-disabled-icon0000\" x=\"284\" y=\"184\" width=\"60\" height=\"60\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"radio-selected-down-icon0000\" x=\"77\" y=\"412\" width=\"60\" height=\"60\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"radio-selected-up-icon0000\" x=\"189\" y=\"365\" width=\"60\" height=\"60\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"radio-up-icon0000\" x=\"250\" y=\"365\" width=\"60\" height=\"60\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"search-input-disabled-skin0000\" x=\"1\" y=\"1\" width=\"120\" height=\"100\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"search-input-focused-skin0000\" x=\"1\" y=\"102\" width=\"120\" height=\"100\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"search-input-icon0000\" x=\"453\" y=\"199\" width=\"31\" height=\"33\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"search-input-up-skin0000\" x=\"1\" y=\"203\" width=\"120\" height=\"100\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"simple-scroll-bar-horizontal-thumb-skin0000\" x=\"284\" y=\"287\" width=\"24\" height=\"12\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"simple-scroll-bar-vertical-thumb-skin0000\" x=\"407\" y=\"203\" width=\"12\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"slider-horizontal-maximum-track-disabled-skin0000\" x=\"138\" y=\"445\" width=\"33\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"slider-horizontal-maximum-track-skin0000\" x=\"205\" y=\"426\" width=\"33\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"slider-horizontal-minimum-track-disabled-skin0000\" x=\"77\" y=\"473\" width=\"33\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"slider-horizontal-minimum-track-skin0000\" x=\"205\" y=\"459\" width=\"33\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"slider-vertical-maximum-track-disabled-skin0000\" x=\"273\" y=\"426\" width=\"33\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"slider-vertical-maximum-track-skin0000\" x=\"43\" y=\"476\" width=\"33\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"slider-vertical-minimum-track-disabled-skin0000\" x=\"307\" y=\"426\" width=\"33\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"slider-vertical-minimum-track-skin0000\" x=\"239\" y=\"426\" width=\"33\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"spinner-list-selection-overlay-skin0000\" x=\"179\" y=\"460\" width=\"24\" height=\"22\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tab-down-skin0000\" x=\"376\" y=\"122\" width=\"30\" height=\"120\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tab-selected-disabled-skin0000\" x=\"376\" y=\"1\" width=\"30\" height=\"120\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tab-selected-up-skin0000\" x=\"345\" y=\"122\" width=\"30\" height=\"120\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tab-up-skin0000\" x=\"345\" y=\"1\" width=\"30\" height=\"120\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"text-input-disabled-skin0000\" x=\"371\" y=\"479\" width=\"32\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"text-input-error-skin0000\" x=\"438\" y=\"1\" width=\"32\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"text-input-focused-skin0000\" x=\"338\" y=\"468\" width=\"32\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"text-input-up-skin0000\" x=\"438\" y=\"100\" width=\"32\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"toggle-button-selected-disabled-skin0000\" x=\"438\" y=\"34\" width=\"32\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"toggle-button-selected-up-skin0000\" x=\"438\" y=\"67\" width=\"32\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"toggle-switch-off-track-disabled-skin0000\" x=\"145\" y=\"478\" width=\"33\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"toggle-switch-off-track-skin0000\" x=\"111\" y=\"478\" width=\"33\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"toggle-switch-on-track-disabled-skin0000\" x=\"438\" y=\"133\" width=\"32\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"toggle-switch-on-track-skin0000\" x=\"438\" y=\"166\" width=\"32\" height=\"32\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tree-disclosure-closed-icon0000\" x=\"404\" y=\"479\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n\t<SubTexture name=\"tree-disclosure-open-icon0000\" x=\"341\" y=\"426\" width=\"24\" height=\"24\" pivotX=\"0\" pivotY=\"0\"/>\n</TextureAtlas>\n"
  },
  {
    "path": "themes/TopcoatLightMobileTheme/package-src.json",
    "content": "{\n\t\"id\": \"feathersui_TopcoatLightMobileTheme-source\",\n\t\"name\": \"Feathers UI Topcoat Light Mobile Theme\",\n\t\"url\": \"https://feathersui.com/as3-starling/\",\n\t\"docUrl\": \"https://feathersui/api-reference/\",\n\t\"description\": \"Topcoat light mobile theme for Feathers UI (Starling version)\",\n\t\"type\": \"src\",\n\t\"version\": \"4.2.0\",\n\t\"sourceUrl\": \"https://github.com/feathersui/feathersui-starling/releases/download/v4.2.0/feathersui_TopcoatLightMobileTheme-source_4.2.0.airpackage\",\n\t\"publishedAt\": \"2021-11-19T00:00:00.000Z\",\n\t\"dependencies\": [\n\t\t\"starling-source:2.x.x\",\n\t\t\"feathersui-source:4.2.x\"\n\t],\n\t\"parameters\": [],\n\t\"tags\": [\"theme\", \"feathers\", \"starling\"],\n\t\"status\": \"release\",\n\t\"license\": {\n\t  \"type\": \"Simplified BSD\",\n\t  \"url\": \"https://github.com/feathersui/feathersui-starling/blob/v4.2.0/LICENSE.md\",\n\t  \"public\": true\n\t}\n  }\n  "
  },
  {
    "path": "themes/TopcoatLightMobileTheme/package-swc.json",
    "content": "{\n\t\"id\": \"feathersui_TopcoatLightMobileTheme\",\n\t\"name\": \"Feathers UI Topcoat Light Mobile Theme\",\n\t\"url\": \"https://feathersui.com/as3-starling/\",\n\t\"docUrl\": \"https://feathersui/api-reference/\",\n\t\"description\": \"Topcoat light mobile theme for Feathers UI (Starling version)\",\n\t\"type\": \"swc\",\n\t\"version\": \"4.2.0\",\n\t\"sourceUrl\": \"https://github.com/feathersui/feathersui-starling/releases/download/v4.2.0/feathersui_TopcoatLightMobileTheme_4.2.0.airpackage\",\n\t\"publishedAt\": \"2021-11-19T00:00:00.000Z\",\n\t\"dependencies\": [\n\t\t\"starling:2.x.x\",\n\t\t\"feathersui:4.2.x\"\n\t],\n\t\"parameters\": [],\n\t\"tags\": [\"theme\", \"feathers\", \"starling\"],\n\t\"status\": \"release\",\n\t\"license\": {\n\t  \"type\": \"Simplified BSD\",\n\t  \"url\": \"https://github.com/feathersui/feathersui-starling/blob/v4.2.0/LICENSE.md\",\n\t  \"public\": true\n\t}\n  }\n  "
  },
  {
    "path": "themes/TopcoatLightMobileTheme/source/feathers/themes/BaseTopcoatLightMobileTheme.as",
    "content": "/*\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved., Marcel Piestansky\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n*/\npackage feathers.themes\n{\n\timport feathers.controls.Alert;\n\timport feathers.controls.AutoComplete;\n\timport feathers.controls.AutoSizeMode;\n\timport feathers.controls.Button;\n\timport feathers.controls.ButtonGroup;\n\timport feathers.controls.ButtonState;\n\timport feathers.controls.Callout;\n\timport feathers.controls.Check;\n\timport feathers.controls.DataGrid;\n\timport feathers.controls.DateTimeSpinner;\n\timport feathers.controls.Drawers;\n\timport feathers.controls.GroupedList;\n\timport feathers.controls.Header;\n\timport feathers.controls.ImageLoader;\n\timport feathers.controls.Label;\n\timport feathers.controls.LayoutGroup;\n\timport feathers.controls.List;\n\timport feathers.controls.NumericStepper;\n\timport feathers.controls.PageIndicator;\n\timport feathers.controls.Panel;\n\timport feathers.controls.PanelScreen;\n\timport feathers.controls.PickerList;\n\timport feathers.controls.ProgressBar;\n\timport feathers.controls.Radio;\n\timport feathers.controls.ScrollContainer;\n\timport feathers.controls.ScrollPolicy;\n\timport feathers.controls.ScrollText;\n\timport feathers.controls.Scroller;\n\timport feathers.controls.SimpleScrollBar;\n\timport feathers.controls.Slider;\n\timport feathers.controls.SpinnerList;\n\timport feathers.controls.StepperButtonLayoutMode;\n\timport feathers.controls.TabBar;\n\timport feathers.controls.TextArea;\n\timport feathers.controls.TextCallout;\n\timport feathers.controls.TextInput;\n\timport feathers.controls.TextInputState;\n\timport feathers.controls.Toast;\n\timport feathers.controls.ToggleButton;\n\timport feathers.controls.ToggleSwitch;\n\timport feathers.controls.TrackLayoutMode;\n\timport feathers.controls.Tree;\n\timport feathers.controls.popups.BottomDrawerPopUpContentManager;\n\timport feathers.controls.popups.CalloutPopUpContentManager;\n\timport feathers.controls.renderers.BaseDefaultItemRenderer;\n\timport feathers.controls.renderers.DefaultDataGridCellRenderer;\n\timport feathers.controls.renderers.DefaultDataGridHeaderRenderer;\n\timport feathers.controls.renderers.DefaultGroupedListHeaderOrFooterRenderer;\n\timport feathers.controls.renderers.DefaultGroupedListItemRenderer;\n\timport feathers.controls.renderers.DefaultListItemRenderer;\n\timport feathers.controls.renderers.DefaultTreeItemRenderer;\n\timport feathers.controls.text.ITextEditorViewPort;\n\timport feathers.controls.text.StageTextTextEditor;\n\timport feathers.controls.text.TextBlockTextEditor;\n\timport feathers.controls.text.TextBlockTextRenderer;\n\timport feathers.controls.text.TextFieldTextEditorViewPort;\n\timport feathers.core.FeathersControl;\n\timport feathers.core.ITextEditor;\n\timport feathers.core.ITextRenderer;\n\timport feathers.core.PopUpManager;\n\timport feathers.layout.Direction;\n\timport feathers.layout.HorizontalAlign;\n\timport feathers.layout.HorizontalLayout;\n\timport feathers.layout.RelativePosition;\n\timport feathers.layout.VerticalAlign;\n\timport feathers.layout.VerticalLayout;\n\timport feathers.skins.ImageSkin;\n\timport feathers.system.DeviceCapabilities;\n\n\timport flash.geom.Rectangle;\n\n\timport starling.display.DisplayObject;\n\timport starling.display.DisplayObjectContainer;\n\timport starling.display.Image;\n\timport starling.display.Quad;\n\timport starling.text.TextFormat;\n\timport starling.textures.Texture;\n\timport starling.textures.TextureAtlas;\n\n\tpublic class BaseTopcoatLightMobileTheme extends StyleNameFunctionTheme\n\t{\n\t\t[Embed(source=\"/../assets/fonts/SourceSansPro-Regular.ttf\", fontFamily=\"SourceSansPro\", fontWeight=\"normal\", mimeType=\"application/x-font\", embedAsCFF=\"true\")]\n\t\tprotected static const SOURCE_SANS_PRO_REGULAR:Class;\n\n\t\t[Embed(source=\"/../assets/fonts/SourceSansPro-Semibold.ttf\",fontFamily=\"SourceSansPro\",fontWeight=\"bold\",mimeType=\"application/x-font\",embedAsCFF=\"true\")]\n\t\tprotected static const SOURCE_SANS_PRO_SEMIBOLD:Class;\n\n\t\t/**\n\t\t * The name of the embedded font used by controls in this theme.\n\t\t */\n\t\tpublic static const FONT_NAME:String = \"SourceSansPro\";\n\n\t\t/**\n\t\t * The stack of fonts to use for controls that don't use embedded fonts.\n\t\t */\n\t\tpublic static const FONT_NAME_STACK:String = \"Source Sans Pro,Helvetica,_sans\";\n\n\t\tprotected static const COLOR_TEXT_DARK:uint = 0x454545;\n\t\tprotected static const COLOR_TEXT_LIGHT:uint = 0xFFFFFF;\n\t\tprotected static const COLOR_TEXT_SELECTED:uint = 0x0083E8;\n\t\tprotected static const COLOR_TEXT_DARK_DISABLED:uint = 0x848585;\n\t\tprotected static const COLOR_TEXT_SELECTED_DISABLED:uint = 0x96AFC3;\n\t\tprotected static const COLOR_TEXT_ACTION_DISABLED:uint = 0xC6DFF3;\n\t\tprotected static const COLOR_TEXT_DANGER_DISABLED:uint = 0xF7B4AF;\n\t\tprotected static const COLOR_BACKGROUND_LIGHT:uint = 0xDFE2E2;\n\t\tprotected static const COLOR_SPINNER_LIST_BACKGROUND:uint = 0xE5E9E8;\n\t\tprotected static const COLOR_MODAL_OVERLAY:uint = 0xDFE2E2;\n\t\tprotected static const ALPHA_MODAL_OVERLAY:Number = 0.8;\n\t\tprotected static const COLOR_DRAWER_OVERLAY:uint = 0x454545;\n\t\tprotected static const ALPHA_DRAWER_OVERLAY:Number = 0.8;\n\t\tprotected static const COLOR_DRAWERS_DIVIDER:uint = 0x9DACA9;\n\t\tprotected static const ALPHA_DATA_GRID_DRAG_OVERLAY:Number = 0.5;\n\t\tprotected static const COLOR_DATA_GRID_DRAG_OVERLAY:uint = 0xDFE2E2;\n\t\tprotected static const COLOR_TOAST_BACKGROUND:uint = 0x454545;\n\n\t\tprotected static const BUTTON_SCALE9_GRID:Rectangle = new Rectangle(7, 7, 1, 1);\n\t\tprotected static const BACK_BUTTON_SCALE9_GRID:Rectangle = new Rectangle(26, 5, 10, 40);\n\t\tprotected static const FORWARD_BUTTON_SCALE9_GRID:Rectangle = new Rectangle(5, 5, 10, 10);\n\t\tprotected static const TEXT_INPUT_SCALE9_GRID:Rectangle = new Rectangle(7, 7, 1, 1);\n\t\tprotected static const HORIZONTAL_MINIMUM_TRACK_SCALE9_GRID:Rectangle = new Rectangle(5, 0, 1, 13);\n\t\tprotected static const HORIZONTAL_MAXIMUM_TRACK_SCALE9_GRID:Rectangle = new Rectangle(0, 0, 1, 13);\n\t\tprotected static const VERTICAL_MINIMUM_TRACK_SCALE9_GRID:Rectangle = new Rectangle(0, 0, 13, 1);\n\t\tprotected static const VERTICAL_MAXIMUM_TRACK_SCALE9_GRID:Rectangle = new Rectangle(0, 5, 13, 1);\n\t\tprotected static const BAR_HORIZONTAL_SCALE9_GRID:Rectangle = new Rectangle(8, 8, 1, 1);\n\t\tprotected static const BAR_VERTICAL_SCALE9_GRID:Rectangle = new Rectangle(8, 8, 1, 1);\n\t\tprotected static const HEADER_BACKGROUND_SCALE9_GRID:Rectangle = new Rectangle(3, 3, 10, 56);\n\t\tprotected static const TAB_SCALE9_GRID:Rectangle = new Rectangle(3, 3, 5, 5);\n\t\tprotected static const SEARCH_INPUT_SCALE9_GRID:Rectangle = new Rectangle(25, 25, 10, 1);\n\t\tprotected static const BACKGROUND_POPUP_SCALE9_GRID:Rectangle = new Rectangle(5, 5, 10, 10);\n\t\tprotected static const POP_UP_DRAWER_BACKGROUND_SCALE9_GRID:Rectangle = new Rectangle(1, 3, 3, 4);\n\t\tprotected static const LIST_ITEM_SCALE9_GRID:Rectangle = new Rectangle(2, 2, 1, 6);\n\t\tprotected static const GROUPED_LIST_HEADER_OR_FOOTER_SCALE9_GRID:Rectangle = new Rectangle(2, 2, 1, 6);\n\t\tprotected static const SPINNER_LIST_OVERLAY_SCALE9_GRID:Rectangle = new Rectangle(2, 5, 1, 1);\n\t\tprotected static const HORIZONTAL_SIMPLE_SCROLL_BAR_SCALE9_GRID:Rectangle = new Rectangle(5, 0, 3, 6);\n\t\tprotected static const VERTICAL_SIMPLE_SCROLL_BAR_SCALE9_GRID:Rectangle = new Rectangle(0, 5, 6, 3);\n\t\tprotected static const DATA_GRID_HEADER_SCALE9_GRID:Rectangle = new Rectangle(2, 2, 1, 6);\n\t\tprotected static const DATA_GRID_COLUMN_RESIZE_SCALE_9_GRID:Rectangle = new Rectangle(0, 1, 3, 1);\n\t\tprotected static const DATA_GRID_COLUMN_DROP_INDICATOR_SCALE_9_GRID:Rectangle = new Rectangle(0, 1, 3, 1);\n\t\tprotected static const DATA_GRID_HEADER_DIVIDER_SCALE_9_GRID:Rectangle = new Rectangle(0, 2, 5, 1);\n\n\t\tprotected static const THEME_STYLE_NAME_VERTICAL_SIMPLE_SCROLL_BAR_THUMB:String = \"topcoat-light-mobile-vertical-simple-scroll-bar-thumb\";\n\t\tprotected static const THEME_STYLE_NAME_HORIZONTAL_SIMPLE_SCROLL_BAR_THUMB:String = \"topcoat-light-mobile-horizontal-simple-scroll-bar-thumb\";\n\t\tprotected static const THEME_STYLE_NAME_HORIZONTAL_SLIDER_THUMB:String = \"topcoat-light-mobile-horizontal-slider-thumb\";\n\t\tprotected static const THEME_STYLE_NAME_HORIZONTAL_SLIDER_MINIMUM_TRACK:String = \"topcoat-light-mobile-horizontal-slider-minimum-track\";\n\t\tprotected static const THEME_STYLE_NAME_HORIZONTAL_SLIDER_MAXIMUM_TRACK:String = \"topcoat-light-mobile-horizontal-slider-maximum-track\";\n\t\tprotected static const THEME_STYLE_NAME_VERTICAL_SLIDER_THUMB:String = \"topcoat-light-mobile-vertical-slider-thumb\";\n\t\tprotected static const THEME_STYLE_NAME_VERTICAL_SLIDER_MINIMUM_TRACK:String = \"topcoat-light-mobile-vertical-slider-minimum-track\";\n\t\tprotected static const THEME_STYLE_NAME_VERTICAL_SLIDER_MAXIMUM_TRACK:String = \"topcoat-light-mobile-vertical-slider-maximum-track\";\n\t\tprotected static const THEME_STYLE_NAME_ALERT_BUTTON_GROUP_BUTTON:String = \"topcoat-light-mobile-alert-button-group-button\";\n\t\tprotected static const THEME_STYLE_NAME_ALERT_BUTTON_GROUP_LAST_BUTTON:String = \"topcoat-light-mobile-alert-button-group-last-button\";\n\t\tprotected static const THEME_STYLE_NAME_GROUPED_LIST_FIRST_ITEM_RENDERER:String = \"topcoat-light-mobile-grouped-list-first-item-renderer\";\n\t\tprotected static const THEME_STYLE_NAME_SPINNER_LIST_ITEM_RENDERER:String = \"topcoat-light-mobile-spinner-list-item-renderer\";\n\t\tprotected static const THEME_STYLE_NAME_DATE_TIME_SPINNER_LIST_ITEM_RENDERER:String = \"topcoat-light-mobile-date-time-spinner-list-item-renderer\";\n\t\tprotected static const THEME_STYLE_NAME_POP_UP_DRAWER:String = \"topcoat-light-mobile-pop-up-drawer\";\n\t\tprotected static const THEME_STYLE_NAME_POP_UP_DRAWER_HEADER:String = \"topcoat-light-mobile-pop-up-drawer-header\";\n\t\tprotected static const THEME_STYLE_NAME_TABLET_PICKER_LIST_ITEM_RENDERER:String = \"topcoat-light-mobile-tablet-picker-list-item-renderer\";\n\t\tprotected static const THEME_STYLE_NAME_TOAST_ACTIONS_BUTTON:String = \"topcoat-light-mobile-toast-actions-button\";\n\n\t\tpublic function BaseTopcoatLightMobileTheme()\n\t\t{\n\t\t\tsuper();\n\t\t}\n\n\t\tprotected var gridSize:int = 70;\n\t\tprotected var gutterSize:int = 20;\n\t\tprotected var smallGutterSize:int = 10;\n\t\tprotected var extraSmallGutterSize:int = 5;\n\t\tprotected var borderSize:int = 1;\n\t\tprotected var controlSize:int = 50;\n\t\tprotected var smallControlSize:int = 16;\n\t\tprotected var wideControlSize:int = 230;\n\t\tprotected var popUpFillSize:int = 300;\n\t\tprotected var thumbSize:int = 34;\n\t\tprotected var shadowSize:int = 2;\n\t\tprotected var calloutBackgroundMinSize:int = 53;\n\t\tprotected var calloutVerticalArrowGap:int = -8;\n\t\tprotected var calloutHorizontalArrowGap:int = -7;\n\n\t\tprotected var smallFontSize:int = 14;\n\t\tprotected var regularFontSize:int = 16;\n\t\tprotected var largeFontSize:int = 20;\n\n\t\tprotected var darkFontStyles:TextFormat;\n\t\tprotected var lightFontStyles:TextFormat;\n\t\tprotected var selectedFontStyles:TextFormat;\n\t\tprotected var darkDisabledFontStyles:TextFormat;\n\t\tprotected var selectedDisabledFontStyles:TextFormat;\n\t\tprotected var actionDisabledFontStyles:TextFormat;\n\t\tprotected var dangerDisabledFontStyles:TextFormat;\n\t\tprotected var darkCenteredFontStyles:TextFormat;\n\t\tprotected var darkCenteredDisabledFontStyles:TextFormat;\n\t\tprotected var smallDarkFontStyles:TextFormat;\n\t\tprotected var smallSelectedFontStyles:TextFormat;\n\t\tprotected var smallDarkDisabledFontStyles:TextFormat;\n\t\tprotected var largeDarkFontStyles:TextFormat;\n\t\tprotected var largeDarkDisabledFontStyles:TextFormat;\n\t\tprotected var darkScrollTextFontStyles:TextFormat;\n\t\tprotected var darkScrollTextDisabledFontStyles:TextFormat;\n\t\tprotected var lightBoldFontStyles:TextFormat;\n\t\tprotected var selectedBoldFontStyles:TextFormat;\n\n\t\t/**\n\t\t * The texture atlas that contains skins for this theme. This base class\n\t\t * does not initialize this member variable. Subclasses are expected to\n\t\t * load the assets somehow and set the <code>atlas</code> member\n\t\t * variable before calling <code>initialize()</code>.\n\t\t */\n\t\tprotected var atlas:TextureAtlas;\n\n\t\tprotected var focusIndicatorTexture:Texture;\n\t\tprotected var buttonUpTexture:Texture;\n\t\tprotected var buttonDownTexture:Texture;\n\t\tprotected var buttonDisabledTexture:Texture;\n\t\tprotected var quietButtonDownTexture:Texture;\n\t\tprotected var backButtonUpTexture:Texture;\n\t\tprotected var backButtonDownTexture:Texture;\n\t\tprotected var backButtonDisabledTexture:Texture;\n\t\tprotected var forwardButtonUpTexture:Texture;\n\t\tprotected var forwardButtonDownTexture:Texture;\n\t\tprotected var forwardButtonDisabledTexture:Texture;\n\t\tprotected var dangerButtonUpTexture:Texture;\n\t\tprotected var dangerButtonDownTexture:Texture;\n\t\tprotected var dangerButtonDisabledTexture:Texture;\n\t\tprotected var callToActionButtonUpTexture:Texture;\n\t\tprotected var callToActionButtonDownTexture:Texture;\n\t\tprotected var callToActionButtonDisabledTexture:Texture;\n\t\tprotected var toggleButtonSelectedUpTexture:Texture;\n\t\tprotected var toggleButtonSelectedDisabledTexture:Texture;\n\t\tprotected var toggleSwitchOnTrackTexture:Texture;\n\t\tprotected var toggleSwitchOnTrackDisabledTexture:Texture;\n\t\tprotected var toggleSwitchOffTrackTexture:Texture;\n\t\tprotected var toggleSwitchOffTrackDisabledTexture:Texture;\n\t\tprotected var checkUpIconTexture:Texture;\n\t\tprotected var checkSelectedUpIconTexture:Texture;\n\t\tprotected var checkDownIconTexture:Texture;\n\t\tprotected var checkDisabledIconTexture:Texture;\n\t\tprotected var checkSelectedDownIconTexture:Texture;\n\t\tprotected var checkSelectedDisabledIconTexture:Texture;\n\t\tprotected var radioUpIconTexture:Texture;\n\t\tprotected var radioSelectedUpIconTexture:Texture;\n\t\tprotected var radioDownIconTexture:Texture;\n\t\tprotected var radioDisabledIconTexture:Texture;\n\t\tprotected var radioSelectedDownIconTexture:Texture;\n\t\tprotected var radioSelectedDisabledIconTexture:Texture;\n\t\tprotected var horizontalProgressBarFillTexture:Texture;\n\t\tprotected var horizontalProgressBarFillDisabledTexture:Texture;\n\t\tprotected var horizontalProgressBarBackgroundTexture:Texture;\n\t\tprotected var horizontalProgressBarBackgroundDisabledTexture:Texture;\n\t\tprotected var verticalProgressBarFillTexture:Texture;\n\t\tprotected var verticalProgressBarFillDisabledTexture:Texture;\n\t\tprotected var verticalProgressBarBackgroundTexture:Texture;\n\t\tprotected var verticalProgressBarBackgroundDisabledTexture:Texture;\n\t\tprotected var headerBackgroundSkinTexture:Texture;\n\t\tprotected var verticalSimpleScrollBarThumbTexture:Texture;\n\t\tprotected var horizontalSimpleScrollBarThumbTexture:Texture;\n\t\tprotected var tabUpTexture:Texture;\n\t\tprotected var tabDownTexture:Texture;\n\t\tprotected var tabSelectedUpTexture:Texture;\n\t\tprotected var tabSelectedDisabledTexture:Texture;\n\t\tprotected var horizontalSliderMinimumTrackTexture:Texture;\n\t\tprotected var horizontalSliderMinimumTrackDisabledTexture:Texture;\n\t\tprotected var horizontalSliderMaximumTrackTexture:Texture;\n\t\tprotected var horizontalSliderMaximumTrackDisabledTexture:Texture;\n\t\tprotected var verticalSliderMinimumTrackTexture:Texture;\n\t\tprotected var verticalSliderMinimumTrackDisabledTexture:Texture;\n\t\tprotected var verticalSliderMaximumTrackTexture:Texture;\n\t\tprotected var verticalSliderMaximumTrackDisabledTexture:Texture;\n\t\tprotected var textInputBackgroundEnabledTexture:Texture;\n\t\tprotected var textInputBackgroundFocusedTexture:Texture;\n\t\tprotected var textInputBackgroundErrorTexture:Texture;\n\t\tprotected var textInputBackgroundDisabledTexture:Texture;\n\t\tprotected var searchTextInputBackgroundEnabledTexture:Texture;\n\t\tprotected var searchTextInputBackgroundFocusedTexture:Texture;\n\t\tprotected var searchTextInputBackgroundDisabledTexture:Texture;\n\t\tprotected var searchIconTexture:Texture;\n\t\tprotected var popUpBackgroundTexture:Texture;\n\t\tprotected var calloutTopArrowTexture:Texture;\n\t\tprotected var calloutRightArrowTexture:Texture;\n\t\tprotected var calloutBottomArrowTexture:Texture;\n\t\tprotected var calloutLeftArrowTexture:Texture;\n\t\tprotected var itemRendererUpTexture:Texture;\n\t\tprotected var itemRendererDownTexture:Texture;\n\t\tprotected var itemRendererSelectedTexture:Texture;\n\t\tprotected var firstItemRendererUpTexture:Texture;\n\t\tprotected var groupedListHeaderTexture:Texture;\n\t\tprotected var groupedListFooterTexture:Texture;\n\t\tprotected var pickerListButtonIcon:Texture;\n\t\tprotected var pickerListButtonDisabledIcon:Texture;\n\t\tprotected var popUpDrawerBackgroundTexture:Texture;\n\t\tprotected var spinnerListSelectionOverlayTexture:Texture;\n\t\tprotected var pageIndicatorNormalTexture:Texture;\n\t\tprotected var pageIndicatorSelectedTexture:Texture;\n\t\tprotected var treeDisclosureOpenIconTexture:Texture;\n\t\tprotected var treeDisclosureClosedIconTexture:Texture;\n\t\tprotected var dataGridHeaderTexture:Texture;\n\t\tprotected var dataGridHeaderSortAscendingIconTexture:Texture;\n\t\tprotected var dataGridHeaderSortDescendingIconTexture:Texture;\n\t\tprotected var dataGridColumnResizeSkinTexture:Texture;\n\t\tprotected var dataGridColumnDropIndicatorSkinTexture:Texture;\n\t\tprotected var dataGridHeaderDividerSkinTexture:Texture;\n\t\tprotected var dragHandleIconTexture:Texture;\n\n\t\t/**\n\t\t * Disposes the atlas before calling super.dispose()\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tif(this.atlas)\n\t\t\t{\n\t\t\t\tthis.atlas.dispose();\n\t\t\t\tthis.atlas = null;\n\t\t\t}\n\t\t\tsuper.dispose();\n\t\t}\n\n\t\t/**\n\t\t * Initializes the theme. Expected to be called by subclasses after the\n\t\t * assets have been loaded and the skin texture atlas has been created.\n\t\t */\n\t\tprotected function initialize():void\n\t\t{\n\t\t\tthis.initializeFonts();\n\t\t\tthis.initializeTextures();\n\t\t\tthis.initializeGlobals();\n\t\t\tthis.initializeStage();\n\t\t\tthis.initializeStyleProviders();\n\t\t}\n\n\t\tprotected function initializeStage():void\n\t\t{\n\t\t\tthis.starling.stage.color = COLOR_BACKGROUND_LIGHT;\n\t\t\tthis.starling.nativeStage.color = COLOR_BACKGROUND_LIGHT;\n\t\t}\n\n\t\tprotected function initializeTextures():void\n\t\t{\n\t\t\tthis.popUpBackgroundTexture = this.atlas.getTexture(\"background-popup-skin0000\");\n\t\t\tthis.popUpDrawerBackgroundTexture = this.atlas.getTexture(\"pop-up-drawer-background-skin0000\");\n\n\t\t\tthis.focusIndicatorTexture = this.atlas.getTexture(\"focus-indicator-skin0000\");\n\n\t\t\tthis.buttonUpTexture = this.atlas.getTexture(\"button-up-skin0000\");\n\t\t\tthis.buttonDownTexture = this.atlas.getTexture(\"button-down-skin0000\");\n\t\t\tthis.buttonDisabledTexture = this.atlas.getTexture(\"button-disabled-skin0000\");\n\t\t\tthis.quietButtonDownTexture = this.atlas.getTexture(\"button-down-skin0000\");\n\t\t\tthis.dangerButtonUpTexture = this.atlas.getTexture(\"button-danger-up-skin0000\");\n\t\t\tthis.dangerButtonDownTexture = this.atlas.getTexture(\"button-danger-down-skin0000\");\n\t\t\tthis.dangerButtonDisabledTexture = this.atlas.getTexture(\"button-danger-disabled-skin0000\");\n\t\t\tthis.callToActionButtonUpTexture = this.atlas.getTexture(\"button-call-to-action-up-skin0000\");\n\t\t\tthis.callToActionButtonDownTexture = this.atlas.getTexture(\"button-call-to-action-down-skin0000\");\n\t\t\tthis.callToActionButtonDisabledTexture = this.atlas.getTexture(\"button-call-to-action-disabled-skin0000\");\n\t\t\tthis.backButtonUpTexture = this.atlas.getTexture(\"button-back-up-skin0000\");\n\t\t\tthis.backButtonDownTexture = this.atlas.getTexture(\"button-back-down-skin0000\");\n\t\t\tthis.backButtonDisabledTexture = this.atlas.getTexture(\"button-back-disabled-skin0000\");\n\t\t\tthis.forwardButtonUpTexture = this.atlas.getTexture(\"button-forward-up-skin0000\");\n\t\t\tthis.forwardButtonDownTexture = this.atlas.getTexture(\"button-forward-down-skin0000\");\n\t\t\tthis.forwardButtonDisabledTexture = this.atlas.getTexture(\"button-forward-disabled-skin0000\");\n\t\t\tthis.toggleButtonSelectedUpTexture = this.atlas.getTexture(\"toggle-button-selected-up-skin0000\");\n\t\t\tthis.toggleButtonSelectedDisabledTexture = this.atlas.getTexture(\"toggle-button-selected-disabled-skin0000\");\n\t\t\t\n\t\t\tthis.calloutTopArrowTexture = this.atlas.getTexture(\"callout-arrow-top-skin0000\");\n\t\t\tthis.calloutRightArrowTexture = this.atlas.getTexture(\"callout-arrow-right-skin0000\");\n\t\t\tthis.calloutBottomArrowTexture = this.atlas.getTexture(\"callout-arrow-bottom-skin0000\");\n\t\t\tthis.calloutLeftArrowTexture = this.atlas.getTexture(\"callout-arrow-left-skin0000\");\n\n\t\t\tthis.checkUpIconTexture = this.atlas.getTexture(\"check-up-icon0000\");\n\t\t\tthis.checkDownIconTexture = this.atlas.getTexture(\"check-down-icon0000\");\n\t\t\tthis.checkDisabledIconTexture = this.atlas.getTexture(\"check-disabled-icon0000\");\n\t\t\tthis.checkSelectedUpIconTexture = this.atlas.getTexture(\"check-selected-up-icon0000\");\n\t\t\tthis.checkSelectedDownIconTexture = this.atlas.getTexture(\"check-selected-down-icon0000\");\n\t\t\tthis.checkSelectedDisabledIconTexture = this.atlas.getTexture(\"check-selected-disabled-icon0000\");\n\n\t\t\tthis.headerBackgroundSkinTexture = this.atlas.getTexture(\"header-background-skin0000\");\n\n\t\t\tthis.itemRendererUpTexture = this.atlas.getTexture(\"list-item-up-skin0000\");\n\t\t\tthis.itemRendererDownTexture = this.atlas.getTexture(\"list-item-down-skin0000\");\n\t\t\tthis.itemRendererSelectedTexture = this.atlas.getTexture(\"list-item-selected-skin0000\");\n\t\t\tthis.firstItemRendererUpTexture = this.atlas.getTexture(\"list-first-item-up-skin0000\");\n\t\t\tthis.groupedListHeaderTexture = this.atlas.getTexture(\"grouped-list-header-skin0000\");\n\t\t\tthis.groupedListFooterTexture = this.atlas.getTexture(\"grouped-list-footer-skin0000\");\n\n\t\t\tthis.pageIndicatorNormalTexture = this.atlas.getTexture(\"page-indicator-normal-skin0000\");\n\t\t\tthis.pageIndicatorSelectedTexture = this.atlas.getTexture(\"page-indicator-selected-skin0000\");\n\n\t\t\tthis.pickerListButtonIcon = this.atlas.getTexture(\"picker-list-button-icon0000\");\n\t\t\tthis.pickerListButtonDisabledIcon = this.atlas.getTexture(\"picker-list-button-disabled-icon0000\");\n\t\t\t\n\t\t\tthis.horizontalProgressBarFillTexture = this.atlas.getTexture(\"progress-bar-horizontal-fill-skin0000\");\n\t\t\tthis.horizontalProgressBarFillDisabledTexture = this.atlas.getTexture(\"progress-bar-horizontal-fill-disabled-skin0000\");\n\t\t\tthis.horizontalProgressBarBackgroundTexture = this.atlas.getTexture(\"progress-bar-horizontal-background-skin0000\");\n\t\t\tthis.horizontalProgressBarBackgroundDisabledTexture = this.atlas.getTexture(\"progress-bar-horizontal-background-disabled-skin0000\");\n\t\t\tthis.verticalProgressBarFillTexture = this.atlas.getTexture(\"progress-bar-vertical-fill-skin0000\");\n\t\t\tthis.verticalProgressBarFillDisabledTexture = this.atlas.getTexture(\"progress-bar-vertical-fill-disabled-skin0000\");\n\t\t\tthis.verticalProgressBarBackgroundTexture = this.atlas.getTexture(\"progress-bar-vertical-background-skin0000\");\n\t\t\tthis.verticalProgressBarBackgroundDisabledTexture = this.atlas.getTexture(\"progress-bar-vertical-background-disabled-skin0000\");\n\n\t\t\tthis.radioUpIconTexture = this.atlas.getTexture(\"radio-up-icon0000\");\n\t\t\tthis.radioDownIconTexture = this.atlas.getTexture(\"radio-down-icon0000\");\n\t\t\tthis.radioDisabledIconTexture = this.atlas.getTexture(\"radio-disabled-icon0000\");\n\t\t\tthis.radioSelectedUpIconTexture = this.atlas.getTexture(\"radio-selected-up-icon0000\");\n\t\t\tthis.radioSelectedDownIconTexture = this.atlas.getTexture(\"radio-selected-down-icon0000\");\n\t\t\tthis.radioSelectedDisabledIconTexture = this.atlas.getTexture(\"radio-selected-disabled-icon0000\");\n\n\t\t\tthis.verticalSimpleScrollBarThumbTexture = this.atlas.getTexture(\"simple-scroll-bar-vertical-thumb-skin0000\");\n\t\t\tthis.horizontalSimpleScrollBarThumbTexture = this.atlas.getTexture(\"simple-scroll-bar-horizontal-thumb-skin0000\");\n\n\t\t\tthis.horizontalSliderMinimumTrackTexture = this.atlas.getTexture(\"slider-horizontal-minimum-track-skin0000\");\n\t\t\tthis.horizontalSliderMinimumTrackDisabledTexture = this.atlas.getTexture(\"slider-horizontal-minimum-track-disabled-skin0000\");\n\t\t\tthis.horizontalSliderMaximumTrackTexture = this.atlas.getTexture(\"slider-horizontal-maximum-track-skin0000\");\n\t\t\tthis.horizontalSliderMaximumTrackDisabledTexture = this.atlas.getTexture(\"slider-horizontal-maximum-track-disabled-skin0000\");\n\t\t\tthis.verticalSliderMinimumTrackTexture = this.atlas.getTexture(\"slider-vertical-minimum-track-skin0000\");\n\t\t\tthis.verticalSliderMinimumTrackDisabledTexture = this.atlas.getTexture(\"slider-vertical-minimum-track-disabled-skin0000\");\n\t\t\tthis.verticalSliderMaximumTrackTexture = this.atlas.getTexture(\"slider-vertical-maximum-track-skin0000\");\n\t\t\tthis.verticalSliderMaximumTrackDisabledTexture = this.atlas.getTexture(\"slider-vertical-maximum-track-disabled-skin0000\");\n\n\t\t\tthis.spinnerListSelectionOverlayTexture = this.atlas.getTexture(\"spinner-list-selection-overlay-skin0000\");\n\n\t\t\tthis.tabUpTexture = this.atlas.getTexture(\"tab-up-skin0000\");\n\t\t\tthis.tabDownTexture = this.atlas.getTexture(\"tab-down-skin0000\");\n\t\t\tthis.tabSelectedUpTexture = this.atlas.getTexture(\"tab-selected-up-skin0000\");\n\t\t\tthis.tabSelectedDisabledTexture = this.atlas.getTexture(\"tab-selected-disabled-skin0000\");\n\n\t\t\tthis.textInputBackgroundEnabledTexture = this.atlas.getTexture(\"text-input-up-skin0000\");\n\t\t\tthis.textInputBackgroundFocusedTexture = this.atlas.getTexture(\"text-input-focused-skin0000\");\n\t\t\tthis.textInputBackgroundErrorTexture = this.atlas.getTexture(\"text-input-error-skin0000\");\n\t\t\tthis.textInputBackgroundDisabledTexture = this.atlas.getTexture(\"text-input-disabled-skin0000\");\n\t\t\tthis.searchTextInputBackgroundEnabledTexture = this.atlas.getTexture(\"search-input-up-skin0000\");\n\t\t\tthis.searchTextInputBackgroundFocusedTexture = this.atlas.getTexture(\"search-input-focused-skin0000\");\n\t\t\tthis.searchTextInputBackgroundDisabledTexture = this.atlas.getTexture(\"search-input-disabled-skin0000\");\n\t\t\tthis.searchIconTexture = this.atlas.getTexture(\"search-input-icon0000\");\n\n\t\t\tthis.toggleSwitchOnTrackTexture = this.atlas.getTexture(\"toggle-switch-on-track-skin0000\");\n\t\t\tthis.toggleSwitchOnTrackDisabledTexture = this.atlas.getTexture(\"toggle-switch-on-track-disabled-skin0000\");\n\t\t\tthis.toggleSwitchOffTrackTexture = this.atlas.getTexture(\"toggle-switch-off-track-skin0000\");\n\t\t\tthis.toggleSwitchOffTrackDisabledTexture = this.atlas.getTexture(\"toggle-switch-off-track-disabled-skin0000\");\n\n\t\t\tthis.treeDisclosureOpenIconTexture = this.atlas.getTexture(\"tree-disclosure-open-icon0000\");\n\t\t\tthis.treeDisclosureClosedIconTexture = this.atlas.getTexture(\"tree-disclosure-closed-icon0000\");\n\n\t\t\tthis.dataGridHeaderTexture = this.atlas.getTexture(\"data-grid-header-skin0000\");\n\t\t\tthis.dataGridHeaderSortAscendingIconTexture = this.atlas.getTexture(\"data-grid-header-sort-ascending-icon0000\");\n\t\t\tthis.dataGridHeaderSortDescendingIconTexture = this.atlas.getTexture(\"data-grid-header-sort-descending-icon0000\");\n\t\t\tthis.dataGridColumnResizeSkinTexture = this.atlas.getTexture(\"data-grid-column-resize-skin0000\");\n\t\t\tthis.dataGridColumnDropIndicatorSkinTexture = this.atlas.getTexture(\"data-grid-column-drop-indicator-skin0000\");\n\t\t\tthis.dataGridHeaderDividerSkinTexture = this.atlas.getTexture(\"data-grid-header-divider-skin0000\");\n\n\t\t\tthis.dragHandleIconTexture = this.atlas.getTexture(\"drag-handle-icon0000\");\n\t\t}\n\n\t\tprotected function initializeFonts():void\n\t\t{\n\t\t\tthis.darkFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, COLOR_TEXT_DARK, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.lightFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, COLOR_TEXT_LIGHT, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.selectedFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, COLOR_TEXT_SELECTED, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.darkDisabledFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, COLOR_TEXT_DARK_DISABLED, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.selectedDisabledFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, COLOR_TEXT_SELECTED_DISABLED, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.dangerDisabledFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, COLOR_TEXT_DANGER_DISABLED, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.actionDisabledFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, COLOR_TEXT_ACTION_DISABLED, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.darkCenteredFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, COLOR_TEXT_DARK, HorizontalAlign.CENTER, VerticalAlign.TOP);\n\t\t\tthis.darkCenteredDisabledFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, COLOR_TEXT_DARK_DISABLED, HorizontalAlign.CENTER, VerticalAlign.TOP);\n\t\t\tthis.lightBoldFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, COLOR_TEXT_LIGHT, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.lightBoldFontStyles.bold = true;\n\t\t\tthis.selectedBoldFontStyles = new TextFormat(FONT_NAME, this.regularFontSize, COLOR_TEXT_SELECTED, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.selectedBoldFontStyles.bold = true;\n\n\t\t\tthis.smallDarkFontStyles = new TextFormat(FONT_NAME, this.smallFontSize, COLOR_TEXT_DARK, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.smallSelectedFontStyles = new TextFormat(FONT_NAME, this.smallFontSize, COLOR_TEXT_SELECTED, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.smallDarkDisabledFontStyles = new TextFormat(FONT_NAME, this.smallFontSize, COLOR_TEXT_DARK_DISABLED, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.largeDarkFontStyles = new TextFormat(FONT_NAME, this.largeFontSize, COLOR_TEXT_DARK, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.largeDarkDisabledFontStyles = new TextFormat(FONT_NAME, this.largeFontSize, COLOR_TEXT_DARK_DISABLED, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\n\t\t\tthis.darkScrollTextFontStyles = new TextFormat(FONT_NAME_STACK, this.regularFontSize, COLOR_TEXT_DARK, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t\tthis.darkScrollTextDisabledFontStyles = new TextFormat(FONT_NAME_STACK, this.regularFontSize, COLOR_TEXT_DARK_DISABLED, HorizontalAlign.LEFT, VerticalAlign.TOP);\n\t\t}\n\n\t\tprotected function initializeGlobals():void\n\t\t{\n\t\t\tFeathersControl.defaultTextRendererFactory = textRendererFactory;\n\t\t\tFeathersControl.defaultTextEditorFactory = textEditorFactory;\n\n\t\t\tPopUpManager.overlayFactory = popUpOverlayFactory;\n\t\t\tCallout.stagePadding = this.smallGutterSize;\n\t\t\tToast.containerFactory = toastContainerFactory;\n\t\t}\n\n\t\tprotected function initializeStyleProviders():void\n\t\t{\n\t\t\t//alert\n\t\t\tthis.getStyleProviderForClass(Alert).defaultStyleFunction = this.setAlertStyles;\n\t\t\tthis.getStyleProviderForClass(ButtonGroup).setFunctionForStyleName(Alert.DEFAULT_CHILD_STYLE_NAME_BUTTON_GROUP, this.setAlertButtonGroupStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_ALERT_BUTTON_GROUP_BUTTON, this.setAlertButtonGroupButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Header).setFunctionForStyleName(Alert.DEFAULT_CHILD_STYLE_NAME_HEADER, this.setHeaderWithoutBackgroundStyles);\n\n\t\t\t//auto complete\n\t\t\tthis.getStyleProviderForClass(AutoComplete).defaultStyleFunction = this.setTextInputStyles;\n\t\t\tthis.getStyleProviderForClass(List).setFunctionForStyleName(AutoComplete.DEFAULT_CHILD_STYLE_NAME_LIST, this.setDropDownListStyles);\n\n\t\t\t//button\n\t\t\tthis.getStyleProviderForClass(Button).defaultStyleFunction = this.setButtonStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_QUIET_BUTTON, this.setQuietButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_DANGER_BUTTON, this.setDangerButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_CALL_TO_ACTION_BUTTON, this.setCallToActionButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_BACK_BUTTON, this.setBackButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_FORWARD_BUTTON, this.setForwardButtonStyles);\n\n\t\t\t//button group\n\t\t\tthis.getStyleProviderForClass(ButtonGroup).defaultStyleFunction = this.setButtonGroupStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(ButtonGroup.DEFAULT_CHILD_STYLE_NAME_BUTTON, this.setButtonGroupButtonStyles);\n\t\t\tthis.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(ButtonGroup.DEFAULT_CHILD_STYLE_NAME_BUTTON, this.setButtonStyles);\n\n\t\t\t//callout\n\t\t\tthis.getStyleProviderForClass(Callout).defaultStyleFunction = this.setCalloutStyles;\n\n\t\t\t//check\n\t\t\tthis.getStyleProviderForClass(Check).defaultStyleFunction = this.setCheckStyles;\n\n\t\t\t//data grid\n\t\t\tthis.getStyleProviderForClass(DataGrid).defaultStyleFunction = this.setDataGridStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultDataGridCellRenderer).defaultStyleFunction = this.setItemRendererStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultDataGridHeaderRenderer).defaultStyleFunction = this.setDataGridHeaderRendererStyles;\n\n\t\t\t//date time spinner\n\t\t\tthis.getStyleProviderForClass(DateTimeSpinner).defaultStyleFunction = this.setDateTimeSpinnerStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).setFunctionForStyleName(THEME_STYLE_NAME_DATE_TIME_SPINNER_LIST_ITEM_RENDERER, this.setDateTimeSpinnerListItemRendererStyles);\n\n\t\t\t//drawers\n\t\t\tthis.getStyleProviderForClass(Drawers).defaultStyleFunction = this.setDrawersStyles;\n\n\t\t\t//grouped list\n\t\t\tthis.getStyleProviderForClass(GroupedList).defaultStyleFunction = this.setGroupedListStyles;\n\t\t\tthis.getStyleProviderForClass(GroupedList).setFunctionForStyleName(GroupedList.ALTERNATE_STYLE_NAME_INSET_GROUPED_LIST, this.setInsetGroupedListStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListItemRenderer).defaultStyleFunction = this.setItemRendererStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListHeaderOrFooterRenderer).defaultStyleFunction = this.setGroupedListHeaderRendererStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListHeaderOrFooterRenderer).setFunctionForStyleName(GroupedList.DEFAULT_CHILD_STYLE_NAME_FOOTER_RENDERER, this.setGroupedListFooterRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListHeaderOrFooterRenderer).setFunctionForStyleName(GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_HEADER_RENDERER, this.setGroupedListInsetHeaderRendererStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListHeaderOrFooterRenderer).setFunctionForStyleName(GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_FOOTER_RENDERER, this.setGroupedListInsetFooterRendererStyles);\n\t\t\t//custom style for the first item in GroupedList (without highlight at the top)\n\t\t\tthis.getStyleProviderForClass(DefaultGroupedListItemRenderer).setFunctionForStyleName(THEME_STYLE_NAME_GROUPED_LIST_FIRST_ITEM_RENDERER, this.setGroupedListFirstItemRendererStyles);\n\n\t\t\t//header\n\t\t\tthis.getStyleProviderForClass(Header).defaultStyleFunction = this.setHeaderStyles;\n\n\t\t\t//label\n\t\t\tthis.getStyleProviderForClass(Label).defaultStyleFunction = this.setLabelStyles;\n\t\t\tthis.getStyleProviderForClass(Label).setFunctionForStyleName(Label.ALTERNATE_STYLE_NAME_HEADING, this.setHeadingLabelStyles);\n\t\t\tthis.getStyleProviderForClass(Label).setFunctionForStyleName(Label.ALTERNATE_STYLE_NAME_DETAIL, this.setDetailLabelStyles);\n\n\t\t\t//layout group\n\t\t\tthis.getStyleProviderForClass(LayoutGroup).setFunctionForStyleName(LayoutGroup.ALTERNATE_STYLE_NAME_TOOLBAR, this.setToolbarLayoutGroupStyles);\n\n\t\t\t//list\n\t\t\tthis.getStyleProviderForClass(List).defaultStyleFunction = this.setListStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).defaultStyleFunction = this.setListItemRendererStyles;\n\n\t\t\t//numeric stepper\n\t\t\tthis.getStyleProviderForClass(NumericStepper).defaultStyleFunction = this.setNumericStepperStyles;\n\t\t\tthis.getStyleProviderForClass(TextInput).setFunctionForStyleName(NumericStepper.DEFAULT_CHILD_STYLE_NAME_TEXT_INPUT, this.setNumericStepperTextInputStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(NumericStepper.DEFAULT_CHILD_STYLE_NAME_DECREMENT_BUTTON, this.setNumericStepperButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(NumericStepper.DEFAULT_CHILD_STYLE_NAME_INCREMENT_BUTTON, this.setNumericStepperButtonStyles);\n\n\t\t\t//page indicator\n\t\t\tthis.getStyleProviderForClass(PageIndicator).defaultStyleFunction = this.setPageIndicatorStyles;\n\n\t\t\t//panel\n\t\t\tthis.getStyleProviderForClass(Panel).defaultStyleFunction = this.setPanelStyles;\n\t\t\tthis.getStyleProviderForClass(Header).setFunctionForStyleName(Panel.DEFAULT_CHILD_STYLE_NAME_HEADER, this.setHeaderWithoutBackgroundStyles);\n\n\t\t\t//panel screen\n\t\t\tthis.getStyleProviderForClass(PanelScreen).defaultStyleFunction = this.setPanelScreenStyles;\n\t\t\tthis.getStyleProviderForClass(Header).setFunctionForStyleName(PanelScreen.DEFAULT_CHILD_STYLE_NAME_HEADER, this.setPanelScreenHeaderStyles);\n\n\t\t\t//picker list\n\t\t\tthis.getStyleProviderForClass(PickerList).defaultStyleFunction = this.setPickerListStyles;\n\t\t\tthis.getStyleProviderForClass(List).setFunctionForStyleName(PickerList.DEFAULT_CHILD_STYLE_NAME_LIST, this.setPickerListListStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(PickerList.DEFAULT_CHILD_STYLE_NAME_BUTTON, this.setPickerListButtonStyles);\n\t\t\tthis.getStyleProviderForClass(Panel).setFunctionForStyleName(THEME_STYLE_NAME_POP_UP_DRAWER, this.setPickerListPopUpDrawerStyles);\n\t\t\tthis.getStyleProviderForClass(Header).setFunctionForStyleName(THEME_STYLE_NAME_POP_UP_DRAWER_HEADER, this.setHeaderStyles);\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).setFunctionForStyleName(THEME_STYLE_NAME_TABLET_PICKER_LIST_ITEM_RENDERER, this.setTabletPickerListItemRendererStyles);\n\n\t\t\t//progress bar\n\t\t\tthis.getStyleProviderForClass(ProgressBar).defaultStyleFunction = this.setProgressBarStyles;\n\n\t\t\t//radio\n\t\t\tthis.getStyleProviderForClass(Radio).defaultStyleFunction = this.setRadioStyles;\n\n\t\t\t//scroll container\n\t\t\tthis.getStyleProviderForClass(ScrollContainer).defaultStyleFunction = this.setScrollContainerStyles;\n\t\t\tthis.getStyleProviderForClass(ScrollContainer).setFunctionForStyleName(ScrollContainer.ALTERNATE_STYLE_NAME_TOOLBAR, this.setToolbarScrollContainerStyles);\n\n\t\t\t//scroll text\n\t\t\tthis.getStyleProviderForClass(ScrollText).defaultStyleFunction = this.setScrollTextStyles;\n\n\t\t\t//simple scroll bar\n\t\t\tthis.getStyleProviderForClass(SimpleScrollBar).defaultStyleFunction = this.setSimpleScrollBarStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_VERTICAL_SIMPLE_SCROLL_BAR_THUMB, this.setVerticalSimpleScrollBarThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_HORIZONTAL_SIMPLE_SCROLL_BAR_THUMB, this.setHorizontalSimpleScrollBarThumbStyles);\n\n\t\t\t//slider\n\t\t\tthis.getStyleProviderForClass(Slider).defaultStyleFunction = this.setSliderStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_HORIZONTAL_SLIDER_THUMB, this.setHorizontalThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_VERTICAL_SLIDER_THUMB, this.setVerticalThumbStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_HORIZONTAL_SLIDER_MINIMUM_TRACK, this.setHorizontalSliderMinimumTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_HORIZONTAL_SLIDER_MAXIMUM_TRACK, this.setHorizontalSliderMaximumTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_VERTICAL_SLIDER_MINIMUM_TRACK, this.setVerticalSliderMinimumTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_VERTICAL_SLIDER_MAXIMUM_TRACK, this.setVerticalSliderMaximumTrackStyles);\n\n\t\t\t//spinner list\n\t\t\tthis.getStyleProviderForClass(SpinnerList).defaultStyleFunction = this.setSpinnerListStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultListItemRenderer).setFunctionForStyleName(THEME_STYLE_NAME_SPINNER_LIST_ITEM_RENDERER, this.setSpinnerListItemRendererStyles);\n\n\t\t\t//tab bar\n\t\t\tthis.getStyleProviderForClass(TabBar).defaultStyleFunction = this.setTabBarStyles;\n\t\t\tthis.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(TabBar.DEFAULT_CHILD_STYLE_NAME_TAB, this.setTabStyles);\n\n\t\t\t//text input\n\t\t\tthis.getStyleProviderForClass(TextInput).defaultStyleFunction = this.setTextInputStyles;\n\t\t\tthis.getStyleProviderForClass(TextInput).setFunctionForStyleName(TextInput.ALTERNATE_STYLE_NAME_SEARCH_TEXT_INPUT, this.setSearchTextInputStyles);\n\n\t\t\t//text area\n\t\t\tthis.getStyleProviderForClass(TextArea).defaultStyleFunction = this.setTextAreaStyles;\n\n\t\t\t//text callout\n\t\t\tthis.getStyleProviderForClass(TextCallout).defaultStyleFunction = this.setTextCalloutStyles;\n\n\t\t\t//toast\n\t\t\tthis.getStyleProviderForClass(Toast).defaultStyleFunction = this.setToastStyles;\n\t\t\tthis.getStyleProviderForClass(ButtonGroup).setFunctionForStyleName(Toast.DEFAULT_CHILD_STYLE_NAME_ACTIONS, this.setToastActionsStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(THEME_STYLE_NAME_TOAST_ACTIONS_BUTTON, this.setToastActionsButtonStyles);\n\n\t\t\t//toggle button\n\t\t\tthis.getStyleProviderForClass(ToggleButton).defaultStyleFunction = this.setToggleButtonStyles;\n\t\t\tthis.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(Button.ALTERNATE_STYLE_NAME_QUIET_BUTTON, this.setQuietButtonStyles);\n\n\t\t\t//toggle switch\n\t\t\tthis.getStyleProviderForClass(ToggleSwitch).defaultStyleFunction = this.setToggleSwitchStyles;\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_ON_TRACK, this.setToggleSwitchOnTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_OFF_TRACK, this.setToggleSwitchOffTrackStyles);\n\t\t\tthis.getStyleProviderForClass(Button).setFunctionForStyleName(ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setHorizontalThumbStyles);\n\t\t\tthis.getStyleProviderForClass(ToggleButton).setFunctionForStyleName(ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_THUMB, this.setHorizontalThumbStyles);\n\n\t\t\t//tree\n\t\t\tthis.getStyleProviderForClass(Tree).defaultStyleFunction = this.setTreeStyles;\n\t\t\tthis.getStyleProviderForClass(DefaultTreeItemRenderer).defaultStyleFunction = this.setTreeItemRendererStyles;\n\t\t}\n\n\t\tprotected static function textRendererFactory():ITextRenderer\n\t\t{\n\t\t\treturn new TextBlockTextRenderer();\n\t\t}\n\t\t\n\t\tprotected static function textEditorFactory():ITextEditor\n\t\t{\n\t\t\treturn new StageTextTextEditor();\n\t\t}\n\t\t\n\t\tprotected static function textAreaTextEditorFactory():ITextEditorViewPort\n\t\t{\n\t\t\treturn new TextFieldTextEditorViewPort();\n\t\t}\n\n\t\tprotected static function popUpOverlayFactory():DisplayObject\n\t\t{\n\t\t\tvar quad:Quad = new Quad(10, 10, COLOR_MODAL_OVERLAY);\n\t\t\tquad.alpha = ALPHA_MODAL_OVERLAY;\n\t\t\treturn quad;\n\t\t}\n\n\t\tprotected static function scrollBarFactory():SimpleScrollBar\n\t\t{\n\t\t\treturn new SimpleScrollBar();\n\t\t}\n\n\t\tprotected static function stepperTextEditorFactory():TextBlockTextEditor\n\t\t{\n\t\t\t/* We are only using this text editor in the NumericStepper because\n\t\t\t * isEditable is false on the TextInput. this text editor is not\n\t\t\t * suitable for mobile use if the TextInput needs to be editable\n\t\t\t * because it can't use the soft keyboard or other mobile-friendly UI */\n\t\t\treturn new TextBlockTextEditor();\n\t\t}\n\t\t\n\t\tprotected static function pickerListSpinnerListFactory():SpinnerList\n\t\t{\n\t\t\treturn new SpinnerList();\n\t\t}\n\n\t\tprotected function pageIndicatorNormalSymbolFactory():DisplayObject\n\t\t{\n\t\t\tvar symbol:ImageLoader = new ImageLoader();\n\t\t\tsymbol.source = this.pageIndicatorNormalTexture;\n\t\t\treturn symbol;\n\t\t}\n\n\t\tprotected function pageIndicatorSelectedSymbolFactory():DisplayObject\n\t\t{\n\t\t\tvar symbol:ImageLoader = new ImageLoader();\n\t\t\tsymbol.source = this.pageIndicatorSelectedTexture;\n\t\t\treturn symbol;\n\t\t}\n\n\t\tprotected function dataGridHeaderDividerFactory():DisplayObject\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.dataGridHeaderDividerSkinTexture);\n\t\t\tskin.scale9Grid = DATA_GRID_HEADER_DIVIDER_SCALE_9_GRID;\n\t\t\tskin.minTouchWidth = this.controlSize;\n\t\t\treturn skin;\n\t\t}\n\n\t\tprotected function toastContainerFactory():DisplayObjectContainer\n\t\t{\n\t\t\tvar container:LayoutGroup = new LayoutGroup();\n\t\t\tcontainer.autoSizeMode = AutoSizeMode.STAGE;\n\n\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\tlayout.verticalAlign = VerticalAlign.BOTTOM;\n\t\t\tif(DeviceCapabilities.isPhone())\n\t\t\t{\n\t\t\t\tlayout.horizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlayout.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\t\tlayout.padding = this.gutterSize;\n\t\t\t\tlayout.gap = this.gutterSize;\n\t\t\t}\n\t\t\tcontainer.layout = layout;\n\t\t\treturn container;\n\t\t}\n\n\t//-------------------------\n\t// Shared\n\t//-------------------------\n\n\t\tprotected function setScrollerStyles(scroller:Scroller):void\n\t\t{\n\t\t\tscroller.verticalScrollBarFactory = scrollBarFactory;\n\t\t\tscroller.horizontalScrollBarFactory = scrollBarFactory;\n\t\t}\n\n\t\tprotected function setDropDownListStyles(list:List):void\n\t\t{\n\t\t\tvar backgroundSkin:Quad = new Quad(10, 10, COLOR_SPINNER_LIST_BACKGROUND);\n\t\t\tlist.backgroundSkin = backgroundSkin;\n\n\t\t\tvar layout:VerticalLayout = new VerticalLayout();\n\t\t\tlayout.horizontalAlign = HorizontalAlign.JUSTIFY;\n\t\t\tlayout.maxRowCount = 4;\n\t\t\tlist.layout = layout;\n\t\t}\n\n\t//-------------------------\n\t// Alert\n\t//-------------------------\n\n\t\tprotected function setAlertStyles(alert:Alert):void\n\t\t{\n\t\t\tthis.setScrollerStyles(alert);\n\n\t\t\tvar backgroundSkin:Image = new Image(this.popUpBackgroundTexture);\n\t\t\tbackgroundSkin.scale9Grid = BACKGROUND_POPUP_SCALE9_GRID;\n\t\t\talert.backgroundSkin = backgroundSkin;\n\n\t\t\talert.fontStyles = this.darkFontStyles.clone();\n\t\t\talert.disabledFontStyles = this.darkDisabledFontStyles.clone();\n\n\t\t\talert.paddingTop = 0;\n\t\t\talert.paddingRight = this.gutterSize;\n\t\t\talert.paddingBottom = this.gutterSize;\n\t\t\talert.paddingLeft = this.gutterSize;\n\t\t\talert.gap = this.gutterSize;\n\t\t\talert.maxWidth = this.popUpFillSize;\n\t\t\talert.maxHeight = this.popUpFillSize;\n\t\t}\n\n\t\t//see Panel section for Header styles\n\n\t\tprotected function setAlertButtonGroupStyles(group:ButtonGroup):void\n\t\t{\n\t\t\tgroup.direction = Direction.HORIZONTAL;\n\t\t\tgroup.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tgroup.verticalAlign = VerticalAlign.JUSTIFY;\n\t\t\tgroup.distributeButtonSizes = false;\n\t\t\tgroup.gap = this.gutterSize;\n\t\t\tgroup.padding = this.gutterSize;\n\t\t\tgroup.paddingTop = 0;\n\t\t\tgroup.customLastButtonStyleName = THEME_STYLE_NAME_ALERT_BUTTON_GROUP_LAST_BUTTON;\n\t\t\tgroup.customButtonStyleName = THEME_STYLE_NAME_ALERT_BUTTON_GROUP_BUTTON;\n\t\t}\n\n\t\tprotected function setAlertButtonGroupButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonUpTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDownTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledTexture);\n\t\t\tif(button is ToggleButton)\n\t\t\t{\n\t\t\t\t//for convenience, this function can style both a regular button\n\t\t\t\t//and a toggle button\n\t\t\t\tskin.selectedTexture = this.toggleButtonSelectedUpTexture;\n\t\t\t\tskin.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.toggleButtonSelectedDisabledTexture);\n\t\t\t}\n\t\t\tskin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.controlSize * 2;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.fontStyles = this.darkFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.darkDisabledFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\t\t}\n\n\t//-------------------------\n\t// Button\n\t//-------------------------\n\n\t\tprotected function setBaseButtonStyles(button:Button):void\n\t\t{\n\t\t\tbutton.paddingBottom = this.smallGutterSize;\n\t\t\tbutton.paddingTop = this.smallGutterSize;\n\t\t\tbutton.paddingRight = this.gutterSize;\n\t\t\tbutton.paddingLeft = this.gutterSize;\n\t\t\tbutton.gap = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonUpTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDownTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledTexture);\n\t\t\tif(button is ToggleButton)\n\t\t\t{\n\t\t\t\t//for convenience, this function can style both a regular button\n\t\t\t\t//and a toggle button\n\t\t\t\tskin.selectedTexture = this.toggleButtonSelectedUpTexture;\n\t\t\t\tskin.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.toggleButtonSelectedDisabledTexture);\n\t\t\t}\n\t\t\tskin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.fontStyles = this.darkFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.darkDisabledFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\t\t}\n\n\t\tprotected function setQuietButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar downSkin:Image = new Image(this.quietButtonDownTexture);\n\t\t\tdownSkin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tbutton.setSkinForState(ButtonState.DOWN, downSkin);\n\n\t\t\tvar defaultSkin:Quad = new Quad(this.controlSize, this.controlSize, 0xff00ff);\n\t\t\tdefaultSkin.alpha = 0;\n\t\t\tbutton.defaultSkin = defaultSkin;\n\n\t\t\tbutton.fontStyles = this.darkFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.darkDisabledFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\t\t}\n\n\t\tprotected function setDangerButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.dangerButtonUpTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.dangerButtonDownTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.dangerButtonDisabledTexture);\n\t\t\tskin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.fontStyles = this.lightFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.dangerDisabledFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\t\t}\n\n\t\tprotected function setCallToActionButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.callToActionButtonUpTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.callToActionButtonDownTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.callToActionButtonDisabledTexture);\n\t\t\tskin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.fontStyles = this.lightFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.actionDisabledFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\t\t}\n\n\t\tprotected function setBackButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.backButtonUpTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.backButtonDownTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.backButtonDisabledTexture);\n\t\t\tskin.scale9Grid = BACK_BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.fontStyles = this.darkFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.darkDisabledFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\n\t\t\tbutton.paddingLeft = this.gutterSize + this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setForwardButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.forwardButtonUpTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.forwardButtonDownTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.forwardButtonDisabledTexture);\n\t\t\tskin.scale9Grid = FORWARD_BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.fontStyles = this.darkFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.darkDisabledFontStyles.clone();\n\n\t\t\tsetBaseButtonStyles(button);\n\n\t\t\tbutton.paddingRight = this.gutterSize + this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// ButtonGroup\n\t//-------------------------\n\n\t\tprotected function setButtonGroupStyles(group:ButtonGroup):void\n\t\t{\n\t\t\tgroup.gap = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setButtonGroupButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonUpTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDownTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledTexture);\n\t\t\tif(button is ToggleButton)\n\t\t\t{\n\t\t\t\t//for convenience, this function can style both a regular button\n\t\t\t\t//and a toggle button\n\t\t\t\tskin.selectedTexture = this.toggleButtonSelectedUpTexture;\n\t\t\t\tskin.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.toggleButtonSelectedDisabledTexture);\n\t\t\t}\n\t\t\tskin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.wideControlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.wideControlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tbutton.fontStyles = this.darkFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.darkDisabledFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\t\t}\n\n\t//-------------------------\n\t// Callout\n\t//-------------------------\n\n\t\tprotected function setCalloutStyles(callout:Callout):void\n\t\t{\n\t\t\tvar backgroundSkin:Image = new Image(this.popUpBackgroundTexture);\n\t\t\tbackgroundSkin.scale9Grid = BACKGROUND_POPUP_SCALE9_GRID;\n\t\t\tbackgroundSkin.width = this.calloutBackgroundMinSize;\n\t\t\tbackgroundSkin.height = this.calloutBackgroundMinSize;\n\t\t\tcallout.backgroundSkin = backgroundSkin;\n\n\t\t\tvar topArrowSkin:Image = new Image(this.calloutTopArrowTexture);\n\t\t\tcallout.topArrowSkin = topArrowSkin;\n\t\t\tcallout.topArrowGap = this.calloutVerticalArrowGap;\n\n\t\t\tvar rightArrowSkin:Image = new Image(this.calloutRightArrowTexture);\n\t\t\tcallout.rightArrowSkin = rightArrowSkin;\n\t\t\tcallout.rightArrowGap = this.calloutHorizontalArrowGap;\n\n\t\t\tvar bottomArrowSkin:Image = new Image(this.calloutBottomArrowTexture);\n\t\t\tcallout.bottomArrowSkin = bottomArrowSkin;\n\t\t\tcallout.bottomArrowGap = this.calloutVerticalArrowGap;\n\n\t\t\tvar leftArrowSkin:Image = new Image(this.calloutLeftArrowTexture);\n\t\t\tcallout.leftArrowSkin = leftArrowSkin;\n\t\t\tcallout.leftArrowGap = this.calloutHorizontalArrowGap;\n\n\t\t\tcallout.padding = this.gutterSize;\n\t\t}\n\n\t//-------------------------\n\t// Check\n\t//-------------------------\n\n\t\tprotected function setCheckStyles(check:Check):void\n\t\t{\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.checkUpIconTexture);\n\t\t\ticon.selectedTexture = this.checkSelectedUpIconTexture;\n\t\t\ticon.setTextureForState(ButtonState.DOWN, this.checkDownIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DISABLED, this.checkDisabledIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.checkSelectedDownIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.checkSelectedDisabledIconTexture);\n\t\t\tcheck.defaultIcon = icon;\n\n\t\t\tcheck.fontStyles = this.darkFontStyles.clone();\n\t\t\tcheck.disabledFontStyles = this.darkDisabledFontStyles.clone();\n\n\t\t\tcheck.gap = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// DataGrid\n\t//-------------------------\n\n\t\tprotected function setDataGridStyles(grid:DataGrid):void\n\t\t{\n\t\t\tthis.setScrollerStyles(grid);\n\t\t\tgrid.backgroundSkin = new Quad(10, 10, COLOR_BACKGROUND_LIGHT);\n\n\t\t\tvar columnResizeSkin:ImageSkin = new ImageSkin(this.dataGridColumnResizeSkinTexture);\n\t\t\tcolumnResizeSkin.scale9Grid = DATA_GRID_COLUMN_RESIZE_SCALE_9_GRID;\n\t\t\tgrid.columnResizeSkin = columnResizeSkin;\n\n\t\t\tvar columnDropIndicatorSkin:ImageSkin = new ImageSkin(this.dataGridColumnDropIndicatorSkinTexture);\n\t\t\tcolumnDropIndicatorSkin.scale9Grid = DATA_GRID_COLUMN_DROP_INDICATOR_SCALE_9_GRID;\n\t\t\tgrid.columnDropIndicatorSkin = columnDropIndicatorSkin;\n\t\t\tgrid.extendedColumnDropIndicator = true;\n\n\t\t\tvar columnDragOverlaySkin:Quad = new Quad(1, 1, COLOR_DATA_GRID_DRAG_OVERLAY);\n\t\t\tcolumnDragOverlaySkin.alpha = ALPHA_DATA_GRID_DRAG_OVERLAY;\n\t\t\tgrid.columnDragOverlaySkin = columnDragOverlaySkin;\n\n\t\t\tgrid.headerDividerFactory = this.dataGridHeaderDividerFactory;\n\t\t}\n\n\t\tprotected function setDataGridHeaderRendererStyles(headerRenderer:DefaultDataGridHeaderRenderer):void\n\t\t{\n\t\t\tvar backgroundSkin:Image = new Image(this.dataGridHeaderTexture);\n\t\t\tbackgroundSkin.scale9Grid = DATA_GRID_HEADER_SCALE9_GRID;\n\t\t\theaderRenderer.backgroundSkin = backgroundSkin;\n\n\t\t\theaderRenderer.sortAscendingIcon = new ImageSkin(this.dataGridHeaderSortAscendingIconTexture);\n\t\t\theaderRenderer.sortDescendingIcon = new ImageSkin(this.dataGridHeaderSortDescendingIconTexture);\n\n\t\t\theaderRenderer.fontStyles = this.smallDarkFontStyles.clone();\n\t\t\theaderRenderer.disabledFontStyles = this.smallDarkDisabledFontStyles.clone();\n\n\t\t\theaderRenderer.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\theaderRenderer.paddingTop = this.smallGutterSize;\n\t\t\theaderRenderer.paddingRight = this.gutterSize;\n\t\t\theaderRenderer.paddingBottom = this.smallGutterSize;\n\t\t\theaderRenderer.paddingLeft = this.gutterSize;\n\t\t}\n\n\t//-------------------------\n\t// DateTimeSpinner\n\t//-------------------------\n\n\t\tprotected function setDateTimeSpinnerStyles(spinner:DateTimeSpinner):void\n\t\t{\n\t\t\tspinner.customItemRendererStyleName = THEME_STYLE_NAME_DATE_TIME_SPINNER_LIST_ITEM_RENDERER;\n\t\t}\n\n\t\tprotected function setDateTimeSpinnerListItemRendererStyles(itemRenderer:DefaultListItemRenderer):void\n\t\t{\n\t\t\tthis.setSpinnerListItemRendererStyles(itemRenderer);\n\n\t\t\titemRenderer.paddingLeft = this.smallGutterSize;\n\t\t\titemRenderer.paddingRight = this.smallGutterSize;\n\t\t\titemRenderer.gap = this.extraSmallGutterSize;\n\t\t\titemRenderer.minGap = this.extraSmallGutterSize;\n\t\t\titemRenderer.accessoryGap = this.extraSmallGutterSize;\n\t\t\titemRenderer.minAccessoryGap = this.extraSmallGutterSize;\n\t\t\titemRenderer.accessoryPosition = RelativePosition.LEFT;\n\t\t}\n\n\t//-------------------------\n\t// Drawers\n\t//-------------------------\n\n\t\tprotected function setDrawersStyles(drawers:Drawers):void\n\t\t{\n\t\t\tvar overlaySkin:Quad = new Quad(10, 10, COLOR_DRAWER_OVERLAY);\n\t\t\toverlaySkin.alpha = ALPHA_DRAWER_OVERLAY;\n\t\t\tdrawers.overlaySkin = overlaySkin;\n\n\t\t\tvar topDrawerDivider:Quad = new Quad(this.borderSize, this.borderSize, COLOR_DRAWERS_DIVIDER);\n\t\t\tdrawers.topDrawerDivider = topDrawerDivider;\n\n\t\t\tvar rightDrawerDivider:Quad = new Quad(this.borderSize, this.borderSize, COLOR_DRAWERS_DIVIDER);\n\t\t\tdrawers.rightDrawerDivider = rightDrawerDivider;\n\n\t\t\tvar bottomDrawerDivider:Quad = new Quad(this.borderSize, this.borderSize, COLOR_DRAWERS_DIVIDER);\n\t\t\tdrawers.bottomDrawerDivider = bottomDrawerDivider;\n\n\t\t\tvar leftDrawerDivider:Quad = new Quad(this.borderSize, this.borderSize, COLOR_DRAWERS_DIVIDER);\n\t\t\tdrawers.leftDrawerDivider = leftDrawerDivider;\n\t\t}\n\n\t//-------------------------\n\t// GroupedList\n\t//-------------------------\n\n\t\tprotected function setGroupedListStyles(list:GroupedList):void\n\t\t{\n\t\t\tthis.setScrollerStyles(list);\n\t\t\tlist.backgroundSkin = new Quad(10, 10, COLOR_BACKGROUND_LIGHT);\n\t\t\tlist.customFirstItemRendererStyleName = THEME_STYLE_NAME_GROUPED_LIST_FIRST_ITEM_RENDERER;\n\t\t}\n\n\t\tprotected function setInsetGroupedListStyles(list:GroupedList):void\n\t\t{\n\t\t\tthis.setGroupedListStyles(list);\n\t\t\tlist.customHeaderRendererStyleName = GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_HEADER_RENDERER;\n\t\t\tlist.customFooterRendererStyleName = GroupedList.ALTERNATE_CHILD_STYLE_NAME_INSET_FOOTER_RENDERER;\n\t\t}\n\n\t\t//see List section for item renderer styles\n\n\t\tprotected function setGroupedListFirstItemRendererStyles(itemRenderer:BaseDefaultItemRenderer):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.firstItemRendererUpTexture);\n\t\t\tskin.selectedTexture = this.itemRendererSelectedTexture;\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.itemRendererDownTexture);\n\t\t\tskin.scale9Grid = LIST_ITEM_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\titemRenderer.defaultSkin = skin;\n\n\t\t\titemRenderer.fontStyles = this.darkFontStyles.clone();\n\t\t\titemRenderer.disabledFontStyles = this.darkDisabledFontStyles.clone();\n\n\t\t\titemRenderer.iconLabelFontStyles = this.smallDarkFontStyles.clone();\n\t\t\titemRenderer.iconLabelDisabledFontStyles = this.smallDarkDisabledFontStyles.clone();\n\n\t\t\titemRenderer.accessoryLabelFontStyles = this.smallDarkFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelDisabledFontStyles = this.smallDarkDisabledFontStyles.clone();\n\n\t\t\tthis.setBaseItemRendererStyles(itemRenderer);\n\t\t}\n\n\t\tprotected function setGroupedListHeaderRendererStyles(headerRenderer:DefaultGroupedListHeaderOrFooterRenderer):void\n\t\t{\n\t\t\tvar backgroundSkin:Image = new Image(this.groupedListHeaderTexture);\n\t\t\tbackgroundSkin.scale9Grid = GROUPED_LIST_HEADER_OR_FOOTER_SCALE9_GRID;\n\t\t\theaderRenderer.backgroundSkin = backgroundSkin;\n\n\t\t\theaderRenderer.fontStyles = this.smallDarkFontStyles.clone();\n\t\t\theaderRenderer.disabledFontStyles = this.smallDarkDisabledFontStyles.clone();\n\n\t\t\theaderRenderer.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\theaderRenderer.paddingTop = this.smallGutterSize;\n\t\t\theaderRenderer.paddingRight = this.gutterSize;\n\t\t\theaderRenderer.paddingBottom = this.smallGutterSize;\n\t\t\theaderRenderer.paddingLeft = this.gutterSize;\n\t\t}\n\n\t\tprotected function setGroupedListInsetHeaderRendererStyles(headerRenderer:DefaultGroupedListHeaderOrFooterRenderer):void\n\t\t{\n\t\t\theaderRenderer.fontStyles = this.smallDarkFontStyles.clone();\n\t\t\theaderRenderer.disabledFontStyles = this.smallDarkDisabledFontStyles.clone();\n\n\t\t\theaderRenderer.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\theaderRenderer.paddingTop = this.gutterSize;\n\t\t\theaderRenderer.paddingRight = this.gutterSize;\n\t\t\theaderRenderer.paddingBottom = this.smallGutterSize;\n\t\t\theaderRenderer.paddingLeft = this.gutterSize;\n\t\t}\n\n\t\tprotected function setGroupedListFooterRendererStyles(footerRenderer:DefaultGroupedListHeaderOrFooterRenderer):void\n\t\t{\n\t\t\tvar backgroundSkin:Image = new Image(this.groupedListFooterTexture);\n\t\t\tbackgroundSkin.scale9Grid = GROUPED_LIST_HEADER_OR_FOOTER_SCALE9_GRID;\n\t\t\tfooterRenderer.backgroundSkin = backgroundSkin;\n\n\t\t\tfooterRenderer.fontStyles = this.smallDarkFontStyles.clone();\n\t\t\tfooterRenderer.disabledFontStyles = this.smallDarkDisabledFontStyles.clone();\n\n\t\t\tfooterRenderer.horizontalAlign = HorizontalAlign.CENTER;\n\t\t\tfooterRenderer.paddingTop = this.smallGutterSize;\n\t\t\tfooterRenderer.paddingRight = this.gutterSize;\n\t\t\tfooterRenderer.paddingBottom = this.smallGutterSize;\n\t\t\tfooterRenderer.paddingLeft = this.gutterSize;\n\t\t}\n\n\t\tprotected function setGroupedListInsetFooterRendererStyles(footerRenderer:DefaultGroupedListHeaderOrFooterRenderer):void\n\t\t{\n\t\t\tfooterRenderer.fontStyles = this.darkFontStyles.clone();\n\t\t\tfooterRenderer.disabledFontStyles = this.darkDisabledFontStyles.clone();\n\n\t\t\tfooterRenderer.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\tfooterRenderer.paddingTop = this.smallGutterSize;\n\t\t\tfooterRenderer.paddingRight = this.gutterSize;\n\t\t\tfooterRenderer.paddingBottom = this.gutterSize;\n\t\t\tfooterRenderer.paddingLeft = this.gutterSize;\n\t\t}\n\n\t//-------------------------\n\t// Header\n\t//-------------------------\n\n\t\tprotected function setHeaderStyles(header:Header):void\n\t\t{\n\t\t\tthis.setHeaderWithoutBackgroundStyles(header);\n\n\t\t\theader.fontStyles = this.largeDarkFontStyles.clone();\n\t\t\theader.disabledFontStyles = this.largeDarkDisabledFontStyles.clone();\n\n\t\t\tvar backgroundSkin:Image = new Image(this.headerBackgroundSkinTexture);\n\t\t\tbackgroundSkin.scale9Grid = HEADER_BACKGROUND_SCALE9_GRID;\n\t\t\tbackgroundSkin.width = this.gridSize;\n\t\t\tbackgroundSkin.height = this.gridSize;\n\t\t\theader.backgroundSkin = backgroundSkin;\n\t\t}\n\n\t//-------------------------\n\t// Label\n\t//-------------------------\n\n\t\tprotected function setLabelStyles(label:Label):void\n\t\t{\n\t\t\tlabel.fontStyles = this.darkFontStyles.clone();\n\t\t\tlabel.disabledFontStyles = this.darkDisabledFontStyles.clone();\n\t\t}\n\n\t\tprotected function setHeadingLabelStyles(label:Label):void\n\t\t{\n\t\t\tlabel.fontStyles = this.largeDarkFontStyles.clone();\n\t\t\tlabel.disabledFontStyles = this.largeDarkDisabledFontStyles.clone();\n\t\t}\n\n\t\tprotected function setDetailLabelStyles(label:Label):void\n\t\t{\n\t\t\tlabel.fontStyles = this.smallDarkFontStyles.clone();\n\t\t\tlabel.disabledFontStyles = this.smallDarkDisabledFontStyles.clone();\n\t\t}\n\n\t//-------------------------\n\t// LayoutGroup\n\t//-------------------------\n\n\t\tprotected function setToolbarLayoutGroupStyles(group:LayoutGroup):void\n\t\t{\n\t\t\tif(!group.layout)\n\t\t\t{\n\t\t\t\tvar layout:HorizontalLayout = new HorizontalLayout();\n\t\t\t\tlayout.paddingTop = this.smallGutterSize;\n\t\t\t\tlayout.paddingRight = this.smallGutterSize;\n\t\t\t\tlayout.paddingBottom = this.smallGutterSize;\n\t\t\t\tlayout.paddingLeft = this.smallGutterSize;\n\t\t\t\tlayout.gap = this.smallGutterSize;\n\t\t\t\tgroup.layout = layout;\n\t\t\t}\n\n\t\t\tgroup.backgroundSkin = new Quad(this.controlSize, this.controlSize, COLOR_BACKGROUND_LIGHT);\n\t\t}\n\n\t//-------------------------\n\t// List\n\t//-------------------------\n\n\t\tprotected function setListStyles(list:List):void\n\t\t{\n\t\t\tthis.setScrollerStyles(list);\n\t\t\tlist.backgroundSkin = new Quad(10, 10, COLOR_BACKGROUND_LIGHT);\n\n\t\t\tvar dropIndicatorSkin:Quad = new Quad(this.borderSize, this.borderSize, COLOR_TEXT_DARK);\n\t\t\tlist.dropIndicatorSkin = dropIndicatorSkin;\n\t\t}\n\n\t\tprotected function setListItemRendererStyles(itemRenderer:DefaultListItemRenderer):void\n\t\t{\n\t\t\tthis.setItemRendererStyles(itemRenderer);\n\n\t\t\tvar dragIcon:ImageSkin = new ImageSkin(this.dragHandleIconTexture);\n\t\t\tdragIcon.minTouchWidth = this.gridSize;\n\t\t\tdragIcon.minTouchHeight = this.gridSize;\n\t\t\titemRenderer.dragIcon = dragIcon;\n\t\t}\n\n\t\tprotected function setBaseItemRendererStyles(itemRenderer:BaseDefaultItemRenderer):void\n\t\t{\n\t\t\titemRenderer.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\titemRenderer.paddingTop = this.smallGutterSize;\n\t\t\titemRenderer.paddingRight = this.gutterSize;\n\t\t\titemRenderer.paddingBottom = this.smallGutterSize;\n\t\t\titemRenderer.paddingLeft = this.gutterSize;\n\t\t\titemRenderer.gap = this.gutterSize;\n\t\t\titemRenderer.minGap = this.gutterSize;\n\t\t\titemRenderer.iconPosition = RelativePosition.LEFT;\n\t\t\titemRenderer.accessoryGap = Number.POSITIVE_INFINITY;\n\t\t\titemRenderer.minAccessoryGap = this.gutterSize;\n\t\t\titemRenderer.accessoryPosition = RelativePosition.RIGHT;\n\t\t\titemRenderer.minTouchWidth = this.controlSize;\n\t\t\titemRenderer.minTouchHeight = this.controlSize;\n\t\t}\n\n\t\tprotected function setItemRendererStyles(itemRenderer:BaseDefaultItemRenderer):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.itemRendererUpTexture);\n\t\t\tskin.selectedTexture = this.itemRendererSelectedTexture;\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.itemRendererDownTexture);\n\t\t\tskin.scale9Grid = LIST_ITEM_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\titemRenderer.defaultSkin = skin;\n\n\t\t\titemRenderer.fontStyles = this.darkFontStyles.clone();\n\t\t\titemRenderer.disabledFontStyles = this.darkDisabledFontStyles.clone();\n\n\t\t\titemRenderer.iconLabelFontStyles = this.smallDarkFontStyles.clone();\n\t\t\titemRenderer.iconLabelDisabledFontStyles = this.smallDarkDisabledFontStyles.clone();\n\n\t\t\titemRenderer.accessoryLabelFontStyles = this.smallDarkFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelDisabledFontStyles = this.smallDarkDisabledFontStyles.clone();\n\n\t\t\tthis.setBaseItemRendererStyles(itemRenderer);\n\t\t}\n\n\t//-------------------------\n\t// NumericStepper\n\t//-------------------------\n\n\t\tprotected function setNumericStepperStyles(stepper:NumericStepper):void\n\t\t{\n\t\t\tstepper.buttonLayoutMode = StepperButtonLayoutMode.SPLIT_HORIZONTAL;\n\t\t\tstepper.incrementButtonLabel = \"+\";\n\t\t\tstepper.decrementButtonLabel = \"-\";\n\t\t}\n\n\t\tprotected function setNumericStepperTextInputStyles(input:TextInput):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.textInputBackgroundEnabledTexture);\n\t\t\tskin.disabledTexture = this.textInputBackgroundDisabledTexture;\n\t\t\tskin.scale9Grid = TEXT_INPUT_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tinput.backgroundSkin = skin;\n\n\t\t\tinput.textEditorFactory = stepperTextEditorFactory;\n\t\t\tinput.fontStyles = this.darkCenteredFontStyles.clone();\n\t\t\tinput.disabledFontStyles = this.darkCenteredDisabledFontStyles.clone();\n\n\t\t\tinput.padding = this.smallGutterSize;\n\t\t\tinput.isEditable = false;\n\t\t\tinput.isSelectable = false;\n\t\t}\n\n\t\tprotected function setNumericStepperButtonStyles(button:Button):void\n\t\t{\n\t\t\tsetQuietButtonStyles(button);\n\n\t\t\tbutton.keepDownStateOnRollOut = true;\n\n\t\t\tbutton.fontStyles = this.largeDarkFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.largeDarkDisabledFontStyles.clone();\n\t\t}\n\n\t//-------------------------\n\t// PageIndicator\n\t//-------------------------\n\n\t\tprotected function setPageIndicatorStyles(pageIndicator:PageIndicator):void\n\t\t{\n\t\t\tpageIndicator.normalSymbolFactory = pageIndicatorNormalSymbolFactory;\n\t\t\tpageIndicator.selectedSymbolFactory = pageIndicatorSelectedSymbolFactory;\n\t\t\tpageIndicator.gap = this.gutterSize;\n\t\t\tpageIndicator.padding = this.gutterSize;\n\t\t\tpageIndicator.minTouchWidth = this.controlSize;\n\t\t\tpageIndicator.minTouchHeight = this.controlSize;\n\t\t}\n\n\t//-------------------------\n\t// Panel\n\t//-------------------------\n\n\t\tprotected function setPanelStyles(panel:Panel):void\n\t\t{\n\t\t\tthis.setScrollerStyles(panel);\n\n\t\t\tvar backgroundSkin:Image = new Image(this.popUpBackgroundTexture);\n\t\t\tbackgroundSkin.scale9Grid = BACKGROUND_POPUP_SCALE9_GRID;\n\t\t\tpanel.backgroundSkin = backgroundSkin;\n\n\t\t\tpanel.paddingTop = this.smallGutterSize;\n\t\t\tpanel.paddingRight = this.smallGutterSize;\n\t\t\tpanel.paddingBottom = this.smallGutterSize;\n\t\t\tpanel.paddingLeft = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setHeaderWithoutBackgroundStyles(header:Header):void\n\t\t{\n\t\t\theader.fontStyles = this.largeDarkFontStyles.clone();\n\t\t\theader.disabledFontStyles = this.largeDarkDisabledFontStyles.clone();\n\n\t\t\theader.gap = this.gutterSize;\n\t\t\theader.paddingTop = this.smallGutterSize;\n\t\t\theader.paddingRight = this.smallGutterSize;\n\t\t\theader.paddingBottom = this.smallGutterSize;\n\t\t\theader.paddingLeft = this.smallGutterSize;\n\t\t\theader.titleGap = this.smallGutterSize;\n\t\t\theader.minHeight = this.gridSize;\n\t\t}\n\n\t//-------------------------\n\t// PanelScreen\n\t//-------------------------\n\n\t\tprotected function setPanelScreenStyles(screen:PanelScreen):void\n\t\t{\n\t\t\tthis.setScrollerStyles(screen);\n\t\t}\n\n\t\tprotected function setPanelScreenHeaderStyles(header:Header):void\n\t\t{\n\t\t\tthis.setHeaderStyles(header);\n\n\t\t\theader.useExtraPaddingForOSStatusBar = true;\n\t\t}\n\n\t//-------------------------\n\t// PickerList\n\t//-------------------------\n\n\t\tprotected function setPickerListStyles(list:PickerList):void\n\t\t{\n\t\t\tif(DeviceCapabilities.isPhone(this.starling.nativeStage))\n\t\t\t{\n\t\t\t\tlist.listFactory = pickerListSpinnerListFactory;\n\n\t\t\t\tvar popUpContentManager:BottomDrawerPopUpContentManager = new BottomDrawerPopUpContentManager();\n\t\t\t\tpopUpContentManager.customPanelStyleName = THEME_STYLE_NAME_POP_UP_DRAWER;\n\t\t\t\tlist.popUpContentManager = popUpContentManager;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlist.popUpContentManager = new CalloutPopUpContentManager();\n\t\t\t\tlist.customItemRendererStyleName = THEME_STYLE_NAME_TABLET_PICKER_LIST_ITEM_RENDERER;\n\t\t\t}\n\t\t}\n\n\t\tprotected function setPickerListButtonStyles(button:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonUpTexture);\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.buttonDownTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledTexture);\n\t\t\tskin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tbutton.defaultSkin = skin;\n\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.pickerListButtonIcon);\n\t\t\ticon.disabledTexture = this.pickerListButtonDisabledIcon;\n\t\t\tbutton.defaultIcon = icon;\n\n\t\t\tbutton.fontStyles = this.darkFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.darkDisabledFontStyles.clone();\n\n\t\t\tthis.setBaseButtonStyles(button);\n\n\t\t\tbutton.gap = Number.POSITIVE_INFINITY;\n\t\t\tbutton.minGap = this.gutterSize;\n\t\t\tbutton.iconPosition = RelativePosition.RIGHT;\n\t\t\tbutton.paddingLeft = this.gutterSize;\n\t\t}\n\n\t\tprotected function setPickerListListStyles(list:List):void\n\t\t{\n\t\t\tthis.setDropDownListStyles(list);\n\t\t}\n\n\t\tprotected function setTabletPickerListItemRendererStyles(itemRenderer:BaseDefaultItemRenderer):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.itemRendererUpTexture);\n\t\t\tskin.selectedTexture = this.itemRendererSelectedTexture;\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.itemRendererDownTexture);\n\t\t\tskin.scale9Grid = LIST_ITEM_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.popUpFillSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\titemRenderer.defaultSkin = skin;\n\n\t\t\titemRenderer.fontStyles = this.darkFontStyles.clone();\n\t\t\titemRenderer.disabledFontStyles = this.darkDisabledFontStyles.clone();\n\n\t\t\titemRenderer.iconLabelFontStyles = this.smallDarkFontStyles.clone();\n\t\t\titemRenderer.iconLabelDisabledFontStyles = this.smallDarkDisabledFontStyles.clone();\n\n\t\t\titemRenderer.accessoryLabelFontStyles = this.smallDarkFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelDisabledFontStyles = this.smallDarkDisabledFontStyles.clone();\n\n\t\t\tthis.setBaseItemRendererStyles(itemRenderer);\n\t\t}\n\n\t\tprotected function setPickerListPopUpDrawerStyles(panel:Panel):void\n\t\t{\n\t\t\tthis.setScrollerStyles(panel);\n\n\t\t\tpanel.customHeaderStyleName = THEME_STYLE_NAME_POP_UP_DRAWER_HEADER;\n\n\t\t\tvar backgroundSkin:Image = new Image(this.popUpDrawerBackgroundTexture);\n\t\t\tbackgroundSkin.scale9Grid = POP_UP_DRAWER_BACKGROUND_SCALE9_GRID;\n\t\t\tpanel.backgroundSkin = backgroundSkin;\n\n\t\t\tpanel.outerPaddingTop = this.shadowSize;\n\t\t}\n\n\t//-------------------------\n\t// ProgressBar\n\t//-------------------------\n\n\t\tprotected function setProgressBarStyles(progress:ProgressBar):void\n\t\t{\n\t\t\tvar backgroundSkin:Image;\n\t\t\tvar backgroundDisabledSkin:Image;\n\t\t\t/* Horizontal background skin */\n\t\t\tif(progress.direction === Direction.HORIZONTAL)\n\t\t\t{\n\t\t\t\tbackgroundSkin = new Image(this.horizontalProgressBarBackgroundTexture);\n\t\t\t\tbackgroundSkin.scale9Grid = BAR_HORIZONTAL_SCALE9_GRID;\n\t\t\t\tbackgroundSkin.width = this.wideControlSize;\n\t\t\t\tbackgroundSkin.height = this.smallControlSize;\n\t\t\t\tbackgroundDisabledSkin = new Image(this.horizontalProgressBarBackgroundDisabledTexture);\n\t\t\t\tbackgroundDisabledSkin.scale9Grid = BAR_HORIZONTAL_SCALE9_GRID;\n\t\t\t\tbackgroundDisabledSkin.width = this.wideControlSize;\n\t\t\t\tbackgroundDisabledSkin.height = this.smallControlSize;\n\t\t\t}\n\t\t\telse //vertical\n\t\t\t{\n\t\t\t\tbackgroundSkin = new Image(this.verticalProgressBarBackgroundTexture);\n\t\t\t\tbackgroundSkin.scale9Grid = BAR_VERTICAL_SCALE9_GRID;\n\t\t\t\tbackgroundSkin.width = this.smallControlSize;\n\t\t\t\tbackgroundSkin.height = this.wideControlSize;\n\t\t\t\tbackgroundDisabledSkin = new Image(this.verticalProgressBarBackgroundDisabledTexture);\n\t\t\t\tbackgroundDisabledSkin.scale9Grid = BAR_VERTICAL_SCALE9_GRID;\n\t\t\t\tbackgroundDisabledSkin.width = this.smallControlSize;\n\t\t\t\tbackgroundDisabledSkin.height = this.wideControlSize;\n\t\t\t}\n\t\t\tprogress.backgroundSkin = backgroundSkin;\n\t\t\tprogress.backgroundDisabledSkin = backgroundDisabledSkin;\n\n\t\t\tvar fillSkin:Image;\n\t\t\tvar fillDisabledSkin:Image;\n\t\t\t/* Horizontal fill skin */\n\t\t\tif(progress.direction === Direction.HORIZONTAL)\n\t\t\t{\n\t\t\t\tfillSkin = new Image(this.horizontalProgressBarFillTexture);\n\t\t\t\tfillSkin.scale9Grid = BAR_HORIZONTAL_SCALE9_GRID;\n\t\t\t\tfillSkin.width = this.smallControlSize;\n\t\t\t\tfillSkin.height = this.smallControlSize;\n\t\t\t\tfillDisabledSkin = new Image(this.horizontalProgressBarFillDisabledTexture);\n\t\t\t\tfillDisabledSkin.scale9Grid = BAR_HORIZONTAL_SCALE9_GRID;\n\t\t\t\tfillDisabledSkin.width = this.smallControlSize;\n\t\t\t\tfillDisabledSkin.height = this.smallControlSize;\n\t\t\t}\n\t\t\telse //vertical\n\t\t\t{\n\t\t\t\tfillSkin = new Image(this.verticalProgressBarFillTexture);\n\t\t\t\tfillSkin.scale9Grid = BAR_VERTICAL_SCALE9_GRID;\n\t\t\t\tfillSkin.width = this.smallControlSize;\n\t\t\t\tfillSkin.height = this.smallControlSize;\n\t\t\t\tfillDisabledSkin = new Image(verticalProgressBarFillDisabledTexture);\n\t\t\t\tfillDisabledSkin.scale9Grid = BAR_VERTICAL_SCALE9_GRID;\n\t\t\t\tfillDisabledSkin.width = this.smallControlSize;\n\t\t\t\tfillDisabledSkin.height = this.smallControlSize;\n\t\t\t}\n\t\t\tprogress.fillSkin = fillSkin;\n\t\t\tprogress.fillDisabledSkin = fillDisabledSkin;\n\t\t}\n\n\t//-------------------------\n\t// Radio\n\t//-------------------------\n\n\t\tprotected function setRadioStyles(radio:Radio):void\n\t\t{\n\t\t\tvar icon:ImageSkin = new ImageSkin(this.radioUpIconTexture);\n\t\t\ticon.selectedTexture = this.radioSelectedUpIconTexture;\n\t\t\ticon.setTextureForState(ButtonState.DOWN, this.radioDownIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DISABLED, this.radioDisabledIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DOWN_AND_SELECTED, this.radioSelectedDownIconTexture);\n\t\t\ticon.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.radioSelectedDisabledIconTexture);\n\t\t\tradio.defaultIcon = icon;\n\n\t\t\tradio.fontStyles = this.darkFontStyles.clone();\n\t\t\tradio.disabledFontStyles = this.darkDisabledFontStyles.clone();\n\n\t\t\tradio.gap = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// ScrollContainer\n\t//-------------------------\n\n\t\tprotected function setScrollContainerStyles(container:ScrollContainer):void\n\t\t{\n\t\t\tthis.setScrollerStyles(container);\n\t\t}\n\n\t\tprotected function setToolbarScrollContainerStyles(container:ScrollContainer):void\n\t\t{\n\t\t\tthis.setScrollerStyles(container);\n\t\t\tif(!container.layout)\n\t\t\t{\n\t\t\t\tvar layout:HorizontalLayout = new HorizontalLayout();\n\t\t\t\tlayout.paddingTop = this.smallGutterSize;\n\t\t\t\tlayout.paddingRight = this.smallGutterSize;\n\t\t\t\tlayout.paddingBottom = this.smallGutterSize;\n\t\t\t\tlayout.paddingLeft = this.smallGutterSize;\n\t\t\t\tlayout.gap = this.smallGutterSize;\n\t\t\t\tcontainer.layout = layout;\n\t\t\t}\n\n\t\t\tcontainer.backgroundSkin = new Quad(this.controlSize, this.controlSize, COLOR_BACKGROUND_LIGHT);\n\t\t}\n\n\t//-------------------------\n\t// ScrollText\n\t//-------------------------\n\n\t\tprotected function setScrollTextStyles(text:ScrollText):void\n\t\t{\n\t\t\tthis.setScrollerStyles(text);\n\n\t\t\ttext.fontStyles = this.darkScrollTextFontStyles.clone();\n\t\t\ttext.disabledFontStyles = this.darkScrollTextDisabledFontStyles.clone();\n\n\t\t\ttext.padding = this.gutterSize;\n\t\t\ttext.paddingRight = this.gutterSize + this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// SimpleScrollBar\n\t//-------------------------\n\n\t\tprotected function setSimpleScrollBarStyles(scrollBar:SimpleScrollBar):void\n\t\t{\n\t\t\tif(scrollBar.direction === Direction.HORIZONTAL)\n\t\t\t{\n\t\t\t\tscrollBar.customThumbStyleName = THEME_STYLE_NAME_HORIZONTAL_SIMPLE_SCROLL_BAR_THUMB;\n\t\t\t}\n\t\t\telse //vertical\n\t\t\t{\n\t\t\t\tscrollBar.customThumbStyleName = THEME_STYLE_NAME_VERTICAL_SIMPLE_SCROLL_BAR_THUMB;\n\t\t\t}\n\t\t\tscrollBar.paddingTop = this.extraSmallGutterSize;\n\t\t\tscrollBar.paddingRight = this.extraSmallGutterSize;\n\t\t\tscrollBar.paddingBottom = this.extraSmallGutterSize;\n\t\t}\n\n\t\tprotected function setHorizontalSimpleScrollBarThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar defaultSkin:Image = new Image(this.horizontalSimpleScrollBarThumbTexture);\n\t\t\tdefaultSkin.scale9Grid = HORIZONTAL_SIMPLE_SCROLL_BAR_SCALE9_GRID;\n\t\t\tthumb.defaultSkin = defaultSkin;\n\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVerticalSimpleScrollBarThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar defaultSkin:Image = new Image(this.verticalSimpleScrollBarThumbTexture);\n\t\t\tdefaultSkin.scale9Grid = VERTICAL_SIMPLE_SCROLL_BAR_SCALE9_GRID;\n\t\t\tthumb.defaultSkin = defaultSkin;\n\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t//-------------------------\n\t// SpinnerList\n\t//-------------------------\n\n\t\tprotected function setSpinnerListStyles(list:SpinnerList):void\n\t\t{\n\t\t\tlist.verticalScrollPolicy = ScrollPolicy.ON;\n\t\t\tlist.backgroundSkin = new Quad(this.controlSize, this.controlSize, COLOR_SPINNER_LIST_BACKGROUND);\n\t\t\tvar selectionOverlaySkin:Image = new Image(this.spinnerListSelectionOverlayTexture);\n\t\t\tselectionOverlaySkin.scale9Grid = SPINNER_LIST_OVERLAY_SCALE9_GRID;\n\t\t\tlist.selectionOverlaySkin = selectionOverlaySkin;\n\t\t\tlist.customItemRendererStyleName = THEME_STYLE_NAME_SPINNER_LIST_ITEM_RENDERER;\n\t\t}\n\n\t\tprotected function setSpinnerListItemRendererStyles(itemRenderer:DefaultListItemRenderer):void\n\t\t{\n\t\t\tvar defaultSkin:Quad = new Quad(this.gridSize, this.gridSize, 0xff00ff);\n\t\t\tdefaultSkin.alpha = 0;\n\t\t\titemRenderer.defaultSkin = defaultSkin;\n\n\t\t\titemRenderer.fontStyles = this.darkFontStyles.clone();\n\t\t\titemRenderer.disabledFontStyles = this.darkDisabledFontStyles.clone();\n\t\t\titemRenderer.selectedFontStyles = this.selectedFontStyles.clone();\n\n\t\t\titemRenderer.iconLabelFontStyles = this.smallDarkFontStyles.clone();\n\t\t\titemRenderer.iconLabelDisabledFontStyles = this.smallDarkDisabledFontStyles.clone();\n\t\t\titemRenderer.iconLabelSelectedFontStyles = this.smallSelectedFontStyles.clone();\n\n\t\t\titemRenderer.accessoryLabelFontStyles = this.smallDarkFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelDisabledFontStyles = this.smallDarkDisabledFontStyles.clone();\n\t\t\titemRenderer.accessoryLabelSelectedFontStyles = this.smallSelectedFontStyles.clone();\n\n\t\t\titemRenderer.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\titemRenderer.paddingTop = this.smallGutterSize;\n\t\t\titemRenderer.paddingBottom = this.smallGutterSize;\n\t\t\titemRenderer.paddingLeft = this.gutterSize;\n\t\t\titemRenderer.paddingRight = this.gutterSize;\n\t\t\titemRenderer.gap = this.smallGutterSize;\n\t\t\titemRenderer.minGap = this.smallGutterSize;\n\t\t\titemRenderer.iconPosition = RelativePosition.LEFT;\n\t\t\titemRenderer.accessoryGap = Number.POSITIVE_INFINITY;\n\t\t\titemRenderer.minAccessoryGap = this.smallGutterSize;\n\t\t\titemRenderer.accessoryPosition = RelativePosition.RIGHT;\n\t\t}\n\n\t//-------------------------\n\t// Slider\n\t//-------------------------\n\n\t\tprotected function setSliderStyles(slider:Slider):void\n\t\t{\n\t\t\tslider.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t\tif(slider.direction === Direction.VERTICAL)\n\t\t\t{\n\t\t\t\tslider.customThumbStyleName = THEME_STYLE_NAME_VERTICAL_SLIDER_THUMB;\n\t\t\t\tslider.customMinimumTrackStyleName = THEME_STYLE_NAME_VERTICAL_SLIDER_MINIMUM_TRACK;\n\t\t\t\tslider.customMaximumTrackStyleName = THEME_STYLE_NAME_VERTICAL_SLIDER_MAXIMUM_TRACK;\n\t\t\t}\n\t\t\telse //horizontal\n\t\t\t{\n\t\t\t\tslider.customThumbStyleName = THEME_STYLE_NAME_HORIZONTAL_SLIDER_THUMB;\n\t\t\t\tslider.customMinimumTrackStyleName = THEME_STYLE_NAME_HORIZONTAL_SLIDER_MINIMUM_TRACK;\n\t\t\t\tslider.customMaximumTrackStyleName = THEME_STYLE_NAME_HORIZONTAL_SLIDER_MAXIMUM_TRACK;\n\t\t\t}\n\t\t}\n\n\t\tprotected function setHorizontalSliderMinimumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.horizontalSliderMinimumTrackTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.horizontalSliderMinimumTrackDisabledTexture);\n\t\t\tskin.scale9Grid = HORIZONTAL_MINIMUM_TRACK_SCALE9_GRID;\n\t\t\tskin.width = this.wideControlSize - this.thumbSize / 2;\n\t\t\tskin.height = this.smallControlSize;\n\t\t\ttrack.defaultSkin = skin;\n\t\t\t\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setHorizontalSliderMaximumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.horizontalSliderMaximumTrackTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.horizontalSliderMaximumTrackDisabledTexture);\n\t\t\tskin.scale9Grid = HORIZONTAL_MAXIMUM_TRACK_SCALE9_GRID;\n\t\t\tskin.width = this.wideControlSize - this.thumbSize / 2;\n\t\t\tskin.height = this.smallControlSize;\n\t\t\ttrack.defaultSkin = skin;\n\t\t\t\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVerticalSliderMinimumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.verticalSliderMinimumTrackTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.verticalSliderMinimumTrackDisabledTexture);\n\t\t\tskin.scale9Grid = VERTICAL_MINIMUM_TRACK_SCALE9_GRID;\n\t\t\tskin.width = this.smallControlSize;\n\t\t\tskin.height = this.wideControlSize - this.thumbSize / 2;\n\t\t\ttrack.defaultSkin = skin;\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVerticalSliderMaximumTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.verticalSliderMaximumTrackTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.verticalSliderMaximumTrackDisabledTexture);\n\t\t\tskin.scale9Grid = VERTICAL_MAXIMUM_TRACK_SCALE9_GRID;\n\t\t\tskin.width = this.smallControlSize;\n\t\t\tskin.height = this.wideControlSize - this.thumbSize / 2;\n\t\t\ttrack.defaultSkin = skin;\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t//-------------------------\n\t// TabBar\n\t//-------------------------\n\n\t\tprotected function setTabBarStyles(tabBar:TabBar):void\n\t\t{\n\t\t\ttabBar.distributeTabSizes = true;\n\t\t}\n\n\t\tprotected function setTabStyles(tab:ToggleButton):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.tabUpTexture);\n\t\t\tskin.selectedTexture = this.tabSelectedUpTexture;\n\t\t\tskin.setTextureForState(ButtonState.DOWN, this.tabDownTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED_AND_SELECTED, this.tabSelectedDisabledTexture);\n\t\t\tskin.scale9Grid = TAB_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.gridSize;\n\t\t\tskin.minWidth = this.controlSize;\n\t\t\tskin.minHeight = this.gridSize;\n\t\t\ttab.defaultSkin = skin;\n\n\t\t\ttab.fontStyles = this.darkFontStyles.clone();\n\t\t\ttab.disabledFontStyles = this.darkDisabledFontStyles.clone();\n\t\t\ttab.selectedFontStyles = this.selectedFontStyles.clone();\n\t\t\ttab.setFontStylesForState(ButtonState.DISABLED_AND_SELECTED, this.selectedDisabledFontStyles.clone());\n\n\t\t\ttab.paddingLeft = this.gutterSize;\n\t\t\ttab.paddingRight = this.gutterSize;\n\t\t}\n\n\t//-------------------------\n\t// TextArea\n\t//-------------------------\n\n\t\tprotected function setTextAreaStyles(textArea:TextArea):void\n\t\t{\n\t\t\tthis.setScrollerStyles(textArea);\n\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.textInputBackgroundEnabledTexture);\n\t\t\tskin.disabledTexture = this.textInputBackgroundDisabledTexture;\n\t\t\tskin.setTextureForState(TextInputState.FOCUSED, this.textInputBackgroundFocusedTexture);\n\t\t\tskin.setTextureForState(TextInputState.ERROR, this.textInputBackgroundErrorTexture);\n\t\t\tskin.scale9Grid = TEXT_INPUT_SCALE9_GRID;\n\t\t\tskin.width = this.wideControlSize;\n\t\t\tskin.height = this.wideControlSize;\n\t\t\ttextArea.backgroundSkin = skin;\n\n\t\t\ttextArea.fontStyles = this.darkScrollTextFontStyles.clone();\n\t\t\ttextArea.disabledFontStyles = this.darkScrollTextDisabledFontStyles.clone();\n\n\t\t\ttextArea.promptFontStyles = this.darkFontStyles.clone();\n\t\t\ttextArea.promptDisabledFontStyles = this.darkDisabledFontStyles.clone();\n\n\t\t\ttextArea.textEditorFactory = textAreaTextEditorFactory;\n\t\t\t\n\t\t\ttextArea.innerPadding = this.smallGutterSize;\n\t\t}\n\n\t//-------------------------\n\t// TextCallout\n\t//-------------------------\n\n\t\tprotected function setTextCalloutStyles(callout:TextCallout):void\n\t\t{\n\t\t\tthis.setCalloutStyles(callout);\n\n\t\t\tcallout.fontStyles = this.darkFontStyles.clone();\n\t\t\tcallout.disabledFontStyles = this.darkDisabledFontStyles\n\t\t}\n\n\t//-------------------------\n\t// TextInput\n\t//-------------------------\n\n\t\tprotected function setBaseTextInputStyles(input:TextInput):void\n\t\t{\n\t\t\tinput.paddingTop = this.smallGutterSize;\n\t\t\tinput.paddingRight = this.gutterSize;\n\t\t\tinput.paddingBottom = this.smallGutterSize;\n\t\t\tinput.paddingLeft = this.gutterSize;\n\t\t\tinput.gap = this.smallGutterSize;\n\t\t}\n\n\t\tprotected function setTextInputStyles(input:TextInput):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.textInputBackgroundEnabledTexture);\n\t\t\tskin.disabledTexture = this.textInputBackgroundDisabledTexture;\n\t\t\tskin.setTextureForState(TextInputState.FOCUSED, this.textInputBackgroundFocusedTexture);\n\t\t\tskin.setTextureForState(TextInputState.ERROR, this.textInputBackgroundErrorTexture);\n\t\t\tskin.scale9Grid = TEXT_INPUT_SCALE9_GRID;\n\t\t\tskin.width = this.wideControlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.wideControlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tinput.backgroundSkin = skin;\n\n\t\t\tinput.fontStyles = this.darkScrollTextFontStyles.clone();\n\t\t\tinput.disabledFontStyles = this.darkScrollTextDisabledFontStyles.clone();\n\n\t\t\tinput.promptFontStyles = this.darkFontStyles.clone();\n\t\t\tinput.promptDisabledFontStyles = this.darkDisabledFontStyles.clone();\n\n\t\t\tthis.setBaseTextInputStyles(input);\n\t\t}\n\n\t\tprotected function setSearchTextInputStyles(input:TextInput):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.searchTextInputBackgroundEnabledTexture);\n\t\t\tskin.disabledTexture = this.searchTextInputBackgroundDisabledTexture;\n\t\t\tskin.setTextureForState(TextInputState.FOCUSED, this.searchTextInputBackgroundFocusedTexture);\n\t\t\tskin.scale9Grid = SEARCH_INPUT_SCALE9_GRID;\n\t\t\tskin.width = this.wideControlSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tskin.minWidth = this.wideControlSize;\n\t\t\tskin.minHeight = this.controlSize;\n\t\t\tinput.backgroundSkin = skin;\n\n\t\t\tvar icon:Image = new Image(this.searchIconTexture);\n\t\t\tinput.defaultIcon = icon;\n\n\t\t\tinput.fontStyles = this.darkScrollTextFontStyles.clone();\n\t\t\tinput.disabledFontStyles = this.darkScrollTextDisabledFontStyles.clone();\n\n\t\t\tinput.promptFontStyles = this.darkFontStyles.clone();\n\t\t\tinput.promptDisabledFontStyles = this.darkDisabledFontStyles.clone();\n\n\t\t\tthis.setBaseTextInputStyles(input);\n\t\t}\n\n\t//-------------------------\n\t// Toast\n\t//-------------------------\n\n\t\tprotected function setToastStyles(toast:Toast):void\n\t\t{\n\t\t\tvar backgroundSkin:Quad = new Quad(1, 1, COLOR_TOAST_BACKGROUND);\n\t\t\ttoast.backgroundSkin = backgroundSkin;\n\n\t\t\ttoast.fontStyles = this.lightFontStyles.clone();\n\n\t\t\ttoast.width = this.popUpFillSize;\n\t\t\ttoast.paddingTop = this.smallGutterSize;\n\t\t\ttoast.paddingRight = this.gutterSize;\n\t\t\ttoast.paddingBottom = this.smallGutterSize;\n\t\t\ttoast.paddingLeft = this.gutterSize;\n\t\t\ttoast.gap = Number.POSITIVE_INFINITY;\n\t\t\ttoast.minGap = this.smallGutterSize;\n\t\t\ttoast.horizontalAlign = HorizontalAlign.LEFT;\n\t\t\ttoast.verticalAlign = VerticalAlign.MIDDLE;\n\t\t}\n\n\t\tprotected function setToastActionsStyles(group:ButtonGroup):void\n\t\t{\n\t\t\tgroup.direction = Direction.HORIZONTAL;\n\t\t\tgroup.gap = this.smallGutterSize;\n\t\t\tgroup.customButtonStyleName = THEME_STYLE_NAME_TOAST_ACTIONS_BUTTON;\n\t\t}\n\n\t\tprotected function setToastActionsButtonStyles(button:Button):void\n\t\t{\n\t\t\tbutton.fontStyles = this.selectedBoldFontStyles.clone();\n\t\t\tbutton.setFontStylesForState(ButtonState.DOWN, this.lightBoldFontStyles);\n\t\t}\n\n\t//-------------------------\n\t// ToggleButton\n\t//-------------------------\n\n\t\tprotected function setToggleButtonStyles(button:ToggleButton):void\n\t\t{\n\t\t\tthis.setButtonStyles(button);\n\n\t\t\tbutton.fontStyles = this.darkFontStyles.clone();\n\t\t\tbutton.disabledFontStyles = this.darkDisabledFontStyles.clone();\n\t\t\tbutton.selectedFontStyles = this.selectedFontStyles.clone();\n\t\t\tbutton.setFontStylesForState(ButtonState.DISABLED_AND_SELECTED, this.selectedDisabledFontStyles.clone());\n\t\t}\n\n\t//-------------------------\n\t// ToggleSwitch\n\t//-------------------------\n\n\t\tprotected function setToggleSwitchStyles(toggle:ToggleSwitch):void\n\t\t{\n\t\t\ttoggle.offLabelFontStyles = this.darkFontStyles.clone();\n\t\t\ttoggle.offLabelDisabledFontStyles = this.darkDisabledFontStyles.clone();\n\t\t\ttoggle.onLabelFontStyles = this.selectedFontStyles.clone();\n\t\t\ttoggle.onLabelDisabledFontStyles = this.darkDisabledFontStyles.clone();\n\n\t\t\ttoggle.trackLayoutMode = TrackLayoutMode.SPLIT;\n\t\t}\n\n\t\tprotected function setToggleSwitchOnTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.toggleSwitchOnTrackTexture);\n\t\t\tskin.disabledTexture = this.toggleSwitchOnTrackDisabledTexture;\n\t\t\tskin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.gridSize;\n\t\t\tskin.height = this.controlSize;\n\n\t\t\ttrack.defaultSkin = skin;\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setToggleSwitchOffTrackStyles(track:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.toggleSwitchOffTrackTexture);\n\t\t\tskin.disabledTexture = this.toggleSwitchOffTrackDisabledTexture;\n\t\t\tskin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.gridSize;\n\t\t\tskin.height = this.controlSize;\n\n\t\t\ttrack.defaultSkin = skin;\n\t\t\ttrack.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setHorizontalThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonUpTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledTexture);\n\t\t\tskin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.thumbSize;\n\t\t\tskin.height = this.controlSize;\n\t\t\tthumb.defaultSkin = skin;\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t\tprotected function setVerticalThumbStyles(thumb:Button):void\n\t\t{\n\t\t\tvar skin:ImageSkin = new ImageSkin(this.buttonUpTexture);\n\t\t\tskin.setTextureForState(ButtonState.DISABLED, this.buttonDisabledTexture);\n\t\t\tskin.scale9Grid = BUTTON_SCALE9_GRID;\n\t\t\tskin.width = this.controlSize;\n\t\t\tskin.height = this.thumbSize;\n\t\t\tthumb.defaultSkin = skin;\n\t\t\tthumb.hasLabelTextRenderer = false;\n\t\t}\n\n\t//-------------------------\n\t// Tree\n\t//-------------------------\n\n\t\tprotected function setTreeStyles(tree:Tree):void\n\t\t{\n\t\t\tthis.setScrollerStyles(tree);\n\t\t\ttree.backgroundSkin = new Quad(10, 10, COLOR_BACKGROUND_LIGHT);\n\t\t}\n\n\t\tprotected function setTreeItemRendererStyles(itemRenderer:DefaultTreeItemRenderer):void\n\t\t{\n\t\t\tthis.setItemRendererStyles(itemRenderer);\n\n\t\t\titemRenderer.indentation = this.treeDisclosureOpenIconTexture.width;\n\n\t\t\tvar disclosureOpenIcon:ImageSkin = new ImageSkin(this.treeDisclosureOpenIconTexture);\n\t\t\t//make sure the hit area is large enough for touch screens\n\t\t\tdisclosureOpenIcon.minTouchWidth = this.gridSize;\n\t\t\tdisclosureOpenIcon.minTouchHeight = this.gridSize;\n\t\t\titemRenderer.disclosureOpenIcon = disclosureOpenIcon;\n\n\t\t\tvar disclosureClosedIcon:ImageSkin = new ImageSkin(this.treeDisclosureClosedIconTexture);\n\t\t\tdisclosureClosedIcon.minTouchWidth = this.gridSize;\n\t\t\tdisclosureClosedIcon.minTouchHeight = this.gridSize;\n\t\t\titemRenderer.disclosureClosedIcon = disclosureClosedIcon;\n\t\t}\n\n\t}\n\n}\n"
  },
  {
    "path": "themes/TopcoatLightMobileTheme/source/feathers/themes/TopcoatLightMobileTheme.as",
    "content": "/*\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved., Marcel Piestansky\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n*/\npackage feathers.themes\n{\n\timport flash.display.Bitmap;\n\timport flash.display.BitmapData;\n\n\timport starling.textures.Texture;\n\timport starling.textures.TextureAtlas;\n\n\t/**\n\t * The \"Topcoat Light\" theme for mobile Feathers apps.\n\t *\n\t * <p>This version of the theme embeds its assets. To load assets at\n\t * runtime, see <code>TopcoatLightMobileThemeWithAssetManager</code> instead.</p>\n\t *\n\t * @see http://feathersui.com/help/theme-assets.html\n\t */\n\tpublic class TopcoatLightMobileTheme extends BaseTopcoatLightMobileTheme\n\t{\n\t\t[Embed(source=\"/../assets/images/topcoat_light_mobile.xml\", mimeType=\"application/octet-stream\")]\n\t\tprivate static const ATLAS_XML:Class;\n\t\t\n\t\t[Embed(source=\"/../assets/images/topcoat_light_mobile.png\")]\n\t\tprivate static const ATLAS_BITMAP:Class;\n\n\t\tpublic function TopcoatLightMobileTheme()\n\t\t{\n\t\t\tsuper();\n\t\t\tthis.initialize();\n\t\t}\n\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tthis.initializeTextureAtlas();\n\t\t\tsuper.initialize();\n\t\t}\n\n\t\tprotected function initializeTextureAtlas():void\n\t\t{\n\t\t\tvar atlasBitmapData:BitmapData = Bitmap(new ATLAS_BITMAP()).bitmapData;\n\t\t\tvar atlasTexture:Texture = Texture.fromBitmapData(atlasBitmapData, false, false, 2);\n\t\t\tatlasTexture.root.onRestore = onAtlasTextureRestore;\n\t\t\tatlasBitmapData.dispose();\n\t\t\tthis.atlas = new TextureAtlas(atlasTexture, XML(new ATLAS_XML()));\n\t\t}\n\n\t\tprivate function onAtlasTextureRestore():void\n\t\t{\n\t\t\tvar atlasBitmapData:BitmapData = Bitmap(new ATLAS_BITMAP()).bitmapData;\n\t\t\tthis.atlas.texture.root.uploadBitmapData(atlasBitmapData);\n\t\t\tatlasBitmapData.dispose();\n\t\t}\n\n\t}\n\n}\n"
  },
  {
    "path": "themes/TopcoatLightMobileTheme/source/feathers/themes/TopcoatLightMobileThemeWithAssetManager.as",
    "content": "/*\nCopyright 2012-2021 Bowler Hat LLC. All Rights Reserved., Marcel Piestansky\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n*/\npackage feathers.themes\n{\n\timport feathers.events.FeathersEventType;\n\n\timport starling.assets.AssetManager;\n\timport starling.core.Starling;\n\timport starling.events.Event;\n\n\t/**\n\t * @copy feathers.themes.IAsyncTheme#event:complete\n\t *\n\t * @eventType starling.events.Event.COMPLETE\n\t */\n\t[Event(name=\"complete\",type=\"starling.events.Event\")]\n\n\t/**\n\t * Dispatched when the theme's assets fail to load due to an error.\n\t *\n\t * <p>The properties of the event object have the following values:</p>\n\t * <table class=\"innertable\">\n\t * <tr><th>Property</th><th>Value</th></tr>\n\t * <tr><td><code>bubbles</code></td><td>false</td></tr>\n\t * <tr><td><code>currentTarget</code></td><td>The Object that defines the\n\t *   event listener that handles the event. For example, if you use\n\t *   <code>myButton.addEventListener()</code> to register an event listener,\n\t *   myButton is the value of the <code>currentTarget</code>.</td></tr>\n\t * <tr><td><code>data</code></td><td>The error string.</td></tr>\n\t * <tr><td><code>target</code></td><td>The Object that dispatched the event;\n\t *   it is not always the Object listening for the event. Use the\n\t *   <code>currentTarget</code> property to always access the Object\n\t *   listening for the event.</td></tr>\n\t * </table>\n\t *\n\t * @eventType feathers.events.FeathersEventType.ERROR\n\t */\n\t[Event(name=\"error\",type=\"starling.events.Event\")]\n\n\t/**\n\t * The \"Topcoat Light\" theme for mobile Feathers apps.\n\t *\n\t * <p>This version of the theme requires loading assets at runtime. To use\n\t * embedded assets, see <code>TopcoatLightMobileTheme</code> instead.</p>\n\t *\n\t * <p>To use this theme, the following files must be included when packaging\n\t * your app:</p>\n\t * <ul>\n\t *     <li>images/topcoat_light_mobile.png</li>\n\t *     <li>images/topcoat_light_mobile.xml</li>\n\t * </ul>\n\t *\n\t * @see http://feathersui.com/help/theme-assets.html\n\t */\n\tpublic class TopcoatLightMobileThemeWithAssetManager extends BaseTopcoatLightMobileTheme implements IAsyncTheme\n\t{\n\t\t/**\n\t\t * @private\n\t\t * The name of the texture atlas in the asset manager.\n\t\t */\n\t\tprotected static const ATLAS_NAME:String = \"topcoat_light_mobile\";\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected static const ATLAS_SCALE_FACTOR:int = 2;\n\n\t\t/**\n\t\t * Constructor.\n\t\t * @param assetsBasePath The root folder of the assets.\n\t\t * @param assetManager An optional pre-created AssetManager. The scaleFactor property must be equal to Starling.contentScaleFactor. To load assets with a different scale factor, use multiple AssetManager instances.\n\t\t */\n\t\tpublic function TopcoatLightMobileThemeWithAssetManager(assetsBasePath:String = \"./\", assetManager:AssetManager = null)\n\t\t{\n\t\t\tthis.loadAssets(assetsBasePath, assetManager);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t * The paths to each of the assets, relative to the base path.\n\t\t */\n\t\tprotected var assetPaths:Vector.<String> = new <String>\n\t\t[\n\t\t\t\"images/\" + ATLAS_NAME + \".xml\",\n\t\t\t\"images/\" + ATLAS_NAME + \".png\"\n\t\t];\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var assetManager:AssetManager;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected var isComplete:Boolean = false;\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride public function dispose():void\n\t\t{\n\t\t\tsuper.dispose();\n\t\t\tif(this.assetManager)\n\t\t\t{\n\t\t\t\tthis.assetManager.removeTextureAtlas(ATLAS_NAME);\n\t\t\t\tthis.assetManager = null;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @copy feathers.themes.IAsyncTheme#isCompleteForStarling()\n\t\t */\n\t\tpublic function isCompleteForStarling(starling:Starling):Boolean\n\t\t{\n\t\t\treturn this.isComplete;\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\toverride protected function initialize():void\n\t\t{\n\t\t\tthis.initializeTextureAtlas();\n\t\t\tsuper.initialize();\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function initializeTextureAtlas():void\n\t\t{\n\t\t\tthis.atlas = this.assetManager.getTextureAtlas(ATLAS_NAME);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function loadAssets(assetsBasePath:String, assetManager:AssetManager):void\n\t\t{\n\t\t\tvar oldScaleFactor:Number = -1;\n\t\t\tif(assetManager)\n\t\t\t{\n\t\t\t\toldScaleFactor = assetManager.textureOptions.scale;\n\t\t\t\tassetManager.textureOptions.scale = ATLAS_SCALE_FACTOR;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tassetManager = new AssetManager(ATLAS_SCALE_FACTOR);\n\t\t\t}\n\t\t\tthis.assetManager = assetManager;\n\t\t\t//add a trailing slash, if needed\n\t\t\tif(assetsBasePath.lastIndexOf(\"/\") != assetsBasePath.length - 1)\n\t\t\t{\n\t\t\t\tassetsBasePath += \"/\";\n\t\t\t}\n\t\t\tvar assetPaths:Vector.<String> = this.assetPaths;\n\t\t\tvar assetCount:int = assetPaths.length;\n\t\t\tfor(var i:int = 0; i < assetCount; i++)\n\t\t\t{\n\t\t\t\tvar asset:String = assetPaths[i];\n\t\t\t\tthis.assetManager.enqueue(assetsBasePath + asset);\n\t\t\t}\n\t\t\tif(oldScaleFactor != -1)\n\t\t\t{\n\t\t\t\t//restore the old scale factor, just in case\n\t\t\t\tthis.assetManager.textureOptions.scale = oldScaleFactor;\n\t\t\t}\n\t\t\tthis.assetManager.loadQueue(assetManager_onComplete, assetManager_onError);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function assetManager_onComplete():void\n\t\t{\n\t\t\tthis.initialize();\n\t\t\tthis.isComplete = true;\n\t\t\tthis.dispatchEventWith(Event.COMPLETE, false, Starling.current);\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t */\n\t\tprotected function assetManager_onError(error:String):void\n\t\t{\n\t\t\tthis.dispatchEventWith(FeathersEventType.ERROR, false, error);\n\t\t}\n\t}\n}\n"
  }
]